ton_connect_ui 0.1.0 copy "ton_connect_ui: ^0.1.0" to clipboard
ton_connect_ui: ^0.1.0 copied to clipboard

Flutter UI for TON Connect: a wallet-picker modal backed by the public wallet registry, QR and deep-link connect flows, and ready-made connect widgets.

example/lib/main.dart

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

import 'charge_screen.dart';
import 'terminal_config.dart';

void main() => runApp(const MerchantTerminalApp());

/// A point-of-sale terminal for TON.
///
/// The cashier enters an amount, the customer scans one code, and the wallet
/// approves the connection and the payment together. That single scan is what
/// the `EmbeddedRequest` feature buys — without it the customer approves twice,
/// which at a counter is the difference between a queue moving and a queue
/// waiting.
class MerchantTerminalApp extends StatefulWidget {
  /// Creates the app.
  const MerchantTerminalApp({super.key});

  @override
  State<MerchantTerminalApp> createState() => _MerchantTerminalAppState();
}

class _MerchantTerminalAppState extends State<MerchantTerminalApp> {
  late final TonConnect _ton;

  @override
  void initState() {
    super.initState();
    _ton = TonConnect(
      manifestUrl: terminalManifestUrl,
      // A real terminal must persist sessions somewhere durable, and somewhere
      // private: the session secret key lives here. See the note in
      // TonConnectStorage.
      storage: InMemoryStorage(),
    );
  }

  @override
  void dispose() {
    _ton.close();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Merchant Terminal',
      theme: ThemeData(
        colorSchemeSeed: const Color(0xFF0098EA),
        brightness: Brightness.light,
      ),
      darkTheme: ThemeData(
        colorSchemeSeed: const Color(0xFF0098EA),
        brightness: Brightness.dark,
      ),
      home: ChargeScreen(ton: _ton),
    );
  }
}
1
likes
160
points
270
downloads

Documentation

API reference

Publisher

verified publishertreamz.me

Weekly Downloads

Flutter UI for TON Connect: a wallet-picker modal backed by the public wallet registry, QR and deep-link connect flows, and ready-made connect widgets.

Repository (GitHub)
View/report issues

Topics

#ton #blockchain #wallet #crypto

License

MIT (license)

Dependencies

flutter, qr, ton_connect, url_launcher

More

Packages that depend on ton_connect_ui