diff --git a/.gitignore b/.gitignore index 6b5418ff..ebdaebb7 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,5 @@ lib/generated_plugin_registrant.dart .vscode/settings.json .vscode/settings.json .vscode/settings.json +.vscode/settings.json +.vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json index 501a6f1f..e592e48b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "commentBox.styles": { "defaultStyle": { - "commentStartToken": "/* \n *@author: ibrahim albitar \n *@Date:27/4/2020 \n *@param: \n *@return:\n *@desc: ", + "commentStartToken": "/* \n *@author: Amjad Amireh \n *@Date:27/4/2020 \n *@param: \n *@return:\n *@desc: ", "commentEndToken": "\n */", "leftEdgeToken": " * ", "rightEdgeToken": "", diff --git a/lib/routes.dart b/lib/routes.dart index c53868c9..9c87ff2f 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,3 +1,4 @@ + import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart'; @@ -18,6 +19,7 @@ import './screens/doctor/services_screen.dart'; import './screens/medicine/medicine_search_screen.dart'; import './screens/medicine/pharmacies_list_screen.dart'; import './screens/patients/patient_search_screen.dart'; +import './screens/patients/patients_referred_screen.dart'; import './screens/patients/patients_screen.dart'; import './screens/patients/profile/lab_result/lab_orders_screen.dart'; import './screens/patients/profile/patient_profile_screen.dart'; @@ -41,6 +43,7 @@ const String QR_READER = 'qr-reader'; const String PATIENT_SEARCH = 'patients/patient-search'; const String PATIENTS = 'patients/patients'; const String PATIENTS_PROFILE = 'patients/patients-profile'; +const String PATIENTS_REFERRED = 'patients/patients-referred'; const String BLOOD_BANK = 'blood-bank'; const String DOCTOR_REPLY = 'doctor-reply'; const String MEDICINE_SEARCH = 'medicine/medicine-search'; @@ -64,6 +67,7 @@ var routes = { PROFILE: (_) => ProfileScreen(), MY_SCHEDULE: (_) => MyScheduleScreen(), PATIENT_SEARCH: (_) => PatientSearchScreen(), + PATIENTS_REFERRED:(_)=>PatientReferredScreen(), PATIENTS: (_) => PatientsScreen(), QR_READER: (_) => QrReaderScreen(), BLOOD_BANK: (_) => BloodBankScreen(), diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 6dd0478c..2c0963cd 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -58,7 +58,16 @@ class _PatientSearchScreenState extends State { PatientOutSA: false); void _validateInputs() async { +print("============== _selectedType============"+ _selectedType); + if(_selectedType!='3') + { try { + + //==================== + //_selectedType=='3'? + //===================== + + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); @@ -93,6 +102,15 @@ class _PatientSearchScreenState extends State { } catch (err) { handelCatchErrorCase(err); } + } + else + { + Navigator.of(context).pushNamed(PATIENTS_REFERRED, arguments: { + "patientSearchForm": _patientSearchFormValues, + "selectedType": _selectedType + }); + + } } handelCatchErrorCase(err) { diff --git a/lib/screens/patients/patients_referred_screen.dart b/lib/screens/patients/patients_referred_screen.dart new file mode 100644 index 00000000..70a84f03 --- /dev/null +++ b/lib/screens/patients/patients_referred_screen.dart @@ -0,0 +1,102 @@ +/* + *@author: Amjad Amireh Modified Referred Patients + *@Date:27/5/2020 + + + *@desc: + */ + +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable_item_widget.dart'; +import 'package:flutter/material.dart'; + +class PatientReferredScreen extends StatefulWidget { + PatientReferredScreen({Key key}) : super(key: key); + + @override + _PatientReferredScreenState createState() => _PatientReferredScreenState(); +} + +class _PatientReferredScreenState extends State { + + String patientType; + String patientTypetitle; + + List>list_product; + @override + void initState() { + super.initState(); + list_product=new List(); + for(var k=1;k<=5;k++) + { + Map map=Map(); + map.putIfAbsent(getName(k), ()=>getContent()); + list_product.add(map); + + } + list_product.map((s){ + + }).map((list)=>list).toList();} + + + + @override + Widget build(BuildContext context) { + + Listlist=List(); + + return AppScaffold( + appBarTitle: "My Referred Patients",//patientTypetitle, + body: Center( + + child: ListView( + children: [ + for(final map in list_product) + for(final keys in map.keys) + ExpandableItem(keys,map[keys].toList()) + , + ], + ) + ), + + ); + } + + + String getName(int month) + { + switch(month) + { + case 1: + return "Mahmoud Shrouf"; + case 2: + return "Mahmoud Shrouf"; + case 3: + return "Mahmoud Shrouf"; + case 4: + return "Mahmoud Shrouf"; + case 5: + return "Mahmoud Shrouf"; + case 6: + return "Mahmoud Shrouf"; + case 7: + return "Mahmoud Shrouf"; + case 8: + return "Mahmoud Shrouf"; + case 9: + return "Mahmoud Shrouf"; + case 10: + return "Mahmoud Shrouf"; + case 11: + return "Mahmoud Shrouf"; + case 12: + return "Mahmoud Shrouf"; + } + } + + List getContent() + { + + return ["1","2","3","4","5","6"].toList(); + } +} \ No newline at end of file diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 68f01fd8..d945e38d 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -374,8 +374,7 @@ class _PatientsScreenState extends State { .start, children: [ Image.network( - "https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png", - + "https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png", height: 100, width: 100), ], @@ -472,8 +471,9 @@ class _PatientsScreenState extends State { ), ), SizedBox( - width:60, - ), + width: + 60, + ), Container( child: AppText( diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 2ca362b5..156457ff 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -165,6 +165,37 @@ class Helpers { ), ); } + /* + *@author: Amjad Amireh + *@Date:5/5/2020 + *@param: checkDate + *@return: DateTime + *@desc: convert String to DateTime + */ +static String checkDate(String dateString) { + DateTime checkedTime = DateTime.parse(dateString); + DateTime currentTime = DateTime.now(); + + if ((currentTime.year == checkedTime.year) && + (currentTime.month == checkedTime.month) && + (currentTime.day == checkedTime.day)) { + return "Today"; + } else if ((currentTime.year == checkedTime.year) && + (currentTime.month == checkedTime.month)) { + if ((currentTime.day - checkedTime.day) == 1) { + return "YESTERDAY"; + } else if ((currentTime.day - checkedTime.day) == -1) { + return "Tomorrow"; + } + + if ((currentTime.day - checkedTime.day) <= -2) { + return "Next Week"; + } else { + return "Old Date"; + } + } + return "Old Date"; + } /* *@author: Mohammad Aljammal @@ -286,6 +317,9 @@ class Helpers { return myWorkingHours; } + + + /* *@author: Elham Rababah *@Date:12/5/2020 diff --git a/lib/widgets/shared/expandable_item_widget.dart b/lib/widgets/shared/expandable_item_widget.dart new file mode 100644 index 00000000..d369e72a --- /dev/null +++ b/lib/widgets/shared/expandable_item_widget.dart @@ -0,0 +1,91 @@ +/* + *@author: Amjad Amireh + *@Date:27/5/2020 + *@param:listItems , headerTitle + *@return:ListItem Expand + + *@desc: + */ +import 'package:flutter/material.dart'; + +class ExpandableItem extends StatefulWidget{ + + final ListlistItems; + final String headerTitle; + + ExpandableItem(this.headerTitle,this.listItems); + + @override + _ExpandableItemState createState() => _ExpandableItemState(); + +} +class _ExpandableItemState extends State +{ + bool isExpand=false; + @override + void initState() { + super.initState(); + isExpand=false; + } + @override + Widget build(BuildContext context) { + ListlistItem=this.widget.listItems; + return Container( + child: Padding( + padding: (isExpand==true)?const EdgeInsets.all(6.0):const EdgeInsets.all(8.0), + child: Container( + decoration:BoxDecoration( + color: Colors.white, + borderRadius: (isExpand!=true)?BorderRadius.all(Radius.circular(50)):BorderRadius.all(Radius.circular(25)), + + + + + + ), + child: ExpansionTile( + key: PageStorageKey(this.widget.headerTitle), + title: Container( + width: double.infinity, + + child: Text(this.widget.headerTitle,style: TextStyle(fontSize: (isExpand!=true)?18:22,color: Colors.black,fontWeight: FontWeight.bold),)), + + trailing: (isExpand==true)?Icon(Icons.keyboard_arrow_up,color: Colors.black,):Icon(Icons.keyboard_arrow_down,color: Colors.black), + onExpansionChanged: (value){ + setState(() { + isExpand=value; + }); + }, + children: [ + for(final item in listItem) + Padding( + padding: const EdgeInsets.all(8.0), + child: InkWell( + onTap: (){ + print(Text("Selected Item $item "+this.widget.headerTitle )); + //========Stop Snak bar=========== Scaffold.of(context).showSnackBar(SnackBar(backgroundColor: Colors.black,duration:Duration(microseconds: 500),content: Text("Selected Item $item "+this.widget.headerTitle ))); + }, + child: Container( + width: double.infinity, + decoration:BoxDecoration( + color: Colors.white, + + border: Border(top: BorderSide(color: Theme.of(context).dividerColor)) + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text(item,style: TextStyle(color: Colors.black),), + + )), + ), + ) + + + ], + + ), + ), + ), + ); + } +} \ No newline at end of file