sesame 0.0.1 copy "sesame: ^0.0.1" to clipboard
sesame: ^0.0.1 copied to clipboard

A set of utils for Dart or flutter applications.

example/main.dart

import 'package:sesame/sesame.dart';

void main() {
  mapGetOrExample();
}

void mapGetOrExample() {
  final map = {"fruit": "apple"};

  final fruitOrDefaultValue = map.getOrElse("fruit", "orange");
  print("fruit is $fruitOrDefaultValue"); // fruit is apple

  final vegetableOrDefaultValue = map.getOrElse("vegetable", "lettuce");
  print("vegetable is $vegetableOrDefaultValue"); // vegetable is lettuce

  final fruitOrNull = map.getOrNull("fruit");
  print("fruit is $fruitOrNull"); // fruit is apple

  final vegetableOrNull = map.getOrNull("vegetable");
  print("vegetable is $vegetableOrNull"); // vegetable is null
}
0
likes
140
points
29
downloads

Publisher

verified publishermintminter.dev

Weekly Downloads

A set of utils for Dart or flutter applications.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on sesame