From ee801c2ba915aaf85ebc5d80ebcd87144d93d009 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Fri, 2 Jul 2021 14:16:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dios=20=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=97=A0=E6=B3=95=E5=BC=B9=E5=87=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .fvm/fvm_config.json | 3 ++- android/build.gradle | 7 +++++++ lib/pages/home/classify/classify_page.dart | 2 +- lib/pages/home/home_page.dart | 12 ++++++++++-- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json index 1c922f8..de7d397 100644 --- a/.fvm/fvm_config.json +++ b/.fvm/fvm_config.json @@ -1,3 +1,4 @@ { - "flutterSdkVersion": "stable" + "flutterSdkVersion": "2.0.2", + "flavors": {} } \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 8fc01c0..ccb95d3 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -4,6 +4,9 @@ buildscript { repositories { google() jcenter() + maven { + url "https://mvn.mob.com/android" + } } dependencies { @@ -18,6 +21,10 @@ allprojects { repositories { google() jcenter() + maven { + url "https://mvn.mob.com/android" + } + } } diff --git a/lib/pages/home/classify/classify_page.dart b/lib/pages/home/classify/classify_page.dart index c63ebbc..b12614f 100644 --- a/lib/pages/home/classify/classify_page.dart +++ b/lib/pages/home/classify/classify_page.dart @@ -176,7 +176,7 @@ class _ClassifyPageState extends BaseStoreState if (currentIndex < widget.data.length - 1 && notification.metrics.pixels.toInt() > - notification.metrics.maxScrollExtent + 120) { + ( notification.metrics.maxScrollExtent + 120).toInt()) { if (!animating) { animating = true; currentIndex++; diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 2eccac3..b86e5fc 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -1421,9 +1421,17 @@ class _HomePageState extends BaseStoreState } Future requestPermission() async { - bool permission = await Permission.locationWhenInUse.isGranted; + if (Platform.isIOS) { + return true; + } + bool permission = await Permission.locationWhenInUse.isRestricted; + bool permanentDenied = + await Permission.locationWhenInUse.isPermanentlyDenied; if (!permission) { - await Permission.locationWhenInUse.request(); + await Permission.locationWhenInUse.request(); + if (permanentDenied) { + await PermissionTool.showOpenPermissionDialog(context, '打开定位权限'); + } permission = await Permission.locationWhenInUse.isGranted; } return permission;