mca_official_flutter_sdk 0.7.1 copy "mca_official_flutter_sdk: ^0.7.1" to clipboard
mca_official_flutter_sdk: ^0.7.1 copied to clipboard

The Official MyCover.ai SDK is a comprehensive Flutter plugin designed to streamline the process of buying insurance. Supporting both iOS and Android platforms, this SDK offers seamless integration wi [...]

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 #

  1. Add package mca_official_flutter_sdk to your pubspec.yaml file
  2. Run flutter pub get
  3. Add required permission for the image pickers and camera
  4. Add required permission for the geolocation

Usage #

Some parameters are required whilst initialising the SDK, others are optional:

  • publicKey: (required) The public key from your distributor's dashboard. This is always required to initialize a purchase.

  • onComplete: (required) The callback function that is called after the SDK implementation is complete.

  • paymentOption: (optional) Required if using a wallet for payment. You must provide the payment reference number. Not required if the payment option defaults to the gateway.

  • debitWalletReference: (optional) Required for uncompleted purchases from the gateway or wallet initialization. Not needed for new/fresh purchases with the default (gateway) payment method.

  • transactionType: (optional) Indicates the intended action when using the SDK. The default is purchase.

  • productId: (optional) An array/list of product IDs. If only one product ID is provided, a purchase for that single product is initialized. If more than one or empty, all products are initialized, and you can select a product to purchase.

  • form: (optional) Basic information you would like to pass into the initialization.

Initialization #

  1. Initialize the SDK without any extra properties
import 'package:mca_official_flutter_sdk/mca_official_flutter_sdk.dart';

return Scaffold(
      body: MyCoverAI(
        context: context,
        publicKey: "MCAPUBK_TEST|49303c8b-4fb4-4d8b-a4d3-c2f6f6d0fb62",
      ),
    )
  1. Naviagate directly to the SDK
import 'package:mca_official_flutter_sdk/mca_official_flutter_sdk.dart';

Navigator.of(context).push(MaterialPageRoute(
    builder: (context) => MyCoverAI(
        context: context,
        walletReference: data,
        paymentOption:
        selectedPaymentOption,
    )));
  1. Initialize the SDK with all extra properties
import 'package:mca_official_flutter_sdk/mca_official_flutter_sdk.dart';

void onComplete(SdkResponse response) {
    PolicyModel purchasedPolicy = response.policyModel;
    Navigator.of(response.context).pushReplacement(MaterialPageRoute(
        builder: (context) => const PostSdkScreen(),
    ));
}

void onClose(dynamic result) {
    Navigator.of(result['context']).pushReplacement(MaterialPageRoute(
        builder: (context) => const PreSdkScreen(),
    ));
}

MyCoverAI(
    publicKey: "MCAPUBK_TEST|49303c8b-4fb4-4d8b-a4d3-c2f6f6d0fb62",
    form: const {
        'email': "fuhad@mycovergenius.com",
        'first_name': 'Fuhad',
        'last_name': 'Aminu',
        'phone': '08123232332',
    },
    onComplete: onComplete,
    onClose: onClose,
    context: context,
    transactionType: TransactionType.purchase,
    isContactFieldsEditable: false,
    paymentOption: widget.paymentOption,
    debitWalletReference: widget.walletReference,
    productId: const [
     "fab6bda1-b870-4648-8704-11c1802a51d0",
     "c1d0f39c-0b8a-452f-a876-78bef8dde1d9",
     "b83d5f4d-e868-4782-bb35-df6e3344ae7d",
    ],
),

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

1
likes
0
pub points
58%
popularity

Publisher

verified publishermycover.ai

The Official MyCover.ai SDK is a comprehensive Flutter plugin designed to streamline the process of buying insurance. Supporting both iOS and Android platforms, this SDK offers seamless integration with your Flutter applications, providing flexible payment options, secure transaction handling, and a user-friendly interface. Whether you are purchasing insurance or making payments, the MyCover.ai SDK simplifies these tasks, ensuring a smooth and efficient user experience.

Homepage

License

unknown (license)

Dependencies

cached_network_image, connectivity_plus, dartz, device_info_plus, dio, dotted_border, file_picker, flutter, flutter_dotenv, flutter_form_builder, flutter_screenutil, flutter_secure_storage, flutter_spinkit, flutter_svg, flutter_widget_from_html_core, fluttertoast, get_it, google_fonts, hooks_riverpod, image_picker, internet_connection_checker, intl, lottie, mockito, permission_handler, pin_code_fields, pretty_dio_logger, pusher_channels_flutter, shared_preferences, shimmer, webview_flutter

More

Packages that depend on mca_official_flutter_sdk