maybeValue<T extends Object> method
T?
maybeValue<T extends Object>({
- T xxLarge()?,
- T xLarge()?,
- T large()?,
- T medium()?,
- T small()?,
- T xSmall()?,
Proxies the call to value but allows all arguments to be null
When not a single argument is non-nullable, instead of throwing, returns a null instead.
Implementation
T? maybeValue<T extends Object>({
T Function()? xxLarge,
T Function()? xLarge,
T Function()? large,
T Function()? medium,
T Function()? small,
T Function()? xSmall,
}) {
if (xxLarge == null && xLarge == null && large == null && medium == null && small == null && xSmall == null) {
return null;
}
return value(xxLarge: xxLarge, xLarge: xLarge, large: large, medium: medium, small: small, xSmall: xSmall);
}