ffr_custom_switch 0.0.3 ffr_custom_switch: ^0.0.3 copied to clipboard
A custom switch designed as a list tile with customizing options by the ffr-devteam
ffr_custom_switch #
Custom Swich Package created with flutter.
The source code is 100% Dart and Flutter, and all necessary files are located in the /lib folder
Installation #
In the dependencies:
section of your pubspec.yaml
, add the following line:
ffr_custom_switch: <latest_version>
Import in your project:
import 'package:ffr_custom_switch/ffr_custom_switch.dart';
Basic Ussage #
class HomeScreen extends StatefulWidget {
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
bool like = true;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('FFR Custom Switch Example'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FFRCustomSwitch(
thumbColor: Colors.
lable: 'Do you like this package?',
inactiveColor: Colors.red,
activeColor: Colors.green,
value: like,
onChanged: (newValue) {
setState(){
like = newValue;
}
},
);
],
),
);
}
}