PACKET v1.0.0 - Initial release
App móvil Flutter para capturar contenido multimedia, etiquetarlo con hashes y enviarlo a backends configurables. Features: - Captura de fotos, audio, video y archivos - Sistema de etiquetas con bibliotecas externas (HST) - Packs de etiquetas predefinidos - Cola de reintentos (hasta 20 contenedores) - Soporte GPS - Hash SHA-256 auto-generado por contenedor - Persistencia SQLite local - Múltiples destinos configurables Stack: Flutter 3.38.5, flutter_bloc, sqflite, dio 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
63
lib/presentation/bloc/captura/captura_state.dart
Normal file
63
lib/presentation/bloc/captura/captura_state.dart
Normal file
@@ -0,0 +1,63 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import '../../../domain/entities/contenedor.dart';
|
||||
import '../../../domain/entities/archivo_adjunto.dart';
|
||||
import '../../../domain/entities/gps_location.dart';
|
||||
|
||||
enum CapturaStatus { idle, capturing, sending, success, error }
|
||||
|
||||
class CapturaState extends Equatable {
|
||||
final Contenedor contenedor;
|
||||
final CapturaStatus status;
|
||||
final String? errorMessage;
|
||||
final bool isRecording;
|
||||
|
||||
const CapturaState({
|
||||
required this.contenedor,
|
||||
this.status = CapturaStatus.idle,
|
||||
this.errorMessage,
|
||||
this.isRecording = false,
|
||||
});
|
||||
|
||||
CapturaState copyWith({
|
||||
Contenedor? contenedor,
|
||||
CapturaStatus? status,
|
||||
String? errorMessage,
|
||||
bool? isRecording,
|
||||
}) =>
|
||||
CapturaState(
|
||||
contenedor: contenedor ?? this.contenedor,
|
||||
status: status ?? this.status,
|
||||
errorMessage: errorMessage,
|
||||
isRecording: isRecording ?? this.isRecording,
|
||||
);
|
||||
|
||||
CapturaState addArchivo(ArchivoAdjunto archivo) {
|
||||
return copyWith(
|
||||
contenedor: contenedor.copyWith(
|
||||
archivos: [...contenedor.archivos, archivo],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
CapturaState removeArchivo(int index) {
|
||||
final archivos = [...contenedor.archivos]..removeAt(index);
|
||||
return copyWith(
|
||||
contenedor: contenedor.copyWith(archivos: archivos),
|
||||
);
|
||||
}
|
||||
|
||||
CapturaState setGps(GpsLocation? gps) {
|
||||
return copyWith(
|
||||
contenedor: contenedor.copyWith(gps: gps),
|
||||
);
|
||||
}
|
||||
|
||||
CapturaState setEtiquetas(List<String> etiquetas) {
|
||||
return copyWith(
|
||||
contenedor: contenedor.copyWith(etiquetas: etiquetas),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [contenedor, status, errorMessage, isRecording];
|
||||
}
|
||||
Reference in New Issue
Block a user