I’m creating a dialog and I need a rounded corners like this:
But when I add BorderRadius to the dialog it’s not the same. Actual result:
My code:
Dialog(
backgroundColor: Colors.white,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(38),
),
…
),
How can I create rounded corner like first picture or style the roundness?
5
Answers
By using:
We can get required type of border style.
I think Flutter doens’t have smooth corners for rounded so try to use a package name
smooth_corner
But there is a lot more on this so try to venture others.
Dialog example although I am using
showGeneralDialog
, the concept of what you want to achieve exists as an example:I think you can either use
clip-path
orcustom painter
in Flutter.If you have the
svg
image of your design then you can go to this website, or if you can draw that shape then you can go this websiteIt will generate all the custom painter code for you so you don’t have to worry about it.
You can use
ContinuousRectangleBorder
instead of usingsmooth_corner
package. It does not require any packages to be installed:You can achieve by doing this