contant_page.dart
10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
// import 'package:flutter/material.dart';
// import 'package:contacts_service/contacts_service.dart';
// import 'package:flutter_screenutil/screenutil.dart';
// import 'package:one_key/pages/my/contant_left_page.dart';
// import 'package:one_key/pages/my/contant_right_page.dart';
// import 'package:one_key/provider/contant_show_model.dart';
// import 'package:one_key/res/colors.dart';
// import 'package:one_key/utils/event_bus.dart';
// import 'package:one_key/utils/utils.dart';
// import 'package:one_key/widgets/custom_tab_indicator.dart';
// import 'package:one_key/widgets/system_app_bar.dart';
// import 'package:provider/provider.dart';
// class ContactListPage extends StatefulWidget {
// @override
// _ContactListPageState createState() => _ContactListPageState();
// }
// class _ContactListPageState extends State<ContactListPage>
// with TickerProviderStateMixin {
// List<Contact> _contacts;
// List _tabBarTitle;
// TabController tabController;
// ContantShowModel contantShowModel;
// @override
// void initState() {
// _tabBarTitle = ['预订联系人', '手机联系人'];
// super.initState();
// tabController = TabController(length: 2, vsync: this);
// }
// @override
// Widget build(BuildContext context) {
// contantShowModel = Provider.of<ContantShowModel>(context, listen: true);
// return Material(
// child: InkWell(
// onTap: () {
// // FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
// },
// child: Scaffold(
// resizeToAvoidBottomInset: false,
// backgroundColor: MyColours.color_ffffff,
// appBar: SystemAppBar(
// '联系人',
// onTap: () {
// EventBus().emit('changeStatusColor');
// Navigator.of(context).pop();
// },
// ),
// body: WillPopScope(
// child: SafeArea(
// child: Column(
// children: <Widget>[
// Container(
// // color: Colors.red,
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(40),
// vertical: ScreenUtil().setWidth(10)),
// height: ScreenUtil().setWidth(45 * 2),
// // alignment: Alignment.center,
// child: Stack(
// children: [
// Container(
// alignment: Alignment.center,
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(20 * 2),
// vertical: ScreenUtil().setWidth(14)),
// decoration: BoxDecoration(
// color: MyColours.color_F0F0F0,
// borderRadius: BorderRadius.circular(
// ScreenUtil().setWidth(24 * 2))),
// child: TextField(
// maxLines: 1,
// controller: contantShowModel.controller,
// // focusNode: _focusNode,
// // autofocus: true,
// style: TextStyle(
// color: MyColours.color_333333,
// fontSize: ScreenUtil().setSp(30)),
// // textAlignVertical: TextAlignVertical.center,
// decoration: InputDecoration(
// contentPadding: EdgeInsets.only(
// right: ScreenUtil().setWidth(40 * 2)),
// hintText: "搜索联系人",
// hintStyle: TextStyle(
// color: MyColours.color_999999,
// fontSize: ScreenUtil().setSp(30),
// ),
// isCollapsed:
// true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
// border: OutlineInputBorder(
// borderSide: BorderSide.none),
// // 左边图标设置
// icon: Image.asset(
// Utils.getImgPath('search'),
// width: ScreenUtil().setWidth(30),
// ),
// //右边图标设置
// // suffixIcon:
// ),
// keyboardType: TextInputType.text,
// textInputAction: TextInputAction.done,
// onChanged: (value) {
// // setState(() {});
// // _searchSellerLocation();
// contantShowModel.searchData(value);
// },
// onEditingComplete: () {
// FocusScope.of(context).requestFocus(
// FocusNode()); //点击空白处隐藏键盘
// // contantShowModel.searchData(
// // contantShowModel.controller.text);
// // _searchSellerLocation();
// // _focusNode.unfocus();
// },
// ),
// ),
// Positioned(
// right: 0,
// top: 0,
// bottom: 0,
// child: Offstage(
// offstage:
// contantShowModel.controller.text ==
// '',
// child: GestureDetector(
// child: Container(
// padding: EdgeInsets.only(
// right: ScreenUtil()
// .setWidth(20 * 2)),
// // color: Colors.orange,
// height:
// ScreenUtil().setWidth(45 * 2),
// width:
// ScreenUtil().setWidth(100 * 2),
// alignment: Alignment.centerRight,
// child: Image.asset(
// Utils.getImgPath('clear'),
// width: ScreenUtil().setWidth(30),
// height: ScreenUtil().setWidth(30),
// ),
// ),
// onTap: () {
// WidgetsBinding.instance
// .addPostFrameCallback(((_) {
// contantShowModel.controller
// .clear();
// contantShowModel.searchData('');
// }));
// },
// )))
// ],
// )),
// Container(
// padding: EdgeInsets.only(
// bottom: ScreenUtil().setWidth(10)),
// margin: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(30)),
// child: TabBar(
// controller: tabController,
// indicator: CustomTabIndicator(
// radius: 0,
// ),
// indicatorColor: MyColours.color_199095,
// indicatorSize: TabBarIndicatorSize.tab,
// // indicatorPadding: EdgeInsets.symmetric(
// // horizontal: ScreenUtil().setWidth(12)),
// labelColor: MyColours.color_199095,
// labelStyle: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// fontWeight: FontWeight.bold),
// labelPadding: EdgeInsets.zero,
// unselectedLabelStyle:
// TextStyle(fontWeight: FontWeight.normal),
// unselectedLabelColor: MyColours.color_999999,
// tabs: _tabBarTitle.map((value) {
// return Tab(
// child: Text(value),
// );
// }).toList()),
// ),
// Expanded(
// child: TabBarView(
// controller: tabController,
// // physics: NeverScrollableScrollPhysics(),
// children: <Widget>[
// ContantLeftPage(),
// ContantRightPage(),
// ],
// )),
// ],
// )),
// onWillPop: () async {
// EventBus().emit('changeStatusColor');
// return true;
// }))));
// }
// }