FdcGridPageSizeSelector constructor

FdcGridPageSizeSelector({
  1. String? id,
  2. bool visible = true,
  3. FdcGridItemPlacement placement = FdcGridItemPlacement.end,
  4. String label = '',
  5. List<int> options = const <int>[100, 500, 1000, 5000, 10000],
})

Implementation

FdcGridPageSizeSelector({
  super.id,
  super.visible,
  super.placement = FdcGridItemPlacement.end,
  this.label = '',
  List<int> options = const <int>[100, 500, 1000, 5000, 10000],
}) : options = List<int>.unmodifiable(options) {
  int? invalidOption;
  for (final option in this.options) {
    if (option <= 0) {
      invalidOption = option;
      break;
    }
  }
  if (invalidOption != null) {
    throw RangeError.value(
      invalidOption,
      'options',
      'Every page-size option must be greater than zero.',
    );
  }
  if (this.options.toSet().length != this.options.length) {
    throw ArgumentError.value(
      options,
      'options',
      'Page-size options must not contain duplicates.',
    );
  }
}