flutter dissmis snackbar

59

ScaffoldMessenger.of(context).hideCurrentSnackBar();
final snackBar = SnackBar(
            content: const Text('Yay! A SnackBar!'),
            action: SnackBarAction(
              label: 'Undo',
              onPressed: () {},
            ),
          );
ScaffoldMessenger.of(context).showSnackBar(snackBar);

Comments

Submit
0 Comments