WaterfallViewModel.copy constructor
WaterfallViewModel.copy(
- int id,
- int instanceId,
- String className,
- RenderContext<
LoadInstanceContext> context, - 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;
}