jamesblasco / modal_bottom_sheet

Flutter | Create advanced modal bottom sheets. Material, Cupertino or your own style
https://pub.dev/packages/modal_bottom_sheet
MIT License
1.89k stars 475 forks source link

Change clipBehaviour to Clip.antiAlias for smooth corners #129

Open LEMUSADR000 opened 3 years ago

LEMUSADR000 commented 3 years ago

The top bar of the page has screen white artifact-like pixels on left and right corners. Here are some images:

  1. What it looks like on my project Screenshot_20201221-110302

  2. What it looks like on project 'Modal with PageView' sample Screenshot_20201221-110350

Closer shot for clarity: Screenshot_20201221-110350

Steps to reproduce:

So far I've tried tweaking shape, topRadius, and various color options but they don't seem to change the presence of these artifacts. Do you know how to fix this? If not, do you know what could be the cause so I could possibly fix it myself and submit an MR?

jamesblasco commented 3 years ago

Yes, I think it is the added border that it should not be there. I will remove it in the next version

LEMUSADR000 commented 3 years ago

This is a great looking package, thanks for all of your work on this!

Zabadam commented 3 years ago

In one of my own apps, I have a Clipper with the same shape as an underlying Container. I still wanted the Border to match, but I ended up reducing the radius of my clipper by 0.5 compared to the container for a cleaner edge. Probably irrelevant in this situation, but something to have in mind.

jamesblasco commented 3 years ago

Hello, there are two errors in the BarBottomSheetRight now. First there was a unneeded border that has been removed, Second, the clips had the behavior Clip.hardEdge by default. Clip.antiAlias is much smoother, but it is slower. I will try that in my projects, and if it goes well I will make the change soon. Feel free to try it by adding the param clipBehaviour

LEMUSADR000 commented 3 years ago

Changing clipBehavior didn't seem to make a noticeable difference in the behavior I was seeing. I'm still getting the white artifacts. Are there any branches I could check out on my project to test some new changes? I'd be completely up for doing something like that if it would help anything.

armandojimenez commented 3 years ago

Any way to deal with this?

LEMUSADR000 commented 3 years ago

I couldn't seem to find a legit workaround for it so I just made any usages of this widget have white bar colors for now. The shape is still messed up, though. It doesn't seem to have a perfect radius.

Zabadam commented 3 years ago

I have never personally experienced this visual bug when using this package, but I also use bespoke styled objects for each portion of the [SlidingSheet], i.e. my [SlidingSheet.headerBuilder] returns a [SlidingSheetHeader].

I do not use any of the built-in borderRadius parameters. Are you? If so, you could instead change the borderRadius of your header manually to see if that is the culprit.