搜索插件、代码仓与 APP 分类

插件详情v1.0.9

flutter_super_grid

带有网格视图的 Flutter 包:SimpleGridView 用于基本网格,FlatGridView 用于高级选项,SectionGridView 用于分段网格和额外样式。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
73
喜欢数
27
Pub 分数
150

安装插件

flutter pub add flutter_super_grid

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Flutter Super Grid 是一个功能强大的包,为 Flutter 应用提供多种网格视图实现。它包含 SimpleGridView 用于简单布局,FlatGridView 提供增强的自定义和高级功能,以及 SectionGridView 用于将内容组织成带有额外样式选项的章节。该包专为跨平台使用而设计,支持 Android、iOS、Web、macOS、Windows 和 Linux。该包简化了复杂的网格结构,同时在各种设备上保持灵活性和性能。

适合场景

  • 构建响应式产品网格
  • 创建带标题的分段列表
  • 设计可自定义的仪表板布局
  • 实现动态网格界面
  • 显示分组的媒体集合
  • 通过样式化网格区域增强用户界面

主要特点

  • 多种网格类型:简单、扁平和分段
  • 高级自定义选项
  • 支持部分标题和样式
  • 跨平台兼容性
  • 轻量且高效
  • 通过 pub add 轻松集成

适合对象

  • 需要灵活网格布局的开发者
  • 具有分类或分组内容的应用程序
  • 需要视觉组织的UI密集型应用
  • 针对多个平台的项目
  • 注重代码简洁性和可重用性的团队

使用建议

  • 需要了解 Flutter 布局原理
  • 复杂设计可能需要额外的样式
  • 除了基本用法外,文档有限
  • 最适合静态或半动态数据结构
  • 不太适合高度交互或动画网格

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

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

Configuration Type Default Value Description
data List - The data to display in the grid (SimpleGridView and FlatGridView).
sections List - The sections to display in the grid (SectionGridView only).
renderItem Function - Function that renders each item in the grid.
onNewItemAdded Function or null null Callback when a new item is added (SectionGridView and FlatGridView).
onPressed Function or null null Callback when an item is pressed (SectionGridView and FlatGridView).
itemsPerRow int 0 Number of items per row or column (applies when isFixed is false).
itemSize double 120.0 The size of items in the main axis.
minItemDimension double 120.0 Minimum dimension (width or height) of each grid item (applies when isFixed is false).
verticalSpacing double 10 Vertical spacing between items.
horizontalSpacing double 10 Horizontal spacing between items.
isFixed bool false Whether the grid item size is fixed.
horizontal bool false Whether the grid view is horizontal.
invertedRow bool false Whether to invert the row.
adjustGridToStyles bool false Whether to adjust the grid to styles.
style SectionGridViewStyle - Style configuration for the grid view.
itemContainerStyle ContainerStyle ContainerStyle() Style for the container of each item (FlatGridView only) (applies when isFixed is false).
footerWidget Widget SizedBox Widget to be displayed as a footer (SectionGridView and FlatGridView).
gridViewHeight double 300 Height of the gridview.
gridViewWidth double double.infinity Width of the gridview.
containerWidth double double.infinity Width of the main container (applies when it's greater than gridViewWidth).
containerHeight double 300 Height of the main container (applies when it's greater than gridViewHeight).
physics ScrollPhysics or null null The 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.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。