Skip to content

Commit

Permalink
Fix QR checking data parsing error
Browse files Browse the repository at this point in the history
  • Loading branch information
sukso96100 committed Jul 25, 2024
1 parent 353f405 commit cc8f6c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions lib/checkInByBarcodeScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,11 @@ class _CheckInByBarcodeScreenState extends State<CheckInByBarcodeScreen> {
labelText: 'Barcode data',
),
onSubmitted: (value) async {
var rawQrJsonData = base64.decode(value).toString();
var qrJsonData = json.decode(rawQrJsonData);

var rawQrJsonData = utf8.decode(base64.decode(value));
var qrJsonData = jsonDecode(rawQrJsonData);
var serverResult = await kioskClient.checkInBySearch(
int.parse(qrJsonData['id']),
qrJsonData['passcode']);
qrJsonData['id'],
qrJsonData['passcode'].toString());
var participantData = await kioskClient
.getParticipantById(qrJsonData['id']);
var snackBar = SnackBar(
Expand Down
2 changes: 1 addition & 1 deletion lib/kioskclient.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class KioskClient {
var response =
await http.get(url, headers: {'Authorization': 'Token $apiToken'});
var status = response.statusCode;
var result = jsonDecode(utf8.decode(response.bodyBytes)) as List;
var result = jsonDecode(utf8.decode(response.bodyBytes));
return (status == 200, result);
}

Expand Down

0 comments on commit cc8f6c2

Please sign in to comment.