mobx.dart
mobx.dart copied to clipboard
[BUG] Generated file with Computed Observables.
I'm currently using mobx. Recently, reading the docs, I found the computed observables and since then, I'm using them in my projects. In one of this projects, that doesn't use null safety feature, store generated files that has computed observables are using being wrotten with ? operator. Due this, every file that has computed observables are coming with error, since this functionality is not recognized in projects that do not have null safety.
Example:
mixin _$AdicionarNovosItensStore on _AdicionarNovosItensStoreBase, Store {
Computed<bool>? _$canSaveOrderComputed;
@override
bool get canSaveOrder =>
(_$canSaveOrderComputed ??= Computed<bool>(() => super.canSaveOrder,
name: '_AdicionarNovosItensStoreBase.canSaveOrder'))
.value;
}
There's something that I can do to solve this problem? I think that mobx code gen should only uses null safety features on projects that has null safety.
Cco: @fernandomoraesvr, @gustavoalves93
If you don't use null safety yet, you need to downgrade to:
mobx: 1.2.1+4
flutter_mobx: 1.1.0+2
mobx_codegen: 1.1.2