Browse Source

First commit

hector.sierra 4 years ago
parent
commit
b2113f1dd2

+ 0
- 61
fast_med_flutter/lib/OfficeScreen.dart View File

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

+ 0
- 135
fast_med_flutter/lib/appointments.dart View File

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

+ 0
- 39
fast_med_flutter/lib/dynamic.dart View File

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

+ 0
- 88
fast_med_flutter/lib/navigation.dart View File

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