File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
packages/flutter/test/material Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -2033,6 +2033,36 @@ void main() {
20332033 );
20342034 await tester.pumpAndSettle ();
20352035 });
2036+
2037+ testWidgets ('Floating Button' , (WidgetTester tester) async {
2038+ await tester.pumpWidget (MaterialApp (
2039+ home: Scaffold (
2040+ appBar: AppBar (),
2041+ floatingActionButton: FloatingActionButton (
2042+ onPressed: () {},
2043+ child: const Icon (Icons .add),
2044+ ),
2045+ floatingActionButtonLocation: FloatingActionButtonLocation .endTop,
2046+ extendBodyBehindAppBar: false ,
2047+ ),
2048+ ));
2049+ final Offset center0 = tester.getCenter (find.byType (FloatingActionButton ));
2050+
2051+ await tester.pumpWidget (MaterialApp (
2052+ home: Scaffold (
2053+ appBar: AppBar (),
2054+ floatingActionButton: FloatingActionButton (
2055+ onPressed: () {},
2056+ child: const Icon (Icons .add),
2057+ ),
2058+ floatingActionButtonLocation: FloatingActionButtonLocation .endTop,
2059+ extendBodyBehindAppBar: true ,
2060+ ),
2061+ ));
2062+ final Offset center1 = tester.getCenter (find.byType (FloatingActionButton ));
2063+
2064+ expect (center0.dy, center1.dy);
2065+ });
20362066 });
20372067}
20382068
You can’t perform that action at this time.
0 commit comments