简体   繁体   中英

Rounded borders on SliverAppBar in flutter

How do you make rounded bottom-corners on a SliverAppBar? I know of 2 ways, but they just don't quite cut it.

1: To use "shape: ContinuousRectangleBorder". The reason this doesn't cut it, is because it's not Circular, but this weird square-circle thing, so it doesn't look the right way. If it's possible to make it with this, and still retain the roundness to it, then please comment that:)

2: To make a container with rounded corners in the SliverAppBar. This is not quite it, because then when you scroll it disappears really early, and you just left with this empty white space in the top of the screen.

If you have any idea, please help. And remember this is a SliverAppBar, not a normal AppBar, there it would be easy.

The first way is the better and recommended way. You can use RoundedRectangleBorder instead of ContinuousRectangleBorder

You can also visit: https://api.flutter.dev/flutter/painting/RoundedRectangleBorder-class.html

You can also check: https://api.flutter.dev/flutter/painting/CircleBorder-class.html for CircleBorder

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM