mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
opt.: pve dashboard (#307)
This commit is contained in:
25
lib/view/widget/row.dart
Normal file
25
lib/view/widget/row.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
final class AvgWidthRow extends StatelessWidget {
|
||||
final List<Widget> children;
|
||||
final double? width;
|
||||
final double padding;
|
||||
|
||||
const AvgWidthRow({
|
||||
super.key,
|
||||
required this.children,
|
||||
this.width,
|
||||
this.padding = 0,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final width =
|
||||
((this.width ?? MediaQuery.of(context).size.width) - padding) /
|
||||
children.length;
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: children.map((e) => SizedBox(width: width, child: e)).toList(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user