id
stringlengths 14
17
| text
stringlengths 23
1.11k
| source
stringlengths 35
114
|
---|---|---|
8965fec2fbf6-8 | Used to select from a range of values.
CupertinoSlidingSegmentedControl
An iOS-13-style segmented control. Used to select mutually exclusive options in a horizontal list.
CupertinoSliverNavigationBar
An iOS-styled navigation bar with iOS-11-style large titles using slivers.
CupertinoSwitch
An iOS-style switch. Used to toggle the on/off state of a single setting.
CupertinoTabBar
An iOS-style bottom tab bar. Typically used with CupertinoTabScaffold.
CupertinoTabScaffold
Tabbed iOS app structure. Positions a tab bar on top of tabs of content.
CupertinoTabView
Root content of a tab that supports parallel navigation between tabs. Typically used with CupertinoTabScaffold.
CupertinoTextField | https://docs.flutter.dev/reference/widgets/index.html |
8965fec2fbf6-9 | CupertinoTextField
An iOS-style text field.
CupertinoTimerPicker
An iOS-style countdown timer picker.
CustomMultiChildLayout
A widget that uses a delegate to size and position multiple children.
CustomPaint
A widget that provides a canvas on which to draw during the paint phase.
CustomScrollView
A ScrollView that creates custom scroll effects using slivers.
CustomSingleChildLayout
A widget that defers the layout of its single child to a delegate.
DataTable
Data tables display sets of raw data. They usually appear in desktop enterprise products. The DataTable widget implements this component.
Date & Time Pickers
Date pickers use a dialog window to select a single date on mobile. Time pickers use a dialog to select a single time (in the...
DecoratedBox | https://docs.flutter.dev/reference/widgets/index.html |
8965fec2fbf6-10 | DecoratedBox
A widget that paints a Decoration either before or after its child paints.
DecoratedBoxTransition
Animated version of a DecoratedBox that animates the different properties of its Decoration.
DefaultTextStyle
The text style to apply to descendant Text widgets without explicit style.
Dismissible
A widget that can be dismissed by dragging in the indicated direction. Dragging or flinging this widget in the DismissDirection causes the child to slide...
Divider
A one logical pixel thick horizontal line, with padding on either side.
DragTarget
A widget that receives data when a Draggable widget is dropped. When a draggable is dragged on top of a drag target, the drag target...
Draggable | https://docs.flutter.dev/reference/widgets/index.html |
8965fec2fbf6-11 | Draggable
A widget that can be dragged from to a DragTarget. When a draggable widget recognizes the start of a drag gesture, it displays a feedback...
DraggableScrollableSheet
A container for a Scrollable that responds to drag gestures by resizing the scrollable until a limit is reached, and then scrolling.
Drawer
A Material Design panel that slides in horizontally from the edge of a Scaffold to show navigation links in an application.
DropdownButton
Shows the currently selected item and an arrow that opens a menu for selecting another item.
ElevatedButton
A Material Design elevated button. A filled button whose material elevates when pressed.
ExcludeSemantics
A widget that drops all the semantics of its descendants. This can be used to hide subwidgets that would otherwise be reported but that would...
Expanded | https://docs.flutter.dev/reference/widgets/index.html |
8965fec2fbf6-12 | Expanded
A widget that expands a child of a Row, Column, or Flex.
ExpansionPanel
Expansion panels contain creation flows and allow lightweight editing of an element. The ExpansionPanel widget implements this component.
FadeTransition
Animates the opacity of a widget.
FittedBox
Scales and positions its child within itself according to fit.
FloatingActionButton
A floating action button is a circular icon button that hovers over content to promote a primary action in the application. Floating action buttons are...
Flow
A widget that implements the flow layout algorithm.
FlutterLogo
The Flutter logo, in widget form. This widget respects the IconTheme.
Form
An optional container for grouping together multiple form field widgets (e.g. TextField widgets).
FormField | https://docs.flutter.dev/reference/widgets/index.html |
8965fec2fbf6-13 | FormField
A single form field. This widget maintains the current state of the form field, so that updates and validation errors are visually reflected in the...
FractionalTranslation
A widget that applies a translation expressed as a fraction of the box's size before painting its child.
FractionallySizedBox
A widget that sizes its child to a fraction of the total available space. For more details about the layout algorithm, see RenderFractionallySizedOverflowBox.
FutureBuilder
Widget that builds itself based on the latest snapshot of interaction with a Future.
GestureDetector
A widget that detects gestures. Attempts to recognize gestures that correspond to its non-null callbacks. If this widget has a child, it defers to that...
GridView
A grid list consists of a repeated pattern of cells arrayed in a vertical and horizontal layout. The GridView widget implements this component.
Hero | https://docs.flutter.dev/reference/widgets/index.html |
8965fec2fbf6-14 | Hero
A widget that marks its child as being a candidate for hero animations.
Icon
A Material Design icon.
IconButton
An icon button is a picture printed on a Material widget that reacts to touches by filling with color (ink).
IgnorePointer
A widget that is invisible during hit testing. When ignoring is true, this widget (and its subtree) is invisible to hit testing. It still consumes...
Image
A widget that displays an image.
IndexedStack
A Stack that shows a single child from a list of children.
InteractiveViewer
A widget that enables pan and zoom interactions with its child.
IntrinsicHeight
A widget that sizes its child to the child's intrinsic height.
IntrinsicWidth
A widget that sizes its child to the child's intrinsic width. | https://docs.flutter.dev/reference/widgets/index.html |
8965fec2fbf6-15 | A widget that sizes its child to the child's intrinsic width.
LayoutBuilder
Builds a widget tree that can depend on the parent widget's size.
LimitedBox
A box that limits its size only when it's unconstrained.
LinearProgressIndicator
A material design linear progress indicator, also known as a progress bar.
ListBody
A widget that arranges its children sequentially along a given axis, forcing them to the dimension of the parent in the other axis.
ListTile
A single fixed-height row that typically contains some text as well as a leading or trailing icon.
ListView
A scrollable, linear list of widgets. ListView is the most commonly used scrolling widget. It displays its children one after another in the scroll direction....
LongPressDraggable
Makes its child draggable starting from long press.
MaterialApp | https://docs.flutter.dev/reference/widgets/index.html |
8965fec2fbf6-16 | Makes its child draggable starting from long press.
MaterialApp
A convenience widget that wraps a number of widgets that are commonly required for applications implementing Material Design.
MediaQuery
Establishes a subtree in which media queries resolve to the given data.
MergeSemantics
A widget that merges the semantics of its descendants.
Navigator
A widget that manages a set of child widgets with a stack discipline. Many apps have a navigator near the top of their widget hierarchy...
NestedScrollView
A scrolling view inside of which can be nested other scrolling views, with their scroll positions being intrinsically linked.
NotificationListener
A widget that listens for Notifications bubbling up the tree.
Offstage
A widget that lays the child out as if it was in the tree, but without painting anything, without making the child available for hit... | https://docs.flutter.dev/reference/widgets/index.html |
8965fec2fbf6-17 | Opacity
A widget that makes its child partially transparent.
OutlinedButton
A Material Design outlined button, essentially a TextButton with an outlined border.
OverflowBox
A widget that imposes different constraints on its child than it gets from its parent, possibly allowing the child to overflow the parent.
Padding
A widget that insets its child by the given padding.
PageView
A scrollable list that works page by page.
Placeholder
A widget that draws a box that represents where other widgets will one day be added.
PopupMenuButton
Displays a menu when pressed and calls onSelected when the menu is dismissed because an item was selected.
PositionedTransition
Animated version of Positioned which takes a specific Animation to transition the child's position from a start position to and end position over the lifetime...
Radio | https://docs.flutter.dev/reference/widgets/index.html |
8965fec2fbf6-18 | Radio
Radio buttons allow the user to select one option from a set. Use radio buttons for exclusive selection if you think that the user needs...
RawImage
A widget that displays a dart:ui.Image directly.
RawKeyboardListener
A widget that calls a callback whenever the user presses or releases a key on a keyboard.
RefreshIndicator
A Material Design pull-to-refresh wrapper for scrollables.
ReorderableListView
A list whose items the user can interactively reorder by dragging.
RichText
The RichText widget displays text that uses multiple different styles. The text to display is described using a tree of TextSpan objects, each of which...
RotatedBox
A widget that rotates its child by a integral number of quarter turns.
RotationTransition
Animates the rotation of a widget.
Row | https://docs.flutter.dev/reference/widgets/index.html |
8965fec2fbf6-19 | Animates the rotation of a widget.
Row
Layout a list of child widgets in the horizontal direction.
Scaffold
Implements the basic Material Design visual layout structure. This class provides APIs for showing drawers, snack bars, and bottom sheets.
ScaleTransition
Animates the scale of transformed widget.
ScrollConfiguration
Controls how Scrollable widgets behave in a subtree.
Scrollable
Scrollable implements the interaction model for a scrollable widget, including gesture recognition, but does not have an opinion about how the viewport, which actually displays...
Scrollbar
A Material Design scrollbar. A scrollbar indicates which portion of a Scrollable widget is actually visible.
Semantics
A widget that annotates the widget tree with a description of the meaning of the widgets. Used by accessibility tools, search engines, and other semantic...
SimpleDialog | https://docs.flutter.dev/reference/widgets/index.html |
8965fec2fbf6-20 | SimpleDialog
Simple dialogs can provide additional details or actions about a list item. For example they can display avatars icons clarifying subtext or orthogonal actions (such...
SingleChildScrollView
A box in which a single widget can be scrolled. This widget is useful when you have a single box that will normally be entirely...
SizeTransition
Animates its own size and clips and aligns the child.
SizedBox
A box with a specified size. If given a child, this widget forces its child to have a specific width and/or height (assuming values are...
SizedOverflowBox
A widget that is a specific size but passes its original constraints through to its child, which will probably overflow.
SlideTransition
Animates the position of a widget relative to its normal position.
Slider
Sliders let users select from a range of values by moving the slider thumb. | https://docs.flutter.dev/reference/widgets/index.html |
8965fec2fbf6-21 | Sliders let users select from a range of values by moving the slider thumb.
SliverAppBar
A material design app bar that integrates with a CustomScrollView.
SliverChildBuilderDelegate
A delegate that supplies children for slivers using a builder callback.
SliverChildListDelegate
A delegate that supplies children for slivers using an explicit list.
SliverFixedExtentList
A sliver that places multiple box children with the same main axis extent in a linear array.
SliverGrid
A sliver that places multiple box children in a two dimensional arrangement.
SliverList
A sliver that places multiple box children in a linear array along the main axis.
SliverPadding
A sliver that applies padding on each side of another sliver.
SliverPersistentHeader | https://docs.flutter.dev/reference/widgets/index.html |
8965fec2fbf6-22 | SliverPersistentHeader
A sliver whose size varies when the sliver is scrolled to the edge of the viewport opposite the sliver's GrowthDirection.
SliverToBoxAdapter
A sliver that contains a single box widget.
SnackBar
A lightweight message with an optional action which briefly displays at the bottom of the screen.
Stack
This class is useful if you want to overlap several children in a simple way, for example having some text and an image, overlaid with...
Stepper
A Material Design stepper widget that displays progress through a sequence of steps.
StreamBuilder
Widget that builds itself based on the latest snapshot of interaction with a Stream.
Switch
On/off switches toggle the state of a single settings option. The Switch widget implements this component.
TabBar
A Material Design widget that displays a horizontal row of tabs. | https://docs.flutter.dev/reference/widgets/index.html |
8965fec2fbf6-23 | TabBar
A Material Design widget that displays a horizontal row of tabs.
TabBarView
A page view that displays the widget which corresponds to the currently selected tab. Typically used in conjunction with a TabBar.
TabController
Coordinates tab selection between a TabBar and a TabBarView.
TabPageSelector
Displays a row of small circular indicators, one per tab. The selected tab's indicator is highlighted. Often used in conjunction with a TabBarView.
Table
A widget that uses the table layout algorithm for its children.
Abc
Text
A run of text with a single style.
TextButton
A Material Design text button. A simple flat button without a border outline.
TextField
Touching a text field places the cursor and displays the keyboard. The TextField widget implements this component. | https://docs.flutter.dev/reference/widgets/index.html |
8965fec2fbf6-24 | Theme
Applies a theme to descendant widgets. A theme describes the colors and typographic choices of an application.
Tooltip
Tooltips provide text labels that help explain the function of a button or other user interface action. Wrap the button in a Tooltip widget to...
Transform
A widget that applies a transformation before painting its child.
WidgetsApp
A convenience class that wraps a number of widgets that are commonly required for an application.
Wrap
A widget that displays its children in multiple horizontal or vertical runs. | https://docs.flutter.dev/reference/widgets/index.html |
ac291c931a60-0 | Deprecated API removed after v1.22
Summary
Changes
CupertinoDialog
Cupertino navigation bars’ actionsForegroundColor
CupertinoTextThemeData.brightness
Pointer events constructed fromHoverEvent
showDialog uses builder
Scaffold.resizeToAvoidBottomPadding
ButtonTheme.bar
InlineSpan, TextSpan, PlaceholderSpan
RenderView.scheduleInitialFrame
Layer.findAll
BinaryMessages
Generic methods for BuildContext
WidgetsBinding.deferFirstFrameReport & WidgetsBinding.allowFirstFrameReport
WaitUntilNoTransientCallbacks, WaitUntilNoPendingFrame, & WaitUntilFirstFrameRasterized
Timeline
Summary | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-1 | Timeline
Summary
In accordance with Flutter’s Deprecation Policy,
deprecated APIs that reached end of life after the
1.22 stable release have been removed.
This is the first time deprecated APIs
have been removed from Flutter,
and some of these deprecations predate our
migration guide policy.
All affected APIs have been compiled into this
primary source to aid in migration. A
quick reference sheet is available as well.
A design document and article are available
for more context on Flutter’s deprecation policy.
Changes
This section lists the deprecations, listed by the affected class.
CupertinoDialog
Supported by fix tool: IDE fix only.
CupertinoDialog was deprecated in v0.2.3.
Use CupertinoAlertDialog or CupertinoPopupSurface instead.
Migration guide
CupertinoAlertDialog | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-2 | Migration guide
CupertinoAlertDialog
Code before migration:
CupertinoDialog
child:
myWidget
);
Code after migration:
CupertinoAlertDialog
content:
myWidget
);
CupertinoPopupSurface
Code before migration:
CupertinoDialog
child:
myWidget
);
Code after migration:
CupertinoPopupSurface
child:
myWidget
);
References
API documentation:
CupertinoAlertDialog
CupertinoPopupSurface
Relevant issues:
Deprecate CupertinoDialog class
Relevant PRs: | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-3 | Deprecate CupertinoDialog class
Relevant PRs:
Deprecated in #20649
Removed in #73604
Cupertino navigation bars’ actionsForegroundColor
Supported by fix tool: No
Migration guide
Code before migration:
CupertinoNavigationBar
actionsForegroundColor:
CupertinoColors
systemBlue
);
CupertinoSliverNavigationBar
actionsForegroundColor:
CupertinoColors
systemBlue
);
Code after migration:
CupertinoTheme
data:
CupertinoThemeData
primaryColor:
CupertinoColors
systemBlue
), | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-4 | CupertinoColors
systemBlue
),
child:
...
);
// To access the color from the `CupertinoTheme`
CupertinoTheme
of
context
primaryColor
References
API documentation:
CupertinoNavigationBar
CupertinoSliverNavigationBar
CupertinoTheme
CupertinoThemeData
Relevant issues:
Create a CupertinoApp and a CupertinoTheme
Relevant PRs:
Deprecated in #23759
Removed in #73745
CupertinoTextThemeData.brightness
Supported by fix tool: Yes | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-5 | Supported by fix tool: Yes
CupertinoTextThemeData.brightness was deprecated in v1.10.14.
This field member was made ineffective at the time of deprecation.
There is no replacement for this
parameter, references should be removed.
Migration guide
Code before migration:
const
CupertinoTextThemeData
themeData
CupertinoTextThemeData
brightness:
Brightness
dark
);
themeData
copyWith
brightness:
Brightness
light
);
Code after migration:
const
CupertinoTextThemeData
themeData
CupertinoTextThemeData
();
themeData
copyWith | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-6 | ();
themeData
copyWith
();
References
API documentation:
CupertinoTextThemeData
Relevant issues:
Revise CupertinoColors and CupertinoTheme for dynamic colors
Relevant PRs:
Deprecated in #41859
Removed in #72017
Pointer events constructed fromHoverEvent
Supported by fix tool: Yes
The fromHoverEvent constructors for PointerEnterEvent
and PointerExitEvent were deprecated in v1.4.3.
The fromMouseEvent constructor should be used instead.
Migration guide
Code before migration:
final
PointerEnterEvent
enterEvent
PointerEnterEvent
fromHoverEvent | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-7 | PointerEnterEvent
fromHoverEvent
PointerHoverEvent
());
final
PointerExitEvent
exitEvent
PointerExitEvent
fromHoverEvent
PointerHoverEvent
());
Code after migration:
final
PointerEnterEvent
enterEvent
PointerEnterEvent
fromMouseEvent
PointerHoverEvent
());
final
PointerExitEvent
exitEvent
PointerExitEvent
fromMouseEvent
PointerHoverEvent
());
References
API documentation:
PointerEnterEvent
PointerExitEvent
Relevant issues: | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-8 | PointerExitEvent
Relevant issues:
PointerEnterEvent and PointerExitEvent can only
be created from hover events
Relevant PRs:
Deprecated in #28602
Removed in #72395
showDialog uses builder
Supported by fix tool: Yes
The child parameter of showDialog was deprecated in in v0.2.3.
The builder parameter should be used instead.
Migration guide
Code before migration:
showDialog
child:
myWidget
);
Code after migration:
showDialog
builder:
context
myWidget
);
References
API documentation:
showDialog
Relevant issues: | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-9 | API documentation:
showDialog
Relevant issues:
showDialog should take a builder rather than a child
Relevant PRs:
Deprecated in #15303
Removed in #72532
Scaffold.resizeToAvoidBottomPadding
Supported by fix tool: Yes
The resizeToAvoidBottomPadding parameter of Scaffold was deprecated in in v1.1.9.
The resizeToAvoidBottomInset parameter should be used instead.
Migration guide
Code before migration:
Scaffold
resizeToAvoidBottomPadding:
true
);
Code after migration:
Scaffold
resizeToAvoidBottomInset:
true
);
References | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-10 | true
);
References
API documentation:
Scaffold
Relevant issues:
Show warning when nesting Scaffolds
SafeArea with keyboard
Double stacked material scaffolds shouldn’t double resizeToAvoidBottomPadding
viewInsets and padding on Window and MediaQueryData should define how they interact
bottom overflow issue, when using textfields inside tabbarview
Relevant PRs:
Deprecated in #26259
Removed in #72890
ButtonTheme.bar
Supported by fix tool: No
Migration guide
Code before migration:
ButtonTheme
bar
minWidth:
10.0
alignedDropdown:
true | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-11 | alignedDropdown:
true
height:
40.0
);
Code after migration, using ButtonTheme:
ButtonTheme
minWidth:
10.0
alignedDropdown:
true
height:
40.0
);
Code after migration, using ButtonBarTheme:
ButtonBarTheme
data:
ButtonBarThemeData
buttonMinWidth:
10.0
buttonAlignedDropdown:
true
buttonHeight:
40.0
);
References
API documentation:
ButtonTheme
ButtonBarTheme
ButtonBar | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-12 | ButtonTheme
ButtonBarTheme
ButtonBar
TextButtonTheme
TextButton
ElevatedButtonTheme
ElevatedButton
OutlinedButtonTheme
OutlinedButton
Relevant issues:
ButtonTheme.bar uses accent color when it should be using primary color
ThemeData.accentColor has insufficient contrast for text
Increased height as a result of changes to materialTapTargetSize affecting AlertDialog/ButtonBar heights
Relevant PRs:
Deprecated in #37544
Removed in #73746
InlineSpan, TextSpan, PlaceholderSpan
Supported by fix tool: No
The following methods were deprecated in the InlineSpan, TextSpan and PlaceholderSpan in order
to enable embedding widgets inline into paragraphs, like images. | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-13 | Migration guide
InlineSpan.text
TextSpan.text
InlineSpan.children
TextSpan.children
InlineSpan.visitTextSpan
InlineSpan.visitChildren
InlineSpan.recognizer
TextSpan.recognizer
InlineSpan.describeSemantics
InlineSpan.computeSemanticsInformation
PlaceholderSpan.visitTextSpan
PlaceHolderSpan.visitChildren
TextSpan.visitTextSpan
TextSpan.visitChildren
References
API documentation:
InlineSpan
TextSpan
PlaceholderSpan
WidgetSpan
Relevant issues:
Text: support inline images
Relevant PRs: | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-14 | Text: support inline images
Relevant PRs:
Development history:
#30069
#33946
#33794
Deprecated in #34051
Removed in #73747
RenderView.scheduleInitialFrame
Supported by fix tool: No
The RenderView.scheduleInitialFrame method was deprecated and removed in order to prevent
splash screens from being taken down too early, resulting in a black screen. This would happen when
WidgetsFlutterBinding.ensureInitialized was called. Instead, replace calls to this method with
RenderView.prepareInitialFrame, followed by RenderView.owner.requestVisualUpdate.
Migration guide
Code before migration:
scheduleInitialFrame
();
Code after migration:
prepareInitialFrame
();
owner | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-15 | prepareInitialFrame
();
owner
requestVisualUpdate
();
References
API documentation:
RenderView
WidgetsFlutterBinding
Relevant issues:
WidgetsFlutterBinding.ensureInitialized() takes down splash screen too early
Relevant PRs:
Deprecated in #39535
Removed in #73748
Layer.findAll
Supported by fix tool: No
Migration guide
Code before migration:
findAll
offset
);
Code after migration:
findAllAnnotations
offset
annotations
References
API documentation:
Layer
MouseRegion | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-16 | API documentation:
Layer
MouseRegion
RenderMouseRegion
AnnotatedRegionLayer
AnnotationResult
Relevant issues:
Breaking Proposal: MouseRegion defaults to opaque; Layers are required to implement findAnnotations
Relevant PRs:
Initially changed in #37896
Deprecated in #42953
Removed in #73749
BinaryMessages
Supported by fix tool: No
Migration guide
defaultBinaryMessenger
ServicesBinding.instance.defaultBinaryMessenger
BinaryMessages
BinaryMessenger
BinaryMessages.handlePlatformMessage
ServicesBinding.instance.defaultBinaryMessenger.handlePlatformMessage
BinaryMessages.send | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-17 | BinaryMessages.send
ServicesBinding.instance.defaultBinaryMessenger.send
BinaryMessages.setMessageHandler
ServicesBinding.instance.defaultBinaryMessenger.setMessageHandler
BinaryMessages.setMockMessageHandler
ServicesBinding.instance.defaultBinaryMessenger.setMockMessageHandler
References
API documentation:
ServicesBinding
BinaryMessenger
Relevant issues:
Flutter synchronization support for Espresso/EarlGrey
Relevant PRs:
Initially changed in #37489
Deprecated in #38464
Removed in #73750
Generic methods for BuildContext
Supported by fix tool: Yes | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-18 | Generic methods for BuildContext
Supported by fix tool: Yes
Several methods in BuildContext were using Type to search for ancestors. Most of those methods
implied a cast at call site because their return type was a parent type. Moreover the type provided
was not checked at analysis time even if the type is actually constrained. Making these methods
generics improves type safety and requires less code.
These method changes affect the BuildContext, Element, and StatefulElement classes. The
TypeMatcher class was also removed.
Migration guide
Code before migration:
ComplexLayoutState
state
context
ancestorStateOfType
const
TypeMatcher
ComplexLayoutState
>())
as
ComplexLayoutState
Code after migration:
ComplexLayoutState
state
context | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-19 | ComplexLayoutState
state
context
ancestorStateOfType
ComplexLayoutState
>();
BuildContext
inheritFromElement
dependOnInheritedElement
inheritFromWidgetOfExactType
dependOnInheritedWidgetOfExactType
ancestorInheritedElementForWidgetOfExactType
getElementForInheritedWidgetOfExactType
ancestorWidgetOfExactType
findAncestorWidgetOfExactType
ancestorStateOfType
findAncestorStateOfType
rootAncestorStateOfType
findRootAncestorStateOfType
ancestorRenderObjectOfType
findAncestorRenderObjectOfType
Element
inheritFromElement | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-20 | Element
inheritFromElement
dependOnInheritedElement
inheritFromWidgetOfExactType
dependOnInheritedWidgetOfExactType
ancestorInheritedElementForWidgetOfExactType
getElementForInheritedWidgetOfExactType
ancestorWidgetOfExactType
findAncestorWidgetOfExactType
ancestorStateOfType
findAncestorStateOfType
rootAncestorStateOfType
findRootAncestorStateOfType
ancestorRenderObjectOfType
findAncestorRenderObjectOfType
StatefulElement
inheritFromElement
dependOnInheritedElement
References
API documentation:
Type
BuildContext
Element | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-21 | Type
BuildContext
Element
StatefulElement
Relevant PRs:
Deprecated in #44189
Removed in:
#69620
#72903
#72901
#73751
WidgetsBinding.deferFirstFrameReport & WidgetsBinding.allowFirstFrameReport
Supported by fix tool: Yes
The deferFirstFrameReport and allowFirstFrameReport methods of WidgetsBinding were deprecated
and removed in order to provide the option to delay rendering the first frame. This is useful for
widgets that need to obtain initialization information asynchronously and while they are waiting for
that information no frame should render as that would take down the splash screen pre-maturely.
The deferFirstFrame and allowFirstFrame methods should be used respectively instead.
Migration guide
Code before migration:
final | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-22 | Migration guide
Code before migration:
final
WidgetsBinding
binding
WidgetsBinding
instance
binding
deferFirstFrameReport
();
binding
allowFirstFrameReport
();
Code after migration:
final
WidgetsBinding
binding
WidgetsBinding
instance
binding
deferFirstFrame
();
binding
allowFirstFrame
();
References
API documentation:
WidgetsBinding
Relevant PRs:
Initially changed in
#45135
#45588
Deprecated in #45941 | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-23 | Deprecated in #45941
Removed in #72893
WaitUntilNoTransientCallbacks, WaitUntilNoPendingFrame, & WaitUntilFirstFrameRasterized
Supported by fix tool: No
The WaitUntilNoTransientCallbacks, WaitUntilNoPendingFrame, and WaitUntilFirstFrameRasterized
methods from the flutter_driver packages were deprecated and removed in order to provide a more
composable waitForCondition API that can be used to compose conditions that the client would like
to wait for.
Migration guide
WaitUntilNoTransientCallbacks
WaitForCondition(NoTransientCallbacks())
WaitUntilNoPendingFrame
WaitForCondition(NoPendingFrame())
WaitUntilFirstFrameRasterized
WaitForCondition(FirstFrameRasterized))
References
API documentation: | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
ac291c931a60-24 | References
API documentation:
WaitForCondition
Relevant issues:
Flutter synchronization support for Espresso/EarlGrey
Relevant PRs:
Initially changed in #37736
Deprecated in #38836
Removed in #73754
Timeline
In stable release: 2.0.0 | https://docs.flutter.dev/release/breaking-changes/1-22-deprecations/index.html |
df2a873730be-0 | Deprecated API removed after v2.10
Summary
Changes
maxLengthEnforced of TextField & related classes
VelocityTracker constructor
DayPicker & MonthPicker
FlatButton, RaisedButton, & OutlineButton
Scaffold SnackBar methods
RectangularSliderTrackShape.disabledThumbGapWidth
Text selection of ThemeData to TextSelectionThemeData
RenderEditable.onSelectionChanged to TextSelectionDelegate.textEditingValue
Stack.overflow
UpdateLiveRegionEvent
RenderObjectElement methods
Timeline
Summary
In accordance with Flutter’s Deprecation Policy,
deprecated APIs that reached end of life after the
2.10 stable release have been removed.
All affected APIs have been compiled into this
primary source to aid in migration. A
quick reference sheet is available as well.
Changes
This section lists the deprecations by affected class. | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-1 | Changes
This section lists the deprecations by affected class.
maxLengthEnforced of TextField & related classes
Supported by Flutter Fix: yes
maxLengthEnforced was deprecated in v1.25.
The following classes all have the same change of API:
TextField
TextFormField
CupertinoTextField
Migration guide
In-depth migration guide available
Code before migration:
const
TextField
textField
TextField
maxLengthEnforced:
true
);
const
TextField
textField
TextField
maxLengthEnforced:
false
);
final
lengthEnforced | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-2 | );
final
lengthEnforced
textField
maxLengthEnforced
const
TextFormField
textFormField
TextFormField
maxLengthEnforced:
true
);
const
TextFormField
textFormField
TextFormField
maxLengthEnforced:
false
);
final
lengthEnforced
textFormField
maxLengthEnforced
const
CupertinoTextField
cupertinoTextField
CupertinoTextField
maxLengthEnforced:
true
);
const
CupertinoTextField | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-3 | );
const
CupertinoTextField
cupertinoTextField
CupertinoTextField
maxLengthEnforced:
false
);
final
lengthEnforced
cupertinoTextField
maxLengthEnforced
Code after migration:
const
TextField
textField
TextField
maxLengthEnforcement:
MaxLengthEnforcement
enforce
);
const
TextField
textField
TextField
maxLengthEnforcement:
MaxLengthEnforcement
none
);
final
lengthEnforced
textField | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-4 | final
lengthEnforced
textField
maxLengthEnforcement
const
TextFormField
textFormField
TextFormField
maxLengthEnforcement:
MaxLengthEnforcement
enforce
);
const
TextFormField
textFormField
TextFormField
maxLengthEnforcement:
MaxLengthEnforcement
none
);
final
lengthEnforced
textFormField
maxLengthEnforcement
const
CupertinoTextField
cupertinoTextField
CupertinoTextField
maxLengthEnforcement:
MaxLengthEnforcement
enforce | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-5 | MaxLengthEnforcement
enforce
);
const
CupertinoTextField
cupertinoTextField
CupertinoTextField
maxLengthEnforcement:
MaxLengthEnforcement
none
);
final
lengthEnforced
cupertinoTextField
maxLengthEnforcement
References
API documentation:
TextField
TextFormField
CupertinoTextField
Relevant issues:
Issue 67898
Relevant PRs:
Deprecated in #68086
Removed in #98539
VelocityTracker constructor
Supported by Flutter Fix: yes | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-6 | VelocityTracker constructor
Supported by Flutter Fix: yes
The default constructor for VelocityTrackerwas deprecated in v1.22.
The VelocityTracker.withKind() should be used instead. This allows for a
PointerDeviceKind to be specified for the tracker. The previous default for
VelocityTracker.kind was PointerDeviceKind.touch.
Migration guide
Code before migration:
final
VelocityTracker
tracker
VelocityTracker
();
Code after migration:
final
VelocityTracker
tracker
VelocityTracker
withKind
PointerDeviceKind
touch
);
References
API documentation:
VelocityTracker
PointerDeviceKind | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-7 | VelocityTracker
PointerDeviceKind
Relevant PRs:
Deprecated in #66043
Removed in #98541
DayPicker & MonthPicker
Supported by Flutter Fix: no
The DayPicker and MonthPicker widgets were first deprecated in v1.15, and
then extended in v1.26.
They have been replaced by one comprehensive widget, CalendarDatePicker.
These widgets were displayed using the showDatePicker method. This method was
migrated to present the new CalendarDatePicker before this release, and so
their final removal should not necessitate further action.
References
Design document:
Material Date Picker Redesign
API documentation:
CalendarDatePicker
showDatePicker
Relevant issues:
Issue 50133 | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-8 | Relevant issues:
Issue 50133
Relevant PRs:
Deprecated in #50546
Removed in #98543
FlatButton, RaisedButton, & OutlineButton
Supported by Flutter Fix: no
The FlatButton, RaisedButton, and OutlineButton widgets were first
deprecated in v1.20, and then extended in v1.26.
They are replaced by new buttons, TextButton, ElevatedButton, and
OutlinedButton. These new widgets also use new associated themes, rather than
the generic ButtonTheme.
FlatButton
ButtonTheme
TextButton
TextButtonTheme
RaisedButton
ButtonTheme
ElevatedButton
ElevatedButtonTheme
OutlineButton | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-9 | ElevatedButtonTheme
OutlineButton
ButtonTheme
OutlinedButton
OutlinedButtonTheme
Migration guide
In-depth migration guide available for detailed styling
Code before migration:
FlatButton
onPressed:
onPressed
child:
Text
'Button'
),
// ...
);
RaisedButton
onPressed:
onPressed
child:
Text
'Button'
),
// ...
);
OutlineButton
onPressed:
onPressed
child:
Text
'Button'
), | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-10 | Text
'Button'
),
// ...
);
Code after migration:
TextButton
onPressed:
onPressed
child:
Text
'Button'
),
// ...
);
ElevatedButton
onPressed:
onPressed
child:
Text
'Button'
),
// ...
);
OutlinedButton
onPressed:
onPressed
child:
Text
'Button'
),
// ...
);
References
Design document: | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-11 | );
References
Design document:
New Material buttons and themes
API documentation:
ButtonStyle
ButtonStyleButton
ElevatedButton
ElevatedButtonTheme
ElevatedButtonThemeData
OutlinedButton
OutlinedButtonTheme
OutlinedButtonThemeData
TextButton
TextButtonTheme
TextButtonThemeData
Relevant PRs:
New API added in #59702
Deprecated in #73352
Removed in #98546
Scaffold SnackBar methods
Supported by Flutter Fix: no
The following Scaffold SnackBar methods were deprecated in v1.23.
showSnackBar | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-12 | showSnackBar
removeCurrentSnackBar
hideCurrentSnackBar
The same named methods of the ScaffoldMessenger should be used instead. A
default ScaffoldMessenger is already created in every MaterialApp.
Migration guide
In-depth migration guide available
Code before migration:
Scaffold
of
context
showSnackBar
mySnackBar
);
Scaffold
of
context
removeCurrentSnackBar
mySnackBar
);
Scaffold
of
context
hideCurrentSnackBar
mySnackBar
);
Code after migration: | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-13 | );
Code after migration:
ScaffoldMessenger
of
context
showSnackBar
mySnackBar
);
ScaffoldMessenger
of
context
removeCurrentSnackBar
mySnackBar
);
ScaffoldMessenger
of
context
hideCurrentSnackBar
mySnackBar
);
References
Design Document
ScaffoldMessenger Design
Video Content
SnackBar Delivery
Widget of the Week
API documentation:
ScaffoldMessenger
SnackBar | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-14 | ScaffoldMessenger
SnackBar
Relevant issues:
Issue 57218
Issue 62921
Relevant PRs:
New API added in #64101
Deprecated in #67947
Removed in #98549
RectangularSliderTrackShape.disabledThumbGapWidth
Supported by Flutter Fix: yes
The RectangularSliderTrackShape.disabledThumbGapWidth was first deprecated in
v1.5, and then extended in v1.26.
This was no longer used by the framework, as the animation of the slider thumb
no longer occurs when disabled.
Migration guide
Code before migration:
RectangularSliderTrackShape
disabledThumbGapWidth:
2.0 | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-15 | disabledThumbGapWidth:
2.0
);
Code after migration:
RectangularSliderTrackShape
();
References
API documentation:
RectangularSliderTrackShape
Relevant PRs:
Animation changed in #30390
Deprecated in #65246
Removed in #98613
Text selection of ThemeData to TextSelectionThemeData
Supported by Flutter Fix: yes
The following ThemeData members were first deprecated in v1.23, and extended
in v1.26.
useTextSelectionTheme
textSelectionColor
cursorColor
textSelectionHandleColor | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-16 | textSelectionColor
cursorColor
textSelectionHandleColor
These should be replaced by a more comprehensive TextSelectionThemeData,
which is now specified in ThemeData itself.
The useTextSelectionTheme flag served as a temporary migration flag to
distinguish the two APIs, it can be removed now.
Migration guide
In-depth migration guide available
Code before migration:
ThemeData
useTextSelectionTheme:
false
textSelectionColor:
Colors
blue
cursorColor:
Colors
green
textSelectionHandleColor:
Colors
red
);
Code after migration:
ThemeData
textSelectionTheme:
TextSelectionThemeData
selectionColor: | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-17 | TextSelectionThemeData
selectionColor:
Colors
blue
cursorColor:
Colors
green
selectionHandleColor:
Colors
red
),
);
References
Design Document
Text Selection Theme
API documentation:
ThemeData
TextSelectionThemeData
Relevant issues:
Issue 17635
Issue 56082
Issue 61227
Relevant PRs:
New API added in #62014
Deprecated in #66485
Removed in #98578
RenderEditable.onSelectionChanged to TextSelectionDelegate.textEditingValue | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-18 | RenderEditable.onSelectionChanged to TextSelectionDelegate.textEditingValue
Supported by Flutter Fix: no
RenderEditable.onSelectionChanged and TextSelectionDelegate.textEditingValue
were deprecated in v1.26.
Instead of calling one or both of these methods, call
TextSelectionDelegate.userUpdateTextEditingValue. This fixed a bug where the
TextInputFormatter would receive the wrong selection value.
Migration guide
Code before migration:
renderEditable
onSelectionChanged
selection
renderObject
cause
);
textSelectionDelegate
textEditingValue
value
Code after migration:
textSelectionDelegate
userUpdateTextEditingValue
value
cause
);
References
API documentation: | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-19 | );
References
API documentation:
RenderEditable
TextSelectionDelegate
Relevant issues:
Resolved #75505
Relevant PRs:
Deprecated in #75541
Removed in #98582
Stack.overflow
Supported by Flutter Fix: yes
Stack.overflow, as well as the Overflow enum were deprecated in v1.22.
The replacement is Stack.clipBehavior, a change made as part of unifying clip
behaviors and semantics across the framework. Where Overflow.visible was used,
use Clip.none. Where Overflow.clip was used, use Clip.hardEdge.
Migration guide
In-depth migration guide available
Code before migration:
const
Stack
stack
Stack | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-20 | const
Stack
stack
Stack
overflow:
Overflow
visible
);
const
Stack
stack
Stack
overflow:
Overflow
clip
);
Code after migration:
const
Stack
stack
Stack
clipBehavior:
Clip
none
);
const
Stack
stack
Stack
clipBehavior:
Clip
hardEdge
);
References
API documentation:
Stack
Clip
Relevant issues: | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-21 | Stack
Clip
Relevant issues:
Resolved #66030
Relevant PRs:
Deprecated in #66305
Removed in #98583
UpdateLiveRegionEvent
Supported by Flutter Fix: no
The SemanticsEvent UpdateLiveRegionEvent, was first deprecated in v1.12, and
then extended in v1.26.
This was never implemented by the framework, and any references should be
removed.
References
API documentation:
SemanticsEvent
Relevant PRs:
Deprecated in #45940
Removed in #98615
RenderObjectElement methods
Supported by Flutter Fix: yes | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-22 | RenderObjectElement methods
Supported by Flutter Fix: yes
The following RenderObjectElement methods were deprecated in v1.21.
insertChildRenderObject
moveChildRenderObject
removeChildRenderObject
These methods are replaced, respectively, by:
insertRenderObjectChild
moveRenderObjectChild
removeRenderObjectChild
These changes were made as a soft breaking deprecation in order to change the
function signature.
Migration guide
Code before migration:
element
insertChildRenderObject
child
slot
);
element
moveChildRenderObject
child
slot
);
element
removeChildRenderObject
child
);
Code after migration: | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
df2a873730be-23 | child
);
Code after migration:
element
insertRenderObjectChild
child
slot
);
element
moveRenderObjectChild
child
oldSlot
newSlot
);
element
removeRenderObjectChild
child
slot
);
References
API documentation:
RenderObjectElement
Relevant issues:
Issue 63269
Relevant PRs:
Deprecated in #64254
Removed in #98616
Timeline
In stable release: 3.0.0 | https://docs.flutter.dev/release/breaking-changes/2-10-deprecations/index.html |
de8954c3a52b-0 | Deprecated API removed after v2.2
Summary
Changes
hasFloatingPlaceholder of InputDecoration & InputDecorationTheme
TextTheme
Default Typography
Timeline
Summary
In accordance with Flutter’s Deprecation Policy,
deprecated APIs that reached end of life after the
2.2 stable release have been removed.
All affected APIs have been compiled into this
primary source to aid in migration. A
quick reference sheet is available as well.
Changes
This section lists the deprecations, listed by the affected class.
hasFloatingPlaceholder of InputDecoration & InputDecorationTheme
Supported by Flutter Fix: yes
Migration guide
Code before migration:
// InputDecoration
// Base constructor
InputDecoration
hasFloatingPlaceholder: | https://docs.flutter.dev/release/breaking-changes/2-2-deprecations/index.html |
de8954c3a52b-1 | InputDecoration
hasFloatingPlaceholder:
true
);
InputDecoration
hasFloatingPlaceholder:
false
);
// collapsed constructor
InputDecoration
collapsed
hasFloatingPlaceholder:
true
);
InputDecoration
collapsed
hasFloatingPlaceholder:
false
);
// Field access
inputDecoration
hasFloatingPlaceholder
// InputDecorationTheme
// Base constructor
InputDecorationTheme
hasFloatingPlaceholder:
true
);
InputDecorationTheme
hasFloatingPlaceholder: | https://docs.flutter.dev/release/breaking-changes/2-2-deprecations/index.html |
de8954c3a52b-2 | InputDecorationTheme
hasFloatingPlaceholder:
false
);
// Field access
inputDecorationTheme
hasFloatingPlaceholder
// copyWith
inputDecorationTheme
copyWith
hasFloatingPlaceholder:
false
);
inputDecorationTheme
copyWith
hasFloatingPlaceholder:
true
);
Code after migration:
// InputDecoration
// Base constructor
InputDecoration
floatingLabelBehavior:
FloatingLabelBehavior
auto
);
InputDecoration
floatingLabelBehavior:
FloatingLabelBehavior
never
); | https://docs.flutter.dev/release/breaking-changes/2-2-deprecations/index.html |
de8954c3a52b-3 | FloatingLabelBehavior
never
);
// collapsed constructor
InputDecoration
collapsed
floatingLabelBehavior:
FloatingLabelBehavior
auto
);
InputDecoration
collapsed
floatingLabelBehavior:
FloatingLabelBehavior
never
);
// Field access
inputDecoration
floatingLabelBehavior
// InputDecorationTheme
// Base constructor
InputDecorationTheme
floatingLabelBehavior:
FloatingLabelBehavior
auto
);
InputDecorationTheme
floatingLabelBehavior:
FloatingLabelBehavior
never
);
// Field access | https://docs.flutter.dev/release/breaking-changes/2-2-deprecations/index.html |
de8954c3a52b-4 | never
);
// Field access
inputDecorationTheme
floatingLabelBehavior
// copyWith
inputDecorationTheme
copyWith
floatingLabelBehavior:
FloatingLabelBehavior
never
);
inputDecorationTheme
copyWith
floatingLabelBehavior:
FloatingLabelBehavior
auto
);
References
API documentation:
InputDecoration
InputDecorationTheme
FloatingLabelBehavior
Relevant issues:
InputDecoration: option to always float label
Relevant PRs:
Deprecated in #46115
Removed in #83923
TextTheme | https://docs.flutter.dev/release/breaking-changes/2-2-deprecations/index.html |
de8954c3a52b-5 | Removed in #83923
TextTheme
Supported by Flutter Fix: yes
Several TextStyle properties of TextTheme were deprecated in v1.13.8. They
are listed in the following table alongside the appropriate replacement in the
new API.
display4
headline1
display3
headline2
display2
headline3
display1
headline4
headline
headline5
title
headline6
subhead
subtitle1
body2
bodyText1
body1
bodyText2
subtitle
subtitle2
Migration guide
Code before migration:
// TextTheme | https://docs.flutter.dev/release/breaking-changes/2-2-deprecations/index.html |
de8954c3a52b-6 | Code before migration:
// TextTheme
// Base constructor
TextTheme
display4:
displayStyle4
display3:
displayStyle3
display2:
displayStyle2
display1:
displayStyle1
headline:
headlineStyle
title:
titleStyle
subhead:
subheadStyle
body2:
body2Style
body1:
body1Style
caption:
captionStyle
button:
buttonStyle
subtitle:
subtitleStyle
overline:
overlineStyle
);
// copyWith | https://docs.flutter.dev/release/breaking-changes/2-2-deprecations/index.html |
de8954c3a52b-7 | overlineStyle
);
// copyWith
TextTheme
copyWith
display4:
displayStyle4
display3:
displayStyle3
display2:
displayStyle2
display1:
displayStyle1
headline:
headlineStyle
title:
titleStyle
subhead:
subheadStyle
body2:
body2Style
body1:
body1Style
caption:
captionStyle
button:
buttonStyle
subtitle:
subtitleStyle
overline:
overlineStyle
);
// Getters | https://docs.flutter.dev/release/breaking-changes/2-2-deprecations/index.html |
de8954c3a52b-8 | overlineStyle
);
// Getters
TextStyle
style
style
textTheme
display4
style
textTheme
display3
style
textTheme
display2
style
textTheme
display1
style
textTheme
headline
style
textTheme
title
style
textTheme
subhead
style
textTheme
body2
style
textTheme
body1
style
textTheme
caption
style
textTheme
button | https://docs.flutter.dev/release/breaking-changes/2-2-deprecations/index.html |
de8954c3a52b-9 | style
textTheme
button
style
textTheme
subtitle
style
textTheme
overline
Code after migration:
// TextTheme
// Base constructor
TextTheme
headline1:
displayStyle4
headline2:
displayStyle3
headline3:
displayStyle2
headline4:
displayStyle1
headline5:
headlineStyle
headline6:
titleStyle
subtitle1:
subheadStyle
bodyText1:
body2Style
bodyText2:
body1Style
caption: | https://docs.flutter.dev/release/breaking-changes/2-2-deprecations/index.html |
de8954c3a52b-10 | body1Style
caption:
captionStyle
button:
buttonStyle
subtitle2:
subtitleStyle
overline:
overlineStyle
);
TextTheme
copyWith
headline1:
displayStyle4
headline2:
displayStyle3
headline3:
displayStyle2
headline4:
displayStyle1
headline5:
headlineStyle
headline6:
titleStyle
subtitle1:
subheadStyle
bodyText1:
body2Style
bodyText2:
body1Style
caption: | https://docs.flutter.dev/release/breaking-changes/2-2-deprecations/index.html |
de8954c3a52b-11 | body1Style
caption:
captionStyle
button:
buttonStyle
subtitle2:
subtitleStyle
overline:
overlineStyle
);
TextStyle
style
style
textTheme
headline1
style
textTheme
headline2
style
textTheme
headline3
style
textTheme
headline4
style
textTheme
headline5
style
textTheme
headline6
style
textTheme
subtitle1
style
textTheme | https://docs.flutter.dev/release/breaking-changes/2-2-deprecations/index.html |
de8954c3a52b-12 | subtitle1
style
textTheme
bodyText1
style
textTheme
bodyText2
style
textTheme
caption
style
textTheme
button
style
textTheme
subtitle2
style
textTheme
overline
References
Design document:
Update the TextTheme API
API documentation:
TextTheme
Relevant issues:
Migrate TextTheme to 2018 APIs
Relevant PRs:
Deprecated in #48547
Removed in #83924
Default Typography | https://docs.flutter.dev/release/breaking-changes/2-2-deprecations/index.html |
de8954c3a52b-13 | Removed in #83924
Default Typography
Supported by Flutter Fix: no
The default Typography was deprecated in v1.13.8.
The prior default returned the text stylings of the 2014 Material Design specification.
This will now result in TextStyles reflecting the 2018 Material Design specification.
For the former, use the material2014 constructor.
Migration guide
Code before migration:
// Formerly returned 2014 TextStyle spec
Typography
();
Code after migration:
// Use 2018 TextStyle spec, either by default or explicitly.
Typography
();
Typography
material2018
();
// Use 2014 spec from former API
Typography | https://docs.flutter.dev/release/breaking-changes/2-2-deprecations/index.html |
de8954c3a52b-14 | // Use 2014 spec from former API
Typography
material2014
();
References
Design document:
Update the TextTheme API
API documentation:
Typography
Relevant issues:
Migrate TextTheme to 2018 APIs
Relevant PRs:
Deprecated in #48547
Removed in #83924
Timeline
In stable release: 2.5 | https://docs.flutter.dev/release/breaking-changes/2-2-deprecations/index.html |
abfc3fc3478f-0 | Deprecated API removed after v2.5
Summary
Changes
autovalidate of Form & related classes
FloatingHeaderSnapConfiguration.vsync
AndroidViewController & subclasses’ id
BlacklistingTextInputFormatter & WhitelistingTextInputFormatter
BottomNavigationBarItem.title
packageRoot in dart:core, dart:isolate, and package:platform
Timeline
Summary
In accordance with Flutter’s Deprecation Policy,
deprecated APIs that reached end of life after the
2.5 stable release have been removed.
All affected APIs have been compiled into this
primary source to aid in migration. A
quick reference sheet is available as well.
Changes
This section lists the deprecations by affected class.
autovalidate of Form & related classes
Supported by Flutter Fix: yes
autovalidate was deprecated in v1.19. | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-1 | autovalidate was deprecated in v1.19.
The following classes all have the same change of API:
Form
FormField
DropdownButtonFormField
TextFormField
Migration guide
In-depth migration guide available
Code before migration:
const
Form
form
Form
autovalidate:
true
);
const
Form
form
Form
autovalidate:
false
);
final
autoMode
form
autovalidate
const
FormField
formField
FormField
autovalidate: | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-2 | formField
FormField
autovalidate:
true
);
const
FormField
formField
FormField
autovalidate:
false
);
final
autoMode
formField
autovalidate
const
TextFormField
textFormField
TextFormField
autovalidate:
true
);
const
TextFormField
textFormField
TextFormField
autovalidate:
false
);
const
DropdownButtonFormField
dropDownButtonFormField
DropdownButtonFormField | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-3 | dropDownButtonFormField
DropdownButtonFormField
autovalidate:
true
);
const
DropdownButtonFormField
dropdownButtonFormField
DropdownButtonFormField
autovalidate:
false
);
Code after migration:
const
Form
form
Form
autovalidateMode:
AutovalidateMode
always
);
const
Form
form
Form
autovalidateMode:
AutovalidateMode
disabled
);
final
autoMode
form
autovalidateMode | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-4 | autoMode
form
autovalidateMode
const
FormField
formField
FormField
autovalidateMode:
AutovalidateMode
always
);
const
FormField
formField
FormField
autovalidateMode:
AutovalidateMode
disabled
);
final
autoMode
formField
autovalidateMode
const
TextFormField
textFormField
TextFormField
autovalidateMode:
AutovalidateMode
always
);
const
TextFormField | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-5 | );
const
TextFormField
textFormField
TextFormField
autovalidateMode:
AutovalidateMode
disabled
);
const
DropdownButtonFormField
dropDownButtonFormField
DropdownButtonFormField
autovalidateMode:
AutovalidateMode
always
);
const
DropdownButtonFormField
dropdownButtonFormField
DropdownButtonFormField
autovalidateMode:
AutovalidateMode
disabled
);
References
API documentation:
Form
FormField
TextFormField
DropdownButtonFormField | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-6 | TextFormField
DropdownButtonFormField
AutovalidateMode
Relevant issues:
Issue 56363
Issue 18885
Issue 15404
Issue 36154
Issue 48876
Relevant PRs:
Deprecated in #59766
Removed in #90292
FloatingHeaderSnapConfiguration.vsync
Supported by Flutter Fix: no
The TickerProvider vsync property of FloatingHeaderSnapConfiguration was
deprecated in v1.19.
The vsync for the animation should instead be specified using
SliverPersistentHeaderDelegate.vsync.
Migration guide
Code before migration:
class | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-7 | Migration guide
Code before migration:
class
MySliverPersistentHeaderDelegate
extends
SliverPersistentHeaderDelegate
FloatingHeaderSnapConfiguration
get
snapConfiguration
FloatingHeaderSnapConfiguration
vsync:
myTickerProvider
);
Code after migration:
class
MySliverPersistentHeaderDelegate
extends
SliverPersistentHeaderDelegate
FloatingHeaderSnapConfiguration
get
snapConfiguration
FloatingHeaderSnapConfiguration
();
TickerProvider
get
vsync
myTickerProvider
References
Design document: | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-8 | myTickerProvider
References
Design document:
Control SliverPersistentHeader’s showOnScreen Behavior
API documentation:
FloatingHeaderSnapConfiguration
SliverPersistentHeaderDelegate
TickerProvider
Relevant issues:
Issue 25507
Relevant PRs:
Deprecated in #56413
Removed in #90293
AndroidViewController & subclasses’ id
Supported by Flutter Fix: yes
The id of AndroidViewController, TextureAndroidViewController, and
SurfaceAndroidViewController, was deprecated in v1.20.
For all of these use cases, viewId should be used instead.
Migration guide
Code before migration:
final
SurfaceAndroidViewController
surfaceController | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-9 | final
SurfaceAndroidViewController
surfaceController
SurfaceAndroidViewController
viewId:
10
viewType:
'FixTester'
layoutDirection:
TextDirection
ltr
);
int
viewId
surfaceController
id
final
SurfaceAndroidViewController
surfaceController
SurfaceAndroidViewController
error:
''
);
final
TextureAndroidViewController
textureController
TextureAndroidViewController
error:
''
);
final
TextureAndroidViewController
textureController
TextureAndroidViewController | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-10 | textureController
TextureAndroidViewController
viewId:
10
viewType:
'FixTester'
layoutDirection:
TextDirection
ltr
);
viewId
textureController
id
Code after migration:
final
SurfaceAndroidViewController
surfaceController
SurfaceAndroidViewController
viewId:
10
viewType:
'FixTester'
layoutDirection:
TextDirection
ltr
);
int
viewId
surfaceController
viewId
final
SurfaceAndroidViewController
surfaceController | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-11 | final
SurfaceAndroidViewController
surfaceController
SurfaceAndroidViewController
error:
''
);
final
TextureAndroidViewController
textureController
TextureAndroidViewController
error:
''
);
final
TextureAndroidViewController
textureController
TextureAndroidViewController
viewId:
10
viewType:
'FixTester'
layoutDirection:
TextDirection
ltr
);
viewId
textureController
viewId
References
Design document:
Flutter Hybrid Composition
API documentation: | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-12 | Flutter Hybrid Composition
API documentation:
AndroidViewController
TextureAndroidViewController
SurfaceAndroidViewController
Relevant issues:
Issue 55218
Relevant PRs:
Deprecated in #60320
Removed in #90294
BlacklistingTextInputFormatter & WhitelistingTextInputFormatter
Supported by Flutter Fix: no
The entire classes of BlacklistingTextInputFormatter and
WhitelistingTextInoutFormatter were deprecated in v1.20.
Their functionality has been rewritten into a single class,
FilteringTextInputFormatter.
Migration guide
Code before migration:
formatter
BlacklistingTextInputFormatter
pattern
replacementString:
'replacedPattern' | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-13 | replacementString:
'replacedPattern'
);
formatter
BlacklistingTextInputFormatter
singleLineFormatter
pattern
formatter
blacklistedPattern
formatter
WhitelistingTextInputFormatter
pattern
);
formatter
WhitelistingTextInputFormatter
digitsOnly
pattern
formatter
whitelistedPattern
Code after migration:
formatter
FilteringTextInputFormatter
deny
pattern
replacementString:
'replacedPattern'
);
formatter
FilteringTextInputFormatter
singleLineFormatter
pattern
formatter | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-14 | singleLineFormatter
pattern
formatter
filterPattern
formatter
FilteringTextInputFormatter
allow
pattern
);
formatter
FilteringTextInputFormatter
digitsOnly
pattern
formatter
filterPattern
References
API documentation:
FilteringTextInputFormatter
Relevant PRs:
Deprecated in #59120
Removed in #90296
BottomNavigationBarItem.title
Supported by Flutter Fix: yes
Migration guide
In-depth migration guide available
Code before migration:
const
BottomNavigationBarItem
bottomNavigationBarItem | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-15 | BottomNavigationBarItem
bottomNavigationBarItem
BottomNavigationBarItem
title:
myTitle
);
const
BottomNavigationBarItem
bottomNavigationBarItem
BottomNavigationBarItem
();
bottomNavigationBarItem
title
Code after migration:
const
BottomNavigationBarItem
bottomNavigationBarItem
BottomNavigationBarItem
label:
myTitle
);
const
BottomNavigationBarItem
bottomNavigationBarItem
BottomNavigationBarItem
();
bottomNavigationBarItem
label
References
Design Document
BottomNavigationBarItem title | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-16 | References
Design Document
BottomNavigationBarItem title
API documentation:
BottomNavigationBarItem
BottomNavigationBar
Tooltip
Relevant PRs:
Deprecated in #59127
Removed in #90295
packageRoot in dart:core, dart:isolate, and package:platform
The following APIs have been removed:
Platform.packageRoot in dart:core
Isolate.packageRoot in dart:isolate
Platform.packageRoot in package:platform
These APIs were marked deprecated in Dart 2.0, and did not
work correctly in any Dart 2.x release.
Migration guide
These packageRoot APIs have been replaced by a new set of packageConfig APIs,
which you should migrate to. | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-17 | Platform.packageConfig in dart:core
Isolate.packageConfig in dart:isolate
Platform.packageConfig in package:platform
If you are using the package:platform package, note that regardless of whether
you are using the packageRoot API or not, older versions of that package are
not compatible with Dart 2.16 and later, as they depend on the now removed
packageRoot API. You may see an error like this when attempting to run your
app:
To resolve that, upgrade to version 3.1.0 or later of package:platform by
upgrading the constraint in your pubspec.yaml file:
dependencies
platform
^3.1.0
References
Relevant PRs:
Removed from the Dart libraries in #47769
Removed from package:platform in PR #38 | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
abfc3fc3478f-18 | Removed from package:platform in PR #38
Updated Flutter to use package:platform 3.1.0 in PR #94603
Timeline
In stable release: 2.10 | https://docs.flutter.dev/release/breaking-changes/2-5-deprecations/index.html |
Subsets and Splits