-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
As of flutter/engine#35285, the public Windows C API and the C++ client wrapper that provides a more user-friendly OO expression of that API allow the user to specify a custom Dart entrypoint (alternative to main()) in the FlutterDesktopEngineProperties struct used to configure an engine.
This results in a slightly unclean API for custom entrypoints, since there are now two ways to specify one:
- Via the
FlutterDesktopEnginePropertiesstruct, which has also althe dart entrypoint arguments array - As a parameter to
FlutterDesktopEngineRun; however this older mechanism was fairly unusable in practice -- see below.
We should eliminate the entrypoint argument to FlutterDesktopEngineRun. In practice, this probably means adding an alternative to FlutterDesktopEngineRun without an entrypoint argument, then deprecating and eventually removing the original function after a grace period to allow any users of the old API to migrate.
In practice, it's likely that fewer than a dozen people will be affected by such a change since our app templates never specify a custom entrypoint, and therefore never interact directly with a FlutterEngine object other than to instantiate it and pass it to a view controller. This limits affected developers to those who have wrapped the Windows C API such as @knopp and @timsneath. I'd be interested to hear their opinions on the above migration strategy.
Background
The motivation for flutter/engine#35285 was that the entrypoint arguments array that populates the List<String> passed to the entrypoint function was always passed through the engine properties struct, but the entrypoint was passed as a parameter to FlutterDesktopEngineRun. However, invoking FlutterDesktopEngineRun without having done view controller setup to set up graphics results in runtime errors. However, setting up a view controller involves calling FlutterViewControllerCreate(..., engine) which immediately launches the engine via the default entrypoint, which made the previous entrypoint configuration painful to use. See: #93537.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status