mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 12:47:37 +02:00
feat: clarify suggested version in app list (#934)
Co-authored-by: Aunali321 <48486084+Aunali321@users.noreply.github.com>
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
|
||||
class InstalledAppItem extends StatefulWidget {
|
||||
const InstalledAppItem({
|
||||
@ -10,6 +11,7 @@ class InstalledAppItem extends StatefulWidget {
|
||||
required this.icon,
|
||||
required this.patchesCount,
|
||||
required this.suggestedVersion,
|
||||
required this.installedVersion,
|
||||
this.onTap,
|
||||
}) : super(key: key);
|
||||
final String name;
|
||||
@ -17,6 +19,7 @@ class InstalledAppItem extends StatefulWidget {
|
||||
final Uint8List icon;
|
||||
final int patchesCount;
|
||||
final String suggestedVersion;
|
||||
final String installedVersion;
|
||||
final Function()? onTap;
|
||||
|
||||
@override
|
||||
@ -48,25 +51,37 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
widget.name,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.visible,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(widget.pkgName),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
widget.suggestedVersion.isEmpty
|
||||
? 'All versions'
|
||||
: widget.suggestedVersion,
|
||||
widget.name,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.visible,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
I18nText(widget.installedVersion.isEmpty
|
||||
? 'All versions'
|
||||
: 'v${widget.installedVersion}'),
|
||||
],
|
||||
),
|
||||
Text(widget.pkgName),
|
||||
Row(
|
||||
children: [
|
||||
I18nText(
|
||||
FlutterI18n.translate(
|
||||
context,
|
||||
'suggested',
|
||||
translationParams: {
|
||||
'version': widget.suggestedVersion.isEmpty
|
||||
? 'All versions'
|
||||
: 'v${widget.suggestedVersion}'
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
widget.patchesCount == 1
|
||||
? '• ${widget.patchesCount} patch'
|
||||
|
@ -59,9 +59,7 @@ class _NotInstalledAppItem extends State<NotInstalledAppItem> {
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
widget.suggestedVersion.isEmpty
|
||||
? 'All versions'
|
||||
: widget.suggestedVersion,
|
||||
'Suggested: ${widget.suggestedVersion.isEmpty ? 'All versions' : 'v${widget.suggestedVersion}'}',
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
|
Reference in New Issue
Block a user