Skip to content

Conversation

fengmlo
Copy link
Contributor

@fengmlo fengmlo commented Sep 20, 2022

Replace context.debugDoingBuild flag with SchedulerBinding.instance.schedulerPhase. 'debugDoingBuild' is only valid in debug mode and it should not be used in release mode, 'SchedulerBinding.instance.schedulerPhase' can be used instead.

@AlexV525
Copy link
Member

Thanks for the contribution. Could explain for with these phases?

@fengmlo
Copy link
Contributor Author

fengmlo commented Sep 21, 2022

In release mode, if the showToast method is used in initState, then calling the showToast method later will no longer be able to display the toast.

@fengmlo
Copy link
Contributor Author

fengmlo commented Sep 21, 2022

For the specific definition of schedulerPhase, check https://api.flutter.dev/flutter/scheduler/SchedulerPhase.html

Copy link
Member

@AlexV525 AlexV525 left a comment

Choose a reason for hiding this comment

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

LGTM

@AlexV525
Copy link
Member

You'll need to modify CHANGELOG and pubspec too.

@AlexV525 AlexV525 merged commit 7475ad2 into OpenFlutter:main Sep 27, 2022
@fengmlo

This comment was marked as duplicate.

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.

2 participants