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>
56 lines
1.5 KiB
Dart
56 lines
1.5 KiB
Dart
import 'archivo_adjunto.dart';
|
|
import 'gps_location.dart';
|
|
|
|
class Contenedor {
|
|
final String hash;
|
|
final String? titulo;
|
|
final String? descripcion;
|
|
final List<ArchivoAdjunto> archivos;
|
|
final GpsLocation? gps;
|
|
final List<String> etiquetas;
|
|
final DateTime createdAt;
|
|
|
|
Contenedor({
|
|
required this.hash,
|
|
this.titulo,
|
|
this.descripcion,
|
|
List<ArchivoAdjunto>? archivos,
|
|
this.gps,
|
|
List<String>? etiquetas,
|
|
DateTime? createdAt,
|
|
}) : archivos = archivos ?? [],
|
|
etiquetas = etiquetas ?? [],
|
|
createdAt = createdAt ?? DateTime.now();
|
|
|
|
Contenedor copyWith({
|
|
String? hash,
|
|
String? titulo,
|
|
String? descripcion,
|
|
List<ArchivoAdjunto>? archivos,
|
|
GpsLocation? gps,
|
|
List<String>? etiquetas,
|
|
DateTime? createdAt,
|
|
}) =>
|
|
Contenedor(
|
|
hash: hash ?? this.hash,
|
|
titulo: titulo ?? this.titulo,
|
|
descripcion: descripcion ?? this.descripcion,
|
|
archivos: archivos ?? this.archivos,
|
|
gps: gps ?? this.gps,
|
|
etiquetas: etiquetas ?? this.etiquetas,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
'hash': hash,
|
|
if (titulo != null) 'titulo': titulo,
|
|
if (descripcion != null) 'descripcion': descripcion,
|
|
'etiquetas': etiquetas,
|
|
if (gps != null) 'gps': gps!.toJson(),
|
|
'archivos': archivos.map((a) => a.toJson()).toList(),
|
|
};
|
|
|
|
bool get isEmpty => archivos.isEmpty && etiquetas.isEmpty && titulo == null;
|
|
int get archivoCount => archivos.length;
|
|
}
|