The Official MyCover.ai SDK
A Flutter plugin for buying insurance, supports both iOS and Android platforms .
Features
Get your insurance and make payment
Getting started
- Add package mca_flutter_sdk to your pubspec.yaml file
- Run flutter pub get
- Add required permission for the image pickers
Usage
Initialise the sdk in two ways
- Input the client ID and also the specific product ID to initialise the SDK, This is to initiate a fresh transaction
such as initialiseSdk(context, productId:'18kjbsj939923',userId:'[email protected]'});
This will initialise the SDK and fetch the selected product with the product ID and continue your purchase.
- Input the client ID to fetch all products
such as initialiseSdk(context,userId:'[email protected]'});
This will initialise the SDK and fetch all products available and you can select a desired product and continue your purchase.
- Input the Client ID, productID and the typeOfTransaction and reference, This can be done when a transaction has already been initiated, payment is made and you have the reference number from the payment done.
such as initialiseSdk(context, productId:'18kjbsj939923',userId:'[email protected]',typeOfTransaction: PurchaseStage.purchase,reference:'BUY-BWBJMPABGFWKB});
import 'package:mca_flutter_sdk/mca_flutter_sdk.dart';
PurchaseStage typeOfTransaction = PurchaseStage.purchase;String reference = 'BUY-BWBJMPABGFWKB';
initialiseSDK({String? userId, String? productId }) async {
final myCover = MyCoverAI(context: context, userId: userId, productId: productId,typeOfTransaction: typeOfTransaction,reference: reference);
var response = await myCover.initialise();
if (response != null) {
showLoading('$response');
}
else {
print("No Response!");
}
}
Additional information
Add the required permission for image picker on Android and iOS android manifest and info.plist respectively The app depends on image picker