-
Notifications
You must be signed in to change notification settings - Fork 6k
Initialize locale from FlutterEngine #17473
Conversation
| [_engine.get() platformViewsController] -> SetFlutterView(_flutterView.get()); | ||
| [_engine.get() platformViewsController] -> SetFlutterViewController(self); | ||
| [_engine.get() platformView] -> NotifyCreated(); | ||
| [_engine.get() platformViewsController]->SetFlutterView(_flutterView.get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this stuff because the newest toolchain brought a new clang-format along with it? If possible, can you submit this without this bit. Lets format the repo again so PRs are not polluted with these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so. Without this, the format ci job fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My formatter always clobbered these, nice to have CI in alignment with my tools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to pull these out again because the toolchain roll got reverted. When I land it again, I'll land a full reformat with or after it.
* Initialize locale from FlutterEngine
Right now, FlutterViewController listens for updates to the system locale and initializes
dart:ui#window.localeatviewDidAppear. This is too late for callers who want to know the locale inmain(or, when they're trying to set up localization for aWidgetsAppor derivative).This patch makes
FlutterEngineresponsible for setting the Locale and listening for changes, and makes sure that happens earlier in the initialization cycle.Adding the assertion to
main.dartof the Scenarios app makes tests fail if the locale is not set up, with a log like this:Fixes flutter/flutter#39032