khqr_widget 1.0.5 copy "khqr_widget: ^1.0.5" to clipboard
khqr_widget: ^1.0.5 copied to clipboard

Khqr_widget help you crate a standard KHQR preview in your app without any efforts.

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'KHQR Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(title: const Text("KhqrWidget sample")),
        body: Builder(builder: (context) {
          return ListView(
            children: [
              ListTile(
                title: const Text("KhqrWidget"),
                tileColor: Colors.grey.shade200,
                onTap: () {
                  Navigator.of(context).push(MaterialPageRoute(
                    builder: (context) => const KhqrWidgetDemo(),
                  ));
                },
              ),
              ListTile(
                title: const Text("KhqrStandWidget"),
                tileColor: Colors.grey.shade200,
                onTap: () {
                  Navigator.of(context).push(MaterialPageRoute(
                    builder: (context) => const KhqrStandWidgetDemo(),
                  ));
                },
              ),
            ],
          );
        }),
      ),
    );
  }
}

class KhqrWidgetDemo extends StatelessWidget {
  const KhqrWidgetDemo({super.key});

  @override
  Widget build(BuildContext context) {
    return const Scaffold(
      body: Center(
        child: KhqrWidget(
          receiverName: "receiverName",
          amount: "12.23",
          currency: "USD",
          qr: "YOUR_QR_DATA",
        ),
      ),
    );
  }
}

class KhqrStandWidgetDemo extends StatelessWidget {
  const KhqrStandWidgetDemo({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: KhqrStandWidget(
          logo: Image.asset("assets/cambify.png"),
          qrData: "YOUR_QR_DATA",
          name: "John Due",
          bakongId: "yourbakong@id",
          qrIcon: Image.asset("assets/dolar_symbol.png"),
        ),
      ),
    );
  }
}
12
likes
0
pub points
69%
popularity

Publisher

verified publishersophoun.com

Khqr_widget help you crate a standard KHQR preview in your app without any efforts.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_svg, google_fonts, qr_flutter

More

Packages that depend on khqr_widget