Prepare for utf8.encode() to return more precise Uint8List type (#129769)
To avoid analyzer warnings when utf8.encode() will return the more precise Uint8List type, we use const Utf8Encoder().convert() which already returns Uint8List See https://github.com/dart-lang/sdk/issues/52801
This commit is contained in:
parent
7cab354def
commit
7068a2088e
@ -493,7 +493,7 @@ class WebAssetServer implements AssetReader {
|
||||
|
||||
/// Write a single file into the in-memory cache.
|
||||
void writeFile(String filePath, String contents) {
|
||||
writeBytes(filePath, utf8.encode(contents) as Uint8List);
|
||||
writeBytes(filePath, const Utf8Encoder().convert(contents));
|
||||
}
|
||||
|
||||
void writeBytes(String filePath, Uint8List contents) {
|
||||
|
@ -39,7 +39,7 @@ void main() {
|
||||
|
||||
unawaited(symbolizationService.decode(
|
||||
input: Stream<Uint8List>.fromIterable(<Uint8List>[
|
||||
utf8.encode('Hello, World\n') as Uint8List,
|
||||
const Utf8Encoder().convert('Hello, World\n'),
|
||||
]),
|
||||
symbols: Uint8List(0),
|
||||
output: IOSink(output.sink),
|
||||
|
Loading…
x
Reference in New Issue
Block a user