bouncy_switch 1.0.1
bouncy_switch: ^1.0.1 copied to clipboard
A lightweight bouncy animated toggle switch for Flutter.
import 'package:flutter/material.dart';
import 'package:bouncy_switch/bouncy_switch.dart';
void main() => runApp(const MyApp());
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
bool enabled = false;
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Bouncy Switch')),
body: Center(
child: BouncySwitch(
value: enabled,
onChanged: (v) => setState(() => enabled = v),
),
),
),
);
}
}