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