uni_selected_button 0.0.3 copy "uni_selected_button: ^0.0.3" to clipboard
uni_selected_button: ^0.0.3 copied to clipboard

Group of buttons where only one button can be selected at a time.

Overview #

uni_selected_button provides a group of buttons where only one button can be selected at a time.

Getting started #

Add dependency #

Add the following line to your pubspec.yaml file:

dependencies:
  uni_selected_button: ^0.0.1

Usage #

  1. Import the package in your Dart file
import 'package:uni_selected_button/uni_selected_button.dart';
  1. Use UniSelectedButton widget, and provide a list of SelectedButton widgets as children.
UniButtonGroup(
  children: [
    SelectedButton(
        label: const Text('Light'),
        icon: const Icon(Icons.light_mode),
        value: ThemeMode.light,
        groupValue: _themeMode,
        onPressed: (value) => {},
    ),
    SelectedButton(
        label: const Text('Dark'),
        icon: const Icon(Icons.dark_mode),
        value: ThemeMode.dart,
        groupValue: _themeMode,
        onPressed: (value) => {},
    ),
    SelectedButton(
        label: const Text('System'),
        icon: const Icon(Icons.laptop),
        value: ThemeMode.system,
        groupValue: _themeMode,
        onPressed: (value) => {},
    ),
  ],
),

Demo #

Demo example

3
likes
150
pub points
40%
popularity

Publisher

verified publisherhuynq.dev

Group of buttons where only one button can be selected at a time.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on uni_selected_button