updateEvents method

  1. @override
void updateEvents(
  1. ImageRenderViewModel renderViewModel,
  2. Set<EventHolder> holders
)
override

3.0 bind events

Implementation

@override
void updateEvents(
  ImageRenderViewModel renderViewModel,
  Set<EventHolder> holders,
) {
  super.updateEvents(renderViewModel, holders);
  if (holders.isNotEmpty) {
    for (var holder in holders) {
      switch (holder.eventName) {
        case kEventOnLoad:
          setOnLoad(renderViewModel, holder.isAdd);
          break;
        case kEventOnLoadStart:
          setOnLoadStart(renderViewModel, holder.isAdd);
          break;
        case kEventOnLoadEnd:
          setOnLoadEnd(renderViewModel, holder.isAdd);
          break;
        case kEventOnError:
          setOnError(renderViewModel, holder.isAdd);
          break;
        case kEventOnProgress:
          setOnProgress(renderViewModel, holder.isAdd);
          break;
      }
    }
  }
}