Last updated:
0 purchases
nmap
Dart Null Map #
A dart package that provides != null map operation extension (null map, nmap).
The null map operator applies the passed convert function on receiver if it is not null, returns null otherwise.
Note: this package is a temporary solution to the open Dart lang issue https://github.com/dart-lang/language/issues/361 while waiting for an actual language operator implementation.
Usage #
final int? a = null;
final int b = 1;
print(a.nmap((n) => n + 1)); // null
print(b.nmap((n) => n + 1)); // 2
copied to clipboard
See implementation file for library source code.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.