Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: version display #458

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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