FLUTTER ECOSYSTEM

zfnadia/grouped-checkbox

一个 Flutter 包,可轻松在 Flutter 项目中以不同样式分组复选框。

分组复选框 项目封面
Stars
7
Forks
8
最近推送(UTC)
2024年1月9日
项目状态
未归档
Nadia Ferdoush GitHub avatar
GITHUB User

Nadia Ferdoush ↗

Hakuna Matata

Toronto, Ontario
语言DartSwiftDockerfileKotlinObjective-C

此仓库发布的插件

使用的依赖

依赖清单 2 项
  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}

原始 README

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

展开 / 收起项目 README

Grouped Checkbox Widget for Flutter

pub package

Overview

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.

Features

  • Supports generic data types.
  • Vertical, horizontal, and wrap orientations.
  • Disabled state support.
  • Callbacks for state changes.

Installation

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

Usage

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

dependencies: grouped_checkbox: 2.0.0
Example
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)),
    )