mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Document AssetBundle loadString Decoding Behavior (#88822)
This commit is contained in:
parent
52b49427de
commit
1d862ec7ea
@ -62,8 +62,12 @@ abstract class AssetBundle {
|
||||
/// If the `cache` argument is set to false, then the data will not be
|
||||
/// cached, and reading the data may bypass the cache. This is useful if the
|
||||
/// caller is going to be doing its own caching. (It might not be cached if
|
||||
/// it's set to true either, that depends on the asset bundle
|
||||
/// implementation.)
|
||||
/// it's set to true either, depending on the asset bundle implementation.)
|
||||
///
|
||||
/// The function expects the stored string to be UTF-8-encoded as
|
||||
/// [Utf8Codec] will be used for decoding the string. If the string is
|
||||
/// larger than 50 KB, the decoding process is delegated to an
|
||||
/// isolate to avoid jank on the main thread.
|
||||
Future<String> loadString(String key, { bool cache = true }) async {
|
||||
final ByteData data = await load(key);
|
||||
if (data == null)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user