Last active
July 13, 2023 13:06
-
-
Save yusufbiberoglu/bc64a0296101d3f6f97d273b18e4da4a to your computer and use it in GitHub Desktop.
user_model.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:json_annotation/json_annotation.dart'; | |
import 'package:app/model/index.dart'; | |
part 'user_model.g.dart'; | |
@JsonSerializable() | |
class UserModel { | |
int id; | |
String name; | |
String surname; | |
String email; | |
UserModel({ | |
required this.id, | |
required this.name, | |
required this.surname, | |
required this.email, | |
}); | |
factory UserModel.fromJson(Map<String, dynamic> json) => | |
_$UserModelFromJson(json); | |
Map<String, dynamic> toJson() => _$UserModelToJson(this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment