DRSchlaubi / contact_picker

A Flutter plugin for picking a contact from the address book.
https://pub.dev/packages/fluttercontactpicker
BSD 3-Clause "New" or "Revised" License
18 stars 37 forks source link

pickEmailContact never completes if pressing BACK on Android #29

Closed kaciula closed 3 years ago

kaciula commented 3 years ago

Hi.

Thank you for the useful plugin.

On Android, if I start pickEmailContact and await and the user does not choose a contact but presses BACK, the code hangs indefinitely.

I would suggest you detect BACK press and return a null contact. Otherwise, define an encapsulating object that has a success boolean value along with the contact (if chosen)

DRSchlaubi commented 3 years ago

I guess i don't complete the future if the intent never returns will see how to fix it later this day