搜尋套件、儲存庫與 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.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。