diff --git a/example/lib/mock_project_db.dart b/example/lib/mock_project_db.dart index 4e02cf3..c02e42e 100644 --- a/example/lib/mock_project_db.dart +++ b/example/lib/mock_project_db.dart @@ -82,6 +82,15 @@ class MockProjectDb implements ProjectDb { ..text = "log_20221202_000000" ]; + // 1x1 transparent pixel + // https://github.com/flutter/flutter/blob/master/packages/flutter_test/test/goldens_test.dart#L14-L20 + Uint8List pngBytes = Uint8List.fromList([ + 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, + 1, 0, 0, 0, 1, 8, 6, 0, 0, 0, 31, 21, 196, 137, 0, 0, 0, 11, 73, 68, 65, 84, + 120, 1, 99, 97, 0, 2, 0, 0, 25, 0, 5, 144, 240, 54, 245, 0, 0, 0, 0, 73, 69, + 78, 68, 174, 66, 96, 130, // avoid flutter format + ]); + @override String getPath() { return "mock/path"; @@ -145,22 +154,22 @@ class MockProjectDb implements ProjectDb { @override Image? getThumbnail(int imageDataId) { - return null; + return Image.memory(pngBytes); } @override Uint8List? getThumbnailBytes(int imageDataId) { - return null; + return pngBytes; } @override Image? getImage(int imageDataId) { - return null; + return Image.memory(pngBytes); } @override Uint8List? getImageDataBytes(int imageDataId) { - return null; + return pngBytes; } @override