toggle_switch_plus 0.0.3 copy "toggle_switch_plus: ^0.0.3" to clipboard
toggle_switch_plus: ^0.0.3 copied to clipboard

A simple toggle switch widget can be customized with desired width, padding, gap, colors, text, corner radius etc.

example/lib/main.dart

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

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

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'An example app for toggle',
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Center(
          child: ToggleSwitchPlus(
            values: const ['male','female','other'],
            labels: const ['Male','Female','Other'],
            onChanged: (value) {
              debugPrint(value);
            },
          ),
        ),
      ),
    );
  }
}
3
likes
110
pub points
67%
popularity

Publisher

verified publisherhalfmadcoder.com

A simple toggle switch widget can be customized with desired width, padding, gap, colors, text, corner radius etc.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on toggle_switch_plus