rm server tab pull to refresh

This commit is contained in:
Junyuan Feng
2022-12-04 15:53:42 +08:00
parent 3998f549e4
commit ca17af30cf
6 changed files with 8 additions and 17 deletions

View File

@@ -215,7 +215,7 @@ class MessageLookup extends MessageLookupByLibrary {
"update": MessageLookupByLibrary.simpleMessage("Update"), "update": MessageLookupByLibrary.simpleMessage("Update"),
"updateAll": MessageLookupByLibrary.simpleMessage("Update all"), "updateAll": MessageLookupByLibrary.simpleMessage("Update all"),
"updateIntervalEqual0": MessageLookupByLibrary.simpleMessage( "updateIntervalEqual0": MessageLookupByLibrary.simpleMessage(
"You set to 0, will not update automatically.\nYou can pull to refresh manually."), "You set to 0, will not update automatically."),
"updateServerStatusInterval": MessageLookupByLibrary.simpleMessage( "updateServerStatusInterval": MessageLookupByLibrary.simpleMessage(
"Server status update interval"), "Server status update interval"),
"upsideDown": MessageLookupByLibrary.simpleMessage("Upside Down"), "upsideDown": MessageLookupByLibrary.simpleMessage("Upside Down"),

View File

@@ -186,8 +186,8 @@ class MessageLookup extends MessageLookupByLibrary {
"unkownConvertMode": MessageLookupByLibrary.simpleMessage("未知转换模式"), "unkownConvertMode": MessageLookupByLibrary.simpleMessage("未知转换模式"),
"update": MessageLookupByLibrary.simpleMessage("更新"), "update": MessageLookupByLibrary.simpleMessage("更新"),
"updateAll": MessageLookupByLibrary.simpleMessage("更新全部"), "updateAll": MessageLookupByLibrary.simpleMessage("更新全部"),
"updateIntervalEqual0": MessageLookupByLibrary.simpleMessage( "updateIntervalEqual0":
"你设置为0服务器状态不会自动刷新。\n你可以手动下拉刷新。"), MessageLookupByLibrary.simpleMessage("你设置为0服务器状态不会自动刷新。"),
"updateServerStatusInterval": "updateServerStatusInterval":
MessageLookupByLibrary.simpleMessage("服务器状态刷新间隔"), MessageLookupByLibrary.simpleMessage("服务器状态刷新间隔"),
"upsideDown": MessageLookupByLibrary.simpleMessage("上下交换"), "upsideDown": MessageLookupByLibrary.simpleMessage("上下交换"),

View File

@@ -470,10 +470,10 @@ class S {
); );
} }
/// `You set to 0, will not update automatically.\nYou can pull to refresh manually.` /// `You set to 0, will not update automatically.`
String get updateIntervalEqual0 { String get updateIntervalEqual0 {
return Intl.message( return Intl.message(
'You set to 0, will not update automatically.\nYou can pull to refresh manually.', 'You set to 0, will not update automatically.',
name: 'updateIntervalEqual0', name: 'updateIntervalEqual0',
desc: '', desc: '',
args: [], args: [],

View File

@@ -41,7 +41,7 @@
"versionUnknownUpdate": "Current: v1.0.{build}", "versionUnknownUpdate": "Current: v1.0.{build}",
"versionHaveUpdate": "Found: v1.0.{build}, click to update", "versionHaveUpdate": "Found: v1.0.{build}, click to update",
"second": "s", "second": "s",
"updateIntervalEqual0": "You set to 0, will not update automatically.\nYou can pull to refresh manually.", "updateIntervalEqual0": "You set to 0, will not update automatically.",
"edit": "Edit", "edit": "Edit",
"noSavedPrivateKey": "No saved private keys.", "noSavedPrivateKey": "No saved private keys.",
"name": "Name", "name": "Name",

View File

@@ -41,7 +41,7 @@
"versionUnknownUpdate": "当前v1.0.{build}", "versionUnknownUpdate": "当前v1.0.{build}",
"versionHaveUpdate": "找到新版本v1.0.{build}, 点击更新", "versionHaveUpdate": "找到新版本v1.0.{build}, 点击更新",
"second": "秒", "second": "秒",
"updateIntervalEqual0": "你设置为0服务器状态不会自动刷新。\n你可以手动下拉刷新。", "updateIntervalEqual0": "你设置为0服务器状态不会自动刷新。",
"edit": "编辑", "edit": "编辑",
"noSavedPrivateKey": "没有已保存的私钥。", "noSavedPrivateKey": "没有已保存的私钥。",
"name": "名称", "name": "名称",

View File

@@ -11,7 +11,6 @@ import 'package:toolbox/data/model/server/server_private_info.dart';
import 'package:toolbox/data/model/server/server_status.dart'; import 'package:toolbox/data/model/server/server_status.dart';
import 'package:toolbox/data/provider/server.dart'; import 'package:toolbox/data/provider/server.dart';
import 'package:toolbox/data/res/color.dart'; import 'package:toolbox/data/res/color.dart';
import 'package:toolbox/data/store/setting.dart';
import 'package:toolbox/generated/l10n.dart'; import 'package:toolbox/generated/l10n.dart';
import 'package:toolbox/locator.dart'; import 'package:toolbox/locator.dart';
import 'package:toolbox/view/page/apt.dart'; import 'package:toolbox/view/page/apt.dart';
@@ -37,14 +36,11 @@ class _ServerPageState extends State<ServerPage>
late ServerProvider _serverProvider; late ServerProvider _serverProvider;
late S s; late S s;
late bool autoUpdate;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_serverProvider = locator<ServerProvider>(); _serverProvider = locator<ServerProvider>();
autoUpdate =
locator<SettingStore>().serverStatusUpdateInterval.fetch() != 0;
} }
@override @override
@@ -84,12 +80,7 @@ class _ServerPageState extends State<ServerPage>
); );
}); });
return Scaffold( return Scaffold(
body: autoUpdate body: child,
? child
: RefreshIndicator(
child: child,
onRefresh: () async => _serverProvider.refreshData(),
),
floatingActionButton: FloatingActionButton( floatingActionButton: FloatingActionButton(
onPressed: () => onPressed: () =>
AppRoute(const ServerEditPage(), 'Add server info page') AppRoute(const ServerEditPage(), 'Add server info page')