Skip to content

Breaking changes that would improve the overall API #24722

@Hixie

Description

@Hixie

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 and Listenable and company are a bit mixed up. We could refactor the code here so that we more clearly have a Listenable and a ListenableController, and a ValueListenable and a ValueListenableController, 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 on ImageStream 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

  • Rename PointerMoveEvent to PointerUpdateEvent, because it's also triggered at button changes without moves.

Animation

Rendering

  • Adaptor -> Adapter
  • SliverChildListDelegate should have a children argument instead of a positional one
  • CustomPainter.hitTest should take a Size argument (CustomPainter.hitTest missing size argument #28206)
  • Layer.pushLayer should be renamed to withLayer, since it is not matched by a popLayer. The same applies to its relatives.
  • BlendMode.srcATop -> BlendMode.srcAtop
  • BlendMode.dstATop -> BlendMode.dstAtop

Widgets

  • TabController should be a ValueListenable
  • Rename WidgetBuilder to make it clear it's a typedef.
  • Rename TransitionBuilder to make it clear it's a typedef with a child.
  • Rename AnimatedBuilder to make it clear it takes any Listenable (even AnimationBuilder would be more consistent...), see also: Breaking changes that would improve the overall API #24722 (comment).
  • Rename Listener to be PointerListener
  • (Subclasses of) AnimatedWidget and ImplicitlyAnimatedWidget should 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 FooBuilder typedefs into one generic typedef, or otherwise cleaning up the inconsistencies there.
  • inheritFromWidgetOfExactType should be generic rather than taking a Type (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 showDialog and showGeneralDialog.
  • AnimatedList should be AnimatedListView.
  • SliverMultiBoxAdaptorWidget is not an adaptor; consider naming like SliverMultiChildRenderObjectWidget.
  • Rename RichText to RawText.
  • Change the type of maxLines from 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)
  • FocusNode and FocusScopeNode should 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.activate should rename to Element.reactivate, because only the reactivate will callback.
  • OnInvokeCallback should be called just InvokeCallback per the style guide.
  • Navigator: reportsRouteUpdateToEngine should be reportRouteUpdateToEngine (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.filled should be isFilled
  • InputDecoration should only have one prefix field and one suffix field, rather than three each (widget, icon, text). And it probably should have an error, a label, and a hint instead of just errorText, labelText, and hintText.
  • Change Divider and VerticalDivider's indent and endIndent properties to simply be margin
  • Colors.grey -> Colors.gray

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: API breakBackwards-incompatible API changesframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions