validate method
void
validate()
Validates paging configuration in runtime builds.
Application config can be assembled dynamically in release builds. Dataset construction calls this method so invalid public paging options fail predictably outside debug mode.
Implementation
void validate() {
if (pageSize <= 0) {
throw RangeError.value(
pageSize,
'pageSize',
'Page size must be greater than zero.',
);
}
if (maxPageSize <= 0) {
throw RangeError.value(
maxPageSize,
'maxPageSize',
'Maximum page size must be greater than zero.',
);
}
if (pageSize > maxPageSize) {
throw RangeError.range(
pageSize,
1,
maxPageSize,
'pageSize',
'Page size cannot exceed maxPageSize.',
);
}
if (!infiniteLoadThreshold.isFinite ||
infiniteLoadThreshold <= 0 ||
infiniteLoadThreshold > 1) {
throw RangeError.range(
infiniteLoadThreshold,
0,
1,
'infiniteLoadThreshold',
'Infinite load threshold must be greater than zero and no greater than one.',
);
}
}