bank78_checkout 0.0.3
bank78_checkout: ^0.0.3 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),
),
),
],
),
),
);
}
}