-
Notifications
You must be signed in to change notification settings - Fork 81
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
Fix/keep model keys on release #146
Conversation
lib/models/connection_status.dart
Outdated
@@ -12,7 +12,7 @@ class ConnectionStatus { | |||
}); | |||
|
|||
@JsonKey(name: 'connected') | |||
final bool connected; | |||
final bool? connected; |
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.
How about we just initialize it with false? Nullability seems a bit overkill here.
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.
will do
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.
made it not nullable and therefore defaulting to false
example/lib/main.dart
Outdated
@@ -47,7 +57,7 @@ class _HomeState extends State<Home> { | |||
_connected = false; | |||
var data = snapshot.data; | |||
if (data != null) { | |||
_connected = data.connected; | |||
_connected = data.connected ?? false; |
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.
See my other comment.
623239d
to
feb52a5
Compare
No description provided.