initial vibecoded release

This commit is contained in:
cyberbread-ru
2026-05-15 16:35:12 +04:00
commit 993478e6e3
78 changed files with 3044 additions and 0 deletions
+66
View File
@@ -0,0 +1,66 @@
class Note {
final String id;
final String title;
final String content;
final DateTime createdAt;
final DateTime updatedAt;
const Note({
required this.id,
required this.title,
required this.content,
required this.createdAt,
required this.updatedAt,
});
Note copyWith({
String? title,
String? content,
DateTime? updatedAt,
}) {
return Note(
id: id,
title: title ?? this.title,
content: content ?? this.content,
createdAt: createdAt,
updatedAt: updatedAt ?? this.updatedAt,
);
}
Map<String, dynamic> toJson() => {
'id': id,
'title': title,
'content': content,
'created_at': createdAt.toIso8601String(),
'updated_at': updatedAt.toIso8601String(),
};
factory Note.fromJson(Map<String, dynamic> json) => Note(
id: json['id'] as String,
title: json['title'] as String,
content: json['content'] as String,
createdAt: DateTime.parse(json['created_at'] as String),
updatedAt: DateTime.parse(json['updated_at'] as String),
);
// SQLite row → Note
factory Note.fromMap(Map<String, dynamic> map) => Note(
id: map['id'] as String,
title: map['title'] as String,
content: map['content'] as String,
createdAt: DateTime.parse(map['created_at'] as String),
updatedAt: DateTime.parse(map['updated_at'] as String),
);
// Note → SQLite row
Map<String, dynamic> toMap() => {
'id': id,
'title': title,
'content': content,
'created_at': createdAt.toIso8601String(),
'updated_at': updatedAt.toIso8601String(),
};
@override
String toString() => 'Note(id: $id, title: $title)';
}