mangayomi/lib/models/history.dart
2024-11-05 14:55:54 +00:00

44 lines
859 B
Dart

import 'package:isar/isar.dart';
import 'package:mangayomi/models/chapter.dart';
import 'package:mangayomi/models/manga.dart';
part 'history.g.dart';
@collection
@Name("History")
class History {
Id? id;
int? mangaId;
int? chapterId;
ItemType? itemType;
final chapter = IsarLink<Chapter>();
String? date;
History({
this.id = Isar.autoIncrement,
required this.itemType,
required this.chapterId,
required this.mangaId,
required this.date,
});
History.fromJson(Map<String, dynamic> json) {
chapterId = json['chapterId'];
date = json['date'];
id = json['id'];
itemType = json['itemType'];
mangaId = json['mangaId'];
}
Map<String, dynamic> toJson() => {
'chapterId': chapterId,
'date': date,
'id': id,
'itemType': itemType,
'mangaId': mangaId
};
}