painting

package
v1.17.13 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: BSD-3-Clause Imports: 23 Imported by: 2 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 painting provides the painting building blocks above the engine: EdgeInsets, BoxDecoration, borders, TextPainter and ImageProvider.

Flutter: package:flutter/painting.dart.

Index

Constants

View Source
const (
	// StrokeAlignInside places the stroke inside of the border path.
	//
	// Flutter: painting/borders.dart BorderSide.strokeAlignInside
	StrokeAlignInside = -1.0
	// StrokeAlignCenter centers the stroke on the border path.
	//
	// Flutter: painting/borders.dart BorderSide.strokeAlignCenter
	StrokeAlignCenter = 0.0
	// StrokeAlignOutside places the stroke outside of the border path.
	//
	// Flutter: painting/borders.dart BorderSide.strokeAlignOutside
	StrokeAlignOutside = 1.0
)

The values of BorderSide.StrokeAlign.

View Source
const DefaultFontSize = 14.0

DefaultFontSize is the font size of text that doesn't give one, in logical pixels.

Flutter: painting/text_painter.dart kDefaultFontSize

View Source
const PlaceholderCodeUnit = 0xFFFC

PlaceholderCodeUnit is the object replacement character that stands for a placeholder in the text of a paragraph.

Flutter: painting/placeholder_span.dart PlaceholderSpan.placeholderCodeUnit

Variables

View Source
var (
	// AlignmentTopLeft is the top left corner.
	//
	// Flutter: painting/alignment.dart Alignment.topLeft
	AlignmentTopLeft = Alignment{-1, -1}
	// AlignmentTopCenter is the center point along the top edge.
	//
	// Flutter: painting/alignment.dart Alignment.topCenter
	AlignmentTopCenter = Alignment{0, -1}
	// AlignmentTopRight is the top right corner.
	//
	// Flutter: painting/alignment.dart Alignment.topRight
	AlignmentTopRight = Alignment{1, -1}
	// AlignmentCenterLeft is the center point along the left edge.
	//
	// Flutter: painting/alignment.dart Alignment.centerLeft
	AlignmentCenterLeft = Alignment{-1, 0}
	// AlignmentCenter is the center point, both horizontally and vertically.
	//
	// Flutter: painting/alignment.dart Alignment.center
	AlignmentCenter = Alignment{0, 0}
	// AlignmentCenterRight is the center point along the right edge.
	//
	// Flutter: painting/alignment.dart Alignment.centerRight
	AlignmentCenterRight = Alignment{1, 0}
	// AlignmentBottomLeft is the bottom left corner.
	//
	// Flutter: painting/alignment.dart Alignment.bottomLeft
	AlignmentBottomLeft = Alignment{-1, 1}
	// AlignmentBottomCenter is the center point along the bottom edge.
	//
	// Flutter: painting/alignment.dart Alignment.bottomCenter
	AlignmentBottomCenter = Alignment{0, 1}
	// AlignmentBottomRight is the bottom right corner.
	//
	// Flutter: painting/alignment.dart Alignment.bottomRight
	AlignmentBottomRight = Alignment{1, 1}
)

The nine alignments of a rectangle.

View Source
var (
	// AlignmentDirectionalTopStart is the top corner on the start side.
	//
	// Flutter: painting/alignment.dart AlignmentDirectional.topStart
	AlignmentDirectionalTopStart = AlignmentDirectional{-1, -1}
	// AlignmentDirectionalTopCenter is the center point along the top edge.
	//
	// Flutter: painting/alignment.dart AlignmentDirectional.topCenter
	AlignmentDirectionalTopCenter = AlignmentDirectional{0, -1}
	// AlignmentDirectionalTopEnd is the top corner on the end side.
	//
	// Flutter: painting/alignment.dart AlignmentDirectional.topEnd
	AlignmentDirectionalTopEnd = AlignmentDirectional{1, -1}
	// AlignmentDirectionalCenterStart is the center point along the start edge.
	//
	// Flutter: painting/alignment.dart AlignmentDirectional.centerStart
	AlignmentDirectionalCenterStart = AlignmentDirectional{-1, 0}
	// AlignmentDirectionalCenter is the center point.
	//
	// Flutter: painting/alignment.dart AlignmentDirectional.center
	AlignmentDirectionalCenter = AlignmentDirectional{0, 0}
	// AlignmentDirectionalCenterEnd is the center point along the end edge.
	//
	// Flutter: painting/alignment.dart AlignmentDirectional.centerEnd
	AlignmentDirectionalCenterEnd = AlignmentDirectional{1, 0}
	// AlignmentDirectionalBottomStart is the bottom corner on the start side.
	//
	// Flutter: painting/alignment.dart AlignmentDirectional.bottomStart
	AlignmentDirectionalBottomStart = AlignmentDirectional{-1, 1}
	// AlignmentDirectionalBottomCenter is the center point along the bottom edge.
	//
	// Flutter: painting/alignment.dart AlignmentDirectional.bottomCenter
	AlignmentDirectionalBottomCenter = AlignmentDirectional{0, 1}
	// AlignmentDirectionalBottomEnd is the bottom corner on the end side.
	//
	// Flutter: painting/alignment.dart AlignmentDirectional.bottomEnd
	AlignmentDirectionalBottomEnd = AlignmentDirectional{1, 1}
)

The nine directional alignments of a rectangle.

View Source
var (
	// TextAlignVerticalTop aligns to the top.
	//
	// Flutter: painting/alignment.dart TextAlignVertical.top
	TextAlignVerticalTop = TextAlignVertical{-1}
	// TextAlignVerticalCenter aligns to the center.
	//
	// Flutter: painting/alignment.dart TextAlignVertical.center
	TextAlignVerticalCenter = TextAlignVertical{0}
	// TextAlignVerticalBottom aligns to the bottom.
	//
	// Flutter: painting/alignment.dart TextAlignVertical.bottom
	TextAlignVerticalBottom = TextAlignVertical{1}
)

The three standard vertical alignments.

View Source
var (
	// FractionalOffsetTopLeft is the top left corner.
	//
	// Flutter: painting/fractional_offset.dart FractionalOffset.topLeft
	FractionalOffsetTopLeft = NewFractionalOffset(0.0, 0.0)
	// FractionalOffsetTopCenter is the center point along the top edge.
	//
	// Flutter: painting/fractional_offset.dart FractionalOffset.topCenter
	FractionalOffsetTopCenter = NewFractionalOffset(0.5, 0.0)
	// FractionalOffsetTopRight is the top right corner.
	//
	// Flutter: painting/fractional_offset.dart FractionalOffset.topRight
	FractionalOffsetTopRight = NewFractionalOffset(1.0, 0.0)
	// FractionalOffsetCenterLeft is the center point along the left edge.
	//
	// Flutter: painting/fractional_offset.dart FractionalOffset.centerLeft
	FractionalOffsetCenterLeft = NewFractionalOffset(0.0, 0.5)
	// FractionalOffsetCenter is the center point, both horizontally and
	// vertically.
	//
	// Flutter: painting/fractional_offset.dart FractionalOffset.center
	FractionalOffsetCenter = NewFractionalOffset(0.5, 0.5)
	// FractionalOffsetCenterRight is the center point along the right edge.
	//
	// Flutter: painting/fractional_offset.dart FractionalOffset.centerRight
	FractionalOffsetCenterRight = NewFractionalOffset(1.0, 0.5)
	// FractionalOffsetBottomLeft is the bottom left corner.
	//
	// Flutter: painting/fractional_offset.dart FractionalOffset.bottomLeft
	FractionalOffsetBottomLeft = NewFractionalOffset(0.0, 1.0)
	// FractionalOffsetBottomCenter is the center point along the bottom edge.
	//
	// Flutter: painting/fractional_offset.dart FractionalOffset.bottomCenter
	FractionalOffsetBottomCenter = NewFractionalOffset(0.5, 1.0)
	// FractionalOffsetBottomRight is the bottom right corner.
	//
	// Flutter: painting/fractional_offset.dart FractionalOffset.bottomRight
	FractionalOffsetBottomRight = NewFractionalOffset(1.0, 1.0)
)

The named fractional offsets.

View Source
var BorderRadiusDirectionalZero = BorderRadiusDirectional{}

BorderRadiusDirectionalZero is a border radius with no rounding.

Flutter: painting/border_radius.dart BorderRadiusDirectional.zero

View Source
var BorderRadiusZero = BorderRadius{}

BorderRadiusZero is a border radius with no rounding.

Flutter: painting/border_radius.dart BorderRadius.zero

View Source
var BorderSideNone = BorderSide{Color: borderSideDefaultColor, Width: 0, Style: BorderStyleNone, StrokeAlign: StrokeAlignInside}

BorderSideNone is a hairline black border that is not rendered.

Flutter: painting/borders.dart BorderSide.none

View Source
var EdgeInsetsDirectionalZero = EdgeInsetsDirectional{}

EdgeInsetsDirectionalZero is an EdgeInsetsDirectional with zero offsets in each direction.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.zero

View Source
var EdgeInsetsZero = EdgeInsets{}

EdgeInsetsZero is an EdgeInsets with zero offsets in each direction.

Flutter: painting/edge_insets.dart EdgeInsets.zero

View Source
var ImageConfigurationEmpty = ImageConfiguration{}

ImageConfigurationEmpty is an image configuration that provides no additional information.

Flutter: painting/image_provider.dart ImageConfiguration.empty

View Source
var LinearBorderNone = NewLinearBorder()

LinearBorderNone is a border without any visible sides.

Flutter: painting/linear_border.dart LinearBorder.none

Functions

func AxisDirectionIsReversed

func AxisDirectionIsReversed(d AxisDirection) bool

AxisDirectionIsReversed reports whether the direction runs against the reading order (up and left).

Flutter: painting/basic_types.dart axisDirectionIsReversed

func BorderSideCanMerge

func BorderSideCanMerge(a, b BorderSide) bool

BorderSideCanMerge reports whether a and b can be merged by BorderSideMerge: one of them is BorderSideNone-like, or they have the same style and color.

Flutter: painting/borders.dart BorderSide.canMerge

func ClipPathAndPaint

func ClipPathAndPaint(c ClipContext, path *ui.Path, clipBehavior ui.Clip, bounds ui.Rect, painter func())

ClipPathAndPaint clips the canvas to the path and calls painter, as the clip behavior says.

Flutter: painting/clip.dart ClipContext.clipPathAndPaint

func ClipRRectAndPaint

func ClipRRectAndPaint(c ClipContext, rrect ui.RRect, clipBehavior ui.Clip, bounds ui.Rect, painter func())

ClipRRectAndPaint clips the canvas to the rounded rectangle and calls painter, as the clip behavior says.

Flutter: painting/clip.dart ClipContext.clipRRectAndPaint

func ClipRSuperellipseAndPaint

func ClipRSuperellipseAndPaint(c ClipContext, rse ui.RSuperellipse, clipBehavior ui.Clip, bounds ui.Rect, painter func())

ClipRSuperellipseAndPaint clips the canvas to the rounded superellipse and calls painter, as the clip behavior says.

Flutter: painting/clip.dart ClipContext.clipRSuperellipseAndPaint

func ClipRectAndPaint

func ClipRectAndPaint(c ClipContext, rect ui.Rect, clipBehavior ui.Clip, bounds ui.Rect, painter func())

ClipRectAndPaint clips the canvas to the rectangle and calls painter, as the clip behavior says.

Flutter: painting/clip.dart ClipContext.clipRectAndPaint

func DebugDescribeTransform

func DebugDescribeTransform(transform *ui.Matrix4) []string

DebugDescribeTransform describes a transform as four lines of four numbers; a nil transform is "null".

Flutter: painting/matrix_utils.dart debugDescribeTransform

func DecorationsEqual

func DecorationsEqual(a, b Decoration) bool

DecorationsEqual is Dart's == of two decorations, which Go's == of two interface values is not: that compares the pointers, and a build makes a new decoration each time. A BoxDecoration, a ShapeDecoration and a FlutterLogoDecoration are compared by their Equal; a decoration of another type that has a method Equal(Decoration) bool is asked; any other is equal only to itself, as a Dart class without operator == is. Two nil decorations are equal.

Flutter: no counterpart (Decoration.operator ==)

func ImageProviderEvict

func ImageProviderEvict(binding *PaintingBinding, p ImageProvider, cache *ImageCache, configuration ImageConfiguration) (bool, error)

ImageProviderEvict evicts an entry from the image cache, the default cache of the binding if cache is nil.

Flutter: painting/image_provider.dart ImageProvider.evict

func ImageProviderResolveStreamForKey

func ImageProviderResolveStreamForKey(binding *PaintingBinding, p ImageProvider, configuration ImageConfiguration,
	stream *ImageStream, key any, handleError ImageErrorListener)

ImageProviderResolveStreamForKey called by ImageProviderResolve after the key is obtained: it finds the completer in the cache, or loads the image, and sets it on the stream.

Flutter: painting/image_provider.dart ImageProvider.resolveStreamForKey

func InlineSpanCodeUnitAt

func InlineSpanCodeUnitAt(s InlineSpan, index int) (byte, bool)

InlineSpanCodeUnitAt returns the code unit (UTF-8 byte) at the offset of the span's text, and false if there is none.

Flutter: painting/inline_span.dart InlineSpan.codeUnitAt

func InlineSpanToPlainText

func InlineSpanToPlainText(s InlineSpan, opts ...ToPlainTextOpts) string

InlineSpanToPlainText returns the text of the span and its descendants.

Flutter: painting/inline_span.dart InlineSpan.toPlainText

func LinearBorderEdgeLerp

func LinearBorderEdgeLerp(a, b foundation.Opt[LinearBorderEdge], t float64) foundation.Opt[LinearBorderEdge]

LinearBorderEdgeLerp linearly interpolates between two edges; a missing edge is taken as an empty one with the other's alignment.

Flutter: painting/linear_border.dart LinearBorderEdge.lerp

func NewColorProperty

NewColorProperty creates a diagnostics property for a color; None is Dart's null.

Flutter: painting/colors.dart ColorProperty

func NewTransformProperty

func NewTransformProperty(name string, value *ui.Matrix4, opts ...foundation.DiagnosticsPropertyOpts) *foundation.DiagnosticsProperty

NewTransformProperty creates a diagnostics property for a transform; a nil transform is Dart's null. It is drawn in one line, as rows split by semicolons, where the parent does not break lines between properties, and in four lines otherwise.

Flutter: painting/matrix_utils.dart TransformProperty

func PaintBorder

func PaintBorder(canvas *ui.Canvas, rect ui.Rect, opts ...BorderPaintOpts)

PaintBorder paints a border around the given rectangle on the canvas. The four sides can have different colors, and the corners are mitered.

Flutter: painting/borders.dart paintBorder

func PaintImage

func PaintImage(canvas *ui.Canvas, rect ui.Rect, image *ui.Image, opts ...PaintImageOpts)

PaintImage paints an image into the given rectangle on the canvas. In debug builds a CenterSlice with a fit of none or cover panics with the tag PaintImageCenterSliceFit, and a fit that doesn't show the whole image with a CenterSlice with PaintImageCenterSliceCropped. A disposed image panics with the tag PaintImageDisposed.

Flutter: painting/decoration_image.dart paintImage

func PaintNonUniformBorder

func PaintNonUniformBorder(canvas *ui.Canvas, rect ui.Rect, o NonUniformBorderOpts)

PaintNonUniformBorder paints a border of different widths around a rectangle or a circle, with a single color.

Flutter: painting/box_border.dart BoxBorder.paintNonUniformBorder

func PaintZigZag

func PaintZigZag(canvas *ui.Canvas, paint *ui.Paint, start, end ui.Offset, zigs int, width float64)

PaintZigZag draws a zig-zag line with the given number of zigs from start to end, zigging the width to either side. In debug builds zigs below 1 panic with the tag PaintZigZagInvalid.

Flutter: painting/paint_utilities.dart paintZigZag

func PositionDependentBox

func PositionDependentBox(o PositionDependentBoxOpts) ui.Offset

PositionDependentBox positions a box of ChildSize in a container of Size so it is near the target, such as a tooltip, and returns its top left.

Flutter: painting/geometry.dart positionDependentBox

func TextPainterComputeMaxIntrinsicWidth

func TextPainterComputeMaxIntrinsicWidth(text InlineSpan, textDirection ui.TextDirection, opts ...TextPainterComputeWidthOpts) float64

TextPainterComputeMaxIntrinsicWidth returns the max intrinsic width of the text laid out in the constraints.

Flutter: painting/text_painter.dart TextPainter.computeMaxIntrinsicWidth

func TextPainterComputeWidth

func TextPainterComputeWidth(text InlineSpan, textDirection ui.TextDirection, opts ...TextPainterComputeWidthOpts) float64

TextPainterComputeWidth returns the width the text takes when laid out in the constraints.

Flutter: painting/text_painter.dart TextPainter.computeWidth

func TextPainterIsHighSurrogate

func TextPainterIsHighSurrogate(value int) bool

TextPainterIsHighSurrogate reports whether the UTF-16 code unit is a high surrogate, the first half of a pair.

Flutter: painting/text_painter.dart TextPainter.isHighSurrogate

func TextPainterIsLowSurrogate

func TextPainterIsLowSurrogate(value int) bool

TextPainterIsLowSurrogate reports whether the UTF-16 code unit is a low surrogate, the second half of a pair.

Flutter: painting/text_painter.dart TextPainter.isLowSurrogate

func TextScalerEqual

func TextScalerEqual(a, b TextScaler) bool

TextScalerEqual is Dart's == on text scalers: linear scalers are equal when their factors are, clamped ones when their limits and scalers are.

Flutter: painting/text_scaler.dart TextScaler.operator ==

Types

type Accumulator

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

Accumulator is a mutable counter that spans use to find the text offset of a span while visiting the tree. The offsets are UTF-8 byte offsets (SPEC §12.10).

Flutter: painting/inline_span.dart Accumulator

func NewAccumulator

func NewAccumulator(value int) *Accumulator

NewAccumulator creates a counter that starts at the value.

Flutter: painting/inline_span.dart Accumulator.new

func (*Accumulator) Increment

func (a *Accumulator) Increment(addend int)

Increment adds to the count. In debug builds a negative addend panics with the tag AccumulatorNegativeIncrement.

Flutter: painting/inline_span.dart Accumulator.increment

func (*Accumulator) Value

func (a *Accumulator) Value() int

Value is the count.

Flutter: painting/inline_span.dart Accumulator.value

type Alignment

type Alignment struct {
	// X is the distance fraction in the horizontal direction.
	X float64
	// Y is the distance fraction in the vertical direction.
	Y float64
}

Alignment is a point within a rectangle: (-1.0, -1.0) represents the top left of the rectangle, (1.0, 1.0) the bottom right.

Flutter: painting/alignment.dart Alignment

func AlignmentLerp

func AlignmentLerp(a, b *Alignment, t float64) *Alignment

AlignmentLerp linearly interpolates between two Alignments. Either may be nil, which counts as the center.

Flutter: painting/alignment.dart Alignment.lerp

func (Alignment) Add

Add returns the sum of the components of this and other.

Flutter: painting/alignment.dart Alignment.add

func (Alignment) AlongOffset

func (a Alignment) AlongOffset(other ui.Offset) ui.Offset

AlongOffset returns the offset that is this fraction in the distance from the top left up to the bottom right of the offset.

Flutter: painting/alignment.dart Alignment.alongOffset

func (Alignment) AlongSize

func (a Alignment) AlongSize(other ui.Size) ui.Offset

AlongSize returns the offset that is this fraction in the distance from the top left up to the bottom right of the size.

Flutter: painting/alignment.dart Alignment.alongSize

func (Alignment) Div

func (a Alignment) Div(k float64) Alignment

Div divides both components by k.

Flutter: painting/alignment.dart Alignment.operator /

func (Alignment) Equal

func (a Alignment) Equal(o AlignmentGeometry) bool

Equal reports whether the three components are equal.

Flutter: painting/alignment.dart Alignment.operator ==

func (Alignment) Inscribe

func (a Alignment) Inscribe(size ui.Size, rect ui.Rect) ui.Rect

Inscribe returns a rect of the given size, aligned within the rect.

Flutter: painting/alignment.dart Alignment.inscribe

func (Alignment) Minus

func (a Alignment) Minus(o Alignment) Alignment

Minus returns the difference of the two alignments.

Flutter: painting/alignment.dart Alignment.operator -

func (Alignment) Mod

func (a Alignment) Mod(k float64) Alignment

Mod takes the modulo k of both components.

Flutter: painting/alignment.dart Alignment.operator %

func (Alignment) Mul

func (a Alignment) Mul(k float64) Alignment

Mul scales both components by k.

Flutter: painting/alignment.dart Alignment.operator *

func (Alignment) Neg

func (a Alignment) Neg() Alignment

Neg returns the alignment with both components negated.

Flutter: painting/alignment.dart Alignment.unary-

func (Alignment) Plus

func (a Alignment) Plus(o Alignment) Alignment

Plus returns the sum of the two alignments.

Flutter: painting/alignment.dart Alignment.operator +

func (Alignment) Resolve

func (a Alignment) Resolve(ui.TextDirection) Alignment

Resolve returns the alignment itself: it does not depend on the direction.

Flutter: painting/alignment.dart Alignment.resolve

func (Alignment) String

func (a Alignment) String() string

String describes the alignment, such as "Alignment.topLeft".

Flutter: painting/alignment.dart Alignment.toString

func (Alignment) TruncDiv

func (a Alignment) TruncDiv(k float64) Alignment

TruncDiv integer-divides both components by k.

Flutter: painting/alignment.dart Alignment.operator ~/

func (Alignment) WithinRect

func (a Alignment) WithinRect(rect ui.Rect) ui.Offset

WithinRect returns the point that is this fraction in the distance from the top left up to the bottom right of the rect.

Flutter: painting/alignment.dart Alignment.withinRect

type AlignmentDirectional

type AlignmentDirectional struct {
	// Start is the distance fraction in the horizontal direction.
	Start float64
	// Y is the distance fraction in the vertical direction.
	Y float64
}

AlignmentDirectional is an offset that's expressed as a fraction of a Size, but whose horizontal component is dependent on the writing direction.

Flutter: painting/alignment.dart AlignmentDirectional

func AlignmentDirectionalLerp

func AlignmentDirectionalLerp(a, b *AlignmentDirectional, t float64) *AlignmentDirectional

AlignmentDirectionalLerp linearly interpolates between two AlignmentDirectionals. Either may be nil, which counts as the center.

Flutter: painting/alignment.dart AlignmentDirectional.lerp

func (AlignmentDirectional) Add

Add returns the sum of the components of this and other.

Flutter: painting/alignment.dart AlignmentDirectional.add

func (AlignmentDirectional) Div

Div divides both components by k.

Flutter: painting/alignment.dart AlignmentDirectional.operator /

func (AlignmentDirectional) Equal

Equal reports whether the three components are equal.

Flutter: painting/alignment.dart AlignmentDirectional.operator ==

func (AlignmentDirectional) Minus

Minus returns the difference of the two alignments.

Flutter: painting/alignment.dart AlignmentDirectional.operator -

func (AlignmentDirectional) Mod

Mod takes the modulo k of both components.

Flutter: painting/alignment.dart AlignmentDirectional.operator %

func (AlignmentDirectional) Mul

Mul scales both components by k.

Flutter: painting/alignment.dart AlignmentDirectional.operator *

func (AlignmentDirectional) Neg

Neg returns the alignment with both components negated.

Flutter: painting/alignment.dart AlignmentDirectional.unary-

func (AlignmentDirectional) Plus

Plus returns the sum of the two alignments.

Flutter: painting/alignment.dart AlignmentDirectional.operator +

func (AlignmentDirectional) Resolve

func (a AlignmentDirectional) Resolve(direction ui.TextDirection) Alignment

Resolve returns an Alignment for the text direction.

Flutter: painting/alignment.dart AlignmentDirectional.resolve

func (AlignmentDirectional) String

func (a AlignmentDirectional) String() string

String describes the alignment, such as "AlignmentDirectional.topStart".

Flutter: painting/alignment.dart AlignmentDirectional.toString

func (AlignmentDirectional) TruncDiv

TruncDiv integer-divides both components by k.

Flutter: painting/alignment.dart AlignmentDirectional.operator ~/

type AlignmentGeometry

type AlignmentGeometry interface {
	// Add returns the sum of the components of this and other.
	Add(other AlignmentGeometry) AlignmentGeometry
	// Resolve returns an Alignment for the text direction. A directional value
	// panics with the tag TextDirectionRequired in debug builds if the
	// direction is unspecified.
	Resolve(direction ui.TextDirection) Alignment
	// Equal reports whether the three components are equal.
	Equal(other AlignmentGeometry) bool
	String() string
	// contains filtered or unexported methods
}

AlignmentGeometry is a base class for Alignment and AlignmentDirectional, representing a point in a rectangle. Its covariant operations (Neg, Mul, Div, TruncDiv and Mod) are the functions AlignmentGeometryNeg, … and the methods of the concrete types.

Flutter: painting/alignment.dart AlignmentGeometry

func AlignmentGeometryDiv

func AlignmentGeometryDiv(g AlignmentGeometry, k float64) AlignmentGeometry

AlignmentGeometryDiv divides every component by k.

Flutter: painting/alignment.dart AlignmentGeometry.operator /

func AlignmentGeometryLerp

func AlignmentGeometryLerp(a, b AlignmentGeometry, t float64) AlignmentGeometry

AlignmentGeometryLerp linearly interpolates between two AlignmentGeometry objects. Either may be nil, which counts as zero.

Flutter: painting/alignment.dart AlignmentGeometry.lerp

func AlignmentGeometryMod

func AlignmentGeometryMod(g AlignmentGeometry, k float64) AlignmentGeometry

AlignmentGeometryMod takes the modulo k of every component.

Flutter: painting/alignment.dart AlignmentGeometry.operator %

func AlignmentGeometryMul

func AlignmentGeometryMul(g AlignmentGeometry, k float64) AlignmentGeometry

AlignmentGeometryMul multiplies every component by k.

Flutter: painting/alignment.dart AlignmentGeometry.operator *

func AlignmentGeometryNeg

func AlignmentGeometryNeg(g AlignmentGeometry) AlignmentGeometry

AlignmentGeometryNeg negates every component.

Flutter: painting/alignment.dart AlignmentGeometry.operator -

func AlignmentGeometryTruncDiv

func AlignmentGeometryTruncDiv(g AlignmentGeometry, k float64) AlignmentGeometry

AlignmentGeometryTruncDiv integer-divides every component by k.

Flutter: painting/alignment.dart AlignmentGeometry.operator ~/

type AssetBundleImageKey

type AssetBundleImageKey struct {
	// Bundle is the bundle from which the image will be obtained.
	Bundle services.AssetBundle
	// Name is the name of the asset, such as "images/2.0x/logo.png".
	Name string
	// Scale is the scale to place in the ImageInfo.
	Scale float64
}

AssetBundleImageKey is the key used by AssetBundleImage providers: the bundle, the name of the asset and its scale.

Flutter: painting/image_provider.dart AssetBundleImageKey

func (AssetBundleImageKey) String

func (k AssetBundleImageKey) String() string

String describes the key.

Flutter: painting/image_provider.dart AssetBundleImageKey.toString

type AssetImage

type AssetImage struct {
	// AssetName is the key of the main asset.
	AssetName string
	// Bundle is the bundle to load the asset from; nil uses the configuration's,
	// then the binding's root bundle.
	Bundle services.AssetBundle
	// Package is the package the asset is in; "" for none.
	Package string
}

AssetImage fetches an image from an AssetBundle, having determined the exact image to use based on the context: the bundle has the main asset and, in sibling directories named like "2.0x", variants of other resolutions, and the one closest to the device pixel ratio of the configuration is used.

Flutter: painting/image_resolution.dart AssetImage

func NewAssetImage

func NewAssetImage(assetName string, opts ...AssetImageOpts) *AssetImage

NewAssetImage creates a provider for the asset.

Flutter: painting/image_resolution.dart AssetImage.new

func (*AssetImage) KeyName

func (a *AssetImage) KeyName() string

KeyName is the name of the asset with the package prefix.

Flutter: painting/image_resolution.dart AssetImage.keyName

func (*AssetImage) LoadImage

func (a *AssetImage) LoadImage(binding *PaintingBinding, key any, decode ImageDecoderCallback) *ImageStreamCompleter

LoadImage loads the asset of the key.

Flutter: painting/image_provider.dart AssetBundleImageProvider.loadImage

func (*AssetImage) ObtainKey

func (a *AssetImage) ObtainKey(binding *PaintingBinding, configuration ImageConfiguration) (any, error)

ObtainKey chooses the variant of the asset for the device pixel ratio of the configuration.

Flutter: painting/image_resolution.dart AssetImage.obtainKey

func (*AssetImage) String

func (a *AssetImage) String() string

String describes the provider.

Flutter: painting/image_resolution.dart AssetImage.toString

type AssetImageOpts

type AssetImageOpts struct {
	// Bundle is the bundle to load the asset from.
	Bundle services.AssetBundle
	// Package is the package the asset is in.
	Package string
}

AssetImageOpts are the optional parameters of NewAssetImage.

Flutter: painting/image_resolution.dart AssetImage.new

type AutomaticNotchedShape

type AutomaticNotchedShape struct {
	// Host is the shape of the widget that uses the notched shape. It cannot
	// depend on the text direction, as no text direction is available.
	Host ShapeBorder
}

AutomaticNotchedShape is a NotchedShape defined by a ShapeBorder: the shape of the widget that uses the notched shape, typically a BottomAppBar.

Deviation: Flutter's second ShapeBorder, the guest that is subtracted from the host to make the notch, is not ported because ui.Path has no boolean operations yet (SPEC §12.10); the guest rectangle is ignored, as it is in Flutter when the guest shape is null.

Flutter: painting/notched_shapes.dart AutomaticNotchedShape

func (AutomaticNotchedShape) GetOuterPath

func (s AutomaticNotchedShape) GetOuterPath(host ui.Rect, _ foundation.Opt[ui.Rect]) *ui.Path

GetOuterPath is the outer path of the host shape in the host rectangle.

Flutter: painting/notched_shapes.dart AutomaticNotchedShape.getOuterPath

type Axis

type Axis int

Axis is a direction along which objects are laid out. The zero value is AxisUnspecified, the default of the widget.

Flutter: painting/basic_types.dart Axis

const (
	// AxisUnspecified is the zero value: the widget's default.
	//
	// Flutter: no counterpart
	AxisUnspecified Axis = iota
	// AxisHorizontal lays objects out in the horizontal direction.
	//
	// Flutter: painting/basic_types.dart Axis.horizontal
	AxisHorizontal
	// AxisVertical lays objects out in the vertical direction.
	//
	// Flutter: painting/basic_types.dart Axis.vertical
	AxisVertical
)

The values of Axis follow Flutter's declaration order.

func AxisDirectionToAxis

func AxisDirectionToAxis(d AxisDirection) Axis

AxisDirectionToAxis returns the axis of a direction.

Flutter: painting/basic_types.dart axisDirectionToAxis

func FlipAxis

func FlipAxis(direction Axis) Axis

FlipAxis returns the other axis.

Flutter: painting/basic_types.dart flipAxis

func (Axis) Name

func (a Axis) Name() string

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

Flutter: painting/basic_types.dart Axis.name

func (Axis) String

func (a Axis) String() string

String returns the name Dart prints, such as "Axis.horizontal".

Flutter: painting/basic_types.dart Axis.toString

type AxisDirection

type AxisDirection int

AxisDirection is a direction along either the horizontal or the vertical axis.

Flutter: painting/basic_types.dart AxisDirection

const (
	// AxisDirectionUnspecified is the zero value: the widget's default.
	//
	// Flutter: no counterpart
	AxisDirectionUnspecified AxisDirection = iota
	// AxisDirectionUp is towards the top.
	//
	// Flutter: painting/basic_types.dart AxisDirection.up
	AxisDirectionUp
	// AxisDirectionRight is towards the right.
	//
	// Flutter: painting/basic_types.dart AxisDirection.right
	AxisDirectionRight
	// AxisDirectionDown is towards the bottom.
	//
	// Flutter: painting/basic_types.dart AxisDirection.down
	AxisDirectionDown
	// AxisDirectionLeft is towards the left.
	//
	// Flutter: painting/basic_types.dart AxisDirection.left
	AxisDirectionLeft
)

The values of AxisDirection follow Flutter's declaration order.

func FlipAxisDirection

func FlipAxisDirection(d AxisDirection) AxisDirection

FlipAxisDirection returns the opposite direction.

Flutter: painting/basic_types.dart flipAxisDirection

func TextDirectionToAxisDirection

func TextDirectionToAxisDirection(d ui.TextDirection) AxisDirection

TextDirectionToAxisDirection returns the axis direction in which text flows.

Flutter: painting/basic_types.dart textDirectionToAxisDirection

func (AxisDirection) Name

func (d AxisDirection) Name() string

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

Flutter: painting/basic_types.dart AxisDirection.name

func (AxisDirection) String

func (d AxisDirection) String() string

String returns the name Dart prints, such as "AxisDirection.up".

Flutter: painting/basic_types.dart AxisDirection.toString

type BeveledRectangleBorder

type BeveledRectangleBorder struct {
	ShapeBorderDefaults

	// BorderRadius is the radii for each corner; nil is BorderRadiusZero.
	BorderRadius BorderRadiusGeometry
	// contains filtered or unexported fields
}

BeveledRectangleBorder is a rectangular border with flattened or "beveled" corners.

Flutter: painting/beveled_rectangle_border.dart BeveledRectangleBorder

func NewBeveledRectangleBorder

func NewBeveledRectangleBorder(opts ...BeveledRectangleBorderOpts) BeveledRectangleBorder

NewBeveledRectangleBorder creates a beveled rectangle border.

Flutter: painting/beveled_rectangle_border.dart BeveledRectangleBorder.new

func (BeveledRectangleBorder) CopyWith

CopyWith returns a copy with the given fields replaced.

Flutter: painting/beveled_rectangle_border.dart BeveledRectangleBorder.copyWith

func (BeveledRectangleBorder) CopyWithSide

func (b BeveledRectangleBorder) CopyWithSide(side BorderSide) OutlinedBorder

CopyWithSide returns a copy with the given side.

Flutter: painting/borders.dart OutlinedBorder.copyWith

func (BeveledRectangleBorder) Dimensions

Dimensions is the stroke inset on all sides.

Flutter: painting/borders.dart OutlinedBorder.dimensions

func (BeveledRectangleBorder) GetInnerPath

func (b BeveledRectangleBorder) GetInnerPath(rect ui.Rect, td ui.TextDirection) *ui.Path

GetInnerPath is the beveled rectangle, deflated by the stroke inset.

Flutter: painting/beveled_rectangle_border.dart BeveledRectangleBorder.getInnerPath

func (BeveledRectangleBorder) GetOuterPath

func (b BeveledRectangleBorder) GetOuterPath(rect ui.Rect, td ui.TextDirection) *ui.Path

GetOuterPath is the beveled rectangle.

Flutter: painting/beveled_rectangle_border.dart BeveledRectangleBorder.getOuterPath

func (BeveledRectangleBorder) LerpFrom

LerpFrom interpolates from a BeveledRectangleBorder.

Flutter: painting/beveled_rectangle_border.dart BeveledRectangleBorder.lerpFrom

func (BeveledRectangleBorder) LerpTo

LerpTo interpolates to a BeveledRectangleBorder.

Flutter: painting/beveled_rectangle_border.dart BeveledRectangleBorder.lerpTo

func (BeveledRectangleBorder) Paint

func (b BeveledRectangleBorder) Paint(canvas *ui.Canvas, rect ui.Rect, td ui.TextDirection)

Paint strokes the border.

Flutter: painting/beveled_rectangle_border.dart BeveledRectangleBorder.paint

func (BeveledRectangleBorder) Scale

Scale scales the side and the radii by t.

Flutter: painting/beveled_rectangle_border.dart BeveledRectangleBorder.scale

func (BeveledRectangleBorder) Side

Side is the border outline's color and weight.

Flutter: painting/borders.dart OutlinedBorder.side

func (BeveledRectangleBorder) String

func (b BeveledRectangleBorder) String() string

String describes the border.

Flutter: painting/beveled_rectangle_border.dart BeveledRectangleBorder.toString

type BeveledRectangleBorderOpts

type BeveledRectangleBorderOpts = RoundedRectangleBorderOpts

BeveledRectangleBorderOpts are the optional parameters of NewBeveledRectangleBorder.

Flutter: painting/beveled_rectangle_border.dart BeveledRectangleBorder.new

type Border

type Border struct {
	// Top is the top side of this border.
	Top BorderSide
	// Right is the right side of this border.
	Right BorderSide
	// Bottom is the bottom side of this border.
	Bottom BorderSide
	// Left is the left side of this border.
	Left BorderSide
}

Border is a border of a box, comprised of four sides: the top, right, bottom, and left. A side left out of a literal is BorderSideNone.

Flutter: painting/box_border.dart Border

func BorderLerp

func BorderLerp(a, b *Border, t float64) *Border

BorderLerp linearly interpolates between two Borders. Either may be nil.

Flutter: painting/box_border.dart Border.lerp

func BorderMerge

func BorderMerge(a, b Border) Border

BorderMerge creates a border that represents the addition of the two given borders.

Flutter: painting/box_border.dart Border.merge

func NewBorderAll

func NewBorderAll(opts ...BorderSideOpts) Border

NewBorderAll creates a border whose sides are all the same.

Flutter: painting/box_border.dart Border.all

func NewBorderFromBorderSide

func NewBorderFromBorderSide(side BorderSide) Border

NewBorderFromBorderSide creates a border whose sides are all the same.

Flutter: painting/box_border.dart Border.fromBorderSide

func NewBorderSymmetric

func NewBorderSymmetric(vertical, horizontal BorderSide) Border

NewBorderSymmetric creates a border with symmetrical vertical and horizontal sides: vertical is the left and right side, horizontal the top and bottom.

Flutter: painting/box_border.dart Border.symmetric

func (Border) Add

func (b Border) Add(other ShapeBorder, reversed bool) ShapeBorder

Add merges this border with another Border when their sides can be merged; otherwise it returns nil.

Flutter: painting/box_border.dart Border.add

func (Border) BottomSide

func (b Border) BottomSide() BorderSide

BottomSide is the bottom side of this border.

Flutter: painting/box_border.dart Border.bottom

func (Border) Dimensions

func (b Border) Dimensions() EdgeInsetsGeometry

Dimensions is the widths of the sides: the stroke insets.

Flutter: painting/box_border.dart Border.dimensions

func (Border) GetInnerPath

func (b Border) GetInnerPath(rect ui.Rect, td ui.TextDirection) *ui.Path

GetInnerPath is the rect inset by the dimensions.

Flutter: painting/box_border.dart BoxBorder.getInnerPath

func (Border) GetOuterPath

func (b Border) GetOuterPath(rect ui.Rect, td ui.TextDirection) *ui.Path

GetOuterPath is the rect.

Flutter: painting/box_border.dart BoxBorder.getOuterPath

func (Border) IsUniform

func (b Border) IsUniform() bool

IsUniform reports whether all four sides are the same in color, width, style and stroke alignment.

Flutter: painting/box_border.dart Border.isUniform

func (Border) LerpFrom

func (b Border) LerpFrom(a ShapeBorder, t float64) ShapeBorder

LerpFrom interpolates from another Border.

Flutter: painting/box_border.dart Border.lerpFrom

func (Border) LerpTo

func (b Border) LerpTo(o ShapeBorder, t float64) ShapeBorder

LerpTo interpolates to another Border.

Flutter: painting/box_border.dart Border.lerpTo

func (Border) Paint

func (b Border) Paint(canvas *ui.Canvas, rect ui.Rect, td ui.TextDirection)

Paint paints the border around the rect.

Flutter: painting/box_border.dart Border.paint

func (Border) PaintBox

func (b Border) PaintBox(canvas *ui.Canvas, rect ui.Rect, opts BoxPaintOpts)

PaintBox paints the border around the rect, with a shape and a border radius.

Flutter: painting/box_border.dart Border.paint

func (Border) PaintInterior

func (b Border) PaintInterior(canvas *ui.Canvas, rect ui.Rect, paint *ui.Paint, _ ui.TextDirection)

PaintInterior fills the rect.

Flutter: painting/box_border.dart BoxBorder.paintInterior

func (Border) PreferPaintInterior

func (b Border) PreferPaintInterior() bool

PreferPaintInterior is true: filling the rect is faster than the path.

Flutter: painting/box_border.dart BoxBorder.preferPaintInterior

func (Border) Scale

func (b Border) Scale(t float64) ShapeBorder

Scale creates a copy of the border with its sides scaled by t.

Flutter: painting/box_border.dart Border.scale

func (Border) String

func (b Border) String() string

String describes the border, such as "Border.all(BorderSide(...))".

Flutter: painting/box_border.dart Border.toString

func (Border) TopSide

func (b Border) TopSide() BorderSide

TopSide is the top side of this border.

Flutter: painting/box_border.dart Border.top

type BorderDirectional

type BorderDirectional struct {
	// Top is the top side of this border.
	Top BorderSide
	// Start is the start side of this border.
	Start BorderSide
	// End is the end side of this border.
	End BorderSide
	// Bottom is the bottom side of this border.
	Bottom BorderSide
}

BorderDirectional is a border of a box, comprised of four sides, where the horizontal sides are dependent on the writing direction.

Flutter: painting/box_border.dart BorderDirectional

func BorderDirectionalLerp

func BorderDirectionalLerp(a, b *BorderDirectional, t float64) *BorderDirectional

BorderDirectionalLerp linearly interpolates between two BorderDirectionals. Either may be nil.

Flutter: painting/box_border.dart BorderDirectional.lerp

func BorderDirectionalMerge

func BorderDirectionalMerge(a, b BorderDirectional) BorderDirectional

BorderDirectionalMerge creates a border that represents the addition of the two given borders.

Flutter: painting/box_border.dart BorderDirectional.merge

func (BorderDirectional) Add

func (b BorderDirectional) Add(other ShapeBorder, reversed bool) ShapeBorder

Add merges this border with another border when their sides can be merged; otherwise it returns nil.

Flutter: painting/box_border.dart BorderDirectional.add

func (BorderDirectional) BottomSide

func (b BorderDirectional) BottomSide() BorderSide

BottomSide is the bottom side of this border.

Flutter: painting/box_border.dart BorderDirectional.bottom

func (BorderDirectional) Dimensions

func (b BorderDirectional) Dimensions() EdgeInsetsGeometry

Dimensions is the widths of the sides: the stroke insets.

Flutter: painting/box_border.dart BorderDirectional.dimensions

func (BorderDirectional) GetInnerPath

func (b BorderDirectional) GetInnerPath(rect ui.Rect, td ui.TextDirection) *ui.Path

GetInnerPath is the rect inset by the dimensions.

Flutter: painting/box_border.dart BoxBorder.getInnerPath

func (BorderDirectional) GetOuterPath

func (b BorderDirectional) GetOuterPath(rect ui.Rect, td ui.TextDirection) *ui.Path

GetOuterPath is the rect.

Flutter: painting/box_border.dart BoxBorder.getOuterPath

func (BorderDirectional) IsUniform

func (b BorderDirectional) IsUniform() bool

IsUniform reports whether all four sides are the same in color, width, style and stroke alignment.

Flutter: painting/box_border.dart BorderDirectional.isUniform

func (BorderDirectional) LerpFrom

LerpFrom interpolates from another BorderDirectional.

Flutter: painting/box_border.dart BorderDirectional.lerpFrom

func (BorderDirectional) LerpTo

LerpTo interpolates to another BorderDirectional.

Flutter: painting/box_border.dart BorderDirectional.lerpTo

func (BorderDirectional) Paint

func (b BorderDirectional) Paint(canvas *ui.Canvas, rect ui.Rect, td ui.TextDirection)

Paint paints the border around the rect.

Flutter: painting/box_border.dart BorderDirectional.paint

func (BorderDirectional) PaintBox

func (b BorderDirectional) PaintBox(canvas *ui.Canvas, rect ui.Rect, opts BoxPaintOpts)

PaintBox paints the border around the rect, with a shape and a border radius. A border whose sides differ needs a text direction.

Flutter: painting/box_border.dart BorderDirectional.paint

func (BorderDirectional) PaintInterior

func (b BorderDirectional) PaintInterior(canvas *ui.Canvas, rect ui.Rect, paint *ui.Paint, _ ui.TextDirection)

PaintInterior fills the rect.

Flutter: painting/box_border.dart BoxBorder.paintInterior

func (BorderDirectional) PreferPaintInterior

func (b BorderDirectional) PreferPaintInterior() bool

PreferPaintInterior is true: filling the rect is faster than the path.

Flutter: painting/box_border.dart BoxBorder.preferPaintInterior

func (BorderDirectional) Scale

Scale creates a copy of the border with its sides scaled by t.

Flutter: painting/box_border.dart BorderDirectional.scale

func (BorderDirectional) String

func (b BorderDirectional) String() string

String describes the border, such as "BorderDirectional(top: BorderSide(...))".

Flutter: painting/box_border.dart BorderDirectional.toString

func (BorderDirectional) TopSide

func (b BorderDirectional) TopSide() BorderSide

TopSide is the top side of this border.

Flutter: painting/box_border.dart BorderDirectional.top

type BorderPaintOpts

type BorderPaintOpts struct {
	Top, Right, Bottom, Left BorderSide
}

BorderPaintOpts are the sides PaintBorder draws; a side that is left out is not drawn.

Flutter: painting/borders.dart paintBorder

type BorderRadius

type BorderRadius struct {
	// TopLeft is the top-left [ui.Radius].
	TopLeft ui.Radius
	// TopRight is the top-right [ui.Radius].
	TopRight ui.Radius
	// BottomLeft is the bottom-left [ui.Radius].
	BottomLeft ui.Radius
	// BottomRight is the bottom-right [ui.Radius].
	BottomRight ui.Radius
}

BorderRadius is an immutable set of radii for each corner of a rectangle. Create one with a literal, NewBorderRadiusAll, NewBorderRadiusCircular, NewBorderRadiusVertical or NewBorderRadiusHorizontal.

Flutter: painting/border_radius.dart BorderRadius

func BorderRadiusLerp

func BorderRadiusLerp(a, b *BorderRadius, t float64) *BorderRadius

BorderRadiusLerp linearly interpolates between two BorderRadius. Either may be nil, which counts as zero.

Flutter: painting/border_radius.dart BorderRadius.lerp

func NewBorderRadiusAll

func NewBorderRadiusAll(radius ui.Radius) BorderRadius

NewBorderRadiusAll creates a border radius where all the corners have the same radius.

Flutter: painting/border_radius.dart BorderRadius.all

func NewBorderRadiusCircular

func NewBorderRadiusCircular(radius float64) BorderRadius

NewBorderRadiusCircular creates a border radius where all the corners are circular with the same radius.

Flutter: painting/border_radius.dart BorderRadius.circular

func NewBorderRadiusHorizontal

func NewBorderRadiusHorizontal(left, right ui.Radius) BorderRadius

NewBorderRadiusHorizontal creates a horizontally symmetric border radius.

Flutter: painting/border_radius.dart BorderRadius.horizontal

func NewBorderRadiusVertical

func NewBorderRadiusVertical(top, bottom ui.Radius) BorderRadius

NewBorderRadiusVertical creates a vertically symmetric border radius.

Flutter: painting/border_radius.dart BorderRadius.vertical

func (BorderRadius) Add

Add returns the result of adding the radii of other.

Flutter: painting/border_radius.dart BorderRadius.add

func (BorderRadius) CopyWith

CopyWith returns a copy with the given radii replaced.

Flutter: painting/border_radius.dart BorderRadius.copyWith

func (BorderRadius) Div

Div divides every radius by k.

Flutter: painting/border_radius.dart BorderRadius.operator /

func (BorderRadius) Equal

Equal reports whether the radii are equal and o is a BorderRadius.

Flutter: painting/border_radius.dart BorderRadius.operator ==

func (BorderRadius) Minus

Minus returns the radii of b less those of o.

Flutter: painting/border_radius.dart BorderRadius.operator -

func (BorderRadius) Mod

Mod takes the modulo k of every radius.

Flutter: painting/border_radius.dart BorderRadius.operator %

func (BorderRadius) Mul

Mul scales every radius by k.

Flutter: painting/border_radius.dart BorderRadius.operator *

func (BorderRadius) Neg

func (b BorderRadius) Neg() BorderRadius

Neg negates every radius.

Flutter: painting/border_radius.dart BorderRadius.unary-

func (BorderRadius) Plus

Plus returns the radii of b plus those of o.

Flutter: painting/border_radius.dart BorderRadius.operator +

func (BorderRadius) Resolve

Resolve returns the radii themselves: they do not depend on the direction.

Flutter: painting/border_radius.dart BorderRadius.resolve

func (BorderRadius) String

func (b BorderRadius) String() string

String describes the border radius, such as "BorderRadius.circular(8.0)".

Flutter: painting/border_radius.dart BorderRadius.toString

func (BorderRadius) Subtract

Subtract returns the result of subtracting the radii of other.

Flutter: painting/border_radius.dart BorderRadius.subtract

func (BorderRadius) ToRRect

func (b BorderRadius) ToRRect(rect ui.Rect) ui.RRect

ToRRect creates a rounded rectangle from the rectangle and these radii, with negative radii clamped to zero.

Flutter: painting/border_radius.dart BorderRadius.toRRect

func (BorderRadius) ToRSuperellipse

func (b BorderRadius) ToRSuperellipse(rect ui.Rect) ui.RSuperellipse

ToRSuperellipse creates a rounded superellipse from the rectangle and these radii, with negative radii clamped to zero.

Flutter: painting/border_radius.dart BorderRadius.toRSuperellipse

func (BorderRadius) TruncDiv

func (b BorderRadius) TruncDiv(k float64) BorderRadius

TruncDiv integer-divides every radius by k.

Flutter: painting/border_radius.dart BorderRadius.operator ~/

type BorderRadiusCopy

type BorderRadiusCopy struct {
	TopLeft, TopRight, BottomLeft, BottomRight foundation.Opt[ui.Radius]
}

BorderRadiusCopy holds the radii BorderRadius.CopyWith replaces.

Flutter: painting/border_radius.dart BorderRadius.copyWith

type BorderRadiusDirectional

type BorderRadiusDirectional struct {
	// TopStart is the top-start [ui.Radius].
	TopStart ui.Radius
	// TopEnd is the top-end [ui.Radius].
	TopEnd ui.Radius
	// BottomStart is the bottom-start [ui.Radius].
	BottomStart ui.Radius
	// BottomEnd is the bottom-end [ui.Radius].
	BottomEnd ui.Radius
}

BorderRadiusDirectional is an immutable set of radii for each corner of a rectangle, but with the corners on the left and right depending on the writing direction.

Flutter: painting/border_radius.dart BorderRadiusDirectional

func BorderRadiusDirectionalLerp

func BorderRadiusDirectionalLerp(a, b *BorderRadiusDirectional, t float64) *BorderRadiusDirectional

BorderRadiusDirectionalLerp linearly interpolates between two BorderRadiusDirectional. Either may be nil, which counts as zero.

Flutter: painting/border_radius.dart BorderRadiusDirectional.lerp

func NewBorderRadiusDirectionalAll

func NewBorderRadiusDirectionalAll(radius ui.Radius) BorderRadiusDirectional

NewBorderRadiusDirectionalAll creates a border radius where all the corners have the same radius.

Flutter: painting/border_radius.dart BorderRadiusDirectional.all

func NewBorderRadiusDirectionalCircular

func NewBorderRadiusDirectionalCircular(radius float64) BorderRadiusDirectional

NewBorderRadiusDirectionalCircular creates a border radius where all the corners are circular with the same radius.

Flutter: painting/border_radius.dart BorderRadiusDirectional.circular

func NewBorderRadiusDirectionalHorizontal

func NewBorderRadiusDirectionalHorizontal(start, end ui.Radius) BorderRadiusDirectional

NewBorderRadiusDirectionalHorizontal creates a horizontally symmetric border radius.

Flutter: painting/border_radius.dart BorderRadiusDirectional.horizontal

func NewBorderRadiusDirectionalVertical

func NewBorderRadiusDirectionalVertical(top, bottom ui.Radius) BorderRadiusDirectional

NewBorderRadiusDirectionalVertical creates a vertically symmetric border radius.

Flutter: painting/border_radius.dart BorderRadiusDirectional.vertical

func (BorderRadiusDirectional) Add

Add returns the result of adding the radii of other.

Flutter: painting/border_radius.dart BorderRadiusDirectional.add

func (BorderRadiusDirectional) Div

Div divides every radius by k.

Flutter: painting/border_radius.dart BorderRadiusDirectional.operator /

func (BorderRadiusDirectional) Equal

Equal reports whether the radii are equal and o is a BorderRadiusDirectional.

Flutter: painting/border_radius.dart BorderRadiusDirectional.operator ==

func (BorderRadiusDirectional) Minus

Minus returns the radii of b less those of o.

Flutter: painting/border_radius.dart BorderRadiusDirectional.operator -

func (BorderRadiusDirectional) Mod

Mod takes the modulo k of every radius.

Flutter: painting/border_radius.dart BorderRadiusDirectional.operator %

func (BorderRadiusDirectional) Mul

Mul scales every radius by k.

Flutter: painting/border_radius.dart BorderRadiusDirectional.operator *

func (BorderRadiusDirectional) Neg

Neg negates every radius.

Flutter: painting/border_radius.dart BorderRadiusDirectional.unary-

func (BorderRadiusDirectional) Plus

Plus returns the radii of b plus those of o.

Flutter: painting/border_radius.dart BorderRadiusDirectional.operator +

func (BorderRadiusDirectional) Resolve

Resolve returns a BorderRadius for the text direction.

Flutter: painting/border_radius.dart BorderRadiusDirectional.resolve

func (BorderRadiusDirectional) String

func (b BorderRadiusDirectional) String() string

String describes the border radius, such as "BorderRadiusDirectional.circular(8.0)".

Flutter: painting/border_radius.dart BorderRadiusDirectional.toString

func (BorderRadiusDirectional) Subtract

Subtract returns the result of subtracting the radii of other.

Flutter: painting/border_radius.dart BorderRadiusDirectional.subtract

func (BorderRadiusDirectional) TruncDiv

TruncDiv integer-divides every radius by k.

Flutter: painting/border_radius.dart BorderRadiusDirectional.operator ~/

type BorderRadiusGeometry

type BorderRadiusGeometry interface {
	// Subtract returns the result of subtracting the radii of other.
	Subtract(other BorderRadiusGeometry) BorderRadiusGeometry
	// Add returns the result of adding the radii of other.
	Add(other BorderRadiusGeometry) BorderRadiusGeometry
	// Resolve returns a BorderRadius for the text direction. A directional value
	// panics with the tag TextDirectionRequired in debug builds if the direction
	// is unspecified.
	Resolve(direction ui.TextDirection) BorderRadius
	// Equal reports whether the eight radii are equal and the types match.
	Equal(other BorderRadiusGeometry) bool
	String() string
	// contains filtered or unexported methods
}

BorderRadiusGeometry is a base class for BorderRadius and BorderRadiusDirectional, which describe the corners of a box. Its covariant operations (Neg, Mul, Div, TruncDiv and Mod) are the functions BorderRadiusGeometryNeg, … and the methods of the concrete types.

Flutter: painting/border_radius.dart BorderRadiusGeometry

var BorderRadiusGeometryZero BorderRadiusGeometry = BorderRadius{}

BorderRadiusGeometryZero is the BorderRadiusGeometry without any rounding.

Flutter: painting/border_radius.dart BorderRadiusGeometry.zero

func BorderRadiusGeometryDiv

func BorderRadiusGeometryDiv(g BorderRadiusGeometry, k float64) BorderRadiusGeometry

BorderRadiusGeometryDiv divides every radius by k.

Flutter: painting/border_radius.dart BorderRadiusGeometry.operator /

func BorderRadiusGeometryLerp

func BorderRadiusGeometryLerp(a, b BorderRadiusGeometry, t float64) BorderRadiusGeometry

BorderRadiusGeometryLerp linearly interpolates between two BorderRadiusGeometry objects. Either may be nil, which counts as zero.

Flutter: painting/border_radius.dart BorderRadiusGeometry.lerp

func BorderRadiusGeometryMod

func BorderRadiusGeometryMod(g BorderRadiusGeometry, k float64) BorderRadiusGeometry

BorderRadiusGeometryMod takes the modulo k of every radius.

Flutter: painting/border_radius.dart BorderRadiusGeometry.operator %

func BorderRadiusGeometryMul

func BorderRadiusGeometryMul(g BorderRadiusGeometry, k float64) BorderRadiusGeometry

BorderRadiusGeometryMul multiplies every radius by k.

Flutter: painting/border_radius.dart BorderRadiusGeometry.operator *

func BorderRadiusGeometryNeg

func BorderRadiusGeometryNeg(g BorderRadiusGeometry) BorderRadiusGeometry

BorderRadiusGeometryNeg negates every radius.

Flutter: painting/border_radius.dart BorderRadiusGeometry.operator -

func BorderRadiusGeometryTruncDiv

func BorderRadiusGeometryTruncDiv(g BorderRadiusGeometry, k float64) BorderRadiusGeometry

BorderRadiusGeometryTruncDiv integer-divides every radius by k.

Flutter: painting/border_radius.dart BorderRadiusGeometry.operator ~/

func BorderRadiusHorizontalGeometry

func BorderRadiusHorizontalGeometry(left, right, start, end foundation.Opt[ui.Radius]) BorderRadiusGeometry

BorderRadiusHorizontalGeometry creates a border radius with the left and right radii (which make a BorderRadius), or the start and end radii (which make a BorderRadiusDirectional). Mixing them panics with the tag BorderRadiusMixedHorizontal in debug builds.

Flutter: painting/border_radius.dart BorderRadiusGeometry.horizontal

type BorderSide

type BorderSide struct {
	// Color is the color of this side of the border.
	Color ui.Color
	// Width is the width of this side of the border, in logical pixels.
	Width float64
	// Style is the style of this side of the border.
	Style BorderStyle
	// StrokeAlign is the relative position of the stroke on a BorderSide in an
	// OutlinedBorder or Border, from StrokeAlignInside (-1) to
	// StrokeAlignOutside (1).
	StrokeAlign float64
}

BorderSide is a side of a border of a box. Make one with NewBorderSide. The zero BorderSide, which a literal such as Border{Top: side} leaves in the other sides, stands for BorderSideNone.

Flutter: painting/borders.dart BorderSide

func BorderSideLerp

func BorderSideLerp(a, b BorderSide, t float64) BorderSide

BorderSideLerp linearly interpolates between two border sides.

Flutter: painting/borders.dart BorderSide.lerp

func BorderSideMerge

func BorderSideMerge(a, b BorderSide) BorderSide

BorderSideMerge creates a BorderSide that represents the addition of the two given BorderSides. Merging sides that cannot be merged panics with the tag BorderSideCannotMerge in debug builds.

Flutter: painting/borders.dart BorderSide.merge

func NewBorderSide

func NewBorderSide(opts ...BorderSideOpts) BorderSide

NewBorderSide creates the side of a border. A negative width panics with the tag BorderSideWidthNegative in debug builds.

Flutter: painting/borders.dart BorderSide.new

func (BorderSide) CopyWith

func (s BorderSide) CopyWith(c BorderSideCopy) BorderSide

CopyWith returns a copy with the given values replaced.

Flutter: painting/borders.dart BorderSide.copyWith

func (BorderSide) DebugFillProperties

func (s BorderSide) DebugFillProperties(p *foundation.DiagnosticPropertiesBuilder)

DebugFillProperties adds the color, width, stroke alignment and style.

Flutter: painting/borders.dart BorderSide.debugFillProperties

func (BorderSide) Scale

func (s BorderSide) Scale(t float64) BorderSide

Scale creates a copy of this border side description but with the width scaled by the factor t. The result has no style if t is not positive.

Flutter: painting/borders.dart BorderSide.scale

func (BorderSide) String

func (s BorderSide) String() string

String describes the side, such as "BorderSide(color: Color(0xff000000), width: 1.0)".

Flutter: painting/borders.dart BorderSide.toString

func (BorderSide) StrokeInset

func (s BorderSide) StrokeInset() float64

StrokeInset is the amount of the stroke width that lies inside of the BorderSide.

Flutter: painting/borders.dart BorderSide.strokeInset

func (BorderSide) StrokeOffset

func (s BorderSide) StrokeOffset() float64

StrokeOffset is the offset of the stroke, taking into account the stroke alignment.

Flutter: painting/borders.dart BorderSide.strokeOffset

func (BorderSide) StrokeOutset

func (s BorderSide) StrokeOutset() float64

StrokeOutset is the amount of the stroke width that lies outside of the BorderSide.

Flutter: painting/borders.dart BorderSide.strokeOutset

func (BorderSide) ToPaint

func (s BorderSide) ToPaint() *ui.Paint

ToPaint creates a Paint object that, if used to stroke a line, will draw the line in this border's style.

Flutter: painting/borders.dart BorderSide.toPaint

func (BorderSide) ToStringShort

func (s BorderSide) ToStringShort() string

ToStringShort names the side.

Flutter: painting/borders.dart BorderSide.toStringShort

type BorderSideCopy

type BorderSideCopy struct {
	Color       foundation.Opt[ui.Color]
	Width       foundation.Opt[float64]
	Style       BorderStyle
	StrokeAlign foundation.Opt[float64]
}

BorderSideCopy holds the values BorderSide.CopyWith replaces.

Flutter: painting/borders.dart BorderSide.copyWith

type BorderSideOpts

type BorderSideOpts struct {
	// Color is the color of the side; the default is black.
	Color foundation.Opt[ui.Color]
	// Width is the width of the side; the default is 1.0.
	Width foundation.Opt[float64]
	// Style is the style of the side; the default is BorderStyleSolid.
	Style BorderStyle
	// StrokeAlign is the relative position of the stroke; the default is
	// StrokeAlignInside.
	StrokeAlign foundation.Opt[float64]
}

BorderSideOpts are the optional parameters of NewBorderSide.

Flutter: painting/borders.dart BorderSide.new

type BorderStyle

type BorderStyle int

BorderStyle is the style of line to draw for a BorderSide in a Border. The zero value is BorderStyleUnspecified: the default (solid) when a BorderSide is created with NewBorderSide.

Flutter: painting/borders.dart BorderStyle

const (
	// BorderStyleUnspecified is the zero value: solid in NewBorderSide.
	//
	// Flutter: no counterpart
	BorderStyleUnspecified BorderStyle = iota
	// BorderStyleNone skips the border.
	//
	// Flutter: painting/borders.dart BorderStyle.none
	BorderStyleNone
	// BorderStyleSolid draws the border as a solid line.
	//
	// Flutter: painting/borders.dart BorderStyle.solid
	BorderStyleSolid
)

The values of BorderStyle follow Flutter's declaration order.

func (BorderStyle) Name

func (s BorderStyle) Name() string

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

Flutter: painting/borders.dart BorderStyle.name

func (BorderStyle) String

func (s BorderStyle) String() string

String returns the name Dart prints, such as "BorderStyle.solid".

Flutter: painting/borders.dart BorderStyle.toString

type BoxBorder

type BoxBorder interface {
	ShapeBorder
	// TopSide is the top side of this border.
	TopSide() BorderSide
	// BottomSide is the bottom side of this border.
	BottomSide() BorderSide
	// IsUniform reports whether all four sides are the same in color, width,
	// style and stroke alignment.
	IsUniform() bool
	// PaintBox paints the border within the given rect on the given canvas.
	// Paint is PaintBox with the default shape and no radius.
	PaintBox(canvas *ui.Canvas, rect ui.Rect, opts BoxPaintOpts)
}

BoxBorder is a border of a box, comprised of four sides: the top, right, bottom, and left. The sides are named TopSide and BottomSide (the properties Top and Bottom are the fields of the concrete types).

Flutter: painting/box_border.dart BoxBorder

func BoxBorderLerp

func BoxBorderLerp(a, b BoxBorder, t float64) BoxBorder

BoxBorderLerp linearly interpolates between two BoxBorders. Both must be a Border or a BorderDirectional (or nil), or it panics with the tag BoxBorderLerpInvalid.

Flutter: painting/box_border.dart BoxBorder.lerp

type BoxDecoration

type BoxDecoration struct {
	DecorationDefaults
	// Color is the color to fill in the background of the box.
	Color foundation.Opt[ui.Color]
	// Image is the image to paint inside the box, above Color and Gradient.
	Image DecorationImageSource
	// Border is the border to draw above the background.
	Border BoxBorder
	// BorderRadius is if non-nil, the corners of this box are rounded.
	BorderRadius BorderRadiusGeometry
	// BoxShadow is a list of shadows cast by this box behind the box. Nil is
	// Flutter's null.
	BoxShadow []BoxShadow
	// Gradient is the gradient to use when filling the box.
	Gradient Gradient
	// BackgroundBlendMode is the blend mode applied to the Color or Gradient
	// background; ui.BlendModeUnspecified for none.
	BackgroundBlendMode ui.BlendMode
	// Shape is the shape to fill the background Color, Gradient and Image into
	// and to cast as the BoxShadow.
	Shape BoxShape
}

BoxDecoration is an immutable description of how to paint a box.

Flutter: painting/box_decoration.dart BoxDecoration

func BoxDecorationLerp

func BoxDecorationLerp(a, b *BoxDecoration, t float64) *BoxDecoration

BoxDecorationLerp linearly interpolates between two box decorations. Either may be nil.

Flutter: painting/box_decoration.dart BoxDecoration.lerp

func NewBoxDecoration

func NewBoxDecoration(opts ...BoxDecorationOpts) *BoxDecoration

NewBoxDecoration creates a box decoration. In debug builds it panics with the tag BoxDecorationBlendModeWithoutBackground if there is a background blend mode but no color or gradient.

Flutter: painting/box_decoration.dart BoxDecoration.new

func (*BoxDecoration) CopyWith

CopyWith returns a copy of the decoration with the given fields replaced.

Flutter: painting/box_decoration.dart BoxDecoration.copyWith

func (*BoxDecoration) CreateBoxPainter

func (d *BoxDecoration) CreateBoxPainter(onChanged func()) BoxPainter

CreateBoxPainter returns a painter for the decoration. In debug builds it panics with the tag BoxDecorationOnChangedRequired if there is an image but no onChanged callback.

Flutter: painting/box_decoration.dart BoxDecoration.createBoxPainter

func (*BoxDecoration) DebugAssertIsValid

func (d *BoxDecoration) DebugAssertIsValid() bool

DebugAssertIsValid panics with the tag BoxDecorationCircleBorderRadius, in debug builds, if the shape is a circle and there is a border radius.

Flutter: painting/box_decoration.dart BoxDecoration.debugAssertIsValid

func (*BoxDecoration) DebugFillProperties

func (d *BoxDecoration) DebugFillProperties(p *foundation.DiagnosticPropertiesBuilder)

DebugFillProperties adds the color, image, border, border radius, shadows, gradient and shape.

Flutter: painting/box_decoration.dart BoxDecoration.debugFillProperties

func (*BoxDecoration) Equal

func (d *BoxDecoration) Equal(other *BoxDecoration) bool

Equal reports whether the other decoration is an equal BoxDecoration.

Flutter: painting/box_decoration.dart BoxDecoration.operator ==

func (*BoxDecoration) GetClipPath

func (d *BoxDecoration) GetClipPath(rect ui.Rect, td ui.TextDirection) *ui.Path

GetClipPath returns the outline of the box as a path.

Flutter: painting/box_decoration.dart BoxDecoration.getClipPath

func (*BoxDecoration) HitTest

func (d *BoxDecoration) HitTest(size ui.Size, position ui.Offset, td ui.TextDirection) bool

HitTest tests whether the position, on a rectangle of the given size, hits the shape of the box. In debug builds it panics with the tag DecorationHitTestOutside if the position is outside the rectangle.

Flutter: painting/box_decoration.dart BoxDecoration.hitTest

func (*BoxDecoration) IsComplex

func (d *BoxDecoration) IsComplex() bool

IsComplex is whether the decoration has shadows.

Flutter: painting/box_decoration.dart BoxDecoration.isComplex

func (*BoxDecoration) LerpFrom

func (d *BoxDecoration) LerpFrom(a Decoration, t float64) Decoration

LerpFrom interpolates from another decoration to this one.

Flutter: painting/box_decoration.dart BoxDecoration.lerpFrom

func (*BoxDecoration) LerpTo

func (d *BoxDecoration) LerpTo(b Decoration, t float64) Decoration

LerpTo interpolates from this decoration to another.

Flutter: painting/box_decoration.dart BoxDecoration.lerpTo

func (*BoxDecoration) Padding

func (d *BoxDecoration) Padding() EdgeInsetsGeometry

Padding is the insets of the border, or zero without one.

Flutter: painting/box_decoration.dart BoxDecoration.padding

func (*BoxDecoration) Scale

func (d *BoxDecoration) Scale(factor float64) *BoxDecoration

Scale returns a new box decoration with its colors and border scaled by the factor.

Flutter: painting/box_decoration.dart BoxDecoration.scale

func (*BoxDecoration) String

func (d *BoxDecoration) String() string

String describes the decoration and its properties.

Flutter: painting/box_decoration.dart BoxDecoration.toString

func (*BoxDecoration) ToStringShort

func (d *BoxDecoration) ToStringShort() string

ToStringShort names the decoration.

Flutter: painting/decoration.dart Decoration.toStringShort

type BoxDecorationCopy

type BoxDecorationCopy struct {
	Color               foundation.Opt[ui.Color]
	Image               DecorationImageSource
	Border              BoxBorder
	BorderRadius        BorderRadiusGeometry
	BoxShadow           foundation.Opt[[]BoxShadow]
	Gradient            Gradient
	BackgroundBlendMode ui.BlendMode
	Shape               BoxShape
}

BoxDecorationCopy holds the replacements for BoxDecoration.CopyWith. A field that is None, or a nil interface, keeps the old value.

Flutter: painting/box_decoration.dart BoxDecoration.copyWith

type BoxDecorationOpts

type BoxDecorationOpts struct {
	Color               foundation.Opt[ui.Color]
	Image               DecorationImageSource
	Border              BoxBorder
	BorderRadius        BorderRadiusGeometry
	BoxShadow           []BoxShadow
	Gradient            Gradient
	BackgroundBlendMode ui.BlendMode
	// Shape defaults to BoxShapeRectangle.
	Shape BoxShape
}

BoxDecorationOpts are the optional parameters of NewBoxDecoration.

Flutter: painting/box_decoration.dart BoxDecoration.new

type BoxFit

type BoxFit int

BoxFit is how a box should be inscribed into another box. The zero value is BoxFitUnspecified: the default of the widget.

Flutter: painting/box_fit.dart BoxFit

const (
	// BoxFitUnspecified is the zero value: the default of the widget.
	BoxFitUnspecified BoxFit = iota
	// BoxFitFill fills the target box by distorting the source's aspect ratio.
	//
	// Flutter: painting/box_fit.dart BoxFit.fill
	BoxFitFill
	// BoxFitContain is as large as possible while still containing the source
	// entirely within the target box.
	//
	// Flutter: painting/box_fit.dart BoxFit.contain
	BoxFitContain
	// BoxFitCover is as small as possible while still covering the entire
	// target box.
	//
	// Flutter: painting/box_fit.dart BoxFit.cover
	BoxFitCover
	// BoxFitFitWidth makes sure the full width of the source is shown,
	// regardless of whether this means the source overflows the target box
	// vertically.
	//
	// Flutter: painting/box_fit.dart BoxFit.fitWidth
	BoxFitFitWidth
	// BoxFitFitHeight makes sure the full height of the source is shown,
	// regardless of whether this means the source overflows the target box
	// horizontally.
	//
	// Flutter: painting/box_fit.dart BoxFit.fitHeight
	BoxFitFitHeight
	// BoxFitNone aligns the source within the target box (by default, centering)
	// and discards any part of the source that is outside the box.
	//
	// Flutter: painting/box_fit.dart BoxFit.none
	BoxFitNone
	// BoxFitScaleDown aligns the source within the target box and, if the
	// source is larger, scales it down to contain it, like BoxFitContain.
	//
	// Flutter: painting/box_fit.dart BoxFit.scaleDown
	BoxFitScaleDown
)

The values of BoxFit follow Flutter's declaration order.

func (BoxFit) Name

func (f BoxFit) Name() string

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

Flutter: painting/box_fit.dart BoxFit.name

func (BoxFit) String

func (f BoxFit) String() string

String returns the name Dart prints, such as "BoxFit.contain".

Flutter: painting/box_fit.dart BoxFit.toString

type BoxPaintOpts

type BoxPaintOpts struct {
	// TextDirection is the direction that a BorderDirectional needs when its
	// sides differ.
	TextDirection ui.TextDirection
	// Shape is the shape of the border; the default is a rectangle.
	Shape BoxShape
	// BorderRadius rounds the corners of a rectangle; None for none.
	BorderRadius foundation.Opt[BorderRadius]
}

BoxPaintOpts are the optional parameters of BoxBorder.PaintBox.

Flutter: painting/box_border.dart BoxBorder.paint

type BoxPainter

type BoxPainter interface {
	// Paint paints the decoration on the canvas at the offset; the
	// configuration says how big the box is.
	Paint(canvas *ui.Canvas, offset ui.Offset, configuration ImageConfiguration)
	// Dispose discards any resources used by the painter.
	Dispose()
}

BoxPainter is a stateful class that can paint a particular Decoration.

Flutter: painting/decoration.dart BoxPainter

type BoxShadow

type BoxShadow struct {
	ui.Shadow
	// SpreadRadius is how much the shadow expands, in logical pixels, before
	// the blur is applied.
	SpreadRadius float64
	// BlurStyle is the style of the blur; ui.BlurStyleUnspecified means normal.
	BlurStyle ui.BlurStyle
}

BoxShadow is a shadow cast by a box. Unlike ui.Shadow it can spread, and it can be drawn with a blur style.

Flutter: painting/box_shadow.dart BoxShadow

func BoxShadowLerp

func BoxShadowLerp(a, b *BoxShadow, t float64) *BoxShadow

BoxShadowLerp linearly interpolates between two box shadows. Either may be nil; the result is nil only for two nils.

Flutter: painting/box_shadow.dart BoxShadow.lerp

func BoxShadowLerpList

func BoxShadowLerpList(a, b []BoxShadow, t float64) []BoxShadow

BoxShadowLerpList linearly interpolates between two lists of box shadows. The shorter list is padded with transparent shadows.

Flutter: painting/box_shadow.dart BoxShadow.lerpList

func NewBoxShadow

func NewBoxShadow(opts ...BoxShadowOpts) BoxShadow

NewBoxShadow creates a box shadow.

Flutter: painting/box_shadow.dart BoxShadow.new

func (BoxShadow) CopyWith

func (s BoxShadow) CopyWith(c BoxShadowCopy) BoxShadow

CopyWith returns a copy of the shadow with the given fields replaced.

Flutter: painting/box_shadow.dart BoxShadow.copyWith

func (BoxShadow) Scale

func (s BoxShadow) Scale(factor float64) BoxShadow

Scale returns a new box shadow with its offset, blurRadius and spreadRadius scaled by the factor.

Flutter: painting/box_shadow.dart BoxShadow.scale

func (BoxShadow) String

func (s BoxShadow) String() string

String describes the shadow, such as "BoxShadow(Color(0xff000000), Offset(0.0, 0.0), 0.0, 0.0, BlurStyle.normal)".

Flutter: painting/box_shadow.dart BoxShadow.toString

func (BoxShadow) ToPaint

func (s BoxShadow) ToPaint() *ui.Paint

ToPaint creates a Paint that, when used to paint a box, draws the shadow.

Flutter: painting/box_shadow.dart BoxShadow.toPaint

type BoxShadowCopy

type BoxShadowCopy struct {
	Color        foundation.Opt[ui.Color]
	Offset       foundation.Opt[ui.Offset]
	BlurRadius   foundation.Opt[float64]
	SpreadRadius foundation.Opt[float64]
	BlurStyle    foundation.Opt[ui.BlurStyle]
}

BoxShadowCopy holds the replacements for BoxShadow.CopyWith.

Flutter: painting/box_shadow.dart BoxShadow.copyWith

type BoxShadowOpts

type BoxShadowOpts struct {
	// Color defaults to opaque black.
	Color foundation.Opt[ui.Color]
	// Offset defaults to zero.
	Offset ui.Offset
	// BlurRadius defaults to 0.
	BlurRadius float64
	// SpreadRadius defaults to 0.
	SpreadRadius float64
	// BlurStyle defaults to ui.BlurStyleNormal.
	BlurStyle ui.BlurStyle
}

BoxShadowOpts are the optional parameters of NewBoxShadow.

Flutter: painting/box_shadow.dart BoxShadow.new

type BoxShape

type BoxShape int

BoxShape is the shape to use when painting a Border or BoxDecoration. The zero value is BoxShapeUnspecified: the default (rectangle).

Flutter: painting/box_border.dart BoxShape

const (
	// BoxShapeUnspecified is the zero value: a rectangle.
	//
	// Flutter: no counterpart
	BoxShapeUnspecified BoxShape = iota
	// BoxShapeRectangle is an axis-aligned, 2-dimensional rectangle.
	//
	// Flutter: painting/box_border.dart BoxShape.rectangle
	BoxShapeRectangle
	// BoxShapeCircle is an axis-aligned, 2-dimensional circle.
	//
	// Flutter: painting/box_border.dart BoxShape.circle
	BoxShapeCircle
)

The values of BoxShape follow Flutter's declaration order.

func (BoxShape) Name

func (s BoxShape) Name() string

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

Flutter: painting/box_border.dart BoxShape.name

func (BoxShape) String

func (s BoxShape) String() string

String returns the name Dart prints, such as "BoxShape.circle".

Flutter: painting/box_border.dart BoxShape.toString

type CircleBorder

type CircleBorder struct {
	ShapeBorderDefaults

	// Eccentricity defines the ovalness of the shape: 0.0 is a circle and 1.0
	// is a stadium-like oval.
	Eccentricity float64
	// contains filtered or unexported fields
}

CircleBorder is a border that fits a circle within the available space.

Flutter: painting/circle_border.dart CircleBorder

func NewCircleBorder

func NewCircleBorder(opts ...CircleBorderOpts) CircleBorder

NewCircleBorder creates a border that fits a circle. In debug builds an eccentricity outside 0 to 1 panics with the tag BorderEccentricityOutOfRange.

Flutter: painting/circle_border.dart CircleBorder.new

func (CircleBorder) CopyWith

CopyWith returns a copy with the given fields replaced.

Flutter: painting/circle_border.dart CircleBorder.copyWith

func (CircleBorder) CopyWithSide

func (b CircleBorder) CopyWithSide(side BorderSide) OutlinedBorder

CopyWithSide returns a copy with the given side.

Flutter: painting/borders.dart OutlinedBorder.copyWith

func (CircleBorder) Dimensions

func (b CircleBorder) Dimensions() EdgeInsetsGeometry

Dimensions is the stroke inset on all sides.

Flutter: painting/borders.dart OutlinedBorder.dimensions

func (CircleBorder) GetInnerPath

func (b CircleBorder) GetInnerPath(rect ui.Rect, _ ui.TextDirection) *ui.Path

GetInnerPath is the circle, deflated by the stroke inset.

Flutter: painting/circle_border.dart CircleBorder.getInnerPath

func (CircleBorder) GetOuterPath

func (b CircleBorder) GetOuterPath(rect ui.Rect, _ ui.TextDirection) *ui.Path

GetOuterPath is the circle.

Flutter: painting/circle_border.dart CircleBorder.getOuterPath

func (CircleBorder) LerpFrom

func (b CircleBorder) LerpFrom(a ShapeBorder, t float64) ShapeBorder

LerpFrom interpolates from a CircleBorder, or scales from nil.

Flutter: painting/circle_border.dart CircleBorder.lerpFrom

func (CircleBorder) LerpTo

LerpTo interpolates to a CircleBorder, or scales to nil.

Flutter: painting/circle_border.dart CircleBorder.lerpTo

func (CircleBorder) Paint

func (b CircleBorder) Paint(canvas *ui.Canvas, rect ui.Rect, _ ui.TextDirection)

Paint strokes the circle.

Flutter: painting/circle_border.dart CircleBorder.paint

func (CircleBorder) PaintInterior

func (b CircleBorder) PaintInterior(canvas *ui.Canvas, rect ui.Rect, paint *ui.Paint, _ ui.TextDirection)

PaintInterior fills the circle.

Flutter: painting/circle_border.dart CircleBorder.paintInterior

func (CircleBorder) PreferPaintInterior

func (b CircleBorder) PreferPaintInterior() bool

PreferPaintInterior is true.

Flutter: painting/circle_border.dart CircleBorder.preferPaintInterior

func (CircleBorder) Scale

func (b CircleBorder) Scale(t float64) ShapeBorder

Scale scales the side by t.

Flutter: painting/circle_border.dart CircleBorder.scale

func (CircleBorder) Side

func (b CircleBorder) Side() BorderSide

Side is the border outline's color and weight.

Flutter: painting/borders.dart OutlinedBorder.side

func (CircleBorder) String

func (b CircleBorder) String() string

String describes the border.

Flutter: painting/circle_border.dart CircleBorder.toString

type CircleBorderCopy

type CircleBorderCopy struct {
	Side         foundation.Opt[BorderSide]
	Eccentricity foundation.Opt[float64]
}

CircleBorderCopy holds the replacements for CircleBorder.CopyWith.

Flutter: painting/circle_border.dart CircleBorder.copyWith

type CircleBorderOpts

type CircleBorderOpts struct {
	// Side defaults to BorderSideNone.
	Side BorderSide
	// Eccentricity defaults to 0.0; it must be from 0.0 to 1.0.
	Eccentricity float64
}

CircleBorderOpts are the optional parameters of NewCircleBorder.

Flutter: painting/circle_border.dart CircleBorder.new

type CircularNotchedRectangle

type CircularNotchedRectangle struct {
	// Inverted makes the notch in the bottom edge instead of the top.
	Inverted bool
}

CircularNotchedRectangle is a rectangle with a smooth circular notch.

Flutter: painting/notched_shapes.dart CircularNotchedRectangle

func (CircularNotchedRectangle) GetOuterPath

func (c CircularNotchedRectangle) GetOuterPath(host ui.Rect, guestOpt foundation.Opt[ui.Rect]) *ui.Path

GetOuterPath creates the rectangle's path with the notch for the guest.

Flutter: painting/notched_shapes.dart CircularNotchedRectangle.getOuterPath

type ClipContext

type ClipContext interface {
	// Canvas is the canvas the clipped painting is drawn on.
	Canvas() *ui.Canvas
}

ClipContext is a mixin that provides the clip-and-paint helpers to a class that has a canvas. The helpers are the functions ClipPathAndPaint, ClipRRectAndPaint, ClipRSuperellipseAndPaint and ClipRectAndPaint.

Flutter: painting/clip.dart ClipContext

type CodecResult

type CodecResult struct {
	Codec *ui.Codec
	Err   error
}

CodecResult is the outcome of making a codec: a codec, or an error.

Flutter: dart:async Future<ui.Codec>

type ColorSwatch

type ColorSwatch[T comparable] struct {
	// Primary is the color of the swatch itself.
	Primary ui.Color
	// contains filtered or unexported fields
}

ColorSwatch is a color that has a small table of related colors called a swatch. Dart's ColorSwatch extends Color; ui.Color is a plain value, so this holds the primary color in Primary instead.

Flutter: painting/colors.dart ColorSwatch

func ColorSwatchLerp

func ColorSwatchLerp[T comparable](a, b *ColorSwatch[T], t float64) *ColorSwatch[T]

ColorSwatchLerp linearly interpolates between two swatches. Either may be nil.

Flutter: painting/colors.dart ColorSwatch.lerp

func NewColorSwatch

func NewColorSwatch[T comparable](primary ui.Color, keys []T, colors map[T]ui.Color) *ColorSwatch[T]

NewColorSwatch creates a swatch. The keys are kept in the given order.

Flutter: painting/colors.dart ColorSwatch.new

func (*ColorSwatch[T]) At

func (s *ColorSwatch[T]) At(key T) (ui.Color, bool)

At returns the color of the key, and whether the swatch has it.

Flutter: painting/colors.dart ColorSwatch.[]

func (*ColorSwatch[T]) Equal

func (s *ColorSwatch[T]) Equal(o *ColorSwatch[T]) bool

Equal reports whether the other swatch has the same primary color and the same table.

Flutter: painting/colors.dart ColorSwatch.operator ==

func (*ColorSwatch[T]) Keys

func (s *ColorSwatch[T]) Keys() []T

Keys are the keys of the swatch, in order.

Flutter: painting/colors.dart ColorSwatch.keys

func (*ColorSwatch[T]) String

func (s *ColorSwatch[T]) String() string

String describes the swatch.

Flutter: painting/colors.dart ColorSwatch.toString

type ContinuousRectangleBorder

type ContinuousRectangleBorder struct {
	ShapeBorderDefaults

	// BorderRadius is the radii for each corner; nil is BorderRadiusZero.
	BorderRadius BorderRadiusGeometry
	// contains filtered or unexported fields
}

ContinuousRectangleBorder is a rectangular border with smooth continuous transitions between the straight sides and the rounded corners.

Flutter: painting/continuous_rectangle_border.dart ContinuousRectangleBorder

func NewContinuousRectangleBorder

func NewContinuousRectangleBorder(opts ...ContinuousRectangleBorderOpts) ContinuousRectangleBorder

NewContinuousRectangleBorder creates a continuous rectangle border.

Flutter: painting/continuous_rectangle_border.dart ContinuousRectangleBorder.new

func (ContinuousRectangleBorder) CopyWith

CopyWith returns a copy with the given fields replaced.

Flutter: painting/continuous_rectangle_border.dart ContinuousRectangleBorder.copyWith

func (ContinuousRectangleBorder) CopyWithSide

CopyWithSide returns a copy with the given side.

Flutter: painting/borders.dart OutlinedBorder.copyWith

func (ContinuousRectangleBorder) Dimensions

Dimensions is the width of the side on all sides.

Flutter: painting/continuous_rectangle_border.dart ContinuousRectangleBorder.dimensions

func (ContinuousRectangleBorder) GetInnerPath

func (b ContinuousRectangleBorder) GetInnerPath(rect ui.Rect, td ui.TextDirection) *ui.Path

GetInnerPath is the shape, deflated by the width of the side.

Flutter: painting/continuous_rectangle_border.dart ContinuousRectangleBorder.getInnerPath

func (ContinuousRectangleBorder) GetOuterPath

func (b ContinuousRectangleBorder) GetOuterPath(rect ui.Rect, td ui.TextDirection) *ui.Path

GetOuterPath is the shape.

Flutter: painting/continuous_rectangle_border.dart ContinuousRectangleBorder.getOuterPath

func (ContinuousRectangleBorder) LerpFrom

LerpFrom interpolates from a ContinuousRectangleBorder.

Flutter: painting/continuous_rectangle_border.dart ContinuousRectangleBorder.lerpFrom

func (ContinuousRectangleBorder) LerpTo

LerpTo interpolates to a ContinuousRectangleBorder.

Flutter: painting/continuous_rectangle_border.dart ContinuousRectangleBorder.lerpTo

func (ContinuousRectangleBorder) Paint

func (b ContinuousRectangleBorder) Paint(canvas *ui.Canvas, rect ui.Rect, td ui.TextDirection)

Paint strokes the border.

Flutter: painting/continuous_rectangle_border.dart ContinuousRectangleBorder.paint

func (ContinuousRectangleBorder) Scale

Scale scales the side and the radii by t.

Flutter: painting/continuous_rectangle_border.dart ContinuousRectangleBorder.scale

func (ContinuousRectangleBorder) Side

Side is the border outline's color and weight.

Flutter: painting/borders.dart OutlinedBorder.side

func (ContinuousRectangleBorder) String

func (b ContinuousRectangleBorder) String() string

String describes the border.

Flutter: painting/continuous_rectangle_border.dart ContinuousRectangleBorder.toString

type ContinuousRectangleBorderOpts

type ContinuousRectangleBorderOpts = RoundedRectangleBorderOpts

ContinuousRectangleBorderOpts are the optional parameters of NewContinuousRectangleBorder.

Flutter: painting/continuous_rectangle_border.dart ContinuousRectangleBorder.new

type Decoration

type Decoration interface {
	foundation.Diagnosticable
	// DebugAssertIsValid asserts that the decoration is valid; it returns true
	// (so that it can be used in assertions).
	DebugAssertIsValid() bool
	// Padding is the insets to use when the decoration is shown around a child:
	// the area the decoration is guaranteed to paint around.
	Padding() EdgeInsetsGeometry
	// IsComplex is whether this decoration is complex enough to benefit from
	// caching its painting.
	IsComplex() bool
	// LerpFrom linearly interpolates from a (possibly nil) decoration to this
	// one; it returns nil if it can't.
	LerpFrom(a Decoration, t float64) Decoration
	// LerpTo linearly interpolates from this decoration to b (possibly nil);
	// it returns nil if it can't.
	LerpTo(b Decoration, t float64) Decoration
	// HitTest tests whether the given point, on a rectangle of the given size,
	// would be considered to hit the decoration.
	HitTest(size ui.Size, position ui.Offset, textDirection ui.TextDirection) bool
	// CreateBoxPainter returns a BoxPainter that will paint this decoration.
	CreateBoxPainter(onChanged func()) BoxPainter
	// GetClipPath returns a closed Path that describes the outer edge of the
	// decoration, for clipping.
	GetClipPath(rect ui.Rect, textDirection ui.TextDirection) *ui.Path
}

Decoration is a description of a painting to be done around a box. A nil Decoration is Flutter's null. The methods LerpFrom and LerpTo are protected in Flutter; they are exported so that other packages can implement a Decoration. Embed DecorationDefaults for the defaults.

Flutter: painting/decoration.dart Decoration

func DecorationLerp

func DecorationLerp(a, b Decoration, t float64) Decoration

DecorationLerp linearly interpolates between two decorations. Either may be nil.

Flutter: painting/decoration.dart Decoration.lerp

type DecorationDefaults

type DecorationDefaults struct{}

DecorationDefaults gives the defaults of Decoration for embedding. Its LerpFrom and LerpTo return nil, its Padding is zero, HitTest is true, and GetClipPath panics.

Flutter: painting/decoration.dart Decoration

func (DecorationDefaults) DebugAssertIsValid

func (DecorationDefaults) DebugAssertIsValid() bool

DebugAssertIsValid returns true.

Flutter: painting/decoration.dart Decoration.debugAssertIsValid

func (DecorationDefaults) DebugFillProperties

DebugFillProperties adds nothing.

Flutter: painting/decoration.dart Decoration.debugFillProperties

func (DecorationDefaults) GetClipPath

func (DecorationDefaults) GetClipPath(ui.Rect, ui.TextDirection) *ui.Path

GetClipPath panics with the tag DecorationNoClipPath.

Flutter: painting/decoration.dart Decoration.getClipPath

func (DecorationDefaults) HitTest

HitTest returns true.

Flutter: painting/decoration.dart Decoration.hitTest

func (DecorationDefaults) IsComplex

func (DecorationDefaults) IsComplex() bool

IsComplex is false.

Flutter: painting/decoration.dart Decoration.isComplex

func (DecorationDefaults) LerpFrom

LerpFrom returns nil.

Flutter: painting/decoration.dart Decoration.lerpFrom

func (DecorationDefaults) LerpTo

LerpTo returns nil.

Flutter: painting/decoration.dart Decoration.lerpTo

func (DecorationDefaults) Padding

Padding is zero.

Flutter: painting/decoration.dart Decoration.padding

type DecorationImage

type DecorationImage struct {
	// Image is the image to be painted into the decoration.
	Image ImageProvider
	// OnError is called when the image fails to load.
	OnError ImageErrorListener
	// ColorFilter is a color filter to apply to the image before painting it.
	ColorFilter *ui.ColorFilter
	// Fit is how the image should be inscribed into the box; unspecified is
	// scaleDown, or fill with a CenterSlice.
	Fit BoxFit
	// Alignment is how to align the image within its bounds; nil is center.
	Alignment AlignmentGeometry
	// CenterSlice is the center slice of a nine-patch image.
	CenterSlice foundation.Opt[ui.Rect]
	// Repeat is how to paint any portions of the box not covered by the image;
	// unspecified is noRepeat.
	Repeat ImageRepeat
	// MatchTextDirection says whether to paint the image in the direction of the
	// TextDirection.
	MatchTextDirection bool
	// Scale is the scale factor applied to the image; the default is 1.
	Scale float64
	// Opacity is the opacity of the image, 0 to 1; the default is 1.
	Opacity float64
	// FilterQuality is the quality of sampling; the default is medium.
	FilterQuality ui.FilterQuality
	// InvertColors says whether the colors of the image are inverted.
	InvertColors bool
	// IsAntiAlias says whether to paint the image with anti-aliasing.
	IsAntiAlias bool
}

DecorationImage is an image for a box decoration: the provider and how to paint it. It implements DecorationImageSource.

Flutter: painting/decoration_image.dart DecorationImage

func NewDecorationImage

func NewDecorationImage(image ImageProvider, opts ...DecorationImageOpts) *DecorationImage

NewDecorationImage creates an image for a decoration.

Flutter: painting/decoration_image.dart DecorationImage.new

func (*DecorationImage) Blended

Blended returns the image that paints a and b on top of each other, blended by t.

Flutter: painting/decoration_image.dart DecorationImage.lerp

func (*DecorationImage) CreatePainter

func (d *DecorationImage) CreatePainter(onChanged func()) DecorationImagePainter

CreatePainter creates a painter for this image, which calls onChanged when it must be repainted.

Flutter: painting/decoration_image.dart DecorationImage.createPainter

func (*DecorationImage) Equal

func (d *DecorationImage) Equal(other DecorationImageSource) bool

Equal is Dart's == on decoration images.

Flutter: painting/decoration_image.dart DecorationImage.operator ==

func (*DecorationImage) String

func (d *DecorationImage) String() string

String describes the image.

Flutter: painting/decoration_image.dart DecorationImage.toString

type DecorationImageOpts

type DecorationImageOpts struct {
	// OnError is called when the image fails to load.
	OnError ImageErrorListener
	// ColorFilter is applied to the image before painting it.
	ColorFilter *ui.ColorFilter
	// Fit is how the image is inscribed into the box.
	Fit BoxFit
	// Alignment defaults to center.
	Alignment AlignmentGeometry
	// CenterSlice is the center slice of a nine-patch image.
	CenterSlice foundation.Opt[ui.Rect]
	// Repeat defaults to noRepeat.
	Repeat ImageRepeat
	// MatchTextDirection defaults to false.
	MatchTextDirection bool
	// Scale defaults to 1.
	Scale foundation.Opt[float64]
	// Opacity defaults to 1.
	Opacity foundation.Opt[float64]
	// FilterQuality defaults to medium.
	FilterQuality ui.FilterQuality
	// InvertColors defaults to false.
	InvertColors bool
	// IsAntiAlias defaults to false.
	IsAntiAlias bool
}

DecorationImageOpts are the optional parameters of NewDecorationImage.

Flutter: painting/decoration_image.dart DecorationImage.new

type DecorationImagePaintOpts

type DecorationImagePaintOpts struct {
	// Blend multiplies the opacity of the image; the default is 1.
	Blend foundation.Opt[float64]
	// BlendMode is how the image combines with what is below; the default is
	// srcOver.
	BlendMode ui.BlendMode
}

DecorationImagePaintOpts are the optional parameters of DecorationImagePainter.Paint.

Flutter: painting/decoration_image.dart DecorationImagePainter.paint

type DecorationImagePainter

type DecorationImagePainter interface {
	// Paint draws the image onto the canvas in the rect, clipped to clipPath
	// when it is not nil.
	Paint(canvas *ui.Canvas, rect ui.Rect, clipPath *ui.Path, configuration ImageConfiguration, opts ...DecorationImagePaintOpts)
	// Dispose discards the resources used by the painter.
	Dispose()
}

DecorationImagePainter draws a DecorationImage.

Flutter: painting/decoration_image.dart DecorationImagePainter

type DecorationImageSource

type DecorationImageSource interface {
	// CreatePainter creates a painter that draws the image and calls onChanged
	// when it must be redrawn.
	CreatePainter(onChanged func()) DecorationImagePainter
	// Blended returns the image that interpolates from a to b at t, where one
	// of them is the receiver. It is used by DecorationImageLerp when the two
	// images differ.
	Blended(a, b DecorationImageSource, t float64) DecorationImageSource
	// Equal reports whether the other image is equal.
	Equal(other DecorationImageSource) bool
}

DecorationImageSource is the image of a BoxDecoration or ShapeDecoration: an image, how to fit it, and so on. *DecorationImage implements it, as does the blend of two images. A nil DecorationImageSource is Flutter's null.

Flutter: painting/decoration_image.dart DecorationImage

func DecorationImageLerp

func DecorationImageLerp(a, b DecorationImageSource, t float64) DecorationImageSource

DecorationImageLerp linearly interpolates between two decoration images, either of which may be nil. It paints both on top of each other, blended together, when they differ.

Flutter: painting/decoration_image.dart DecorationImage.lerp

type EdgeInsets

type EdgeInsets struct {
	// Left is the offset from the left.
	Left float64
	// Top is the offset from the top.
	Top float64
	// Right is the offset from the right.
	Right float64
	// Bottom is the offset from the bottom.
	Bottom float64
}

EdgeInsets is an immutable set of offsets in each of the four cardinal directions. Create one with a literal, NewEdgeInsetsAll, NewEdgeInsetsSymmetric, NewEdgeInsetsFromLTRB or NewEdgeInsetsFromViewPadding.

Flutter: painting/edge_insets.dart EdgeInsets

func EdgeInsetsLerp

func EdgeInsetsLerp(a, b *EdgeInsets, t float64) *EdgeInsets

EdgeInsetsLerp linearly interpolates between two EdgeInsets. Either may be nil, which counts as zero.

Flutter: painting/edge_insets.dart EdgeInsets.lerp

func NewEdgeInsetsAll

func NewEdgeInsetsAll(value float64) EdgeInsets

NewEdgeInsetsAll creates insets where all the offsets are value.

Flutter: painting/edge_insets.dart EdgeInsets.all

func NewEdgeInsetsFromLTRB

func NewEdgeInsetsFromLTRB(left, top, right, bottom float64) EdgeInsets

NewEdgeInsetsFromLTRB creates insets from offsets from the left, top, right, and bottom.

Flutter: painting/edge_insets.dart EdgeInsets.fromLTRB

func NewEdgeInsetsFromViewPadding

func NewEdgeInsetsFromViewPadding(padding ui.ViewPadding, devicePixelRatio float64) EdgeInsets

NewEdgeInsetsFromViewPadding creates insets that match the padding of a view, converted from physical to logical pixels.

Flutter: painting/edge_insets.dart EdgeInsets.fromViewPadding

func NewEdgeInsetsSymmetric

func NewEdgeInsetsSymmetric(vertical, horizontal float64) EdgeInsets

NewEdgeInsetsSymmetric creates insets with symmetrical vertical and horizontal offsets.

Flutter: painting/edge_insets.dart EdgeInsets.symmetric

func (EdgeInsets) Add

Add returns the result of adding the distances of other.

Flutter: painting/edge_insets.dart EdgeInsets.add

func (EdgeInsets) Along

func (e EdgeInsets) Along(axis Axis) float64

Along is the total offset along the axis.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.along

func (EdgeInsets) BottomLeft

func (e EdgeInsets) BottomLeft() ui.Offset

BottomLeft is the vector from the bottom left of a rectangle to the bottom left of that rectangle inset by this object.

Flutter: painting/edge_insets.dart EdgeInsets.bottomLeft

func (EdgeInsets) BottomRight

func (e EdgeInsets) BottomRight() ui.Offset

BottomRight is the vector from the bottom right of a rectangle to the bottom right of that rectangle inset by this object.

Flutter: painting/edge_insets.dart EdgeInsets.bottomRight

func (EdgeInsets) Clamp

Clamp clamps each distance between those of min and max.

Flutter: painting/edge_insets.dart EdgeInsets.clamp

func (EdgeInsets) CollapsedSize

func (e EdgeInsets) CollapsedSize() ui.Size

CollapsedSize is a size that will contain the offsets.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.collapsedSize

func (EdgeInsets) CopyWith

func (e EdgeInsets) CopyWith(c EdgeInsetsCopy) EdgeInsets

CopyWith returns a copy with the given distances replaced.

Flutter: painting/edge_insets.dart EdgeInsets.copyWith

func (EdgeInsets) DeflateRRect

func (e EdgeInsets) DeflateRRect(r ui.RRect) ui.RRect

DeflateRRect returns a rounded rect shrunk by the insets, whose radii shrink too.

Flutter: painting/edge_insets.dart EdgeInsets.deflateRRect

func (EdgeInsets) DeflateRect

func (e EdgeInsets) DeflateRect(r ui.Rect) ui.Rect

DeflateRect returns a new rect that is smaller than the given rect in each direction by the amount of inset in each direction.

Flutter: painting/edge_insets.dart EdgeInsets.deflateRect

func (EdgeInsets) DeflateSize

func (e EdgeInsets) DeflateSize(s ui.Size) ui.Size

DeflateSize returns the size shrunk by the insets.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.deflateSize

func (EdgeInsets) Div

func (e EdgeInsets) Div(k float64) EdgeInsets

Div divides the distances by k.

Flutter: painting/edge_insets.dart EdgeInsets.operator /

func (EdgeInsets) Equal

func (e EdgeInsets) Equal(o EdgeInsetsGeometry) bool

Equal reports whether the six distances are equal.

Flutter: painting/edge_insets.dart EdgeInsets.operator ==

func (EdgeInsets) Flipped

func (e EdgeInsets) Flipped() EdgeInsets

Flipped is an EdgeInsets with top and bottom, left and right flipped.

Flutter: painting/edge_insets.dart EdgeInsets.flipped

func (EdgeInsets) Horizontal

func (e EdgeInsets) Horizontal() float64

Horizontal is the total offset in the horizontal direction.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.horizontal

func (EdgeInsets) InflateRRect

func (e EdgeInsets) InflateRRect(r ui.RRect) ui.RRect

InflateRRect returns a rounded rect grown by the insets, whose radii grow too.

Flutter: painting/edge_insets.dart EdgeInsets.inflateRRect

func (EdgeInsets) InflateRect

func (e EdgeInsets) InflateRect(r ui.Rect) ui.Rect

InflateRect returns a new rect that is bigger than the given rect in each direction by the amount of inset in each direction.

Flutter: painting/edge_insets.dart EdgeInsets.inflateRect

func (EdgeInsets) InflateSize

func (e EdgeInsets) InflateSize(s ui.Size) ui.Size

InflateSize returns the size grown by the insets.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.inflateSize

func (EdgeInsets) IsNonNegative

func (e EdgeInsets) IsNonNegative() bool

IsNonNegative reports whether every distance is zero or more.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.isNonNegative

func (EdgeInsets) Minus

func (e EdgeInsets) Minus(o EdgeInsets) EdgeInsets

Minus returns an EdgeInsets where the distances of other are subtracted from these.

Flutter: painting/edge_insets.dart EdgeInsets.operator -

func (EdgeInsets) Mod

func (e EdgeInsets) Mod(k float64) EdgeInsets

Mod takes the modulo k of the distances.

Flutter: painting/edge_insets.dart EdgeInsets.operator %

func (EdgeInsets) Mul

func (e EdgeInsets) Mul(k float64) EdgeInsets

Mul scales the distances by k.

Flutter: painting/edge_insets.dart EdgeInsets.operator *

func (EdgeInsets) Neg

func (e EdgeInsets) Neg() EdgeInsets

Neg returns the insets with every distance negated.

Flutter: painting/edge_insets.dart EdgeInsets.unary-

func (EdgeInsets) Plus

func (e EdgeInsets) Plus(o EdgeInsets) EdgeInsets

Plus returns an EdgeInsets where the distances of other are added to these.

Flutter: painting/edge_insets.dart EdgeInsets.operator +

func (EdgeInsets) Resolve

Resolve returns the insets themselves: they do not depend on the direction.

Flutter: painting/edge_insets.dart EdgeInsets.resolve

func (EdgeInsets) String

func (e EdgeInsets) String() string

String describes the insets, such as "EdgeInsets.all(8.0)".

Flutter: painting/edge_insets.dart EdgeInsets.toString

func (EdgeInsets) Subtract

Subtract returns the result of subtracting the distances of other.

Flutter: painting/edge_insets.dart EdgeInsets.subtract

func (EdgeInsets) TopLeft

func (e EdgeInsets) TopLeft() ui.Offset

TopLeft is an Offset describing the vector from the top left of a rectangle to the top left of that rectangle inset by this object.

Flutter: painting/edge_insets.dart EdgeInsets.topLeft

func (EdgeInsets) TopRight

func (e EdgeInsets) TopRight() ui.Offset

TopRight is the vector from the top right of a rectangle to the top right of that rectangle inset by this object.

Flutter: painting/edge_insets.dart EdgeInsets.topRight

func (EdgeInsets) TruncDiv

func (e EdgeInsets) TruncDiv(k float64) EdgeInsets

TruncDiv integer-divides the distances by k.

Flutter: painting/edge_insets.dart EdgeInsets.operator ~/

func (EdgeInsets) Vertical

func (e EdgeInsets) Vertical() float64

Vertical is the total offset in the vertical direction.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.vertical

type EdgeInsetsCopy

type EdgeInsetsCopy struct {
	Left, Top, Right, Bottom foundation.Opt[float64]
}

EdgeInsetsCopy holds the distances EdgeInsets.CopyWith replaces; the ones that are None keep their value.

Flutter: painting/edge_insets.dart EdgeInsets.copyWith

type EdgeInsetsDirectional

type EdgeInsetsDirectional struct {
	// Start is the offset from the start side, the left in left-to-right text.
	Start float64
	// Top is the offset from the top.
	Top float64
	// End is the offset from the end side, the right in left-to-right text.
	End float64
	// Bottom is the offset from the bottom.
	Bottom float64
}

EdgeInsetsDirectional is an immutable set of offsets in each of the four cardinal directions, but whose horizontal components are dependent on the writing direction.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional

func EdgeInsetsDirectionalLerp

func EdgeInsetsDirectionalLerp(a, b *EdgeInsetsDirectional, t float64) *EdgeInsetsDirectional

EdgeInsetsDirectionalLerp linearly interpolates between two EdgeInsetsDirectional. Either may be nil, which counts as zero.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.lerp

func NewEdgeInsetsDirectionalAll

func NewEdgeInsetsDirectionalAll(value float64) EdgeInsetsDirectional

NewEdgeInsetsDirectionalAll creates insets where all the offsets are value.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.all

func NewEdgeInsetsDirectionalFromSTEB

func NewEdgeInsetsDirectionalFromSTEB(start, top, end, bottom float64) EdgeInsetsDirectional

NewEdgeInsetsDirectionalFromSTEB creates insets from offsets from the start, top, end, and bottom.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.fromSTEB

func NewEdgeInsetsDirectionalSymmetric

func NewEdgeInsetsDirectionalSymmetric(horizontal, vertical float64) EdgeInsetsDirectional

NewEdgeInsetsDirectionalSymmetric creates insets with symmetrical vertical and horizontal offsets.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.symmetric

func (EdgeInsetsDirectional) Add

Add returns the result of adding the distances of other.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.add

func (EdgeInsetsDirectional) Along

func (e EdgeInsetsDirectional) Along(axis Axis) float64

Along is the total offset along the axis.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.along

func (EdgeInsetsDirectional) Clamp

Clamp clamps each distance between those of min and max.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.clamp

func (EdgeInsetsDirectional) CollapsedSize

func (e EdgeInsetsDirectional) CollapsedSize() ui.Size

CollapsedSize is a size that will contain the offsets.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.collapsedSize

func (EdgeInsetsDirectional) CopyWith

CopyWith returns a copy with the given distances replaced.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.copyWith

func (EdgeInsetsDirectional) DeflateSize

func (e EdgeInsetsDirectional) DeflateSize(s ui.Size) ui.Size

DeflateSize returns the size shrunk by the insets.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.deflateSize

func (EdgeInsetsDirectional) Div

Div divides the distances by k.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.operator /

func (EdgeInsetsDirectional) Equal

Equal reports whether the six distances are equal.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.operator ==

func (EdgeInsetsDirectional) Flipped

Flipped is an EdgeInsetsDirectional with top and bottom, start and end flipped.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.flipped

func (EdgeInsetsDirectional) Horizontal

func (e EdgeInsetsDirectional) Horizontal() float64

Horizontal is the total offset in the horizontal direction.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.horizontal

func (EdgeInsetsDirectional) InflateSize

func (e EdgeInsetsDirectional) InflateSize(s ui.Size) ui.Size

InflateSize returns the size grown by the insets.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.inflateSize

func (EdgeInsetsDirectional) IsNonNegative

func (e EdgeInsetsDirectional) IsNonNegative() bool

IsNonNegative reports whether every distance is zero or more.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.isNonNegative

func (EdgeInsetsDirectional) Minus

Minus returns the insets where the distances of other are subtracted.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.operator -

func (EdgeInsetsDirectional) Mod

Mod takes the modulo k of the distances.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.operator %

func (EdgeInsetsDirectional) Mul

Mul scales the distances by k.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.operator *

func (EdgeInsetsDirectional) Neg

Neg returns the insets with every distance negated.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.unary-

func (EdgeInsetsDirectional) Plus

Plus returns the insets where the distances of other are added.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.operator +

func (EdgeInsetsDirectional) Resolve

func (e EdgeInsetsDirectional) Resolve(direction ui.TextDirection) EdgeInsets

Resolve returns an EdgeInsets for the text direction.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.resolve

func (EdgeInsetsDirectional) String

func (e EdgeInsetsDirectional) String() string

String describes the insets, such as "EdgeInsetsDirectional(1.0, 2.0, 3.0, 4.0)".

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.toString

func (EdgeInsetsDirectional) Subtract

Subtract returns the result of subtracting the distances of other.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.subtract

func (EdgeInsetsDirectional) TruncDiv

TruncDiv integer-divides the distances by k.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.operator ~/

func (EdgeInsetsDirectional) Vertical

func (e EdgeInsetsDirectional) Vertical() float64

Vertical is the total offset in the vertical direction.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.vertical

type EdgeInsetsDirectionalCopy

type EdgeInsetsDirectionalCopy struct {
	Start, Top, End, Bottom foundation.Opt[float64]
}

EdgeInsetsDirectionalCopy holds the distances EdgeInsetsDirectional.CopyWith replaces; the ones that are None keep their value.

Flutter: painting/edge_insets.dart EdgeInsetsDirectional.copyWith

type EdgeInsetsGeometry

type EdgeInsetsGeometry interface {
	// IsNonNegative reports whether every distance is zero or more.
	IsNonNegative() bool
	// Horizontal is the total offset in the horizontal direction.
	Horizontal() float64
	// Vertical is the total offset in the vertical direction.
	Vertical() float64
	// Along is the total offset along the axis.
	Along(axis Axis) float64
	// CollapsedSize is a size that will contain the offsets: Size(Horizontal, Vertical).
	CollapsedSize() ui.Size
	// InflateSize returns the size grown by the insets.
	InflateSize(size ui.Size) ui.Size
	// DeflateSize returns the size shrunk by the insets.
	DeflateSize(size ui.Size) ui.Size
	// Subtract returns the result of subtracting the distances of other.
	Subtract(other EdgeInsetsGeometry) EdgeInsetsGeometry
	// Add returns the result of adding the distances of other.
	Add(other EdgeInsetsGeometry) EdgeInsetsGeometry
	// Clamp clamps each distance between those of min and max.
	Clamp(min, max EdgeInsetsGeometry) EdgeInsetsGeometry
	// Resolve returns an EdgeInsets for the text direction. A directional
	// value panics with the tag TextDirectionRequired in debug builds if the
	// direction is unspecified.
	Resolve(direction ui.TextDirection) EdgeInsets
	// Equal reports whether the six distances are equal.
	Equal(other EdgeInsetsGeometry) bool
	String() string
	// contains filtered or unexported methods
}

EdgeInsetsGeometry is a base for EdgeInsets and EdgeInsetsDirectional, which describe offsets from each side of a box. Its covariant operations (Flipped, Neg, Mul, Div, TruncDiv and Mod) are the functions EdgeInsetsGeometryFlipped, EdgeInsetsGeometryNeg, … and the methods of the concrete types.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry

var EdgeInsetsGeometryInfinity EdgeInsetsGeometry = mixedEdgeInsets(edgeParts{
	math.Inf(1), math.Inf(1), math.Inf(1), math.Inf(1), math.Inf(1), math.Inf(1)})

EdgeInsetsGeometryInfinity is an EdgeInsetsGeometry with infinite offsets in every direction.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.infinity

func EdgeInsetsGeometryDiv

func EdgeInsetsGeometryDiv(g EdgeInsetsGeometry, k float64) EdgeInsetsGeometry

EdgeInsetsGeometryDiv divides every distance by k.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.operator /

func EdgeInsetsGeometryFlipped

func EdgeInsetsGeometryFlipped(g EdgeInsetsGeometry) EdgeInsetsGeometry

EdgeInsetsGeometryFlipped returns the insets with left and right swapped, and top and bottom.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.flipped

func EdgeInsetsGeometryLerp

func EdgeInsetsGeometryLerp(a, b EdgeInsetsGeometry, t float64) EdgeInsetsGeometry

EdgeInsetsGeometryLerp linearly interpolates between two EdgeInsetsGeometry objects. Either may be nil, which counts as zero; a nil result is returned for two nil values.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.lerp

func EdgeInsetsGeometryMod

func EdgeInsetsGeometryMod(g EdgeInsetsGeometry, k float64) EdgeInsetsGeometry

EdgeInsetsGeometryMod takes the modulo k of every distance.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.operator %

func EdgeInsetsGeometryMul

func EdgeInsetsGeometryMul(g EdgeInsetsGeometry, k float64) EdgeInsetsGeometry

EdgeInsetsGeometryMul multiplies every distance by k.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.operator *

func EdgeInsetsGeometryNeg

func EdgeInsetsGeometryNeg(g EdgeInsetsGeometry) EdgeInsetsGeometry

EdgeInsetsGeometryNeg negates every distance.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.operator -

func EdgeInsetsGeometryTruncDiv

func EdgeInsetsGeometryTruncDiv(g EdgeInsetsGeometry, k float64) EdgeInsetsGeometry

EdgeInsetsGeometryTruncDiv integer-divides every distance by k.

Flutter: painting/edge_insets.dart EdgeInsetsGeometry.operator ~/

func OutlinedBorderDimensions

func OutlinedBorderDimensions(side BorderSide) EdgeInsetsGeometry

OutlinedBorderDimensions is the default Dimensions of an OutlinedBorder: the stroke inset of the side on all sides.

Flutter: painting/borders.dart OutlinedBorder.dimensions

type ExactAssetImage

type ExactAssetImage struct {
	// AssetName is the key of the asset.
	AssetName string
	// Scale is the scale to place in the ImageInfo.
	Scale float64
	// Bundle is the bundle to load the asset from; nil uses the configuration's,
	// then the binding's root bundle.
	Bundle services.AssetBundle
	// Package is the package the asset is in; "" for none.
	Package string
}

ExactAssetImage loads an image from an AssetBundle using the exact asset specified by name, without choosing a variant for the device pixel ratio.

Flutter: painting/image_provider.dart ExactAssetImage

func NewExactAssetImage

func NewExactAssetImage(assetName string, opts ...ExactAssetImageOpts) *ExactAssetImage

NewExactAssetImage creates a provider for the asset.

Flutter: painting/image_provider.dart ExactAssetImage.new

func (*ExactAssetImage) KeyName

func (e *ExactAssetImage) KeyName() string

KeyName is the name of the asset with the package prefix.

Flutter: painting/image_provider.dart ExactAssetImage.keyName

func (*ExactAssetImage) LoadImage

func (e *ExactAssetImage) LoadImage(binding *PaintingBinding, key any, decode ImageDecoderCallback) *ImageStreamCompleter

LoadImage loads the asset of the key.

Flutter: painting/image_provider.dart AssetBundleImageProvider.loadImage

func (*ExactAssetImage) ObtainKey

func (e *ExactAssetImage) ObtainKey(binding *PaintingBinding, configuration ImageConfiguration) (any, error)

ObtainKey makes the key from the bundle, the asset name and the scale.

Flutter: painting/image_provider.dart ExactAssetImage.obtainKey

func (*ExactAssetImage) String

func (e *ExactAssetImage) String() string

String describes the provider.

Flutter: painting/image_provider.dart ExactAssetImage.toString

type ExactAssetImageOpts

type ExactAssetImageOpts struct {
	// Scale defaults to 1.
	Scale foundation.Opt[float64]
	// Bundle is the bundle to load the asset from.
	Bundle services.AssetBundle
	// Package is the package the asset is in.
	Package string
}

ExactAssetImageOpts are the optional parameters of NewExactAssetImage.

Flutter: painting/image_provider.dart ExactAssetImage.new

type FileImage

type FileImage struct {
	// Path is the path of the image file.
	Path string
	// Scale is the scale to place in the ImageInfo.
	Scale float64
}

FileImage decodes the given file as an image, associating it with the given scale.

Flutter: painting/image_provider.dart FileImage

func NewFileImage

func NewFileImage(path string, scale ...float64) FileImage

NewFileImage creates a provider for the image file.

Flutter: painting/image_provider.dart FileImage.new

func (FileImage) LoadImage

func (f FileImage) LoadImage(binding *PaintingBinding, key any, decode ImageDecoderCallback) *ImageStreamCompleter

LoadImage reads the file and decodes it.

Flutter: painting/image_provider.dart FileImage.loadImage

func (FileImage) ObtainKey

ObtainKey returns the provider itself as the key.

Flutter: painting/image_provider.dart FileImage.obtainKey

func (FileImage) String

func (f FileImage) String() string

String describes the provider.

Flutter: painting/image_provider.dart FileImage.toString

type FittedSizes

type FittedSizes struct {
	// Source is the size of the part of the input to show.
	Source ui.Size
	// Destination is the size of the part of the output to show it on.
	Destination ui.Size
}

FittedSizes is the pair of sizes that applyBoxFit computes.

Flutter: painting/box_fit.dart FittedSizes

func ApplyBoxFit

func ApplyBoxFit(fit BoxFit, inputSize, outputSize ui.Size) FittedSizes

ApplyBoxFit apportions the input size and output size by the fit: the part of the input to show and the part of the output to draw it on. An unspecified fit is treated as BoxFitFill.

Flutter: painting/box_fit.dart applyBoxFit

type FlutterLogoDecoration

type FlutterLogoDecoration struct {
	DecorationDefaults
	// TextColor is the color used to paint the "Flutter" text.
	TextColor ui.Color
	// Style is what that logo should look like.
	Style FlutterLogoStyle
	// Margin is how far to inset the logo from the edge of the container.
	Margin EdgeInsets
	// TextEngine makes the paragraph of the "Flutter" text. Deviation: Dart
	// reaches a global font collection; here the engine is a parameter, and
	// with none the text is not painted.
	TextEngine ui.ParagraphFactory
	// contains filtered or unexported fields
}

FlutterLogoDecoration is an immutable description of the Flutter logo.

Flutter: painting/flutter_logo.dart FlutterLogoDecoration

func FlutterLogoDecorationLerp

func FlutterLogoDecorationLerp(a, b *FlutterLogoDecoration, t float64) *FlutterLogoDecoration

FlutterLogoDecorationLerp linearly interpolates between two Flutter logo decorations. Either may be nil.

Flutter: painting/flutter_logo.dart FlutterLogoDecoration.lerp

func NewFlutterLogoDecoration

func NewFlutterLogoDecoration(opts ...FlutterLogoDecorationOpts) *FlutterLogoDecoration

NewFlutterLogoDecoration creates a decoration that paints the Flutter logo.

Flutter: painting/flutter_logo.dart FlutterLogoDecoration.new

func (*FlutterLogoDecoration) CreateBoxPainter

func (d *FlutterLogoDecoration) CreateBoxPainter(func()) BoxPainter

CreateBoxPainter returns a painter for the logo.

Flutter: painting/flutter_logo.dart FlutterLogoDecoration.createBoxPainter

func (*FlutterLogoDecoration) DebugAssertIsValid

func (d *FlutterLogoDecoration) DebugAssertIsValid() bool

DebugAssertIsValid panics with the tag FlutterLogoInvalid, in debug builds, if the position isn't finite or the opacity is out of range.

Flutter: painting/flutter_logo.dart FlutterLogoDecoration.debugAssertIsValid

func (*FlutterLogoDecoration) DebugFillProperties

DebugFillProperties adds the text color, the style and the transition.

Flutter: painting/flutter_logo.dart FlutterLogoDecoration.debugFillProperties

func (*FlutterLogoDecoration) Equal

Equal reports whether the other decoration is equal: same text color, position and opacity.

Flutter: painting/flutter_logo.dart FlutterLogoDecoration.operator ==

func (*FlutterLogoDecoration) GetClipPath

func (d *FlutterLogoDecoration) GetClipPath(rect ui.Rect, _ ui.TextDirection) *ui.Path

GetClipPath is the rect.

Flutter: painting/flutter_logo.dart FlutterLogoDecoration.getClipPath

func (*FlutterLogoDecoration) HitTest

HitTest is always true.

Flutter: painting/flutter_logo.dart FlutterLogoDecoration.hitTest

func (*FlutterLogoDecoration) IsComplex

func (d *FlutterLogoDecoration) IsComplex() bool

IsComplex is whether the logo is not in a transition.

Flutter: painting/flutter_logo.dart FlutterLogoDecoration.isComplex

func (*FlutterLogoDecoration) LerpFrom

LerpFrom interpolates from a FlutterLogoDecoration or nil.

Flutter: painting/flutter_logo.dart FlutterLogoDecoration.lerpFrom

func (*FlutterLogoDecoration) LerpTo

LerpTo interpolates to a FlutterLogoDecoration or nil.

Flutter: painting/flutter_logo.dart FlutterLogoDecoration.lerpTo

func (*FlutterLogoDecoration) String

func (d *FlutterLogoDecoration) String() string

String describes the decoration and its properties.

Flutter: painting/flutter_logo.dart FlutterLogoDecoration.toString

func (*FlutterLogoDecoration) ToStringShort

func (d *FlutterLogoDecoration) ToStringShort() string

ToStringShort names the decoration.

Flutter: painting/decoration.dart Decoration.toStringShort

type FlutterLogoDecorationOpts

type FlutterLogoDecorationOpts struct {
	// TextColor defaults to 0xFF757575.
	TextColor foundation.Opt[ui.Color]
	// Style defaults to FlutterLogoStyleMarkOnly.
	Style FlutterLogoStyle
	// Margin defaults to zero.
	Margin EdgeInsets
	// TextEngine makes the paragraph of the "Flutter" text; with none the text
	// is not painted.
	TextEngine ui.ParagraphFactory
}

FlutterLogoDecorationOpts are the optional parameters of NewFlutterLogoDecoration.

Flutter: painting/flutter_logo.dart FlutterLogoDecoration.new

type FlutterLogoStyle

type FlutterLogoStyle int

FlutterLogoStyle is an immutable style description of how to paint the Flutter logo. The zero value is FlutterLogoStyleUnspecified: markOnly.

Flutter: painting/flutter_logo.dart FlutterLogoStyle

const (
	// FlutterLogoStyleUnspecified is the zero value: the default (mark only).
	FlutterLogoStyleUnspecified FlutterLogoStyle = iota
	// FlutterLogoStyleMarkOnly is only the Flutter logo, no text.
	//
	// Flutter: painting/flutter_logo.dart FlutterLogoStyle.markOnly
	FlutterLogoStyleMarkOnly
	// FlutterLogoStyleHorizontal is the mark and the text next to it.
	//
	// Flutter: painting/flutter_logo.dart FlutterLogoStyle.horizontal
	FlutterLogoStyleHorizontal
	// FlutterLogoStyleStacked is the mark with the text below it.
	//
	// Flutter: painting/flutter_logo.dart FlutterLogoStyle.stacked
	FlutterLogoStyleStacked
)

The values of FlutterLogoStyle follow Flutter's declaration order.

func (FlutterLogoStyle) Name

func (s FlutterLogoStyle) Name() string

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

Flutter: painting/flutter_logo.dart FlutterLogoStyle.name

func (FlutterLogoStyle) String

func (s FlutterLogoStyle) String() string

String returns the name Dart prints, such as "FlutterLogoStyle.stacked".

Flutter: painting/flutter_logo.dart FlutterLogoStyle.toString

type FractionalOffset

type FractionalOffset struct{ Alignment }

FractionalOffset is an offset that's expressed as a fraction of a Size: (0, 0) is the top left, (1, 1) the bottom right. It is an Alignment, whose x and y run from -1 to 1, so it embeds one.

Flutter: painting/fractional_offset.dart FractionalOffset

func FractionalOffsetLerp

func FractionalOffsetLerp(a, b *FractionalOffset, t float64) *FractionalOffset

FractionalOffsetLerp linearly interpolates between two fractional offsets, either of which may be nil, which stands for the center.

Flutter: painting/fractional_offset.dart FractionalOffset.lerp

func NewFractionalOffset

func NewFractionalOffset(dx, dy float64) FractionalOffset

NewFractionalOffset creates a fractional offset from the fractions of the width and the height.

Flutter: painting/fractional_offset.dart FractionalOffset.new

func NewFractionalOffsetFromOffsetAndRect

func NewFractionalOffsetFromOffsetAndRect(offset ui.Offset, rect ui.Rect) FractionalOffset

NewFractionalOffsetFromOffsetAndRect returns the fractional offset of the offset in the rectangle.

Flutter: painting/fractional_offset.dart FractionalOffset.fromOffsetAndRect

func NewFractionalOffsetFromOffsetAndSize

func NewFractionalOffsetFromOffsetAndSize(offset ui.Offset, size ui.Size) FractionalOffset

NewFractionalOffsetFromOffsetAndSize returns the fractional offset of the offset in a rectangle of the size, with its top left at the origin.

Flutter: painting/fractional_offset.dart FractionalOffset.fromOffsetAndSize

func (FractionalOffset) Add

Add returns the sum of the components of this and other, as a FractionalOffset if other is one.

Flutter: painting/fractional_offset.dart FractionalOffset.operator +

func (FractionalOffset) DX

func (f FractionalOffset) DX() float64

DX is the distance fraction in the horizontal direction.

Flutter: painting/fractional_offset.dart FractionalOffset.dx

func (FractionalOffset) DY

func (f FractionalOffset) DY() float64

DY is the distance fraction in the vertical direction.

Flutter: painting/fractional_offset.dart FractionalOffset.dy

func (FractionalOffset) Div

Div divides both fractions by k.

Flutter: painting/fractional_offset.dart FractionalOffset.operator /

func (FractionalOffset) Minus

Minus is the difference of two fractional offsets.

Flutter: painting/fractional_offset.dart FractionalOffset.operator -

func (FractionalOffset) Mod

Mod takes the modulo k of both fractions.

Flutter: painting/fractional_offset.dart FractionalOffset.operator %

func (FractionalOffset) Mul

Mul scales both fractions by k.

Flutter: painting/fractional_offset.dart FractionalOffset.operator *

func (FractionalOffset) Neg

Neg negates both fractions.

Flutter: painting/fractional_offset.dart FractionalOffset.operator unary-

func (FractionalOffset) Plus

Plus is the sum of two fractional offsets.

Flutter: painting/fractional_offset.dart FractionalOffset.operator +

func (FractionalOffset) String

func (f FractionalOffset) String() string

String describes the offset.

Flutter: painting/fractional_offset.dart FractionalOffset.toString

func (FractionalOffset) TruncDiv

TruncDiv integer-divides both fractions by k.

Flutter: painting/fractional_offset.dart FractionalOffset.operator ~/

type GetParagraphStyleOpts

type GetParagraphStyleOpts struct {
	// TextAlign is the alignment of the text in the lines.
	TextAlign ui.TextAlign
	// TextDirection is the directionality of the text.
	TextDirection ui.TextDirection
	// TextScaler scales the font sizes; the default is TextScalerNoScaling.
	TextScaler TextScaler
	// Ellipsis replaces the text that doesn't fit when MaxLines is exceeded.
	Ellipsis string
	// MaxLines is the maximum number of lines; it must be greater than zero.
	MaxLines foundation.Opt[int]
	// TextHeightBehavior says how Height applies to the first and last line.
	TextHeightBehavior *ui.TextHeightBehavior
	// Locale selects region-specific glyphs.
	Locale foundation.Opt[ui.Locale]
	// FontFamily overrides the style's family.
	FontFamily string
	// FontSize overrides the style's font size.
	FontSize foundation.Opt[float64]
	// FontWeight overrides the style's weight.
	FontWeight ui.FontWeight
	// FontStyle overrides the style's font style.
	FontStyle ui.FontStyle
	// Height overrides the style's height.
	Height foundation.Opt[float64]
	// StrutStyle is the strut of the paragraph.
	StrutStyle *StrutStyle
	// TabSize is the distance between tab stops as a count of the advance of a space; 0 gives
	// tabs no stops.
	//
	// Flutter: no counterpart
	TabSize float64
}

GetParagraphStyleOpts are the optional parameters of TextStyle.GetParagraphStyle.

Flutter: painting/text_style.dart TextStyle.getParagraphStyle

type GetTextStyleOpts

type GetTextStyleOpts struct {
	// TextScaler scales the font size; the default is TextScalerNoScaling.
	TextScaler TextScaler
}

GetTextStyleOpts are the optional parameters of TextStyle.GetTextStyle.

Flutter: painting/text_style.dart TextStyle.getTextStyle

type Gradient

type Gradient interface {
	// GetColors is the colors the gradient should obtain at each of the stops.
	GetColors() []ui.Color
	// GetStops is the stops that say where each color is obtained; nil spaces
	// the colors evenly.
	GetStops() []float64
	// GetTransform is the transform of the gradient; nil for none.
	GetTransform() GradientTransform
	// CreateShader creates a Shader for the rect.
	CreateShader(rect ui.Rect, textDirection ui.TextDirection) ui.Shader
	// Scale returns a new gradient with its colors scaled by the factor (the
	// alpha channel).
	Scale(factor float64) Gradient
	// WithOpacity returns a new gradient with opacity applied to all its colors.
	WithOpacity(opacity float64) Gradient
	// FromColor returns a gradient of the same kind and geometry with all its
	// colors replaced by color.
	FromColor(color ui.Color) Gradient
	// LerpFrom interpolates from another gradient (possibly nil) to this one;
	// it returns nil if it can't.
	LerpFrom(a Gradient, t float64) Gradient
	// LerpTo interpolates from this gradient to another (possibly nil); it
	// returns nil if it can't.
	LerpTo(b Gradient, t float64) Gradient
	// Equal reports whether the gradients are of the same kind and equal.
	Equal(other Gradient) bool
	String() string
}

Gradient is a 2D gradient. A nil Gradient is Flutter's null. The methods LerpFrom and LerpTo are protected in Flutter; they are exported so that other packages can implement a Gradient.

Flutter: painting/gradient.dart Gradient

func GradientLerp

func GradientLerp(a, b Gradient, t float64) Gradient

GradientLerp linearly interpolates between two gradients. Either may be nil. When they are of different kinds, the result fades the first out and the second in.

Flutter: painting/gradient.dart Gradient.lerp

type GradientRotation

type GradientRotation struct {
	// Radians is the angle of rotation, in radians.
	Radians float64
}

GradientRotation transforms the gradient by rotating it around its center.

Flutter: painting/gradient.dart GradientRotation

func (GradientRotation) String

func (g GradientRotation) String() string

String describes the rotation, such as "GradientRotation(radians: 1.6)".

Flutter: painting/gradient.dart GradientRotation.toString

func (GradientRotation) Transform

func (g GradientRotation) Transform(bounds ui.Rect, _ ui.TextDirection) *ui.Matrix4

Transform returns the rotation around the center of the bounds.

Flutter: painting/gradient.dart GradientRotation.transform

type GradientTransform

type GradientTransform interface {
	// Transform returns the matrix to apply to the gradient in the bounds, or
	// nil for none.
	Transform(bounds ui.Rect, textDirection ui.TextDirection) *ui.Matrix4
}

GradientTransform is a transform applied to a gradient's shader, such as a rotation.

Flutter: painting/gradient.dart GradientTransform

type HSLColor

type HSLColor struct {
	// Alpha is the alpha channel, from 0.0 (transparent) to 1.0 (opaque).
	Alpha float64
	// Hue is the hue, from 0.0 to 360.0.
	Hue float64
	// Saturation is the saturation, from 0.0 to 1.0.
	Saturation float64
	// Lightness is the lightness, from 0.0 to 1.0.
	Lightness float64
}

HSLColor is a color represented using alpha, hue, saturation, and lightness.

Flutter: painting/colors.dart HSLColor

func HSLColorLerp

func HSLColorLerp(a, b *HSLColor, t float64) *HSLColor

HSLColorLerp linearly interpolates between two HSLColors. Either may be nil.

Flutter: painting/colors.dart HSLColor.lerp

func NewHSLColorFromAHSL

func NewHSLColorFromAHSL(alpha, hue, saturation, lightness float64) HSLColor

NewHSLColorFromAHSL creates a color from alpha, hue, saturation and lightness. Components out of range panic in debug builds with the tag ColorComponentOutOfRange.

Flutter: painting/colors.dart HSLColor.fromAHSL

func NewHSLColorFromColor

func NewHSLColorFromColor(color ui.Color) HSLColor

NewHSLColorFromColor creates an HSLColor from a Color.

Flutter: painting/colors.dart HSLColor.fromColor

func (HSLColor) String

func (c HSLColor) String() string

String describes the color.

Flutter: painting/colors.dart HSLColor.toString

func (HSLColor) ToColor

func (c HSLColor) ToColor() ui.Color

ToColor returns the color as an RGB ui.Color.

Flutter: painting/colors.dart HSLColor.toColor

func (HSLColor) WithAlpha

func (c HSLColor) WithAlpha(alpha float64) HSLColor

WithAlpha returns a copy of this color with the alpha channel replaced.

Flutter: painting/colors.dart HSLColor.withAlpha

func (HSLColor) WithHue

func (c HSLColor) WithHue(hue float64) HSLColor

WithHue returns a copy of this color with the hue replaced.

Flutter: painting/colors.dart HSLColor.withHue

func (HSLColor) WithLightness

func (c HSLColor) WithLightness(lightness float64) HSLColor

WithLightness returns a copy of this color with the lightness replaced.

Flutter: painting/colors.dart HSLColor.withLightness

func (HSLColor) WithSaturation

func (c HSLColor) WithSaturation(saturation float64) HSLColor

WithSaturation returns a copy of this color with the saturation replaced.

Flutter: painting/colors.dart HSLColor.withSaturation

type HSVColor

type HSVColor struct {
	// Alpha is the alpha channel, from 0.0 (transparent) to 1.0 (opaque).
	Alpha float64
	// Hue is the hue, from 0.0 to 360.0.
	Hue float64
	// Saturation is the saturation, from 0.0 to 1.0.
	Saturation float64
	// Value is the value (brightness), from 0.0 to 1.0.
	Value float64
}

HSVColor is a color represented using alpha, hue, saturation, and value.

Flutter: painting/colors.dart HSVColor

func HSVColorLerp

func HSVColorLerp(a, b *HSVColor, t float64) *HSVColor

HSVColorLerp linearly interpolates between two HSVColors. Either may be nil.

Flutter: painting/colors.dart HSVColor.lerp

func NewHSVColorFromAHSV

func NewHSVColorFromAHSV(alpha, hue, saturation, value float64) HSVColor

NewHSVColorFromAHSV creates a color from alpha, hue, saturation and value. Components out of range panic in debug builds with the tag ColorComponentOutOfRange.

Flutter: painting/colors.dart HSVColor.fromAHSV

func NewHSVColorFromColor

func NewHSVColorFromColor(color ui.Color) HSVColor

NewHSVColorFromColor creates an HSVColor from a Color.

Flutter: painting/colors.dart HSVColor.fromColor

func (HSVColor) String

func (c HSVColor) String() string

String describes the color.

Flutter: painting/colors.dart HSVColor.toString

func (HSVColor) ToColor

func (c HSVColor) ToColor() ui.Color

ToColor returns the color as an RGB ui.Color.

Flutter: painting/colors.dart HSVColor.toColor

func (HSVColor) WithAlpha

func (c HSVColor) WithAlpha(alpha float64) HSVColor

WithAlpha returns a copy of this color with the alpha channel replaced.

Flutter: painting/colors.dart HSVColor.withAlpha

func (HSVColor) WithHue

func (c HSVColor) WithHue(hue float64) HSVColor

WithHue returns a copy of this color with the hue replaced.

Flutter: painting/colors.dart HSVColor.withHue

func (HSVColor) WithSaturation

func (c HSVColor) WithSaturation(saturation float64) HSVColor

WithSaturation returns a copy of this color with the saturation replaced.

Flutter: painting/colors.dart HSVColor.withSaturation

func (HSVColor) WithValue

func (c HSVColor) WithValue(value float64) HSVColor

WithValue returns a copy of this color with the value replaced.

Flutter: painting/colors.dart HSVColor.withValue

type ImageCache

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

ImageCache class holds a finite number of images in memory, keyed by the object an ImageProvider gives for the image (which must be comparable).

Flutter: painting/image_cache.dart ImageCache

func NewImageCache

func NewImageCache(sched *scheduler.SchedulerBinding) *ImageCache

NewImageCache creates a cache of 1000 images and 100 MiB. The scheduler binding disposes the images after a frame.

Flutter: painting/image_cache.dart ImageCache.new

func (*ImageCache) Clear

func (c *ImageCache) Clear()

Clear evicts all pending and keepAlive entries from the cache. Live images that listeners still use are not cleared.

Flutter: painting/image_cache.dart ImageCache.clear

func (*ImageCache) ClearLiveImages

func (c *ImageCache) ClearLiveImages()

ClearLiveImages clears the live images, so the cache no longer tracks them.

Flutter: painting/image_cache.dart ImageCache.clearLiveImages

func (*ImageCache) ContainsKey

func (c *ImageCache) ContainsKey(key any) bool

ContainsKey reports whether the key is pending or kept alive.

Flutter: painting/image_cache.dart ImageCache.containsKey

func (*ImageCache) CurrentSize

func (c *ImageCache) CurrentSize() int

CurrentSize is the current number of cached images.

Flutter: painting/image_cache.dart ImageCache.currentSize

func (*ImageCache) CurrentSizeBytes

func (c *ImageCache) CurrentSizeBytes() int

CurrentSizeBytes is the current size of the cache in bytes.

Flutter: painting/image_cache.dart ImageCache.currentSizeBytes

func (*ImageCache) Evict

func (c *ImageCache) Evict(key any, includeLive ...bool) bool

Evict removes the image with the key from the cache, as a pending, keepAlive and, unless includeLive is false, live image. It reports whether an entry that was pending or kept alive was removed.

Flutter: painting/image_cache.dart ImageCache.evict

func (*ImageCache) LiveImageCount

func (c *ImageCache) LiveImageCount() int

LiveImageCount is the number of live images being held.

Flutter: painting/image_cache.dart ImageCache.liveImageCount

func (*ImageCache) MaximumSize

func (c *ImageCache) MaximumSize() int

MaximumSize is the maximum number of images to cache.

Flutter: painting/image_cache.dart ImageCache.maximumSize

func (*ImageCache) MaximumSizeBytes

func (c *ImageCache) MaximumSizeBytes() int

MaximumSizeBytes is the maximum size of the cache in bytes.

Flutter: painting/image_cache.dart ImageCache.maximumSizeBytes

func (*ImageCache) PendingImageCount

func (c *ImageCache) PendingImageCount() int

PendingImageCount is the number of images being loaded.

Flutter: painting/image_cache.dart ImageCache.pendingImageCount

func (*ImageCache) PutIfAbsent

func (c *ImageCache) PutIfAbsent(key any, loader func() *ImageStreamCompleter, onError ImageErrorListener) *ImageStreamCompleter

PutIfAbsent returns the completer cached for the key, or calls the loader to make one and caches it. If the loader panics with an error and onError is not nil, onError gets it and PutIfAbsent returns nil.

Flutter: painting/image_cache.dart ImageCache.putIfAbsent

func (*ImageCache) SetMaximumSize

func (c *ImageCache) SetMaximumSize(value int)

SetMaximumSize sets the maximum number of images. Setting it to 0 clears the cache; a smaller value evicts the oldest images. In debug builds a negative value panics with the tag ImageCacheSizeInvalid.

Flutter: painting/image_cache.dart ImageCache.maximumSize

func (*ImageCache) SetMaximumSizeBytes

func (c *ImageCache) SetMaximumSizeBytes(value int)

SetMaximumSizeBytes sets the maximum size in bytes. Setting it to 0 clears the cache. In debug builds a negative value panics with the tag ImageCacheSizeInvalid.

Flutter: painting/image_cache.dart ImageCache.maximumSizeBytes

func (*ImageCache) StatusForKey

func (c *ImageCache) StatusForKey(key any) ImageCacheStatus

StatusForKey returns the status of the image with the key.

Flutter: painting/image_cache.dart ImageCache.statusForKey

type ImageCacheStatus

type ImageCacheStatus struct {
	// Pending says the image is being loaded and cached when done.
	Pending bool
	// KeepAlive says the cache holds the image.
	KeepAlive bool
	// Live says a listener holds the image.
	Live bool
}

ImageCacheStatus is information about how the cache handles an image key.

Flutter: painting/image_cache.dart ImageCacheStatus

func ImageProviderObtainCacheStatus

func ImageProviderObtainCacheStatus(binding *PaintingBinding, p ImageProvider, configuration ImageConfiguration,
	handleError ImageErrorListener) (ImageCacheStatus, bool)

ImageProviderObtainCacheStatus finds out where the image is in the cache. It returns false when the key could not be made; the error goes to handleError, or to the binding's reporter if it is nil.

Flutter: painting/image_provider.dart ImageProvider.obtainCacheStatus

func (ImageCacheStatus) String

func (s ImageCacheStatus) String() string

String describes the status.

Flutter: painting/image_cache.dart ImageCacheStatus.toString

func (ImageCacheStatus) Tracked

func (s ImageCacheStatus) Tracked() bool

Tracked reports whether the image is pending, kept alive or live.

Flutter: painting/image_cache.dart ImageCacheStatus.tracked

func (ImageCacheStatus) Untracked

func (s ImageCacheStatus) Untracked() bool

Untracked reports whether the cache knows nothing of the image.

Flutter: painting/image_cache.dart ImageCacheStatus.untracked

type ImageChunkEvent

type ImageChunkEvent struct {
	// CumulativeBytesLoaded is the number of bytes that have been received.
	CumulativeBytesLoaded int
	// ExpectedTotalBytes is the number of bytes in the whole image, if known.
	ExpectedTotalBytes foundation.Opt[int]
}

ImageChunkEvent is an immutable notification of image bytes that have been incrementally loaded.

Flutter: painting/image_stream.dart ImageChunkEvent

func NewImageChunkEvent

func NewImageChunkEvent(cumulativeBytesLoaded int, expectedTotalBytes foundation.Opt[int]) ImageChunkEvent

NewImageChunkEvent creates the event. In debug builds negative numbers panic with the tag ImageChunkEventInvalid.

Flutter: painting/image_stream.dart ImageChunkEvent.new

func (ImageChunkEvent) DebugFillProperties

func (e ImageChunkEvent) DebugFillProperties(p *foundation.DiagnosticPropertiesBuilder)

DebugFillProperties adds the byte counts.

Flutter: painting/image_stream.dart ImageChunkEvent.debugFillProperties

type ImageChunkListener

type ImageChunkListener func(event ImageChunkEvent)

ImageChunkListener is called when a chunk of an image is loaded.

Flutter: painting/image_stream.dart ImageChunkListener

type ImageConfiguration

type ImageConfiguration struct {
	// Binding is the PaintingBinding the image resolves with. Deviation: Flutter
	// reaches it through PaintingBinding.instance.
	Binding *PaintingBinding
	// Bundle is the asset bundle from which assets are loaded; nil for none.
	Bundle services.AssetBundle
	// DevicePixelRatio is the device pixel ratio where the image will be used.
	DevicePixelRatio foundation.Opt[float64]
	// Locale is the language and region for which to select the image.
	Locale foundation.Opt[ui.Locale]
	// TextDirection is the reading direction, for directional images;
	// ui.TextDirectionUnspecified for none.
	TextDirection ui.TextDirection
	// Size is the size at which the image will be rendered.
	Size foundation.Opt[ui.Size]
	// Platform is the platform the image is for.
	Platform foundation.Opt[foundation.TargetPlatform]
}

ImageConfiguration configures an image provider to the situation in which the image is used: the bundle, device pixel ratio, locale, size and so on.

Flutter: painting/image_provider.dart ImageConfiguration

func (ImageConfiguration) CopyWith

CopyWith returns a copy with the given fields replaced.

Flutter: painting/image_provider.dart ImageConfiguration.copyWith

func (ImageConfiguration) String

func (c ImageConfiguration) String() string

String describes the configuration.

Flutter: painting/image_provider.dart ImageConfiguration.toString

type ImageConfigurationCopy

type ImageConfigurationCopy struct {
	Binding          *PaintingBinding
	Bundle           services.AssetBundle
	DevicePixelRatio foundation.Opt[float64]
	Locale           foundation.Opt[ui.Locale]
	TextDirection    foundation.Opt[ui.TextDirection]
	Size             foundation.Opt[ui.Size]
	Platform         foundation.Opt[foundation.TargetPlatform]
}

ImageConfigurationCopy holds the replacements for ImageConfiguration.CopyWith.

Flutter: painting/image_provider.dart ImageConfiguration.copyWith

type ImageDecoderCallback

type ImageDecoderCallback func(ctx context.Context, data []byte, getTargetSize TargetImageSizeCallback) (*ui.Codec, error)

ImageDecoderCallback decodes the bytes of an image. getTargetSize may be nil, to decode at the intrinsic size.

Flutter: painting/image_provider.dart ImageDecoderCallback

type ImageErrorDetails

type ImageErrorDetails struct {
	// Err is the error.
	Err error
	// Library is the part of the framework that reported it.
	Library string
	// Context says what was going on, such as "while resolving an image".
	Context string
	// Silent says that the error is expected, such as a network error, and the
	// reporter may show less of it.
	Silent bool
	// Information describes the image provider, its configuration and its key, in
	// debug builds.
	Information func() []foundation.DiagnosticsNode
}

ImageErrorDetails describes an error that happened while resolving an image.

Flutter: foundation/assertions.dart FlutterErrorDetails

type ImageErrorListener

type ImageErrorListener func(err error)

ImageErrorListener is called when loading an image failed.

Flutter: painting/image_stream.dart ImageErrorListener

type ImageInfo

type ImageInfo struct {
	// Image is the raw image pixels.
	//
	// Flutter: painting/image_stream.dart ImageInfo.image
	Image *ui.Image
	// Scale is the linear scale factor for drawing this image at its intended
	// size: the image is intended for a device pixel ratio of Scale.
	//
	// Flutter: painting/image_stream.dart ImageInfo.scale
	Scale float64
	// DebugLabel is a string used for debugging; it is empty for none.
	//
	// Flutter: painting/image_stream.dart ImageInfo.debugLabel
	DebugLabel string
}

ImageInfo is a handle to an image resource and its scale. It owns a reference to the image: call Dispose when done.

Flutter: painting/image_stream.dart ImageInfo

func NewImageInfo

func NewImageInfo(image *ui.Image, opts ...ImageInfoOpts) *ImageInfo

NewImageInfo creates an image info that owns the reference to the image.

Flutter: painting/image_stream.dart ImageInfo.new

func (*ImageInfo) Clone

func (i *ImageInfo) Clone() *ImageInfo

Clone returns a new handle with its own reference to the image.

Flutter: painting/image_stream.dart ImageInfo.clone

func (*ImageInfo) Dispose

func (i *ImageInfo) Dispose()

Dispose releases the reference to the image.

Flutter: painting/image_stream.dart ImageInfo.dispose

func (*ImageInfo) Equal

func (i *ImageInfo) Equal(other *ImageInfo) bool

Equal is Dart's == on the info: the same image, scale and label.

Flutter: painting/image_stream.dart ImageInfo.operator ==

func (*ImageInfo) IsCloneOf

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

IsCloneOf reports whether the other handle is a clone of this one.

Flutter: painting/image_stream.dart ImageInfo.isCloneOf

func (*ImageInfo) SizeBytes

func (i *ImageInfo) SizeBytes() int

SizeBytes is the number of bytes of memory the image takes, as the cache counts it: width times height times four.

Flutter: painting/image_stream.dart ImageInfo.sizeBytes

func (*ImageInfo) String

func (i *ImageInfo) String() string

String describes the info.

Flutter: painting/image_stream.dart ImageInfo.toString

type ImageInfoOpts

type ImageInfoOpts struct {
	// Scale defaults to 1.
	Scale foundation.Opt[float64]
	// DebugLabel is a string used for debugging.
	DebugLabel string
}

ImageInfoOpts are the optional parameters of NewImageInfo.

Flutter: painting/image_stream.dart ImageInfo.new

type ImageListener

type ImageListener func(image *ImageInfo, synchronousCall bool)

ImageListener is called when an image is available.

Flutter: painting/image_stream.dart ImageListener

type ImageProvider

type ImageProvider interface {
	// ObtainKey converts the provider and the configuration to a key that
	// identifies the image in the cache.
	//
	// Flutter: painting/image_provider.dart ImageProvider.obtainKey
	ObtainKey(binding *PaintingBinding, configuration ImageConfiguration) (key any, err error)
	// LoadImage converts a key into an ImageStreamCompleter, and begins fetching
	// the image using decode.
	//
	// Flutter: painting/image_provider.dart ImageProvider.loadImage
	LoadImage(binding *PaintingBinding, key any, decode ImageDecoderCallback) *ImageStreamCompleter
}

ImageProvider identifies an image without committing to the precise final asset. Implementations: AssetImage, ExactAssetImage, FileImage, MemoryImage, NetworkImage and ResizeImage. The key an implementation gives must be comparable (a struct of comparable values, or a pointer).

Deviation: ObtainKey is synchronous and takes the PaintingBinding, which stands for Flutter's PaintingBinding.instance and rootBundle.

Flutter: painting/image_provider.dart ImageProvider

func ResizeImageIfNeeded

func ResizeImageIfNeeded(cacheWidth, cacheHeight foundation.Opt[int], provider ImageProvider) ImageProvider

ResizeImageIfNeeded returns the provider wrapped in a ResizeImage if a cache width or height is given.

Flutter: painting/image_provider.dart ResizeImage.resizeIfNeeded

type ImageRepeat

type ImageRepeat int

ImageRepeat is how to paint any portions of a box not covered by an image. The zero value is ImageRepeatUnspecified: noRepeat.

Flutter: painting/decoration_image.dart ImageRepeat

const (
	// ImageRepeatUnspecified is the zero value: noRepeat.
	ImageRepeatUnspecified ImageRepeat = iota
	// ImageRepeatRepeat repeats the image in both the x and y directions.
	//
	// Flutter: painting/decoration_image.dart ImageRepeat.repeat
	ImageRepeatRepeat
	// ImageRepeatRepeatX repeats the image in the x direction.
	//
	// Flutter: painting/decoration_image.dart ImageRepeat.repeatX
	ImageRepeatRepeatX
	// ImageRepeatRepeatY repeats the image in the y direction.
	//
	// Flutter: painting/decoration_image.dart ImageRepeat.repeatY
	ImageRepeatRepeatY
	// ImageRepeatNoRepeat leaves uncovered portions of the box transparent.
	//
	// Flutter: painting/decoration_image.dart ImageRepeat.noRepeat
	ImageRepeatNoRepeat
)

The values of ImageRepeat follow Flutter's declaration order.

func (ImageRepeat) Name

func (r ImageRepeat) Name() string

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

func (ImageRepeat) String

func (r ImageRepeat) String() string

String returns the name Dart prints, such as "ImageRepeat.repeatX".

type ImageResult

type ImageResult struct {
	Info *ImageInfo
	Err  error
}

ImageResult is the outcome of loading an image: an image info, or an error.

Flutter: dart:async Future<ImageInfo>

type ImageStream

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

ImageStream is a handle to an image resource that may not be available yet: the completer gets set when the image is being loaded, and listeners added before are moved to it.

Flutter: painting/image_stream.dart ImageStream

func ImageProviderResolve

func ImageProviderResolve(binding *PaintingBinding, p ImageProvider, configuration ImageConfiguration) *ImageStream

ImageProviderResolve returns a stream for the image the provider names in the configuration. If obtaining the key fails, the error is reported to the stream's listeners in the next event turn.

Flutter: painting/image_provider.dart ImageProvider.resolve

func NewImageStream

func NewImageStream() *ImageStream

NewImageStream creates a stream with no completer.

Flutter: painting/image_stream.dart ImageStream.new

func (*ImageStream) AddListener

func (s *ImageStream) AddListener(listener *ImageStreamListener)

AddListener adds a listener callback to be called whenever a new image is available.

Flutter: painting/image_stream.dart ImageStream.addListener

func (*ImageStream) Completer

func (s *ImageStream) Completer() *ImageStreamCompleter

Completer is the completer that has been assigned to this stream, or nil.

Flutter: painting/image_stream.dart ImageStream.completer

func (*ImageStream) DebugFillProperties

func (s *ImageStream) DebugFillProperties(p *foundation.DiagnosticPropertiesBuilder)

DebugFillProperties adds the completer and the listeners.

Flutter: painting/image_stream.dart ImageStream.debugFillProperties

func (*ImageStream) Key

func (s *ImageStream) Key() any

Key is an object that is unique for the image this stream is for: the completer once set, else the stream.

Flutter: painting/image_stream.dart ImageStream.key

func (*ImageStream) RemoveListener

func (s *ImageStream) RemoveListener(listener *ImageStreamListener)

RemoveListener stops the listener from being notified.

Flutter: painting/image_stream.dart ImageStream.removeListener

func (*ImageStream) SetCompleter

func (s *ImageStream) SetCompleter(value *ImageStreamCompleter)

SetCompleter assigns the completer and moves the listeners to it. In debug builds setting it twice panics with the tag ImageStreamCompleterSet.

Flutter: painting/image_stream.dart ImageStream.setCompleter

func (*ImageStream) String

func (s *ImageStream) String() string

String describes the stream.

func (*ImageStream) ToStringShort

func (s *ImageStream) ToStringShort() string

ToStringShort names the stream.

type ImageStreamCompleter

type ImageStreamCompleter struct {

	// DebugLabel is a description of the image, for debugging.
	//
	// Flutter: painting/image_stream.dart ImageStreamCompleter.debugLabel
	DebugLabel string
	// contains filtered or unexported fields
}

ImageStreamCompleter is the interface for the object that manages the listeners of an ImageStream and the images it delivers. Create one with NewImageStreamCompleter, NewOneFrameImageStreamCompleter or NewMultiFrameImageStreamCompleter.

Flutter: painting/image_stream.dart ImageStreamCompleter

func NewImageStreamCompleter

func NewImageStreamCompleter(binding *PaintingBinding) *ImageStreamCompleter

NewImageStreamCompleter creates a completer with no image. Call SetImage when the image is ready. The binding may be nil: errors nobody handled are then dropped.

Flutter: painting/image_stream.dart ImageStreamCompleter.new

func NewMultiFrameImageStreamCompleter

func NewMultiFrameImageStreamCompleter(binding *PaintingBinding, options ...MultiFrameImageStreamCompleterOpts) *ImageStreamCompleter

NewMultiFrameImageStreamCompleter creates a completer for an image that may have several frames, such as a GIF. It shows each frame for its duration, on frame callbacks, while it has listeners.

Flutter: painting/image_stream.dart MultiFrameImageStreamCompleter

func NewOneFrameImageStreamCompleter

func NewOneFrameImageStreamCompleter(binding *PaintingBinding, image <-chan ImageResult, informationCollector func() []foundation.DiagnosticsNode) *ImageStreamCompleter

NewOneFrameImageStreamCompleter creates a completer for an image that is loaded once. Send the result on the channel, once, from any goroutine; it is delivered on the UI thread. An error is reported silently.

Flutter: painting/image_stream.dart OneFrameImageStreamCompleter

func (*ImageStreamCompleter) AddEphemeralErrorListener

func (c *ImageStreamCompleter) AddEphemeralErrorListener(listener ImageErrorListener)

AddEphemeralErrorListener adds an error listener that is called once if the loading fails and there is no image yet; it is dropped as soon as an image arrives.

Flutter: painting/image_stream.dart ImageStreamCompleter.addEphemeralErrorListener

func (*ImageStreamCompleter) AddListener

func (c *ImageStreamCompleter) AddListener(listener *ImageStreamListener)

AddListener adds a listener callback to be called whenever a new image is available. If an image is already available, the listener is called at once with a clone of it and synchronousCall true.

Flutter: painting/image_stream.dart ImageStreamCompleter.addListener

func (*ImageStreamCompleter) AddOnLastListenerRemovedCallback

func (c *ImageStreamCompleter) AddOnLastListenerRemovedCallback(callback func()) (remove func())

AddOnLastListenerRemovedCallback adds a callback called once when the last listener is removed. Compare callbacks by the index returned.

Flutter: painting/image_stream.dart ImageStreamCompleter.addOnLastListenerRemovedCallback

func (*ImageStreamCompleter) CurrentImage

func (c *ImageStreamCompleter) CurrentImage() *ImageInfo

CurrentImage is the most recent image, or nil; the completer owns it.

Flutter: no counterpart

func (*ImageStreamCompleter) DebugFillProperties

func (c *ImageStreamCompleter) DebugFillProperties(p *foundation.DiagnosticPropertiesBuilder)

DebugFillProperties adds the current image, the listeners and the state.

Flutter: painting/image_stream.dart ImageStreamCompleter.debugFillProperties

func (*ImageStreamCompleter) Disposed

func (c *ImageStreamCompleter) Disposed() bool

Disposed reports whether the completer disposed itself.

Flutter: no counterpart

func (*ImageStreamCompleter) HasListeners

func (c *ImageStreamCompleter) HasListeners() bool

HasListeners reports whether any listener is subscribed.

Flutter: painting/image_stream.dart ImageStreamCompleter.hasListeners

func (*ImageStreamCompleter) KeepAlive

KeepAlive creates a handle that keeps the completer from disposing itself when it has no listeners.

Flutter: painting/image_stream.dart ImageStreamCompleter.keepAlive

func (*ImageStreamCompleter) ListenerCount

func (c *ImageStreamCompleter) ListenerCount() int

ListenerCount is the number of listeners.

Flutter: no counterpart

func (*ImageStreamCompleter) MaybeDispose

func (c *ImageStreamCompleter) MaybeDispose()

MaybeDispose disposes the completer if it has no listeners and no handles.

Flutter: painting/image_stream.dart ImageStreamCompleter.maybeDispose

func (*ImageStreamCompleter) RemoveListener

func (c *ImageStreamCompleter) RemoveListener(listener *ImageStreamListener)

RemoveListener stops the listener from being notified. When the last listener goes, the callbacks added with AddOnLastListenerRemovedCallback run, and the completer disposes itself unless a handle keeps it alive.

Flutter: painting/image_stream.dart ImageStreamCompleter.removeListener

func (*ImageStreamCompleter) ReportError

func (c *ImageStreamCompleter) ReportError(details ImageErrorDetails)

ReportError tells the error listeners that loading failed. If none handled it and no listener opted out of error reports, the binding's reporter gets it.

Flutter: painting/image_stream.dart ImageStreamCompleter.reportError

func (*ImageStreamCompleter) ReportImageChunkEvent

func (c *ImageStreamCompleter) ReportImageChunkEvent(event ImageChunkEvent)

ReportImageChunkEvent tells the chunk listeners that a part of the image loaded.

Flutter: painting/image_stream.dart ImageStreamCompleter.reportImageChunkEvent

func (*ImageStreamCompleter) SetImage

func (c *ImageStreamCompleter) SetImage(image *ImageInfo)

SetImage calls every listener with a clone of the image, and keeps the image for the listeners that come later. The completer owns the image.

Flutter: painting/image_stream.dart ImageStreamCompleter.setImage

func (*ImageStreamCompleter) SetOnDisposed

func (c *ImageStreamCompleter) SetOnDisposed(fn func())

SetOnDisposed sets the function called when the completer disposes itself (a subclass's onDisposed).

Flutter: painting/image_stream.dart ImageStreamCompleter.onDisposed

func (*ImageStreamCompleter) String

func (c *ImageStreamCompleter) String() string

String describes the completer.

func (*ImageStreamCompleter) ToStringShort

func (c *ImageStreamCompleter) ToStringShort() string

ToStringShort names the completer.

type ImageStreamCompleterHandle

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

ImageStreamCompleterHandle keeps an ImageStreamCompleter from being disposed while it has no listeners.

Flutter: painting/image_stream.dart ImageStreamCompleterHandle

func (*ImageStreamCompleterHandle) Dispose

func (h *ImageStreamCompleterHandle) Dispose()

Dispose releases the handle; the completer may dispose itself if nothing else keeps it alive. In debug builds disposing twice panics with the tag ImageStreamCompleterHandleDisposed.

Flutter: painting/image_stream.dart ImageStreamCompleterHandle.dispose

type ImageStreamListener

type ImageStreamListener struct {
	// OnImage is called when the image is loaded; the listener owns the info and
	// must dispose it.
	OnImage ImageListener
	// OnChunk is called when a chunk of the image is loaded; nil for none.
	OnChunk ImageChunkListener
	// OnError is called when loading the image failed; nil for none.
	OnError ImageErrorListener
	// ReportErrors is false if the listener handles errors itself, even without
	// OnError.
	ReportErrors bool
}

ImageStreamListener receives the events of an image stream. Compare listeners by pointer: the same *ImageStreamListener is used to add and remove.

Flutter: painting/image_stream.dart ImageStreamListener

func NewImageStreamListener

func NewImageStreamListener(onImage ImageListener, opts ...ImageStreamListenerOpts) *ImageStreamListener

NewImageStreamListener creates a listener.

Flutter: painting/image_stream.dart ImageStreamListener.new

type ImageStreamListenerOpts

type ImageStreamListenerOpts struct {
	// OnChunk is called when a chunk of the image is loaded.
	OnChunk ImageChunkListener
	// OnError is called when loading the image failed.
	OnError ImageErrorListener
	// ReportErrors defaults to true.
	ReportErrors foundation.Opt[bool]
}

ImageStreamListenerOpts are the optional parameters of NewImageStreamListener.

Flutter: painting/image_stream.dart ImageStreamListener.new

type InlineSpan

type InlineSpan interface {
	foundation.DiagnosticableTree
	// Style is the style to apply to this span and its children, or nil.
	//
	// Flutter: painting/inline_span.dart InlineSpan.style
	Style() *TextStyle
	// Build adds the span to the builder.
	//
	// Flutter: painting/inline_span.dart InlineSpan.build
	Build(builder *ui.ParagraphBuilder, opts ...SpanBuildOpts)
	// VisitChildren calls the visitor on this span and its descendants in depth
	// first order, until it returns false; it returns false if it was stopped.
	//
	// Flutter: painting/inline_span.dart InlineSpan.visitChildren
	VisitChildren(visitor InlineSpanVisitor) bool
	// VisitDirectChildren calls the visitor on the direct children.
	//
	// Flutter: painting/inline_span.dart InlineSpan.visitDirectChildren
	VisitDirectChildren(visitor InlineSpanVisitor) bool
	// GetSpanForPositionVisitor returns this span if the position is in its
	// text, else advances the offset past it and returns nil.
	//
	// Flutter: painting/inline_span.dart InlineSpan.getSpanForPositionVisitor
	GetSpanForPositionVisitor(position ui.TextPosition, offset *Accumulator) InlineSpan
	// ComputeToPlainText writes the text of the span and its descendants.
	//
	// Flutter: painting/inline_span.dart InlineSpan.computeToPlainText
	ComputeToPlainText(buffer *strings.Builder, includeSemanticsLabels, includePlaceholders bool)
	// ComputeSemanticsInformation adds the semantics information of the span and
	// its descendants.
	//
	// Flutter: painting/inline_span.dart InlineSpan.computeSemanticsInformation
	ComputeSemanticsInformation(collector *[]InlineSpanSemanticsInformation)
	// CodeUnitAtVisitor returns the code unit at the index of the span's text,
	// advancing the offset.
	//
	// Flutter: painting/inline_span.dart InlineSpan.codeUnitAtVisitor
	CodeUnitAtVisitor(index int, offset *Accumulator) (byte, bool)
	// DebugAssertIsValid reports whether the span is valid.
	//
	// Flutter: painting/inline_span.dart InlineSpan.debugAssertIsValid
	DebugAssertIsValid() bool
	// CompareTo describes the difference to another span.
	//
	// Flutter: painting/inline_span.dart InlineSpan.compareTo
	CompareTo(other InlineSpan) RenderComparison
	// Equal is Dart's ==.
	//
	// Flutter: painting/inline_span.dart InlineSpan.operator ==
	Equal(other InlineSpan) bool
}

InlineSpan is an immutable span of inline content which forms part of a paragraph. TextSpan and PlaceholderSpan (WidgetSpan) implement it; embed InlineSpanBase for the style.

Flutter: painting/inline_span.dart InlineSpan

func InlineSpanGetSpanForPosition

func InlineSpanGetSpanForPosition(s InlineSpan, position ui.TextPosition) InlineSpan

InlineSpanGetSpanForPosition returns the span that contains the position, or nil.

Flutter: painting/inline_span.dart InlineSpan.getSpanForPosition

type InlineSpanBase

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

InlineSpanBase holds the style that every InlineSpan has. Embed it.

Flutter: painting/inline_span.dart InlineSpan

func NewInlineSpanBase

func NewInlineSpanBase(style *TextStyle) InlineSpanBase

NewInlineSpanBase creates the base with the style, which may be nil.

Flutter: painting/inline_span.dart InlineSpan.new

func (InlineSpanBase) DebugFillBase

DebugFillBase adds the properties of InlineSpan itself: the style.

Flutter: painting/inline_span.dart InlineSpan.debugFillProperties

func (InlineSpanBase) EqualBase

func (b InlineSpanBase) EqualBase(other InlineSpan) bool

EqualBase is the part of Dart's == that InlineSpan itself checks: the style.

Flutter: painting/inline_span.dart InlineSpan.operator ==

func (InlineSpanBase) Style

func (b InlineSpanBase) Style() *TextStyle

Style is the style to apply to this span and its children.

Flutter: painting/inline_span.dart InlineSpan.style

type InlineSpanSemanticsInformation

type InlineSpanSemanticsInformation struct {
	// Text is the text of the span.
	Text string
	// IsPlaceholder is whether the span is a placeholder.
	IsPlaceholder bool
	// SemanticsLabel replaces the text for accessibility, when SemanticsLabelSet.
	SemanticsLabel string
	// SemanticsLabelSet is whether SemanticsLabel is not null.
	SemanticsLabelSet bool
	// SemanticsIdentifier is the identifier of the semantics node, or "".
	SemanticsIdentifier string
	// Recognizer is the gesture recognizer of the span, or nil.
	Recognizer gestures.GestureRecognizer
	// RequiresOwnNode is whether the span needs its own semantics node.
	RequiresOwnNode bool
	// StringAttributes are the annotations of the text.
	StringAttributes []ui.StringAttribute
}

InlineSpanSemanticsInformation is the information a span gives to the semantics tree of the paragraph.

Flutter: painting/inline_span.dart InlineSpanSemanticsInformation

func CombineSemanticsInfo

func CombineSemanticsInfo(infoList []InlineSpanSemanticsInformation) []InlineSpanSemanticsInformation

CombineSemanticsInfo walks the infos of spans and joins the ones that don't need their own node into one.

Flutter: painting/inline_span.dart combineSemanticsInfo

func InlineSpanGetSemanticsInformation

func InlineSpanGetSemanticsInformation(s InlineSpan) []InlineSpanSemanticsInformation

InlineSpanGetSemanticsInformation returns the semantics information of the span and its descendants.

Flutter: painting/inline_span.dart InlineSpan.getSemanticsInformation

func InlineSpanSemanticsPlaceholder

func InlineSpanSemanticsPlaceholder() InlineSpanSemanticsInformation

InlineSpanSemanticsPlaceholder is the information of a placeholder.

Flutter: painting/inline_span.dart InlineSpanSemanticsInformation.placeholder

func NewInlineSpanSemanticsInformation

func NewInlineSpanSemanticsInformation(text string, info InlineSpanSemanticsInformation) InlineSpanSemanticsInformation

NewInlineSpanSemanticsInformation creates the information of a span. In debug builds a placeholder that has a different text, a label or a recognizer panics with the tag InlineSpanSemanticsPlaceholderInvalid.

Flutter: painting/inline_span.dart InlineSpanSemanticsInformation.new

func (InlineSpanSemanticsInformation) Equal

Equal is Dart's == on the information.

Flutter: painting/inline_span.dart InlineSpanSemanticsInformation.operator ==

func (InlineSpanSemanticsInformation) String

String describes the information.

Flutter: painting/inline_span.dart InlineSpanSemanticsInformation.toString

type InlineSpanVisitor

type InlineSpanVisitor func(span InlineSpan) bool

InlineSpanVisitor is called with each span of a visit. Returning false stops the visit.

Flutter: painting/inline_span.dart InlineSpanVisitor

type LinearBorder

type LinearBorder struct {
	ShapeBorderDefaults

	// Start is the edge at the start of the reading direction.
	Start foundation.Opt[LinearBorderEdge]
	// End is the edge at the end of the reading direction.
	End foundation.Opt[LinearBorderEdge]
	// Top is the top edge.
	Top foundation.Opt[LinearBorderEdge]
	// Bottom is the bottom edge.
	Bottom foundation.Opt[LinearBorderEdge]
	// contains filtered or unexported fields
}

LinearBorder defines a border that consists of up to four lines, one for each edge: start, end, top and bottom.

Flutter: painting/linear_border.dart LinearBorder

func NewLinearBorder

func NewLinearBorder(opts ...LinearBorderOpts) LinearBorder

NewLinearBorder creates a border with the given edges.

Flutter: painting/linear_border.dart LinearBorder.new

func NewLinearBorderBottom

func NewLinearBorderBottom(opts ...LinearBorderEdgeOnlyOpts) LinearBorder

NewLinearBorderBottom creates a border with only a bottom edge.

Flutter: painting/linear_border.dart LinearBorder.bottom

func NewLinearBorderEnd

func NewLinearBorderEnd(opts ...LinearBorderEdgeOnlyOpts) LinearBorder

NewLinearBorderEnd creates a border with only an end edge.

Flutter: painting/linear_border.dart LinearBorder.end

func NewLinearBorderStart

func NewLinearBorderStart(opts ...LinearBorderEdgeOnlyOpts) LinearBorder

NewLinearBorderStart creates a border with only a start edge.

Flutter: painting/linear_border.dart LinearBorder.start

func NewLinearBorderTop

func NewLinearBorderTop(opts ...LinearBorderEdgeOnlyOpts) LinearBorder

NewLinearBorderTop creates a border with only a top edge.

Flutter: painting/linear_border.dart LinearBorder.top

func (LinearBorder) CopyWith

CopyWith returns a copy with the given fields replaced.

Flutter: painting/linear_border.dart LinearBorder.copyWith

func (LinearBorder) CopyWithSide

func (b LinearBorder) CopyWithSide(side BorderSide) OutlinedBorder

CopyWithSide returns a copy with the given side.

Flutter: painting/borders.dart OutlinedBorder.copyWith

func (LinearBorder) Dimensions

func (b LinearBorder) Dimensions() EdgeInsetsGeometry

Dimensions is the width of the side on each edge that is present.

Flutter: painting/linear_border.dart LinearBorder.dimensions

func (LinearBorder) GetInnerPath

func (b LinearBorder) GetInnerPath(rect ui.Rect, td ui.TextDirection) *ui.Path

GetInnerPath is the rect, deflated by the dimensions.

Flutter: painting/linear_border.dart LinearBorder.getInnerPath

func (LinearBorder) GetOuterPath

func (b LinearBorder) GetOuterPath(rect ui.Rect, _ ui.TextDirection) *ui.Path

GetOuterPath is the rect.

Flutter: painting/linear_border.dart LinearBorder.getOuterPath

func (LinearBorder) LerpFrom

func (b LinearBorder) LerpFrom(a ShapeBorder, t float64) ShapeBorder

LerpFrom interpolates from a LinearBorder.

Flutter: painting/linear_border.dart LinearBorder.lerpFrom

func (LinearBorder) LerpTo

LerpTo interpolates to a LinearBorder.

Flutter: painting/linear_border.dart LinearBorder.lerpTo

func (LinearBorder) Paint

func (b LinearBorder) Paint(canvas *ui.Canvas, rect ui.Rect, td ui.TextDirection)

Paint draws the edges.

Flutter: painting/linear_border.dart LinearBorder.paint

func (LinearBorder) Scale

func (b LinearBorder) Scale(t float64) ShapeBorder

Scale scales the side by t; the edges are dropped.

Flutter: painting/linear_border.dart LinearBorder.scale

func (LinearBorder) Side

func (b LinearBorder) Side() BorderSide

Side is the border outline's color and weight.

Flutter: painting/borders.dart OutlinedBorder.side

func (LinearBorder) String

func (b LinearBorder) String() string

String describes the border.

Flutter: painting/linear_border.dart LinearBorder.toString

type LinearBorderCopy

LinearBorderCopy holds the replacements for LinearBorder.CopyWith.

Flutter: painting/linear_border.dart LinearBorder.copyWith

type LinearBorderEdge

type LinearBorderEdge struct {
	// Size is the length of the edge as a fraction of the available space,
	// from 0 to 1.
	Size float64
	// Alignment is where the edge is placed, from -1 (start) to 1 (end).
	Alignment float64
}

LinearBorderEdge defines the relative size and alignment of one LinearBorder edge.

Flutter: painting/linear_border.dart LinearBorderEdge

func NewLinearBorderEdge

func NewLinearBorderEdge(opts ...LinearBorderEdgeOpts) LinearBorderEdge

NewLinearBorderEdge creates an edge. In debug builds a size outside 0 to 1 panics with the tag LinearBorderEdgeSizeOutOfRange.

Flutter: painting/linear_border.dart LinearBorderEdge.new

func (LinearBorderEdge) String

func (e LinearBorderEdge) String() string

String describes the edge, such as "LinearBorderEdge(size: 0.5)".

Flutter: painting/linear_border.dart LinearBorderEdge.toString

type LinearBorderEdgeOnlyOpts

type LinearBorderEdgeOnlyOpts struct {
	// Side defaults to BorderSideNone.
	Side BorderSide
	// Alignment defaults to 0.0.
	Alignment float64
	// Size defaults to 1.0.
	Size foundation.Opt[float64]
}

LinearBorderEdgeOnlyOpts are the optional parameters of the single-edge constructors of LinearBorder.

Flutter: painting/linear_border.dart LinearBorder.start

type LinearBorderEdgeOpts

type LinearBorderEdgeOpts struct {
	// Size defaults to 1.0; it must be from 0.0 to 1.0.
	Size foundation.Opt[float64]
	// Alignment defaults to 0.0.
	Alignment float64
}

LinearBorderEdgeOpts are the optional parameters of NewLinearBorderEdge.

Flutter: painting/linear_border.dart LinearBorderEdge.new

type LinearBorderOpts

type LinearBorderOpts struct {
	// Side defaults to BorderSideNone.
	Side   BorderSide
	Start  foundation.Opt[LinearBorderEdge]
	End    foundation.Opt[LinearBorderEdge]
	Top    foundation.Opt[LinearBorderEdge]
	Bottom foundation.Opt[LinearBorderEdge]
}

LinearBorderOpts are the optional parameters of NewLinearBorder.

Flutter: painting/linear_border.dart LinearBorder.new

type LinearGradient

type LinearGradient struct {
	// Begin is the offset at which stop 0.0 of the gradient is placed.
	Begin AlignmentGeometry
	// End is the offset at which stop 1.0 of the gradient is placed.
	End AlignmentGeometry
	// Colors are the colors the gradient should obtain at each of the stops.
	Colors []ui.Color
	// Stops say where each color is obtained; nil spaces the colors evenly.
	Stops []float64
	// TileMode is how this gradient should tile the plane beyond the region
	// before Begin and after End.
	TileMode ui.TileMode
	// Transform is the transform of the gradient; nil for none.
	Transform GradientTransform
}

LinearGradient is a 2D linear gradient.

Flutter: painting/gradient.dart LinearGradient

func LinearGradientLerp

func LinearGradientLerp(a, b *LinearGradient, t float64) *LinearGradient

LinearGradientLerp linearly interpolates between two LinearGradients. Either may be nil. It returns a nil *LinearGradient for two nils.

Flutter: painting/gradient.dart LinearGradient.lerp

func NewLinearGradient

func NewLinearGradient(colors []ui.Color, opts ...LinearGradientOpts) *LinearGradient

NewLinearGradient creates a linear gradient.

Flutter: painting/gradient.dart LinearGradient.new

func (*LinearGradient) CreateShader

func (g *LinearGradient) CreateShader(rect ui.Rect, td ui.TextDirection) ui.Shader

CreateShader creates the shader for the rect.

Flutter: painting/gradient.dart LinearGradient.createShader

func (*LinearGradient) Equal

func (g *LinearGradient) Equal(other Gradient) bool

Equal reports whether other is an equal LinearGradient.

Flutter: painting/gradient.dart LinearGradient.operator ==

func (*LinearGradient) FromColor

func (g *LinearGradient) FromColor(c ui.Color) Gradient

FromColor returns a gradient with all its colors replaced by color.

Flutter: painting/gradient.dart LinearGradient.fromColor

func (*LinearGradient) GetColors

func (g *LinearGradient) GetColors() []ui.Color

GetColors returns the colors.

Flutter: painting/gradient.dart Gradient.colors

func (*LinearGradient) GetStops

func (g *LinearGradient) GetStops() []float64

GetStops returns the stops.

Flutter: painting/gradient.dart Gradient.stops

func (*LinearGradient) GetTransform

func (g *LinearGradient) GetTransform() GradientTransform

GetTransform returns the transform.

Flutter: painting/gradient.dart Gradient.transform

func (*LinearGradient) LerpFrom

func (g *LinearGradient) LerpFrom(a Gradient, t float64) Gradient

LerpFrom interpolates from a LinearGradient or nil.

Flutter: painting/gradient.dart LinearGradient.lerpFrom

func (*LinearGradient) LerpTo

func (g *LinearGradient) LerpTo(b Gradient, t float64) Gradient

LerpTo interpolates to a LinearGradient or nil.

Flutter: painting/gradient.dart LinearGradient.lerpTo

func (*LinearGradient) Scale

func (g *LinearGradient) Scale(factor float64) Gradient

Scale returns a gradient with its colors scaled by the factor.

Flutter: painting/gradient.dart LinearGradient.scale

func (*LinearGradient) String

func (g *LinearGradient) String() string

String describes the gradient.

Flutter: painting/gradient.dart LinearGradient.toString

func (*LinearGradient) WithOpacity

func (g *LinearGradient) WithOpacity(o float64) Gradient

WithOpacity returns a gradient with the opacity applied to its colors.

Flutter: painting/gradient.dart LinearGradient.withOpacity

type LinearGradientOpts

type LinearGradientOpts struct {
	// Begin defaults to AlignmentCenterLeft.
	Begin AlignmentGeometry
	// End defaults to AlignmentCenterRight.
	End AlignmentGeometry
	// Stops say where each color is obtained; nil spaces them evenly.
	Stops []float64
	// TileMode defaults to ui.TileModeClamp.
	TileMode ui.TileMode
	// Transform is the transform of the gradient.
	Transform GradientTransform
}

LinearGradientOpts are the optional parameters of NewLinearGradient.

Flutter: painting/gradient.dart LinearGradient.new

type MemoryImage

type MemoryImage struct {
	// Bytes is the bytes of the image.
	Bytes []byte
	// Scale is the scale to place in the ImageInfo.
	Scale float64
	// contains filtered or unexported fields
}

MemoryImage decodes the given bytes as an image, associating it with the given scale. Two providers are equal when they share the same slice, as Dart's Uint8List compares by identity.

Flutter: painting/image_provider.dart MemoryImage

func NewMemoryImage

func NewMemoryImage(bytes []byte, scale ...float64) *MemoryImage

NewMemoryImage creates a provider for the bytes of an encoded image.

Flutter: painting/image_provider.dart MemoryImage.new

func (*MemoryImage) LoadImage

func (m *MemoryImage) LoadImage(binding *PaintingBinding, key any, decode ImageDecoderCallback) *ImageStreamCompleter

LoadImage decodes the bytes.

Flutter: painting/image_provider.dart MemoryImage.loadImage

func (*MemoryImage) ObtainKey

ObtainKey makes the key from the identity of the bytes and the scale.

Flutter: painting/image_provider.dart MemoryImage.obtainKey

type MemoryImageKey

type MemoryImageKey struct {
	Scale float64
	// contains filtered or unexported fields
}

MemoryImageKey is the key of a MemoryImage.

Flutter: no counterpart

type MultiFrameImageStreamCompleterOpts

type MultiFrameImageStreamCompleterOpts struct {
	// Codec delivers the codec that provides the frames, once. Send it from any
	// goroutine.
	Codec <-chan CodecResult
	// Scale is the scale of the image.
	Scale float64
	// DebugLabel is a description of the image.
	DebugLabel string
	// ChunkEvents delivers the progress of the loading; the channel may be nil.
	ChunkEvents <-chan ImageChunkEvent
	// InformationCollector describes the image provider and the key, for errors.
	InformationCollector func() []foundation.DiagnosticsNode
}

MultiFrameImageStreamCompleterOpts are the parameters of NewMultiFrameImageStreamCompleter.

Flutter: painting/image_stream.dart MultiFrameImageStreamCompleter

type NetworkImage

type NetworkImage struct {
	// URL is where the image will be fetched from.
	URL string
	// Scale is the scale to place in the ImageInfo.
	Scale float64
	// Headers are HTTP headers sent with the request; nil for none.
	Headers map[string]string
}

NetworkImage fetches the image from the URL, associating it with the given scale.

Flutter: painting/image_provider.dart NetworkImage

func NewNetworkImage

func NewNetworkImage(url string, opts ...NetworkImageOpts) *NetworkImage

NewNetworkImage creates a provider for the image at the URL.

Flutter: painting/image_provider.dart NetworkImage.new

func (*NetworkImage) LoadImage

func (n *NetworkImage) LoadImage(binding *PaintingBinding, key any, decode ImageDecoderCallback) *ImageStreamCompleter

LoadImage requests the image and decodes the response.

Flutter: painting/_network_image_io.dart NetworkImage.loadImage

func (*NetworkImage) ObtainKey

ObtainKey makes the key from the URL, the scale and the headers.

Flutter: painting/_network_image_io.dart NetworkImage.obtainKey

func (*NetworkImage) String

func (n *NetworkImage) String() string

String describes the provider.

Flutter: painting/_network_image_io.dart NetworkImage.toString

type NetworkImageKey

type NetworkImageKey struct {
	URL   string
	Scale float64
	// contains filtered or unexported fields
}

NetworkImageKey is the key of a NetworkImage: the URL, the scale and the headers.

Flutter: painting/image_provider.dart NetworkImage

type NetworkImageOpts

type NetworkImageOpts struct {
	// Scale defaults to 1.
	Scale foundation.Opt[float64]
	// Headers are HTTP headers sent with the request.
	Headers map[string]string
}

NetworkImageOpts are the optional parameters of NewNetworkImage.

Flutter: painting/image_provider.dart NetworkImage.new

type NonUniformBorderOpts

type NonUniformBorderOpts struct {
	// BorderRadius rounds the corners of a rectangle; None for none.
	BorderRadius foundation.Opt[BorderRadiusGeometry]
	// TextDirection resolves a directional border radius.
	TextDirection ui.TextDirection
	// Shape is the shape of the border; the default is a rectangle.
	Shape BoxShape
	// Top, Right, Bottom and Left are the sides; BorderSideNone for the ones
	// that are left out.
	Top, Right, Bottom, Left BorderSide
	// Color is the color of the border.
	Color ui.Color
}

NonUniformBorderOpts are the parameters of PaintNonUniformBorder.

Flutter: painting/box_border.dart BoxBorder.paintNonUniformBorder

type NotchedShape

type NotchedShape interface {
	// GetOuterPath creates a path of the host with a notch for the guest, which is
	// nil for none.
	//
	// Flutter: painting/notched_shapes.dart NotchedShape.getOuterPath
	GetOuterPath(host ui.Rect, guest foundation.Opt[ui.Rect]) *ui.Path
}

NotchedShape specifies a shape with a notch: a rectangle with a cut-out for another shape, such as a floating action button docked in a bar.

Flutter: painting/notched_shapes.dart NotchedShape

type OutlinedBorder

type OutlinedBorder interface {
	ShapeBorder
	// Side is the border outline's color and weight.
	Side() BorderSide
	// CopyWithSide returns a copy with the given side. The concrete types have
	// a CopyWith with all their properties.
	CopyWithSide(side BorderSide) OutlinedBorder
}

OutlinedBorder is a ShapeBorder that draws an outline with the width and color specified by its BorderSide.

Flutter: painting/borders.dart OutlinedBorder

func OutlinedBorderLerp

func OutlinedBorderLerp(a, b OutlinedBorder, t float64) OutlinedBorder

OutlinedBorderLerp linearly interpolates between two OutlinedBorders.

Flutter: painting/borders.dart OutlinedBorder.lerp

type OvalBorder

type OvalBorder struct {
	CircleBorder
}

OvalBorder is a border that fits an oval within the available space: a CircleBorder with an eccentricity of 1.0 by default.

Flutter: painting/oval_border.dart OvalBorder

func NewOvalBorder

func NewOvalBorder(opts ...OvalBorderOpts) OvalBorder

NewOvalBorder creates an oval border. The eccentricity defaults to 1.0.

Flutter: painting/oval_border.dart OvalBorder.new

func (OvalBorder) CopyWith

func (b OvalBorder) CopyWith(c CircleBorderCopy) OvalBorder

CopyWith returns a copy with the given fields replaced.

Flutter: painting/oval_border.dart OvalBorder.copyWith

func (OvalBorder) CopyWithSide

func (b OvalBorder) CopyWithSide(side BorderSide) OutlinedBorder

CopyWithSide returns a copy with the given side.

Flutter: painting/borders.dart OutlinedBorder.copyWith

func (OvalBorder) LerpFrom

func (b OvalBorder) LerpFrom(a ShapeBorder, t float64) ShapeBorder

LerpFrom interpolates from an OvalBorder, or as a CircleBorder.

Flutter: painting/oval_border.dart OvalBorder.lerpFrom

func (OvalBorder) LerpTo

func (b OvalBorder) LerpTo(o ShapeBorder, t float64) ShapeBorder

LerpTo interpolates to an OvalBorder, or as a CircleBorder.

Flutter: painting/oval_border.dart OvalBorder.lerpTo

func (OvalBorder) Scale

func (b OvalBorder) Scale(t float64) ShapeBorder

Scale scales the side by t.

Flutter: painting/oval_border.dart OvalBorder.scale

func (OvalBorder) String

func (b OvalBorder) String() string

String describes the border.

Flutter: painting/oval_border.dart OvalBorder.toString

type OvalBorderOpts

type OvalBorderOpts struct {
	// Side defaults to BorderSideNone.
	Side BorderSide
	// Eccentricity defaults to 1.0; it must be from 0.0 to 1.0.
	Eccentricity foundation.Opt[float64]
}

OvalBorderOpts are the optional parameters of NewOvalBorder.

Flutter: painting/oval_border.dart OvalBorder.new

type PaintImageOpts

type PaintImageOpts struct {
	// DebugImageLabel is a description of the image, for debugging.
	DebugImageLabel string
	// Scale is the number of image pixels per logical pixel; the default is 1.
	Scale foundation.Opt[float64]
	// Opacity is the opacity of the image; the default is 1.
	Opacity foundation.Opt[float64]
	// ColorFilter is applied to the image before painting it.
	ColorFilter *ui.ColorFilter
	// Fit is how the image is inscribed into the rect; unspecified is scaleDown,
	// or fill with a CenterSlice.
	Fit BoxFit
	// Alignment is how to align the image within the rect; the default is center.
	Alignment foundation.Opt[Alignment]
	// CenterSlice is the center slice of a nine-patch image.
	CenterSlice foundation.Opt[ui.Rect]
	// Repeat is how to paint the portions of the rect the image doesn't cover.
	Repeat ImageRepeat
	// FlipHorizontally paints the image mirrored.
	FlipHorizontally bool
	// InvertColors inverts the colors of the image.
	InvertColors bool
	// FilterQuality is the quality of sampling; the default is medium.
	FilterQuality ui.FilterQuality
	// IsAntiAlias says whether to paint with anti-aliasing.
	IsAntiAlias bool
	// BlendMode is how the image combines with what is below; the default is
	// srcOver.
	BlendMode ui.BlendMode
}

PaintImageOpts are the optional parameters of PaintImage.

Flutter: painting/decoration_image.dart paintImage

type PaintingBinding

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

PaintingBinding is the glue between the painting library and the Flutter engine: it owns the image cache and decodes the images.

Flutter: painting/binding.dart PaintingBinding

func NewPaintingBinding

func NewPaintingBinding(ctx context.Context, sched *scheduler.SchedulerBinding, opts ...PaintingBindingOpts) *PaintingBinding

NewPaintingBinding creates the binding. The context is the lifetime of the application: image loads stop when it is cancelled.

Flutter: painting/binding.dart PaintingBinding.initInstances

func (*PaintingBinding) AfterFunc

func (b *PaintingBinding) AfterFunc(d time.Duration, fn func()) (stop func())

AfterFunc calls the function on the UI thread after the duration, and returns the function that cancels the call.

Flutter: no counterpart (Dart's Timer)

func (*PaintingBinding) AssetBundle

func (b *PaintingBinding) AssetBundle() services.AssetBundle

AssetBundle is the root bundle, or nil if the binding has none.

Flutter: services/asset_bundle.dart rootBundle

func (*PaintingBinding) Context

func (b *PaintingBinding) Context() context.Context

Context is the lifetime of the application.

Flutter: no counterpart

func (*PaintingBinding) Evict

func (b *PaintingBinding) Evict(asset string)

Evict clears the image cache, as when an asset changed.

Flutter: painting/binding.dart PaintingBinding.evict

func (*PaintingBinding) HTTPClient

func (b *PaintingBinding) HTTPClient() *http.Client

HTTPClient is the client NetworkImage requests with.

Flutter: painting/_network_image_io.dart debugNetworkImageHttpClientProvider

func (*PaintingBinding) HandleMemoryPressure

func (b *PaintingBinding) HandleMemoryPressure()

HandleMemoryPressure clears the image cache.

Flutter: painting/binding.dart PaintingBinding.handleMemoryPressure

func (*PaintingBinding) HandleSystemFontsChange

func (b *PaintingBinding) HandleSystemFontsChange()

HandleSystemFontsChange tells the listeners of SystemFonts that the fonts of the system changed.

Flutter: painting/binding.dart PaintingBinding.handleSystemMessage (fontsChange)

func (*PaintingBinding) ImageCache

func (b *PaintingBinding) ImageCache() *ImageCache

ImageCache is the singleton cache of images that have been loaded.

Flutter: painting/binding.dart PaintingBinding.imageCache

func (*PaintingBinding) InstantiateImageCodecWithSize

func (b *PaintingBinding) InstantiateImageCodecWithSize(ctx context.Context, data []byte, getTargetSize TargetImageSizeCallback) (*ui.Codec, error)

InstantiateImageCodecWithSize decodes an image at the size getTargetSize picks. It fails with the tag ImageDecodeFailed if the data is not an image.

Flutter: painting/binding.dart PaintingBinding.instantiateImageCodecWithSize

func (*PaintingBinding) Post

func (b *PaintingBinding) Post(fn func())

Post runs the function on the UI thread; it is safe from any goroutine.

Flutter: no counterpart (Dart futures complete on the UI isolate)

func (*PaintingBinding) ReportError

func (b *PaintingBinding) ReportError(details ImageErrorDetails)

ReportError gives an error nobody handled to the reporter: ErrorReporter if it was set, else the framework's error reporter.

Flutter: foundation/assertions.dart FlutterError.reportError

func (*PaintingBinding) Scheduler

func (b *PaintingBinding) Scheduler() *scheduler.SchedulerBinding

Scheduler is the scheduler binding the painting binding runs on.

Flutter: no counterpart

func (*PaintingBinding) SystemFonts

func (b *PaintingBinding) SystemFonts() foundation.Listenable

SystemFonts notifies when the fonts of the system change.

Flutter: painting/binding.dart PaintingBinding.systemFonts

func (*PaintingBinding) TextEngine

func (b *PaintingBinding) TextEngine() ui.ParagraphFactory

TextEngine is the text engine of the platform dispatcher, which lays out the paragraphs of a TextPainter.

Flutter: no counterpart

type PaintingBindingOpts

type PaintingBindingOpts struct {
	// Post runs a function on the UI thread, from any goroutine; the default is
	// the Post of the scheduler's PlatformDispatcher.
	Post func(fn func())
	// AfterFunc calls fn on the UI thread after d, and returns the function that
	// cancels it; the default is time.AfterFunc and Post.
	AfterFunc func(d time.Duration, fn func()) (stop func())
	// ImageCache is the cache the binding uses; the default is a new one with the
	// default limits.
	ImageCache *ImageCache
	// AssetBundle is the root bundle: the one an AssetImage reads from when the
	// provider and the ImageConfiguration name none.
	AssetBundle services.AssetBundle
	// HTTPClient makes the requests of NetworkImage; the default is a new
	// http.Client.
	HTTPClient *http.Client
	// ErrorReporter receives the details of the errors nobody handled. When it
	// is nil they go to Reporter.
	ErrorReporter func(ImageErrorDetails)
	// Reporter is the framework's error reporter (SPEC §14.2); it receives the
	// error of each report that ErrorReporter does not take.
	Reporter foundation.ErrorReporter
}

PaintingBindingOpts are the optional parameters of NewPaintingBinding.

Flutter: painting/binding.dart PaintingBinding

type PlaceholderDimensions

type PlaceholderDimensions struct {
	// Size is the size of the placeholder.
	Size ui.Size
	// Alignment is how the placeholder aligns with the text.
	Alignment ui.PlaceholderAlignment
	// Baseline is the baseline the placeholder aligns on.
	Baseline ui.TextBaseline
	// BaselineOffset is the distance from the top of the box to its baseline.
	BaselineOffset foundation.Opt[float64]
}

PlaceholderDimensions is the dimensions of a placeholder (the box of a WidgetSpan) that TextPainter lays out around.

Flutter: painting/text_painter.dart PlaceholderDimensions

func PlaceholderDimensionsEmpty

func PlaceholderDimensionsEmpty() PlaceholderDimensions

PlaceholderDimensionsEmpty is the dimensions of a placeholder that takes no space.

Flutter: painting/text_painter.dart PlaceholderDimensions.empty

func (PlaceholderDimensions) String

func (d PlaceholderDimensions) String() string

String describes the dimensions.

Flutter: painting/text_painter.dart PlaceholderDimensions.toString

type PlaceholderSpan

type PlaceholderSpan interface {
	InlineSpan
	// Alignment is how the placeholder aligns with the text.
	//
	// Flutter: painting/placeholder_span.dart PlaceholderSpan.alignment
	Alignment() ui.PlaceholderAlignment
	// Baseline is the baseline the placeholder aligns on, for the baseline
	// alignment; unspecified is null.
	//
	// Flutter: painting/placeholder_span.dart PlaceholderSpan.baseline
	Baseline() ui.TextBaseline
}

PlaceholderSpan is an immutable placeholder that is embedded inline within text. WidgetSpan implements it.

Flutter: painting/placeholder_span.dart PlaceholderSpan

type PlaceholderSpanBase

type PlaceholderSpanBase struct {
	InlineSpanBase
	// contains filtered or unexported fields
}

PlaceholderSpanBase is what a PlaceholderSpan has: the alignment, the baseline and the style. Embed it.

Flutter: painting/placeholder_span.dart PlaceholderSpan

func NewPlaceholderSpanBase

func NewPlaceholderSpanBase(opts ...PlaceholderSpanOpts) PlaceholderSpanBase

NewPlaceholderSpanBase creates the base of a placeholder span.

Flutter: painting/placeholder_span.dart PlaceholderSpan.new

func (PlaceholderSpanBase) Alignment

Alignment is how the placeholder aligns with the text.

Flutter: painting/placeholder_span.dart PlaceholderSpan.alignment

func (PlaceholderSpanBase) Baseline

func (b PlaceholderSpanBase) Baseline() ui.TextBaseline

Baseline is the baseline the placeholder aligns on.

Flutter: painting/placeholder_span.dart PlaceholderSpan.baseline

func (PlaceholderSpanBase) ComputeSemanticsInformation

func (b PlaceholderSpanBase) ComputeSemanticsInformation(collector *[]InlineSpanSemanticsInformation)

ComputeSemanticsInformation adds the placeholder information.

Flutter: painting/placeholder_span.dart PlaceholderSpan.computeSemanticsInformation

func (PlaceholderSpanBase) ComputeToPlainText

func (b PlaceholderSpanBase) ComputeToPlainText(buffer *strings.Builder, includeSemanticsLabels, includePlaceholders bool)

ComputeToPlainText writes the placeholder character.

Flutter: painting/placeholder_span.dart PlaceholderSpan.computeToPlainText

func (PlaceholderSpanBase) DebugAssertIsValid

func (b PlaceholderSpanBase) DebugAssertIsValid() bool

DebugAssertIsValid panics in debug builds with the tag PlaceholderSpanNotImplemented: a placeholder span must be a WidgetSpan, which implements this itself.

Flutter: painting/placeholder_span.dart PlaceholderSpan.debugAssertIsValid

func (PlaceholderSpanBase) DebugFillBase

DebugFillBase adds the style, the alignment and the baseline.

Flutter: painting/placeholder_span.dart PlaceholderSpan.debugFillProperties

type PlaceholderSpanOpts

type PlaceholderSpanOpts struct {
	// Alignment defaults to bottom.
	Alignment ui.PlaceholderAlignment
	// Baseline is the baseline to align on.
	Baseline ui.TextBaseline
	// Style is the style of the span.
	Style *TextStyle
}

PlaceholderSpanOpts are the optional parameters of NewPlaceholderSpanBase.

Flutter: painting/placeholder_span.dart PlaceholderSpan.new

type PositionDependentBoxOpts

type PositionDependentBoxOpts struct {
	// Size is the size of the container.
	Size ui.Size
	// ChildSize is the size of the box to position.
	ChildSize ui.Size
	// Target is the point the box should be near, in the container.
	Target ui.Offset
	// PreferBelow says whether the box goes below the target when it fits both
	// above and below.
	PreferBelow bool
	// VerticalOffset is the distance between the target and the box.
	VerticalOffset float64
	// Margin is the minimum distance to the edges of the container; the default
	// is 10.
	Margin foundation.Opt[float64]
}

PositionDependentBoxOpts are the parameters of PositionDependentBox.

Flutter: painting/geometry.dart positionDependentBox

type RadialGradient

type RadialGradient struct {
	// Center is the center of the gradient, as an offset into the unit square.
	Center AlignmentGeometry
	// Radius is the radius of the gradient, as a fraction of the shortest side
	// of the paint box.
	Radius float64
	// Colors are the colors the gradient should obtain at each of the stops.
	Colors []ui.Color
	// Stops say where each color is obtained; nil spaces the colors evenly.
	Stops []float64
	// TileMode is how this gradient should tile the plane beyond the outer
	// ring at Radius.
	TileMode ui.TileMode
	// Focal is the focal point of the gradient; nil for none.
	Focal AlignmentGeometry
	// FocalRadius is the radius of the focal point, as a fraction of the
	// shortest side of the paint box.
	FocalRadius float64
	// Transform is the transform of the gradient; nil for none.
	Transform GradientTransform
}

RadialGradient is a 2D radial gradient.

Flutter: painting/gradient.dart RadialGradient

func NewRadialGradient

func NewRadialGradient(colors []ui.Color, opts ...RadialGradientOpts) *RadialGradient

NewRadialGradient creates a radial gradient.

Flutter: painting/gradient.dart RadialGradient.new

func RadialGradientLerp

func RadialGradientLerp(a, b *RadialGradient, t float64) *RadialGradient

RadialGradientLerp linearly interpolates between two RadialGradients. Either may be nil.

Flutter: painting/gradient.dart RadialGradient.lerp

func (*RadialGradient) CreateShader

func (g *RadialGradient) CreateShader(rect ui.Rect, td ui.TextDirection) ui.Shader

CreateShader creates the shader for the rect.

Flutter: painting/gradient.dart RadialGradient.createShader

func (*RadialGradient) Equal

func (g *RadialGradient) Equal(other Gradient) bool

Equal reports whether other is an equal RadialGradient.

Flutter: painting/gradient.dart RadialGradient.operator ==

func (*RadialGradient) FromColor

func (g *RadialGradient) FromColor(c ui.Color) Gradient

FromColor returns a gradient with all its colors replaced by color.

Flutter: painting/gradient.dart RadialGradient.fromColor

func (*RadialGradient) GetColors

func (g *RadialGradient) GetColors() []ui.Color

GetColors returns the colors.

Flutter: painting/gradient.dart Gradient.colors

func (*RadialGradient) GetStops

func (g *RadialGradient) GetStops() []float64

GetStops returns the stops.

Flutter: painting/gradient.dart Gradient.stops

func (*RadialGradient) GetTransform

func (g *RadialGradient) GetTransform() GradientTransform

GetTransform returns the transform.

Flutter: painting/gradient.dart Gradient.transform

func (*RadialGradient) LerpFrom

func (g *RadialGradient) LerpFrom(a Gradient, t float64) Gradient

LerpFrom interpolates from a RadialGradient or nil.

Flutter: painting/gradient.dart RadialGradient.lerpFrom

func (*RadialGradient) LerpTo

func (g *RadialGradient) LerpTo(b Gradient, t float64) Gradient

LerpTo interpolates to a RadialGradient or nil.

Flutter: painting/gradient.dart RadialGradient.lerpTo

func (*RadialGradient) Scale

func (g *RadialGradient) Scale(factor float64) Gradient

Scale returns a gradient with its colors scaled by the factor.

Flutter: painting/gradient.dart RadialGradient.scale

func (*RadialGradient) String

func (g *RadialGradient) String() string

String describes the gradient.

Flutter: painting/gradient.dart RadialGradient.toString

func (*RadialGradient) WithOpacity

func (g *RadialGradient) WithOpacity(o float64) Gradient

WithOpacity returns a gradient with the opacity applied to its colors.

Flutter: painting/gradient.dart RadialGradient.withOpacity

type RadialGradientOpts

type RadialGradientOpts struct {
	// Center defaults to AlignmentCenter.
	Center AlignmentGeometry
	// Radius defaults to 0.5.
	Radius foundation.Opt[float64]
	// Stops say where each color is obtained; nil spaces them evenly.
	Stops []float64
	// TileMode defaults to ui.TileModeClamp.
	TileMode ui.TileMode
	// Focal is the focal point; nil for none.
	Focal AlignmentGeometry
	// FocalRadius defaults to 0.
	FocalRadius float64
	// Transform is the transform of the gradient.
	Transform GradientTransform
}

RadialGradientOpts are the optional parameters of NewRadialGradient.

Flutter: painting/gradient.dart RadialGradient.new

type RenderComparison

type RenderComparison int

RenderComparison is the description of the difference between two objects, in terms of how much work is needed to apply it: nothing, the metadata, a repaint or a new layout.

Flutter: painting/basic_types.dart RenderComparison

const (
	// RenderComparisonIdentical means the objects are the same: no work is needed.
	//
	// Flutter: painting/basic_types.dart RenderComparison.identical
	RenderComparisonIdentical RenderComparison = iota
	// RenderComparisonMetadata means that only the metadata, such as the
	// semantics, changed.
	//
	// Flutter: painting/basic_types.dart RenderComparison.metadata
	RenderComparisonMetadata
	// RenderComparisonPaint means that the object needs to be repainted.
	//
	// Flutter: painting/basic_types.dart RenderComparison.paint
	RenderComparisonPaint
	// RenderComparisonLayout means that the object needs a new layout.
	//
	// Flutter: painting/basic_types.dart RenderComparison.layout
	RenderComparisonLayout
)

The values of RenderComparison follow Flutter's declaration order.

func (RenderComparison) Name

func (c RenderComparison) Name() string

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

func (RenderComparison) String

func (c RenderComparison) String() string

String returns the name Dart prints, such as "RenderComparison.layout".

type ResizeImage

type ResizeImage struct {
	// ImageProvider is the provider of the original image.
	ImageProvider ImageProvider
	// Width is the width the image should decode to and cache; None for the
	// intrinsic width, or the aspect ratio of Height.
	Width foundation.Opt[int]
	// Height is the height the image should decode to and cache.
	Height foundation.Opt[int]
	// Policy is how the dimensions apply; the default is exact.
	Policy ResizeImagePolicy
	// AllowUpscaling says whether the image may be made larger than it is.
	AllowUpscaling bool
}

ResizeImage instructs Flutter to decode the image at the specified dimensions instead of at its native size.

Flutter: painting/image_provider.dart ResizeImage

func NewResizeImage

func NewResizeImage(imageProvider ImageProvider, opts ...ResizeImageOpts) *ResizeImage

NewResizeImage creates a provider that decodes the image at the dimensions. In debug builds giving neither Width nor Height panics with the tag ResizeImageNoSize.

Flutter: painting/image_provider.dart ResizeImage.new

func (*ResizeImage) LoadImage

func (r *ResizeImage) LoadImage(binding *PaintingBinding, key any, decode ImageDecoderCallback) *ImageStreamCompleter

LoadImage loads the wrapped image, decoding it at the size.

Flutter: painting/image_provider.dart ResizeImage.loadImage

func (*ResizeImage) ObtainKey

func (r *ResizeImage) ObtainKey(binding *PaintingBinding, configuration ImageConfiguration) (any, error)

ObtainKey makes the key from the key of the wrapped provider.

Flutter: painting/image_provider.dart ResizeImage.obtainKey

type ResizeImageKey

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

ResizeImageKey is the key of a ResizeImage.

Flutter: painting/image_provider.dart ResizeImageKey

type ResizeImageOpts

type ResizeImageOpts struct {
	// Width is the width the image should decode to.
	Width foundation.Opt[int]
	// Height is the height the image should decode to.
	Height foundation.Opt[int]
	// Policy defaults to exact.
	Policy ResizeImagePolicy
	// AllowUpscaling defaults to false.
	AllowUpscaling bool
}

ResizeImageOpts are the optional parameters of NewResizeImage.

Flutter: painting/image_provider.dart ResizeImage.new

type ResizeImagePolicy

type ResizeImagePolicy int

ResizeImagePolicy is how ResizeImage resizes the image.

Flutter: painting/image_provider.dart ResizeImagePolicy

const (
	// ResizeImagePolicyUnspecified is the zero value: exact.
	ResizeImagePolicyUnspecified ResizeImagePolicy = iota
	// ResizeImagePolicyExact makes the image the size, regardless of its aspect
	// ratio.
	//
	// Flutter: painting/image_provider.dart ResizeImagePolicy.exact
	ResizeImagePolicyExact
	// ResizeImagePolicyFit makes the image fit in the size, keeping its aspect
	// ratio.
	//
	// Flutter: painting/image_provider.dart ResizeImagePolicy.fit
	ResizeImagePolicyFit
)

The values of ResizeImagePolicy follow Flutter's declaration order.

func (ResizeImagePolicy) Name

func (p ResizeImagePolicy) Name() string

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

type RoundedRectangleBorder

type RoundedRectangleBorder struct {
	ShapeBorderDefaults

	// BorderRadius is the radii for each corner; nil is BorderRadiusZero.
	BorderRadius BorderRadiusGeometry
	// contains filtered or unexported fields
}

RoundedRectangleBorder is a rectangular border with rounded corners.

Flutter: painting/rounded_rectangle_border.dart RoundedRectangleBorder

func NewRoundedRectangleBorder

func NewRoundedRectangleBorder(opts ...RoundedRectangleBorderOpts) RoundedRectangleBorder

NewRoundedRectangleBorder creates a rounded rectangle border.

Flutter: painting/rounded_rectangle_border.dart RoundedRectangleBorder.new

func (RoundedRectangleBorder) CopyWith

CopyWith returns a copy with the given fields replaced.

Flutter: painting/rounded_rectangle_border.dart RoundedRectangleBorder.copyWith

func (RoundedRectangleBorder) CopyWithSide

func (b RoundedRectangleBorder) CopyWithSide(side BorderSide) OutlinedBorder

CopyWithSide returns a copy with the given side.

Flutter: painting/borders.dart OutlinedBorder.copyWith

func (RoundedRectangleBorder) Dimensions

Dimensions is the stroke inset on all sides.

Flutter: painting/borders.dart OutlinedBorder.dimensions

func (RoundedRectangleBorder) GetInnerPath

func (b RoundedRectangleBorder) GetInnerPath(rect ui.Rect, td ui.TextDirection) *ui.Path

GetInnerPath is the rounded rectangle, deflated by the stroke inset.

Flutter: painting/rounded_rectangle_border.dart RoundedRectangleBorder.getInnerPath

func (RoundedRectangleBorder) GetOuterPath

func (b RoundedRectangleBorder) GetOuterPath(rect ui.Rect, td ui.TextDirection) *ui.Path

GetOuterPath is the rounded rectangle.

Flutter: painting/rounded_rectangle_border.dart RoundedRectangleBorder.getOuterPath

func (RoundedRectangleBorder) LerpFrom

LerpFrom interpolates from a RoundedRectangleBorder or a CircleBorder.

Flutter: painting/rounded_rectangle_border.dart RoundedRectangleBorder.lerpFrom

func (RoundedRectangleBorder) LerpTo

LerpTo interpolates to a RoundedRectangleBorder or a CircleBorder.

Flutter: painting/rounded_rectangle_border.dart RoundedRectangleBorder.lerpTo

func (RoundedRectangleBorder) Paint

func (b RoundedRectangleBorder) Paint(canvas *ui.Canvas, rect ui.Rect, td ui.TextDirection)

Paint strokes the border.

Flutter: painting/rounded_rectangle_border.dart RoundedRectangleBorder.paint

func (RoundedRectangleBorder) PaintInterior

func (b RoundedRectangleBorder) PaintInterior(canvas *ui.Canvas, rect ui.Rect, paint *ui.Paint, td ui.TextDirection)

PaintInterior fills the rounded rectangle.

Flutter: painting/rounded_rectangle_border.dart RoundedRectangleBorder.paintInterior

func (RoundedRectangleBorder) PreferPaintInterior

func (b RoundedRectangleBorder) PreferPaintInterior() bool

PreferPaintInterior is true.

Flutter: painting/rounded_rectangle_border.dart RoundedRectangleBorder.preferPaintInterior

func (RoundedRectangleBorder) Scale

Scale scales the side and the radii by t.

Flutter: painting/rounded_rectangle_border.dart RoundedRectangleBorder.scale

func (RoundedRectangleBorder) Side

Side is the border outline's color and weight.

Flutter: painting/borders.dart OutlinedBorder.side

func (RoundedRectangleBorder) String

func (b RoundedRectangleBorder) String() string

String describes the border.

Flutter: painting/rounded_rectangle_border.dart RoundedRectangleBorder.toString

type RoundedRectangleBorderCopy

type RoundedRectangleBorderCopy struct {
	Side         foundation.Opt[BorderSide]
	BorderRadius BorderRadiusGeometry
}

RoundedRectangleBorderCopy holds the replacements for RoundedRectangleBorder.CopyWith.

Flutter: painting/rounded_rectangle_border.dart RoundedRectangleBorder.copyWith

type RoundedRectangleBorderOpts

type RoundedRectangleBorderOpts struct {
	// Side defaults to BorderSideNone.
	Side BorderSide
	// BorderRadius defaults to BorderRadiusZero.
	BorderRadius BorderRadiusGeometry
}

RoundedRectangleBorderOpts are the optional parameters of NewRoundedRectangleBorder.

Flutter: painting/rounded_rectangle_border.dart RoundedRectangleBorder.new

type RoundedSuperellipseBorder

type RoundedSuperellipseBorder struct {
	ShapeBorderDefaults

	// BorderRadius is the radii for each corner; nil is BorderRadiusZero.
	BorderRadius BorderRadiusGeometry
	// contains filtered or unexported fields
}

RoundedSuperellipseBorder is a rectangular border with continuous (superellipse) rounded corners.

Flutter: painting/rounded_rectangle_border.dart RoundedSuperellipseBorder

func NewRoundedSuperellipseBorder

func NewRoundedSuperellipseBorder(opts ...RoundedSuperellipseBorderOpts) RoundedSuperellipseBorder

NewRoundedSuperellipseBorder creates a rounded superellipse border.

Flutter: painting/rounded_rectangle_border.dart RoundedSuperellipseBorder.new

func (RoundedSuperellipseBorder) CopyWith

CopyWith returns a copy with the given fields replaced.

Flutter: painting/rounded_rectangle_border.dart RoundedSuperellipseBorder.copyWith

func (RoundedSuperellipseBorder) CopyWithSide

CopyWithSide returns a copy with the given side.

Flutter: painting/borders.dart OutlinedBorder.copyWith

func (RoundedSuperellipseBorder) Dimensions

Dimensions is the stroke inset on all sides.

Flutter: painting/borders.dart OutlinedBorder.dimensions

func (RoundedSuperellipseBorder) GetInnerPath

func (b RoundedSuperellipseBorder) GetInnerPath(rect ui.Rect, td ui.TextDirection) *ui.Path

GetInnerPath is the shape, deflated by the stroke inset.

Flutter: painting/rounded_rectangle_border.dart RoundedSuperellipseBorder.getInnerPath

func (RoundedSuperellipseBorder) GetOuterPath

func (b RoundedSuperellipseBorder) GetOuterPath(rect ui.Rect, td ui.TextDirection) *ui.Path

GetOuterPath is the shape.

Flutter: painting/rounded_rectangle_border.dart RoundedSuperellipseBorder.getOuterPath

func (RoundedSuperellipseBorder) LerpFrom

LerpFrom interpolates from a RoundedSuperellipseBorder or a CircleBorder.

Flutter: painting/rounded_rectangle_border.dart RoundedSuperellipseBorder.lerpFrom

func (RoundedSuperellipseBorder) LerpTo

LerpTo interpolates to a RoundedSuperellipseBorder or a CircleBorder.

Flutter: painting/rounded_rectangle_border.dart RoundedSuperellipseBorder.lerpTo

func (RoundedSuperellipseBorder) Paint

func (b RoundedSuperellipseBorder) Paint(canvas *ui.Canvas, rect ui.Rect, td ui.TextDirection)

Paint strokes the border.

Flutter: painting/rounded_rectangle_border.dart RoundedSuperellipseBorder.paint

func (RoundedSuperellipseBorder) PaintInterior

func (b RoundedSuperellipseBorder) PaintInterior(canvas *ui.Canvas, rect ui.Rect, paint *ui.Paint, td ui.TextDirection)

PaintInterior fills the shape.

Flutter: painting/rounded_rectangle_border.dart RoundedSuperellipseBorder.paintInterior

func (RoundedSuperellipseBorder) PreferPaintInterior

func (b RoundedSuperellipseBorder) PreferPaintInterior() bool

PreferPaintInterior is true.

Flutter: painting/rounded_rectangle_border.dart RoundedSuperellipseBorder.preferPaintInterior

func (RoundedSuperellipseBorder) Scale

Scale scales the side and the radii by t.

Flutter: painting/rounded_rectangle_border.dart RoundedSuperellipseBorder.scale

func (RoundedSuperellipseBorder) Side

Side is the border outline's color and weight.

Flutter: painting/borders.dart OutlinedBorder.side

func (RoundedSuperellipseBorder) String

func (b RoundedSuperellipseBorder) String() string

String describes the border.

Flutter: painting/rounded_rectangle_border.dart RoundedSuperellipseBorder.toString

type RoundedSuperellipseBorderOpts

type RoundedSuperellipseBorderOpts = RoundedRectangleBorderOpts

RoundedSuperellipseBorderOpts are the optional parameters of NewRoundedSuperellipseBorder.

Flutter: painting/rounded_rectangle_border.dart RoundedSuperellipseBorder.new

type ShapeBorder

type ShapeBorder interface {
	// Dimensions is the widths of the border: the insets that make the area a
	// widget can use inside the border.
	Dimensions() EdgeInsetsGeometry
	// Add attempts to create a new object that represents the amalgamation of
	// this border and the other (placed on top of it, or below it if reversed).
	// It returns nil if it can't.
	Add(other ShapeBorder, reversed bool) ShapeBorder
	// Scale creates a copy of the border scaled by the factor t.
	Scale(t float64) ShapeBorder
	// LerpFrom linearly interpolates from another ShapeBorder (possibly nil) to
	// this one; it returns nil if it can't.
	LerpFrom(a ShapeBorder, t float64) ShapeBorder
	// LerpTo linearly interpolates from this to another ShapeBorder (possibly
	// nil); it returns nil if it can't.
	LerpTo(b ShapeBorder, t float64) ShapeBorder
	// GetOuterPath creates a Path that describes the outer edge of the border.
	GetOuterPath(rect ui.Rect, textDirection ui.TextDirection) *ui.Path
	// GetInnerPath creates a Path that describes the inner edge of the border.
	GetInnerPath(rect ui.Rect, textDirection ui.TextDirection) *ui.Path
	// PaintInterior paints the interior of the border, if PreferPaintInterior
	// is true.
	PaintInterior(canvas *ui.Canvas, rect ui.Rect, paint *ui.Paint, textDirection ui.TextDirection)
	// PreferPaintInterior reports whether PaintInterior is faster than
	// filling the path of GetOuterPath.
	PreferPaintInterior() bool
	// Paint paints the border within the given rect on the given canvas.
	Paint(canvas *ui.Canvas, rect ui.Rect, textDirection ui.TextDirection)
	String() string
}

ShapeBorder is the base of shapes that can be drawn as borders around a box and used as the outline of a shape. The methods Add, LerpFrom and LerpTo are protected in Flutter; they are exported so that other packages can implement a ShapeBorder. A nil ShapeBorder is Flutter's null. Embed ShapeBorderDefaults for the default Add, PaintInterior and PreferPaintInterior.

Flutter: painting/borders.dart ShapeBorder

func ShapeBorderDefaultLerpFrom

func ShapeBorderDefaultLerpFrom(self, a ShapeBorder, t float64) ShapeBorder

ShapeBorderDefaultLerpFrom is the default LerpFrom of a ShapeBorder: the scaled border when a is nil, and nil otherwise.

Flutter: painting/borders.dart ShapeBorder.lerpFrom

func ShapeBorderDefaultLerpTo

func ShapeBorderDefaultLerpTo(self, b ShapeBorder, t float64) ShapeBorder

ShapeBorderDefaultLerpTo is the default LerpTo of a ShapeBorder: the scaled border when b is nil, and nil otherwise.

Flutter: painting/borders.dart ShapeBorder.lerpTo

func ShapeBorderLerp

func ShapeBorderLerp(a, b ShapeBorder, t float64) ShapeBorder

ShapeBorderLerp linearly interpolates between two ShapeBorders. Either may be nil. When neither border knows how to interpolate with the other, the result is a for t < 0.5 and b after.

Flutter: painting/borders.dart ShapeBorder.lerp

func ShapeBorderPlus

func ShapeBorderPlus(a, other ShapeBorder) ShapeBorder

ShapeBorderPlus creates a new border consisting of the two borders: the other border on the outside, then this one.

Flutter: painting/borders.dart ShapeBorder.operator +

type ShapeBorderDefaults

type ShapeBorderDefaults struct{}

ShapeBorderDefaults supplies the default Add (nil), PaintInterior (a debug panic) and PreferPaintInterior (false) of ShapeBorder; embed it in a border.

Flutter: painting/borders.dart ShapeBorder

func (ShapeBorderDefaults) Add

Add returns nil: the borders can't be amalgamated.

Flutter: painting/borders.dart ShapeBorder.add

func (ShapeBorderDefaults) PaintInterior

func (ShapeBorderDefaults) PaintInterior(*ui.Canvas, ui.Rect, *ui.Paint, ui.TextDirection)

PaintInterior panics in debug builds with the tag ShapeBorderNoPaintInterior: the border said it does not prefer to paint its interior.

Flutter: painting/borders.dart ShapeBorder.paintInterior

func (ShapeBorderDefaults) PreferPaintInterior

func (ShapeBorderDefaults) PreferPaintInterior() bool

PreferPaintInterior is false.

Flutter: painting/borders.dart ShapeBorder.preferPaintInterior

type ShapeDecoration

type ShapeDecoration struct {
	DecorationDefaults
	// Color is the color to fill in the background of the shape.
	Color foundation.Opt[ui.Color]
	// Image is the image to paint inside the shape, above Color and Gradient.
	Image DecorationImageSource
	// Gradient is the gradient to use when filling the shape.
	Gradient Gradient
	// Shadows is a list of shadows cast by this shape behind the shape. Nil is
	// Flutter's null.
	Shadows []BoxShadow
	// Shape is the shape to fill the Color, Gradient and Image into and to cast
	// as the Shadows.
	Shape ShapeBorder
}

ShapeDecoration is an immutable description of how to paint an arbitrary shape.

Flutter: painting/shape_decoration.dart ShapeDecoration

func NewShapeDecoration

func NewShapeDecoration(shape ShapeBorder, opts ...ShapeDecorationOpts) *ShapeDecoration

NewShapeDecoration creates a shape decoration. In debug builds a color together with a gradient panics with the tag ShapeDecorationColorAndGradient.

Flutter: painting/shape_decoration.dart ShapeDecoration.new

func NewShapeDecorationFromBoxDecoration

func NewShapeDecorationFromBoxDecoration(source *BoxDecoration) *ShapeDecoration

NewShapeDecorationFromBoxDecoration creates a shape decoration out of a box decoration. In debug builds a non-uniform border where a shape needs a uniform one panics with the tag ShapeDecorationBorderNotUniform.

Flutter: painting/shape_decoration.dart ShapeDecoration.fromBoxDecoration

func ShapeDecorationLerp

func ShapeDecorationLerp(a, b *ShapeDecoration, t float64) *ShapeDecoration

ShapeDecorationLerp linearly interpolates between two shape decorations. Either may be nil.

Flutter: painting/shape_decoration.dart ShapeDecoration.lerp

func (*ShapeDecoration) CreateBoxPainter

func (d *ShapeDecoration) CreateBoxPainter(onChanged func()) BoxPainter

CreateBoxPainter returns a painter for the decoration. In debug builds it panics with the tag ShapeDecorationOnChangedRequired if there is an image but no onChanged callback.

Flutter: painting/shape_decoration.dart ShapeDecoration.createBoxPainter

func (*ShapeDecoration) DebugFillProperties

func (d *ShapeDecoration) DebugFillProperties(p *foundation.DiagnosticPropertiesBuilder)

DebugFillProperties adds the color, gradient, image, shadows and shape.

Flutter: painting/shape_decoration.dart ShapeDecoration.debugFillProperties

func (*ShapeDecoration) Equal

func (d *ShapeDecoration) Equal(other *ShapeDecoration) bool

Equal reports whether the other decoration is an equal ShapeDecoration.

Flutter: painting/shape_decoration.dart ShapeDecoration.operator ==

func (*ShapeDecoration) GetClipPath

func (d *ShapeDecoration) GetClipPath(rect ui.Rect, td ui.TextDirection) *ui.Path

GetClipPath is the outer path of the shape.

Flutter: painting/shape_decoration.dart ShapeDecoration.getClipPath

func (*ShapeDecoration) HitTest

func (d *ShapeDecoration) HitTest(size ui.Size, position ui.Offset, td ui.TextDirection) bool

HitTest tests whether the position hits the outer path of the shape.

Flutter: painting/shape_decoration.dart ShapeDecoration.hitTest

func (*ShapeDecoration) IsComplex

func (d *ShapeDecoration) IsComplex() bool

IsComplex is whether the decoration has shadows.

Flutter: painting/shape_decoration.dart ShapeDecoration.isComplex

func (*ShapeDecoration) LerpFrom

func (d *ShapeDecoration) LerpFrom(a Decoration, t float64) Decoration

LerpFrom interpolates from a BoxDecoration, a ShapeDecoration or nil.

Flutter: painting/shape_decoration.dart ShapeDecoration.lerpFrom

func (*ShapeDecoration) LerpTo

func (d *ShapeDecoration) LerpTo(b Decoration, t float64) Decoration

LerpTo interpolates to a BoxDecoration, a ShapeDecoration or nil.

Flutter: painting/shape_decoration.dart ShapeDecoration.lerpTo

func (*ShapeDecoration) Padding

func (d *ShapeDecoration) Padding() EdgeInsetsGeometry

Padding is the dimensions of the shape.

Flutter: painting/shape_decoration.dart ShapeDecoration.padding

func (*ShapeDecoration) String

func (d *ShapeDecoration) String() string

String describes the decoration and its properties.

Flutter: painting/shape_decoration.dart ShapeDecoration.toString

func (*ShapeDecoration) ToStringShort

func (d *ShapeDecoration) ToStringShort() string

ToStringShort names the decoration.

Flutter: painting/decoration.dart Decoration.toStringShort

type ShapeDecorationOpts

type ShapeDecorationOpts struct {
	Color    foundation.Opt[ui.Color]
	Image    DecorationImageSource
	Gradient Gradient
	Shadows  []BoxShadow
}

ShapeDecorationOpts are the optional parameters of NewShapeDecoration.

Flutter: painting/shape_decoration.dart ShapeDecoration.new

type SpanBuildOpts

type SpanBuildOpts struct {
	// TextScaler scales the font sizes; the default is TextScalerNoScaling.
	TextScaler TextScaler
	// Dimensions are the sizes of the placeholders, in the order they appear.
	Dimensions []PlaceholderDimensions
}

SpanBuildOpts are the optional parameters of InlineSpan.Build.

Flutter: painting/inline_span.dart InlineSpan.build

type StadiumBorder

type StadiumBorder struct {
	ShapeBorderDefaults
	// contains filtered or unexported fields
}

StadiumBorder is a border that fits a stadium-shaped border (a box with semicircles on the ends) within the rectangle of the widget it is applied to.

Flutter: painting/stadium_border.dart StadiumBorder

func NewStadiumBorder

func NewStadiumBorder(opts ...StadiumBorderOpts) StadiumBorder

NewStadiumBorder creates a stadium border.

Flutter: painting/stadium_border.dart StadiumBorder.new

func (StadiumBorder) CopyWith

CopyWith returns a copy with the given fields replaced.

Flutter: painting/stadium_border.dart StadiumBorder.copyWith

func (StadiumBorder) CopyWithSide

func (b StadiumBorder) CopyWithSide(side BorderSide) OutlinedBorder

CopyWithSide returns a copy with the given side.

Flutter: painting/borders.dart OutlinedBorder.copyWith

func (StadiumBorder) Dimensions

func (b StadiumBorder) Dimensions() EdgeInsetsGeometry

Dimensions is the stroke inset on all sides.

Flutter: painting/borders.dart OutlinedBorder.dimensions

func (StadiumBorder) GetInnerPath

func (b StadiumBorder) GetInnerPath(rect ui.Rect, _ ui.TextDirection) *ui.Path

GetInnerPath is the stadium, deflated by the stroke inset.

Flutter: painting/stadium_border.dart StadiumBorder.getInnerPath

func (StadiumBorder) GetOuterPath

func (b StadiumBorder) GetOuterPath(rect ui.Rect, _ ui.TextDirection) *ui.Path

GetOuterPath is the stadium.

Flutter: painting/stadium_border.dart StadiumBorder.getOuterPath

func (StadiumBorder) LerpFrom

func (b StadiumBorder) LerpFrom(a ShapeBorder, t float64) ShapeBorder

LerpFrom interpolates from a StadiumBorder, CircleBorder or RoundedRectangleBorder.

Flutter: painting/stadium_border.dart StadiumBorder.lerpFrom

func (StadiumBorder) LerpTo

LerpTo interpolates to a StadiumBorder, CircleBorder or RoundedRectangleBorder.

Flutter: painting/stadium_border.dart StadiumBorder.lerpTo

func (StadiumBorder) Paint

func (b StadiumBorder) Paint(canvas *ui.Canvas, rect ui.Rect, _ ui.TextDirection)

Paint strokes the stadium.

Flutter: painting/stadium_border.dart StadiumBorder.paint

func (StadiumBorder) PaintInterior

func (b StadiumBorder) PaintInterior(canvas *ui.Canvas, rect ui.Rect, paint *ui.Paint, _ ui.TextDirection)

PaintInterior fills the stadium.

Flutter: painting/stadium_border.dart StadiumBorder.paintInterior

func (StadiumBorder) PreferPaintInterior

func (b StadiumBorder) PreferPaintInterior() bool

PreferPaintInterior is true.

Flutter: painting/stadium_border.dart StadiumBorder.preferPaintInterior

func (StadiumBorder) Scale

func (b StadiumBorder) Scale(t float64) ShapeBorder

Scale scales the side by t.

Flutter: painting/stadium_border.dart StadiumBorder.scale

func (StadiumBorder) Side

func (b StadiumBorder) Side() BorderSide

Side is the border outline's color and weight.

Flutter: painting/borders.dart OutlinedBorder.side

func (StadiumBorder) String

func (b StadiumBorder) String() string

String describes the border.

Flutter: painting/stadium_border.dart StadiumBorder.toString

type StadiumBorderCopy

type StadiumBorderCopy struct {
	Side foundation.Opt[BorderSide]
}

StadiumBorderCopy holds the replacements for StadiumBorder.CopyWith.

Flutter: painting/stadium_border.dart StadiumBorder.copyWith

type StadiumBorderOpts

type StadiumBorderOpts struct {
	// Side defaults to BorderSideNone.
	Side BorderSide
}

StadiumBorderOpts are the optional parameters of NewStadiumBorder.

Flutter: painting/stadium_border.dart StadiumBorder.new

type StarBorder

type StarBorder struct {
	ShapeBorderDefaults

	// Points is the number of points in this star, or sides on a polygon.
	Points float64

	// PointRounding is how rounded the points of the star are, from 0 to 1.
	PointRounding float64
	// ValleyRounding is how rounded the valleys of the star are, from 0 to 1.
	ValleyRounding float64

	// Squash is how much of the aspect ratio of the attached widget to take on,
	// from 0 (a regular star) to 1 (the star takes the aspect ratio).
	Squash float64
	// contains filtered or unexported fields
}

StarBorder is a border that fits a star or polygon-shaped border within the rectangle of the widget it is applied to.

Flutter: painting/star_border.dart StarBorder

func NewStarBorder

func NewStarBorder(opts ...StarBorderOpts) StarBorder

NewStarBorder creates a star border. In debug builds an argument out of its range panics with the tag StarBorderInvalid.

Flutter: painting/star_border.dart StarBorder.new

func NewStarBorderPolygon

func NewStarBorderPolygon(opts ...StarBorderPolygonOpts) StarBorder

NewStarBorderPolygon creates a polygon border. In debug builds an argument out of its range panics with the tag StarBorderInvalid.

Flutter: painting/star_border.dart StarBorder.polygon

func (StarBorder) CopyWith

func (b StarBorder) CopyWith(c StarBorderCopy) StarBorder

CopyWith returns a copy with the given fields replaced. The copy is a star, even if this is a polygon.

Flutter: painting/star_border.dart StarBorder.copyWith

func (StarBorder) CopyWithSide

func (b StarBorder) CopyWithSide(side BorderSide) OutlinedBorder

CopyWithSide returns a copy with the given side.

Flutter: painting/borders.dart OutlinedBorder.copyWith

func (StarBorder) Dimensions

func (b StarBorder) Dimensions() EdgeInsetsGeometry

Dimensions is the stroke inset on all sides.

Flutter: painting/borders.dart OutlinedBorder.dimensions

func (StarBorder) GetInnerPath

func (b StarBorder) GetInnerPath(rect ui.Rect, _ ui.TextDirection) *ui.Path

GetInnerPath is the star, in the rect deflated by the stroke inset.

Flutter: painting/star_border.dart StarBorder.getInnerPath

func (StarBorder) GetOuterPath

func (b StarBorder) GetOuterPath(rect ui.Rect, _ ui.TextDirection) *ui.Path

GetOuterPath is the star.

Flutter: painting/star_border.dart StarBorder.getOuterPath

func (StarBorder) InnerRadiusRatio

func (b StarBorder) InnerRadiusRatio() float64

InnerRadiusRatio is the radius of the inner vertices of the star relative to the outer ones; for a polygon it is cos(pi / points).

Flutter: painting/star_border.dart StarBorder.innerRadiusRatio

func (StarBorder) LerpFrom

func (b StarBorder) LerpFrom(a ShapeBorder, t float64) ShapeBorder

LerpFrom interpolates from a StarBorder, CircleBorder, StadiumBorder or RoundedRectangleBorder.

Flutter: painting/star_border.dart StarBorder.lerpFrom

func (StarBorder) LerpTo

func (b StarBorder) LerpTo(o ShapeBorder, t float64) ShapeBorder

LerpTo interpolates to a StarBorder, CircleBorder, StadiumBorder or RoundedRectangleBorder.

Flutter: painting/star_border.dart StarBorder.lerpTo

func (StarBorder) Paint

func (b StarBorder) Paint(canvas *ui.Canvas, rect ui.Rect, _ ui.TextDirection)

Paint strokes the star.

Flutter: painting/star_border.dart StarBorder.paint

func (StarBorder) Rotation

func (b StarBorder) Rotation() float64

Rotation is the rotation of the star in degrees.

Flutter: painting/star_border.dart StarBorder.rotation

func (StarBorder) Scale

func (b StarBorder) Scale(t float64) ShapeBorder

Scale scales the side by t.

Flutter: painting/star_border.dart StarBorder.scale

func (StarBorder) Side

func (b StarBorder) Side() BorderSide

Side is the border outline's color and weight.

Flutter: painting/borders.dart OutlinedBorder.side

func (StarBorder) String

func (b StarBorder) String() string

String describes the border.

Flutter: painting/star_border.dart StarBorder.toString

type StarBorderCopy

type StarBorderCopy struct {
	Side             foundation.Opt[BorderSide]
	Points           foundation.Opt[float64]
	InnerRadiusRatio foundation.Opt[float64]
	PointRounding    foundation.Opt[float64]
	ValleyRounding   foundation.Opt[float64]
	Rotation         foundation.Opt[float64]
	Squash           foundation.Opt[float64]
}

StarBorderCopy holds the replacements for StarBorder.CopyWith.

Flutter: painting/star_border.dart StarBorder.copyWith

type StarBorderOpts

type StarBorderOpts struct {
	// Side defaults to BorderSideNone.
	Side BorderSide
	// Points defaults to 5; it must be at least 2.
	Points foundation.Opt[float64]
	// InnerRadiusRatio defaults to 0.4; it must be from 0 to 1.
	InnerRadiusRatio foundation.Opt[float64]
	// PointRounding defaults to 0.
	PointRounding float64
	// ValleyRounding defaults to 0.
	ValleyRounding float64
	// Rotation is the rotation of the star in degrees.
	Rotation float64
	// Squash defaults to 0.
	Squash float64
}

StarBorderOpts are the optional parameters of NewStarBorder.

Flutter: painting/star_border.dart StarBorder.new

type StarBorderPolygonOpts

type StarBorderPolygonOpts struct {
	// Side defaults to BorderSideNone.
	Side BorderSide
	// Sides defaults to 5; it must be at least 2.
	Sides foundation.Opt[float64]
	// PointRounding defaults to 0.
	PointRounding float64
	// Rotation is the rotation of the polygon in degrees.
	Rotation float64
	// Squash defaults to 0.
	Squash float64
}

StarBorderPolygonOpts are the optional parameters of NewStarBorderPolygon.

Flutter: painting/star_border.dart StarBorder.polygon

type StrutStyle

type StrutStyle struct {
	// FontFamily is the name of the font to use when painting the strut,
	// including any package prefix.
	FontFamily string
	// FontSize is the size of the strut's font.
	FontSize foundation.Opt[float64]
	// Height is the height of the strut as a multiple of the font size.
	Height foundation.Opt[float64]
	// LeadingDistribution is how the extra height is divided.
	LeadingDistribution ui.TextLeadingDistribution
	// FontWeight is the typeface thickness of the strut.
	FontWeight ui.FontWeight
	// FontStyle is the typeface variant of the strut.
	FontStyle ui.FontStyle
	// Leading is the additional leading as a multiple of the font size.
	Leading foundation.Opt[float64]
	// ForceStrutHeight makes every line use the strut's height when true.
	ForceStrutHeight foundation.Opt[bool]
	// DebugLabel is a human-readable description of the style.
	DebugLabel string
	// contains filtered or unexported fields
}

StrutStyle defines the strut, which sets the minimum vertical layout metrics of the lines of a paragraph.

Flutter: painting/strut_style.dart StrutStyle

func NewStrutStyle

func NewStrutStyle(opts ...StrutStyleOpts) *StrutStyle

NewStrutStyle creates a strut style. In debug builds a font size that is not greater than zero, a negative leading, or a package without a font family panics with the tags StrutStyleFontSizeInvalid, StrutStyleLeadingInvalid and StrutStylePackageWithoutFont.

Flutter: painting/strut_style.dart StrutStyle.new

func NewStrutStyleFromTextStyle

func NewStrutStyleFromTextStyle(textStyle *TextStyle, opts ...StrutStyleOpts) *StrutStyle

NewStrutStyleFromTextStyle creates a strut style from a text style, with the options overriding it.

Flutter: painting/strut_style.dart StrutStyle.fromTextStyle

func StrutStyleDisabled

func StrutStyleDisabled() *StrutStyle

StrutStyleDisabled is the strut that has no height and no leading, so it takes no space and only the text sets the line height.

Flutter: painting/strut_style.dart StrutStyle.disabled

func (*StrutStyle) CompareTo

func (s *StrutStyle) CompareTo(other *StrutStyle) RenderComparison

CompareTo describes the difference between two strut styles: layout when one changes the layout, else identical.

Flutter: painting/strut_style.dart StrutStyle.compareTo

func (*StrutStyle) DebugFillProperties

func (s *StrutStyle) DebugFillProperties(p *foundation.DiagnosticPropertiesBuilder)

DebugFillProperties adds the properties of the style.

Flutter: painting/strut_style.dart StrutStyle.debugFillProperties

func (*StrutStyle) DebugFillPropertiesWithPrefix

func (s *StrutStyle) DebugFillPropertiesWithPrefix(p *foundation.DiagnosticPropertiesBuilder, prefix string)

DebugFillPropertiesWithPrefix is DebugFillProperties with a prefix before each property name, which TextSpan uses for the "style: " properties.

Flutter: painting/strut_style.dart StrutStyle.debugFillProperties

func (*StrutStyle) Equal

func (s *StrutStyle) Equal(other *StrutStyle) bool

Equal is Dart's == on strut styles.

Flutter: painting/strut_style.dart StrutStyle.operator ==

func (*StrutStyle) FontFamilyFallback

func (s *StrutStyle) FontFamilyFallback() []string

FontFamilyFallback is the ordered list of font families to fall back on, with the package prefix applied.

Flutter: painting/strut_style.dart StrutStyle.fontFamilyFallback

func (*StrutStyle) InheritFromTextStyle

func (s *StrutStyle) InheritFromTextStyle(other *TextStyle) *StrutStyle

InheritFromTextStyle returns a strut style with the unset fields taken from the text style.

Flutter: painting/strut_style.dart StrutStyle.inheritFromTextStyle

func (*StrutStyle) Merge

func (s *StrutStyle) Merge(other *StrutStyle) *StrutStyle

Merge returns a strut style where the fields of other replace the ones of this strut style, where other has them.

Flutter: painting/strut_style.dart StrutStyle.merge

func (*StrutStyle) String

func (s *StrutStyle) String() string

String describes the style and its properties.

Flutter: painting/strut_style.dart StrutStyle.toString

func (*StrutStyle) ToStringShort

func (s *StrutStyle) ToStringShort() string

ToStringShort names the style.

Flutter: painting/strut_style.dart StrutStyle.toStringShort

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 strut's font; it must be greater than zero.
	FontSize foundation.Opt[float64]
	// Height is the height of the strut as a multiple of the font size.
	Height foundation.Opt[float64]
	// LeadingDistribution is how the extra height is divided above and below.
	LeadingDistribution ui.TextLeadingDistribution
	// Leading is the additional leading as a multiple of the font size; it must
	// not be negative.
	Leading foundation.Opt[float64]
	// FontWeight is the typeface thickness of the strut.
	FontWeight ui.FontWeight
	// FontStyle is the typeface variant of the strut.
	FontStyle ui.FontStyle
	// ForceStrutHeight makes every line use the strut's height when true.
	ForceStrutHeight foundation.Opt[bool]
	// DebugLabel is a human-readable description of the style.
	DebugLabel string
	// Package is the package that holds the font; the font family names are
	// prefixed with "packages/<package>/".
	Package string
}

StrutStyleOpts are the optional parameters of NewStrutStyle.

Flutter: painting/strut_style.dart StrutStyle

type SweepGradient

type SweepGradient struct {
	// Center is the center of the gradient, as an offset into the unit square.
	Center AlignmentGeometry
	// StartAngle is the angle in radians at which stop 0.0 of the gradient is
	// placed.
	StartAngle float64
	// EndAngle is the angle in radians at which stop 1.0 of the gradient is
	// placed.
	EndAngle float64
	// Colors are the colors the gradient should obtain at each of the stops.
	Colors []ui.Color
	// Stops say where each color is obtained; nil spaces the colors evenly.
	Stops []float64
	// TileMode is how this gradient should tile the plane beyond the angles.
	TileMode ui.TileMode
	// Transform is the transform of the gradient; nil for none.
	Transform GradientTransform
}

SweepGradient is a 2D sweep gradient.

Flutter: painting/gradient.dart SweepGradient

func NewSweepGradient

func NewSweepGradient(colors []ui.Color, opts ...SweepGradientOpts) *SweepGradient

NewSweepGradient creates a sweep gradient.

Flutter: painting/gradient.dart SweepGradient.new

func SweepGradientLerp

func SweepGradientLerp(a, b *SweepGradient, t float64) *SweepGradient

SweepGradientLerp linearly interpolates between two SweepGradients. Either may be nil.

Flutter: painting/gradient.dart SweepGradient.lerp

func (*SweepGradient) CreateShader

func (g *SweepGradient) CreateShader(rect ui.Rect, td ui.TextDirection) ui.Shader

CreateShader creates the shader for the rect.

Flutter: painting/gradient.dart SweepGradient.createShader

func (*SweepGradient) Equal

func (g *SweepGradient) Equal(other Gradient) bool

Equal reports whether other is an equal SweepGradient.

Flutter: painting/gradient.dart SweepGradient.operator ==

func (*SweepGradient) FromColor

func (g *SweepGradient) FromColor(c ui.Color) Gradient

FromColor returns a gradient with all its colors replaced by color.

Flutter: painting/gradient.dart SweepGradient.fromColor

func (*SweepGradient) GetColors

func (g *SweepGradient) GetColors() []ui.Color

GetColors returns the colors.

Flutter: painting/gradient.dart Gradient.colors

func (*SweepGradient) GetStops

func (g *SweepGradient) GetStops() []float64

GetStops returns the stops.

Flutter: painting/gradient.dart Gradient.stops

func (*SweepGradient) GetTransform

func (g *SweepGradient) GetTransform() GradientTransform

GetTransform returns the transform.

Flutter: painting/gradient.dart Gradient.transform

func (*SweepGradient) LerpFrom

func (g *SweepGradient) LerpFrom(a Gradient, t float64) Gradient

LerpFrom interpolates from a SweepGradient or nil.

Flutter: painting/gradient.dart SweepGradient.lerpFrom

func (*SweepGradient) LerpTo

func (g *SweepGradient) LerpTo(b Gradient, t float64) Gradient

LerpTo interpolates to a SweepGradient or nil.

Flutter: painting/gradient.dart SweepGradient.lerpTo

func (*SweepGradient) Scale

func (g *SweepGradient) Scale(factor float64) Gradient

Scale returns a gradient with its colors scaled by the factor.

Flutter: painting/gradient.dart SweepGradient.scale

func (*SweepGradient) String

func (g *SweepGradient) String() string

String describes the gradient.

Flutter: painting/gradient.dart SweepGradient.toString

func (*SweepGradient) WithOpacity

func (g *SweepGradient) WithOpacity(o float64) Gradient

WithOpacity returns a gradient with the opacity applied to its colors.

Flutter: painting/gradient.dart SweepGradient.withOpacity

type SweepGradientOpts

type SweepGradientOpts struct {
	// Center defaults to AlignmentCenter.
	Center AlignmentGeometry
	// StartAngle defaults to 0.
	StartAngle float64
	// EndAngle defaults to 2 pi.
	EndAngle foundation.Opt[float64]
	// Stops say where each color is obtained; nil spaces them evenly.
	Stops []float64
	// TileMode defaults to ui.TileModeClamp.
	TileMode ui.TileMode
	// Transform is the transform of the gradient.
	Transform GradientTransform
}

SweepGradientOpts are the optional parameters of NewSweepGradient.

Flutter: painting/gradient.dart SweepGradient.new

type TargetImageSize

type TargetImageSize struct {
	// Width is the target width in pixels.
	Width foundation.Opt[int]
	// Height is the target height in pixels.
	Height foundation.Opt[int]
}

TargetImageSize is the size an image should be decoded at. A None side keeps the aspect ratio, or the intrinsic size if the other is None too.

Flutter: dart:ui TargetImageSize

type TargetImageSizeCallback

type TargetImageSizeCallback func(intrinsicWidth, intrinsicHeight int) TargetImageSize

TargetImageSizeCallback picks the size to decode an image at, from its intrinsic size.

Flutter: dart:ui TargetImageSizeCallback

type TextAlignVertical

type TextAlignVertical struct {
	// Y is the vertical alignment, between -1.0 and 1.0.
	Y float64
}

TextAlignVertical is the vertical alignment of text within an input box: the y of the alignment from -1.0 (top) to 1.0 (bottom).

Flutter: painting/alignment.dart TextAlignVertical

func NewTextAlignVertical

func NewTextAlignVertical(y float64) TextAlignVertical

NewTextAlignVertical creates the alignment. In debug builds a y outside of -1.0 to 1.0 panics with the tag TextAlignVerticalOutOfRange.

Flutter: painting/alignment.dart TextAlignVertical.new

func (TextAlignVertical) String

func (a TextAlignVertical) String() string

String describes the alignment, such as "TextAlignVertical(y: 0.0)".

Flutter: painting/alignment.dart TextAlignVertical.toString

type TextOverflow

type TextOverflow int

TextOverflow is how overflowing text should be handled. The zero value is TextOverflowUnspecified: Dart's null.

Flutter: painting/text_painter.dart TextOverflow

const (
	// TextOverflowUnspecified is the zero value: null, the widget's default.
	TextOverflowUnspecified TextOverflow = iota
	// TextOverflowClip clips the overflowing text to fix its container.
	//
	// Flutter: painting/text_painter.dart TextOverflow.clip
	TextOverflowClip
	// TextOverflowFade fades the overflowing text to transparent.
	//
	// Flutter: painting/text_painter.dart TextOverflow.fade
	TextOverflowFade
	// TextOverflowEllipsis uses an ellipsis to indicate that the text has
	// overflowed.
	//
	// Flutter: painting/text_painter.dart TextOverflow.ellipsis
	TextOverflowEllipsis
	// TextOverflowVisible renders overflowing text outside of its container.
	//
	// Flutter: painting/text_painter.dart TextOverflow.visible
	TextOverflowVisible
)

The values of TextOverflow follow Flutter's declaration order.

func (TextOverflow) Name

func (o TextOverflow) Name() string

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

Flutter: painting/text_painter.dart TextOverflow.name

func (TextOverflow) String

func (o TextOverflow) String() string

String returns the name Dart prints, such as "TextOverflow.clip".

type TextPainter

type TextPainter struct {

	// DebugPaintTextLayoutBoxes makes Paint draw a box around each character, for
	// debugging.
	//
	// Flutter: painting/text_painter.dart TextPainter.debugPaintTextLayoutBoxes
	DebugPaintTextLayoutBoxes bool
	// contains filtered or unexported fields
}

TextPainter is an object that paints a TextSpan into a Canvas.

Flutter: painting/text_painter.dart TextPainter

func NewTextPainter

func NewTextPainter(opts ...TextPainterOpts) *TextPainter

NewTextPainter creates a text painter. In debug builds a MaxLines that is not greater than zero, and a text that isn't valid, panic with the tags TextPainterMaxLinesInvalid and TextPainterEllipsisEmpty (never for ""), or the ones of the span.

Flutter: painting/text_painter.dart TextPainter.new

func (*TextPainter) ComputeDistanceToActualBaseline

func (p *TextPainter) ComputeDistanceToActualBaseline(baseline ui.TextBaseline) float64

ComputeDistanceToActualBaseline returns the distance from the top to the baseline of the first line.

Flutter: painting/text_painter.dart TextPainter.computeDistanceToActualBaseline

func (*TextPainter) ComputeLineMetrics

func (p *TextPainter) ComputeLineMetrics() []ui.LineMetrics

ComputeLineMetrics returns the metrics of the lines, shifted by the paint offset.

Flutter: painting/text_painter.dart TextPainter.computeLineMetrics

func (*TextPainter) DebugDisposed

func (p *TextPainter) DebugDisposed() bool

DebugDisposed reports whether Dispose was called. It is only meaningful in debug builds, where it is always right; release builds return false.

Flutter: painting/text_painter.dart TextPainter.debugDisposed

func (*TextPainter) DidExceedMaxLines

func (p *TextPainter) DidExceedMaxLines() bool

DidExceedMaxLines is whether the text didn't fit in MaxLines.

Flutter: painting/text_painter.dart TextPainter.didExceedMaxLines

func (*TextPainter) Dispose

func (p *TextPainter) Dispose()

Dispose releases the resources of the painter. The painter can't be used afterwards. In debug builds disposing twice panics with the tag TextPainterDisposed.

Flutter: painting/text_painter.dart TextPainter.dispose

func (*TextPainter) Ellipsis

func (p *TextPainter) Ellipsis() string

Ellipsis is the string that replaces the text that doesn't fit; "" is null.

Flutter: painting/text_painter.dart TextPainter.ellipsis

func (*TextPainter) GetBoxesForSelection

func (p *TextPainter) GetBoxesForSelection(selection ui.TextRange, opts ...ui.BoxesForRangeOpts) []ui.TextBox

GetBoxesForSelection returns the boxes that cover the range of the text (UTF-8 byte offsets), shifted by the paint offset. Deviation: Flutter takes a TextSelection; here the range is a ui.TextRange, which is what the selection's start and end are.

Flutter: painting/text_painter.dart TextPainter.getBoxesForSelection

func (*TextPainter) GetClosestGlyphForOffset

func (p *TextPainter) GetClosestGlyphForOffset(offset ui.Offset) (ui.GlyphInfo, bool)

GetClosestGlyphForOffset returns the glyph closest to the offset, or false.

Flutter: painting/text_painter.dart TextPainter.getClosestGlyphForOffset

func (*TextPainter) GetFullHeightForCaret

func (p *TextPainter) GetFullHeightForCaret(position ui.TextPosition, caretPrototype ui.Rect) float64

GetFullHeightForCaret returns the full height of the caret at the position.

Flutter: painting/text_painter.dart TextPainter.getFullHeightForCaret

func (*TextPainter) GetLineBoundary

func (p *TextPainter) GetLineBoundary(position ui.TextPosition) ui.TextRange

GetLineBoundary returns the text range of the line at the position.

Flutter: painting/text_painter.dart TextPainter.getLineBoundary

func (*TextPainter) GetOffsetAfter

func (p *TextPainter) GetOffsetAfter(offset int) (int, bool)

GetOffsetAfter returns the offset after the character at the offset, or false at the end of the text. Offsets are UTF-8 byte offsets (SPEC §12.10), so the step is the length of the encoded character.

Flutter: painting/text_painter.dart TextPainter.getOffsetAfter

func (*TextPainter) GetOffsetBefore

func (p *TextPainter) GetOffsetBefore(offset int) (int, bool)

GetOffsetBefore returns the offset before the character that ends at the offset, or false at the start of the text.

Flutter: painting/text_painter.dart TextPainter.getOffsetBefore

func (*TextPainter) GetOffsetForCaret

func (p *TextPainter) GetOffsetForCaret(position ui.TextPosition, caretPrototype ui.Rect) ui.Offset

GetOffsetForCaret returns the offset at which to paint the caret, relative to the top left of the painted text.

Flutter: painting/text_painter.dart TextPainter.getOffsetForCaret

func (*TextPainter) GetPositionForOffset

func (p *TextPainter) GetPositionForOffset(offset ui.Offset) ui.TextPosition

GetPositionForOffset returns the text position closest to the offset in the painted text.

Flutter: painting/text_painter.dart TextPainter.getPositionForOffset

func (*TextPainter) GetWordBoundary

func (p *TextPainter) GetWordBoundary(position ui.TextPosition) ui.TextRange

GetWordBoundary returns the text range of the word at the position.

Flutter: painting/text_painter.dart TextPainter.getWordBoundary

func (*TextPainter) Height

func (p *TextPainter) Height() float64

Height is the vertical space required to paint the text.

Flutter: painting/text_painter.dart TextPainter.height

func (*TextPainter) InlinePlaceholderBoxes

func (p *TextPainter) InlinePlaceholderBoxes() []ui.TextBox

InlinePlaceholderBoxes returns the boxes of the placeholders, shifted by the paint offset; nil before layout.

Flutter: painting/text_painter.dart TextPainter.inlinePlaceholderBoxes

func (*TextPainter) Layout

func (p *TextPainter) Layout(minWidth, maxWidth float64)

Layout computes the visual position of the glyphs for painting the text. In both cases the constraints are of the width. Without a text or a text direction it panics with the tags TextPainterTextNotSet and TextPainterDirectionNotSet.

Flutter: painting/text_painter.dart TextPainter.layout

func (*TextPainter) Locale

func (p *TextPainter) Locale() foundation.Opt[ui.Locale]

Locale is the locale used to select region-specific glyphs.

Flutter: painting/text_painter.dart TextPainter.locale

func (*TextPainter) MarkNeedsLayout

func (p *TextPainter) MarkNeedsLayout()

MarkNeedsLayout flags the previous layout result as invalid.

Flutter: painting/text_painter.dart TextPainter.markNeedsLayout

func (*TextPainter) MaxIntrinsicWidth

func (p *TextPainter) MaxIntrinsicWidth() float64

MaxIntrinsicWidth is the width at which increasing the width doesn't change the height.

Flutter: painting/text_painter.dart TextPainter.maxIntrinsicWidth

func (*TextPainter) MaxLines

func (p *TextPainter) MaxLines() foundation.Opt[int]

MaxLines is the maximum number of lines.

Flutter: painting/text_painter.dart TextPainter.maxLines

func (*TextPainter) MinIntrinsicWidth

func (p *TextPainter) MinIntrinsicWidth() float64

MinIntrinsicWidth is the width at which decreasing the width doesn't decrease the height.

Flutter: painting/text_painter.dart TextPainter.minIntrinsicWidth

func (*TextPainter) Paint

func (p *TextPainter) Paint(canvas *ui.Canvas, offset ui.Offset)

Paint draws the text in the canvas at the offset. Without a layout it panics with the tag TextPainterPaintBeforeLayout.

Flutter: painting/text_painter.dart TextPainter.paint

func (*TextPainter) PlainText

func (p *TextPainter) PlainText() string

PlainText is the text of the span, without the semantics labels.

Flutter: painting/text_painter.dart TextPainter.plainText

func (*TextPainter) PreferredLineHeight

func (p *TextPainter) PreferredLineHeight() float64

PreferredLineHeight is the height of a line of the text's style, not counting the text itself.

Flutter: painting/text_painter.dart TextPainter.preferredLineHeight

func (*TextPainter) SetEllipsis

func (p *TextPainter) SetEllipsis(value string)

SetEllipsis sets the ellipsis, invalidating the layout when it changes.

Flutter: painting/text_painter.dart TextPainter.ellipsis

func (*TextPainter) SetLocale

func (p *TextPainter) SetLocale(value foundation.Opt[ui.Locale])

SetLocale sets the locale, invalidating the layout when it changes.

Flutter: painting/text_painter.dart TextPainter.locale

func (*TextPainter) SetMaxLines

func (p *TextPainter) SetMaxLines(value foundation.Opt[int])

SetMaxLines sets the maximum number of lines, invalidating the layout when it changes. In debug builds a value that is not greater than zero panics with the tag TextPainterMaxLinesInvalid.

Flutter: painting/text_painter.dart TextPainter.maxLines

func (*TextPainter) SetPlaceholderDimensions

func (p *TextPainter) SetPlaceholderDimensions(value []PlaceholderDimensions)

SetPlaceholderDimensions sets the sizes of the placeholders, in the order they appear in the text. Empty or equal values are ignored. In debug builds a count that doesn't match the placeholders panics with the tag TextPainterPlaceholderCountMismatch.

Flutter: painting/text_painter.dart TextPainter.setPlaceholderDimensions

func (*TextPainter) SetStrutStyle

func (p *TextPainter) SetStrutStyle(value *StrutStyle)

SetStrutStyle sets the strut, invalidating the layout when it changes.

Flutter: painting/text_painter.dart TextPainter.strutStyle

func (*TextPainter) SetTabSize

func (p *TextPainter) SetTabSize(value float64)

SetTabSize sets the distance between tab stops, invalidating the layout when it changes.

Flutter: no counterpart

func (*TextPainter) SetText

func (p *TextPainter) SetText(value InlineSpan)

SetText sets the text, marking the layout as invalid if the text changed in a way that needs a layout, or flagging the paragraph for rebuilding if only the painting changed.

Flutter: painting/text_painter.dart TextPainter.text

func (*TextPainter) SetTextAlign

func (p *TextPainter) SetTextAlign(value ui.TextAlign)

SetTextAlign sets the alignment, invalidating the layout when it changes.

Flutter: painting/text_painter.dart TextPainter.textAlign

func (*TextPainter) SetTextDirection

func (p *TextPainter) SetTextDirection(value ui.TextDirection)

SetTextDirection sets the directionality, invalidating the layout when it changes.

Flutter: painting/text_painter.dart TextPainter.textDirection

func (*TextPainter) SetTextHeightBehavior

func (p *TextPainter) SetTextHeightBehavior(value *ui.TextHeightBehavior)

SetTextHeightBehavior sets the behavior, invalidating the layout when it changes.

Flutter: painting/text_painter.dart TextPainter.textHeightBehavior

func (*TextPainter) SetTextScaler

func (p *TextPainter) SetTextScaler(value TextScaler)

SetTextScaler sets the policy, invalidating the layout when it changes.

Flutter: painting/text_painter.dart TextPainter.textScaler

func (*TextPainter) SetTextWidthBasis

func (p *TextPainter) SetTextWidthBasis(value TextWidthBasis)

SetTextWidthBasis sets the basis. The layout is not invalidated, but Layout must be called again before the width is read.

Flutter: painting/text_painter.dart TextPainter.textWidthBasis

func (*TextPainter) Size

func (p *TextPainter) Size() ui.Size

Size is the width and height required to paint the text.

Flutter: painting/text_painter.dart TextPainter.size

func (*TextPainter) StrutStyle

func (p *TextPainter) StrutStyle() *StrutStyle

StrutStyle is the strut of the paragraph.

Flutter: painting/text_painter.dart TextPainter.strutStyle

func (*TextPainter) TabSize

func (p *TextPainter) TabSize() float64

TabSize is the distance between tab stops, as a count of the advance of a space; 0 means tabs have no stops.

Flutter: no counterpart

func (*TextPainter) Text

func (p *TextPainter) Text() InlineSpan

Text is the (potentially styled) text to paint.

Flutter: painting/text_painter.dart TextPainter.text

func (*TextPainter) TextAlign

func (p *TextPainter) TextAlign() ui.TextAlign

TextAlign is how the text is aligned horizontally.

Flutter: painting/text_painter.dart TextPainter.textAlign

func (*TextPainter) TextDirection

func (p *TextPainter) TextDirection() ui.TextDirection

TextDirection is the default directionality of the text; unspecified is null.

Flutter: painting/text_painter.dart TextPainter.textDirection

func (*TextPainter) TextHeightBehavior

func (p *TextPainter) TextHeightBehavior() *ui.TextHeightBehavior

TextHeightBehavior says how the line height applies to the first and last lines.

Flutter: painting/text_painter.dart TextPainter.textHeightBehavior

func (*TextPainter) TextScaler

func (p *TextPainter) TextScaler() TextScaler

TextScaler is the font scaling policy.

Flutter: painting/text_painter.dart TextPainter.textScaler

func (*TextPainter) TextWidthBasis

func (p *TextPainter) TextWidthBasis() TextWidthBasis

TextWidthBasis is how the width of the text is measured.

Flutter: painting/text_painter.dart TextPainter.textWidthBasis

func (*TextPainter) Width

func (p *TextPainter) Width() float64

Width is the horizontal space required to paint the text.

Flutter: painting/text_painter.dart TextPainter.width

func (*TextPainter) WordBoundaries

func (p *TextPainter) WordBoundaries() *WordBoundary

WordBoundaries returns the boundaries of the words of the laid-out text.

Flutter: painting/text_painter.dart TextPainter.wordBoundaries

type TextPainterComputeWidthOpts

type TextPainterComputeWidthOpts struct {
	// TextEngine lays out the paragraph.
	TextEngine ui.ParagraphFactory
	// TextAlign is how the text aligns horizontally.
	TextAlign ui.TextAlign
	// TextScaler scales the font sizes.
	TextScaler TextScaler
	// MaxLines is the maximum number of lines.
	MaxLines foundation.Opt[int]
	// Ellipsis replaces the text that doesn't fit.
	Ellipsis string
	// Locale selects region-specific glyphs.
	Locale foundation.Opt[ui.Locale]
	// StrutStyle is the strut of the paragraph.
	StrutStyle *StrutStyle
	// TextWidthBasis is how the width is measured.
	TextWidthBasis TextWidthBasis
	// TextHeightBehavior says how the line height applies.
	TextHeightBehavior *ui.TextHeightBehavior
	// TabSize is the distance between tab stops in spaces; 0 gives tabs no stops.
	//
	// Flutter: no counterpart
	TabSize float64
	// MinWidth is the minimum width of the layout.
	MinWidth float64
	// MaxWidth is the maximum width of the layout; the default is infinity.
	MaxWidth foundation.Opt[float64]
}

TextPainterComputeWidthOpts are the optional parameters of TextPainterComputeWidth and TextPainterComputeMaxIntrinsicWidth.

Flutter: painting/text_painter.dart TextPainter.computeWidth

type TextPainterOpts

type TextPainterOpts struct {
	// TextEngine lays out the paragraphs. Deviation: Flutter reaches the engine
	// through a global; the framework passes the engine of the
	// PlatformDispatcher here.
	TextEngine ui.ParagraphFactory
	// Text is the text to paint.
	Text InlineSpan
	// TextAlign is how the text aligns horizontally; the default is start.
	TextAlign ui.TextAlign
	// TextDirection is the default directionality of the text; it must be set
	// before layout.
	TextDirection ui.TextDirection
	// TextScaler scales the font sizes; the default is TextScalerNoScaling.
	TextScaler TextScaler
	// MaxLines is the maximum number of lines; it must be greater than zero.
	MaxLines foundation.Opt[int]
	// Ellipsis replaces the text that doesn't fit; it must not be empty if set.
	Ellipsis string
	// Locale selects region-specific glyphs.
	Locale foundation.Opt[ui.Locale]
	// StrutStyle is the strut of the paragraph.
	StrutStyle *StrutStyle
	// TextWidthBasis is how the width is measured; the default is parent.
	TextWidthBasis TextWidthBasis
	// TextHeightBehavior says how the line height applies to the first and last
	// lines.
	TextHeightBehavior *ui.TextHeightBehavior
	// TabSize is the distance between tab stops, as a count of the advance of a
	// space in the font of the text's style; a tab advances to the next multiple,
	// measured from the start of its line. 0, the default, gives tabs no stops.
	//
	// Flutter: no counterpart
	TabSize float64
}

TextPainterOpts are the optional parameters of NewTextPainter.

Flutter: painting/text_painter.dart TextPainter.new

type TextScaler

type TextScaler interface {
	// Scale returns the font size scaled by the policy.
	Scale(fontSize float64) float64
	// TextScaleFactor is the approximate scale factor of the policy, for what
	// uses a factor instead of Scale.
	TextScaleFactor() float64
	// Clamp returns a scaler that limits the factor of this one.
	Clamp(opts ...TextScalerClampOpts) TextScaler
	String() string
}

TextScaler defines a policy for scaling font sizes by the user's text size setting. Implement Scale and TextScaleFactor, and Clamp with TextScalerClamp (the default of Flutter's abstract class).

Flutter: painting/text_scaler.dart TextScaler

var TextScalerNoScaling TextScaler = linearTextScaler{1.0}

TextScalerNoScaling is a TextScaler that doesn't scale.

Flutter: painting/text_scaler.dart TextScaler.noScaling

func NewTextScalerLinear

func NewTextScalerLinear(textScaleFactor float64) TextScaler

NewTextScalerLinear creates a scaler that scales font sizes by the factor. In debug builds a negative factor panics with the tag TextScalerInvalid.

Flutter: painting/text_scaler.dart TextScaler.linear

func TextScalerClamp

func TextScalerClamp(s TextScaler, opts ...TextScalerClampOpts) TextScaler

TextScalerClamp is the default Clamp of a TextScaler: this scaler, limited to the factors.

Flutter: painting/text_scaler.dart TextScaler.clamp

type TextScalerClampOpts

type TextScalerClampOpts struct {
	// MinScaleFactor defaults to 0; it must be finite and not negative.
	MinScaleFactor float64
	// MaxScaleFactor defaults to infinity; it must not be less than the minimum.
	MaxScaleFactor foundation.Opt[float64]
}

TextScalerClampOpts are the optional parameters of TextScaler.Clamp.

Flutter: painting/text_scaler.dart TextScaler.clamp

type TextSpan

type TextSpan struct {
	InlineSpanBase
	// Text is the text contained in the span.
	Text foundation.Opt[string]
	// Children are the spans that follow the text.
	Children []InlineSpan
	// Recognizer receives the pointer down events on the span.
	Recognizer gestures.GestureRecognizer
	// MouseCursor is the cursor over the span.
	MouseCursor services.MouseCursor
	// SemanticsLabel replaces the text for accessibility.
	SemanticsLabel foundation.Opt[string]
	// SemanticsIdentifier is the identifier of the semantics node.
	SemanticsIdentifier foundation.Opt[string]
	// Locale is the locale of the text, for accessibility.
	Locale foundation.Opt[ui.Locale]
	// SpellOut says that the text is spoken character by character.
	SpellOut foundation.Opt[bool]
	// contains filtered or unexported fields
}

TextSpan is an immutable span of text.

Flutter: painting/text_span.dart TextSpan

func NewTextSpan

func NewTextSpan(opts ...TextSpanOpts) *TextSpan

NewTextSpan creates a span of text. In debug builds a semantics label without a text panics with the tag TextSpanLabelWithoutText.

Flutter: painting/text_span.dart TextSpan.new

func (*TextSpan) Build

func (s *TextSpan) Build(builder *ui.ParagraphBuilder, opts ...SpanBuildOpts)

Build adds the span, with its style and its children, to the builder.

Flutter: painting/text_span.dart TextSpan.build

func (*TextSpan) CodeUnitAtVisitor

func (s *TextSpan) CodeUnitAtVisitor(index int, offset *Accumulator) (byte, bool)

CodeUnitAtVisitor returns the code unit at the index of the span's text.

Flutter: painting/text_span.dart TextSpan.codeUnitAtVisitor

func (*TextSpan) CompareTo

func (s *TextSpan) CompareTo(other InlineSpan) RenderComparison

CompareTo describes the difference between this span and another.

Flutter: painting/text_span.dart TextSpan.compareTo

func (*TextSpan) ComputeSemanticsInformation

func (s *TextSpan) ComputeSemanticsInformation(collector *[]InlineSpanSemanticsInformation)

ComputeSemanticsInformation adds the semantics information of the span and its descendants.

Flutter: painting/text_span.dart TextSpan.computeSemanticsInformation

func (*TextSpan) ComputeToPlainText

func (s *TextSpan) ComputeToPlainText(buffer *strings.Builder, includeSemanticsLabels, includePlaceholders bool)

ComputeToPlainText writes the text of the span and its descendants.

Flutter: painting/text_span.dart TextSpan.computeToPlainText

func (*TextSpan) Cursor

func (s *TextSpan) Cursor() services.MouseCursor

Cursor is the cursor over the span.

Flutter: painting/text_span.dart TextSpan.cursor

func (*TextSpan) DebugAssertIsValid

func (s *TextSpan) DebugAssertIsValid() bool

DebugAssertIsValid checks the children, in debug builds, and returns true.

Flutter: painting/text_span.dart TextSpan.debugAssertIsValid

func (*TextSpan) DebugDescribeChildren

func (s *TextSpan) DebugDescribeChildren() []foundation.DiagnosticsNode

DebugDescribeChildren describes the child spans.

Flutter: painting/text_span.dart TextSpan.debugDescribeChildren

func (*TextSpan) DebugFillProperties

func (s *TextSpan) DebugFillProperties(p *foundation.DiagnosticPropertiesBuilder)

DebugFillProperties adds the style, the text, the recognizer, the callbacks, the cursor and the semantics label.

Flutter: painting/text_span.dart TextSpan.debugFillProperties

func (*TextSpan) Equal

func (s *TextSpan) Equal(other InlineSpan) bool

Equal is Dart's == on spans.

Flutter: painting/text_span.dart TextSpan.operator ==

func (*TextSpan) GetSpanForPositionVisitor

func (s *TextSpan) GetSpanForPositionVisitor(position ui.TextPosition, offset *Accumulator) InlineSpan

GetSpanForPositionVisitor returns this span if the position is in its text.

Flutter: painting/text_span.dart TextSpan.getSpanForPositionVisitor

func (*TextSpan) HandleEvent

func (s *TextSpan) HandleEvent(event gestures.PointerEvent, entry gestures.HitTestEntry)

HandleEvent gives a pointer down event to the recognizer.

Flutter: painting/text_span.dart TextSpan.handleEvent

func (*TextSpan) OnEnter

OnEnter is the callback for a mouse pointer entering the span.

Flutter: painting/text_span.dart TextSpan.onEnter

func (*TextSpan) OnExit

OnExit is the callback for a mouse pointer leaving the span.

Flutter: painting/text_span.dart TextSpan.onExit

func (*TextSpan) String

func (s *TextSpan) String() string

String describes the span.

Flutter: painting/text_span.dart TextSpan.toString

func (*TextSpan) ToStringShort

func (s *TextSpan) ToStringShort() string

ToStringShort names the span.

Flutter: painting/text_span.dart TextSpan.toStringShort

func (*TextSpan) ValidForMouseTracker

func (s *TextSpan) ValidForMouseTracker() bool

ValidForMouseTracker is always true for a text span.

Flutter: painting/text_span.dart TextSpan.validForMouseTracker

func (*TextSpan) VisitChildren

func (s *TextSpan) VisitChildren(visitor InlineSpanVisitor) bool

VisitChildren calls the visitor on this span, if it has text, then on the descendants.

Flutter: painting/text_span.dart TextSpan.visitChildren

func (*TextSpan) VisitDirectChildren

func (s *TextSpan) VisitDirectChildren(visitor InlineSpanVisitor) bool

VisitDirectChildren calls the visitor on the direct children.

Flutter: painting/text_span.dart TextSpan.visitDirectChildren

type TextSpanOpts

type TextSpanOpts struct {
	// Text is the text contained in the span; None is null.
	Text foundation.Opt[string]
	// Children are the spans that follow the text; nil is null.
	Children []InlineSpan
	// Style is the style to apply to the text and the children.
	Style *TextStyle
	// Recognizer receives the pointer down events on the span.
	Recognizer gestures.GestureRecognizer
	// MouseCursor is the cursor over the span; the default is MouseCursorDefer,
	// and the click cursor when there is a recognizer.
	MouseCursor services.MouseCursor
	// OnEnter is called when a mouse pointer enters the span.
	OnEnter services.PointerEnterEventListener
	// OnExit is called when a mouse pointer leaves the span.
	OnExit services.PointerExitEventListener
	// SemanticsLabel replaces the text for accessibility; it needs Text.
	SemanticsLabel foundation.Opt[string]
	// SemanticsIdentifier is the identifier of the semantics node.
	SemanticsIdentifier foundation.Opt[string]
	// Locale is the locale of the text, for accessibility.
	Locale foundation.Opt[ui.Locale]
	// SpellOut says that the text is spoken character by character.
	SpellOut foundation.Opt[bool]
}

TextSpanOpts are the optional parameters of NewTextSpan.

Flutter: painting/text_span.dart TextSpan

type TextStyle

type TextStyle struct {
	// Inherit says whether null fields inherit from the enclosing style.
	Inherit bool
	// Color is the color of the text.
	Color foundation.Opt[ui.Color]
	// BackgroundColor is the color of the box behind the text.
	BackgroundColor foundation.Opt[ui.Color]
	// FontFamily is the name of the font family, with any package prefix.
	FontFamily string
	// FontSize is the size of the glyphs in logical pixels.
	FontSize foundation.Opt[float64]
	// FontWeight is the typeface thickness; 0 is null.
	FontWeight ui.FontWeight
	// FontStyle is the typeface variant; unspecified is null.
	FontStyle ui.FontStyle
	// LetterSpacing is the space added between letters.
	LetterSpacing foundation.Opt[float64]
	// WordSpacing is the space added at each space.
	WordSpacing foundation.Opt[float64]
	// TextBaseline is the baseline the text aligns on; unspecified is null.
	TextBaseline ui.TextBaseline
	// Height is the height of the line as a multiple of the font size.
	Height foundation.Opt[float64]
	// LeadingDistribution is how the extra line height is divided; unspecified
	// is null.
	LeadingDistribution ui.TextLeadingDistribution
	// Locale selects region-specific glyphs.
	Locale foundation.Opt[ui.Locale]
	// Foreground is the paint of the text, instead of Color.
	Foreground *ui.Paint
	// Background is the paint of the box behind the text.
	Background *ui.Paint
	// Decoration is the decoration to paint near the text.
	Decoration foundation.Opt[ui.TextDecoration]
	// DecorationColor is the color of the decoration.
	DecorationColor foundation.Opt[ui.Color]
	// DecorationStyle is the style of the decoration line; unspecified is null.
	DecorationStyle ui.TextDecorationStyle
	// DecorationThickness is the thickness of the decoration.
	DecorationThickness foundation.Opt[float64]
	// DebugLabel is a human-readable description of the style.
	DebugLabel string
	// Shadows are painted underneath the text; nil is null.
	Shadows []ui.Shadow
	// FontFeatures select glyph variants of the font; nil is null.
	FontFeatures []ui.FontFeature
	// FontVariations are the axis values of a variable font; nil is null.
	FontVariations []ui.FontVariation
	// Overflow is how visual overflow is handled; unspecified is null.
	Overflow TextOverflow
	// contains filtered or unexported fields
}

TextStyle is an immutable style describing how to format and paint text. Create it with NewTextStyle; its fields are for reading.

Flutter: painting/text_style.dart TextStyle

func NewTextStyle

func NewTextStyle(opts ...TextStyleOpts) *TextStyle

NewTextStyle creates a text style. In debug builds giving both a Color and a Foreground panics with the tag TextStyleColorAndForeground, and both a BackgroundColor and a Background with TextStyleBackgroundAndBackgroundColor.

Flutter: painting/text_style.dart TextStyle.new

func TextStyleLerp

func TextStyleLerp(a, b *TextStyle, t float64) *TextStyle

TextStyleLerp linearly interpolates between two text styles. Either may be nil. In debug builds interpolating styles whose Inherit differs while fields are null in both panics with the tag TextStyleLerpInheritMismatch.

Flutter: painting/text_style.dart TextStyle.lerp

func (*TextStyle) Apply

func (s *TextStyle) Apply(a TextStyleApply) *TextStyle

Apply creates a copy of this text style, replacing or modifying some fields. In debug builds a factor or a delta on a field that is null panics with the tag TextStyleApplyNullField.

Flutter: painting/text_style.dart TextStyle.apply

func (*TextStyle) CompareTo

func (s *TextStyle) CompareTo(other *TextStyle) RenderComparison

CompareTo describes the difference between two text styles: layout when one affects the layout, paint when only the painting differs, else identical.

Flutter: painting/text_style.dart TextStyle.compareTo

func (*TextStyle) CopyWith

func (s *TextStyle) CopyWith(c TextStyleCopy) *TextStyle

CopyWith creates a copy of this text style, replacing the fields the parameter sets.

Flutter: painting/text_style.dart TextStyle.copyWith

func (*TextStyle) DebugFillProperties

func (s *TextStyle) DebugFillProperties(p *foundation.DiagnosticPropertiesBuilder)

DebugFillProperties adds the properties of the style.

Flutter: painting/text_style.dart TextStyle.debugFillProperties

func (*TextStyle) DebugFillPropertiesWithPrefix

func (s *TextStyle) DebugFillPropertiesWithPrefix(p *foundation.DiagnosticPropertiesBuilder, prefix string)

DebugFillPropertiesWithPrefix is DebugFillProperties with a prefix before each property name, which TextSpan uses for the "style: " properties.

Flutter: painting/text_style.dart TextStyle.debugFillProperties

func (*TextStyle) Equal

func (s *TextStyle) Equal(other *TextStyle) bool

Equal is Dart's == on text styles.

Flutter: painting/text_style.dart TextStyle.operator ==

func (*TextStyle) FontFamilyFallback

func (s *TextStyle) FontFamilyFallback() []string

FontFamilyFallback is the ordered list of font families to fall back on, with the package prefix applied; nil is null.

Flutter: painting/text_style.dart TextStyle.fontFamilyFallback

func (*TextStyle) GetParagraphStyle

func (s *TextStyle) GetParagraphStyle(opts ...GetParagraphStyleOpts) *ui.ParagraphStyle

GetParagraphStyle returns the engine paragraph style for this style. In debug builds a MaxLines that is not greater than zero panics with the tag ParagraphMaxLinesInvalid.

Flutter: painting/text_style.dart TextStyle.getParagraphStyle

func (*TextStyle) GetTextStyle

func (s *TextStyle) GetTextStyle(opts ...GetTextStyleOpts) *ui.TextStyle

GetTextStyle returns the engine text style for this style.

Flutter: painting/text_style.dart TextStyle.getTextStyle

func (*TextStyle) Merge

func (s *TextStyle) Merge(other *TextStyle) *TextStyle

Merge returns a new text style that is a combination of this style and the given other style. A nil other, or one that doesn't inherit, is returned as it is.

Flutter: painting/text_style.dart TextStyle.merge

func (*TextStyle) Package

func (s *TextStyle) Package() string

Package is the package that holds the font, or "".

Flutter: painting/text_style.dart TextStyle._package

func (*TextStyle) String

func (s *TextStyle) String() string

String describes the style and its properties.

Flutter: painting/text_style.dart TextStyle.toString

func (*TextStyle) ToStringShort

func (s *TextStyle) ToStringShort() string

ToStringShort names the style.

Flutter: painting/text_style.dart TextStyle.toStringShort

type TextStyleApply

type TextStyleApply struct {
	// Color replaces the color, unless there is a foreground.
	Color foundation.Opt[ui.Color]
	// BackgroundColor replaces the background color, unless there is a
	// background.
	BackgroundColor foundation.Opt[ui.Color]
	// Decoration replaces the decoration.
	Decoration foundation.Opt[ui.TextDecoration]
	// DecorationColor replaces the decoration color.
	DecorationColor foundation.Opt[ui.Color]
	// DecorationStyle replaces the decoration style.
	DecorationStyle ui.TextDecorationStyle
	// DecorationThicknessFactor multiplies the decoration thickness.
	DecorationThicknessFactor foundation.Opt[float64]
	// DecorationThicknessDelta is added to the decoration thickness.
	DecorationThicknessDelta float64
	// FontFamily replaces the font family.
	FontFamily string
	// FontFamilyFallback replaces the font family fallback.
	FontFamilyFallback []string
	// FontSizeFactor multiplies the font size.
	FontSizeFactor foundation.Opt[float64]
	// FontSizeDelta is added to the font size.
	FontSizeDelta float64
	// FontWeightDelta is added to the index of the font weight (w100 is 0).
	FontWeightDelta int
	// FontStyle replaces the font style.
	FontStyle ui.FontStyle
	// LetterSpacingFactor multiplies the letter spacing.
	LetterSpacingFactor foundation.Opt[float64]
	// LetterSpacingDelta is added to the letter spacing.
	LetterSpacingDelta float64
	// WordSpacingFactor multiplies the word spacing.
	WordSpacingFactor foundation.Opt[float64]
	// WordSpacingDelta is added to the word spacing.
	WordSpacingDelta float64
	// HeightFactor multiplies the height.
	HeightFactor foundation.Opt[float64]
	// HeightDelta is added to the height.
	HeightDelta float64
	// TextBaseline replaces the baseline.
	TextBaseline ui.TextBaseline
	// LeadingDistribution replaces the leading distribution.
	LeadingDistribution ui.TextLeadingDistribution
	// Locale replaces the locale.
	Locale foundation.Opt[ui.Locale]
	// Shadows replaces the shadows.
	Shadows []ui.Shadow
	// FontFeatures replaces the font features.
	FontFeatures []ui.FontFeature
	// FontVariations replaces the font variations.
	FontVariations []ui.FontVariation
	// Package replaces the package.
	Package string
	// Overflow replaces the overflow.
	Overflow TextOverflow
}

TextStyleApply are the parameters of TextStyle.Apply. A factor defaults to 1 and a delta to 0.

Flutter: painting/text_style.dart TextStyle.apply

type TextStyleCopy

type TextStyleCopy = TextStyleOpts

TextStyleCopy are the parameters of TextStyle.CopyWith.

Flutter: painting/text_style.dart TextStyle.copyWith

type TextStyleOpts

type TextStyleOpts struct {
	// Inherit says whether null fields inherit from the enclosing style; it
	// defaults to true.
	Inherit foundation.Opt[bool]
	// Color is the color to use when painting the text; it must not be given
	// together with Foreground.
	Color foundation.Opt[ui.Color]
	// BackgroundColor is the color to use as the background of the text; it must
	// not be given together with Background.
	BackgroundColor foundation.Opt[ui.Color]
	// FontSize is the size of the glyphs in logical pixels.
	FontSize foundation.Opt[float64]
	// FontWeight is the typeface thickness.
	FontWeight ui.FontWeight
	// FontStyle is the typeface variant.
	FontStyle ui.FontStyle
	// LetterSpacing is the space added between letters, in logical pixels.
	LetterSpacing foundation.Opt[float64]
	// WordSpacing is the space added at each space, in logical pixels.
	WordSpacing foundation.Opt[float64]
	// TextBaseline is the baseline the text aligns on.
	TextBaseline ui.TextBaseline
	// Height is the height of the line as a multiple of the font size.
	Height foundation.Opt[float64]
	// LeadingDistribution is how the extra line height is divided.
	LeadingDistribution ui.TextLeadingDistribution
	// Locale selects region-specific glyphs.
	Locale foundation.Opt[ui.Locale]
	// Foreground is the paint of the text, instead of Color.
	Foreground *ui.Paint
	// Background is the paint of the box behind the text, instead of
	// BackgroundColor.
	Background *ui.Paint
	// Shadows are painted underneath the text; nil is null.
	Shadows []ui.Shadow
	// FontFeatures select glyph variants of the font; nil is null.
	FontFeatures []ui.FontFeature
	// FontVariations are the axis values of a variable font; nil is null.
	FontVariations []ui.FontVariation
	// Decoration is the decoration to paint near the text.
	Decoration foundation.Opt[ui.TextDecoration]
	// DecorationColor is the color of the decoration.
	DecorationColor foundation.Opt[ui.Color]
	// DecorationStyle is the style of the decoration line.
	DecorationStyle ui.TextDecorationStyle
	// DecorationThickness is the thickness of the decoration as a multiple of the
	// font's default.
	DecorationThickness foundation.Opt[float64]
	// DebugLabel is a human-readable description of the style.
	DebugLabel string
	// FontFamily is the name of the font family.
	FontFamily string
	// FontFamilyFallback is the ordered list of families to fall back on; nil is
	// null.
	FontFamilyFallback []string
	// Package is the package that holds the font; the family names are prefixed
	// with "packages/<package>/".
	Package string
	// Overflow is how visual overflow is handled.
	Overflow TextOverflow
}

TextStyleOpts are the optional parameters of NewTextStyle (and of TextStyle.CopyWith, where an unset value keeps the style's).

Flutter: painting/text_style.dart TextStyle

type TextWidthBasis

type TextWidthBasis int

TextWidthBasis is the way to measure the width of the rendered text. The zero value is TextWidthBasisUnspecified: parent.

Flutter: painting/text_painter.dart TextWidthBasis

const (
	// TextWidthBasisUnspecified is the zero value: parent.
	TextWidthBasisUnspecified TextWidthBasis = iota
	// TextWidthBasisParent makes the width take all the space the parent gives.
	//
	// Flutter: painting/text_painter.dart TextWidthBasis.parent
	TextWidthBasisParent
	// TextWidthBasisLongestLine makes the width the width of the longest line.
	//
	// Flutter: painting/text_painter.dart TextWidthBasis.longestLine
	TextWidthBasisLongestLine
)

The values of TextWidthBasis follow Flutter's declaration order.

func (TextWidthBasis) Name

func (b TextWidthBasis) Name() string

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

func (TextWidthBasis) String

func (b TextWidthBasis) String() string

String returns the name Dart prints, such as "TextWidthBasis.parent".

type ToPlainTextOpts

type ToPlainTextOpts struct {
	// ExcludeSemanticsLabels leaves out the semantics labels and uses the text.
	ExcludeSemanticsLabels bool
	// ExcludePlaceholders leaves out the placeholder characters.
	ExcludePlaceholders bool
}

ToPlainTextOpts are the optional parameters of InlineSpan.ToPlainText. Both are true unless the Exclude field says otherwise.

Flutter: painting/inline_span.dart InlineSpan.toPlainText

type VerticalDirection

type VerticalDirection int

VerticalDirection is a direction in which boxes flow vertically.

Flutter: painting/basic_types.dart VerticalDirection

const (
	// VerticalDirectionUnspecified is the zero value: the widget's default
	// (down).
	//
	// Flutter: no counterpart
	VerticalDirectionUnspecified VerticalDirection = iota
	// VerticalDirectionUp is from bottom to top.
	//
	// Flutter: painting/basic_types.dart VerticalDirection.up
	VerticalDirectionUp
	// VerticalDirectionDown is from top to bottom.
	//
	// Flutter: painting/basic_types.dart VerticalDirection.down
	VerticalDirectionDown
)

The values of VerticalDirection follow Flutter's declaration order.

func (VerticalDirection) Name

func (d VerticalDirection) Name() string

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

Flutter: painting/basic_types.dart VerticalDirection.name

func (VerticalDirection) String

func (d VerticalDirection) String() string

String returns the name Dart prints, such as "VerticalDirection.up".

Flutter: painting/basic_types.dart VerticalDirection.toString

type WordBoundary

type WordBoundary struct {
	services.TextBoundaryDefaults

	// MoveByWordBoundary is the boundary that skips the spaces and punctuation
	// between words, as the text editing shortcuts do.
	//
	// Flutter: painting/text_painter.dart WordBoundary.moveByWordBoundary
	MoveByWordBoundary services.TextBoundary
	// contains filtered or unexported fields
}

WordBoundary is a TextBoundary that finds the boundaries of the words in the text of a laid-out TextPainter.

Flutter: painting/text_painter.dart WordBoundary

func (*WordBoundary) GetTextBoundaryAt

func (w *WordBoundary) GetTextBoundaryAt(position int) ui.TextRange

GetTextBoundaryAt is the range of the word at the position.

Flutter: painting/text_painter.dart WordBoundary.getTextBoundaryAt

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL