Add fromJson() function in model classes. For example, Info ChangeNotifier class should not worry about creating a User object. It should just pass a json variable to User.fromJson() function. And this function inside User class knows how to convert a json into a User object.
https://github.com/ikema77/flutter_auth/blob/0b86b7d22c968fdd363c173abcfbd6dd2510f919/lib/providers/info.dart#L72-L79
Add fromJson() function in model classes. For example, Info ChangeNotifier class should not worry about creating a User object. It should just pass a json variable to User.fromJson() function. And this function inside User class knows how to convert a json into a User object.
Check this out: Json serialization inside model classes