Ver código fonte

rutas a files de hector

Oniel Mendez 4 anos atrás
pai
commit
5b7c137f44

+ 6
- 0
fast_med_flutter/lib/main.dart Ver arquivo

@@ -1,6 +1,9 @@
1 1
 import 'package:fast_med_flutter/routes/home.dart';
2 2
 import 'package:fast_med_flutter/routes/ver_oficinas.dart';
3 3
 import 'package:fast_med_flutter/routes/calendario.dart';
4
+import 'package:fast_med_flutter/routes/main.dart';
5
+import 'package:fast_med_flutter/routes/register.dart';
6
+import 'package:fast_med_flutter/routes/welcome.dart';
4 7
 import 'package:flutter/material.dart';
5 8
 
6 9
 void main() => runApp(MaterialApp(
@@ -9,5 +12,8 @@ void main() => runApp(MaterialApp(
9 12
       '/home': (context) => Home(),
10 13
       '/verOficinas': (context) => VerOficinas(),
11 14
       '/calendario': (context) => Calendario(),
15
+      '/welcome': (context) => WelcomePage(),
16
+      '/register': (context) => RegisterPage(),
17
+      '/MyApp': (context) => MyApp(),
12 18
     }
13 19
 ));

+ 16
- 4
fast_med_flutter/lib/routes/home.dart Ver arquivo

@@ -33,9 +33,21 @@ class _HomeState extends State<Home>{
33 33
               minWidth: 300.0,
34 34
               height: 100.0,
35 35
               onPressed: (){
36
-                Navigator.pushNamed(context, '/verOficinas');
36
+                Navigator.pushNamed(context, '/register');
37
+              },
38
+              child: Text('register',
39
+                style: TextStyle(fontSize: 36),
40
+              ),
41
+              color: Colors.purple,
42
+
43
+            ),
44
+            new FlatButton(
45
+              minWidth: 300.0,
46
+              height: 100.0,
47
+              onPressed: (){
48
+                Navigator.pushNamed(context, '/welcome');
37 49
               },
38
-              child: Text('Otro boton',
50
+              child: Text('welcome',
39 51
                 style: TextStyle(fontSize: 36),
40 52
               ),
41 53
               color: Colors.purple,
@@ -45,9 +57,9 @@ class _HomeState extends State<Home>{
45 57
               minWidth: 300.0,
46 58
               height: 100.0,
47 59
               onPressed: (){
48
-                Navigator.pushNamed(context, '/calendario');
60
+                Navigator.pushNamed(context, '/MyApp');
49 61
               },
50
-              child: Text('Calendario',
62
+              child: Text('MyApp',
51 63
                 style: TextStyle(fontSize: 36),
52 64
               ),
53 65
               color: Colors.purple,

+ 33
- 0
fast_med_flutter/lib/routes/main.dart Ver arquivo

@@ -0,0 +1,33 @@
1
+
2
+import 'package:flutter/cupertino.dart';
3
+import 'package:flutter_login/flutter_login.dart';
4
+import 'package:flutter/material.dart';
5
+import 'package:google_fonts/google_fonts.dart';
6
+import 'register.dart';
7
+import 'welcome.dart';
8
+
9
+// import 'dashboard_screen.dart';
10
+
11
+
12
+
13
+void main() =>  runApp(MyApp());
14
+
15
+
16
+
17
+class MyApp extends StatelessWidget{
18
+  
19
+  static const String title = "FastMed";
20
+
21
+  @override
22
+  Widget build(BuildContext context){
23
+    final textTheme = Theme.of(context).textTheme;
24
+    return MaterialApp(
25
+      title: title,
26
+      theme: ThemeData(
27
+        textTheme: GoogleFonts.cabinTextTheme(textTheme),
28
+        ),
29
+      home: WelcomePage(),
30
+    );
31
+  }
32
+
33
+}

+ 161
- 0
fast_med_flutter/lib/routes/register.dart Ver arquivo

@@ -0,0 +1,161 @@
1
+import 'package:flutter_login/flutter_login.dart';
2
+import 'package:flutter/material.dart';
3
+import 'package:google_fonts/google_fonts.dart';
4
+
5
+//
6
+//Still to add: 
7
+//  Email verification, that the input has "@" and "."
8
+//  Send email and password to database
9
+//
10
+//
11
+//
12
+
13
+class RegisterPage extends StatefulWidget{
14
+  
15
+  RegisterPage({Key key, this.title}) : super(key: key);
16
+  final String title;
17
+
18
+  @override
19
+  _RegisterPageState createState() => _RegisterPageState();
20
+}
21
+
22
+class _RegisterPageState extends State<RegisterPage> {
23
+
24
+  TextEditingController email;
25
+  TextEditingController password;
26
+  TextEditingController confirmpass;
27
+
28
+  // Future<List> send_data() async {
29
+  //   final data = await
30
+  // }
31
+
32
+  String _SamePass(){
33
+    if(password == confirmpass){
34
+      return "Same password";
35
+    }
36
+    else{
37
+      return "Different passwords";
38
+    }
39
+  }
40
+
41
+  Widget _BackButton(BuildContext context){
42
+    return InkWell(
43
+      onTap: (){
44
+        Navigator.pop(context);
45
+      },
46
+      child: Row(
47
+        children: <Widget>[
48
+          Container(
49
+            padding: EdgeInsets.only(left: 0, top: 10, bottom: 10),
50
+            child: Icon(Icons.arrow_back_ios, color: Colors.black),
51
+          ),
52
+          Text("Back",
53
+          style: TextStyle(fontSize: 12, fontWeight: FontWeight.w500))
54
+        ]
55
+      ),
56
+    );
57
+  }
58
+
59
+  Widget _SubmitButton(BuildContext context){
60
+    return InkWell(
61
+       onTap: (){
62
+
63
+       },
64
+      child: Container(
65
+        padding: EdgeInsets.symmetric(vertical: 10),
66
+        width: 250,
67
+        alignment: Alignment.center,
68
+        decoration: BoxDecoration(
69
+          color: Colors.red,
70
+          borderRadius: BorderRadius.circular(30),
71
+        ),
72
+        child: Text(
73
+          "Submit",
74
+          style: TextStyle(fontSize: 22, color: Colors.white),
75
+        ),
76
+      ),
77
+    );
78
+  }
79
+
80
+  Widget _EntryField(String title, TextEditingController controller, {bool pass = false}){
81
+    return Container(
82
+      padding: EdgeInsets.only(left: 0, top: 10, bottom: 10),
83
+      child: Column(
84
+        crossAxisAlignment: CrossAxisAlignment.start,
85
+      
86
+        children: <Widget> [
87
+          Text(
88
+            title,
89
+            style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
90
+          ),
91
+          SizedBox(
92
+            height: 30
93
+          ),
94
+          TextField(
95
+            controller: controller,
96
+            obscureText: pass,
97
+            decoration: InputDecoration(
98
+              border: (
99
+                  UnderlineInputBorder()
100
+              ),
101
+            ),
102
+          )
103
+        ]
104
+      ),
105
+      
106
+    );
107
+  }
108
+
109
+  Widget _Fills(){
110
+    return Column(
111
+      children: <Widget> [
112
+      _EntryField("Email", email),
113
+      _EntryField("Password", password, pass: true),
114
+      _EntryField("Confirm Password", confirmpass, pass: true)
115
+    
116
+    ]
117
+    );
118
+  }
119
+
120
+//add column or stack
121
+  @override
122
+  Widget build(BuildContext context) {
123
+    final height = MediaQuery.of(context).size.height;
124
+    return Scaffold(
125
+      body: Container(
126
+        height: height,
127
+        child: Stack(
128
+          
129
+          children: <Widget>[
130
+            Container(
131
+              padding: EdgeInsets.symmetric(horizontal: 20),
132
+              child: SingleChildScrollView(
133
+                child: Column(
134
+                  crossAxisAlignment: CrossAxisAlignment.center,
135
+                  mainAxisAlignment: MainAxisAlignment.center,
136
+                  children: <Widget>[
137
+                     SizedBox(
138
+                      height: 200,
139
+                    ),
140
+                    _Fills(),
141
+                    //Add code to verify if password and confirm password match
142
+                    SizedBox(
143
+                      height: 20,
144
+                    ),
145
+                    _SubmitButton(context),
146
+                  ],
147
+                ),
148
+              )
149
+            ),
150
+            Positioned(
151
+            top: 12, left: 20, child: _BackButton(context),
152
+          ),
153
+          ],
154
+          
155
+        ),
156
+      )
157
+    );
158
+  }
159
+    
160
+}
161
+

+ 201
- 0
fast_med_flutter/lib/routes/welcome.dart Ver arquivo

@@ -0,0 +1,201 @@
1
+
2
+
3
+import 'package:flutter_login/flutter_login.dart';
4
+import 'package:flutter/material.dart';
5
+import 'package:google_fonts/google_fonts.dart';
6
+import 'register.dart';
7
+
8
+
9
+
10
+
11
+
12
+class WelcomePage extends StatefulWidget {
13
+  WelcomePage({Key key, this.title}) : super(key: key);
14
+
15
+  final String title;
16
+
17
+  @override
18
+  _WelcomePageState createState() => _WelcomePageState();
19
+}
20
+
21
+class _WelcomePageState extends State<WelcomePage> {
22
+
23
+  TextEditingController email;
24
+  TextEditingController password;
25
+
26
+  Widget _message(BuildContext context){
27
+    return RichText(
28
+      textAlign: TextAlign.center,
29
+      text: TextSpan(
30
+          text: "Don't have an account?",
31
+          style: GoogleFonts.cabin(
32
+              fontSize: 18,
33
+              color: Colors.black
34
+          )
35
+      ),
36
+    );
37
+  }
38
+
39
+  Widget _title(BuildContext context){
40
+    return RichText(
41
+      textAlign: TextAlign.center,
42
+      text: TextSpan(
43
+          text: "Welcome to FastMed",
44
+          style: GoogleFonts.cabin(
45
+              fontSize: 30,
46
+              color: Colors.red
47
+          )
48
+      ),
49
+    );
50
+
51
+  }
52
+
53
+  Widget _LoginField(String title, TextEditingController controller, {bool pass = false}){
54
+    return Container(
55
+      padding: EdgeInsets.only(left: 0, top: 10, bottom: 10),
56
+      child: Column(
57
+          crossAxisAlignment: CrossAxisAlignment.start,
58
+
59
+          children: <Widget> [
60
+            Text(
61
+              title,
62
+              style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
63
+            ),
64
+            SizedBox(
65
+                height: 30
66
+            ),
67
+            TextField(
68
+              controller: controller,
69
+              obscureText: pass,
70
+              decoration: InputDecoration(
71
+                border: (
72
+                    UnderlineInputBorder(
73
+
74
+                    )
75
+                ),
76
+              ),
77
+            ),
78
+          ]
79
+      ),
80
+
81
+    );
82
+  }
83
+
84
+  Widget _Fills(){
85
+    return Column(
86
+        children: <Widget> [
87
+          _LoginField("Email", email),
88
+          _LoginField("Password", password, pass: true),
89
+
90
+        ]
91
+    );
92
+  }
93
+
94
+
95
+
96
+  // Widget _LogInButton(BuildContext context){
97
+  //   return InkWell(
98
+  //     // onTap: () {
99
+  //     //   Navigator.push(context, MaterialPageRoute(builder: (context)) => __LoginPage())
100
+  //     // },
101
+  //     child: Container(
102
+  //       // width: MediaQuery.of(context).size.width,
103
+  //       width: 200,
104
+  //       // height: ,
105
+  //       padding: EdgeInsets.symmetric(vertical:8),
106
+  //       alignment: Alignment.center,
107
+  //       decoration: BoxDecoration(
108
+  //         color: Colors.red,
109
+  //         // shape:
110
+  //
111
+  //         borderRadius: BorderRadius.circular(30),
112
+  //       ),
113
+  //       child: Text(
114
+  //         "Login",
115
+  //         style: TextStyle(fontSize: 25, color: Colors.white),
116
+  //       ),
117
+  //
118
+  //     )
119
+  //   );
120
+  // }
121
+
122
+  Widget _RegisterButton(BuildContext context){
123
+    return InkWell(
124
+        onTap: () {
125
+          Navigator.push(
126
+              context, MaterialPageRoute(builder: (context) => RegisterPage()));
127
+        },
128
+        child: Container(
129
+          // width: MediaQuery.of(context).size.width,
130
+          width: 180,
131
+          padding: EdgeInsets.symmetric(vertical:8),
132
+          alignment: Alignment.center,
133
+          decoration: BoxDecoration(
134
+            color: Colors.red,
135
+            // shape:
136
+
137
+            borderRadius: BorderRadius.circular(30),
138
+          ),
139
+          child: Text(
140
+            "Register",
141
+            style: TextStyle(fontSize: 22, color: Colors.white),
142
+          ),
143
+
144
+        )
145
+    );
146
+  }
147
+
148
+  @override
149
+  Widget build(BuildContext context) {
150
+    final height = MediaQuery.of(context).size.height;
151
+    return Scaffold(
152
+        body: Container(
153
+          height: height,
154
+          child:Container(
155
+            width: MediaQuery.of(context).size.width,
156
+            padding: EdgeInsets.symmetric(horizontal: 20),
157
+            // height: MediaQuery.of(context).size.height,
158
+            decoration: BoxDecoration(
159
+                borderRadius: BorderRadius.all(Radius.circular(4)),
160
+                boxShadow: [
161
+                  BoxShadow(
162
+                      color: Colors.white,
163
+                      offset: Offset(0,3),
164
+                      blurRadius: 5,
165
+                      spreadRadius: 2)
166
+                ]
167
+
168
+            ),
169
+            child: SingleChildScrollView(
170
+                child: Column(
171
+                  crossAxisAlignment: CrossAxisAlignment.center,
172
+                  mainAxisAlignment: MainAxisAlignment.center,
173
+                  children: <Widget> [
174
+                    SizedBox(
175
+                      height: 80,
176
+                    ),
177
+                    _title(context),
178
+                    SizedBox(
179
+                      height: 150,
180
+                    ),
181
+                    // _LogInButton(context),
182
+                    _Fills(),
183
+                    SizedBox(
184
+                      height: 60,
185
+                    ),
186
+                    _message(context),
187
+                    SizedBox(
188
+                      height: 10,
189
+                    ),
190
+                    _RegisterButton(context),
191
+                    SizedBox(
192
+                      height: 10,
193
+                    )
194
+                  ],
195
+                )
196
+            ),
197
+          ),
198
+        )
199
+    );
200
+  }
201
+}

+ 154
- 0
fast_med_flutter/pubspec.lock Ver arquivo

@@ -43,6 +43,20 @@ packages:
43 43
       url: "https://pub.dartlang.org"
44 44
     source: hosted
45 45
     version: "1.15.0-nullsafety.3"
46
+  convert:
47
+    dependency: transitive
48
+    description:
49
+      name: convert
50
+      url: "https://pub.dartlang.org"
51
+    source: hosted
52
+    version: "2.1.1"
53
+  crypto:
54
+    dependency: transitive
55
+    description:
56
+      name: crypto
57
+      url: "https://pub.dartlang.org"
58
+    source: hosted
59
+    version: "2.1.5"
46 60
   cupertino_icons:
47 61
     dependency: "direct main"
48 62
     description:
@@ -57,16 +71,58 @@ packages:
57 71
       url: "https://pub.dartlang.org"
58 72
     source: hosted
59 73
     version: "1.2.0-nullsafety.1"
74
+  ffi:
75
+    dependency: transitive
76
+    description:
77
+      name: ffi
78
+      url: "https://pub.dartlang.org"
79
+    source: hosted
80
+    version: "0.1.3"
81
+  file:
82
+    dependency: transitive
83
+    description:
84
+      name: file
85
+      url: "https://pub.dartlang.org"
86
+    source: hosted
87
+    version: "5.2.1"
88
+  flushbar:
89
+    dependency: transitive
90
+    description:
91
+      name: flushbar
92
+      url: "https://pub.dartlang.org"
93
+    source: hosted
94
+    version: "1.10.4"
60 95
   flutter:
61 96
     dependency: "direct main"
62 97
     description: flutter
63 98
     source: sdk
64 99
     version: "0.0.0"
100
+  flutter_login:
101
+    dependency: "direct main"
102
+    description:
103
+      name: flutter_login
104
+      url: "https://pub.dartlang.org"
105
+    source: hosted
106
+    version: "1.0.14"
65 107
   flutter_test:
66 108
     dependency: "direct dev"
67 109
     description: flutter
68 110
     source: sdk
69 111
     version: "0.0.0"
112
+  font_awesome_flutter:
113
+    dependency: transitive
114
+    description:
115
+      name: font_awesome_flutter
116
+      url: "https://pub.dartlang.org"
117
+    source: hosted
118
+    version: "8.10.0"
119
+  google_fonts:
120
+    dependency: "direct main"
121
+    description:
122
+      name: google_fonts
123
+      url: "https://pub.dartlang.org"
124
+    source: hosted
125
+    version: "1.1.1"
70 126
   http:
71 127
     dependency: "direct main"
72 128
     description:
@@ -102,6 +158,13 @@ packages:
102 158
       url: "https://pub.dartlang.org"
103 159
     source: hosted
104 160
     version: "1.3.0-nullsafety.3"
161
+  nested:
162
+    dependency: transitive
163
+    description:
164
+      name: nested
165
+      url: "https://pub.dartlang.org"
166
+    source: hosted
167
+    version: "0.0.4"
105 168
   path:
106 169
     dependency: transitive
107 170
     description:
@@ -109,6 +172,41 @@ packages:
109 172
       url: "https://pub.dartlang.org"
110 173
     source: hosted
111 174
     version: "1.8.0-nullsafety.1"
175
+  path_provider:
176
+    dependency: transitive
177
+    description:
178
+      name: path_provider
179
+      url: "https://pub.dartlang.org"
180
+    source: hosted
181
+    version: "1.6.24"
182
+  path_provider_linux:
183
+    dependency: transitive
184
+    description:
185
+      name: path_provider_linux
186
+      url: "https://pub.dartlang.org"
187
+    source: hosted
188
+    version: "0.0.1+2"
189
+  path_provider_macos:
190
+    dependency: transitive
191
+    description:
192
+      name: path_provider_macos
193
+      url: "https://pub.dartlang.org"
194
+    source: hosted
195
+    version: "0.0.4+6"
196
+  path_provider_platform_interface:
197
+    dependency: transitive
198
+    description:
199
+      name: path_provider_platform_interface
200
+      url: "https://pub.dartlang.org"
201
+    source: hosted
202
+    version: "1.0.4"
203
+  path_provider_windows:
204
+    dependency: transitive
205
+    description:
206
+      name: path_provider_windows
207
+      url: "https://pub.dartlang.org"
208
+    source: hosted
209
+    version: "0.0.4+3"
112 210
   pedantic:
113 211
     dependency: transitive
114 212
     description:
@@ -116,6 +214,41 @@ packages:
116 214
       url: "https://pub.dartlang.org"
117 215
     source: hosted
118 216
     version: "1.9.2"
217
+  platform:
218
+    dependency: transitive
219
+    description:
220
+      name: platform
221
+      url: "https://pub.dartlang.org"
222
+    source: hosted
223
+    version: "2.2.1"
224
+  plugin_platform_interface:
225
+    dependency: transitive
226
+    description:
227
+      name: plugin_platform_interface
228
+      url: "https://pub.dartlang.org"
229
+    source: hosted
230
+    version: "1.0.3"
231
+  process:
232
+    dependency: transitive
233
+    description:
234
+      name: process
235
+      url: "https://pub.dartlang.org"
236
+    source: hosted
237
+    version: "3.0.13"
238
+  provider:
239
+    dependency: transitive
240
+    description:
241
+      name: provider
242
+      url: "https://pub.dartlang.org"
243
+    source: hosted
244
+    version: "4.3.2+2"
245
+  quiver:
246
+    dependency: transitive
247
+    description:
248
+      name: quiver
249
+      url: "https://pub.dartlang.org"
250
+    source: hosted
251
+    version: "2.1.5"
119 252
   simple_gesture_detector:
120 253
     dependency: transitive
121 254
     description:
@@ -177,6 +310,13 @@ packages:
177 310
       url: "https://pub.dartlang.org"
178 311
     source: hosted
179 312
     version: "0.2.19-nullsafety.2"
313
+  transformer_page_view:
314
+    dependency: transitive
315
+    description:
316
+      name: transformer_page_view
317
+      url: "https://pub.dartlang.org"
318
+    source: hosted
319
+    version: "0.1.6"
180 320
   typed_data:
181 321
     dependency: transitive
182 322
     description:
@@ -191,6 +331,20 @@ packages:
191 331
       url: "https://pub.dartlang.org"
192 332
     source: hosted
193 333
     version: "2.1.0-nullsafety.3"
334
+  win32:
335
+    dependency: transitive
336
+    description:
337
+      name: win32
338
+      url: "https://pub.dartlang.org"
339
+    source: hosted
340
+    version: "1.7.3"
341
+  xdg_directories:
342
+    dependency: transitive
343
+    description:
344
+      name: xdg_directories
345
+      url: "https://pub.dartlang.org"
346
+    source: hosted
347
+    version: "0.1.2"
194 348
 sdks:
195 349
   dart: ">=2.10.0-110 <2.11.0"
196 350
   flutter: ">=1.17.0 <2.0.0"

+ 2
- 0
fast_med_flutter/pubspec.yaml Ver arquivo

@@ -29,6 +29,8 @@ dependencies:
29 29
   # Use with the CupertinoIcons class for iOS style icons.
30 30
   cupertino_icons: ^1.0.0
31 31
   table_calendar: ^2,0,1
32
+  flutter_login: ^1.0.14
33
+  google_fonts: ^1.1.1
32 34
 
33 35
   #
34 36
   http: ^0.12.2