factory Template.fromJson(Map<String, dynamic> json) { return Template( (json['stages'] as List).map<Stage>((e) => Stage.fromJson(e)).toList()); }