Fix import paths and test issues
- 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
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
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,
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user