Flutter iOS Embedder
FlutterHeadlessDartRunner Class Reference

#import <FlutterHeadlessDartRunner.h>

Inheritance diagram for FlutterHeadlessDartRunner:
FlutterEngine <FlutterPluginRegistry>

Instance Methods

(instancetype) - initWithName:project:
 
(instancetype) - initWithName:project:allowHeadlessExecution:
 
(instancetype) - initWithName:project:allowHeadlessExecution:restorationEnabled:
 
(instancetype) - NS_SWIFT_UI_ACTOR
 
- Instance Methods inherited from FlutterEngine
(instancetype) - initWithName:
 
(instancetype) - initWithName:project:
 
(instancetype) - initWithName:project:allowHeadlessExecution:
 
(instancetype) - initWithName:project:allowHeadlessExecution:restorationEnabled:
 
(BOOL) - runWithEntrypoint:
 
(BOOL) - runWithEntrypoint:initialRoute:
 
(BOOL) - runWithEntrypoint:libraryURI:
 
(BOOL) - runWithEntrypoint:libraryURI:initialRoute:
 
(BOOL) - runWithEntrypoint:libraryURI:initialRoute:entrypointArgs:
 
(void) - destroyContext
 
(void) - ensureSemanticsEnabled
 
(BOOL isGpuDisabled) - FLUTTER_DEPRECATED
 
(nullable FlutterFMLTaskRunner *) - platformTaskRunner
 
(nullable FlutterFMLTaskRunner *) - uiTaskRunner
 
(nullable FlutterFMLTaskRunner *) - rasterTaskRunner
 
(flutter::Shell &) - shell
 
(flutter::PlatformViewIOS *) - platformView
 
(void) - setBinaryMessenger:
 
(void) - waitForFirstFrame:callback:
 
(FlutterEngine *) - spawnWithEntrypoint:libraryURI:initialRoute:entrypointArgs:
 
(const flutter::ThreadHost &) - threadHost
 
(void) - updateDisplays
 
(void) - sendDisplayWithScreenNativeSize:scale:
 
(void) - flutterTextInputView:performAction:withClient:
 
(void) - sceneWillEnterForeground:
 
(void) - sceneDidEnterBackground:
 
(void) - applicationWillEnterForeground:
 
(void) - applicationDidEnterBackground:
 
(NSString *) - lookupKeyForAsset:
 
(NSString *) - lookupKeyForAsset:fromPackage:
 
- Instance Methods inherited from <FlutterPluginRegistry>
(nullable NSObject< FlutterPluginRegistrar > *) - registrarForPlugin:
 
(BOOL) - hasPlugin:
 
(nullable NSObject *) - valuePublishedByPlugin:
 

Additional Inherited Members

- Properties inherited from FlutterEngine
FlutterViewController * viewController
 
FlutterMethodChannel * localizationChannel
 
FlutterMethodChannel * navigationChannel
 
FlutterMethodChannel * restorationChannel
 
FlutterMethodChannel * platformChannel
 
FlutterMethodChannel * textInputChannel
 
FlutterBasicMessageChannel * lifecycleChannel
 
FlutterBasicMessageChannel * systemChannel
 
FlutterBasicMessageChannel * settingsChannel
 
FlutterBasicMessageChannel * keyEventChannel
 
NSURL * vmServiceUrl
 
NSObject< FlutterBinaryMessenger > * binaryMessenger
 
NSObject< FlutterTextureRegistry > * textureRegistry
 
NSString * isolateId
 
FlutterEngineProcTable & embedderAPI
 
BOOL enableEmbedderAPI
 
BOOL allowHeadlessExecution
 
NSMutableDictionary * pluginPublications
 
FlutterRestorationPlugin * restorationPlugin
 

Detailed Description

The deprecated FlutterHeadlessDartRunner runs Flutter Dart code with a null rasterizer, and no native drawing surface. It is appropriate for use in running Dart code e.g. in the background from a plugin.

Like any FlutterEngine, this class must be created and run on the main thread. See FlutterEngine class documentation.

Most callers should prefer using FlutterEngine directly; this interface exists for legacy support.

Definition at line 37 of file FlutterHeadlessDartRunner.h.

Method Documentation

◆ initWithName:project:

- (instancetype) initWithName: (NSString*)  labelPrefix
project: (FlutterDartProject*)  NS_SWIFT_UI_ACTOR 

Initialize this FlutterHeadlessDartRunner with a FlutterDartProject.

If the FlutterDartProject is not specified, the FlutterHeadlessDartRunner will attempt to locate the project in a default location.

A newly initialized engine will not run the FlutterDartProject until either -runWithEntrypoint: or -runWithEntrypoint:libraryURI is called.

Parameters
labelPrefixThe label prefix used to identify threads for this instance. Should be unique across FlutterEngine instances
projectOrNilThe FlutterDartProject to run.

Definition at line 26 of file FlutterHeadlessDartRunner.mm.

30  :(NSString*)labelPrefix project:(FlutterDartProject*)projectOrNil {
31  return [self initWithName:labelPrefix project:projectOrNil allowHeadlessExecution:YES];
32 }

References initWithName:project:allowHeadlessExecution:.

◆ initWithName:project:allowHeadlessExecution:

- (instancetype) initWithName: (NSString*)  labelPrefix
project: (FlutterDartProject*)  projectOrNil
allowHeadlessExecution: (BOOL)  NS_SWIFT_UI_ACTOR 

Initialize this FlutterHeadlessDartRunner with a FlutterDartProject.

If the FlutterDartProject is not specified, the FlutterHeadlessDartRunner will attempt to locate the project in a default location.

A newly initialized engine will not run the FlutterDartProject until either -runWithEntrypoint: or -runWithEntrypoint:libraryURI is called.

Parameters
labelPrefixThe label prefix used to identify threads for this instance. Should be unique across FlutterEngine instances
projectOrNilThe FlutterDartProject to run.
allowHeadlessExecutionMust be set to YES.

Definition at line 26 of file FlutterHeadlessDartRunner.mm.

34  :(NSString*)labelPrefix
35  project:(FlutterDartProject*)projectOrNil
37  NSAssert(allowHeadlessExecution == YES,
38  @"Cannot initialize a FlutterHeadlessDartRunner without headless execution.");
39  return [self initWithName:labelPrefix
40  project:projectOrNil
41  allowHeadlessExecution:allowHeadlessExecution
42  restorationEnabled:NO];
43 }

Referenced by initWithName:project:.

◆ initWithName:project:allowHeadlessExecution:restorationEnabled:

- (instancetype) initWithName: (NSString*)  labelPrefix
project: (FlutterDartProject*)  projectOrNil
allowHeadlessExecution: (BOOL)  allowHeadlessExecution
restorationEnabled: (BOOL)  NS_SWIFT_UI_ACTOR 

Initialize this FlutterHeadlessDartRunner with a FlutterDartProject.

If the FlutterDartProject is not specified, the FlutterHeadlessDartRunner will attempt to locate the project in a default location.

A newly initialized engine will not run the FlutterDartProject until either -runWithEntrypoint: or -runWithEntrypoint:libraryURI is called.

Parameters
labelPrefixThe label prefix used to identify threads for this instance. Should be unique across FlutterEngine instances
projectOrNilThe FlutterDartProject to run.
allowHeadlessExecutionMust be set to YES.
restorationEnabledMust be set to NO.

Definition at line 26 of file FlutterHeadlessDartRunner.mm.

45  :(NSString*)labelPrefix
46  project:(FlutterDartProject*)projectOrNil
48  restorationEnabled:(BOOL)restorationEnabled {
49  NSAssert(allowHeadlessExecution == YES,
50  @"Cannot initialize a FlutterHeadlessDartRunner without headless execution.");
51  return [super initWithName:labelPrefix
52  project:projectOrNil
53  allowHeadlessExecution:allowHeadlessExecution
54  restorationEnabled:restorationEnabled];
55 }

◆ NS_SWIFT_UI_ACTOR

- (instancetype) NS_SWIFT_UI_ACTOR

Not recommended for use - will initialize with a default label ("io.flutter.headless") and the default FlutterDartProject.

Reimplemented from FlutterEngine.


The documentation for this class was generated from the following files: