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

PowerSwitchButton is a customizable Flutter switch widget with adjustable size, stroke width, dash width, and dash space for a stylish toggle switch.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        backgroundColor: Colors.white,
        body: Center(
          child: PowerSwitchButton(
            size: 200,
            strokeWidth: 4,
            dashWidth: 1,
            dashSpace: 2,
            onColor: Colors.red,
            offColor: Colors.grey,
            backgroundColor: Colors.black,
            iconColor: Colors.black54,
            onToggle: (bool isOn) {
              print('Switch is ${isOn ? 'On' : 'Off'}');
            },
          ),
        ),
      ),
    );
  }
}
9
likes
0
points
11
downloads

Publisher

unverified uploader

Weekly Downloads

PowerSwitchButton is a customizable Flutter switch widget with adjustable size, stroke width, dash width, and dash space for a stylish toggle switch.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cupertino_icons, flutter

More

Packages that depend on power_switch_button