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
d618b810
Unverified
Commit
d618b810
authored
Nov 03, 2020
by
Smarak Das
Committed by
GitHub
Nov 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AdoptAWidget: SnackBar (#69555)
parent
fb90544c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
+63
-0
snack_bar.dart
packages/flutter/lib/src/material/snack_bar.dart
+63
-0
No files found.
packages/flutter/lib/src/material/snack_bar.dart
View file @
d618b810
...
@@ -158,6 +158,69 @@ class _SnackBarActionState extends State<SnackBarAction> {
...
@@ -158,6 +158,69 @@ class _SnackBarActionState extends State<SnackBarAction> {
/// A SnackBar with an action will not time out when TalkBack or VoiceOver are
/// A SnackBar with an action will not time out when TalkBack or VoiceOver are
/// enabled. This is controlled by [AccessibilityFeatures.accessibleNavigation].
/// enabled. This is controlled by [AccessibilityFeatures.accessibleNavigation].
///
///
/// {@tool dartpad --template=stateless_widget_scaffold_center}
///
/// Here is an example of a [SnackBar] with an [action] button implemented using
/// [SnackBarAction].
///
/// ```dart
/// Widget build(BuildContext context) {
/// return ElevatedButton(
/// child: Text("Show Snackbar"),
/// onPressed: () {
/// ScaffoldMessenger.of(context).showSnackBar(
/// SnackBar(
/// content: Text("Awesome Snackbar!"),
/// action: SnackBarAction(
/// label: "Action",
/// onPressed: () {
/// // Code to execute.
/// },
/// ),
/// ),
/// );
/// },
/// );
/// }
/// ```
/// {@end-tool}
///
/// {@tool dartpad --template=stateless_widget_scaffold_center}
///
/// Here is an example of a customized [SnackBar]. It utilizes
/// [behavior], [shape], [padding], [width], and [duration] to customize the
/// location, appearance, and the duration for which the [SnackBar] is visible.
///
/// ```dart
/// Widget build(BuildContext context) {
/// return ElevatedButton(
/// child: Text("Show Snackbar"),
/// onPressed: () {
/// ScaffoldMessenger.of(context).showSnackBar(
/// SnackBar(
/// action: SnackBarAction(
/// label: "Action",
/// onPressed: () {
/// // Code to execute.
/// },
/// ),
/// content: Text("Awesome SnackBar!"),
/// duration: Duration(milliseconds: 1500),
/// width: 280.0, // Width of the SnackBar.
/// padding: EdgeInsets.symmetric(
/// horizontal: 8.0), // Inner padding for SnackBar content.
/// behavior: SnackBarBehavior.floating,
/// shape: RoundedRectangleBorder(
/// borderRadius: BorderRadius.circular(10.0),
/// ),
/// ),
/// );
/// },
/// );
/// }
/// ```
/// {@end-tool}
///
/// See also:
/// See also:
///
///
/// * [ScaffoldMessenger.of], to obtain the current [ScaffoldMessengerState],
/// * [ScaffoldMessenger.of], to obtain the current [ScaffoldMessengerState],
...
...
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