-
Notifications
You must be signed in to change notification settings - Fork 28.6k
Breaking changes that would improve the overall API #24722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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 Workaround (in the referenced issue above) is complicated and slightly absurd :-) |
We should just be able to fix #19143, turning something from returning This bug is specifically about changes we can never really make because they're breaking changes. |
Done, and non-breaking |
May I complain here that I dislike how
I find it rather unintuitive that |
Just passing there after listening to your awesome podcast on itsallwidgets.com
What does it mean? Moving toward an API closer to
I'm not sure I agree with that one. From my experience mentoring in Flutter, that specific API is usually the first step that led peoples understanding that Flutter does layout differently. |
The current API was broken in that you registered multiple callbacks at once, but when you removed listeners, only the primary listener was used to determine what was removed. This led to unintuitive cases where the caller could get unexpected behavior. This updates the API to add and remove listeners using a newly introduced [ImageStreamListener] object, a value object that has references to the individual callbacks that may fire. flutter#24722 flutter#32374 flutter#32935
The current API was broken in that you registered multiple callbacks at once, but when you removed listeners, only the primary listener was used to determine what was removed. This led to unintuitive cases where the caller could get unexpected behavior. This updates the API to add and remove listeners using a newly introduced [ImageStreamListener] object, a value object that has references to the individual callbacks that may fire. #24722 #32374 #32935
The current API was broken in that you registered multiple callbacks at once, but when you removed listeners, only the primary listener was used to determine what was removed. This led to unintuitive cases where the caller could get unexpected behavior. This updates the API to add and remove listeners using a newly introduced [ImageStreamListener] object, a value object that has references to the individual callbacks that may fire. flutter#24722 flutter#32374 flutter#32935
*) 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...)." |
Please feel free to edit the list above so that we just have one comment with all the proposed changes. |
@Hixie I added a bullet to the list in the top post and linked to the detailed description in the comments. |
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:
|
Adding this one as well: #61690 |
I don't like when "intellisense" gives me multiple copies of the same suggestion. It'd be nice if, for instance,
|
A small one: Tracked in: #159223 |
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. |
I think you might be using |
Developers often use As such, |
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. |
I agree this would be a nice addition, in the mean time remember that the framework also provides |
Uh oh!
There was an error while loading. Please reload this page.
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
ChangeNotifier
andListenable
and company are a bit mixed up. We could refactor the code here so that we more clearly have aListenable
and aListenableController
, and aValueListenable
and aValueListenableController
, and so on.Services
StandardMessageCodec
should be a static class or should be stateful.dev.flutter/channel-buffers
control 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
/removeListener
onImageStream
have a broken API that should be redesigned.NotchedShape
should be a shape, or should have another name.TextStyle
has 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
PointerMoveEvent
toPointerUpdateEvent
, because it's also triggered at button changes without moves.Animation
Tween
s should be immutable.vsync
in AnimationController totickerProvider
(Roll engine c41bbc63d955cc7056a162957ac4eeeca6647dc2..e77e4f0e051cb53754814ffe33df291a551bdba3 (5 commits) #37255)AnimationController
, have one for each type of controller (bounded, unbounded, simulation, repeating, etc).Animatable.animate
in favour ofAnimation.drive
.CurveTween
constructor's argument should be positional. (Make CurveTween curve a regular parameter #21433)Rendering
Adaptor
->Adapter
children
argument instead of a positional oneCustomPainter.hitTest
should take aSize
argument (CustomPainter.hitTest missing size argument #28206)Layer.pushLayer
should 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
WidgetBuilder
to make it clear it's a typedef.TransitionBuilder
to make it clear it's a typedef with a child.AnimatedBuilder
to make it clear it takes anyListenable
(evenAnimationBuilder
would be more consistent...), see also: Breaking changes that would improve the overall API #24722 (comment).Listener
to bePointerListener
AnimatedWidget
andImplicitlyAnimatedWidget
should be named consistently (see Breaking changes that would improve the overall API #24722 (comment)).AnimatedSize
).FooBuilder
typedefs into one generic typedef, or otherwise cleaning up the inconsistencies there.inheritFromWidgetOfExactType
should 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.showDialog
andshowGeneralDialog
.AnimatedList
should beAnimatedListView
.SliverMultiBoxAdaptorWidget
is not an adaptor; consider naming likeSliverMultiChildRenderObjectWidget
.RichText
toRawText
.maxLines
from int to double (TextField maxLines should be a double, not an int. #35064).ColorFiltered
->ColorFilter
FocusNode
andFocusScopeNode
should use 'focusable' instead of 'canRequestFocus' as the attribute for controlling focusability.Element.activate
should rename toElement.reactivate
, because only the reactivate will callback.OnInvokeCallback
should be called justInvokeCallback
per the style guide.reportsRouteUpdateToEngine
should bereportRouteUpdateToEngine
(imperative not descriptive).Material
InputDecoration.filled
should beisFilled
InputDecoration
should only have one prefix field and one suffix field, rather than three each (widget, icon, text). And it probably should have anerror
, alabel
, and ahint
instead of justerrorText
,labelText
, andhintText
.Divider
andVerticalDivider
'sindent
andendIndent
properties to simply bemargin
Colors.grey
->Colors.gray
The text was updated successfully, but these errors were encountered: