@@ -38,8 +38,10 @@ void main() {
38
38
),
39
39
),
40
40
);
41
- expect (tester.takeException ().toString (),
42
- contains ('Could not find remote widget named' ));
41
+ expect (
42
+ tester.takeException ().toString (),
43
+ contains ('Could not find remote widget named' ),
44
+ );
43
45
44
46
runtime.update (const LibraryName (< String > ['test' ]), parseLibraryFile ('''
45
47
import core;
@@ -225,6 +227,82 @@ void main() {
225
227
);
226
228
});
227
229
230
+ testWidgets ('Implement ButtonBar properties' , (WidgetTester tester) async {
231
+ final Runtime runtime = setupRuntime ();
232
+ final DynamicContent data = DynamicContent ();
233
+ final List <String > eventLog = < String > [];
234
+ await tester.pumpWidget (
235
+ MaterialApp (
236
+ theme: ThemeData (useMaterial3: false ),
237
+ home: RemoteWidget (
238
+ runtime: runtime,
239
+ data: data,
240
+ widget: const FullyQualifiedWidgetName (testName, 'root' ),
241
+ onEvent: (String eventName, DynamicMap eventArguments) {
242
+ eventLog.add ('$eventName $eventArguments ' );
243
+ },
244
+ ),
245
+ ),
246
+ );
247
+ expect (
248
+ tester.takeException ().toString (),
249
+ contains ('Could not find remote widget named' ),
250
+ );
251
+
252
+ addTearDown (() async {
253
+ await tester.binding.setSurfaceSize (null );
254
+ });
255
+
256
+ runtime.update (testName, parseLibraryFile ('''
257
+ import core;
258
+ import material;
259
+ widget root = Scaffold(
260
+ body: Center(
261
+ child: ButtonBar(
262
+ buttonPadding: [8.0],
263
+ layoutBehavior: 'constrained',
264
+ alignment: 'end',
265
+ overflowDirection: 'up',
266
+ overflowButtonSpacing: 8.0,
267
+ mainAxisSize: 'min',
268
+ children: [
269
+ ElevatedButton(
270
+ onPressed: event 'button' { },
271
+ child: Text(text: 'Elevated'),
272
+ ),
273
+ OutlinedButton(
274
+ onPressed: event 'button' { },
275
+ child: Text(text: 'Outlined'),
276
+ ),
277
+ TextButton(
278
+ onPressed: event 'button' { },
279
+ child: Text(text: 'Text'),
280
+ ),
281
+ ],
282
+ ),
283
+ ),
284
+ );
285
+ ''' ));
286
+ await tester.pump ();
287
+
288
+ await expectLater (
289
+ find.byType (RemoteWidget ),
290
+ matchesGoldenFile ('goldens/material_test.button_bar_properties.png' ),
291
+ skip: ! runGoldens,
292
+ );
293
+
294
+ // Update the surface size for ButtonBar to overflow.
295
+ await tester.binding.setSurfaceSize (const Size (200.0 , 600.0 ));
296
+ await tester.pump ();
297
+
298
+ await expectLater (
299
+ find.byType (RemoteWidget ),
300
+ matchesGoldenFile (
301
+ 'goldens/material_test.button_bar_properties.overflow.png' ),
302
+ skip: ! runGoldens,
303
+ );
304
+ });
305
+
228
306
testWidgets ('OverflowBar configured to resemble ButtonBar' ,
229
307
(WidgetTester tester) async {
230
308
final Runtime runtime = setupRuntime ();
@@ -243,8 +321,10 @@ void main() {
243
321
),
244
322
),
245
323
);
246
- expect (tester.takeException ().toString (),
247
- contains ('Could not find remote widget named' ));
324
+ expect (
325
+ tester.takeException ().toString (),
326
+ contains ('Could not find remote widget named' ),
327
+ );
248
328
249
329
runtime.update (testName, parseLibraryFile ('''
250
330
import core;
@@ -301,8 +381,10 @@ void main() {
301
381
),
302
382
),
303
383
);
304
- expect (tester.takeException ().toString (),
305
- contains ('Could not find remote widget named' ));
384
+ expect (
385
+ tester.takeException ().toString (),
386
+ contains ('Could not find remote widget named' ),
387
+ );
306
388
307
389
addTearDown (() async {
308
390
await tester.binding.setSurfaceSize (null );
0 commit comments