payment_dialog 1.0.5  payment_dialog: ^1.0.5 copied to clipboard
payment_dialog: ^1.0.5 copied to clipboard
A customizable Flutter payment dialog with WebView for handling online payments.
Payment Dialog.
A simple Flutter package for displaying customizable payment dialogs in your app.
   
   
   
   
Features #
- Show a payment confirmation dialog.
- Customize title, message, and buttons.
Quickstart #
Add dependency to your pubspec file #
Add this to your pubspec.yaml:
dependencies:
  payment_dialog: ^1.0.0
Add PaymentDialog to your app #
import 'package:flutter/material.dart';
import 'package:payment_dialog/payment_dialog.dart';
void main() {
  runApp(const MyApp());
}
class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: ElevatedButton(
            onPressed: () async {
              final success = await showPaymentDialog(
                context: context,
                paymentUrl: 'https://yourpaymentgateway.com/start',
                succeededUrl: 'https://your-payment-website.com/success',
                failedUrl: 'https://your-payment-website.com/failed',
                cancelledUrl: 'https://your-payment-website.com/cancelled',
              );
              debugPrint(success ? "Payment Success" : "Payment Failed/Cancelled");
            },
            child: const Text("Pay Now"),
          ),
        ),
      ),
    );
  }
}
