-
Notifications
You must be signed in to change notification settings - Fork 0
📦 migrate to null safety + make work with stable flutter #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; | |
import 'package:sensors/sensors.dart'; | ||
|
||
class ShakeDetector { | ||
final VoidCallback onPhoneShake; | ||
final VoidCallback? onPhoneShake; | ||
|
||
final double shakeThresholdGravity; | ||
|
||
|
@@ -19,7 +19,7 @@ class ShakeDetector { | |
|
||
int lastShakeTimestamp = DateTime.now().millisecondsSinceEpoch; | ||
|
||
StreamSubscription streamSubscription; | ||
StreamSubscription? streamSubscription; | ||
|
||
ShakeDetector({ | ||
this.onPhoneShake, | ||
|
@@ -53,7 +53,7 @@ class ShakeDetector { | |
lastShakeTimestamp = now; | ||
if (++shakeCount >= minShakeCount) { | ||
shakeCount = 0; | ||
onPhoneShake(); | ||
onPhoneShake!(); | ||
} | ||
} | ||
}); | ||
|
@@ -62,7 +62,7 @@ class ShakeDetector { | |
/// Stops listening to accelerometer events | ||
void stopListening() { | ||
if (streamSubscription != null) { | ||
streamSubscription.cancel(); | ||
streamSubscription!.cancel(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can be replaced with |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,11 @@ author: Simon Leier <simonleier@gmail.com> | |
homepage: https://github.com/leisim/logger_flutter | ||
|
||
environment: | ||
sdk: ">=2.2.2 <3.0.0" | ||
sdk: '>=2.12.0 <3.0.0' | ||
|
||
dependencies: | ||
flutter: | ||
sdk: flutter | ||
|
||
logger: ">=1.0.0" | ||
sensors: ^0.4.2+4 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aren’t we using sensors_plus? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have yet to try that, will update on this |
||
sensors: 2.0.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let’s make
dark
required or pass a default default value while initialisation