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.
- Loading branch information
1 parent
28d79c1
commit dc883ce
Showing
4 changed files
with
244 additions
and
18 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
.github/patches/flutter_3.13.9_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,38 @@ | ||
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 | ||
@@ -287,7 +28,7 @@ class _DropdownMenuState<T> extends State<DropdownMenu<T>> { | ||
late List<GlobalKey> buttonItemKeys; | ||
final MenuController _controller = MenuController(); | ||
late final TextEditingController _textEditingController; | ||
- late bool _enableFilter; | ||
+ bool _enableFilter = false; | ||
late List<DropdownMenuEntry<T>> filteredEntries; | ||
List<Widget>? _initialMenu; | ||
int? currentHighlight; | ||
@@ -317,4 +317,9 @@ class _DropdownMenuState<T> extends State<DropdownMenu<T>> { | ||
super.didUpdateWidget(oldWidget); | ||
+ if (oldWidget.enableFilter != widget.enableFilter) { | ||
+ if (!widget.enableFilter) { | ||
+ _enableFilter = false; | ||
+ } | ||
+ } | ||
if (oldWidget.enableSearch != widget.enableSearch) { | ||
if (!widget.enableSearch) { | ||
currentHighlight = null; | ||
@@ -447,5 +451,6 @@ class _DropdownMenuState<T> extends State<DropdownMenu<T>> { | ||
currentHighlight = widget.enableSearch ? i : null; | ||
widget.onSelected?.call(entry.value); | ||
+ _enableFilter = false; | ||
} | ||
: null, | ||
requestFocusOnHover: false, | ||
@@ -517,5 +521,7 @@ class _DropdownMenuState<T> extends State<DropdownMenu<T>> { | ||
if (_enableFilter) { | ||
filteredEntries = filter(widget.dropdownMenuEntries, _textEditingController); | ||
+ } else { | ||
+ filteredEntries = widget.dropdownMenuEntries; | ||
} | ||
|
||
if (widget.enableSearch) { |
41 changes: 41 additions & 0 deletions
41
.github/patches/flutter_3.19.6_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,41 @@ | ||
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 | ||
@@ -348,7 +348,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; | ||
@@ -393,6 +393,11 @@ class _DropdownMenuState<T> extends State<DropdownMenu<T>> { | ||
_localTextEditingController = null; | ||
} | ||
} | ||
+ if (oldWidget.enableFilter != widget.enableFilter) { | ||
+ if (!widget.enableFilter) { | ||
+ _enableFilter = false; | ||
+ } | ||
+ } | ||
if (oldWidget.enableSearch != widget.enableSearch) { | ||
if (!widget.enableSearch) { | ||
currentHighlight = null; | ||
@@ -541,6 +546,7 @@ class _DropdownMenuState<T> extends State<DropdownMenu<T>> { | ||
); | ||
currentHighlight = widget.enableSearch ? i : null; | ||
widget.onSelected?.call(entry.value); | ||
+ _enableFilter = false; | ||
} | ||
: null, | ||
requestFocusOnHover: false, | ||
@@ -613,5 +618,7 @@ class _DropdownMenuState<T> extends State<DropdownMenu<T>> { | ||
if (_enableFilter) { | ||
filteredEntries = filter(widget.dropdownMenuEntries, _textEditingController); | ||
+ } 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
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