pay_with_stripe 0.0.4
pay_with_stripe: ^0.0.4 copied to clipboard
Pay with Stripe is a Flutter package that streamlines Stripe payments, allowing you to complete transactions securely with a single line of code.
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:pay_with_stripe/pay_with_stripe.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true),
home: Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text("Pay With Strip"),
),
floatingActionButton: FloatingActionButton(
onPressed: () async {
final result = await PayWithStripe.makePayment(
paymentModel: PaymentModel(
publishableKey: '', // get publish key from strip dashboard
secretKey: '', // get secretKey key from strip dashboard
amount: 100)); // $100
log("result: $result");
},
child: const Icon(Icons.add),
),
),
);
}
}