瀏覽代碼

First commit

hector.sierra 4 年之前
父節點
當前提交
f3397ec8f6
共有 38 個文件被更改,包括 1198 次插入872 次删除
  1. 1
    1
      fast_med_flutter/.metadata
  2. 23
    0
      fast_med_flutter/API/.ftpconfig
  3. 17
    0
      fast_med_flutter/API/config.php
  4. 31
    0
      fast_med_flutter/API/getcitas.php
  5. 33
    0
      fast_med_flutter/API/insert_user.php
  6. 25
    0
      fast_med_flutter/API/login.php
  7. 36
    0
      fast_med_flutter/API/update_profile.php
  8. 2
    2
      fast_med_flutter/README.md
  9. 1
    1
      fast_med_flutter/android/app/build.gradle
  10. 1
    1
      fast_med_flutter/android/app/src/debug/AndroidManifest.xml
  11. 2
    5
      fast_med_flutter/android/app/src/main/AndroidManifest.xml
  12. 1
    1
      fast_med_flutter/android/app/src/main/kotlin/com/example/hello/MainActivity.kt
  13. 1
    1
      fast_med_flutter/android/app/src/profile/AndroidManifest.xml
  14. 3
    3
      fast_med_flutter/ios/Runner.xcodeproj/project.pbxproj
  15. 1
    1
      fast_med_flutter/ios/Runner/Info.plist
  16. 61
    0
      fast_med_flutter/lib/OfficeScreen.dart
  17. 69
    0
      fast_med_flutter/lib/Offices.dart
  18. 135
    0
      fast_med_flutter/lib/appointments.dart
  19. 39
    0
      fast_med_flutter/lib/dynamic.dart
  20. 13
    0
      fast_med_flutter/lib/home.dart
  21. 34
    17
      fast_med_flutter/lib/main.dart
  22. 88
    0
      fast_med_flutter/lib/navigation.dart
  23. 226
    0
      fast_med_flutter/lib/profileinfo.dart
  24. 274
    0
      fast_med_flutter/lib/register.dart
  25. 0
    347
      fast_med_flutter/lib/routes/calendario.dart
  26. 0
    87
      fast_med_flutter/lib/routes/home.dart
  27. 0
    33
      fast_med_flutter/lib/routes/main.dart
  28. 0
    161
      fast_med_flutter/lib/routes/register.dart
  29. 0
    91
      fast_med_flutter/lib/routes/ver_oficinas.dart
  30. 68
    33
      fast_med_flutter/lib/welcome.dart
  31. 0
    13
      fast_med_flutter/lib/widgets/DataTableMySqlDemo/Oficina.dart
  32. 0
    46
      fast_med_flutter/lib/widgets/DataTableMySqlDemo/Services.dart
  33. 0
    1
      fast_med_flutter/lib/widgets/MySQL_DataTable/dud.dart
  34. 0
    0
      fast_med_flutter/lib/widgets/data_table/dud.dart
  35. 0
    1
      fast_med_flutter/lib/widgets/dud.dart
  36. 5
    19
      fast_med_flutter/pubspec.lock
  37. 6
    5
      fast_med_flutter/pubspec.yaml
  38. 2
    2
      fast_med_flutter/test/widget_test.dart

+ 1
- 1
fast_med_flutter/.metadata 查看文件

@@ -4,7 +4,7 @@
4 4
 # This file should be version controlled and should not be manually edited.
5 5
 
6 6
 version:
7
-  revision: 84f3d28555368a70270e9ac8390a9441df95e752
7
+  revision: 8874f21e79d7ec66d0457c7ab338348e31b17f1d
8 8
   channel: stable
9 9
 
10 10
 project_type: app

+ 23
- 0
fast_med_flutter/API/.ftpconfig 查看文件

@@ -0,0 +1,23 @@
1
+{
2
+    "protocol": "sftp",
3
+    "host": "ada.uprrp.edu",
4
+    "port": 22,
5
+    "user": "hector.sierra",
6
+    "pass": "thegamer",
7
+    "promptForPass": false,
8
+    "remote": "/home/users/hector.sierra/public_html/FastMed/API/",
9
+    "local": "/home/boyuva/Projects/Apps/fastmed/API",
10
+    "agent": "",
11
+    "privatekey": "",
12
+    "passphrase": "",
13
+    "hosthash": "",
14
+    "ignorehost": true,
15
+    "connTimeout": 100000,
16
+    "keepalive": 100000,
17
+    "keyboardInteractive": false,
18
+    "keyboardInteractiveForPass": false,
19
+    "remoteCommand": "",
20
+    "remoteShell": "",
21
+    "watch": [],
22
+    "watchTimeout": 500
23
+}

+ 17
- 0
fast_med_flutter/API/config.php 查看文件

@@ -0,0 +1,17 @@
1
+<?php
2
+
3
+	$username="FastMed";//change username
4
+	$password="skA4KCZUMZfQ6ijL"; //change password
5
+	$host="localhost";
6
+	$db_name="FastMed"; //change databasename
7
+
8
+	$connect=mysqli_connect($host,$username,$password,$db_name);
9
+
10
+	if(!$connect)
11
+	{
12
+		echo json_encode("Connection Failed");
13
+	}
14
+
15
+    $connect->set_charset('utf-8');
16
+
17
+?>

+ 31
- 0
fast_med_flutter/API/getcitas.php 查看文件

@@ -0,0 +1,31 @@
1
+<?php
2
+    include "config.php";
3
+
4
+
5
+    // $email = mysqli_real_escape_string($connect, $POST['email']);
6
+    // $password = mysqli_real_escape_string($connect, $POST['password']);
7
+
8
+
9
+    $email = $_POST['email'];
10
+    $password = $_POST['password'];
11
+
12
+
13
+    $query = "SELECT * FROM Citas";
14
+
15
+
16
+    $results = mysqli_query($connect, $query);
17
+
18
+    // var_dump($results);
19
+
20
+
21
+
22
+    echo $results;
23
+
24
+    if($results == True)
25
+    {
26
+      echo "user registered";
27
+    }
28
+    else {
29
+        echo "user not registered";
30
+    }
31
+?>

+ 33
- 0
fast_med_flutter/API/insert_user.php 查看文件

@@ -0,0 +1,33 @@
1
+<?php
2
+    include "config.php";
3
+
4
+
5
+    // $email = mysqli_real_escape_string($connect, $POST['email']);
6
+    // $password = mysqli_real_escape_string($connect, $POST['password']);
7
+
8
+
9
+    $email = $_POST['email'];
10
+    $password = $_POST['password'];
11
+
12
+
13
+    $query = "INSERT INTO Users (email, password) VALUES ('$email', '$password')";
14
+
15
+    // var_dump($query);
16
+    // echo "Despues\n";
17
+
18
+    $results = mysqli_query($connect, $query);
19
+
20
+    // var_dump($results);
21
+
22
+
23
+
24
+    echo $results;
25
+
26
+    if($results == True)
27
+    {
28
+      echo "user registered";
29
+    }
30
+    else {
31
+        echo "user not registered";
32
+    }
33
+?>

+ 25
- 0
fast_med_flutter/API/login.php 查看文件

@@ -0,0 +1,25 @@
1
+<?php
2
+    include "config.php";
3
+
4
+
5
+
6
+    $email = $_POST['email'];
7
+    $password = $_POST['password'];
8
+
9
+
10
+    $query = "INSERT INTO Users (email, password) VALUES ('$email', '$password')";
11
+
12
+
13
+    $results = mysqli_query($connect, $query);
14
+
15
+
16
+    // echo $results;
17
+
18
+    if($results == True)
19
+    {
20
+
21
+    }
22
+    else {
23
+        echo "User not registered";
24
+    }
25
+?>

+ 36
- 0
fast_med_flutter/API/update_profile.php 查看文件

@@ -0,0 +1,36 @@
1
+<?php
2
+    include "config.php";
3
+
4
+
5
+
6
+
7
+    $firstN = $_POST['first_name'];
8
+    $lastN = $_POST['last_name'];
9
+    $country = $_POST['country'];
10
+    $city = $_POST['city'];
11
+    $phone = $_POST['phone'];
12
+    $healthcare = $_POST['healthcare'];
13
+
14
+
15
+
16
+
17
+// have tp change from insert to update or add update
18
+    $query = "INSERT INTO Profile (first_name, last_name, country, city, phone_number, healthcare_provider)
19
+              VALUES ('$firstN', '$lastN', '$country', '$city', $phone, '$healthcare')";
20
+
21
+
22
+    $results = mysqli_query($connect, $query);
23
+
24
+
25
+
26
+
27
+    echo $results;
28
+
29
+    if($results == True)
30
+    {
31
+
32
+    }
33
+    else {
34
+        echo "User not registered";
35
+    }
36
+?>

+ 2
- 2
fast_med_flutter/README.md 查看文件

@@ -1,6 +1,6 @@
1
-# fast_med_flutter
1
+# hello
2 2
 
3
-A new Flutter application.
3
+A new Flutter project.
4 4
 
5 5
 ## Getting Started
6 6
 

+ 1
- 1
fast_med_flutter/android/app/build.gradle 查看文件

@@ -38,7 +38,7 @@ android {
38 38
 
39 39
     defaultConfig {
40 40
         // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41
-        applicationId "com.example.fast_med_flutter"
41
+        applicationId "com.example.hello"
42 42
         minSdkVersion 16
43 43
         targetSdkVersion 29
44 44
         versionCode flutterVersionCode.toInteger()

+ 1
- 1
fast_med_flutter/android/app/src/debug/AndroidManifest.xml 查看文件

@@ -1,5 +1,5 @@
1 1
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
-    package="com.example.fast_med_flutter">
2
+    package="com.example.hello">
3 3
     <!-- Flutter needs it to communicate with the running application
4 4
          to allow setting breakpoints, to provide hot reload, etc.
5 5
     -->

+ 2
- 5
fast_med_flutter/android/app/src/main/AndroidManifest.xml 查看文件

@@ -1,16 +1,13 @@
1 1
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
-    package="com.example.fast_med_flutter">
2
+    package="com.example.hello">
3 3
     <!-- io.flutter.app.FlutterApplication is an android.app.Application that
4 4
          calls FlutterMain.startInitialization(this); in its onCreate method.
5 5
          In most cases you can leave this as-is, but you if you want to provide
6 6
          additional functionality it is fine to subclass or reimplement
7 7
          FlutterApplication and put your custom class here. -->
8
-    <!-- Required to fetch data from the internet. -->
9
-    <uses-permission android:name="android.permission.INTERNET" />
10
-
11 8
     <application
12 9
         android:name="io.flutter.app.FlutterApplication"
13
-        android:label="fast_med_flutter"
10
+        android:label="hello"
14 11
         android:icon="@mipmap/ic_launcher">
15 12
         <activity
16 13
             android:name=".MainActivity"

fast_med_flutter/android/app/src/main/kotlin/com/example/fast_med_flutter/MainActivity.kt → fast_med_flutter/android/app/src/main/kotlin/com/example/hello/MainActivity.kt 查看文件

@@ -1,4 +1,4 @@
1
-package com.example.fast_med_flutter
1
+package com.example.hello
2 2
 
3 3
 import io.flutter.embedding.android.FlutterActivity
4 4
 

+ 1
- 1
fast_med_flutter/android/app/src/profile/AndroidManifest.xml 查看文件

@@ -1,5 +1,5 @@
1 1
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
-    package="com.example.fast_med_flutter">
2
+    package="com.example.hello">
3 3
     <!-- Flutter needs it to communicate with the running application
4 4
          to allow setting breakpoints, to provide hot reload, etc.
5 5
     -->

+ 3
- 3
fast_med_flutter/ios/Runner.xcodeproj/project.pbxproj 查看文件

@@ -299,7 +299,7 @@
299 299
 					"$(inherited)",
300 300
 					"$(PROJECT_DIR)/Flutter",
301 301
 				);
302
-				PRODUCT_BUNDLE_IDENTIFIER = com.example.fastMedFlutter;
302
+				PRODUCT_BUNDLE_IDENTIFIER = com.example.hello;
303 303
 				PRODUCT_NAME = "$(TARGET_NAME)";
304 304
 				SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
305 305
 				SWIFT_VERSION = 5.0;
@@ -431,7 +431,7 @@
431 431
 					"$(inherited)",
432 432
 					"$(PROJECT_DIR)/Flutter",
433 433
 				);
434
-				PRODUCT_BUNDLE_IDENTIFIER = com.example.fastMedFlutter;
434
+				PRODUCT_BUNDLE_IDENTIFIER = com.example.hello;
435 435
 				PRODUCT_NAME = "$(TARGET_NAME)";
436 436
 				SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
437 437
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -458,7 +458,7 @@
458 458
 					"$(inherited)",
459 459
 					"$(PROJECT_DIR)/Flutter",
460 460
 				);
461
-				PRODUCT_BUNDLE_IDENTIFIER = com.example.fastMedFlutter;
461
+				PRODUCT_BUNDLE_IDENTIFIER = com.example.hello;
462 462
 				PRODUCT_NAME = "$(TARGET_NAME)";
463 463
 				SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
464 464
 				SWIFT_VERSION = 5.0;

+ 1
- 1
fast_med_flutter/ios/Runner/Info.plist 查看文件

@@ -11,7 +11,7 @@
11 11
 	<key>CFBundleInfoDictionaryVersion</key>
12 12
 	<string>6.0</string>
13 13
 	<key>CFBundleName</key>
14
-	<string>fast_med_flutter</string>
14
+	<string>hello</string>
15 15
 	<key>CFBundlePackageType</key>
16 16
 	<string>APPL</string>
17 17
 	<key>CFBundleShortVersionString</key>

+ 61
- 0
fast_med_flutter/lib/OfficeScreen.dart 查看文件

@@ -0,0 +1,61 @@
1
+import 'package:flutter/material.dart';
2
+import 'dart:convert';
3
+import 'package:hello/Offices.dart';
4
+import 'package:hello/appointments.dart';
5
+import 'package:flutter/foundation.dart';
6
+
7
+
8
+class OfficesScreen extends StatelessWidget {
9
+  final List<Offices> off;
10
+  Offices ofi;
11
+  // final Offices Of;
12
+  // final offlist = List<Offices>.generate(
13
+  //   2,
14
+  //       (i) => Offices(
15
+  //         'Office $i',
16
+  //         docs[i], spec[i], addrs[i],
17
+  //   ),
18
+  // );
19
+
20
+  var docs = ["Collazo", "Albizu"];
21
+  var spec = ["General", "Pediatra"];
22
+  var addrs = ["Bo. Montellano, Cayey", "Las Dalias, Mayagüez"];
23
+
24
+  //requiring the list of todos
25
+  OfficesScreen({Key key, @required this.off}) : super(key: key);
26
+
27
+  @override
28
+  Widget build(BuildContext context) {
29
+    // print(docs[0]);
30
+
31
+    final offlist = List<Offices>.generate(
32
+      2,
33
+          (i) => Offices(
34
+            'Office $i',
35
+            // "sds", "gfdf", "fvfgv",
36
+            docs[i], spec[i], addrs[i]
37
+      ),
38
+    );
39
+    print(ofi.variable);
40
+    return Scaffold(
41
+
42
+      appBar: AppBar(
43
+        title: Text('Todos'),
44
+      ),
45
+      //passing in the ListView.builder
46
+      body: ListView.builder(
47
+        itemCount: offlist.length,
48
+        itemBuilder: (context, index) {
49
+          return ListTile(
50
+              title: Text(offlist[index].office),
51
+              onTap: (){
52
+                Navigator.push(context, MaterialPageRoute(builder: (context) => 
53
+                AppointmentPage(O: offlist[index])),
54
+                );
55
+              },
56
+          );
57
+        },
58
+      ),
59
+    );
60
+  }
61
+}

+ 69
- 0
fast_med_flutter/lib/Offices.dart 查看文件

@@ -0,0 +1,69 @@
1
+// import 'package:flutter/material.dart';
2
+// import 'dart:convert';
3
+// import 'package:flutter/foundation.dart';
4
+// import 'OfficeScreen.dart';
5
+// import 'appointments.dart';
6
+//
7
+// class Officess {
8
+//   final String office;
9
+//   final String doctor;
10
+//   final String specialty;
11
+//   final String address;
12
+//
13
+//   Officess({this.office, this.doctor, this.specialty, this.address});
14
+//
15
+//   factory Officess.fromJson(Map<String, dynamic> json) {
16
+//     return Officess(
17
+//       office: json['office'],
18
+//       doctor: json['doctor'],
19
+//       specialty: json['id'],
20
+//       address: json['title'],
21
+//     );
22
+//   }
23
+// }
24
+
25
+class Offices {
26
+  final String office;
27
+  final String doctor;
28
+  final String specialty;
29
+  final String address;
30
+
31
+  var variable = 32;
32
+
33
+  var docs = ["Collazo", "Albizu"];
34
+  var spec = ["General", "Pediatra"];
35
+  var addrs = ["Bo. Montellano, Cayey", "Las Dalias, Mayagüez"];
36
+
37
+  Offices(this.office, this.doctor, this.specialty, this.address);
38
+
39
+
40
+}
41
+// var docs = List<String> ("juan", "pedro");
42
+
43
+
44
+// final off = List<Offices>.generate(
45
+//   2,
46
+//       (i) => Offices(
47
+//     'Office $i',
48
+//     docs[i], spec[i], addrs[i],
49
+//   ),
50
+// );
51
+
52
+
53
+
54
+
55
+
56
+
57
+// final off = List<Offices>.generate(
58
+//   2,
59
+//       (i) => Offices(
60
+//     'Office $i',
61
+//     docs[i],
62
+//     spec[i],
63
+//     addrs[i],
64
+//   ),
65
+// );
66
+
67
+
68
+
69
+

+ 135
- 0
fast_med_flutter/lib/appointments.dart 查看文件

@@ -0,0 +1,135 @@
1
+import 'package:flutter/cupertino.dart';
2
+import 'package:flutter_login/flutter_login.dart';
3
+import 'package:flutter/material.dart';
4
+import 'package:google_fonts/google_fonts.dart';
5
+import 'package:hello/Offices.dart';
6
+import 'dynamic.dart';
7
+import 'Offices.dart';
8
+import 'OfficeScreen.dart';
9
+import 'package:flutter/foundation.dart';
10
+import 'package:http/http.dart' as http;
11
+
12
+//This page only works when called by other OfficeScreenPage()
13
+//Need to add the functionality to work on its own
14
+
15
+
16
+class AppointmentPage extends StatelessWidget {
17
+
18
+
19
+  final Offices O;
20
+  AppointmentPage({Key key, @required this.O}) :super(key: key);
21
+  // AppointmentPage({Key key, @required this.O}) : super(key: key);
22
+
23
+  // final String title;
24
+  //
25
+  // Future<http.Response> fetchAlbum() {
26
+  //   return http.get('https://ada.uprrp.edu/~hector.sierra/FastMed/API/API/getcitas.php');
27
+  // }
28
+
29
+
30
+
31
+  // List<dynamicWidget> listDynamic = [];
32
+  // List<String> data = [];
33
+  // Icon floatingIcon = new Icon(Icons.add);
34
+  //
35
+  // addDynamic() {
36
+  //   if (data.length != 0) {
37
+  //     floatingIcon = new Icon(Icons.add);
38
+  //     data = [];
39
+  //     listDynamic = [];
40
+  //     print('if');
41
+  //   }
42
+  //   setState(() {});
43
+  //   if (listDynamic.length >= 5) {
44
+  //     return;
45
+  //   }
46
+  //   listDynamic.add(new dynamicWidget());
47
+  // }
48
+  //
49
+
50
+  // var docs = ["Collazo", "Albizu"];
51
+  // var spec = ["General", "Pediatra"];
52
+  // var addrs = ["Bo. Montellano, Cayey", "Las Dalias, Mayagüez"];
53
+
54
+
55
+  @override
56
+  Widget card() {
57
+  return SizedBox(
58
+    width: 380,
59
+    height: 150,
60
+      child: Card(
61
+        child: Column(
62
+          mainAxisSize: MainAxisSize.min,
63
+            children: <Widget>[
64
+              ListTile(
65
+
66
+                leading: Icon(
67
+                  Icons.check,
68
+                  color: Colors.green,
69
+                  size: 60,
70
+              ),
71
+                title: Text( O.doctor + "\n" + O.specialty, textScaleFactor: 1.5,),
72
+                subtitle: Text(O.address, textScaleFactor: 1.45,),
73
+                trailing: Text("\n10:45 - 11:45      ", textScaleFactor: 1.30,),
74
+
75
+              ),
76
+              // ListTile(
77
+              //   leading: Icon(
78
+              //     Icons.check,
79
+              //     color: Colors.green,
80
+              //     size: 60,
81
+              //   ),
82
+              //   title: Text("Figueroa" + "\n" + "Gastrointerologo", textScaleFactor: 1.5,),
83
+              //   subtitle: Text("Las Dalias, Mayagüez", textScaleFactor: 1.45,),
84
+              //   trailing: Text("\n10:45 - 11:45      ", textScaleFactor: 1.30,),
85
+              //
86
+              // )
87
+           ],
88
+          ),
89
+        ),
90
+      );
91
+    }
92
+
93
+  @override
94
+  Widget build(BuildContext context) {
95
+    final height = MediaQuery.of(context).size.height;
96
+    return Scaffold(
97
+
98
+        body: Container(
99
+          height: height,
100
+          child:Container(
101
+            width: MediaQuery.of(context).size.width,
102
+            padding: EdgeInsets.symmetric(horizontal: 20),
103
+            // height: MediaQuery.of(context).size.height,
104
+            decoration: BoxDecoration(
105
+                borderRadius: BorderRadius.all(Radius.circular(4)),
106
+                boxShadow: [
107
+                  BoxShadow(
108
+                      color: Colors.white,
109
+                      offset: Offset(0,3),
110
+                      blurRadius: 5,
111
+                      spreadRadius: 2)
112
+                ]
113
+
114
+            ),
115
+            child: SingleChildScrollView(
116
+                child: Column(
117
+                  crossAxisAlignment: CrossAxisAlignment.center,
118
+                  mainAxisAlignment: MainAxisAlignment.center,
119
+                  children: <Widget> [
120
+                    SizedBox(
121
+                      height: 80,
122
+                    ),
123
+                    card(),
124
+                    SizedBox(
125
+                      height: 25,
126
+                    ),
127
+                    // card(docs[1], spec[1], addrs[1]),
128
+                  ],
129
+                )
130
+            ),
131
+          ),
132
+        )
133
+    );
134
+  }
135
+}

+ 39
- 0
fast_med_flutter/lib/dynamic.dart 查看文件

@@ -0,0 +1,39 @@
1
+import 'package:flutter/material.dart';
2
+
3
+
4
+class dynamicWidget extends StatelessWidget {
5
+  TextEditingController Product = new TextEditingController();
6
+  TextEditingController Price = new TextEditingController();
7
+
8
+  @override
9
+  Widget build(BuildContext context) {
10
+
11
+    Widget card() {
12
+      return SizedBox(
13
+        width: 380,
14
+        height: 140,
15
+        child: Card(
16
+          child: Column(
17
+            mainAxisSize: MainAxisSize.min,
18
+            children: <Widget>[
19
+              const ListTile(
20
+
21
+                leading: Icon(
22
+                  Icons.check,
23
+                  color: Colors.green,
24
+                  size: 60,
25
+                ),
26
+                title: Text("\nVacunación\nDr. Jímenez", textScaleFactor: 1.15,),
27
+                subtitle: Text("Bo. Montellano, Cayey", textScaleFactor: 1.25,),
28
+                trailing: Text("\n10:45 - 11:45      ", textScaleFactor: 1.30,),
29
+
30
+              ),
31
+            ],
32
+          ),
33
+        ),
34
+      );
35
+    }
36
+
37
+  }
38
+
39
+}

+ 13
- 0
fast_med_flutter/lib/home.dart 查看文件

@@ -0,0 +1,13 @@
1
+import 'package:flutter/material.dart';
2
+
3
+class HomePage extends StatelessWidget{
4
+  @override
5
+  Widget build(BuildContext context) {
6
+    // TODO: implement build
7
+    return Container(
8
+      padding: EdgeInsets.all(25.0),
9
+      child: Text("HOME PAGE"),
10
+    );
11
+
12
+  }
13
+}

+ 34
- 17
fast_med_flutter/lib/main.dart 查看文件

@@ -1,19 +1,36 @@
1
-import 'package:fast_med_flutter/routes/home.dart';
2
-import 'package:fast_med_flutter/routes/ver_oficinas.dart';
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';
1
+
2
+import 'package:flutter/cupertino.dart';
3
+import 'package:flutter_login/flutter_login.dart';
7 4
 import 'package:flutter/material.dart';
5
+import 'package:google_fonts/google_fonts.dart';
6
+import 'package:hello/profileinfo.dart';
7
+import 'register.dart';
8
+import 'welcome.dart';
9
+import 'navigation.dart';
10
+import 'profileinfo.dart';
11
+
12
+// import 'dashboard_screen.dart';
13
+
14
+
15
+
16
+void main() =>  runApp(MyApp());
17
+
18
+
19
+
20
+class MyApp extends StatelessWidget{
21
+  
22
+  static const String title = "FastMed";
23
+
24
+  @override
25
+  Widget build(BuildContext context){
26
+    final textTheme = Theme.of(context).textTheme;
27
+    return MaterialApp(
28
+      title: title,
29
+      theme: ThemeData(
30
+        textTheme: GoogleFonts.cabinTextTheme(textTheme),
31
+        ),
32
+      home: NavigationPage(),
33
+    );
34
+  }
8 35
 
9
-void main() => runApp(MaterialApp(
10
-    initialRoute: '/home',
11
-    routes: {
12
-      '/home': (context) => Home(),
13
-      '/verOficinas': (context) => VerOficinas(),
14
-      '/calendario': (context) => Calendario(),
15
-      '/welcome': (context) => WelcomePage(),
16
-      '/register': (context) => RegisterPage(),
17
-      '/MyApp': (context) => MyApp(),
18
-    }
19
-));
36
+}

+ 88
- 0
fast_med_flutter/lib/navigation.dart 查看文件

@@ -0,0 +1,88 @@
1
+
2
+import 'package:flutter_login/flutter_login.dart';
3
+import 'package:flutter/material.dart';
4
+import 'package:google_fonts/google_fonts.dart';
5
+import 'package:hello/home.dart';
6
+import 'register.dart';
7
+import 'welcome.dart';
8
+import 'profileinfo.dart';
9
+import 'appointments.dart';
10
+import 'package:http/http.dart' as http;
11
+import 'OfficeScreen.dart';
12
+import 'Offices.dart';
13
+
14
+
15
+class NavigationPage extends StatefulWidget{
16
+
17
+  NavigationPage({Key key, this.title}) : super(key: key);
18
+  final String title;
19
+
20
+  @override
21
+  _NavigationPageState createState() => _NavigationPageState();
22
+}
23
+
24
+class _NavigationPageState extends State<NavigationPage>{
25
+
26
+
27
+  int _selectedIndex = 0;
28
+
29
+  static const TextStyle optionStyle = TextStyle(fontSize: 30, fontWeight: FontWeight.bold);
30
+
31
+  final _pageOptions = [
32
+    OfficesScreen(),
33
+    ProfilePage(),
34
+    AppointmentPage()
35
+  ];
36
+
37
+  // static const List<Navigator> _widgetOptions = <Navigator>[
38
+  // //   Navigator.push(
39
+  // // context, MaterialPageRoute(builder: (context) => ProfilePage()));
40
+  // ];
41
+
42
+
43
+  // void _onItemTapped(int index) {
44
+  //   setState(() {
45
+  //     _selectedIndex = index;
46
+  //   });
47
+  // }
48
+  @override
49
+  Widget build(BuildContext context) {
50
+    final height = MediaQuery.of(context).size.height;
51
+    return Scaffold(
52
+      // appBar: AppBar(
53
+      //   title: Text("Title"),
54
+      // ),
55
+      body:  _pageOptions[_selectedIndex],
56
+      bottomNavigationBar: BottomNavigationBar(
57
+        onTap: (int index){
58
+          setState(() {
59
+            _selectedIndex = index;
60
+          });
61
+        },
62
+          selectedItemColor: Colors.red[800],
63
+        currentIndex: _selectedIndex,
64
+        // onTap: ,
65
+        // currentIndex: ,
66
+        // selectedItemColor: Colors.red, onTap: ,
67
+        //
68
+
69
+        items: [
70
+          BottomNavigationBarItem(icon: Icon(Icons.medical_services),
71
+              label: 'FastMed'),
72
+          BottomNavigationBarItem(icon: Icon(Icons.person_rounded),
73
+              label: 'Profile'),
74
+          BottomNavigationBarItem(icon: Icon(Icons.event_note_rounded),
75
+              label: 'Appointments')
76
+        ],
77
+
78
+      ),
79
+      // body: Container(
80
+      //
81
+      // ),
82
+    );
83
+    // TODO: implement build
84
+    throw UnimplementedError();
85
+  }
86
+
87
+
88
+}

+ 226
- 0
fast_med_flutter/lib/profileinfo.dart 查看文件

@@ -0,0 +1,226 @@
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
+import 'package:http/http.dart' as http;
8
+
9
+
10
+
11
+class ProfilePage extends StatefulWidget{
12
+
13
+  ProfilePage({Key key, this.title}) : super(key: key);
14
+  final String title;
15
+
16
+  @override
17
+  _ProfilePageState createState() => _ProfilePageState();
18
+}
19
+
20
+class _ProfilePageState extends State<ProfilePage>{
21
+  TextEditingController first_name = new TextEditingController();
22
+  TextEditingController last_name = new TextEditingController() ;
23
+  TextEditingController country = new TextEditingController();
24
+  TextEditingController city = new TextEditingController();
25
+  TextEditingController phone = new TextEditingController();
26
+  TextEditingController healthcare = new TextEditingController();
27
+
28
+  // trying to create a an array of controllers
29
+  // final List<TextEditingController> controllers = List();
30
+  // controllers.add(first_name);
31
+
32
+  Future<List> clear_controllers() async {
33
+    first_name.text = "";
34
+    last_name.text = "";
35
+    country.text = "";
36
+    city.text = "";
37
+    phone.text = "";
38
+    healthcare.text = "";
39
+  }
40
+
41
+
42
+  _Notice(BuildContext context, String message, int r, int g, int b){
43
+    showDialog<void>(
44
+        context: context,
45
+        barrierDismissible: false,
46
+        barrierColor: Colors.transparent,
47
+
48
+        builder: (BuildContext context){
49
+          Future.delayed(Duration(seconds: 3), () {
50
+            Navigator.of(context).pop(true);
51
+          });
52
+
53
+          return Material(
54
+              color: Colors.transparent,
55
+              child: InkResponse(
56
+                child: Container(
57
+
58
+                  alignment: Alignment.bottomCenter,
59
+                  padding: EdgeInsets.only(bottom: 130),
60
+                  child: Text(
61
+                    message,
62
+                    style: TextStyle(fontSize: 20, color: Color.fromARGB(255, r, g, b)),),
63
+
64
+                ),
65
+              )
66
+          );  
67
+        }
68
+      );
69
+  }
70
+  Future<List> send_data() async {
71
+
72
+
73
+    var url = 'https://ada.uprrp.edu/~hector.sierra/FastMed/UpdateProfile.php';
74
+    final data = await http.post(url, body: {
75
+      "first_name": first_name.text,
76
+      "last_name": last_name.text,
77
+      "country": country.text,
78
+      "city": city.text,
79
+      "phone": phone.text,
80
+      "healthcare": healthcare.text,
81
+    });
82
+    print(data.body);
83
+    if("User not registered" == data.body){
84
+      _Notice(context, "Error, unable to update profile", 255, 0, 0);
85
+    }
86
+    else{
87
+      _Notice(context, "Profile Updated", 0, 255, 0);
88
+    }
89
+
90
+  }
91
+
92
+  Widget _BackButton(BuildContext context) {
93
+    return InkWell(
94
+      onTap: () {
95
+        Navigator.pop(context);
96
+      },
97
+      child: Row(
98
+          children: <Widget>[
99
+            Container(
100
+              padding: EdgeInsets.only(left: 0, top: 10, bottom: 10),
101
+              child: Icon(Icons.arrow_back_ios, color: Colors.black),
102
+            ),
103
+            Text("Back",
104
+                style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500))
105
+          ]
106
+      ),
107
+    );
108
+  }
109
+
110
+
111
+  Widget _SubmitButton(BuildContext context) {
112
+    return InkResponse(
113
+      onTap: () {
114
+        send_data();
115
+        // clear_controllers();
116
+      },
117
+      child: Material(
118
+        borderRadius: BorderRadius.circular(30),
119
+        elevation: 3,
120
+        child: Container(
121
+          padding: EdgeInsets.symmetric(vertical: 10),
122
+          width: 250,
123
+          alignment: Alignment.center,
124
+          decoration: BoxDecoration(
125
+            color: Colors.red,
126
+            borderRadius: BorderRadius.circular(30),
127
+          ),
128
+
129
+          child: Text(
130
+            "Update",
131
+            style: TextStyle(fontSize: 22, color: Colors.white),
132
+          ),
133
+        ),
134
+      ),
135
+    );
136
+  }
137
+
138
+  Widget _Fills() {
139
+    return Column(
140
+        children: <Widget>[
141
+          _EntryField("First Name", first_name),
142
+          _EntryField("Last Name", last_name),
143
+          _EntryField("Country", country),
144
+          _EntryField("City", city),
145
+          _EntryField("Phone Number", phone),
146
+          _EntryField("Healthcare Provider", healthcare),
147
+        ]
148
+    );
149
+  }
150
+
151
+  Widget _EntryField(String title, TextEditingController controller,
152
+      {bool pass = false}) {
153
+    return Container(
154
+      padding: EdgeInsets.only(left: 0, top: 10, bottom: 10),
155
+      child: Column(
156
+          crossAxisAlignment: CrossAxisAlignment.start,
157
+
158
+          children: <Widget>[
159
+            Text(
160
+              title,
161
+              style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
162
+            ),
163
+            SizedBox(
164
+                height: 30
165
+            ),
166
+            TextField(
167
+              controller: controller,
168
+              obscureText: pass,
169
+              decoration: InputDecoration(
170
+                border: (
171
+                    UnderlineInputBorder()
172
+                ),
173
+              ),
174
+            )
175
+          ]
176
+      ),
177
+
178
+    );
179
+  }
180
+
181
+
182
+
183
+  @override
184
+  Widget build(BuildContext context) {
185
+    final height = MediaQuery.of(context).size.height;
186
+    return Scaffold(
187
+        body: Container(
188
+          height: height,
189
+          child: Stack(
190
+
191
+            children: <Widget>[
192
+              Container(
193
+                  padding: EdgeInsets.symmetric(horizontal: 20),
194
+                  child: SingleChildScrollView(
195
+                    child: Column(
196
+                      crossAxisAlignment: CrossAxisAlignment.center,
197
+                      mainAxisAlignment: MainAxisAlignment.center,
198
+                      children: <Widget>[
199
+                        SizedBox(
200
+                          height: 60,
201
+                        ),
202
+                        _Fills(),
203
+                        //Add code to verify if password and confirm password match
204
+                        SizedBox(
205
+                          height: 80,
206
+                        ),
207
+                        _SubmitButton(context),
208
+                        SizedBox(
209
+                          height: 50,
210
+                        ),
211
+                        // ElevatedButton(
212
+                        //     onPressed: send_data, child: Text("Register")),
213
+                      ],
214
+                    ),
215
+                  )
216
+              ),
217
+              // Positioned(
218
+              //   top: 15, left: 20, child: _BackButton(context),
219
+              // ),
220
+            ],
221
+
222
+          ),
223
+        )
224
+    );
225
+  }
226
+}

+ 274
- 0
fast_med_flutter/lib/register.dart 查看文件

@@ -0,0 +1,274 @@
1
+import 'dart:convert';
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 'package:http/http.dart' as http;
7
+import 'dart:convert' as convert;
8
+
9
+
10
+
11
+//
12
+//Still to add: 
13
+//  Email verification, that the input has "@" and "."
14
+//  Hash the passwords
15
+//  Allow users to login
16
+//  Verify password and confirm password match
17
+//
18
+
19
+class RegisterPage extends StatefulWidget{
20
+  
21
+  RegisterPage({Key key, this.title}) : super(key: key);
22
+  final String title;
23
+
24
+  @override
25
+  _RegisterPageState createState() => _RegisterPageState();
26
+}
27
+
28
+class _RegisterPageState extends State<RegisterPage> {
29
+  // TextEditingController name = new TextEditingController();
30
+  TextEditingController email = new TextEditingController();
31
+  TextEditingController password = new TextEditingController() ;
32
+  TextEditingController confirmpass = new TextEditingController();
33
+
34
+
35
+  Future<List> send_data() async {
36
+
37
+
38
+    var url = 'https://ada.uprrp.edu/~hector.sierra/FastMed/API/InsertUser.php';
39
+    final data = await http.post(url, body: {
40
+        "email": email.text,
41
+        "password": password.text,
42
+      });
43
+    print(data.body);
44
+    if("user not registered" == data.body){
45
+      print("maybe we use this");
46
+    }
47
+
48
+  }
49
+
50
+  bool _SamePass() {
51
+    if (password.text == confirmpass.text) {
52
+      return true;
53
+    }
54
+    else {
55
+      return false;
56
+    }
57
+  }
58
+
59
+  _Alerts(BuildContext context){
60
+
61
+    TextEditingController msg = new TextEditingController();
62
+
63
+
64
+   //
65
+   //Useful code for adding pop up messages with animations
66
+   //
67
+   //
68
+
69
+    // Navigator.of(context).push(
70
+    //
71
+    //   PageRouteBuilder(
72
+    //       transitionDuration: Duration(seconds: 2),
73
+    //       pageBuilder: (context, animation, secAnimation ) => AlertDialog(
74
+    //         title: Text("Testing"),
75
+    //         elevation: 1,
76
+    //         backgroundColor: Colors.transparent,
77
+    //
78
+    //       ),
79
+    //       opaque: false,
80
+    //   )
81
+    //
82
+    // );
83
+
84
+    showDialog<void>(
85
+      context: context,
86
+      barrierDismissible: false,
87
+      barrierColor: Colors.transparent,
88
+
89
+      builder: (BuildContext context){
90
+        Future.delayed(Duration(seconds: 2), () {
91
+          Navigator.of(context).pop(true);
92
+        });
93
+
94
+        return Material(
95
+          color: Colors.transparent,
96
+          child: InkResponse(
97
+            child: Container(
98
+
99
+              alignment: Alignment.bottomCenter,
100
+              padding: EdgeInsets.only(bottom: 30),
101
+              child: Text(
102
+                  "Email address is already registered",
103
+                  style: TextStyle(fontSize: 18, color: Colors.red),),
104
+
105
+            ),
106
+          )
107
+        );
108
+
109
+        // return Banner(
110
+        //   location: BannerLocation.bottomEnd,
111
+        //   message: "Hello there",
112
+        //
113
+        // );
114
+
115
+        // // allows the message to disappear
116
+        // Future.delayed(Duration(seconds: 2), () {
117
+        //   Navigator.of(context).pop(true);
118
+        // });
119
+        // return AlertDialog(
120
+        //   buttonPadding: ,
121
+        //   title: Text("Testing"),
122
+        //   elevation: 1,
123
+        //   backgroundColor: Colors.transparent,
124
+        // );
125
+      }
126
+    );
127
+  }
128
+
129
+
130
+
131
+  Widget _BackButton(BuildContext context) {
132
+    return InkWell(
133
+      onTap: () {
134
+        Navigator.pop(context);
135
+      },
136
+      child: Row(
137
+          children: <Widget>[
138
+            Container(
139
+              padding: EdgeInsets.only(left: 0, top: 10, bottom: 10),
140
+              child: Icon(Icons.arrow_back_ios, color: Colors.black),
141
+            ),
142
+            Text("Back",
143
+                style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500))
144
+          ]
145
+      ),
146
+    );
147
+  }
148
+
149
+  Widget _SubmitButton(BuildContext context) {
150
+    return InkResponse(
151
+      onTap: () {
152
+        send_data();
153
+        // _Alert(BuildContext);
154
+        // _Match(context);
155
+        _Alerts(context);
156
+      },
157
+      child: Material(
158
+        borderRadius: BorderRadius.circular(30),
159
+        elevation: 3,
160
+        child: Container(
161
+        padding: EdgeInsets.symmetric(vertical: 10),
162
+        width: 250,
163
+        alignment: Alignment.center,
164
+        decoration: BoxDecoration(
165
+          color: Colors.red,
166
+          borderRadius: BorderRadius.circular(30),
167
+        ),
168
+
169
+        child: Text(
170
+          "Submit",
171
+          style: TextStyle(fontSize: 22, color: Colors.white),
172
+        ),
173
+        ),
174
+      ),
175
+    );
176
+  }
177
+
178
+    Widget _EntryField(String title, TextEditingController controller,
179
+        {bool pass = false}) {
180
+      return Container(
181
+        padding: EdgeInsets.only(left: 0, top: 10, bottom: 10),
182
+        child: Column(
183
+            crossAxisAlignment: CrossAxisAlignment.start,
184
+
185
+            children: <Widget>[
186
+              Text(
187
+                title,
188
+                style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
189
+              ),
190
+              SizedBox(
191
+                  height: 30
192
+              ),
193
+              TextField(
194
+                controller: controller,
195
+                obscureText: pass,
196
+                decoration: InputDecoration(
197
+                  border: (
198
+                      UnderlineInputBorder()
199
+                  ),
200
+                ),
201
+              )
202
+            ]
203
+        ),
204
+
205
+      );
206
+    }
207
+
208
+    Widget _Fills() {
209
+      return Column(
210
+          children: <Widget>[
211
+            _EntryField("Email", email),
212
+            _EntryField("Password", password, pass: true),
213
+            _EntryField("Confirm Password", confirmpass, pass: true)
214
+
215
+          ]
216
+      );
217
+    }
218
+
219
+//add column or stack
220
+    @override
221
+    Widget build(BuildContext context) {
222
+      final height = MediaQuery
223
+          .of(context)
224
+          .size
225
+          .height;
226
+      return Scaffold(
227
+          body: Container(
228
+            height: height,
229
+            child: Stack(
230
+
231
+              children: <Widget>[
232
+                Container(
233
+                    padding: EdgeInsets.symmetric(horizontal: 20),
234
+                    child: SingleChildScrollView(
235
+                      child: Column(
236
+                        crossAxisAlignment: CrossAxisAlignment.center,
237
+                        mainAxisAlignment: MainAxisAlignment.center,
238
+                        children: <Widget>[
239
+                          // Text("Username", style: TextStyle(fontSize: 18.0),),
240
+                          // TextField(
241
+                          //   controller: name,
242
+                          //   decoration: InputDecoration(
243
+                          //       hintText: 'name'
244
+                          //   ),
245
+                          // ),
246
+                          SizedBox(
247
+                            height: 700,
248
+                          ),
249
+                          _Fills(),
250
+                          //Add code to verify if password and confirm password match
251
+                          SizedBox(
252
+                            height: 20,
253
+                          ),
254
+                          _SubmitButton(context),
255
+                          SizedBox(
256
+                            height: 10,
257
+                          ),
258
+                          // ElevatedButton(
259
+                          //     onPressed: send_data, child: Text("Register")),
260
+                        ],
261
+                      ),
262
+                    )
263
+                ),
264
+                Positioned(
265
+                  top: 15, left: 20, child: _BackButton(context),
266
+                ),
267
+              ],
268
+
269
+            ),
270
+          )
271
+      );
272
+    }
273
+  }
274
+

+ 0
- 347
fast_med_flutter/lib/routes/calendario.dart 查看文件

@@ -1,347 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-import 'package:intl/date_symbol_data_local.dart';
3
-import 'package:table_calendar/table_calendar.dart';
4
-
5
-// Dias sin Citas Disponibles
6
-final Map<DateTime, List> _holidays = {
7
-  DateTime(2020, 11, 6): ['No Hay Citas'],
8
-  DateTime(2020, 11, 3): ['Dia Elecciones'],
9
-
10
-};
11
-
12
-void main() {
13
-  initializeDateFormatting().then((_) => runApp(Calendario()));
14
-}
15
-
16
-
17
-
18
-class Calendario extends StatelessWidget {
19
-  @override
20
-  Widget build(BuildContext context) {
21
-    return MaterialApp(
22
-      title: 'Citas Disponibles',
23
-      theme: ThemeData(
24
-        primarySwatch: Colors.blue,
25
-      ),
26
-      home: MyHomePage(title: 'Citas Disponibles'),
27
-    );
28
-  }
29
-}
30
-
31
-class MyHomePage extends StatefulWidget {
32
-  MyHomePage({Key key, this.title}) : super(key: key);
33
-
34
-  final String title;
35
-
36
-  @override
37
-  _MyHomePageState createState() => _MyHomePageState();
38
-}
39
-
40
-class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
41
-  Map<DateTime, List> _events;
42
-  List _selectedEvents;
43
-  AnimationController _animationController;
44
-  CalendarController _calendarController;
45
-
46
-  @override
47
-  void initState() {
48
-    super.initState();
49
-    final _selectedDay = DateTime.now();
50
-
51
-    _events = {
52
-
53
-      _selectedDay.add(Duration(days: 3)): Set.from([ 'Cita Cardiologo', 'Cita Dentista']).toList(),
54
-      _selectedDay.add(Duration(days: 22)): ['Cita Cardiologo', 'Cita Dentista'],
55
-
56
-    };
57
-
58
-    _selectedEvents = _events[_selectedDay] ?? [];
59
-    _calendarController = CalendarController();
60
-
61
-    _animationController = AnimationController(
62
-      vsync: this,
63
-      duration: const Duration(milliseconds: 400),
64
-    );
65
-
66
-    _animationController.forward();
67
-  }
68
-
69
-  @override
70
-  void dispose() {
71
-    _animationController.dispose();
72
-    _calendarController.dispose();
73
-    super.dispose();
74
-  }
75
-
76
-  void _onDaySelected(DateTime day, List events, List holidays) {
77
-    print('CALLBACK: _onDaySelected');
78
-    setState(() {
79
-      _selectedEvents = events;
80
-    });
81
-  }
82
-
83
-  void _onVisibleDaysChanged(DateTime first, DateTime last, CalendarFormat format) {
84
-    print('CALLBACK: _onVisibleDaysChanged');
85
-  }
86
-
87
-  void _onCalendarCreated(DateTime first, DateTime last, CalendarFormat format) {
88
-    print('CALLBACK: _onCalendarCreated');
89
-  }
90
-
91
-  @override
92
-  Widget build(BuildContext context) {
93
-    return Scaffold(
94
-      appBar: AppBar(
95
-        title: Text(widget.title),
96
-      ),
97
-      body: Column(
98
-        mainAxisSize: MainAxisSize.max,
99
-        children: <Widget>[
100
-          // Switch out 2 lines below to play with TableCalendar's settings
101
-          //-----------------------
102
-          _buildTableCalendar(),
103
-          // _buildTableCalendarWithBuilders(),
104
-          const SizedBox(height: 8.0),
105
-          _buildButtons(),
106
-          const SizedBox(height: 8.0),
107
-          Expanded(child: _buildEventList()),
108
-        ],
109
-      ),
110
-    );
111
-  }
112
-  //Back button
113
-  Widget BackButton(BuildContext context){
114
-    return InkWell(
115
-      onTap: (){
116
-        Navigator.pop(context);
117
-      },
118
-      child: Row(
119
-          children: <Widget>[
120
-            Container(
121
-              padding: EdgeInsets.only(left: 0, top:10, bottom: 10),
122
-              child: Icon(Icons.arrow_back_ios, color: Colors.black),
123
-            ),
124
-            Text("Black",
125
-                style: TextStyle(fontSize: 12, fontWeight: FontWeight.w500))
126
-          ]
127
-      ),
128
-    );
129
-  }
130
-
131
-  // Simple TableCalendar configuration (using Styles)
132
-  Widget _buildTableCalendar() {
133
-    return TableCalendar(
134
-      calendarController: _calendarController,
135
-      events: _events,
136
-      holidays: _holidays,
137
-      startingDayOfWeek: StartingDayOfWeek.monday,
138
-      calendarStyle: CalendarStyle(
139
-        selectedColor: Colors.lightBlueAccent,
140
-        todayColor: Colors.blueAccent,
141
-        markersColor: Colors.brown,
142
-        outsideDaysVisible: false,
143
-      ),
144
-      headerStyle: HeaderStyle(
145
-        formatButtonTextStyle: TextStyle().copyWith(color: Colors.white, fontSize: 15.0),
146
-        formatButtonDecoration: BoxDecoration(
147
-          color: Colors.lightBlue,
148
-          borderRadius: BorderRadius.circular(16.0),
149
-        ),
150
-      ),
151
-      onDaySelected: _onDaySelected,
152
-      onVisibleDaysChanged: _onVisibleDaysChanged,
153
-      onCalendarCreated: _onCalendarCreated,
154
-    );
155
-  }
156
-
157
-  // More advanced TableCalendar configuration (using Builders & Styles)
158
-  Widget _buildTableCalendarWithBuilders() {
159
-    return TableCalendar(
160
-      locale: 'pl_PL',
161
-      calendarController: _calendarController,
162
-      events: _events,
163
-      holidays: _holidays,
164
-      initialCalendarFormat: CalendarFormat.month,
165
-      formatAnimation: FormatAnimation.slide,
166
-      startingDayOfWeek: StartingDayOfWeek.sunday,
167
-      availableGestures: AvailableGestures.all,
168
-      availableCalendarFormats: const {
169
-        CalendarFormat.month: '',
170
-        CalendarFormat.week: '',
171
-      },
172
-      calendarStyle: CalendarStyle(
173
-        outsideDaysVisible: false,
174
-        weekendStyle: TextStyle().copyWith(color: Colors.blue),
175
-        holidayStyle: TextStyle().copyWith(color: Colors.blue),
176
-      ),
177
-      daysOfWeekStyle: DaysOfWeekStyle(
178
-        weekendStyle: TextStyle().copyWith(color: Colors.blue),
179
-      ),
180
-      headerStyle: HeaderStyle(
181
-        centerHeaderTitle: true,
182
-        formatButtonVisible: false,
183
-      ),
184
-      builders: CalendarBuilders(
185
-        selectedDayBuilder: (context, date, _) {
186
-          return FadeTransition(
187
-            opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
188
-            child: Container(
189
-              margin: const EdgeInsets.all(4.0),
190
-              padding: const EdgeInsets.only(top: 5.0, left: 6.0),
191
-              color: Colors.green,
192
-              width: 100,
193
-              height: 100,
194
-              child: Text(
195
-                '${date.day}',
196
-                style: TextStyle().copyWith(fontSize: 16.0),
197
-              ),
198
-            ),
199
-          );
200
-        },
201
-        todayDayBuilder: (context, date, _) {
202
-          return Container(
203
-            margin: const EdgeInsets.all(4.0),
204
-            padding: const EdgeInsets.only(top: 5.0, left: 6.0),
205
-            color: Colors.amber,
206
-            width: 100,
207
-            height: 100,
208
-            child: Text(
209
-              '${date.day}',
210
-              style: TextStyle().copyWith(fontSize: 16.0),
211
-            ),
212
-          );
213
-        },
214
-        markersBuilder: (context, date, events, holidays) {
215
-          final children = <Widget>[];
216
-
217
-          if (events.isNotEmpty) {
218
-            children.add(
219
-              Positioned(
220
-                right: 1,
221
-                bottom: 1,
222
-                child: _buildEventsMarker(date, events),
223
-              ),
224
-            );
225
-          }
226
-
227
-          if (holidays.isNotEmpty) {
228
-            children.add(
229
-              Positioned(
230
-                right: -2,
231
-                top: -2,
232
-                child: _buildHolidaysMarker(),
233
-              ),
234
-            );
235
-          }
236
-
237
-          return children;
238
-        },
239
-      ),
240
-      onDaySelected: (date, events, holidays) {
241
-        _onDaySelected(date, events, holidays);
242
-        _animationController.forward(from: 0.0);
243
-      },
244
-      onVisibleDaysChanged: _onVisibleDaysChanged,
245
-      onCalendarCreated: _onCalendarCreated,
246
-    );
247
-  }
248
-
249
-  Widget _buildEventsMarker(DateTime date, List events) {
250
-    return AnimatedContainer(
251
-      duration: const Duration(milliseconds: 300),
252
-      decoration: BoxDecoration(
253
-        shape: BoxShape.rectangle,
254
-        color: _calendarController.isSelected(date)
255
-            ? Colors.brown[500]
256
-            : _calendarController.isToday(date) ? Colors.brown : Colors.blue,
257
-      ),
258
-      width: 16.0,
259
-      height: 16.0,
260
-      child: Center(
261
-        child: Text(
262
-          '${events.length}',
263
-          style: TextStyle().copyWith(
264
-            color: Colors.green,
265
-            fontSize: 12.0,
266
-          ),
267
-        ),
268
-      ),
269
-    );
270
-  }
271
-
272
-  Widget _buildHolidaysMarker() {
273
-    return Icon(
274
-      Icons.add_box,
275
-      size: 20.0,
276
-      color: Colors.blueGrey,
277
-    );
278
-  }
279
-
280
-  Widget _buildButtons() {
281
-    final dateTime = _events.keys.elementAt(_events.length - 2);
282
-
283
-    return Column(
284
-      children: <Widget>[
285
-        Row(
286
-          mainAxisSize: MainAxisSize.max,
287
-          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
288
-          children: <Widget>[
289
-            RaisedButton(
290
-              child: Text('Mes'),
291
-              onPressed: () {
292
-                setState(() {
293
-                  _calendarController.setCalendarFormat(CalendarFormat.month);
294
-                });
295
-              },
296
-            ),
297
-            RaisedButton(
298
-              child: Text('2 Semanas'),
299
-              onPressed: () {
300
-                setState(() {
301
-                  _calendarController.setCalendarFormat(CalendarFormat.twoWeeks);
302
-                });
303
-              },
304
-            ),
305
-            RaisedButton(
306
-              child: Text('Semana'),
307
-              onPressed: () {
308
-                setState(() {
309
-                  _calendarController.setCalendarFormat(CalendarFormat.week);
310
-                });
311
-              },
312
-            ),
313
-          ],
314
-        ),
315
-        const SizedBox(height: 8.0),
316
-        RaisedButton(
317
-          child: Text('Recuerde Cita ${dateTime.day}-${dateTime.month}-${dateTime.year}'),
318
-          onPressed: () {
319
-            _calendarController.setSelectedDay(
320
-              DateTime(dateTime.year, dateTime.month, dateTime.day),
321
-              runCallback: true,
322
-            );
323
-          },
324
-        ),
325
-      ],
326
-    );
327
-  }
328
-
329
-
330
-  Widget _buildEventList() {
331
-    return ListView(
332
-      children: _selectedEvents
333
-          .map((event) => Container(
334
-        decoration: BoxDecoration(
335
-          border: Border.all(width: 0.8),
336
-          borderRadius: BorderRadius.circular(12.0),
337
-        ),
338
-        margin: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
339
-        child: ListTile(
340
-          title: Text(event.toString()),
341
-          onTap: () => print('$event tapped!'),
342
-        ),
343
-      ))
344
-          .toList(),
345
-    );
346
-  }
347
-}

+ 0
- 87
fast_med_flutter/lib/routes/home.dart 查看文件

@@ -1,87 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-
3
-class Home extends StatefulWidget{
4
-  @override
5
-  _HomeState createState() => _HomeState();
6
-}
7
-
8
-class _HomeState extends State<Home>{
9
-  @override
10
-  Widget build(BuildContext context){
11
-    return Scaffold(
12
-      appBar: AppBar(
13
-        title: Text('Bienvenido'),
14
-        centerTitle: true,
15
-      ),
16
-      body: Center(
17
-        child: Column(
18
-          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
19
-          children: [
20
-            new FlatButton(
21
-              minWidth: 300.0,
22
-              height: 100.0,
23
-              onPressed: (){
24
-                Navigator.pushNamed(context, '/verOficinas');
25
-              },
26
-              child: Text('Ver Oficinas',
27
-                style: TextStyle(fontSize: 36),
28
-              ),
29
-              color: Colors.purple,
30
-
31
-            ),
32
-            new FlatButton(
33
-              minWidth: 300.0,
34
-              height: 100.0,
35
-              onPressed: (){
36
-                Navigator.pushNamed(context, '/calendario');
37
-              },
38
-              child: Text('Calendario',
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, '/register');
49
-              },
50
-              child: Text('register',
51
-                style: TextStyle(fontSize: 36),
52
-              ),
53
-              color: Colors.purple,
54
-
55
-            ),
56
-            new FlatButton(
57
-              minWidth: 300.0,
58
-              height: 100.0,
59
-              onPressed: (){
60
-                Navigator.pushNamed(context, '/welcome');
61
-              },
62
-              child: Text('welcome',
63
-                style: TextStyle(fontSize: 36),
64
-              ),
65
-              color: Colors.purple,
66
-
67
-            ),
68
-            new FlatButton(
69
-              minWidth: 300.0,
70
-              height: 100.0,
71
-              onPressed: (){
72
-                Navigator.pushNamed(context, '/MyApp');
73
-              },
74
-              child: Text('MyApp',
75
-                style: TextStyle(fontSize: 36),
76
-              ),
77
-              color: Colors.purple,
78
-
79
-            ),
80
-            ],
81
-        ),
82
-
83
-      ),
84
-
85
-    );
86
-  }
87
-}

+ 0
- 33
fast_med_flutter/lib/routes/main.dart 查看文件

@@ -1,33 +0,0 @@
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
-}

+ 0
- 161
fast_med_flutter/lib/routes/register.dart 查看文件

@@ -1,161 +0,0 @@
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
-

+ 0
- 91
fast_med_flutter/lib/routes/ver_oficinas.dart 查看文件

@@ -1,91 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-import '../widgets/DataTableMySqlDemo/Oficina.dart';
3
-import '../widgets/DataTableMySqlDemo/Services.dart';
4
-import 'dart:async';
5
-
6
-class VerOficinas extends StatefulWidget{
7
-  VerOficinas() : super();
8
-  final String title = 'Oficinas';
9
-  @override
10
-  State<StatefulWidget> viewOficinas() {
11
-    //no se que hago, quizas no lo necesite
12
-    return null;
13
-  }
14
-  _VerOficinasState createState() => _VerOficinasState();
15
-}
16
-
17
-class _VerOficinasState extends State<VerOficinas>{
18
-  List<Oficina> _oficinas;
19
-  List<Oficina> _filterOficinas;
20
-  GlobalKey<ScaffoldState> _scaffoldKey;
21
-  TextEditingController _nameController;//
22
-  Oficina _selectOficina;
23
-  bool _isUpdateing;
24
-
25
-  @override
26
-  void initState() {
27
-    super.initState();
28
-    _oficinas = [];
29
-    // _filterOficinas = [];
30
-    _isUpdateing = false;
31
-    _scaffoldKey = GlobalKey();
32
-    _nameController = TextEditingController();
33
-    _getOficinas();
34
-  }
35
-
36
-  _getOficinas() {
37
-
38
-    return _oficinas;
39
-  }
40
-
41
-
42
-  @override
43
-  Widget build(BuildContext context){
44
-    Services.getOficinas().then((Oficinas) {
45
-      setState(() {
46
-        _oficinas = Oficinas;
47
-        //print(_oficinas);
48
-        //print("Length ${Oficinas.length}");
49
-      });
50
-
51
-    });
52
-    List<Oficina> lista =  _oficinas;
53
-    return Scaffold(
54
-      key: _scaffoldKey,
55
-      appBar: AppBar(
56
-        title: Text('Oficinas'),
57
-        centerTitle: true,
58
-        backgroundColor: Colors.purple,
59
-
60
-      ),
61
-      body: Center(
62
-          child: Column(
63
-            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
64
-            children: lista.map((Oficina data) {
65
-              return FlatButton(
66
-                minWidth: 300.0,
67
-                height: 100.0,
68
-                child: Text(data.name,
69
-                style: TextStyle(fontSize: 36),
70
-                ),
71
-                onPressed: () {
72
-                  print(data.name);
73
-                },
74
-                padding: new EdgeInsets.all(0.0),
75
-                color: Colors.purple,
76
-
77
-              );
78
-            }).toList(),
79
-          ),
80
-          // child: FlatButton(
81
-          //   onPressed: (){
82
-          //     _getOficinas();
83
-          //   },
84
-          //   child: Text('Ver Oficinas'),
85
-          //   color: Colors.purple,
86
-          // )
87
-      ),
88
-
89
-    );
90
-  }
91
-}

fast_med_flutter/lib/routes/welcome.dart → fast_med_flutter/lib/welcome.dart 查看文件

@@ -1,10 +1,14 @@
1
-
2
-
1
+import 'dart:convert';
2
+// import 'dart:html';
3
+import 'dart:io';
4
+import 'package:flutter/cupertino.dart';
3 5
 import 'package:flutter_login/flutter_login.dart';
4 6
 import 'package:flutter/material.dart';
5 7
 import 'package:google_fonts/google_fonts.dart';
6 8
 import 'register.dart';
7
-
9
+import 'package:http/http.dart' as http;
10
+import 'dart:convert' as convert;
11
+import 'navigation.dart';
8 12
 
9 13
 
10 14
 
@@ -19,9 +23,34 @@ class WelcomePage extends StatefulWidget {
19 23
 }
20 24
 
21 25
 class _WelcomePageState extends State<WelcomePage> {
26
+  var Token;
27
+  TextEditingController email = new TextEditingController();
28
+  TextEditingController password = new TextEditingController();
29
+
30
+
31
+  Future<List> send_data() async {
32
+
33
+    var url = 'https://ada.uprrp.edu/~hector.sierra/FastMed/API/login.php';
34
+    http.Response response = await http.post(url, body: {
35
+      "email": email.text,
36
+      "password": password.text,
37
+    });
38
+    print(response.body);
39
+    print(response.statusCode);
40
+    print(HttpStatus.ok);
41
+    if("user not found" == response.body){
42
+      print("maybe we use this");
43
+    }
44
+    else{
45
+      print("User found");
46
+      Token = email.text;
47
+
48
+      // Navigator.push(
49
+      //     context, MaterialPageRoute(builder: (context) => NavigationPage()));
50
+
51
+    }
52
+  }
22 53
 
23
-  TextEditingController email;
24
-  TextEditingController password;
25 54
 
26 55
   Widget _message(BuildContext context){
27 56
     return RichText(
@@ -59,7 +88,7 @@ class _WelcomePageState extends State<WelcomePage> {
59 88
           children: <Widget> [
60 89
             Text(
61 90
               title,
62
-              style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
91
+              style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
63 92
             ),
64 93
             SizedBox(
65 94
                 height: 30
@@ -81,6 +110,8 @@ class _WelcomePageState extends State<WelcomePage> {
81 110
     );
82 111
   }
83 112
 
113
+
114
+
84 115
   Widget _Fills(){
85 116
     return Column(
86 117
         children: <Widget> [
@@ -93,31 +124,31 @@ class _WelcomePageState extends State<WelcomePage> {
93 124
 
94 125
 
95 126
 
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
-  // }
127
+
128
+  Widget _SubmitButton(BuildContext context){
129
+    return InkResponse(
130
+      onTap: (){
131
+
132
+        send_data();
133
+
134
+
135
+      },
136
+      child: Container(
137
+        padding: EdgeInsets.symmetric(vertical: 10),
138
+        width: 180,
139
+        alignment: Alignment.center,
140
+        decoration: BoxDecoration(
141
+          color: Colors.red,
142
+          borderRadius: BorderRadius.circular(30),
143
+        ),
144
+        child: Text(
145
+          "Login",
146
+          style: TextStyle(fontSize: 22, color: Colors.white),
147
+        ),
148
+      ),
149
+    );
150
+  }
151
+
121 152
 
122 153
   Widget _RegisterButton(BuildContext context){
123 154
     return InkWell(
@@ -183,13 +214,17 @@ class _WelcomePageState extends State<WelcomePage> {
183 214
                     SizedBox(
184 215
                       height: 60,
185 216
                     ),
217
+                    _SubmitButton(context),
218
+                    SizedBox(
219
+                      height: 45,
220
+                    ),
186 221
                     _message(context),
187 222
                     SizedBox(
188
-                      height: 10,
223
+                      height: 15,
189 224
                     ),
190 225
                     _RegisterButton(context),
191 226
                     SizedBox(
192
-                      height: 10,
227
+                      height: 20,
193 228
                     )
194 229
                   ],
195 230
                 )

+ 0
- 13
fast_med_flutter/lib/widgets/DataTableMySqlDemo/Oficina.dart 查看文件

@@ -1,13 +0,0 @@
1
-class Oficina {
2
-  String id;
3
-  String name;
4
-
5
-  Oficina({this.id, this.name});
6
-
7
-  factory Oficina.fromJson(Map<String, dynamic> json) {
8
-    return Oficina (
9
-      id :json['id'] as String,
10
-      name: json['name'] as String,
11
-    );
12
-  }
13
-}

+ 0
- 46
fast_med_flutter/lib/widgets/DataTableMySqlDemo/Services.dart 查看文件

@@ -1,46 +0,0 @@
1
-import 'dart:convert';
2
-import 'package:http/http.dart'
3
-  as http;
4
-import 'Oficina.dart';
5
-
6
-class Services {
7
-  static const URL = 'https://ada.uprrp.edu/~oniel.mendez2/json/oficinas.php';
8
-  static const URL_GET_ALL = 'ada.uprrp.edu/~oniel.mendez2/json/getOficinas.php';
9
-  static const URL_LOCAL = 'http://localhost/test/getOficinas.json';
10
-  static const _GET_ALL = "GET_ALL";
11
-
12
-  //get all oficinas
13
-  static Future<List<Oficina>> getOficinas() async {
14
-    try {
15
-      var map = Map<String, dynamic>();
16
-      map['action'] = _GET_ALL;
17
-      //print('antes');
18
-      final response = await http.get(URL_GET_ALL);
19
-      // print('despues');
20
-      // print('getOficinas Response: ${response.body}');
21
-      if (200 == response.statusCode) {
22
-        List<Oficina> list = parseResponse(response.body);
23
-
24
-        return list;
25
-      } else {
26
-        final response = '[{"id":"1","name":"no"},{"id":"2","name":"respondio"},{"id":"3","name":"code: 200"}]';
27
-        List<Oficina> list = parseResponse(response);
28
-        return list; // return an empty list on exception/error
29
-      }
30
-    } catch (e) {
31
-      final response = '[{"id":"1","name":"este"},{"id":"2","name":"es el"},{"id":"3","name":"catch(e)"}]';
32
-      List<Oficina> list = parseResponse(response);
33
-      return list; // return an empty list on exception/error
34
-    }
35
-  }
36
-
37
-  static List<Oficina> parseResponse(String responseBody) {
38
-    final parsed = json.decode(responseBody).cast<Map<String, dynamic>>();
39
-    return parsed.map<Oficina>((json) => Oficina.fromJson(json)).toList();
40
-  }
41
-
42
-  Future<http.Response> fetchAlbum() {
43
-    return http.get('https://jsonplaceholder.typicode.com/albums/1');
44
-  }
45
-
46
-}

+ 0
- 1
fast_med_flutter/lib/widgets/MySQL_DataTable/dud.dart 查看文件

@@ -1 +0,0 @@
1
-import 'dart:convert';

+ 0
- 0
fast_med_flutter/lib/widgets/data_table/dud.dart 查看文件


+ 0
- 1
fast_med_flutter/lib/widgets/dud.dart 查看文件

@@ -1 +0,0 @@
1
-import 'dart:convert';

+ 5
- 19
fast_med_flutter/pubspec.lock 查看文件

@@ -178,7 +178,7 @@ packages:
178 178
       name: path_provider
179 179
       url: "https://pub.dartlang.org"
180 180
     source: hosted
181
-    version: "1.6.24"
181
+    version: "1.6.22"
182 182
   path_provider_linux:
183 183
     dependency: transitive
184 184
     description:
@@ -192,21 +192,21 @@ packages:
192 192
       name: path_provider_macos
193 193
       url: "https://pub.dartlang.org"
194 194
     source: hosted
195
-    version: "0.0.4+6"
195
+    version: "0.0.4+4"
196 196
   path_provider_platform_interface:
197 197
     dependency: transitive
198 198
     description:
199 199
       name: path_provider_platform_interface
200 200
       url: "https://pub.dartlang.org"
201 201
     source: hosted
202
-    version: "1.0.4"
202
+    version: "1.0.3"
203 203
   path_provider_windows:
204 204
     dependency: transitive
205 205
     description:
206 206
       name: path_provider_windows
207 207
       url: "https://pub.dartlang.org"
208 208
     source: hosted
209
-    version: "0.0.4+3"
209
+    version: "0.0.4+1"
210 210
   pedantic:
211 211
     dependency: transitive
212 212
     description:
@@ -248,14 +248,7 @@ packages:
248 248
       name: quiver
249 249
       url: "https://pub.dartlang.org"
250 250
     source: hosted
251
-    version: "2.1.5"
252
-  simple_gesture_detector:
253
-    dependency: transitive
254
-    description:
255
-      name: simple_gesture_detector
256
-      url: "https://pub.dartlang.org"
257
-    source: hosted
258
-    version: "0.1.4"
251
+    version: "2.1.4+1"
259 252
   sky_engine:
260 253
     dependency: transitive
261 254
     description: flutter
@@ -289,13 +282,6 @@ packages:
289 282
       url: "https://pub.dartlang.org"
290 283
     source: hosted
291 284
     version: "1.1.0-nullsafety.1"
292
-  table_calendar:
293
-    dependency: "direct main"
294
-    description:
295
-      name: table_calendar
296
-      url: "https://pub.dartlang.org"
297
-    source: hosted
298
-    version: "2.3.0"
299 285
   term_glyph:
300 286
     dependency: transitive
301 287
     description:

+ 6
- 5
fast_med_flutter/pubspec.yaml 查看文件

@@ -1,5 +1,5 @@
1
-name: fast_med_flutter
2
-description: A new Flutter application.
1
+name: hello
2
+description: A new Flutter project.
3 3
 
4 4
 # The following line prevents the package from being accidentally published to
5 5
 # pub.dev using `pub publish`. This is preferred for private packages.
@@ -21,19 +21,20 @@ environment:
21 21
   sdk: ">=2.7.0 <3.0.0"
22 22
 
23 23
 dependencies:
24
+  http: ^0.12.2
24 25
   flutter:
25 26
     sdk: flutter
27
+  
28
+  
26 29
 
27 30
 
28 31
   # The following adds the Cupertino Icons font to your application.
29 32
   # Use with the CupertinoIcons class for iOS style icons.
30 33
   cupertino_icons: ^1.0.0
31
-  table_calendar: ^2,0,1
32 34
   flutter_login: ^1.0.14
33 35
   google_fonts: ^1.1.1
34 36
 
35
-  #
36
-  http: ^0.12.2
37
+
37 38
 
38 39
 dev_dependencies:
39 40
   flutter_test:

+ 2
- 2
fast_med_flutter/test/widget_test.dart 查看文件

@@ -8,12 +8,12 @@
8 8
 import 'package:flutter/material.dart';
9 9
 import 'package:flutter_test/flutter_test.dart';
10 10
 
11
-import 'package:fast_med_flutter/main.dart';
11
+import 'package:hello/main.dart';
12 12
 
13 13
 void main() {
14 14
   testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 15
     // Build our app and trigger a frame.
16
-    await tester.pumpWidget(MaterialApp());
16
+    await tester.pumpWidget(MyApp());
17 17
 
18 18
     // Verify that our counter starts at 0.
19 19
     expect(find.text('0'), findsOneWidget);