在读取保存在Firestore上的Flutter Map()数据时出现问题

时间:2019-12-15 06:58:28

标签: flutter google-cloud-firestore

Showing database firestore

嗨, 我正在尝试显示使用以下代码保存在Firestore中的Map()数据。

 snapshot.data.data['MyMobile'].forEach((key,value)=> Text("$key $value"))

它显示下面的错误

I/flutter (23045): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter (23045): The following NoSuchMethodError was thrown building StreamBuilder<DocumentSnapshot>(dirty,
I/flutter (23045): dependencies: [MediaQuery], state: _StreamBuilderBaseState<DocumentSnapshot,
I/flutter (23045): AsyncSnapshot<DocumentSnapshot>>#46607):
I/flutter (23045): The method 'forEach' was called on null.
I/flutter (23045): Receiver: null
I/flutter (23045): Tried calling: forEach(Closure: (dynamic, dynamic) => Text)

0 个答案:

没有答案