@@ -276,12 +276,17 @@ void main() {
276276    await  tester.pumpWidget (
277277      MediaQuery (
278278        data:  const  MediaQueryData (
279-           padding :  EdgeInsets .only (bottom:  20.0 ),
279+           viewPadding :  EdgeInsets .only (bottom:  20.0 ),
280280        ),
281281        child:  child,
282282      ),
283283    );
284284    final  Offset  initialPoint =  tester.getCenter (find.byType (Placeholder ));
285+     expect (
286+       tester.getBottomLeft (find.byType (Placeholder )).dy,
287+       moreOrLessEquals (600.0  -  20.0  -  kFloatingActionButtonMargin)
288+     );
289+ 
285290    // Consume bottom padding - as if by the keyboard opening 
286291    await  tester.pumpWidget (
287292      MediaQuery (
@@ -296,6 +301,37 @@ void main() {
296301    expect (initialPoint, finalPoint);
297302  });
298303
304+   testWidgets ('viewPadding change should trigger _ScaffoldLayout re-layout' , (WidgetTester  tester) async  {
305+     Widget  buildFrame (EdgeInsets  viewPadding) {
306+       return  MediaQuery (
307+         data:  MediaQueryData (
308+           viewPadding:  viewPadding,
309+         ),
310+         child:  Directionality (
311+           textDirection:  TextDirection .ltr,
312+           child:  Scaffold (
313+             resizeToAvoidBottomInset:  false ,
314+             body:  Container (),
315+             floatingActionButton:  const  Placeholder (),
316+           ),
317+         ),
318+       );
319+     }
320+ 
321+     await  tester.pumpWidget (buildFrame (const  EdgeInsets .only (bottom:  300 )));
322+ 
323+     final  RenderBox  renderBox =  tester.renderObject <RenderBox >(find.byType (CustomMultiChildLayout ));
324+     expect (renderBox.debugNeedsLayout, false );
325+ 
326+     await  tester.pumpWidget (
327+       buildFrame (const  EdgeInsets .only (bottom:  400 )),
328+       null ,
329+       EnginePhase .build,
330+     );
331+ 
332+     expect (renderBox.debugNeedsLayout, true );
333+   });
334+ 
299335  testWidgets ('Drawer scrolling' , (WidgetTester  tester) async  {
300336    final  Key  drawerKey =  UniqueKey ();
301337    const  double  appBarHeight =  256.0 ;
0 commit comments