WaterfallViewModel.copy constructor

WaterfallViewModel.copy(
  1. int id,
  2. int instanceId,
  3. String className,
  4. RenderContext<LoadInstanceContext> context,
  5. WaterfallViewModel viewModel,
)

Implementation

WaterfallViewModel.copy(
  int id,
  int instanceId,
  String className,
  RenderContext context,
  WaterfallViewModel viewModel,
) : super.copy(id, instanceId, className, context, viewModel) {
  numberOfColumns = viewModel.numberOfColumns;
  numberOfItems = viewModel.numberOfItems;
  columnSpacing = viewModel.columnSpacing;
  interItemSpacing = viewModel.interItemSpacing;
  preloadItemNumber = viewModel.preloadItemNumber;
  contentInset = viewModel.contentInset;
  realItemList = viewModel.children.whereType<WaterfallItemViewModel>().toList();
  var localContainBannerView = viewModel.containBannerView;
  if (localContainBannerView) {
    RenderViewModel? localBannerViewModel;
    try {
      localBannerViewModel =
          viewModel.children.firstWhere((element) => element is DivRenderViewModel);
      containBannerView = viewModel.containBannerView;
      bannerViewModel = localBannerViewModel;
    } catch (err) {
      containBannerView = false;
    }
  }
  var localContainPullFooter = viewModel.containPullFooter;
  var localPullFooterViewModel =
      viewModel.children.whereType<ListPullFooterViewModel>().toList()[0];
  if (localContainPullFooter) {
    footerViewModel = localPullFooterViewModel;
  }
  scrollGestureDispatcher = viewModel.scrollGestureDispatcher;
}