BreakpointValue<T>.fromMap constructor

BreakpointValue<T>.fromMap(
  1. Map<LayoutBreakpoint, T> values, [
  2. T? defaultValue
])

Implementation

BreakpointValue.fromMap(Map<LayoutBreakpoint, T> values, [T? defaultValue])
    : assert(
          values.length == LayoutBreakpoint.values.length ||
              defaultValue != null,
          'A default value is required if there is not a value asigned to a breakpoint inside the map'),
      this.xs = values[LayoutBreakpoint.xs] ?? defaultValue!,
      this.sm = values[LayoutBreakpoint.sm],
      this.md = values[LayoutBreakpoint.md],
      this.lg = values[LayoutBreakpoint.lg],
      this.xl = values[LayoutBreakpoint.xl];