refactor: change name from "recommendedVersion" to "suggestedVersion"

This commit is contained in:
EvadeMaster 2023-04-29 20:00:00 +07:00 committed by Palm
parent e2ed296dc7
commit 941263102d
8 changed files with 26 additions and 26 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -63,7 +63,7 @@ class AppSelectorCard extends StatelessWidget {
const SizedBox(height: 4),
Text(
locator<PatcherViewModel>()
.getRecommendedVersionString(context),
.getSuggestedVersionString(context),
),
],
),