import 'package:equatable/equatable.dart';
import 'package:laki_icu_app/models/bo/bluetooth_read_model.dart';

class BluetoothReadState extends Equatable {
  final BluetoothReadModel info;
  final bool isLoading;
  final String? error;

  const BluetoothReadState({
    this.info = BluetoothReadModel.empty,
    this.isLoading = false,
    this.error,
  });

  BluetoothReadState copyWith({
    BluetoothReadModel? info,
    bool? isLoading,
    String? error,
    bool clearError = false,
  }) {
    return BluetoothReadState(
      info: info ?? this.info,
      isLoading: isLoading ?? this.isLoading,
      error: clearError ? null : error ?? this.error,
    );
  }

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