@@ -15,7 +15,7 @@ import 'package:image/image.dart';
15
15
///
16
16
/// This function loads the scene image from the [file] , extracts each individual golden
17
17
/// image from the scene, and then returns all of those golden images as a [GoldenCollection] .
18
- GoldenCollection extractGoldenCollectionFromSceneFile (File file) {
18
+ ( GoldenCollection , GoldenSceneMetadata ) extractGoldenCollectionFromSceneFile (File file) {
19
19
FtgLog .pipeline.fine ("Extracting golden collection from golden image." );
20
20
21
21
// Read the scene PNG data into memory.
@@ -38,7 +38,7 @@ GoldenCollection extractGoldenCollectionFromSceneFile(File file) {
38
38
}
39
39
40
40
// Extract the golden images from the scene image.
41
- return _extractCollectionFromScene (sceneMetadata, sceneImage);
41
+ return ( _extractCollectionFromScene (sceneMetadata, sceneImage), sceneMetadata );
42
42
}
43
43
44
44
/// Extracts a [GoldenCollection] from a golden scene within the current widget tree.
@@ -100,10 +100,7 @@ GoldenCollection _extractCollectionFromScene(GoldenSceneMetadata sceneMetadata,
100
100
);
101
101
}
102
102
103
- return GoldenCollection (
104
- goldenImages,
105
- metadata: sceneMetadata,
106
- );
103
+ return GoldenCollection (goldenImages);
107
104
}
108
105
109
106
RenderRepaintBoundary ? _findNearestRepaintBoundary (Finder bounds) {
@@ -131,6 +128,7 @@ RenderRepaintBoundary? _findNearestRepaintBoundary(Finder bounds) {
131
128
class GoldenSceneMetadata {
132
129
static GoldenSceneMetadata fromJson (Map <String , dynamic > json) {
133
130
return GoldenSceneMetadata (
131
+ description: json["description" ] ?? "" ,
134
132
images: [
135
133
for (final imageJson in (json["images" ] as List <dynamic >)) //
136
134
GoldenImageMetadata .fromJson (imageJson),
@@ -139,13 +137,16 @@ class GoldenSceneMetadata {
139
137
}
140
138
141
139
const GoldenSceneMetadata ({
140
+ required this .description,
142
141
required this .images,
143
142
});
144
143
144
+ final String description;
145
145
final List <GoldenImageMetadata > images;
146
146
147
147
Map <String , dynamic > toJson () {
148
148
return {
149
+ "description" : description,
149
150
"images" : images.map ((image) => image.toJson ()).toList (growable: false ),
150
151
};
151
152
}
0 commit comments