From 651e5af14dc8ac6e2227d292132c64a0e8365ee9 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Fri, 13 Nov 2020 15:33:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8D=8E=E4=B8=BA=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=97=A0=E6=B3=95=E4=B8=8B=E5=8D=95=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/home/home_page.dart | 20 +++++++++++++++----- pubspec.lock | 2 +- pubspec.yaml | 3 +-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index ff01804..69c057d 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -243,11 +243,21 @@ class _HomePageState extends BaseStoreState super.dispose(); } + bool _updateTag = false; + @override void didChangeAppLifecycleState(AppLifecycleState state) { + if (state == AppLifecycleState.paused) _updateTag = true; if (state == AppLifecycleState.resumed) { - DPrint.printf("后台返回前台"); - _updateSource(); + //TODO 修复订单无法下单的问题,该问题只在华为设备中发生, + // Set native info: isAppForeground(true) + // Set native info: isAppForeground(false) + // 不停的在前后台切换,原因未知 + if (_updateTag) { + _updateSource(); + _updateTag = false; + } + // _handleOpenInstallEvents(); } } @@ -596,7 +606,7 @@ class _HomePageState extends BaseStoreState padding: EdgeInsets.only(bottom: 5), color: AppColor.frenchColor, child: GoodsItemWidget.rowGoods( - isSingleDayGoods: true, + isSingleDayGoods: false, onBrandClick: () { AppRouter.push(context, RouteName.BRANDGOODS_LIST_PAGE, arguments: BrandGoodsListPage.setArguments( @@ -1355,8 +1365,8 @@ class _HomePageState extends BaseStoreState _mobShareInit() { ShareSDKRegister register = ShareSDKRegister(); - register.setupSinaWeibo("3484799074", "0cc08d31b4d63dc81fbb7a2559999fb3", - "https://reecook.cn"); + register.setupSinaWeibo( + "3484799074", "0cc08d31b4d63dc81fbb7a2559999fb3", "https://reecook.cn"); register.setupQQ("101876843", "6f367bfad98978e22c2e11897dd74f00"); SharesdkPlugin.regist(register); } diff --git a/pubspec.lock b/pubspec.lock index 65c8b2d..680045d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1162,7 +1162,7 @@ packages: source: hosted version: "0.2.7" wakelock: - dependency: "direct main" + dependency: transitive description: name: wakelock url: "https://pub.flutter-io.cn" diff --git a/pubspec.yaml b/pubspec.yaml index b6e0d12..3f7698b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -86,7 +86,7 @@ dependencies: path: # 网络请求 - dio: ^3.0.9 + dio: ^3.0.10 # loading界面 flutter_spinkit: ^3.1.0 @@ -204,7 +204,6 @@ dependencies: flutter_markdown: - wakelock: dropdown_search: ^0.4.5