sift 1.0.9
sift: ^1.0.9 copied to clipboard

A lightweight map reading library that can be used in Dart and Flutter projects

Sift #

A lightweight map reading library that can be used in Dart and Flutter projects

Usage #

Map<String, dynamic> _data = {'age': 21, 'name': null, 'address': '41 Main drive'};

//reading values that are required - throws exception in case of error
try {
  var age = _sift.readNumberFromMap(_data, 'age');
  var address = _sift.readStringFromMap(_data, 'address');
  print(age); //prints 21
  print(address); //prints 41 Main Drive
} on SiftException catch (exception) {
  print(exception.errorMessage);
}

//reading values that are optional by providing a default value
var name = _sift.readStringFromMapWithDefaultValue(_data, 'name', 'John Doe');
print(name); //prints John Doe
5
likes
90
pub points
44%
popularity

Publisher

shoutoutsoftware.com

A lightweight map reading library that can be used in Dart and Flutter projects

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD (LICENSE)

Dependencies

flutter, intl, pedantic

More

Packages that depend on sift