Speed up first asset load by encoding asset manifest in binary rather than JSON (#113637)

This commit is contained in:
Andrew Kolos
2022-12-05 10:39:10 -08:00
committed by GitHub
parent d52e2de5bf
commit 56cad89b1e
14 changed files with 2065 additions and 907 deletions

View File

@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:flutter_gallery/gallery/example_code_parser.dart';
import 'package:flutter_test/flutter_test.dart';
@@ -58,4 +60,9 @@ class TestAssetBundle extends AssetBundle {
@override
String toString() => '$runtimeType@$hashCode()';
@override
Future<T> loadStructuredBinaryData<T>(String key, FutureOr<T> Function(ByteData data) parser) async {
return parser(await load(key));
}
}