import 'package:equatable/equatable.dart';
import 'package:flutter/cupertino.dart';
import 'package:zhiying_base_widget/pages/login_page/invite/model/login_invite_user.dart';
import 'package:zhiying_base_widget/pages/login_page/model/login_model.dart';
import 'package:zhiying_base_widget/pages/login_page/model/login_user.dart';

abstract class LoginInviteState extends Equatable {
  const LoginInviteState();

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

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

/// 数据加载完毕状态
class LoginInviteLoadedState extends LoginInviteState {
  final LoginModel 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 LoginUser model;

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

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

/// 邀请码失败
class LoginInviteSubmitError extends LoginInviteState {
  final String msg;

  const LoginInviteSubmitError({this.msg});

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

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

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

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

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

  const LoginInviteQueryError({this.msg});

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