Kamil Poniewierski
Kamil Poniewierski

Reputation: 334

Can the space of Safe Area be filled with anything?

I would like to have a bottom aligned button which has text positioned above safe area in a way that allows me to fill that space with the color of button and, ideally, is clickable too.

I was thinking about adding a Container with Gesture Detector there but can't figure out how to do it in a way that won't ruin layout on phones without safe area. That's how huge it looks when wrapped in SafeArea. Ideally there would be little to no margin above text in this button, something like this.

Upvotes: 0

Views: 843

Answers (1)

Jim
Jim

Reputation: 7601

You can use flutter_screenutil instead of SafeArea, knowing the bottom and top safearea height by these 2 functions:

ScreenUtil.bottomBarHeight //Bottom safe zone distance, suitable for buttons with full screen ScreenUtil.statusBarHeight //Status bar height , Notch will be higher Unit px

you can then control the height of safearea yourself

Upvotes: 1

Related Questions