edge_to_edge_plus 0.1.0
edge_to_edge_plus: ^0.1.0 copied to clipboard
Typed Android window insets, tappableElement-aware system bar protection and diagnostics for the mandatory edge-to-edge enforcement in Android 15 and 16.
Changelog #
All notable changes to this project are documented here. The format follows Keep a Changelog, and this project adheres to Semantic Versioning.
0.1.0 #
First release.
Added #
SystemInsets— oneEdgeInsetsperWindowInsets.Type, in logical pixels:statusBars,navigationBars,navigationBarsIgnoringVisibility,systemBars,tappableElement,displayCutout,ime,systemGestures,mandatorySystemGestures,captionBar, plusimeVisibleandhasTappableNavigationBar.MediaQueryexposes none of these separately.SystemBarProtection.top/.bottom— draws a background behind a system bar, sized fromstatusBars.topandtappableElement.bottomrespectively. Renders nothing when the inset is zero, so the bottom variant disappears under gesture navigation.EdgeToEdgeScope— streams inset changes from the host and rebuilds dependents. Falls back toSystemInsets.fromMediaQuerywhen absent rather than asserting.EdgeToEdgeRegion.solidBottom/.scrollingBottom/.custom— per-page system bar styling overAnnotatedRegion<SystemUiOverlayStyle>, differing in whether the system's contrast scrim is suppressed.SystemBarStyles— the same four styles as plain constants, suitable forAppBarTheme.systemOverlayStyle. UnlikeSystemUiOverlayStyle.light/.darkthey do not set an opaque black navigation bar.SystemNavigationMode—threeButton,twoButton,gesture,unknown, resolved natively fromSettings.Secure.navigation_modewith aconfig_navBarInteractionModefallback and an inset-shape hint.EdgeToEdgeCapabilities— API level, hosttargetSdkVersion, whether edge-to-edge is enforced, whetherwindowOptOutEdgeToEdgeEnforcementis set, and whether this device still honours it.EdgeToEdgeDiagnostics— structured warnings for the misconfigurations that fail silently: a dead opt-out flag,targetSdkbelow 35, system bar colours the OS is ignoring on API 35+, and a missingEdgeToEdgeScope.EdgeToEdgeDebugOverlay— labelled, measured bands for every inset type plus a summary card. Compiles out of release builds.EdgeToEdge— static, context-free accessors for one-shot reads, plussetNavigationBarContrastEnforcedandsetStatusBarContrastEnforced.- Example app with five screens, including a before/after switch that turns the handling off so the overlap is visible.
Platform support #
- Android API 24–36. Insets are converted to logical pixels on the native side.
- iOS, web, macOS, Windows and Linux are a safe no-op: capabilities report
unsupported, insets fall back to
MediaQuery, widgets render their child unchanged, and nothing throws.
Notes #
- The navigation-mode enum is named
SystemNavigationMode. Flutter already exports aNavigationModefrommedia_query.dart, and reusing that name would causeambiguous_importerrors in any file importing both this package andpackage:flutter/material.dart. - This package will never recommend
android:windowOptOutEdgeToEdgeEnforcement. It is deprecated and disabled for apps targeting API 36 on Android 16, andEdgeToEdge.diagnose()reports it as an error when it is being ignored.