Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 是否仍要继续检查geoLocator.isLocationServiceEnabled()?_Android_Flutter_Dart - Fatal编程技术网

Android 是否仍要继续检查geoLocator.isLocationServiceEnabled()?

Android 是否仍要继续检查geoLocator.isLocationServiceEnabled()?,android,flutter,dart,Android,Flutter,Dart,正如标题所述,是否有任何方法可以持续检查geoLocator.isLocationServiceEnabled() 我想随时检查GPS状态,并在用户打开/关闭GPS时显示图像 需要连续运行wait geologitor.isLocationServiceEnabled() 我最后就是这样做的 FutureBuilder<bool>( future: geoLocator.isLocationServiceEnab

正如标题所述,是否有任何方法可以持续检查geoLocator.isLocationServiceEnabled()

我想随时检查GPS状态,并在用户打开/关闭GPS时显示图像

需要连续运行wait geologitor.isLocationServiceEnabled()


我最后就是这样做的

                  FutureBuilder<bool>(
                  future: geoLocator.isLocationServiceEnabled(),
                  initialData: false,
                  builder:
                      (BuildContext context, AsyncSnapshot<bool> snapshot) {
                    if (!snapshot.data) {
                      return FadeTransition(
                          opacity: _animationController,
                          child: IconButton(
                            icon: Icon(Icons.gps_fixed),
                            onPressed: () => null,
                            color: Colors.red,
                          ));
FutureBuilder(
future:geoLocator.isLocationServiceEnabled(),
initialData:false,
建设者:
(BuildContext上下文,异步快照){
如果(!snapshot.data){
返回衰减转换(
不透明度:_animationController,
孩子:我的钮扣(
图标:图标(图标。gps_固定),
onPressed:()=>null,
颜色:颜色,红色,
));

我最后就是这样做的

                  FutureBuilder<bool>(
                  future: geoLocator.isLocationServiceEnabled(),
                  initialData: false,
                  builder:
                      (BuildContext context, AsyncSnapshot<bool> snapshot) {
                    if (!snapshot.data) {
                      return FadeTransition(
                          opacity: _animationController,
                          child: IconButton(
                            icon: Icon(Icons.gps_fixed),
                            onPressed: () => null,
                            color: Colors.red,
                          ));
FutureBuilder(
future:geoLocator.isLocationServiceEnabled(),
initialData:false,
建设者:
(BuildContext上下文,异步快照){
如果(!snapshot.data){
返回衰减转换(
不透明度:_animationController,
孩子:我的钮扣(
图标:图标(图标。gps_固定),
onPressed:()=>null,
颜色:颜色,红色,
));