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

A flutter plugin to connect phantom wallet from Mobile Application.

example/main.dart

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

void main() => runApp(MyApp());

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

  // Initialize the PhantomConnect object
  final PhantomConnect phantomConnect = PhantomConnect(
    appUrl: "https://solana.com",
    deepLink: "dapp://exampledeeplink.io",
  );

  void connect() {
    Uri connectUrl = phantomConnect.generateConnectUri(
        cluster: 'devnet', redirect: '/onConnect');
    // Open the url using (url_launcher)[https://pub.dev/packages/url_launcher]]
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: SafeArea(
        child: Scaffold(
          body: Center(
            child: ElevatedButton(
              onPressed: () => connect(),
              child: const Text("Connect"),
            ),
          ),
        ),
      ),
    );
  }
}
4
likes
130
points
4
downloads

Publisher

unverified uploader

Weekly Downloads

A flutter plugin to connect phantom wallet from Mobile Application.

Homepage

Documentation

API reference

License

unknown (license)

Dependencies

flutter, pinenacl, solana

More

Packages that depend on phantom_wallet