solana_mobile_client 0.0.1 copy "solana_mobile_client: ^0.0.1" to clipboard
solana_mobile_client: ^0.0.1 copied to clipboard

outdated

A reference implementation of the Mobile Wallet Adapter (Client) specification for Flutter.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:solana_mobile_client_example/client.dart';

void main() {
  runApp(
    BlocProvider(
      create: (_) => ClientBloc(),
      child: const MyApp(),
    ),
  );
}

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

  @override
  Widget build(BuildContext context) => MaterialApp(
        home: Scaffold(
          appBar: AppBar(
            title: const Text('Plugin example app'),
          ),
          body: BlocListener<ClientBloc, ClientState>(
            listener: (context, state) {
              // ignore: avoid_print, only for example
              print(state.capabilities);
            },
            listenWhen: (previous, current) =>
                previous.capabilities != current.capabilities,
            child: Column(
              children: [
                ElevatedButton(
                  onPressed: () {
                    context.read<ClientBloc>().requestCapabilities();
                  },
                  child: const Text('Get capabilities'),
                )
              ],
            ),
          ),
        ),
      );
}
2
likes
0
pub points
67%
popularity

Publisher

verified publishercryptoplease.com

A reference implementation of the Mobile Wallet Adapter (Client) specification for Flutter.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, freezed_annotation, json_annotation, plugin_platform_interface

More

Packages that depend on solana_mobile_client