ifNotNull<T> static method
void
ifNotNull<T>(
- T? value,
- void action(
- T
Executes a function if value is not null
Example:
Helpers.ifNotNull(value, (v) => print(v));
Implementation
static void ifNotNull<T>(T? value, void Function(T) action) {
if (value != null) action(value);
}