konnect_wallet_services 0.0.10 copy "konnect_wallet_services: ^0.0.10" to clipboard
konnect_wallet_services: ^0.0.10 copied to clipboard

Platformweb

Flutter web plugin to help intergrate wallet with super app

example/lib/main.dart

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

void main() {
  WalletPlaformManager().init();
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
   
    return MaterialApp(
      title: 'Flutter Web App',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage>
    with WithPlatformMessageRecieved {

  @override
  void initState() {
    WalletPlaformManager.registerForService(this);
    WalletPlaformManager.requestService(WalletPlatformService(
                params: {'latest': 30},
                walletService: WalletService.GET_PRINCIPAL));
    // TODO: implement initState
    super.initState();
  }

  var title = "Loggin in as ";

  @override
  void onPlatformResults(WalletPlatformService message) {
    // TODO: implement onPlatformResults
    super.onPlatformResults(message);
    setState(() {
      title = "Loggin in as ${message.params["firstName"]}";
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(children: [
        Text("Welcome To Super App"),
        
        Text("${title}")]),
    );
  }
}
1
likes
130
points
22
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter web plugin to help intergrate wallet with super app

Homepage

Documentation

API reference

License

unknown (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface

More

Packages that depend on konnect_wallet_services