From 383c9a0177c4f45c1154ca6497c4750809d872e7 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Wed, 13 Mar 2024 17:28:24 +0100 Subject: [PATCH] disable: permission handler for windows --- .github/workflows/build.yml | 6 ++++++ lib/features/profile/add/add_profile_modal.dart | 12 +++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2670fad0..65bd4d4a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -171,6 +171,12 @@ jobs: if: ${{ startsWith(matrix.platform,'windows') }} run: | (Get-Content -Path "pubspec.yaml") -notmatch "permission_handler" | Set-Content -Path "pubspec.yaml" + (Get-Content -Path "lib\features\profile\add\add_profile_modal.dart") -notmatch "qr_code_scanner_screen" | Set-Content -Path "lib\features\profile\add\add_profile_modal.dart" + (Get-Content -Path lib\features\profile\add\add_profile_modal.dart) -replace 'await QRCodeScannerScreen\(\).open\(context\);', 'null;' | Set-Content -Path lib\features\profile\add\add_profile_modal.dart + Remove-Item -Path "lib\features\common\qr_code_scanner_screen.dart" + + + - name: Prepare for ${{ matrix.platform }} run: | diff --git a/lib/features/profile/add/add_profile_modal.dart b/lib/features/profile/add/add_profile_modal.dart index 7fb3c365..5752d532 100644 --- a/lib/features/profile/add/add_profile_modal.dart +++ b/lib/features/profile/add/add_profile_modal.dart @@ -120,14 +120,12 @@ class AddProfileModal extends HookConsumerWidget { icon: FluentIcons.qr_code_24_regular, size: buttonWidth, onTap: () async { - final captureResult = - await const QRCodeScannerScreen() - .open(context); - if (captureResult == null) return; + final cr = + await QRCodeScannerScreen().open(context); + + if (cr == null) return; if (addProfileState.isLoading) return; - ref - .read(addProfileProvider.notifier) - .add(captureResult); + ref.read(addProfileProvider.notifier).add(cr); }, ) else