FLUTTER ECOSYSTEM

zuvola/flutter_grid_button

将按钮排列成网格的 Flutter 小部件。

flutter_grid_button 项目封面
Stars
12
Forks
5
最近推送(UTC)
2026年3月4日
项目状态
未归档
zuvola GitHub avatar
GITHUB User

zuvola ↗

语言C++DartCMakeHTMLSwiftCKotlinObjective-C

此仓库发布的插件

使用的依赖

依赖清单 3 项
  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}
  • flutter_lints开发依赖^1.0.0

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

flutter_grid_button

Flutter widget that arrange buttons in a grid. It is useful for making a number pad, calculator, and so on.

pub package

https://github.com/zuvola/flutter_grid_button/blob/master/example/screenshot.png?raw=true

Getting Started

To use this plugin, add flutter_grid_button as a dependency in your pubspec.yaml file.

dependencies:
 flutter_grid_button: 

Import the library in your file.

import 'package:flutter_grid_button/flutter_grid_button.dart';

See the example directory for a complete sample app using GridButton. Or use the GridButton like below.

GridButton(
  onPressed: (String value) {
    /*...*/
  },
  items: [
    [
      GridButtonItem(title: "1"),
      GridButtonItem(child: Text("2")),
      GridButtonItem(title: "3", flex: 2),
    ],
    [
      GridButtonItem(title: "a", value: "100", longPressValue: "long"),
      GridButtonItem(title: "b", color: Colors.lightBlue)
    ],
  ],
)