eazigrid 0.0.1 eazigrid: ^0.0.1 copied to clipboard
Easy dynamic flutter row to list/grid widget. This widget arranges children as a row and or grid depending on the constraints of it's parent.
Easy dynamic Flutter row to list/grid. Starts out as a row and resizes to a grid - scaling to dimensions of parent widget.
Features #
- Width of parent widget must be explicitly defined.
- Height automatically shrinks or expands to wrap parent widget if height of parent is left unspecified.
- Children can be made vertically scrollable if the parameter
isScrollable
is set to true.
Getting started #
Add package dependency to pubspec.yaml.
dependencies:
flutter:
sdk: flutter
...
eazigrid: ^[latest_version]
Resolve overflow issues for automated testing by adding the following line to the main method in the main flutter file as shown in the example
EaziGridFlowHandler.handleEaziError();
Usage #
Declare EaziGrid
in a parent widget with width != infinty (See example)
EaziGrid(
isScrollable: true,
horizontalAlignment: EaziAlignment.start,
children: [
for(int i=0; i<=widget.totalItems; i++)
TestGridItem(itemIndex: i)
])
Widget Parameters
isScrollable
: makes resulting grid vertically scrollable if set to true.horizontalAlignment
: aligns children in each row by any of the options defined inEaziAlignment
.verticalAlignment
: aligns grid rows vertically by any of the options in definedEaziAlignment
.children
: all children must be widgets with explicitly defined heights and widths.
enum EaziAlignment { start, center, end }
Additional information #
Feel free to open issues for feature requests. If you'd like to contribute, send a PR.
TODO: 🤔 HAVE FUN 😬