Jisho-Study-Tool/lib/models/history/search_string.dart

26 lines
469 B
Dart
Raw Normal View History

2021-07-17 16:11:17 +02:00
import 'package:objectbox/objectbox.dart';
2021-07-19 01:49:18 +02:00
import 'package:jisho_study_tool/models/history/word_result.dart';
2021-07-17 16:11:17 +02:00
@Entity()
2021-07-19 01:49:18 +02:00
class SearchString {
2021-07-17 16:11:17 +02:00
int id = 0;
@Property(type: PropertyType.date)
DateTime timestamp;
String query;
2021-07-19 01:49:18 +02:00
@Backlink()
final chosenResults = ToMany<WordResult>();
2021-07-17 16:11:17 +02:00
2021-07-19 01:49:18 +02:00
SearchString({
2021-07-26 21:39:17 +02:00
required this.timestamp,
required this.query,
2021-07-17 16:11:17 +02:00
});
@override
String toString() {
2021-07-19 01:49:18 +02:00
return "[${timestamp.toIso8601String()}] \"$query\"";
2021-07-17 16:11:17 +02:00
}
}