Search packages, repositories and app categories

custom_radio_grouped_button cover
Package detailsv2.3.0

custom_radio_grouped_button

Custom Radio Buttons and Grouped Check Box Button

AndroidiOSWebmacOSWindowsLinux
30-day downloads
1.2K
Likes
156
Pub points
140

Install package

flutter pub add custom_radio_grouped_button

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package that provides customizable radio buttons and grouped checkbox buttons with support for multiple platforms. It allows developers to create visually distinct and interactive selection components, ideal for forms and user preferences. The package offers flexible styling, easy integration, and responsive behavior across Android, iOS, Web, macOS, Windows, and Linux. It enhances UI consistency while maintaining simplicity in implementation.

Use cases

  • Form inputs with single selection
  • User preference settings
  • Survey or quiz interfaces
  • Customizable UI components
  • Multi-platform applications

Key features

  • Customizable button styles
  • Grouped selection logic
  • Support for both radio and checkbox modes
  • Responsive design across platforms
  • Easy integration with existing Flutter projects

Suitable for

  • Developers building forms
  • UI designers seeking custom controls
  • Cross-platform app creators
  • Projects requiring interactive selection widgets

Considerations

  • Requires manual handling of selection state
  • Limited built-in validation
  • May need additional styling for complex layouts
  • Not optimized for very large option lists
  • Depends on external dependencies for advanced features

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

custom_radio_grouped_button

Pub

Custom Radio Buttons and Grouped Check Box Button

Custom Flutter widgets that makes Checkbox and Radio Buttons much cleaner and easier

Installing

Add the following to your pubspec.yaml file:

dependencies:
  custom_radio_grouped_button: any

Creating Radio Button

CustomRadioButton(
  elevation: 0,
  absoluteZeroSpacing: true,
  unSelectedColor: Theme.of(context).canvasColor,
  buttonLables: [
    'Student',
    'Parent',
    'Teacher',
  ],
  buttonValues: [
    "STUDENT",
    "PARENT",
    "TEACHER",
  ],
  buttonTextStyle: ButtonTextStyle(
      selectedColor: Colors.white,
      unSelectedColor: Colors.black,
      textStyle: TextStyle(fontSize: 16)),
  radioButtonValue: (value) {
    print(value);
  },
  selectedColor: Theme.of(context).accentColor,
),

Creating Grouped Button

CustomCheckBoxGroup(
  buttonTextStyle: ButtonTextStyle(
    selectedColor: Colors.red,
    unSelectedColor: Colors.orange,
    textStyle: TextStyle(
      fontSize: 16,
    ),
    selectedTextStyle: TextStyle(
      fontSize: 20,
      fontWeight: FontWeight.w700,
    ),
  ),
  unSelectedColor: Theme.of(context).canvasColor,
  buttonLables: [
    "M",
    "T",
    "W",
    "T",
    "F",
    "S",
    "S",
  ],
  buttonValuesList: [
    "Monday",
    "Tuesday",
    "Wednesday",
    "Thursday",
    "Friday",
    "Saturday",
    "Sunday",
  ],
  checkBoxButtonValues: (values) {
    print(values);
  },
  spacing: 0,
  defaultSelected: "Monday",
  horizontal: false,
  enableButtonWrap: false,
  width: 40,
  absoluteZeroSpacing: false,
  selectedColor: Theme.of(context).accentColor,
  padding: 10, 
);

Changing values Programiically

You can acces the widget's state using Key now

Example: Create a key for the CustomRadioButton widget

final key = new GlobalKey<CustomRadioButtonState<T>>();

now to change the value of the widget pass the value to the selectButton method

key.currentState.selectButton(<value>);

Similarly for the CustomCheckBoxGroup widget

final key = new GlobalKey<CustomCheckBoxGroupState<T>>();

key.currentState.selectButton(<value>);

Screenshots

Grouped Button Grouped Button

Categories

Source repository

Projects using this package

No data available yet.