小编gre*_*bra的帖子

Flutter TextFormField TextInputAction.done 不是带有键盘类型数字的选项

我有一个带有 TextFormFields 列的表单。我的问题是,当我给 TextFormField akeyboardType: TextInputType.number并且textInputAction: TextInputAction.donetextInputAction 不显示时。对于其他类型的键盘,这对我来说不是问题......

我的问题是:如何创建一个 TextFormField,它具有仅包含数字的键盘具有 textInputAction?

flutter flutter-layout

4
推荐指数
1
解决办法
1246
查看次数

如何在 Flutter 中查询 Firebase Firestore 中 Geopoint 类型的字段?

我正在查询 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)

如何引用坐标内的纬度和经度?

在此输入图像描述

在此输入图像描述

firebase flutter google-cloud-firestore

0
推荐指数
1
解决办法
3790
查看次数