feat: initial release of Oracle 999 divination app

This commit is contained in:
Alma Alexyz
2026-08-31 12:35:13 +05:00
commit 28b85061b9
143 changed files with 16073 additions and 0 deletions
+69
View File
@@ -0,0 +1,69 @@
class WordItem {
final int id; // Base index 0..999
final int sessionNumber; // Dynamic randomized session number 0..999
final String word;
final String partOfSpeech;
final double frequency;
final String category;
final String description;
const WordItem({
required this.id,
this.sessionNumber = 0,
required this.word,
required this.partOfSpeech,
required this.frequency,
this.category = '',
this.description = '',
});
WordItem copyWith({
int? id,
int? sessionNumber,
String? word,
String? partOfSpeech,
double? frequency,
String? category,
String? description,
}) {
return WordItem(
id: id ?? this.id,
sessionNumber: sessionNumber ?? this.sessionNumber,
word: word ?? this.word,
partOfSpeech: partOfSpeech ?? this.partOfSpeech,
frequency: frequency ?? this.frequency,
category: category ?? this.category,
description: description ?? this.description,
);
}
String get formattedSessionNumber => sessionNumber.toString().padLeft(3, '0');
String get formattedId => formattedSessionNumber;
Map<String, dynamic> toMap() {
return {
'id': id,
'sessionNumber': sessionNumber,
'word': word,
'partOfSpeech': partOfSpeech,
'frequency': frequency,
'category': category,
'description': description,
};
}
factory WordItem.fromMap(Map<String, dynamic> map) {
return WordItem(
id: map['id'] as int,
sessionNumber: map['sessionNumber'] as int? ?? (map['id'] as int),
word: map['word'] as String,
partOfSpeech: map['partOfSpeech'] as String,
frequency: (map['frequency'] as num).toDouble(),
category: map['category'] as String? ?? '',
description: map['description'] as String? ?? '',
);
}
@override
String toString() => '#$formattedSessionNumber: $word ($partOfSpeech)';
}