smart_grid_view_nls 0.2.2 copy "smart_grid_view_nls: ^0.2.2" to clipboard
smart_grid_view_nls: ^0.2.2 copied to clipboard

A responsive grid view that changes it's cross axis child count based on the available horizontal size.

smart_grid_view #

A responsive grid view that changes it's cross axis child count based on the available horizontal size.

This widget is great for creating responsive designs as the sized of tiles stays about the same across different screen sizes.

How does it work #

Using the width of tiles, SmartGridview will calculate the crossAxisCount for the underlying GridView with maxWidth ~/ tileWidth.

The tileHeight is used with tileWidth to calculate gridChildRatio.

Example #

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Example')),
        body: SmartGridView(
          tileWidth: 128,
          tileHeight: 168,
          children: List.generate(80, (index) => Card(
            child: GridTile(
              child: Text('tile #$index'),
            ),
          )),
        ),
      ),
    );
  }
}
copied to clipboard
Result

2
likes
140
points
53
downloads

Publisher

unverified uploader

Weekly Downloads

2024.07.10 - 2025.01.22

A responsive grid view that changes it's cross axis child count based on the available horizontal size.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on smart_grid_view_nls