saveTheme2Storage method

dynamic saveTheme2Storage(
  1. Brightness brightness,
  2. MaterialColor themeColor
)

数据持久化到shared preferences

Implementation

saveTheme2Storage(Brightness brightness, MaterialColor themeColor) async {
  var index = Colors.primaries.indexOf(themeColor);
  StorageManager.setItem(kThemeBrightnessIndex, brightness.index);
  StorageManager.setItem(kThemeColorIndex, index);
}