import 'package:equatable/equatable.dart';
import 'package:flutter/cupertino.dart';
import 'package:zhiying_comm/models/user/user_info_model.dart';
import 'package:zhiying_comm/pages/login_page/model/login_style_model.dart';

abstract class LoginState extends Equatable {
  const LoginState();

  @override
  List<Object> get props => [];
}

/// 初始化状态
class InitialLoginState extends LoginState {}

/// 缓存数据状态
class LoginCacheState extends LoginState {
  final LoginStyleModel model;

  const LoginCacheState({this.model});

  @override
  List<Object> get props => [this.model];
}

/// 数据加载完毕状态
class LoginLoadedState extends LoginState {
  final LoginStyleModel model;

  const LoginLoadedState({this.model});

  @override
  List<Object> get props => [this.model];
}

/// 数据加载出错
class LoginErrorState extends LoginState {}

/// 第三方登录成功
class LoginThirdLoginSuccessState extends LoginState {
  String thirdType;
  UserInfoModel model;

  LoginThirdLoginSuccessState({@required this.model, @required this.thirdType});

  @override
  List<Object> get props => [this.model];
}

/// 第三方登录失败
class LoginThirdLoginErrorState extends LoginState {
  @override
  bool operator ==(Object other) {
    return false;
  }

  @override
  int get hashCode => super.hashCode;
}
