Location.fromMap constructor

Location.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory Location.fromMap(Map<String, dynamic> map) {
  return Location(
    name: map['name'],
    owner: Npc.fromMap(map['owner']),
    type: LocationManager().getType(map['type']),
    zone: map['zone'],
    outsideDescription: List<String>.from((map['outsideDescription'])),
    buildingDescription: map['buildingDescription'],
    goods: map['goods'] != null
        ? List<Goods>.from(
            (map['goods']).map<Goods?>(
              (x) => Goods.fromMap(x),
            ),
          )
        : null,
  );
}