- Notifications
You must be signed in to change notification settings - Fork78
Use builder pattern#124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
good idea would be to remove the start-engine entirely and instead take a callback for initializing plugins after engine start. On Android the engine should start/stop on Resume/Paused |
@dvc94ch I have split the engine start and initialisation. However, plugins should be initialised before starting the engine, as there is a possible race condition where flutter sends a message before the corresponding channel has been registered. |
I'm refering to for example sending the locale. Are we talking about the same thing? |
Not sure the relevance of locale sending? These changes only move arguments, what happens with plugins etc is unchanged? |
I'm saying it should be changed, but doesn't necessarily have to be in this PR. So the builder should take a |
I feel like engine restarting etc isn't something that should be built into I can't imagine engine restarting is needed anywhere? (On mobile, there are the plugins for suspending and resuming the app?) |
Nice, hadn't noticed the lifecycle plugin :) |
can you fix the clippy issues? |
An initial step towards supporting more configuration options.
In the future,
handler
will be broken down inopengl handler
or something of the likes, allowing the engine to be constructed withwith_gl_backend()
,with_software_backend()
etc.It also then allows for optional features to be added in the future, such as
with_semantics_handler
, orwith_persistent_cache
.Currently,
FlutterEngine::new
is going to get bloated, one solution is some sort ofFlutterConfig
struct for data that doesn't change, then allowingengine.config().assets()