-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2fc2f90
commit 7921f62
Showing
6 changed files
with
961 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,33 @@ | ||
import 'package:contact_card/cards/mecard.dart'; | ||
import 'package:contact_card/cards/vcard.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
void main() => runApp(const MyApp()); | ||
|
||
const mecardText = | ||
'MECARD:N:Doe,John;ORG:ABC Company;TEL:+123456789;TEL:+987654321;EMAIL:[email protected];ADR:123 Main St, Anytown, CA 12345;NOTE:This is a note;BDAY:1970-01-01;URL:http://www.abccompany.com;TITLE:Marketing Director;NICKNAME:Johnny;X-SOCIALPROFILE;type=twitter:http://twitter.com/johndoe;X-SOCIALPROFILE;type=linkedin:http://www.linkedin.com/in/johndoe;;'; | ||
|
||
const vcard1Text = ''' | ||
BEGIN:VCARD | ||
VERSION:1.0 | ||
N:Gonzalez;Juan;;; | ||
FN:Juan Gonzalez | ||
TEL:555-1234 | ||
TEL;HOME:555-5678 | ||
ADR;WORK:;;123 Main St.;Anytown;CA;12345;USA | ||
ADR;HOME:;;456 Oak St.;Othertown;CA;67890;USA | ||
EMAIL:[email protected] | ||
EMAIL:[email protected] | ||
ORG:Acme Inc.;Sales Department | ||
TITLE:Sales Representative | ||
ROLE:Sales | ||
URL:http://www.johndoe.com | ||
PHOTO;JPEG:http://www.example.com/photo.jpg | ||
LOGO;GIF:http://www.example.com/logo.gif | ||
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Acme Inc.=0D=0ASales Department=0D=0A123 Main St.=0D=0AAnytown, CA 12345=0D=0AUSA | ||
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:456 Oak St.=0D=0AOthertown, CA 67890=0D=0AUSA | ||
END:VCARD'''; | ||
|
||
class MyApp extends StatelessWidget { | ||
const MyApp({Key? key}) : super(key: key); | ||
|
||
|
@@ -32,6 +54,14 @@ class MyApp extends StatelessWidget { | |
debugPrint(card.toPlainText()); | ||
}, | ||
), | ||
ElevatedButton( | ||
child: const Text('vCard 1.0'), | ||
onPressed: () { | ||
final card = VCard1.fromPlainText(vcard1Text); | ||
debugPrint(card.toString()); | ||
debugPrint(card.toPlainText()); | ||
}, | ||
), | ||
], | ||
), | ||
), | ||
|
Oops, something went wrong.