updateColor function
updateColor is used to update the colors of the app based on the theme
mode
is the current theme mode
Implementation
void updateColor(ThemeMode mode) {
iconColor = mode == ThemeMode.dark ? Colors.white : Colors.black;
/// [themeDefaultColor] is the default color of the app
themeDefaultColor = mode == ThemeMode.dark
? const Color.fromRGBO(245, 249, 255, 0.95)
: const Color.fromRGBO(29, 34, 41, 1);
/// [themeBottomSheetColor] is the color of the bottom sheet
themeBottomSheetColor = mode == ThemeMode.dark
? const Color.fromRGBO(20, 23, 28, 1)
: const Color.fromRGBO(245, 249, 255, 0.95);
/// [themeSurfaceColor] is the color of the surface of the app
themeSurfaceColor = mode == ThemeMode.dark
? const Color.fromRGBO(29, 34, 41, 1)
: const Color.fromRGBO(245, 249, 255, 0.95);
/// [themeSubHeadingColor] is the color of the subheading
themeSubHeadingColor = mode == ThemeMode.dark
? const Color.fromRGBO(224, 236, 255, 0.8)
: borderColor;
/// [themeScreenBackgroundColor] is the color of the background of the app
themeScreenBackgroundColor = mode == ThemeMode.dark
? const Color.fromRGBO(11, 13, 15, 1)
: hmsWhiteColor;
/// [themeHintColor] is the color of the hint text
themeHintColor = mode == ThemeMode.dark
? const Color.fromRGBO(195, 208, 229, 0.5)
: hmsWhiteColor;
/// [themeHMSBorderColor] is the color of the border of the app
themeHMSBorderColor = mode == ThemeMode.dark
? const Color.fromRGBO(45, 52, 64, 1)
: hmsWhiteColor;
/// [themeTileNameColor] is the color of the name of the tile
themeTileNameColor = mode == ThemeMode.dark
? const Color.fromRGBO(0, 0, 0, 0.9)
: hmsHintColor;
/// [themeDisabledTextColor] is the color of the disabled text
themeDisabledTextColor = mode == ThemeMode.dark
? const Color.fromRGBO(255, 255, 255, 0.48)
: themeDefaultColor;
}