-
-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support NNBD (Null safety) for generated code of mobx_codegen (new) (#…
…634) * Update pubspec.yaml * try to let generated code support null safety * support null safety code generation for Computed * upgrade dependencies * support "required" keyword in Action methods * upgrade mobx version for codegen * change outputs of tests to be consistent with null safety * add tests about null safety and pass them * change @required to required
- Loading branch information
Showing
14 changed files
with
649 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,61 @@ | ||
mixin _$Item<T extends num> on _Item<T>, Store { | ||
final _$valueAtom = Atom(name: '_Item.value'); | ||
final _$value1Atom = Atom(name: '_Item.value1'); | ||
|
||
@override | ||
T get value { | ||
_$valueAtom.reportRead(); | ||
return super.value; | ||
T get value1 { | ||
_$value1Atom.reportRead(); | ||
return super.value1; | ||
} | ||
|
||
@override | ||
set value(T value) { | ||
_$valueAtom.reportWrite(value, super.value, () { | ||
super.value = value; | ||
set value1(T value) { | ||
_$value1Atom.reportWrite(value, super.value1, () { | ||
super.value1 = value; | ||
}); | ||
} | ||
|
||
final _$valuesAtom = Atom(name: '_Item.values'); | ||
final _$value2Atom = Atom(name: '_Item.value2'); | ||
|
||
@override | ||
List<T> get values { | ||
_$valuesAtom.reportRead(); | ||
return super.values; | ||
T? get value2 { | ||
_$value2Atom.reportRead(); | ||
return super.value2; | ||
} | ||
|
||
@override | ||
set values(List<T> value) { | ||
_$valuesAtom.reportWrite(value, super.values, () { | ||
super.values = value; | ||
set value2(T? value) { | ||
_$value2Atom.reportWrite(value, super.value2, () { | ||
super.value2 = value; | ||
}); | ||
} | ||
|
||
final _$values1Atom = Atom(name: '_Item.values1'); | ||
|
||
@override | ||
List<T> get values1 { | ||
_$values1Atom.reportRead(); | ||
return super.values1; | ||
} | ||
|
||
@override | ||
set values1(List<T> value) { | ||
_$values1Atom.reportWrite(value, super.values1, () { | ||
super.values1 = value; | ||
}); | ||
} | ||
|
||
final _$values2Atom = Atom(name: '_Item.values2'); | ||
|
||
@override | ||
List<T> get values2 { | ||
_$values2Atom.reportRead(); | ||
return super.values2; | ||
} | ||
|
||
@override | ||
set values2(List<T> value) { | ||
_$values2Atom.reportWrite(value, super.values2, () { | ||
super.values2 = value; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.