Fl Droid connection

Platform Support

Android
âœ”ī¸

🔨 Installation

dependencies:
  fl_droid_connection: ^0.0.2

⚙ Import

import 'package:fl_droid_connection/fl_droid_connection.dart';

đŸ•šī¸ Usage/Example

Functions

  import 'package:fl_droid_connection/fl_droid_connection.dart';

  // Get information of platform version,
  getPlatformVersion();

  // ping
  ping();

  // lastTransaction
  lastTransaction();

  // settlement
  settlement();

  // passMpm
  passMpm(String request);

  // passCpm
  passCpm(String request);

  // sale & passMPM
  sale(String request);

  // voidOperation
  voidOperation(String request);

Examples

  import 'package:fl_droid_connection/fl_droid_connection.dart';

  // Ping Pong
  Future<void> ping() async {
    String pingResult;
    // Platform messages may fail, so we use a try/catch PlatformException.
    // We also handle the message potentially returning null.
    try {
      pingResult =
          await _flDroidConnectionPlugin.ping() ?? 'Unkown ping result';
    } on PlatformException {
      pingResult = 'Failed to ping.';
    }

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    debugPrint(pingResult);
    setState(() {
      _dynamicResult = pingResult;
    });
  }

  // Get information of platform version,
  Future<void> passCpm() async {
    String passCpmResult;
    // Platform messages may fail, so we use a try/catch PlatformException.
    // We also handle the message potentially returning null.
    try {
      passCpmResult = await _flDroidConnectionPlugin.passCpm(
              FlDroidConnectionRequest(
                      amount: _amountPassCpmController.text,
                      paymentToken: _paymentTokenController.text)
                  .toRawJson()) ??
          'Unkown passCpm result';
    } on PlatformException {
      passCpmResult = 'Failed to passCpm.';
    }

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    debugPrint(passCpmResult);
    setState(() {
      _dynamicResult = passCpmResult;
    });
  }

📃 License

/*
#################################################################################
#                                                                               #
#                     COPYRIGHT (C) DATABANK LLC since 2017                     #
#                                                                               #
#          ALL RIGHTS RESERVED BY DATABANK LLC.  THIS PROGRAM MUST BE           #
#          USED SOLELY FOR THE PURPOSES OF DATABANK LLC AND ITS USERS.          #
#   NO PART OF THIS PROGRAM MAY BE MODIFIED IN SOURCE OR BINARY FORM BY OTHERS  #
#             WITHOUT THE PRIOR WRITTEN PERMISSION OF DATABANK LLC.             #
#                                                                               #
#     USE OF COPYRIGHT NOTICE DOES NOT EVIDENCE PUBLICATION OF THE PROGRAM.     #
#                                                                               #
#################################################################################
*/