提交 0c5d5720 authored 作者: yueweilu's avatar yueweilu

webview 插件使用 6.0.0 以适配 ios 上不能隐藏系统长按菜单

上级 1c4f51ca
......@@ -31,7 +31,8 @@ keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
android {
namespace "com.zijin.book.flutter_book"
compileSdkVersion flutter.compileSdkVersion
// compileSdkVersion flutter.compileSdkVersion
compileSdkVersion 34
ndkVersion flutter.ndkVersion
compileOptions {
......
......@@ -9,11 +9,11 @@ PODS:
- Flutter
- flutter_inapp_purchase (0.0.1):
- Flutter
- flutter_inappwebview (0.0.1):
- flutter_inappwebview_ios (0.0.1):
- Flutter
- flutter_inappwebview/Core (= 0.0.1)
- flutter_inappwebview_ios/Core (= 0.0.1)
- OrderedSet (~> 5.0)
- flutter_inappwebview/Core (0.0.1):
- flutter_inappwebview_ios/Core (0.0.1):
- Flutter
- OrderedSet (~> 5.0)
- flutter_sound (9.2.13):
......@@ -60,7 +60,7 @@ DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_app_update (from `.symlinks/plugins/flutter_app_update/ios`)
- flutter_inapp_purchase (from `.symlinks/plugins/flutter_inapp_purchase/ios`)
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
- flutter_sound (from `.symlinks/plugins/flutter_sound/ios`)
- flutter_tts (from `.symlinks/plugins/flutter_tts/ios`)
- fluwx (from `.symlinks/plugins/fluwx/ios`)
......@@ -91,8 +91,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_app_update/ios"
flutter_inapp_purchase:
:path: ".symlinks/plugins/flutter_inapp_purchase/ios"
flutter_inappwebview:
:path: ".symlinks/plugins/flutter_inappwebview/ios"
flutter_inappwebview_ios:
:path: ".symlinks/plugins/flutter_inappwebview_ios/ios"
flutter_sound:
:path: ".symlinks/plugins/flutter_sound/ios"
flutter_tts:
......@@ -122,7 +122,7 @@ SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_app_update: 65f61da626cb111d1b24674abc4b01728d7723bc
flutter_inapp_purchase: 5c6a1ac3f11b11d0c8c0321c0c41c1f05805e4c8
flutter_inappwebview: 3d32228f1304635e7c028b0d4252937730bbc6cf
flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0
flutter_sound: c60effa2a350fb977885f0db2fbc4c1ad5160900
flutter_sound_core: 26c10e5832e76aaacfae252d8925232281c486ae
flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
......
......@@ -21,7 +21,8 @@ class _AdDetailPageState extends State<AdDetailPage> {
),
body: InAppWebView(
initialUrlRequest: URLRequest(
url: Uri.parse(widget.adModel.url??''),
url: WebUri.uri(Uri.parse(widget.adModel.url??''))
// Uri.parse(widget.adModel.url??''),
),
)
);
......
......@@ -21,7 +21,8 @@ class _AnswerPageState extends State<AnswerPage> {
),
body: InAppWebView(
initialUrlRequest: URLRequest(
url: Uri.parse(widget.params['url']??''),
// url: Uri.parse(widget.params['url']??''),
url: WebUri.uri(Uri.parse(widget.params['url']??''))
),
onLoadStop: (controller, url) {
String str = '$kServerUrl,${widget.params['book_id']},${widget.params['chapter_id']},${widget.params['token']},${widget.params['position']}';
......
......@@ -22,7 +22,8 @@ class _BaiKePageState extends State<BaiDictPage> {
),
body: InAppWebView(
initialUrlRequest: URLRequest(
url: Uri.parse('https://hanyu.baidu.com/hanyu-page/zici/s?from=aladdin&query=${widget.keyword}&srcid=51368&wd=${widget.keyword}&ptype=zici'),
// url: Uri.parse('https://hanyu.baidu.com/hanyu-page/zici/s?from=aladdin&query=${widget.keyword}&srcid=51368&wd=${widget.keyword}&ptype=zici'),
url: WebUri.uri(Uri.parse('https://hanyu.baidu.com/hanyu-page/zici/s?from=aladdin&query=${widget.keyword}&srcid=51368&wd=${widget.keyword}&ptype=zici'))
),
),
);
......
......@@ -21,7 +21,8 @@ class _BaiKePageState extends State<BaiKePage> {
),
body: InAppWebView(
initialUrlRequest: URLRequest(
url: Uri.parse('https://baike.baidu.com/item/${widget.keyword}?fromModule=lemma_search-box'),
// url: Uri.parse('https://baike.baidu.com/item/${widget.keyword}?fromModule=lemma_search-box'),
url: WebUri.uri(Uri.parse('https://baike.baidu.com/item/${widget.keyword}?fromModule=lemma_search-box'))
),
),
);
......
......@@ -647,7 +647,8 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
// 7、将HTML内容写入文件
await file.writeAsString(htmlStr);
webViewController.loadUrl(urlRequest: URLRequest(
url: Uri.parse(writeFilePath),
// url: Uri.parse(writeFilePath),
url: WebUri.uri(Uri.parse(writeFilePath))
));
}
......
......@@ -70,16 +70,23 @@ class _ReadPageState extends State<ReadPage> {
children: [
InAppWebView(
initialUrlRequest: URLRequest(
url: Uri.parse(kReadBook),
// url: Uri.parse(kReadBook),
url: WebUri.uri(Uri.parse(kReadBook))
// url: Uri.parse("/storage/emulated/0/Android/data/com.zijin.book.flutter_book/files/174/7-325.html"),
),
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
clearCache: true
)
initialSettings:InAppWebViewSettings(
clearCache:true,
),
// initialOptions: InAppWebViewGroupOptions(
// crossPlatform: InAppWebViewOptions(
// clearCache: true
// )
// ),
contextMenu: ContextMenu(
options: ContextMenuOptions(hideDefaultSystemContextMenuItems: true),
// options: ContextMenuOptions(hideDefaultSystemContextMenuItems: true),
settings: ContextMenuSettings(
hideDefaultSystemContextMenuItems: true
)
),
onWebViewCreated: (InAppWebViewController controller){
readController.webViewController = controller;
......
......@@ -117,7 +117,7 @@ class _BuildDiscussState extends State<BuildDiscuss> {
type ==0? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(model.content?.text?.content??'',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3),),
Text(model.content?.text?.content??'审核中',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3),),
Gaps.vGaps10,
_buildImageGridView()
],
......
......@@ -19,7 +19,8 @@ class TermsPage extends StatelessWidget {
),
body: InAppWebView(
initialUrlRequest: URLRequest(
url: Uri.parse(url),
// url: Uri.parse(url),
url: WebUri.uri(Uri.parse(url))
),
)
);
......
......@@ -21,7 +21,8 @@ class _UserWrongDesPageState extends State<UserWrongDesPage> {
),
body: InAppWebView(
initialUrlRequest: URLRequest(
url: Uri.parse(kUserWrongDes),
// url: Uri.parse(kUserWrongDes),
url: WebUri.uri(Uri.parse(kUserWrongDes))
),
onLoadStop: (controller, url) {
String str = '$kServerUrl,${widget.model.bookId},${UserStore.to.token}';
......
......@@ -132,7 +132,7 @@ abstract class Routes {
initialLocation: '/$splash',
// initialLocation: '/',
observers: [observer],
// redirect: _RouteRedirect.auth,
// redirect: (context, state) => _RouteRedirect.auth(),
routes: [
GoRoute(
path: '/$splash',
......
......@@ -290,6 +290,7 @@ class _RequestInterceptor extends Interceptor {
default:
// if (code == 901) UserStore.to.logout();
// msg = response?.data?['msg']?.toString() ?? msg;
msg = response?.data?['message']?.toString() ?? msg;
CustomToast.fail(msg);
break;
......
差异被折叠。
......@@ -65,7 +65,7 @@ dependencies:
# 录音
flutter_tts: 3.8.5
# webview
flutter_inappwebview: ^5.8.0
flutter_inappwebview: ^6.0.0
intl: 0.18.0
# 录音
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论