Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

update component

AmanRajSinghMouryaeffbf687f1e7
diff --git a/mobile/packages/ente_components/lib/components/selection_controls/checkbox_component.dart b/mobile/packages/ente_components/lib/components/selection_controls/checkbox_component.dart
index 3481991e59..b171e72e10 100644
--- a/mobile/packages/ente_components/lib/components/selection_controls/checkbox_component.dart
+++ b/mobile/packages/ente_components/lib/components/selection_controls/checkbox_component.dart
@@ -11,17 +11,22 @@ class CheckboxComponent extends StatelessWidget {
super.key,
required this.selected,
required this.onChanged,
+ this.selectedColor,
});
final bool selected;
final ValueChanged<bool>? onChanged;
+ /// Fill and border color when [selected] and enabled.
+ /// Defaults to the theme's primary color.
+ final Color? selectedColor;
+
@override
Widget build(BuildContext context) {
final colors = context.componentColors;
final enabled = onChanged != null;
final fill = selected
- ? (enabled ? colors.primary : colors.fillDarkest)
+ ? (enabled ? (selectedColor ?? colors.primary) : colors.fillDarkest)
: Colors.transparent;
final stroke = enabled ? colors.strokeDark : colors.strokeFaint;