Commit 32ebdf16 by Maurits van Beusekom Committed by GitHub

Merge pull request #459 from Baseflow/nullsafe_platform_interface

Nullsafe platform interface
parents 5fee1e03 665ecb20
## 3.0.0
* Migrated to null safety.
## 2.0.2 ## 2.0.2
* Added support for the limited photos permission available on iOS 14 and up. * Added support for the limited photos permission available on iOS 14 and up.
......
...@@ -52,7 +52,8 @@ class MethodChannelPermissionHandler extends PermissionHandlerPlatform { ...@@ -52,7 +52,8 @@ class MethodChannelPermissionHandler extends PermissionHandlerPlatform {
/// [false]. /// [false].
Future<bool> openAppSettings() async { Future<bool> openAppSettings() async {
final wasOpened = await _methodChannel.invokeMethod('openAppSettings'); final wasOpened = await _methodChannel.invokeMethod('openAppSettings');
return wasOpened;
return wasOpened ?? false;
} }
/// Requests the user for access to the supplied list of [Permission]s, if /// Requests the user for access to the supplied list of [Permission]s, if
...@@ -77,6 +78,6 @@ class MethodChannelPermissionHandler extends PermissionHandlerPlatform { ...@@ -77,6 +78,6 @@ class MethodChannelPermissionHandler extends PermissionHandlerPlatform {
final shouldShowRationale = await _methodChannel.invokeMethod( final shouldShowRationale = await _methodChannel.invokeMethod(
'shouldShowRequestPermissionRationale', permission.value); 'shouldShowRequestPermissionRationale', permission.value);
return shouldShowRationale; return shouldShowRationale ?? false;
} }
} }
...@@ -3,20 +3,20 @@ description: A common platform interface for the permission_handler plugin. ...@@ -3,20 +3,20 @@ description: A common platform interface for the permission_handler plugin.
homepage: https://github.com/baseflow/flutter-permission-handler/tree/master/permission_handler_platform_interface homepage: https://github.com/baseflow/flutter-permission-handler/tree/master/permission_handler_platform_interface
# NOTE: We strongly prefer non-breaking changes, even at the expense of a # NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 2.0.2 version: 3.0.0
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
meta: ^1.0.5 meta: ^1.0.5
plugin_platform_interface: ^1.0.2 plugin_platform_interface: ^2.0.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
mockito: ^4.1.1 mockito: ^5.0.0
effective_dart: ^1.2.1 effective_dart: ^1.3.0
environment: environment:
sdk: ">=2.6.0 <3.0.0" sdk: ">=2.12.0-259.9.beta <3.0.0"
flutter: ">=1.9.1+hotfix.4 <2.0.0" flutter: ">=1.9.1+hotfix.4 <2.0.0"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment