Flutter widget to create a group of buttons fast

Overview

Flutter widget to create a group of buttons fast 🚀

Included Radio and CheckBox buttons models with custom groping types 🤤
Show some ❤️ and star the repo to support the project!


Pub Star on Github License: MIT

Pub likes Pub popularity Pub points

Image Image Image

Getting Started

Follow these steps to use this package

Add dependency

dependencies:
  group_button: ^3.3.1 #latest version

Add import package

import 'package:group_button/group_button.dart';

Easy to use

Simple example of use GroupButton
Put this code in your project at an screen and learn how it works 😊

GroupButton(
    isRadio: false,
    spacing: 10,
    onSelected: (index, isSelected) => print('$index button is selected'),
    buttons: ["12:00", "13:00", "14:30", "18:00", "19:00", "21:40"],
)

Customize

In order to customize your buttons inside GroupButton you can use code below
This code includes all the fields used in GroupButton

GroupButton(
    spacing: 5,
    isRadio: false,
    direction: Axis.horizontal,
    onSelected: (index, isSelected) =>
          print('$index button is ${isSelected ? 'selected' : 'unselected'}'),
    buttons: ["Dart","Kotlin","Java","Swift","Objective-C","Python","JS"],
    selectedButtons: [0, 1], /// [List<int>] after 2.2.1 version 
    selectedTextStyle: TextStyle(
        fontWeight: FontWeight.w600,
        fontSize: 16,
        color: Colors.red,
    ),
    unselectedTextStyle: TextStyle(
        fontWeight: FontWeight.w600,
        fontSize: 14,
        color: Colors.grey[600],
    ),
    selectedColor: Colors.white,
    unselectedColor: Colors.grey[300],
    selectedBorderColor: Colors.red,
    unselectedBorderColor: Colors.grey[500],
    borderRadius: BorderRadius.circular(5.0),
    selectedShadow: <BoxShadow>[BoxShadow(color: Colors.transparent)],
    unselectedShadow: <BoxShadow>[BoxShadow(color: Colors.transparent)],
)

Examples

You can check more examples of using this package here


Attributes

Attribute Annotation
buttons [String] list that will be displayed on buttons in the [GroupButton]
selectedButtons [List] that will be set initial selected buttons in the [GroupButton] when [isRadio] is false
selectedButton [int] that will be set initial selected button in the [GroupButton] when [isRadio] is true
onSelected Callback [Function] works by clicking on a group element
Return int [index] of selected button and [isSelected] if [isRadio] = false
isRadio bool variable for switching between modes [ChackBox] and [Radio]
if the [isRadio] = true, only one button can be selected
if the [isRadio] = false, you can select several at once
direction The direction of arrangement of the buttons in [GroupButton]
spacing The spacing between buttons inside [GroupButton]
runSpacing When [groupingType] is [GroupingType.wrap] this field sets Wrap [runSpacing]
selectedTextStyle [TextStyle] of text of selected button(s)
unselectedTextStyle [TextStyle] of text of unselected buttons
selectedColor background [Color] of selected button(s)
unselectedColor background [Color] of unselected buttons
selectedBorderColor border [Color] of selected button(s)
unselectedBorderColor border [Color] of unselected buttons
borderRadius [BorderRadius] of buttons
How much the button will be rounded
selectedShadow list of selected button(s) [BoxShadow]
unselectedShadow list of unselected buttons [BoxShadow]
groupingType The field is responsible for how the buttons will be grouped [GroupingType]
mainGroupAlignment How the buttons should be placed in the main axis in a layout [MainGroupAlignment]
crossGroupAlignment How the buttons should be placed along the cross axis in a layout [CrossGroupAlignment]
groupRunAlignment How the button runs themselves should be placed the cross axis in a layout [GroupRunAlignment]
textAlign The buttons text alignment [GroupButton]
textPadding The inner padding of buttons [GroupButton]
alignment [AlignmentGeometry] Text position inside the buttons in case [buttonWidth] or [buttonHeight] defined
elevation [double] The buttons' elevation
disabledButtons [int] button ids that are disabled

Thanks to all contributors of this package


For help getting started with 😍 Flutter, view online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

You might also like...

Magpie-fly is a component library produced by 58 Group, which encapsulates a variety of common components to meet the needs of developers

[toc] magpie_fly Magpie-fly 是58集体出品组件库,封装了多种常用组件,以满足开发者需求。(Magpie-fly is a component library produced by 58 Group, which encapsulates a variety of com

Mar 18, 2022

Call Kit is a prebuilt feature-rich call component, which enables you to build one-on-one and group voice/video calls into your app with only a few lines of code.

Call Kit is a prebuilt feature-rich call component, which enables you to build one-on-one and group voice/video calls into your app with only a few lines of code.

Call Kit (ZegoUIKitPrebuiltCall) Call Kit is a prebuilt feature-rich call component, which enables you to build one-on-one and group voice/video calls

Dec 26, 2022

QR.Flutter is a Flutter library for simple and fast QR code rendering via a Widget or custom painter.

QR.Flutter is a Flutter library for simple and fast QR code rendering via a Widget or custom painter.

QR.Flutter is a Flutter library for simple and fast QR code rendering via a Widget or custom painter. Need help? Please do not submit an issue for a "

Jan 8, 2023

Flutter-sorted-chips-row - Flutter library for rendering a row of Material "Chip" buttons that gets sorted according to the given function

Flutter-sorted-chips-row - Flutter library for rendering a row of Material

sorted_chips_row A Flutter Widget displaying a row of Material Chips, sorted according to the provided comparison function. How to use Adding dependen

Jul 29, 2021

Implements GTK Widgets, themes and titlebar buttons in Flutter. Based on the GNOME HIG

Implements GTK Widgets, themes and titlebar buttons in Flutter. Based on the GNOME HIG

GTK ❤️ Flutter Unofficial implementation of GTK Widgets, themes and titlebar buttons in Flutter. Based on the GNOME Human Interface Guidelines. Featur

Dec 26, 2022

Example of floating buttons using dialogs on Flutter

Example of floating buttons using dialogs on Flutter

Flutter example using floating buttons and dialogs This is a simple example showing floating buttons above a UI. These a shown via the showDialog() fu

Mar 13, 2020

A Flutter package for generating sign in buttons for different social media accounts.

A Flutter package for generating sign in buttons for different social media accounts.

Sign In Button A Flutter plugin for generating sign in buttons for different social media accounts. Getting Started You must add the library as a depe

Dec 8, 2022

A set of Flutter widgets that makes grouping Checkboxes and Radio Buttons much easier!

A set of Flutter widgets that makes grouping Checkboxes and Radio Buttons much easier!

grouped_buttons A set of Flutter widgets that makes grouping Checkboxes and Radio Buttons much easier! Installing Add the following to your pubspec.ya

Dec 28, 2022

Flutter plugin for detecting all hardware buttons

Flutter plugin for detecting all hardware buttons

DEPRECATED This plugin is deprecated :( We're no longer able to maintain it. hardware_buttons A Flutter plugin for iOS and Android for detecting vario

Aug 21, 2021
Owner
NodeMov
NodeMov
Create dart data classes easily, fast and without writing boilerplate or running code generation.

Dart Data Class Generator Create dart data classes easily, fast and without writing boilerplate or running code generation. Features The generator can

null 186 Feb 28, 2022
A cross-platform Flutter widget for displaying websites. Optional navigation buttons.

Overview Gives you a cross-platform Flutter widget for displaying websites and other web content. Licensed under the Apache License 2.0. Links Github

Dint 11 Oct 23, 2022
Flutter widget that arrange buttons in a grid.

flutter_grid_button Flutter widget that arrange buttons in a grid. It is useful for making a number pad, calculator, and so on. Getting Started To use

zuvola 11 Jan 10, 2022
Flutter widget library containing buttons for authenticating with popular social networks: Apple, Google, Facebook, Twitter and Microsoft.

Flutter Auth Buttons This library is now in maintenance mode I'm no longer actively using Flutter and don't have the time to keep this library maintai

Duncan Jones 115 Nov 3, 2022
Cross Platform mobile application built using Flutter for a group project

splitz A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this i

Utkarsh Omer 0 Jul 30, 2022
Custom flutter testing CLI tool for individual test runs and group testing

fluttertest Custom flutter testing CLI tool for inidividual test runs or group testing Overview Flutter is a great framework which has helps developer

vi_mi 15 Nov 6, 2022
Chat app in Flutter Firebase with Group Based Functionalities (Email/Password Auth)

group_chatapp_flutter_firebase Group based chat app in Flutter and Firebase with Cloudfirestore, Firebase Auth and StreamBuilders ?? Overview Welcome

BackSlash Flutter 32 Jan 9, 2023
Group Intern Project: All Things Charmaine

allthingscharmaine A new Flutter application. . . . . .. . . . . . . . Getting Started ASSETS: https://1drv.ms/u/s!AnbxnB5ugF0ohrM89fJXIqFf8g-q9A?e=ZJ

OLUWATOMISIN ESAN 2 Mar 19, 2020
a small app with a collection to WhatsApp group links

linki A community based app for links to social media groups. Intro Linki is a simple app that shows an interactive list of links to social media grou

Sean 11 Sep 19, 2021
A ListView that allows you to group list items and support headers like iOS UITableView section.

GroupListView package for Flutter. A ListView that allows you to group list items and support headers like iOS UITableView section. Features List Item

Daniel Ioannou 73 Nov 21, 2022