This library supports create and parse VCard files.
- 2.1
- 3.0
- 4.0
Add this package to your dependency list:
dart pub add vcf_dart
Include into your project:
import 'package:vcf_dart/vcf_dart.dart';
Parse the existing VCard file and print its content:
const localStr = """BEGIN:VCARD
VERSION:3.0
N:User;Test
FN:Test User
EMAIL;TYPE=HOME:[email protected]
END:VCARD""";
final stack = VCardStack.fromData(localStr);
print(stack.vcardStack);
For more examples, check the example folder.
Create an empty VCard stack and add a VCard element:
final stack = VCardStack();
final builder = VCardItemBuilder()
..addProperty(
const VCardProperty(
name: VConstants.name,
values: ['User', 'Test'],
),
)
..addPropertyFromEntry(
VConstants.formattedName,
'Test User',
)
..addProperty(
const VCardProperty(
name: VConstants.email,
nameParameters: [
VCardNameParameter(
VConstants.nameParamType,
VConstants.phoneTypeHome,
),
],
values: ['[email protected]'],
),
);
stack.items.add(builder.build());
- AGENT type support
- Add more checks for invalid VCF files
- Add more tests and examples
- And more...