import 'package:teso/Classes/TesoUser.dart'; class TokenHandler { String tokenTeso; String tokenFirebase; TesoUser user; TokenHandler({this.tokenTeso, this.user, this.tokenFirebase}); factory TokenHandler.fromJSON(Map json) { return TokenHandler( tokenTeso: json['tokenTeso'], tokenFirebase: json['tokenFirebase'] != null ? json['tokenFirebase'] : "", user: TesoUser.fromJSON(json['user']), ); } Map toJson() { final Map data = Map(); data['tokenTeso'] = this.tokenTeso; data['tokenFirebase'] = this.tokenFirebase; data['user'] = this.user; return data; } @override String toString() { return '{"user": "$user", "tokenTeso": "$tokenTeso", "tokenFirebase": "$tokenFirebase"}'; } }