[Feedback Requested] Cross-platform Adaptation for Top App Bars (Navigation Bars) #93
leighajarett
started this conversation in
Cross-platform Design
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is a top app bar?
Top app bars display information and actions at the top of the screen. They can contain:
Platform differences
On the latest version of Android, app bars follow the design guidelines defined in Material 3. On iOS, an equivalent component is defined in Apple’s Human Interface Guidelines called navigation bars.
Both Material 3 and HIGs offer different designs depending on whether or not the user has scrolled on the page. For example, many iOS and Android system app bars display the text underneath the leading component when the user is positioned at the top of the page (see images below).
There are some notable differences on the design of the app bar between the two platforms, as shown in the table below. Note that Material colors referenced below a
arrow back
chevron backward
San Francisco bold (title)
For developer guidance, see UIBlurEffect.Style
Border: 1ps 0x4D000000
Medium: 112ps
Large: 152ps
Large: 117ps
Medium top: (8,4,0,4)
Medium bottom: (0,16,20,16)
Large top: (8,4,20,4)
Large bottom: (40,16,20,16)
Click here to see Material top app bar detailed padding specs
Large top: (0,6,0,6)
Large bottom: (4,16,8,16)
The Flutter framework has four different widgets for displaying app bars:
Adaptation recommendation
We recommend leveraging the platform-specific properties for the following:
Rationale and exceptions
Matching iOS styling can help your Flutter app feel more natural to iOS users. However, it's important for your app bar to feel cohesive with the rest of your app. So, there are a few exceptions noted below:
Example Code
Many Flutter apps leverage the existing Material
AppBar
widget or theSliverAppBar
widget. These already supports the following automatic adaptations:BackButton
: is used by default as the leading component. The icon adapts to the platform icon by default.However, you can further customize properties to match the iOS system as shown below:
Text styling
To match iOS styling, map the
headlineMedium
MaterialtextTheme
to the CupertinonavLargeTitleTextStyle
textTheme:App Bar
SliverAppBar
Automated Adaptation
Automated adaptation is not yet supported by Flutter for app bars. However, we are exploring ways to make this easier within the framework. If you’d like the Flutter team or community contributors to prioritize this feature, you can upvote flutter/flutter#124330 with a 👍emoji. If you have other ideas on how to make this experience more seamless, please add comments to this discussion.
Beta Was this translation helpful? Give feedback.
All reactions