-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.dart
80 lines (75 loc) · 2.42 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import 'package:flutter/material.dart';
import 'package:upi_payment_qrcode_generator/upi_payment_qrcode_generator.dart';
void main() {
runApp(const MyApp());
}
/// Creates The UPI Payment QRCode
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
//TODO Change UPI ID
final upiDetails = UPIDetails(
upiID: "9167877725@axl",
payeeName: "Agnel Selvan",
amount: 1,
transactionNote: "Hello World");
final upiDetailsWithoutAmount = UPIDetails(
upiID: "9167877725@axl",
payeeName: "Agnel Selvan",
transactionNote: "Hello World",
);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('UPI Payment QRCode Generator'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text("UPI Payment QRCode without Amount",
style: TextStyle(fontWeight: FontWeight.bold)),
UPIPaymentQRCode(
upiDetails: upiDetailsWithoutAmount,
size: 220,
embeddedImagePath: 'assets/images/logo.png',
embeddedImageSize: const Size(60, 60),
eyeStyle: const QrEyeStyle(
eyeShape: QrEyeShape.circle,
color: Colors.black,
),
dataModuleStyle: const QrDataModuleStyle(
dataModuleShape: QrDataModuleShape.circle,
color: Colors.black,
),
),
Text(
"Scan QR to Pay",
style: TextStyle(color: Colors.grey[600], letterSpacing: 1.2),
),
const SizedBox(
height: 20,
),
const Text("UPI Payment QRCode with Amount",
style: TextStyle(fontWeight: FontWeight.bold)),
UPIPaymentQRCode(
upiDetails: upiDetails,
size: 220,
upiQRErrorCorrectLevel: UPIQRErrorCorrectLevel.low,
),
Text(
"Scan QR to Pay",
style: TextStyle(color: Colors.grey[600], letterSpacing: 1.2),
),
],
),
),
),
);
}
}