adaptive_grid 1.0.4 copy "adaptive_grid: ^1.0.4" to clipboard
adaptive_grid: ^1.0.4 copied to clipboard

A lightweight Flutter package that creates fully responsive, dynamic grids.

adaptive_grid #

A lightweight Flutter widget that turns a list of widgets into a responsive grid layout using flutter_layout_grid. It automatically adjusts the number of columns based on screen width, a minimum item width, and configurable spacing.

Supports both regular and sliver-based grids out of the box.


πŸ‘€ Preview #

Sample 1

Sample 2


✨ Features #

  • Fully responsive layout using minimumItemWidth
  • Auto-calculated column count and row sizes
  • Configurable horizontalSpacing and verticalSpacing
  • Optional SliverToBoxAdapter support via .sliver constructor
  • Built on top of the powerful flutter_layout_grid

πŸš€ Getting Started #

Add this to your pubspec.yaml:

dependencies:
  adaptive_grid:

Import it in your Dart code:

import 'package:adaptive_grid/adaptive_grid.dart';

πŸ“¦ Usage #

Regular grid #

AdaptiveGrid(
  itemCount: items.length,
  minimumItemWidth: 200,
  horizontalSpacing: 16,
  verticalSpacing: 24,
  itemBuilder: (context, index) => ItemCard(data: items[index]),
)

Sliver grid (inside a CustomScrollView) #

CustomScrollView(
  slivers: [
    AdaptiveGrid.sliver(
      itemCount: items.length,
      minimumItemWidth: 250,
      horizontalSpacing: 16,
      verticalSpacing: 24,
      itembBilder: (context, index) => ItemCard(data: items[index]),
    ),
  ],
)

πŸ“„ License #

This project is licensed under the MIT License. See the LICENSE file for details.

πŸ™Œ Contributing #

Pull requests and issues are welcome! Feel free to suggest improvements or features.

3
likes
160
points
22
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight Flutter package that creates fully responsive, dynamic grids.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_layout_grid

More

Packages that depend on adaptive_grid