contact_add 0.0.3 copy "contact_add: ^0.0.3" to clipboard
contact_add: ^0.0.3 copied to clipboard

Add contacts to Android, iOS or macOS without additional permissions. This is done using native views for the user to complete the contact and save it to the address book.

example/lib/main.dart

import 'package:contact_add/contact.dart';
import 'package:flutter/material.dart';
import 'dart:async';

import 'package:contact_add/contact_add.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            children: [
              ElevatedButton(
                  onPressed: () async {
                    await addContact();
                  },
                  child: const Text('Add Contact')),
            ],
          ),
        ),
      ),
    );
  }

  Future<void> addContact() async {
    await ContactAdd.addContact(Contact(
        firstname: "John",
        lastname: "Doe",
        company: "ContactAdd",
        phone: "+41 01 234 56 78",
        email: "hello@example.com"));
  }
}
3
likes
160
points
59
downloads

Publisher

unverified uploader

Weekly Downloads

Add contacts to Android, iOS or macOS without additional permissions. This is done using native views for the user to complete the contact and save it to the address book.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on contact_add