Skip to content

feat: GleapBannerArea keeps the app below inline banners - #46

Merged
boehlerlukas merged 2 commits into
mainfrom
feat/inline-banner-inset
Oct 16, 2026
Merged

boehlerlukas merged 2 commits into
mainfrom
feat/inline-banner-inset

Conversation

@boehlerlukas

Copy link
Copy Markdown
Contributor

Customer ask (Operátor ICT, Prague public transport app, ticket 129428): inline banners in Flutter cover the app instead of pushing it down like on the web. They want them for service-outage notices sent from the dashboard.

Usage

MaterialApp(
  builder: (context, child) => GleapBannerArea(child: child!),
  home: const HomeScreen(),
)

While an inline banner is shown, the app is padded down by the banner's height (animated, 250 ms ease-out) and the top safe-area padding in MediaQuery shrinks by the same amount, since the banner covers the status bar. So AppBar/SafeArea don't add a second status-bar gap, and full-bleed content such as maps moves down too. Floating banners still float. Opt-in, so no existing app changes. Gleap.bannerHeight (ValueListenable<double>, logical px) is exposed for custom layouts. Web does nothing: the JS SDK already pushes the page.

Plumbing: native bannerHeightChanged → method channel → Gleap.bannerHeight; read once more with getBannerHeight after initialize, because the native SDKs only report changes (hot restart, new Flutter engine).

Depends on GleapSDK/Gleap-iOS-SDK#58 and GleapSDK/Android-SDK#53. The native pins stay at 19.2.4 here, so this compiles only once those are released and the pins are bumped in the release PR. Merge the native SDKs first.

Tested end to end on the iOS 27 simulator and the Android API 36.1 emulator (targetSdk 33 and 35). The local native branches were wired in via SPM path/mavenLocal, and real inline/floating payloads were fed through the SDKs' showBanner. That harness is not part of this PR.

  • Inline: banner covers the status bar and the AppBar sits directly below it (iOS 144 pt, Android 106 dp); close → back to the top
  • Floating: no push-down; replacing floating with inline works
  • Gleap widget opened and closed with the banner shown: layout stays (Android: no flicker on activity return)
  • Landscape: height updates (iOS 62, Android 86) and content follows
  • Hot restart with a banner shown: height recovered
  • flutter test passes (21), flutter analyze lib clean

🤖 Generated with Claude Code

boehlerlukas and others added 2 commits October 16, 2026 11:30
Forwards the native bannerHeightChanged callback into Gleap.bannerHeight (read once more on
initialize for hot restarts and new engines) and adds GleapBannerArea, which pads the app down by
the banner's height (animated) and shrinks the top safe-area padding by the same amount. The
example app wraps MaterialApp in it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant