Animation.fromJson constructor

Animation.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Animation.fromJson(Map<String, dynamic> json) {
  return Animation(
    id: json['id'] as String,
    name: json['name'] as String,
    pausedState: json['pausedState'] as bool? ?? false,
    playState: json['playState'] as String,
    playbackRate: json['playbackRate'] as num,
    startTime: json['startTime'] as num,
    currentTime: json['currentTime'] as num,
    type: AnimationType.fromJson(json['type'] as String),
    source: json.containsKey('source')
        ? AnimationEffect.fromJson(json['source'] as Map<String, dynamic>)
        : null,
    cssId: json.containsKey('cssId') ? json['cssId'] as String : null,
  );
}