- Fixed test file import paths to point to correct Bloc file locations - Fixed Bloc file import paths for models (../../../models/models.dart) - Added explicit type annotations to resolve null safety warnings - Fixed null safety issues in wishlist_bloc_test.dart - All 70 tests now passing
42 lines
1.0 KiB
Dart
42 lines
1.0 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
|
|
class ScannerState extends Equatable {
|
|
final bool isScanning;
|
|
final bool isProcessing;
|
|
final Map<String, dynamic>? detectedBookData;
|
|
final String? errorMessage;
|
|
|
|
const ScannerState({
|
|
this.isScanning = false,
|
|
this.isProcessing = false,
|
|
this.detectedBookData,
|
|
this.errorMessage,
|
|
});
|
|
|
|
factory ScannerState.initial() {
|
|
return const ScannerState();
|
|
}
|
|
|
|
ScannerState copyWith({
|
|
bool? isScanning,
|
|
bool? isProcessing,
|
|
Map<String, dynamic>? detectedBookData,
|
|
String? errorMessage,
|
|
bool clearDetectedBookData = false,
|
|
}) {
|
|
return ScannerState(
|
|
isScanning: isScanning ?? this.isScanning,
|
|
isProcessing: isProcessing ?? this.isProcessing,
|
|
detectedBookData: clearDetectedBookData ? null : (detectedBookData ?? this.detectedBookData),
|
|
errorMessage: errorMessage ?? this.errorMessage,
|
|
);
|
|
}
|
|
|
|
@override
|
|
List<Object?> get props => [
|
|
isScanning,
|
|
isProcessing,
|
|
detectedBookData,
|
|
errorMessage,
|
|
];
|
|
} |