From 355fe96b2a4c7821256d9e8828d2cb9539904878 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 05 五月 2022 19:29:16 +0800
Subject: [PATCH] 功能完善

---
 flutter_module/lib/ui/common/browser.dart |   28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/flutter_module/lib/ui/common/browser.dart b/flutter_module/lib/ui/common/browser.dart
index a047dea..3bf24ac 100644
--- a/flutter_module/lib/ui/common/browser.dart
+++ b/flutter_module/lib/ui/common/browser.dart
@@ -19,8 +19,7 @@
   _BrowserPageState createState() => _BrowserPageState(title, url);
 }
 
-class _BrowserPageState extends State<BrowserPage>
-    with SingleTickerProviderStateMixin {
+class _BrowserPageState extends State<BrowserPage> {
   String title = "";
   String? url;
   double progress = 0;
@@ -31,7 +30,7 @@
   void initState() {
     super.initState();
     if (Platform.isAndroid) {
-      WebView.platform = SurfaceAndroidWebView();
+      WebView.platform = AndroidWebView();
     }
   }
 
@@ -68,9 +67,21 @@
                   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();
                     }
                   },
@@ -79,14 +90,15 @@
                   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,
+                  initialUrl: url,
                   onWebViewCreated: (WebViewController webViewController) {
                     _webViewController = webViewController;
                   },

--
Gitblit v1.8.0