phantom_connect 0.0.8 copy "phantom_connect: ^0.0.8" to clipboard
phantom_connect: ^0.0.8 copied to clipboard

A flutter plugin to connect phantom wallet from Mobile Application.

example/main.dart

import 'package:flutter/material.dart';
import 'package:phantom_connect/phantom_connect.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"),
            ),
          ),
        ),
      ),
    );
  }
}
8
likes
150
points
36
downloads

Publisher

verified publisherstrawhat.xyz

Weekly Downloads

A flutter plugin to connect phantom wallet from Mobile Application.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, pinenacl, solana

More

Packages that depend on phantom_connect