Skip to content

Commit

Permalink
Merge pull request #237 from DattatreyaReddy/234-web-platform-fix
Browse files Browse the repository at this point in the history
fixed Platform web error
  • Loading branch information
DattatreyaReddy authored Oct 16, 2023
2 parents c0283a7 + 84c7413 commit daa62d6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -37,8 +36,7 @@ List<QuickSearchResult>? 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 =
Expand Down Expand Up @@ -120,24 +118,8 @@ List<QuickSearchResult>? 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);
}

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

20 changes: 10 additions & 10 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit daa62d6

Please sign in to comment.