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
130
points
26
downloads

Publisher

verified publisherhalfmadcoder.com

Weekly Downloads

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

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on toggle_switch_plus