The below code from https://pub.dev/packages/permission_handler/example throws an error: Exception has occurred. NoSuchMethodError (NoSuchMethodError: The getter 'value' was called on null. Receiver: null Tried calling: value)
@override
void initState() {
super.initState();
_listenForPermissionStatus();
}
void _listenForPermissionStatus() async {
final status = await _permission.status;
setState(() => _permissionStatus = status);
}