mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 01:01:56 +01:00
refactor: change name from "recommendedVersion" to "suggestedVersion"
This commit is contained in:
parent
e2ed296dc7
commit
941263102d
8 changed files with 26 additions and 26 deletions
|
@ -57,7 +57,7 @@
|
|||
"widgetSubtitle": "No application selected",
|
||||
"noAppsLabel": "No applications found",
|
||||
"currentVersion": "Current",
|
||||
"recommendedVersion": "Suggested",
|
||||
"suggestedVersion": "Suggested",
|
||||
"anyVersion": "any"
|
||||
},
|
||||
"patchSelectorCard": {
|
||||
|
@ -91,7 +91,7 @@
|
|||
"loadPatchesSelection": "Load patches selection",
|
||||
"noSavedPatches": "No saved patches for the selected app.\nPress Done to save current selection.",
|
||||
"noPatchesFound": "No patches found for the selected app",
|
||||
"selectAllPatchesWarningContent": "You are about to select all patches, that includes unrecommended patches and can cause unwanted behavior."
|
||||
"selectAllPatchesWarningContent": "You are about to select all patches, that includes non-suggested patches and can cause unwanted behavior."
|
||||
},
|
||||
"patchItem": {
|
||||
"unsupportedDialogText": "Selecting this patch may result in patching errors.\n\nApp version: {packageVersion}\nSupported versions:\n{supportedVersions}",
|
||||
|
|
|
@ -310,7 +310,7 @@ class PatcherAPI {
|
|||
ShareExtend.share(log.path, 'file');
|
||||
}
|
||||
|
||||
String getRecommendedVersion(String packageName) {
|
||||
String getSuggestedVersion(String packageName) {
|
||||
final Map<String, int> versions = {};
|
||||
for (final Patch patch in _patches) {
|
||||
final Package? package = patch.compatiblePackages.firstWhereOrNull(
|
||||
|
|
|
@ -104,8 +104,8 @@ class _AppSelectorViewState extends State<AppSelectorView> {
|
|||
icon: app.icon,
|
||||
patchesCount:
|
||||
model.patchesCount(app.packageName),
|
||||
recommendedVersion:
|
||||
model.getRecommendedVersion(
|
||||
suggestedVersion:
|
||||
model.getSuggestedVersion(
|
||||
app.packageName,
|
||||
),
|
||||
onTap: () {
|
||||
|
@ -127,8 +127,8 @@ class _AppSelectorViewState extends State<AppSelectorView> {
|
|||
(app) => NotInstalledAppItem(
|
||||
name: app,
|
||||
patchesCount: model.patchesCount(app),
|
||||
recommendedVersion:
|
||||
model.getRecommendedVersion(app),
|
||||
suggestedVersion:
|
||||
model.getSuggestedVersion(app),
|
||||
onTap: () {
|
||||
model.showDownloadToast();
|
||||
},
|
||||
|
|
|
@ -61,8 +61,8 @@ class AppSelectorViewModel extends BaseViewModel {
|
|||
return allApps;
|
||||
}
|
||||
|
||||
String getRecommendedVersion(String packageName) {
|
||||
return _patcherAPI.getRecommendedVersion(packageName);
|
||||
String getSuggestedVersion(String packageName) {
|
||||
return _patcherAPI.getSuggestedVersion(packageName);
|
||||
}
|
||||
|
||||
Future<void> selectApp(ApplicationWithIcon application) async {
|
||||
|
|
|
@ -130,24 +130,24 @@ class PatcherViewModel extends BaseViewModel {
|
|||
return text;
|
||||
}
|
||||
|
||||
String getRecommendedVersionString(BuildContext context) {
|
||||
String recommendedVersion =
|
||||
_patcherAPI.getRecommendedVersion(selectedApp!.packageName);
|
||||
if (recommendedVersion.isEmpty) {
|
||||
recommendedVersion = FlutterI18n.translate(
|
||||
String getSuggestedVersionString(BuildContext context) {
|
||||
String suggestedVersion =
|
||||
_patcherAPI.getSuggestedVersion(selectedApp!.packageName);
|
||||
if (suggestedVersion.isEmpty) {
|
||||
suggestedVersion = FlutterI18n.translate(
|
||||
context,
|
||||
'appSelectorCard.anyVersion',
|
||||
);
|
||||
} else {
|
||||
recommendedVersion = 'v$recommendedVersion';
|
||||
suggestedVersion = 'v$suggestedVersion';
|
||||
}
|
||||
return '${FlutterI18n.translate(
|
||||
context,
|
||||
'appSelectorCard.currentVersion',
|
||||
)}: v${selectedApp!.version}\n${FlutterI18n.translate(
|
||||
context,
|
||||
'appSelectorCard.recommendedVersion',
|
||||
)}: $recommendedVersion';
|
||||
'appSelectorCard.suggestedVersion',
|
||||
)}: $suggestedVersion';
|
||||
}
|
||||
|
||||
Future<void> loadLastSelectedPatches() async {
|
||||
|
|
|
@ -9,14 +9,14 @@ class InstalledAppItem extends StatefulWidget {
|
|||
required this.pkgName,
|
||||
required this.icon,
|
||||
required this.patchesCount,
|
||||
required this.recommendedVersion,
|
||||
required this.suggestedVersion,
|
||||
this.onTap,
|
||||
}) : super(key: key);
|
||||
final String name;
|
||||
final String pkgName;
|
||||
final Uint8List icon;
|
||||
final int patchesCount;
|
||||
final String recommendedVersion;
|
||||
final String suggestedVersion;
|
||||
final Function()? onTap;
|
||||
|
||||
@override
|
||||
|
@ -62,9 +62,9 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
|
|||
Row(
|
||||
children: [
|
||||
Text(
|
||||
widget.recommendedVersion.isEmpty
|
||||
widget.suggestedVersion.isEmpty
|
||||
? 'All versions'
|
||||
: widget.recommendedVersion,
|
||||
: widget.suggestedVersion,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
|
|
|
@ -6,12 +6,12 @@ class NotInstalledAppItem extends StatefulWidget {
|
|||
Key? key,
|
||||
required this.name,
|
||||
required this.patchesCount,
|
||||
required this.recommendedVersion,
|
||||
required this.suggestedVersion,
|
||||
this.onTap,
|
||||
}) : super(key: key);
|
||||
final String name;
|
||||
final int patchesCount;
|
||||
final String recommendedVersion;
|
||||
final String suggestedVersion;
|
||||
final Function()? onTap;
|
||||
|
||||
@override
|
||||
|
@ -59,9 +59,9 @@ class _NotInstalledAppItem extends State<NotInstalledAppItem> {
|
|||
Row(
|
||||
children: [
|
||||
Text(
|
||||
widget.recommendedVersion.isEmpty
|
||||
widget.suggestedVersion.isEmpty
|
||||
? 'All versions'
|
||||
: widget.recommendedVersion,
|
||||
: widget.suggestedVersion,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
|
|
|
@ -63,7 +63,7 @@ class AppSelectorCard extends StatelessWidget {
|
|||
const SizedBox(height: 4),
|
||||
Text(
|
||||
locator<PatcherViewModel>()
|
||||
.getRecommendedVersionString(context),
|
||||
.getSuggestedVersionString(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue