From 22cbef305035573671297172c9204f01d210d380 Mon Sep 17 00:00:00 2001 From: Eilidh Southren Date: Fri, 2 Dec 2022 20:17:20 +0000 Subject: [PATCH] [CP] Fix Snackbar TalkBack regression (#116417) * Add M2 defaults and template skeleton * add MaterialStateColor functionality to ActionTextColor (issue #110402) * Add M2 defaults and template skeleton * updated material 3 tokens * Updated snackbar demo * add theme tests * add gen defaults * formatting * more whitespace fixes * add widget type * update docs * code review changes * Add line overflow functionality * whitespace fixes * update M3 animation * whitespace fixes * add insetPadding param * Modifed icon parameter to showCloseIcon * white space fixes * test fixes * rename iconColor to closeIconColor * debug test fix * de-britishification * g3fix * g3fix * debug test fix * Fix Snackbar talkback regression * fix merge weirdness * test fix * fix linux analysis error * fix linux analysis error * fix linux analysis error * fix linux analysis error * fix linux analysis error * fix linux analysis error --- .../flutter/lib/src/material/snack_bar.dart | 6 ++---- .../flutter/test/material/debug_test.dart | 21 ++----------------- .../flutter/test/material/snack_bar_test.dart | 4 ++++ 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/packages/flutter/lib/src/material/snack_bar.dart b/packages/flutter/lib/src/material/snack_bar.dart index 09f3d8cbd1..85f88238e7 100644 --- a/packages/flutter/lib/src/material/snack_bar.dart +++ b/packages/flutter/lib/src/material/snack_bar.dart @@ -628,9 +628,7 @@ class _SnackBarState extends State { Widget snackBar = Padding( padding: padding, - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, + child: Wrap( children: [ Row( children: [ @@ -656,7 +654,7 @@ class _SnackBarState extends State { children: maybeActionAndIcon), ), ], - ), + ), ); diff --git a/packages/flutter/test/material/debug_test.dart b/packages/flutter/test/material/debug_test.dart index 80e94dc9a6..208ee58798 100644 --- a/packages/flutter/test/material/debug_test.dart +++ b/packages/flutter/test/material/debug_test.dart @@ -316,24 +316,7 @@ void main() { ' TextButtonTheme\n' ' Padding\n' ' Row\n' - ' Column\n' - ' _SingleChildViewport\n' - ' IgnorePointer-[GlobalKey#d48e8]\n' - ' Semantics\n' - ' Listener\n' - ' _GestureSemantics\n' - ' RawGestureDetector-[LabeledGlobalKey#0c3e0]\n' - ' Listener\n' - ' _ScrollableScope\n' - ' _ScrollSemantics-[GlobalKey#349b8]\n' - ' NotificationListener\n' - ' RepaintBoundary\n' - ' CustomPaint\n' - ' RepaintBoundary\n' - ' NotificationListener\n' - ' GlowingOverscrollIndicator\n' - ' Scrollable\n' - ' SingleChildScrollView\n' + ' Wrap\n' ' Padding\n' ' MediaQuery\n' ' Padding\n' @@ -395,7 +378,7 @@ void main() { ' Directionality\n' ' [root]\n' ' Typically, the ScaffoldMessenger widget is introduced by the\n' - ' MaterialApp at the top of your application widget tree.\n', + ' MaterialApp at the top of your application widget tree.\n' )); }); } diff --git a/packages/flutter/test/material/snack_bar_test.dart b/packages/flutter/test/material/snack_bar_test.dart index f4d63ab6e7..4d5a847b87 100644 --- a/packages/flutter/test/material/snack_bar_test.dart +++ b/packages/flutter/test/material/snack_bar_test.dart @@ -1276,6 +1276,10 @@ void main() { await tester.pumpAndSettle(); expect(tester.getSemantics(find.text('snack')), matchesSemantics( + isLiveRegion: true, + hasDismissAction: true, + hasScrollDownAction: true, + hasScrollUpAction: true, label: 'snack', textDirection: TextDirection.ltr, ));