dbenitez-bcn / solid_bottom_sheet

Apache License 2.0
58 stars 19 forks source link

Question: how to set border radius, and change opacity if possible? #19

Closed themisir closed 4 years ago

themisir commented 4 years ago

Hi,

I wanted to change border-radius using BoxDecorator but the result is not fine. The borders were clipped but I saw white background bellow borders. (my background is colorful so I want opaque bg not white).

Also, I wanted to change the opacity of the container but changing the color of Container or adding Opacity above container did not work.

Thanks in advance!

themisir commented 4 years ago

Fixed by adding canvasColor: Colors.transparent, and using Stack.

MarkStepp commented 4 years ago

@TheMisir - can you show an example

themisir commented 4 years ago

@MarkStepp I don't remember actually, but I think I changed child container's borderRadius property. I'm sorry but I forget where did I write the code.

It looked like that:

Stack(
  children: [
    YourScreenContent(),
    SolidBottomSheet(
      headerBar: Container(
        decoration: new BoxDecoration(
          color: Colors.green, 
          borderRadius: new BorderRadius.only(
            topLeft:  const  Radius.circular(40.0),
            topRight: const  Radius.circular(40.0))
          ),
      ),
    ),
  ],
);
blackmenthor commented 4 years ago

If anyone's wondering, the canvasColor is supposed to be used inside your MaterialApp's ThemeData