mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-12 18:08:10 +02:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d32befb832 | ||
|
94d8295992 | ||
|
dcf9f5732a | ||
|
c89790d58f | ||
|
3633c58bea | ||
|
9770501aec | ||
|
167d0ccced | ||
|
430d1f2690 |
BIN
assets/fonts/Montserrat-Regular.ttf
Normal file
BIN
assets/fonts/Montserrat-Regular.ttf
Normal file
Binary file not shown.
Binary file not shown.
@@ -255,7 +255,7 @@
|
|||||||
"intermediateLinkNotFound": "Intermediate veza nije nađena",
|
"intermediateLinkNotFound": "Intermediate veza nije nađena",
|
||||||
"intermediateLink": "Intermediate veza",
|
"intermediateLink": "Intermediate veza",
|
||||||
"exemptFromBackgroundUpdates": "Izuzmi iz ažuriranja u pozadini (ako su uključeni)",
|
"exemptFromBackgroundUpdates": "Izuzmi iz ažuriranja u pozadini (ako su uključeni)",
|
||||||
"bgUpdatesOnWiFiOnly": "Isključite ažuriranje u pozadini kada niste na WiFi-ju",
|
"bgUpdatesOnWiFiOnly": "Isključite ažuriranje u pozadini kada niste naWi-Fi-ju",
|
||||||
"bgUpdatesWhileChargingOnly": "Disable background updates when not charging",
|
"bgUpdatesWhileChargingOnly": "Disable background updates when not charging",
|
||||||
"autoSelectHighestVersionCode": "Automatski izaberite najveću (verziju) versionCode APK-a",
|
"autoSelectHighestVersionCode": "Automatski izaberite najveću (verziju) versionCode APK-a",
|
||||||
"versionExtractionRegEx": "RegEx ekstrakcija verzije",
|
"versionExtractionRegEx": "RegEx ekstrakcija verzije",
|
||||||
|
@@ -255,7 +255,7 @@
|
|||||||
"intermediateLinkNotFound": "Intermediate link not found",
|
"intermediateLinkNotFound": "Intermediate link not found",
|
||||||
"intermediateLink": "Intermediate link",
|
"intermediateLink": "Intermediate link",
|
||||||
"exemptFromBackgroundUpdates": "Exempt from background updates (if enabled)",
|
"exemptFromBackgroundUpdates": "Exempt from background updates (if enabled)",
|
||||||
"bgUpdatesOnWiFiOnly": "Disable background updates when not on WiFi",
|
"bgUpdatesOnWiFiOnly": "Disable background updates when not onWi-Fi",
|
||||||
"bgUpdatesWhileChargingOnly": "Disable background updates when not charging",
|
"bgUpdatesWhileChargingOnly": "Disable background updates when not charging",
|
||||||
"autoSelectHighestVersionCode": "Auto-select highest versionCode APK",
|
"autoSelectHighestVersionCode": "Auto-select highest versionCode APK",
|
||||||
"versionExtractionRegEx": "Version String Extraction RegEx",
|
"versionExtractionRegEx": "Version String Extraction RegEx",
|
||||||
|
@@ -255,7 +255,7 @@
|
|||||||
"intermediateLinkNotFound": "Enlace intermedio no encontrado",
|
"intermediateLinkNotFound": "Enlace intermedio no encontrado",
|
||||||
"intermediateLink": "Enlace intermedio",
|
"intermediateLink": "Enlace intermedio",
|
||||||
"exemptFromBackgroundUpdates": "Exenta de actualizciones en segundo plano (si están habilitadas)",
|
"exemptFromBackgroundUpdates": "Exenta de actualizciones en segundo plano (si están habilitadas)",
|
||||||
"bgUpdatesOnWiFiOnly": "Deshabilitar las actualizaciones en segundo plano sin WiFi",
|
"bgUpdatesOnWiFiOnly": "Deshabilitar las actualizaciones en segundo plano sinWi-Fi",
|
||||||
"bgUpdatesWhileChargingOnly": "Desactiva las actualizaciones en segundo plano cuando no estés cargando",
|
"bgUpdatesWhileChargingOnly": "Desactiva las actualizaciones en segundo plano cuando no estés cargando",
|
||||||
"autoSelectHighestVersionCode": "Auto selección del paquete APK con versión más reciente",
|
"autoSelectHighestVersionCode": "Auto selección del paquete APK con versión más reciente",
|
||||||
"versionExtractionRegEx": "Versión de extracción RegEx",
|
"versionExtractionRegEx": "Versión de extracción RegEx",
|
||||||
|
@@ -255,7 +255,7 @@
|
|||||||
"intermediateLinkNotFound": "لینک میانی پیدا نشد",
|
"intermediateLinkNotFound": "لینک میانی پیدا نشد",
|
||||||
"intermediateLink": "پیوند میانی",
|
"intermediateLink": "پیوند میانی",
|
||||||
"exemptFromBackgroundUpdates": "معاف از بهروزرسانیهای پسزمینه (در صورت فعال بودن)",
|
"exemptFromBackgroundUpdates": "معاف از بهروزرسانیهای پسزمینه (در صورت فعال بودن)",
|
||||||
"bgUpdatesOnWiFiOnly": "بهروزرسانیهای پسزمینه را در صورت عدم اتصال به WiFi غیرفعال کنید",
|
"bgUpdatesOnWiFiOnly": "بهروزرسانیهای پسزمینه را در صورت عدم اتصال بهWi-Fi غیرفعال کنید",
|
||||||
"bgUpdatesWhileChargingOnly": "بهروزرسانیهای پسزمینه را هنگام شارژ نشدن غیرفعال کنید",
|
"bgUpdatesWhileChargingOnly": "بهروزرسانیهای پسزمینه را هنگام شارژ نشدن غیرفعال کنید",
|
||||||
"autoSelectHighestVersionCode": "انتخاب خودکار بالاترین نسخه کد APK",
|
"autoSelectHighestVersionCode": "انتخاب خودکار بالاترین نسخه کد APK",
|
||||||
"versionExtractionRegEx": "نسخه استخراج RegEx",
|
"versionExtractionRegEx": "نسخه استخراج RegEx",
|
||||||
|
@@ -255,7 +255,7 @@
|
|||||||
"intermediateLinkNotFound": "Lien intermédiaire introuvable",
|
"intermediateLinkNotFound": "Lien intermédiaire introuvable",
|
||||||
"intermediateLink": "Lien intermédiaire",
|
"intermediateLink": "Lien intermédiaire",
|
||||||
"exemptFromBackgroundUpdates": "Exclure de la mise à jour en arrière-plan (si activé)",
|
"exemptFromBackgroundUpdates": "Exclure de la mise à jour en arrière-plan (si activé)",
|
||||||
"bgUpdatesOnWiFiOnly": "Désactiver les mises à jour en arrière-plan lorsque vous n'êtes pas en WiFi",
|
"bgUpdatesOnWiFiOnly": "Désactiver les mises à jour en arrière-plan lorsque vous n'êtes pas enWi-Fi",
|
||||||
"bgUpdatesWhileChargingOnly": "Désactiver les mises à jour en arrière-plan lorsque le véhicule n'est pas en charge",
|
"bgUpdatesWhileChargingOnly": "Désactiver les mises à jour en arrière-plan lorsque le véhicule n'est pas en charge",
|
||||||
"autoSelectHighestVersionCode": "Sélectionner automatiquement la version la plus récente du code APK",
|
"autoSelectHighestVersionCode": "Sélectionner automatiquement la version la plus récente du code APK",
|
||||||
"versionExtractionRegEx": "Extraire la version par Expression régulière",
|
"versionExtractionRegEx": "Extraire la version par Expression régulière",
|
||||||
|
@@ -255,7 +255,7 @@
|
|||||||
"intermediateLinkNotFound": "Tautan perantara tidak ditemukan",
|
"intermediateLinkNotFound": "Tautan perantara tidak ditemukan",
|
||||||
"intermediateLink": "Tautan perantara",
|
"intermediateLink": "Tautan perantara",
|
||||||
"exemptFromBackgroundUpdates": "Dikecualikan dari pembaruan latar belakang (jika diaktifkan)",
|
"exemptFromBackgroundUpdates": "Dikecualikan dari pembaruan latar belakang (jika diaktifkan)",
|
||||||
"bgUpdatesOnWiFiOnly": "Nonaktifkan pembaruan latar belakang saat tidak menggunakan WiFi",
|
"bgUpdatesOnWiFiOnly": "Nonaktifkan pembaruan latar belakang saat tidak menggunakanWi-Fi",
|
||||||
"bgUpdatesWhileChargingOnly": "Menonaktifkan pembaruan latar belakang saat tidak mengisi daya",
|
"bgUpdatesWhileChargingOnly": "Menonaktifkan pembaruan latar belakang saat tidak mengisi daya",
|
||||||
"autoSelectHighestVersionCode": "Pilih otomatis APK dengan versi kode tertinggi",
|
"autoSelectHighestVersionCode": "Pilih otomatis APK dengan versi kode tertinggi",
|
||||||
"versionExtractionRegEx": "Reguler ekspresi terkait ekstraksi versi string",
|
"versionExtractionRegEx": "Reguler ekspresi terkait ekstraksi versi string",
|
||||||
|
@@ -255,7 +255,7 @@
|
|||||||
"intermediateLinkNotFound": "Link intermedio non trovato",
|
"intermediateLinkNotFound": "Link intermedio non trovato",
|
||||||
"intermediateLink": "Collegamento intermedio",
|
"intermediateLink": "Collegamento intermedio",
|
||||||
"exemptFromBackgroundUpdates": "Esente da aggiornamenti in secondo piano (se attivo)",
|
"exemptFromBackgroundUpdates": "Esente da aggiornamenti in secondo piano (se attivo)",
|
||||||
"bgUpdatesOnWiFiOnly": "Disattiva aggiornamenti in secondo piano quando non si usa il WiFi",
|
"bgUpdatesOnWiFiOnly": "Disattiva aggiornamenti in secondo piano quando non si usa ilWi-Fi",
|
||||||
"bgUpdatesWhileChargingOnly": "Disabilita gli aggiornamenti in background quando non è in carica",
|
"bgUpdatesWhileChargingOnly": "Disabilita gli aggiornamenti in background quando non è in carica",
|
||||||
"autoSelectHighestVersionCode": "Auto-seleziona APK con versionCode più alto",
|
"autoSelectHighestVersionCode": "Auto-seleziona APK con versionCode più alto",
|
||||||
"versionExtractionRegEx": "RegEx di estrazione versione",
|
"versionExtractionRegEx": "RegEx di estrazione versione",
|
||||||
|
@@ -255,7 +255,7 @@
|
|||||||
"intermediateLinkNotFound": "Intermediaire link niet gevonden",
|
"intermediateLinkNotFound": "Intermediaire link niet gevonden",
|
||||||
"intermediateLink": "Intermediaire link",
|
"intermediateLink": "Intermediaire link",
|
||||||
"exemptFromBackgroundUpdates": "Vrijgesteld van achtergrond-updates (indien ingeschakeld)",
|
"exemptFromBackgroundUpdates": "Vrijgesteld van achtergrond-updates (indien ingeschakeld)",
|
||||||
"bgUpdatesOnWiFiOnly": "Achtergrond-updates uitschakelen wanneer niet verbonden met WiFi",
|
"bgUpdatesOnWiFiOnly": "Achtergrond-updates uitschakelen wanneer niet verbonden metWi-Fi",
|
||||||
"bgUpdatesWhileChargingOnly": "Achtergrondupdates uitschakelen als er niet wordt opgeladen",
|
"bgUpdatesWhileChargingOnly": "Achtergrondupdates uitschakelen als er niet wordt opgeladen",
|
||||||
"autoSelectHighestVersionCode": "De APK met de hoogste versiecode automatisch selecteren",
|
"autoSelectHighestVersionCode": "De APK met de hoogste versiecode automatisch selecteren",
|
||||||
"versionExtractionRegEx": "Reguliere expressie voor versie-extractie",
|
"versionExtractionRegEx": "Reguliere expressie voor versie-extractie",
|
||||||
|
@@ -255,7 +255,7 @@
|
|||||||
"intermediateLinkNotFound": "Mellanlänk hittades inte",
|
"intermediateLinkNotFound": "Mellanlänk hittades inte",
|
||||||
"intermediateLink": "Mellanlänk",
|
"intermediateLink": "Mellanlänk",
|
||||||
"exemptFromBackgroundUpdates": "Undta från bakgrundsuppdateringar (om aktiverad)",
|
"exemptFromBackgroundUpdates": "Undta från bakgrundsuppdateringar (om aktiverad)",
|
||||||
"bgUpdatesOnWiFiOnly": "Inaktivera Bakgrundsuppdateringar utan WiFi",
|
"bgUpdatesOnWiFiOnly": "Inaktivera Bakgrundsuppdateringar utanWi-Fi",
|
||||||
"bgUpdatesWhileChargingOnly": "Inaktivera bakgrundsuppdateringar när du inte laddar",
|
"bgUpdatesWhileChargingOnly": "Inaktivera bakgrundsuppdateringar när du inte laddar",
|
||||||
"autoSelectHighestVersionCode": "Välj automatiskt högsta versionskod APK",
|
"autoSelectHighestVersionCode": "Välj automatiskt högsta versionskod APK",
|
||||||
"versionExtractionRegEx": "Version Extraction RegEx",
|
"versionExtractionRegEx": "Version Extraction RegEx",
|
||||||
|
@@ -255,7 +255,7 @@
|
|||||||
"intermediateLinkNotFound": "Không tìm thấy liên kết trung gian",
|
"intermediateLinkNotFound": "Không tìm thấy liên kết trung gian",
|
||||||
"intermediateLink": "Liên kết trung gian",
|
"intermediateLink": "Liên kết trung gian",
|
||||||
"exemptFromBackgroundUpdates": "Miễn cập nhật nền (nếu được bật)",
|
"exemptFromBackgroundUpdates": "Miễn cập nhật nền (nếu được bật)",
|
||||||
"bgUpdatesOnWiFiOnly": "Tắt cập nhật nền khi không có WiFi",
|
"bgUpdatesOnWiFiOnly": "Tắt cập nhật nền khi không cóWi-Fi",
|
||||||
"bgUpdatesWhileChargingOnly": "Disable background updates when not charging",
|
"bgUpdatesWhileChargingOnly": "Disable background updates when not charging",
|
||||||
"autoSelectHighestVersionCode": "Tự động chọn APK mã phiên bản cao nhất",
|
"autoSelectHighestVersionCode": "Tự động chọn APK mã phiên bản cao nhất",
|
||||||
"versionExtractionRegEx": "Trích xuất phiên bản RegEx",
|
"versionExtractionRegEx": "Trích xuất phiên bản RegEx",
|
||||||
|
@@ -255,7 +255,7 @@
|
|||||||
"intermediateLinkNotFound": "沒有找到中間連結",
|
"intermediateLinkNotFound": "沒有找到中間連結",
|
||||||
"intermediateLink": "中間連結",
|
"intermediateLink": "中間連結",
|
||||||
"exemptFromBackgroundUpdates": "免除背景更新(若已啟用)",
|
"exemptFromBackgroundUpdates": "免除背景更新(若已啟用)",
|
||||||
"bgUpdatesOnWiFiOnly": "停用非 WiFi 的背景更新",
|
"bgUpdatesOnWiFiOnly": "停用非Wi-Fi 的背景更新",
|
||||||
"bgUpdatesWhileChargingOnly": "Disable background updates when not charging",
|
"bgUpdatesWhileChargingOnly": "Disable background updates when not charging",
|
||||||
"autoSelectHighestVersionCode": "自動選擇最高 versionCode 的 APK",
|
"autoSelectHighestVersionCode": "自動選擇最高 versionCode 的 APK",
|
||||||
"versionExtractionRegEx": "版本字串提取正則表達式",
|
"versionExtractionRegEx": "版本字串提取正則表達式",
|
||||||
|
@@ -163,29 +163,39 @@ class GitLab extends AppSource {
|
|||||||
apkDetailsList = json.map((e) {
|
apkDetailsList = json.map((e) {
|
||||||
var apkUrlsFromAssets = (e['assets']?['links'] as List<dynamic>? ?? [])
|
var apkUrlsFromAssets = (e['assets']?['links'] as List<dynamic>? ?? [])
|
||||||
.map((e) {
|
.map((e) {
|
||||||
return (e['direct_asset_url'] ?? e['url'] ?? '') as String;
|
var url = (e['direct_asset_url'] ?? e['url'] ?? '') as String;
|
||||||
|
var parsedUrl = url.isNotEmpty ? Uri.parse(url) : null;
|
||||||
|
return MapEntry(
|
||||||
|
(e['name'] ??
|
||||||
|
(parsedUrl != null && parsedUrl.pathSegments.isNotEmpty
|
||||||
|
? parsedUrl.pathSegments.last
|
||||||
|
: 'unknown')) as String,
|
||||||
|
(e['direct_asset_url'] ?? e['url'] ?? '') as String);
|
||||||
})
|
})
|
||||||
.where((s) => s.isNotEmpty)
|
.where((s) => s.key.isNotEmpty)
|
||||||
.toList();
|
.toList();
|
||||||
List<String> uploadedAPKsFromDescription =
|
var uploadedAPKsFromDescription = ((e['description'] ?? '') as String)
|
||||||
((e['description'] ?? '') as String)
|
.split('](')
|
||||||
.split('](')
|
.join('\n')
|
||||||
.join('\n')
|
.split('.apk)')
|
||||||
.split('.apk)')
|
.join('.apk\n')
|
||||||
.join('.apk\n')
|
.split('\n')
|
||||||
.split('\n')
|
.where((s) => s.startsWith('/uploads/') && s.endsWith('apk'))
|
||||||
.where((s) => s.startsWith('/uploads/') && s.endsWith('apk'))
|
.map((s) => 'https://${hosts[0]}/-/project/$projectId$s')
|
||||||
.map((s) => 'https://${hosts[0]}/-/project/$projectId$s')
|
.map((l) => MapEntry(Uri.parse(l).pathSegments.last, l))
|
||||||
.toList();
|
.toList();
|
||||||
var apkUrlsSet = apkUrlsFromAssets.toSet();
|
Map<String, String> apkUrls = {};
|
||||||
apkUrlsSet.addAll(uploadedAPKsFromDescription);
|
for (var entry in apkUrlsFromAssets) {
|
||||||
|
apkUrls[entry.key] = entry.value;
|
||||||
|
}
|
||||||
|
for (var entry in uploadedAPKsFromDescription) {
|
||||||
|
apkUrls[entry.key] = entry.value;
|
||||||
|
}
|
||||||
var releaseDateString =
|
var releaseDateString =
|
||||||
e['released_at'] ?? e['created_at'] ?? e['commit']?['created_at'];
|
e['released_at'] ?? e['created_at'] ?? e['commit']?['created_at'];
|
||||||
DateTime? releaseDate =
|
DateTime? releaseDate =
|
||||||
releaseDateString != null ? DateTime.parse(releaseDateString) : null;
|
releaseDateString != null ? DateTime.parse(releaseDateString) : null;
|
||||||
return APKDetails(
|
return APKDetails(e['tag_name'] ?? e['name'], apkUrls.entries.toList(),
|
||||||
e['tag_name'] ?? e['name'],
|
|
||||||
getApkUrlsFromUrls(apkUrlsSet.toList()),
|
|
||||||
AppNames(names.author, names.name.split('/').last),
|
AppNames(names.author, names.name.split('/').last),
|
||||||
releaseDate: releaseDate);
|
releaseDate: releaseDate);
|
||||||
});
|
});
|
||||||
|
@@ -358,10 +358,12 @@ class HTML extends AppSource {
|
|||||||
.toString();
|
.toString();
|
||||||
return APKDetails(
|
return APKDetails(
|
||||||
version,
|
version,
|
||||||
[rel]
|
[rel].map((e) {
|
||||||
.map((e) =>
|
var uri = Uri.parse(e);
|
||||||
MapEntry('${e.hashCode}-${Uri.parse(e).pathSegments.last}', e))
|
var fileName =
|
||||||
.toList(),
|
uri.pathSegments.isNotEmpty ? uri.pathSegments.last : uri.origin;
|
||||||
|
return MapEntry('${e.hashCode}-$fileName', e);
|
||||||
|
}).toList(),
|
||||||
AppNames(uri.host, tr('app')));
|
AppNames(uri.host, tr('app')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -23,7 +23,7 @@ import 'package:easy_localization/src/localization.dart';
|
|||||||
List<MapEntry<Locale, String>> supportedLocales = const [
|
List<MapEntry<Locale, String>> supportedLocales = const [
|
||||||
MapEntry(Locale('en'), 'English'),
|
MapEntry(Locale('en'), 'English'),
|
||||||
MapEntry(Locale('zh'), '简体中文'),
|
MapEntry(Locale('zh'), '简体中文'),
|
||||||
MapEntry(Locale('zh_Hant_TW'), '臺灣話'),
|
MapEntry(Locale('zh', 'Hant_TW'), '臺灣話'),
|
||||||
MapEntry(Locale('it'), 'Italiano'),
|
MapEntry(Locale('it'), 'Italiano'),
|
||||||
MapEntry(Locale('ja'), '日本語'),
|
MapEntry(Locale('ja'), '日本語'),
|
||||||
MapEntry(Locale('hu'), 'Magyar'),
|
MapEntry(Locale('hu'), 'Magyar'),
|
||||||
@@ -61,11 +61,11 @@ Future<void> loadTranslations() async {
|
|||||||
var forceLocale = s.forcedLocale;
|
var forceLocale = s.forcedLocale;
|
||||||
final controller = EasyLocalizationController(
|
final controller = EasyLocalizationController(
|
||||||
saveLocale: true,
|
saveLocale: true,
|
||||||
forceLocale: forceLocale != null ? Locale(forceLocale) : null,
|
forceLocale: forceLocale,
|
||||||
fallbackLocale: fallbackLocale,
|
fallbackLocale: fallbackLocale,
|
||||||
supportedLocales: supportedLocales.map((e) => e.key).toList(),
|
supportedLocales: supportedLocales.map((e) => e.key).toList(),
|
||||||
assetLoader: const RootBundleAssetLoader(),
|
assetLoader: const RootBundleAssetLoader(),
|
||||||
useOnlyLangCode: true,
|
useOnlyLangCode: false,
|
||||||
useFallbackTranslations: true,
|
useFallbackTranslations: true,
|
||||||
path: localeDir,
|
path: localeDir,
|
||||||
onLoadError: (FlutterError e) {
|
onLoadError: (FlutterError e) {
|
||||||
@@ -119,7 +119,7 @@ void main() async {
|
|||||||
supportedLocales: supportedLocales.map((e) => e.key).toList(),
|
supportedLocales: supportedLocales.map((e) => e.key).toList(),
|
||||||
path: localeDir,
|
path: localeDir,
|
||||||
fallbackLocale: fallbackLocale,
|
fallbackLocale: fallbackLocale,
|
||||||
useOnlyLangCode: true,
|
useOnlyLangCode: false,
|
||||||
child: const Obtainium()),
|
child: const Obtainium()),
|
||||||
));
|
));
|
||||||
BackgroundFetch.registerHeadlessTask(backgroundFetchHeadlessTask);
|
BackgroundFetch.registerHeadlessTask(backgroundFetchHeadlessTask);
|
||||||
@@ -203,12 +203,9 @@ class _ObtainiumState extends State<Obtainium> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!supportedLocales
|
if (!supportedLocales.map((e) => e.key).contains(context.locale) ||
|
||||||
.map((e) => e.key.languageCode)
|
|
||||||
.contains(context.locale.languageCode) ||
|
|
||||||
(settingsProvider.forcedLocale == null &&
|
(settingsProvider.forcedLocale == null &&
|
||||||
context.deviceLocale.languageCode !=
|
context.deviceLocale != context.locale)) {
|
||||||
context.locale.languageCode)) {
|
|
||||||
settingsProvider.resetLocaleSafe(context);
|
settingsProvider.resetLocaleSafe(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -251,17 +248,15 @@ class _ObtainiumState extends State<Obtainium> {
|
|||||||
colorScheme: settingsProvider.theme == ThemeSettings.dark
|
colorScheme: settingsProvider.theme == ThemeSettings.dark
|
||||||
? darkColorScheme
|
? darkColorScheme
|
||||||
: lightColorScheme,
|
: lightColorScheme,
|
||||||
fontFamily: settingsProvider.useSystemFont
|
fontFamily:
|
||||||
? 'SystemFont'
|
settingsProvider.useSystemFont ? 'SystemFont' : 'Montserrat'),
|
||||||
: 'Wix-Madefor-Display'),
|
|
||||||
darkTheme: ThemeData(
|
darkTheme: ThemeData(
|
||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
colorScheme: settingsProvider.theme == ThemeSettings.light
|
colorScheme: settingsProvider.theme == ThemeSettings.light
|
||||||
? lightColorScheme
|
? lightColorScheme
|
||||||
: darkColorScheme,
|
: darkColorScheme,
|
||||||
fontFamily: settingsProvider.useSystemFont
|
fontFamily:
|
||||||
? 'SystemFont'
|
settingsProvider.useSystemFont ? 'SystemFont' : 'Montserrat'),
|
||||||
: 'Wix-Madefor-Display'),
|
|
||||||
home: Shortcuts(shortcuts: <LogicalKeySet, Intent>{
|
home: Shortcuts(shortcuts: <LogicalKeySet, Intent>{
|
||||||
LogicalKeySet(LogicalKeyboardKey.select): const ActivateIntent(),
|
LogicalKeySet(LogicalKeyboardKey.select): const ActivateIntent(),
|
||||||
}, child: const HomePage()));
|
}, child: const HomePage()));
|
||||||
|
@@ -262,14 +262,14 @@ class _SettingsPageState extends State<SettingsPage> {
|
|||||||
child: Text(tr('followSystem')),
|
child: Text(tr('followSystem')),
|
||||||
),
|
),
|
||||||
...supportedLocales.map((e) => DropdownMenuItem(
|
...supportedLocales.map((e) => DropdownMenuItem(
|
||||||
value: e.key.toLanguageTag(),
|
value: e.key,
|
||||||
child: Text(e.value),
|
child: Text(e.value),
|
||||||
))
|
))
|
||||||
],
|
],
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
settingsProvider.forcedLocale = value;
|
settingsProvider.forcedLocale = value;
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
context.setLocale(Locale(value));
|
context.setLocale(value);
|
||||||
} else {
|
} else {
|
||||||
settingsProvider.resetLocaleSafe(context);
|
settingsProvider.resetLocaleSafe(context);
|
||||||
}
|
}
|
||||||
|
@@ -261,22 +261,24 @@ class SettingsProvider with ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
String? get forcedLocale {
|
Locale? get forcedLocale {
|
||||||
var fl = prefs?.getString('forcedLocale');
|
var flSegs = prefs?.getString('forcedLocale')?.split('-');
|
||||||
return supportedLocales
|
var fl = flSegs != null && flSegs.isNotEmpty
|
||||||
.where((element) => element.key.toLanguageTag() == fl)
|
? Locale(flSegs[0], flSegs.length > 1 ? flSegs[1] : null)
|
||||||
.isNotEmpty
|
: null;
|
||||||
|
var set = supportedLocales.where((element) => element.key == fl).isNotEmpty
|
||||||
? fl
|
? fl
|
||||||
: null;
|
: null;
|
||||||
|
return set;
|
||||||
}
|
}
|
||||||
|
|
||||||
set forcedLocale(String? fl) {
|
set forcedLocale(Locale? fl) {
|
||||||
if (fl == null) {
|
if (fl == null) {
|
||||||
prefs?.remove('forcedLocale');
|
prefs?.remove('forcedLocale');
|
||||||
} else if (supportedLocales
|
} else if (supportedLocales
|
||||||
.where((element) => element.key.toLanguageTag() == fl)
|
.where((element) => element.key == fl)
|
||||||
.isNotEmpty) {
|
.isNotEmpty) {
|
||||||
prefs?.setString('forcedLocale', fl);
|
prefs?.setString('forcedLocale', fl.toLanguageTag());
|
||||||
}
|
}
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
@@ -285,9 +287,7 @@ class SettingsProvider with ChangeNotifier {
|
|||||||
a.length == b.length && a.union(b).length == a.length;
|
a.length == b.length && a.union(b).length == a.length;
|
||||||
|
|
||||||
void resetLocaleSafe(BuildContext context) {
|
void resetLocaleSafe(BuildContext context) {
|
||||||
if (context.supportedLocales
|
if (context.supportedLocales.contains(context.deviceLocale)) {
|
||||||
.map((e) => e.languageCode)
|
|
||||||
.contains(context.deviceLocale.languageCode)) {
|
|
||||||
context.resetLocale();
|
context.resetLocale();
|
||||||
} else {
|
} else {
|
||||||
context.setLocale(context.fallbackLocale!);
|
context.setLocale(context.fallbackLocale!);
|
||||||
|
44
pubspec.lock
44
pubspec.lock
@@ -48,10 +48,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: app_links
|
name: app_links
|
||||||
sha256: "433df2e61b10519407475d7f69e470789d23d593f28224c38ba1068597be7950"
|
sha256: "85ed8fc1d25a76475914fff28cc994653bd900bc2c26e4b57a49e097febb54ba"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.3.3"
|
version: "6.4.0"
|
||||||
app_links_linux:
|
app_links_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -288,10 +288,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: ffi
|
name: ffi
|
||||||
sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
|
sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.3"
|
version: "2.1.4"
|
||||||
file:
|
file:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -304,10 +304,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: file_picker
|
name: file_picker
|
||||||
sha256: "3d57312a53746ed4eb8c843dc50372454bbda37dd0c01a4d40fedc83e2ce4921"
|
sha256: "6f6bfa8797f296965bdc3e1f702574ab49a540c19b9237b401e7c2b25dfe594c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.3.5"
|
version: "9.0.0"
|
||||||
fixnum:
|
fixnum:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -756,26 +756,26 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: permission_handler
|
name: permission_handler
|
||||||
sha256: "18bf33f7fefbd812f37e72091a15575e72d5318854877e0e4035a24ac1113ecb"
|
sha256: "59adad729136f01ea9e35a48f5d1395e25cba6cea552249ddbe9cf950f5d7849"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "11.3.1"
|
version: "11.4.0"
|
||||||
permission_handler_android:
|
permission_handler_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: permission_handler_android
|
name: permission_handler_android
|
||||||
sha256: "71bbecfee799e65aff7c744761a57e817e73b738fedf62ab7afd5593da21f9f1"
|
sha256: d3971dcdd76182a0c198c096b5db2f0884b0d4196723d21a866fc4cdea057ebc
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "12.0.13"
|
version: "12.1.0"
|
||||||
permission_handler_apple:
|
permission_handler_apple:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: permission_handler_apple
|
name: permission_handler_apple
|
||||||
sha256: e6f6d73b12438ef13e648c4ae56bd106ec60d17e90a59c4545db6781229082a0
|
sha256: f84a188e79a35c687c132a0a0556c254747a08561e99ab933f12f6ca71ef3c98
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "9.4.5"
|
version: "9.4.6"
|
||||||
permission_handler_html:
|
permission_handler_html:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -788,10 +788,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: permission_handler_platform_interface
|
name: permission_handler_platform_interface
|
||||||
sha256: e9c8eadee926c4532d0305dff94b85bf961f16759c3af791486613152af4b4f9
|
sha256: eb99b295153abce5d683cac8c02e22faab63e50679b937fa1bf67d58bb282878
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.2.3"
|
version: "4.3.0"
|
||||||
permission_handler_windows:
|
permission_handler_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -900,10 +900,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_android
|
name: shared_preferences_android
|
||||||
sha256: ea86be7b7114f9e94fddfbb52649e59a03d6627ccd2387ebddcd6624719e9f16
|
sha256: a768fc8ede5f0c8e6150476e14f38e2417c0864ca36bb4582be8e21925a03c22
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.5"
|
version: "2.4.6"
|
||||||
shared_preferences_foundation:
|
shared_preferences_foundation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -932,10 +932,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_web
|
name: shared_preferences_web
|
||||||
sha256: d2ca4132d3946fec2184261726b355836a82c33d7d5b67af32692aff18a4684e
|
sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.2"
|
version: "2.4.3"
|
||||||
shared_preferences_windows:
|
shared_preferences_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1219,18 +1219,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: webview_flutter_wkwebview
|
name: webview_flutter_wkwebview
|
||||||
sha256: "8e0593559bfecd35eb1757d6907ed6b995a41ef82607d6113df897c2805ce6be"
|
sha256: d7403ef4f042714c9ee2b26eaac4cadae7394cb0d4e608b1dd850c3ff96bd893
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.18.0"
|
version: "3.18.2"
|
||||||
win32:
|
win32:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: win32
|
name: win32
|
||||||
sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e
|
sha256: b89e6e24d1454e149ab20fbb225af58660f0c0bf4475544650700d8e2da54aef
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.10.1"
|
version: "5.11.0"
|
||||||
win32_registry:
|
win32_registry:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.1.41+2298
|
version: 1.1.43+2300
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.6.0
|
sdk: ^3.6.0
|
||||||
@@ -47,7 +47,7 @@ dependencies:
|
|||||||
permission_handler: ^11.0.0
|
permission_handler: ^11.0.0
|
||||||
fluttertoast: ^8.0.9
|
fluttertoast: ^8.0.9
|
||||||
device_info_plus: ^11.0.0
|
device_info_plus: ^11.0.0
|
||||||
file_picker: ^8.0.0+1
|
file_picker: ^9.0.0
|
||||||
animations: ^2.0.4
|
animations: ^2.0.4
|
||||||
android_package_installer: # TODO: See if PR will be accepted (dev may not be active), else remove this comment
|
android_package_installer: # TODO: See if PR will be accepted (dev may not be active), else remove this comment
|
||||||
git:
|
git:
|
||||||
@@ -151,6 +151,6 @@ flutter:
|
|||||||
# see https://flutter.dev/to/font-from-package
|
# see https://flutter.dev/to/font-from-package
|
||||||
|
|
||||||
fonts:
|
fonts:
|
||||||
- family: Wix-Madefor-Display
|
- family: Montserrat
|
||||||
fonts:
|
fonts:
|
||||||
- asset: assets/fonts/WixMadeforDisplay-Regular.otf
|
- asset: assets/fonts/Montserrat-Regular.ttf
|
Reference in New Issue
Block a user