vCard (Maintained)

Create vCards to import contacts into Outlook, iOS, Mac OS, and Android devices from your website or mobile application.


To use this package, add vcard_maintained as a dependency in your pubspec.yaml file like so.

  vcard_maintained: any

Then run the flutter tooling:

flutter packages get


Below is a simple example of how to create a basic vCard and how to save it to a file, or view its contents from the console.

/// Import the package
import 'package:vcard_maintained/vcard_maintained.dart';

///Create a new vCard
var vCard = VCard();

///Set properties
vCard.firstName = 'FirstName';
vCard.middleName = 'MiddleName';
vCard.lastName = 'LastName';
vCard.organization = 'ActivSpaces Labs';'/path/to/image/file.png', 'PNG');
vCard.workPhone = 'Work Phone Number';
vCard.birthday =;
vCard.title = 'Software Developer';
vCard.url = '';
vCard.note = 'Notes on contact';

/// Save to file

/// Get as formatted string

Embedding Images

You can embed images in the photo or logo field instead of linking to them from a URL using base64 encoding.

//can be Windows or Linux/Unix path structures, and JPEG, PNG, GIF formats'/path/to/file.png');
//can also embed images via base-64 encoded strings'iVBORw0KGgoAAAANSUhEUgAAA2...', 'image/png');
vCard.logo.embedFromString('iVBORw0KGgoAAAANSUhEUgAAA2...', 'image/png');

Date Reference

MDN reference on how to use the Date object for birthday and anniversary can be found at

Complete Example

The following shows a vCard with everything filled out.

///import the package
import 'package:vcard_maintained/vcard_maintained.dart';

//create a new vCard
var vCard = VCard();

///set basic properties shown before
vCard.firstName = 'FirstName';
vCard.middleName = 'MiddleName';
vCard.lastName = 'Last Name';
vCard.uid = '6yuuhuhj-c34d-4a1e-8922-bd38a9476a53';
vCard.organization = 'ActivSpaces Labs';

///link to image'/path/to/image/file.png', 'JPEG');

///or embed image'/path/to/image/file.png');

vCard.workPhone = '312-555-1212';
vCard.birthday =;
vCard.title = 'Software Developer';
vCard.url = '';
vCard.workUrl = '';
vCard.note = 'Notes on contact';

///set other vitals
vCard.nickname = 'Scarface';
vCard.namePrefix = 'Mr.';
vCard.nameSuffix = 'JR';
vCard.gender = 'M';
vCard.anniversary =;
vCard.role = 'Software Development';

///set other phone numbers
vCard.homePhone = 'Home Phone';
vCard.cellPhone = 'Cell Phone';
vCard.pagerPhone = 'Pager Phone';

///set fax/facsimile numbers
vCard.homeFax = 'Home Fax';
vCard.workFax = 'Work Fax';

///set email addresses = '';
vCard.workEmail = '';

///set logo of organization or personal logo (also supports embedding, see above)
vCard.logo.attachFromUrl('', 'PNG');

///set URL where the vCard can be found
vCard.source = '';

///set address information
vCard.homeAddress.label = 'Home Address';
vCard.homeAddress.street = 'Great Soppo'; = 'Buea';
vCard.homeAddress.stateProvince = 'SW';
vCard.homeAddress.postalCode = '00237';
vCard.homeAddress.countryRegion = 'Cameroon';
vCard.homeAddress.type = 'HOME';

vCard.workAddress.label = 'Work Address';
vCard.workAddress.street = 'Molyko'; = 'Buea';
vCard.workAddress.stateProvince = 'SW';
vCard.workAddress.postalCode = '00237';
vCard.workAddress.countryRegion = 'Cameroon';
vCard.workAddress.type = 'WORK';

///set social media URLs
vCard.socialUrls['facebook'] = 'https://...';
vCard.socialUrls['linkedIn'] = 'https://...';
vCard.socialUrls['twitter'] = 'https://...';
vCard.socialUrls['flickr'] = 'https://...';
vCard.socialUrls['custom'] = 'https://...';

///you can also embed photos from files instead of attaching via URL'photo.jpg');

vCard.version = '3.0'; //can also support 2.1 and 4.0, certain versions only support certain fields

///save to file

///get as formatted string

Multiple Email, Fax, & Phone Examples

email, otherEmail, cellPhone, pagerPhone, homePhone, workPhone, homeFax, workFax, otherPhone all support multiple entries in an array format.

Examples are provided below:

///import the package
import 'package:vcard_maintained/vcard_maintained.dart';

//create a new vCard
var vCard = VCard();

///multiple email entry = [

///multiple cellphone
vCard.cellPhone = [

Apple AddressBook Extensions

You can mark as a contact as an organization with the following Apple AddressBook extension property:

    var vCard = VCard();
    vCard.isOrganization = true;

Original Source

This is a dart port of vCards-js package by Eric J Nesser


You can run the VCard unit tests via (WIP):

flutter test


Contributions are always welcome!

Thanks to Eric whose original work made life so much easier for me.


This package depends on:


Contributions are always welcome!

Work with us


Copyright (c)2019 ActivSpaces Labs MIT