2020-08-06 16:25:47 +02:00
|
|
|
import 'package:astronote_app/models/company.dart';
|
2020-08-06 14:19:17 +02:00
|
|
|
|
2020-08-06 16:25:47 +02:00
|
|
|
class UserDatas {
|
2020-08-06 14:19:17 +02:00
|
|
|
String lastname;
|
|
|
|
List<Companie> companies;
|
|
|
|
String firstname;
|
|
|
|
String civilite;
|
|
|
|
|
2020-08-06 16:25:47 +02:00
|
|
|
UserDatas({this.lastname, this.companies, this.firstname, this.civilite});
|
2020-08-06 14:19:17 +02:00
|
|
|
|
|
|
|
|
2020-08-06 16:25:47 +02:00
|
|
|
UserDatas.fromJson(Map<String, dynamic> json) {
|
2020-08-06 14:19:17 +02:00
|
|
|
lastname = json['lastname'];
|
|
|
|
if (json['companies'] != null) {
|
|
|
|
companies = new List<Companie>();
|
|
|
|
json['companies'].forEach((v) {
|
|
|
|
companies.add(new Companie.fromJson(v));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
firstname = json['firstname'];
|
|
|
|
civilite = json['civilite'];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Map<String, dynamic> toJson() {
|
|
|
|
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
|
|
// data['lastname'] = this.lastname;
|
|
|
|
// if (this.companies != null) {
|
|
|
|
// data['companies'] = this.companies.map((v) => v.toJson()).toList();
|
|
|
|
// }
|
|
|
|
// data['firstname'] = this.firstname;
|
|
|
|
// data['civilite'] = this.civilite;
|
|
|
|
// return data;
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() {
|
|
|
|
return 'User{lastname: $lastname, companies: $companies, firstname: $firstname, civilite: $civilite}';
|
|
|
|
}
|
|
|
|
}
|