bank78_checkout 0.0.2 copy "bank78_checkout: ^0.0.2" to clipboard
bank78_checkout: ^0.0.2 copied to clipboard

Bank78 MFB's Flutter package.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Bank78 Checkout Example',
      theme: ThemeData(colorScheme: .fromSeed(seedColor: Colors.black)),
      home: const MyHomePage(title: 'Bank78 Checkout Example'),
    );
  }
}

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

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.black,
        title: Text(widget.title, style: TextStyle(color: Colors.white70)),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: .center,
          spacing: 10,
          children: [
            ElevatedButton(
              style: ButtonStyle(
                backgroundColor: WidgetStateColor.resolveWith(
                  (state) => Colors.greenAccent,
                ),
              ),
              onPressed: () {
                Bank78Checkout.init(
                  Bank78CheckoutConfig(
                    context: context,
                    clientId: '[CLIENT_ID]',
                    clientSecret: '[CLIENT_SECRET]',
                    apiKey: '[API_KEY]',
                    reference: '[REF]',
                    returnUrl: 'https://bank78.co', //optional
                    cancelUrl: 'https://bank78.co', //optional
                    environment: Bank78CheckoutEnv.development,
                  ),
                );
              },
              child: Text(
                'Start Demo Session',
                style: TextStyle(color: Colors.black),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
150
points
161
downloads

Documentation

API reference

Publisher

verified publisherbank78.co

Weekly Downloads

Bank78 MFB's Flutter package.

Homepage

License

MIT (license)

Dependencies

asn1lib, cryptography, dio, equatable, flutter, intl, pointycastle, url_launcher, uuid

More

Packages that depend on bank78_checkout