blusalt_identity 0.0.1-dev.4

  • Readme
  • Changelog
  • Example
  • Installing
  • new53

blusalt_identity #

Dart CI

Blusalt Flutter package for accessing Blusalt Identity Verification Services

Developers Preview Status #

The Package is a pre-release , all issues should be logged in Issues.

Usage #

To use this plugin, add blusalt_identity_plugin as a dependency in your pubspec.yaml file.

Getting Started #

import 'package:blusalt_identity/network/blusalt_sdk.dart';
import 'package:blusalt_identity/network/network_client.dart';


ApiCredentials credentials = ApiCredentials(
    apiKey: MY_API_KEY,
    clientID: MY_CLIENT_ID, 
    appName: MY_APP_NAME
  );
  var future = BlusaltSDK.initializeSDK(credentials);
  future.then((onValue){
    print(onValue);
  })
  .catchError((onError){
   // print(onError);
  });

Sample Usage #

import 'package:blusalt_identity/network/blusalt_sdk.dart';
import 'package:blusalt_identity/network/network_client.dart';
import 'package:blusalt_identity/verification_manager.dart' as manager;

///
void verifyBVN(BuildContext context){
  initProgressBar(context);
  _progressDialog.show();
  BVNRequest bvnRequest = BVNRequest(
      firstName: "",
      lastName: "",
      bvnNumber: "",
      phoneNumber: ""
  );
  var response = manager.verifyBVN(bvnRequest);
  response.then((onValue){
    _progressDialog.dismiss();
    showToast(context, onValue.message );
  })
  .catchError((onError){
    _progressDialog.dismiss();
    showToast(context, onError.toString());
  });
}

0.0.1-dev.4 #

  • Update Request models

0.0.1-dev.3 #

  • Add Examples and minor code changes

0.0.1-dev.2 #

  • Fix Minor code bugs

0.0.1-dev.1 #

  • Initial developers preview release.

example/blusalt_identity.dart

import 'package:blusalt_identity/model/request.dart';
import 'package:blusalt_identity/network/blusalt_sdk.dart';
import 'package:blusalt_identity/network/network_client.dart';
import 'package:blusalt_identity/verification_manager.dart' as manager;

/// Initializing the SDK with API credentials obtained from account
/// [dashboard](blusalt.io). Replace the empty strings with the appropriate value
void initializeSDK() {
  ApiCredentials credentials =
      ApiCredentials(apiKey: "", clientID: "", appName: "");
  var future = BlusaltSDK.initializeSDK(credentials);
  future.then((onValue) {
    print(onValue);
  }).catchError((onError) {
    // print(onError);
  });
}

/// Verify Customer BVN. Provide actual customer BVN and phone number
/// Get the Customer BVN data
void verifyBVN() {
  BVNRequest bvnRequest = BVNRequest(bvnNumber: "", phoneNumber: "");
  var response = manager.verifyBVN(bvnRequest);
  response.then((onValue) {}).catchError((onError) {});
}

/// Verify Customer PVC. Provide actual customer PVC, phone number and state
/// Get the Customer PVC data
void verifyPVC() {
  PVCRequest pvcRequest =
      PVCRequest(lastName: "", pvcNumber: "", phoneNumber: "", state: "");
  var response = manager.verifyPVC(pvcRequest);
  response.then((onValue) {}).catchError((onError) {});
}

/// Verify Customer Natianal Identity number. Provide actual customer NIN and phone number
/// Get the Customer NIN data
void verifyNIN() {
  NINRequest ninRequest = NINRequest(ninNumber: "", phoneNumber: "");
  var response = manager.verifyNIN(ninRequest);
  response.then((onValue) {}).catchError((onError) {});
}

/// Verify Customer International passport. Provide actual customer Passport number and phone number
/// Get the Customer International passport data
void verifyNIP() {
  var nipRequest = NIPRequest(passportNumber: "", phoneNumber: "");
  var response = manager.verifyNIP(nipRequest);
  response.then((onValue) {}).catchError((onError) {});
}

/// Verify Customer Driver's Licence. Provide actual customer licence and phone number
/// Get the Customer Driver's Licence  data
void verifyDriversLicence() {
  var dlRequest = DLRequest(dlNumber: "", phoneNumber: "");
  var response = manager.verifyDriversLicence(dlRequest);
  response.then((onValue) {}).catchError((onError) {});
}

Use this package as a library

1. Depend on it

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


dependencies:
  blusalt_identity: ^0.0.1-dev.4

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:blusalt_identity/common/exception.dart';
import 'package:blusalt_identity/model/bvn_response.dart';
import 'package:blusalt_identity/model/bvn_response.g.dart';
import 'package:blusalt_identity/model/dl_response.dart';
import 'package:blusalt_identity/model/dl_response.g.dart';
import 'package:blusalt_identity/model/initialization_response.dart';
import 'package:blusalt_identity/model/initialization_response.g.dart';
import 'package:blusalt_identity/model/nin_response.dart';
import 'package:blusalt_identity/model/nin_response.g.dart';
import 'package:blusalt_identity/model/nip_response.dart';
import 'package:blusalt_identity/model/nip_response.g.dart';
import 'package:blusalt_identity/model/pvc_response.dart';
import 'package:blusalt_identity/model/pvc_response.g.dart';
import 'package:blusalt_identity/model/request.dart';
import 'package:blusalt_identity/network/blusalt_sdk.dart';
import 'package:blusalt_identity/network/network_client.dart';
import 'package:blusalt_identity/services.dart';
import 'package:blusalt_identity/verification_manager.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
22
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
65
Overall:
Weighted score of the above. [more]
53
Learn more about scoring.

We analyzed this package on Mar 31, 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

Fix lib/services.dart. (-1.49 points)

Analysis of lib/services.dart reported 3 hints:

line 9 col 1: Extension methods weren't supported until version 2.6.0, but this code is required to be able to run on earlier versions.

line 10 col 16: The value of the field '_names' isn't used.

line 20 col 15: This function has a return type of 'ServiceType', but doesn't end with a return statement.

Fix lib/network/blusalt_sdk.dart. (-1 points)

Analysis of lib/network/blusalt_sdk.dart reported 2 hints:

line 30 col 13: The value of the local variable 'services' isn't used.

line 43 col 26: Use ; instead of {} for empty constructor bodies.

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://github.com/dannijax/blusalt_identity_plugin was unreachable.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Package is pre-release. (-5 points)

Pre-release versions should be used with caution; their API can change in breaking ways.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
build_runner ^1.8.0 1.8.1
built_value_generator ^7.0.9 7.0.9
flutter 0.0.0
http ^0.12.0+4 0.12.0+4
http_interceptor ^0.2.0 0.2.0
json_annotation ^3.0.1 3.0.1
json_serializable ^3.2.5 3.3.0
mockito ^4.1.1 4.1.1
Transitive dependencies
_fe_analyzer_shared 1.0.3
analyzer 0.39.4
args 1.6.0
async 2.4.1
boolean_selector 2.0.0
build 1.2.2
build_config 0.4.2
build_daemon 2.1.4
build_resolvers 1.3.3
build_runner_core 5.0.0
built_collection 4.3.2
built_value 7.0.9
charcode 1.1.3
checked_yaml 1.0.2
code_builder 3.2.1
collection 1.14.11 1.14.12
convert 2.1.1
crypto 2.1.4
csslib 0.16.1
dart_style 1.3.3
fixnum 0.10.11
glob 1.2.0
graphs 0.2.0
html 0.14.0+3
http_multi_server 2.2.0
http_parser 3.1.4
io 0.3.3
js 0.6.1+1
logging 0.11.4
matcher 0.12.6
meta 1.1.8
mime 0.9.6+3
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.9.3
package_resolver 1.0.10
path 1.6.4
pedantic 1.9.0
pool 1.4.0
pub_semver 1.4.4
pubspec_parse 0.1.5
quiver 2.1.3
shelf 0.7.5
shelf_web_socket 0.2.3
sky_engine 0.0.99
source_gen 0.9.5
source_span 1.7.0
stack_trace 1.9.3
stream_channel 2.0.0
stream_transform 1.2.0
string_scanner 1.0.5
term_glyph 1.1.0
test_api 0.2.15
timing 0.1.1+2
typed_data 1.1.6
vector_math 2.0.8
watcher 0.9.7+14
web_socket_channel 1.1.0
yaml 2.2.0
Dev dependencies
flutter_test
test ^1.6.0