diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 8b6467b1..2c0963cd 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -58,8 +58,8 @@ class _PatientSearchScreenState extends State { PatientOutSA: false); void _validateInputs() async { - - if(_selectedType=='2') +print("============== _selectedType============"+ _selectedType); + if(_selectedType!='3') { try { @@ -102,7 +102,7 @@ class _PatientSearchScreenState extends State { } catch (err) { handelCatchErrorCase(err); } - } + } else { Navigator.of(context).pushNamed(PATIENTS_REFERRED, arguments: { diff --git a/lib/screens/patients/patients_referred_screen.dart b/lib/screens/patients/patients_referred_screen.dart index c0ba5dfe..9b03adcb 100644 --- a/lib/screens/patients/patients_referred_screen.dart +++ b/lib/screens/patients/patients_referred_screen.dart @@ -1,3 +1,12 @@ +/* + *@author: Amjad Amireh Modified Referred Patients + *@Date:27/5/2020 + + + *@desc: + */ +import 'package:doctor_app_flutter/widgets/patients/list_item.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; class PatientReferredScreen extends StatefulWidget { @@ -11,10 +20,82 @@ 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) { - return Container( - child: Text("Refferrd Patiant"),//child, + + 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) + ListItem(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/widgets/patients/list_item.dart b/lib/widgets/patients/list_item.dart index d400d3c4..069e2fa5 100644 --- a/lib/widgets/patients/list_item.dart +++ b/lib/widgets/patients/list_item.dart @@ -1,13 +1,11 @@ /* *@author: Amjad Amireh *@Date:27/5/2020 - *@param: - *@return:Create Expand list with snakebar notification + *@param:listItems , headerTitle + *@return:ListItem Expand *@desc: */ - - import 'package:flutter/material.dart'; class ListItem extends StatefulWidget{ @@ -28,7 +26,6 @@ class ListItemState extends State bool isExpand=false; @override void initState() { - // TODO: implement initState super.initState(); isExpand=false; } @@ -40,16 +37,21 @@ class ListItemState extends State 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) + 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),)), - trailing: (isExpand==true)?Icon(Icons.keyboard_arrow_up,size: 32,color: Colors.black,):Icon(Icons.keyboard_arrow_down,size: 32,color: Colors.black), + + 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; @@ -61,18 +63,20 @@ class ListItemState extends State 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 ))); + 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.grey, - borderRadius: BorderRadius.all(Radius.circular(4)), - border: Border.all(color: Colors.grey) + 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.white),), + child: Text(item,style: TextStyle(color: Colors.black),), + )), ), )