LiveData<T>.single constructor
LiveData<T>.single (
- T initValue, {
- String? name,
- bool verifyDataChange = false,
- StreamController<
T> ? streamController, - LifeCycleOwner? observeOn,
- 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;
}