unify_api 1.2.2+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 60

unify_api #

A Unify API Wrapper

Examples #

  group("Account", () {
    test("Client => isAuthorized", () {
      expect(client.isAuthorized, equals(true));
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("getCache() => UnifyCache", () async {
      try {
        UnifyCache _data = await client.getCache();
        expect(_data is UnifyCache, equals(true));
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)), skip: true);

    test("getInfo() => AccountInfo", () async {
      try {
        AccountInfo _data = await client.getInfo();
        expect(_data is AccountInfo, equals(true));
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listUnifyAlerts() => List<UnifyAlert>", () async {
      try {
        List<UnifyAlert> _data = await client.listUnifyAlerts();
        expect(_data is List<UnifyAlert>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));
  });

  group("Contacts", () {
    test("listContacts() => List<Contact>", () async {
      try {
        List<Contact> _data = await client.listContacts();
        expect(_data is List<Contact>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("getContactDetails() => ContactDetails", () async {
      try {
        List<Contact> _data = await client.listContacts();
        ContactDetails _info = await _data.first.getDetails();
        expect(_info is ContactDetails, equals(true));
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listContactDetailsTracker() => List<Tracker>", () async {
      try {
        List<Contact> _data = await client.listContacts();
        List<Tracker> _list = await _data.first.listTracker();
        expect(_list is List<Tracker>, equals(true));
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listContactDetailsNotes() => List<Note>", () async {
      try {
        List<Contact> _data = await client.listContacts();
        List<ContactNote> _list = await _data.first.listNotes();
        expect(_list is List<ContactNote>, equals(true));
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listLoanHistory() => List<LoanHistory>", () async {
      try {
        List<Contact> _data = await client.listContacts();
        List<LoanHistory> _info = await _data.first.listLoans();
        expect(_info is List<LoanHistory>, equals(true));
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listContactLogResponses() => List<String>", () async {
      try {
        List<String> _data = await client.listContactLogResponses();
        expect(_data is List<String>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listCompanyCategories() => List<CompanyCategory>", () async {
      try {
        List<CompanyCategory> _data = await client.listCompanyCategories();
        expect(_data is List<CompanyCategory>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));
  });

  group("Leads", () {
    test("listLeads() => List<Lead>", () async {
      try {
        List<Lead> _data = await client.listLeads();
        expect(_data is List<Lead>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("getLeadDetails() => LeadDetails", () async {
      try {
        List<Lead> _data = await client.listLeads();
        LeadDetails _info = await _data.first.getDetails();
        expect(_info is LeadDetails, equals(true));
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listLeadDetailsTracker() => List<Tracker>", () async {
      try {
        List<Lead> _data = await client.listLeads();
        List<Tracker> _list = await _data.first.listTracker();
        expect(_list is List<Tracker>, equals(true));
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listLeadDetailsNotes() => List<Note>", () async {
      try {
        List<Lead> _data = await client.listLeads();
        List<LeadNote> _list = await _data.first.listNotes();
        expect(_list is List<LeadNote>, equals(true));
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listLeadLogResponses() => List<String>", () async {
      try {
        List<String> _data = await client.listLeadLogResponses();
        expect(_data is List<String>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));
  });

  group("Contact Groups", () {
    test("listContactGroups() => List of ContactGroup", () async {
      try {
        List<ContactGroup> _data = await client.listContactGroups();
        expect(_data is List<ContactGroup>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listContactsForContactGroup() => List<Contact>", () async {
      try {
        List<ContactGroup> _data = await client.listContactGroups();
        List<Contact> _info = await _data.first.listContacts();
        expect(_info is List<Contact>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listEmailsForContactGroup() => List<String>", () async {
      try {
        List<ContactGroup> _data = await client.listContactGroups();
        List<String> _info = await _data.first.listEmails();
        expect(_info is List<String>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));
  });

  group("Lead Groups", () {
    test("listLeadGroups() => List<LeadGroup>", () async {
      try {
        List<LeadGroup> _data = await client.listLeadGroups();
        expect(_data is List<LeadGroup>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listLeadsForLeadGroup() => List<Lead>", () async {
      try {
        List<LeadGroup> _data = await client.listLeadGroups();
        List<Lead> _info = await _data.first.listLeads();
        expect(_info is List<Lead>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listEmailsForLeadGroup() => List<String>", () async {
      try {
        List<LeadGroup> _data = await client.listLeadGroups();
        List<String> _info = await _data.first.listEmails();
        expect(_info is List<String>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));
  });

  group("Dashboard Alerts", () {
    test("getStats() => DashboardStats", () async {
      try {
        DashboardStats _data = await client.getStats();
        expect(_data is DashboardStats, equals(true));
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listOpportunitiyAlerts() => List<DashboardAlert>", () async {
      try {
        List<DashboardAlert> _data = await client.listOpportunitiyAlerts();
        expect(_data is List<DashboardAlert>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listCustomerAlerts() => List<DashboardAlert>", () async {
      try {
        List<DashboardAlert> _data = await client.listCustomerAlerts();
        expect(_data is List<DashboardAlert>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listHotProspectAlerts() => List<DashboardAlert>", () async {
      try {
        List<DashboardAlert> _data = await client.listHotProspectAlerts();
        expect(_data is List<DashboardAlert>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listPipelineAlerts() => List<DashboardAlert>", () async {
      try {
        List<DashboardAlert> _data = await client.listPipelineAlerts();
        expect(_data is List<DashboardAlert>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listDashboardPartners() => List<DashboardPartners>", () async {
      try {
        List<DashboardPartners> _data = await client.listDashboardPartners();
        expect(_data is List<DashboardPartners>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));
  });

  group("Loans", () {
    test("listLoansAll() => List<Loan>", () async {
      try {
        List<Loan> _data = await client.listLoansAll();
        expect(_data is List<Loan>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listLoansClosed() => List<Loan>", () async {
      try {
        List<Loan> _data = await client.listLoansClosed();
        expect(_data is List<Loan>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listLoansMyPipeline() => List<Loan>", () async {
      try {
        List<Loan> _data = await client.listLoansMyPipeline();
        expect(_data is List<Loan>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listLoansProspects() => List<Loan>", () async {
      try {
        List<Loan> _data = await client.listLoansProspects();
        expect(_data is List<Loan>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listLoansOther() => List<Loan>", () async {
      try {
        List<Loan> _data = await client.listLoansOther();
        expect(_data is List<Loan>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("getLoanDetails() => LoanDetails", () async {
      try {
        List<Loan> _data = await client.listLoansAll();
        LoanDetails _info = await _data.first.getDetails();
        expect(_info is LoanDetails, equals(true));
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("getLoanStatus() => LoanProgress", () async {
      try {
        List<Loan> _data = await client.listLoansAll();
        LoanProgress _info = await _data.first.getProgress();
        expect(_info is LoanProgress, equals(true));
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listLoanContacts() => List<LoanContact>", () async {
      try {
        List<Loan> _data = await client.listLoansAll();
        List<LoanContact> _info = await _data.first.listContacts();
        expect(_info is List<LoanContact>, equals(true));
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));
  });

  group("Tasks", () {
    test("listTasksAll() => List<Task>", () async {
      try {
        List<Task> _data = await client.listTasksAll();
        expect(_data is List<Task>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listTasksContacts() => List<Task>", () async {
      try {
        List<Task> _data = await client.listTasksContacts();
        expect(_data is List<Task>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listTasksLeads() => List<Task>", () async {
      try {
        List<Task> _data = await client.listTasksLeads();
        expect(_data is List<Task>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listTasksCoreLeads() => List<Task>", () async {
      try {
        List<Task> _data = await client.listTasksCoreLeads();
        expect(_data is List<Task>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listTasksForContact() => List<Task>", () async {
      try {
        List<Contact> _data = await client.listContacts();
        List<Task> _list = await _data.first.listTasks();
        expect(_list is List<Task>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listTasksForLead() => List<Task>", () async {
      try {
        List<Lead> _data = await client.listLeads();
        List<Task> _list = await _data.first.listTasks();
        expect(_list is List<Task>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listTasksForCoreLead() => List<Task>", () async {
      try {
        List<CoreLead> _data = await client.listCoreLeads();
        List<Task> _list = await _data.first.listTasks();
        expect(_list is List<Task>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));
  });

  group("Core Leads", () {
    test("listCoreLeads() => List<CoreLead>", () async {
      try {
        List<CoreLead> _data = await client.listCoreLeads();
        expect(_data is List<CoreLead>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("getCoreLeadDetails() => CoreLeadDetails", () async {
      try {
        List<CoreLead> _data = await client.listCoreLeads();
        CoreLeadDetails _info = await _data.first.getDetails();
        expect(_info is CoreLeadDetails, equals(true));
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));
  });

  group("Unify Video", () {
    test("getKalturaSession() => String", () async {
      try {
        AccountInfo _info = await client.getInfo();
        String _data = await client.getKalturaSession(_info?.kalturaId);
        expect(_data is String, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("Admin getKalturaSession() => String", () async {
      try {
        String _data = await client.getKalturaSession(null, admin: true);
        expect(_data is String, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));
    test("listTemplates() => List<String>", () async {
      try {
        List<String> _data = await client.listTemplates();
        expect(_data is List<String>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listVideosAll() => List<Video>", () async {
      try {
        List<Video> _data = await client.listVideosAll();
        expect(_data is List<Video>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listVideosMyVideos() => List<Video>", () async {
      try {
        List<Video> _data = await client.listVideosMyVideos();
        expect(_data is List<Video>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listVideosArchived() => List<Video>", () async {
      try {
        List<Video> _data = await client.listVideosArchived();
        expect(_data is List<Video>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listVideosShared() => List<Video>", () async {
      try {
        List<Video> _data = await client.listVideosShared();
        expect(_data is List<Video>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("getVideoDetails() => VideoDetails", () async {
      try {
        List<Video> _data = await client.listVideosAll();
        VideoDetails _info = await _data?.first?.getDetails();
        expect(_info is VideoDetails, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("getVideoShareUrl() => String", () async {
      try {
        List<Video> _data = await client.listVideosAll();
        String _info = await _data?.first?.share();
        expect(_info is String, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("getVideoPreview() => String", () async {
      try {
        List<Video> _data = await client.listVideosAll();
        String _info = await _data?.first?.preview();
        expect(_info is String, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("getVideoTotalViews() => int", () async {
      try {
        int _info = await client.getVideoTotalViews();
        expect(_info is int, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));
  });

  group("Marketing", () {
    test("listMarketingSection() => List<MarketingSection>", () async {
      try {
        List<MarketingSection> _data = await client.listMarketingSection();
        expect(_data is List<MarketingSection>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listMarketingMaterial() => List<MarketingMaterial>", () async {
      try {
        List<MarketingMaterial> _data = await client.listMarketingMaterial();
        expect(_data is List<MarketingMaterial>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("getMarketingDetails() => MarketingMaterialDetails", () async {
      try {
        List<MarketingMaterial> _data = await client.listMarketingMaterial();
        MarketingMaterialDetails _info = await _data.first.getDetails();
        expect(_info is MarketingMaterialDetails, equals(true));
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listMarketingCampaigns() => List<MarketingCampaign>", () async {
      try {
        List<MarketingCampaign> _data = await client.listMarketingCampaigns();
        expect(_data is List<MarketingCampaign>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("listMarketingPartners() => List<MarketingPartner>", () async {
      try {
        List<MarketingPartner> _data = await client.listMarketingPartners();
        expect(_data is List<MarketingPartner>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("getMarketingValidation() => MarketingValidation", () async {
      try {
        List<MarketingMaterial> _list = await client.listMarketingMaterial();
        MarketingValidation _data = await _list?.first?.validate();
        expect(_data is MarketingValidation, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));
  });

  group("Cart", () {
    test("listCartItems() => List<CartItem>", () async {
      try {
        CartOrder _data = await client.getCartOrder();
        List<CartItem> _list = await _data.listItems();
        expect(_list is List<CartItem>, true);
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));

    test("getCartOrder() => CartOrder", () async {
      try {
        CartOrder _data = await client.getCartOrder();
        expect(_data is CartOrder, equals(true));
      } catch (e) {
        fail("Error: $e");
      }
    }, timeout: Timeout(Duration(seconds: _timeout)));
  });

Changelog #

1.2.2 #

  • Check whether or not to show Unapproved videos

1.2.0 #

  • Making Get Details Faster
  • Changing to Timeline

1.1.3 #

  • Fix edit Leads/Loans
  • Removed Unapproved tag from My Videos

1.1.2 #

  • Bug fix for Lead Loans

1.1.1 #

  • Bug fix for Video Enabled

1.1.0 #

  • Fix for Unify Video Enabled

1.0.4 #

  • Fix for decoder

1.0.3 #

  • Bug fixes

1.0.2 #

  • Checking for not found lead, contacts and loan details

1.0.1 #

  • Bug Fixes for Cart Values
  • Adding more items to cache

1.0.0 #

  • Wrapper built around V1 of Unify REST API

example/README.md

unify_api #

A Unify API Wrapper

Examples #

 import 'package:flutter/material.dart';
import 'package:unify_api/tool.dart';

import 'common/index.dart';
import 'ui/index.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({
    Key key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: HomeScreen(),
    );
  }
}

class HomeScreen extends StatefulWidget {
  @override
  _HomeScreenState createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
  UnifyClient _client;
  final TextEditingController _username = TextEditingController();
  final TextEditingController _password = TextEditingController();
  final TextEditingController _domain =
      TextEditingController(text: "mobile.myunifycrm.com");

  @override
  Widget build(BuildContext context) {
    if (_client == null || !_client.isAuthorized)
      return Scaffold(
        appBar: AppBar(title: Text("Login - Unify API")),
        body: SingleChildScrollView(
          child: Column(
            children: <Widget>[
              ListTile(
                title: TextField(
                  controller: _username,
                  decoration: InputDecoration(hintText: "Username"),
                ),
              ),
              ListTile(
                title: TextField(
                  controller: _password,
                  obscureText: true,
                  decoration: InputDecoration(hintText: "Password"),
                ),
              ),
              ListTile(
                title: TextField(
                  controller: _domain,
                  decoration: InputDecoration(hintText: "Domain"),
                ),
              ),
              RaisedButton.icon(
                icon: Icon(Icons.account_circle),
                label: Text("Login"),
                onPressed: () async {
                  var client = getUnifyClient(
                    unifyUsername: _username.text,
                    unifyPassword: _password.text,
                    domain: _domain.text,
                  );
                  await client.login();

                  setState(() {
                    _client = client;
                  });
                },
              ),
            ],
          ),
        ),
      );
    return Scaffold(
        appBar: AppBar(
          title: const Text('Overview - Unify API'),
          actions: <Widget>[
            IconButton(
              icon: Icon(Icons.exit_to_app),
              onPressed: () {
                setState(() {
                  _client = null;
                });
              },
            )
          ],
        ),
        body: GridView.count(
          crossAxisCount: 2,
          children: <Widget>[
            GridItem(
              iconData: Icons.account_circle,
              name: "Account",
              details: AccountInfoExample(client: _client),
            ),
            GridItem(
              iconData: Icons.contacts,
              name: "Contacts",
              details: ContactsExample(client: _client),
            ),
            GridItem(
              iconData: Icons.people,
              name: "Leads",
              details: LeadsExample(client: _client),
            ),
            GridItem(
              iconData: Icons.people_outline,
              name: "Lead Tracker",
              details: CoreLeadsExample(client: _client),
            ),
            GridItem(
              iconData: Icons.dashboard,
              name: "Dashboard",
              details: DashboardAlertsExample(client: _client),
            ),
            GridItem(
              iconData: Icons.group,
              name: "Contact Groups",
              details: ContactGroupsExample(client: _client),
            ),
            GridItem(
              iconData: Icons.group,
              name: "Lead Groups",
              details: LeadGroupsExample(client: _client),
            ),
            GridItem(
              iconData: Icons.folder,
              name: "Loan Folders",
              details: LoanFolderExample(client: _client),
            ),
            GridItem(
              iconData: Icons.video_library,
              name: "Unify Video",
              details: VideoExample(client: _client),
            ),
            GridItem(
              iconData: Icons.info_outline,
              name: "Marketing",
              details: MarketingExample(client: _client),
            ),
            GridItem(
              iconData: Icons.shopping_cart,
              name: "Cart",
              details: CartExample(client: _client),
            ),
          ],
        ));
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  unify_api: ^1.2.2+1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or 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:unify_api/tool.dart';
import 'package:unify_api/unify.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
36
Health:
Code health derived from static analysis. [more]
86
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
60
Learn more about scoring.

We analyzed this package on Dec 9, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.13.1+4

Health issues and suggestions

Document public APIs. (-0.53 points)

987 out of 1003 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/impl/common/http.dart. (-5.36 points)

Analysis of lib/src/impl/common/http.dart reported 11 hints, including:

line 1842 col 7: DO use curly braces for all flow control structures.

line 1865 col 7: DO use curly braces for all flow control structures.

line 1979 col 9: DO use curly braces for all flow control structures.

line 1984 col 13: DO use curly braces for all flow control structures.

line 2177 col 19: Use = to separate a named parameter from its default value.

Fix lib/src/token.dart. (-1.49 points)

Analysis of lib/src/token.dart reported 3 hints:

line 9 col 43: Unnecessary new keyword.

line 30 col 7: Unnecessary new keyword.

line 34 col 21: Unnecessary new keyword.

Fix lib/src/impl/browser.dart. (-1 points)

Analysis of lib/src/impl/browser.dart reported 2 hints:

line 16 col 16: Unnecessary new keyword.

line 20 col 20: Use = to separate a named parameter from its default value.

Fix additional 13 files with analysis or formatting issues. (-6.50 points)

Additional issues in the following files:

  • lib/src/impl/mobile.dart (2 hints)
  • lib/src/impl/unsupported.dart (2 hints)
  • lib/src/types/account/details.dart (2 hints)
  • lib/src/endpoints.dart (1 hint)
  • lib/src/types/contacts/details.dart (1 hint)
  • lib/src/types/contacts/list.dart (1 hint)
  • lib/src/types/leads/details.dart (1 hint)
  • lib/src/types/leads/list.dart (1 hint)
  • lib/src/types/loans/contact.dart (1 hint)
  • lib/src/types/marketing/material.dart (1 hint)
  • lib/src/client.dart (Run dartfmt to format lib/src/client.dart.)
  • lib/src/types/loans/details.dart (Run dartfmt to format lib/src/types/loans/details.dart.)
  • lib/unify.dart (Run dartfmt to format lib/unify.dart.)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
html ^0.14.0+2 0.14.0+3
http ^0.12.0+2 0.12.0+2
intl ^0.16.0 0.16.0
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
csslib 0.16.1
http_parser 3.1.3
meta 1.1.8
path 1.6.4
pedantic 1.9.0
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
test ^1.5.2