ffr_custom_switch 0.0.3 copy "ffr_custom_switch: ^0.0.3" to clipboard
ffr_custom_switch: ^0.0.3 copied to clipboard

A custom switch designed as a list tile with customizing options by the ffr-devteam

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:ffr_custom_switch/ffr_custom_switch.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
 @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'FFR Custom Switch DEMO',
      home: MyHomePage(title: 'FFR Custom Switch DEMO'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  bool like = true;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: SafeArea(
        child: Padding(
          padding: const EdgeInsets.all(20.0),
          child: FFRCustomSwitch(
              value: like,
              onChanged: (newValue) {
                setState(() {
                  like = newValue;
                });
              },
              inactiveColor: Colors.red,
              activeColor: Colors.green,
              lable: 'Do you like this package?',
              style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
              thumbColor: Colors.grey),
        ),
      ),
    );
  }
}
0
likes
40
pub points
0%
popularity

Publisher

unverified uploader

A custom switch designed as a list tile with customizing options by the ffr-devteam

Homepage
Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on ffr_custom_switch