Sharing assets with the underlying platform: Loading Flutter assets in iOS
Loading Flutter assets in iOS
On iOS the assets are available via the mainBundle. The lookup key used in, for instance pathForResource:ofType:, is obtained from lookupKeyForAsset or lookupKeyForAsset:fromPackage: on FlutterPluginRegistrar, or lookupKeyForAsset: or lookupKeyForAsset:fromPackage: on FlutterViewController. FlutterPluginRegistrar is available when developing a plugin while FlutterViewController would be the choice when developing an app including a platform view.
To access icons/heart.png from your Objective-C plugin code you would do the following:.