// Model: Note // - Representa una nota guardada en la app. // - `id` viene de SQLite y sirve como identificador estable. // - `index` representa el orden visual dentro de la lista. class Note { const Note({ this.id, required this.title, required this.body, required this.createdAt, required this.updatedAt, required this.index, }); final int? id; final String title; final String body; final DateTime createdAt; final DateTime updatedAt; final int index; Note copyWith({ int? id, String? title, String? body, DateTime? createdAt, DateTime? updatedAt, int? index, }) { return Note( id: id ?? this.id, title: title ?? this.title, body: body ?? this.body, createdAt: createdAt ?? this.createdAt, updatedAt: updatedAt ?? this.updatedAt, index: index ?? this.index, ); } @override bool operator ==(Object other) { if (identical(this, other)) { return true; } return other is Note && id != null && other.id == id; } @override int get hashCode => id?.hashCode ?? Object.hash(title, body, createdAt, updatedAt, index); }