holtzmak / Humane-Transport

A Flutter and Firebase mobile application to record Canadian animal transport and transfer of care documentation
https://sanakhan1997.github.io/Humane-Transport/
GNU General Public License v3.0
6 stars 3 forks source link

Time limit calls over the internet so to warn Transporter when device is offline #245

Closed holtzmak closed 3 years ago

holtzmak commented 3 years ago

Closes #234 .

This PR adds:

  1. Time limit of 10s to internet futures as per https://stackoverflow.com/a/61518327
  2. Continue using futures against the suggestion of https://stackoverflow.com/a/53551036
  3. Adds BusyOverlay to home screen

We should continue to use futures because they provide us with useful error messages, like permission denied. Without them, debugging would be a lot harder and more confusing for the Transporter


Changes aren't much, but when the device is offline we will see:

Blank images when offline Blank images when offline

PDF View never completes because it can't get images from the internet, but the user can just back out from the screen rather than wait now PDF View sits forever, but that's fine because we can leave

We see this message when a timeout occurs: Good future error