有什么方法可以实现Flutter顶部小吃吧? [英] Is there any way to achieve a Flutter top snackbar?

查看:41
本文介绍了有什么方法可以实现Flutter顶部小吃吧?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个简单的小吃吧,它位于屏幕的顶部,而底部却是这样.在Flutter中,我使用了本机的小吃吧,但它没有这样的功能.

I want to create a simple snackbar that come from top of the screen instesd of bottom.In flutter i have used native snackbar but it does not have such feature.

推荐答案

您可以使用 https://pub .dartlang.org/packages/flushbar

RaisedButton(
  child: Text('Show Top Snackbar'),
  onPressed: () {
    Flushbar(
      flushbarPosition: FlushbarPosition.TOP,
    )
      ..title = "Hey Ninja"
      ..message = "Lorem Ipsum is simply dummy text of the printing and typesetting industry"
      ..duration = Duration(seconds: 3)
      ..show(context);
  },
),

这篇关于有什么方法可以实现Flutter顶部小吃吧?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆