Results for “MaterialApp”
Full-text search across Boring Doc explanations, official documentation pages, the Flutter API index and every indexed version change.
Concepts
- Navigation and routing3.47.7navigation
context) is the alternative when you cannot construct the widget yourself. Named routes (MaterialApp.routes, Navigator.pushNamed) deduplicate route creation but are no longer recommended for most apps: deep-link
- Testing3.47.7testing
Flutter has three test levels: unit tests (package:test) for plain Dart
Guides
- Navigation and routingdoc
Overview of Flutter's navigation and routing features Flutter provides a complete
- Pass arguments to a named routedoc
arguments using the ModalRoute.of() method or inside an onGenerateRoute() function provided to the MaterialApp or CupertinoApp constructor. This recipe demonstrates how to pass arguments to a named
- Layoutdoc
Learn about common layout widgets in Flutter. Learn how to build layouts
- Flutter architectural overviewdoc
A high-level overview of the architecture of Flutter, including the core
- Navigate with named routesdoc
Define the routes Next, define the routes by providing additional properties to the MaterialApp constructor: the initialRoute and the routes themselves. The initialRoute property defines which
- Handling errors in Flutterdoc
How to control error messages and logging of errors The Flutter framework
- DevToolsdoc
Learn to use the Dart DevTools when developing Flutter apps. Learn to
- Accessibility technologiesdoc
Information about accessibility technologies for Flutter developers. Summary Assistive technologies are essential
- Hero animationsdoc
How to animate a widget to fly between two screens. The hero
- Understanding Flutter's keyboard focus systemdoc
How to use the focus system in your Flutter app. This article
API reference
- MaterialAppclass
application that uses Material Design. material.MaterialApp MaterialApp Material App class material
- MaterialApp.newconstructor
Creates a MaterialApp. material.MaterialApp.MaterialApp.new MaterialApp new Material App.new constructor material
- MaterialApp.routerconstructor
Creates a MaterialApp that uses the Router instead of a Navigator. material.MaterialApp.MaterialApp.router MaterialApp router Material App.router constructor material
- MaterialScrollBehaviorclass
Describes how Scrollable widgets behave for MaterialApps. material.MaterialScrollBehavior MaterialScrollBehavior Material Scroll Behavior class material
- ThemeDataclass
Defines the configuration of the overall visual Theme for a MaterialApp or a widget subtree within the app. material.ThemeData ThemeData Theme Data class material
- CheckedModeBannerclass
Displays a Banner saying "DEBUG" when running in debug mode. MaterialApp builds one of these by default. widgets.CheckedModeBanner CheckedModeBanner Checked Mode Banner class widgets
- material.ThemeModeenum
Describes which theme will be used by MaterialApp. material.ThemeMode ThemeMode Theme Mode enum material
Version changes
- The Route and Navigator refactoring1.17.0breaking
The `Route` class no longer manages its overlay entries in overlay, and
- Make sure that a MaterialApp doesn't crash in 0x0 environment3.38.0bugfix
Make sure that a MaterialApp doesn't crash in 0x0 environment (Material, by @ahmedsameha1). MaterialApp
- Default Scrollbars on Desktop2.2.0breaking
`ScrollBehavior`s now automatically apply `Scrollbar`s to scrolling widgets on desktop
- The default page transition on Android is now PredictiveBackPageTransitionBuilder3.38.0breaking
able to support predictive back route transitions. Code before migration: ```dart return MaterialApp( theme: ThemeData( brightness: Brightness.light, // pageTransitionsTheme is the default. ), home: const MyFirstScreen(), ); ``` Code after migration
- Updated Material 3 progress indicators3.29.0breaking
updated `LinearProgressIndicator` design, set the `ProgressIndicatorThemeData.year2023` property to `false` in your `MaterialApp`: ```dart highlightLines=2 return MaterialApp( theme: ThemeData(progressIndicatorTheme: const ProgressIndicatorThemeData(year2023: false)), // ... LinearProgressIndicator( year2023
- TextField requires MaterialLocalizations1.20.0breaking
assertion such as the following: If the `TextField` descends from a `MaterialApp`, the `DefaultMaterialLocalizations` is already instantiated and won't require any changes to your existing code
- More Strict Assertions in the Navigator and the Hero Controller Scope1.20.0breaking
that starts to throw exceptions. ```dart import 'package:material_ui/material_ui.dart'; void main() { runApp( MaterialApp( builder: (BuildContext context, Widget child) { // Builds two parallel navigators. This throws // error because
- SnackBars managed by the ScaffoldMessenger2.0.0breaking
ScaffoldMessenger`, one of which is available by default within the context of a `MaterialApp`. The previous approach called upon the `Scaffold` to show a `SnackBar`. Prior
- Migrate to standalone material_ui and cupertino_ui packagesunreleasedbreaking
The Material and Cupertino design libraries are now available as standalone packages
- Updated Material 3 Slider3.29.0breaking
updated `Slider` design, set the `SliderThemeData.year2023` property to `false` in your `MaterialApp`: ```dart highlightLines=2 return MaterialApp( theme: ThemeData(sliderTheme: const SliderThemeData(year2023: false)), // ... Slider( value
- Default multitouch scrolling3.19.0breaking
Flutter applications. ### Setting a custom `ScrollBehavior` for your application Code before migration: ```dart MaterialApp( // ... ); ``` Code after migration: ```dart class MyCustomScrollBehavior extends MaterialScrollBehavior { // Override behavior methods and getters
- Page transitions replaced by ZoomPageTransitionsBuilder3.0.0breaking
should define builders explicitly for the target platforms. Code before migration: ```dart MaterialApp( theme: ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple)), ) ``` Code after migration: ```dart MaterialApp( theme: ThemeData
- Default drag scrolling devices2.5.0breaking
Scrollable` widget. ### Setting a custom `ScrollBehavior` for your application Code before migration: ```dart MaterialApp( // ... ); ``` Code after migration: ```dart class MyCustomScrollBehavior extends MaterialScrollBehavior { // Override behavior methods and getters
- FloatingActionButton and ThemeData's accent properties1.17.0breaking
configure the theme's `floatingActionButtonTheme` instead of its `accentIconTheme`. Code before migration: ```dart MaterialApp( theme: ThemeData( accentIconTheme: IconThemeData(color: Colors.red), ), ) ``` Code after migration: ```dart MaterialApp( theme
- The ThemeData.useMaterial3 property is now set to true by default3.16.0breaking
Material 3 version of the Material library by specifying `useMaterial3: false` in your `MaterialApp` theme. will eventually be deprecated and removed. but needed a whole new implementation
- Navigator's page APIs breaking change3.24.0breaking
child: Placeholder()); void main() { final List<Page > pages = <Page >[page1, page2, page3]; runApp( MaterialApp( home: Navigator( pages: pages, onPopPage: (Route<Object?> route, Object? result) { if (route.settings == page2
- ThemeData's toggleableActiveColor property has been deprecated3.7.0deprecated
RadioThemeData`. 3. By customizing the widget's color properties. Code before migration: ```dart MaterialApp( theme: ThemeData(toggleableActiveColor: myColor), // ... ); ``` Code after migration: ```dart final ThemeData theme = ThemeData(); MaterialApp
- Generic types in PopScope3.24.0breaking
safe result. Code before migration: ```dart import 'package:material_ui/material_ui.dart'; void main() { runApp( MaterialApp( navigatorKey: nav, home: Column( children: [ Form( canPop: false, onPopInvoked: (bool didPop) { if (didPop
- Introduce new ColorScheme roles3.22.0breaking
should be migrated to `surfaceContainerHighest`. Code before migration: ```dart final ColorScheme colorScheme = ColorScheme(); MaterialApp( theme: ThemeData( //... colorScheme: colorScheme.copyWith( background: myColor1, onBackground: myColor2
- ThemeData's accent properties have been deprecated2.5.0deprecated
color scheme's secondary color instead of accentColor. Code before migration: ```dart MaterialApp( theme: ThemeData(accentColor: myColor), // ... ); ``` Code after migration: ```dart final ThemeData theme = ThemeData(); MaterialApp
- Semantics Order of the Overlay Entries in Modal Routes1.20.0breaking
We changed the semantics traverse order of the overlay entries in modal
- Deprecated API removed after v2.103.0.0removed
OutlinedButton ButtonTheme TextButtonTheme ElevatedButtonTheme OutlinedButtonTheme ButtonStyle ButtonStyleButton ElevatedButtonThemeData OutlinedButtonThemeData TextButtonThemeData Scaffold SnackBar ScaffoldMessenger MaterialApp RectangularSliderTrackShape.disabledThumbGapWidth RectangularSliderTrackShape ThemeData TextSelectionThemeData RenderEditable.onSelectionChanged TextSelectionDelegate.textEditingValue TextSelectionDelegate.userUpdateTextEditingValue TextInputFormatter
- Localized messages are generated into source, not a synthetic package3.32.0breaking
created and referenced by the app: ```dart import 'package:flutter_gen/gen_l10n/app_localizations.dart'; // ... const MaterialApp( title: 'Localizations Sample App', localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: AppLocalizations.supportedLocales, ); ``` To migrate away from importing `package
- Dialogs' Default BorderRadius1.20.0breaking
main() => runApp(Foo()); class Foo extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( floatingActionButton: FloatingActionButton(onPressed: () { showDialog( context: context, builder: (BuildContext context) { return AlertDialog
- New Buttons and Button Themes1.20.0breaking
A new set of basic material button widgets and themes have been