fix: improve patches selector.

This commit is contained in:
Alberto Ponces
2022-08-09 02:30:12 +01:00
parent 6338eb5dd1
commit 84923127e2
9 changed files with 95 additions and 26 deletions

View File

@ -4,6 +4,7 @@ import 'package:google_fonts/google_fonts.dart';
// ignore: must_be_immutable
class PatchItem extends StatefulWidget {
final String name;
final String simpleName;
final String description;
final String version;
bool isSelected;
@ -11,6 +12,7 @@ class PatchItem extends StatefulWidget {
PatchItem({
Key? key,
required this.name,
required this.simpleName,
required this.description,
required this.version,
required this.isSelected,
@ -43,7 +45,7 @@ class _PatchItemState extends State<PatchItem> {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
widget.name,
widget.simpleName,
style: GoogleFonts.inter(
fontSize: 16,
fontWeight: FontWeight.w600,

View File

@ -1,7 +1,10 @@
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/constants.dart';
import 'package:revanced_manager/ui/views/app_selector/app_selector_viewmodel.dart';
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart';
class PatchSelectorCard extends StatelessWidget {
final Function()? onPressed;
@ -35,13 +38,35 @@ class PatchSelectorCard extends StatelessWidget {
),
),
const SizedBox(height: 10),
I18nText(
'patchSelectorCard.widgetSubtitle',
child: Text(
'',
style: robotoTextStyle,
),
),
locator<AppSelectorViewModel>().selectedApp == null
? I18nText(
'patchSelectorCard.widgetFirstSubtitle',
child: Text(
'',
style: robotoTextStyle,
),
)
: locator<PatchesSelectorViewModel>().selectedPatches.isEmpty
? I18nText(
'patchSelectorCard.widgetSecondSubtitle',
child: Text(
'',
style: robotoTextStyle,
),
)
: I18nText(
'patchSelectorCard.widgetThirdSubtitle',
translationParams: {
'selected': locator<PatchesSelectorViewModel>()
.selectedPatches
.length
.toString()
},
child: Text(
'',
style: robotoTextStyle,
),
),
],
),
),