flutter中如何实现浮动Snackbar动画?

She*_*don 8 animation android snackbar flutter

我正在尝试在浮动 Snackbar 中实现动画,它从屏幕底部出现并向上移动,就像 Gmail 应用程序中滑动邮件以获取文件时出现的动画一样。有人可以发布一个例子吗?

ScaffoldMessenger.of(context).showSnackBar(SnackBar(
                          content: Text(
                            'Product removed from cart',
                          ),
                          action: SnackBarAction(
                              label: 'Undo',
                              onPressed: () {
                               //
                              }),
                          duration: Duration(seconds: 3),
                          behavior: SnackBarBehavior.floating,
                          margin: EdgeInsets.only(bottom: 30,left: 10,right: 10),
                          animation: // **Answer Please**
                      }
Run Code Online (Sandbox Code Playgroud)

小智 -2

导入“ fluttertoast”包并像这样使用......

Fluttertoast.showToast(
        msg:"Toast Message",
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.BOTTOM,
        timeInSecForIosWeb: 1,
        textColor: Colors.white,
        backgroundColor: Colors.black54,
        fontSize: 16.0)
Run Code Online (Sandbox Code Playgroud)