mirror of
https://github.com/PranshulGG/WeatherMaster.git
synced 2026-10-21 10:40:23 -05:00
removed option to use sys font
This commit is contained in:
1 parent
caea35303c
commit
d905dfe623
9 files changed
+378
-347
No files matched your search
+6
-20
@@ -201,10 +201,6 @@ class MyApp extends StatelessWidget {
|
||||
);
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||
|
||||
final appFont = context.watch<UnitSettingsNotifier>().appFont;
|
||||
|
||||
final useSystemFont = appFont == "System";
|
||||
|
||||
return MaterialApp(
|
||||
title: 'WeatherMaster',
|
||||
debugShowCheckedModeBanner: false,
|
||||
@@ -230,16 +226,11 @@ class MyApp extends StatelessWidget {
|
||||
textTheme: ThemeData.light()
|
||||
.textTheme
|
||||
.apply(
|
||||
fontFamily: useSystemFont ? null : 'DefaultFont',
|
||||
fontFamily: 'DefaultFont',
|
||||
)
|
||||
.copyWith(
|
||||
bodyLarge: !useSystemFont
|
||||
? TextStyle(fontSize: 15.5, fontFamily: 'DefaultFont')
|
||||
: null,
|
||||
bodyMedium: !useSystemFont
|
||||
? TextStyle(fontSize: 14, fontFamily: 'DefaultFont')
|
||||
: null,
|
||||
),
|
||||
bodyLarge: TextStyle(fontSize: 15.5, fontFamily: 'DefaultFont'),
|
||||
bodyMedium: TextStyle(fontSize: 14, fontFamily: 'DefaultFont')),
|
||||
highlightColor: Colors.transparent,
|
||||
pageTransitionsTheme: const PageTransitionsTheme(
|
||||
builders: {
|
||||
@@ -262,16 +253,11 @@ class MyApp extends StatelessWidget {
|
||||
textTheme: ThemeData.dark()
|
||||
.textTheme
|
||||
.apply(
|
||||
fontFamily: useSystemFont ? null : 'DefaultFont',
|
||||
fontFamily: 'DefaultFont',
|
||||
)
|
||||
.copyWith(
|
||||
bodyLarge: !useSystemFont
|
||||
? TextStyle(fontSize: 15.5, fontFamily: 'DefaultFont')
|
||||
: null,
|
||||
bodyMedium: !useSystemFont
|
||||
? TextStyle(fontSize: 14, fontFamily: 'DefaultFont')
|
||||
: null,
|
||||
),
|
||||
bodyLarge: TextStyle(fontSize: 15.5, fontFamily: 'DefaultFont'),
|
||||
bodyMedium: TextStyle(fontSize: 14, fontFamily: 'DefaultFont')),
|
||||
highlightColor: Colors.transparent,
|
||||
pageTransitionsTheme: const PageTransitionsTheme(
|
||||
builders: {
|
||||
|
||||
@@ -15,7 +15,6 @@ class UnitSettingsNotifier extends ChangeNotifier {
|
||||
bool _useOnlyMaterialScheme = false;
|
||||
bool _showFrog = true;
|
||||
bool _useDarkBackgroundCards = false;
|
||||
String _appFont = "Open sans";
|
||||
|
||||
// Getters
|
||||
String get tempUnit => _tempUnit;
|
||||
@@ -30,7 +29,6 @@ class UnitSettingsNotifier extends ChangeNotifier {
|
||||
bool get useOnlyMaterialScheme => _useOnlyMaterialScheme;
|
||||
bool get showFrog => _showFrog;
|
||||
bool get useDarkBackgroundCards => _useDarkBackgroundCards;
|
||||
String get appFont => _appFont;
|
||||
|
||||
UnitSettingsNotifier() {
|
||||
_loadAllUnits();
|
||||
@@ -64,7 +62,6 @@ class UnitSettingsNotifier extends ChangeNotifier {
|
||||
_useDarkBackgroundCards =
|
||||
await PreferencesHelper.getBool("useDarkerCardBackground") ??
|
||||
_useDarkBackgroundCards;
|
||||
_appFont = await PreferencesHelper.getString("appFont") ?? _appFont;
|
||||
|
||||
notifyListeners();
|
||||
}
|
||||
@@ -155,10 +152,4 @@ class UnitSettingsNotifier extends ChangeNotifier {
|
||||
PreferencesHelper.setBool("useDarkerCardBackground", value);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void updateAppFont(String value) {
|
||||
_appFont = value;
|
||||
PreferencesHelper.setString("appFont", value);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
+338
-318
@@ -49,15 +49,13 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
Widget build(BuildContext context) {
|
||||
final themeController = Provider.of<ThemeController>(context);
|
||||
final currentMode = themeController.themeMode;
|
||||
final currentAppfont =
|
||||
PreferencesHelper.getString("appFont") ?? "Open Sans";
|
||||
|
||||
final isSupported = themeController.isDynamicColorSupported;
|
||||
|
||||
final optionsTheme = {
|
||||
"Auto": "theme_auto".tr(),
|
||||
"Dark": "theme_dark".tr(),
|
||||
"Light": "theme_light".tr()
|
||||
"Light": "theme_light".tr(),
|
||||
};
|
||||
|
||||
return Scaffold(
|
||||
@@ -71,317 +69,334 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
scrolledUnderElevation: 1,
|
||||
),
|
||||
SliverToBoxAdapter(
|
||||
child: Column(children: [
|
||||
SettingSection(
|
||||
styleTile: true,
|
||||
title: SettingSectionTitle(
|
||||
"app_looks".tr(),
|
||||
noPadding: true,
|
||||
),
|
||||
tiles: [
|
||||
SettingSingleOptionTile(
|
||||
icon: Icon(Symbols.routine),
|
||||
title: Text('app_theme_dark_light'.tr()),
|
||||
dialogTitle: 'app_theme_dark_light'.tr(),
|
||||
value: SettingTileValue(
|
||||
child: Column(
|
||||
children: [
|
||||
SettingSection(
|
||||
styleTile: true,
|
||||
title: SettingSectionTitle("app_looks".tr(), noPadding: true),
|
||||
tiles: [
|
||||
SettingSingleOptionTile(
|
||||
icon: Icon(Symbols.routine),
|
||||
title: Text('app_theme_dark_light'.tr()),
|
||||
dialogTitle: 'app_theme_dark_light'.tr(),
|
||||
value: SettingTileValue(
|
||||
optionsTheme[currentMode == ThemeMode.light
|
||||
? "Light"
|
||||
: currentMode == ThemeMode.system
|
||||
? "Auto"
|
||||
: "Dark"]!),
|
||||
options: optionsTheme.values.toList(),
|
||||
initialOption: optionsTheme[currentMode == ThemeMode.light
|
||||
? "Light"
|
||||
: currentMode == ThemeMode.system
|
||||
? "Auto"
|
||||
: "Dark"]!,
|
||||
onSubmitted: (value) {
|
||||
setState(() {
|
||||
final selectedKey = optionsTheme.entries
|
||||
.firstWhere((e) => e.value == value)
|
||||
.key;
|
||||
PreferencesHelper.setString("AppTheme", selectedKey);
|
||||
themeController.setThemeMode(selectedKey == "Dark"
|
||||
? ThemeMode.dark
|
||||
: selectedKey == "Auto"
|
||||
? ThemeMode.system
|
||||
: ThemeMode.light);
|
||||
});
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
icon: Icon(Symbols.thermometer_add, fill: 1, weight: 500),
|
||||
title: Text("temperature_animation".tr()),
|
||||
description: Text("temp_animation_sub_pref".tr()),
|
||||
toggled:
|
||||
PreferencesHelper.getBool("useTempAnimation") ?? true,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
PreferencesHelper.setBool("useTempAnimation", value);
|
||||
});
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
enabled: _useCustomTile,
|
||||
icon: Icon(Symbols.colorize, fill: 1, weight: 500),
|
||||
title: Text("use_custom_color".tr()),
|
||||
toggled:
|
||||
PreferencesHelper.getBool("usingCustomSeed") ?? false,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
PreferencesHelper.setBool("usingCustomSeed", value);
|
||||
if (value == true) {
|
||||
Provider.of<ThemeController>(context, listen: false)
|
||||
.setSeedColor(PreferencesHelper.getColor(
|
||||
"CustomMaterialColor") ??
|
||||
Colors.blue);
|
||||
} else {
|
||||
Provider.of<ThemeController>(context, listen: false)
|
||||
.setSeedColor(PreferencesHelper.getColor(
|
||||
"weatherThemeColor") ??
|
||||
Colors.blue);
|
||||
}
|
||||
});
|
||||
_showTile = value;
|
||||
},
|
||||
),
|
||||
SettingColorTile(
|
||||
enabled: _showTile,
|
||||
icon: Icon(Symbols.colors, fill: 1, weight: 500),
|
||||
title: Text('primary_color'.tr()),
|
||||
description: Text('primary_color_sub'.tr()),
|
||||
dialogTitle: 'Color',
|
||||
initialColor:
|
||||
PreferencesHelper.getColor("CustomMaterialColor") ??
|
||||
Colors.blue,
|
||||
colorPickers: [ColorPickerType.primary],
|
||||
onSubmitted: (value) {
|
||||
setState(() {
|
||||
PreferencesHelper.setColor(
|
||||
"CustomMaterialColor", value);
|
||||
Provider.of<ThemeController>(context, listen: false)
|
||||
.setSeedColor(value);
|
||||
});
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
enabled: isSupported
|
||||
? _showTile
|
||||
? false
|
||||
: true
|
||||
: false,
|
||||
icon: Icon(Symbols.wallpaper, fill: 1, weight: 500),
|
||||
title: Text("dynamic_colors".tr()),
|
||||
description: Text(
|
||||
"${"dynamic_colors_sub".tr()} ${isSupported ? "" : "(Android 12+)"}"),
|
||||
toggled:
|
||||
PreferencesHelper.getBool("DynamicColors") ?? false,
|
||||
onChanged: (value) async {
|
||||
final themeController = context.read<ThemeController>();
|
||||
|
||||
PreferencesHelper.setBool("DynamicColors", value);
|
||||
|
||||
if (value) {
|
||||
await themeController.loadDynamicColors();
|
||||
} else {
|
||||
Provider.of<ThemeController>(context, listen: false)
|
||||
.setSeedColor(PreferencesHelper.getColor(
|
||||
"weatherThemeColor") ??
|
||||
Colors.blue);
|
||||
}
|
||||
setState(() {
|
||||
if (value) {
|
||||
_useCustomTile = false;
|
||||
} else {
|
||||
_useCustomTile = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
icon: Icon(Symbols.palette, fill: 1, weight: 500),
|
||||
title: Text("material_scheme_only".tr()),
|
||||
description: Text('material_scheme_only_sub'.tr()),
|
||||
toggled: PreferencesHelper.getBool("OnlyMaterialScheme") ??
|
||||
false,
|
||||
onChanged: (value) {
|
||||
PreferencesHelper.setBool("OnlyMaterialScheme", value);
|
||||
setState(() {
|
||||
SnackUtil.showSnackBar(
|
||||
context: context,
|
||||
message: "Restarting app",
|
||||
);
|
||||
Future.delayed(Duration(seconds: 2), () {
|
||||
Restart.restartApp();
|
||||
});
|
||||
});
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
icon: Icon(Symbols.responsive_layout, fill: 1, weight: 500),
|
||||
title: Text("froggy_layout".tr()),
|
||||
toggled: PreferencesHelper.getBool("showFroggy") ?? true,
|
||||
onChanged: (value) {
|
||||
context
|
||||
.read<UnitSettingsNotifier>()
|
||||
.updateShowFroggy(value);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
icon: Icon(Symbols.cards, fill: 1, weight: 500),
|
||||
title: Text('make_the_card_background_darker'.tr()),
|
||||
toggled:
|
||||
PreferencesHelper.getBool("useDarkerCardBackground") ??
|
||||
false,
|
||||
onChanged: (value) {
|
||||
context
|
||||
.read<UnitSettingsNotifier>()
|
||||
.updateUseDarkerBackground(value);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
SettingActionTile(
|
||||
icon: Icon(Symbols.view_agenda, fill: 1, weight: 500),
|
||||
title: Text('edit_layout'.tr()),
|
||||
trailing: Icon(Icons.chevron_right),
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => EditLayoutPage(),
|
||||
fullscreenDialog: true),
|
||||
);
|
||||
},
|
||||
),
|
||||
SettingSingleOptionTile(
|
||||
icon: Icon(Symbols.font_download, fill: 1, weight: 500),
|
||||
title: Text("App font"),
|
||||
value: SettingTileValue(currentAppfont),
|
||||
dialogTitle: "App font",
|
||||
initialOption: currentAppfont.toString(),
|
||||
options: ["System", "Nato Sans"],
|
||||
: "Dark"]!,
|
||||
),
|
||||
options: optionsTheme.values.toList(),
|
||||
initialOption: optionsTheme[currentMode == ThemeMode.light
|
||||
? "Light"
|
||||
: currentMode == ThemeMode.system
|
||||
? "Auto"
|
||||
: "Dark"]!,
|
||||
onSubmitted: (value) {
|
||||
setState(() {
|
||||
final selectedKey = optionsTheme.entries
|
||||
.firstWhere((e) => e.value == value)
|
||||
.key;
|
||||
PreferencesHelper.setString("AppTheme", selectedKey);
|
||||
themeController.setThemeMode(
|
||||
selectedKey == "Dark"
|
||||
? ThemeMode.dark
|
||||
: selectedKey == "Auto"
|
||||
? ThemeMode.system
|
||||
: ThemeMode.light,
|
||||
);
|
||||
});
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
icon: Icon(Symbols.thermometer_add, fill: 1, weight: 500),
|
||||
title: Text("temperature_animation".tr()),
|
||||
description: Text("temp_animation_sub_pref".tr()),
|
||||
toggled:
|
||||
PreferencesHelper.getBool("useTempAnimation") ?? true,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
PreferencesHelper.setBool("useTempAnimation", value);
|
||||
});
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
enabled: _useCustomTile,
|
||||
icon: Icon(Symbols.colorize, fill: 1, weight: 500),
|
||||
title: Text("use_custom_color".tr()),
|
||||
toggled:
|
||||
PreferencesHelper.getBool("usingCustomSeed") ?? false,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
PreferencesHelper.setBool("usingCustomSeed", value);
|
||||
if (value == true) {
|
||||
Provider.of<ThemeController>(
|
||||
context,
|
||||
listen: false,
|
||||
).setSeedColor(
|
||||
PreferencesHelper.getColor(
|
||||
"CustomMaterialColor",
|
||||
) ??
|
||||
Colors.blue,
|
||||
);
|
||||
} else {
|
||||
Provider.of<ThemeController>(
|
||||
context,
|
||||
listen: false,
|
||||
).setSeedColor(
|
||||
PreferencesHelper.getColor("weatherThemeColor") ??
|
||||
Colors.blue,
|
||||
);
|
||||
}
|
||||
});
|
||||
_showTile = value;
|
||||
},
|
||||
),
|
||||
SettingColorTile(
|
||||
enabled: _showTile,
|
||||
icon: Icon(Symbols.colors, fill: 1, weight: 500),
|
||||
title: Text('primary_color'.tr()),
|
||||
description: Text('primary_color_sub'.tr()),
|
||||
dialogTitle: 'Color',
|
||||
initialColor:
|
||||
PreferencesHelper.getColor("CustomMaterialColor") ??
|
||||
Colors.blue,
|
||||
colorPickers: [ColorPickerType.primary],
|
||||
onSubmitted: (value) {
|
||||
setState(() {
|
||||
PreferencesHelper.setColor(
|
||||
"CustomMaterialColor",
|
||||
value,
|
||||
);
|
||||
Provider.of<ThemeController>(
|
||||
context,
|
||||
listen: false,
|
||||
).setSeedColor(value);
|
||||
});
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
enabled: isSupported
|
||||
? _showTile
|
||||
? false
|
||||
: true
|
||||
: false,
|
||||
icon: Icon(Symbols.wallpaper, fill: 1, weight: 500),
|
||||
title: Text("dynamic_colors".tr()),
|
||||
description: Text(
|
||||
"${"dynamic_colors_sub".tr()} ${isSupported ? "" : "(Android 12+)"}",
|
||||
),
|
||||
toggled:
|
||||
PreferencesHelper.getBool("DynamicColors") ?? false,
|
||||
onChanged: (value) async {
|
||||
final themeController = context.read<ThemeController>();
|
||||
|
||||
PreferencesHelper.setBool("DynamicColors", value);
|
||||
|
||||
if (value) {
|
||||
await themeController.loadDynamicColors();
|
||||
} else {
|
||||
Provider.of<ThemeController>(
|
||||
context,
|
||||
listen: false,
|
||||
).setSeedColor(
|
||||
PreferencesHelper.getColor("weatherThemeColor") ??
|
||||
Colors.blue,
|
||||
);
|
||||
}
|
||||
setState(() {
|
||||
if (value) {
|
||||
_useCustomTile = false;
|
||||
} else {
|
||||
_useCustomTile = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
icon: Icon(Symbols.palette, fill: 1, weight: 500),
|
||||
title: Text("material_scheme_only".tr()),
|
||||
description: Text('material_scheme_only_sub'.tr()),
|
||||
toggled:
|
||||
PreferencesHelper.getBool("OnlyMaterialScheme") ??
|
||||
false,
|
||||
onChanged: (value) {
|
||||
PreferencesHelper.setBool("OnlyMaterialScheme", value);
|
||||
setState(() {
|
||||
SnackUtil.showSnackBar(
|
||||
context: context,
|
||||
message: "Restarting app",
|
||||
);
|
||||
Future.delayed(Duration(seconds: 2), () {
|
||||
Restart.restartApp();
|
||||
});
|
||||
});
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
icon: Icon(
|
||||
Symbols.responsive_layout,
|
||||
fill: 1,
|
||||
weight: 500,
|
||||
),
|
||||
title: Text("froggy_layout".tr()),
|
||||
toggled: PreferencesHelper.getBool("showFroggy") ?? true,
|
||||
onChanged: (value) {
|
||||
context.read<UnitSettingsNotifier>().updateShowFroggy(
|
||||
value,
|
||||
);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
icon: Icon(Symbols.cards, fill: 1, weight: 500),
|
||||
title: Text('make_the_card_background_darker'.tr()),
|
||||
toggled: PreferencesHelper.getBool(
|
||||
"useDarkerCardBackground",
|
||||
) ??
|
||||
false,
|
||||
onChanged: (value) {
|
||||
context
|
||||
.read<UnitSettingsNotifier>()
|
||||
.updateAppFont(value);
|
||||
|
||||
.updateUseDarkerBackground(value);
|
||||
setState(() {});
|
||||
})
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SettingSection(
|
||||
styleTile: true,
|
||||
title: SettingSectionTitle(
|
||||
'weather'.tr(),
|
||||
noPadding: true,
|
||||
),
|
||||
tiles: [
|
||||
SettingActionTile(
|
||||
icon: Icon(Symbols.home_pin, fill: 1, weight: 500),
|
||||
title: Text('home_location'.tr()),
|
||||
description: Text(
|
||||
"${city ?? 'Unknown City'}, ${country ?? 'Unknown Country'}",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
fontWeight: FontWeight.w700),
|
||||
},
|
||||
),
|
||||
trailing: Icon(Icons.chevron_right),
|
||||
onTap: () async {
|
||||
final updated = await Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => const HomeLocationScreen()),
|
||||
);
|
||||
SettingActionTile(
|
||||
icon: Icon(Symbols.view_agenda, fill: 1, weight: 500),
|
||||
title: Text('edit_layout'.tr()),
|
||||
trailing: Icon(Icons.chevron_right),
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => EditLayoutPage(),
|
||||
fullscreenDialog: true,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
SettingSection(
|
||||
styleTile: true,
|
||||
title: SettingSectionTitle('weather'.tr(), noPadding: true),
|
||||
tiles: [
|
||||
SettingActionTile(
|
||||
icon: Icon(Symbols.home_pin, fill: 1, weight: 500),
|
||||
title: Text('home_location'.tr()),
|
||||
description: Text(
|
||||
"${city ?? 'Unknown City'}, ${country ?? 'Unknown Country'}",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
trailing: Icon(Icons.chevron_right),
|
||||
onTap: () async {
|
||||
final updated = await Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => const HomeLocationScreen(),
|
||||
),
|
||||
);
|
||||
|
||||
if (updated == true) {
|
||||
loadLocation();
|
||||
}
|
||||
},
|
||||
),
|
||||
SettingActionTile(
|
||||
icon: Icon(Symbols.page_info, fill: 1, weight: 500),
|
||||
title: Text('app_units'.tr()),
|
||||
description: Text(
|
||||
if (updated == true) {
|
||||
loadLocation();
|
||||
}
|
||||
},
|
||||
),
|
||||
SettingActionTile(
|
||||
icon: Icon(Symbols.page_info, fill: 1, weight: 500),
|
||||
title: Text('app_units'.tr()),
|
||||
description: Text(
|
||||
'temperature_wind_pressure_visibility_precipitation_time_aqi'
|
||||
.tr()),
|
||||
trailing: Icon(Icons.chevron_right),
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(builder: (_) => const AppUnitsPage()),
|
||||
);
|
||||
},
|
||||
),
|
||||
SettingActionTile(
|
||||
icon: Icon(Symbols.update, fill: 1, weight: 500),
|
||||
title: Text('background_updates'.tr()),
|
||||
trailing: Icon(Icons.chevron_right),
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => BackgroundUpdatesPage()),
|
||||
);
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
icon: Icon(Symbols.assistant_navigation,
|
||||
fill: 1, weight: 500),
|
||||
title: Text("use_device_compass".tr()),
|
||||
description: Text("use_device_compass_sub".tr()),
|
||||
toggled:
|
||||
PreferencesHelper.getBool("useDeviceCompass") ?? false,
|
||||
onChanged: (value) {
|
||||
context
|
||||
.read<UnitSettingsNotifier>()
|
||||
.updateUseDeviceCompass(value);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
icon: Icon(Symbols.taunt, fill: 1, weight: 500),
|
||||
title: Text('froggy_insights'.tr()),
|
||||
description: Text('froggy_insights_sub'.tr()),
|
||||
toggled:
|
||||
PreferencesHelper.getBool("useFroggyInsights") ?? false,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
PreferencesHelper.setBool("useFroggyInsights", value);
|
||||
});
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
icon: Icon(Symbols.animation, fill: 1, weight: 500),
|
||||
title: Text("background_card_animation".tr()),
|
||||
toggled:
|
||||
PreferencesHelper.getBool("CardBackgroundAnimations") ??
|
||||
true,
|
||||
onChanged: (value) {
|
||||
context
|
||||
.read<UnitSettingsNotifier>()
|
||||
.updateuseCardBackgroundAnimations(value);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
SettingActionTile(
|
||||
icon: Icon(Symbols.nest_farsight_weather,
|
||||
fill: 1, weight: 500),
|
||||
title: Text('weather_models'.tr()),
|
||||
description: Text('openmeteo_weather_models'.tr()),
|
||||
trailing: Icon(Icons.chevron_right),
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => const MeteoModelsPage()),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SettingSection(
|
||||
.tr(),
|
||||
),
|
||||
trailing: Icon(Icons.chevron_right),
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => const AppUnitsPage(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
SettingActionTile(
|
||||
icon: Icon(Symbols.update, fill: 1, weight: 500),
|
||||
title: Text('background_updates'.tr()),
|
||||
trailing: Icon(Icons.chevron_right),
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => BackgroundUpdatesPage(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
icon: Icon(
|
||||
Symbols.assistant_navigation,
|
||||
fill: 1,
|
||||
weight: 500,
|
||||
),
|
||||
title: Text("use_device_compass".tr()),
|
||||
description: Text("use_device_compass_sub".tr()),
|
||||
toggled: PreferencesHelper.getBool("useDeviceCompass") ??
|
||||
false,
|
||||
onChanged: (value) {
|
||||
context
|
||||
.read<UnitSettingsNotifier>()
|
||||
.updateUseDeviceCompass(value);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
icon: Icon(Symbols.taunt, fill: 1, weight: 500),
|
||||
title: Text('froggy_insights'.tr()),
|
||||
description: Text('froggy_insights_sub'.tr()),
|
||||
toggled: PreferencesHelper.getBool("useFroggyInsights") ??
|
||||
false,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
PreferencesHelper.setBool("useFroggyInsights", value);
|
||||
});
|
||||
},
|
||||
),
|
||||
SettingSwitchTile(
|
||||
icon: Icon(Symbols.animation, fill: 1, weight: 500),
|
||||
title: Text("background_card_animation".tr()),
|
||||
toggled: PreferencesHelper.getBool(
|
||||
"CardBackgroundAnimations",
|
||||
) ??
|
||||
true,
|
||||
onChanged: (value) {
|
||||
context
|
||||
.read<UnitSettingsNotifier>()
|
||||
.updateuseCardBackgroundAnimations(value);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
SettingActionTile(
|
||||
icon: Icon(
|
||||
Symbols.nest_farsight_weather,
|
||||
fill: 1,
|
||||
weight: 500,
|
||||
),
|
||||
title: Text('weather_models'.tr()),
|
||||
description: Text('openmeteo_weather_models'.tr()),
|
||||
trailing: Icon(Icons.chevron_right),
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => const MeteoModelsPage(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
SettingSection(
|
||||
styleTile: true,
|
||||
title: SettingSectionTitle(
|
||||
'additional'.tr(),
|
||||
@@ -391,14 +406,18 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
SettingActionTile(
|
||||
icon: Icon(Symbols.language, fill: 1, weight: 500),
|
||||
title: Text('app_language'.tr()),
|
||||
description: Text(getLanguageNamesSettingsView(
|
||||
context.locale)['english']
|
||||
.toString()),
|
||||
description: Text(
|
||||
getLanguageNamesSettingsView(
|
||||
context.locale,
|
||||
)['english']
|
||||
.toString(),
|
||||
),
|
||||
trailing: Icon(Icons.chevron_right),
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => const LanguagesScreen()),
|
||||
builder: (_) => const LanguagesScreen(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -416,7 +435,8 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
trailing: Icon(Icons.chevron_right),
|
||||
onTap: () async {
|
||||
await DataBackupService.importAndReplaceAllData(
|
||||
context);
|
||||
context,
|
||||
);
|
||||
},
|
||||
),
|
||||
SettingActionTile(
|
||||
@@ -425,16 +445,16 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
description: Text('learn_about_app'.tr()),
|
||||
trailing: Icon(Icons.chevron_right),
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(builder: (_) => AboutPage()),
|
||||
);
|
||||
Navigator.of(
|
||||
context,
|
||||
).push(MaterialPageRoute(builder: (_) => AboutPage()));
|
||||
},
|
||||
),
|
||||
]),
|
||||
SizedBox(
|
||||
height: 200,
|
||||
),
|
||||
]),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 200),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -506,7 +526,7 @@ Map<String, String> getLanguageNamesSettingsView(Locale locale) {
|
||||
if (lang == 'pt' && country == 'PT') {
|
||||
return {
|
||||
'native': 'Português (Portugal)',
|
||||
'english': 'Portuguese (Portugal)'
|
||||
'english': 'Portuguese (Portugal)',
|
||||
};
|
||||
}
|
||||
if (lang == 'ro' && country == 'RO') {
|
||||
@@ -548,6 +568,6 @@ Map<String, String> getLanguageNamesSettingsView(Locale locale) {
|
||||
|
||||
return {
|
||||
'native': '$lang${country != null ? "_$country" : ""}',
|
||||
'english': 'Unknown'
|
||||
'english': 'Unknown',
|
||||
};
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
+15
@@ -539,3 +539,18 @@ create_cxx_tasks
|
||||
[gap of 24ms]
|
||||
create_cxx_tasks completed in 237ms
|
||||
|
||||
# C/C++ build system timings
|
||||
create_cxx_tasks
|
||||
create-initial-cxx-model
|
||||
create-module-model 40ms
|
||||
create-variant-model 16ms
|
||||
create-ARMEABI_V7A-model 40ms
|
||||
create-ARM64_V8A-model 16ms
|
||||
[gap of 28ms]
|
||||
create-ARMEABI_V7A-model 10ms
|
||||
create-ARM64_V8A-model 14ms
|
||||
[gap of 52ms]
|
||||
create-initial-cxx-model completed in 224ms
|
||||
[gap of 26ms]
|
||||
create_cxx_tasks completed in 259ms
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
# C/C++ build system timings
|
||||
create_cxx_tasks
|
||||
create-initial-cxx-model
|
||||
create-module-model 14ms
|
||||
create-ARMEABI_V7A-model 10ms
|
||||
[gap of 36ms]
|
||||
create-ARMEABI_V7A-model 23ms
|
||||
[gap of 57ms]
|
||||
create-initial-cxx-model completed in 146ms
|
||||
create_cxx_tasks completed in 154ms
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
# C/C++ build system timings
|
||||
create_cxx_tasks
|
||||
create-initial-cxx-model
|
||||
create-module-model 10ms
|
||||
[gap of 87ms]
|
||||
create-initial-cxx-model completed in 97ms
|
||||
create_cxx_tasks completed in 101ms
|
||||
|
||||
Reference in new issue
Block a user