Skip to main content

AnimationCommand

The class represents a command for controlling animation of a corresponding property. Extends RemoteCommand.

Properties​

PropertyTypeDescription
controllerIdStringIdentifier of the controlled AnimatedBuilder widget
animatedPropKeyStringAnimation controller identifier
methodAnimationMethodAnimation method to be called
triggerAnimationTriggerTrigger that determines when the animation should start
commandDataMap<String, dynamic>Command data
typeStringCommand type (always "animation")

Class Definition​

final class AnimationCommand extends RemoteCommand {
final String animatedPropKey;
final AnimationMethod method;
final AnimationTrigger trigger;

const AnimationCommand({
required super.commandData,
required super.controllerId,
required super.type,
required this.animatedPropKey,
required this.method,
required this.trigger,
});

factory AnimationCommand.fromRemoteCommand(RemoteCommand command);
}

JSON Example​

{
"type": "command",
"controllerId": "animated_widget_id",
"commandData": {
"type": "animation",
"animatedPropKey": "style",
"method": 0,
"trigger": "onAction"
}
}