From dfcb360b9d9f2e5b4a433e4deb4f2e55453d7ec1 Mon Sep 17 00:00:00 2001 From: perol Date: Sun, 22 Sep 2024 18:32:46 +0800 Subject: [PATCH] data loaded logic --- android/app/build.gradle | 4 ++-- lib/constants.dart | 2 +- lib/page/board/board_page.dart | 16 +++++++++++++--- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 9124d09f..98a423c6 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -81,8 +81,8 @@ android { applicationId packageName minSdkVersion 21 targetSdkVersion 34 - versionCode 10009476 - versionName "0.9.48 X" + versionCode 10009480 + versionName "0.9.48 color" ndk { abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64' } } compileOptions { diff --git a/lib/constants.dart b/lib/constants.dart index 007d74d4..b3322e64 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -17,7 +17,7 @@ import 'dart:io'; class Constants { - static String tagName = "0.9.47"; + static String tagName = "0.9.48"; static const isGooglePlay = bool.fromEnvironment("IS_GOOGLEPLAY", defaultValue: false); static int type = 0; diff --git a/lib/page/board/board_page.dart b/lib/page/board/board_page.dart index ed90e9e3..dea3a089 100644 --- a/lib/page/board/board_page.dart +++ b/lib/page/board/board_page.dart @@ -26,10 +26,20 @@ class _BoardPageState extends State { if (_boardList.isNotEmpty) { return; } + if (BoardInfo.boardDataLoaded) { + setState(() { + _boardList = BoardInfo.boardList; + }); + return; + } final list = await BoardInfo.load(); - setState(() { - _boardList = list; - }); + BoardInfo.boardList = list; + BoardInfo.boardDataLoaded = true; + if (mounted) { + setState(() { + _boardList = list; + }); + } } catch (e) {} }