ImageItem<T extends Object>.fromImageDataStream constructor

ImageItem<T extends Object>.fromImageDataStream(
  1. Stream<ImageData<T>?> image, {
  2. dynamic fallBackWidget = const LoadingView(),
})

Implementation

ImageItem.fromImageDataStream(
  Stream<ImageData<T>?> image, {
  fallBackWidget = const LoadingView(),
})  : this.tag = UniqueKey(),
      this.fallBackWidget = const LoadingView() {
  image.forEach((value) {
    this.image = value;
    if (value != null)
      this.tag = value.id;
    else
      this.fallBackWidget = Center(child: const Icon(Icons.report_problem));
    // debugPrint(this.tag.toString());
    notifyListeners();
  });
}