问题描述
我正在尝试映射从 Firebase Firestore 读取的 GeoPoint 类型。
数据是从 Firestore 读取的,我在工厂的地图对象中获取了我的字段 geoPoint。
我收到一个错误,说 _TypeError (type '_InternalLinkedHashMap
如果我继续执行,它确实会在 GeoPoint 类型中设置,但是这个错误只在我第一次阅读文档时发生,之后它可以工作,知道会发生什么吗?
import 'package:cloud_firestore/cloud_firestore.dart';
class RestaurantModel {
final String id;
final String name;
final String logoURL;
final String headerImage;
final String phone;
final String address;
final String zipCode;
final String town;
final String website;
final String eMail;
final String aboutUs;
final GeoPoint geoPoint;
bool isExpanded = false;
RestaurantModel({
this.id,this.name,this.logoURL,this.headerImage,this.phone,this.address,this.zipCode,this.town,this.website,this.eMail,this.aboutUs,this.geoPoint,});
factory RestaurantModel.fromMap({Map<String,dynamic> map,String docId}) {
if (map == null) return null;
return RestaurantModel(
id: docId ?? map['id'],name: map['name'],logoURL: map['logoUrl'],headerImage: map['headerImage'] ?? '',phone: map['phone'],address: map['address'],zipCode: map['zipCode'],town: map['town'],website: map['website'],eMail: map['eMail'],aboutUs: map['aboutUs'] ?? '',geoPoint: map['geoPoint'],);
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)