safePadding property
EdgeInsets
get
safePadding
Retrieves the padding necessary to avoid system intrusions (e.g., status bars, notches).
This is typically only needed when placing content directly behind the status bar or system navigation bars, or when using custom scrolls.
Example:
// Use safePadding to offset content below the status bar
Padding(
padding: context.safePadding,
child: const Text('Hello'),
)
Implementation
EdgeInsets get safePadding => MediaQuery.paddingOf(this);