Skip to content

Commit

Permalink
add button to reset app color
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed Dec 6, 2024
1 parent 6e9797b commit b2f3598
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions lib/Frontend/pages/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,33 @@ class _SettingsState extends ConsumerState<Settings> {
title: Text(
settingsAppColor(),
),
trailing: ColorIndicator(
width: 44,
height: 44,
borderRadius: 22,
color: appColorValue,
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
if (HiveProxy.getOrDefault(settings, appColor, defaultValue: appColorDefault) != appColorDefault) ...[
IconButton(
onPressed: () {
setState(() {
HiveProxy.put(settings, appColor, appColorDefault);
appColorValue = Color(appColorDefault);
});
},
icon: Icon(Icons.clear)),
],
ColorIndicator(
width: 44,
height: 44,
borderRadius: 22,
color: appColorValue,
)
],
),
onTap: () async {
ColorPickerRoute(defaultColor: appColorValue.value).push(context).then(
(color) => setState(() {
if (color != null) {
HiveProxy.put(settings, appColor, color);
appColorValue = color;
appColorValue = Color(color);
}
}),
);
Expand Down

0 comments on commit b2f3598

Please sign in to comment.