Flutter 定位服务是否开启判断

您所在的位置:网站首页 js判断手机是否开启定位 Flutter 定位服务是否开启判断

Flutter 定位服务是否开启判断

2024-07-16 11:29| 来源: 网络整理| 查看: 265

找了一圈pub没找着, 只看到个location,但get之后需要google 服务,没安装一直弹窗…… 那就自己写一下吧 git地址: https://github.com/EchoPuda/location_service_check.git nullsafety版本:https://github.com/EchoPuda/location_service_check_nullsafety pub:https://pub.dev/packages/location_service_check

使用方法 pubspec.yaml: location_service_check: git: url: https://github.com/EchoPuda/location_service_check.git import import 'package:location_service_check/location_service_check.dart'; 检查是否开启了定位服务 bool open = await LocationServiceCheck.checkLocationIsOpen; 打开定位设置页 await LocationServiceCheck.openLocationSetting;

Android直接打开系统的定位服务, iOS由于ios10开始不支持打开系统详细设置,所以打开应用的设置页。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3