fix: add delay to unstick download banner (#94)

* fix: add delay to fix download banner

* revert change

* minor tweak

* reduce wait time for download banner
This commit is contained in:
Bryan Oltman
2023-10-03 14:01:29 -04:00
committed by GitHub
parent b02610370a
commit 11c220c2ec
+7 -1
View File
@@ -132,7 +132,13 @@ class _MyHomePageState extends State<MyHomePage> {
Future<void> _downloadUpdate() async {
_showDownloadingBanner();
await _shorebirdCodePush.downloadUpdateIfAvailable();
await Future.wait([
_shorebirdCodePush.downloadUpdateIfAvailable(),
// Add an artificial delay so the banner has enough time to animate in.
Future<void>.delayed(const Duration(milliseconds: 250)),
]);
if (!mounted) return;
ScaffoldMessenger.of(context).hideCurrentMaterialBanner();