StrokeOrderAnimationController class Null safety

A ChangeNotifier that controls the behaviour of a stroke order diagram. It must be passed as an argument to a StrokeOrderAnimator that handles the actual presentation of the diagram. It can be consumed by the StrokeOrderAnimator and an app to allow for synchronization of, e.g., control buttons with the animations.

Inheritance

Constructors

StrokeOrderAnimationController(String _strokeOrder, dynamic tickerProvider, {double strokeAnimationSpeed = 1, double hintAnimationSpeed = 3, bool showStroke = true, bool showOutline = true, bool showMedian = false, bool showUserStroke = false, bool highlightRadical = false, Color strokeColor = Colors.blue, Color outlineColor = Colors.black, Color medianColor = Colors.black, Color radicalColor = Colors.red, Color brushColor = Colors.black, double brushWidth = 8.0, int hintAfterStrokes = 3, Color hintColor = Colors.lightBlueAccent, Function? onQuizCompleteCallback, Function? onWrongStrokeCallback, Function? onCorrectStrokeCallback})

Properties

brushColor Color
read-only
brushWidth double
read-only
currentStroke int
read-only
hashCode int
The hash code for this object.
read-onlyinherited
hasListeners bool
Whether any listeners are currently registered.
@protectedread-onlyinherited
highlightRadical bool
read-only
hintAfterStrokes int
read-only
hintAnimationController AnimationController
read-only
hintColor Color
read-only
isAnimating bool
read-only
isQuizzing bool
read-only
medianColor Color
read-only
medians List<List<Offset>>
read-only
nStrokes int
read-only
outlineColor Color
read-only
radicalColor Color
read-only
radicalStrokes List<int>
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
showMedian bool
read-only
showOutline bool
read-only
showStroke bool
read-only
showUserStroke bool
read-only
strokeAnimationController AnimationController
read-only
strokeColor Color
read-only
strokeOrder String
read-only
strokes List<Path>
read-only
summary QuizSummary
read-only

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addOnCorrectStrokeCallback(Function? onCorrectStrokeCallback) → void
addOnQuizCompleteCallback(Function? onQuizCompleteCallback) → void
addOnWrongStrokeCallback(Function? onWrongStrokeCallback) → void
animateHint() → void
checkStroke(List<Offset?> rawStroke) → void
convertOffsetsToPath(List<Offset> points) Path
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
getAllowedLengthRange(double medianLength) List<double>
getLength(List<Offset> points) double
getNonNullPointsFrom(List<Offset?> rawPoints) List<Offset>
getStartEndMargin(double medianLength) double
nextStroke() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
notifyCorrectStrokeCallbacks() → void
notifyListeners() → void
Call all the registered listeners.
notifyQuizCompleteCallbacks() → void
notifyWrongStrokeCallbacks() → void
previousStroke() → void
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
reset() → void
setBrushColor(Color value) → void
setBrushWidth(double value) → void
setHighlightRadical(bool value) → void
setHintAfterStrokes(int value) → void
setHintAnimationSpeed(double value) → void
setHintColor(Color value) → void
setMedianColor(Color value) → void
setOutlineColor(Color value) → void
setRadicalColor(Color value) → void
setShowMedian(bool value) → void
setShowOutline(bool value) → void
setShowStroke(bool value) → void
setShowUserStroke(bool value) → void
setStrokeAnimationSpeed(double value) → void
setStrokeColor(Color value) → void
setStrokeOrder(String strokeOrder) → void
showFullCharacter() → void
startAnimation() → void
startQuiz() → void
stopAnimation() → void
stopQuiz() → void
strokeEndIsWithinMargin(List<Offset> points, List<Offset> currentMedian, double startEndMargin) bool
strokeHasRightDirection(List<Offset> points, List<Offset> currentMedian) bool
strokeIsCorrect(double strokeLength, List<Offset> stroke) bool
strokeLengthWithinBounds(double strokeLength, List<double> lengthRange) bool
strokeStartIsWithinMargin(List<Offset> points, List<Offset> currentMedian, double startEndMargin) bool
toString() String
A string representation of this object.
inherited

Operators

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