// ignore_for_file: public_member_api_docs, sort_constructors_first import 'package:canvas/models/profile.dart'; class Project { final String id; final String name; final List profiles; Map toJson() { return { 'id': id, 'name': name, 'profiles': profiles.map((profile) => profile.toJson()).toList(), }; } Project.fromJson(Map map) : id = map['id'] as String, name = map['name'] as String, profiles = List.from( (map['profiles'] as List).map( (profile) => Profile.fromJson(profile as Map), ), ); }