extension_nullable 1.0.1 copy "extension_nullable: ^1.0.1" to clipboard
extension_nullable: ^1.0.1 copied to clipboard

extends nullable

extension-nullable #

usage #

String louder(String s) {
  return "$s !!";
}

// map
final String? s1 = "hoge";
final String? s2 = null;

final res1 = s1.map(louder); // hoge !!
final res2 = s2.map(louder); // null

// fold
final String? s1 = "hoge";
final String? s2 = null;

final res1 = s1.fold("unexpect", louder); // hoge !!
final res2 = s2.fold("expect", louder); // expect
copied to clipboard
1
likes
120
points
25
downloads

Publisher

unverified uploader

Weekly Downloads

2024.07.07 - 2025.01.19

extends nullable

Repository (GitHub)

Documentation

API reference

License

MIT (license)

More

Packages that depend on extension_nullable