openAppSettings method
Open app settings for permission management
Implementation
Future<bool> openAppSettings() async {
try {
_logger.logInfo('Permissions', 'Opening app settings...');
final result = await Permission.locationWhenInUse
.request()
.then((_) => Permission.locationWhenInUse.isPermanentlyDenied)
.then((isDenied) async {
if (isDenied) {
return await openAppSettings();
}
return true;
});
_logger.logSuccess('Permissions', 'App settings request processed');
return result;
} catch (error) {
_logger.logError(
'Permissions',
'Failed to open app settings: ${error.toString()}',
);
return false;
}
}