fix(windows): require Flutter 3.44 for pen input
All checks were successful
CI / Windows build (push) Successful in 10m10s
All checks were successful
CI / Windows build (push) Successful in 10m10s
Surface Pen reports as PointerDeviceKind.stylus and multitouch is delivered only on Flutter 3.44+ (WM_POINTER migration, PR #165323). 3.41.4 dropped pen events, so our stylus-kind capture got nothing and pinch-zoom did not work. Pin CI to Flutter 3.44.2 (shadowing any cached older SDK on the runner) and require flutter >=3.44.0 in pubspec.
This commit is contained in:
@@ -35,39 +35,25 @@ jobs:
|
|||||||
# Flutter on PATH, so: use it if present (PATH / FLUTTER_ROOT / common
|
# Flutter on PATH, so: use it if present (PATH / FLUTTER_ROOT / common
|
||||||
# dirs), otherwise install the pinned SDK from the flutter-io.cn mirror
|
# dirs), otherwise install the pinned SDK from the flutter-io.cn mirror
|
||||||
# into a persistent dir (C:\flutter-ci) that is reused across runs.
|
# into a persistent dir (C:\flutter-ci) that is reused across runs.
|
||||||
- name: Set up Flutter
|
# Pin Flutter 3.44.2 DETERMINISTICALLY. pdfrx needs Windows stylus +
|
||||||
|
# multitouch, which only landed in Flutter 3.44.0 (WM_POINTER migration).
|
||||||
|
# We install into a version-pinned dir and PREPEND it to PATH so this
|
||||||
|
# version shadows any older Flutter already on the runner (a stale
|
||||||
|
# C:\flutter-ci from prior runs must NOT win, or pen input breaks again).
|
||||||
|
- name: Set up Flutter (pinned 3.44.2)
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$ErrorActionPreference = 'Stop'
|
$ErrorActionPreference = 'Stop'
|
||||||
$ProgressPreference = 'SilentlyContinue'
|
$ProgressPreference = 'SilentlyContinue'
|
||||||
if (Get-Command flutter -ErrorAction SilentlyContinue) {
|
$ver = '3.44.2'
|
||||||
Write-Host "flutter already on PATH"; exit 0
|
$root = "C:\flutter-$ver"
|
||||||
}
|
|
||||||
$candidates = @()
|
|
||||||
if ($env:FLUTTER_ROOT) { $candidates += (Join-Path $env:FLUTTER_ROOT 'bin') }
|
|
||||||
$candidates += @(
|
|
||||||
'C:\flutter-ci\flutter\bin','C:\flutter\bin','C:\src\flutter\bin',
|
|
||||||
'C:\tools\flutter\bin','C:\dev\flutter\bin',
|
|
||||||
"$env:USERPROFILE\flutter\bin","$env:LOCALAPPDATA\flutter\bin"
|
|
||||||
)
|
|
||||||
foreach ($c in $candidates) {
|
|
||||||
if ($c -and (Test-Path (Join-Path $c 'flutter.bat'))) {
|
|
||||||
Write-Host "Found Flutter at $c"
|
|
||||||
Add-Content -Path $env:GITHUB_PATH -Value $c
|
|
||||||
exit 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# Install the pinned SDK from the China mirror into a persistent dir.
|
|
||||||
$root = 'C:\flutter-ci'
|
|
||||||
$bin = Join-Path $root 'flutter\bin'
|
$bin = Join-Path $root 'flutter\bin'
|
||||||
if (-not (Test-Path (Join-Path $bin 'flutter.bat'))) {
|
if (-not (Test-Path (Join-Path $bin 'flutter.bat'))) {
|
||||||
$url = 'https://storage.flutter-io.cn/flutter_infra_release/releases/stable/windows/flutter_windows_3.41.4-stable.zip'
|
$url = "https://storage.flutter-io.cn/flutter_infra_release/releases/stable/windows/flutter_windows_$ver-stable.zip"
|
||||||
$zip = Join-Path $env:TEMP 'flutter_sdk.zip'
|
$zip = Join-Path $env:TEMP "flutter_$ver.zip"
|
||||||
New-Item -ItemType Directory -Force -Path $root | Out-Null
|
New-Item -ItemType Directory -Force -Path $root | Out-Null
|
||||||
Write-Host "Downloading Flutter SDK from $url"
|
Write-Host "Downloading Flutter $ver from $url"
|
||||||
$ok = $false
|
$ok = $false
|
||||||
# curl.exe (bundled on Windows 10+) streams to disk and is far
|
|
||||||
# faster than Invoke-WebRequest for a ~1GB file. Fall back to IWR.
|
|
||||||
$curl = "$env:SystemRoot\System32\curl.exe"
|
$curl = "$env:SystemRoot\System32\curl.exe"
|
||||||
if (Test-Path $curl) {
|
if (Test-Path $curl) {
|
||||||
& $curl -L --fail --retry 3 --retry-delay 5 -o $zip $url
|
& $curl -L --fail --retry 3 --retry-delay 5 -o $zip $url
|
||||||
@@ -80,16 +66,18 @@ jobs:
|
|||||||
catch { Write-Host "IWR attempt $i failed: $_"; Start-Sleep 5 }
|
catch { Write-Host "IWR attempt $i failed: $_"; Start-Sleep 5 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (-not $ok) { Write-Error "Failed to download Flutter SDK"; exit 1 }
|
if (-not $ok) { Write-Error "Failed to download Flutter $ver"; exit 1 }
|
||||||
Write-Host "Extracting to $root (this is slow on first run)"
|
Write-Host "Extracting to $root (slow on first run)"
|
||||||
Expand-Archive -Path $zip -DestinationPath $root -Force
|
Expand-Archive -Path $zip -DestinationPath $root -Force
|
||||||
Remove-Item $zip -Force
|
Remove-Item $zip -Force
|
||||||
}
|
}
|
||||||
if (-not (Test-Path (Join-Path $bin 'flutter.bat'))) {
|
if (-not (Test-Path (Join-Path $bin 'flutter.bat'))) {
|
||||||
Write-Error "Flutter install failed"; exit 1
|
Write-Error "Flutter $ver install failed"; exit 1
|
||||||
}
|
}
|
||||||
Write-Host "Flutter ready at $bin"
|
# Prepend (first line wins in GITHUB_PATH) so 3.44.2 shadows any
|
||||||
|
# system/cached Flutter on the runner.
|
||||||
Add-Content -Path $env:GITHUB_PATH -Value $bin
|
Add-Content -Path $env:GITHUB_PATH -Value $bin
|
||||||
|
Write-Host "Flutter $ver pinned at $bin"
|
||||||
|
|
||||||
- name: Flutter version
|
- name: Flutter version
|
||||||
run: flutter --version
|
run: flutter --version
|
||||||
|
|||||||
22
pubspec.lock
22
pubspec.lock
@@ -125,10 +125,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: characters
|
name: characters
|
||||||
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
|
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.0"
|
version: "1.4.1"
|
||||||
checked_yaml:
|
checked_yaml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -635,26 +635,26 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
|
sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.17"
|
version: "0.12.19"
|
||||||
material_color_utilities:
|
material_color_utilities:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: material_color_utilities
|
name: material_color_utilities
|
||||||
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
|
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.11.1"
|
version: "0.13.0"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
|
sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.17.0"
|
version: "1.18.0"
|
||||||
mime:
|
mime:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1184,10 +1184,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
|
sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.7"
|
version: "0.7.11"
|
||||||
timing:
|
timing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1374,4 +1374,4 @@ packages:
|
|||||||
version: "3.1.3"
|
version: "3.1.3"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.10.8 <4.0.0"
|
dart: ">=3.10.8 <4.0.0"
|
||||||
flutter: ">=3.41.0"
|
flutter: ">=3.44.0"
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ version: 0.1.0+1
|
|||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.10.8
|
sdk: ^3.10.8
|
||||||
|
# pdfrx + Surface Pen require Windows stylus/multitouch, which only exists
|
||||||
|
# in Flutter 3.44+ (WM_POINTER migration, PR #165323). Building on older
|
||||||
|
# Flutter silently breaks pen input on Windows.
|
||||||
|
flutter: ">=3.44.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
|
|||||||
Reference in New Issue
Block a user