在Flutter中的FAB上方显示SnackBar / Toast

时间:2020-02-24 01:38:19

标签: flutter

如何在FAB / FloatingActionButton上方显示SnackBar?

Snackbar along bottom by default

1 个答案:

答案 0 :(得分:1)

添加

behavior: SnackBarBehavior.floating

到SnackBar。

      final snackbar = SnackBar(
        content: Text('Contents saved to disk'),
        behavior: SnackBarBehavior.floating, // <== Added
      );

enter image description here