|
|
@ -4,7 +4,7 @@ import 'package:aku_community_manager/tools/screen_tool.dart';
|
|
|
|
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart';
|
|
|
|
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart';
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:qr_code_scanner/qr_code_scanner.dart';
|
|
|
|
// import 'package:qr_code_scanner/qr_code_scanner.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class ScanPage extends StatefulWidget {
|
|
|
|
class ScanPage extends StatefulWidget {
|
|
|
|
ScanPage({Key key}) : super(key: key);
|
|
|
|
ScanPage({Key key}) : super(key: key);
|
|
|
@ -15,7 +15,7 @@ class ScanPage extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
|
|
class _ScanPageState extends State<ScanPage> {
|
|
|
|
class _ScanPageState extends State<ScanPage> {
|
|
|
|
GlobalKey qrKey = GlobalKey(debugLabel: 'QR');
|
|
|
|
GlobalKey qrKey = GlobalKey(debugLabel: 'QR');
|
|
|
|
QRViewController _qrViewController;
|
|
|
|
// QRViewController _qrViewController;
|
|
|
|
String tempText;
|
|
|
|
String tempText;
|
|
|
|
Timer _timer;
|
|
|
|
Timer _timer;
|
|
|
|
bool _barMove = false;
|
|
|
|
bool _barMove = false;
|
|
|
@ -33,7 +33,7 @@ class _ScanPageState extends State<ScanPage> {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
void dispose() {
|
|
|
|
_qrViewController?.dispose();
|
|
|
|
// _qrViewController?.dispose();
|
|
|
|
_timer?.cancel();
|
|
|
|
_timer?.cancel();
|
|
|
|
super.dispose();
|
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -43,18 +43,18 @@ class _ScanPageState extends State<ScanPage> {
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
body: Stack(
|
|
|
|
body: Stack(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
QRView(
|
|
|
|
// QRView(
|
|
|
|
key: qrKey,
|
|
|
|
// key: qrKey,
|
|
|
|
onQRViewCreated: (controller) {
|
|
|
|
// onQRViewCreated: (controller) {
|
|
|
|
_qrViewController = controller;
|
|
|
|
// _qrViewController = controller;
|
|
|
|
controller.scannedDataStream.listen((event) {
|
|
|
|
// controller.scannedDataStream.listen((event) {
|
|
|
|
if (tempText != event) {
|
|
|
|
// if (tempText != event) {
|
|
|
|
tempText = event;
|
|
|
|
// tempText = event;
|
|
|
|
BotToast.showText(text: event);
|
|
|
|
// BotToast.showText(text: event);
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
},
|
|
|
|
// },
|
|
|
|
),
|
|
|
|
// ),
|
|
|
|
Center(
|
|
|
|
Center(
|
|
|
|
child: Stack(
|
|
|
|
child: Stack(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|