FlutterDartProject
Objective-C
@interface FlutterDartProject : NSObject
Swift
class FlutterDartProject : NSObject
A set of Flutter and Dart assets used by a FlutterEngine
to initialize execution.
-
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).
Declaration
Objective-C
- (nonnull instancetype)initWithPrecompiledDartBundle: (nullable NSBundle *)bundle;
Swift
init(precompiledDartBundle bundle: Bundle?)
Parameters
bundle
The bundle containing the Flutter assets directory. If nil, the App framework created by Flutter will be used.
-
Unavailable
Use -init instead.
Unavailable - use
init
instead.Declaration
Objective-C
- (nonnull instancetype)initFromDefaultSourceForConfiguration;
-
Returns the default identifier for the bundle where we expect to find the Flutter Dart application.
Declaration
Objective-C
+ (nonnull NSString *)defaultBundleIdentifier;
Swift
class func defaultBundleIdentifier() -> String
-
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.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSArray<NSString *> *dartEntrypointArguments;
-
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
.Declaration
Objective-C
+ (nonnull NSString *)lookupKeyForAsset:(nonnull NSString *)asset;
Swift
class func lookupKey(forAsset asset: String) -> String
Parameters
asset
The name of the asset. The name can be hierarchical.
Return Value
the file name to be used for lookup in the main bundle.
-
Returns the file name for the given asset. The returned file name can be used to access the asset in the supplied bundle.
Declaration
Objective-C
+ (nonnull NSString *)lookupKeyForAsset:(nonnull NSString *)asset fromBundle:(nullable NSBundle *)bundle;
Swift
class func lookupKey(forAsset asset: String, from bundle: Bundle?) -> String
Parameters
asset
The name of the asset. The name can be hierarchical.
bundle
The
NSBundle
to use for looking up the asset.Return Value
the file name to be used for lookup in the main 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 application’s main bundle.
Declaration
Objective-C
+ (nonnull NSString *)lookupKeyForAsset:(nonnull NSString *)asset fromPackage:(nonnull NSString *)package;
Swift
class func lookupKey(forAsset asset: String, fromPackage package: String) -> String
Parameters
asset
The name of the asset. The name can be hierarchical.
package
The name of the package from which the asset originates.
Return Value
the file name to be used for lookup in the main 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.
Declaration
Objective-C
+ (nonnull NSString *)lookupKeyForAsset:(nonnull NSString *)asset fromPackage:(nonnull NSString *)package fromBundle:(nullable NSBundle *)bundle;
Swift
class func lookupKey(forAsset asset: String, fromPackage package: String, from bundle: Bundle?) -> String
Parameters
asset
The name of the asset. The name can be hierarchical.
package
The name of the package from which the asset originates.
bundle
The bundle to use when doing the lookup.
Return Value
the file name to be used for lookup in the main bundle.