isGpsOn static method

Future<Map<String, bool>> isGpsOn()

Implementation

static Future<Map<String, bool>> isGpsOn() async {
  String gps = 'Location/Gps';
  if(kIsWeb){
    return {gps: true};
  }else{
  try {
    bool serviceEnabled = await Geolocator.isLocationServiceEnabled();
    return {gps: serviceEnabled};
  } catch (e) {}
  return {gps: false};
  }
}