new: pull to refresh on server tab

This commit is contained in:
lollipopkit
2023-02-17 15:55:34 +08:00
parent 1aac166c43
commit 99aa0fc1f5
12 changed files with 46 additions and 25 deletions

View File

@@ -267,7 +267,7 @@ class _MyHomePageState extends State<MyHomePage>
),
)
],
child: Text(_s.license),
child: Text(_s.about),
)
],
),

View File

@@ -220,7 +220,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
children: [
Text('${used.toStringAsFixed(0)}%', style: textSize27),
width7,
Text('of ${(ss.mem.total * 1024).convertBytes} Mem',
Text('of ${(ss.mem.total * 1024).convertBytes}',
style: textSize13Grey)
],
),
@@ -233,9 +233,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
),
],
),
const SizedBox(
height: 11,
),
height13,
_buildProgress(used)
],
),
@@ -262,7 +260,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
children: [
Text('${used.toStringAsFixed(0)}%', style: textSize27),
width7,
Text('of ${(ss.swap.total * 1024).convertBytes} Swap',
Text('of ${(ss.swap.total * 1024).convertBytes} ',
style: textSize13Grey)
],
),
@@ -275,9 +273,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
),
],
),
const SizedBox(
height: 11,
),
height13,
_buildProgress(used)
],
),

View File

@@ -76,6 +76,7 @@ class _ServerPageState extends State<ServerPage>
return ListView.separated(
padding: const EdgeInsets.all(7),
controller: ScrollController(),
physics: const AlwaysScrollableScrollPhysics(),
itemBuilder: (ctx, idx) {
if (idx == pro.servers.length) {
return SizedBox(height: _media.padding.bottom);
@@ -90,7 +91,7 @@ class _ServerPageState extends State<ServerPage>
},
);
return Scaffold(
body: child,
body: RefreshIndicator(child: child, onRefresh: () async => await _serverProvider.refreshData(onlyFailed: true)),
floatingActionButton: FloatingActionButton(
onPressed: () => AppRoute(
const ServerEditPage(),