小编jon*_*360的帖子

如何为 Firestore 创建自动删除机制?(时间段后删除数据)

我不确定如何开始/完成此操作,如果文档在特定时间段(例如 30 天)内未更改或访问,我希望 Firestore 数据库中的集合中的文档自行删除。换句话说,如果不需要,数据应该过期(被删除)。

有没有办法完成这个任务?

感谢您的帮助!

database firebase google-cloud-firestore

9
推荐指数
1
解决办法
1万
查看次数

pub get failed: 因为 flutter_app 依赖 firebase_firestore ^0.12.7+1 不匹配任何版本,版本解析失败

 pub get failed: Because flutter_app depends on firebase_firestore
 ^0.12.7+1 which doesn't match any versions, version solving failed.
Run Code Online (Sandbox Code Playgroud)

尝试flutter pub get在 pubspec.yaml 文件中运行时出现此错误。我目前正在尝试设置 firebase https://firebase.google.com/docs/flutter/setup

这是我的 pubspec.yaml 文件:

name: flutter_app
description: A new Flutter application.

version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2

  # Add the dependency for the Firebase Core Flutter SDK …
Run Code Online (Sandbox Code Playgroud)

dependencies android dart firebase flutter

8
推荐指数
1
解决办法
1万
查看次数

如何修复 [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] 未处理的异常:NoSuchMethodError: The method '&lt;=' was called on null. 错误?

我一直收到这个错误,我不知道如何修复它,因为昨天相同的代码起作用了。(这是一个测试应用程序,它使用谷歌地图和 firebase firestore 来保存和查询地图上的标记)

我认为这可能与我的 flutter 安装有关,所以我尝试使用稳定版和测试版,但在两个版本中都出现了相同的错误。

这是错误:

E/flutter (16809): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: NoSuchMethodError: The method '<=' was called on null.
E/flutter (16809): Receiver: null
E/flutter (16809): Tried calling: <=(102.0)
E/flutter (16809): #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
E/flutter (16809): #1      GeoFireCollectionRef.within.<anonymous closure>.<anonymous closure> (package:geoflutterfire/src/collection.dart:125:31)
E/flutter (16809): #2      WhereIterator.moveNext (dart:_internal/iterable.dart:442:13)
E/flutter (16809): #3      new List.from (dart:core-patch/array_patch.dart:50:19)
E/flutter (16809): #4      new List.of (dart:core-patch/array_patch.dart:68:17)
E/flutter (16809): #5      Iterable.toList (dart:core/iterable.dart:404:12)
E/flutter (16809): #6      GeoFireCollectionRef.within.<anonymous closure> (package:geoflutterfire/src/collection.dart:126:16)
E/flutter (16809): #7      _MapStream._handleData (dart:async/stream_pipe.dart:219:31)
E/flutter (16809): #8      _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:157:13) …
Run Code Online (Sandbox Code Playgroud)

google-maps flutter google-cloud-firestore

7
推荐指数
1
解决办法
2万
查看次数

如何在 Flutter 中创建轮廓卡片小部件

我想包含一个带有颤动的轮廓材料卡,但由于卡小部件没有样式元素或类似的东西,我不知道如何实现这一点。

我尝试使用该shape:属性,但不是很成功,主要是因为我不明白它是如何工作的。

在此输入图像描述

dart flutter flutter-layout

6
推荐指数
1
解决办法
8417
查看次数

按文档 id 查询集合

我正在寻找一种通过文档 ID 而不是字段进行查询的方法。

它可能看起来像这样:

Firestore.instance.collection('tournaments').where(documentId, searchInput)
Run Code Online (Sandbox Code Playgroud)

在这种情况下searchInput是一个不完整的 documentId。

我在 Stackoverflow 上看到了一个解决方案,但它不适用于颤振:https : //stackoverflow.com/a/52252264/8539070

要记住的另一件事是,我试图显示集合中与 id 的某些部分匹配的所有文档的列表。

感谢您的帮助!

dart firebase flutter google-cloud-firestore

3
推荐指数
2
解决办法
2771
查看次数

Firebase 定价:配额是否包括所有项目?

配额是包括所有项目还是每个 Firebase/谷歌云项目都是分开的?

我问这个问题是因为我想知道我是否应该在一个项目中包含多个应用程序以降低价格。关于组织,将应用程序拆分为多个项目会更好。

目前,我在 Google Cloud 上有一个应用程序项目和另一个项目来托管网站。(所有应用程序将使用同一个网站)

谢谢你的帮助!(我知道这不是一个编程问题,但作为使用 firebase 的程序员知道这很重要)

firebase google-cloud-platform

2
推荐指数
1
解决办法
457
查看次数