diff --git a/lib/routes.dart b/lib/routes.dart index f2f5f6bb..cb194c5b 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,3 +1,5 @@ + + import './screens/patients/profile/vital_sign/body_measurements_screen.dart'; import './screens/QR_reader_screen.dart'; @@ -13,6 +15,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'; @@ -36,6 +39,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'; @@ -56,6 +60,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 d5bfd7be..2eab35c1 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 { + + if(_selectedType=='2') + { 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..c0ba5dfe --- /dev/null +++ b/lib/screens/patients/patients_referred_screen.dart @@ -0,0 +1,20 @@ +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; + @override + Widget build(BuildContext context) { + return Container( + child: Text("Refferrd Patiant"),//child, + ); + } +} \ 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/widgets/patients/list_item.dart b/lib/widgets/patients/list_item.dart new file mode 100644 index 00000000..d400d3c4 --- /dev/null +++ b/lib/widgets/patients/list_item.dart @@ -0,0 +1,87 @@ +/* + *@author: Amjad Amireh + *@Date:27/5/2020 + *@param: + *@return:Create Expand list with snakebar notification + + *@desc: + */ + + +import 'package:flutter/material.dart'; + +class ListItem extends StatefulWidget{ + + ListlistItems; + String headerTitle; + + ListItem(this.headerTitle,this.listItems); + + @override + StatecreateState() + { + return ListItemState(); + } +} +class ListItemState extends State +{ + bool isExpand=false; + @override + void initState() { + // TODO: implement initState + super.initState(); + isExpand=false; + } + @override + Widget build(BuildContext context) { + ListlistItem=this.widget.listItems; + return Padding( + padding: (isExpand==true)?const EdgeInsets.all(8.0):const EdgeInsets.all(12.0), + child: Container( + decoration:BoxDecoration( + color: Colors.white, + borderRadius: (isExpand!=true)?BorderRadius.all(Radius.circular(8)):BorderRadius.all(Radius.circular(22)), + border: Border.all(color: Colors.white) + ), + child: ExpansionTile( + key: PageStorageKey(this.widget.headerTitle), + title: Container( + width: double.infinity, + + child: Text(this.widget.headerTitle,style: TextStyle(fontSize: (isExpand!=true)?18:22),)), + trailing: (isExpand==true)?Icon(Icons.keyboard_arrow_up,size: 32,color: Colors.black,):Icon(Icons.keyboard_arrow_down,size: 32,color: Colors.black), + onExpansionChanged: (value){ + setState(() { + isExpand=value; + }); + }, + children: [ + for(final item in listItem) + Padding( + padding: const EdgeInsets.all(8.0), + child: InkWell( + onTap: (){ + 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.grey, + borderRadius: BorderRadius.all(Radius.circular(4)), + border: Border.all(color: Colors.grey) + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text(item,style: TextStyle(color: Colors.white),), + )), + ), + ) + + + ], + + ), + ), + ); + } +} \ No newline at end of file