diff --git a/lib/app/data/services/local_storage_service.dart b/lib/app/data/services/local_storage_service.dart index 8df5775e..a4e096ed 100644 --- a/lib/app/data/services/local_storage_service.dart +++ b/lib/app/data/services/local_storage_service.dart @@ -22,6 +22,7 @@ import '../enums/reader_navigation_layout.dart'; class LocalStorageService extends GetxService { final box = GetStorage(); + // ignore: todo // TODO Need Enhancement in Tachidesk-server // https://github.com/Suwayomi/Tachidesk-Server/issues/312 // final Rx _settings = Settings().obs; diff --git a/lib/app/modules/browse/views/browse_view.dart b/lib/app/modules/browse/views/browse_view.dart index 5c29429d..7d95da7b 100644 --- a/lib/app/modules/browse/views/browse_view.dart +++ b/lib/app/modules/browse/views/browse_view.dart @@ -1,3 +1,5 @@ +// ignore_for_file: no_leading_underscores_for_local_identifiers + import 'package:flutter/material.dart'; import 'package:get/get.dart'; diff --git a/lib/app/modules/extensions/views/extensions_view.dart b/lib/app/modules/extensions/views/extensions_view.dart index d3a3dd1e..a96b2d7d 100644 --- a/lib/app/modules/extensions/views/extensions_view.dart +++ b/lib/app/modules/extensions/views/extensions_view.dart @@ -1,3 +1,5 @@ +// ignore_for_file: no_leading_underscores_for_local_identifiers + import 'package:flutter/material.dart'; import 'package:cached_network_image/cached_network_image.dart'; diff --git a/lib/app/modules/home/controllers/home_controller copy.dart b/lib/app/modules/home/controllers/home_controller copy.dart index b4539ee6..ed8296a6 100644 --- a/lib/app/modules/home/controllers/home_controller copy.dart +++ b/lib/app/modules/home/controllers/home_controller copy.dart @@ -1,3 +1,5 @@ +// ignore_for_file: file_names + import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; diff --git a/lib/app/modules/home/views/home_view.dart b/lib/app/modules/home/views/home_view.dart index fd598527..ab018e80 100644 --- a/lib/app/modules/home/views/home_view.dart +++ b/lib/app/modules/home/views/home_view.dart @@ -4,14 +4,14 @@ import 'package:get/get.dart'; import '../../../../generated/locales.g.dart'; import '../../browse/views/browse_view.dart'; -import '../../browse/widgets/browse_appbar_actions.dart'; + import '../../downloads/views/downloads_view.dart'; import '../../library/views/library_view.dart'; -import '../../library/widgets/library_appbar_actions.dart'; + import '../../more/views/more_view.dart'; import '../../updates/views/updates_view.dart'; import '../controllers/home_controller.dart'; -import '../widgets/big_screen_navigation_bar.dart'; + import '../widgets/small_screen_navigation_bar.dart'; const List navigationBarTitles = [ diff --git a/lib/app/modules/home/widgets/small_screen_navigation_bar.dart b/lib/app/modules/home/widgets/small_screen_navigation_bar.dart index f052f497..394b2371 100644 --- a/lib/app/modules/home/widgets/small_screen_navigation_bar.dart +++ b/lib/app/modules/home/widgets/small_screen_navigation_bar.dart @@ -1,6 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; - import 'package:get/get.dart'; import 'package:tachidesk_sorayomi/app/modules/browse/controllers/browse_controller.dart'; import 'package:tachidesk_sorayomi/app/modules/updates/controllers/updates_controller.dart'; diff --git a/lib/app/modules/library/views/library_view copy.dart b/lib/app/modules/library/views/library_view copy.dart index cd7fee68..8fef5fb8 100644 --- a/lib/app/modules/library/views/library_view copy.dart +++ b/lib/app/modules/library/views/library_view copy.dart @@ -1,9 +1,11 @@ +// ignore_for_file: file_names + import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:tachidesk_sorayomi/app/modules/browse/widgets/browse_appbar_actions.dart'; import 'package:tachidesk_sorayomi/app/modules/home/controllers/home_controller.dart'; -import 'package:tachidesk_sorayomi/app/modules/home/widgets/small_screen_navigation_bar.dart'; + import 'package:tachidesk_sorayomi/app/modules/library/widgets/library_appbar_actions.dart'; import '../../../../generated/locales.g.dart'; diff --git a/lib/app/modules/library/views/library_view.dart b/lib/app/modules/library/views/library_view.dart index cbb5dfc3..ed9f7b39 100644 --- a/lib/app/modules/library/views/library_view.dart +++ b/lib/app/modules/library/views/library_view.dart @@ -1,7 +1,9 @@ +// ignore_for_file: no_leading_underscores_for_local_identifiers + import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import 'package:grouped_list/sliver_grouped_list.dart'; + import 'package:tachidesk_sorayomi/app/modules/browse/widgets/browse_appbar_actions.dart'; import 'package:tachidesk_sorayomi/app/modules/home/controllers/home_controller.dart'; import 'package:tachidesk_sorayomi/app/modules/home/views/home_view.dart'; @@ -112,7 +114,6 @@ class LibraryView extends GetView { // elevation: 0, pinned: true, stretch: true, - floating: true, actions: [ IconButton( @@ -131,7 +132,6 @@ class LibraryView extends GetView { ? BrowseAppBarActions() : SizedBox()) ], - title: Text(navigationBarTitles[0].tr), bottom: controller.categoryListLength <= 1 ? null @@ -141,8 +141,11 @@ class LibraryView extends GetView { indicatorSize: TabBarIndicatorSize.label, indicatorColor: Theme.of(context).colorScheme.primary, // padding: EdgeInsets.all(8), + tabs: controller.categoryList - .map((e) => Tab(text: e?.name ?? "Default")) + .map((e) => Tab( + text: e?.name ?? "Default", + )) .toList(), ), )), diff --git a/lib/app/modules/reader/views/reader_view.dart b/lib/app/modules/reader/views/reader_view.dart index bce7afff..b923ffc9 100644 --- a/lib/app/modules/reader/views/reader_view.dart +++ b/lib/app/modules/reader/views/reader_view.dart @@ -24,14 +24,16 @@ class ReaderView extends GetView { children: [ !controller.isLoading ? controller.chapter.pageCount != null - ? Obx(() { - ReaderMode readerMode = controller.readerMode == - ReaderMode.defaultReader - ? controller.localStorageService.readerMode - : controller.readerMode; - return controller.readerModeMap[readerMode]!( - controller: controller); - }) + ? Obx( + () { + ReaderMode readerMode = controller.readerMode == + ReaderMode.defaultReader + ? controller.localStorageService.readerMode + : controller.readerMode; + return controller.readerModeMap[readerMode]!( + controller: controller); + }, + ) : EmoticonsView( text: "${LocaleKeys.no.tr} " "${LocaleKeys.readerScreen_chapterError.tr}", diff --git a/lib/app/modules/reader/widgets/paga_number_slider.dart b/lib/app/modules/reader/widgets/paga_number_slider.dart index b8ac01c3..f41c5926 100644 --- a/lib/app/modules/reader/widgets/paga_number_slider.dart +++ b/lib/app/modules/reader/widgets/paga_number_slider.dart @@ -1,9 +1,7 @@ -import 'dart:math'; - import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import 'package:path/path.dart'; + import 'package:syncfusion_flutter_sliders/sliders.dart'; import '../controllers/reader_controller.dart'; diff --git a/lib/app/modules/reader/widgets/reader_modes/webtoon.dart b/lib/app/modules/reader/widgets/reader_modes/webtoon.dart index 200af0d5..a64735c2 100644 --- a/lib/app/modules/reader/widgets/reader_modes/webtoon.dart +++ b/lib/app/modules/reader/widgets/reader_modes/webtoon.dart @@ -3,6 +3,7 @@ import 'package:flutter/services.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:get/get.dart'; +import 'package:pinch_zoom_image_last/pinch_zoom_image_last.dart'; import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; import '../../../../../generated/locales.g.dart'; @@ -69,83 +70,80 @@ class Webtoon extends StatelessWidget { @override Widget build(BuildContext context) { initListeners(); - return InteractiveViewer( - child: Shortcuts( - shortcuts: { - LogicalKeySet(LogicalKeyboardKey.arrowUp): PreviousScrollIntent(), - LogicalKeySet(LogicalKeyboardKey.arrowDown): NextScrollIntent(), + return Shortcuts( + shortcuts: { + LogicalKeySet(LogicalKeyboardKey.arrowUp): PreviousScrollIntent(), + LogicalKeySet(LogicalKeyboardKey.arrowDown): NextScrollIntent(), + }, + child: Actions( + actions: { + PreviousScrollIntent: CallbackAction( + onInvoke: (intent) => controller.previousScroll!(), + ), + NextScrollIntent: CallbackAction( + onInvoke: (intent) => controller.nextScroll!(), + ), }, - child: Actions( - actions: { - PreviousScrollIntent: CallbackAction( - onInvoke: (intent) => controller.previousScroll!(), - ), - NextScrollIntent: CallbackAction( - onInvoke: (intent) => controller.nextScroll!(), - ), - }, - child: Focus( - autofocus: true, - child: ScrollablePositionedList.builder( - itemScrollController: itemScrollController, - itemPositionsListener: itemPositionsListener, - itemCount: controller.chapter.pageCount ?? 0, - itemBuilder: (context, index) { - if (index == (controller.chapter.pageCount! - 1)) { - controller.markAsRead(); - } - Map? headers = - controller.localStorageService.baseAuthType == - AuthType.basic - ? { - "Authorization": - controller.localStorageService.basicAuth, - } - : null; - return GestureDetector( - onSecondaryTap: () { - readerPageBottomSheet( - context: context, - index: index, - controller: controller, - headers: headers, - ); - }, - onLongPress: () { - readerPageBottomSheet( - index: index, - context: context, - controller: controller, - headers: headers, - ); - }, - child: CachedNetworkImage( - fit: BoxFit.fitWidth, - imageUrl: controller.getChapterPage(index), - httpHeaders: headers, - filterQuality: FilterQuality.high, - progressIndicatorBuilder: - (context, url, downloadProgress) => SizedBox( - height: context.height * .7, - child: Center( - child: CircularProgressIndicator( - value: downloadProgress.progress, - ), + child: Focus( + autofocus: true, + child: ScrollablePositionedList.builder( + itemScrollController: itemScrollController, + itemPositionsListener: itemPositionsListener, + itemCount: controller.chapter.pageCount ?? 0, + itemBuilder: (context, index) { + if (index == (controller.chapter.pageCount! - 1)) { + controller.markAsRead(); + } + Map? headers = + controller.localStorageService.baseAuthType == AuthType.basic + ? { + "Authorization": + controller.localStorageService.basicAuth, + } + : null; + return GestureDetector( + onSecondaryTap: () { + readerPageBottomSheet( + context: context, + index: index, + controller: controller, + headers: headers, + ); + }, + onLongPress: () { + readerPageBottomSheet( + index: index, + context: context, + controller: controller, + headers: headers, + ); + }, + child: CachedNetworkImage( + fit: BoxFit.fitWidth, + imageUrl: controller.getChapterPage(index), + httpHeaders: headers, + filterQuality: FilterQuality.high, + progressIndicatorBuilder: (context, url, downloadProgress) => + SizedBox( + height: context.height * .7, + child: Center( + child: CircularProgressIndicator( + value: downloadProgress.progress, ), ), - errorWidget: (context, url, error) => SizedBox( - height: context.height, - child: Center( - child: EmoticonsView( - text: "${LocaleKeys.no.tr} " - "${LocaleKeys.readerScreen_image.tr}", - ), + ), + errorWidget: (context, url, error) => SizedBox( + height: context.height, + child: Center( + child: EmoticonsView( + text: "${LocaleKeys.no.tr} " + "${LocaleKeys.readerScreen_image.tr}", ), ), ), - ); - }, - ), + ), + ); + }, ), ), ), diff --git a/lib/app/modules/sources/views/sources_view.dart b/lib/app/modules/sources/views/sources_view.dart index e634cb33..42741516 100644 --- a/lib/app/modules/sources/views/sources_view.dart +++ b/lib/app/modules/sources/views/sources_view.dart @@ -1,3 +1,5 @@ +// ignore_for_file: no_leading_underscores_for_local_identifiers + import 'package:flutter/material.dart'; import 'package:cached_network_image/cached_network_image.dart'; diff --git a/lib/app/modules/updates/views/updates_view.dart b/lib/app/modules/updates/views/updates_view.dart index 910b10d4..b06a1710 100644 --- a/lib/app/modules/updates/views/updates_view.dart +++ b/lib/app/modules/updates/views/updates_view.dart @@ -15,7 +15,7 @@ import '../../../data/enums/auth_type.dart'; import '../../../data/manga_page_model.dart'; import '../../../routes/app_pages.dart'; import '../../../widgets/emoticons.dart'; -import '../../home/controllers/home_controller.dart'; + import '../../home/views/home_view.dart'; import '../controllers/updates_controller.dart'; diff --git a/lib/app/widgets/manga_grid_design copy.dart b/lib/app/widgets/manga_grid_design copy.dart index 031a0a52..d7fc834e 100644 --- a/lib/app/widgets/manga_grid_design copy.dart +++ b/lib/app/widgets/manga_grid_design copy.dart @@ -1,3 +1,5 @@ +// ignore_for_file: file_names + import 'package:flutter/material.dart'; import 'package:cached_network_image/cached_network_image.dart'; diff --git a/pubspec.lock b/pubspec.lock index 5e3a4b77..88ca6a5e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -373,6 +373,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.11.1" + pinch_zoom_image_last: + dependency: "direct main" + description: + name: pinch_zoom_image_last + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1" platform: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 3c0dcbcf..c90b3290 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: tachidesk_sorayomi -version: 1.0.12+1 +version: 1.0.13+1 publish_to: none description: A new Flutter frontend for Tachidesk. environment: @@ -29,6 +29,7 @@ dependencies: scrollable_positioned_list: ^0.2.3 syncfusion_flutter_sliders: ^20.1.52 url_launcher: ^6.0.17 + pinch_zoom_image_last: ^0.4.1 dev_dependencies: flutter_lints: ^2.0.1