Easy dynamic Flutter row to list/grid. Starts out as a row and resizes to a grid - scaling to dimensions of parent widget.
- 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.
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();
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)
])
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 }
Feel free to open issues for feature requests. If you'd like to contribute, send a PR.
TODO: 🤔 HAVE FUN 😬