Skip to content

Support for custom entry point for fl_engine on Linux  #86599

@proninyaroslav

Description

@proninyaroslav

Use case

The basic Flutter API supports running engine from a custom Dart entry point, this is implemented in the FlutterProjectArgs structure (custom_dart_entrypoint).

Android, Windows, macOS, and iOS implement this capability in the platform API. For example, Windows has a FlutterWindowsEngine::RunWithEntrypoint method. Android has a DartExecutor class that allows you to run the Flutter Engine using a custom callback dispatcher as an entry point.

The presence of this feature made it possible to implement the workmanager package, which allows executing Dart code in the background, in a duplicated main Isolate. Without the ability to set a custom entry point, it's impossible to implement this feature in Linux.

Proposal

Add a new fl_engine_start_with_entrypoint() method to fl_engine, or add the dart_entrypoint field to the _FlDartProject structure and the corresponding fl_dart_project_set_dart_entrypoint() method.

I think that the implementation will not be difficult, because it's enough to pass the entry point argument to FlutterProjectArgs structure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: desktopRunning on desktopc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterengineflutter/engine related. See also e: labels.platform-linuxBuilding on or for Linux specificallyteam-linuxOwned by the Linux platform teamtriaged-linuxTriaged by the Linux platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions