ui

package
v1.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2026 License: BSD-3-Clause Imports: 23 Imported by: 3 modules, 13 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ui is the engine API: geometry, Color, Paint, Path, Canvas, Scene, Paragraph, images, views and input events.

Flutter: dart:ui (engine/src/flutter/lib/ui).

Index

Constants

View Source
const (
	// ClipboardFormatText is plain text (UTF-8).
	//
	// Flutter: services/clipboard.dart Clipboard.kTextPlain
	ClipboardFormatText = "text/plain"
	// ClipboardFormatPNG is an image in the PNG format.
	//
	// Flutter: no counterpart
	ClipboardFormatPNG = "image/png"
	// ClipboardFormatURIList is a list of URIs, such as the files that a file
	// manager copied ("file:///home/me/a.txt").
	//
	// Flutter: no counterpart
	ClipboardFormatURIList = "text/uri-list"
	// ClipboardFormatHTML is a fragment of HTML (UTF-8), such as the markup that a
	// rich text editor pastes as formatted text.
	//
	// Flutter: no counterpart
	ClipboardFormatHTML = "text/html"
)

The formats of the clipboard content, as MIME types.

View Source
const (
	// TagPointerLockUnavailable is the tag of the error of a lock that the platform cannot make: Wayland without
	// zwp_pointer_constraints_v1 and zwp_relative_pointer_manager_v1, a host without windows, a window that does not
	// exist.
	//
	// Flutter: no counterpart
	TagPointerLockUnavailable = "PointerLockUnavailable"
	// TagPointerLockDenied is the tag of the error of a lock that the platform refuses: the web, outside a user
	// gesture.
	//
	// Flutter: no counterpart
	TagPointerLockDenied = "PointerLockDenied"
)

The tags of the errors of the pointer lock (SPEC §27.6, §27.11). The platforms make them; widgets.PointerLock returns them.

View Source
const CaretBlinkNever time.Duration = -1

CaretBlinkNever is the CaretBlinkTime of a system whose user turned the caret's blinking off: the caret of a text field stays on.

Flutter: no counterpart

View Source
const TextHeightNone = 0.0

TextHeightNone is the sentinel for TextStyle heights: it asks the line to use the font's own height.

Flutter: ui/text.dart kTextHeightNone

Variables

View Source
var AllWindowCapabilities = WindowCapabilities{WindowMenu: true, Maximize: true, Fullscreen: true, Minimize: true}

AllWindowCapabilities is every capability: what a window has when the compositor does not say (xdg_wm_base below version 5).

Flutter: no counterpart

View Source
var OffsetInfinite = Offset{math.Inf(1), math.Inf(1)}

OffsetInfinite is an offset with infinite x and y components.

Flutter: ui/geometry.dart Offset.infinite

View Source
var OffsetZero = Offset{}

OffsetZero is an offset with zero magnitude.

Flutter: ui/geometry.dart Offset.zero

View Source
var RRectZero = RRect{}

RRectZero is a RRect with all of its fields zero.

Flutter: ui/geometry.dart RRect.zero

View Source
var RSuperellipseZero = RSuperellipse{}

RSuperellipseZero is a RSuperellipse with all of its fields zero.

Flutter: ui/geometry.dart RSuperellipse.zero

View Source
var RadiusZero = Radius{}

RadiusZero is a radius with zero extent on both axes.

Flutter: ui/geometry.dart Radius.zero

View Source
var RectLargest = Rect{-giantScalar, -giantScalar, giantScalar, giantScalar}

RectLargest is a rectangle that covers the entire coordinate space, or at least a very large part of it.

Flutter: ui/geometry.dart Rect.largest

View Source
var RectZero = Rect{}

RectZero is a rectangle with left, top, right and bottom edges all at zero.

Flutter: ui/geometry.dart Rect.zero

View Source
var SemanticsFlagsNone = SemanticsFlags{}

SemanticsFlagsNone is the flags of a node with no flag set.

Flutter: ui/semantics.dart SemanticsFlags.none

View Source
var SizeInfinite = Size{math.Inf(1), math.Inf(1)}

SizeInfinite is a size whose width and height are infinite.

Flutter: ui/geometry.dart Size.infinite

View Source
var SizeZero = Size{}

SizeZero is a size whose width and height are zero.

Flutter: ui/geometry.dart Size.zero

View Source
var TextRangeEmpty = TextRange{-1, -1}

TextRangeEmpty is a range that starts and ends at -1, the invalid range.

Flutter: ui/text.dart TextRange.empty

View Source
var ViewPaddingZero = ViewPadding{}

ViewPaddingZero is a padding of zero on every side.

Flutter: ui/window.dart ViewPadding.zero

Functions

func ClampDouble

func ClampDouble(x, min, max float64) float64

ClampDouble clamps x to the range [min, max]. A NaN x gives max, as in Flutter.

Flutter: ui/math.dart clampDouble

func ColorGetAlphaFromOpacity

func ColorGetAlphaFromOpacity(opacity float64) int

ColorGetAlphaFromOpacity returns an alpha value from 0 to 255 for an opacity from 0 to 1 (clamped).

Flutter: ui/painting.dart Color.getAlphaFromOpacity

func ConvertRadiusToSigma

func ConvertRadiusToSigma(radius float64) float64

ConvertRadiusToSigma converts a blur radius to the standard deviation Skia uses for it.

Flutter: ui/painting.dart Shadow.convertRadiusToSigma

func LerpDouble

func LerpDouble(a, b, t float64) float64

LerpDouble linearly interpolates between a and b: a when t is 0, b when t is 1. Equal values, and two NaNs, give a exactly, whatever t is.

Flutter: ui/lerp.dart lerpDouble

func LerpDoubleOpt

func LerpDoubleOpt(a, b *float64, t float64) *float64

LerpDoubleOpt is LerpDouble for values that may be absent: a nil value counts as 0, and nil with nil gives nil.

Flutter: ui/lerp.dart lerpDouble

func MatrixMultiplyInPlace

func MatrixMultiplyInPlace(a, b *Matrix4)

MatrixMultiplyInPlace sets b to the product a * b, and leaves a alone.

Flutter: painting/matrix_utils.dart MatrixUtils.multiplyInPlace

func Ptr

func Ptr[T any](v T) *T

Ptr returns a pointer to v. It is for the options whose Flutter parameter is nullable, such as ColorWithValuesOpts.

Flutter: no counterpart

Types

type AccessibilityFeatures

type AccessibilityFeatures struct {
	// AccessibleNavigation is whether an assistive technology, such as a
	// screen reader, is in use.
	//
	// Flutter: ui/window.dart AccessibilityFeatures.accessibleNavigation
	AccessibleNavigation bool
	// InvertColors is whether the platform inverts the colors of the screen.
	//
	// Flutter: ui/window.dart AccessibilityFeatures.invertColors
	InvertColors bool
	// DisableAnimations is whether the user asked to turn animations off or
	// reduce them.
	//
	// Flutter: ui/window.dart AccessibilityFeatures.disableAnimations
	DisableAnimations bool
	// BoldText is whether the user asked for bold text.
	//
	// Flutter: ui/window.dart AccessibilityFeatures.boldText
	BoldText bool
	// ReduceMotion is whether the user asked to reduce motion.
	//
	// Flutter: ui/window.dart AccessibilityFeatures.reduceMotion
	ReduceMotion bool
	// HighContrast is whether the user asked for more contrast.
	//
	// Flutter: ui/window.dart AccessibilityFeatures.highContrast
	HighContrast bool
	// OnOffSwitchLabels is whether the user asked for labels on switches.
	//
	// Flutter: ui/window.dart AccessibilityFeatures.onOffSwitchLabels
	OnOffSwitchLabels bool
}

AccessibilityFeatures are the platform's accessibility settings that apply to the whole app.

Flutter: ui/window.dart AccessibilityFeatures

func (AccessibilityFeatures) String

func (f AccessibilityFeatures) String() string

String describes the features that are on, such as "AccessibilityFeatures[disableAnimations]".

Flutter: ui/window.dart AccessibilityFeatures.toString

type AddPathOpts

type AddPathOpts struct {
	// Matrix4 transforms the added path before it is moved by the offset; nil
	// means none.
	Matrix4 *Matrix4
}

AddPathOpts are the optional arguments of AddPath and ExtendWithPath.

Flutter: ui/painting.dart Path.addPath

type AddPictureOpts

type AddPictureOpts struct {
	// IsComplexHint says that the picture is expensive to draw, so it may be
	// worth caching.
	IsComplexHint bool
	// WillChangeHint says that the picture is likely to change, so it should not
	// be cached.
	WillChangeHint bool
}

AddPictureOpts are the optional arguments of AddPicture.

Flutter: ui/compositing.dart SceneBuilder.addPicture

type AddPlaceholderOpts

type AddPlaceholderOpts struct {
	// Scale multiplies the size and baseline offset; it defaults to 1.
	Scale *float64
	// BaselineOffset is the distance from the top of the box to its baseline; it defaults to the height (the bottom edge).
	BaselineOffset *float64
	// Baseline is the text baseline BaselineOffset refers to; it defaults to alphabetic.
	Baseline TextBaseline
}

AddPlaceholderOpts are the optional parameters of ParagraphBuilder.AddPlaceholder.

Flutter: ui/text.dart ParagraphBuilder.addPlaceholder

type AddTextureOpts

type AddTextureOpts struct {
	// Offset is the top left corner of the rectangle the texture is drawn into.
	Offset Offset
	// Width and Height are the size of the rectangle.
	Width, Height float64
	// Freeze says that the layer keeps showing the texture's last frame while the app resizes it.
	Freeze bool
	// FilterQuality is the quality of the scaling; the default is FilterQualityLow.
	FilterQuality FilterQuality
}

AddTextureOpts are the optional arguments of AddTexture.

Flutter: ui/compositing.dart SceneBuilder.addTexture

type AppExitResponse

type AppExitResponse int

AppExitResponse is the answer of an app to a request to exit.

Flutter: ui/platform_dispatcher.dart ui.AppExitResponse

const (
	// AppExitResponseUnspecified is the zero value; it counts as Exit.
	//
	// Flutter: no counterpart
	AppExitResponseUnspecified AppExitResponse = iota
	// AppExitResponseExit lets the app exit.
	//
	// Flutter: ui/platform_dispatcher.dart AppExitResponse.exit
	AppExitResponseExit
	// AppExitResponseCancel keeps the app running.
	//
	// Flutter: ui/platform_dispatcher.dart AppExitResponse.cancel
	AppExitResponseCancel
)

The values of AppExitResponse follow Flutter's declaration order.

func (AppExitResponse) String

func (r AppExitResponse) String() string

String returns the name of the value, such as "AppExitResponseCancel".

Flutter: ui/platform_dispatcher.dart AppExitResponse

type AppExitType

type AppExitType int

AppExitType is how an app is asked to exit: the app can refuse a cancelable exit, and cannot refuse a required one.

Flutter: ui/platform_dispatcher.dart ui.AppExitType

const (
	// AppExitTypeUnspecified is the zero value.
	//
	// Flutter: no counterpart
	AppExitTypeUnspecified AppExitType = iota
	// AppExitTypeCancelable is an exit that the app can cancel, such as the user
	// closing the last window.
	//
	// Flutter: ui/platform_dispatcher.dart AppExitType.cancelable
	AppExitTypeCancelable
	// AppExitTypeRequired is an exit that the app cannot refuse, such as the
	// system shutting down.
	//
	// Flutter: ui/platform_dispatcher.dart AppExitType.required
	AppExitTypeRequired
)

The values of AppExitType follow Flutter's declaration order.

func (AppExitType) String

func (t AppExitType) String() string

String returns the name of the value, such as "AppExitTypeCancelable".

Flutter: ui/platform_dispatcher.dart AppExitType

type AppLifecycleState

type AppLifecycleState int

AppLifecycleState states that an application can be in once it is running. The zero value, AppLifecycleStateUnspecified, means no state is known yet.

Flutter: ui/platform_dispatcher.dart AppLifecycleState

const (
	// AppLifecycleStateUnspecified is the zero value: no state is known yet.
	//
	// Flutter: no counterpart
	AppLifecycleStateUnspecified AppLifecycleState = iota
	// AppLifecycleStateDetached means the application is still hosted by the
	// engine but detached from any views, or is shutting down.
	//
	// Flutter: ui/platform_dispatcher.dart AppLifecycleState.detached
	AppLifecycleStateDetached
	// AppLifecycleStateResumed means the application is visible and responding
	// to user input.
	//
	// Flutter: ui/platform_dispatcher.dart AppLifecycleState.resumed
	AppLifecycleStateResumed
	// AppLifecycleStateInactive means the application is in an inactive state
	// and is not receiving user input.
	//
	// Flutter: ui/platform_dispatcher.dart AppLifecycleState.inactive
	AppLifecycleStateInactive
	// AppLifecycleStateHidden means all views of the application are hidden.
	//
	// Flutter: ui/platform_dispatcher.dart AppLifecycleState.hidden
	AppLifecycleStateHidden
	// AppLifecycleStatePaused means the application is not currently visible to
	// the user and not responding to user input. Desktop platforms do not use
	// it.
	//
	// Flutter: ui/platform_dispatcher.dart AppLifecycleState.paused
	AppLifecycleStatePaused
)

The values of AppLifecycleState follow Flutter's declaration order.

func (AppLifecycleState) String

func (s AppLifecycleState) String() string

String returns the name of the state, such as "AppLifecycleStateResumed".

Flutter: ui/platform_dispatcher.dart AppLifecycleState

type ArcToPointOpts

type ArcToPointOpts struct {
	// Radius is the radii of the ellipse the arc is on. The zero value (Flutter's
	// Radius.zero) makes a straight line; radii that are too small to reach the
	// end are scaled up.
	Radius Radius
	// Rotation is the rotation of the ellipse, in radians.
	Rotation float64
	// LargeArc picks the arc of more than half of the ellipse, among the two
	// that reach the end point in the same direction.
	LargeArc bool
	// Clockwise is the direction of the arc; nil means true, Flutter's default.
	Clockwise *bool
}

ArcToPointOpts are the optional arguments of ArcToPoint and RelativeArcToPoint.

Flutter: ui/painting.dart Path.arcToPoint

type BackGestureEvent

type BackGestureEvent struct {
	// HasTouchOffset is whether TouchX and TouchY are known: a back that a button or a key makes
	// has no finger.
	HasTouchOffset bool
	// TouchX and TouchY are the position of the finger in the view, in logical pixels.
	TouchX, TouchY float64
	// Progress is how far the gesture has gone, from 0 to 1.
	Progress float64
	// SwipeEdge is the edge that the gesture started from.
	SwipeEdge BackSwipeEdge
}

BackGestureEvent is a step of the back gesture of the system: where the finger is, how far the gesture has gone and from which edge it started.

Flutter: services/predictive_back_event.dart PredictiveBackEvent

type BackHost

type BackHost interface {
	// SetFrameworkHandlesBack says whether the framework handles the back gesture of the system
	// (something that can pop, or a PopScope that cannot): the system then gives the gesture to
	// the app and shows its predictive animation, else it does its own (SPEC §24.8).
	SetFrameworkHandlesBack(handles bool)
}

BackHost is what the engine implements to tell the system whether the framework wants the back gesture. The dispatcher uses it when the host has it; a host without it does nothing.

Flutter: no counterpart (the engine's side of the flutter/platform channel)

type BackSwipeEdge

type BackSwipeEdge int

BackSwipeEdge is the edge of the screen that a back gesture starts from.

Flutter: services/predictive_back_event.dart PredictiveBackEvent.swipeEdge (SwipeEdge)

const (
	// BackSwipeEdgeUnspecified is the zero value.
	//
	// Flutter: no counterpart
	BackSwipeEdgeUnspecified BackSwipeEdge = iota
	// BackSwipeEdgeLeft is the left edge.
	//
	// Flutter: services/predictive_back_event.dart SwipeEdge.left
	BackSwipeEdgeLeft
	// BackSwipeEdgeRight is the right edge.
	//
	// Flutter: services/predictive_back_event.dart SwipeEdge.right
	BackSwipeEdgeRight
)

The values of BackSwipeEdge follow Flutter's SwipeEdge (left, right).

type BackdropFilterEngineLayer

type BackdropFilterEngineLayer struct {
	// contains filtered or unexported fields
}

BackdropFilterEngineLayer is the handle PushBackdropFilter returns.

Flutter: ui/compositing.dart BackdropFilterEngineLayer

func (*BackdropFilterEngineLayer) Dispose

func (h *BackdropFilterEngineLayer) Dispose()

Dispose releases the handle.

Flutter: ui/compositing.dart _EngineLayerWrapper.dispose

func (*BackdropFilterEngineLayer) Layer

func (h *BackdropFilterEngineLayer) Layer() Layer

Layer returns the layer the handle stands for.

Flutter: no counterpart

type BackdropFilterLayer

type BackdropFilterLayer struct {

	// Filter is the image filter applied to the backdrop.
	Filter ImageFilter
	// BlendMode is how the filtered backdrop combines with what is there.
	BlendMode BlendMode
	// BackdropID, when HasBackdropID is true, names a backdrop shared by several
	// backdrop filters, which are then computed once.
	BackdropID    int
	HasBackdropID bool
	// contains filtered or unexported fields
}

BackdropFilterLayer applies an image filter to what was drawn before it, within its clip, and then draws the layers under it.

Flutter: flow/layers/backdrop_filter_layer.h BackdropFilterLayer

func (*BackdropFilterLayer) Children

func (b *BackdropFilterLayer) Children() []Layer

Children returns the layers under this one.

Flutter: no counterpart

func (*BackdropFilterLayer) HasTexture

func (b *BackdropFilterLayer) HasTexture() bool

HasTexture reports whether this layer or a layer under it is a TextureLayer.

Flutter: no counterpart

func (*BackdropFilterLayer) OldLayer

func (b *BackdropFilterLayer) OldLayer() Layer

OldLayer returns the layer of the previous frame this one replaces.

Flutter: no counterpart

type BlendMode

type BlendMode int

BlendMode describes the algorithm used to combine a source and a destination image when drawing; the order is Skia's. The default is BlendModeSrcOver.

Flutter: ui/painting.dart BlendMode

const (
	// BlendModeUnspecified is the zero value: the default.
	//
	// Flutter: no counterpart
	BlendModeUnspecified BlendMode = iota
	// BlendModeClear is Flutter's BlendMode.clear. Drop both the source and destination images, leaving nothing.
	//
	// Flutter: ui/painting.dart BlendMode.clear
	BlendModeClear
	// BlendModeSrc is Flutter's BlendMode.src. Drop the destination image, only paint the source image.
	//
	// Flutter: ui/painting.dart BlendMode.src
	BlendModeSrc
	// BlendModeDst is Flutter's BlendMode.dst. Drop the source image, only paint the destination image.
	//
	// Flutter: ui/painting.dart BlendMode.dst
	BlendModeDst
	// BlendModeSrcOver is Flutter's BlendMode.srcOver. Composite the source image over the destination image. This is the default.
	//
	// Flutter: ui/painting.dart BlendMode.srcOver
	BlendModeSrcOver
	// BlendModeDstOver is Flutter's BlendMode.dstOver. Composite the source image under the destination image.
	//
	// Flutter: ui/painting.dart BlendMode.dstOver
	BlendModeDstOver
	// BlendModeSrcIn is Flutter's BlendMode.srcIn. Show the source image, but only where the two images overlap. The destination is treated merely as a mask.
	//
	// Flutter: ui/painting.dart BlendMode.srcIn
	BlendModeSrcIn
	// BlendModeDstIn is Flutter's BlendMode.dstIn. Show the destination image, but only where the two images overlap. The source is treated merely as a mask.
	//
	// Flutter: ui/painting.dart BlendMode.dstIn
	BlendModeDstIn
	// BlendModeSrcOut is Flutter's BlendMode.srcOut. Show the source image, but only where the two images do not overlap.
	//
	// Flutter: ui/painting.dart BlendMode.srcOut
	BlendModeSrcOut
	// BlendModeDstOut is Flutter's BlendMode.dstOut. Show the destination image, but only where the two images do not overlap.
	//
	// Flutter: ui/painting.dart BlendMode.dstOut
	BlendModeDstOut
	// BlendModeSrcATop is Flutter's BlendMode.srcATop. Composite the source image over the destination image, but only where it overlaps the destination.
	//
	// Flutter: ui/painting.dart BlendMode.srcATop
	BlendModeSrcATop
	// BlendModeDstATop is Flutter's BlendMode.dstATop. Composite the destination image over the source image, but only where it overlaps the source.
	//
	// Flutter: ui/painting.dart BlendMode.dstATop
	BlendModeDstATop
	// BlendModeXor is Flutter's BlendMode.xor. Apply a bitwise xor operator to the source and destination images, which leaves transparency where they overlap.
	//
	// Flutter: ui/painting.dart BlendMode.xor
	BlendModeXor
	// BlendModePlus is Flutter's BlendMode.plus. Sum the components of the source and destination images.
	//
	// Flutter: ui/painting.dart BlendMode.plus
	BlendModePlus
	// BlendModeModulate is Flutter's BlendMode.modulate. Multiply the color components of the source and destination images.
	//
	// Flutter: ui/painting.dart BlendMode.modulate
	BlendModeModulate
	// BlendModeScreen is Flutter's BlendMode.screen. Multiply the inverse of the components of the source and destination images, and inverse the result.
	//
	// Flutter: ui/painting.dart BlendMode.screen
	BlendModeScreen
	// BlendModeOverlay is Flutter's BlendMode.overlay. Multiply the components of the source and destination images after adjusting them to favor the destination.
	//
	// Flutter: ui/painting.dart BlendMode.overlay
	BlendModeOverlay
	// BlendModeDarken is Flutter's BlendMode.darken. Composite the source and destination image by choosing the lowest value from each color channel.
	//
	// Flutter: ui/painting.dart BlendMode.darken
	BlendModeDarken
	// BlendModeLighten is Flutter's BlendMode.lighten. Composite the source and destination image by choosing the highest value from each color channel.
	//
	// Flutter: ui/painting.dart BlendMode.lighten
	BlendModeLighten
	// BlendModeColorDodge is Flutter's BlendMode.colorDodge. Divide the destination by the inverse of the source.
	//
	// Flutter: ui/painting.dart BlendMode.colorDodge
	BlendModeColorDodge
	// BlendModeColorBurn is Flutter's BlendMode.colorBurn. Divide the inverse of the destination by the source, and inverse the result.
	//
	// Flutter: ui/painting.dart BlendMode.colorBurn
	BlendModeColorBurn
	// BlendModeHardLight is Flutter's BlendMode.hardLight. Multiply the components of the source and destination images after adjusting them to favor the source.
	//
	// Flutter: ui/painting.dart BlendMode.hardLight
	BlendModeHardLight
	// BlendModeSoftLight is Flutter's BlendMode.softLight. Use colorDodge for source values below 0.5 and colorBurn for source values above 0.5.
	//
	// Flutter: ui/painting.dart BlendMode.softLight
	BlendModeSoftLight
	// BlendModeDifference is Flutter's BlendMode.difference. Subtract the smaller value from the bigger value for each channel.
	//
	// Flutter: ui/painting.dart BlendMode.difference
	BlendModeDifference
	// BlendModeExclusion is Flutter's BlendMode.exclusion. Subtract double the product of the two images from the sum of the two images.
	//
	// Flutter: ui/painting.dart BlendMode.exclusion
	BlendModeExclusion
	// BlendModeMultiply is Flutter's BlendMode.multiply. Multiply the components of the source and destination images, including the alpha channel.
	//
	// Flutter: ui/painting.dart BlendMode.multiply
	BlendModeMultiply
	// BlendModeHue is Flutter's BlendMode.hue. Take the hue of the source image, and the saturation and luminosity of the destination image.
	//
	// Flutter: ui/painting.dart BlendMode.hue
	BlendModeHue
	// BlendModeSaturation is Flutter's BlendMode.saturation. Take the saturation of the source image, and the hue and luminosity of the destination image.
	//
	// Flutter: ui/painting.dart BlendMode.saturation
	BlendModeSaturation
	// BlendModeColor is Flutter's BlendMode.color. Take the hue and saturation of the source image, and the luminosity of the destination image.
	//
	// Flutter: ui/painting.dart BlendMode.color
	BlendModeColor
	// BlendModeLuminosity is Flutter's BlendMode.luminosity. Take the luminosity of the source image, and the hue and saturation of the destination image.
	//
	// Flutter: ui/painting.dart BlendMode.luminosity
	BlendModeLuminosity
)

The values of BlendMode follow Flutter's declaration order.

func (BlendMode) Name

func (e BlendMode) Name() string

Name returns the Dart enum name, such as "srcOver".

Flutter: dart:core Enum.name

func (BlendMode) String

func (e BlendMode) String() string

String returns the name Dart prints for the value, such as "BlendMode.clear".

type BlurImageFilter

type BlurImageFilter struct {
	// contains filtered or unexported fields
}

BlurImageFilter is the Gaussian blur image filter.

Flutter: ui/painting.dart _GaussianBlurImageFilter

func (*BlurImageFilter) Bounds

func (f *BlurImageFilter) Bounds() (Rect, bool)

Bounds is the rectangle the filter is limited to, and whether there is one.

Flutter: ui/painting.dart _GaussianBlurImageFilter.bounds

func (*BlurImageFilter) DebugShortDescription

func (f *BlurImageFilter) DebugShortDescription() string

DebugShortDescription describes the filter in a few words.

Flutter: ui/painting.dart _GaussianBlurImageFilter.debugShortDescription

func (*BlurImageFilter) Equal

func (f *BlurImageFilter) Equal(other ImageFilter) bool

Equal reports whether other is a blur with the same values.

Flutter: ui/painting.dart _GaussianBlurImageFilter.operator ==

func (*BlurImageFilter) SigmaX

func (f *BlurImageFilter) SigmaX() float64

SigmaX is the standard deviation of the blur on the x axis.

Flutter: ui/painting.dart _GaussianBlurImageFilter.sigmaX

func (*BlurImageFilter) SigmaY

func (f *BlurImageFilter) SigmaY() float64

SigmaY is the standard deviation of the blur on the y axis.

Flutter: ui/painting.dart _GaussianBlurImageFilter.sigmaY

func (*BlurImageFilter) String

func (f *BlurImageFilter) String() string

String describes the filter, as Dart's toString does.

Flutter: ui/painting.dart _GaussianBlurImageFilter.toString

func (*BlurImageFilter) TileMode

func (f *BlurImageFilter) TileMode() TileMode

TileMode is how the edges are treated; TileModeUnspecified when not given.

Flutter: ui/painting.dart _GaussianBlurImageFilter.tileMode

type BlurStyle

type BlurStyle int

BlurStyle lists the styles to use for blurs in MaskFilter objects.

Flutter: ui/painting.dart BlurStyle

const (
	// BlurStyleUnspecified is the zero value: the default.
	//
	// Flutter: no counterpart
	BlurStyleUnspecified BlurStyle = iota
	// BlurStyleNormal is Flutter's BlurStyle.normal. Fuzzy inside and outside. This is useful for painting shadows that are offset from the shape that ostensibly is casting the shadow.
	//
	// Flutter: ui/painting.dart BlurStyle.normal
	BlurStyleNormal
	// BlurStyleSolid is Flutter's BlurStyle.solid. Solid inside, fuzzy outside. This corresponds to drawing the shape, and additionally drawing the blur.
	//
	// Flutter: ui/painting.dart BlurStyle.solid
	BlurStyleSolid
	// BlurStyleOuter is Flutter's BlurStyle.outer. Nothing inside, fuzzy outside. This is useful for painting shadows for partially transparent shapes.
	//
	// Flutter: ui/painting.dart BlurStyle.outer
	BlurStyleOuter
	// BlurStyleInner is Flutter's BlurStyle.inner. Fuzzy inside, nothing outside. This can make shapes appear to be lit from within.
	//
	// Flutter: ui/painting.dart BlurStyle.inner
	BlurStyleInner
)

The values of BlurStyle follow Flutter's declaration order.

func (BlurStyle) String

func (e BlurStyle) String() string

String returns the name Dart prints for the value, such as "BlurStyle.normal".

type BoxHeightStyle

type BoxHeightStyle int

BoxHeightStyle defines how the height of the boxes returned by Paragraph.GetBoxesForRange is bound.

Flutter: ui/text.dart BoxHeightStyle

const (
	// BoxHeightStyleUnspecified is the zero value: tight.
	//
	// Flutter: no counterpart
	BoxHeightStyleUnspecified BoxHeightStyle = iota
	// BoxHeightStyleTight provides tight bounding boxes that fit heights per run.
	//
	// Flutter: ui/text.dart BoxHeightStyle.tight
	BoxHeightStyleTight
	// BoxHeightStyleMax makes the height of the boxes the maximum height of all runs in the line.
	//
	// Flutter: ui/text.dart BoxHeightStyle.max
	BoxHeightStyleMax
	// BoxHeightStyleIncludeLineSpacingMiddle extends the top and bottom edge of the bounds to cover half of the line spacing each.
	//
	// Flutter: ui/text.dart BoxHeightStyle.includeLineSpacingMiddle
	BoxHeightStyleIncludeLineSpacingMiddle
	// BoxHeightStyleIncludeLineSpacingTop extends the top edge of the bounds to fully cover any line spacing.
	//
	// Flutter: ui/text.dart BoxHeightStyle.includeLineSpacingTop
	BoxHeightStyleIncludeLineSpacingTop
	// BoxHeightStyleIncludeLineSpacingBottom extends the bottom edge of the bounds to fully cover any line spacing.
	//
	// Flutter: ui/text.dart BoxHeightStyle.includeLineSpacingBottom
	BoxHeightStyleIncludeLineSpacingBottom
	// BoxHeightStyleStrut calculates box heights from the metrics of the paragraph's strut.
	//
	// Flutter: ui/text.dart BoxHeightStyle.strut
	BoxHeightStyleStrut
)

The values of BoxHeightStyle follow Flutter's declaration order.

func (BoxHeightStyle) Name

func (e BoxHeightStyle) Name() string

Name returns the Dart enum name, such as "tight".

Flutter: dart:core Enum.name

func (BoxHeightStyle) String

func (e BoxHeightStyle) String() string

String returns the name Dart prints for the value, such as "BoxHeightStyle.max".

type BoxWidthStyle

type BoxWidthStyle int

BoxWidthStyle defines how the width of the boxes returned by Paragraph.GetBoxesForRange is bound.

Flutter: ui/text.dart BoxWidthStyle

const (
	// BoxWidthStyleUnspecified is the zero value: tight.
	//
	// Flutter: no counterpart
	BoxWidthStyleUnspecified BoxWidthStyle = iota
	// BoxWidthStyleTight provides tight bounding boxes that fit widths to the runs of each line independently.
	//
	// Flutter: ui/text.dart BoxWidthStyle.tight
	BoxWidthStyleTight
	// BoxWidthStyleMax adds boxes at the beginning and end of each line so that the boxes of a line are as wide as the widest line.
	//
	// Flutter: ui/text.dart BoxWidthStyle.max
	BoxWidthStyleMax
)

The values of BoxWidthStyle follow Flutter's declaration order.

func (BoxWidthStyle) Name

func (e BoxWidthStyle) Name() string

Name returns the Dart enum name, such as "tight".

Flutter: dart:core Enum.name

func (BoxWidthStyle) String

func (e BoxWidthStyle) String() string

String returns the name Dart prints for the value, such as "BoxWidthStyle.max".

type BoxesForRangeOpts

type BoxesForRangeOpts struct {
	// HeightStyle defaults to tight.
	HeightStyle BoxHeightStyle
	// WidthStyle defaults to tight.
	WidthStyle BoxWidthStyle
}

BoxesForRangeOpts are the optional parameters of Paragraph.GetBoxesForRange.

Flutter: ui/text.dart Paragraph.getBoxesForRange

type Brightness

type Brightness int

Brightness describes the contrast of a theme or color palette. The zero value, BrightnessUnspecified, means the platform does not say.

Flutter: ui/platform_dispatcher.dart Brightness

const (
	// BrightnessUnspecified is the zero value.
	//
	// Flutter: no counterpart
	BrightnessUnspecified Brightness = iota
	// BrightnessDark is a dark appearance.
	//
	// Flutter: ui/platform_dispatcher.dart Brightness.dark
	BrightnessDark
	// BrightnessLight is a light appearance.
	//
	// Flutter: ui/platform_dispatcher.dart Brightness.light
	BrightnessLight
)

The values of Brightness follow Flutter's declaration order.

func (Brightness) String

func (b Brightness) String() string

String returns the name of the value, such as "BrightnessDark".

Flutter: ui/platform_dispatcher.dart Brightness

type Canvas

type Canvas struct {
	// contains filtered or unexported fields
}

Canvas is an interface for recording graphical operations. It holds the state a drawing needs (the current transform and clip, and a stack of saved ones) and records every drawing command into a display list, which the PictureRecorder it was created for turns into a Picture.

A Canvas is not safe for use from several goroutines.

Flutter: ui/painting.dart Canvas

func NewCanvas

func NewCanvas(recorder *PictureRecorder, opts ...CanvasOpts) *Canvas

NewCanvas creates a canvas that records into the recorder, which starts recording. It panics with the tag CanvasRecorderBusy when the recorder is already recording.

Flutter: ui/painting.dart Canvas

func (*Canvas) ClipPath

func (c *Canvas) ClipPath(path *Path, opts ...ClipOpts)

ClipPath reduces the clip region to the intersection of the current clip and the given path. The path is copied.

Flutter: ui/painting.dart Canvas.clipPath

func (*Canvas) ClipRRect

func (c *Canvas) ClipRRect(rrect RRect, opts ...ClipOpts)

ClipRRect reduces the clip region to the intersection of the current clip and the given rounded rectangle.

Flutter: ui/painting.dart Canvas.clipRRect

func (*Canvas) ClipRSuperellipse

func (c *Canvas) ClipRSuperellipse(rs RSuperellipse, opts ...ClipOpts)

ClipRSuperellipse reduces the clip region to the intersection of the current clip and the given rounded superellipse.

Flutter: ui/painting.dart Canvas.clipRSuperellipse

func (*Canvas) ClipRect

func (c *Canvas) ClipRect(rect Rect, opts ...ClipRectOpts)

ClipRect reduces the clip region to the intersection of the current clip and the given rectangle (or, with ClipOpDifference, to the part of the current clip outside it). If the rectangle is empty, everything is clipped away until the next Restore.

Flutter: ui/painting.dart Canvas.clipRect

func (*Canvas) DrawArc

func (c *Canvas) DrawArc(rect Rect, startAngle, sweepAngle float64, useCenter bool, paint *Paint)

DrawArc draws an arc scaled to fit inside the given rectangle. It starts from startAngle radians around the oval up to startAngle + sweepAngle radians around the oval, with zero radians being the point on the right hand side of the oval that crosses the horizontal line that intersects the center of the rectangle and with positive angles going clockwise around the oval. If useCenter is true, the arc is closed back to the center, forming a circle sector. Otherwise, the arc is not closed, forming a circle segment.

Flutter: ui/painting.dart Canvas.drawArc

func (*Canvas) DrawAtlas

func (c *Canvas) DrawAtlas(atlas *Image, transforms []RSTransform, rects []Rect, colors []Color, blendMode BlendMode, cullRect *Rect, paint *Paint)

DrawAtlas draws many parts of an image (the atlas) to the canvas. Each part is the rectangle in rects at the same index, placed by the transform at that index. The colors, when there are any, tint the parts with the blend mode (BlendModeSrc when unspecified). The optional cullRect is a bound on everything drawn, which can speed up culling. Lists whose lengths do not match panic with the tag AtlasTransformCountMismatch or AtlasColorCountMismatch.

Flutter: ui/painting.dart Canvas.drawAtlas

func (*Canvas) DrawCircle

func (c *Canvas) DrawCircle(center Offset, radius float64, paint *Paint)

DrawCircle draws a circle centered at the point given by the first argument and that has the radius given by the second argument, with the paint given by the third argument.

Flutter: ui/painting.dart Canvas.drawCircle

func (*Canvas) DrawColor

func (c *Canvas) DrawColor(color Color, blendMode BlendMode)

DrawColor paints the given color onto the canvas, applying the given blend mode, with the given color being the source and the background being the destination.

Flutter: ui/painting.dart Canvas.drawColor

func (*Canvas) DrawDRRect

func (c *Canvas) DrawDRRect(outer, inner RRect, paint *Paint)

DrawDRRect draws a shape consisting of the difference between two rounded rectangles with the given paint. The outer rectangle must contain the inner one.

Flutter: ui/painting.dart Canvas.drawDRRect

func (*Canvas) DrawImage

func (c *Canvas) DrawImage(image *Image, offset Offset, paint *Paint)

DrawImage draws the given Image into the canvas with its top-left corner at the given offset.

Flutter: ui/painting.dart Canvas.drawImage

func (*Canvas) DrawImageNine

func (c *Canvas) DrawImageNine(image *Image, center, dst Rect, paint *Paint)

DrawImageNine draws the given Image into the canvas using the given Paint.

The image is drawn in nine portions described by splitting the image by drawing two horizontal lines and two vertical lines, where the center argument describes the rectangle formed by the four points where these four lines intersect each other. The corners are drawn into the corresponding corners of dst without scaling, and the edges and the center are stretched.

Flutter: ui/painting.dart Canvas.drawImageNine

func (*Canvas) DrawImageRect

func (c *Canvas) DrawImageRect(image *Image, src, dst Rect, paint *Paint)

DrawImageRect draws the subset of the given image described by the src argument into the canvas in the axis-aligned rectangle given by the dst argument.

Flutter: ui/painting.dart Canvas.drawImageRect

func (*Canvas) DrawLine

func (c *Canvas) DrawLine(p1, p2 Offset, paint *Paint)

DrawLine draws a line between the given points using the given paint. The line is stroked, the value of the paint's style is ignored for this call.

Flutter: ui/painting.dart Canvas.drawLine

func (*Canvas) DrawOval

func (c *Canvas) DrawOval(rect Rect, paint *Paint)

DrawOval draws an axis-aligned oval that fills the given axis-aligned rectangle with the given paint. A filled empty oval is not recorded.

Flutter: ui/painting.dart Canvas.drawOval

func (*Canvas) DrawPaint

func (c *Canvas) DrawPaint(paint *Paint)

DrawPaint fills the canvas with the given Paint. To fill the canvas with a solid color and blend mode, consider DrawColor instead.

Flutter: ui/painting.dart Canvas.drawPaint

func (*Canvas) DrawParagraph

func (c *Canvas) DrawParagraph(paragraph *Paragraph, offset Offset)

DrawParagraph draws a sequence of text.

Flutter: ui/painting.dart Canvas.drawParagraph

func (*Canvas) DrawPath

func (c *Canvas) DrawPath(path *Path, paint *Paint)

DrawPath draws the given Path with the given paint. The path is copied.

Flutter: ui/painting.dart Canvas.drawPath

func (*Canvas) DrawPicture

func (c *Canvas) DrawPicture(picture *Picture)

DrawPicture draws the given Picture onto the canvas. To create a picture, see PictureRecorder.

Flutter: ui/painting.dart Canvas.drawPicture

func (*Canvas) DrawPoints

func (c *Canvas) DrawPoints(mode PointMode, points []Offset, paint *Paint)

DrawPoints draws a sequence of points according to the given PointMode. The points are copied.

Flutter: ui/painting.dart Canvas.drawPoints

func (*Canvas) DrawRRect

func (c *Canvas) DrawRRect(rrect RRect, paint *Paint)

DrawRRect draws a rounded rectangle with the given paint.

Flutter: ui/painting.dart Canvas.drawRRect

func (*Canvas) DrawRSuperellipse

func (c *Canvas) DrawRSuperellipse(rs RSuperellipse, paint *Paint)

DrawRSuperellipse draws a rounded superellipse with the given paint.

Flutter: ui/painting.dart Canvas.drawRSuperellipse

func (*Canvas) DrawRect

func (c *Canvas) DrawRect(rect Rect, paint *Paint)

DrawRect draws a rectangle with the given paint. Whether the rectangle is filled or stroked (or both) is controlled by the paint's style. A filled empty rectangle is not recorded.

Flutter: ui/painting.dart Canvas.drawRect

func (*Canvas) DrawShadow

func (c *Canvas) DrawShadow(path *Path, color Color, elevation float64, transparentOccluder bool)

DrawShadow draws a shadow for a Path representing the given material elevation. The transparentOccluder argument should be true if the occluding object is not opaque.

The elevation is in logical pixels; the renderer scales it by the device pixel ratio of the view.

Flutter: ui/painting.dart Canvas.drawShadow

func (*Canvas) DrawVertices

func (c *Canvas) DrawVertices(vertices *Vertices, blendMode BlendMode, paint *Paint)

DrawVertices draws a set of Vertices onto the canvas as one or more triangles. The Paint.color property specifies the default color to use for the triangles drawn when the vertices have no colors, and its shader, when set, is used with the texture coordinates. The blend mode combines the vertex colors with the paint's color or shader.

Flutter: ui/painting.dart Canvas.drawVertices

func (*Canvas) GetDestinationClipBounds

func (c *Canvas) GetDestinationClipBounds() Rect

GetDestinationClipBounds returns the conservative bounds of the total clip in device coordinates: the coordinates of the target the picture will be drawn onto.

Flutter: ui/painting.dart Canvas.getDestinationClipBounds

func (*Canvas) GetLocalClipBounds

func (c *Canvas) GetLocalClipBounds() Rect

GetLocalClipBounds returns the conservative bounds of the total clip in the current coordinate system: the rectangle that contains the area that can still be drawn into. It is meant for culling, not to be exact.

Flutter: ui/painting.dart Canvas.getLocalClipBounds

func (*Canvas) GetSaveCount

func (c *Canvas) GetSaveCount() int

GetSaveCount returns the number of items on the save stack, including the initial state: it is 1 on a new canvas, and every Save and SaveLayer adds one.

Flutter: ui/painting.dart Canvas.getSaveCount

func (*Canvas) GetTransform

func (c *Canvas) GetTransform() *Matrix4

GetTransform returns a copy of the current transform.

Flutter: ui/painting.dart Canvas.getTransform

func (*Canvas) Restore

func (c *Canvas) Restore()

Restore pops the transform and clip states stored by the last Save or SaveLayer. Nothing happens when the stack is empty.

Flutter: ui/painting.dart Canvas.restore

func (*Canvas) RestoreToCount

func (c *Canvas) RestoreToCount(count int)

RestoreToCount efficiently calls Restore until GetSaveCount returns count. A count less than 1 is 1, and a count greater than the current one does nothing.

Flutter: ui/painting.dart Canvas.restoreToCount

func (*Canvas) Rotate

func (c *Canvas) Rotate(radians float64)

Rotate adds a rotation to the current transform. The argument is in radians clockwise.

Flutter: ui/painting.dart Canvas.rotate

func (*Canvas) Save

func (c *Canvas) Save()

Save saves a copy of the current transform and clip on the save stack. Call Restore to pop the save stack.

Flutter: ui/painting.dart Canvas.save

func (*Canvas) SaveLayer

func (c *Canvas) SaveLayer(bounds *Rect, paint *Paint)

SaveLayer saves a copy of the current transform and clip on the save stack, and then creates a new group which subsequent calls will become a part of. When the save stack is later popped, the group will be flattened into a layer and have the given paint's color filter, blend mode and alpha applied. The bounds, when not nil, limit the layer.

Flutter: ui/painting.dart Canvas.saveLayer

func (*Canvas) Scale

func (c *Canvas) Scale(sx, sy float64)

Scale adds an axis-aligned scale to the current transform, scaling by the first argument in the horizontal direction and the second in the vertical direction.

Flutter: ui/painting.dart Canvas.scale

func (*Canvas) ScaleUniform

func (c *Canvas) ScaleUniform(s float64)

ScaleUniform adds a scale of s in both directions to the current transform: Flutter's scale called with one argument.

Flutter: ui/painting.dart Canvas.scale

func (*Canvas) Skew

func (c *Canvas) Skew(sx, sy float64)

Skew adds an axis-aligned skew to the current transform, with the first argument being the horizontal skew in rise over run units clockwise around the origin, and the second argument being the vertical skew in rise over run units clockwise around the origin.

Flutter: ui/painting.dart Canvas.skew

func (*Canvas) String

func (c *Canvas) String() string

String describes the canvas, as Dart's toString does.

Flutter: ui/painting.dart Canvas.toString

func (*Canvas) Transform

func (c *Canvas) Transform(matrix *Matrix4)

Transform multiplies the current transform by the specified 4⨉4 transformation matrix.

Flutter: ui/painting.dart Canvas.transform

func (*Canvas) Translate

func (c *Canvas) Translate(dx, dy float64)

Translate adds a translation to the current transform, shifting the coordinate space horizontally by the first argument and vertically by the second argument.

Flutter: ui/painting.dart Canvas.translate

type CanvasOpts

type CanvasOpts struct {
	// CullRect is a bound on what will be drawn, in the coordinates the canvas
	// starts with; the display list may leave out what is outside it. Nil means
	// Rect.largest, as in Flutter.
	CullRect *Rect
}

CanvasOpts are the optional arguments of NewCanvas.

Flutter: ui/painting.dart Canvas

type CheckedState

type CheckedState int

CheckedState is the state of a checkable node.

Flutter: ui/semantics.dart CheckedState

const (
	// CheckedStateNone is the state of a node that is not checkable.
	//
	// Flutter: ui/semantics.dart CheckedState.none
	CheckedStateNone CheckedState = iota
	// CheckedStateIsTrue is checked.
	//
	// Flutter: ui/semantics.dart CheckedState.isTrue
	CheckedStateIsTrue
	// CheckedStateIsFalse is not checked.
	//
	// Flutter: ui/semantics.dart CheckedState.isFalse
	CheckedStateIsFalse
	// CheckedStateMixed is neither checked nor not checked.
	//
	// Flutter: ui/semantics.dart CheckedState.mixed
	CheckedStateMixed
)

The values of CheckedState. The zero value is CheckedStateNone.

func (CheckedState) Name

func (c CheckedState) Name() string

Name returns the name of the value, such as "isTrue".

Flutter: ui/semantics.dart CheckedState.name

func (CheckedState) String

func (c CheckedState) String() string

String is "CheckedState.isTrue".

Flutter: ui/semantics.dart CheckedState.toString

type Clip

type Clip int

Clip lists the different ways to clip a widget's content.

Flutter: ui/painting.dart Clip

const (
	// ClipUnspecified is the zero value: the default.
	//
	// Flutter: no counterpart
	ClipUnspecified Clip = iota
	// ClipNone is Flutter's Clip.none. No clip at all.
	//
	// Flutter: ui/painting.dart Clip.none
	ClipNone
	// ClipHardEdge is Flutter's Clip.hardEdge. Clip, but do not apply anti-aliasing.
	//
	// Flutter: ui/painting.dart Clip.hardEdge
	ClipHardEdge
	// ClipAntiAlias is Flutter's Clip.antiAlias. Clip with anti-aliasing.
	//
	// Flutter: ui/painting.dart Clip.antiAlias
	ClipAntiAlias
	// ClipAntiAliasWithSaveLayer is Flutter's Clip.antiAliasWithSaveLayer. Clip with anti-aliasing and saveLayer immediately following the clip.
	//
	// Flutter: ui/painting.dart Clip.antiAliasWithSaveLayer
	ClipAntiAliasWithSaveLayer
)

The values of Clip follow Flutter's declaration order.

func (Clip) Name

func (e Clip) Name() string

Name returns the Dart enum name, such as "hardEdge".

Flutter: dart:core Enum.name

func (Clip) String

func (e Clip) String() string

String returns the name Dart prints for the value, such as "Clip.none".

type ClipOp

type ClipOp int

ClipOp is the way a clip combines with the current clip.

Flutter: ui/painting.dart ClipOp

const (
	// ClipOpUnspecified is the zero value: ClipOpIntersect.
	//
	// Flutter: no counterpart
	ClipOpUnspecified ClipOp = iota
	// ClipOpDifference is Flutter's ClipOp.difference. Subtract the clip shape
	// from the current clip.
	//
	// Flutter: ui/painting.dart ClipOp.difference
	ClipOpDifference
	// ClipOpIntersect is Flutter's ClipOp.intersect. Intersect the clip shape with
	// the current clip. This is the default.
	//
	// Flutter: ui/painting.dart ClipOp.intersect
	ClipOpIntersect
)

The values of ClipOp follow Flutter's declaration order.

func (ClipOp) String

func (e ClipOp) String() string

String returns the name Dart prints for the value, such as "ClipOp.intersect".

type ClipOpts

type ClipOpts struct {
	// DoAntiAlias says whether the edge is smoothed; nil means true, Flutter's
	// default.
	DoAntiAlias *bool
}

ClipOpts are the optional arguments of ClipRRect, ClipRSuperellipse and ClipPath.

Flutter: ui/painting.dart Canvas.clipRRect

type ClipPathEngineLayer

type ClipPathEngineLayer struct {
	// contains filtered or unexported fields
}

ClipPathEngineLayer is the handle PushClipPath returns.

Flutter: ui/compositing.dart ClipPathEngineLayer

func (*ClipPathEngineLayer) Dispose

func (h *ClipPathEngineLayer) Dispose()

Dispose releases the handle.

Flutter: ui/compositing.dart _EngineLayerWrapper.dispose

func (*ClipPathEngineLayer) Layer

func (h *ClipPathEngineLayer) Layer() Layer

Layer returns the layer the handle stands for.

Flutter: no counterpart

type ClipPathLayer

type ClipPathLayer struct {

	// Path is the clip shape: a copy of the path that was given.
	Path *Path
	// ClipBehavior says how the edge is clipped; never ClipUnspecified.
	ClipBehavior Clip
	// contains filtered or unexported fields
}

ClipPathLayer clips the layers under it to a path.

Flutter: flow/layers/clip_path_layer.h ClipPathLayer

func (*ClipPathLayer) Children

func (b *ClipPathLayer) Children() []Layer

Children returns the layers under this one.

Flutter: no counterpart

func (*ClipPathLayer) HasTexture

func (b *ClipPathLayer) HasTexture() bool

HasTexture reports whether this layer or a layer under it is a TextureLayer.

Flutter: no counterpart

func (*ClipPathLayer) OldLayer

func (b *ClipPathLayer) OldLayer() Layer

OldLayer returns the layer of the previous frame this one replaces.

Flutter: no counterpart

type ClipRRectEngineLayer

type ClipRRectEngineLayer struct {
	// contains filtered or unexported fields
}

ClipRRectEngineLayer is the handle PushClipRRect returns.

Flutter: ui/compositing.dart ClipRRectEngineLayer

func (*ClipRRectEngineLayer) Dispose

func (h *ClipRRectEngineLayer) Dispose()

Dispose releases the handle.

Flutter: ui/compositing.dart _EngineLayerWrapper.dispose

func (*ClipRRectEngineLayer) Layer

func (h *ClipRRectEngineLayer) Layer() Layer

Layer returns the layer the handle stands for.

Flutter: no counterpart

type ClipRRectLayer

type ClipRRectLayer struct {

	// RRect is the clip shape.
	RRect RRect
	// ClipBehavior says how the edge is clipped; never ClipUnspecified.
	ClipBehavior Clip
	// contains filtered or unexported fields
}

ClipRRectLayer clips the layers under it to a rounded rectangle.

Flutter: flow/layers/clip_rrect_layer.h ClipRRectLayer

func (*ClipRRectLayer) Children

func (b *ClipRRectLayer) Children() []Layer

Children returns the layers under this one.

Flutter: no counterpart

func (*ClipRRectLayer) HasTexture

func (b *ClipRRectLayer) HasTexture() bool

HasTexture reports whether this layer or a layer under it is a TextureLayer.

Flutter: no counterpart

func (*ClipRRectLayer) OldLayer

func (b *ClipRRectLayer) OldLayer() Layer

OldLayer returns the layer of the previous frame this one replaces.

Flutter: no counterpart

type ClipRSuperellipseEngineLayer

type ClipRSuperellipseEngineLayer struct {
	// contains filtered or unexported fields
}

ClipRSuperellipseEngineLayer is the handle PushClipRSuperellipse returns.

Flutter: ui/compositing.dart ClipRSuperellipseEngineLayer

func (*ClipRSuperellipseEngineLayer) Dispose

func (h *ClipRSuperellipseEngineLayer) Dispose()

Dispose releases the handle.

Flutter: ui/compositing.dart _EngineLayerWrapper.dispose

func (*ClipRSuperellipseEngineLayer) Layer

func (h *ClipRSuperellipseEngineLayer) Layer() Layer

Layer returns the layer the handle stands for.

Flutter: no counterpart

type ClipRSuperellipseLayer

type ClipRSuperellipseLayer struct {

	// RSuperellipse is the clip shape.
	RSuperellipse RSuperellipse
	// ClipBehavior says how the edge is clipped; never ClipUnspecified.
	ClipBehavior Clip
	// contains filtered or unexported fields
}

ClipRSuperellipseLayer clips the layers under it to a rounded superellipse.

Flutter: flow/layers/clip_rsuperellipse_layer.h ClipRSuperellipseLayer

func (*ClipRSuperellipseLayer) Children

func (b *ClipRSuperellipseLayer) Children() []Layer

Children returns the layers under this one.

Flutter: no counterpart

func (*ClipRSuperellipseLayer) HasTexture

func (b *ClipRSuperellipseLayer) HasTexture() bool

HasTexture reports whether this layer or a layer under it is a TextureLayer.

Flutter: no counterpart

func (*ClipRSuperellipseLayer) OldLayer

func (b *ClipRSuperellipseLayer) OldLayer() Layer

OldLayer returns the layer of the previous frame this one replaces.

Flutter: no counterpart

type ClipRectEngineLayer

type ClipRectEngineLayer struct {
	// contains filtered or unexported fields
}

ClipRectEngineLayer is the handle PushClipRect returns.

Flutter: ui/compositing.dart ClipRectEngineLayer

func (*ClipRectEngineLayer) Dispose

func (h *ClipRectEngineLayer) Dispose()

Dispose releases the handle.

Flutter: ui/compositing.dart _EngineLayerWrapper.dispose

func (*ClipRectEngineLayer) Layer

func (h *ClipRectEngineLayer) Layer() Layer

Layer returns the layer the handle stands for.

Flutter: no counterpart

type ClipRectLayer

type ClipRectLayer struct {

	// Rect is the clip shape.
	Rect Rect
	// ClipBehavior says how the edge is clipped; never ClipUnspecified.
	ClipBehavior Clip
	// contains filtered or unexported fields
}

ClipRectLayer clips the layers under it to a rectangle.

Flutter: flow/layers/clip_rect_layer.h ClipRectLayer

func (*ClipRectLayer) Children

func (b *ClipRectLayer) Children() []Layer

Children returns the layers under this one.

Flutter: no counterpart

func (*ClipRectLayer) HasTexture

func (b *ClipRectLayer) HasTexture() bool

HasTexture reports whether this layer or a layer under it is a TextureLayer.

Flutter: no counterpart

func (*ClipRectLayer) OldLayer

func (b *ClipRectLayer) OldLayer() Layer

OldLayer returns the layer of the previous frame this one replaces.

Flutter: no counterpart

type ClipRectOpts

type ClipRectOpts struct {
	// ClipOp says whether the rectangle is intersected with the clip (the zero
	// value, Flutter's default) or subtracted from it.
	ClipOp ClipOp
	// DoAntiAlias says whether the edge is smoothed; nil means true, Flutter's
	// default.
	DoAntiAlias *bool
}

ClipRectOpts are the optional arguments of ClipRect.

Flutter: ui/painting.dart Canvas.clipRect

type ClipboardContent

type ClipboardContent struct {
	// Text is the plain text; HasText says whether there is any (the empty
	// string is a text).
	Text    string
	HasText bool
	// PNG is the image, in the PNG format; nil for none.
	PNG []byte
	// URIs are the URIs of the files or other resources; nil for none.
	URIs []string
	// HTML is a fragment of HTML, in UTF-8: the markup that stands for the
	// content in a program that pastes formatted text (the "text/html" format).
	// The empty string is none. It is a fragment, not a document: no <html> or
	// <body> is needed, and a platform that carries a whole document (Windows'
	// CF_HTML) puts the fragment inside one and reads it back out.
	HTML string
}

ClipboardContent is what a clipboard holds, in the formats it has. A content with several formats is one copy: the same thing in different shapes (a file manager offers the URIs and their names as text).

Flutter: no counterpart

func (ClipboardContent) Has

func (c ClipboardContent) Has(format string) bool

Has reports whether the content has the format.

Flutter: no counterpart

func (ClipboardContent) IsEmpty

func (c ClipboardContent) IsEmpty() bool

IsEmpty reports whether the content has no format.

Flutter: no counterpart

type ClipboardHost

type ClipboardHost interface {
	// SetClipboardText makes text the content of the clipboard; done, when it is
	// not nil, gets the error if any.
	SetClipboardText(ctx context.Context, text string, done func(err error))
	// GetClipboardText reads the text of the clipboard; ok is false when the
	// clipboard has no text.
	GetClipboardText(ctx context.Context, done func(text string, ok bool, err error))
}

ClipboardHost is what the engine implements to give access to the system clipboard. The dispatcher uses it when the host has it; a host without it fails the clipboard calls with ClipboardUnavailable. The functions that the methods take are called later on the UI thread, never before the method has returned.

Flutter: no counterpart (the engine's side of the Clipboard calls of the flutter/platform channel)

type ClipboardKind

type ClipboardKind int

ClipboardKind is the selection a clipboard call is about.

Flutter: no counterpart (Flutter has the system clipboard only)

const (
	// ClipboardKindUnspecified is the zero value: the system clipboard.
	//
	// Flutter: no counterpart
	ClipboardKindUnspecified ClipboardKind = iota
	// ClipboardKindSystem is the clipboard of copy and paste.
	//
	// Flutter: no counterpart
	ClipboardKindSystem
	// ClipboardKindPrimary is the primary selection of Linux desktops: the text
	// that is selected, which a middle click pastes.
	//
	// Flutter: no counterpart
	ClipboardKindPrimary
)

The values of ClipboardKind.

func (ClipboardKind) String

func (k ClipboardKind) String() string

String names the kind.

Flutter: no counterpart

type Codec

type Codec struct {
	// contains filtered or unexported fields
}

Codec is a decoded still or animated image, from which the frames are read.

Flutter: ui/painting.dart Codec

func InstantiateImageCodec

func InstantiateImageCodec(ctx context.Context, data []byte, opts ...InstantiateImageCodecOpts) (*Codec, error)

InstantiateImageCodec decodes an image from its encoded bytes: PNG, JPEG, GIF (with every frame and its duration), WebP (not animated) or BMP. The pixels are premultiplied RGBA. A scale target resizes every frame with a Catmull-Rom filter. It fails with ImageDecodeFailed when the data is not an image of a supported format, is damaged, or is too large (more than 67 million pixels), with ImageSizeInvalid for a negative target, and with ImageDecodeCanceled when ctx is done.

Deviation: Flutter's returns a Future and decodes lazily; this decodes at once. The orientation in a JPEG's EXIF data is not applied.

Flutter: ui/painting.dart instantiateImageCodec

func (*Codec) Dispose

func (c *Codec) Dispose()

Dispose releases the codec. The frames already returned stay valid.

Flutter: ui/painting.dart Codec.dispose

func (*Codec) FrameCount

func (c *Codec) FrameCount() int

FrameCount is the number of frames: 1 for a still image.

Flutter: ui/painting.dart Codec.frameCount

func (*Codec) GetNextFrame

func (c *Codec) GetNextFrame(ctx context.Context) (FrameInfo, error)

GetNextFrame returns the next frame, going back to the first after the last. It fails with the tag CodecDisposed after Dispose.

Deviation: Flutter's returns a Future; the frames are decoded when the codec is made, so this returns at once.

Flutter: ui/painting.dart Codec.getNextFrame

func (*Codec) RepetitionCount

func (c *Codec) RepetitionCount() int

RepetitionCount is the number of times the animation repeats after the first play: 0 plays it once, -1 repeats it forever, and a positive number repeats it that many times. A still image is 0.

Flutter: ui/painting.dart Codec.repetitionCount

type Color

type Color struct {
	// A is the alpha channel: 0 is transparent and 1 is opaque.
	A float32
	// R is the red channel.
	R float32
	// G is the green channel.
	G float32
	// B is the blue channel.
	B float32
	// ColorSpace is the color space of the components. Its zero value is sRGB.
	ColorSpace ColorSpace
}

Color is an immutable color value, with float32 alpha, red, green and blue components in a color space. In the sRGB space the components are from 0 to 1; in the extended sRGB space they can be outside that range.

The zero value is transparent black in sRGB. It can be written as a literal: Color{A: 1, R: 1}.

Flutter: ui/painting.dart Color

func ColorAlphaBlend

func ColorAlphaBlend(foreground, background Color) Color

ColorAlphaBlend combines the foreground color as a transparent color over a background color, with the same result as drawing the foreground over the background. Both colors must be in the same color space.

Flutter: ui/painting.dart Color.alphaBlend

func ColorLerp

func ColorLerp(x, y *Color, t float64) *Color

ColorLerp linearly interpolates between two colors, either of which may be nil. A nil color counts as transparent: the other color's alpha is scaled. Two nils give nil.

Flutter: ui/painting.dart Color.lerp

func NewColor

func NewColor(value uint32) Color

NewColor constructs a color from the 32-bit value 0xAARRGGBB, in sRGB.

Flutter: ui/painting.dart Color

func NewColorFrom

func NewColorFrom(alpha, red, green, blue float64, opts ...ColorFromOpts) Color

NewColorFrom constructs a color from floating point components.

Flutter: ui/painting.dart Color.from

func NewColorFromARGB

func NewColorFromARGB(a, r, g, b int) Color

NewColorFromARGB constructs a color from the lower 8 bits of four integers: alpha, red, green and blue, in sRGB.

Flutter: ui/painting.dart Color.fromARGB

func NewColorFromRGBO

func NewColorFromRGBO(r, g, b int, opacity float64) Color

NewColorFromRGBO constructs a color from the lower 8 bits of three integers (red, green and blue) and an opacity from 0 to 1, in sRGB.

Flutter: ui/painting.dart Color.fromRGBO

func (Color) Alpha

func (c Color) Alpha() int

Alpha is the alpha channel as an integer from 0 to 255.

Flutter: ui/painting.dart Color.alpha

func (Color) Blue

func (c Color) Blue() int

Blue is the blue channel as an integer from 0 to 255.

Flutter: ui/painting.dart Color.blue

func (Color) ComputeLuminance

func (c Color) ComputeLuminance() float64

ComputeLuminance returns the relative luminance of this color, from 0 for black to 1 for white. Alpha is ignored.

Flutter: ui/painting.dart Color.computeLuminance

func (Color) Green

func (c Color) Green() int

Green is the green channel as an integer from 0 to 255.

Flutter: ui/painting.dart Color.green

func (Color) Lerp

func (c Color) Lerp(y Color, t float64) Color

Lerp linearly interpolates between c and y: c when t is 0, y when t is 1. When the colors are in different color spaces, both are converted to the wider one. The result's components are clamped to 0 to 1.

Flutter: ui/painting.dart Color.lerp

func (Color) Opacity

func (c Color) Opacity() float64

Opacity is the alpha channel from 0 to 1, rounded to 8 bits.

Flutter: ui/painting.dart Color.opacity

func (Color) Red

func (c Color) Red() int

Red is the red channel as an integer from 0 to 255.

Flutter: ui/painting.dart Color.red

func (Color) String

func (c Color) String() string

String describes the color, as Dart's toString does.

Flutter: ui/painting.dart Color.toString

func (Color) ToARGB32

func (c Color) ToARGB32() uint32

ToARGB32 converts the color to the 32-bit value 0xAARRGGBB, clamping each component to 8 bits.

Flutter: ui/painting.dart Color.toARGB32

func (Color) WithAlpha

func (c Color) WithAlpha(a int) Color

WithAlpha returns a new color that matches this color with the alpha channel replaced with a (which is from 0 to 255). The other channels are rounded to 8 bits.

Flutter: ui/painting.dart Color.withAlpha

func (Color) WithBlue

func (c Color) WithBlue(b int) Color

WithBlue returns a new color that matches this color with the blue channel replaced with b (from 0 to 255).

Flutter: ui/painting.dart Color.withBlue

func (Color) WithGreen

func (c Color) WithGreen(g int) Color

WithGreen returns a new color that matches this color with the green channel replaced with g (from 0 to 255).

Flutter: ui/painting.dart Color.withGreen

func (Color) WithOpacity

func (c Color) WithOpacity(opacity float64) Color

WithOpacity returns a new color that matches this color with the alpha channel replaced with the given opacity (from 0 to 1). It loses precision: prefer WithValues.

Flutter: ui/painting.dart Color.withOpacity

func (Color) WithRed

func (c Color) WithRed(r int) Color

WithRed returns a new color that matches this color with the red channel replaced with r (from 0 to 255).

Flutter: ui/painting.dart Color.withRed

func (Color) WithValues

func (c Color) WithValues(opts ...ColorWithValuesOpts) Color

WithValues returns a new color that matches this color with the components replaced, and converted to the color space when one is given. Passing more than one options value panics.

Flutter: ui/painting.dart Color.withValues

type ColorFilter

type ColorFilter struct {
	// contains filtered or unexported fields
}

ColorFilter is 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.

A ColorFilter is also an ImageFilter.

Flutter: ui/painting.dart ColorFilter

func NewColorFilterLinearToSrgbGamma

func NewColorFilterLinearToSrgbGamma() *ColorFilter

NewColorFilterLinearToSrgbGamma creates a color filter that applies the inverse of the sRGB gamma curve to the RGB channels.

Flutter: ui/painting.dart ColorFilter.linearToSrgbGamma

func NewColorFilterMatrix

func NewColorFilterMatrix(matrix [20]float64) *ColorFilter

NewColorFilterMatrix creates a color filter from a 5x4 color matrix, in row-major order. The matrix is applied to the color as a column vector (r, g, b, a, 1) with the components from 0 to 255:

| R' |   | a00 a01 a02 a03 a04 |   | R |
| G' |   | a10 a11 a12 a13 a14 |   | G |
| B' | = | a20 a21 a22 a23 a24 | * | B |
| A' |   | a30 a31 a32 a33 a34 |   | A |
                                    | 1 |

Flutter: ui/painting.dart ColorFilter.matrix

func NewColorFilterMode

func NewColorFilterMode(color Color, blendMode BlendMode) *ColorFilter

NewColorFilterMode creates a color filter that applies the blend mode given as the second argument. The source color is the one given as the first argument, and the destination color is the one from the layer being composited.

Flutter: ui/painting.dart ColorFilter.mode

func NewColorFilterSaturation

func NewColorFilterSaturation(saturation float64) *ColorFilter

NewColorFilterSaturation creates a color filter that scales the saturation: 0 gives grayscale, 1 leaves the colors alone, and more than 1 oversaturates.

Flutter: ui/painting.dart ColorFilter.saturation

func NewColorFilterSrgbToLinearGamma

func NewColorFilterSrgbToLinearGamma() *ColorFilter

NewColorFilterSrgbToLinearGamma creates a color filter that applies the sRGB gamma curve to the RGB channels.

Flutter: ui/painting.dart ColorFilter.srgbToLinearGamma

func (*ColorFilter) BlendMode

func (f *ColorFilter) BlendMode() BlendMode

BlendMode is the blend mode of a mode filter.

Flutter: ui/painting.dart ColorFilter._blendMode

func (*ColorFilter) Color

func (f *ColorFilter) Color() Color

Color is the source color of a mode filter.

Flutter: ui/painting.dart ColorFilter._color

func (*ColorFilter) DebugShortDescription

func (f *ColorFilter) DebugShortDescription() string

DebugShortDescription describes the filter in a few words.

Flutter: ui/painting.dart ColorFilter.debugShortDescription

func (*ColorFilter) Equal

func (f *ColorFilter) Equal(other ImageFilter) bool

Equal reports whether other is a color filter of the same kind and values.

Flutter: ui/painting.dart ColorFilter.operator ==

func (*ColorFilter) Kind

func (f *ColorFilter) Kind() ColorFilterKind

Kind says which kind of filter this is.

Flutter: ui/painting.dart ColorFilter._type

func (*ColorFilter) Matrix

func (f *ColorFilter) Matrix() [20]float64

Matrix is the 5x4 row-major matrix of a matrix filter.

Flutter: ui/painting.dart ColorFilter._matrix

func (*ColorFilter) String

func (f *ColorFilter) String() string

String describes the filter, as Dart's toString does.

Flutter: ui/painting.dart ColorFilter.toString

type ColorFilterEngineLayer

type ColorFilterEngineLayer struct {
	// contains filtered or unexported fields
}

ColorFilterEngineLayer is the handle PushColorFilter returns.

Flutter: ui/compositing.dart ColorFilterEngineLayer

func (*ColorFilterEngineLayer) Dispose

func (h *ColorFilterEngineLayer) Dispose()

Dispose releases the handle.

Flutter: ui/compositing.dart _EngineLayerWrapper.dispose

func (*ColorFilterEngineLayer) Layer

func (h *ColorFilterEngineLayer) Layer() Layer

Layer returns the layer the handle stands for.

Flutter: no counterpart

type ColorFilterKind

type ColorFilterKind int

ColorFilterKind says which kind of ColorFilter a filter is.

Flutter: ui/painting.dart ColorFilter._type

const (
	// ColorFilterKindUnspecified is the zero value; no filter has it.
	//
	// Flutter: no counterpart
	ColorFilterKindUnspecified ColorFilterKind = iota
	// ColorFilterKindMode blends a color over the source with a blend mode.
	//
	// Flutter: ui/painting.dart ColorFilter._kTypeMode
	ColorFilterKindMode
	// ColorFilterKindMatrix multiplies the color by a 5x4 matrix.
	//
	// Flutter: ui/painting.dart ColorFilter._kTypeMatrix
	ColorFilterKindMatrix
	// ColorFilterKindLinearToSrgbGamma converts linear colors to sRGB.
	//
	// Flutter: ui/painting.dart ColorFilter._kTypeLinearToSrgbGamma
	ColorFilterKindLinearToSrgbGamma
	// ColorFilterKindSrgbToLinearGamma converts sRGB colors to linear.
	//
	// Flutter: ui/painting.dart ColorFilter._kTypeSrgbToLinearGamma
	ColorFilterKindSrgbToLinearGamma
)

The kinds of ColorFilter.

type ColorFilterLayer

type ColorFilterLayer struct {

	// Filter is the color filter.
	Filter *ColorFilter
	// contains filtered or unexported fields
}

ColorFilterLayer applies a color filter to the layers under it.

Flutter: flow/layers/color_filter_layer.h ColorFilterLayer

func (*ColorFilterLayer) Children

func (b *ColorFilterLayer) Children() []Layer

Children returns the layers under this one.

Flutter: no counterpart

func (*ColorFilterLayer) HasTexture

func (b *ColorFilterLayer) HasTexture() bool

HasTexture reports whether this layer or a layer under it is a TextureLayer.

Flutter: no counterpart

func (*ColorFilterLayer) OldLayer

func (b *ColorFilterLayer) OldLayer() Layer

OldLayer returns the layer of the previous frame this one replaces.

Flutter: no counterpart

type ColorFromOpts

type ColorFromOpts struct {
	// ColorSpace is the color space of the components; the zero value is sRGB.
	ColorSpace ColorSpace
}

ColorFromOpts are the optional arguments of NewColorFrom.

Flutter: ui/painting.dart Color.from

type ColorSpace

type ColorSpace int

ColorSpace lists the color spaces a Color can be in. Unlike the other enums of this package its zero value is ColorSpaceSRGB, so that a Color written as a literal is in sRGB.

Flutter: ui/painting.dart ColorSpace

const (
	// ColorSpaceSRGB is Flutter's ColorSpace.sRGB. The sRGB color space.
	//
	// Flutter: ui/painting.dart ColorSpace.sRGB
	ColorSpaceSRGB ColorSpace = iota
	// ColorSpaceExtendedSRGB is Flutter's ColorSpace.extendedSRGB. The extended sRGB color space: sRGB with component values outside 0 to 1.
	//
	// Flutter: ui/painting.dart ColorSpace.extendedSRGB
	ColorSpaceExtendedSRGB
	// ColorSpaceDisplayP3 is Flutter's ColorSpace.displayP3. The Display P3 color space, a wider gamut than sRGB.
	//
	// Flutter: ui/painting.dart ColorSpace.displayP3
	ColorSpaceDisplayP3
)

The values of ColorSpace follow Flutter's declaration order.

func (ColorSpace) String

func (e ColorSpace) String() string

String returns the name Dart prints for the value, such as "ColorSpace.sRGB".

type ColorWithValuesOpts

type ColorWithValuesOpts struct {
	// Alpha replaces the alpha channel.
	Alpha *float64
	// Red replaces the red channel.
	Red *float64
	// Green replaces the green channel.
	Green *float64
	// Blue replaces the blue channel.
	Blue *float64
	// ColorSpace converts the color to this color space after the components are
	// replaced.
	ColorSpace *ColorSpace
}

ColorWithValuesOpts are the arguments of Color.WithValues. A nil field leaves that component as it is.

Flutter: ui/painting.dart Color.withValues

type ComposeImageFilter

type ComposeImageFilter struct {
	// contains filtered or unexported fields
}

ComposeImageFilter is the image filter that applies one filter after another.

Flutter: ui/painting.dart _ComposeImageFilter

func (*ComposeImageFilter) DebugShortDescription

func (f *ComposeImageFilter) DebugShortDescription() string

DebugShortDescription describes the filter in a few words.

Flutter: ui/painting.dart _ComposeImageFilter.debugShortDescription

func (*ComposeImageFilter) Equal

func (f *ComposeImageFilter) Equal(other ImageFilter) bool

Equal reports whether other composes equal filters in the same order.

Flutter: ui/painting.dart _ComposeImageFilter.operator ==

func (*ComposeImageFilter) Inner

func (f *ComposeImageFilter) Inner() ImageFilter

Inner is the filter applied first.

Flutter: ui/painting.dart _ComposeImageFilter.innerFilter

func (*ComposeImageFilter) Outer

func (f *ComposeImageFilter) Outer() ImageFilter

Outer is the filter applied last.

Flutter: ui/painting.dart _ComposeImageFilter.outerFilter

func (*ComposeImageFilter) String

func (f *ComposeImageFilter) String() string

String describes the filter, as Dart's toString does.

Flutter: ui/painting.dart _ComposeImageFilter.toString

type ComputePathMetricsOpts

type ComputePathMetricsOpts struct {
	// ForceClosed measures every contour as if it were closed.
	ForceClosed bool
}

ComputePathMetricsOpts are the optional arguments of ComputeMetrics.

Flutter: ui/painting.dart Path.computeMetrics

type ContainerLayer

type ContainerLayer struct {
	// contains filtered or unexported fields
}

ContainerLayer groups layers and applies nothing. The root of a scene is one.

Flutter: flow/layers/container_layer.h ContainerLayer

func (*ContainerLayer) Children

func (b *ContainerLayer) Children() []Layer

Children returns the layers under this one.

Flutter: no counterpart

func (*ContainerLayer) HasTexture

func (b *ContainerLayer) HasTexture() bool

HasTexture reports whether this layer or a layer under it is a TextureLayer.

Flutter: no counterpart

func (*ContainerLayer) OldLayer

func (b *ContainerLayer) OldLayer() Layer

OldLayer returns the layer of the previous frame this one replaces.

Flutter: no counterpart

type ContentType

type ContentType int

ContentType is what a window shows, as a hint to the compositor (Wayland's wp_content_type_v1): a compositor can pick the refresh rate and the latency that suit a game or a video. The zero value is ContentTypeUnspecified.

Flutter: no counterpart

const (
	// ContentTypeUnspecified gives no hint.
	//
	// Flutter: no counterpart
	ContentTypeUnspecified ContentType = iota
	// ContentTypePhoto is a window that shows still pictures.
	//
	// Flutter: no counterpart
	ContentTypePhoto
	// ContentTypeVideo is a window that plays video.
	//
	// Flutter: no counterpart
	ContentTypeVideo
	// ContentTypeGame is a game: the compositor may favor a low latency.
	//
	// Flutter: no counterpart
	ContentTypeGame
)

The values of ContentType.

type ContextMenuHost

type ContextMenuHost interface {
	// SetBrowserContextMenuEnabled shows (true) or hides the browser's context menu. It reports
	// whether a window has a menu to change.
	SetBrowserContextMenuEnabled(enabled bool) bool
}

ContextMenuHost is what the engine implements to show or hide the browser's context menu. The dispatcher uses it when the host has it; a host without it has no such menu.

Flutter: no counterpart (the engine's side of the flutter/contextmenu channel)

type Corners

type Corners struct {
	// TopLeft is the radius of the top left corner.
	TopLeft Radius
	// TopRight is the radius of the top right corner.
	TopRight Radius
	// BottomRight is the radius of the bottom right corner.
	BottomRight Radius
	// BottomLeft is the radius of the bottom left corner.
	BottomLeft Radius
}

Corners holds the radius of each corner, for the constructors that take the corners separately. A zero Radius is a square corner.

Flutter: ui/geometry.dart RRect.fromLTRBAndCorners

type CursorHost

type CursorHost interface {
	// ActivateSystemCursor shows the system cursor of the kind (the kind of a
	// SystemMouseCursor, such as "click") over the window that the device's
	// pointer is in.
	ActivateSystemCursor(device int, kind string)
}

CursorHost is what the engine implements to show the system mouse cursors. The dispatcher uses it when the host has it; a host without it shows none.

Flutter: no counterpart (the engine's side of the flutter/mousecursor channel)

type DecodeImageFromPixelsOpts

type DecodeImageFromPixelsOpts struct {
	// RowBytes is the number of bytes between the start of one row and the next;
	// 0 means the rows are tightly packed, 4 * width.
	RowBytes int
}

DecodeImageFromPixelsOpts are the optional arguments of DecodeImageFromPixels.

Flutter: ui/painting.dart decodeImageFromPixels

type DecorationMode

type DecorationMode int

DecorationMode says who draws the title bar and the borders of a window.

Flutter: no counterpart

const (
	// DecorationNone is a window without a title bar: a borderless window.
	//
	// Flutter: no counterpart
	DecorationNone DecorationMode = iota
	// DecorationServerSide is a window whose title bar the compositor or the window
	// manager draws.
	//
	// Flutter: no counterpart
	DecorationServerSide
	// DecorationLibdecor is a window whose title bar libdecor draws, around the
	// window's surface (Wayland without server-side decorations, such as GNOME).
	//
	// Flutter: no counterpart
	DecorationLibdecor
	// DecorationApp is a window whose title bar the app draws: with
	// WindowConfig.Decorations set to DecorationsApp, or when nothing else is
	// available. The window has to show a WindowDecoration, or its own title bar.
	//
	// Flutter: no counterpart
	DecorationApp
)

The values of DecorationMode.

func (DecorationMode) Name

func (m DecorationMode) Name() string

Name is the name of the mode.

Flutter: no counterpart

func (DecorationMode) String

func (m DecorationMode) String() string

String is "DecorationMode." and the name.

Flutter: no counterpart

type DeviceOrientation

type DeviceOrientation int

DeviceOrientation is an orientation of the device's screen.

Flutter: services/system_chrome.dart DeviceOrientation

const (
	// DeviceOrientationUnspecified is the zero value.
	//
	// Flutter: no counterpart
	DeviceOrientationUnspecified DeviceOrientation = iota
	// DeviceOrientationPortraitUp is upright portrait.
	//
	// Flutter: services/system_chrome.dart DeviceOrientation.portraitUp
	DeviceOrientationPortraitUp
	// DeviceOrientationLandscapeLeft is landscape, turned to the left.
	//
	// Flutter: services/system_chrome.dart DeviceOrientation.landscapeLeft
	DeviceOrientationLandscapeLeft
	// DeviceOrientationPortraitDown is upside-down portrait.
	//
	// Flutter: services/system_chrome.dart DeviceOrientation.portraitDown
	DeviceOrientationPortraitDown
	// DeviceOrientationLandscapeRight is landscape, turned to the right.
	//
	// Flutter: services/system_chrome.dart DeviceOrientation.landscapeRight
	DeviceOrientationLandscapeRight
)

The values of DeviceOrientation follow Flutter's declaration order.

type DilateImageFilter

type DilateImageFilter struct {
	// contains filtered or unexported fields
}

DilateImageFilter is the morphological dilation image filter.

Flutter: ui/painting.dart _DilateImageFilter

func (*DilateImageFilter) DebugShortDescription

func (f *DilateImageFilter) DebugShortDescription() string

DebugShortDescription describes the filter in a few words.

Flutter: ui/painting.dart _DilateImageFilter.debugShortDescription

func (*DilateImageFilter) Equal

func (f *DilateImageFilter) Equal(other ImageFilter) bool

Equal reports whether other is a dilation with the same radii.

Flutter: ui/painting.dart _DilateImageFilter.operator ==

func (*DilateImageFilter) RadiusX

func (f *DilateImageFilter) RadiusX() float64

RadiusX is the radius on the x axis.

Flutter: ui/painting.dart _DilateImageFilter.radiusX

func (*DilateImageFilter) RadiusY

func (f *DilateImageFilter) RadiusY() float64

RadiusY is the radius on the y axis.

Flutter: ui/painting.dart _DilateImageFilter.radiusY

func (*DilateImageFilter) String

func (f *DilateImageFilter) String() string

String describes the filter, as Dart's toString does.

Flutter: ui/painting.dart _DilateImageFilter.toString

type Display

type Display struct {
	// ID identifies the display.
	ID int
	// DevicePixelRatio is the number of physical pixels per logical pixel on
	// the display.
	DevicePixelRatio float64
	// Size is the size of the display in physical pixels.
	Size Size
	// RefreshRate is the refresh rate in frames per second.
	RefreshRate float64
}

Display is a physical display (a monitor) that a view can be on.

Flutter: ui/window.dart Display

func (Display) String

func (d Display) String() string

String describes the display, such as "Display(id: 1, size: 1920.0x1080.0)".

Flutter: ui/window.dart Display.toString

type DisplayList

type DisplayList struct {
	// contains filtered or unexported fields
}

DisplayList is the list of drawing commands a PictureRecorder recorded. It is immutable.

Flutter: no counterpart (flutter::DisplayList)

func (*DisplayList) CullRect

func (d *DisplayList) CullRect() Rect

CullRect is the rectangle the canvas was created with, outside of which the picture has no content that matters.

Flutter: no counterpart

func (*DisplayList) Ops

func (d *DisplayList) Ops() []DisplayOp

Ops returns the operations in the order they were recorded. The slice is the list's own: callers must not change it.

Flutter: no counterpart

type DisplayOp

type DisplayOp interface {
	// contains filtered or unexported methods
}

DisplayOp is one recorded drawing command of a Canvas. The renderers walk the operations of a Picture's DisplayList and draw them; apps do not need it. The operations are the exported structs below, so a renderer picks one with a type switch. An operation is a value: it is never changed after it is recorded, and it holds copies of the paths and paints it was given.

Flutter: no counterpart (Flutter's engine records a C++ DisplayList)

type DragRequest

type DragRequest struct {
	// ID identifies the request; the DropEvents of the operation that reach this app
	// carry it as LocalID. It is not 0.
	ID uint64
	// Text is the text to offer as text/plain.
	Text string
	// URIs are the URIs to offer as text/uri-list (file:// URIs for files).
	URIs []string
	// Actions are the actions the app allows; none means copy.
	Actions DropActions
}

DragRequest is a drag and drop operation that the app starts.

Flutter: no counterpart

type DragResult

type DragResult struct {
	// ID is the ID of the DragRequest.
	ID uint64
	// Action is the action that the target performed; DropActionNone when the drag
	// was cancelled or dropped where it is not accepted.
	Action DropActions
}

DragResult is how a drag and drop operation that the app started ended.

Flutter: no counterpart

type DropActions

type DropActions uint8

DropActions is a set of the actions a drag and drop operation may perform.

Flutter: no counterpart (Flutter has no drag and drop between apps)

const (
	// DropActionCopy copies the data to the target.
	//
	// Flutter: no counterpart
	DropActionCopy DropActions = 1 << iota
	// DropActionMove moves the data to the target: the source removes it.
	//
	// Flutter: no counterpart
	DropActionMove
	// DropActionLink makes a link to the data at the target.
	//
	// Flutter: no counterpart
	DropActionLink

	// DropActionNone is no action: the drop is not accepted.
	//
	// Flutter: no counterpart
	DropActionNone DropActions = 0
)

The actions of a drag and drop operation.

func (DropActions) Has

func (s DropActions) Has(a DropActions) bool

Has reports whether the set contains all the actions of a.

Flutter: no counterpart

type DropEvent

type DropEvent struct {
	// ViewID is the view the drag is over.
	ViewID ViewID
	// Phase says what happened.
	Phase DropPhase
	// Position is where the pointer is over the view, in physical pixels.
	Position Offset
	// Types are the MIME types that the source offers, such as "text/uri-list".
	Types []string
	// Actions are the actions the source allows.
	Actions DropActions
	// Text is the text of the drag (text/plain), in a drop.
	Text string
	// URIs are the URIs of the drag (text/uri-list), in a drop: the files that a file
	// manager drags are file:// URIs.
	URIs []string
	// LocalID is not 0 when the source is this app: the ID of the DragRequest that
	// started it.
	LocalID uint64
}

DropEvent is a drag and drop operation of another application (or of this one, through the platform) over a view.

Flutter: no counterpart

type DropHost

type DropHost interface {
	// StartDrag starts a drag from the window of the view. It must be called while
	// the pointer button that started the drag is down. The result of the operation
	// arrives through PlatformDispatcher.DispatchDragEnd.
	StartDrag(view ViewID, request DragRequest) error
}

DropHost is what the engine implements to start a drag and drop operation and to take part in the ones of other applications.

Flutter: no counterpart

type DropPhase

type DropPhase int

DropPhase is what a DropEvent says happened.

Flutter: no counterpart

const (
	// DropPhaseEnter is a drag that came into the view.
	//
	// Flutter: no counterpart
	DropPhaseEnter DropPhase = iota
	// DropPhaseMove is a drag that moved over the view.
	//
	// Flutter: no counterpart
	DropPhaseMove
	// DropPhaseLeave is a drag that left the view without a drop.
	//
	// Flutter: no counterpart
	DropPhaseLeave
	// DropPhaseDrop is a drag that was dropped on the view; the event has the data.
	//
	// Flutter: no counterpart
	DropPhaseDrop
)

The phases of a drag and drop operation over a view.

type EngineLayer

type EngineLayer interface {
	// Dispose releases the handle. A disposed layer cannot be added with
	// AddRetained.
	Dispose()
	// contains filtered or unexported methods
}

EngineLayer is a handle to a layer a SceneBuilder pushed. Keep it, and pass it as the OldLayer of the same kind of push in the next frame, to say that the new layer replaces it; or pass it to AddRetained to put the same layer in another scene without building it again.

Flutter: ui/painting.dart EngineLayer

type ErodeImageFilter

type ErodeImageFilter struct {
	// contains filtered or unexported fields
}

ErodeImageFilter is the morphological erosion image filter.

Flutter: ui/painting.dart _ErodeImageFilter

func (*ErodeImageFilter) DebugShortDescription

func (f *ErodeImageFilter) DebugShortDescription() string

DebugShortDescription describes the filter in a few words.

Flutter: ui/painting.dart _ErodeImageFilter.debugShortDescription

func (*ErodeImageFilter) Equal

func (f *ErodeImageFilter) Equal(other ImageFilter) bool

Equal reports whether other is an erosion with the same radii.

Flutter: ui/painting.dart _ErodeImageFilter.operator ==

func (*ErodeImageFilter) RadiusX

func (f *ErodeImageFilter) RadiusX() float64

RadiusX is the radius on the x axis.

Flutter: ui/painting.dart _ErodeImageFilter.radiusX

func (*ErodeImageFilter) RadiusY

func (f *ErodeImageFilter) RadiusY() float64

RadiusY is the radius on the y axis.

Flutter: ui/painting.dart _ErodeImageFilter.radiusY

func (*ErodeImageFilter) String

func (f *ErodeImageFilter) String() string

String describes the filter, as Dart's toString does.

Flutter: ui/painting.dart _ErodeImageFilter.toString

type ExtractPathOpts

type ExtractPathOpts struct {
	// StartWithMoveTo says whether the new path starts with a move to the start of
	// the extracted part; nil means true, Flutter's default. When false the part
	// continues the path being built, if it is added with ExtendWithPath.
	StartWithMoveTo *bool
}

ExtractPathOpts are the optional arguments of PathMetric.ExtractPath.

Flutter: ui/painting.dart PathMetric.extractPath

type FilterQuality

type FilterQuality int

FilterQuality is the quality of filtering to use when an image is scaled. The default for a Paint is FilterQualityNone.

Flutter: ui/painting.dart FilterQuality

const (
	// FilterQualityUnspecified is the zero value: the default.
	//
	// Flutter: no counterpart
	FilterQualityUnspecified FilterQuality = iota
	// FilterQualityNone is Flutter's FilterQuality.none. Fastest possible filtering, albeit also the lowest quality: nearest-neighbor sampling.
	//
	// Flutter: ui/painting.dart FilterQuality.none
	FilterQualityNone
	// FilterQualityLow is Flutter's FilterQuality.low. Better quality than none, faster than medium: bilinear interpolation.
	//
	// Flutter: ui/painting.dart FilterQuality.low
	FilterQualityLow
	// FilterQualityMedium is Flutter's FilterQuality.medium. Better quality than low, faster than high: bilinear interpolation with mipmaps.
	//
	// Flutter: ui/painting.dart FilterQuality.medium
	FilterQualityMedium
	// FilterQualityHigh is Flutter's FilterQuality.high. Best possible quality when scaling up images, scaling down images (slow).
	//
	// Flutter: ui/painting.dart FilterQuality.high
	FilterQualityHigh
)

The values of FilterQuality follow Flutter's declaration order.

func (FilterQuality) Name

func (e FilterQuality) Name() string

Name returns the Dart enum name, such as "medium".

Flutter: dart:core Enum.name

func (FilterQuality) String

func (e FilterQuality) String() string

String returns the name Dart prints for the value, such as "FilterQuality.none".

type FlatContour

type FlatContour struct {
	// Points are the vertices of the polyline. For a closed contour the first
	// point is not repeated at the end.
	Points []Offset
	// Closed says that the contour was closed: the last point connects to the
	// first.
	Closed bool
}

FlatContour is a contour of a path turned into straight lines.

Flutter: no counterpart

type FontFeature

type FontFeature struct {
	// Feature is the four-letter OpenType feature tag.
	Feature string
	// Value is 0 to turn the feature off, 1 to turn it on, or the index of an alternate.
	Value int
}

FontFeature is a feature tag and a value that configures the font's OpenType features, such as "liga" or "tnum".

Flutter: ui/text.dart FontFeature

func NewFontFeature

func NewFontFeature(feature string, value int) FontFeature

NewFontFeature creates a feature. A tag that is not four letters long, or a negative value, panics with the tag FontFeatureInvalid.

Flutter: ui/text.dart FontFeature

func (FontFeature) String

func (f FontFeature) String() string

String returns what Dart prints, such as "FontFeature(liga, 1)".

type FontLoadingEngine

type FontLoadingEngine interface {
	ParagraphFactory
	// LoadFontFromList adds the font in list (a TrueType or OpenType file) to the
	// family, or to the family named in the font when family is empty.
	LoadFontFromList(list []byte, family string) error
}

FontLoadingEngine is a ParagraphFactory that can take fonts at run time. internal/text/layout's Engine implements it; PlatformDispatcher.LoadFontFromList uses it.

Flutter: no counterpart

type FontMetrics

type FontMetrics struct {
	// Ascent and Descent are the distances from the baseline up to the top and down to the bottom of a
	// line in the style, as the paragraph's line metrics (ComputeLineMetrics) give them: each includes
	// half of Leading, and the style's Height, if it has one, is applied. The baseline of a one-line
	// paragraph is Ascent below its top.
	Ascent, Descent float64
	// Leading is the line gap of the font (the space it asks between two lines), at the size.
	Leading float64
	// Height is the height of a paragraph of one line in the style: Ascent and Descent added and rounded.
	Height float64
	// ZeroAdvance is the advance of the digit "0": the width of a cell of a grid of a monospaced font.
	ZeroAdvance float64
	// Monospaced says that the font says it is monospaced (the post table's fixed pitch flag, or all its
	// glyphs having the same advance, as fontconfig decides). It is false when the font does not say.
	Monospaced bool
}

FontMetrics are the vertical metrics and the width of a digit of the font that a text style draws with, at the style's size, in logical pixels (PlatformDispatcher.FontMetrics). They are what a paragraph of one line in that style measures, so a grid of cells (a terminal) can be sized from them without laying out and measuring a paragraph.

Flutter: no counterpart

type FontMetricsEngine

type FontMetricsEngine interface {
	ParagraphFactory
	// FontMetrics measures the face that the style draws the digit "0" with, the way a paragraph of
	// one line in that style does.
	FontMetrics(style *ResolvedTextStyle) FontMetrics
}

FontMetricsEngine is a ParagraphFactory that can measure the font of a style without a paragraph of the caller's. internal/text/layout's Engine implements it; PlatformDispatcher.FontMetrics uses it.

Flutter: no counterpart

type FontOrigin

type FontOrigin int

FontOrigin says where a font comes from. The zero value is FontOriginUnspecified.

Flutter: no counterpart

const (
	// FontOriginUnspecified is the zero value: no font.
	//
	// Flutter: no counterpart
	FontOriginUnspecified FontOrigin = iota
	// FontOriginLoaded is a font that the app loaded (LoadFontFromList, FontLoader,
	// RunAppOpts.Fonts, gluttertest.Opts.Fonts).
	//
	// Flutter: no counterpart
	FontOriginLoaded
	// FontOriginBundled is a font that Glutter bundles (Roboto, Material Icons).
	//
	// Flutter: no counterpart
	FontOriginBundled
	// FontOriginSystem is a font file of the system.
	//
	// Flutter: no counterpart
	FontOriginSystem
)

The values of FontOrigin.

type FontQueryEngine

type FontQueryEngine interface {
	ParagraphFactory
	// ResolveFont says which face the family resolves to for a weight and a slant,
	// the one that draws a letter of a TextStyle that names only that family; false when
	// the family has no font.
	ResolveFont(family string, weight FontWeight, style FontStyle) (ResolvedFont, bool)
	// InstalledFontFamilies lists the families of the system's, bundled and loaded fonts.
	InstalledFontFamilies() []string
}

FontQueryEngine is a ParagraphFactory that can say which fonts it has. internal/text/layout's Engine implements it; PlatformDispatcher.ResolveFont and InstalledFontFamilies use it.

Flutter: no counterpart

type FontStyle

type FontStyle int

FontStyle is whether to use italic or upright glyphs.

Flutter: ui/text.dart FontStyle

const (
	// FontStyleUnspecified is the zero value: the default (upright).
	//
	// Flutter: no counterpart
	FontStyleUnspecified FontStyle = iota
	// FontStyleNormal uses the upright ("Roman") glyphs.
	//
	// Flutter: ui/text.dart FontStyle.normal
	FontStyleNormal
	// FontStyleItalic uses glyphs that have a more pronounced angle and typically a cursive style.
	//
	// Flutter: ui/text.dart FontStyle.italic
	FontStyleItalic
)

The values of FontStyle follow Flutter's declaration order.

func (FontStyle) Name

func (e FontStyle) Name() string

Name returns the Dart enum name, such as "italic".

Flutter: dart:core Enum.name

func (FontStyle) String

func (e FontStyle) String() string

String returns the name Dart prints for the value, such as "FontStyle.italic".

type FontVariation

type FontVariation struct {
	// Axis is the four-letter axis tag.
	Axis string
	// Value is the value on the axis, in the font's design units.
	Value float64
}

FontVariation is an axis tag and a value that configures the font's variable axes, such as "wght" or "wdth".

Flutter: ui/text.dart FontVariation

func FontVariationLerp

func FontVariationLerp(a, b *FontVariation, t float64) *FontVariation

FontVariationLerp linearly interpolates between two font variations. Either may be nil. When the axes differ, or both are nil, the result is a for t < 0.5 and b otherwise.

Flutter: ui/text.dart FontVariation.lerp

func NewFontVariation

func NewFontVariation(axis string, value float64) FontVariation

NewFontVariation creates a variation. A tag that is not four letters long, or a value outside -32768 to 32768, panics with the tag FontVariationInvalid.

Flutter: ui/text.dart FontVariation

func (FontVariation) String

func (v FontVariation) String() string

String returns what Dart prints, such as "FontVariation(wght, 700)".

type FontWeight

type FontWeight int

FontWeight is the thickness of the glyphs used to draw the text, from 1 to 1000. The zero value is unspecified: the default (400).

Flutter: ui/text.dart FontWeight

const (
	// FontWeightW100 is thin, the least thick.
	//
	// Flutter: ui/text.dart FontWeight.w100
	FontWeightW100 FontWeight = 100
	// FontWeightW200 is extra-light.
	//
	// Flutter: ui/text.dart FontWeight.w200
	FontWeightW200 FontWeight = 200
	// FontWeightW300 is light.
	//
	// Flutter: ui/text.dart FontWeight.w300
	FontWeightW300 FontWeight = 300
	// FontWeightW400 is normal / regular / plain.
	//
	// Flutter: ui/text.dart FontWeight.w400
	FontWeightW400 FontWeight = 400
	// FontWeightW500 is medium.
	//
	// Flutter: ui/text.dart FontWeight.w500
	FontWeightW500 FontWeight = 500
	// FontWeightW600 is semi-bold.
	//
	// Flutter: ui/text.dart FontWeight.w600
	FontWeightW600 FontWeight = 600
	// FontWeightW700 is bold.
	//
	// Flutter: ui/text.dart FontWeight.w700
	FontWeightW700 FontWeight = 700
	// FontWeightW800 is extra-bold.
	//
	// Flutter: ui/text.dart FontWeight.w800
	FontWeightW800 FontWeight = 800
	// FontWeightW900 is black, the most thick.
	//
	// Flutter: ui/text.dart FontWeight.w900
	FontWeightW900 FontWeight = 900
	// FontWeightNormal is the default font weight (w400).
	//
	// Flutter: ui/text.dart FontWeight.normal
	FontWeightNormal = FontWeightW400
	// FontWeightBold is a commonly used font weight that is heavier than normal (w700).
	//
	// Flutter: ui/text.dart FontWeight.bold
	FontWeightBold = FontWeightW700
)

The conventional weights.

func FontWeightLerp

func FontWeightLerp(a, b FontWeight, t float64) FontWeight

FontWeightLerp linearly interpolates between two font weights, where FontWeight(0) is Flutter's null: it counts as normal when the other is set. It returns 0 for two nulls. The result is rounded and clamped to 100 to 900.

Flutter: ui/text.dart FontWeight.lerp

func NewFontWeight

func NewFontWeight(value int) FontWeight

NewFontWeight returns the weight with the given value. A value outside 1 to 1000 panics with the tag FontWeightInvalid.

Flutter: ui/text.dart FontWeight

func (FontWeight) String

func (w FontWeight) String() string

String returns the name Dart prints for the value, such as "FontWeight.w400".

func (FontWeight) Value

func (w FontWeight) Value() int

Value is the weight as a number from 1 to 1000, or 0 when unspecified.

Flutter: ui/text.dart FontWeight.value

type FrameInfo

type FrameInfo struct {
	// Duration is how long the frame is shown; 0 for a still image.
	Duration time.Duration
	// Image is the frame. The caller disposes it.
	Image *Image
}

FrameInfo is one frame of an image: how long to show it, and its pixels.

Flutter: ui/painting.dart FrameInfo

type FramePhase

type FramePhase int

FramePhase is a moment of a frame that a FrameTiming records.

Flutter: ui/platform_dispatcher.dart FramePhase

const (
	// FramePhaseUnspecified is the zero value: not a phase.
	//
	// Flutter: no counterpart
	FramePhaseUnspecified FramePhase = iota
	// FramePhaseVsyncStart is when the platform asked for the frame (the compositor's
	// frame callback).
	//
	// Flutter: ui/platform_dispatcher.dart FramePhase.vsyncStart
	FramePhaseVsyncStart
	// FramePhaseBuildStart is when the framework began to build the frame (OnBeginFrame).
	//
	// Flutter: ui/platform_dispatcher.dart FramePhase.buildStart
	FramePhaseBuildStart
	// FramePhaseBuildFinish is when the framework handed the scene over to be drawn.
	//
	// Flutter: ui/platform_dispatcher.dart FramePhase.buildFinish
	FramePhaseBuildFinish
	// FramePhaseRasterStart is when the renderer began to draw the scene.
	//
	// Flutter: ui/platform_dispatcher.dart FramePhase.rasterStart
	FramePhaseRasterStart
	// FramePhaseRasterFinish is when the renderer was done drawing and had presented the
	// frame.
	//
	// Flutter: ui/platform_dispatcher.dart FramePhase.rasterFinish
	FramePhaseRasterFinish
	// FramePhaseRasterFinishWallTime is the wall-clock time at which the frame was
	// rasterized.
	//
	// Flutter: ui/platform_dispatcher.dart FramePhase.rasterFinishWallTime
	FramePhaseRasterFinishWallTime
)

The phases of a frame, in the order they happen.

type FrameTiming

type FrameTiming struct {
	// contains filtered or unexported fields
}

FrameTiming says when the phases of a frame happened and how long its parts took, as the engine measured them: a tool to find the frames that were too slow.

Deviation: the times are time.Duration from an arbitrary fixed point, not integers of microseconds, and vsyncStart is the start of the build when the platform's frame time is not on the clock the engine measures with (SPEC §12.10).

Flutter: ui/platform_dispatcher.dart FrameTiming

func NewFrameTiming

func NewFrameTiming(vsyncStart, buildStart, buildFinish, rasterStart, rasterFinish, rasterFinishWallTime time.Duration, frameNumber int, opts ...FrameTimingOpts) FrameTiming

NewFrameTiming creates the record of a frame. The times are from one fixed point, each not before the one before it, except the wall time.

Flutter: ui/platform_dispatcher.dart FrameTiming.new

func (FrameTiming) BuildDuration

func (t FrameTiming) BuildDuration() time.Duration

BuildDuration is how long the framework took to build the frame: the time spent in the animation callbacks, the build, the layout and the paint.

Flutter: ui/platform_dispatcher.dart FrameTiming.buildDuration

func (FrameTiming) FrameNumber

func (t FrameTiming) FrameNumber() int

FrameNumber is the number of the frame, counted from 1 by the engine.

Flutter: ui/platform_dispatcher.dart FrameTiming.frameNumber

func (FrameTiming) LayerCacheBytes

func (t FrameTiming) LayerCacheBytes() int

LayerCacheBytes is the size of the layers in the raster cache.

Flutter: ui/platform_dispatcher.dart FrameTiming.layerCacheBytes

func (FrameTiming) LayerCacheCount

func (t FrameTiming) LayerCacheCount() int

LayerCacheCount is the number of layers in the raster cache.

Flutter: ui/platform_dispatcher.dart FrameTiming.layerCacheCount

func (FrameTiming) PictureCacheBytes

func (t FrameTiming) PictureCacheBytes() int

PictureCacheBytes is the size of the pictures in the raster cache.

Flutter: ui/platform_dispatcher.dart FrameTiming.pictureCacheBytes

func (FrameTiming) PictureCacheCount

func (t FrameTiming) PictureCacheCount() int

PictureCacheCount is the number of pictures in the raster cache.

Flutter: ui/platform_dispatcher.dart FrameTiming.pictureCacheCount

func (FrameTiming) RasterDuration

func (t FrameTiming) RasterDuration() time.Duration

RasterDuration is how long the renderer took to draw the frame and present it.

Flutter: ui/platform_dispatcher.dart FrameTiming.rasterDuration

func (FrameTiming) String

func (t FrameTiming) String() string

String describes the timing as Flutter does.

Flutter: ui/platform_dispatcher.dart FrameTiming.toString

func (FrameTiming) TimestampOf

func (t FrameTiming) TimestampOf(phase FramePhase) time.Duration

TimestampOf returns when the phase happened. It panics with the tag FramePhaseInvalid for a value that is not a phase.

Flutter: ui/platform_dispatcher.dart FrameTiming.timestampInMicroseconds

func (FrameTiming) TotalSpan

func (t FrameTiming) TotalSpan() time.Duration

TotalSpan is the time from the platform's request for the frame to the end of the raster.

Flutter: ui/platform_dispatcher.dart FrameTiming.totalSpan

func (FrameTiming) VsyncOverhead

func (t FrameTiming) VsyncOverhead() time.Duration

VsyncOverhead is how long it took from the platform's request for the frame to the start of the build.

Flutter: ui/platform_dispatcher.dart FrameTiming.vsyncOverhead

type FrameTimingOpts

type FrameTimingOpts struct {
	// LayerCacheCount and LayerCacheBytes are the number and the size of the layers
	// in the raster cache.
	LayerCacheCount, LayerCacheBytes int
	// PictureCacheCount and PictureCacheBytes are the number and the size of the pictures
	// in the raster cache.
	PictureCacheCount, PictureCacheBytes int
}

FrameTimingOpts are the optional arguments of NewFrameTiming.

Flutter: ui/platform_dispatcher.dart FrameTiming.new

type GestureSettings

type GestureSettings struct {
	// PhysicalTouchSlop is how far a touch may move before it is a drag.
	PhysicalTouchSlop float64
	// PhysicalDoubleTapSlop is how far apart two taps may be to make a double
	// tap.
	PhysicalDoubleTapSlop float64
}

GestureSettings are the gesture thresholds the platform sets, in physical pixels. A value of 0 means the platform gives none, and the framework uses its own default.

Flutter: ui/window.dart GestureSettings

type GlyphInfo

type GlyphInfo struct {
	// GraphemeClusterLayoutBounds is the layout bounding rectangle of the grapheme cluster, in the paragraph's coordinate system.
	GraphemeClusterLayoutBounds Rect
	// GraphemeClusterRange is the range of the grapheme cluster in the text (byte offsets).
	GraphemeClusterRange TextRange
	// WritingDirection is the direction of the text of the grapheme cluster.
	WritingDirection TextDirection
}

GlyphInfo is the layout information of a grapheme cluster in a paragraph.

Flutter: ui/text.dart GlyphInfo

type Gradient

type Gradient struct {
	// contains filtered or unexported fields
}

Gradient is a shader that renders a color gradient: linear, radial (with an optional focal point, which makes a two-point conical gradient) or sweep. It is immutable.

Flutter: ui/painting.dart Gradient

func NewGradientLinear

func NewGradientLinear(from, to Offset, colors []Color, opts ...GradientLinearOpts) *Gradient

NewGradientLinear creates a linear gradient from one point to another. The colors are given in a list, and the optional color stops say where each is. Passing a list of colors whose length does not fit the stops panics with GradientColorCountInvalid or GradientStopCountMismatch.

Flutter: ui/painting.dart Gradient.linear

func NewGradientRadial

func NewGradientRadial(center Offset, radius float64, colors []Color, opts ...GradientRadialOpts) *Gradient

NewGradientRadial creates a radial gradient centered at center that ends at radius distance from the center. With a Focal point (other than the center, or with a focal radius) it is a two-point conical gradient. Bad color lists panic as in NewGradientLinear.

Flutter: ui/painting.dart Gradient.radial

func NewGradientSweep

func NewGradientSweep(center Offset, colors []Color, opts ...GradientSweepOpts) *Gradient

NewGradientSweep creates a sweep gradient centered at center that starts at StartAngle and ends at EndAngle. Bad color lists panic as in NewGradientLinear.

Flutter: ui/painting.dart Gradient.sweep

func (*Gradient) Center

func (g *Gradient) Center() Offset

Center is the center of a radial, conical or sweep gradient.

Flutter: ui/painting.dart Gradient.radial

func (*Gradient) ColorStops

func (g *Gradient) ColorStops() []float64

ColorStops returns a copy of the color stops, or nil when there are two colors at 0 and 1.

Flutter: ui/painting.dart Gradient.linear

func (*Gradient) Colors

func (g *Gradient) Colors() []Color

Colors returns a copy of the colors, converted to extended sRGB as the engine takes them (their ColorSpace field may still say sRGB: the components are the same).

Flutter: ui/painting.dart _encodeWideColorList

func (*Gradient) EndAngle

func (g *Gradient) EndAngle() float64

EndAngle is the angle a sweep gradient ends at.

Flutter: ui/painting.dart Gradient.sweep

func (*Gradient) Focal

func (g *Gradient) Focal() Offset

Focal is the focal point of a conical gradient.

Flutter: ui/painting.dart Gradient.radial

func (*Gradient) FocalRadius

func (g *Gradient) FocalRadius() float64

FocalRadius is the radius of the focal circle of a conical gradient.

Flutter: ui/painting.dart Gradient.radial

func (*Gradient) From

func (g *Gradient) From() Offset

From is the start point of a linear gradient.

Flutter: ui/painting.dart Gradient.linear

func (*Gradient) Kind

func (g *Gradient) Kind() GradientKind

Kind says which shape of gradient this is.

Flutter: ui/painting.dart Gradient

func (*Gradient) Matrix4

func (g *Gradient) Matrix4() (*Matrix4, bool)

Matrix4 returns a copy of the transform of the gradient, and false when it has none.

Flutter: ui/painting.dart Gradient.linear

func (*Gradient) Radius

func (g *Gradient) Radius() float64

Radius is the radius of a radial or conical gradient.

Flutter: ui/painting.dart Gradient.radial

func (*Gradient) StartAngle

func (g *Gradient) StartAngle() float64

StartAngle is the angle a sweep gradient starts at.

Flutter: ui/painting.dart Gradient.sweep

func (*Gradient) TileMode

func (g *Gradient) TileMode() TileMode

TileMode is what happens outside the gradient's bounds.

Flutter: ui/painting.dart Gradient.linear

func (*Gradient) To

func (g *Gradient) To() Offset

To is the end point of a linear gradient.

Flutter: ui/painting.dart Gradient.linear

type GradientKind

type GradientKind int

GradientKind says what shape of gradient a Gradient is.

Flutter: ui/painting.dart Gradient

const (
	// GradientKindUnspecified is the zero value; no gradient has it.
	//
	// Flutter: no counterpart
	GradientKindUnspecified GradientKind = iota
	// GradientKindLinear changes along the line between two points.
	//
	// Flutter: ui/painting.dart Gradient.linear
	GradientKindLinear
	// GradientKindRadial changes with the distance from a center.
	//
	// Flutter: ui/painting.dart Gradient.radial
	GradientKindRadial
	// GradientKindConical is a two-point conical gradient: a radial one with a
	// focal point and radius.
	//
	// Flutter: ui/painting.dart Gradient.radial
	GradientKindConical
	// GradientKindSweep changes with the angle around a center.
	//
	// Flutter: ui/painting.dart Gradient.sweep
	GradientKindSweep
)

The kinds of Gradient.

type GradientLinearOpts

type GradientLinearOpts struct {
	// ColorStops are the positions, from 0 to 1, of the colors along the line.
	// When nil there must be exactly two colors, at 0 and 1.
	ColorStops []float64
	// TileMode is what happens outside the line; the zero value is
	// TileModeClamp.
	TileMode TileMode
	// Matrix4 transforms the gradient; nil means none.
	Matrix4 *Matrix4
}

GradientLinearOpts are the optional arguments of NewGradientLinear.

Flutter: ui/painting.dart Gradient.linear

type GradientRadialOpts

type GradientRadialOpts struct {
	// ColorStops are the positions, from 0 to 1, of the colors along the radius.
	// When nil there must be exactly two colors, at 0 and 1.
	ColorStops []float64
	// TileMode is what happens outside the radius; the zero value is
	// TileModeClamp.
	TileMode TileMode
	// Matrix4 transforms the gradient; nil means none.
	Matrix4 *Matrix4
	// Focal is the focal point of a two-point conical gradient; nil means a
	// plain radial gradient.
	Focal *Offset
	// FocalRadius is the radius of the focal circle.
	FocalRadius float64
}

GradientRadialOpts are the optional arguments of NewGradientRadial.

Flutter: ui/painting.dart Gradient.radial

type GradientSweepOpts

type GradientSweepOpts struct {
	// ColorStops are the positions, from 0 to 1, of the colors along the sweep.
	// When nil there must be exactly two colors, at 0 and 1.
	ColorStops []float64
	// TileMode is what happens outside the angles; the zero value is
	// TileModeClamp.
	TileMode TileMode
	// StartAngle is where the sweep starts, in radians clockwise from the
	// positive x axis.
	StartAngle float64
	// EndAngle is where the sweep ends. Flutter's default is 2*pi, which is also
	// used here when EndAngle is 0 and StartAngle is not negative (an end of 0
	// is only meaningful after a negative start).
	EndAngle float64
	// Matrix4 transforms the gradient; nil means none.
	Matrix4 *Matrix4
}

GradientSweepOpts are the optional arguments of NewGradientSweep.

Flutter: ui/painting.dart Gradient.sweep

type HapticFeedbackKind

type HapticFeedbackKind int

HapticFeedbackKind is a kind of haptic feedback.

Flutter: services/haptic_feedback.dart HapticFeedback

const (
	// HapticFeedbackUnspecified is the zero value.
	//
	// Flutter: no counterpart
	HapticFeedbackUnspecified HapticFeedbackKind = iota
	// HapticFeedbackVibrate is a vibration of the platform's default length.
	//
	// Flutter: services/haptic_feedback.dart HapticFeedback.vibrate
	HapticFeedbackVibrate
	// HapticFeedbackLightImpact is a light impact.
	//
	// Flutter: services/haptic_feedback.dart HapticFeedback.lightImpact
	HapticFeedbackLightImpact
	// HapticFeedbackMediumImpact is a medium impact.
	//
	// Flutter: services/haptic_feedback.dart HapticFeedback.mediumImpact
	HapticFeedbackMediumImpact
	// HapticFeedbackHeavyImpact is a heavy impact.
	//
	// Flutter: services/haptic_feedback.dart HapticFeedback.heavyImpact
	HapticFeedbackHeavyImpact
	// HapticFeedbackSelectionClick is the tick of a selection that changes.
	//
	// Flutter: services/haptic_feedback.dart HapticFeedback.selectionClick
	HapticFeedbackSelectionClick
)

The values of HapticFeedbackKind.

type IdleInhibitHost

type IdleInhibitHost interface {
	// KeepScreenOn stops the screen from going idle while the window of the view
	// is visible (on is true), or lets it (false). It fails with
	// IdleInhibitUnavailable when the platform cannot.
	KeepScreenOn(view ViewID, on bool) error
}

IdleInhibitHost is what the engine implements to keep the screen from going idle (dimming, blanking and locking). A host without it cannot do it.

Flutter: no counterpart

type Image

type Image struct {
	// contains filtered or unexported fields
}

Image is an image that has been decoded, or rendered, into pixels. It is a handle: Clone makes another handle on the same pixels, and each handle is disposed by itself.

Flutter: ui/painting.dart Image

func DecodeImageFromPixels

func DecodeImageFromPixels(ctx context.Context, pixels []byte, width, height int, format PixelFormat, opts ...DecodeImageFromPixelsOpts) (*Image, error)

DecodeImageFromPixels makes an image from raw pixels. The pixels are copied. The error ImageSizeInvalid says the size is not valid, ImageFormatUnsupported that the format is not known, and ImagePixelsInvalid that the pixels are too few for the size and the row bytes.

TODO(step 2.10): the target size options.

Deviation: Flutter delivers the image through a callback; this returns it.

Flutter: ui/painting.dart decodeImageFromPixels

func NewImageFromRGBA

func NewImageFromRGBA(pix []byte, width, height int) *Image

NewImageFromRGBA wraps premultiplied RGBA pixels that the caller will not change afterwards, without copying them. It is for the renderers, which make images by drawing; apps use DecodeImageFromPixels. It panics with the tag ImagePixelsInvalid when the pixels are not exactly 4 * width * height bytes.

Flutter: no counterpart

func (*Image) Clone

func (i *Image) Clone() *Image

Clone makes another handle on the same pixels.

Flutter: ui/painting.dart Image.clone

func (*Image) Dispose

func (i *Image) Dispose()

Dispose releases the handle. The pixels stay while another handle needs them. Drawing a disposed image is a programmer error.

Flutter: ui/painting.dart Image.dispose

func (*Image) Height

func (i *Image) Height() int

Height is the height of the image in pixels.

Flutter: ui/painting.dart Image.height

func (*Image) IsCloneOf

func (i *Image) IsCloneOf(other *Image) bool

IsCloneOf says whether the two handles share their pixels.

Flutter: ui/painting.dart Image.isCloneOf

func (*Image) IsDisposed

func (i *Image) IsDisposed() bool

IsDisposed says whether the handle has been disposed.

Flutter: ui/painting.dart Image.debugDisposed

func (*Image) Pixels

func (i *Image) Pixels() []byte

Pixels returns the pixels as premultiplied RGBA, 4 bytes each, row by row from the top, without padding. They are shared: callers must not change them.

Flutter: no counterpart (Image.toByteData copies)

func (*Image) String

func (i *Image) String() string

String describes the image, as Dart's toString does: "[100×50]".

Flutter: ui/painting.dart Image.toString

func (*Image) ToByteData

func (i *Image) ToByteData(format ImageByteFormat) ([]byte, error)

ToByteData returns the pixels of the image in the format. The result is a new slice. It fails with the tag ImageDisposed on a disposed image, and with ImageFormatUnsupported for an unknown format.

Deviation: Flutter's returns a Future.

Flutter: ui/painting.dart Image.toByteData

func (*Image) Width

func (i *Image) Width() int

Width is the width of the image in pixels.

Flutter: ui/painting.dart Image.width

type ImageByteFormat

type ImageByteFormat int

ImageByteFormat is the encoding Image.ToByteData produces.

Flutter: ui/painting.dart ImageByteFormat

const (
	// ImageByteFormatUnspecified is the zero value: ImageByteFormatRawRGBA.
	//
	// Flutter: no counterpart
	ImageByteFormatUnspecified ImageByteFormat = iota
	// ImageByteFormatRawRGBA is Flutter's ImageByteFormat.rawRgba: RGBA in row
	// order with premultiplied alpha, 8 bits per channel.
	//
	// Flutter: ui/painting.dart ImageByteFormat.rawRgba
	ImageByteFormatRawRGBA
	// ImageByteFormatRawStraightRGBA is Flutter's ImageByteFormat.rawStraightRgba:
	// RGBA in row order with straight alpha, 8 bits per channel.
	//
	// Flutter: ui/painting.dart ImageByteFormat.rawStraightRgba
	ImageByteFormatRawStraightRGBA
	// ImageByteFormatRawUnmodified is Flutter's ImageByteFormat.rawUnmodified:
	// the image's own format, which here is premultiplied RGBA.
	//
	// Flutter: ui/painting.dart ImageByteFormat.rawUnmodified
	ImageByteFormatRawUnmodified
	// ImageByteFormatPNG is Flutter's ImageByteFormat.png: a PNG file.
	//
	// Flutter: ui/painting.dart ImageByteFormat.png
	ImageByteFormatPNG
)

The values of ImageByteFormat follow Flutter's declaration order.

Deviation: Flutter's rawExtendedRgba128 is not provided: images here are 8 bits per channel.

type ImageFilter

type ImageFilter interface {
	// DebugShortDescription describes the filter in a few words.
	DebugShortDescription() string
	// Equal reports whether other is the same filter with the same values.
	Equal(other ImageFilter) bool
	// String describes the filter, as Dart's toString does.
	String() string
	// contains filtered or unexported methods
}

ImageFilter is a filter operation to apply to a raster image: a blur, a dilation or erosion, a matrix transform, a composition of two filters, or a ColorFilter. The concrete types are *BlurImageFilter, *DilateImageFilter, *ErodeImageFilter, *MatrixImageFilter, *ComposeImageFilter and *ColorFilter.

Flutter: ui/painting.dart ImageFilter

func NewImageFilterBlur

func NewImageFilterBlur(opts ...ImageFilterBlurOpts) ImageFilter

NewImageFilterBlur creates an image filter that applies a Gaussian blur.

Flutter: ui/painting.dart ImageFilter.blur

func NewImageFilterCompose

func NewImageFilterCompose(outer, inner ImageFilter) ImageFilter

NewImageFilterCompose creates an image filter that applies the inner filter first and then the outer filter to its result.

Flutter: ui/painting.dart ImageFilter.compose

func NewImageFilterDilate

func NewImageFilterDilate(opts ...ImageFilterMorphologyOpts) ImageFilter

NewImageFilterDilate creates an image filter that dilates each pixel's color from its neighboring pixels, within the radii.

Flutter: ui/painting.dart ImageFilter.dilate

func NewImageFilterErode

func NewImageFilterErode(opts ...ImageFilterMorphologyOpts) ImageFilter

NewImageFilterErode creates an image filter that erodes each pixel's color from its neighboring pixels, within the radii.

Flutter: ui/painting.dart ImageFilter.erode

func NewImageFilterMatrix

func NewImageFilterMatrix(matrix *Matrix4, opts ...ImageFilterMatrixOpts) ImageFilter

NewImageFilterMatrix creates an image filter that applies a matrix transformation. The matrix is copied.

Flutter: ui/painting.dart ImageFilter.matrix

type ImageFilterBlurOpts

type ImageFilterBlurOpts struct {
	// SigmaX is the standard deviation of the blur on the x axis.
	SigmaX float64
	// SigmaY is the standard deviation of the blur on the y axis.
	SigmaY float64
	// TileMode is how the edges are treated; the zero value leaves the choice to
	// the renderer (Flutter's null).
	TileMode TileMode
	// Bounds limits where the filter reads and writes; nil means unbounded.
	Bounds *Rect
}

ImageFilterBlurOpts are the optional arguments of NewImageFilterBlur.

Flutter: ui/painting.dart ImageFilter.blur

type ImageFilterEngineLayer

type ImageFilterEngineLayer struct {
	// contains filtered or unexported fields
}

ImageFilterEngineLayer is the handle PushImageFilter returns.

Flutter: ui/compositing.dart ImageFilterEngineLayer

func (*ImageFilterEngineLayer) Dispose

func (h *ImageFilterEngineLayer) Dispose()

Dispose releases the handle.

Flutter: ui/compositing.dart _EngineLayerWrapper.dispose

func (*ImageFilterEngineLayer) Layer

func (h *ImageFilterEngineLayer) Layer() Layer

Layer returns the layer the handle stands for.

Flutter: no counterpart

type ImageFilterLayer

type ImageFilterLayer struct {

	// Filter is the image filter.
	Filter ImageFilter
	// Offset moves the children, before the filter is applied.
	Offset Offset
	// contains filtered or unexported fields
}

ImageFilterLayer applies an image filter to the layers under it.

Flutter: flow/layers/image_filter_layer.h ImageFilterLayer

func (*ImageFilterLayer) Children

func (b *ImageFilterLayer) Children() []Layer

Children returns the layers under this one.

Flutter: no counterpart

func (*ImageFilterLayer) HasTexture

func (b *ImageFilterLayer) HasTexture() bool

HasTexture reports whether this layer or a layer under it is a TextureLayer.

Flutter: no counterpart

func (*ImageFilterLayer) OldLayer

func (b *ImageFilterLayer) OldLayer() Layer

OldLayer returns the layer of the previous frame this one replaces.

Flutter: no counterpart

type ImageFilterMatrixOpts

type ImageFilterMatrixOpts struct {
	// FilterQuality is the quality of the resampling; the zero value is
	// FilterQualityMedium, Flutter's default here.
	FilterQuality FilterQuality
}

ImageFilterMatrixOpts are the optional arguments of NewImageFilterMatrix.

Flutter: ui/painting.dart ImageFilter.matrix

type ImageFilterMorphologyOpts

type ImageFilterMorphologyOpts struct {
	// RadiusX is the radius of the filter on the x axis, in logical pixels.
	RadiusX float64
	// RadiusY is the radius of the filter on the y axis, in logical pixels.
	RadiusY float64
}

ImageFilterMorphologyOpts are the optional arguments of NewImageFilterDilate and NewImageFilterErode.

Flutter: ui/painting.dart ImageFilter.dilate

type ImageShader

type ImageShader struct {
	// contains filtered or unexported fields
}

ImageShader is a shader that tiles an image.

Flutter: ui/painting.dart ImageShader

func NewImageShader

func NewImageShader(image *Image, tmx, tmy TileMode, matrix *Matrix4, opts ...ImageShaderOpts) *ImageShader

NewImageShader creates an image shader that repeats the image as the tile modes say on each axis, transformed by the matrix. A nil matrix is the identity. The matrix is copied.

Flutter: ui/painting.dart ImageShader

func (*ImageShader) FilterQuality

func (s *ImageShader) FilterQuality() FilterQuality

FilterQuality is the quality of the resampling; FilterQualityUnspecified when the renderer chooses.

Flutter: ui/painting.dart ImageShader

func (*ImageShader) Image

func (s *ImageShader) Image() *Image

Image is the image that is tiled.

Flutter: ui/painting.dart ImageShader

func (*ImageShader) Matrix4

func (s *ImageShader) Matrix4() *Matrix4

Matrix4 returns a copy of the transform of the image.

Flutter: ui/painting.dart ImageShader

func (*ImageShader) TileModeX

func (s *ImageShader) TileModeX() TileMode

TileModeX is how the image repeats horizontally.

Flutter: ui/painting.dart ImageShader

func (*ImageShader) TileModeY

func (s *ImageShader) TileModeY() TileMode

TileModeY is how the image repeats vertically.

Flutter: ui/painting.dart ImageShader

type ImageShaderOpts

type ImageShaderOpts struct {
	// FilterQuality is the quality of the resampling; the zero value leaves the
	// choice to the renderer (Flutter's null).
	FilterQuality FilterQuality
}

ImageShaderOpts are the optional arguments of NewImageShader.

Flutter: ui/painting.dart ImageShader

type InstantiateImageCodecOpts

type InstantiateImageCodecOpts struct {
	// TargetWidth is the width to scale the image to, in pixels; 0 keeps the
	// original, or with a TargetHeight keeps the aspect ratio.
	TargetWidth int
	// TargetHeight is the height to scale the image to, in pixels; 0 keeps the
	// original, or with a TargetWidth keeps the aspect ratio.
	TargetHeight int
	// AllowUpscaling says whether a target larger than the image is honored; nil
	// means true, Flutter's default. When false a target is held to the size of
	// the image on each axis.
	AllowUpscaling *bool
}

InstantiateImageCodecOpts are the optional arguments of InstantiateImageCodec.

Flutter: ui/painting.dart instantiateImageCodec

type KeyData

type KeyData struct {
	// TimeStamp is the time at which the event was generated, since an
	// arbitrary fixed point in the past.
	TimeStamp time.Duration
	// Type is the type of the event.
	Type KeyEventType
	// DeviceType is the type of the device that produced the event.
	DeviceType KeyEventDeviceType
	// Physical is the ID of the physical key (Flutter's PhysicalKeyboardKey),
	// which does not depend on the keyboard layout.
	Physical uint64
	// Logical is the ID of the logical key (Flutter's LogicalKeyboardKey),
	// which depends on the keyboard layout.
	Logical uint64
	// Character is the text the key produced. It is empty where Flutter has
	// null: for key releases and for keys that produce no text.
	Character string
	// Synthesized is whether the event was created by the engine to keep the
	// pressed-key state consistent, rather than by the user.
	Synthesized bool
}

KeyData is information about a key event: which physical key, which logical key and which character it produced.

Flutter: ui/key.dart KeyData

func (KeyData) String

func (d KeyData) String() string

String describes the event for logs and test failures. Like Flutter's toString, the text has an unmatched opening parenthesis.

Flutter: ui/key.dart KeyData.toString

type KeyEventDeviceType

type KeyEventDeviceType int

KeyEventDeviceType is the type of device that produced a key event. The zero value, KeyEventDeviceTypeUnspecified, is never produced by a platform backend.

Flutter: ui/key.dart KeyEventDeviceType

const (
	// KeyEventDeviceTypeUnspecified is the zero value.
	//
	// Flutter: no counterpart
	KeyEventDeviceTypeUnspecified KeyEventDeviceType = iota
	// KeyEventDeviceTypeKeyboard is a keyboard.
	//
	// Flutter: ui/key.dart KeyEventDeviceType.keyboard
	KeyEventDeviceTypeKeyboard
	// KeyEventDeviceTypeDirectionalPad is a directional pad.
	//
	// Flutter: ui/key.dart KeyEventDeviceType.directionalPad
	KeyEventDeviceTypeDirectionalPad
	// KeyEventDeviceTypeGamepad is a gamepad.
	//
	// Flutter: ui/key.dart KeyEventDeviceType.gamepad
	KeyEventDeviceTypeGamepad
	// KeyEventDeviceTypeJoystick is a joystick.
	//
	// Flutter: ui/key.dart KeyEventDeviceType.joystick
	KeyEventDeviceTypeJoystick
	// KeyEventDeviceTypeHDMI is an HDMI remote.
	//
	// Flutter: ui/key.dart KeyEventDeviceType.hdmi
	KeyEventDeviceTypeHDMI
)

The values of KeyEventDeviceType follow Flutter's declaration order.

func (KeyEventDeviceType) Label

func (t KeyEventDeviceType) Label() string

Label returns a human-readable name, such as "Directional Pad".

Flutter: ui/key.dart KeyEventDeviceType.label

func (KeyEventDeviceType) String

func (t KeyEventDeviceType) String() string

String returns the same text as Label.

Flutter: ui/key.dart KeyEventDeviceType

type KeyEventType

type KeyEventType int

KeyEventType is the type of a key event. The zero value, KeyEventTypeUnspecified, is never produced by a platform backend.

Flutter: ui/key.dart KeyEventType

const (
	// KeyEventTypeUnspecified is the zero value.
	//
	// Flutter: no counterpart
	KeyEventTypeUnspecified KeyEventType = iota
	// KeyEventTypeDown means a key was pressed.
	//
	// Flutter: ui/key.dart KeyEventType.down
	KeyEventTypeDown
	// KeyEventTypeUp means a key was released.
	//
	// Flutter: ui/key.dart KeyEventType.up
	KeyEventTypeUp
	// KeyEventTypeRepeat means a key is held down and repeats.
	//
	// Flutter: ui/key.dart KeyEventType.repeat
	KeyEventTypeRepeat
)

The values of KeyEventType follow Flutter's declaration order.

func (KeyEventType) Label

func (t KeyEventType) Label() string

Label returns a human-readable name, such as "Key Down".

Flutter: ui/key.dart KeyEventType.label

func (KeyEventType) String

func (t KeyEventType) String() string

String returns the same text as Label.

Flutter: ui/key.dart KeyEventType

type Layer

type Layer interface {
	// Children returns the layers under this one, in painting order. The slice
	// is the layer's own: callers must not change it.
	Children() []Layer
	// OldLayer returns the layer of the previous frame this one replaces, when
	// the app said so with an oldLayer argument, or nil. Renderers may reuse
	// what they cached for it. The layer keeps the old one only as long as the
	// handle that was passed as oldLayer is alive (the framework keeps it for the
	// frame that follows); then OldLayer returns nil. A strong reference would chain
	// every frame the app ever drew to the next, and keep all their pictures.
	OldLayer() Layer
	// HasTexture reports whether this layer or a layer under it is a TextureLayer. A renderer does not keep
	// the pixels of such a layer (a texture changes without the scene changing).
	HasTexture() bool
	// contains filtered or unexported methods
}

Layer is a node of the tree of a Scene. A scene is a tree of layers: container layers that apply an effect (a transform, a clip, an opacity, a filter) to the layers under them, and leaf layers that draw a Picture. The renderers walk the tree and pick the concrete layer with a type switch. A layer is immutable once the scene is built.

Flutter: no counterpart (flutter::Layer)

type LineMetrics

type LineMetrics struct {
	// HardBreak is true if the line ends with a hard line break (a newline).
	HardBreak bool
	// Ascent is the rise from the baseline as calculated from the font and style for this line, with the line height applied.
	Ascent float64
	// Descent is the drop from the baseline as calculated from the font and style for this line, with the line height applied.
	Descent float64
	// UnscaledAscent is the rise from the baseline as calculated from the font and style, without the line height.
	UnscaledAscent float64
	// Height is the total height of the line from the top of the paragraph, the sum of Ascent and Descent (rounded).
	Height float64
	// Width is the width of the line, not counting the trailing whitespace.
	Width float64
	// Left is the x coordinate of the left edge of the line.
	Left float64
	// Baseline is the y coordinate of the baseline, from the top of the paragraph.
	Baseline float64
	// LineNumber is the number of the line, starting at 0.
	LineNumber int
}

LineMetrics is the metrics of one line of a laid-out paragraph.

Flutter: ui/text.dart LineMetrics

type Locale

type Locale struct {
	// LanguageCode is the ISO 639 language subtag, such as "en", or "" for none.
	LanguageCode string
	// ScriptCode is the ISO 15924 script subtag, such as "Latn", or "".
	ScriptCode string
	// CountryCode is the ISO 3166 region subtag, such as "US", or "".
	CountryCode string
}

Locale identifies a language, optionally with a script and a country.

Flutter: ui/platform_dispatcher.dart Locale

func NewLocale

func NewLocale(languageCode string, countryCode ...string) Locale

NewLocale creates a locale from a language code and an optional country code.

Flutter: ui/platform_dispatcher.dart Locale

func ParseLocale

func ParseLocale(tag string) (Locale, bool)

ParseLocale reads a locale from a BCP 47 language tag ("en-US", "zh-Hans-CN") or a POSIX locale name ("en_US.UTF-8", "de_DE@euro"). The second result is false for a name that holds no language, such as "C" or "POSIX" or an empty string.

Flutter: no counterpart (the embedder parses the platform's locale names)

func (Locale) IsZero

func (l Locale) IsZero() bool

IsZero reports whether the locale names nothing.

Flutter: no counterpart

func (Locale) LanguageTag

func (l Locale) LanguageTag() string

LanguageTag is the BCP 47 language tag of the locale, such as "zh-Hans-CN".

Flutter: ui/platform_dispatcher.dart Locale.toLanguageTag

func (Locale) String

func (l Locale) String() string

String is the locale the way Dart prints it: subtags joined with "_".

Flutter: ui/platform_dispatcher.dart Locale.toString

type LocaleStringAttribute

type LocaleStringAttribute struct {
	// contains filtered or unexported fields
}

LocaleStringAttribute says that the range is in the locale.

Flutter: ui/semantics.dart LocaleStringAttribute

func NewLocaleStringAttribute

func NewLocaleStringAttribute(r TextRange, locale Locale) LocaleStringAttribute

NewLocaleStringAttribute creates an attribute for the range and the locale.

Flutter: ui/semantics.dart LocaleStringAttribute.new

func (LocaleStringAttribute) CopyWithRange

func (a LocaleStringAttribute) CopyWithRange(r TextRange) StringAttribute

CopyWithRange returns the attribute for another range.

Flutter: ui/semantics.dart LocaleStringAttribute.copy

func (LocaleStringAttribute) Locale

func (a LocaleStringAttribute) Locale() Locale

Locale is the locale of the range.

Flutter: ui/semantics.dart LocaleStringAttribute.locale

func (LocaleStringAttribute) Range

func (a LocaleStringAttribute) Range() TextRange

Range is the range the attribute applies to.

Flutter: ui/semantics.dart StringAttribute.range

type MaskFilter

type MaskFilter struct {
	// contains filtered or unexported fields
}

MaskFilter is a mask filter to apply to shapes as they are painted. A mask filter is a function that takes a bitmap of color pixels, and returns another bitmap of color pixels. Currently only a blur is supported.

Flutter: ui/painting.dart MaskFilter

func NewMaskFilterBlur

func NewMaskFilterBlur(style BlurStyle, sigma float64) *MaskFilter

NewMaskFilterBlur creates a mask filter that applies a Gaussian blur of the given standard deviation (sigma). A zero style is BlurStyleNormal.

Flutter: ui/painting.dart MaskFilter.blur

func (*MaskFilter) Equal

func (m *MaskFilter) Equal(other *MaskFilter) bool

Equal reports whether the two mask filters are the same blur. A nil filter equals only nil.

Flutter: ui/painting.dart MaskFilter.operator ==

func (*MaskFilter) Sigma

func (m *MaskFilter) Sigma() float64

Sigma is the standard deviation of the Gaussian blur, in logical pixels.

Flutter: ui/painting.dart MaskFilter._sigma

func (*MaskFilter) String

func (m *MaskFilter) String() string

String describes the filter, as Dart's toString does.

Flutter: ui/painting.dart MaskFilter.toString

func (*MaskFilter) Style

func (m *MaskFilter) Style() BlurStyle

Style is the blur style.

Flutter: ui/painting.dart MaskFilter._style

type Matrix4

type Matrix4 struct {
	// contains filtered or unexported fields
}

Matrix4 is a 4x4 matrix of float32 values, stored in column-major order: the entry in row r and column c is Storage()[c*4+r]. Transforms are applied to column vectors, so m.Multiply(n) applies n first.

Unlike most of package ui, Matrix4 is mutable, as vector_math's is: methods such as Translate and Scale change the receiver. Clone makes a copy.

Deviation: the storage is float32 (SPEC §7), where Flutter's vector_math_64 uses float64.

Flutter: package:vector_math Matrix4

func NewMatrix4Compose

func NewMatrix4Compose(translation Vector3, rotation Quaternion, scale Vector3) *Matrix4

NewMatrix4Compose returns the matrix of the translation, rotation and scale (the inverse of Decompose).

Flutter: package:vector_math Matrix4.compose

func NewMatrix4CylindricalProjection

func NewMatrix4CylindricalProjection(radius, angle, perspective float64, vertical bool) *Matrix4

NewMatrix4CylindricalProjection returns the transform that makes a plane look like it is on a cylinder with the given radius, turned by angle radians. The perspective is from 0 to 1 (Flutter's default is 0.001). With vertical true the turn is around the x axis (Flutter's Axis.vertical, its default), and with false around the y axis (Axis.horizontal).

Flutter: painting/matrix_utils.dart MatrixUtils.createCylindricalProjectionTransform

func NewMatrix4Diagonal3Values

func NewMatrix4Diagonal3Values(x, y, z float32) *Matrix4

NewMatrix4Diagonal3Values returns the matrix that scales by (x, y, z).

Flutter: package:vector_math Matrix4.diagonal3Values

func NewMatrix4ForceToPoint

func NewMatrix4ForceToPoint(offset Offset) *Matrix4

NewMatrix4ForceToPoint returns a matrix that sends every point to offset: a transform that collapses its input.

Flutter: painting/matrix_utils.dart MatrixUtils.forceToPoint

func NewMatrix4FromList

func NewMatrix4FromList(values [16]float32) *Matrix4

NewMatrix4FromList returns a matrix with the 16 values, in column-major order, as its storage.

Flutter: package:vector_math Matrix4.fromList

func NewMatrix4Identity

func NewMatrix4Identity() *Matrix4

NewMatrix4Identity returns the identity matrix.

Flutter: package:vector_math Matrix4.identity

func NewMatrix4RotationX

func NewMatrix4RotationX(radians float64) *Matrix4

NewMatrix4RotationX returns the matrix that rotates by radians around the x axis.

Flutter: package:vector_math Matrix4.rotationX

func NewMatrix4RotationY

func NewMatrix4RotationY(radians float64) *Matrix4

NewMatrix4RotationY returns the matrix that rotates by radians around the y axis.

Flutter: package:vector_math Matrix4.rotationY

func NewMatrix4RotationZ

func NewMatrix4RotationZ(radians float64) *Matrix4

NewMatrix4RotationZ returns the matrix that rotates by radians around the z axis.

Flutter: package:vector_math Matrix4.rotationZ

func NewMatrix4Skew

func NewMatrix4Skew(alpha, beta float64) *Matrix4

NewMatrix4Skew returns the matrix that skews both coordinates.

Flutter: package:vector_math Matrix4.skew

func NewMatrix4SkewX

func NewMatrix4SkewX(alpha float64) *Matrix4

NewMatrix4SkewX returns the matrix that skews the x coordinate by the tangent of alpha times y.

Flutter: package:vector_math Matrix4.skewX

func NewMatrix4SkewY

func NewMatrix4SkewY(beta float64) *Matrix4

NewMatrix4SkewY returns the matrix that skews the y coordinate by the tangent of beta times x.

Flutter: package:vector_math Matrix4.skewY

func NewMatrix4TranslationValues

func NewMatrix4TranslationValues(x, y, z float32) *Matrix4

NewMatrix4TranslationValues returns the matrix that translates by (x, y, z).

Flutter: package:vector_math Matrix4.translationValues

func NewMatrix4Zero

func NewMatrix4Zero() *Matrix4

NewMatrix4Zero returns the zero matrix.

Flutter: package:vector_math Matrix4.zero

func (*Matrix4) AsScale

func (m *Matrix4) AsScale() (float64, bool)

AsScale returns the factor when m is exactly a uniform scale in the plane (the same x and y factor, nothing else), and false otherwise.

Flutter: painting/matrix_utils.dart MatrixUtils.getAsScale

func (*Matrix4) AsTranslation

func (m *Matrix4) AsTranslation() (Offset, bool)

AsTranslation returns the translation (dx, dy) when m is exactly a translation in the plane, and false otherwise.

Flutter: painting/matrix_utils.dart MatrixUtils.getAsTranslation

func (*Matrix4) Clone

func (m *Matrix4) Clone() *Matrix4

Clone returns a copy of the matrix.

Flutter: package:vector_math Matrix4.clone

func (*Matrix4) Decompose

func (m *Matrix4) Decompose() (translation Vector3, rotation Quaternion, scale Vector3)

Decompose splits m into its translation, rotation and scale. A matrix with a negative determinant has a negative x scale.

Flutter: package:vector_math Matrix4.decompose

func (*Matrix4) Determinant

func (m *Matrix4) Determinant() float64

Determinant returns the determinant of m.

Flutter: package:vector_math Matrix4.determinant

func (*Matrix4) Entry

func (m *Matrix4) Entry(row, col int) float32

Entry returns the value in the given row and column.

Flutter: package:vector_math Matrix4.entry

func (*Matrix4) Equals

func (m *Matrix4) Equals(other *Matrix4) bool

Equals reports whether the two matrices hold the same values. A nil matrix counts as the identity, and two nils are equal.

Flutter: painting/matrix_utils.dart MatrixUtils.matrixEquals

func (*Matrix4) GetMaxScaleOnAxis

func (m *Matrix4) GetMaxScaleOnAxis() float64

GetMaxScaleOnAxis returns the largest factor by which m scales along an axis.

Flutter: package:vector_math Matrix4.getMaxScaleOnAxis

func (*Matrix4) GetTranslation

func (m *Matrix4) GetTranslation() Vector3

GetTranslation returns the translation part of m.

Flutter: package:vector_math Matrix4.getTranslation

func (*Matrix4) InverseTransformRect

func (m *Matrix4) InverseTransformRect(rect Rect) Rect

InverseTransformRect returns the smallest rectangle that contains rect transformed by the inverse of m.

Flutter: painting/matrix_utils.dart MatrixUtils.inverseTransformRect

func (*Matrix4) Invert

func (m *Matrix4) Invert() float64

Invert inverts m in place and returns its determinant. A matrix whose determinant is zero cannot be inverted: it is left as it was.

Flutter: package:vector_math Matrix4.invert

func (*Matrix4) Inverted

func (m *Matrix4) Inverted() *Matrix4

Inverted returns the inverse of m, or a copy of m when it has none.

Flutter: package:vector_math Matrix4.copyInverse

func (*Matrix4) IsIdentity

func (m *Matrix4) IsIdentity() bool

IsIdentity reports whether m is exactly the identity matrix.

Flutter: painting/matrix_utils.dart MatrixUtils.isIdentity

func (*Matrix4) IsZero

func (m *Matrix4) IsZero() bool

IsZero reports whether every entry is zero.

Flutter: vector_math Matrix4.isZero

func (*Matrix4) Multiply

func (m *Matrix4) Multiply(n *Matrix4) *Matrix4

Multiply returns the product m * n (Dart's *). Applied to a point, n acts first.

Flutter: package:vector_math Matrix4.operator *

func (*Matrix4) MultiplyBy

func (m *Matrix4) MultiplyBy(n *Matrix4)

MultiplyBy sets m to the product m * n.

Flutter: package:vector_math Matrix4.multiply

func (*Matrix4) PerspectiveTransform

func (m *Matrix4) PerspectiveTransform(v Vector3) Vector3

PerspectiveTransform transforms the vector as the point (x, y, z, 1) and divides the result by its w.

Flutter: package:vector_math Matrix4.perspectiveTransform

func (*Matrix4) RotateX

func (m *Matrix4) RotateX(radians float64)

RotateX rotates m by radians around the x axis: m = m * R.

Flutter: package:vector_math Matrix4.rotateX

func (*Matrix4) RotateY

func (m *Matrix4) RotateY(radians float64)

RotateY rotates m by radians around the y axis: m = m * R.

Flutter: package:vector_math Matrix4.rotateY

func (*Matrix4) RotateZ

func (m *Matrix4) RotateZ(radians float64)

RotateZ rotates m by radians around the z axis: m = m * R.

Flutter: package:vector_math Matrix4.rotateZ

func (*Matrix4) Scale

func (m *Matrix4) Scale(x, y, z float32)

Scale scales m by (x, y, z): m = m * S.

Flutter: package:vector_math Matrix4.scale

func (*Matrix4) ScaleUniform

func (m *Matrix4) ScaleUniform(v float32)

ScaleUniform scales m by v on all three axes: m = m * S.

Flutter: package:vector_math Matrix4.scale

func (*Matrix4) SetEntry

func (m *Matrix4) SetEntry(row, col int, v float32)

SetEntry sets the value in the given row and column.

Flutter: package:vector_math Matrix4.setEntry

func (*Matrix4) SetFrom

func (m *Matrix4) SetFrom(other *Matrix4)

SetFrom copies the values of other into m.

Flutter: package:vector_math Matrix4.setFrom

func (*Matrix4) SetIdentity

func (m *Matrix4) SetIdentity()

SetIdentity makes m the identity matrix.

Flutter: package:vector_math Matrix4.setIdentity

func (*Matrix4) SetTranslationRaw

func (m *Matrix4) SetTranslationRaw(x, y, z float32)

SetTranslationRaw sets the translation part of m.

Flutter: package:vector_math Matrix4.setTranslationRaw

func (*Matrix4) SetZero

func (m *Matrix4) SetZero()

SetZero makes m the zero matrix.

Flutter: package:vector_math Matrix4.setZero

func (*Matrix4) Storage

func (m *Matrix4) Storage() *[16]float32

Storage returns the 16 values in column-major order. The array is the matrix's own storage: changing it changes the matrix.

Flutter: package:vector_math Matrix4.storage

func (*Matrix4) Transform

func (m *Matrix4) Transform(v Vector4) Vector4

Transform transforms the 4D vector.

Flutter: package:vector_math Matrix4.transform

func (*Matrix4) Transform3

func (m *Matrix4) Transform3(v Vector3) Vector3

Transform3 transforms the vector as the point (x, y, z, 1), ignoring the perspective row.

Flutter: package:vector_math Matrix4.transform3

func (*Matrix4) TransformPoint

func (m *Matrix4) TransformPoint(point Offset) Offset

TransformPoint transforms the point (x, y) as the vector (x, y, 0, 1) and drops the resulting z. It divides by w only when w is not 1.

Flutter: painting/matrix_utils.dart MatrixUtils.transformPoint

func (*Matrix4) TransformRect

func (m *Matrix4) TransformRect(rect Rect) Rect

TransformRect returns the smallest rectangle that contains the transformed rect.

Flutter: painting/matrix_utils.dart MatrixUtils.transformRect

func (*Matrix4) Translate

func (m *Matrix4) Translate(x, y, z float32)

Translate translates m by (x, y, z), as if multiplied on the right by the translation: m = m * T.

Flutter: package:vector_math Matrix4.translate

func (*Matrix4) Transpose

func (m *Matrix4) Transpose()

Transpose transposes m in place.

Flutter: package:vector_math Matrix4.transpose

func (*Matrix4) Transposed

func (m *Matrix4) Transposed() *Matrix4

Transposed returns the transpose of m.

Flutter: package:vector_math Matrix4.transposed

type MatrixImageFilter

type MatrixImageFilter struct {
	// contains filtered or unexported fields
}

MatrixImageFilter is the image filter that transforms the image with a matrix.

Flutter: ui/painting.dart _MatrixImageFilter

func (*MatrixImageFilter) DebugShortDescription

func (f *MatrixImageFilter) DebugShortDescription() string

DebugShortDescription describes the filter in a few words.

Flutter: ui/painting.dart _MatrixImageFilter.debugShortDescription

func (*MatrixImageFilter) Equal

func (f *MatrixImageFilter) Equal(other ImageFilter) bool

Equal reports whether other is a matrix filter with the same matrix and quality.

Flutter: ui/painting.dart _MatrixImageFilter.operator ==

func (*MatrixImageFilter) FilterQuality

func (f *MatrixImageFilter) FilterQuality() FilterQuality

FilterQuality is the quality of the resampling.

Flutter: ui/painting.dart _MatrixImageFilter.filterQuality

func (*MatrixImageFilter) Matrix

func (f *MatrixImageFilter) Matrix() *Matrix4

Matrix is a copy of the transformation matrix.

Flutter: ui/painting.dart _MatrixImageFilter.data

func (*MatrixImageFilter) String

func (f *MatrixImageFilter) String() string

String describes the filter, as Dart's toString does.

Flutter: ui/painting.dart _MatrixImageFilter.toString

type Offset

type Offset struct {
	// Dx is the horizontal component.
	Dx float64
	// Dy is the vertical component.
	Dy float64
}

Offset is an immutable 2D floating-point offset: a point or a vector in logical or physical pixels, depending on where it is used.

Flutter: ui/geometry.dart Offset

func NewOffsetFromDirection

func NewOffsetFromDirection(direction, distance float64) Offset

NewOffsetFromDirection returns the offset whose direction is the given angle in radians, measured from the positive x axis, and whose length is distance. Flutter's default distance is 1.0.

Deviation: distance is a positional argument, because package ui cannot use foundation.Opt.

Flutter: ui/geometry.dart Offset.fromDirection

func OffsetLerp

func OffsetLerp(a, b *Offset, t float64) *Offset

OffsetLerp linearly interpolates between two offsets, either of which may be nil. A nil offset counts as zero, and two nils give nil.

Flutter: ui/geometry.dart Offset.lerp

func (Offset) Add

func (o Offset) Add(other Offset) Offset

Add returns the sum of two offsets (Dart's +).

Flutter: ui/geometry.dart Offset.operator +

func (Offset) And

func (o Offset) And(other Size) Rect

And returns the rectangle whose top left corner is this offset and whose size is other (Dart's &).

Flutter: ui/geometry.dart Offset.operator &

func (Offset) Direction

func (o Offset) Direction() float64

Direction is the angle of this offset as radians clockwise from the positive x axis, in the range -pi to pi.

Flutter: ui/geometry.dart Offset.direction

func (Offset) Distance

func (o Offset) Distance() float64

Distance is the magnitude of this offset.

Flutter: ui/geometry.dart Offset.distance

func (Offset) DistanceSquared

func (o Offset) DistanceSquared() float64

DistanceSquared is the square of the magnitude of this offset.

Flutter: ui/geometry.dart Offset.distanceSquared

func (Offset) Div

func (o Offset) Div(operand float64) Offset

Div divides both components by operand (Dart's /).

Flutter: ui/geometry.dart Offset.operator /

func (Offset) Ge

func (o Offset) Ge(other Offset) bool

Ge reports whether both components are greater than or equal to the other's (Dart's >=).

Flutter: ui/geometry.dart OffsetBase.operator >=

func (Offset) Gt

func (o Offset) Gt(other Offset) bool

Gt reports whether both components are greater than the other's (Dart's >).

Flutter: ui/geometry.dart OffsetBase.operator >

func (Offset) IsFinite

func (o Offset) IsFinite() bool

IsFinite reports whether both components are finite (neither infinite nor NaN).

Flutter: ui/geometry.dart OffsetBase.isFinite

func (Offset) IsInfinite

func (o Offset) IsInfinite() bool

IsInfinite reports whether either component is infinite.

Flutter: ui/geometry.dart OffsetBase.isInfinite

func (Offset) Le

func (o Offset) Le(other Offset) bool

Le reports whether both components are less than or equal to the other's (Dart's <=).

Flutter: ui/geometry.dart OffsetBase.operator <=

func (Offset) Lerp

func (o Offset) Lerp(b Offset, t float64) Offset

Lerp linearly interpolates between o and b: o when t is 0, b when t is 1.

Flutter: ui/geometry.dart Offset.lerp

func (Offset) Lt

func (o Offset) Lt(other Offset) bool

Lt reports whether both components are less than the other's (Dart's <).

Flutter: ui/geometry.dart OffsetBase.operator <

func (Offset) Mod

func (o Offset) Mod(operand float64) Offset

Mod returns the remainder of dividing both components by operand, made non-negative as Dart does (Dart's %).

Flutter: ui/geometry.dart Offset.operator %

func (Offset) Mul

func (o Offset) Mul(operand float64) Offset

Mul multiplies both components by operand (Dart's *).

Flutter: ui/geometry.dart Offset.operator *

func (Offset) Neg

func (o Offset) Neg() Offset

Neg returns the offset with both components negated (Dart's unary -).

Flutter: ui/geometry.dart Offset.operator -

func (Offset) Scale

func (o Offset) Scale(scaleX, scaleY float64) Offset

Scale returns an offset with Dx multiplied by scaleX and Dy by scaleY.

Flutter: ui/geometry.dart Offset.scale

func (Offset) String

func (o Offset) String() string

String describes the offset, as Dart's toString does.

Flutter: ui/geometry.dart Offset.toString

func (Offset) Sub

func (o Offset) Sub(other Offset) Offset

Sub returns the difference of two offsets (Dart's -).

Flutter: ui/geometry.dart Offset.operator -

func (Offset) Translate

func (o Offset) Translate(translateX, translateY float64) Offset

Translate returns an offset with translateX added to Dx and translateY to Dy.

Flutter: ui/geometry.dart Offset.translate

func (Offset) TruncDiv

func (o Offset) TruncDiv(operand float64) Offset

TruncDiv divides both components by operand and truncates the results (Dart's ~/).

Deviation: an infinite or NaN result stays so, where Dart throws.

Flutter: ui/geometry.dart Offset.operator ~/

type OffsetEngineLayer

type OffsetEngineLayer struct {
	// contains filtered or unexported fields
}

OffsetEngineLayer is the handle PushOffset returns.

Flutter: ui/compositing.dart OffsetEngineLayer

func (*OffsetEngineLayer) Dispose

func (h *OffsetEngineLayer) Dispose()

Dispose releases the handle.

Flutter: ui/compositing.dart _EngineLayerWrapper.dispose

func (*OffsetEngineLayer) Layer

func (h *OffsetEngineLayer) Layer() Layer

Layer returns the layer the handle stands for.

Flutter: no counterpart

type OpClipPath

type OpClipPath struct {
	// Path is the clip shape: a copy of the path that was given.
	Path *Path
	// AntiAlias says whether the edge is smoothed.
	AntiAlias bool
}

OpClipPath clips to a path in the current coordinates.

Flutter: ui/painting.dart Canvas.clipPath

type OpClipRRect

type OpClipRRect struct {
	// RRect is the clip shape.
	RRect RRect
	// AntiAlias says whether the edge is smoothed.
	AntiAlias bool
}

OpClipRRect clips to a rounded rectangle in the current coordinates.

Flutter: ui/painting.dart Canvas.clipRRect

type OpClipRSuperellipse

type OpClipRSuperellipse struct {
	// RSuperellipse is the clip shape.
	RSuperellipse RSuperellipse
	// AntiAlias says whether the edge is smoothed.
	AntiAlias bool
}

OpClipRSuperellipse clips to a rounded superellipse in the current coordinates.

Flutter: ui/painting.dart Canvas.clipRSuperellipse

type OpClipRect

type OpClipRect struct {
	// Rect is the clip shape.
	Rect Rect
	// Op says whether the shape is intersected with the clip or subtracted.
	Op ClipOp
	// AntiAlias says whether the edge is smoothed.
	AntiAlias bool
}

OpClipRect clips to a rectangle in the current coordinates.

Flutter: ui/painting.dart Canvas.clipRect

type OpDrawArc

type OpDrawArc struct {
	// Rect is the rectangle the oval fills.
	Rect Rect
	// StartAngle is where the arc starts, in radians clockwise from the right.
	StartAngle float64
	// SweepAngle is how far it goes, in radians; positive is clockwise.
	SweepAngle float64
	// UseCenter says whether the arc is closed through the center of the oval
	// (a pie slice) or by a chord.
	UseCenter bool
	// Paint is the paint to draw it with.
	Paint Paint
}

OpDrawArc draws an arc of an oval.

Flutter: ui/painting.dart Canvas.drawArc

type OpDrawAtlas

type OpDrawAtlas struct {
	// Atlas is the image that holds the parts.
	Atlas *Image
	// Transforms place each part.
	Transforms []RSTransform
	// Rects are the parts of the atlas, one for each transform.
	Rects []Rect
	// Colors, when there are any, tint each part; as many as the rects.
	Colors []Color
	// BlendMode is how the colors combine with the atlas.
	BlendMode BlendMode
	// CullRect is a bound on everything drawn, for culling; HasCullRect is false
	// when it was not given.
	CullRect    Rect
	HasCullRect bool
	// Paint is the paint to draw them with.
	Paint Paint
}

OpDrawAtlas draws many parts of an image, each transformed.

Flutter: ui/painting.dart Canvas.drawAtlas

type OpDrawCircle

type OpDrawCircle struct {
	// Center is the center of the circle.
	Center Offset
	// Radius is its radius.
	Radius float64
	// Paint is the paint to draw it with.
	Paint Paint
}

OpDrawCircle draws a circle.

Flutter: ui/painting.dart Canvas.drawCircle

type OpDrawColor

type OpDrawColor struct {
	// Color is the source color.
	Color Color
	// BlendMode is how it combines with what is there.
	BlendMode BlendMode
}

OpDrawColor paints the whole clip with a color and a blend mode.

Flutter: ui/painting.dart Canvas.drawColor

type OpDrawDRRect

type OpDrawDRRect struct {
	// Outer is the outer edge of the region.
	Outer RRect
	// Inner is the inner edge of the region.
	Inner RRect
	// Paint is the paint to draw it with.
	Paint Paint
}

OpDrawDRRect draws the region between two rounded rectangles.

Flutter: ui/painting.dart Canvas.drawDRRect

type OpDrawImage

type OpDrawImage struct {
	// Image is the image to draw.
	Image *Image
	// Offset is where its top left corner goes.
	Offset Offset
	// Paint is the paint to draw it with.
	Paint Paint
}

OpDrawImage draws an image with its top left corner at an offset.

Flutter: ui/painting.dart Canvas.drawImage

type OpDrawImageNine

type OpDrawImageNine struct {
	// Image is the image to draw.
	Image *Image
	// Center is the middle cell of the nine-patch, in the pixels of the image.
	Center Rect
	// Dst is where the whole image goes.
	Dst Rect
	// Paint is the paint to draw it with.
	Paint Paint
}

OpDrawImageNine draws an image stretched like a nine-patch.

Flutter: ui/painting.dart Canvas.drawImageNine

type OpDrawImageRect

type OpDrawImageRect struct {
	// Image is the image to draw.
	Image *Image
	// Src is the part of the image to draw, in the pixels of the image.
	Src Rect
	// Dst is where it goes, scaled to fit.
	Dst Rect
	// Paint is the paint to draw it with.
	Paint Paint
}

OpDrawImageRect draws part of an image into a rectangle.

Flutter: ui/painting.dart Canvas.drawImageRect

type OpDrawLine

type OpDrawLine struct {
	// P1 is the start of the line.
	P1 Offset
	// P2 is the end of the line.
	P2 Offset
	// Paint is the paint to stroke it with.
	Paint Paint
}

OpDrawLine draws a line between two points.

Flutter: ui/painting.dart Canvas.drawLine

type OpDrawOval

type OpDrawOval struct {
	// Rect is the rectangle the oval fills, with its edges in order.
	Rect Rect
	// Paint is the paint to draw it with.
	Paint Paint
}

OpDrawOval draws an axis-aligned oval that fills a rectangle.

Flutter: ui/painting.dart Canvas.drawOval

type OpDrawPaint

type OpDrawPaint struct {
	// Paint is the paint to fill with.
	Paint Paint
}

OpDrawPaint fills the whole clip with a paint.

Flutter: ui/painting.dart Canvas.drawPaint

type OpDrawParagraph

type OpDrawParagraph struct {
	// Paragraph is the laid-out text.
	Paragraph *Paragraph
	// Offset is where its top left corner goes.
	Offset Offset
}

OpDrawParagraph draws a paragraph of text.

Flutter: ui/painting.dart Canvas.drawParagraph

type OpDrawPath

type OpDrawPath struct {
	// Path is a copy of the path that was given.
	Path *Path
	// Paint is the paint to draw it with.
	Paint Paint
}

OpDrawPath draws a path.

Flutter: ui/painting.dart Canvas.drawPath

type OpDrawPicture

type OpDrawPicture struct {
	// Picture is the picture to draw.
	Picture *Picture
}

OpDrawPicture draws another picture.

Flutter: ui/painting.dart Canvas.drawPicture

type OpDrawPoints

type OpDrawPoints struct {
	// Mode says how the points are joined.
	Mode PointMode
	// Points are a copy of the points that were given.
	Points []Offset
	// Paint is the paint to draw them with.
	Paint Paint
}

OpDrawPoints draws a set of points, lines or a polygon.

Flutter: ui/painting.dart Canvas.drawPoints

type OpDrawRRect

type OpDrawRRect struct {
	// RRect is the rounded rectangle.
	RRect RRect
	// Paint is the paint to draw it with.
	Paint Paint
}

OpDrawRRect draws a rounded rectangle.

Flutter: ui/painting.dart Canvas.drawRRect

type OpDrawRSuperellipse

type OpDrawRSuperellipse struct {
	// RSuperellipse is the shape.
	RSuperellipse RSuperellipse
	// Paint is the paint to draw it with.
	Paint Paint
}

OpDrawRSuperellipse draws a rounded superellipse.

Flutter: ui/painting.dart Canvas.drawRSuperellipse

type OpDrawRect

type OpDrawRect struct {
	// Rect is the rectangle, with its edges in order.
	Rect Rect
	// Paint is the paint to draw it with.
	Paint Paint
}

OpDrawRect draws a rectangle.

Flutter: ui/painting.dart Canvas.drawRect

type OpDrawShadow

type OpDrawShadow struct {
	// Path is a copy of the path that casts the shadow.
	Path *Path
	// Color is the color of the shadow.
	Color Color
	// Elevation is how far the path is above the surface, in logical pixels.
	Elevation float64
	// TransparentOccluder says that the path is not opaque, so the shadow also
	// shows through it.
	TransparentOccluder bool
}

OpDrawShadow draws the shadow of a path.

Flutter: ui/painting.dart Canvas.drawShadow

type OpDrawVertices

type OpDrawVertices struct {
	// Vertices are the vertices to draw.
	Vertices *Vertices
	// BlendMode is how the vertex colors combine with the paint's color or shader.
	BlendMode BlendMode
	// Paint is the paint to draw them with.
	Paint Paint
}

OpDrawVertices draws triangles from vertices.

Flutter: ui/painting.dart Canvas.drawVertices

type OpRestore

type OpRestore struct{}

OpRestore pops the transform, the clip and, if there is one, the layer.

Flutter: ui/painting.dart Canvas.restore

type OpSave

type OpSave struct{}

OpSave pushes the transform and the clip, as Canvas.Save does.

Flutter: ui/painting.dart Canvas.save

type OpSaveLayer

type OpSaveLayer struct {
	// Bounds limits the layer; HasBounds is false when there is no limit.
	Bounds    Rect
	HasBounds bool
	// Paint says how the layer is composited: its alpha, blend mode, color
	// filter and image filter (which also filters the content behind the layer
	// when it is a backdrop).
	Paint Paint
}

OpSaveLayer pushes the transform and the clip and starts drawing into a layer that is composited with the paint at the matching restore.

Flutter: ui/painting.dart Canvas.saveLayer

type OpTransform

type OpTransform struct {
	// Matrix is the matrix to concatenate.
	Matrix Matrix4
}

OpTransform multiplies the current transform on the right by a matrix, as Canvas.Translate, Scale, Rotate, Skew and Transform do.

Flutter: ui/painting.dart Canvas.transform

type OpacityEngineLayer

type OpacityEngineLayer struct {
	// contains filtered or unexported fields
}

OpacityEngineLayer is the handle PushOpacity returns.

Flutter: ui/compositing.dart OpacityEngineLayer

func (*OpacityEngineLayer) Dispose

func (h *OpacityEngineLayer) Dispose()

Dispose releases the handle.

Flutter: ui/compositing.dart _EngineLayerWrapper.dispose

func (*OpacityEngineLayer) Layer

func (h *OpacityEngineLayer) Layer() Layer

Layer returns the layer the handle stands for.

Flutter: no counterpart

type OpacityLayer

type OpacityLayer struct {

	// Alpha is the opacity, from 0 (transparent) to 255 (opaque).
	Alpha int
	// Offset moves the children, before the alpha is applied.
	Offset Offset
	// contains filtered or unexported fields
}

OpacityLayer draws the layers under it into a group and composites the group with an alpha.

Flutter: flow/layers/opacity_layer.h OpacityLayer

func (*OpacityLayer) Children

func (b *OpacityLayer) Children() []Layer

Children returns the layers under this one.

Flutter: no counterpart

func (*OpacityLayer) HasTexture

func (b *OpacityLayer) HasTexture() bool

HasTexture reports whether this layer or a layer under it is a TextureLayer.

Flutter: no counterpart

func (*OpacityLayer) OldLayer

func (b *OpacityLayer) OldLayer() Layer

OldLayer returns the layer of the previous frame this one replaces.

Flutter: no counterpart

type Paint

type Paint struct {
	// contains filtered or unexported fields
}

Paint is a description of the style to use when drawing on a Canvas.

Most APIs on Canvas take a Paint object to describe the style to use for that operation. The zero value is Flutter's `Paint()`: opaque black, filled, with anti-aliasing, blend mode srcOver, and no filters or shader. Copy a Paint by assigning it; every part of it is immutable or a value.

Flutter's properties become a getter and a Set method, such as Color and SetColor, so that the zero value can be the default.

Flutter: ui/painting.dart Paint

func NewPaint

func NewPaint() *Paint

NewPaint creates a Paint with Flutter's defaults. It is the same as the zero value.

Flutter: ui/painting.dart Paint

func NewPaintFrom

func NewPaintFrom(other *Paint) *Paint

NewPaintFrom creates a copy of other.

Flutter: ui/painting.dart Paint.from

func (*Paint) BlendMode

func (p *Paint) BlendMode() BlendMode

BlendMode is the blend mode to apply when a shape is drawn or a layer is composited. It defaults to BlendModeSrcOver.

Flutter: ui/painting.dart Paint.blendMode

func (*Paint) Color

func (p *Paint) Color() Color

Color is the color to use when stroking or filling a shape. It defaults to opaque black.

Flutter: ui/painting.dart Paint.color

func (*Paint) ColorFilter

func (p *Paint) ColorFilter() *ColorFilter

ColorFilter is the ColorFilter to apply when drawing, or nil for none.

Flutter: ui/painting.dart Paint.colorFilter

func (*Paint) FilterQuality

func (p *Paint) FilterQuality() FilterQuality

FilterQuality is the quality of sampling used when scaling images. It defaults to FilterQualityNone.

Flutter: ui/painting.dart Paint.filterQuality

func (*Paint) ImageFilter

func (p *Paint) ImageFilter() ImageFilter

ImageFilter is the ImageFilter to apply to what is drawn, or nil for none.

Flutter: ui/painting.dart Paint.imageFilter

func (*Paint) InvertColors

func (p *Paint) InvertColors() bool

InvertColors reports whether the colors are inverted when drawing. It defaults to false.

Flutter: ui/painting.dart Paint.invertColors

func (*Paint) IsAntiAlias

func (p *Paint) IsAntiAlias() bool

IsAntiAlias reports whether to apply anti-aliasing to lines and images drawn on the canvas. It defaults to true.

Flutter: ui/painting.dart Paint.isAntiAlias

func (*Paint) MaskFilter

func (p *Paint) MaskFilter() *MaskFilter

MaskFilter is the MaskFilter to use when drawing, or nil for none.

Flutter: ui/painting.dart Paint.maskFilter

func (*Paint) SetBlendMode

func (p *Paint) SetBlendMode(m BlendMode)

SetBlendMode sets the blend mode. BlendModeUnspecified is BlendModeSrcOver.

Flutter: ui/painting.dart Paint.blendMode

func (*Paint) SetColor

func (p *Paint) SetColor(c Color)

SetColor sets the color to use when stroking or filling a shape.

Flutter: ui/painting.dart Paint.color

func (*Paint) SetColorFilter

func (p *Paint) SetColorFilter(f *ColorFilter)

SetColorFilter sets the ColorFilter; nil removes it.

Flutter: ui/painting.dart Paint.colorFilter

func (*Paint) SetFilterQuality

func (p *Paint) SetFilterQuality(q FilterQuality)

SetFilterQuality sets the quality of sampling when scaling images. FilterQualityUnspecified is FilterQualityNone.

Flutter: ui/painting.dart Paint.filterQuality

func (*Paint) SetImageFilter

func (p *Paint) SetImageFilter(f ImageFilter)

SetImageFilter sets the ImageFilter; nil removes it.

Flutter: ui/painting.dart Paint.imageFilter

func (*Paint) SetInvertColors

func (p *Paint) SetInvertColors(v bool)

SetInvertColors sets whether the colors are inverted when drawing.

Flutter: ui/painting.dart Paint.invertColors

func (*Paint) SetIsAntiAlias

func (p *Paint) SetIsAntiAlias(v bool)

SetIsAntiAlias sets whether to apply anti-aliasing.

Flutter: ui/painting.dart Paint.isAntiAlias

func (*Paint) SetMaskFilter

func (p *Paint) SetMaskFilter(f *MaskFilter)

SetMaskFilter sets the MaskFilter; nil removes it.

Flutter: ui/painting.dart Paint.maskFilter

func (*Paint) SetShader

func (p *Paint) SetShader(s Shader)

SetShader sets the shader; nil removes it.

Flutter: ui/painting.dart Paint.shader

func (*Paint) SetStrokeCap

func (p *Paint) SetStrokeCap(c StrokeCap)

SetStrokeCap sets the finish on the end of stroked lines. StrokeCapUnspecified is StrokeCapButt.

Flutter: ui/painting.dart Paint.strokeCap

func (*Paint) SetStrokeJoin

func (p *Paint) SetStrokeJoin(j StrokeJoin)

SetStrokeJoin sets the finish on the joins between segments. StrokeJoinUnspecified is StrokeJoinMiter.

Flutter: ui/painting.dart Paint.strokeJoin

func (*Paint) SetStrokeMiterLimit

func (p *Paint) SetStrokeMiterLimit(v float64)

SetStrokeMiterLimit sets the limit for miters.

Flutter: ui/painting.dart Paint.strokeMiterLimit

func (*Paint) SetStrokeWidth

func (p *Paint) SetStrokeWidth(w float64)

SetStrokeWidth sets how wide to make edges drawn when stroking.

Flutter: ui/painting.dart Paint.strokeWidth

func (*Paint) SetStyle

func (p *Paint) SetStyle(s PaintingStyle)

SetStyle sets whether to paint inside shapes, the edges of shapes, or both. PaintingStyleUnspecified is PaintingStyleFill.

Flutter: ui/painting.dart Paint.style

func (*Paint) Shader

func (p *Paint) Shader() Shader

Shader is the shader to use when drawing, or nil for none. When it is set, the color is ignored.

Flutter: ui/painting.dart Paint.shader

func (*Paint) String

func (p *Paint) String() string

String describes the paint, as Dart's toString does.

Flutter: ui/painting.dart Paint.toString

func (*Paint) StrokeCap

func (p *Paint) StrokeCap() StrokeCap

StrokeCap is the kind of finish to place on the end of lines drawn when the style is PaintingStyleStroke. It defaults to StrokeCapButt.

Flutter: ui/painting.dart Paint.strokeCap

func (*Paint) StrokeJoin

func (p *Paint) StrokeJoin() StrokeJoin

StrokeJoin is the kind of finish to place on the joins between segments. It defaults to StrokeJoinMiter.

Flutter: ui/painting.dart Paint.strokeJoin

func (*Paint) StrokeMiterLimit

func (p *Paint) StrokeMiterLimit() float64

StrokeMiterLimit is the limit for miters to be drawn on segments when the join is set to StrokeJoinMiter. It defaults to 4.0.

Flutter: ui/painting.dart Paint.strokeMiterLimit

func (*Paint) StrokeWidth

func (p *Paint) StrokeWidth() float64

StrokeWidth is how wide to make edges drawn when the style is PaintingStyleStroke. A width of zero is a hairline. It defaults to 0.0. The value is held as a float32, as Flutter does.

Flutter: ui/painting.dart Paint.strokeWidth

func (*Paint) Style

func (p *Paint) Style() PaintingStyle

Style is whether to paint inside shapes, the edges of shapes, or both. It defaults to PaintingStyleFill.

Flutter: ui/painting.dart Paint.style

type PaintingStyle

type PaintingStyle int

PaintingStyle is whether to paint inside shapes, the edges of shapes, or both. The default is PaintingStyleFill.

Flutter: ui/painting.dart PaintingStyle

const (
	// PaintingStyleUnspecified is the zero value: the default.
	//
	// Flutter: no counterpart
	PaintingStyleUnspecified PaintingStyle = iota
	// PaintingStyleFill is Flutter's PaintingStyle.fill. Apply the Paint to the inside of the shape.
	//
	// Flutter: ui/painting.dart PaintingStyle.fill
	PaintingStyleFill
	// PaintingStyleStroke is Flutter's PaintingStyle.stroke. Apply the Paint to the edge of the shape.
	//
	// Flutter: ui/painting.dart PaintingStyle.stroke
	PaintingStyleStroke
)

The values of PaintingStyle follow Flutter's declaration order.

func (PaintingStyle) String

func (e PaintingStyle) String() string

String returns the name Dart prints for the value, such as "PaintingStyle.fill".

type Paragraph

type Paragraph struct {
	// contains filtered or unexported fields
}

Paragraph is a paragraph of text that has been laid out, ready to be drawn with Canvas.DrawParagraph.

Flutter: ui/text.dart Paragraph

func NewParagraph

func NewParagraph(layout ParagraphLayout) *Paragraph

NewParagraph wraps the layout a text engine made.

Flutter: no counterpart

func (*Paragraph) AlphabeticBaseline

func (p *Paragraph) AlphabeticBaseline() float64

AlphabeticBaseline is the distance from the top of the paragraph to the alphabetic baseline of the first line.

Flutter: ui/text.dart Paragraph.alphabeticBaseline

func (*Paragraph) ComputeLineMetrics

func (p *Paragraph) ComputeLineMetrics() []LineMetrics

ComputeLineMetrics returns the metrics of every line of the laid-out paragraph.

Flutter: ui/text.dart Paragraph.computeLineMetrics

func (*Paragraph) DidExceedMaxLines

func (p *Paragraph) DidExceedMaxLines() bool

DidExceedMaxLines is true if there is more text than ParagraphStyle.MaxLines allows.

Flutter: ui/text.dart Paragraph.didExceedMaxLines

func (*Paragraph) GetBoxesForPlaceholders

func (p *Paragraph) GetBoxesForPlaceholders() []TextBox

GetBoxesForPlaceholders returns a list of text boxes that enclose all placeholders in the paragraph, in the order they were added.

Flutter: ui/text.dart Paragraph.getBoxesForPlaceholders

func (*Paragraph) GetBoxesForRange

func (p *Paragraph) GetBoxesForRange(start, end int, opts ...BoxesForRangeOpts) []TextBox

GetBoxesForRange returns a list of text boxes that enclose the given text range (byte offsets). Coordinates are relative to the upper-left corner of the paragraph.

Flutter: ui/text.dart Paragraph.getBoxesForRange

func (*Paragraph) GetClosestGlyphInfoForOffset

func (p *Paragraph) GetClosestGlyphInfoForOffset(offset Offset) (GlyphInfo, bool)

GetClosestGlyphInfoForOffset returns the glyph closest to the given offset, or false if the text is empty or entirely clipped.

Flutter: ui/text.dart Paragraph.getClosestGlyphInfoForOffset

func (*Paragraph) GetGlyphInfoAt

func (p *Paragraph) GetGlyphInfoAt(offset int) (GlyphInfo, bool)

GetGlyphInfoAt returns the glyph located at the given byte offset, or false if the offset is out of the visible lines or is ellipsized.

Flutter: ui/text.dart Paragraph.getGlyphInfoAt

func (*Paragraph) GetLineBoundary

func (p *Paragraph) GetLineBoundary(position TextPosition) TextRange

GetLineBoundary returns the range of the line at the given position. The newline, if any, is part of the range.

Flutter: ui/text.dart Paragraph.getLineBoundary

func (*Paragraph) GetLineMetricsAt

func (p *Paragraph) GetLineMetricsAt(lineNumber int) (LineMetrics, bool)

GetLineMetricsAt returns the metrics of the line, or false if lineNumber is not a visible line.

Flutter: ui/text.dart Paragraph.getLineMetricsAt

func (*Paragraph) GetLineNumberAt

func (p *Paragraph) GetLineNumberAt(offset int) (int, bool)

GetLineNumberAt returns the number of the line that holds the byte at the offset, or false if the offset is out of bounds or after the last visible character.

Flutter: ui/text.dart Paragraph.getLineNumberAt

func (*Paragraph) GetPositionForOffset

func (p *Paragraph) GetPositionForOffset(offset Offset) TextPosition

GetPositionForOffset returns the text position closest to the given offset. It always returns a position, even when the paragraph is empty.

Flutter: ui/text.dart Paragraph.getPositionForOffset

func (*Paragraph) GetWordBoundary

func (p *Paragraph) GetWordBoundary(position TextPosition) TextRange

GetWordBoundary returns the range of the word at the given position. Characters that are not part of a word have word breaks on both sides: the range is that one character.

Flutter: ui/text.dart Paragraph.getWordBoundary

func (*Paragraph) Height

func (p *Paragraph) Height() float64

Height is the amount of vertical space this paragraph occupies.

Flutter: ui/text.dart Paragraph.height

func (*Paragraph) IdeographicBaseline

func (p *Paragraph) IdeographicBaseline() float64

IdeographicBaseline is the distance from the top of the paragraph to the ideographic baseline of the first line.

Flutter: ui/text.dart Paragraph.ideographicBaseline

func (*Paragraph) Layout

func (p *Paragraph) Layout(constraints ParagraphConstraints)

Layout provides the size of the paragraph; the width is where lines wrap.

Flutter: ui/text.dart Paragraph.layout

func (*Paragraph) Layouter

func (p *Paragraph) Layouter() ParagraphLayout

Layouter returns the layout the paragraph wraps, for the renderers and the text queries.

Flutter: no counterpart

func (*Paragraph) LongestLine

func (p *Paragraph) LongestLine() float64

LongestLine is the distance from the left edge of the leftmost glyph to the right edge of the rightmost glyph, over the longest line.

Flutter: ui/text.dart Paragraph.longestLine

func (*Paragraph) MaxIntrinsicWidth

func (p *Paragraph) MaxIntrinsicWidth() float64

MaxIntrinsicWidth is the width at which decreasing the width would not decrease the height.

Flutter: ui/text.dart Paragraph.maxIntrinsicWidth

func (*Paragraph) MinIntrinsicWidth

func (p *Paragraph) MinIntrinsicWidth() float64

MinIntrinsicWidth is the minimum width that this paragraph could be without failing to paint its contents within itself.

Flutter: ui/text.dart Paragraph.minIntrinsicWidth

func (*Paragraph) NumberOfLines

func (p *Paragraph) NumberOfLines() int

NumberOfLines is the total number of visible lines in the paragraph.

Flutter: ui/text.dart Paragraph.numberOfLines

func (*Paragraph) Width

func (p *Paragraph) Width() float64

Width is the amount of horizontal space this paragraph occupies.

Flutter: ui/text.dart Paragraph.width

type ParagraphBuilder

type ParagraphBuilder struct {
	// contains filtered or unexported fields
}

ParagraphBuilder is used to construct a Paragraph.

Flutter: ui/text.dart ParagraphBuilder

func NewParagraphBuilder

func NewParagraphBuilder(factory ParagraphFactory, style *ParagraphStyle) *ParagraphBuilder

NewParagraphBuilder creates a ParagraphBuilder for the text engine and the paragraph style. The Flutter constructor takes only the style, because Dart has a global font collection; here the engine is a parameter.

Flutter: ui/text.dart ParagraphBuilder

func (*ParagraphBuilder) AddPlaceholder

func (b *ParagraphBuilder) AddPlaceholder(width, height float64, alignment PlaceholderAlignment, opts ...AddPlaceholderOpts)

AddPlaceholder reserves a box of the given size in the text. The paragraph lays out the text around it, and GetBoxesForPlaceholders reports where it is. A negative size panics with the tag PlaceholderSizeInvalid.

Flutter: ui/text.dart ParagraphBuilder.addPlaceholder

func (*ParagraphBuilder) AddText

func (b *ParagraphBuilder) AddText(text string)

AddText adds the text, in the current style.

Flutter: ui/text.dart ParagraphBuilder.addText

func (*ParagraphBuilder) Build

func (b *ParagraphBuilder) Build() *Paragraph

Build ends the builder and returns the paragraph. It must be laid out with Layout before it is used. The builder is not to be used after it: the paragraph keeps its runs and placeholders.

Flutter: ui/text.dart ParagraphBuilder.build

func (*ParagraphBuilder) PlaceholderCount

func (b *ParagraphBuilder) PlaceholderCount() int

PlaceholderCount is the number of placeholders added so far.

Flutter: ui/text.dart ParagraphBuilder.placeholderCount

func (*ParagraphBuilder) PlaceholderScales

func (b *ParagraphBuilder) PlaceholderScales() []float64

PlaceholderScales is the scale of each placeholder added so far.

Flutter: ui/text.dart ParagraphBuilder.placeholderScales

func (*ParagraphBuilder) Pop

func (b *ParagraphBuilder) Pop()

Pop ends the effect of the most recent PushStyle. Popping with no style pushed panics with the tag ParagraphBuilderPopEmpty.

Flutter: ui/text.dart ParagraphBuilder.pop

func (*ParagraphBuilder) PushStyle

func (b *ParagraphBuilder) PushStyle(style *TextStyle)

PushStyle applies the text style to text added after, until the matching Pop. Fields the style did not set inherit from the style below.

Flutter: ui/text.dart ParagraphBuilder.pushStyle

type ParagraphConstraints

type ParagraphConstraints struct {
	// Width is the width the lines are wrapped to. An infinite width lays the text out with no soft line breaks.
	Width float64
}

ParagraphConstraints are the constraints a Paragraph is laid out with.

Flutter: ui/text.dart ParagraphConstraints

func NewParagraphConstraints

func NewParagraphConstraints(width float64) ParagraphConstraints

NewParagraphConstraints creates the constraints for a width.

Flutter: ui/text.dart ParagraphConstraints

type ParagraphContent

type ParagraphContent struct {
	// Style is the paragraph style.
	Style *ParagraphStyle
	// Text is the whole text, in UTF-8.
	Text string
	// Runs cover Text in order, with no gaps; there is none for an empty text.
	Runs []TextRun
	// Placeholders are the boxes in Text, in order.
	Placeholders []PlaceholderSpec
}

ParagraphContent is what a ParagraphBuilder collected: the style and the styled text. A text engine lays it out.

Flutter: no counterpart

type ParagraphDraw

type ParagraphDraw struct {
	// Op is the drawing operation (OpDrawPath, OpDrawRect or OpDrawPicture), in the
	// coordinates of its own origin.
	Op DisplayOp
	// Offset is where the origin of Op is, from the top left corner of the paragraph.
	Offset Offset
	// Matrix, when not nil, transforms the coordinates of Op before Offset applies.
	Matrix *Matrix4
	// Snap says that the origin lands on the pixel grid the way text does: with its
	// horizontal position at a quarter of a pixel and its vertical one at a pixel, when the
	// transform allows it. Glyphs are snapped; the lines of decorations are not.
	Snap bool
}

ParagraphDraw is one piece of the drawing of a paragraph: a shape, a glyph, a decoration line or a color glyph, which a renderer draws with the usual operations.

Flutter: no counterpart

type ParagraphFactory

type ParagraphFactory interface {
	// BuildParagraph shapes the content. The paragraph must be laid out before it is used.
	BuildParagraph(content *ParagraphContent) ParagraphLayout
}

ParagraphFactory is the text engine: it makes a laid-out paragraph from its content. internal/text/layout implements it. The framework reaches it through the PlatformDispatcher, so there is no global font collection.

Flutter: no counterpart

type ParagraphLayout

type ParagraphLayout interface {
	// Layout lays the text out for the constraints. It can be called again with other constraints.
	Layout(ParagraphConstraints)
	// Width is the amount of horizontal space this paragraph occupies.
	Width() float64
	// Height is the amount of vertical space this paragraph occupies.
	Height() float64
	// LongestLine is the width of the widest line, not counting trailing whitespace.
	LongestLine() float64
	// MinIntrinsicWidth is the minimum width that this paragraph could be without failing to paint its contents within itself.
	MinIntrinsicWidth() float64
	// MaxIntrinsicWidth is the width at which decreasing the width would not decrease the height.
	MaxIntrinsicWidth() float64
	// AlphabeticBaseline is the distance from the top of the paragraph to the alphabetic baseline of the first line.
	AlphabeticBaseline() float64
	// IdeographicBaseline is the distance from the top of the paragraph to the ideographic baseline of the first line.
	IdeographicBaseline() float64
	// DidExceedMaxLines is true if there is more text than the style's maximum number of lines could show.
	DidExceedMaxLines() bool
	// ComputeLineMetrics returns the metrics of every line.
	ComputeLineMetrics() []LineMetrics
	// GetBoxesForRange returns the boxes that enclose the text in the byte range.
	GetBoxesForRange(start, end int, heightStyle BoxHeightStyle, widthStyle BoxWidthStyle) []TextBox
	// GetBoxesForPlaceholders returns the boxes of the placeholders, in the order they were added.
	GetBoxesForPlaceholders() []TextBox
	// GetPositionForOffset returns the text position closest to the point.
	GetPositionForOffset(offset Offset) TextPosition
	// GetClosestGlyphInfoForOffset returns the grapheme cluster closest to the point.
	GetClosestGlyphInfoForOffset(offset Offset) (GlyphInfo, bool)
	// GetGlyphInfoAt returns the grapheme cluster that holds the byte offset.
	GetGlyphInfoAt(offset int) (GlyphInfo, bool)
	// GetWordBoundary returns the range of the word at the position.
	GetWordBoundary(position TextPosition) TextRange
	// GetLineBoundary returns the range of the line at the position, with its newline.
	GetLineBoundary(position TextPosition) TextRange
	// GetLineMetricsAt returns the metrics of one line.
	GetLineMetricsAt(lineNumber int) (LineMetrics, bool)
	// NumberOfLines is the number of visible lines.
	NumberOfLines() int
	// GetLineNumberAt returns the line that holds the byte offset.
	GetLineNumberAt(offset int) (int, bool)
}

ParagraphLayout is a laid-out paragraph as the text engine provides it. A Paragraph wraps one. It is implemented by internal/text/layout; a test may provide its own.

Flutter: no counterpart

type ParagraphPainter

type ParagraphPainter interface {
	// PaintParagraph calls emit for each piece of the drawing of the laid-out paragraph, in
	// drawing order: for each line its backgrounds, shadows, glyphs and decorations.
	PaintParagraph(emit func(ParagraphDraw))
}

ParagraphPainter is a ParagraphLayout that can draw itself: the renderers draw a paragraph by drawing what it emits, in order.

Flutter: no counterpart

type ParagraphStyle

type ParagraphStyle struct {
	// contains filtered or unexported fields
}

ParagraphStyle describes the whole paragraph: alignment, direction, maximum lines, ellipsis, strut, and the defaults of the text style.

Flutter: ui/text.dart ParagraphStyle

func NewParagraphStyle

func NewParagraphStyle(opts ...ParagraphStyleOpts) *ParagraphStyle

NewParagraphStyle creates a paragraph style. A negative MaxLines panics with the tag MaxLinesNegative, and a TabSize that is negative, NaN or infinite with the tag TabSizeInvalid.

Flutter: ui/text.dart ParagraphStyle

func (*ParagraphStyle) Align

func (s *ParagraphStyle) Align() TextAlign

Align is the text alignment, start when unspecified.

Flutter: no counterpart

func (*ParagraphStyle) BaseTextStyle

func (s *ParagraphStyle) BaseTextStyle() ResolvedTextStyle

BaseTextStyle is the text style a paragraph starts from: the defaults with the paragraph style's font and locale applied.

Flutter: engine/src/flutter/lib/ui/text/paragraph_builder.cc ParagraphBuilder::ParagraphBuilder

func (*ParagraphStyle) Direction

func (s *ParagraphStyle) Direction() TextDirection

Direction is the text direction, left to right when unspecified.

Flutter: no counterpart

func (*ParagraphStyle) Ellipsis

func (s *ParagraphStyle) Ellipsis() string

Ellipsis is the ellipsis string, "" for none.

Flutter: no counterpart

func (*ParagraphStyle) HeightBehavior

func (s *ParagraphStyle) HeightBehavior() TextHeightBehavior

HeightBehavior is the text height behavior, with the defaults applied.

Flutter: no counterpart

func (*ParagraphStyle) MaxLines

func (s *ParagraphStyle) MaxLines() (int, bool)

MaxLines is the limit of lines and whether there is one.

Flutter: no counterpart

func (*ParagraphStyle) Options

func (s *ParagraphStyle) Options() ParagraphStyleOpts

Options returns the options the style was made from.

Flutter: no counterpart

func (*ParagraphStyle) Strut

func (s *ParagraphStyle) Strut() ResolvedStrut

Strut is the strut with its fields decided; Enabled is false when the paragraph has none.

Flutter: engine/src/flutter/lib/ui/text/paragraph_builder.cc decodeStrut

func (*ParagraphStyle) TabSize

func (s *ParagraphStyle) TabSize() float64

TabSize is the distance between tab stops in spaces of the paragraph's font; 0 for no tab stops.

Flutter: no counterpart

type ParagraphStyleOpts

type ParagraphStyleOpts struct {
	// TextAlign is the alignment of the text within the lines of the paragraph.
	TextAlign TextAlign
	// TextDirection is the directionality of the text, which also decides what start and end mean.
	TextDirection TextDirection
	// MaxLines is the maximum number of lines to show; nil means no limit.
	MaxLines *int
	// FontFamily is the name of the font to use when painting the text.
	FontFamily string
	// FontSize is the size of glyphs (in logical pixels) to use when painting the text.
	FontSize *float64
	// Height is the height of the line as a multiple of the font size.
	Height *float64
	// TextHeightBehavior says how Height applies to the first ascent and the last descent.
	TextHeightBehavior *TextHeightBehavior
	// FontWeight is the typeface thickness to use when painting the text.
	FontWeight FontWeight
	// FontStyle is the typeface variant to use when drawing the letters.
	FontStyle FontStyle
	// StrutStyle is the strut of the paragraph.
	StrutStyle *StrutStyle
	// Ellipsis replaces the text that does not fit when MaxLines is exceeded; "" means none.
	Ellipsis string
	// Locale is the locale used to select region-specific glyphs.
	Locale *Locale
	// TabSize is the distance between two tab stops, as a count of the advance of a space in the
	// font of the paragraph style (CSS's tab-size). A tab advances to the next multiple of it,
	// measured from the start of its line. 0, the default, gives tabs no stops, as in Flutter.
	//
	// Flutter: no counterpart
	TabSize float64
}

ParagraphStyleOpts are the optional parameters of NewParagraphStyle.

Flutter: ui/text.dart ParagraphStyle

type Path

type Path struct {
	// contains filtered or unexported fields
}

Path is a complex two-dimensional shape: any number of contours, each made of straight lines, quadratic and cubic Bézier curves, and conic sections. Contours can be open or closed. It follows Skia's SkPath, which is what Flutter wraps, including the way a segment added after a close starts a new contour at the start of the closed one.

Unlike most of package ui, a Path is mutable: the methods that build it change it. NewPathFrom copies one.

Deviation: the points are float64, where Skia keeps float32.

Flutter: ui/painting.dart Path

func NewPath

func NewPath() *Path

NewPath creates an empty path.

Flutter: ui/painting.dart Path

func NewPathFrom

func NewPathFrom(source *Path) *Path

NewPathFrom creates a copy of source.

Flutter: ui/painting.dart Path.from

func PathCombine

func PathCombine(op PathOperation, path1, path2 *Path) *Path

PathCombine applies the operation to the two paths and returns the result as a new path: the region that is inside the paths (each by its own fill type) the way the operation says. The contours of the result do not cross each other or themselves, holes have the opposite direction of what they are in, and the fill type is PathFillTypeNonZero. Open contours are taken as closed, as when a path is filled.

The way it works (a deliberate choice, documented in SPEC §7): the curves of both paths are cut into straight lines, in steps of the same parameter, with a tolerance of a ten-thousandth of the size of the paths; every crossing of two lines, every touch and every overlap becomes a vertex (the coordinates are snapped to a grid a billionth of that size, and vertices that fall in neighbouring cells are welded, so that rounding does not leave gaps); this gives a planar graph whose edges each have a winding number of both paths on their two sides, found by casting a ray; an edge is on the border of the result when the operation says differently for its two sides; the edges are chained into contours. Because no assumption is made on the paths, the inputs may cross themselves, overlap each other, touch along an edge, or be open. Where the border of the result follows a stretch of one of the original curves, the curve is put back (cut at the crossings, with its end points on the vertices), so a result made of pieces of circles still has curves, not lines; only the stretches between two crossings of a curve with another curve are exact up to the tolerance.

Deviation: Skia's pathops works with exact curve intersections and can fail (Flutter's Path.combine then returns an empty path, or throws); this one always returns a path. The vertices of the crossings of curves are found on the lines that replace them, so they are off the true crossing by at most the tolerance.

Flutter: ui/painting.dart Path.combine

func (*Path) AddArc

func (p *Path) AddArc(oval Rect, startAngle, sweepAngle float64)

AddArc adds a new sub-path with one arc segment that consists of the arc that follows the edge of the oval bounded by the given rectangle, from startAngle radians around the oval up to startAngle + sweepAngle radians around the oval, with zero radians being the point on the right hand side of the oval that crosses the horizontal line that intersects the center of the rectangle and with positive angles going clockwise around the oval.

Flutter: ui/painting.dart Path.addArc

func (*Path) AddOval

func (p *Path) AddOval(oval Rect)

AddOval adds a new sub-path that consists of a curve that forms the ellipse that fills the given rectangle. The oval is drawn clockwise, starting from the center of its right edge, as four conics.

Flutter: ui/painting.dart Path.addOval

func (*Path) AddPath

func (p *Path) AddPath(path *Path, offset Offset, opts ...AddPathOpts)

AddPath adds the sub-paths of path to this path, translated by offset (after the optional transform).

Flutter: ui/painting.dart Path.addPath

func (*Path) AddPolygon

func (p *Path) AddPolygon(points []Offset, close bool)

AddPolygon adds a new sub-path with a sequence of line segments that connect the given points. If close is true, the last point is joined to the first one.

Flutter: ui/painting.dart Path.addPolygon

func (*Path) AddRRect

func (p *Path) AddRRect(rrect RRect)

AddRRect adds a new sub-path that consists of the straight lines and curves needed to form the rounded rectangle described by the argument. It starts on the left edge, above the bottom left corner, and goes clockwise.

Flutter: ui/painting.dart Path.addRRect

func (*Path) AddRSuperellipse

func (p *Path) AddRSuperellipse(rs RSuperellipse)

AddRSuperellipse adds a new sub-path that consists of the straight lines and curves needed to form the rounded superellipse described by the argument.

Deviation: the corners follow the approximation of RSuperellipse.Contains, not Impeller's exact shape; see SPEC §12.10.

Flutter: ui/painting.dart Path.addRSuperellipse

func (*Path) AddRect

func (p *Path) AddRect(rect Rect)

AddRect adds a new sub-path that consists of four lines that outline the given rectangle, clockwise from its top left corner.

Flutter: ui/painting.dart Path.addRect

func (*Path) ArcTo

func (p *Path) ArcTo(rect Rect, startAngle, sweepAngle float64, forceMoveTo bool)

ArcTo appends a conic-built arc of the oval bounded by rect, starting at startAngle radians around the oval and going sweepAngle radians (positive is clockwise). The angle 0 is at the right of the oval. If forceMoveTo is false, a line from the current point to the arc's start is added first (unless they are the same point); if it is true, a new sub-path starts at the arc.

Flutter: ui/painting.dart Path.arcTo

func (*Path) ArcToPoint

func (p *Path) ArcToPoint(arcEnd Offset, opts ...ArcToPointOpts)

ArcToPoint appends up to four conic curves weighted to describe an oval arc that starts at the current point and ends at arcEnd, as an SVG elliptical arc does. If the radii are zero or the points are the same, a line is added.

Flutter: ui/painting.dart Path.arcToPoint

func (*Path) Close

func (p *Path) Close()

Close closes the last sub-path, as if a straight line had been drawn from the current point to the first point of the sub-path.

Flutter: ui/painting.dart Path.close

func (*Path) ComputeMetrics

func (p *Path) ComputeMetrics(opts ...ComputePathMetricsOpts) PathMetrics

ComputeMetrics returns the metrics of the contours of the path, in order. Contours with no length are left out. The path is measured as it is when this is called.

Flutter: ui/painting.dart Path.computeMetrics

func (*Path) ConicTo

func (p *Path) ConicTo(x1, y1, x2, y2, w float64)

ConicTo adds a conic section that curves from the current point to the given point (x2, y2), using the control point (x1, y1) and the weight w. If the weight is greater than 1 the curve is a hyperbola, if it is 1 a parabola, and if it is less than 1 an ellipse. A weight that is not positive makes a line to (x2, y2), and one that is infinite makes two lines through (x1, y1).

Flutter: ui/painting.dart Path.conicTo

func (*Path) Contains

func (p *Path) Contains(point Offset) bool

Contains reports whether the point is inside the path, as the fill type decides. Every contour counts as closed. A point on the outline is inside when it is on a left or top edge, as for Rect.Contains.

Flutter: ui/painting.dart Path.contains

func (*Path) CubicTo

func (p *Path) CubicTo(x1, y1, x2, y2, x3, y3 float64)

CubicTo adds a cubic Bézier segment that curves from the current point to the given point (x3, y3), using the control points (x1, y1) and (x2, y2).

Flutter: ui/painting.dart Path.cubicTo

func (*Path) ExtendWithPath

func (p *Path) ExtendWithPath(path *Path, offset Offset, opts ...AddPathOpts)

ExtendWithPath adds the sub-paths of path to this path, translated by offset (after the optional transform), like AddPath, except that the first sub-path is connected to the current point with a line instead of starting a new one.

Flutter: ui/painting.dart Path.extendWithPath

func (*Path) FillType

func (p *Path) FillType() PathFillType

FillType is how the interior of the path is decided. It defaults to PathFillTypeNonZero.

Flutter: ui/painting.dart Path.fillType

func (*Path) Fingerprint

func (p *Path) Fingerprint() uint64

Fingerprint returns a 64-bit hash of the path's contents: its verbs, points, conic weights and fill type. Two paths with the same contents have the same fingerprint, so a renderer can recognize a path it has drawn before even when the app built it again. Different paths almost never share one; a renderer that needs certainty compares the paths too.

The path keeps the fingerprint up to date as it changes, so this takes constant time and writes nothing: it is safe to call from two goroutines while nothing changes the path (SPEC §9.3, §9.9).

Flutter: no counterpart

func (*Path) Flatten

func (p *Path) Flatten(matrix *Matrix4, tolerance float64) []FlatContour

Flatten turns the path into polylines: each contour becomes a list of points that stay within tolerance of the curves they replace. The points are transformed by matrix (which may be nil) first, so the tolerance is in the units of the result, such as device pixels. A tolerance that is not positive is 0.25. A contour that is only a move is dropped, unless it was closed.

Flutter: no counterpart

func (*Path) ForEachSegment

func (p *Path) ForEachSegment(fn func(PathSegment))

ForEachSegment calls fn for each segment of the path, in order.

Flutter: skia SkPath::Iter

func (*Path) GetBounds

func (p *Path) GetBounds() Rect

GetBounds computes the bounding rectangle for this path: the smallest rectangle that contains every point of the path, control points included. A path with no points, or with a point that is not finite, has the empty rectangle at the origin. A path containing only axis-aligned points on the same straight line has no area, and therefore Rect.IsEmpty is true for it: consider checking rect.Width() + rect.Height() > 0 instead.

This is what Flutter returns (SkPath::computeFiniteBounds). GetTightBounds is the exact box of the curves.

Flutter: ui/painting.dart Path.getBounds

func (*Path) GetTightBounds

func (p *Path) GetTightBounds() Rect

GetTightBounds computes the smallest rectangle that contains the path itself: unlike GetBounds it ignores control points that the curves do not reach.

Flutter: skia SkPath::computeTightBounds

func (*Path) IsEmpty

func (p *Path) IsEmpty() bool

IsEmpty reports whether the path has no segments at all.

Flutter: skia SkPath::isEmpty

func (*Path) LineTo

func (p *Path) LineTo(x, y float64)

LineTo adds a straight line segment from the current point to the given point.

Flutter: ui/painting.dart Path.lineTo

func (*Path) MoveTo

func (p *Path) MoveTo(x, y float64)

MoveTo starts a new sub-path at the given coordinate.

Flutter: ui/painting.dart Path.moveTo

func (*Path) QuadraticBezierTo

func (p *Path) QuadraticBezierTo(x1, y1, x2, y2 float64)

QuadraticBezierTo adds a quadratic Bézier segment that curves from the current point to the given point (x2, y2), using the control point (x1, y1).

Flutter: ui/painting.dart Path.quadraticBezierTo

func (*Path) RelativeArcToPoint

func (p *Path) RelativeArcToPoint(arcEndDelta Offset, opts ...ArcToPointOpts)

RelativeArcToPoint is ArcToPoint with the end given as an offset from the current point.

Flutter: ui/painting.dart Path.relativeArcToPoint

func (*Path) RelativeConicTo

func (p *Path) RelativeConicTo(x1, y1, x2, y2, w float64)

RelativeConicTo is ConicTo with the points given as offsets from the current point.

Flutter: ui/painting.dart Path.relativeConicTo

func (*Path) RelativeCubicTo

func (p *Path) RelativeCubicTo(x1, y1, x2, y2, x3, y3 float64)

RelativeCubicTo is CubicTo with the points given as offsets from the current point.

Flutter: ui/painting.dart Path.relativeCubicTo

func (*Path) RelativeLineTo

func (p *Path) RelativeLineTo(dx, dy float64)

RelativeLineTo adds a straight line segment from the current point to the point at the given offset from it.

Flutter: ui/painting.dart Path.relativeLineTo

func (*Path) RelativeMoveTo

func (p *Path) RelativeMoveTo(dx, dy float64)

RelativeMoveTo starts a new sub-path at the given offset from the last point.

Flutter: ui/painting.dart Path.relativeMoveTo

func (*Path) RelativeQuadraticBezierTo

func (p *Path) RelativeQuadraticBezierTo(x1, y1, x2, y2 float64)

RelativeQuadraticBezierTo is QuadraticBezierTo with the points given as offsets from the current point.

Flutter: ui/painting.dart Path.relativeQuadraticBezierTo

func (*Path) Reset

func (p *Path) Reset()

Reset clears the path, removing every sub-path. The fill type is kept.

Flutter: ui/painting.dart Path.reset

func (*Path) Segments

func (p *Path) Segments() []PathSegment

Segments returns the segments of the path as a list.

Flutter: skia SkPath::Iter

func (*Path) SetFillType

func (p *Path) SetFillType(t PathFillType)

SetFillType sets how the interior of the path is decided.

Flutter: ui/painting.dart Path.fillType

func (*Path) Shift

func (p *Path) Shift(offset Offset) *Path

Shift returns a new path that is this path translated by the given offset.

Flutter: ui/painting.dart Path.shift

func (*Path) String

func (p *Path) String() string

String describes the path, as Dart's toString does.

Flutter: ui/painting.dart Path.toString

func (*Path) Transform

func (p *Path) Transform(matrix *Matrix4) *Path

Transform returns a new path with the transformation matrix applied to this one. A matrix with perspective turns the conics into conics with other weights.

Flutter: ui/painting.dart Path.transform

type PathFillType

type PathFillType int

PathFillType is how the interior of a Path is decided.

Flutter: ui/painting.dart PathFillType

const (
	// PathFillTypeUnspecified is the zero value: PathFillTypeNonZero.
	//
	// Flutter: no counterpart
	PathFillTypeUnspecified PathFillType = iota
	// PathFillTypeNonZero is Flutter's PathFillType.nonZero. A point is inside
	// the path if a ray from it crosses the path a different number of times
	// going one way than the other. This is the default.
	//
	// Flutter: ui/painting.dart PathFillType.nonZero
	PathFillTypeNonZero
	// PathFillTypeEvenOdd is Flutter's PathFillType.evenOdd. A point is inside
	// the path if a ray from it crosses the path an odd number of times.
	//
	// Flutter: ui/painting.dart PathFillType.evenOdd
	PathFillTypeEvenOdd
)

The values of PathFillType follow Flutter's declaration order.

func (PathFillType) String

func (e PathFillType) String() string

String returns the name Dart prints for the value, such as "PathFillType.nonZero".

type PathMetric

type PathMetric struct {
	// Length is the total length of the contour, in the units of the path.
	Length float64
	// IsClosed says whether the contour is closed, or was made so.
	IsClosed bool
	// ContourIndex is the position of this contour among the path's contours that
	// have a length.
	ContourIndex int
	// contains filtered or unexported fields
}

PathMetric describes one contour of a path: how long it is, and what lies at each distance along it.

Flutter: ui/painting.dart PathMetric

func (*PathMetric) ExtractPath

func (m *PathMetric) ExtractPath(start, end float64, opts ...ExtractPathOpts) *Path

ExtractPath returns the part of the contour between the distances start and end, as a new path. The distances are clamped to the contour. When start is after end, or there is nothing to extract, the path is empty.

Flutter: ui/painting.dart PathMetric.extractPath

func (*PathMetric) GetTangentForOffset

func (m *PathMetric) GetTangentForOffset(distance float64) (Tangent, bool)

GetTangentForOffset computes the position of the contour at the given distance along it, and the unit vector of its direction there. The distance is clamped to the contour. It reports false when there is nothing to compute, as for a NaN distance.

Flutter: ui/painting.dart PathMetric.getTangentForOffset

func (*PathMetric) String

func (m *PathMetric) String() string

String describes the metric, as Dart's toString does.

Flutter: ui/painting.dart PathMetric.toString

type PathMetrics

type PathMetrics []*PathMetric

PathMetrics is the list of the contours of a path, as PathMetric values.

Flutter: ui/painting.dart PathMetrics

type PathOperation

type PathOperation int

PathOperation is how PathCombine combines two paths.

Flutter: ui/painting.dart PathOperation

const (
	// PathOperationUnspecified is the zero value: PathOperationDifference.
	//
	// Flutter: no counterpart
	PathOperationUnspecified PathOperation = iota
	// PathOperationDifference subtracts the second path from the first.
	//
	// Flutter: ui/painting.dart PathOperation.difference
	PathOperationDifference
	// PathOperationIntersect keeps what the two paths have in common.
	//
	// Flutter: ui/painting.dart PathOperation.intersect
	PathOperationIntersect
	// PathOperationUnion keeps what is in either of the paths.
	//
	// Flutter: ui/painting.dart PathOperation.union
	PathOperationUnion
	// PathOperationXor keeps what is in one of the paths and not in both.
	//
	// Flutter: ui/painting.dart PathOperation.xor
	PathOperationXor
	// PathOperationReverseDifference subtracts the first path from the second.
	//
	// Flutter: ui/painting.dart PathOperation.reverseDifference
	PathOperationReverseDifference
)

The values of PathOperation follow Flutter's declaration order.

func (PathOperation) String

func (o PathOperation) String() string

String returns the name Dart prints for the value, such as "PathOperation.union".

type PathSegment

type PathSegment struct {
	// Verb says what kind of segment this is.
	Verb PathVerb
	// P0 is the start of the segment; for a move, the point moved to.
	P0 Offset
	// P1 is the first point added: the end of a line, the control point of a
	// quad or conic, the first control point of a cubic, the start of the contour
	// for a close.
	P1 Offset
	// P2 is the end of a quad or conic, and the second control point of a cubic.
	P2 Offset
	// P3 is the end of a cubic.
	P3 Offset
	// Weight is the weight of a conic.
	Weight float64
}

PathSegment is one segment of a path, with the point it starts from. P0 is where the segment starts; P1 to P3 are the points it adds, as many as its verb needs: a move has only P0 (the point it moves to), a line P1, a quad or a conic P1 (control) and P2 (end), a cubic P1 and P2 (control) and P3 (end). A close has P0, the last point, and P1, the point the contour started at.

Flutter: skia SkPath::Iter

type PathVerb

type PathVerb uint8

PathVerb is the kind of one segment of a Path.

Flutter: skia SkPath::Verb

const (
	// PathVerbMove starts a new contour at a point.
	//
	// Flutter: skia SkPath::kMove_Verb
	PathVerbMove PathVerb = iota
	// PathVerbLine is a straight line to a point.
	//
	// Flutter: skia SkPath::kLine_Verb
	PathVerbLine
	// PathVerbQuad is a quadratic Bézier curve with one control point.
	//
	// Flutter: skia SkPath::kQuad_Verb
	PathVerbQuad
	// PathVerbConic is a conic section (a rational quadratic) with one control
	// point and a weight.
	//
	// Flutter: skia SkPath::kConic_Verb
	PathVerbConic
	// PathVerbCubic is a cubic Bézier curve with two control points.
	//
	// Flutter: skia SkPath::kCubic_Verb
	PathVerbCubic
	// PathVerbClose closes the contour with a line back to its start.
	//
	// Flutter: skia SkPath::kClose_Verb
	PathVerbClose
)

The verbs of a Path.

type Picture

type Picture struct {
	// contains filtered or unexported fields
}

Picture is an object that holds a sequence of drawing commands, recorded by a Canvas and ended by PictureRecorder.EndRecording. It is immutable, and it can be drawn into any number of canvases or composited into a Scene.

Flutter: ui/painting.dart Picture

func NewPictureFromOps

func NewPictureFromOps(cullRect Rect, ops []DisplayOp) *Picture

NewPictureFromOps makes a picture of the operations, as a PictureRecorder would after a canvas with the cull rectangle recorded them. The picture owns the slice: the caller does not change it afterwards. It is for code that copies a picture with some of its operations replaced (package offscreen).

Flutter: no counterpart

func (*Picture) ApproximateBytesUsed

func (p *Picture) ApproximateBytesUsed() int

ApproximateBytesUsed estimates the memory the picture holds, in bytes. It is meant to decide how many pictures to keep, not to account for memory exactly.

Flutter: ui/painting.dart Picture.approximateBytesUsed

func (*Picture) CullRect

func (p *Picture) CullRect() Rect

CullRect is the rectangle the canvas that recorded the picture was created with: the picture has no content that matters outside it.

Flutter: no counterpart

func (*Picture) DisplayList

func (p *Picture) DisplayList() *DisplayList

DisplayList returns the recorded commands, for the renderers.

Flutter: no counterpart

func (*Picture) Dispose

func (p *Picture) Dispose()

Dispose releases the picture. It does nothing in this implementation, which holds no native resources.

Flutter: ui/painting.dart Picture.dispose

func (*Picture) String

func (p *Picture) String() string

String describes the picture, as Dart's toString does.

Flutter: ui/painting.dart Picture.toString

func (*Picture) ToImage

func (p *Picture) ToImage(width, height int, opts ...ToImageOpts) (*Image, error)

ToImage draws the picture into an image of the given size in pixels. The picture is drawn from its origin with no scaling. It fails with ImageSizeInvalid for a size that is not positive, and RasterizerMissing when no rasterizer is given.

Deviation: Flutter's returns a Future and draws with the engine's rasterizer; this one is synchronous and is given the rasterizer (SPEC §12.10).

Flutter: ui/painting.dart Picture.toImage

func (*Picture) ToImageSync

func (p *Picture) ToImageSync(width, height int, opts ...ToImageOpts) (*Image, error)

ToImageSync is ToImage.

Flutter: ui/painting.dart Picture.toImageSync

type PictureLayer

type PictureLayer struct {

	// Offset is where the origin of the picture goes.
	Offset Offset
	// Picture is the picture to draw.
	Picture *Picture
	// IsComplexHint says that the picture is expensive to draw, so a renderer is
	// advised to cache it.
	IsComplexHint bool
	// WillChangeHint says that the picture is likely to change, so a renderer is
	// advised not to cache it.
	WillChangeHint bool
	// contains filtered or unexported fields
}

PictureLayer draws a picture at an offset.

Flutter: flow/layers/display_list_layer.h DisplayListLayer

func (*PictureLayer) Children

func (b *PictureLayer) Children() []Layer

Children returns the layers under this one.

Flutter: no counterpart

func (*PictureLayer) HasTexture

func (b *PictureLayer) HasTexture() bool

HasTexture reports whether this layer or a layer under it is a TextureLayer.

Flutter: no counterpart

func (*PictureLayer) OldLayer

func (b *PictureLayer) OldLayer() Layer

OldLayer returns the layer of the previous frame this one replaces.

Flutter: no counterpart

type PictureRecorder

type PictureRecorder struct {
	// contains filtered or unexported fields
}

PictureRecorder records the drawing commands of a Canvas into a Picture.

Flutter: ui/painting.dart PictureRecorder

func NewPictureRecorder

func NewPictureRecorder() *PictureRecorder

NewPictureRecorder creates a recorder that is not recording yet: creating a Canvas for it starts the recording.

Flutter: ui/painting.dart PictureRecorder

func (*PictureRecorder) EndRecording

func (r *PictureRecorder) EndRecording() *Picture

EndRecording finishes recording and returns the picture of everything the canvas drew. The canvas can no longer draw. It panics with the tag PictureRecorderNotRecording when nothing was recording.

Flutter: ui/painting.dart PictureRecorder.endRecording

func (*PictureRecorder) IsRecording

func (r *PictureRecorder) IsRecording() bool

IsRecording reports whether a canvas is recording into the recorder.

Flutter: ui/painting.dart PictureRecorder.isRecording

func (*PictureRecorder) String

func (r *PictureRecorder) String() string

String describes the recorder, as Dart's toString does.

Flutter: ui/painting.dart PictureRecorder.toString

type PixelFormat

type PixelFormat int

PixelFormat is the layout of the pixels given to DecodeImageFromPixels.

Flutter: ui/painting.dart PixelFormat

const (
	// PixelFormatUnspecified is the zero value: PixelFormatRGBA8888.
	//
	// Flutter: no counterpart
	PixelFormatUnspecified PixelFormat = iota
	// PixelFormatRGBA8888 is Flutter's PixelFormat.rgba8888: each pixel is four
	// bytes, red, green, blue and alpha in this order, with premultiplied alpha.
	//
	// Flutter: ui/painting.dart PixelFormat.rgba8888
	PixelFormatRGBA8888
	// PixelFormatBGRA8888 is Flutter's PixelFormat.bgra8888: each pixel is four
	// bytes, blue, green, red and alpha in this order, with premultiplied alpha.
	//
	// Flutter: ui/painting.dart PixelFormat.bgra8888
	PixelFormatBGRA8888
)

The values of PixelFormat follow Flutter's declaration order.

type PlaceholderAlignment

type PlaceholderAlignment int

PlaceholderAlignment is where to vertically align a placeholder relative to the surrounding text.

Flutter: ui/text.dart PlaceholderAlignment

const (
	// PlaceholderAlignmentUnspecified is the zero value: baseline.
	//
	// Flutter: no counterpart
	PlaceholderAlignmentUnspecified PlaceholderAlignment = iota
	// PlaceholderAlignmentBaseline matches the baseline of the placeholder with the baseline of the text.
	//
	// Flutter: ui/text.dart PlaceholderAlignment.baseline
	PlaceholderAlignmentBaseline
	// PlaceholderAlignmentAboveBaseline aligns the bottom edge of the placeholder with the baseline, so it is entirely above the baseline.
	//
	// Flutter: ui/text.dart PlaceholderAlignment.aboveBaseline
	PlaceholderAlignmentAboveBaseline
	// PlaceholderAlignmentBelowBaseline aligns the top edge of the placeholder with the baseline, so it is entirely below the baseline.
	//
	// Flutter: ui/text.dart PlaceholderAlignment.belowBaseline
	PlaceholderAlignmentBelowBaseline
	// PlaceholderAlignmentTop aligns the top edge of the placeholder with the top edge of the text.
	//
	// Flutter: ui/text.dart PlaceholderAlignment.top
	PlaceholderAlignmentTop
	// PlaceholderAlignmentBottom aligns the bottom edge of the placeholder with the bottom edge of the text.
	//
	// Flutter: ui/text.dart PlaceholderAlignment.bottom
	PlaceholderAlignmentBottom
	// PlaceholderAlignmentMiddle aligns the middle of the placeholder with the middle of the text.
	//
	// Flutter: ui/text.dart PlaceholderAlignment.middle
	PlaceholderAlignmentMiddle
)

The values of PlaceholderAlignment follow Flutter's declaration order.

func (PlaceholderAlignment) Name

func (e PlaceholderAlignment) Name() string

Name returns the Dart enum name, such as "middle".

Flutter: dart:core Enum.name

func (PlaceholderAlignment) String

func (e PlaceholderAlignment) String() string

String returns the name Dart prints for the value, such as "PlaceholderAlignment.middle".

type PlaceholderSpec

type PlaceholderSpec struct {
	// Offset is the byte offset of the U+FFFC character that stands for the placeholder in Text.
	Offset int
	// Width and Height are the size of the box, in logical pixels, before Scale.
	Width, Height float64
	// Alignment is how the box aligns vertically with the text.
	Alignment PlaceholderAlignment
	// Scale multiplies Width, Height and BaselineOffset.
	Scale float64
	// BaselineOffset is the distance from the top of the box to its baseline, used for the baseline alignments.
	BaselineOffset float64
	// Baseline is the text baseline that BaselineOffset aligns with.
	Baseline TextBaseline
}

PlaceholderSpec is a box in the text that the paragraph leaves room for: an inline widget.

Flutter: no counterpart

type PlatformConfiguration

type PlatformConfiguration struct {
	// Locales are the user's locales, most preferred first.
	Locales []Locale
	// TextScaleFactor is the system text scale; 0 means 1.
	TextScaleFactor float64
	// PlatformBrightness is the system color scheme; BrightnessUnspecified
	// means light.
	PlatformBrightness Brightness
	// AccessibilityFeatures are the system's accessibility settings.
	AccessibilityFeatures AccessibilityFeatures
	// AccentColor is the system accent color, or nil if there is none.
	AccentColor *Color
	// AlwaysUse24HourFormat is whether the user wants times in 24-hour format.
	//
	// Flutter: ui/platform_dispatcher.dart PlatformConfiguration.alwaysUse24HourFormat
	AlwaysUse24HourFormat bool
	// ScaleFontSize, when it is not nil, scales a font size in logical pixels the way the system
	// does, which is not linear on Android 14 and later (the size is interpolated between the
	// whole sizes the system converts). A platform that scales text linearly leaves it nil.
	//
	// Flutter: ui/platform_dispatcher.dart PlatformConfiguration.configurationId (the
	// synchronous call getScaledFontSize)
	ScaleFontSize func(fontSize float64) float64
	// UIFontFamily and UIFontSize are the family and the size, in points, of
	// the desktop's interface font (GNOME's font-name); empty and 0 when the
	// platform does not say.
	//
	// Flutter: no counterpart
	UIFontFamily string
	UIFontSize   float64
	// MonospaceFontFamily and MonospaceFontSize are the family and the size, in
	// points, of the desktop's monospace font (GNOME's monospace-font-name); empty
	// and 0 when the platform does not say. A code editor uses them as its default
	// font.
	//
	// Flutter: no counterpart
	MonospaceFontFamily string
	MonospaceFontSize   float64
	// CaretBlinkTime is the time the caret of a text field stays on, and then off, as the
	// system says; zero when the platform does not say, CaretBlinkNever when the user turned
	// the blinking off.
	//
	// Deviation: Flutter blinks at a fixed half period of 500 ms (SPEC §12.10).
	//
	// Flutter: no counterpart (widgets/editable_text.dart _kCursorBlinkHalfPeriod is a constant)
	CaretBlinkTime time.Duration
	// DoubleClickTime is the longest time between the two clicks of a double click, as the
	// system says; zero when the platform does not say. The gestures keep Flutter's
	// kDoubleTapTimeout; apps and the framework can read it with
	// PlatformDispatcher.DoubleClickTime.
	//
	// Deviation: Flutter's double-tap timeout is a constant (SPEC §12.10).
	//
	// Flutter: no counterpart (gestures/constants.dart kDoubleTapTimeout is a constant)
	DoubleClickTime time.Duration
}

PlatformConfiguration is the system-wide configuration the app follows. The engine hands one to the dispatcher whenever it changes.

Flutter: ui/platform_dispatcher.dart PlatformConfiguration

type PlatformDispatcher

type PlatformDispatcher struct {
	// OnMetricsChanged is called when the metrics of a view change.
	//
	// Flutter: ui/platform_dispatcher.dart PlatformDispatcher.onMetricsChanged
	OnMetricsChanged func()
	// OnLocaleChanged is called when the locales change.
	//
	// Flutter: ui/platform_dispatcher.dart PlatformDispatcher.onLocaleChanged
	OnLocaleChanged func()
	// OnPopRoute is called when the system asks the app to go back (SPEC §24.8). The binding sets it.
	//
	// Flutter: widgets/binding.dart WidgetsBinding.handlePopRoute
	OnPopRoute func()
	// OnStartBackGesture is called when a predictive back gesture starts; it returns whether the
	// framework took it. The binding sets it.
	//
	// Flutter: widgets/binding.dart WidgetsBinding._handleStartBackGesture
	OnStartBackGesture func(BackGestureEvent) bool
	// OnUpdateBackGestureProgress, OnCommitBackGesture and OnCancelBackGesture are called as a
	// predictive back gesture goes on, ends and is cancelled. The binding sets them.
	//
	// Flutter: widgets/binding.dart WidgetsBinding._handleUpdateBackGestureProgress
	OnUpdateBackGestureProgress func(BackGestureEvent)
	OnCommitBackGesture         func()
	OnCancelBackGesture         func()
	// OnMemoryPressure is called when the system is low on memory. The binding sets it.
	//
	// Flutter: widgets/binding.dart WidgetsBinding.handleMemoryPressure
	OnMemoryPressure func()
	// OnTextScaleFactorChanged is called when the text scale factor changes.
	//
	// Flutter: ui/platform_dispatcher.dart PlatformDispatcher.onTextScaleFactorChanged
	OnTextScaleFactorChanged func()
	// OnPlatformBrightnessChanged is called when the system brightness
	// changes.
	//
	// Flutter: ui/platform_dispatcher.dart PlatformDispatcher.onPlatformBrightnessChanged
	OnPlatformBrightnessChanged func()
	// OnPlatformConfigurationChanged is called when any system setting
	// changes, after the callback for that setting.
	//
	// Flutter: ui/platform_dispatcher.dart PlatformDispatcher.onPlatformConfigurationChanged
	OnPlatformConfigurationChanged func()
	// OnAccessibilityFeaturesChanged is called when the accessibility
	// features change.
	//
	// Flutter: ui/platform_dispatcher.dart PlatformDispatcher.onAccessibilityFeaturesChanged
	OnAccessibilityFeaturesChanged func()
	// OnFontsChanged is called after fonts were added to the text engine
	// (LoadFontFromList), so that the framework lays the text out again.
	//
	// Flutter: services/system_channels.dart SystemChannels.system (the fontsChange message)
	OnFontsChanged func()
	// OnSemanticsEnabledChanged is called when an assistive technology starts or
	// stops asking for semantics.
	//
	// Flutter: ui/platform_dispatcher.dart PlatformDispatcher.onSemanticsEnabledChanged
	OnSemanticsEnabledChanged func()
	// OnSemanticsActionEvent is called when an assistive technology asks a node
	// to perform an action.
	//
	// Flutter: ui/platform_dispatcher.dart PlatformDispatcher.onSemanticsActionEvent
	OnSemanticsActionEvent func(event SemanticsActionEvent)
	// OnBeginFrame is called to start a frame, with the time of the frame
	// since an arbitrary fixed point. The times never go back. Animation
	// tickers run here.
	//
	// Flutter: ui/platform_dispatcher.dart PlatformDispatcher.onBeginFrame
	OnBeginFrame func(frameTime time.Duration)
	// OnDrawFrame is called to build the frame's scene and render it, after
	// OnBeginFrame.
	//
	// Flutter: ui/platform_dispatcher.dart PlatformDispatcher.onDrawFrame
	OnDrawFrame func()
	// OnReportTimings is called with the timings of the frames that were drawn since
	// the last call: the engine reports a batch after each frame. The engine measures
	// the frames only while this is set (NeedsReportTimings).
	//
	// Flutter: ui/platform_dispatcher.dart PlatformDispatcher.onReportTimings
	OnReportTimings func(timings []FrameTiming)
	// OnPointerDataPacket is called with the pointer reports that arrived
	// since the last frame, at the start of a frame.
	//
	// Flutter: ui/platform_dispatcher.dart PlatformDispatcher.onPointerDataPacket
	OnPointerDataPacket func(packet PointerDataPacket)
	// OnKeyData is called for each key event. It returns whether the event
	// was handled.
	//
	// Flutter: ui/platform_dispatcher.dart PlatformDispatcher.onKeyData
	OnKeyData func(data KeyData) bool
	// OnTextInput is called with a change that the input method asks of the
	// focused text field (preedit, commit or a deletion).
	//
	// Flutter: services/text_input.dart TextInput._handleTextInputInvocation
	OnTextInput func(event TextInputEvent)
	// OnAppLifecycleStateChanged is called when the app lifecycle state
	// changes.
	//
	// Flutter: services/binding.dart (the flutter/lifecycle channel)
	OnAppLifecycleStateChanged func(state AppLifecycleState)
	// OnExitRequested is called when the user asks to close a view (the close
	// button of a window). It returns the response of the app: with
	// AppExitResponseCancel the window stays open. Nil lets the window close.
	// The framework installs it to ask the observers of the widgets binding
	// (SPEC §8.7 "Closing").
	//
	// Flutter: services/binding.dart ServicesBinding.handleRequestAppExit
	OnExitRequested func(view ViewID) AppExitResponse
	// OnViewRemoved is called after a view was removed (RemoveView), whoever removed
	// it: the platform closed its window, or the framework destroyed it. The framework
	// installs it so that the first window's controller and View know that it is gone
	// (SPEC §8.7 "Closing").
	//
	// Flutter: no counterpart
	OnViewRemoved func(view ViewID)
	// OnPointerLockEnded is called when the pointer lock of a view ended by itself (SPEC §27.6): the window lost the
	// focus, the compositor or the browser ended the lock, or the window was closed. The framework installs it for
	// widgets.PointerLock.
	//
	// Flutter: no counterpart
	OnPointerLockEnded func(view ViewID)
	// OnViewFocusChange is called when a view gets or loses the focus.
	//
	// Flutter: ui/platform_dispatcher.dart PlatformDispatcher.onViewFocusChange
	OnViewFocusChange func(event ViewFocusEvent)
	// OnDrop is called for a drag and drop operation over a view, and returns the
	// action the framework accepts at that place (DropActionNone for none). A drop
	// carries the data.
	//
	// Flutter: no counterpart
	OnDrop func(event DropEvent) DropActions
	// OnDragEnd is called when a drag that the app started with StartDrag is over.
	//
	// Flutter: no counterpart
	OnDragEnd func(result DragResult)
	// OnWindowCloseRequested is called when the user asks to close the window of a
	// view. It returns true when the framework takes over, as the owner of a window
	// controller does: it decides whether to destroy the window, and the engine does
	// not close it. OnExitRequested is not asked then.
	//
	// Flutter: widgets/_window.dart RegularWindowControllerDelegate.onWindowCloseRequested
	OnWindowCloseRequested func(view ViewID) bool
	// IsIdle reports whether the framework has nothing more to show: no frame is
	// scheduled and no work that changes the picture is pending (an image that is
	// loading, an animation). The engine asks it to decide when the
	// self-capture (GLUTTER_SCREENSHOT) may save the window. Nil counts as idle.
	//
	// Flutter: no counterpart
	IsIdle func() bool
	// contains filtered or unexported fields
}

PlatformDispatcher is the central point where the framework meets the platform: the views, the frame callbacks, the input, and the system settings.

The engine creates one with NewPlatformDispatcher and gives it to the framework (SPEC §7, §13). Everything here runs on the UI thread. The callbacks are plain fields; set the ones you need. The methods under "Called by the engine" are for the engine to report what happens; an app does not call them.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher

func NewPlatformDispatcher

func NewPlatformDispatcher(host PlatformHost) *PlatformDispatcher

NewPlatformDispatcher creates a dispatcher with no views. The host is the engine; it may be nil in a test, where scheduling does nothing and rendering returns PlatformHostMissing.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.new

func (*PlatformDispatcher) AccentColor

func (d *PlatformDispatcher) AccentColor() *Color

AccentColor is the system accent color, or nil if there is none.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.systemAccentColor (in newer versions)

func (*PlatformDispatcher) AccessibilityFeatures

func (d *PlatformDispatcher) AccessibilityFeatures() AccessibilityFeatures

AccessibilityFeatures are the system's accessibility settings.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.accessibilityFeatures

func (*PlatformDispatcher) ActivateSystemCursor

func (d *PlatformDispatcher) ActivateSystemCursor(device int, kind string)

ActivateSystemCursor asks the engine to show the system cursor of the kind for the device. Nothing happens when the host cannot show cursors.

Deviation: Flutter sends it as the activateSystemCursor call of the flutter/mousecursor platform channel (SPEC §12.10).

Flutter: services/mouse_cursor.dart _SystemMouseCursorSession.activate

func (*PlatformDispatcher) ActivationToken

func (d *PlatformDispatcher) ActivationToken(view ViewID, done func(token string))

ActivationToken gives done an activation token for an app that this app starts from the window of the view; see PortalHost. Without a host it is called at once with an empty token.

Flutter: no counterpart

func (*PlatformDispatcher) AddView

func (d *PlatformDispatcher) AddView(id ViewID, cfg ViewConfiguration) *View

AddView makes a view with the ID and configuration and returns it. A second view with the same ID replaces the first. Called by the engine.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.addView (the engine's _addView)

func (*PlatformDispatcher) AlwaysUse24HourFormat

func (d *PlatformDispatcher) AlwaysUse24HourFormat() bool

AlwaysUse24HourFormat is whether the user wants times in 24-hour format.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.alwaysUse24HourFormat

func (*PlatformDispatcher) AppID

func (d *PlatformDispatcher) AppID() string

AppID is the application ID of the app (RunAppOpts.AppID), or an empty string when the host does not know it.

Flutter: no counterpart

func (*PlatformDispatcher) AppLifecycleState

func (d *PlatformDispatcher) AppLifecycleState() AppLifecycleState

AppLifecycleState is the lifecycle state of the app; AppLifecycleStateUnspecified until the platform reports one.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.initialLifecycleState

func (*PlatformDispatcher) BeginFrame

func (d *PlatformDispatcher) BeginFrame(frameTime time.Duration)

BeginFrame starts a frame: it calls OnBeginFrame with the frame time. A time earlier than the last one is raised to it, so the times never go back. Called by the engine.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher._beginFrame

func (*PlatformDispatcher) CancelBackGesture

func (d *PlatformDispatcher) CancelBackGesture()

CancelBackGesture is called by the engine when the user cancels a predictive back gesture.

Flutter: widgets/binding.dart WidgetsBinding._handleCancelBackGesture

func (*PlatformDispatcher) CaretBlinkTime

func (d *PlatformDispatcher) CaretBlinkTime() time.Duration

CaretBlinkTime is the time the caret of a text field stays on, and then off, as the system says: zero when the platform does not say (the framework uses 500 ms) and CaretBlinkNever when the user turned the blinking off.

Flutter: no counterpart

func (*PlatformDispatcher) CommitBackGesture

func (d *PlatformDispatcher) CommitBackGesture()

CommitBackGesture is called by the engine when the user finishes a predictive back gesture.

Flutter: widgets/binding.dart WidgetsBinding._handleCommitBackGesture

func (*PlatformDispatcher) CreateWindow

func (d *PlatformDispatcher) CreateWindow(spec WindowSpec) (*View, error)

CreateWindow asks the engine for a new window and returns its view. The view's configuration is the one the host starts with; the platform reports the real one soon after. It fails with WindowingUnsupported when the host cannot create windows, and with the host's error otherwise.

Flutter: widgets/_window.dart WindowingOwner.createRegularWindowController

func (*PlatformDispatcher) DestroyWindow

func (d *PlatformDispatcher) DestroyWindow(id ViewID)

DestroyWindow destroys the window of the view and removes the view. Rendering into a view that was destroyed does nothing.

Flutter: widgets/_window.dart BaseWindowController.destroy

func (*PlatformDispatcher) DispatchDragEnd

func (d *PlatformDispatcher) DispatchDragEnd(result DragResult)

DispatchDragEnd passes the end of a drag that the app started to OnDragEnd. Called by the engine.

Flutter: no counterpart

func (*PlatformDispatcher) DispatchDrop

func (d *PlatformDispatcher) DispatchDrop(event DropEvent) DropActions

DispatchDrop passes a drop event to OnDrop and returns the action that the framework accepts, or DropActionNone. Called by the engine.

Flutter: no counterpart

func (*PlatformDispatcher) DispatchKeyData

func (d *PlatformDispatcher) DispatchKeyData(data KeyData) bool

DispatchKeyData gives a key event to OnKeyData and returns whether it was handled (false when nothing listens). Called by the engine.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher._dispatchKeyData

func (*PlatformDispatcher) DispatchPointerDataPacket

func (d *PlatformDispatcher) DispatchPointerDataPacket(packet PointerDataPacket)

DispatchPointerDataPacket gives the pointer reports to OnPointerDataPacket. Called by the engine.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher._dispatchPointerDataPacket

func (*PlatformDispatcher) DispatchSemanticsActionEvent

func (d *PlatformDispatcher) DispatchSemanticsActionEvent(event SemanticsActionEvent)

DispatchSemanticsActionEvent reports an action that an assistive technology asked for. Called by the engine.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher._dispatchSemanticsAction

func (*PlatformDispatcher) DispatchTextInput

func (d *PlatformDispatcher) DispatchTextInput(event TextInputEvent)

DispatchTextInput gives a change asked by the input method to OnTextInput. Called by the engine.

Flutter: services/text_input.dart TextInput._handleTextInputInvocation

func (*PlatformDispatcher) DispatchViewFocus

func (d *PlatformDispatcher) DispatchViewFocus(event ViewFocusEvent)

DispatchViewFocus tells OnViewFocusChange that a view got or lost the focus. Called by the engine.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher._dispatchViewFocusEvent

func (*PlatformDispatcher) Displays

func (d *PlatformDispatcher) Displays() []Display

Displays are the connected displays.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.displays

func (*PlatformDispatcher) DoubleClickTime

func (d *PlatformDispatcher) DoubleClickTime() time.Duration

DoubleClickTime is the longest time between the two clicks of a double click, as the system says; zero when the platform does not say.

Flutter: no counterpart

func (*PlatformDispatcher) DrawFrame

func (d *PlatformDispatcher) DrawFrame()

DrawFrame ends a frame: it calls OnDrawFrame. Called by the engine.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher._drawFrame

func (*PlatformDispatcher) FontMetrics

func (d *PlatformDispatcher) FontMetrics(style *TextStyle) (FontMetrics, error)

FontMetrics measures the font that a text style draws with, at its size: the ascent, descent and leading, the height of a line, the advance of the digit "0" and whether the font is monospaced (FontMetrics). The numbers are those of a paragraph of one line in the style, without building one for each style. The style is resolved against the defaults of a paragraph (black, 14 logical pixels, weight 400), so a style that leaves the size or the family out gets those; nil is the default style. It fails with FontMetricsUnsupported when the text engine cannot measure.

Flutter: no counterpart

func (*PlatformDispatcher) GetClipboard

func (d *PlatformDispatcher) GetClipboard(ctx context.Context, kind ClipboardKind, format string, done func(content ClipboardContent, err error))

GetClipboard asks the engine to read the selection of the kind in the format. done is called later on the UI thread; the content is empty when the selection has no such format. A host without a rich clipboard fails with ClipboardUnavailable, except for the text of the system clipboard.

Flutter: no counterpart

func (*PlatformDispatcher) GetClipboardText

func (d *PlatformDispatcher) GetClipboardText(ctx context.Context, done func(text string, ok bool, err error))

GetClipboardText asks the engine to read the text of the system clipboard. done is called later on the UI thread; ok is false when the clipboard has no text. A host without a clipboard fails with ClipboardUnavailable.

Deviation: Flutter sends it as the Clipboard.getData call of the flutter/platform channel (SPEC §12.10).

Flutter: services/clipboard.dart Clipboard.getData

func (*PlatformDispatcher) HostAs

func (d *PlatformDispatcher) HostAs(target any) bool

HostAs finds in the host of the dispatcher (the engine) the interface that target points to: it sets *target to the host and returns true when the host implements the interface, and returns false when it does not (or there is no engine behind the dispatcher). It is how a package that is not the engine reaches an optional service of the host without the host's type being public, as errors.As does for errors (package gpu gets the device of the renderer so, SPEC §27.2). It panics with HostAsTargetInvalid when target is not a non-nil pointer to an interface.

Flutter: no counterpart

func (*PlatformDispatcher) ImplicitView

func (d *PlatformDispatcher) ImplicitView() *View

ImplicitView returns the first view, the one with ImplicitViewID, or nil if it was closed.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.implicitView

func (*PlatformDispatcher) InstalledFontFamilies

func (d *PlatformDispatcher) InstalledFontFamilies() []string

InstalledFontFamilies lists the font families that a TextStyle can name: the system's, the bundled and the loaded ones, sorted without regard to case. It is nil when the text engine cannot say. The first call on a machine that has no fontconfig scans the font directories.

Flutter: no counterpart

func (*PlatformDispatcher) KeepScreenOn

func (d *PlatformDispatcher) KeepScreenOn(id ViewID, on bool) error

KeepScreenOn stops the screen from going idle while the window of the view is visible, or, with false, lets it. It fails with IdleInhibitUnavailable when the host or the platform cannot.

Flutter: no counterpart

func (*PlatformDispatcher) LoadFontFromList

func (d *PlatformDispatcher) LoadFontFromList(list []byte, fontFamily string) error

LoadFontFromList loads a font while the app runs, and makes it usable in TextStyle.FontFamily and TextStyle.FontFamilyFallback under the family name; list is a TrueType or OpenType file. A family can have several fonts (regular, bold, italic...); the weight and slant of each come from the font. An empty family takes the name inside the font. The text laid out before is laid out again (OnFontsChanged). It must be called on the UI thread, and fails with FontLoadUnsupported when the text engine cannot load fonts, FontDataInvalid when list is not a font, and FontFamilyMissing when there is no family name.

Flutter: ui/text.dart loadFontFromList

func (*PlatformDispatcher) Locale

func (d *PlatformDispatcher) Locale() Locale

Locale is the user's most preferred locale; the empty locale if the platform reports none.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.locale

func (*PlatformDispatcher) Locales

func (d *PlatformDispatcher) Locales() []Locale

Locales are the user's locales, most preferred first.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.locales

func (*PlatformDispatcher) LockPointer

func (d *PlatformDispatcher) LockPointer(view ViewID) error

LockPointer locks the pointer to the window of the view (SPEC §27.6). It fails with PointerLockUnavailable when the host or the platform cannot, and with PointerLockDenied when the platform refuses.

Flutter: no counterpart

func (*PlatformDispatcher) MonospaceFont

func (d *PlatformDispatcher) MonospaceFont() (family string, size float64)

MonospaceFont is the family and the size, in points, of the desktop's monospace font; empty and 0 when the platform does not say.

Flutter: no counterpart

func (*PlatformDispatcher) NeedsReportTimings

func (d *PlatformDispatcher) NeedsReportTimings() bool

NeedsReportTimings says whether anything listens for frame timings, so that the engine measures them only when they are used. Called by the engine.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher._setNeedsReportTimings

func (*PlatformDispatcher) NotifyMemoryPressure

func (d *PlatformDispatcher) NotifyMemoryPressure()

NotifyMemoryPressure is called by the engine when the system is low on memory.

Flutter: services/system_channels.dart SystemChannels.system (memoryPressure)

func (*PlatformDispatcher) PerformHapticFeedback

func (d *PlatformDispatcher) PerformHapticFeedback(kind HapticFeedbackKind)

PerformHapticFeedback asks the engine for haptic feedback. Nothing happens when the host cannot.

Deviation: Flutter sends it as the HapticFeedback.vibrate call of the flutter/platform channel (SPEC §12.10).

Flutter: services/haptic_feedback.dart HapticFeedback

func (*PlatformDispatcher) PlatformBrightness

func (d *PlatformDispatcher) PlatformBrightness() Brightness

PlatformBrightness is the system color scheme; BrightnessLight unless the platform says dark.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.platformBrightness

func (*PlatformDispatcher) PlatformService

func (d *PlatformDispatcher) PlatformService(name string) any

PlatformService returns the optional service of the platform with the name (see ServiceHost), or nil when the host or the platform has none. It may be called from any goroutine.

Flutter: no counterpart

func (*PlatformDispatcher) PlaySystemSound

func (d *PlatformDispatcher) PlaySystemSound(kind SystemSoundKind)

PlaySystemSound asks the engine to play a sound of the system. Nothing happens when the host cannot.

Deviation: Flutter sends it as the SystemSound.play call of the flutter/platform channel (SPEC §12.10).

Flutter: services/system_sound.dart SystemSound.play

func (*PlatformDispatcher) PointerLockEnded

func (d *PlatformDispatcher) PointerLockEnded(view ViewID)

PointerLockEnded is called by the engine when the lock of a view ended without the app asking: the window lost the focus, the compositor or the browser ended it, or the window was closed. It calls OnPointerLockEnded.

Flutter: no counterpart

func (*PlatformDispatcher) PopRoute

func (d *PlatformDispatcher) PopRoute()

PopRoute is called by the engine when the system asks the app to go back (the back button of an old Android, or the back gesture when it is not predictive): OnPopRoute decides what that is.

Flutter: services/system_channels.dart SystemChannels.navigation (popRoute)

func (*PlatformDispatcher) PortalParentHandle

func (d *PlatformDispatcher) PortalParentHandle(view ViewID, done func(handle string))

PortalParentHandle gives done the handle that the portals take as the parent of a dialog over the window of the view; see PortalHost. Without a host it is called at once with an empty handle.

Flutter: no counterpart

func (*PlatformDispatcher) Post

func (d *PlatformDispatcher) Post(fn func())

Post runs fn on the UI thread, after the work that is running now, and wakes the event loop. It is safe to call from any goroutine; functions posted by one goroutine run in the order it posted them. Without an engine behind the dispatcher, fn runs at once.

Flutter: dart:async Timer.run, scheduleMicrotask (the event loop of the UI isolate)

func (*PlatformDispatcher) RemoveView

func (d *PlatformDispatcher) RemoveView(id ViewID)

RemoveView removes the view with the ID. Called by the engine.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.removeView (the engine's _removeView)

func (*PlatformDispatcher) ReportTimings

func (d *PlatformDispatcher) ReportTimings(timings []FrameTiming)

ReportTimings gives the timings of the frames that were drawn to OnReportTimings. Called by the engine.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher._reportTimings

func (*PlatformDispatcher) RequestAppExit

func (d *PlatformDispatcher) RequestAppExit()

RequestAppExit asks the engine to end the app: the windows close and the run loop returns.

Flutter: services/system_channels.dart (System.exitApplication)

func (*PlatformDispatcher) RequestClose

func (d *PlatformDispatcher) RequestClose(id ViewID) bool

RequestClose is called by the engine when the user asks to close the view. It returns whether the view may close: false when OnExitRequested cancels.

Flutter: services/binding.dart ServicesBinding.handleRequestAppExit

func (*PlatformDispatcher) RequestViewFocusChange

func (d *PlatformDispatcher) RequestViewFocusChange(id ViewID, state ViewFocusState, direction ViewFocusDirection)

RequestViewFocusChange asks the engine to give the focus to the native window of a view, or to take it away. The engine answers with a view focus event once the window has it.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.requestViewFocusChange

func (*PlatformDispatcher) ResolveFont

func (d *PlatformDispatcher) ResolveFont(family string, weight FontWeight, style FontStyle) (ResolvedFont, bool)

ResolveFont says which face a font family resolves to for a weight and a slant: the one that draws a letter of a TextStyle that names only that family. A generic family (monospace) gives the system's font for it, and a name that the user's configuration stands for another (Arial) the font of that. It is false when the family has no font, or when the text engine cannot say. A zero weight is FontWeightW400.

Flutter: no counterpart

func (*PlatformDispatcher) ScaleFontSize

func (d *PlatformDispatcher) ScaleFontSize(fontSize float64) float64

ScaleFontSize computes the scaled font size from the unscaled one, in logical pixels, according to the user's text scale. A platform that scales text linearly (the PlatformConfiguration has no ScaleFontSize) gives fontSize times TextScaleFactor. Otherwise the sizes on both sides of fontSize are converted by the platform (and remembered until the configuration changes) and the result is interpolated between them. The result is never negative for a valid size.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.scaleFontSize

func (*PlatformDispatcher) ScheduleFrame

func (d *PlatformDispatcher) ScheduleFrame()

ScheduleFrame asks for OnBeginFrame and OnDrawFrame to be called at the next moment the display wants a frame. Asking again before that is the same as asking once.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.scheduleFrame

func (*PlatformDispatcher) SemanticsEnabled

func (d *PlatformDispatcher) SemanticsEnabled() bool

SemanticsEnabled reports whether an assistive technology asks for semantics.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.semanticsEnabled

func (*PlatformDispatcher) SetAppLifecycleState

func (d *PlatformDispatcher) SetAppLifecycleState(state AppLifecycleState)

SetAppLifecycleState sets the lifecycle state and calls OnAppLifecycleStateChanged when it changed. Called by the engine.

Flutter: services/binding.dart (the flutter/lifecycle channel)

func (*PlatformDispatcher) SetBrowserContextMenuEnabled

func (d *PlatformDispatcher) SetBrowserContextMenuEnabled(enabled bool) bool

SetBrowserContextMenuEnabled asks the engine to show or to hide the browser's context menu, and reports whether it did: a host that is not a browser has no such menu and nothing happens.

Deviation: Flutter sends it as the enableContextMenu and disableContextMenu calls of the flutter/contextmenu platform channel (SPEC §12.10).

Flutter: services/browser_context_menu.dart BrowserContextMenu.enableContextMenu

func (*PlatformDispatcher) SetClipboard

func (d *PlatformDispatcher) SetClipboard(ctx context.Context, kind ClipboardKind, content ClipboardContent, done func(err error))

SetClipboard asks the engine to put the content on the selection of the kind (the system clipboard or the primary selection). done, when it is not nil, is called later on the UI thread with the error if any. A host without a rich clipboard fails with ClipboardUnavailable, except for the text of the system clipboard.

Flutter: no counterpart

func (*PlatformDispatcher) SetClipboardText

func (d *PlatformDispatcher) SetClipboardText(ctx context.Context, text string, done func(err error))

SetClipboardText asks the engine to put text on the system clipboard. done, when it is not nil, is called later on the UI thread with the error if any. A host without a clipboard fails with ClipboardUnavailable.

Deviation: Flutter sends it as the Clipboard.setData call of the flutter/platform channel (SPEC §12.10).

Flutter: services/clipboard.dart Clipboard.setData

func (*PlatformDispatcher) SetDisplays

func (d *PlatformDispatcher) SetDisplays(displays []Display)

SetDisplays sets the connected displays. Called by the engine.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher._updateDisplays

func (*PlatformDispatcher) SetEnabledSystemUIMode

func (d *PlatformDispatcher) SetEnabledSystemUIMode(mode SystemUIMode, overlays []SystemUIOverlay)

SetEnabledSystemUIMode asks the engine to show or hide the system's bars. Nothing happens when the host cannot.

Deviation: Flutter sends it as the SystemChrome.setEnabledSystemUIMode call of the flutter/platform channel (SPEC §12.10).

Flutter: services/system_chrome.dart SystemChrome.setEnabledSystemUIMode

func (*PlatformDispatcher) SetFrameworkHandlesBack

func (d *PlatformDispatcher) SetFrameworkHandlesBack(handles bool)

SetFrameworkHandlesBack tells the engine whether the framework handles the back gesture.

Deviation: Flutter sends it as the SystemNavigator.setFrameworkHandlesBack call of the flutter/platform channel (SPEC §12.10).

Flutter: services/system_navigator.dart SystemNavigator.setFrameworkHandlesBack

func (*PlatformDispatcher) SetPreferredOrientations

func (d *PlatformDispatcher) SetPreferredOrientations(orientations []DeviceOrientation)

SetPreferredOrientations asks the engine to limit the orientations of the app. Nothing happens when the host cannot.

Deviation: Flutter sends it as the SystemChrome.setPreferredOrientations call of the flutter/platform channel (SPEC §12.10).

Flutter: services/system_chrome.dart SystemChrome.setPreferredOrientations

func (*PlatformDispatcher) SetSemanticsEnabled

func (d *PlatformDispatcher) SetSemanticsEnabled(enabled bool)

SetSemanticsEnabled says whether an assistive technology asks for semantics, and calls OnSemanticsEnabledChanged if that changed. Called by the engine.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher._updateSemanticsEnabled

func (*PlatformDispatcher) SetSemanticsTreeEnabled

func (d *PlatformDispatcher) SetSemanticsTreeEnabled(enabled bool)

SetSemanticsTreeEnabled tells the engine whether the framework produces a semantics tree.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.setSemanticsTreeEnabled

func (*PlatformDispatcher) SetSystemUIChangeCallback

func (d *PlatformDispatcher) SetSystemUIChangeCallback(fn func(visible bool))

SetSystemUIChangeCallback sets the function that hears of the system showing or hiding its bars. Nothing happens when the host cannot.

Deviation: Flutter sends it as the SystemChrome.setSystemUIChangeListener call of the flutter/platform channel and receives the changes as method calls (SPEC §12.10).

Flutter: services/system_chrome.dart SystemChrome.setSystemUIChangeCallback

func (*PlatformDispatcher) SetSystemUIOverlayStyle

func (d *PlatformDispatcher) SetSystemUIOverlayStyle(style SystemUIOverlayStyle)

SetSystemUIOverlayStyle asks the engine to set the look of the system's bars. Nothing happens when the host cannot.

Deviation: Flutter sends it as the SystemChrome.setSystemUIOverlayStyle call of the flutter/platform channel (SPEC §12.10).

Flutter: services/system_chrome.dart SystemChrome.setSystemUIOverlayStyle

func (*PlatformDispatcher) SetTextEngine

func (d *PlatformDispatcher) SetTextEngine(engine ParagraphFactory)

SetTextEngine sets the text engine that lays out paragraphs. The engine calls it at startup.

Flutter: no counterpart (Dart reaches the engine's font collection globally)

func (*PlatformDispatcher) SetTextInput

func (d *PlatformDispatcher) SetTextInput(state TextInputState)

SetTextInput gives the input method of the platform the state of the focused text field. Nothing happens when the host has no input method.

Deviation: Flutter sends it as the TextInput.* calls of the flutter/textinput platform channel (SPEC §12.10).

Flutter: services/text_input.dart _PlatformTextInputControl

func (*PlatformDispatcher) SetWindowConstraints

func (d *PlatformDispatcher) SetWindowConstraints(id ViewID, min, max Size)

SetWindowConstraints sets the limits on the content size of the window of the view, in logical pixels; zero means no limit.

Flutter: widgets/_window.dart RegularWindowController.setConstraints

func (*PlatformDispatcher) SetWindowContentType

func (d *PlatformDispatcher) SetWindowContentType(id ViewID, contentType ContentType)

SetWindowContentType tells the compositor what the window of the view shows.

Flutter: no counterpart

func (*PlatformDispatcher) SetWindowHidden

func (d *PlatformDispatcher) SetWindowHidden(id ViewID, hidden bool)

SetWindowHidden takes the window of the view off the screen, or, with false, puts it back with the state it had. A hidden window still exists: the view stays, and the app keeps running.

Flutter: no counterpart

func (*PlatformDispatcher) SetWindowIcon

func (d *PlatformDispatcher) SetWindowIcon(id ViewID, icon WindowIcon) error

SetWindowIcon sets the icon of the window of the view. It fails with WindowIconInvalid when a picture is wrong, and with the platform's error when it cannot use the icon. A host that cannot set icons ignores it.

Flutter: no counterpart

func (*PlatformDispatcher) SetWindowSize

func (d *PlatformDispatcher) SetWindowSize(id ViewID, size Size)

SetWindowSize asks for a new content size of the window of the view, in logical pixels.

Flutter: widgets/_window.dart RegularWindowController.setSize

func (*PlatformDispatcher) SetWindowTitle

func (d *PlatformDispatcher) SetWindowTitle(id ViewID, title string)

SetWindowTitle sets the title of the window of the view.

Flutter: widgets/_window.dart RegularWindowController.setTitle

func (*PlatformDispatcher) SpellCheck

func (d *PlatformDispatcher) SpellCheck(ctx context.Context, locale, text string, done func(spans []SpellCheckSpan, err error))

SpellCheck asks the engine to check the spelling of the text in the locale. done is called later on the UI thread with the misspelled ranges, or with the error: a host without a spell checker fails with SpellCheckUnavailable.

Deviation: Flutter sends it as the SpellCheck.initiateSpellCheck call of the flutter/spellcheck channel (SPEC §12.10).

Flutter: services/spell_check.dart DefaultSpellCheckService.fetchSpellCheckSuggestions

func (*PlatformDispatcher) SpellCheckSupported

func (d *PlatformDispatcher) SpellCheckSupported() bool

SpellCheckSupported reports whether the engine has a spell checker.

Flutter: services/spell_check.dart DefaultSpellCheckService.supportsSpellCheck

func (*PlatformDispatcher) StartBackGesture

func (d *PlatformDispatcher) StartBackGesture(e BackGestureEvent) bool

StartBackGesture is called by the engine when a predictive back gesture starts. It reports whether the framework took it.

Flutter: widgets/binding.dart WidgetsBinding._handleStartBackGesture

func (*PlatformDispatcher) StartDrag

func (d *PlatformDispatcher) StartDrag(view ViewID, request DragRequest) error

StartDrag starts a drag and drop operation from the window of a view. The result comes to OnDragEnd. It fails with DragUnsupported when the host cannot, and with the host's error when the platform refuses.

Flutter: no counterpart

func (*PlatformDispatcher) TextEngine

func (d *PlatformDispatcher) TextEngine() ParagraphFactory

TextEngine is the text engine that lays out paragraphs; it is nil until the engine sets one. The framework gives it to ParagraphBuilder.

Flutter: no counterpart (Dart reaches the engine's font collection globally)

func (*PlatformDispatcher) TextScaleFactor

func (d *PlatformDispatcher) TextScaleFactor() float64

TextScaleFactor is the system text scale; 1 unless the user changed it.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.textScaleFactor

func (*PlatformDispatcher) UIFont

func (d *PlatformDispatcher) UIFont() (family string, size float64)

UIFont is the family and the size, in points, of the desktop's interface font; empty and 0 when the platform does not say.

Flutter: no counterpart

func (*PlatformDispatcher) UnlockPointer

func (d *PlatformDispatcher) UnlockPointer(view ViewID)

UnlockPointer ends the pointer lock of the window of the view.

Flutter: no counterpart

func (*PlatformDispatcher) UpdateBackGestureProgress

func (d *PlatformDispatcher) UpdateBackGestureProgress(e BackGestureEvent)

UpdateBackGestureProgress is called by the engine as a predictive back gesture goes on.

Flutter: widgets/binding.dart WidgetsBinding._handleUpdateBackGestureProgress

func (*PlatformDispatcher) UpdatePlatformConfiguration

func (d *PlatformDispatcher) UpdatePlatformConfiguration(cfg PlatformConfiguration)

UpdatePlatformConfiguration sets the system settings and calls the callbacks of the ones that changed (locales, text scale factor, brightness, accessibility features), then OnPlatformConfigurationChanged. Called by the engine.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher._updateLocales and _updateUserSettingsData

func (*PlatformDispatcher) UpdateViewConfiguration

func (d *PlatformDispatcher) UpdateViewConfiguration(id ViewID, cfg ViewConfiguration)

UpdateViewConfiguration sets the configuration of the view and calls OnMetricsChanged. A view that does not exist is ignored. Called by the engine.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher._updateWindowMetrics

func (*PlatformDispatcher) View

func (d *PlatformDispatcher) View(id ViewID) *View

View returns the view with the ID, or nil if there is none.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.view

func (*PlatformDispatcher) Views

func (d *PlatformDispatcher) Views() []*View

Views are the views that exist, in order of their IDs.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.views

type PlatformHost

type PlatformHost interface {
	// ScheduleFrame asks for OnBeginFrame and OnDrawFrame to be called at the
	// next moment the display wants a frame.
	ScheduleFrame()
	// RenderView draws the scene into the view.
	RenderView(view ViewID, scene *Scene) error
	// RequestAppExit asks the engine to end the app.
	RequestAppExit()
	// Post runs fn on the UI thread, after the work that is running now. It is
	// safe to call from any goroutine.
	Post(fn func())
}

PlatformHost is what the dispatcher asks of the engine. The engine implements it; apps never do.

Flutter: no counterpart (the engine's native side of dart:ui)

type PointMode

type PointMode int

PointMode is how Canvas.DrawPoints joins the points it is given.

Flutter: ui/painting.dart PointMode

const (
	// PointModeUnspecified is the zero value: PointModePoints.
	//
	// Flutter: no counterpart
	PointModeUnspecified PointMode = iota
	// PointModePoints is Flutter's PointMode.points. Draw each point separately.
	// If the paint's stroke cap is round, this draws circles; otherwise it draws
	// squares.
	//
	// Flutter: ui/painting.dart PointMode.points
	PointModePoints
	// PointModeLines is Flutter's PointMode.lines. Draw each sequence of two
	// points as a line segment.
	//
	// Flutter: ui/painting.dart PointMode.lines
	PointModeLines
	// PointModePolygon is Flutter's PointMode.polygon. Draw the entire sequence of
	// points as one line.
	//
	// Flutter: ui/painting.dart PointMode.polygon
	PointModePolygon
)

The values of PointMode follow Flutter's declaration order.

func (PointMode) String

func (e PointMode) String() string

String returns the name Dart prints for the value, such as "PointMode.lines".

type PointerChange

type PointerChange int

PointerChange is how the pointer has changed since the last report. The zero value, PointerChangeUnspecified, is never produced by a platform backend.

Flutter: ui/pointer.dart PointerChange

const (
	// PointerChangeUnspecified is the zero value.
	//
	// Flutter: no counterpart
	PointerChangeUnspecified PointerChange = iota
	// PointerChangeCancel means the input from the pointer is no longer
	// directed towards this receiver.
	//
	// Flutter: ui/pointer.dart PointerChange.cancel
	PointerChangeCancel
	// PointerChangeAdd means the device has started tracking the pointer.
	//
	// Flutter: ui/pointer.dart PointerChange.add
	PointerChangeAdd
	// PointerChangeRemove means the device is no longer tracking the pointer.
	//
	// Flutter: ui/pointer.dart PointerChange.remove
	PointerChangeRemove
	// PointerChangeHover means the pointer moved while it was not in contact
	// with the device.
	//
	// Flutter: ui/pointer.dart PointerChange.hover
	PointerChangeHover
	// PointerChangeDown means the pointer has made contact with the device.
	//
	// Flutter: ui/pointer.dart PointerChange.down
	PointerChangeDown
	// PointerChangeMove means the pointer moved while in contact with the
	// device.
	//
	// Flutter: ui/pointer.dart PointerChange.move
	PointerChangeMove
	// PointerChangeUp means the pointer stopped making contact with the device.
	//
	// Flutter: ui/pointer.dart PointerChange.up
	PointerChangeUp
	// PointerChangePanZoomStart means a pan/zoom gesture started on a
	// trackpad.
	//
	// Flutter: ui/pointer.dart PointerChange.panZoomStart
	PointerChangePanZoomStart
	// PointerChangePanZoomUpdate means a pan/zoom gesture on a trackpad
	// changed.
	//
	// Flutter: ui/pointer.dart PointerChange.panZoomUpdate
	PointerChangePanZoomUpdate
	// PointerChangePanZoomEnd means a pan/zoom gesture on a trackpad ended.
	//
	// Flutter: ui/pointer.dart PointerChange.panZoomEnd
	PointerChangePanZoomEnd
)

The values of PointerChange follow Flutter's declaration order.

func (PointerChange) String

func (c PointerChange) String() string

String returns the name of the change, such as "PointerChangeDown".

Flutter: ui/pointer.dart PointerChange

type PointerData

type PointerData struct {
	// ViewID is the ID of the view this event is for.
	ViewID ViewID
	// EmbedderID is the ID of the pointer event as assigned by the embedder.
	EmbedderID int
	// TimeStamp is the time at which this event happened, since an arbitrary
	// fixed point in the past.
	TimeStamp time.Duration
	// Change is how the pointer has changed since the last report.
	Change PointerChange
	// Kind is the kind of input device for which the event was generated.
	Kind PointerDeviceKind
	// SignalKind is the kind of signal, or PointerSignalKindUnspecified when
	// the data is not a signal.
	SignalKind PointerSignalKind
	// Device is the unique identifier of the device.
	Device int
	// PointerIdentifier identifies the pointer within its device while it is
	// in contact.
	PointerIdentifier int
	// PhysicalX is the x coordinate of the pointer, in physical pixels.
	PhysicalX float64
	// PhysicalY is the y coordinate of the pointer, in physical pixels.
	PhysicalY float64
	// PhysicalDeltaX is the distance in physical pixels that the pointer moved
	// along x since the last report.
	PhysicalDeltaX float64
	// PhysicalDeltaY is the distance in physical pixels that the pointer moved
	// along y since the last report.
	PhysicalDeltaY float64
	// Buttons is a bit field of the buttons that are currently pressed.
	Buttons int
	// Obscured is whether the input is obscured by another window.
	Obscured bool
	// Synthesized is whether the event was created by the engine to keep the
	// state consistent, rather than by a device.
	Synthesized bool
	// Pressure is the pressure of the touch, normalized by the range between
	// PressureMin and PressureMax.
	Pressure float64
	// PressureMin is the minimum value that Pressure can return.
	PressureMin float64
	// PressureMax is the maximum value that Pressure can return.
	PressureMax float64
	// Distance is the distance of the detected object from the input surface.
	Distance float64
	// DistanceMax is the maximum value that Distance can return.
	DistanceMax float64
	// Size is the area of the screen being pressed, scaled to a value between
	// 0 and 1.
	Size float64
	// RadiusMajor is the radius of the contact ellipse along the major axis,
	// in logical pixels.
	RadiusMajor float64
	// RadiusMinor is the radius of the contact ellipse along the minor axis,
	// in logical pixels.
	RadiusMinor float64
	// RadiusMin is the minimum value that RadiusMajor and RadiusMinor can
	// return.
	RadiusMin float64
	// RadiusMax is the maximum value that RadiusMajor and RadiusMinor can
	// return.
	RadiusMax float64
	// Orientation is the orientation angle of the detected object, in radians.
	Orientation float64
	// Tilt is the tilt angle of the detected object, in radians.
	Tilt float64
	// PlatformData is opaque platform-specific data associated with the event.
	PlatformData int
	// ScrollDeltaX is the amount to scroll in the x direction, in physical
	// pixels. Only set for scroll signals.
	ScrollDeltaX float64
	// ScrollDeltaY is the amount to scroll in the y direction, in physical
	// pixels. Only set for scroll signals.
	ScrollDeltaY float64
	// PanX is the total horizontal translation of a pan/zoom gesture.
	PanX float64
	// PanY is the total vertical translation of a pan/zoom gesture.
	PanY float64
	// PanDeltaX is the horizontal translation since the last pan/zoom report.
	PanDeltaX float64
	// PanDeltaY is the vertical translation since the last pan/zoom report.
	PanDeltaY float64
	// Scale is the scale of a pan/zoom gesture, 1 meaning no scaling.
	Scale float64
	// Rotation is the rotation of a pan/zoom gesture, in radians.
	Rotation float64
	// OnRespond, when not nil, lets the framework answer the event that
	// produced this data. See Respond.
	OnRespond func(allowPlatformDefault bool)
}

PointerData is information about the state of a pointer. All positions and deltas are in physical pixels of the view.

Flutter's defaults are the zero values, except that Change defaults to cancel and Kind to touch; platform backends always set both explicitly.

Flutter: ui/pointer.dart PointerData

func (PointerData) Respond

func (d PointerData) Respond(allowPlatformDefault bool)

Respond tells the platform whether it may run its default behavior for the event that produced this data (for example, scrolling the page on the web). It does nothing when OnRespond is nil.

Flutter: ui/pointer.dart PointerData.respond

func (PointerData) String

func (d PointerData) String() string

String returns a short description of the data.

Flutter: ui/pointer.dart PointerData.toString

type PointerDataPacket

type PointerDataPacket struct {
	// Data is the pointer reports in this packet, in order.
	Data []PointerData
}

PointerDataPacket is a sequence of reports about the state of pointers.

Flutter: ui/pointer.dart PointerDataPacket

type PointerDeviceKind

type PointerDeviceKind int

PointerDeviceKind is the kind of pointer device. The zero value, PointerDeviceKindUnspecified, is never produced by a platform backend.

Flutter: ui/pointer.dart PointerDeviceKind

const (
	// PointerDeviceKindUnspecified is the zero value.
	//
	// Flutter: no counterpart
	PointerDeviceKindUnspecified PointerDeviceKind = iota
	// PointerDeviceKindTouch is a touch screen contact.
	//
	// Flutter: ui/pointer.dart PointerDeviceKind.touch
	PointerDeviceKindTouch
	// PointerDeviceKindMouse is a mouse.
	//
	// Flutter: ui/pointer.dart PointerDeviceKind.mouse
	PointerDeviceKindMouse
	// PointerDeviceKindStylus is a stylus.
	//
	// Flutter: ui/pointer.dart PointerDeviceKind.stylus
	PointerDeviceKindStylus
	// PointerDeviceKindInvertedStylus is the eraser end of a stylus.
	//
	// Flutter: ui/pointer.dart PointerDeviceKind.invertedStylus
	PointerDeviceKindInvertedStylus
	// PointerDeviceKindTrackpad is a trackpad.
	//
	// Flutter: ui/pointer.dart PointerDeviceKind.trackpad
	PointerDeviceKindTrackpad
	// PointerDeviceKindUnknown is a device of an unknown kind.
	//
	// Flutter: ui/pointer.dart PointerDeviceKind.unknown
	PointerDeviceKindUnknown
)

The values of PointerDeviceKind follow Flutter's declaration order.

func (PointerDeviceKind) Name

func (k PointerDeviceKind) Name() string

Name returns the Dart name of the kind, such as "mouse". It is what Flutter's EnumProperty prints. The zero value is named "touch", which is what the framework treats it as.

Flutter: ui/pointer.dart PointerDeviceKind

func (PointerDeviceKind) String

func (k PointerDeviceKind) String() string

String returns the name of the kind, such as "PointerDeviceKindMouse".

Flutter: ui/pointer.dart PointerDeviceKind

type PointerLockHost

type PointerLockHost interface {
	// LockPointer locks the pointer to the window of the view: the cursor is hidden, and the mouse's pointer events
	// keep their position and carry the motion in PhysicalDeltaX and PhysicalDeltaY. It fails with
	// PointerLockUnavailable and PointerLockDenied. The lock ends through PlatformDispatcher.PointerLockEnded.
	LockPointer(view ViewID) error
	// UnlockPointer ends the lock of the view's window. Nothing happens when it is not locked.
	UnlockPointer(view ViewID)
}

PointerLockHost is what the engine implements to lock the pointer to a window (SPEC §27.6). A host without it cannot.

Flutter: no counterpart

type PointerSignalKind

type PointerSignalKind int

PointerSignalKind is the kind of pointer signal event. The zero value, PointerSignalKindUnspecified, is Flutter's null signalKind: the data is not a signal.

Flutter: ui/pointer.dart PointerSignalKind

const (
	// PointerSignalKindUnspecified is the zero value. It stands for the null
	// signalKind of PointerData.
	//
	// Flutter: ui/pointer.dart PointerData.signalKind (null)
	PointerSignalKindUnspecified PointerSignalKind = iota
	// PointerSignalKindNone is the type of a pointer signal event that is not
	// a signal.
	//
	// Flutter: ui/pointer.dart PointerSignalKind.none
	PointerSignalKindNone
	// PointerSignalKindScroll is a scroll signal.
	//
	// Flutter: ui/pointer.dart PointerSignalKind.scroll
	PointerSignalKindScroll
	// PointerSignalKindScrollInertiaCancel is a signal that cancels a scroll
	// that was still moving by inertia.
	//
	// Flutter: ui/pointer.dart PointerSignalKind.scrollInertiaCancel
	PointerSignalKindScrollInertiaCancel
	// PointerSignalKindScale is a scale signal.
	//
	// Flutter: ui/pointer.dart PointerSignalKind.scale
	PointerSignalKindScale
	// PointerSignalKindUnknown is a signal of an unknown kind.
	//
	// Flutter: ui/pointer.dart PointerSignalKind.unknown
	PointerSignalKindUnknown
)

The values of PointerSignalKind follow Flutter's declaration order.

func (PointerSignalKind) String

func (k PointerSignalKind) String() string

String returns the name of the kind, such as "PointerSignalKindScroll".

Flutter: ui/pointer.dart PointerSignalKind

type PortalHost

type PortalHost interface {
	// PortalParentHandle asks for the string that a portal wants as its parent
	// window: "wayland:<handle>" (zxdg_exporter_v2) or "x11:<window id in hex>".
	// done is called on the UI thread, with an empty string when the window has no
	// handle (the compositor cannot export it).
	PortalParentHandle(view ViewID, done func(handle string))
	// ActivationToken asks for a token that lets an app that this app starts take
	// the focus (XDG_ACTIVATION_TOKEN, and the activation_token of the portals). done
	// is called on the UI thread, with an empty string when there is none.
	ActivationToken(view ViewID, done func(token string))
	// AppID is the application ID of the app: the Wayland app_id and the X11
	// WM_CLASS, which must match its .desktop file. Notifications and the tray use
	// it to name the app to the desktop. It may be empty.
	AppID() string
}

PortalHost is what the engine implements for the services of the desktop that take a window as their parent (the portals of xdg-desktop-portal): the handle of the window and the activation token of the app. A host without it gives none.

Flutter: no counterpart

type PushBackdropFilterOpts

type PushBackdropFilterOpts struct {
	// BlendMode is how the filtered backdrop combines with what is there; the
	// zero value is BlendModeSrcOver, Flutter's default.
	BlendMode BlendMode
	// BackdropID, when not nil, names a backdrop that several filters share.
	BackdropID *int
	// OldLayer is the layer of the previous frame this one replaces.
	OldLayer *BackdropFilterEngineLayer
}

PushBackdropFilterOpts are the optional arguments of PushBackdropFilter.

Flutter: ui/compositing.dart SceneBuilder.pushBackdropFilter

type PushClipPathOpts

type PushClipPathOpts struct {
	// ClipBehavior says how the edge is clipped; the zero value is
	// ClipAntiAlias, Flutter's default.
	ClipBehavior Clip
	// OldLayer is the layer of the previous frame this one replaces.
	OldLayer *ClipPathEngineLayer
}

PushClipPathOpts are the optional arguments of PushClipPath.

Flutter: ui/compositing.dart SceneBuilder.pushClipPath

type PushClipRRectOpts

type PushClipRRectOpts struct {
	// ClipBehavior says how the edge is clipped; the zero value is
	// ClipAntiAlias, Flutter's default.
	ClipBehavior Clip
	// OldLayer is the layer of the previous frame this one replaces.
	OldLayer *ClipRRectEngineLayer
}

PushClipRRectOpts are the optional arguments of PushClipRRect.

Flutter: ui/compositing.dart SceneBuilder.pushClipRRect

type PushClipRSuperellipseOpts

type PushClipRSuperellipseOpts struct {
	// ClipBehavior says how the edge is clipped; the zero value is
	// ClipAntiAlias, Flutter's default.
	ClipBehavior Clip
	// OldLayer is the layer of the previous frame this one replaces.
	OldLayer *ClipRSuperellipseEngineLayer
}

PushClipRSuperellipseOpts are the optional arguments of PushClipRSuperellipse.

Flutter: ui/compositing.dart SceneBuilder.pushClipRSuperellipse

type PushClipRectOpts

type PushClipRectOpts struct {
	// ClipBehavior says how the edge is clipped; the zero value is
	// ClipAntiAlias, Flutter's default.
	ClipBehavior Clip
	// OldLayer is the layer of the previous frame this one replaces.
	OldLayer *ClipRectEngineLayer
}

PushClipRectOpts are the optional arguments of PushClipRect.

Flutter: ui/compositing.dart SceneBuilder.pushClipRect

type PushColorFilterOpts

type PushColorFilterOpts struct {
	// OldLayer is the layer of the previous frame this one replaces.
	OldLayer *ColorFilterEngineLayer
}

PushColorFilterOpts are the optional arguments of PushColorFilter.

Flutter: ui/compositing.dart SceneBuilder.pushColorFilter

type PushImageFilterOpts

type PushImageFilterOpts struct {
	// Offset moves the children before the filter is applied.
	Offset Offset
	// OldLayer is the layer of the previous frame this one replaces.
	OldLayer *ImageFilterEngineLayer
}

PushImageFilterOpts are the optional arguments of PushImageFilter.

Flutter: ui/compositing.dart SceneBuilder.pushImageFilter

type PushOffsetOpts

type PushOffsetOpts struct {
	// OldLayer is the layer of the previous frame this one replaces.
	OldLayer *OffsetEngineLayer
}

PushOffsetOpts are the optional arguments of PushOffset.

Flutter: ui/compositing.dart SceneBuilder.pushOffset

type PushOpacityOpts

type PushOpacityOpts struct {
	// Offset moves the children before the alpha is applied.
	Offset Offset
	// OldLayer is the layer of the previous frame this one replaces.
	OldLayer *OpacityEngineLayer
}

PushOpacityOpts are the optional arguments of PushOpacity.

Flutter: ui/compositing.dart SceneBuilder.pushOpacity

type PushShaderMaskOpts

type PushShaderMaskOpts struct {
	// FilterQuality is the quality of sampling an image shader; the zero value is
	// FilterQualityLow, Flutter's default.
	FilterQuality FilterQuality
	// OldLayer is the layer of the previous frame this one replaces.
	OldLayer *ShaderMaskEngineLayer
}

PushShaderMaskOpts are the optional arguments of PushShaderMask.

Flutter: ui/compositing.dart SceneBuilder.pushShaderMask

type PushTransformOpts

type PushTransformOpts struct {
	// OldLayer is the layer of the previous frame this one replaces.
	OldLayer *TransformEngineLayer
}

PushTransformOpts are the optional arguments of PushTransform.

Flutter: ui/compositing.dart SceneBuilder.pushTransform

type Quad

type Quad struct {
	// Point0 is the first corner.
	Point0 Vector3
	// Point1 is the second corner.
	Point1 Vector3
	// Point2 is the third corner.
	Point2 Vector3
	// Point3 is the fourth corner.
	Point3 Vector3
}

Quad is a quadrilateral of four points, in order around its edge.

Flutter: package:vector_math Quad

func NewQuadPoints

func NewQuadPoints(point0, point1, point2, point3 Vector3) Quad

NewQuadPoints creates the quad with the four corners.

Flutter: package:vector_math Quad.points

type Quaternion

type Quaternion struct {
	// X is the first imaginary component.
	X float64
	// Y is the second imaginary component.
	Y float64
	// Z is the third imaginary component.
	Z float64
	// W is the real component.
	W float64
}

Quaternion is a rotation as a quaternion with float64 components.

Flutter: package:vector_math Quaternion

func NewQuaternionFromRotation

func NewQuaternionFromRotation(m [9]float64) Quaternion

NewQuaternionFromRotation returns the quaternion of the 3x3 rotation matrix, which is given in column-major order (the entry of row r and column c is m[c*3+r]).

Flutter: package:vector_math Quaternion.setFromRotation

func NewQuaternionIdentity

func NewQuaternionIdentity() Quaternion

NewQuaternionIdentity returns the quaternion that does not rotate.

Flutter: package:vector_math Quaternion.identity

func (Quaternion) Add

func (q Quaternion) Add(o Quaternion) Quaternion

Add returns the sum of the components of the two quaternions.

Flutter: package:vector_math Quaternion.+

func (Quaternion) Length

func (q Quaternion) Length() float64

Length is the length of the quaternion as a four dimensional vector.

Flutter: package:vector_math Quaternion.length

func (Quaternion) Normalized

func (q Quaternion) Normalized() Quaternion

Normalized returns the quaternion scaled to length 1; a quaternion of length 0 is returned as it is.

Flutter: package:vector_math Quaternion.normalized

func (Quaternion) Scaled

func (q Quaternion) Scaled(scale float64) Quaternion

Scaled returns the quaternion with every component multiplied by scale.

Flutter: package:vector_math Quaternion.scaled

type RRect

type RRect rrectLike

RRect is an immutable rectangle with elliptical rounded corners.

Its fields are the rectangle's edges and the radius of each corner on each axis.

Flutter: ui/geometry.dart RRect

func NewRRectFromLTRBAndCorners

func NewRRectFromLTRBAndCorners(left, top, right, bottom float64, corners ...Corners) RRect

NewRRectFromLTRBAndCorners constructs a RRect from the left, top, right and bottom edges and a radius for each corner. Passing more than one Corners panics.

Flutter: ui/geometry.dart RRect.fromLTRBAndCorners

func NewRRectFromLTRBR

func NewRRectFromLTRBR(left, top, right, bottom float64, radius Radius) RRect

NewRRectFromLTRBR constructs a RRect from the left, top, right and bottom edges and the same radius for all four corners.

Flutter: ui/geometry.dart RRect.fromLTRBR

func NewRRectFromLTRBXY

func NewRRectFromLTRBXY(left, top, right, bottom, radiusX, radiusY float64) RRect

NewRRectFromLTRBXY constructs a RRect from the left, top, right and bottom edges and the same x and y radius for all four corners.

Flutter: ui/geometry.dart RRect.fromLTRBXY

func NewRRectFromRectAndCorners

func NewRRectFromRectAndCorners(rect Rect, corners ...Corners) RRect

NewRRectFromRectAndCorners constructs a RRect from a rectangle and a radius for each corner. Passing more than one Corners panics.

Flutter: ui/geometry.dart RRect.fromRectAndCorners

func NewRRectFromRectAndRadius

func NewRRectFromRectAndRadius(rect Rect, radius Radius) RRect

NewRRectFromRectAndRadius constructs a RRect from a rectangle and the same radius for all four corners.

Flutter: ui/geometry.dart RRect.fromRectAndRadius

func NewRRectFromRectXY

func NewRRectFromRectXY(rect Rect, radiusX, radiusY float64) RRect

NewRRectFromRectXY constructs a RRect from a rectangle and the same x and y radius for all four corners.

Flutter: ui/geometry.dart RRect.fromRectXY

func RRectLerp

func RRectLerp(a, b *RRect, t float64) *RRect

RRectLerp linearly interpolates between two shapes, either of which may be nil. A nil shape counts as an empty one at the origin, and two nils give nil.

Flutter: ui/geometry.dart RRect.lerp

func (RRect) BlRadius

func (r RRect) BlRadius() Radius

BlRadius is the bottom left corner's radius.

Flutter: ui/geometry.dart _RRectLike.blRadius

func (RRect) BrRadius

func (r RRect) BrRadius() Radius

BrRadius is the bottom right corner's radius.

Flutter: ui/geometry.dart _RRectLike.brRadius

func (RRect) Center

func (r RRect) Center() Offset

Center is the offset to the point halfway between the left and right and the top and bottom edges.

Flutter: ui/geometry.dart _RRectLike.center

func (RRect) Contains

func (r RRect) Contains(point Offset) bool

Contains reports whether the point is inside the rounded rectangle. The left and top edges are inside, the right and bottom edges are not. The radii are scaled down first when they do not fit (see ScaleRadii).

Flutter: ui/geometry.dart RRect.contains

func (RRect) Deflate

func (r RRect) Deflate(delta float64) RRect

Deflate returns a new RRect with edges and radii moved inwards by the given delta.

Flutter: ui/geometry.dart _RRectLike.deflate

func (RRect) HasNaN

func (r RRect) HasNaN() bool

HasNaN reports whether any of the edges or radii is NaN.

Flutter: ui/geometry.dart _RRectLike.hasNaN

func (RRect) Height

func (r RRect) Height() float64

Height is the distance between the top and bottom edges.

Flutter: ui/geometry.dart _RRectLike.height

func (RRect) Inflate

func (r RRect) Inflate(delta float64) RRect

Inflate returns a new RRect with edges and radii moved outwards by the given delta.

Flutter: ui/geometry.dart _RRectLike.inflate

func (RRect) IsCircle

func (r RRect) IsCircle() bool

IsCircle reports whether the RRect has the shape of a circle.

Flutter: ui/geometry.dart _RRectLike.isCircle

func (RRect) IsEllipse

func (r RRect) IsEllipse() bool

IsEllipse reports whether the RRect has the shape of an ellipse.

Flutter: ui/geometry.dart _RRectLike.isEllipse

func (RRect) IsEmpty

func (r RRect) IsEmpty() bool

IsEmpty reports whether the RRect encloses no area.

Flutter: ui/geometry.dart _RRectLike.isEmpty

func (RRect) IsFinite

func (r RRect) IsFinite() bool

IsFinite reports whether the four edges are finite.

Flutter: ui/geometry.dart _RRectLike.isFinite

func (RRect) IsRect

func (r RRect) IsRect() bool

IsRect reports whether the RRect is a simple rectangle with no rounded corner.

Flutter: ui/geometry.dart _RRectLike.isRect

func (RRect) IsStadium

func (r RRect) IsStadium() bool

IsStadium reports whether the RRect has the shape of a stadium (two semicircles connected by a rectangle).

Flutter: ui/geometry.dart _RRectLike.isStadium

func (RRect) Lerp

func (r RRect) Lerp(b RRect, t float64) RRect

Lerp linearly interpolates between r and b: r when t is 0, b when t is 1.

Flutter: ui/geometry.dart RRect.lerp

func (RRect) LongestSide

func (r RRect) LongestSide() float64

LongestSide is the greater of the magnitudes of the width and the height.

Flutter: ui/geometry.dart _RRectLike.longestSide

func (RRect) MiddleRect

func (r RRect) MiddleRect() Rect

MiddleRect is the rectangle that remains after the corner radii are taken off all four sides.

Flutter: ui/geometry.dart _RRectLike.middleRect

func (RRect) OuterRect

func (r RRect) OuterRect() Rect

OuterRect is the outer rectangle: the bounding box of the RRect.

Flutter: ui/geometry.dart _RRectLike.outerRect

func (RRect) SafeInnerRect

func (r RRect) SafeInnerRect() Rect

SafeInnerRect is the biggest rectangle that is entirely inside the RRect and has the same center, found with a safe inset at each corner.

Flutter: ui/geometry.dart _RRectLike.safeInnerRect

func (RRect) ScaleRadii

func (r RRect) ScaleRadii() RRect

ScaleRadii scales all radii so that on each side their sum will not exceed the size of the width or height.

Flutter: ui/geometry.dart _RRectLike.scaleRadii

func (RRect) Shift

func (r RRect) Shift(offset Offset) RRect

Shift returns a new RRect translated by the given offset.

Flutter: ui/geometry.dart _RRectLike.shift

func (RRect) ShortestSide

func (r RRect) ShortestSide() float64

ShortestSide is the lesser of the magnitudes of the width and the height.

Flutter: ui/geometry.dart _RRectLike.shortestSide

func (RRect) String

func (r RRect) String() string

String describes the RRect, as Dart's toString does.

Flutter: ui/geometry.dart RRect.toString

func (RRect) TallMiddleRect

func (r RRect) TallMiddleRect() Rect

TallMiddleRect is the full-height rectangle between the left and right corner radii.

Flutter: ui/geometry.dart _RRectLike.tallMiddleRect

func (RRect) TlRadius

func (r RRect) TlRadius() Radius

TlRadius is the top left corner's radius.

Flutter: ui/geometry.dart _RRectLike.tlRadius

func (RRect) TrRadius

func (r RRect) TrRadius() Radius

TrRadius is the top right corner's radius.

Flutter: ui/geometry.dart _RRectLike.trRadius

func (RRect) WideMiddleRect

func (r RRect) WideMiddleRect() Rect

WideMiddleRect is the full-width rectangle between the top and bottom corner radii.

Flutter: ui/geometry.dart _RRectLike.wideMiddleRect

func (RRect) Width

func (r RRect) Width() float64

Width is the distance between the left and right edges.

Flutter: ui/geometry.dart _RRectLike.width

type RSTransform

type RSTransform struct {
	// Scos is the cosine of the rotation, multiplied by the scale.
	Scos float32
	// Ssin is the sine of the rotation, multiplied by the scale.
	Ssin float32
	// Tx is the horizontal translation.
	Tx float32
	// Ty is the vertical translation.
	Ty float32
}

RSTransform is a rotation, uniform scale and translation in the form the atlas drawing calls take, modeled after Impeller's RSTransform: the matrix

[ scos -ssin  tx ]
[ ssin  scos  ty ]
[    0     0   1 ]

Flutter: ui/geometry.dart RSTransform

func NewRSTransform

func NewRSTransform(scos, ssin, tx, ty float32) RSTransform

NewRSTransform creates an RSTransform from the matrix entries.

Flutter: ui/geometry.dart RSTransform

func NewRSTransformFromComponents

func NewRSTransformFromComponents(rotation, scale, anchorX, anchorY, translateX, translateY float64) RSTransform

NewRSTransformFromComponents creates an RSTransform from a rotation in radians, a uniform scale, the anchor point of the source rectangle that stays fixed, and the point it moves to.

Flutter: ui/geometry.dart RSTransform.fromComponents

type RSuperellipse

type RSuperellipse rrectLike

RSuperellipse is an immutable rectangle with rounded superellipse corners: the continuous corners of iOS, which curve more gradually than circular ones.

Its fields are the rectangle's edges and the radius of each corner on each axis.

Flutter: ui/geometry.dart RSuperellipse

func NewRSuperellipseFromLTRBAndCorners

func NewRSuperellipseFromLTRBAndCorners(left, top, right, bottom float64, corners ...Corners) RSuperellipse

NewRSuperellipseFromLTRBAndCorners constructs a RSuperellipse from the left, top, right and bottom edges and a radius for each corner. Passing more than one Corners panics.

Flutter: ui/geometry.dart RSuperellipse.fromLTRBAndCorners

func NewRSuperellipseFromLTRBR

func NewRSuperellipseFromLTRBR(left, top, right, bottom float64, radius Radius) RSuperellipse

NewRSuperellipseFromLTRBR constructs a RSuperellipse from the left, top, right and bottom edges and the same radius for all four corners.

Flutter: ui/geometry.dart RSuperellipse.fromLTRBR

func NewRSuperellipseFromLTRBXY

func NewRSuperellipseFromLTRBXY(left, top, right, bottom, radiusX, radiusY float64) RSuperellipse

NewRSuperellipseFromLTRBXY constructs a RSuperellipse from the left, top, right and bottom edges and the same x and y radius for all four corners.

Flutter: ui/geometry.dart RSuperellipse.fromLTRBXY

func NewRSuperellipseFromRectAndCorners

func NewRSuperellipseFromRectAndCorners(rect Rect, corners ...Corners) RSuperellipse

NewRSuperellipseFromRectAndCorners constructs a RSuperellipse from a rectangle and a radius for each corner. Passing more than one Corners panics.

Flutter: ui/geometry.dart RSuperellipse.fromRectAndCorners

func NewRSuperellipseFromRectAndRadius

func NewRSuperellipseFromRectAndRadius(rect Rect, radius Radius) RSuperellipse

NewRSuperellipseFromRectAndRadius constructs a RSuperellipse from a rectangle and the same radius for all four corners.

Flutter: ui/geometry.dart RSuperellipse.fromRectAndRadius

func NewRSuperellipseFromRectXY

func NewRSuperellipseFromRectXY(rect Rect, radiusX, radiusY float64) RSuperellipse

NewRSuperellipseFromRectXY constructs a RSuperellipse from a rectangle and the same x and y radius for all four corners.

Flutter: ui/geometry.dart RSuperellipse.fromRectXY

func RSuperellipseLerp

func RSuperellipseLerp(a, b *RSuperellipse, t float64) *RSuperellipse

RSuperellipseLerp linearly interpolates between two shapes, either of which may be nil. A nil shape counts as an empty one at the origin, and two nils give nil.

Flutter: ui/geometry.dart RSuperellipse.lerp

func (RSuperellipse) BlRadius

func (r RSuperellipse) BlRadius() Radius

BlRadius is the bottom left corner's radius.

Flutter: ui/geometry.dart _RRectLike.blRadius

func (RSuperellipse) BrRadius

func (r RSuperellipse) BrRadius() Radius

BrRadius is the bottom right corner's radius.

Flutter: ui/geometry.dart _RRectLike.brRadius

func (RSuperellipse) Center

func (r RSuperellipse) Center() Offset

Center is the offset to the point halfway between the left and right and the top and bottom edges.

Flutter: ui/geometry.dart _RRectLike.center

func (RSuperellipse) Contains

func (r RSuperellipse) Contains(point Offset) bool

Contains reports whether the point is inside the shape. The left and top edges are inside, the right and bottom edges are not.

Deviation: Flutter asks Impeller's RoundSuperellipse (impeller/geometry), which is not in reference/. This approximates its corners with the superellipse of exponent 5 in a box 1.2924 times the radius, so a point near a corner can be classified differently by a few thousandths of the radius. SPEC §12.10 lists it.

Flutter: ui/geometry.dart RSuperellipse.contains

func (RSuperellipse) Deflate

func (r RSuperellipse) Deflate(delta float64) RSuperellipse

Deflate returns a new RSuperellipse with edges and radii moved inwards by the given delta.

Flutter: ui/geometry.dart _RRectLike.deflate

func (RSuperellipse) HasNaN

func (r RSuperellipse) HasNaN() bool

HasNaN reports whether any of the edges or radii is NaN.

Flutter: ui/geometry.dart _RRectLike.hasNaN

func (RSuperellipse) Height

func (r RSuperellipse) Height() float64

Height is the distance between the top and bottom edges.

Flutter: ui/geometry.dart _RRectLike.height

func (RSuperellipse) Inflate

func (r RSuperellipse) Inflate(delta float64) RSuperellipse

Inflate returns a new RSuperellipse with edges and radii moved outwards by the given delta.

Flutter: ui/geometry.dart _RRectLike.inflate

func (RSuperellipse) IsCircle

func (r RSuperellipse) IsCircle() bool

IsCircle reports whether the RSuperellipse has the shape of a circle.

Flutter: ui/geometry.dart _RRectLike.isCircle

func (RSuperellipse) IsEllipse

func (r RSuperellipse) IsEllipse() bool

IsEllipse reports whether the RSuperellipse has the shape of an ellipse.

Flutter: ui/geometry.dart _RRectLike.isEllipse

func (RSuperellipse) IsEmpty

func (r RSuperellipse) IsEmpty() bool

IsEmpty reports whether the RSuperellipse encloses no area.

Flutter: ui/geometry.dart _RRectLike.isEmpty

func (RSuperellipse) IsFinite

func (r RSuperellipse) IsFinite() bool

IsFinite reports whether the four edges are finite.

Flutter: ui/geometry.dart _RRectLike.isFinite

func (RSuperellipse) IsRect

func (r RSuperellipse) IsRect() bool

IsRect reports whether the RSuperellipse is a simple rectangle with no rounded corner.

Flutter: ui/geometry.dart _RRectLike.isRect

func (RSuperellipse) IsStadium

func (r RSuperellipse) IsStadium() bool

IsStadium reports whether the RSuperellipse has the shape of a stadium (two semicircles connected by a rectangle).

Flutter: ui/geometry.dart _RRectLike.isStadium

func (RSuperellipse) Lerp

Lerp linearly interpolates between r and b: r when t is 0, b when t is 1.

Flutter: ui/geometry.dart RSuperellipse.lerp

func (RSuperellipse) LongestSide

func (r RSuperellipse) LongestSide() float64

LongestSide is the greater of the magnitudes of the width and the height.

Flutter: ui/geometry.dart _RRectLike.longestSide

func (RSuperellipse) MiddleRect

func (r RSuperellipse) MiddleRect() Rect

MiddleRect is the rectangle that remains after the corner radii are taken off all four sides.

Flutter: ui/geometry.dart _RRectLike.middleRect

func (RSuperellipse) OuterRect

func (r RSuperellipse) OuterRect() Rect

OuterRect is the outer rectangle: the bounding box of the RSuperellipse.

Flutter: ui/geometry.dart _RRectLike.outerRect

func (RSuperellipse) SafeInnerRect

func (r RSuperellipse) SafeInnerRect() Rect

SafeInnerRect is the biggest rectangle that is entirely inside the RSuperellipse and has the same center, found with a safe inset at each corner.

Flutter: ui/geometry.dart _RRectLike.safeInnerRect

func (RSuperellipse) ScaleRadii

func (r RSuperellipse) ScaleRadii() RSuperellipse

ScaleRadii scales all radii so that on each side their sum will not exceed the size of the width or height.

Flutter: ui/geometry.dart _RRectLike.scaleRadii

func (RSuperellipse) Shift

func (r RSuperellipse) Shift(offset Offset) RSuperellipse

Shift returns a new RSuperellipse translated by the given offset.

Flutter: ui/geometry.dart _RRectLike.shift

func (RSuperellipse) ShortestSide

func (r RSuperellipse) ShortestSide() float64

ShortestSide is the lesser of the magnitudes of the width and the height.

Flutter: ui/geometry.dart _RRectLike.shortestSide

func (RSuperellipse) String

func (r RSuperellipse) String() string

String describes the RSuperellipse, as Dart's toString does.

Flutter: ui/geometry.dart RSuperellipse.toString

func (RSuperellipse) TallMiddleRect

func (r RSuperellipse) TallMiddleRect() Rect

TallMiddleRect is the full-height rectangle between the left and right corner radii.

Flutter: ui/geometry.dart _RRectLike.tallMiddleRect

func (RSuperellipse) TlRadius

func (r RSuperellipse) TlRadius() Radius

TlRadius is the top left corner's radius.

Flutter: ui/geometry.dart _RRectLike.tlRadius

func (RSuperellipse) TrRadius

func (r RSuperellipse) TrRadius() Radius

TrRadius is the top right corner's radius.

Flutter: ui/geometry.dart _RRectLike.trRadius

func (RSuperellipse) WideMiddleRect

func (r RSuperellipse) WideMiddleRect() Rect

WideMiddleRect is the full-width rectangle between the top and bottom corner radii.

Flutter: ui/geometry.dart _RRectLike.wideMiddleRect

func (RSuperellipse) Width

func (r RSuperellipse) Width() float64

Width is the distance between the left and right edges.

Flutter: ui/geometry.dart _RRectLike.width

type Radius

type Radius struct {
	// X is the radius value on the horizontal axis.
	X float64
	// Y is the radius value on the vertical axis.
	Y float64
}

Radius is a radius of a circle or ellipse.

Flutter: ui/geometry.dart Radius

func NewRadiusCircular

func NewRadiusCircular(radius float64) Radius

NewRadiusCircular constructs a circular radius: X and Y are both radius.

Flutter: ui/geometry.dart Radius.circular

func NewRadiusElliptical

func NewRadiusElliptical(x, y float64) Radius

NewRadiusElliptical constructs an elliptical radius with the given radii on the horizontal and vertical axes.

Flutter: ui/geometry.dart Radius.elliptical

func RadiusLerp

func RadiusLerp(a, b *Radius, t float64) *Radius

RadiusLerp linearly interpolates between two radii, either of which may be nil. A nil radius counts as zero, and two nils give nil.

Flutter: ui/geometry.dart Radius.lerp

func (Radius) Add

func (r Radius) Add(other Radius) Radius

Add returns the sum of two radii (Dart's +).

Flutter: ui/geometry.dart Radius.operator +

func (Radius) Clamp

func (r Radius) Clamp(opts ...RadiusClampOpts) Radius

Clamp returns this radius with each axis limited to the bounds. Passing more than one options value panics.

Flutter: ui/geometry.dart Radius.clamp

func (Radius) ClampValues

func (r Radius) ClampValues(opts ...RadiusClampValuesOpts) Radius

ClampValues returns this radius with each axis limited to its bounds. Passing more than one options value panics.

Flutter: ui/geometry.dart Radius.clampValues

func (Radius) Div

func (r Radius) Div(operand float64) Radius

Div divides both axes by operand (Dart's /).

Flutter: ui/geometry.dart Radius.operator /

func (Radius) Lerp

func (r Radius) Lerp(b Radius, t float64) Radius

Lerp linearly interpolates between r and b: r when t is 0, b when t is 1.

Flutter: ui/geometry.dart Radius.lerp

func (Radius) Mod

func (r Radius) Mod(operand float64) Radius

Mod returns the remainder of dividing both axes by operand, made non-negative as Dart does (Dart's %).

Flutter: ui/geometry.dart Radius.operator %

func (Radius) Mul

func (r Radius) Mul(operand float64) Radius

Mul multiplies both axes by operand (Dart's *).

Flutter: ui/geometry.dart Radius.operator *

func (Radius) Neg

func (r Radius) Neg() Radius

Neg returns the radius with both axes negated (Dart's unary -).

Flutter: ui/geometry.dart Radius.operator -

func (Radius) String

func (r Radius) String() string

String describes the radius, as Dart's toString does.

Flutter: ui/geometry.dart Radius.toString

func (Radius) Sub

func (r Radius) Sub(other Radius) Radius

Sub returns the difference of two radii (Dart's -).

Flutter: ui/geometry.dart Radius.operator -

func (Radius) TruncDiv

func (r Radius) TruncDiv(operand float64) Radius

TruncDiv divides both axes by operand and truncates the results (Dart's ~/).

Deviation: an infinite or NaN result stays so, where Dart throws.

Flutter: ui/geometry.dart Radius.operator ~/

type RadiusClampOpts

type RadiusClampOpts struct {
	// Minimum is the lower bound for both axes; nil means no lower bound.
	Minimum *Radius
	// Maximum is the upper bound for both axes; nil means no upper bound.
	Maximum *Radius
}

RadiusClampOpts are the optional arguments of Radius.Clamp. A nil bound leaves that side open.

Flutter: ui/geometry.dart Radius.clamp

type RadiusClampValuesOpts

type RadiusClampValuesOpts struct {
	// MinimumX is the lower bound for the horizontal axis.
	MinimumX *float64
	// MinimumY is the lower bound for the vertical axis.
	MinimumY *float64
	// MaximumX is the upper bound for the horizontal axis.
	MaximumX *float64
	// MaximumY is the upper bound for the vertical axis.
	MaximumY *float64
}

RadiusClampValuesOpts are the optional arguments of Radius.ClampValues. A nil bound leaves that side open.

Flutter: ui/geometry.dart Radius.clampValues

type Rasterizer

type Rasterizer interface {
	// RasterizeScene draws the scene into a new image of width x height pixels.
	RasterizeScene(scene *Scene, width, height int) (*Image, error)
}

Rasterizer turns a scene into pixels. The renderers implement it: the software renderer (internal/gpu/soft) draws on the CPU, and the GLES renderer reads back from the GPU. A Picture or a Scene cannot draw itself, so ToImage is given the rasterizer of the binding it is used under.

Flutter: no counterpart (the engine's rasterizer is native)

type Rect

type Rect struct {
	// Left is the offset of the left edge from the x axis.
	Left float64
	// Top is the offset of the top edge from the y axis.
	Top float64
	// Right is the offset of the right edge from the x axis.
	Right float64
	// Bottom is the offset of the bottom edge from the y axis.
	Bottom float64
}

Rect is an immutable, 2D, axis-aligned, floating-point rectangle whose coordinates are given relative to an origin.

Flutter: ui/geometry.dart Rect

func NewRectFromCenter

func NewRectFromCenter(center Offset, width, height float64) Rect

NewRectFromCenter constructs a rectangle from its center point, width and height.

Flutter: ui/geometry.dart Rect.fromCenter

func NewRectFromCircle

func NewRectFromCircle(center Offset, radius float64) Rect

NewRectFromCircle constructs the rectangle that bounds a circle with the given center and radius.

Flutter: ui/geometry.dart Rect.fromCircle

func NewRectFromLTRB

func NewRectFromLTRB(left, top, right, bottom float64) Rect

NewRectFromLTRB constructs a rectangle from its left, top, right and bottom edges.

Flutter: ui/geometry.dart Rect.fromLTRB

func NewRectFromLTWH

func NewRectFromLTWH(left, top, width, height float64) Rect

NewRectFromLTWH constructs a rectangle from its left and top edges, its width and its height.

Flutter: ui/geometry.dart Rect.fromLTWH

func NewRectFromPoints

func NewRectFromPoints(a, b Offset) Rect

NewRectFromPoints constructs the smallest rectangle that contains the two points.

Flutter: ui/geometry.dart Rect.fromPoints

func RectLerp

func RectLerp(a, b *Rect, t float64) *Rect

RectLerp linearly interpolates between two rectangles, either of which may be nil. A nil rectangle counts as an empty one at the origin, and two nils give nil.

Flutter: ui/geometry.dart Rect.lerp

func (Rect) BottomCenter

func (r Rect) BottomCenter() Offset

BottomCenter is the offset to the center of the bottom edge.

Flutter: ui/geometry.dart Rect.bottomCenter

func (Rect) BottomLeft

func (r Rect) BottomLeft() Offset

BottomLeft is the offset to the intersection of the bottom and left edges.

Flutter: ui/geometry.dart Rect.bottomLeft

func (Rect) BottomRight

func (r Rect) BottomRight() Offset

BottomRight is the offset to the intersection of the bottom and right edges.

Flutter: ui/geometry.dart Rect.bottomRight

func (Rect) Center

func (r Rect) Center() Offset

Center is the offset to the point halfway between the left and right and the top and bottom edges.

Flutter: ui/geometry.dart Rect.center

func (Rect) CenterLeft

func (r Rect) CenterLeft() Offset

CenterLeft is the offset to the center of the left edge.

Flutter: ui/geometry.dart Rect.centerLeft

func (Rect) CenterRight

func (r Rect) CenterRight() Offset

CenterRight is the offset to the center of the right edge.

Flutter: ui/geometry.dart Rect.centerRight

func (Rect) Contains

func (r Rect) Contains(offset Offset) bool

Contains reports whether the point is inside the rectangle. The left and top edges are inside, the right and bottom edges are not.

Flutter: ui/geometry.dart Rect.contains

func (Rect) Deflate

func (r Rect) Deflate(delta float64) Rect

Deflate returns a new rectangle with edges moved inwards by the given delta.

Flutter: ui/geometry.dart Rect.deflate

func (Rect) ExpandToInclude

func (r Rect) ExpandToInclude(other Rect) Rect

ExpandToInclude returns a new rectangle which is the bounding box containing this rectangle and the given rectangle.

Flutter: ui/geometry.dart Rect.expandToInclude

func (Rect) HasNaN

func (r Rect) HasNaN() bool

HasNaN reports whether any of the coordinates is NaN.

Flutter: ui/geometry.dart Rect.hasNaN

func (Rect) Height

func (r Rect) Height() float64

Height is the distance between the top and bottom edges of the rectangle.

Flutter: ui/geometry.dart Rect.height

func (Rect) Inflate

func (r Rect) Inflate(delta float64) Rect

Inflate returns a new rectangle with edges moved outwards by the given delta.

Flutter: ui/geometry.dart Rect.inflate

func (Rect) Intersect

func (r Rect) Intersect(other Rect) Rect

Intersect returns a new rectangle that is the intersection of the given rectangle and this rectangle. The two rectangles must overlap for the result to be meaningful: check IsEmpty on the result.

Flutter: ui/geometry.dart Rect.intersect

func (Rect) IsEmpty

func (r Rect) IsEmpty() bool

IsEmpty reports whether the rectangle encloses no area: its left edge is not to the left of its right edge, or its top is not above its bottom.

Flutter: ui/geometry.dart Rect.isEmpty

func (Rect) IsFinite

func (r Rect) IsFinite() bool

IsFinite reports whether all four coordinates are finite.

Flutter: ui/geometry.dart Rect.isFinite

func (Rect) IsInfinite

func (r Rect) IsInfinite() bool

IsInfinite reports whether any of the coordinates is positive infinity.

Flutter: ui/geometry.dart Rect.isInfinite

func (Rect) Lerp

func (r Rect) Lerp(b Rect, t float64) Rect

Lerp linearly interpolates between r and b: r when t is 0, b when t is 1.

Flutter: ui/geometry.dart Rect.lerp

func (Rect) LongestSide

func (r Rect) LongestSide() float64

LongestSide is the greater of the magnitudes of the width and the height.

Flutter: ui/geometry.dart Rect.longestSide

func (Rect) Overlaps

func (r Rect) Overlaps(other Rect) bool

Overlaps reports whether the two rectangles have a non-zero area of overlap.

Flutter: ui/geometry.dart Rect.overlaps

func (Rect) Shift

func (r Rect) Shift(offset Offset) Rect

Shift returns a new rectangle translated by the given offset.

Flutter: ui/geometry.dart Rect.shift

func (Rect) ShortestSide

func (r Rect) ShortestSide() float64

ShortestSide is the lesser of the magnitudes of the width and the height.

Flutter: ui/geometry.dart Rect.shortestSide

func (Rect) Size

func (r Rect) Size() Size

Size is the distance between the top left and bottom right corners.

Flutter: ui/geometry.dart Rect.size

func (Rect) String

func (r Rect) String() string

String describes the rectangle, as Dart's toString does.

Flutter: ui/geometry.dart Rect.toString

func (Rect) TopCenter

func (r Rect) TopCenter() Offset

TopCenter is the offset to the center of the top edge.

Flutter: ui/geometry.dart Rect.topCenter

func (Rect) TopLeft

func (r Rect) TopLeft() Offset

TopLeft is the offset to the intersection of the top and left edges.

Flutter: ui/geometry.dart Rect.topLeft

func (Rect) TopRight

func (r Rect) TopRight() Offset

TopRight is the offset to the intersection of the top and right edges.

Flutter: ui/geometry.dart Rect.topRight

func (Rect) Translate

func (r Rect) Translate(translateX, translateY float64) Rect

Translate returns a new rectangle with translateX added to the x components and translateY added to the y components.

Flutter: ui/geometry.dart Rect.translate

func (Rect) Width

func (r Rect) Width() float64

Width is the distance between the left and right edges of the rectangle.

Flutter: ui/geometry.dart Rect.width

type ResizeEdge

type ResizeEdge int

ResizeEdge is an edge or a corner of a window that the user can drag to resize it.

Flutter: no counterpart

const (
	// ResizeEdgeTop is the top edge.
	//
	// Flutter: no counterpart
	ResizeEdgeTop ResizeEdge = iota
	// ResizeEdgeBottom is the bottom edge.
	//
	// Flutter: no counterpart
	ResizeEdgeBottom
	// ResizeEdgeLeft is the left edge.
	//
	// Flutter: no counterpart
	ResizeEdgeLeft
	// ResizeEdgeRight is the right edge.
	//
	// Flutter: no counterpart
	ResizeEdgeRight
	// ResizeEdgeTopLeft is the top left corner.
	//
	// Flutter: no counterpart
	ResizeEdgeTopLeft
	// ResizeEdgeTopRight is the top right corner.
	//
	// Flutter: no counterpart
	ResizeEdgeTopRight
	// ResizeEdgeBottomLeft is the bottom left corner.
	//
	// Flutter: no counterpart
	ResizeEdgeBottomLeft
	// ResizeEdgeBottomRight is the bottom right corner.
	//
	// Flutter: no counterpart
	ResizeEdgeBottomRight
)

The values of ResizeEdge.

type ResolvedFont

type ResolvedFont struct {
	// Family is the family name of the face, which can differ from the name asked for
	// (a generic name such as monospace, or an alias such as Arial).
	Family string
	// Path is the font file, and Index the face in it (a font collection has several).
	// Both are empty for a loaded or bundled font, which has no file.
	Path  string
	Index int
	// Origin says whether the font was loaded by the app, is bundled, or is a system font.
	Origin FontOrigin
	// Weight is the OpenType weight of the face (400 regular, 700 bold) and Italic whether it is
	// italic, as the font says; the weight of a variable font is that of its default instance.
	Weight int
	Italic bool
}

ResolvedFont is the face that a font family resolves to (PlatformDispatcher.ResolveFont).

Flutter: no counterpart

type ResolvedStrut

type ResolvedStrut struct {
	// Enabled says whether the paragraph has a strut at all.
	Enabled bool
	// FontFamilies is the family followed by its fallbacks; empty means the paragraph's.
	FontFamilies []string
	// FontWeight is the weight of the strut's font.
	FontWeight FontWeight
	// FontStyle is the style of the strut's font.
	FontStyle FontStyle
	// FontSize is the size of the strut's font.
	FontSize float64
	// Height is the multiple of the font size the strut takes, used when HasHeight.
	Height float64
	// HasHeight says whether the height was set.
	HasHeight bool
	// LeadingDistribution is how the extra space of the height is divided.
	LeadingDistribution TextLeadingDistribution
	// Leading is the extra leading as a multiple of the font size; -1 when not set.
	Leading float64
	// Force says whether every line takes the strut's height.
	Force bool
}

ResolvedStrut is a strut with every field decided.

Flutter: engine/src/flutter/third_party/txt/src/txt/paragraph_style.h StrutStyle

type ResolvedTextStyle

type ResolvedTextStyle struct {
	// Color is the color of the text, when Foreground is nil.
	Color Color
	// Foreground, when not nil, is the paint of the text instead of Color.
	Foreground *Paint
	// Background, when not nil, is the paint of the box behind the text.
	Background *Paint
	// Decoration is the decorations to draw.
	Decoration TextDecoration
	// DecorationColor is the color of the decorations when HasDecorationColor; else the text color.
	DecorationColor Color
	// HasDecorationColor says whether DecorationColor was set.
	HasDecorationColor bool
	// DecorationStyle is the line style of the decorations.
	DecorationStyle TextDecorationStyle
	// DecorationThickness is the multiple of the font's default decoration thickness.
	DecorationThickness float64
	// FontWeight is the weight of the glyphs.
	FontWeight FontWeight
	// FontStyle is upright or italic.
	FontStyle FontStyle
	// TextBaseline is the baseline the text aligns on.
	TextBaseline TextBaseline
	// FontFamilies is the font family followed by its fallbacks, in priority order; empty means the system default.
	FontFamilies []string
	// FontSize is the size of the glyphs in logical pixels.
	FontSize float64
	// LetterSpacing is the extra space after each letter.
	LetterSpacing float64
	// WordSpacing is the extra space at each white space.
	WordSpacing float64
	// Height is the multiple of the font size that the line takes, used when HasHeight.
	Height float64
	// HasHeight says whether the height was set; if not, the font's own line height applies.
	HasHeight bool
	// LeadingDistribution is how the extra line space is divided.
	LeadingDistribution TextLeadingDistribution
	// Locale selects region-specific glyphs.
	Locale Locale
	// Shadows are drawn underneath the text.
	Shadows []Shadow
	// FontFeatures are the OpenType features to apply.
	FontFeatures []FontFeature
	// FontVariations are the variable-font axis values to apply.
	FontVariations []FontVariation
}

ResolvedTextStyle is a text style with every field decided: what the layout and the renderers use.

Flutter: engine/src/flutter/third_party/txt/src/txt/text_style.h TextStyle

func DefaultResolvedTextStyle

func DefaultResolvedTextStyle() ResolvedTextStyle

DefaultResolvedTextStyle is the style a paragraph starts from: black, 14 logical pixels, weight 400.

Flutter: engine/src/flutter/third_party/txt/src/txt/text_style.cc TextStyle::TextStyle

type RichClipboardHost

type RichClipboardHost interface {
	// SetClipboard makes the content the content of the selection of the kind.
	SetClipboard(ctx context.Context, kind ClipboardKind, content ClipboardContent, done func(err error))
	// GetClipboard reads the content of the selection of the kind in the format
	// (one of the ClipboardFormat constants). The content is empty when the
	// selection has no such format.
	GetClipboard(ctx context.Context, kind ClipboardKind, format string, done func(content ClipboardContent, err error))
}

RichClipboardHost is what the engine implements to give access to the clipboards beyond the text of the system one: the primary selection, images and files. The dispatcher uses it when the host has it; a host without it fails the calls with ClipboardUnavailable, except the text of the system clipboard, which goes through ClipboardHost. The functions that the methods take are called later on the UI thread, never before the method has returned.

Flutter: no counterpart

type Scene

type Scene struct {
	// contains filtered or unexported fields
}

Scene is a composited scene: a tree of layers built by a SceneBuilder and ready to be rendered. It is immutable.

Flutter: ui/compositing.dart Scene

func (*Scene) Dispose

func (s *Scene) Dispose()

Dispose releases the scene. It does nothing in this implementation, which holds no native resources.

Flutter: ui/compositing.dart Scene.dispose

func (*Scene) HasTexture

func (s *Scene) HasTexture() bool

HasTexture reports whether the scene has a TextureLayer. A nil scene has none.

Flutter: no counterpart

func (*Scene) MapContent

func (s *Scene) MapContent(picture func(*Picture) *Picture, shader func(Shader) Shader) *Scene

MapContent returns a scene with the layers of this one, in which each picture is replaced by what picture returns for it and the shader of each shader mask layer by what shader returns. A function that returns its argument leaves the layer as it is, and a layer none of whose content, and none of whose children, changed is the same layer in both scenes. The layers of the new scene do not name the layers of an earlier frame they replace. Either function can be nil.

Flutter: no counterpart

func (*Scene) Root

func (s *Scene) Root() *ContainerLayer

Root returns the layer at the top of the tree.

Flutter: no counterpart

func (*Scene) String

func (s *Scene) String() string

String describes the scene, as Dart's toString does.

Flutter: ui/compositing.dart Scene.toString

func (*Scene) ToImage

func (s *Scene) ToImage(width, height int, opts ...ToImageOpts) (*Image, error)

ToImage draws the scene into an image of the given size in pixels, with the rasterizer in the options. It fails with ImageSizeInvalid for a size that is not positive, and RasterizerMissing when no rasterizer is given.

Deviation: Flutter's returns a Future and draws with the engine's rasterizer; this one is synchronous and is given the rasterizer (SPEC §12.10).

Flutter: ui/compositing.dart Scene.toImage

func (*Scene) ToImageSync

func (s *Scene) ToImageSync(width, height int, opts ...ToImageOpts) (*Image, error)

ToImageSync is ToImage.

Flutter: ui/compositing.dart Scene.toImageSync

type SceneBuilder

type SceneBuilder struct {
	// contains filtered or unexported fields
}

SceneBuilder builds a Scene: a tree of layers. Push methods start a layer that applies an effect to everything added until the matching Pop, and AddPicture adds a picture. Build ends the building and returns the scene.

Flutter: ui/compositing.dart SceneBuilder

func NewSceneBuilder

func NewSceneBuilder() *SceneBuilder

NewSceneBuilder creates a builder with an empty scene, which has a container layer as its root.

Flutter: ui/compositing.dart SceneBuilder

func (*SceneBuilder) AddPicture

func (b *SceneBuilder) AddPicture(offset Offset, picture *Picture, opts ...AddPictureOpts)

AddPicture adds a picture to the scene, with its origin at the offset.

Flutter: ui/compositing.dart SceneBuilder.addPicture

func (*SceneBuilder) AddRetained

func (b *SceneBuilder) AddRetained(retained EngineLayer)

AddRetained adds a retained layer to the scene: the same layer a previous push returned, with everything under it, without building it again. The layer must not have been disposed; it panics with the tag EngineLayerDisposed if it was.

Flutter: ui/compositing.dart SceneBuilder.addRetained

func (*SceneBuilder) AddTexture

func (b *SceneBuilder) AddTexture(textureID int64, opts ...AddTextureOpts)

AddTexture adds a texture to the scene: the texture that the registry of package gpu knows by textureID (Device.RegisterTexture), scaled to the rectangle. The renderer draws it with the pixels the app has written to it by then; an id that is not registered draws nothing.

Deviation: Flutter's ids are the embedder's; Glutter's are those of the registry of package gpu (SPEC §27.4, §12.10).

Flutter: ui/compositing.dart SceneBuilder.addTexture

func (*SceneBuilder) Build

func (b *SceneBuilder) Build() *Scene

Build finishes the scene and returns it. The layers that are still open are closed. The builder cannot be used again: its methods panic with the tag SceneBuilderBuilt.

Flutter: ui/compositing.dart SceneBuilder.build

func (*SceneBuilder) Pop

func (b *SceneBuilder) Pop()

Pop ends the effect of the last push operation. Nothing happens when only the root is left.

Flutter: ui/compositing.dart SceneBuilder.pop

func (*SceneBuilder) PushBackdropFilter

func (b *SceneBuilder) PushBackdropFilter(filter ImageFilter, opts ...PushBackdropFilterOpts) *BackdropFilterEngineLayer

PushBackdropFilter pushes a backdrop filter operation onto the operation stack: the filter is applied to what was drawn before, inside the current clip, and then the children are drawn on top.

Flutter: ui/compositing.dart SceneBuilder.pushBackdropFilter

func (*SceneBuilder) PushClipPath

func (b *SceneBuilder) PushClipPath(path *Path, opts ...PushClipPathOpts) *ClipPathEngineLayer

PushClipPath pushes a path clip operation onto the operation stack. The path is copied.

Flutter: ui/compositing.dart SceneBuilder.pushClipPath

func (*SceneBuilder) PushClipRRect

func (b *SceneBuilder) PushClipRRect(rrect RRect, opts ...PushClipRRectOpts) *ClipRRectEngineLayer

PushClipRRect pushes a rounded-rectangular clip operation onto the operation stack.

Flutter: ui/compositing.dart SceneBuilder.pushClipRRect

func (*SceneBuilder) PushClipRSuperellipse

PushClipRSuperellipse pushes a rounded-superellipse clip operation onto the operation stack.

Flutter: ui/compositing.dart SceneBuilder.pushClipRSuperellipse

func (*SceneBuilder) PushClipRect

func (b *SceneBuilder) PushClipRect(rect Rect, opts ...PushClipRectOpts) *ClipRectEngineLayer

PushClipRect pushes a rectangular clip operation onto the operation stack.

Flutter: ui/compositing.dart SceneBuilder.pushClipRect

func (*SceneBuilder) PushColorFilter

func (b *SceneBuilder) PushColorFilter(filter *ColorFilter, opts ...PushColorFilterOpts) *ColorFilterEngineLayer

PushColorFilter pushes a color filter operation onto the operation stack.

Flutter: ui/compositing.dart SceneBuilder.pushColorFilter

func (*SceneBuilder) PushImageFilter

func (b *SceneBuilder) PushImageFilter(filter ImageFilter, opts ...PushImageFilterOpts) *ImageFilterEngineLayer

PushImageFilter pushes an image filter operation onto the operation stack.

Flutter: ui/compositing.dart SceneBuilder.pushImageFilter

func (*SceneBuilder) PushOffset

func (b *SceneBuilder) PushOffset(dx, dy float64, opts ...PushOffsetOpts) *OffsetEngineLayer

PushOffset pushes a translation onto the operation stack.

Flutter: ui/compositing.dart SceneBuilder.pushOffset

func (*SceneBuilder) PushOpacity

func (b *SceneBuilder) PushOpacity(alpha int, opts ...PushOpacityOpts) *OpacityEngineLayer

PushOpacity pushes an opacity operation onto the operation stack. The alpha is from 0 (transparent) to 255 (opaque).

Flutter: ui/compositing.dart SceneBuilder.pushOpacity

func (*SceneBuilder) PushShaderMask

func (b *SceneBuilder) PushShaderMask(shader Shader, maskRect Rect, blendMode BlendMode, opts ...PushShaderMaskOpts) *ShaderMaskEngineLayer

PushShaderMask pushes a shader mask operation onto the operation stack: the children are drawn into a group, and the shader is painted over the group with the blend mode, inside maskRect.

Flutter: ui/compositing.dart SceneBuilder.pushShaderMask

func (*SceneBuilder) PushTransform

func (b *SceneBuilder) PushTransform(matrix *Matrix4, opts ...PushTransformOpts) *TransformEngineLayer

PushTransform pushes a transform operation onto the operation stack. The matrix is copied. Everything added until the matching Pop is transformed.

Flutter: ui/compositing.dart SceneBuilder.pushTransform

func (*SceneBuilder) String

func (b *SceneBuilder) String() string

String describes the builder, as Dart's toString does.

Flutter: ui/compositing.dart SceneBuilder.toString

type SemanticsAction

type SemanticsAction int

SemanticsAction is an action that an assistive technology can ask a node to perform. The value of each action is its bit in a bit field of actions.

Flutter: ui/semantics.dart SemanticsAction

const (
	// SemanticsActionTap is a request to tap the node.
	//
	// Flutter: ui/semantics.dart SemanticsAction.tap
	SemanticsActionTap SemanticsAction = 1 << iota
	// SemanticsActionLongPress is a request to long press the node.
	//
	// Flutter: ui/semantics.dart SemanticsAction.longPress
	SemanticsActionLongPress
	// SemanticsActionScrollLeft scrolls the content so that it moves left.
	//
	// Flutter: ui/semantics.dart SemanticsAction.scrollLeft
	SemanticsActionScrollLeft
	// SemanticsActionScrollRight scrolls the content so that it moves right.
	//
	// Flutter: ui/semantics.dart SemanticsAction.scrollRight
	SemanticsActionScrollRight
	// SemanticsActionScrollUp scrolls the content so that it moves up.
	//
	// Flutter: ui/semantics.dart SemanticsAction.scrollUp
	SemanticsActionScrollUp
	// SemanticsActionScrollDown scrolls the content so that it moves down.
	//
	// Flutter: ui/semantics.dart SemanticsAction.scrollDown
	SemanticsActionScrollDown
	// SemanticsActionIncrease increases the value of a slider or similar.
	//
	// Flutter: ui/semantics.dart SemanticsAction.increase
	SemanticsActionIncrease
	// SemanticsActionDecrease decreases the value of a slider or similar.
	//
	// Flutter: ui/semantics.dart SemanticsAction.decrease
	SemanticsActionDecrease
	// SemanticsActionShowOnScreen scrolls the node into view.
	//
	// Flutter: ui/semantics.dart SemanticsAction.showOnScreen
	SemanticsActionShowOnScreen
	// SemanticsActionMoveCursorForwardByCharacter moves the cursor one
	// character forward.
	//
	// Flutter: ui/semantics.dart SemanticsAction.moveCursorForwardByCharacter
	SemanticsActionMoveCursorForwardByCharacter
	// SemanticsActionMoveCursorBackwardByCharacter moves the cursor one
	// character backward.
	//
	// Flutter: ui/semantics.dart SemanticsAction.moveCursorBackwardByCharacter
	SemanticsActionMoveCursorBackwardByCharacter
	// SemanticsActionSetSelection sets the text selection.
	//
	// Flutter: ui/semantics.dart SemanticsAction.setSelection
	SemanticsActionSetSelection
	// SemanticsActionCopy copies the selection to the clipboard.
	//
	// Flutter: ui/semantics.dart SemanticsAction.copy
	SemanticsActionCopy
	// SemanticsActionCut cuts the selection to the clipboard.
	//
	// Flutter: ui/semantics.dart SemanticsAction.cut
	SemanticsActionCut
	// SemanticsActionPaste pastes the clipboard.
	//
	// Flutter: ui/semantics.dart SemanticsAction.paste
	SemanticsActionPaste
	// SemanticsActionDidGainAccessibilityFocus says that the node got the
	// accessibility focus.
	//
	// Flutter: ui/semantics.dart SemanticsAction.didGainAccessibilityFocus
	SemanticsActionDidGainAccessibilityFocus
	// SemanticsActionDidLoseAccessibilityFocus says that the node lost the
	// accessibility focus.
	//
	// Flutter: ui/semantics.dart SemanticsAction.didLoseAccessibilityFocus
	SemanticsActionDidLoseAccessibilityFocus
	// SemanticsActionCustomAction is a custom action; the argument is its ID.
	//
	// Flutter: ui/semantics.dart SemanticsAction.customAction
	SemanticsActionCustomAction
	// SemanticsActionDismiss dismisses the node, for example a dialog.
	//
	// Flutter: ui/semantics.dart SemanticsAction.dismiss
	SemanticsActionDismiss
	// SemanticsActionMoveCursorForwardByWord moves the cursor one word forward.
	//
	// Flutter: ui/semantics.dart SemanticsAction.moveCursorForwardByWord
	SemanticsActionMoveCursorForwardByWord
	// SemanticsActionMoveCursorBackwardByWord moves the cursor one word
	// backward.
	//
	// Flutter: ui/semantics.dart SemanticsAction.moveCursorBackwardByWord
	SemanticsActionMoveCursorBackwardByWord
	// SemanticsActionSetText replaces the text of the field.
	//
	// Flutter: ui/semantics.dart SemanticsAction.setText
	SemanticsActionSetText
	// SemanticsActionFocus gives the node the input focus.
	//
	// Flutter: ui/semantics.dart SemanticsAction.focus
	SemanticsActionFocus
	// SemanticsActionScrollToOffset scrolls to an offset; the argument is the
	// offset.
	//
	// Flutter: ui/semantics.dart SemanticsAction.scrollToOffset
	SemanticsActionScrollToOffset
	// SemanticsActionExpand expands a collapsed node.
	//
	// Flutter: ui/semantics.dart SemanticsAction.expand
	SemanticsActionExpand
	// SemanticsActionCollapse collapses an expanded node.
	//
	// Flutter: ui/semantics.dart SemanticsAction.collapse
	SemanticsActionCollapse
)

The semantics actions; each is one bit of the bit field the engine uses.

func SemanticsActionValues

func SemanticsActionValues() []SemanticsAction

SemanticsActionValues are all the actions, in the order of their bits.

Flutter: ui/semantics.dart SemanticsAction.values

func (SemanticsAction) Name

func (a SemanticsAction) Name() string

Name returns the name of the action, such as "tap".

Flutter: ui/semantics.dart SemanticsAction.name

func (SemanticsAction) String

func (a SemanticsAction) String() string

String is "SemanticsAction.tap".

Flutter: ui/semantics.dart SemanticsAction.toString

type SemanticsActionEvent

type SemanticsActionEvent struct {
	// ViewID is the view of the node.
	ViewID ViewID
	// NodeID is the ID of the node.
	NodeID int
	// Type is the action.
	Type SemanticsAction
	// Arguments are the arguments of the action: a bool for the cursor moves,
	// an int for a custom action, a string for setText, a map with "base" and
	// "extent" for setSelection, a []float64 for scrollToOffset; nil for the
	// others.
	Arguments any
}

SemanticsActionEvent is a request of an assistive technology to perform an action on a node.

Flutter: ui/semantics.dart SemanticsActionEvent

type SemanticsCustomActionUpdate

type SemanticsCustomActionUpdate struct {
	// ID is the ID of the action.
	ID int
	// Label is the label of the action; empty for an overriding action.
	Label string
	// Hint is the hint of an overriding action.
	Hint string
	// OverrideID is the bit of the action that this one overrides, or -1.
	OverrideID int
}

SemanticsCustomActionUpdate is what SemanticsUpdateBuilder.UpdateCustomAction records about a custom action.

Flutter: ui/semantics.dart SemanticsUpdateBuilder.updateCustomAction

type SemanticsFlags

type SemanticsFlags struct {
	// IsChecked is the checked state of a checkbox or radio button.
	IsChecked CheckedState
	// IsSelected is whether the node is selected.
	IsSelected Tristate
	// IsEnabled is whether the node is enabled.
	IsEnabled Tristate
	// IsToggled is whether a toggle is on.
	IsToggled Tristate
	// IsExpanded is whether an expandable node is expanded.
	IsExpanded Tristate
	// IsRequired is whether a form field is required.
	IsRequired Tristate
	// IsFocused is whether the node has the input focus; none if it cannot.
	IsFocused Tristate
	// IsButton is whether the node is a button.
	IsButton bool
	// IsTextField is whether the node is a text field.
	IsTextField bool
	// IsInMutuallyExclusiveGroup is whether the node is in a radio group.
	IsInMutuallyExclusiveGroup bool
	// IsHeader is whether the node is a header.
	IsHeader bool
	// IsObscured is whether the text is obscured, as in a password field.
	IsObscured bool
	// ScopesRoute is whether the node is the root of a route.
	ScopesRoute bool
	// NamesRoute is whether the node names the route.
	NamesRoute bool
	// IsHidden is whether the node is hidden from the user.
	IsHidden bool
	// IsImage is whether the node is an image.
	IsImage bool
	// IsLiveRegion is whether changes of the node are announced.
	IsLiveRegion bool
	// HasImplicitScrolling is whether the node scrolls when a child gets the
	// accessibility focus.
	HasImplicitScrolling bool
	// IsMultiline is whether the text field has several lines.
	IsMultiline bool
	// IsReadOnly is whether the text field is read only.
	IsReadOnly bool
	// IsLink is whether the node is a link.
	IsLink bool
	// IsSlider is whether the node is a slider.
	IsSlider bool
	// IsKeyboardKey is whether the node is a key of an on screen keyboard.
	IsKeyboardKey bool
	// IsAccessibilityFocusBlocked is whether the node cannot get the
	// accessibility focus.
	IsAccessibilityFocusBlocked bool
}

SemanticsFlags are the boolean properties of a semantics node. The zero value is SemanticsFlagsNone.

Flutter: ui/semantics.dart SemanticsFlags

func (SemanticsFlags) HasConflictingFlags

func (f SemanticsFlags) HasConflictingFlags(o SemanticsFlags) bool

HasConflictingFlags reports whether both have the same flag set, or a value for the same state; two such nodes cannot be merged into one.

Flutter: ui/semantics.dart SemanticsFlags.hasConflictingFlags

func (SemanticsFlags) Merge

Merge combines the flags of a node with those of a node merged into it: a flag is set if it is set in either, and a state that is true or mixed in either stays so.

Flutter: ui/semantics.dart SemanticsFlags.merge

func (SemanticsFlags) String

func (f SemanticsFlags) String() string

String lists the flags that are set.

Flutter: ui/semantics.dart SemanticsFlags.toString

func (SemanticsFlags) ToStrings

func (f SemanticsFlags) ToStrings() []string

ToStrings names the flags that are set, in the order of the engine's bit field (hasCheckedState, isChecked, isSelected, isButton, ...).

Flutter: ui/semantics.dart SemanticsFlags.toStrings

type SemanticsHitTestBehavior

type SemanticsHitTestBehavior int

SemanticsHitTestBehavior says how a node takes part in hit testing for assistive technology.

Flutter: ui/semantics.dart SemanticsHitTestBehavior

const (
	// SemanticsHitTestBehaviorDefer leaves the decision to the children.
	//
	// Flutter: ui/semantics.dart SemanticsHitTestBehavior.defer
	SemanticsHitTestBehaviorDefer SemanticsHitTestBehavior = iota
	// SemanticsHitTestBehaviorOpaque is hit, and hides what is behind it.
	//
	// Flutter: ui/semantics.dart SemanticsHitTestBehavior.opaque
	SemanticsHitTestBehaviorOpaque
	// SemanticsHitTestBehaviorTransparent is hit, and lets what is behind it
	// be hit too.
	//
	// Flutter: ui/semantics.dart SemanticsHitTestBehavior.transparent
	SemanticsHitTestBehaviorTransparent
)

The values of SemanticsHitTestBehavior. The zero value is SemanticsHitTestBehaviorDefer.

func (SemanticsHitTestBehavior) Name

Name returns the name of the value, such as "opaque".

Flutter: ui/semantics.dart SemanticsHitTestBehavior.name

func (SemanticsHitTestBehavior) String

func (b SemanticsHitTestBehavior) String() string

String is "SemanticsHitTestBehavior.opaque".

Flutter: ui/semantics.dart SemanticsHitTestBehavior.toString

type SemanticsHost

type SemanticsHost interface {
	// UpdateSemantics gives the view the changes to its semantics tree.
	UpdateSemantics(view ViewID, update *SemanticsUpdate)
	// SetSemanticsTreeEnabled says whether the framework produces a semantics
	// tree; the engine then keeps its accessibility bridge in step.
	SetSemanticsTreeEnabled(enabled bool)
}

SemanticsHost is what the engine implements to take part in semantics. The dispatcher uses it when the host has it; a host without it ignores semantics.

Flutter: no counterpart (the engine's native side of dart:ui)

type SemanticsInputType

type SemanticsInputType int

SemanticsInputType is the type of input of a text field.

Flutter: ui/semantics.dart SemanticsInputType

const (
	// SemanticsInputTypeNone is not a text field.
	//
	// Flutter: ui/semantics.dart SemanticsInputType.none
	SemanticsInputTypeNone SemanticsInputType = iota
	// SemanticsInputTypeText is plain text.
	//
	// Flutter: ui/semantics.dart SemanticsInputType.text
	SemanticsInputTypeText
	// SemanticsInputTypeURL is a URL.
	//
	// Flutter: ui/semantics.dart SemanticsInputType.url
	SemanticsInputTypeURL
	// SemanticsInputTypePhone is a phone number.
	//
	// Flutter: ui/semantics.dart SemanticsInputType.phone
	SemanticsInputTypePhone
	// SemanticsInputTypeSearch is a search query.
	//
	// Flutter: ui/semantics.dart SemanticsInputType.search
	SemanticsInputTypeSearch
	// SemanticsInputTypeEmail is an email address.
	//
	// Flutter: ui/semantics.dart SemanticsInputType.email
	SemanticsInputTypeEmail
	// SemanticsInputTypeMultiline is several lines of text.
	//
	// Flutter: ui/semantics.dart SemanticsInputType.multiline
	SemanticsInputTypeMultiline
	// SemanticsInputTypeNumber is a number.
	//
	// Flutter: ui/semantics.dart SemanticsInputType.number
	SemanticsInputTypeNumber
	// SemanticsInputTypeDatetime is a date and time.
	//
	// Flutter: ui/semantics.dart SemanticsInputType.datetime
	SemanticsInputTypeDatetime
)

The values of SemanticsInputType. The zero value is SemanticsInputTypeNone.

func (SemanticsInputType) Name

func (t SemanticsInputType) Name() string

Name returns the name of the value, such as "email".

Flutter: ui/semantics.dart SemanticsInputType.name

func (SemanticsInputType) String

func (t SemanticsInputType) String() string

String is "SemanticsInputType.email".

Flutter: ui/semantics.dart SemanticsInputType.toString

type SemanticsNodeUpdate

type SemanticsNodeUpdate struct {
	// ID is the ID of the node.
	ID int
	// Flags are the flags of the node.
	Flags SemanticsFlags
	// Actions are the supported actions as a bit field.
	Actions SemanticsAction
	// Rect is the rectangle of the node in its own coordinates.
	Rect Rect
	// Identifier is the identifier for tests.
	Identifier string
	// Label and LabelAttributes are the label.
	Label           string
	LabelAttributes []StringAttribute
	// Value and ValueAttributes are the value.
	Value           string
	ValueAttributes []StringAttribute
	// IncreasedValue and IncreasedValueAttributes are the value after an
	// increase.
	IncreasedValue           string
	IncreasedValueAttributes []StringAttribute
	// DecreasedValue and DecreasedValueAttributes are the value after a
	// decrease.
	DecreasedValue           string
	DecreasedValueAttributes []StringAttribute
	// Hint and HintAttributes are the hint.
	Hint           string
	HintAttributes []StringAttribute
	// Tooltip is the tooltip.
	Tooltip string
	// TextDirection is the direction of the strings; unspecified if there is
	// none.
	TextDirection TextDirection
	// TextSelectionBase and TextSelectionExtent are the selection, or -1.
	TextSelectionBase, TextSelectionExtent int
	// PlatformViewID is the platform view, or -1.
	PlatformViewID int
	// MaxValueLength and CurrentValueLength are the text field lengths, or -1.
	MaxValueLength, CurrentValueLength int
	// ScrollChildren, ScrollIndex, ScrollPosition, ScrollExtentMax and
	// ScrollExtentMin describe a scrollable; the positions are NaN if unset.
	ScrollChildren, ScrollIndex                      int
	ScrollPosition, ScrollExtentMax, ScrollExtentMin float64
	// Transform maps the node to its parent in traversal order (column major).
	Transform [16]float32
	// TraversalParent is the ID of the traversal parent, or -1.
	TraversalParent int
	// HitTestTransform maps the node to its parent for hit testing.
	HitTestTransform [16]float32
	// ChildrenInTraversalOrder and ChildrenInHitTestOrder are the IDs of the
	// children.
	ChildrenInTraversalOrder, ChildrenInHitTestOrder []int
	// AdditionalActions are the IDs of the custom actions.
	AdditionalActions []int
	// HeadingLevel is 0 to 6.
	HeadingLevel int
	// LinkURL is the URL of a link, or "".
	LinkURL string
	// Role is the role.
	Role SemanticsRole
	// ControlsNodes are the identifiers of the nodes that this one controls;
	// nil if none.
	ControlsNodes []string
	// ValidationResult is the validation result.
	ValidationResult SemanticsValidationResult
	// HitTestBehavior is the hit test behavior.
	HitTestBehavior SemanticsHitTestBehavior
	// InputType is the input type.
	InputType SemanticsInputType
	// Locale is the locale of the strings, or nil.
	Locale *Locale
	// MinValue and MaxValue are the limits of a value, or "".
	MinValue, MaxValue string
}

SemanticsNodeUpdate is what SemanticsUpdateBuilder.UpdateNode records about a node. The IDs of the children are in the order the engine uses them.

Flutter: ui/semantics.dart SemanticsUpdateBuilder.updateNode

type SemanticsRole

type SemanticsRole int

SemanticsRole is the role of a node, which tells an assistive technology what kind of control or landmark it is.

Flutter: ui/semantics.dart SemanticsRole

const (
	// SemanticsRoleNone is no role.
	//
	// Flutter: ui/semantics.dart SemanticsRole.none
	SemanticsRoleNone SemanticsRole = iota
	// SemanticsRoleTab is a tab in a tab bar.
	//
	// Flutter: ui/semantics.dart SemanticsRole.tab
	SemanticsRoleTab
	// SemanticsRoleTabBar is a bar of tabs.
	//
	// Flutter: ui/semantics.dart SemanticsRole.tabBar
	SemanticsRoleTabBar
	// SemanticsRoleTabPanel is the content of a tab.
	//
	// Flutter: ui/semantics.dart SemanticsRole.tabPanel
	SemanticsRoleTabPanel
	// SemanticsRoleDialog is a dialog.
	//
	// Flutter: ui/semantics.dart SemanticsRole.dialog
	SemanticsRoleDialog
	// SemanticsRoleAlertDialog is a dialog that needs an answer.
	//
	// Flutter: ui/semantics.dart SemanticsRole.alertDialog
	SemanticsRoleAlertDialog
	// SemanticsRoleTable is a table.
	//
	// Flutter: ui/semantics.dart SemanticsRole.table
	SemanticsRoleTable
	// SemanticsRoleCell is a cell of a table.
	//
	// Flutter: ui/semantics.dart SemanticsRole.cell
	SemanticsRoleCell
	// SemanticsRoleRow is a row of a table.
	//
	// Flutter: ui/semantics.dart SemanticsRole.row
	SemanticsRoleRow
	// SemanticsRoleColumnHeader is the header of a column of a table.
	//
	// Flutter: ui/semantics.dart SemanticsRole.columnHeader
	SemanticsRoleColumnHeader
	// SemanticsRoleDragHandle is a handle that is dragged.
	//
	// Flutter: ui/semantics.dart SemanticsRole.dragHandle
	SemanticsRoleDragHandle
	// SemanticsRoleSpinButton is a field with a value that steps up and down.
	//
	// Flutter: ui/semantics.dart SemanticsRole.spinButton
	SemanticsRoleSpinButton
	// SemanticsRoleComboBox is a text field with a list of choices.
	//
	// Flutter: ui/semantics.dart SemanticsRole.comboBox
	SemanticsRoleComboBox
	// SemanticsRoleMenuBar is a bar of menus.
	//
	// Flutter: ui/semantics.dart SemanticsRole.menuBar
	SemanticsRoleMenuBar
	// SemanticsRoleMenu is a menu.
	//
	// Flutter: ui/semantics.dart SemanticsRole.menu
	SemanticsRoleMenu
	// SemanticsRoleMenuItem is an item of a menu.
	//
	// Flutter: ui/semantics.dart SemanticsRole.menuItem
	SemanticsRoleMenuItem
	// SemanticsRoleMenuItemCheckbox is a checkbox in a menu.
	//
	// Flutter: ui/semantics.dart SemanticsRole.menuItemCheckbox
	SemanticsRoleMenuItemCheckbox
	// SemanticsRoleMenuItemRadio is a radio button in a menu.
	//
	// Flutter: ui/semantics.dart SemanticsRole.menuItemRadio
	SemanticsRoleMenuItemRadio
	// SemanticsRoleAlert is a message that is announced at once.
	//
	// Flutter: ui/semantics.dart SemanticsRole.alert
	SemanticsRoleAlert
	// SemanticsRoleStatus is a status message.
	//
	// Flutter: ui/semantics.dart SemanticsRole.status
	SemanticsRoleStatus
	// SemanticsRoleList is a list.
	//
	// Flutter: ui/semantics.dart SemanticsRole.list
	SemanticsRoleList
	// SemanticsRoleListItem is an item of a list.
	//
	// Flutter: ui/semantics.dart SemanticsRole.listItem
	SemanticsRoleListItem
	// SemanticsRoleComplementary is a landmark for content next to the main one.
	//
	// Flutter: ui/semantics.dart SemanticsRole.complementary
	SemanticsRoleComplementary
	// SemanticsRoleContentInfo is a landmark for the information about the page.
	//
	// Flutter: ui/semantics.dart SemanticsRole.contentInfo
	SemanticsRoleContentInfo
	// SemanticsRoleMain is the landmark of the main content.
	//
	// Flutter: ui/semantics.dart SemanticsRole.main
	SemanticsRoleMain
	// SemanticsRoleNavigation is a landmark for navigation.
	//
	// Flutter: ui/semantics.dart SemanticsRole.navigation
	SemanticsRoleNavigation
	// SemanticsRoleRegion is a landmark for a region with a label.
	//
	// Flutter: ui/semantics.dart SemanticsRole.region
	SemanticsRoleRegion
	// SemanticsRoleForm is a form.
	//
	// Flutter: ui/semantics.dart SemanticsRole.form
	SemanticsRoleForm
	// SemanticsRoleLoadingSpinner is a progress indicator without a value.
	//
	// Flutter: ui/semantics.dart SemanticsRole.loadingSpinner
	SemanticsRoleLoadingSpinner
	// SemanticsRoleProgressBar is a progress bar.
	//
	// Flutter: ui/semantics.dart SemanticsRole.progressBar
	SemanticsRoleProgressBar
	// SemanticsRoleRadioGroup is a group of radio buttons.
	//
	// Flutter: ui/semantics.dart SemanticsRole.radioGroup
	SemanticsRoleRadioGroup
	// SemanticsRoleTooltip is a tooltip.
	//
	// Flutter: ui/semantics.dart SemanticsRole.tooltip
	SemanticsRoleTooltip
	// SemanticsRoleHotKey is a keyboard shortcut.
	//
	// Flutter: ui/semantics.dart SemanticsRole.hotKey
	SemanticsRoleHotKey
)

The values of SemanticsRole. The zero value is SemanticsRoleNone.

func (SemanticsRole) Name

func (r SemanticsRole) Name() string

Name returns the name of the role, such as "tabBar".

Flutter: ui/semantics.dart SemanticsRole.name

func (SemanticsRole) String

func (r SemanticsRole) String() string

String is "SemanticsRole.tabBar".

Flutter: ui/semantics.dart SemanticsRole.toString

type SemanticsUpdate

type SemanticsUpdate struct {
	// Nodes are the nodes that changed, parents before children.
	Nodes []SemanticsNodeUpdate
	// CustomActions are the custom actions that the nodes use.
	CustomActions []SemanticsCustomActionUpdate
}

SemanticsUpdate is a set of changes to the semantics tree, which the framework sends to the engine.

Flutter: ui/semantics.dart SemanticsUpdate

type SemanticsUpdateBuilder

type SemanticsUpdateBuilder struct {
	// contains filtered or unexported fields
}

SemanticsUpdateBuilder builds a SemanticsUpdate.

Flutter: ui/semantics.dart SemanticsUpdateBuilder

func NewSemanticsUpdateBuilder

func NewSemanticsUpdateBuilder() *SemanticsUpdateBuilder

NewSemanticsUpdateBuilder creates an empty builder.

Flutter: ui/semantics.dart SemanticsUpdateBuilder.new

func (*SemanticsUpdateBuilder) Build

Build returns the update. The builder can not be used again.

Flutter: ui/semantics.dart SemanticsUpdateBuilder.build

func (*SemanticsUpdateBuilder) UpdateCustomAction

func (b *SemanticsUpdateBuilder) UpdateCustomAction(a SemanticsCustomActionUpdate)

UpdateCustomAction adds the definition of a custom action.

Flutter: ui/semantics.dart SemanticsUpdateBuilder.updateCustomAction

func (*SemanticsUpdateBuilder) UpdateNode

UpdateNode adds the new state of a node. A negative ID panics with the tag SemanticsUpdateInvalid.

Flutter: ui/semantics.dart SemanticsUpdateBuilder.updateNode

type SemanticsValidationResult

type SemanticsValidationResult int

SemanticsValidationResult is the result of the validation of a field.

Flutter: ui/semantics.dart SemanticsValidationResult

const (
	// SemanticsValidationResultNone is no validation.
	//
	// Flutter: ui/semantics.dart SemanticsValidationResult.none
	SemanticsValidationResultNone SemanticsValidationResult = iota
	// SemanticsValidationResultValid is a value that passed the validation.
	//
	// Flutter: ui/semantics.dart SemanticsValidationResult.valid
	SemanticsValidationResultValid
	// SemanticsValidationResultInvalid is a value that failed the validation.
	//
	// Flutter: ui/semantics.dart SemanticsValidationResult.invalid
	SemanticsValidationResultInvalid
)

The values of SemanticsValidationResult. The zero value is SemanticsValidationResultNone.

func (SemanticsValidationResult) Name

Name returns the name of the value, such as "valid".

Flutter: ui/semantics.dart SemanticsValidationResult.name

func (SemanticsValidationResult) String

func (v SemanticsValidationResult) String() string

String is "SemanticsValidationResult.valid".

Flutter: ui/semantics.dart SemanticsValidationResult.toString

type ServiceHost

type ServiceHost interface {
	// PlatformService returns the service with the name, or nil when the platform has none. It may be
	// called from any goroutine.
	PlatformService(name string) any
}

ServiceHost is what the engine implements to hand out the optional services that its platform has by itself, and that package desktop uses instead of D-Bus: on Android the services of opening a URI and of notifications (SPEC §24.11). A host without it has none. The services are named, and the value is a plain Go interface that the caller asserts, because package ui cannot name the platform's types.

Flutter: no counterpart

type Shader

type Shader interface {
	// contains filtered or unexported methods
}

Shader is the base of the objects that supply a color for each pixel of a shape when it is painted: gradients and image shaders. Set one on a Paint with Paint.SetShader.

Flutter: ui/painting.dart Shader

type ShaderMaskEngineLayer

type ShaderMaskEngineLayer struct {
	// contains filtered or unexported fields
}

ShaderMaskEngineLayer is the handle PushShaderMask returns.

Flutter: ui/compositing.dart ShaderMaskEngineLayer

func (*ShaderMaskEngineLayer) Dispose

func (h *ShaderMaskEngineLayer) Dispose()

Dispose releases the handle.

Flutter: ui/compositing.dart _EngineLayerWrapper.dispose

func (*ShaderMaskEngineLayer) Layer

func (h *ShaderMaskEngineLayer) Layer() Layer

Layer returns the layer the handle stands for.

Flutter: no counterpart

type ShaderMaskLayer

type ShaderMaskLayer struct {

	// Shader is the shader that makes the mask.
	Shader Shader
	// MaskRect is the area the shader is painted over.
	MaskRect Rect
	// BlendMode is how the shader combines with the group.
	BlendMode BlendMode
	// FilterQuality is the quality of sampling an image shader; never
	// FilterQualityUnspecified.
	FilterQuality FilterQuality
	// contains filtered or unexported fields
}

ShaderMaskLayer draws the layers under it into a group and then paints a shader over the group with a blend mode, within a rectangle.

Flutter: flow/layers/shader_mask_layer.h ShaderMaskLayer

func (*ShaderMaskLayer) Children

func (b *ShaderMaskLayer) Children() []Layer

Children returns the layers under this one.

Flutter: no counterpart

func (*ShaderMaskLayer) HasTexture

func (b *ShaderMaskLayer) HasTexture() bool

HasTexture reports whether this layer or a layer under it is a TextureLayer.

Flutter: no counterpart

func (*ShaderMaskLayer) OldLayer

func (b *ShaderMaskLayer) OldLayer() Layer

OldLayer returns the layer of the previous frame this one replaces.

Flutter: no counterpart

type Shadow

type Shadow struct {
	// Color is the color of the shadow.
	Color Color
	// Offset is the displacement of the shadow from the text.
	Offset Offset
	// BlurRadius is the blur radius; the Gaussian blur uses BlurSigma, derived from it.
	BlurRadius float64
}

Shadow is a single shadow cast by a piece of text.

The zero Shadow has a transparent color; NewShadow gives Flutter's default, opaque black.

Flutter: ui/painting.dart Shadow

func NewShadow

func NewShadow(opts ...ShadowOpts) Shadow

NewShadow creates a shadow. A negative blur radius panics with the tag ShadowBlurRadiusNegative.

Flutter: ui/painting.dart Shadow

func ShadowLerp

func ShadowLerp(a, b *Shadow, t float64) *Shadow

ShadowLerp linearly interpolates between two shadows. Either may be nil; two nils give nil.

Flutter: ui/painting.dart Shadow.lerp

func ShadowLerpList

func ShadowLerpList(a, b []Shadow, t float64) []Shadow

ShadowLerpList linearly interpolates between two lists of shadows; the shorter list is padded with transparent shadows. Two nil lists give nil.

Flutter: ui/painting.dart Shadow.lerpList

func (Shadow) BlurSigma

func (s Shadow) BlurSigma() float64

BlurSigma is the standard deviation of the Gaussian blur of the shadow.

Flutter: ui/painting.dart Shadow.blurSigma

func (Shadow) Scale

func (s Shadow) Scale(factor float64) Shadow

Scale returns a shadow with its offset and blur radius scaled by the factor.

Flutter: ui/painting.dart Shadow.scale

type ShadowOpts

type ShadowOpts struct {
	// Color defaults to opaque black.
	Color *Color
	// Offset defaults to zero.
	Offset Offset
	// BlurRadius defaults to 0 and must not be negative.
	BlurRadius float64
}

ShadowOpts are the optional parameters of NewShadow.

Flutter: ui/painting.dart Shadow

type Size

type Size struct {
	// Width is the horizontal extent.
	Width float64
	// Height is the vertical extent.
	Height float64
}

Size holds a 2D floating-point size: a width and a height.

Flutter: ui/geometry.dart Size

func NewSizeFromHeight

func NewSizeFromHeight(height float64) Size

NewSizeFromHeight returns a size with the given height and an infinite width.

Flutter: ui/geometry.dart Size.fromHeight

func NewSizeFromRadius

func NewSizeFromRadius(radius float64) Size

NewSizeFromRadius returns the size of a circle with the given radius.

Flutter: ui/geometry.dart Size.fromRadius

func NewSizeFromWidth

func NewSizeFromWidth(width float64) Size

NewSizeFromWidth returns a size with the given width and an infinite height.

Flutter: ui/geometry.dart Size.fromWidth

func NewSizeSquare

func NewSizeSquare(dimension float64) Size

NewSizeSquare returns a size with the same width and height.

Flutter: ui/geometry.dart Size.square

func SizeLerp

func SizeLerp(a, b *Size, t float64) *Size

SizeLerp linearly interpolates between two sizes, either of which may be nil. A nil size counts as zero, and two nils give nil.

Flutter: ui/geometry.dart Size.lerp

func (Size) Add

func (s Size) Add(other Offset) Size

Add returns s made larger by the offset (Dart's +).

Flutter: ui/geometry.dart Size.operator +

func (Size) AspectRatio

func (s Size) AspectRatio() float64

AspectRatio is the lesser of the ratio between width and height and the ratio between height and width: here, width divided by height, with the cases of a zero height handled as Flutter does.

Flutter: ui/geometry.dart Size.aspectRatio

func (Size) BottomCenter

func (s Size) BottomCenter(origin Offset) Offset

BottomCenter is the offset to the center of the bottom edge of the rectangle of this size whose top left corner is origin.

Flutter: ui/geometry.dart Size.bottomCenter

func (Size) BottomLeft

func (s Size) BottomLeft(origin Offset) Offset

BottomLeft is the offset to the intersection of the bottom and left edges of the rectangle of this size whose top left corner is origin.

Flutter: ui/geometry.dart Size.bottomLeft

func (Size) BottomRight

func (s Size) BottomRight(origin Offset) Offset

BottomRight is the offset to the intersection of the bottom and right edges of the rectangle of this size whose top left corner is origin.

Flutter: ui/geometry.dart Size.bottomRight

func (Size) Center

func (s Size) Center(origin Offset) Offset

Center is the offset to the point halfway between the left and right and the top and bottom edges of the rectangle of this size whose top left corner is origin.

Flutter: ui/geometry.dart Size.center

func (Size) CenterLeft

func (s Size) CenterLeft(origin Offset) Offset

CenterLeft is the offset to the center of the left edge of the rectangle of this size whose top left corner is origin.

Flutter: ui/geometry.dart Size.centerLeft

func (Size) CenterRight

func (s Size) CenterRight(origin Offset) Offset

CenterRight is the offset to the center of the right edge of the rectangle of this size whose top left corner is origin.

Flutter: ui/geometry.dart Size.centerRight

func (Size) Contains

func (s Size) Contains(offset Offset) bool

Contains reports whether the point is inside the rectangle of this size whose top left corner is the origin. The left and top edges are inside, the right and bottom edges are not.

Flutter: ui/geometry.dart Size.contains

func (Size) Div

func (s Size) Div(operand float64) Size

Div divides both dimensions by operand (Dart's /).

Flutter: ui/geometry.dart Size.operator /

func (Size) Flipped

func (s Size) Flipped() Size

Flipped returns a size with the width and height swapped.

Flutter: ui/geometry.dart Size.flipped

func (Size) Ge

func (s Size) Ge(other Size) bool

Ge reports whether both dimensions are greater than or equal to the other's (Dart's >=).

Flutter: ui/geometry.dart OffsetBase.operator >=

func (Size) Gt

func (s Size) Gt(other Size) bool

Gt reports whether both dimensions are greater than the other's (Dart's >).

Flutter: ui/geometry.dart OffsetBase.operator >

func (Size) IsEmpty

func (s Size) IsEmpty() bool

IsEmpty reports whether either dimension is zero or negative.

Flutter: ui/geometry.dart Size.isEmpty

func (Size) IsFinite

func (s Size) IsFinite() bool

IsFinite reports whether both dimensions are finite.

Flutter: ui/geometry.dart OffsetBase.isFinite

func (Size) IsInfinite

func (s Size) IsInfinite() bool

IsInfinite reports whether either dimension is infinite.

Flutter: ui/geometry.dart OffsetBase.isInfinite

func (Size) Le

func (s Size) Le(other Size) bool

Le reports whether both dimensions are less than or equal to the other's (Dart's <=).

Flutter: ui/geometry.dart OffsetBase.operator <=

func (Size) Lerp

func (s Size) Lerp(b Size, t float64) Size

Lerp linearly interpolates between s and b: s when t is 0, b when t is 1.

Flutter: ui/geometry.dart Size.lerp

func (Size) LongestSide

func (s Size) LongestSide() float64

LongestSide is the greater of the magnitudes of the width and the height.

Flutter: ui/geometry.dart Size.longestSide

func (Size) Lt

func (s Size) Lt(other Size) bool

Lt reports whether both dimensions are less than the other's (Dart's <).

Flutter: ui/geometry.dart OffsetBase.operator <

func (Size) Mod

func (s Size) Mod(operand float64) Size

Mod returns the remainder of dividing both dimensions by operand, made non-negative as Dart does (Dart's %).

Flutter: ui/geometry.dart Size.operator %

func (Size) Mul

func (s Size) Mul(operand float64) Size

Mul multiplies both dimensions by operand (Dart's *).

Flutter: ui/geometry.dart Size.operator *

func (Size) ShortestSide

func (s Size) ShortestSide() float64

ShortestSide is the lesser of the magnitudes of the width and the height.

Flutter: ui/geometry.dart Size.shortestSide

func (Size) String

func (s Size) String() string

String describes the size, as Dart's toString does.

Flutter: ui/geometry.dart Size.toString

func (Size) Sub

func (s Size) Sub(other Size) Offset

Sub returns the offset that, added to other, gives s: the difference of two sizes (Dart's - with a Size).

Flutter: ui/geometry.dart Size.operator -

func (Size) SubOffset

func (s Size) SubOffset(other Offset) Size

SubOffset returns s made smaller by the offset (Dart's - with an Offset).

Flutter: ui/geometry.dart Size.operator -

func (Size) TopCenter

func (s Size) TopCenter(origin Offset) Offset

TopCenter is the offset to the center of the top edge of the rectangle of this size whose top left corner is origin.

Flutter: ui/geometry.dart Size.topCenter

func (Size) TopLeft

func (s Size) TopLeft(origin Offset) Offset

TopLeft is the offset to the intersection of the top and left edges of the rectangle of this size whose top left corner is origin.

Flutter: ui/geometry.dart Size.topLeft

func (Size) TopRight

func (s Size) TopRight(origin Offset) Offset

TopRight is the offset to the intersection of the top and right edges of the rectangle of this size whose top left corner is origin.

Flutter: ui/geometry.dart Size.topRight

func (Size) TruncDiv

func (s Size) TruncDiv(operand float64) Size

TruncDiv divides both dimensions by operand and truncates the results (Dart's ~/).

Deviation: an infinite or NaN result stays so, where Dart throws.

Flutter: ui/geometry.dart Size.operator ~/

type SpellCheckHost

type SpellCheckHost interface {
	// SpellCheckSupported says whether the platform has a spell checker that can be asked.
	SpellCheckSupported() bool
	// SpellCheck asks for the misspelled words of the text in the locale (a BCP 47 tag, such as
	// "en-US"). done is called later on the UI thread with the misspelled ranges in order, or the
	// error. It may be called from any goroutine's work: the result is posted to the UI thread.
	SpellCheck(ctx context.Context, locale, text string, done func(spans []SpellCheckSpan, err error))
}

SpellCheckHost is what the engine implements to give access to the spell checker of the platform: Android's TextServicesManager (SPEC §24.6). The dispatcher uses it when the host has it; a host without it has no spell check, as Linux and the web do not.

Flutter: no counterpart (the engine's side of the flutter/spellcheck channel)

type SpellCheckSpan

type SpellCheckSpan struct {
	// Start is the byte offset of the first byte of the misspelled range.
	Start int
	// End is the byte offset after the last byte of the misspelled range.
	End int
	// Suggestions are the replacements, the best first.
	Suggestions []string
}

SpellCheckSpan is a misspelled range of the text that was checked, with the words the spell checker suggests for it. Start and End are UTF-8 byte offsets into the text.

Deviation: Flutter's SuggestionSpan has the UTF-16 range of a TextRange; Glutter's text offsets are bytes (SPEC §12.10), and the platform converts the ranges it gets.

Flutter: services/spell_check.dart SuggestionSpan

type SpellOutStringAttribute

type SpellOutStringAttribute struct {
	// contains filtered or unexported fields
}

SpellOutStringAttribute says that the range should be spoken character by character.

Flutter: ui/semantics.dart SpellOutStringAttribute

func NewSpellOutStringAttribute

func NewSpellOutStringAttribute(r TextRange) SpellOutStringAttribute

NewSpellOutStringAttribute creates an attribute for the range.

Flutter: ui/semantics.dart SpellOutStringAttribute.new

func (SpellOutStringAttribute) CopyWithRange

CopyWithRange returns the attribute for another range.

Flutter: ui/semantics.dart SpellOutStringAttribute.copy

func (SpellOutStringAttribute) Range

Range is the range the attribute applies to.

Flutter: ui/semantics.dart StringAttribute.range

type StringAttribute

type StringAttribute interface {
	// Range is the range of the string the attribute applies to (UTF-8 byte
	// offsets, SPEC §12.10).
	//
	// Flutter: ui/semantics.dart StringAttribute.range
	Range() TextRange
	// CopyWithRange returns the attribute for another range.
	//
	// Flutter: ui/semantics.dart StringAttribute.copy
	CopyWithRange(r TextRange) StringAttribute
}

StringAttribute is an immutable annotation of a range of a string, which semantics sends to the accessibility service.

Flutter: ui/semantics.dart StringAttribute

type StrokeCap

type StrokeCap int

StrokeCap is the shape drawn at the ends of a stroked open path. The default is StrokeCapButt.

Flutter: ui/painting.dart StrokeCap

const (
	// StrokeCapUnspecified is the zero value: the default.
	//
	// Flutter: no counterpart
	StrokeCapUnspecified StrokeCap = iota
	// StrokeCapButt is Flutter's StrokeCap.butt. Begin and end contours with a flat edge and no extension.
	//
	// Flutter: ui/painting.dart StrokeCap.butt
	StrokeCapButt
	// StrokeCapRound is Flutter's StrokeCap.round. Begin and end contours with a semi-circle extension.
	//
	// Flutter: ui/painting.dart StrokeCap.round
	StrokeCapRound
	// StrokeCapSquare is Flutter's StrokeCap.square. Begin and end contours with a half square extension.
	//
	// Flutter: ui/painting.dart StrokeCap.square
	StrokeCapSquare
)

The values of StrokeCap follow Flutter's declaration order.

func (StrokeCap) String

func (e StrokeCap) String() string

String returns the name Dart prints for the value, such as "StrokeCap.butt".

type StrokeJoin

type StrokeJoin int

StrokeJoin is the shape drawn where two segments of a stroked path meet. The default is StrokeJoinMiter.

Flutter: ui/painting.dart StrokeJoin

const (
	// StrokeJoinUnspecified is the zero value: the default.
	//
	// Flutter: no counterpart
	StrokeJoinUnspecified StrokeJoin = iota
	// StrokeJoinMiter is Flutter's StrokeJoin.miter. Joins between line segments form sharp corners, up to the miter limit.
	//
	// Flutter: ui/painting.dart StrokeJoin.miter
	StrokeJoinMiter
	// StrokeJoinRound is Flutter's StrokeJoin.round. Joins between line segments form circular arcs.
	//
	// Flutter: ui/painting.dart StrokeJoin.round
	StrokeJoinRound
	// StrokeJoinBevel is Flutter's StrokeJoin.bevel. Joins between line segments are cut off with a straight line.
	//
	// Flutter: ui/painting.dart StrokeJoin.bevel
	StrokeJoinBevel
)

The values of StrokeJoin follow Flutter's declaration order.

func (StrokeJoin) String

func (e StrokeJoin) String() string

String returns the name Dart prints for the value, such as "StrokeJoin.miter".

type StrutStyle

type StrutStyle struct {
	// contains filtered or unexported fields
}

StrutStyle defines the strut, which sets the minimum vertical layout metrics of a paragraph's lines.

Flutter: ui/text.dart StrutStyle

func NewStrutStyle

func NewStrutStyle(opts ...StrutStyleOpts) *StrutStyle

NewStrutStyle creates a strut style.

Flutter: ui/text.dart StrutStyle

func (*StrutStyle) Options

func (s *StrutStyle) Options() StrutStyleOpts

Options returns the options the strut was made from.

Flutter: no counterpart

type StrutStyleOpts

type StrutStyleOpts struct {
	// FontFamily is the name of the font to use when painting the strut.
	FontFamily string
	// FontFamilyFallback is the ordered list of font families to fall back on.
	FontFamilyFallback []string
	// FontSize is the size of the font of the strut, in logical pixels.
	FontSize *float64
	// Height is the height of the strut as a multiple of its font size.
	Height *float64
	// LeadingDistribution is how the extra space of the height is divided.
	LeadingDistribution TextLeadingDistribution
	// Leading is the additional leading as a multiple of the font size, half above and half below.
	Leading *float64
	// FontWeight is the weight of the strut's font.
	FontWeight FontWeight
	// FontStyle is the style of the strut's font.
	FontStyle FontStyle
	// ForceStrutHeight, when true, makes every line exactly the strut's height.
	ForceStrutHeight *bool
}

StrutStyleOpts are the optional parameters of NewStrutStyle.

Flutter: ui/text.dart StrutStyle

type SystemChromeHost

type SystemChromeHost interface {
	// SetPreferredOrientations says which orientations the app can be in; an empty list lets
	// the system choose.
	SetPreferredOrientations(orientations []DeviceOrientation)
	// SetEnabledSystemUIMode sets how much of the system's interface shows; overlays are the
	// bars that stay for SystemUIModeManual.
	SetEnabledSystemUIMode(mode SystemUIMode, overlays []SystemUIOverlay)
	// SetSystemUIOverlayStyle sets the look of the bars.
	SetSystemUIOverlayStyle(style SystemUIOverlayStyle)
	// SetSystemUIChangeCallback sets the function that is called, on the UI thread, when the
	// system shows (true) or hides (false) its bars because of the user; nil removes it.
	SetSystemUIChangeCallback(fn func(visible bool))
	// PerformHapticFeedback gives the feedback.
	PerformHapticFeedback(kind HapticFeedbackKind)
	// PlaySystemSound plays the sound.
	PlaySystemSound(kind SystemSoundKind)
}

SystemChromeHost is what the engine implements to control the system's interface around the app, to give haptic feedback and to play the sounds of the system. The dispatcher uses it when the host has it; a host without it (the desktop and the web) does nothing, as Flutter does there.

Flutter: no counterpart (the engine's side of the flutter/platform channel)

type SystemSoundKind

type SystemSoundKind int

SystemSoundKind is a sound of the system.

Flutter: services/system_sound.dart SystemSoundType

const (
	// SystemSoundUnspecified is the zero value.
	//
	// Flutter: no counterpart
	SystemSoundUnspecified SystemSoundKind = iota
	// SystemSoundClick is the sound of a click.
	//
	// Flutter: services/system_sound.dart SystemSoundType.click
	SystemSoundClick
	// SystemSoundTick is the sound of a tick.
	//
	// Flutter: services/system_sound.dart SystemSoundType.tick
	SystemSoundTick
	// SystemSoundAlert is the sound of an alert.
	//
	// Flutter: services/system_sound.dart SystemSoundType.alert
	SystemSoundAlert
)

The values of SystemSoundKind.

type SystemUIMode

type SystemUIMode int

SystemUIMode is how much of the system's interface (the status bar and the navigation bar) the app shows.

Flutter: services/system_chrome.dart SystemUiMode

const (
	// SystemUIModeUnspecified is the zero value.
	//
	// Flutter: no counterpart
	SystemUIModeUnspecified SystemUIMode = iota
	// SystemUIModeLeanBack hides the bars until the user taps the screen.
	//
	// Flutter: services/system_chrome.dart SystemUiMode.leanBack
	SystemUIModeLeanBack
	// SystemUIModeImmersive hides the bars until the user swipes from an edge.
	//
	// Flutter: services/system_chrome.dart SystemUiMode.immersive
	SystemUIModeImmersive
	// SystemUIModeImmersiveSticky is immersive, and the bars hide again by themselves.
	//
	// Flutter: services/system_chrome.dart SystemUiMode.immersiveSticky
	SystemUIModeImmersiveSticky
	// SystemUIModeEdgeToEdge draws behind transparent bars.
	//
	// Flutter: services/system_chrome.dart SystemUiMode.edgeToEdge
	SystemUIModeEdgeToEdge
	// SystemUIModeManual shows the overlays that are listed.
	//
	// Flutter: services/system_chrome.dart SystemUiMode.manual
	SystemUIModeManual
)

The values of SystemUIMode follow Flutter's declaration order.

type SystemUIOverlay

type SystemUIOverlay int

SystemUIOverlay is a bar of the system's interface.

Flutter: services/system_chrome.dart SystemUiOverlay

const (
	// SystemUIOverlayUnspecified is the zero value.
	//
	// Flutter: no counterpart
	SystemUIOverlayUnspecified SystemUIOverlay = iota
	// SystemUIOverlayTop is the status bar.
	//
	// Flutter: services/system_chrome.dart SystemUiOverlay.top
	SystemUIOverlayTop
	// SystemUIOverlayBottom is the navigation bar.
	//
	// Flutter: services/system_chrome.dart SystemUiOverlay.bottom
	SystemUIOverlayBottom
)

The values of SystemUIOverlay follow Flutter's declaration order.

type SystemUIOverlayStyle

type SystemUIOverlayStyle struct {
	// SystemNavigationBarColor is the color of the navigation bar.
	SystemNavigationBarColor *Color
	// SystemNavigationBarDividerColor is the color of the divider above it.
	SystemNavigationBarDividerColor *Color
	// SystemNavigationBarIconBrightness is the brightness of its icons.
	SystemNavigationBarIconBrightness Brightness
	// SystemNavigationBarContrastEnforced is whether the system makes sure it has contrast.
	SystemNavigationBarContrastEnforced *bool
	// StatusBarColor is the color of the status bar.
	StatusBarColor *Color
	// StatusBarBrightness is the brightness of the status bar (iOS).
	StatusBarBrightness Brightness
	// StatusBarIconBrightness is the brightness of the status bar's icons.
	StatusBarIconBrightness Brightness
	// SystemStatusBarContrastEnforced is whether the system makes sure it has contrast.
	SystemStatusBarContrastEnforced *bool
}

SystemUIOverlayStyle is the look of the status bar and the navigation bar. A nil color or flag is one that the app does not say: the platform keeps what it has.

Flutter: services/system_chrome.dart SystemUiOverlayStyle

type Tangent

type Tangent struct {
	// Position is the point on the path.
	Position Offset
	// Vector is the unit vector pointing the way the path goes there.
	Vector Offset
}

Tangent is the position and the direction of a path at some distance along it.

Flutter: ui/painting.dart Tangent

func NewTangent

func NewTangent(position, vector Offset) Tangent

NewTangent creates a Tangent from a position and a direction vector.

Flutter: ui/painting.dart Tangent

func NewTangentFromAngle

func NewTangentFromAngle(position Offset, angle float64) Tangent

NewTangentFromAngle creates a Tangent from a position and the angle of its direction, in radians, measured clockwise from the positive x axis.

Flutter: ui/painting.dart Tangent.fromAngle

func (Tangent) Angle

func (t Tangent) Angle() float64

Angle is the angle of the direction in radians, counter-clockwise from the positive x axis, to be consistent with the sweepAngle of Path.ArcTo.

Flutter: ui/painting.dart Tangent.angle

type TextAffinity

type TextAffinity int

TextAffinity is a direction from which to interpret a text position that sits at a soft line break, where the end of one line and the start of the next are the same offset.

Flutter: ui/text.dart TextAffinity

const (
	// TextAffinityUnspecified is the zero value: downstream.
	//
	// Flutter: no counterpart
	TextAffinityUnspecified TextAffinity = iota
	// TextAffinityUpstream means the position is associated with the character before the offset: the end of the line before the break.
	//
	// Flutter: ui/text.dart TextAffinity.upstream
	TextAffinityUpstream
	// TextAffinityDownstream means the position is associated with the character after the offset: the start of the line after the break.
	//
	// Flutter: ui/text.dart TextAffinity.downstream
	TextAffinityDownstream
)

The values of TextAffinity follow Flutter's declaration order.

func (TextAffinity) IsUpstream

func (e TextAffinity) IsUpstream() bool

IsUpstream reports whether the affinity is upstream; the unspecified affinity is downstream.

Flutter: no counterpart

func (TextAffinity) Name

func (e TextAffinity) Name() string

Name returns the Dart enum name, such as "downstream".

Flutter: dart:core Enum.name

func (TextAffinity) String

func (e TextAffinity) String() string

String returns the name Dart prints for the value, such as "TextAffinity.upstream".

type TextAlign

type TextAlign int

TextAlign is how the text is aligned horizontally.

Flutter: ui/text.dart TextAlign

const (
	// TextAlignUnspecified is the zero value: the default (start).
	//
	// Flutter: no counterpart
	TextAlignUnspecified TextAlign = iota
	// TextAlignLeft aligns the text on the left edge of the container.
	//
	// Flutter: ui/text.dart TextAlign.left
	TextAlignLeft
	// TextAlignRight aligns the text on the right edge of the container.
	//
	// Flutter: ui/text.dart TextAlign.right
	TextAlignRight
	// TextAlignCenter aligns the text in the center of the container.
	//
	// Flutter: ui/text.dart TextAlign.center
	TextAlignCenter
	// TextAlignJustify stretches the lines that end in a soft line break to fill the width of the container.
	//
	// Flutter: ui/text.dart TextAlign.justify
	TextAlignJustify
	// TextAlignStart aligns the text on the leading edge of the container.
	//
	// Flutter: ui/text.dart TextAlign.start
	TextAlignStart
	// TextAlignEnd aligns the text on the trailing edge of the container.
	//
	// Flutter: ui/text.dart TextAlign.end
	TextAlignEnd
)

The values of TextAlign follow Flutter's declaration order.

func (TextAlign) Name

func (e TextAlign) Name() string

Name returns the Dart enum name, such as "center".

Flutter: dart:core Enum.name

func (TextAlign) String

func (e TextAlign) String() string

String returns the name Dart prints for the value, such as "TextAlign.left".

type TextBaseline

type TextBaseline int

TextBaseline is a horizontal line used for aligning text.

Flutter: ui/text.dart TextBaseline

const (
	// TextBaselineUnspecified is the zero value: the default (alphabetic).
	//
	// Flutter: no counterpart
	TextBaselineUnspecified TextBaseline = iota
	// TextBaselineAlphabetic is the horizontal line used to align the bottom of glyphs for alphabetic characters.
	//
	// Flutter: ui/text.dart TextBaseline.alphabetic
	TextBaselineAlphabetic
	// TextBaselineIdeographic is the horizontal line used to align ideographic characters.
	//
	// Flutter: ui/text.dart TextBaseline.ideographic
	TextBaselineIdeographic
)

The values of TextBaseline follow Flutter's declaration order.

func (TextBaseline) Name

func (e TextBaseline) Name() string

Name returns the Dart enum name, such as "alphabetic".

Flutter: dart:core Enum.name

func (TextBaseline) String

func (e TextBaseline) String() string

String returns the name Dart prints for the value, such as "TextBaseline.alphabetic".

type TextBox

type TextBox struct {
	// Left is the left edge of the box.
	Left float64
	// Top is the top edge of the box.
	Top float64
	// Right is the right edge of the box.
	Right float64
	// Bottom is the bottom edge of the box.
	Bottom float64
	// Direction is the direction in which text inside the box flows.
	Direction TextDirection
}

TextBox is a rectangle enclosing a run of text, with the direction of the text in it.

Flutter: ui/text.dart TextBox

func NewTextBoxFromLTRBD

func NewTextBoxFromLTRBD(left, top, right, bottom float64, direction TextDirection) TextBox

NewTextBoxFromLTRBD creates a box from its edges and direction.

Flutter: ui/text.dart TextBox.fromLTRBD

func (TextBox) End

func (b TextBox) End() float64

End is the right edge of the box for left-to-right text and the left edge for right-to-left text.

Flutter: ui/text.dart TextBox.end

func (TextBox) Start

func (b TextBox) Start() float64

Start is the left edge of the box for left-to-right text and the right edge for right-to-left text.

Flutter: ui/text.dart TextBox.start

func (TextBox) String

func (b TextBox) String() string

String returns what Dart prints for the box.

func (TextBox) ToRect

func (b TextBox) ToRect() Rect

ToRect returns the box as a Rect.

Flutter: ui/text.dart TextBox.toRect

type TextDecoration

type TextDecoration int

TextDecoration is a linear decoration to draw near the text: a bit mask of underline, overline and line through.

Flutter: ui/text.dart TextDecoration

const (
	// TextDecorationNone draws no decoration.
	//
	// Flutter: ui/text.dart TextDecoration.none
	TextDecorationNone TextDecoration = 0
	// TextDecorationUnderline draws a line underneath each line of text.
	//
	// Flutter: ui/text.dart TextDecoration.underline
	TextDecorationUnderline TextDecoration = 1
	// TextDecorationOverline draws a line above each line of text.
	//
	// Flutter: ui/text.dart TextDecoration.overline
	TextDecorationOverline TextDecoration = 2
	// TextDecorationLineThrough draws a line through each line of text.
	//
	// Flutter: ui/text.dart TextDecoration.lineThrough
	TextDecorationLineThrough TextDecoration = 4
)

The decorations, combined with Combine or by or-ing.

func CombineTextDecorations

func CombineTextDecorations(decorations ...TextDecoration) TextDecoration

CombineTextDecorations creates a decoration that paints the union of all the given decorations.

Flutter: ui/text.dart TextDecoration.combine

func (TextDecoration) Contains

func (d TextDecoration) Contains(other TextDecoration) bool

Contains reports whether this decoration will paint at least as much decoration as the other.

Flutter: ui/text.dart TextDecoration.contains

func (TextDecoration) String

func (d TextDecoration) String() string

String returns what Dart prints for the value, such as "TextDecoration.underline".

type TextDecorationStyle

type TextDecorationStyle int

TextDecorationStyle is the style in which to draw a text decoration.

Flutter: ui/text.dart TextDecorationStyle

const (
	// TextDecorationStyleUnspecified is the zero value: the default (solid).
	//
	// Flutter: no counterpart
	TextDecorationStyleUnspecified TextDecorationStyle = iota
	// TextDecorationStyleSolid draws a solid line.
	//
	// Flutter: ui/text.dart TextDecorationStyle.solid
	TextDecorationStyleSolid
	// TextDecorationStyleDouble draws two lines.
	//
	// Flutter: ui/text.dart TextDecorationStyle.double
	TextDecorationStyleDouble
	// TextDecorationStyleDotted draws a dotted line.
	//
	// Flutter: ui/text.dart TextDecorationStyle.dotted
	TextDecorationStyleDotted
	// TextDecorationStyleDashed draws a dashed line.
	//
	// Flutter: ui/text.dart TextDecorationStyle.dashed
	TextDecorationStyleDashed
	// TextDecorationStyleWavy draws a sinusoidal line.
	//
	// Flutter: ui/text.dart TextDecorationStyle.wavy
	TextDecorationStyleWavy
)

The values of TextDecorationStyle follow Flutter's declaration order.

func (TextDecorationStyle) Name

func (e TextDecorationStyle) Name() string

Name returns the Dart enum name, such as "wavy".

Flutter: dart:core Enum.name

func (TextDecorationStyle) String

func (e TextDecorationStyle) String() string

String returns the name Dart prints for the value, such as "TextDecorationStyle.wavy".

type TextDirection

type TextDirection int

TextDirection is a direction in which text flows.

Flutter: ui/text.dart TextDirection

const (
	// TextDirectionUnspecified is the zero value: the default (left to right).
	//
	// Flutter: no counterpart
	TextDirectionUnspecified TextDirection = iota
	// TextDirectionRTL is the text flows from right to left (e.g. Arabic, Hebrew).
	//
	// Flutter: ui/text.dart TextDirection.rtl
	TextDirectionRTL
	// TextDirectionLTR is the text flows from left to right (e.g., English, French).
	//
	// Flutter: ui/text.dart TextDirection.ltr
	TextDirectionLTR
)

The values of TextDirection follow Flutter's declaration order (rtl first).

func (TextDirection) IsRTL

func (e TextDirection) IsRTL() bool

IsRTL reports whether the direction is right to left. The unspecified direction is left to right.

Flutter: no counterpart

func (TextDirection) Name

func (e TextDirection) Name() string

Name returns the Dart enum name, such as "ltr".

Flutter: dart:core Enum.name

func (TextDirection) String

func (e TextDirection) String() string

String returns the name Dart prints for the value, such as "TextDirection.rtl".

type TextHeightBehavior

type TextHeightBehavior struct {
	// ApplyHeightToFirstAscent says whether the line height applies to the ascent of the first line.
	ApplyHeightToFirstAscent bool
	// ApplyHeightToLastDescent says whether the line height applies to the descent of the last line.
	ApplyHeightToLastDescent bool
	// LeadingDistribution is how the extra space of a line is divided; the unspecified value is proportional.
	LeadingDistribution TextLeadingDistribution
}

TextHeightBehavior defines how to apply TextStyle.Height over the first ascent and the last descent of a paragraph.

Flutter: ui/text.dart TextHeightBehavior

func NewTextHeightBehavior

func NewTextHeightBehavior(opts ...TextHeightBehaviorOpts) TextHeightBehavior

NewTextHeightBehavior creates a TextHeightBehavior with Flutter's defaults for what the options leave out.

Flutter: ui/text.dart TextHeightBehavior

func (TextHeightBehavior) String

func (b TextHeightBehavior) String() string

String returns what Dart prints for the behavior.

type TextHeightBehaviorOpts

type TextHeightBehaviorOpts struct {
	// ApplyHeightToFirstAscent defaults to true.
	ApplyHeightToFirstAscent *bool
	// ApplyHeightToLastDescent defaults to true.
	ApplyHeightToLastDescent *bool
	// LeadingDistribution defaults to proportional.
	LeadingDistribution TextLeadingDistribution
}

TextHeightBehaviorOpts are the optional parameters of NewTextHeightBehavior.

Flutter: ui/text.dart TextHeightBehavior

type TextInputEnterKey

type TextInputEnterKey int

TextInputEnterKey is what the Enter key of a virtual keyboard is labeled and does, as the platform can show it: the action of the text field. The zero value, TextInputEnterKeyUnspecified, means the platform's own label.

Flutter: no counterpart (Flutter sends the TextInputAction of the configuration over the flutter/textinput channel)

const (
	// TextInputEnterKeyUnspecified is the zero value: the platform's own label.
	//
	// Flutter: no counterpart
	TextInputEnterKeyUnspecified TextInputEnterKey = iota
	// TextInputEnterKeyEnter inserts a line break.
	//
	// Flutter: no counterpart
	TextInputEnterKeyEnter
	// TextInputEnterKeyDone means the user is done with the input.
	//
	// Flutter: no counterpart
	TextInputEnterKeyDone
	// TextInputEnterKeyGo takes the user to the target of the text.
	//
	// Flutter: no counterpart
	TextInputEnterKeyGo
	// TextInputEnterKeyNext moves the focus to the next field.
	//
	// Flutter: no counterpart
	TextInputEnterKeyNext
	// TextInputEnterKeyPrevious moves the focus to the previous field.
	//
	// Flutter: no counterpart
	TextInputEnterKeyPrevious
	// TextInputEnterKeySearch runs a search for the text.
	//
	// Flutter: no counterpart
	TextInputEnterKeySearch
	// TextInputEnterKeySend sends the text.
	//
	// Flutter: no counterpart
	TextInputEnterKeySend
)

The values of TextInputEnterKey follow the values of the HTML enterkeyhint attribute.

func (TextInputEnterKey) String

func (k TextInputEnterKey) String() string

String returns the name of the value, such as "TextInputEnterKeyDone".

type TextInputEvent

type TextInputEvent struct {
	// View is the view whose text field the event is for.
	View ViewID
	// DeleteBefore and DeleteAfter are the bytes to delete before and after the
	// cursor, once the text being composed is removed.
	DeleteBefore, DeleteAfter int
	// DeleteSelection removes the selected text even when Commit and Preedit are
	// empty, as a Backspace does. Without it an event that commits nothing leaves
	// the selection as it is.
	DeleteSelection bool
	// Commit is the text to insert at the cursor, replacing the selection.
	Commit string
	// Preedit is the text the input method is composing, shown at the cursor
	// until it is committed. Empty means there is none.
	Preedit string
	// PreeditCursorBegin and PreeditCursorEnd are the selection inside Preedit,
	// in UTF-8 byte offsets. Both -1 means the input method hides the cursor.
	PreeditCursorBegin, PreeditCursorEnd int
}

TextInputEvent is a change that the input method asks of the text field. The platform sends one event for each batch of changes the input method makes at once; apply them in this order: remove the text being composed, delete the surrounding text, insert Commit (or remove the selection, when DeleteSelection asks for it), then show Preedit.

Flutter: no counterpart (Flutter receives TextInputClient.updateEditingState and the like over the flutter/textinput channel)

type TextInputHints

type TextInputHints uint32

TextInputHints are the flags that tell an input method how to treat the text of the focused text field. The zero value has no hint.

Flutter: no counterpart

const (
	// TextInputHintCompletion suggests completions of the word.
	//
	// Flutter: no counterpart
	TextInputHintCompletion TextInputHints = 1 << iota
	// TextInputHintSpellcheck checks the spelling.
	//
	// Flutter: no counterpart
	TextInputHintSpellcheck
	// TextInputHintAutoCapitalization capitalizes the first letter of a
	// sentence.
	//
	// Flutter: no counterpart
	TextInputHintAutoCapitalization
	// TextInputHintLowercase prefers lowercase letters.
	//
	// Flutter: no counterpart
	TextInputHintLowercase
	// TextInputHintUppercase prefers uppercase letters.
	//
	// Flutter: no counterpart
	TextInputHintUppercase
	// TextInputHintTitlecase capitalizes the first letter of every word.
	//
	// Flutter: no counterpart
	TextInputHintTitlecase
	// TextInputHintHiddenText hides the text: no suggestions are shown.
	//
	// Flutter: no counterpart
	TextInputHintHiddenText
	// TextInputHintSensitiveData keeps the text out of any learning or history.
	//
	// Flutter: no counterpart
	TextInputHintSensitiveData
	// TextInputHintLatin expects Latin letters.
	//
	// Flutter: no counterpart
	TextInputHintLatin
	// TextInputHintMultiline expects several lines of text.
	//
	// Flutter: no counterpart
	TextInputHintMultiline
)

The flags of TextInputHints; their values are the content hints of the Wayland text-input protocol.

func (TextInputHints) Has

Has reports whether all the flags of f are set.

Flutter: no counterpart

type TextInputHost

type TextInputHost interface {
	// SetTextInput gives the input method the state of the focused text field.
	// A state with Enabled false turns the input method off.
	SetTextInput(state TextInputState)
}

TextInputHost is what the engine implements to give the input method (IME) of the platform the state of the focused text field. The dispatcher uses it when the host has it; a host without it has no input method.

Flutter: no counterpart (the engine's side of the flutter/textinput channel)

type TextInputPurpose

type TextInputPurpose int

TextInputPurpose is what the focused text field is for, so an input method can show a fitting keyboard or enable the right dictionaries. The zero value, TextInputPurposeUnspecified, means normal text.

Flutter: no counterpart (Flutter sends the TextInputType of the configuration over the flutter/textinput channel)

const (
	// TextInputPurposeUnspecified is the zero value: normal text.
	//
	// Flutter: no counterpart
	TextInputPurposeUnspecified TextInputPurpose = iota
	// TextInputPurposeAlpha allows letters only.
	//
	// Flutter: no counterpart
	TextInputPurposeAlpha
	// TextInputPurposeDigits allows digits only.
	//
	// Flutter: no counterpart
	TextInputPurposeDigits
	// TextInputPurposeNumber is a number, with a sign and a decimal separator.
	//
	// Flutter: no counterpart
	TextInputPurposeNumber
	// TextInputPurposePhone is a phone number.
	//
	// Flutter: no counterpart
	TextInputPurposePhone
	// TextInputPurposeURL is a URL.
	//
	// Flutter: no counterpart
	TextInputPurposeURL
	// TextInputPurposeEmail is an email address.
	//
	// Flutter: no counterpart
	TextInputPurposeEmail
	// TextInputPurposeName is a person's name.
	//
	// Flutter: no counterpart
	TextInputPurposeName
	// TextInputPurposePassword is a password; the text is hidden.
	//
	// Flutter: no counterpart
	TextInputPurposePassword
	// TextInputPurposePIN is a numeric PIN; the text is hidden.
	//
	// Flutter: no counterpart
	TextInputPurposePIN
	// TextInputPurposeDate is a date.
	//
	// Flutter: no counterpart
	TextInputPurposeDate
	// TextInputPurposeTime is a time.
	//
	// Flutter: no counterpart
	TextInputPurposeTime
	// TextInputPurposeDatetime is a date and a time.
	//
	// Flutter: no counterpart
	TextInputPurposeDatetime
)

The values of TextInputPurpose follow the content purposes of the Wayland text-input protocol.

func (TextInputPurpose) String

func (p TextInputPurpose) String() string

String returns the name of the value, such as "TextInputPurposeEmail".

type TextInputState

type TextInputState struct {
	// Enabled is whether a text field has focus. When false, the other fields
	// mean nothing and the input method is turned off.
	Enabled bool
	// View is the view that the text field is in.
	View ViewID
	// Purpose is what the text field is for.
	Purpose TextInputPurpose
	// Hints tell the input method how to treat the text.
	Hints TextInputHints
	// Text is the text of the field around the caret, without the text that the
	// input method is composing (the preedit). It is whole unless the field is
	// too long for the platform; then it is cut around the caret and
	// the selection is relative to the cut text.
	Text string
	// SelectionAnchor and SelectionCursor are the selection in Text, in UTF-8
	// byte offsets: the anchor is where the selection began and the cursor is
	// the end that moves. They are equal for a caret.
	SelectionAnchor, SelectionCursor int
	// CaretRect is the rectangle of the caret, in logical pixels of the view, so
	// the input method can place its candidate window next to it.
	CaretRect Rect
	// EnterKey is the action of the field, for a platform whose keyboard labels
	// its Enter key (the web's enterkeyhint).
	EnterKey TextInputEnterKey
	// CausedByInputMethod is whether the last change of Text or Selection comes
	// from the input method, not from the user or the app.
	CausedByInputMethod bool
}

TextInputState is what the input method (IME) of the platform needs to know about the focused text field. The framework sends a new state to the platform each time one of its parts changes.

Flutter: no counterpart (Flutter sends the pieces over the flutter/textinput channel: TextInput.setClient, setEditingState, setCaretRect and the like)

type TextLeadingDistribution

type TextLeadingDistribution int

TextLeadingDistribution is how the extra vertical space of a line (the line height minus the font's own height) is divided.

Flutter: ui/text.dart TextLeadingDistribution

const (
	// TextLeadingDistributionUnspecified is the zero value: the default (proportional).
	//
	// Flutter: no counterpart
	TextLeadingDistributionUnspecified TextLeadingDistribution = iota
	// TextLeadingDistributionProportional distributes the leading in proportion to the font's ascent and descent.
	//
	// Flutter: ui/text.dart TextLeadingDistribution.proportional
	TextLeadingDistributionProportional
	// TextLeadingDistributionEven puts half of the leading above the ascent and half below the descent.
	//
	// Flutter: ui/text.dart TextLeadingDistribution.even
	TextLeadingDistributionEven
)

The values of TextLeadingDistribution follow Flutter's declaration order.

func (TextLeadingDistribution) Name

Name returns the Dart enum name, such as "even".

Flutter: dart:core Enum.name

func (TextLeadingDistribution) String

func (e TextLeadingDistribution) String() string

String returns the name Dart prints for the value, such as "TextLeadingDistribution.even".

type TextPosition

type TextPosition struct {
	// Offset is the byte offset in the text.
	Offset int
	// Affinity is the side of the offset at a soft line break; the zero value is downstream.
	Affinity TextAffinity
}

TextPosition is a position in a string of text: an offset and, at a soft line break, which side of it.

The offset is a UTF-8 byte offset into the string (SPEC §12.10).

Flutter: ui/text.dart TextPosition

func NewTextPosition

func NewTextPosition(offset int, opts ...TextPositionOpts) TextPosition

NewTextPosition creates a position.

Flutter: ui/text.dart TextPosition

func (TextPosition) Equal

func (p TextPosition) Equal(other TextPosition) bool

Equal reports whether two positions are the same, with the unspecified affinity being downstream.

Flutter: ui/text.dart TextPosition.==

func (TextPosition) String

func (p TextPosition) String() string

String returns what Dart prints, such as "TextPosition(offset: 3, affinity: TextAffinity.downstream)".

type TextPositionOpts

type TextPositionOpts struct {
	// Affinity defaults to downstream.
	Affinity TextAffinity
}

TextPositionOpts are the optional parameters of NewTextPosition.

Flutter: ui/text.dart TextPosition

type TextRange

type TextRange struct {
	// Start is the index of the first character in the range.
	Start int
	// End is the next index after the characters in this range.
	End int
}

TextRange is a range of characters in a string of text: byte offsets, start inclusive and end exclusive. A range with a negative offset (-1) is invalid.

Flutter: ui/text.dart TextRange

func NewTextRange

func NewTextRange(start, end int) TextRange

NewTextRange creates a range. An offset below -1 panics with the tag TextRangeInvalid.

Flutter: ui/text.dart TextRange

func NewTextRangeCollapsed

func NewTextRangeCollapsed(offset int) TextRange

NewTextRangeCollapsed creates an empty range at the offset.

Flutter: ui/text.dart TextRange.collapsed

func (TextRange) IsCollapsed

func (r TextRange) IsCollapsed() bool

IsCollapsed reports whether the range is empty.

Flutter: ui/text.dart TextRange.isCollapsed

func (TextRange) IsNormalized

func (r TextRange) IsNormalized() bool

IsNormalized reports whether the start is not after the end.

Flutter: ui/text.dart TextRange.isNormalized

func (TextRange) IsValid

func (r TextRange) IsValid() bool

IsValid reports whether both offsets are not negative.

Flutter: ui/text.dart TextRange.isValid

func (TextRange) String

func (r TextRange) String() string

String returns what Dart prints, such as "TextRange(start: 1, end: 3)".

func (TextRange) TextAfter

func (r TextRange) TextAfter(text string) string

TextAfter is the text after the range.

Flutter: ui/text.dart TextRange.textAfter

func (TextRange) TextBefore

func (r TextRange) TextBefore(text string) string

TextBefore is the text before the range. A range that is not normalized or is outside the text panics with the tag TextRangeOutOfBounds.

Flutter: ui/text.dart TextRange.textBefore

func (TextRange) TextInside

func (r TextRange) TextInside(text string) string

TextInside is the text in the range.

Flutter: ui/text.dart TextRange.textInside

type TextRun

type TextRun struct {
	// Start and End are the UTF-8 byte offsets of the text, End exclusive.
	Start, End int
	// Style is the style of the text. Runs that came from one PushStyle share it, and so does a
	// paragraph with the runs of its content: nothing changes what it points to.
	Style *ResolvedTextStyle
}

TextRun is a stretch of the paragraph's text in one style.

Flutter: no counterpart

type TextStyle

type TextStyle struct {
	// contains filtered or unexported fields
}

TextStyle is an immutable style describing how to format and paint text. Fields that were not set inherit from the style under it when it is pushed on a ParagraphBuilder.

Flutter: ui/text.dart TextStyle

func NewTextStyle

func NewTextStyle(opts ...TextStyleOpts) *TextStyle

NewTextStyle creates a text style. Passing both a Color and a Foreground panics with the tag TextStyleColorAndForeground.

Flutter: ui/text.dart TextStyle

func (*TextStyle) Options

func (s *TextStyle) Options() TextStyleOpts

Options returns the options the style was made from. The slices are copies.

Flutter: no counterpart

func (*TextStyle) Resolve

func (s *TextStyle) Resolve(parent ResolvedTextStyle) ResolvedTextStyle

Resolve applies the style on top of parent: every field the style set replaces the parent's.

Flutter: engine/src/flutter/lib/ui/text/paragraph_builder.cc ParagraphBuilder::pushStyle

func (*TextStyle) String

func (s *TextStyle) String() string

String returns a description of the style's set fields.

type TextStyleOpts

type TextStyleOpts struct {
	// Color is the color to use when painting the text; it must not be given together with Foreground.
	Color *Color
	// Decoration is the decorations to paint near the text (underline, overline, line through).
	Decoration *TextDecoration
	// DecorationColor is the color in which to paint the text decorations; it defaults to the text color.
	DecorationColor *Color
	// DecorationStyle is the style in which to paint the text decorations.
	DecorationStyle TextDecorationStyle
	// DecorationThickness is how many times the default thickness of the decoration to draw it with.
	DecorationThickness *float64
	// FontWeight is the typeface thickness to use when painting the text.
	FontWeight FontWeight
	// FontStyle is the typeface variant to use when drawing the letters.
	FontStyle FontStyle
	// TextBaseline is the baseline to use for aligning the text.
	TextBaseline TextBaseline
	// FontFamily is the name of the font to use when painting the text.
	FontFamily string
	// FontFamilyFallback is the ordered list of font families to fall back on when a glyph cannot be found in a higher priority font.
	FontFamilyFallback []string
	// FontSize is the size of glyphs (in logical pixels) to use when painting the text.
	FontSize *float64
	// LetterSpacing is the amount of space (in logical pixels) to add between each letter.
	LetterSpacing *float64
	// WordSpacing is the amount of space (in logical pixels) to add at each sequence of white-space.
	WordSpacing *float64
	// Height is the height of the line as a multiple of the font size; nil uses the font's own line height.
	Height *float64
	// LeadingDistribution is how the extra space of the line height is divided above and below the text.
	LeadingDistribution TextLeadingDistribution
	// Locale is the locale used to select region-specific glyphs.
	Locale *Locale
	// Background is the paint drawn as a background for the text.
	Background *Paint
	// Foreground is the paint used to draw the text; it must not be given together with Color.
	Foreground *Paint
	// Shadows is a list of Shadows that will be painted underneath the text.
	Shadows []Shadow
	// FontFeatures is a list of FontFeatures that affect how the font selects glyphs.
	FontFeatures []FontFeature
	// FontVariations is a list of FontVariations that affect how a variable font is rendered.
	FontVariations []FontVariation
}

TextStyleOpts are the optional parameters of NewTextStyle. A field left at its zero value (or nil) is not set, and a style pushed on a ParagraphBuilder inherits it from the style under it.

Flutter: ui/text.dart TextStyle

type TextureLayer

type TextureLayer struct {

	// TextureID is the id the registry gave the texture.
	TextureID int64
	// Offset is the top left corner of the rectangle.
	Offset Offset
	// Width and Height are the size of the rectangle.
	Width, Height float64
	// Freeze says that the layer keeps showing the texture's last frame while the app resizes it.
	Freeze bool
	// FilterQuality is the quality of the scaling; never FilterQualityUnspecified.
	FilterQuality FilterQuality
	// contains filtered or unexported fields
}

TextureLayer draws a texture that the app registered (SPEC §27.4) into a rectangle. The renderer samples the texture with the filter quality, premultiplied, scaled to the rectangle. A renderer without GPU textures draws nothing.

Flutter: flow/layers/texture_layer.h TextureLayer

func (*TextureLayer) Children

func (b *TextureLayer) Children() []Layer

Children returns the layers under this one.

Flutter: no counterpart

func (*TextureLayer) HasTexture

func (b *TextureLayer) HasTexture() bool

HasTexture reports whether this layer or a layer under it is a TextureLayer.

Flutter: no counterpart

func (*TextureLayer) OldLayer

func (b *TextureLayer) OldLayer() Layer

OldLayer returns the layer of the previous frame this one replaces.

Flutter: no counterpart

type TileMode

type TileMode int

TileMode is what the shader does outside the bounds it was defined for. The default is TileModeClamp.

Flutter: ui/painting.dart TileMode

const (
	// TileModeUnspecified is the zero value: the default.
	//
	// Flutter: no counterpart
	TileModeUnspecified TileMode = iota
	// TileModeClamp is Flutter's TileMode.clamp. Edge is extended indefinitely.
	//
	// Flutter: ui/painting.dart TileMode.clamp
	TileModeClamp
	// TileModeRepeated is Flutter's TileMode.repeated. Edge is repeated from first to last.
	//
	// Flutter: ui/painting.dart TileMode.repeated
	TileModeRepeated
	// TileModeMirror is Flutter's TileMode.mirror. Edge is mirrored from last to first to last.
	//
	// Flutter: ui/painting.dart TileMode.mirror
	TileModeMirror
	// TileModeDecal is Flutter's TileMode.decal. Render the shader's image pixels only within its original bounds; outside is transparent.
	//
	// Flutter: ui/painting.dart TileMode.decal
	TileModeDecal
)

The values of TileMode follow Flutter's declaration order.

func (TileMode) String

func (e TileMode) String() string

String returns the name Dart prints for the value, such as "TileMode.clamp".

type ToImageOpts

type ToImageOpts struct {
	// Rasterizer draws the image. Nil makes ToImage fail with RasterizerMissing.
	Rasterizer Rasterizer
}

ToImageOpts are the optional arguments of Picture.ToImage and Scene.ToImage.

Flutter: ui/painting.dart Picture.toImage

type TransformEngineLayer

type TransformEngineLayer struct {
	// contains filtered or unexported fields
}

TransformEngineLayer is the handle PushTransform returns.

Flutter: ui/compositing.dart TransformEngineLayer

func (*TransformEngineLayer) Dispose

func (h *TransformEngineLayer) Dispose()

Dispose releases the handle.

Flutter: ui/compositing.dart _EngineLayerWrapper.dispose

func (*TransformEngineLayer) Layer

func (h *TransformEngineLayer) Layer() Layer

Layer returns the layer the handle stands for.

Flutter: no counterpart

type TransformLayer

type TransformLayer struct {

	// Matrix is the transform applied to the children.
	Matrix Matrix4
	// contains filtered or unexported fields
}

TransformLayer applies a transform to the layers under it. PushOffset makes one too, with a translation.

Flutter: flow/layers/transform_layer.h TransformLayer

func (*TransformLayer) Children

func (b *TransformLayer) Children() []Layer

Children returns the layers under this one.

Flutter: no counterpart

func (*TransformLayer) HasTexture

func (b *TransformLayer) HasTexture() bool

HasTexture reports whether this layer or a layer under it is a TextureLayer.

Flutter: no counterpart

func (*TransformLayer) OldLayer

func (b *TransformLayer) OldLayer() Layer

OldLayer returns the layer of the previous frame this one replaces.

Flutter: no counterpart

type Tristate

type Tristate int

Tristate is a boolean that can also be unset.

Flutter: ui/semantics.dart Tristate

const (
	// TristateNone is the state of a property that does not apply.
	//
	// Flutter: ui/semantics.dart Tristate.none
	TristateNone Tristate = iota
	// TristateIsTrue is true.
	//
	// Flutter: ui/semantics.dart Tristate.isTrue
	TristateIsTrue
	// TristateIsFalse is false.
	//
	// Flutter: ui/semantics.dart Tristate.isFalse
	TristateIsFalse
)

The values of Tristate. The zero value is TristateNone.

func TristateFromBool

func TristateFromBool(v bool) Tristate

TristateFromBool is TristateIsTrue or TristateIsFalse.

Flutter: semantics/semantics.dart _tristateFromBoolOrNull

func (Tristate) Name

func (t Tristate) Name() string

Name returns the name of the value, such as "isTrue".

Flutter: ui/semantics.dart Tristate.name

func (Tristate) String

func (t Tristate) String() string

String is "Tristate.isTrue".

Flutter: ui/semantics.dart Tristate.toString

func (Tristate) ToBoolOrNull

func (t Tristate) ToBoolOrNull() *bool

ToBoolOrNull is the value as a pointer to a bool; nil for TristateNone.

Flutter: ui/semantics.dart Tristate.toBoolOrNull

type Vector3

type Vector3 struct {
	// X is the first component.
	X float32
	// Y is the second component.
	Y float32
	// Z is the third component.
	Z float32
}

Vector3 is a 3D vector of float32 components.

Flutter: package:vector_math Vector3

type Vector4

type Vector4 struct {
	// X is the first component.
	X float32
	// Y is the second component.
	Y float32
	// Z is the third component.
	Z float32
	// W is the fourth component.
	W float32
}

Vector4 is a 4D vector of float32 components.

Flutter: package:vector_math Vector4

type VertexMode

type VertexMode int

VertexMode is how the vertices of a Vertices are joined into triangles.

Flutter: ui/painting.dart VertexMode

const (
	// VertexModeUnspecified is the zero value: VertexModeTriangles.
	//
	// Flutter: no counterpart
	VertexModeUnspecified VertexMode = iota
	// VertexModeTriangles is Flutter's VertexMode.triangles. Draw each sequence
	// of three vertices as the vertices of a triangle.
	//
	// Flutter: ui/painting.dart VertexMode.triangles
	VertexModeTriangles
	// VertexModeTriangleStrip is Flutter's VertexMode.triangleStrip. Draw each
	// sliding window of three vertices as the vertices of a triangle.
	//
	// Flutter: ui/painting.dart VertexMode.triangleStrip
	VertexModeTriangleStrip
	// VertexModeTriangleFan is Flutter's VertexMode.triangleFan. Draw the first
	// vertex and each sliding window of two vertices as the vertices of a
	// triangle.
	//
	// Flutter: ui/painting.dart VertexMode.triangleFan
	VertexModeTriangleFan
)

The values of VertexMode follow Flutter's declaration order.

func (VertexMode) String

func (e VertexMode) String() string

String returns the name Dart prints for the value, such as "VertexMode.triangles".

type Vertices

type Vertices struct {
	// contains filtered or unexported fields
}

Vertices is a set of vertex positions, and optionally colors, texture coordinates and indices, to draw as triangles with Canvas.DrawVertices. It is immutable.

Flutter: ui/painting.dart Vertices

func NewVertices

func NewVertices(mode VertexMode, positions []Offset, opts ...VerticesOpts) *Vertices

NewVertices creates a set of vertices. It panics with the tag VerticesColorCountMismatch, VerticesTextureCountMismatch or VerticesIndexInvalid when the lists do not fit the positions.

Flutter: ui/painting.dart Vertices

func (*Vertices) Colors

func (v *Vertices) Colors() []Color

Colors returns a copy of the vertex colors, or nil when there are none.

Flutter: ui/painting.dart Vertices

func (*Vertices) Dispose

func (v *Vertices) Dispose()

Dispose releases the vertices. It does nothing in this implementation, which holds no native resources.

Flutter: ui/painting.dart Vertices.dispose

func (*Vertices) Indices

func (v *Vertices) Indices() []uint16

Indices returns a copy of the indices, or nil when there are none.

Flutter: ui/painting.dart Vertices

func (*Vertices) Mode

func (v *Vertices) Mode() VertexMode

Mode is how the vertices are joined into triangles.

Flutter: ui/painting.dart Vertices

func (*Vertices) Positions

func (v *Vertices) Positions() []Offset

Positions returns a copy of the vertex positions.

Flutter: ui/painting.dart Vertices

func (*Vertices) TextureCoordinates

func (v *Vertices) TextureCoordinates() []Offset

TextureCoordinates returns a copy of the texture coordinates, or nil when there are none.

Flutter: ui/painting.dart Vertices

type VerticesOpts

type VerticesOpts struct {
	// Colors are the colors at the vertices, as many as the positions, or nil.
	Colors []Color
	// TextureCoordinates are the points of the shader's image to use at the
	// vertices, as many as the positions, or nil.
	TextureCoordinates []Offset
	// Indices pick the positions to build the triangles from; nil means the
	// positions in order. Each index is less than the number of positions, and
	// at most 65535.
	Indices []int
}

VerticesOpts are the optional arguments of NewVertices.

Flutter: ui/painting.dart Vertices

type View

type View struct {
	// contains filtered or unexported fields
}

View is one top-level surface that the app renders into, such as a window. The dispatcher makes views; the platform sets their configuration.

Flutter: ui/window.dart FlutterView

func (*View) Destroyed

func (v *View) Destroyed() bool

Destroyed is whether the window of the view was destroyed. Rendering into a destroyed view does nothing.

Flutter: no counterpart

func (*View) DevicePixelRatio

func (v *View) DevicePixelRatio() float64

DevicePixelRatio is the number of physical pixels per logical pixel.

Flutter: ui/window.dart FlutterView.devicePixelRatio

func (*View) Display

func (v *View) Display() Display

Display is the display the view is on.

Flutter: ui/window.dart FlutterView.display

func (*View) GestureSettings

func (v *View) GestureSettings() GestureSettings

GestureSettings are the platform's gesture thresholds, in physical pixels.

Flutter: ui/window.dart FlutterView.gestureSettings

func (*View) KeepScreenOn

func (v *View) KeepScreenOn(on bool) error

KeepScreenOn stops the screen from going idle while the window is visible, or, with false, lets it; see PlatformDispatcher.KeepScreenOn.

Flutter: no counterpart

func (*View) Padding

func (v *View) Padding() ViewPadding

Padding is the area the app should avoid: ViewPadding minus ViewInsets, in physical pixels.

Flutter: ui/window.dart FlutterView.padding

func (*View) PerformWindowAction

func (v *View) PerformWindowAction(action WindowAction)

PerformWindowAction asks the window of the view to do the action: the way a title bar that the app draws moves, resizes, minimizes, maximizes or closes it.

Flutter: no counterpart

func (*View) PhysicalConstraints

func (v *View) PhysicalConstraints() ViewConstraints

PhysicalConstraints are the limits on the size of the view, in physical pixels; tight around PhysicalSize unless the platform says otherwise.

Flutter: ui/window.dart FlutterView.physicalConstraints

func (*View) PhysicalSize

func (v *View) PhysicalSize() Size

PhysicalSize is the size of the view in physical pixels.

Flutter: ui/window.dart FlutterView.physicalSize

func (*View) PlatformDispatcher

func (v *View) PlatformDispatcher() *PlatformDispatcher

PlatformDispatcher is the dispatcher that owns the view.

Flutter: ui/window.dart FlutterView.platformDispatcher

func (*View) Render

func (v *View) Render(scene *Scene) error

Render draws the scene into the view. Call it from OnDrawFrame, at most once per frame (the last scene wins). It returns the renderer's error, such as a lost GPU context; a dispatcher without an engine behind it returns PlatformHostMissing.

Flutter: ui/window.dart FlutterView.render

func (*View) SetContentType

func (v *View) SetContentType(contentType ContentType)

SetContentType tells the compositor what the window of the view shows.

Flutter: no counterpart

func (*View) SetIcon

func (v *View) SetIcon(icon WindowIcon) error

SetIcon sets the icon of the window of the view; see PlatformDispatcher.SetWindowIcon.

Flutter: no counterpart

func (*View) SystemGestureInsets

func (v *View) SystemGestureInsets() ViewPadding

SystemGestureInsets is the area where the system handles gestures, in physical pixels.

Flutter: ui/window.dart FlutterView.systemGestureInsets

func (*View) UpdateSemantics

func (v *View) UpdateSemantics(update *SemanticsUpdate)

UpdateSemantics gives the engine the changes to the semantics tree of the view. A host that does not take part in semantics ignores it.

Flutter: ui/window.dart FlutterView.updateSemantics

func (*View) ViewID

func (v *View) ViewID() ViewID

ViewID is the ID of the view.

Flutter: ui/window.dart FlutterView.viewId

func (*View) ViewInsets

func (v *View) ViewInsets() ViewPadding

ViewInsets is the area covered by system UI the app can draw below, in physical pixels.

Flutter: ui/window.dart FlutterView.viewInsets

func (*View) ViewPadding

func (v *View) ViewPadding() ViewPadding

ViewPadding is the area of the view that the system covers or that is not usable, in physical pixels.

Flutter: ui/window.dart FlutterView.viewPadding

func (*View) Window

func (v *View) Window() WindowInfo

Window is what the platform says about the decorations and the state of the window that the view shows: who draws the title bar, what the user may do with the window, and whether it is maximized or has the focus.

Flutter: no counterpart

type ViewConfiguration

type ViewConfiguration struct {
	// PhysicalSize is the size of the view in physical pixels.
	PhysicalSize Size
	// DevicePixelRatio is the number of physical pixels per logical pixel; 0
	// means 1.
	DevicePixelRatio float64
	// ViewPadding is the area of the view that the system covers or that is
	// not usable (an unsafe area), in physical pixels.
	ViewPadding ViewPadding
	// ViewInsets is the area covered by the system UI that the app can still
	// draw below, such as an on-screen keyboard.
	ViewInsets ViewPadding
	// SystemGestureInsets is the area where the system handles gestures.
	SystemGestureInsets ViewPadding
	// Padding is ViewPadding minus ViewInsets: the area the app should avoid.
	Padding ViewPadding
	// PhysicalConstraints limits the size of the view; the zero value allows
	// only PhysicalSize.
	PhysicalConstraints ViewConstraints
	// Display is the display the view is on.
	Display Display
	// GestureSettings are the platform's gesture thresholds.
	GestureSettings GestureSettings
	// Window is what the platform says about the decorations and the state of the
	// window of the view.
	Window WindowInfo
}

ViewConfiguration is the size, scale and system areas of a view, as the platform reports them. The engine hands one to the dispatcher whenever it changes.

Flutter: ui/window.dart _ViewConfiguration

type ViewConstraints

type ViewConstraints struct {
	// MinWidth is the smallest width the view can have.
	MinWidth float64
	// MaxWidth is the largest width the view can have.
	MaxWidth float64
	// MinHeight is the smallest height the view can have.
	MinHeight float64
	// MaxHeight is the largest height the view can have.
	MaxHeight float64
}

ViewConstraints are the limits, in physical pixels, on the size of a view.

Flutter: ui/window.dart ViewConstraints

func NewViewConstraintsTight

func NewViewConstraintsTight(size Size) ViewConstraints

NewViewConstraintsTight creates constraints that allow only the given size.

Flutter: ui/window.dart ViewConstraints.tight

type ViewFocusDirection

type ViewFocusDirection int

ViewFocusDirection is the direction of a focus change between views.

Flutter: ui/platform_dispatcher.dart ViewFocusDirection

const (
	// ViewFocusDirectionUndefined is a focus change with no direction, as when the
	// user clicks the window.
	//
	// Flutter: ui/platform_dispatcher.dart ViewFocusDirection.undefined
	ViewFocusDirectionUndefined ViewFocusDirection = iota
	// ViewFocusDirectionForward is a focus change that moves to the next widget.
	//
	// Flutter: ui/platform_dispatcher.dart ViewFocusDirection.forward
	ViewFocusDirectionForward
	// ViewFocusDirectionBackward is a focus change that moves to the previous
	// widget.
	//
	// Flutter: ui/platform_dispatcher.dart ViewFocusDirection.backward
	ViewFocusDirectionBackward
)

The values of ViewFocusDirection.

type ViewFocusEvent

type ViewFocusEvent struct {
	// ViewID is the view whose focus changed.
	ViewID ViewID
	// State is whether the view has the focus now.
	State ViewFocusState
	// Direction is where the focus came from.
	Direction ViewFocusDirection
}

ViewFocusEvent says that a view got or lost the focus.

Flutter: ui/platform_dispatcher.dart ViewFocusEvent

type ViewFocusHost

type ViewFocusHost interface {
	// RequestViewFocus asks for the window of the view to get or lose the focus.
	RequestViewFocus(view ViewID, state ViewFocusState, direction ViewFocusDirection)
}

ViewFocusHost is what the engine implements to give the focus to a native window when the framework moves the focus into its view.

Flutter: ui/platform_dispatcher.dart PlatformDispatcher.requestViewFocusChange

type ViewFocusState

type ViewFocusState int

ViewFocusState is whether a view has the focus.

Flutter: ui/platform_dispatcher.dart ViewFocusState

const (
	// ViewFocusStateUnfocused is a view that lost the focus.
	//
	// Flutter: ui/platform_dispatcher.dart ViewFocusState.unfocused
	ViewFocusStateUnfocused ViewFocusState = iota
	// ViewFocusStateFocused is a view that has the focus.
	//
	// Flutter: ui/platform_dispatcher.dart ViewFocusState.focused
	ViewFocusStateFocused
)

The values of ViewFocusState.

type ViewID

type ViewID int64

ViewID identifies a View: one top-level surface that the engine renders into, such as a window. The first view is the implicit view and has ID 0.

Flutter: ui/window.dart FlutterView.viewId

const ImplicitViewID ViewID = 0

ImplicitViewID is the ID of the implicit view, the first view that exists when the app starts.

Flutter: ui/window.dart PlatformDispatcher.implicitView

type ViewPadding

type ViewPadding struct {
	// Left is the distance from the left edge.
	Left float64
	// Top is the distance from the top edge.
	Top float64
	// Right is the distance from the right edge.
	Right float64
	// Bottom is the distance from the bottom edge.
	Bottom float64
}

ViewPadding is a set of four distances, in physical pixels, from the edges of a view: the areas that the system covers (or that the app should avoid).

Flutter: ui/window.dart ViewPadding

type WindowAction

type WindowAction struct {
	// Kind is what to do.
	Kind WindowActionKind
	// Edge is the edge that WindowActionResize drags.
	Edge ResizeEdge
	// Position is where WindowActionShowMenu opens the menu, in logical pixels of
	// the window.
	Position Offset
}

WindowAction is a request of a title bar that the app draws.

Flutter: no counterpart

type WindowActionKind

type WindowActionKind int

WindowActionKind is what a title bar asks the window to do.

Flutter: no counterpart

const (
	// WindowActionMove starts moving the window with the pointer that is down.
	//
	// Flutter: no counterpart
	WindowActionMove WindowActionKind = iota
	// WindowActionResize starts resizing the window from an edge.
	//
	// Flutter: no counterpart
	WindowActionResize
	// WindowActionShowMenu shows the window menu at a position.
	//
	// Flutter: no counterpart
	WindowActionShowMenu
	// WindowActionMinimize minimizes the window.
	//
	// Flutter: no counterpart
	WindowActionMinimize
	// WindowActionMaximize maximizes the window.
	//
	// Flutter: no counterpart
	WindowActionMaximize
	// WindowActionRestore restores a maximized window.
	//
	// Flutter: no counterpart
	WindowActionRestore
	// WindowActionClose asks to close the window, as the user's close button does.
	//
	// Flutter: no counterpart
	WindowActionClose
	// WindowActionFullscreen makes the window fullscreen.
	//
	// Flutter: widgets/_window.dart RegularWindowController.setFullscreen
	WindowActionFullscreen
	// WindowActionUnfullscreen takes the window out of fullscreen.
	//
	// Flutter: widgets/_window.dart RegularWindowController.setFullscreen
	WindowActionUnfullscreen
	// WindowActionActivate asks for the window to be shown at its size and position,
	// out of the minimized state, and to get the focus. The platform may refuse the
	// focus and the stacking order.
	//
	// Flutter: widgets/_window.dart RegularWindowController.activate
	WindowActionActivate
)

The values of WindowActionKind.

type WindowAppearanceHost

type WindowAppearanceHost interface {
	// SetWindowIcon sets the icon of the window of the view. An empty icon removes it.
	SetWindowIcon(view ViewID, icon WindowIcon) error
	// SetWindowContentType gives the compositor a hint about what the window shows.
	SetWindowContentType(view ViewID, contentType ContentType)
}

WindowAppearanceHost is what the engine implements to change what a window looks like to the desktop. A host without it ignores the changes.

Flutter: no counterpart

type WindowCapabilities

type WindowCapabilities struct {
	// WindowMenu is whether the window can show the window menu.
	WindowMenu bool
	// Maximize is whether the window can be maximized.
	Maximize bool
	// Fullscreen is whether the window can be made fullscreen.
	Fullscreen bool
	// Minimize is whether the window can be minimized.
	Minimize bool
}

WindowCapabilities are the things that the compositor lets the user do with a window, as xdg_toplevel.wm_capabilities reports them. The zero value is "nothing"; WindowInfo says whether the compositor reported them at all.

Flutter: no counterpart

type WindowControlHost

type WindowControlHost interface {
	// CreateWindow creates a window and its view. It returns the ID of the view and
	// its configuration until the platform reports the real one.
	CreateWindow(spec WindowSpec) (ViewID, ViewConfiguration, error)
	// DestroyWindow destroys the window of the view. It is not an error to destroy
	// a window twice.
	DestroyWindow(view ViewID)
	// SetWindowTitle sets the title of the window of the view.
	SetWindowTitle(view ViewID, title string)
	// SetWindowSize asks for a new content size in logical pixels.
	SetWindowSize(view ViewID, size Size)
	// SetWindowConstraints sets the smallest and the largest content size in
	// logical pixels; zero means no limit.
	SetWindowConstraints(view ViewID, min, max Size)
	// SetWindowHidden takes the window of the view off the screen (true), or puts
	// it back (false). A hidden window still exists.
	SetWindowHidden(view ViewID, hidden bool)
}

WindowControlHost is what the engine implements to create, change and destroy the windows that the framework asks for (widgets/_window.dart). A host without it makes CreateWindow fail with WindowingUnsupported.

Flutter: widgets/_window.dart WindowingOwner

type WindowHost

type WindowHost interface {
	// PerformWindowAction does the action for the window of the view. Moves and
	// resizes need the input event that is going on (the last pointer press), so
	// call it from the handler of that event.
	PerformWindowAction(view ViewID, action WindowAction)
}

WindowHost is what the engine implements to carry out the actions of a title bar that the app draws. A host without it ignores them.

Flutter: no counterpart (the window controller of widgets/_window.dart)

type WindowIcon

type WindowIcon struct {
	// Name is the name of an icon of the icon theme, such as "text-editor".
	Name string
	// Images are the pictures of the icon, one for each size.
	Images []WindowIconImage
}

WindowIcon is the icon of a window: the name of an icon of the icon theme, pictures, or both. The compositor uses the name first when it knows the icon. The zero value is no icon: the window gets its icon from the app's .desktop file.

Flutter: no counterpart

func (WindowIcon) IsZero

func (i WindowIcon) IsZero() bool

IsZero is whether the icon is empty.

Flutter: no counterpart

func (WindowIcon) Validate

func (i WindowIcon) Validate() error

Validate checks the pictures of the icon. It fails with WindowIconInvalid (metadata "index") when a picture is not square, has a negative scale, or does not have Size*Size*4 bytes.

Flutter: no counterpart

type WindowIconImage

type WindowIconImage struct {
	// Size is the width and the height of the picture in pixels; the picture is
	// square.
	Size int
	// Scale is the scale of the picture; the icon is Size/Scale logical pixels
	// wide. The default, for zero, is 1.
	Scale int
	// RGBA holds Size*Size*4 bytes: the rows from the top, each pixel as red,
	// green, blue and alpha, with the color not premultiplied by the alpha.
	RGBA []byte
}

WindowIconImage is one picture of a window icon.

Flutter: no counterpart

type WindowInfo

type WindowInfo struct {
	// Decoration is who draws the title bar.
	Decoration DecorationMode
	// Capabilities are what the user may do with the window.
	Capabilities WindowCapabilities
	// Title is the title of the window.
	Title string
	// Maximized is whether the window fills the work area.
	Maximized bool
	// Fullscreen is whether the window fills the screen.
	Fullscreen bool
	// Activated is whether the window has the keyboard focus.
	Activated bool
	// Minimized is whether the window is minimized (iconified). Only the X11 backend
	// knows: xdg-shell does not say, so a Wayland window never reports it.
	Minimized bool
	// Tiled is whether the compositor tiles the window: its edges touch other
	// windows or the screen, so it has no borders to resize from.
	Tiled bool
}

WindowInfo is what the platform tells about the decorations and the state of a window. A title bar that the app draws needs all of it.

Flutter: no counterpart

type WindowKind

type WindowKind int

WindowKind is the kind of a window that the framework creates.

Flutter: widgets/_window.dart WindowArchetype

const (
	// WindowKindRegular is an ordinary top-level window.
	//
	// Flutter: widgets/_window.dart WindowArchetype.regular
	WindowKindRegular WindowKind = iota
	// WindowKindDialog is a dialog, modal to its parent when it has one.
	//
	// Flutter: widgets/_window.dart WindowArchetype.dialog
	WindowKindDialog
)

The values of WindowKind.

type WindowSpec

type WindowSpec struct {
	// Kind is the kind of window.
	Kind WindowKind
	// Title is the title of the window.
	Title string
	// Size is the initial size of the content in logical pixels; zero lets the
	// platform choose.
	Size Size
	// MinSize is the smallest size in logical pixels; zero means no minimum.
	MinSize Size
	// MaxSize is the largest size in logical pixels; zero means no maximum.
	MaxSize Size
	// NotResizable is true for a window the user cannot resize.
	NotResizable bool
	// Parent is the view of the parent of a dialog, when HasParent is true.
	Parent ViewID
	// HasParent is whether the window has a parent. A dialog with a parent is modal
	// to it and closes with it.
	HasParent bool
	// AppDecorations is true when the app draws the title bar of the window, so the
	// platform does not ask the compositor or libdecor for one.
	AppDecorations bool
	// Icon is the icon of the window; the zero value is none.
	Icon WindowIcon
	// ContentType is the hint about what the window shows.
	ContentType ContentType
	// State is the state the window is created in; the platform creates it in that
	// state, so it never shows at its size first. The zero value is a normal window.
	State WindowStartState
}

WindowSpec describes a window that the framework asks the engine to create.

Flutter: widgets/_window.dart WindowingOwner.createRegularWindowController

type WindowStartState

type WindowStartState int

WindowStartState is the state a window is created in (WindowSpec.State).

Flutter: no counterpart

const (
	// WindowStartStateUnspecified is the zero value and means WindowStartStateNormal.
	//
	// Flutter: no counterpart
	WindowStartStateUnspecified WindowStartState = iota
	// WindowStartStateNormal is a window that is neither maximized, minimized nor
	// fullscreen.
	//
	// Flutter: no counterpart
	WindowStartStateNormal
	// WindowStartStateMaximized is a maximized window.
	//
	// Flutter: no counterpart
	WindowStartStateMaximized
	// WindowStartStateMinimized is a minimized window.
	//
	// Flutter: no counterpart
	WindowStartStateMinimized
	// WindowStartStateFullscreen is a fullscreen window.
	//
	// Flutter: no counterpart
	WindowStartStateFullscreen
)

The values of WindowStartState.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL