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

A custom animated switch with smooth transitions and themed backgrounds, ideal for toggling between day and night modes.

example/lib/main.dart

import 'package:fancy_switch_flutter/fancy_switch_flutter.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,
            onImagePath: 'assets/images/day.pn',
            offImagePath: 'assets/images/night.pn',
            thumbSize: 50.0,
            height: 60.0,
            width: 120.0,
            enableColor: Colors.lightGreen,
            disableColor: Colors.black26,
            onChanged: (val) {
              //print('Switch state: $val');
            },
          ),
        ),
      ),
    );
  }
}
1
likes
160
points
46
downloads

Publisher

unverified uploader

Weekly Downloads

A custom animated switch with smooth transitions and themed backgrounds, ideal for toggling between day and night modes.

Repository (GitHub)
View/report issues

Topics

#switch #animated #custom-widget #flutter

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on fancy_switch_flutter