Skip to content

Commit cd54545

Browse files
authored
fix: remove expanded from mobilescanner (#51)
1 parent 0ddb1d3 commit cd54545

1 file changed

Lines changed: 21 additions & 23 deletions

File tree

remote/lib/qr_scanner.dart

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,29 @@ class QRScanner extends StatelessWidget {
1919
backgroundColor: Colors.transparent,
2020
elevation: 0,
2121
),
22-
body: Expanded(
23-
child: MobileScanner(
24-
allowDuplicates: false,
25-
onDetect: (barcode, args) {
26-
final code = barcode.rawValue;
27-
if (code != null) {
28-
if (!urlRegEx.hasMatch(code)) {
29-
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
30-
content:
31-
Text('This QR code is not valid, please check again!'),
32-
));
33-
return;
34-
}
35-
36-
final splitUrl = code.split('/');
37-
uuid = splitUrl[3];
38-
StorageUtil.putString("uuid", uuid!);
39-
40-
Navigator.of(context).pushReplacement(MaterialPageRoute(
41-
builder: (context) => ControlScreen(channelId: uuid!)));
22+
body: MobileScanner(
23+
allowDuplicates: false,
24+
onDetect: (barcode, args) {
25+
final code = barcode.rawValue;
26+
if (code != null) {
27+
if (!urlRegEx.hasMatch(code)) {
28+
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
29+
content:
30+
Text('This QR code is not valid, please check again!'),
31+
));
4232
return;
4333
}
44-
Navigator.of(context).pop();
45-
}),
46-
),
34+
35+
final splitUrl = code.split('/');
36+
uuid = splitUrl[3];
37+
StorageUtil.putString("uuid", uuid!);
38+
39+
Navigator.of(context).pushReplacement(MaterialPageRoute(
40+
builder: (context) => ControlScreen(channelId: uuid!)));
41+
return;
42+
}
43+
Navigator.of(context).pop();
44+
}),
4745
);
4846
}
4947
}

0 commit comments

Comments
 (0)