- Add offline-first SQLite architecture with DatabaseHelper singleton, 12 CREATE TABLE statements and full seed data on first launch - Add 10 models (fromMap/toMap) and 12 DAOs with CRUD + getPendientes() - Add ApiAuthService (JWT via SharedPreferences) and Sincronizador skeleton - Move login auth from SQLite to SharedPreferences with SHA-256 PIN hash; default PIN 123456, platform-independent (no native plugin required) - Add seguridad_page.dart: change PIN form (current → new → confirm) - Add Cerrar Sesión with confirmation dialog and full stack clear - Redesign settings_page.dart with AppColors dark theme; add Sistema section with "Inicializar base de datos" and "Inicializar sincronización" - Fix Linux desktop: sqflite_common_ffi with platform detection in DatabaseHelper - Fix ScrollController conflict on Linux: primary: false on all IndexedStack pages - Update plan_proyecto.md with session 2–3 progress and auth roadmap Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
875 B
Dart
36 lines
875 B
Dart
class Mensaje {
|
|
final int? id;
|
|
final String texto;
|
|
final bool esMio;
|
|
final String hora;
|
|
final String timestamp;
|
|
final bool sincronizado;
|
|
|
|
const Mensaje({
|
|
this.id,
|
|
required this.texto,
|
|
required this.esMio,
|
|
required this.hora,
|
|
required this.timestamp,
|
|
this.sincronizado = false,
|
|
});
|
|
|
|
factory Mensaje.fromMap(Map<String, dynamic> m) => Mensaje(
|
|
id: m['id'] as int?,
|
|
texto: m['texto'] as String,
|
|
esMio: (m['es_mio'] as int) == 1,
|
|
hora: m['hora'] as String,
|
|
timestamp: m['timestamp'] as String,
|
|
sincronizado: (m['sincronizado'] as int) == 1,
|
|
);
|
|
|
|
Map<String, dynamic> toMap() => {
|
|
if (id != null) 'id': id,
|
|
'texto': texto,
|
|
'es_mio': esMio ? 1 : 0,
|
|
'hora': hora,
|
|
'timestamp': timestamp,
|
|
'sincronizado': sincronizado ? 1 : 0,
|
|
};
|
|
}
|