From bee053c499728839be6dcf3df7cf8daa194aab24 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Thu, 8 Dec 2022 16:25:27 +0100 Subject: [PATCH] neon: Fix radio theme --- packages/neon/lib/src/utils/theme.dart | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/neon/lib/src/utils/theme.dart b/packages/neon/lib/src/utils/theme.dart index c989ffd1..71a8f3e4 100644 --- a/packages/neon/lib/src/utils/theme.dart +++ b/packages/neon/lib/src/utils/theme.dart @@ -35,6 +35,14 @@ ThemeData getThemeFromNextcloudTheme( secondary: keepOriginalAccentColorOverride, ); + final fillColor = MaterialStateProperty.resolveWith((final states) { + if (states.contains(MaterialState.disabled)) { + return selectBrightness == Brightness.dark ? Colors.white38 : Colors.black38; + } + + return colorScheme.primary; + }); + return ThemeData( useMaterial3: true, colorScheme: colorScheme, @@ -45,13 +53,7 @@ ThemeData getThemeFromNextcloudTheme( behavior: SnackBarBehavior.floating, ), checkboxTheme: CheckboxThemeData( - fillColor: MaterialStateProperty.resolveWith((final states) { - if (states.contains(MaterialState.disabled)) { - return selectBrightness == Brightness.dark ? Colors.white38 : Colors.black38; - } - - return colorScheme.primary; - }), + fillColor: fillColor, checkColor: MaterialStateProperty.resolveWith((final states) => colorScheme.onPrimary), ), dividerTheme: const DividerThemeData( @@ -66,5 +68,8 @@ ThemeData getThemeFromNextcloudTheme( : const Color(0xFF404040) : const Color(0xFFEAEAEA), ), + radioTheme: RadioThemeData( + fillColor: fillColor, + ), ); }