9 lines
145 B
Dart

extension Let<T> on T? {
R? let<R>(R Function(T it) action) {
if (this != null) {
return action(this!);
}
return null;
}
}