Tag

status-bar

0 views collected around this technical thread.

Sohu Tech Products
Sohu Tech Products
Aug 14, 2024 · Mobile Development

Understanding Flutter Status Bar Height: Why MediaQuery.padding.top Returns 0

In Flutter, MediaQuery.of(context).padding.top reports the system UI inset rather than the actual status‑bar height, and when a Scaffold (especially with an AppBar) consumes this padding the value becomes zero, so developers must read the raw view padding via WidgetsBinding or MediaQueryData.fromView to reliably obtain the status‑bar height.

AndroidMediaQueryMobile Development
0 likes · 5 min read
Understanding Flutter Status Bar Height: Why MediaQuery.padding.top Returns 0
Sohu Tech Products
Sohu Tech Products
Sep 28, 2022 · Mobile Development

Understanding Flutter's PrimaryScrollController and Its Role in Scroll‑to‑Top Behavior

This article explains how Flutter implements the iOS‑style status‑bar tap to scroll‑to‑top feature using PrimaryScrollController, details its definition, relationship with InheritedWidget, ScrollController and ScrollView, shows the relevant source code, and provides practical guidance for avoiding common pitfalls in complex page structures.

Mobile DevelopmentScaffoldflutter
0 likes · 17 min read
Understanding Flutter's PrimaryScrollController and Its Role in Scroll‑to‑Top Behavior