Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Fix isPhysicalDevice check in web environment #296

@ethanwlee

Description

@ethanwlee
  • 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions