StoryElement.fromJson constructor
StoryElement.fromJson(
- Map<String, dynamic> json
)
Implementation
factory StoryElement.fromJson(Map<String, dynamic> json) {
return StoryElement(
layerIndex: json['layerIndex'] as int,
id: json['id'],
type: ItemType.fromString(json['type']),
value: json['value'] as String,
containerColor: Color(json['containerColor']),
textStyle: const TextStyle()
..fromJson(json['textStyle'] as Map<String, dynamic>),
textAlign: TextAlign.values[json['textAlign']],
position: Offset.zero.fromJson(json['position'] as Map<String, double>),
scale: json['scale'] as double,
rotation: json['rotation'] as double,
customWidgetId: json['customWidgetId'] as String,
isVideoMuted: json['isVideoMuted'] as bool? ?? false,
);
}