The Flutter painting library.

To use, import package:flutter/painting.dart.

This library includes a variety of classes that wrap the Flutter engine's painting API for more specialized purposes, such as painting scaled images, interpolating between shadows, painting borders around boxes, etc.

In particular:

Typedefs

VoidCallback() → void

Signature of callbacks that have no arguments and return no data.

Functions

applyImageFit(ImageFit fit, Size inputSize, Size outputSize) FittedSizes

Apply an ImageFit value.

hashList(Iterable<Object> args) int

Combine the hashCodes of an arbitrary number of values from an Iterable into one value. This function will return the same value if given "null" as if given an empty list.

hashValues(Object arg01, Object arg02, [ Object arg03 = _hashEnd, Object arg04 = _hashEnd, Object arg05 = _hashEnd, Object arg06 = _hashEnd, Object arg07 = _hashEnd, Object arg08 = _hashEnd, Object arg09 = _hashEnd, Object arg10 = _hashEnd, Object arg11 = _hashEnd, Object arg12 = _hashEnd, Object arg13 = _hashEnd, Object arg14 = _hashEnd, Object arg15 = _hashEnd, Object arg16 = _hashEnd, Object arg17 = _hashEnd, Object arg18 = _hashEnd, Object arg19 = _hashEnd, Object arg20 = _hashEnd ]) int

Combine up to twenty values' hashCodes into one value.

paintImage({Canvas canvas, Rect rect, Image image, ColorFilter colorFilter, ImageFit fit, ImageRepeat repeat: ImageRepeat.noRepeat, Rect centerSlice, FractionalOffset alignment }) → void

Paints an image into the given rectangle in the canvas.

Enums

Axis

The two cardinal directions in two dimensions.

BlurStyle

Styles to use for blurs in MaskFilter objects.

BorderStyle

The style of line to draw for a BorderSide in a Border.

BoxShape

The shape to use when rendering a BoxDecoration.

FilterQuality

Quality levels for image filters.

FlutterLogoStyle

Possible ways to draw Flutter's logo.

FontStyle

Whether to slant the glyphs in the font

ImageFit

How an image should be inscribed into a box.

ImageRepeat

How to paint any portions of a box not covered by an image.

PaintingStyle

Strategies for painting shapes and paths on a canvas.

StrokeCap

Styles to use for line endings.

TextAffinity

Whether a TextPosition is visually upstream or downstream of its offset.

TextAlign

Whether to align text horizontally

TextBaseline

A horizontal line used for aligning text

TextDecorationStyle

The style in which to draw a text decoration

TextDirection

A direction in which text flows.

TileMode

Defines what happens at the edge of the gradient.

TransferMode

Algorithms to use when painting on the canvas.

VertexMode

Defines how a list of points is interpreted when drawing a set of triangles.

Classes

BackgroundImage

A background image for a box.

Border

A border of a box, comprised of four sides.

BorderRadius

An immutable set of radii for each corner of a rectangle.

BorderSide

A side of a border of a box.

BoxDecoration

An immutable description of how to paint a box.

BoxPainter

A stateful class that can paint a particular Decoration.

BoxShadow

A shadow cast by a box.

Canvas

An interface for recording graphical operations.

Color

An immutable 32 bit color value in ARGB

ColorFilter

A description of a color filter to apply when drawing a shape or compositing a layer with a particular Paint. A color filter is a function that takes two colors, and outputs one color. When applied during compositing, it is independently applied to each pixel of the layer being drawn before the entire layer is merged with the destination.

Decoration

A description of a box decoration (a decoration applied to a Rect).

EdgeInsets

An immutable set of offsets in each of the four cardinal directions.

FittedSizes

The pair of sizes returned by applyImageFit.

FlutterLogoDecoration

An immutable description of how to paint Flutter's logo.

FontWeight

The thickness of the glyphs used to draw the text

FractionalOffset

An offset that's expressed as a fraction of a Size.

Gradient

A 2D gradient.

HSVColor

A color represented using alpha, hue, saturation, and value.

ImageConfiguration

Configuration information passed to the ImageProvider.resolve method to select a specific image.

ImageShader

A shader (as used by Paint.shader) that tiles an image.

LinearGradient

A 2D linear gradient.

MaskFilter

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

MatrixUtils

Utility functions for working with matrices.

Offset

An immutable 2D floating-point offset.

Paint

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

Path

A complex, one-dimensional subset of a plane.

Point

An immutable 2D floating-point x,y coordinate pair.

RadialGradient

A 2D radial gradient.

Radius

A radius for either circular or elliptical shapes.

Rect

An immutable 2D, axis-aligned, floating-point rectangle whose coordinates are relative to an origin point.

RRect

A rounded rectangle with the custom radii for all four corners.

RSTransform

A transform consisting of a translation, a rotation, and a uniform scale.

Shader

Base class for objects such as Gradient and ImageShader which correspond to shaders as used by Paint.shader.

Size

Holds a 2D floating-point size.

TextDecoration

A linear decoration to draw near the text

TextPainter

An object that paints a TextSpan tree into a Canvas.

TextPosition

A visual position in a string of text.

TextRange

A range of characters in a string of text.

TextSelection

A range of text that represents a selection.

TextSpan

An immutable span of text.

TextStyle

An immutable style in which paint text.