Skip to content

[cupertino_ui] Document CupertinoTabScaffold background color behind bottom view insets - #13620

Open
victorsanni wants to merge 4 commits into
flutter:mainfrom
victorsanni:cupertino-tab-scaffold-keyboard
Open

victorsanni wants to merge 4 commits into
flutter:mainfrom
victorsanni:cupertino-tab-scaffold-keyboard

Conversation

@victorsanni

@victorsanni victorsanni commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Part of flutter/flutter#179482 (design: https://flutter.dev/go/ios-26-keyboard-bleed). Follows #13242 and #13244, which updated Scaffold persistent bottom sheets and Dialog.fullscreen in material_ui. Paired with flutter/flutter#196355 (viewInsets API docs); next: material_ui modal bottom sheet and Scaffold keyboard docs.

What this does

Documents on CupertinoTabScaffold.backgroundColor and CupertinoTabScaffold.resizeToAvoidBottomInset that when resizeToAvoidBottomInset is true and MediaQueryData.viewInsets has a non-zero bottom inset (such as from an onscreen keyboard), tab content is kept above the inset while the scaffold's background and tabBar remain behind it. When a tab page paints a different background color (for example, CupertinoPageScaffold.backgroundColor), the scaffold's background can remain visible through a translucent keyboard or around its rounded corners unless matched.

Behavior changes and caveats

  • No runtime behavior changes.
  • Apps whose tab page background differs from the scaffold's background need to match CupertinoTabScaffold.backgroundColor (or CupertinoThemeData.scaffoldBackgroundColor when shared across tabs), updating backgroundColor when switching tabs or nested CupertinoTabView routes that use different colors.
  • CupertinoTabBar continues to sit at the bottom of the scaffold behind the keyboard; matching backgroundColor covers the region between the inset tab content and the tab bar (including the keyboard's top corners).
  • resizeToAvoidBottomInset: false is unchanged: CupertinoTabScaffold does not inset tab content by viewInsets.bottom, and continues to apply tabBar bottom obstruction alongside unconsumed viewInsets.

Tests

  • Pin in tab_scaffold_test.dart that when resizeToAvoidBottomInset is true, CupertinoTabScaffold paints its background (backgroundColor or CupertinoThemeData.scaffoldBackgroundColor) across the full view behind a bottom view inset while a tab's CupertinoPageScaffold stops above the inset.

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2

…bottom view insets

Documents on CupertinoTabScaffold.backgroundColor and resizeToAvoidBottomInset
that in default mode (resizeToAvoidBottomInset: true), tab content is kept above
bottom viewInsets while backgroundColor continues to fill the scaffold behind
it, and adds a widget test pinning that geometry.

Part of flutter/flutter#179482.
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Nov 11, 2026
@github-actions github-actions Bot added p: cupertino_ui triage-design Should be looked at in design triage labels Nov 11, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation for CupertinoTabScaffold's backgroundColor and resizeToAvoidBottomInset properties to clarify that the scaffold's background extends behind bottom view insets when resizeToAvoidBottomInset is true. It also adds a widget test to verify this behavior and includes a pending changelog entry. There are no review comments to address, and no further feedback is provided.

gmackall pushed a commit to gmackall/flutter that referenced this pull request Nov 24, 2026
…#196355)

Part of flutter#179482 (design:
https://flutter.dev/go/ios-26-keyboard-bleed). Follows
flutter/packages#13242 (`Scaffold` persistent bottom sheets) and
flutter/packages#13244 (`Dialog.fullscreen`), and paired with
flutter/packages#13620 (`CupertinoTabScaffold` docs in `cupertino_ui`).
Next in `flutter/packages`: `showModalBottomSheet`/`Scaffold` docs in
`material_ui` (no further `flutter/flutter` changes are planned for
flutter#179482).

## What this does

Showing a docked keyboard does not resize the Flutter view; the view
continues to extend behind the keyboard while the engine reports the
overlapped height in `viewInsets.bottom`.

Updates `viewInsets` documentation in `dart:ui` (`FlutterView` and
`_ViewConfiguration`) and `widgets` (`MediaQueryData`) that previously
claimed the inset region is completely obscured or not visible at all,
and removes the outdated contrast in `FlutterView`'s `viewPadding` docs
claiming insets cover an area without gaps. System UI such as the
keyboard may be translucent or have rounded corners (for example, the
rounded, translucent keyboard introduced in iOS 26), leaving what is
painted behind it visible, so `MediaQueryData.viewInsets` now notes that
the inset area is typically not interactive (the system UI receives
pointer events there), advises keeping content and controls out of it
while continuing to paint backgrounds behind it, and includes a snippet
showing `viewInsets` applied as padding inside a background surface.

## Behavior changes and caveats

- No runtime behavior changes (documentation comments only).
- Kept as one PR across `engine/src/flutter/lib/ui` and
`packages/flutter` so `dart:ui` and `MediaQueryData` do not contradict
each other.
- `package:flutter/material.dart` and `package:flutter/cupertino.dart`
are deprecated; Material and Cupertino documentation and widget updates
target `material_ui` and `cupertino_ui` in `flutter/packages`.

## Tests

- Comment-only documentation change; test-exempt under Tree Hygiene.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

If this change needs to override an active code freeze, provide a
comment explaining why. The code freeze workflow can be overridden by
code reviewers. See pinned issues for any active code freezes with
guidance.

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/CONTRIBUTING.ai.md
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[flutter/website]: https://github.com/flutter/website
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD p: cupertino_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant