mangayomi-mirror/lib/source/source_model.dart
2023-04-26 12:55:13 +01:00

90 lines
1.9 KiB
Dart

import 'package:hive/hive.dart';
part 'source_model.g.dart';
@HiveType(typeId: 3)
class SourceModel extends HiveObject {
@HiveField(0)
final String sourceName;
@HiveField(1)
final String url;
@HiveField(2)
final String lang;
@HiveField(3, defaultValue: true)
final bool isActive;
@HiveField(4, defaultValue: false)
final bool isAdded;
@HiveField(5, defaultValue: false)
final bool isNsfw;
@HiveField(6)
final TypeSource typeSource;
@HiveField(7)
final String logoUrl;
@HiveField(8, defaultValue: false)
final bool isFullData;
@HiveField(9, defaultValue: false)
final bool isCloudflare;
SourceModel({
required this.sourceName,
required this.url,
required this.lang,
required this.typeSource,
required this.logoUrl,
this.isActive = true,
this.isAdded = false,
this.isNsfw = false,
this.isFullData = false,
this.isCloudflare = false,
});
}
@HiveType(typeId: 4)
enum TypeSource {
@HiveField(1)
single,
@HiveField(2)
mangathemesia,
@HiveField(3)
comick,
@HiveField(4)
mmrcms
}
// @HiveType(typeId: 3)
// class SourceModel {
// @HiveField(0, defaultValue: true)
// final bool isActive;
// @HiveField(1)
// final Source source;
// @HiveField(2)
// SourceModel(
// this.source, {
// this.isActive = true,
// });
// }
// @HiveType(typeId: 4)
// class Source {
// @HiveField(0)
// final String sourceName;
// @HiveField(1)
// final String url;
// @HiveField(2)
// final String lang;
// @HiveField(3, defaultValue: true)
// final bool isActive;
// @HiveField(4, defaultValue: false)
// final bool isAdded;
// @HiveField(5, defaultValue: false)
// final bool isNsfw;
// final TypeSource typeSource;
// Source(
// this.sourceName,
// this.url,
// this.lang,
// this.typeSource, {
// this.isActive = true,
// this.isAdded = false,
// this.isNsfw = false,
// });
// }