switcher_xlive 1.0.5 copy "switcher_xlive: ^1.0.5" to clipboard
switcher_xlive: ^1.0.5 copied to clipboard

Fork with null-safety update from xlive_switch, Flutter custom switch based Oleg Frolov's animation design

example/lib/main.dart

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

void main() => runApp(const MyApp());

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

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

class MyAppState extends State<MyApp> {
  bool _value = true;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              SwitcherXlive(
                value: _value,
                onChanged: _changeValue,
              ),
              Text('Current value: $_value'),
            ],
          ),
        ),
      ),
    );
  }

  void _changeValue(bool value) {
    setState(() {
      _value = value;
    });
  }
}
5
likes
130
pub points
67%
popularity

Publisher

verified publisherstudiobidibou.fr

Fork with null-safety update from xlive_switch, Flutter custom switch based Oleg Frolov's animation design

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

cupertino_icons, flutter

More

Packages that depend on switcher_xlive