@@ -1183,6 +1183,75 @@ void main() {
1183
1183
1184
1184
expect (tester.getSize (find.byType (CircularProgressIndicator )), const Size (36 , 36 ));
1185
1185
});
1186
+
1187
+ testWidgetsWithLeakTracking ('RefreshProgressIndicator using fields correctly' , (WidgetTester tester) async {
1188
+ Future <void > pumpIndicator (RefreshProgressIndicator indicator) {
1189
+ return tester.pumpWidget (Theme (data: theme, child: indicator));
1190
+ }
1191
+
1192
+ // With default values.
1193
+ await pumpIndicator (const RefreshProgressIndicator ());
1194
+ Material material = tester.widget (
1195
+ find.descendant (
1196
+ of: find.byType (RefreshProgressIndicator ),
1197
+ matching: find.byType (Material ),
1198
+ ),
1199
+ );
1200
+ Container container = tester.widget (
1201
+ find.descendant (
1202
+ of: find.byType (RefreshProgressIndicator ),
1203
+ matching: find.byType (Container ),
1204
+ ),
1205
+ );
1206
+ Padding padding = tester.widget (
1207
+ find.descendant (
1208
+ of: find.descendant (
1209
+ of: find.byType (RefreshProgressIndicator ),
1210
+ matching: find.byType (Material ),
1211
+ ),
1212
+ matching: find.byType (Padding ),
1213
+ ),
1214
+ );
1215
+ expect (material.elevation, 2.0 );
1216
+ expect (container.margin, const EdgeInsets .all (4.0 ));
1217
+ expect (padding.padding, const EdgeInsets .all (12.0 ));
1218
+
1219
+ // With values provided.
1220
+ const double testElevation = 1.0 ;
1221
+ const EdgeInsetsGeometry testIndicatorMargin = EdgeInsets .all (6.0 );
1222
+ const EdgeInsetsGeometry testIndicatorPadding = EdgeInsets .all (10.0 );
1223
+ await pumpIndicator (
1224
+ const RefreshProgressIndicator (
1225
+ elevation: testElevation,
1226
+ indicatorMargin: testIndicatorMargin,
1227
+ indicatorPadding: testIndicatorPadding,
1228
+ ),
1229
+ );
1230
+ material = tester.widget (
1231
+ find.descendant (
1232
+ of: find.byType (RefreshProgressIndicator ),
1233
+ matching: find.byType (Material ),
1234
+ ),
1235
+ );
1236
+ container = tester.widget (
1237
+ find.descendant (
1238
+ of: find.byType (RefreshProgressIndicator ),
1239
+ matching: find.byType (Container ),
1240
+ ),
1241
+ );
1242
+ padding = tester.widget (
1243
+ find.descendant (
1244
+ of: find.descendant (
1245
+ of: find.byType (RefreshProgressIndicator ),
1246
+ matching: find.byType (Material ),
1247
+ ),
1248
+ matching: find.byType (Padding ),
1249
+ ),
1250
+ );
1251
+ expect (material.elevation, testElevation);
1252
+ expect (container.margin, testIndicatorMargin);
1253
+ expect (padding.padding, testIndicatorPadding);
1254
+ });
1186
1255
}
1187
1256
1188
1257
class _RefreshProgressIndicatorGolden extends StatefulWidget {
0 commit comments