VectorGraphicsCodec class
The VectorGraphicsCodec provides support for both encoding and decoding the vector_graphics binary format.
Constructors
- VectorGraphicsCodec()
-
Create a new VectorGraphicsCodec.
const
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
-
decode(
ByteData data, VectorGraphicsCodecListener? listener, {DecodeResponse? response}) → DecodeResponse - Decode the vector_graphics binary.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
writeClipPath(
VectorGraphicsBuffer buffer, int path) → void -
writeDrawImage(
VectorGraphicsBuffer buffer, int imageId, double x, double y, double width, double height, Float64List? transform) → void -
writeDrawPath(
VectorGraphicsBuffer buffer, int pathId, int paintId, int? patternId) → void - Encode a draw path command in the current buffer.
-
writeDrawText(
VectorGraphicsBuffer buffer, int textId, int? fillId, int? strokeId, int? patternId) → void -
writeDrawVertices(
VectorGraphicsBuffer buffer, Float32List vertices, Uint16List? indices, int? paintId) → void - Encode a draw vertices command in the current buffer.
-
writeFill(
VectorGraphicsBuffer buffer, int color, int blendMode, [int? shaderId]) → int - Encode a paint object used for a fill in the current buffer, returning the identifier assigned to it.
-
writeImage(
VectorGraphicsBuffer buffer, int format, Uint8List data) → int -
Write an image to the
buffer
, returning the identifier assigned to it. -
writeLinearGradient(
VectorGraphicsBuffer buffer, {required double fromX, required double fromY, required double toX, required double toY, required Int32List colors, required Float32List? offsets, required int tileMode}) → int - Write a linear gradient into the current buffer.
-
writeMask(
VectorGraphicsBuffer buffer) → void -
writePath(
VectorGraphicsBuffer buffer, Uint8List controlTypes, Float32List controlPoints, int fillType, {bool half = false}) → int -
Write a new path to the
buffer
, returing the identifier assigned to it. -
writePattern(
VectorGraphicsBuffer buffer, double x, double y, double width, double height, Float64List transform) → int -
writeRadialGradient(
VectorGraphicsBuffer buffer, {required double centerX, required double centerY, required double radius, required double? focalX, required double? focalY, required Int32List colors, required Float32List? offsets, required Float64List? transform, required int tileMode}) → int - Write a radial gradient into the current buffer.
-
writeRestoreLayer(
VectorGraphicsBuffer buffer) → void - Pops the current save stack, if there is anything to pop. Otherwise, does nothing.
-
writeSaveLayer(
VectorGraphicsBuffer buffer, int paint) → void -
Saves a copy of the current transform and clip on the save stack, and then
creates a new group which subsequent calls will become a part of. When the
save stack is later popped, the group will be flattened into a layer and
have the given
paint
'sPaint.blendMode
applied. -
writeSize(
VectorGraphicsBuffer buffer, double width, double height) → void - Encode the dimensions of the vector graphic.
-
writeStroke(
VectorGraphicsBuffer buffer, int color, int strokeCap, int strokeJoin, int blendMode, double strokeMiterLimit, double strokeWidth, [int? shaderId]) → int - Encode a paint object in the current buffer, returning the identifier assigned to it.
-
writeTextConfig(
{required VectorGraphicsBuffer buffer, required String text, required String? fontFamily, required double xAnchorMultiplier, required int fontWeight, required double fontSize, required int decoration, required int decorationStyle, required int decorationColor}) → int -
Write the
text
contents given starting atx
,y
. -
writeTextPosition(
VectorGraphicsBuffer buffer, double? x, double? y, double? dx, double? dy, bool reset, Float64List? transform) → void -
writeUpdateTextPosition(
VectorGraphicsBuffer buffer, int textPositionId) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited