-
Notifications
You must be signed in to change notification settings - Fork 212
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
Migrate to Flutter 2 #370
Migrate to Flutter 2 #370
Conversation
4f2410f
to
86b9900
Compare
664afe8
to
ef75a67
Compare
* Add Null safety support
ef75a67
to
6137aca
Compare
* Update after issue flutter/flutter#45197
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.
Reviewed 18 of 18 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @emawby and @Jeasmine)
example/lib/main.dart, line 292 at r1 (raw file):
// Get the value for a trigger by its key Object? triggerValue = await OneSignal.shared.getTriggerValueForKey("trigger_3"); print("'trigger_3' key trigger value: ${triggerValue?.toString() ?? null}");
?? null
doesn't seems needed here. Doesn't triggerValue?.toString()
result in null
if triggerValue
is null
?
lib/src/create_notification.dart, line 176 at r1 (raw file):
if (this.buttons != null) { var btns = []; this.buttons!.forEach((btn) => btns.add(btn.mapRepresentation()));
Is the !
needed here? Does Dart not infer that it can't be null
from the if block it is contained in?
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @emawby and @jkasten2)
example/lib/main.dart, line 292 at r1 (raw file):
Previously, jkasten2 (Josh Kasten) wrote…
?? null
doesn't seems needed here. Doesn'ttriggerValue?.toString()
result innull
iftriggerValue
isnull
?
Done.
lib/src/create_notification.dart, line 176 at r1 (raw file):
Previously, jkasten2 (Josh Kasten) wrote…
Is the
!
needed here? Does Dart not infer that it can't benull
from the if block it is contained in?
Actually, it doesn't
Error: Method 'forEach' cannot be called on 'List?' because it is potentially null.
- 'List' is from 'dart:core'.
- 'OSActionButton' is from 'package:onesignal_flutter/src/notification.dart' ('../lib/src/notification.dart').
Try calling using ?. instead.
this.buttons.forEach((btn) => btns.add(btn.mapRepresentation()));
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.
Reviewed 1 of 1 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @emawby)
This change is