dynamic_button 0.1.0 copy "dynamic_button: ^0.1.0" to clipboard
dynamic_button: ^0.1.0 copied to clipboard

A production-ready Flutter UI library for building customizable buttons, chips, segmented controls, filter buttons, and selectable components with animations, themes, and generic item support.

Dynamic Button #

dynamic_button is a customizable button widget for Flutter that allows you to create dynamic and interactive buttons with various design and behavior options. This widget supports dynamic lists, customizable borders, colors, text styles, and selectable states using checkboxes.

Features #

  • Customizable Background Color: Set the button's background color with the color property.
  • Adjustable Border: Define border color and width using borderColor and border properties.
  • Rounded Corners: Customize the border radius to achieve rounded corners with the radius property.
  • Elevation: Apply elevation to give the button a raised effect with the elevation property.
  • Flexible Height: Specify the height for the button using the height property.
  • Dynamic List of Buttons: Generate a horizontal list of buttons based on the provided list of strings via the list property.
  • Selectable Buttons: Integrate checkboxes into the buttons to allow selection.
  • Custom Text Style: Use the titleStyle property to define the font size, weight, and color of the button labels.

import 'package:flutter/material.dart';
import 'package:dynamic_button/dynamic_button.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('DynamicButton Example')),
        body: Center(
          child: DynamicButton(
            list: ['Option 1', 'Option 2', 'Option 3'],
            color: Colors.blue,
            borderColor: Colors.blueAccent,
            border: 2,
            radius: 12,
            elevation: 5,
            height: 50,
            labelStyle: TextStyle(
              fontSize: 14,
              color: Colors.white,
            ),
            onTap: (String label) {
              // Handle button tap with button label
              print('Tapped button: $label');
            },
          ),
        ),
      ),
    );
  }
}
2
likes
0
points
59
downloads

Publisher

unverified uploader

Weekly Downloads

A production-ready Flutter UI library for building customizable buttons, chips, segmented controls, filter buttons, and selectable components with animations, themes, and generic item support.

Repository (GitHub)
View/report issues

Topics

#flutter #button #chips #segmented-control #ui

License

unknown (license)

Dependencies

flutter

More

Packages that depend on dynamic_button