seerbit_flutter_native 0.0.1+3 copy "seerbit_flutter_native: ^0.0.1+3" to clipboard
seerbit_flutter_native: ^0.0.1+3 copied to clipboard

Seerbit Flutter Package.

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Seerbit Demo',
      home: MyHomePage(title: 'Seerbit Demo'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  SeerbitCheckout seerbitCheckout =
      SeerbitCheckout(publicKey: "SBPUBK_8FPZXG5LG25IFRXHYEYWBLIL8MEG5L7W");

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            TextButton(
              onPressed: () {
                seerbitCheckout.createCheckout(
                  context,
                  showForm: false,
                  isRelease: false,
                  onClose: () => print("Closed"),
                  onSuccess: () => print("Success"),
                  onFailure: () => print("Failure"),
                  payload: PaymentPayloadModel(
                      firstName: "Jane",
                      lastName: "Doe",
                      fullName: "Jane Doe",
                      mobileNumber: "08140273333",
                      email: "abcd@gmail.com",
                      redirectUrl: "https://google.com",
                      sourceIp: "0.0.0.1",
                      productId: "",
                      currency: "NGN",
                      country: "NG",
                      amount: "50"),
                );
              },
              child: const Text("Pay without form"),
            ),
            TextButton(
              onPressed: () {
                seerbitCheckout.createCheckout(
                  context,
                  isRelease: false,
                  showForm: true,
                  onClose: () => print("Closed"),
                  onSuccess: () => print("Success"),
                  onFailure: () => print("Failure"),
                  payload: PaymentPayloadModel(
                      firstName: "Falola",
                      lastName: "Adedayo",
                      fullName: "Falola Adedayo",
                      mobileNumber: "08140276106",
                      email: "onuohasilver9@gmail.com",
                      redirectUrl: "https://google.com",
                      sourceIp: "0.0.0.1",
                      productId: "",
                      currency: "NGN",
                      country: "NG",
                      fee: "1.5",
                      amount: "20"),
                );
              },
              child: const Text("Pay with form"),
            )
          ],
        ),
      ),
    );
  }
}