【问题标题】:How I can change curve animation for snackbar in flutter?如何在 flutter 中更改小吃店的曲线动画?
【发布时间】:2023-01-26 01:42:12
【问题描述】:

帮我! 我需要在 flutter 中更改默认的 snackbar 动画。我需要在 snackbar 出现时更改曲线动画。 我想将标准动画更改为 Curves.easeOutBack。

我尝试使用 Snackbar 的动画属性,但没有任何反应。和 我尝试使用 Snackbar().withAnimation(_curve) 但也没有任何反应。

【问题讨论】:

标签: flutter flutter-animation curve snackbar animationcontroller


【解决方案1】:

使用名为another_flushbar 的包


Flushbar(
  animationDuration: const Duration(seconds: 2),
  forwardAnimationCurve: Curves.easeIn, // ? Here you change the curve animation
  reverseAnimationCurve: Curves.easeOut,// ? Here you change the curve animation
  duration: const Duration(milliseconds: 3000),
  flushbarPosition: FlushbarPosition.BOTTOM,
  flushbarStyle: FlushbarStyle.FLOATING,
  message: "I am Bottom Snackbar",
  margin: const EdgeInsets.symmetric(vertical: 20),
  ).show(context);

【讨论】:

    猜你喜欢
    • 2020-04-06
    • 2016-09-13
    • 2020-07-05
    • 2018-09-27
    • 2017-04-07
    • 2020-08-02
    • 2016-03-05
    • 2022-07-07
    • 2020-04-07
    相关资源
    最近更新 更多