From e359afbdabcdc6de8579aac6d5b1ffba7e829a2f Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Fri, 21 Jan 2022 12:08:23 -0800 Subject: [PATCH] notify listeners --- lib/models/profile.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/models/profile.dart b/lib/models/profile.dart index 98783f12..e79eb573 100644 --- a/lib/models/profile.dart +++ b/lib/models/profile.dart @@ -174,6 +174,7 @@ class ProfileInfoState extends ChangeNotifier { void downloadInit(String fileKey, int numChunks) { this._downloads[fileKey] = FileDownloadProgress(numChunks, DateTime.now()); + notifyListeners(); } void downloadUpdate(String fileKey, int progress, int numChunks) { @@ -239,6 +240,7 @@ class ProfileInfoState extends ChangeNotifier { void downloadMarkResumed(String fileKey) { if (this._downloads.containsKey(fileKey)) { this._downloads[fileKey]!.interrupted = false; + notifyListeners(); } } @@ -258,7 +260,7 @@ class ProfileInfoState extends ChangeNotifier { // we may trigger this event for auto-downloaded receivers too, // as such we don't assume anything else about the file...other than that // it exists. - if (this._downloads.containsKey(fileKey) == false) { + if (!this._downloads.containsKey(fileKey)) { // this will be overwritten by download update if the file is being downloaded this._downloads[fileKey] = FileDownloadProgress(1, DateTime.now()); }