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

Commit a42c265

Browse files
author
Luis Correa
committed
1.2.2+8
1 parent c19a3da commit a42c265

File tree

6 files changed

+12
-77
lines changed

6 files changed

+12
-77
lines changed

lib/components/connected_form.dart

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ class _ConnectedFormState extends State<ConnectedForm> {
4242
.checkConnectivity()
4343
.then((value) => updateNetworkState(value));
4444

45-
suscription = Connectivity().onConnectivityChanged.listen(updateNetworkState);
45+
suscription =
46+
Connectivity().onConnectivityChanged.listen(updateNetworkState);
4647

4748
setState(() {
4849
nautaClient = NautaClient(
@@ -132,16 +133,6 @@ class _ConnectedFormState extends State<ConnectedForm> {
132133
return Container(
133134
child: Column(
134135
children: <Widget>[
135-
Padding(
136-
padding: EdgeInsets.all(4.0),
137-
child: Text(
138-
'Conectado',
139-
style: TextStyle(
140-
color: Theme.of(context).focusColor,
141-
fontSize: 20,
142-
),
143-
),
144-
),
145136
Padding(
146137
padding: EdgeInsets.all(20),
147138
child: Center(
@@ -182,7 +173,7 @@ class _ConnectedFormState extends State<ConnectedForm> {
182173
color: Theme.of(context).focusColor,
183174
minWidth: MediaQuery.of(context).size.width,
184175
child: Text(
185-
'Salir',
176+
'Cerrar sesión',
186177
style: TextStyle(color: Colors.white),
187178
),
188179
onPressed: () async {
@@ -191,9 +182,13 @@ class _ConnectedFormState extends State<ConnectedForm> {
191182

192183
try {
193184
SharedPreferences prefs = await SharedPreferences.getInstance();
194-
await prefs.remove('nauta_username');
185+
186+
// Que primero haga logout
195187
await nautaClient.logout();
196188

189+
// Y luego borre la sessión
190+
await prefs.remove('nauta_username');
191+
197192
_timer.cancel();
198193
await pr.hide();
199194

lib/pages/connected_page.dart

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'package:flutter/material.dart';
22
import 'package:todo/components/connected_form.dart';
3-
import 'package:connectivity/connectivity.dart';
43

54
class ConnectedPage extends StatefulWidget {
65
ConnectedPage({Key key, this.title = 'Conectado', this.username})
@@ -14,39 +13,6 @@ class ConnectedPage extends StatefulWidget {
1413
}
1514

1615
class _ConnectedPageState extends State<ConnectedPage> {
17-
String wifiSSID = '';
18-
String wifiIP = '';
19-
20-
var suscription;
21-
22-
@override
23-
void initState() {
24-
super.initState();
25-
26-
Connectivity()
27-
.checkConnectivity()
28-
.then((value) => updateNetworkState(value));
29-
30-
suscription =
31-
Connectivity().onConnectivityChanged.listen(updateNetworkState);
32-
}
33-
34-
updateNetworkState(ConnectivityResult result) async {
35-
final wifiName = await (Connectivity().getWifiName());
36-
final ip = await (Connectivity().getWifiIP());
37-
38-
setState(() {
39-
wifiSSID = wifiName;
40-
wifiIP = ip;
41-
});
42-
}
43-
44-
@override
45-
void dispose() {
46-
suscription.cancel();
47-
super.dispose();
48-
}
49-
5016
@override
5117
Widget build(BuildContext context) {
5218
return Scaffold(
@@ -60,15 +26,6 @@ class _ConnectedPageState extends State<ConnectedPage> {
6026
widget.title,
6127
style: TextStyle(fontWeight: FontWeight.bold),
6228
),
63-
background: Container(
64-
color: Theme.of(context).scaffoldBackgroundColor,
65-
child: Center(
66-
child: Text(
67-
'SSID: $wifiSSID IP: $wifiIP',
68-
style: TextStyle(color: Colors.white),
69-
),
70-
),
71-
),
7229
),
7330
elevation: 0,
7431
leading: IconButton(

lib/pages/download_ussd_page.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ class _DownloadUssdPageState extends State<DownloadUssdPage> {
7171
'Body: ${resp.body}',
7272
);
7373
}
74-
Navigator.pushReplacement(
74+
Navigator.pushAndRemoveUntil(
7575
context,
7676
MaterialPageRoute(builder: (context) => HomePage(title: 'TODO')),
77+
(Route<dynamic> route) => false,
7778
);
7879
} catch (e) {
7980
log(e.toString());

lib/pages/login_page.dart

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ class _LoginPageState extends State<LoginPage> {
2525
String wlanIp;
2626
String ip;
2727

28-
String wifiSSID = '';
29-
String wifiIP = '';
30-
3128
IconData networkIcon;
3229

3330
final _scaffoldKey = GlobalKey<ScaffoldState>();
@@ -80,13 +77,8 @@ class _LoginPageState extends State<LoginPage> {
8077
networkIcon = Icons.network_cell;
8178
});
8279
} else if (result == ConnectivityResult.wifi) {
83-
final wifiName = await (Connectivity().getWifiName());
84-
final ip = await (Connectivity().getWifiIP());
8580
setState(() {
8681
networkIcon = Icons.wifi_lock;
87-
88-
wifiSSID = wifiName;
89-
wifiIP = ip;
9082
});
9183
} else {
9284
setState(() {
@@ -164,16 +156,6 @@ class _LoginPageState extends State<LoginPage> {
164156
SliverList(
165157
delegate: SliverChildListDelegate(
166158
[
167-
Container(
168-
height: 18,
169-
color: Theme.of(context).scaffoldBackgroundColor,
170-
child: Center(
171-
child: Text(
172-
'SSID: $wifiSSID IP: $wifiIP',
173-
style: TextStyle(color: Colors.white),
174-
),
175-
),
176-
),
177159
Container(
178160
child: Padding(
179161
padding: EdgeInsets.only(left: 30, right: 30, bottom: 10),

nauta_api/lib/src/nauta_api.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class NautaProtocol {
9696
static Future<SessionObject> createSession() async {
9797
if (await isConnected()) {
9898
if (isLoggedIn()) {
99-
throw NautaPreLoginException("Hay una session abierta");
99+
throw NautaPreLoginException("Hay una sesión abierta");
100100
} else {
101101
throw NautaPreLoginException("Hay una conexion activa");
102102
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1515
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
1616
# Read more about iOS versioning at
1717
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18-
version: 1.2.2+7
18+
version: 1.2.2+8
1919

2020
environment:
2121
sdk: ">=2.7.0 <3.0.0"

0 commit comments

Comments
 (0)