Here's part of my store, which supports signing in and out:
abstract class _AuthStore with Store {
@observable
User? user;
}
And here's the generated code:
final _$userAtom = Atom(name: '_AuthStore.user');
@override
User get user {
_$userAtom.reportRead();
return super.user;
}
@override
set listener(User value) {
_$userAtom.reportWrite(value, super.user, () {
super.user = value;
});
}
The generated getters and setters do not use the correct User? type, and instead use the non-nullable User. This does not compile.
NNBD is a fairly big change and we are working on it. It's currently not supported.
Understood, I just figured I should report this as I haven't seen it mentioned in any NNBD discussions.
Hi is there any updates? Since nullable observable values are very common
I have created a PR here (any suggestions and updates are welcomed!): https://github.com/mobxjs/mobx.dart/pull/631
Dupe of #598
Null safe versions have been published for mobx, flutter_mobx and mobx_codegen
Most helpful comment
NNBD is a fairly big change and we are working on it. It's currently not supported.