Skip to content

Instantly share code, notes, and snippets.

@yusufbiberoglu
Last active July 13, 2023 13:06
Show Gist options
  • Save yusufbiberoglu/bc64a0296101d3f6f97d273b18e4da4a to your computer and use it in GitHub Desktop.
Save yusufbiberoglu/bc64a0296101d3f6f97d273b18e4da4a to your computer and use it in GitHub Desktop.
user_model.dart
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