Skip to main content

Flutter SDK

Our Flutter SDK provides a rich set of pre-built UI components and APIs to seamlessly integrate payment functionalities within your Flutter application.

Introduction

The Spotflow Flutter SDK pallows you to integrate smooth and secure payment flows into your Flutter apps. It supports both Android and iOS platforms, making it versatile for mobile app development.

Requirements

Ensure your Flutter environment meets the following:

  • context: Flutter 3.7.0 or later
  • context: Dart 2.19 or later
  • context: Compatible with Android (minSdkVersion 21) and iOS (iOS 11+)
  • context: Internet permission for Android  (AndroidManifest.xml)
Beta Release

The Flutter SDK is currently a beta release. If you encounter any issues, kindly reach out to our support team at support@spotflow.one.

Installation

To use the Spotflow Flutter SDK package, add the following dependencies to your pubspec.yaml file:

dependencies:
spotflow_flutter: ^1.0.0 # or the latest version

Then run flutter pub get to fetch the package.

Parameters Required by the SDK

ParameterTypeDescription
planIdStringThe plan ID (optional).
currencyStringCurrency for the payment (e.g., "NGN").
amountStringAmount to be paid (nullable).
keyStringThe API key for authenticating the transaction.
encryptionKeyStringThis key is used to encrypt the card for secure transactions.
customerEmailStringThe email address of the customer.
customerNameStringThe name of the customer (optional).
customerPhoneNumberStringThe phone number of the customer (optional).
customerIdStringThe unique identifier for the customer (optional).
paymentDescriptionStringDescription of the payment (optional).
appLogoStringApp logo widget (optional).
appNameStringThe name of the app (optional).
debugModeboolEnable or disable debug mode.

Always ensure that your key and encryptionKey are stored securely. Avoid hardcoding them in production apps.

Usage Example

Here is an example of how to make a payment using the Spotflow package:

import 'package:spotflow_flutter/spotflow_flutter.dart';

SpotflowFlutter.startPayment(
context: context,
customerId: "cust_001",
customerEmail: "jane@example.com",
customerName: "Jane Doe",
customerPhoneNumber: "+123456789",
currency: "USD",
amount: 100.0,
key: "your_public_key",
encryptionKey: "your_encryption_key",
paymentDescription: "Payment for services",
planId: "plan_001",
appName: "MyApp",
appLogo: Image.asset('assets/logo.png'), // Or any Widget
debugMode: true,
);

Note

  • context: Android: Ensure INTERNET permission is declared in AndroidManifest.xml
  • context: iOS: No special permissions required beyond basic networking

Testing Your Implementation

Test cards can be found here

Running the Example Project

An example project has been provided on our Github Repository. Clone the repository and navigate to the example folder. Open it with a supported IDE or run flutter run from the terminal in that folder.

Help

Feel free to create issues and pull requests on GitHub if you need any help.