Skip to content

Commit 5547411

Browse files
author
Ivan Dlugos
committed
fix generator test runner after a dependency update
1 parent b571130 commit 5547411

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

generator/test/helpers.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,16 @@ class _SingleFileAssetReader extends AssetReader {
3838
}
3939

4040
Future<bool> canRead(AssetId id) async => true; //this.id == id;
41-
Future<List<int>> readAsBytes(AssetId id) => throw UnimplementedError();
42-
Stream<AssetId> findAssets(Glob glob, {String package}) => Stream.fromIterable([id]); // throw UnimplementedError();
41+
42+
Stream<AssetId> findAssets(Glob glob, {String package}) => Stream.fromIterable([id]);
43+
44+
@override
45+
Future<List<int>> readAsBytes(AssetId id) async => utf8.encode(await readAsString(id));
4346

4447
@override
4548
Future<String> readAsString(AssetId id, {Encoding encoding = utf8}) async {
4649
if (id.package != "objectbox" && id.package != "objectbox_generator") return "";
50+
if (id.path.endsWith(".g.dart")) return "";
4751

4852
String path = id.path;
4953
if (id.package == "objectbox") path = "../" + path;

0 commit comments

Comments
 (0)