Spaces:
Configuration error
Configuration error
File size: 1,079 Bytes
75d6016 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | import 'package:flutter/material.dart';
class AppLayoutBuiderWidget extends StatelessWidget {
final bool? isColor;
final int sections;
final double width;
const AppLayoutBuiderWidget(
{Key? key, this.isColor, required this.sections, this.width = 3})
: super(key: key);
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return Flex(
direction: Axis.horizontal,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: List.generate(
(constraints.constrainWidth() / 6).floor(),
(index) => SizedBox(
width: 1,
height: 1,
child: DecoratedBox(
decoration: BoxDecoration(
color: isColor == null
? Colors.white
: Colors.grey.shade300),
),
),
));
},
);
}
}
|