text
stringlengths
1
474
scroll controller to the top position.
There is no equivalent behavior on Android.<topic_end>
<topic_start>
Typography
When using the Material package,
the typography automatically defaults to the
font family appropriate for the platform.
Android uses the Roboto font.
iOS uses the San Francisco font.When using the Cupertino package, the default theme
uses the San Francisco font.The San Francisco font license limits its usage to
software running on iOS, macOS, or tvOS only.
Therefore a fallback font is used when running on Android
if the platform is debug-overridden to iOS or the
default Cupertino theme is used.You might choose to adapt the text styling of Material
widgets to match the default text styling on iOS.
You can see widget-specific examples in the
UI Component section.<topic_end>
<topic_start>
Iconography
When using the Material package,
certain icons automatically show different
graphics depending on the platform.
For instance, the overflow button’s three dots
are horizontal on iOS and vertical on Android.
The back button is a simple chevron on iOS and
has a stem/shaft on Android.The material library also provides a set of platform-adaptive icons through Icons.adaptive.<topic_end>
<topic_start>
Haptic feedback
The Material and Cupertino packages automatically
trigger the platform appropriate haptic feedback in
certain scenarios.For instance,
a word selection via text field long-press triggers a ‘buzz’
vibrate on Android and not on iOS.Scrolling through picker items on iOS triggers a
‘light impact’ knock and no feedback on Android.<topic_end>
<topic_start>
Text editing
Flutter also makes the below adaptations while editing
the content of text fields to match the current platform.<topic_end>
<topic_start>
Keyboard gesture navigation
On Android,
horizontal swipes can be made on the soft keyboard’s space key
to move the cursor in Material and Cupertino text fields.On iOS devices with 3D Touch capabilities,
a force-press-drag gesture could be made on the soft
keyboard to move the cursor in 2D via a floating cursor.
This works on both Material and Cupertino text fields.<topic_end>
<topic_start>
Text selection toolbar
With Material on Android,
the Android style selection toolbar is shown when
a text selection is made in a text field.With Material on iOS or when using Cupertino,
the iOS style selection toolbar is shown when a text
selection is made in a text field.<topic_end>
<topic_start>
Single tap gesture
With Material on Android,
a single tap in a text field puts the cursor at the
location of the tap.A collapsed text selection also shows a draggable
handle to subsequently move the cursor.With Material on iOS or when using Cupertino,
a single tap in a text field puts the cursor at the
nearest edge of the word tapped.Collapsed text selections don’t have draggable handles on iOS.<topic_end>
<topic_start>
Long-press gesture
With Material on Android,
a long press selects the word under the long press.
The selection toolbar is shown upon release.With Material on iOS or when using Cupertino,
a long press places the cursor at the location of the
long press. The selection toolbar is shown upon release.<topic_end>
<topic_start>
Long-press drag gesture
With Material on Android,
dragging while holding the long press expands the words selected.With Material on iOS or when using Cupertino,
dragging while holding the long press moves the cursor.<topic_end>
<topic_start>
Double tap gesture
On both Android and iOS,
a double tap selects the word receiving the
double tap and shows the selection toolbar.<topic_end>
<topic_start>
UI components
This section includes preliminary recommendations on how to adapt
Material widgets to deliver a natural and compelling experience on iOS.
Your feedback is welcomed on issue #8427.<topic_end>
<topic_start>
Widgets with .adaptive() constructors
Several widgets support .adaptive() constructors.
The following table lists these widgets.
Adaptive constructors substitute the corresponding Cupertino components
when the app is run on an iOS device.Widgets in the following table are used primarily for input,
selection, and to display system information.
Because these controls are tightly integrated with the operating system,
users have been trained to recognize and respond to them.
Therefore, we recommend that you follow platform conventions.<topic_end>
<topic_start>
Top app bar and navigation bar
Since Android 12, the default UI for top app
bars follows the design guidelines defined in Material 3.
On iOS, an equivalent component called “Navigation Bars”
is defined in Apple’s Human Interface Guidelines (HIG).Certain properties of app bars in Flutter apps should be adapted,
like system icons and page transitions.