how to read V Card file(contact number,name etc) in flutter without use string split

1,293

You can user VCard parser from https://pub.dev/packages/vcard_parser add to pubspec

dependencies:
  vcard_parser: ^0.1.6

in code import

import 'package:vcard_parser/vcard_parser.dart';

Now

Map<String, Object> map = VcardParser(String VCardcontent).parse() ;
Share:
1,293
Admin
Author by

Admin

Updated on December 17, 2022

Comments

  • Admin
    Admin over 1 year

    enter image description here

    i try to read contacts number and name from this V Card file. i don't know,what is the proper any way to read .

    i use string split method. but any other proper way to read this, please suggest

    ( V Card file image show here)

    • pskink
      pskink about 4 years
      String.splitMapJoin / StringScanner ? but why to make your life harder if you already have easy solution?
    • Admin
      Admin about 4 years
      yes you are right,split string is good option. but i think may be another solution. that i don't know.. @ pskink
    • Admin
      Admin about 4 years
      yes i use it already.but its so complex for separate and read all data.
    • pskink
      pskink about 4 years
      what is complex?
    • Admin
      Admin about 4 years
      example :- for Phone number get in TEL in work and home ,and same as address has two fields work and home. and same as other filed for iterate data.
  • Admin
    Admin about 4 years
    Thanks for response, but this library not define how they work. @Dev
  • Admin
    Admin about 4 years
    Its work,but not so exact for read all data .work same as Split method.i was use it its get data like for email :- EMAIL;TYPE=INTERNET: {name: INTERNET, value: [email protected]},
  • Dev
    Dev about 4 years
    bro this is the only available parser on pub as much as i know.
  • Admin
    Admin about 4 years
    i agree with you.but i think may be these have another solution also..
  • Nikul Boharwal
    Nikul Boharwal over 3 years
    Hey have you get the solution for this stuff because I also get in stuck to read vCard file in flutter