Bilbo Baggins
Bilbo Baggins

Reputation: 175

how to make side color on dialog

Do you guys know how to give side color on dialog like picture below.

enter image description here

If you want to know my code, here I attach it:

Future<T?> showCustomDialog<T>(BuildContext context) {
    return showDialog<T>(
      context: context,
      builder: (context) => Dialog(
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(16),
        ),
        child: this,
      ),
    );
  }

Just assume the widget is in the child.

Upvotes: 0

Views: 24

Answers (1)

eamirho3ein
eamirho3ein

Reputation: 17880

You can try this:

showDialog(
  context: context,
  builder: (BuildContext context) {
    return Dialog(
      clipBehavior: Clip.antiAlias,
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(16),
      ),
      child: Column(
        children: [
          Container(
            color: Colors.green,
            width: double.infinity,
            height: 10,
          ),
        ],
      ),
    );
  });

enter image description here

Upvotes: 1

Related Questions