Latest samples and snippets for material

Material:RangeSlider

MATERIAL RANGESLIDER

Material:ReorderableList

While a drag is underway, the widget returned by the [proxyDecorator] serves as a "proxy" (a substitute) for the item in the list. The proxy is created with the original list item as its child. The [proxyDecorator] in this example is similar to the default one except that it changes the proxy item's background color.
MATERIAL REORDERABLELIST

Material:DatePicker

This sample demonstrates how to create a restorable Material date picker. This is accomplished by enabling state restoration by specifying [MaterialApp.restorationScopeId] and using [Navigator.restorablePush] to push [DatePickerDialog] when the button is tapped.
MATERIAL DATEPICKER

Material:Tooltip

This example shows how [Tooltip] can be shown manually with [TooltipTriggerMode.manual] by calling the [TooltipState.ensureTooltipVisible] function.
MATERIAL TOOLTIP

Material:Slider

MATERIAL SLIDER

Material:Radio

Here is an example of Radio widgets wrapped in ListTiles, which is similar to what you could get with the RadioListTile widget. The currently selected character is passed into `groupValue`, which is maintained by the example's `State`. In this case, the first `Radio` will start off selected because `_character` is initialized to `SingingCharacter.lafayette`. If the second radio button is pressed, the example's state is updated with `setState`, updating `_character` to `SingingCharacter.jefferson`. This causes the buttons to rebuild with the updated `groupValue`, and therefore the selection of the second button. Requires one of its ancestors to be a [Material] widget.
MATERIAL RADIO

Material:InputDecorator

This example shows how the prefix icon alignment can be changed using [Align] with a fixed `widthFactor` and `heightFactor`.
MATERIAL INPUTDECORATOR

Material:Colors

MATERIAL COLORS

Material:Drawer

MATERIAL DRAWER

Material:ProgressIndicatorTheme

MATERIAL PROGRESSINDICATORTHEME

Material:TextFormField

This example shows how to move the focus to the next field when the user presses the SPACE key.
MATERIAL TEXTFORMFIELD

Material:Colors

MATERIAL COLORS

Material:TextFormField

MATERIAL TEXTFORMFIELD

Material:Colors

MATERIAL COLORS

Material:InkDecoration

MATERIAL INKDECORATION

Material:About

This sample shows two ways to open [AboutDialog]. The first one uses an [AboutListTile], and the second uses the [showAboutDialog] function.
MATERIAL ABOUT

Material:Colors

MATERIAL COLORS

Material:Colors

MATERIAL COLORS

Material:RefreshIndicator

This example shows how [RefreshIndicator] can be triggered in different ways.
MATERIAL REFRESHINDICATOR

Material:Scaffold

This example shows a [Scaffold] with an [AppBar], a [BottomAppBar] and a [FloatingActionButton]. The [body] is a [Text] placed in a [Center] in order to center the text within the [Scaffold]. The [FloatingActionButton] is centered and docked within the [BottomAppBar] using [FloatingActionButtonLocation.centerDocked]. The [FloatingActionButton] is connected to a callback that increments a counter. ![](https://flutter.github.io/assets-for-api-docs/assets/material/scaffold_bottom_app_bar.png)
MATERIAL SCAFFOLD

Material:IconButton

In this sample the icon button's background color is defined with an [Ink] widget whose child is an [IconButton]. The icon button's filled background is a light shade of blue, it's a filled circle, and it's as big as the button is. ![](https://flutter.github.io/assets-for-api-docs/assets/material/icon_button_background.png)
MATERIAL ICONBUTTON

Material:InputDecorator

This sample shows how to style a `TextField` with a prefixIcon that changes color based on the `MaterialState`. The color defaults to gray, be blue while focused and red if in an error state.
MATERIAL INPUTDECORATOR

Material:Colors

MATERIAL COLORS

Material:ChipTheme

MATERIAL CHIPTHEME

Material:CircleAvatar

MATERIAL CIRCLEAVATAR

Material:ListTile

MATERIAL LISTTILE

Material:TextField

MATERIAL TEXTFIELD

Material:Colors

MATERIAL COLORS

Material:AppBar

This sample shows a [SliverAppBar] and it's behavior when using the [pinned], [snap] and [floating] parameters.
MATERIAL APPBAR

Material:Scaffold

MATERIAL SCAFFOLD

Material:Card

This sample shows creation of a [Card] widget that shows album information and two actions.
MATERIAL CARD

Material:Colors

MATERIAL COLORS

Material:Dialog

This sample demonstrates how to use [showDialog] to display a dialog box.
MATERIAL DIALOG

Material:MaterialState

MATERIAL MATERIALSTATE

Material:Scaffold

When the [Scaffold] is actually created in the same `build` function, the `context` argument to the `build` function can't be used to find the [Scaffold] (since it's "above" the widget being returned in the widget tree). In such cases, the following technique with a [Builder] can be used to provide a new scope with a [BuildContext] that is "under" the [Scaffold]:
MATERIAL SCAFFOLD

Material:Colors

MATERIAL COLORS

Material:MaterialState

This example defines a subclass of [RoundedRectangleBorder] and an implementation of [MaterialStateOutlinedBorder], that resolves to [RoundedRectangleBorder] when its widget is selected.
MATERIAL MATERIALSTATE

Material:Colors

MATERIAL COLORS

Material:ProgressIndicator

This example shows a [LinearProgressIndicator] with a changing value.
MATERIAL PROGRESSINDICATOR

Material:Dialog

This sample demonstrates how to create a restorable Material dialog. This is accomplished by enabling state restoration by specifying [MaterialApp.restorationScopeId] and using [Navigator.restorablePush] to push [DialogRoute] when the button is tapped. {@macro flutter.widgets.RestorationManager}
MATERIAL DIALOG

Material:ListTile

MATERIAL LISTTILE

Material:Card

This sample shows creation of [Card] widgets for elevated, filled and outlined types, as described in: https://m3.material.io/components/cards/overview
MATERIAL CARD

Material:Dialog

This demo shows a [TextButton] which when pressed, calls [showDialog]. When called, this method displays a Material dialog above the current contents of the app and returns a [Future] that completes when the dialog is dismissed.
MATERIAL DIALOG

Material:NavigationRail

This example shows a [NavigationRail] used within a Scaffold with 3 [NavigationRailDestination]s. The main content is separated by a divider (although elevation on the navigation rail can be used instead). The `_selectedIndex` is updated by the `onDestinationSelected` callback.
MATERIAL NAVIGATIONRAIL

Material:Colors

MATERIAL COLORS

Material:CheckboxListTile

![Checkbox list tile semantics sample](https://flutter.github.io/assets-for-api-docs/assets/material/checkbox_list_tile_semantics.png) Here is an example of a custom labeled checkbox widget, called LinkedLabelCheckbox, that includes an interactive [RichText] widget that handles tap gestures.
MATERIAL CHECKBOXLISTTILE

Material:Search

MATERIAL SEARCH

Material:InputDecorator

This sample shows how to style a `TextField` using an `InputDecorator`. The TextField displays a "send message" icon to the left of the input area, which is surrounded by a border an all sides. It displays the `hintText` inside the input area to help the user understand what input is required. It displays the `helperText` and `counterText` below the input area. ![](https://flutter.github.io/assets-for-api-docs/assets/material/input_decoration.png)
MATERIAL INPUTDECORATOR

Material:OutlinedButton

Here is an example of a basic [OutlinedButton].
MATERIAL OUTLINEDBUTTON

Material:Autocomplete

This example shows how to create an Autocomplete widget with a custom type. Try searching with text from the name or email field.
MATERIAL AUTOCOMPLETE

Material:ReorderableList

MATERIAL REORDERABLELIST

Material:Colors

MATERIAL COLORS

Material:CheckboxListTile

![CheckboxListTile sample](https://flutter.github.io/assets-for-api-docs/assets/material/checkbox_list_tile.png) This widget shows a checkbox that, when checked, slows down all animations (including the animation of the checkbox itself getting checked!). This sample requires that you also import 'package:flutter/scheduler.dart', so that you can reference [timeDilation].
MATERIAL CHECKBOXLISTTILE

Material:App

MATERIAL APP

Material:ButtonStyle

This sample shows how to create each of the Material 3 button types with Flutter.
MATERIAL BUTTONSTYLE

Material:Radio

MATERIAL RADIO

Material:ThemeData

MATERIAL THEMEDATA

Material:ListTile

Here is an example of using a [StatefulWidget] to keep track of the selected index, and using that to set the `selected` property on the corresponding [ListTile].
MATERIAL LISTTILE

Material:Dialog

MATERIAL DIALOG

Material:NavigationBar

This example shows a [NavigationBar] as it is used within a [Scaffold] widget. The [NavigationBar] has three [NavigationDestination] widgets and the [selectedIndex] is set to index 0. The `onDestinationSelected` callback changes the selected item's index and displays a corresponding widget in the body of the [Scaffold].
MATERIAL NAVIGATIONBAR

Material:Scaffold

Typical usage of the [ScaffoldMessenger.of] function is to call it in response to a user gesture or an application state change.
MATERIAL SCAFFOLD

Material:FlexibleSpaceBar

This sample application demonstrates the different features of the [FlexibleSpaceBar] when used in a [SliverAppBar]. This app bar is configured to stretch into the overscroll space, and uses the [FlexibleSpaceBar.stretchModes] to apply `fadeTitle`, `blurBackground` and `zoomBackground`. The app bar also makes use of [CollapseMode.parallax] by default.
MATERIAL FLEXIBLESPACEBAR

Material:ThemeData

This sample shows how to create and use a subclass of [ThemeExtension] that defines two colors.
MATERIAL THEMEDATA

Material:Scaffold

Here is an example of showing a [SnackBar] when the user presses a button.
MATERIAL SCAFFOLD

Material:Chip

MATERIAL CHIP

Material:Radio

This example shows how to enable deselecting a radio button by setting the [toggleable] attribute.
MATERIAL RADIO

Material:SwitchListTile

![SwitchListTile sample](https://flutter.github.io/assets-for-api-docs/assets/material/switch_list_tile.png) This widget shows a switch that, when toggled, changes the state of a [bool] member field called `_lights`.
MATERIAL SWITCHLISTTILE

Material:TooltipTheme

MATERIAL TOOLTIPTHEME

Material:Colors

MATERIAL COLORS

Material:Scaffold

Typical usage of the [Scaffold.of] function is to call it from within the `build` method of a child of a [Scaffold].
MATERIAL SCAFFOLD

Material:TimePicker

MATERIAL TIMEPICKER

Material:TextButton

This sample shows how to render a disabled TextButton, an enabled TextButton and lastly a TextButton with gradient background.
MATERIAL TEXTBUTTON

Material:DatePicker

This sample demonstrates how to create a restorable Material date range picker. This is accomplished by enabling state restoration by specifying [MaterialApp.restorationScopeId] and using [Navigator.restorablePush] to push [DateRangePickerDialog] when the button is tapped.
MATERIAL DATEPICKER

Material:ThemeData

MATERIAL THEMEDATA

Material:Colors

MATERIAL COLORS

Material:ExpansionTile

This example demonstrates different configurations of ExpansionTile.
MATERIAL EXPANSIONTILE

Material:TextTheme

MATERIAL TEXTTHEME

Material:Stepper

An example the shows how to use the [Stepper], and the [Stepper] UI appearance.
MATERIAL STEPPER

Material:Colors

MATERIAL COLORS

Material:Feedback

MATERIAL FEEDBACK

Material:SwitchListTile

![Custom switch list tile sample](https://flutter.github.io/assets-for-api-docs/assets/material/switch_list_tile_custom.png) Here is an example of a custom LabeledSwitch widget, but you can easily make your own configurable widget.
MATERIAL SWITCHLISTTILE

Material:NavigationRail

This sample shows the creation of [NavigationRail] widget used within a Scaffold with 3 [NavigationRailDestination]s, as described in: https://m3.material.io/components/navigation-rail/overview
MATERIAL NAVIGATIONRAIL

Material:Divider

This sample shows how to display a Divider between an orange and blue box inside a column. The Divider is 20 logical pixels in height and contains a vertically centered black line that is 5 logical pixels thick. The black line is indented by 20 logical pixels. ![](https://flutter.github.io/assets-for-api-docs/assets/material/divider.png)
MATERIAL DIVIDER

Material:Feedback

MATERIAL FEEDBACK

Material:SliderTheme

MATERIAL SLIDERTHEME

Material:Scrollbar

When [thumbVisibility] is true, the scrollbar thumb will remain visible without the fade animation. This requires that a [ScrollController] is provided to controller, or that the [PrimaryScrollController] is available. When a [ScrollView.scrollDirection] is [Axis.horizontal], it is recommended that the [Scrollbar] is always visible, since scrolling in the horizontal axis is less discoverable.
MATERIAL SCROLLBAR

Material:ToggleButtons

This example showcase [ToggleButtons] in various configurations.
MATERIAL TOGGLEBUTTONS

Material:SwitchListTile

![Switch list tile semantics sample](https://flutter.github.io/assets-for-api-docs/assets/material/switch_list_tile_semantics.png) Here is an example of a custom labeled radio widget, called LinkedLabelRadio, that includes an interactive [RichText] widget that handles tap gestures.
MATERIAL SWITCHLISTTILE

Material:ChipInput

MATERIAL CHIPINPUT

Material:AppBar

MATERIAL APPBAR

Material:RadioListTile

This example shows how to enable deselecting a radio button by setting the [toggleable] attribute.
MATERIAL RADIOLISTTILE

Material:MaterialStateMixin

MATERIAL MATERIALSTATEMIXIN

Material:Tooltip

This example show a basic [Tooltip] which has a [Text] as child. [message] contains your label to be shown by the tooltip when the child that Tooltip wraps is hovered over on web or desktop. On mobile, the tooltip is shown when the widget is long pressed.
MATERIAL TOOLTIP

Material:Checkbox

This example shows how you can override the default theme of of a [Checkbox] with a [MaterialStateProperty]. In this example, the checkbox's color will be `Colors.blue` when the [Checkbox] is being pressed, hovered, or focused. Otherwise, the checkbox's color will be `Colors.red`.
MATERIAL CHECKBOX

Material:Tooltip

This example shows a rich [Tooltip] that specifies the [richMessage] parameter instead of the [message] parameter (only one of these may be non-null. Any [InlineSpan] can be specified for the [richMessage] attribute, including [WidgetSpan].
MATERIAL TOOLTIP

Material:Dropdown

This sample shows a `DropdownButton` with a large arrow icon, purple text style, and bold purple underline, whose value is one of "One", "Two", "Free", or "Four". ![](https://flutter.github.io/assets-for-api-docs/assets/material/dropdown_button.png)
MATERIAL DROPDOWN

Material:MaterialState

This example defines a subclass of [MaterialStateBorderSide], that resolves to a red border side when its widget is selected.
MATERIAL MATERIALSTATE

Material:Colors

MATERIAL COLORS

Material:Scaffold

Sometimes [SnackBar]s are produced by code that doesn't have ready access to a valid [BuildContext]. One such example of this is when you show a SnackBar from a method outside of the `build` function. In these cases, you can assign a [GlobalKey] to the [ScaffoldMessenger]. This example shows a key being used to obtain the [ScaffoldMessengerState] provided by the [MaterialApp].
MATERIAL SCAFFOLD

Material:Scaffold

This example shows a [Scaffold] with a blueGrey [backgroundColor], [body] and [FloatingActionButton]. The [body] is a [Text] placed in a [Center] in order to center the text within the [Scaffold]. The [FloatingActionButton] is connected to a callback that increments a counter. ![](https://flutter.github.io/assets-for-api-docs/assets/material/scaffold_background_color.png)
MATERIAL SCAFFOLD

Material:Colors

MATERIAL COLORS

Material:Icons

MATERIAL ICONS

Material:PopupMenu

MATERIAL POPUPMENU

Material:CheckboxListTile

![Custom checkbox list tile sample](https://flutter.github.io/assets-for-api-docs/assets/material/checkbox_list_tile_custom.png) Here is an example of a custom LabeledCheckbox widget, but you can easily make your own configurable widget.
MATERIAL CHECKBOXLISTTILE

Material:RangeSlider

![A range slider widget, consisting of 5 divisions and showing the default value indicator.](https://flutter.github.io/assets-for-api-docs/assets/material/range_slider.png) This range values are in intervals of 20 because the Range Slider has 5 divisions, from 0 to 100. This means are values are split between 0, 20, 40, 60, 80, and 100. The range values are initialized with 40 and 80 in this demo.
MATERIAL RANGESLIDER

Material:App

MATERIAL APP

Material:Scaffold

To disable the drawer edge swipe, set the [Scaffold.endDrawerEnableOpenDragGesture] to false. Then, use [ScaffoldState.openEndDrawer] to open the drawer and [Navigator.pop] to close it.
MATERIAL SCAFFOLD

Material:RadioListTile

![RadioListTile sample](https://flutter.github.io/assets-for-api-docs/assets/material/radio_list_tile.png) This widget shows a pair of radio buttons that control the `_character` field. The field is of the type `SingingCharacter`, an enum.
MATERIAL RADIOLISTTILE

Material:Card

This sample shows creation of a [Card] widget that can be tapped. When tapped this [Card]'s [InkWell] displays an "ink splash" that fills the entire card.
MATERIAL CARD

Material:Colors

MATERIAL COLORS

Material:SliderTheme

MATERIAL SLIDERTHEME

Material:Chip

MATERIAL CHIP

Material:Colors

MATERIAL COLORS

Material:Chip

MATERIAL CHIP

Material:TabController

This example shows how to listen to page updates in [TabBar] and [TabBarView] when using [DefaultTabController].
MATERIAL TABCONTROLLER

Material:FloatingActionButton

This sample shows the creation of [FloatingActionButton] widget in the typical location in a Scaffold, as described in: https://m3.material.io/components/floating-action-button/overview
MATERIAL FLOATINGACTIONBUTTON

Material:AppBar

This sample shows an [AppBar] with two simple actions. The first action opens a [SnackBar], while the second action navigates to a new page.
MATERIAL APPBAR

Material:Scaffold

To disable the drawer edge swipe, set the [Scaffold.drawerEnableOpenDragGesture] to false. Then, use [ScaffoldState.openDrawer] to open the drawer and [Navigator.pop] to close it.
MATERIAL SCAFFOLD

Material:ChipChoice

MATERIAL CHIPCHOICE

Material:Dialog

This sample shows the creation of [AlertDialog], as described in: https://m3.material.io/components/dialogs/overview
MATERIAL DIALOG

Material:AppBar

MATERIAL APPBAR

Material:AppBar

MATERIAL APPBAR

Material:Colors

MATERIAL COLORS

Material:Banner

Banners placed directly into the widget tree are static.
MATERIAL BANNER

Material:Colors

MATERIAL COLORS

Material:Scaffold

Here is an example of showing a [MaterialBanner] when the user presses a button.
MATERIAL SCAFFOLD

Material:ThemeData

This sample shows how to create and use a subclass of [ThemeExtension] that defines two colors.
MATERIAL THEMEDATA

Material:FloatingActionButton

This sample shows the creation of all the variants of [FloatingActionButton] widget as described in: https://m3.material.io/components/floating-action-button/overview
MATERIAL FLOATINGACTIONBUTTON

Material:InkDecoration

MATERIAL INKDECORATION

Material:ElevatedButton

This sample produces an enabled and a disabled ElevatedButton.
MATERIAL ELEVATEDBUTTON

Material:InputDecorator

This sample shows how to style a `TextField` with a prefixIcon that changes color based on the `MaterialState` through the use of `ThemeData`. The color defaults to gray, be blue while focused and red if in an error state.
MATERIAL INPUTDECORATOR

Material:Colors

MATERIAL COLORS

Material:TextTheme

MATERIAL TEXTTHEME

Material:FloatingActionButton

This example shows how to display a [FloatingActionButton] in a [Scaffold], with a pink [backgroundColor] and a thumbs up [Icon]. ![](https://flutter.github.io/assets-for-api-docs/assets/material/floating_action_button.png)
MATERIAL FLOATINGACTIONBUTTON

Material:Colors

MATERIAL COLORS

Material:InputDecorator

It's possible to override the label style for just the error state, or just the default state, or both. In this example the [labelStyle] is specified with a [MaterialStateProperty] which resolves to a text style whose color depends on the decorator's error state.
MATERIAL INPUTDECORATOR

Material:Colors

MATERIAL COLORS

Material:ReorderableList

MATERIAL REORDERABLELIST

Material:Time

MATERIAL TIME

Material:BottomNavigationBar

This example shows a [BottomNavigationBar] as it is used within a [Scaffold] widget. The [BottomNavigationBar] has three [BottomNavigationBarItem] widgets, which means it defaults to [BottomNavigationBarType.fixed], and the [currentIndex] is set to index 0. The selected item is amber. The `_onItemTapped` function changes the selected item's index and displays a corresponding message in the center of the [Scaffold].
MATERIAL BOTTOMNAVIGATIONBAR

Material:InputDecorator

This example shows the differences between two `TextField` widgets when [prefixIconConstraints] is set to the default value and when one is not. Note that [isDense] must be set to true to be able to set the constraints smaller than 48px. If null, [BoxConstraints] with a minimum width and height of 48px is used.
MATERIAL INPUTDECORATOR

Material:ListTile

Here is an example of a custom list item that resembles a YouTube-related video list item created with [Expanded] and [Container] widgets. ![Custom list item a](https://flutter.github.io/assets-for-api-docs/assets/widgets/custom_list_item_a.png)
MATERIAL LISTTILE

Material:Slider

![A slider widget, consisting of 5 divisions and showing the default value indicator.](https://flutter.github.io/assets-for-api-docs/assets/material/slider.png) The Sliders value is part of the Stateful widget subclass to change the value setState was called.
MATERIAL SLIDER

Material:InputDecorator

This example shows how the suffix icon alignment can be changed using [Align] with a fixed `widthFactor` and `heightFactor`.
MATERIAL INPUTDECORATOR

Material:RadioListTile

![Radio list tile semantics sample](https://flutter.github.io/assets-for-api-docs/assets/material/radio_list_tile_semantics.png) Here is an example of a custom labeled radio widget, called LinkedLabelRadio, that includes an interactive [RichText] widget that handles tap gestures.
MATERIAL RADIOLISTTILE

Material:ChipFilter

MATERIAL CHIPFILTER

Material:Scaffold

Here is an example of showing a [SnackBar] when the user presses a button.
MATERIAL SCAFFOLD

Material:InputDecorator

This sample shows how to style a `TextField` with a round border and additional text before and after the input area. It displays "Prefix" before the input area, and "Suffix" after the input area. ![](https://flutter.github.io/assets-for-api-docs/assets/material/input_decoration_prefix_suffix.png)
MATERIAL INPUTDECORATOR

Material:Autocomplete

This example shows how to create a very basic Autocomplete widget using the default UI.
MATERIAL AUTOCOMPLETE

Material:Tabs

[TabBar] can also be implemented by using a [TabController] which provides more options to control the behavior of the [TabBar] and [TabBarView]. This can be used instead of a [DefaultTabController], demonstrated below.
MATERIAL TABS

Material:Dropdown

This sample shows a `DropdownButton` with a button with [Text] that corresponds to but is unique from [DropdownMenuItem].
MATERIAL DROPDOWN

Material:AnimatedIcons

MATERIAL ANIMATEDICONS

Material:InkWell

Tap the container to cause it to grow. Then, tap it again and hold before the widget reaches its maximum size to observe the clipped ink splash.
MATERIAL INKWELL

Material:AppBar

MATERIAL APPBAR

Material:BottomNavigationBar

This example shows a [BottomNavigationBar] as it is used within a [Scaffold] widget. The [BottomNavigationBar] has four [BottomNavigationBarItem] widgets, which means it defaults to [BottomNavigationBarType.shifting], and the [currentIndex] is set to index 0. The selected item is amber in color. With each [BottomNavigationBarItem] widget, backgroundColor property is also defined, which changes the background color of [BottomNavigationBar], when that item is selected. The `_onItemTapped` function changes the selected item's index and displays a corresponding message in the center of the [Scaffold].
MATERIAL BOTTOMNAVIGATIONBAR

Material:Divider

This sample shows how to display a [VerticalDivider] between a purple and orange box inside a [Row]. The [VerticalDivider] is 20 logical pixels in width and contains a horizontally centered black line that is 1 logical pixels thick. The grey line is indented by 20 logical pixels.
MATERIAL DIVIDER

Material:ExpansionPanel

Here is a simple example of how to implement ExpansionPanelList.radio.
MATERIAL EXPANSIONPANEL

Material:Colors

MATERIAL COLORS

Material:FloatingActionButtonLocation

This is an example of a user-defined [FloatingActionButtonLocation]. The example shows a [Scaffold] with an [AppBar], a [BottomAppBar], and a [FloatingActionButton] using a custom [FloatingActionButtonLocation]. The new [FloatingActionButtonLocation] is defined by extending [StandardFabLocation] with two mixins, [FabEndOffsetX] and [FabFloatOffsetY], and overriding the [getOffsetX] method to adjust the FAB's x-coordinate, creating a [FloatingActionButtonLocation] slightly different from [FloatingActionButtonLocation.endFloat].
MATERIAL FLOATINGACTIONBUTTONLOCATION

Material:ChipTheme

MATERIAL CHIPTHEME

Material:InputDecorator

This sample shows how to style a "collapsed" `TextField` using an `InputDecorator`. The collapsed `TextField` surrounds the hint text and input area with a border, but does not add padding around them. ![](https://flutter.github.io/assets-for-api-docs/assets/material/input_decoration_collapsed.png)
MATERIAL INPUTDECORATOR

Material:ListTile

MATERIAL LISTTILE

Material:InkDecoration

Wrapping the [Ink] in a clipping widget directly will not work since the [Material] it will be printed on is responsible for clipping. In this example the image is not being clipped as expected. This is because it is being rendered onto the Scaffold body Material, which isn't wrapped in the [ClipRRect].
MATERIAL INKDECORATION

Material:SnackBar

Here is an example of a customized [SnackBar]. It utilizes [behavior], [shape], [padding], [width], and [duration] to customize the location, appearance, and the duration for which the [SnackBar] is visible.
MATERIAL SNACKBAR

Material:Colors

MATERIAL COLORS

Material:RadioListTile

![Custom radio list tile sample](https://flutter.github.io/assets-for-api-docs/assets/material/radio_list_tile_custom.png) Here is an example of a custom LabeledRadio widget, but you can easily make your own configurable widget.
MATERIAL RADIOLISTTILE

Material:InputDecorator

This example shows the differences between two `TextField` widgets when [suffixIconConstraints] is set to the default value and when one is not. Note that [isDense] must be set to true to be able to set the constraints smaller than 48px. If null, [BoxConstraints] with a minimum width and height of 48px is used.
MATERIAL INPUTDECORATOR

Material:TextField

This sample shows how to get a value from a TextField via the [onSubmitted] callback.
MATERIAL TEXTFIELD

Material:ReorderableList

MATERIAL REORDERABLELIST

Material:BottomAppBar

MATERIAL BOTTOMAPPBAR

Material:Colors

MATERIAL COLORS

Material:FloatingActionButton

This example shows how to make an extended [FloatingActionButton] in a [Scaffold], with a pink [backgroundColor], a thumbs up [Icon] and a [Text] label that reads "Approve". ![](https://flutter.github.io/assets-for-api-docs/assets/material/floating_action_button_label.png)
MATERIAL FLOATINGACTIONBUTTON

Material:ExpansionPanel

Here is a simple example of how to implement ExpansionPanelList.
MATERIAL EXPANSIONPANEL

Material:Colors

MATERIAL COLORS

Material:MaterialState

This example shows how you can override the default text and icon color (the "foreground color") of a [TextButton] with a [MaterialStateProperty]. In this example, the button's text color will be `Colors.blue` when the button is being pressed, hovered, or focused. Otherwise, the text color will be `Colors.red`.
MATERIAL MATERIALSTATE

Material:ListTile

MATERIAL LISTTILE

Material:TextSelectionTheme

MATERIAL TEXTSELECTIONTHEME

Material:TextField

MATERIAL TEXTFIELD

Material:Stepper

Creates a stepper control with custom buttons.
MATERIAL STEPPER

Material:SelectableText

MATERIAL SELECTABLETEXT

Material:App

MATERIAL APP

Material:Colors

MATERIAL COLORS

Material:TabController

MATERIAL TABCONTROLLER

Material:InkDecoration

One solution would be to deliberately wrap the [Ink.image] in a [Material]. This makes sure the Material that the image is painted on is also responsible for clipping said content.
MATERIAL INKDECORATION

Material:ListTile

Here is an example of an article list item with multiline titles and subtitles. It utilizes [Row]s and [Column]s, as well as [Expanded] and [AspectRatio] widgets to organize its layout. ![Custom list item b](https://flutter.github.io/assets-for-api-docs/assets/widgets/custom_list_item_b.png)
MATERIAL LISTTILE

Material:BottomAppBar

This example shows the [BottomAppBar], which can be configured to have a notch using the [BottomAppBar.shape] property. This also includes an optional [FloatingActionButton], which illustrates the [FloatingActionButtonLocation]s in relation to the [BottomAppBar].
MATERIAL BOTTOMAPPBAR

Material:Scrollbar

This sample shows a [Scrollbar] that executes a fade animation as scrolling occurs. The Scrollbar will fade into view as the user scrolls, and fade out when scrolling stops.
MATERIAL SCROLLBAR

Material:Checkbox

MATERIAL CHECKBOX

Material:ProgressIndicator

This example shows a [CircularProgressIndicator] with a changing value.
MATERIAL PROGRESSINDICATOR

Material:ThemeData

MATERIAL THEMEDATA

Material:InkSparkle

MATERIAL INKSPARKLE

Material:Colors

MATERIAL COLORS

Material:Switch

MATERIAL SWITCH

Material:Tabs

This sample shows the implementation of [TabBar] and [TabBarView] using a [DefaultTabController]. Each [Tab] corresponds to a child of the [TabBarView] in the order they are written.
MATERIAL TABS

Material:Chip

This sample shows how to use [onDeleted] to remove an entry when the delete button is tapped.
MATERIAL CHIP

Material:ChipAction

MATERIAL CHIPACTION

Material:MaterialStateMixin

MATERIAL MATERIALSTATEMIXIN

Material:Banner

MaterialBanner's can also be presented through a [ScaffoldMessenger]. Here is an example where ScaffoldMessengerState.showMaterialBanner() is used to show the MaterialBanner.
MATERIAL BANNER

Material:Switch

MATERIAL SWITCH

Material:SnackBar

Here is an example of a [SnackBar] with an [action] button implemented using [SnackBarAction].
MATERIAL SNACKBAR

Material:Scaffold

This example shows a [Scaffold] with a [body] and [FloatingActionButton]. The [body] is a [Text] placed in a [Center] in order to center the text within the [Scaffold]. The [FloatingActionButton] is connected to a callback that increments a counter. ![The Scaffold has a white background with a blue AppBar at the top. A blue FloatingActionButton is positioned at the bottom right corner of the Scaffold.](https://flutter.github.io/assets-for-api-docs/assets/material/scaffold.png)
MATERIAL SCAFFOLD

Material:IconButton

This sample shows an `IconButton` that uses the Material icon "volume_up" to increase the volume. ![](https://flutter.github.io/assets-for-api-docs/assets/material/icon_button.png)
MATERIAL ICONBUTTON

Material:BottomSheet

This example demonstrates how to use `showModalBottomSheet` to display a bottom sheet that obscures the content behind it when a user taps a button. It also demonstrates how to close the bottom sheet using the [Navigator] when a user taps on a button inside the bottom sheet.
MATERIAL BOTTOMSHEET

Material:NavigationRail

This example shows how to use this animation to create a [FloatingActionButton] that animates itself between the normal and extended states of the [NavigationRail]. An instance of `MyNavigationRailFab` is created for [NavigationRail.leading]. Pressing the FAB button toggles the "extended" state of the [NavigationRail].
MATERIAL NAVIGATIONRAIL

Material:Colors

MATERIAL COLORS

Material:Colors

MATERIAL COLORS

Material:Dropdown

This sample shows a `DropdownButton` with a dropdown button text style that is different than its menu items.
MATERIAL DROPDOWN

Material:App

MATERIAL APP

Material:PopupMenu

This example shows a menu with four items, selecting between an enum's values and setting a `_selectedMenu` field based on the selection
MATERIAL POPUPMENU

Material:Dialog

This sample shows the creation of [showDialog], as described in: https://m3.material.io/components/dialogs/overview
MATERIAL DIALOG

Material:SelectableText

MATERIAL SELECTABLETEXT

Material:Tooltip

This example covers most of the attributes available in Tooltip. `decoration` has been used to give a gradient and borderRadius to Tooltip. `height` has been used to set a specific height of the Tooltip. `preferBelow` is false, the tooltip will prefer showing above [Tooltip]'s child widget. However, it may show the tooltip below if there's not enough space above the widget. `textStyle` has been used to set the font size of the 'message'. `showDuration` accepts a Duration to continue showing the message after the long press has been released or the mouse pointer exits the child widget. `waitDuration` accepts a Duration for which a mouse pointer has to hover over the child widget before the tooltip is shown.
MATERIAL TOOLTIP

Material:Scaffold

This example demonstrates how to use `showBottomSheet` to display a bottom sheet when a user taps a button. It also demonstrates how to close a bottom sheet using the Navigator.
MATERIAL SCAFFOLD

Material:MaterialState

This example defines a mouse cursor that resolves to [SystemMouseCursors.forbidden] when its widget is disabled.
MATERIAL MATERIALSTATE

Material:Colors

MATERIAL COLORS

Material:Colors

MATERIAL COLORS

Material:App

MATERIAL APP

Material:Colors

MATERIAL COLORS

Material:DataTable

This sample shows how to display a [DataTable] with three columns: name, age, and role. The columns are defined by three [DataColumn] objects. The table contains three rows of data for three example users, the data for which is defined by three [DataRow] objects. ![](https://flutter.github.io/assets-for-api-docs/assets/material/data_table.png)
MATERIAL DATATABLE

Material:Divider

MATERIAL DIVIDER

Material:InputDecorator

This example shows a `TextField` with a [Text.rich] widget as the [label]. The widget contains multiple [Text] widgets with different [TextStyle]'s.
MATERIAL INPUTDECORATOR

Material:DataTable

This sample shows how to display a [DataTable] with alternate colors per row, and a custom color for when the row is selected.
MATERIAL DATATABLE

Material:InputDecorator

It's possible to override the label style for just the error state, or just the default state, or both. In this example the [floatingLabelStyle] is specified with a [MaterialStateProperty] which resolves to a text style whose color depends on the decorator's error state.
MATERIAL INPUTDECORATOR

Material:Colors

MATERIAL COLORS

Material:Colors

MATERIAL COLORS

Material:Icons

MATERIAL ICONS

Material:InputDecorator

This sample shows how to create a `TextField` with hint text, a red border on all sides, and an error message. To display a red border and error message, provide `errorText` to the `InputDecoration` constructor. ![](https://flutter.github.io/assets-for-api-docs/assets/material/input_decoration_error.png)
MATERIAL INPUTDECORATOR