DiscoverModule/lib/contacts_module/custom_widget/custom_switch.dart

29 lines
728 B
Dart
Raw Normal View History

2024-11-22 10:38:43 +00:00
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;
// });
// },
);
}
}