|
@@ -63,76 +63,98 @@ class _ContactListPageState extends State<ContactListPage> |
|
@@ -63,76 +63,98 @@ class _ContactListPageState extends State<ContactListPage> |
|
63
|
vertical: ScreenUtil().setWidth(10)),
|
63
|
vertical: ScreenUtil().setWidth(10)),
|
|
64
|
height: ScreenUtil().setWidth(45 * 2),
|
64
|
height: ScreenUtil().setWidth(45 * 2),
|
|
65
|
// alignment: Alignment.center,
|
65
|
// alignment: Alignment.center,
|
|
66
|
- child: Container(
|
|
|
|
67
|
- alignment: Alignment.center,
|
|
|
|
68
|
- padding: EdgeInsets.symmetric(
|
|
|
|
69
|
- horizontal: ScreenUtil().setWidth(20 * 2),
|
|
|
|
70
|
- vertical: ScreenUtil().setWidth(14)),
|
|
|
|
71
|
- decoration: BoxDecoration(
|
|
|
|
72
|
- color: MyColours.color_F0F0F0,
|
|
|
|
73
|
- borderRadius: BorderRadius.circular(
|
|
|
|
74
|
- ScreenUtil().setWidth(24 * 2))),
|
|
|
|
75
|
- child: TextField(
|
|
|
|
76
|
- controller: contantShowModel.controller,
|
|
|
|
77
|
- // focusNode: _focusNode,
|
|
|
|
78
|
- // autofocus: true,
|
|
|
|
79
|
-
|
|
|
|
80
|
- style: TextStyle(
|
|
|
|
81
|
- color: MyColours.color_333333,
|
|
|
|
82
|
- fontSize: ScreenUtil().setSp(30),
|
|
|
|
83
|
- textBaseline: TextBaseline.alphabetic),
|
|
|
|
84
|
- textAlignVertical: TextAlignVertical.center,
|
|
|
|
85
|
- decoration: InputDecoration(
|
|
|
|
86
|
- hintText: "搜索联系人",
|
|
|
|
87
|
- hintStyle: TextStyle(
|
|
|
|
88
|
- color: MyColours.color_999999,
|
|
|
|
89
|
- fontSize: ScreenUtil().setSp(30),
|
|
|
|
90
|
- ),
|
|
|
|
91
|
- isCollapsed:
|
|
|
|
92
|
- true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
|
|
|
|
93
|
- border: InputBorder.none,
|
|
|
|
94
|
- //左边图标设置
|
|
|
|
95
|
- icon: Image.asset(
|
|
|
|
96
|
- Utils.getImgPath('search'),
|
|
|
|
97
|
- width: ScreenUtil().setWidth(30),
|
66
|
+ child: Stack(
|
|
|
|
67
|
+ children: [
|
|
|
|
68
|
+ Container(
|
|
|
|
69
|
+ alignment: Alignment.center,
|
|
|
|
70
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
71
|
+ horizontal: ScreenUtil().setWidth(20 * 2),
|
|
|
|
72
|
+ vertical: ScreenUtil().setWidth(14)),
|
|
|
|
73
|
+ decoration: BoxDecoration(
|
|
|
|
74
|
+ color: MyColours.color_F0F0F0,
|
|
|
|
75
|
+ borderRadius: BorderRadius.circular(
|
|
|
|
76
|
+ ScreenUtil().setWidth(24 * 2))),
|
|
|
|
77
|
+ child: TextField(
|
|
|
|
78
|
+ maxLines: 1,
|
|
|
|
79
|
+ controller: contantShowModel.controller,
|
|
|
|
80
|
+ // focusNode: _focusNode,
|
|
|
|
81
|
+ // autofocus: true,
|
|
|
|
82
|
+ style: TextStyle(
|
|
|
|
83
|
+ color: MyColours.color_333333,
|
|
|
|
84
|
+ fontSize: ScreenUtil().setSp(30)),
|
|
|
|
85
|
+ // textAlignVertical: TextAlignVertical.center,
|
|
|
|
86
|
+ decoration: InputDecoration(
|
|
|
|
87
|
+ contentPadding: EdgeInsets.only(
|
|
|
|
88
|
+ right: ScreenUtil().setWidth(70 * 2)),
|
|
|
|
89
|
+ hintText: "搜索联系人",
|
|
|
|
90
|
+ hintStyle: TextStyle(
|
|
|
|
91
|
+ color: MyColours.color_999999,
|
|
|
|
92
|
+ fontSize: ScreenUtil().setSp(30),
|
|
|
|
93
|
+ ),
|
|
|
|
94
|
+ isCollapsed:
|
|
|
|
95
|
+ true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
|
|
|
|
96
|
+ border: InputBorder.none,
|
|
|
|
97
|
+ // 左边图标设置
|
|
|
|
98
|
+ icon: Image.asset(
|
|
|
|
99
|
+ Utils.getImgPath('search'),
|
|
|
|
100
|
+ width: ScreenUtil().setWidth(30),
|
|
|
|
101
|
+ ),
|
|
|
|
102
|
+ //右边图标设置
|
|
|
|
103
|
+ // suffixIcon:
|
|
98
|
),
|
104
|
),
|
|
99
|
- //右边图标设置
|
|
|
|
100
|
- suffixIcon: contantShowModel
|
|
|
|
101
|
- .controller.text ==
|
|
|
|
102
|
- ''
|
|
|
|
103
|
- ? Container()
|
|
|
|
104
|
- : GestureDetector(
|
|
|
|
105
|
- child: Container(
|
|
|
|
106
|
- height: ScreenUtil().setWidth(30),
|
105
|
+ keyboardType: TextInputType.text,
|
|
|
|
106
|
+ textInputAction: TextInputAction.done,
|
|
|
|
107
|
+
|
|
|
|
108
|
+ onChanged: (value) {
|
|
|
|
109
|
+ // setState(() {});
|
|
|
|
110
|
+ // _searchSellerLocation();
|
|
|
|
111
|
+ contantShowModel.searchData(value);
|
|
|
|
112
|
+ },
|
|
|
|
113
|
+ onEditingComplete: () {
|
|
|
|
114
|
+ FocusScope.of(context).requestFocus(
|
|
|
|
115
|
+ FocusNode()); //点击空白处隐藏键盘
|
|
|
|
116
|
+ // contantShowModel.searchData(
|
|
|
|
117
|
+ // contantShowModel.controller.text);
|
|
|
|
118
|
+ // _searchSellerLocation();
|
|
|
|
119
|
+ // _focusNode.unfocus();
|
|
|
|
120
|
+ },
|
|
|
|
121
|
+ ),
|
|
|
|
122
|
+ ),
|
|
|
|
123
|
+ Positioned(
|
|
|
|
124
|
+ right: 0,
|
|
|
|
125
|
+ top: 0,
|
|
|
|
126
|
+ bottom: 0,
|
|
|
|
127
|
+ child: Offstage(
|
|
|
|
128
|
+ offstage:
|
|
|
|
129
|
+ contantShowModel.controller.text ==
|
|
|
|
130
|
+ '',
|
|
|
|
131
|
+ child: GestureDetector(
|
|
|
|
132
|
+ child: Container(
|
|
|
|
133
|
+ padding: EdgeInsets.only(
|
|
|
|
134
|
+ right: ScreenUtil()
|
|
|
|
135
|
+ .setWidth(20 * 2)),
|
|
|
|
136
|
+ // color: Colors.orange,
|
|
|
|
137
|
+ height:
|
|
|
|
138
|
+ ScreenUtil().setWidth(45 * 2),
|
|
|
|
139
|
+ width:
|
|
|
|
140
|
+ ScreenUtil().setWidth(100 * 2),
|
|
|
|
141
|
+ alignment: Alignment.centerRight,
|
|
|
|
142
|
+ child: Image.asset(
|
|
|
|
143
|
+ Utils.getImgPath('clear'),
|
|
107
|
width: ScreenUtil().setWidth(30),
|
144
|
width: ScreenUtil().setWidth(30),
|
|
108
|
- alignment: Alignment.centerRight,
|
|
|
|
109
|
- child: Image.asset(
|
|
|
|
110
|
- Utils.getImgPath('clear'),
|
|
|
|
111
|
- width:
|
|
|
|
112
|
- ScreenUtil().setWidth(30),
|
|
|
|
113
|
- ),
|
145
|
+ height: ScreenUtil().setWidth(30),
|
|
114
|
),
|
146
|
),
|
|
115
|
- onTap: () {
|
|
|
|
116
|
- WidgetsBinding.instance
|
|
|
|
117
|
- .addPostFrameCallback(((_) {
|
|
|
|
118
|
- contantShowModel.controller
|
|
|
|
119
|
- .clear();
|
|
|
|
120
|
- contantShowModel.searchData('');
|
|
|
|
121
|
- }));
|
|
|
|
122
|
- },
|
|
|
|
123
|
- )),
|
|
|
|
124
|
- keyboardType: TextInputType.text,
|
|
|
|
125
|
- textInputAction: TextInputAction.search,
|
|
|
|
126
|
- onChanged: (value) {
|
|
|
|
127
|
- setState(() {});
|
|
|
|
128
|
- // _searchSellerLocation();
|
|
|
|
129
|
- contantShowModel.searchData(value);
|
|
|
|
130
|
- },
|
|
|
|
131
|
- onEditingComplete: () {
|
|
|
|
132
|
- // _searchSellerLocation();
|
|
|
|
133
|
- // _focusNode.unfocus();
|
|
|
|
134
|
- },
|
|
|
|
135
|
- ),
|
147
|
+ ),
|
|
|
|
148
|
+ onTap: () {
|
|
|
|
149
|
+ WidgetsBinding.instance
|
|
|
|
150
|
+ .addPostFrameCallback(((_) {
|
|
|
|
151
|
+ contantShowModel.controller
|
|
|
|
152
|
+ .clear();
|
|
|
|
153
|
+ contantShowModel.searchData('');
|
|
|
|
154
|
+ }));
|
|
|
|
155
|
+ },
|
|
|
|
156
|
+ )))
|
|
|
|
157
|
+ ],
|
|
136
|
)),
|
158
|
)),
|
|
137
|
Container(
|
159
|
Container(
|
|
138
|
padding: EdgeInsets.only(
|
160
|
padding: EdgeInsets.only(
|