flutter / put-flutter-to-work

A Flutter add-to-app demo you can try with your own apps
BSD 3-Clause "New" or "Revised" License
321 stars 38 forks source link

[DEMO] Add FlutterAppDelegate to SwiftUI project #165

Closed hellohuanlin closed 1 year ago

hellohuanlin commented 1 year ago

Description

The current implementation is a default SwiftUI project without an App Delegate.

This PR contains 2 commits:

  1. use FlutterAppDelegate for add-to-app SwiftUI project;
  2. use a AppDelegate conforming to FlutterAppLifeCycleProvider (if developers can't subclass from FlutterAppDelegate)

EDIT:

This is for DEMO (and documentation) purpose, but in the future we probably want to keep 3 separate implementations:

Type of Change

hellohuanlin commented 1 year ago

FYI @leighajarett the first commit of this PR is basically following your new instruction.

I will keep this PR open for documentation purpose and not land it. But in the future we probably want to keep 3 separate implementations:

  1. without App Delegate
  2. with FlutterAppDelegate subclass (1st commit of this PR)
  3. with a App Delegate conforming to FlutterAppLifeCycleProvider (2nd commit of this PR)