Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kodjodevf committed Nov 17, 2023
1 parent 0024980 commit 01477e4
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 132 deletions.
90 changes: 0 additions & 90 deletions lib/eval/bridge/m_http_response.dart

This file was deleted.

7 changes: 0 additions & 7 deletions lib/eval/model/m_http_response.dart

This file was deleted.

12 changes: 6 additions & 6 deletions lib/eval/model/m_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import 'package:mangayomi/models/video.dart';
abstract class MProvider {
MProvider();

Future<MPages> getLatestUpdates(MSource sourceInfo, int page);
Future<MPages> getLatestUpdates(MSource source, int page);

Future<MPages> getPopular(MSource sourceInfo, int page);
Future<MPages> getPopular(MSource source, int page);

Future<MPages> search(MSource sourceInfo, String query, int page);
Future<MPages> search(MSource source, String query, int page);

Future<MManga> getDetail(MSource sourceInfo, String url);
Future<MManga> getDetail(MSource source, String url);

Future<List<String>> getPageList(MSource sourceInfo, String url);
Future<List<String>> getPageList(MSource source, String url);

Future<List<Video>> getVideoList(MSource sourceInfo, String url);
Future<List<Video>> getVideoList(MSource source, String url);

// FilterList getFilterList();
}
24 changes: 13 additions & 11 deletions lib/modules/anime/anime_player_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,20 @@ class _AnimePlayerViewState extends riv.ConsumerState<AnimePlayerView> {
},
),
),
body: PopScope(
onPopInvoked: (_) {
body: WillPopScope(
onWillPop: () async {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: SystemUiOverlay.values);
Navigator.pop(context);
return false;
},
child: const Center(
child: Text("Error"),
),
),
);
}
data.$1.sort(
(a, b) => a.quality.compareTo(b.quality),
);
data.$1.sort((a, b) => a.quality.compareTo(b.quality));
return AnimeStreamPage(
episode: widget.episode,
videos: data.$1,
Expand All @@ -97,12 +96,13 @@ class _AnimePlayerViewState extends riv.ConsumerState<AnimePlayerView> {
},
),
),
body: PopScope(
onPopInvoked: (_) {
body: WillPopScope(
onWillPop: () async {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: SystemUiOverlay.values);

Navigator.pop(context);
return false;
},
child: Center(
child: Text(error.toString()),
Expand All @@ -124,12 +124,13 @@ class _AnimePlayerViewState extends riv.ConsumerState<AnimePlayerView> {
},
),
),
body: PopScope(
onPopInvoked: (_) {
body: WillPopScope(
onWillPop: () async {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: SystemUiOverlay.values);

Navigator.pop(context);
return false;
},
child: const ProgressCenter(),
),
Expand Down Expand Up @@ -932,11 +933,12 @@ class _AnimeStreamPageState extends riv.ConsumerState<AnimeStreamPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: PopScope(
onPopInvoked: (_) {
body: WillPopScope(
onWillPop: () async {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: SystemUiOverlay.values);
Navigator.pop(context);
return false;
},
child: _isDesktop ? _desktopPlayer() : _mobilePlayer(),
),
Expand Down
5 changes: 3 additions & 2 deletions lib/modules/manga/detail/manga_detail_main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ class _MangaReaderDetailState extends ConsumerState<MangaReaderDetail> {
.future);
}
},
child: PopScope(
onPopInvoked: (_) {
child: WillPopScope(
onWillPop: () async {
Navigator.pop(context);
return false;
},
child: Stack(
children: [
Expand Down
5 changes: 3 additions & 2 deletions lib/modules/manga/home/manga_home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,10 @@ class _MangaHomeScreenState extends ConsumerState<MangaHomeScreen> {
),
),
),
body: PopScope(
onPopInvoked: (_) {
body: WillPopScope(
onWillPop: () async {
Navigator.pop(context);
return false;
},
child: _getManga!.when(
data: (data) {
Expand Down
22 changes: 12 additions & 10 deletions lib/modules/manga/reader/reader_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import 'package:mangayomi/modules/widgets/progress_center.dart';
import 'package:mangayomi/utils/reg_exp_matcher.dart';
import 'package:photo_view/photo_view.dart';
import 'package:photo_view/photo_view_gallery.dart';
import 'package:rinf/rinf.dart';
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';

typedef DoubleClickAnimationListener = void Function();
Expand Down Expand Up @@ -68,11 +67,12 @@ class MangaReaderView extends ConsumerWidget {
},
),
),
body: PopScope(
onPopInvoked: (_) {
body: WillPopScope(
onWillPop: () async {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: SystemUiOverlay.values);
Navigator.pop(context);
return false;
},
child: const Center(
child: Text("Error"),
Expand All @@ -97,11 +97,12 @@ class MangaReaderView extends ConsumerWidget {
},
),
),
body: PopScope(
onPopInvoked: (_) {
body: WillPopScope(
onWillPop: () async {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: SystemUiOverlay.values);
Navigator.pop(context);
return false;
},
child: Center(
child: Text(error.toString()),
Expand All @@ -121,11 +122,12 @@ class MangaReaderView extends ConsumerWidget {
},
),
),
body: PopScope(
onPopInvoked: (_) {
body: WillPopScope(
onWillPop: () async {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: SystemUiOverlay.values);
Navigator.pop(context);
return false;
},
child: const ProgressCenter(),
),
Expand Down Expand Up @@ -163,7 +165,6 @@ class _MangaChapterPageGalleryState
_readerController.setMangaHistoryUpdate();
_readerController.setPageIndex(
_geCurrentIndex(_uChapDataPreload[_currentIndex!].index!));
Rinf.ensureFinalized();
_rebuildDetail.close();
_doubleClickAnimationController.dispose();
clearGestureDetailsCache();
Expand Down Expand Up @@ -257,9 +258,10 @@ class _MangaChapterPageGalleryState
final backgroundColor = ref.watch(backgroundColorStateProvider);
final cropBorders = ref.watch(cropBordersStateProvider);
final l10n = l10nLocalizations(context)!;
return PopScope(
onPopInvoked: (_) {
return WillPopScope(
onWillPop: () async {
_goBack(context);
return false;
},
child: KeyboardListener(
autofocus: true,
Expand Down
8 changes: 7 additions & 1 deletion lib/modules/more/about/about_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ class _AboutScreenState extends ConsumerState<AboutScreen> {
_launchInBrowser(Uri.parse(
'https://github.com/kodjodevf/mangayomi'));
},
icon: const Icon(FontAwesomeIcons.github))
icon: const Icon(FontAwesomeIcons.github)),
IconButton(
onPressed: () {
_launchInBrowser(Uri.parse(
'https://discord.com/invite/EjfBuYahsP'));
},
icon: const Icon(FontAwesomeIcons.discord))
],
)
],
Expand Down
5 changes: 3 additions & 2 deletions lib/modules/webview/webview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ class _MangaWebViewState extends ConsumerState<MangaWebView> {
),
)
: SafeArea(
child: PopScope(
onPopInvoked: (_) {
child: WillPopScope(
onWillPop: () async {
_webViewController?.goBack();
return false;
},
child: Column(
children: [
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
sdk: flutter
flutter_localizations:
sdk: flutter
go_router: ^12.0.0
go_router: ^12.1.1
flutter_riverpod: ^2.4.4
cached_network_image: ^3.3.0
http: ^1.1.0
Expand Down

0 comments on commit 01477e4

Please sign in to comment.