Venkatesh Prasad
Venkatesh Prasad

Reputation: 103

Custom background shapes for dialog in flutter

I am trying to implement dialog which should have a custom card of some sort where the child widgets can partially come out as shown in this sample image

Please help me how to recreate it in flutter.

Upvotes: 0

Views: 1069

Answers (1)

Mohamed hassan kadri
Mohamed hassan kadri

Reputation: 1069

I will suggest to use a dialog with container inside it and then the container can have a column or stack and you can reposition your widget here is a little example

return Dialog(
      child: Container(
        decoration: BoxDecoration(borderRadius: BorderRadius.circular(10.0)),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Stack(
              alignment: Alignment.topCenter,
              overflow: Overflow.visible,
              children: <Widget>[
                Container(
                  child: Text('a widget'),
                ),
                Positioned(
                  child: Container( ),
                ),
                Positioned(
                  child: Image.asset(
                    'your image link  here'
                  ),
                ),
              ],
            ),
          ],
        ),
      ),
    );

Upvotes: 1

Related Questions