BaseBreakpoints<T> constructor

BaseBreakpoints<T>({
  1. required List<int> breakpoints,
  2. required List<T?> values,
  3. Map<int, T>? custom,
})

Creates a new set of breakpoints and associated values.

Implementation

BaseBreakpoints({
  required List<int> breakpoints,
  required this.values,
  Map<int, T>? custom,
}) {
  // Check conditions – an extending class could try to break these rules
  if (breakpoints.first != 0) {
    throw ArgumentError('The smallest breakpoint width must be 0.');
  }
  if (values.first == null) {
    throw ArgumentError('The smallest breakpoint value cannot be null.');
  }

  _combineCustomBreakpoints(breakpoints, custom);
}