takeFromMap method

  1. @override
void takeFromMap(
  1. Map<String, dynamic>? from, {
  2. bool copyEntries = true,
})
override

Used for meta-forms in setting deep properties

Implementation

@override
void takeFromMap(Map<String, dynamic>? from, {bool copyEntries = true}) {
  if (from == null) return;

  super.takeFromMap(from, copyEntries: copyEntries);
  for (final entry in from.entries) {
    final key = entry.key;
    final value = entry.value;
    if (value == null) continue;
    switch (key) {
      case "googlePlaceId":
        _googlePlaceId = value as String;
        break;
      case "description":
        _description = value as String;
        break;
      case "type":
        _type = value as String;
        break;
      case "geo":
        _geo = GeoLocation.fromJson(value);
        break;
      case "streetLineOne":
        _streetLineOne = value as String;
        break;
      case "streetLineTwo":
        _streetLineTwo = value as String;
        break;
      case "streetLineThree":
        _streetLineThree = value as String;
        break;
      case "locality":
        _locality = value as String;
        break;
      case "region":
        _region = value as String;
        break;
      case "postalCode":
        _postalCode = value as String;
        break;
      case "countryCode":
        _countryCode = value as String;
        break;
      case "shippable":
        _shippable = value as bool;
        break;
      case "sortOrder":
        _sortOrder = value as int;
        break;
      default:
        break;
    }
  }
}