Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List state = [
- false,
- true,
- false,
- false,
- ];
- Widget switchs(label, index) {
- return Container(
- padding: const EdgeInsets.only(
- top: 20,
- ),
- child: Row(
- children: <Widget>[
- Text(
- label,
- style: primaryTextStyle.copyWith(
- fontSize: 24,
- fontWeight: semiBold,
- ),
- ),
- const SizedBox(
- width: 200,
- ),
- FlutterSwitch(
- width: 125.0,
- height: 55.0,
- valueFontSize: 25.0,
- toggleSize: 45.0,
- value: state[index],
- borderRadius: 30.0,
- padding: 8.0,
- showOnOff: true,
- activeColor: Colors.blueAccent,
- onToggle: (val) {
- setState(() {
- state[index] = val;
- });
- },
- ),
- ],
- ),
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement