v2.0.0grouped_checkbox
一個用於在 Flutter 項目中輕鬆以不同樣式分組複選框的套件。
11喜歡 78近 30 天下載140Pub 分數
AndroidiOSWebmacOSWindowsLinux
一個 Flutter 套件,可輕鬆在 Flutter 專案中以不同樣式分組複選方塊。
{"sdk":"flutter"}{"sdk":"flutter"}以下為英文專案原文快照,最新內容請造訪 GitHub。
The GroupedCheckbox widget enables displaying a list of checkboxes in various orientations and styles. It's designed for flexibility, supporting generic types, and offers customizable options.
Add grouped_checkbox to your Flutter project's dependencies.
https://raw.githubusercontent.com/zfnadia/grouped-checkbox/master/screenshots/one.jpg https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExMHE3dTJxeTY4MjFyOWNxODYxazZoYzBueGJsNWVqbXk0Yjlicmd0aSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/rCxjnhgA34BFo76lxt/giphy.gif
To use this plugin, add grouped_checkbox as a dependency in your pubspec.yaml file.
dependencies: grouped_checkbox: 2.0.0
import 'package:grouped_checkbox/grouped_checkbox.dart';
final List<ColorItem> allItemList = [
ColorItem('Red', Colors.red),
ColorItem('Green', Colors.green),
ColorItem('Blue', Colors.blue),
ColorItem('Yellow', Colors.yellow),
ColorItem('Black', Colors.black),
ColorItem('Violet', Colors.purple)
];
class ColorItem {
String name;
Color color;
ColorItem(this.name, this.color);
}
GroupedCheckbox<ColorItem>(
itemList: allItemList,
checkedItemList: selectedItems,
disabled: disabledItems,
onChanged: (itemList) {
updateFunction(itemList!);
},
orientation: orientation,
checkColor: Colors.purpleAccent,
activeColor: Colors.lightBlue,
itemWidgetBuilder: (item) => Text(item.name, style: TextStyle(color: item.color)),
)