Repository navigation
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: API breakBackwards-incompatible API changesBackwards-incompatible API changesframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
This bug lists changes we'll probably never make, but should consider if we ever for some reason decided to start over in a new universe.
Foundation
-
ChangeNotifierandListenableand company are a bit mixed up. We could refactor the code here so that we more clearly have aListenableand aListenableController, and aValueListenableand aValueListenableController, and so on.
Services
-
StandardMessageCodecshould be a static class or should be stateful. -
dev.flutter/channel-bufferscontrol messages should use a more efficient binary format rather than an inefficient bespoke\r-delimited text-based format. -
flutter/system,flutter/navigation, etc, control messages should use a more efficient binary format rather than JSON.
Painting
-
addListener/removeListeneronImageStreamhave a broken API that should be redesigned. -
NotchedShapeshould be a shape, or should have another name. -
TextStylehas many decoration properties, it would be nice if they were all in one object, maybe separate objects for underline and overline and strike-through.
Gestures
- Rename
PointerMoveEventtoPointerUpdateEvent, because it's also triggered at button changes without moves.
Animation
-
Tweens should be immutable. - Consider renaming
vsyncin AnimationController totickerProvider(Roll engine c41bbc63d955cc7056a162957ac4eeeca6647dc2..e77e4f0e051cb53754814ffe33df291a551bdba3 (5 commits) #37255) - Instead of one
AnimationController, have one for each type of controller (bounded, unbounded, simulation, repeating, etc). - Remove
Animatable.animatein favour ofAnimation.drive. -
CurveTweenconstructor's argument should be positional. (Make CurveTween curve a regular parameter #21433)
Rendering
-
Adaptor->Adapter - SliverChildListDelegate should have a
childrenargument instead of a positional one -
CustomPainter.hitTestshould take aSizeargument (CustomPainter.hitTest missing size argument #28206) -
Layer.pushLayershould be renamed towithLayer, since it is not matched by apopLayer. The same applies to its relatives. -
BlendMode.srcATop->BlendMode.srcAtop -
BlendMode.dstATop->BlendMode.dstAtop
Widgets
- TabController should be a ValueListenable
- Rename
WidgetBuilderto make it clear it's a typedef. - Rename
TransitionBuilderto make it clear it's a typedef with a child. - Rename
AnimatedBuilderto make it clear it takes anyListenable(evenAnimationBuilderwould be more consistent...), see also: Breaking changes that would improve the overall API #24722 (comment). - Rename
Listenerto bePointerListener - (Subclasses of)
AnimatedWidgetandImplicitlyAnimatedWidgetshould be named consistently (see Breaking changes that would improve the overall API #24722 (comment)). - Name the Foo vs FooTransition vs AnimatedFoo widgets more consistently (e.g. FadeTransition vs AnimatedOpacity, also
AnimatedSize). - Consider merging all the one-argument
FooBuildertypedefs into one generic typedef, or otherwise cleaning up the inconsistencies there. -
inheritFromWidgetOfExactTypeshould be generic rather than taking aType(so it can guarantee its return type is of the same type as the argument). -
Container's width and height properties should size the child, and imply an alignment. - It's weird that we have both
showDialogandshowGeneralDialog. -
AnimatedListshould beAnimatedListView. -
SliverMultiBoxAdaptorWidgetis not an adaptor; consider naming likeSliverMultiChildRenderObjectWidget. - Rename
RichTexttoRawText. - Change the type of
maxLinesfrom int to double (TextField maxLines should be a double, not an int. #35064). -
ColorFiltered->ColorFilter - Be consistent about callback parameter names for tapping/pressing something (onTap vs onPressed, Be consistent about callback parameter names for tapping/pressing something #17407)
-
FocusNodeandFocusScopeNodeshould use 'focusable' instead of 'canRequestFocus' as the attribute for controlling focusability. - MediaQueryData.disableAnimations should be called MediaQueryData.enableAnimations with the opposite semantics (see style guide under "double negatives").
- MediaQuery.viewPadding should be used instead of MediaQuery.padding throughout the framework. viewPadding was added ATF to address edge cases, but the API surface has become confusing as a result, see SafeArea.maintainBottomViewPadding should be true by default #59204
-
Element.activateshould rename toElement.reactivate, because only the reactivate will callback. -
OnInvokeCallbackshould be called justInvokeCallbackper the style guide. - Navigator:
reportsRouteUpdateToEngineshould bereportRouteUpdateToEngine(imperative not descriptive). - Better property's naming for Form widget (autoValidateMode, instead of autovalidateMode) #115820
Material
- ColorScheme.on* shouldn't look like event handlers
- Handle the tap target padding for e.g. mini fabs more intuitively (dunno what that would entail exactly)
-
InputDecoration.filledshould beisFilled -
InputDecorationshould only have one prefix field and one suffix field, rather than three each (widget, icon, text). And it probably should have anerror, alabel, and ahintinstead of justerrorText,labelText, andhintText. - Change
DividerandVerticalDivider'sindentandendIndentproperties to simply bemargin -
Colors.grey->Colors.gray
Reacted by PiN73, Jonas Wanke, mirkancal, Tim Whiting, Pedro Massango, Pedro Massango, Jonas Sander, Marcel Garus, Michel Feinstein, Tom Gilder and 24 more
Reacted by _juliotati
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: API breakBackwards-incompatible API changesBackwards-incompatible API changesframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Activity
SteveAlexander commentedon Nov 27, 2018
May I propose this for the Framework too? #19143
I currently have some pretty ugly code to allow me to sequence an animation of changing tab and then scrolling to a certain position. This is because while
ScrollController.animateToreturns a Future so I can sequence something to happen after scrolling is done,TabController.animateTois void.Workaround (in the referenced issue above) is complicated and slightly absurd :-)
Hixie commentedon Nov 27, 2018
We should just be able to fix #19143, turning something from returning
voidto returning aFuturewhen it's something that we don't expect people to implement shouldn't be a breaking change.This bug is specifically about changes we can never really make because they're breaking changes.
jonahwilliams commentedon Jan 11, 2019
Adding a type parameter to invokeMethod would be nice too: #17333Done, and non-breaking
jamesderlin commentedon Mar 29, 2019
May I complain here that I dislike how
Stackexpects its children ordered back-to-front in z-order? For example:I find it rather unintuitive that
child1appears on top in the code but is actually at the bottom of the stack.rrousselGit commentedon May 20, 2019
Just passing there after listening to your awesome podcast on itsallwidgets.com
What does it mean? Moving toward an API closer to
StreamvsStreamControllerforListenable?I'm not sure I agree with that one.
While the current behavior is definitely surprising for newcomers, that's a good thing IMO.
From my experience mentoring in Flutter, that specific API is usually the first step that led peoples understanding that Flutter does layout differently.
This helped my mentees a lot in understanding that, in Flutter, UI elements means nothing without the rest of the tree – and that everything is declarative to the core.
Add some sanity to the ImageStream listener API (#32936)
goderbauer commentedon Aug 1, 2019
AnimatedWidget,ImplicitlyAnimatedWidgetand their subclasses should be named consistently. For the most part, subclasses of AnimatedWidget are namedFooTransitionand subclasses of ofImplicitlyAnimatedWidgetare namedAnimatedFoo. There are annoying/unnecessary exceptions, though, which should be renamed for consistency:AnimatedModalBarrier(subclass ofAnimatedWidget) should be renamed toModalBarrierTransitionAnimatedBuilder(subclass ofAnimatedWidget) should be renamed to something likeTransitionBuilder*)AnimatedWidgetitself should probably more accurately be namedTransitionWidgetImplicitlyAnimatedWidgetshould just beAnimatedWidgetFoovsFooTransitionvsAnimatedFoowidgets more consistently (e.g.OpacityvsFadeTransitionvsAnimatedOpacity).*) This would also fix another item on the list above: "Rename AnimatedBuilder to make it clear it takes any Listenable (even AnimationBuilder would be more consistent...)."
Hixie commentedon Aug 1, 2019
Please feel free to edit the list above so that we just have one comment with all the proposed changes.
goderbauer commentedon Aug 2, 2019
@Hixie I added a bullet to the list in the top post and linked to the detailed description in the comments.
efortuna commentedon Sep 22, 2019
@goderbauer is the animations group planning on renaming some of these like you mentioned (such as
AnimatedModalBarrier)?One other to add to the list of naming mismatches is
AnimatedSize.goderbauer commentedon Sep 23, 2019
I added AnimatedSize to the list above.
I did not have plans to rename these. It feels like the change would be rather disruptive to current users of these without any benefit for them?
tvolkert commentedon Dec 4, 2019
When we look to do a Flutter 2.0 release, we should consider doing the things listed in this issue as part of the 1.x->2.x break.
21 remaining items
bartekpacia commentedon May 1, 2024
It seems to me that some naming-related items on this list could be done by renaming the offending identifiers, and introducing a temporary (for ~1 year/4 major releases) type-alias with the old name.
For example:
Piinks commentedon Jul 18, 2024
Adding this one as well: #61690
nate-thegrate commentedon Aug 14, 2024
Some things I felt like adding here:
Builderclasses into constructors and make thebuilderargument positionalBuilderandStatefulBuildercan be useful, but there's no benefit to extending those classes; instead they could beWidget.builderandWidget.statefulBuilder.Freeing up the namespace would be beneficial, e.g. a developer (or this framework) could use
Builderas a class or typedef without a name overlap.Animatable<T>andParametricCurve<T>Animatablehas atransformmethod which creates a value based on adouble tparameter (a fraction in the range 0.0 to 1.0);ParametricCurve.transform()does pretty much exactly the same thing.But a few differences in the implementation make it so we can't just have one of those classes as a subtype of the other without breakages.
PreferredSizeWidgetAny logic that needs the dimensions of one or more children should handle it during
RenderObject.performLayout.AutomaticKeepAliveClientMixinInstructing developers to call
super.build(context)and ignore the return value is unintuitive API design IMO. I'd prefer one of the following:voidinstead of overridingbuildmixin on StatefulWidget: you'd override thewantKeepAlivegetter on the widget class, and the mixin would changecreateElementso that no changes to the state'sbuildmethod are needed.Separate packages for framework layersit came true! 🙂justinmc commentedon Nov 20, 2024
A small one:
SelectionChangedCause.scribbleshould be renamed toSelectionChangedCause.stylusHandwritingto indicate that it is not iOS-specific.Tracked in: #159223
colbymaloy commentedon Nov 27, 2024
could you please add some gesture information to the hitTest method for custompainter??? for example when using interactiveViewer and painting a list of items, say like a map with points of interest, i need to detect taps on those items.
hitTest gets triggered when panning on the map, causing accidental clicks. if hitTest has some info about which gesture happened i could make it work. Current workaround is to wrap CustomPaint in a GestureDetector and use onTapDown.
feinstein commentedon Nov 27, 2024
I think you might be using
hitTestwrongly. It's purpose is not to tell you that your widget was tapped, so you can call a callback, or trigger some logic. It's purpose is for you to inform the framework that there's something in those coordinates, so the gesture detection algorithm can decide which widget is being tapped (as you might be tapping on a transparent area in your widget, so the widget that's behind can get that gesture instead), and will get the gesture callback activated.caseycrogers commentedon Mar 19, 2025
Developers often use
ValueChanged<T>in contexts where the function isn't being called on changes and has nothing to do with changing values-they just wanted a type def forvoid Function(T)andValueChangedwas handy.As such,
ValueChanged<T>should've just been calledValueCallback<T>to make it more obviously usable outside of strictly on change callbacks.mateusfccp commentedon Mar 19, 2025
This can be no breaking. If found valuable, we can introduce one without removing the other. They would be virtually equal, but have different semantics.
feinstein commentedon Mar 19, 2025
I agree this would be a nice addition, in the mean time remember that the framework also provides
ValueSetter<T>.ValentinVignal commentedon Jul 1, 2026
Another one: #187909
WidgetControllerfrompackages/flutter_test/lib/src/controller.dartshould not be using a static variable_nextPointeras a counter. It is making the tests dependent on each other in some specific scenarios.