Commit d34b28c3 by Maurits van Beusekom

Merge branch 'develop'

parents 475cf5c5 fb752f41
...@@ -49,11 +49,6 @@ jobs: ...@@ -49,11 +49,6 @@ jobs:
run: flutter analyze run: flutter analyze
working-directory: ${{env.source-directory}} working-directory: ${{env.source-directory}}
# Run all unit-tests with code coverage
- name: Run unit tests
run: flutter test --coverage
working-directory: ${{env.source-directory}}
# Build Android version of the example app # Build Android version of the example app
- name: Run Android build - name: Run Android build
run: flutter build apk --release run: flutter build apk --release
...@@ -63,10 +58,3 @@ jobs: ...@@ -63,10 +58,3 @@ jobs:
- name: Run iOS build - name: Run iOS build
run: flutter build ios --release --no-codesign run: flutter build ios --release --no-codesign
working-directory: ${{env.example-directory}} working-directory: ${{env.example-directory}}
# Upload code coverage information
- uses: codecov/codecov-action@v1
with:
file: ${{env.source-directory}}/coverage/lcov.info # optional
name: permission_handler (App Facing Package) # optional
fail_ci_if_error: true
...@@ -48,15 +48,3 @@ jobs: ...@@ -48,15 +48,3 @@ jobs:
run: flutter analyze run: flutter analyze
working-directory: ${{env.source-directory}} working-directory: ${{env.source-directory}}
# Run all unit-tests with code coverage
- name: Run unit tests
run: flutter test --coverage
working-directory: ${{env.source-directory}}
# Upload code coverage information
- uses: codecov/codecov-action@v1
with:
file: ${{env.source-directory}}/coverage/lcov.info # optional
name: permission_handler_platform_interface (Platform Interface Package) # optional
fail_ci_if_error: true
\ No newline at end of file
## 6.0.0
* Migrated to null safety
## 5.1.0+2 ## 5.1.0+2
* Solve mismatch with permission constants between Dart and Android (due to addition of permission on iOS); * Solve mismatch with permission constants between Dart and Android (due to addition of permission on iOS);
......
# #
# NOTE: This podspec is NOT to be published. It is only used as a local source! # NOTE: This podspec is NOT to be published. It is only used as a local source!
# This is a generated file; do not edit or check into version control.
# #
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Flutter' s.name = 'Flutter'
s.version = '1.0.0' s.version = '1.0.0'
s.summary = 'High-performance, high-fidelity mobile apps.' s.summary = 'High-performance, high-fidelity mobile apps.'
s.description = <<-DESC
Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS.
DESC
s.homepage = 'https://flutter.io' s.homepage = 'https://flutter.io'
s.license = { :type => 'MIT' } s.license = { :type => 'MIT' }
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
s.ios.deployment_target = '8.0' s.ios.deployment_target = '8.0'
s.vendored_frameworks = 'Flutter.framework' # Framework linking is handled by Flutter tooling, not CocoaPods.
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
s.vendored_frameworks = 'path/to/nothing'
end end
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "group:Runner.xcodeproj"> location = "self:">
</FileRef> </FileRef>
</Workspace> </Workspace>
...@@ -74,18 +74,18 @@ class BaseflowPluginExample extends StatelessWidget { ...@@ -74,18 +74,18 @@ class BaseflowPluginExample extends StatelessWidget {
1, 1,
); );
} }
return MaterialColor(color.value, swatch); return MaterialColor(color.value, swatch as Map<int, Color>);
} }
} }
/// A Flutter example demonstrating how the [pluginName] plugin could be used /// A Flutter example demonstrating how the [pluginName] plugin could be used
class AppHome extends StatefulWidget { class AppHome extends StatefulWidget {
/// Constructs the [AppHome] class /// Constructs the [AppHome] class
AppHome({Key key, this.title}) : super(key: key); AppHome({Key? key, this.title}) : super(key: key);
/// The [title] of the application, which is shown in the application's /// The [title] of the application, which is shown in the application's
/// title bar. /// title bar.
final String title; final String? title;
@override @override
_AppHomeState createState() => _AppHomeState(); _AppHomeState createState() => _AppHomeState();
......
...@@ -70,7 +70,7 @@ class _PermissionState extends State<PermissionWidget> { ...@@ -70,7 +70,7 @@ class _PermissionState extends State<PermissionWidget> {
} }
void checkServiceStatus(BuildContext context, Permission permission) async { void checkServiceStatus(BuildContext context, Permission permission) async {
Scaffold.of(context).showSnackBar(SnackBar( ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text((await permission.status).toString()), content: Text((await permission.status).toString()),
)); ));
} }
......
...@@ -74,11 +74,13 @@ class InfoPage extends StatelessWidget { ...@@ -74,11 +74,13 @@ class InfoPage extends StatelessWidget {
margin: const EdgeInsets.only(top: 24.0), margin: const EdgeInsets.only(top: 24.0),
alignment: Alignment.center, alignment: Alignment.center,
child: SizedBox.expand( child: SizedBox.expand(
child: RaisedButton( child: ElevatedButton(
textTheme: Theme.of(context).buttonTheme.textTheme, style: ElevatedButton.styleFrom(
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.0)),
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
),
),
child: Text(text), child: Text(text),
onPressed: () => _launchURL(url), onPressed: () => _launchURL(url),
), ),
......
...@@ -2,7 +2,7 @@ name: permission_handler_example ...@@ -2,7 +2,7 @@ name: permission_handler_example
description: Demonstrates how to use the permission_handler plugin. description: Demonstrates how to use the permission_handler plugin.
environment: environment:
sdk: ">=2.1.0 <3.0.0" sdk: ">=2.12.0-259.9.beta <3.0.0"
dependencies: dependencies:
flutter: flutter:
...@@ -15,7 +15,7 @@ dev_dependencies: ...@@ -15,7 +15,7 @@ dev_dependencies:
permission_handler: permission_handler:
path: ../ path: ../
url_launcher: ^5.4.11 url_launcher: ^6.0.0
flutter: flutter:
uses-material-design: true uses-material-design: true
......
...@@ -46,7 +46,8 @@ extension PermissionActions on Permission { ...@@ -46,7 +46,8 @@ extension PermissionActions on Permission {
/// ///
/// Returns the new [PermissionStatus]. /// Returns the new [PermissionStatus].
Future<PermissionStatus> request() async { Future<PermissionStatus> request() async {
return (await [this].request())[this]; final permissionStatus = (await [this].request())[this];
return permissionStatus ?? PermissionStatus.denied;
} }
} }
......
name: permission_handler name: permission_handler
description: Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions. description: Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.
version: 5.1.0+2 version: 6.0.0
homepage: https://github.com/baseflowit/flutter-permission-handler homepage: https://github.com/baseflowit/flutter-permission-handler
flutter: flutter:
...@@ -15,13 +15,13 @@ flutter: ...@@ -15,13 +15,13 @@ flutter:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
meta: ^1.1.6 meta: ^1.3.0
permission_handler_platform_interface: ^2.0.2 permission_handler_platform_interface: ^3.0.0
dev_dependencies: dev_dependencies:
effective_dart: ^1.2.1 effective_dart: ^1.3.0
plugin_platform_interface: ^1.0.1 plugin_platform_interface: ^2.0.0
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.12.0-259.9.beta <3.0.0"
flutter: ">=1.12.8 <2.0.0" flutter: ">=1.12.8 <2.0.0"
## 3.0.0+1
* **BREAKING**: Removed PermissionStatus.undetermined. This is now replaced by PermissionStatus.denied.
## 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;
} }
} }
...@@ -2,9 +2,6 @@ part of permission_handler_platform_interface; ...@@ -2,9 +2,6 @@ part of permission_handler_platform_interface;
/// Defines the state of a [Permission]. /// Defines the state of a [Permission].
enum PermissionStatus { enum PermissionStatus {
/// The permission wasn't requested yet.
undetermined,
/// The user granted access to the requested feature. /// The user granted access to the requested feature.
granted, granted,
...@@ -37,7 +34,7 @@ extension PermissionStatusValue on PermissionStatus { ...@@ -37,7 +34,7 @@ extension PermissionStatusValue on PermissionStatus {
return 1; return 1;
case PermissionStatus.restricted: case PermissionStatus.restricted:
return 2; return 2;
case PermissionStatus.undetermined: case PermissionStatus.denied:
return 3; return 3;
case PermissionStatus.permanentlyDenied: case PermissionStatus.permanentlyDenied:
return 5; return 5;
...@@ -53,7 +50,6 @@ extension PermissionStatusValue on PermissionStatus { ...@@ -53,7 +50,6 @@ extension PermissionStatusValue on PermissionStatus {
PermissionStatus.denied, PermissionStatus.denied,
PermissionStatus.granted, PermissionStatus.granted,
PermissionStatus.restricted, PermissionStatus.restricted,
PermissionStatus.undetermined,
PermissionStatus.limited, PermissionStatus.limited,
PermissionStatus.permanentlyDenied, PermissionStatus.permanentlyDenied,
][value]; ][value];
...@@ -61,9 +57,6 @@ extension PermissionStatusValue on PermissionStatus { ...@@ -61,9 +57,6 @@ extension PermissionStatusValue on PermissionStatus {
} }
extension PermissionStatusGetters on PermissionStatus { extension PermissionStatusGetters on PermissionStatus {
/// If the permission was never requested before.
bool get isUndetermined => this == PermissionStatus.undetermined;
/// If the user granted access to the requested feature. /// If the user granted access to the requested feature.
bool get isGranted => this == PermissionStatus.granted; bool get isGranted => this == PermissionStatus.granted;
...@@ -86,9 +79,6 @@ extension PermissionStatusGetters on PermissionStatus { ...@@ -86,9 +79,6 @@ extension PermissionStatusGetters on PermissionStatus {
} }
extension FuturePermissionStatusGetters on Future<PermissionStatus> { extension FuturePermissionStatusGetters on Future<PermissionStatus> {
/// If the permission was never requested before.
Future<bool> get isUndetermined async => (await this).isUndetermined;
/// If the user granted access to the requested feature. /// If the user granted access to the requested feature.
Future<bool> get isGranted async => (await this).isGranted; Future<bool> get isGranted async => (await this).isGranted;
......
...@@ -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+1
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.22.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