@@ -6,6 +6,8 @@ import 'package:todo/pages/connected_page.dart';
66
77import 'package:nauta_api/nauta_api.dart' ;
88
9+ import 'package:webview_flutter/webview_flutter.dart' ;
10+
911class LoginForm extends StatefulWidget {
1012 @override
1113 _LoginFormState createState () => _LoginFormState ();
@@ -53,7 +55,7 @@ class _LoginFormState extends State<LoginForm> {
5355 labelText: 'Username' ,
5456 prefixIcon: Icon (
5557 Icons .alternate_email,
56- size: 32 ,
58+ size: 28 ,
5759 )),
5860 validator: (value) {
5961 if (value.isEmpty) {
@@ -74,7 +76,7 @@ class _LoginFormState extends State<LoginForm> {
7476 labelText: 'Contraseña' ,
7577 prefixIcon: Icon (
7678 Icons .lock_outline,
77- size: 32 ,
79+ size: 28 ,
7880 ),
7981 ),
8082 validator: (value) {
@@ -98,17 +100,33 @@ class _LoginFormState extends State<LoginForm> {
98100 onPressed: login,
99101 ),
100102 ),
101- Padding (
102- padding: EdgeInsets .all (5.0 ),
103- child: MaterialButton (
104- color: Colors .lightBlue,
105- child: Text (
106- 'Consultar crédito' ,
107- style: TextStyle (color: Colors .white),
103+ Row (
104+ mainAxisAlignment: MainAxisAlignment .center,
105+ children: < Widget > [
106+ Padding (
107+ padding: EdgeInsets .all (2.0 ),
108+ child: MaterialButton (
109+ color: Colors .lightBlue,
110+ child: Text (
111+ 'Consultar crédito' ,
112+ style: TextStyle (color: Colors .white),
113+ ),
114+ onPressed: credit,
115+ ),
108116 ),
109- onPressed: credit,
110- ),
111- )
117+ Padding (
118+ padding: EdgeInsets .all (2.0 ),
119+ child: MaterialButton (
120+ color: Colors .lightBlue,
121+ child: Text (
122+ 'Portal Nauta' ,
123+ style: TextStyle (color: Colors .white),
124+ ),
125+ onPressed: portalNauta,
126+ ),
127+ )
128+ ],
129+ ),
112130 ],
113131 ),
114132 );
@@ -138,21 +156,25 @@ class _LoginFormState extends State<LoginForm> {
138156 await pr.hide ();
139157
140158 Navigator .pushReplacement (
141- context,
142- MaterialPageRoute (
143- builder: (context) => ConnectedPage (
144- title: 'Conectado' ,
145- username: _user.username,
146- )));
159+ context,
160+ MaterialPageRoute (
161+ builder: (context) => ConnectedPage (
162+ title: 'Conectado' ,
163+ username: _user.username,
164+ ),
165+ ),
166+ );
147167 } on NautaException catch (e) {
148168 await pr.hide ();
149- Scaffold .of (context).showSnackBar (SnackBar (
150- backgroundColor: Colors .red,
151- content: Text (
152- e.message,
153- style: TextStyle (fontWeight: FontWeight .w800, fontSize: 18 ),
169+ Scaffold .of (context).showSnackBar (
170+ SnackBar (
171+ backgroundColor: Colors .red,
172+ content: Text (
173+ e.message,
174+ style: TextStyle (fontWeight: FontWeight .w800, fontSize: 18 ),
175+ ),
154176 ),
155- )) ;
177+ );
156178 }
157179 } // end if (form.validate())
158180 } // end login()
@@ -200,4 +222,29 @@ class _LoginFormState extends State<LoginForm> {
200222 }
201223 } // end if (form.validate())
202224 } // end credit()
225+
226+ void portalNauta () {
227+ Navigator .push (
228+ context,
229+ MaterialPageRoute (
230+ builder: (context) => PortalNauta (),
231+ ),
232+ );
233+ }
234+ }
235+
236+ class PortalNauta extends StatelessWidget {
237+ @override
238+ Widget build (BuildContext context) {
239+ return Scaffold (
240+ appBar: AppBar (
241+ title: Text ('Portal Nauta' ),
242+ elevation: 0 ,
243+ ),
244+ body: WebView (
245+ initialUrl: "https://www.portal.nauta.cu" ,
246+ javascriptMode: JavascriptMode .unrestricted,
247+ ),
248+ );
249+ }
203250}
0 commit comments