diff --git a/packages/flutter/lib/src/material/banner.dart b/packages/flutter/lib/src/material/banner.dart index 80312cdaf6..81f894cf04 100644 --- a/packages/flutter/lib/src/material/banner.dart +++ b/packages/flutter/lib/src/material/banner.dart @@ -117,7 +117,7 @@ class MaterialBanner extends StatelessWidget { ? const EdgeInsetsDirectional.only(start: 16.0, top: 2.0) : const EdgeInsetsDirectional.only(start: 16.0, top: 24.0, end: 16.0, bottom: 4.0)); final EdgeInsetsGeometry leadingPadding = this.leadingPadding - ?? bannerTheme.padding + ?? bannerTheme.leadingPadding ?? const EdgeInsetsDirectional.only(end: 16.0); final Widget buttonBar = ButtonBar( diff --git a/packages/flutter/test/material/banner_theme_test.dart b/packages/flutter/test/material/banner_theme_test.dart index 882d396f39..a45796085c 100644 --- a/packages/flutter/test/material/banner_theme_test.dart +++ b/packages/flutter/test/material/banner_theme_test.dart @@ -101,9 +101,9 @@ void main() { final Offset containerTopLeft = tester.getTopLeft(_containerFinder()); final Offset leadingTopLeft = tester.getTopLeft(find.byIcon(Icons.ac_unit)); expect(contentTopLeft.dy - containerTopLeft.dy, 24); - expect(contentTopLeft.dx - containerTopLeft.dx, 39); + expect(contentTopLeft.dx - containerTopLeft.dx, 41); expect(leadingTopLeft.dy - containerTopLeft.dy, 19); - expect(leadingTopLeft.dx - containerTopLeft.dx, 10); + expect(leadingTopLeft.dx - containerTopLeft.dx, 11); }); testWidgets('MaterialBanner widget properties take priority over theme', (WidgetTester tester) async { @@ -120,7 +120,7 @@ void main() { contentTextStyle: textStyle, content: const Text(contentText), padding: const EdgeInsets.all(10), - leadingPadding: const EdgeInsets.all(10), + leadingPadding: const EdgeInsets.all(12), actions: [ TextButton( child: const Text('Action'), @@ -140,9 +140,9 @@ void main() { final Offset containerTopLeft = tester.getTopLeft(_containerFinder()); final Offset leadingTopLeft = tester.getTopLeft(find.byIcon(Icons.ac_unit)); expect(contentTopLeft.dy - containerTopLeft.dy, 29); - expect(contentTopLeft.dx - containerTopLeft.dx, 54); + expect(contentTopLeft.dx - containerTopLeft.dx, 58); expect(leadingTopLeft.dy - containerTopLeft.dy, 24); - expect(leadingTopLeft.dx - containerTopLeft.dx, 20); + expect(leadingTopLeft.dx - containerTopLeft.dx, 22); }); testWidgets('MaterialBanner uses color scheme when necessary', (WidgetTester tester) async { @@ -172,7 +172,7 @@ MaterialBannerThemeData _bannerTheme() { backgroundColor: Colors.orange, contentTextStyle: TextStyle(color: Colors.pink), padding: EdgeInsets.all(5), - leadingPadding: EdgeInsets.all(5), + leadingPadding: EdgeInsets.all(6), ); }