dbenitez-bcn / solid_bottom_sheet

Apache License 2.0
58 stars 19 forks source link

Set margin of SolidBottomSheet. #25

Open Rashesh-Bosamiya opened 4 years ago

Rashesh-Bosamiya commented 4 years ago

How can I set margin of SolidBottomSheet? However, I have set margin of widget that is inside body. That is working. But showing white color in margin area of body.

See following screenshot.

Simulator Screen Shot - iPhone 11 - 2020-09-07 at 19 14 15

bottomSheet: SolidBottomSheet(
          draggableBody: true,
          minHeight: 20.vertical,
          maxHeight: 50.vertical,
          toggleVisibilityOnTap: false,
          canUserSwipe: true,
          showOnAppear: false,
          headerBar: null,
          body: MyBottomSheet()),

class MyBottomSheet extends StatelessWidget {
  BorderRadius get _radius {
    return BorderRadius.only(
      topRight: Radius.circular(4.horizontal),
      topLeft: Radius.circular(4.horizontal),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.symmetric(horizontal: 5.horizontal),
      height: 50.vertical,
      decoration: BoxDecoration(
          color: AppColors.red.withOpacity(0.2),
          borderRadius: _radius),
    );
  }
}
dbenitez-bcn commented 4 years ago

You see this color because I didn't set it as transparent... For now try to add the margin to the SolidBottomSheet itself instead of adding it into you body widget. I will try to set the background color of the body as transparent asap.

Rashesh-Bosamiya commented 4 years ago

Thank you for quick reply.

As you said to add margin in SolidBottomSheet. But I did not find property for that.

There are only these properties available. (See below screenshot)

Screenshot 2020-09-07 at 8 03 22 PM

Rashesh-Bosamiya commented 4 years ago

If you could quickly update this repository for this change, I will appreciate it.

Also, please acknowledge in this ticket once you update.

dbenitez-bcn commented 4 years ago

Wrap the SolidBottomSheet with a padding widget. Maybe this helps you

Rashesh-Bosamiya commented 4 years ago

Nope, that is not working.

Rashesh-Bosamiya commented 4 years ago

Any update on this ticket?

dbenitez-bcn commented 1 year ago

Here you can find a potential solution https://github.com/dbenitez-bcn/solid_bottom_sheet/issues/29#issuecomment-898885655