api_payment 0.0.1
api_payment: ^0.0.1 copied to clipboard
Easy payment api for online systems. It's available for any platform.
example/lib/main.dart
import 'package:api_payment/utils/enums/display_types.dart';
import 'package:flutter/material.dart';
import 'package:api_payment/yt_ypay.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
YtYpay ypay = YtYpay(
clientId: "projectn7oowh0ajrikqh7gkizlenemupscgrhzpabkmc14xehd",
title: "Tlo app",
amount: 500.0,
backendUrl: "http://192.168.1.68:8000/api/");
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
localizationsDelegates: const [
DefaultMaterialLocalizations.delegate,
DefaultWidgetsLocalizations.delegate,
],
home: Scaffold(
body: Padding(
padding: const EdgeInsets.only(top: 39.0),
child: Builder(builder: (context) {
return SingleChildScrollView(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
ElevatedButton(
onPressed: () {
ypay.payment(
displayType: DisplayTypes.MODAL,
context: context) ??
Container();
},
child: const Text("Open dialog"),
),
],
),
ypay.payment() ?? Container(),
],
),
);
}),
),
),
);
}
}