apolopay_sdk 1.1.0 copy "apolopay_sdk: ^1.1.0" to clipboard
apolopay_sdk: ^1.1.0 copied to clipboard

Apolo Pay SDK for Flutter.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData.dark(),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Apolo Pay SDK Example'),
        ),
        body: Center(
          child: ApoloPayButton(
            client: ApoloPayClient(publicKey: 'publicKey'),
            processId: 'processId',
            onSuccess: (context, response) {
              print('Pago exitoso: ${response.message}');
            },
            onExpired: (context, error) {
              print('Pago expirado: ${error.message}');
            },
            onError: (context, error) {
              print('Error en pago: ${error.message}');
            },
          ),
        ),
      ),
    );
  }
}