Carlos hace 3 años
padre
commit
8affc6dd6c
Se han modificado 40 ficheros con 703 adiciones y 1145 borrados
  1. 1
    1
      fast_med_flutter/README.md
  2. 1
    1
      fast_med_flutter/android/app/build.gradle
  3. 1
    1
      fast_med_flutter/android/app/src/debug/AndroidManifest.xml
  4. 3
    12
      fast_med_flutter/android/app/src/main/AndroidManifest.xml
  5. 1
    1
      fast_med_flutter/android/app/src/main/kotlin/com/example/userstory2translate/MainActivity.kt
  6. 1
    1
      fast_med_flutter/android/app/src/main/res/drawable/launch_background.xml
  7. 18
    0
      fast_med_flutter/android/app/src/main/res/values-night/styles.xml
  8. 4
    4
      fast_med_flutter/android/app/src/main/res/values/styles.xml
  9. 1
    1
      fast_med_flutter/android/app/src/profile/AndroidManifest.xml
  10. 1
    0
      fast_med_flutter/ios/Flutter/Debug.xcconfig
  11. 1
    0
      fast_med_flutter/ios/Flutter/Release.xcconfig
  12. 41
    0
      fast_med_flutter/ios/Podfile
  13. 3
    3
      fast_med_flutter/ios/Runner.xcodeproj/project.pbxproj
  14. 1
    1
      fast_med_flutter/ios/Runner/Info.plist
  15. 17
    0
      fast_med_flutter/lib/classes/language.dart
  16. 15
    0
      fast_med_flutter/lib/languages/en.json
  17. 15
    0
      fast_med_flutter/lib/languages/es.json
  18. 42
    0
      fast_med_flutter/lib/localization/language_constants.dart
  19. 51
    0
      fast_med_flutter/lib/localization/localization.dart
  20. 78
    16
      fast_med_flutter/lib/main.dart
  21. 26
    0
      fast_med_flutter/lib/pages/about_page.dart
  22. 217
    0
      fast_med_flutter/lib/pages/home_page.dart
  23. 24
    0
      fast_med_flutter/lib/pages/not_found_page.dart
  24. 54
    0
      fast_med_flutter/lib/pages/settings_page.dart
  25. 21
    0
      fast_med_flutter/lib/router/custom_router.dart
  26. 3
    0
      fast_med_flutter/lib/router/route_constants.dart
  27. 0
    347
      fast_med_flutter/lib/routes/calendario.dart
  28. 0
    87
      fast_med_flutter/lib/routes/home.dart
  29. 0
    33
      fast_med_flutter/lib/routes/main.dart
  30. 0
    161
      fast_med_flutter/lib/routes/register.dart
  31. 0
    91
      fast_med_flutter/lib/routes/ver_oficinas.dart
  32. 0
    201
      fast_med_flutter/lib/routes/welcome.dart
  33. 0
    13
      fast_med_flutter/lib/widgets/DataTableMySqlDemo/Oficina.dart
  34. 0
    46
      fast_med_flutter/lib/widgets/DataTableMySqlDemo/Services.dart
  35. 0
    1
      fast_med_flutter/lib/widgets/MySQL_DataTable/dud.dart
  36. 0
    0
      fast_med_flutter/lib/widgets/data_table/dud.dart
  37. 0
    1
      fast_med_flutter/lib/widgets/dud.dart
  38. 50
    110
      fast_med_flutter/pubspec.lock
  39. 10
    10
      fast_med_flutter/pubspec.yaml
  40. 2
    2
      fast_med_flutter/test/widget_test.dart

+ 1
- 1
fast_med_flutter/README.md Ver fichero

@@ -1,4 +1,4 @@
1
-# fast_med_flutter
1
+# userstory2translate
2 2
 
3 3
 A new Flutter application.
4 4
 

+ 1
- 1
fast_med_flutter/android/app/build.gradle Ver fichero

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

+ 1
- 1
fast_med_flutter/android/app/src/debug/AndroidManifest.xml Ver fichero

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

+ 3
- 12
fast_med_flutter/android/app/src/main/AndroidManifest.xml Ver fichero

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

fast_med_flutter/android/app/src/main/kotlin/com/example/fast_med_flutter/MainActivity.kt → fast_med_flutter/android/app/src/main/kotlin/com/example/userstory2translate/MainActivity.kt Ver fichero

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

+ 1
- 1
fast_med_flutter/android/app/src/main/res/drawable/launch_background.xml Ver fichero

@@ -1,7 +1,7 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <!-- Modify this file to customize your launch splash screen -->
3 3
 <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4
-    <item android:drawable="@android:color/white" />
4
+    <item android:drawable="?android:colorBackground" />
5 5
 
6 6
     <!-- You can insert your own image assets here -->
7 7
     <!-- <item>

+ 18
- 0
fast_med_flutter/android/app/src/main/res/values-night/styles.xml Ver fichero

@@ -0,0 +1,18 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<resources>
3
+    <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
4
+    <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
5
+        <!-- Show a splash screen on the activity. Automatically removed when
6
+             Flutter draws its first frame -->
7
+        <item name="android:windowBackground">@drawable/launch_background</item>
8
+    </style>
9
+    <!-- Theme applied to the Android Window as soon as the process has started.
10
+         This theme determines the color of the Android Window while your
11
+         Flutter UI initializes, as well as behind your Flutter UI while its
12
+         running.
13
+         
14
+         This Theme is only used starting with V2 of Flutter's Android embedding. -->
15
+    <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
16
+        <item name="android:windowBackground">?android:colorBackground</item>
17
+    </style>
18
+</resources>

+ 4
- 4
fast_med_flutter/android/app/src/main/res/values/styles.xml Ver fichero

@@ -1,7 +1,7 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <resources>
3
-    <!-- Theme applied to the Android Window while the process is starting -->
4
-    <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
3
+    <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
4
+    <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
5 5
         <!-- Show a splash screen on the activity. Automatically removed when
6 6
              Flutter draws its first frame -->
7 7
         <item name="android:windowBackground">@drawable/launch_background</item>
@@ -12,7 +12,7 @@
12 12
          running.
13 13
          
14 14
          This Theme is only used starting with V2 of Flutter's Android embedding. -->
15
-    <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
16
-        <item name="android:windowBackground">@android:color/white</item>
15
+    <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
16
+        <item name="android:windowBackground">?android:colorBackground</item>
17 17
     </style>
18 18
 </resources>

+ 1
- 1
fast_med_flutter/android/app/src/profile/AndroidManifest.xml Ver fichero

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

+ 1
- 0
fast_med_flutter/ios/Flutter/Debug.xcconfig Ver fichero

@@ -1 +1,2 @@
1
+#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
1 2
 #include "Generated.xcconfig"

+ 1
- 0
fast_med_flutter/ios/Flutter/Release.xcconfig Ver fichero

@@ -1 +1,2 @@
1
+#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
1 2
 #include "Generated.xcconfig"

+ 41
- 0
fast_med_flutter/ios/Podfile Ver fichero

@@ -0,0 +1,41 @@
1
+# Uncomment this line to define a global platform for your project
2
+# platform :ios, '9.0'
3
+
4
+# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5
+ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6
+
7
+project 'Runner', {
8
+  'Debug' => :debug,
9
+  'Profile' => :release,
10
+  'Release' => :release,
11
+}
12
+
13
+def flutter_root
14
+  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15
+  unless File.exist?(generated_xcode_build_settings_path)
16
+    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17
+  end
18
+
19
+  File.foreach(generated_xcode_build_settings_path) do |line|
20
+    matches = line.match(/FLUTTER_ROOT\=(.*)/)
21
+    return matches[1].strip if matches
22
+  end
23
+  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24
+end
25
+
26
+require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27
+
28
+flutter_ios_podfile_setup
29
+
30
+target 'Runner' do
31
+  use_frameworks!
32
+  use_modular_headers!
33
+
34
+  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35
+end
36
+
37
+post_install do |installer|
38
+  installer.pods_project.targets.each do |target|
39
+    flutter_additional_ios_build_settings(target)
40
+  end
41
+end

+ 3
- 3
fast_med_flutter/ios/Runner.xcodeproj/project.pbxproj Ver fichero

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

+ 1
- 1
fast_med_flutter/ios/Runner/Info.plist Ver fichero

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

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

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

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

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

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

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

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

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

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

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

+ 78
- 16
fast_med_flutter/lib/main.dart Ver fichero

@@ -1,19 +1,81 @@
1
-import 'package:fast_med_flutter/routes/home.dart';
2
-import 'package:fast_med_flutter/routes/ver_oficinas.dart';
3
-import 'package:fast_med_flutter/routes/calendario.dart';
4
-import 'package:fast_med_flutter/routes/main.dart';
5
-import 'package:fast_med_flutter/routes/register.dart';
6
-import 'package:fast_med_flutter/routes/welcome.dart';
7 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';
5
+import 'package:flutter_localizations/flutter_localizations.dart';
8 6
 
9
-void main() => runApp(MaterialApp(
10
-    initialRoute: '/home',
11
-    routes: {
12
-      '/home': (context) => Home(),
13
-      '/verOficinas': (context) => VerOficinas(),
14
-      '/calendario': (context) => Calendario(),
15
-      '/welcome': (context) => WelcomePage(),
16
-      '/register': (context) => RegisterPage(),
17
-      '/MyApp': (context) => MyApp(),
7
+import 'localization/language_constants.dart';
8
+
9
+void main() => runApp(MyApp());
10
+
11
+class MyApp extends StatefulWidget {
12
+  const MyApp({Key key}) : super(key: key);
13
+  static void setLocale(BuildContext context, Locale newLocale) {
14
+    _MyAppState state = context.findAncestorStateOfType<_MyAppState>();
15
+    state.setLocale(newLocale);
16
+  }
17
+
18
+  @override
19
+  _MyAppState createState() => _MyAppState();
20
+}
21
+
22
+class _MyAppState extends State<MyApp> {
23
+  Locale _locale;
24
+  setLocale(Locale locale) {
25
+    setState(() {
26
+      _locale = locale;
27
+    });
28
+  }
29
+
30
+  @override
31
+  void didChangeDependencies() {
32
+    getLocale().then((locale) {
33
+      setState(() {
34
+        this._locale = locale;
35
+      });
36
+    });
37
+    super.didChangeDependencies();
38
+  }
39
+
40
+  @override
41
+  Widget build(BuildContext context) {
42
+    if (this._locale == null) {
43
+      return Container(
44
+        child: Center(
45
+          child: CircularProgressIndicator(
46
+              valueColor: AlwaysStoppedAnimation<Color>(Colors.blue[800])),
47
+        ),
48
+      );
49
+    } else {
50
+      return MaterialApp(
51
+        debugShowCheckedModeBanner: false,
52
+        title: "Flutter Localization Demo",
53
+        theme: ThemeData(primarySwatch: Colors.blue),
54
+        locale: _locale,
55
+        supportedLocales: [
56
+          Locale("en", "US"),
57
+          Locale("fa", "IR"),
58
+          Locale("es", "SP"),
59
+          Locale("hi", "IN")
60
+        ],
61
+        localizationsDelegates: [
62
+          DemoLocalization.delegate,
63
+          GlobalMaterialLocalizations.delegate,
64
+          GlobalWidgetsLocalizations.delegate,
65
+          GlobalCupertinoLocalizations.delegate,
66
+        ],
67
+        localeResolutionCallback: (locale, supportedLocales) {
68
+          for (var supportedLocale in supportedLocales) {
69
+            if (supportedLocale.languageCode == locale.languageCode &&
70
+                supportedLocale.countryCode == locale.countryCode) {
71
+              return supportedLocale;
72
+            }
73
+          }
74
+          return supportedLocales.first;
75
+        },
76
+        onGenerateRoute: CustomRouter.generatedRoute,
77
+        initialRoute: homeRoute,
78
+      );
18 79
     }
19
-));
80
+  }
81
+}

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

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

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

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

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

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

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

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

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

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

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

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

+ 0
- 347
fast_med_flutter/lib/routes/calendario.dart Ver fichero

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

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

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

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

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

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

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

+ 0
- 91
fast_med_flutter/lib/routes/ver_oficinas.dart Ver fichero

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

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

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

+ 0
- 13
fast_med_flutter/lib/widgets/DataTableMySqlDemo/Oficina.dart Ver fichero

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

+ 0
- 46
fast_med_flutter/lib/widgets/DataTableMySqlDemo/Services.dart Ver fichero

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

+ 0
- 1
fast_med_flutter/lib/widgets/MySQL_DataTable/dud.dart Ver fichero

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

+ 0
- 0
fast_med_flutter/lib/widgets/data_table/dud.dart Ver fichero


+ 0
- 1
fast_med_flutter/lib/widgets/dud.dart Ver fichero

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

+ 50
- 110
fast_med_flutter/pubspec.lock Ver fichero

@@ -43,20 +43,6 @@ packages:
43 43
       url: "https://pub.dartlang.org"
44 44
     source: hosted
45 45
     version: "1.15.0-nullsafety.3"
46
-  convert:
47
-    dependency: transitive
48
-    description:
49
-      name: convert
50
-      url: "https://pub.dartlang.org"
51
-    source: hosted
52
-    version: "2.1.1"
53
-  crypto:
54
-    dependency: transitive
55
-    description:
56
-      name: crypto
57
-      url: "https://pub.dartlang.org"
58
-    source: hosted
59
-    version: "2.1.5"
60 46
   cupertino_icons:
61 47
     dependency: "direct main"
62 48
     description:
@@ -85,65 +71,40 @@ packages:
85 71
       url: "https://pub.dartlang.org"
86 72
     source: hosted
87 73
     version: "5.2.1"
88
-  flushbar:
89
-    dependency: transitive
90
-    description:
91
-      name: flushbar
92
-      url: "https://pub.dartlang.org"
93
-    source: hosted
94
-    version: "1.10.4"
95 74
   flutter:
96 75
     dependency: "direct main"
97 76
     description: flutter
98 77
     source: sdk
99 78
     version: "0.0.0"
100
-  flutter_login:
101
-    dependency: "direct main"
102
-    description:
103
-      name: flutter_login
104
-      url: "https://pub.dartlang.org"
105
-    source: hosted
106
-    version: "1.0.14"
79
+  flutter_localizations:
80
+    dependency: "direct dev"
81
+    description: flutter
82
+    source: sdk
83
+    version: "0.0.0"
107 84
   flutter_test:
108 85
     dependency: "direct dev"
109 86
     description: flutter
110 87
     source: sdk
111 88
     version: "0.0.0"
112
-  font_awesome_flutter:
89
+  flutter_web_plugins:
113 90
     dependency: transitive
114
-    description:
115
-      name: font_awesome_flutter
116
-      url: "https://pub.dartlang.org"
117
-    source: hosted
118
-    version: "8.10.0"
119
-  google_fonts:
120
-    dependency: "direct main"
121
-    description:
122
-      name: google_fonts
123
-      url: "https://pub.dartlang.org"
124
-    source: hosted
125
-    version: "1.1.1"
126
-  http:
127
-    dependency: "direct main"
128
-    description:
129
-      name: http
130
-      url: "https://pub.dartlang.org"
131
-    source: hosted
132
-    version: "0.12.2"
133
-  http_parser:
91
+    description: flutter
92
+    source: sdk
93
+    version: "0.0.0"
94
+  intl:
134 95
     dependency: transitive
135 96
     description:
136
-      name: http_parser
97
+      name: intl
137 98
       url: "https://pub.dartlang.org"
138 99
     source: hosted
139
-    version: "3.1.4"
140
-  intl:
100
+    version: "0.16.1"
101
+  js:
141 102
     dependency: transitive
142 103
     description:
143
-      name: intl
104
+      name: js
144 105
       url: "https://pub.dartlang.org"
145 106
     source: hosted
146
-    version: "0.16.1"
107
+    version: "0.6.3-nullsafety.1"
147 108
   matcher:
148 109
     dependency: transitive
149 110
     description:
@@ -157,14 +118,7 @@ packages:
157 118
       name: meta
158 119
       url: "https://pub.dartlang.org"
159 120
     source: hosted
160
-    version: "1.3.0-nullsafety.3"
161
-  nested:
162
-    dependency: transitive
163
-    description:
164
-      name: nested
165
-      url: "https://pub.dartlang.org"
166
-    source: hosted
167
-    version: "0.0.4"
121
+    version: "1.3.0-nullsafety.4"
168 122
   path:
169 123
     dependency: transitive
170 124
     description:
@@ -172,13 +126,6 @@ packages:
172 126
       url: "https://pub.dartlang.org"
173 127
     source: hosted
174 128
     version: "1.8.0-nullsafety.1"
175
-  path_provider:
176
-    dependency: transitive
177
-    description:
178
-      name: path_provider
179
-      url: "https://pub.dartlang.org"
180
-    source: hosted
181
-    version: "1.6.24"
182 129
   path_provider_linux:
183 130
     dependency: transitive
184 131
     description:
@@ -186,13 +133,6 @@ packages:
186 133
       url: "https://pub.dartlang.org"
187 134
     source: hosted
188 135
     version: "0.0.1+2"
189
-  path_provider_macos:
190
-    dependency: transitive
191
-    description:
192
-      name: path_provider_macos
193
-      url: "https://pub.dartlang.org"
194
-    source: hosted
195
-    version: "0.0.4+6"
196 136
   path_provider_platform_interface:
197 137
     dependency: transitive
198 138
     description:
@@ -207,13 +147,6 @@ packages:
207 147
       url: "https://pub.dartlang.org"
208 148
     source: hosted
209 149
     version: "0.0.4+3"
210
-  pedantic:
211
-    dependency: transitive
212
-    description:
213
-      name: pedantic
214
-      url: "https://pub.dartlang.org"
215
-    source: hosted
216
-    version: "1.9.2"
217 150
   platform:
218 151
     dependency: transitive
219 152
     description:
@@ -235,27 +168,48 @@ packages:
235 168
       url: "https://pub.dartlang.org"
236 169
     source: hosted
237 170
     version: "3.0.13"
238
-  provider:
171
+  shared_preferences:
172
+    dependency: "direct dev"
173
+    description:
174
+      name: shared_preferences
175
+      url: "https://pub.dartlang.org"
176
+    source: hosted
177
+    version: "0.5.12+4"
178
+  shared_preferences_linux:
179
+    dependency: transitive
180
+    description:
181
+      name: shared_preferences_linux
182
+      url: "https://pub.dartlang.org"
183
+    source: hosted
184
+    version: "0.0.2+4"
185
+  shared_preferences_macos:
239 186
     dependency: transitive
240 187
     description:
241
-      name: provider
188
+      name: shared_preferences_macos
242 189
       url: "https://pub.dartlang.org"
243 190
     source: hosted
244
-    version: "4.3.2+2"
245
-  quiver:
191
+    version: "0.0.1+11"
192
+  shared_preferences_platform_interface:
246 193
     dependency: transitive
247 194
     description:
248
-      name: quiver
195
+      name: shared_preferences_platform_interface
249 196
       url: "https://pub.dartlang.org"
250 197
     source: hosted
251
-    version: "2.1.5"
252
-  simple_gesture_detector:
198
+    version: "1.0.4"
199
+  shared_preferences_web:
253 200
     dependency: transitive
254 201
     description:
255
-      name: simple_gesture_detector
202
+      name: shared_preferences_web
256 203
       url: "https://pub.dartlang.org"
257 204
     source: hosted
258
-    version: "0.1.4"
205
+    version: "0.1.2+7"
206
+  shared_preferences_windows:
207
+    dependency: transitive
208
+    description:
209
+      name: shared_preferences_windows
210
+      url: "https://pub.dartlang.org"
211
+    source: hosted
212
+    version: "0.0.1+3"
259 213
   sky_engine:
260 214
     dependency: transitive
261 215
     description: flutter
@@ -274,7 +228,7 @@ packages:
274 228
       name: stack_trace
275 229
       url: "https://pub.dartlang.org"
276 230
     source: hosted
277
-    version: "1.10.0-nullsafety.1"
231
+    version: "1.10.0-nullsafety.2"
278 232
   stream_channel:
279 233
     dependency: transitive
280 234
     description:
@@ -289,13 +243,6 @@ packages:
289 243
       url: "https://pub.dartlang.org"
290 244
     source: hosted
291 245
     version: "1.1.0-nullsafety.1"
292
-  table_calendar:
293
-    dependency: "direct main"
294
-    description:
295
-      name: table_calendar
296
-      url: "https://pub.dartlang.org"
297
-    source: hosted
298
-    version: "2.3.0"
299 246
   term_glyph:
300 247
     dependency: transitive
301 248
     description:
@@ -310,13 +257,6 @@ packages:
310 257
       url: "https://pub.dartlang.org"
311 258
     source: hosted
312 259
     version: "0.2.19-nullsafety.2"
313
-  transformer_page_view:
314
-    dependency: transitive
315
-    description:
316
-      name: transformer_page_view
317
-      url: "https://pub.dartlang.org"
318
-    source: hosted
319
-    version: "0.1.6"
320 260
   typed_data:
321 261
     dependency: transitive
322 262
     description:
@@ -337,7 +277,7 @@ packages:
337 277
       name: win32
338 278
       url: "https://pub.dartlang.org"
339 279
     source: hosted
340
-    version: "1.7.3"
280
+    version: "1.7.4"
341 281
   xdg_directories:
342 282
     dependency: transitive
343 283
     description:
@@ -346,5 +286,5 @@ packages:
346 286
     source: hosted
347 287
     version: "0.1.2"
348 288
 sdks:
349
-  dart: ">=2.10.0-110 <2.11.0"
350
-  flutter: ">=1.17.0 <2.0.0"
289
+  dart: ">=2.10.0-110 <=2.11.0-213.1.beta"
290
+  flutter: ">=1.12.13+hotfix.5 <2.0.0"

+ 10
- 10
fast_med_flutter/pubspec.yaml Ver fichero

@@ -1,4 +1,4 @@
1
-name: fast_med_flutter
1
+name: userstory2translate
2 2
 description: A new Flutter application.
3 3
 
4 4
 # The following line prevents the package from being accidentally published to
@@ -28,16 +28,14 @@ dependencies:
28 28
   # The following adds the Cupertino Icons font to your application.
29 29
   # Use with the CupertinoIcons class for iOS style icons.
30 30
   cupertino_icons: ^1.0.0
31
-  table_calendar: ^2,0,1
32
-  flutter_login: ^1.0.14
33
-  google_fonts: ^1.1.1
34
-
35
-  #
36
-  http: ^0.12.2
37 31
 
38 32
 dev_dependencies:
39 33
   flutter_test:
40 34
     sdk: flutter
35
+  flutter_localizations:
36
+    sdk: flutter
37
+  shared_preferences: ^0.5.6+2
38
+
41 39
 
42 40
 # For information on the generic Dart part of this file, see the
43 41
 # following page: https://dart.dev/tools/pub/pubspec
@@ -51,9 +49,11 @@ flutter:
51 49
   uses-material-design: true
52 50
 
53 51
   # To add assets to your application, add an assets section, like this:
54
-  # assets:
55
-  #   - images/a_dot_burr.jpeg
56
-  #   - images/a_dot_ham.jpeg
52
+  assets:
53
+    - lib/languages/en.json
54
+    - lib/languages/es.json
55
+    #- lib/languages/fa.json
56
+    #- lib/languages/hi.json
57 57
 
58 58
   # An image asset can refer to one or more resolution-specific "variants", see
59 59
   # https://flutter.dev/assets-and-images/#resolution-aware.

+ 2
- 2
fast_med_flutter/test/widget_test.dart Ver fichero

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