User.fromJson constructor

User.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory User.fromJson(Map<String, dynamic> json) {
  return User(
    id: json['id'] as int,
    username: json['username'] as String,
    password: json['password'] as String,
    phone: json['phone'] as String,
  );
}