Expand description
Flutter’s dart:ui: host traits (Platform, View) and value types
(Offset, Color, Canvas, Paint, Shadow).
The framework depends on this crate. This crate does not depend on the
framework. Hosts implement Platform and View, and invoke
EmbedderClient on the client the start closure returns. They do not
name App.
Re-exports§
pub use valo;
Structs§
- Application
Switcher Description - Specifies a description of the application that is pertinent to the embedder’s application switcher (also known as “recent tasks”) user interface.
- Autofill
Configuration - A collection of autofill related information that represents an
AutofillClient. - Backdrop
Backdropfilters the sampled scene before a save layer’s children paint.- Color
- An immutable color value in ARGB format.
- Font
Collection FontCollectionowns registered faces and sources for resolving missing fonts.- Font
Demand FontDemanddescribes font requests that no registered face could satisfy.- Font
Feature - A feature tag and value that affect the selection of glyphs in a font.
- FontId
FontIdidentifies a registered font within aFaceSetorFontCollection.- Font
Variation - An axis tag and value that can be used to customize variable fonts.
- Font
Weight - The thickness of the glyphs used to draw the text.
- Frame
- One complete engine frame delivered to the client.
- Gesture
Settings - A
nullfield indicates that the platform or view does not have a preference and the fallback constants should be used instead. - Glyph
Info - The measurements of a character (or a sequence of visually connected characters) within a paragraph.
- Image
Imageis a cheap-to-clone handle to an immutable GPU image.- Image
Frame - One decoded frame, prepared and ready to draw. Flutter dart:ui
FrameInfo. - Inert
Platform - Platform for hand-pumped tests.
- Instant
- A measurement of a monotonically nondecreasing clock.
Opaque and useful only with
Duration. - KeyData
- Information about a key event.
- Line
Metrics LineMetricsstores the measurements and statistics of a single line in the paragraph.- Locale
- An identifier used to select a user’s language and formatting preferences.
- Mask
Blur MaskBlurapplies a Gaussian blur to a draw’s coverage mask.- Matrix4
Matrixis a full 4×4 column-major transform.- Offset
- An immutable 2D floating-point offset.
- Paint
Paintdescribes how a drawing operation produces and composites pixels.- Paragraph
- A paragraph of text.
- Paragraph
Builder - Builds a
Paragraphcontaining text with the given styling information. - Paragraph
Constraints - Layout constraints for
Paragraphobjects. - Paragraph
Style - An opaque object that determines the configuration used by
ParagraphBuilderto position lines within aParagraphof text. - Path
Pathis an immutable collection of line and Bézier contours.- Path
Builder PathBuilderrecords commands used to create an immutablePath.- Pointer
Data - Information about the state of a pointer.
- Pointer
Data Packet - A sequence of reports about the state of pointers.
- Quaternion
- A rotation as a unit quaternion.
- RRect
- An immutable rounded rectangle with the custom radii for all four corners.
- RSuperellipse
- An immutable rounded superellipse.
- Radius
- A radius for either circular or elliptical shapes.
- RawFloating
Cursor Point - The current state and position of the floating cursor.
- Rect
- An immutable, 2D, axis-aligned, floating-point rectangle whose coordinates are relative to a given origin.
- Restoration
Update - What the host answers when the framework asks for the restoration data it stored.
- Scene
Builder - Builds a
Scenecontaining the given visuals. - Shadow
- A representation of a shadow.
- Size
- Holds a 2D floating-point size.
- Stroke
Strokedescribes the width, ends, joins, and optional dash pattern of a line.- System
Font Source - The engine’s font manager: the platform’s installed fonts through a
FontManager, and the two family names Flutter’s engine defines for the platform’s own user-interface font. - System
UiOverlay Style - Specifies a system overlay style for a portion of the app.
- TextBox
- A rectangle enclosing a run of text.
- Text
Decoration - A linear decoration to draw near the text.
- Text
Editing Value - The current text, selection, and composing state for editing a run of text.
- Text
Height Behavior - Defines how to apply
TextStyle.heightover and under text. - Text
Input Configuration - Controls the visual appearance of the text input control.
- Text
Input Type - The type of information for which to optimize the text input control.
- Text
Position - A position in a string of text.
- Text
Range - A range of characters in a string of text.
- Text
Selection - A range of text that represents a selection.
- Text
Style - An opaque object that determines the size, position, and rendering of text.
- Typeface
Typefaceis one face the platform matched: a font file, the face’s index in it, and how the platform names and styles that face.- Vector3
- A three-dimensional vector.
- View
Constraints - Immutable layout constraints for a view (
dart:uiViewConstraints). - View
Focus Event - An event for the engine to communicate view focus changes to the app.
Flutter counterpart:
ViewFocusEventindart:ui/platform_dispatcher.dart. - ViewId
- Opaque id for one
View(FlutterView.viewId). - View
Metrics - Per-view geometry the host reports (
_ViewConfigurationfields we use). - View
Padding - Physical padding on each side of a view (
dart:uiViewPadding). - Window
Config - How a window is made. Sizes and positions are logical, in the host’s screen space with the origin at the top left of the primary screen.
Enums§
- AppExit
Response - The possible responses to a request to exit the application.
- AppLifecycle
State - States that an application can be in once it is running.
- Blend
Mode BlendModecontrols how source pixels combine with destination pixels.- Blur
Style BlurStylecontrols where blurred coverage appears relative to a shape.- BoxHeight
Style - Defines various ways to vertically bound the boxes returned by
Paragraph::get_boxes_for_range. - BoxWidth
Style - Defines various ways to horizontally bound the boxes returned by
Paragraph::get_boxes_for_range. - Brightness
- Describes the contrast of a theme or color palette.
- Clip
- Different ways to clip content.
- ClipOp
ClipOpcontrols how a clip shape changes the current clip.- Color
Filter - A description of a color filter to apply when drawing a shape or compositing
a layer with a particular
Paint. A color filter is a function that takes two colors, and outputs one color. When applied during compositing, it is independently applied to each pixel of the layer being drawn before the entire layer is merged with the destination. - Color
Space - The color space describes the colors that are available to an
Image. - Fill
Rule FillRuledetermines which regions of overlapping contours are filled.- Floating
Cursor Drag State - The state of a “floating cursor” drag on an iOS soft keyboard.
- Font
Style - Whether to use the italic type variation of glyphs in the font.
- Haptic
Feedback Type - The kind of haptic feedback to play.
- Image
Decode Error - Why an image could not be read. Flutter reports these as an exception on the codec future.
- Image
Filter - A filter operation to apply to a raster image.
- Image
Repetition - How an animation repeats once it has played through.
- KeyEvent
Device Type - The source device for the key event.
- KeyEvent
Type - The type of a key event.
- Matrix
Kind MatrixKindclassifies the behavior relevant to two-dimensional rendering.- Paint
Style PaintStyleselects filled geometry or a stroked outline.- Placeholder
Alignment - Where to vertically align the placeholder relative to the surrounding text.
- Pointer
Change - How the pointer has changed since the last report.
- Pointer
Device Kind - The kind of pointer device.
- Pointer
Signal Kind - The kind of pointer signal event.
- Popup
Menu Entry - One line of a popup menu the host shows with its own menu system.
- RawWindow
Handle - A window handle for a particular windowing system.
- Restoration
Data - One value in the restoration data, of the kinds
StandardMessageCodeccan carry. - Smart
Dashes Type - Indicates how to handle the intelligent replacement of dashes in text input.
- Smart
Quotes Type - Indicates how to handle the intelligent replacement of quotes in text input.
- System
Context Menu Item - A button to show in the system-rendered context menu.
- System
Mouse Cursor Kind - A system cursor kind (
SystemMouseCursor.kind). The host maps each to its native cursor and shows the basic arrow for one it lacks;Nonehides the cursor. - Target
Platform - The platform that user interaction should adapt to target.
- Text
Affinity - A way to disambiguate a
TextPositionwhen its offset could match two different locations in the rendered string. - Text
Align - Whether and how to align text horizontally.
- Text
Baseline - A horizontal line used for aligning text.
- Text
Capitalization - Configures how the platform keyboard will select an uppercase or lowercase keyboard.
- Text
Decoration Style - The style in which to draw a text decoration
- Text
Direction - A direction in which text flows.
- Text
Input Action - An action the user has requested the text input control to perform.
- Text
Leading Distribution - How the leading of the text is distributed over and under the text.
- View
Focus Direction - Represents the direction in which focus transitioned across views.
- View
Focus State - Represents the focus state of a given view.
- Window
Background - What the window shows behind the app’s painting. Anything but
Solidlets what is behind the window show where the app paints nothing. - Window
Error - Window
Level
Constants§
- K_
TEXT_ HEIGHT_ NONE - A
TextStyle.heightvalue that indicates the text span should take the height defined by the font, which may not be exactly the height offontSize.
Traits§
- Canvas
Text - Paragraph drawing on a
Canvas(Dart’sCanvas.drawParagraph). - Clipboard
- The system clipboard: Flutter’s
Clipboardover the platform channel. - Embedder
Client - Complete frames and typed view lifecycle notifications.
- Font
Manager FontManageris the platform’s font lookup, in the shape of Skia’sSkFontMgr.- Font
Source FontSourcelocates fonts that are not already registered.- Haptics
- Flutter’s
HapticFeedback. - Host
Window - A window the host has on screen. Its
viewis what the framework draws into and receives input from, like the implicit view. - Image
Codec - One encoded image, opened and ready to give up its frames. Flutter dart:ui
Codec. - Mouse
Cursor - Flutter’s mouse cursor channel.
- Platform
- The long-lived host object held by the application.
- Popup
Menus - A native pop-up menu shown at the pointer, answered with the index chosen.
- Restoration
- Flutter’s restoration channel: state kept across relaunches.
- System
Chrome - Flutter’s
SystemChrome: the system UI around the app. - System
Context Menu - Flutter’s
SystemContextMenu: the system’s own menu over a text selection. - Text
Input Host - The host side of Flutter’s text input connection for one view.
- Text
Services - The text services a selection toolbar offers: Flutter’s LookUp, SearchWeb and Share platform-channel calls.
- View
- A stable handle to one host-provided view.
- Windowing
Owner - The host’s window maker.
Nonefromcrate::Platform::windowing_ownerwhere the implicit view is the only one there can be.
Functions§
- clamp_
double - Same as
f64::clampbut maps NaN tomax. - compose
- Composes a matrix from
translation,rotationandscale. - decompose
- Decomposes
matrixinto its translation, rotation and scale components. - default_
font_ families - Flutter
txt::GetDefaultFontFamilies(): the family namesFontCollection::setDefaultFontManagerlooks up when a style leavesfontFamilyunset. - flattened_
ops - The picture’s operations in replay order with every embedded list’s following its embedding op, for a test or a diagnostic that asks what a scene draws regardless of how its layers nested it.
- lerp_
double - Linearly interpolate between two numbers,
aandb, by an extrapolation factort. - lerp_
int - Linearly interpolate between two integers.
- rrect_
radii_ elliptical - Per-corner elliptical radii in valo’s order (clockwise from top-left).
- rsuperellipse_
radii_ elliptical - Per-corner elliptical radii in valo’s order (clockwise from top-left).
- set_
default_ font_ manager - Flutter
skia::textlayout::FontCollection::setDefaultFontManager: register the default family’s faces as the collection’s fallback chain, then keepsourcefor later lookups. - transform3
- Transforms a point as a 3-vector, with no perspective division.
Type Aliases§
- Canvas
- Flutter
Canvas— valo records into a display list. - Engine
Layer - Flutter
EngineLayer— the display list a layer’s subtree recorded when it was last added to a scene, whichSceneBuilder::add_retainedembeds again while nothing in it changed. The engine keeps a node of its layer tree; valo keeps a nested list. - Image
Codec Future - A codec being opened. Flutter’s
Future<ui.Codec>. - Image
Frame Future - A frame being decoded. Flutter’s
Future<ui.FrameInfo>. - Picture
- Flutter
Picture— a finished display list, whatcrate::View::presenttakes (FlutterFlutterView.rendertakes aScene). - Platform
Ref - Restoration
Map - Flutter’s
Map<Object?, Object?>of restoration data: insertion-ordered, keyed by value. - Scene
- Flutter
Scene— whatSceneBuilder::buildproduces andcrate::View::presenttakes. - ViewRef
- Window
Future - A window being made: the host finishes it on its own loop.
- Window
Ref