Fix
This commit is contained in:
parent
0024980e47
commit
01477e4f4c
10 changed files with 48 additions and 132 deletions
|
|
@ -1,90 +0,0 @@
|
|||
import 'package:dart_eval/dart_eval.dart';
|
||||
import 'package:dart_eval/dart_eval_bridge.dart';
|
||||
import 'package:dart_eval/stdlib/core.dart';
|
||||
import 'package:mangayomi/eval/model/m_http_response.dart';
|
||||
|
||||
class $MHttpResponse implements MHttpResponse, $Instance {
|
||||
$MHttpResponse.wrap(this.$value) : _superclass = $Object($value);
|
||||
|
||||
static const $type = BridgeTypeRef(
|
||||
BridgeTypeSpec('package:mangayomi/bridge_lib.dart', 'MHttpResponse'));
|
||||
|
||||
static const $declaration = BridgeClassDef(BridgeClassType($type),
|
||||
constructors: {
|
||||
'': BridgeConstructorDef(BridgeFunctionDef(
|
||||
returns: BridgeTypeAnnotation($type),
|
||||
))
|
||||
},
|
||||
// Specify class fields
|
||||
fields: {
|
||||
'body': BridgeFieldDef(
|
||||
BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.string))),
|
||||
'statusCode':
|
||||
BridgeFieldDef(BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.int))),
|
||||
'hasError':
|
||||
BridgeFieldDef(BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.bool))),
|
||||
},
|
||||
wrap: true);
|
||||
|
||||
static $Value? $new(Runtime runtime, $Value? target, List<$Value?> args) {
|
||||
return $MHttpResponse.wrap(MHttpResponse());
|
||||
}
|
||||
|
||||
@override
|
||||
final MHttpResponse $value;
|
||||
|
||||
@override
|
||||
MHttpResponse get $reified => $value;
|
||||
|
||||
final $Instance _superclass;
|
||||
|
||||
@override
|
||||
$Value? $getProperty(Runtime runtime, String identifier) {
|
||||
switch (identifier) {
|
||||
case 'body':
|
||||
return $String($value.body!);
|
||||
case 'statusCode':
|
||||
return $int($value.statusCode!);
|
||||
case 'hasError':
|
||||
return $bool($value.hasError!);
|
||||
|
||||
default:
|
||||
return _superclass.$getProperty(runtime, identifier);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
int $getRuntimeType(Runtime runtime) => runtime.lookupType($type.spec!);
|
||||
|
||||
@override
|
||||
void $setProperty(Runtime runtime, String identifier, $Value value) {
|
||||
switch (identifier) {
|
||||
case 'body':
|
||||
$value.body = value.$reified;
|
||||
case 'statusCode':
|
||||
$value.statusCode = value.$reified;
|
||||
case 'hasError':
|
||||
$value.hasError = value.$reified;
|
||||
|
||||
default:
|
||||
_superclass.$setProperty(runtime, identifier, value);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
String? get body => $value.body;
|
||||
|
||||
@override
|
||||
int? get statusCode => $value.statusCode;
|
||||
@override
|
||||
bool? get hasError => $value.hasError;
|
||||
|
||||
@override
|
||||
set body(String? body) {}
|
||||
|
||||
@override
|
||||
set statusCode(int? statusCode) {}
|
||||
|
||||
@override
|
||||
set hasError(bool? hasError) {}
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
class MHttpResponse {
|
||||
bool? hasError;
|
||||
int? statusCode;
|
||||
String? body;
|
||||
|
||||
MHttpResponse({this.body, this.hasError, this.statusCode});
|
||||
}
|
||||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,11 +64,12 @@ 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"),
|
||||
|
|
@ -76,9 +77,7 @@ class _AnimePlayerViewState extends riv.ConsumerState<AnimePlayerView> {
|
|||
),
|
||||
);
|
||||
}
|
||||
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,
|
||||
|
|
@ -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()),
|
||||
|
|
@ -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(),
|
||||
),
|
||||
|
|
@ -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(),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -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: [
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
@ -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"),
|
||||
|
|
@ -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()),
|
||||
|
|
@ -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(),
|
||||
),
|
||||
|
|
@ -163,7 +165,6 @@ class _MangaChapterPageGalleryState
|
|||
_readerController.setMangaHistoryUpdate();
|
||||
_readerController.setPageIndex(
|
||||
_geCurrentIndex(_uChapDataPreload[_currentIndex!].index!));
|
||||
Rinf.ensureFinalized();
|
||||
_rebuildDetail.close();
|
||||
_doubleClickAnimationController.dispose();
|
||||
clearGestureDetailsCache();
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
],
|
||||
)
|
||||
],
|
||||
|
|
|
|||
|
|
@ -92,9 +92,10 @@ class _MangaWebViewState extends ConsumerState<MangaWebView> {
|
|||
),
|
||||
)
|
||||
: SafeArea(
|
||||
child: PopScope(
|
||||
onPopInvoked: (_) {
|
||||
child: WillPopScope(
|
||||
onWillPop: () async {
|
||||
_webViewController?.goBack();
|
||||
return false;
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue