Skip to content

Instantly share code, notes, and snippets.

@vaygeth89
Last active October 23, 2021 08:58
Show Gist options
  • Save vaygeth89/a7a1a78b4969ecab66c76d1da2376074 to your computer and use it in GitHub Desktop.
Save vaygeth89/a7a1a78b4969ecab66c76d1da2376074 to your computer and use it in GitHub Desktop.
Serialized Sign In Class
//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