mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
refactor: improve code
This commit is contained in:
parent
20ffef39a3
commit
1ad906fedc
@ -22,7 +22,6 @@ import 'package:revanced_manager/ui/views/navigation/navigation_viewmodel.dart';
|
|||||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/homeView/update_confirmation_dialog.dart';
|
import 'package:revanced_manager/ui/widgets/homeView/update_confirmation_dialog.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart';
|
import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart';
|
||||||
import 'package:revanced_manager/utils/about_info.dart';
|
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
import 'package:stacked_services/stacked_services.dart';
|
import 'package:stacked_services/stacked_services.dart';
|
||||||
|
|
||||||
@ -114,7 +113,7 @@ class HomeViewModel extends BaseViewModel {
|
|||||||
Future<bool> hasManagerUpdates() async {
|
Future<bool> hasManagerUpdates() async {
|
||||||
String currentVersion = await _managerAPI.getCurrentManagerVersion();
|
String currentVersion = await _managerAPI.getCurrentManagerVersion();
|
||||||
_latestManagerVersion = await _managerAPI.getLatestManagerVersion();
|
_latestManagerVersion = await _managerAPI.getLatestManagerVersion();
|
||||||
|
|
||||||
// add v to current version
|
// add v to current version
|
||||||
if (!currentVersion.startsWith('v')) {
|
if (!currentVersion.startsWith('v')) {
|
||||||
currentVersion = 'v$currentVersion';
|
currentVersion = 'v$currentVersion';
|
||||||
|
@ -157,7 +157,8 @@ class InstallerView extends StatelessWidget {
|
|||||||
SliverFillRemaining(
|
SliverFillRemaining(
|
||||||
hasScrollBody: false,
|
hasScrollBody: false,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: MediaQuery.of(context).viewPadding.bottom),
|
height: MediaQuery.of(context).viewPadding.bottom,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
|
||||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||||
|
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
||||||
|
|
||||||
class InstalledAppItem extends StatefulWidget {
|
class InstalledAppItem extends StatefulWidget {
|
||||||
const InstalledAppItem({
|
const InstalledAppItem({
|
||||||
@ -63,9 +64,11 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 4),
|
const SizedBox(width: 4),
|
||||||
I18nText(widget.installedVersion.isEmpty
|
I18nText(
|
||||||
? 'All versions'
|
widget.installedVersion.isEmpty
|
||||||
: 'v${widget.installedVersion}'),
|
? 'All versions'
|
||||||
|
: 'v${widget.installedVersion}',
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Text(widget.pkgName),
|
Text(widget.pkgName),
|
||||||
@ -81,6 +84,7 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
|
|||||||
: 'v${widget.suggestedVersion}'
|
: 'v${widget.suggestedVersion}'
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
),
|
||||||
const SizedBox(width: 4),
|
const SizedBox(width: 4),
|
||||||
Text(
|
Text(
|
||||||
widget.patchesCount == 1
|
widget.patchesCount == 1
|
||||||
|
Loading…
Reference in New Issue
Block a user