我有一个带有 TextFormFields 列的表单。我的问题是,当我给 TextFormField akeyboardType: TextInputType.number并且textInputAction: TextInputAction.donetextInputAction 不显示时。对于其他类型的键盘,这对我来说不是问题......
我的问题是:如何创建一个 TextFormField,它具有仅包含数字的键盘并具有 textInputAction?
我正在查询 firestore 集合以查找纬度和经度范围内的文档。由于看来您无法使用给定两个不同字段(“lat”、“lon”)的参数进行查询,因此我已将 Geopoint 类型分配给具有经度和纬度的单个字段“coords”。如何将 .where() 与地理点一起使用?下面是我想要使用的一般查询,其中 _latMin、_latMax 等是链接到地图边界框的变量。
_getDocs() async {
print('getdocs');
final QuerySnapshot snapshot = await FirebaseFirestore.instance
.collection('collectionName')
.where(
'coords',
isGreaterThan: _latMin,
isLessThan: _latMax,
)
.where(
'coords',
isGreaterThan: _lonMin,
isLessThan: _lonMax,
)
.get();
snapshot.docs.forEach((DocumentSnapshot doc) {
print(doc.data());
});
}
Run Code Online (Sandbox Code Playgroud)
如何引用坐标内的纬度和经度?