Explorar el Código

sprint 2 hector integrado

Oniel Mendez hace 4 años
padre
commit
936ef35231

+ 0
- 77
Jorge/pubspec.yaml Ver fichero

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

BIN
MH.png Ver fichero


+ 0
- 16
README.md Ver fichero

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

+ 0
- 17
fast_med_flutter/lib/classes/language.dart Ver fichero

@@ -1,17 +0,0 @@
1
-class Language {
2
-  final int id;
3
-  final String flag;
4
-  final String name;
5
-  final String languageCode;
6
-
7
-  Language(this.id, this.flag, this.name, this.languageCode);
8
-
9
-  static List<Language> languageList() {
10
-    return <Language>[
11
-      Language(1, "🇦🇫", "فارسی", "fa"),
12
-      Language(2, "🇺🇸", "English", "en"),
13
-      Language(3, "🇺🇸", "Español", "es"),
14
-      Language(4, "🇮🇳", "हिंदी", "hi"),
15
-    ];
16
-  }
17
-}

+ 0
- 15
fast_med_flutter/lib/languages/en.json Ver fichero

@@ -1,15 +0,0 @@
1
-{
2
-  "home_page": "Home Page",
3
-  "personal_information": "Personal Information",
4
-  "name": "Name",
5
-  "name_hint": "Enter your name",
6
-  "email": "Email",
7
-  "email_hint": "Enter your email",
8
-  "date_of_birth": "Date of Birth",
9
-  "required_field": "Required Field",
10
-  "submit_info": "Submit Info",
11
-  "about_us": "About Us",
12
-  "settings": "Settings",
13
-  "change_language": "Change Language",
14
-  "about": "This user story translate for our FastMed app in CCOM4030."
15
-}

+ 0
- 15
fast_med_flutter/lib/languages/es.json Ver fichero

@@ -1,15 +0,0 @@
1
-{
2
-  "home_page": "Pagina Inicio",
3
-  "personal_information": "Informacion Personal",
4
-  "name": "Nombre",
5
-  "name_hint": "Entra tu nombre",
6
-  "email": "Correo electronico",
7
-  "email_hint": "Entra tu correo electronico",
8
-  "date_of_birth": "Fecha de nacimiento",
9
-  "required_field": "Campo requerido",
10
-  "submit_info": "Somete informacion",
11
-  "about_us": "Acerca de nosotros",
12
-  "settings": "Configuracion",
13
-  "change_language": "Cambia el lenguaje",
14
-  "about": "Este user story traduce para nuestro FastMed app en CCOM4030."
15
-}

+ 0
- 42
fast_med_flutter/lib/localization/language_constants.dart Ver fichero

@@ -1,42 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-import 'package:userstory2translate/localization/localization.dart';
3
-import 'package:shared_preferences/shared_preferences.dart';
4
-
5
-const String LAGUAGE_CODE = 'languageCode';
6
-
7
-//languages code
8
-const String ENGLISH = 'en';
9
-const String FARSI = 'fa';
10
-const String SPANISH = 'es';
11
-const String HINDI = 'hi';
12
-
13
-Future<Locale> setLocale(String languageCode) async {
14
-  SharedPreferences _prefs = await SharedPreferences.getInstance();
15
-  await _prefs.setString(LAGUAGE_CODE, languageCode);
16
-  return _locale(languageCode);
17
-}
18
-
19
-Future<Locale> getLocale() async {
20
-  SharedPreferences _prefs = await SharedPreferences.getInstance();
21
-  String languageCode = _prefs.getString(LAGUAGE_CODE) ?? "en";
22
-  return _locale(languageCode);
23
-}
24
-
25
-Locale _locale(String languageCode) {
26
-  switch (languageCode) {
27
-    case ENGLISH:
28
-      return Locale(ENGLISH, 'US');
29
-    case FARSI:
30
-      return Locale(FARSI, "IR");
31
-    case SPANISH:
32
-      return Locale(SPANISH, "SP");
33
-    case HINDI:
34
-      return Locale(HINDI, "IN");
35
-    default:
36
-      return Locale(ENGLISH, 'US');
37
-  }
38
-}
39
-
40
-String getTranslated(BuildContext context, String key) {
41
-  return DemoLocalization.of(context).translate(key);
42
-}

+ 0
- 51
fast_med_flutter/lib/localization/localization.dart Ver fichero

@@ -1,51 +0,0 @@
1
-import 'dart:convert';
2
-
3
-import 'package:flutter/material.dart';
4
-import 'package:flutter/services.dart';
5
-
6
-class DemoLocalization {
7
-  DemoLocalization(this.locale);
8
-
9
-  final Locale locale;
10
-  static DemoLocalization of(BuildContext context) {
11
-    return Localizations.of<DemoLocalization>(context, DemoLocalization);
12
-  }
13
-
14
-  Map<String, String> _localizedValues;
15
-
16
-  Future<void> load() async {
17
-    String jsonStringValues =
18
-    await rootBundle.loadString('lib/languages/${locale.languageCode}.json');
19
-    Map<String, dynamic> mappedJson = json.decode(jsonStringValues);
20
-    _localizedValues =
21
-        mappedJson.map((key, value) => MapEntry(key, value.toString()));
22
-  }
23
-
24
-  String translate(String key) {
25
-    return _localizedValues[key];
26
-  }
27
-
28
-  // static member to have simple access to the delegate from Material App
29
-  static const LocalizationsDelegate<DemoLocalization> delegate =
30
-  _DemoLocalizationsDelegate();
31
-}
32
-
33
-class _DemoLocalizationsDelegate
34
-    extends LocalizationsDelegate<DemoLocalization> {
35
-  const _DemoLocalizationsDelegate();
36
-
37
-  @override
38
-  bool isSupported(Locale locale) {
39
-    return ['en', 'es', 'fa', 'hi'].contains(locale.languageCode);
40
-  }
41
-
42
-  @override
43
-  Future<DemoLocalization> load(Locale locale) async {
44
-    DemoLocalization localization = new DemoLocalization(locale);
45
-    await localization.load();
46
-    return localization;
47
-  }
48
-
49
-  @override
50
-  bool shouldReload(LocalizationsDelegate<DemoLocalization> old) => false;
51
-}

+ 3
- 0
fast_med_flutter/lib/main.dart Ver fichero

@@ -8,6 +8,7 @@ import 'package:fast_med_flutter/routes/welcome.dart';
8 8
 import 'package:fast_med_flutter/routes/album.dart';
9 9
 import 'package:flutter/material.dart';
10 10
 import 'package:fast_med_flutter/routes/especialidades.dart';
11
+import 'package:fast_med_flutter/routes/profileinfo.dart';
11 12
 
12 13
 void main() => runApp(MaterialApp(
13 14
     initialRoute: '/home',
@@ -21,5 +22,7 @@ void main() => runApp(MaterialApp(
21 22
       '/MyApp': (context) => MyApp(),
22 23
       '/album': (context) => album(),
23 24
       '/especialidades': (context) => especialidades(),
25
+      '/perfil': (context) => ProfilePage(),
26
+      '/translation': (context) => ProfilePage(),
24 27
     }
25 28
 ));

+ 0
- 26
fast_med_flutter/lib/pages/about_page.dart Ver fichero

@@ -1,26 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-import 'package:userstory2translate/localization/language_constants.dart';
3
-
4
-class AboutPage extends StatefulWidget {
5
-  AboutPage({Key key}) : super(key: key);
6
-
7
-  @override
8
-  _AboutPageState createState() => _AboutPageState();
9
-}
10
-
11
-class _AboutPageState extends State<AboutPage> {
12
-  @override
13
-  Widget build(BuildContext context) {
14
-    return Scaffold(
15
-      appBar: AppBar(
16
-        title: Text(getTranslated(context, 'about_us')),
17
-      ),
18
-      body: Container(
19
-        padding: EdgeInsets.all(20),
20
-        child: Center(
21
-          child: Text(getTranslated(context, 'about')),
22
-        ),
23
-      ),
24
-    );
25
-  }
26
-}

+ 0
- 217
fast_med_flutter/lib/pages/home_page.dart Ver fichero

@@ -1,217 +0,0 @@
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';
6
-
7
-class HomePage extends StatefulWidget {
8
-  HomePage({Key key}) : super(key: key);
9
-
10
-  @override
11
-  _HomePageState createState() => _HomePageState();
12
-}
13
-
14
-class _HomePageState extends State<HomePage> {
15
-  final GlobalKey<FormState> _key = GlobalKey<FormState>();
16
-  void _changeLanguage(Language language) async {
17
-    Locale _locale = await setLocale(language.languageCode);
18
-    MyApp.setLocale(context, _locale);
19
-  }
20
-
21
-  void _showSuccessDialog() {
22
-    showTimePicker(context: context, initialTime: TimeOfDay.now());
23
-  }
24
-
25
-  @override
26
-  Widget build(BuildContext context) {
27
-    return Scaffold(
28
-      appBar: AppBar(
29
-        title: Text(getTranslated(context, 'home_page')),
30
-        actions: <Widget>[
31
-          Padding(
32
-            padding: const EdgeInsets.all(8.0),
33
-            child: DropdownButton<Language>(
34
-              underline: SizedBox(),
35
-              icon: Icon(
36
-                Icons.language,
37
-                color: Colors.white,
38
-              ),
39
-              onChanged: (Language language) {
40
-                _changeLanguage(language);
41
-              },
42
-              items: Language.languageList()
43
-                  .map<DropdownMenuItem<Language>>(
44
-                    (e) => DropdownMenuItem<Language>(
45
-                  value: e,
46
-                  child: Row(
47
-                    mainAxisAlignment: MainAxisAlignment.spaceAround,
48
-                    children: <Widget>[
49
-                      Text(
50
-                        e.flag,
51
-                        style: TextStyle(fontSize: 30),
52
-                      ),
53
-                      Text(e.name)
54
-                    ],
55
-                  ),
56
-                ),
57
-              )
58
-                  .toList(),
59
-            ),
60
-          ),
61
-        ],
62
-      ),
63
-      drawer: Drawer(
64
-        child: _drawerList(),
65
-      ),
66
-      body: Container(
67
-        padding: EdgeInsets.all(20),
68
-        child: _mainForm(context),
69
-      ),
70
-    );
71
-  }
72
-
73
-  Form _mainForm(BuildContext context) {
74
-    return Form(
75
-      key: _key,
76
-      child: Column(
77
-        children: <Widget>[
78
-          Container(
79
-            height: MediaQuery.of(context).size.height / 4,
80
-            child: Center(
81
-              child: Text(
82
-                getTranslated(context, 'personal_information'),
83
-                // DemoLocalization.of(context).translate('personal_information'),
84
-                textAlign: TextAlign.center,
85
-                style: TextStyle(
86
-                  fontSize: 30,
87
-                  fontWeight: FontWeight.bold,
88
-                ),
89
-              ),
90
-            ),
91
-          ),
92
-          TextFormField(
93
-            validator: (val) {
94
-              if (val.isEmpty) {
95
-                return getTranslated(context, 'required_field');
96
-                // return DemoLocalization.of(context).translate('required_fiedl');
97
-              }
98
-              return null;
99
-            },
100
-            decoration: InputDecoration(
101
-              border: OutlineInputBorder(),
102
-              labelText: getTranslated(context, 'name'),
103
-              hintText: getTranslated(context, 'name_hint'),
104
-            ),
105
-          ),
106
-          SizedBox(
107
-            height: 10,
108
-          ),
109
-          TextFormField(
110
-            validator: (val) {
111
-              if (val.isEmpty) {
112
-                return getTranslated(context, 'required_field');
113
-              }
114
-              return null;
115
-            },
116
-            decoration: InputDecoration(
117
-              border: OutlineInputBorder(),
118
-              labelText: getTranslated(context, 'email'),
119
-              hintText: getTranslated(context, 'email_hint'),
120
-            ),
121
-          ),
122
-          SizedBox(
123
-            height: 10,
124
-          ),
125
-          TextFormField(
126
-            decoration: InputDecoration(
127
-                border: OutlineInputBorder(),
128
-                hintText: getTranslated(context, 'date_of_birth')),
129
-            onTap: () async {
130
-              FocusScope.of(context).requestFocus(FocusNode());
131
-              await showDatePicker(
132
-                context: context,
133
-                initialDate: DateTime.now(),
134
-                firstDate: DateTime(DateTime.now().year),
135
-                lastDate: DateTime(DateTime.now().year + 20),
136
-              );
137
-            },
138
-          ),
139
-          SizedBox(
140
-            height: 10,
141
-          ),
142
-          MaterialButton(
143
-            onPressed: () {
144
-              if (_key.currentState.validate()) {
145
-                _showSuccessDialog();
146
-              }
147
-            },
148
-            height: 50,
149
-            shape: StadiumBorder(),
150
-            color: Theme.of(context).primaryColor,
151
-            child: Center(
152
-              child: Text(
153
-                getTranslated(context, 'submit_info'),
154
-                style: TextStyle(color: Colors.white, fontSize: 20),
155
-              ),
156
-            ),
157
-          )
158
-        ],
159
-      ),
160
-    );
161
-  }
162
-
163
-  Container _drawerList() {
164
-    TextStyle _textStyle = TextStyle(
165
-      color: Colors.white,
166
-      fontSize: 24,
167
-    );
168
-    return Container(
169
-      color: Theme.of(context).primaryColor,
170
-      child: ListView(
171
-        padding: EdgeInsets.zero,
172
-        children: <Widget>[
173
-          DrawerHeader(
174
-            child: Container(
175
-              height: 100,
176
-              child: CircleAvatar(),
177
-            ),
178
-          ),
179
-          ListTile(
180
-            leading: Icon(
181
-              Icons.info,
182
-              color: Colors.white,
183
-              size: 30,
184
-            ),
185
-            title: Text(
186
-              getTranslated(context, 'about_us'),
187
-              style: _textStyle,
188
-            ),
189
-            onTap: () {
190
-              // To close the Drawer
191
-              Navigator.pop(context);
192
-              // Navigating to About Page
193
-              Navigator.pushNamed(context, aboutRoute);
194
-            },
195
-          ),
196
-          ListTile(
197
-            leading: Icon(
198
-              Icons.settings,
199
-              color: Colors.white,
200
-              size: 30,
201
-            ),
202
-            title: Text(
203
-              getTranslated(context, 'settings'),
204
-              style: _textStyle,
205
-            ),
206
-            onTap: () {
207
-              // To close the Drawer
208
-              Navigator.pop(context);
209
-              // Navigating to About Page
210
-              Navigator.pushNamed(context, settingsRoute);
211
-            },
212
-          ),
213
-        ],
214
-      ),
215
-    );
216
-  }
217
-}

+ 0
- 24
fast_med_flutter/lib/pages/not_found_page.dart Ver fichero

@@ -1,24 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-
3
-class NotFoundPage extends StatefulWidget {
4
-  NotFoundPage({Key key}) : super(key: key);
5
-
6
-  @override
7
-  _NotFoundPageState createState() => _NotFoundPageState();
8
-}
9
-
10
-class _NotFoundPageState extends State<NotFoundPage> {
11
-  @override
12
-  Widget build(BuildContext context) {
13
-    return Scaffold(
14
-      appBar: AppBar(
15
-        title: Text("Not Found"),
16
-      ),
17
-      body: Container(
18
-        child: Center(
19
-          child: Text("Sorry, We couldn't found your page"),
20
-        ),
21
-      ),
22
-    );
23
-  }
24
-}

+ 0
- 54
fast_med_flutter/lib/pages/settings_page.dart Ver fichero

@@ -1,54 +0,0 @@
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
-
6
-class SettingsPage extends StatefulWidget {
7
-  SettingsPage({Key key}) : super(key: key);
8
-
9
-  @override
10
-  _SettingsPageState createState() => _SettingsPageState();
11
-}
12
-
13
-class _SettingsPageState extends State<SettingsPage> {
14
-  void _changeLanguage(Language language) async {
15
-    Locale _locale = await setLocale(language.languageCode);
16
-    MyApp.setLocale(context, _locale);
17
-  }
18
-
19
-  @override
20
-  Widget build(BuildContext context) {
21
-    return Scaffold(
22
-      appBar: AppBar(
23
-        title: Text(getTranslated(context, 'settings')),
24
-      ),
25
-      body: Container(
26
-        child: Center(
27
-            child: DropdownButton<Language>(
28
-              iconSize: 30,
29
-              hint: Text(getTranslated(context, 'change_language')),
30
-              onChanged: (Language language) {
31
-                _changeLanguage(language);
32
-              },
33
-              items: Language.languageList()
34
-                  .map<DropdownMenuItem<Language>>(
35
-                    (e) => DropdownMenuItem<Language>(
36
-                  value: e,
37
-                  child: Row(
38
-                    mainAxisAlignment: MainAxisAlignment.spaceAround,
39
-                    children: <Widget>[
40
-                      Text(
41
-                        e.flag,
42
-                        style: TextStyle(fontSize: 30),
43
-                      ),
44
-                      Text(e.name)
45
-                    ],
46
-                  ),
47
-                ),
48
-              )
49
-                  .toList(),
50
-            )),
51
-      ),
52
-    );
53
-  }
54
-}

+ 0
- 21
fast_med_flutter/lib/router/custom_router.dart Ver fichero

@@ -1,21 +0,0 @@
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';
7
-
8
-class CustomRouter {
9
-  static Route<dynamic> generatedRoute(RouteSettings settings) {
10
-    switch (settings.name) {
11
-      case homeRoute:
12
-        return MaterialPageRoute(builder: (_) => HomePage());
13
-      case aboutRoute:
14
-        return MaterialPageRoute(builder: (_) => AboutPage());
15
-      case settingsRoute:
16
-        return MaterialPageRoute(builder: (_) => SettingsPage());
17
-      default:
18
-        return MaterialPageRoute(builder: (_) => NotFoundPage());
19
-    }
20
-  }
21
-}

+ 0
- 3
fast_med_flutter/lib/router/route_constants.dart Ver fichero

@@ -1,3 +0,0 @@
1
-const String homeRoute = "home";
2
-const String aboutRoute = "about";
3
-const String settingsRoute = "settings";

+ 12
- 0
fast_med_flutter/lib/routes/home.dart Ver fichero

@@ -99,6 +99,18 @@ class _HomeState extends State<Home>{
99 99
               color: Colors.purple,
100 100
 
101 101
             ),
102
+            new FlatButton(
103
+              minWidth: 300.0,
104
+              height: 100.0,
105
+              onPressed: (){
106
+                Navigator.pushNamed(context, '/perfil');
107
+              },
108
+              child: Text('perfil',
109
+                style: TextStyle(fontSize: 36),
110
+              ),
111
+              color: Colors.purple,
112
+
113
+            ),
102 114
             //aqui termina lo que merge
103 115
             ],
104 116
         ),

+ 226
- 0
fast_med_flutter/lib/routes/profileinfo.dart Ver fichero

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

+ 0
- 18
flutter_app7.iml Ver fichero

@@ -1,18 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<module type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" inherit-compiler-output="true">
4
-    <exclude-output />
5
-    <content url="file://$MODULE_DIR$">
6
-      <sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
7
-      <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
8
-      <excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
9
-      <excludeFolder url="file://$MODULE_DIR$/.idea" />
10
-      <excludeFolder url="file://$MODULE_DIR$/.pub" />
11
-      <excludeFolder url="file://$MODULE_DIR$/build" />
12
-    </content>
13
-    <orderEntry type="sourceFolder" forTests="false" />
14
-    <orderEntry type="library" name="Dart SDK" level="project" />
15
-    <orderEntry type="library" name="Flutter Plugins" level="project" />
16
-    <orderEntry type="library" name="Dart Packages" level="project" />
17
-  </component>
18
-</module>

BIN
healthpic.jpg Ver fichero


BIN
logo1_mobilehealth.png Ver fichero


+ 0
- 164
package_config.json Ver fichero

@@ -1,164 +0,0 @@
1
-{
2
-  "configVersion": 2,
3
-  "packages": [
4
-    {
5
-      "name": "async",
6
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.5.0-nullsafety.1",
7
-      "packageUri": "lib/",
8
-      "languageVersion": "2.10"
9
-    },
10
-    {
11
-      "name": "boolean_selector",
12
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0-nullsafety.1",
13
-      "packageUri": "lib/",
14
-      "languageVersion": "2.10"
15
-    },
16
-    {
17
-      "name": "characters",
18
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0-nullsafety.3",
19
-      "packageUri": "lib/",
20
-      "languageVersion": "2.10"
21
-    },
22
-    {
23
-      "name": "charcode",
24
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.2.0-nullsafety.1",
25
-      "packageUri": "lib/",
26
-      "languageVersion": "2.10"
27
-    },
28
-    {
29
-      "name": "clock",
30
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.0-nullsafety.1",
31
-      "packageUri": "lib/",
32
-      "languageVersion": "2.10"
33
-    },
34
-    {
35
-      "name": "collection",
36
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0-nullsafety.3",
37
-      "packageUri": "lib/",
38
-      "languageVersion": "2.10"
39
-    },
40
-    {
41
-      "name": "cupertino_icons",
42
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-1.0.0",
43
-      "packageUri": "lib/",
44
-      "languageVersion": "2.0"
45
-    },
46
-    {
47
-      "name": "fake_async",
48
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.2.0-nullsafety.1",
49
-      "packageUri": "lib/",
50
-      "languageVersion": "2.10"
51
-    },
52
-    {
53
-      "name": "flutter",
54
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/packages/flutter",
55
-      "packageUri": "lib/",
56
-      "languageVersion": "2.10"
57
-    },
58
-    {
59
-      "name": "flutter_test",
60
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/packages/flutter_test",
61
-      "packageUri": "lib/",
62
-      "languageVersion": "2.2"
63
-    },
64
-    {
65
-      "name": "intl",
66
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.16.1",
67
-      "packageUri": "lib/",
68
-      "languageVersion": "2.5"
69
-    },
70
-    {
71
-      "name": "matcher",
72
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10-nullsafety.1",
73
-      "packageUri": "lib/",
74
-      "languageVersion": "2.10"
75
-    },
76
-    {
77
-      "name": "meta",
78
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0-nullsafety.3",
79
-      "packageUri": "lib/",
80
-      "languageVersion": "2.10"
81
-    },
82
-    {
83
-      "name": "path",
84
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.0-nullsafety.1",
85
-      "packageUri": "lib/",
86
-      "languageVersion": "2.10"
87
-    },
88
-    {
89
-      "name": "simple_gesture_detector",
90
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/simple_gesture_detector-0.1.4",
91
-      "packageUri": "lib/",
92
-      "languageVersion": "2.1"
93
-    },
94
-    {
95
-      "name": "sky_engine",
96
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/bin/cache/pkg/sky_engine",
97
-      "packageUri": "lib/",
98
-      "languageVersion": "1.11"
99
-    },
100
-    {
101
-      "name": "source_span",
102
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.8.0-nullsafety.2",
103
-      "packageUri": "lib/",
104
-      "languageVersion": "2.10"
105
-    },
106
-    {
107
-      "name": "stack_trace",
108
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0-nullsafety.1",
109
-      "packageUri": "lib/",
110
-      "languageVersion": "2.10"
111
-    },
112
-    {
113
-      "name": "stream_channel",
114
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0-nullsafety.1",
115
-      "packageUri": "lib/",
116
-      "languageVersion": "2.10"
117
-    },
118
-    {
119
-      "name": "string_scanner",
120
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.0-nullsafety.1",
121
-      "packageUri": "lib/",
122
-      "languageVersion": "2.10"
123
-    },
124
-    {
125
-      "name": "table_calendar",
126
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/table_calendar-2.3.0",
127
-      "packageUri": "lib/",
128
-      "languageVersion": "2.7"
129
-    },
130
-    {
131
-      "name": "term_glyph",
132
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.0-nullsafety.1",
133
-      "packageUri": "lib/",
134
-      "languageVersion": "2.10"
135
-    },
136
-    {
137
-      "name": "test_api",
138
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.19-nullsafety.2",
139
-      "packageUri": "lib/",
140
-      "languageVersion": "2.10"
141
-    },
142
-    {
143
-      "name": "typed_data",
144
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0-nullsafety.3",
145
-      "packageUri": "lib/",
146
-      "languageVersion": "2.10"
147
-    },
148
-    {
149
-      "name": "vector_math",
150
-      "rootUri": "file:///C:/Users/Q524U/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0-nullsafety.3",
151
-      "packageUri": "lib/",
152
-      "languageVersion": "2.10"
153
-    },
154
-    {
155
-      "name": "flutter_app7",
156
-      "rootUri": "../",
157
-      "packageUri": "lib/",
158
-      "languageVersion": "2.7"
159
-    }
160
-  ],
161
-  "generated": "2020-11-05T14:27:55.447604Z",
162
-  "generator": "pub",
163
-  "generatorVersion": "2.10.3"
164
-}

+ 0
- 175
pubspec.lock Ver fichero

@@ -1,175 +0,0 @@
1
-# Generated by pub
2
-# See https://dart.dev/tools/pub/glossary#lockfile
3
-packages:
4
-  async:
5
-    dependency: transitive
6
-    description:
7
-      name: async
8
-      url: "https://pub.dartlang.org"
9
-    source: hosted
10
-    version: "2.5.0-nullsafety.1"
11
-  boolean_selector:
12
-    dependency: transitive
13
-    description:
14
-      name: boolean_selector
15
-      url: "https://pub.dartlang.org"
16
-    source: hosted
17
-    version: "2.1.0-nullsafety.1"
18
-  characters:
19
-    dependency: transitive
20
-    description:
21
-      name: characters
22
-      url: "https://pub.dartlang.org"
23
-    source: hosted
24
-    version: "1.1.0-nullsafety.3"
25
-  charcode:
26
-    dependency: transitive
27
-    description:
28
-      name: charcode
29
-      url: "https://pub.dartlang.org"
30
-    source: hosted
31
-    version: "1.2.0-nullsafety.1"
32
-  clock:
33
-    dependency: transitive
34
-    description:
35
-      name: clock
36
-      url: "https://pub.dartlang.org"
37
-    source: hosted
38
-    version: "1.1.0-nullsafety.1"
39
-  collection:
40
-    dependency: transitive
41
-    description:
42
-      name: collection
43
-      url: "https://pub.dartlang.org"
44
-    source: hosted
45
-    version: "1.15.0-nullsafety.3"
46
-  cupertino_icons:
47
-    dependency: "direct main"
48
-    description:
49
-      name: cupertino_icons
50
-      url: "https://pub.dartlang.org"
51
-    source: hosted
52
-    version: "1.0.0"
53
-  fake_async:
54
-    dependency: transitive
55
-    description:
56
-      name: fake_async
57
-      url: "https://pub.dartlang.org"
58
-    source: hosted
59
-    version: "1.2.0-nullsafety.1"
60
-  flutter:
61
-    dependency: "direct main"
62
-    description: flutter
63
-    source: sdk
64
-    version: "0.0.0"
65
-  flutter_test:
66
-    dependency: "direct dev"
67
-    description: flutter
68
-    source: sdk
69
-    version: "0.0.0"
70
-  intl:
71
-    dependency: transitive
72
-    description:
73
-      name: intl
74
-      url: "https://pub.dartlang.org"
75
-    source: hosted
76
-    version: "0.16.1"
77
-  matcher:
78
-    dependency: transitive
79
-    description:
80
-      name: matcher
81
-      url: "https://pub.dartlang.org"
82
-    source: hosted
83
-    version: "0.12.10-nullsafety.1"
84
-  meta:
85
-    dependency: transitive
86
-    description:
87
-      name: meta
88
-      url: "https://pub.dartlang.org"
89
-    source: hosted
90
-    version: "1.3.0-nullsafety.3"
91
-  path:
92
-    dependency: transitive
93
-    description:
94
-      name: path
95
-      url: "https://pub.dartlang.org"
96
-    source: hosted
97
-    version: "1.8.0-nullsafety.1"
98
-  simple_gesture_detector:
99
-    dependency: transitive
100
-    description:
101
-      name: simple_gesture_detector
102
-      url: "https://pub.dartlang.org"
103
-    source: hosted
104
-    version: "0.1.4"
105
-  sky_engine:
106
-    dependency: transitive
107
-    description: flutter
108
-    source: sdk
109
-    version: "0.0.99"
110
-  source_span:
111
-    dependency: transitive
112
-    description:
113
-      name: source_span
114
-      url: "https://pub.dartlang.org"
115
-    source: hosted
116
-    version: "1.8.0-nullsafety.2"
117
-  stack_trace:
118
-    dependency: transitive
119
-    description:
120
-      name: stack_trace
121
-      url: "https://pub.dartlang.org"
122
-    source: hosted
123
-    version: "1.10.0-nullsafety.1"
124
-  stream_channel:
125
-    dependency: transitive
126
-    description:
127
-      name: stream_channel
128
-      url: "https://pub.dartlang.org"
129
-    source: hosted
130
-    version: "2.1.0-nullsafety.1"
131
-  string_scanner:
132
-    dependency: transitive
133
-    description:
134
-      name: string_scanner
135
-      url: "https://pub.dartlang.org"
136
-    source: hosted
137
-    version: "1.1.0-nullsafety.1"
138
-  table_calendar:
139
-    dependency: "direct main"
140
-    description:
141
-      name: table_calendar
142
-      url: "https://pub.dartlang.org"
143
-    source: hosted
144
-    version: "2.3.0"
145
-  term_glyph:
146
-    dependency: transitive
147
-    description:
148
-      name: term_glyph
149
-      url: "https://pub.dartlang.org"
150
-    source: hosted
151
-    version: "1.2.0-nullsafety.1"
152
-  test_api:
153
-    dependency: transitive
154
-    description:
155
-      name: test_api
156
-      url: "https://pub.dartlang.org"
157
-    source: hosted
158
-    version: "0.2.19-nullsafety.2"
159
-  typed_data:
160
-    dependency: transitive
161
-    description:
162
-      name: typed_data
163
-      url: "https://pub.dartlang.org"
164
-    source: hosted
165
-    version: "1.3.0-nullsafety.3"
166
-  vector_math:
167
-    dependency: transitive
168
-    description:
169
-      name: vector_math
170
-      url: "https://pub.dartlang.org"
171
-    source: hosted
172
-    version: "2.1.0-nullsafety.3"
173
-sdks:
174
-  dart: ">=2.10.0-110 <2.11.0"
175
-  flutter: ">=1.17.0 <2.0.0"

+ 0
- 77
pubspec.yaml Ver fichero

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