Menu

1 / 2

Hide the status bar while scrolling in Flutter without layout jumps

DEV Community: flutter·Frank Milvus·about 22 hours ago
#KAH6vNXZ
#devtoflutter#devto#dev#android#system
Reading 0:00
15s threshold

A chat screen is mostly a reading surface. On a phone, the system status bar, the floating conversation header and the pinned-message bar can eat well over a hundred density-independent pixels at the top of the screen. That is fine while you are writing a message. It is exactly the wrong use of space while you are scrolling back through a year of conversation looking for one link.

So the bars in our Flutter chat now behave like a browser's address bar: they leave when you scroll away from the newest message and come back when you scroll toward it. Two independent switches control what leaves — the in-app app bars (on by default) and the Android/iOS status bar (off by default, because the clock and battery are information most people want to keep).

The interesting part is not the fade.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.