1
+ import 'package:flutter/cupertino.dart' ;
1
2
import 'package:flutter/material.dart' show Colors;
2
3
import 'package:flutter/widgets.dart' ;
3
4
import 'package:flutter_test/flutter_test.dart' ;
@@ -71,14 +72,20 @@ class GridGoldenScene extends StatelessWidget {
71
72
}
72
73
73
74
items.add (
74
- _buildItem (
75
- context,
76
- entries[index].key.metadata,
77
- Image .memory (
78
- key: entries[index].value,
79
- entries[index].key.pngBytes,
80
- width: entries[index].key.size.width,
81
- height: entries[index].key.size.height,
75
+ Padding (
76
+ padding: EdgeInsets .only (
77
+ top: row > 0 ? defaultGridSpacing.between : 0 ,
78
+ left: col > 0 ? defaultGridSpacing.between : 0 ,
79
+ ),
80
+ child: _buildItem (
81
+ context,
82
+ entries[index].key.metadata,
83
+ Image .memory (
84
+ key: entries[index].value,
85
+ entries[index].key.pngBytes,
86
+ width: entries[index].key.size.width,
87
+ height: entries[index].key.size.height,
88
+ ),
82
89
),
83
90
),
84
91
);
@@ -96,37 +103,13 @@ class GridGoldenScene extends StatelessWidget {
96
103
child: GoldenSceneBounds (
97
104
child: ColoredBox (
98
105
color: Colors .white,
99
- child: Table (
100
- defaultColumnWidth: IntrinsicColumnWidth (),
101
- children: rows,
106
+ child: Padding (
107
+ padding: spacing.around,
108
+ child: Table (
109
+ defaultColumnWidth: IntrinsicColumnWidth (),
110
+ children: rows,
111
+ ),
102
112
),
103
- // child: ConstrainedBox(
104
- // constraints: BoxConstraints(maxWidth: maxWidth),
105
- // // ^ We have to constrain the width due to the vertical scrolling viewport in the
106
- // // the GridView.
107
- // // TODO: Use some other grid implementation that doesn't include scrolling.
108
- // child: GridView(
109
- // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
110
- // mainAxisSpacing: 0,
111
- // crossAxisCount: 3,
112
- // crossAxisSpacing: 0,
113
- // ),
114
- // shrinkWrap: true,
115
- // padding: const EdgeInsets.all(0),
116
- // children: [
117
- // for (final entry in goldens.entries)
118
- // ColoredBox(
119
- // color: Colors.green,
120
- // child: Image.memory(
121
- // key: entry.value,
122
- // entry.key.pngBytes,
123
- // width: entry.key.size.width,
124
- // height: entry.key.size.height,
125
- // ),
126
- // ),
127
- // ],
128
- // ),
129
- // ),
130
113
),
131
114
),
132
115
);
0 commit comments