api_payment 0.0.1 copy "api_payment: ^0.0.1" to clipboard
api_payment: ^0.0.1 copied to clipboard

unlisted

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(),
                ],
              ),
            );
          }),
        ),
      ),
    );
  }
}
3
likes
0
points
167
downloads

Publisher

unverified uploader

Weekly Downloads

Easy payment api for online systems. It's available for any platform.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

clipboard, flutter, flutter_web_plugins, http, intl, pinput, plugin_platform_interface, web

More

Packages that depend on api_payment