VN<T> constructor
VN<T> (
- T initialValue, [
- ChangeType changeType = ChangeType.smart
Creates a VN instance with an initial value and optional change behavior.
initialValue: The initial value of thisVN.changeType: Determines the behavior of updates. Defaults to ChangeType.smart.
If kFlutterMemoryAllocationsEnabled is enabled, the instance is tracked.
Implementation
VN(T initialValue, [this.changeType = ChangeType.smart])
: _value = initialValue {
_valueSetter = switch (changeType) {
ChangeType.hard => hardSet,
ChangeType.silent => silentSet,
ChangeType.smart => smartSet,
};
if (kFlutterMemoryAllocationsEnabled) {
ChangeNotifier.maybeDispatchObjectCreation(this);
}
}