-
Notifications
You must be signed in to change notification settings - Fork 21
/
main.dart
156 lines (151 loc) · 5.02 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import 'package:flutter/material.dart';
import 'package:razorpay_flutter_customui_example/payment_slection_page.dart';
import 'package:razorpay_flutter_customui_example/sdk_initilize_dialog.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.blue.shade300,
body: Container(
child: Stack(
alignment: Alignment.center,
children: [
Positioned(
top: MediaQuery.of(context).size.height * 0.3,
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.9,
child: Container(
height: 80.0,
color: Colors.grey.shade300,
child: Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: EdgeInsets.all(4.0),
child: Text(
'Order #RZP',
),
),
),
),
),
),
Positioned(
top: (MediaQuery.of(context).size.height * 0.3) + 80.0,
child: Container(
width: MediaQuery.of(context).size.width * 0.9,
color: Colors.white,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
children: [
Text(
'Razorpay T-Shirt',
style: TextStyle(
fontSize: 18.0,
color: Colors.grey,
),
),
SizedBox(height: 6.0),
Text(
'INR 1.00',
style: TextStyle(
fontSize: 12.0,
color: Colors.grey,
),
),
SizedBox(height: 6.0),
Text(
'This is a real transaction',
style: TextStyle(
fontStyle: FontStyle.italic,
fontSize: 12.0,
color: Colors.grey,
),
),
SizedBox(height: 16.0),
ElevatedButton(
onPressed: () {
showDialog(
context: context,
builder: (BuildContext context) {
return SDKInitilizeDialog();
},
);
},
child: Text('Purchase'),
style: ElevatedButton.styleFrom(
primary: Colors.green,
),
)
],
),
),
),
),
Positioned(
top: (MediaQuery.of(context).size.height * 0.3) - 30.0,
child: Container(
height: 60.0,
width: 60.0,
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Container(
decoration: BoxDecoration(
color: Colors.black,
image: DecorationImage(
image: Image.asset('images/rzp.png').image,
),
),
),
),
),
),
Positioned(
top: MediaQuery.of(context).size.height * 0.8,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.0),
border: Border.all(color: Colors.white, width: 1.0)),
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Secure Payments by Razorpay',
style: TextStyle(
fontStyle: FontStyle.italic,
color: Colors.white,
fontSize: 10.0,
),
),
),
),
)
],
),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}