Skip to content

Commit

Permalink
Fix the problem of exiting the main route on the mobile terminal
Browse files Browse the repository at this point in the history
修复移动端退出主路由的问题
  • Loading branch information
jiangtian616 committed Nov 3, 2024
1 parent 7afe40a commit 117095b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 23 deletions.
10 changes: 7 additions & 3 deletions lib/src/network/eh_cache_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class EHCacheManager extends Interceptor {
@override
void onRequest(RequestOptions options, RequestInterceptorHandler handler) async {
CacheOptions cacheOptions = _getCacheOptions(options);

options.extra[realUriExtraKey] = options.uri.toString();

if (_shouldSkipRequest(options, cacheOptions)) {
handler.next(options);
return;
Expand Down Expand Up @@ -286,7 +286,11 @@ class SqliteCacheStore {
final AppDb appDb;

SqliteCacheStore({required this.appDb}) {
cleanExpired();
try {
cleanExpired();
} catch (e) {
log.error('cleanExpired failed', e);
}
}

Future<void> cleanExpired() {
Expand Down
43 changes: 23 additions & 20 deletions lib/src/pages/layout/tablet_v2/tablet_layout_page_v2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_resizable_container/flutter_resizable_container.dart';
import 'package:get/get.dart';
import 'package:jhentai/src/pages/layout/mobile_v2/mobile_layout_page_v2.dart';
import 'package:jhentai/src/widget/will_pop_interceptor.dart';

import '../../../config/ui_config.dart';
import '../../../routes/routes.dart';
Expand Down Expand Up @@ -38,27 +39,29 @@ class _TabletLayoutPageV2State extends State<TabletLayoutPageV2> {

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: UIConfig.backGroundColor(context),
body: ResizableContainer(
direction: Axis.horizontal,
controller: resizableController,
children: [
ResizableChild(
child: _leftColumn(),
size: ResizableSize.ratio(windowService.leftColumnWidthRatio),
minSize: 100,
return WillPopInterceptor(
child: Scaffold(
backgroundColor: UIConfig.backGroundColor(context),
body: ResizableContainer(
direction: Axis.horizontal,
controller: resizableController,
children: [
ResizableChild(
child: _leftColumn(),
size: ResizableSize.ratio(windowService.leftColumnWidthRatio),
minSize: 100,
),
ResizableChild(
child: _rightColumn(),
size: ResizableSize.ratio(1 - windowService.leftColumnWidthRatio),
minSize: 100,
),
],
divider: ResizableDivider(
thickness: 1.5,
size: 7.5,
color: UIConfig.layoutDividerColor(context),
),
ResizableChild(
child: _rightColumn(),
size: ResizableSize.ratio(1 - windowService.leftColumnWidthRatio),
minSize: 100,
),
],
divider: ResizableDivider(
thickness: 1.5,
size: 7.5,
color: UIConfig.layoutDividerColor(context),
),
),
);
Expand Down

0 comments on commit 117095b

Please sign in to comment.