| | |
| | | void initState() { |
| | | super.initState(); |
| | | if (Platform.isAndroid) { |
| | | WebView.platform = SurfaceAndroidWebView(); |
| | | WebView.platform = AndroidWebView(); |
| | | } |
| | | } |
| | | |
| | |
| | | return false; |
| | | }, |
| | | child: Scaffold( |
| | | resizeToAvoidBottomInset: true, |
| | | backgroundColor: Colors.white, |
| | | body: Flex( |
| | | direction: Axis.vertical, |
| | |
| | | back: () { |
| | | _back(); |
| | | }, |
| | | rightIcon: const Icon(Icons.refresh,size: 30,), |
| | | rightClick: (){ |
| | | if(_webViewController!=null){ |
| | | leftWidget: const Padding( |
| | | padding: EdgeInsets.only(left: 5, right: 10), |
| | | child: Icon( |
| | | Icons.close_rounded, |
| | | size: 30, |
| | | )), |
| | | leftWidgetClick: () { |
| | | popPage(context); |
| | | }, |
| | | rightIcon: const Icon( |
| | | Icons.refresh, |
| | | size: 30, |
| | | ), |
| | | rightClick: () { |
| | | if (_webViewController != null) { |
| | | _webViewController!.reload(); |
| | | } |
| | | }, |
| | |
| | | height: 1, |
| | | child: LinearProgressIndicator( |
| | | backgroundColor: Colors.white, |
| | | valueColor: const AlwaysStoppedAnimation(ColorConstant.theme), |
| | | valueColor: |
| | | const AlwaysStoppedAnimation(ColorConstant.theme), |
| | | value: progress, |
| | | ), |
| | | ), |
| | | Expanded( |
| | | child: WebView( |
| | | //http://192.168.3.122:8848/test/JsTest.html |
| | | initialUrl:url, |
| | | backgroundColor: Colors.white, |
| | | initialUrl: url, |
| | | onWebViewCreated: (WebViewController webViewController) { |
| | | _webViewController = webViewController; |
| | | }, |