Search code examples
flutteruser-interfaceflutter-layoutsnackbar

How to Display a Widget Over the Screen in flutter?


I want to Display a Widget like this over the Image/Screen: enter image description here

I try to do this with snackbar with following code:

SnackBar(
  elevation: 5,
  padding: const EdgeInsets.all(0),
  backgroundColor: Colors.transparent,
  behavior: SnackBarBehavior.floating,
  content: Children()

But it is displaying with a little black color in background...

Is there any other widget for achieving this???

If you know the answer of the question then answer this question...


Solution

  • You can also use Toast in this case. A toast generally appears for 2 seconds or you can set a custom duration for the same.

    Flutter Toast is a good library to achieve the same.

    https://pub.dev/packages/fluttertoast