JorgeIan 3 years ago
parent
commit
c99cc96a40
100 changed files with 1966 additions and 418 deletions
  1. 0
    131
      Carlos/gps_fastmed.dart
  2. 0
    109
      Carlos/main.dart.rtf
  3. 0
    77
      Jorge/pubspec.yaml
  4. 0
    16
      README.md
  5. 0
    0
      fast_med_app/.gitignore
  6. 0
    0
      fast_med_app/.metadata
  7. 0
    0
      fast_med_app/README.md
  8. 0
    0
      fast_med_app/android/.gitignore
  9. 0
    0
      fast_med_app/android/app/build.gradle
  10. 0
    0
      fast_med_app/android/app/src/debug/AndroidManifest.xml
  11. 0
    0
      fast_med_app/android/app/src/main/AndroidManifest.xml
  12. 0
    0
      fast_med_app/android/app/src/main/kotlin/com/example/fast_med_flutter/MainActivity.kt
  13. 0
    0
      fast_med_app/android/app/src/main/res/drawable/launch_background.xml
  14. 0
    0
      fast_med_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
  15. 0
    0
      fast_med_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
  16. 0
    0
      fast_med_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  17. 0
    0
      fast_med_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  18. 0
    0
      fast_med_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  19. 0
    0
      fast_med_app/android/app/src/main/res/values/styles.xml
  20. 0
    0
      fast_med_app/android/app/src/profile/AndroidManifest.xml
  21. 0
    0
      fast_med_app/android/build.gradle
  22. 0
    0
      fast_med_app/android/gradle.properties
  23. 0
    0
      fast_med_app/android/gradle/wrapper/gradle-wrapper.properties
  24. 0
    0
      fast_med_app/android/settings.gradle
  25. 0
    0
      fast_med_app/ios/.gitignore
  26. 0
    0
      fast_med_app/ios/Flutter/AppFrameworkInfo.plist
  27. 0
    0
      fast_med_app/ios/Flutter/Debug.xcconfig
  28. 0
    0
      fast_med_app/ios/Flutter/Release.xcconfig
  29. 0
    0
      fast_med_app/ios/Runner.xcodeproj/project.pbxproj
  30. 0
    0
      fast_med_app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  31. 0
    0
      fast_med_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  32. 0
    0
      fast_med_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
  33. 0
    0
      fast_med_app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
  34. 0
    0
      fast_med_app/ios/Runner.xcworkspace/contents.xcworkspacedata
  35. 0
    0
      fast_med_app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  36. 0
    0
      fast_med_app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
  37. 0
    0
      fast_med_app/ios/Runner/AppDelegate.swift
  38. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
  39. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
  40. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
  41. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
  42. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
  43. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
  44. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
  45. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
  46. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
  47. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
  48. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
  49. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
  50. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
  51. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
  52. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
  53. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
  54. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
  55. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
  56. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
  57. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
  58. 0
    0
      fast_med_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
  59. 0
    0
      fast_med_app/ios/Runner/Base.lproj/LaunchScreen.storyboard
  60. 0
    0
      fast_med_app/ios/Runner/Base.lproj/Main.storyboard
  61. 0
    0
      fast_med_app/ios/Runner/Info.plist
  62. 0
    0
      fast_med_app/ios/Runner/Runner-Bridging-Header.h
  63. 0
    0
      fast_med_app/lib/classes/language.dart
  64. 0
    0
      fast_med_app/lib/languages/en.json
  65. 0
    0
      fast_med_app/lib/languages/es.json
  66. 1
    1
      fast_med_app/lib/localization/language_constants.dart
  67. 0
    0
      fast_med_app/lib/localization/localization.dart
  68. 10
    1
      fast_med_app/lib/main.dart
  69. 0
    0
      fast_med_app/lib/model/event.dart
  70. 1
    1
      fast_med_app/lib/pages/about_page.dart
  71. 5
    5
      fast_med_app/lib/pages/home_page.dart
  72. 0
    0
      fast_med_app/lib/pages/not_found_page.dart
  73. 4
    4
      fast_med_app/lib/pages/settings_page.dart
  74. 0
    0
      fast_med_app/lib/res/event_firestore_service.dart
  75. 5
    5
      fast_med_app/lib/router/custom_router.dart
  76. 0
    0
      fast_med_app/lib/router/route_constants.dart
  77. 60
    0
      fast_med_app/lib/routes/OfficeScreen.dart
  78. 69
    0
      fast_med_app/lib/routes/Offices.dart
  79. 85
    0
      fast_med_app/lib/routes/album.dart
  80. 135
    0
      fast_med_app/lib/routes/appointments.dart
  81. 229
    0
      fast_med_app/lib/routes/calendario.dart
  82. 39
    0
      fast_med_app/lib/routes/dynamic.dart
  83. 109
    0
      fast_med_app/lib/routes/especialidades.dart
  84. 37
    0
      fast_med_app/lib/routes/home.dart
  85. 0
    0
      fast_med_app/lib/routes/main.dart
  86. 88
    0
      fast_med_app/lib/routes/navigation.dart
  87. 226
    0
      fast_med_app/lib/routes/profileinfo.dart
  88. 274
    0
      fast_med_app/lib/routes/register.dart
  89. 8
    8
      fast_med_app/lib/routes/translation.dart
  90. 304
    0
      fast_med_app/lib/routes/ver_oficina.dart
  91. 15
    27
      fast_med_app/lib/routes/ver_oficinas.dart
  92. 68
    33
      fast_med_app/lib/routes/welcome.dart
  93. 0
    0
      fast_med_app/lib/ui/pages/add_event.dart
  94. 0
    0
      fast_med_app/lib/ui/pages/view_event.dart
  95. 32
    0
      fast_med_app/lib/widgets/DataTableMySqlDemo/Especialista.dart
  96. 29
    0
      fast_med_app/lib/widgets/DataTableMySqlDemo/Horario.dart
  97. 29
    0
      fast_med_app/lib/widgets/DataTableMySqlDemo/Oficina.dart
  98. 104
    0
      fast_med_app/lib/widgets/DataTableMySqlDemo/Services.dart
  99. 0
    0
      fast_med_app/lib/widgets/MySQL_DataTable/dud.dart
  100. 0
    0
      fast_med_app/lib/widgets/data_table/dud.dart

+ 0
- 131
Carlos/gps_fastmed.dart View File

@@ -1,131 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-import 'package:url_launcher/url_launcher.dart';
3
-
4
-
5
-void main() {
6
-  runApp(MyApp());
7
-}
8
-
9
-class MyApp extends StatelessWidget {
10
-  // This widget is the root of your application.
11
-  @override
12
-  Widget build(BuildContext context) {
13
-    return MaterialApp(
14
-      title: 'Flutter Demo',
15
-      theme: ThemeData(
16
-        // This is the theme of your application.
17
-        //
18
-        // Try running your application with "flutter run". You'll see the
19
-        // application has a blue toolbar. Then, without quitting the app, try
20
-        // changing the primarySwatch below to Colors.green and then invoke
21
-        // "hot reload" (press "r" in the console where you ran "flutter run",
22
-        // or simply save your changes to "hot reload" in a Flutter IDE).
23
-        // Notice that the counter didn't reset back to zero; the application
24
-        // is not restarted.
25
-        primarySwatch: Colors.blue,
26
-      ),
27
-      home: MyHomePage(title: 'Flutter Demo Home Page'),
28
-    );
29
-  }
30
-}
31
-
32
-class MyHomePage extends StatefulWidget {
33
-  MyHomePage({Key key, this.title}) : super(key: key);
34
-
35
-  // This widget is the home page of your application. It is stateful, meaning
36
-  // that it has a State object (defined below) that contains fields that affect
37
-  // how it looks.
38
-
39
-  // This class is the configuration for the state. It holds the values (in this
40
-  // case the title) provided by the parent (in this case the App widget) and
41
-  // used by the build method of the State. Fields in a Widget subclass are
42
-  // always marked "final".
43
-
44
-  final String title;
45
-
46
-  @override
47
-  _MyHomePageState createState() => _MyHomePageState();
48
-}
49
-
50
-class _MyHomePageState extends State<MyHomePage> {
51
-  int _counter = 0;
52
-
53
-  void _incrementCounter() async {
54
-    setState(() async {
55
-      String destinationLatitude = "18.39007092764153";
56
-      String destinationLongitude = "-65.976216841223";
57
-      String originlatitude = "18.418738017376207";
58
-      String originlongitude = "-66.02565531285634";
59
-
60
-      //const url = 'https://www.google.com/maps/@42.585444,13.007813,6z';
61
-      const url = "https://www.google.com/maps/dir/?api=1&parameters&origin=18.418738017376207,-66.02565531285634&destination=18.39007092764153,-65.976216841223";
62
-      if (await canLaunch(url)) {
63
-      await launch(url);
64
-      } else {
65
-      throw 'Could not launch $url';
66
-      }
67
-
68
-      //String uri = "http://maps.google.com/maps?daddr=" + destinationLatitude + "," + destinationLongitude + " (" + "Doctor" + ")";
69
-      //Intent intent;
70
-      //intent.setAction(Action.ACTION_VIEW);
71
-      //Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
72
-      //intent.setPackage("com.google.android.apps.maps");
73
-      //startActivity(intent);
74
-      //UIApplication.shared.openURL(URL(string:"https://www.google.com/maps/@42.585444,13.007813,6z")!);
75
-      _counter++;
76
-    });
77
-  }
78
-
79
-  @override
80
-  Widget build(BuildContext context) {
81
-    // This method is rerun every time setState is called, for instance as done
82
-    // by the _incrementCounter method above.
83
-    //
84
-    // The Flutter framework has been optimized to make rerunning build methods
85
-    // fast, so that you can just rebuild anything that needs updating rather
86
-    // than having to individually change instances of widgets.
87
-    return Scaffold(
88
-      appBar: AppBar(
89
-        // Here we take the value from the MyHomePage object that was created by
90
-        // the App.build method, and use it to set our appbar title.
91
-        title: Text(widget.title),
92
-      ),
93
-      body: Center(
94
-        // Center is a layout widget. It takes a single child and positions it
95
-        // in the middle of the parent.
96
-        child: Column(
97
-          // Column is also a layout widget. It takes a list of children and
98
-          // arranges them vertically. By default, it sizes itself to fit its
99
-          // children horizontally, and tries to be as tall as its parent.
100
-          //
101
-          // Invoke "debug painting" (press "p" in the console, choose the
102
-          // "Toggle Debug Paint" action from the Flutter Inspector in Android
103
-          // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
104
-          // to see the wireframe for each widget.
105
-          //
106
-          // Column has various properties to control how it sizes itself and
107
-          // how it positions its children. Here we use mainAxisAlignment to
108
-          // center the children vertically; the main axis here is the vertical
109
-          // axis because Columns are vertical (the cross axis would be
110
-          // horizontal).
111
-          mainAxisAlignment: MainAxisAlignment.center,
112
-          children: <Widget>[
113
-            Text(
114
-              'You have pushed the button this many times:',
115
-            ),
116
-            Text(
117
-              '$_counter',
118
-              style: Theme.of(context).textTheme.headline4,
119
-            ),
120
-          ],
121
-        ),
122
-      ),
123
-      floatingActionButton: FloatingActionButton(
124
-        onPressed: _incrementCounter,
125
-        tooltip: 'Increment',
126
-        child: Icon(Icons.add),
127
-      ), // This trailing comma makes auto-formatting nicer for build methods.
128
-    );
129
-  }
130
-}
131
-

+ 0
- 109
Carlos/main.dart.rtf View File

@@ -1,109 +0,0 @@
1
-{\rtf1\ansi\ansicpg1252\cocoartf2577
2
-\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 Menlo-Regular;\f1\fnil\fcharset0 Menlo-Italic;}
3
-{\colortbl;\red255\green255\blue255;\red191\green100\blue38;\red32\green32\blue32;\red88\green118\blue71;
4
-\red254\green187\blue91;\red153\green168\blue186;\red173\green169\blue32;\red133\green96\blue154;\red86\green132\blue173;
5
-}
6
-{\*\expandedcolortbl;;\csgenericrgb\c74902\c39216\c14902;\csgenericrgb\c12549\c12549\c12549;\csgenericrgb\c34510\c46275\c27843;
7
-\csgenericrgb\c99608\c73333\c35686;\csgenericrgb\c60000\c65882\c72941;\csgenericrgb\c67843\c66275\c12549;\csgenericrgb\c52157\c37647\c60392;\csgenericrgb\c33725\c51765\c67843;
8
-}
9
-\margl1440\margr1440\vieww11520\viewh8400\viewkind0
10
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0
11
-
12
-\f0\fs24 \cf2 \cb3 import \cf4 'package:flutter/material.dart'\cf2 ;\
13
-import \cf4 'package:userstory2translate/localization/localization.dart'\cf2 ;\
14
-import \cf4 'package:userstory2translate/router/custom_router.dart'\cf2 ;\
15
-import \cf4 'package:userstory2translate/router/route_constants.dart'\cf2 ;\
16
-import \cf4 'package:flutter_localizations/flutter_localizations.dart'\cf2 ;\
17
-\
18
-import \cf4 'localization/language_constants.dart'\cf2 ;\
19
-\
20
-void \cf5 main\cf6 () => runApp(\cf5 MyApp\cf6 ())\cf2 ;\
21
-\
22
-class \cf6 MyApp \cf2 extends \cf6 StatefulWidget \{\
23
-  \cf2 const \cf6 MyApp(\{Key key\}) : \cf2 super\cf6 (key: key)\cf2 ;\
24
-  static void 
25
-\f1\i \cf5 setLocale
26
-\f0\i0 \cf6 (BuildContext context\cf2 , \cf6 Locale newLocale) \{\
27
-    _MyAppState state = context.findAncestorStateOfType<_MyAppState>()\cf2 ;\
28
-    \cf6 state.setLocale(newLocale)\cf2 ;\
29
-  \cf6 \}\
30
-\
31
-  \cf7 @override\
32
-  \cf6 _MyAppState \cf5 createState\cf6 () => \cf5 _MyAppState\cf6 ()\cf2 ;\
33
-\cf6 \}\
34
-\
35
-\cf2 class \cf6 _MyAppState \cf2 extends \cf6 State<MyApp> \{\
36
-  Locale \cf8 _locale\cf2 ;\
37
-  \cf5 setLocale\cf6 (Locale locale) \{\
38
-    setState(() \{\
39
-      \cf8 _locale \cf6 = locale\cf2 ;\
40
-    \cf6 \})\cf2 ;\
41
-  \cf6 \}\
42
-\
43
-  \cf7 @override\
44
-  \cf2 void \cf5 didChangeDependencies\cf6 () \{\
45
-    getLocale().then((locale) \{\
46
-      setState(() \{\
47
-        \cf2 this\cf6 .\cf8 _locale \cf6 = locale\cf2 ;\
48
-      \cf6 \})\cf2 ;\
49
-    \cf6 \})\cf2 ;\
50
-    super\cf6 .didChangeDependencies()\cf2 ;\
51
-  \cf6 \}\
52
-\
53
-  \cf7 @override\
54
-  \cf6 Widget \cf5 build\cf6 (BuildContext context) \{\
55
-    \cf2 if \cf6 (\cf2 this\cf6 .\cf8 _locale \cf6 == \cf2 null\cf6 ) \{\
56
-      \cf2 return \cf5 Container\cf6 (\
57
-        child: \cf5 Center\cf6 (\
58
-          child: \cf5 CircularProgressIndicator\cf6 (\
59
-              valueColor: \cf5 AlwaysStoppedAnimation\cf6 <Color>(Colors.
60
-\f1\i \cf8 blue
61
-\f0\i0 \cf6 [\cf9 800\cf6 ]))\cf2 ,\
62
-        \cf6 )\cf2 ,\
63
-      \cf6 )\cf2 ;\
64
-    \cf6 \} \cf2 else \cf6 \{\
65
-      \cf2 return \cf5 MaterialApp\cf6 (\
66
-        debugShowCheckedModeBanner: \cf2 false,\
67
-        \cf6 title: \cf4 "Flutter Localization Demo"\cf2 ,\
68
-        \cf6 theme: \cf5 ThemeData\cf6 (primarySwatch: Colors.
69
-\f1\i \cf8 blue
70
-\f0\i0 \cf6 )\cf2 ,\
71
-        \cf6 locale: \cf8 _locale\cf2 ,\
72
-        \cf6 supportedLocales: [\
73
-          \cf5 Locale\cf6 (\cf4 "en"\cf2 , \cf4 "US"\cf6 )\cf2 ,\
74
-          \cf5 Locale\cf6 (\cf4 "fa"\cf2 , \cf4 "IR"\cf6 )\cf2 ,\
75
-          \cf5 Locale\cf6 (\cf4 "es"\cf2 , \cf4 "SP"\cf6 )\cf2 ,\
76
-          \cf5 Locale\cf6 (\cf4 "hi"\cf2 , \cf4 "IN"\cf6 )\
77
-        ]\cf2 ,\
78
-        \cf6 localizationsDelegates: [\
79
-          DemoLocalization.
80
-\f1\i \cf8 delegate
81
-\f0\i0 \cf2 ,\
82
-          \cf6 GlobalMaterialLocalizations.
83
-\f1\i \cf8 delegate
84
-\f0\i0 \cf2 ,\
85
-          \cf6 GlobalWidgetsLocalizations.
86
-\f1\i \cf8 delegate
87
-\f0\i0 \cf2 ,\
88
-          \cf6 GlobalCupertinoLocalizations.
89
-\f1\i \cf8 delegate
90
-\f0\i0 \cf2 ,\
91
-        \cf6 ]\cf2 ,\
92
-        \cf6 localeResolutionCallback: (locale\cf2 , \cf6 supportedLocales) \{\
93
-          \cf2 for \cf6 (\cf2 var \cf6 supportedLocale \cf2 in \cf6 supportedLocales) \{\
94
-            \cf2 if \cf6 (supportedLocale.\cf8 languageCode \cf6 == locale.\cf8 languageCode \cf6 &&\
95
-                supportedLocale.\cf8 countryCode \cf6 == locale.\cf8 countryCode\cf6 ) \{\
96
-              \cf2 return \cf6 supportedLocale\cf2 ;\
97
-            \cf6 \}\
98
-          \}\
99
-          \cf2 return \cf6 supportedLocales.\cf8 first\cf2 ;\
100
-        \cf6 \}\cf2 ,\
101
-        \cf6 onGenerateRoute: CustomRouter.
102
-\f1\i \cf5 generatedRoute
103
-\f0\i0 \cf2 ,\
104
-        \cf6 initialRoute: homeRoute\cf2 ,\
105
-      \cf6 )\cf2 ;\
106
-    \cf6 \}\
107
-  \}\
108
-\}\
109
-}

+ 0
- 77
Jorge/pubspec.yaml View File

@@ -1,77 +0,0 @@
1
-name: flutter_app7
2
-description: A new Flutter application.
3
-
4
-# The following line prevents the package from being accidentally published to
5
-# pub.dev using `pub publish`. This is preferred for private packages.
6
-publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7
-
8
-# The following defines the version and build number for your application.
9
-# A version number is three numbers separated by dots, like 1.2.43
10
-# followed by an optional build number separated by a +.
11
-# Both the version and the builder number may be overridden in flutter
12
-# build by specifying --build-name and --build-number, respectively.
13
-# In Android, build-name is used as versionName while build-number used as versionCode.
14
-# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15
-# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16
-# Read more about iOS versioning at
17
-# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18
-version: 1.0.0+1
19
-
20
-environment:
21
-  sdk: ">=2.7.0 <3.0.0"
22
-
23
-dependencies:
24
-  flutter:
25
-    sdk: flutter
26
-
27
-
28
-  # The following adds the Cupertino Icons font to your application.
29
-  # Use with the CupertinoIcons class for iOS style icons.
30
-  cupertino_icons: ^1.0.0
31
-  table_calendar: ^2,0,1
32
-
33
-dev_dependencies:
34
-  flutter_test:
35
-    sdk: flutter
36
-
37
-# For information on the generic Dart part of this file, see the
38
-# following page: https://dart.dev/tools/pub/pubspec
39
-
40
-# The following section is specific to Flutter.
41
-flutter:
42
-
43
-  # The following line ensures that the Material Icons font is
44
-  # included with your application, so that you can use the icons in
45
-  # the material Icons class.
46
-  uses-material-design: true
47
-
48
-  # To add assets to your application, add an assets section, like this:
49
-  # assets:
50
-  #   - images/a_dot_burr.jpeg
51
-  #   - images/a_dot_ham.jpeg
52
-
53
-  # An image asset can refer to one or more resolution-specific "variants", see
54
-  # https://flutter.dev/assets-and-images/#resolution-aware.
55
-
56
-  # For details regarding adding assets from package dependencies, see
57
-  # https://flutter.dev/assets-and-images/#from-packages
58
-
59
-  # To add custom fonts to your application, add a fonts section here,
60
-  # in this "flutter" section. Each entry in this list should have a
61
-  # "family" key with the font family name, and a "fonts" key with a
62
-  # list giving the asset and other descriptors for the font. For
63
-  # example:
64
-  # fonts:
65
-  #   - family: Schyler
66
-  #     fonts:
67
-  #       - asset: fonts/Schyler-Regular.ttf
68
-  #       - asset: fonts/Schyler-Italic.ttf
69
-  #         style: italic
70
-  #   - family: Trajan Pro
71
-  #     fonts:
72
-  #       - asset: fonts/TrajanPro.ttf
73
-  #       - asset: fonts/TrajanPro_Bold.ttf
74
-  #         weight: 700
75
-  #
76
-  # For details regarding fonts from package dependencies,
77
-  # see https://flutter.dev/custom-fonts/#from-packages

+ 0
- 16
README.md View File

@@ -1,16 +0,0 @@
1
-# flutter_app7
2
-
3
-A new Flutter application.
4
-
5
-## Getting Started
6
-
7
-This project is a starting point for a Flutter application.
8
-
9
-A few resources to get you started if this is your first Flutter project:
10
-
11
-- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12
-- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13
-
14
-For help getting started with Flutter, view our
15
-[online documentation](https://flutter.dev/docs), which offers tutorials,
16
-samples, guidance on mobile development, and a full API reference.

fast_med_flutter/.gitignore → fast_med_app/.gitignore View File


fast_med_flutter/.metadata → fast_med_app/.metadata View File


fast_med_flutter/README.md → fast_med_app/README.md View File


fast_med_flutter/android/.gitignore → fast_med_app/android/.gitignore View File


fast_med_flutter/android/app/build.gradle → fast_med_app/android/app/build.gradle View File


fast_med_flutter/android/app/src/profile/AndroidManifest.xml → fast_med_app/android/app/src/debug/AndroidManifest.xml View File


fast_med_flutter/android/app/src/main/AndroidManifest.xml → fast_med_app/android/app/src/main/AndroidManifest.xml View File


fast_med_flutter/android/app/src/main/kotlin/com/example/fast_med_flutter/MainActivity.kt → fast_med_app/android/app/src/main/kotlin/com/example/fast_med_flutter/MainActivity.kt View File


fast_med_flutter/android/app/src/main/res/drawable/launch_background.xml → fast_med_app/android/app/src/main/res/drawable/launch_background.xml View File


fast_med_flutter/android/app/src/main/res/mipmap-hdpi/ic_launcher.png → fast_med_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png View File


fast_med_flutter/android/app/src/main/res/mipmap-mdpi/ic_launcher.png → fast_med_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png View File


fast_med_flutter/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png → fast_med_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png View File


fast_med_flutter/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png → fast_med_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png View File


fast_med_flutter/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png → fast_med_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png View File


fast_med_flutter/android/app/src/main/res/values/styles.xml → fast_med_app/android/app/src/main/res/values/styles.xml View File


fast_med_flutter/android/app/src/debug/AndroidManifest.xml → fast_med_app/android/app/src/profile/AndroidManifest.xml View File


fast_med_flutter/android/build.gradle → fast_med_app/android/build.gradle View File


fast_med_flutter/android/gradle.properties → fast_med_app/android/gradle.properties View File


fast_med_flutter/android/gradle/wrapper/gradle-wrapper.properties → fast_med_app/android/gradle/wrapper/gradle-wrapper.properties View File


fast_med_flutter/android/settings.gradle → fast_med_app/android/settings.gradle View File


fast_med_flutter/ios/.gitignore → fast_med_app/ios/.gitignore View File


fast_med_flutter/ios/Flutter/AppFrameworkInfo.plist → fast_med_app/ios/Flutter/AppFrameworkInfo.plist View File


fast_med_flutter/ios/Flutter/Debug.xcconfig → fast_med_app/ios/Flutter/Debug.xcconfig View File


fast_med_flutter/ios/Flutter/Release.xcconfig → fast_med_app/ios/Flutter/Release.xcconfig View File


fast_med_flutter/ios/Runner.xcodeproj/project.pbxproj → fast_med_app/ios/Runner.xcodeproj/project.pbxproj View File


fast_med_flutter/ios/Runner.xcworkspace/contents.xcworkspacedata → fast_med_app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata View File


fast_med_flutter/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist → fast_med_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist View File


fast_med_flutter/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings → fast_med_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings View File


fast_med_flutter/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme → fast_med_app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme View File


fast_med_flutter/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata → fast_med_app/ios/Runner.xcworkspace/contents.xcworkspacedata View File


fast_med_flutter/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist → fast_med_app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist View File


fast_med_flutter/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings → fast_med_app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings View File


fast_med_flutter/ios/Runner/AppDelegate.swift → fast_med_app/ios/Runner/AppDelegate.swift View File


fast_med_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json → fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json View File


fast_med_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png → fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png → fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png → fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png → fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png → fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png → fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png → fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png → fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png → fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png → fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png → fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png → fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png → fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png → fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png → fast_med_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json → fast_med_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json View File


fast_med_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png → fast_med_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png → fast_med_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png → fast_med_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png View File


fast_med_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md → fast_med_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md View File


fast_med_flutter/ios/Runner/Base.lproj/LaunchScreen.storyboard → fast_med_app/ios/Runner/Base.lproj/LaunchScreen.storyboard View File


fast_med_flutter/ios/Runner/Base.lproj/Main.storyboard → fast_med_app/ios/Runner/Base.lproj/Main.storyboard View File


fast_med_flutter/ios/Runner/Info.plist → fast_med_app/ios/Runner/Info.plist View File


fast_med_flutter/ios/Runner/Runner-Bridging-Header.h → fast_med_app/ios/Runner/Runner-Bridging-Header.h View File


Carlos/language.dart → fast_med_app/lib/classes/language.dart View File


Carlos/en.json → fast_med_app/lib/languages/en.json View File


Carlos/es.json → fast_med_app/lib/languages/es.json View File


Carlos/language_constants.dart → fast_med_app/lib/localization/language_constants.dart View File

@@ -1,5 +1,5 @@
1 1
 import 'package:flutter/material.dart';
2
-import 'package:userstory2translate/localization/localization.dart';
2
+import '../localization/localization.dart';
3 3
 import 'package:shared_preferences/shared_preferences.dart';
4 4
 
5 5
 const String LAGUAGE_CODE = 'languageCode';

Carlos/localization.dart → fast_med_app/lib/localization/localization.dart View File


fast_med_flutter/lib/main.dart → fast_med_app/lib/main.dart View File

@@ -1,19 +1,28 @@
1 1
 import 'package:fast_med_flutter/routes/home.dart';
2 2
 import 'package:fast_med_flutter/routes/ver_oficinas.dart';
3
+import 'package:fast_med_flutter/routes/ver_oficina.dart';
3 4
 import 'package:fast_med_flutter/routes/calendario.dart';
4 5
 import 'package:fast_med_flutter/routes/main.dart';
5 6
 import 'package:fast_med_flutter/routes/register.dart';
6 7
 import 'package:fast_med_flutter/routes/welcome.dart';
8
+import 'package:fast_med_flutter/routes/album.dart';
7 9
 import 'package:flutter/material.dart';
10
+import 'package:fast_med_flutter/routes/especialidades.dart';
11
+import 'routes/translation.dart';
8 12
 
9 13
 void main() => runApp(MaterialApp(
10
-    initialRoute: '/home',
14
+    initialRoute: '/welcome',
11 15
     routes: {
12 16
       '/home': (context) => Home(),
13 17
       '/verOficinas': (context) => VerOficinas(),
18
+      '/ver/oficina': (context) => VerOficina(),
14 19
       '/calendario': (context) => Calendario(),
15 20
       '/welcome': (context) => WelcomePage(),
16 21
       '/register': (context) => RegisterPage(),
17 22
       '/MyApp': (context) => MyApp(),
23
+      '/album': (context) => album(),
24
+      '/especialidades': (context) => especialidades(),
25
+      '/translation': (context) => translation(),
26
+
18 27
     }
19 28
 ));

fast_med_flutter/lib/model/event.dart → fast_med_app/lib/model/event.dart View File


Carlos/about_page.dart → fast_med_app/lib/pages/about_page.dart View File

@@ -1,5 +1,5 @@
1 1
 import 'package:flutter/material.dart';
2
-import 'package:userstory2translate/localization/language_constants.dart';
2
+import '../localization/language_constants.dart';
3 3
 
4 4
 class AboutPage extends StatefulWidget {
5 5
   AboutPage({Key key}) : super(key: key);

Carlos/home_page.dart → fast_med_app/lib/pages/home_page.dart View File

@@ -1,8 +1,8 @@
1 1
 import 'package:flutter/material.dart';
2
-import 'package:userstory2translate/classes/language.dart';
3
-import 'package:userstory2translate/localization/language_constants.dart';
4
-import 'package:userstory2translate/main.dart';
5
-import 'package:userstory2translate/router/route_constants.dart';
2
+import '../classes/language.dart';
3
+import '../localization/language_constants.dart';
4
+import '../routes/translation.dart';
5
+import '../router/route_constants.dart';
6 6
 
7 7
 class HomePage extends StatefulWidget {
8 8
   HomePage({Key key}) : super(key: key);
@@ -15,7 +15,7 @@ class _HomePageState extends State<HomePage> {
15 15
   final GlobalKey<FormState> _key = GlobalKey<FormState>();
16 16
   void _changeLanguage(Language language) async {
17 17
     Locale _locale = await setLocale(language.languageCode);
18
-    MyApp.setLocale(context, _locale);
18
+    translation.setLocale(context, _locale);
19 19
   }
20 20
 
21 21
   void _showSuccessDialog() {

Carlos/not_found_page.dart → fast_med_app/lib/pages/not_found_page.dart View File


Carlos/settings_page.dart → fast_med_app/lib/pages/settings_page.dart View File

@@ -1,7 +1,7 @@
1 1
 import 'package:flutter/material.dart';
2
-import 'package:userstory2translate/classes/language.dart';
3
-import 'package:userstory2translate/localization/language_constants.dart';
4
-import 'package:userstory2translate/main.dart';
2
+import '../classes/language.dart';
3
+import '../localization/language_constants.dart';
4
+import '../routes/translation.dart';
5 5
 
6 6
 class SettingsPage extends StatefulWidget {
7 7
   SettingsPage({Key key}) : super(key: key);
@@ -13,7 +13,7 @@ class SettingsPage extends StatefulWidget {
13 13
 class _SettingsPageState extends State<SettingsPage> {
14 14
   void _changeLanguage(Language language) async {
15 15
     Locale _locale = await setLocale(language.languageCode);
16
-    MyApp.setLocale(context, _locale);
16
+    translation.setLocale(context, _locale);
17 17
   }
18 18
 
19 19
   @override

fast_med_flutter/lib/res/event_firestore_service.dart → fast_med_app/lib/res/event_firestore_service.dart View File


Carlos/custom_router.dart → fast_med_app/lib/router/custom_router.dart View File

@@ -1,9 +1,9 @@
1 1
 import 'package:flutter/material.dart';
2
-import 'package:userstory2translate/pages/about_page.dart';
3
-import 'package:userstory2translate/pages/home_page.dart';
4
-import 'package:userstory2translate/pages/not_found_page.dart';
5
-import 'package:userstory2translate/pages/settings_page.dart';
6
-import 'package:userstory2translate/router/route_constants.dart';
2
+import '../pages/about_page.dart';
3
+import '../pages/home_page.dart';
4
+import '../pages/not_found_page.dart';
5
+import '../pages/settings_page.dart';
6
+import '../router/route_constants.dart';
7 7
 
8 8
 class CustomRouter {
9 9
   static Route<dynamic> generatedRoute(RouteSettings settings) {

Carlos/route_constants.dart → fast_med_app/lib/router/route_constants.dart View File


+ 60
- 0
fast_med_app/lib/routes/OfficeScreen.dart View File

@@ -0,0 +1,60 @@
1
+import 'package:flutter/material.dart';
2
+import 'dart:convert';
3
+import 'Offices.dart';
4
+import '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
+    return Scaffold(
40
+
41
+      appBar: AppBar(
42
+        title: Text('Todos'),
43
+      ),
44
+      //passing in the ListView.builder
45
+      body: ListView.builder(
46
+        itemCount: offlist.length,
47
+        itemBuilder: (context, index) {
48
+          return ListTile(
49
+              title: Text(offlist[index].office),
50
+              onTap: (){
51
+                Navigator.push(context, MaterialPageRoute(builder: (context) => 
52
+                AppointmentPage(O: offlist[index])),
53
+                );
54
+              },
55
+          );
56
+        },
57
+      ),
58
+    );
59
+  }
60
+}

+ 69
- 0
fast_med_app/lib/routes/Offices.dart View File

@@ -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
+

+ 85
- 0
fast_med_app/lib/routes/album.dart View File

@@ -0,0 +1,85 @@
1
+import 'dart:async';
2
+import 'dart:convert';
3
+import 'dart:io';
4
+
5
+import 'package:flutter/material.dart';
6
+import 'package:flutter/services.dart';
7
+import 'package:http/http.dart' as http;
8
+
9
+Future<Oficina> fetchOficina() async {
10
+  final response =
11
+  await http.get('https://ada.uprrp.edu/~oniel.mendez2/json/getOficinas.php');
12
+
13
+  if (response.statusCode == 200) {
14
+    return Oficina.fromJson(jsonDecode(response.body));
15
+  } else {
16
+    throw Exception('Failed to load album');
17
+  }
18
+}
19
+
20
+class Oficina {
21
+  String id;
22
+  String name;
23
+
24
+  Oficina({this.id, this.name});
25
+
26
+  factory Oficina.fromJson(Map<String, dynamic> json) {
27
+    return Oficina (
28
+      id :json['id'],
29
+      name: json['name'],
30
+    );
31
+  }
32
+}
33
+
34
+
35
+Future<void> main() async {
36
+  runApp(album());
37
+}
38
+class album extends StatefulWidget {
39
+
40
+  album({Key key}) : super(key: key);
41
+
42
+  @override
43
+  _MyAppState2 createState() => _MyAppState2();
44
+}
45
+
46
+
47
+class _MyAppState2 extends State<album> {
48
+  Future<Oficina> futureOficina;
49
+
50
+  @override
51
+  void initState() {
52
+    super.initState();
53
+    futureOficina = fetchOficina();
54
+  }
55
+
56
+  @override
57
+  Widget build(BuildContext context) {
58
+    return MaterialApp(
59
+      title: 'Fetch Data Example',
60
+      theme: ThemeData(
61
+        primarySwatch: Colors.blue,
62
+      ),
63
+      home: Scaffold(
64
+        appBar: AppBar(
65
+          title: Text('Fetch Data Example'),
66
+        ),
67
+        body: Center(
68
+          child: FutureBuilder<Oficina>(
69
+            future: futureOficina,
70
+            builder: (context, snapshot) {
71
+              if (snapshot.hasData) {
72
+                return Text(snapshot.data.name);
73
+              } else if (snapshot.hasError) {
74
+                return Text("${snapshot.error}");
75
+              }
76
+
77
+              // By default, show a loading spinner.
78
+              return CircularProgressIndicator();
79
+            },
80
+          ),
81
+        ),
82
+      ),
83
+    );
84
+  }
85
+}

+ 135
- 0
fast_med_app/lib/routes/appointments.dart View File

@@ -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 '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
+}

+ 229
- 0
fast_med_app/lib/routes/calendario.dart View File

@@ -0,0 +1,229 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:fast_med_flutter/ui/pages/add_event.dart';
3
+import 'package:fast_med_flutter/ui/pages/view_event.dart';
4
+import 'package:table_calendar/table_calendar.dart';
5
+import 'package:http/http.dart' as http;
6
+
7
+import 'package:fast_med_flutter/model/event.dart';
8
+
9
+// Dias de Citas No Disponibles
10
+
11
+final Map<DateTime, List> _holidays = {
12
+  DateTime(2020, 11, 6): ['No Hay Citas'],
13
+  DateTime(2020, 11, 3): ['Dia Elecciones'],
14
+  DateTime(2020, 12, 25): ['Christmas'],
15
+  DateTime(2020, 12, 31): ['Despedida del anyo nuevo'],
16
+  DateTime(2021, 01, 01): ['Anyo Nuevo'],
17
+};
18
+
19
+//Iniciar la Seccion de las Citas
20
+
21
+void main() async{
22
+
23
+  //Comunicacion con el servidor antes de iniciar el app
24
+
25
+  var url = 'https://ada.uprrp.edu/~jorge.lopez19/FastMed/API/InsertEvent.php';
26
+  WidgetsFlutterBinding.ensureInitialized();
27
+  final data = await http.post(url, body: {
28
+  });
29
+  runApp(Calendario());
30
+
31
+}
32
+
33
+//Inicio del Area de las Citas Disponibles
34
+
35
+class Calendario extends StatelessWidget {
36
+  @override
37
+  Widget build(BuildContext context) {
38
+    return MaterialApp(
39
+      title: 'Citas Disponibles',
40
+      theme: ThemeData(
41
+        primarySwatch: Colors.blue,
42
+      ),
43
+      home: MyHomePage(),
44
+      routes: {
45
+        "add_event": (_) => AddEventPage(),
46
+      },
47
+    );
48
+  }
49
+}
50
+
51
+
52
+// Define el homepage para el area de citas
53
+
54
+class MyHomePage extends StatefulWidget {
55
+  @override
56
+  _MyHomePageState createState() => _MyHomePageState();
57
+}
58
+
59
+class _MyHomePageState extends State<MyHomePage> {
60
+  CalendarController _controller;
61
+  Map<DateTime, List<dynamic>> _events;
62
+  List<dynamic> _selectedEvents;
63
+
64
+  @override
65
+  void initState() {
66
+    super.initState();
67
+    final _selectedDay = DateTime.now();
68
+    _controller = CalendarController();
69
+    _events = {
70
+      //Ejemplos de Citas Previamente Hechas de Prueba Para los Recordatorios
71
+      _selectedDay.add(Duration(days: 3)): Set.from(
72
+          [ 'Cita Cardiologo', 'Cita Dentista']).toList(),
73
+      _selectedDay.add(Duration(days: 22)): [
74
+        'Cita Cardiologo',
75
+        'Cita Dentista'
76
+      ],
77
+    };
78
+    _selectedEvents = _events[_selectedDay] ?? [];
79
+    void _onDaySelected(DateTime day, List events, List holidays) {
80
+      print('CALLBACK: _onDaySelected');
81
+      setState(() {
82
+        _selectedEvents = _events[_selectedDay] ?? [];
83
+      });
84
+    }
85
+  }
86
+
87
+  Map<String, dynamic> encodeMap(Map<DateTime, dynamic> map) {
88
+    Map<String, dynamic> newMap = {};
89
+    map.forEach((key, value) {
90
+      newMap[key.toString()] = map[key];
91
+    });
92
+    return newMap;
93
+  }
94
+
95
+  Map<DateTime, List<dynamic>> _groupEvents(List<EventModel> events) {
96
+    Map<DateTime, List<dynamic>> data = {};
97
+    events.forEach((event) {
98
+      DateTime date = DateTime(event.eventDate.year, event.eventDate.month,
99
+          event.eventDate.day, 12);
100
+      if (data[date] == null) data[date] = [];
101
+      data[date].add(event);
102
+    });
103
+    return data;
104
+  }
105
+
106
+
107
+  @override
108
+//Marca en el calendario los dias que no esta disponibles para hacer horarios
109
+  void _onDaySelected(DateTime day, List events, List holidays) {
110
+    print('CALLBACK: _onDaySelected');
111
+    setState(() {
112
+      _selectedEvents = events;
113
+    });
114
+  }
115
+
116
+  void _onVisibleDaysChanged(DateTime first, DateTime last,
117
+      CalendarFormat format) {
118
+    print('CALLBACK: _onVisibleDaysChanged');
119
+  }
120
+
121
+  void _onCalendarCreated(DateTime first, DateTime last,
122
+      CalendarFormat format) {
123
+    print('CALLBACK: _onCalendarCreated');
124
+  }
125
+
126
+//Definimos los detalles del area de las citas
127
+  @override
128
+  Widget build(BuildContext context) {
129
+    return Scaffold(
130
+      appBar: AppBar(
131
+        title: Text('Citas Disponibles'),
132
+      ),
133
+      body: StreamBuilder<List<EventModel>>(
134
+        // stream: eventDBS.streamList(),
135
+          builder: (context, snapshot) {
136
+            if (snapshot.hasData) {
137
+              List<EventModel> allEvents = snapshot.data;
138
+              if (allEvents.isNotEmpty) {
139
+                _events = _groupEvents(allEvents);
140
+              }
141
+            }
142
+
143
+            return SingleChildScrollView(
144
+              child: Column(
145
+                crossAxisAlignment: CrossAxisAlignment.start,
146
+                children: <Widget>[
147
+                  TableCalendar(
148
+                    events: _events,
149
+                    holidays: _holidays,
150
+                    initialCalendarFormat: CalendarFormat.month,
151
+                    calendarStyle: CalendarStyle(
152
+                        canEventMarkersOverflow: true,
153
+                        todayColor: Colors.orange,
154
+                        selectedColor: Theme
155
+                            .of(context)
156
+                            .primaryColor,
157
+                        todayStyle: TextStyle(
158
+                            fontWeight: FontWeight.bold,
159
+                            fontSize: 18.0,
160
+                            color: Colors.white)),
161
+                    headerStyle: HeaderStyle(
162
+                      centerHeaderTitle: true,
163
+                      formatButtonDecoration: BoxDecoration(
164
+                        color: Colors.orange,
165
+                        borderRadius: BorderRadius.circular(20.0),
166
+                      ),
167
+                      formatButtonTextStyle: TextStyle(color: Colors.white),
168
+                      formatButtonShowsNext: false,
169
+                    ),
170
+                    startingDayOfWeek: StartingDayOfWeek.monday,
171
+                    onVisibleDaysChanged: _onVisibleDaysChanged,
172
+                    onCalendarCreated: _onCalendarCreated,
173
+
174
+                    builders: CalendarBuilders(
175
+                      selectedDayBuilder: (context, date, events) =>
176
+                          Container(
177
+                              margin: const EdgeInsets.all(4.0),
178
+                              alignment: Alignment.center,
179
+                              decoration: BoxDecoration(
180
+                                  color: Theme
181
+                                      .of(context)
182
+                                      .primaryColor,
183
+                                  borderRadius: BorderRadius.circular(10.0)),
184
+                              child: Text(
185
+                                date.day.toString(),
186
+                                style: TextStyle(color: Colors.white),
187
+                              )),
188
+                      todayDayBuilder: (context, date, events) =>
189
+                          Container(
190
+                              margin: const EdgeInsets.all(4.0),
191
+                              alignment: Alignment.center,
192
+                              decoration: BoxDecoration(
193
+                                  color: Colors.orange,
194
+                                  borderRadius: BorderRadius.circular(10.0)),
195
+                              child: Text(
196
+                                date.day.toString(),
197
+                                style: TextStyle(color: Colors.white),
198
+                              )),
199
+                    ),
200
+                    calendarController: _controller,
201
+                  ),
202
+                  ..._selectedEvents.map((event) =>
203
+                      ListTile(
204
+                        title: Text(event.title),
205
+                        onTap: () {
206
+                          Navigator.push(
207
+                              context,
208
+                              MaterialPageRoute(
209
+                                  builder: (_) =>
210
+                                      EventDetailsPage(
211
+                                        event: event,
212
+                                      )));
213
+                        },
214
+                      )),
215
+                ],
216
+              ),
217
+            );
218
+          }
219
+      ),
220
+      floatingActionButton: FloatingActionButton(
221
+        child: Icon(Icons.add),
222
+        onPressed: () => Navigator.pushNamed(context, 'add_event'),
223
+      ),
224
+    );
225
+  }
226
+}
227
+
228
+
229
+

+ 39
- 0
fast_med_app/lib/routes/dynamic.dart View File

@@ -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
+}

+ 109
- 0
fast_med_app/lib/routes/especialidades.dart View File

@@ -0,0 +1,109 @@
1
+import 'package:flutter/material.dart';
2
+import 'dart:convert';
3
+import 'package:json_table/json_table.dart';
4
+
5
+class SimpleTable extends StatefulWidget {
6
+  @override
7
+  _SimpleTableState createState() => _SimpleTableState();
8
+}
9
+
10
+class _SimpleTableState extends State<SimpleTable> {
11
+  final String jsonSample =
12
+      '[{"id":"0","name":"Dr.Collazo","Oficina":"A","Phone":"787-522-0123","Espe":"Dentist"},{"id":"1","name":"Dr.Lelolelo","Oficina":"B","Phone":"787-533-4567","Espe":"Dentist"},{"id":"2","name":"Dr.Pepo","Oficina":"C","Phone":"787-544-8910","Espe":"otorrinolaringologo"}]';
13
+  bool toggle = true;
14
+
15
+  @override
16
+  Widget build(BuildContext context) {
17
+    var json = jsonDecode(jsonSample);
18
+    return Scaffold(
19
+      body: Container(
20
+        padding: EdgeInsets.all(16.0),
21
+        child: toggle
22
+            ? Column(
23
+          children: [
24
+            JsonTable(
25
+              json,
26
+              showColumnToggle: true,
27
+              tableHeaderBuilder: (String header) {
28
+                return Container(
29
+                  padding: EdgeInsets.symmetric(
30
+                      horizontal: 8.0, vertical: 4.0),
31
+                  decoration: BoxDecoration(
32
+                      border: Border.all(width: 0.5),
33
+                      color: Colors.grey[300]),
34
+                  child: Text(
35
+                    header,
36
+                    textAlign: TextAlign.center,
37
+                    style: Theme.of(context).textTheme.display1.copyWith(
38
+                        fontWeight: FontWeight.w700,
39
+                        fontSize: 14.0,
40
+                        color: Colors.black87),
41
+                  ),
42
+                );
43
+              },
44
+              tableCellBuilder: (value) {
45
+                return Container(
46
+                  padding: EdgeInsets.symmetric(
47
+                      horizontal: 4.0, vertical: 2.0),
48
+                  decoration: BoxDecoration(
49
+                      border: Border.all(
50
+                          width: 0.5,
51
+                          color: Colors.grey.withOpacity(0.5))),
52
+                  child: Text(
53
+                    value,
54
+                    textAlign: TextAlign.center,
55
+                    style: Theme.of(context).textTheme.display1.copyWith(
56
+                        fontSize: 14.0, color: Colors.grey[900]),
57
+                  ),
58
+                );
59
+              },
60
+              allowRowHighlight: true,
61
+              rowHighlightColor: Colors.yellow[500].withOpacity(0.7),
62
+              paginationRowCount: 20,
63
+            ),
64
+            SizedBox(
65
+              height: 20.0,
66
+            ),
67
+            Text("Tabla Oficinas")
68
+          ],
69
+        )
70
+            : Center(
71
+          child: Text(getPrettyJSONString(jsonSample)),
72
+        ),
73
+      ),
74
+      floatingActionButton: FloatingActionButton(
75
+          child: Icon(Icons.grid_on),
76
+          onPressed: () {
77
+            setState(
78
+                  () {
79
+                toggle = !toggle;
80
+              },
81
+            );
82
+          }),
83
+    );
84
+  }
85
+
86
+  String getPrettyJSONString(jsonObject) {
87
+    JsonEncoder encoder = new JsonEncoder.withIndent('  ');
88
+    String jsonString = encoder.convert(json.decode(jsonObject));
89
+    return jsonString;
90
+  }
91
+}
92
+
93
+void main() => runApp(especialidades());
94
+
95
+class especialidades extends StatelessWidget {
96
+  @override
97
+  Widget build(BuildContext context) {
98
+    return MaterialApp(
99
+      title: 'Flutter Demo',
100
+      theme: ThemeData(
101
+        primarySwatch: Colors.blue,
102
+      ),
103
+      home: SimpleTable(),
104
+    );
105
+  }
106
+}
107
+
108
+
109
+

+ 37
- 0
fast_med_app/lib/routes/home.dart View File

@@ -0,0 +1,37 @@
1
+import 'package:flutter/material.dart';
2
+import '../widgets/functions.dart';
3
+
4
+class Home extends StatefulWidget{
5
+  @override
6
+  _HomeState createState() => _HomeState();
7
+}
8
+
9
+
10
+
11
+
12
+class _HomeState extends State<Home>{
13
+  @override
14
+  Widget build(BuildContext context){
15
+    return Scaffold(
16
+      appBar: AppBar(
17
+        title: Text('Bienvenido'),
18
+        centerTitle: true,
19
+      ),
20
+      body: Center(
21
+        child: ListView(
22
+          //mainAxisAlignment: MainAxisAlignment.spaceEvenly,
23
+          children: [
24
+            newButton(context,'/verOficinas','Ver Oficinas'),
25
+            spaceBetween(),
26
+            newButton(context,'/especialidades','especialidades'),
27
+            spaceBetween(),
28
+            newButton(context,'/translation','translation'),
29
+            spaceBetween(),
30
+            ],
31
+        ),
32
+
33
+      ),
34
+
35
+    );
36
+  }
37
+}

hector/main.dart → fast_med_app/lib/routes/main.dart View File


+ 88
- 0
fast_med_app/lib/routes/navigation.dart View File

@@ -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 'register.dart';
6
+import 'welcome.dart';
7
+import 'profileinfo.dart';
8
+import 'appointments.dart';
9
+import 'package:http/http.dart' as http;
10
+import 'OfficeScreen.dart';
11
+import 'Offices.dart';
12
+import 'package:fast_med_flutter/routes/home.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
+    Home()
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_app/lib/routes/profileinfo.dart View File

@@ -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_app/lib/routes/register.dart View File

@@ -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: 100,
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
+

Carlos/main.dart → fast_med_app/lib/routes/translation.dart View File

@@ -1,15 +1,15 @@
1 1
 import 'package:flutter/material.dart';
2
-import 'package:userstory2translate/localization/localization.dart';
3
-import 'package:userstory2translate/router/custom_router.dart';
4
-import 'package:userstory2translate/router/route_constants.dart';
2
+import '../localization/localization.dart';
3
+import '../router/custom_router.dart';
4
+import '../router/route_constants.dart';
5 5
 import 'package:flutter_localizations/flutter_localizations.dart';
6 6
 
7
-import 'localization/language_constants.dart';
7
+import '../localization/language_constants.dart';
8 8
 
9
-void main() => runApp(MyApp());
9
+void main() => runApp(translation());
10 10
 
11
-class MyApp extends StatefulWidget {
12
-  const MyApp({Key key}) : super(key: key);
11
+class translation extends StatefulWidget {
12
+  const translation({Key key}) : super(key: key);
13 13
   static void setLocale(BuildContext context, Locale newLocale) {
14 14
     _MyAppState state = context.findAncestorStateOfType<_MyAppState>();
15 15
     state.setLocale(newLocale);
@@ -19,7 +19,7 @@ class MyApp extends StatefulWidget {
19 19
   _MyAppState createState() => _MyAppState();
20 20
 }
21 21
 
22
-class _MyAppState extends State<MyApp> {
22
+class _MyAppState extends State<translation> {
23 23
   Locale _locale;
24 24
   setLocale(Locale locale) {
25 25
     setState(() {

+ 304
- 0
fast_med_app/lib/routes/ver_oficina.dart View File

@@ -0,0 +1,304 @@
1
+import 'package:flutter/material.dart';
2
+import '../widgets/DataTableMySqlDemo/Oficina.dart';
3
+import '../widgets/DataTableMySqlDemo/Horario.dart';
4
+import '../widgets/DataTableMySqlDemo/Especialista.dart';
5
+import '../widgets/DataTableMySqlDemo/Services.dart';
6
+import 'dart:async';
7
+import '../widgets/functions.dart';
8
+import 'package:flutter/material.dart';
9
+import 'package:url_launcher/url_launcher.dart';
10
+
11
+
12
+class VerOficina extends StatefulWidget{
13
+  VerOficina() : super();
14
+  final String title = 'Oficina';
15
+  @override
16
+  State<StatefulWidget> viewOficina() {
17
+    //no se que hago, quizas no lo necesite
18
+    return null;
19
+  }
20
+  _VerOficinaState createState() => _VerOficinaState();
21
+}
22
+
23
+class _VerOficinaState extends State<VerOficina>{
24
+  Map post = {};
25
+  List<Oficina> _oficina;
26
+  List<Horario> _horario;
27
+  List<Especialista> _especialista;
28
+
29
+  @override
30
+  void initState() {
31
+    super.initState();
32
+    _oficina = [];
33
+    _getOficina();
34
+    _horario = [];
35
+    _getHorario();
36
+    _especialista = [];
37
+    _getEspecialista();
38
+  }
39
+
40
+  _getOficina() {
41
+    return _oficina;
42
+  }
43
+  _getHorario() {
44
+    return _horario;
45
+  }
46
+  _getEspecialista() {
47
+    return _especialista;
48
+  }
49
+
50
+  //funcion
51
+  //recibe Horario para regresar la horas de entrada y salida
52
+  String getHoras(Horario horario) {
53
+    var open_time = horario.open_time;
54
+    var close_time = horario.close_time;
55
+    if (open_time == close_time
56
+        && open_time == '00:00:00'){
57
+        return 'Cerrado';
58
+    }
59
+    var open_hour = int.parse(open_time.substring(0,2));
60
+    var open_minutes = open_time.substring(3,5);
61
+    //var open_minutes;
62
+    var close_hour = int.parse(close_time.substring(0,2));
63
+    var close_minutes = open_time.substring(3,5);
64
+
65
+    // ver si la hora de abrir es AM o PM
66
+    if (open_hour==12){
67
+      open_time = open_time.substring(0,5) + ' PM';
68
+    }else if (open_hour>12){
69
+      open_time = (open_hour % 12).toString() + ':' + open_minutes + ' PM';
70
+    }else{
71
+      open_time = (open_hour % 12).toString() + ':' + open_minutes + ' AM';
72
+    }
73
+
74
+    // ver si la hora de cerrar es AM o PM
75
+    if (close_hour==12){
76
+      close_time = close_time.substring(0,5) + ' PM';
77
+    }else if (close_hour>12){
78
+      close_time = (close_hour % 12).toString() + ':' + close_minutes + ' PM';
79
+    }else{
80
+      close_time = (close_hour % 12).toString() + ':' + close_minutes + ' AM';
81
+    }
82
+
83
+    return open_time + ' - ' + close_time;
84
+  }
85
+  String getEspecialistas(List especialistas) {
86
+    if(especialistas.length > 0 && especialistas[0].specialty.toString() != 'null'){
87
+      var str = "";
88
+      especialistas.forEach((especialista){
89
+        str = str + especialista.specialty.toString() + '\n';
90
+      });
91
+      return str;
92
+    }
93
+    return "No hay especialistas";
94
+  }
95
+
96
+  @override
97
+  Widget build(BuildContext context){
98
+    post = ModalRoute.of(context).settings.arguments;
99
+    Services.getOficina(post['id']).then((Oficina) {
100
+      setState(() {
101
+        _oficina = Oficina;
102
+      });
103
+    });
104
+    Services.getHorario(post['id']).then((Horario) {
105
+      setState(() {
106
+        _horario = Horario;
107
+      });
108
+    });
109
+    Services.getEspecialista(post['id']).then((Especialista) {
110
+      setState(() {
111
+        _especialista = Especialista;
112
+      });
113
+    });
114
+
115
+
116
+    List<Oficina> lista =  _oficina;
117
+    var name = 'Cargando...';
118
+    var telephone = 'Cargando...';
119
+    var address = 'Cargando...';
120
+    var email = 'Cargando...';
121
+    if (lista.length > 0){
122
+      name = lista[0].name;
123
+      telephone = lista[0].telephone;
124
+      address = lista[0].address;
125
+      email = lista[0].email;
126
+    }
127
+
128
+    List<Horario> horario =  _horario;
129
+    var domingo_horario = 'Cargando...';
130
+    var lunes_horario = 'Cargando...';
131
+    var martes_horario = 'Cargando...';
132
+    var miercoles_horario = 'Cargando...';
133
+    var jueves_horario = 'Cargando...';
134
+    var viernes_horario = 'Cargando...';
135
+    var sabado_horario = 'Cargando...';
136
+    if(horario.length == 7){
137
+      domingo_horario = getHoras(horario[0]);
138
+      lunes_horario = getHoras(horario[1]);
139
+      martes_horario = getHoras(horario[2]);
140
+      miercoles_horario = getHoras(horario[3]);
141
+      jueves_horario = getHoras(horario[4]);
142
+      viernes_horario = getHoras(horario[5]);
143
+      sabado_horario = getHoras(horario[6]);
144
+    }else{
145
+      domingo_horario = 'Error';
146
+      lunes_horario = 'Error';
147
+      martes_horario = 'Error';
148
+      miercoles_horario = 'Error';
149
+      jueves_horario = 'Error';
150
+      viernes_horario = 'Error';
151
+      sabado_horario = 'Error';
152
+    }
153
+
154
+
155
+    List<Especialista> especialista =  _especialista;
156
+    var especialistas = getEspecialistas(especialista);
157
+
158
+    return Scaffold(
159
+      appBar: AppBar(
160
+        title: Text(name),
161
+        centerTitle: true,
162
+      ),
163
+      body: Center(
164
+        child: ListView(
165
+          //mainAxisAlignment: MainAxisAlignment.spaceEvenly,
166
+          children: [
167
+            new Card(
168
+              color: Colors.red[300],
169
+
170
+              child: Column(
171
+                mainAxisSize: MainAxisSize.min,
172
+                children: <Widget>[
173
+                  ListTile(
174
+                    // leading: Icon(Icons.album),
175
+                    title: Text('Horario',style: TextStyle(fontWeight: FontWeight.bold,height: 2, fontSize: 36),textAlign: TextAlign.center),
176
+                    subtitle: Text(
177
+                        'Domingo: ' + '$domingo_horario'
178
+                        '\nLunes: ' + '$lunes_horario'
179
+                        '\nMartes: ' + '$martes_horario'
180
+                        '\nMiercoles: ' + '$miercoles_horario'
181
+                        '\nJueves: ' + '$jueves_horario'
182
+                        '\nViernes: ' + '$viernes_horario'
183
+                        '\nSabado: ' + '$sabado_horario',
184
+                        style: TextStyle(fontWeight: FontWeight.bold,height: 2, fontSize: 12),
185
+                        textAlign: TextAlign.center),
186
+                  ),
187
+                  Row(
188
+                    mainAxisAlignment: MainAxisAlignment.end,
189
+                    children: <Widget>[
190
+                      TextButton(
191
+                        child: const Text('Buscar Disponibilidad'),
192
+                        onPressed: () {
193
+                          Navigator.pushNamed(context, '/calendario');
194
+                        },
195
+                      ),
196
+                      const SizedBox(width: 8),
197
+                    ],
198
+                  ),
199
+                ],
200
+              ),
201
+            ),
202
+            new Card(
203
+              color: Colors.red[300],
204
+
205
+              child: Column(
206
+                mainAxisSize: MainAxisSize.min,
207
+                children: <Widget>[
208
+                  Row(
209
+                    mainAxisAlignment: MainAxisAlignment.center,
210
+                    children: <Widget>[
211
+                      TextButton(
212
+                        child: const Text('Especialidades \ndisponibles',
213
+                            style: TextStyle(fontWeight: FontWeight.bold,height: 1.5, fontSize: 36),
214
+                            textAlign: TextAlign.center),
215
+                        onPressed: () { /* ... */ },
216
+                      ),
217
+                      const SizedBox(width: 8),
218
+                    ],
219
+                  ),
220
+                  ListTile(
221
+                    subtitle: Text(
222
+                        '$especialistas',
223
+                        style: TextStyle(fontWeight: FontWeight.bold,height: 2, fontSize: 12),
224
+                        textAlign: TextAlign.center),
225
+                  ),
226
+                ],
227
+              ),
228
+            ),
229
+            new Card(
230
+              color: Colors.red[300],
231
+
232
+              child: Column(
233
+                mainAxisSize: MainAxisSize.min,
234
+                children: <Widget>[
235
+                  ListTile(
236
+                    title: Text('Direccion',style: TextStyle(fontWeight: FontWeight.bold,height: 2, fontSize: 36),textAlign: TextAlign.center),
237
+                    subtitle: Text('$address',
238
+                        style: TextStyle(fontWeight: FontWeight.bold,height: 2, fontSize: 12),
239
+                        textAlign: TextAlign.center),
240
+                  ),
241
+                  Row(
242
+                    mainAxisAlignment: MainAxisAlignment.end,
243
+                    children: <Widget>[
244
+                      TextButton(
245
+                        child: const Text('Buscar en el mapa'),
246
+                        onPressed: () {
247
+                          setState(() async {
248
+                            String destinationLatitude = "18.39007092764153";
249
+                            String destinationLongitude = "-65.976216841223";
250
+                            String originlatitude = "18.418738017376207";
251
+                            String originlongitude = "-66.02565531285634";
252
+
253
+                            //const url = 'https://www.google.com/maps/@42.585444,13.007813,6z';
254
+                            const url = "https://www.google.com/maps/dir/?api=1&parameters&origin=18.418738017376207,-66.02565531285634&destination=18.39007092764153,-65.976216841223";
255
+                            if (await canLaunch(url)) {
256
+                              await launch(url);
257
+                            } else {
258
+                              throw 'Could not launch $url';
259
+                            }
260
+
261
+                            //String uri = "http://maps.google.com/maps?daddr=" + destinationLatitude + "," + destinationLongitude + " (" + "Doctor" + ")";
262
+                            //Intent intent;
263
+                            //intent.setAction(Action.ACTION_VIEW);
264
+                            //Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
265
+                            //intent.setPackage("com.google.android.apps.maps");
266
+                            //startActivity(intent);
267
+                            //UIApplication.shared.openURL(URL(string:"https://www.google.com/maps/@42.585444,13.007813,6z")!);
268
+                          });
269
+                          },
270
+                      ),
271
+                      const SizedBox(width: 8),
272
+                    ],
273
+                  ),
274
+                ],
275
+              ),
276
+            ),
277
+            new Card(
278
+              color: Colors.red[300],
279
+
280
+              child: Column(
281
+                mainAxisSize: MainAxisSize.min,
282
+                children: <Widget>[
283
+                  ListTile(
284
+                    title: Text('Contacto',style: TextStyle(fontWeight: FontWeight.bold,height: 2, fontSize: 36),textAlign: TextAlign.center),
285
+                    subtitle: Text("Telefono: \n "
286
+                        "$telephone \n "
287
+                        "\n"
288
+                        "Email:  \n  "
289
+                        "$email",
290
+                        style: TextStyle(fontWeight: FontWeight.bold,height: 2, fontSize: 12),
291
+                        textAlign: TextAlign.center),
292
+                  ),
293
+                ],
294
+              ),
295
+            ),
296
+          ],
297
+        ),
298
+
299
+      ),
300
+
301
+    );
302
+  }
303
+}
304
+

fast_med_flutter/lib/routes/ver_oficinas.dart → fast_med_app/lib/routes/ver_oficinas.dart View File

@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
2 2
 import '../widgets/DataTableMySqlDemo/Oficina.dart';
3 3
 import '../widgets/DataTableMySqlDemo/Services.dart';
4 4
 import 'dart:async';
5
+import '../widgets/functions.dart';
5 6
 
6 7
 class VerOficinas extends StatefulWidget{
7 8
   VerOficinas() : super();
@@ -58,34 +59,21 @@ class _VerOficinasState extends State<VerOficinas>{
58 59
         backgroundColor: Colors.purple,
59 60
 
60 61
       ),
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
-          // )
62
+      body: ListView.builder(
63
+        itemCount: lista.length,
64
+        itemBuilder: (context, index){
65
+          return Card(
66
+          child: ListTile(
67
+            onTap: () {
68
+              Navigator.pushNamed(context, "/ver/oficina", arguments:{
69
+                'id' : lista[index].id,
70
+              });
71
+            },
72
+            title: Text(lista[index].name),
73
+          )
74
+          );
75
+        }
87 76
       ),
88
-
89 77
     );
90 78
   }
91 79
 }

hector/welcome.dart → fast_med_app/lib/routes/welcome.dart View File

@@ -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
                 )

fast_med_flutter/lib/ui/pages/add_event.dart → fast_med_app/lib/ui/pages/add_event.dart View File


fast_med_flutter/lib/ui/pages/view_event.dart → fast_med_app/lib/ui/pages/view_event.dart View File


+ 32
- 0
fast_med_app/lib/widgets/DataTableMySqlDemo/Especialista.dart View File

@@ -0,0 +1,32 @@
1
+class Especialista {
2
+  String id;
3
+  String oficina_id;
4
+  String name;
5
+  String specialty;
6
+  String telephone;
7
+  String email;
8
+
9
+  Especialista({this.id, this.oficina_id, this.name, this.specialty, this.telephone, this.email});
10
+
11
+  factory Especialista.allFromJson(Map<String, dynamic> json) {
12
+    return Especialista (
13
+      id :json['id'] as String,
14
+      oficina_id: json['oficina_id'] as String,
15
+      name: json['name'] as String,
16
+      specialty: json['specialty'] as String,
17
+      telephone: json['telephone'] as String,
18
+      email: json['email'] as String,
19
+    );
20
+  }
21
+
22
+  factory Especialista.infoFromJson(Map<String, dynamic> json) {
23
+    return Especialista (
24
+      id :json['id'] as String,
25
+      oficina_id: json['oficina_id'] as String,
26
+      name: json['name'] as String,
27
+      specialty: json['specialty'] as String,
28
+      telephone: json['telephone'] as String,
29
+      email: json['email'] as String,
30
+    );
31
+  }
32
+}

+ 29
- 0
fast_med_app/lib/widgets/DataTableMySqlDemo/Horario.dart View File

@@ -0,0 +1,29 @@
1
+class Horario {
2
+  String id;
3
+  String oficina_id;
4
+  String dia_semana;
5
+  String open_time;
6
+  String close_time;
7
+
8
+  Horario({this.id, this.oficina_id, this.dia_semana, this.open_time, this.close_time});
9
+
10
+  factory Horario.allFromJson(Map<String, dynamic> json) {
11
+    return Horario (
12
+      id :json['id'] as String,
13
+      oficina_id: json['oficina_id'] as String,
14
+      dia_semana: json['dia_semana'] as String,
15
+      open_time: json['open_time'] as String,
16
+      close_time: json['close_time'] as String,
17
+    );
18
+  }
19
+
20
+  factory Horario.infoFromJson(Map<String, dynamic> json) {
21
+    return Horario (
22
+      id :json['id'] as String,
23
+      oficina_id: json['oficina_id'] as String,
24
+      dia_semana: json['dia_semana'] as String,
25
+      open_time: json['open_time'] as String,
26
+      close_time: json['close_time'] as String,
27
+    );
28
+  }
29
+}

+ 29
- 0
fast_med_app/lib/widgets/DataTableMySqlDemo/Oficina.dart View File

@@ -0,0 +1,29 @@
1
+class Oficina {
2
+  String id;
3
+  String name;
4
+  String address;
5
+  String telephone;
6
+  String email;
7
+
8
+  Oficina({this.id, this.name, this.address, this.telephone, this.email});
9
+
10
+  factory Oficina.allFromJson(Map<String, dynamic> json) {
11
+    return Oficina (
12
+      id :json['id'] as String,
13
+      name: json['name'] as String,
14
+      address: json['address'] as String,
15
+      telephone: json['telephone'] as String,
16
+      email: json['email'] as String,
17
+    );
18
+  }
19
+
20
+  factory Oficina.infoFromJson(Map<String, dynamic> json) {
21
+    return Oficina (
22
+      id :json['id'] as String,
23
+      name: json['name'] as String,
24
+      address: json['address'] as String,
25
+      telephone: json['telephone'] as String,
26
+      email: json['email'] as String,
27
+    );
28
+  }
29
+}

+ 104
- 0
fast_med_app/lib/widgets/DataTableMySqlDemo/Services.dart View File

@@ -0,0 +1,104 @@
1
+import 'dart:convert';
2
+import 'package:fast_med_flutter/widgets/DataTableMySqlDemo/Horario.dart';
3
+import 'package:fast_med_flutter/widgets/DataTableMySqlDemo/Especialista.dart';
4
+import 'package:http/http.dart'
5
+  as http;
6
+import 'Oficina.dart';
7
+
8
+class Services {
9
+  static const URL_GET_ALL = 'http://ada.uprrp.edu/~oniel.mendez2/json/getOficinas.php';
10
+  static const URL_OFICINA_GET_BY_ID = 'https://ada.uprrp.edu/~oniel.mendez2/json/getOficinaByID.php';
11
+  static const URL_HORARIO = 'https://ada.uprrp.edu/~oniel.mendez2/json/getHorario.php';
12
+  static const URL_ESPECIALISTA = 'https://ada.uprrp.edu/~oniel.mendez2/json/getEspecialista.php';
13
+  //static const _GET_ALL = "GET_ALL";
14
+
15
+  //get all oficinas
16
+  static Future<List<Oficina>> getOficinas() async {
17
+    try {
18
+      final response = await http.get(URL_GET_ALL);
19
+      if (200 == response.statusCode) {
20
+        final parsed = json.decode(response.body).cast<Map<String, dynamic>>();
21
+        List<Oficina> list = parsed.map<Oficina>((json) => Oficina.allFromJson(json)).toList();
22
+        return list;
23
+      } else {
24
+        final response = '[{"id":"1","name":"error."},{"id":"2","name":"el codigo"},{"id":"3","name":"!=200"}]';
25
+        final parsed = json.decode(response).cast<Map<String, dynamic>>();
26
+        List<Oficina> list = parsed.map<Oficina>((json) => Oficina.allFromJson(json)).toList();
27
+        return list; // return an empty list on exception/error
28
+      }
29
+    } catch (e) {
30
+      final response = '[{"id":"1","name":"oficina 1,"telephone":"787","address":"Carretera ##","email":"email@domain.com""},'
31
+                        '{"id":"2","name":"oficina 2","telephone":"787","address":"Carretera ##","email":"email@domain.com"},'
32
+                        '{"id":"3","name":"oficina 3","telephone":"787","address":"Carretera ##","email":"email@domain.com"}]';
33
+      final parsed = json.decode(response).cast<Map<String, dynamic>>();
34
+      List<Oficina> list = parsed.map<Oficina>((json) => Oficina.allFromJson(json)).toList();
35
+      return list; // return an empty list on exception/error
36
+    }
37
+  }
38
+
39
+  static Future<List<Oficina>> getOficina(id) async {
40
+    try {
41
+      final response = await http.post(URL_OFICINA_GET_BY_ID, body: {'id': id});
42
+      if (200 == response.statusCode) {
43
+        final parsed = json.decode(response.body).cast<Map<String, dynamic>>();
44
+        List<Oficina> list = parsed.map<Oficina>((json) => Oficina.allFromJson(json)).toList();
45
+        return list;
46
+      } else {
47
+        final response = '[{"id":"1","name":"error.","telephone":"787","address":"Carretera ##","email":"email@domain.com"}]';
48
+        final parsed = json.decode(response).cast<Map<String, dynamic>>();
49
+        List<Oficina> list = parsed.map<Oficina>((json) => Oficina.allFromJson(json)).toList();
50
+        return list; // return an empty list on exception/error
51
+      }
52
+    } catch (e) {
53
+      final response = '[{"id":"1","name":"oficina 1","telephone":"787","address":"Carretera ##","email":"email@domain.com"}]';
54
+      final parsed = json.decode(response).cast<Map<String, dynamic>>();
55
+      List<Oficina> list = parsed.map<Oficina>((json) => Oficina.allFromJson(json)).toList();
56
+      return list; // return an empty list on exception/error
57
+    }
58
+  }
59
+
60
+  //para conseguir el horario de una oficina
61
+  static Future<List<Horario>> getHorario(id) async {
62
+    try {
63
+      final response = await http.post(URL_HORARIO, body: {'id': id});
64
+      if (200 == response.statusCode && response != null) {
65
+        final parsed = json.decode(response.body).cast<Map<String, dynamic>>();
66
+        List<Horario> list = parsed.map<Horario>((json) => Horario.allFromJson(json)).toList();
67
+        return list;
68
+      } else {
69
+        final response = '[{"id":"1","name":"error.","telephone":"787","address":"Carretera ##","email":"email@domain.com"}]';
70
+        final parsed = json.decode(response).cast<Map<String, dynamic>>();
71
+        List<Horario> list = parsed.map<Horario>((json) => Horario.allFromJson(json)).toList();
72
+        return list; // return an empty list on exception/error
73
+      }
74
+    } catch (e) {
75
+      final response = '[{"id":"1","name":"oficina 1","telephone":"787","address":"Carretera ##","email":"email@domain.com"}]';
76
+      final parsed = json.decode(response).cast<Map<String, dynamic>>();
77
+      List<Horario> list = parsed.map<Horario>((json) => Horario.allFromJson(json)).toList();
78
+      return list; // return an empty list on exception/error
79
+    }
80
+  }
81
+
82
+  //para conseguir especialistas que trabajen en una oficina
83
+  static Future<List<Especialista>> getEspecialista(id) async {
84
+    try {
85
+      final response = await http.post(URL_ESPECIALISTA, body: {'id': id});
86
+      if (200 == response.statusCode && response != null) {
87
+        final parsed = json.decode(response.body).cast<Map<String, dynamic>>();
88
+        List<Especialista> list = parsed.map<Especialista>((json) => Especialista.allFromJson(json)).toList();
89
+        return list;
90
+      } else {
91
+        final response = '[{"id":"1","name":"error.","telephone":"787","address":"Carretera ##","email":"email@domain.com"}]';
92
+        final parsed = json.decode(response).cast<Map<String, dynamic>>();
93
+        List<Especialista> list = parsed.map<Especialista>((json) => Especialista.allFromJson(json)).toList();
94
+        return list; // return an empty list on exception/error
95
+      }
96
+    } catch (e) {
97
+      final response = '[{"id":"1","name":"oficina 1","telephone":"787","address":"Carretera ##","email":"email@domain.com"}]';
98
+      final parsed = json.decode(response).cast<Map<String, dynamic>>();
99
+      List<Especialista> list = parsed.map<Especialista>((json) => Especialista.allFromJson(json)).toList();
100
+      return list; // return an empty list on exception/error
101
+    }
102
+  }
103
+
104
+}

fast_med_flutter/lib/widgets/dud.dart → fast_med_app/lib/widgets/MySQL_DataTable/dud.dart View File


fast_med_flutter/lib/widgets/data_table/dud.dart → fast_med_app/lib/widgets/data_table/dud.dart View File


Some files were not shown because too many files changed in this diff