mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-13 19:22:22 +01:00
Reboot v3
This commit is contained in:
27
lib/src/ui/widget/shared/smart_check_box.dart
Normal file
27
lib/src/ui/widget/shared/smart_check_box.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
|
||||
class SmartCheckBox extends StatefulWidget {
|
||||
final CheckboxController controller;
|
||||
final Widget? content;
|
||||
const SmartCheckBox({Key? key, required this.controller, this.content}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<SmartCheckBox> createState() => _SmartCheckBoxState();
|
||||
}
|
||||
|
||||
class _SmartCheckBoxState extends State<SmartCheckBox> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Checkbox(
|
||||
checked: widget.controller.value,
|
||||
onChanged: (checked) => setState(() => widget.controller.value = checked ?? false),
|
||||
content: widget.content
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CheckboxController {
|
||||
bool value;
|
||||
|
||||
CheckboxController({this.value = false});
|
||||
}
|
||||
Reference in New Issue
Block a user