Flutter Firebase Firestore - 并行多个 get() 调用?

问题描述 投票:0回答:1

我知道您可以使用

await Future.wait([firstResult, secondResult]);
一次进行多个异步调用,但是如何像这样同时进行多个 Firestore 调用:

final jobs = await fireDb
          .collection(FIRE_DB_JOBS)
          .doc(fireAuthUseCases.getEmail())
          .withConverter<JobsEntity>(
            fromFirestore: JobsEntity.fromFirestore,
            toFirestore: (JobsEntity jobsEntity, _) => jobsEntity.toFirestore(),
          ).get();
flutter dart asynchronous google-cloud-firestore
1个回答
0
投票

啊我缺少括号;-( 列出响应=等待Future.wait([

火数据库 .collection(FIRE_DB_JOBS) .doc(fireAuthUseCases.getEmail()) .withConverter( fromFirestore:JobsEntity.fromFirestore, toFirestore: (JobsEntity jobsEntity, _) => jobsEntity.toFirestore(), )。得到() ]

);

© www.soinside.com 2019 - 2024. All rights reserved.