提交 8021a8e9 authored 作者: yueweilu's avatar yueweilu

扩展阅读页图片放大回调

上级 1cb79a92
...@@ -108,6 +108,8 @@ class _LibraryPageState extends State<LibraryPage> { ...@@ -108,6 +108,8 @@ class _LibraryPageState extends State<LibraryPage> {
), ),
Visibility( Visibility(
visible: controller.show, visible: controller.show,
child: Container(
height: double.infinity,
child: FilterPage( child: FilterPage(
controller: controller, controller: controller,
sureTap: (){ sureTap: (){
...@@ -119,6 +121,7 @@ class _LibraryPageState extends State<LibraryPage> { ...@@ -119,6 +121,7 @@ class _LibraryPageState extends State<LibraryPage> {
controller.resetFilter(); controller.resetFilter();
},), },),
), ),
),
], ],
); );
} }
......
...@@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; ...@@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import '../../routes/index.dart';
import '../../utils/index.dart'; import '../../utils/index.dart';
part 'view.dart'; part 'view.dart';
\ No newline at end of file
...@@ -26,7 +26,19 @@ class _ReadInfoPageState extends State<ReadInfoPage> { ...@@ -26,7 +26,19 @@ class _ReadInfoPageState extends State<ReadInfoPage> {
onLoadStop: (controller, url) { onLoadStop: (controller, url) {
String jsonStr = jsonEncode(widget.params); String jsonStr = jsonEncode(widget.params);
controller.evaluateJavascript(source: 'callbackInFlutterComponent($jsonStr)'); controller.evaluateJavascript(source: 'callbackInFlutterComponent($jsonStr)');
// 图片预览
controller.addJavaScriptHandler(handlerName: 'scaleImageCallback', callback: (args){
String url = args.first[0].toString();
String title = args.first[1].toString();
Map<String,String> params = {
'url':url,
'title':title,
};
Console.log('监听图片预览---------------给页面传参---------------------------------$params');
context.pushNamed(Routes.scaleImage,queryParameters: params);
});
}, },
onConsoleMessage: (controller, consoleMessage) { onConsoleMessage: (controller, consoleMessage) {
// 接收从 WebView 发送的消息 // 接收从 WebView 发送的消息
Console.log("画廊扩展阅读-------Received message from WebView-----------------------------: ${consoleMessage.message}"); Console.log("画廊扩展阅读-------Received message from WebView-----------------------------: ${consoleMessage.message}");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论