Browse Source

1、更新带图标的二维码组件,

bakamaka.guan 2 years ago
parent
commit
d6516cab53
2 changed files with 21 additions and 17 deletions
  1. 19 15
      lib/src/qrcode_withlogo.dart
  2. 2 2
      pubspec.yaml

+ 19 - 15
lib/src/qrcode_withlogo.dart

@@ -31,8 +31,8 @@ class QRCodeWithLogo extends StatefulWidget implements FWidget {
   const QRCodeWithLogo(
     this.qrData, {
     Key? key,
-    this.codeStatement = "QRCodeStatement",
-    this.operationStatement = "QRCodeOperationStatement",
+    this.codeStatement,
+    this.operationStatement,
     this.operationSuccessCallback,
     this.size = 280,
     this.logoSize,
@@ -83,25 +83,29 @@ class _QRCodeWithLogoState extends State<QRCodeWithLogo> {
           mainAxisAlignment: MainAxisAlignment.center,
           children: [
             qrFutureBuilder,
-            FPadding(
-              padding: EdgeInsets.symmetric(vertical: 20, horizontal: 40)
-                  .copyWith(bottom: 5),
-              child: FText(widget.codeStatement!),
-            ),
-            FInk(
-              decoration: UnderlineTabIndicator(
+            if (widget.codeStatement != null)
+              FPadding(
+                padding: EdgeInsets.symmetric(vertical: 20, horizontal: 40)
+                    .copyWith(bottom: 5),
+                child: FText(widget.codeStatement!),
+              ),
+            if (widget.operationStatement != null)
+              FInk(
+                decoration: UnderlineTabIndicator(
                   borderSide: BorderSide(color: Colors.blue),
-                  insets: EdgeInsets.fromLTRB(0, 0, 0, 1)),
-              child: FInkWell(
+                  insets: EdgeInsets.fromLTRB(0, 0, 0, 1),
+                ),
+                child: FInkWell(
                   child: FText(
                     widget.operationStatement!,
                     style: TextStyle(color: Colors.blue),
                   ),
                   onTap: () => {
-                        Clipboard.setData(ClipboardData(text: widget.qrData)),
-                        widget.operationSuccessCallback?.call()
-                      }),
-            )
+                    Clipboard.setData(ClipboardData(text: widget.qrData)),
+                    widget.operationSuccessCallback?.call()
+                  },
+                ),
+              )
           ],
         ),
       ),

+ 2 - 2
pubspec.yaml

@@ -13,11 +13,11 @@ dependency_overrides:
   fis_common:
     git:
       url: http://git.ius.plus:88/Project-Wing/fis_lib_common.git
-      ref: 63dcf70026
+      ref: cb4c3d5
   fis_ui:
     git:
       url: http://git.ius.plus:88/Project-Wing/fis_lib_ui.git
-      ref: 147958b2d3
+      ref: a6289ae
   fis_jsonrpc:
     git:
       url: http://git.ius.plus:88/Project-Wing/fis_lib_jsonrpc.git