From 84c741350b50a99af54942f4e675d32f6831c446 Mon Sep 17 00:00:00 2001 From: DattatreyaReddy Panta <58727124+DattatreyaReddy@users.noreply.github.com> Date: Mon, 16 Oct 2023 21:55:36 +0530 Subject: [PATCH] fixed Platform web error --- .../reader_mode/continuous_reader_mode.dart | 3 ++- .../reader_mode/single_page_reader_mode.dart | 3 ++- .../controller/quick_search_controller.dart | 22 ++----------------- .../controller/quick_search_controller.g.dart | 2 +- pubspec.lock | 20 ++++++++--------- pubspec.yaml | 2 +- 6 files changed, 18 insertions(+), 34 deletions(-) diff --git a/lib/src/features/manga_book/presentation/reader/widgets/reader_mode/continuous_reader_mode.dart b/lib/src/features/manga_book/presentation/reader/widgets/reader_mode/continuous_reader_mode.dart index 0ac9deb5..55e95a45 100644 --- a/lib/src/features/manga_book/presentation/reader/widgets/reader_mode/continuous_reader_mode.dart +++ b/lib/src/features/manga_book/presentation/reader/widgets/reader_mode/continuous_reader_mode.dart @@ -6,6 +6,7 @@ import 'dart:io'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; @@ -125,7 +126,7 @@ class ContinuousReaderMode extends HookConsumerWidget { ); }, child: AppUtils.wrapIf( - Platform.isAndroid || Platform.isIOS + !kIsWeb && (Platform.isAndroid || Platform.isIOS) ? (child) => InteractiveViewer(maxScale: 5, child: child) : null, ScrollablePositionedList.separated( diff --git a/lib/src/features/manga_book/presentation/reader/widgets/reader_mode/single_page_reader_mode.dart b/lib/src/features/manga_book/presentation/reader/widgets/reader_mode/single_page_reader_mode.dart index a79c1fa4..7d083dbb 100644 --- a/lib/src/features/manga_book/presentation/reader/widgets/reader_mode/single_page_reader_mode.dart +++ b/lib/src/features/manga_book/presentation/reader/widgets/reader_mode/single_page_reader_mode.dart @@ -6,6 +6,7 @@ import 'dart:io'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_cache_manager/flutter_cache_manager.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; @@ -134,7 +135,7 @@ class SinglePageReaderMode extends HookConsumerWidget { ), ); return AppUtils.wrapIf( - Platform.isAndroid || Platform.isIOS + !kIsWeb && (Platform.isAndroid || Platform.isIOS) ? (child) => InteractiveViewer(maxScale: 5, child: child) : null, image, diff --git a/lib/src/features/quick_open/presentation/quick_search/controller/quick_search_controller.dart b/lib/src/features/quick_open/presentation/quick_search/controller/quick_search_controller.dart index 916b9d4e..c5399c6a 100644 --- a/lib/src/features/quick_open/presentation/quick_search/controller/quick_search_controller.dart +++ b/lib/src/features/quick_open/presentation/quick_search/controller/quick_search_controller.dart @@ -7,7 +7,6 @@ import 'package:flutter/material.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import '../../../../../constants/quick_open_help_text.dart'; -import '../../../../../routes/router_config.dart'; import '../../../../../utils/extensions/custom_extensions.dart'; import '../../../../../utils/mixin/state_provider_mixin.dart'; import '../../../../browse_center/presentation/source/controller/source_controller.dart'; @@ -37,8 +36,7 @@ List? processesQuickSearch( if (query!.startsWith('?')) return getQuickShowHintTextList(context); // Source Search - if (query.startsWith('@') || - (context.location.contains(Routes.browse)).ifNull()) { + if (query.startsWith('@')) { String sourceQuery = query.startsWith('@') ? query.substring(1) : query; final queryList = sourceQuery.split('/'); final sourceList = @@ -120,24 +118,8 @@ List? processesQuickSearch( } // Manga Search - if (query.startsWith('#') || - (context.location.contains(Routes.library)).ifNull()) { + if (query.startsWith('#')) { return mangaSearch(query); } - - // Manga Description context aware Search - if ((context.location.startsWith(Routes.mangaRoute)).ifNull()) { - final id = int.tryParse(context.location - .substring(Routes.mangaRoute.length) - .split('/') - .firstOrNull - ?.split('?') - .firstOrNull ?? - ''); - if (id != null) { - final manga = ref.watch(MangaWithIdProvider(mangaId: id)).valueOrNull; - if (manga != null) return chapterSearch(manga, query: query); - } - } return mangaSearch(query); } diff --git a/lib/src/features/quick_open/presentation/quick_search/controller/quick_search_controller.g.dart b/lib/src/features/quick_open/presentation/quick_search/controller/quick_search_controller.g.dart index eee1dbb3..986d99c5 100644 --- a/lib/src/features/quick_open/presentation/quick_search/controller/quick_search_controller.g.dart +++ b/lib/src/features/quick_open/presentation/quick_search/controller/quick_search_controller.g.dart @@ -7,7 +7,7 @@ part of 'quick_search_controller.dart'; // ************************************************************************** String _$processesQuickSearchHash() => - r'd0671247c128a4484ee5aed3c70f0267ea2a9baa'; + r'fc253ae948ddc40613d7c08d04808b1871071608'; /// Copied from Dart SDK class _SystemHash { diff --git a/pubspec.lock b/pubspec.lock index 9415b8c9..5fd48bcf 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -431,10 +431,10 @@ packages: dependency: transitive description: name: flutter_riverpod - sha256: e667e406a74d67715f1fa0bd941d9ded49aff72f3a9f4440a36aece4e8d457a7 + sha256: bdba94be666ecb1beeb0f5a748d96cdd6a37215f27e6b48c7673b95cecb800c8 url: "https://pub.dev" source: hosted - version: "2.4.3" + version: "2.4.4" flutter_staggered_grid_view: dependency: transitive description: @@ -465,10 +465,10 @@ packages: dependency: "direct main" description: name: font_awesome_flutter - sha256: "5fb789145cae1f4c3245c58b3f8fb287d055c26323879eab57a7bf0cfd1e45f3" + sha256: "52671aea66da73b58d42ec6d0912b727a42248dd9a7c76d6c20f275783c48c08" url: "https://pub.dev" source: hosted - version: "10.5.0" + version: "10.6.0" freezed: dependency: "direct dev" description: @@ -537,10 +537,10 @@ packages: dependency: "direct main" description: name: hooks_riverpod - sha256: "69dcb88acbc68c81fc27ec15a89a4e24b7812c83c13a6307a1a9366ada758541" + sha256: "0e02037e6fd3511a06ab4770b1a766d2d9bb576f85780d5bb452ca53e3311044" url: "https://pub.dev" source: hosted - version: "2.4.3" + version: "2.4.4" html: dependency: transitive description: @@ -905,10 +905,10 @@ packages: dependency: transitive description: name: riverpod - sha256: "494bf2cfb4df30000273d3052bdb1cc1de738574c6b678f0beb146ea56f5e208" + sha256: "2af3d127a6e4e34b89b8f1f018086f5ded04b8e538174f0510bba3e4c0d878b1" url: "https://pub.dev" source: hosted - version: "2.4.3" + version: "2.4.4" riverpod_analyzer_utils: dependency: transitive description: @@ -921,10 +921,10 @@ packages: dependency: "direct main" description: name: riverpod_annotation - sha256: b724b2085405c4f62a1824a3fa3fb1e4858e09a4e2e8db92b7547c08d07a1377 + sha256: "388b03ed91b8f5126318fa43221fe078ebc20c81523dec9fcb5237cb5431d4dd" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.2.1" riverpod_generator: dependency: "direct dev" description: diff --git a/pubspec.yaml b/pubspec.yaml index 256d6362..1be3dda2 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.5.14+1 +version: 0.5.15+1 environment: sdk: ">=3.0.0 <4.0.0"