File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed
lib/widget_system/views/desk_ui/widget_panel Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,17 @@ class _DeskSearchBarState extends State<DeskSearchBar> {
31
31
}
32
32
33
33
void onSelected (WidgetModel model) {
34
+ final FocusScopeNode focusScope = FocusScope .of (context);
35
+ if (focusScope.hasFocus) {
36
+ focusScope.unfocus ();
37
+ }
38
+ _controller.clear ();
39
+
40
+ Navigator .pushNamed (
41
+ context,
42
+ UnitRouter .widget_detail,
43
+ arguments: model,
44
+ );
34
45
}
35
46
36
47
Future <Iterable <WidgetModel >> buildOptions (TextEditingValue textEditingValue) async {
@@ -65,7 +76,7 @@ class _DeskSearchBarState extends State<DeskSearchBar> {
65
76
itemBuilder: (_,index) {
66
77
WidgetModel model = options.elementAt (index);
67
78
return InkWell (
68
- onTap: ()=> _toDetaile (model),
79
+ onTap: ()=> onSelected (model),
69
80
child: Ink (
70
81
padding: EdgeInsets .symmetric (vertical: 6 , horizontal: 15 ),
71
82
child: Row (children: [
@@ -143,17 +154,4 @@ class _DeskSearchBarState extends State<DeskSearchBar> {
143
154
return TextSpan (children: span);
144
155
}
145
156
146
- void _toDetaile (WidgetModel model) {
147
- final FocusScopeNode focusScope = FocusScope .of (context);
148
- if (focusScope.hasFocus) {
149
- focusScope.unfocus ();
150
- }
151
- _controller.clear ();
152
-
153
- Navigator .pushNamed (
154
- context,
155
- UnitRouter .widget_detail,
156
- arguments: model,
157
- );
158
- }
159
157
}
You can’t perform that action at this time.
0 commit comments