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/invite/model/login_invite_user.dart';
import 'package:zhiying_comm/pages/login_page/model/login_style_model.dart';

abstract class LoginInviteState extends Equatable {
  const LoginInviteState();

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

/// 初始化状态
class LoginInviteInitial extends LoginInviteState {}

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

  const LoginInviteLoadedState({@required this.model});

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

/// 数据加载出错
class LoginInviteErrorState extends LoginInviteState {
  final String msg;

  const LoginInviteErrorState({this.msg});

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

/// 邀请码成功
class LoginInviteSubmitSuccess extends LoginInviteState {
  final UserInfoModel model;

  const LoginInviteSubmitSuccess({@required this.model});

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

/// 邀请码失败
class LoginInviteSubmitErrorState extends LoginInviteState {
  @override
  bool operator ==(Object other) {
    return false;
  }

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

/// 查询邀请人成功
class LoginInviteQuerySuccessState extends LoginInviteState {
  final LoginInviteUser model;
  final LoginStyleModel pageMdel;

  const LoginInviteQuerySuccessState({@required this.model, @required this.pageMdel});

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

/// 查询邀请人失败
class LoginInviteQueryErrorState extends LoginInviteState {
  final String msg;

  const LoginInviteQueryErrorState({this.msg});

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