Skip to content

Conversation

@mrice-wisecode
Copy link

  1. Fixes calling set state when not mounted. (exception) (Issue Link)
  2. Fixes PlatformView being rendered before a size is available. (exception) (Issue Link)

1. Fixes calling set state when not mounted. (exception)
2. Fixes PlatformView being rendered before a size is available. (exception)
@jerielng
Copy link
Contributor

Hey @mrice-wisecode thanks for opening this pull request and for your continued and active engagement on these two issues. Our SDK code changes go through an internal review process, but this PR will be a really helpful reference for our team.

We'll keep you posted in this PR and on the original issues when the changes have been made and released.

});
calculatedHeight = height;
if(mounted) {
setState(() {});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For our knowledge, could you give some context on why you moved the calculatedHeight explicitly out of the setState block?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah for sure. so in the case where calculatedHeight gets set before we are mounted it would be set so that upon the initial call to the build function the calculatedHeight would be set and ready for use. then in subsequent calls we could likely assume we would then be mounted and setState would get called. the function inside of setState is not at all necessary to use and just for convenience. this guarantees calculatedHeight will get set and if we need to update our state because we are mounted it would still happen.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyhow, take it or leave it but this does resolve the two issues I recently posted. For now i'll deploy our updates on my fork and hope to see some fixes soon. Thanks for keeping this updated! Much appreciated

@hokstuff
Copy link
Contributor

Hi @mrice-wisecode,

Thank you for submitting this PR! As noted in the original Github issues, we have released fixes to the root causes you raised and addressed in this PR. I will close this out and feel free to validate the behaviors on our latest 16.0.0 SDK version.

Thanks!

@hokstuff hokstuff closed this Oct 23, 2025
@hokstuff
Copy link
Contributor

Apologies, I will reopen this PR since it addresses another issue that is not yet fixed

@hokstuff hokstuff reopened this Oct 23, 2025
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.

3 participants