# waft-widgets/src
Flutter home: packages/flutter/lib/src/widgets
Ported against: ed2132410ee94b5a590cb7f67cee7a6ea9101a60
## Identical
- widgets/constants.rs → constants.dart
- widgets/image_filter.rs → image_filter.dart
- widgets/expansible.rs → expansible.dart
- widgets/sliver_persistent_header.rs → sliver_persistent_header.dart
- widgets/shared_app_data.rs → shared_app_data.dart
- widgets/annotated_region.rs → annotated_region.dart
- widgets/scroll_activity.rs → scroll_activity.dart
- widgets/scroll_notification_observer.rs → scroll_notification_observer.dart
- widgets/autofill.rs → autofill.dart
- widgets/spell_check.rs → spell_check.dart
- view.rs → view.dart
- widgets/notification_listener.rs → notification_listener.dart
- widgets/orientation_builder.rs → orientation_builder.dart
- widgets/safe_area.rs → safe_area.dart
- widgets/value_listenable_builder.rs → value_listenable_builder.dart
- widgets/sliver.rs → sliver.dart
- widgets/navigation_toolbar.rs → navigation_toolbar.dart
- widgets/standard_component_type.rs → standard_component_type.dart
- widgets/title.rs → title.dart
- widgets/scroll_metrics.rs → scroll_metrics.dart
- widgets/primary_scroll_controller.rs → primary_scroll_controller.dart
- widgets/scroll_controller.rs → scroll_controller.dart
- widgets/single_child_scroll_view.rs → single_child_scroll_view.dart
- widgets/pages.rs → pages.dart
- widgets/placeholder.rs → placeholder.dart
- widgets/pop_scope.rs → pop_scope.dart
- widgets/dialog.rs → dialog.dart
- widgets/modal_barrier.rs → modal_barrier.dart
- widgets/navigator_pop_handler.rs → navigator_pop_handler.dart
- widgets/text.rs → text.dart (+ `RichText` from basic.dart)
- widgets/status_transitions.rs → status_transitions.dart
- widgets/text_editing_intents.rs → text_editing_intents.dart
- widgets/text.rs → text.dart (+ `RichText` from basic.dart)
- widgets/context_menu_button_item.rs → context_menu_button_item.dart
- widgets/text_selection_toolbar_anchors.rs → text_selection_toolbar_anchors.dart
- widgets/desktop_text_selection_toolbar_layout_delegate.rs → desktop_text_selection_toolbar_layout_delegate.dart
- widgets/text_selection_toolbar_layout_delegate.rs → text_selection_toolbar_layout_delegate.dart
- widgets/overscroll_indicator.rs → overscroll_indicator.dart
- widgets/magnifier.rs → magnifier.dart
- widgets/debug.rs → debug.dart (the checks ported so far)
- widgets/animated_size.rs → animated_size.dart
- widgets/lookup_boundary.rs → lookup_boundary.dart
- widgets/default_selection_style.rs → default_selection_style.dart
- widgets/selection_container.rs → selection_container.dart
- widgets/overflow_bar.rs → overflow_bar.dart
- widgets/bottom_navigation_bar_item.rs → bottom_navigation_bar_item.dart
- widgets/date.rs → date.dart
- widgets/animated_switcher.rs → animated_switcher.dart
- widgets/animated_cross_fade.rs → animated_cross_fade.dart
- widgets/sliver_fill.rs → sliver_fill.dart
- widgets/raw_radio.rs → raw_radio.dart
- widgets/drag_boundary.rs → drag_boundary.dart
- widgets/sliver_prototype_extent_list.rs → sliver_prototype_extent_list.dart
## show_* functions → their .dart files
- Change: `show_raw_dialog` and `show_general_dialog` are builders — `ShowRawDialog::new(builder)` and `ShowGeneralDialog::new(page_builder)`, with a setter per optional Dart argument — whose `show(app, context)` runs the body the free function ran.
Reason: language — Rust has no named optional arguments, so the required arguments stay in `new` and every optional one is a fluent setter.
Affect: a call site writes `ShowRawDialog::new(builder).use_root_navigator(false).show(app, context)` where Dart writes named arguments, and the free functions no longer exist.
## widgets/preferred_size.rs → preferred_size.dart (+ the `Size` subclass mechanism)
- Change: Flutter's `Size` subclass `_PreferredAppBarSize` is a `SizeExtension` payload that `AnySize` carries beside the plain `Size`, as `AnyColor` carries a `Color`'s; `PreferredSizeWidget::preferred_size` and `PreferredSize`'s field hold `AnySize`, which derefs to `Size`, and `extension::<T>()` is Dart's `is T`.
Reason: language — dart:ui `Size` is a `Copy` value here and cannot be subclassed.
Affect: a preferred size keeps its subclass only while it stays an `AnySize`; one copied into a plain `Size` is a plain size.
- Change: a widget is a `PreferredSizeWidget` to a parent holding it erased (`TabBar`'s tabs) by answering `StatelessWidget::as_preferred_size_widget` or `StatefulWidget::as_preferred_size_widget` with itself, which the erased form forwards from `Widget::as_preferred_size_widget`.
Reason: language — a `WidgetRef` cannot be asked `is PreferredSizeWidget` of a trait its widget implements.
Affect: a widget that implements `PreferredSizeWidget` but leaves `as_preferred_size_widget` at its default is not seen as one; `PreferredSize`, `AppBar`, `CupertinoNavigationBar`, `Tab` and `TabBar` answer.
## widgets/inherited_theme.rs → inherited_theme.dart
- Change: an inherited widget is an `InheritedTheme` by answering `InheritedWidget::as_inherited_theme` with itself, and `capture` collects the ancestors whose widget answers.
Reason: language — Rust cannot ask an erased widget whether its type implements a trait, which is Dart's `widget is InheritedTheme`.
Affect: a theme that implements `InheritedTheme` but leaves `as_inherited_theme` at its default is not captured, and its subtree's captured copies do not see it; `InheritedTheme` cannot have `InheritedWidget` as a supertrait (`update_should_notify(&Self)` is not dyn-compatible), so `capture` checks that the ancestor is an inherited element, as Dart's `InheritedElement(widget: InheritedTheme)` pattern does.
## widgets/slotted_render_object_widget.rs → slotted_render_object_widget.dart
- Change: `debug_name_for_slot` names a slot whose `Debug` is a bare name (`BottomRight`, as an enum case derives it) by that name with its first letter lowered, and any other slot by its `Debug`, where Dart names an enum value by its `.name` and anything else by `toString()`.
Reason: language — Rust cannot ask whether a value is an enum; a derived `Debug` tells an enum case, a bare name, from a struct, which carries its fields.
Affect: an enum slot reads as Dart's (`bottomRight`, `deleteIcon`), and a struct slot as its `Debug` (`TestSlot(3)`); a unit struct used as a slot reads as an enum case would.
## framework/ → framework.dart
- Change: a `State` is released with its element at unmount and freed at the next checkpoint unless a `Ref` keeps it; a callback that outlives the state holds a `Ref` (from `Handle::upgrade`) or checks `mounted`.
Reason: language — no garbage collector keeps Dart's disposed `State` alive; the tree code keeps a state only while it is mounted.
Affect: Dart's `if (mounted) setState(..)` guard from a timer or listener still works, but reading `widget` or `context` through a bare handle after the checkpoint panics with a stale-handle message instead of returning the last widget.
- Change: a panic in `build` unwinds; there is no `ErrorWidget` and no `FlutterError.reportError`, and a failed `of` lookup panics with its message in every build.
Reason: language — no catchable exception for ordinary control flow.
Affect: a failing build takes the frame down instead of painting the red error box, and a failed lookup reports the same in release as in debug.
- Change: `GlobalKey` is one type that wraps the `Key` it compares and hashes as, and a widget's key is `KeyRef`, `Local(Rc<dyn Key>)` or `Global(GlobalKey)`; Dart's `key is GlobalKey` is a match on `KeyRef::Global`, and the registry maps a `GlobalKey` to its element. Dart's classes map to constructors: `GlobalKey()` → `GlobalKey::new()`; `LabeledGlobalKey(label)` → `GlobalKey::labeled(label)` (both equal only to themselves and their clones); `GlobalObjectKey(value)` → `GlobalKey::object(handle_id)`; a subclass that overrides `==` and `hashCode` (`_ReorderableItemGlobalKey`, `_ReorderableListViewChildGlobalKey`, `_MergeableMaterialSliceKey`, `_DeprecatedRawViewKey`, go_router's `_ShellRouteNavigatorKey`) → `GlobalKey::wrapping(Rc::new(key))` over a private `Key` whose `eq_key` and `hash_key` are that override. `GlobalKey<T>`'s type argument is `current_state::<S>`'s.
Reason: language — a concrete type cannot be subclassed: Dart's subclasses of `GlobalKey` override only `==`, `hashCode` and `toString` and add nothing the framework reads through the key, so what varies is the key they compare as; and a type argument on the key would make `GlobalKey<A>` and `GlobalKey<B>` different Rust types where Dart's are one runtime class.
Affect: a key is given with `.into()`: `.key(key.clone().into())` for a global key, `.key(ValueKey::new(1).into())` for a local one, and an app's own key type implements `Key` (and `LocalKey`) and converts the same way into `KeyRef::Local`; an app's own global kind is `GlobalKey::wrapping` over its key; a key's state type is checked where `current_state::<S>` is called, not where the key is declared; `LocalKey` stays a marker for fields Dart types as `LocalKey` (`TableRow::key`, `PageStorageKey`).
- Change: `ObjectKey` and `GlobalKey::object` compare by an object's `HandleId`: an object's identity is its handle.
Reason: language — a Rust value has no identity, and the objects Dart keys by identity (a `State`, a controller) live in the arena under handles (the lead's decision).
Affect: only an arena object can key a widget by identity; the key names the object without keeping it, where Dart's key holds it, so a key stays `Copy` and a key made from a freed object never matches the slot's next occupant; `CupertinoApp` and `WidgetsApp` key their `WidgetsApp` and navigator by `GlobalKey::object(self.id())`, as Dart's `GlobalObjectKey(this)`.
- Change: a `ParentDataWidget` names the parent-data types it accepts, and `Positioned` accepts an overlay theater's parent data as well as a `Stack`'s.
Reason: language — no subtyping between parent-data types, so Dart's `is StackParentData` test cannot pass for a subclass.
Affect: a `ParentDataWidget` over a render object whose Dart parent data is a subclass of the expected one is rejected unless the widget names that type too.
- Change: a widget's `debug_fill_properties` is a method of each widget kind (`StatelessWidget`, `StatefulWidget`, `InheritedWidget`, `ParentDataWidget`, `RenderObjectWidget`) and of `Widget`, which an element's dump calls; `to_string_short` is overridable on a render object widget and on a widget implementing `Widget` itself, the two kinds whose Dart classes override it (`SizedBox`, `RootWidget`).
Reason: language — a user's widget implements a kind, which its erased wrapper forwards; no `super.debugFillProperties` call, so the framework sets `Widget`'s dense style first.
Affect: none in a dump; a stateless or stateful widget cannot rename itself in one.
- Deferred: `Widget.debugDescribeChildren` and a widget's own `toStringDeep`. Trigger: a dump of a widget rather than an element, or a leaf render object widget that describes children (none in Flutter's libraries).
- Change: an element's and a state's diagnostics are added in Dart's order by the framework: `Element`'s, its widget's among them, then `RenderObjectElement`'s render object, then the element class's own `debug_fill_properties` (`StatefulElement` adds its state); a state's `debug_fill_properties` comes after `State`'s lifecycle and mounting lines.
Reason: language — no `super` call from a trait default.
Affect: none.
## binding.rs → binding.dart
- Change: `debug_dump_app(app)` answers the text Dart's `debugDumpApp` prints, headed `WidgetsBinding - DEBUG MODE` (or `RELEASE MODE`).
Reason: platform — there is no `debugPrint` to throttle, one binding type stands for Dart's `WidgetsFlutterBinding`, and Rust builds have no profile mode.
Affect: the caller prints or compares it.
- Change: `WidgetsBinding`'s lifecycle, exit and back-gesture handlers do not catch a panicking observer.
Reason: language — no `FlutterError.reportError` hook to catch and continue.
Affect: one failing observer unwinds the lifecycle change or the exit request, and the observers after it hear nothing.
- Change: `WidgetsBindingObserver::did_change_drag` and the `DropListener` hear what is dragged from outside the application, from `EmbedderClient::drag_report`, and the listener's `on_dropped` hands over the dropped items as a paste hands over its own; Flutter has no drop in its framework and leaves it to plugins.
Reason: platform — the host reports the drag at the window, and the binding's observers are where window-level events reach the tree.
Affect: any observer hears every drag over any view, an `on_dropped` callback starts each read it wants before it returns, as the HTML spec's drag data store is protected until the drop, and with a host that reports no position the whole view is the target.
- Change: the binding keeps an observer as `Rc<dyn WidgetsBindingObserver>`. `DropListener`, `LocalizationsResolver` and `AppLifecycleListener` register an `Rc` that holds a `Ref` to themselves, which their `dispose` removes; `AppLifecycleListener` holds that `Rc` weakly, to remove it by, and a bare-handle observer whose object is freed is skipped as a tear-off is (`App::tear_off_receiver_is_live`).
Reason: language — Dart's `_observers` list holds each observer until `removeObserver`, which a `Ref` in the `Rc` is; a strong `Rc` in the listener's own field would make a ring.
Affect: a `DropListener`, `LocalizationsResolver` or `AppLifecycleListener` never disposed is never freed and keeps hearing, as in Dart; one disposed is freed at the next checkpoint.
- Change: `WidgetsBinding` follows the platform's caption settings itself and tells its observers each change through `WidgetsBindingObserver::did_change_caption_style`, which Flutter has no counterpart of.
Reason: platform — the caption settings tell their changes by a future of their own, where the other system settings reach the binding through the dispatcher.
Affect: every observer hears each change of the user's caption style, for as long as the app runs.
- Change: `run_app` builds its content, through a `MultiViewApp`, in every view the platform hosts for the app that carries no initial data, and where the platform gives none at start, as on a desktop, asks for one with `Platform::request_view` configured as `run_app_with` says and panics if the platform refuses at once, where Flutter's `runApp` draws into the implicit view.
Reason: platform — there is no implicit view: the platform gives the app its views or makes them on request.
Affect: an app given several views shows its content in each, with its own state; a request to close the app's last view asks to quit, as Cmd-Q does; an app with views of several kinds, or embedded where views come later, starts with `run_widget` over a `MultiViewApp`, as Flutter's web multi-view apps start with `runWidget`.
- Change: `WidgetsBinding::handle_clipboard_event` hands the host's copy, cut and paste to the primary focus as `CopySelectionTextIntent` and `PasteTextIntent`, with the event as the clipboard while they run.
Reason: platform — a host that owns the user's copy and paste, as a browser does, sends them as events, where Flutter's web engine has the browser paste into its own hidden text field.
Affect: the browser's or an Edit menu's Copy, Cut and Paste act on whatever widget has the focus, a selectable text included.
- Change: `WidgetsBinding::handle_edit_command` hands the system Edit menu's undo, redo, select all and delete to the primary focus as `UndoTextIntent`, `RedoTextIntent`, `SelectAllTextIntent` and a forward `DeleteCharacterIntent`; Flutter's macOS embedder sends the field its selectors through the text input channel instead.
Reason: platform — the host sends Edit's items as commands for the focused view, as it sends copy, cut and paste.
Affect: Edit's items act on whatever widget has the focus and handles the intent, and on nothing when none does.
- Change: the binding hears every tray icon's events and hands each to the listener set for its icon (`add_tray_icon_listener`); Flutter has no tray.
Reason: platform — the host reports a tray icon's events through one client hook, and several icons, each a `PlatformTrayIcon` or one the app added itself, hear their own.
Affect: an app that adds an icon itself hears it through a listener, since the binding owns the hook.
- Change: the binding makes its `DefaultPlatformMenuDelegate` over the app, which sets menus on the platform's `MenuBar` and hears its choices through `EmbedderClient::menu_selected`, where Flutter's binding makes one over `SystemChannels.menu`.
Reason: platform — there are no method channels; the host trait is the channel.
Affect: a `PlatformMenuBar` sets nothing on a host without a menu bar, where Flutter's channel call fails unheard.
- Change: `WidgetsBindingObserver::did_pop_route` and `WidgetsBinding::handle_pop_route` take the view the user went back in, where Dart's `didPopRoute` names none.
Reason: platform — each Android task of one app is a view with its own Back, and the host says which (`EmbedderClient::pop_route`).
Affect: an observer that belongs to one view answers for that view alone, and one for the whole app answers for any.
- Change: `WidgetsBindingObserver` hears every view the platform adds or removes for the app (`did_add_view`, `did_remove_view`), whoever started it, a request to close one (`did_request_view_close`) and a request for a view that got none (`did_fail_view_request`), where Flutter tells only `didChangeMetrics` and a listener compares `platformDispatcher.views` with what it had.
Reason: platform — the host reports each view's arrival, departure and close request by view, and a view the app asked for arrives as one the system made or restored does, as an iOS scene connects or an Android activity is created, carrying the initial data it was asked for with.
Affect: an app decides what goes in each view as it arrives, from its initial data, a view on a composition layer of the app's own among them; a close request stops at the first observer that answers `true`, which is whoever builds the view, and one no observer answers closes the view by the close rule, as Flutter's window delegate destroys a window by default, so a close that comes before the view's first build is not lost.
- Change: each element marked dirty outside a build pass asks for a frame of its own view, or of every view for one above every `View`, where Flutter asks once for the first.
Reason: platform — another view may be hidden and get no frames, while each frame builds every dirty element.
Affect: a `setState` in one window gives that window a frame and is built at the first frame of any window.
- Change: `WidgetsBinding::handle_commit_back_gesture` takes the view the gesture was in and answers whether the application handled it; when no observer handles the gesture it goes back through `handle_pop_route` for that view and returns its answer, where Dart's `handlePopRoute` calls `SystemNavigator.pop` itself.
Reason: platform — Back is reported per view, and the host does the platform's own Back when the app answers `false` (the `did_pop_route` entry).
Affect: a committed gesture nothing handled goes back in its own view, and the host closes or backgrounds the activity when nothing went back.
## multi_view_app.rs → `MultiViewApp` of Flutter web's embedding guide
- Change: `MultiViewApp` is a framework widget and the one way an app says what each of its views shows, as SwiftUI's scenes say it, where Flutter shows it as a sample in its web embedding guide; its builder answers, for each view the platform hosts for the app, what goes in it or `None`, and it answers close requests on the views it shows content in (`on_close_requested`). The module doc states the design of an app's views.
Reason: platform — there is no implicit view, and a view the app asked for in a window (`Platform::request_view`) or on a composition layer of its own (`ViewEmbedder::add_view`, Flutter's embedder's `FlutterEngineAddView`, which Flutter's framework has no object for), the first one and one the system made or restored all arrive the same way, each saying by its initial data what it is for.
Affect: an app asks for another view and holds nothing: the view arrives in the builder; a view the builder answers `None` for shows nothing; by default a request to close the app's last view asks to quit and any other's window closes. An app that hosts a view on its own layer gives it its metrics, sight, input and removal through the `ViewEmbedder` by the view's id, learned as the view arrives.
- Change: Waft does not port Flutter's windowing API, `widgets/_window.dart`'s `WindowController`, `WindowingOwner`, `RegularWindow` and their archetypes.
Reason: platform — it is experimental and desktop-only, the app making each window through a controller it holds, with nothing for the views a system makes or restores, as Android brings a task back from Recents and iOS a scene; Waft's one model is a view, asked for or not, arriving with what it is for.
Affect: an app asks for a window with `Platform::request_view` and builds it in a `MultiViewApp`; what Flutter's controller gives, a window's frame, title, minimizing and closing, the content reaches through `WindowScope`.
## widgets/composition_layer_view.rs → platform views (`AndroidView`, `UiKitView`, `Texture`)
- Change: one `CompositionLayerView` widget shows a composition layer on every platform, where Flutter has a widget per platform and `Texture`.
Reason: platform — a layer is a rectangle and its content on every compositor, and only the buffer's type differs, which the layer carries.
Affect: the widget takes no input and reports no size, so an app wraps it in a `Listener` and tells the producer the size itself.
## widgets/video_frame_view.rs → `Texture`
- Change: `VideoFrameView::new(reader)` draws the frames of a `VideoFrameReader` the app made and gave a player or a camera session, where Flutter's `Texture(textureId:)` draws a texture a plugin registered.
Reason: platform — the reader is the frame source, as Android's `TextureView` draws its `SurfaceTexture`, beside `CompositionLayerView` as `TextureView` is beside `SurfaceView`.
Affect: a video drawn by the framework clips, turns, fades and takes effects like anything painted, where a `PlayerView` has the system show it on a layer, the cheaper way and the only one for protected or HDR video.
## media/ → the `video_player` package's `VideoPlayerController` and `VideoPlayer`, and the `camera` package's `CameraController`, `CameraPreview` and `availableCameras`
- Change: `Player` is a listenable over the host's player, made from a URL and loading by itself, with no `initialize` and no copied value, and `PlayerView::new(player)` shows it, where Flutter's `VideoPlayerController` is initialized and `VideoPlayer` takes the controller.
Reason: platform — the host's player is the system's, which loads by itself and reports its state, and a host without players answers none.
Affect: an app calls `play` on a new player, `Player::new` answers `None` where the platform has no players, a URL the system cannot play reports a failure, and a `PlayerView` takes the video's size in logical pixels, or none until it is known.
- Change: `open_camera` opens a camera, asking the user the first time, and `CameraSession::start` starts it in one of its formats with all its outputs at once, answering once it runs or is interrupted, a listenable that tells the format it runs in and whether it runs, is interrupted or ended, and `CameraPreview::new(session)` shows its preview, where Flutter's `CameraController` initializes a camera with a resolution preset and takes pictures and videos itself.
Reason: platform — the host's session is the system's, which configures all its outputs together, and a platform without cameras answers none.
Affect: `open_camera` answers `None` where the platform has no cameras, an app gives the preview's layer, a frame reader, a photo size and recordings as the session starts, a photo arrives as encoded bytes and a recording at the app's path.
- Change: `available_cameras_changed` answers a future that resolves at the next change of what `available_cameras` answers, such as a camera plugged in or out, where Flutter's `availableCameras` tells no change.
Reason: platform — the host's cameras tell when their list changes, as every system tells an app.
Affect: an app lists the cameras again each time one comes or goes, asking for a new future after each, and gets `None` where the platform has no cameras.
- Change: a `PlayerView` makes a composition layer of its own and puts its player's picture there as it is mounted, which the system draws into, and nowhere as it is unmounted, unless another view took it since, and a `CameraPreview` places the layer its session started with; the frames of whichever view it is in place the layer.
Reason: platform — the picture is drawn by the system into a layer that is the composition layer's content, which no frame of the framework's touches, and a camera's outputs are given as it starts.
Affect: a player shows on the view built for it last and nowhere once its views are gone, a camera's preview shows where its `CameraPreview` is, and nothing shows where the host has no compositor.
- Change: a `Player` lists its media's tracks in its state, selects an audio track and a text track or none, and tells the media's metadata and the cues to show now, and a `PlayerView` draws those cues over the video with a `SubtitleView`, as Media3's `PlayerView` does, where Flutter's `VideoPlayer` shows no subtitles and an app puts a `ClosedCaption` of a caption file it parsed over it.
Reason: platform — the system draws no subtitles: the host's player hands out the cues of the media's own text tracks, as the media styles them.
Affect: a `PlayerView` shows the subtitles of the text track selected, in the user's caption style, with no code of the app's, and an app that draws the frames itself puts a `SubtitleView` of `Player::cues` over its video.
- Change: `Player::position` reads the host's player's position at each call and a `Player`'s listeners hear it only when it jumps, at every change its host tells, where Flutter's `VideoPlayerValue.position` is a copy its controller refreshes on a timer and tells at each refresh.
Reason: platform — the host's player is read when the app needs its position and tells only its jumps, as every system's player does.
Affect: a widget that shows the position while the player plays reads it at each frame, ticking with a `Ticker` from its state's ticker provider while the state says it plays, and a `Player`'s listeners also hear a change that left its state, metadata and cues as they were.
## media/subtitle_view.rs, media/subtitle_painter.rs → Media3's `SubtitleView`, `CanvasSubtitleOutput` and `SubtitlePainter` (androidx/media at 8c6678b, Apache 2.0)
- Change: `SubtitleView` always draws in the user's caption style, which it reads from the ambient `MediaQuery`, merged into each cue setting by setting, a setting that applies always over the media's styling and one that applies where the media says nothing beneath it, colours and their opacities on their own, where Media3's draws in the style an app sets, the user's only after `setUserDefaultStyle`, which it reads once, with every embedded style over it or, with `setApplyEmbeddedStyles(false)`, none.
Reason: platform — the user's caption style is a system setting beside the cues, and Apple's settings each say whether they apply always or only where the media says nothing, which Chromium's and WebKit's cue style sheets honour.
Affect: an app sets no caption style, text size or embedded-style switch on the view, the user's style changes the subtitles shown at once, a platform without caption settings shows the media's own style, and the runs of one cue can have different edges.
- Change: `SubtitleView` rounds the box behind a cue by the style's corner radius, draws a kind of font the style names in the family Chromium draws it in, and draws an edge whose colour neither the media nor the style says in black, where Media3's style has no corner radius or kind of font and its default edge colour is white.
Reason: platform — Apple's style gives a corner radius and an edge with no colour, which Chromium and WebKit draw black, and Windows gives a kind of font rather than a family.
Affect: subtitles on a Mac show the rounded box and the black edges the user set, and small capitals are drawn in their family's own letters, since a run takes no font features.
## widgets/banner.rs → banner.dart
- Change: `BannerPainter` answers no `repaint` listenable, where Dart repaints on `PaintingBinding.systemFonts`.
Reason: platform — the binding raises no system-font change yet.
Affect: a banner does not repaint when the system fonts change.
## widgets/basic.rs → basic.dart (+ `WidgetBuilder` from framework.dart, `Spacer` from spacer.dart, `IndexedStack` from indexed_stack.dart, `IndexedWidgetBuilder` from framework.dart)
- Change: a Dart constructor assert on one argument runs on its setter, and one across arguments in the widget's `debug_check_constructor`, when it is turned into a `WidgetRef` (`into_widget`); `Flex`, `RawIndexedStack`, `CustomPaint` and `Table` still check theirs when the element creates or updates the render object.
Reason: language — a struct literal has no constructor body, and a fluent setter cannot see the arguments a later setter will supply.
Affect: a bad combination panics where the widget is handed to the tree (for those four, during build), and a single-field assert fires at its setter, so a chain Dart's constructor would accept (`Positioned::fill(..).width(..)`) panics at `.width`.
- Change: the semantics flags (`Opacity.alwaysIncludeSemantics`, the deprecated `ignoringSemantics`) are absent, here and in the transitions and implicit animations built on these widgets.
Reason: platform — the flags only feed the semantics tree, which is deferred.
Affect: a caller cannot set them; nothing paints differently.
- `BackdropFilter`'s blend modes and anisotropic sigmas follow rendering's `RenderBackdropFilter` entry.
## widgets/container.rs → container.dart
- Change: `Container.color` and `decoration`'s mutual exclusion is asserted by whichever of the two setters runs second; the margin, padding and constraints asserts run on their own setters (basic.rs's assert entry).
Reason: language — a struct literal has no constructor body.
Affect: `.color(..).decoration(..)` panics at `.decoration` with Dart's message, in either order.
## widgets/ticker_provider.rs → ticker_provider.dart
- Change: `TickerMode::get_notifier` returns a fresh wrapper on every call, and its fallback is a fresh constant listenable.
Reason: language — a `dyn` value has no identity of its own, and foundation's erased `Listenable` value is deferred (this is its trigger).
Affect: two notifiers for one `TickerMode` never compare equal, so the ticker mixins drop and re-add their listener on every `activate`.
## widgets/transitions.rs → transitions.dart
- Change: the tweens this crate declares are `Clone` values built without the `App`, as `waft-animation`'s `ValueTween` is, where its Flutter-named tweens are arena objects.
Reason: language — orphan rule: an `Animatable` impl on a handle to a tween would name only foreign types.
Affect: `drive` drives a clone, so writing `begin` or `end` afterwards does not reach the running animation as it does on a Dart `Tween`.
- Change: `DelegatedTransitionBuilder` is a value carrying an identity: `DelegatedTransitionBuilder::function(f)` equals any other built from the same function, as Dart's tear-offs of one static method are identical, and `DelegatedTransitionBuilder::new(closure)` equals only its clones.
Reason: language — a Rust closure or function value has no identity to compare, and `ModalRoute` decides whether to receive the route above's delegated transition by comparing it with its own (the callback-identity pattern).
Affect: a route that offers its builder as a closure built per call never matches another route's, so a route below it always receives it; the Cupertino routes offer theirs as functions, so a sheet over a sheet, or a page over a page, receives none, as in Flutter.
- `SizeTransition`'s constructor asserts run on its setters, the mutually exclusive `axis_alignment` / `alignment` on whichever runs second; see basic.rs's assert entry.
- `FadeTransition` has no `alwaysIncludeSemantics`; see basic.rs's semantics-flags entry.
## widgets/icon_theme_data.rs → icon_theme_data.dart, widgets/icon_theme.rs → icon_theme.dart
- Change: a `CupertinoIconThemeData` is an `IconThemeData` carrying a `resolve` override, which `copy_with` and `merge` keep and `lerp` drops.
Reason: language — `IconTheme.data` is a value, not a subclassable object.
Affect: a lerped cupertino icon theme resolves like a plain one, where Dart's subclass keeps resolving as itself.
## widgets/gesture_detector.rs → gesture_detector.dart
- Change: `replaceGestureRecognizers`'s `FlutterError` is a `debug_assert!`.
Reason: language — no catchable exception; diagnostics deferred.
Affect: calling it outside layout panics in debug and proceeds in release.
## widgets/media_query.rs → media_query.dart
- Change: `MediaQueryData::from_view` reads the platform's brightness, its system context menu and the user's caption style, and leaves the accessibility, text-scaling and corner-radius fields at their defaults.
Reason: platform — `Platform` exposes `platform_brightness`, `system_context_menu` and `caption_settings` only, and `ViewMetrics` has no corner radii.
Affect: those fields are only non-default when an ambient `MediaQuery` supplies `platform_data`.
- Change: `MediaQueryData` carries the user's caption style, which `MediaQuery::from_view` takes again at each change, where Flutter's carries no caption style.
Reason: platform — the caption style is a system accessibility setting, as bold text and the text scale are, and the systems that keep one tell when the user changes it.
Affect: a widget that reads `MediaQuery::caption_style_of` is built again when the user changes their caption style, which is `None` where the platform keeps no caption settings.
## widgets/image.rs → image.dart
- Change: `ImageState` keeps a failed load to itself, where Dart also hands the failure to `FlutterError.onError`.
Reason: language — there is no isolate-wide error hook to report it to.
Affect: a failed image leaves an empty box and nothing in the log, and a caller that wants to react reads the failure off the state.
- Change: `create_local_image_configuration` leaves `bundle` and `locale` unset.
Reason: platform — `DefaultAssetBundle` and `Localizations` wait.
Affect: an `ImageProvider` keyed by bundle or locale resolves against `None`.
## widgets/widget_state.rs → widget_state.dart
- Change: `WidgetStateMapper::resolve` panics with Dart's `ArgumentError` message when no key is satisfied, for every value type.
Reason: language — Dart's `null as T` is a runtime test of `T`'s nullability, which a Rust generic cannot make without specialization.
Affect: a mapper over an `Option` panics on an unmatched set instead of resolving null, unless the map ends with a `WidgetState::any()` entry.
- Change: `WidgetStatePropertyAll` and `WidgetStateMapper` are properties only of a value type with `PartialEq`, which their `==` (`eq_property`) compares.
Reason: language — a Rust generic `==` needs the bound, where every Dart object has an `==`, identity unless overridden.
Affect: a property over a type without `PartialEq` cannot be made with `all` or `from_map`; `dyn Widget` and `Icon` have an identity `PartialEq`, Dart's `Widget.==`, for a widget-valued property such as `MenuThemeData::submenu_icon` and for `Switch::thumb_icon`.
- Change: `WidgetStateColor` is an `AnyColor` whose plain value is its empty-state resolution, read back with `color.extension::<WidgetStateColor>()`.
Reason: language — painting's `Color` is a value, not a subclassable object.
Affect: a map-built colour read as a plain `Color` gives its empty-state resolution where Dart throws, and panics only when no key matches the empty set.
- Change: `WidgetStateBorderSide` and `WidgetStateTextStyle` are carried by painting's `AnyBorderSide` and `AnyTextStyle`, as `WidgetStateColor` is by `AnyColor`, whose plain value is Dart's `super` value: the default `BorderSide()` and the empty `TextStyle()`.
Reason: language — painting's `BorderSide` and `TextStyle` are values, not subclassable objects (the lead's decision, following `AnyColor`).
Affect: a field takes a widget-state side or style only when it is typed `AnyBorderSide` or `AnyTextStyle`, and a map-built one read as a plain value gives that default where Dart's mapper throws.
- Change: `WidgetStateOutlinedBorder` is an `OutlinedBorder` itself, whose `ShapeBorder` and `OutlinedBorder` members are those of the default `RoundedRectangleBorder` it holds, for a map-built one too.
Reason: language — `OutlinedBorder` is a trait, so the subclass implements it directly as `WidgetStateMouseCursor` implements `MouseCursor`, and Dart's mapper answers those members only through `noSuchMethod`.
Affect: a map-built border used as a plain border paints the default rounded rectangle where Dart throws, and another border's `lerp_from` does not see it as a `RoundedRectangleBorder`, which Dart's `is` on the subclass would.
- Change: `clickable()`, `adaptive_clickable()` and `textable()` return a new `WidgetStateMouseCursor` per call that shares one per-thread resolver, and a `resolve_with` cursor compares equal to another holding the same resolver.
Reason: language — Rust has no `static const` object holding an `Rc`, so the identity of Dart's one canonical object is the identity of the resolver every call shares.
Affect: two calls of one of them compare equal, as Dart's `const` does, but are two objects; a cursor made by `resolve_with` is equal only to itself.
## framework/ → framework.dart (`Element.debugVisitOnstageChildren`)
- Change: the element subclasses Dart writes only to hide children from the test finders (`_OffstageElement`, `_IndexedStackElement`, Material's `_TextSelectionToolbarItemsLayoutElement`) have no element of their own: the generic single- and multi-child render-object elements ask their widget, through `RenderObjectWidget::debug_visit_onstage_children`, which children are onstage; an element of a widget's own (`_TheaterElement`, `_ViewportElement`, `SliverMultiBoxAdaptorElement`, Cupertino's toolbar items) overrides `Element::debug_visit_onstage_children` as Dart does.
Reason: language — Waft's generic elements stand in for Dart's per-widget element subclasses, and a subclass for one debug override would repeat a whole element.
Affect: a widget that hides children from the finders overrides the widget method, not the element's.
## framework: notifications → framework.dart (`Notification`, `NotifiableElementMixin`, `_NotificationNode`)
- Change: `NotificationListener<T>` matches one concrete notification type, or a family such as `dyn ScrollNotification` or `dyn LayoutChangedNotification` that a notification declares itself part of.
Reason: language — Dart's `notification is T` covers subclasses, and a trait family has no `TypeId` a downcast can name.
Affect: a listener sees only that exact type or a declared family, where Dart's also catches every subclass.
## widgets/page_storage.rs → page_storage.dart
- Change: `PageStorageBucket` stores erased values and `PageStorageKey` carries no type argument.
Reason: language — an erased key cannot be recognised as a generic type.
Affect: reading state back under a type other than the one written yields `None` rather than the stored value.
## widgets/scroll_delegate.rs → scroll_delegate.dart
- Change: `SliverChildListDelegate::should_rebuild` compares the two child lists pairwise (length, then `Rc::ptr_eq`).
Reason: language — Dart compares the two `List` references, and a `Vec` has no identity.
Affect: a delegate rebuilt from a fresh list of the same widget references does not rebuild its children, where Dart's list-identity check would.
## widgets/viewport.rs → viewport.dart
- `Viewport`'s center and cache-extent asserts run on whichever of the setters they need runs second; see basic.rs's assert entry.
## widgets/default_text_editing_shortcuts.rs → default_text_editing_shortcuts.dart
- Change: the shortcut tables are functions that build a fresh `ShortcutMap` per call, and so is `intent_for_macos_selector`.
Reason: language — an `Rc` value cannot be a `const`, and the target platform is a property of the host-supplied `Platform`.
Affect: the `ShortcutManager` re-indexes on every rebuild of this widget instead of seeing an unchanged const map.
- Change: the keys a platform is said to handle itself are only stood aside for when the host says it turns editing keys into edits.
Reason: platform — Dart stands aside for every macOS and iOS host because its embedders for those two are the only ones it has; a host that reports plain key presses interprets nothing, so standing aside would leave those keys to nobody.
Affect: over such a host a field's backspace, delete and arrow keys edit the text instead of doing nothing, on macOS and iOS as everywhere else.
- Change: where the host says the system's menus send Edit's cut, copy and paste, a field stands aside for those keys, the clipboard entries of the web's table, with Control and with Command, and acts on the `clipboard_event` the menu sends; Dart does so on the web only.
Reason: platform — such a menu takes the key once the framework leaves it, and its command is the system's own, which a host may require for a paste.
Affect: on macOS with the standard Edit menu, ⌘C, ⌘X and ⌘V reach a field through the menu, which flashes, and select all stays the field's.
## widgets/app.rs → app.dart
- Change: `WidgetsApp.showPerformanceOverlayOverride` and `debugAllowBannerOverride` are kept per `App`, read with `WidgetsApp::show_performance_overlay_override(app)` and `debug_allow_banner_override(app)` and set with their `set_` twins, not in statics.
Reason: language — Dart's statics are isolate-global, and an `App` is Waft's isolate.
Affect: setting one changes only the app it is passed to, so a test that sets it needs no reset.
- Change: `WidgetsApp`'s cross-argument constructor asserts run when the widget is turned into a `WidgetRef` (`into_widget`).
Reason: language — the arguments arrive through fluent setters, so they are only complete once the chain ends (basic.rs's assert entry).
Affect: a contradictory configuration panics where the app widget is handed to the tree, not on its first build.
- Change: `WidgetsApp::default_shortcuts` and `default_actions` build a fresh value per call, with new action objects.
Reason: language — an `Rc` or an arena handle cannot be a `const`, and Dart's `defaultActions` is one mutable map of shared action objects.
Affect: modifying the returned map changes only the app it is passed to, where Dart's global map is shared by every `WidgetsApp`.
- Change: the default navigation-notification handler tells the host of the view the app is built in through `ViewHost::set_framework_handles_back` on every target, where Dart's `SystemNavigator.setFrameworkHandlesBack` tells the platform as a whole on Android alone.
Reason: platform — whether Back is heard in advance is the host's to know, a host whose app answers behind an interface hears it on any system, as a program of WaOS's does, and each Android task of one app has its own Back.
Affect: a host that implements it hears whether a navigator can pop in each view on every system; the default drops it, as a host that asks `EmbedderClient::pop_route` on the spot does.
- Change: `did_pop_route` goes back only for a Back in the view the app is built in.
Reason: platform — the binding hears Back for one view (binding.rs's `did_pop_route` entry).
Affect: with an app in each of two views, Back pops the navigator of the view it was pressed in, and the other's stays.
## widgets/scroll_context.rs → scroll_context.dart
- Change: a scroll context hands its positions one shared `Rc<dyn ScrollContext>`, compared by pointer where Dart compares `this`.
Reason: language — an `Rc` has no `==` by object identity.
Affect: a context that mints a fresh `Rc` per position fails `absorb`'s identity check.
## widgets/scroll_physics.rs → scroll_physics.dart
- Change: the deprecated `tolerance` getter is not ported.
Reason: platform — it reads the implicit view's device pixel ratio, and there is no implicit view.
Affect: call `tolerance_for(metrics)`, as Flutter asks.
## widgets/scroll_simulation.rs → scroll_simulation.dart
- Change: a fling from past an edge back into the content decelerates like any fling.
Reason: platform — UIKit does so, measured on an iPhone (`experiments/2026-11-16-scroll-reversal`, Part 7).
Affect: a swipe that turns back at a list's end carries on, instead of springing back to the end.
## widgets/scroll_notification.rs → scroll_notification.dart
## widgets/scroll_position.rs → scroll_position.dart
- Change: everything that reads a position's metrics — the physics, a `ScrollMetricsNotification`, `ScrollIncrementDetails` — is handed a `copy_with` snapshot instead of the position itself.
Reason: language — the axis direction and device pixel ratio are live reads of the `ScrollContext`, which needs the arena the `&self` `ScrollMetrics` trait does not have.
Affect: a `ScrollPhysics` sees the metrics as they were at the call, not the live position Dart lets it re-read; a page view's snapshot is a `PageMetrics` carrying its position's cached page, which `PageScrollPhysics` reads where Dart asks `position is _PagePosition`.
- Change: the semantic-action bookkeeping and the `notifyListeners` override that ran it are gone.
Reason: platform — `ScrollContext.setSemanticsActions` waits with the semantics tree.
Affect: nothing schedules a semantics update when the offset or the dimensions change.
## widgets/scroll_position_with_single_context.rs → scroll_position_with_single_context.dart
- Change: `absorb` tests the other position by downcasting to its own leaf type rather than for the `ScrollPositionWithSingleContext` base.
Reason: language — the arena answers only the type a handle was created with.
Affect: absorbing a position of a different leaf type goes idle and keeps its own scroll direction and drag, where Dart hands both over.
## widgets/scrollable.rs → scrollable.dart, widgets/scrollable_helpers.rs → scrollable_helpers.dart
- Change: `build` wraps the viewport in `Listener` → `RawGestureDetector` → `IgnorePointer` only: `_ScrollSemantics` and the selection handler are gone.
Reason: platform — `_ScrollSemantics` is a render object that only feeds the semantics tree, and selection is deferred (`## widgets/widget_inspector.rs → widget_inspector.dart (`WidgetInspectorService`)
- Change: an inspector id is the object's arena handle (`inspector-<bits>`, `inspector_id`), where Dart's `toId` hands out counted ids kept in object groups until `disposeGroup`.
Reason: other — the arena already names each object uniquely, finds it back, and never keeps it alive, which Dart's id table and weak maps are for.
Affect: a client's `objectGroup` and `disposeGroup` have nothing to release; an id of a freed object finds nothing.
- Change: an element's diagnostics node (`ElementDiagnosticsNode`, Dart's `_ElementDiagnosticableTreeNode`) answers as its `value` the facts the inspector reads of its element (`ElementFacts`: its widget's type, whether it is stateful), where Dart's answers the element.
Reason: language — a snapshot node keeps no arena object, and the serialization delegate has no `App` to read one through.
Affect: none.
- Deferred: `getRootWidgetTree`'s `withPreviews` (a paragraph's `textPreview`) and `fullDetails=false` (`toJsonMapIterative`), `DisableWidgetInspectorScope`, and the inspector's other extensions (`getProperties`, `getChildren`, selection, layout explorer). Trigger: a client that asks for them.
- Change: a widget's creation location is the line that turned it into a `WidgetRef` (`into_widget`, `#[track_caller]` in a debug build), which a setter or constructor taking a child passes on from its own caller, where Dart's compiler records each constructor call (`--track-widget-creation`).
Reason: language — Rust records a caller's location only through `#[track_caller]` functions, and every widget becomes a tree node through `into_widget`.
Affect: a widget made in one place and converted in another names where it was converted.
- Change: the app's own widgets (`createdByLocalProject`, the summary tree) are those whose file Rust names relative to the workspace being built, where Dart's are those under the roots its tool sets (`addPubRootDirectories`).
Reason: platform — Cargo names a workspace file by a relative path and a dependency's (registry, checkout) by an absolute one, which needs no root from a client.
Affect: Waft's own examples, in Waft's workspace, count the framework's widgets as their own.
- Deferred: `locationId` and the extensions that read locations (`addPubRootDirectories`, rebuild and repaint counts, `trackRebuildDirtyWidgets`). Trigger: a client that asks for them.
- Change: the screenshot's PNG is encoded by valo's software encoder (`waft_embedder::encode_png`), where Dart's `toByteData(png)` is the engine's.
Reason: platform — the winit host's Windows and Linux systems have no image codecs here; one encoder makes the same file on every host.
Affect: none.
## Deferred`).
- binding.rs: `ext.flutter.didSendFirstFrameRasterizedEvent` and the `Flutter.FirstFrame` event, which need the host's frame timings and an event stream to clients. Trigger: frame timings from a host, or a client that listens for events.
Affect: a scrollable exposes no scroll actions to a screen reader and cannot be selected across; its tree is three nodes shallower.
- Change: a pointer scroll signal is resolved through gestures' `PointerSignalResolver`, but the host is not told the event was handled.
Reason: platform — `PointerEvent.respond` is omitted on signal events (waft-gestures records it).
Affect: an embedder that would scroll the page itself is not told the scrollable took the event.
## platform_selectable_region_context_menu.rs → platform_selectable_region_context_menu.dart
- Change: `PlatformSelectableRegionContextMenu` is the non-web stub alone: every member and its `build` throw where Dart throws `UnimplementedError`.
Reason: platform — the context menu is a web platform view, and there is no web host that implements it.
Affect: an app on a non-web host never builds one; a web host has nothing to build yet.
## widgets/selectable_region.rs → selectable_region.dart (`MultiSelectableSelectionContainerDelegate`, `StaticSelectionContainerDelegate`)
- Change: Dart's two classes are traits over their field bags, the bodies an override reaches as `super` live on `MultiSelectableSelectionContainerDelegateBase` and `StaticSelectionContainerDelegateBase`, `PlainStaticSelectionContainerDelegate` is Dart's instantiable `StaticSelectionContainerDelegate()`, and a leaf writes the `*_accessors!`, `static_selection_container_delegate_overrides!` and `SelectionHandler` / `SelectionRegistrar` macros.
Reason: language — no class inheritance, and a trait and a struct cannot share a name.
Affect: an app that extends `StaticSelectionContainerDelegate` implements the trait over its own bags and forwards the inherited members with the macros, where Dart writes `extends StaticSelectionContainerDelegate`; `SelectableRegion` builds `PlainStaticSelectionContainerDelegate` where Dart writes `StaticSelectionContainerDelegate()`.
- Change: `compareOrder` is a method taking the app, not a getter returning a `Comparator<Selectable>`.
Reason: language — a selectable's bounding boxes are read through `&mut App`, which the comparator a getter returned could not carry.
Affect: a subclass overrides `compare_order(self, app, a, b)` where Dart overrides `compareOrder`.
## widgets/selectable_region.rs → selectable_region.dart (`SelectableRegion`)
- Change: a region whose `selectionControls` do not mix in `TextSelectionHandleControls` shows no toolbar.
Reason: language — the overlay's own toolbar asks the deprecated `TextSelectionDelegate` members (`textEditingValue`, `cutSelection`, `pasteText`, …), which the region does not implement.
Affect: `contextMenuBuilder` is a region's only toolbar; the platform controls, which are handle controls, and Material's `SelectionArea` are unaffected.
- Change: the process-text and share items of a region's menu are absent.
Reason: platform — the host has no text-processing service or share sheet.
Affect: a region's menu holds Copy and Select All, where an Android host would add a Share item.
- Change: the deprecated `TextSelectionDelegate` implementation, `_updateSelectionStatus`'s `textEditingValue`, `SelectionListener`, `SelectionDetails` and `SelectionListenerNotifier` are not ported.
Reason: language — the delegate's members exist only for the deprecated toolbar and the platform's text input channel, which the port does not use; the listener classes wait for their tests' needs.
Affect: `SelectableRegionState` is not a `TextSelectionDelegate` and no `SelectionListener` reports a region's selection details; `onSelectionChanged` and `contextMenuButtonItems` give what those would.
- Change: the browser's own context menu is not wired: the region does not attach `PlatformSelectableRegionContextMenu` on focus, detach it on blur, or wrap its child in one, and `BrowserContextMenu` is not ported.
Reason: platform — both serve the browser's own context menu, a DOM view the web host would own, and there is no web host.
Affect: a region builds the same tree and takes the same focus path on every platform, with no browser-menu integration where Flutter's web region has one.
## widgets/text.rs → text.dart (selection)
- Change: the text delegate records where each fragment of the paragraph after its first starts in it when the selectables change, where Dart reads it from the fragment's first box while it computes the range.
Reason: language — `Selectable::bounding_boxes` and `RenderParagraph::get_position_for_offset` take `&mut App` here, and `SelectionHandler::selection` has `&App`.
Affect: none in left-to-right text: a fragment's first box starts at its first character whatever the layout, and the paragraph rebuilds its fragments, and so the record, whenever its text changes; a right-to-left fragment re-wrapped by a relayout may report the start Dart read before the relayout.
## widgets/scroll_view.rs → scroll_view.dart
- Change: the physics a primary scroll view implies is substituted in `build`, not stored on the widget.
Reason: language — a fluent setter cannot see the `primary`, `controller` and direction a later setter will supply.
Affect: `view.physics` reads `None` where Dart's field already holds the implied `AlwaysScrollableScrollPhysics`; the `Scrollable` is given the same physics either way.
- Change: `ListView`'s and `GridView`'s `children` and `add*` arguments are setters, whichever of them runs last rebuilding the delegate out of all of them, and `ListView::builder(..)`, `separated(..)`, `GridView::builder(..)`, `count(..)` and `extent(..)` are separate values that convert to the widget, `count` and `extent` holding their grid delegate's arguments.
Reason: language — a fluent setter cannot see the arguments a later setter will supply, and the delegate is built from four of them.
Affect: any order of those four setters lands on the delegate Dart's constructor builds, and all four panic on a builder-, separated- or custom-constructed view; the scroll view's own arguments are set on the converted widget.
## widgets/focus_manager.rs → focus_manager.dart
- Change: `remove_child` clears the cached ancestors of the removed node and its descendants, which Dart's `_removeChild` leaves until the node is reattached.
Reason: language — Dart's collector keeps the old ancestors readable, but the arena frees them.
Affect: a node outside the tree reads no ancestors until it is reattached, so its `skipTraversal` no longer depends on where it used to be.
- Change: the manager takes key events one at a time from `HardwareKeyboard`; there is no `KeyMessage`, no `RawKeyEvent` and no `FocusNode.onKey`.
Reason: platform — services' raw key path and `KeyEventManager.keyMessageHandler` are deferred (`waft-services/src/PORTING.md`).
Affect: a node handles keys through `on_key_event` only, and the Android virtual-keyboard check that suppresses a highlight change does not run.
- Change: `size`, `offset` and `rect` read the context's render object as a `RenderBox` and use its size where Dart reads `semanticBounds`.
Reason: platform — `semanticBounds` waits with semantics; on a box it is exactly that rectangle.
Affect: a focus node whose context hosts something other than a `RenderBox` panics instead of returning that object's paint bounds.
## widgets/focus_scope.rs → focus_scope.dart
- Change: the debug focus border (`debugPaintFocusBoxes`'s `_DebugFocusBorder`) is absent.
Reason: platform — diagnostics wait.
Affect: `debug_paint_focus_boxes` draws nothing.
## widgets/actions.rs → actions.dart
- Change: Dart's `const ActionDispatcher()` is `PlainActionDispatcher`, a fresh object per call.
Reason: language — no `const` object holding an `Rc`, and a trait and a struct cannot share a name.
Affect: two dispatchers are never equal, so an `Actions` widget that sets one rebuilds its dependents on every update.
## widgets/shortcuts.rs → shortcuts.dart
- Change: shortcuts are an insertion-ordered list of activator and intent pairs, not a map; `CallbackShortcuts.bindings` has the same shape.
Reason: language — an erased `ShortcutActivator` has no content hash to key a map with.
Affect: two entries with equal activators both stay where Dart's map keeps only the last, and reordering the list counts as a change.
## widgets/restoration.rs → restoration.dart, widgets/restoration_properties.rs → restoration_properties.dart
- Change: the root bucket is read within the call, so what Dart runs from the future's continuation runs inline.
Reason: platform — the host's `Restoration` capability answers within the call (waft-services' `root_bucket`).
Affect: the first frame is never held back and a `RootRestorationScope` hands its child a bucket on its very first build, where Dart renders an empty container first.
- Change: `RestorableEnum` and `RestorableEnumN` serialize a value with its `Debug` output where Dart uses the enum's name, and keep duplicate `values`.
Reason: language — a Rust enum has no reflected variant name.
Affect: a hand-written `Debug` decides what is written to the restoration data, so a stored value is only restored while that output stays the variant name.
## widgets/overlay.rs → overlay.dart
- Change: the theater does not suppress the `markNeedsLayout` that adopting or dropping an overlay child performs, and the deferred layout box always re-schedules its subtree.
Reason: language — a Rust impl cannot call the trait body it overrides, so neither the outstanding-update counter nor the dirty flag can be maintained.
Affect: showing or hiding an `OverlayPortal` child relays out the whole `Overlay`, and the overlay child's subtree is laid out again whenever the `Overlay` or the `OverlayPortal` lays out; the resulting tree is the same, the work is not.
- Change: the theater's and the deferred layout box's children are collected into a `Vec` before each layout, paint and hit-test walk.
Reason: language — a lazy iterator would borrow the `App` for the whole walk, and the body of the walk needs `&mut App`.
Affect: an overlay child added or removed during the `Overlay`'s own layout is picked up on the next layout pass, not the current one.
## widgets/navigator.rs → navigator.dart
- Change: `Route::will_pop` and `NavigatorState::maybe_pop` answer within the call, where Dart returns a future.
Reason: language — the only asynchrony in Dart's deprecated `willPop` is the callback loop deferred with `WillPopScope` (`## Deferred`).
Affect: a pop is decided before the call returns, so nothing can hold the decision open; when the callback loop is ported, both become `CompleterFuture`s.
- Change: a route result is the erased `Option<Rc<dyn Any>>`; `Route`, `Page` and `TransitionDelegate` carry no result type.
Reason: language — the navigator holds routes of mixed result types in one history, and a type-erased handle cannot carry a per-route type parameter.
Affect: a popped result is downcast when it comes back and a mismatched type is simply `None`, where Dart's `T` is settled when the code is compiled.
## widgets/routes.rs → routes.dart
- Change: `RouteObserver` takes a `RoutePredicate` where Dart takes the type argument `R`.
Reason: language — a Rust type parameter cannot answer "is this erased route an `R`" without a witness.
Affect: which routes an observer is told about is whatever predicate it was given, not a route class.
- Change: `RawDialogRoute.buildPage` wraps the page builder's widget in `Semantics(scopesRoute:, explicitChildNodes:)` without Dart's `DisplayFeatureSubScreen`, and there is no `anchorPoint`.
Reason: platform — the `DisplayFeatureSubScreen` wrapper is deferred, and `anchorPoint` exists only to feed it.
Affect: a dialog is not confined to the display-feature sub-screen closest to an anchor point.
- Change: `AnyTransitionRoute` carries `underlying_animation` beside `animation`, for the animation a route runs on rather than whatever a subclass answers with.
Reason: language — Dart keeps the animation in a private field and offers a getter over it, and a `ModalRoute` overrides that getter with a proxy that reads complete while the route is offstage. Where the route behind measures the one ahead, Dart reaches past the override to the field, which library privacy lets it do; an erased route here is reached through a vtable, so the field needs an edge of its own, as `controller_value` already has.
Affect: a route behind follows the next route's own animation and stays where it is while that route is offstage to be measured, instead of flashing the end of the transition before it plays.
## widgets/implicit_animations.rs → implicit_animations.dart
- Change: this file's tweens are value tweens in transitions.rs's shape, and the ones over a nullable Dart value animate an `Option` whose endpoints flatten, so an unset endpoint and one set to `None` are the same thing.
Reason: language — the same orphan rule; Dart's `BorderRadius??` flattens where `Option<Option<_>>` does not, and `_constructTweens`' `tween.end ?? tween.begin` depends on that.
Affect: a tween with an unset `begin` returns `None` at `t == 0` rather than panicking, and `Matrix4Tween` interpolates the host's f32 matrices, so a `decompose` / `compose` round trip is exact only to f32.
- `AnimatedOpacity` has no `alwaysIncludeSemantics`; see basic.rs's semantics-flags entry.
- `AnimatedContainer`'s colour / decoration exclusion and its other constructor asserts run on the setters, as container.rs records; `width` and `height` fold into `constraints` on assignment, as `Container`'s do.
## widgets/visibility.rs → indexed_stack.dart (`Visibility`)
Flutter folded `visibility.dart` into `indexed_stack.dart`; this file keeps the old name, and the shared scope lives in basic.rs with the rest of `IndexedStack`.
- Change: `Visibility`'s five `maintain*` constructor asserts run when the widget is turned into a `WidgetRef` (`into_widget`).
Reason: language — the flags arrive through fluent setters, so they are only complete once the chain ends (basic.rs's assert entry).
Affect: any order of the setter chain is accepted, and a bad combination panics where the widget is handed to the tree, not on its first build.
- Change: `maintain_semantics` is carried but nothing reads it.
Reason: platform — it only feeds `visitChildrenForSemantics`, and the semantics tree is deferred.
Affect: a hidden child is never reported to accessibility tools, `maintain_semantics` or not.
## widgets/draggable_scrollable_sheet.rs → draggable_scrollable_sheet.dart
- Change: `_replaceExtent` compares the old and new `snap_sizes` by value.
Reason: language — Dart's `List` `==` is identity, and a `Vec` has none.
Affect: rebuilding a snapping sheet with a fresh list of the same sizes does not schedule the post-frame snap Dart schedules.
## widgets/editable_text.rs → editable_text.dart
- Change: `EditableText` keeps the constructor's strut in a private `strut_style` field and answers Dart's `strutStyle` getter as `effective_strut_style()`; `strut_style(...)` is Dart's constructor argument.
Reason: language — Rust has no getter and setter sharing one name on a type.
Affect: code that reads the strut the editable lays out with calls `effective_strut_style()`, not `strut_style()`.
- Change: `EditableText.debugDeterministicCursor` is kept per `App`, read with `EditableText::debug_deterministic_cursor(app)` and set with `set_debug_deterministic_cursor(app, value)`, not in a static.
Reason: language — Dart's statics are isolate-global, and an `App` is Waft's isolate.
Affect: setting it changes only the app it is passed to, so a test that sets it needs no reset.
- Change: an app private command arrives with its action string only; the argument map Flutter sends is dropped.
Reason: platform — the host's `perform_private_command` carries no map.
Affect: a private command handler cannot read the arguments the platform sent with it.
- Change: `want_keep_alive` reads a focus flag the focus listener updates instead of walking the node.
Reason: language — `FocusNode::has_focus` needs `&mut App`, which the getter does not have.
Affect: keep-alive follows the last focus change the state handled, so it lags a change no listener has run for yet.
- Change: the selection's glyph heights are measured from its first and last Unicode scalar, not its grapheme clusters.
Reason: language — there is no `characters` package.
Affect: a selection that starts or ends inside a multi-scalar cluster (an emoji ZWJ sequence) sizes from that scalar's box, or falls back to `preferredLineHeight`.
- Change: a paste whose clipboard read finishes after the field left the tree is dropped, where Dart goes on with it.
Reason: language — a disposed state's handle cannot be read.
Affect: a field that closes while the clipboard is being read pastes nothing.
## widgets/undo_history.rs → undo_history.dart
- Change: `UndoHistory`'s `value` is any `ValueListenable<T>` handle, where Dart takes a `ValueNotifier<T>`.
Reason: language — without subclassing, a `TextEditingController` is no `ValueNotifier`; both are value listenables.
Affect: an `UndoHistory` can also track another value listenable, such as an animation.
## widgets/platform_menu_bar.rs → platform_menu_bar.dart
- Change: `PlatformMenuItem` is a trait with `PlainPlatformMenuItem` as Dart's concrete class, its shared bodies on `PlatformMenuItemBase`, and `to_menu_entries` builds `MenuEntry` values where Dart's `toChannelRepresentation` builds maps.
Reason: language — no class inheritance; and platform — the menu crosses to the host as a value, not a channel message.
Affect: a subclass of `PlatformMenuItem` implements the trait, and the delegate hands the host values it can check.
- Change: an item also has a `check` and an `icon`, which a native menu draws; Dart's `PlatformMenuItem` has neither.
Reason: platform — AppKit, Win32 and the DBus menu draw check marks and icons, which only a menu the framework draws could draw otherwise.
Affect: a checkbox or radio item shows its state in the system's menu.
- Change: `PlatformProvidedMenuItemType` adds `Undo`, `Redo`, `Cut`, `Copy`, `Paste`, `SelectAll` and `Delete`, and its speaking items map to no item of the host's.
Reason: platform — the system knows its Edit menu by these, and the host sends them to the focused view (`ProvidedItem`); no host provides speech.
Affect: an app gets the system's Edit menu with dictation and emoji on macOS, and `has_menu` answers no for the speaking items.
- Change: a tooltip is not carried, and `onOpen` and `onClose` are never called.
Reason: platform — no host's menu interface says a menu opened or closed, and AppKit's menus show no tooltip the host sets.
Affect: a menu's open and close callbacks stay silent, and a tooltip shows nowhere.
- Change: a provided item's label is the host's, in English, and its enabled state is the value's alone, where AppKit validates items through the responder chain.
Reason: platform — the host builds each menu whole from the value and leaves deciding to the app.
Affect: macOS's Enter Full Screen keeps its title in full screen, and an Edit item stays enabled with nothing to copy.
## widgets/platform_tray_icon.rs → no Flutter counterpart: `PlatformMenuBar`'s form, SwiftUI's `MenuBarExtra`'s lifetime, Electron's `Tray.setContextMenu`'s trigger
- Change: `PlatformTrayIcon` is an icon in the system's tray with an image, a tooltip, a menu of the items `PlatformMenuBar` takes and callbacks for a click and a double click, which Flutter does not have; it takes `PlatformMenuBar`'s form, a widget with no look of its own that hands the host a value on each change and dispatches a choice to the item's callback or intent, by ids of each icon's own.
Reason: platform — a desktop app's tray icon is part of what it shows, and a value rebuilt from state is how this framework hands the host its menus.
Affect: an app shows a tray icon by putting the widget in its tree, and several may be there at once.
- Change: the icon is there while the widget is in the tree, as SwiftUI's `MenuBarExtra` is while it is in its scene: added when the widget is mounted, once the host answers it, removed when it is unmounted, and updated by a rebuild.
Reason: platform — the host's icon is a resource the widget owns, as a ticker or a focus node is a state's.
Affect: an icon the system refuses, or one answered after the widget left the tree, shows nowhere.
- Change: the menu shows on each system's own trigger, as Electron's `Tray.setContextMenu` shows it: handed to the system where the icon offers a menu the system opens by itself (macOS, Linux), opened at the icon on `ContextMenuRequested` elsewhere (Windows).
Reason: platform — each system decides when a tray's menu opens, and the framework, not the host, keeps the convention.
Affect: the same widget gives a macOS click, a Linux desktop's trigger and a Windows right click the menu; an app that wants another trigger uses the icon's capabilities directly.
## widgets/system_context_menu.rs → system_context_menu.dart
- Change: custom item callback ids are a process-wide counter string, not Dart's `hashCode`.
Reason: language — the item data is an enum, not an object with an identity hash.
Affect: the host sees incrementing ids such as `"1"` rather than an object hash.
## widgets/text_selection.rs → text_selection.dart
- Change: a `ClipboardStatusNotifier` with listeners also updates each time the host says the clipboard changed.
Reason: platform — Flutter's engines never say the clipboard changed; a host that can tell, says so.
Affect: a toolbar's Paste button follows a copy made in another app without the app having to resume first.
- Change: each overlay owns its context-menu and spell-check `OverlayEntry`; there is no `ContextMenuController` singleton.
Reason: language — Dart's static `_shownInstance` is isolate-global.
Affect: two `SelectionOverlay`s can show two menus at once.
- Change: the selection handles' glyph heights are measured from the first and last Unicode scalar, not the grapheme clusters.
Reason: language — there is no `characters` package.
Affect: a selection that starts or ends inside a multi-scalar cluster (an emoji ZWJ sequence) sizes from that scalar's box, or falls back to `preferredLineHeight`.
## widgets/feedback.rs → feedback.dart
- Change: `for_tap` is a no-op; `for_long_press` calls only `HapticFeedback` (`vibrate` on Android/Fuchsia, `heavy_impact` on iOS).
Reason: platform — `SystemSound` and semantics events are not on the host surface.
Affect: a tap plays no click; iOS long-press has no click sound.
## widgets/tap_region.rs → tap_region.dart
- Change: `RenderTapRegionSurface` records the hit path on its own hit-test entry target instead of an `Expando` keyed by entry identity.
Reason: language — `BoxHitTestResult` is a borrow of `HitTestResult` and `BoxHitTestEntry` is a value; neither can be an `Expando` key holding the path.
Affect: the surface appears in the hit-test path as that target rather than as a `BoxHitTestEntry`.
- Change: `RenderTapRegion` registers after `perform_layout` and unregisters in `did_detach`, where Dart overrides `layout` and `dispose`.
Reason: language — `layout` and `dispose` are not virtuals a leaf can wrap.
Affect: a region stops being registered as soon as it detaches, not only when it is disposed, and the next layout registers it again.
- Change: `TapRegionGroupId` prints a type group as its `TypeId`'s debug form and a handle group as `#` and its identity hash, where Dart prints the group object's `toString`.
Reason: language — a `TypeId` is opaque and carries no name, and a `HandleId` has no `toString`.
Affect: a dump's `groupId:` line reads `TypeId(…)` or `#00001` where Flutter's reads `EditableText` or `Instance of '…'`.
## widgets/drag_target.rs → drag_target.dart
- Change: a drag payload is an `Rc<T>` and a target accepts a draggable by matching that concrete Rust type.
Reason: language — Rust has no runtime subtype relation to test a payload against a target's type.
Affect: a draggable and a target pair up only on the same type, so a shared payload model has to be one type (an enum), where Dart also matches subtypes.
## widgets/widget_span.rs → widget_span.dart
- Change: `WidgetSpan::extract_from_inline_span` wraps each inline widget in its parent-data and scaling widgets only, without Dart's `Semantics` tagged with the placeholder's index.
Reason: language — the tag needs `SemanticsTag` equality by index, and `SemanticsTag` compares by identity until the semantics tree needs it.
Affect: an inline widget contributes no semantics node of its own.
- Change: a `WidgetSpan`'s `widget` diagnostic line is a `DiagnosticsProperty<String>` reading `Instance of 'Widget'`.
Reason: language — a `WidgetRef` is an erased arena handle with no runtime class name.
Affect: a span dump names the kind where Dart names the widget's class.
## widgets/table.rs → table.dart
- Change: `Table`'s constructor checks (a baseline alignment has a `text_baseline`, the rows have the same number of cells, no row is empty) run when the table creates or updates its render object.
Reason: language — Rust has no named arguments, so the table is built by setters that each see one argument, and none sees them all.
Affect: in a debug build, a malformed table panics when it is mounted or rebuilt, not where it is written.
## window.rs → _window.dart (`WindowScope`)
- Change: `WindowScope` hands the content of a view in a window the window itself, the host's `HostWindow` (`WindowScope::of`, `WindowScope::maybe_of`), where Flutter's hands the window's controller; the `View` widget provides it for every view in a window, and its dependents rebuild when the host reports the window changed, where Flutter's `Window` widget provides it for the controller it is given.
Reason: platform — every view in a window, asked for or made by the system, has its window from the host (`View::window`), and there is no controller to hand.
Affect: content reads its window's frame, minimizing and closing from its context, and rebuilds when the window is minimized or restored, covered or shown, or moved, as it rebuilds with its view's metrics; content in no window, a phone's screen, has none.
## widgets/snapshot_widget.rs → snapshot_widget.dart
- Change: `RenderSnapshotWidget` never rasterises its child: while `allow_snapshotting` is true it paints the child live through `SnapshotPainter::paint(context, offset, size, super.paint)`, where Flutter rasterises the child into an `Image` and calls `paint_snapshot`.
Reason: platform — `OffsetLayer.toImageSync` is deferred, so a layer cannot be turned into an `Image`.
Affect: a snapshotted child keeps repainting and animating, `paint_snapshot` is never called, `SnapshotController::clear` and a device-pixel-ratio change cause no re-rasterisation, and `SnapshotMode` changes nothing (no platform-view check runs, so `Normal` never panics).
## widgets/page_transitions_builder.rs → page_transitions_builder.dart
- Change: two `PageTransitionsBuilderRef`s are equal only when they share one allocation.
Reason: language — no canonical `const` objects: Dart's `const FadeUpwardsPageTransitionsBuilder()` is one object wherever it is written.
Affect: two themes or builder maps built with separately made builders compare unequal where Dart's const builders are identical.
## widgets/raw_menu_anchor.rs → raw_menu_anchor.dart
- Change: `MenuController` is a leaf of `MenuControllerLeaf`, holding Dart's fields as a `MenuControllerData` bag; a field or parameter Dart types as `MenuController` is the erased `AnyMenuController`, and an app's subclass is a second leaf that overrides `is_open`, `open`, `close` or `close_children` and calls `MenuController::open` (and the others) where Dart writes `super`.
Reason: language — a Rust struct cannot be subclassed, and Flutter's `MenuController` is a plain class apps extend (its `final` modifier was removed for that).
Affect: an anchor is given `controller.as_menu_controller()`, and `MenuController::maybe_of` returns an `AnyMenuController`.
## widgets/raw_tooltip.rs → raw_tooltip.dart
- Change: the list of open tooltips (`RawTooltip._openedTooltips`), and `_RenderExclusiveMouseRegion`'s `isOutermostMouseRegion` / `foundInnermostMouseRegion`, are kept per `App` (an `app.singleton`), not in Dart statics.
Reason: language — Dart's statics are isolate-global.
Affect: `RawTooltip::dismiss_all_tool_tips(app)` dismisses only that `App`'s tooltips, and two `App`s can each show a hovered tooltip at once.
- Change: `RawTooltipState::ensure_tooltip_visible` cannot be called after the state is disposed.
Reason: language — the arena frees the state at the checkpoint after its element unmounts, unless a `Ref` keeps it, while Dart keeps the object until it is collected.
Affect: calling it on a stale handle panics, where Dart returns false; reaching it through a `GlobalKey`, as Material's `TooltipState` does, gives `None` (Dart's `?? false`).
## widgets/form.rs → form.dart
- Change: `FormField` and `FormFieldState` are leaves of `FormFieldLeaf` and `FormFieldStateLeaf`, with the shared bodies as associated functions on `FormFieldState`; a `FormState` holds its fields as `DynamicFormFieldState` (Dart's `FormFieldState<dynamic>`), whose `value` is a `&dyn Any` and whose `typed::<T>()` answers Dart's `is FormFieldState<T>`, and a builder is handed `AnyFormFieldState<T>`, which `downcast::<S>` narrows to the leaf as Dart's `field as S`.
Reason: language — no subclassing of a generic class, and the form's fields have mixed value types.
Affect: a subclass such as `TextFormField` overrides `did_change`, `reset` and `restore_state` on its own state and calls `FormFieldState::did_change(self, ..)` where Dart writes `super`; a caller reads a field's value from the form's `fields` by downcasting it or by `typed::<T>()`.
## widgets/dismissible.rs → dismissible.dart
- Change: `confirm_dismiss` returns a `Task<Option<bool>>`, and the resize starts after it resolves, at the next checkpoint.
Reason: language — waft-foundation's `Task` entry.
Affect: when the slide ends inside a frame, the child is replaced by the collapsing background, or `on_dismissed` runs when there is no `resize_duration`, one frame later than in Flutter.
- Change: Dart's `secondaryBackground == null || background != null` constructor assert runs when the widget is turned into a `WidgetRef` (`into_widget`).
Reason: language — `background` and `secondary_background` arrive through fluent setters after `new`, so the pair is only complete once the chain ends.
Affect: a secondary background without a background panics where the dismissible is handed to the tree, not on its first build.
## widgets/page_view.rs → page_view.dart
- Change: Dart's `scrollCacheExtent == null || (scrollCacheExtent.value > 0.0) == allowImplicitScrolling` constructor assert runs when the widget is turned into a `WidgetRef` (`into_widget`).
Reason: language — `allow_implicit_scrolling` and `scroll_cache_extent` arrive through fluent setters after `new`, so the pair is only complete once the chain ends.
Affect: an inconsistent pair panics where the page view is handed to the tree, not on its first build.
## widgets/layout_builder.rs → layout_builder.dart
- Change: `LayoutBuilder`'s builder receives an `AnyBoxConstraints`, and the element compares it, extension included, to decide whether the builder runs again.
Reason: language — the constraints are a `BoxConstraints` subclass instance only through rendering's wrapper (D17).
Affect: a builder reads fields through deref and calls `.constraints()` to hand the plain value on; a parent that changes only a subclass field reruns the builder, as in Dart.
## widgets/reorderable_list.rs → reorderable_list.dart
- Change: `EdgeDraggingAutoScroller` keeps its `on_scroll_view_scrolled` callback after `stop_auto_scroll`, so an animation in flight when the list's state is freed calls the state's `handle_scrollable_auto_scrolled` once after disposal, as Dart's `_scroll` calls `_handleScrollableAutoScrolled` on the disposed state.
Reason: language — the callback is a tear-off of the state's handle, which the arena skips once the state is freed, where Dart's bound method keeps the disposed state alive and runs.
Affect: a debug build logs "a listener whose receiver was freed without removing it was skipped" when a list is torn down with an auto-scroll animation in flight; the call does nothing in either.
## widgets/autocomplete.rs → autocomplete.dart
- Change: `RawAutocomplete`'s options builder returns a task, and a builder with its options at hand returns a ready one.
Reason: language — Rust has no union of a value and a future, as Dart's `FutureOr` is.
Affect: every options builder is written as returning a task, and its options reach the state at the next checkpoint either way, as Dart's await delivers even a plain value in a microtask.
- Change: `RawAutocomplete`'s first constructor shows an option by its `Display` form, and a second constructor takes the function that turns an option into text.
Reason: language — every Dart object has the `toString` Dart's default calls, and a Rust type has a `Display` form only when it implements one.
Affect: an option type without a `Display` form is built with the second constructor.
- Change: `RawAutocomplete` compares a newly selected option with the current selection by the option type's equality.
Reason: language — a Rust value has no identity, which Dart's default equality compares.
Affect: selecting an option equal to the current one does nothing, where Dart selects a distinct object with equal fields again.
## heroes.rs → heroes.dart
- Change: a hero's tag is Dart's `Object`, erased as `Rc<dyn AnyEq>`, and a tag is made by wrapping the value: `Rc::new("photo")`.
Reason: language — a tag is only compared with `==` and hashed, so one erased trait in `waft-foundation` serves it where Dart's `Object` needs no declaration.
Affect: a tag is a shared trait object; two tags of different types never match, as two Dart objects of different classes do not.
## Widget, state and element diagnostics
- Change: each class's own `debugFillProperties` is a method on its kind trait, and a superclass body that is not `Widget`/`State`/`Element` is one shared function or bag method the subclass calls at Dart's position: `Align::fill_properties` (`Center`), `FlexConfiguration` (`Row`, `Column`), `ImplicitlyAnimatedWidgetData` (every implicit animation widget), `Flexible::fill_properties` (`Expanded`), `ScrollViewData` and `BoxScrollViewData` (`ListView`, `GridView`, `CustomScrollView`), `IconThemeData` (`IconTheme`), `PlatformMenuItemBase` (`PlatformMenu`, `PlatformMenuItemGroup`, `PlatformProvidedMenuItem`), `FocusOrder`, and the ticker-provider mixin bodies.
Reason: language — Rust has no `super` call, and a trait default cannot call the body an implementor overrides.
Affect: none; a dump's properties and their order are Dart's.
- Change: `AnimatedWidget.listenable` prints the kind and a hash (`Listenable#00012`) where Dart prints the object's own `toString`.
Reason: language — the listenable is an `Rc<dyn Listenable>`, which carries no runtime class name or kind.
Affect: a transition's `listenable` line names no value, where Dart shows the animation's status and value.
- Change: a widget held in a property is added as a diagnostics node: `SliverFillRemaining.child` is the child widget's own node.
Reason: language — Rust has no `Widget.toString` that collects a widget's properties without minting a node.
Affect: the child's properties show, where Dart's `DiagnosticsProperty<Widget>` prints the same node in one line.
- Change: `Actions`'s map prints each key as its `TypeId` and the default dispatcher as `ActionDispatcher#…`.
Reason: language — a Rust `TypeId` carries no name, and a zero-sized `PlainActionDispatcher` has no identity.
Affect: a non-empty actions map's keys are not intent class names; the default dispatcher's hash names no object.
- Change: a `CustomClipper`, a `LayoutId.id`, a `Hero.tag` and a `MetaData.metaData` print their `Debug` form, or `Instance of '…'` for a value with no `Display`.
Reason: language — an erased Rust value has no runtime class name.
Affect: `clipper: Instance of 'CustomClipper<Rect>'`, `id: [<1>]`, `tag: "photo"` and `metaData: Instance of 'Object'`, where Dart prints the object's own `toString`.
- Change: a ticker-provider mixin's `ticker`/`tickers` line is added only by a state whose own body calls the mixin body; `ScrollableState` does.
Reason: language — no mixin linearization: the framework adds `State`'s lines, not a mixin's.
Affect: a state that mixes in a ticker provider but does not call the body shows no ticker line.
## Deferred
- platform_selectable_region_context_menu_web.dart: the web context menu, a registered platform view over a DOM element. Trigger: a web host.
- scrollable.rs: scrollable_selection_test.dart's horizontal and reversed variants, double- and triple-click drags, handle-drag scrolls, the two padding cases and the 'Complex cases' after 'selection starts outside of the scrollable'. Trigger: the next edit of the scrollable's selection delegate.
- selectable_region.rs: selectable_region_test.dart's cases beyond the mouse, spy, keyboard-granular and handle-drag ones ported (double- and triple-click drags, shift-click, directional extension, the toolbar and magnifier cases, onSelectionChanged, SelectionListener). Trigger: the next edit of `SelectableRegion`'s gestures or actions; `SelectionListener`.
- raw_tooltip.rs: the `SemanticsService.tooltip` announcement. Trigger: the semantics tree.
- form.rs: `Form.onWillPop`, the `WillPopScope` it builds, and the deprecated `Form.onPopInvoked`. Trigger: `WillPopScope` (deferred; Flutter deprecates both).
- form.rs: the error announcement `FormState._validate` sends through `SemanticsService`. Trigger: the semantics tree.
- stretch_effect.rs: the shader stretch (`_StretchOverscrollEffect`, `_StretchEffectPainter`, `_StretchEffectShader` and the `ImageFilter.isShaderFilterSupported` branch), so the stretch is always the matrix scale Flutter uses where shader filters are unsupported. Trigger: the next edit of stretch_effect.rs (embedder's `FragmentProgram` and `ImageFilter::shader` exist).
- snapshot_widget.rs: `SnapshotWidget`'s raster path (`_paintAndDetachToImage`: painting into an `OffsetLayer`, the `supportsRasterization` platform-view check with its `SnapshotMode` branches, `toImageSync`, and `paintSnapshot` with that raster). Trigger: `OffsetLayer.toImageSync`.
- snapshot_widget.rs: `SnapshotPainter`'s memory-allocation events (`kFlutterMemoryAllocationsEnabled`). Trigger: leak tracking.
- media/subtitle_painter.rs: Media3's `BidiUtils` wrapping of each right-to-left line of a cue before it is laid out. Trigger: the first right-to-left subtitles.
- image.rs: `Image.network` and `Image.file`. Trigger: an HTTP client; a file system.
- image.rs: `Image.asset`'s bundle lookup, and the bundle `createLocalImageConfiguration` would carry, without which `AssetImage` cannot resolve from a widget. Trigger: `DefaultAssetBundle`.
- image.rs: the frame, loading and error builders, and `gaplessPlayback`. Trigger: a caller that wants to show something while an image loads or after it fails.
- image.rs: `precacheImage`. Trigger: a caller that warms an image before showing it.
- image.rs: `color` / `colorBlendMode`, `centerSlice` and `filterQuality`. Trigger: painting's colour filters; an image drawn as a resizable frame; a caller that needs to choose how an image is sampled.
- focus_manager.rs: `FocusNode.onKey` and the Android IME key check. Trigger: services' raw key path.
- focus_manager.rs, focus_scope.rs: `FocusManager`'s semantics action listener (`handleSemanticsAction`). Trigger: the semantics tree.
- focus_manager.rs, focus_scope.rs: the `debugDumpFocusTree` helpers and the debug focus border. Trigger: a focus-tree dump; the debug focus border.
- focus_scope.rs: `_FocusInheritedScope` keeps the copy of the inherited-notifier element it grew before inherited_notifier.rs was ported. Trigger: the next change to that element.
- framework/: `ErrorWidget` with its exception reporting, and the build-time diagnostics and duplicate-key checks, `Table`'s checks for duplicate row and cell keys among them. Trigger: diagnostics.
- platform_menu_bar.rs: `PlatformMenuBar.debugDescribeChildren`, the menu items under a menu bar's dump. Trigger: a widget-level `debugDescribeChildren` (deferred in `framework/`).
- ticker_provider.rs: the ticker-provider mixins' `ticker`/`tickers` lines on states whose own `debugFillProperties` does not call the mixin body; the mixin bodies exist (`SingleTickerProviderStateMixin::debug_fill_properties`, `TickerProviderStateMixin::debug_fill_properties`). Trigger: each such state's next diagnostics edit.
- image.rs: `_ImageState`'s `loadingProgress`, `frameNumber` and `wasSynchronouslyLoaded` lines, with the frame and loading builders. Trigger: those builders.
- framework/: `reassemble`. Trigger: hot reload.
- binding.rs: the observer callbacks no host reports (memory pressure, pushed routes and route information, the text scale, accessibility features), `scheduleWarmUpFrame`. Trigger: a host that reports those events.
- binding.rs: the host callback that reports a predictive back gesture to `WidgetsBinding::handle_start_back_gesture`, `handle_update_back_gesture_progress`, `handle_commit_back_gesture` and `handle_cancel_back_gesture` (Flutter's `SystemChannels.backGesture`). Trigger: a host that reports back gestures.
- platform_menu_bar.rs: `PlatformMenuItem.onOpen` and `onClose`, and the tooltip. Trigger: a host that reports a menu opened or closed.
- binding.rs: first-frame-rasterized reporting and the push/pop route handlers. Trigger: `SchedulerBinding.addTimingsCallback`; navigation.
- view.rs: the view's semantics owner callbacks. Trigger: the semantics tree.
- view.rs, overlay.rs: the hidden-by-a-`LookupBoundary` variants of the `View.of` and `Overlay.of` error messages. Trigger: diagnostics.
- form.rs, page_storage.rs, tap_region.rs: the 'The context used was' lines print the widget's type where Dart describes the element. Trigger: diagnostics.
- `debugCheckHasDirectionality` in the widgets that resolve a directional value (the check is in debug.rs). Trigger: each such widget's next edit.
- selectable_region.rs: `SelectionListener`, `SelectionDetails`, `SelectionListenerNotifier`, the deprecated `TextSelectionDelegate` members and the iOS-web double-tap quirks. Trigger: the first caller of a selection listener; a web host.
- text.rs: `locale`, `hyphens`, and the deprecated `textScaleFactor`; `Text`'s selection container and `_RichText` carry none of them either. Trigger: `Locale` (the embedder's exists); `Hyphens`.
- basic.rs: `Flow`, `RotatedBox`, `IgnoreBaseline`, `ShaderMask`, `RawImage`, `WidgetToRenderBoxAdapter`. Trigger: each one's render object.
- basic.rs: `RepaintBoundary.wrap` and `wrapAll`, `DefaultAssetBundle`. Trigger: the sliver child delegates that call them; asset bundles.
- basic.rs: `SliverSemantics`, which waits on `RenderSliverSemanticsAnnotations`, and the semantics flags on the pointer and opacity widgets, which only feed `visitChildrenForSemantics`. Trigger: a `SliverSemantics` caller; the semantics tree.
- basic.rs: the inspector-only transform labels. Trigger: diagnostics.
- visibility.rs: `SliverVisibility`. Trigger: `SliverOpacity`, `SliverIgnorePointer` and `SliverOffstage`.
- visibility.rs: what `Visibility.maintainSemantics` controls. Trigger: the semantics tree.
- ticker_provider.rs: `TickerMode.merge`. Trigger: the next edit of ticker_provider.rs (`Builder` exists).
- transitions.rs: `SliverFadeTransition`, and with it implicit_animations.rs's `SliverAnimatedOpacity`. Trigger: `SliverOpacity`'s render sliver.
- transitions.rs, implicit_animations.rs: `SliverFadeTransition`'s and `SliverAnimatedOpacity`'s diagnostics, with those slivers. Trigger: `SliverOpacity`'s render sliver.
- icon_theme: `IconThemeData.hashCode` (no `Hash` over `f64`). Trigger: a map keyed by `IconThemeData`.
- gesture_detector.rs: the semantics gesture handling (`excludeFromSemantics`, `semantics`, `_GestureSemantics`), and the double-tap and force-press callbacks. Trigger: the semantics tree; `DoubleTapGestureRecognizer`; a caller of the force-press callbacks.
- media_query.rs: `DisplayFeature`, `SystemTextScaler`, the platform sources for the accessibility flags, 24-hour format, text style overrides and corner radii, and the media-query debug checks. Trigger: observers in binding.rs; those members on `Platform` / `ViewMetrics`; diagnostics.
- widget_state.rs: `WidgetStatesController` as a `ValueListenable`, and hashing. Trigger: the first caller that listens to a controller as a value; theme-data hashing.
- localizations.rs: the localization debug checks. Trigger: diagnostics.
- banner.rs: repaint on `PaintingBinding.systemFonts`. Trigger: a host reporting system font changes.
- app.rs: `WidgetsApp.router` and every router field it fills, with their branches of `_updateRouting` and `build`. Trigger: `router.dart`.
- app.rs: the state's route-push handlers. Trigger: the binding's pushed-route events.
- app.rs: the performance overlay, semantics debugger and widget inspector the three carried debug flags would show. Trigger: `performance_overlay.dart`; the semantics tree; `widget_inspector.dart`.
- default_text_editing_shortcuts.rs: the Control-key editing bindings macOS supplies from its own key tables (Control-A, Control-E, Control-K, Control-D), which Dart's macOS map leaves to the host. Trigger: nothing else supplies them over a host that reports plain key presses.
- editable_text.rs: scribble and stylus support but the selection rects (`_ScribbleFocusable`, `_ScribblePlaceholder`, and `_ScribbleCacheKey`'s strut style and placeholder), the spell-check fetch, the magnifier overlay, the floating cursor and `insertContent`; the scroll notification's `_handleContextMenuOnScroll`. Trigger: `UndoManagerClient`; `RenderEditable.setFloatingCursor`; Scribble on the iOS host.
- editable_text.rs: `Semantics(inputType:, onCopy:, onCut:, onPaste:)`. Trigger: the next edit of editable_text.rs.
- text_selection.rs: `EmptyTextSelectionControls`. Trigger: its first caller.
- text_selection.rs: the outer `TapRegion(groupId: SelectableRegion)` around the toolbar wrapper and around each selection handle. Trigger: `SelectableRegion`.
- feedback.rs: the system sound in `for_tap` and iOS `for_long_press`, and the semantic events they send. Trigger: services' `SystemSound`; the semantics tree.
- text_selection.rs: the Android stylus path and the `Scribe` availability check in `onTapDown`. Trigger: host `Scribe`.
- tap_region.rs: the surface's semantics listeners and semantics action handling. Trigger: the semantics tree.
- layout_builder.rs: `SliverLayoutBuilder` with the abstract generic builders, and the error widget on a builder panic. Trigger: the next edit of layout_builder.rs (slivers exist); diagnostics.
- sliver.rs: `SliverOpacity`, `SliverIgnorePointer`, `SliverOffstage`, `SliverConstrainedCrossAxis`, `SliverCrossAxisExpanded`, `SliverCrossAxisGroup` and `SliverMainAxisGroup`. Trigger: each one's render sliver.
- sliver.rs: `SliverEnsureSemantics`. Trigger: the semantics tree.
- Two-dimensional scrolling: the two-dimensional viewport, its scrollable and scopes, its child delegates, `DiagonalDragBehavior`, and sliver.rs's `KeepAlive` under such a viewport. Trigger: `two_dimensional_viewport.dart`.
- scroll_delegate.rs: the delegate description's exception branch. Trigger: diagnostics.
- Scroll semantics: `ScrollContext.setSemanticsActions`, scrollable.rs's semantics widget and its render object with `excludeFromSemantics` and `semanticChildCount`, and scroll_position.rs's semantic action bookkeeping. Trigger: the semantics tree.
- scrollable.rs: `ScrollableDetails.hashCode` (no `Hash` over an erased physics). Trigger: a map keyed by scrollable details.
- single_child_scroll_view.rs: the semantics clip and the approximate paint clip (deferred crate-wide in rendering's PORTING.md). Trigger: the semantics tree; the inspector.
- scrollbar.rs: the painter's semantics and the structured error reports, which are plain assert messages here. Trigger: the semantics tree; diagnostics.
- toggleable.rs: the tap's `TapSemanticEvent`. Trigger: the semantics tree.
- radio_group.rs: the post-frame check that at most one radio carries the group value. Trigger: diagnostics, and a post-frame callback usable from a state that may run without a binding.
- shortcuts.rs: the deprecated `isActivatedBy` and the duplicate-shortcut check. Trigger: content equality on `ShortcutActivator`; diagnostics.
- navigator.rs, routes.rs, pop_scope.rs: the members Dart deprecates in favour of the pop-with-result and mark-for-complete ones. Trigger: never — port them only if Flutter un-deprecates them.
- navigator.rs: restoring the focused semantic node after a pop. Trigger: the semantics tree.
- navigator.rs: the navigator diagnostics and the error reports around route generation. Trigger: diagnostics.
- routes.rs: the latency performance mode a transition requests from the engine. Trigger: scheduler's `requestPerformanceMode`.
- routes.rs: `ModalRoute`'s deprecated scoped will-pop callbacks, whose list everything else reads as always empty. Trigger: an async `WillPopCallback`, which needs an event loop — Flutter's own replacement `PopScope` is ported.
- routes.rs: `RawDialogRoute.anchorPoint` with the display-feature sub-screen, so `showGeneralDialog` has no `anchorPoint`. Trigger: `display_feature_sub_screen.dart`, which needs `MediaQuery.displayFeatures`.
- modal_barrier.rs: the barrier's `_SemanticsClipper`. Trigger: the semantics tree.
- modal_barrier.rs: the alert sound when a non-dismissible barrier is tapped. Trigger: services' `SystemSound`.
- overlay.rs: the theater's intrinsics, dry layout and baselines, and the deferred layout box's dry baseline. Trigger: intrinsics and baselines through a theater child.
- overlay.rs: the stack trace an invalidated entry location records (a flag stands in). Trigger: diagnostics.
- overlay.rs: the overlay's semantics wrappers with their `traversalParentIdentifier` child identifiers, and its semantics updates. Trigger: the next edit of overlay.rs (the semantics widgets exist); the semantics tree.
- overlay.rs: the theater's clip layer handle and the entry location's compositing-bits update. Trigger: layer handles and compositing bits in `waft-rendering`.
- overlay.rs: the deferred-child gates on the theater's `markNeedsLayout` and the layout box's dirty flag. Trigger: a public `RenderBox` super-hook for `markNeedsLayout` and a readable dirty flag in `waft-rendering`.
- heroes.rs: the structured report behind the duplicate-tag check (a `debug_assert!` carrying Dart's message meanwhile). Trigger: diagnostics.
- reorderable_list.rs: 'SliverReorderableList item has correct semantics' and 'SliverReorderableList custom semantics action has correct label'. Trigger: the semantics tree.
- reorderable_list.rs: 'When creating a new item, be in the correct position'. Trigger: `Finder.hitTestable(at:)` in `waft_widgets::testing`.
- reorderable_list.rs: 'Tests the correctness of the drop animation in various scenarios'. Trigger: `WidgetTester.timedDrag` in `waft_widgets::testing`.
- autocomplete.rs: the results-found and no-results announcements, and autocomplete_test's three announcement cases. Trigger: the semantics tree.
- autocomplete.rs: the two "when field scrolled offscreen" cases (desktop and mobile). Trigger: flutter_test's `scrollUntilVisible` in `waft_widgets::testing`.
## Skipped
- reorderable_list.rs: the second 'ReorderableList supports items with nested list views without throwing layout exception.', a repeat of the first in Dart's file.
- async.dart: the future builder and the stream builder; a Waft app's entities and tasks already rebuild a widget when a value arrives, so they gain it nothing.