import 'package:e_commerce_training/src/model/response/notification_response.dart';
import 'package:equatable/equatable.dart';

abstract class MainState extends Equatable {
  const MainState();

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

class MainInitial extends MainState {
  @override
  String toString() {
    return 'MainInitial{}';
  }
}

class MainLoading extends MainState {
  @override
  String toString() => 'MainLoading';
}

class MainFailure extends MainState {
  final String error;

  MainFailure(this.error);

  @override
  String toString() => 'MainFailure { error: $error }';
}

class MainPageState extends MainState {
  final int position;

  MainPageState(this.position);

  @override
  String toString() => 'MainPageState';
}

class ShowForegroundNotificationSuccess extends MainState {
  final String title;
  final String body;
  final NotificationData data;

  ShowForegroundNotificationSuccess(this.title, this.body, this.data);

  @override
  String toString() {
    return 'ShowForegroundNotificationSuccess{title:$title,body:$body,data:$data}';
  }
}

class GetNewNotificationSuccess extends MainState {

  final int notificationId;

  GetNewNotificationSuccess(this.notificationId);

  @override
  String toString() {
    return 'GetNewNotificationSuccess {notificationId : $notificationId}';
  }
}

class RefreshMainState extends MainState{

  @override
  String toString() {
    return 'RefreshMainState{}';
  }
}

class RefreshAfterAuthenticateState extends MainState {

  @override
  String toString() {
    return 'RefreshAfterAuthenticateState{}';
  }
}

class NavigateToNotificationState extends MainState {

  final NotificationData data;

  NavigateToNotificationState(this.data);

  @override
  String toString() {
    return 'NavigateToNotificationState { data: $data}';
  }
}

