mobile_pos 1.0.1 mobile_pos: ^1.0.1 copied to clipboard
A Flutter plugin for Raven Bank's Mobile POS (BankBox) device.
Raven Bank Mobile POS (BankBox) Flutter Plugin #
A Flutter Plugin that enables you connect to Raven Bank’s Bank Box
Prerequisites #
Credentials #
First you need to obtain your app credentials from Raven Bank
Android Setup #
Set minSdkVersion target #
This library targets android devices >= SDK 21. Make sure you're targeting at-least the same by modifying your android/app/build.gradle
file
minSdkVersion = 21
IOS Setup #
Update Info.plist
to add necessary permissions #
<key>NSBluetoothAlwaysUsageDescription</key>
<string>allow app use bluetooth</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>allow app use bluetooth</string>
<key>NSCameraUsageDescription</key>
<string>Can I use the camera please?</string>
Note #
- Debugging IOS would now require physical devices after depending on this plugin as build may fail on simulator.
Usage #
Import #
import 'package:mobile_pos/mobile_pos_sdk.dart';
Launch SDK #
await RavenBankBoxPlugin.launch(
context,
config: BankBoxConfig(
logo: Container(
height: 32,
width: 32,
decoration: const BoxDecoration(
shape: BoxShape.circle, color: Color(0xffEA872D)),
child: Padding(
padding: const EdgeInsets.all(12),
child: Image.asset('assets/logo.png'),
),
),
onClose: () {
//user taps close button
Navigator.pop(context);
},
showTerminals: true,
enableBalanceCheck: false,
enableSuccessSound: true,
showLabel: true,
theme: const MobilePOSTheme(
darkModeFG: Color(0xff141414),
lightModeFG: Colors.white,
bankBoxThemeMode: BankBoxThemeMode.dark,
headerTextColor: Color(0xFF755AE2),
primaryColor: Color(0xFF755AE2),
onPrimary: Colors.white,
secondaryColor: Color(0xFFEA872D)),
enviroment: BankBoxEnvironment.staging,
appInfo: AppInfo(
category: Category.partner,
appName: '<YOUR APP NAME>',
appId: '<YOUR APP ID>',
appEmail: 'YOUR APP EMAIL'),
customerInfo: CustomerInfo(
lastName: '<USER LAST NAME>',
firstName: '<USER FIRST NAME>',
bvn: '<USER BVN>',
email: '<USER EMAIL>',
phone: '<USER PHONE>',
),
onSuccess: (data) {
//TODO: handle success cases
},
onError: (error) {
//TODO: handle error cases
},
),
);