@@ -4,8 +4,15 @@ void main() {
4
4
5
5
runApp (
6
6
MaterialApp (
7
+ debugShowCheckedModeBanner: false ,
7
8
title: 'Simple Interest Calculator App' ,
8
9
home: SIForm (),
10
+ theme: ThemeData (
11
+ brightness: Brightness .dark,
12
+ primaryColor: Colors .indigo,
13
+ accentColor: Colors .indigoAccent
14
+ ),
15
+
9
16
)
10
17
);
11
18
}
@@ -27,6 +34,8 @@ class _SIFormState extends State<SIForm> {
27
34
@override
28
35
Widget build (BuildContext context) {
29
36
37
+ TextStyle textStyle = Theme .of (context).textTheme.title;
38
+
30
39
return Scaffold (
31
40
// resizeToAvoidBottomPadding: false,
32
41
appBar: AppBar (
@@ -44,9 +53,11 @@ class _SIFormState extends State<SIForm> {
44
53
padding: EdgeInsets .only (top: _minimumPadding, bottom: _minimumPadding),
45
54
child: TextField (
46
55
keyboardType: TextInputType .number,
56
+ style: textStyle,
47
57
decoration: InputDecoration (
48
58
labelText: 'Principal' ,
49
59
hintText: 'Enter Principal e.g. 12000' ,
60
+ labelStyle: textStyle,
50
61
border: OutlineInputBorder (
51
62
borderRadius: BorderRadius .circular (5.0 )
52
63
)
@@ -57,9 +68,11 @@ class _SIFormState extends State<SIForm> {
57
68
padding: EdgeInsets .only (top: _minimumPadding, bottom: _minimumPadding),
58
69
child: TextField (
59
70
keyboardType: TextInputType .number,
71
+ style: textStyle,
60
72
decoration: InputDecoration (
61
73
labelText: 'Rate of Interest' ,
62
74
hintText: 'In percent' ,
75
+ labelStyle: textStyle,
63
76
border: OutlineInputBorder (
64
77
borderRadius: BorderRadius .circular (5.0 )
65
78
)
@@ -73,9 +86,11 @@ class _SIFormState extends State<SIForm> {
73
86
74
87
Expanded (child: TextField (
75
88
keyboardType: TextInputType .number,
89
+ style: textStyle,
76
90
decoration: InputDecoration (
77
91
labelText: 'Term' ,
78
92
hintText: 'Time in years' ,
93
+ labelStyle: textStyle,
79
94
border: OutlineInputBorder (
80
95
borderRadius: BorderRadius .circular (5.0 )
81
96
)
@@ -109,7 +124,9 @@ class _SIFormState extends State<SIForm> {
109
124
child: Row (children: < Widget > [
110
125
Expanded (
111
126
child: RaisedButton (
112
- child: Text ('Calculate' ),
127
+ color: Theme .of (context).accentColor,
128
+ textColor: Theme .of (context).primaryColorDark,
129
+ child: Text ('Calculate' , textScaleFactor: 1.5 ,),
113
130
onPressed: () {
114
131
115
132
},
@@ -118,7 +135,9 @@ class _SIFormState extends State<SIForm> {
118
135
119
136
Expanded (
120
137
child: RaisedButton (
121
- child: Text ('Reset' ),
138
+ color: Theme .of (context).primaryColorDark,
139
+ textColor: Theme .of (context).primaryColorLight,
140
+ child: Text ('Reset' , textScaleFactor: 1.5 ,),
122
141
onPressed: () {
123
142
124
143
},
@@ -129,7 +148,7 @@ class _SIFormState extends State<SIForm> {
129
148
130
149
Padding (
131
150
padding: EdgeInsets .all (_minimumPadding * 2 ),
132
- child: Text ('Todo Text' ),
151
+ child: Text ('Todo Text' , style : textStyle, ),
133
152
)
134
153
135
154
],
0 commit comments