Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix isPhysicalDevice check in web environment #296

Open
ethan-tbd opened this issue Sep 6, 2024 · 0 comments
Open

Fix isPhysicalDevice check in web environment #296

ethan-tbd opened this issue Sep 6, 2024 · 0 comments

Comments

@ethan-tbd
Copy link
Contributor

  • when running didpay on web (by selecting "Chrome - web" as your device in VSCode), an unsupported operation error is thrown when running the isPhysicalDevice() check
  • originally, this check was used to see if the user was on a real, physical device so the app knows if it is possible to use the camera (i.e. to scan qr codes)
  • since didpay on web will not support qr code scanning, add a check to the isPhysicalDevice() method in DeviceInfoService to prevent the below error
DartError: Unsupported operation: Platform._operatingSystem
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 297:3       throw_
dart-sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart 244:5                   _operatingSystem
dart-sdk/lib/io/platform_impl.dart 56:40                                          get operatingSystem
dart-sdk/lib/io/platform.dart 83:44                                               get operatingSystem
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 1293:8  get
dart-sdk/lib/io/platform.dart 161:46                                              get isIOS
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 1293:8  get
packages/didpay/features/device/device_info_service.dart 11:53                    isPhysicalDevice
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 127:5                _async
packages/didpay/features/device/device_info_service.dart 11:32                    isPhysicalDevice
packages/didpay/features/dap/dap_qr_tile.dart 28:30                               <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 127:5                _async
packages/didpay/features/dap/dap_qr_tile.dart 27:11                               <fn>
dart-sdk/lib/async/future.dart 422:39                                             <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:11           internalCallback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant