fluttercontactpicker 2.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • new79

fluttercontactpicker #

pub.de

Interact with native OS contact pickers using Flutter

Getting Started #

Grab contact.

final PhoneContact contact =
                    await FlutterContactPicker.pickPhoneContact();

For more info read the docs or take a look at the example

2.1.2 #

  • Fix iOS implementation

2.1.1 #

  • Remove debug messages

2.1.0 #

  • Migrate to Flutter v2 embedded plugins
  • Remove example plugin code
  • Support multiple requests at the same time (only recommended for v2 plugins)

2.0.0 #

  • Rewrite fork with kotlin and swift
  • Add support for email contacts

example/lib/main.dart

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:fluttercontactpicker/fluttercontactpicker.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) => MaterialApp(
        home: MainWidget(),
      );
}

class MainWidget extends StatefulWidget {
  @override
  _MainWidgetState createState() => _MainWidgetState();
}

class _MainWidgetState extends State<MainWidget> {
  PhoneContact _phoneContact;
  EmailContact _emailContact;

  @override
  Widget build(BuildContext context) => Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Column(
          children: <Widget>[
            if(_emailContact != null) Column(children: <Widget>[
              const Text("Email contact:"),
              Text("Name: ${_emailContact.fullName}"),
              Text("Email: ${_emailContact.email.email} (${_emailContact.email.label})")
            ],),
            if(_phoneContact != null) Column(children: <Widget>[
              const Text("Phone contact:"),
              Text("Name: ${_phoneContact.fullName}"),
              Text("Phone: ${_phoneContact.phoneNumber.number} (${_phoneContact.phoneNumber.label})")
            ],),
            RaisedButton(
              child: const Text("pick phone contact"),
              onPressed: () async {
                final PhoneContact contact =
                    await FlutterContactPicker.pickPhoneContact();
                print(contact);
                setState(() {
                  _phoneContact = contact;
                });
              },
            ),
            RaisedButton(
              child: const Text("pick email contact"),
              onPressed: () async {
                final EmailContact contact =
                    await FlutterContactPicker.pickEmailContact();
                print(contact);
                setState(() {
                  _emailContact = contact;
                });
              },
            )
          ],
        ),
      );
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  fluttercontactpicker: ^2.1.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:fluttercontactpicker/fluttercontactpicker.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
58
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
79
Learn more about scoring.

We analyzed this package on Mar 26, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Format lib/fluttercontactpicker.dart.

Run flutter format to format lib/fluttercontactpicker.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test