Skip to main content

prophetx_sdk 0.5.0 copy "prophetx_sdk: ^0.5.0" to clipboard
prophetx_sdk: ^0.5.0 copied to clipboard

ProphetX Flutter SDK — embed deposit, withdraw, KYC and onboarding flows in Flutter apps.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return ProphetXProvider(
      environment: EnvironmentName.staging,
      token: const String.fromEnvironment('PROPHETX_TOKEN'),
      theme: const EmbedTheme(primaryColor: '#6366f1'),
      locale: 'en',
      child: MaterialApp(
        title: 'ProphetX SDK Example',
        theme: ThemeData.dark(useMaterial3: true),
        home: const HomeScreen(),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    final px = ProphetX.of(context);

    return Scaffold(
      appBar: AppBar(title: const Text('ProphetX SDK Example')),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
              onPressed: () => px.deposit.open(OpenDepositOptions(
                onSuccess: (id, amt) => debugPrint('deposit success $id ($amt)'),
                onCancel: () => debugPrint('deposit cancelled'),
                onError: (code, msg) => debugPrint('deposit error $code: $msg'),
              )),
              child: const Text('Open Deposit'),
            ),
            const SizedBox(height: 12),
            ElevatedButton(
              onPressed: () => px.withdraw.open(OpenWithdrawOptions(
                onSuccess: (id, amt) => debugPrint('withdraw success $id ($amt)'),
                onCancel: () => debugPrint('withdraw cancelled'),
              )),
              child: const Text('Open Withdraw'),
            ),
            const SizedBox(height: 24),
            const PoweredByProphetX(),
          ],
        ),
      ),
    );
  }
}
0
likes
130
points
583
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

ProphetX Flutter SDK — embed deposit, withdraw, KYC and onboarding flows in Flutter apps.

Homepage

License

unknown (license)

Dependencies

flutter, flutter_secure_storage, flutter_svg, http, url_launcher, uuid, webview_flutter

More

Packages that depend on prophetx_sdk