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"),
"updateAll": MessageLookupByLibrary.simpleMessage("Update all"),
"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(
"Server status update interval"),
"upsideDown": MessageLookupByLibrary.simpleMessage("Upside Down"),

View File

@@ -186,8 +186,8 @@ class MessageLookup extends MessageLookupByLibrary {
"unkownConvertMode": MessageLookupByLibrary.simpleMessage("未知转换模式"),
"update": MessageLookupByLibrary.simpleMessage("更新"),
"updateAll": MessageLookupByLibrary.simpleMessage("更新全部"),
"updateIntervalEqual0": MessageLookupByLibrary.simpleMessage(
"你设置为0服务器状态不会自动刷新。\n你可以手动下拉刷新。"),
"updateIntervalEqual0":
MessageLookupByLibrary.simpleMessage("你设置为0服务器状态不会自动刷新。"),
"updateServerStatusInterval":
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 {
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',
desc: '',
args: [],

View File

@@ -41,7 +41,7 @@
"versionUnknownUpdate": "Current: v1.0.{build}",
"versionHaveUpdate": "Found: v1.0.{build}, click to update",
"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",
"noSavedPrivateKey": "No saved private keys.",
"name": "Name",

View File

@@ -41,7 +41,7 @@
"versionUnknownUpdate": "当前v1.0.{build}",
"versionHaveUpdate": "找到新版本v1.0.{build}, 点击更新",
"second": "秒",
"updateIntervalEqual0": "你设置为0服务器状态不会自动刷新。\n你可以手动下拉刷新。",
"updateIntervalEqual0": "你设置为0服务器状态不会自动刷新。",
"edit": "编辑",
"noSavedPrivateKey": "没有已保存的私钥。",
"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/provider/server.dart';
import 'package:toolbox/data/res/color.dart';
import 'package:toolbox/data/store/setting.dart';
import 'package:toolbox/generated/l10n.dart';
import 'package:toolbox/locator.dart';
import 'package:toolbox/view/page/apt.dart';
@@ -37,14 +36,11 @@ class _ServerPageState extends State<ServerPage>
late ServerProvider _serverProvider;
late S s;
late bool autoUpdate;
@override
void initState() {
super.initState();
_serverProvider = locator<ServerProvider>();
autoUpdate =
locator<SettingStore>().serverStatusUpdateInterval.fetch() != 0;
}
@override
@@ -84,12 +80,7 @@ class _ServerPageState extends State<ServerPage>
);
});
return Scaffold(
body: autoUpdate
? child
: RefreshIndicator(
child: child,
onRefresh: () async => _serverProvider.refreshData(),
),
body: child,
floatingActionButton: FloatingActionButton(
onPressed: () =>
AppRoute(const ServerEditPage(), 'Add server info page')