when<T> method
T
when<T>({
- required T mobile(),
- required T tablet(),
- required T desktop(),
- T widescreen()?,
Implementation
T when<T>({
required T Function() mobile,
required T Function() tablet,
required T Function() desktop,
T Function()? widescreen,
}) => switch (this) {
Breakpoint.mobile => mobile(),
Breakpoint.tablet => tablet(),
Breakpoint.desktop => desktop(),
Breakpoint.widescreen => widescreen != null ? widescreen() : desktop(),
};