修复ios 定位弹窗无法弹出的问题

master
zhangmeng 4 years ago
parent f7a2439206
commit ee801c2ba9

@ -1,3 +1,4 @@
{
"flutterSdkVersion": "stable"
"flutterSdkVersion": "2.0.2",
"flavors": {}
}

@ -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"
}
}
}

@ -176,7 +176,7 @@ class _ClassifyPageState extends BaseStoreState<ClassifyPage>
if (currentIndex < widget.data.length - 1 &&
notification.metrics.pixels.toInt() >
notification.metrics.maxScrollExtent + 120) {
( notification.metrics.maxScrollExtent + 120).toInt()) {
if (!animating) {
animating = true;
currentIndex++;

@ -1421,9 +1421,17 @@ class _HomePageState extends BaseStoreState<HomePage>
}
Future<bool> 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;

Loading…
Cancel
Save