mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
feat: Improve app selector and patcher UI (#1616)
This commit is contained in:
parent
acb1e2434b
commit
efb2d5ef32
@ -72,22 +72,21 @@
|
|||||||
"widgetTitle": "Patcher",
|
"widgetTitle": "Patcher",
|
||||||
"patchButton": "Patch",
|
"patchButton": "Patch",
|
||||||
|
|
||||||
"armv7WarningDialogText": "Patching on ARMv7 devices is not yet supported and might fail. Proceed anyways?",
|
"armv7WarningDialogText": "Patching on ARMv7 devices is not yet supported and might fail. Continue anyways?",
|
||||||
|
|
||||||
"removedPatchesWarningDialogText": "The following patches have been removed since the last time you used them.\n\n{patches}\n\nProceed anyways?",
|
"removedPatchesWarningDialogText": "The following patches have been removed since the last time you used them.\n\n{patches}\n\nContinue anyways?",
|
||||||
"requiredOptionDialogText" : "Some patch options have to be set."
|
"requiredOptionDialogText" : "Some patch options have to be set."
|
||||||
},
|
},
|
||||||
"appSelectorCard": {
|
"appSelectorCard": {
|
||||||
"widgetTitle": "Select an application",
|
"widgetTitle": "Select an app",
|
||||||
"widgetTitleSelected": "Selected application",
|
"widgetTitleSelected": "Selected app",
|
||||||
"widgetSubtitle": "No application selected",
|
"widgetSubtitle": "No app selected",
|
||||||
|
|
||||||
"noAppsLabel": "No applications found",
|
"noAppsLabel": "No applications found",
|
||||||
"notInstalled":"App not installed",
|
|
||||||
|
|
||||||
"currentVersion": "Current",
|
"currentVersion": "Current",
|
||||||
"suggestedVersion": "Suggested",
|
"suggestedVersion": "Suggested",
|
||||||
"allVersions": "All versions"
|
"anyVersion": "Any version"
|
||||||
},
|
},
|
||||||
"patchSelectorCard": {
|
"patchSelectorCard": {
|
||||||
"widgetTitle": "Select patches",
|
"widgetTitle": "Select patches",
|
||||||
@ -101,8 +100,8 @@
|
|||||||
"widgetSubtitle": "We are online!"
|
"widgetSubtitle": "We are online!"
|
||||||
},
|
},
|
||||||
"appSelectorView": {
|
"appSelectorView": {
|
||||||
"viewTitle": "Select an application",
|
"viewTitle": "Select an app",
|
||||||
"searchBarHint": "Search applications",
|
"searchBarHint": "Search app",
|
||||||
|
|
||||||
"storageButton": "Storage",
|
"storageButton": "Storage",
|
||||||
"selectFromStorageButton": "Select from storage",
|
"selectFromStorageButton": "Select from storage",
|
||||||
@ -111,7 +110,7 @@
|
|||||||
|
|
||||||
"downloadToast": "Download function is not available yet",
|
"downloadToast": "Download function is not available yet",
|
||||||
|
|
||||||
"requireSuggestedAppVersionDialogText": "The version of the app you have selected does not match the suggested version. Please select the app that matches the suggested version.\n\nSelected version: v{selected}\nSuggested version: v{suggested}\n\nTo proceed anyway, disable \"Require suggested app version\" in the settings.",
|
"requireSuggestedAppVersionDialogText": "The version of the app you have selected does not match the suggested version which can lead to unexpected issues. Please use the suggested version.\n\nSelected version: {selected}\nSuggested version: {suggested}\n\nTo continue anyway, disable \"Require suggested app version\" in the settings.",
|
||||||
|
|
||||||
"featureNotAvailable": "Feature not implemented",
|
"featureNotAvailable": "Feature not implemented",
|
||||||
"featureNotAvailableText": "This application is a split APK and cannot be selected. Unfortunately, this feature is only available for rooted users at the moment. However, you can still install the application by selecting its APK files from your device's storage instead"
|
"featureNotAvailableText": "This application is a split APK and cannot be selected. Unfortunately, this feature is only available for rooted users at the moment. However, you can still install the application by selecting its APK files from your device's storage instead"
|
||||||
@ -164,7 +163,7 @@
|
|||||||
"installerView": {
|
"installerView": {
|
||||||
"widgetTitle": "Installer",
|
"widgetTitle": "Installer",
|
||||||
"installType": "Select install type",
|
"installType": "Select install type",
|
||||||
"installTypeDescription": "Select the installation type to proceed with.",
|
"installTypeDescription": "Select the installation type to continue with.",
|
||||||
|
|
||||||
"installButton": "Install",
|
"installButton": "Install",
|
||||||
"installRootType": "Mount",
|
"installRootType": "Mount",
|
||||||
@ -241,6 +240,7 @@
|
|||||||
|
|
||||||
"versionCompatibilityCheckLabel": "Version compatibility check",
|
"versionCompatibilityCheckLabel": "Version compatibility check",
|
||||||
"versionCompatibilityCheckHint": "Prevent selecting patches that are not compatible with the selected app version",
|
"versionCompatibilityCheckHint": "Prevent selecting patches that are not compatible with the selected app version",
|
||||||
|
|
||||||
"requireSuggestedAppVersionLabel": "Require suggested app version",
|
"requireSuggestedAppVersionLabel": "Require suggested app version",
|
||||||
"requireSuggestedAppVersionHint": "Prevent selecting an app with a version that is not the suggested",
|
"requireSuggestedAppVersionHint": "Prevent selecting an app with a version that is not the suggested",
|
||||||
"requireSuggestedAppVersionDialogText": "Selecting an app that is not the suggested version may cause unexpected issues.\n\nDo you want to proceed anyways?",
|
"requireSuggestedAppVersionDialogText": "Selecting an app that is not the suggested version may cause unexpected issues.\n\nDo you want to proceed anyways?",
|
||||||
|
@ -76,7 +76,7 @@ class AppSelectorViewModel extends BaseViewModel {
|
|||||||
final String suggestedVersion = getSuggestedVersion(packageName);
|
final String suggestedVersion = getSuggestedVersion(packageName);
|
||||||
|
|
||||||
if (suggestedVersion.isNotEmpty) {
|
if (suggestedVersion.isNotEmpty) {
|
||||||
await openDefaultBrowser('$packageName apk version v$suggestedVersion');
|
await openDefaultBrowser('$packageName apk version $suggestedVersion');
|
||||||
} else {
|
} else {
|
||||||
await openDefaultBrowser('$packageName apk');
|
await openDefaultBrowser('$packageName apk');
|
||||||
}
|
}
|
||||||
|
@ -220,8 +220,6 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
String suggestedVersion = _patcherAPI.getSuggestedVersion(_app.packageName);
|
String suggestedVersion = _patcherAPI.getSuggestedVersion(_app.packageName);
|
||||||
if (suggestedVersion.isEmpty) {
|
if (suggestedVersion.isEmpty) {
|
||||||
suggestedVersion = 'Any';
|
suggestedVersion = 'Any';
|
||||||
} else {
|
|
||||||
suggestedVersion = 'v$suggestedVersion';
|
|
||||||
}
|
}
|
||||||
return suggestedVersion;
|
return suggestedVersion;
|
||||||
}
|
}
|
||||||
|
@ -148,52 +148,17 @@ class PatcherViewModel extends BaseViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String getAppSelectionString() {
|
String getAppSelectionString() {
|
||||||
String text = '${selectedApp!.name} (${selectedApp!.packageName})';
|
return '${selectedApp!.name} ${selectedApp!.version}';
|
||||||
if (text.length > 32) {
|
|
||||||
text = '${text.substring(0, 32)}...)';
|
|
||||||
}
|
|
||||||
return text;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String getCurrentVersionString(BuildContext context) {
|
Future<void> queryVersion(String suggestedVersion) async {
|
||||||
return '${FlutterI18n.translate(
|
await openDefaultBrowser(
|
||||||
context,
|
'${selectedApp!.packageName} apk version $suggestedVersion',
|
||||||
'appSelectorCard.currentVersion',
|
);
|
||||||
)}: v${selectedApp!.version}';
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> searchSuggestedVersionOnWeb() async {
|
|
||||||
final String suggestedVersion =
|
|
||||||
_patcherAPI.getSuggestedVersion(selectedApp!.packageName);
|
|
||||||
|
|
||||||
if (suggestedVersion.isNotEmpty) {
|
|
||||||
await openDefaultBrowser(
|
|
||||||
'${selectedApp!.packageName} apk version v$suggestedVersion',
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
await openDefaultBrowser('${selectedApp!.packageName} apk');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String getSuggestedVersion() {
|
|
||||||
return _patcherAPI.getSuggestedVersion(selectedApp!.packageName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String getSuggestedVersionString(BuildContext context) {
|
String getSuggestedVersionString(BuildContext context) {
|
||||||
String suggestedVersion =
|
return _patcherAPI.getSuggestedVersion(selectedApp!.packageName);
|
||||||
_patcherAPI.getSuggestedVersion(selectedApp!.packageName);
|
|
||||||
if (suggestedVersion.isEmpty) {
|
|
||||||
suggestedVersion = FlutterI18n.translate(
|
|
||||||
context,
|
|
||||||
'appSelectorCard.allVersions',
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
suggestedVersion = 'v$suggestedVersion';
|
|
||||||
}
|
|
||||||
return '${FlutterI18n.translate(
|
|
||||||
context,
|
|
||||||
'appSelectorCard.suggestedVersion',
|
|
||||||
)}: $suggestedVersion';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> openDefaultBrowser(String query) async {
|
Future<void> openDefaultBrowser(String query) async {
|
||||||
|
@ -54,25 +54,43 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
Wrap(
|
||||||
|
crossAxisAlignment: WrapCrossAlignment.center,
|
||||||
|
spacing: 4,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
widget.name,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
widget.installedVersion,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
widget.patchesCount == 1
|
||||||
|
? '• ${widget.patchesCount} patch'
|
||||||
|
: '• ${widget.patchesCount} patches',
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
color: Theme.of(context).colorScheme.secondary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
Text(
|
Text(
|
||||||
widget.name,
|
widget.pkgName,
|
||||||
maxLines: 2,
|
|
||||||
overflow: TextOverflow.visible,
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(widget.pkgName),
|
|
||||||
I18nText(
|
|
||||||
FlutterI18n.translate(
|
|
||||||
context,
|
|
||||||
'installed',
|
|
||||||
translationParams: {
|
|
||||||
'version': 'v${widget.installedVersion}',
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
Wrap(
|
Wrap(
|
||||||
crossAxisAlignment: WrapCrossAlignment.center,
|
crossAxisAlignment: WrapCrossAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@ -85,7 +103,7 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
|
|||||||
borderRadius:
|
borderRadius:
|
||||||
const BorderRadius.all(Radius.circular(8)),
|
const BorderRadius.all(Radius.circular(8)),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(4),
|
padding: const EdgeInsets.fromLTRB(8, 4, 8, 4),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
@ -95,18 +113,10 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
|
|||||||
'version': widget.suggestedVersion.isEmpty
|
'version': widget.suggestedVersion.isEmpty
|
||||||
? FlutterI18n.translate(
|
? FlutterI18n.translate(
|
||||||
context,
|
context,
|
||||||
'appSelectorCard.allVersions',
|
'appSelectorCard.anyVersion',
|
||||||
)
|
)
|
||||||
: 'v${widget.suggestedVersion}',
|
: widget.suggestedVersion,
|
||||||
},
|
},
|
||||||
child: Text(
|
|
||||||
'',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.onSecondaryContainer,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 4),
|
const SizedBox(width: 4),
|
||||||
Icon(
|
Icon(
|
||||||
@ -121,17 +131,6 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 4),
|
|
||||||
Text(
|
|
||||||
widget.patchesCount == 1
|
|
||||||
? '• ${widget.patchesCount} patch'
|
|
||||||
: '• ${widget.patchesCount} patches',
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -33,103 +33,91 @@ class _NotInstalledAppItem extends State<NotInstalledAppItem> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
|
width: 48,
|
||||||
height: 48,
|
height: 48,
|
||||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: const CircleAvatar(
|
child: const CircleAvatar(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.square_rounded,
|
Icons.square_rounded,
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
size: 44,
|
size: 48,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
Wrap(
|
||||||
widget.name,
|
crossAxisAlignment: WrapCrossAlignment.center,
|
||||||
style: const TextStyle(
|
spacing: 4,
|
||||||
fontSize: 16,
|
children: [
|
||||||
fontWeight: FontWeight.w500,
|
Text(
|
||||||
|
widget.name,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
widget.patchesCount == 1
|
||||||
|
? '• ${widget.patchesCount} patch'
|
||||||
|
: '• ${widget.patchesCount} patches',
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
color: Theme.of(context).colorScheme.secondary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 4),
|
||||||
const SizedBox(height: 4),
|
Wrap(
|
||||||
I18nText(
|
crossAxisAlignment: WrapCrossAlignment.center,
|
||||||
'appSelectorCard.notInstalled',
|
children: [
|
||||||
child: Text(
|
Material(
|
||||||
'',
|
color:
|
||||||
style: TextStyle(
|
Theme.of(context).colorScheme.secondaryContainer,
|
||||||
color: Theme.of(context).textTheme.titleLarge!.color,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Wrap(
|
|
||||||
crossAxisAlignment: WrapCrossAlignment.center,
|
|
||||||
children: [
|
|
||||||
Material(
|
|
||||||
color: Theme.of(context).colorScheme.secondaryContainer,
|
|
||||||
borderRadius:
|
|
||||||
const BorderRadius.all(Radius.circular(8)),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: widget.onLinkTap,
|
|
||||||
borderRadius:
|
borderRadius:
|
||||||
const BorderRadius.all(Radius.circular(8)),
|
const BorderRadius.all(Radius.circular(8)),
|
||||||
child: Container(
|
child: InkWell(
|
||||||
padding: const EdgeInsets.all(4),
|
onTap: widget.onLinkTap,
|
||||||
child: Row(
|
borderRadius:
|
||||||
mainAxisSize: MainAxisSize.min,
|
const BorderRadius.all(Radius.circular(8)),
|
||||||
children: [
|
child: Container(
|
||||||
I18nText(
|
padding: const EdgeInsets.fromLTRB(8, 4, 8, 4),
|
||||||
'suggested',
|
child: Row(
|
||||||
translationParams: {
|
mainAxisSize: MainAxisSize.min,
|
||||||
'version': widget.suggestedVersion.isEmpty
|
children: [
|
||||||
? FlutterI18n.translate(
|
I18nText(
|
||||||
context,
|
'suggested',
|
||||||
'appSelectorCard.allVersions',
|
translationParams: {
|
||||||
)
|
'version': widget.suggestedVersion.isEmpty
|
||||||
: 'v${widget.suggestedVersion}',
|
? FlutterI18n.translate(
|
||||||
},
|
context,
|
||||||
child: Text(
|
'appSelectorCard.anyVersion',
|
||||||
'',
|
)
|
||||||
style: TextStyle(
|
: widget.suggestedVersion,
|
||||||
color: Theme.of(context)
|
},
|
||||||
.colorScheme
|
|
||||||
.onSecondaryContainer,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(width: 4),
|
||||||
const SizedBox(width: 4),
|
Icon(
|
||||||
Icon(
|
Icons.search,
|
||||||
Icons.search,
|
size: 16,
|
||||||
size: 16,
|
color: Theme.of(context)
|
||||||
color: Theme.of(context)
|
.colorScheme
|
||||||
.colorScheme
|
.onSecondaryContainer,
|
||||||
.onSecondaryContainer,
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
const SizedBox(width: 4),
|
),
|
||||||
Text(
|
]),
|
||||||
widget.patchesCount == 1
|
|
||||||
? '• ${widget.patchesCount} patch'
|
|
||||||
: '• ${widget.patchesCount} patches',
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -15,13 +15,21 @@ class AppSelectorCard extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final vm = locator<PatcherViewModel>();
|
||||||
|
|
||||||
|
|
||||||
|
String? suggestedVersion;
|
||||||
|
if (vm.selectedApp != null) {
|
||||||
|
suggestedVersion = vm.getSuggestedVersionString(context);
|
||||||
|
}
|
||||||
|
|
||||||
return CustomCard(
|
return CustomCard(
|
||||||
onTap: onPressed,
|
onTap: onPressed,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
I18nText(
|
I18nText(
|
||||||
locator<PatcherViewModel>().selectedApp == null
|
vm.selectedApp == null
|
||||||
? 'appSelectorCard.widgetTitle'
|
? 'appSelectorCard.widgetTitle'
|
||||||
: 'appSelectorCard.widgetTitleSelected',
|
: 'appSelectorCard.widgetTitleSelected',
|
||||||
child: const Text(
|
child: const Text(
|
||||||
@ -33,7 +41,7 @@ class AppSelectorCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
if (locator<PatcherViewModel>().selectedApp == null)
|
if (vm.selectedApp == null)
|
||||||
I18nText('appSelectorCard.widgetSubtitle')
|
I18nText('appSelectorCard.widgetSubtitle')
|
||||||
else
|
else
|
||||||
Row(
|
Row(
|
||||||
@ -42,9 +50,9 @@ class AppSelectorCard extends StatelessWidget {
|
|||||||
height: 18.0,
|
height: 18.0,
|
||||||
child: ClipOval(
|
child: ClipOval(
|
||||||
child: Image.memory(
|
child: Image.memory(
|
||||||
locator<PatcherViewModel>().selectedApp == null
|
vm.selectedApp == null
|
||||||
? Uint8List(0)
|
? Uint8List(0)
|
||||||
: locator<PatcherViewModel>().selectedApp!.icon,
|
: vm.selectedApp!.icon,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -52,13 +60,13 @@ class AppSelectorCard extends StatelessWidget {
|
|||||||
const SizedBox(width: 6),
|
const SizedBox(width: 6),
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(
|
||||||
locator<PatcherViewModel>().getAppSelectionString(),
|
vm.getAppSelectionString(),
|
||||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (locator<PatcherViewModel>().selectedApp == null)
|
if (vm.selectedApp == null)
|
||||||
Container()
|
Container()
|
||||||
else
|
else
|
||||||
Column(
|
Column(
|
||||||
@ -66,49 +74,50 @@ class AppSelectorCard extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text(
|
Text(
|
||||||
locator<PatcherViewModel>().getCurrentVersionString(context),
|
vm.selectedApp!.packageName,
|
||||||
),
|
),
|
||||||
Row(
|
if (suggestedVersion!.isNotEmpty &&
|
||||||
children: [
|
suggestedVersion != vm.selectedApp!.version) ...[
|
||||||
Material(
|
const SizedBox(height: 4),
|
||||||
color: Theme.of(context).colorScheme.secondaryContainer,
|
Row(
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
children: [
|
||||||
child: InkWell(
|
Material(
|
||||||
onTap: () {
|
color: Theme.of(context).colorScheme.secondaryContainer,
|
||||||
locator<PatcherViewModel>()
|
|
||||||
.searchSuggestedVersionOnWeb();
|
|
||||||
},
|
|
||||||
borderRadius:
|
borderRadius:
|
||||||
const BorderRadius.all(Radius.circular(8)),
|
const BorderRadius.all(Radius.circular(8)),
|
||||||
child: Container(
|
child: InkWell(
|
||||||
padding: const EdgeInsets.all(4),
|
onTap: () {
|
||||||
child: Row(
|
vm.queryVersion(suggestedVersion!);
|
||||||
mainAxisSize: MainAxisSize.min,
|
},
|
||||||
children: [
|
borderRadius:
|
||||||
Text(
|
const BorderRadius.all(Radius.circular(8)),
|
||||||
locator<PatcherViewModel>()
|
child: Container(
|
||||||
.getSuggestedVersionString(context),
|
padding: const EdgeInsets.fromLTRB(8, 4, 8, 4),
|
||||||
style: TextStyle(
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
I18nText(
|
||||||
|
'suggested',
|
||||||
|
translationParams: {
|
||||||
|
'version': suggestedVersion,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
Icon(
|
||||||
|
Icons.search,
|
||||||
|
size: 16,
|
||||||
color: Theme.of(context)
|
color: Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
.onSecondaryContainer,
|
.onSecondaryContainer,
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
const SizedBox(width: 4),
|
),
|
||||||
Icon(
|
|
||||||
Icons.search,
|
|
||||||
size: 16,
|
|
||||||
color: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.onSecondaryContainer,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
]
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user