flutter_grid_button
Flutter 组件,用于在网格中排列按钮。它适用于制作数字键盘、计算器等。

入门
要使用此插件,请在您的 pubspec.yaml 文件中添加 flutter_grid_button 作为 依赖项。
dependencies:
flutter_grid_button:
在您的文件中导入库。
import 'package:flutter_grid_button/flutter_grid_button.dart';
请参阅 example 目录,获取使用 GridButton 的完整示例应用。
或者像下面这样使用 GridButton。
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)
],
],
)