Skip to content

Commit

Permalink
fix: version display (#458)
Browse files Browse the repository at this point in the history
Fixes #457
  • Loading branch information
lollipopkit authored Jul 10, 2024
1 parent 14771ae commit f7d6c46
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
4 changes: 4 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"name": "debug",
"request": "launch",
"type": "dart",
"env": {
// Comment this line to use the default display
"DISPLAY": ":1"
}
// "args": [
// "-v"
// ]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Especially thanks to <a href="https://github.com/TerminalStudio/dartssh2">dartss
Platform | From
--- | ---
iOS / macOS | [AppStore](https://apps.apple.com/app/id1586449703)
Android | [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox) / [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lolli.tech/serverbox/?sort=time&order=desc&layout=grid) / [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/)
Android | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lolli.tech/serverbox/?sort=time&order=desc&layout=grid) / [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox) / [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/)
Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lolli.tech/serverbox/?sort=time&order=desc&layout=grid)

**Please only download pkgs from the source that you trust!**
Expand Down
2 changes: 1 addition & 1 deletion README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
平台 | 下载
--- | ---
iOS / macOS | [AppStore](https://apps.apple.com/app/id1586449703)
Android | [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox) / [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lolli.tech/serverbox/?sort=time&order=desc&layout=grid) / [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/)
Android | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lolli.tech/serverbox/?sort=time&order=desc&layout=grid) / [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox) / [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/)
Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lolli.tech/serverbox/?sort=time&order=desc&layout=grid)

**请不要从不受信任的来源下载!**
Expand Down
7 changes: 0 additions & 7 deletions lib/data/provider/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ import 'package:fl_lib/fl_lib.dart';
import 'package:flutter/material.dart';

class AppProvider extends ChangeNotifier {
int? _newestBuild;
int? get newestBuild => _newestBuild;
set newestBuild(int? build) {
_newestBuild = build;
notifyListeners();
}

BuildContext? ctx;

bool isWearOS = false;
Expand Down
13 changes: 6 additions & 7 deletions lib/view/page/setting/entry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_highlight/theme_map.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:icons_plus/icons_plus.dart';
import 'package:provider/provider.dart';
import 'package:server_box/core/extension/context/locale.dart';
import 'package:server_box/data/res/rebuild.dart';
import 'package:server_box/data/res/store.dart';
Expand All @@ -14,7 +13,6 @@ import 'package:server_box/view/page/setting/platform/platform_pub.dart';

import '../../../core/route.dart';
import '../../../data/model/app/net_view.dart';
import '../../../data/provider/app.dart';
import '../../../data/res/build_data.dart';

const _kIconSize = 23.0;
Expand Down Expand Up @@ -184,12 +182,13 @@ class _SettingPageState extends State<SettingPage> {
return ListTile(
leading: const Icon(Icons.update),
title: Text(l10n.autoCheckUpdate),
subtitle: Consumer<AppProvider>(
builder: (ctx, app, __) {
subtitle: ValBuilder(
listenable: AppUpdateIface.newestBuild,
builder: (val) {
String display;
if (app.newestBuild != null) {
if (app.newestBuild! > BuildData.build) {
display = l10n.versionHaveUpdate(app.newestBuild!);
if (val != null) {
if (val > BuildData.build) {
display = l10n.versionHaveUpdate(val);
} else {
display = l10n.versionUpdated(BuildData.build);
}
Expand Down

0 comments on commit f7d6c46

Please sign in to comment.