flutter_super_grid 1.0.9

SDKflutter
Platformandroidioswindowslinuxmacosweb

Flutter package with grid views: SimpleGridView for basic grids, FlatGridView for advanced options, and SectionGridView for sectioned grids and addtional styling.

Flutter Super Grid

Pub

A customizable Flutter package for displaying grid views of sections.

Example App

Installation

Add the following to your pubspec.yaml file:

dependencies:
  flutter_super_grid: ^1.0.9

Then, run:

$ flutter pub get

Features

  • Customizable grid view with sections and various configuration options.
  • Support for item tap callbacks with section and item indices.
  • Option to invert the row and display the grid horizontally.
  • Section titles with customizable styling and alignment.

SectionGridView

Example SectionGrid

Usage

import 'package:flutter_super_grid/flutter_super_grid.dart';

SectionGridView(
  sections: yourSectionsList,
  renderItem: (itemData) {
    // Customize how each item is rendered
    return YourCustomItemWidget(itemData);
  },
  itemsPerRow: 3,
  // ... (See Configuration Table below)
)

FlatGridView

Example FlatGrid

Usage

import 'package:flutter_super_grid/flutter_super_grid.dart';

FlatGridView(
  data: yourDataList,
  renderItem: (itemData) {
    // Customize how each item is rendered
    return YourCustomItemWidget(itemData);
  },
  itemsPerRow: 3,
  // ... (See Configuration Table below)
)

SimpleGridView

Example SimpleGrid

Usage

import 'package:flutter_super_grid/flutter_super_grid.dart';

SimpleGridView(
  data: yourDataList,
  renderItem: (itemData) {
    // Customize how each item is rendered
    return YourCustomItemWidget(itemData);
  },
  // ... (See Configuration Table below)
)

Configuration Table

ConfigurationTypeDefault ValueDescription
dataList-The data to display in the grid (SimpleGridView and FlatGridView).
sectionsList-The sections to display in the grid (SectionGridView only).
renderItemFunction-Function that renders each item in the grid.
onNewItemAddedFunction or nullnullCallback when a new item is added (SectionGridView and FlatGridView).
onPressedFunction or nullnullCallback when an item is pressed (SectionGridView and FlatGridView).
itemsPerRowint0Number of items per row or column (applies when isFixed is false).
itemSizedouble120.0The size of items in the main axis.
minItemDimensiondouble120.0Minimum dimension (width or height) of each grid item (applies when isFixed is false).
verticalSpacingdouble10Vertical spacing between items.
horizontalSpacingdouble10Horizontal spacing between items.
isFixedboolfalseWhether the grid item size is fixed.
horizontalboolfalseWhether the grid view is horizontal.
invertedRowboolfalseWhether to invert the row.
adjustGridToStylesboolfalseWhether to adjust the grid to styles.
styleSectionGridViewStyle-Style configuration for the grid view.
itemContainerStyleContainerStyleContainerStyle()Style for the container of each item (FlatGridView only) (applies when isFixed is false).
footerWidgetWidgetSizedBoxWidget to be displayed as a footer (SectionGridView and FlatGridView).
gridViewHeightdouble300Height of the gridview.
gridViewWidthdoubledouble.infinityWidth of the gridview.
containerWidthdoubledouble.infinityWidth of the main container (applies when it's greater than gridViewWidth).
containerHeightdouble300Height of the main container (applies when it's greater than gridViewHeight).
physicsScrollPhysics or nullnullThe physics of the scroll view.

Documentation

For detailed documentation, see API Documentation.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Issues and Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.

If you fixed a bug or implemented a feature, please send a pull request.