LiveData<T>.single constructor

LiveData<T>.single(
  1. T initValue, {
  2. String? name,
  3. bool verifyDataChange = false,
  4. StreamController<T>? streamController,
  5. LifeCycleOwner? observeOn,
  6. Logger? logger,
})

Implementation

factory LiveData.single(
    T initValue, {
      String? name,
      bool verifyDataChange = false,
      StreamController<T>? streamController,
      LifeCycleOwner? observeOn,
      Logger? logger,
    }) {
  LiveData<T> _this = LiveData<T>(
    initValue,
    name: name,
    verifyDataChange: verifyDataChange,
  );
  _this.streamController = streamController ?? StreamController<T>();
  _this._currentValue = initValue;
  _this.logger = logger ?? Logger.instance;
  _this.streamController = streamController ?? StreamController<T>();
  if (observeOn != null) {
    _this.owner(observeOn);
  }
  return _this;
}