From fa705507ba574c857b1667553737d23b1b7ff495 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 12 五月 2022 12:06:31 +0800
Subject: [PATCH] 后端模板代码优化

---
 src/main/resources/code/flutter_module/lib/ui/common/browser.dart |   27 +++++++++++++++++++++------
 1 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/src/main/resources/code/flutter_module/lib/ui/common/browser.dart b/src/main/resources/code/flutter_module/lib/ui/common/browser.dart
index a047dea..b6d7d15 100644
--- a/src/main/resources/code/flutter_module/lib/ui/common/browser.dart
+++ b/src/main/resources/code/flutter_module/lib/ui/common/browser.dart
@@ -31,7 +31,7 @@
   void initState() {
     super.initState();
     if (Platform.isAndroid) {
-      WebView.platform = SurfaceAndroidWebView();
+      WebView.platform = AndroidWebView();
     }
   }
 
@@ -59,6 +59,7 @@
           return false;
         },
         child: Scaffold(
+            resizeToAvoidBottomInset: true,
             backgroundColor: Colors.white,
             body: Flex(
               direction: Axis.vertical,
@@ -68,9 +69,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 +92,16 @@
                   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;
                   },

--
Gitblit v1.8.0