From 1d862ec7eaaa3e34a162c53b5d504c11d10543fa Mon Sep 17 00:00:00 2001 From: creativecreatorormaybenot Date: Thu, 9 Sep 2021 21:02:13 +0000 Subject: [PATCH] Document AssetBundle loadString Decoding Behavior (#88822) --- packages/flutter/lib/src/services/asset_bundle.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/flutter/lib/src/services/asset_bundle.dart b/packages/flutter/lib/src/services/asset_bundle.dart index 53659adf577..9d02a728ed6 100644 --- a/packages/flutter/lib/src/services/asset_bundle.dart +++ b/packages/flutter/lib/src/services/asset_bundle.dart @@ -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 loadString(String key, { bool cache = true }) async { final ByteData data = await load(key); if (data == null)