PlatformAssetsPathHandler class abstract
Handler class to open a file from assets directory in the application APK.
Opens the requested file from the application's assets directory.
The matched prefix path used shouldn't be a prefix of a real web path.
Thus, if the requested file cannot be found a WebResourceResponse object with a null data will be returned instead of null.
This saves the time of falling back to network and trying to resolve a path that doesn't exist.
A WebResourceResponse with null data will be received as an HTTP response with status code 404 and no body.
The MIME type for the file will be determined from the file's extension using
guessContentTypeFromName.
Developers should ensure that asset files are named using standard file extensions.
If the file does not have a recognised extension, text/plain will be used by default.
- Inheritance
-
- Object
- PlatformInterface
- PlatformAssetsPathHandler
- Implemented types
- Annotations
-
- @SupportedPlatforms.new(platforms: [AndroidPlatform()])
Constructors
- PlatformAssetsPathHandler(PlatformAssetsPathHandlerCreationParams params)
-
Creates a new PlatformAssetsPathHandler
factory
- PlatformAssetsPathHandler.implementation(PlatformAssetsPathHandlerCreationParams params)
- Used by the platform implementation to create a new PlatformAssetsPathHandler.
- PlatformAssetsPathHandler.static()
-
Creates a new empty PlatformAssetsPathHandler to access static methods.
factory
Properties
- eventHandler ↔ PlatformPathHandlerEvents?
-
Event handler object that handles the PlatformPathHandler events.
latefinalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- params → PlatformAssetsPathHandlerCreationParams
-
The parameters used to initialize the PlatformAssetsPathHandler.
final
- path → String
-
The suffix path to be handled.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → String
-
The path handler type.
no setteroverride
Methods
-
isClassSupported(
{TargetPlatform? platform}) → bool -
Check if the current class is supported by the defaultTargetPlatform or a specific
platform. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
inherited
-
toMap(
{EnumMethod? enumMethod}) → Map< String, dynamic> -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited