Rami Dhouib
Rami Dhouib

Reputation: 33

Flutter : Dialog() widget overlay

return Dialog(...)

Information: This "Dialog()" has different sizes based on the input of the class.

Question: How can I put an overlay 20 pixels around it? Let's say red?

What did I try? I tried the "shadow" property; it isn't good enough and does not look how I want it.

Greetings

Upvotes: 0

Views: 31

Answers (1)

Texv
Texv

Reputation: 1904

You can just use a container inside the dialog with custom BoxDecoration:

Dialog(
  child: Container(
    decoration: BoxDecoration(
      color: Colors.white,
      boxShadow: const [
        BoxShadow(
          color: Colors.red,
          blurRadius: 10)])));

See demo here: https://dartpad.dev/?id=d3f1fb7d3e50e1543f6899c57c7effb8

Upvotes: 1

Related Questions