Answers for "global snackbar in flutter"

9

flutter snackbar

ScaffoldMessenger.of(context).showSnackBar(SnackBar(
                content: Text("Your Text"),
                duration: Duration(milliseconds: 300),
              ));
Posted by: Guest on July-08-2021
3

snackbar in flutter

final snackBar = SnackBar(content: Text('Yay! A SnackBar!'));

// Find the ScaffoldMessenger in the widget tree
// and use it to show a SnackBar.
ScaffoldMessenger.of(context).showSnackBar(snackBar);
Posted by: Guest on March-04-2021
1

flutter snackbar

final snackBar = SnackBar(
  content: Text('Yay! A SnackBar!'),
  action: SnackBarAction(
    label: 'Undo',
    onPressed: () {
      // Some code to undo the change.
    },
  ),
);

 // Find the Scaffold in the widget tree and use
 // it to show a SnackBar.
 Scaffold.of(context).showSnackBar(snackBar);
Posted by: Guest on May-15-2020
1

snackbar in flutter

final snackBar = SnackBar(
  content: Text('Yay! A SnackBar!'),
  action: SnackBarAction(
    label: 'Undo',
    onPressed: () {
      // Some code to undo the change.
    },
  ),
);
Posted by: Guest on March-04-2021

Browse Popular Code Answers by Language