when method
Returns this if condition evaluates to true, otherwise null.
condition can be:
boolbool Function()(lazy)- anything else →
false
Implementation
T? when(Object? condition) => _evalCondition(condition) ? this : null;
Returns this if condition evaluates to true, otherwise null.
condition can be:
boolbool Function() (lazy)falseT? when(Object? condition) => _evalCondition(condition) ? this : null;