Showing
8 changed files
with
262 additions
and
240 deletions
| @@ -214,91 +214,93 @@ class _EditReserverPageState extends State<EditReserverPage> { | @@ -214,91 +214,93 @@ class _EditReserverPageState extends State<EditReserverPage> { | ||
| 214 | } | 214 | } |
| 215 | 215 | ||
| 216 | _getCallLog() async { | 216 | _getCallLog() async { |
| 217 | - Iterable<CallLogEntry> result = await CallLog.query(); | ||
| 218 | - List<Picker.PickerItem<dynamic>> data = []; | 217 | + try { |
| 218 | + Iterable<CallLogEntry> result = await CallLog.query(); | ||
| 219 | + List<Picker.PickerItem<dynamic>> data = []; | ||
| 219 | 220 | ||
| 220 | - List<CallLogEntry> object = Utils.removeDuplicates(result.toList()); | 221 | + List<CallLogEntry> object = Utils.removeDuplicates(result.toList()); |
| 221 | 222 | ||
| 222 | - print(object); | 223 | + print(object); |
| 223 | 224 | ||
| 224 | - detailModel.userHistorys = []; | ||
| 225 | - showPhoneHistory = false; | ||
| 226 | - // setState(() {}); | ||
| 227 | - | ||
| 228 | - object.forEach((element) { | ||
| 229 | - detailModel.userHistorys.add(UserHistoryEntity( | ||
| 230 | - '', '', element.name ?? '', '1', element.number, '', '', '')); | 225 | + detailModel.userHistorys = []; |
| 226 | + showPhoneHistory = false; | ||
| 227 | + // setState(() {}); | ||
| 231 | 228 | ||
| 232 | - String title = ''; | ||
| 233 | - title += ' ${element.number ?? ''}'; | ||
| 234 | - if (element.name != null && element.name != '') { | ||
| 235 | - title += ' ${element.name}'; | ||
| 236 | - } | 229 | + object.forEach((element) { |
| 230 | + detailModel.userHistorys.add(UserHistoryEntity( | ||
| 231 | + '', '', element.name ?? '', '1', element.number, '', '', '')); | ||
| 237 | 232 | ||
| 238 | - String stateStr = ''; //状态 | ||
| 239 | - | ||
| 240 | - if (element.callType.name == 'incoming' || | ||
| 241 | - element.callType.name == 'wifiIncoming' || | ||
| 242 | - element.callType.name == 'answeredExternally') { | ||
| 243 | - stateStr = ' 呼入'; | ||
| 244 | - } else if (element.callType.name == 'outgoing' || | ||
| 245 | - element.callType.name == 'wifiOutgoing' || | ||
| 246 | - element.callType.name == 'voiceMail') { | ||
| 247 | - stateStr = ' 呼出'; | ||
| 248 | - } else if (element.callType.name == 'missed') { | ||
| 249 | - stateStr = ' 未接'; | ||
| 250 | - } else if (element.callType.name == 'rejected') { | ||
| 251 | - stateStr = ' 拒接'; | ||
| 252 | - } else if (element.callType.name == 'blocked') { | ||
| 253 | - stateStr = ' 拦截'; | ||
| 254 | - } | 233 | + String title = ''; |
| 234 | + title += ' ${element.number ?? ''}'; | ||
| 235 | + if (element.name != null && element.name != '') { | ||
| 236 | + title += ' ${element.name}'; | ||
| 237 | + } | ||
| 255 | 238 | ||
| 256 | - String sunString = | ||
| 257 | - Utils.formatCallLogFromMill(element.timestamp.toString()); | ||
| 258 | - | ||
| 259 | - data.add(Picker.PickerItem( | ||
| 260 | - text: Row( | ||
| 261 | - mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 262 | - children: [ | ||
| 263 | - Expanded( | ||
| 264 | - child: Row( | ||
| 265 | - children: [ | ||
| 266 | - HEmptyView(30), | ||
| 267 | - Text(title ?? '', | ||
| 268 | - style: TextStyle( | ||
| 269 | - fontSize: font(16), color: MyColours.color_515151)), | ||
| 270 | - Expanded( | ||
| 271 | - child: Text(stateStr ?? '', | ||
| 272 | - style: TextStyle( | ||
| 273 | - fontSize: font(16), | ||
| 274 | - color: MyColours.color_26000000))), | ||
| 275 | - ], | ||
| 276 | - )), | ||
| 277 | - Container( | ||
| 278 | - margin: EdgeInsets.only(right: w(15)), | ||
| 279 | - child: Text(sunString ?? '', | ||
| 280 | - style: TextStyle( | ||
| 281 | - fontSize: font(16), color: MyColours.color_515151))) | ||
| 282 | - ], | ||
| 283 | - ))); | ||
| 284 | - }); | ||
| 285 | - if (data.length > 0) { | ||
| 286 | - //有记录,底部弹窗展示 | ||
| 287 | - // showPhoneHistory = true; | ||
| 288 | - // setState(() {}); | ||
| 289 | - DialogUtil.showSelectCusmanWidgetDialog(context, data, (value) { | ||
| 290 | - if (value != null) { | ||
| 291 | - _byValueToReqeust(value[0]); | 239 | + String stateStr = ''; //状态 |
| 240 | + | ||
| 241 | + if (element.callType.name == 'incoming' || | ||
| 242 | + element.callType.name == 'wifiIncoming' || | ||
| 243 | + element.callType.name == 'answeredExternally') { | ||
| 244 | + stateStr = ' 呼入'; | ||
| 245 | + } else if (element.callType.name == 'outgoing' || | ||
| 246 | + element.callType.name == 'wifiOutgoing' || | ||
| 247 | + element.callType.name == 'voiceMail') { | ||
| 248 | + stateStr = ' 呼出'; | ||
| 249 | + } else if (element.callType.name == 'missed') { | ||
| 250 | + stateStr = ' 未接'; | ||
| 251 | + } else if (element.callType.name == 'rejected') { | ||
| 252 | + stateStr = ' 拒接'; | ||
| 253 | + } else if (element.callType.name == 'blocked') { | ||
| 254 | + stateStr = ' 拦截'; | ||
| 292 | } | 255 | } |
| 293 | - }, title: '从通话记录选择客人电话', selecteds: [ | ||
| 294 | - // _getFirSelected(hourAndMinute, data), | ||
| 295 | - // _getSecSelected(hourAndMinute) | ||
| 296 | - ]).then((value) { | ||
| 297 | - print(value); | 256 | + |
| 257 | + String sunString = | ||
| 258 | + Utils.formatCallLogFromMill(element.timestamp.toString()); | ||
| 259 | + | ||
| 260 | + data.add(Picker.PickerItem( | ||
| 261 | + text: Row( | ||
| 262 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 263 | + children: [ | ||
| 264 | + Expanded( | ||
| 265 | + child: Row( | ||
| 266 | + children: [ | ||
| 267 | + HEmptyView(30), | ||
| 268 | + Text(title ?? '', | ||
| 269 | + style: TextStyle( | ||
| 270 | + fontSize: font(16), color: MyColours.color_515151)), | ||
| 271 | + Expanded( | ||
| 272 | + child: Text(stateStr ?? '', | ||
| 273 | + style: TextStyle( | ||
| 274 | + fontSize: font(16), | ||
| 275 | + color: MyColours.color_26000000))), | ||
| 276 | + ], | ||
| 277 | + )), | ||
| 278 | + Container( | ||
| 279 | + margin: EdgeInsets.only(right: w(15)), | ||
| 280 | + child: Text(sunString ?? '', | ||
| 281 | + style: TextStyle( | ||
| 282 | + fontSize: font(16), color: MyColours.color_515151))) | ||
| 283 | + ], | ||
| 284 | + ))); | ||
| 298 | }); | 285 | }); |
| 299 | - } else { | ||
| 300 | - Utils.showToast('暂无通话记录!'); | ||
| 301 | - } | 286 | + if (data.length > 0) { |
| 287 | + //有记录,底部弹窗展示 | ||
| 288 | + // showPhoneHistory = true; | ||
| 289 | + // setState(() {}); | ||
| 290 | + DialogUtil.showSelectCusmanWidgetDialog(context, data, (value) { | ||
| 291 | + if (value != null) { | ||
| 292 | + _byValueToReqeust(value[0]); | ||
| 293 | + } | ||
| 294 | + }, title: '从通话记录选择客人电话', selecteds: [ | ||
| 295 | + // _getFirSelected(hourAndMinute, data), | ||
| 296 | + // _getSecSelected(hourAndMinute) | ||
| 297 | + ]).then((value) { | ||
| 298 | + print(value); | ||
| 299 | + }); | ||
| 300 | + } else { | ||
| 301 | + Utils.showToast('暂无通话记录!'); | ||
| 302 | + } | ||
| 303 | + } catch (e) {} | ||
| 302 | } | 304 | } |
| 303 | 305 | ||
| 304 | _byValueToReqeust(int index) { | 306 | _byValueToReqeust(int index) { |
| @@ -1075,90 +1075,95 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { | @@ -1075,90 +1075,95 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { | ||
| 1075 | // } | 1075 | // } |
| 1076 | // } | 1076 | // } |
| 1077 | _getCallLog() async { | 1077 | _getCallLog() async { |
| 1078 | - Iterable<CallLogEntry> result = await CallLog.query(); | ||
| 1079 | - List<Picker.PickerItem<dynamic>> data = []; | 1078 | + try { |
| 1079 | + Iterable<CallLogEntry> result = await CallLog.query(); | ||
| 1080 | + List<Picker.PickerItem<dynamic>> data = []; | ||
| 1080 | 1081 | ||
| 1081 | - List<CallLogEntry> object = Utils.removeDuplicates(result.toList()); | 1082 | + List<CallLogEntry> object = Utils.removeDuplicates(result.toList()); |
| 1082 | 1083 | ||
| 1083 | - print(object); | 1084 | + print(object); |
| 1084 | 1085 | ||
| 1085 | - _notebookDetailChangeModel.userHistorys = []; | ||
| 1086 | - showPhoneHistory = false; | ||
| 1087 | - // setState(() {}); | 1086 | + _notebookDetailChangeModel.userHistorys = []; |
| 1087 | + showPhoneHistory = false; | ||
| 1088 | + // setState(() {}); | ||
| 1088 | 1089 | ||
| 1089 | - object.forEach((element) { | ||
| 1090 | - _notebookDetailChangeModel.userHistorys.add(UserHistoryEntity( | ||
| 1091 | - '', '', element.name ?? '', '1', element.number, '', '', '')); | 1090 | + object.forEach((element) { |
| 1091 | + _notebookDetailChangeModel.userHistorys.add(UserHistoryEntity( | ||
| 1092 | + '', '', element.name ?? '', '1', element.number, '', '', '')); | ||
| 1092 | 1093 | ||
| 1093 | - String title = ''; | ||
| 1094 | - title += ' ${element.number ?? ''}'; | ||
| 1095 | - if (element.name != null && element.name != '') { | ||
| 1096 | - title += ' ${element.name}'; | ||
| 1097 | - } | 1094 | + String title = ''; |
| 1095 | + title += ' ${element.number ?? ''}'; | ||
| 1096 | + if (element.name != null && element.name != '') { | ||
| 1097 | + title += ' ${element.name}'; | ||
| 1098 | + } | ||
| 1098 | 1099 | ||
| 1099 | - String stateStr = ''; //状态 | ||
| 1100 | - | ||
| 1101 | - if (element.callType.name == 'incoming' || | ||
| 1102 | - element.callType.name == 'wifiIncoming' || | ||
| 1103 | - element.callType.name == 'answeredExternally') { | ||
| 1104 | - stateStr = ' 呼入'; | ||
| 1105 | - } else if (element.callType.name == 'outgoing' || | ||
| 1106 | - element.callType.name == 'wifiOutgoing' || | ||
| 1107 | - element.callType.name == 'voiceMail') { | ||
| 1108 | - stateStr = ' 呼出'; | ||
| 1109 | - } else if (element.callType.name == 'missed') { | ||
| 1110 | - stateStr = ' 未接'; | ||
| 1111 | - } else if (element.callType.name == 'rejected') { | ||
| 1112 | - stateStr = ' 拒接'; | ||
| 1113 | - } else if (element.callType.name == 'blocked') { | ||
| 1114 | - stateStr = ' 拦截'; | ||
| 1115 | - } | 1100 | + String stateStr = ''; //状态 |
| 1101 | + | ||
| 1102 | + if (element.callType.name == 'incoming' || | ||
| 1103 | + element.callType.name == 'wifiIncoming' || | ||
| 1104 | + element.callType.name == 'answeredExternally') { | ||
| 1105 | + stateStr = ' 呼入'; | ||
| 1106 | + } else if (element.callType.name == 'outgoing' || | ||
| 1107 | + element.callType.name == 'wifiOutgoing' || | ||
| 1108 | + element.callType.name == 'voiceMail') { | ||
| 1109 | + stateStr = ' 呼出'; | ||
| 1110 | + } else if (element.callType.name == 'missed') { | ||
| 1111 | + stateStr = ' 未接'; | ||
| 1112 | + } else if (element.callType.name == 'rejected') { | ||
| 1113 | + stateStr = ' 拒接'; | ||
| 1114 | + } else if (element.callType.name == 'blocked') { | ||
| 1115 | + stateStr = ' 拦截'; | ||
| 1116 | + } | ||
| 1116 | 1117 | ||
| 1117 | - String sunString = | ||
| 1118 | - Utils.formatCallLogFromMill(element.timestamp.toString()); | 1118 | + String sunString = |
| 1119 | + Utils.formatCallLogFromMill(element.timestamp.toString()); | ||
| 1119 | 1120 | ||
| 1120 | - data.add(Picker.PickerItem( | ||
| 1121 | - text: Row( | ||
| 1122 | - mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 1123 | - children: [ | ||
| 1124 | - Expanded( | ||
| 1125 | - child: Row( | ||
| 1126 | - children: [ | ||
| 1127 | - HEmptyView(30), | ||
| 1128 | - Text(title ?? '', | ||
| 1129 | - style: TextStyle( | ||
| 1130 | - fontSize: font(16), color: MyColours.color_515151)), | ||
| 1131 | - Expanded( | ||
| 1132 | - child: Text(stateStr ?? '', | ||
| 1133 | - style: TextStyle( | ||
| 1134 | - fontSize: font(16), | ||
| 1135 | - color: MyColours.color_26000000))), | ||
| 1136 | - ], | ||
| 1137 | - )), | ||
| 1138 | - Container( | ||
| 1139 | - margin: EdgeInsets.only(right: w(15)), | ||
| 1140 | - child: Text(sunString ?? '', | ||
| 1141 | - style: TextStyle( | ||
| 1142 | - fontSize: font(16), color: MyColours.color_515151))) | ||
| 1143 | - ], | ||
| 1144 | - ))); | ||
| 1145 | - }); | ||
| 1146 | - if (data.length > 0) { | ||
| 1147 | - //有记录,底部弹窗展示 | ||
| 1148 | - // showPhoneHistory = true; | ||
| 1149 | - // setState(() {}); | ||
| 1150 | - DialogUtil.showSelectCusmanWidgetDialog(context, data, (value) { | ||
| 1151 | - if (value != null) { | ||
| 1152 | - _byValueToReqeust(value[0]); | ||
| 1153 | - } | ||
| 1154 | - }, title: '从通话记录选择客人电话', selecteds: [ | ||
| 1155 | - // _getFirSelected(hourAndMinute, data), | ||
| 1156 | - // _getSecSelected(hourAndMinute) | ||
| 1157 | - ]).then((value) { | ||
| 1158 | - print(value); | 1121 | + data.add(Picker.PickerItem( |
| 1122 | + text: Row( | ||
| 1123 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 1124 | + children: [ | ||
| 1125 | + Expanded( | ||
| 1126 | + child: Row( | ||
| 1127 | + children: [ | ||
| 1128 | + HEmptyView(30), | ||
| 1129 | + Text(title ?? '', | ||
| 1130 | + style: TextStyle( | ||
| 1131 | + fontSize: font(16), color: MyColours.color_515151)), | ||
| 1132 | + Expanded( | ||
| 1133 | + child: Text(stateStr ?? '', | ||
| 1134 | + style: TextStyle( | ||
| 1135 | + fontSize: font(16), | ||
| 1136 | + color: MyColours.color_26000000))), | ||
| 1137 | + ], | ||
| 1138 | + )), | ||
| 1139 | + Container( | ||
| 1140 | + margin: EdgeInsets.only(right: w(15)), | ||
| 1141 | + child: Text(sunString ?? '', | ||
| 1142 | + style: TextStyle( | ||
| 1143 | + fontSize: font(16), color: MyColours.color_515151))) | ||
| 1144 | + ], | ||
| 1145 | + ))); | ||
| 1159 | }); | 1146 | }); |
| 1160 | - } else { | ||
| 1161 | - Utils.showToast('暂无通话记录!'); | 1147 | + if (data.length > 0) { |
| 1148 | + //有记录,底部弹窗展示 | ||
| 1149 | + // showPhoneHistory = true; | ||
| 1150 | + // setState(() {}); | ||
| 1151 | + DialogUtil.showSelectCusmanWidgetDialog(context, data, (value) { | ||
| 1152 | + if (value != null) { | ||
| 1153 | + _byValueToReqeust(value[0]); | ||
| 1154 | + } | ||
| 1155 | + }, title: '从通话记录选择客人电话', selecteds: [ | ||
| 1156 | + // _getFirSelected(hourAndMinute, data), | ||
| 1157 | + // _getSecSelected(hourAndMinute) | ||
| 1158 | + ]).then((value) { | ||
| 1159 | + print(value); | ||
| 1160 | + }); | ||
| 1161 | + } else { | ||
| 1162 | + Utils.showToast('暂无通话记录!'); | ||
| 1163 | + } | ||
| 1164 | + } catch (e) { | ||
| 1165 | + print(e); | ||
| 1166 | + | ||
| 1162 | } | 1167 | } |
| 1163 | } | 1168 | } |
| 1164 | 1169 |
| @@ -3930,7 +3930,8 @@ class InvicationPageState extends State<InvicationPage> | @@ -3930,7 +3930,8 @@ class InvicationPageState extends State<InvicationPage> | ||
| 3930 | } | 3930 | } |
| 3931 | 3931 | ||
| 3932 | _getCallLog() async { | 3932 | _getCallLog() async { |
| 3933 | - Iterable<CallLogEntry> result = await CallLog.query(); | 3933 | + try { |
| 3934 | + Iterable<CallLogEntry> result = await CallLog.query(); | ||
| 3934 | List<Picker.PickerItem<dynamic>> data = []; | 3935 | List<Picker.PickerItem<dynamic>> data = []; |
| 3935 | 3936 | ||
| 3936 | List<CallLogEntry> object = Utils.removeDuplicates(result.toList()); | 3937 | List<CallLogEntry> object = Utils.removeDuplicates(result.toList()); |
| @@ -4056,6 +4057,10 @@ class InvicationPageState extends State<InvicationPage> | @@ -4056,6 +4057,10 @@ class InvicationPageState extends State<InvicationPage> | ||
| 4056 | } else { | 4057 | } else { |
| 4057 | _getContactData(); | 4058 | _getContactData(); |
| 4058 | } | 4059 | } |
| 4060 | + | ||
| 4061 | + } catch (e) { | ||
| 4062 | + } | ||
| 4063 | + | ||
| 4059 | } | 4064 | } |
| 4060 | 4065 | ||
| 4061 | _getContactData() async { | 4066 | _getContactData() async { |
| @@ -682,91 +682,93 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -682,91 +682,93 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 682 | // } | 682 | // } |
| 683 | 683 | ||
| 684 | _getCallLog() async { | 684 | _getCallLog() async { |
| 685 | - Iterable<CallLogEntry> result = await CallLog.query(); | ||
| 686 | - List<Picker.PickerItem<dynamic>> data = []; | 685 | + try { |
| 686 | + Iterable<CallLogEntry> result = await CallLog.query(); | ||
| 687 | + List<Picker.PickerItem<dynamic>> data = []; | ||
| 687 | 688 | ||
| 688 | - List<CallLogEntry> object = Utils.removeDuplicates(result.toList()); | 689 | + List<CallLogEntry> object = Utils.removeDuplicates(result.toList()); |
| 689 | 690 | ||
| 690 | - print(object); | 691 | + print(object); |
| 691 | 692 | ||
| 692 | - _baseIndoProvider.userHistorys = []; | ||
| 693 | - showPhoneHistory = false; | ||
| 694 | - // setState(() {}); | 693 | + _baseIndoProvider.userHistorys = []; |
| 694 | + showPhoneHistory = false; | ||
| 695 | + // setState(() {}); | ||
| 695 | 696 | ||
| 696 | - object.forEach((element) { | ||
| 697 | - _baseIndoProvider.userHistorys.add(UserHistoryEntity( | ||
| 698 | - '', '', element.name ?? '', '1', element.number, '', '', '')); | 697 | + object.forEach((element) { |
| 698 | + _baseIndoProvider.userHistorys.add(UserHistoryEntity( | ||
| 699 | + '', '', element.name ?? '', '1', element.number, '', '', '')); | ||
| 699 | 700 | ||
| 700 | - String title = ''; | ||
| 701 | - title += ' ${element.number ?? ''}'; | ||
| 702 | - if (element.name != null && element.name != '') { | ||
| 703 | - title += ' ${element.name}'; | ||
| 704 | - } | 701 | + String title = ''; |
| 702 | + title += ' ${element.number ?? ''}'; | ||
| 703 | + if (element.name != null && element.name != '') { | ||
| 704 | + title += ' ${element.name}'; | ||
| 705 | + } | ||
| 705 | 706 | ||
| 706 | - String stateStr = ''; //状态 | ||
| 707 | - | ||
| 708 | - if (element.callType.name == 'incoming' || | ||
| 709 | - element.callType.name == 'wifiIncoming' || | ||
| 710 | - element.callType.name == 'answeredExternally') { | ||
| 711 | - stateStr = ' 呼入'; | ||
| 712 | - } else if (element.callType.name == 'outgoing' || | ||
| 713 | - element.callType.name == 'wifiOutgoing' || | ||
| 714 | - element.callType.name == 'voiceMail') { | ||
| 715 | - stateStr = ' 呼出'; | ||
| 716 | - } else if (element.callType.name == 'missed') { | ||
| 717 | - stateStr = ' 未接'; | ||
| 718 | - } else if (element.callType.name == 'rejected') { | ||
| 719 | - stateStr = ' 拒接'; | ||
| 720 | - } else if (element.callType.name == 'blocked') { | ||
| 721 | - stateStr = ' 拦截'; | ||
| 722 | - } | 707 | + String stateStr = ''; //状态 |
| 708 | + | ||
| 709 | + if (element.callType.name == 'incoming' || | ||
| 710 | + element.callType.name == 'wifiIncoming' || | ||
| 711 | + element.callType.name == 'answeredExternally') { | ||
| 712 | + stateStr = ' 呼入'; | ||
| 713 | + } else if (element.callType.name == 'outgoing' || | ||
| 714 | + element.callType.name == 'wifiOutgoing' || | ||
| 715 | + element.callType.name == 'voiceMail') { | ||
| 716 | + stateStr = ' 呼出'; | ||
| 717 | + } else if (element.callType.name == 'missed') { | ||
| 718 | + stateStr = ' 未接'; | ||
| 719 | + } else if (element.callType.name == 'rejected') { | ||
| 720 | + stateStr = ' 拒接'; | ||
| 721 | + } else if (element.callType.name == 'blocked') { | ||
| 722 | + stateStr = ' 拦截'; | ||
| 723 | + } | ||
| 723 | 724 | ||
| 724 | - String sunString = | ||
| 725 | - Utils.formatCallLogFromMill(element.timestamp.toString()); | 725 | + String sunString = |
| 726 | + Utils.formatCallLogFromMill(element.timestamp.toString()); | ||
| 726 | 727 | ||
| 727 | - data.add(Picker.PickerItem( | ||
| 728 | - text: Row( | ||
| 729 | - mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 730 | - children: [ | ||
| 731 | - Expanded( | ||
| 732 | - child: Row( | ||
| 733 | - children: [ | ||
| 734 | - HEmptyView(30), | ||
| 735 | - Text(title ?? '', | ||
| 736 | - style: TextStyle( | ||
| 737 | - fontSize: font(16), color: MyColours.color_515151)), | ||
| 738 | - Expanded( | ||
| 739 | - child: Text(stateStr ?? '', | ||
| 740 | - style: TextStyle( | ||
| 741 | - fontSize: font(16), | ||
| 742 | - color: MyColours.color_26000000))), | ||
| 743 | - ], | ||
| 744 | - )), | ||
| 745 | - Container( | ||
| 746 | - margin: EdgeInsets.only(right: w(15)), | ||
| 747 | - child: Text(sunString ?? '', | ||
| 748 | - style: TextStyle( | ||
| 749 | - fontSize: font(16), color: MyColours.color_515151))) | ||
| 750 | - ], | ||
| 751 | - ))); | ||
| 752 | - }); | ||
| 753 | - if (data.length > 0) { | ||
| 754 | - //有记录,底部弹窗展示 | ||
| 755 | - // showPhoneHistory = true; | ||
| 756 | - // setState(() {}); | ||
| 757 | - DialogUtil.showSelectCusmanWidgetDialog(context, data, (value) { | ||
| 758 | - if (value != null) { | ||
| 759 | - _byValueToReqeust(value[0]); | ||
| 760 | - } | ||
| 761 | - }, title: '从通话记录选择客人电话', selecteds: [ | ||
| 762 | - // _getFirSelected(hourAndMinute, data), | ||
| 763 | - // _getSecSelected(hourAndMinute) | ||
| 764 | - ]).then((value) { | ||
| 765 | - print(value); | 728 | + data.add(Picker.PickerItem( |
| 729 | + text: Row( | ||
| 730 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 731 | + children: [ | ||
| 732 | + Expanded( | ||
| 733 | + child: Row( | ||
| 734 | + children: [ | ||
| 735 | + HEmptyView(30), | ||
| 736 | + Text(title ?? '', | ||
| 737 | + style: TextStyle( | ||
| 738 | + fontSize: font(16), color: MyColours.color_515151)), | ||
| 739 | + Expanded( | ||
| 740 | + child: Text(stateStr ?? '', | ||
| 741 | + style: TextStyle( | ||
| 742 | + fontSize: font(16), | ||
| 743 | + color: MyColours.color_26000000))), | ||
| 744 | + ], | ||
| 745 | + )), | ||
| 746 | + Container( | ||
| 747 | + margin: EdgeInsets.only(right: w(15)), | ||
| 748 | + child: Text(sunString ?? '', | ||
| 749 | + style: TextStyle( | ||
| 750 | + fontSize: font(16), color: MyColours.color_515151))) | ||
| 751 | + ], | ||
| 752 | + ))); | ||
| 766 | }); | 753 | }); |
| 767 | - } else { | ||
| 768 | - Utils.showToast('暂无通话记录!'); | ||
| 769 | - } | 754 | + if (data.length > 0) { |
| 755 | + //有记录,底部弹窗展示 | ||
| 756 | + // showPhoneHistory = true; | ||
| 757 | + // setState(() {}); | ||
| 758 | + DialogUtil.showSelectCusmanWidgetDialog(context, data, (value) { | ||
| 759 | + if (value != null) { | ||
| 760 | + _byValueToReqeust(value[0]); | ||
| 761 | + } | ||
| 762 | + }, title: '从通话记录选择客人电话', selecteds: [ | ||
| 763 | + // _getFirSelected(hourAndMinute, data), | ||
| 764 | + // _getSecSelected(hourAndMinute) | ||
| 765 | + ]).then((value) { | ||
| 766 | + print(value); | ||
| 767 | + }); | ||
| 768 | + } else { | ||
| 769 | + Utils.showToast('暂无通话记录!'); | ||
| 770 | + } | ||
| 771 | + } catch (e) {} | ||
| 770 | } | 772 | } |
| 771 | 773 | ||
| 772 | _byValueToReqeust(int index) { | 774 | _byValueToReqeust(int index) { |
| @@ -56,7 +56,6 @@ Future<PermissionStatus> contactPermissionStatus() async { | @@ -56,7 +56,6 @@ Future<PermissionStatus> contactPermissionStatus() async { | ||
| 56 | return permissionStatus; | 56 | return permissionStatus; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | - | ||
| 60 | Future<bool> requestContactPermission() async { | 59 | Future<bool> requestContactPermission() async { |
| 61 | final permissions = await [Permission.contacts].request(); | 60 | final permissions = await [Permission.contacts].request(); |
| 62 | if (permissions[Permission.contacts] == PermissionStatus.granted) { | 61 | if (permissions[Permission.contacts] == PermissionStatus.granted) { |
| @@ -213,10 +213,18 @@ class Utils { | @@ -213,10 +213,18 @@ class Utils { | ||
| 213 | } else if (Utils.isOneDay(_strtimes, dateNow.add(Duration(days: 2)))) { | 213 | } else if (Utils.isOneDay(_strtimes, dateNow.add(Duration(days: 2)))) { |
| 214 | date = "后天 "; | 214 | date = "后天 "; |
| 215 | } else { | 215 | } else { |
| 216 | - date = Utils.addZeroNumber(_strtimes.month) + | ||
| 217 | - "月" + | ||
| 218 | - Utils.addZeroNumber(_strtimes.day) + | ||
| 219 | - "日"; | 216 | + if (_strtimes.year == dateNow.year) { |
| 217 | + date = Utils.addZeroNumber(_strtimes.month) + | ||
| 218 | + "月" + | ||
| 219 | + Utils.addZeroNumber(_strtimes.day) + | ||
| 220 | + "日"; | ||
| 221 | + } else { | ||
| 222 | + date = _strtimes.year.toString() + | ||
| 223 | + Utils.addZeroNumber(_strtimes.month) + | ||
| 224 | + "月" + | ||
| 225 | + Utils.addZeroNumber(_strtimes.day) + | ||
| 226 | + "日"; | ||
| 227 | + } | ||
| 220 | } | 228 | } |
| 221 | return date; | 229 | return date; |
| 222 | } | 230 | } |
| @@ -986,35 +986,35 @@ packages: | @@ -986,35 +986,35 @@ packages: | ||
| 986 | name: permission_handler | 986 | name: permission_handler |
| 987 | url: "https://pub.flutter-io.cn" | 987 | url: "https://pub.flutter-io.cn" |
| 988 | source: hosted | 988 | source: hosted |
| 989 | - version: "10.0.0" | 989 | + version: "11.0.1" |
| 990 | permission_handler_android: | 990 | permission_handler_android: |
| 991 | dependency: transitive | 991 | dependency: transitive |
| 992 | description: | 992 | description: |
| 993 | name: permission_handler_android | 993 | name: permission_handler_android |
| 994 | url: "https://pub.flutter-io.cn" | 994 | url: "https://pub.flutter-io.cn" |
| 995 | source: hosted | 995 | source: hosted |
| 996 | - version: "10.0.0" | 996 | + version: "11.1.0" |
| 997 | permission_handler_apple: | 997 | permission_handler_apple: |
| 998 | dependency: transitive | 998 | dependency: transitive |
| 999 | description: | 999 | description: |
| 1000 | name: permission_handler_apple | 1000 | name: permission_handler_apple |
| 1001 | url: "https://pub.flutter-io.cn" | 1001 | url: "https://pub.flutter-io.cn" |
| 1002 | source: hosted | 1002 | source: hosted |
| 1003 | - version: "9.0.4" | 1003 | + version: "9.1.4" |
| 1004 | permission_handler_platform_interface: | 1004 | permission_handler_platform_interface: |
| 1005 | dependency: transitive | 1005 | dependency: transitive |
| 1006 | description: | 1006 | description: |
| 1007 | name: permission_handler_platform_interface | 1007 | name: permission_handler_platform_interface |
| 1008 | url: "https://pub.flutter-io.cn" | 1008 | url: "https://pub.flutter-io.cn" |
| 1009 | source: hosted | 1009 | source: hosted |
| 1010 | - version: "3.7.0" | 1010 | + version: "3.12.0" |
| 1011 | permission_handler_windows: | 1011 | permission_handler_windows: |
| 1012 | dependency: transitive | 1012 | dependency: transitive |
| 1013 | description: | 1013 | description: |
| 1014 | name: permission_handler_windows | 1014 | name: permission_handler_windows |
| 1015 | url: "https://pub.flutter-io.cn" | 1015 | url: "https://pub.flutter-io.cn" |
| 1016 | source: hosted | 1016 | source: hosted |
| 1017 | - version: "0.1.0" | 1017 | + version: "0.1.3" |
| 1018 | petitparser: | 1018 | petitparser: |
| 1019 | dependency: transitive | 1019 | dependency: transitive |
| 1020 | description: | 1020 | description: |
| @@ -51,7 +51,8 @@ dependencies: | @@ -51,7 +51,8 @@ dependencies: | ||
| 51 | # fluttertoast: ^3.1.3 | 51 | # fluttertoast: ^3.1.3 |
| 52 | fluttertoast: ^8.0.9 | 52 | fluttertoast: ^8.0.9 |
| 53 | # 权限管理 | 53 | # 权限管理 |
| 54 | - permission_handler: ^10.0.0 | 54 | + # permission_handler: ^10.0.0 |
| 55 | + permission_handler: ^11.0.1 | ||
| 55 | # permission_handler: ^5.0.1 | 56 | # permission_handler: ^5.0.1 |
| 56 | # permission_handler: ^5.0.1+1 ^6.1.1 4.4.0 | 57 | # permission_handler: ^5.0.1+1 ^6.1.1 4.4.0 |
| 57 | # 文件系统访问 | 58 | # 文件系统访问 |
-
Please register or login to post a comment