【问题标题】:FlutterContactPicker how to throw the error UserCancelledPickingExceptionFlutterContactPicker 如何抛出错误 UserCancelledPickingException
【发布时间】:2021-04-30 19:11:08
【问题描述】:

我正在尝试这段代码,但报错!

try { contact = await FlutterContactPicker .pickPhoneContact(); } on PlatformException catch (e) { if (e.code == 'CANCELLED') { throw UserCancelledPickingException(); } rethrow; }

【问题讨论】:

    标签: flutter-layout


    【解决方案1】:

    替换:

    on PlatformException
    

    on UserCancelledPickingException {}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-03-08
      • 2016-06-14
      • 2012-10-28
      • 2019-01-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多