areesha-06/flutter-docs-api
0
1{"url": "https://docs.flutter.dev/ui/adaptive-responsive/more-info", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nExamples\nIf you'd like to see how the adaptive and responsive\n concepts (as described in these pages) come together,\n check out the source code for the following apps:\nWonderous\nFlutter adaptive demo\nLearn more about basic usability principles\nOf course, these pages don't constitute an\n exhaustive list of the things you might consider.\n The more operating"}
2{"url": "https://docs.flutter.dev/ui/adaptive-responsive/more-info", "title": "Untitled", "text": " exhaustive list of the things you might consider.\n The more operating systems, form factors,\n and input devices you support, the more difficult\n it becomes to spec out every permutation in design.\nTaking time to learn basic usability principles as a\n developer empowers you to make better decisions,\n reduces back-and-forth iterations with\n design during production, and results in\n "}
3{"url": "https://docs.flutter.dev/ui/adaptive-responsive/more-info", "title": "Untitled", "text": "reduces back-and-forth iterations with\n design during production, and results in\n improved productivity with better outcomes.\nHere are some resources that you might find useful:\nAndroid large screen guidelines\nMaterial guidelines on applying layout\nMaterial design for large screens\nMaterial guidelines on canonical layouts\nBuild high quality apps (Android)\nUI design do's and don'ts (Apple)\nHuman interface guidelines (Apple)\nResponsive design techniques (Microsoft"}
4{"url": "https://docs.flutter.dev/ui/adaptive-responsive/more-info", "title": "Untitled", "text": "n do's and don'ts (Apple)\nHuman interface guidelines (Apple)\nResponsive design techniques (Microsoft)\nMachine sizes and breakpoints (Microsoft)\nHow to build Adaptive UI with Flutter ,\n a Google I/O 2024 video.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-11. View source or report an issue ."}
5{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nThe final area to consider for adaptive apps is platform standards.\n Each platform has its own idioms and norms;\n these nominal or de facto standards inform user expectations\n of how an application should behave. Thanks, in part to the web,\n users are accustomed to more customized experiences,\n but reflecting these platform standards can "}
6{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "tomed to more customized experiences,\n but reflecting these platform standards can still provide\n significant benefits:\nReduce cognitive load\nBy matching the user's existing mental model,\n accomplishing tasks becomes intuitive,\n which requires less thinking,\n boosts productivity, and reduces frustrations.\nBuild trust\nUsers can become wary or suspicious\n when applications don't ad"}
7{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "ns.\nBuild trust\nUsers can become wary or suspicious\n when applications don't adhere to their expectations.\n Conversely, a UI that feels familiar can build user trust\n and can help improve the perception of quality.\n This often has the added benefit of better app store\n ratings—something we can all appreciate!\nConsider expected behavior on each platform\nThe first step is to spend some time con"}
8{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "all appreciate!\nConsider expected behavior on each platform\nThe first step is to spend some time considering what\n the expected appearance, presentation,\n or behavior is on this platform.\n Try to forget any limitations of your current implementation,\n and just envision the ideal user experience.\n Work backwards from there.\nAnother way to think about this is to ask,\n \"How would a user of this pla"}
9{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "om there.\nAnother way to think about this is to ask,\n \"How would a user of this platform expect to achieve this goal?\"\n Then, try to envision how that would work in your app\n without any compromises.\nThis can be difficult if you aren't a regular user of the platform.\n You might be unaware of the specific idioms and can easily miss\n them completely. For example, a lifetime Android user is\n likely"}
10{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "\n them completely. For example, a lifetime Android user is\n likely unaware of platform conventions on iOS,\n and the same holds true for macOS, Linux, and Windows.\n These differences might be subtle to you,\n but be painfully obvious to an experienced user.\nFind a platform advocate\nIf possible, assign someone as an advocate for each platform.\n Ideally, your advocate uses the platform as their prim"}
11{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "advocate for each platform.\n Ideally, your advocate uses the platform as their primary device,\n and can offer the perspective of a highly opinionated user.\n To reduce the number of people, combine roles.\n Have one advocate for Windows and Android,\n one for Linux and the web, and one for Mac and iOS.\nThe goal is to have constant, informed feedback so the app\n feels great on each platform. Advocat"}
12{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": " have constant, informed feedback so the app\n feels great on each platform. Advocates should be encouraged\n to be quite picky, calling out anything they feel differs from\n typical applications on their device. A simple example is how\n the default button in a dialog is typically on the left on Mac\n and Linux, but is on the right on Windows.\n Details like that are easy to miss if you aren't using "}
13{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "s on the right on Windows.\n Details like that are easy to miss if you aren't using a platform\n on a regular basis.\nStay unique\nConforming to expected behaviors doesn't mean that your app\n needs to use default components or styling.\n Many of the most popular multiplatform apps have very distinct\n and opinionated UIs including custom buttons, context menus,\n and title bars.\nThe more you can consol"}
14{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "s including custom buttons, context menus,\n and title bars.\nThe more you can consolidate styling and behavior across platforms,\n the easier development and testing will be.\n The trick is to balance creating a unique experience with a\n strong identity, while respecting the norms of each platform.\nCommon idioms and norms to consider\nTake a quick look at a few specific norms and idioms\n you might want to consider, "}
15{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "\nTake a quick look at a few specific norms and idioms\n you might want to consider, and how you could approach\n them in Flutter.\nScrollbar appearance and behavior\nDesktop and mobile users expect scrollbars,\n but they expect them to behave differently on different platforms.\n Mobile users expect smaller scrollbars that only appear\n while scrolling, whereas desktop users generally expect\n omniprese"}
16{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": " while scrolling, whereas desktop users generally expect\n omnipresent, larger scrollbars that they can click or drag.\nFlutter comes with a built-in Scrollbar widget that already\n has support for adaptive colors and sizes according to the\n current platform. The one tweak you might want to make is to\n toggle alwaysShown when on a desktop platform:\nThis subtle attention to detail can make your app feel more\n "}
17{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "own when on a desktop platform:\nThis subtle attention to detail can make your app feel more\n comfortable on a given platform.\nMulti-select\nDealing with multi-select within a list is another area\n with subtle differences across platforms:\nTo perform a platform-aware check for control or command,\n you can write something like this:\nA final consideration for keyboard users is the Select All action.\n If you have a large list of item"}
18{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "tion for keyboard users is the Select All action.\n If you have a large list of items of selectable items,\n many of your keyboard users will expect that they can use Control+A to select all the items.\nTouch devices\nOn touch devices, multi-selection is typically simplified,\n with the expected behavior being similar to having the isMultiSelectModifier down on the desktop.\n You can select or deselect items using a single tap,\n "}
19{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "r down on the desktop.\n You can select or deselect items using a single tap,\n and will usually have a button to Select All or Clear the current selection.\nHow you handle multi-selection on different devices depends\n on your specific use cases, but the important thing is to\n make sure that you're offering each platform the best\n interaction model possible.\nSelectable text\nA common expectation on the web (and to a"}
20{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": " interaction model possible.\nSelectable text\nA common expectation on the web (and to a lesser extent desktop)\n is that most visible text can be selected with the mouse cursor.\n When text is not selectable,\n users on the web tend to have an adverse reaction.\nLuckily, this is easy to support with the SelectableText widget:\nTo support rich text, then use TextSpan :\nTitle bars\nOn modern desktop applications, it's common to customize\n "}
21{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "ich text, then use TextSpan :\nTitle bars\nOn modern desktop applications, it's common to customize\n the title bar of your app window, adding a logo for\n stronger branding or contextual controls to help save\n vertical space in your main UI.\nThis isn't supported directly in Flutter, but you can use the bits_dojo package to disable the native title bars,\n and replace them with your own.\nThis package lets you add whatever widgets you"}
22{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "rs,\n and replace them with your own.\nThis package lets you add whatever widgets you want to the TitleBar because it uses pure Flutter widgets under the hood.\n This makes it easy to adapt the title bar as you navigate\n to different sections of the app.\nContext menus and tooltips\nOn desktop, there are several interactions that\n manifest as a widget shown in an overlay,\n but with differences in how they're triggere"}
23{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "fest as a widget shown in an overlay,\n but with differences in how they're triggered, dismissed,\n and positioned:\nContext menu\nTypically triggered by a right-click,\n a context menu is positioned close to the mouse,\n and is dismissed by clicking anywhere,\n selecting an option from the menu, or clicking outside it.\nTooltip\nTypically triggered by hovering for\n 200-400ms over an inte"}
24{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "outside it.\nTooltip\nTypically triggered by hovering for\n 200-400ms over an interactive element,\n a tooltip is usually anchored to a widget\n (as opposed to the mouse position) and is dismissed\n when the mouse cursor leaves that widget.\nPopup panel (also known as flyout)\nSimilar to a tooltip,\n a popup panel is usually anchored to a widget.\n The main difference is that panel"}
25{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "popup panel is usually anchored to a widget.\n The main difference is that panels are most often\n shown on a tap event, and they usually don't hide\n themselves when the cursor leaves.\n Instead, panels are typically dismissed by clicking\n outside the panel or by pressing a Close or Submit button.\nTo show basic tooltips in Flutter,\n use the built-in Tooltip widget:\nFlutter also "}
26{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "\nTo show basic tooltips in Flutter,\n use the built-in Tooltip widget:\nFlutter also provides built-in context menus when editing\n or selecting text.\nTo show more advanced tooltips, popup panels,\n or create custom context menus,\n you either use one of the available packages,\n or build it yourself using a Stack or Overlay .\nSome available packages include:\ncontext_menus\nanchored_popups\nflutter_portal\nsuper_tooltip\n"}
27{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "erlay .\nSome available packages include:\ncontext_menus\nanchored_popups\nflutter_portal\nsuper_tooltip\ncustom_pop_up_menu\nWhile these controls can be valuable for touch users as accelerators,\n they are essential for mouse users. These users expect\n to right-click things, edit content in place,\n and hover for more information. Failing to meet those expectations\n can lead to disappointed users, or at least,\n a feelin"}
28{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "pectations\n can lead to disappointed users, or at least,\n a feeling that something isn't quite right.\nHorizontal button order\nOn Windows, when presenting a row of buttons,\n the confirmation button is placed at the start of\n the row (left side). On all other platforms,\n it's the opposite. The confirmation button is\n placed at the end of the row (right side).\nThis can be easily handled in Flutter "}
29{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "\n placed at the end of the row (right side).\nThis can be easily handled in Flutter using the TextDirection property on Row :\nMenu bar\nAnother common pattern on desktop apps is the menu bar.\n On Windows and Linux, this menu lives as part of the Chrome title bar,\n whereas on macOS, it's located along the top of the primary screen.\nCurrently, you can specify custom menu bar entries using\n a prototype plugin, but it's expected that "}
30{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": " specify custom menu bar entries using\n a prototype plugin, but it's expected that this functionality will\n eventually be integrated into the main SDK.\nIt's worth mentioning that on Windows and Linux,\n you can't combine a custom title bar with a menu bar.\n When you create a custom title bar,\n you're replacing the native one completely,\n which means you also lose the integrated native menu bar.\nI"}
31{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "native one completely,\n which means you also lose the integrated native menu bar.\nIf you need both a custom title bar and a menu bar,\n you can achieve that by implementing it in Flutter,\n similar to a custom context menu.\nDrag and drop\nOne of the core interactions for both touch-based and\n pointer-based inputs is drag and drop. Although this\n interaction is expected for both types of input,\n the"}
32{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "though this\n interaction is expected for both types of input,\n there are important differences to think about when\n it comes to scrolling lists of draggable items.\nGenerally speaking, touch users expect to see drag handles\n to differentiate draggable areas from scrollable ones,\n or alternatively, to initiate a drag by using a long\n press gesture. This is because scrolling and dragging\n "}
33{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "g by using a long\n press gesture. This is because scrolling and dragging\n are both sharing a single finger for input.\nMouse users have more input options. They can use a wheel\n or scrollbar to scroll, which generally eliminates the need\n for dedicated drag handles. If you look at the macOS\n Finder or Windows Explorer, you'll see that they work\n this way: you just select an item and start draggin"}
34{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "rer, you'll see that they work\n this way: you just select an item and start dragging.\nIn Flutter, you can implement drag and drop in many ways.\n Discussing specific implementations is outside\n the scope of this article, but some high level options\n include the following:\nUse the Draggable and DragTarget APIs\n directly for a custom look and feel.\nUse the Draggable and DragTarget APIs\n dir"}
35{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "directly for a custom look and feel.\nUse the Draggable and DragTarget APIs\n directly for a custom look and feel.\nHook into onPan gesture events,\n and move an object yourself within a parent Stack .\nHook into onPan gesture events,\n and move an object yourself within a parent Stack .\nUse one of the pre-made list packages on pub.dev.\nUse one of the pre-made list packages on pub.dev.\nUnless stated otherwise, the documentation on this sit"}
36{"url": "https://docs.flutter.dev/ui/adaptive-responsive/idioms", "title": "Untitled", "text": "one of the pre-made list packages on pub.dev.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
37{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nMost real-world apps have the need to adapt to the\n capabilities and policies of different devices and platforms.\n This page contains advice for how to\n handle these scenarios in your code.\nDesign to the strengths of each device type\nConsider the unique strengths and weaknesses of different devices.\n Beyond their screen size and inputs, such as touch, mou"}
38{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": "sses of different devices.\n Beyond their screen size and inputs, such as touch, mouse, keyboard,\n what other unique capabilities can you leverage?\n Flutter enables your code to run on different devices,\n but strong design is more than just running code.\n Think about what each platform does best and\n see if there are unique capabilities to leverage.\nFor example: Apple's App Store and Google's Pla"}
39{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": " see if there are unique capabilities to leverage.\nFor example: Apple's App Store and Google's Play Store\n have different rules that apps need to abide by.\n Different host operating systems have differing\n capabilities across time as well as each other.\nAnother example is leveraging the web's extremely\n low barrier for sharing. If you're deploying a web app,\n decide what deep links to support,\n "}
40{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": "If you're deploying a web app,\n decide what deep links to support,\n and design the navigation routes with those in mind.\nFlutter's recommended pattern for handling different\n behavior based on these unique capabilities is to create\n a set of Capability and Policy classes for your app.\nCapabilities\nA capability defines what the code or device can do.\n Examples of capabilities include:\nThe existence of an API\nOS-e"}
41{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": "e or device can do.\n Examples of capabilities include:\nThe existence of an API\nOS-enforced restrictions\nPhysical hardware requirements (like a camera)\nPolicies\nA policy defines what the code should do.\nExamples of policies include:\nApp store guidelines\nDesign preferences\nAssets or copy that refers to the host device\nFeatures enabled on the server side\nHow to structure policy code\nThe simplest mechanical way is Platform.isAndroid , Platform.isIOS , and kIsWeb . These APIs mechani"}
42{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": "The simplest mechanical way is Platform.isAndroid , Platform.isIOS , and kIsWeb . These APIs mechanically\n let you know where the code is running but have some\n problems as the app expands where it can run, and\n as host platforms add functionality.\nThe following guidelines explain best practices\n when developing the capabilities and policies for your app:\nAvoid using Platform.isAndroid and similar functions\n t"}
43{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": "nd policies for your app:\nAvoid using Platform.isAndroid and similar functions\n to make layout decisions or assumptions about what a device can do.\nInstead, describe what you want to branch on in a method.\nExample: Your app has a link to buy something in a\n website, but you don't want to show that link on iOS\n devices for policy reasons.\nWhat did you get by adding an additional layer of indirection?\n The code makes it more cle"}
44{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": "d you get by adding an additional layer of indirection?\n The code makes it more clear why the branched path exists.\n This method can exist directly in the class but it's likely\n that other parts of the code might need this same check.\n If so, put the code in a class.\nWith this code in a class, any widget test can mock Policy().shouldAllowPurchaseClick and verify the behavior\n independently of where the device ru"}
45{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": "uldAllowPurchaseClick and verify the behavior\n independently of where the device runs.\n It also means that later, if you decide that\n buying on the web isn't the right flow for\n Android users, you can change the implementation\n and the tests for clickable text won't need to change.\nCapabilities\nSometimes you want your code to do something but the\n API doesn't exist, or maybe you depend on a plug"}
46{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": "your code to do something but the\n API doesn't exist, or maybe you depend on a plugin feature\n that isn't yet implemented on all of the platforms you support.\n This is a limitation of what the device can do.\nThose situations are similar to the policy decisions\n described above, but these are referred to as capabilities .\n Why separate policy classes from capabilities\n when the structure of the c"}
47{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": " Why separate policy classes from capabilities\n when the structure of the classes is similar?\n The Flutter team has found with productionized apps that making\n a logical distinction between what apps can do and\n what they should do helps larger products respond to\n changes in what platforms can do or require\n in addition to your own preferences after\n the initial code is"}
48{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": "re\n in addition to your own preferences after\n the initial code is written.\nFor example, consider the case where one platform adds\n a new permission that requires users to interact with\n a system dialog before your code calls a sensitive API.\n Your team does the work for platform 1 and creates a\n capability named requirePermissionDialogFlow .\n Then, if and when platform 2 adds a"}
49{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": "capability named requirePermissionDialogFlow .\n Then, if and when platform 2 adds a similar requirement\n but only for new API versions,\n then the implementation of requirePermissionDialogFlow can now check the API level and return true for platform 2.\n You've leveraged the work you already did.\nPolicies\nWe encourage starting with a Policy class initially\n even if it seems like you won't make many policy based de"}
50{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": "a Policy class initially\n even if it seems like you won't make many policy based decisions.\n As the complexity of the class grows or the number of inputs expands,\n you might decide to break up the policy class by feature\n or some other criteria.\nFor policy implementation, you can use compile time,\n run time, or Remote Procedure Call (RPC) backed implementations.\nCompile-time policy checks are good for platforms\n"}
51{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": "mote Procedure Call (RPC) backed implementations.\nCompile-time policy checks are good for platforms\n where the preference is unlikely to change and where\n accidentally changing the value might have large consequences.\n For example, if a platform requires that you not\n link to the Play store, or requires that you use\n a specific payment provider given the content of your app.\nRuntime checks can be good for determ"}
52{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": " a specific payment provider given the content of your app.\nRuntime checks can be good for determining if there\n is a touch screen the user can use. Android has a feature\n you can check and your web implementation could\n check for max touch points.\nRPC-backed policy changes are good for incremental\n feature rollout or for decisions that might change later.\nSummary\nUse a Capability class to define what the code can do.\n "}
53{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": "ions that might change later.\nSummary\nUse a Capability class to define what the code can do.\n You might check against the existence of an API,\n OS-enforced restrictions,\n and physical hardware requirements (like a camera).\n A capability usually involves compile or runtime checks.\nUse a Policy class (or classes depending on complexity)\n to define what the code should do to comply with\n App store "}
54{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": "ity)\n to define what the code should do to comply with\n App store guidelines, design preferences,\n and assets or copy that need to refer to the host device.\n Policies can be a mix of compile, runtime, or RPC checks.\nTest the branching code by mocking capabilities and\n policies so the widget tests don't need to change\n when capabilities or policies change.\nName the methods in your capabilities an"}
55{"url": "https://docs.flutter.dev/ui/adaptive-responsive/capabilities", "title": "Untitled", "text": "nge\n when capabilities or policies change.\nName the methods in your capabilities and policies classes\n based on what they are trying to branch, rather than on device type.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
56{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nIt isn't enough to just adapt how your app looks,\n you also have to support a variety of user inputs.\n The mouse and keyboard introduce input types beyond those\n found on a touch device, like scroll wheel, right-click,\n hover interactions, tab traversal, and keyboard shortcuts.\nSome of these features work by default on Material\n widgets. "}
57{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "d keyboard shortcuts.\nSome of these features work by default on Material\n widgets. But, if you've created a custom widget,\n you might need to implement them directly.\nSome features that encompass a well-designed app,\n also help users who work with assistive technologies.\n For example, aside from being good app design ,\n some features, like tab traversal and keyboard shortcuts,\n are critical for "}
58{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": " some features, like tab traversal and keyboard shortcuts,\n are critical for users who work with assistive devices .\n In addition to the standard advice for creating accessible apps , this page covers\n info for creating apps that are both\n adaptive and accessible.\nScroll wheel for custom widgets\nScrolling widgets like ScrollView or ListView support the scroll wheel by default, and because\n almost every scr"}
59{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "View or ListView support the scroll wheel by default, and because\n almost every scrollable custom widget is built\n using one of these, it works with those as well.\nIf you need to implement custom scroll behavior,\n you can use the Listener widget, which lets you\n customize how your UI reacts to the scroll wheel.\nTab traversal and focus interactions\nUsers with physical keyboards expect that they can use\n the tab k"}
60{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "ocus interactions\nUsers with physical keyboards expect that they can use\n the tab key to quickly navigate an application,\n and users with motor or vision differences often rely\n completely on keyboard navigation.\nThere are two considerations for tab interactions:\n how focus moves from widget to widget, known as traversal,\n and the visual highlight shown when a widget is focused.\nMost built-in components, like bu"}
61{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": " and the visual highlight shown when a widget is focused.\nMost built-in components, like buttons and text fields,\n support traversal and highlights by default.\n If you have your own widget that you want included in\n traversal, you can use the FocusableActionDetector widget\n to create your own controls. The FocusableActionDetector widget is helpful for combining focus, mouse input,\n and shortcuts togethe"}
62{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "Detector widget is helpful for combining focus, mouse input,\n and shortcuts together in one widget. You can create\n a detector that defines actions and key bindings,\n and provides callbacks for handling focus and hover highlights.\nControlling traversal order\nTo get more control over the order that\n widgets are focused on when the user tabs through,\n you can use FocusTraversalGroup to define sections\n "}
63{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "user tabs through,\n you can use FocusTraversalGroup to define sections\n of the tree that should be treated as a group when tabbing.\nFor example, you might to tab through all the fields in\n a form before tabbing to the submit button:\nFlutter has several built-in ways to traverse widgets and groups,\n defaulting to the ReadingOrderTraversalPolicy class.\n This class usually works well, but it's possible to modify th"}
64{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "aversalPolicy class.\n This class usually works well, but it's possible to modify this\n using another predefined TraversalPolicy class or by creating\n a custom policy.\nKeyboard accelerators\nIn addition to tab traversal, desktop and web users are accustomed\n to having various keyboard shortcuts bound to specific actions.\n Whether it's the Delete key for quick deletions or Control+N for a new document, be sure to c"}
65{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": " Whether it's the Delete key for quick deletions or Control+N for a new document, be sure to consider the different\n accelerators your users expect. The keyboard is a powerful\n input tool, so try to squeeze as much efficiency from it as you can.\n Your users will appreciate it!\nKeyboard accelerators can be accomplished in a few ways in Flutter,\n depending on your goals.\nIf you have a single widget like a TextField or a Butt"}
66{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "r,\n depending on your goals.\nIf you have a single widget like a TextField or a Button that\n already has a focus node, you can wrap it in a KeyboardListener or a Focus widget and listen for keyboard events:\nTo apply a set of keyboard shortcuts to a large section\n of the tree, use the Shortcuts widget:\nThe Shortcuts widget is useful because it only\n allows shortcuts to be fired when this widget tree\n or one of its"}
67{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": " allows shortcuts to be fired when this widget tree\n or one of its children has focus and is visible.\nThe final option is a global listener. This listener\n can be used for always-on, app-wide shortcuts or for\n panels that can accept shortcuts whenever they're visible\n (regardless of their focus state). Adding global listeners\n is easy with HardwareKeyboard :\nTo check key combinations with the gl"}
68{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "al listeners\n is easy with HardwareKeyboard :\nTo check key combinations with the global listener,\n you can use the HardwareKeyboard.instance.logicalKeysPressed set.\n For example, a method like the following can check whether any\n of the provided keys are being held down:\nPutting these two things together,\n you can fire an action when Shift+N is pressed:\nOne note of caution when using the static listener,\n "}
69{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": " fire an action when Shift+N is pressed:\nOne note of caution when using the static listener,\n is that you often need to disable it when the user\n is typing in a field or when the widget it's\n associated with is hidden from view.\n Unlike with Shortcuts or KeyboardListener ,\n this is your responsibility to manage. This can be especially\n important when you're binding a Delete/Backspace accelerator"}
70{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "his can be especially\n important when you're binding a Delete/Backspace accelerator for Delete , but then have child TextFields that the user\n might be typing in.\nMouse enter, exit, and hover for custom widgets\nOn desktop, it's common to change the mouse cursor\n to indicate the functionality about the content the\n mouse is hovering over. For example, you typically see\n a hand cursor when you hover over a button,"}
71{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "g over. For example, you typically see\n a hand cursor when you hover over a button,\n or an I cursor when you hover over text.\nFlutter's Material buttons handle basic focus states\n for standard button and text cursors.\n (A notable exception is if you change the default styling\n of the Material buttons to set the overlayColor to transparent.)\nImplement a focus state for any custom buttons or\n gest"}
72{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "erlayColor to transparent.)\nImplement a focus state for any custom buttons or\n gesture detectors in your app.\n If you change the default Material button styles,\n test for keyboard focus states and\n implement your own, if needed.\nTo change the cursor from within your custom widgets,\n use MouseRegion :\nMouseRegion is also useful for creating custom\n rollover and hover effects:\nFor an example that "}
73{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "s also useful for creating custom\n rollover and hover effects:\nFor an example that changes the button style\n to outline the button when it has focus,\n check out the button code for the Wonderous app .\n The app modifies the FocusNode.hasFocus property to check whether the button has focus\n and, if so, adds an outline.\nVisual density\nYou might consider enlarging the \"hit area\"\n of a widget to acco"}
74{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "ne.\nVisual density\nYou might consider enlarging the \"hit area\"\n of a widget to accommodate a touch screen, for example.\nDifferent input devices offer various levels of precision,\n which necessitate differently-sized hit areas.\n Flutter's VisualDensity class makes it easy to adjust the\n density of your views across the entire application,\n for example, by making a button larger\n (and therefore ea"}
75{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "cation,\n for example, by making a button larger\n (and therefore easier to tap) on a touch device.\nWhen you change the VisualDensity for\n your MaterialApp , MaterialComponents that support it animate their densities to match.\n By default, both horizontal and vertical densities\n are set to 0.0, but you can set the densities to any\n negative or positive value that you want.\n By swi"}
76{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "ensities to any\n negative or positive value that you want.\n By switching between different\n densities, you can easily adjust your UI.\nTo set a custom visual density,\n inject the density into your MaterialApp theme:\nTo use VisualDensity inside your own views,\n you can look it up:\nNot only does the container react automatically to changes\n in density, it also animates when it changes.\n "}
77{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "utomatically to changes\n in density, it also animates when it changes.\n This ties together your custom components,\n along with the built-in components,\n for a smooth transition effect across the app.\nAs shown, VisualDensity is unit-less,\n so it can mean different things to different views.\n In the following example, 1 density unit equals 6 pixels,\n but this is totally up to you "}
78{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": " following example, 1 density unit equals 6 pixels,\n but this is totally up to you to decide.\n The fact that it is unit-less makes it quite versatile,\n and it should work in most contexts.\nIt's worth noting that the Material generally\n use a value of around 4 logical pixels for each\n visual density unit. For more information about the\n supported components, see the VisualDensity API.\n "}
79{"url": "https://docs.flutter.dev/ui/adaptive-responsive/input", "title": "Untitled", "text": "information about the\n supported components, see the VisualDensity API.\n For more information about density principles in general,\n see the Material Design guide .\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
80{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nRecommended best practices for adaptive design include:\nDesign considerations\nBreak down your widgets\nWhile designing your app, try to break down large,\n complex widgets into smaller, simpler ones.\nRefactoring widgets can reduce the complexity of\n adopting an adaptive UI by sharing core pieces of code.\n There are other benefits as well:\nOn the performance side, having lot"}
81{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "ces of code.\n There are other benefits as well:\nOn the performance side, having lots of small const widgets improves rebuild times over having large,\n complex widgets.\nFlutter can reuse const widget instances,\n while a larger complex widget has to be set up\n for every rebuild.\nFrom a code health perspective, organizing your UI\n into smaller bite sized pieces helps keep the complexity\n "}
82{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "UI\n into smaller bite sized pieces helps keep the complexity\n of each Widget down. A less-complex Widget is more readable,\n easier to refactor, and less likely to have surprising behavior.\nTo learn more, check out the 3 steps of\n adaptive design in General approach .\nDesign to the strengths of each form factor\nBeyond screen size, you should also spend time\n considering the unique strengths and weaknesses\n "}
83{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "size, you should also spend time\n considering the unique strengths and weaknesses\n of different form factors. It isn't always ideal\n for your multiplatform app to offer identical\n functionality everywhere. Consider whether it makes\n sense to focus on specific capabilities,\n or even remove certain features, on some device categories.\nFor example, mobile devices are portable and have cameras,\n "}
84{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "features, on some device categories.\nFor example, mobile devices are portable and have cameras,\n but they aren't well suited for detailed creative work.\n With this in mind, you might focus more on capturing content\n and tagging it with location data for a mobile UI,\n but focus on organizing or manipulating that content\n for a tablet or desktop UI.\nAnother example is leveraging the web's extremely low barrier\n "}
85{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": " for a tablet or desktop UI.\nAnother example is leveraging the web's extremely low barrier\n for sharing. If you're deploying a web app,\n decide which deep links to support,\n and design your navigation routes with those in mind.\nThe key takeaway here is to think about what each\n platform does best and see if there are unique capabilities\n you can leverage.\nSolve touch first\nBuilding a great touch UI can oft"}
86{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "capabilities\n you can leverage.\nSolve touch first\nBuilding a great touch UI can often be more difficult\n than a traditional desktop UI due, in part,\n to the lack of input accelerators like right-click,\n scroll wheel, or keyboard shortcuts.\nOne way to approach this challenge is to focus initially\n on a great touch-oriented UI. You can still do most of\n your testing using the desktop target for it"}
87{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "oriented UI. You can still do most of\n your testing using the desktop target for its iteration speed.\n But, remember to switch frequently to a mobile device to\n verify that everything feels right.\nAfter you have the touch interface polished, you can tweak\n the visual density for mouse users, and then layer on all\n the additional inputs. Approach these other inputs as\n accelerator—alternatives th"}
88{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": " the additional inputs. Approach these other inputs as\n accelerator—alternatives that make a task faster.\n The important thing to consider is what a user expects\n when using a particular input device,\n and work to reflect that in your app.\nImplementation details\nDon't lock the orientation of your app.\nAn adaptive app should look good on windows of\n different sizes and shapes. While locking an app\n "}
89{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "ood on windows of\n different sizes and shapes. While locking an app\n to portrait mode on phones can help narrow the scope\n of a minimum viable product, it can increase the\n effort required to make the app adaptive in the future.\nFor example, the assumption that phones will only\n render your app in a full screen portrait mode is\n not a guarantee. Multi window app support is becoming common,\n "}
90{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "rtrait mode is\n not a guarantee. Multi window app support is becoming common,\n and foldables have many use cases that work best with\n multiple apps running side by side.\nIf you absolutely must lock your app in portrait mode (but don't),\n use the Display API instead of something like MediaQuery to get the physical dimensions of the screen.\nTo summarize:\nLocked screens can be an accessibility issue for some users\nAndroid large for"}
91{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": " screen.\nTo summarize:\nLocked screens can be an accessibility issue for some users\nAndroid large format tiers require portrait and landscape\n support at the lowest level .\nAndroid devices can override a locked screen\nApple guidelines say aim to support both orientations\nAvoid device orientation-based layouts\nAvoid using MediaQuery 's orientation field\n or OrientationBuilder near the top of your widget tree\n to switch between different app layo"}
92{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "ationBuilder near the top of your widget tree\n to switch between different app layouts. This is\n similar to the guidance of not checking device types\n to determine screen size. The device's orientation also\n doesn't necessarily inform you of how much space your\n app window has.\nInstead, use MediaQuery 's sizeOf or LayoutBuilder ,\n as discussed in the General approach page.\n Then"}
93{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": " LayoutBuilder ,\n as discussed in the General approach page.\n Then use adaptive breakpoints like the ones that Material recommends.\nDon't gobble up all of the horizontal space\nApps that use the full width of the window to\n display boxes or text fields don't play well\n when these apps run on large screens.\nTo learn how to avoid this,\n check out Layout with GridView .\nAvoid checking for hardware types\nAvoid writin"}
94{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "s,\n check out Layout with GridView .\nAvoid checking for hardware types\nAvoid writing code that checks whether the device you're\n running on is a \"phone\" or a \"tablet\", or any other type\n of device when making layout decisions.\nWhat space your app is actually given to render in\n isn't always tied to the full screen size of the device.\n Flutter can run on many different platforms,\n and your app mi"}
95{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "ce.\n Flutter can run on many different platforms,\n and your app might be running in a resizeable window on ChromeOS,\n side by side with another app on tablets in a multi-window mode,\n or even in a picture-in-picture on phones.\n Therefore, device type and app window size aren't\n really strongly connected.\nInstead, use MediaQuery to get the size of the window\n your app is currentl"}
96{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "nected.\nInstead, use MediaQuery to get the size of the window\n your app is currently running in.\nThis isn't only helpful for UI code.\n To learn how abstracting out device\n capabilities can help your business logic code,\n check out the 2022 Google I/O talk, Flutter lessons for federated plugin development .\nSupport a variety of input devices\nApps should support basic mice, trackpads,\n and keyboard shortcuts. The "}
97{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "ut devices\nApps should support basic mice, trackpads,\n and keyboard shortcuts. The most common user\n flows should support keyboard navigation\n to ensure accessibility. In particular,\n your app follow accessible best practices\n for keyboards on large devices.\nThe Material library provides widgets with\n excellent default behavior for touch, mouse,\n and keyboard interaction.\nTo lea"}
98{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": " excellent default behavior for touch, mouse,\n and keyboard interaction.\nTo learn how to add this support to custom widgets,\n check out User input & accessibility .\nRestore List state\nTo maintain the scroll position in a list\n that doesn't change its layout when the\n device's orientation changes,\n use the PageStorageKey class. PageStorageKey persists the\n widget state in storage after the wi"}
99{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "StorageKey class. PageStorageKey persists the\n widget state in storage after the widget is\n destroyed and restores state when recreated.\nYou can see an example of this in the Wonderous app ,\n where it stores the list's state in the SingleChildScrollView widget.\nIf the List widget changes its layout\n when the device's orientation changes,\n you might have to do a bit of math ( example )\n to change"}
100{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "hanges,\n you might have to do a bit of math ( example )\n to change the scroll position on screen rotation.\nSave app state\nApps should retain or restore app state as the device rotates, changes window size,\n or folds and unfolds.\n By default, an app should maintain state.\nIf your app loses state during device configuration,\n verify that the plugins and native extensions\n that your app uses suppor"}
101{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": " verify that the plugins and native extensions\n that your app uses support the\n device type, such as a large screen.\n Some native extensions might lose state when the\n device changes position.\nFor more information on a real-world case\n where this occurred, check out Problem: Folding/unfolding causes state loss in Developing Flutter apps for Large screens ,\n a free article on Medium.\nUn"}
102{"url": "https://docs.flutter.dev/ui/adaptive-responsive/best-practices", "title": "Untitled", "text": "e loss in Developing Flutter apps for Large screens ,\n a free article on Medium.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
103{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nAdaptation philosophy\nIn general, two cases of platform adaptiveness exist:\nThings that are behaviors of the OS environment\n (such as text editing and scrolling) and that\n would be 'wrong' if a different behavior took place.\nThings that are conventionally implemented in apps using\n the OEM's SDKs (such as using parallel tabs on iOS or\n showing an "}
104{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": " the OEM's SDKs (such as using parallel tabs on iOS or\n showing an android.app.AlertDialog on Android).\nThis article mainly covers the automatic adaptations\n provided by Flutter in case 1 on Android and iOS.\nFor case 2, Flutter bundles the means to produce the\n appropriate effects of the platform conventions but doesn't\n adapt automatically when app design choices are needed.\n For a discussion, s"}
105{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": " adapt automatically when app design choices are needed.\n For a discussion, see issue #8410 and the Material/Cupertino adaptive widget problem definition .\nFor an example of an app using different information\n architecture structures on Android and iOS but sharing\n the same content code, see the platform_design code samples .\nPage navigation\nFlutter provides the navigation patterns seen on Android\n and iOS and also automat"}
106{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "\nFlutter provides the navigation patterns seen on Android\n and iOS and also automatically adapts the navigation animation\n to the current platform.\nNavigation transitions\nOn Android , the default Navigator.push() transition\n is modeled after startActivity() ,\n which generally has one bottom-up animation variant.\nOn iOS :\nThe default Navigator.push() API produces an\n iOS Show/Push style transition that animates"}
107{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "lt Navigator.push() API produces an\n iOS Show/Push style transition that animates from\n end-to-start depending on the locale's RTL setting.\n The page behind the new route also parallax-slides\n in the same direction as in iOS.\nA separate bottom-up transition style exists when\n pushing a page route where PageRoute.fullscreenDialog is true. This represents iOS's Present/Modal style\n tra"}
108{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "ageRoute.fullscreenDialog is true. This represents iOS's Present/Modal style\n transition and is typically used on fullscreen modal pages.\nAndroid page transition\niOS push transition\niOS present transition\nPlatform-specific transition details\nOn Android , Flutter uses the ZoomPageTransitionsBuilder animation.\n When the user taps on an item, the UI zooms in to a screen that features that item.\n When the user taps to go back, the UI zooms out to "}
109{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "creen that features that item.\n When the user taps to go back, the UI zooms out to the previous screen.\nOn iOS when the push style transition is used,\n Flutter's bundled CupertinoNavigationBar and CupertinoSliverNavigationBar nav bars\n automatically animate each subcomponent to its corresponding\n subcomponent on the next or previous page's CupertinoNavigationBar or CupertinoSliverNavigationBar .\nAndroid\niOS Nav Bar\nBack navigati"}
110{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "us page's CupertinoNavigationBar or CupertinoSliverNavigationBar .\nAndroid\niOS Nav Bar\nBack navigation\nOn Android ,\n the OS back button, by default, is sent to Flutter\n and pops the top route of the WidgetsApp 's Navigator.\nOn iOS ,\n an edge swipe gesture can be used to pop the top route.\nAndroid back button\niOS back swipe gesture\nScrolling\nScrolling is an important part of the platform's\n look and feel, and Flutter automaticall"}
111{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "ing is an important part of the platform's\n look and feel, and Flutter automatically adjusts\n the scrolling behavior to match the current platform.\nPhysics simulation\nAndroid and iOS both have complex scrolling physics\n simulations that are difficult to describe verbally.\n Generally, iOS's scrollable has more weight and\n dynamic friction but Android has more static friction.\n Therefore iOS gains"}
112{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": " dynamic friction but Android has more static friction.\n Therefore iOS gains high speed more gradually but stops\n less abruptly and is more slippery at slow speeds.\nSoft fling comparison\nMedium fling comparison\nStrong fling comparison\nOverscroll behavior\nOn Android ,\n scrolling past the edge of a scrollable shows an overscroll glow indicator (based on the color\n of the current Material theme).\nOn iOS , scrolling past the "}
113{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "r (based on the color\n of the current Material theme).\nOn iOS , scrolling past the edge of a scrollable overscrolls with increasing resistance and snaps back.\nDynamic overscroll comparison\nStatic overscroll comparison\nScrollbars\nOn Material-based platforms (such as Android and web),\n scrollbars are typically visible during scrolling\n and may remain visible depending on the platform and theme.\nOn Cupertino-based platforms (such as iOS),\n "}
114{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "n visible depending on the platform and theme.\nOn Cupertino-based platforms (such as iOS),\n scrollbars are more minimal and generally only appear briefly\n while the user is actively scrolling, fading out when interaction stops.\nThis difference reflects each platform’s visual conventions\n and helps maintain a native look and feel across devices.\nMomentum\nOn iOS ,\n repeated flings in the same direction stacks momentum\n "}
115{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "mentum\nOn iOS ,\n repeated flings in the same direction stacks momentum\n and builds more speed with each successive fling.\n There is no equivalent behavior on Android.\niOS scroll momentum\nReturn to top\nOn iOS ,\n tapping the OS status bar scrolls the primary\n scroll controller to the top position.\n There is no equivalent behavior on Android.\niOS status bar tap to top\nTypography\nWhen using the Mate"}
116{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "There is no equivalent behavior on Android.\niOS status bar tap to top\nTypography\nWhen using the Material package,\n the typography automatically defaults to the\n font family appropriate for the platform.\n Android uses the Roboto font.\n iOS uses the San Francisco font.\nWhen using the Cupertino package, the default theme uses the San Francisco font.\nThe San Francisco font license limits its usage to\n software runni"}
117{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": " Francisco font.\nThe San Francisco font license limits its usage to\n software running on iOS, macOS, or tvOS only.\n Therefore a fallback font is used when running on Android\n if the platform is debug-overridden to iOS or the\n default Cupertino theme is used.\nYou might choose to adapt the text styling of Material\n widgets to match the default text styling on iOS.\n You can see widget-specific exam"}
118{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "widgets to match the default text styling on iOS.\n You can see widget-specific examples in the UI Component section .\nRoboto on Android\nSan Francisco on iOS\nIconography\nWhen using the Material package,\n certain icons automatically show different\n graphics depending on the platform.\n For instance, the overflow button's three dots\n are horizontal on iOS and vertical on Android.\n The back button is"}
119{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": " are horizontal on iOS and vertical on Android.\n The back button is a simple chevron on iOS and\n has a stem/shaft on Android.\nIcons on Android\nIcons on iOS\nThe material library also provides a set of\n platform-adaptive icons through Icons.adaptive .\nHaptic feedback\nThe Material and Cupertino packages automatically\n trigger the platform appropriate haptic feedback in\n certain scenarios.\nFor instan"}
120{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": " trigger the platform appropriate haptic feedback in\n certain scenarios.\nFor instance,\n a word selection via text field long-press triggers a 'buzz'\n vibrate on Android and not on iOS.\nScrolling through picker items on iOS triggers a\n 'light impact' knock and no feedback on Android.\nText editing\nBoth the Material and Cupertino Text Input fields\n support spellcheck and adapt to use the proper\n sp"}
121{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "t Input fields\n support spellcheck and adapt to use the proper\n spellcheck configuration for the platform,\n and the proper spell check menu and highlight colors.\nFlutter also makes the below adaptations while editing\n the content of text fields to match the current platform.\nKeyboard gesture navigation\nOn Android ,\n horizontal swipes can be made on the soft keyboard's space key\n to move the curs"}
122{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": " horizontal swipes can be made on the soft keyboard's space key\n to move the cursor in Material and Cupertino text fields.\nOn iOS devices with 3D Touch capabilities,\n a force-press-drag gesture could be made on the soft\n keyboard to move the cursor in 2D via a floating cursor.\n This works on both Material and Cupertino text fields.\nAndroid space key cursor move\niOS 3D Touch drag cursor move\nText selection toolbar\nWith Material"}
123{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "ds.\nAndroid space key cursor move\niOS 3D Touch drag cursor move\nText selection toolbar\nWith Material on Android ,\n the Android style selection toolbar is shown when\n a text selection is made in a text field.\nWith Material on iOS or when using Cupertino ,\n the iOS style selection toolbar is shown when a text\n selection is made in a text field.\nAndroid text selection toolbar\niOS text selection toolbar\nSingle tap gesture\nWith Mater"}
124{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": " text field.\nAndroid text selection toolbar\niOS text selection toolbar\nSingle tap gesture\nWith Material on Android ,\n a single tap in a text field puts the cursor at the\n location of the tap.\nA collapsed text selection also shows a draggable\n handle to subsequently move the cursor.\nWith Material on iOS or when using Cupertino ,\n a single tap in a text field puts the cursor at the\n nearest edge of the word tapped"}
125{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": " single tap in a text field puts the cursor at the\n nearest edge of the word tapped.\nCollapsed text selections don't have draggable handles on iOS.\nAndroid tap\niOS tap\nLong-press gesture\nWith Material on Android ,\n a long press selects the word under the long press.\n The selection toolbar is shown upon release.\nWith Material on iOS or when using Cupertino ,\n a long press places the cursor at the location of the\n "}
126{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "upertino ,\n a long press places the cursor at the location of the\n long press. The selection toolbar is shown upon release.\nAndroid long press\niOS long press\nLong-press drag gesture\nWith Material on Android ,\n dragging while holding the long press expands the words selected.\nWith Material on iOS or when using Cupertino ,\n dragging while holding the long press moves the cursor.\nAndroid long-press drag\niOS long-press drag\nDouble t"}
127{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": " while holding the long press moves the cursor.\nAndroid long-press drag\niOS long-press drag\nDouble tap gesture\nOn both Android and iOS,\n a double tap selects the word receiving the\n double tap and shows the selection toolbar.\nAndroid double tap\niOS double tap\nUI components\nThis section includes preliminary recommendations on how to adapt\n Material widgets to deliver a natural and compelling experience on iOS.\n Your feedback is w"}
128{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": " widgets to deliver a natural and compelling experience on iOS.\n Your feedback is welcomed on issue #8427 .\nWidgets with .adaptive() constructors\nSeveral widgets support .adaptive() constructors.\n The following table lists these widgets.\n Adaptive constructors substitute the corresponding Cupertino components\n when the app is run on an iOS device.\nWidgets in the following table are used primarily for input,\n sel"}
129{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "on an iOS device.\nWidgets in the following table are used primarily for input,\n selection, and to display system information.\n Because these controls are tightly integrated with the operating system,\n users have been trained to recognize and respond to them.\n Therefore, we recommend that you follow platform conventions.\nTop app bar and navigation bar\nSince Android 12, the default UI for top app\n bars follows the"}
130{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "r and navigation bar\nSince Android 12, the default UI for top app\n bars follows the design guidelines defined in Material 3 .\n On iOS, an equivalent component called \"Navigation Bars\"\n is defined in Apple's Human Interface Guidelines (HIG).\nTop App Bar in Material 3\nNavigation Bar in Human Interface Guidelines\nCertain properties of app bars in Flutter apps should be adapted,\n like system icons and page transitions.\n "}
131{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "tter apps should be adapted,\n like system icons and page transitions.\n These are already automatically adapted when using\n the Material AppBar and SliverAppBar widgets.\n You can also further customize the properties of these widgets to better\n match iOS platform styles, as shown below.\nBut, because app bars are displayed alongside\n other content in your page, it's only recommended to adapt the s"}
132{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "splayed alongside\n other content in your page, it's only recommended to adapt the styling\n so long as it's cohesive with the rest of your application. You can see\n additional code samples and a further explanation in the GitHub discussion on app bar adaptations .\nBottom navigation bars\nSince Android 12, the default UI for bottom navigation\n bars follow the design guidelines defined in Material 3 .\n On iOS, an eq"}
133{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": " bars follow the design guidelines defined in Material 3 .\n On iOS, an equivalent component called \"Tab Bars\"\n is defined in Apple's Human Interface Guidelines (HIG).\nBottom Navigation Bar in Material 3\nTab Bar in Human Interface Guidelines\nSince tab bars are persistent across your app, they should match your\n own branding. However, if you choose to use Material's default\n styling on Android, you might consider adaptin"}
134{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "ou choose to use Material's default\n styling on Android, you might consider adapting to the default iOS\n tab bars.\nTo implement platform-specific bottom navigation bars,\n you can use Flutter's NavigationBar widget on Android\n and the CupertinoTabBar widget on iOS.\n Below is a code snippet you can\n adapt to show a platform-specific navigation bars.\nText fields\nSince Android 12, text fields follow"}
135{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": " adapt to show a platform-specific navigation bars.\nText fields\nSince Android 12, text fields follow the Material 3 (M3) design guidelines.\n On iOS, Apple's Human Interface Guidelines (HIG) define\n an equivalent component.\nText Field in Material 3\nText Field in HIG\nSince text fields require user input,\n their design should follow platform conventions.\nTo implement a platform-specific TextField in Flutter, you can adapt the styling of the\n "}
136{"url": "https://docs.flutter.dev/ui/adaptive-responsive/platform-adaptations", "title": "Untitled", "text": "ons.\nTo implement a platform-specific TextField in Flutter, you can adapt the styling of the\n Material TextField .\nTo learn more about adapting text fields, check out the GitHub discussion on text fields .\n You can leave feedback or ask questions in the discussion.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
137{"url": "https://docs.flutter.dev/ui/adaptive-responsive/safearea-mediaquery", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nThis page discusses how and when to use the SafeArea and MediaQuery widgets.\nSafeArea\nWhen running your app on the latest devices,\n you might encounter bits of the UI being blocked\n by cutouts on the device's screen.\n You can fix this with the SafeArea widget,\n which insets its child widget to avoid intrusions\n (like notches and camera cu"}
138{"url": "https://docs.flutter.dev/ui/adaptive-responsive/safearea-mediaquery", "title": "Untitled", "text": " which insets its child widget to avoid intrusions\n (like notches and camera cutouts),\n as well as operating system UI\n (such as the status bar on Android),\n or by rounded corners of the physical display.\nIf you don't want this behavior,\n the SafeArea widget allows you to\n disable padding on any of its four sides.\n By default, all four sides are enabled.\nIt's generally recom"}
139{"url": "https://docs.flutter.dev/ui/adaptive-responsive/safearea-mediaquery", "title": "Untitled", "text": "ny of its four sides.\n By default, all four sides are enabled.\nIt's generally recommended to wrap the body of a Scaffold widget in SafeArea as a good place to start,\n but you don't always need to put it this high in the Widget tree.\nFor example, if you purposefully want your app to stretch\n under the cutouts, you can move the SafeArea to wrap\n whatever content makes sense,\n and let the rest of the app take up th"}
140{"url": "https://docs.flutter.dev/ui/adaptive-responsive/safearea-mediaquery", "title": "Untitled", "text": " whatever content makes sense,\n and let the rest of the app take up the full screen.\nUsing SafeArea ensures that your app content won't be\n cut off by physical display features or operating system UI,\n and sets your app up for success even as new devices with\n different shapes and styles of cutouts enter the market.\nHow does SafeArea do so much in a small amount of code?\n Behind the scenes it uses t"}
141{"url": "https://docs.flutter.dev/ui/adaptive-responsive/safearea-mediaquery", "title": "Untitled", "text": "ow does SafeArea do so much in a small amount of code?\n Behind the scenes it uses the MediaQuery object.\nMediaQuery\nAs discussed in the SafeArea section, MediaQuery is a powerful widget for creating\n adaptive apps. Sometimes you'll use MediaQuery directly, and sometimes you'll use SafeArea ,\n which uses MediaQuery behind the scenes.\nMediaQuery provides lots of information,\n including the app's current window size.\n "}
142{"url": "https://docs.flutter.dev/ui/adaptive-responsive/safearea-mediaquery", "title": "Untitled", "text": "vides lots of information,\n including the app's current window size.\n It exposes accessibility settings like high contrast mode\n and text scaling, or if the user is using an accessibility\n service like TalkBack or VoiceOver. MediaQuery also contains info about the features\n of your device's display, such as having a hinge or a fold.\nSafeArea uses the data from MediaQuery to figure out\n how much "}
143{"url": "https://docs.flutter.dev/ui/adaptive-responsive/safearea-mediaquery", "title": "Untitled", "text": " a hinge or a fold.\nSafeArea uses the data from MediaQuery to figure out\n how much to inset its child Widget .\n Specifically, it uses the MediaQuery padding property,\n which is basically the amount of the display that's\n partially obscured by system UI, display notches, or status bar.\nSo, why not use MediaQuery directly?\nThe answer is that SafeArea does one clever thing\n that makes it beneficial to use over just"}
144{"url": "https://docs.flutter.dev/ui/adaptive-responsive/safearea-mediaquery", "title": "Untitled", "text": "r is that SafeArea does one clever thing\n that makes it beneficial to use over just raw MediaQueryData .\n Specifically, it modifies the MediaQuery exposed\n to SafeArea 's children to make it appear as if the\n padding added to SafeArea doesn't exist.\n This means that you can nest SafeArea s,\n and only the topmost one will apply the padding\n needed to avoid the notches as system U"}
145{"url": "https://docs.flutter.dev/ui/adaptive-responsive/safearea-mediaquery", "title": "Untitled", "text": "nly the topmost one will apply the padding\n needed to avoid the notches as system UI.\nAs your app grows and you move widgets around,\n you don't have to worry about having too much\n padding applied if you have multiple SafeArea s,\n whereas you would have issues if using MediaQueryData.padding directly.\nYou can wrap the body of a Scaffold widget\n with a SafeArea , but you don't have to put it this high\n "}
146{"url": "https://docs.flutter.dev/ui/adaptive-responsive/safearea-mediaquery", "title": "Untitled", "text": "affold widget\n with a SafeArea , but you don't have to put it this high\n in the widget tree.\n The SafeArea just needs to wrap the contents\n that would cause information loss if cut off by the\n hardware features mentioned earlier.\nFor example, if you purposefully want your app to stretch\n under the cutouts, you can move the SafeArea to wrap\n whatever content makes sense,\n "}
147{"url": "https://docs.flutter.dev/ui/adaptive-responsive/safearea-mediaquery", "title": "Untitled", "text": " cutouts, you can move the SafeArea to wrap\n whatever content makes sense,\n and let the rest of the app take up the full screen.\n A side note is that this is what the AppBar widget\n does by default, which is how it goes underneath the\n system status bar. This is also why wrapping the body\n of a Scaffold in a SafeArea is recommended,\n instead of wrapping the whole Scaffold itself"}
148{"url": "https://docs.flutter.dev/ui/adaptive-responsive/safearea-mediaquery", "title": "Untitled", "text": "affold in a SafeArea is recommended,\n instead of wrapping the whole Scaffold itself.\nSafeArea ensures that your app content won't be\n cut off in a generic way and sets your app up\n for success even as new devices with different\n shapes and styles of cutouts enter the market.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
149{"url": "https://docs.flutter.dev/ui/adaptive-responsive/safearea-mediaquery", "title": "Untitled", "text": "reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
150{"url": "https://docs.flutter.dev/ui/adaptive-responsive/large-screens", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nThis page provides guidance on optimizing your\n app to improve its behavior on large screens.\nFlutter, like Android, defines large screens as tablets,\n foldables, and ChromeOS devices running Android. Flutter also defines large screen devices as web, desktop,\n and iPads.\nLayout with GridView\nConsider the following screenshots of an app.\n The app displays "}
151{"url": "https://docs.flutter.dev/ui/adaptive-responsive/large-screens", "title": "Untitled", "text": "yout with GridView\nConsider the following screenshots of an app.\n The app displays its UI in a ListView .\n The image on the left shows the app running\n on a mobile device. The image on the right shows the\n app running on a large screen device before the advice on this page was applied .\nThis is not optimal.\nThe Android Large Screen App Quality Guidelines and the iOS equivalent say that neither text nor boxes should take up the\n "}
152{"url": "https://docs.flutter.dev/ui/adaptive-responsive/large-screens", "title": "Untitled", "text": "n App Quality Guidelines and the iOS equivalent say that neither text nor boxes should take up the\n full screen width. How to solve this in an adaptive way?\nA common solution uses GridView , as shown in the next section.\nGridView\nYou can use the GridView widget to transform\n your existing ListView into more reasonably-sized items.\nGridView is similar to the ListView widget,\n but instead of handling only a list of widgets arranged linearly, GridV"}
153{"url": "https://docs.flutter.dev/ui/adaptive-responsive/large-screens", "title": "Untitled", "text": "ew widget,\n but instead of handling only a list of widgets arranged linearly, GridView can arrange widgets in a two-dimensional array.\nGridView also has constructors that are similar to ListView .\n The ListView default constructor maps to GridView.count ,\n and ListView.builder is similar to GridView.builder .\nGridView has some additional constructors for more custom layouts.\n To learn more, visit the GridView API page.\nFor examp"}
154{"url": "https://docs.flutter.dev/ui/adaptive-responsive/large-screens", "title": "Untitled", "text": "ors for more custom layouts.\n To learn more, visit the GridView API page.\nFor example, if your original app used a ListView.builder ,\n swap that out for a GridView.builder .\n If your app has a large number of items,\n it's recommended to use this builder constructor to only\n build the item widgets that are actually visible.\nMost of the parameters in the constructor are the same between\n the two w"}
155{"url": "https://docs.flutter.dev/ui/adaptive-responsive/large-screens", "title": "Untitled", "text": " visible.\nMost of the parameters in the constructor are the same between\n the two widgets, so it's a straightforward swap.\n However, you need to figure out what to set for the gridDelegate .\nFlutter provides powerful premade gridDelegates that you can use, namely:\nLets you assign a specific number of columns to your grid.\nLets you define a max item width.\nOther solutions\nAnother way to approach these situations is to\n use the maxWidth property o"}
156{"url": "https://docs.flutter.dev/ui/adaptive-responsive/large-screens", "title": "Untitled", "text": "lutions\nAnother way to approach these situations is to\n use the maxWidth property of BoxConstraints .\n This involves the following:\nWrap the GridView in a ConstrainedBox and give\n it a BoxConstraints with a maximum width set.\nUse a Container instead of a ConstrainedBox if you want other functionality like setting the\n background color.\nFor choosing the maximum width value,\n consider using the values recommen"}
157{"url": "https://docs.flutter.dev/ui/adaptive-responsive/large-screens", "title": "Untitled", "text": "nd color.\nFor choosing the maximum width value,\n consider using the values recommended\n by Material 3 in the Applying layout guide.\nFoldables\nAs mentioned previously, Android and Flutter both\n recommend in their design guidance not to lock screen orientation,\n but some apps lock screen orientation anyway.\n Be aware that this can cause problems when running your\n app on a foldable device.\nWhen ru"}
158{"url": "https://docs.flutter.dev/ui/adaptive-responsive/large-screens", "title": "Untitled", "text": "e that this can cause problems when running your\n app on a foldable device.\nWhen running on a foldable, the app might look ok\n when the device is folded. But when unfolding,\n you might find the app letterboxed.\nAs described in the SafeArea & MediaQuery page,\n letterboxing means that the app's window is locked to\n the center of the screen while the window is\n surrounded with black.\nWhy can this h"}
159{"url": "https://docs.flutter.dev/ui/adaptive-responsive/large-screens", "title": "Untitled", "text": "the center of the screen while the window is\n surrounded with black.\nWhy can this happen?\nThis can happen when using MediaQuery to figure out\n the window size for your app. When the device is folded,\n orientation is restricted to portrait mode.\n Under the hood, setPreferredOrientations causes\n Android to use a portrait compatibility mode and the app\n is displayed in a letterboxed state.\n "}
160{"url": "https://docs.flutter.dev/ui/adaptive-responsive/large-screens", "title": "Untitled", "text": "trait compatibility mode and the app\n is displayed in a letterboxed state.\n In the letterboxed state, MediaQuery never receives\n the larger window size that allows the UI to expand.\nYou can solve this in one of two ways:\nSupport all orientations.\nUse the dimensions of the physical display .\n In fact, this is one of the few situations where\n you would use the physical display dimensions and not the window dim"}
161{"url": "https://docs.flutter.dev/ui/adaptive-responsive/large-screens", "title": "Untitled", "text": "tions where\n you would use the physical display dimensions and not the window dimensions.\nHow to obtain the physical screen dimensions?\nYou can use the Display API, which contains the\n size, pixel ratio, and refresh rate of the physical device.\nThe following sample code retrieves a Display object:\nThe important thing is to find the display of the\n view that you care about. This creates a forward-looking\n API that should handle"}
162{"url": "https://docs.flutter.dev/ui/adaptive-responsive/large-screens", "title": "Untitled", "text": " view that you care about. This creates a forward-looking\n API that should handle current and future multi-display\n and multi-view devices.\nAdaptive input\nAdding support for more screens, also means\n expanding input controls.\nAndroid guidelines describe three tiers of large format device support.\nTier 3, the lowest level of support,\n includes support for mouse and stylus input\n ( Material 3 guidelines , Apple "}
163{"url": "https://docs.flutter.dev/ui/adaptive-responsive/large-screens", "title": "Untitled", "text": " includes support for mouse and stylus input\n ( Material 3 guidelines , Apple guidelines ).\nIf your app uses Material 3 and its buttons and selectors,\n then your app already has built-in support for\n various additional input states.\nBut what if you have a custom widget?\n Check out the User input page for\n guidance on adding input support for widgets .\nNavigation\nNavigation can create unique challenges when "}
164{"url": "https://docs.flutter.dev/ui/adaptive-responsive/large-screens", "title": "Untitled", "text": "dance on adding input support for widgets .\nNavigation\nNavigation can create unique challenges when working with a variety of\n differently-sized devices. Generally, you want to switch between\n a BottomNavigationBar and a NavigationRail depending on\n available screen space.\nFor more information (and corresponding example code),\n check out Problem: Navigation rail , a section in the Developing Flutter apps for Large screens articl"}
165{"url": "https://docs.flutter.dev/ui/adaptive-responsive/large-screens", "title": "Untitled", "text": "eck out Problem: Navigation rail , a section in the Developing Flutter apps for Large screens article.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
166{"url": "https://docs.flutter.dev/ui/adaptive-responsive/general", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nSo, just how do you approach taking an app\n designed for conventional mobile devices,\n and make it beautiful on a wide range\n of devices? What steps are required?\nGoogle engineers, who have experience doing this\n very thing for large apps, recommend the\n following 3-step approach.\nStep 1: Abstract\nFirst, identify the widgets that you plan"}
167{"url": "https://docs.flutter.dev/ui/adaptive-responsive/general", "title": "Untitled", "text": " following 3-step approach.\nStep 1: Abstract\nFirst, identify the widgets that you plan to\n make dynamic. Analyze the constructors for those\n widgets and abstract out the data that you can share.\nCommon widgets that require adaptability are:\nDialogs, both fullscreen and modal\nNavigation UI, both rail and bottom bar\nCustom layout, such as \"is the UI area taller or wider?\"\nFor example, in a Dialog widget, you can share\n the info that "}
168{"url": "https://docs.flutter.dev/ui/adaptive-responsive/general", "title": "Untitled", "text": "ea taller or wider?\"\nFor example, in a Dialog widget, you can share\n the info that contains the content of the dialog.\nOr, perhaps you want to switch between a NavigationBar when the app window is small,\n and a NavigationRail when the app window is large.\n These widgets would likely share a list of\n navigable destinations. In this case,\n you might create a Destination widget to hold\n this info, "}
169{"url": "https://docs.flutter.dev/ui/adaptive-responsive/general", "title": "Untitled", "text": " case,\n you might create a Destination widget to hold\n this info, and specify the Destination as having both\n an icon and a text label.\nNext, you will evaluate your screen size to decide\n on how to display your UI.\nStep 2: Measure\nYou have two ways to determine the size of your display area: MediaQuery and LayoutBuilder .\nMediaQuery\nIn the past, you might have used MediaQuery.of to\n determine the size of the dev"}
170{"url": "https://docs.flutter.dev/ui/adaptive-responsive/general", "title": "Untitled", "text": "ry\nIn the past, you might have used MediaQuery.of to\n determine the size of the device's screen.\n However, devices today feature screens\n with a wide variety of sizes and shapes,\n and this test can be misleading.\nFor example, maybe your app currently occupies a\n small window on a large screen. If you use the MediaQuery.of method and conclude the screen to be small\n (when, in fact, the app displa"}
171{"url": "https://docs.flutter.dev/ui/adaptive-responsive/general", "title": "Untitled", "text": "Query.of method and conclude the screen to be small\n (when, in fact, the app displays in a tiny window on a large screen),\n and you've portrait locked your app, it causes the\n app's window to lock to the center of the\n screen, surrounded with black.\n This is hardly an ideal UI on a large screen.\nKeep in mind that MediaQuery.sizeOf returns the\n current size of the app's entire screen and\n "}
172{"url": "https://docs.flutter.dev/ui/adaptive-responsive/general", "title": "Untitled", "text": "MediaQuery.sizeOf returns the\n current size of the app's entire screen and\n not just a single widget.\nYou have two ways to measure your screen space.\n You can use either MediaQuery.sizeOf or LayoutBuilder ,\n depending on whether you want the size of the whole\n app window, or more local sizing.\nIf you want your widget to be fullscreen,\n even when the app window is small,\n use Med"}
173{"url": "https://docs.flutter.dev/ui/adaptive-responsive/general", "title": "Untitled", "text": "get to be fullscreen,\n even when the app window is small,\n use MediaQuery.sizeOf so you can choose the\n UI based on the size of the app window itself.\n In the previous section, you want to base the\n sizing behavior on the entire app's window,\n so you would use MediaQuery.sizeOf .\nRequesting the size of the app window from inside\n the build method, as in MediaQuery.sizeOf(context"}
174{"url": "https://docs.flutter.dev/ui/adaptive-responsive/general", "title": "Untitled", "text": "ze of the app window from inside\n the build method, as in MediaQuery.sizeOf(context) ,\n causes the given BuildContext to rebuild any time\n the size property changes.\nLayoutBuilder\nLayoutBuilder accomplishes a similar goal as MediaQuery.sizeOf , with some distinctions.\nRather than providing the size of the app's window, LayoutBuilder provides the layout constraints from\n the parent Widget . This means that you get\n "}
175{"url": "https://docs.flutter.dev/ui/adaptive-responsive/general", "title": "Untitled", "text": "ayout constraints from\n the parent Widget . This means that you get\n sizing information based on the specific spot\n in the widget tree where you added the LayoutBuilder .\n Also, LayoutBuilder returns a BoxConstraints object instead of a Size object,\n so you are given the valid width\n and height ranges (minimum and maximum) for the content,\n rather than just a fixed size.\n "}
176{"url": "https://docs.flutter.dev/ui/adaptive-responsive/general", "title": "Untitled", "text": "nges (minimum and maximum) for the content,\n rather than just a fixed size.\n This can be useful for custom widgets.\nFor example, imagine a custom widget, where you want\n the sizing to be based on the space specifically\n given to that widget, and not the app window in general.\n In this scenario, use LayoutBuilder .\nStep 3: Branch\nAt this point, you must decide what sizing breakpoints to use\n when"}
177{"url": "https://docs.flutter.dev/ui/adaptive-responsive/general", "title": "Untitled", "text": "\nStep 3: Branch\nAt this point, you must decide what sizing breakpoints to use\n when choosing what version of the UI to display.\n For example, the Material layout guidelines suggest using\n a bottom nav bar for windows less than 600 logical pixels wide,\n and a nav rail for those that are 600 pixels wide or greater.\n Again, your choice shouldn't depend on the type of device,\n but on the device's av"}
178{"url": "https://docs.flutter.dev/ui/adaptive-responsive/general", "title": "Untitled", "text": " Again, your choice shouldn't depend on the type of device,\n but on the device's available window size.\nTo work through an example that switches between a NavigationRail and a NavigationBar , check out\n the Building an animated responsive app layout with Material 3 .\nThe next page discusses how to ensure that your\n app looks best on large screens and foldables.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page"}
179{"url": "https://docs.flutter.dev/ui/adaptive-responsive/general", "title": "Untitled", "text": "and foldables.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
180{"url": "https://docs.flutter.dev/ui/adaptive-responsive", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nOne of Flutter's primary goals is to create a framework\n that allows you to develop apps from a single codebase\n that look and feel great on any platform.\nThis means that your app might appear on screens of\n many different sizes, from a watch, to a foldable\n phone with two screens, to a high definition monitor.\n And your input device migh"}
181{"url": "https://docs.flutter.dev/ui/adaptive-responsive", "title": "Untitled", "text": " phone with two screens, to a high definition monitor.\n And your input device might be a physical or\n virtual keyboard, a mouse, a touchscreen, or\n any number of other devices.\nTwo terms that describe these design concepts\n are adaptive and responsive . Ideally,\n you'd want your app to be both but what,\n exactly, does this mean?\nWhat is responsive vs adaptive?\nAn easy way to think about it is t"}
182{"url": "https://docs.flutter.dev/ui/adaptive-responsive", "title": "Untitled", "text": " exactly, does this mean?\nWhat is responsive vs adaptive?\nAn easy way to think about it is that responsive design\n is about fitting the UI into the space and\n adaptive design is about the UI being usable in\n the space.\nSo, a responsive app adjusts the placement of design\n elements to fit the available space. And an\n adaptive app selects the appropriate layout and\n input devices to be usa"}
183{"url": "https://docs.flutter.dev/ui/adaptive-responsive", "title": "Untitled", "text": " adaptive app selects the appropriate layout and\n input devices to be usable in the available space.\n For example, should a tablet UI use bottom navigation or\n side-panel navigation?\nThis section covers various aspects of adaptive and\n responsive design:\nGeneral approach\nSafeArea & MediaQuery\nLarge screens & foldables\nUser input & accessibility\nCapabilities & policies\nBest practices for adaptive apps\nAdditional resourc"}
184{"url": "https://docs.flutter.dev/ui/adaptive-responsive", "title": "Untitled", "text": "er input & accessibility\nCapabilities & policies\nBest practices for adaptive apps\nAdditional resources\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
185{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nThis page describes how to bind physical keyboard events to actions in the user\n interface. For instance, to define keyboard shortcuts in your application, this\n page is for you.\nOverview\nFor a GUI application to do anything, it has to have actions: users want to tell\n the application to do something. Actions are often simple functions that\n directly perf"}
186{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "application to do something. Actions are often simple functions that\n directly perform the action (such as set a value or save a file). In a larger\n application, however, things are more complex: the code for invoking the action,\n and the code for the action itself might need to be in different places.\n Shortcuts (key bindings) might need definition at a level that knows nothing\n about the actions they invoke.\nT"}
187{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "ght need definition at a level that knows nothing\n about the actions they invoke.\nThat's where Flutter's actions and shortcuts system comes in. It allows\n developers to define actions that fulfill intents bound to them. In this\n context, an intent is a generic action that the user wishes to perform, and an Intent class instance represents these user intents in Flutter. An Intent can be general purpose, fulfilled by different actions in different"}
188{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "er intents in Flutter. An Intent can be general purpose, fulfilled by different actions in different\n contexts. An Action can be a simple callback (as in the case of\n the CallbackAction ) or something more complex that integrates with entire\n undo/redo architectures (for example) or other logic.\nShortcuts are key bindings that activate by pressing a key or combination\n of keys. The key combinations reside in a table with their b"}
189{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": " a key or combination\n of keys. The key combinations reside in a table with their bound intent. When\n the Shortcuts widget invokes them, it sends their matching intent to the\n actions subsystem for fulfillment.\nTo illustrate the concepts in actions and shortcuts, this article creates a\n simple app that allows a user to select and copy text in a text field using both\n buttons and shortcuts.\nWhy separate Actions f"}
190{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "copy text in a text field using both\n buttons and shortcuts.\nWhy separate Actions from Intents?\nYou might wonder: why not just map a key combination directly to an action? Why\n have intents at all? This is because it is useful to have a separation of\n concerns between where the key mapping definitions are (often at a high level),\n and where the action definitions are (often at a low level), and because it is\n i"}
191{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": " and where the action definitions are (often at a low level), and because it is\n important to be able to have a single key combination map to an intended\n operation in an app, and have it adapt automatically to whichever action\n fulfills that intended operation for the focused context.\nFor instance, Flutter has an ActivateIntent widget that maps each type of\n control to its corresponding version of an ActivateAction (and that e"}
192{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "each type of\n control to its corresponding version of an ActivateAction (and that executes\n the code that activates the control). This code often needs fairly private\n access to do its work. If the extra layer of indirection that Intent s provide\n didn't exist, it would be necessary to elevate the definition of the actions to\n where the defining instance of the Shortcuts widget could see them, causing\n "}
193{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": " where the defining instance of the Shortcuts widget could see them, causing\n the shortcuts to have more knowledge than necessary about which action to\n invoke, and to have access to or provide state that it wouldn't necessarily have\n or need otherwise. This allows your code to separate the two concerns to be more\n independent.\nIntents configure an action so that the same action can serve multiple uses. An\n "}
194{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "dependent.\nIntents configure an action so that the same action can serve multiple uses. An\n example of this is DirectionalFocusIntent , which takes a direction to move\n the focus in, allowing the DirectionalFocusAction to know which direction to\n move the focus. Just be careful: don't pass state in the Intent that applies\n to all invocations of an Action : that kind of state should be passed to the\n constructor"}
195{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": " invocations of an Action : that kind of state should be passed to the\n constructor of the Action itself, to keep the Intent from needing to know\n too much.\nWhy not use callbacks?\nYou also might wonder: why not just use a callback instead of an Action object? The main reason is that it's useful for actions to decide whether they\n are enabled by implementing isEnabled . Also, it is often helpful if the key\n bindings, and the impl"}
196{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "plementing isEnabled . Also, it is often helpful if the key\n bindings, and the implementation of those bindings, are in different places.\nIf all you need are callbacks without the flexibility of Actions and Shortcuts , you can use the CallbackShortcuts widget:\nShortcuts\nAs you'll see below, actions are useful on their own, but the most common use\n case involves binding them to a keyboard shortcut. This is what the Shortcuts widget is for.\nIt is inserted into the"}
197{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "nding them to a keyboard shortcut. This is what the Shortcuts widget is for.\nIt is inserted into the widget hierarchy to define key combinations that\n represent the user's intent when that key combination is pressed. To convert\n that intended purpose for the key combination into a concrete action, the Actions widget used to map the Intent to an Action . For instance, you can\n define a SelectAllIntent , and bind it to your own SelectAllAction or "}
198{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "ce, you can\n define a SelectAllIntent , and bind it to your own SelectAllAction or to your CanvasSelectAllAction , and from that one key binding, the system invokes\n either one, depending on which part of your application has focus. Let's see how\n the key binding part works:\nThe map given to a Shortcuts widget maps a LogicalKeySet (or a ShortcutActivator , see note below) to an Intent instance. The logical key\n set defines a set"}
199{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "tivator , see note below) to an Intent instance. The logical key\n set defines a set of one or more keys, and the intent indicates the intended\n purpose of the keypress. The Shortcuts widget looks up key presses in the map,\n to find an Intent instance, which it gives to the action's invoke() method.\nThe ShortcutManager\nThe shortcut manager, a longer-lived object than the Shortcuts widget, passes\n on key events when it receives th"}
200{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "r-lived object than the Shortcuts widget, passes\n on key events when it receives them. It contains the logic for deciding how to\n handle the keys, the logic for walking up the tree to find other shortcut\n mappings, and maintains a map of key combinations to intents.\nWhile the default behavior of the ShortcutManager is usually desirable, the Shortcuts widget takes a ShortcutManager that you can subclass to customize\n its function"}
201{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "uts widget takes a ShortcutManager that you can subclass to customize\n its functionality.\nFor example, if you wanted to log each key that a Shortcuts widget handled,\n you could make a LoggingShortcutManager :\nNow, every time the Shortcuts widget handles a shortcut, it prints out the key\n event and relevant context.\nActions\nActions allow for the definition of operations that the application can\n perform by invoking them with an I"}
202{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "finition of operations that the application can\n perform by invoking them with an Intent . Actions can be enabled or disabled,\n and receive the intent instance that invoked them as an argument to allow\n configuration by the intent.\nDefining actions\nActions, in their simplest form, are just subclasses of Action<Intent> with an invoke() method. Here's a simple action that simply invokes a function on the\n provided model:\nOr, if it"}
203{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "'s a simple action that simply invokes a function on the\n provided model:\nOr, if it's too much of a bother to create a new class, use a CallbackAction :\nOnce you have an action, you add it to your application using the Actions widget, which takes a map of Intent types to Action s:\nThe Shortcuts widget uses the Focus widget's context and Actions.invoke to\n find which action to invoke. If the Shortcuts widget doesn't find a matching\n intent type i"}
204{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "ch action to invoke. If the Shortcuts widget doesn't find a matching\n intent type in the first Actions widget encountered, it considers the next\n ancestor Actions widget, and so on, until it reaches the root of the widget\n tree, or finds a matching intent type and invokes the corresponding action.\nInvoking Actions\nThe actions system has several ways to invoke actions. By far the most common\n way is through the use of a Shortcut"}
205{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "ys to invoke actions. By far the most common\n way is through the use of a Shortcuts widget covered in the previous section,\n but there are other ways to interrogate the actions subsystem and invoke an\n action. It's possible to invoke actions that are not bound to keys.\nFor instance, to find an action associated with an intent, you can use:\nThis returns an Action associated with the SelectAllIntent type if one is\n available in t"}
206{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "eturns an Action associated with the SelectAllIntent type if one is\n available in the given context . If one isn't available, it returns null. If\n an associated Action should always be available, then use find instead of maybeFind , which throws an exception when it doesn't find a matching Intent type.\nTo invoke the action (if it exists), call:\nCombine that into one call with the following:\nSometimes you want to invoke an action as a\n result of"}
207{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "one call with the following:\nSometimes you want to invoke an action as a\n result of pressing a button or another control.\n You can do this with the Actions.handler function.\n If the intent has a mapping to an enabled action,\n the Actions.handler function creates a handler closure.\n However, if it doesn't have a mapping, it returns null .\n This allows the button to be disabled if\n "}
208{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "pping, it returns null .\n This allows the button to be disabled if\n there is no enabled action that matches in the context.\nThe Actions widget only invokes actions when isEnabled(Intent intent) returns true, allowing the action to decide if the dispatcher should consider it\n for invocation. If the action isn't enabled, the action is not invoked and the\n framework stops searching for matching actions at that point.\nThe previous e"}
209{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "d the\n framework stops searching for matching actions at that point.\nThe previous example uses a Builder because Actions.handler and Actions.invoke (for example) only finds actions in the provided context , and\n if the example passes the context given to the build function, the framework\n starts looking above the current widget. Using a Builder allows the\n framework to find the actions defined in the same build function.\nYou ca"}
210{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "llows the\n framework to find the actions defined in the same build function.\nYou can invoke an action without needing a BuildContext , but since the Actions widget requires a context to find an enabled action to invoke, you\n need to provide one, either by creating your own Action instance, or by\n finding one in an appropriate context with Actions.find .\nTo invoke the action, pass the action to the invoke method on an ActionDispatcher , either on"}
211{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "find .\nTo invoke the action, pass the action to the invoke method on an ActionDispatcher , either one you created yourself, or one retrieved from an\n existing Actions widget using the Actions.of(context) method. Check whether\n the action is enabled before calling invoke . Of course, you can also just call invoke on the action itself, passing an Intent , but then you opt out of any\n services that an action dispatcher might provide (like logging, "}
212{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "ou opt out of any\n services that an action dispatcher might provide (like logging, undo/redo, and\n so on).\nAction dispatchers\nMost of the time, you just want to invoke an action, have it do its thing, and\n forget about it. Sometimes, however, you might want to log the executed actions.\nThis is where replacing the default ActionDispatcher with a custom dispatcher\n comes in. You pass your ActionDispatcher to the Actions widget, a"}
213{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "stom dispatcher\n comes in. You pass your ActionDispatcher to the Actions widget, and it\n invokes actions from any Actions widgets below that one that doesn't set a\n dispatcher of its own.\nThe first thing Actions does when invoking an action is look up the ActionDispatcher and pass the action to it for invocation. If there is none,\n it creates a default ActionDispatcher that simply invokes the action.\nIf you want a log of all th"}
214{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": " it creates a default ActionDispatcher that simply invokes the action.\nIf you want a log of all the actions invoked, however, you can create your own LoggingActionDispatcher to do the job:\nThen you pass that to your top-level Actions widget:\nThis logs every action as it executes, like so:\nPutting it together\nThe combination of Actions and Shortcuts is powerful: you can define generic\n intents that map to specific actions at the widget level. Here's a simple app\n "}
215{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": " intents that map to specific actions at the widget level. Here's a simple app\n that illustrates the concepts described above. The app creates a text field that\n also has \"select all\" and \"copy to clipboard\" buttons next to it. The buttons\n invoke actions to accomplish their work. All the invoked actions and\n shortcuts are logged.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last up"}
216{"url": "https://docs.flutter.dev/ui/interactivity/actions-and-shortcuts", "title": "Untitled", "text": "ogged.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-06-26. View source or report an issue ."}
217{"url": "https://docs.flutter.dev/ui/interactivity/gestures/drag-outside", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nYou might want to implement\n drag and drop somewhere in your app.\nYou have a couple potential approaches\n that you can take. One directly uses\n Flutter widgets and the other uses a package\n ( super_drag_and_drop ), available on pub.dev .\nCreate draggable widgets within your app\nIf you want to implement drag and drop within\n your applicati"}
218{"url": "https://docs.flutter.dev/ui/interactivity/gestures/drag-outside", "title": "Untitled", "text": "dgets within your app\nIf you want to implement drag and drop within\n your application, you can use the Draggable widget. For insight into this approach, see\n the Drag a UI element within an app recipe.\nAn advantage of using Draggable and DragTarget is\n that you can supply Dart code to decide whether to accept a drop.\nFor more information, check out the Draggable widget of the week video.\nImplement drag and drop between apps\nIf you want to implem"}
219{"url": "https://docs.flutter.dev/ui/interactivity/gestures/drag-outside", "title": "Untitled", "text": "t the Draggable widget of the week video.\nImplement drag and drop between apps\nIf you want to implement drag and drop within\n your application and also between your\n application and another (possibly non-Flutter) app,\n check out the super_drag_and_drop package.\nTo avoid implementing two styles of drag and drop,\n one for drags outside of the app and another for\n dragging inside the app,\n you can "}
220{"url": "https://docs.flutter.dev/ui/interactivity/gestures/drag-outside", "title": "Untitled", "text": "ide of the app and another for\n dragging inside the app,\n you can supply local data to the package to\n perform drags within your app.\nAnother difference between this approach and\n using Draggable directly,\n is that you must tell the package up front\n what data your app accepts because the platform\n APIs need a synchronous response, which doesn't\n allow an asynch"}
221{"url": "https://docs.flutter.dev/ui/interactivity/gestures/drag-outside", "title": "Untitled", "text": "\n APIs need a synchronous response, which doesn't\n allow an asynchronous response from the framework.\nAn advantage of using this approach is that it\n works across desktop, mobile, and web.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
222{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nThis document explains how to listen for, and respond to, gestures in Flutter.\n Examples of gestures include taps, drags, and scaling.\nThe gesture system in Flutter has two separate layers.\n The first layer has raw pointer events that describe\n the location and movement of pointers (for example,\n touches, mice, and styli) across the screen.\n "}
223{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": "pointers (for example,\n touches, mice, and styli) across the screen.\n The second layer has gestures that describe semantic\n actions that consist of one or more pointer movements.\nPointers\nPointers represent raw data about the user's interaction\n with the device's screen.\n There are four types of pointer events:\nThe pointer has contacted the screen at a particular location.\nThe pointer has moved from one location"}
224{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": "e pointer has contacted the screen at a particular location.\nThe pointer has moved from one location on the screen to another.\nThe pointer has stopped contacting the screen.\nInput from this pointer is no longer directed towards this app.\nOn pointer down, the framework does a hit test on your app\n to determine which widget exists at the location where the\n pointer contacted the screen. The pointer down event\n (and subsequent events for that point"}
225{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": "contacted the screen. The pointer down event\n (and subsequent events for that pointer) are then dispatched\n to the innermost widget found by the hit test.\n From there, the events bubble up the tree and are dispatched\n to all the widgets on the path from the innermost\n widget to the root of the tree. There is no mechanism for\n canceling or stopping pointer events from being dispatched further.\nTo"}
226{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": "chanism for\n canceling or stopping pointer events from being dispatched further.\nTo listen to pointer events directly from the widgets layer, use a Listener widget. However, generally,\n consider using gestures (as discussed below) instead.\nGestures\nGestures represent semantic actions (for example, tap, drag,\n and scale) that are recognized from multiple individual pointer\n events, potentially even multiple individual pointers.\n "}
227{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": "ltiple individual pointer\n events, potentially even multiple individual pointers.\n Gestures can dispatch multiple events, corresponding to the\n lifecycle of the gesture (for example, drag start,\n drag update, and drag end):\nTap\nA pointer that might cause a tap has contacted\n the screen at a particular location.\nA pointer that triggers a tap has stopped contacting\n the screen at a particu"}
228{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": ".\nA pointer that triggers a tap has stopped contacting\n the screen at a particular location.\nThe pointer that previously triggered the onTapDown has also triggered onTapUp which ends up causing a tap.\nThe pointer that previously triggered the onTapDown won't end up causing a tap.\nDouble tap\nThe user has tapped the screen at the same location twice in\n quick succession.\nLong press\nA pointer has remained in contact with the\n screen at "}
229{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": "k succession.\nLong press\nA pointer has remained in contact with the\n screen at the same location for a long period of time.\nVertical drag\nA pointer has contacted the screen and might begin to\n move vertically.\nA pointer that is in contact with the screen and\n moving vertically has moved in the vertical direction.\nA pointer that was previously in contact with the screen\n and moving vertically is no longer in c"}
230{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": "reviously in contact with the screen\n and moving vertically is no longer in contact with the\n screen and was moving at a specific velocity when it\n stopped contacting the screen.\nHorizontal drag\nA pointer has contacted the screen and might begin to\n move horizontally.\nA pointer that is in contact with the screen and\n moving horizontally has moved in the horizontal direction.\nA pointer t"}
231{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": "een and\n moving horizontally has moved in the horizontal direction.\nA pointer that was previously in contact with the\n screen and moving horizontally is no longer in contact\n with the screen and was moving at a specific velocity\n when it stopped contacting the screen.\nPan\nA pointer has contacted the screen and might begin to move\n horizontally or vertically. This callback crashes if onHorizon"}
232{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": "t begin to move\n horizontally or vertically. This callback crashes if onHorizontalDragStart or onVerticalDragStart is set.\nA pointer that is in contact with the screen and is moving\n in the vertical or horizontal direction. This callback\n crashes if onHorizontalDragUpdate or onVerticalDragUpdate is set.\nA pointer that was previously in contact with screen\n is no longer in contact with the screen and is moving\n "}
233{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": " contact with screen\n is no longer in contact with the screen and is moving\n at a specific velocity when it stopped contacting the screen.\n This callback crashes if onHorizontalDragEnd or onVerticalDragEnd is set.\nAdding gesture detection to widgets\nTo listen to gestures from the widgets layer,\n use a GestureDetector .\nIf you're using Material Components,\n many of those widgets already respond to tap"}
234{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": "\nIf you're using Material Components,\n many of those widgets already respond to taps or gestures.\n For example, IconButton and TextButton respond to presses (taps), and ListView responds to swipes to trigger scrolling.\n If you aren't using those widgets, but you want the\n \"ink splash\" effect on a tap, you can use InkWell .\nGesture disambiguation\nAt a given location on screen,\n there might be multiple gesture det"}
235{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": " disambiguation\nAt a given location on screen,\n there might be multiple gesture detectors.\n For example:\nA ListTile has a tap recognizer that responds\n to the entire ListTile , and a nested one around\n a trailing icon button. The screen rect of the\n trailing icon is now covered by two gesture\n recognizers that need to negotiate for who handles\n the gesture if it turns "}
236{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": " recognizers that need to negotiate for who handles\n the gesture if it turns out to be a tap.\nA single GestureDetector covers a screen area\n configured to handle multiple gestures,\n such as a long press and a tap.\n The tap recognizer must now negotiate\n with the long press recognizer when\n the user touches that part of the screen.\n Depending on what happens nex"}
237{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": " the user touches that part of the screen.\n Depending on what happens next with that pointer,\n one of the two recognizers receives the gesture,\n or neither receives the gesture if the user\n performs something that's neither a tap nor a long press.\nAll of these gesture detectors listen to the stream\n of pointer events as they flow past and attempt to recognize\n specific gestures. "}
238{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": " of pointer events as they flow past and attempt to recognize\n specific gestures. The GestureDetector widget decides\n which gestures to attempt to recognize based on which of its\n callbacks are non-null.\nWhen there is more than one gesture recognizer for a given\n pointer on the screen, the framework disambiguates which\n gesture the user intends by having each recognizer join\n the gesture arena "}
239{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": " gesture the user intends by having each recognizer join\n the gesture arena . The gesture arena determines which\n gesture wins using the following rules:\nAt any time, a recognizer can eliminate itself and leave the\n arena. If there's only one recognizer left in the arena,\n that recognizer wins.\nAt any time, a recognizer can eliminate itself and leave the\n arena. If there's only one recognizer "}
240{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": "izer can eliminate itself and leave the\n arena. If there's only one recognizer left in the arena,\n that recognizer wins.\nAt any time, a recognizer can declare itself the winner,\n causing all of the remaining recognizers to lose.\nAt any time, a recognizer can declare itself the winner,\n causing all of the remaining recognizers to lose.\nFor example, when disambiguating horizontal and vertical dragging,\n "}
241{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": "recognizers to lose.\nFor example, when disambiguating horizontal and vertical dragging,\n both recognizers enter the arena when they receive the pointer\n down event. The recognizers observe the pointer move events.\n If the user moves the pointer more than a certain number of\n logical pixels horizontally, the horizontal recognizer declares\n the win and the gesture is interpreted as a horizontal drag.\n "}
242{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": "eclares\n the win and the gesture is interpreted as a horizontal drag.\n Similarly, if the user moves more than a certain number of logical\n pixels vertically, the vertical recognizer declares itself the winner.\nThe gesture arena is beneficial when there is only a horizontal\n (or vertical) drag recognizer. In that case, there is only one\n recognizer in the arena and the horizontal drag is recognized\n "}
243{"url": "https://docs.flutter.dev/ui/interactivity/gestures", "title": "Untitled", "text": "y one\n recognizer in the arena and the horizontal drag is recognized\n immediately, which means the first pixel of horizontal movement\n can be treated as a drag and the user won't need to wait for\n further gesture disambiguation.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
244{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nThis article explains how to control where keyboard input is directed. If you\n are implementing an application that uses a physical keyboard, such as most\n desktop and web applications, this page is for you. If your app won't be used\n with a physical keyboard, you can skip this.\nOverview\nFlutter comes with a focus system that directs the keyboard input to a\n "}
245{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "this.\nOverview\nFlutter comes with a focus system that directs the keyboard input to a\n particular part of an application. In order to do this, users \"focus\" the input\n onto that part of an application by tapping or clicking the desired UI element.\n Once that happens, text entered with the keyboard flows to that part of the\n application until the focus moves to another part of the application. Focus can\n also be"}
246{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "ation until the focus moves to another part of the application. Focus can\n also be moved by pressing a particular keyboard shortcut, which is typically\n bound to Tab , so it is sometimes called \"tab traversal\".\nThis page explores the APIs used to perform these operations on a Flutter\n application, and how the focus system works. We have noticed that there is some\n confusion among developers about how to define and use FocusNode"}
247{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "hat there is some\n confusion among developers about how to define and use FocusNode objects.\n If that describes your experience, skip ahead to the best practices for\n creating FocusNode objects .\nFocus use cases\nSome examples of situations where you might need to know how to use the focus\n system:\nReceiving/handling key events\nImplementing a custom component that needs to be focusable\nReceiving notifications when the focus cha"}
248{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "mplementing a custom component that needs to be focusable\nReceiving notifications when the focus changes\nChanging or defining the \"tab order\" of focus traversal in an application\nDefining groups of controls that should be traversed together\nPreventing some controls in an application from being focusable\nGlossary\nBelow are terms, as Flutter uses them, for elements of the focus system. The\n various classes that implement some of these concepts are introduced below.\nFocus tree - A "}
249{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": " various classes that implement some of these concepts are introduced below.\nFocus tree - A tree of focus nodes that typically sparsely mirrors the\n widget tree, representing all the widgets that can receive focus.\nFocus node - A single node in a focus tree. This node can receive the\n focus, and is said to \"have focus\" when it is part of the focus chain. It\n participates in handling key events only when it has focus.\nPrimary focus "}
250{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "n. It\n participates in handling key events only when it has focus.\nPrimary focus - The farthest focus node from the root of the focus tree\n that has focus. This is the focus node where key events start propagating to\n the primary focus node and its ancestors.\nFocus chain - An ordered list of focus nodes that starts at the primary\n focus node and follows the branches of the focus tree to the root of the\n "}
251{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": " focus node and follows the branches of the focus tree to the root of the\n focus tree.\nFocus scope - A special focus node whose job is to contain a group of\n other focus nodes, and allow only those nodes to receive focus. It contains\n information about which nodes were previously focused in its subtree.\nFocus traversal - The process of moving from one focusable node to\n another in a predictable order. This is typ"}
252{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "of moving from one focusable node to\n another in a predictable order. This is typically seen in applications when\n the user presses Tab to move to the next focusable control or\n field.\nFocusNode and FocusScopeNode\nThe FocusNode and FocusScopeNode objects implement the\n mechanics of the focus system. They are long-lived objects (longer than widgets,\n similar to render objects) that hold the focus state and "}
253{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "ts (longer than widgets,\n similar to render objects) that hold the focus state and attributes so that they\n are persistent between builds of the widget tree. Together, they form\n the focus tree data structure.\nThey were originally intended to be developer-facing objects used to control\n some aspects of the focus system, but over time they have evolved to mostly\n implement details of the focus system. In order to"}
254{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "ime they have evolved to mostly\n implement details of the focus system. In order to prevent breaking existing\n applications, they still contain public interfaces for their attributes. But, in\n general, the thing for which they are most useful is to act as a relatively\n opaque handle, passed to a descendant widget in order to call requestFocus() on an ancestor widget, which requests that a descendant widget obtain focus.\n "}
255{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "requestFocus() on an ancestor widget, which requests that a descendant widget obtain focus.\n Setting of the other attributes is best managed by a Focus or FocusScope widget, unless you are not using them, or implementing your own\n version of them.\nBest practices for creating FocusNode objects\nSome dos and don'ts around using these objects include:\nDon't allocate a new FocusNode for each build. This can cause\n memory leaks, and occasionally ca"}
256{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": " new FocusNode for each build. This can cause\n memory leaks, and occasionally causes a loss of focus when the widget\n rebuilds while the node has focus.\nDo create FocusNode and FocusScopeNode objects in a stateful widget. FocusNode and FocusScopeNode need to be disposed of when you're done\n using them, so they should only be created inside of a stateful widget's\n state object, where you can override dispose to dispose o"}
257{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "of a stateful widget's\n state object, where you can override dispose to dispose of them.\nDon't use the same FocusNode for multiple widgets. If you do, the\n widgets will fight over managing the attributes of the node, and you\n probably won't get what you expect.\nDo set the debugLabel of a focus node widget to help with diagnosing\n focus issues.\nDon't set the onKeyEvent callback on a FocusNode or FocusScopeNode if\n "}
258{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": " focus issues.\nDon't set the onKeyEvent callback on a FocusNode or FocusScopeNode if\n they are being managed by a Focus or FocusScope widget.\n If you want an onKeyEvent handler, then add a new Focus widget\n around the widget subtree you would like to listen to, and\n set the onKeyEvent attribute of the widget to your handler.\n Set canRequestFocus: false on the widget if\n you al"}
259{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": " handler.\n Set canRequestFocus: false on the widget if\n you also don't want it to be able to take primary focus.\n This is because the onKeyEvent attribute on the Focus widget can be\n set to something else in a subsequent build, and if that happens,\n it overwrites the onKeyEvent handler you set on the node.\nDo call requestFocus() on a node to request that it receives the\n primary focu"}
260{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "e.\nDo call requestFocus() on a node to request that it receives the\n primary focus, especially from an ancestor that has passed a node it owns to\n a descendant where you want to focus.\nDo use focusNode.requestFocus() . It is not necessary to call FocusScope.of(context).requestFocus(focusNode) . The focusNode.requestFocus() method is equivalent and more performant.\nUnfocusing\nThere is an API for telling a node to \"give up the focus\", named FocusNode.unfocus()"}
261{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "ant.\nUnfocusing\nThere is an API for telling a node to \"give up the focus\", named FocusNode.unfocus() . While it does remove focus from the node, it is important\n to realize that there really is no such thing as \"unfocusing\" all nodes. If a\n node is unfocused, then it must pass the focus somewhere else, since there is always a primary focus. The node that receives the focus when a node calls unfocus() is either the nearest FocusScopeNode , or a previously focused"}
262{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "the focus when a node calls unfocus() is either the nearest FocusScopeNode , or a previously focused node\n in that scope, depending upon the disposition argument given to unfocus() .\n If you would like more control over where the focus goes when you remove it from\n a node, explicitly focus another node instead of calling unfocus() , or use the\n focus traversal mechanism to find another node with the focusInDirection , nextFocus "}
263{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": " focus traversal mechanism to find another node with the focusInDirection , nextFocus , or previousFocus methods on FocusNode .\nWhen calling unfocus() , the disposition argument allows two modes for\n unfocusing: UnfocusDisposition.scope and UnfocusDisposition.previouslyFocusedChild . The default is scope , which gives\n the focus to the nearest parent focus scope. This means that if the focus is\n thereafter moved to the next node wi"}
264{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": " focus scope. This means that if the focus is\n thereafter moved to the next node with FocusNode.nextFocus , it starts with the\n \"first\" focusable item in the scope.\nThe previouslyFocusedChild disposition will search the scope to find the\n previously focused child and request focus on it. If there is no previously\n focused child, it is equivalent to scope .\nFocus widget\nThe Focus widget owns and manages a focus node, and is the w"}
265{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "t is equivalent to scope .\nFocus widget\nThe Focus widget owns and manages a focus node, and is the workhorse of the\n focus system. It manages the attaching and detaching of the focus node it owns\n from the focus tree, manages the attributes and callbacks of the focus node, and\n has static functions to enable discovery of focus nodes attached to the widget\n tree.\nIn its simplest form, wrapping the Focus widget around a widget su"}
266{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "he widget\n tree.\nIn its simplest form, wrapping the Focus widget around a widget subtree allows\n that widget subtree to obtain focus as part of the focus traversal process, or\n whenever requestFocus is called on the FocusNode passed to it. When combined\n with a gesture detector that calls requestFocus , it can receive focus when\n tapped or clicked.\nYou might pass a FocusNode object to the Focus widget to manage,"}
267{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": " tapped or clicked.\nYou might pass a FocusNode object to the Focus widget to manage, but if you\n don't, it creates its own. The main reason to create your own FocusNode is to be able to call requestFocus() on the node to control the focus from a parent widget. Most of the other\n functionality of a FocusNode is best accessed by changing the attributes of\n the Focus widget itself.\nThe Focus widget is used in most of Flutter's own c"}
268{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "es of\n the Focus widget itself.\nThe Focus widget is used in most of Flutter's own controls to implement their\n focus functionality.\nHere is an example showing how to use the Focus widget to make a custom\n control focusable. It creates a container with text that reacts to receiving the\n focus.\nKey events\nIf you wish to listen for key events in a subtree,\n set the onKeyEvent attribute of the Focus widget to\n "}
269{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "ey events in a subtree,\n set the onKeyEvent attribute of the Focus widget to\n be a handler that either just listens to the key, or\n handles the key and stops its propagation to other widgets.\nKey events start at the focus node with primary focus.\n If that node doesn't return KeyEventResult.handled from\n its onKeyEvent handler, then its parent focus node is given the event.\n If the parent doesn't"}
270{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "vent handler, then its parent focus node is given the event.\n If the parent doesn't handle it, it goes to its parent,\n and so on, until it reaches the root of the focus tree.\n If the event reaches the root of the focus tree without being handled, then\n it is returned to the platform to give to\n the next native control in the application\n (in case the Flutter UI is part of a larger native applica"}
271{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "trol in the application\n (in case the Flutter UI is part of a larger native application UI).\n Events that are handled are not propagated to other Flutter widgets,\n and they are also not propagated to native widgets.\nHere's an example of a Focus widget that absorbs every key that\n its subtree doesn't handle, without being able to be the primary focus:\nFocus key events are processed before text entry events, so handling a key even"}
272{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "e the primary focus:\nFocus key events are processed before text entry events, so handling a key event\n when the focus widget surrounds a text field prevents that key from being\n entered into the text field.\nHere's an example of a widget that won't allow the letter \"a\" to be typed into\n the text field:\nIf the intent is input validation, this example's functionality would probably\n be better implemented using a TextInputFormatter "}
273{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "e's functionality would probably\n be better implemented using a TextInputFormatter , but the technique can still\n be useful: the Shortcuts widget uses this method to handle shortcuts before\n they become text input, for instance.\nControlling what gets focus\nOne of the main aspects of focus is controlling what can receive focus and how.\n The attributes canRequestFocus , skipTraversal, and descendantsAreFocusable control how this n"}
274{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": " The attributes canRequestFocus , skipTraversal, and descendantsAreFocusable control how this node and its descendants participate in the focus process.\nIf the skipTraversal attribute true, then this focus node doesn't participate\n in focus traversal. It is still focusable if requestFocus is called on its\n focus node, but is otherwise skipped when the focus traversal system is looking\n for the next thing to focus on.\nThe canRequestFocus att"}
275{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "raversal system is looking\n for the next thing to focus on.\nThe canRequestFocus attribute, unsurprisingly, controls whether or not the\n focus node that this Focus widget manages can be used to request focus. If\n this attribute is false, then calling requestFocus on the node has no effect.\n It also implies that this node is skipped for focus traversal, since it can't\n request focus.\nThe descendantsAreFocusable at"}
276{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": " for focus traversal, since it can't\n request focus.\nThe descendantsAreFocusable attribute controls whether the descendants of this\n node can receive focus, but still allows this node to receive focus. This\n attribute can be used to turn off focusability for an entire widget subtree.\n This is how the ExcludeFocus widget works: it's just a Focus widget with\n this attribute set.\nAutofocus\nSetting the autofocus at"}
277{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "'s just a Focus widget with\n this attribute set.\nAutofocus\nSetting the autofocus attribute of a Focus widget tells the widget to\n request the focus the first time the focus scope it belongs to is focused. If\n more than one widget has autofocus set, then it is arbitrary which one\n receives the focus, so try to only set it on one widget per focus scope.\nThe autofocus attribute only takes effect if there isn't already a focus in\n "}
278{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "idget per focus scope.\nThe autofocus attribute only takes effect if there isn't already a focus in\n the scope that the node belongs to.\nSetting the autofocus attribute on two nodes that belong to different focus\n scopes is well defined: each one becomes the focused widget when their\n corresponding scopes are focused.\nChange notifications\nThe Focus.onFocusChanged callback can be used to get notifications that the\n focus state for"}
279{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": ".onFocusChanged callback can be used to get notifications that the\n focus state for a particular node has changed. It notifies if the node is added\n to or removed from the focus chain, which means it gets notifications even if it\n isn't the primary focus. If you only want to know if you have received the\n primary focus, check and see if hasPrimaryFocus is true on the focus node.\nObtaining the FocusNode\nSometimes, it is useful to"}
280{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "see if hasPrimaryFocus is true on the focus node.\nObtaining the FocusNode\nSometimes, it is useful to obtain the focus node of a Focus widget to\n interrogate its attributes.\nTo access the focus node from an ancestor of the Focus widget, create and pass\n in a FocusNode as the Focus widget's focusNode attribute. Because it needs\n to be disposed of, the focus node you pass needs to be owned by a stateful\n widget, so don't just creat"}
281{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "he focus node you pass needs to be owned by a stateful\n widget, so don't just create one each time it is built.\nIf you need access to the focus node from the descendant of a Focus widget,\n you can call Focus.of(context) to obtain the focus node of the nearest Focus widget to the given context. If you need to obtain the FocusNode of a Focus widget within the same build function, use a Builder to make sure you have\n the correct context. This is sh"}
282{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "uild function, use a Builder to make sure you have\n the correct context. This is shown in the following example:\nTiming\nOne of the details of the focus system is that when focus is requested, it only\n takes effect after the current build phase completes. This means that focus\n changes are always delayed by one frame, because changing focus can\n cause arbitrary parts of the widget tree to rebuild, including ancestors of the\n "}
283{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": " cause arbitrary parts of the widget tree to rebuild, including ancestors of the\n widget currently requesting focus. Because descendants cannot dirty their\n ancestors, it has to happen between frames, so that any needed changes can\n happen on the next frame.\nFocusScope widget\nThe FocusScope widget is a special version of the Focus widget that manages\n a FocusScopeNode instead of a FocusNode . The FocusScopeNode i"}
284{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "idget that manages\n a FocusScopeNode instead of a FocusNode . The FocusScopeNode is a special\n node in the focus tree that serves as a grouping mechanism for the focus nodes\n in a subtree. Focus traversal stays within a focus scope unless a node outside\n of the scope is explicitly focused.\nThe focus scope also keeps track of the current focus and history of the nodes\n focused within its subtree. That way, if a"}
285{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "current focus and history of the nodes\n focused within its subtree. That way, if a node releases focus or is removed\n when it had focus, the focus can be returned to the node that had focus\n previously.\nFocus scopes also serve as a place to return focus to if none of the descendants\n have focus. This allows the focus traversal code to have a starting context for\n finding the next (or first) focusable control t"}
286{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "ode to have a starting context for\n finding the next (or first) focusable control to move to.\nIf you focus a focus scope node, it first attempts to focus the current, or most\n recently focused node in its subtree, or the node in its subtree that requested\n autofocus (if any). If there is no such node, it receives the focus itself.\nFocusableActionDetector widget\nThe FocusableActionDetector is a widget that combines the functionality of Actions ,"}
287{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "Detector widget\nThe FocusableActionDetector is a widget that combines the functionality of Actions , Shortcuts , MouseRegion and a Focus widget to create\n a detector that defines actions and key bindings, and provides callbacks for\n handling focus and hover highlights. It is what Flutter controls use to\n implement all of these aspects of the controls. It is just implemented using the\n constituent widgets, so if you don't need al"}
288{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "ols. It is just implemented using the\n constituent widgets, so if you don't need all of its functionality, you can just\n use the ones you need, but it is a convenient way to build these behaviors into\n your custom controls.\nControlling focus traversal\nOnce an application has the ability to focus, the next thing many apps want to\n do is to allow the user to control the focus using the keyboard or another input\n d"}
289{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "do is to allow the user to control the focus using the keyboard or another input\n device. The most common example of this is \"tab traversal\" where the user\n presses Tab to go to the \"next\" control. Controlling what \"next\"\n means is the subject of this section. This kind of traversal is provided by\n Flutter by default.\nIn a simple grid layout, it's fairly easy to decide which control is next. If\n you're not at th"}
290{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "grid layout, it's fairly easy to decide which control is next. If\n you're not at the end of the row, then it's the one to the right (or left for\n right-to-left locales). If you are at the end of a row, it's the first control\n in the next row. Unfortunately, applications are rarely laid out in grids, so\n more guidance is often needed.\nThe default algorithm in Flutter ( ReadingOrderTraversalPolicy ) for focus\n tra"}
291{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "ed.\nThe default algorithm in Flutter ( ReadingOrderTraversalPolicy ) for focus\n traversal is pretty good: It gives the right answer for most applications.\n However, there are always pathological cases, or cases where the context or\n design requires a different order than the one the default ordering algorithm\n arrives at. For those cases, there are other mechanisms for achieving the\n desired order.\nFocusTraversa"}
292{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "e cases, there are other mechanisms for achieving the\n desired order.\nFocusTraversalGroup widget\nThe FocusTraversalGroup widget should be placed in the tree around widget\n subtrees that should be fully traversed before moving on to another widget or\n group of widgets. Just grouping widgets into related groups is often enough to\n resolve many tab traversal ordering problems. If not, the group can also be\n given a"}
293{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "esolve many tab traversal ordering problems. If not, the group can also be\n given a FocusTraversalPolicy to determine the ordering within the group.\nThe default ReadingOrderTraversalPolicy is usually sufficient, but in\n cases where more control over ordering is needed, an OrderedTraversalPolicy can be used. The order argument of the FocusTraversalOrder widget wrapped around the focusable components\n determines the order. The order can be any sub"}
294{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "ped around the focusable components\n determines the order. The order can be any subclass of FocusOrder , but NumericFocusOrder and LexicalFocusOrder are provided.\nIf none of the provided focus traversal policies are sufficient for your\n application, you could also write your own policy and use it to determine any\n custom ordering you want.\nHere's an example of how to use the FocusTraversalOrder widget to traverse a\n row of butto"}
295{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "an example of how to use the FocusTraversalOrder widget to traverse a\n row of buttons in the order TWO, ONE, THREE using NumericFocusOrder .\nFocusTraversalPolicy\nThe FocusTraversalPolicy is the object that determines which widget is next,\n given a request and the current focus node. The requests (member functions) are\n things like findFirstFocus , findLastFocus , next , previous , and inDirection .\nFocusTraversalPolicy is the abstract base class"}
296{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": " findLastFocus , next , previous , and inDirection .\nFocusTraversalPolicy is the abstract base class for concrete policies, like ReadingOrderTraversalPolicy , OrderedTraversalPolicy and the DirectionalFocusTraversalPolicyMixin classes.\nIn order to use a FocusTraversalPolicy , you give one to a FocusTraversalGroup , which determines the widget subtree in which the policy\n will be effective. The member functions of the class are rarely called directly:\n they are m"}
297{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "ffective. The member functions of the class are rarely called directly:\n they are meant to be used by the focus system.\nThe focus manager\nThe FocusManager maintains the current primary focus for the system. It\n only has a few pieces of API that are useful to users of the focus system. One\n is the FocusManager.instance.primaryFocus property, which contains the\n currently focused focus node and is also accessible from the global p"}
298{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "contains the\n currently focused focus node and is also accessible from the global primaryFocus field.\nOther useful properties are FocusManager.instance.highlightMode and FocusManager.instance.highlightStrategy . These are used by widgets that need\n to switch between a \"touch\" mode and a \"traditional\" (mouse and keyboard) mode\n for their focus highlights. When a user is using touch to navigate, the focus\n highlight is usually hid"}
299{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "lights. When a user is using touch to navigate, the focus\n highlight is usually hidden, and when they switch to a mouse or keyboard, the\n focus highlight needs to be shown again so they know what is focused. The highlightStrategy tells the focus manager how to interpret changes in the\n usage mode of the device: it can either automatically switch between the two\n based on the most recent input events, or it can be locked in touch"}
300{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": "etween the two\n based on the most recent input events, or it can be locked in touch or\n traditional modes. The provided widgets in Flutter already know how to use this\n information, so you only need it if you're writing your own controls from\n scratch. You can use addHighlightModeListener callback to listen for changes\n in the highlight mode.\nUnless stated otherwise, the documentation on this site reflects Flutt"}
301{"url": "https://docs.flutter.dev/ui/interactivity/focus", "title": "Untitled", "text": " in the highlight mode.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-11. View source or report an issue ."}
302{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nHow do you modify your app to make it react to user input?\n In this tutorial, you'll add interactivity to an app that\n contains only non-interactive widgets.\n Specifically, you'll modify an icon to make it tappable\n by creating a custom stateful widget that manages two\n stateless widgets.\nThe building layouts tutorial showed you how to cr"}
303{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": " manages two\n stateless widgets.\nThe building layouts tutorial showed you how to create\n the layout for the following screenshot.\nThe layout tutorial app\nWhen the app first launches, the star is solid red,\n indicating that this lake has previously been favorited.\n The number next to the star indicates that 41\n people have favorited this lake. After completing this tutorial,\n tapping the star rem"}
304{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "ple have favorited this lake. After completing this tutorial,\n tapping the star removes its favorited status,\n replacing the solid star with an outline and\n decreasing the count. Tapping again favorites the lake,\n drawing a solid star and increasing the count.\nTo accomplish this, you'll create a single custom widget\n that includes both the star and the count,\n which are themselves widgets. Tappi"}
305{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": " that includes both the star and the count,\n which are themselves widgets. Tapping the star changes state\n for both widgets, so the same widget should manage both.\nYou can get right to touching the code in Step 2: Subclass StatefulWidget .\n If you want to try different ways of managing state,\n skip to Managing state .\nStateful and stateless widgets\nA widget is either stateful or stateless. If a widget can\n ch"}
306{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "and stateless widgets\nA widget is either stateful or stateless. If a widget can\n change—when a user interacts with it,\n for example—it's stateful.\nA stateless widget never changes. Icon , IconButton , and Text are\n examples of stateless widgets. Stateless widgets\n subclass StatelessWidget .\nA stateful widget is dynamic: for example,\n it can change its appearance in response to events\n triggered "}
307{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "e,\n it can change its appearance in response to events\n triggered by user interactions or when it receives data. Checkbox , Radio , Slider , InkWell , Form , and TextField are examples of stateful widgets. Stateful widgets\n subclass StatefulWidget .\nA widget's state is stored in a State object,\n separating the widget's state from its appearance.\n The state consists of values that can change, like a\n "}
308{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "its appearance.\n The state consists of values that can change, like a\n slider's current value or whether a checkbox is checked.\n When the widget's state changes,\n the state object calls setState() ,\n telling the framework to redraw the widget.\nCreating a stateful widget\nIn this section, you'll create a custom stateful widget.\n You'll replace two stateless widgets—the solid red\n "}
309{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "eful widget.\n You'll replace two stateless widgets—the solid red\n star and the numeric count next to it—with a single\n custom stateful widget that manages a row with two\n children widgets: an IconButton and Text .\nImplementing a custom stateful widget requires creating two classes:\nA subclass of StatefulWidget that defines the widget.\nA subclass of State that contains the state for that\n widget and defines the"}
310{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "get.\nA subclass of State that contains the state for that\n widget and defines the widget's build() method.\nThis section shows you how to build a stateful widget,\n called FavoriteWidget , for the lakes app.\n After setting up, your first step is choosing how state is\n managed for FavoriteWidget .\nStep 0: Get ready\nIf you've already built the app in the building layouts tutorial ,\n skip to the next section.\nMake "}
311{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "y built the app in the building layouts tutorial ,\n skip to the next section.\nMake sure you've set up your environment.\nCreate a new Flutter app .\nReplace the lib/main.dart file with main.dart .\nReplace the pubspec.yaml file with pubspec.yaml .\nCreate an images directory in your project, and add lake.jpg .\nOnce you have a connected and enabled device,\n or you've launched the iOS simulator (part of the Flutter install) or the Android emulator (part of the Android"}
312{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "aunched the iOS simulator (part of the Flutter install) or the Android emulator (part of the Android Studio\n install), you are good to go!\nStep 1: Decide which object manages the widget's state\nA widget's state can be managed in several ways,\n but in our example the widget itself, FavoriteWidget , will manage its own state.\n In this example, toggling the star is an isolated\n action that doesn't affect the parent widget or the re"}
313{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "ing the star is an isolated\n action that doesn't affect the parent widget or the rest of\n the UI, so the widget can handle its state internally.\nLearn more about the separation of widget and state,\n and how state might be managed, in Managing state .\nStep 2: Subclass StatefulWidget\nThe FavoriteWidget class manages its own state,\n so it overrides createState() to create a State object. The framework calls createState() when it wa"}
314{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "so it overrides createState() to create a State object. The framework calls createState() when it wants to build the widget.\n In this example, createState() returns an\n instance of _FavoriteWidgetState ,\n which you'll implement in the next step.\nStep 3: Subclass State\nThe _FavoriteWidgetState class stores the mutable data\n that can change over the lifetime of the widget.\n When the app first launches, the UI disp"}
315{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "n change over the lifetime of the widget.\n When the app first launches, the UI displays a solid\n red star, indicating that the lake has \"favorite\" status,\n along with 41 likes. These values are stored in the _isFavorited and _favoriteCount fields:\nThe class also defines a build() method,\n which creates a row containing a red IconButton ,\n and Text . You use IconButton (instead of Icon )\n becaus"}
316{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "utton ,\n and Text . You use IconButton (instead of Icon )\n because it has an onPressed property that defines\n the callback function ( _toggleFavorite ) for handling a tap.\n You'll define the callback function next.\nThe _toggleFavorite() method, which is called when the IconButton is pressed, calls setState() .\n Calling setState() is critical, because this\n tells the framework that the widget's "}
317{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "alling setState() is critical, because this\n tells the framework that the widget's state has\n changed and that the widget should be redrawn.\n The function argument to setState() toggles the\n UI between these two states:\nA star icon and the number 41\nA star_border icon and the number 40\nStep 4: Plug the stateful widget into the widget tree\nAdd your custom stateful widget to the widget tree in\n the app's build() m"}
318{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "get tree\nAdd your custom stateful widget to the widget tree in\n the app's build() method. First, locate the code that\n creates the Icon and Text , and delete it.\n In the same location, create the stateful widget:\nThat's it! When you hot reload the app,\n the star icon should now respond to taps.\nProblems?\nIf you can't get your code to run, look in your\n IDE for possible errors. Debugging Flutter apps might help.\n"}
319{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": " to run, look in your\n IDE for possible errors. Debugging Flutter apps might help.\n If you still can't find the problem,\n check your code against the interactive lakes example on GitHub.\nlib/main.dart\npubspec.yaml\nlakes.jpg\nIf you still have questions, refer to any one of the developer community channels.\nThe rest of this page covers several ways a widget's state can\n be managed, and lists other available interactive widgets.\nMa"}
320{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "a widget's state can\n be managed, and lists other available interactive widgets.\nManaging state\nWho manages the stateful widget's state? The widget itself?\n The parent widget? Both? Another object?\n The answer is... it depends. There are several valid ways\n to make your widget interactive. You, as the widget designer,\n make the decision based on how you expect your widget to be used.\n Here are "}
321{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": " make the decision based on how you expect your widget to be used.\n Here are the most common ways to manage state:\nThe widget manages its own state\nThe parent manages the widget's state\nA mix-and-match approach\nHow do you decide which approach to use?\n The following principles should help you decide:\nIf the state in question is user data,\n for example the checked or unchecked\n mode of a checkbox, or the position of"}
322{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": " for example the checked or unchecked\n mode of a checkbox, or the position of a slider,\n then the state is best managed by the parent widget.\nIf the state in question is user data,\n for example the checked or unchecked\n mode of a checkbox, or the position of a slider,\n then the state is best managed by the parent widget.\nIf the state in question is aesthetic,\n for examp"}
323{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "managed by the parent widget.\nIf the state in question is aesthetic,\n for example an animation, then the\n state is best managed by the widget itself.\nIf the state in question is aesthetic,\n for example an animation, then the\n state is best managed by the widget itself.\nIf in doubt, start by managing state in the parent widget.\nWe'll give examples of the different ways of managing state\n by creati"}
324{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "rent widget.\nWe'll give examples of the different ways of managing state\n by creating three simple examples: TapboxA, TapboxB,\n and TapboxC. The examples all work similarly—each\n creates a container that, when tapped, toggles between a\n green or grey box. The _active boolean determines the\n color: green for active or grey for inactive.\nThese examples use GestureDetector to capture activity\n on t"}
325{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": " or grey for inactive.\nThese examples use GestureDetector to capture activity\n on the Container .\nThe widget manages its own state\nSometimes it makes the most sense for the widget\n to manage its state internally. For example, ListView automatically scrolls when its\n content exceeds the render box. Most developers\n using ListView don't want to manage ListView 's\n scrolling behavior, so ListView itself manages its"}
326{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "on't want to manage ListView 's\n scrolling behavior, so ListView itself manages its scroll offset.\nThe _TapboxAState class:\nManages state for TapboxA .\nDefines the _active boolean which determines the\n box's current color.\nDefines the _handleTap() function, which updates _active when the box is tapped and calls the setState() function to update the UI.\nImplements all interactive behavior for the widget.\nThe parent widget manages the widget's state\nOften it mak"}
327{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "s all interactive behavior for the widget.\nThe parent widget manages the widget's state\nOften it makes the most sense for the parent widget\n to manage the state and tell its child widget when to update.\n For example, IconButton allows you to treat\n an icon as a tappable button. IconButton is a\n stateless widget because we decided that the parent\n widget needs to know whether the button has been tapped,\n "}
328{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "that the parent\n widget needs to know whether the button has been tapped,\n so it can take appropriate action.\nIn the following example, TapboxB exports its state\n to its parent through a callback. Because TapboxB\n doesn't manage any state, it subclasses StatelessWidget.\nThe ParentWidgetState class:\nManages the _active state for TapboxB.\nImplements _handleTapboxChanged() ,\n the method called when the box is tap"}
329{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "pboxB.\nImplements _handleTapboxChanged() ,\n the method called when the box is tapped.\nWhen the state changes, calls setState() to update the UI.\nThe TapboxB class:\nExtends StatelessWidget because all state is handled by its parent.\nWhen a tap is detected, it notifies the parent.\nA mix-and-match approach\nFor some widgets, a mix-and-match approach makes\n the most sense. In this scenario, the stateful widget\n manages some of the state, and the pa"}
330{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "sense. In this scenario, the stateful widget\n manages some of the state, and the parent widget\n manages other aspects of the state.\nIn the TapboxC example, on tap down,\n a dark green border appears around the box. On tap up,\n the border disappears and the box's color changes. TapboxC exports its _active state to its parent but manages its _highlight state internally. This example has two State objects, _ParentWidgetState and _Ta"}
331{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "ages its _highlight state internally. This example has two State objects, _ParentWidgetState and _TapboxCState .\nThe _ParentWidgetState object:\nManages the _active state.\nImplements _handleTapboxChanged() ,\n the method called when the box is tapped.\nCalls setState() to update the UI when a tap\n occurs and the _active state changes.\nThe _TapboxCState object:\nManages the _highlight state.\nThe GestureDetector listens to all tap events.\n As th"}
332{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "nages the _highlight state.\nThe GestureDetector listens to all tap events.\n As the user taps down, it adds the highlight\n (implemented as a dark green border). As the user releases the\n tap, it removes the highlight.\nCalls setState() to update the UI on tap down,\n tap up, or tap cancel, and the _highlight state changes.\nOn a tap event, passes that state change to the parent widget to take\n appropriate "}
333{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": " a tap event, passes that state change to the parent widget to take\n appropriate action using the widget property.\nAn alternate implementation might have exported the highlight\n state to the parent while keeping the active state internal,\n but if you asked someone to use that tap box,\n they'd probably complain that it doesn't make much sense.\n The developer cares whether the box is active.\n Th"}
334{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "ke much sense.\n The developer cares whether the box is active.\n The developer probably doesn't care how the highlighting\n is managed, and prefers that the tap box handles those\n details.\nOther interactive widgets\nFlutter offers a variety of buttons and similar interactive widgets.\n Most of these widgets implement the Material Design guidelines ,\n which define a set of components with an opiniona"}
335{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "the Material Design guidelines ,\n which define a set of components with an opinionated UI.\nIf you prefer, you can use GestureDetector to build\n interactivity into any custom widget.\n You can find examples of GestureDetector in Managing state . Learn more about the GestureDetector in Handle taps , a recipe in the Flutter cookbook.\nWhen you need interactivity, it's easiest to use one of\n the prefabricated widgets. Here's a partial"}
336{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "eractivity, it's easiest to use one of\n the prefabricated widgets. Here's a partial list:\nStandard widgets\nForm\nFormField\nMaterial Components\nCheckbox\nDropdownButton\nTextButton\nFloatingActionButton\nIconButton\nRadio\nElevatedButton\nSlider\nSwitch\nTextField\nResources\nThe following resources might help when adding interactivity\n to your app.\nGestures , a section in the Flutter cookbook.\nHow to create a button and make it respond to input.\nA description of Flutter's g"}
337{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": " Flutter cookbook.\nHow to create a button and make it respond to input.\nA description of Flutter's gesture mechanism.\nReference documentation for all of the Flutter libraries.\nFlutter showcase app with a custom design and engaging interactions.\nThis video includes information about state and\n stateless widgets. Presented by Google engineer, Ian Hickson.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View sou"}
338{"url": "https://docs.flutter.dev/ui/interactivity", "title": "Untitled", "text": "e, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
339{"url": "https://docs.flutter.dev/ui/layout/scrolling/slivers", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nA sliver is a portion of a scrollable area that you\n can define to behave in a special way.\n You can use slivers to achieve custom scrolling effects,\n such as elastic scrolling.\nFor a free, instructor-led video workshop that uses DartPad,\n check out the following video about using slivers.\nWatch on YouTube in a new tab: \"Building scrolling experiences in "}
340{"url": "https://docs.flutter.dev/ui/layout/scrolling/slivers", "title": "Untitled", "text": "lowing video about using slivers.\nWatch on YouTube in a new tab: \"Building scrolling experiences in Flutter\"\nResources\nFor more information on implementing fancy scrolling effects\n in Flutter, see the following resources:\nA free article on Medium that\n explains how to implement custom scrolling\n using the sliver classes.\nA one-minute Widget-of-the-week\n video that gives an overview of the SliverAppBar widget.\nWatch o"}
341{"url": "https://docs.flutter.dev/ui/layout/scrolling/slivers", "title": "Untitled", "text": "t-of-the-week\n video that gives an overview of the SliverAppBar widget.\nWatch on YouTube in a new tab: \"SliverAppBar | Flutter widget of the week\"\nA one-minute Widget-of-the-week\n video that gives an overview of the SliverList and SliverGrid widgets.\nWatch on YouTube in a new tab: \"SliverList & SliverGrid | Flutter widget of the week\"\nA 50-minute episode of The Boring Show where Ian Hickson, Flutter's Tech Lead, and Filip Hracek\n dis"}
342{"url": "https://docs.flutter.dev/ui/layout/scrolling/slivers", "title": "Untitled", "text": "f The Boring Show where Ian Hickson, Flutter's Tech Lead, and Filip Hracek\n discuss the power of slivers.\nWatch on YouTube in a new tab: \"Slivers explained - Making dynamic layouts\"\nAPI docs\nTo learn more about the available sliver APIs,\n check out these related API docs:\nCustomScrollView\nSliverAppBar\nSliverGrid\nSliverList\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report a"}
343{"url": "https://docs.flutter.dev/ui/layout/scrolling/slivers", "title": "Untitled", "text": "ation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
344{"url": "https://docs.flutter.dev/ui/layout/scrolling", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nFlutter has many built-in widgets that automatically\n scroll and also offers a variety of widgets\n that you can customize to create specific scrolling\n behavior.\nBasic scrolling\nMany Flutter widgets support scrolling out of the box\n and do most of the work for you. For example, SingleChildScrollView automatically scrolls its\n child when n"}
345{"url": "https://docs.flutter.dev/ui/layout/scrolling", "title": "Untitled", "text": "for you. For example, SingleChildScrollView automatically scrolls its\n child when necessary. Other useful widgets include ListView and GridView .\n You can check out more of these widgets on the scrolling page of the Widget catalog.\nWatch on YouTube in a new tab: \"Scrollbar | Flutter widget of the week\"\nWatch on YouTube in a new tab: \"ListView | Flutter widget of the week\"\nInfinite scrolling\nWhen you have a long list of items\n in your ListView or"}
346{"url": "https://docs.flutter.dev/ui/layout/scrolling", "title": "Untitled", "text": "he week\"\nInfinite scrolling\nWhen you have a long list of items\n in your ListView or GridView (including an infinite list),\n you can build the items on demand\n as they scroll into view. This provides a much\n more performant scrolling experience.\n For more information, check out ListView.builder or GridView.builder .\nSpecialized scrollable widgets\nThe following widgets provide more\n specific scrol"}
347{"url": "https://docs.flutter.dev/ui/layout/scrolling", "title": "Untitled", "text": ".\nSpecialized scrollable widgets\nThe following widgets provide more\n specific scrolling behavior.\nA video on using DraggableScrollableSheet :\nWatch on YouTube in a new tab: \"DraggableScrollableSheet | Flutter widget of the week\"\nTurn the scrollable area into a wheel with ListWheelScrollView !\nWatch on YouTube in a new tab: \"ListWheelScrollView | Flutter widget of the week\"\nFancy scrolling\nPerhaps you want to implement elastic scrolling,\n also called scroll bounc"}
348{"url": "https://docs.flutter.dev/ui/layout/scrolling", "title": "Untitled", "text": "crolling\nPerhaps you want to implement elastic scrolling,\n also called scroll bouncing . Or maybe you want to\n implement other dynamic scrolling effects, like parallax scrolling.\n Or perhaps you want a scrolling header with very specific behavior,\n such as shrinking or disappearing.\nYou can achieve all this and more using the\n Flutter Sliver* classes.\n A sliver refers to a piece of the scrollabl"}
349{"url": "https://docs.flutter.dev/ui/layout/scrolling", "title": "Untitled", "text": " Flutter Sliver* classes.\n A sliver refers to a piece of the scrollable area.\n You can define and insert a sliver into a CustomScrollView to have finer-grained control over that area.\nFor more information, check out Using slivers to achieve fancy scrolling and the Sliver classes .\nNested scrolling widgets\nHow do you nest a scrolling widget\n inside another scrolling widget\n without hurting scrolling performance?\n "}
350{"url": "https://docs.flutter.dev/ui/layout/scrolling", "title": "Untitled", "text": " inside another scrolling widget\n without hurting scrolling performance?\n Do you set the ShrinkWrap property to true,\n or do you use a sliver?\nCheck out the \"ShrinkWrap vs Slivers\" video:\nWatch on YouTube in a new tab: \"ShrinkWrap vs Slivers | Decoding Flutter\"\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
351{"url": "https://docs.flutter.dev/ui/layout/scrolling", "title": "Untitled", "text": "Page last updated on 2026-05-05. View source or report an issue ."}
352{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nWhen someone learning Flutter asks you why some widget\n with width: 100 isn't 100 pixels wide,\n the default answer is to tell them to put that widget\n inside of a Center , right?\nDon't do that.\nIf you do, they'll come back again and again,\n asking why some FittedBox isn't working,\n why that Column is overflowing, or what IntrinsicWidth is"}
353{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "FittedBox isn't working,\n why that Column is overflowing, or what IntrinsicWidth is supposed to be doing.\nInstead, first tell them that Flutter layout is very different\n from HTML layout (which is probably where they're coming from),\n and then make them memorize the following rule:\nFlutter layout can't really be understood without knowing\n this rule, so Flutter developers should learn it early on.\nIn more detail:\nA widget gets i"}
354{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " this rule, so Flutter developers should learn it early on.\nIn more detail:\nA widget gets its own constraints from its parent .\n A constraint is just a set of 4 doubles:\n a minimum and maximum width, and a minimum and maximum height.\nThen the widget goes through its own list of children .\n One by one, the widget tells its children what their constraints are (which can be different for each child),\n and then asks"}
355{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "hat their constraints are (which can be different for each child),\n and then asks each child what size it wants to be.\nThen, the widget positions its children (horizontally in the x axis, and vertically in the y axis),\n one by one.\nAnd, finally, the widget tells its parent about its own size (within the original constraints, of course).\nFor example, if a composed widget contains a column\n with some padding, and wants to lay out its two child"}
356{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "sed widget contains a column\n with some padding, and wants to lay out its two children\n as follows:\nThe negotiation goes something like this:\nWidget : \"Hey parent, what are my constraints?\"\nParent : \"You must be from 0 to 300 pixels wide,\n and 0 to 85 tall.\"\nWidget : \"Hmmm, since I want to have 5 pixels of padding,\n then my children can have at most 290 pixels of width\n and 75 pixels of height.\"\nWidget "}
357{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "children can have at most 290 pixels of width\n and 75 pixels of height.\"\nWidget : \"Hey first child, You must be from 0 to 290 pixels wide, and 0 to 75 tall.\"\nFirst child : \"OK, then I wish to be 290 pixels wide,\n and 20 pixels tall.\"\nWidget : \"Hmmm, since I want to put my second child below the\n first one, this leaves only 55 pixels of height for\n my second child.\"\nWidget : \"Hey second child, You must be from 0 to 29"}
358{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "ight for\n my second child.\"\nWidget : \"Hey second child, You must be from 0 to 290 wide,\n and 0 to 55 tall.\"\nSecond child : \"OK, I wish to be 140 pixels wide,\n and 30 pixels tall.\"\nWidget : \"Very well. My first child has position x: 5 and y: 5 ,\n and my second child has x: 80 and y: 25 .\"\nWidget : \"Hey parent, I've decided that my size is going to be 300 pixels wide, and 60 pixels tall.\"\nLimitations\nFlutter's layout e"}
359{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "ded that my size is going to be 300 pixels wide, and 60 pixels tall.\"\nLimitations\nFlutter's layout engine is designed to be a one-pass process.\n This means that Flutter lays out its widgets very efficiently,\n but does result in a few limitations:\nA widget can decide its own size only within the\n constraints given to it by its parent.\n This means a widget usually can't have any size it wants .\nA widget can decide its own "}
360{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " This means a widget usually can't have any size it wants .\nA widget can decide its own size only within the\n constraints given to it by its parent.\n This means a widget usually can't have any size it wants .\nA widget can't know and doesn't decide its own position\n in the screen , since it's the widget's parent who decides\n the position of the widget.\nA widget can't know and doesn't decide its own p"}
361{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "s\n the position of the widget.\nA widget can't know and doesn't decide its own position\n in the screen , since it's the widget's parent who decides\n the position of the widget.\nSince the parent's size and position, in its turn,\n also depends on its own parent, it's impossible to\n precisely define the size and position of any widget\n without taking into consideration the "}
362{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "ine the size and position of any widget\n without taking into consideration the tree as a whole.\nSince the parent's size and position, in its turn,\n also depends on its own parent, it's impossible to\n precisely define the size and position of any widget\n without taking into consideration the tree as a whole.\nIf a child wants a different size from its parent and\n the parent doesn't have enough "}
363{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "ild wants a different size from its parent and\n the parent doesn't have enough information to align it,\n then the child's size might be ignored. Be specific when defining alignment.\nIf a child wants a different size from its parent and\n the parent doesn't have enough information to align it,\n then the child's size might be ignored. Be specific when defining alignment.\nIn Flutter, widgets are rendered by their und"}
364{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "might be ignored. Be specific when defining alignment.\nIn Flutter, widgets are rendered by their underlying RenderBox objects. Many boxes in Flutter,\n especially those that just take a single child,\n pass their constraint on to their children.\nGenerally, there are three kinds of boxes,\n in terms of how they handle their constraints:\nThose that try to be as big as possible.\n For example, the boxes used by Center and ListView .\n"}
365{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " to be as big as possible.\n For example, the boxes used by Center and ListView .\nThose that try to be the same size as their children.\n For example, the boxes used by Transform and Opacity .\nThose that try to be a particular size.\n For example, the boxes used by Image and Text .\nSome widgets, for example Container ,\n vary from type to type based on their constructor arguments.\n The Container constructor de"}
366{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "om type to type based on their constructor arguments.\n The Container constructor defaults\n to trying to be as big as possible, but if you give it a width ,\n for instance, it tries to honor that and be that particular size.\nOthers, for example Row and Column (flex boxes)\n vary based on the constraints they are given,\n as described in the Flex section.\nExamples\nFor an interactive experience, use the following Dart"}
367{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " as described in the Flex section.\nExamples\nFor an interactive experience, use the following DartPad.\n Use the numbered horizontal scrolling bar to switch between\n 29 different examples.\nIf you prefer, you can grab the code from this GitHub repo .\nThe examples are explained in the following sections.\nExample 1\nThe screen is the parent of the Container , and it\n forces the Container to be exactly the same size as the screen.\nSo the Container f"}
368{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " forces the Container to be exactly the same size as the screen.\nSo the Container fills the screen and paints it red.\nExample 2\nThe red Container wants to be 100 × 100,\n but it can't, because the screen forces it to be\n exactly the same size as the screen.\nSo the Container fills the screen.\nExample 3\nThe screen forces the Center to be exactly the same size\n as the screen, so the Center fills the screen.\nThe Center tells the Cont"}
369{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "same size\n as the screen, so the Center fills the screen.\nThe Center tells the Container that it can be any size it\n wants, but not bigger than the screen. Now the Container can indeed be 100 × 100.\nExample 4\nThis is different from the previous example in that it uses Align instead of Center .\nAlign also tells the Container that it can be any size it\n wants, but if there is empty space it won't center the Container .\n Instead, i"}
370{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " wants, but if there is empty space it won't center the Container .\n Instead, it aligns the container to the bottom-right of the\n available space.\nExample 5\nThe screen forces the Center to be exactly the\n same size as the screen, so the Center fills the screen.\nThe Center tells the Container that it can be any size it wants,\n but not bigger than the screen. The Container wants to be\n of infinite size, but si"}
371{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "but not bigger than the screen. The Container wants to be\n of infinite size, but since it can't be bigger than the screen,\n it just fills the screen.\nExample 6\nThe screen forces the Center to be exactly the\n same size as the screen, so the Center fills the screen.\nThe Center tells the Container that it can be any\n size it wants, but not bigger than the screen.\n Since the Container has no child and no fixed size,"}
372{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "ut not bigger than the screen.\n Since the Container has no child and no fixed size,\n it decides it wants to be as big as possible,\n so it fills the whole screen.\nBut why does the Container decide that?\n Simply because that's a design decision by those who\n created the Container widget. It could have been\n created differently, and you have to read the Container API documentation to understand\n "}
373{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " created differently, and you have to read the Container API documentation to understand\n how it behaves, depending on the circumstances.\nExample 7\nThe screen forces the Center to be exactly the same\n size as the screen, so the Center fills the screen.\nThe Center tells the red Container that it can be any size\n it wants, but not bigger than the screen. Since the red Container has no size but has a child,\n it decides it w"}
374{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "n the screen. Since the red Container has no size but has a child,\n it decides it wants to be the same size as its child.\nThe red Container tells its child that it can be any size\n it wants, but not bigger than the screen.\nThe child is a green Container that wants to\n be 30 × 30. Given that the red Container sizes itself to\n the size of its child, it is also 30 × 30.\n The red color isn't visible because the gree"}
375{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "ize of its child, it is also 30 × 30.\n The red color isn't visible because the green Container entirely covers the red Container .\nExample 8\nThe red Container sizes itself to its children's size,\n but it takes its own padding into consideration.\n So it is also 30 × 30 plus padding.\n The red color is visible because of the padding,\n and the green Container has the same size as\n in the previous ex"}
376{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "\n and the green Container has the same size as\n in the previous example.\nExample 9\nYou might guess that the Container has to be\n between 70 and 150 pixels, but you would be wrong.\n The ConstrainedBox only imposes additional constraints\n from those it receives from its parent.\nHere, the screen forces the ConstrainedBox to be exactly\n the same size as the screen, so it tells its child Container to"}
377{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "dBox to be exactly\n the same size as the screen, so it tells its child Container to also assume the size of the screen, thus ignoring its constraints parameter.\nExample 10\nNow, Center allows ConstrainedBox to be any size up to\n the screen size. The ConstrainedBox imposes additional constraints from its constraints parameter onto its child.\nThe Container must be between 70 and 150 pixels.\n It wants to have 10 pixels,\n so it ends "}
378{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "tween 70 and 150 pixels.\n It wants to have 10 pixels,\n so it ends up having 70 (the minimum).\nExample 11\nCenter allows ConstrainedBox to be any size up to the\n screen size. The ConstrainedBox imposes additional constraints from its constraints parameter onto its child.\nThe Container must be between 70 and 150 pixels.\n It wants to have 1000 pixels,\n so it ends up having 150 (the maximum).\nExample 12\nCenter allows"}
379{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "have 1000 pixels,\n so it ends up having 150 (the maximum).\nExample 12\nCenter allows ConstrainedBox to be any size up to the\n screen size. The ConstrainedBox imposes additional constraints from its constraints parameter onto its child.\nThe Container must be between 70 and 150 pixels.\n It wants to have 100 pixels, and that's the size it has,\n since that's between 70 and 150.\nExample 13\nThe screen forces the UnconstrainedBox to be "}
380{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " since that's between 70 and 150.\nExample 13\nThe screen forces the UnconstrainedBox to be exactly\n the same size as the screen. However, the UnconstrainedBox lets its child Container be any size it wants.\nExample 14\nThe screen forces the UnconstrainedBox to be exactly\n the same size as the screen, and UnconstrainedBox lets its child Container be any size it wants.\nUnfortunately, in this case the Container is\n 4000 pixels wide and is to"}
381{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " it wants.\nUnfortunately, in this case the Container is\n 4000 pixels wide and is too big to fit in\n the UnconstrainedBox , so the UnconstrainedBox displays\n the much dreaded \"overflow warning\".\nExample 15\nThe screen forces the OverflowBox to be exactly the same\n size as the screen, and OverflowBox lets its child Container be any size it wants.\nOverflowBox is similar to UnconstrainedBox ;\n the difference is that "}
382{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "ize it wants.\nOverflowBox is similar to UnconstrainedBox ;\n the difference is that it won't display any warnings\n if the child doesn't fit the space.\nIn this case, the Container has 4000 pixels of width,\n and is too big to fit in the OverflowBox ,\n but the OverflowBox simply shows as much as it can,\n with no warnings given.\nExample 16\nThis won't render anything, and you'll see an error in the console.\nThe Uncons"}
383{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "ngs given.\nExample 16\nThis won't render anything, and you'll see an error in the console.\nThe UnconstrainedBox lets its child be any size it wants,\n however its child is a Container with infinite size.\nFlutter can't render infinite sizes, so it throws an error with\n the following message: BoxConstraints forces an infinite width.\nExample 17\nHere you won't get an error anymore,\n because when the LimitedBox is given an\n infinite si"}
384{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "ror anymore,\n because when the LimitedBox is given an\n infinite size by the UnconstrainedBox ;\n it passes a maximum width of 100 down to its child.\nIf you swap the UnconstrainedBox for a Center widget,\n the LimitedBox won't apply its limit anymore\n (since its limit is only applied when it gets infinite\n constraints), and the width of the Container is allowed to grow past 100.\nThis explains the d"}
385{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " constraints), and the width of the Container is allowed to grow past 100.\nThis explains the difference between a LimitedBox and a ConstrainedBox .\nExample 18\nThe screen forces the FittedBox to be exactly the same\n size as the screen. The Text has some natural width\n (also called its intrinsic width) that depends on the\n amount of text, its font size, and so on.\nThe FittedBox lets the Text be any size it wants,\n but after "}
386{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "font size, and so on.\nThe FittedBox lets the Text be any size it wants,\n but after the Text tells its size to the FittedBox ,\n the FittedBox scales the Text until it fills all of\n the available width.\nExample 19\nBut what happens if you put the FittedBox inside of a Center widget? The Center lets the FittedBox be any size it wants, up to the screen size.\nThe FittedBox then sizes itself to the Text ,\n and lets the Text be any size"}
387{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " size.\nThe FittedBox then sizes itself to the Text ,\n and lets the Text be any size it wants.\n Since both FittedBox and the Text have the same size,\n no scaling happens.\nExample 20\nHowever, what happens if FittedBox is inside of a Center widget, but the Text is too large to fit the screen?\nFittedBox tries to size itself to the Text ,\n but it can't be bigger than the screen.\n It then assumes the screen size,\n "}
388{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " but it can't be bigger than the screen.\n It then assumes the screen size,\n and resizes Text so that it fits the screen, too.\nExample 21\nIf, however, you remove the FittedBox , the Text gets its maximum width from the screen,\n and breaks the line so that it fits the screen.\nExample 22\nFittedBox can only scale a widget that is bounded\n (has non-infinite width and height). Otherwise,\n it won't render anything,"}
389{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " (has non-infinite width and height). Otherwise,\n it won't render anything,\n and you'll see an error in the console.\nExample 23\nThe screen forces the Row to be exactly the same size\n as the screen.\nJust like an UnconstrainedBox , the Row won't\n impose any constraints onto its children,\n and instead lets them be any size they want.\n The Row then puts them side-by-side,\n a"}
390{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "em be any size they want.\n The Row then puts them side-by-side,\n and any extra space remains empty.\nExample 24\nSince Row won't impose any constraints onto its children,\n it's quite possible that the children might be too big to fit\n the available width of the Row . In this case, just like an UnconstrainedBox , the Row displays the \"overflow warning\".\nExample 25\nWhen a Row 's child is wrapped in an Expanded widget,\n "}
391{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " \"overflow warning\".\nExample 25\nWhen a Row 's child is wrapped in an Expanded widget,\n the Row won't let this child define its own width anymore.\nInstead, it defines the Expanded width according to the\n other children, and only then the Expanded widget forces\n the original child to have the Expanded 's width.\nIn other words, once you use Expanded ,\n the original child's width becomes irrelevant, and is ignored.\nExample 26\nIf all"}
392{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": ",\n the original child's width becomes irrelevant, and is ignored.\nExample 26\nIf all of Row 's children are wrapped in Expanded widgets,\n each Expanded has a size proportional to its flex parameter,\n and only then each Expanded widget forces its child to have\n the Expanded 's width.\nIn other words, Expanded ignores the preferred width of\n its children.\nExample 27\nThe only difference if you use Flexible instead of"}
393{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "dth of\n its children.\nExample 27\nThe only difference if you use Flexible instead of Expanded ,\n is that Flexible lets its child have the same or smaller\n width than the Flexible itself, while Expanded forces\n its child to have the exact same width of the Expanded .\n But both Expanded and Flexible ignore their children's width\n when sizing themselves.\nExample 28\nThe screen forces the Scaffold to "}
394{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "dren's width\n when sizing themselves.\nExample 28\nThe screen forces the Scaffold to be exactly the same size\n as the screen, so the Scaffold fills the screen.\n The Scaffold tells the Container that it can be any size it wants,\n but not bigger than the screen.\nExample 29\nIf you want the Scaffold 's child to be exactly the same size\n as the Scaffold itself, you can wrap its child with SizedBox.expand .\nTight vs loo"}
395{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " as the Scaffold itself, you can wrap its child with SizedBox.expand .\nTight vs loose constraints\nIt's very common to hear that some constraint is\n \"tight\" or \"loose\", so what does that mean?\nTight constraints\nA tight constraint offers a single possibility,\n an exact size. In other words, a tight constraint\n has its maximum width equal to its minimum width;\n and has its maximum height equal to its minimum height"}
396{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "equal to its minimum width;\n and has its maximum height equal to its minimum height.\nAn example of this is the App widget,\n which is contained by the RenderView class:\n the box used by the child returned by the\n application's build function is given a constraint\n that forces it to exactly fill the application's content area\n (typically, the entire screen).\nAnother example: if you nest a bunch of"}
397{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "ntent area\n (typically, the entire screen).\nAnother example: if you nest a bunch of boxes inside\n each other at the root of your application's render tree,\n they'll all exactly fit in each other,\n forced by the box's tight constraints.\nIf you go to Flutter's box.dart file and search for\n the BoxConstraints constructors,\n you'll find the following:\nIf you revisit Example 2 ,\n the"}
398{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "ctors,\n you'll find the following:\nIf you revisit Example 2 ,\n the screen forces the red Container to be\n exactly the same size as the screen.\n The screen achieves that, of course, by passing tight\n constraints to the Container .\nLoose constraints\nA loose constraint is one that has a minimum\n of zero and a maximum non-zero.\nSome boxes loosen the incoming constraints,\n meaning th"}
399{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "ero and a maximum non-zero.\nSome boxes loosen the incoming constraints,\n meaning the maximum is maintained but the\n minimum is removed, so the widget can have\n a minimum width and height both equal to zero .\nUltimately, Center 's purpose is to transform\n the tight constraints it received from its parent\n (the screen) to loose constraints for its child\n (the Container ).\nIf you revisit Example 3 "}
400{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "en) to loose constraints for its child\n (the Container ).\nIf you revisit Example 3 ,\n the Center allows the red Container to be smaller,\n but not bigger than the screen.\nUnbounded constraints\nIn certain situations,\n a box's constraint is unbounded , or infinite.\n This means that either the maximum width or\n the maximum height is set to double.infinity .\nA box that tries to be as big as possible "}
401{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " the maximum height is set to double.infinity .\nA box that tries to be as big as possible won't\n function usefully when given an unbounded constraint and,\n in debug mode, throws an exception.\nThe most common case where a render box ends up\n with an unbounded constraint is within a flex box\n ( Row or Column ),\n and within a scrollable region (such as ListView and other ScrollView subclasses).\nListView ,"}
402{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " and within a scrollable region (such as ListView and other ScrollView subclasses).\nListView , for example,\n tries to expand to fit the space available\n in its cross-direction\n (perhaps it's a vertically-scrolling block and\n tries to be as wide as its parent).\n If you nest a vertically scrolling ListView inside a horizontally scrolling ListView ,\n the inner list tries to be as wide as poss"}
403{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "ide a horizontally scrolling ListView ,\n the inner list tries to be as wide as possible,\n which is infinitely wide,\n since the outer one is scrollable in that direction.\nThe next section describes the error you might\n encounter with unbounded constraints in a Flex widget.\nFlex\nA flex box ( Row and Column ) behaves\n differently depending on whether its\n constraint is bounded or unbounded in\n "}
404{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " differently depending on whether its\n constraint is bounded or unbounded in\n its primary direction.\nA flex box with a bounded constraint in its\n primary direction tries to be as big as possible.\nA flex box with an unbounded constraint\n in its primary direction tries to fit its children\n in that space. Each child's flex value must be\n set to zero, meaning that you can't use Expanded when the fl"}
405{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "'s flex value must be\n set to zero, meaning that you can't use Expanded when the flex box is inside\n another flex box or a scrollable;\n otherwise it throws an exception.\nThe cross direction\n (width for Column or height for Row ),\n must never be unbounded,\n or it can't reasonably align its children.\nLearning the layout rules for specific widgets\nKnowing the general layout rule is necessary, but i"}
406{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": ".\nLearning the layout rules for specific widgets\nKnowing the general layout rule is necessary, but it's not enough.\nEach widget has a lot of freedom when applying the general rule,\n so there is no way of knowing how it behaves by just reading\n the widget's name.\nIf you try to guess, you'll probably guess wrong.\n You can't know exactly how a widget behaves unless\n you've read its documentation, or studied its source-code.\nThe lay"}
407{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " behaves unless\n you've read its documentation, or studied its source-code.\nThe layout source-code is usually complex,\n so it's probably better to just read the documentation.\n However, if you decide to study the layout source-code,\n you can easily find it by using the navigating capabilities\n of your IDE.\nHere's an example:\nFind a Column in your code and navigate to its\n source code. To do "}
408{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "an example:\nFind a Column in your code and navigate to its\n source code. To do this, use command+B (macOS)\n or control+B (Windows/Linux) in Android Studio or IntelliJ.\n You'll be taken to the basic.dart file.\n Since Column extends Flex , navigate to the Flex source code (also in basic.dart ).\nFind a Column in your code and navigate to its\n source code. To do this, use command+B (macOS)\n "}
409{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "code and navigate to its\n source code. To do this, use command+B (macOS)\n or control+B (Windows/Linux) in Android Studio or IntelliJ.\n You'll be taken to the basic.dart file.\n Since Column extends Flex , navigate to the Flex source code (also in basic.dart ).\nScroll down until you find a method called createRenderObject() . As you can see,\n this method returns a RenderFlex .\n "}
410{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "bject() . As you can see,\n this method returns a RenderFlex .\n This is the render-object for the Column .\n Now navigate to the source-code of RenderFlex ,\n which takes you to the flex.dart file.\nScroll down until you find a method called createRenderObject() . As you can see,\n this method returns a RenderFlex .\n This is the render-object for the Column .\n "}
411{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "ns a RenderFlex .\n This is the render-object for the Column .\n Now navigate to the source-code of RenderFlex ,\n which takes you to the flex.dart file.\nScroll down until you find a method called performLayout() . This is the method that does\n the layout for the Column .\nScroll down until you find a method called performLayout() . This is the method that does\n the layout for the Column .\nOrigin"}
412{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": "formLayout() . This is the method that does\n the layout for the Column .\nOriginal article by Marcelo Glasberg\nMarcelo originally published this content as Flutter: The Advanced Layout Rule Even Beginners Must Know on Medium. We loved it and asked that he allow us to publish\n in on docs.flutter.dev, to which he graciously agreed. Thanks, Marcelo!\n You can find Marcelo on GitHub and pub.dev .\nAlso, thanks to Simon Lightfoot for creating the\n "}
413{"url": "https://docs.flutter.dev/ui/layout/constraints", "title": "Untitled", "text": " You can find Marcelo on GitHub and pub.dev .\nAlso, thanks to Simon Lightfoot for creating the\n header image at the top of the article.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
414{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nThis tutorial explains how to design and build layouts in Flutter.\nIf you use the example code provided, you can build the following app.\nThe finished app.\nPhoto by Dino Reichmuth on Unsplash .\n Text by Switzerland Tourism .\nTo get a better overview of the layout mechanism, start with Flutter's approach to layout .\nDiagram the layout\nIn this section, consider what type of user experience you want for\n "}
415{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "o layout .\nDiagram the layout\nIn this section, consider what type of user experience you want for\n your app users.\nConsider how to position the components of your user interface.\n A layout consists of the total end result of these positionings.\n Consider planning your layout to speed up your coding.\n Using visual cues to know where something goes on screen can be a great help.\nUse whichever method you prefer, like an interface d"}
416{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "e something goes on screen can be a great help.\nUse whichever method you prefer, like an interface design tool or a pencil\n and a sheet of paper. Figure out where you want to place elements on your\n screen before writing code. It's the programming version of the adage:\n \"Measure twice, cut once.\"\nAsk these questions to break the layout down to its basic elements. Can you identify the rows and columns? Does the layout include a grid? Are there ov"}
417{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": " basic elements. Can you identify the rows and columns? Does the layout include a grid? Are there overlapping elements? Does the UI need tabs? What do you need to align, pad, or border?\nAsk these questions to break the layout down to its basic elements.\nCan you identify the rows and columns?\nDoes the layout include a grid?\nAre there overlapping elements?\nDoes the UI need tabs?\nWhat do you need to align, pad, or border?\nIdentify the larger elements. In this example, you arrange the image, title,\n"}
418{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "align, pad, or border?\nIdentify the larger elements. In this example, you arrange the image, title,\nbuttons, and description into a column. Major elements in the layout: image, row, row, and text block\nIdentify the larger elements. In this example, you arrange the image, title,\nbuttons, and description into a column.\nMajor elements in the layout: image, row, row, and text block\nDiagram each row. Row 1, the Title section, has three children:\na column of text, a star icon, and a number.\nIts first "}
419{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "ow 1, the Title section, has three children:\na column of text, a star icon, and a number.\nIts first child, the column, contains two lines of text.\nThat first column might need more space. Title section with text blocks and an icon Row 2, the Button section, has three children: each child contains\na column which then contains an icon and text. The Button section with three labeled buttons\nDiagram each row.\nRow 1, the Title section, has three children:\na column of text, a star icon, and a number.\n"}
420{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "ach row.\nRow 1, the Title section, has three children:\na column of text, a star icon, and a number.\nIts first child, the column, contains two lines of text.\nThat first column might need more space. Title section with text blocks and an icon\nRow 1, the Title section, has three children:\na column of text, a star icon, and a number.\nIts first child, the column, contains two lines of text.\nThat first column might need more space.\nTitle section with text blocks and an icon\nRow 2, the Button section, "}
421{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "column might need more space.\nTitle section with text blocks and an icon\nRow 2, the Button section, has three children: each child contains\na column which then contains an icon and text. The Button section with three labeled buttons\nRow 2, the Button section, has three children: each child contains\na column which then contains an icon and text.\nThe Button section with three labeled buttons\nAfter diagramming the layout, consider how you would code it.\nWould you write all the code in one class?\n "}
422{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "iagramming the layout, consider how you would code it.\nWould you write all the code in one class?\n Or, would you create one class for each part of the layout?\nTo follow Flutter best practices, create one class, or Widget,\n to contain each part of your layout.\n When Flutter needs to re-render part of a UI,\n it updates the smallest part that changes.\n This is why Flutter makes \"everything a widget\".\n "}
423{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "part that changes.\n This is why Flutter makes \"everything a widget\".\n If only the text changes in a Text widget, Flutter redraws only that text.\n Flutter changes the least amount of the UI possible in response to user input.\nFor this tutorial, write each element you have identified as its own widget.\nCreate the app base code\nIn this section, shell out the basic Flutter app code to start your app.\nSet up your Flutter environment .\nSet up your Flu"}
424{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": " out the basic Flutter app code to start your app.\nSet up your Flutter environment .\nSet up your Flutter environment .\nCreate a new Flutter app .\nCreate a new Flutter app .\nReplace the contents of lib/main.dart with the following code.\n This app uses a parameter for the app title and the title shown\n on the app's appBar . This decision simplifies the code. dart import ' package:flutter/material.dart ' ; void main ( ) => runApp ( const MyApp ( ) ) ; c"}
425{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": " dart import ' package:flutter/material.dart ' ; void main ( ) => runApp ( const MyApp ( ) ) ; class MyApp extends StatelessWidget { const MyApp ( { super . key } ) ; @override Widget build ( BuildContext context ) { const String appTitle = ' Flutter layout demo ' ; return MaterialApp ( title : appTitle , home : Scaffold ( appBar : AppBar ( title : const Text ( appTitle ) ) , body : const Center ( child : Text ( ' Hello World ' ) , ) , ) , ) ; } } content_copy\nReplace the contents of lib/m"}
426{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "nter ( child : Text ( ' Hello World ' ) , ) , ) , ) ; } } content_copy\nReplace the contents of lib/main.dart with the following code.\n This app uses a parameter for the app title and the title shown\n on the app's appBar . This decision simplifies the code.\nAdd the Title section\nIn this section, create a TitleSection widget that resembles\n the following layout.\nThe Title section as sketch and prototype UI\nAdd the TitleSection Widget\nAdd t"}
427{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "the following layout.\nThe Title section as sketch and prototype UI\nAdd the TitleSection Widget\nAdd the following code after the MyApp class.\nTo use all remaining free space in the row, use the Expanded widget to\n stretch the Column widget.\n To place the column at the start of the row,\n set the crossAxisAlignment property to CrossAxisAlignment.start .\nTo add space between the rows of text, put those rows in a Padding widget.\nThe title row e"}
428{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "t.start .\nTo add space between the rows of text, put those rows in a Padding widget.\nThe title row ends with a red star icon and the text 41 .\n The entire row falls inside a Padding widget and pads each edge\n by 32 pixels.\nChange the app body to a scrolling view\nIn the body property, replace the Center widget with a SingleChildScrollView widget.\n Within the SingleChildScrollView widget, replace the Text widget with a Column widget.\nThese c"}
429{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": " Within the SingleChildScrollView widget, replace the Text widget with a Column widget.\nThese code updates change the app in the following ways.\nA SingleChildScrollView widget can scroll.\n This allows elements that don't fit on the current screen to display.\nA Column widget displays any elements within its children property\n in the order listed.\n The first element listed in the children list displays at\n the top of "}
430{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": " The first element listed in the children list displays at\n the top of the list. Elements in the children list display\n in array order on the screen from top to bottom.\nUpdate the app to display the title section\nAdd the TitleSection widget as the first element in the children list.\n This places it at the top of the screen.\n Pass the provided name and location to the TitleSection constructor.\nAdd the Button section"}
431{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": " Pass the provided name and location to the TitleSection constructor.\nAdd the Button section\nIn this section, add the buttons that will add functionality to your app.\nThe Button section contains three columns that use the same layout:\n an icon over a row of text.\nThe Button section as sketch and prototype UI\nPlan to distribute these columns in one row so each takes the same\n amount of space. Paint all text and icons with the primary color.\nAdd the Button"}
432{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "e\n amount of space. Paint all text and icons with the primary color.\nAdd the ButtonSection widget\nAdd the following code after the TitleSection widget to contain the code\n to build the row of buttons.\nCreate a widget to make buttons\nAs the code for each column could use the same syntax,\n create a widget named ButtonWithText .\n The widget's constructor accepts a color, icon data, and a label for the button.\n Usin"}
433{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": " widget's constructor accepts a color, icon data, and a label for the button.\n Using these values, the widget builds a Column with an Icon and a stylized Text widget as its children.\n To help separate these children, a Padding widget the Text widget\n is wrapped with a Padding widget.\nAdd the following code after the ButtonSection class.\nPosition the buttons with a Row widget\nAdd the following code into the ButtonSection widget.\nAdd three instanc"}
434{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "he buttons with a Row widget\nAdd the following code into the ButtonSection widget.\nAdd three instances of the ButtonWithText widget, once for each button.\nPass the color, Icon , and text for that specific button.\nAlign the columns along the main axis with the MainAxisAlignment.spaceEvenly value.\n The main axis for a Row widget is horizontal and the main axis for a Column widget is vertical.\n This value, then, tells Flutter to arrange the free space in equal "}
435{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "is vertical.\n This value, then, tells Flutter to arrange the free space in equal amounts\n before, between, and after each column along the Row .\nUpdate the app to display the button section\nAdd the button section to the children list.\nAdd the Text section\nIn this section, add the text description to this app.\nThe text block as sketch and prototype UI\nAdd the TextSection widget\nAdd the following code as a separate widget after the ButtonSection widget.\nBy set"}
436{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "extSection widget\nAdd the following code as a separate widget after the ButtonSection widget.\nBy setting softWrap to true , text lines fill the column width before\n wrapping at a word boundary.\nUpdate the app to display the text section\nAdd a new TextSection widget as a child after the ButtonSection .\n When adding the TextSection widget, set its description property to\n the text of the location description.\nAdd the Image section\nIn this section,"}
437{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "ty to\n the text of the location description.\nAdd the Image section\nIn this section, add the image file to complete your layout.\nConfigure your app to use supplied images\nTo configure your app to reference images, modify its pubspec.yaml file.\nCreate an images directory at the top of the project.\nCreate an images directory at the top of the project.\nDownload the lake.jpg image and add it to the new images directory.\nDownload the lake.jpg image and add it to the new images directo"}
438{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "add it to the new images directory.\nDownload the lake.jpg image and add it to the new images directory.\nTo include images, add an assets tag to the pubspec.yaml file\n at the root directory of your app.\n When you add assets , it serves as the set of pointers to the images\n available to your code. pubspec.yaml yaml flutter : uses-material-design : true assets : - images/lake.jpg content_copy\nTo include images, add an assets tag to the "}
439{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "l-design : true assets : - images/lake.jpg content_copy\nTo include images, add an assets tag to the pubspec.yaml file\n at the root directory of your app.\n When you add assets , it serves as the set of pointers to the images\n available to your code.\nCreate the ImageSection widget\nDefine the following ImageSection widget after the other declarations.\nThe BoxFit.cover value tells Flutter to display the image with\n two c"}
440{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "declarations.\nThe BoxFit.cover value tells Flutter to display the image with\n two constraints. First, display the image as small as possible.\n Second, cover all the space that the layout allotted, called the render box.\nUpdate the app to display the image section\nAdd an ImageSection widget as the first child in the children list.\n Set the image property to the path of the image you added in Configure your app to use supplied images .\nCongratulat"}
441{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "operty to the path of the image you added in Configure your app to use supplied images .\nCongratulations\nThat's it! When you hot reload the app, your app should look like this.\nThe finished app\nResources\nYou can access the resources used in this tutorial from these locations:\nDart code: main.dart Image: ch-photo Pubspec: pubspec.yaml\nNext Steps\nTo add interactivity to this layout, follow the interactivity tutorial .\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0."}
442{"url": "https://docs.flutter.dev/ui/layout/tutorial", "title": "Untitled", "text": "activity tutorial .\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
443{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nOverview\nThe core of Flutter's layout mechanism is widgets.\n In Flutter, almost everything is a widget—even\n layout models are widgets. The images, icons,\n and text that you see in a Flutter app are all widgets.\n But things you don't see are also widgets,\n such as the rows, columns, and grids that arrange,\n constrain, and"}
444{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " such as the rows, columns, and grids that arrange,\n constrain, and align the visible widgets.\n You create a layout by composing widgets to build more\n complex widgets.\nConceptual example\nIn the following example, the first screenshot displays\n three icons with labels and the second screenshot includes\n the visual layout for rows and columns. In the second\n screenshot, debugPaint"}
445{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " the visual layout for rows and columns. In the second\n screenshot, debugPaintSizeEnabled is set to true so you\n can see the visual layout.\nHere's a diagram of the widget tree for the previous\n example:\nMost of this should look as you might expect, but you might be wondering\n about the containers (shown in pink). Container is a widget class\n that allows you to customize its child widget. Use a Container whe"}
446{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " a widget class\n that allows you to customize its child widget. Use a Container when\n you want to add padding, margins, borders, or background color,\n to name some of its capabilities.\nEach Text widget is placed in a Container to add margins. The entire Row is also placed in a Container to add padding around the row.\nThe rest of the UI is controlled by properties.\n Set an Icon 's color using its color property.\n "}
447{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "ed by properties.\n Set an Icon 's color using its color property.\n Use the Text.style property to set the font, its color, weight, and so on.\n Columns and rows have properties that allow you to specify how their\n children are aligned vertically or horizontally, and how much space\n the children should occupy.\nLay out a widget\nHow do you lay out a single widget in Flutter? This section\n shows you "}
448{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "ut a widget\nHow do you lay out a single widget in Flutter? This section\n shows you how to create and display a simple widget.\n It also shows the entire code for a simple Hello World app.\nIn Flutter, it takes only a few steps to put text, an icon,\n or an image on the screen.\n1. Select a layout widget\nChoose from a variety of layout widgets based\n on how you want to align or constrain a visible widget,\n as these c"}
449{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " on how you want to align or constrain a visible widget,\n as these characteristics are typically passed on to the\n contained widget.\nFor example, you could use the Center layout widget to center a visible widget\n horizontally and vertically:\n2. Create a visible widget\nChoose a visible widget for your app to contain\n visible elements, such as text , images , or icons .\nFor example, you could use the Text widget dis"}
450{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " visible elements, such as text , images , or icons .\nFor example, you could use the Text widget display\n some text:\n3. Add the visible widget to the layout widget\nAll layout widgets have either of the following:\nA child property if they take a single child—for example, Center or Container\nA children property if they take a list of widgets—for example, Row , Column , ListView , or Stack .\nAdd the Text widget to the Center widget:\n4. Add the layout widget to the page\nA Flutter ap"}
451{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " Stack .\nAdd the Text widget to the Center widget:\n4. Add the layout widget to the page\nA Flutter app is itself a widget, and most widgets have a build() method. Instantiating and returning a widget in the app's build() method\n displays the widget.\nStandard apps\nMaterial apps\nCupertino apps\nFor a general app, you can add the Container widget to\n the app's build() method:\nBy default, a general app doesn't include an AppBar ,\n title, o"}
452{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "ild() method:\nBy default, a general app doesn't include an AppBar ,\n title, or background color. If you want these features in a\n general app, you have to build them yourself. This app\n changes the background color to white and the text to\n dark grey to mimic a Material app.\nFor a Material app, you can use a Scaffold widget;\n it provides a default banner, background color,\n "}
453{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "a Scaffold widget;\n it provides a default banner, background color,\n and has API for adding drawers, snack bars, and bottom sheets.\n Then you can add the Center widget directly to the body property for the home page.\nTo create a Cupertino app,\n use the CupertinoApp and CupertinoPageScaffold widgets.\nUnlike Material , it doesn't provide a default banner or background color.\n You need"}
454{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "Material , it doesn't provide a default banner or background color.\n You need to set these yourself.\nTo set default colors, pass in a configured CupertinoThemeData to your app's theme property.\nTo set default colors, pass in a configured CupertinoThemeData to your app's theme property.\nTo add an iOS-styled navigation bar to the top of your app, add a CupertinoNavigationBar widget to the navigationBar property of your scaffold.\n You can use the co"}
455{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "idget to the navigationBar property of your scaffold.\n You can use the colors that CupertinoColors provides to\n configure your widgets to match iOS design.\nTo add an iOS-styled navigation bar to the top of your app, add a CupertinoNavigationBar widget to the navigationBar property of your scaffold.\n You can use the colors that CupertinoColors provides to\n configure your widgets to match iO"}
456{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "lors that CupertinoColors provides to\n configure your widgets to match iOS design.\nTo lay out the body of your app, set the child property of your scaffold\n with the desired widget as its value, like Center or Column .\nTo lay out the body of your app, set the child property of your scaffold\n with the desired widget as its value, like Center or Column .\nTo learn what other UI components you can add, check out the Cup"}
457{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " its value, like Center or Column .\nTo learn what other UI components you can add, check out the Cupertino library .\n5. Run your app\nAfter you've added your widgets, run your app. When you run\nthe app, you should see Hello World .\nApp source code:\nMaterial app\nNon-Material app\nLay out multiple widgets vertically and horizontally\nOne of the most common layout patterns is to arrange\n widgets vertically or horizontally. You can use a Row widget to arrange widgets horizontally,\n "}
458{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " widgets vertically or horizontally. You can use a Row widget to arrange widgets horizontally,\n and a Column widget to arrange widgets vertically.\nTo create a row or column in Flutter, you add a list of children\n widgets to a Row or Column widget. In turn,\n each child can itself be a row or column, and so on.\n The following example shows how it is possible to nest rows or\n columns inside of rows or columns.\nThi"}
459{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "le shows how it is possible to nest rows or\n columns inside of rows or columns.\nThis layout is organized as a Row . The row contains two children:\n a column on the left, and an image on the right:\nThe left column's widget tree nests rows and columns.\nYou'll implement some of Pavlova's layout code in Nesting rows and columns .\nAligning widgets\nYou control how a row or column aligns its children using the mainAxisAlignment and crossAxisAlignment properties.\n "}
460{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " or column aligns its children using the mainAxisAlignment and crossAxisAlignment properties.\n For a row, the main axis runs horizontally and the cross axis runs\n vertically. For a column, the main axis runs vertically and the cross\n axis runs horizontally.\nThe MainAxisAlignment and CrossAxisAlignment enums offer a variety of constants for controlling alignment.\nIn the following example, each of the 3 images is 100 pixels wide.\n "}
461{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "ling alignment.\nIn the following example, each of the 3 images is 100 pixels wide.\n The render box (in this case, the entire screen)\n is more than 300 pixels wide, so setting the main axis\n alignment to spaceEvenly divides the free horizontal\n space evenly between, before, and after each image.\nApp source: row_column\nColumns work the same way as rows. The following example shows a column\n of 3 images, each is 10"}
462{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "the same way as rows. The following example shows a column\n of 3 images, each is 100 pixels high. The height of the render box\n (in this case, the entire screen) is more than 300 pixels, so\n setting the main axis alignment to spaceEvenly divides the free vertical\n space evenly between, above, and below each image.\nApp source: row_column\nSizing widgets\nWhen a layout is too large to fit a device, a yellow\n and bla"}
463{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "column\nSizing widgets\nWhen a layout is too large to fit a device, a yellow\n and black striped pattern appears along the affected edge.\n Here is an example of a row that is too wide:\nWidgets can be sized to fit within a row or column by using the Expanded widget. To fix the previous example where the\n row of images is too wide for its render box,\n wrap each image with an Expanded widget.\nApp source: sizing\nPerhaps you want a widg"}
464{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " wrap each image with an Expanded widget.\nApp source: sizing\nPerhaps you want a widget to occupy twice as much space as its\n siblings. For this, use the Expanded widget flex property,\n an integer that determines the flex factor for a widget.\n The default flex factor is 1. The following code sets\n the flex factor of the middle image to 2:\nApp source: sizing\nPacking widgets\nBy default, a row or column occupies as m"}
465{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " the middle image to 2:\nApp source: sizing\nPacking widgets\nBy default, a row or column occupies as much space along its main axis\n as possible, but if you want to pack the children closely together,\n set its mainAxisSize to MainAxisSize.min . The following example\n uses this property to pack the star icons together.\nApp source: pavlova\nNesting rows and columns\nThe layout framework allows you to nest rows and columns\n inside of r"}
466{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "s and columns\nThe layout framework allows you to nest rows and columns\n inside of rows and columns as deeply as you need.\n Let's look at the code for the outlined\n section of the following layout:\nThe outlined section is implemented as two rows. The ratings row contains\n five stars and the number of reviews. The icons row contains three\n columns of icons and text.\nThe widget tree for the ratings row:\nThe ratings"}
467{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " three\n columns of icons and text.\nThe widget tree for the ratings row:\nThe ratings variable creates a row containing a smaller row\n of 5-star icons, and text:\nThe icons row, below the ratings row, contains 3 columns;\n each column contains an icon and two lines of text,\n as you can see in its widget tree:\nThe iconList variable defines the icons row:\nThe leftColumn variable contains the ratings and icons rows,\n a"}
468{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "ines the icons row:\nThe leftColumn variable contains the ratings and icons rows,\n as well as the title and text that describes the Pavlova:\nThe left column is placed in a SizedBox to constrain its width.\n Finally, the UI is constructed with the entire row (containing the\n left column and the image) inside a Card .\nThe Pavlova image is from Pixabay .\n You can embed an image from the net using Image.network() but,\n "}
469{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " .\n You can embed an image from the net using Image.network() but,\n for this example, the image is saved to an images directory in the project,\n added to the pubspec file , and accessed using Images.asset() .\n For more information, see Adding assets and images .\nApp source: pavlova\nCommon layout widgets\nFlutter has a rich library of layout widgets.\n Here are a few of those most commonly used.\n T"}
470{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "of layout widgets.\n Here are a few of those most commonly used.\n The intent is to get you up and running as quickly as possible,\n rather than overwhelm you with a complete list.\n For information on other available widgets,\n refer to the Widget catalog ,\n or use the Search box in the API reference docs .\n Also, the widget pages in the API docs often make suggestions\n "}
471{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "docs .\n Also, the widget pages in the API docs often make suggestions\n about similar widgets that might better suit your needs.\nThe following widgets fall into two categories: standard widgets\n from the widgets library , and specialized widgets from the Material library . Any app can use the widgets library but\n only Material apps can use the Material Components library.\nStandard widgets\nMaterial widgets\nCupertino widgets\nAdds p"}
472{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " can use the Material Components library.\nStandard widgets\nMaterial widgets\nCupertino widgets\nAdds padding, margins, borders,\n background color, or other decorations to a widget.\nLays widgets out as a scrollable grid.\nLays widgets out as a scrollable list.\nOverlaps a widget on top of another.\nProvides a structured layout framework\n with slots for common Material Design app elements.\nCreates a horizontal bar that's typically\n "}
473{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "or common Material Design app elements.\nCreates a horizontal bar that's typically\n displayed at the top of a screen.\nOrganizes related info into a box with\n rounded corners and a drop shadow.\nOrganizes up to 3 lines of text,\n and optional leading and trailing icons, into a row.\nProvides the basic layout structure for an iOS-style page.\nCreates an iOS-style navigation bar at the top of the screen.\nCreates a segmente"}
474{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "an iOS-style page.\nCreates an iOS-style navigation bar at the top of the screen.\nCreates a segmented control for selecting.\nCreates the characteristic iOS bottom tab bar.\nContainer\nMany layouts make liberal use of Container s to separate\n widgets using padding, or to add borders or margins.\n You can change the device's background by placing the\n entire layout into a Container and changing its background\n color or image.\nSummary"}
475{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "entire layout into a Container and changing its background\n color or image.\nSummary (Container)\nAdd padding, margins, borders\nChange background color or image\nContains a single child widget, but that child can be a Row , Column , or even the root of a widget tree\nExamples (Container)\nThis layout consists of a column with two rows, each containing\n 2 images. A Container is used to change the background color\n of the column to a lighter grey.\nA Co"}
476{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "ainer is used to change the background color\n of the column to a lighter grey.\nA Container is also used to add a rounded border and margins\n to each image:\nYou can find more Container examples in the tutorial .\nApp source: container\nGridView\nUse GridView to lay widgets out as a two-dimensional\n list. GridView provides two pre-fabricated lists,\n or you can build your own custom grid. When a GridView detects that its contents are "}
477{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " or you can build your own custom grid. When a GridView detects that its contents are too long to fit the render box,\n it automatically scrolls.\nSummary (GridView)\nLays widgets out in a grid\nDetects when the column content exceeds the render box\n and automatically provides scrolling\nBuild your own custom grid, or use one of the provided grids: GridView.count allows you to specify the number of columns GridView.extent allows you to specify the max"}
478{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "View.count allows you to specify the number of columns GridView.extent allows you to specify the maximum pixel\n width of a tile\nGridView.count allows you to specify the number of columns\nGridView.extent allows you to specify the maximum pixel\n width of a tile\nExamples (GridView)\nUses GridView.extent to create a grid with tiles a maximum\n 150 pixels wide.\nApp source: grid_and_list\nUses GridView.count to create a grid that's 2 tiles\n wide in portrait"}
479{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "de.\nApp source: grid_and_list\nUses GridView.count to create a grid that's 2 tiles\n wide in portrait mode, and 3 tiles wide in landscape mode.\n The titles are created by setting the footer property for\n each GridTile .\nDart code: grid_list_demo.dart\nListView\nListView , a column-like widget, automatically\n provides scrolling when its content is too long for\n its render box.\nSummary (ListView)\nA specialized Column for organizing a list of boxes\nCan be laid out h"}
480{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "render box.\nSummary (ListView)\nA specialized Column for organizing a list of boxes\nCan be laid out horizontally or vertically\nDetects when its content won't fit and provides scrolling\nLess configurable than Column , but easier to use and\n supports scrolling\nExamples (ListView)\nUses ListView to display a list of businesses using ListTile s. A Divider separates the theaters from\n the restaurants.\nApp source: grid_and_list\nUses ListView to display the Colors from\n the Material "}
481{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " the restaurants.\nApp source: grid_and_list\nUses ListView to display the Colors from\n the Material 2 Design palette for a particular color family.\nDart code: colors_demo.dart\nStack\nUse Stack to arrange widgets on top of a base\n widget—often an image. The widgets can completely\n or partially overlap the base widget.\nSummary (Stack)\nUse for widgets that overlap another widget\nThe first widget in the list of children is the base widget;\n subsequ"}
482{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "ther widget\nThe first widget in the list of children is the base widget;\n subsequent children are overlaid on top of that base widget\nA Stack 's content can't scroll\nYou can choose to clip children that exceed the render box\nExamples (Stack)\nUses Stack to overlay a Container (that displays its Text on a translucent\n black background) on top of a CircleAvatar .\n The Stack offsets the text using the alignment property and Alignment s.\nApp source: card_and_stack\nUses Stack to o"}
483{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "ts the text using the alignment property and Alignment s.\nApp source: card_and_stack\nUses Stack to overlay an icon on top of an image.\nDart code: bottom_navigation_demo.dart\nCard\nA Card , from the Material library ,\n contains related nuggets of information and can\n be composed of almost any widget, but is often used with ListTile . Card has a single child,\n but its child can be a column, row, list, grid,\n or other widget that su"}
484{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " but its child can be a column, row, list, grid,\n or other widget that supports multiple children.\n By default, a Card shrinks its size to 0 by 0 pixels.\n You can use SizedBox to constrain the size of a card.\nIn Flutter, a Card features slightly rounded corners\n and a drop shadow, giving it a 3D effect.\n Changing a Card 's elevation property allows you to control\n the drop shadow effec"}
485{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " Changing a Card 's elevation property allows you to control\n the drop shadow effect. Setting the elevation to 24,\n for example, visually lifts the Card further from the\n surface and causes the shadow to become more dispersed.\n For a list of supported elevation values, see Elevation in the Material guidelines .\n Specifying an unsupported value disables the drop shadow entirely.\nSummary (Card)\nImplements a Materi"}
486{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "pecifying an unsupported value disables the drop shadow entirely.\nSummary (Card)\nImplements a Material card\nUsed for presenting related nuggets of information\nAccepts a single child, but that child can be a Row , Column , or other widget that holds a list of children\nDisplayed with rounded corners and a drop shadow\nA Card 's content can't scroll\nFrom the Material library\nExamples (Card)\nA Card containing 3 ListTiles and sized by wrapping\n it with a SizedBox . A Divider separates the first\n and"}
487{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "taining 3 ListTiles and sized by wrapping\n it with a SizedBox . A Divider separates the first\n and second ListTiles .\nApp source: card_and_stack\nA Card containing an image and text.\nDart code: cards_demo.dart\nListTile\nUse ListTile , a specialized row widget from the Material library , for an easy way to create a row\n containing up to 3 lines of text and optional leading\n and trailing icons. ListTile is most commonly used in Card or ListView , but can be used e"}
488{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " and trailing icons. ListTile is most commonly used in Card or ListView , but can be used elsewhere.\nSummary (ListTile)\nA specialized row that contains up to 3 lines of text and\n optional icons\nLess configurable than Row , but easier to use\nFrom the Material library\nExamples (ListTile)\nA Card containing 3 ListTile s.\nApp source: card_and_stack\nUses ListTile with leading widgets.\nDart code: list_demo.dart\nConstraints\nTo fully understand Flutter's layout system, you nee"}
489{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": " widgets.\nDart code: list_demo.dart\nConstraints\nTo fully understand Flutter's layout system, you need\n to learn how Flutter positions and sizes\n the components in a layout. For more information,\n see Understanding constraints .\nVideos\nThe following videos, part of the Flutter in Focus series,\n explain Stateless and Stateful widgets.\nWatch on YouTube in a new tab: \"How to create stateless widgets\"\nWatch on YouTube in a new tab: \""}
490{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "s.\nWatch on YouTube in a new tab: \"How to create stateless widgets\"\nWatch on YouTube in a new tab: \"How and when stateful widgets are best used\"\nFlutter in Focus playlist\nEach episode of the Widget of the Week series focuses on a widget.\n Several of them include layout widgets.\nWatch on YouTube in a new tab: \"Introducing widget of the week\"\nFlutter Widget of the Week playlist\nOther resources\nThe following resources might help when writing layout code.\nLearn how to build a layout"}
491{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "r resources\nThe following resources might help when writing layout code.\nLearn how to build a layout.\nDescribes many of the widgets available in Flutter.\nFor those familiar with web programming,\n this page maps HTML/CSS functionality to Flutter features.\nReference documentation for all of the Flutter libraries.\nExplains how to add images and other assets to your app's package.\nOne person's experience writing their first Flutter app.\nUnless stated otherwise, the documentation"}
492{"url": "https://docs.flutter.dev/ui/layout", "title": "Untitled", "text": "\nOne person's experience writing their first Flutter app.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
493{"url": "https://docs.flutter.dev/ui/navigation/url-strategies", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nFlutter web apps support two ways of configuring\n URL-based navigation on the web:\nPaths are read and written to the hash fragment .\nFor example, flutterexample.dev/#/path/to/screen .\nPaths are read and written without a hash. For example,\nflutterexample.dev/path/to/screen .\nConfiguring the URL strategy\nTo configure Flutter to use the path instead, use the usePathUrlStrategy function provided by the flutt"}
494{"url": "https://docs.flutter.dev/ui/navigation/url-strategies", "title": "Untitled", "text": "configure Flutter to use the path instead, use the usePathUrlStrategy function provided by the flutter_web_plugins library,\n which is part of the Flutter SDK.\nYou can't directly add flutter_web_plugins using pub add .\n Include it as a Flutter SDK dependency in your pubspec.yaml file:\nThen call the usePathUrlStrategy function before runApp :\nConfiguring your web server\nPathUrlStrategy uses the History API , which requires additional\n configuratio"}
495{"url": "https://docs.flutter.dev/ui/navigation/url-strategies", "title": "Untitled", "text": "rver\nPathUrlStrategy uses the History API , which requires additional\n configuration for web servers.\nTo configure your web server to support PathUrlStrategy, check your web server's\n documentation to rewrite requests to index.html . Check your web server's\n documentation for details on how to configure single-page apps.\nIf you are using Firebase Hosting, choose the \"Configure as a single-page app\"\n option when initializing your"}
496{"url": "https://docs.flutter.dev/ui/navigation/url-strategies", "title": "Untitled", "text": "Hosting, choose the \"Configure as a single-page app\"\n option when initializing your project. For more information see Firebase's Configure rewrites documentation.\nThe local dev server created by running flutter run -d chrome is configured to\n handle any path gracefully and fallback to your app's index.html file.\nHosting a Flutter app at a non-root location\nUpdate the <base href=\"/\"> tag in web/index.html to the path where your app is hosted.\n Fo"}
497{"url": "https://docs.flutter.dev/ui/navigation/url-strategies", "title": "Untitled", "text": "the <base href=\"/\"> tag in web/index.html to the path where your app is hosted.\n For example, to host your Flutter app at my_app.dev/flutter_app , change\n this tag to <base href=\"/flutter_app/\"> .\nRelative base href tags are supported for release builds but they must take\n into account the full URL where the page was served from.\n This means a relative base href for a request to /flutter_app/ , /flutter_app/nested/route , and /f"}
498{"url": "https://docs.flutter.dev/ui/navigation/url-strategies", "title": "Untitled", "text": " This means a relative base href for a request to /flutter_app/ , /flutter_app/nested/route , and /flutter_app/nested/route/ will be different\n (for example \".\" , \"..\" , and \"../..\" respectively).\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
499{"url": "https://docs.flutter.dev/ui/navigation/deep-linking", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nDeep links are links that not only open an app, but also take the\n user to a specific location \"deep\" inside the app. For example,\n a deep link from an advertisement for a pair of sneakers might open\n a shopping app and display the product page for those particular shoes.\nFlutter supports deep linking on iOS, Android, and the web.\n Opening a URL displays "}
500{"url": "https://docs.flutter.dev/ui/navigation/deep-linking", "title": "Untitled", "text": "lutter supports deep linking on iOS, Android, and the web.\n Opening a URL displays that screen in your app.\n With the following steps,\n you can launch and display routes by using named routes\n (either with the routes parameter or onGenerateRoute ), or by\n using the Router widget.\nIf you're running the app in a web browser, there's no additional setup\n required. Route paths are handled in the sam"}
501{"url": "https://docs.flutter.dev/ui/navigation/deep-linking", "title": "Untitled", "text": " browser, there's no additional setup\n required. Route paths are handled in the same way as an iOS or Android deep\n link. By default, web apps read the deep link path from the url fragment using\n the pattern: /#/path/to/app/screen , but this can be changed by configuring the URL strategy for your app.\nIf you are a visual learner, check out the following video:\nWatch on YouTube in a new tab: \"Deep linking in Flutter\"\nGet started\nTo get started, s"}
502{"url": "https://docs.flutter.dev/ui/navigation/deep-linking", "title": "Untitled", "text": "lowing video:\nWatch on YouTube in a new tab: \"Deep linking in Flutter\"\nGet started\nTo get started, see our cookbooks for Android and iOS:\nMigrating from plugin-based deep linking\nIf you have written a plugin to handle deep links, as described in Deep Links and Flutter applications (a free article on Medium),\n you should opt out the Flutter's default deep link handler.\n To do this, set FlutterDeepLinkingEnabled to false in Info.plist or flutter_deeplinking_enable"}
503{"url": "https://docs.flutter.dev/ui/navigation/deep-linking", "title": "Untitled", "text": " To do this, set FlutterDeepLinkingEnabled to false in Info.plist or flutter_deeplinking_enabled to false in AndroidManifest.xml .\nBehavior\nThe behavior varies slightly based on the platform and whether the app is\n launched and running.\nWhen using the Router widget,\n your app has the ability to replace the\n current set of pages when a new deep link\n is opened while the app is running.\nTo learn more\nLearning Flutter's new na"}
504{"url": "https://docs.flutter.dev/ui/navigation/deep-linking", "title": "Untitled", "text": "p link\n is opened while the app is running.\nTo learn more\nLearning Flutter's new navigation and routing system provides an\n introduction to the Router system.\nDeep dive into Flutter deep linking video from Google I/O 2023\nFlutter Deep Linking: The Ultimate Guide ,\n a step-by-step tutorial showing how to implement deep links in Flutter.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026"}
505{"url": "https://docs.flutter.dev/ui/navigation/deep-linking", "title": "Untitled", "text": " stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
506{"url": "https://docs.flutter.dev/ui/navigation", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nFlutter provides a complete system for navigating between screens and handling\n deep links. Small applications without complex deep linking can use Navigator , while apps with specific deep linking and navigation\n requirements should also use the Router to correctly handle deep links on\n Android and iOS, and to stay in sync with the address bar when the app is\n "}
507{"url": "https://docs.flutter.dev/ui/navigation", "title": "Untitled", "text": " Android and iOS, and to stay in sync with the address bar when the app is\n running on the web.\nTo configure your Android or iOS application to handle deep links, see Deep linking .\nUsing the Navigator\nThe Navigator widget displays screens as a stack using the correct transition\n animations for the target platform. To navigate to a new screen, access the Navigator through the route's BuildContext and call imperative methods such\n a"}
508{"url": "https://docs.flutter.dev/ui/navigation", "title": "Untitled", "text": " the Navigator through the route's BuildContext and call imperative methods such\n as push() or pop() :\nBecause Navigator keeps a stack of Route objects (representing the history\n stack), The push() method also takes a Route object. The MaterialPageRoute object is a subclass of Route that specifies the transition animations for\n Material Design. For more examples of how to use the Navigator , follow the navigation recipes from the Flutter Cookboo"}
509{"url": "https://docs.flutter.dev/ui/navigation", "title": "Untitled", "text": "r more examples of how to use the Navigator , follow the navigation recipes from the Flutter Cookbook or\n visit the Navigator API documentation .\nUsing named routes\nApplications with simple navigation and deep linking requirements can use the Navigator for navigation and the MaterialApp.routes parameter for deep\n links:\n/second represents a named route that was declared in the MaterialApp.routes list. For a complete example, follow the Navigate with named routes"}
510{"url": "https://docs.flutter.dev/ui/navigation", "title": "Untitled", "text": "clared in the MaterialApp.routes list. For a complete example, follow the Navigate with named routes recipe from the Flutter Cookbook.\nLimitations\nAlthough named routes can handle deep links, the behavior is always the same and\n can't be customized. When a new deep link is received by the platform, Flutter\n pushes a new Route onto the Navigator regardless of where the user currently is.\nFlutter also doesn't support the browser forward button for applications usi"}
511{"url": "https://docs.flutter.dev/ui/navigation", "title": "Untitled", "text": " the user currently is.\nFlutter also doesn't support the browser forward button for applications using\n named routes. For these reasons, we don't recommend using named routes in most\n applications. Instead, use a routing package like go_router or\n use Navigator with MaterialPageRoute .\nUsing the Router\nFlutter applications with advanced navigation and routing requirements (such as\n a web app that uses direct links to each screen"}
512{"url": "https://docs.flutter.dev/ui/navigation", "title": "Untitled", "text": " and routing requirements (such as\n a web app that uses direct links to each screen, or an app with multiple Navigator widgets) should use a routing package such as go_router that can\n parse the route path and configure the Navigator whenever the app receives a\n new deep link.\nTo use the Router, switch to the router constructor on MaterialApp or CupertinoApp and provide it with a Router configuration. Routing packages,\n such as "}
513{"url": "https://docs.flutter.dev/ui/navigation", "title": "Untitled", "text": "upertinoApp and provide it with a Router configuration. Routing packages,\n such as go_router , typically provide route configuration and routes\n can be used as follows:\nBecause packages like go_router are declarative , they will always display the\n same screen(s) when a deep link is received.\nUsing Router and Navigator together\nThe Router and Navigator are designed to work together. You can navigate\n using the Router API through"}
514{"url": "https://docs.flutter.dev/ui/navigation", "title": "Untitled", "text": "gator are designed to work together. You can navigate\n using the Router API through a declarative routing package, such as go_router , or by calling imperative methods such as push() and pop() on\n the Navigator .\nWhen you navigate using the Router or a declarative routing package, each\n route on the Navigator is page-backed , meaning it was created from a Page using the pages argument on the Navigator constructor. Conversely, any Route created b"}
515{"url": "https://docs.flutter.dev/ui/navigation", "title": "Untitled", "text": "d from a Page using the pages argument on the Navigator constructor. Conversely, any Route created by calling Navigator.push or showDialog will add a pageless route to the Navigator. If you are using a routing package, Routes that are page-backed are always deep-linkable, whereas pageless routes\n are not.\nWhen a page-backed Route is removed from the Navigator , all of the pageless routes after it are also removed. For example, if a deep link\n navigates by removi"}
516{"url": "https://docs.flutter.dev/ui/navigation", "title": "Untitled", "text": " routes after it are also removed. For example, if a deep link\n navigates by removing a page-backed route from the Navigator, all pageless routes after (up until the next page-backed route) are removed too.\nWeb support\nApps using the Router class integrate with the browser History API to provide\n a consistent experience when using the browser's back and forward buttons.\n Whenever you navigate using the Router , a History API entry is added to th"}
517{"url": "https://docs.flutter.dev/ui/navigation", "title": "Untitled", "text": "ttons.\n Whenever you navigate using the Router , a History API entry is added to the\n browser's history stack. Pressing the back button uses reverse\n chronological navigation , meaning that the user is taken to the previously\n visited location that was shown using the Router . This means that if the user\n pops a page from the Navigator and then presses the browser back button\n the previous p"}
518{"url": "https://docs.flutter.dev/ui/navigation", "title": "Untitled", "text": " a page from the Navigator and then presses the browser back button\n the previous page is pushed back onto the stack.\nMore information\nFor more information on navigation and routing, check out the following\n resources:\nThe Flutter cookbook includes multiple navigation recipes that show how to\n use the Navigator .\nThe Navigator and Router API documentation contain details on how\n to set up declarative navigation without a rou"}
519{"url": "https://docs.flutter.dev/ui/navigation", "title": "Untitled", "text": "umentation contain details on how\n to set up declarative navigation without a routing package.\nUnderstanding navigation , a page from the Material Design documentation,\n outlines concepts for designing the navigation in your app, including\n explanations for forward, upward, and chronological navigation.\nLearning Flutter's new navigation and routing system , an article on\n Medium, describes how to use the Router widget di"}
520{"url": "https://docs.flutter.dev/ui/navigation", "title": "Untitled", "text": "routing system , an article on\n Medium, describes how to use the Router widget directly, without\n a routing package.\nThe Router design document contains the motivation and design of the Router API.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
521{"url": "https://docs.flutter.dev/ui/dot-shorthands", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nThe dot shorthands feature allows you to omit the explicit type when\n accessing static members, constructors, or enum values, provided the compiler\n can infer the type from the surrounding context.\nWhy dot shorthands matter\nBuilding layouts in Flutter often involves deeply nested widget trees.\n Historically, this meant repeatedly typing explicit class and enum names for\n "}
522{"url": "https://docs.flutter.dev/ui/dot-shorthands", "title": "Untitled", "text": "es.\n Historically, this meant repeatedly typing explicit class and enum names for\n properties like colors, typography, and alignment. Dot shorthands reduces this\n boilerplate, making your code easier to read and faster to write.\nHere is a side-by-side comparison of building a simple Container :\nWithout dot shorthands\nWith dot shorthands\nWhere to use dot shorthands\nDot shorthands work anywhere the Dart compiler has a clear \"context type\",\n "}
523{"url": "https://docs.flutter.dev/ui/dot-shorthands", "title": "Untitled", "text": "se dot shorthands\nDot shorthands work anywhere the Dart compiler has a clear \"context type\",\n meaning it knows exactly what type it expects. In Flutter, this is almost\n everywhere inside a widget's property list.\nThe most common targets for dot shorthands in Flutter are:\nEnums : MainAxisAlignment , CrossAxisAlignment , BoxFit , TextDirection .\nStatic properties and methods : FontWeight (constants like .bold ).\nConstructors : EdgeInsets.all() , BorderRadius.circu"}
524{"url": "https://docs.flutter.dev/ui/dot-shorthands", "title": "Untitled", "text": "d methods : FontWeight (constants like .bold ).\nConstructors : EdgeInsets.all() , BorderRadius.circular() .\nExample: enums\nWhen a property expects an enum , such as mainAxisAlignment , you can omit the\n enum's name and just provide the value preceded by a dot ( . ):\nExample: static properties\nStatic properties work when the context type is exactly the class that defines the property. A common example is text styling with FontWeight :\nExample: constructors\nYou can also use dot sh"}
525{"url": "https://docs.flutter.dev/ui/dot-shorthands", "title": "Untitled", "text": "ty. A common example is text styling with FontWeight :\nExample: constructors\nYou can also use dot shorthands for named constructors. Many Flutter layout properties accept a base class like EdgeInsetsGeometry . To support dot shorthands, Flutter adds redirecting constructors to these base classes that point to the appropriate subclasses.\nYou can even use .new to call an unnamed constructor, though this is less\n common in standard widget trees:\nUnless stated otherwise, the documen"}
526{"url": "https://docs.flutter.dev/ui/dot-shorthands", "title": "Untitled", "text": "this is less\n common in standard widget trees:\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-06-18. View source or report an issue ."}
527{"url": "https://docs.flutter.dev/ui/assets/asset-transformation", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nYou can configure your project to automatically transform assets\n at build time using compatible Dart packages.\nSpecifying asset transformations\nIn the pubspec.yaml file, list the assets to be transformed and the associated\n transformer package.\nWith this configuration, assets/logo.svg is transformed by the vector_graphics_compiler package as it is copied to the build output. This\n "}
528{"url": "https://docs.flutter.dev/ui/assets/asset-transformation", "title": "Untitled", "text": "ransformed by the vector_graphics_compiler package as it is copied to the build output. This\n package precompiles SVG files into an optimized binary files that can be\n displayed using the vector_graphics package, like so:\nPassing arguments to asset transformers\nTo pass a string of arguments to an asset transformer,\n also specify that in the pubspec:\nChaining asset transformers\nAsset transformers can be chained and are applied in\n "}
529{"url": "https://docs.flutter.dev/ui/assets/asset-transformation", "title": "Untitled", "text": "c:\nChaining asset transformers\nAsset transformers can be chained and are applied in\n the order they are declared.\n Consider the following example using imaginary packages:\nHere, bird.png is transformed by the grayscale_filter package.\n The output is then transformed by the png_optimizer package before being\n bundled into the built app.\nWriting asset transformer packages\nAn asset transformer is a Dart command-line app that is inv"}
530{"url": "https://docs.flutter.dev/ui/assets/asset-transformation", "title": "Untitled", "text": " app.\nWriting asset transformer packages\nAn asset transformer is a Dart command-line app that is invoked with dart run with at least two arguments: --input , which contains the path to\n the file to transform and --output , which is the location where the\n transformer code must write its output to.\nIf the transformer finishes with a non-zero exit code, the application build\n fails with an error message explaining that transformation of the asset "}
531{"url": "https://docs.flutter.dev/ui/assets/asset-transformation", "title": "Untitled", "text": "ion build\n fails with an error message explaining that transformation of the asset failed.\n Anything written to the stderr stream of the process by the transformer is\n included in the error message.\nDuring the invocation of the transformer, the FLUTTER_BUILD_MODE environment variable will be set to the CLI name of the build mode being used.\n For example, if you run your app with flutter run -d macos --release , then FLUTTER_BUIL"}
532{"url": "https://docs.flutter.dev/ui/assets/asset-transformation", "title": "Untitled", "text": " For example, if you run your app with flutter run -d macos --release , then FLUTTER_BUILD_MODE will be set to release .\nSample\nFor a sample Flutter project that uses asset transformation and includes a custom\n Dart package that is used as a transformer, check out the asset_transformers project in the Flutter samples repo .\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-11. View source or report an issue ."}
533{"url": "https://docs.flutter.dev/ui/assets/asset-transformation", "title": "Untitled", "text": "this site reflects Flutter 3.44.0. Page last updated on 2026-05-11. View source or report an issue ."}
534{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nFlutter apps can include both code and assets (sometimes called resources). An asset is a file\n that is bundled and deployed with your app,\n and is accessible at runtime. Common types of assets include\n static data (for example, JSON files),\n configuration files, icons, and images\n (JPEG, WebP, GIF, animated WebP/GIF, PNG, BMP, and WBMP)."}
535{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "files, icons, and images\n (JPEG, WebP, GIF, animated WebP/GIF, PNG, BMP, and WBMP).\nSpecifying assets\nFlutter uses the pubspec.yaml file,\n located at the root of your project,\n to identify assets required by an app.\nHere is an example:\nTo include all assets under a directory,\n specify the directory name with the / character at the end:\nAsset bundling\nThe assets subsection of the flutter section\n specifies files "}
536{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": " end:\nAsset bundling\nThe assets subsection of the flutter section\n specifies files that should be included with the app.\n Each asset is identified by an explicit path\n (relative to the pubspec.yaml file) where the asset\n file is located. The order in which the assets are\n declared doesn't matter. The actual directory name used\n ( assets in first example or directory in the above\n "}
537{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "ory name used\n ( assets in first example or directory in the above\n example) doesn't matter.\nDuring a build, Flutter places assets into a special\n archive called the asset bundle that apps read\n from at runtime.\nAutomatic transformation of asset files at build time\nFlutter supports using a Dart package to transform asset files when building your app.\n To do this, specify the asset files and transformer package i"}
538{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "n building your app.\n To do this, specify the asset files and transformer package in your pubspec file.\n To learn how to do this and write your own asset-transforming packages, see Transforming assets at build time .\nLoading assets\nYour app can access its assets through an AssetBundle object.\nThe two main methods on an asset bundle allow you to load a\n string/text asset ( loadString() ) or an image/binary asset ( load() )\n out o"}
539{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": " string/text asset ( loadString() ) or an image/binary asset ( load() )\n out of the bundle, given a logical key. The logical key maps to the path\n to the asset specified in the pubspec.yaml file at build time.\nLoading text assets\nEach Flutter app has a rootBundle object for easy access to the main asset bundle.\n It is possible to load assets directly using the rootBundle global static from package:flutter/services.dart .\nHowever, it's recom"}
540{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "directly using the rootBundle global static from package:flutter/services.dart .\nHowever, it's recommended to obtain the AssetBundle for the current BuildContext using DefaultAssetBundle , rather than the default\n asset bundle that was built with the app; this\n approach enables a parent widget to substitute a\n different AssetBundle at run time,\n which can be useful for localization or testing\n scenarios.\nTypical"}
541{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": " which can be useful for localization or testing\n scenarios.\nTypically, you'll use DefaultAssetBundle.of() to indirectly load an asset, for example a JSON file,\n from the app's runtime rootBundle .\nOutside of a Widget context, or when a handle\n to an AssetBundle is not available,\n you can use rootBundle to directly load such assets.\n For example:\nLoading images\nTo load an image, use the AssetImage"}
542{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "load such assets.\n For example:\nLoading images\nTo load an image, use the AssetImage class in a widget's build() method.\nFor example, your app can load the background\n image from the asset declarations in the previous example:\nResolution-aware image assets\nFlutter can load resolution-appropriate images for\n the current device pixel ratio .\nAssetImage will map a logical requested\n asset onto one that most closely matches the curre"}
543{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "ge will map a logical requested\n asset onto one that most closely matches the current device pixel ratio .\nFor this mapping to work, assets should be arranged\n according to a particular directory structure:\nWhere M and N are numeric identifiers that correspond\n to the nominal resolution of the images contained within.\n In other words, they specify the device pixel ratio that\n the images are intended for.\nIn this"}
544{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "rds, they specify the device pixel ratio that\n the images are intended for.\nIn this example, image.png is considered the main asset ,\n while Mx/image.png and Nx/image.png are considered to be variants .\nThe main asset is assumed to correspond to a resolution of 1.0.\n For example, consider the following asset layout for an\n image named my_icon.png :\nOn devices with a device pixel ratio of 1.8, the asset .../2.0x/my_icon.png is ch"}
545{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "amed my_icon.png :\nOn devices with a device pixel ratio of 1.8, the asset .../2.0x/my_icon.png is chosen.\n For a device pixel ratio of 2.7, the asset .../3.0x/my_icon.png is chosen.\nIf the width and height of the rendered image are not specified\n on the Image widget, the nominal resolution is used to scale\n the asset so that it occupies the same amount of screen space\n as the main asset would have, just with a higher resolution."}
546{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "mount of screen space\n as the main asset would have, just with a higher resolution.\n That is, if .../my_icon.png is 72px by 72px, then .../3.0x/my_icon.png should be 216px by 216px;\n but they both render into 72px by 72px (in logical pixels),\n if width and height are not specified.\nBundling of resolution-aware image assets\nYou only need to specify the main asset or its parent directory\n in the assets section of "}
547{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "y need to specify the main asset or its parent directory\n in the assets section of pubspec.yaml .\n Flutter bundles the variants for you.\n Each entry should correspond to a real file, with the exception of\n the main asset entry. If the main asset entry doesn't correspond\n to a real file, then the asset with the lowest resolution\n is used as the fallback for devices with device pixel\n "}
548{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "est resolution\n is used as the fallback for devices with device pixel\n ratios below that resolution. The entry should still\n be included in the pubspec.yaml manifest, however.\nAnything using the default asset bundle inherits resolution\n awareness when loading images. (If you work with some of the lower\n level classes, like ImageStream or ImageCache ,\n you'll also notice parameters related to sca"}
549{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "ses, like ImageStream or ImageCache ,\n you'll also notice parameters related to scale.)\nAsset images in package dependencies\nTo load an image from a package dependency,\n the package argument must be provided to AssetImage .\nFor instance, suppose your application depends on a package\n called my_icons , which has the following directory structure:\nTo load the image, use:\nAssets used by the package itself should also be fetched\n us"}
550{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "o load the image, use:\nAssets used by the package itself should also be fetched\n using the package argument as above.\nBundling of package assets\nIf the desired asset is specified in the pubspec.yaml file of the package, it's bundled automatically with the\n application. In particular, assets used by the package\n itself must be specified in its pubspec.yaml .\nA package can also choose to have assets in its lib/ folder that are not specified in its"}
551{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "pec.yaml .\nA package can also choose to have assets in its lib/ folder that are not specified in its pubspec.yaml file.\n In this case, for those images to be bundled,\n the application has to specify which ones to include in its pubspec.yaml . For instance, a package named fancy_backgrounds could have the following files:\nTo include, say, the first image, the pubspec.yaml of the\n application should specify it in the assets section:\nThe lib/ is im"}
552{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "ec.yaml of the\n application should specify it in the assets section:\nThe lib/ is implied,\n so it should not be included in the asset path.\nIf you are developing a package, to load an asset within the package, specify it in the pubspec.yaml of the package:\nTo load the image within your package, use:\nSharing assets with the underlying platform\nFlutter assets are readily available to platform code\n using the AssetManager on Android and NSBundle on "}
553{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "dily available to platform code\n using the AssetManager on Android and NSBundle on iOS.\nLoading Flutter assets in Android\nOn Android the assets are available through the AssetManager API. The lookup key used in,\n for instance openFd , is obtained from lookupKeyForAsset on PluginRegistry.Registrar or getLookupKeyForAsset on FlutterView . PluginRegistry.Registrar is available when developing a plugin\n while FlutterView would be the choice when de"}
554{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "s available when developing a plugin\n while FlutterView would be the choice when developing an\n app including a platform view.\nAs an example, suppose you have specified the following\n in your pubspec.yaml\nThis reflects the following structure in your Flutter app.\nTo access icons/heart.png from your Java plugin code,\n do the following:\nLoading Flutter assets in iOS\nOn iOS the assets are available through the mainBundle .\n "}
555{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "ing:\nLoading Flutter assets in iOS\nOn iOS the assets are available through the mainBundle .\n The lookup key used in, for instance pathForResource:ofType: ,\n is obtained from lookupKeyForAsset or lookupKeyForAsset:fromPackage: on FlutterPluginRegistrar , or lookupKeyForAsset: or lookupKeyForAsset:fromPackage: on FlutterViewController . FlutterPluginRegistrar is available when developing\n a plugin while FlutterViewController would be the choice\n "}
556{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "ilable when developing\n a plugin while FlutterViewController would be the choice\n when developing an app including a platform view.\nAs an example, suppose you have the Flutter setting from above.\nTo access icons/heart.png from your Objective-C plugin code you\n would do the following:\nTo access icons/heart.png from your Swift app you\n would do the following:\nFor a more complete example, see the implementation of the\n "}
557{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": " would do the following:\nFor a more complete example, see the implementation of the\n Flutter video_player plugin on pub.dev.\nLoading iOS images in Flutter\nWhen implementing Flutter by adding it to an existing iOS app ,\n you might have images hosted in iOS that you\n want to use in Flutter. To accomplish\n that, use platform channels to pass the image\n data to Dart as FlutterStandardTypedData .\nPlatform assets\nT"}
558{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "els to pass the image\n data to Dart as FlutterStandardTypedData .\nPlatform assets\nThere are other occasions to work with assets in the\n platform projects directly. Below are two common cases\n where assets are used before the Flutter framework is\n loaded and running.\nUpdating the app icon\nUpdating a Flutter application's launch icon works\n the same way as updating launch icons in native\n Android "}
559{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "n works\n the same way as updating launch icons in native\n Android or iOS applications.\nAndroid\nIn your Flutter project's root directory, navigate to .../android/app/src/main/res . The various bitmap resource\n folders such as mipmap-hdpi already contain placeholder\n images named ic_launcher.png . Replace them with your\n desired assets respecting the recommended icon size per\n screen density as in"}
560{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": " desired assets respecting the recommended icon size per\n screen density as indicated by the Android Developer Guide .\niOS\nIn your Flutter project's root directory,\n navigate to .../ios/Runner . The Assets.xcassets/AppIcon.appiconset directory already contains\n placeholder images. Replace them with the appropriately\n sized images as indicated by their filename as dictated by the\n Apple Human Interface Guide"}
561{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "ages as indicated by their filename as dictated by the\n Apple Human Interface Guidelines .\n Keep the original file names.\nUpdating the launch screen\nFlutter also uses native platform mechanisms to draw\n transitional launch screens to your Flutter app while the\n Flutter framework loads. This launch screen persists until\n Flutter renders the first frame of your application.\nAndroid\nTo add a launch screen (also kno"}
562{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": " Flutter renders the first frame of your application.\nAndroid\nTo add a launch screen (also known as \"splash screen\") to your\n Flutter application, navigate to .../android/app/src/main .\n In res/drawable/launch_background.xml ,\n use this layer list drawable XML to customize\n the look of your launch screen. The existing template provides\n an example of adding an image to the middle of a white splash\n "}
563{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": "te provides\n an example of adding an image to the middle of a white splash\n screen in commented code. You can uncomment it or use other drawables to achieve the intended effect.\nFor more details, see Adding a splash screen to your Android app .\niOS\nTo add an image to the center of your \"splash screen\",\n navigate to .../ios/Runner .\n In Assets.xcassets/LaunchImage.imageset ,\n drop in images named LaunchImage.png "}
564{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": " In Assets.xcassets/LaunchImage.imageset ,\n drop in images named LaunchImage.png , LaunchImage@2x.png , LaunchImage@3x.png .\n If you use different filenames,\n update the Contents.json file in the same directory.\nYou can also fully customize your launch screen storyboard\n in Xcode by opening .../ios/Runner.xcworkspace .\n Navigate to Runner/Runner in the Project Navigator and\n drop in images by "}
565{"url": "https://docs.flutter.dev/ui/assets/assets-and-images", "title": "Untitled", "text": " Navigate to Runner/Runner in the Project Navigator and\n drop in images by opening Assets.xcassets or do any\n customization using the Interface Builder in LaunchScreen.storyboard .\nFor more details, see Adding a splash screen to your iOS app .\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
566{"url": "https://docs.flutter.dev/ui/assets", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nHow to set up automatic transformation of images (and other assets) in your Flutter app.\nHow to use images (and other assets) in your Flutter app.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
567{"url": "https://docs.flutter.dev/ui/animations/staggered-animations", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nStaggered animations are a straightforward concept: visual changes\n happen as a series of operations, rather than all at once.\n The animation might be purely sequential, with one change occurring after\n the next, or it might partially or completely overlap. It might also\n have gaps, where no changes occur.\nThis guide shows how to build a staggered animati"}
568{"url": "https://docs.flutter.dev/ui/animations/staggered-animations", "title": "Untitled", "text": " have gaps, where no changes occur.\nThis guide shows how to build a staggered animation in Flutter.\nThe following video demonstrates the animation performed by\n basic_staggered_animation:\nWatch on YouTube in a new tab: \"Staggered animation example\"\nIn the video, you see the following animation of a single widget,\n which begins as a bordered blue square with slightly rounded corners.\n The square runs through changes in the followin"}
569{"url": "https://docs.flutter.dev/ui/animations/staggered-animations", "title": "Untitled", "text": "are with slightly rounded corners.\n The square runs through changes in the following order:\nFades in\nWidens\nBecomes taller while moving upwards\nTransforms into a bordered circle\nChanges color to orange\nAfter running forward, the animation runs in reverse.\nBasic structure of a staggered animation\nThe following diagram shows the Interval s used in the basic_staggered_animation example.\n You might notice the following characteristics:\nThe opacity changes during the"}
570{"url": "https://docs.flutter.dev/ui/animations/staggered-animations", "title": "Untitled", "text": "le.\n You might notice the following characteristics:\nThe opacity changes during the first 10% of the timeline.\nA tiny gap occurs between the change in opacity,\n and the change in width.\nNothing animates during the last 25% of the timeline.\nIncreasing the padding makes the widget appear to rise upward.\nIncreasing the border radius to 0.5,\n transforms the square with rounded corners into a circle.\nThe padding and height changes occur during\n "}
571{"url": "https://docs.flutter.dev/ui/animations/staggered-animations", "title": "Untitled", "text": "sforms the square with rounded corners into a circle.\nThe padding and height changes occur during\n the same exact interval, but they don't have to.\nTo set up the animation:\nCreate an AnimationController that manages all of the Animations .\nCreate a Tween for each property being animated. The Tween defines a range of values. The Tween 's animate method requires the parent controller, and produces an Animation for that property.\nThe Tween defines a range of values.\nThe Tween 's "}
572{"url": "https://docs.flutter.dev/ui/animations/staggered-animations", "title": "Untitled", "text": "ler, and produces an Animation for that property.\nThe Tween defines a range of values.\nThe Tween 's animate method requires the parent controller, and produces an Animation for that property.\nSpecify the interval on the Animation 's curve property.\nWhen the controlling animation's value changes,\n the new animation's value changes, triggering the UI to update.\nThe following code creates a tween for the width property.\n It builds a CurvedAnimation ,\n "}
573{"url": "https://docs.flutter.dev/ui/animations/staggered-animations", "title": "Untitled", "text": "eates a tween for the width property.\n It builds a CurvedAnimation ,\n specifying an eased curve. See Curves for\n other available pre-defined animation curves.\nThe begin and end values don't have to be doubles.\n The following code builds the tween for the borderRadius property\n (which controls the roundness of the square's corners),\n using BorderRadius.circular() .\nComplete staggered animation\nLi"}
574{"url": "https://docs.flutter.dev/ui/animations/staggered-animations", "title": "Untitled", "text": "square's corners),\n using BorderRadius.circular() .\nComplete staggered animation\nLike all interactive widgets, the complete animation consists\n of a widget pair: a stateless and a stateful widget.\nThe stateless widget specifies the Tween s,\n defines the Animation objects, and provides a build() function\n responsible for building the animating portion of the widget tree.\nThe stateful widget creates the controller, plays the anima"}
575{"url": "https://docs.flutter.dev/ui/animations/staggered-animations", "title": "Untitled", "text": "he animating portion of the widget tree.\nThe stateful widget creates the controller, plays the animation,\n and builds the non-animating portion of the widget tree.\n The animation begins when a tap is detected anywhere in the screen.\nFull code for basic_staggered_animation's main.dart\nStateless widget: StaggerAnimation\nIn the stateless widget, StaggerAnimation ,\n the build() function instantiates an AnimatedBuilder —a general purpose widget for b"}
576{"url": "https://docs.flutter.dev/ui/animations/staggered-animations", "title": "Untitled", "text": " the build() function instantiates an AnimatedBuilder —a general purpose widget for building\n animations. The AnimatedBuilder builds a widget and configures it using the Tweens ' current values.\n The example creates a function named _buildAnimation() (which performs\n the actual UI updates), and assigns it to its builder property.\n AnimatedBuilder listens to notifications from the animation controller,\n "}
577{"url": "https://docs.flutter.dev/ui/animations/staggered-animations", "title": "Untitled", "text": " AnimatedBuilder listens to notifications from the animation controller,\n marking the widget tree dirty as values change.\n For each tick of the animation, the values are updated,\n resulting in a call to _buildAnimation() .\nStateful widget: StaggerDemo\nThe stateful widget, StaggerDemo , creates the AnimationController (the one who rules them all), specifying a 2000 ms duration. It plays\n the animation, and builds t"}
578{"url": "https://docs.flutter.dev/ui/animations/staggered-animations", "title": "Untitled", "text": "les them all), specifying a 2000 ms duration. It plays\n the animation, and builds the non-animating portion of the widget tree.\n The animation begins when a tap is detected in the screen.\n The animation runs forward, then backward.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
579{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nThis tutorial shows you how to build explicit animations in Flutter.\n The examples build on each other, introducing you to different aspects of the\n animation library. The tutorial is built on essential concepts, classes,\n and methods in the animation library that you can learn about in Introduction to animations .\nThe Flutter SDK also provides built-in explicit animation"}
580{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": "earn about in Introduction to animations .\nThe Flutter SDK also provides built-in explicit animations,\n such as FadeTransition , SizeTransition ,\n and SlideTransition . These simple animations are\n triggered by setting a beginning and ending point.\n They are simpler to implement\n than custom explicit animations, which are described here.\nThe following sections walks you through several animation examples.\n "}
581{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": "hich are described here.\nThe following sections walks you through several animation examples.\n Each section provides a link to the source code for that example.\nRendering animations\nSo far you've learned how to generate a sequence of numbers over time.\n Nothing has been rendered to the screen. To render with an Animation object, store the Animation object as a\n member of your widget, then use its value to decide how to draw.\nConsider the followi"}
582{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": " member of your widget, then use its value to decide how to draw.\nConsider the following app that draws the Flutter logo without animation:\nApp source: animate0\nThe following shows the same code modified to animate the\n logo to grow from nothing to full size.\n When defining an AnimationController , you must pass in a vsync object. The vsync parameter is described in the AnimationController section .\nThe changes from the non-animated example are hig"}
583{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": " is described in the AnimationController section .\nThe changes from the non-animated example are highlighted:\nApp source: animate1\nThe addListener() function calls setState() ,\n so every time the Animation generates a new number,\n the current frame is marked dirty, which forces build() to be called again. In build() ,\n the container changes size because its height and\n width now use animation.value instead of a hardcoded value.\n"}
584{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": "ecause its height and\n width now use animation.value instead of a hardcoded value.\n Dispose of the controller when the State object is\n discarded to prevent memory leaks.\nWith these few changes,\n you've created your first animation in Flutter!\nSimplifying with AnimatedWidget\nThe AnimatedWidget base class allows you to separate out\n the core widget code from the animation code. AnimatedWidget doesn't need to main"}
585{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": "\n the core widget code from the animation code. AnimatedWidget doesn't need to maintain a State object to hold the animation. Add the following AnimatedLogo class:\nAnimatedLogo uses the current value of the animation when drawing itself.\nThe LogoApp still manages the AnimationController and the Tween ,\n and it passes the Animation object to AnimatedLogo :\nApp source: animate2\nMonitoring the progress of the animation\nIt's often helpful to know when an animation c"}
586{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": "ce: animate2\nMonitoring the progress of the animation\nIt's often helpful to know when an animation changes state,\n such as finishing, moving forward, or reversing.\n You can get notifications for this with addStatusListener() .\n The following code modifies the previous example so that\n it listens for a state change and prints an update.\n The highlighted line shows the change:\nRunning this code produces this outpu"}
587{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": "date.\n The highlighted line shows the change:\nRunning this code produces this output:\nNext, use addStatusListener() to reverse the animation\n at the beginning or the end. This creates a \"breathing\" effect:\nApp source: animate3\nRefactoring with AnimatedBuilder\nOne problem with the code in the animate3 example,\n is that changing the animation required changing the widget\n that renders the logo. A better solution\n "}
588{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": "ed changing the widget\n that renders the logo. A better solution\n is to separate responsibilities into different classes:\nRender the logo\nDefine the Animation object\nRender the transition\nYou can accomplish this separation with the help of the AnimatedBuilder class. An AnimatedBuilder is a\n separate class in the render tree. Like AnimatedWidget , AnimatedBuilder automatically listens to notifications\n from the Animation object, "}
589{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": "AnimatedBuilder automatically listens to notifications\n from the Animation object, and marks the widget tree\n dirty as necessary, so you don't need to call addListener() .\nThe widget tree for the animate4 example looks like this:\nStarting from the bottom of the widget tree, the code for rendering\n the logo is straightforward:\nThe middle three blocks in the diagram are all created in the build() method in GrowTransition , shown below.\n "}
590{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": "ks in the diagram are all created in the build() method in GrowTransition , shown below.\n The GrowTransition widget itself is stateless and holds\n the set of final variables necessary to define the transition animation.\n The build() function creates and returns the AnimatedBuilder ,\n which takes the ( Anonymous builder) method and the LogoWidget object as parameters. The work of rendering the\n transition actuall"}
591{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": " the LogoWidget object as parameters. The work of rendering the\n transition actually happens in the ( Anonymous builder)\n method, which creates a Container of the appropriate size\n to force the LogoWidget to shrink to fit.\nOne tricky point in the code below is that the child looks\n like it's specified twice. What's happening is that the\n outer reference of child is passed to AnimatedBuilder ,\n w"}
592{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": "at the\n outer reference of child is passed to AnimatedBuilder ,\n which passes it to the anonymous closure, which then uses\n that object as its child. The net result is that the AnimatedBuilder is inserted in between the two widgets\n in the render tree.\nFinally, the code to initialize the animation looks very\n similar to the animate2 example. The initState() method creates an AnimationController and a Tween ,\n "}
593{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": "lar to the animate2 example. The initState() method creates an AnimationController and a Tween ,\n then binds them with animate() . The magic happens in\n the build() method, which returns a GrowTransition object with a LogoWidget as a child, and an animation object to\n drive the transition. These are the three elements listed\n in the bullet points above.\nApp source: animate4\nSimultaneous animations\nIn this section, you'll build o"}
594{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": "he bullet points above.\nApp source: animate4\nSimultaneous animations\nIn this section, you'll build on the example from monitoring the progress of the animation ( animate3 ), which used AnimatedWidget to animate in and out continuously. Consider the case\n where you want to animate in and out while the\n opacity animates from transparent to opaque.\nEach tween manages an aspect of the animation. For example:\nYou can get the size with sizeAnimation.value and the opac"}
595{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": " an aspect of the animation. For example:\nYou can get the size with sizeAnimation.value and the opacity\n with opacityAnimation.value , but the constructor for AnimatedWidget only takes a single Animation object. To solve this problem,\n the example creates its own Tween objects and explicitly calculates the\n values.\nChange AnimatedLogo to encapsulate its own Tween objects,\n and its build() method calls Tween.evaluate() on the par"}
596{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": "te its own Tween objects,\n and its build() method calls Tween.evaluate() on the parent's animation object to calculate\n the required size and opacity values.\n The following code shows the changes with highlights:\nApp source: animate5 object knows the current state of an animation\n (for example, whether it's started, stopped,\n or moving forward or in reverse),\n but doesn't know anything abo"}
597{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": " or moving forward or in reverse),\n but doesn't know anything about what appears onscreen.\nAn AnimationController manages the Animation .\nA CurvedAnimation defines progression as a non-linear curve.\nA Tween interpolates between a beginning and ending value\n for a property being animated.\nNext steps\nThis tutorial gives you a foundation for creating animations in\n Flutter using Tweens , but there are many other classes to explo"}
598{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": "ing animations in\n Flutter using Tweens , but there are many other classes to explore.\n You might investigate the specialized Tween classes,\n animations specific to your design system type, ReverseAnimation ,\n shared element transitions (also known as Hero animations),\n physics simulations and fling() methods.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2"}
599{"url": "https://docs.flutter.dev/ui/animations/tutorial", "title": "Untitled", "text": "ess stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
600{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nThe animation system in Flutter is based on typed Animation objects. Widgets can either\n incorporate these animations in their build\n functions directly by reading their current value and listening to their\n state changes or they can use the animations as the basis of more elaborate\n animations that they pass along to other widgets.\nAnimation\nThe primary "}
601{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "elaborate\n animations that they pass along to other widgets.\nAnimation\nThe primary building block of the animation system is the Animation class. An animation represents a value\n of a specific type that can change over the lifetime of\n the animation. Most widgets that perform an animation\n receive an Animation object as a parameter,\n from which they read the current value of the animation\n and t"}
602{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "r,\n from which they read the current value of the animation\n and to which they listen for changes to that value.\naddListener\nWhenever the animation's value changes,\n the animation notifies all the listeners added with addListener . Typically, a State object that listens to an animation calls setState on itself in its listener callback\n to notify the widget system that it needs to\n rebuild with the new value of t"}
603{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": " to notify the widget system that it needs to\n rebuild with the new value of the animation.\nThis pattern is so common that there are two widgets\n that help widgets rebuild when animations change value: AnimatedWidget and AnimatedBuilder .\n The first, AnimatedWidget , is most useful for\n stateless animated widgets. To use AnimatedWidget ,\n simply subclass it and implement the build function.\n "}
604{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "atedWidget ,\n simply subclass it and implement the build function.\n The second, AnimatedBuilder , is useful for more complex widgets\n that wish to include an animation as part of a larger build function.\n To use AnimatedBuilder , simply construct the widget\n and pass it a builder function.\naddStatusListener\nAnimations also provide an AnimationStatus ,\n which indicates how the animation will evol"}
605{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "ions also provide an AnimationStatus ,\n which indicates how the animation will evolve over time.\n Whenever the animation's status changes,\n the animation notifies all the listeners added with addStatusListener . Typically, animations start\n out in the dismissed status, which means they're\n at the beginning of their range. For example,\n animations that progress from 0.0 to 1.0\n w"}
606{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "r range. For example,\n animations that progress from 0.0 to 1.0\n will be dismissed when their value is 0.0.\n An animation might then run forward (from 0.0 to 1.0)\n or perhaps in reverse (from 1.0 to 0.0).\n Eventually, if the animation reaches the end of its range\n (1.0), the animation reaches the completed status.\nAnimationController\nTo create an animation, first create an AnimationController ."}
607{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "completed status.\nAnimationController\nTo create an animation, first create an AnimationController .\n As well as being an animation itself, an AnimationController lets you control the animation. For example,\n you can tell the controller to play the animation forward or stop the animation.\n You can also fling animations,\n which uses a physical simulation, such as a spring,\n to drive the animation.\nOnce you've cre"}
608{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "s a physical simulation, such as a spring,\n to drive the animation.\nOnce you've created an animation controller,\n you can start building other animations based on it.\n For example, you can create a ReverseAnimation that mirrors the original animation but runs in the\n opposite direction (from 1.0 to 0.0).\n Similarly, you can create a CurvedAnimation whose value is adjusted by a Curve .\nTweens\nTo animate beyond th"}
609{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "y, you can create a CurvedAnimation whose value is adjusted by a Curve .\nTweens\nTo animate beyond the 0.0 to 1.0 interval, you can use a Tween<T> , which interpolates between its begin and end values. Many types have specific Tween subclasses that provide type-specific interpolation.\n For example, ColorTween interpolates between colors and RectTween interpolates between rects.\n You can define your own interpolations by creating\n your own subclas"}
610{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": " You can define your own interpolations by creating\n your own subclass of Tween and overriding its lerp function.\nBy itself, a tween just defines how to interpolate\n between two values. To get a concrete value for the\n current frame of an animation, you also need an\n animation to determine the current state.\n There are two ways to combine a tween\n with an animation to get a concret"}
611{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": " There are two ways to combine a tween\n with an animation to get a concrete value:\nYou can evaluate the tween at the current\n value of an animation. This approach is most useful\n for widgets that are already listening to the animation and hence\n rebuilding whenever the animation changes value.\nYou can evaluate the tween at the current\n value of an animation. This approach is most useful\n"}
612{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": " the tween at the current\n value of an animation. This approach is most useful\n for widgets that are already listening to the animation and hence\n rebuilding whenever the animation changes value.\nYou can animate the tween based on the animation.\n Rather than returning a single value, the animate function\n returns a new Animation that incorporates the tween.\n This approach"}
613{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": " returns a new Animation that incorporates the tween.\n This approach is most useful when you want to give the\n newly created animation to another widget,\n which can then read the current value that incorporates\n the tween as well as listen for changes to the value.\nYou can animate the tween based on the animation.\n Rather than returning a single value, the animate function\n "}
614{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "animation.\n Rather than returning a single value, the animate function\n returns a new Animation that incorporates the tween.\n This approach is most useful when you want to give the\n newly created animation to another widget,\n which can then read the current value that incorporates\n the tween as well as listen for changes to the value.\nArchitecture\nAnimations are actually "}
615{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": " the tween as well as listen for changes to the value.\nArchitecture\nAnimations are actually built from a number of core building blocks.\nScheduler\nThe SchedulerBinding is a singleton class\n that exposes the Flutter scheduling primitives.\nFor this discussion, the key primitive is the frame callbacks.\n Each time a frame needs to be shown on the screen,\n Flutter's engine triggers a \"begin frame\" callback that\n the scheduler"}
616{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": " Flutter's engine triggers a \"begin frame\" callback that\n the scheduler multiplexes to all the listeners registered using scheduleFrameCallback() . All these callbacks are\n given the official time stamp of the frame, in\n the form of a Duration from some arbitrary epoch. Since all the\n callbacks have the same time, any animations triggered from these\n callbacks will appear to be exactly synchronised e"}
617{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "animations triggered from these\n callbacks will appear to be exactly synchronised even\n if they take a few milliseconds to be executed.\nTickers\nThe Ticker class hooks into the scheduler's scheduleFrameCallback() mechanism to invoke a callback every tick.\nA Ticker can be started and stopped. When started,\n it returns a Future that will resolve when it is stopped.\nEach tick, the Ticker provides the callback with the\n duration sinc"}
618{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": " it is stopped.\nEach tick, the Ticker provides the callback with the\n duration since the first tick after it was started.\nBecause tickers always give their elapsed time relative to the first\n tick after they were started; tickers are all synchronised. If you\n start three tickers at different times between two ticks, they will all\n nonetheless be synchronised with the same starting time, and will\n subsequently ti"}
619{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": " nonetheless be synchronised with the same starting time, and will\n subsequently tick in lockstep. Like people at a bus-stop,\n all the tickers wait for a regularly occurring event\n (the tick) to begin moving (counting time).\nSimulations\nThe Simulation abstract class maps a\n relative time value (an elapsed time) to a\n double value, and has a notion of completion.\nIn principle simulations are stateless but in prac"}
620{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": " double value, and has a notion of completion.\nIn principle simulations are stateless but in practice\n some simulations (for example, BouncingScrollSimulation and ClampingScrollSimulation )\n change state irreversibly when queried.\nThere are various concrete implementations of the Simulation class for different effects.\nAnimatables\nThe Animatable abstract class maps a\n double to a value of a particular type.\nAnimatable classes are stateless an"}
621{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "maps a\n double to a value of a particular type.\nAnimatable classes are stateless and immutable.\nTweens\nThe Tween<T> abstract class maps a double\n value nominally in the range 0.0-1.0 to a typed value\n (for example, a Color , or another double).\n It is an Animatable .\nIt has a notion of an output type ( T ),\n a begin value and an end value of that type,\n and a way to interpolate ( lerp ) between "}
622{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "in value and an end value of that type,\n and a way to interpolate ( lerp ) between the begin\n and end values for a given input value (the double nominally in\n the range 0.0-1.0).\nTween classes are stateless and immutable.\nComposing animatables\nPassing an Animatable<double> (the parent) to an Animatable 's chain() method creates a new Animatable subclass that applies the\n parent's mapping then the child's mapping.\nCurves\nThe Curv"}
623{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "bclass that applies the\n parent's mapping then the child's mapping.\nCurves\nThe Curve abstract class maps doubles\n nominally in the range 0.0-1.0 to doubles\n nominally in the range 0.0-1.0.\nCurve classes are stateless and immutable.\nAnimations\nThe Animation abstract class provides a\n value of a given type, a concept of animation\n direction and animation status, and a listener interface to\n regist"}
624{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": " direction and animation status, and a listener interface to\n register callbacks that get invoked when the value or status change.\nSome subclasses of Animation have values that never change\n ( kAlwaysCompleteAnimation , kAlwaysDismissedAnimation , AlwaysStoppedAnimation ); registering callbacks on\n these has no effect as the callbacks are never called.\nThe Animation<double> variant is special because it can be used to\n "}
625{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "ks are never called.\nThe Animation<double> variant is special because it can be used to\n represent a double nominally in the range 0.0-1.0, which is the input\n expected by Curve and Tween classes, as well as some further\n subclasses of Animation .\nSome Animation subclasses are stateless,\n merely forwarding listeners to their parents.\n Some are very stateful.\nComposable animations\nMost Animation subclasses take a"}
626{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "ts.\n Some are very stateful.\nComposable animations\nMost Animation subclasses take an explicit \"parent\" Animation<double> . They are driven by that parent.\nThe CurvedAnimation subclass takes an Animation<double> class (the\n parent) and a couple of Curve classes (the forward and reverse\n curves) as input, and uses the value of the parent as input to the\n curves to determine its output. CurvedAnimation is immutable and\n "}
627{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": " the\n curves to determine its output. CurvedAnimation is immutable and\n stateless.\nThe ReverseAnimation subclass takes an Animation<double> class as its parent and reverses\n all the values of the animation. It assumes the parent\n is using a value nominally in the range 0.0-1.0 and returns\n a value in the range 1.0-0.0. The status and direction of the parent\n animation are also reversed. ReverseA"}
628{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "-0.0. The status and direction of the parent\n animation are also reversed. ReverseAnimation is immutable and\n stateless.\nThe ProxyAnimation subclass takes an Animation<double> class as\n its parent and merely forwards the current state of that parent.\n However, the parent is mutable.\nThe TrainHoppingAnimation subclass takes two parents,\n and switches between them when their values cross.\nAnimation controllers\nThe"}
629{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "ents,\n and switches between them when their values cross.\nAnimation controllers\nThe AnimationController is a stateful Animation<double> that uses a Ticker to give itself life.\n It can be started and stopped. At each tick, it takes the time\n elapsed since it was started and passes it to a Simulation to obtain\n a value. That is then the value it reports. If the Simulation reports that at that time it has ended, then the controller"}
630{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": " the value it reports. If the Simulation reports that at that time it has ended, then the controller stops\n itself.\nThe animation controller can be given a lower and upper bound to\n animate between, and a duration.\nIn the simple case (using forward() or reverse() ), the animation controller simply does a linear\n interpolation from the lower bound to the upper bound (or vice versa,\n for the reverse direction) over the given durat"}
631{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "to the upper bound (or vice versa,\n for the reverse direction) over the given duration.\nWhen using repeat() , the animation controller uses a linear\n interpolation between the given bounds over the given duration, but\n does not stop.\nWhen using animateTo() , the animation controller does a linear\n interpolation over the given duration from the current value to the\n given target. If no duration is given to the me"}
632{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "tion from the current value to the\n given target. If no duration is given to the method, the default\n duration of the controller and the range described by the controller's\n lower bound and upper bound is used to determine the velocity of the\n animation.\nWhen using fling() , a Force is used to create a specific\n simulation which is then used to drive the controller.\nWhen using animateWith() , the given simulatio"}
633{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": "imulation which is then used to drive the controller.\nWhen using animateWith() , the given simulation is used to drive the\n controller.\nThese methods all return the future that the Ticker provides and\n which will resolve when the controller next stops or changes\n simulation.\nAttaching animatables to animations\nPassing an Animation<double> (the new parent) to an Animatable 's animate() method creates a new Animation subclass that acts like\n "}
634{"url": "https://docs.flutter.dev/ui/animations/overview", "title": "Untitled", "text": " parent) to an Animatable 's animate() method creates a new Animation subclass that acts like\n the Animatable but is driven from the given parent.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
635{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nYou've probably seen hero animations many times. For example, a screen displays\n a list of thumbnails representing items for sale. Selecting an item flies it to\n a new screen, containing more details and a \"Buy\" button. Flying an image from\n one screen to another is called a hero animation in Flutter, though the same\n motion is sometimes referred to as a"}
636{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": " a hero animation in Flutter, though the same\n motion is sometimes referred to as a shared element transition .\nYou might want to watch this one-minute video introducing the Hero widget:\nWatch on YouTube in a new tab: \"Hero | Flutter widget of the week\"\nThis guide demonstrates how to build standard hero animations, and hero\n animations that transform the image from a circular shape to a square shape\n during flight.\nYou can create this animation "}
637{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "m a circular shape to a square shape\n during flight.\nYou can create this animation in Flutter with Hero widgets.\n As the hero animates from the source to the destination route,\n the destination route (minus the hero) fades into view.\n Typically, heroes are small parts of the UI, like images,\n that both routes have in common. From the user's perspective\n the hero \"flies\" between the routes. This "}
638{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": " in common. From the user's perspective\n the hero \"flies\" between the routes. This guide shows how\n to create the following hero animations:\nStandard hero animations\nA standard hero animation flies the hero from one route to a new route,\n usually landing at a different location and with a different size.\nThe following video (recorded at slow speed) shows a typical example.\n Tapping the flippers in the center of the route flies t"}
639{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": ") shows a typical example.\n Tapping the flippers in the center of the route flies them to the\n upper left corner of a new, blue route, at a smaller size.\n Tapping the flippers in the blue route (or using the device's\n back-to-previous-route gesture) flies the flippers back to\n the original route.\nWatch on YouTube in a new tab: \"Standard hero animation in Flutter\"\nRadial hero animations\nIn radial hero animation ,"}
640{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "in a new tab: \"Standard hero animation in Flutter\"\nRadial hero animations\nIn radial hero animation , as the hero flies between routes\n its shape appears to change from circular to rectangular.\nThe following video (recorded at slow speed),\n shows an example of a radial hero animation. At the start, a\n row of three circular images appears at the bottom of the route.\n Tapping any of the circular images flies that image to a new rou"}
641{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "tom of the route.\n Tapping any of the circular images flies that image to a new route\n that displays it with a square shape.\n Tapping the square image flies the hero back to\n the original route, displayed with a circular shape.\nWatch on YouTube in a new tab: \"Radial hero animation in Flutter\"\nBefore moving to the sections specific to standard or radial hero animations,\n read basic structure of a hero animation t"}
642{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": " to standard or radial hero animations,\n read basic structure of a hero animation to learn how to structure hero animation code,\n and behind the scenes to understand\n how Flutter performs a hero animation.\nBasic structure of a hero animation\nHero animations are implemented using two Hero widgets: one describing the widget in the source route,\n and another describing the widget in the destination route.\n From the"}
643{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": " and another describing the widget in the destination route.\n From the user's point of view, the hero appears to be shared, and\n only the programmer needs to understand this implementation detail.\n Hero animation code has the following structure:\nDefine a starting Hero widget, referred to as the source\n hero . The hero specifies its graphical representation\n (typically an image), and an identi"}
644{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": " hero specifies its graphical representation\n (typically an image), and an identifying tag, and is in\n the currently displayed widget tree as defined by the source route.\nDefine an ending Hero widget, referred to as the destination hero .\n This hero also specifies its graphical representation,\n and the same tag as the source hero.\n It's essential that both hero widgets are created with\n "}
645{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "ce hero.\n It's essential that both hero widgets are created with\n the same tag , typically an object that represents the\n underlying data. For best results, the heroes should have\n virtually identical widget trees.\nCreate a route that contains the destination hero.\n The destination route defines the widget tree that exists\n at the end of the animation.\nTrigger the animation by push"}
646{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "dget tree that exists\n at the end of the animation.\nTrigger the animation by pushing the destination route on the\n Navigator's stack. The Navigator push and pop operations trigger\n a hero animation for each pair of heroes with matching tags in\n the source and destination routes.\nFlutter calculates the tween that animates the Hero's bounds from\n the starting point to the endpoint (interpolating size and p"}
647{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "he Hero's bounds from\n the starting point to the endpoint (interpolating size and position),\n and performs the animation in an overlay.\nThe next section describes Flutter's process in greater detail.\nBehind the scenes\nThe following describes how Flutter performs the\n transition from one route to another.\nBefore transition, the source hero waits in the source\n route's widget tree. The destination route does not yet exist,\n "}
648{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": " the source\n route's widget tree. The destination route does not yet exist,\n and the overlay is empty.\nPushing a route to the Navigator triggers the animation.\n At t=0.0 , Flutter does the following:\nCalculates the destination hero's path, offscreen,\n using the curved motion as described in the Material\n motion spec. Flutter now knows where the hero ends up.\nCalculates the destination hero's path, offscr"}
649{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "otion spec. Flutter now knows where the hero ends up.\nCalculates the destination hero's path, offscreen,\n using the curved motion as described in the Material\n motion spec. Flutter now knows where the hero ends up.\nPlaces the destination hero in the overlay,\n at the same location and size as the source hero.\n Adding a hero to the overlay changes its Z-order so that it\n appears on top of all r"}
650{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "g a hero to the overlay changes its Z-order so that it\n appears on top of all routes.\nPlaces the destination hero in the overlay,\n at the same location and size as the source hero.\n Adding a hero to the overlay changes its Z-order so that it\n appears on top of all routes.\nMoves the source hero offscreen.\nMoves the source hero offscreen.\nAs the hero flies, its rectangular bounds are animated using Tween<Rect> , sp"}
651{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "source hero offscreen.\nAs the hero flies, its rectangular bounds are animated using Tween<Rect> , specified in Hero's createRectTween property.\n By default, Flutter uses an instance of MaterialRectArcTween , which animates the\n rectangle's opposing corners along a curved path.\n (See Radial hero animations for an example\n that uses a different Tween animation.)\nWhen the flight completes:\nFlutter moves the hero widget from the ove"}
652{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": " a different Tween animation.)\nWhen the flight completes:\nFlutter moves the hero widget from the overlay to\n the destination route. The overlay is now empty.\nFlutter moves the hero widget from the overlay to\n the destination route. The overlay is now empty.\nThe destination hero appears in its final position\n in the destination route.\nThe destination hero appears in its final position\n in the destination route.\nTh"}
653{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "he destination hero appears in its final position\n in the destination route.\nThe source hero is restored to its route.\nThe source hero is restored to its route.\nPopping the route performs the same process,\n animating the hero back to its size\n and location in the source route.\nEssential classes\nThe examples in this guide use the following classes to\n implement hero animations:\nThe widget that flies from the source to the des"}
654{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "ses to\n implement hero animations:\nThe widget that flies from the source to the destination route.\n Define one Hero for the source route and another for the\n destination route, and assign each the same tag.\n Flutter animates pairs of heroes with matching tags.\nSpecifies what happens when tapping the hero.\n The InkWell 's onTap() method builds the\n new route and pushes it to t"}
655{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": " The InkWell 's onTap() method builds the\n new route and pushes it to the Navigator 's stack.\nThe Navigator manages a stack of routes. Pushing a route on or\n popping a route from the Navigator 's stack triggers the animation.\nSpecifies a screen or page. Most apps,\n beyond the most basic, have multiple routes.\nStandard hero animations\nWhat's going on?\nFlying an image from one route to another is easy to implement\n "}
656{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "ations\nWhat's going on?\nFlying an image from one route to another is easy to implement\n using Flutter's hero widget. When using MaterialPageRoute to specify the new route, the image flies along a curved path,\n as described by the Material Design motion spec .\nCreate a new Flutter app and\n update it using the files from the hero_animation .\nTo run the example:\nTap on the home route's photo to fly the image to a new route\n showi"}
657{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "the example:\nTap on the home route's photo to fly the image to a new route\n showing the same photo at a different location and scale.\nReturn to the previous route by tapping the image, or by using the\n device's back-to-the-previous-route gesture.\nYou can slow the transition further using the timeDilation property.\nPhotoHero class\nThe custom PhotoHero class maintains the hero,\n and its size, image, and behavior when tapped.\n "}
658{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "ntains the hero,\n and its size, image, and behavior when tapped.\n The PhotoHero builds the following widget tree:\nHere's the code:\nKey information:\nThe starting route is implicitly pushed by MaterialApp when HeroAnimation is provided as the app's home property.\nAn InkWell wraps the image, making it trivial to add a tap\n gesture to the both the source and destination heroes.\nDefining the Material widget with a transparent color\n "}
659{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "ource and destination heroes.\nDefining the Material widget with a transparent color\n enables the image to \"pop out\" of the background as it\n flies to its destination.\nThe SizedBox specifies the hero's size at the start and\n end of the animation.\nSetting the Image's fit property to BoxFit.contain ,\n ensures that the image is as large as possible during the\n transition without changing its aspect ratio.\n"}
660{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "s as large as possible during the\n transition without changing its aspect ratio.\nHeroAnimation class\nThe HeroAnimation class creates the source and destination\n PhotoHeroes, and sets up the transition.\nHere's the code:\nKey information:\nWhen the user taps the InkWell containing the source hero,\n the code creates the destination route using MaterialPageRoute .\n Pushing the destination route to the Navigator 's stack triggers"}
661{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "rialPageRoute .\n Pushing the destination route to the Navigator 's stack triggers\n the animation.\nThe Container positions the PhotoHero in the destination\n route's top-left corner, below the AppBar .\nThe onTap() method for the destination PhotoHero pops the Navigator 's stack, triggering the animation\n that flies the Hero back to the original route.\nUse the timeDilation property to slow the transition\n "}
662{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "back to the original route.\nUse the timeDilation property to slow the transition\n while debugging.\nRadial hero animations\nFlying a hero from one route to another as it transforms\n from a circular shape to a rectangular shape is a slick\n effect that you can implement using Hero widgets.\n To accomplish this, the code animates the intersection of\n two clip shapes: a circle and a square.\n Througho"}
663{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "intersection of\n two clip shapes: a circle and a square.\n Throughout the animation, the circle clip (and the image)\n scales from minRadius to maxRadius , while the square\n clip maintains constant size. At the same time,\n the image flies from its position in the source route to its\n position in the destination route. For visual examples\n of this transition, see Radial transformat"}
664{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": " destination route. For visual examples\n of this transition, see Radial transformation in the Material motion spec.\nThis animation might seem complex (and it is), but you can customize the\n provided example to your needs. The heavy lifting is done for you.\nWhat's going on?\nThe following diagram shows the clipped image at the beginning\n ( t = 0.0 ), and the end ( t = 1.0 ) of the animation.\nThe blue gradient (representing the image), indicates "}
665{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": " ), and the end ( t = 1.0 ) of the animation.\nThe blue gradient (representing the image), indicates where the clip\n shapes intersect. At the beginning of the transition,\n the result of the intersection is a circular clip ( ClipOval ).\n During the transformation, the ClipOval scales from minRadius to maxRadius while the ClipRect maintains a constant size.\n At the end of the transition the intersection of the circular and\n "}
666{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "t size.\n At the end of the transition the intersection of the circular and\n rectangular clips yield a rectangle that's the same size as the hero\n widget. In other words, at the end of the transition the image is no\n longer clipped.\nCreate a new Flutter app and\n update it using the files from the radial_hero_animation GitHub directory.\nTo run the example:\nTap on one of the three circular thumbnails to animate the"}
667{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "ion GitHub directory.\nTo run the example:\nTap on one of the three circular thumbnails to animate the image\n to a larger square positioned in the middle of a new route that\n obscures the original route.\nReturn to the previous route by tapping the image, or by using the\n device's back-to-the-previous-route gesture.\nYou can slow the transition further using the timeDilation property.\nPhoto class\nThe Photo class builds the widget tree that hol"}
668{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "further using the timeDilation property.\nPhoto class\nThe Photo class builds the widget tree that holds the image:\nKey information:\nThe InkWell captures the tap gesture.\n The calling function passes the onTap() function to the Photo 's constructor.\nDuring flight, the InkWell draws its splash on its first\n Material ancestor.\nThe Material widget has a slightly opaque color, so the\n transparent portions of the image are rendered with color.\n "}
669{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "aque color, so the\n transparent portions of the image are rendered with color.\n This ensures that the circle-to-square transition is easy to see,\n even for images with transparency.\nThe Photo class does not include the Hero in its widget tree.\n For the animation to work, the hero\n wraps the RadialExpansion widget.\nRadialExpansion class\nThe RadialExpansion widget, the core of the demo, builds the\n "}
670{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "on widget.\nRadialExpansion class\nThe RadialExpansion widget, the core of the demo, builds the\n widget tree that clips the image during the transition.\n The clipped shape results from the intersection of a circular clip\n (that grows during flight),\n with a rectangular clip (that remains a constant size throughout).\nTo do this, it builds the following widget tree:\nHere's the code:\nKey information:\nThe hero wraps the RadialExpansio"}
671{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "uilds the following widget tree:\nHere's the code:\nKey information:\nThe hero wraps the RadialExpansion widget.\nThe hero wraps the RadialExpansion widget.\nAs the hero flies, its size changes and,\n because it constrains its child's size,\n the RadialExpansion widget changes size to match.\nAs the hero flies, its size changes and,\n because it constrains its child's size,\n the RadialExpansion widget changes size to matc"}
672{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "t constrains its child's size,\n the RadialExpansion widget changes size to match.\nThe RadialExpansion animation is created by two overlapping clips.\nThe RadialExpansion animation is created by two overlapping clips.\nThe example defines the tweening interpolation using MaterialRectCenterArcTween .\n The default flight path for a hero animation\n interpolates the tweens using the corners of the heroes.\n This approach"}
673{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": " interpolates the tweens using the corners of the heroes.\n This approach affects the hero's aspect ratio during\n the radial transformation, so the new flight path uses MaterialRectCenterArcTween to interpolate the tweens using the\n center point of each hero. Here's the code: dart static RectTween _createRectTween ( Rect ? begin , Rect ? end ) { return MaterialRectCenterArcTween ( begin : begin , end : end ) ; } content_copy Th"}
674{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": ", Rect ? end ) { return MaterialRectCenterArcTween ( begin : begin , end : end ) ; } content_copy The hero's flight path still follows an arc,\n but the image's aspect ratio remains constant.\nThe example defines the tweening interpolation using MaterialRectCenterArcTween .\n The default flight path for a hero animation\n interpolates the tweens using the corners of the heroes.\n This approach affects the hero's aspec"}
675{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "tweens using the corners of the heroes.\n This approach affects the hero's aspect ratio during\n the radial transformation, so the new flight path uses MaterialRectCenterArcTween to interpolate the tweens using the\n center point of each hero.\nHere's the code:\nThe hero's flight path still follows an arc,\n but the image's aspect ratio remains constant.\nUnless stated otherwise, the documentation on this site reflects "}
676{"url": "https://docs.flutter.dev/ui/animations/hero-animations", "title": "Untitled", "text": "e's aspect ratio remains constant.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
677{"url": "https://docs.flutter.dev/ui/animations/implicit-animations", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nWith Flutter's animation library ,\n you can add motion and create visual effects\n for the widgets in your UI.\n One part of the library is an assortment of widgets\n that manage animations for you.\n These widgets are collectively referred to as implicit animations ,\n or implicitly animated widgets , deriving their name from"}
678{"url": "https://docs.flutter.dev/ui/animations/implicit-animations", "title": "Untitled", "text": "as implicit animations ,\n or implicitly animated widgets , deriving their name from the ImplicitlyAnimatedWidget class that they implement.\n The following set of resources provide many ways to learn\n about implicit animations in Flutter.\nDocumentation\nLearn about implicit and explicit animations\n and get hands-on experience adding implicit animations\n to a complete Flutter app.\nA step-by-step recipe for "}
679{"url": "https://docs.flutter.dev/ui/animations/implicit-animations", "title": "Untitled", "text": "ding implicit animations\n to a complete Flutter app.\nA step-by-step recipe for using the AnimatedContainer implicitly animated widget.\nAll implicit animations extend the ImplicitlyAnimatedWidget class.\nFlutter in Focus videos\nFlutter in Focus videos feature 5-10 minute tutorials\n with real code that cover techniques\n that every Flutter dev needs to know from top to bottom.\n The following videos cover topics\n "}
680{"url": "https://docs.flutter.dev/ui/animations/implicit-animations", "title": "Untitled", "text": "ds to know from top to bottom.\n The following videos cover topics\n that are relevant to implicit animations.\nWatch on YouTube in a new tab: \"Flutter implicit animation basics\"\nWatch on YouTube in a new tab: \"Create custom implicit animations with TweenAnimationBuilder\"\nThe Boring Show\nWatch the Boring Show to follow Google Engineers build apps\n from scratch in Flutter. The following episode covers\n using implicit animations in a"}
681{"url": "https://docs.flutter.dev/ui/animations/implicit-animations", "title": "Untitled", "text": "om scratch in Flutter. The following episode covers\n using implicit animations in a news aggregator app.\nWatch on YouTube in a new tab: \"Adding implicit animations to a news application\"\nWidget of the Week videos\nA weekly series of short animated videos each showing\n the important features of one particular widget.\n In about 60 seconds, you'll see real code for each\n widget with a demo about how it works.\n The f"}
682{"url": "https://docs.flutter.dev/ui/animations/implicit-animations", "title": "Untitled", "text": " real code for each\n widget with a demo about how it works.\n The following Widget of the Week videos cover\n implicitly animated widgets:\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
683{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nWell-designed animations make a UI feel more intuitive,\n contribute to the slick look and feel of a polished app,\n and improve the user experience.\n Flutter's animation support makes it easy to implement a variety of\n animation types. Many widgets, especially Material widgets ,\n come with the standard motion effects defined in their desig"}
684{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "ly Material widgets ,\n come with the standard motion effects defined in their design spec,\n but it's also possible to customize these effects.\nChoosing an approach\nThere are different approaches you can take when creating\n animations in Flutter. Which approach is right for you?\n To help you decide, check out the video, How to choose which Flutter Animation Widget is right for you? (Also published as a companion article .)\nWatch "}
685{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "se which Flutter Animation Widget is right for you? (Also published as a companion article .)\nWatch on YouTube in a new tab: \"How to choose which Flutter animation widget is right for your use case\"\n(To dive deeper into the decision process,\n watch the Animations in Flutter done right video,\n presented at Flutter Europe.)\nAs shown in the video, the following\n decision tree helps you decide what approach\n to use when implementing"}
686{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": " decision tree helps you decide what approach\n to use when implementing a Flutter animation:\nAnimation deep dive\nFor a deeper understanding of just how animations work in Flutter, watch Animation deep dive .\n (Also published as a companion article .)\nWatch on YouTube in a new tab: \"Take a deep dive into Flutter animation\"\nImplicit and explicit animations\nPre-packaged implicit animations\nIf a pre-packaged implicit animation (the easiest animation\n "}
687{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "ns\nPre-packaged implicit animations\nIf a pre-packaged implicit animation (the easiest animation\n to implement) suits your needs, watch Animation basics with implicit animations .\n (Also published as a companion article .)\nWatch on YouTube in a new tab: \"Flutter implicit animation basics\"\nCustom implicit animations\nTo create a custom implicit animation, watch Creating your own custom implicit animations with TweenAnimationBuilder .\n (Also publish"}
688{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "ing your own custom implicit animations with TweenAnimationBuilder .\n (Also published as a companion article .)\nWatch on YouTube in a new tab: \"Create custom implicit animations with TweenAnimationBuilder\"\nBuilt-in explicit animations\nTo create an explicit animation (where you control the animation,\n rather than letting the framework control it), perhaps\n you can use one of the built-in explicit animations classes.\n For more inf"}
689{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": " you can use one of the built-in explicit animations classes.\n For more information, watch Making your first directional animations with\n built-in explicit animations .\n (Also published as a companion article .)\nWatch on YouTube in a new tab: \"Making your first directional animations with built-in explicit animations\"\nExplicit animations\nIf you need to build an explicit animation from scratch, watch Creating custom explicit animations "}
690{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "\nIf you need to build an explicit animation from scratch, watch Creating custom explicit animations with\n AnimatedBuilder and AnimatedWidget .\n (Also published as a companion article .)\nWatch on YouTube in a new tab: \"Creating custom explicit animations with AnimatedBuilder and AnimatedWidget\"\nAnimation types\nGenerally, animations are either tween- or physics-based.\n The following sections explain what these terms mean,\n and p"}
691{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "sed.\n The following sections explain what these terms mean,\n and point you to resources where you can learn more.\nTween animation\nShort for in-betweening . In a tween animation, the beginning\n and ending points are defined, as well as a timeline, and a curve\n that defines the timing and speed of the transition.\n The framework calculates how to transition from the beginning point\n to the end poin"}
692{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "he framework calculates how to transition from the beginning point\n to the end point.\nSee the Animations tutorial , which uses tweens in the examples.\nSee the Animations tutorial , which uses tweens in the examples.\nAlso see the API documentation for Tween , CurveTween , and TweenSequence .\nAlso see the API documentation for Tween , CurveTween , and TweenSequence .\nPhysics-based animation\nIn physics-based animation, motion is modeled to resemble real-world\n beha"}
693{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "nimation\nIn physics-based animation, motion is modeled to resemble real-world\n behavior. When you toss a ball, for example, where and when it lands\n depends on how fast it was tossed and how far it was from the ground.\n Similarly, dropping a ball attached to a spring falls\n (and bounces) differently than dropping a ball attached to a string.\nAnimate a widget using a physics simulation A recipe in the animations section of the Fl"}
694{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "o a string.\nAnimate a widget using a physics simulation A recipe in the animations section of the Flutter cookbook.\nAnimate a widget using a physics simulation A recipe in the animations section of the Flutter cookbook.\nAlso see the API documentation for AnimationController.animateWith and SpringSimulation .\nAlso see the API documentation for AnimationController.animateWith and SpringSimulation .\nCommon animation patterns\nMost UX or motion designers find that certain\n animation "}
695{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "Common animation patterns\nMost UX or motion designers find that certain\n animation patterns are used repeatedly when designing a UI.\n This section lists some of the commonly\n used animation patterns, and tells you where to learn more.\nAnimated list or grid\nThis pattern involves animating the addition or removal of\n elements from a list or grid.\nAnimatedList example This demo, from the Sample app catalog , shows how to\n "}
696{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": " list or grid.\nAnimatedList example This demo, from the Sample app catalog , shows how to\n animate adding an element to a list, or removing a selected element.\n The internal Dart list is synced as the user modifies the list using\n the plus (+) and minus (-) buttons.\nShared element transition\nIn this pattern, the user selects an element—often an\n image—from the page, and the UI animates the selected element\n "}
697{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": " an\n image—from the page, and the UI animates the selected element\n to a new page with more detail. In Flutter, you can easily implement\n shared element transitions between routes (pages)\n using the Hero widget.\nHero animations How to create two styles of Hero animations: The hero flies from one page to another while changing position\n and size. The hero's boundary changes shape, from a circle to a square,"}
698{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "tion\n and size. The hero's boundary changes shape, from a circle to a square,\n as its flies from one page to another.\nHero animations How to create two styles of Hero animations:\nThe hero flies from one page to another while changing position\n and size.\nThe hero's boundary changes shape, from a circle to a square,\n as its flies from one page to another.\nAlso see the API documentation for the Hero , Naviga"}
699{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": " as its flies from one page to another.\nAlso see the API documentation for the Hero , Navigator , and PageRoute classes.\nAlso see the API documentation for the Hero , Navigator , and PageRoute classes.\nStaggered animation\nAnimations that are broken into smaller motions,\n where some of the motion is delayed.\n The smaller animations might be sequential,\n or might partially or completely overlap.\nStaggered Animations\nEssential animation con"}
700{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": " or might partially or completely overlap.\nStaggered Animations\nEssential animation concepts and classes\nThe animation system in Flutter is based on typed Animation objects. Widgets can either incorporate\n these animations in their build functions directly by\n reading their current value and listening to their state\n changes or they can use the animations as the basis of\n more elaborate animations that they pass alo"}
701{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "an use the animations as the basis of\n more elaborate animations that they pass along to\n other widgets.\nAnimation <double>\nIn Flutter, an Animation object knows nothing about what\n is onscreen. An Animation is an abstract class that\n understands its current value and its state (completed or dismissed).\n One of the more commonly used animation types is Animation<double> .\nAn Animation object sequentially generat"}
702{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "e more commonly used animation types is Animation<double> .\nAn Animation object sequentially generates\n interpolated numbers between two values over a certain duration.\n The output of an Animation object might be linear,\n a curve, a step function, or any other mapping you can create.\n Depending on how the Animation object is controlled,\n it could run in reverse, or even switch directions in the\n "}
703{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "olled,\n it could run in reverse, or even switch directions in the\n middle.\nAnimations can also interpolate types other than double, such as Animation<Color> or Animation<Size> .\nAn Animation object has state. Its current value is\n always available in the .value member.\nAn Animation object knows nothing about rendering or build() functions.\nCurvedAnimation\nA CurvedAnimation defines the animation's progress\n as a non-linear curve."}
704{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "nimation\nA CurvedAnimation defines the animation's progress\n as a non-linear curve.\nCurvedAnimation and AnimationController (described in the next sections)\n are both of type Animation<double> , so you can pass them interchangeably.\n The CurvedAnimation wraps the object it's modifying—you\n don't subclass AnimationController to implement a curve.\nYou can use Curves with CurvedAnimation . The Curves class defines\n "}
705{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "lement a curve.\nYou can use Curves with CurvedAnimation . The Curves class defines\n many commonly used curves, or you can create your own. For example:\nIf you want to apply an animation curve to a Tween , consider using CurveTween .\nAnimationController\nAnimationController is a special Animation object that generates a new value whenever the hardware\n is ready for a new frame. By default,\n an AnimationController linearly produces the numbers\n "}
706{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "a new frame. By default,\n an AnimationController linearly produces the numbers\n from 0.0 to 1.0 during a given duration.\n For example, this code creates an Animation object,\n but does not start it running:\nAnimationController derives from Animation<double> , so it can be used\n wherever an Animation object is needed. However, the AnimationController has additional methods to control the animation. For example, yo"}
707{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "d. However, the AnimationController has additional methods to control the animation. For example, you start\n an animation with the .forward() method. The generation of numbers is\n tied to the screen refresh, so typically 60 numbers are generated per\n second. After each number is generated, each Animation object calls the\n attached Listener objects. To create a custom display list for each\n child, see RepaintBoun"}
708{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": " Listener objects. To create a custom display list for each\n child, see RepaintBoundary .\nWhen creating an AnimationController , you pass it a vsync argument.\n The presence of vsync prevents offscreen animations from consuming\n unnecessary resources.\n You can use your stateful object as the vsync by adding SingleTickerProviderStateMixin to the class definition.\n You can see an example of this in animate1 on GitH"}
709{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "eMixin to the class definition.\n You can see an example of this in animate1 on GitHub.\nTween\nBy default, the AnimationController object ranges from 0.0 to 1.0.\n If you need a different range or a different data type, you can use a Tween to configure an animation to interpolate to a\n different range or data type. For example, the\n following Tween goes from -200.0 to 0.0:\nA Tween is a stateless object that takes only begin and end"}
710{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "following Tween goes from -200.0 to 0.0:\nA Tween is a stateless object that takes only begin and end .\n The sole job of a Tween is to define a mapping from an\n input range to an output range. The input range is commonly\n 0.0 to 1.0, but that's not a requirement.\nA Tween inherits from Animatable<T> , not from Animation<T> .\n An Animatable , like Animation , doesn't have to output double.\n For example, ColorTween "}
711{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "matable , like Animation , doesn't have to output double.\n For example, ColorTween specifies a progression between two colors.\nA Tween object doesn't store any state. Instead, it provides the evaluate(Animation<double> animation) method that uses the transform function to map the current value of the animation\n (between 0.0 and 1.0), to the actual animation value.\nThe current value of the Animation object can be found in the .value method. The evaluate function "}
712{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "\nThe current value of the Animation object can be found in the .value method. The evaluate function also performs some housekeeping,\n such as ensuring that begin and end are returned when the\n animation values are 0.0 and 1.0, respectively.\nTween.animate\nTo use a Tween object, call animate() on the Tween ,\n passing in the controller object. For example,\n the following code generates the\n integer values from 0 to"}
713{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "ample,\n the following code generates the\n integer values from 0 to 255 over the course of 500 ms.\nThe following example shows a controller, a curve, and a Tween :\nAnimation notifications\nAn Animation object can have Listener s and StatusListener s,\n defined with addListener() and addStatusListener() .\n A Listener is called whenever the value of the animation changes.\n The most common behavior of a Listener is to"}
714{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "r the value of the animation changes.\n The most common behavior of a Listener is to call setState() to cause a rebuild. A StatusListener is called when an animation begins,\n ends, moves forward, or moves reverse, as defined by AnimationStatus .\nCodelabs, tutorials, and articles\nThe following resources are a good place to start learning\n the Flutter animation framework. Each of these documents\n shows how to write animation code.\n"}
715{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "r animation framework. Each of these documents\n shows how to write animation code.\nAnimations in Flutter codelab Learn about implicit and explicit animations\n while building a multiple-choice quiz game.\nAnimations in Flutter codelab Learn about implicit and explicit animations\n while building a multiple-choice quiz game.\nAnimations tutorial Explains the fundamental classes in the Flutter animation package\n (controlle"}
716{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "l Explains the fundamental classes in the Flutter animation package\n (controllers, Animatable , curves, listeners, builders),\n as it guides you through a progression of tween animations using\n different aspects of the animation APIs. This tutorial shows\n how to create your own custom explicit animations.\nAnimations tutorial Explains the fundamental classes in the Flutter animation package\n (c"}
717{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": " tutorial Explains the fundamental classes in the Flutter animation package\n (controllers, Animatable , curves, listeners, builders),\n as it guides you through a progression of tween animations using\n different aspects of the animation APIs. This tutorial shows\n how to create your own custom explicit animations.\nZero to One with Flutter, part 1 and part 2 Medium articles showing how to create an animated chart us"}
718{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "ro to One with Flutter, part 1 and part 2 Medium articles showing how to create an animated chart using tweening.\nZero to One with Flutter, part 1 and part 2 Medium articles showing how to create an animated chart using tweening.\nCasual games toolkit A toolkit with game templates that contain examples of how to use Flutter\n animations.\nCasual games toolkit A toolkit with game templates that contain examples of how to use Flutter\n animations.\nOther resour"}
719{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "templates that contain examples of how to use Flutter\n animations.\nOther resources\nLearn more about Flutter animations at the following links:\nThere are several animations packages available on pub.dev that contain\n pre-built animations for commonly used patterns, including: Container transforms, shared axis transitions,\n fade through transitions, and fade transitions.\nThere are several animations packages available on pub.dev that c"}
720{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "transitions, and fade transitions.\nThere are several animations packages available on pub.dev that contain\n pre-built animations for commonly used patterns, including: Container transforms, shared axis transitions,\n fade through transitions, and fade transitions.\nAnimation samples from the Sample app catalog .\nAnimation samples from the Sample app catalog .\nAnimation recipes from the Flutter cookbook.\nAnimation recipes from the Flutter cookbook.\nAnimatio"}
721{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": ".\nAnimation recipes from the Flutter cookbook.\nAnimation recipes from the Flutter cookbook.\nAnimation videos from the Flutter YouTube channel.\nAnimation videos from the Flutter YouTube channel.\nAnimations: overview A look at some of the major classes in the\n animations library, and Flutter's animation architecture.\nAnimations: overview A look at some of the major classes in the\n animations library, and Flutter's animation architecture.\nAnimation and moti"}
722{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "e\n animations library, and Flutter's animation architecture.\nAnimation and motion widgets A catalog of some of the animation widgets\n provided in the Flutter APIs.\nAnimation and motion widgets A catalog of some of the animation widgets\n provided in the Flutter APIs.\nThe animation library in the Flutter API documentation The animation API for the Flutter framework. This link\n takes you to a technical overview page"}
723{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "PI for the Flutter framework. This link\n takes you to a technical overview page for the library.\nThe animation library in the Flutter API documentation The animation API for the Flutter framework. This link\n takes you to a technical overview page for the library.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
724{"url": "https://docs.flutter.dev/ui/animations", "title": "Untitled", "text": "ated on 2026-05-05. View source or report an issue ."}
725{"url": "https://docs.flutter.dev/ui/accessibility/assistive-technologies", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nSummary\nAssistive technologies are essential for making digital content accessible to\n individuals with disabilities. This document provides an overview of two key\n categories of assistive technologies relevant to Flutter development: screen\n readers for users with visual impairments and mobility support tools for\n those with motor limitations. By underst"}
726{"url": "https://docs.flutter.dev/ui/accessibility/assistive-technologies", "title": "Untitled", "text": "mpairments and mobility support tools for\n those with motor limitations. By understanding and testing with these\n technologies, you can ensure your Flutter application provides a more inclusive\n and user-friendly experience for everyone.\nScreen readers\nFor mobile, screen readers ( TalkBack , VoiceOver )\n enable visually impaired users to get spoken feedback about\n the contents of the screen and interact with the"}
727{"url": "https://docs.flutter.dev/ui/accessibility/assistive-technologies", "title": "Untitled", "text": "sers to get spoken feedback about\n the contents of the screen and interact with the UI by using\n gestures on mobile and keyboard shortcuts on desktop.\n Turn on VoiceOver or TalkBack on your mobile device and\n navigate around your app.\nTo turn on the screen reader on your device, complete the following steps:\nAndroid\niOS or iPadOS\nBrowsers\nDesktop\nOn your device, open Settings .\nSelect Accessibility and then TalkBack .\nTurn 'Use "}
728{"url": "https://docs.flutter.dev/ui/accessibility/assistive-technologies", "title": "Untitled", "text": "Browsers\nDesktop\nOn your device, open Settings .\nSelect Accessibility and then TalkBack .\nTurn 'Use TalkBack' on or off.\nSelect Ok.\nTo learn how to find and customize Android's\n accessibility features, view the following video.\nOn your device, open Settings > Accessibility > VoiceOver\nTurn the VoiceOver setting on or off\nTo learn how to find and customize iOS\n accessibility features, view the following video.\nFor web, the following screen readers are"}
729{"url": "https://docs.flutter.dev/ui/accessibility/assistive-technologies", "title": "Untitled", "text": " accessibility features, view the following video.\nFor web, the following screen readers are currently supported:\nMobile browsers:\niOS - VoiceOver\nAndroid - TalkBack\nDesktop browsers:\nmacOS - VoiceOver\nWindows - JAWs & NVDA\nScreen readers users on web must toggle the\n \"Enable accessibility\" button to build the semantics tree.\n Users can skip this step if you programmatically auto-enable\n accessibility for your app using"}
730{"url": "https://docs.flutter.dev/ui/accessibility/assistive-technologies", "title": "Untitled", "text": "is step if you programmatically auto-enable\n accessibility for your app using this API:\nWindows comes with a screen reader called Narrator\n but some developers recommend using the more popular\n NVDA screen reader. To learn about using NVDA to test\n Windows apps, check out Screen Readers 101 For Front-End Developers (Windows) .\nOn a Mac, you can use the desktop version of VoiceOver,\n "}
731{"url": "https://docs.flutter.dev/ui/accessibility/assistive-technologies", "title": "Untitled", "text": "velopers (Windows) .\nOn a Mac, you can use the desktop version of VoiceOver,\n which is included in macOS.\nOn Linux, a popular screen reader is called Orca.\n It comes pre-installed with some distributions\n and is available on package repositories such as apt .\n To learn about using Orca, check out Getting started with Orca screen reader on Gnome desktop .\nCheck out the following video demo to see how to\n "}
732{"url": "https://docs.flutter.dev/ui/accessibility/assistive-technologies", "title": "Untitled", "text": "arted with Orca screen reader on Gnome desktop .\nCheck out the following video demo to see how to\n use VoiceOver with the now-archived Flutter Gallery web app.\nFlutter's standard widgets generate an accessibility tree automatically.\n However, if your app needs something different,\n it can be customized using the Semantics widget .\nWhen there is text in your app that should be voiced\n with a specific voice, inform the screen read"}
733{"url": "https://docs.flutter.dev/ui/accessibility/assistive-technologies", "title": "Untitled", "text": "xt in your app that should be voiced\n with a specific voice, inform the screen reader\n which voice to use by calling TextSpan.locale . MaterialApp.locale and Localizations.override will affect screen reader voices starting from flutter 3.38 release.\n Usually, the screen reader uses the system voice\n except where you explicitly set it with TextSpan.locale .\nMobility support\nFor users with limited dexterity or hand strength, mobil"}
734{"url": "https://docs.flutter.dev/ui/accessibility/assistive-technologies", "title": "Untitled", "text": " it with TextSpan.locale .\nMobility support\nFor users with limited dexterity or hand strength, mobility support features\n can be helpful. Both Android and iOS offer a range of tools designed to make\n navigation and control easier.\n These features allow users to operate their devices through external switches,\n voice commands, or simplified on-screen menus.\nAndroid provides Switch Access, Voice Access and Accessibility Menu,\n "}
735{"url": "https://docs.flutter.dev/ui/accessibility/assistive-technologies", "title": "Untitled", "text": "implified on-screen menus.\nAndroid provides Switch Access, Voice Access and Accessibility Menu,\n while iOS offers Switch Control, Voice Control, and AssistiveTouch.\n Understanding these tools helps in creating\n apps that are usable by people with diverse physical abilities.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
736{"url": "https://docs.flutter.dev/ui/accessibility/assistive-technologies", "title": "Untitled", "text": ".44.0. Page last updated on 2026-05-05. View source or report an issue ."}
737{"url": "https://docs.flutter.dev/ui/accessibility/web-accessibility", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nBackground\nFlutter supports web accessibility by translating its internal\n Semantics tree into an accessible HTML DOM structure that\n screen readers can understand.\n Since Flutter renders its UI on a single canvas, it needs a special layer\n to expose the UI's meaning and structure to web browsers.\nOpt-in web accessibility\nInvisible button\nFor performance "}
738{"url": "https://docs.flutter.dev/ui/accessibility/web-accessibility", "title": "Untitled", "text": "'s meaning and structure to web browsers.\nOpt-in web accessibility\nInvisible button\nFor performance reasons, Flutter's web accessibility is not on by default.\n To turn on accessibility, the user needs to press an invisible button with aria-label=\"Enable accessibility\" .\n After pressing the button, the DOM tree will reflect all accessibility\n information for the widgets.\nTurn on accessibility mode in code\nAn alternative approach is to turn on acc"}
739{"url": "https://docs.flutter.dev/ui/accessibility/web-accessibility", "title": "Untitled", "text": "mation for the widgets.\nTurn on accessibility mode in code\nAn alternative approach is to turn on accessibility mode\n by adding the following code when running an app.\nEnhancing Accessibility with Semantic Roles\nWhat are Semantic Roles?\nSemantic roles define the purpose of a UI element, helping screen readers\n and other assistive tools interpret and present your application effectively\n to users. For example, a role can indicate if a widget is a "}
740{"url": "https://docs.flutter.dev/ui/accessibility/web-accessibility", "title": "Untitled", "text": "plication effectively\n to users. For example, a role can indicate if a widget is a button, a link,\n to users. For example, a role can indicate whether a widget is a button, a link,\n a heading, a slider, or part of a table.\nWhile Flutter's standard widgets often provide these semantics automatically,\n a custom component without a clearly defined role can be incomprehensible\n to a screen reader user.\nBy assigning "}
741{"url": "https://docs.flutter.dev/ui/accessibility/web-accessibility", "title": "Untitled", "text": "learly defined role can be incomprehensible\n to a screen reader user.\nBy assigning appropriate roles, you ensure that:\nScreen readers can announce the type and purpose of elements correctly.\nUsers can navigate your application more effectively using assistive technologies.\nYour application adheres to web accessibility standards, improving usability.\nUsing SemanticsRole in Flutter for web\nFlutter provides the Semantics widget with the SemanticsRole enum to allow developers to ass"}
742{"url": "https://docs.flutter.dev/ui/accessibility/web-accessibility", "title": "Untitled", "text": "for web\nFlutter provides the Semantics widget with the SemanticsRole enum to allow developers to assign specific roles to their widgets. When your\n Flutter web app is rendered, these Flutter-specific roles are translated into\n corresponding ARIA roles in the web page's HTML structure.\n1. Automatic Semantics from Standard Widgets\nMany standard Flutter widgets, like TabBar , MenuAnchor , and Table ,\n automatically include semantic information alon"}
743{"url": "https://docs.flutter.dev/ui/accessibility/web-accessibility", "title": "Untitled", "text": " TabBar , MenuAnchor , and Table ,\n automatically include semantic information along with their roles.\n Whenever possible, prefer using these standard widgets\n as they handle many accessibility aspects out-of-the-box.\n2. Explicitly adding or overriding roles\nFor custom components or when the default semantics aren't sufficient,\n use the Semantics widget to define the role:\nHere's an example of how you might explicitly define a l"}
744{"url": "https://docs.flutter.dev/ui/accessibility/web-accessibility", "title": "Untitled", "text": "se the Semantics widget to define the role:\nHere's an example of how you might explicitly define a list and its items:\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
745{"url": "https://docs.flutter.dev/ui/accessibility/accessibility-testing", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nAccessibility regulations\nTo ensure your app is accessible, check it against public standards like the Web Content Accessibility Guidelines (WCAG) 2 , the EN 301 549 ,\n and use resources like the Voluntary Product Accessibility Template (VPAT) to self-assess your product. For more details on these\n regulations, check out the main accessibility page .\nInspecting accessibility support\nWe re"}
746{"url": "https://docs.flutter.dev/ui/accessibility/accessibility-testing", "title": "Untitled", "text": " regulations, check out the main accessibility page .\nInspecting accessibility support\nWe recommend using automated accessibility scanners to test the following:\nFor Android: Install the Accessibility Scanner for Android Enable the Accessibility Scanner from Android Settings > Accessibility >\n Accessibility Scanner > On . Navigate to the Accessibility Scanner 'checkbox'\n icon button to initiate a scan.\nFor Android:\nInstall the Accessibility"}
747{"url": "https://docs.flutter.dev/ui/accessibility/accessibility-testing", "title": "Untitled", "text": "kbox'\n icon button to initiate a scan.\nFor Android:\nInstall the Accessibility Scanner for Android\nEnable the Accessibility Scanner from Android Settings > Accessibility >\n Accessibility Scanner > On .\nNavigate to the Accessibility Scanner 'checkbox'\n icon button to initiate a scan.\nFor iOS: Open the iOS folder of your Flutter app in Xcode. Select a Simulator as the target, and click the Run button. In Xcode, select Xcode > Op"}
748{"url": "https://docs.flutter.dev/ui/accessibility/accessibility-testing", "title": "Untitled", "text": "pp in Xcode. Select a Simulator as the target, and click the Run button. In Xcode, select Xcode > Open Developer Tools > Accessibility Inspector . In the Accessibility Inspector,\n select Inspection > Enable Point to Inspect ,\n and then select the various user interface elements in your running\n Flutter app to inspect their accessibility attributes. In the Accessibility Inspector,\n select Audit in the tool"}
749{"url": "https://docs.flutter.dev/ui/accessibility/accessibility-testing", "title": "Untitled", "text": "ibility attributes. In the Accessibility Inspector,\n select Audit in the toolbar, and then\n select Run Audit to get a report of potential issues.\nFor iOS:\nOpen the iOS folder of your Flutter app in Xcode.\nSelect a Simulator as the target, and click the Run button.\nIn Xcode, select Xcode > Open Developer Tools > Accessibility Inspector .\nIn the Accessibility Inspector,\n select Inspection > Enable Point to Inspect ,\n "}
750{"url": "https://docs.flutter.dev/ui/accessibility/accessibility-testing", "title": "Untitled", "text": "ility Inspector,\n select Inspection > Enable Point to Inspect ,\n and then select the various user interface elements in your running\n Flutter app to inspect their accessibility attributes.\nIn the Accessibility Inspector,\n select Audit in the toolbar, and then\n select Run Audit to get a report of potential issues.\nFor web: Open Chrome DevTools (or similar tools in other browsers). In"}
751{"url": "https://docs.flutter.dev/ui/accessibility/accessibility-testing", "title": "Untitled", "text": "a report of potential issues.\nFor web: Open Chrome DevTools (or similar tools in other browsers). Inspect the HTML tree under semantics host, containing the ARIA\n attributes generated by Flutter. In Chrome, the \"Elements\" tab has an \"Accessibility\" sub-tab\n that can be used to inspect the data exported to semantics tree.\nFor web:\nOpen Chrome DevTools (or similar tools in other browsers).\nInspect the HTML tree under semantics host, containing the ARIA"}
752{"url": "https://docs.flutter.dev/ui/accessibility/accessibility-testing", "title": "Untitled", "text": "or similar tools in other browsers).\nInspect the HTML tree under semantics host, containing the ARIA\n attributes generated by Flutter.\nIn Chrome, the \"Elements\" tab has an \"Accessibility\" sub-tab\n that can be used to inspect the data exported to semantics tree.\nTesting accessibility on mobile\nTest your app using Flutter's Accessibility Guideline API .\n This API checks if your app's UI meets Flutter's accessibility recommendations.\n "}
753{"url": "https://docs.flutter.dev/ui/accessibility/accessibility-testing", "title": "Untitled", "text": " This API checks if your app's UI meets Flutter's accessibility recommendations.\n These cover recommendations for text contrast, target size, and target labels.\nThe following snippet shows how to use the Guideline API on\n a sample widget named AccessibleApp :\nTo try these tests out, run them on\n a new app created with flutter create .\n Each button on that app's main screen serves as a tappable target\n "}
754{"url": "https://docs.flutter.dev/ui/accessibility/accessibility-testing", "title": "Untitled", "text": "te .\n Each button on that app's main screen serves as a tappable target\n with text rendered in an 18-point font.\nYou can add Guideline API tests alongside other widget tests ,\n or in a separate file, such as test/a11y_test.dart in this example.\nTesting accessibility on the web\nYou can debug accessibility by visualizing the semantic nodes created for your web app\n using the following command line flag in profile and release modes"}
755{"url": "https://docs.flutter.dev/ui/accessibility/accessibility-testing", "title": "Untitled", "text": "or your web app\n using the following command line flag in profile and release modes:\nWith the flag activated, the semantic nodes appear on top of the widgets;\n you can verify that the semantic elements are placed where they should be.\n If the semantic nodes are incorrectly placed, please file a bug report .\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an i"}
756{"url": "https://docs.flutter.dev/ui/accessibility/accessibility-testing", "title": "Untitled", "text": "on on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
757{"url": "https://docs.flutter.dev/ui/accessibility", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nBackground\nEnsuring that apps are accessible to a broad range of users is an essential\n part of building a high-quality app. Applications that are poorly\n designed create barriers to people of all ages. The UN Convention on\n the Rights of Persons with Disabilities states the moral and legal\n imperative to ensure universal access to information systems; "}
758{"url": "https://docs.flutter.dev/ui/accessibility", "title": "Untitled", "text": "the moral and legal\n imperative to ensure universal access to information systems; countries\n around the world enforce accessibility as a requirement; and companies\n recognize the business advantages of maximizing access to their services.\nWe strongly encourage you to include an accessibility checklist\n as a key criteria before shipping your app. Flutter is committed to\n supporting developers in making their app"}
759{"url": "https://docs.flutter.dev/ui/accessibility", "title": "Untitled", "text": "ipping your app. Flutter is committed to\n supporting developers in making their apps more accessible, and includes\n first-class framework support for accessibility in addition to that\n provided by the underlying operating system, including:\nUI Design and styling\nAssistive Technologies (Screen Reader) supports\nAccessibility regulations\nAccessibility standards and regulations help ensure that products are\n accessible to people wit"}
760{"url": "https://docs.flutter.dev/ui/accessibility", "title": "Untitled", "text": "y standards and regulations help ensure that products are\n accessible to people with disabilities. Many of these have been enacted into\n laws and policies, making them requirements for products and services.\nWCAG 2 : Web Content Accessibility Guidelines (WCAG) 2 is an\n internationally recognized standard for making web content more accessible\n to people with disabilities. It is a stable, technical standard developed\n "}
761{"url": "https://docs.flutter.dev/ui/accessibility", "title": "Untitled", "text": " to people with disabilities. It is a stable, technical standard developed\n by the World Wide Web Consortium (W3C).\nWCAG 2 : Web Content Accessibility Guidelines (WCAG) 2 is an\n internationally recognized standard for making web content more accessible\n to people with disabilities. It is a stable, technical standard developed\n by the World Wide Web Consortium (W3C).\nEN 301 549 : EN 301 549 is"}
762{"url": "https://docs.flutter.dev/ui/accessibility", "title": "Untitled", "text": "d developed\n by the World Wide Web Consortium (W3C).\nEN 301 549 : EN 301 549 is the European harmonized standard for\n accessibility requirements for Information and Communication Technology (ICT)\n products and services.\nEN 301 549 : EN 301 549 is the European harmonized standard for\n accessibility requirements for Information and Communication Technology (ICT)\n products and services.\nVPAT : T"}
763{"url": "https://docs.flutter.dev/ui/accessibility", "title": "Untitled", "text": "Information and Communication Technology (ICT)\n products and services.\nVPAT : The Voluntary Product Accessibility Template (VPAT) is a\n free template that translates accessibility requirements and standards into\n actionable testing criteria for products and services.\nVPAT : The Voluntary Product Accessibility Template (VPAT) is a\n free template that translates accessibility requirements and standards into\n "}
764{"url": "https://docs.flutter.dev/ui/accessibility", "title": "Untitled", "text": " free template that translates accessibility requirements and standards into\n actionable testing criteria for products and services.\nLaws around the world require digital content and services to be accessible\n to people with disabilities.\n In the U.S., the Americans with Disabilities Act (ADA) prohibits\n discrimination in public accommodations. Section 508 of the Rehabilitation Act requires federal agencies"}
765{"url": "https://docs.flutter.dev/ui/accessibility", "title": "Untitled", "text": "rimination in public accommodations. Section 508 of the Rehabilitation Act requires federal agencies and their\n contractors to meet WCAG standards for all ICT.\nIn the EU, the European Accessibility Act (EAA) requires a wide range of\n public and private sector services to be accessible, primarily using\n the EN 301 549 as its technical basis.\nBuilding with accessibility in mind\nEnsuring that your app can be used by everyone means building accessib"}
766{"url": "https://docs.flutter.dev/ui/accessibility", "title": "Untitled", "text": "ng with accessibility in mind\nEnsuring that your app can be used by everyone means building accessibility\n into it from the start. For some apps, that's easier said than done.\n In the video below, two of our engineers take a mobile app from a dire\n accessibility state to one that takes advantage of Flutter's built-in\n widgets to offer a dramatically more accessible experience.\nAccessibility release checklist\nHere is a non-exhaus"}
767{"url": "https://docs.flutter.dev/ui/accessibility", "title": "Untitled", "text": "ffer a dramatically more accessible experience.\nAccessibility release checklist\nHere is a non-exhaustive list of things to consider as you prepare your\n app for release.\nActive interactions . Ensure that all active interactions do\n something. Any button that can\n be pushed should do something when pushed. For example, if you have a\n no-op callback for an onPressed event, change it to show a SnackBar on the screen explainin"}
768{"url": "https://docs.flutter.dev/ui/accessibility", "title": "Untitled", "text": " no-op callback for an onPressed event, change it to show a SnackBar on the screen explaining which control you just pushed.\nScreen reader testing . The screen reader should be able to\n describe all controls on the page when you tap on them, and the\n descriptions should be intelligible. Test your app with TalkBack (Android) and VoiceOver (iOS).\nContrast ratios . We encourage you to have a contrast ratio of at\n least 4.5:1 between c"}
769{"url": "https://docs.flutter.dev/ui/accessibility", "title": "Untitled", "text": "t ratios . We encourage you to have a contrast ratio of at\n least 4.5:1 between controls or text and the background, with the\n exception of disabled components. Images should also be vetted for\n sufficient contrast.\nContext switching . Nothing should change the user's context\n automatically while typing in information. Generally, the widgets\n should avoid changing the user's context without some sort o"}
770{"url": "https://docs.flutter.dev/ui/accessibility", "title": "Untitled", "text": "erally, the widgets\n should avoid changing the user's context without some sort of\n confirmation action.\nTappable targets . All tappable targets should be at least 48x48 pixels.\nErrors . Important actions should be able to be undone. In fields\n that show errors, suggest a correction if possible.\nColor vision deficiency testing . Controls should be usable and\n legible in colorblind and grayscale modes.\nScale factors . The"}
771{"url": "https://docs.flutter.dev/ui/accessibility", "title": "Untitled", "text": "uld be usable and\n legible in colorblind and grayscale modes.\nScale factors . The UI should remain legible and usable at very\n large scale factors for text size and display scaling.\nLearn more\nTo learn more about Flutter and accessibility, check out\n the following articles written by community members:\nA deep dive into Flutter's accessibility widgets\nFlutter: Crafting a great experience for screen readers\nUnless stated otherwise, the documen"}
772{"url": "https://docs.flutter.dev/ui/accessibility", "title": "Untitled", "text": "widgets\nFlutter: Crafting a great experience for screen readers\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
773{"url": "https://docs.flutter.dev/ui/accessibility/ui-design-and-styling", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nTo create an accessible app, design your UI with accessibility in mind.\n This page covers key aspects of accessible UI design and styling.\nLarge fonts\nBoth Android and iOS contain system settings to configure the desired font\n sizes used by apps. Flutter text widgets respect this OS setting when\n determining font sizes.\nFont sizes are calculated automatically by Flutter b"}
774{"url": "https://docs.flutter.dev/ui/accessibility/ui-design-and-styling", "title": "Untitled", "text": " when\n determining font sizes.\nFont sizes are calculated automatically by Flutter based on the OS setting.\n However, as a developer you should make sure your layout has enough room to\n render all its contents when the font sizes are increased.\n For example, you can test all parts of your app on a small-screen\n device configured to use the largest font setting.\nTo adjust font sizes: on iOS, go to\n "}
775{"url": "https://docs.flutter.dev/ui/accessibility/ui-design-and-styling", "title": "Untitled", "text": "ice configured to use the largest font setting.\nTo adjust font sizes: on iOS, go to\n Settings > Accessibility > Display & Text Size;\n on Android, go to Settings > Font size.\nExample\nThe following two screenshots show the standard Flutter app\n template rendered with the default iOS font setting,\n and with the largest font setting selected in iOS accessibility settings.\nDefault font setting\nLargest accessibility font setting\nSuffi"}
776{"url": "https://docs.flutter.dev/ui/accessibility/ui-design-and-styling", "title": "Untitled", "text": "elected in iOS accessibility settings.\nDefault font setting\nLargest accessibility font setting\nSufficient contrast\nSufficient color contrast makes text and images easier to read.\n Along with benefitting users with various visual impairments,\n sufficient color contrast helps all users when viewing an interface\n on devices in extreme lighting conditions,\n such as when exposed to direct sunlight or on a display with low\n "}
777{"url": "https://docs.flutter.dev/ui/accessibility/ui-design-and-styling", "title": "Untitled", "text": "ions,\n such as when exposed to direct sunlight or on a display with low\n brightness.\nThe W3C recommends :\nAt least 4.5:1 for small text (below 18 point regular or 14 point bold)\nAt least 3.0:1 for large text (18 point and above regular or 14 point and\n above bold)\nYou can test contrast using Flutter's Accessibility Guideline API .\n For more details on testing, check out the accessibility testing page .\nTap target size\nControls"}
778{"url": "https://docs.flutter.dev/ui/accessibility/ui-design-and-styling", "title": "Untitled", "text": " For more details on testing, check out the accessibility testing page .\nTap target size\nControls that are too small are hard for many people to interact with and select.\n Ensure that interactive elements have a large enough tap target to be easily\n pressed by users.\nBoth Android and iOS recommend a minimum tap target size of 48x48 dp and 44x44 pts respectively.\nThe W3C recommends a minimum target size of 44 by 44 CSS pixels.\nYou can test tap target size usin"}
779{"url": "https://docs.flutter.dev/ui/accessibility/ui-design-and-styling", "title": "Untitled", "text": ".\nThe W3C recommends a minimum target size of 44 by 44 CSS pixels.\nYou can test tap target size using Flutter's Accessibility Guideline API .\n For more details on testing, check out the accessibility testing page .\nOther accessibility features\nYou can check the AccessibilityFeatures class for additional\n accessibility features that may be enabled by the platform,\n such as bold text, high contrast, and inverted colors.\nUnless stated otherwise, th"}
780{"url": "https://docs.flutter.dev/ui/accessibility/ui-design-and-styling", "title": "Untitled", "text": " such as bold text, high contrast, and inverted colors.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
781{"url": "https://docs.flutter.dev/ui/widgets", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nCreate beautiful apps faster with Flutter's collection of visual, structural,\n platform, and interactive widgets. In addition to browsing widgets by category,\n you can also see all the widgets in the widget index .\nDesign systems\nFlutter ships with two design systems as part of the SDK.\nYou can find many more design systems created by the Flutter community\n on pub.dev , t"}
782{"url": "https://docs.flutter.dev/ui/widgets", "title": "Untitled", "text": " can find many more design systems created by the Flutter community\n on pub.dev , the package repository for Dart and Flutter.\n For example, the Windows-inspired fluent_ui ,\n macOS-inspired macos_ui ,\n and the Ubuntu-inspired yaru widgets.\nBase widgets\nBase widgets support a range of common rendering options\n like input, layout, and text.\nMake your app accessible.\nBring animations to your app.\nManage assets, dis"}
783{"url": "https://docs.flutter.dev/ui/widgets", "title": "Untitled", "text": " input, layout, and text.\nMake your app accessible.\nBring animations to your app.\nManage assets, display images, and show icons.\nWidgets supporting async patterns in your Flutter apps.\nWidgets to know before building your first Flutter app.\nTake user input in addition to input widgets in Material components and Cupertino.\nRespond to touch events and route users to different views.\nArrange other widgets columns, rows, grids, and many other layouts.\nThese widgets apply visual effects to the childr"}
784{"url": "https://docs.flutter.dev/ui/widgets", "title": "Untitled", "text": "dgets columns, rows, grids, and many other layouts.\nThese widgets apply visual effects to the children without changing their layout, size, or position.\nScroll multiple widgets as children of the parent.\nManage the theme of your app, make your app responsive to screen sizes, or add padding.\nDisplay and style text.\nWidget of the Week\n100+ short, 1-minute explainer videos to\n help you quickly get started with Flutter widgets.\nWatch more widget of the week videos\nUnless stated othe"}
785{"url": "https://docs.flutter.dev/ui/widgets", "title": "Untitled", "text": "ou quickly get started with Flutter widgets.\nWatch more widget of the week videos\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
786{"url": "https://docs.flutter.dev/ui/design/cupertino", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nThe Flutter Cupertino library is a collection\n of widgets that implement Apple's iOS design language\n for Flutter apps. The widgets have a similar look\n and feel to iOS, including rounded corners, gradients,\n and minimalistic design.\n They also include iOS interactions and animations.\nThe following 15-minute video provides a high-level\n "}
787{"url": "https://docs.flutter.dev/ui/design/cupertino", "title": "Untitled", "text": "also include iOS interactions and animations.\nThe following 15-minute video provides a high-level\n glimpse of the Cupertino package:\nWatch on YouTube in a new tab: \"Flutter's Cupertino Package\"\nTo see some Cupertino widgets in action, the following videos from the\n Widget of the Week series cover a few of them.\nMore information\nTo learn more about using the Cupertino\n package with Flutter,\n check out the following resources:\nThe"}
788{"url": "https://docs.flutter.dev/ui/design/cupertino", "title": "Untitled", "text": "ino\n package with Flutter,\n check out the following resources:\nThe (mostly visual) Cupertino widget catalog on doc.flutter.dev\nThe Cupertino library page in the API docs\nThe Cupertino API examples on the flutter/flutter\n repo. ( Instructions ) For example,\n to run CupertinoSwitch :\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue "}
789{"url": "https://docs.flutter.dev/ui/design/cupertino", "title": "Untitled", "text": " this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
790{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nCustom shaders can be used to provide rich graphical effects\n beyond those provided by the Flutter SDK.\n A shader is a program authored in a small,\n Dart-like language, known as GLSL,\n and executed on the user's GPU.\nCustom shaders are added to a Flutter project\n by listing them in the pubspec.yaml file,\n and obtained usi"}
791{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "oject\n by listing them in the pubspec.yaml file,\n and obtained using the FragmentProgram API.\nAdding shaders to an application\nShaders, in the form of GLSL files with the .frag extension,\n must be declared in the shaders section of your project's pubspec.yaml file.\n The Flutter command-line tool compiles the shader\n to its appropriate backend format,\n and generates its necessary runtime metadata"}
792{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": " to its appropriate backend format,\n and generates its necessary runtime metadata.\n The compiled shader is then included in the application just like an asset.\nWhen running in debug mode,\n changes to a shader program trigger recompilation\n and update the shader during hot reload or hot restart.\nShaders from packages are added to a project\n with packages/$pkgname prefixed to the shader program's name\n "}
793{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": " a project\n with packages/$pkgname prefixed to the shader program's name\n (where $pkgname is the name of the package).\nLoading shaders at runtime\nTo load a shader into a FragmentProgram object at runtime,\n use the FragmentProgram.fromAsset constructor.\n The asset's name is the same as the path to the shader\n given in the pubspec.yaml file.\nThe FragmentProgram object can be used to create\n one or"}
794{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": " in the pubspec.yaml file.\nThe FragmentProgram object can be used to create\n one or more FragmentShader instances.\n A FragmentShader object represents a fragment program\n along with a particular set of uniforms (configuration parameters).\n The available uniforms depends on how the shader was defined.\nCanvas API\nFragment shaders can be used with most Canvas APIs\n by setting Paint.shader .\n For ex"}
795{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "n be used with most Canvas APIs\n by setting Paint.shader .\n For example, when using Canvas.drawRect the shader is evaluated for all fragments within the rectangle.\n For an API like Canvas.drawPath with a stroked path,\n the shader is evaluated for all fragments within the stroked line.\n Some APIs, such as Canvas.drawImage , ignore the value of the shader.\nImageFilter API\nFragment shaders can also be used with the"}
796{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "awImage , ignore the value of the shader.\nImageFilter API\nFragment shaders can also be used with the ImageFilter API.\n This allows using custom fragment shaders with the ImageFiltered class or the BackdropFilter class\n to apply shaders to already rendered content. ImageFilter provides a constructor, ImageFilter.shader ,\n for creating an ImageFilter with a custom fragment shader.\nWhen using ImageFilter with BackdropFilter , a ClipRect can be\n "}
797{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "r with a custom fragment shader.\nWhen using ImageFilter with BackdropFilter , a ClipRect can be\n used to limit the area that is affected by the ImageFilter . Without a ClipRect the BackdropFilter will be applied to the whole screen.\nImageFilter fragment shaders receive some uniforms automatically from the\n engine. The sampler2D value at index 0 is set to the filter input image, and\n the float values at indices 0 and 1 are set to the image's widt"}
798{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "r input image, and\n the float values at indices 0 and 1 are set to the image's width and height.\n Your shader must specify this constructor to accept these values (for example, a sampler2D and a vec2 ), but you should not set them from your Dart code.\nWhen targeting OpenGLES the y-coordinates of the texture will be flipped so the\n fragment shader should un-flip the UVs when sampling from textures provided by\n the engine.\nAuthori"}
799{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "should un-flip the UVs when sampling from textures provided by\n the engine.\nAuthoring shaders\nFragment shaders are authored as GLSL source files.\n By convention, these files have the .frag extension.\n (Flutter doesn't support vertex shaders,\n which would have the .vert extension.)\nAny GLSL version from 460 down to 100 is supported,\n though some available features are restricted.\n The rest of the"}
800{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": ",\n though some available features are restricted.\n The rest of the examples in this document use version 460 core .\nShaders are subject to the following limitations\n when used with Flutter:\nUBOs and SSBOs aren't supported\nsampler2D is the only supported sampler type\nOnly the two-argument version of texture (sampler and uv) is supported\nNo additional varying inputs can be declared\nAll precision hints are ignored when targeting Skia\nUnsigned integ"}
801{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "al varying inputs can be declared\nAll precision hints are ignored when targeting Skia\nUnsigned integers and booleans aren't supported\nUniforms\nA fragment program can be configured by defining uniform values in the GLSL shader source\n and then setting these values in Dart for\n each fragment shader instance.\nFloating point uniforms with the GLSL types float , vec2 , vec3 , and vec4 are set using the FragmentShader.setFloat or FragmentShader.getUniformFloat method."}
802{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": " vec3 , and vec4 are set using the FragmentShader.setFloat or FragmentShader.getUniformFloat method. GLSL sampler values, which use the sampler2D type, are set using the FragmentShader.setImageSampler or FragmentShader.getImageSampler method.\nThe correct index for each uniform value is determined by the order that the\n uniform values are defined in the fragment program. For data types composed of\n multiple floats, such as a vec4 , you must call FragmentShader.se"}
803{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "ypes composed of\n multiple floats, such as a vec4 , you must call FragmentShader.setFloat or UniformFloatSlot.set once for each value.\nFor example, given the following uniforms declarations in a GLSL fragment program:\nThe corresponding Dart code to initialize these uniform values is as follows:\nWhen using FragmentShader.setFloat note that the indices do not count the sampler2D uniform. This uniform is set separately with FragmentShader.setImageSampler , with the index starting o"}
804{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "form. This uniform is set separately with FragmentShader.setImageSampler , with the index starting over at 0.\nAny float uniforms that are left uninitialized will default to 0.0 .\nThe reflection data generated by the Flutter's shader compiler can be audited\n with the following commands in order to see things like uniform offsets.\nCurrent position\nThe shader has access to a varying value that contains the local coordinates for\n the particular fragment being evalua"}
805{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "value that contains the local coordinates for\n the particular fragment being evaluated. Use this feature to compute\n effects that depend on the current position, which can be accessed by\n importing the flutter/runtime_effect.glsl library and calling the FlutterFragCoord function. For example:\nThe value returned from FlutterFragCoord is distinct from gl_FragCoord . gl_FragCoord provides the screen space coordinates and should generally be\n "}
806{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "om gl_FragCoord . gl_FragCoord provides the screen space coordinates and should generally be\n avoided to ensure that shaders are consistent across backends. When targeting a\n Skia backend, the calls to gl_FragCoord are rewritten to access local\n coordinates but this rewriting isn't possible with Impeller.\nColors\nThere isn't a built-in data type for colors. Instead they are commonly\n represented as a vec4 with each component corr"}
807{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "r colors. Instead they are commonly\n represented as a vec4 with each component corresponding to one of the RGBA\n color channels.\nThe single output fragColor expects that the color value is normalized to be\n in the range of 0.0 to 1.0 and that it has premultiplied alpha. This is\n different than typical Flutter colors which use a 0-255 value encoding and\n have unpremultipled alpha.\nSamplers\nA sampler provides acce"}
808{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "255 value encoding and\n have unpremultipled alpha.\nSamplers\nA sampler provides access to a dart:ui Image object. This image can be\n acquired either from a decoded image or from part of the application using Scene.toImageSync or Picture.toImageSync .\nBy default, the image uses TileMode.clamp to determine how values outside\n of the range of [0, 1] behave. Customization of the tile mode is not supported\n and needs to be emulated in"}
809{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "ehave. Customization of the tile mode is not supported\n and needs to be emulated in the shader.\nPerformance considerations\nWhen targeting the Skia backend, loading the shader might be expensive since it\n must be compiled to the appropriate platform-specific shader at runtime. If you\n intend to use one or more shaders during an animation, consider precaching the\n fragment program objects before starting the animation.\nYou can reu"}
810{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "precaching the\n fragment program objects before starting the animation.\nYou can reuse a FragmentShader object across frames; this is more efficient\n than creating a new FragmentShader for each frame.\nFor a more detailed guide on writing performant shaders,\n check out Writing efficient shaders on GitHub.\nOther resources\nFor more information, here are a few resources.\nThe Book of Shaders by Patricio Gonzalez Vivo and Jen Lowe\nShader toy , a collab"}
811{"url": "https://docs.flutter.dev/ui/design/graphics/fragment-shaders", "title": "Untitled", "text": "re a few resources.\nThe Book of Shaders by Patricio Gonzalez Vivo and Jen Lowe\nShader toy , a collaborative shader playground\nsimple_shader , a simple Flutter fragment shaders sample project\nflutter_shaders , a package that simplifies using fragment shaders in\n Flutter\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
812{"url": "https://docs.flutter.dev/ui/design/material", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nMaterial Design is an open-source design system built\n and supported by Google designers and developers.\nThe latest version, Material 3, enables personal,\n adaptive, and expressive experiences—from dynamic color\n and enhanced accessibility, to foundations for\n large screen layouts, and design tokens.\nFor most Flutter widgets, upgrading to Material 3\n "}
813{"url": "https://docs.flutter.dev/ui/design/material", "title": "Untitled", "text": " large screen layouts, and design tokens.\nFor most Flutter widgets, upgrading to Material 3\n is seamless. But some widgets couldn't be\n updated—entirely new implementations were needed,\n such as NavigationBar .\n You must make these changes to your code manually.\n Until your app is entirely updated,\n the UI might look or act a bit strange.\n You can find the entirely new Materi"}
814{"url": "https://docs.flutter.dev/ui/design/material", "title": "Untitled", "text": " the UI might look or act a bit strange.\n You can find the entirely new Material components by\n visiting the Affected widgets page.\nExplore the updated components, typography, color system,\n and elevation support with the Material 3 demo .\nMore information\nTo learn more about Material Design and Flutter,\n check out:\nMaterial.io developer documentation\nMigrating a Flutter app to Material 3 blog post by Taha Tesser\nUmbrella i"}
815{"url": "https://docs.flutter.dev/ui/design/material", "title": "Untitled", "text": "io developer documentation\nMigrating a Flutter app to Material 3 blog post by Taha Tesser\nUmbrella issue on GitHub\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
816{"url": "https://docs.flutter.dev/ui/design/text/typography", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nTypography covers the style and appearance of\n type or fonts: it specifies how heavy the font is,\n the slant of the font, the spacing between\n the letters, and other visual aspects of the text.\nAll fonts are not created the same.\nA font style is defined by, at minimum, a typeface, representing the set of\n common character rules describing fonts in the sam"}
817{"url": "https://docs.flutter.dev/ui/design/text/typography", "title": "Untitled", "text": "peface, representing the set of\n common character rules describing fonts in the same type family, such as Roboto or Noto , a font weight (for example, Regular, Bold, or a\n numeric value), and a style (like Regular, Italic , etc). All of these\n and additional pre-set attributes come together to make up\n what we would call a static font.\nVariable fonts allow some of these attributes to be modified at runtime and\n "}
818{"url": "https://docs.flutter.dev/ui/design/text/typography", "title": "Untitled", "text": "font.\nVariable fonts allow some of these attributes to be modified at runtime and\n store what would normally be multiple static fonts in a single file.\nTypographic Scale\nA typographical scale is a set of related text styles to provide balance,\n cohesion, and visual variety in your apps.\nThe common type scale in Flutter, provided by TextTheme , includes five\n categories of text indicating the function:\nDisplay\nHeadline\nTitle\nLabel\nBody\nThere are "}
819{"url": "https://docs.flutter.dev/ui/design/text/typography", "title": "Untitled", "text": " categories of text indicating the function:\nDisplay\nHeadline\nTitle\nLabel\nBody\nThere are also three size variations for each:\nSmall\nMedium\nLarge\nEach of these fifteen combinations of a category and text size are represented\n by a single TextStyle .\nAll the platform specific typographical scales that Flutter exposes are\n contained in the Typography class. Usually, you will not need to\n reference this class directly as the TextTheme wil"}
820{"url": "https://docs.flutter.dev/ui/design/text/typography", "title": "Untitled", "text": ". Usually, you will not need to\n reference this class directly as the TextTheme will be localized to your target platform.\nVariable fonts\nVariable fonts allow you to control pre-defined aspects of text styling.\n Variable fonts support specific axes, such as width,\n weight, slant (to name a few).\n The user can select any value along the continuous axis when specifying the type.\nUsing the Google Fonts type tester\nA growing number "}
821{"url": "https://docs.flutter.dev/ui/design/text/typography", "title": "Untitled", "text": "g the continuous axis when specifying the type.\nUsing the Google Fonts type tester\nA growing number of fonts on Google Fonts offer some variable font capabilities.\n You can see the range of options by using the Type Tester and see how you\n might vary a single font.\nIn real time, move the slider on any of the axes to\n see how it affects the font. When programming a variable font,\n use the FontVariation class to modify the font's "}
822{"url": "https://docs.flutter.dev/ui/design/text/typography", "title": "Untitled", "text": "hen programming a variable font,\n use the FontVariation class to modify the font's design axes.\n The FontVariation class conforms to the OpenType font variables spec .\nStatic fonts\nGoogle Fonts also contains static fonts. As with variable fonts,\n you need to know how the font is designed to know what options\n are available to you.\n Once again, the Google Fonts site can help.\nUsing the Google Fonts package\nWhile "}
823{"url": "https://docs.flutter.dev/ui/design/text/typography", "title": "Untitled", "text": "\n Once again, the Google Fonts site can help.\nUsing the Google Fonts package\nWhile you can download fonts from the site and install them manually in your apps,\n you can elect to use theme directly from the google_fonts package on pub.dev .\nThey can be used as is by referencing simply the font name:\nor customized by setting properties on the resulting TextStyle :\nModifying fonts\nUse the following API to programmatically alter a static font\n (but "}
824{"url": "https://docs.flutter.dev/ui/design/text/typography", "title": "Untitled", "text": "odifying fonts\nUse the following API to programmatically alter a static font\n (but remember that this only works if the font was designed to support the feature):\nFontFeature to select glyphs\nFontWeight to modify weight\nFontStyle to italicize\nFontVariation to specify a range of values for a specific property.\nA FontFeature corresponds to an OpenType feature tag and can be thought of as a boolean flag to enable or disable\n a feature of a given font.\nOther resourc"}
825{"url": "https://docs.flutter.dev/ui/design/text/typography", "title": "Untitled", "text": "of as a boolean flag to enable or disable\n a feature of a given font.\nOther resources\nThe following video shows you some of the capabilities\n of Flutter's typography and combines it with the Material and Cupertino look and feel (depending on the platform\n the app runs on), animation, and custom fragment shaders:\nWatch on YouTube in a new tab: \"Prototyping beautiful designs with Flutter\"\nTo read one engineer's experience\n customi"}
826{"url": "https://docs.flutter.dev/ui/design/text/typography", "title": "Untitled", "text": "totyping beautiful designs with Flutter\"\nTo read one engineer's experience\n customizing variable fonts and animating them as they\n morph (and was the basis for the above video),\n check out Playful typography with Flutter ,\n a free article on Medium. The associated example also\n uses a custom shader.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. "}
827{"url": "https://docs.flutter.dev/ui/design/text/typography", "title": "Untitled", "text": "otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
828{"url": "https://docs.flutter.dev/data-and-backend/google-apis", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nThe Google APIs package exposes dozens of Google\n services that you can use from Dart projects.\nThis page describes how to use APIs that interact with\n end-user data by using Google authentication.\nExamples of user-data APIs include Calendar , Gmail , YouTube , and Firebase.\nTo add authentication to Firebase explicitly, check out the Add a user authentication flow to a Flutter app using F"}
829{"url": "https://docs.flutter.dev/data-and-backend/google-apis", "title": "Untitled", "text": "cation to Firebase explicitly, check out the Add a user authentication flow to a Flutter app using FirebaseUI codelab and the Get Started with Firebase Authentication on Flutter docs.\nOverview\nTo use Google APIs, follow these steps:\nPick the desired API\nEnable the API\nAuthenticate and determine the current user\nObtain an authenticated HTTP client\nCreate and use the desired API class\n1. Pick the desired API\nThe documentation for package:googleapis lists\n each API as a separate Da"}
830{"url": "https://docs.flutter.dev/data-and-backend/google-apis", "title": "Untitled", "text": "sired API\nThe documentation for package:googleapis lists\n each API as a separate Dart library&emdash;in a name_version format.\n Check out youtube_v3 as an example.\nEach library might provide many types,\n but there is one root class that ends in Api .\n For YouTube, it's YouTubeApi .\nNot only is the Api class the one you need to\n instantiate (see step 3), but it also\n exposes the scopes that repre"}
831{"url": "https://docs.flutter.dev/data-and-backend/google-apis", "title": "Untitled", "text": " instantiate (see step 3), but it also\n exposes the scopes that represent the permissions\n needed to use the API. For example,\n the Constants section of the YouTubeApi class lists the available scopes.\n To request access to read (but not write) an end-user's\n YouTube data, authenticate the user with youtubeReadonlyScope .\n2. Enable the API\nTo use Google APIs you must have a Google account\n "}
832{"url": "https://docs.flutter.dev/data-and-backend/google-apis", "title": "Untitled", "text": "youtubeReadonlyScope .\n2. Enable the API\nTo use Google APIs you must have a Google account\n and a Google project. You also\n need to enable your desired API.\nThis example enables YouTube Data API v3 .\n For details, see the getting started instructions .\n3. Authenticate and determine the current user\nUse the google_sign_in package to\n authenticate users with their Google identity.\n Configure sign in for each platf"}
833{"url": "https://docs.flutter.dev/data-and-backend/google-apis", "title": "Untitled", "text": " authenticate users with their Google identity.\n Configure sign in for each platform you want to support.\nThe package's functionality is accessed through\n a static instance of the GoogleSignIn class.\n Before interacting with the instance,\n the initialize method must be called and allowed to complete.\nOnce initialization is complete but before user authentication,\n listen to authentication events to determine i"}
834{"url": "https://docs.flutter.dev/data-and-backend/google-apis", "title": "Untitled", "text": "ete but before user authentication,\n listen to authentication events to determine if a user signed in.\nOnce you're listening to any relevant authentication events,\n you can attempt to authenticate a previously signed-in user.\nTo also allow for new users to authenticate,\n follow the instructions provided by package:google_sign_in .\nOnce a user has been authenticated,\n you must obtain an authenticated HTTP client.\n4. Obtain an aut"}
835{"url": "https://docs.flutter.dev/data-and-backend/google-apis", "title": "Untitled", "text": "been authenticated,\n you must obtain an authenticated HTTP client.\n4. Obtain an authenticated HTTP client\nOnce you have a signed-in user, request the\n relevant client authorization tokens using authorizationForScopes for the API scopes that your app requires.\nOnce you have the relevant authorization tokens,\n use the authClient extension from package:extension_google_sign_in_as_googleapis_auth to\n set up an authenticated HTTP cli"}
836{"url": "https://docs.flutter.dev/data-and-backend/google-apis", "title": "Untitled", "text": "ge:extension_google_sign_in_as_googleapis_auth to\n set up an authenticated HTTP client with the relevant credentials applied.\n5. Create and use the desired API class\nUse the API to create the desired API type and call methods.\n For instance:\nMore information\nYou might want to check out the following:\nThe extension_google_sign_in_as_googleapis_auth example is a working implementation of the concepts described on this page.\nUnless stated otherwise, the documentati"}
837{"url": "https://docs.flutter.dev/data-and-backend/google-apis", "title": "Untitled", "text": "king implementation of the concepts described on this page.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-06-25. View source or report an issue ."}
838{"url": "https://docs.flutter.dev/data-and-backend/networking", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nCross-platform http networking\nThe http package provides the simplest way to issue http requests. This\n package is supported on Android, iOS, macOS, Windows, Linux and the web.\nPlatform notes\nSome platforms require additional steps, as detailed below.\nAndroid\nAndroid apps must declare their use of the internet in the Android\n manifest ( AndroidManifest.xml ):\nmacOS\nmacOS apps must allow n"}
839{"url": "https://docs.flutter.dev/data-and-backend/networking", "title": "Untitled", "text": "net in the Android\n manifest ( AndroidManifest.xml ):\nmacOS\nmacOS apps must allow network access in the relevant *.entitlements files.\nLearn more about setting up entitlements .\nSamples\nFor a practical sample of various networking tasks (incl. fetching data,\n WebSockets, and parsing data in the background) see the networking cookbook recipes .\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View s"}
840{"url": "https://docs.flutter.dev/data-and-backend/networking", "title": "Untitled", "text": "ise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
841{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nIt is hard to think of a mobile app that doesn't need to communicate with a\n web server or easily store structured data at some point. When making\n network-connected apps, the chances are that it needs to consume some good old\n JSON, sooner or later.\nThis guide looks into ways of using JSON with Flutter.\n It covers which JSON solution to use in different "}
842{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "ays of using JSON with Flutter.\n It covers which JSON solution to use in different scenarios, and why.\nWatch on YouTube in a new tab: \"dart:convert (Technique of the Week)\"\nWhich JSON serialization method is right for me?\nThis article covers two general strategies for working with JSON:\nManual serialization\nAutomated serialization using code generation\nDifferent projects come with different complexities and use cases.\n For smaller proof-of-concept projects or qu"}
843{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": " different complexities and use cases.\n For smaller proof-of-concept projects or quick prototypes,\n using code generators might be overkill.\n For apps with several JSON models with more complexity,\n encoding by hand can quickly become tedious, repetitive,\n and lend itself to many small errors.\nUse manual serialization for smaller projects\nManual JSON decoding refers to using the built-in JSON decoder in dart:con"}
844{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "tion for smaller projects\nManual JSON decoding refers to using the built-in JSON decoder in dart:convert . It involves passing the raw JSON string to the jsonDecode() function, and then looking up the values you need in the resulting Map<String, dynamic> .\n It has no external dependencies or particular setup process,\n and it's good for a quick proof of concept.\nManual decoding does not perform well when your project becomes bigger.\n Writing deco"}
845{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "nual decoding does not perform well when your project becomes bigger.\n Writing decoding logic by hand can become hard to manage and error-prone.\n If you have a typo when accessing a nonexistent JSON\n field, your code throws an error during runtime.\nIf you do not have many JSON models in your project and are\n looking to test a concept quickly,\n manual serialization might be the way you want to start.\n "}
846{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "ept quickly,\n manual serialization might be the way you want to start.\n For an example of manual encoding, see Serializing JSON manually using dart:convert .\nUse code generation for medium to large projects\nJSON serialization with code generation means having an external library\n generate the encoding boilerplate for you. After some initial setup,\n you run a file watcher that generates the code from your model classes.\n "}
847{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "\n you run a file watcher that generates the code from your model classes.\n For example, json_serializable and built_value are these\n kinds of libraries.\nThis approach scales well for a larger project. No hand-written\n boilerplate is needed, and typos when accessing JSON fields are caught at\n compile-time. The downside with code generation is that it requires some\n initial setup. Also, the genera"}
848{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "side with code generation is that it requires some\n initial setup. Also, the generated source files might produce visual clutter\n in your project navigator.\nYou might want to use generated code for JSON serialization when you have a\n medium or a larger project. To see an example of code generation based JSON\n encoding, see Serializing JSON using code generation libraries .\nIs there a GSON/ Jackson/ Moshi equivalent in Flutter?\nT"}
849{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "zing JSON using code generation libraries .\nIs there a GSON/ Jackson/ Moshi equivalent in Flutter?\nThe simple answer is no.\nSuch a library would require using runtime reflection , which is disabled in\n Flutter. Runtime reflection interferes with tree shaking , which Dart has\n supported for quite a long time. With tree shaking, you can \"shake off\" unused\n code from your release builds. This optimizes the app's size significantly.\nSince reflection"}
850{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": " code from your release builds. This optimizes the app's size significantly.\nSince reflection makes all code implicitly used by default, it makes tree\n shaking difficult. The tools cannot know what parts are unused at runtime, so\n the redundant code is hard to strip away. App sizes cannot be easily optimized\n when using reflection.\nAlthough you cannot use runtime reflection with Flutter,\n some libraries give you similarly"}
851{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": " you cannot use runtime reflection with Flutter,\n some libraries give you similarly easy-to-use APIs but are\n based on code generation instead. This\n approach is covered in more detail in the code generation libraries section.\nSerializing JSON manually using dart:convert\nBasic JSON serialization in Flutter is very simple. Flutter has a built-in dart:convert library that includes a straightforward JSON encoder and\n decoder.\nThe f"}
852{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "rt:convert library that includes a straightforward JSON encoder and\n decoder.\nThe following sample JSON implements a simple user model.\nWith dart:convert ,\n you can serialize this JSON model in two ways.\nSerializing JSON inline\nBy looking at the dart:convert documentation,\n you'll see that you can decode the JSON by calling the jsonDecode() function, with the JSON string as the method argument.\nUnfortunately, jsonDecode() returns a dynamic , mea"}
853{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "on, with the JSON string as the method argument.\nUnfortunately, jsonDecode() returns a dynamic , meaning\n that you do not know the types of the values until runtime. With this approach,\n you lose most of the statically typed language features: type safety,\n autocompletion and most importantly, compile-time exceptions. Your code will\n become instantly more error-prone.\nFor example, whenever you access the name or email fields, yo"}
854{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": " become instantly more error-prone.\nFor example, whenever you access the name or email fields, you could quickly\n introduce a typo. A typo that the compiler doesn't know about since the\n JSON lives in a map structure.\nSerializing JSON inside model classes\nCombat the previously mentioned problems by introducing a plain model\n class, called User in this example. Inside the User class, you'll find:\nA User.fromJson() constructor, for constructing"}
855{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "in this example. Inside the User class, you'll find:\nA User.fromJson() constructor, for constructing a new User instance from a\n map structure.\nA toJson() method, which converts a User instance into a map.\nWith this approach, the calling code can have type safety,\n autocompletion for the name and email fields, and compile-time exceptions.\n If you make typos or treat the fields as int s instead of String s,\n the app won't compi"}
856{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "u make typos or treat the fields as int s instead of String s,\n the app won't compile, instead of crashing at runtime.\nuser.dart\nThe responsibility of the decoding logic is now moved inside the model\n itself. With this new approach, you can decode a user easily.\nTo encode a user, pass the User object to the jsonEncode() function.\n You don't need to call the toJson() method, since jsonEncode() already does it for you.\nWith this approach, the call"}
857{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "o call the toJson() method, since jsonEncode() already does it for you.\nWith this approach, the calling code doesn't have to worry about JSON\n serialization at all. However, the model class still definitely has to.\n In a production app, you would want to ensure that the serialization\n works properly. In practice, the User.fromJson() and User.toJson() methods both need to have unit tests in place to verify correct behavior.\nHowever, real-world sc"}
858{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "n() methods both need to have unit tests in place to verify correct behavior.\nHowever, real-world scenarios are not always that simple.\n Sometimes JSON API responses are more complex, for example since they\n contain nested JSON objects that must be parsed through their own model\n class.\nIt would be nice if there were something that handled the JSON encoding\n and decoding for you. Luckily, there is!\nSerializing JSON using code g"}
859{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "N encoding\n and decoding for you. Luckily, there is!\nSerializing JSON using code generation libraries\nAlthough there are other libraries available, this guide uses json_serializable , an automated source code generator that\n generates the JSON serialization boilerplate for you.\nSince the serialization code is not handwritten or maintained manually\n anymore, you minimize the risk of having JSON serialization exceptions at\n runti"}
860{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": " anymore, you minimize the risk of having JSON serialization exceptions at\n runtime.\nSetting up json_serializable in a project\nTo include json_serializable in your project, you need one regular\n dependency, and two dev dependencies . In short, dev dependencies are dependencies that are not included in our app source code—they\n are only used in the development environment.\nTo add the dependencies, run flutter pub add :\nRun flutter pub get insid"}
861{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "he development environment.\nTo add the dependencies, run flutter pub add :\nRun flutter pub get inside your project root folder\n (or click Packages get in your editor)\n to make these new dependencies available in your project.\nCreating model classes the json_serializable way\nThe following shows how to convert the User class to a json_serializable class. For the sake of simplicity,\n this code uses the simplified JSON model\n from t"}
862{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "e of simplicity,\n this code uses the simplified JSON model\n from the previous samples.\nuser.dart\nWith this setup, the source code generator generates code for encoding\n and decoding the name and email fields from JSON.\nIf needed, it is also easy to customize the naming strategy.\n For example, if the API returns objects with snake_case ,\n and you want to use lowerCamelCase in your models,\n you ca"}
863{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "case ,\n and you want to use lowerCamelCase in your models,\n you can use the @JsonKey annotation with a name parameter:\nIt's best if both server and client follow the same naming strategy. @JsonSerializable() provides fieldRename enum for totally converting dart\n fields into JSON keys.\nModifying @JsonSerializable(fieldRename: FieldRename.snake) is equivalent to\n adding @JsonKey(name: '<snake_case>') to each field.\nSometimes serve"}
864{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "equivalent to\n adding @JsonKey(name: '<snake_case>') to each field.\nSometimes server data is uncertain, so it is necessary to verify and protect data\n on client.\n Other commonly used @JsonKey annotations include:\nRunning the code generation utility\nWhen creating json_serializable classes the first time,\n you'll get errors similar to the following:\nThese errors are entirely normal and are simply because the generated code for\n "}
865{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": " to the following:\nThese errors are entirely normal and are simply because the generated code for\n the model class does not exist yet. To resolve this, run the code\n generator that generates the serialization boilerplate.\nThere are two ways of running the code generator.\nOne-time code generation\nBy running dart run build_runner build --delete-conflicting-outputs in the project root,\n you generate JSON serialization code for your models whenever "}
866{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "n the project root,\n you generate JSON serialization code for your models whenever they are needed.\n This triggers a one-time build that goes through the source files, picks the\n relevant ones, and generates the necessary serialization code for them.\nWhile this is convenient, it would be nice if you did not have to run the\n build manually every time you make changes in your model classes.\nGenerating code continuously\nA watcher m"}
867{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "manually every time you make changes in your model classes.\nGenerating code continuously\nA watcher makes our source code generation process more convenient. It\n watches changes in our project files and automatically builds the necessary\n files when needed. Start the watcher by running dart run build_runner watch --delete-conflicting-outputs in the project root.\nIt is safe to start the watcher once and leave it running in the background.\nConsuming json_serializab"}
868{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": " is safe to start the watcher once and leave it running in the background.\nConsuming json_serializable models\nTo decode a JSON string the json_serializable way,\n you do not have actually to make any changes to our previous code.\nThe same goes for encoding. The calling API is the same as before.\nWith json_serializable ,\n you can forget any manual JSON serialization in the User class.\n The source code generator creates a file called user.g.dart ,\n"}
869{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": " in the User class.\n The source code generator creates a file called user.g.dart ,\n that has all the necessary serialization logic.\n You no longer have to write automated tests to ensure\n that the serialization works—it's now the library's responsibility to make sure the serialization works\n appropriately.\nGenerating code for nested classes\nYou might have code that has nested classes within a class.\n "}
870{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "ing code for nested classes\nYou might have code that has nested classes within a class.\n If that is the case, and you have tried to pass the class in JSON format\n as an argument to a service (such as Firebase, for example),\n you might have experienced an Invalid argument error.\nConsider the following Address class:\nThe Address class is nested inside the User class:\nRunning dart run build_runner build --delete-conflicting-outputs in the terminal "}
871{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "de the User class:\nRunning dart run build_runner build --delete-conflicting-outputs in the terminal creates\n the *.g.dart file, but the private _$UserToJson() function\n looks something like the following:\nAll looks fine now, but if you do a print() on the user object:\nThe result is:\nWhen what you probably want is output like the following:\nTo make this work, pass explicitToJson: true in the @JsonSerializable() annotation over the class declaration. The User clas"}
872{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "explicitToJson: true in the @JsonSerializable() annotation over the class declaration. The User class now looks as follows:\nFor more information, see explicitToJson in the JsonSerializable class for the json_annotation package.\nFurther references\nFor more information, see the following resources:\nThe dart:convert and JsonCodec documentation\nThe json_serializable package on pub.dev\nThe json_serializable examples on GitHub\nThe Dive into Dart's patterns and records codelab\nThis ultimate guide about"}
873{"url": "https://docs.flutter.dev/data-and-backend/serialization/json", "title": "Untitled", "text": "zable examples on GitHub\nThe Dive into Dart's patterns and records codelab\nThis ultimate guide about how to parse JSON in Dart/Flutter\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
874{"url": "https://docs.flutter.dev/data-and-backend/serialization", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nHow to use JSON with Flutter.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
875{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/options", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nState management is a complex topic.\n If you feel that some of your questions haven't been answered,\n or that the approach described on these pages\n is not viable for your use cases, you are probably right.\nLearn more from the following resources,\n many of which have been contributed by the Flutter community.\nGeneral overview\nThings to review before selec"}
876{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/options", "title": "Untitled", "text": "which have been contributed by the Flutter community.\nGeneral overview\nThings to review before selecting an approach.\nIntroduction to state management ,\n which is the beginning of this very section\n (for those of you who arrived directly to this Options page\n and missed the previous pages)\nPragmatic State Management in Flutter ,\n a video from Google I/O 2019\nFlutter Architecture Samples , by Brian Egan\nBuilt-in approache"}
877{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/options", "title": "Untitled", "text": " a video from Google I/O 2019\nFlutter Architecture Samples , by Brian Egan\nBuilt-in approaches\nsetState\nThe low-level approach to use for widget-specific, ephemeral state.\nAdding interactivity to your Flutter app , a Flutter tutorial\nBasic state management in Google Flutter , by Agung Surya\nValueNotifier and InheritedNotifier\nAn approach using only Flutter provided APIs to\n update state and notify the UI of changes.\nState Management using ValueNotifier and InheritedNotifi"}
878{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/options", "title": "Untitled", "text": " update state and notify the UI of changes.\nState Management using ValueNotifier and InheritedNotifier , by Tadas Petra\nInheritedWidget and InheritedModel\nThe low-level approach used to\n communicate between ancestors and children in the widget tree.\n This is what package:provider and many other approaches use under the hood.\nThe following instructor-led video workshop covers how to\n use InheritedWidget :\nWatch on YouTube in a new tab: \"How to ma"}
879{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/options", "title": "Untitled", "text": "shop covers how to\n use InheritedWidget :\nWatch on YouTube in a new tab: \"How to manage application state using inherited widgets\"\nOther useful docs include:\nInheritedWidget docs\nManaging Flutter Application State With InheritedWidgets ,\n by Hans Muller\nInheriting Widgets , by Mehmet Fidanboylu\nWidget - State - Context - InheritedWidget , by Didier Bolelens\nCommunity-provided packages\nDepending on the complexity of your app and preferences of your team,\n "}
880{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/options", "title": "Untitled", "text": "unity-provided packages\nDepending on the complexity of your app and preferences of your team,\n you might find adopting a state management package useful.\n State management packages often help reduce boilerplate code,\n provide specialized debugging tools, and can help\n enable a clearer and consistent application architecture.\nThe Flutter community offers a wide variety of state management packages.\n The best choi"}
881{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/options", "title": "Untitled", "text": "lutter community offers a wide variety of state management packages.\n The best choice for your app often depends on the app's complexity,\n your team's preferences, and the specific problems you need to solve.\nTo begin exploring the available options,\n check out the #state-management topic on the pub.dev site and\n refine the search to find packages that match your needs.\nExplore the variety of state-management packages built by a"}
882{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/options", "title": "Untitled", "text": " to find packages that match your needs.\nExplore the variety of state-management packages built by and for the Flutter community.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
883{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/declarative", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nIf you're coming to Flutter from an imperative framework\n (such as Android SDK or iOS UIKit), you need to start\n thinking about app development from a new perspective.\nMany assumptions that you might have don't apply to Flutter. For example, in\n Flutter it's okay to rebuild parts of your UI from scratch instead of modifying\n it. Flutter is fast enough to "}
884{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/declarative", "title": "Untitled", "text": " parts of your UI from scratch instead of modifying\n it. Flutter is fast enough to do that, even on every frame if needed.\nFlutter is declarative . This means that Flutter builds its user interface to\n reflect the current state of your app:\nWhen the state of your app changes\n (for example, the user flips a switch in the settings screen),\n you change the state, and that triggers a redraw of the user interface.\n T"}
885{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/declarative", "title": "Untitled", "text": " you change the state, and that triggers a redraw of the user interface.\n There is no imperative changing of the UI itself\n (like widget.setText )—you change the state,\n and the UI rebuilds from scratch.\nRead more about the declarative approach to UI programming\n in the Introduction to declarative UI .\nThe declarative style of UI programming has many benefits.\n Remarkably, there is only one code path for"}
886{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/declarative", "title": "Untitled", "text": "e of UI programming has many benefits.\n Remarkably, there is only one code path for any state of the UI.\n You describe what the UI should look\n like for any given state, once—and that is it.\nAt first,\n this style of programming might not seem as intuitive as the\n imperative style. This is why this section is here. Read on.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last"}
887{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/declarative", "title": "Untitled", "text": " Read on.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
888{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/intro", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nIf you are already familiar with state management in reactive apps,\n you can skip this section, though you might want to review the list of different approaches .\nAs you explore Flutter,\n there comes a time when you need to share application\n state between screens, across your app.\n There are many approaches you can take,\n and many ques"}
889{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/intro", "title": "Untitled", "text": " your app.\n There are many approaches you can take,\n and many questions to think about.\nIn the following pages,\n you will learn the basics of dealing with state in Flutter apps.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
890{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/ephemeral-vs-app", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nThis doc introduces app state, ephemeral state,\n and how you might manage each in a Flutter app.\nIn the broadest possible sense, the state of an app is everything that\n exists in memory when the app is running. This includes the app's assets,\n all the variables that the Flutter framework keeps about the UI,\n animation state, textures, fonts, and so on. "}
891{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/ephemeral-vs-app", "title": "Untitled", "text": "lutter framework keeps about the UI,\n animation state, textures, fonts, and so on. While this broadest\n possible definition of state is valid, it's not very useful for\n architecting an app.\nFirst, you don't even manage some state (like textures).\n The framework handles those for you. So a more useful definition of\n state is \"whatever data you need in order to rebuild your UI at any\n moment in ti"}
892{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/ephemeral-vs-app", "title": "Untitled", "text": " state is \"whatever data you need in order to rebuild your UI at any\n moment in time\". Second, the state that you do manage yourself can\n be separated into two conceptual types: ephemeral state and app state.\nEphemeral state\nEphemeral state (sometimes called UI state or local state )\n is the state you can neatly contain in a single widget.\nThis is, intentionally, a vague definition, so here are a few examples.\ncurrent page in a PageView\ncurrent"}
893{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/ephemeral-vs-app", "title": "Untitled", "text": "s, intentionally, a vague definition, so here are a few examples.\ncurrent page in a PageView\ncurrent progress of a complex animation\ncurrent selected tab in a BottomNavigationBar\nOther parts of the widget tree seldom need to access this kind of state.\n There is no need to serialize it, and it doesn't change in complex ways.\nIn other words, there is no need to use state management techniques\n (ScopedModel, Redux, etc.) on this kind of state.\n All"}
894{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/ephemeral-vs-app", "title": "Untitled", "text": "techniques\n (ScopedModel, Redux, etc.) on this kind of state.\n All you need is a StatefulWidget .\nBelow, you see how the currently selected item in a bottom navigation bar is\n held in the _index field of the _MyHomepageState class.\n In this example, _index is ephemeral state.\nHere, using setState() and a field inside the StatefulWidget's State\n class is completely natural. No other part of your app needs to acce"}
895{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/ephemeral-vs-app", "title": "Untitled", "text": "idget's State\n class is completely natural. No other part of your app needs to access _index . The variable only changes inside the MyHomepage widget.\n And, if the user closes and restarts the app,\n you don't mind that _index resets to zero.\nApp state\nState that is not ephemeral,\n that you want to share across many parts of your app,\n and that you want to keep between user sessions,\n is what we "}
896{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/ephemeral-vs-app", "title": "Untitled", "text": "pp,\n and that you want to keep between user sessions,\n is what we call application state\n (sometimes also called shared state).\nExamples of application state:\nUser preferences\nLogin info\nNotifications in a social networking app\nThe shopping cart in an e-commerce app\nRead/unread state of articles in a news app\nFor managing app state, you'll want to research your options.\n Your choice depends on the complexity and nature of your a"}
897{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/ephemeral-vs-app", "title": "Untitled", "text": " research your options.\n Your choice depends on the complexity and nature of your app,\n your team's previous experience, and many other aspects. Read on.\nThere is no clear-cut rule\nTo be clear, you can use State and setState() to manage all of\n the state in your app. In fact, the Flutter team does this in many\n simple app samples (including the starter app that you get with every flutter create ).\nIt goes the other way, too. For"}
898{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/ephemeral-vs-app", "title": "Untitled", "text": "(including the starter app that you get with every flutter create ).\nIt goes the other way, too. For example, you might decide that—in\n the context of your particular app—the selected tab in a bottom\n navigation bar is not ephemeral state. You might need to change it\n from outside the class, keep it between sessions, and so on.\n In that case, the _index variable is app state.\nThere is no clear-cut, universal rule to distinguish\n"}
899{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/ephemeral-vs-app", "title": "Untitled", "text": "n that case, the _index variable is app state.\nThere is no clear-cut, universal rule to distinguish\n whether a particular variable is ephemeral or app state.\n Sometimes, you'll have to refactor one into another.\n For example, you'll start with some clearly ephemeral state,\n but as your application grows in features,\n it might need to be moved to app state.\nFor that reason, take the following diagram with a large"}
900{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/ephemeral-vs-app", "title": "Untitled", "text": " it might need to be moved to app state.\nFor that reason, take the following diagram with a large grain of salt:\nWhen asked about React's setState versus Redux's store, the author of Redux,\n Dan Abramov, replied:\n\"The rule of thumb is: Do whatever is less awkward .\"\nIn summary, there are two conceptual types of state in any Flutter app.\n Ephemeral state can be implemented using State and setState() ,\n and is often local to a single widget. Th"}
901{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/ephemeral-vs-app", "title": "Untitled", "text": "implemented using State and setState() ,\n and is often local to a single widget. The rest is your app state.\n Both types have their place in any Flutter app, and the split between\n the two depends on your own preference and the complexity of the app.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
902{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nNow that you know about declarative UI programming and the difference between ephemeral and app state ,\n you are ready to learn about simple app state management.\nOn this page, we are going to be using the provider package.\n If you are new to Flutter and you don't have a strong reason to choose\n another approach (Redux, Rx, hooks, etc.), this is probably the approach\n "}
903{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "oose\n another approach (Redux, Rx, hooks, etc.), this is probably the approach\n you should start with. The provider package is easy to understand\n and it doesn't use much code.\n It also uses concepts that are applicable in every other approach.\nThat said, if you have a strong background in\n state management from other reactive frameworks,\n you can find packages and tutorials listed on the option"}
904{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "ther reactive frameworks,\n you can find packages and tutorials listed on the options page .\nOur example\nFor illustration, consider the following simple app.\nThe app has two separate screens: a catalog,\n and a cart (represented by the MyCatalog ,\n and MyCart widgets, respectively). It could be a shopping app,\n but you can imagine the same structure in a simple social networking\n app (replace catalog for \"wall\" an"}
905{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "he same structure in a simple social networking\n app (replace catalog for \"wall\" and cart for \"favorites\").\nThe catalog screen includes a custom app bar ( MyAppBar )\n and a scrolling view of many list items ( MyListItems ).\nHere's the app visualized as a widget tree.\nSo we have at least 5 subclasses of Widget . Many of them need\n access to state that \"belongs\" elsewhere. For example, each MyListItem needs to be able to add itself to the cart.\n "}
906{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "hat \"belongs\" elsewhere. For example, each MyListItem needs to be able to add itself to the cart.\n It might also want to see whether the currently displayed item\n is already in the cart.\nThis takes us to our first question: where should we put the current\n state of the cart?\nLifting state up\nIn Flutter,\n it makes sense to keep the state above the widgets that use it.\nWhy? In declarative frameworks like Flutter, if you want to ch"}
907{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": " state above the widgets that use it.\nWhy? In declarative frameworks like Flutter, if you want to change the UI,\n you have to rebuild it. There is no easy way to have MyCart.updateWith(somethingNew) . In other words, it's hard to\n imperatively change a widget from outside, by calling a method on it.\n And even if you could make this work, you would be fighting the\n framework instead of letting it help you.\nEven if you get the abo"}
908{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": " be fighting the\n framework instead of letting it help you.\nEven if you get the above code to work,\n you would then have to deal\n with the following in the MyCart widget:\nYou would need to take into consideration the current state of the UI\n and apply the new data to it. It's hard to avoid bugs this way.\nIn Flutter, you construct a new widget every time its contents change.\n Instead of MyCart.updateWith(somethin"}
909{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "a new widget every time its contents change.\n Instead of MyCart.updateWith(somethingNew) (a method call)\n you use MyCart(contents) (a constructor). Because you can only\n construct new widgets in the build methods of their parents,\n if you want to change contents , it needs to live in MyCart 's\n parent or above.\nNow MyCart has only one code path for building any version of the UI.\nIn our example, contents needs t"}
910{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "w MyCart has only one code path for building any version of the UI.\nIn our example, contents needs to live in MyApp . Whenever it changes,\n it rebuilds MyCart from above (more on that later). Because of this, MyCart doesn't need to worry about lifecycle—it just declares\n what to show for any given contents . When that changes, the old MyCart widget disappears and is completely replaced by the new one.\nThis is what we mean when we say that widgets are immutable.\n"}
911{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "is completely replaced by the new one.\nThis is what we mean when we say that widgets are immutable.\n They don't change—they get replaced.\nNow that we know where to put the state of the cart, let's see how\n to access it.\nAccessing the state\nWhen a user clicks on one of the items in the catalog,\n it's added to the cart. But since the cart lives above MyListItem ,\n how do we do that?\nA simple option is to provide a callback that My"}
912{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "e MyListItem ,\n how do we do that?\nA simple option is to provide a callback that MyListItem can call\n when it is clicked. Dart's functions are first class objects,\n so you can pass them around any way you want. So, inside MyCatalog you can define the following:\nThis works okay, but for an app state that you need to modify from\n many different places, you'd have to pass around a lot of\n callbacks—which gets old p"}
913{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "ny different places, you'd have to pass around a lot of\n callbacks—which gets old pretty quickly.\nFortunately, Flutter has mechanisms for widgets to provide data and\n services to their descendants (in other words, not just their children,\n but any widgets below them). As you would expect from Flutter,\n where Everything is a Widget™ , these mechanisms are just special\n kinds of widgets— InheritedWidget , Inherite"}
914{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "™ , these mechanisms are just special\n kinds of widgets— InheritedWidget , InheritedNotifier , InheritedModel , and more. We won't be covering those here,\n because they are a bit low-level for what we're trying to do.\nInstead, we are going to use a package that works with the low-level\n widgets but is simple to use. It's called provider .\nBefore working with provider ,\n don't forget to add the dependency on it to your pubspec.ya"}
915{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "orking with provider ,\n don't forget to add the dependency on it to your pubspec.yaml .\nTo add the provider package as a dependency, run flutter pub add :\nNow you can import 'package:provider/provider.dart'; and start building.\nWith provider , you don't need to worry about callbacks or InheritedWidgets . But you do need to understand 3 concepts:\nChangeNotifier\nChangeNotifierProvider\nConsumer\nChangeNotifier\nChangeNotifier is a simple class included in the Flutter SDK which provid"}
916{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "er\nConsumer\nChangeNotifier\nChangeNotifier is a simple class included in the Flutter SDK which provides\n change notification to its listeners. In other words, if something is\n a ChangeNotifier , you can subscribe to its changes. (It is a form of\n Observable, for those familiar with the term.)\nIn provider , ChangeNotifier is one way to encapsulate your application\n state. For very simple apps, you get by with a single ChangeNotifi"}
917{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "our application\n state. For very simple apps, you get by with a single ChangeNotifier .\n In complex ones, you'll have several models, and therefore several ChangeNotifiers . (You don't need to use ChangeNotifier with provider at all, but it's an easy class to work with.)\nIn our shopping app example, we want to manage the state of the cart in a ChangeNotifier . We create a new class that extends it, like so:\nThe only code that is specific to ChangeNotifier is the"}
918{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "create a new class that extends it, like so:\nThe only code that is specific to ChangeNotifier is the call\n to notifyListeners() . Call this method any time the model changes in a way\n that might change your app's UI. Everything else in CartModel is the\n model itself and its business logic.\nChangeNotifier is part of flutter:foundation and doesn't depend on\n any higher-level classes in Flutter. It's easily testable (you don't even"}
919{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "epend on\n any higher-level classes in Flutter. It's easily testable (you don't even need\n to use widget testing for it). For example,\n here's a simple unit test of CartModel :\nChangeNotifierProvider\nChangeNotifierProvider is the widget that provides an instance of\n a ChangeNotifier to its descendants. It comes from the provider package.\nWe already know where to put ChangeNotifierProvider : above the widgets that\n "}
920{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "ckage.\nWe already know where to put ChangeNotifierProvider : above the widgets that\n need to access it. In the case of CartModel , that means somewhere\n above both MyCart and MyCatalog .\nYou don't want to place ChangeNotifierProvider higher than necessary\n (because you don't want to pollute the scope). But in our case,\n the only widget that is on top of both MyCart and MyCatalog is MyApp .\nNote that we're defining a builder that"}
921{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "idget that is on top of both MyCart and MyCatalog is MyApp .\nNote that we're defining a builder that creates a new instance\n of CartModel . ChangeNotifierProvider is smart enough not to rebuild CartModel unless absolutely necessary. It also automatically calls dispose() on CartModel when the instance is no longer needed.\nIf you want to provide more than one class, you can use MultiProvider :\nConsumer\nNow that CartModel is provided to widgets in our app through the ChangeNotifier"}
922{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "iProvider :\nConsumer\nNow that CartModel is provided to widgets in our app through the ChangeNotifierProvider declaration at the top, we can start using it.\nThis is done through the Consumer widget.\nWe must specify the type of the model that we want to access.\n In this case, we want CartModel , so we write Consumer<CartModel> . If you don't specify the generic ( <CartModel> ),\n the provider package won't be able to help you. provider is based on types,\n "}
923{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": " the provider package won't be able to help you. provider is based on types,\n and without the type, it doesn't know what you want.\nThe only required argument of the Consumer widget\n is the builder. Builder is a function that is called whenever the ChangeNotifier changes. (In other words, when you call notifyListeners() in your model, all the builder methods of all the corresponding Consumer widgets are called.)\nThe builder is called with three argum"}
924{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "ethods of all the corresponding Consumer widgets are called.)\nThe builder is called with three arguments. The first one is context ,\n which you also get in every build method.\nThe second argument of the builder function is the instance of\n the ChangeNotifier . It's what we were asking for in the first place.\n You can use the data in the model to define what the UI should look like\n at any given point.\nThe third argument is child"}
925{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "efine what the UI should look like\n at any given point.\nThe third argument is child , which is there for optimization.\n If you have a large widget subtree under your Consumer that doesn't change when the model changes, you can construct it\n once and get it through the builder.\nIt is best practice to put your Consumer widgets as deep in the tree\n as possible. You don't want to rebuild large portions of the UI\n ju"}
926{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": " as possible. You don't want to rebuild large portions of the UI\n just because some detail somewhere changed.\nInstead:\nProvider.of\nSometimes, you don't really need the data in the model to change the\n UI but you still need to access it. For example, a ClearCart button wants to allow the user to remove everything from the cart.\n It doesn't need to display the contents of the cart,\n it just needs to call the clear()"}
927{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "oesn't need to display the contents of the cart,\n it just needs to call the clear() method.\nWe could use Consumer<CartModel> for this,\n but that would be wasteful. We'd be asking the framework to\n rebuild a widget that doesn't need to be rebuilt.\nFor this use case, we can use Provider.of ,\n with the listen parameter set to false .\nUsing the above line in a build method won't cause this widget to\n rebuild when no"}
928{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt/simple", "title": "Untitled", "text": "\nUsing the above line in a build method won't cause this widget to\n rebuild when notifyListeners is called.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-29. View source or report an issue ."}
929{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nAn introduction to different approaches to managing state in Flutter apps.\nHow to think about declarative programming.\nHow to structure an app to manage the state of the data flowing through it.\nHow to tell the difference between ephemeral and app state.\nA simple form of state management.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report"}
930{"url": "https://docs.flutter.dev/data-and-backend/state-mgmt", "title": "Untitled", "text": "ntation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
931{"url": "https://docs.flutter.dev/data-and-backend/firebase", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nFirebase is a Backend-as-a-Service (BaaS) app development platform\n that provides hosted backend services such as a realtime database,\n cloud storage, authentication, crash reporting, machine learning,\n remote configuration, and hosting for your static files.\nFlutter and Firebase resources\nFirebase supports Flutter. To learn more,\n check out the following"}
932{"url": "https://docs.flutter.dev/data-and-backend/firebase", "title": "Untitled", "text": "rebase resources\nFirebase supports Flutter. To learn more,\n check out the following resources.\nDocumentation\nGetting started with Firebase and Flutter\nFirebase plugins\nBlog Posts\nUse Firebase to host your Flutter app on the web\nTutorials\nGet to know Firebase for Flutter\ntutorial\nvideo workshop\nFlutter and Firebase community resources\nThe Flutter community created the following useful resources.\nBlog Posts\nBuilding chat app with Flutter and Firebase\nVideos\nUsing Firestore as a ba"}
933{"url": "https://docs.flutter.dev/data-and-backend/firebase", "title": "Untitled", "text": "ful resources.\nBlog Posts\nBuilding chat app with Flutter and Firebase\nVideos\nUsing Firestore as a backend to your Flutter app\nLive Coding Firebase Authentication with Flutter\nFlutter & Firebase Auth 01\nFlutter: Firebase Tutorial Part 1 - Auth and Sign in\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
934{"url": "https://docs.flutter.dev/data-and-backend/persistence", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
935{"url": "https://docs.flutter.dev/cookbook/images/fading-in-images", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nWhen displaying images using the default Image widget,\n you might notice they simply pop onto the screen as they're loaded.\n This might feel visually jarring to your users.\nInstead, wouldn't it be nice to display a placeholder at first,\n and images would fade in as they're loaded? Use the FadeInImage widget for exactly this purpose.\nFadeInImage works with images of any ty"}
936{"url": "https://docs.flutter.dev/cookbook/images/fading-in-images", "title": "Untitled", "text": "loaded? Use the FadeInImage widget for exactly this purpose.\nFadeInImage works with images of any type: in-memory, local assets,\n or images from the internet.\nIn-Memory\nIn this example, use the transparent_image package for a simple transparent placeholder.\nComplete example\nFrom asset bundle\nYou can also consider using local assets for placeholders.\n First, add the asset to the project's pubspec.yaml file\n (for more details, see Adding assets an"}
937{"url": "https://docs.flutter.dev/cookbook/images/fading-in-images", "title": "Untitled", "text": "e asset to the project's pubspec.yaml file\n (for more details, see Adding assets and images ):\nThen, use the FadeInImage.assetNetwork() constructor:\nComplete example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
938{"url": "https://docs.flutter.dev/cookbook/images/network-image", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nDisplaying images is fundamental for most mobile apps.\n Flutter provides the Image widget to\n display different types of images.\nTo work with images from a URL, use the Image.network() constructor.\nBonus: animated gifs\nOne useful thing about the Image widget:\n It supports animated gifs.\nImage fade in with placeholders\nThe default Image.network constructor doesn't handle m"}
939{"url": "https://docs.flutter.dev/cookbook/images/network-image", "title": "Untitled", "text": "nimated gifs.\nImage fade in with placeholders\nThe default Image.network constructor doesn't handle more advanced\n functionality, such as fading images in after loading.\n To accomplish this task,\n check out Fade in images with a placeholder .\nFade in images with a placeholder\nInteractive example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
940{"url": "https://docs.flutter.dev/cookbook/images/network-image", "title": "Untitled", "text": "te reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
941{"url": "https://docs.flutter.dev/cookbook/images", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nHow to fade images into view.\nHow to display images from the internet.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
942{"url": "https://docs.flutter.dev/cookbook/animation/animated-container", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nThe Container class provides a convenient way\n to create a widget with specific properties:\n width, height, background color, padding, borders, and more.\nSimple animations often involve changing these properties over time.\n For example,\n you might want to animate the background color from grey to green to\n indicate that an item has been s"}
943{"url": "https://docs.flutter.dev/cookbook/animation/animated-container", "title": "Untitled", "text": "nimate the background color from grey to green to\n indicate that an item has been selected by the user.\nTo animate these properties,\n Flutter provides the AnimatedContainer widget.\n Like the Container widget, AnimatedContainer allows you to define\n the width, height, background colors, and more. However, when the AnimatedContainer is rebuilt with new properties, it automatically\n animates between the old and new"}
944{"url": "https://docs.flutter.dev/cookbook/animation/animated-container", "title": "Untitled", "text": " is rebuilt with new properties, it automatically\n animates between the old and new values. In Flutter, these types of\n animations are known as \"implicit animations.\"\nThis recipe describes how to use an AnimatedContainer to animate the size,\n background color, and border radius when the user taps a button\n using the following steps:\nCreate a StatefulWidget with default properties.\nBuild an AnimatedContainer using the properties."}
945{"url": "https://docs.flutter.dev/cookbook/animation/animated-container", "title": "Untitled", "text": "s:\nCreate a StatefulWidget with default properties.\nBuild an AnimatedContainer using the properties.\nStart the animation by rebuilding with new properties.\n1. Create a StatefulWidget with default properties\nTo start, create StatefulWidget and State classes.\n Use the custom State class to define the properties that change over\n time. In this example, that includes the width, height, color, and border\n radius. You can also define the default value"}
946{"url": "https://docs.flutter.dev/cookbook/animation/animated-container", "title": "Untitled", "text": "the width, height, color, and border\n radius. You can also define the default value of each property.\nThese properties belong to a custom State class so they\n can be updated when the user taps a button.\n2. Build an AnimatedContainer using the properties\nNext, build the AnimatedContainer using the properties defined in the\n previous step. Furthermore, provide a duration that defines how long\n the animation should run.\n3. Start th"}
947{"url": "https://docs.flutter.dev/cookbook/animation/animated-container", "title": "Untitled", "text": "re, provide a duration that defines how long\n the animation should run.\n3. Start the animation by rebuilding with new properties\nFinally, start the animation by rebuilding the AnimatedContainer with the new properties.\n How to trigger a rebuild?\n Use the setState() method.\nAdd a button to the app. When the user taps the button, update\n the properties with a new width, height, background color and border radius\n "}
948{"url": "https://docs.flutter.dev/cookbook/animation/animated-container", "title": "Untitled", "text": " the properties with a new width, height, background color and border radius\n inside a call to setState() .\nA real app typically transitions between fixed values (for example,\n from a grey to a green background). For this app,\n generate new values each time the user taps the button.\nInteractive example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an i"}
949{"url": "https://docs.flutter.dev/cookbook/animation/animated-container", "title": "Untitled", "text": "on on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
950{"url": "https://docs.flutter.dev/cookbook/animation/page-route-animation", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nA design language, such as Material, defines standard behaviors when\n transitioning between routes (or screens). Sometimes, though, a custom\n transition between screens can make an app more unique. To help, PageRouteBuilder provides an Animation object.\n This Animation can be used with Tween and Curve objects to customize the transition animation.\n This r"}
951{"url": "https://docs.flutter.dev/cookbook/animation/page-route-animation", "title": "Untitled", "text": "be used with Tween and Curve objects to customize the transition animation.\n This recipe shows how to transition between\n routes by animating the new route into view from\n the bottom of the screen.\nTo create a custom page route transition, this recipe uses the following steps:\nSet up a PageRouteBuilder\nCreate a Tween\nAdd an AnimatedWidget\nUse a CurveTween\nCombine the two Tween s\n1. Set up a PageRouteBuilder\nTo start, use a PageRouteBuilder to cr"}
952{"url": "https://docs.flutter.dev/cookbook/animation/page-route-animation", "title": "Untitled", "text": "rveTween\nCombine the two Tween s\n1. Set up a PageRouteBuilder\nTo start, use a PageRouteBuilder to create a Route . PageRouteBuilder has two callbacks, one to build the content of the route\n ( pageBuilder ), and one to build the route's transition ( transitionsBuilder ).\nThe following example creates two routes: a home route with a \"Go!\" button, and\n a second route titled \"Page 2\".\n2. Create a Tween\nTo make the new page animate in from the bottom, it should anima"}
953{"url": "https://docs.flutter.dev/cookbook/animation/page-route-animation", "title": "Untitled", "text": " titled \"Page 2\".\n2. Create a Tween\nTo make the new page animate in from the bottom, it should animate from Offset(0,1) to Offset(0, 0) (usually defined using the Offset.zero constructor). In this case, the Offset is a 2D vector for the FractionalTranslation widget.\n Setting the dy argument to 1 represents a vertical translation one\n full height of the page.\nThe transitionsBuilder callback has an animation parameter. It's an Animation<double> that produces value"}
954{"url": "https://docs.flutter.dev/cookbook/animation/page-route-animation", "title": "Untitled", "text": "ransitionsBuilder callback has an animation parameter. It's an Animation<double> that produces values between 0 and 1. Convert the Animation<double> into an Animation<Offset> using a Tween:\n3. Use an AnimatedWidget\nFlutter has a set of widgets extending AnimatedWidget that rebuild themselves when the value of the animation changes. For instance,\n SlideTransition takes an Animation<Offset> and translates its child (using a FractionalTranslation widget) whenever the value of the a"}
955{"url": "https://docs.flutter.dev/cookbook/animation/page-route-animation", "title": "Untitled", "text": "<Offset> and translates its child (using a FractionalTranslation widget) whenever the value of the animation changes.\nAnimatedWidget Return a SlideTransition with the Animation<Offset> and the child widget:\n4. Use a CurveTween\nFlutter provides a selection of easing curves that\n adjust the rate of the animation over time.\n The Curves class\n provides a predefined set of commonly used curves.\n For example, Curves.easeOut makes the "}
956{"url": "https://docs.flutter.dev/cookbook/animation/page-route-animation", "title": "Untitled", "text": "s a predefined set of commonly used curves.\n For example, Curves.easeOut makes the animation start quickly and end slowly.\nTo use a Curve, create a new CurveTween and pass it a Curve:\nThis new Tween still produces values from 0 to 1. In the next step, it will be\n combined the Tween<Offset> from step 2.\n5. Combine the two Tweens\nTo combine the tweens,\n use chain() :\nThen use this tween by passing it to animation.drive() . This creates a new Anima"}
957{"url": "https://docs.flutter.dev/cookbook/animation/page-route-animation", "title": "Untitled", "text": " use chain() :\nThen use this tween by passing it to animation.drive() . This creates a new Animation<Offset> that can be given to the SlideTransition widget:\nThis new Tween (or Animatable) produces Offset values by first evaluating the CurveTween , then evaluating the Tween<Offset>. When the animation runs, the\n values are computed in this order:\nThe animation (provided to the transitionsBuilder callback) produces values\n from 0 to 1.\nThe CurveTween maps t"}
958{"url": "https://docs.flutter.dev/cookbook/animation/page-route-animation", "title": "Untitled", "text": " transitionsBuilder callback) produces values\n from 0 to 1.\nThe CurveTween maps those values to new values between 0 and 1 based on its\n curve.\nThe Tween<Offset> maps the double values to Offset values.\nAnother way to create an Animation<Offset> with an easing curve is to use a CurvedAnimation :\nInteractive example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-11. View source or report an issue "}
959{"url": "https://docs.flutter.dev/cookbook/animation/page-route-animation", "title": "Untitled", "text": " this site reflects Flutter 3.44.0. Page last updated on 2026-05-11. View source or report an issue ."}
960{"url": "https://docs.flutter.dev/cookbook/animation/physics-simulation", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nPhysics simulations can make app interactions feel realistic and interactive.\n For example, you might want to animate a widget to act as if it were attached to\n a spring or falling with gravity.\nThis recipe demonstrates how to move a widget from a dragged point back to the\n center using a spring simulation.\nThis recipe uses these steps:\nSet up an animation controller\nMove"}
961{"url": "https://docs.flutter.dev/cookbook/animation/physics-simulation", "title": "Untitled", "text": " center using a spring simulation.\nThis recipe uses these steps:\nSet up an animation controller\nMove the widget using gestures\nAnimate the widget\nCalculate the velocity to simulate a springing motion\nStep 1: Set up an animation controller\nStart with a stateful widget called DraggableCard :\nMake the _DraggableCardState class extend from SingleTickerProviderStateMixin .\n Then construct an AnimationController in initState and set vsync to this .\nStep 2: Move the widget using gestur"}
962{"url": "https://docs.flutter.dev/cookbook/animation/physics-simulation", "title": "Untitled", "text": "uct an AnimationController in initState and set vsync to this .\nStep 2: Move the widget using gestures\nMake the widget move when it's dragged, and add an Alignment field to the _DraggableCardState class:\nAdd a GestureDetector that handles the onPanDown , onPanUpdate , and onPanEnd callbacks. To adjust the alignment, use a MediaQuery to get the\n size of the widget, and divide by 2. (This converts units of \"pixels dragged\" to\n coordinates that Align uses.) Then, s"}
963{"url": "https://docs.flutter.dev/cookbook/animation/physics-simulation", "title": "Untitled", "text": " (This converts units of \"pixels dragged\" to\n coordinates that Align uses.) Then, set the Align widget's alignment to _dragAlignment :\nStep 3: Animate the widget\nWhen the widget is released, it should spring back to the center.\nAdd an Animation<Alignment> field and an _runAnimation method. This\n method defines a Tween that interpolates between the point the widget was\n dragged to, to the point in the center.\nNext, update _dragAlignment when the "}
964{"url": "https://docs.flutter.dev/cookbook/animation/physics-simulation", "title": "Untitled", "text": " was\n dragged to, to the point in the center.\nNext, update _dragAlignment when the AnimationController produces a\n value:\nNext, make the Align widget use the _dragAlignment field:\nFinally, update the GestureDetector to manage the animation controller:\nStep 4: Calculate the velocity to simulate a springing motion\nThe last step is to do a little math, to calculate the velocity of the widget\n after it's finished being dragged. This is so that the w"}
965{"url": "https://docs.flutter.dev/cookbook/animation/physics-simulation", "title": "Untitled", "text": "he velocity of the widget\n after it's finished being dragged. This is so that the widget realistically\n continues at that speed before being snapped back. (The _runAnimation method\n already sets the direction by setting the animation's start and end alignment.)\nFirst, import the physics package:\nThe onPanEnd callback provides a DragEndDetails object. This object\n provides the velocity of the pointer when it stopped contacting th"}
966{"url": "https://docs.flutter.dev/cookbook/animation/physics-simulation", "title": "Untitled", "text": "ct. This object\n provides the velocity of the pointer when it stopped contacting the screen. The\n velocity is in pixels per second, but the Align widget doesn't use pixels. It\n uses coordinate values between [-1.0, -1.0] and [1.0, 1.0], where [0.0, 0.0]\n represents the center. The size calculated in step 2 is used to convert pixels\n to coordinate values in this range.\nFinally, AnimationController has an animateW"}
967{"url": "https://docs.flutter.dev/cookbook/animation/physics-simulation", "title": "Untitled", "text": "s\n to coordinate values in this range.\nFinally, AnimationController has an animateWith() method that can be given a SpringSimulation :\nDon't forget to call _runAnimation() with the velocity and size:\nInteractive Example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
968{"url": "https://docs.flutter.dev/cookbook/animation/opacity-animation", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nUI developers often need to show and hide elements on screen.\n However, quickly popping elements on and off the screen can\n feel jarring to end users. Instead,\n fade elements in and out with an opacity animation to create\n a smooth experience.\nThe AnimatedOpacity widget makes it easy to perform opacity\n animations. This recipe uses the fo"}
969{"url": "https://docs.flutter.dev/cookbook/animation/opacity-animation", "title": "Untitled", "text": "pacity widget makes it easy to perform opacity\n animations. This recipe uses the following steps:\nCreate a box to fade in and out.\nDefine a StatefulWidget .\nDisplay a button that toggles the visibility.\nFade the box in and out.\n1. Create a box to fade in and out\nFirst, create something to fade in and out. For this example,\n draw a green box on screen.\n2. Define a StatefulWidget\nNow that you have a green box to animate,\n you need a way to know wh"}
970{"url": "https://docs.flutter.dev/cookbook/animation/opacity-animation", "title": "Untitled", "text": "StatefulWidget\nNow that you have a green box to animate,\n you need a way to know whether the box should be visible.\n To accomplish this, use a StatefulWidget .\nA StatefulWidget is a class that creates a State object.\n The State object holds some data about the app and provides a way to\n update that data. When updating the data,\n you can also ask Flutter to rebuild the UI with those changes.\nIn this case, you hav"}
971{"url": "https://docs.flutter.dev/cookbook/animation/opacity-animation", "title": "Untitled", "text": " you can also ask Flutter to rebuild the UI with those changes.\nIn this case, you have one piece of data:\n a boolean representing whether the button is visible.\nTo construct a StatefulWidget , create two classes: A StatefulWidget and a corresponding State class.\n Pro tip: The Flutter plugins for Android Studio and VSCode include\n the stful snippet to quickly generate this code.\n3. Display a button that toggles the visibility\nNow t"}
972{"url": "https://docs.flutter.dev/cookbook/animation/opacity-animation", "title": "Untitled", "text": "e stful snippet to quickly generate this code.\n3. Display a button that toggles the visibility\nNow that you have some data to determine whether the green box\n should be visible, you need a way to update that data.\n In this example, if the box is visible, hide it.\n If the box is hidden, show it.\nTo handle this, display a button. When a user presses the button,\n flip the boolean from true to false, or false to true.\n "}
973{"url": "https://docs.flutter.dev/cookbook/animation/opacity-animation", "title": "Untitled", "text": " the button,\n flip the boolean from true to false, or false to true.\n Make this change using setState() ,\n which is a method on the State class.\n This tells Flutter to rebuild the widget.\nFor more information on working with user input,\n see the Gestures section of the cookbook.\n4. Fade the box in and out\nYou have a green box on screen and a button to toggle the visibility\n to true or false . Ho"}
974{"url": "https://docs.flutter.dev/cookbook/animation/opacity-animation", "title": "Untitled", "text": " a green box on screen and a button to toggle the visibility\n to true or false . How to fade the box in and out? With an AnimatedOpacity widget.\nThe AnimatedOpacity widget requires three arguments:\nopacity : A value from 0.0 (invisible) to 1.0 (fully visible).\nduration : How long the animation should take to complete.\nchild : The widget to animate. In this case, the green box.\nInteractive example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Pa"}
975{"url": "https://docs.flutter.dev/cookbook/animation/opacity-animation", "title": "Untitled", "text": "eractive example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
976{"url": "https://docs.flutter.dev/cookbook/animation", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nHow to animate properties of a container using implicit animations.\nHow to implement a physics animation.\nHow to animate from one page to another.\nHow to fade a widget in and out.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
977{"url": "https://docs.flutter.dev/cookbook/maintenance/error-reporting", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nWhile one always tries to create apps that are free of bugs,\n they're sure to crop up from time to time.\n Since buggy apps lead to unhappy users and customers,\n it's important to understand how often your users\n experience bugs and where those bugs occur.\n That way, you can prioritize the bugs with the\n highest impact and"}
978{"url": "https://docs.flutter.dev/cookbook/maintenance/error-reporting", "title": "Untitled", "text": " That way, you can prioritize the bugs with the\n highest impact and work to fix them.\nHow can you determine how often your users experiences bugs?\n Whenever an error occurs, create a report containing the\n error that occurred and the associated stacktrace.\n You can then send the report to an error tracking\n service, such as Bugsnag , Datadog , Firebase Crashlytics , Rollbar , or Sentry.\nThe error"}
979{"url": "https://docs.flutter.dev/cookbook/maintenance/error-reporting", "title": "Untitled", "text": " service, such as Bugsnag , Datadog , Firebase Crashlytics , Rollbar , or Sentry.\nThe error tracking service aggregates all of the crashes your users\n experience and groups them together. This allows you to know how often your\n app fails and where the users run into trouble.\nIn this recipe, learn how to report errors to the Sentry crash reporting service using\n the following steps:\nGet a DSN from Sentry.\nImport the Flutter Sentry packag"}
980{"url": "https://docs.flutter.dev/cookbook/maintenance/error-reporting", "title": "Untitled", "text": "using\n the following steps:\nGet a DSN from Sentry.\nImport the Flutter Sentry package\nInitialize the Sentry SDK\nCapture errors programmatically\n1. Get a DSN from Sentry\nBefore reporting errors to Sentry, you need a \"DSN\" to uniquely identify\n your app with the Sentry.io service.\nTo get a DSN, use the following steps:\nCreate an account with Sentry .\nLog in to the account.\nCreate a new Flutter project.\nCopy the code snippet that includes the DSN.\n2. Import the Sent"}
981{"url": "https://docs.flutter.dev/cookbook/maintenance/error-reporting", "title": "Untitled", "text": "count.\nCreate a new Flutter project.\nCopy the code snippet that includes the DSN.\n2. Import the Sentry package\nImport the sentry_flutter package into the app.\n The sentry package makes it easier to send\n error reports to the Sentry error tracking service.\nTo add the sentry_flutter package as a dependency,\n run flutter pub add :\n3. Initialize the Sentry SDK\nInitialize the SDK to capture different unhandled errors automatically:\nAlternatively, you"}
982{"url": "https://docs.flutter.dev/cookbook/maintenance/error-reporting", "title": "Untitled", "text": "entry SDK\nInitialize the SDK to capture different unhandled errors automatically:\nAlternatively, you can pass the DSN to Flutter using the dart-define tag:\nWhat does that give me?\nThis is all you need for Sentry to\n capture unhandled errors in Dart and native layers.\n This includes Swift, Objective-C, C, and C++ on iOS, and\n Java, Kotlin, C, and C++ on Android.\n4. Capture errors programmatically\nBesides the automatic error reporting that Sentry "}
983{"url": "https://docs.flutter.dev/cookbook/maintenance/error-reporting", "title": "Untitled", "text": "++ on Android.\n4. Capture errors programmatically\nBesides the automatic error reporting that Sentry generates by\n importing and initializing the SDK,\n you can use the API to report errors to Sentry:\nFor more information, see the Sentry API docs on pub.dev.\nLearn more\nExtensive documentation about using the Sentry SDK can be found on Sentry's site .\nComplete example\nTo view a working example,\n see the Sentry flutter example app.\nUnless stated oth"}
984{"url": "https://docs.flutter.dev/cookbook/maintenance/error-reporting", "title": "Untitled", "text": "e\nTo view a working example,\n see the Sentry flutter example app.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
985{"url": "https://docs.flutter.dev/cookbook/maintenance", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nHow to keep track of errors that users encounter.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
986{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nGamers have various motivations for playing games.\n In broad strokes, there are four major motivations: immersion, achievement, cooperation, and competition .\n No matter the game you build, some players want to achieve in it.\n This could be trophies won or secrets unlocked.\n Some players want to compete in it.\n This could be hitting high "}
987{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "\n Some players want to compete in it.\n This could be hitting high scores or accomplishing speedruns.\n These two ideas map to the concepts of achievements and leaderboards .\nEcosystems such as the App Store and Google Play provide\n centralized services for achievements and leaderboards.\n Players can view achievements from all their games in one place and\n developers don't need to re-implement the"}
988{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "ts from all their games in one place and\n developers don't need to re-implement them for every game.\nThis recipe demonstrates how to use the games_services package to add achievements and leaderboard functionality to your mobile game.\n1. Enable platform services\nTo enable games services, set up Game Center on iOS and Google Play Games Services on Android.\niOS\nTo enable Game Center (GameKit) on iOS:\nOpen your Flutter project in Xcode.\n Open ios/Runner.xcworks"}
989{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": " (GameKit) on iOS:\nOpen your Flutter project in Xcode.\n Open ios/Runner.xcworkspace\nOpen your Flutter project in Xcode.\n Open ios/Runner.xcworkspace\nSelect the root Runner project.\nSelect the root Runner project.\nGo to the Signing & Capabilities tab.\nGo to the Signing & Capabilities tab.\nClick the + button to add Game Center as a capability.\nClick the + button to add Game Center as a capability.\nClose Xcode.\nClose Xcode.\nIf you haven't already,\n "}
990{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "tton to add Game Center as a capability.\nClose Xcode.\nClose Xcode.\nIf you haven't already,\n register your game in App Store Connect and from the My App section press the + icon.\nIf you haven't already,\n register your game in App Store Connect and from the My App section press the + icon.\nStill in App Store Connect, look for the Game Center section. You\n can find it in Services as of this writing. On the Game\n C"}
991{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": " can find it in Services as of this writing. On the Game\n Center page, you might want to set up a leaderboard and several\n achievements, depending on your game. Take note of the IDs of the\n leaderboards and achievements you create.\nStill in App Store Connect, look for the Game Center section. You\n can find it in Services as of this writing. On the Game\n Center page, you "}
992{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": " can find it in Services as of this writing. On the Game\n Center page, you might want to set up a leaderboard and several\n achievements, depending on your game. Take note of the IDs of the\n leaderboards and achievements you create.\nAndroid\nTo enable Play Games Services on Android:\nIf you haven't already, go to Google Play Console and register your game there.\nIf you haven't already, go to Google Play Console and register your gam"}
993{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "nd register your game there.\nIf you haven't already, go to Google Play Console and register your game there.\nStill in Google Play Console, select Play Games Services → Setup\n and management → Configuration from the navigation menu and\n follow their instructions. This takes a significant amount of time and patience.\n Among other things, you'll need to set up an\n OAuth consent screen in Google Cloud Conso"}
994{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "hings, you'll need to set up an\n OAuth consent screen in Google Cloud Console.\n If at any point you feel lost, consult the\n official Play Games Services guide .\nStill in Google Play Console, select Play Games Services → Setup\n and management → Configuration from the navigation menu and\n follow their instructions.\nThis takes a significant amount of time and patience.\n "}
995{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": " follow their instructions.\nThis takes a significant amount of time and patience.\n Among other things, you'll need to set up an\n OAuth consent screen in Google Cloud Console.\n If at any point you feel lost, consult the\n official Play Games Services guide .\nThis takes a significant amount of time and patience.\n Among other things, you'll need to set up an\n "}
996{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "me and patience.\n Among other things, you'll need to set up an\n OAuth consent screen in Google Cloud Console.\n If at any point you feel lost, consult the\n official Play Games Services guide .\nWhen done, you can start adding leaderboards and achievements in Play Games Services → Setup and management . Create the exact\n same set as you did on the iOS side. Make note of IDs.\nWhen"}
997{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": ". Create the exact\n same set as you did on the iOS side. Make note of IDs.\nWhen done, you can start adding leaderboards and achievements in Play Games Services → Setup and management . Create the exact\n same set as you did on the iOS side. Make note of IDs.\nGo to Play Games Services → Setup and management → Publishing .\nGo to Play Games Services → Setup and management → Publishing .\nClick Publish . Don't worry, this doesn't actually publish your\n "}
998{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "d management → Publishing .\nClick Publish . Don't worry, this doesn't actually publish your\n game. It only publishes the achievements and leaderboard. Once a\n leaderboard, for example, is published this way, it cannot be\n unpublished.\nClick Publish . Don't worry, this doesn't actually publish your\n game. It only publishes the achievements and leaderboard. Once a\n leaderboard, for example, is "}
999{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "blishes the achievements and leaderboard. Once a\n leaderboard, for example, is published this way, it cannot be\n unpublished.\nGo to Play Games Services → Setup and management →\n Configuration → Credentials .\nGo to Play Games Services → Setup and management →\n Configuration → Credentials .\nFind the Get resources button.\n It returns an XML file with the Play Games Services IDs. xml <!-- THI"}
1000{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": " button.\n It returns an XML file with the Play Games Services IDs. xml <!-- THIS IS JUST AN EXAMPLE --> <?xml version=\"1.0\" encoding=\"utf-8\"?> <resources> <!-- app_id --> <string name=\"app_id\" translatable=\"false\"> 424242424242 </string> <!-- package_name --> <string name=\"package_name\" translatable=\"false\"> dev.flutter.tictactoe </string> <!-- achievement First win --> <string name=\"achievement_first_win\" translatable=\"false\"> sOmEiDsTrInG </string> <!-- leaderboard Highest"}
1001{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "g name=\"achievement_first_win\" translatable=\"false\"> sOmEiDsTrInG </string> <!-- leaderboard Highest Score --> <string name=\"leaderboard_highest_score\" translatable=\"false\"> sOmEiDsTrInG </string> </resources> content_copy\nFind the Get resources button.\n It returns an XML file with the Play Games Services IDs.\nAdd a file at android/app/src/main/res/values/games-ids.xml containing the XML you received in the previous step.\nAdd a file at android/app/src/main/res/values/games-i"}
1002{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "ing the XML you received in the previous step.\nAdd a file at android/app/src/main/res/values/games-ids.xml containing the XML you received in the previous step.\n2. Sign in to the game service\nNow that you have set up Game Center and Play Games Services , and\n have your achievement & leaderboard IDs ready, it's finally Dart time.\nAdd a dependency on the games_services package . $ flutter pub add games_services content_copy\nAdd a dependency on the games_services package .\nBefore y"}
1003{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "lutter pub add games_services content_copy\nAdd a dependency on the games_services package .\nBefore you can do anything else, you have to sign the player into\n the game service. dart try { await GamesServices . signIn ( ) ; } on PlatformException catch ( e ) { // ... deal with failures ... } content_copy\nBefore you can do anything else, you have to sign the player into\n the game service.\nThe sign in happens in the background. It takes several seconds, so\n"}
1004{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": " the game service.\nThe sign in happens in the background. It takes several seconds, so\n don't call signIn() before runApp() or the players will be forced to\n stare at a blank screen every time they start your game.\nThe API calls to the games_services API can fail for a multitude of\n reasons. Therefore, every call should be wrapped in a try-catch block as\n in the previous example. The rest of this recipe omits except"}
1005{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "a try-catch block as\n in the previous example. The rest of this recipe omits exception\n handling for clarity.\n3. Unlock achievements\nRegister achievements in Google Play Console and App Store Connect,\n and take note of their IDs. Now you can award any of those\n achievements from your Dart code: dart await GamesServices . unlock ( achievement : Achievement ( androidID : ' your android id ' , iOSID : ' your ios id ' , ) , "}
1006{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "nlock ( achievement : Achievement ( androidID : ' your android id ' , iOSID : ' your ios id ' , ) , ) ; content_copy The player's account on Google Play Games or Apple Game Center now\n lists the achievement.\nRegister achievements in Google Play Console and App Store Connect,\n and take note of their IDs. Now you can award any of those\n achievements from your Dart code:\nThe player's account on Google Play Games or Apple Game Center now"}
1007{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "achievements from your Dart code:\nThe player's account on Google Play Games or Apple Game Center now\n lists the achievement.\nTo display the achievements UI from your game, call the games_services API: dart await GamesServices . showAchievements ( ) ; content_copy This displays the platform achievements UI as an overlay on your game.\nTo display the achievements UI from your game, call the games_services API:\nThis displays the platform achievements UI as an overlay on your gam"}
1008{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "e, call the games_services API:\nThis displays the platform achievements UI as an overlay on your game.\nTo display the achievements in your own UI, use GamesServices.loadAchievements() .\nTo display the achievements in your own UI, use GamesServices.loadAchievements() .\n4. Submit scores\nWhen the player finishes a play-through, your game can submit the result\n of that play session into one or more leaderboards.\nFor example, a platformer game like Super Mario can submit both the\n "}
1009{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "to one or more leaderboards.\nFor example, a platformer game like Super Mario can submit both the\n final score and the time taken to complete the level, to two separate\n leaderboards.\nIn the first step, you registered a leaderboard in Google Play\n Console and App Store Connect, and took note of its ID. Using this\n ID, you can submit new scores for the player: dart await GamesServices . submitScore ( score : Score ( iOSLea"}
1010{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "an submit new scores for the player: dart await GamesServices . submitScore ( score : Score ( iOSLeaderboardID : ' some_id_from_app_store ' , androidLeaderboardID : ' sOmE_iD_fRoM_gPlAy ' , value : 100 , ) , ) ; content_copy You don't need to check whether the new score is the player's\n highest. The platform game services handle that for you.\nIn the first step, you registered a leaderboard in Google Play\n Console and App Store Connect, and took note of i"}
1011{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "a leaderboard in Google Play\n Console and App Store Connect, and took note of its ID. Using this\n ID, you can submit new scores for the player:\nYou don't need to check whether the new score is the player's\n highest. The platform game services handle that for you.\nTo display the leaderboard as an overlay over your game, make the\n following call: dart await GamesServices . showLeaderboards ( iOSLeaderboardID : ' so"}
1012{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": " following call: dart await GamesServices . showLeaderboards ( iOSLeaderboardID : ' some_id_from_app_store ' , androidLeaderboardID : ' sOmE_iD_fRoM_gPlAy ' , ) ; content_copy\nTo display the leaderboard as an overlay over your game, make the\n following call:\nIf you want to display the leaderboard scores in your own UI, you\n can fetch them with GamesServices.loadLeaderboardScores() .\nIf you want to display the leaderboard scores in your own "}
1013{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "h GamesServices.loadLeaderboardScores() .\nIf you want to display the leaderboard scores in your own UI, you\n can fetch them with GamesServices.loadLeaderboardScores() .\n5. Next steps\nThere's more to the games_services plugin. With this plugin, you can:\nGet the player's icon, name or unique ID\nSave and load game states\nSign out of the game service\nSome achievements can be incremental. For example: \"You have collected\n all 10 pieces of the McGuffin.\"\nEach game"}
1014{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "mental. For example: \"You have collected\n all 10 pieces of the McGuffin.\"\nEach game has different needs from game services.\nTo start, you might want to create this controller\n in order to keep all achievements & leaderboards logic in one place:\nMore information\nThe Flutter Casual Games Toolkit includes the following templates:\nbasic : basic starter game\ncard : starter card game\nendless runner : starter game (using Flame)\n where the player endl"}
1015{"url": "https://docs.flutter.dev/cookbook/games/achievements-leaderboard", "title": "Untitled", "text": "rter card game\nendless runner : starter game (using Flame)\n where the player endlessly runs, avoiding pitfalls\n and gaining rewards\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1016{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nMultiplayer games need a way to synchronize game states between players.\n Broadly speaking, two types of multiplayer games exist:\nHigh tick rate .\n These games need to synchronize game states many times per second\n with low latency.\n These would include action games, sports games, fighting games.\nHigh tick rate .\n These ga"}
1017{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": " include action games, sports games, fighting games.\nHigh tick rate .\n These games need to synchronize game states many times per second\n with low latency.\n These would include action games, sports games, fighting games.\nLow tick rate .\n These games only need to synchronize game states occasionally\n with latency having less impact.\n These would include card games, strateg"}
1018{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": " with latency having less impact.\n These would include card games, strategy games, puzzle games.\nLow tick rate .\n These games only need to synchronize game states occasionally\n with latency having less impact.\n These would include card games, strategy games, puzzle games.\nThis resembles the differentiation between real-time versus turn-based\n games, though the analogy falls short.\n "}
1019{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "ween real-time versus turn-based\n games, though the analogy falls short.\n For example, real-time strategy games run—as the name suggests—in\n real-time, but that doesn't correlate to a high tick rate.\n These games can simulate much of what happens\n in between player interactions on local machines.\n Therefore, they don't need to synchronize game states that often.\nIf you can choose low tick rates "}
1020{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": " Therefore, they don't need to synchronize game states that often.\nIf you can choose low tick rates as a developer, you should.\n Low tick lowers latency requirements and server costs.\n Sometimes, a game requires high tick rates of synchronization.\n For those cases, solutions such as Firestore don't make a good fit .\n Pick a dedicated multiplayer server solution such as Nakama .\n Nakama has a Dart package .\nIf yo"}
1021{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "ted multiplayer server solution such as Nakama .\n Nakama has a Dart package .\nIf you expect that your game requires a low tick rate of synchronization,\n continue reading.\nThis recipe demonstrates how to use the cloud_firestore package to implement multiplayer capabilities in your game.\n This recipe doesn't require a server.\n It uses two or more clients sharing game state using Cloud Firestore.\n1. Prepare your game for multiplaye"}
1022{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "es two or more clients sharing game state using Cloud Firestore.\n1. Prepare your game for multiplayer\nWrite your game code to allow changing the game state\n in response to both local events and remote events.\n A local event could be a player action or some game logic.\n A remote event could be a world update coming from the server.\nTo simplify this cookbook recipe, start with\n the card template that you'll find\n "}
1023{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": " cookbook recipe, start with\n the card template that you'll find\n in the flutter/games repository .\n Run the following command to clone that repository:\nOpen the project in templates/card .\n2. Install Firestore\nCloud Firestore is a horizontally scaling,\n NoSQL document database in the cloud.\n It includes built-in live synchronization.\n This is perfect for our needs.\n It keeps th"}
1024{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "live synchronization.\n This is perfect for our needs.\n It keeps the game state updated in the cloud database,\n so every player sees the same state.\nIf you want a quick, 15-minute primer on Cloud Firestore,\n check out the following video:\nWatch on YouTube in a new tab: \"What is a NoSQL Database? Learn about Cloud Firestore\"\nTo add Firestore to your Flutter project,\n follow the first two steps of the Get started w"}
1025{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "Firestore to your Flutter project,\n follow the first two steps of the Get started with Cloud Firestore guide:\nCreate a Cloud Firestore database\nSet up your development environment\nThe desired outcomes include:\nA Firestore database ready in the cloud, in Test mode\nA generated firebase_options.dart file\nThe appropriate plugins added to your pubspec.yaml\nYou don't need to write any Dart code in this step.\n As soon as you understand the step of writing\n "}
1026{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "art code in this step.\n As soon as you understand the step of writing\n Dart code in that guide, return to this recipe.\n3. Initialize Firestore\nOpen lib/main.dart and import the plugins,\n as well as the firebase_options.dart file\n that was generated by flutterfire configure in the previous step. dart import ' package:cloud_firestore/cloud_firestore.dart ' ; import ' package:firebase_core/firebase_core.dart ' ; import "}
1027{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "d_firestore/cloud_firestore.dart ' ; import ' package:firebase_core/firebase_core.dart ' ; import ' firebase_options.dart ' ; content_copy\nOpen lib/main.dart and import the plugins,\n as well as the firebase_options.dart file\n that was generated by flutterfire configure in the previous step.\nAdd the following code just above the call to runApp() in lib/main.dart : dart WidgetsFlutterBinding . ensureInitialized ( ) ; await Firebase . initializeApp ( "}
1028{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "main.dart : dart WidgetsFlutterBinding . ensureInitialized ( ) ; await Firebase . initializeApp ( options : DefaultFirebaseOptions . currentPlatform ) ; content_copy This ensures that Firebase is initialized on game startup.\nAdd the following code just above the call to runApp() in lib/main.dart :\nThis ensures that Firebase is initialized on game startup.\nAdd the Firestore instance to the app.\n That way, any widget can access this instance.\n Widgets "}
1029{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": " That way, any widget can access this instance.\n Widgets can also react to the instance missing, if needed. To do this with the card template, you can use\n the provider package\n (which is already installed as a dependency). Replace the boilerplate runApp(MyApp()) with the following: dart runApp ( Provider . value ( value : FirebaseFirestore . instance , child : MyApp ( ) ) ) ; content_copy Put the provider abo"}
1030{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "e ( value : FirebaseFirestore . instance , child : MyApp ( ) ) ) ; content_copy Put the provider above MyApp , not inside it.\n This enables you to test the app without Firebase. :::note\n In case you are not working with the card template,\n you must either install the provider package or use your own method of accessing the FirebaseFirestore instance from various parts of your codebase.\n :::\nAdd the Firestore "}
1031{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "irestore instance from various parts of your codebase.\n :::\nAdd the Firestore instance to the app.\n That way, any widget can access this instance.\n Widgets can also react to the instance missing, if needed.\nTo do this with the card template, you can use\n the provider package\n (which is already installed as a dependency).\nReplace the boilerplate runApp(MyApp()) with the following:\nPut the"}
1032{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "eady installed as a dependency).\nReplace the boilerplate runApp(MyApp()) with the following:\nPut the provider above MyApp , not inside it.\n This enables you to test the app without Firebase.\n:::note\n In case you are not working with the card template,\n you must either install the provider package or use your own method of accessing the FirebaseFirestore instance from various parts of your codebase.\n :::\n4. Cr"}
1033{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "the FirebaseFirestore instance from various parts of your codebase.\n :::\n4. Create a Firestore controller class\nThough you can talk to Firestore directly,\n you should write a dedicated controller class\n to make the code more readable and maintainable.\nHow you implement the controller depends on your game\n and on the exact design of your multiplayer experience.\n For the case of the card template,\n "}
1034{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "ign of your multiplayer experience.\n For the case of the card template,\n you could synchronize the contents of the two circular playing areas.\n It's not enough for a full multiplayer experience,\n but it's a good start.\nTo create a controller, copy,\n then paste the following code into a new file called lib/multiplayer/firestore_controller.dart .\nNotice the following features of this code:\nThe controller's constru"}
1035{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "yer/firestore_controller.dart .\nNotice the following features of this code:\nThe controller's constructor takes a BoardState .\n This enables the controller to manipulate the local state of the game.\nThe controller's constructor takes a BoardState .\n This enables the controller to manipulate the local state of the game.\nThe controller subscribes to both local changes to update Firestore\n and to remote changes to update the local state "}
1036{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "l changes to update Firestore\n and to remote changes to update the local state and UI.\nThe controller subscribes to both local changes to update Firestore\n and to remote changes to update the local state and UI.\nThe fields _areaOneRef and _areaTwoRef are\n Firebase document references.\n They describe where the data for each area resides,\n and how to convert between the local Dart objects ( Lis"}
1037{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "for each area resides,\n and how to convert between the local Dart objects ( List<PlayingCard> )\n and remote JSON objects ( Map<String, dynamic> ).\n The Firestore API lets us subscribe to these references\n with .snapshots() , and write to them with .set() .\nThe fields _areaOneRef and _areaTwoRef are\n Firebase document references.\n They describe where the data for each area"}
1038{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": " Firebase document references.\n They describe where the data for each area resides,\n and how to convert between the local Dart objects ( List<PlayingCard> )\n and remote JSON objects ( Map<String, dynamic> ).\n The Firestore API lets us subscribe to these references\n with .snapshots() , and write to them with .set() .\n5. Use the Firestore controller\nOpen the file responsible for starting t"}
1039{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "write to them with .set() .\n5. Use the Firestore controller\nOpen the file responsible for starting the play session: lib/play_session/play_session_screen.dart in the case of the card template.\n You instantiate the Firestore controller from this file.\nOpen the file responsible for starting the play session: lib/play_session/play_session_screen.dart in the case of the card template.\n You instantiate the Firestore controller from this file.\nImport Firebas"}
1040{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "late.\n You instantiate the Firestore controller from this file.\nImport Firebase and the controller: dart import ' package:cloud_firestore/cloud_firestore.dart ' ; import ' ../multiplayer/firestore_controller.dart ' ; content_copy\nImport Firebase and the controller:\nAdd a nullable field to the _PlaySessionScreenState class\n to contain a controller instance: dart FirestoreController ? _firestoreController ; content_copy\nAdd a nullable field to the _PlayS"}
1041{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "e: dart FirestoreController ? _firestoreController ; content_copy\nAdd a nullable field to the _PlaySessionScreenState class\n to contain a controller instance:\nIn the initState() method of the same class,\n add code that tries to read the FirebaseFirestore instance\n and, if successful, constructs the controller.\n You added the FirebaseFirestore instance to main.dart in the Initialize Firestore step. dart final "}
1042{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": " You added the FirebaseFirestore instance to main.dart in the Initialize Firestore step. dart final firestore = context . read < FirebaseFirestore ? > ( ) ; if ( firestore == null ) { _log . warning ( \" Firestore instance wasn't provided. \" ' Running without _firestoreController. ' , ) ; } else { _firestoreController = FirestoreController ( instance : firestore , boardState : _boardState , ) ; } content_copy\nIn the initState() method of the same class,\n add code that tries "}
1043{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "ontent_copy\nIn the initState() method of the same class,\n add code that tries to read the FirebaseFirestore instance\n and, if successful, constructs the controller.\n You added the FirebaseFirestore instance to main.dart in the Initialize Firestore step.\nDispose of the controller using the dispose() method\n of the same class. dart _firestoreController ?. dispose ( ) ; content_copy\nDispose of the controller usi"}
1044{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "he same class. dart _firestoreController ?. dispose ( ) ; content_copy\nDispose of the controller using the dispose() method\n of the same class.\n6. Test the game\nRun the game on two separate devices\n or in 2 different windows on the same device.\nRun the game on two separate devices\n or in 2 different windows on the same device.\nWatch how adding a card to an area on one device\n makes it appear on the other one."}
1045{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": " how adding a card to an area on one device\n makes it appear on the other one.\nWatch how adding a card to an area on one device\n makes it appear on the other one.\nOpen the Firebase web console and navigate to your project's Firestore Database.\nOpen the Firebase web console and navigate to your project's Firestore Database.\nWatch how it updates the data in real time.\n You can even edit the data in the console\n "}
1046{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "n real time.\n You can even edit the data in the console\n and see all running clients update.\nWatch how it updates the data in real time.\n You can even edit the data in the console\n and see all running clients update.\nTroubleshooting\nThe most common issues you might encounter when testing\n Firebase integration include the following:\nThe game crashes when trying to reach Firebase. Firebase inte"}
1047{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "ase integration include the following:\nThe game crashes when trying to reach Firebase. Firebase integration hasn't been properly set up.\n Revisit Step 2 and make sure to run flutterfire configure as part of that step.\nThe game crashes when trying to reach Firebase.\nFirebase integration hasn't been properly set up.\n Revisit Step 2 and make sure to run flutterfire configure as part of that step.\nThe game doesn't communicate with Firebase on macOS. By d"}
1048{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "lutterfire configure as part of that step.\nThe game doesn't communicate with Firebase on macOS. By default, macOS apps don't have internet access.\n Enable internet entitlement first.\nThe game doesn't communicate with Firebase on macOS.\nBy default, macOS apps don't have internet access.\n Enable internet entitlement first.\n7. Next steps\nAt this point, the game has near-instant and\n dependable synchronization of state across clients.\n "}
1049{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "e game has near-instant and\n dependable synchronization of state across clients.\n It lacks actual game rules:\n what cards can be played when, and with what results.\n This depends on the game itself and is left to you to try.\nAt this point, the shared state of the match only includes\n the two playing areas and the cards within them.\n You can save other data into _matchRef , too,\n "}
1050{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "cards within them.\n You can save other data into _matchRef , too,\n like who the players are and whose turn it is.\n If you're unsure where to start,\n follow a Firestore codelab or two to familiarize yourself with the API.\nAt first, a single match should suffice\n for testing your multiplayer game with colleagues and friends.\n As you approach the release date,\n think about authenti"}
1051{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": " friends.\n As you approach the release date,\n think about authentication and match-making.\n Thankfully, Firebase provides a built-in way to authenticate users and the Firestore database structure can handle multiple matches.\n Instead of a single match_1 ,\n you can populate the matches collection with as many records as needed.\nAn online match can start in a \"waiting\" state,\n with only the first "}
1052{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": "ds as needed.\nAn online match can start in a \"waiting\" state,\n with only the first player present.\n Other players can see the \"waiting\" matches in some kind of lobby.\n Once enough players join a match, it becomes \"active\".\n Once again, the exact implementation depends on\n the kind of online experience you want.\n The basics remain the same:\n a large collection of documents,\n "}
1053{"url": "https://docs.flutter.dev/cookbook/games/firestore-multiplayer", "title": "Untitled", "text": " The basics remain the same:\n a large collection of documents,\n each representing one active or potential match.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1054{"url": "https://docs.flutter.dev/cookbook/games", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nHow to use the games_services plugin to add functionality to your game.\nHow to use use Firebase Cloud Firestore to implement multiplayer in your game.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1055{"url": "https://docs.flutter.dev/cookbook/plugins/play-video", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nPlaying videos is a common task in app development,\n and Flutter apps are no exception. To play videos,\n the Flutter team provides the video_player plugin.\n You can use the video_player plugin to play videos\n stored on the file system, as an asset, or from the internet.\nOn iOS, the video_player plugin makes use of AVPlayer to handle playback. On Android,\n"}
1056{"url": "https://docs.flutter.dev/cookbook/plugins/play-video", "title": "Untitled", "text": "the internet.\nOn iOS, the video_player plugin makes use of AVPlayer to handle playback. On Android,\n it uses ExoPlayer .\nThis recipe demonstrates how to use the video_player package to stream a\n video from the internet with basic play and pause controls using\n the following steps:\nAdd the video_player dependency.\nAdd permissions to your app.\nCreate and initialize a VideoPlayerController .\nDisplay the video player.\nPlay and pause the video.\n1. Ad"}
1057{"url": "https://docs.flutter.dev/cookbook/plugins/play-video", "title": "Untitled", "text": "e and initialize a VideoPlayerController .\nDisplay the video player.\nPlay and pause the video.\n1. Add the video_player dependency\nThis recipe depends on one Flutter plugin: video_player .\n First, add this dependency to your project.\nTo add the video_player package as a dependency, run flutter pub add :\n2. Add permissions to your app\nNext, update your android and ios configurations to ensure\n that your app has the correct permissions to stream videos\n "}
1058{"url": "https://docs.flutter.dev/cookbook/plugins/play-video", "title": "Untitled", "text": " to ensure\n that your app has the correct permissions to stream videos\n from the internet.\nAndroid\nAdd the following permission to the AndroidManifest.xml file just after the <application> definition. The AndroidManifest.xml file is found at <project root>/android/app/src/main/AndroidManifest.xml .\niOS\nFor iOS, add the following to the Info.plist file found at <project root>/ios/Runner/Info.plist .\nmacOS\nIf you use network-based videos, add the com.apple.securit"}
1059{"url": "https://docs.flutter.dev/cookbook/plugins/play-video", "title": "Untitled", "text": "oject root>/ios/Runner/Info.plist .\nmacOS\nIf you use network-based videos, add the com.apple.security.network.client entitlement .\nWeb\nFlutter web does not support dart:io ,\n so avoid using the VideoPlayerController.file constructor for the plugin.\n Using this constructor attempts to create a VideoPlayerController.file that throws an UnimplementedError .\nDifferent web browsers might have different video-playback capabilities,\n such as supported "}
1060{"url": "https://docs.flutter.dev/cookbook/plugins/play-video", "title": "Untitled", "text": " web browsers might have different video-playback capabilities,\n such as supported formats or autoplay.\n Check the video_player_web package for more web-specific information.\nThe VideoPlayerOptions.mixWithOthers option can't be implemented in web,\n at least at the moment. If you use this option in web it will be silently ignored.\n3. Create and initialize a VideoPlayerController\nNow that you have the video_player plugin installed with the correct"}
1061{"url": "https://docs.flutter.dev/cookbook/plugins/play-video", "title": "Untitled", "text": "tialize a VideoPlayerController\nNow that you have the video_player plugin installed with the correct\n permissions, create a VideoPlayerController . The VideoPlayerController class allows you to connect to different types of\n videos and control playback.\nBefore you can play videos, you must also initialize the controller.\n This establishes the connection to the video and prepare the\n controller for playback.\nTo create and initial"}
1062{"url": "https://docs.flutter.dev/cookbook/plugins/play-video", "title": "Untitled", "text": "ection to the video and prepare the\n controller for playback.\nTo create and initialize the VideoPlayerController do the following:\nCreate a StatefulWidget with a companion State class\nAdd a variable to the State class to store the VideoPlayerController\nAdd a variable to the State class to store the Future returned from VideoPlayerController.initialize\nCreate and initialize the controller in the initState method\nDispose of the controller in the dispose method\n4. Display the video"}
1063{"url": "https://docs.flutter.dev/cookbook/plugins/play-video", "title": "Untitled", "text": "troller in the initState method\nDispose of the controller in the dispose method\n4. Display the video player\nNow, display the video. The video_player plugin provides the VideoPlayer widget to display the video initialized by\n the VideoPlayerController .\n By default, the VideoPlayer widget takes up as much space as possible.\n This often isn't ideal for videos because they are meant\n to be displayed in a specific aspect ratio, such"}
1064{"url": "https://docs.flutter.dev/cookbook/plugins/play-video", "title": "Untitled", "text": "for videos because they are meant\n to be displayed in a specific aspect ratio, such as 16x9 or 4x3.\nTherefore, wrap the VideoPlayer widget in an AspectRatio widget to ensure that the video has the correct proportions.\nFurthermore, you must display the VideoPlayer widget after the _initializeVideoPlayerFuture() completes. Use FutureBuilder to\n display a loading spinner until the controller finishes initializing.\n Note: initializing the controller"}
1065{"url": "https://docs.flutter.dev/cookbook/plugins/play-video", "title": "Untitled", "text": "nner until the controller finishes initializing.\n Note: initializing the controller does not begin playback.\n5. Play and pause the video\nBy default, the video starts in a paused state. To begin playback,\n call the play() method provided by the VideoPlayerController .\n To pause playback, call the pause() method.\nFor this example,\n add a FloatingActionButton to your app that displays a play\n or pause icon dependin"}
1066{"url": "https://docs.flutter.dev/cookbook/plugins/play-video", "title": "Untitled", "text": "add a FloatingActionButton to your app that displays a play\n or pause icon depending on the situation.\n When the user taps the button,\n play the video if it's currently paused,\n or pause the video if it's playing.\nComplete example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1067{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nMany developers use advertising to monetize their mobile apps and games.\n This allows their app to be downloaded free of charge,\n which improves the app's popularity.\nTo add ads to your Flutter project, use AdMob ,\n Google's mobile advertising platform.\n This recipe demonstrates how to use the google_mobile_ads package to add a banner ad to your app or ga"}
1068{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": "is recipe demonstrates how to use the google_mobile_ads package to add a banner ad to your app or game.\n1. Get AdMob App IDs\nGo to AdMob and set up an\n account. This could take some time because you need to provide\n banking information, sign contracts, and so on.\nGo to AdMob and set up an\n account. This could take some time because you need to provide\n banking information, sign contracts, and so on.\nWith the AdMo"}
1069{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": " need to provide\n banking information, sign contracts, and so on.\nWith the AdMob account ready, create two Apps in AdMob: one for\n Android and one for iOS.\nWith the AdMob account ready, create two Apps in AdMob: one for\n Android and one for iOS.\nOpen the App settings section.\nOpen the App settings section.\nGet the AdMob App IDs for both the Android app and the iOS app.\n They resemble ca-app-pub-1234567890123456~1"}
1070{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": "h the Android app and the iOS app.\n They resemble ca-app-pub-1234567890123456~1234567890 . Note the\n tilde ( ~ ) between the two numbers.\nGet the AdMob App IDs for both the Android app and the iOS app.\n They resemble ca-app-pub-1234567890123456~1234567890 . Note the\n tilde ( ~ ) between the two numbers.\n2. Platform-specific setup\nUpdate your Android and iOS configurations to include your App IDs.\nAndroid\nAdd your"}
1071{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": "-specific setup\nUpdate your Android and iOS configurations to include your App IDs.\nAndroid\nAdd your AdMob app ID to your Android app.\nOpen the app's android/app/src/main/AndroidManifest.xml file.\nOpen the app's android/app/src/main/AndroidManifest.xml file.\nAdd a new <meta-data> tag.\nAdd a new <meta-data> tag.\nSet the android:name element with a value of com.google.android.gms.ads.APPLICATION_ID .\nSet the android:name element with a value of com.google.android.gms.ads.APPLICATION_ID .\nSet the a"}
1072{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": ".\nSet the android:name element with a value of com.google.android.gms.ads.APPLICATION_ID .\nSet the android:value element with the value to your own AdMob app\n ID that you got in the previous step.\n Include them in quotes as shown: xml <manifest> <application> ... <!-- Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713 --> < meta-data android:name=\"com.google.android.gms.ads.APPLICATION_ID\" android:value=\"ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy\""}
1073{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": "e=\"com.google.android.gms.ads.APPLICATION_ID\" android:value=\"ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy\"/> </application> </manifest> content_copy\nSet the android:value element with the value to your own AdMob app\n ID that you got in the previous step.\n Include them in quotes as shown:\niOS\nAdd your AdMob app ID to your iOS app.\nOpen your app's ios/Runner/Info.plist file.\nOpen your app's ios/Runner/Info.plist file.\nEnclose GADApplicationIdentifier with a key "}
1074{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": "plist file.\nOpen your app's ios/Runner/Info.plist file.\nEnclose GADApplicationIdentifier with a key tag.\nEnclose GADApplicationIdentifier with a key tag.\nEnclose your AdMob app ID with a string tag. You created this AdMob\n App ID in step 1 . xml <key> GADApplicationIdentifier </key> <string> ca-app-pub-################~########## </string> content_copy\nEnclose your AdMob app ID with a string tag. You created this AdMob\n App ID in step 1 .\n3. Add the goog"}
1075{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": "D with a string tag. You created this AdMob\n App ID in step 1 .\n3. Add the google_mobile_ads plugin\nTo add the google_mobile_ads plugin as a dependency, run flutter pub add :\n4. Initialize the Mobile Ads SDK\nYou need to initialize the Mobile Ads SDK before loading ads.\nCall MobileAds.instance.initialize() to initialize the Mobile Ads\n SDK. dart void main ( ) async { WidgetsFlutterBinding . ensureInitialized ( ) ; unawaited ( MobileAds . instance . initia"}
1076{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": " ) async { WidgetsFlutterBinding . ensureInitialized ( ) ; unawaited ( MobileAds . instance . initialize ( ) ) ; runApp ( const MyApp ( ) ) ; } content_copy\nCall MobileAds.instance.initialize() to initialize the Mobile Ads\n SDK.\nRun the initialization step at startup, as shown above,\n so that the AdMob SDK has enough time to initialize before it is needed.\n5. Load a banner ad\nTo show an ad, you need to request it from AdMob.\nTo load a banner ad, construct "}
1077{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": ". Load a banner ad\nTo show an ad, you need to request it from AdMob.\nTo load a banner ad, construct a BannerAd instance, and\n call load() on it.\nTo view a complete example, check out the last step of this recipe.\n6. Show banner ad\nOnce you have a loaded instance of BannerAd , use AdWidget to show it.\nIt's a good idea to wrap the widget in a SafeArea (so that no part of\n the ad is obstructed by device notches) and a SizedBox (so that it has\n its "}
1078{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": " the ad is obstructed by device notches) and a SizedBox (so that it has\n its specified, constant size before and after loading).\nYou must dispose of an ad when you no longer need to access it. The best\n practice for when to call dispose() is either after the AdWidget is\n removed from the widget tree or in the BannerAdListener.onAdFailedToLoad() callback.\n7. Configure ads\nTo show anything beyond test ads, you have to register ad units.\nOpen"}
1079{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": "d() callback.\n7. Configure ads\nTo show anything beyond test ads, you have to register ad units.\nOpen AdMob .\nOpen AdMob .\nCreate an Ad unit for each of the AdMob apps. This asks for the Ad unit's format. AdMob provides many formats\n beyond banner ads --- interstitials, rewarded ads, app open ads, and\n so on.\n The API for those is similar, and documented in the AdMob documentation and through official samples .\nCreate an Ad unit for e"}
1080{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": "ar, and documented in the AdMob documentation and through official samples .\nCreate an Ad unit for each of the AdMob apps.\nThis asks for the Ad unit's format. AdMob provides many formats\n beyond banner ads --- interstitials, rewarded ads, app open ads, and\n so on.\n The API for those is similar, and documented in the AdMob documentation and through official samples .\nChoose banner ads.\nChoose banner ads.\nGet the Ad unit IDs for both t"}
1081{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": " and through official samples .\nChoose banner ads.\nChoose banner ads.\nGet the Ad unit IDs for both the Android app and the iOS app.\n You can find these in the Ad units section. They look something\n like ca-app-pub-1234567890123456/1234567890 . The format resembles\n the App ID but with a slash ( / ) between the two numbers. This\n distinguishes an Ad unit ID from an App ID .\nGet the Ad unit IDs for both the Android"}
1082{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": " distinguishes an Ad unit ID from an App ID .\nGet the Ad unit IDs for both the Android app and the iOS app.\n You can find these in the Ad units section. They look something\n like ca-app-pub-1234567890123456/1234567890 . The format resembles\n the App ID but with a slash ( / ) between the two numbers. This\n distinguishes an Ad unit ID from an App ID .\nAdd these Ad unit IDs to the constructor of Banner"}
1083{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": " distinguishes an Ad unit ID from an App ID .\nAdd these Ad unit IDs to the constructor of BannerAd ,\n depending on the target app platform. dart final String adUnitId = Platform . isAndroid // Use this ad unit on Android... ? ' ca-app-pub-3940256099942544/6300978111 ' // ... or this one on iOS. : ' ca-app-pub-3940256099942544/2934735716 ' ; content_copy\nAdd these Ad unit IDs to the constructor of BannerAd ,\n depending on the target app platform.\n8. F"}
1084{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": "Ds to the constructor of BannerAd ,\n depending on the target app platform.\n8. Final touches\nTo display the ads in a published app or game (as opposed to debug or\n testing scenarios), your app must meet additional requirements:\nYour app must be reviewed and approved before it can fully serve\n ads.\n Follow AdMob's app readiness guidelines .\n For example, your app must be listed on at least one of t"}
1085{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": "adiness guidelines .\n For example, your app must be listed on at least one of the\n supported stores such as Google Play Store or Apple App Store.\nYour app must be reviewed and approved before it can fully serve\n ads.\n Follow AdMob's app readiness guidelines .\n For example, your app must be listed on at least one of the\n supported stores such as Google Play Store or Apple "}
1086{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": "ed on at least one of the\n supported stores such as Google Play Store or Apple App Store.\nYou must create an app-ads.txt file and publish it on your developer website.\nYou must create an app-ads.txt file and publish it on your developer website.\nTo learn more about app and game monetization,\n visit the official sites\n of AdMob and Ad Manager .\n9. Complete example\nThe following code implements a simple stateful widget that loads a\n "}
1087{"url": "https://docs.flutter.dev/cookbook/plugins/google-mobile-ads", "title": "Untitled", "text": "\n9. Complete example\nThe following code implements a simple stateful widget that loads a\n banner ad and shows it.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-06-25. View source or report an issue ."}
1088{"url": "https://docs.flutter.dev/cookbook/plugins/picture-using-camera", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nMany apps require working with the device's cameras to\n take photos and videos. Flutter provides the camera plugin\n for this purpose. The camera plugin provides tools to get a list of the\n available cameras, display a preview coming from a specific camera,\n and take photos or videos.\nThis recipe demonstrates how to use the camera plugin to display a prev"}
1089{"url": "https://docs.flutter.dev/cookbook/plugins/picture-using-camera", "title": "Untitled", "text": " and take photos or videos.\nThis recipe demonstrates how to use the camera plugin to display a preview,\n take a photo, and display it using the following steps:\nAdd the required dependencies.\nGet a list of the available cameras.\nCreate and initialize the CameraController .\nUse a CameraPreview to display the camera's feed.\nTake a picture with the CameraController .\nDisplay the picture with an Image widget.\n1. Add the required dependencies\nTo complete this recipe, you need to add"}
1090{"url": "https://docs.flutter.dev/cookbook/plugins/picture-using-camera", "title": "Untitled", "text": "ture with an Image widget.\n1. Add the required dependencies\nTo complete this recipe, you need to add three dependencies to your app:\nProvides tools to work with the cameras on the device.\nFinds the correct paths to store images.\nCreates paths that work on any platform.\nTo add the packages as dependencies, run flutter pub add :\n2. Get a list of the available cameras\nNext, get a list of available cameras using the camera plugin.\n3. Create and initialize the CameraController\nOnce you have a camera,"}
1091{"url": "https://docs.flutter.dev/cookbook/plugins/picture-using-camera", "title": "Untitled", "text": "meras using the camera plugin.\n3. Create and initialize the CameraController\nOnce you have a camera, use the following steps to\n create and initialize a CameraController .\n This process establishes a connection to\n the device's camera that allows you to control the camera\n and display a preview of the camera's feed.\nCreate a StatefulWidget with a companion State class.\nAdd a variable to the State class to store the CameraControl"}
1092{"url": "https://docs.flutter.dev/cookbook/plugins/picture-using-camera", "title": "Untitled", "text": "fulWidget with a companion State class.\nAdd a variable to the State class to store the CameraController .\nAdd a variable to the State class to store the Future returned from CameraController.initialize() .\nCreate and initialize the controller in the initState() method.\nDispose of the controller in the dispose() method.\n4. Use a CameraPreview to display the camera's feed\nNext, use the CameraPreview widget from the camera package to\n display a preview of the camera's feed.\nUse a F"}
1093{"url": "https://docs.flutter.dev/cookbook/plugins/picture-using-camera", "title": "Untitled", "text": " widget from the camera package to\n display a preview of the camera's feed.\nUse a FutureBuilder for exactly this purpose.\n5. Take a picture with the CameraController\nYou can use the CameraController to take pictures using the takePicture() method, which returns an XFile ,\n a cross-platform, simplified File abstraction.\n On both Android and IOS, the new image is stored in their\n respective cache directories,\n and"}
1094{"url": "https://docs.flutter.dev/cookbook/plugins/picture-using-camera", "title": "Untitled", "text": "e new image is stored in their\n respective cache directories,\n and the path to that location is returned in the XFile .\nIn this example, create a FloatingActionButton that takes a picture\n using the CameraController when a user taps on the button.\nTaking a picture requires 2 steps:\nEnsure that the camera is initialized.\nUse the controller to take a picture and ensure\n that it returns a Future<XFile> .\nIt is good practice to wr"}
1095{"url": "https://docs.flutter.dev/cookbook/plugins/picture-using-camera", "title": "Untitled", "text": "a picture and ensure\n that it returns a Future<XFile> .\nIt is good practice to wrap these operations in a try / catch block in order\n to handle any errors that might occur.\n6. Display the picture with an Image widget\nIf you take the picture successfully, you can then display the saved picture\n using an Image widget. In this case, the picture is stored as a file on\n the device.\nTherefore, you must provide a File to the Image.fi"}
1096{"url": "https://docs.flutter.dev/cookbook/plugins/picture-using-camera", "title": "Untitled", "text": "stored as a file on\n the device.\nTherefore, you must provide a File to the Image.file constructor.\n You can create an instance of the File class by passing the path created in\n the previous step.\nComplete example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1097{"url": "https://docs.flutter.dev/cookbook/plugins", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nHow to use the video_player plugin.\nHow to use the google_mobile_ads package to show ads in Flutter.\nHow to use a camera plugin on mobile.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1098{"url": "https://docs.flutter.dev/cookbook/navigation/named-routes", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nIn the Navigate to a new screen and back recipe,\n you learned how to navigate to a new screen by creating a new route and\n pushing it to the Navigator .\nHowever, if you need to navigate to the same screen in many parts\n of your app, this approach can result in code duplication.\n The solution is to define a named route ,\n and use the named"}
1099{"url": "https://docs.flutter.dev/cookbook/navigation/named-routes", "title": "Untitled", "text": "ion.\n The solution is to define a named route ,\n and use the named route for navigation.\nTo work with named routes,\n use the Navigator.pushNamed() function.\n This example replicates the functionality from the original recipe,\n demonstrating how to use named routes using the following steps:\nCreate two screens.\nDefine the routes.\nNavigate to the second screen using Navigator.pushNamed() .\nReturn to the first scre"}
1100{"url": "https://docs.flutter.dev/cookbook/navigation/named-routes", "title": "Untitled", "text": "ine the routes.\nNavigate to the second screen using Navigator.pushNamed() .\nReturn to the first screen using Navigator.pop() .\n1. Create two screens\nFirst, create two screens to work with. The first screen contains a\n button that navigates to the second screen. The second screen contains a\n button that navigates back to the first.\n2. Define the routes\nNext, define the routes by providing additional properties\n to the MaterialApp constructor: the"}
1101{"url": "https://docs.flutter.dev/cookbook/navigation/named-routes", "title": "Untitled", "text": " the routes by providing additional properties\n to the MaterialApp constructor: the initialRoute and the routes themselves.\nThe initialRoute property defines which route the app should start with.\n The routes property defines the available named routes and the widgets\n to build when navigating to those routes.\n3. Navigate to the second screen\nWith the widgets and routes in place, trigger navigation by using the Navigator.pushNamed() method.\n "}
1102{"url": "https://docs.flutter.dev/cookbook/navigation/named-routes", "title": "Untitled", "text": " the widgets and routes in place, trigger navigation by using the Navigator.pushNamed() method.\n This tells Flutter to build the widget defined in the routes table and launch the screen.\nIn the build() method of the FirstScreen widget, update the onPressed() callback:\n4. Return to the first screen\nTo navigate back to the first screen, use the Navigator.pop() function.\nInteractive example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last u"}
1103{"url": "https://docs.flutter.dev/cookbook/navigation/named-routes", "title": "Untitled", "text": "example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1104{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nDeep linking allows an app user to launch an app with a URI.\n This URI contains scheme, host, and path,\n and opens the app to a specific screen.\nA universal link , a type of deep link exclusive to iOS devices,\n uses only the http or https protocols.\nTo set up universal links, you need to own a web domain.\n As a temporary solution,\n consid"}
1105{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "s, you need to own a web domain.\n As a temporary solution,\n consider using Firebase Hosting or GitHub Pages .\nOnce you've set up your deep links, you can validate them.\n To learn more, see Validate deep links .\nCreate or modify a Flutter app\nWrite a Flutter app that can handle an incoming URL.\nThis example uses the go_router package to handle the routing.\n The Flutter team maintains the go_router package.\n It pr"}
1106{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "routing.\n The Flutter team maintains the go_router package.\n It provides a simple API to handle complex routing scenarios.\nTo create a new application, type flutter create <app-name> . $ flutter create deeplink_cookbook content_copy\nTo create a new application, type flutter create <app-name> .\nTo include the go_router package as a dependency,\n run flutter pub add : $ flutter pub add go_router content_copy\nTo include the go_router package as "}
1107{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": " run flutter pub add : $ flutter pub add go_router content_copy\nTo include the go_router package as a dependency,\n run flutter pub add :\nTo handle the routing, create a GoRouter object in the main.dart file: main.dart dart import ' package:flutter/material.dart ' ; import ' package:go_router/go_router.dart ' ; void main ( ) => runApp ( MaterialApp . router ( routerConfig : router ) ) ; /// This handles '/' and '/details'. final router = GoRouter ( routes : [ GoRoute ( pa"}
1108{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "outer ) ) ; /// This handles '/' and '/details'. final router = GoRouter ( routes : [ GoRoute ( path : ' / ' , builder : ( _ , _ ) => Scaffold ( appBar : AppBar ( title : const Text ( ' Home Screen ' ) ) , ) , routes : [ GoRoute ( path : ' details ' , builder : ( _ , _ ) => Scaffold ( appBar : AppBar ( title : const Text ( ' Details Screen ' ) ) , ) , ) , ] , ) , ] , ) ; content_copy\nTo handle the routing, create a GoRouter object in the main.dart file:\nAdjust iOS build settings\nLaunch Xcode.\n"}
1109{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "he routing, create a GoRouter object in the main.dart file:\nAdjust iOS build settings\nLaunch Xcode.\nLaunch Xcode.\nOpen the ios/Runner.xcworkspace file inside the\n Flutter project's ios folder.\nOpen the ios/Runner.xcworkspace file inside the\n Flutter project's ios folder.\nAdd associated domains\nXcode\nOther editors\nLaunch Xcode if necessary.\nLaunch Xcode if necessary.\nClick the top-level Runner .\nClick the top-level Runner .\nIn the Editor, click the Runner"}
1110{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "necessary.\nClick the top-level Runner .\nClick the top-level Runner .\nIn the Editor, click the Runner target.\nIn the Editor, click the Runner target.\nClick Signing & Capabilities .\nClick Signing & Capabilities .\nTo add a new domain, click + Capability under Signing & Capabilities .\nTo add a new domain, click + Capability under Signing & Capabilities .\nClick Associated Domains .\nClick Associated Domains .\nIn the Associated Domains section, click + .\nIn the Associated Domains section, click + .\nEnt"}
1111{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "ains .\nIn the Associated Domains section, click + .\nIn the Associated Domains section, click + .\nEnter applinks:<web domain> . Replace <web domain> with your own domain name.\nEnter applinks:<web domain> . Replace <web domain> with your own domain name.\nOpen the ios/Runner/Runner.entitlements XML file in your preferred editor.\nOpen the ios/Runner/Runner.entitlements XML file in your preferred editor.\nAdd an associated domain inside the <dict> tag. xml <?xml version=\"1.0\" encoding=\"UTF-8\"?> <!DOCT"}
1112{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "r.\nAdd an associated domain inside the <dict> tag. xml <?xml version=\"1.0\" encoding=\"UTF-8\"?> <!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"> <plist version=\"1.0\"> <dict> <key> com.apple.developer.associated-domains </key> <array> <string> applinks:example.com </string> </array> </dict> </plist> content_copy\nAdd an associated domain inside the <dict> tag.\nSave the ios/Runner/Runner.entitlements file.\nSave the ios/Runner/Runner.entitlements f"}
1113{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": " <dict> tag.\nSave the ios/Runner/Runner.entitlements file.\nSave the ios/Runner/Runner.entitlements file.\nTo check that the associated domains you created are available,\n perform the following steps:\nLaunch Xcode if necessary.\nLaunch Xcode if necessary.\nClick the top-level Runner .\nClick the top-level Runner .\nIn the Editor, click the Runner target.\nIn the Editor, click the Runner target.\nClick Signing & Capabilities .\n The domains should appear i"}
1114{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "unner target.\nClick Signing & Capabilities .\n The domains should appear in the Associated Domains section.\nClick Signing & Capabilities .\n The domains should appear in the Associated Domains section.\nYou have finished configuring the application for deep linking.\nAssociate your app with your web domain\nYou need to host an apple-app-site-association file in the web domain.\n This file tells the mobile browser which\n "}
1115{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "tion file in the web domain.\n This file tells the mobile browser which\n iOS application to open instead of the browser.\n To create the file, find the appID of the Flutter app you\n created in the previous section.\nLocate components of the appID\nApple formats the appID as <team id>.<bundle id> .\nLocate the bundle ID in the Xcode project.\nLocate the team ID in the developer account .\nFor example: Given a team ID of S8QB4VV633 and a"}
1116{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "ject.\nLocate the team ID in the developer account .\nFor example: Given a team ID of S8QB4VV633 and a bundle ID of com.example.deeplinkCookbook ,\n you would enter an appID entry of S8QB4VV633.com.example.deeplinkCookbook .\nCreate and host apple-app-site-association JSON file\nThis file uses the JSON format.\n Don't include the .json file extension when you save this file.\n Per Apple's documentation ,\n this file should resemble the "}
1117{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "file.\n Per Apple's documentation ,\n this file should resemble the following content:\nSet one value in the appIDs array to <team id>.<bundle id> .\nSet one value in the appIDs array to <team id>.<bundle id> .\nSet the paths array to [\"*\"] .\n The paths array specifies the allowed universal links.\n Using the asterisk, * redirects every path to the Flutter app.\n If needed, change the paths array value to a"}
1118{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "ts every path to the Flutter app.\n If needed, change the paths array value to a setting more\n appropriate to your app.\nSet the paths array to [\"*\"] .\n The paths array specifies the allowed universal links.\n Using the asterisk, * redirects every path to the Flutter app.\n If needed, change the paths array value to a setting more\n appropriate to your app.\nHost the file at a "}
1119{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "ths array value to a setting more\n appropriate to your app.\nHost the file at a URL that resembles the following structure. <webdomain>/.well-known/apple-app-site-association\nHost the file at a URL that resembles the following structure.\n<webdomain>/.well-known/apple-app-site-association\nVerify that your browser can access this file.\nVerify that your browser can access this file.\nTest the universal link\nTest a universal link using a physical iOS device or the Simulator.\nBefor"}
1120{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "e.\nTest the universal link\nTest a universal link using a physical iOS device or the Simulator.\nBefore testing,\n install the Flutter app on the iOS device or Simulator,\n Use flutter run on the desired device. When complete,\n the Flutter app displays on the home screen of the\n iOS device or Simulator.\nBefore testing,\n install the Flutter app on the iOS device or Simulator,\n "}
1121{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "\n install the Flutter app on the iOS device or Simulator,\n Use flutter run on the desired device.\nWhen complete,\n the Flutter app displays on the home screen of the\n iOS device or Simulator.\nIf you test using the Simulator, use the Xcode CLI: $ xcrun simctl openurl booted https://<web domain>/details content_copy\nIf you test using the Simulator, use the Xcode CLI:\nIf you test with a physical iOS device: Launch th"}
1122{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "f you test using the Simulator, use the Xcode CLI:\nIf you test with a physical iOS device: Launch the Note app. Type the URL in the Note app. Click the resulting link. If successful, the Flutter app launches and displays its details screen.\nIf you test with a physical iOS device:\nLaunch the Note app.\nType the URL in the Note app.\nClick the resulting link.\nIf successful, the Flutter app launches and displays its details screen.\nFind the source code\nYou can find the source code for the deeplink_co"}
1123{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-universal-links", "title": "Untitled", "text": "d displays its details screen.\nFind the source code\nYou can find the source code for the deeplink_cookbook recipe in the GitHub repo.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1124{"url": "https://docs.flutter.dev/cookbook/navigation/navigation-basics", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nMost apps contain several screens for displaying different\n types of information. For example, an app might have a\n screen that displays products. When the user taps the image\n of a product, a new screen displays details about the\n product.\nIn Android, a route is equivalent to an Activity .\n In iOS, a route is equivalent to a ViewControll"}
1125{"url": "https://docs.flutter.dev/cookbook/navigation/navigation-basics", "title": "Untitled", "text": "ute is equivalent to an Activity .\n In iOS, a route is equivalent to a ViewController .\n In Flutter, a route is just a widget.\nThis recipe uses the Navigator to navigate to a new route.\nThe next few sections show how to navigate between two routes,\n using these steps:\nCreate two routes.\nNavigate to the second route using Navigator.push() .\nReturn to the first route using Navigator.pop() .\n1. Create two routes\nFirst, create two routes to work wit"}
1126{"url": "https://docs.flutter.dev/cookbook/navigation/navigation-basics", "title": "Untitled", "text": "to the first route using Navigator.pop() .\n1. Create two routes\nFirst, create two routes to work with. Since this is a basic example,\n each route contains only a single button. Tapping the button on the\n first route navigates to the second route. Tapping the button on the\n second route returns to the first route.\nFirst, set up the visual structure:\nAndroid\niOS\n2. Navigate to the second route using Navigator.push()\nTo switch to a new route, use t"}
1127{"url": "https://docs.flutter.dev/cookbook/navigation/navigation-basics", "title": "Untitled", "text": ":\nAndroid\niOS\n2. Navigate to the second route using Navigator.push()\nTo switch to a new route, use the Navigator.push() method. The push() method adds a Route to the stack of routes managed by\n the Navigator . Where does the Route come from?\n You can create your own, or use a platform-specific route\n such as MaterialPageRoute or CupertinoPageRoute .\n A platform-specific route is useful because it transitions\n t"}
1128{"url": "https://docs.flutter.dev/cookbook/navigation/navigation-basics", "title": "Untitled", "text": "e .\n A platform-specific route is useful because it transitions\n to the new route using a platform-specific animation.\nIn the build() method of the FirstRoute widget,\n update the onPressed() callback:\nAndroid\niOS\n3. Return to the first route using Navigator.pop()\nHow do you close the second route and return to the first?\n By using the Navigator.pop() method.\n The pop() method removes the current Route from the s"}
1129{"url": "https://docs.flutter.dev/cookbook/navigation/navigation-basics", "title": "Untitled", "text": " the Navigator.pop() method.\n The pop() method removes the current Route from the stack of\n routes managed by the Navigator .\nTo implement a return to the original route, update the onPressed() callback in the SecondRoute widget:\nInteractive example\nAndroid\niOS\nAdditional navigation methods\nThe recipe in this topic shows you one way to navigate to a new screen and\n back to the previous scene, using the push and pop methods in the Navigator class"}
1130{"url": "https://docs.flutter.dev/cookbook/navigation/navigation-basics", "title": "Untitled", "text": "\n back to the previous scene, using the push and pop methods in the Navigator class, but there are several other Navigator static methods that\n you can use. Here are a few of them:\npushAndRemoveUntil : Adds a navigation route to the stack and then removes\n the most recent routes from the stack until a condition is met.\npushReplacement : Replaces the current route on the top of the\n stack with a new one.\nreplace : Replace a r"}
1131{"url": "https://docs.flutter.dev/cookbook/navigation/navigation-basics", "title": "Untitled", "text": " the current route on the top of the\n stack with a new one.\nreplace : Replace a route on the stack with another route.\nreplaceRouteBelow : Replace the route below a specific route on the stack.\npopUntil : Removes the most recent routes that were added to the stack of\n navigation routes until a condition is met.\nremoveRoute : Remove a specific route from the stack.\nremoveRouteBelow : Remove the route below a specific route on the\n stack.\nre"}
1132{"url": "https://docs.flutter.dev/cookbook/navigation/navigation-basics", "title": "Untitled", "text": "ack.\nremoveRouteBelow : Remove the route below a specific route on the\n stack.\nrestorablePush : Restore a route that was removed from the stack.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1133{"url": "https://docs.flutter.dev/cookbook/navigation/navigate-with-arguments", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nThe Navigator provides the ability to navigate\n to a named route from any part of an app using\n a common identifier.\n In some cases, you might also need to pass arguments to a\n named route. For example, you might wish to navigate to the /user route and\n pass information about the user to that route.\nYou can accomplish this task using the "}
1134{"url": "https://docs.flutter.dev/cookbook/navigation/navigate-with-arguments", "title": "Untitled", "text": " pass information about the user to that route.\nYou can accomplish this task using the arguments parameter of the Navigator.pushNamed() method. Extract the arguments using the ModalRoute.of() method or inside an onGenerateRoute() function provided to the MaterialApp or CupertinoApp constructor.\nThis recipe demonstrates how to pass arguments to a named\n route and read the arguments using ModalRoute.of() and onGenerateRoute() using the following steps:\nDefine the argu"}
1135{"url": "https://docs.flutter.dev/cookbook/navigation/navigate-with-arguments", "title": "Untitled", "text": "the arguments using ModalRoute.of() and onGenerateRoute() using the following steps:\nDefine the arguments you need to pass.\nCreate a widget that extracts the arguments.\nRegister the widget in the routes table.\nNavigate to the widget.\n1. Define the arguments you need to pass\nFirst, define the arguments you need to pass to the new route.\n In this example, pass two pieces of data:\n The title of the screen and a message .\nTo pass both pieces of data, create a class "}
1136{"url": "https://docs.flutter.dev/cookbook/navigation/navigate-with-arguments", "title": "Untitled", "text": " The title of the screen and a message .\nTo pass both pieces of data, create a class that stores this information.\n2. Create a widget that extracts the arguments\nNext, create a widget that extracts and displays the title and message from the ScreenArguments .\n To access the ScreenArguments ,\n use the ModalRoute.of() method.\n This method returns the current route with the arguments.\n3. Register the widget in the routes table\nNext, "}
1137{"url": "https://docs.flutter.dev/cookbook/navigation/navigate-with-arguments", "title": "Untitled", "text": "thod returns the current route with the arguments.\n3. Register the widget in the routes table\nNext, add an entry to the routes provided to the MaterialApp widget. The routes define which widget should be created based on the name of the route.\n4. Navigate to the widget\nFinally, navigate to the ExtractArgumentsScreen when a user taps a button using Navigator.pushNamed() .\n Provide the arguments to the route via the arguments property. The ExtractArgumentsScreen extracts the title"}
1138{"url": "https://docs.flutter.dev/cookbook/navigation/navigate-with-arguments", "title": "Untitled", "text": "the arguments to the route via the arguments property. The ExtractArgumentsScreen extracts the title and message from these\n arguments.\nAlternatively, extract the arguments using onGenerateRoute\nInstead of extracting the arguments directly inside the widget, you can also\n extract the arguments inside an onGenerateRoute() function and pass them to a widget.\nThe onGenerateRoute() function creates the correct route based on the given RouteSettings .\nInteractive exa"}
1139{"url": "https://docs.flutter.dev/cookbook/navigation/navigate-with-arguments", "title": "Untitled", "text": "enerateRoute() function creates the correct route based on the given RouteSettings .\nInteractive example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1140{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-app-links", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nDeep linking is a mechanism for launching an app with a URI.\n This URI contains scheme, host, and path,\n and opens the app to a specific screen.\nAn app link is a type of deep link that uses http or https and is exclusive to Android devices.\nSetting up app links requires one to own a web domain.\n Otherwise, consider using Firebase Hosting or GitHub Pages as a temporary sol"}
1141{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-app-links", "title": "Untitled", "text": "ain.\n Otherwise, consider using Firebase Hosting or GitHub Pages as a temporary solution.\nOnce you've set up your deep links, you can validate them.\n To learn more, see Validate deep links .\n1. Customize a Flutter application\nWrite a Flutter app that can handle an incoming URL.\n This example uses the go_router package to handle the routing.\n The Flutter team maintains the go_router package.\n It provides a simple"}
1142{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-app-links", "title": "Untitled", "text": " The Flutter team maintains the go_router package.\n It provides a simple API to handle complex routing scenarios.\nTo create a new application, type flutter create <app-name> : $ flutter create deeplink_cookbook content_copy\nTo create a new application, type flutter create <app-name> :\nTo include go_router package in your app,\n add a dependency for go_router to the project: To add the go_router package as a dependency,\n run flu"}
1143{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-app-links", "title": "Untitled", "text": "o_router to the project: To add the go_router package as a dependency,\n run flutter pub add : $ flutter pub add go_router content_copy\nTo include go_router package in your app,\n add a dependency for go_router to the project:\nTo add the go_router package as a dependency,\n run flutter pub add :\nTo handle the routing,\n create a GoRouter object in the main.dart file: main.dart dart import ' package:flutter/material.d"}
1144{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-app-links", "title": "Untitled", "text": " create a GoRouter object in the main.dart file: main.dart dart import ' package:flutter/material.dart ' ; import ' package:go_router/go_router.dart ' ; void main ( ) => runApp ( MaterialApp . router ( routerConfig : router ) ) ; /// This handles '/' and '/details'. final router = GoRouter ( routes : [ GoRoute ( path : ' / ' , builder : ( _ , _ ) => Scaffold ( appBar : AppBar ( title : const Text ( ' Home Screen ' ) ) , ) , routes : [ GoRoute ( path : ' details ' , builder : ( _ , _ ) => Sc"}
1145{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-app-links", "title": "Untitled", "text": "Text ( ' Home Screen ' ) ) , ) , routes : [ GoRoute ( path : ' details ' , builder : ( _ , _ ) => Scaffold ( appBar : AppBar ( title : const Text ( ' Details Screen ' ) ) , ) , ) , ] , ) , ] , ) ; content_copy\nTo handle the routing,\n create a GoRouter object in the main.dart file:\n2. Modify AndroidManifest.xml\nOpen the Flutter project with VS Code or Android Studio.\nOpen the Flutter project with VS Code or Android Studio.\nNavigate to android/app/src/main/AndroidManifest.xml "}
1146{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-app-links", "title": "Untitled", "text": "lutter project with VS Code or Android Studio.\nNavigate to android/app/src/main/AndroidManifest.xml file.\nNavigate to android/app/src/main/AndroidManifest.xml file.\nAdd the following metadata tag and intent filter inside the <activity> tag with .MainActivity . Replace example.com with your own web domain. xml <intent-filter android:autoVerify=\"true\"> <action android:name=\"android.intent.action.VIEW\" /> <category android:name=\"android.intent.category.DEFAULT\" /> <category android:name=\"android.in"}
1147{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-app-links", "title": "Untitled", "text": "W\" /> <category android:name=\"android.intent.category.DEFAULT\" /> <category android:name=\"android.intent.category.BROWSABLE\" /> <data android:scheme=\"http\" android:host=\"example.com\" /> <data android:scheme=\"https\" /> </intent-filter> content_copy\nAdd the following metadata tag and intent filter inside the <activity> tag with .MainActivity .\nReplace example.com with your own web domain.\n3. Hosting assetlinks.json file\nHost an assetlinks.json file in using a web server\n with a do"}
1148{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-app-links", "title": "Untitled", "text": " assetlinks.json file\nHost an assetlinks.json file in using a web server\n with a domain that you own. This file tells the\n mobile browser which Android application to open instead\n of the browser. To create the file,\n get the package name of the Flutter app you created in\n the previous step and the sha256 fingerprint of the\n signing key you will be using to build the APK.\nPackage name\nLocate the"}
1149{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-app-links", "title": "Untitled", "text": "int of the\n signing key you will be using to build the APK.\nPackage name\nLocate the package name in AndroidManifest.xml ,\n the package property under <manifest> tag.\n Package names are usually in the format of com.example.* .\nsha256 fingerprint\nThe process might differ depending on how the apk is signed.\nUsing google play app signing\nYou can find the sha256 fingerprint directly from play\n developer console. Open your app in the "}
1150{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-app-links", "title": "Untitled", "text": "the sha256 fingerprint directly from play\n developer console. Open your app in the play console,\n under Release> Setup > App Integrity> App Signing tab :\nUsing local keystore\nIf you are storing the key locally,\n you can generate sha256 using the following command:\nassetlinks.json\nThe hosted file should look similar to this:\nSet the package_name value to your Android application ID.\nSet the package_name value to your Android application ID.\nSet s"}
1151{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-app-links", "title": "Untitled", "text": "lue to your Android application ID.\nSet the package_name value to your Android application ID.\nSet sha256_cert_fingerprints to the value you got\n from the previous step.\nSet sha256_cert_fingerprints to the value you got\n from the previous step.\nHost the file at a URL that resembles the following: <webdomain>/.well-known/assetlinks.json\nHost the file at a URL that resembles the following: <webdomain>/.well-known/assetlinks.json\nVerify that your browser ca"}
1152{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-app-links", "title": "Untitled", "text": "RL that resembles the following: <webdomain>/.well-known/assetlinks.json\nVerify that your browser can access this file.\nVerify that your browser can access this file.\nTesting\nYou can use a real device or the Emulator to test an app link,\n but first make sure you have executed flutter run at least once on\n the devices. This ensures that the Flutter application is installed.\nTo test only the app setup, use the adb command:\nTo test both web and app setup, you must "}
1153{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-app-links", "title": "Untitled", "text": "nstalled.\nTo test only the app setup, use the adb command:\nTo test both web and app setup, you must click a link\n directly through web browser or another app.\n One way is to create a Google Doc, add the link, and tap on it.\nIf everything is set up correctly, the Flutter application\n launches and displays the details screen:\nAppendix\nSource code: deeplink_cookbook\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Pa"}
1154{"url": "https://docs.flutter.dev/cookbook/navigation/set-up-app-links", "title": "Untitled", "text": "eeplink_cookbook\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1155{"url": "https://docs.flutter.dev/cookbook/navigation/passing-data", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nOften, you not only want to navigate to a new screen,\n but also pass data to the screen as well.\n For example, you might want to pass information about\n the item that's been tapped.\nRemember: Screens are just widgets.\n In this example, create a list of todos.\n When a todo is tapped, navigate to a new screen (widget) that\n "}
1156{"url": "https://docs.flutter.dev/cookbook/navigation/passing-data", "title": "Untitled", "text": "s.\n When a todo is tapped, navigate to a new screen (widget) that\n displays information about the todo.\n This recipe uses the following steps:\nDefine a todo class.\nDisplay a list of todos.\nCreate a detail screen that can display information about a todo.\nNavigate and pass data to the detail screen.\n1. Define a todo class\nFirst, you need a simple way to represent todos. For this example,\n create a class that contains two pieces o"}
1157{"url": "https://docs.flutter.dev/cookbook/navigation/passing-data", "title": "Untitled", "text": "ay to represent todos. For this example,\n create a class that contains two pieces of data: the title and description.\n2. Create a list of todos\nSecond, display a list of todos. In this example, generate\n 20 todos and show them using a ListView.\n For more information on working with lists,\n see the Use lists recipe.\nGenerate the list of todos\nDisplay the list of todos using a ListView\nSo far, so good.\n This gener"}
1158{"url": "https://docs.flutter.dev/cookbook/navigation/passing-data", "title": "Untitled", "text": "st of todos\nDisplay the list of todos using a ListView\nSo far, so good.\n This generates 20 todos and displays them in a ListView.\n3. Create a Todo screen to display the list\nFor this, we create a StatelessWidget . We call it TodosScreen .\n Since the contents of this page won't change during runtime,\n we'll have to require the list\n of todos within the scope of this widget.\nWe pass in our ListView.builder as body of the widget we"}
1159{"url": "https://docs.flutter.dev/cookbook/navigation/passing-data", "title": "Untitled", "text": " of todos within the scope of this widget.\nWe pass in our ListView.builder as body of the widget we're returning to build() .\n This'll render the list on to the screen for you to get going!\nWith Flutter's default styling, you're good to go without sweating about\n things that you'd like to do later on!\n4. Create a detail screen to display information about a todo\nNow, create the second screen. The title of the screen contains the\n title of the t"}
1160{"url": "https://docs.flutter.dev/cookbook/navigation/passing-data", "title": "Untitled", "text": "Now, create the second screen. The title of the screen contains the\n title of the todo, and the body of the screen shows the description.\nSince the detail screen is a normal StatelessWidget ,\n require the user to enter a Todo in the UI.\n Then, build the UI using the given todo.\n5. Navigate and pass data to the detail screen\nWith a DetailScreen in place,\n you're ready to perform the Navigation.\n In this example, "}
1161{"url": "https://docs.flutter.dev/cookbook/navigation/passing-data", "title": "Untitled", "text": "place,\n you're ready to perform the Navigation.\n In this example, navigate to the DetailScreen when a user\n taps a todo in the list. Pass the todo to the DetailScreen .\nTo capture the user's tap in the TodosScreen , write an onTap() callback for the ListTile widget. Within the onTap() callback,\n use the Navigator.push() method.\nInteractive example\nAlternatively, pass the arguments using RouteSettings\nRepeat the first two steps.\n"}
1162{"url": "https://docs.flutter.dev/cookbook/navigation/passing-data", "title": "Untitled", "text": "teractive example\nAlternatively, pass the arguments using RouteSettings\nRepeat the first two steps.\nCreate a detail screen to extract the arguments\nNext, create a detail screen that extracts and displays the title and description from the Todo . To access the Todo , use the ModalRoute.of() method. This method returns the current route with the arguments.\nNavigate and pass the arguments to the detail screen\nFinally, navigate to the DetailScreen when a user taps\n a ListTile widget"}
1163{"url": "https://docs.flutter.dev/cookbook/navigation/passing-data", "title": "Untitled", "text": "il screen\nFinally, navigate to the DetailScreen when a user taps\n a ListTile widget using Navigator.push() .\n Pass the arguments as part of the RouteSettings .\n The DetailScreen extracts these arguments.\nComplete example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1164{"url": "https://docs.flutter.dev/cookbook/navigation/hero-animations", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nIt's often helpful to guide users through an app as they navigate from screen\n to screen. A common technique to lead users through an app is to animate a\n widget from one screen to the next. This creates a visual anchor connecting\n the two screens.\nUse the Hero widget\n to animate a widget from one screen to the next.\n This recipe uses the"}
1165{"url": "https://docs.flutter.dev/cookbook/navigation/hero-animations", "title": "Untitled", "text": " to animate a widget from one screen to the next.\n This recipe uses the following steps:\nCreate two screens showing the same image.\nAdd a Hero widget to the first screen.\nAdd a Hero widget to the second screen.\n1. Create two screens showing the same image\nIn this example, display the same image on both screens.\n Animate the image from the first screen to the second screen when\n the user taps the image. For now, create the visual stru"}
1166{"url": "https://docs.flutter.dev/cookbook/navigation/hero-animations", "title": "Untitled", "text": "to the second screen when\n the user taps the image. For now, create the visual structure;\n handle animations in the next steps.\n2. Add a Hero widget to the first screen\nTo connect the two screens together with an animation, wrap\n the Image widget on both screens in a Hero widget.\n The Hero widget requires two arguments:\nAn object that identifies the Hero .\n It must be the same on both screens.\nThe widget to "}
1167{"url": "https://docs.flutter.dev/cookbook/navigation/hero-animations", "title": "Untitled", "text": "that identifies the Hero .\n It must be the same on both screens.\nThe widget to animate across screens.\n3. Add a Hero widget to the second screen\nTo complete the connection with the first screen,\n wrap the Image on the second screen with a Hero widget that has the same tag as the Hero in the first screen.\nAfter applying the Hero widget to the second screen,\n the animation between screens just works.\nInteractive example\nUnless stated otherwise"}
1168{"url": "https://docs.flutter.dev/cookbook/navigation/hero-animations", "title": "Untitled", "text": " the animation between screens just works.\nInteractive example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1169{"url": "https://docs.flutter.dev/cookbook/navigation/returning-data", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nIn some cases, you might want to return data from a new screen.\n For example, say you push a new screen that presents two options to a user.\n When the user taps an option, you want to inform the first screen\n of the user's selection so that it can act on that information.\nYou can do this with the Navigator.pop() method using the following steps:\nDefine the home screen\nAdd"}
1170{"url": "https://docs.flutter.dev/cookbook/navigation/returning-data", "title": "Untitled", "text": "ou can do this with the Navigator.pop() method using the following steps:\nDefine the home screen\nAdd a button that launches the selection screen\nShow the selection screen with two buttons\nWhen a button is tapped, close the selection screen\nShow a snackbar on the home screen with the selection\n1. Define the home screen\nThe home screen displays a button. When tapped,\n it launches the selection screen.\n2. Add a button that launches the selection screen\nNow, create the SelectionButt"}
1171{"url": "https://docs.flutter.dev/cookbook/navigation/returning-data", "title": "Untitled", "text": "e selection screen.\n2. Add a button that launches the selection screen\nNow, create the SelectionButton, which does the following:\nLaunches the SelectionScreen when it's tapped.\nWaits for the SelectionScreen to return a result.\n3. Show the selection screen with two buttons\nNow, build a selection screen that contains two buttons.\n When a user taps a button,\n that app closes the selection screen and lets the home\n screen know which button was tappe"}
1172{"url": "https://docs.flutter.dev/cookbook/navigation/returning-data", "title": "Untitled", "text": "p closes the selection screen and lets the home\n screen know which button was tapped.\nThis step defines the UI.\n The next step adds code to return data.\n4. When a button is tapped, close the selection screen\nNow, update the onPressed() callback for both of the buttons.\n To return data to the first screen,\n use the Navigator.pop() method,\n which accepts an optional second argument called result .\n "}
1173{"url": "https://docs.flutter.dev/cookbook/navigation/returning-data", "title": "Untitled", "text": "method,\n which accepts an optional second argument called result .\n Any result is returned to the Future in the SelectionButton.\nYep button\nNope button\n5. Show a snackbar on the home screen with the selection\nNow that you're launching a selection screen and awaiting the result,\n you'll want to do something with the information that's returned.\nIn this case, show a snackbar displaying the result by using the _navigateAndDisplaySelection() method "}
1174{"url": "https://docs.flutter.dev/cookbook/navigation/returning-data", "title": "Untitled", "text": "this case, show a snackbar displaying the result by using the _navigateAndDisplaySelection() method in SelectionButton :\nInteractive example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-06-25. View source or report an issue ."}
1175{"url": "https://docs.flutter.dev/cookbook/navigation", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nHow to implement named routes for navigating between screens.\nLearn how to set up universal links for an iOS application built with Flutter.\nHow to navigate between routes.\nHow to pass arguments to a named route.\nLearn how to set up app links for an Android application built with Flutter.\nHow to pass data to a new route.\nHow to animate a widget from one screen to another\nHow to return data from a new screen.\nUnless stated"}
1176{"url": "https://docs.flutter.dev/cookbook/navigation", "title": "Untitled", "text": "w to animate a widget from one screen to another\nHow to return data from a new screen.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1177{"url": "https://docs.flutter.dev/cookbook/gestures/dismissible", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nThe \"swipe to dismiss\" pattern is common in many mobile apps.\n For example, when writing an email app,\n you might want to allow a user to swipe away\n email messages to delete them from a list.\nFlutter makes this task easy by providing the Dismissible widget.\n Learn how to implement swipe to dismiss with the following steps:\nCreate a list of items.\nWrap ea"}
1178{"url": "https://docs.flutter.dev/cookbook/gestures/dismissible", "title": "Untitled", "text": " Learn how to implement swipe to dismiss with the following steps:\nCreate a list of items.\nWrap each item in a Dismissible widget.\nProvide \"leave behind\" indicators.\n1. Create a list of items\nFirst, create a list of items. For detailed\n instructions on how to create a list,\n follow the Working with long lists recipe.\nCreate a data source\nIn this example,\n you want 20 sample items to work with.\n To keep it simple, generate a li"}
1179{"url": "https://docs.flutter.dev/cookbook/gestures/dismissible", "title": "Untitled", "text": " you want 20 sample items to work with.\n To keep it simple, generate a list of strings.\nConvert the data source into a list\nDisplay each item in the list on screen. Users won't\n be able to swipe these items away just yet.\n2. Wrap each item in a Dismissible widget\nIn this step,\n give users the ability to swipe an item off the list by using the Dismissible widget.\nAfter the user has swiped away the item,\n remove the item"}
1180{"url": "https://docs.flutter.dev/cookbook/gestures/dismissible", "title": "Untitled", "text": "g the Dismissible widget.\nAfter the user has swiped away the item,\n remove the item from the list and display a snackbar.\n In a real app, you might need to perform more complex logic,\n such as removing the item from a web service or database.\nUpdate the itemBuilder() function to return a Dismissible widget:\n3. Provide \"leave behind\" indicators\nAs it stands,\n the app allows users to swipe items off the list, but it doesn't\n "}
1181{"url": "https://docs.flutter.dev/cookbook/gestures/dismissible", "title": "Untitled", "text": "it stands,\n the app allows users to swipe items off the list, but it doesn't\n give a visual indication of what happens when they do.\n To provide a cue that items are removed,\n display a \"leave behind\" indicator as they\n swipe the item off the screen. In this case,\n the indicator is a red background.\nTo add the indicator,\n provide a background parameter to the Dismissible .\nInter"}
1182{"url": "https://docs.flutter.dev/cookbook/gestures/dismissible", "title": "Untitled", "text": "d.\nTo add the indicator,\n provide a background parameter to the Dismissible .\nInteractive example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1183{"url": "https://docs.flutter.dev/cookbook/gestures/ripples", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nWidgets that follow the Material Design guidelines display\n a ripple animation when tapped.\nFlutter provides the InkWell widget to perform this effect.\n Create a ripple effect using the following steps:\nCreate a widget that supports tap.\nWrap it in an InkWell widget to manage tap callbacks and\n ripple animations.\nInteractive example\nUnless stated otherwise, the document"}
1184{"url": "https://docs.flutter.dev/cookbook/gestures/ripples", "title": "Untitled", "text": "and\n ripple animations.\nInteractive example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1185{"url": "https://docs.flutter.dev/cookbook/gestures/handling-taps", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nYou not only want to display information to users,\n you want users to interact with your app.\n Use the GestureDetector widget to respond\n to fundamental actions, such as tapping and dragging.\nThis recipe shows how to make a custom button that shows\n a snackbar when tapped with the following steps:\nCreate the button.\nWrap it in a GestureDetector and provid"}
1186{"url": "https://docs.flutter.dev/cookbook/gestures/handling-taps", "title": "Untitled", "text": "bar when tapped with the following steps:\nCreate the button.\nWrap it in a GestureDetector and provide an onTap() callback.\nNotes\nFor information on adding the Material ripple effect to your\n button, see the Add Material touch ripples recipe.\nAlthough this example creates a custom button,\n Flutter includes a handful of button implementations, such as: ElevatedButton , TextButton , and CupertinoButton .\nInteractive example\nUnless stated otherwise, the document"}
1187{"url": "https://docs.flutter.dev/cookbook/gestures/handling-taps", "title": "Untitled", "text": "utton , TextButton , and CupertinoButton .\nInteractive example\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1188{"url": "https://docs.flutter.dev/cookbook/gestures", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nHow to implement swiping to dismiss or delete.\nHow to implement ripple animations.\nHow to handle tapping and dragging.\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1189{"url": "https://docs.flutter.dev/cookbook/testing/integration/introduction", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nUnit tests and widget tests validate individual classes,\n functions, or widgets.\n They don't validate how individual pieces work\n together in whole or capture the performance\n of an app running on a real device.\n To perform these tasks, use integration tests .\nIntegration tests verify the behavior of the complete app.\n Th"}
1190{"url": "https://docs.flutter.dev/cookbook/testing/integration/introduction", "title": "Untitled", "text": " integration tests .\nIntegration tests verify the behavior of the complete app.\n This test can also be called end-to-end testing or GUI testing.\nTesting frameworks\nTwo packages are commonly used to perform Flutter integration tests.\n These are:\nintegration_test package: The official\n integration test package that is part of the Flutter SDK. Tests written\n with integration_test can perform the following tasks: run on the\n"}
1191{"url": "https://docs.flutter.dev/cookbook/testing/integration/introduction", "title": "Untitled", "text": "sts written\n with integration_test can perform the following tasks: run on the\n target device, run from the host machine with flutter test integration_test ,\n and use flutter_test APIs. This makes integration tests similar to writing widget tests . However, integration_test can't interact with\n native platform UI.\nintegration_test package: The official\n integration test package that is part o"}
1192{"url": "https://docs.flutter.dev/cookbook/testing/integration/introduction", "title": "Untitled", "text": "integration_test package: The official\n integration test package that is part of the Flutter SDK. Tests written\n with integration_test can perform the following tasks: run on the\n target device, run from the host machine with flutter test integration_test ,\n and use flutter_test APIs. This makes integration tests similar to writing widget tests . However, integration_test can't interact with\n "}
1193{"url": "https://docs.flutter.dev/cookbook/testing/integration/introduction", "title": "Untitled", "text": "imilar to writing widget tests . However, integration_test can't interact with\n native platform UI.\npatrol package: A popular third-party integration test package that\n has many of the features supported by the integration_test package,\n but can additionally interact with native platform UI such as\n permission dialogs, notifications, or the contents of platform views.\npatrol package: A popular third-party integra"}
1194{"url": "https://docs.flutter.dev/cookbook/testing/integration/introduction", "title": "Untitled", "text": "ogs, notifications, or the contents of platform views.\npatrol package: A popular third-party integration test package that\n has many of the features supported by the integration_test package,\n but can additionally interact with native platform UI such as\n permission dialogs, notifications, or the contents of platform views.\nTerminology\nThe system on which you develop your app, like a desktop computer.\nThe mobile device, browser, or d"}
1195{"url": "https://docs.flutter.dev/cookbook/testing/integration/introduction", "title": "Untitled", "text": "\nThe system on which you develop your app, like a desktop computer.\nThe mobile device, browser, or desktop application that\n runs your Flutter app.\nIf you run your app in a web browser or as a desktop application,\n the host machine and the target device are the same.\nGetting started\nTo use integration_test , add it as a dependency for your\n Flutter app test file.\nTo migrate existing projects that use flutter_driver ,\n co"}
1196{"url": "https://docs.flutter.dev/cookbook/testing/integration/introduction", "title": "Untitled", "text": " Flutter app test file.\nTo migrate existing projects that use flutter_driver ,\n consult the Migrating from flutter_driver guide.\nTo use patrol , follow the Patrol setup guide .\nUse cases for integration testing\nThe other guides in this section explain how to use integration tests to validate functionality and performance .\nUnless stated otherwise, the documentation on this site reflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1197{"url": "https://docs.flutter.dev/cookbook/testing/integration/introduction", "title": "Untitled", "text": "eflects Flutter 3.44.0. Page last updated on 2026-05-05. View source or report an issue ."}
1198{"url": "https://docs.flutter.dev/cookbook/testing/integration/profiling", "title": "Untitled", "text": "Flutter 3.44 is here! Watch What's new in Flutter and read the blog post .\nWhen it comes to mobile apps, performance is critical to user experience.\n Users expect apps to have smooth scrolling and meaningful animations free of\n stuttering or skipped frames, known as \"jank.\" How to ensure that your app\n is free of jank on a wide variety of devices?\nThere are two options: first, manually test the app on different devices.\n While t"}
1199{"url": "https://docs.flutter.dev/cookbook/testing/integration/profiling", "title": "Untitled", "text": "\nThere are two options: first, manually test the app on different devices.\n While that approach might work for a smaller app, it becomes more\n cumbersome as an app grows in size. Alternatively, run an integration\n test that performs a specific task and records a performance timeline.\n Then, examine the results to determine whether a specific section of\n the app needs to be improved.\nIn this recipe, learn how to "}
1200{"url": "https://docs.flutter.dev/cookbook/testing/integration/profiling", "title": "Untitled", "text": " a specific section of\n the app needs to be improved.\nIn this recipe, learn how to write a test that records a performance\n timeline while performing a specific task and saves a summary of the\n results to a local file.\nThis recipe uses the following steps:\nWrite a test that scrolls through a list of items.\nRecord the performance of the app.\nSave the results to disk.\nRun the test.\nReview the results.\n1. Write a test that scrolls through a list of"}
