Skip to content

Commit

Permalink
FIX FOR REAL (HOPEUFLLY)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryanidk committed Feb 29, 2024
1 parent 883c7b5 commit d75d432
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/screens/scan.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class _ScanResultsPageState extends State<ScanResultsPage> {
QRViewController? controller;

void sendData(values, isGame) {
Navigator.of(context).pop();
// redirect to `send_data.dart` and pass the data
Navigator.push(
context,
Expand Down Expand Up @@ -59,9 +58,6 @@ class _ScanResultsPageState extends State<ScanResultsPage> {
onQRViewCreated: _onQRViewCreated,
),
),
if (result != null)
Text(
'Barcode Type: ${describeEnum(result!.format)} Data: ${result!.code}')
],
),
);
Expand All @@ -71,11 +67,13 @@ class _ScanResultsPageState extends State<ScanResultsPage> {
this.controller = controller;
controller.scannedDataStream.listen((scanData) {
result = scanData;
String? resultData = result!.code;
Map? resultDataMap = jsonDecode(resultData!);
bool? isGame = resultDataMap!['isGame'] == "y" ? true : false;
resultDataMap.remove("isGame");
sendData(resultDataMap, isGame);
if (result != null) {
String? resultData = result!.code;
Map? resultDataMap = jsonDecode(resultData!);
bool? isGame = resultDataMap!['isGame'] == "y" ? true : false;
resultDataMap.remove("isGame");
sendData(resultDataMap, isGame);
}
});
}

Expand Down

0 comments on commit d75d432

Please sign in to comment.