Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 1.03 KB

README.md

File metadata and controls

44 lines (34 loc) · 1.03 KB

on_off_switcher

on_off_switcher widget for Flutter project.

Getting Started

For use on_off_switcher widget in your project:

  1. Add dependency in the pubspec.yaml file
    dependencies:
        flutter:
            sdk: flutter
        on_off_switcher:
            git:
                url: git@github.com:Windmill-Smart-Solutions/FLUTTER-on_off_switcher.git
  1. Import widget in the dart file:
    import 'package:on_off_switcher/on_off_switcher.dart';
    import 'package:on_off_switcher/on_off_switcher_state.dart';
  1. Make an instance of the widget.

         OnOffSwitcher(
                state: OnOffSwitcherState.switchOn,
                valueChanged: (state) {
                  if (state == OnOffSwitcherState.switchOn) {
                    print('State is ON');
                  } else {
                    print('State is OFF');
                  }
                },
              )

    License

    Windmill Smart Solutions 2020 ©