Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
135bb5d4
Unverified
Commit
135bb5d4
authored
Apr 08, 2022
by
Kate Lovett
Committed by
GitHub
Apr 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated Scaffold SnackBar API (#98549)
parent
1cf5c740
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
773 deletions
+72
-773
scaffold.dart
packages/flutter/lib/src/material/scaffold.dart
+0
-261
snack_bar.dart
packages/flutter/lib/src/material/snack_bar.dart
+3
-3
debug_test.dart
packages/flutter/test/material/debug_test.dart
+62
-4
snack_bar_test.dart
packages/flutter/test/material/snack_bar_test.dart
+7
-505
No files found.
packages/flutter/lib/src/material/scaffold.dart
View file @
135bb5d4
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/material/snack_bar.dart
View file @
135bb5d4
...
...
@@ -122,7 +122,7 @@ class _SnackBarActionState extends State<SnackBarAction> {
_haveTriggeredAction
=
true
;
});
widget
.
onPressed
();
Scaffold
.
of
(
context
).
hideCurrentSnackBar
(
reason:
SnackBarClosedReason
.
action
);
Scaffold
Messenger
.
of
(
context
).
hideCurrentSnackBar
(
reason:
SnackBarClosedReason
.
action
);
}
@override
...
...
@@ -583,14 +583,14 @@ class _SnackBarState extends State<SnackBar> {
container:
true
,
liveRegion:
true
,
onDismiss:
()
{
Scaffold
.
of
(
context
).
removeCurrentSnackBar
(
reason:
SnackBarClosedReason
.
dismiss
);
Scaffold
Messenger
.
of
(
context
).
removeCurrentSnackBar
(
reason:
SnackBarClosedReason
.
dismiss
);
},
child:
Dismissible
(
key:
const
Key
(
'dismissible'
),
direction:
widget
.
dismissDirection
,
resizeDuration:
null
,
onDismissed:
(
DismissDirection
direction
)
{
Scaffold
.
of
(
context
).
removeCurrentSnackBar
(
reason:
SnackBarClosedReason
.
swipe
);
Scaffold
Messenger
.
of
(
context
).
removeCurrentSnackBar
(
reason:
SnackBarClosedReason
.
swipe
);
},
child:
snackBar
,
),
...
...
packages/flutter/test/material/debug_test.dart
View file @
135bb5d4
...
...
@@ -263,8 +263,10 @@ void main() {
),
),
));
// The Scaffold should assert we still have an ancestor ScaffoldMessenger in
// order to dismiss the SnackBar from the ScaffoldMessenger.
// Tap SnackBarAction to dismiss.
// The SnackBarAction should assert we still have an ancestor
// ScaffoldMessenger in order to dismiss the SnackBar from the
// Scaffold.
await
tester
.
tap
(
find
.
text
(
'Test'
));
FlutterError
.
onError
=
oldHandler
;
...
...
@@ -286,11 +288,67 @@ void main() {
expect
(
error
.
toStringDeep
(),
equalsIgnoringHashCodes
(
'FlutterError
\n
'
' No ScaffoldMessenger widget found.
\n
'
' Scaffold widgets require a ScaffoldMessenger widget ancestor.
\n
'
' SnackBarAction widgets require a ScaffoldMessenger widget
\n
'
' ancestor.
\n
'
' The specific widget that could not find a ScaffoldMessenger
\n
'
' ancestor was:
\n
'
' S
caffold-[LabeledGlobalKey<ScaffoldState>#00829]
\n
'
' S
nackBarAction
\n
'
' The ancestors of this widget were:
\n
'
' TextButtonTheme
\n
'
' Padding
\n
'
' Row
\n
'
' Padding
\n
'
' MediaQuery
\n
'
' Padding
\n
'
' SafeArea
\n
'
' FadeTransition
\n
'
' IconTheme
\n
'
' IconTheme
\n
'
' _InheritedCupertinoTheme
\n
'
' CupertinoTheme
\n
'
' _InheritedTheme
\n
'
' Theme
\n
'
' DefaultTextStyle
\n
'
' AnimatedDefaultTextStyle
\n
'
' _InkFeatures-[GlobalKey#00000 ink renderer]
\n
'
' NotificationListener<LayoutChangedNotification>
\n
'
' PhysicalModel
\n
'
' AnimatedPhysicalModel
\n
'
' Material
\n
'
' FractionalTranslation
\n
'
' SlideTransition
\n
'
' Listener
\n
'
' _GestureSemantics
\n
'
' RawGestureDetector
\n
'
' GestureDetector
\n
'
" Dismissible-[<'dismissible'>]
\n
"
' Semantics
\n
'
' Align
\n
'
' AnimatedBuilder
\n
'
' ClipRect
\n
'
' KeyedSubtree-[GlobalKey#00000]
\n
'
' _EffectiveTickerMode
\n
'
' TickerMode
\n
'
' Offstage
\n
'
' SizedBox
\n
'
' Hero
\n
'
' SnackBar-[#00000]
\n
'
' MediaQuery
\n
'
' LayoutId-[<_ScaffoldSlot.snackBar>]
\n
'
' CustomMultiChildLayout
\n
'
' AnimatedBuilder
\n
'
' DefaultTextStyle
\n
'
' AnimatedDefaultTextStyle
\n
'
' _InkFeatures-[GlobalKey#00000 ink renderer]
\n
'
' NotificationListener<LayoutChangedNotification>
\n
'
' PhysicalModel
\n
'
' AnimatedPhysicalModel
\n
'
' Material
\n
'
' _ScrollMetricsNotificationObserverScope
\n
'
' NotificationListener<ScrollMetricsNotification>
\n
'
' ScrollMetricsNotificationObserver
\n
'
' _ScaffoldScope
\n
'
' Scaffold-[LabeledGlobalKey<ScaffoldState>#00000]
\n
'
' MediaQuery
\n
'
' Directionality
\n
'
' [root]
\n
'
...
...
packages/flutter/test/material/snack_bar_test.dart
View file @
135bb5d4
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment