@@ -38,8 +38,10 @@ void main() {
3838 ),
3939 ),
4040 );
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+ );
4345
4446 runtime.update (const LibraryName (< String > ['test' ]), parseLibraryFile ('''
4547 import core;
@@ -225,6 +227,82 @@ void main() {
225227 );
226228 });
227229
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+
228306 testWidgets ('OverflowBar configured to resemble ButtonBar' ,
229307 (WidgetTester tester) async {
230308 final Runtime runtime = setupRuntime ();
@@ -243,8 +321,10 @@ void main() {
243321 ),
244322 ),
245323 );
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+ );
248328
249329 runtime.update (testName, parseLibraryFile ('''
250330 import core;
@@ -301,8 +381,10 @@ void main() {
301381 ),
302382 ),
303383 );
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+ );
306388
307389 addTearDown (() async {
308390 await tester.binding.setSurfaceSize (null );
0 commit comments