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-17 16:11:17 +02:00
|
|
|
this.timestamp,
|
|
|
|
this.query,
|
|
|
|
});
|
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() {
|
2021-07-19 01:49:18 +02:00
|
|
|
return "[${timestamp.toIso8601String()}] \"$query\"";
|
2021-07-17 16:11:17 +02:00
|
|
|
}
|
|
|
|
}
|