import 'package:equatable/equatable.dart';

abstract class RapidOrderState extends Equatable {
  const RapidOrderState();

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

class RapidOrderInitial extends RapidOrderState {
  const RapidOrderInitial({
    this.message = '',
    this.isListening = false,
    required this.examples,
  });
  final String message;
  final bool isListening;
  final List<String> examples;

  @override
  List<Object?> get props => <Object?>[message, isListening, examples];

  RapidOrderInitial copyWith({
    String? message,
    bool? isListening,
    List<String>? examples,
  }) {
    return RapidOrderInitial(
      message: message ?? this.message,
      isListening: isListening ?? this.isListening,
      examples: examples ?? this.examples,
    );
  }
}

class RapidOrderSubmitting extends RapidOrderState {
  const RapidOrderSubmitting();
}

class RapidOrderSuccess extends RapidOrderState {
  const RapidOrderSuccess();
}

class RapidOrderFailure extends RapidOrderState {
  const RapidOrderFailure(this.error);
  final String error;

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