map_fields 0.0.5 copy "map_fields: ^0.0.5" to clipboard
map_fields: ^0.0.5 copied to clipboard

Get fields from a map, simply, performing error handling errors.

MapFields #

A package for handling fields in maps for dart in a simple and fast way.

Features #

  • MapFields.load()
  • getString
  • getInt
  • getDouble
  • getBool
  • getDateTime
  • getList<T>
  • getStringNullable
  • getIntNullable
  • getDoubleNullable
  • getBoolNullable
  • getDateTimeNullable
  • getListNullable<T>

Installation #

dependencies:
  map_fields: any

Usage #

import 'package:map_fields/map_fields.dart';

final map = <String, dynamic>{
    'name': 'Isac Dev',
    'is_dev': true
};

final mapFields = MapFields.load(map);
print(mapFields.getString('name')); // 'Isac Dev'
print(mapFields.getBool('is_dev')); // true
print(mapFields.getDateTime('birth', DateTime(1900))); // 1900-01-01 00:00:00.000
print(mapFields.getDateTime('birth')); // throw MapFieldsError
6
likes
150
points
35
downloads

Publisher

verified publisherisacmartins.com

Weekly Downloads

Get fields from a map, simply, performing error handling errors.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on map_fields