forked from rustdesk/rustdesk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'rustdesk:master' into master
- Loading branch information
Showing
196 changed files
with
8,324 additions
and
3,978 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<T> extends State<DropdownMenu<T>> { | ||
final GlobalKey _leadingKey = GlobalKey(); | ||
late List<GlobalKey> buttonItemKeys; | ||
final MenuController _controller = MenuController(); | ||
- late bool _enableFilter; | ||
+ bool _enableFilter = false; | ||
late List<DropdownMenuEntry<T>> filteredEntries; | ||
List<Widget>? _initialMenu; | ||
int? currentHighlight; | ||
@@ -524,6 +524,11 @@ class _DropdownMenuState<T> extends State<DropdownMenu<T>> { | ||
} | ||
_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<T> extends State<DropdownMenu<T>> { | ||
); | ||
currentHighlight = widget.enableSearch ? i : null; | ||
widget.onSelected?.call(entry.value); | ||
+ _enableFilter = false; | ||
} | ||
: null, | ||
requestFocusOnHover: false, | ||
@@ -735,6 +741,8 @@ class _DropdownMenuState<T> extends State<DropdownMenu<T>> { | ||
if (_enableFilter) { | ||
filteredEntries = widget.filterCallback?.call(filteredEntries, _localTextEditingController!.text) | ||
?? filter(widget.dropdownMenuEntries, _localTextEditingController!); | ||
+ } else { | ||
+ filteredEntries = widget.dropdownMenuEntries; | ||
} | ||
|
||
if (widget.enableSearch) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.