custom_radio_grouped_button

自定义 Flutter 小部件,使复选框和单选按钮更加简洁易用。

安装

将以下内容添加到您的 pubspec.yaml 文件中

dependencies:
  custom_radio_grouped_button: any

创建单选按钮

CustomRadioButton(
buttonColor: Theme.of(context).canvasColor,
buttonLables: [
   "Student",
   "Parent/Teacher",
  ],
buttonValues: [
   "STUDENT",
   "TEACHER",
  ],
radioButtonValue: (value) => print(value),
selectedColor: Theme.of(context).accentColor,
);

创建分组按钮

CustomCheckBoxGroup(
buttonColor: Theme.of(context).canvasColor,
buttonLables: [
  "Monday",
  "Tuesday",
  "Wednesday",
  "Thursday",
],
buttonValuesList: [
  "Monday",
  "Tuesday",
  "Wednesday",
  "Thursday",
],
checkBoxButtonValues: (values) => print(values),
defaultSelected: "Monday",
horizontal: true,
width: 120,
selectedColor: Theme.o.accentColor,
padding: 5,
);

截图

RadioButton

GroupButton

GitHub

https://github.com/ketanchoyal/custom_radio_grouped_button