- NEXT AUTHOR: Put your breaking change notification here and insert headings as appropriate to identify which version is affected.
flutter testcan now be run with the
--test-randomize-ordering-seedflag to shuffle the order tests are run in. If it is set to the string
random, it will pick a random seed to use (and print it out so the order can be repeated). If a positive integer is specified, it will use that as the seed for shuffling tests.
- #45986 Engine roll that included a fix for live regions on Android. Live regions will now announce on every change, instead of only announcing if a change was made when the flag was added once.
- #44283 Deprecating SliverOverlapAbsorber & SliverOverlapInjector child property in favor of ‘sliver’.
- #43457 Adds TargetPlatform.macOS, which might break some switch statements.
- #44189 Make some BuildContext methods generics.
- #43848 Don’t allow Disabled InkWells to be focusable.
- #42449 Increase TextField’s minimum height from 40 to 48.
- #42479 Update
disabledHintbehavior to have consistent alignment and constraints.
- #39857 Update
ToggleButtondefault constraints to default to Material design specifications instead of
- #41415 Added
cacheHeightparameters to provide a custom decode size for images. This can be used to reduce memory usage of the ImageCache.
- #41814 Enables setting of semantics focused and focusable attributes within Focus widgets. Added
- #41327 Incorporates link specific semantics.
- #37896 Added a protected method
- flutter/engine #12708 Turned on NS_ASSUME_NONNULL_BEGIN for FlutterViewController. This is a breaking change when the view controller is initialized from Swift.
- #40166 Fixes to focus handling. If you push a route after this change, and had a ‘first focus’ set on a widget via FocusScopeNode.setFirstFocus, it won’t currently receive focus immediately, but after this change it will. Similarly, if you pop a route after this change, the focus will go back to where it was before the route was pushed
ObstructingPreferredSizeWidget.fullObstructionis replaced by
- #40636 Updates the appearance of
CupertinoSlide. Changes the API of
CupertinoThumbPainterto allow for further customization.
- flutter/engine #12128 Flutter on iOS will no longer send AppLifecycleState events on the lifecycle channel when the FlutterViewController is not visible to bring it inline with behavior on Android.
- dart-lang/sdk #37985 Inference is changed when using Null values in a FutureOr context. Namely, constraints of the forms similar to Null <: FutureOr now yield Null as the solution for T.
- #40189 changes the default border color and text color of
- #38481 improves
- #37652 Change RenderObject.getTransformTo to include ancestor. Affects RenderBox.localToGlobal when an ancestor is specified.
RawChip.selectedis now non-nullable. This was an inconsistency in the chips API that was cleaned up.
- #10481 The Android Embedding interface changes.
FlutterActivity.createBuilder()has been replaced with
FlutterFragment.Builder()has been replaced with
- #36964 The constant
kMinInteractiveSizewas removed from widgets/text_selection.dart and replaced with
kMinInteractiveDimensionin widgets/constants.dart. See the announcement for more information.
- #37489 The
binary_messenger.dartwas deprecated and replaced with
ServicesBinding.instance.defaultBinaryMessenger. See the announcement for more information.
- #9041 TextStyle.height and StrutStyle.height is properly implemented as a multiple of font size instead of a multiple of the font-provided height. When height is null or omitted, the font-provided height will be used. When height is provided, the height of the line will be
fontSize * height. See the announcement for more information.
- #36900 Improves type safety by fixing the return value of certain API that return
Uint8Listbut are declared to return
List<int>. Read the breaking change announcement for error fixes.
- #34684 The return type of the almost never used
ParentDataWidget.debugDescribeInvalidAncestorChainmethod is now
String. Existing uses can call
.join('\n')on the return value if they need to continue to use a
Stringinstead of a
- #30069 Text inline widgets allows embedding arbitrary widgets inline with text.
TextSpanhas also been reworked to inherit from
InlineSpan, in order to support
WidgetSpan, which is used to define inline widgets. Existing uses of
TextSpanshould not assume the object is of type
- #33480 The
FadeInImagewidget no longer supports the
- #32374 The
Imagewidget now supports two new properties:
loadingBuilder, which enable callers to easily add a placeholder image which the image ios loading, add effects to the image once it loads (such as fading it in), and monitor the loading progress of the image (e.g. to show the user a loading indicator).
- #33148 ExpandIcon now uses Colors.white60 instead of Colors.white54 when dark theme is used (ThemeData.brightness is set to Brightness.dark).
- #32936 cleaned up the
removeListener()now take an instance of
ImageStreamListener, which contains references to the individual callbacks. See the announcement for more information.
- #32528 Tapping a modal bottom sheet no longer dismisses it by default.
- #30983 To support structured error messages #27327 the signature of InformationCollector and the context parameter of the FlutterErrorDetails constructor were changed. This should not impact you unless your package is attempting behave like part of the Flutter framework. See this comment which discusses how to write code that is forwards and backwards compatible with this change.
- framework #31569/engine #8695 Rect and RRect are now const constructable and are backed by 64 bit doubles rather than 32 bit floats internally.
- framework #31917 <- engine #8796 <- dart 1dd0f88c84 Fixes bug in StreamIterator which allowed constructor argument to be null. Also allowed await for on a null stream. This is now a runtime error.
TabController.animationControllerchanged to be
DefaultTabControllerto handle changes to number of tabs (after initial build).
- To address the bugs in #16604 the flutter tool will now always run Gradle or Xcode when asked to run/build an application. Previously we attempted to avoid rebuilds when we believed that the underlying application should not have changed.
- #30811 We’ve improved the performance of tests with coverage enabled to be more inline with existing test performance. For more information see #23157.
- Various performance improvements to hot reload. Assets added to pubspec.yaml will be correctly synced without a hot restart. New dependencies can be added to the pubspec and synced as well, but flutter packages get must be run separately or by an IDE.
- #29188 SliverChildListDelegate constructor is changed to non-const.
- #29946 Adds support to CupertinoPageScaffold for tapping the status bar to scroll to the top of the scaffold’s content.
- #28751 Add
TextStyleto control the stroke thickness of text decoration.
- #28242 Adds support on Android and iOS for long-press-drag gestures in text fields to select words on Android and to move the cursor on iOS.
toStringoverride on a
PointerEventsubclass will need to be changed.
- #27866 Fixes a bug when an iOS back swipe gesture is manually dragged back to its starting point and breaking future back swipes.
- #27697 CupertinoTextField’s cursorColor default now matches the app’s theme. If this is undesirable, developers can use the
ThemeDatato provide a Cupertino-specific override.
- #24876 Improves the general fidelity of text cursors on iOS such as rounder corners, a fading cursor blink etc.
- #7567 Embedder API: The
FlutterResulttype has been renamed to
- #26332 Strut: fine tuned control over text minimum line heights, allows forcing the line height to be a specified height.
- #7414 dart:ui: Rename dart:ui ParagraphStyle.lineHeight to ParagraphStyle.height. This property previously did not do anything and was renamed to stay consistent with TextStyle.height.
- #7518 The default location of the
flutter_assetsfolder has been moved for iOS.
Picture.toImagenow returns a
- #7497 Embedder API:
FlutterProjectArgshave been renamed to indicate that they should no longer be provided.
- #26238 removed the long-deprecated
- #23424 By default, a drag gesture detector’s onStart callback will be called with the location of where a drag gesture is detected (ie. after dragging a certain number of pixels) instead of at the touch down location. To use the old functionality with a given drag gesture recognizer, the dragStartBehavior variable of the recognizer should be set DragStartBehavior.down.
- #25593 Let CupertinoTabScaffold also automatically handle keyboard insets with or without CupertinoPageScaffold.
- #24457 Implements double-tap to select word in TextField and CupertinoTextField.
- #25585 Add fontFamilyFallback to TextStyle to specify custom font fallback order.
- #24554 Adds Force Press gesture detector and recognizer for iOS devices with screen pressure sensors.
- #23759 Adds CupertinoTheme, support for Cupertino adaptation of Material Theme and limited support for Cupertino dark theme.
- #25384 Adds support for the text editing floating cursor. On iOS devices, the cursor can be moved by force pressing or long pressing the spacebar on the keyboard.
- ##25183 Add
navigatorKeyAPI to CupertinoTabView.
- Skia and engine rolls to address the following:
- Engine rolls to fix
- Various fixes to tooling for documentation, documentation, and documentation accompanying the templates.
- flutter/engine#6883 – FlutterViewController will no longer load your app’s splash screen by default. The implementation of that has been moved to a new method
- #23755 Removed direct dependency of flutter_test on
package:test. Flutter now requires test version 1.5.1 and mockito version 4.0.0.Breaking change:This requires adding an explicit dependency to your pubspec.yaml:dev_dependencies: test: ^1.5.1
- #24024 and flutter/engine#6760 Upgraded harfbuzz to 2.1.0, Significantly improved text layout, and zero-width-joiner (zwj) support for better emojis on iOS.
- #23417 provide
nullwhen locale is unavailable or invalid instead of
- #23583 Improved localization algorithm with scriptCodes and full preferred locales list support, breaking changes to callbacks when locales are changed (pass list instead of single locale).
- #23320 Adds back swipe gesture support for Cupertino navigation bars’ cross-page transitions.
- #23320 Adds support for Hero transitions across multiple Navigators.
- #23194 Adds CupertinoTextField, an iOS styled text entry field.
- #23221 Adds RTL support for Cupertino navigation bars’ cross-page transitions.
- #22977 replaces most of
void. See the mail proposing this change.
- #22985 Implement correct orthographic projection
- #23104 Update wrapping message
- #22924 Support for disabling interactive TextField caret and selection
- #22870 Use new
mixinsyntax for super-mixins
- #22022 allow command line option “–project-name” in flutter create
- #23126 Dispatch a Flutter.Navigation event each time navigation occurs.
- #23183 Fix bug where gradle build rule would rerun on switching from
- #22394 Fix out of range spring simulation in ClampingScrollSimulation
- #23174 enable lint prefer_void_to_null
- #23184 TextTheme.apply() should not assume non-null TextStyle fields
- #23168 Added Mongolian (mn) translations
- #23167 Fix disabled formfield validation
- #23015 Finalize editing when hitting the enter key on a single line TextField
- #23021 Make it easier to use CocoaPods to Add2App for iOS
- #22825 fix Curves.bounceInOut math
- #22977 Prefer void to null
- #22822 Adds callback for Long Press Up
- #18770 Add
- #21657 Make AndroidView take gesture recognizer factories.
- #22449 Add support for text shadows
- flutter/engine#6644 Add BoxHeightStyle and BoxWidthStyle as arguments to Paragraph.getBoxesForRange() to obtain various styles of enclosing boxes.
- Skia update that changes the low level implementation of blurs and anti aliasing, which may break golden tests.
- flutter/engine#6393 adds nullability annotations to Android MethodChannel/MethodCall.
- #21251 adds CupertinoDatePicker, an iOS-style picker control that supports a date mode and a date + time mode.
- #21715, The default MaterialPageRoute transition is now defined by the Theme. Added (optional) support for Android P style page transitions. The MaterialPageRoute support for “hosting” another route to reuse its buildTransitions() method was removed because PageTransitionsBuilders, including CupertinoPageTransitionBuilder, are standalone objects.
- #22108 changed the output of
flutter doctorslightly, which may affect automated scripts that depended on the exact output.
- #21540 added a
Animatable. It is implemented by
Tween(the main subclass of
Animatable) but classes that subclass
Animatabledirectly will need to implement it. Typically the existing
evaluate()method can be changed to implement
transform()instead, using the value given by the argument to
transform()rather than the current value of the animation provided to
evaluate()now has a default implementation that defers to
- #20322 performs parallax transitions between
CupertinoSliverNavigationBars when navigating between pages.
- #20966 adds
- #20929 fixes bug where
CupertinoPageScaffoldwasn’t insetting its content when the keyboard is shown.
CupertinoSliverNavigationBarnow auto-populate their title and back button labels based on their
- Dart SDK updated to a Dart 2 build (2.1.0-dev.0.0). Package and plugin authors should ensure their
pubspec.yamlfiles include a Dart SDK constraint with an upper bound of
<3.0.0. See the Getting ready for Dart 2 post for details.
- #19025 renamed
- #19317 Add cursorWidth and cursorRadius to TextField (Material) cursor.
- #20116 reduced release binary sizes by ~2MB
- #20267 adds `CupertinoSegmentedControl’.
- #19232 adds
CupertinoActionSheetfor iOS-style bottom pop-up sheets.
- #20101 improves
CupertinoScrollbarvisual fidelity during overscrolls.
- #19789 adds support for infinite scrolling and looped scrolling for
- #18381 improves visual fidelity of
- #19284 adds multi-column
CupertinoPickersupport for off-axis cylindrical projection.
- #18469 added a
CupertinoAppfor creating iOS styled apps.
- #18614 added
isInstanceOfas a function exported from Flutter, because package:matcher has deprecated its implementation of
- flutter/engine#5517 enabled the
- #18488 made the
flutter tracerequired, because the previous behaviour was unreliable and caused flaky tests.
- #18096 changed the rendering of the character counter in text fields to more closely match the Material design specifications.
- #17661 changed the layout and size of
ListTileto better conform to the latest Material design specs.
- #17620 slightly reduces the default dimensions of
Switchto better conform to the latest Material design specs.
- #17637 updates
Switchto use the
toggleableActiveColor. If you are using a light theme and are not specifying an
ThemeData, these controls will now use a higher contrast shade from the primary swatch.
- #17586 added a new
TextStyle. Subclasses must ensure that this property is handled in constructors and
- #17021 added implicit a11y scrolling for iOS. For this, viewports define a cache extend before the leading as well as after the trailing edge and slivers are expected to provide semantics information if they fall into the cache extent.Breaking changeWith this change, children of a viewport that are currently not visible in the viewport are now considered off-stage. To find them in a test, specify
skipOffstage: falseon the Finder.
- #17094 introduced the ability to do golden image testing in widget tests. Within a widget test, you can now use the following matcher to ensure that your widget’s rasterized image matches a golden file (e.g.
foo.png):await expectLater(find.byType(MyWidget), matchesGoldenFile(‘foo.png’));Breaking changeOne of the consequences of this change is that all tests run through
flutter testnow explicitly depend on
package:flutter_test. Users of
flutter testwill need to update their
pubspec.yamlfile to include the following if it does not already exist:
dev_dependencies: flutter_test: sdk: flutterIf your
pubspec.yamldoes not contain the requisite dependency, and you run
flutter test, you will see errors of the following form:
compiler message: Error: Could not resolve the package 'flutter_test' in 'package:flutter_test/flutter_test.dart'.
- flutter/engine#5060 introduced the ability to encode a
dart:ui Imageinto a PNG via
Image.toByteData(). Callers wishing to get encoded bytes may pass the
formatargument, like so:image.toByteData(format: ui.ImageByteFormat.png);
We are aware of a potential problem with certificate validation in the
HttpClient implementation. To follow our investigation, see Dart issue 32936.
- flutter/engine#4932 introduced a new shell embedding API with numerous new features. In particular, a single process can now host multiple Flutter shells.
- flutter/engine#4762 and flutter/engine#5008 introduced
Image.toByteData(), which is used to get the raw RGBA bytes of an
- #16721 scroll motion starts on iOS has been fine tuned to avoid a jump when the scroll first starts moving and to more closely mirror native behavior.
- #16039 and #16447 substantially revised the
Chipimplementation, added new chip types:
ActionChip, and updated the appearance of chips.
- #16187 updated the
Cardwidget’s shape and elevation.
dart:async: Removed the deprecated
tryParsestatic method to
DateTime, and deprecated
newkeyword can now always be omitted. The
constkeyword is required to create a constant expression, although within the expression, further
constkeywords can also be omitted.
- #16040 adds an API to let
CupertinoTabScaffold‘s current tab be programmatically changed via its
- #15416 removed
package:httpfrom Flutter and replaced all usages with the
dart:io. If you use
package:httpyou must add it as a dependency in your
pubspec.yamlto continue using it.
createHttpClient()was also removed after being marked deprecated. To change how the framework creates http clients, you can use HttpOverrides from
dart:ioto provide your own
createHttpClient()callback globally or per zone.More details are available in the announcement.
- #15871 changed the default configuration of the
flutter create. “screenLayout” and “density” are now included by default in the configChanges attribute, preventing flutter apps from restarting when these change.
- #15324 adds a new CupertinoRefreshControl widget styled after the iOS pull-to-refresh pattern. Demo available in the Flutter Gallery.
- #15565 turned Dart 2 mode on by default. To run in Dart 1 mode, you can still use
--no-preview-dart-2.More details are available in the announcement.
- #15537 removed SemanticsSortOrder. From now on traversal sorting is done among sibling nodes only.More details available in the announcement.
- #15484 changed the meaning of the
initialValueconstructor parameter.The TextFormField initialValue parameter no longer unconditionally initializes the text property of its TextEditingController. If you create a TextFormField and provide a controller, the initialValue must be null, which is now the default. If you’re providing a controller you can specify it’s initial text value with the TextEditingController text property.Before
new TextFormField( initialValue: 'Hello World', controller: _myTextEditingController, );After
new TextFormField( controller: _myTextEditingController ..text = 'Hello World', ) // Or more typically: _myTextEditingController = new TextEditingController( text: 'Hello World', ); new TextFormField( controller: _myTextEditingController, );
- #15303 updated the
showDialogfunction to take a builder and deprecated the
showDialog(context: context, child: new Text('hello'))After
showDialog(context: context, builder: (BuildContext context) => new Text('hello'))
- #15265 updated
ThemeDatato use the primary color of a
MaterialColorinstead of unconditionally using the 500 shade for light themes. The color values remain unchanged.Before
expect(widget.color, Colors.blue.shade500) // primary colorAfter
expect(widget.color, Colors.blue) // primary color
- #15548 adds debugging flags
debugDisableOpacityLayersto help with performance diagnosis of rasterizing speed.
- flutter/engine#4742 updated assets to be read directly out of the APK on Android. As a result, leading slashes are no longer supported in image asset paths:Before
- #14901 A Slider visual update changed the colors, opacities, and the value indicator shape and behavior. It also removed the “
thumbOpenAtMin” flag from the Slider class, which is no longer needed, and can be emulated by the custom thumb shape support.
- #14702 removed the
engineDartVersiongetter from the flutter tool’s
- flutter/engine#4607 and #14601 removed default constructors from the following
- #14410 contained a breaking API change to
- The constructors
ButtonTheme.bar()are no longer
- The constructors
- #14410 changed the hierarchy of
RaisedButton– they both inherit from
RawMaterialButtonnow rather than from
- #14410 changed
RaisedButtonto no longer cast a shadow when disabled.
- #14343 revised how copy, cut, and paste works for EditableText: The abstract class TextSelectionControls has new methods canCopy, canCut, etc. to determine if those actions are available. The TextSelectionDelegate interface now requires an additional method bringIntoView(TextPosition position) to scroll a TextPosition into the visible part of a TextField. Furthermore, that interface is no longer implemented by TextSelectionOverlay. In its place EditableTextState should be used, which implements that interface. See also: flutter-dev/IHPndyUDy0M
- #14449 replaces the
SliverGridLayout.estimateMaxScrollOffsetmethod by the
SliverGridLayout.computeMaxScrollOffsetmethod. This new method must report an accurate value, not just an estimate. This was necessary to fix a bug where a finite
SliverGridcould not handle being scrolled off the top of the screen (because we had no way to determine how much content it had).For similar reasons, the
RenderSliverBoxChildManagerinterface has a new getter,
childCount, which must return a non-null value if
createChildcan return null. In practice, it is unusual to implement this interface, so this should have no effect. It is more common to implement the widgets-layer equivalent,
SliverChildDelegate. This interface already had an
estimatedChildCountgetter. The getter continues to exist, though its semantics have been adjusted a little to require that the returned value be accurate if the
buildmethod on the delegate ever returns null.
- #13734, #14055, and #14177 substantially revised the InputDecorator et al. widgets. The layout of the input decorator’s parts has changed a little, which means that the internal layout of text fields has changed as well. Tests that depend on the internal geometry of text fields will need to be updated.In addition,
hideDivider: truemust be replaced by the new
border: InputBorder.none. This is part of our making it easier to customize how inputs are rendered; you can now also provide a custom InputBorder subclass if you have particularly novel desires for your input decoration.
- #4528 and #14011 deprecated support for big integers in the standard platform channel message/method codecs, to be made unavailable following a four week grace period. This change is a consequence of the transition to Dart 2.0 where the
inttype is no longer unlimited size.
- #4487 replaces all uses of the
RequestPermissionResultcallback concept in
RequestPermissionsResult, adding a missing
sto align with the corresponding Android SDK concept.