Skip to content

Commit

Permalink
Improve showSnackBar documentation (#114612)
Browse files Browse the repository at this point in the history
Co-authored-by: Bruno Leroux <[email protected]>
  • Loading branch information
bleroux and bleroux authored Nov 18, 2022
1 parent ec03f1c commit 710e708
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/flutter/lib/src/material/scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,10 @@ class ScaffoldMessengerState extends State<ScaffoldMessenger> with TickerProvide

// SNACKBAR API

/// Shows a [SnackBar] across all registered [Scaffold]s.
/// Shows a [SnackBar] across all registered [Scaffold]s. Scaffolds register
/// to receive snack bars from their closest [ScaffoldMessenger] ancestor.
/// If there are several registered scaffolds the snack bar is shown
/// simultaneously on all of them.
///
/// 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 @@ -432,7 +435,10 @@ class ScaffoldMessengerState extends State<ScaffoldMessenger> with TickerProvide

// MATERIAL BANNER API

/// Shows a [MaterialBanner] across all registered [Scaffold]s.
/// Shows a [MaterialBanner] across all registered [Scaffold]s. Scaffolds register
/// to receive material banners from their closest [ScaffoldMessenger] ancestor.
/// If there are several registered scaffolds the material banner is shown
/// simultaneously on all of them.
///
/// A scaffold can show at most one material banner at a time. If this function is
/// called while another material banner is already visible, the given material banner
Expand Down Expand Up @@ -1559,6 +1565,12 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr
/// app. A bottom sheet can either be persistent, in which case it is shown
/// using the [ScaffoldState.showBottomSheet] method, or modal, in which case
/// it is shown using the [showModalBottomSheet] function.
/// * [SnackBar], which is a lightweight message with an optional action which
/// briefly displays at the bottom of the screen. Use the
/// [ScaffoldMessengerState.showSnackBar] method to show snack bars.
/// * [MaterialBanner], which displays an important, succinct message, at the
/// top of the screen, below the app bar. Use the
/// [ScaffoldMessengerState.showMaterialBanner] method to show material banners.
/// * [ScaffoldState], which is the state associated with this widget.
/// * <https://material.io/design/layout/responsive-layout-grid.html>
/// * Cookbook: [Add a Drawer to a screen](https://flutter.dev/docs/cookbook/design/drawer)
Expand Down

0 comments on commit 710e708

Please sign in to comment.