I'm migrating to null safety and have some setters that executes code if a value changes
set someValue(int value) {
if ( _someValue != val ) {
_someValue = val;
// do some stuff
}
}
Some of my variables now have late initialization due to migration and I'm understandably getting a LateInitializationError above when I check its value. Is there a way to check if a variable is initialized? E.g.,
set someValue(int value) {
if ( !_someValue.isInitilized() || _someValue != val ) {
_someValue = val;
// do some stuff
}
}