| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import 'package:get/get.dart';
- import '../../widget/app_net_image.dart';
- import 'in_game_controller.dart';
- import 'package:flutter/material.dart';
- import 'package:webview_flutter/webview_flutter.dart';
- class InfoView extends GetView<InGameController>{
- 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: controller.legend,
- fit: BoxFit.contain,
- )
- ],
- ) ,
- )
- );
- }
- }
|