This commit is contained in:
Moustapha Kodjo Amadou 2025-02-21 22:31:50 +01:00
parent a5af985c2c
commit f841c1adde
5 changed files with 20 additions and 16 deletions

View file

@ -10,11 +10,11 @@ class Category {
bool? forManga;
@enumerated
late ItemType forItemType;
Category(
{this.id = Isar.autoIncrement,
required this.name,
this.forManga = true,
required this.forItemType});
Category({
this.id = Isar.autoIncrement,
required this.name,
required this.forItemType,
});
Category.fromJson(Map<String, dynamic> json) {
id = json['id'];
@ -25,13 +25,17 @@ class Category {
Category.fromJsonV1(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
forItemType = json['forManga'] is bool
? json['forManga'] == true
? ItemType.manga
: ItemType.anime
: ItemType.manga;
forItemType =
json['forManga'] is bool
? json['forManga'] == true
? ItemType.manga
: ItemType.anime
: ItemType.manga;
}
Map<String, dynamic> toJson() =>
{'id': id, 'name': name, 'forItemType': forItemType.index};
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'forItemType': forItemType.index,
};
}

View file

@ -84,10 +84,10 @@ Category _categoryDeserialize(
forItemType:
_CategoryforItemTypeValueEnumMap[reader.readByteOrNull(offsets[0])] ??
ItemType.manga,
forManga: reader.readBoolOrNull(offsets[1]),
id: id,
name: reader.readStringOrNull(offsets[2]),
);
object.forManga = reader.readBoolOrNull(offsets[1]);
return object;
}

View file

@ -6,7 +6,7 @@ part of 'router.dart';
// RiverpodGenerator
// **************************************************************************
String _$routerHash() => r'7a4e8651b0f12561ff4be5ca85a0142ab64a3da3';
String _$routerHash() => r'52271f834e5242820afdb209d765c3cee8f3fe5b';
/// See also [router].
@ProviderFor(router)

View file

@ -6,7 +6,7 @@ part of 'aniskip.dart';
// RiverpodGenerator
// **************************************************************************
String _$aniSkipHash() => r'2e5d19b025a2207ff64da7bf7908450ea9e5ff8c';
String _$aniSkipHash() => r'887869b54e2e151633efd46da83bde845e14f421';
/// See also [AniSkip].
@ProviderFor(AniSkip)

View file

@ -6,7 +6,7 @@ part of 'anilist.dart';
// RiverpodGenerator
// **************************************************************************
String _$anilistHash() => r'ddd07acc8d28d2aa95c942566109e9393ca9e5ed';
String _$anilistHash() => r'70e8cd537270a9054a1ef72de117fc7ad5545218';
/// Copied from Dart SDK
class _SystemHash {