Skip to content

UnlockAgency/flutter_location_permissions

Repository files navigation

Permissions

Location

import 'package:permissions/permissions.dart';

// ...
  
Future<void> getAuthorizationStatus() async {
    Permissions _permissions = Permissions();
	
    final status = await _permissions.location.getPermissionStatus();
	
    print("Current status? ${status}");
	
    if (status == LocationPermissionStatus.pending) {
        final newStatus = await permissions.location.requestAlwaysPermission();
        print("New status? ${newStatus}");
    }
}

getAuthorizationStatus();