Showing
13 changed files
with
143 additions
and
74 deletions
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | 9 | ||
| 10 | <uses-permission android:name="android.permission.READ_CONTACTS" /> | 10 | <uses-permission android:name="android.permission.READ_CONTACTS" /> |
| 11 | <uses-permission android:name="android.permission.WRITE_CONTACTS" /> | 11 | <uses-permission android:name="android.permission.WRITE_CONTACTS" /> |
| 12 | + <uses-permission android:name="android.permission.READ_CONTACTS"/> | ||
| 12 | 13 | ||
| 13 | <application | 14 | <application |
| 14 | android:name="io.flutter.app.FlutterApplication" | 15 | android:name="io.flutter.app.FlutterApplication" |
| 1 | # Uncomment this line to define a global platform for your project | 1 | # Uncomment this line to define a global platform for your project |
| 2 | -# platform :ios, '9.0' | 2 | +platform :ios, '9.0' |
| 3 | 3 | ||
| 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. |
| 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' | 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' |
| @@ -9,6 +9,8 @@ PODS: | @@ -9,6 +9,8 @@ PODS: | ||
| 9 | - Flutter | 9 | - Flutter |
| 10 | - device_info (0.0.1): | 10 | - device_info (0.0.1): |
| 11 | - Flutter | 11 | - Flutter |
| 12 | + - easy_contact_picker (0.0.1): | ||
| 13 | + - Flutter | ||
| 12 | - Flutter (1.0.0) | 14 | - Flutter (1.0.0) |
| 13 | - flutter_bugly (0.0.1): | 15 | - flutter_bugly (0.0.1): |
| 14 | - Bugly | 16 | - Bugly |
| @@ -34,9 +36,9 @@ PODS: | @@ -34,9 +36,9 @@ PODS: | ||
| 34 | - Reachability (3.2) | 36 | - Reachability (3.2) |
| 35 | - shared_preferences (0.0.1): | 37 | - shared_preferences (0.0.1): |
| 36 | - Flutter | 38 | - Flutter |
| 37 | - - sqflite (0.0.2): | 39 | + - sqflite (0.0.1): |
| 38 | - Flutter | 40 | - Flutter |
| 39 | - - FMDB (>= 2.7.5) | 41 | + - FMDB (~> 2.7.2) |
| 40 | - TPNS-iOS (1.2.7.2) | 42 | - TPNS-iOS (1.2.7.2) |
| 41 | - tpns_flutter_plugin (1.0.4): | 43 | - tpns_flutter_plugin (1.0.4): |
| 42 | - Flutter | 44 | - Flutter |
| @@ -52,6 +54,7 @@ DEPENDENCIES: | @@ -52,6 +54,7 @@ DEPENDENCIES: | ||
| 52 | - connectivity (from `.symlinks/plugins/connectivity/ios`) | 54 | - connectivity (from `.symlinks/plugins/connectivity/ios`) |
| 53 | - contacts_service (from `.symlinks/plugins/contacts_service/ios`) | 55 | - contacts_service (from `.symlinks/plugins/contacts_service/ios`) |
| 54 | - device_info (from `.symlinks/plugins/device_info/ios`) | 56 | - device_info (from `.symlinks/plugins/device_info/ios`) |
| 57 | + - easy_contact_picker (from `.symlinks/plugins/easy_contact_picker/ios`) | ||
| 55 | - Flutter (from `Flutter`) | 58 | - Flutter (from `Flutter`) |
| 56 | - flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`) | 59 | - flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`) |
| 57 | - flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`) | 60 | - flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`) |
| @@ -84,6 +87,8 @@ EXTERNAL SOURCES: | @@ -84,6 +87,8 @@ EXTERNAL SOURCES: | ||
| 84 | :path: ".symlinks/plugins/contacts_service/ios" | 87 | :path: ".symlinks/plugins/contacts_service/ios" |
| 85 | device_info: | 88 | device_info: |
| 86 | :path: ".symlinks/plugins/device_info/ios" | 89 | :path: ".symlinks/plugins/device_info/ios" |
| 90 | + easy_contact_picker: | ||
| 91 | + :path: ".symlinks/plugins/easy_contact_picker/ios" | ||
| 87 | Flutter: | 92 | Flutter: |
| 88 | :path: Flutter | 93 | :path: Flutter |
| 89 | flutter_bugly: | 94 | flutter_bugly: |
| @@ -119,6 +124,7 @@ SPEC CHECKSUMS: | @@ -119,6 +124,7 @@ SPEC CHECKSUMS: | ||
| 119 | connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 | 124 | connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 |
| 120 | contacts_service: 849e1f84281804c8bfbec1b4c3eedcb23c5d3eca | 125 | contacts_service: 849e1f84281804c8bfbec1b4c3eedcb23c5d3eca |
| 121 | device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 | 126 | device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 |
| 127 | + easy_contact_picker: 9ab9dc70e8ddde6e76a19ffc482d7bf899868730 | ||
| 122 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec | 128 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec |
| 123 | flutter_bugly: c9800f4d5bc5bdc27ffdde3417a26ba44266e0c3 | 129 | flutter_bugly: c9800f4d5bc5bdc27ffdde3417a26ba44266e0c3 |
| 124 | flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259 | 130 | flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259 |
| @@ -131,13 +137,13 @@ SPEC CHECKSUMS: | @@ -131,13 +137,13 @@ SPEC CHECKSUMS: | ||
| 131 | permission_handler: 8278954f2382902f63f00dd8828769c0bd6d511b | 137 | permission_handler: 8278954f2382902f63f00dd8828769c0bd6d511b |
| 132 | Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 | 138 | Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 |
| 133 | shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d | 139 | shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d |
| 134 | - sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 | 140 | + sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0 |
| 135 | TPNS-iOS: 9b35473a4a0d07f2c2730ea1e66c6749c2b98095 | 141 | TPNS-iOS: 9b35473a4a0d07f2c2730ea1e66c6749c2b98095 |
| 136 | tpns_flutter_plugin: 8dbbee157aab91a878f64d056c1383726a6c5c4d | 142 | tpns_flutter_plugin: 8dbbee157aab91a878f64d056c1383726a6c5c4d |
| 137 | url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef | 143 | url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef |
| 138 | webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 | 144 | webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 |
| 139 | WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44 | 145 | WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44 |
| 140 | 146 | ||
| 141 | -PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c | 147 | +PODFILE CHECKSUM: a75497545d4391e2d394c3668e20cfb1c2bbd4aa |
| 142 | 148 | ||
| 143 | -COCOAPODS: 1.9.1 | 149 | +COCOAPODS: 1.9.3 |
| @@ -253,6 +253,7 @@ | @@ -253,6 +253,7 @@ | ||
| 253 | "${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework", | 253 | "${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework", |
| 254 | "${BUILT_PRODUCTS_DIR}/contacts_service/contacts_service.framework", | 254 | "${BUILT_PRODUCTS_DIR}/contacts_service/contacts_service.framework", |
| 255 | "${BUILT_PRODUCTS_DIR}/device_info/device_info.framework", | 255 | "${BUILT_PRODUCTS_DIR}/device_info/device_info.framework", |
| 256 | + "${BUILT_PRODUCTS_DIR}/easy_contact_picker/easy_contact_picker.framework", | ||
| 256 | "${BUILT_PRODUCTS_DIR}/flutter_statusbarcolor/flutter_statusbarcolor.framework", | 257 | "${BUILT_PRODUCTS_DIR}/flutter_statusbarcolor/flutter_statusbarcolor.framework", |
| 257 | "${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework", | 258 | "${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework", |
| 258 | "${BUILT_PRODUCTS_DIR}/install_plugin/install_plugin.framework", | 259 | "${BUILT_PRODUCTS_DIR}/install_plugin/install_plugin.framework", |
| @@ -272,6 +273,7 @@ | @@ -272,6 +273,7 @@ | ||
| 272 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework", | 273 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework", |
| 273 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/contacts_service.framework", | 274 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/contacts_service.framework", |
| 274 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework", | 275 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework", |
| 276 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/easy_contact_picker.framework", | ||
| 275 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_statusbarcolor.framework", | 277 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_statusbarcolor.framework", |
| 276 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework", | 278 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework", |
| 277 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/install_plugin.framework", | 279 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/install_plugin.framework", |
| 1 | import 'dart:io'; | 1 | import 'dart:io'; |
| 2 | 2 | ||
| 3 | - | ||
| 4 | import 'package:common_utils/common_utils.dart'; | 3 | import 'package:common_utils/common_utils.dart'; |
| 5 | import 'package:dio/dio.dart'; | 4 | import 'package:dio/dio.dart'; |
| 6 | import 'package:fluro/fluro.dart'; | 5 | import 'package:fluro/fluro.dart'; |
| @@ -67,8 +66,7 @@ class MyApp extends StatefulWidget { | @@ -67,8 +66,7 @@ class MyApp extends StatefulWidget { | ||
| 67 | } | 66 | } |
| 68 | 67 | ||
| 69 | class MyAppState extends State<MyApp> { | 68 | class MyAppState extends State<MyApp> { |
| 70 | - | ||
| 71 | - int xgCount=1;//注册信鸽次数,最多5次 | 69 | + int xgCount = 1; //注册信鸽次数,最多5次 |
| 72 | 70 | ||
| 73 | @override | 71 | @override |
| 74 | void initState() { | 72 | void initState() { |
| @@ -13,6 +13,7 @@ import 'package:one_key/provider/user_model.dart'; | @@ -13,6 +13,7 @@ import 'package:one_key/provider/user_model.dart'; | ||
| 13 | import 'package:one_key/res/colors.dart'; | 13 | import 'package:one_key/res/colors.dart'; |
| 14 | import 'package:one_key/utils/dialog_util.dart'; | 14 | import 'package:one_key/utils/dialog_util.dart'; |
| 15 | import 'package:one_key/utils/event_bus.dart'; | 15 | import 'package:one_key/utils/event_bus.dart'; |
| 16 | +import 'package:one_key/utils/misc.dart'; | ||
| 16 | import 'package:one_key/utils/navigator_util.dart'; | 17 | import 'package:one_key/utils/navigator_util.dart'; |
| 17 | import 'package:one_key/utils/utils.dart'; | 18 | import 'package:one_key/utils/utils.dart'; |
| 18 | import 'package:one_key/widgets/MyDivider.dart'; | 19 | import 'package:one_key/widgets/MyDivider.dart'; |
| @@ -22,9 +23,11 @@ import 'package:one_key/widgets/h_empty_view.dart'; | @@ -22,9 +23,11 @@ import 'package:one_key/widgets/h_empty_view.dart'; | ||
| 22 | import 'package:one_key/widgets/new_table_item.dart'; | 23 | import 'package:one_key/widgets/new_table_item.dart'; |
| 23 | import 'package:one_key/widgets/table_item.dart'; | 24 | import 'package:one_key/widgets/table_item.dart'; |
| 24 | import 'package:one_key/widgets/v_empty_view.dart'; | 25 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 26 | +import 'package:permission_handler/permission_handler.dart'; | ||
| 25 | import 'package:provider/provider.dart'; | 27 | import 'package:provider/provider.dart'; |
| 26 | import 'package:one_key/models/table_list.dart' as t; | 28 | import 'package:one_key/models/table_list.dart' as t; |
| 27 | import 'dart:convert' as convert; | 29 | import 'dart:convert' as convert; |
| 30 | +import 'package:easy_contact_picker/easy_contact_picker.dart'; | ||
| 28 | 31 | ||
| 29 | typedef clickCallback = void Function(String value); | 32 | typedef clickCallback = void Function(String value); |
| 30 | 33 | ||
| @@ -45,6 +48,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -45,6 +48,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 45 | FocusNode _nameNode = FocusNode(); | 48 | FocusNode _nameNode = FocusNode(); |
| 46 | FocusNode _needNode = FocusNode(); | 49 | FocusNode _needNode = FocusNode(); |
| 47 | NotebookDetailModel detailModel = NotebookDetailModel(); | 50 | NotebookDetailModel detailModel = NotebookDetailModel(); |
| 51 | + EasyContactPicker _contactPicker = EasyContactPicker(); | ||
| 48 | 52 | ||
| 49 | @override | 53 | @override |
| 50 | void initState() { | 54 | void initState() { |
| @@ -503,6 +507,19 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -503,6 +507,19 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 503 | HEmptyView(40), | 507 | HEmptyView(40), |
| 504 | InkWell( | 508 | InkWell( |
| 505 | onTap: () { | 509 | onTap: () { |
| 510 | + _openAddressBook(); | ||
| 511 | + }, | ||
| 512 | + child: Text( | ||
| 513 | + '打开通讯录', | ||
| 514 | + style: TextStyle( | ||
| 515 | + color: MyColours.color_199095, | ||
| 516 | + fontSize: ScreenUtil().setSp(34), | ||
| 517 | + ), | ||
| 518 | + ), | ||
| 519 | + ), | ||
| 520 | + HEmptyView(40), | ||
| 521 | + InkWell( | ||
| 522 | + onTap: () { | ||
| 506 | _showDateChooseWidget(context); | 523 | _showDateChooseWidget(context); |
| 507 | }, | 524 | }, |
| 508 | child: Text( | 525 | child: Text( |
| @@ -774,6 +791,35 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -774,6 +791,35 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 774 | ); | 791 | ); |
| 775 | } | 792 | } |
| 776 | 793 | ||
| 794 | + _openAddressBook() async { | ||
| 795 | + if (!(await checkContactPermission())) { | ||
| 796 | + PermissionStatus permissionStatus = await contactPermissionStatus(); | ||
| 797 | + if (permissionStatus == PermissionStatus.neverAskAgain) { | ||
| 798 | + //用户选择不在弹出权限提示框 | ||
| 799 | + print('never'); | ||
| 800 | + } else { | ||
| 801 | + // 申请权限 | ||
| 802 | + bool canContacts = await requestContactPermission(); | ||
| 803 | + if (canContacts) { | ||
| 804 | + _getContactData(); | ||
| 805 | + } else { | ||
| 806 | + //拒绝通讯录权限 , 苹果拒绝权限后,不再提示权限框,进入此处 | ||
| 807 | + print(canContacts); | ||
| 808 | + } | ||
| 809 | + } | ||
| 810 | + } else { | ||
| 811 | + _getContactData(); | ||
| 812 | + } | ||
| 813 | + } | ||
| 814 | + | ||
| 815 | + _getContactData() async { | ||
| 816 | + Contact contact = await _contactPicker.selectContactWithNative(); | ||
| 817 | + setState(() { | ||
| 818 | + _notebookDetailChangeModel.phoneController.text = contact.phoneNumber; | ||
| 819 | + _notebookDetailChangeModel.nameController.text = contact.fullName; | ||
| 820 | + }); | ||
| 821 | + } | ||
| 822 | + | ||
| 777 | @override | 823 | @override |
| 778 | Widget build(BuildContext context) { | 824 | Widget build(BuildContext context) { |
| 779 | _notebookDetailChangeModel = | 825 | _notebookDetailChangeModel = |
| @@ -18,56 +18,60 @@ import '../app.dart'; | @@ -18,56 +18,60 @@ import '../app.dart'; | ||
| 18 | /** | 18 | /** |
| 19 | * 上传联系人 | 19 | * 上传联系人 |
| 20 | */ | 20 | */ |
| 21 | -class ContactModel{ | ||
| 22 | - | 21 | +class ContactModel { |
| 23 | ContactModel._(); | 22 | ContactModel._(); |
| 24 | 23 | ||
| 25 | static ContactModel _instance; | 24 | static ContactModel _instance; |
| 26 | 25 | ||
| 27 | - static ContactModel getInstance(){ | ||
| 28 | - if(_instance==null){ | ||
| 29 | - _instance=ContactModel._(); | 26 | + static ContactModel getInstance() { |
| 27 | + if (_instance == null) { | ||
| 28 | + _instance = ContactModel._(); | ||
| 30 | } | 29 | } |
| 31 | return _instance; | 30 | return _instance; |
| 32 | } | 31 | } |
| 33 | 32 | ||
| 34 | uploadLocalContact(BuildContext context) async { | 33 | uploadLocalContact(BuildContext context) async { |
| 35 | - bool isUpload=App.sp.getBool("isUpload")??false; | ||
| 36 | - if(isUpload)return; | ||
| 37 | - bool authority=await requestContactPermission(); | ||
| 38 | - if(authority){ | ||
| 39 | - Iterable<Contact> contacts=await ContactsService.getContacts(withThumbnails: false); | ||
| 40 | - List<Map<String,String>> callLogs=[]; | 34 | + bool isUpload = App.sp.getBool("isUpload") ?? false; |
| 35 | + if (isUpload) return; | ||
| 36 | + bool authority = await requestContactPermission(); | ||
| 37 | + if (authority) { | ||
| 38 | + Iterable<Contact> contacts = | ||
| 39 | + await ContactsService.getContacts(withThumbnails: false); | ||
| 40 | + List<Map<String, String>> callLogs = []; | ||
| 41 | 41 | ||
| 42 | - contacts.forEach((contact){ | ||
| 43 | - String phoneNum=""; | ||
| 44 | - if(contact.phones.isNotEmpty){ | ||
| 45 | - phoneNum=contact.phones.first.value.replaceAll(new RegExp(r"\s+\b|\b\s"), ""); | 42 | + contacts.forEach((contact) { |
| 43 | + String phoneNum = ""; | ||
| 44 | + if (contact.phones.isNotEmpty) { | ||
| 45 | + phoneNum = contact.phones.first.value | ||
| 46 | + .replaceAll(new RegExp(r"\s+\b|\b\s"), ""); | ||
| 46 | } | 47 | } |
| 47 | - Map<String,String> callLog={ | ||
| 48 | - "phoneNum":"${phoneNum.trim()}", | ||
| 49 | - "sid":Provider.of<UserModel>(context,listen: false).user.sellerid, | ||
| 50 | - "deviceId":"dhgajkhdgahghsdghdkgahd", | ||
| 51 | - "phoneDate":"${DateTime.now().millisecondsSinceEpoch}", | ||
| 52 | - "callType":"2", | ||
| 53 | - "callUser":"${contact.displayName}", | ||
| 54 | - "account":Provider.of<UserModel>(context,listen: false).user.account | ||
| 55 | - }; | 48 | + Map<String, String> callLog = { |
| 49 | + "phoneNum": "${phoneNum.trim()}", | ||
| 50 | + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 51 | + "deviceId": "dhgajkhdgahghsdghdkgahd", | ||
| 52 | + "phoneDate": "${DateTime.now().millisecondsSinceEpoch}", | ||
| 53 | + "callType": "2", | ||
| 54 | + "callUser": "${contact.displayName}", | ||
| 55 | + "account": Provider.of<UserModel>(context, listen: false).user.account | ||
| 56 | + }; | ||
| 56 | callLogs.add(callLog); | 57 | callLogs.add(callLog); |
| 57 | }); | 58 | }); |
| 58 | - Map<String,String> params={ | ||
| 59 | - "data":jsonEncode(callLogs) | ||
| 60 | - }; | 59 | + Map<String, String> params = {"data": jsonEncode(callLogs)}; |
| 61 | BaseResp<String> baseResp = await DioUtil() | 60 | BaseResp<String> baseResp = await DioUtil() |
| 62 | - .request<String>(context, Method.get, HttpUrl.upload_contact,showLoading: false, | ||
| 63 | - data: params,options: Options(method: Method.post,contentType: ContentType.parse("application/x-www-form-urlencoded"))) | 61 | + .request<String>(context, Method.get, HttpUrl.upload_contact, |
| 62 | + showLoading: false, | ||
| 63 | + data: params, | ||
| 64 | + options: Options( | ||
| 65 | + method: Method.post, | ||
| 66 | + contentType: | ||
| 67 | + ContentType.parse("application/x-www-form-urlencoded"))) | ||
| 64 | .catchError((error) { | 68 | .catchError((error) { |
| 65 | print(error.toString()); | 69 | print(error.toString()); |
| 66 | }); | 70 | }); |
| 67 | - if(baseResp!=null&&baseResp.code == Constant.status_success){ | 71 | + if (baseResp != null && baseResp.code == Constant.status_success) { |
| 68 | LogUtil.v("联系人上传成功:${contacts.length}条"); | 72 | LogUtil.v("联系人上传成功:${contacts.length}条"); |
| 69 | App.sp.setBool("isUpload", true); | 73 | App.sp.setBool("isUpload", true); |
| 70 | } | 74 | } |
| 71 | } | 75 | } |
| 72 | } | 76 | } |
| 73 | -} | ||
| 77 | +} |
| @@ -199,7 +199,7 @@ class DialogUtil { | @@ -199,7 +199,7 @@ class DialogUtil { | ||
| 199 | TableCalendar( | 199 | TableCalendar( |
| 200 | calendarController: _calendarController, | 200 | calendarController: _calendarController, |
| 201 | initialSelectedDay: selectDateTime, | 201 | initialSelectedDay: selectDateTime, |
| 202 | - onDaySelected: (day, events) { | 202 | + onDaySelected: (day, events,holidays) { |
| 203 | Navigator.of(dialogContext).pop(day); | 203 | Navigator.of(dialogContext).pop(day); |
| 204 | }, | 204 | }, |
| 205 | availableGestures: AvailableGestures.none, | 205 | availableGestures: AvailableGestures.none, |
| 1 | import 'package:flutter/services.dart'; | 1 | import 'package:flutter/services.dart'; |
| 2 | import 'package:permission_handler/permission_handler.dart'; | 2 | import 'package:permission_handler/permission_handler.dart'; |
| 3 | 3 | ||
| 4 | - Future<bool> checkContactPermission() async { | 4 | +Future<bool> checkContactPermission() async { |
| 5 | PermissionStatus permissionStatus = | 5 | PermissionStatus permissionStatus = |
| 6 | await PermissionHandler().checkPermissionStatus(PermissionGroup.contacts); | 6 | await PermissionHandler().checkPermissionStatus(PermissionGroup.contacts); |
| 7 | if (permissionStatus == PermissionStatus.granted) { | 7 | if (permissionStatus == PermissionStatus.granted) { |
| @@ -11,10 +11,15 @@ import 'package:permission_handler/permission_handler.dart'; | @@ -11,10 +11,15 @@ import 'package:permission_handler/permission_handler.dart'; | ||
| 11 | } | 11 | } |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | +Future<PermissionStatus> contactPermissionStatus() async { | ||
| 15 | + PermissionStatus permissionStatus = | ||
| 16 | + await PermissionHandler().checkPermissionStatus(PermissionGroup.contacts); | ||
| 17 | + return permissionStatus; | ||
| 18 | +} | ||
| 19 | + | ||
| 14 | Future<bool> requestContactPermission() async { | 20 | Future<bool> requestContactPermission() async { |
| 15 | final permissions = | 21 | final permissions = |
| 16 | await PermissionHandler().requestPermissions([PermissionGroup.contacts]); | 22 | await PermissionHandler().requestPermissions([PermissionGroup.contacts]); |
| 17 | - | ||
| 18 | if (permissions[PermissionGroup.contacts] == PermissionStatus.granted) { | 23 | if (permissions[PermissionGroup.contacts] == PermissionStatus.granted) { |
| 19 | return true; | 24 | return true; |
| 20 | } else { | 25 | } else { |
| @@ -22,7 +27,6 @@ Future<bool> requestContactPermission() async { | @@ -22,7 +27,6 @@ Future<bool> requestContactPermission() async { | ||
| 22 | } | 27 | } |
| 23 | } | 28 | } |
| 24 | 29 | ||
| 25 | - | ||
| 26 | Future<bool> openSetting() { | 30 | Future<bool> openSetting() { |
| 27 | return PermissionHandler().openAppSettings(); | 31 | return PermissionHandler().openAppSettings(); |
| 28 | } | 32 | } |
| @@ -21,7 +21,7 @@ packages: | @@ -21,7 +21,7 @@ packages: | ||
| 21 | name: async | 21 | name: async |
| 22 | url: "https://pub.flutter-io.cn" | 22 | url: "https://pub.flutter-io.cn" |
| 23 | source: hosted | 23 | source: hosted |
| 24 | - version: "2.5.0-nullsafety.1" | 24 | + version: "2.4.2" |
| 25 | audioplayers: | 25 | audioplayers: |
| 26 | dependency: "direct main" | 26 | dependency: "direct main" |
| 27 | description: | 27 | description: |
| @@ -35,7 +35,7 @@ packages: | @@ -35,7 +35,7 @@ packages: | ||
| 35 | name: boolean_selector | 35 | name: boolean_selector |
| 36 | url: "https://pub.flutter-io.cn" | 36 | url: "https://pub.flutter-io.cn" |
| 37 | source: hosted | 37 | source: hosted |
| 38 | - version: "2.1.0-nullsafety.1" | 38 | + version: "2.0.0" |
| 39 | build: | 39 | build: |
| 40 | dependency: transitive | 40 | dependency: transitive |
| 41 | description: | 41 | description: |
| @@ -105,14 +105,14 @@ packages: | @@ -105,14 +105,14 @@ packages: | ||
| 105 | name: characters | 105 | name: characters |
| 106 | url: "https://pub.flutter-io.cn" | 106 | url: "https://pub.flutter-io.cn" |
| 107 | source: hosted | 107 | source: hosted |
| 108 | - version: "1.1.0-nullsafety.3" | 108 | + version: "1.0.0" |
| 109 | charcode: | 109 | charcode: |
| 110 | dependency: transitive | 110 | dependency: transitive |
| 111 | description: | 111 | description: |
| 112 | name: charcode | 112 | name: charcode |
| 113 | url: "https://pub.flutter-io.cn" | 113 | url: "https://pub.flutter-io.cn" |
| 114 | source: hosted | 114 | source: hosted |
| 115 | - version: "1.2.0-nullsafety.1" | 115 | + version: "1.1.3" |
| 116 | checked_yaml: | 116 | checked_yaml: |
| 117 | dependency: transitive | 117 | dependency: transitive |
| 118 | description: | 118 | description: |
| @@ -126,7 +126,7 @@ packages: | @@ -126,7 +126,7 @@ packages: | ||
| 126 | name: clock | 126 | name: clock |
| 127 | url: "https://pub.flutter-io.cn" | 127 | url: "https://pub.flutter-io.cn" |
| 128 | source: hosted | 128 | source: hosted |
| 129 | - version: "1.1.0-nullsafety.1" | 129 | + version: "1.0.1" |
| 130 | code_builder: | 130 | code_builder: |
| 131 | dependency: transitive | 131 | dependency: transitive |
| 132 | description: | 132 | description: |
| @@ -140,7 +140,7 @@ packages: | @@ -140,7 +140,7 @@ packages: | ||
| 140 | name: collection | 140 | name: collection |
| 141 | url: "https://pub.flutter-io.cn" | 141 | url: "https://pub.flutter-io.cn" |
| 142 | source: hosted | 142 | source: hosted |
| 143 | - version: "1.15.0-nullsafety.3" | 143 | + version: "1.14.13" |
| 144 | common_utils: | 144 | common_utils: |
| 145 | dependency: "direct main" | 145 | dependency: "direct main" |
| 146 | description: | 146 | description: |
| @@ -253,13 +253,20 @@ packages: | @@ -253,13 +253,20 @@ packages: | ||
| 253 | url: "https://pub.flutter-io.cn" | 253 | url: "https://pub.flutter-io.cn" |
| 254 | source: hosted | 254 | source: hosted |
| 255 | version: "1.0.17" | 255 | version: "1.0.17" |
| 256 | + easy_contact_picker: | ||
| 257 | + dependency: "direct main" | ||
| 258 | + description: | ||
| 259 | + name: easy_contact_picker | ||
| 260 | + url: "https://pub.flutter-io.cn" | ||
| 261 | + source: hosted | ||
| 262 | + version: "0.0.2" | ||
| 256 | fake_async: | 263 | fake_async: |
| 257 | dependency: transitive | 264 | dependency: transitive |
| 258 | description: | 265 | description: |
| 259 | name: fake_async | 266 | name: fake_async |
| 260 | url: "https://pub.flutter-io.cn" | 267 | url: "https://pub.flutter-io.cn" |
| 261 | source: hosted | 268 | source: hosted |
| 262 | - version: "1.2.0-nullsafety.1" | 269 | + version: "1.1.0" |
| 263 | ffi: | 270 | ffi: |
| 264 | dependency: transitive | 271 | dependency: transitive |
| 265 | description: | 272 | description: |
| @@ -491,14 +498,14 @@ packages: | @@ -491,14 +498,14 @@ packages: | ||
| 491 | name: matcher | 498 | name: matcher |
| 492 | url: "https://pub.flutter-io.cn" | 499 | url: "https://pub.flutter-io.cn" |
| 493 | source: hosted | 500 | source: hosted |
| 494 | - version: "0.12.10-nullsafety.1" | 501 | + version: "0.12.8" |
| 495 | meta: | 502 | meta: |
| 496 | dependency: transitive | 503 | dependency: transitive |
| 497 | description: | 504 | description: |
| 498 | name: meta | 505 | name: meta |
| 499 | url: "https://pub.flutter-io.cn" | 506 | url: "https://pub.flutter-io.cn" |
| 500 | source: hosted | 507 | source: hosted |
| 501 | - version: "1.3.0-nullsafety.3" | 508 | + version: "1.1.8" |
| 502 | mime: | 509 | mime: |
| 503 | dependency: transitive | 510 | dependency: transitive |
| 504 | description: | 511 | description: |
| @@ -519,7 +526,7 @@ packages: | @@ -519,7 +526,7 @@ packages: | ||
| 519 | name: node_interop | 526 | name: node_interop |
| 520 | url: "https://pub.flutter-io.cn" | 527 | url: "https://pub.flutter-io.cn" |
| 521 | source: hosted | 528 | source: hosted |
| 522 | - version: "1.1.1" | 529 | + version: "1.2.0" |
| 523 | node_io: | 530 | node_io: |
| 524 | dependency: transitive | 531 | dependency: transitive |
| 525 | description: | 532 | description: |
| @@ -561,7 +568,7 @@ packages: | @@ -561,7 +568,7 @@ packages: | ||
| 561 | name: path | 568 | name: path |
| 562 | url: "https://pub.flutter-io.cn" | 569 | url: "https://pub.flutter-io.cn" |
| 563 | source: hosted | 570 | source: hosted |
| 564 | - version: "1.8.0-nullsafety.1" | 571 | + version: "1.7.0" |
| 565 | path_provider: | 572 | path_provider: |
| 566 | dependency: "direct main" | 573 | dependency: "direct main" |
| 567 | description: | 574 | description: |
| @@ -603,7 +610,7 @@ packages: | @@ -603,7 +610,7 @@ packages: | ||
| 603 | name: pedantic | 610 | name: pedantic |
| 604 | url: "https://pub.flutter-io.cn" | 611 | url: "https://pub.flutter-io.cn" |
| 605 | source: hosted | 612 | source: hosted |
| 606 | - version: "1.9.2" | 613 | + version: "1.9.0" |
| 607 | permission_handler: | 614 | permission_handler: |
| 608 | dependency: "direct main" | 615 | dependency: "direct main" |
| 609 | description: | 616 | description: |
| @@ -769,14 +776,14 @@ packages: | @@ -769,14 +776,14 @@ packages: | ||
| 769 | name: source_span | 776 | name: source_span |
| 770 | url: "https://pub.flutter-io.cn" | 777 | url: "https://pub.flutter-io.cn" |
| 771 | source: hosted | 778 | source: hosted |
| 772 | - version: "1.8.0-nullsafety.2" | 779 | + version: "1.7.0" |
| 773 | sqflite: | 780 | sqflite: |
| 774 | dependency: "direct main" | 781 | dependency: "direct main" |
| 775 | description: | 782 | description: |
| 776 | name: sqflite | 783 | name: sqflite |
| 777 | url: "https://pub.flutter-io.cn" | 784 | url: "https://pub.flutter-io.cn" |
| 778 | source: hosted | 785 | source: hosted |
| 779 | - version: "1.3.2+1" | 786 | + version: "1.3.1+2" |
| 780 | sqflite_common: | 787 | sqflite_common: |
| 781 | dependency: transitive | 788 | dependency: transitive |
| 782 | description: | 789 | description: |
| @@ -790,14 +797,14 @@ packages: | @@ -790,14 +797,14 @@ packages: | ||
| 790 | name: stack_trace | 797 | name: stack_trace |
| 791 | url: "https://pub.flutter-io.cn" | 798 | url: "https://pub.flutter-io.cn" |
| 792 | source: hosted | 799 | source: hosted |
| 793 | - version: "1.10.0-nullsafety.1" | 800 | + version: "1.9.5" |
| 794 | stream_channel: | 801 | stream_channel: |
| 795 | dependency: transitive | 802 | dependency: transitive |
| 796 | description: | 803 | description: |
| 797 | name: stream_channel | 804 | name: stream_channel |
| 798 | url: "https://pub.flutter-io.cn" | 805 | url: "https://pub.flutter-io.cn" |
| 799 | source: hosted | 806 | source: hosted |
| 800 | - version: "2.1.0-nullsafety.1" | 807 | + version: "2.0.0" |
| 801 | stream_transform: | 808 | stream_transform: |
| 802 | dependency: transitive | 809 | dependency: transitive |
| 803 | description: | 810 | description: |
| @@ -811,7 +818,7 @@ packages: | @@ -811,7 +818,7 @@ packages: | ||
| 811 | name: string_scanner | 818 | name: string_scanner |
| 812 | url: "https://pub.flutter-io.cn" | 819 | url: "https://pub.flutter-io.cn" |
| 813 | source: hosted | 820 | source: hosted |
| 814 | - version: "1.1.0-nullsafety.1" | 821 | + version: "1.0.5" |
| 815 | synchronized: | 822 | synchronized: |
| 816 | dependency: transitive | 823 | dependency: transitive |
| 817 | description: | 824 | description: |
| @@ -832,14 +839,14 @@ packages: | @@ -832,14 +839,14 @@ packages: | ||
| 832 | name: term_glyph | 839 | name: term_glyph |
| 833 | url: "https://pub.flutter-io.cn" | 840 | url: "https://pub.flutter-io.cn" |
| 834 | source: hosted | 841 | source: hosted |
| 835 | - version: "1.2.0-nullsafety.1" | 842 | + version: "1.1.0" |
| 836 | test_api: | 843 | test_api: |
| 837 | dependency: transitive | 844 | dependency: transitive |
| 838 | description: | 845 | description: |
| 839 | name: test_api | 846 | name: test_api |
| 840 | url: "https://pub.flutter-io.cn" | 847 | url: "https://pub.flutter-io.cn" |
| 841 | source: hosted | 848 | source: hosted |
| 842 | - version: "0.2.19-nullsafety.2" | 849 | + version: "0.2.17" |
| 843 | timing: | 850 | timing: |
| 844 | dependency: transitive | 851 | dependency: transitive |
| 845 | description: | 852 | description: |
| @@ -862,14 +869,14 @@ packages: | @@ -862,14 +869,14 @@ packages: | ||
| 862 | name: typed_data | 869 | name: typed_data |
| 863 | url: "https://pub.flutter-io.cn" | 870 | url: "https://pub.flutter-io.cn" |
| 864 | source: hosted | 871 | source: hosted |
| 865 | - version: "1.3.0-nullsafety.3" | 872 | + version: "1.2.0" |
| 866 | url_launcher: | 873 | url_launcher: |
| 867 | dependency: "direct main" | 874 | dependency: "direct main" |
| 868 | description: | 875 | description: |
| 869 | name: url_launcher | 876 | name: url_launcher |
| 870 | url: "https://pub.flutter-io.cn" | 877 | url: "https://pub.flutter-io.cn" |
| 871 | source: hosted | 878 | source: hosted |
| 872 | - version: "5.7.8" | 879 | + version: "5.7.6" |
| 873 | url_launcher_linux: | 880 | url_launcher_linux: |
| 874 | dependency: transitive | 881 | dependency: transitive |
| 875 | description: | 882 | description: |
| @@ -890,14 +897,14 @@ packages: | @@ -890,14 +897,14 @@ packages: | ||
| 890 | name: url_launcher_platform_interface | 897 | name: url_launcher_platform_interface |
| 891 | url: "https://pub.flutter-io.cn" | 898 | url: "https://pub.flutter-io.cn" |
| 892 | source: hosted | 899 | source: hosted |
| 893 | - version: "1.0.9" | 900 | + version: "1.0.8" |
| 894 | url_launcher_web: | 901 | url_launcher_web: |
| 895 | dependency: transitive | 902 | dependency: transitive |
| 896 | description: | 903 | description: |
| 897 | name: url_launcher_web | 904 | name: url_launcher_web |
| 898 | url: "https://pub.flutter-io.cn" | 905 | url: "https://pub.flutter-io.cn" |
| 899 | source: hosted | 906 | source: hosted |
| 900 | - version: "0.1.5" | 907 | + version: "0.1.4+1" |
| 901 | url_launcher_windows: | 908 | url_launcher_windows: |
| 902 | dependency: transitive | 909 | dependency: transitive |
| 903 | description: | 910 | description: |
| @@ -918,7 +925,7 @@ packages: | @@ -918,7 +925,7 @@ packages: | ||
| 918 | name: vector_math | 925 | name: vector_math |
| 919 | url: "https://pub.flutter-io.cn" | 926 | url: "https://pub.flutter-io.cn" |
| 920 | source: hosted | 927 | source: hosted |
| 921 | - version: "2.1.0-nullsafety.3" | 928 | + version: "2.0.8" |
| 922 | watcher: | 929 | watcher: |
| 923 | dependency: transitive | 930 | dependency: transitive |
| 924 | description: | 931 | description: |
| @@ -953,7 +960,7 @@ packages: | @@ -953,7 +960,7 @@ packages: | ||
| 953 | name: xdg_directories | 960 | name: xdg_directories |
| 954 | url: "https://pub.flutter-io.cn" | 961 | url: "https://pub.flutter-io.cn" |
| 955 | source: hosted | 962 | source: hosted |
| 956 | - version: "0.1.2" | 963 | + version: "0.1.0" |
| 957 | yaml: | 964 | yaml: |
| 958 | dependency: transitive | 965 | dependency: transitive |
| 959 | description: | 966 | description: |
| @@ -962,5 +969,5 @@ packages: | @@ -962,5 +969,5 @@ packages: | ||
| 962 | source: hosted | 969 | source: hosted |
| 963 | version: "2.2.1" | 970 | version: "2.2.1" |
| 964 | sdks: | 971 | sdks: |
| 965 | - dart: ">=2.10.2 <2.11.0" | ||
| 966 | - flutter: ">=1.22.2 <2.0.0" | 972 | + dart: ">=2.9.0 <3.0.0" |
| 973 | + flutter: ">=1.20.0 <2.0.0" |
| @@ -34,7 +34,7 @@ dependencies: | @@ -34,7 +34,7 @@ dependencies: | ||
| 34 | # 屏幕适配 | 34 | # 屏幕适配 |
| 35 | flutter_screenutil: ^1.0.2 | 35 | flutter_screenutil: ^1.0.2 |
| 36 | # 路由管理 | 36 | # 路由管理 |
| 37 | - fluro: ^1.6.0 | 37 | + fluro: ^1.6.3 |
| 38 | # Toast提示 | 38 | # Toast提示 |
| 39 | fluttertoast: ^3.1.3 | 39 | fluttertoast: ^3.1.3 |
| 40 | # 权限管理 | 40 | # 权限管理 |
| @@ -86,6 +86,7 @@ dependencies: | @@ -86,6 +86,7 @@ dependencies: | ||
| 86 | # 获取通讯录 | 86 | # 获取通讯录 |
| 87 | contacts_service: ^0.4.6 | 87 | contacts_service: ^0.4.6 |
| 88 | common_utils: ^1.1.3 | 88 | common_utils: ^1.1.3 |
| 89 | + easy_contact_picker: ^0.0.2 | ||
| 89 | 90 | ||
| 90 | 91 | ||
| 91 | dev_dependencies: | 92 | dev_dependencies: |
-
Please register or login to post a comment