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

A highly customizable toggle button widget for Flutter applications. This widget allows you to create stylish toggle buttons with flexible configurations.

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],
            ),
          ),
        ),
      ),
    );
  }
}
5
likes
160
points
241
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.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_toggle_button