Home > Software design >  how to make side color on dialog
how to make side color on dialog

Time:01-09

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.

CodePudding user response:

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

  • Related