【发布时间】:2019-05-29 14:50:24
【问题描述】:
我正在尝试在我的 Flutter 应用中使用异步将数据写入 Firestore 集合中。
我确实有这个代码,但它似乎不起作用。
import 'package:location/location.dart';
Location _locationService = new Location();
Future<void> setUserData() async {
Map<String, dynamic> userData = <String, dynamic>{
'email': this._emailController.text,
'password': this._passwordController.text,
'firstname': this._firstNameController.text,
'familyname': this._familyNameController.text,
'phonenumber': this._phoneNumberController.text,
'neighbourhood': this._neighbourhoodController.text,
'latitude': await _locationService.getLocation().latitude,
};
crudObj.addData(userData);
}
crudObj.addData 直接写入我的 Firestore 集合。
我做错了什么?
【问题讨论】:
标签: flutter google-cloud-firestore