Merge branch 'Amjad_search' into 'master'

Amjad search

See merge request Cloud_Solution/doctor_app_flutter!39
merge-requests/40/head
amjad nabil amireh 5 years ago
commit 4a12b38d76

@ -1,7 +1,7 @@
{
"commentBox.styles": {
"defaultStyle": {
"commentStartToken": "/* \n *@author: Elham Rababah \n *@Date:13/4/2020 \n *@param: \n *@return:\n *@desc: ",
"commentStartToken": "/* \n *@author: Amjad Amireh \n *@Date:28/4/2020 \n *@param: \n *@return:\n *@desc: ",
"commentEndToken": "\n */",
"leftEdgeToken": " * ",
"rightEdgeToken": "",

@ -5,5 +5,7 @@ const ONLY_LETTERS = "[a-zA-Z]";
const ONLY_DATE = "[0-9/]";
//*********change value to decode json from Dropdown ************
var SERVICES_PATIANT = ["GetMyOutPatient", "GetMyInPatient", "GtMyDischargePatient","GtMyReferredPatient","GtMyDischargeReferralPatient","GtMyTomorrowPatient","GtMyReferralPatient"];
var SERVICES_PATIANT2 = ["List_MyOutPatient", "List_MyInPatient", "List_MyReferredPatient","List_MyReferredPatient","List_MyDischargeReferredPatient","List_MyTomorrowPatient","List_MyReferralPatient"];
var SERVICES_JSON_PATIANT_LIST = ["List_MyOutPatient", "List_MyInPatient","List_MyDischargePatient" ,"List_MyReferredPatient","List_MyDischargeReferralPatient","List_MyTomorrowPatient","List_MyReferralPatient"];
var SERVICES_PATIANT_HEADER = ["OutPatient", "InPatient", "Discharge","Referred","Referral Discharge","Tomorrow","Referral"];
//******************

@ -1,10 +1,5 @@
import 'dart:convert';
//PatiantInformtion patiantInformtionFromJson(String str) => PatiantInformtion.fromJson(json.decode(str));
////String patiantInformtionToJson(PatiantInformtion data) => json.encode(data.toJson());
//****************************** */
/*
*@author: Amjad Amireh
*@Date:27/4/2020

@ -63,6 +63,20 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
if (_formKey.currentState.validate()) {
// If all data are correct then save data to out variables
<<<<<<< lib/screens/patients/patient_search_screen.dart
// _formKey.currentState.save();
sharedPref.getString(TOKEN).then((token) {
_patientSearchFormValues.TokenID = _patientSearchFormValues,
_patientSearchFormValues.ProjectID= _selectedType
Navigator.of(context).pushNamed(PATIENTS, arguments: {
"patientSearchForm": _patientSearchFormValues,
"selectedType": _selectedType
});
=======
// _formKey.currentState.save();
String token = await sharedPref.getString(TOKEN);
int projectID = await sharedPref.getInt(PROJECT_ID);
@ -72,6 +86,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
Navigator.of(context).pushNamed(PATIENTS, arguments: {
"patientSearchForm": _patientSearchFormValues,
"selectedType": _selectedType
>>>>>>> lib/screens/patients/patient_search_screen.dart
});
} else {
// If all data are not valid then start auto validation.

@ -33,19 +33,18 @@ class PatientsScreen extends StatefulWidget {
class _PatientsScreenState extends State<PatientsScreen> {
List<dynamic> litems;
//*******************
List<PatiantInformtion> responseModelList;
List<String> _locations = ['Today', 'Tomorrow', 'Next Week'];
int _activeLocation = 0;
//*******************
bool _isInit = true;
String patientType;
String patientTypetitle;
var _isLoading = true;
var _hasError;
//*******Amjad add to search box******
//******* search box******
final _controller = TextEditingController();
//**************
PatientModel patient;
@ -53,31 +52,28 @@ class _PatientsScreenState extends State<PatientsScreen> {
@override
void didChangeDependencies() {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
//PatientModel patient = routeArgs['patientSearchForm'];
patient = routeArgs['patientSearchForm'];
//PatiantInformtion patiantInfo = routeArgs['patientSearchForm'];
patient = routeArgs['patientSearchForm'];
print(patient.TokenID + "EEEEEE");
String patientType = routeArgs['selectedType'];
patientType = routeArgs['selectedType'];
patientTypetitle = SERVICES_PATIANT_HEADER[int.parse(patientType)];
print("**************patiant Type**************");
print(patientType);
print("**************test**************");
if (_isInit) {
// setState(() {});
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
patientsProv.getPatientList(patient, patientType).then((res) {
// print('MessageStatus${res['MessageStatus']}');
print('List_MyInPatient${(res['List_MyInPatient'])}');
setState(() {
int val2 = int.parse(patientType);
litems = res[SERVICES_PATIANT2[val2]];
//********************
litems = res[SERVICES_JSON_PATIANT_LIST[val2]];
final List parsed = litems;
responseModelList =
new ModelResponse.fromJson(parsed).list;
responseModelList = new ModelResponse.fromJson(parsed).list;
//********************
_isLoading = false;
_hasError = res['ErrorEndUserMessage'];
@ -96,18 +92,15 @@ class _PatientsScreenState extends State<PatientsScreen> {
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
return AppScaffold(
appBarTitle: 'Patients',
appBarTitle: patientTypetitle,
//***********Modify by amjad (create List view to insert all new data webservise in scroll )*************
body: Container(
child: ListView(scrollDirection: Axis.vertical, children: <Widget>[
Container(
//child:litems == null?Column():Column(children: <Widget>[
child: litems == null
? Column()
: Column(
children: <Widget>[
//*********change to test screen************* */
// child:Column(children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.height * 0.03),
@ -168,18 +161,12 @@ class _PatientsScreenState extends State<PatientsScreen> {
])));
}
//***********amjad update*************
//***********amjad update**buildInputDecoration ***to search box********
InputDecoration buildInputDecoration(BuildContext context, hint) {
return InputDecoration(
prefixIcon: Icon(Icons.search, color: Colors.red),
filled: true,
fillColor: Colors.white,
//Image.asset(asset),
/* icon: Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(Icons.search),
),*/
hintText: hint,
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder(
@ -192,17 +179,12 @@ class _PatientsScreenState extends State<PatientsScreen> {
));
}
//*************
Widget _locationBar(BuildContext _context) {
//*********
//*********
return Container(
height: MediaQuery.of(context).size.height * 0.065,
width: SizeConfig.screenWidth * 0.80,
decoration: BoxDecoration(
color: Color(0Xff59434f), //Color.fromARGB(89, 67, 79,0),
borderRadius: BorderRadius.circular(20)),
color: Color(0Xff59434f), borderRadius: BorderRadius.circular(20)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisSize: MainAxisSize.max,
@ -239,4 +221,3 @@ class _PatientsScreenState extends State<PatientsScreen> {
));
}
}
//***********************

Loading…
Cancel
Save