on_off_switch

Last updated:

0 purchases

on_off_switch Image
on_off_switch Images
Add to Cart

Description:

on off switch

on_off_switch #
A Flutter package that provides an interactive on/off switch widget.

Installation #
Add the following line to your pubspec.yaml file:
dependencies:
on_off_switch: ^0.0.1
copied to clipboard
Then, run:
$ flutter pub get
Usage #
Import the package in your Dart code:
import 'package:on_off_switch/on_off_switch.dart';
Use the OnOffSwitch widget in your Flutter app:
OnOffSwitch(
value: true, // or false
onChanged: (bool newValue) {
// Handle the switch state change
print('Switch value changed: $newValue');
},
)
copied to clipboard
Example #
Check out the example folder for a simple usage example.
API Reference
OnOffSwitch
Properties

value (bool): The current state of the switch.
onChanged (Function(bool)): Callback function called when the switch state changes.

OnOffSwitch(
value: true,
onChanged: (bool newValue) {
print('Switch value changed: $newValue');
},
)

copied to clipboard
License #
This package is open-source and available under the MIT License.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.