payengine 0.0.1 payengine: ^0.0.1 copied to clipboard
PayEngine SDK.
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:payengine/payengine.dart';
import 'screens/bank_account_screen.dart';
import 'screens/credit_card_screen.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
late TabController _controller;
final PayEngineConfig config = const PayEngineConfig(
publicKey: "pk_test_yHpGIwKZ0Pi031bayG6rSWXDwi4MLggP",
scriptURL: "https://staging-sandbox.payengine.dev/js/1.0.0/embed.js");
Map<dynamic, dynamic> result = {};
@override
void initState() {
super.initState();
_controller = TabController(length: 2, vsync: this);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: const Text('Secure Fields example'),
bottom: TabBar(
controller: _controller,
tabs: const [Tab(text: 'Credit Card'), Tab(text: 'Bank Account')],
),
),
body: TabBarView(
controller: _controller,
children: [
CreditCardScreen(config: config),
BankAccountScreen(config: config)
],
),
),
);
}
}