flutter_periculum
Periculum Insight Plugin (Flutter) This plugin allows Flutter apps to generate Mobile Data Analysis and Affordability Analysis.
Platform Supported
Android
Installation and usage
-
Add the latest version of the plugin to your pubspec.yaml (and run
pub get
) dependencies:flutter_periculum: ^0.0.2
-
Import the plugin and use it in your flutter App.0
import 'package:flutter_periculum/flutter_periculum.dart';
Required Permission
The following permission (LOCATION, SMS and WIFI) are required to be requested in the AndroidManifest.xml from the Android device before calling method of the package.
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.LOCAL_MAC_ADDRESS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET"/>
Generate Mobile Analysis for Version 1 of the SDK
Parameter | Type | Description |
---|---|---|
publicKey | String | required |
phoneNumber | String | required |
bvn | String | required |
Returns a list of key
var flutterPericulum =
await FlutterPericulum.generateMobileAnalysis(
publicKey: 'publicKey',
bvn: '1234567890123',
phoneNumber: '090********',
);
Generate Mobile Insight for Version 2 of the SDK
Returns a Json String contain //{ "mobileInsightsOverviewKey": 6}
Parameter | Type | Description |
---|---|---|
publicKey | String | required |
phoneNumber | String | required |
bvn | String | required |
var flutterPericulum =
await FlutterPericulum.generateMobileInsightV2(
publicKey: 'publicKey',
bvn: '1234567890123',
phoneNumber: '090********',
);
Update an existing Mobile Analysis for Version 2 of the SDK
Returns a Json Object carrying ```OverviewKey``mobileInsightsOverviewKey
Parameter | Type | Description |
---|---|---|
publicKey | String | required |
phoneNumber | String | optional |
bvn | String | optional |
var flutterPericulum =
await FlutterPericulum.patchMobileAnalysisV2(
publicKey: 'publickKey',
overviewkey: 'overviewKey',
bvn: '12345678908765',
phoneNumber: '090********');
ElevatedButton(
onPressed: () async {
try {
var flutterPericulum =
await FlutterPericulum.generateMobileInsightV2(
publicKey: 'nucleusis123',
bvn: '344983985053053',
phoneNumber: '09098983930',
setState(() {
responseOutput = flutterPericulum;
});
} on Exception catch (e) {
throw e.toString();
}
},
child: const Text('Mobile Analysis V2'),
),
...
Compatibility
Minimum Android SDK: Periculum requires a minimum API level of 21.
Info
For this plugin to work, you must have a Periculum account and you'll also need to use your merchant Id and secret key to generate a token from the Periculum API.
Getting Started
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.