set method Null safety

T set(
  1. T value,
  2. {bool notifyChange = true}
)

Updates the property value. Notifies any listeners to the change

Returns the updated value

Implementation

T set(T value, {bool notifyChange = true}) {
  final previousValue = _value;
  _value = value;
  if (notifyChange && previousValue != value) {
    _viewModel.notifyChanges([
      EmpireStateChanged(value, previousValue, propertyName: propertyName)
    ]);
  }
  return _value;
}