Skip to content

Conversation

jacob314
Copy link
Contributor

The previous approach of delaying by 250ms was insufficient. This matches other UI in DevTools where we block actions while the current action is in progress.

'The "$page" screen is not available for this application.'),
page != null
? 'The "$page" screen is not available for this application.'
: 'No tabs available for this application.',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should now never occur but the previous message was confusing.

@@ -117,7 +117,7 @@ class _InitializerState extends State<Initializer>

/// Shows a "disconnected" overlay if the [service.serviceManager] is not currently connected.
void _handleNoConnection() {
WidgetsBinding.instance.addPostFrameCallback((_) {
WidgetsBinding.instance.scheduleFrameCallback((_) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't understand why we were using a postFrameCallback. A frame might not render and then it wouldn't be called till some strange later time.

@@ -1305,3 +1281,18 @@ extension BoolExtension on bool {
return -1;
}
}

Future<T> whenValueNonNull<T>(ValueListenable<T> listenable) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't see where this is used in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is used in a future pr.

if (value != null) {
completer.complete(value);
}
listenable.removeListener(listener);
Copy link
Member

Choose a reason for hiding this comment

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

what if value is null? Then we would remove the listener and the completer would never complete. If value is null, should we keep listening?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed. Fixed the logic.

@jacob314 jacob314 merged commit e391fac into flutter:master Jun 11, 2021
@jacob314 jacob314 deleted the connect_fix branch June 11, 2021 17:59
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