vatom_wallet_sdk 0.0.22 copy "vatom_wallet_sdk: ^0.0.22" to clipboard
vatom_wallet_sdk: ^0.0.22 copied to clipboard

Vatom Wallet SDK for flutter.

example/vatom_wallet_sdk_example.dart

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

main() {
  WidgetsFlutterBinding.ensureInitialized();

  final VatomWallet wallet = VatomWallet(
    accessToken: "...accessToken",
    refreshToken: "...refreshToken",
    initialRoute: "map",
    config: VatomConfigFeatures(
      hideTokenActions: true,
      disableArPickup: true,
      disableNewTokenToast: true,
      hideDrawer: false,
      hideNavigation: false,
      language: "en",
      scanner: ScannerFeatures(enabled: false),
      pageConfig: PageConfig(
        features: PageFeatures(
          icon: PageFeaturesIcon(badges: false, editions: false, titles: false),
          footer: PageFeaturesFooter(enabled: true, icons: [
            PageFeaturesFooterIcon(id: "map", src: "", title: "Map"),
          ]),
        ),
      ),
    ),
  );

  runApp(
    MaterialApp(
      home: Scaffold(
        body: SafeArea(
          child: Column(
            children: [
              Expanded(
                child: wallet,
              ),
              Row(
                children: [
                  ElevatedButton(
                    onPressed: () async {
                      // await wallet.openCommunity('sahMOa1qQR',
                      //     roomId: '!EcINyJyITqdmqVEAVe%3Avatom.com');
                      var tabs = await wallet.getCurrentUser();
                      print(tabs?.toJson());
                    },
                    child: Text('getCurrentUser'),
                  ),
                  ElevatedButton(
                    onPressed: () async {
                      await wallet.navigateToTab("Connect");
                    },
                    child: Text('Connect'),
                  ),
                  ElevatedButton(
                    onPressed: () async {
                      await wallet.navigateToTab("Home");
                    },
                    child: Text('Home'),
                  ),
                ],
              ),
            ],
          ),
        ),
      ),
    ),
  );
}