StrokeOrderAnimationController class
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
-
- Object
- ChangeNotifier
- StrokeOrderAnimationController
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
-
no setter
- brushWidth → double
-
no setter
- currentStroke → int
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- highlightRadical → bool
-
no setter
- hintAfterStrokes → int
-
no setter
- hintAnimationController → AnimationController
-
no setter
- hintColor → Color
-
no setter
- isAnimating → bool
-
no setter
- isQuizzing → bool
-
no setter
- medianColor → Color
-
no setter
-
medians
→ List<
List< Offset> > -
no setter
- nStrokes → int
-
no setter
- outlineColor → Color
-
no setter
- radicalColor → Color
-
no setter
-
radicalStrokes
→ List<
int> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showMedian → bool
-
no setter
- showOutline → bool
-
no setter
- showStroke → bool
-
no setter
- showUserStroke → bool
-
no setter
- strokeAnimationController → AnimationController
-
no setter
- strokeColor → Color
-
no setter
- strokeOrder → String
-
no setter
-
strokes
→ List<
Path> -
no setter
- summary → QuizSummary
-
no setter
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 nonexistent method or property is accessed.
inherited
-
notifyCorrectStrokeCallbacks(
) → void -
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
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