flutter_advanced_switch 0.0.5 copy "flutter_advanced_switch: ^0.0.5" to clipboard
flutter_advanced_switch: ^0.0.5 copied to clipboard

outdated

An advanced switch control.

flutter_switcher #

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]

Gettings 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';

Basic Example #

Default 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
    activeLabel: 'ON', // String
    inactiveLabel: 'OFF',  // String
    activeTextStyle: theme.textTheme.bodyText1, // TextStyle
    inactiveTextStyle: theme.textTheme.bodyText1, // TextStyle
    activeImage: theme.textTheme.bodyText1, // ImageProvider
    inactiveImage: theme.textTheme.bodyText1, // 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]

153
likes
0
points
13k
downloads

Publisher

verified publisheralexmelnyk.io

Weekly Downloads

An advanced switch control.

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_advanced_switch