Support linux version of MIH
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||
@@ -13,6 +15,12 @@ class MIHLocationAPI {
|
||||
///if user has blocked permission (denied or denied forver), user will get error pop up.
|
||||
///if user has granted permission (while in use), function will return Position object.
|
||||
Future<Position?> getGPSPosition(BuildContext context) async {
|
||||
bool serviceEnabled = await Geolocator.isLocationServiceEnabled();
|
||||
if (!serviceEnabled && Platform.isLinux) {
|
||||
// Direct the user to their System Settings
|
||||
MihAlertServices().locationPermissionAlert(context);
|
||||
return null;
|
||||
}
|
||||
print("Before checkPermission"); // Debug
|
||||
LocationPermission permission = await Geolocator.checkPermission();
|
||||
print("After checkPermission: $permission"); // Debug
|
||||
|
||||
Reference in New Issue
Block a user