diff --git a/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff b/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff new file mode 100644 index 000000000..9b8ea2690 --- /dev/null +++ b/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff @@ -0,0 +1,42 @@ +diff --git a/packages/flutter/lib/src/material/dropdown_menu.dart b/packages/flutter/lib/src/material/dropdown_menu.dart +index 7e634cd2aa..c1e9acc295 100644 +--- a/packages/flutter/lib/src/material/dropdown_menu.dart ++++ b/packages/flutter/lib/src/material/dropdown_menu.dart +@@ -475,7 +475,7 @@ class _DropdownMenuState extends State> { + final GlobalKey _leadingKey = GlobalKey(); + late List buttonItemKeys; + final MenuController _controller = MenuController(); +- late bool _enableFilter; ++ bool _enableFilter = false; + late List> filteredEntries; + List? _initialMenu; + int? currentHighlight; +@@ -524,6 +524,11 @@ class _DropdownMenuState extends State> { + } + _localTextEditingController = widget.controller ?? TextEditingController(); + } ++ if (oldWidget.enableFilter != widget.enableFilter) { ++ if (!widget.enableFilter) { ++ _enableFilter = false; ++ } ++ } + if (oldWidget.enableSearch != widget.enableSearch) { + if (!widget.enableSearch) { + currentHighlight = null; +@@ -663,6 +668,7 @@ class _DropdownMenuState extends State> { + ); + currentHighlight = widget.enableSearch ? i : null; + widget.onSelected?.call(entry.value); ++ _enableFilter = false; + } + : null, + requestFocusOnHover: false, +@@ -735,6 +741,8 @@ class _DropdownMenuState extends State> { + if (_enableFilter) { + filteredEntries = widget.filterCallback?.call(filteredEntries, _localTextEditingController!.text) + ?? filter(widget.dropdownMenuEntries, _localTextEditingController!); ++ } else { ++ filteredEntries = widget.dropdownMenuEntries; + } + + if (widget.enableSearch) { diff --git a/.github/workflows/flutter-build.yml b/.github/workflows/flutter-build.yml index 6fd234969..595a604f6 100644 --- a/.github/workflows/flutter-build.yml +++ b/.github/workflows/flutter-build.yml @@ -114,6 +114,15 @@ jobs: Expand-Archive -Path windows-x64-release.zip -DestinationPath windows-x64-release mv -Force windows-x64-release/*  C:/hostedtoolcache/windows/flutter/stable-${{ env.FLUTTER_VERSION }}-x64/bin/cache/artifacts/engine/windows-x64-release/ + - name: Patch flutter + shell: bash + run: | + cd $(dirname $(dirname $(which flutter))) + # https://github.com/flutter/flutter/commit/b5847d364a26d727af58ab885a6123e0e5304b2b#diff-634a338bd9ed19b66a27beba35a8acf4defffd8beff256113e6811771a0c4821R543 + PATCH_PATH="${{ github.workspace }}/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff" + PATCH_PATH=$(echo "$PATCH_PATH" | sed 's/\\/\//g') + [[ "3.24.4" == ${{env.FLUTTER_VERSION}} ]] && git apply "$PATCH_PATH" + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@v1 with: @@ -486,6 +495,11 @@ jobs: channel: "stable" flutter-version: ${{ env.FLUTTER_VERSION }} + - name: Patch flutter + run: | + cd $(dirname $(dirname $(which flutter))) + [[ "3.24.4" == ${{env.FLUTTER_VERSION}} ]] && git apply ${{ github.workspace }}/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff + - name: Setup vcpkg with Github Actions binary cache uses: lukka/run-vcpkg@v11 with: @@ -687,6 +701,11 @@ jobs: channel: "stable" flutter-version: ${{ env.FLUTTER_VERSION }} + - name: Patch flutter + run: | + cd $(dirname $(dirname $(which flutter))) + [[ "3.24.4" == ${{env.FLUTTER_VERSION}} ]] && git apply ${{ github.workspace }}/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff + - name: Workaround for flutter issue shell: bash run: | @@ -922,6 +941,12 @@ jobs: with: channel: "stable" flutter-version: ${{ env.ANDROID_FLUTTER_VERSION }} + + - name: Patch flutter + run: | + cd $(dirname $(dirname $(which flutter))) + [[ "3.24.4" == ${{env.ANDROID_FLUTTER_VERSION}} ]] && git apply ${{ github.workspace }}/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff + - uses: nttld/setup-ndk@v1 id: setup-ndk with: @@ -1194,6 +1219,11 @@ jobs: channel: "stable" flutter-version: ${{ env.ANDROID_FLUTTER_VERSION }} + - name: Patch flutter + run: | + cd $(dirname $(dirname $(which flutter))) + [[ "3.24.4" == ${{env.ANDROID_FLUTTER_VERSION}} ]] && git apply ${{ github.workspace }}/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff + - name: Restore bridge files uses: actions/download-artifact@master with: @@ -1543,6 +1573,12 @@ jobs: ;; esac + if [[ "3.24.4" == ${{ env.FLUTTER_VERSION }} ]]; then + pushd $(dirname $(dirname $(which flutter))) + git apply ${{ github.workspace }}/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff + popd + fi + # build flutter pushd /workspace export CARGO_INCREMENTAL=0 @@ -2014,6 +2050,12 @@ jobs: flutter-version: ${{ env.FLUTTER_VERSION }} cache: true + - name: Patch flutter + shell: bash + run: | + cd $(dirname $(dirname $(which flutter))) + [[ "3.24.4" == ${{env.FLUTTER_VERSION}} ]] && git apply ${{ github.workspace }}/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff + # https://rustdesk.com/docs/en/dev/build/web/ - name: Build web shell: bash