In Xcode, select File -> New -> Target from the menu bar.

Select the app extension you intend to add.
This selection generates extension-specific code 
within a new folder in your project.
To learn more about the generated code and the SDKs for each
extension point, check out the resources in
Apple’s documentation.

How do Flutter apps interact with App Extensions?

Flutter apps interact with app extensions using the same
techniques as UIKit or SwiftUI apps.
The containing app and the app extension don’t communicate directly.
The containing app might not be running while the device user interacts with the extension.
The app and your extension can read and write to shared resources or
use higher-level APIs to communicate with each other.

Using higher-level APIs

Some extensions have APIs. For example, 
the Core Spotlight framework indexes your app 
allowing users to search from Spotlight and Safari. The
WidgetKit framework can trigger an update of your home screen
widget.