1
1
// ignore_for_file: sized_box_for_whitespace, avoid_unnecessary_containers, file_names
2
2
3
3
import 'package:flutter/material.dart' ;
4
- import '/QR Generator/QRGenerator .dart' ;
5
- import '/QR Scanner/ScanQR .dart' ;
4
+ import '/methods/QR_generator_method .dart' ;
5
+ import '/methods/QR_scanner_method .dart' ;
6
6
7
7
class MyHomePage extends StatefulWidget {
8
+ const MyHomePage ({Key ? key}) : super (key: key);
9
+
8
10
@override
9
11
_MyHomePageState createState () => _MyHomePageState ();
10
12
}
@@ -15,11 +17,10 @@ class _MyHomePageState extends State<MyHomePage> {
15
17
return Scaffold (
16
18
backgroundColor: Colors .white,
17
19
appBar: AppBar (
18
- title: Center (
19
- child: Text (
20
- "QR Scanner/Generator" ,
21
- ),
20
+ title: const Center (
21
+ child: Text ("QR Scanner/Generator" ),
22
22
),
23
+ elevation: 0 ,
23
24
),
24
25
body: Container (
25
26
height: MediaQuery .of (context).size.height,
@@ -34,9 +35,9 @@ class _MyHomePageState extends State<MyHomePage> {
34
35
mainAxisAlignment: MainAxisAlignment .spaceAround,
35
36
crossAxisAlignment: CrossAxisAlignment .center,
36
37
children: [
37
- CircleAvatar (
38
+ const CircleAvatar (
38
39
backgroundImage: AssetImage (
39
- "images/QR.jpg" ,
40
+ "assets/ images/QR.jpg" ,
40
41
),
41
42
foregroundColor: Colors .transparent,
42
43
backgroundColor: Colors .transparent,
@@ -50,63 +51,49 @@ class _MyHomePageState extends State<MyHomePage> {
50
51
child: Container (
51
52
width: ((MediaQuery .of (context).size.width) / 2 ) - 45 ,
52
53
height: 50 ,
53
- child: OutlineButton (
54
- focusColor: Colors .red,
55
- highlightColor: Colors .blue,
56
- hoverColor: Colors .lightBlue[100 ],
57
- splashColor: Colors .blue,
58
- borderSide: BorderSide (
59
- width: 3 ,
60
- color: Colors .blue,
54
+ child: OutlinedButton (
55
+ style: OutlinedButton .styleFrom (
56
+ shape: const StadiumBorder (),
57
+ side:
58
+ const BorderSide (width: 3 , color: Colors .blue),
61
59
),
62
- shape: StadiumBorder (),
63
- child: Text (
60
+ child: const Text (
64
61
"Scan QR" ,
65
- style: TextStyle (
66
- fontSize: 17 ,
67
- ),
62
+ style: TextStyle (fontSize: 17 ),
68
63
),
69
64
onPressed: () {
70
65
Navigator .push (
71
66
context,
72
67
MaterialPageRoute (
73
- builder: (context) => ScanQR (),
68
+ builder: (context) => const ScanQR (),
74
69
),
75
70
);
76
71
},
77
72
),
78
73
),
79
74
),
80
- SizedBox (
81
- width: 25 ,
82
- ),
75
+ const SizedBox (width: 25 ),
83
76
Container (
84
77
child: Hero (
85
78
tag: "Scan QR" ,
86
79
child: Container (
87
80
width: ((MediaQuery .of (context).size.width) / 2 ) - 45 ,
88
81
height: 50 ,
89
- child: OutlineButton (
90
- focusColor: Colors .red,
91
- highlightColor: Colors .blue,
92
- hoverColor: Colors .lightBlue[100 ],
93
- splashColor: Colors .blue,
94
- borderSide: BorderSide (
95
- width: 3 ,
96
- color: Colors .blue,
82
+ child: OutlinedButton (
83
+ style: OutlinedButton .styleFrom (
84
+ shape: const StadiumBorder (),
85
+ side: const BorderSide (
86
+ width: 3 , color: Colors .blue),
97
87
),
98
- shape: StadiumBorder (),
99
- child: Text (
88
+ child: const Text (
100
89
"Generate QR" ,
101
- style: TextStyle (
102
- fontSize: 17 ,
103
- ),
90
+ style: TextStyle (fontSize: 17 ),
104
91
),
105
92
onPressed: () {
106
93
Navigator .push (
107
94
context,
108
95
MaterialPageRoute (
109
- builder: (context) => QRGenerator (),
96
+ builder: (context) => const QRGenerator (),
110
97
),
111
98
);
112
99
},
@@ -115,7 +102,7 @@ class _MyHomePageState extends State<MyHomePage> {
115
102
),
116
103
),
117
104
],
118
- )
105
+ ),
119
106
],
120
107
),
121
108
),
0 commit comments