Skip to content

๐Ÿ™Œ๐Ÿพ This package makes it easy to use the Mono connect widget in a flutter project

License

Notifications You must be signed in to change notification settings

Zfinix/flutter_mono

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

22 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Flutter Mono

** This is an unofficial SDK for flutter

This package makes it easy to use the Mono connect widget in a flutter project.

๐Ÿ“ธ Screen Shots

Getting Started

  • Register on the Mono website and get your public and secret keys.
  • Setup a server to exchange tokens to access user financial data with your Mono secret key.

iOS

  • Add the key Privacy - Camera Usage Description and a usage description to your Info.plist.

If editing Info.plist as text, add:

<key>NSCameraUsageDescription</key>
<string>your usage description here</string>

Android

State the camera permission in your android/app/src/main/AndroidManifest.xml file.

<uses-permission android:name="android.permission.CAMERA"/>

๐Ÿš€ How to Use plugin

  • Launch MonoFlutter with launchMono method
import 'package:flutter_mono/flutter_mono.dart';

 void launch() async {
    FlutterMono(
      apiKey: 'Your Public Key', // from https://app.withmono.com/apps
      reference: "some_random_string",
      showLogs: true,
      customer: const MonoCustomer(
        newCustomer: MonoNewCustomerModel(
          name: "Samuel Olamide", // REQUIRED
          email: "[email protected]", // REQUIRED
          identity: MonoNewCustomerIdentity(
            type: "bvn",
            number: "2323233239",
          ),
        ),
        existingCustomer: MonoExistingCustomerModel(
          id: "1234-RTFG-ABCD", // REQUIRED
        ),
      ),
      selectedInstitution: ConnectInstitution(
        id: "5f2d08be60b92e2888287702",
        authMethod: ConnectAuthMethod.mobileBanking,
      ),
      configJson: const {
        "selectedInstitution": {
          "id": "5f2d08be60b92e2888287702",
          "auth_method": "mobile_banking"
        }
      },
      onClose: (it) =>log('Success: $it'),
      onLoad: () => log('widget_loaded'),
      onEvent: (eventName, eventData) {
        switch (eventName) {
          case 'mono.connect.institution_selected':
            /// do something
            break;
        }
      },
    ).launchMono(context);
 }
  • Use MonoView widget
import 'package:flutter_mono/flutter_mono.dart';

   ...

   FlutterMono(
      apiKey: 'Your Public Key', // from https://app.withmono.com/apps
      reference: "some_random_string",
      showLogs: true,
      customer: const MonoCustomer(
        newCustomer: MonoNewCustomerModel(
          name: "Samuel Olamide", // REQUIRED
          email: "[email protected]", // REQUIRED
          identity: MonoNewCustomerIdentity(
            type: "bvn",
            number: "2323233239",
          ),
        ),
        existingCustomer: MonoExistingCustomerModel(
          id: "1234-RTFG-ABCD", // REQUIRED
        ),
      ),
      selectedInstitution: ConnectInstitution(
        id: "5f2d08be60b92e2888287702",
        authMethod: ConnectAuthMethod.mobileBanking,
      ),
      onClose: (it) =>log('Success: $it'),
      onLoad: () => log('widget_loaded'),
      onEvent: (eventName, eventData) {
        switch (eventName) {
          case 'mono.connect.institution_selected':
            /// do something
            break;
        }
      },
    )

   ...

โœจ Contribution

Lots of PR's would be needed to improve this plugin. So lots of suggestions and PRs are welcome.

About

๐Ÿ™Œ๐Ÿพ This package makes it easy to use the Mono connect widget in a flutter project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published