Skip to content

Add a FlutterEngine cleanup method to FlutterActivity and FlutterFragment #41943

@matthew-carroll

Description

@matthew-carroll

Add a FlutterEngine cleanup method to FlutterActivity and FlutterFragment.

There is an existing method called configureFlutterEngine(engine) where developers register plugins and do any other configuration they want to a FlutterEngine. This method is invoked from from onCreate() in FlutterActivity and onAttach() in FlutterFragment. This makes it difficult to effectively document the correct place to clean up FlutterEngine references, e.g, a channel that is no longer needed.

To remedy this, we should introduce something like a teardownFlutterEngine(engine) method that gives FlutterActivity and FlutterFragment an explicit opportunity to clean up references that were established in configureFlutterEngine(engine).

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: contributor-productivityTeam-specific productivity, code health, technical debt.engineflutter/engine related. See also e: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions