import 'package:equatable/equatable.dart';
import 'package:flutter/cupertino.dart';

abstract class LoginEvent extends Equatable {
  const LoginEvent();

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

/// 初始化
class LoginInitEvent extends LoginEvent {}

/// 第三方登录: 淘宝登录
class LoginThirdAliEvent extends LoginEvent {
  // 用户昵称
  final String nick;

  // 头像地址
  final String avatarUrl;
  final String openId;
  final String openSid;
  final String topAccessToken;
  final String topAuthCode;

  LoginThirdAliEvent({this.nick, this.avatarUrl, this.openId, this.openSid, this.topAccessToken, this.topAuthCode});

  @override
  List<Object> get props => [this.nick, this.avatarUrl, this.openId, this.openSid, this.topAccessToken, this.topAuthCode];
}

/// 第三方登录：苹果登录
class LoginThirdAppleEvent extends LoginEvent {
  final String identityToken;
  LoginThirdAppleEvent({@required this.identityToken});
  @override
  List<Object> get props => [this.identityToken];
}

/// 第三方登录：微信登录
class LoginThirdWeChatEvent extends LoginEvent {
  final Map<dynamic, dynamic> model;
  LoginThirdWeChatEvent({@required this.model});
  @override
  List<Object> get props => [this.model];
}

/// 第三方登录：QQ登录
class LoginThirdQQEvent extends LoginEvent {
  final Map<dynamic, dynamic> model;

  LoginThirdQQEvent({@required this.model});

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