Interface FlutterPlugin.FlutterAssets
- Enclosing interface:
- FlutterPlugin
public static interface FlutterPlugin.FlutterAssets
Provides Flutter plugins with access to Flutter asset information.
-
Method Summary
Modifier and TypeMethodDescriptiongetAssetFilePathByName
(String assetFileName) Returns the relative file path to the Flutter asset with the given name, including the file's extension, e.g.,"myImage.jpg"
.getAssetFilePathByName
(String assetFileName, String packageName) Same asgetAssetFilePathByName(String)
but with added support for an explicit AndroidpackageName
.getAssetFilePathBySubpath
(String assetSubpath) Returns the relative file path to the Flutter asset with the given subpath, including the file's extension, e.g.,"/dir1/dir2/myImage.jpg"
.getAssetFilePathBySubpath
(String assetSubpath, String packageName) Same asgetAssetFilePathBySubpath(String)
but with added support for an explicit AndroidpackageName
.
-
Method Details
-
getAssetFilePathByName
Returns the relative file path to the Flutter asset with the given name, including the file's extension, e.g.,"myImage.jpg"
.The returned file path is relative to the Android app's standard assets directory. Therefore, the returned path is appropriate to pass to Android's
AssetManager
, but the path is not appropriate to load as an absolute path. -
getAssetFilePathByName
Same asgetAssetFilePathByName(String)
but with added support for an explicit AndroidpackageName
. -
getAssetFilePathBySubpath
Returns the relative file path to the Flutter asset with the given subpath, including the file's extension, e.g.,"/dir1/dir2/myImage.jpg"
.The returned file path is relative to the Android app's standard assets directory. Therefore, the returned path is appropriate to pass to Android's
AssetManager
, but the path is not appropriate to load as an absolute path. -
getAssetFilePathBySubpath
Same asgetAssetFilePathBySubpath(String)
but with added support for an explicit AndroidpackageName
.
-