LiveData<T> constructor Null safety

LiveData<T>(
  1. T initValue,
  2. {String? name,
  3. StreamController<T>? streamController,
  4. LifeCycleObserver? lifeCycleObserver}
)

Implementation

LiveData(
  T initValue, {
  this.name,
  StreamController<T>? streamController,
  LifeCycleObserver? lifeCycleObserver,
})  : this.initialValue = initValue,
      this._currentValue = initValue {
  this.streamController = streamController ?? StreamController<T>();
  if (lifeCycleObserver != null) {
    bind(lifeCycleObserver);
  }
}