From 2ce5a1a14632ba2404d2fbeeef44a87b86fd0ab6 Mon Sep 17 00:00:00 2001 From: DattatreyaReddy Panta <58727124+DattatreyaReddy@users.noreply.github.com> Date: Wed, 1 Feb 2023 20:53:32 +0530 Subject: [PATCH] V0.3.6 (#108) * bug fixed * bug fixes * version update --- .../source_manga_display_icon_popup.dart | 2 +- .../widgets/library_manga_display.dart | 2 +- .../reader/widgets/page_number_slider.dart | 2 +- .../reader/widgets/reader_wrapper.dart | 2 +- .../widgets/chapter_manga_list_tile.dart | 106 +++++++++--------- .../widgets/loading_popup_icon_button.dart | 2 +- .../presentation/general/general_screen.dart | 2 +- .../reader_mode_tile/reader_mode_tile.dart | 2 +- .../reader_navigation_layout_tile.dart | 2 +- .../server/widget/auth_type_tile.dart | 2 +- .../theme_mode_tile/theme_mode_tile.dart | 2 +- lib/src/utils/storage/dio_error_util.dart | 5 +- ...{list_popup.dart => radio_list_popup.dart} | 0 pubspec.yaml | 2 +- 14 files changed, 69 insertions(+), 64 deletions(-) rename lib/src/widgets/{list_popup.dart => radio_list_popup.dart} (100%) diff --git a/lib/src/features/browse_center/presentation/source_manga_list/widgets/source_manga_display_icon_popup.dart b/lib/src/features/browse_center/presentation/source_manga_list/widgets/source_manga_display_icon_popup.dart index 046ad91a..d3ec012a 100644 --- a/lib/src/features/browse_center/presentation/source_manga_list/widgets/source_manga_display_icon_popup.dart +++ b/lib/src/features/browse_center/presentation/source_manga_list/widgets/source_manga_display_icon_popup.dart @@ -13,7 +13,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import '../../../../../constants/db_keys.dart'; import '../../../../../constants/enum.dart'; import '../../../../../i18n/locale_keys.g.dart'; -import '../../../../../widgets/list_popup.dart'; +import '../../../../../widgets/radio_list_popup.dart'; import '../controller/source_manga_controller.dart'; class SourceMangaDisplayIconPopup extends ConsumerWidget { diff --git a/lib/src/features/library/presentation/library/widgets/library_manga_display.dart b/lib/src/features/library/presentation/library/widgets/library_manga_display.dart index d4803716..ccf15d97 100644 --- a/lib/src/features/library/presentation/library/widgets/library_manga_display.dart +++ b/lib/src/features/library/presentation/library/widgets/library_manga_display.dart @@ -13,8 +13,8 @@ import '../../../../../constants/enum.dart'; import '../../../../../i18n/locale_keys.g.dart'; import '../../../../../utils/extensions/custom_extensions.dart'; import '../../../../../widgets/custom_checkbox_list_tile.dart'; -import '../../../../../widgets/list_popup.dart'; import '../../../../../widgets/manga_cover/providers/manga_cover_providers.dart'; +import '../../../../../widgets/radio_list_popup.dart'; import '../controller/library_controller.dart'; class LibraryMangaDisplay extends ConsumerWidget { diff --git a/lib/src/features/manga_book/presentation/reader/widgets/page_number_slider.dart b/lib/src/features/manga_book/presentation/reader/widgets/page_number_slider.dart index 6be2f798..aac23a46 100644 --- a/lib/src/features/manga_book/presentation/reader/widgets/page_number_slider.dart +++ b/lib/src/features/manga_book/presentation/reader/widgets/page_number_slider.dart @@ -35,7 +35,7 @@ class PageNumberSlider extends StatelessWidget { value: min(currentValue.toDouble(), maxValue.toDouble()), min: 0, max: maxValue.toDouble() - 1, - divisions: max(maxValue, 1) - 1, + divisions: max(maxValue - 1, 1), onChanged: (val) => onChanged(val.toInt()), ), ), diff --git a/lib/src/features/manga_book/presentation/reader/widgets/reader_wrapper.dart b/lib/src/features/manga_book/presentation/reader/widgets/reader_wrapper.dart index 02ca5689..0941429c 100644 --- a/lib/src/features/manga_book/presentation/reader/widgets/reader_wrapper.dart +++ b/lib/src/features/manga_book/presentation/reader/widgets/reader_wrapper.dart @@ -16,7 +16,7 @@ import '../../../../../constants/enum.dart'; import '../../../../../i18n/locale_keys.g.dart'; import '../../../../../routes/router_config.dart'; import '../../../../../utils/extensions/custom_extensions.dart'; -import '../../../../../widgets/list_popup.dart'; +import '../../../../../widgets/radio_list_popup.dart'; import '../../../data/manga_book_repository.dart'; import '../../../domain/chapter/chapter_model.dart'; import '../../../domain/chapter_patch/chapter_put_model.dart'; diff --git a/lib/src/features/manga_book/presentation/updates/widgets/chapter_manga_list_tile.dart b/lib/src/features/manga_book/presentation/updates/widgets/chapter_manga_list_tile.dart index d4f60926..bdccb8d5 100644 --- a/lib/src/features/manga_book/presentation/updates/widgets/chapter_manga_list_tile.dart +++ b/lib/src/features/manga_book/presentation/updates/widgets/chapter_manga_list_tile.dart @@ -34,61 +34,65 @@ class ChapterMangaListTile extends StatelessWidget { @override Widget build(BuildContext context) { final color = (pair.chapter?.read).ifNull() ? Colors.grey : null; - return ListTile( - title: Row( - mainAxisSize: MainAxisSize.min, - children: [ - if (pair.chapter?.bookmarked ?? false) ...[ - const Icon(Icons.bookmark, size: 20), - KSizedBox.w4.size, - ], - Expanded( - child: Text( - pair.manga?.title ?? "", - style: TextStyle(color: color), + return GestureDetector( + onSecondaryTap: + pair.chapter != null ? () => toggleSelect(pair.chapter!) : null, + child: ListTile( + title: Row( + mainAxisSize: MainAxisSize.min, + children: [ + if (pair.chapter?.bookmarked ?? false) ...[ + const Icon(Icons.bookmark, size: 20), + KSizedBox.w4.size, + ], + Expanded( + child: Text( + pair.manga?.title ?? "", + style: TextStyle(color: color), + ), ), + ], + ), + leading: ClipRRect( + borderRadius: BorderRadius.circular(8), + child: ServerImage( + imageUrl: pair.manga?.thumbnailUrl ?? "", + size: const Size.square(48), ), - ], - ), - leading: ClipRRect( - borderRadius: BorderRadius.circular(8), - child: ServerImage( - imageUrl: pair.manga?.thumbnailUrl ?? "", - size: const Size.square(48), ), - ), - subtitle: Text( - pair.chapter?.name ?? pair.chapter?.chapterNumber.toString() ?? "", - style: TextStyle(color: color), - ), - trailing: (pair.manga?.id != null && pair.chapter?.index != null) - ? DownloadStatusIcon( - isDownloaded: pair.chapter?.downloaded ?? false, - mangaId: pair.manga!.id!, - chapter: pair.chapter!, - updateData: updatePair, - ) - : null, - selectedColor: context.theme.colorScheme.onSurface, - selectedTileColor: - context.isDarkMode ? Colors.grey.shade700 : Colors.grey.shade300, - selected: isSelected, - onTap: pair.chapter != null && pair.manga != null - ? () { - if (canTapSelect) { - toggleSelect(pair.chapter!); - } else { - context.push( - Routes.getReader( - "${pair.manga!.id}", - "${pair.chapter!.index}", - ), - ); + subtitle: Text( + pair.chapter?.name ?? pair.chapter?.chapterNumber.toString() ?? "", + style: TextStyle(color: color), + ), + trailing: (pair.manga?.id != null && pair.chapter?.index != null) + ? DownloadStatusIcon( + isDownloaded: pair.chapter?.downloaded ?? false, + mangaId: pair.manga!.id!, + chapter: pair.chapter!, + updateData: updatePair, + ) + : null, + selectedColor: context.theme.colorScheme.onSurface, + selectedTileColor: + context.isDarkMode ? Colors.grey.shade700 : Colors.grey.shade300, + selected: isSelected, + onTap: pair.chapter != null && pair.manga != null + ? () { + if (canTapSelect) { + toggleSelect(pair.chapter!); + } else { + context.push( + Routes.getReader( + "${pair.manga!.id}", + "${pair.chapter!.index}", + ), + ); + } } - } - : null, - onLongPress: - pair.chapter != null ? () => toggleSelect(pair.chapter!) : null, + : null, + onLongPress: + pair.chapter != null ? () => toggleSelect(pair.chapter!) : null, + ), ); } } diff --git a/lib/src/features/manga_book/widgets/loading_popup_icon_button.dart b/lib/src/features/manga_book/widgets/loading_popup_icon_button.dart index d7085a4b..63fe4367 100644 --- a/lib/src/features/manga_book/widgets/loading_popup_icon_button.dart +++ b/lib/src/features/manga_book/widgets/loading_popup_icon_button.dart @@ -10,7 +10,7 @@ import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:go_router/go_router.dart'; import '../../../widgets/custom_circular_progress_indicator.dart'; -import '../../../widgets/list_popup.dart'; +import '../../../widgets/radio_list_popup.dart'; class LoadingEnumPopupIconButton extends HookWidget { const LoadingEnumPopupIconButton({ diff --git a/lib/src/features/settings/presentation/general/general_screen.dart b/lib/src/features/settings/presentation/general/general_screen.dart index 02359fb2..9cd50ac5 100644 --- a/lib/src/features/settings/presentation/general/general_screen.dart +++ b/lib/src/features/settings/presentation/general/general_screen.dart @@ -10,7 +10,7 @@ import 'package:go_router/go_router.dart'; import '../../../../constants/language_list.dart'; import '../../../../i18n/locale_keys.g.dart'; -import '../../../../widgets/list_popup.dart'; +import '../../../../widgets/radio_list_popup.dart'; class GeneralScreen extends StatelessWidget { const GeneralScreen({super.key}); diff --git a/lib/src/features/settings/presentation/reader/widgets/reader_mode_tile/reader_mode_tile.dart b/lib/src/features/settings/presentation/reader/widgets/reader_mode_tile/reader_mode_tile.dart index 7f49bd3d..9d00c613 100644 --- a/lib/src/features/settings/presentation/reader/widgets/reader_mode_tile/reader_mode_tile.dart +++ b/lib/src/features/settings/presentation/reader/widgets/reader_mode_tile/reader_mode_tile.dart @@ -14,7 +14,7 @@ import '../../../../../../constants/db_keys.dart'; import '../../../../../../constants/enum.dart'; import '../../../../../../i18n/locale_keys.g.dart'; import '../../../../../../utils/storage/local/shared_preferences_client.dart'; -import '../../../../../../widgets/list_popup.dart'; +import '../../../../../../widgets/radio_list_popup.dart'; part 'reader_mode_tile.g.dart'; diff --git a/lib/src/features/settings/presentation/reader/widgets/reader_navigation_layout_tile/reader_navigation_layout_tile.dart b/lib/src/features/settings/presentation/reader/widgets/reader_navigation_layout_tile/reader_navigation_layout_tile.dart index f77afccc..8a60cee4 100644 --- a/lib/src/features/settings/presentation/reader/widgets/reader_navigation_layout_tile/reader_navigation_layout_tile.dart +++ b/lib/src/features/settings/presentation/reader/widgets/reader_navigation_layout_tile/reader_navigation_layout_tile.dart @@ -14,7 +14,7 @@ import '../../../../../../constants/db_keys.dart'; import '../../../../../../constants/enum.dart'; import '../../../../../../i18n/locale_keys.g.dart'; import '../../../../../../utils/storage/local/shared_preferences_client.dart'; -import '../../../../../../widgets/list_popup.dart'; +import '../../../../../../widgets/radio_list_popup.dart'; part 'reader_navigation_layout_tile.g.dart'; diff --git a/lib/src/features/settings/presentation/server/widget/auth_type_tile.dart b/lib/src/features/settings/presentation/server/widget/auth_type_tile.dart index bb39697c..0352d473 100644 --- a/lib/src/features/settings/presentation/server/widget/auth_type_tile.dart +++ b/lib/src/features/settings/presentation/server/widget/auth_type_tile.dart @@ -12,7 +12,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import '../../../../../constants/enum.dart'; import '../../../../../global_providers/global_providers.dart'; import '../../../../../i18n/locale_keys.g.dart'; -import '../../../../../widgets/list_popup.dart'; +import '../../../../../widgets/radio_list_popup.dart'; class AuthTypeTile extends ConsumerWidget { const AuthTypeTile({super.key}); diff --git a/lib/src/features/settings/widgets/theme_mode_tile/theme_mode_tile.dart b/lib/src/features/settings/widgets/theme_mode_tile/theme_mode_tile.dart index 4a7d32e4..aeb68dbb 100644 --- a/lib/src/features/settings/widgets/theme_mode_tile/theme_mode_tile.dart +++ b/lib/src/features/settings/widgets/theme_mode_tile/theme_mode_tile.dart @@ -14,7 +14,7 @@ import '../../../../constants/db_keys.dart'; import '../../../../i18n/locale_keys.g.dart'; import '../../../../utils/extensions/custom_extensions.dart'; import '../../../../utils/storage/local/shared_preferences_client.dart'; -import '../../../../widgets/list_popup.dart'; +import '../../../../widgets/radio_list_popup.dart'; part 'theme_mode_tile.g.dart'; diff --git a/lib/src/utils/storage/dio_error_util.dart b/lib/src/utils/storage/dio_error_util.dart index f8de9b33..3d5869c0 100644 --- a/lib/src/utils/storage/dio_error_util.dart +++ b/lib/src/utils/storage/dio_error_util.dart @@ -26,8 +26,9 @@ class DioErrorUtil { errorDescription = "Receive timeout"; break; case DioErrorType.response: - errorDescription = - "Received invalid status code: ${error.response?.statusCode}"; + errorDescription = (error.response?.statusCode) != null + ? "Received invalid status code: ${error.response?.statusCode}" + : "Something went wrong!"; break; case DioErrorType.sendTimeout: errorDescription = "Send timeout"; diff --git a/lib/src/widgets/list_popup.dart b/lib/src/widgets/radio_list_popup.dart similarity index 100% rename from lib/src/widgets/list_popup.dart rename to lib/src/widgets/radio_list_popup.dart diff --git a/pubspec.yaml b/pubspec.yaml index b2c8ee21..09d3ca37 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: tachidesk_sorayomi description: A new Flutter frontend for Tachidesk. publish_to: "none" -version: 0.3.5+1 +version: 0.3.6+1 environment: sdk: ">=2.18.1 <3.0.0"