Closed kou-yeung closed 4 years ago
Hi, since you are using an async call to update the UI, your have to find the target window before calling Window.instance.run. You can solve this problem by surrounding Window.instance.run(..) with a getScope call, Please read this section https://github.com/UnityTech/UIWidgets#using-window-scope for the details.
thanks~
I use RefreshIndicator to make a "Pull to refresh".
When i download data from server and call "resolve"
Window.instance.run(() => this.ResolveSync());
will show error "Window.instance == null"sample code for RefreshIndicator.onRefresh
new RefreshIndicator ( onRefresh: RefreshList )
Promise RefreshList() { return new Promise((resolve, reject) => { using (var client = new WebClient()) { client.DownloadStringCompleted += (str, err) => { resolve(); }; client.DownloadStringAsync(new Uri("xxx"), null); } }); }