UiPaint class
A wrapper around Flutter's ui.Paint to simplify paint configuration for
map rendering.
This class provides convenient constructors for creating stroke and fill paints, and methods for setting properties like color, stroke width, and shaders. It also handles the disposal of associated resources, such as bitmap shaders.
Constructors
- UiPaint.fill({int? color})
- Creates a new paint object for filling paths.
- UiPaint.from(UiPaint other)
-
Creates a new paint object as a copy of another
UiPaint. -
UiPaint.stroke({int? color, double? strokeWidth, MapCap? cap, MapJoin? join, List<
double> ? strokeDasharray}) - Creates a new paint object for stroking paths.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void - Disposes the bitmap shader associated with this paint, if any.
-
expose(
) → Paint -
Exposes the underlying
ui.Paintobject for direct use. -
getAntiAlias(
) → bool - Returns true if anti-aliasing is enabled for this paint.
-
getBitmapShader(
) → SymbolImage? - Returns the bitmap shader for this paint, if any.
-
getColor(
) → Color -
Returns the color of this paint as a
ui.Color. -
getColorAsNumber(
) → int - Returns the color of this paint as a 32-bit integer.
-
getStrokeDasharray(
) → List< double> ? - Returns the stroke dash array for this paint, if any.
-
getStrokeWidth(
) → double - Returns the stroke width of this paint.
-
isFillPaint(
) → bool - Returns true if this paint is a fill paint.
-
isTransparent(
) → bool - Returns true if the color of this paint is transparent.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setAntiAlias(
bool value) → void - Sets whether to apply anti-aliasing when drawing with this paint.
-
setBitmapShader(
SymbolImage symbolImage) → void - Sets the shader for this paint to a bitmap pattern.
-
setColor(
Color color) → void -
Sets the color of this paint from a
ui.Color. -
setColorFromNumber(
int color) → void - Sets the color of this paint from a 32-bit integer.
-
setStrokeCap(
MapCap cap) → void - Sets the stroke cap style for this paint.
-
setStrokeDasharray(
List< double> ? strokeDasharray) → void - Sets the stroke dash array for this paint.
-
setStrokeJoin(
MapJoin join) → void - Sets the stroke join style for this paint.
-
setStrokeWidth(
double strokeWidth) → void - Sets the stroke width for this paint.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited