9 lines
149 B
Dart

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