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>
21 lines
642 B
Dart
21 lines
642 B
Dart
import '../constants/app_constants.dart';
|
|
|
|
class RetryUtils {
|
|
static DateTime calculateNextRetry(int intentoActual) {
|
|
final delay = RetryDelays.getDelay(intentoActual);
|
|
return DateTime.now().add(delay);
|
|
}
|
|
|
|
static bool shouldRetry(int intentos) {
|
|
return intentos < AppConstants.maxReintentos;
|
|
}
|
|
|
|
static String formatTimeRemaining(DateTime nextRetry) {
|
|
final diff = nextRetry.difference(DateTime.now());
|
|
if (diff.isNegative) return 'Ahora';
|
|
if (diff.inHours > 0) return '${diff.inHours}h ${diff.inMinutes % 60}m';
|
|
if (diff.inMinutes > 0) return '${diff.inMinutes}m';
|
|
return '${diff.inSeconds}s';
|
|
}
|
|
}
|