Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Fix formatting in BottomAppBar test (#115520)
Browse files Browse the repository at this point in the history
This PR made a few mistakes on formatting: flutter/flutter#115175
  • Loading branch information
bernaferrari committed Nov 18, 2022
1 parent 24865ad commit d2e6dfe
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions packages/flutter/test/material/bottom_app_bar_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ void main() {
);
}, skip: isBrowser); // https://github.com/flutter/flutter/issues/44572


testWidgets('Custom Padding', (WidgetTester tester) async {
const EdgeInsets customPadding = EdgeInsets.all(10);
const EdgeInsets customPadding = EdgeInsets.all(10);
await tester.pumpWidget(
MaterialApp(
theme: ThemeData.from(colorScheme: const ColorScheme.light()),
Expand All @@ -98,10 +97,10 @@ void main() {
alignment: Alignment.bottomCenter,
child: BottomAppBar(
padding: customPadding,
child:ColoredBox(
color:Colors.green,
child:SizedBox(width: 300, height: 60),
),
child: ColoredBox(
color: Colors.green,
child: SizedBox(width: 300, height: 60),
),
),
),
);
Expand All @@ -112,14 +111,14 @@ void main() {

final BottomAppBar bottomAppBar = tester.widget(find.byType(BottomAppBar));
expect(bottomAppBar.padding, customPadding);
final Rect babRect = tester.getRect(find.byType(BottomAppBar));
final Rect childRect = tester.getRect(find.byType(ColoredBox));
final Rect babRect = tester.getRect(find.byType(BottomAppBar));
final Rect childRect = tester.getRect(find.byType(ColoredBox));
expect(childRect, const Rect.fromLTRB(250, 530, 550, 590));
expect(babRect, const Rect.fromLTRB(240, 520, 560, 600));
});

testWidgets('Custom Padding in Material 3', (WidgetTester tester) async {
const EdgeInsets customPadding = EdgeInsets.all(10);
const EdgeInsets customPadding = EdgeInsets.all(10);
await tester.pumpWidget(
MaterialApp(
theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true),
Expand All @@ -130,10 +129,10 @@ void main() {
alignment: Alignment.bottomCenter,
child: BottomAppBar(
padding: customPadding,
child:ColoredBox(
color:Colors.green,
child:SizedBox(width: 300, height: 60),
),
child: ColoredBox(
color: Colors.green,
child: SizedBox(width: 300, height: 60),
),
),
),
);
Expand All @@ -144,8 +143,8 @@ void main() {

final BottomAppBar bottomAppBar = tester.widget(find.byType(BottomAppBar));
expect(bottomAppBar.padding, customPadding);
final Rect babRect = tester.getRect(find.byType(BottomAppBar));
final Rect childRect = tester.getRect(find.byType(ColoredBox));
final Rect babRect = tester.getRect(find.byType(BottomAppBar));
final Rect childRect = tester.getRect(find.byType(ColoredBox));
expect(childRect, const Rect.fromLTRB(250, 530, 550, 590));
expect(babRect, const Rect.fromLTRB(240, 520, 560, 600));
});
Expand Down

0 comments on commit d2e6dfe

Please sign in to comment.