Showing
4 changed files
with
115 additions
and
106 deletions
| @@ -75,9 +75,9 @@ PODS: | @@ -75,9 +75,9 @@ PODS: | ||
| 75 | - Flutter | 75 | - Flutter |
| 76 | - sign_in_with_apple (0.0.1): | 76 | - sign_in_with_apple (0.0.1): |
| 77 | - Flutter | 77 | - Flutter |
| 78 | - - sqflite (0.0.1): | 78 | + - sqflite (0.0.2): |
| 79 | - Flutter | 79 | - Flutter |
| 80 | - - FMDB (~> 2.7.2) | 80 | + - FMDB (>= 2.7.5) |
| 81 | - TPNS-iOS (1.2.7.2) | 81 | - TPNS-iOS (1.2.7.2) |
| 82 | - tpns_flutter_plugin (1.0.4): | 82 | - tpns_flutter_plugin (1.0.4): |
| 83 | - Flutter | 83 | - Flutter |
| @@ -239,7 +239,7 @@ SPEC CHECKSUMS: | @@ -239,7 +239,7 @@ SPEC CHECKSUMS: | ||
| 239 | Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 | 239 | Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 |
| 240 | shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d | 240 | shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d |
| 241 | sign_in_with_apple: 34f3f5456a45fd7ac5fb42905e2ad31dae061b4a | 241 | sign_in_with_apple: 34f3f5456a45fd7ac5fb42905e2ad31dae061b4a |
| 242 | - sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0 | 242 | + sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 |
| 243 | TPNS-iOS: 9b35473a4a0d07f2c2730ea1e66c6749c2b98095 | 243 | TPNS-iOS: 9b35473a4a0d07f2c2730ea1e66c6749c2b98095 |
| 244 | tpns_flutter_plugin: 8dbbee157aab91a878f64d056c1383726a6c5c4d | 244 | tpns_flutter_plugin: 8dbbee157aab91a878f64d056c1383726a6c5c4d |
| 245 | url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef | 245 | url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef |
| @@ -487,7 +487,7 @@ | @@ -487,7 +487,7 @@ | ||
| 487 | "$(inherited)", | 487 | "$(inherited)", |
| 488 | "$(PROJECT_DIR)/Flutter", | 488 | "$(PROJECT_DIR)/Flutter", |
| 489 | ); | 489 | ); |
| 490 | - MARKETING_VERSION = 2.5.1; | 490 | + MARKETING_VERSION = 2.6.0; |
| 491 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 491 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 492 | PRODUCT_NAME = Runner; | 492 | PRODUCT_NAME = Runner; |
| 493 | PROVISIONING_PROFILE_SPECIFIER = ""; | 493 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -631,7 +631,7 @@ | @@ -631,7 +631,7 @@ | ||
| 631 | "$(inherited)", | 631 | "$(inherited)", |
| 632 | "$(PROJECT_DIR)/Flutter", | 632 | "$(PROJECT_DIR)/Flutter", |
| 633 | ); | 633 | ); |
| 634 | - MARKETING_VERSION = 2.5.1; | 634 | + MARKETING_VERSION = 2.6.0; |
| 635 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 635 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 636 | PRODUCT_NAME = Runner; | 636 | PRODUCT_NAME = Runner; |
| 637 | PROVISIONING_PROFILE_SPECIFIER = ""; | 637 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -666,7 +666,7 @@ | @@ -666,7 +666,7 @@ | ||
| 666 | "$(inherited)", | 666 | "$(inherited)", |
| 667 | "$(PROJECT_DIR)/Flutter", | 667 | "$(PROJECT_DIR)/Flutter", |
| 668 | ); | 668 | ); |
| 669 | - MARKETING_VERSION = 2.5.1; | 669 | + MARKETING_VERSION = 2.6.0; |
| 670 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 670 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 671 | PRODUCT_NAME = Runner; | 671 | PRODUCT_NAME = Runner; |
| 672 | PROVISIONING_PROFILE_SPECIFIER = ""; | 672 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -5,6 +5,7 @@ import 'package:one_key/constant/state.dart'; | @@ -5,6 +5,7 @@ import 'package:one_key/constant/state.dart'; | ||
| 5 | import 'package:one_key/provider/contant_show_model.dart'; | 5 | import 'package:one_key/provider/contant_show_model.dart'; |
| 6 | import 'package:one_key/provider/user_model.dart'; | 6 | import 'package:one_key/provider/user_model.dart'; |
| 7 | import 'package:one_key/res/colors.dart'; | 7 | import 'package:one_key/res/colors.dart'; |
| 8 | +import 'package:one_key/utils/dialog_util.dart'; | ||
| 8 | import 'package:one_key/widgets/MyDivider.dart'; | 9 | import 'package:one_key/widgets/MyDivider.dart'; |
| 9 | 10 | ||
| 10 | import 'package:one_key/widgets/page_exception.dart'; | 11 | import 'package:one_key/widgets/page_exception.dart'; |
| @@ -50,6 +51,8 @@ class _ContantLeftPageState extends State<ContantLeftPage> { | @@ -50,6 +51,8 @@ class _ContantLeftPageState extends State<ContantLeftPage> { | ||
| 50 | callback: () { | 51 | callback: () { |
| 51 | // offset = 0; | 52 | // offset = 0; |
| 52 | // getMessages(); | 53 | // getMessages(); |
| 54 | + model.pageStateLeft = PageState.Loading; | ||
| 55 | + model.notifyListeners(); | ||
| 53 | _getContantData(); | 56 | _getContantData(); |
| 54 | }, | 57 | }, |
| 55 | emptyMsg: "暂时没有联系人哦", | 58 | emptyMsg: "暂时没有联系人哦", |
| @@ -60,49 +63,57 @@ class _ContantLeftPageState extends State<ContantLeftPage> { | @@ -60,49 +63,57 @@ class _ContantLeftPageState extends State<ContantLeftPage> { | ||
| 60 | return ListView.builder( | 63 | return ListView.builder( |
| 61 | itemCount: model.userHistorys.length, | 64 | itemCount: model.userHistorys.length, |
| 62 | itemBuilder: (BuildContext context, int index) { | 65 | itemBuilder: (BuildContext context, int index) { |
| 63 | - return Column( | ||
| 64 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 65 | - children: [ | ||
| 66 | - index == 0 | ||
| 67 | - ? MyDivider( | ||
| 68 | - double.infinity, | ||
| 69 | - ScreenUtil().setWidth(20), | ||
| 70 | - color: MyColours.color_f5f5f5, | ||
| 71 | - ) | ||
| 72 | - : Container(), | ||
| 73 | - Container( | ||
| 74 | - width: double.infinity, | ||
| 75 | - padding: EdgeInsets.symmetric( | ||
| 76 | - horizontal: ScreenUtil().setWidth(40), | ||
| 77 | - vertical: ScreenUtil().setWidth(30)), | ||
| 78 | - height: ScreenUtil().setWidth(74 * 2), | ||
| 79 | - decoration: BoxDecoration( | ||
| 80 | - border: Border( | ||
| 81 | - top: index == 0 | ||
| 82 | - ? BorderSide( | ||
| 83 | - width: ScreenUtil().setWidth(2), | ||
| 84 | - color: MyColours.color_E0E0E0) | ||
| 85 | - : BorderSide( | ||
| 86 | - width: 0, color: Colors.transparent), | ||
| 87 | - bottom: BorderSide( | ||
| 88 | - width: ScreenUtil().setWidth(2), | ||
| 89 | - color: MyColours.color_E0E0E0))), | ||
| 90 | - child: Column( | ||
| 91 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 92 | - children: [ | ||
| 93 | - Text(model.userHistorys[index].rname, | ||
| 94 | - style: TextStyle( | ||
| 95 | - color: MyColours.color_333333, | ||
| 96 | - fontSize: ScreenUtil().setSp(32))), | ||
| 97 | - VEmptyView(10), | ||
| 98 | - Text(model.userHistorys[index].phone, | ||
| 99 | - style: TextStyle( | ||
| 100 | - color: MyColours.color_999999, | ||
| 101 | - fontSize: ScreenUtil().setSp(30))) | ||
| 102 | - ], | ||
| 103 | - ), | ||
| 104 | - ) | ||
| 105 | - ]); | 66 | + return InkWell( |
| 67 | + onTap: () { | ||
| 68 | + if (model.userHistorys[index].phone != null && | ||
| 69 | + model.userHistorys[index].phone != '') { | ||
| 70 | + DialogUtil.goPhone(model.userHistorys[index].phone); | ||
| 71 | + } | ||
| 72 | + }, | ||
| 73 | + child: Column( | ||
| 74 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 75 | + children: [ | ||
| 76 | + index == 0 | ||
| 77 | + ? MyDivider( | ||
| 78 | + double.infinity, | ||
| 79 | + ScreenUtil().setWidth(20), | ||
| 80 | + color: MyColours.color_f5f5f5, | ||
| 81 | + ) | ||
| 82 | + : Container(), | ||
| 83 | + Container( | ||
| 84 | + width: double.infinity, | ||
| 85 | + padding: EdgeInsets.symmetric( | ||
| 86 | + horizontal: ScreenUtil().setWidth(40), | ||
| 87 | + vertical: ScreenUtil().setWidth(30)), | ||
| 88 | + height: ScreenUtil().setWidth(74 * 2), | ||
| 89 | + decoration: BoxDecoration( | ||
| 90 | + border: Border( | ||
| 91 | + top: index == 0 | ||
| 92 | + ? BorderSide( | ||
| 93 | + width: ScreenUtil().setWidth(2), | ||
| 94 | + color: MyColours.color_E0E0E0) | ||
| 95 | + : BorderSide( | ||
| 96 | + width: 0, color: Colors.transparent), | ||
| 97 | + bottom: BorderSide( | ||
| 98 | + width: ScreenUtil().setWidth(2), | ||
| 99 | + color: MyColours.color_E0E0E0))), | ||
| 100 | + child: Column( | ||
| 101 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 102 | + children: [ | ||
| 103 | + Text(model.userHistorys[index].rname, | ||
| 104 | + style: TextStyle( | ||
| 105 | + color: MyColours.color_333333, | ||
| 106 | + fontSize: ScreenUtil().setSp(32))), | ||
| 107 | + VEmptyView(10), | ||
| 108 | + Text(model.userHistorys[index].phone, | ||
| 109 | + style: TextStyle( | ||
| 110 | + color: MyColours.color_999999, | ||
| 111 | + fontSize: ScreenUtil().setSp(30))) | ||
| 112 | + ], | ||
| 113 | + ), | ||
| 114 | + ) | ||
| 115 | + ]), | ||
| 116 | + ); | ||
| 106 | }); | 117 | }); |
| 107 | 118 | ||
| 108 | // onRefresh: () async { | 119 | // onRefresh: () async { |
| @@ -128,23 +128,15 @@ class _ContantRightPageState extends State<ContantRightPage> { | @@ -128,23 +128,15 @@ class _ContantRightPageState extends State<ContantRightPage> { | ||
| 128 | }); | 128 | }); |
| 129 | 129 | ||
| 130 | // Lazy load thumbnails after rendering initial contacts. | 130 | // Lazy load thumbnails after rendering initial contacts. |
| 131 | - for (final contact in contacts) { | ||
| 132 | - ContactsService.getAvatar(contact).then((avatar) { | ||
| 133 | - if (avatar == null) return; // Don't redraw if no change. | ||
| 134 | - setState(() => contact.avatar = avatar); | ||
| 135 | - }); | ||
| 136 | - } | 131 | + // for (final contact in contacts) { |
| 132 | + // ContactsService.getAvatar(contact).then((avatar) { | ||
| 133 | + // if (avatar == null) return; // Don't redraw if no change. | ||
| 134 | + // setState(() => contact.avatar = avatar); | ||
| 135 | + // }); | ||
| 136 | + // } | ||
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | - void updateContact() async { | ||
| 140 | - Contact ninja = _contacts | ||
| 141 | - .toList() | ||
| 142 | - .firstWhere((contact) => contact.familyName.startsWith("Ninja")); | ||
| 143 | - ninja.avatar = null; | ||
| 144 | - await ContactsService.updateContact(ninja); | ||
| 145 | 139 | ||
| 146 | - refreshContacts(); | ||
| 147 | - } | ||
| 148 | 140 | ||
| 149 | _openContactForm() async { | 141 | _openContactForm() async { |
| 150 | try { | 142 | try { |
| @@ -220,7 +212,6 @@ class _ContantRightPageState extends State<ContantRightPage> { | @@ -220,7 +212,6 @@ class _ContantRightPageState extends State<ContantRightPage> { | ||
| 220 | goSetting = true; | 212 | goSetting = true; |
| 221 | openSetting(); | 213 | openSetting(); |
| 222 | } | 214 | } |
| 223 | - ; | ||
| 224 | }, | 215 | }, |
| 225 | emptyMsg: "暂时没有联系人哦", | 216 | emptyMsg: "暂时没有联系人哦", |
| 226 | emptyImg: "empty_search", | 217 | emptyImg: "empty_search", |
| @@ -230,49 +221,56 @@ class _ContantRightPageState extends State<ContantRightPage> { | @@ -230,49 +221,56 @@ class _ContantRightPageState extends State<ContantRightPage> { | ||
| 230 | itemCount: _contacts?.length ?? 0, | 221 | itemCount: _contacts?.length ?? 0, |
| 231 | itemBuilder: (BuildContext context, int index) { | 222 | itemBuilder: (BuildContext context, int index) { |
| 232 | Contact c = _contacts?.elementAt(index); | 223 | Contact c = _contacts?.elementAt(index); |
| 233 | - return Column( | ||
| 234 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 235 | - children: [ | ||
| 236 | - index == 0 | ||
| 237 | - ? MyDivider( | ||
| 238 | - double.infinity, | ||
| 239 | - ScreenUtil().setWidth(20), | ||
| 240 | - color: MyColours.color_f5f5f5, | ||
| 241 | - ) | ||
| 242 | - : Container(), | ||
| 243 | - Container( | ||
| 244 | - width: double.infinity, | ||
| 245 | - padding: EdgeInsets.symmetric( | ||
| 246 | - horizontal: ScreenUtil().setWidth(40), | ||
| 247 | - vertical: ScreenUtil().setWidth(30)), | ||
| 248 | - height: ScreenUtil().setWidth(74 * 2), | ||
| 249 | - decoration: BoxDecoration( | ||
| 250 | - border: Border( | ||
| 251 | - top: index == 0 | ||
| 252 | - ? BorderSide( | 224 | + return InkWell( |
| 225 | + onTap: () { | ||
| 226 | + if (c.phones.first.value != null && | ||
| 227 | + c.phones.first.value != '') { | ||
| 228 | + DialogUtil.goPhone(c.phones.first.value); | ||
| 229 | + } | ||
| 230 | + }, | ||
| 231 | + child: Column( | ||
| 232 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 233 | + children: [ | ||
| 234 | + index == 0 | ||
| 235 | + ? MyDivider( | ||
| 236 | + double.infinity, | ||
| 237 | + ScreenUtil().setWidth(20), | ||
| 238 | + color: MyColours.color_f5f5f5, | ||
| 239 | + ) | ||
| 240 | + : Container(), | ||
| 241 | + Container( | ||
| 242 | + width: double.infinity, | ||
| 243 | + padding: EdgeInsets.symmetric( | ||
| 244 | + horizontal: ScreenUtil().setWidth(40), | ||
| 245 | + vertical: ScreenUtil().setWidth(30)), | ||
| 246 | + height: ScreenUtil().setWidth(74 * 2), | ||
| 247 | + decoration: BoxDecoration( | ||
| 248 | + border: Border( | ||
| 249 | + top: index == 0 | ||
| 250 | + ? BorderSide( | ||
| 251 | + width: ScreenUtil().setWidth(2), | ||
| 252 | + color: MyColours.color_E0E0E0) | ||
| 253 | + : BorderSide( | ||
| 254 | + width: 0, color: Colors.transparent), | ||
| 255 | + bottom: BorderSide( | ||
| 253 | width: ScreenUtil().setWidth(2), | 256 | width: ScreenUtil().setWidth(2), |
| 254 | - color: MyColours.color_E0E0E0) | ||
| 255 | - : BorderSide( | ||
| 256 | - width: 0, color: Colors.transparent), | ||
| 257 | - bottom: BorderSide( | ||
| 258 | - width: ScreenUtil().setWidth(2), | ||
| 259 | - color: MyColours.color_E0E0E0))), | ||
| 260 | - child: Column( | ||
| 261 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 262 | - children: [ | ||
| 263 | - Text(c.displayName, | ||
| 264 | - style: TextStyle( | ||
| 265 | - color: MyColours.color_333333, | ||
| 266 | - fontSize: ScreenUtil().setSp(32))), | ||
| 267 | - VEmptyView(10), | ||
| 268 | - Text(c.phones.first.value, | ||
| 269 | - style: TextStyle( | ||
| 270 | - color: MyColours.color_999999, | ||
| 271 | - fontSize: ScreenUtil().setSp(30))) | ||
| 272 | - ], | ||
| 273 | - ), | ||
| 274 | - ) | ||
| 275 | - ]); | 257 | + color: MyColours.color_E0E0E0))), |
| 258 | + child: Column( | ||
| 259 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 260 | + children: [ | ||
| 261 | + Text(c.displayName, | ||
| 262 | + style: TextStyle( | ||
| 263 | + color: MyColours.color_333333, | ||
| 264 | + fontSize: ScreenUtil().setSp(32))), | ||
| 265 | + VEmptyView(10), | ||
| 266 | + Text(c.phones.first.value, | ||
| 267 | + style: TextStyle( | ||
| 268 | + color: MyColours.color_999999, | ||
| 269 | + fontSize: ScreenUtil().setSp(30))) | ||
| 270 | + ], | ||
| 271 | + ), | ||
| 272 | + ) | ||
| 273 | + ])); | ||
| 276 | }); | 274 | }); |
| 277 | } | 275 | } |
| 278 | } | 276 | } |
-
Please register or login to post a comment