29 lines
728 B
Dart
29 lines
728 B
Dart
import 'package:flutter/cupertino.dart';
|
|
|
|
class CustomSwitch extends StatefulWidget {
|
|
final Color? activeclor;
|
|
final bool? switchvalue;
|
|
final ValueChanged<bool>? onchanged;
|
|
const CustomSwitch(
|
|
{super.key, this.activeclor, this.switchvalue, this.onchanged});
|
|
|
|
@override
|
|
State<CustomSwitch> createState() => _CustomSwitchState();
|
|
}
|
|
|
|
class _CustomSwitchState extends State<CustomSwitch> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return CupertinoSwitch(
|
|
activeColor: widget.activeclor,
|
|
value: widget.switchvalue!,
|
|
onChanged: widget.onchanged
|
|
// (value) {
|
|
// setState(() {
|
|
// _switchValue = value;
|
|
// });
|
|
// },
|
|
);
|
|
}
|
|
}
|