refactor: version presentation
This commit is contained in:
@@ -25,7 +25,7 @@ class AboutPage extends HookConsumerWidget {
|
||||
switch (next) {
|
||||
case AsyncData(value: final remoteVersion?):
|
||||
await NewVersionDialog(
|
||||
appInfo.version,
|
||||
appInfo.presentVersion,
|
||||
remoteVersion,
|
||||
canIgnore: false,
|
||||
).show(context);
|
||||
@@ -59,7 +59,7 @@ class AboutPage extends HookConsumerWidget {
|
||||
),
|
||||
const Gap(4),
|
||||
Text(
|
||||
"${t.about.version} ${appInfo.version}",
|
||||
"${t.about.version} ${appInfo.presentVersion}",
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -29,8 +29,7 @@ class AppUpdateNotifier extends _$AppUpdateNotifier with AppLogger {
|
||||
throw l;
|
||||
},
|
||||
(remote) {
|
||||
if (remote.version.replaceAll(".dev", "").compareTo(currentVersion) >
|
||||
0) {
|
||||
if (remote.version.compareTo(currentVersion) > 0) {
|
||||
loggy.info("new version available: $remote");
|
||||
return remote;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class NewVersionDialog extends HookConsumerWidget {
|
||||
style: theme.textTheme.bodySmall,
|
||||
),
|
||||
TextSpan(
|
||||
text: newVersion.fullVersion,
|
||||
text: newVersion.presentVersion,
|
||||
style: theme.textTheme.labelMedium,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:hiddify/core/core_providers.dart';
|
||||
import 'package:hiddify/core/router/router.dart';
|
||||
import 'package:hiddify/domain/environment.dart';
|
||||
import 'package:hiddify/domain/failures.dart';
|
||||
import 'package:hiddify/features/common/active_profile/active_profile_notifier.dart';
|
||||
import 'package:hiddify/features/common/active_profile/has_any_profile_notifier.dart';
|
||||
@@ -88,11 +87,7 @@ class AppVersionLabel extends HookConsumerWidget {
|
||||
final t = ref.watch(translationsProvider);
|
||||
final theme = Theme.of(context);
|
||||
|
||||
final appInfo = ref.watch(appInfoProvider);
|
||||
final version = appInfo.version +
|
||||
(appInfo.environment == Environment.prod
|
||||
? ""
|
||||
: " ${appInfo.environment.name}");
|
||||
final version = ref.watch(appInfoProvider).presentVersion;
|
||||
if (version.isBlank) return const SizedBox();
|
||||
|
||||
return Semantics(
|
||||
|
||||
Reference in New Issue
Block a user