vnpay_client 0.0.3 copy "vnpay_client: ^0.0.3" to clipboard
vnpay_client: ^0.0.3 copied to clipboard

A Package support show VNPAY screen

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:vnpay_client/vnpay_client.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  final paymentUrl = 'example';

  void _onPaymentSuccess(data) {}

  void _onPaymentFailure(error) {}

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: OutlinedButton(
            onPressed: () {
              showVNPayScreen(
                context,
                paymentUrl: paymentUrl,
                onPaymentSuccess: _onPaymentSuccess,
                onPaymentError: _onPaymentFailure,
              );
            },
            child: const Text('Click me'),
          ),
        ),
      ),
    );
  }
}
0
likes
130
pub points
51%
popularity

Publisher

unverified uploader

A Package support show VNPAY screen

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, webview_flutter

More

Packages that depend on vnpay_client