Improve efficiency of data fetching

This commit is contained in:
Junyuan Feng
2022-02-02 13:23:54 +08:00
parent 5d9b19407f
commit 026d203608
8 changed files with 121 additions and 113 deletions

View File

@@ -65,6 +65,7 @@ class _MyHomePageState extends State<MyHomePage>
void didChangeAppLifecycleState(AppLifecycleState state) {
super.didChangeAppLifecycleState(state);
if (state == AppLifecycleState.paused) {
_serverProvider.setDisconnected();
_serverProvider.stopAutoRefresh();
}
if (state == AppLifecycleState.resumed) {
@@ -90,9 +91,11 @@ class _MyHomePageState extends State<MyHomePage>
),
),
drawer: _buildDrawer(),
body: TabBarView(
controller: _tabController,
children: const [ServerPage(), ConvertPage(), PingPage()]),
body: TabBarView(controller: _tabController, children: [
ServerPage(_tabController),
const ConvertPage(),
const PingPage()
]),
);
}