Skip to content
This repository was archived by the owner on Jan 5, 2021. It is now read-only.

Commit f37cb77

Browse files
author
Luis Correa
committed
clean design
1 parent 44ce950 commit f37cb77

File tree

8 files changed

+241
-112
lines changed

8 files changed

+241
-112
lines changed

lib/components/connected_form.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ class _ConnectedFormState extends State<ConnectedForm> {
133133
return Padding(
134134
padding: EdgeInsets.all(10.0),
135135
child: MaterialButton(
136+
elevation: 0.5,
136137
color: Colors.blue,
137138
minWidth: MediaQuery.of(context).size.width,
138139
child: Text(
@@ -181,6 +182,7 @@ class _ConnectedFormState extends State<ConnectedForm> {
181182
return Padding(
182183
padding: EdgeInsets.only(left: 10.0, right: 10.0, top: 10.0),
183184
child: MaterialButton(
185+
elevation: 0.5,
184186
color: Colors.blue,
185187
minWidth: MediaQuery.of(context).size.width,
186188
child: Text(
@@ -206,5 +208,4 @@ class _ConnectedFormState extends State<ConnectedForm> {
206208
}
207209
return Text("");
208210
}
209-
210211
}

lib/components/login_form.dart

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ class _LoginFormState extends State<LoginForm> {
5252
child: TextFormField(
5353
autovalidate: true,
5454
decoration: InputDecoration(
55-
labelText: 'Usuario',
56-
prefixIcon: Icon(
57-
Icons.alternate_email,
58-
size: 28,
59-
)),
55+
labelText: 'Usuario',
56+
prefixIcon: Icon(
57+
Icons.alternate_email,
58+
size: 28,
59+
),
60+
),
6061
validator: (value) {
6162
if (value.isEmpty) {
6263
return 'Este campo no debe estar vacío';
@@ -97,6 +98,7 @@ class _LoginFormState extends State<LoginForm> {
9798
Padding(
9899
padding: EdgeInsets.all(10.0),
99100
child: MaterialButton(
101+
elevation: 0.5,
100102
color: Colors.blue,
101103
minWidth: MediaQuery.of(context).size.width,
102104
child: Text(
@@ -114,6 +116,7 @@ class _LoginFormState extends State<LoginForm> {
114116
Padding(
115117
padding: EdgeInsets.all(2.0),
116118
child: MaterialButton(
119+
elevation: 0.5,
117120
color: Colors.lightBlue,
118121
child: Text(
119122
'Consultar crédito',
@@ -125,6 +128,7 @@ class _LoginFormState extends State<LoginForm> {
125128
Padding(
126129
padding: EdgeInsets.all(2.0),
127130
child: MaterialButton(
131+
elevation: 0.5,
128132
color: Colors.lightBlue,
129133
child: Text(
130134
'Portal Nauta',
@@ -246,7 +250,10 @@ class PortalNauta extends StatelessWidget {
246250
Widget build(BuildContext context) {
247251
return Scaffold(
248252
appBar: AppBar(
249-
title: Text('Portal Nauta'),
253+
title: Text(
254+
'Portal Nauta',
255+
style: TextStyle(fontWeight: FontWeight.bold),
256+
),
250257
elevation: 0,
251258
),
252259
body: WebView(

lib/components/ussd_widget.dart

Lines changed: 114 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,26 @@ class _UssdRootState extends State<UssdRootWidget> {
3535
Widget build(BuildContext context) {
3636
if (items != null)
3737
return ListView.builder(
38-
itemCount: items.length + 1,
39-
itemBuilder: (context, index) {
40-
if (index == 0)
41-
return Container(
42-
height: 100,
43-
color: Colors.blue,
44-
child: Center(
45-
child:
46-
Icon(Icons.developer_mode, size: 64, color: Colors.white),
47-
),
48-
);
38+
itemCount: items.length,
39+
itemBuilder: (context, index) {
40+
var item = items[index];
4941

50-
var item = items[index - 1];
51-
52-
if (item.type == 'code')
53-
return UssdWidget(
42+
if (item.type == 'code')
43+
return Padding(
44+
padding: EdgeInsets.only(left: 14.0, right: 14.0),
45+
child: UssdWidget(
5446
ussdCode: item,
55-
);
56-
else
57-
return UssdCategoryWidget(
47+
),
48+
);
49+
else
50+
return Padding(
51+
padding: EdgeInsets.only(left: 14.0, right: 14.0),
52+
child: UssdCategoryWidget(
5853
category: item,
59-
);
60-
});
54+
),
55+
);
56+
},
57+
);
6158

6259
return Center(
6360
child: CircularProgressIndicator(),
@@ -87,7 +84,9 @@ class UssdCategoryWidget extends StatelessWidget {
8784
child: Column(children: <Widget>[
8885
ListTile(
8986
leading: Icon(category.icon, color: Colors.blue),
90-
title: Text(category.name.toUpperCase()),
87+
title: Text(
88+
category.name.toUpperCase(),
89+
),
9190
),
9291
Divider(
9392
color: Colors.blue,
@@ -108,32 +107,59 @@ class UssdWidgets extends StatelessWidget {
108107
Widget build(BuildContext context) {
109108
return Scaffold(
110109
appBar: AppBar(
111-
elevation: 0,
112-
title: Text(title),
110+
centerTitle: true,
111+
title: Text(
112+
title,
113+
style: TextStyle(
114+
fontWeight: FontWeight.bold,
115+
),
116+
),
117+
leading: IconButton(
118+
icon: Icon(Icons.arrow_back_ios),
119+
onPressed: () {
120+
Navigator.of(context).pop();
121+
},
122+
),
113123
),
114-
body: Container(
115-
height: MediaQuery.of(context).size.height,
116-
child: ListView.builder(
117-
itemCount: ussdItems.length + 1,
118-
itemBuilder: (context, index) {
119-
if (index == 0)
120-
return Container(
121-
height: 100,
122-
color: Colors.blue,
123-
child: Icon(icon, size: 64, color: Colors.white),
124-
);
125-
126-
var item = ussdItems[index - 1];
127-
128-
if (item.type == 'code')
129-
return UssdWidget(
130-
ussdCode: item,
131-
);
132-
else
133-
return UssdCategoryWidget(
134-
category: item,
135-
);
136-
}),
124+
body: ListView(
125+
children: <Widget>[
126+
Container(
127+
height: 100,
128+
color: Colors.blue,
129+
child: Icon(icon, size: 64, color: Colors.white),
130+
),
131+
Container(
132+
decoration: BoxDecoration(
133+
color: Colors.white,
134+
borderRadius: BorderRadius.only(
135+
topLeft: Radius.circular(45.0),
136+
bottomRight: Radius.circular(45.0),
137+
),
138+
),
139+
height: MediaQuery.of(context).size.height - 180,
140+
child: ListView.builder(
141+
itemCount: ussdItems.length,
142+
itemBuilder: (context, index) {
143+
var item = ussdItems[index];
144+
145+
if (item.type == 'code')
146+
return Padding(
147+
padding: EdgeInsets.only(left: 14.0, right: 14.0),
148+
child: UssdWidget(
149+
ussdCode: item,
150+
),
151+
);
152+
else
153+
return Padding(
154+
padding: EdgeInsets.only(left: 14.0, right: 14.0),
155+
child: UssdCategoryWidget(
156+
category: item,
157+
),
158+
);
159+
},
160+
),
161+
),
162+
],
137163
),
138164
);
139165
}
@@ -174,7 +200,9 @@ class SimpleCode extends StatelessWidget {
174200
child: Column(children: <Widget>[
175201
ListTile(
176202
leading: Icon(icon, color: Colors.blue),
177-
title: Text(name.toUpperCase()),
203+
title: Text(
204+
name.toUpperCase(),
205+
),
178206
),
179207
Divider(
180208
color: Colors.blue,
@@ -224,23 +252,46 @@ class CodeFormPage extends StatelessWidget {
224252
Widget build(BuildContext context) {
225253
return Scaffold(
226254
appBar: AppBar(
227-
elevation: 0,
228-
title: Text(code.name.toUpperCase()),
255+
centerTitle: true,
256+
title: Text(
257+
code.name.toUpperCase(),
258+
style: TextStyle(
259+
fontWeight: FontWeight.bold,
260+
),
261+
),
262+
leading: IconButton(
263+
onPressed: () {
264+
Navigator.of(context).pop();
265+
},
266+
icon: Icon(Icons.arrow_back_ios),
267+
),
229268
),
230-
body: Container(
231-
alignment: Alignment.center,
232-
child: Center(
233-
child: Padding(
269+
body: ListView(
270+
children: <Widget>[
271+
Container(
272+
height: MediaQuery.of(context).size.height - 80,
273+
decoration: BoxDecoration(
274+
color: Colors.white,
275+
borderRadius: BorderRadius.only(
276+
topLeft: Radius.circular(45.0),
277+
bottomRight: Radius.circular(45.0),
278+
),
279+
),
280+
child: Center(
281+
child: Padding(
234282
padding: EdgeInsets.all(10.0),
235-
child: Card(
236-
child: Padding(
237-
padding: EdgeInsets.all(20.0),
238-
child: CodeForm(
239-
code: code.code,
240-
fields: code.fields,
241-
type: code.type,
242-
)),
243-
))),
283+
child: Padding(
284+
padding: EdgeInsets.all(20.0),
285+
child: CodeForm(
286+
code: code.code,
287+
fields: code.fields,
288+
type: code.type,
289+
),
290+
),
291+
),
292+
),
293+
)
294+
],
244295
),
245296
);
246297
}
@@ -283,6 +334,7 @@ class _CodeFormState extends State<CodeForm> {
283334
return Padding(
284335
padding: EdgeInsets.all(10.0),
285336
child: MaterialButton(
337+
elevation: 0.5,
286338
color: Colors.blue,
287339
minWidth: MediaQuery.of(context).size.width,
288340
child: Text(

lib/main.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ class App extends StatelessWidget {
1313
debugShowCheckedModeBanner: false,
1414
title: 'TODO',
1515
theme: ThemeData(
16-
primarySwatch: Colors.blue,
17-
visualDensity: VisualDensity.adaptivePlatformDensity,
16+
fontFamily: 'Montserrat',
17+
appBarTheme: AppBarTheme(
18+
color: Colors.transparent,
19+
elevation: 0.0,
20+
),
21+
scaffoldBackgroundColor: Colors.blue,
1822
),
1923
home: HomePage(title: 'TODO'),
2024
);

0 commit comments

Comments
 (0)