Speed up first asset load by encoding asset manifest in binary rather than JSON (#113637)
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user