From ffd34620f6783e57b66ba3f64f59713293c5fd77 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 5 Nov 2020 14:33:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=89=AB=E4=B8=80=E6=89=AB?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ui/tool_pages/scan_page.dart | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/ui/tool_pages/scan_page.dart b/lib/ui/tool_pages/scan_page.dart index cd7c3c7..429bd06 100644 --- a/lib/ui/tool_pages/scan_page.dart +++ b/lib/ui/tool_pages/scan_page.dart @@ -1,3 +1,5 @@ +import 'package:aku_community_manager/tools/screen_tool.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/material.dart'; import 'package:qr_code_scanner/qr_code_scanner.dart'; @@ -12,6 +14,7 @@ class ScanPage extends StatefulWidget { class _ScanPageState extends State { GlobalKey qrKey = GlobalKey(debugLabel: 'QR'); QRViewController _qrViewController; + String tempText; @override void dispose() { @@ -29,7 +32,10 @@ class _ScanPageState extends State { onQRViewCreated: (controller) { _qrViewController = controller; controller.scannedDataStream.listen((event) { - BotToast.showText(text: event); + if (tempText != event) { + tempText = event; + BotToast.showText(text: event); + } }); }, ), @@ -38,6 +44,7 @@ class _ScanPageState extends State { height: 200, width: 200, decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), border: Border.all( color: Colors.red, width: 1, @@ -45,6 +52,15 @@ class _ScanPageState extends State { ), ), ), + Positioned( + left: 10, + top: 10 + statusBarHeight, + child: Material( + color: Colors.black45, + borderRadius: BorderRadius.circular(40), + child: AkuBackButton.close(brightness: Brightness.dark), + ), + ), ], ), );