Closed mq162 closed 3 years ago
I write a function to update value of my object but when I get the value it's always return null :(
class User with Mappable { String name; String email;
@override void mapping(Mapper map) { map("name", name, (v) => name = v); map("email", email, (v) => email = v); }
updateValue({required String key, dynamic value}) { var json = toJson(); json[key] = value; var map = Mapper.fromJson(json); mapping(map); } }
I write a function to update value of my object but when I get the value it's always return null :(
class User with Mappable { String name; String email;
@override void mapping(Mapper map) { map("name", name, (v) => name = v); map("email", email, (v) => email = v); }
updateValue({required String key, dynamic value}) { var json = toJson(); json[key] = value; var map = Mapper.fromJson(json); mapping(map); } }