// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark

part of 'order_form_bloc.dart';

// **************************************************************************
// FreezedGenerator
// **************************************************************************

T _$identity<T>(T value) => value;

final _privateConstructorUsedError = UnsupportedError(
    'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');

/// @nodoc
mixin _$OrderFormEvent {
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(Order order) started,
    required TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)
        create,
    required TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)
        createWithPayment,
    required TResult Function(List<ProductQuantity> items, String orderId)
        addToOrder,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        refund,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        voidOrder,
    required TResult Function(OrderItem item) toggleItem,
    required TResult Function(bool selectAll) toggleSelectAll,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(Order order)? started,
    TResult? Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult? Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult? Function(OrderItem item)? toggleItem,
    TResult? Function(bool selectAll)? toggleSelectAll,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(Order order)? started,
    TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult Function(OrderItem item)? toggleItem,
    TResult Function(bool selectAll)? toggleSelectAll,
    required TResult orElse(),
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_Started value) started,
    required TResult Function(_Create value) create,
    required TResult Function(_CreateWithPaymentMethod value) createWithPayment,
    required TResult Function(_AddToOrder value) addToOrder,
    required TResult Function(_Refund value) refund,
    required TResult Function(_VoidOrder value) voidOrder,
    required TResult Function(_ToggleItem value) toggleItem,
    required TResult Function(_ToggleSelectAll value) toggleSelectAll,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_Started value)? started,
    TResult? Function(_Create value)? create,
    TResult? Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult? Function(_AddToOrder value)? addToOrder,
    TResult? Function(_Refund value)? refund,
    TResult? Function(_VoidOrder value)? voidOrder,
    TResult? Function(_ToggleItem value)? toggleItem,
    TResult? Function(_ToggleSelectAll value)? toggleSelectAll,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_Started value)? started,
    TResult Function(_Create value)? create,
    TResult Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult Function(_AddToOrder value)? addToOrder,
    TResult Function(_Refund value)? refund,
    TResult Function(_VoidOrder value)? voidOrder,
    TResult Function(_ToggleItem value)? toggleItem,
    TResult Function(_ToggleSelectAll value)? toggleSelectAll,
    required TResult orElse(),
  }) =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class $OrderFormEventCopyWith<$Res> {
  factory $OrderFormEventCopyWith(
          OrderFormEvent value, $Res Function(OrderFormEvent) then) =
      _$OrderFormEventCopyWithImpl<$Res, OrderFormEvent>;
}

/// @nodoc
class _$OrderFormEventCopyWithImpl<$Res, $Val extends OrderFormEvent>
    implements $OrderFormEventCopyWith<$Res> {
  _$OrderFormEventCopyWithImpl(this._value, this._then);

  // ignore: unused_field
  final $Val _value;
  // ignore: unused_field
  final $Res Function($Val) _then;

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
}

/// @nodoc
abstract class _$$StartedImplCopyWith<$Res> {
  factory _$$StartedImplCopyWith(
          _$StartedImpl value, $Res Function(_$StartedImpl) then) =
      __$$StartedImplCopyWithImpl<$Res>;
  @useResult
  $Res call({Order order});
}

/// @nodoc
class __$$StartedImplCopyWithImpl<$Res>
    extends _$OrderFormEventCopyWithImpl<$Res, _$StartedImpl>
    implements _$$StartedImplCopyWith<$Res> {
  __$$StartedImplCopyWithImpl(
      _$StartedImpl _value, $Res Function(_$StartedImpl) _then)
      : super(_value, _then);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? order = null,
  }) {
    return _then(_$StartedImpl(
      null == order
          ? _value.order
          : order // ignore: cast_nullable_to_non_nullable
              as Order,
    ));
  }
}

/// @nodoc

class _$StartedImpl implements _Started {
  const _$StartedImpl(this.order);

  @override
  final Order order;

  @override
  String toString() {
    return 'OrderFormEvent.started(order: $order)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$StartedImpl &&
            (identical(other.order, order) || other.order == order));
  }

  @override
  int get hashCode => Object.hash(runtimeType, order);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$StartedImplCopyWith<_$StartedImpl> get copyWith =>
      __$$StartedImplCopyWithImpl<_$StartedImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(Order order) started,
    required TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)
        create,
    required TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)
        createWithPayment,
    required TResult Function(List<ProductQuantity> items, String orderId)
        addToOrder,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        refund,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        voidOrder,
    required TResult Function(OrderItem item) toggleItem,
    required TResult Function(bool selectAll) toggleSelectAll,
  }) {
    return started(order);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(Order order)? started,
    TResult? Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult? Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult? Function(OrderItem item)? toggleItem,
    TResult? Function(bool selectAll)? toggleSelectAll,
  }) {
    return started?.call(order);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(Order order)? started,
    TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult Function(OrderItem item)? toggleItem,
    TResult Function(bool selectAll)? toggleSelectAll,
    required TResult orElse(),
  }) {
    if (started != null) {
      return started(order);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_Started value) started,
    required TResult Function(_Create value) create,
    required TResult Function(_CreateWithPaymentMethod value) createWithPayment,
    required TResult Function(_AddToOrder value) addToOrder,
    required TResult Function(_Refund value) refund,
    required TResult Function(_VoidOrder value) voidOrder,
    required TResult Function(_ToggleItem value) toggleItem,
    required TResult Function(_ToggleSelectAll value) toggleSelectAll,
  }) {
    return started(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_Started value)? started,
    TResult? Function(_Create value)? create,
    TResult? Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult? Function(_AddToOrder value)? addToOrder,
    TResult? Function(_Refund value)? refund,
    TResult? Function(_VoidOrder value)? voidOrder,
    TResult? Function(_ToggleItem value)? toggleItem,
    TResult? Function(_ToggleSelectAll value)? toggleSelectAll,
  }) {
    return started?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_Started value)? started,
    TResult Function(_Create value)? create,
    TResult Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult Function(_AddToOrder value)? addToOrder,
    TResult Function(_Refund value)? refund,
    TResult Function(_VoidOrder value)? voidOrder,
    TResult Function(_ToggleItem value)? toggleItem,
    TResult Function(_ToggleSelectAll value)? toggleSelectAll,
    required TResult orElse(),
  }) {
    if (started != null) {
      return started(this);
    }
    return orElse();
  }
}

abstract class _Started implements OrderFormEvent {
  const factory _Started(final Order order) = _$StartedImpl;

  Order get order;

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$StartedImplCopyWith<_$StartedImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$CreateImplCopyWith<$Res> {
  factory _$$CreateImplCopyWith(
          _$CreateImpl value, $Res Function(_$CreateImpl) then) =
      __$$CreateImplCopyWithImpl<$Res>;
  @useResult
  $Res call(
      {List<ProductQuantity> items,
      String customerName,
      Customer? customer,
      OrderType orderType,
      TableModel? table});
}

/// @nodoc
class __$$CreateImplCopyWithImpl<$Res>
    extends _$OrderFormEventCopyWithImpl<$Res, _$CreateImpl>
    implements _$$CreateImplCopyWith<$Res> {
  __$$CreateImplCopyWithImpl(
      _$CreateImpl _value, $Res Function(_$CreateImpl) _then)
      : super(_value, _then);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? items = null,
    Object? customerName = null,
    Object? customer = freezed,
    Object? orderType = null,
    Object? table = freezed,
  }) {
    return _then(_$CreateImpl(
      items: null == items
          ? _value._items
          : items // ignore: cast_nullable_to_non_nullable
              as List<ProductQuantity>,
      customerName: null == customerName
          ? _value.customerName
          : customerName // ignore: cast_nullable_to_non_nullable
              as String,
      customer: freezed == customer
          ? _value.customer
          : customer // ignore: cast_nullable_to_non_nullable
              as Customer?,
      orderType: null == orderType
          ? _value.orderType
          : orderType // ignore: cast_nullable_to_non_nullable
              as OrderType,
      table: freezed == table
          ? _value.table
          : table // ignore: cast_nullable_to_non_nullable
              as TableModel?,
    ));
  }
}

/// @nodoc

class _$CreateImpl implements _Create {
  const _$CreateImpl(
      {required final List<ProductQuantity> items,
      required this.customerName,
      required this.customer,
      required this.orderType,
      required this.table})
      : _items = items;

  final List<ProductQuantity> _items;
  @override
  List<ProductQuantity> get items {
    if (_items is EqualUnmodifiableListView) return _items;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableListView(_items);
  }

  @override
  final String customerName;
  @override
  final Customer? customer;
  @override
  final OrderType orderType;
  @override
  final TableModel? table;

  @override
  String toString() {
    return 'OrderFormEvent.create(items: $items, customerName: $customerName, customer: $customer, orderType: $orderType, table: $table)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$CreateImpl &&
            const DeepCollectionEquality().equals(other._items, _items) &&
            (identical(other.customerName, customerName) ||
                other.customerName == customerName) &&
            (identical(other.customer, customer) ||
                other.customer == customer) &&
            (identical(other.orderType, orderType) ||
                other.orderType == orderType) &&
            (identical(other.table, table) || other.table == table));
  }

  @override
  int get hashCode => Object.hash(
      runtimeType,
      const DeepCollectionEquality().hash(_items),
      customerName,
      customer,
      orderType,
      table);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$CreateImplCopyWith<_$CreateImpl> get copyWith =>
      __$$CreateImplCopyWithImpl<_$CreateImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(Order order) started,
    required TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)
        create,
    required TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)
        createWithPayment,
    required TResult Function(List<ProductQuantity> items, String orderId)
        addToOrder,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        refund,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        voidOrder,
    required TResult Function(OrderItem item) toggleItem,
    required TResult Function(bool selectAll) toggleSelectAll,
  }) {
    return create(items, customerName, customer, orderType, table);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(Order order)? started,
    TResult? Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult? Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult? Function(OrderItem item)? toggleItem,
    TResult? Function(bool selectAll)? toggleSelectAll,
  }) {
    return create?.call(items, customerName, customer, orderType, table);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(Order order)? started,
    TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult Function(OrderItem item)? toggleItem,
    TResult Function(bool selectAll)? toggleSelectAll,
    required TResult orElse(),
  }) {
    if (create != null) {
      return create(items, customerName, customer, orderType, table);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_Started value) started,
    required TResult Function(_Create value) create,
    required TResult Function(_CreateWithPaymentMethod value) createWithPayment,
    required TResult Function(_AddToOrder value) addToOrder,
    required TResult Function(_Refund value) refund,
    required TResult Function(_VoidOrder value) voidOrder,
    required TResult Function(_ToggleItem value) toggleItem,
    required TResult Function(_ToggleSelectAll value) toggleSelectAll,
  }) {
    return create(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_Started value)? started,
    TResult? Function(_Create value)? create,
    TResult? Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult? Function(_AddToOrder value)? addToOrder,
    TResult? Function(_Refund value)? refund,
    TResult? Function(_VoidOrder value)? voidOrder,
    TResult? Function(_ToggleItem value)? toggleItem,
    TResult? Function(_ToggleSelectAll value)? toggleSelectAll,
  }) {
    return create?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_Started value)? started,
    TResult Function(_Create value)? create,
    TResult Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult Function(_AddToOrder value)? addToOrder,
    TResult Function(_Refund value)? refund,
    TResult Function(_VoidOrder value)? voidOrder,
    TResult Function(_ToggleItem value)? toggleItem,
    TResult Function(_ToggleSelectAll value)? toggleSelectAll,
    required TResult orElse(),
  }) {
    if (create != null) {
      return create(this);
    }
    return orElse();
  }
}

abstract class _Create implements OrderFormEvent {
  const factory _Create(
      {required final List<ProductQuantity> items,
      required final String customerName,
      required final Customer? customer,
      required final OrderType orderType,
      required final TableModel? table}) = _$CreateImpl;

  List<ProductQuantity> get items;
  String get customerName;
  Customer? get customer;
  OrderType get orderType;
  TableModel? get table;

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$CreateImplCopyWith<_$CreateImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$CreateWithPaymentMethodImplCopyWith<$Res> {
  factory _$$CreateWithPaymentMethodImplCopyWith(
          _$CreateWithPaymentMethodImpl value,
          $Res Function(_$CreateWithPaymentMethodImpl) then) =
      __$$CreateWithPaymentMethodImplCopyWithImpl<$Res>;
  @useResult
  $Res call(
      {List<ProductQuantity> items,
      String customerName,
      Customer? customer,
      OrderType orderType,
      TableModel table,
      PaymentMethod paymentMethod});
}

/// @nodoc
class __$$CreateWithPaymentMethodImplCopyWithImpl<$Res>
    extends _$OrderFormEventCopyWithImpl<$Res, _$CreateWithPaymentMethodImpl>
    implements _$$CreateWithPaymentMethodImplCopyWith<$Res> {
  __$$CreateWithPaymentMethodImplCopyWithImpl(
      _$CreateWithPaymentMethodImpl _value,
      $Res Function(_$CreateWithPaymentMethodImpl) _then)
      : super(_value, _then);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? items = null,
    Object? customerName = null,
    Object? customer = freezed,
    Object? orderType = null,
    Object? table = null,
    Object? paymentMethod = null,
  }) {
    return _then(_$CreateWithPaymentMethodImpl(
      items: null == items
          ? _value._items
          : items // ignore: cast_nullable_to_non_nullable
              as List<ProductQuantity>,
      customerName: null == customerName
          ? _value.customerName
          : customerName // ignore: cast_nullable_to_non_nullable
              as String,
      customer: freezed == customer
          ? _value.customer
          : customer // ignore: cast_nullable_to_non_nullable
              as Customer?,
      orderType: null == orderType
          ? _value.orderType
          : orderType // ignore: cast_nullable_to_non_nullable
              as OrderType,
      table: null == table
          ? _value.table
          : table // ignore: cast_nullable_to_non_nullable
              as TableModel,
      paymentMethod: null == paymentMethod
          ? _value.paymentMethod
          : paymentMethod // ignore: cast_nullable_to_non_nullable
              as PaymentMethod,
    ));
  }
}

/// @nodoc

class _$CreateWithPaymentMethodImpl implements _CreateWithPaymentMethod {
  const _$CreateWithPaymentMethodImpl(
      {required final List<ProductQuantity> items,
      required this.customerName,
      required this.customer,
      required this.orderType,
      required this.table,
      required this.paymentMethod})
      : _items = items;

  final List<ProductQuantity> _items;
  @override
  List<ProductQuantity> get items {
    if (_items is EqualUnmodifiableListView) return _items;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableListView(_items);
  }

  @override
  final String customerName;
  @override
  final Customer? customer;
  @override
  final OrderType orderType;
  @override
  final TableModel table;
  @override
  final PaymentMethod paymentMethod;

  @override
  String toString() {
    return 'OrderFormEvent.createWithPayment(items: $items, customerName: $customerName, customer: $customer, orderType: $orderType, table: $table, paymentMethod: $paymentMethod)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$CreateWithPaymentMethodImpl &&
            const DeepCollectionEquality().equals(other._items, _items) &&
            (identical(other.customerName, customerName) ||
                other.customerName == customerName) &&
            (identical(other.customer, customer) ||
                other.customer == customer) &&
            (identical(other.orderType, orderType) ||
                other.orderType == orderType) &&
            (identical(other.table, table) || other.table == table) &&
            (identical(other.paymentMethod, paymentMethod) ||
                other.paymentMethod == paymentMethod));
  }

  @override
  int get hashCode => Object.hash(
      runtimeType,
      const DeepCollectionEquality().hash(_items),
      customerName,
      customer,
      orderType,
      table,
      paymentMethod);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$CreateWithPaymentMethodImplCopyWith<_$CreateWithPaymentMethodImpl>
      get copyWith => __$$CreateWithPaymentMethodImplCopyWithImpl<
          _$CreateWithPaymentMethodImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(Order order) started,
    required TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)
        create,
    required TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)
        createWithPayment,
    required TResult Function(List<ProductQuantity> items, String orderId)
        addToOrder,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        refund,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        voidOrder,
    required TResult Function(OrderItem item) toggleItem,
    required TResult Function(bool selectAll) toggleSelectAll,
  }) {
    return createWithPayment(
        items, customerName, customer, orderType, table, paymentMethod);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(Order order)? started,
    TResult? Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult? Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult? Function(OrderItem item)? toggleItem,
    TResult? Function(bool selectAll)? toggleSelectAll,
  }) {
    return createWithPayment?.call(
        items, customerName, customer, orderType, table, paymentMethod);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(Order order)? started,
    TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult Function(OrderItem item)? toggleItem,
    TResult Function(bool selectAll)? toggleSelectAll,
    required TResult orElse(),
  }) {
    if (createWithPayment != null) {
      return createWithPayment(
          items, customerName, customer, orderType, table, paymentMethod);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_Started value) started,
    required TResult Function(_Create value) create,
    required TResult Function(_CreateWithPaymentMethod value) createWithPayment,
    required TResult Function(_AddToOrder value) addToOrder,
    required TResult Function(_Refund value) refund,
    required TResult Function(_VoidOrder value) voidOrder,
    required TResult Function(_ToggleItem value) toggleItem,
    required TResult Function(_ToggleSelectAll value) toggleSelectAll,
  }) {
    return createWithPayment(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_Started value)? started,
    TResult? Function(_Create value)? create,
    TResult? Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult? Function(_AddToOrder value)? addToOrder,
    TResult? Function(_Refund value)? refund,
    TResult? Function(_VoidOrder value)? voidOrder,
    TResult? Function(_ToggleItem value)? toggleItem,
    TResult? Function(_ToggleSelectAll value)? toggleSelectAll,
  }) {
    return createWithPayment?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_Started value)? started,
    TResult Function(_Create value)? create,
    TResult Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult Function(_AddToOrder value)? addToOrder,
    TResult Function(_Refund value)? refund,
    TResult Function(_VoidOrder value)? voidOrder,
    TResult Function(_ToggleItem value)? toggleItem,
    TResult Function(_ToggleSelectAll value)? toggleSelectAll,
    required TResult orElse(),
  }) {
    if (createWithPayment != null) {
      return createWithPayment(this);
    }
    return orElse();
  }
}

abstract class _CreateWithPaymentMethod implements OrderFormEvent {
  const factory _CreateWithPaymentMethod(
          {required final List<ProductQuantity> items,
          required final String customerName,
          required final Customer? customer,
          required final OrderType orderType,
          required final TableModel table,
          required final PaymentMethod paymentMethod}) =
      _$CreateWithPaymentMethodImpl;

  List<ProductQuantity> get items;
  String get customerName;
  Customer? get customer;
  OrderType get orderType;
  TableModel get table;
  PaymentMethod get paymentMethod;

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$CreateWithPaymentMethodImplCopyWith<_$CreateWithPaymentMethodImpl>
      get copyWith => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$AddToOrderImplCopyWith<$Res> {
  factory _$$AddToOrderImplCopyWith(
          _$AddToOrderImpl value, $Res Function(_$AddToOrderImpl) then) =
      __$$AddToOrderImplCopyWithImpl<$Res>;
  @useResult
  $Res call({List<ProductQuantity> items, String orderId});
}

/// @nodoc
class __$$AddToOrderImplCopyWithImpl<$Res>
    extends _$OrderFormEventCopyWithImpl<$Res, _$AddToOrderImpl>
    implements _$$AddToOrderImplCopyWith<$Res> {
  __$$AddToOrderImplCopyWithImpl(
      _$AddToOrderImpl _value, $Res Function(_$AddToOrderImpl) _then)
      : super(_value, _then);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? items = null,
    Object? orderId = null,
  }) {
    return _then(_$AddToOrderImpl(
      items: null == items
          ? _value._items
          : items // ignore: cast_nullable_to_non_nullable
              as List<ProductQuantity>,
      orderId: null == orderId
          ? _value.orderId
          : orderId // ignore: cast_nullable_to_non_nullable
              as String,
    ));
  }
}

/// @nodoc

class _$AddToOrderImpl implements _AddToOrder {
  const _$AddToOrderImpl(
      {required final List<ProductQuantity> items, required this.orderId})
      : _items = items;

  final List<ProductQuantity> _items;
  @override
  List<ProductQuantity> get items {
    if (_items is EqualUnmodifiableListView) return _items;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableListView(_items);
  }

  @override
  final String orderId;

  @override
  String toString() {
    return 'OrderFormEvent.addToOrder(items: $items, orderId: $orderId)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$AddToOrderImpl &&
            const DeepCollectionEquality().equals(other._items, _items) &&
            (identical(other.orderId, orderId) || other.orderId == orderId));
  }

  @override
  int get hashCode => Object.hash(
      runtimeType, const DeepCollectionEquality().hash(_items), orderId);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$AddToOrderImplCopyWith<_$AddToOrderImpl> get copyWith =>
      __$$AddToOrderImplCopyWithImpl<_$AddToOrderImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(Order order) started,
    required TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)
        create,
    required TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)
        createWithPayment,
    required TResult Function(List<ProductQuantity> items, String orderId)
        addToOrder,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        refund,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        voidOrder,
    required TResult Function(OrderItem item) toggleItem,
    required TResult Function(bool selectAll) toggleSelectAll,
  }) {
    return addToOrder(items, orderId);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(Order order)? started,
    TResult? Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult? Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult? Function(OrderItem item)? toggleItem,
    TResult? Function(bool selectAll)? toggleSelectAll,
  }) {
    return addToOrder?.call(items, orderId);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(Order order)? started,
    TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult Function(OrderItem item)? toggleItem,
    TResult Function(bool selectAll)? toggleSelectAll,
    required TResult orElse(),
  }) {
    if (addToOrder != null) {
      return addToOrder(items, orderId);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_Started value) started,
    required TResult Function(_Create value) create,
    required TResult Function(_CreateWithPaymentMethod value) createWithPayment,
    required TResult Function(_AddToOrder value) addToOrder,
    required TResult Function(_Refund value) refund,
    required TResult Function(_VoidOrder value) voidOrder,
    required TResult Function(_ToggleItem value) toggleItem,
    required TResult Function(_ToggleSelectAll value) toggleSelectAll,
  }) {
    return addToOrder(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_Started value)? started,
    TResult? Function(_Create value)? create,
    TResult? Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult? Function(_AddToOrder value)? addToOrder,
    TResult? Function(_Refund value)? refund,
    TResult? Function(_VoidOrder value)? voidOrder,
    TResult? Function(_ToggleItem value)? toggleItem,
    TResult? Function(_ToggleSelectAll value)? toggleSelectAll,
  }) {
    return addToOrder?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_Started value)? started,
    TResult Function(_Create value)? create,
    TResult Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult Function(_AddToOrder value)? addToOrder,
    TResult Function(_Refund value)? refund,
    TResult Function(_VoidOrder value)? voidOrder,
    TResult Function(_ToggleItem value)? toggleItem,
    TResult Function(_ToggleSelectAll value)? toggleSelectAll,
    required TResult orElse(),
  }) {
    if (addToOrder != null) {
      return addToOrder(this);
    }
    return orElse();
  }
}

abstract class _AddToOrder implements OrderFormEvent {
  const factory _AddToOrder(
      {required final List<ProductQuantity> items,
      required final String orderId}) = _$AddToOrderImpl;

  List<ProductQuantity> get items;
  String get orderId;

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$AddToOrderImplCopyWith<_$AddToOrderImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$RefundImplCopyWith<$Res> {
  factory _$$RefundImplCopyWith(
          _$RefundImpl value, $Res Function(_$RefundImpl) then) =
      __$$RefundImplCopyWithImpl<$Res>;
  @useResult
  $Res call({List<OrderItem> items, String orderId, String reason});
}

/// @nodoc
class __$$RefundImplCopyWithImpl<$Res>
    extends _$OrderFormEventCopyWithImpl<$Res, _$RefundImpl>
    implements _$$RefundImplCopyWith<$Res> {
  __$$RefundImplCopyWithImpl(
      _$RefundImpl _value, $Res Function(_$RefundImpl) _then)
      : super(_value, _then);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? items = null,
    Object? orderId = null,
    Object? reason = null,
  }) {
    return _then(_$RefundImpl(
      items: null == items
          ? _value._items
          : items // ignore: cast_nullable_to_non_nullable
              as List<OrderItem>,
      orderId: null == orderId
          ? _value.orderId
          : orderId // ignore: cast_nullable_to_non_nullable
              as String,
      reason: null == reason
          ? _value.reason
          : reason // ignore: cast_nullable_to_non_nullable
              as String,
    ));
  }
}

/// @nodoc

class _$RefundImpl implements _Refund {
  const _$RefundImpl(
      {required final List<OrderItem> items,
      required this.orderId,
      required this.reason})
      : _items = items;

  final List<OrderItem> _items;
  @override
  List<OrderItem> get items {
    if (_items is EqualUnmodifiableListView) return _items;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableListView(_items);
  }

  @override
  final String orderId;
  @override
  final String reason;

  @override
  String toString() {
    return 'OrderFormEvent.refund(items: $items, orderId: $orderId, reason: $reason)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$RefundImpl &&
            const DeepCollectionEquality().equals(other._items, _items) &&
            (identical(other.orderId, orderId) || other.orderId == orderId) &&
            (identical(other.reason, reason) || other.reason == reason));
  }

  @override
  int get hashCode => Object.hash(runtimeType,
      const DeepCollectionEquality().hash(_items), orderId, reason);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$RefundImplCopyWith<_$RefundImpl> get copyWith =>
      __$$RefundImplCopyWithImpl<_$RefundImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(Order order) started,
    required TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)
        create,
    required TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)
        createWithPayment,
    required TResult Function(List<ProductQuantity> items, String orderId)
        addToOrder,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        refund,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        voidOrder,
    required TResult Function(OrderItem item) toggleItem,
    required TResult Function(bool selectAll) toggleSelectAll,
  }) {
    return refund(items, orderId, reason);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(Order order)? started,
    TResult? Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult? Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult? Function(OrderItem item)? toggleItem,
    TResult? Function(bool selectAll)? toggleSelectAll,
  }) {
    return refund?.call(items, orderId, reason);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(Order order)? started,
    TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult Function(OrderItem item)? toggleItem,
    TResult Function(bool selectAll)? toggleSelectAll,
    required TResult orElse(),
  }) {
    if (refund != null) {
      return refund(items, orderId, reason);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_Started value) started,
    required TResult Function(_Create value) create,
    required TResult Function(_CreateWithPaymentMethod value) createWithPayment,
    required TResult Function(_AddToOrder value) addToOrder,
    required TResult Function(_Refund value) refund,
    required TResult Function(_VoidOrder value) voidOrder,
    required TResult Function(_ToggleItem value) toggleItem,
    required TResult Function(_ToggleSelectAll value) toggleSelectAll,
  }) {
    return refund(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_Started value)? started,
    TResult? Function(_Create value)? create,
    TResult? Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult? Function(_AddToOrder value)? addToOrder,
    TResult? Function(_Refund value)? refund,
    TResult? Function(_VoidOrder value)? voidOrder,
    TResult? Function(_ToggleItem value)? toggleItem,
    TResult? Function(_ToggleSelectAll value)? toggleSelectAll,
  }) {
    return refund?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_Started value)? started,
    TResult Function(_Create value)? create,
    TResult Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult Function(_AddToOrder value)? addToOrder,
    TResult Function(_Refund value)? refund,
    TResult Function(_VoidOrder value)? voidOrder,
    TResult Function(_ToggleItem value)? toggleItem,
    TResult Function(_ToggleSelectAll value)? toggleSelectAll,
    required TResult orElse(),
  }) {
    if (refund != null) {
      return refund(this);
    }
    return orElse();
  }
}

abstract class _Refund implements OrderFormEvent {
  const factory _Refund(
      {required final List<OrderItem> items,
      required final String orderId,
      required final String reason}) = _$RefundImpl;

  List<OrderItem> get items;
  String get orderId;
  String get reason;

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$RefundImplCopyWith<_$RefundImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$VoidOrderImplCopyWith<$Res> {
  factory _$$VoidOrderImplCopyWith(
          _$VoidOrderImpl value, $Res Function(_$VoidOrderImpl) then) =
      __$$VoidOrderImplCopyWithImpl<$Res>;
  @useResult
  $Res call({List<OrderItem> items, String orderId, String reason});
}

/// @nodoc
class __$$VoidOrderImplCopyWithImpl<$Res>
    extends _$OrderFormEventCopyWithImpl<$Res, _$VoidOrderImpl>
    implements _$$VoidOrderImplCopyWith<$Res> {
  __$$VoidOrderImplCopyWithImpl(
      _$VoidOrderImpl _value, $Res Function(_$VoidOrderImpl) _then)
      : super(_value, _then);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? items = null,
    Object? orderId = null,
    Object? reason = null,
  }) {
    return _then(_$VoidOrderImpl(
      items: null == items
          ? _value._items
          : items // ignore: cast_nullable_to_non_nullable
              as List<OrderItem>,
      orderId: null == orderId
          ? _value.orderId
          : orderId // ignore: cast_nullable_to_non_nullable
              as String,
      reason: null == reason
          ? _value.reason
          : reason // ignore: cast_nullable_to_non_nullable
              as String,
    ));
  }
}

/// @nodoc

class _$VoidOrderImpl implements _VoidOrder {
  const _$VoidOrderImpl(
      {required final List<OrderItem> items,
      required this.orderId,
      required this.reason})
      : _items = items;

  final List<OrderItem> _items;
  @override
  List<OrderItem> get items {
    if (_items is EqualUnmodifiableListView) return _items;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableListView(_items);
  }

  @override
  final String orderId;
  @override
  final String reason;

  @override
  String toString() {
    return 'OrderFormEvent.voidOrder(items: $items, orderId: $orderId, reason: $reason)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$VoidOrderImpl &&
            const DeepCollectionEquality().equals(other._items, _items) &&
            (identical(other.orderId, orderId) || other.orderId == orderId) &&
            (identical(other.reason, reason) || other.reason == reason));
  }

  @override
  int get hashCode => Object.hash(runtimeType,
      const DeepCollectionEquality().hash(_items), orderId, reason);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$VoidOrderImplCopyWith<_$VoidOrderImpl> get copyWith =>
      __$$VoidOrderImplCopyWithImpl<_$VoidOrderImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(Order order) started,
    required TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)
        create,
    required TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)
        createWithPayment,
    required TResult Function(List<ProductQuantity> items, String orderId)
        addToOrder,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        refund,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        voidOrder,
    required TResult Function(OrderItem item) toggleItem,
    required TResult Function(bool selectAll) toggleSelectAll,
  }) {
    return voidOrder(items, orderId, reason);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(Order order)? started,
    TResult? Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult? Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult? Function(OrderItem item)? toggleItem,
    TResult? Function(bool selectAll)? toggleSelectAll,
  }) {
    return voidOrder?.call(items, orderId, reason);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(Order order)? started,
    TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult Function(OrderItem item)? toggleItem,
    TResult Function(bool selectAll)? toggleSelectAll,
    required TResult orElse(),
  }) {
    if (voidOrder != null) {
      return voidOrder(items, orderId, reason);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_Started value) started,
    required TResult Function(_Create value) create,
    required TResult Function(_CreateWithPaymentMethod value) createWithPayment,
    required TResult Function(_AddToOrder value) addToOrder,
    required TResult Function(_Refund value) refund,
    required TResult Function(_VoidOrder value) voidOrder,
    required TResult Function(_ToggleItem value) toggleItem,
    required TResult Function(_ToggleSelectAll value) toggleSelectAll,
  }) {
    return voidOrder(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_Started value)? started,
    TResult? Function(_Create value)? create,
    TResult? Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult? Function(_AddToOrder value)? addToOrder,
    TResult? Function(_Refund value)? refund,
    TResult? Function(_VoidOrder value)? voidOrder,
    TResult? Function(_ToggleItem value)? toggleItem,
    TResult? Function(_ToggleSelectAll value)? toggleSelectAll,
  }) {
    return voidOrder?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_Started value)? started,
    TResult Function(_Create value)? create,
    TResult Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult Function(_AddToOrder value)? addToOrder,
    TResult Function(_Refund value)? refund,
    TResult Function(_VoidOrder value)? voidOrder,
    TResult Function(_ToggleItem value)? toggleItem,
    TResult Function(_ToggleSelectAll value)? toggleSelectAll,
    required TResult orElse(),
  }) {
    if (voidOrder != null) {
      return voidOrder(this);
    }
    return orElse();
  }
}

abstract class _VoidOrder implements OrderFormEvent {
  const factory _VoidOrder(
      {required final List<OrderItem> items,
      required final String orderId,
      required final String reason}) = _$VoidOrderImpl;

  List<OrderItem> get items;
  String get orderId;
  String get reason;

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$VoidOrderImplCopyWith<_$VoidOrderImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ToggleItemImplCopyWith<$Res> {
  factory _$$ToggleItemImplCopyWith(
          _$ToggleItemImpl value, $Res Function(_$ToggleItemImpl) then) =
      __$$ToggleItemImplCopyWithImpl<$Res>;
  @useResult
  $Res call({OrderItem item});
}

/// @nodoc
class __$$ToggleItemImplCopyWithImpl<$Res>
    extends _$OrderFormEventCopyWithImpl<$Res, _$ToggleItemImpl>
    implements _$$ToggleItemImplCopyWith<$Res> {
  __$$ToggleItemImplCopyWithImpl(
      _$ToggleItemImpl _value, $Res Function(_$ToggleItemImpl) _then)
      : super(_value, _then);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? item = null,
  }) {
    return _then(_$ToggleItemImpl(
      null == item
          ? _value.item
          : item // ignore: cast_nullable_to_non_nullable
              as OrderItem,
    ));
  }
}

/// @nodoc

class _$ToggleItemImpl implements _ToggleItem {
  const _$ToggleItemImpl(this.item);

  @override
  final OrderItem item;

  @override
  String toString() {
    return 'OrderFormEvent.toggleItem(item: $item)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ToggleItemImpl &&
            (identical(other.item, item) || other.item == item));
  }

  @override
  int get hashCode => Object.hash(runtimeType, item);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$ToggleItemImplCopyWith<_$ToggleItemImpl> get copyWith =>
      __$$ToggleItemImplCopyWithImpl<_$ToggleItemImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(Order order) started,
    required TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)
        create,
    required TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)
        createWithPayment,
    required TResult Function(List<ProductQuantity> items, String orderId)
        addToOrder,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        refund,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        voidOrder,
    required TResult Function(OrderItem item) toggleItem,
    required TResult Function(bool selectAll) toggleSelectAll,
  }) {
    return toggleItem(item);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(Order order)? started,
    TResult? Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult? Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult? Function(OrderItem item)? toggleItem,
    TResult? Function(bool selectAll)? toggleSelectAll,
  }) {
    return toggleItem?.call(item);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(Order order)? started,
    TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult Function(OrderItem item)? toggleItem,
    TResult Function(bool selectAll)? toggleSelectAll,
    required TResult orElse(),
  }) {
    if (toggleItem != null) {
      return toggleItem(item);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_Started value) started,
    required TResult Function(_Create value) create,
    required TResult Function(_CreateWithPaymentMethod value) createWithPayment,
    required TResult Function(_AddToOrder value) addToOrder,
    required TResult Function(_Refund value) refund,
    required TResult Function(_VoidOrder value) voidOrder,
    required TResult Function(_ToggleItem value) toggleItem,
    required TResult Function(_ToggleSelectAll value) toggleSelectAll,
  }) {
    return toggleItem(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_Started value)? started,
    TResult? Function(_Create value)? create,
    TResult? Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult? Function(_AddToOrder value)? addToOrder,
    TResult? Function(_Refund value)? refund,
    TResult? Function(_VoidOrder value)? voidOrder,
    TResult? Function(_ToggleItem value)? toggleItem,
    TResult? Function(_ToggleSelectAll value)? toggleSelectAll,
  }) {
    return toggleItem?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_Started value)? started,
    TResult Function(_Create value)? create,
    TResult Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult Function(_AddToOrder value)? addToOrder,
    TResult Function(_Refund value)? refund,
    TResult Function(_VoidOrder value)? voidOrder,
    TResult Function(_ToggleItem value)? toggleItem,
    TResult Function(_ToggleSelectAll value)? toggleSelectAll,
    required TResult orElse(),
  }) {
    if (toggleItem != null) {
      return toggleItem(this);
    }
    return orElse();
  }
}

abstract class _ToggleItem implements OrderFormEvent {
  const factory _ToggleItem(final OrderItem item) = _$ToggleItemImpl;

  OrderItem get item;

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$ToggleItemImplCopyWith<_$ToggleItemImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ToggleSelectAllImplCopyWith<$Res> {
  factory _$$ToggleSelectAllImplCopyWith(_$ToggleSelectAllImpl value,
          $Res Function(_$ToggleSelectAllImpl) then) =
      __$$ToggleSelectAllImplCopyWithImpl<$Res>;
  @useResult
  $Res call({bool selectAll});
}

/// @nodoc
class __$$ToggleSelectAllImplCopyWithImpl<$Res>
    extends _$OrderFormEventCopyWithImpl<$Res, _$ToggleSelectAllImpl>
    implements _$$ToggleSelectAllImplCopyWith<$Res> {
  __$$ToggleSelectAllImplCopyWithImpl(
      _$ToggleSelectAllImpl _value, $Res Function(_$ToggleSelectAllImpl) _then)
      : super(_value, _then);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? selectAll = null,
  }) {
    return _then(_$ToggleSelectAllImpl(
      null == selectAll
          ? _value.selectAll
          : selectAll // ignore: cast_nullable_to_non_nullable
              as bool,
    ));
  }
}

/// @nodoc

class _$ToggleSelectAllImpl implements _ToggleSelectAll {
  const _$ToggleSelectAllImpl(this.selectAll);

  @override
  final bool selectAll;

  @override
  String toString() {
    return 'OrderFormEvent.toggleSelectAll(selectAll: $selectAll)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ToggleSelectAllImpl &&
            (identical(other.selectAll, selectAll) ||
                other.selectAll == selectAll));
  }

  @override
  int get hashCode => Object.hash(runtimeType, selectAll);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$ToggleSelectAllImplCopyWith<_$ToggleSelectAllImpl> get copyWith =>
      __$$ToggleSelectAllImplCopyWithImpl<_$ToggleSelectAllImpl>(
          this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(Order order) started,
    required TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)
        create,
    required TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)
        createWithPayment,
    required TResult Function(List<ProductQuantity> items, String orderId)
        addToOrder,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        refund,
    required TResult Function(
            List<OrderItem> items, String orderId, String reason)
        voidOrder,
    required TResult Function(OrderItem item) toggleItem,
    required TResult Function(bool selectAll) toggleSelectAll,
  }) {
    return toggleSelectAll(selectAll);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(Order order)? started,
    TResult? Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult? Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult? Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult? Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult? Function(OrderItem item)? toggleItem,
    TResult? Function(bool selectAll)? toggleSelectAll,
  }) {
    return toggleSelectAll?.call(selectAll);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(Order order)? started,
    TResult Function(List<ProductQuantity> items, String customerName,
            Customer? customer, OrderType orderType, TableModel? table)?
        create,
    TResult Function(
            List<ProductQuantity> items,
            String customerName,
            Customer? customer,
            OrderType orderType,
            TableModel table,
            PaymentMethod paymentMethod)?
        createWithPayment,
    TResult Function(List<ProductQuantity> items, String orderId)? addToOrder,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        refund,
    TResult Function(List<OrderItem> items, String orderId, String reason)?
        voidOrder,
    TResult Function(OrderItem item)? toggleItem,
    TResult Function(bool selectAll)? toggleSelectAll,
    required TResult orElse(),
  }) {
    if (toggleSelectAll != null) {
      return toggleSelectAll(selectAll);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_Started value) started,
    required TResult Function(_Create value) create,
    required TResult Function(_CreateWithPaymentMethod value) createWithPayment,
    required TResult Function(_AddToOrder value) addToOrder,
    required TResult Function(_Refund value) refund,
    required TResult Function(_VoidOrder value) voidOrder,
    required TResult Function(_ToggleItem value) toggleItem,
    required TResult Function(_ToggleSelectAll value) toggleSelectAll,
  }) {
    return toggleSelectAll(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_Started value)? started,
    TResult? Function(_Create value)? create,
    TResult? Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult? Function(_AddToOrder value)? addToOrder,
    TResult? Function(_Refund value)? refund,
    TResult? Function(_VoidOrder value)? voidOrder,
    TResult? Function(_ToggleItem value)? toggleItem,
    TResult? Function(_ToggleSelectAll value)? toggleSelectAll,
  }) {
    return toggleSelectAll?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_Started value)? started,
    TResult Function(_Create value)? create,
    TResult Function(_CreateWithPaymentMethod value)? createWithPayment,
    TResult Function(_AddToOrder value)? addToOrder,
    TResult Function(_Refund value)? refund,
    TResult Function(_VoidOrder value)? voidOrder,
    TResult Function(_ToggleItem value)? toggleItem,
    TResult Function(_ToggleSelectAll value)? toggleSelectAll,
    required TResult orElse(),
  }) {
    if (toggleSelectAll != null) {
      return toggleSelectAll(this);
    }
    return orElse();
  }
}

abstract class _ToggleSelectAll implements OrderFormEvent {
  const factory _ToggleSelectAll(final bool selectAll) = _$ToggleSelectAllImpl;

  bool get selectAll;

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$ToggleSelectAllImplCopyWith<_$ToggleSelectAllImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
mixin _$OrderFormState {
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function() initial,
    required TResult Function() loading,
    required TResult Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)
        loaded,
    required TResult Function(Order order) success,
    required TResult Function() successMsg,
    required TResult Function(String message) error,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function()? initial,
    TResult? Function()? loading,
    TResult? Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)?
        loaded,
    TResult? Function(Order order)? success,
    TResult? Function()? successMsg,
    TResult? Function(String message)? error,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function()? initial,
    TResult Function()? loading,
    TResult Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)?
        loaded,
    TResult Function(Order order)? success,
    TResult Function()? successMsg,
    TResult Function(String message)? error,
    required TResult orElse(),
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_Initial value) initial,
    required TResult Function(_Loading value) loading,
    required TResult Function(_Loaded value) loaded,
    required TResult Function(_Success value) success,
    required TResult Function(_SuccessMsg value) successMsg,
    required TResult Function(_Error value) error,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_Initial value)? initial,
    TResult? Function(_Loading value)? loading,
    TResult? Function(_Loaded value)? loaded,
    TResult? Function(_Success value)? success,
    TResult? Function(_SuccessMsg value)? successMsg,
    TResult? Function(_Error value)? error,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_Initial value)? initial,
    TResult Function(_Loading value)? loading,
    TResult Function(_Loaded value)? loaded,
    TResult Function(_Success value)? success,
    TResult Function(_SuccessMsg value)? successMsg,
    TResult Function(_Error value)? error,
    required TResult orElse(),
  }) =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class $OrderFormStateCopyWith<$Res> {
  factory $OrderFormStateCopyWith(
          OrderFormState value, $Res Function(OrderFormState) then) =
      _$OrderFormStateCopyWithImpl<$Res, OrderFormState>;
}

/// @nodoc
class _$OrderFormStateCopyWithImpl<$Res, $Val extends OrderFormState>
    implements $OrderFormStateCopyWith<$Res> {
  _$OrderFormStateCopyWithImpl(this._value, this._then);

  // ignore: unused_field
  final $Val _value;
  // ignore: unused_field
  final $Res Function($Val) _then;

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
}

/// @nodoc
abstract class _$$InitialImplCopyWith<$Res> {
  factory _$$InitialImplCopyWith(
          _$InitialImpl value, $Res Function(_$InitialImpl) then) =
      __$$InitialImplCopyWithImpl<$Res>;
}

/// @nodoc
class __$$InitialImplCopyWithImpl<$Res>
    extends _$OrderFormStateCopyWithImpl<$Res, _$InitialImpl>
    implements _$$InitialImplCopyWith<$Res> {
  __$$InitialImplCopyWithImpl(
      _$InitialImpl _value, $Res Function(_$InitialImpl) _then)
      : super(_value, _then);

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
}

/// @nodoc

class _$InitialImpl implements _Initial {
  const _$InitialImpl();

  @override
  String toString() {
    return 'OrderFormState.initial()';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType && other is _$InitialImpl);
  }

  @override
  int get hashCode => runtimeType.hashCode;

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function() initial,
    required TResult Function() loading,
    required TResult Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)
        loaded,
    required TResult Function(Order order) success,
    required TResult Function() successMsg,
    required TResult Function(String message) error,
  }) {
    return initial();
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function()? initial,
    TResult? Function()? loading,
    TResult? Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)?
        loaded,
    TResult? Function(Order order)? success,
    TResult? Function()? successMsg,
    TResult? Function(String message)? error,
  }) {
    return initial?.call();
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function()? initial,
    TResult Function()? loading,
    TResult Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)?
        loaded,
    TResult Function(Order order)? success,
    TResult Function()? successMsg,
    TResult Function(String message)? error,
    required TResult orElse(),
  }) {
    if (initial != null) {
      return initial();
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_Initial value) initial,
    required TResult Function(_Loading value) loading,
    required TResult Function(_Loaded value) loaded,
    required TResult Function(_Success value) success,
    required TResult Function(_SuccessMsg value) successMsg,
    required TResult Function(_Error value) error,
  }) {
    return initial(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_Initial value)? initial,
    TResult? Function(_Loading value)? loading,
    TResult? Function(_Loaded value)? loaded,
    TResult? Function(_Success value)? success,
    TResult? Function(_SuccessMsg value)? successMsg,
    TResult? Function(_Error value)? error,
  }) {
    return initial?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_Initial value)? initial,
    TResult Function(_Loading value)? loading,
    TResult Function(_Loaded value)? loaded,
    TResult Function(_Success value)? success,
    TResult Function(_SuccessMsg value)? successMsg,
    TResult Function(_Error value)? error,
    required TResult orElse(),
  }) {
    if (initial != null) {
      return initial(this);
    }
    return orElse();
  }
}

abstract class _Initial implements OrderFormState {
  const factory _Initial() = _$InitialImpl;
}

/// @nodoc
abstract class _$$LoadingImplCopyWith<$Res> {
  factory _$$LoadingImplCopyWith(
          _$LoadingImpl value, $Res Function(_$LoadingImpl) then) =
      __$$LoadingImplCopyWithImpl<$Res>;
}

/// @nodoc
class __$$LoadingImplCopyWithImpl<$Res>
    extends _$OrderFormStateCopyWithImpl<$Res, _$LoadingImpl>
    implements _$$LoadingImplCopyWith<$Res> {
  __$$LoadingImplCopyWithImpl(
      _$LoadingImpl _value, $Res Function(_$LoadingImpl) _then)
      : super(_value, _then);

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
}

/// @nodoc

class _$LoadingImpl implements _Loading {
  const _$LoadingImpl();

  @override
  String toString() {
    return 'OrderFormState.loading()';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType && other is _$LoadingImpl);
  }

  @override
  int get hashCode => runtimeType.hashCode;

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function() initial,
    required TResult Function() loading,
    required TResult Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)
        loaded,
    required TResult Function(Order order) success,
    required TResult Function() successMsg,
    required TResult Function(String message) error,
  }) {
    return loading();
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function()? initial,
    TResult? Function()? loading,
    TResult? Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)?
        loaded,
    TResult? Function(Order order)? success,
    TResult? Function()? successMsg,
    TResult? Function(String message)? error,
  }) {
    return loading?.call();
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function()? initial,
    TResult Function()? loading,
    TResult Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)?
        loaded,
    TResult Function(Order order)? success,
    TResult Function()? successMsg,
    TResult Function(String message)? error,
    required TResult orElse(),
  }) {
    if (loading != null) {
      return loading();
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_Initial value) initial,
    required TResult Function(_Loading value) loading,
    required TResult Function(_Loaded value) loaded,
    required TResult Function(_Success value) success,
    required TResult Function(_SuccessMsg value) successMsg,
    required TResult Function(_Error value) error,
  }) {
    return loading(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_Initial value)? initial,
    TResult? Function(_Loading value)? loading,
    TResult? Function(_Loaded value)? loaded,
    TResult? Function(_Success value)? success,
    TResult? Function(_SuccessMsg value)? successMsg,
    TResult? Function(_Error value)? error,
  }) {
    return loading?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_Initial value)? initial,
    TResult Function(_Loading value)? loading,
    TResult Function(_Loaded value)? loaded,
    TResult Function(_Success value)? success,
    TResult Function(_SuccessMsg value)? successMsg,
    TResult Function(_Error value)? error,
    required TResult orElse(),
  }) {
    if (loading != null) {
      return loading(this);
    }
    return orElse();
  }
}

abstract class _Loading implements OrderFormState {
  const factory _Loading() = _$LoadingImpl;
}

/// @nodoc
abstract class _$$LoadedImplCopyWith<$Res> {
  factory _$$LoadedImplCopyWith(
          _$LoadedImpl value, $Res Function(_$LoadedImpl) then) =
      __$$LoadedImplCopyWithImpl<$Res>;
  @useResult
  $Res call(
      {Order order,
      List<OrderItem> selectedItems,
      int totalVoidOrRefund,
      bool isAllSelected});
}

/// @nodoc
class __$$LoadedImplCopyWithImpl<$Res>
    extends _$OrderFormStateCopyWithImpl<$Res, _$LoadedImpl>
    implements _$$LoadedImplCopyWith<$Res> {
  __$$LoadedImplCopyWithImpl(
      _$LoadedImpl _value, $Res Function(_$LoadedImpl) _then)
      : super(_value, _then);

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? order = null,
    Object? selectedItems = null,
    Object? totalVoidOrRefund = null,
    Object? isAllSelected = null,
  }) {
    return _then(_$LoadedImpl(
      order: null == order
          ? _value.order
          : order // ignore: cast_nullable_to_non_nullable
              as Order,
      selectedItems: null == selectedItems
          ? _value._selectedItems
          : selectedItems // ignore: cast_nullable_to_non_nullable
              as List<OrderItem>,
      totalVoidOrRefund: null == totalVoidOrRefund
          ? _value.totalVoidOrRefund
          : totalVoidOrRefund // ignore: cast_nullable_to_non_nullable
              as int,
      isAllSelected: null == isAllSelected
          ? _value.isAllSelected
          : isAllSelected // ignore: cast_nullable_to_non_nullable
              as bool,
    ));
  }
}

/// @nodoc

class _$LoadedImpl implements _Loaded {
  const _$LoadedImpl(
      {required this.order,
      final List<OrderItem> selectedItems = const [],
      this.totalVoidOrRefund = 0,
      this.isAllSelected = false})
      : _selectedItems = selectedItems;

  @override
  final Order order;
  final List<OrderItem> _selectedItems;
  @override
  @JsonKey()
  List<OrderItem> get selectedItems {
    if (_selectedItems is EqualUnmodifiableListView) return _selectedItems;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableListView(_selectedItems);
  }

  @override
  @JsonKey()
  final int totalVoidOrRefund;
  @override
  @JsonKey()
  final bool isAllSelected;

  @override
  String toString() {
    return 'OrderFormState.loaded(order: $order, selectedItems: $selectedItems, totalVoidOrRefund: $totalVoidOrRefund, isAllSelected: $isAllSelected)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$LoadedImpl &&
            (identical(other.order, order) || other.order == order) &&
            const DeepCollectionEquality()
                .equals(other._selectedItems, _selectedItems) &&
            (identical(other.totalVoidOrRefund, totalVoidOrRefund) ||
                other.totalVoidOrRefund == totalVoidOrRefund) &&
            (identical(other.isAllSelected, isAllSelected) ||
                other.isAllSelected == isAllSelected));
  }

  @override
  int get hashCode => Object.hash(
      runtimeType,
      order,
      const DeepCollectionEquality().hash(_selectedItems),
      totalVoidOrRefund,
      isAllSelected);

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$LoadedImplCopyWith<_$LoadedImpl> get copyWith =>
      __$$LoadedImplCopyWithImpl<_$LoadedImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function() initial,
    required TResult Function() loading,
    required TResult Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)
        loaded,
    required TResult Function(Order order) success,
    required TResult Function() successMsg,
    required TResult Function(String message) error,
  }) {
    return loaded(order, selectedItems, totalVoidOrRefund, isAllSelected);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function()? initial,
    TResult? Function()? loading,
    TResult? Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)?
        loaded,
    TResult? Function(Order order)? success,
    TResult? Function()? successMsg,
    TResult? Function(String message)? error,
  }) {
    return loaded?.call(order, selectedItems, totalVoidOrRefund, isAllSelected);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function()? initial,
    TResult Function()? loading,
    TResult Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)?
        loaded,
    TResult Function(Order order)? success,
    TResult Function()? successMsg,
    TResult Function(String message)? error,
    required TResult orElse(),
  }) {
    if (loaded != null) {
      return loaded(order, selectedItems, totalVoidOrRefund, isAllSelected);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_Initial value) initial,
    required TResult Function(_Loading value) loading,
    required TResult Function(_Loaded value) loaded,
    required TResult Function(_Success value) success,
    required TResult Function(_SuccessMsg value) successMsg,
    required TResult Function(_Error value) error,
  }) {
    return loaded(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_Initial value)? initial,
    TResult? Function(_Loading value)? loading,
    TResult? Function(_Loaded value)? loaded,
    TResult? Function(_Success value)? success,
    TResult? Function(_SuccessMsg value)? successMsg,
    TResult? Function(_Error value)? error,
  }) {
    return loaded?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_Initial value)? initial,
    TResult Function(_Loading value)? loading,
    TResult Function(_Loaded value)? loaded,
    TResult Function(_Success value)? success,
    TResult Function(_SuccessMsg value)? successMsg,
    TResult Function(_Error value)? error,
    required TResult orElse(),
  }) {
    if (loaded != null) {
      return loaded(this);
    }
    return orElse();
  }
}

abstract class _Loaded implements OrderFormState {
  const factory _Loaded(
      {required final Order order,
      final List<OrderItem> selectedItems,
      final int totalVoidOrRefund,
      final bool isAllSelected}) = _$LoadedImpl;

  Order get order;
  List<OrderItem> get selectedItems;
  int get totalVoidOrRefund;
  bool get isAllSelected;

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$LoadedImplCopyWith<_$LoadedImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$SuccessImplCopyWith<$Res> {
  factory _$$SuccessImplCopyWith(
          _$SuccessImpl value, $Res Function(_$SuccessImpl) then) =
      __$$SuccessImplCopyWithImpl<$Res>;
  @useResult
  $Res call({Order order});
}

/// @nodoc
class __$$SuccessImplCopyWithImpl<$Res>
    extends _$OrderFormStateCopyWithImpl<$Res, _$SuccessImpl>
    implements _$$SuccessImplCopyWith<$Res> {
  __$$SuccessImplCopyWithImpl(
      _$SuccessImpl _value, $Res Function(_$SuccessImpl) _then)
      : super(_value, _then);

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? order = null,
  }) {
    return _then(_$SuccessImpl(
      null == order
          ? _value.order
          : order // ignore: cast_nullable_to_non_nullable
              as Order,
    ));
  }
}

/// @nodoc

class _$SuccessImpl implements _Success {
  const _$SuccessImpl(this.order);

  @override
  final Order order;

  @override
  String toString() {
    return 'OrderFormState.success(order: $order)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$SuccessImpl &&
            (identical(other.order, order) || other.order == order));
  }

  @override
  int get hashCode => Object.hash(runtimeType, order);

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$SuccessImplCopyWith<_$SuccessImpl> get copyWith =>
      __$$SuccessImplCopyWithImpl<_$SuccessImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function() initial,
    required TResult Function() loading,
    required TResult Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)
        loaded,
    required TResult Function(Order order) success,
    required TResult Function() successMsg,
    required TResult Function(String message) error,
  }) {
    return success(order);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function()? initial,
    TResult? Function()? loading,
    TResult? Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)?
        loaded,
    TResult? Function(Order order)? success,
    TResult? Function()? successMsg,
    TResult? Function(String message)? error,
  }) {
    return success?.call(order);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function()? initial,
    TResult Function()? loading,
    TResult Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)?
        loaded,
    TResult Function(Order order)? success,
    TResult Function()? successMsg,
    TResult Function(String message)? error,
    required TResult orElse(),
  }) {
    if (success != null) {
      return success(order);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_Initial value) initial,
    required TResult Function(_Loading value) loading,
    required TResult Function(_Loaded value) loaded,
    required TResult Function(_Success value) success,
    required TResult Function(_SuccessMsg value) successMsg,
    required TResult Function(_Error value) error,
  }) {
    return success(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_Initial value)? initial,
    TResult? Function(_Loading value)? loading,
    TResult? Function(_Loaded value)? loaded,
    TResult? Function(_Success value)? success,
    TResult? Function(_SuccessMsg value)? successMsg,
    TResult? Function(_Error value)? error,
  }) {
    return success?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_Initial value)? initial,
    TResult Function(_Loading value)? loading,
    TResult Function(_Loaded value)? loaded,
    TResult Function(_Success value)? success,
    TResult Function(_SuccessMsg value)? successMsg,
    TResult Function(_Error value)? error,
    required TResult orElse(),
  }) {
    if (success != null) {
      return success(this);
    }
    return orElse();
  }
}

abstract class _Success implements OrderFormState {
  const factory _Success(final Order order) = _$SuccessImpl;

  Order get order;

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$SuccessImplCopyWith<_$SuccessImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$SuccessMsgImplCopyWith<$Res> {
  factory _$$SuccessMsgImplCopyWith(
          _$SuccessMsgImpl value, $Res Function(_$SuccessMsgImpl) then) =
      __$$SuccessMsgImplCopyWithImpl<$Res>;
}

/// @nodoc
class __$$SuccessMsgImplCopyWithImpl<$Res>
    extends _$OrderFormStateCopyWithImpl<$Res, _$SuccessMsgImpl>
    implements _$$SuccessMsgImplCopyWith<$Res> {
  __$$SuccessMsgImplCopyWithImpl(
      _$SuccessMsgImpl _value, $Res Function(_$SuccessMsgImpl) _then)
      : super(_value, _then);

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
}

/// @nodoc

class _$SuccessMsgImpl implements _SuccessMsg {
  const _$SuccessMsgImpl();

  @override
  String toString() {
    return 'OrderFormState.successMsg()';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType && other is _$SuccessMsgImpl);
  }

  @override
  int get hashCode => runtimeType.hashCode;

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function() initial,
    required TResult Function() loading,
    required TResult Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)
        loaded,
    required TResult Function(Order order) success,
    required TResult Function() successMsg,
    required TResult Function(String message) error,
  }) {
    return successMsg();
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function()? initial,
    TResult? Function()? loading,
    TResult? Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)?
        loaded,
    TResult? Function(Order order)? success,
    TResult? Function()? successMsg,
    TResult? Function(String message)? error,
  }) {
    return successMsg?.call();
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function()? initial,
    TResult Function()? loading,
    TResult Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)?
        loaded,
    TResult Function(Order order)? success,
    TResult Function()? successMsg,
    TResult Function(String message)? error,
    required TResult orElse(),
  }) {
    if (successMsg != null) {
      return successMsg();
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_Initial value) initial,
    required TResult Function(_Loading value) loading,
    required TResult Function(_Loaded value) loaded,
    required TResult Function(_Success value) success,
    required TResult Function(_SuccessMsg value) successMsg,
    required TResult Function(_Error value) error,
  }) {
    return successMsg(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_Initial value)? initial,
    TResult? Function(_Loading value)? loading,
    TResult? Function(_Loaded value)? loaded,
    TResult? Function(_Success value)? success,
    TResult? Function(_SuccessMsg value)? successMsg,
    TResult? Function(_Error value)? error,
  }) {
    return successMsg?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_Initial value)? initial,
    TResult Function(_Loading value)? loading,
    TResult Function(_Loaded value)? loaded,
    TResult Function(_Success value)? success,
    TResult Function(_SuccessMsg value)? successMsg,
    TResult Function(_Error value)? error,
    required TResult orElse(),
  }) {
    if (successMsg != null) {
      return successMsg(this);
    }
    return orElse();
  }
}

abstract class _SuccessMsg implements OrderFormState {
  const factory _SuccessMsg() = _$SuccessMsgImpl;
}

/// @nodoc
abstract class _$$ErrorImplCopyWith<$Res> {
  factory _$$ErrorImplCopyWith(
          _$ErrorImpl value, $Res Function(_$ErrorImpl) then) =
      __$$ErrorImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String message});
}

/// @nodoc
class __$$ErrorImplCopyWithImpl<$Res>
    extends _$OrderFormStateCopyWithImpl<$Res, _$ErrorImpl>
    implements _$$ErrorImplCopyWith<$Res> {
  __$$ErrorImplCopyWithImpl(
      _$ErrorImpl _value, $Res Function(_$ErrorImpl) _then)
      : super(_value, _then);

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? message = null,
  }) {
    return _then(_$ErrorImpl(
      null == message
          ? _value.message
          : message // ignore: cast_nullable_to_non_nullable
              as String,
    ));
  }
}

/// @nodoc

class _$ErrorImpl implements _Error {
  const _$ErrorImpl(this.message);

  @override
  final String message;

  @override
  String toString() {
    return 'OrderFormState.error(message: $message)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ErrorImpl &&
            (identical(other.message, message) || other.message == message));
  }

  @override
  int get hashCode => Object.hash(runtimeType, message);

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$ErrorImplCopyWith<_$ErrorImpl> get copyWith =>
      __$$ErrorImplCopyWithImpl<_$ErrorImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function() initial,
    required TResult Function() loading,
    required TResult Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)
        loaded,
    required TResult Function(Order order) success,
    required TResult Function() successMsg,
    required TResult Function(String message) error,
  }) {
    return error(message);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function()? initial,
    TResult? Function()? loading,
    TResult? Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)?
        loaded,
    TResult? Function(Order order)? success,
    TResult? Function()? successMsg,
    TResult? Function(String message)? error,
  }) {
    return error?.call(message);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function()? initial,
    TResult Function()? loading,
    TResult Function(Order order, List<OrderItem> selectedItems,
            int totalVoidOrRefund, bool isAllSelected)?
        loaded,
    TResult Function(Order order)? success,
    TResult Function()? successMsg,
    TResult Function(String message)? error,
    required TResult orElse(),
  }) {
    if (error != null) {
      return error(message);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_Initial value) initial,
    required TResult Function(_Loading value) loading,
    required TResult Function(_Loaded value) loaded,
    required TResult Function(_Success value) success,
    required TResult Function(_SuccessMsg value) successMsg,
    required TResult Function(_Error value) error,
  }) {
    return error(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_Initial value)? initial,
    TResult? Function(_Loading value)? loading,
    TResult? Function(_Loaded value)? loaded,
    TResult? Function(_Success value)? success,
    TResult? Function(_SuccessMsg value)? successMsg,
    TResult? Function(_Error value)? error,
  }) {
    return error?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_Initial value)? initial,
    TResult Function(_Loading value)? loading,
    TResult Function(_Loaded value)? loaded,
    TResult Function(_Success value)? success,
    TResult Function(_SuccessMsg value)? successMsg,
    TResult Function(_Error value)? error,
    required TResult orElse(),
  }) {
    if (error != null) {
      return error(this);
    }
    return orElse();
  }
}

abstract class _Error implements OrderFormState {
  const factory _Error(final String message) = _$ErrorImpl;

  String get message;

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$ErrorImplCopyWith<_$ErrorImpl> get copyWith =>
      throw _privateConstructorUsedError;
}
