Skip to content

Comments

Fix screenInfo availability issue#4

Open
TOZXII wants to merge 1 commit intomainfrom
fix-screeninfo-availability
Open

Fix screenInfo availability issue#4
TOZXII wants to merge 1 commit intomainfrom
fix-screeninfo-availability

Conversation

@TOZXII
Copy link
Owner

@TOZXII TOZXII commented Oct 24, 2024

Fixes #3

Add a FutureBuilder to ScreenHelperWidget to wait for screenInfoData to be available.

  • Modify _fetchAndSetScreenInfo to return a Future in lib/screen_helper_widget.dart.
  • Update build method in lib/screen_helper_widget.dart to use FutureBuilder to wait for screenInfoData.
  • Remove the null check for screenInfo in ScreenInfoDisplay in example/lib/main.dart.
  • Remove the CircularProgressIndicator in ScreenInfoDisplay in example/lib/main.dart.

For more details, open the Copilot Workspace session.

Fixes #3

Add a `FutureBuilder` to `ScreenHelperWidget` to wait for `screenInfoData` to be available.

* Modify `_fetchAndSetScreenInfo` to return a `Future` in `lib/screen_helper_widget.dart`.
* Update `build` method in `lib/screen_helper_widget.dart` to use `FutureBuilder` to wait for `screenInfoData`.
* Remove the null check for `screenInfo` in `ScreenInfoDisplay` in `example/lib/main.dart`.
* Remove the `CircularProgressIndicator` in `ScreenInfoDisplay` in `example/lib/main.dart`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/TOZXII/screen_helper/issues/3?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sometimes the screenInfo cannot be found on the widget tree

1 participant