verifyOrThrow method
Implementation
void verifyOrThrow(CollectionWidgetStateType type) {
final ok = switch (type) {
CollectionWidgetStateType.list => this is InfiniteListOptions,
CollectionWidgetStateType.sliverList => this is SliverInfiniteListOptions,
CollectionWidgetStateType.animatedList => this is AnimatedInfiniteListOptions,
CollectionWidgetStateType.animatedSliverList => this is AnimatedSliverInfiniteListOptions,
CollectionWidgetStateType.grid => this is InfiniteGridOptions,
CollectionWidgetStateType.sliverGrid => this is SliverInfiniteGridOptions,
};
if (!ok) {
throw ArgumentError('Wrong options type for "$type". Got ${runtimeType.toString()}.');
}
}