Finswich Public APIs
  • INTEGRATING via CHECKOUT
    • Getting Started/Overview
    • Integrating the Checkout on your App (Frontend)
      • Integrating Finswich checkout via NPM or Yarn
      • Integrating the Finswich Checkout on your Vanilla Javascript app
      • Steps for integrating Finswich Checkout via Flutter
      • Pseudocode for Integrating Finswich Checkout in Application (Native iOS & Android)
    • Authentication
    • User Onboarding
    • Error Handling
    • Integrating the Services (Backend)
      • Interwallet Transfer
      • Bank Transfer
      • Funding
      • Utility Purchases
Powered by GitBook
On this page
  1. INTEGRATING via CHECKOUT
  2. Integrating the Checkout on your App (Frontend)

Steps for integrating Finswich Checkout via Flutter

PreviousIntegrating the Finswich Checkout on your Vanilla Javascript appNextPseudocode for Integrating Finswich Checkout in Application (Native iOS & Android)

Last updated 4 months ago

  • Visit the link to the

  • On the flutter package website they click the installing tab

  • Please follow the instructions on the page.

  • After installing and adding the finswich package to your code, here is a sample dart code to complete your set up

import 'package:finswich_checkout/finswich_checkout.dart';
import 'package:flutter/widgets.dart';

class MyWidget extends StatefulWidget {
  const MyWidget({super.key});

  @override
  State<MyWidget> createState() => _MyWidgetState();
}

class _MyWidgetState extends State<MyWidget> {
  bool isCheckoutVisible = false;
//to pop out the checkout set isCheckoutVisible to true
  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Container(),//the container should be replaced by your code

        /// Your widget should go here in place of container (your application)
        ischeckoutvisible
            ? FinswichIframe(
                balance: "your_user_balance",
                isCheckoutVisible: isCheckoutVisible,
                origin: "your_apps_origin",

                ///To get your origin use this [window.location.origin],
                publicKey:
                    "your_finswich_live_public_key",
                reference: "your_user_reference",
                refreshUI: () {
                  setState(() {});
                },
              )
            : const SizedBox(),
      ],
    );
  }
}

The table below helps to explain the objects passed to the inline JS during initialiazation

Key
Description
Type

reference

This is your user's reference on your platform

String

public_key

Your live public key from Finswich app

String

balance

the user's balance on your app

Number

origin

your whitelisted IP saved on the Finswich platform

String

flutter package