UDocShape class
One drawn shape. Geometry is normalised (see UDocShapeSpace) so it survives zoom, window resizes and EPUB re-flow.
- Annotations
Constructors
-
UDocShape({required String id, required UDocShapeKind kind, required List<
Offset> points, required Color strokeColor, required DateTime createdAt, required DateTime updatedAt, int pageIndex = -1, int blockIndex = -1, Color? fillColor, double strokeWidth = 0.004, double opacity = 1, bool dashed = false, String text = "", double fontSize = 0.028, bool bold = false, int? startMs, int? endMs}) -
const
-
UDocShape.create({required UDocShapeKind kind, required List<
Offset> points, required Color strokeColor, int pageIndex = -1, int blockIndex = -1, Color? fillColor, double strokeWidth = 0.004, double opacity = 1, bool dashed = false, String text = "", double fontSize = 0.028, bool bold = false, int? startMs, int? endMs}) -
factory
-
UDocShape.fromJson(Map<
String, Object?> json) -
factory
Properties
- blockIndex → int
-
final
- bold → bool
-
final
- bounds → Rect
-
no setter
- createdAt → DateTime
-
final
- dashed → bool
-
final
- endMs → int?
-
final
- fillColor → Color?
-
final
- fontSize → double
-
Font size as a fraction of the surface width.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasText → bool
-
no setter
- id → String
-
final
- isFreehand → bool
-
no setter
- kind → UDocShapeKind
-
final
- opacity → double
-
final
- pageIndex → int
-
final
-
points
→ List<
Offset> -
Freehand points, or two corners / end points for everything else.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startMs → int?
-
Visible time range on video surfaces (null = always).
final
- strokeColor → Color
-
final
- strokeWidth → double
-
Stroke width as a fraction of the surface width.
final
- text → String
-
final
- updatedAt → DateTime
-
final
Methods
-
copyWith(
{List< Offset> ? points, Color? strokeColor, Color? fillColor, bool clearFill = false, double? strokeWidth, double? opacity, bool? dashed, String? text, double? fontSize, bool? bold, int? startMs, int? endMs, UDocShapeKind? kind}) → UDocShape -
fitted(
Rect target) → UDocShape -
Scales the shape so its bounds become
target. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
placed(
{int? pageIndex, int? blockIndex, int? startMs, int? endMs, bool clearTime = false, bool copy = false}) → UDocShape -
Stamps where the shape lives;
copygives it a fresh id. -
toJson(
) → Map< String, Object?> -
toString(
) → String -
A string representation of this object.
inherited
-
translated(
Offset delta) → UDocShape -
visibleAt(
Duration position) → bool
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited