feat: Allow changing languages (#1488)

Co-authored-by: validcube <pun.butrach@gmail.com>
This commit is contained in:
Ushie
2024-02-12 02:22:25 +03:00
committed by GitHub
parent c498cff096
commit f82c439b26
64 changed files with 1302 additions and 1488 deletions

View File

@ -3,9 +3,11 @@ import 'package:dynamic_color/dynamic_color.dart';
import 'package:dynamic_themes/dynamic_themes.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:google_fonts/google_fonts.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/theme.dart';
import 'package:stacked_services/stacked_services.dart';
@ -15,11 +17,9 @@ class DynamicThemeBuilder extends StatefulWidget {
super.key,
required this.title,
required this.home,
required this.localizationsDelegates,
});
final String title;
final Widget home;
final Iterable<LocalizationsDelegate> localizationsDelegates;
@override
State<DynamicThemeBuilder> createState() => _DynamicThemeBuilderState();
@ -108,7 +108,9 @@ class _DynamicThemeBuilderState extends State<DynamicThemeBuilder>
onGenerateRoute: StackedRouter().onGenerateRoute,
theme: theme,
home: widget.home,
localizationsDelegates: widget.localizationsDelegates,
localizationsDelegates: GlobalMaterialLocalizations.delegates,
locale: TranslationProvider.of(context).flutterLocale,
supportedLocales: AppLocaleUtils.supportedLocales,
),
);
},

View File

@ -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,
),
),
)

View File

@ -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);
}

View File

@ -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),

View File

@ -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(),

View File

@ -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);
}
}

View File

@ -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),
),

View File

@ -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;
}

View File

@ -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: '',
),
],

View File

@ -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),
],
),
),

View File

@ -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'),
),
),
),
);

View File

@ -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,
),
),
),

View File

@ -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),
),
],
),

View File

@ -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 &&

View File

@ -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 {

View File

@ -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),
);
}

View File

@ -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),
);
}

View File

@ -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),
);
}

View File

@ -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),
);

View File

@ -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),
),
],
),

View File

@ -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,

View File

@ -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 {

View File

@ -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/patched_application.dart';
import 'package:revanced_manager/ui/widgets/appInfoView/app_info_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
@ -22,13 +22,10 @@ class AppInfoView extends StatelessWidget {
body: CustomScrollView(
slivers: <Widget>[
CustomSliverAppBar(
title: I18nText(
'appInfoView.widgetTitle',
child: Text(
'',
style: GoogleFonts.inter(
color: Theme.of(context).textTheme.titleLarge!.color,
),
title: Text(
t.appInfoView.widgetTitle,
style: GoogleFonts.inter(
color: Theme.of(context).textTheme.titleLarge!.color,
),
),
),
@ -86,16 +83,13 @@ class AppInfoView extends StatelessWidget {
.primary,
),
const SizedBox(height: 10),
I18nText(
'appInfoView.openButton',
child: Text(
'',
style: TextStyle(
color: Theme.of(context)
.colorScheme
.primary,
fontWeight: FontWeight.bold,
),
Text(
t.appInfoView.openButton,
style: TextStyle(
color: Theme.of(context)
.colorScheme
.primary,
fontWeight: FontWeight.bold,
),
),
],
@ -130,16 +124,13 @@ class AppInfoView extends StatelessWidget {
.primary,
),
const SizedBox(height: 10),
I18nText(
'appInfoView.uninstallButton',
child: Text(
'',
style: TextStyle(
color: Theme.of(context)
.colorScheme
.primary,
fontWeight: FontWeight.bold,
),
Text(
t.appInfoView.uninstallButton,
style: TextStyle(
color: Theme.of(context)
.colorScheme
.primary,
fontWeight: FontWeight.bold,
),
),
],
@ -183,16 +174,13 @@ class AppInfoView extends StatelessWidget {
.primary,
),
const SizedBox(height: 10),
I18nText(
'appInfoView.unmountButton',
child: Text(
'',
style: TextStyle(
color: Theme.of(context)
.colorScheme
.primary,
fontWeight: FontWeight.bold,
),
Text(
t.appInfoView.unmountButton,
style: TextStyle(
color: Theme.of(context)
.colorScheme
.primary,
fontWeight: FontWeight.bold,
),
),
],
@ -209,14 +197,11 @@ class AppInfoView extends StatelessWidget {
ListTile(
contentPadding:
const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'appInfoView.packageNameLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.appInfoView.packageNameLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: Text(app.packageName),
@ -225,61 +210,50 @@ class AppInfoView extends StatelessWidget {
ListTile(
contentPadding:
const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'appInfoView.installTypeLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.appInfoView.installTypeLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: app.isRooted
? I18nText('appInfoView.mountTypeLabel')
: I18nText('appInfoView.regularTypeLabel'),
? Text(t.appInfoView.mountTypeLabel)
: Text(t.appInfoView.regularTypeLabel),
),
const SizedBox(height: 4),
ListTile(
contentPadding:
const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'appInfoView.patchedDateLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.appInfoView.patchedDateLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText(
'appInfoView.patchedDateHint',
translationParams: {
'date': model.getPrettyDate(context, app.patchDate),
'time': model.getPrettyTime(context, app.patchDate),
},
subtitle: Text(
t.appInfoView.patchedDateHint(
date: model.getPrettyDate(context, app.patchDate),
time: model.getPrettyTime(context, app.patchDate),
),
),
),
const SizedBox(height: 4),
ListTile(
contentPadding:
const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'appInfoView.appliedPatchesLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.appInfoView.appliedPatchesLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText(
'appInfoView.appliedPatchesHint',
translationParams: {
'quantity': app.appliedPatches.length.toString(),
},
subtitle: Text(
t.appInfoView.appliedPatchesHint(
quantity: app.appliedPatches.length.toString(),
),
),
onTap: () => model.showAppliedPatchesDialog(context, app),
),

View File

@ -1,9 +1,9 @@
// ignore_for_file: use_build_context_synchronously
import 'package:device_apps/device_apps.dart';
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:intl/intl.dart';
import 'package:revanced_manager/app/app.locator.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/models/patched_application.dart';
import 'package:revanced_manager/services/manager_api.dart';
import 'package:revanced_manager/services/patcher_api.dart';
@ -32,7 +32,7 @@ class AppInfoViewModel extends BaseViewModel {
isUninstalled = await DeviceApps.uninstallApp(app.packageName);
}
if (isUninstalled && app.isRooted && await _rootAPI.hasRootPermissions()) {
if (isUninstalled && app.isRooted && await _rootAPI.hasRootPermissions()) {
await _rootAPI.uninstall(app.packageName);
}
@ -51,7 +51,7 @@ class AppInfoViewModel extends BaseViewModel {
}
void updateNotImplemented(BuildContext context) {
_toast.showBottom('appInfoView.updateNotImplemented');
_toast.showBottom(t.appInfoView.updateNotImplemented);
}
Future<void> showUninstallDialog(
@ -64,12 +64,12 @@ class AppInfoViewModel extends BaseViewModel {
return showDialog(
context: context,
builder: (context) => AlertDialog(
title: I18nText('appInfoView.rootDialogTitle'),
content: I18nText('appInfoView.rootDialogText'),
title: Text(t.appInfoView.rootDialogTitle),
content: Text(t.appInfoView.rootDialogText),
actions: <Widget>[
FilledButton(
onPressed: () => Navigator.of(context).pop(),
child: I18nText('okButton'),
child: Text(t.okButton),
),
],
),
@ -79,16 +79,12 @@ class AppInfoViewModel extends BaseViewModel {
return showDialog(
context: context,
builder: (context) => AlertDialog(
title: I18nText(
'appInfoView.unmountButton',
),
content: I18nText(
'appInfoView.unmountDialogText',
),
title: Text(t.appInfoView.unmountButton),
content: Text(t.appInfoView.unmountDialogText),
actions: <Widget>[
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: I18nText('noButton'),
child: Text(t.noButton),
),
FilledButton(
onPressed: () {
@ -96,7 +92,7 @@ class AppInfoViewModel extends BaseViewModel {
Navigator.of(context).pop();
Navigator.of(context).pop();
},
child: I18nText('yesButton'),
child: Text(t.yesButton),
),
],
),
@ -105,16 +101,12 @@ class AppInfoViewModel extends BaseViewModel {
return showDialog(
context: context,
builder: (context) => AlertDialog(
title: I18nText(
'appInfoView.uninstallButton',
),
content: I18nText(
'appInfoView.uninstallDialogText',
),
title: Text(t.appInfoView.uninstallButton),
content: Text(t.appInfoView.uninstallDialogText),
actions: <Widget>[
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: I18nText('noButton'),
child: Text(t.noButton),
),
FilledButton(
onPressed: () {
@ -122,7 +114,7 @@ class AppInfoViewModel extends BaseViewModel {
Navigator.of(context).pop();
Navigator.of(context).pop();
},
child: I18nText('yesButton'),
child: Text(t.yesButton),
),
],
),
@ -148,14 +140,14 @@ class AppInfoViewModel extends BaseViewModel {
return showDialog(
context: context,
builder: (context) => AlertDialog(
title: I18nText('appInfoView.appliedPatchesLabel'),
title: Text(t.appInfoView.appliedPatchesLabel),
content: SingleChildScrollView(
child: Text(getAppliedPatchesString(app.appliedPatches)),
),
actions: <Widget>[
FilledButton(
onPressed: () => Navigator.of(context).pop(),
child: I18nText('okButton'),
child: Text(t.okButton),
),
],
),

View File

@ -1,6 +1,6 @@
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
class InstalledAppItem extends StatefulWidget {
@ -107,16 +107,12 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
I18nText(
'suggested',
translationParams: {
'version': widget.suggestedVersion.isEmpty
? FlutterI18n.translate(
context,
'appSelectorCard.anyVersion',
)
: widget.suggestedVersion,
},
Text(
t.suggested(
version: widget.suggestedVersion.isEmpty
? Text(t.appSelectorCard.anyVersion)
: 'v${widget.suggestedVersion}',
),
),
const SizedBox(width: 4),
Icon(

View File

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
class NotInstalledAppItem extends StatefulWidget {
@ -91,16 +91,12 @@ class _NotInstalledAppItem extends State<NotInstalledAppItem> {
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
I18nText(
'suggested',
translationParams: {
'version': widget.suggestedVersion.isEmpty
? FlutterI18n.translate(
context,
'appSelectorCard.anyVersion',
)
: widget.suggestedVersion,
},
Text(
t.suggested(
version: widget.suggestedVersion.isEmpty
? t.appSelectorCard.anyVersion
: 'v${widget.suggestedVersion}',
),
),
const SizedBox(width: 4),
Icon(

View File

@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_cache_manager/file.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:revanced_manager/services/download_manager.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
import 'package:url_launcher/url_launcher.dart';
@ -26,14 +25,11 @@ class _ContributorsCardState extends State<ContributorsCard> {
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: I18nText(
child: Text(
widget.title,
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
),

View File

@ -1,7 +1,7 @@
import 'package:device_apps/device_apps.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/models/patched_application.dart';
import 'package:revanced_manager/services/manager_api.dart';
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
@ -51,19 +51,15 @@ class InstalledAppsCard extends StatelessWidget {
color: Theme.of(context).colorScheme.secondary,
),
const SizedBox(height: 16),
I18nText(
'homeView.noInstallations',
child: Text(
'',
textAlign: TextAlign.center,
style: Theme.of(context)
.textTheme
.titleMedium!
.copyWith(
color:
Theme.of(context).colorScheme.secondary,
),
),
Text(
t.homeView.noInstallations,
textAlign: TextAlign.center,
style: Theme.of(context)
.textTheme
.titleMedium!
.copyWith(
color: Theme.of(context).colorScheme.secondary,
),
),
],
),

View File

@ -1,6 +1,6 @@
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/home/home_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
@ -39,13 +39,13 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
children: <Widget>[
FutureBuilder<String?>(
future: model.getLatestManagerReleaseTime(),
builder: (context, snapshot) => snapshot.hasData &&
snapshot.data!.isNotEmpty
? I18nText(
'latestCommitCard.timeagoLabel',
translationParams: {'time': snapshot.data!},
)
: I18nText('latestCommitCard.loadingLabel'),
builder: (context, snapshot) =>
snapshot.hasData && snapshot.data!.isNotEmpty
? Text(
t.latestCommitCard
.timeagoLabel(time: snapshot.data!),
)
: Text(t.latestCommitCard.loadingLabel),
),
],
),
@ -62,8 +62,8 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
!snapshot.data!,
),
child: (snapshot.hasData && !snapshot.data!)
? I18nText('showChangelogButton')
: I18nText('showUpdateButton'),
? Text(t.showChangelogButton)
: Text(t.showUpdateButton),
),
),
],
@ -89,15 +89,9 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
future: model.getLatestPatchesReleaseTime(),
builder: (context, snapshot) => Text(
snapshot.hasData && snapshot.data!.isNotEmpty
? FlutterI18n.translate(
context,
'latestCommitCard.timeagoLabel',
translationParams: {'time': snapshot.data!},
)
: FlutterI18n.translate(
context,
'latestCommitCard.loadingLabel',
),
? t.latestCommitCard
.timeagoLabel(time: snapshot.data!)
: t.latestCommitCard.loadingLabel,
),
),
],
@ -115,8 +109,8 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
!snapshot.data!,
),
child: (snapshot.hasData && !snapshot.data!)
? I18nText('showChangelogButton')
: I18nText('showUpdateButton'),
? Text(t.showChangelogButton)
: Text(t.showUpdateButton),
),
),
],

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:flutter_markdown/flutter_markdown.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';
class UpdateConfirmationSheet extends StatelessWidget {
@ -51,16 +51,13 @@ class UpdateConfirmationSheet extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
I18nText(
Text(
isPatches
? 'homeView.updatePatchesSheetTitle'
: 'homeView.updateSheetTitle',
child: const Text(
'',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
? t.homeView.updatePatchesSheetTitle
: t.homeView.updateSheetTitle,
style: const TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 4.0),
@ -94,40 +91,36 @@ class UpdateConfirmationSheet extends StatelessWidget {
? model.updatePatches(context)
: model.updateManager(context);
},
child: I18nText('updateButton'),
child: Text(t.updateButton),
),
],
),
),
Padding(
padding: const EdgeInsets.only(top: 12.0, left: 24.0, bottom: 12.0),
child: I18nText(
'homeView.updateChangelogTitle',
child: Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
color: Theme.of(context)
.colorScheme
.onSecondaryContainer,
child: Text(
t.homeView.updateChangelogTitle,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
color:
Theme.of(context).colorScheme.onSecondaryContainer,
),
),
),
),
Container(
margin: const EdgeInsets.symmetric(horizontal: 24.0),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondaryContainer,
borderRadius: BorderRadius.circular(12.0),
Container(
margin: const EdgeInsets.symmetric(horizontal: 24.0),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondaryContainer,
borderRadius: BorderRadius.circular(12.0),
),
child: Markdown(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.all(20.0),
data: snapshot.data!['body'] ?? '',
),
),
child: Markdown(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.all(20.0),
data: snapshot.data!['body'] ?? '',
),
),
],
);
},

View File

@ -1,7 +1,8 @@
import 'dart:typed_data';
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/patcher/patcher_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
@ -28,21 +29,18 @@ class AppSelectorCard extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
I18nText(
Text(
vm.selectedApp == null
? 'appSelectorCard.widgetTitle'
: 'appSelectorCard.widgetTitleSelected',
child: const Text(
'',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
? t.appSelectorCard.widgetTitle
: t.appSelectorCard.widgetTitleSelected,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 8),
if (vm.selectedApp == null)
I18nText('appSelectorCard.widgetSubtitle')
Text(t.appSelectorCard.widgetSubtitle)
else
Row(
children: <Widget>[
@ -96,11 +94,10 @@ class AppSelectorCard extends StatelessWidget {
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
I18nText(
'suggested',
translationParams: {
'version': suggestedVersion,
},
Text(
t.suggested(
version: suggestedVersion,
),
),
const SizedBox(width: 4),
Icon(

View File

@ -1,6 +1,6 @@
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/models/patch.dart';
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
@ -21,16 +21,13 @@ class PatchSelectorCard extends StatelessWidget {
children: <Widget>[
Row(
children: <Widget>[
I18nText(
Text(
locator<PatcherViewModel>().selectedPatches.isEmpty
? 'patchSelectorCard.widgetTitle'
: 'patchSelectorCard.widgetTitleSelected',
child: const Text(
'',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
? t.patchSelectorCard.widgetTitle
: t.patchSelectorCard.widgetTitleSelected,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
Text(
@ -46,10 +43,10 @@ class PatchSelectorCard extends StatelessWidget {
),
const SizedBox(height: 4),
if (locator<PatcherViewModel>().selectedApp == null)
I18nText('patchSelectorCard.widgetSubtitle')
Text(t.patchSelectorCard.widgetSubtitle)
else
locator<PatcherViewModel>().selectedPatches.isEmpty
? I18nText('patchSelectorCard.widgetEmptySubtitle')
? Text(t.patchSelectorCard.widgetEmptySubtitle)
: Text(_getPatchesSelection()),
],
),

View File

@ -1,6 +1,6 @@
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/models/patch.dart';
import 'package:revanced_manager/services/manager_api.dart';
import 'package:revanced_manager/services/toast.dart';
@ -162,7 +162,7 @@ class _PatchItemState extends State<PatchItem> {
Padding(
padding: const EdgeInsets.only(top: 8),
child: TextButton.icon(
label: I18nText('warning'),
label: Text(t.warning),
icon: const Icon(
Icons.warning_amber_outlined,
size: 20.0,
@ -215,19 +215,18 @@ class _PatchItemState extends State<PatchItem> {
return showDialog(
context: context,
builder: (context) => AlertDialog(
title: I18nText('warning'),
content: I18nText(
'patchItem.unsupportedDialogText',
translationParams: {
'packageVersion': widget.packageVersion,
'supportedVersions':
title: Text(t.warning),
content: Text(
t.patchItem.unsupportedDialogText(
packageVersion: widget.packageVersion,
supportedVersions:
'${widget.supportedPackageVersions.reversed.join('\n')}',
},
),
),
actions: <Widget>[
FilledButton(
onPressed: () => Navigator.of(context).pop(),
child: I18nText('okButton'),
child: Text(t.okButton),
),
],
),
@ -238,14 +237,14 @@ class _PatchItemState extends State<PatchItem> {
return showDialog(
context: context,
builder: (context) => AlertDialog(
title: I18nText('notice'),
content: I18nText(
'patchItem.unsupportedRequiredOption',
title: Text(t.notice),
content: Text(
t.patchItem.unsupportedRequiredOption,
),
actions: <Widget>[
FilledButton(
onPressed: () => Navigator.of(context).pop(),
child: I18nText('okButton'),
child: Text(t.okButton),
),
],
),

View File

@ -1,7 +1,7 @@
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/gen/strings.g.dart';
import 'package:revanced_manager/models/patch.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
@ -93,13 +93,10 @@ class IntAndStringPatchOption extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 8),
I18nText(
'patchOptionsView.requiredOption',
child: Text(
'',
style: TextStyle(
color: Theme.of(context).colorScheme.error,
),
Text(
t.patchOptionsView.requiredOption,
style: TextStyle(
color: Theme.of(context).colorScheme.error,
),
),
],
@ -240,14 +237,11 @@ class IntStringLongListPatchOption extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
const Icon(Icons.add, size: 20),
I18nText(
'add',
child: const Text(
'',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
),
Text(
t.add,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
],
@ -279,13 +273,10 @@ class UnsupportedPatchOption extends StatelessWidget {
alignment: Alignment.centerLeft,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: I18nText(
'patchOptionsView.unsupportedOption',
child: const Text(
'',
style: TextStyle(
fontSize: 16,
),
child: Text(
t.patchOptionsView.unsupportedOption,
style: const TextStyle(
fontSize: 16,
),
),
),
@ -452,13 +443,10 @@ class _TextFieldForPatchOptionState extends State<TextFieldForPatchOption> {
..add(
DropdownMenuItem(
value: '',
child: I18nText(
'patchOptionsView.customValue',
child: const Text(
'',
style: TextStyle(
fontSize: 16,
),
child: Text(
t.patchOptionsView.customValue,
style: const TextStyle(
fontSize: 16,
),
),
),
@ -491,25 +479,22 @@ class _TextFieldForPatchOptionState extends State<TextFieldForPatchOption> {
isStringOption ? TextInputType.text : TextInputType.number,
decoration: InputDecoration(
suffixIcon: PopupMenuButton(
tooltip: FlutterI18n.translate(
context,
'patchOptionsView.tooltip',
),
tooltip: t.patchOptionsView.tooltip,
itemBuilder: (BuildContext context) {
return [
if (isArrayOption)
PopupMenuItem(
value: 'remove',
child: I18nText('remove'),
value: t.remove,
child: Text(t.remove),
),
if (isStringOption) ...[
PopupMenuItem(
value: 'patchOptionsView.selectFilePath',
child: I18nText('patchOptionsView.selectFilePath'),
value: t.patchOptionsView.selectFilePath,
child: Text(t.patchOptionsView.selectFilePath),
),
PopupMenuItem(
value: 'patchOptionsView.selectFolder',
child: I18nText('patchOptionsView.selectFolder'),
value: t.patchOptionsView.selectFolder,
child: Text(t.patchOptionsView.selectFolder),
),
],
];

View File

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/utils/about_info.dart';
class AboutWidget extends StatefulWidget {
@ -34,21 +34,18 @@ class _AboutWidgetState extends State<AboutWidget> {
);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: I18nText('settingsView.snackbarMessage'),
content: Text(t.settingsView.snackbarMessage),
backgroundColor:
Theme.of(context).colorScheme.secondary,
),
);
}
: null,
title: I18nText(
'settingsView.aboutLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.aboutLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: snapshot.hasData

View File

@ -1,6 +1,7 @@
// ignore_for_file: prefer_const_constructors
import 'package:flutter/material.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_manage_api_url.dart';
import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_manage_sources.dart';
import 'package:revanced_manager/ui/widgets/settingsView/settings_auto_update_patches.dart';
@ -17,7 +18,7 @@ class SAdvancedSection extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SettingsSection(
title: 'settingsView.advancedSectionTitle',
title: t.settingsView.advancedSectionTitle,
children: const <Widget>[
SAutoUpdatePatches(),
SShowUpdateDialog(),

View File

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_i18n/widgets/I18nText.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/shared/haptics/haptic_switch_list_tile.dart';
@ -17,17 +17,14 @@ class _SAutoUpdatePatchesState extends State<SAutoUpdatePatches> {
Widget build(BuildContext context) {
return HapticSwitchListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.autoUpdatePatchesLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.autoUpdatePatchesLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.autoUpdatePatchesHint'),
subtitle: Text(t.settingsView.autoUpdatePatchesHint),
value: _settingsViewModel.isPatchesAutoUpdate(),
onChanged: (value) {
setState(() {

View File

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_i18n/widgets/I18nText.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/settingsView/about_widget.dart';
import 'package:revanced_manager/ui/widgets/settingsView/settings_section.dart';
@ -12,51 +12,42 @@ class SDebugSection extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SettingsSection(
title: 'settingsView.debugSectionTitle',
title: t.settingsView.debugSectionTitle,
children: <Widget>[
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.logsLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.logsLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.logsHint'),
subtitle: Text(t.settingsView.logsHint),
onTap: () => _settingsViewModel.exportLogcatLogs(),
),
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.deleteLogsLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.deleteLogsLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.deleteLogsHint'),
subtitle: Text(t.settingsView.deleteLogsHint),
onTap: () => _settingsViewModel.deleteLogs(),
),
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.deleteTempDirLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.deleteTempDirLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.deleteTempDirHint'),
subtitle: Text(t.settingsView.deleteTempDirHint),
onTap: () => _settingsViewModel.deleteTempDir(),
),
const AboutWidget(

View File

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_i18n/widgets/I18nText.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/shared/haptics/haptic_switch_list_tile.dart';
@ -18,17 +18,14 @@ class _SEnablePatchesSelectionState extends State<SEnablePatchesSelection> {
Widget build(BuildContext context) {
return HapticSwitchListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.enablePatchesSelectionLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.enablePatchesSelectionLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.enablePatchesSelectionHint'),
subtitle: Text(t.settingsView.enablePatchesSelectionHint),
value: _settingsViewModel.isPatchesChangeEnabled(),
onChanged: (value) async {
await _settingsViewModel.showPatchesChangeEnableDialog(value, context);

View File

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_i18n/widgets/I18nText.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_manage_keystore_password.dart';
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/settingsView/settings_section.dart';
@ -12,106 +12,88 @@ class SExportSection extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SettingsSection(
title: 'settingsView.exportSectionTitle',
title: t.settingsView.exportSectionTitle,
children: <Widget>[
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.exportPatchesLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.exportPatchesLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.exportPatchesHint'),
subtitle: Text(t.settingsView.exportPatchesHint),
onTap: () => _settingsViewModel.exportPatches(),
),
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.importPatchesLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.importPatchesLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.importPatchesHint'),
subtitle: Text(t.settingsView.importPatchesHint),
onTap: () => _settingsViewModel.importPatches(context),
),
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.resetStoredPatchesLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.resetStoredPatchesLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.resetStoredPatchesHint'),
subtitle: Text(t.settingsView.resetStoredPatchesHint),
onTap: () => _showResetDialog(
context,
'settingsView.resetStoredPatchesDialogTitle',
'settingsView.resetStoredPatchesDialogText',
t.settingsView.resetStoredPatchesDialogTitle,
t.settingsView.resetStoredPatchesDialogText,
_settingsViewModel.resetSelectedPatches,
),
),
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.resetStoredOptionsLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.resetStoredOptionsLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.resetStoredOptionsHint'),
subtitle: Text(t.settingsView.resetStoredOptionsHint),
onTap: () => _showResetDialog(
context,
'settingsView.resetStoredOptionsDialogTitle',
'settingsView.resetStoredOptionsDialogText',
t.settingsView.resetStoredOptionsDialogTitle,
t.settingsView.resetStoredOptionsDialogText,
_settingsViewModel.resetAllOptions,
),
),
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.exportKeystoreLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.exportKeystoreLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.exportKeystoreHint'),
subtitle: Text(t.settingsView.exportKeystoreHint),
onTap: () => _settingsViewModel.exportKeystore(),
),
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.importKeystoreLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.importKeystoreLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.importKeystoreHint'),
subtitle: Text(t.settingsView.importKeystoreHint),
onTap: () async {
await _settingsViewModel.importKeystore();
final sManageKeystorePassword = SManageKeystorePassword();
@ -122,17 +104,14 @@ class SExportSection extends StatelessWidget {
),
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.regenerateKeystoreLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.regenerateKeystoreLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.regenerateKeystoreHint'),
subtitle: Text(t.settingsView.regenerateKeystoreHint),
onTap: () => _showDeleteKeystoreDialog(context),
),
// SManageKeystorePasswordUI(),
@ -149,19 +128,19 @@ class SExportSection extends StatelessWidget {
return showDialog(
context: context,
builder: (context) => AlertDialog(
title: I18nText(dialogTitle),
content: I18nText(dialogText),
title: Text(dialogTitle),
content: Text(dialogText),
actions: <Widget>[
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: I18nText('noButton'),
child: Text(t.noButton),
),
FilledButton(
onPressed: () => {
Navigator.of(context).pop(),
dialogAction(),
},
child: I18nText('yesButton'),
child: Text(t.yesButton),
),
],
),
@ -172,19 +151,19 @@ class SExportSection extends StatelessWidget {
return showDialog(
context: context,
builder: (context) => AlertDialog(
title: I18nText('settingsView.regenerateKeystoreDialogTitle'),
content: I18nText('settingsView.regenerateKeystoreDialogText'),
title: Text(t.settingsView.regenerateKeystoreDialogTitle),
content: Text(t.settingsView.regenerateKeystoreDialogText),
actions: <Widget>[
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: I18nText('noButton'),
child: Text(t.noButton),
),
FilledButton(
onPressed: () => {
Navigator.of(context).pop(),
_settingsViewModel.deleteKeystore(),
},
child: I18nText('yesButton'),
child: Text(t.yesButton),
),
],
),

View File

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_i18n/widgets/I18nText.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/shared/haptics/haptic_switch_list_tile.dart';
@ -19,17 +19,14 @@ class _SRequireSuggestedAppVersionState
Widget build(BuildContext context) {
return HapticSwitchListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.requireSuggestedAppVersionLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.requireSuggestedAppVersionLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.requireSuggestedAppVersionHint'),
subtitle: Text(t.settingsView.requireSuggestedAppVersionHint),
value: _settingsViewModel.isRequireSuggestedAppVersionEnabled(),
onChanged: (value) async {
await _settingsViewModel.showRequireSuggestedAppVersionDialog(

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
class SettingsSection extends StatelessWidget {
const SettingsSection({
@ -17,13 +16,10 @@ class SettingsSection extends StatelessWidget {
children: <Widget>[
Container(
padding: const EdgeInsets.only(top: 16.0, bottom: 10.0, left: 20.0),
child: I18nText(
child: Text(
title,
child: Text(
'',
style: TextStyle(
color: Theme.of(context).colorScheme.primary,
),
style: TextStyle(
color: Theme.of(context).colorScheme.primary,
),
),
),

View File

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_i18n/widgets/I18nText.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/shared/haptics/haptic_switch_list_tile.dart';
@ -17,17 +17,14 @@ class _SShowUpdateDialogState extends State<SShowUpdateDialog> {
Widget build(BuildContext context) {
return HapticSwitchListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.showUpdateDialogLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.showUpdateDialogLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.showUpdateDialogHint'),
subtitle: Text(t.settingsView.showUpdateDialogHint),
value: _settingsViewModel.showUpdateDialog(),
onChanged: (value) {
setState(() {

View File

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_i18n/widgets/I18nText.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/settingsView/settings_section.dart';
import 'package:revanced_manager/ui/widgets/settingsView/social_media_widget.dart';
@ -12,21 +12,18 @@ class STeamSection extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SettingsSection(
title: 'settingsView.teamSectionTitle',
title: t.settingsView.teamSectionTitle,
children: <Widget>[
ListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.contributorsLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.contributorsLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.contributorsHint'),
subtitle: Text(t.settingsView.contributorsHint),
onTap: () => _settingsViewModel.navigateToContributors(),
),
const SocialMediaWidget(

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
class SettingsTileDialog extends StatelessWidget {
const SettingsTileDialog({
@ -18,17 +17,14 @@ class SettingsTileDialog extends StatelessWidget {
Widget build(BuildContext context) {
return ListTile(
contentPadding: padding ?? EdgeInsets.zero,
title: I18nText(
title: Text(
title,
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText(subtitle),
subtitle: Text(subtitle),
onTap: onTap,
);
}

View File

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_i18n/widgets/I18nText.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart';
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
@ -21,17 +21,14 @@ class _SUniversalPatchesState extends State<SUniversalPatches> {
Widget build(BuildContext context) {
return HapticSwitchListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.universalPatchesLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.universalPatchesLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.universalPatchesHint'),
subtitle: Text(t.settingsView.universalPatchesHint),
value: _settingsViewModel.areUniversalPatchesEnabled(),
onChanged: (value) {
setState(() {

View File

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_i18n/widgets/I18nText.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart';
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
@ -24,17 +24,14 @@ class _SVersionCompatibilityCheckState
Widget build(BuildContext context) {
return HapticSwitchListTile(
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.versionCompatibilityCheckLabel',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.settingsView.versionCompatibilityCheckLabel,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('settingsView.versionCompatibilityCheckHint'),
subtitle: Text(t.settingsView.versionCompatibilityCheckHint),
value: _settingsViewModel.isVersionCompatibilityCheckEnabled(),
onChanged: (value) {
setState(() {

View File

@ -1,7 +1,7 @@
import 'package:expandable/expandable.dart';
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/ui/widgets/settingsView/social_media_item.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_icon.dart';
@ -26,17 +26,14 @@ class SocialMediaWidget extends StatelessWidget {
),
header: ListTile(
contentPadding: padding ?? EdgeInsets.zero,
title: I18nText(
'socialMediaCard.widgetTitle',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
title: Text(
t.socialMediaCard.widgetTitle,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
subtitle: I18nText('socialMediaCard.widgetSubtitle'),
subtitle: Text(t.socialMediaCard.widgetSubtitle),
),
expanded: Padding(
padding: padding ?? EdgeInsets.zero,

View File

@ -1,7 +1,7 @@
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:revanced_manager/gen/strings.g.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
import 'package:timeago/timeago.dart';
@ -81,7 +81,7 @@ class _ApplicationItemState extends State<ApplicationItem> {
children: <Widget>[
FilledButton(
onPressed: widget.onPressed,
child: I18nText('applicationItem.infoButton'),
child: Text(t.applicationItem.infoButton),
),
],
),