import '../../../widget/app_net_image.dart'; import 'game_std_controller.dart'; import 'package:webview_flutter/webview_flutter.dart'; class InfoView extends LayerView{ late final WebViewController wc; InfoView({super.key}){ wc = WebViewController() ..setJavaScriptMode(JavaScriptMode.unrestricted) ..setBackgroundColor(const Color(0x00000000)) ..setNavigationDelegate( NavigationDelegate( onProgress: (int progress) { // Update loading bar. }, onPageStarted: (String url) {}, onPageFinished: (String url) {}, onWebResourceError: (WebResourceError error) {}, // onNavigationRequest: (NavigationRequest request) { // if (request.url.startsWith('https://www.youtube.com/')) { // return NavigationDecision.prevent; // } // return NavigationDecision.navigate; // }, ), ) ..loadRequest(Uri.parse('https://www.beswell.com/info/info.html')); } @override Widget build(BuildContext context) { return DefaultTabController( initialIndex: 0, length: 2, child: Scaffold( appBar: AppBar( title: const Text(''), bottom:const TabBar(tabs: [ Tab(text: '帮助'), Tab(text: '图例') ]), ), body: TabBarView( physics: const NeverScrollableScrollPhysics(), children: [ WebViewWidget(controller: wc), AppNetImage( netImage: viewModel.legend, fit: BoxFit.contain, ) ], ) , ) ); } }