【问题标题】:How to get data out of flutter plugin vCard如何从颤振插件 vCard 中获取数据
【发布时间】:2020-10-11 10:35:31
【问题描述】:

所以我试图让一个颤振应用程序显示从电子名片中提取的联系信息。但是我在如何过滤掉名字、姓氏、电话号码等数据时遇到了麻烦。这就是提取的 vcard 数据的样子

I/flutter (11933): BEGIN:VCARD
I/flutter (11933): VERSION:3.0
I/flutter (11933): FN;CHARSET=UTF-8:FirstName MiddleName LastName
I/flutter (11933): N;CHARSET=UTF-8:LastName;FirstName;MiddleName;;
I/flutter (11933): NICKNAME;CHARSET=UTF-8:
I/flutter (11933): BDAY:20201011
I/flutter (11933): TEL;TYPE=WORK,VOICE:Work Phone Number
I/flutter (11933): ORG;CHARSET=UTF-8:ActivSpaces Labs
I/flutter (11933): URL;CHARSET=UTF-8:https://github.com/valerycolong
I/flutter (11933): NOTE;CHARSET=UTF-8:Notes on contact
I/flutter (11933): REV:2020-10-11T15:35:06.168221
I/flutter (11933): END:VCARD

谁能帮我解决这个问题。我试过使用 vcard_parser 插件,它的输出也让我很困惑,因为我是 Flutter 的新手

I/flutter (11933): {BEGIN: VCARD, VERSION: 3.0, FN;CHARSET=UTF-8: {name: UTF-8, value: FirstName MiddleName LastName}, N;CHARSET=UTF-8: {name: UTF-8, value: LastName}, NICKNAME;CHARSET=UTF-8: {name: UTF-8, value: }, BDAY: 20201011, TEL;TYPE=WORK,VOICE: {name: WORK,VOICE, value: Work Phone Number}, ORG;CHARSET=UTF-8: {name: UTF-8, value: ActivSpaces Labs}, NOTE;CHARSET=UTF-8: {name: UTF-8, value: Notes on contact}, END: VCARD}

感谢您的帮助!

【问题讨论】:

    标签: flutter dart vcf-vcard


    【解决方案1】:

    试试Simple Vcard Parser。 这是用于从 VCard 中提取数据的 Flutter 包。

    更新您的 pubspec.yaml

      dependencies:
      ...
      simple_vcard_parser: ^0.1.3
    

    用法:

    import 'package:simple_vcard_parser/simple_vcard_parser.dart';
    VCard vc = VCard(myVCard);
    print(vc.version); 
    print(vc.formattedName); 
    print(vc.organisation); 
    print(vc.title); 
    print(vc.email); 
    print(vc.typedTelephone); 
    print(vc.name);
    

    【讨论】:

      猜你喜欢
      • 2019-04-20
      • 2022-10-06
      • 2019-11-21
      • 2021-02-16
      • 1970-01-01
      • 2021-03-26
      • 1970-01-01
      • 2020-11-17
      • 2021-10-30
      相关资源
      最近更新 更多