Issue
DocumentReference ref = FirebaseFirestore.instance
.collection('invoices')
.doc(authService.getUser().uid); // or non existing ID
// here works if I return {}
final doc = await ref.get();
final data = doc.data();
When trying locally either with simulator or with real device (connected by usb) works fine, but in released app, the await takes for ever.
This was also working ok before updating to flutter 2.8 but now it fails only on Android
Solution
Reposting my comments as they seemed to have helped:
You should handle possible exceptions. The get
method returns an instance of Future
, which may complete with an error. When awaiting it, it may throw.
Answered By - Riwen
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.