Skip to content

Commit

Permalink
Merge pull request #3 from koa-health/chore/migrate_dart_null_safety
Browse files Browse the repository at this point in the history
chore(dart): migrate to null safety
  • Loading branch information
racloubon authored Feb 22, 2022
2 parents ef9bf09 + 43f6acb commit 39ec0f0
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 36 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.0

- Migration to use dart with null safety

## 1.2.3

- Updated workflow
Expand Down
4 changes: 2 additions & 2 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:name="screen_lock_check_example"
android:label="screen_lock_check_example"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:name="io.flutter.embedding.android.FlutterActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
42 changes: 21 additions & 21 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,42 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety.1"
version: "2.8.2"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.1"
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.3"
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.1"
version: "1.3.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.1"
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0-nullsafety.3"
version: "1.15.0"
cupertino_icons:
dependency: "direct main"
description:
Expand All @@ -56,7 +56,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.1"
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -73,28 +73,28 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10-nullsafety.1"
version: "0.12.11"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.7.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.1"
version: "1.8.0"
screen_lock_check:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "1.2.3"
version: "2.0.0"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -106,56 +106,56 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.2"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.1"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.1"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.1"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.1"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19-nullsafety.2"
version: "0.4.3"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.3"
version: "2.1.1"
sdks:
dart: ">=2.10.0-110 <2.11.0"
flutter: ">=1.20.0"
dart: ">=2.14.0 <3.0.0"
flutter: ">=2.8.1"
7 changes: 6 additions & 1 deletion lib/screen_lock_check.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ class ScreenLockCheck {
/// Returns [true] if the user has some form of screen lock (lock screen)
/// enabled on their device
Future<bool> get isScreenLockEnabled async {
final bool isScreenLockEnabled = await _channel.invokeMethod('isScreenLockEnabled');
final bool? isScreenLockEnabled = await _channel.invokeMethod('isScreenLockEnabled');

if (isScreenLockEnabled == null) {
throw Exception('Could not establish whether or not screen lock is enabled');
}

return isScreenLockEnabled;
}
}
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: screen_lock_check
description: A plugin that checks whether the user has enabled a passcode, pattern lock, face id or touch id on their device.
version: 1.2.3
version: 2.0.0
homepage: https://github.com/koa-health/screen_lock_check

environment:
sdk: ">=2.7.0 <3.0.0"
flutter: ">=1.20.0"
sdk: '>=2.12.0 <3.0.0'
flutter: ">=2.8.1"

dependencies:
flutter:
Expand Down

0 comments on commit 39ec0f0

Please sign in to comment.