foundrex_flutter_mobile_sdk 0.0.4 copy "foundrex_flutter_mobile_sdk: ^0.0.4" to clipboard
foundrex_flutter_mobile_sdk: ^0.0.4 copied to clipboard

Foundrex Payments and KYC Flutter SDK.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:foundrex_flutter_mobile_sdk/foundrex_flutter_mobile_sdk.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await Foundrex.initializeStripe(
    publishableKey: 'pk_test_XXXX',
  );

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              ElevatedButton(
                onPressed: () async {
                  await Foundrex.payments.presentPaymentSheet(
                    clientSecret: 'pi_secret_XXXX',
                  );
                },
                child: const Text('Pay'),
              ),
              ElevatedButton(
                onPressed: () async {
                  await Foundrex.kyc.start();
                },
                child: const Text('Start KYC'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}