flutter_toggle_button 0.0.2 copy "flutter_toggle_button: ^0.0.2" to clipboard
flutter_toggle_button: ^0.0.2 copied to clipboard

A highly customizable toggle button widget for Flutter applications. This widget allows you to create stylish toggle buttons with flexible configurations including button size, colors, gradients, te [...]

example/main.dart

import 'package:flutter_toggle_button/flutter_toggle_button.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Custom Toggle Button Example'),
        ),
        body: Center(
          child: FlutterToggleButton(
            items: const ['Option 1', 'Option 2', 'Option 3'],
            onTap: (index) {
              if (kDebugMode) {
                print('Selected index: $index');
              }
            },
            buttonWidth: 120,
            buttonHeight: 50,
            borderRadius: 25,
            buttonTextFontSize: 18,
            enableTextColor: Colors.white,
            disableTextColor: Colors.grey,
            buttonGradient: const LinearGradient(
              colors: [Colors.blue, Colors.green],
            ),
          ),
        ),
      ),
    );
  }
}
3
likes
150
points
77
downloads

Publisher

unverified uploader

Weekly Downloads

A highly customizable toggle button widget for Flutter applications. This widget allows you to create stylish toggle buttons with flexible configurations including button size, colors, gradients, text styles, and more. It supports various content types such as text, numbers, and widgets, making it versatile for different use cases. The package includes comprehensive customization options to tailor the appearance and behavior of the toggle buttons to suit your app's design requirements.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_toggle_button