#include <asset_resolver.h>
Definition at line 21 of file asset_resolver.h.
◆ AssetResolverType
Identifies the type of AssetResolver an instance is.
Enumerator |
---|
kAssetManager | |
kApkAssetProvider | |
kDirectoryAssetBundle | |
Definition at line 30 of file asset_resolver.h.
◆ AssetResolver()
flutter::AssetResolver::AssetResolver |
( |
| ) |
|
|
default |
◆ ~AssetResolver()
virtual flutter::AssetResolver::~AssetResolver |
( |
| ) |
|
|
virtualdefault |
◆ as_apk_asset_provider()
virtual const APKAssetProvider * flutter::AssetResolver::as_apk_asset_provider |
( |
| ) |
const |
|
inlinevirtual |
◆ as_asset_manager()
virtual const AssetManager * flutter::AssetResolver::as_asset_manager |
( |
| ) |
const |
|
inlinevirtual |
◆ as_directory_asset_bundle()
◆ GetAsMapping()
virtual std::unique_ptr< fml::Mapping > flutter::AssetResolver::GetAsMapping |
( |
const std::string & |
asset_name | ) |
const |
|
pure virtual |
◆ GetAsMappings()
virtual std::vector< std::unique_ptr< fml::Mapping > > flutter::AssetResolver::GetAsMappings |
( |
const std::string & |
asset_pattern, |
|
|
const std::optional< std::string > & |
subdir |
|
) |
| const |
|
inlinevirtual |
Same as GetAsMapping() but returns mappings for all files who's name matches a given pattern. Returns empty vector if no matching assets are found.
- Parameters
-
[in] | asset_pattern | The pattern to match file names against. |
[in] | subdir | Optional subdirectory in which to search for files. If supplied this function does a flat search within the subdirectory instead of a recursive search through the entire assets directory. |
- Returns
- Returns a vector of mappings of files which match the search parameters.
Reimplemented in flutter::AssetManager, and flutter::testing::TestAssetResolver.
Definition at line 91 of file asset_resolver.h.
◆ GetType()
◆ IsValid()
virtual bool flutter::AssetResolver::IsValid |
( |
| ) |
const |
|
pure virtual |
◆ IsValidAfterAssetManagerChange()
virtual bool flutter::AssetResolver::IsValidAfterAssetManagerChange |
( |
| ) |
const |
|
pure virtual |
Certain asset resolvers are still valid after the asset manager is replaced before a hot reload, or after a new run configuration is created during a hot restart. By preserving these resolvers and re-inserting them into the new resolver or run configuration, the tooling can avoid needing to sync all application assets through the Dart devFS upon connecting to the VM Service. Besides improving the startup performance of running a Flutter application, it also reduces the occurrence of tool failures due to repeated network flakes caused by damaged cables or hereto unknown bugs in the Dart HTTP server implementation.
- Returns
- Returns whether this resolver is valid after the asset manager or run configuration is updated.
Implemented in flutter::AssetManager, flutter::testing::TestAssetResolver, and flutter::testing::ThreadCheckingAssetResolver.
◆ operator!=()
bool flutter::AssetResolver::operator!= |
( |
const AssetResolver & |
other | ) |
const |
|
inline |
Definition at line 98 of file asset_resolver.h.
98 {
100 }
virtual bool operator==(const AssetResolver &other) const =0
◆ operator==()
virtual bool flutter::AssetResolver::operator== |
( |
const AssetResolver & |
other | ) |
const |
|
pure virtual |
The documentation for this class was generated from the following file: