Guest User

Untitled

a guest
Oct 23rd, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. @immutable
  2. class SignInState{
  3.  
  4.  
  5. final ScreenState type;
  6. final LoadingStatus loadingStatus;
  7. final String password;
  8. final String passwordError;
  9. final String email;
  10. final String emailError;
  11. final String code;
  12. final String codeError;
  13.  
  14. SignInState({this.type, this.loadingStatus, this.password, this.passwordError,
  15. this.email, this.emailError, this.code, this.codeError});
  16.  
  17.  
  18. SignInState copyWith({
  19. ScreenState type,
  20. LoadingStatus loadingStatus,
  21. String password,
  22. String passwordError,
  23. String retypePassword,
  24. String retypePasswordError,
  25. String email,
  26. String emailError,
  27. String token,
  28. String code,
  29. String codeError,
  30. }){
  31. return new SignInState(
  32. type: type ?? this.type,
  33. loadingStatus: loadingStatus ?? this.loadingStatus,
  34. password: password ?? this.password,
  35. passwordError: passwordError ?? this.passwordError,
  36. email: email ?? this.email,
  37. emailError: emailError ?? this.emailError,
  38. code: code ?? this.code,
  39. codeError: codeError ?? this.codeError
  40. );
  41. }
  42.  
  43. factory SignInState.initial(){
  44. return new SignInState(
  45. type: ScreenState.WELCOME,
  46. loadingStatus: LoadingStatus.success,
  47. password: "",
  48. passwordError: "",
  49. email: "",
  50. emailError: "",
  51. code: "",
  52. codeError: "");
  53.  
  54. }
  55. }
Add Comment
Please, Sign In to add comment