Flutter Engine
 
Loading...
Searching...
No Matches
FlutterDartProject Class Reference

#include <FlutterDartProject.h>

Inheritance diagram for FlutterDartProject:

Instance Methods

(instancetype) - initWithPrecompiledDartBundle:
 
("Use -init instead.") - FLUTTER_UNAVAILABLE
 
(NSArray< NSString * > *dartEntrypointArguments) - API_UNAVAILABLE
 
(instancetype) - initWithSettings: [implementation]
 
(const flutter::Settings &) - settings [implementation]
 
(const flutter::PlatformData- defaultPlatformData [implementation]
 
(flutter::RunConfiguration- runConfiguration [implementation]
 
(flutter::RunConfiguration- runConfigurationForEntrypoint: [implementation]
 
(flutter::RunConfiguration- runConfigurationForEntrypoint:libraryOrNil: [implementation]
 
(flutter::RunConfiguration- runConfigurationForEntrypoint:libraryOrNil:entrypointArgs: [implementation]
 
(nonnull instancetype) - initWithAssetsPath:ICUDataPath: [implementation]
 

Class Methods

(NSString *) + defaultBundleIdentifier
 
(NSString *) + lookupKeyForAsset:
 
(NSString *) + lookupKeyForAsset:fromBundle:
 
(NSString *) + lookupKeyForAsset:fromPackage:
 
(NSString *) + lookupKeyForAsset:fromPackage:fromBundle:
 
(NSString *) + flutterAssetsName: [implementation]
 
(NSString *) + domainNetworkPolicy: [implementation]
 
(bool) + allowsArbitraryLoads: [implementation]
 
(NSString *) + flutterAssetsNameWithBundle: [implementation]
 

Properties

BOOL isWideGamutEnabled [implementation]
 
NSString * assetsPath [implementation]
 
NSString * ICUDataPath [implementation]
 
void(* rootIsolateCreateCallback )(void *_Nullable) [implementation]
 
BOOL enableImpeller [implementation]
 
BOOL enableFlutterGPU [implementation]
 

Detailed Description

A set of Flutter and Dart assets used by a FlutterEngine to initialize execution.

Definition at line 19 of file FlutterDartProject.h.

Method Documentation

◆ allowsArbitraryLoads:

+ (bool) allowsArbitraryLoads: (NSDictionary *)  appTransportSecurity
implementation

Provided by category FlutterDartProject().

◆ API_UNAVAILABLE

- (NSArray< NSString * > *dartEntrypointArguments) API_UNAVAILABLE (ios) 

An NSArray of NSStrings to be passed as command line arguments to the Dart entrypoint.

If this is not explicitly set, this will default to the contents of [NSProcessInfo arguments], without the binary name.

Set this to nil to pass no arguments to the Dart entrypoint.

◆ defaultBundleIdentifier

◆ defaultPlatformData

- (const PlatformData FlutterDartProject()):
implementation

Provided by category FlutterDartProject().

◆ domainNetworkPolicy:

+ (NSString *) domainNetworkPolicy: (NSDictionary *)  appTransportSecurity
implementation

Provided by category FlutterDartProject().

◆ FLUTTER_UNAVAILABLE

- ("Use -init instead.") FLUTTER_UNAVAILABLE

Unavailable - use init instead.

◆ flutterAssetsName:

+ (NSString *) flutterAssetsName: (NSBundle *)  bundle
implementation

Provided by category FlutterDartProject().

◆ flutterAssetsNameWithBundle:

+ (NSString *) flutterAssetsNameWithBundle: (NSBundle *)  bundle
implementation

Get the Flutter assets name path by pass the bundle. If bundle is nil, we use the main bundle as default.

Provided by category FlutterDartProject().

◆ initWithAssetsPath:ICUDataPath:

- (nonnull instancetype) initWithAssetsPath: (nonnull NSString *)  assets
ICUDataPath: (nonnull NSString *)  NS_DESIGNATED_INITIALIZER 
implementation

Instead of looking up the assets and ICU data path in the application bundle, this initializer allows callers to create a Dart project with custom locations specified for the both.

Provided by category FlutterDartProject().

◆ initWithPrecompiledDartBundle:

- (instancetype) initWithPrecompiledDartBundle: (nullable NSBundle*)  NS_DESIGNATED_INITIALIZER

Initializes a Flutter Dart project from a bundle.

The bundle must either contain a flutter_assets resource directory, or set the Info.plist key FLTAssetsPath to override that name (if you are doing a custom build using a different name).

Parameters
bundleThe bundle containing the Flutter assets directory. If nil, the App framework created by Flutter will be used.

Definition at line 42 of file FlutterDartProject.mm.

285 :(nullable NSBundle*)bundle {
286 self = [super init];
287
288 if (self) {
289 _settings = FLTDefaultSettingsForBundle(bundle);
290 }
291
292 return self;
293}
flutter::Settings FLTDefaultSettingsForBundle(NSBundle *bundle, NSProcessInfo *processInfoOrNil)

◆ initWithSettings:

- (instancetype) initWithSettings: (const flutter::Settings &)  settings
implementation

This is currently used for only for tests to override settings.

Provided by category FlutterDartProject().

◆ lookupKeyForAsset:

+ (NSString *) lookupKeyForAsset: (NSString*)  asset

Returns the file name for the given asset. If the bundle with the identifier "io.flutter.flutter.app" exists, it will try use that bundle; otherwise, it will use the main bundle. To specify a different bundle, use +lookupKeyForAsset:fromBundle.

Parameters
assetThe name of the asset. The name can be hierarchical.
Returns
the file name to be used for lookup in the main bundle.

Definition at line 42 of file FlutterDartProject.mm.

394 :(NSString*)asset {
395 return [self lookupKeyForAsset:asset fromBundle:nil];
396}

◆ lookupKeyForAsset:fromBundle:

+ (NSString *) lookupKeyForAsset: (NSString*)  asset
fromBundle: (nullable NSBundle*)  bundle 

Returns the file name for the given asset. The returned file name can be used to access the asset in the supplied bundle.

Parameters
assetThe name of the asset. The name can be hierarchical.
bundleThe NSBundle to use for looking up the asset.
Returns
the file name to be used for lookup in the main bundle.

Definition at line 42 of file FlutterDartProject.mm.

398 :(NSString*)asset fromBundle:(nullable NSBundle*)bundle {
399 NSString* flutterAssetsName = [FlutterDartProject flutterAssetsName:bundle];
400 return [NSString stringWithFormat:@"%@/%@", flutterAssetsName, asset];
401}

◆ lookupKeyForAsset:fromPackage:

+ (NSString *) lookupKeyForAsset: (NSString*)  asset
fromPackage: (NSString*)  package 

Returns the file name for the given asset which originates from the specified package. The returned file name can be used to access the asset in the application's main bundle.

Parameters
assetThe name of the asset. The name can be hierarchical.
packageThe name of the package from which the asset originates.
Returns
the file name to be used for lookup in the main bundle.

Definition at line 42 of file FlutterDartProject.mm.

403 :(NSString*)asset fromPackage:(NSString*)package {
404 return [self lookupKeyForAsset:asset fromPackage:package fromBundle:nil];
405}

◆ lookupKeyForAsset:fromPackage:fromBundle:

+ (NSString *) lookupKeyForAsset: (NSString*)  asset
fromPackage: (NSString*)  package
fromBundle: (nullable NSBundle*)  bundle 

Returns the file name for the given asset which originates from the specified package. The returned file name can be used to access the asset in the specified bundle.

Parameters
assetThe name of the asset. The name can be hierarchical.
packageThe name of the package from which the asset originates.
bundleThe bundle to use when doing the lookup.
Returns
the file name to be used for lookup in the main bundle.

Definition at line 42 of file FlutterDartProject.mm.

407 :(NSString*)asset
408 fromPackage:(NSString*)package
409 fromBundle:(nullable NSBundle*)bundle {
410 return [self lookupKeyForAsset:[NSString stringWithFormat:@"packages/%@/%@", package, asset]
411 fromBundle:bundle];
412}

◆ runConfiguration

- (RunConfiguration FlutterDartProject()):
implementation

Provided by category FlutterDartProject().

◆ runConfigurationForEntrypoint:

- (RunConfiguration FlutterDartProject()): (nullable NSString *)  entrypointOrNil
implementation

Provided by category FlutterDartProject().

◆ runConfigurationForEntrypoint:libraryOrNil:

- (RunConfiguration FlutterDartProject()): (nullable NSString *)  entrypointOrNil
libraryOrNil: (nullable NSString *)  dartLibraryOrNil 
implementation

Provided by category FlutterDartProject().

◆ runConfigurationForEntrypoint:libraryOrNil:entrypointArgs:

- (RunConfiguration FlutterDartProject()): (nullable NSString *)  entrypointOrNil
libraryOrNil: (nullable NSString *)  dartLibraryOrNil
entrypointArgs: (nullable NSArray< NSString * > *)  entrypointArgs 
implementation

Provided by category FlutterDartProject().

◆ settings

- (const Settings & FlutterDartProject()):
implementation

Provided by category FlutterDartProject().

Property Documentation

◆ assetsPath

- (NSString*) assetsPath
readnonatomicassignimplementation

The path to the Flutter assets directory.

Provided by category FlutterDartProject().

Definition at line 22 of file FlutterDartProject_Internal.h.

◆ enableFlutterGPU

- (BOOL) enableFlutterGPU
readnonatomicassignimplementation

Whether Flutter GPU is enabled

Provided by category FlutterDartProject().

Definition at line 42 of file FlutterDartProject_Internal.h.

◆ enableImpeller

- (BOOL) enableImpeller
readnonatomicassignimplementation

Whether the Impeller rendering backend is enabled

Provided by category FlutterDartProject().

Definition at line 37 of file FlutterDartProject_Internal.h.

◆ ICUDataPath

- (NSString*) ICUDataPath
readnonatomicassignimplementation

The path to the ICU data file.

Provided by category FlutterDartProject().

Definition at line 27 of file FlutterDartProject_Internal.h.

◆ isWideGamutEnabled

- (BOOL) isWideGamutEnabled
readnonatomicassignimplementation

Provided by category FlutterDartProject().

Definition at line 21 of file FlutterDartProject_Internal.h.

◆ rootIsolateCreateCallback

- (void(* rootIsolateCreateCallback) (void *_Nullable))
readwritenonatomicassignimplementation

The callback invoked by the engine in root isolate scope.

Provided by category FlutterDartProject().

Definition at line 32 of file FlutterDartProject_Internal.h.

Referenced by flutter::testing::TEST_F(), and flutter::testing::TEST_F().


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