flutter_advanced_switch 0.0.9+4 copy "flutter_advanced_switch: ^0.0.9+4" to clipboard
flutter_advanced_switch: ^0.0.9+4 copied to clipboard

outdated

An advanced switch control provides a rich API for widget customization that opens a new look and feel in your app.

flutter_advanced_switch #

An advanced swicth widget, that can be fully customized with size, text, color, radius of corners.

Switch OFF State Switch ON State
Flutter Advanced Switch Off State Flutter Advanced Switch On State

Getting Started #

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
    ...
    flutter_advanced_switch: <latest_version>

Import in your project:

import 'package:flutter_advanced_switch/flutter_advanced_switch.dart';

Examples #

Regular Switch

// ...
AdvancedSwitch(
    value: _value, // Boolean
    onChanged: (value) => setState(() { // Callback (or null to disable)
        _value = value;
    }),
)
// ...

Customized Switch

// ...
AdvancedSwitch(
    value: _value, // Boolean
    activeColor: Colors.green, // Color
    inactiveColor: Colors.grey, // Color
    activeChild: Text('ON'), // Widget
    inactiveChild: Text('OFF'),  // Widget
    activeImage: AssetImage('assets/images/on.png'), // ImageProvider
    inactiveImage: AssetImage('assets/images/off.png'), // ImageProvider
    borderRadius: BorderRadius.all(const Radius.circular(15)), // BorderRadius
    width: 50.0, // Double
    height: 30.0, // Double
    onChanged: (value) => setState(() { // Callback (or null to disable)
        _value = value;
    }),
),
// ...

Demo #

Flutter Advanced Switch Preview

140
likes
40
pub points
97%
popularity

Publisher

verified publisheralexmelnyk.io

An advanced switch control provides a rich API for widget customization that opens a new look and feel in your app.

Repository (GitHub)
View/report issues

Documentation

Documentation

License

MIT (license)

Dependencies

flutter, flutter_icons

More

Packages that depend on flutter_advanced_switch