LinearGradient class

A core linear gradient. Can be added as a child to a Shape's Fill or Stroke to paint that Fill or Stroke with a gradient. This is the foundation for the RadialGradient which is very similar but also has a radius value.

Inheritance
Implementers

Constructors

LinearGradient()

Properties

artboard Artboard?
The artboard this component belongs to.
no setterinherited
canBeOrphaned bool
Override to true if you want some object inheriting from Component to not have a parent. Most objects will validate that they have a parent during the onAdded callback otherwise they are considered invalid and are culled from core.
no setterinherited
children → ContainerChildren
finalinherited
context RuntimeArtboard
covariantgetter/setter pairinherited
coreType int
no setterinherited
coreTypes Set<int>
no setterinherited
dependencies Set<Component>
no setterinherited
dependents Set<Component>
no setterinherited
dirt int
getter/setter pairinherited
end Vec2D
no setter
endOffset Offset
no setter
endX double
Change the _endX field value. endXChanged will be invoked only if the field's value has changed.
getter/setter pairinherited
endY double
Change the _endY field value. endYChanged will be invoked only if the field's value has changed.
getter/setter pairinherited
gradientStops List<GradientStop>
Stored list of core gradient stops are in the hierarchy as children of this container.
final
graphOrder int
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
hasValidated bool
no setterinherited
id int
getter/setter pairinherited
isCollapsed bool
Whether this Component's update processes at all.
no setterinherited
name String
Non-unique identifier, used to give friendly names to elements in the hierarchy. Runtimes provide an API for finding components by this name.
getter/setter pairinherited
opacity double
Change the _opacity field value. opacityChanged will be invoked only if the field's value has changed.
getter/setter pairinherited
paint Paint
no setterinherited
paintsInWorldSpace bool
getter/setter pair
parent ↔ ContainerComponent?
getter/setter pairinherited
parentId int
Identifier used to track parent ContainerComponent.
getter/setter pairinherited
renderOpacity double
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shapePaintContainer → ShapePaintContainer?
The container is usually either a Shape or an Artboard, basically any of the various ContainerComponents that can contain Fills or Strokes.
no setterinherited
start Vec2D
no setter
startOffset Offset
no setter
startX double
Change the _startX field value. startXChanged will be invoked only if the field's value has changed.
getter/setter pairinherited
startY double
Change the _startY field value. startYChanged will be invoked only if the field's value has changed.
getter/setter pairinherited
userData ↔ dynamic
getter/setter pairinherited

Methods

addDependent(Component dependent, {Component? via}) bool
Mark dependent as a component which must update after this. Provide via as the Component registering the dependency when it is not dependent itself. At edit time this allows the editor to rebuild both dependent and via when dependent has its dependencies cleared.
inherited
addDirt(int value, {bool recurse = false}) bool
inherited
allDependencies(Set<Component> dependencies) → void
inherited
appendChild(Component child) → void
Adds the child to the children list and re-wires the parent reference of the child to the parent. Effectively detach and append.
inherited
buildDependencies() → void
Gradients depends on their shape.
buildDrawOrder(List<Drawable> drawables, DrawRules? rules, List<DrawRules> allRules) → void
inherited
changeArtboard(Artboard? value) → void
inherited
childAdded(Component child) → void
childRemoved(Component child) → void
clearDependencies() → void
inherited
clone<K extends Core<CoreContext>>() → K?
Make a duplicate of this core object, N.B. that all properties excluding object id are copied.
inherited
copy(covariant Core<CoreContext> source) → void
Copies property values, currently doesn't trigger change callbacks. It's meant to be a helper for clone.
inherited
endXChanged(double from, double to) → void
override
endYChanged(double from, double to) → void
override
forAll(DescentCallback cb) bool
inherited
forEachChild(DescentCallback cb) → void
inherited
import(ImportStack stack) bool
inherited
initializePaintMutator(ShapePaintContainer container, Paint paint) → void
inherited
isValidParent(Component parent) bool
inherited
makeGradient(Offset start, Offset end, List<Color> colors, List<double> colorPositions) Gradient
markGradientDirty() → void
Mark the gradient as needing to be rebuilt. This is a more efficient version of markStopsDirty as it won't re-sort the stops.
markPaintDirty() → void
markRebuildDependencies() → void
inherited
markStopsDirty() → void
Mark the gradient stops as changed. This will re-sort the stops and rebuild the necessary gradients in the next update cycle.
nameChanged(String from, String to) → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onAdded() → void
onAddedDirty() → void
inherited
onDependencyRemoved(Component dependent) → void
Something we depend on has been removed. It's important to clear out any stored references to that dependency so it can be garbage collected (if necessary).
inherited
onDirty(int mask) → void
inherited
onRemoved() → void
When a component has been removed from the Core Context, we clean up any dangling references left on the parent and on any other dependent component. It's important for specialization of Component to respond to override onDependencyRemoved and clean up any further stored references to that component (for example the target of a Constraint).
inherited
opacityChanged(double from, double to) → void
override
parentChanged(ContainerComponent? from, ContainerComponent? to) → void
inherited
parentIdChanged(int from, int to) → void
inherited
prependChild(Component child) → void
inherited
propagateCollapse(bool collapse) bool
inherited
propagateCollapseToChildren(bool collapse) → void
inherited
remove() → void
inherited
removeRecursive() → void
Recursive version of Component.remove. This should only be called when you know this is the only part of the branch you are removing in your operation. If your operation could remove items from the same branch multiple times, you should consider building up a list of the individual items to remove and then remove them individually to avoid calling remove multiple times on children.
inherited
resolveArtboard() bool
Find the artboard in the hierarchy.
inherited
startXChanged(double from, double to) → void
override
startYChanged(double from, double to) → void
override
syncColor() → void
toString() String
A string representation of this object.
inherited
update(int dirt) → void
userDataChanged(dynamic from, dynamic to) → void
inherited
validate() bool
visitAncestor(Component ancestor) → void
Called whenever we're resolving the artboard, we piggy back on that process to visit ancestors in the tree. This is a good opportunity to check if we have an ancestor of a specific type. For example, a Path needs to know which Shape it's within.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited