in_app_payment 0.0.2 copy "in_app_payment: ^0.0.2" to clipboard
in_app_payment: ^0.0.2 copied to clipboard

In app payment package for the stage 6 task of the HNGx Internship. This package would enable flutter developers make payments through google pay and apple pay in their application.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  ///initializing payment package
  final pay = HNGPay();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text("Payment test"),
      ),
      body: Center(
        child: SizedBox(
          child: pay.googlePay(context, amountToPay: "24", userID: '23'),

          /// accepting the amount and user id
        ),
      ),
    );
  }
}
5
likes
130
points
32
downloads

Publisher

unverified uploader

Weekly Downloads

In app payment package for the stage 6 task of the HNGx Internship. This package would enable flutter developers make payments through google pay and apple pay in their application.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http, pay

More

Packages that depend on in_app_payment