We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0d917b commit 4676377Copy full SHA for 4676377
using_snackbar/lib/main.dart
@@ -26,7 +26,7 @@ class MyButton extends StatelessWidget {
26
// On pressing the raised button
27
onPressed: () {
28
// show snackbar
29
- Scaffold.of(context).showSnackBar(SnackBar(
+ ScaffoldMessenger.of(context).showSnackBar(SnackBar(
30
// set content of snackbar
31
content: Text("Hello! I am SnackBar :)"),
32
// set duration
@@ -36,7 +36,7 @@ class MyButton extends StatelessWidget {
36
label: "Hit Me (Action)",
37
38
// When action button is pressed, show another snackbar
39
40
content: Text(
41
"Hello! I am shown becoz you pressed Action :)"),
42
));
0 commit comments