open_apple_pay_payment_setup 1.0.0+1 copy "open_apple_pay_payment_setup: ^1.0.0+1" to clipboard
open_apple_pay_payment_setup: ^1.0.0+1 copied to clipboard

PlatformiOS

A Flutter plugin that opens the Apple Pay payment setup screen on iOS devices. Useful for prompting users to configure Apple Pay before initiating payment flows.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Apple Pay Setup Example',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: const SetupScreen(),
    );
  }
}

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

  Future<void> _openPaymentSetup(BuildContext context) async {
    try {
      await OpenApplePayPaymentSetup().openPaymentSetup();
      if (context.mounted) {
        ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('Payment setup opened')));
      }
    } catch (e) {
      if (context.mounted) {
        ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Failed to open payment setup: $e')));
      }
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Apple Pay Setup')),
      body: Center(
        child: ElevatedButton(onPressed: () => _openPaymentSetup(context), child: const Text('Open Apple Pay Setup')),
      ),
    );
  }
}
1
likes
150
points
0
downloads

Publisher

verified publishernavalia.io

Weekly Downloads

A Flutter plugin that opens the Apple Pay payment setup screen on iOS devices. Useful for prompting users to configure Apple Pay before initiating payment flows.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on open_apple_pay_payment_setup

Packages that implement open_apple_pay_payment_setup