Last active
October 23, 2021 08:58
-
-
Save vaygeth89/a7a1a78b4969ecab66c76d1da2376074 to your computer and use it in GitHub Desktop.
Serialized Sign In Class
This file contains hidden or 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
| //Add this | |
| import 'package:json_annotation/json_annotation.dart'; | |
| //Add this | |
| part 'sign_in.g.dart'; | |
| //Add this | |
| @JsonSerializable() | |
| class SignIn { | |
| final String email; | |
| final String password; | |
| SignIn({ | |
| required this.email, | |
| required this.password, | |
| }); | |
| //Add this | |
| static SignIn fromJson(Map<String, dynamic> map) => _$SignInFromJson(map); | |
| Map<String, dynamic> toJson() => _$SignInToJson(this); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment