fancy_switch_flutter 0.0.2 copy "fancy_switch_flutter: ^0.0.2" to clipboard
fancy_switch_flutter: ^0.0.2 copied to clipboard

A custom animated Flutter switch widget that toggles between two themed backgrounds (e.g. day and night) with smooth animations and image support. Perfect for theme toggles or playful UX

example/main.dart

import 'package:fancy_switch_flutter/src/fancy_switch.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Fancy Switch Demo')),
        body: Center(
          child: FancySwitch(
            initialValue: true,
            on_image_path: 'assets/on_image.png',
            off_image_path: 'assets/off_image.png',
            thumb_size: 30.0,
            height: 60.0,
            width: 120.0,
            onChanged: (val) {
              print('Switch state: $val');
            },
          ),
        ),
      ),
    );
  }
}
1
likes
0
points
50
downloads

Publisher

unverified uploader

Weekly Downloads

A custom animated Flutter switch widget that toggles between two themed backgrounds (e.g. day and night) with smooth animations and image support. Perfect for theme toggles or playful UX

Homepage
Repository (GitHub)
View/report issues

Topics

#switch #animated #custom-widget #flutter

License

unknown (license)

Dependencies

flutter

More

Packages that depend on fancy_switch_flutter