mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-03-11 21:35:32 +00:00
84 lines
1.8 KiB
Dart
84 lines
1.8 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;
|
|
|
|
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});
|
|
}
|
|
|
|
@HiveType(typeId: 4)
|
|
enum TypeSource {
|
|
@HiveField(1)
|
|
single,
|
|
@HiveField(2)
|
|
mangathemesia,
|
|
@HiveField(3)
|
|
comick
|
|
}
|
|
|
|
// @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,
|
|
// });
|
|
// }
|