From a7eda9faf986958ab652083e03086b7989616ffa Mon Sep 17 00:00:00 2001 From: Kima Date: Thu, 8 Feb 2024 22:19:38 +0100 Subject: [PATCH] changed share thingies --- filcnaplo/lib/api/client.dart | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/filcnaplo/lib/api/client.dart b/filcnaplo/lib/api/client.dart index a728a02..1736f25 100644 --- a/filcnaplo/lib/api/client.dart +++ b/filcnaplo/lib/api/client.dart @@ -236,9 +236,19 @@ class FilcAPI { theme.json['accent_color'] = theme.accentColor.value.toString(); theme.json['icon_color'] = theme.iconColor.value.toString(); theme.json['shadow_effect'] = theme.shadowEffect.toString(); - theme.json['theme_mode'] = theme.themeMode == ThemeMode.dark - ? 'dark' - : (theme.themeMode == ThemeMode.light ? 'light' : null.toString()); + + // set theme mode or remove if unneccessary + switch (theme.themeMode) { + case ThemeMode.dark: + theme.json['theme_mode'] = 'dark'; + break; + case ThemeMode.light: + theme.json['theme_mode'] = 'light'; + break; + default: + theme.json.remove('theme_mode'); + break; + } // set linked grade colors theme.json['grade_colors_id'] = theme.gradeColors.id;