Skip to content

Commit

Permalink
fix scan item
Browse files Browse the repository at this point in the history
Signed-off-by: phuoc <[email protected]>
  • Loading branch information
phuocbitmark committed Jun 18, 2024
1 parent 3faf563 commit be6d3cd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
24 changes: 22 additions & 2 deletions lib/screen/scan_qr/scan_qr_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ enum ScannerItem {
BEACON_CONNECT,
ETH_ADDRESS,
XTZ_ADDRESS,
GLOBAL
GLOBAL,
CANVAS,
}

class QRScanView extends StatefulWidget {
Expand Down Expand Up @@ -615,7 +616,23 @@ class QRScanViewState extends State<QRScanView>
),
),
);

case ScannerItem.CANVAS:
return RichText(
text: TextSpan(
text: 'display_with_ff'.tr(),
children: [
TextSpan(
text: ' ',
style: theme.textTheme.ppMori400Grey14,
),
TextSpan(
text: 'on_tv_or_desktop'.tr(),
style: theme.textTheme.ppMori400Grey14,
),
],
style: theme.textTheme.ppMori400White14,
),
);
case ScannerItem.ETH_ADDRESS:
case ScannerItem.XTZ_ADDRESS:
return Column(
Expand Down Expand Up @@ -669,6 +686,9 @@ class QRScanViewState extends State<QRScanView>
return;
} else {
switch (widget.scannerItem) {
case ScannerItem.CANVAS:

/// handled with deeplink
case ScannerItem.WALLET_CONNECT:
if (code.startsWith('wc:')) {
await _handleAutonomyConnect(code);
Expand Down
6 changes: 3 additions & 3 deletions lib/view/stream_device_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class _StreamDeviceViewState extends State<StreamDeviceView> {
),
recognizer: TapGestureRecognizer()
..onTap = () async {
await scanToAddMore(context);
await _scanToAddMore(context);
},
),
TextSpan(
Expand Down Expand Up @@ -174,9 +174,9 @@ class _StreamDeviceViewState extends State<StreamDeviceView> {
);
}

Future<void> scanToAddMore(BuildContext context) async {
Future<void> _scanToAddMore(BuildContext context) async {
final device = await Navigator.of(context)
.pushNamed(AppRouter.scanQRPage, arguments: ScannerItem.GLOBAL);
.pushNamed(AppRouter.scanQRPage, arguments: ScannerItem.CANVAS);
log.info('device selected: $device');
_canvasDeviceBloc.add(CanvasDeviceGetDevicesEvent());
}
Expand Down

0 comments on commit be6d3cd

Please sign in to comment.