Skip to content

Commit 22729f4

Browse files
committed
Add test code
1 parent 167bc2f commit 22729f4

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

packages/flutter/test/material/scaffold_test.dart

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)