[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScaffoldMessenger #64101

Merged
merged 11 commits into from
Sep 3, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update docs
  • Loading branch information
Piinks committed Aug 27, 2020
commit 063e1590f54e03d67744976303c9212f4534a683
22 changes: 19 additions & 3 deletions packages/flutter/lib/src/material/scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2028,7 +2028,8 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin {

ScaffoldMessengerState _scaffoldMessenger;

/// Shows a [SnackBar] at the bottom of the scaffold.
/// [ScaffoldMessengerState.showSnackBar] shows a [SnackBar] at the bottom of
/// the scaffold. This method should not be used.
///
/// A scaffold can show at most one snack bar at a time. If this function is
/// called while another snack bar is already visible, the given snack bar
Expand Down Expand Up @@ -2065,6 +2066,10 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin {
/// }
/// ```
/// {@end-tool}
///
/// See also:
///
/// * [ScaffoldMessenger], this should be used instead to manage [SnackBar]s.
// TODO(Piinks): Deprecate after customers are migrated
ScaffoldFeatureController<SnackBar, SnackBarClosedReason> showSnackBar(SnackBar snackbar) {
assert(() {
Expand Down Expand Up @@ -2092,10 +2097,15 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin {
return _scaffoldMessenger.showSnackBar(snackbar);
}

/// Removes the current [SnackBar] (if any) immediately.
/// [ScaffoldMessengerState.removeCurrentSnackBar] removes the current
/// [SnackBar] (if any) immediately. This method should not be used.
///
/// The removed snack bar does not run its normal exit animation. If there are
/// any queued snack bars, they begin their entrance animation immediately.
///
/// See also:
///
/// * [ScaffoldMessenger], this should be used instead to manage [SnackBar]s.
// TODO(Piinks): Deprecate after customers are migrated
void removeCurrentSnackBar({ SnackBarClosedReason reason = SnackBarClosedReason.remove }) {
assert(() {
Expand Down Expand Up @@ -2123,9 +2133,15 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin {
_scaffoldMessenger.removeCurrentSnackBar(reason: reason);
}

/// Removes the current [SnackBar] by running its normal exit animation.
/// [ScaffoldMessengerState.hideCurrentSnackBar] removes the current
/// [SnackBar] by running its normal exit animation. This method should not be
/// used.
///
/// The closed completer is called after the animation is complete.
///
/// See also:
///
/// * [ScaffoldMessenger], this should be used instead to manage [SnackBar]s.
// TODO(Piinks): Deprecate after customers are migrated.
void hideCurrentSnackBar({ SnackBarClosedReason reason = SnackBarClosedReason.hide }) {
assert(() {
Expand Down