mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 04:37:37 +02:00
feat: Allow changing languages (#1488)
Co-authored-by: validcube <pun.butrach@gmail.com>
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart' hide SearchBar;
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/ui/views/app_selector/app_selector_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/widgets/appSelectorView/app_skeleton_loader.dart';
|
||||
import 'package:revanced_manager/ui/widgets/appSelectorView/installed_app_item.dart';
|
||||
@ -25,7 +25,7 @@ class _AppSelectorViewState extends State<AppSelectorView> {
|
||||
viewModelBuilder: () => AppSelectorViewModel(),
|
||||
builder: (context, model, child) => Scaffold(
|
||||
floatingActionButton: HapticFloatingActionButtonExtended(
|
||||
label: I18nText('appSelectorView.storageButton'),
|
||||
label: Text(t.appSelectorView.storageButton),
|
||||
icon: const Icon(Icons.sd_storage),
|
||||
onPressed: () {
|
||||
model.selectAppFromStorage(context);
|
||||
@ -36,8 +36,8 @@ class _AppSelectorViewState extends State<AppSelectorView> {
|
||||
SliverAppBar(
|
||||
pinned: true,
|
||||
floating: true,
|
||||
title: I18nText(
|
||||
'appSelectorView.viewTitle',
|
||||
title: Text(
|
||||
t.appSelectorView.viewTitle,
|
||||
),
|
||||
titleTextStyle: TextStyle(
|
||||
fontSize: 22.0,
|
||||
@ -58,10 +58,7 @@ class _AppSelectorViewState extends State<AppSelectorView> {
|
||||
horizontal: 12.0,
|
||||
),
|
||||
child: SearchBar(
|
||||
hintText: FlutterI18n.translate(
|
||||
context,
|
||||
'appSelectorView.searchBarHint',
|
||||
),
|
||||
hintText: t.appSelectorView.searchBarHint,
|
||||
onQueryChanged: (searchQuery) {
|
||||
setState(() {
|
||||
_query = searchQuery;
|
||||
@ -74,14 +71,10 @@ class _AppSelectorViewState extends State<AppSelectorView> {
|
||||
SliverToBoxAdapter(
|
||||
child: model.noApps
|
||||
? Center(
|
||||
child: I18nText(
|
||||
'appSelectorCard.noAppsLabel',
|
||||
child: Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
color:
|
||||
Theme.of(context).textTheme.titleLarge!.color,
|
||||
),
|
||||
child: Text(
|
||||
t.appSelectorCard.noAppsLabel,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).textTheme.titleLarge!.color,
|
||||
),
|
||||
),
|
||||
)
|
||||
|
@ -5,8 +5,8 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_file_dialog/flutter_file_dialog.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/models/patch.dart';
|
||||
import 'package:revanced_manager/models/patched_application.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
@ -168,25 +168,22 @@ class AppSelectorViewModel extends BaseViewModel {
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: I18nText('warning'),
|
||||
content: I18nText(
|
||||
'appSelectorView.requireSuggestedAppVersionDialogText',
|
||||
translationParams: {
|
||||
'suggested': suggestedVersion,
|
||||
'selected': selectedVersion,
|
||||
},
|
||||
child: const Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
title: Text(t.warning),
|
||||
content: Text(
|
||||
t.appSelectorView.requireSuggestedAppVersionDialogText(
|
||||
suggested: suggestedVersion,
|
||||
selected: selectedVersion,
|
||||
),
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
|
||||
),
|
||||
actions: [
|
||||
FilledButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: I18nText('okButton'),
|
||||
child: Text(t.okButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -208,26 +205,20 @@ class AppSelectorViewModel extends BaseViewModel {
|
||||
color: Theme.of(innerContext).colorScheme.primary,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
I18nText(
|
||||
'appSelectorView.featureNotAvailable',
|
||||
child: const Text(
|
||||
'',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w600,
|
||||
wordSpacing: 1.5,
|
||||
),
|
||||
Text(
|
||||
t.appSelectorView.featureNotAvailable,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w600,
|
||||
wordSpacing: 1.5,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
I18nText(
|
||||
'appSelectorView.featureNotAvailableText',
|
||||
child: const Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
),
|
||||
Text(
|
||||
t.appSelectorView.featureNotAvailableText,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
@ -241,7 +232,7 @@ class AppSelectorViewModel extends BaseViewModel {
|
||||
children: [
|
||||
const Icon(Icons.sd_card),
|
||||
const SizedBox(width: 10),
|
||||
I18nText('appSelectorView.selectFromStorageButton'),
|
||||
Text(t.appSelectorView.selectFromStorageButton),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -254,7 +245,7 @@ class AppSelectorViewModel extends BaseViewModel {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(width: 10),
|
||||
I18nText('cancelButton'),
|
||||
Text(t.cancelButton),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -295,7 +286,7 @@ class AppSelectorViewModel extends BaseViewModel {
|
||||
if (kDebugMode) {
|
||||
print(e);
|
||||
}
|
||||
_toast.showBottom('appSelectorView.errorMessage');
|
||||
_toast.showBottom(t.appSelectorView.errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@ -323,5 +314,5 @@ class AppSelectorViewModel extends BaseViewModel {
|
||||
}
|
||||
|
||||
void showDownloadToast() =>
|
||||
_toast.showBottom('appSelectorView.downloadToast');
|
||||
_toast.showBottom(t.appSelectorView.downloadToast);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/ui/views/contributors/contributors_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/widgets/contributorsView/contributors_card.dart';
|
||||
import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart';
|
||||
@ -18,13 +18,10 @@ class ContributorsView extends StatelessWidget {
|
||||
body: CustomScrollView(
|
||||
slivers: <Widget>[
|
||||
CustomSliverAppBar(
|
||||
title: I18nText(
|
||||
'contributorsView.widgetTitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.inter(
|
||||
color: Theme.of(context).textTheme.titleLarge!.color,
|
||||
),
|
||||
title: Text(
|
||||
t.contributorsView.widgetTitle,
|
||||
style: GoogleFonts.inter(
|
||||
color: Theme.of(context).textTheme.titleLarge!.color,
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -34,27 +31,27 @@ class ContributorsView extends StatelessWidget {
|
||||
delegate: SliverChildListDelegate.fixed(
|
||||
<Widget>[
|
||||
ContributorsCard(
|
||||
title: 'contributorsView.patcherContributors',
|
||||
title: t.contributorsView.patcherContributors,
|
||||
contributors: model.patcherContributors,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ContributorsCard(
|
||||
title: 'contributorsView.patchesContributors',
|
||||
title: t.contributorsView.patchesContributors,
|
||||
contributors: model.patchesContributors,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ContributorsCard(
|
||||
title: 'contributorsView.integrationsContributors',
|
||||
title: t.contributorsView.integrationsContributors,
|
||||
contributors: model.integrationsContributors,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ContributorsCard(
|
||||
title: 'contributorsView.cliContributors',
|
||||
title: t.contributorsView.cliContributors,
|
||||
contributors: model.cliContributors,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ContributorsCard(
|
||||
title: 'contributorsView.managerContributors',
|
||||
title: t.contributorsView.managerContributors,
|
||||
contributors: model.managerContributors,
|
||||
),
|
||||
SizedBox(height: MediaQuery.viewPaddingOf(context).bottom),
|
||||
|
@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/widgets/homeView/installed_apps_card.dart';
|
||||
import 'package:revanced_manager/ui/widgets/homeView/latest_commit_card.dart';
|
||||
@ -25,13 +25,10 @@ class HomeView extends StatelessWidget {
|
||||
slivers: <Widget>[
|
||||
CustomSliverAppBar(
|
||||
isMainView: true,
|
||||
title: I18nText(
|
||||
'homeView.widgetTitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.inter(
|
||||
color: Theme.of(context).textTheme.titleLarge!.color,
|
||||
),
|
||||
title: Text(
|
||||
t.homeView.widgetTitle,
|
||||
style: GoogleFonts.inter(
|
||||
color: Theme.of(context).textTheme.titleLarge!.color,
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -40,22 +37,16 @@ class HomeView extends StatelessWidget {
|
||||
sliver: SliverList(
|
||||
delegate: SliverChildListDelegate.fixed(
|
||||
<Widget>[
|
||||
I18nText(
|
||||
'homeView.updatesSubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
Text(
|
||||
t.homeView.updatesSubtitle,
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
LatestCommitCard(model: model, parentContext: context),
|
||||
const SizedBox(height: 23),
|
||||
I18nText(
|
||||
'homeView.patchedSubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
Text(
|
||||
t.homeView.patchedSubtitle,
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
InstalledAppsCard(),
|
||||
|
@ -1,16 +1,17 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:injectable/injectable.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/app/app.router.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/models/patched_application.dart';
|
||||
import 'package:revanced_manager/services/github_api.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
@ -68,12 +69,12 @@ class HomeViewModel extends BaseViewModel {
|
||||
),
|
||||
onDidReceiveNotificationResponse: (response) async {
|
||||
if (response.id == 0) {
|
||||
_toast.showBottom('homeView.installingMessage');
|
||||
_toast.showBottom(t.homeView.installingMessage);
|
||||
final File? managerApk = await _managerAPI.downloadManager();
|
||||
if (managerApk != null) {
|
||||
await _patcherAPI.installApk(context, managerApk.path);
|
||||
} else {
|
||||
_toast.showBottom('homeView.errorDownloadMessage');
|
||||
_toast.showBottom(t.homeView.errorDownloadMessage);
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -82,22 +83,21 @@ class HomeViewModel extends BaseViewModel {
|
||||
.resolvePlatformSpecificImplementation<
|
||||
AndroidFlutterLocalNotificationsPlugin>()
|
||||
?.requestNotificationsPermission();
|
||||
|
||||
final bool isConnected =
|
||||
await Connectivity().checkConnectivity() != ConnectivityResult.none;
|
||||
if (!isConnected) {
|
||||
_toast.showBottom('homeView.noConnection');
|
||||
_toast.showBottom(t.homeView.noConnection);
|
||||
}
|
||||
|
||||
final NotificationAppLaunchDetails? notificationAppLaunchDetails =
|
||||
await flutterLocalNotificationsPlugin.getNotificationAppLaunchDetails();
|
||||
if (notificationAppLaunchDetails?.didNotificationLaunchApp ?? false) {
|
||||
_toast.showBottom('homeView.installingMessage');
|
||||
_toast.showBottom(t.homeView.installingMessage);
|
||||
final File? managerApk = await _managerAPI.downloadManager();
|
||||
if (managerApk != null) {
|
||||
await _patcherAPI.installApk(context, managerApk.path);
|
||||
} else {
|
||||
_toast.showBottom('homeView.errorDownloadMessage');
|
||||
_toast.showBottom(t.homeView.errorDownloadMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -183,7 +183,7 @@ class HomeViewModel extends BaseViewModel {
|
||||
builder: (context) => PopScope(
|
||||
canPop: false,
|
||||
child: AlertDialog(
|
||||
title: I18nText('homeView.downloadConsentDialogTitle'),
|
||||
title: Text(t.homeView.downloadConsentDialogTitle),
|
||||
content: ValueListenableBuilder(
|
||||
valueListenable: autoUpdate,
|
||||
builder: (context, value, child) {
|
||||
@ -191,31 +191,24 @@ class HomeViewModel extends BaseViewModel {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
I18nText(
|
||||
'homeView.downloadConsentDialogText',
|
||||
child: Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
Text(
|
||||
t.homeView.downloadConsentDialogText,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: I18nText(
|
||||
'homeView.downloadConsentDialogText2',
|
||||
translationParams: {
|
||||
'url': _managerAPI.defaultApiUrl.split('/')[2],
|
||||
},
|
||||
child: Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
),
|
||||
child: Text(
|
||||
t.homeView.downloadConsentDialogText2(
|
||||
url: _managerAPI.defaultApiUrl.split('/')[2],
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -229,7 +222,7 @@ class HomeViewModel extends BaseViewModel {
|
||||
_managerAPI.setDownloadConsent(false);
|
||||
SystemNavigator.pop();
|
||||
},
|
||||
child: I18nText('quitButton'),
|
||||
child: Text(t.quitButton),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () async {
|
||||
@ -237,7 +230,7 @@ class HomeViewModel extends BaseViewModel {
|
||||
_managerAPI.setPatchesAutoUpdate(autoUpdate.value);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('okButton'),
|
||||
child: Text(t.okButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -251,7 +244,7 @@ class HomeViewModel extends BaseViewModel {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (innerContext) => AlertDialog(
|
||||
title: I18nText('homeView.updateDialogTitle'),
|
||||
title: Text(t.homeView.updateDialogTitle),
|
||||
content: ValueListenableBuilder(
|
||||
valueListenable: noShow,
|
||||
builder: (context, value, child) {
|
||||
@ -259,33 +252,25 @@ class HomeViewModel extends BaseViewModel {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
I18nText(
|
||||
'homeView.updateDialogText',
|
||||
translationParams: {
|
||||
'file': isPatches ? 'ReVanced Patches' : 'ReVanced Manager',
|
||||
'version': isPatches
|
||||
Text(
|
||||
t.homeView.updateDialogText(
|
||||
file: isPatches ? 'ReVanced Patches' : 'ReVanced Manager',
|
||||
version: isPatches
|
||||
? _currentPatchesVersion
|
||||
: _currentManagerVersion,
|
||||
},
|
||||
child: Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
HapticCheckboxListTile(
|
||||
value: value,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: I18nText(
|
||||
'noShowAgain',
|
||||
),
|
||||
subtitle: I18nText(
|
||||
'homeView.changeLaterSubtitle',
|
||||
),
|
||||
title: Text(t.noShowAgain),
|
||||
subtitle: Text(t.homeView.changeLaterSubtitle),
|
||||
onChanged: (selected) {
|
||||
noShow.value = selected!;
|
||||
},
|
||||
@ -300,7 +285,7 @@ class HomeViewModel extends BaseViewModel {
|
||||
_managerAPI.setShowUpdateDialog(!noShow.value);
|
||||
Navigator.pop(innerContext);
|
||||
},
|
||||
child: I18nText('dismissButton'), // Decide later
|
||||
child: Text(t.dismissButton), // Decide later
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () async {
|
||||
@ -308,7 +293,7 @@ class HomeViewModel extends BaseViewModel {
|
||||
Navigator.pop(innerContext);
|
||||
await showUpdateConfirmationDialog(context, isPatches);
|
||||
},
|
||||
child: I18nText('showUpdateButton'),
|
||||
child: Text(t.showUpdateButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -316,7 +301,7 @@ class HomeViewModel extends BaseViewModel {
|
||||
}
|
||||
|
||||
Future<void> updatePatches(BuildContext context) async {
|
||||
_toast.showBottom('homeView.downloadingMessage');
|
||||
_toast.showBottom(t.homeView.downloadingMessage);
|
||||
final String patchesVersion =
|
||||
await _managerAPI.getLatestPatchesVersion() ?? '0.0.0';
|
||||
final String integrationsVersion =
|
||||
@ -324,27 +309,27 @@ class HomeViewModel extends BaseViewModel {
|
||||
if (patchesVersion != '0.0.0' && integrationsVersion != '0.0.0') {
|
||||
await _managerAPI.setCurrentPatchesVersion(patchesVersion);
|
||||
await _managerAPI.setCurrentIntegrationsVersion(integrationsVersion);
|
||||
_toast.showBottom('homeView.downloadedMessage');
|
||||
_toast.showBottom(t.homeView.downloadedMessage);
|
||||
forceRefresh(context);
|
||||
} else {
|
||||
_toast.showBottom('homeView.errorDownloadMessage');
|
||||
_toast.showBottom(t.homeView.errorDownloadMessage);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateManager(BuildContext context) async {
|
||||
final ValueNotifier<bool> downloaded = ValueNotifier(false);
|
||||
try {
|
||||
_toast.showBottom('homeView.downloadingMessage');
|
||||
_toast.showBottom(t.homeView.downloadingMessage);
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => ValueListenableBuilder(
|
||||
valueListenable: downloaded,
|
||||
builder: (context, value, child) {
|
||||
return AlertDialog(
|
||||
title: I18nText(
|
||||
title: Text(
|
||||
!value
|
||||
? 'homeView.downloadingMessage'
|
||||
: 'homeView.downloadedMessage',
|
||||
? t.homeView.downloadingMessage
|
||||
: t.homeView.downloadedMessage,
|
||||
),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@ -373,7 +358,7 @@ class HomeViewModel extends BaseViewModel {
|
||||
_revancedAPI.disposeManagerUpdateProgress();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('cancelButton'),
|
||||
child: Text(t.cancelButton),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -382,15 +367,12 @@ class HomeViewModel extends BaseViewModel {
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
I18nText(
|
||||
'homeView.installUpdate',
|
||||
child: Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
Text(
|
||||
t.homeView.installUpdate,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16.0),
|
||||
@ -403,7 +385,7 @@ class HomeViewModel extends BaseViewModel {
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('cancelButton'),
|
||||
child: Text(t.cancelButton),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8.0),
|
||||
@ -416,7 +398,7 @@ class HomeViewModel extends BaseViewModel {
|
||||
downloadedApk!.path,
|
||||
);
|
||||
},
|
||||
child: I18nText('updateButton'),
|
||||
child: Text(t.updateButton),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -457,21 +439,21 @@ class HomeViewModel extends BaseViewModel {
|
||||
// uiLocalNotificationDateInterpretation:
|
||||
// UILocalNotificationDateInterpretation.absoluteTime,
|
||||
// );
|
||||
_toast.showBottom('homeView.installingMessage');
|
||||
_toast.showBottom(t.homeView.installingMessage);
|
||||
await _patcherAPI.installApk(context, managerApk.path);
|
||||
} else {
|
||||
_toast.showBottom('homeView.errorDownloadMessage');
|
||||
_toast.showBottom(t.homeView.errorDownloadMessage);
|
||||
}
|
||||
} on Exception catch (e) {
|
||||
if (kDebugMode) {
|
||||
print(e);
|
||||
}
|
||||
_toast.showBottom('homeView.errorInstallMessage');
|
||||
_toast.showBottom(t.homeView.errorInstallMessage);
|
||||
}
|
||||
}
|
||||
|
||||
void updatesAreDisabled() {
|
||||
_toast.showBottom('homeView.updatesDisabled');
|
||||
_toast.showBottom(t.homeView.updatesDisabled);
|
||||
}
|
||||
|
||||
Future<void> showUpdateConfirmationDialog(
|
||||
@ -510,7 +492,7 @@ class HomeViewModel extends BaseViewModel {
|
||||
|
||||
Future<void> forceRefresh(BuildContext context) async {
|
||||
_managerAPI.clearAllData();
|
||||
_toast.showBottom('homeView.refreshSuccess');
|
||||
_toast.showBottom(t.homeView.refreshSuccess);
|
||||
initialize(context);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/ui/views/installer/installer_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/widgets/installerView/gradient_progress_indicator.dart';
|
||||
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
||||
@ -26,10 +26,10 @@ class InstallerView extends StatelessWidget {
|
||||
floatingActionButton: Visibility(
|
||||
visible: !model.isPatching && !model.hasErrors,
|
||||
child: HapticFloatingActionButtonExtended(
|
||||
label: I18nText(
|
||||
label: Text(
|
||||
model.isInstalled
|
||||
? 'installerView.openButton'
|
||||
: 'installerView.installButton',
|
||||
? t.installerView.openButton
|
||||
: t.installerView.installButton,
|
||||
),
|
||||
icon: model.isInstalled
|
||||
? const Icon(Icons.open_in_new)
|
||||
@ -54,19 +54,13 @@ class InstallerView extends StatelessWidget {
|
||||
Visibility(
|
||||
visible: !model.hasErrors,
|
||||
child: IconButton.filledTonal(
|
||||
tooltip: FlutterI18n.translate(
|
||||
context,
|
||||
'installerView.exportApkButtonTooltip',
|
||||
),
|
||||
tooltip: t.installerView.exportApkButtonTooltip,
|
||||
icon: const Icon(Icons.save),
|
||||
onPressed: () => model.onButtonPressed(0),
|
||||
),
|
||||
),
|
||||
IconButton.filledTonal(
|
||||
tooltip: FlutterI18n.translate(
|
||||
context,
|
||||
'installerView.exportLogButtonTooltip',
|
||||
),
|
||||
tooltip: t.installerView.exportLogButtonTooltip,
|
||||
icon: const Icon(Icons.post_add),
|
||||
onPressed: () => model.onButtonPressed(1),
|
||||
),
|
||||
|
@ -4,9 +4,9 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_background/flutter_background.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/models/patch.dart';
|
||||
import 'package:revanced_manager/models/patched_application.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
@ -49,14 +49,8 @@ class InstallerViewModel extends BaseViewModel {
|
||||
try {
|
||||
FlutterBackground.initialize(
|
||||
androidConfig: FlutterBackgroundAndroidConfig(
|
||||
notificationTitle: FlutterI18n.translate(
|
||||
context,
|
||||
'installerView.notificationTitle',
|
||||
),
|
||||
notificationText: FlutterI18n.translate(
|
||||
context,
|
||||
'installerView.notificationText',
|
||||
),
|
||||
notificationTitle: t.installerView.notificationTitle,
|
||||
notificationText: t.installerView.notificationText,
|
||||
notificationIcon: const AndroidResource(
|
||||
name: 'ic_notification',
|
||||
),
|
||||
@ -280,26 +274,26 @@ class InstallerViewModel extends BaseViewModel {
|
||||
];
|
||||
|
||||
Clipboard.setData(ClipboardData(text: formattedLogs.join('\n')));
|
||||
_toast.showBottom('installerView.copiedToClipboard');
|
||||
_toast.showBottom(t.installerView.copiedToClipboard);
|
||||
}
|
||||
|
||||
Future<void> screenshotDetected(BuildContext context) async {
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: I18nText(
|
||||
'warning',
|
||||
title: Text(
|
||||
t.warning,
|
||||
),
|
||||
icon: const Icon(Icons.warning),
|
||||
content: SingleChildScrollView(
|
||||
child: I18nText('installerView.screenshotDetected'),
|
||||
child: Text(t.installerView.screenshotDetected),
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('noButton'),
|
||||
child: Text(t.noButton),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
@ -307,7 +301,7 @@ class InstallerViewModel extends BaseViewModel {
|
||||
showPopupScreenshotWarning = true;
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('yesButton'),
|
||||
child: Text(t.yesButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -321,8 +315,8 @@ class InstallerViewModel extends BaseViewModel {
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (innerContext) => AlertDialog(
|
||||
title: I18nText(
|
||||
'installerView.installType',
|
||||
title: Text(
|
||||
t.installerView.installType,
|
||||
),
|
||||
icon: const Icon(Icons.file_download_outlined),
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 16),
|
||||
@ -339,20 +333,17 @@ class InstallerViewModel extends BaseViewModel {
|
||||
horizontal: 20,
|
||||
vertical: 10,
|
||||
),
|
||||
child: I18nText(
|
||||
'installerView.installTypeDescription',
|
||||
child: Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
child: Text(
|
||||
t.installerView.installTypeDescription,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
),
|
||||
RadioListTile(
|
||||
title: I18nText('installerView.installNonRootType'),
|
||||
title: Text(t.installerView.installNonRootType),
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 16),
|
||||
value: 0,
|
||||
@ -362,7 +353,7 @@ class InstallerViewModel extends BaseViewModel {
|
||||
},
|
||||
),
|
||||
RadioListTile(
|
||||
title: I18nText('installerView.installRootType'),
|
||||
title: Text(t.installerView.installRootType),
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 16),
|
||||
value: 1,
|
||||
@ -373,14 +364,11 @@ class InstallerViewModel extends BaseViewModel {
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: I18nText(
|
||||
'installerView.warning',
|
||||
child: Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
),
|
||||
child: Text(
|
||||
t.installerView.warning,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -394,14 +382,14 @@ class InstallerViewModel extends BaseViewModel {
|
||||
onPressed: () {
|
||||
Navigator.of(innerContext).pop();
|
||||
},
|
||||
child: I18nText('cancelButton'),
|
||||
child: Text(t.cancelButton),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
Navigator.of(innerContext).pop();
|
||||
installResult(context, installType.value == 1);
|
||||
},
|
||||
child: I18nText('installerView.installButton'),
|
||||
child: Text(t.installerView.installButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -411,24 +399,22 @@ class InstallerViewModel extends BaseViewModel {
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (innerContext) => AlertDialog(
|
||||
title: I18nText(
|
||||
'warning',
|
||||
),
|
||||
title: Text(t.warning),
|
||||
contentPadding: const EdgeInsets.all(16),
|
||||
content: I18nText('installerView.warning'),
|
||||
content: Text(t.installerView.warning),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(innerContext).pop();
|
||||
},
|
||||
child: I18nText('cancelButton'),
|
||||
child: Text(t.cancelButton),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
Navigator.of(innerContext).pop();
|
||||
installResult(context, false);
|
||||
},
|
||||
child: I18nText('installerView.installButton'),
|
||||
child: Text(t.installerView.installButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -544,11 +530,11 @@ class InstallerViewModel extends BaseViewModel {
|
||||
if (isPatching) {
|
||||
if (!cancel) {
|
||||
cancel = true;
|
||||
_toast.showBottom('installerView.pressBackAgain');
|
||||
_toast.showBottom(t.installerView.pressBackAgain);
|
||||
} else if (!isCanceled) {
|
||||
await stopPatcher();
|
||||
} else {
|
||||
_toast.showBottom('installerView.noExit');
|
||||
_toast.showBottom(t.installerView.noExit);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import 'package:animations/animations.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/ui/views/navigation/navigation_viewmodel.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
|
||||
@ -43,30 +43,21 @@ class NavigationView extends StatelessWidget {
|
||||
icon: model.isIndexSelected(0)
|
||||
? const Icon(Icons.dashboard)
|
||||
: const Icon(Icons.dashboard_outlined),
|
||||
label: FlutterI18n.translate(
|
||||
context,
|
||||
'navigationView.dashboardTab',
|
||||
),
|
||||
label: t.navigationView.dashboardTab,
|
||||
tooltip: '',
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: model.isIndexSelected(1)
|
||||
? const Icon(Icons.build)
|
||||
: const Icon(Icons.build_outlined),
|
||||
label: FlutterI18n.translate(
|
||||
context,
|
||||
'navigationView.patcherTab',
|
||||
),
|
||||
label: t.navigationView.patcherTab,
|
||||
tooltip: '',
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: model.isIndexSelected(2)
|
||||
? const Icon(Icons.settings)
|
||||
: const Icon(Icons.settings_outlined),
|
||||
label: FlutterI18n.translate(
|
||||
context,
|
||||
'navigationView.settingsTab',
|
||||
),
|
||||
label: t.navigationView.settingsTab,
|
||||
tooltip: '',
|
||||
),
|
||||
],
|
||||
|
@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/models/patch.dart';
|
||||
import 'package:revanced_manager/ui/views/patch_options/patch_options_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/widgets/patchesSelectorView/patch_options_fields.dart';
|
||||
@ -25,19 +25,16 @@ class PatchOptionsView extends StatelessWidget {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
},
|
||||
label: I18nText('patchOptionsView.saveOptions'),
|
||||
label: Text(t.patchOptionsView.saveOptions),
|
||||
icon: const Icon(Icons.save),
|
||||
),
|
||||
body: CustomScrollView(
|
||||
slivers: <Widget>[
|
||||
SliverAppBar(
|
||||
title: I18nText(
|
||||
'patchOptionsView.viewTitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.inter(
|
||||
color: Theme.of(context).textTheme.titleLarge!.color,
|
||||
),
|
||||
title: Text(
|
||||
t.patchOptionsView.viewTitle,
|
||||
style: GoogleFonts.inter(
|
||||
color: Theme.of(context).textTheme.titleLarge!.color,
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
@ -48,10 +45,7 @@ class PatchOptionsView extends StatelessWidget {
|
||||
icon: const Icon(
|
||||
Icons.history,
|
||||
),
|
||||
tooltip: FlutterI18n.translate(
|
||||
context,
|
||||
'patchOptionsView.resetOptionsTooltip',
|
||||
),
|
||||
tooltip: t.patchOptionsView.resetOptionsTooltip,
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -111,7 +105,7 @@ class PatchOptionsView extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.add),
|
||||
I18nText('patchOptionsView.addOptions'),
|
||||
Text(t.patchOptionsView.addOptions),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/widgets/I18nText.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/models/patch.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||
@ -137,8 +137,8 @@ class PatchOptionsViewModel extends BaseViewModel {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
I18nText(
|
||||
'patchOptionsView.addOptions',
|
||||
Text(
|
||||
t.patchOptionsView.addOptions,
|
||||
),
|
||||
Text(
|
||||
'',
|
||||
@ -154,7 +154,7 @@ class PatchOptionsViewModel extends BaseViewModel {
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('cancelButton'),
|
||||
child: Text(t.cancelButton),
|
||||
),
|
||||
],
|
||||
contentPadding: const EdgeInsets.all(8),
|
||||
@ -224,7 +224,7 @@ Future<void> showRequiredOptionNullDialog(
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: I18nText('notice'),
|
||||
title: Text(t.notice),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
@ -248,20 +248,19 @@ Future<void> showRequiredOptionNullDialog(
|
||||
PatchesSelectorViewModel().showPatchesChangeDialog(context);
|
||||
}
|
||||
},
|
||||
child: I18nText('patchOptionsView.deselectPatch'),
|
||||
child: Text(t.patchOptionsView.deselectPatch),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('okButton'),
|
||||
child: Text(t.okButton),
|
||||
),
|
||||
],
|
||||
content: I18nText(
|
||||
'patchOptionsView.requiredOptionNull',
|
||||
translationParams: {
|
||||
'options': optionsTitles.join('\n'),
|
||||
},
|
||||
content: Text(
|
||||
t.patchOptionsView.requiredOptionNull(
|
||||
options: optionsTitles.join('\n'),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/widgets/patcherView/app_selector_card.dart';
|
||||
import 'package:revanced_manager/ui/widgets/patcherView/patch_selector_card.dart';
|
||||
@ -21,7 +21,7 @@ class PatcherView extends StatelessWidget {
|
||||
floatingActionButton: Visibility(
|
||||
visible: model.showPatchButton(),
|
||||
child: HapticFloatingActionButtonExtended(
|
||||
label: I18nText('patcherView.patchButton'),
|
||||
label: Text(t.patcherView.patchButton),
|
||||
icon: const Icon(Icons.build),
|
||||
onPressed: () async {
|
||||
if (model.checkRequiredPatchOption(context)) {
|
||||
@ -37,13 +37,10 @@ class PatcherView extends StatelessWidget {
|
||||
slivers: <Widget>[
|
||||
CustomSliverAppBar(
|
||||
isMainView: true,
|
||||
title: I18nText(
|
||||
'patcherView.widgetTitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.inter(
|
||||
color: Theme.of(context).textTheme.titleLarge!.color,
|
||||
),
|
||||
title: Text(
|
||||
t.patcherView.widgetTitle,
|
||||
style: GoogleFonts.inter(
|
||||
color: Theme.of(context).textTheme.titleLarge!.color,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -5,10 +5,10 @@ import 'dart:io';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:injectable/injectable.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/app/app.router.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/models/patch.dart';
|
||||
import 'package:revanced_manager/models/patched_application.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
@ -54,24 +54,25 @@ class PatcherViewModel extends BaseViewModel {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: I18nText('notice'),
|
||||
content: I18nText(
|
||||
'patcherView.removedPatchesWarningDialogText',
|
||||
translationParams: {'patches': removedPatches.join('\n')},
|
||||
title: Text(t.notice),
|
||||
content: Text(
|
||||
t.patcherView.removedPatchesWarningDialogText(
|
||||
patches: removedPatches.join('\n'),
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('noButton'),
|
||||
child: Text(t.noButton),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
showArmv7WarningDialog(context);
|
||||
},
|
||||
child: I18nText('yesButton'),
|
||||
child: Text(t.yesButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -94,21 +95,21 @@ class PatcherViewModel extends BaseViewModel {
|
||||
showDialog(
|
||||
context: context ?? ctx,
|
||||
builder: (context) => AlertDialog(
|
||||
title: I18nText('notice'),
|
||||
content: I18nText('patcherView.requiredOptionDialogText'),
|
||||
title: Text(t.notice),
|
||||
content: Text(t.patcherView.requiredOptionDialogText),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () => {
|
||||
Navigator.of(context).pop(),
|
||||
},
|
||||
child: I18nText('cancelButton'),
|
||||
child: Text(t.cancelButton),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () => {
|
||||
Navigator.pop(context),
|
||||
navigateToPatchesSelector(),
|
||||
},
|
||||
child: I18nText('okButton'),
|
||||
child: Text(t.okButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -125,19 +126,19 @@ class PatcherViewModel extends BaseViewModel {
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: I18nText('warning'),
|
||||
content: I18nText('patcherView.armv7WarningDialogText'),
|
||||
title: Text(t.warning),
|
||||
content: Text(t.patcherView.armv7WarningDialogText),
|
||||
actions: <Widget>[
|
||||
FilledButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: I18nText('noButton'),
|
||||
child: Text(t.noButton),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
navigateToInstaller();
|
||||
},
|
||||
child: I18nText('yesButton'),
|
||||
child: Text(t.yesButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart' hide SearchBar;
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/widgets/shared/haptics/haptic_floating_action_button_extended.dart';
|
||||
@ -40,7 +40,7 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
||||
child: HapticFloatingActionButtonExtended(
|
||||
label: Row(
|
||||
children: <Widget>[
|
||||
I18nText('patchesSelectorView.doneButton'),
|
||||
Text(t.patchesSelectorView.doneButton),
|
||||
Text(' (${model.selectedPatches.length})'),
|
||||
],
|
||||
),
|
||||
@ -58,8 +58,8 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
||||
SliverAppBar(
|
||||
pinned: true,
|
||||
floating: true,
|
||||
title: I18nText(
|
||||
'patchesSelectorView.viewTitle',
|
||||
title: Text(
|
||||
t.patchesSelectorView.viewTitle,
|
||||
),
|
||||
titleTextStyle: TextStyle(
|
||||
fontSize: 22.0,
|
||||
@ -99,8 +99,8 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
value: 0,
|
||||
child: I18nText(
|
||||
'patchesSelectorView.loadPatchesSelection',
|
||||
child: Text(
|
||||
t.patchesSelectorView.loadPatchesSelection,
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -114,10 +114,7 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
||||
horizontal: 12.0,
|
||||
),
|
||||
child: SearchBar(
|
||||
hintText: FlutterI18n.translate(
|
||||
context,
|
||||
'patchesSelectorView.searchBarHint',
|
||||
),
|
||||
hintText: t.patchesSelectorView.searchBarHint,
|
||||
onQueryChanged: (searchQuery) {
|
||||
setState(() {
|
||||
_query = searchQuery;
|
||||
@ -132,12 +129,9 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
||||
? Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: I18nText(
|
||||
'patchesSelectorView.noPatchesFound',
|
||||
child: Text(
|
||||
'',
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
child: Text(
|
||||
t.patchesSelectorView.noPatchesFound,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
),
|
||||
)
|
||||
@ -151,11 +145,8 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
||||
Row(
|
||||
children: [
|
||||
ActionChip(
|
||||
label: I18nText('patchesSelectorView.default'),
|
||||
tooltip: FlutterI18n.translate(
|
||||
context,
|
||||
'patchesSelectorView.defaultTooltip',
|
||||
),
|
||||
label: Text(t.patchesSelectorView.defaultChip),
|
||||
tooltip: t.patchesSelectorView.defaultTooltip,
|
||||
onPressed: () {
|
||||
if (_managerAPI.isPatchesChangeEnabled()) {
|
||||
model.selectDefaultPatches();
|
||||
@ -166,11 +157,8 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
ActionChip(
|
||||
label: I18nText('patchesSelectorView.none'),
|
||||
tooltip: FlutterI18n.translate(
|
||||
context,
|
||||
'patchesSelectorView.noneTooltip',
|
||||
),
|
||||
label: Text(t.patchesSelectorView.noneChip),
|
||||
tooltip: t.patchesSelectorView.noneTooltip,
|
||||
onPressed: () {
|
||||
if (_managerAPI.isPatchesChangeEnabled()) {
|
||||
model.clearPatches();
|
||||
@ -189,7 +177,7 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
||||
children: [
|
||||
model.getPatchCategory(
|
||||
context,
|
||||
'patchesSelectorView.newPatches',
|
||||
t.patchesSelectorView.newPatches,
|
||||
),
|
||||
...model.getQueriedPatches(_query).map((patch) {
|
||||
if (model.isPatchNew(patch)) {
|
||||
@ -205,7 +193,7 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
||||
))
|
||||
model.getPatchCategory(
|
||||
context,
|
||||
'patchesSelectorView.patches',
|
||||
t.patchesSelectorView.patches,
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -227,7 +215,7 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
||||
children: [
|
||||
model.getPatchCategory(
|
||||
context,
|
||||
'patchesSelectorView.universalPatches',
|
||||
t.patchesSelectorView.universalPatches,
|
||||
),
|
||||
...model.getQueriedPatches(_query).map((patch) {
|
||||
if (patch.compatiblePackages.isEmpty &&
|
||||
|
@ -1,8 +1,8 @@
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/widgets/I18nText.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/app/app.router.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/models/patch.dart';
|
||||
import 'package:revanced_manager/models/patched_application.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
@ -92,19 +92,18 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: I18nText('notice'),
|
||||
content: I18nText(
|
||||
'patchesSelectorView.setRequiredOption',
|
||||
translationParams: {
|
||||
'patches': patches.map((patch) => '• $patch').join('\n'),
|
||||
},
|
||||
title: Text(t.notice),
|
||||
content: Text(
|
||||
t.patchesSelectorView.setRequiredOption(
|
||||
patches: patches.map((patch) => '• $patch').join('\n'),
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
FilledButton(
|
||||
onPressed: () => {
|
||||
Navigator.of(context).pop(),
|
||||
},
|
||||
child: I18nText('okButton'),
|
||||
child: Text(t.okButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -128,21 +127,18 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: I18nText('warning'),
|
||||
content: I18nText(
|
||||
'patchItem.patchesChangeWarningDialogText',
|
||||
child: const Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
title: Text(t.warning),
|
||||
content: Text(
|
||||
t.patchItem.patchesChangeWarningDialogText,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: I18nText('okButton'),
|
||||
child: Text(t.okButton),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
@ -150,7 +146,7 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
||||
..pop()
|
||||
..pop();
|
||||
},
|
||||
child: I18nText('patchItem.patchesChangeWarningDialogButton'),
|
||||
child: Text(t.patchItem.patchesChangeWarningDialogButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -257,13 +253,10 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
||||
bottom: 10.0,
|
||||
left: 5.0,
|
||||
),
|
||||
child: I18nText(
|
||||
child: Text(
|
||||
category,
|
||||
child: Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -321,7 +314,7 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
||||
this.selectedPatches.removeWhere((patch) => !isPatchSupported(patch));
|
||||
}
|
||||
} else {
|
||||
locator<Toast>().showBottom('patchesSelectorView.noSavedPatches');
|
||||
locator<Toast>().showBottom(t.patchesSelectorView.noSavedPatches);
|
||||
}
|
||||
notifyListeners();
|
||||
} else {
|
||||
|
@ -1,8 +1,8 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
import 'package:revanced_manager/ui/widgets/settingsView/settings_tile_dialog.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
@ -20,7 +20,7 @@ class SManageApiUrl extends BaseViewModel {
|
||||
builder: (context) => AlertDialog(
|
||||
title: Row(
|
||||
children: <Widget>[
|
||||
I18nText('settingsView.apiURLLabel'),
|
||||
Text(t.settingsView.apiURLLabel),
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.manage_history_outlined),
|
||||
@ -42,10 +42,7 @@ class SManageApiUrl extends BaseViewModel {
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: FlutterI18n.translate(
|
||||
context,
|
||||
'settingsView.selectApiURL',
|
||||
),
|
||||
labelText: t.settingsView.selectApiURL,
|
||||
hintText: apiUrl,
|
||||
),
|
||||
),
|
||||
@ -58,7 +55,7 @@ class SManageApiUrl extends BaseViewModel {
|
||||
_apiUrlController.clear();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('cancelButton'),
|
||||
child: Text(t.cancelButton),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
@ -69,7 +66,7 @@ class SManageApiUrl extends BaseViewModel {
|
||||
_managerAPI.setApiUrl(apiUrl);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('okButton'),
|
||||
child: Text(t.okButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -80,12 +77,12 @@ class SManageApiUrl extends BaseViewModel {
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: I18nText('settingsView.sourcesResetDialogTitle'),
|
||||
content: I18nText('settingsView.apiURLResetDialogText'),
|
||||
title: Text(t.settingsView.sourcesResetDialogTitle),
|
||||
content: Text(t.settingsView.apiURLResetDialogText),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: I18nText('noButton'),
|
||||
child: Text(t.noButton),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
@ -94,7 +91,7 @@ class SManageApiUrl extends BaseViewModel {
|
||||
..pop()
|
||||
..pop();
|
||||
},
|
||||
child: I18nText('yesButton'),
|
||||
child: Text(t.yesButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -111,8 +108,8 @@ class SManageApiUrlUI extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return SettingsTileDialog(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
title: 'settingsView.apiURLLabel',
|
||||
subtitle: 'settingsView.apiURLHint',
|
||||
title: t.settingsView.apiURLLabel,
|
||||
subtitle: t.settingsView.apiURLHint,
|
||||
onTap: () => sManageApiUrl.showApiUrlDialog(context),
|
||||
);
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
import 'package:revanced_manager/ui/widgets/settingsView/settings_tile_dialog.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
@ -21,7 +21,7 @@ class SManageKeystorePassword extends BaseViewModel {
|
||||
builder: (context) => AlertDialog(
|
||||
title: Row(
|
||||
children: <Widget>[
|
||||
I18nText('settingsView.selectKeystorePassword'),
|
||||
Text(t.settingsView.selectKeystorePassword),
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.manage_history_outlined),
|
||||
@ -41,10 +41,7 @@ class SManageKeystorePassword extends BaseViewModel {
|
||||
onChanged: (value) => notifyListeners(),
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: FlutterI18n.translate(
|
||||
context,
|
||||
'settingsView.selectKeystorePassword',
|
||||
),
|
||||
labelText: t.settingsView.selectKeystorePassword,
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -56,7 +53,7 @@ class SManageKeystorePassword extends BaseViewModel {
|
||||
_keystorePasswordController.clear();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('cancelButton'),
|
||||
child: Text(t.cancelButton),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
@ -64,7 +61,7 @@ class SManageKeystorePassword extends BaseViewModel {
|
||||
_managerAPI.setKeystorePassword(passwd);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('okButton'),
|
||||
child: Text(t.okButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -81,8 +78,8 @@ class SManageKeystorePasswordUI extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return SettingsTileDialog(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
title: 'settingsView.selectKeystorePassword',
|
||||
subtitle: 'settingsView.selectKeystorePasswordHint',
|
||||
title: t.settingsView.selectKeystorePassword,
|
||||
subtitle: t.settingsView.selectKeystorePasswordHint,
|
||||
onTap: () => sManageKeystorePassword.showKeystoreDialog(context),
|
||||
);
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
import 'package:revanced_manager/services/toast.dart';
|
||||
import 'package:revanced_manager/ui/widgets/settingsView/settings_tile_dialog.dart';
|
||||
@ -32,7 +32,7 @@ class SManageSources extends BaseViewModel {
|
||||
builder: (context) => AlertDialog(
|
||||
title: Row(
|
||||
children: <Widget>[
|
||||
I18nText('settingsView.sourcesLabel'),
|
||||
Text(t.settingsView.sourcesLabel),
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.manage_history_outlined),
|
||||
@ -58,10 +58,7 @@ class SManageSources extends BaseViewModel {
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: FlutterI18n.translate(
|
||||
context,
|
||||
'settingsView.hostRepositoryLabel',
|
||||
),
|
||||
labelText: t.settingsView.hostRepositoryLabel,
|
||||
hintText: hostRepository,
|
||||
),
|
||||
),
|
||||
@ -77,10 +74,7 @@ class SManageSources extends BaseViewModel {
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: FlutterI18n.translate(
|
||||
context,
|
||||
'settingsView.orgPatchesLabel',
|
||||
),
|
||||
labelText: t.settingsView.orgPatchesLabel,
|
||||
hintText: patchesRepo.split('/')[0],
|
||||
),
|
||||
),
|
||||
@ -96,10 +90,7 @@ class SManageSources extends BaseViewModel {
|
||||
color: Colors.transparent,
|
||||
),
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: FlutterI18n.translate(
|
||||
context,
|
||||
'settingsView.sourcesPatchesLabel',
|
||||
),
|
||||
labelText: t.settingsView.sourcesPatchesLabel,
|
||||
hintText: patchesRepo.split('/')[1],
|
||||
),
|
||||
),
|
||||
@ -115,10 +106,7 @@ class SManageSources extends BaseViewModel {
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: FlutterI18n.translate(
|
||||
context,
|
||||
'settingsView.orgIntegrationsLabel',
|
||||
),
|
||||
labelText: t.settingsView.orgIntegrationsLabel,
|
||||
hintText: integrationsRepo.split('/')[0],
|
||||
),
|
||||
),
|
||||
@ -134,15 +122,12 @@ class SManageSources extends BaseViewModel {
|
||||
color: Colors.transparent,
|
||||
),
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: FlutterI18n.translate(
|
||||
context,
|
||||
'settingsView.sourcesIntegrationsLabel',
|
||||
),
|
||||
labelText: t.settingsView.sourcesIntegrationsLabel,
|
||||
hintText: integrationsRepo.split('/')[1],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
I18nText('settingsView.sourcesUpdateNote'),
|
||||
Text(t.settingsView.sourcesUpdateNote),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -155,7 +140,7 @@ class SManageSources extends BaseViewModel {
|
||||
_intSourceController.clear();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('cancelButton'),
|
||||
child: Text(t.cancelButton),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
@ -168,10 +153,10 @@ class SManageSources extends BaseViewModel {
|
||||
);
|
||||
_managerAPI.setCurrentPatchesVersion('0.0.0');
|
||||
_managerAPI.setCurrentIntegrationsVersion('0.0.0');
|
||||
_toast.showBottom('settingsView.restartAppForChanges');
|
||||
_toast.showBottom(t.settingsView.restartAppForChanges);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('okButton'),
|
||||
child: Text(t.okButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -182,12 +167,12 @@ class SManageSources extends BaseViewModel {
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: I18nText('settingsView.sourcesResetDialogTitle'),
|
||||
content: I18nText('settingsView.sourcesResetDialogText'),
|
||||
title: Text(t.settingsView.sourcesResetDialogTitle),
|
||||
content: Text(t.settingsView.sourcesResetDialogText),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: I18nText('noButton'),
|
||||
child: Text(t.noButton),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
@ -196,12 +181,12 @@ class SManageSources extends BaseViewModel {
|
||||
_managerAPI.setIntegrationsRepo('');
|
||||
_managerAPI.setCurrentPatchesVersion('0.0.0');
|
||||
_managerAPI.setCurrentIntegrationsVersion('0.0.0');
|
||||
_toast.showBottom('settingsView.restartAppForChanges');
|
||||
_toast.showBottom(t.settingsView.restartAppForChanges);
|
||||
Navigator.of(context)
|
||||
..pop()
|
||||
..pop();
|
||||
},
|
||||
child: I18nText('yesButton'),
|
||||
child: Text(t.yesButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -218,8 +203,8 @@ class SManageSourcesUI extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return SettingsTileDialog(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
title: 'settingsView.sourcesLabel',
|
||||
subtitle: 'settingsView.sourcesLabelHint',
|
||||
title: t.settingsView.sourcesLabel,
|
||||
subtitle: t.settingsView.sourcesLabelHint,
|
||||
onTap: () => sManageSources.showSourcesDialog(context),
|
||||
);
|
||||
}
|
||||
|
@ -1,76 +1,101 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:language_code/language_code.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/main.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
import 'package:revanced_manager/services/toast.dart';
|
||||
import 'package:revanced_manager/ui/views/navigation/navigation_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/widgets/settingsView/settings_tile_dialog.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
import 'package:timeago/timeago.dart' as timeago;
|
||||
|
||||
final _settingViewModel = SettingsViewModel();
|
||||
|
||||
class SUpdateLanguage extends BaseViewModel {
|
||||
final Toast _toast = locator<Toast>();
|
||||
late SharedPreferences _prefs;
|
||||
String selectedLanguage = 'English';
|
||||
String selectedLanguageLocale = prefs.getString('language') ?? 'en_US';
|
||||
List languages = [];
|
||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||
|
||||
Future<void> initialize() async {
|
||||
_prefs = await SharedPreferences.getInstance();
|
||||
selectedLanguageLocale =
|
||||
_prefs.getString('language') ?? selectedLanguageLocale;
|
||||
_prefs.getString('language');
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> updateLanguage(BuildContext context, String? value) async {
|
||||
if (value != null) {
|
||||
selectedLanguageLocale = value;
|
||||
_prefs = await SharedPreferences.getInstance();
|
||||
await _prefs.setString('language', value);
|
||||
await FlutterI18n.refresh(context, Locale(value));
|
||||
timeago.setLocaleMessages(value, timeago.EnMessages());
|
||||
locator<NavigationViewModel>().notifyListeners();
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> initLang() async {
|
||||
languages.sort((a, b) => a['name'].compareTo(b['name']));
|
||||
notifyListeners();
|
||||
Future<void> updateLocale(String locale) async {
|
||||
LocaleSettings.setLocaleRaw(locale);
|
||||
_managerAPI.setLocale(locale);
|
||||
Future.delayed(
|
||||
const Duration(milliseconds: 120),
|
||||
() => _toast.showBottom(t.settingsView.languageUpdated),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> showLanguagesDialog(BuildContext parentContext) {
|
||||
initLang();
|
||||
final ValueNotifier<String> selectedLanguageCode =
|
||||
ValueNotifier(LocaleSettings.currentLocale.languageCode);
|
||||
// initLang();
|
||||
|
||||
// Return a dialog with list for each language supported by the application.
|
||||
// the dialog will display the english and native name of each languages,
|
||||
// the current language will be highlighted by selected radio button.
|
||||
return showDialog(
|
||||
context: parentContext,
|
||||
builder: (context) => SimpleDialog(
|
||||
title: I18nText('settingsView.languageLabel'),
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 500,
|
||||
child: ListView.builder(
|
||||
itemCount: languages.length,
|
||||
itemBuilder: (context, index) {
|
||||
return RadioListTile<String>(
|
||||
title: Text(languages[index]['name']),
|
||||
subtitle: Text(languages[index]['locale']),
|
||||
value: languages[index]['locale'],
|
||||
groupValue: selectedLanguageLocale,
|
||||
onChanged: (value) {
|
||||
selectedLanguage = languages[index]['name'];
|
||||
_toast.showBottom('settingsView.restartAppForChanges');
|
||||
updateLanguage(context, value);
|
||||
Navigator.pop(context);
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(t.settingsView.languageLabel),
|
||||
icon: const Icon(Icons.language),
|
||||
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
content: ValueListenableBuilder(
|
||||
valueListenable: selectedLanguageCode,
|
||||
builder: (context, value, child) {
|
||||
return SingleChildScrollView(
|
||||
child: ListBody(
|
||||
children: AppLocale.values.map(
|
||||
(locale) {
|
||||
LanguageCodes? languageCode;
|
||||
Text? languageNativeName;
|
||||
|
||||
try {
|
||||
languageCode =
|
||||
LanguageCodes.fromCode(locale.languageCode);
|
||||
} catch (e) {}
|
||||
if (languageCode != null) {
|
||||
languageNativeName = Text(languageCode.nativeName);
|
||||
}
|
||||
|
||||
return RadioListTile(
|
||||
title: Text(
|
||||
languageCode?.englishName ?? locale.languageCode,
|
||||
),
|
||||
subtitle: languageNativeName,
|
||||
value: locale.languageCode == selectedLanguageCode.value,
|
||||
groupValue: true,
|
||||
onChanged: (value) {
|
||||
selectedLanguageCode.value = locale.languageCode;
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
).toList(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text(t.cancelButton),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
updateLocale(selectedLanguageCode.value);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text(t.okButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -85,8 +110,10 @@ class SUpdateLanguageUI extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return SettingsTileDialog(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
title: 'settingsView.languageLabel',
|
||||
subtitle: _settingViewModel.sUpdateLanguage.selectedLanguage,
|
||||
title: t.settingsView.languageLabel,
|
||||
subtitle:
|
||||
LanguageCodes.fromCode(LocaleSettings.currentLocale.languageCode)
|
||||
.nativeName,
|
||||
onTap: () =>
|
||||
_settingViewModel.sUpdateLanguage.showLanguagesDialog(context),
|
||||
);
|
||||
|
@ -3,8 +3,8 @@
|
||||
import 'package:dynamic_themes/dynamic_themes.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_i18n/widgets/I18nText.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
import 'package:revanced_manager/ui/widgets/settingsView/settings_section.dart';
|
||||
import 'package:revanced_manager/ui/widgets/shared/haptics/haptic_radio_list_tile.dart';
|
||||
@ -23,18 +23,15 @@ class _SUpdateThemeUIState extends State<SUpdateThemeUI> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SettingsSection(
|
||||
title: 'settingsView.appearanceSectionTitle',
|
||||
title: t.settingsView.appearanceSectionTitle,
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
title: I18nText(
|
||||
'settingsView.themeModeLabel',
|
||||
child: const Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
title: Text(
|
||||
t.settingsView.themeModeLabel,
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
trailing: FilledButton(
|
||||
@ -46,17 +43,14 @@ class _SUpdateThemeUIState extends State<SUpdateThemeUI> {
|
||||
if (managerAPI.isDynamicThemeAvailable)
|
||||
HapticSwitchListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
title: I18nText(
|
||||
'settingsView.dynamicThemeLabel',
|
||||
child: const Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
title: Text(
|
||||
t.settingsView.dynamicThemeLabel,
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
subtitle: I18nText('settingsView.dynamicThemeHint'),
|
||||
subtitle: Text(t.settingsView.dynamicThemeHint),
|
||||
value: getDynamicThemeStatus(),
|
||||
onChanged: (value) => {
|
||||
setUseDynamicTheme(
|
||||
@ -101,16 +95,16 @@ class _SUpdateThemeUIState extends State<SUpdateThemeUI> {
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
I18nText getThemeModeName() {
|
||||
Text getThemeModeName() {
|
||||
switch (getThemeMode()) {
|
||||
case 0:
|
||||
return I18nText('settingsView.systemThemeLabel');
|
||||
return Text(t.settingsView.systemThemeLabel);
|
||||
case 1:
|
||||
return I18nText('settingsView.lightThemeLabel');
|
||||
return Text(t.settingsView.lightThemeLabel);
|
||||
case 2:
|
||||
return I18nText('settingsView.darkThemeLabel');
|
||||
return Text(t.settingsView.darkThemeLabel);
|
||||
default:
|
||||
return I18nText('settingsView.systemThemeLabel');
|
||||
return Text(t.settingsView.systemThemeLabel);
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,7 +114,7 @@ class _SUpdateThemeUIState extends State<SUpdateThemeUI> {
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: I18nText('settingsView.themeModeLabel'),
|
||||
title: Text(t.settingsView.themeModeLabel),
|
||||
icon: const Icon(Icons.palette),
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 16),
|
||||
content: SingleChildScrollView(
|
||||
@ -132,7 +126,7 @@ class _SUpdateThemeUIState extends State<SUpdateThemeUI> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
HapticRadioListTile(
|
||||
title: I18nText('settingsView.systemThemeLabel'),
|
||||
title: Text(t.settingsView.systemThemeLabel),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
value: 0,
|
||||
groupValue: value,
|
||||
@ -141,7 +135,7 @@ class _SUpdateThemeUIState extends State<SUpdateThemeUI> {
|
||||
},
|
||||
),
|
||||
HapticRadioListTile(
|
||||
title: I18nText('settingsView.lightThemeLabel'),
|
||||
title: Text(t.settingsView.lightThemeLabel),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
value: 1,
|
||||
groupValue: value,
|
||||
@ -150,7 +144,7 @@ class _SUpdateThemeUIState extends State<SUpdateThemeUI> {
|
||||
},
|
||||
),
|
||||
HapticRadioListTile(
|
||||
title: I18nText('settingsView.darkThemeLabel'),
|
||||
title: Text(t.settingsView.darkThemeLabel),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
value: 2,
|
||||
groupValue: value,
|
||||
@ -168,14 +162,14 @@ class _SUpdateThemeUIState extends State<SUpdateThemeUI> {
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('cancelButton'),
|
||||
child: Text(t.cancelButton),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
setThemeMode(context, newTheme.value);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('okButton'),
|
||||
child: Text(t.okButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -1,8 +1,9 @@
|
||||
// ignore_for_file: prefer_const_constructors
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_update_language.dart';
|
||||
import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_update_theme.dart';
|
||||
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
|
||||
import 'package:revanced_manager/ui/widgets/settingsView/settings_advanced_section.dart';
|
||||
@ -27,13 +28,10 @@ class SettingsView extends StatelessWidget {
|
||||
slivers: <Widget>[
|
||||
CustomSliverAppBar(
|
||||
isMainView: true,
|
||||
title: I18nText(
|
||||
'settingsView.widgetTitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: GoogleFonts.inter(
|
||||
color: Theme.of(context).textTheme.titleLarge!.color,
|
||||
),
|
||||
title: Text(
|
||||
t.settingsView.widgetTitle,
|
||||
style: GoogleFonts.inter(
|
||||
color: Theme.of(context).textTheme.titleLarge!.color,
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -47,7 +45,7 @@ class SettingsView extends StatelessWidget {
|
||||
children: const [
|
||||
SUpdateThemeUI(),
|
||||
// _settingsDivider,
|
||||
// SUpdateLanguageUI(),
|
||||
SUpdateLanguageUI(),
|
||||
_settingsDivider,
|
||||
SAdvancedSection(),
|
||||
_settingsDivider,
|
||||
|
@ -1,12 +1,13 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_file_dialog/flutter_file_dialog.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:logcat/logcat.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/app/app.router.dart';
|
||||
import 'package:revanced_manager/gen/strings.g.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
import 'package:revanced_manager/services/toast.dart';
|
||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||
@ -60,15 +61,12 @@ class SettingsViewModel extends BaseViewModel {
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: I18nText('warning'),
|
||||
content: I18nText(
|
||||
'settingsView.enablePatchesSelectionWarningText',
|
||||
child: const Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
title: Text(t.warning),
|
||||
content: Text(
|
||||
t.settingsView.enablePatchesSelectionWarningText,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
@ -78,13 +76,13 @@ class SettingsViewModel extends BaseViewModel {
|
||||
_managerAPI.setPatchesChangeEnabled(true);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('yesButton'),
|
||||
child: Text(t.yesButton),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('noButton'),
|
||||
child: Text(t.noButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -93,15 +91,12 @@ class SettingsViewModel extends BaseViewModel {
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: I18nText('warning'),
|
||||
content: I18nText(
|
||||
'settingsView.disablePatchesSelectionWarningText',
|
||||
child: const Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
title: Text(t.warning),
|
||||
content: Text(
|
||||
t.settingsView.disablePatchesSelectionWarningText,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
@ -109,7 +104,7 @@ class SettingsViewModel extends BaseViewModel {
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('noButton'),
|
||||
child: Text(t.noButton),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
@ -118,7 +113,7 @@ class SettingsViewModel extends BaseViewModel {
|
||||
_managerAPI.setPatchesChangeEnabled(false);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('yesButton'),
|
||||
child: Text(t.yesButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -156,15 +151,12 @@ class SettingsViewModel extends BaseViewModel {
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: I18nText('warning'),
|
||||
content: I18nText(
|
||||
'settingsView.requireSuggestedAppVersionDialogText',
|
||||
child: const Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
title: Text(t.warning),
|
||||
content: Text(
|
||||
t.settingsView.requireSuggestedAppVersionDialogText,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
@ -173,13 +165,13 @@ class SettingsViewModel extends BaseViewModel {
|
||||
_managerAPI.enableRequireSuggestedAppVersionStatus(false);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('yesButton'),
|
||||
child: Text(t.yesButton),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: I18nText('noButton'),
|
||||
child: Text(t.noButton),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -197,13 +189,13 @@ class SettingsViewModel extends BaseViewModel {
|
||||
|
||||
void deleteKeystore() {
|
||||
_managerAPI.deleteKeystore();
|
||||
_toast.showBottom('settingsView.regeneratedKeystore');
|
||||
_toast.showBottom(t.settingsView.regeneratedKeystore);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void deleteTempDir() {
|
||||
_managerAPI.deleteTempFolder();
|
||||
_toast.showBottom('settingsView.deletedTempDir');
|
||||
_toast.showBottom(t.settingsView.deletedTempDir);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
@ -219,9 +211,9 @@ class SettingsViewModel extends BaseViewModel {
|
||||
fileName: 'selected_patches_$dateTime.json',
|
||||
),
|
||||
);
|
||||
_toast.showBottom('settingsView.exportedPatches');
|
||||
_toast.showBottom(t.settingsView.exportedPatches);
|
||||
} else {
|
||||
_toast.showBottom('settingsView.noExportFileFound');
|
||||
_toast.showBottom(t.settingsView.noExportFileFound);
|
||||
}
|
||||
} on Exception catch (e) {
|
||||
if (kDebugMode) {
|
||||
@ -245,13 +237,13 @@ class SettingsViewModel extends BaseViewModel {
|
||||
if (_patcherViewModel.selectedApp != null) {
|
||||
_patcherViewModel.loadLastSelectedPatches();
|
||||
}
|
||||
_toast.showBottom('settingsView.importedPatches');
|
||||
_toast.showBottom(t.settingsView.importedPatches);
|
||||
}
|
||||
} on Exception catch (e) {
|
||||
if (kDebugMode) {
|
||||
print(e);
|
||||
}
|
||||
_toast.showBottom('settingsView.jsonSelectorErrorMessage');
|
||||
_toast.showBottom(t.settingsView.jsonSelectorErrorMessage);
|
||||
}
|
||||
} else {
|
||||
_managerAPI.showPatchesChangeWarningDialog(context);
|
||||
@ -270,9 +262,9 @@ class SettingsViewModel extends BaseViewModel {
|
||||
fileName: 'keystore_$dateTime.keystore',
|
||||
),
|
||||
);
|
||||
_toast.showBottom('settingsView.exportedKeystore');
|
||||
_toast.showBottom(t.settingsView.exportedKeystore);
|
||||
} else {
|
||||
_toast.showBottom('settingsView.noKeystoreExportFileFound');
|
||||
_toast.showBottom(t.settingsView.noKeystoreExportFileFound);
|
||||
}
|
||||
} on Exception catch (e) {
|
||||
if (kDebugMode) {
|
||||
@ -288,24 +280,24 @@ class SettingsViewModel extends BaseViewModel {
|
||||
final File inFile = File(result);
|
||||
inFile.copySync(_managerAPI.keystoreFile);
|
||||
|
||||
_toast.showBottom('settingsView.importedKeystore');
|
||||
_toast.showBottom(t.settingsView.importedKeystore);
|
||||
}
|
||||
} on Exception catch (e) {
|
||||
if (kDebugMode) {
|
||||
print(e);
|
||||
}
|
||||
_toast.showBottom('settingsView.keystoreSelectorErrorMessage');
|
||||
_toast.showBottom(t.settingsView.keystoreSelectorErrorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
void resetAllOptions() {
|
||||
_managerAPI.resetAllOptions();
|
||||
_toast.showBottom('settingsView.resetStoredOptions');
|
||||
_toast.showBottom(t.settingsView.resetStoredOptions);
|
||||
}
|
||||
|
||||
void resetSelectedPatches() {
|
||||
_managerAPI.resetLastSelectedPatches();
|
||||
_toast.showBottom('settingsView.resetStoredPatches');
|
||||
_toast.showBottom(t.settingsView.resetStoredPatches);
|
||||
}
|
||||
|
||||
Future<void> deleteLogs() async {
|
||||
@ -314,7 +306,7 @@ class SettingsViewModel extends BaseViewModel {
|
||||
if (logsDir.existsSync()) {
|
||||
logsDir.deleteSync(recursive: true);
|
||||
}
|
||||
_toast.showBottom('settingsView.deletedLogs');
|
||||
_toast.showBottom(t.settingsView.deletedLogs);
|
||||
}
|
||||
|
||||
Future<void> exportLogcatLogs() async {
|
||||
|
Reference in New Issue
Block a user