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

Commit 6ec424f

Browse files
author
Luis Correa
committed
v1.1.0
1 parent 1c1f941 commit 6ec424f

File tree

12 files changed

+177
-50
lines changed

12 files changed

+177
-50
lines changed

config/ussd_codes.json

Lines changed: 84 additions & 11 deletions
Large diffs are not rendered by default.

lib/components/disclaim.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class DisclaimerWidget extends StatelessWidget {
4141
child: MaterialButton(
4242
onPressed: () {
4343
SharedPreferences.getInstance().then((prefs) {
44-
prefs.setBool('dok1', true);
44+
prefs.setBool('dok1.1', true);
4545
Navigator.of(context).pushAndRemoveUntil(
4646
MaterialPageRoute(
4747
builder: (context) => HomePage(
@@ -87,10 +87,14 @@ UNA VEZ MÁS. HACEMOS ÉNFASIS EN QUE LOS USUARIOS DEBEN DESCARGAR LA APLICACIÓ
8787
8888
FUENTES OFICIALES:
8989
90-
1. Releases generados automáticamente a partir del código oficial alojado en Github:
90+
1. Releases generados automáticamente a partir del código oficial en Github:
9191
9292
https://github.com/todo-devs/todo/releases
9393
94-
Fecha de actualización: 22 de junio del 2020
94+
2. Tienda cubana de aplicaciones Apklis
95+
96+
https://www.apklis.cu/application/com.cubanopensource.todo
97+
98+
Fecha de actualización: 23 de junio del 2020
9599
""";
96100
}

lib/components/login_form.dart

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class _LoginFormState extends State<LoginForm> {
9292
padding: EdgeInsets.all(10.0),
9393
child: MaterialButton(
9494
elevation: 0.5,
95-
color: Colors.blue,
95+
color: Theme.of(context).focusColor,
9696
minWidth: MediaQuery.of(context).size.width,
9797
child: Text(
9898
'Conectar',
@@ -111,7 +111,7 @@ class _LoginFormState extends State<LoginForm> {
111111
padding: EdgeInsets.all(2.0),
112112
child: MaterialButton(
113113
elevation: 0.5,
114-
color: Colors.lightBlue,
114+
color: Theme.of(context).focusColor,
115115
child: Text(
116116
'Crédito',
117117
style: TextStyle(color: Colors.white),
@@ -125,7 +125,7 @@ class _LoginFormState extends State<LoginForm> {
125125
padding: EdgeInsets.all(2.0),
126126
child: MaterialButton(
127127
elevation: 0.5,
128-
color: Colors.lightBlue,
128+
color: Theme.of(context).focusColor,
129129
child: Text(
130130
'Portal Nauta',
131131
style: TextStyle(color: Colors.white),
@@ -180,7 +180,11 @@ class _LoginFormState extends State<LoginForm> {
180180
backgroundColor: Colors.red,
181181
content: Text(
182182
e.message,
183-
style: TextStyle(fontWeight: FontWeight.w800, fontSize: 18),
183+
style: TextStyle(
184+
fontWeight: FontWeight.w800,
185+
fontSize: 18,
186+
color: Colors.white,
187+
),
184188
),
185189
),
186190
);
@@ -213,7 +217,7 @@ class _LoginFormState extends State<LoginForm> {
213217

214218
Scaffold.of(context).showSnackBar(SnackBar(
215219
duration: Duration(seconds: 10),
216-
backgroundColor: Colors.blueAccent,
220+
backgroundColor: Theme.of(context).focusColor,
217221
content: Text(
218222
'Crédito: $userCredit',
219223
style: TextStyle(fontWeight: FontWeight.w800, fontSize: 20),

lib/components/settings.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import 'package:provider/provider.dart';
33
import 'package:shared_preferences/shared_preferences.dart';
44
import 'package:todo/pages/download_ussd_page.dart';
55
import 'package:todo/services/AppStateNotifier.dart';
6-
import 'package:todo/themes/colors.dart';
76
import 'package:todo/components/disclaim.dart';
87

98
class SettingsWidget extends StatefulWidget {
@@ -41,7 +40,7 @@ class _SettingsState extends State<SettingsWidget> {
4140
mainAxisAlignment: MainAxisAlignment.center,
4241
children: <Widget>[
4342
Text(
44-
'Versión 1.0.0 | 22-06-2020',
43+
'Versión 1.1.0 | 23-06-2020',
4544
style: TextStyle(
4645
color: Colors.white,
4746
fontWeight: FontWeight.bold,
@@ -63,7 +62,7 @@ class _SettingsState extends State<SettingsWidget> {
6362
),
6463
),
6564
Switch(
66-
activeColor: GFColors.SUCCESS,
65+
activeColor: Theme.of(context).focusColor,
6766
value: darkMode,
6867
onChanged: (value) {
6968
setState(() {
@@ -89,7 +88,7 @@ class _SettingsState extends State<SettingsWidget> {
8988
children: <Widget>[
9089
Expanded(
9190
child: Text(
92-
'Descargar códigos USSD',
91+
'Actualizar códigos USSD',
9392
style: TextStyle(
9493
color: Colors.white,
9594
fontWeight: FontWeight.bold,
@@ -100,7 +99,10 @@ class _SettingsState extends State<SettingsWidget> {
10099
margin: EdgeInsets.symmetric(horizontal: 15),
101100
child: Icon(
102101
Icons.file_download,
103-
color: GFColors.SUCCESS,
102+
color: Theme.of(context).scaffoldBackgroundColor ==
103+
Theme.of(context).focusColor
104+
? Colors.white
105+
: Theme.of(context).focusColor,
104106
),
105107
),
106108
],

lib/components/ussd_widget.dart

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'package:shared_preferences/shared_preferences.dart';
99
import 'package:todo/services/contacts.dart';
1010
import 'package:todo/services/phone.dart';
1111
import 'package:todo/models/ussd_codes.dart';
12+
import 'package:getflutter/getflutter.dart';
1213

1314
class UssdRootWidget extends StatefulWidget {
1415
_UssdRootState createState() => _UssdRootState();
@@ -136,8 +137,15 @@ class UssdCategoryWidget extends StatelessWidget {
136137
);
137138
},
138139
child: Column(children: <Widget>[
139-
ListTile(
140-
leading: Icon(category.icon, color: Theme.of(context).focusColor),
140+
GFListTile(
141+
margin: EdgeInsets.all(3),
142+
avatar: Icon(category.icon, color: Theme.of(context).focusColor),
143+
description: Text(
144+
category.description,
145+
style: TextStyle(
146+
color: Theme.of(context).focusColor,
147+
),
148+
),
141149
title: Text(
142150
category.name.toUpperCase(),
143151
),
@@ -239,6 +247,7 @@ class UssdWidget extends StatelessWidget {
239247
code: ussdCode.code,
240248
name: ussdCode.name,
241249
icon: ussdCode.icon,
250+
description: ussdCode.description,
242251
);
243252
}
244253

@@ -249,9 +258,10 @@ class UssdWidget extends StatelessWidget {
249258
class SimpleCode extends StatelessWidget {
250259
final String code;
251260
final String name;
261+
final String description;
252262
final IconData icon;
253263

254-
SimpleCode({this.code, this.name, this.icon});
264+
SimpleCode({this.code, this.name, this.icon, this.description});
255265

256266
@override
257267
Widget build(BuildContext context) {
@@ -260,8 +270,15 @@ class SimpleCode extends StatelessWidget {
260270
callTo(code);
261271
},
262272
child: Column(children: <Widget>[
263-
ListTile(
264-
leading: Icon(icon, color: Theme.of(context).focusColor),
273+
GFListTile(
274+
margin: EdgeInsets.all(3),
275+
avatar: Icon(icon, color: Theme.of(context).focusColor),
276+
description: Text(
277+
description,
278+
style: TextStyle(
279+
color: Theme.of(context).focusColor,
280+
),
281+
),
265282
title: Text(
266283
name.toUpperCase(),
267284
),
@@ -293,8 +310,15 @@ class CodeWithForm extends StatelessWidget {
293310
);
294311
},
295312
child: Column(children: <Widget>[
296-
ListTile(
297-
leading: Icon(code.icon, color: Theme.of(context).focusColor),
313+
GFListTile(
314+
margin: EdgeInsets.all(3),
315+
avatar: Icon(code.icon, color: Theme.of(context).focusColor),
316+
description: Text(
317+
code.description,
318+
style: TextStyle(
319+
color: Theme.of(context).focusColor,
320+
),
321+
),
298322
title: Text(code.name.toUpperCase()),
299323
),
300324
Divider(

lib/models/ussd_codes.dart

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ abstract class UssdItem {
1818
String name;
1919
IconData icon;
2020
String type;
21+
String description;
2122

22-
UssdItem({this.name, this.icon, this.type});
23+
UssdItem({this.name, this.icon, this.type, this.description});
2324

2425
factory UssdItem.fromJson(Map<String, dynamic> parsedJson) {
2526
final type = parsedJson['type'];
@@ -35,8 +36,9 @@ abstract class UssdItem {
3536
class UssdCategory extends UssdItem {
3637
List<UssdItem> items;
3738

38-
UssdCategory({name, icon, this.items})
39-
: super(name: name, icon: icon, type: 'category');
39+
UssdCategory({name, icon, description, this.items})
40+
: super(
41+
name: name, icon: icon, type: 'category', description: description);
4042

4143
factory UssdCategory.fromJson(Map<String, dynamic> parsedJson) {
4244
var list = parsedJson['items'] as List;
@@ -49,7 +51,12 @@ class UssdCategory extends UssdItem {
4951
icon = Icons.code;
5052
}
5153

52-
return UssdCategory(name: parsedJson['name'], icon: icon, items: itemList);
54+
return UssdCategory(
55+
name: parsedJson['name'],
56+
icon: icon,
57+
description: parsedJson['description'],
58+
items: itemList,
59+
);
5360
}
5461
}
5562

@@ -58,8 +65,8 @@ class UssdCode extends UssdItem {
5865

5966
List<UssdCodeField> fields;
6067

61-
UssdCode({name, icon, this.code, this.fields})
62-
: super(name: name, icon: icon, type: 'code');
68+
UssdCode({name, icon, description, this.code, this.fields})
69+
: super(name: name, icon: icon, type: 'code', description: description);
6370

6471
factory UssdCode.fromJson(Map<String, dynamic> parsedJson) {
6572
var list = parsedJson['fields'] as List;
@@ -78,6 +85,7 @@ class UssdCode extends UssdItem {
7885
name: parsedJson['name'],
7986
icon: icon,
8087
code: parsedJson['code'],
88+
description: parsedJson['description'],
8189
fields: fieldsList,
8290
);
8391
}

lib/pages/download_ussd_page.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@ class _DownloadUssdPageState extends State<DownloadUssdPage> {
5757
} else {
5858
throw Exception(
5959
'Request failed: ${resp.request.url}\n'
60-
'StatusCode: ${resp.statusCode}\n'
61-
'Body: ${resp.body}',
60+
'StatusCode: ${resp.statusCode}\n'
61+
'Body: ${resp.body}',
6262
);
6363
}
6464
}
6565
prefs.setInt('day', actualDay);
6666
} else {
6767
throw Exception(
6868
'Request failed: ${resp.request.url}\n'
69-
'StatusCode: ${resp.statusCode}\n'
70-
'Body: ${resp.body}',
69+
'StatusCode: ${resp.statusCode}\n'
70+
'Body: ${resp.body}',
7171
);
7272
}
7373
Navigator.pushReplacement(
@@ -80,8 +80,7 @@ class _DownloadUssdPageState extends State<DownloadUssdPage> {
8080
loading = false;
8181
message = 'Ha ocurrido un error en la descarga de los códigos USSD.\n\n'
8282
'Revise su conexión e intentelo nuevamente.\n\n'
83-
'Si el error continúa póngase en contacto con el soporte para '
84-
'clientes.';
83+
'Si el error continúa póngase en contacto con el equipo de desarrollo.';
8584
buttonText = 'CERRAR';
8685
});
8786
}
@@ -113,6 +112,7 @@ class _DownloadUssdPageState extends State<DownloadUssdPage> {
113112
textAlign: TextAlign.center,
114113
style: TextStyle(
115114
fontWeight: FontWeight.bold,
115+
color: Colors.white,
116116
),
117117
),
118118
),

lib/pages/home_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class _HomePageState extends State<HomePage> {
2323
@override
2424
Widget build(BuildContext context) {
2525
SharedPreferences.getInstance().then((prefs) {
26-
final dok = prefs.getBool('dok1');
26+
final dok = prefs.getBool('dok1.1');
2727

2828
if (dok == null || !dok)
2929
Navigator.of(context).push(

lib/pages/login_page.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,11 @@ class _LoginPageState extends State<LoginPage> {
162162
backgroundColor: Colors.red,
163163
content: Text(
164164
e.message,
165-
style: TextStyle(fontWeight: FontWeight.w800, fontSize: 18),
165+
style: TextStyle(
166+
fontWeight: FontWeight.w800,
167+
fontSize: 18,
168+
color: Colors.white,
169+
),
166170
),
167171
),
168172
);

lib/themes/dark_theme.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:flutter/material.dart';
2-
import 'package:todo/themes/colors.dart';
2+
33

44
final themeDark = ThemeData(
55
brightness: Brightness.dark,
@@ -8,7 +8,7 @@ final themeDark = ThemeData(
88
color: Colors.transparent,
99
elevation: 0.0,
1010
),
11-
scaffoldBackgroundColor: Color.fromRGBO(39, 50, 80, 1),
12-
dialogBackgroundColor: Color.fromRGBO(55, 65, 104, 1),
13-
focusColor: GFColors.SUCCESS
11+
scaffoldBackgroundColor: Color(0xff24272c),
12+
dialogBackgroundColor: Color(0xff121212),
13+
focusColor: Color(0xff10DC60)
1414
);

0 commit comments

Comments
 (0)