savePreferences method
Future<void>
savePreferences(
{ - required String widgetCode,
- required Color backgroundColor,
- required String appBarTitle,
- required Color appBarBackgroundColor,
- required Color appBarTitleColor,
- required Color appBarBackButtonColor,
})
Implementation
Future<void> savePreferences({
required String widgetCode,
required Color backgroundColor,
required String appBarTitle,
required Color appBarBackgroundColor,
required Color appBarTitleColor,
required Color appBarBackButtonColor,
}) async {
final prefs = await SharedPreferences.getInstance();
await prefs.setString(_keyWidgetCode, widgetCode);
await prefs.setInt(_keyBackgroundColor, backgroundColor.value);
await prefs.setString(_keyAppBarTitle, appBarTitle);
await prefs.setInt(_keyAppBarBackgroundColor, appBarBackgroundColor.value);
await prefs.setInt(_keyAppBarTitleColor, appBarTitleColor.value);
await prefs.setInt(_keyAppBarBackButtonColor, appBarBackButtonColor.value);
}