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
|
||||
# dirs), otherwise install the pinned SDK from the flutter-io.cn mirror
|
||||
# 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
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
if (Get-Command flutter -ErrorAction SilentlyContinue) {
|
||||
Write-Host "flutter already on PATH"; exit 0
|
||||
}
|
||||
$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'
|
||||
$ver = '3.44.2'
|
||||
$root = "C:\flutter-$ver"
|
||||
$bin = Join-Path $root 'flutter\bin'
|
||||
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'
|
||||
$zip = Join-Path $env:TEMP 'flutter_sdk.zip'
|
||||
$url = "https://storage.flutter-io.cn/flutter_infra_release/releases/stable/windows/flutter_windows_$ver-stable.zip"
|
||||
$zip = Join-Path $env:TEMP "flutter_$ver.zip"
|
||||
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
|
||||
# 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"
|
||||
if (Test-Path $curl) {
|
||||
& $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 }
|
||||
}
|
||||
}
|
||||
if (-not $ok) { Write-Error "Failed to download Flutter SDK"; exit 1 }
|
||||
Write-Host "Extracting to $root (this is slow on first run)"
|
||||
if (-not $ok) { Write-Error "Failed to download Flutter $ver"; exit 1 }
|
||||
Write-Host "Extracting to $root (slow on first run)"
|
||||
Expand-Archive -Path $zip -DestinationPath $root -Force
|
||||
Remove-Item $zip -Force
|
||||
}
|
||||
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
|
||||
Write-Host "Flutter $ver pinned at $bin"
|
||||
|
||||
- name: Flutter version
|
||||
run: flutter --version
|
||||
|
||||
Reference in New Issue
Block a user