sesame 0.0.1 sesame: ^0.0.1 copied to clipboard
A set of utils for Dart or flutter applications.
Sesame #
Features #
- Useful extension methods for Dart collections.
Getting started #
Add the following to your pubspec.yaml
:
dependencies:
sesame: any
Usage #
Extensions #
A set of useful extension methods for Dart collections.
MapGetOr
import 'package:sesame/extensions.dart';
final map = {"fruit":"apple"};
final fruitOrDefaultValue = map.getOrElse("fruit", "orange"); // apple
final vegetableOrDefaultValue = map.getOrElse("vegetable", "lettuce"); // lettuce
final fruitOrNull = map.getOrNull("fruit"); // apple
final vegetableOrNull = map.getOrNull("vegetable"); //null