Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove reader bottomsheet #149

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/src/constants/enum.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ enum MangaSort {

enum ChapterSort {
source,
uploadDate,
fetchedDate;

String toLocale(BuildContext context) {
Expand All @@ -110,6 +111,8 @@ enum ChapterSort {
return context.l10n!.chapterSortSource;
case ChapterSort.fetchedDate:
return context.l10n!.chapterSortFetchedDate;
case ChapterSort.uploadDate:
return context.l10n!.chapterSortUploadDate;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class CategoryMangaListWithQueryAndFilter
final mangaFilterDownloaded =
ref.watch(libraryMangaFilterDownloadedProvider);
final mangaFilterCompleted = ref.watch(libraryMangaFilterCompletedProvider);
final sortedBy = ref.watch(libraryMangaSortProvider);
final MangaSort sortedBy =
ref.watch(libraryMangaSortProvider) ?? DBKeys.mangaSort.initial;
final sortedDirection =
ref.watch(libraryMangaSortDirectionProvider).ifNull(true);

Expand Down Expand Up @@ -89,8 +90,6 @@ class CategoryMangaListWithQueryAndFilter
case MangaSort.lastRead:
return (m2.lastReadAt ?? 0).compareTo(m1.lastReadAt ?? 0) *
sortDirToggle;
default:
return 0;
}
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/src/features/manga_book/domain/manga/manga_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Manga with _$Manga {
@JsonKey(fromJson: MangaStatus.fromJson, toJson: MangaStatus.toJson)
MangaStatus? status,
String? thumbnailUrl,
int? thumbnailUrlLastFetched,
String? title,
int? unreadCount,
int? lastFetchedAt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ mixin _$Manga {
@JsonKey(fromJson: MangaStatus.fromJson, toJson: MangaStatus.toJson)
MangaStatus? get status => throw _privateConstructorUsedError;
String? get thumbnailUrl => throw _privateConstructorUsedError;
int? get thumbnailUrlLastFetched => throw _privateConstructorUsedError;
String? get title => throw _privateConstructorUsedError;
int? get unreadCount => throw _privateConstructorUsedError;
int? get lastFetchedAt => throw _privateConstructorUsedError;
Expand Down Expand Up @@ -76,6 +77,7 @@ abstract class $MangaCopyWith<$Res> {
@JsonKey(fromJson: MangaStatus.fromJson, toJson: MangaStatus.toJson)
MangaStatus? status,
String? thumbnailUrl,
int? thumbnailUrlLastFetched,
String? title,
int? unreadCount,
int? lastFetchedAt,
Expand Down Expand Up @@ -119,6 +121,7 @@ class _$MangaCopyWithImpl<$Res, $Val extends Manga>
Object? sourceId = freezed,
Object? status = freezed,
Object? thumbnailUrl = freezed,
Object? thumbnailUrlLastFetched = freezed,
Object? title = freezed,
Object? unreadCount = freezed,
Object? lastFetchedAt = freezed,
Expand Down Expand Up @@ -199,6 +202,10 @@ class _$MangaCopyWithImpl<$Res, $Val extends Manga>
? _value.thumbnailUrl
: thumbnailUrl // ignore: cast_nullable_to_non_nullable
as String?,
thumbnailUrlLastFetched: freezed == thumbnailUrlLastFetched
? _value.thumbnailUrlLastFetched
: thumbnailUrlLastFetched // ignore: cast_nullable_to_non_nullable
as int?,
title: freezed == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -289,6 +296,7 @@ abstract class _$$_MangaCopyWith<$Res> implements $MangaCopyWith<$Res> {
@JsonKey(fromJson: MangaStatus.fromJson, toJson: MangaStatus.toJson)
MangaStatus? status,
String? thumbnailUrl,
int? thumbnailUrlLastFetched,
String? title,
int? unreadCount,
int? lastFetchedAt,
Expand Down Expand Up @@ -331,6 +339,7 @@ class __$$_MangaCopyWithImpl<$Res> extends _$MangaCopyWithImpl<$Res, _$_Manga>
Object? sourceId = freezed,
Object? status = freezed,
Object? thumbnailUrl = freezed,
Object? thumbnailUrlLastFetched = freezed,
Object? title = freezed,
Object? unreadCount = freezed,
Object? lastFetchedAt = freezed,
Expand Down Expand Up @@ -411,6 +420,10 @@ class __$$_MangaCopyWithImpl<$Res> extends _$MangaCopyWithImpl<$Res, _$_Manga>
? _value.thumbnailUrl
: thumbnailUrl // ignore: cast_nullable_to_non_nullable
as String?,
thumbnailUrlLastFetched: freezed == thumbnailUrlLastFetched
? _value.thumbnailUrlLastFetched
: thumbnailUrlLastFetched // ignore: cast_nullable_to_non_nullable
as int?,
title: freezed == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -462,6 +475,7 @@ class _$_Manga implements _Manga {
@JsonKey(fromJson: MangaStatus.fromJson, toJson: MangaStatus.toJson)
this.status,
this.thumbnailUrl,
this.thumbnailUrlLastFetched,
this.title,
this.unreadCount,
this.lastFetchedAt,
Expand Down Expand Up @@ -519,6 +533,8 @@ class _$_Manga implements _Manga {
@override
final String? thumbnailUrl;
@override
final int? thumbnailUrlLastFetched;
@override
final String? title;
@override
final int? unreadCount;
Expand All @@ -533,7 +549,7 @@ class _$_Manga implements _Manga {

@override
String toString() {
return 'Manga(artist: $artist, author: $author, description: $description, downloadCount: $downloadCount, chapterCount: $chapterCount, lastReadAt: $lastReadAt, lastChapterRead: $lastChapterRead, freshData: $freshData, genre: $genre, inLibrary: $inLibrary, id: $id, inLibraryAt: $inLibraryAt, initialized: $initialized, realUrl: $realUrl, source: $source, sourceId: $sourceId, status: $status, thumbnailUrl: $thumbnailUrl, title: $title, unreadCount: $unreadCount, lastFetchedAt: $lastFetchedAt, chaptersLastFetchedAt: $chaptersLastFetchedAt, url: $url, meta: $meta)';
return 'Manga(artist: $artist, author: $author, description: $description, downloadCount: $downloadCount, chapterCount: $chapterCount, lastReadAt: $lastReadAt, lastChapterRead: $lastChapterRead, freshData: $freshData, genre: $genre, inLibrary: $inLibrary, id: $id, inLibraryAt: $inLibraryAt, initialized: $initialized, realUrl: $realUrl, source: $source, sourceId: $sourceId, status: $status, thumbnailUrl: $thumbnailUrl, thumbnailUrlLastFetched: $thumbnailUrlLastFetched, title: $title, unreadCount: $unreadCount, lastFetchedAt: $lastFetchedAt, chaptersLastFetchedAt: $chaptersLastFetchedAt, url: $url, meta: $meta)';
}

@override
Expand Down Expand Up @@ -570,6 +586,9 @@ class _$_Manga implements _Manga {
(identical(other.status, status) || other.status == status) &&
(identical(other.thumbnailUrl, thumbnailUrl) ||
other.thumbnailUrl == thumbnailUrl) &&
(identical(
other.thumbnailUrlLastFetched, thumbnailUrlLastFetched) ||
other.thumbnailUrlLastFetched == thumbnailUrlLastFetched) &&
(identical(other.title, title) || other.title == title) &&
(identical(other.unreadCount, unreadCount) ||
other.unreadCount == unreadCount) &&
Expand Down Expand Up @@ -603,6 +622,7 @@ class _$_Manga implements _Manga {
sourceId,
status,
thumbnailUrl,
thumbnailUrlLastFetched,
title,
unreadCount,
lastFetchedAt,
Expand Down Expand Up @@ -646,6 +666,7 @@ abstract class _Manga implements Manga {
@JsonKey(fromJson: MangaStatus.fromJson, toJson: MangaStatus.toJson)
final MangaStatus? status,
final String? thumbnailUrl,
final int? thumbnailUrlLastFetched,
final String? title,
final int? unreadCount,
final int? lastFetchedAt,
Expand Down Expand Up @@ -693,6 +714,8 @@ abstract class _Manga implements Manga {
@override
String? get thumbnailUrl;
@override
int? get thumbnailUrlLastFetched;
@override
String? get title;
@override
int? get unreadCount;
Expand Down
2 changes: 2 additions & 0 deletions lib/src/features/manga_book/domain/manga/manga_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ AsyncValue<List<Chapter>?> mangaChapterListWithFilter(
final chapterFilterDownloaded =
ref.watch(mangaChapterFilterDownloadedProvider);
final chapterFilterBookmark = ref.watch(mangaChapterFilterBookmarkedProvider);
final sortedBy = ref.watch(mangaChapterSortProvider);
final ChapterSort sortedBy = ref.watch(mangaChapterSortProvider) ??
DBKeys.chapterSortDirection.initial;
final sortedDirection =
ref.watch(mangaChapterSortDirectionProvider).ifNull(true);

Expand Down Expand Up @@ -126,8 +127,9 @@ AsyncValue<List<Chapter>?> mangaChapterListWithFilter(
return (m1.fetchedAt ?? 0).compareTo(m2.fetchedAt ?? 0) * sortDirToggle;
case ChapterSort.source:
return (m1.index ?? 0).compareTo(m2.index ?? 0) * sortDirToggle;
default:
return 0;
case ChapterSort.uploadDate:
return (m1.uploadDate ?? 0).compareTo(m2.uploadDate ?? 0) *
sortDirToggle;
}
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class MangaChapterSort extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
return ListView(
children: const [
Divider(height: .5),
MangaChapterSortTile(sortType: ChapterSort.source),
MangaChapterSortTile(sortType: ChapterSort.fetchedDate),
children: [
const Divider(height: .5),
for (ChapterSort chapterSort in ChapterSort.values)
MangaChapterSortTile(sortType: chapterSort),
],
);
}
Expand Down
Loading