Merge branch 'mohammad' into 'master'

Mohammad

See merge request Cloud_Solution/doctor_app_flutter!89
merge-requests/90/merge
Mohammad Aljammal 6 years ago
commit c7269374b9

@ -2,8 +2,8 @@ const MAX_SMALL_SCREEN = 660;
const ONLY_NUMBERS = "[0-9]"; const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z]"; const ONLY_LETTERS = "[a-zA-Z]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
//const BASE_URL = 'https://hmgwebservices.com/Services/'; const BASE_URL = 'https://hmgwebservices.com/Services/';
const BASE_URL = 'https://uat.hmgwebservices.com/Services/'; //const BASE_URL = 'https://uat.hmgwebservices.com/Services/';
const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems_Region"; const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems_Region";
const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "DoctorApplication.svc/REST/GetProgressNoteForInPatient"; const PATIENT_PROGRESS_NOTE_URL = "DoctorApplication.svc/REST/GetProgressNoteForInPatient";

@ -25,7 +25,8 @@ import '../util/helpers.dart';
Helpers helpers = Helpers(); Helpers helpers = Helpers();
class PatientsProvider with ChangeNotifier { class PatientsProvider with ChangeNotifier
{
bool isLoading = false; bool isLoading = false;
bool isError = false; bool isError = false;
String error = ''; String error = '';

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/models/my_referral_patient_model.dart'; import 'package:doctor_app_flutter/models/my_referral_patient_model.dart';
import 'package:doctor_app_flutter/models/request_add_referred_doctor_remarks.dart'; import 'package:doctor_app_flutter/models/request_add_referred_doctor_remarks.dart';
import 'package:doctor_app_flutter/models/request_my_referral_patient_model.dart'; import 'package:doctor_app_flutter/models/request_my_referral_patient_model.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -11,6 +12,8 @@ class MyReferralPatientProvider with ChangeNotifier {
bool isLoading = true; bool isLoading = true;
bool isError = false; bool isError = false;
String error = ''; String error = '';
Helpers helpers = Helpers();
RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel();
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks(); RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks();

@ -1,11 +1,10 @@
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
//import 'package:doctor_app_flutter/models/my_referral_patient_model.dart';
import 'package:doctor_app_flutter/models/my_referred_patient_model.dart'; import 'package:doctor_app_flutter/models/my_referred_patient_model.dart';
//import 'package:doctor_app_flutter/models/my_referred_patient_model.dart';
//import 'package:doctor_app_flutter/models/request_add_referred_doctor_remarks.dart';
import 'package:doctor_app_flutter/models/request_my_referral_patient_model.dart'; import 'package:doctor_app_flutter/models/request_my_referral_patient_model.dart';
import 'package:doctor_app_flutter/models/verify_referral_doctor_remarks.dart'; import 'package:doctor_app_flutter/models/verify_referral_doctor_remarks.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import '../util/helpers.dart';
class MyReferredPatientProvider with ChangeNotifier { class MyReferredPatientProvider with ChangeNotifier {
@ -14,9 +13,8 @@ class MyReferredPatientProvider with ChangeNotifier {
bool isLoading = true; bool isLoading = true;
bool isError = false; bool isError = false;
String error = ''; String error = '';
Helpers helpers = Helpers();
RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel();
// RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks();
VerifyReferralDoctorRemarks _verifyreferraldoctorremarks = VerifyReferralDoctorRemarks(); VerifyReferralDoctorRemarks _verifyreferraldoctorremarks = VerifyReferralDoctorRemarks();
MyReferredPatientProvider() { MyReferredPatientProvider() {
getMyReferralPatient(); getMyReferralPatient();
@ -49,16 +47,13 @@ class MyReferredPatientProvider with ChangeNotifier {
} }
} }
// Future replay(
// String referredDoctorRemarks, MyReferredPatientModel model) async { Future verify(
Future replay(
MyReferredPatientModel model) async { MyReferredPatientModel model) async {
try { try {
_verifyreferraldoctorremarks.patientID=model.projectId; _verifyreferraldoctorremarks.patientID=model.projectId;
_verifyreferraldoctorremarks.admissionNo =model.admissionNo; _verifyreferraldoctorremarks.admissionNo =model.admissionNo;
_verifyreferraldoctorremarks.lineItemNo = model.lineItemNo; _verifyreferraldoctorremarks.lineItemNo = model.lineItemNo;
_verifyreferraldoctorremarks.referredDoctorRemarks=model.referredDoctorRemarks; _verifyreferraldoctorremarks.referredDoctorRemarks=model.referredDoctorRemarks;
_verifyreferraldoctorremarks.referringDoctor=model.referringDoctor; _verifyreferraldoctorremarks.referringDoctor=model.referringDoctor;
_verifyreferraldoctorremarks.firstName=model.firstName; _verifyreferraldoctorremarks.firstName=model.firstName;
@ -67,18 +62,9 @@ class MyReferredPatientProvider with ChangeNotifier {
_verifyreferraldoctorremarks.patientMobileNumber=model.mobileNumber; _verifyreferraldoctorremarks.patientMobileNumber=model.mobileNumber;
_verifyreferraldoctorremarks.patientIdentificationID=model.patientIdentificationNo; _verifyreferraldoctorremarks.patientIdentificationID=model.patientIdentificationNo;
await BaseAppClient.post( await BaseAppClient.post(
'DoctorApplication.svc/REST/GtMyReferredPatient', 'DoctorApplication.svc/REST/GtMyReferredPatient',
body: _verifyreferraldoctorremarks.toJson(),//_requestAddReferredDoctorRemarks.toJson(), body: _verifyreferraldoctorremarks.toJson(),
onSuccess: (dynamic body, int statusCode) { onSuccess: (dynamic body, int statusCode) {
listMyReferredPatientModel[ listMyReferredPatientModel[
@ -86,11 +72,11 @@ class MyReferredPatientProvider with ChangeNotifier {
notifyListeners(); notifyListeners();
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
throw (error); throw(error);
}, },
); );
} catch (error) { } catch (error) {
throw error; throw(error);
} }
} }
} }

@ -19,7 +19,7 @@ class MyReferralPatient extends StatelessWidget {
return AppScaffold( return AppScaffold(
showBottomBar: false, showBottomBar: false,
showAppDrawer: false, showAppDrawer: false,
appBarTitle: TranslationBase.of(context).mySchedule, appBarTitle: 'My Referral Patient',
body: referralPatientProvider.isLoading body: referralPatientProvider.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: referralPatientProvider.isError : referralPatientProvider.isError

@ -20,7 +20,7 @@ class MyReferredPatient extends StatelessWidget {
return AppScaffold( return AppScaffold(
showBottomBar: false, showBottomBar: false,
showAppDrawer: false, showAppDrawer: false,
appBarTitle: TranslationBase.of(context).mySchedule, appBarTitle: 'My Referred Patient',
body: referredPatientProvider.isLoading body: referredPatientProvider.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: referredPatientProvider.isError : referredPatientProvider.isError

@ -8,7 +8,7 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
); );
} }
void showSuccesToast(msg) { static void showSuccesToast(msg) {
FlutterFlexibleToast.showToast( FlutterFlexibleToast.showToast(
message: msg, message: msg,
toastLength: Toast.LENGTH_SHORT, toastLength: Toast.LENGTH_SHORT,
@ -20,7 +20,7 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
} }
void showErrorToast(msg) { static void showErrorToast(msg) {
FlutterFlexibleToast.showToast( FlutterFlexibleToast.showToast(
message: msg, message: msg,
toastLength: Toast.LENGTH_SHORT, toastLength: Toast.LENGTH_SHORT,

@ -7,7 +7,6 @@ import '../util/dr_app_toast_msg.dart';
import 'package:connectivity/connectivity.dart'; import 'package:connectivity/connectivity.dart';
DrAppToastMsg toastMsg = DrAppToastMsg();
/* /*
*@author: Elham Rababah *@author: Elham Rababah
@ -126,7 +125,7 @@ class Helpers {
localMsg = msg.toString(); localMsg = msg.toString();
} }
toastMsg.showErrorToast(localMsg); DrAppToastMsg.showErrorToast(localMsg);
} }
/* /*

@ -14,7 +14,6 @@ import '../../util/dr_app_toast_msg.dart';
import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
DrAppToastMsg toastMsg = DrAppToastMsg();
class KnownUserLogin extends StatefulWidget { class KnownUserLogin extends StatefulWidget {
@override @override
@ -80,14 +79,14 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
2; //res['SELECTDeviceIMEIbyIMEI_List'][0]['LogInType']; 2; //res['SELECTDeviceIMEIbyIMEI_List'][0]['LogInType'];
}).catchError((err) { }).catchError((err) {
print('${err}'); print('${err}');
toastMsg.showErrorToast(err); DrAppToastMsg.showErrorToast(err);
}); });
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return DrAppCircularProgressIndeicator(); return DrAppCircularProgressIndeicator();
default: default:
if (snapshot.hasError) { if (snapshot.hasError) {
toastMsg.showErrorToast('Error: ${snapshot.error}'); DrAppToastMsg.showErrorToast('Error: ${snapshot.error}');
return Text('Error: ${snapshot.error}'); return Text('Error: ${snapshot.error}');
} else { } else {
return Column( return Column(
@ -323,6 +322,6 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
} }
showErorrMsg(localMsg) { showErorrMsg(localMsg) {
toastMsg.showErrorToast(localMsg); DrAppToastMsg.showErrorToast(localMsg);
} }
} }

@ -15,7 +15,6 @@ import '../../util/helpers.dart';
import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
DrAppToastMsg toastMsg = DrAppToastMsg();
Helpers helpers = Helpers(); Helpers helpers = Helpers();
class VerifyAccount extends StatefulWidget { class VerifyAccount extends StatefulWidget {
@ -63,7 +62,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
return DrAppCircularProgressIndeicator(); return DrAppCircularProgressIndeicator();
default: default:
if (snapshot.hasError) { if (snapshot.hasError) {
toastMsg.showErrorToast('Error: ${snapshot.error}'); DrAppToastMsg.showErrorToast('Error: ${snapshot.error}');
return Text('Error: ${snapshot.error}'); return Text('Error: ${snapshot.error}');
} else { } else {
return Form( return Form(

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/my_referral_patient_model.dart'; import 'package:doctor_app_flutter/models/my_referral_patient_model.dart';
import 'package:doctor_app_flutter/providers/referral_patient_provider.dart'; import 'package:doctor_app_flutter/providers/referral_patient_provider.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
@ -42,7 +43,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
AppText( AppText(
'${widget.myReferralPatientModel.firstName} ${widget.myReferralPatientModel.lastName}', '${widget.myReferralPatientModel.firstName} ${widget.myReferralPatientModel.lastName}',
@ -67,265 +68,252 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Column( SizedBox(height: 5,),
crossAxisAlignment: CrossAxisAlignment.start, Divider(color: Color(0xFF000000),height: 0.5,),
children: <Widget>[ Table(
Divider(color: Colors.grey), border: TableBorder.symmetric(inside: BorderSide(width: 0.5),),
Row( children: [
children: <Widget>[ TableRow(
children: [
Expanded( Expanded(
child: Column( child: Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
'File No', 'File No',
fontSize: fontSize:
1.7 * SizeConfig.textMultiplier, 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
AppText( AppText(
'${widget.myReferralPatientModel.referringDoctor}', '${widget.myReferralPatientModel.referringDoctor}',
fontSize: fontSize:
1.7 * SizeConfig.textMultiplier, 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
) )
], ],
), ),
),
), ),
Container(
height: SizeConfig.realScreenWidth * 0.1,
width: 0.8,
color: Colors.grey,
margin: EdgeInsets.only(left: 15, right: 15),
),
Expanded( Expanded(
child: Column( child: Container(
crossAxisAlignment: CrossAxisAlignment.start, margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5),
children: <Widget>[ padding: EdgeInsets.all(5),
AppText( child: Column(
'Referring Doctor', crossAxisAlignment: CrossAxisAlignment.start,
fontSize: children: <Widget>[
1.7 * SizeConfig.textMultiplier, AppText(
fontWeight: FontWeight.bold, 'Referring Doctor',
), fontSize:
AppText( 1.7 * SizeConfig.textMultiplier,
widget.myReferralPatientModel fontWeight: FontWeight.bold,
.referringClinicDescription, ),
fontSize: AppText(
1.7 * SizeConfig.textMultiplier, widget.myReferralPatientModel
fontWeight: FontWeight.w300, .referringClinicDescription,
) fontSize:
], 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
), ),
), )
], ]
), ),
TableRow(
Divider(color: Colors.grey), children: [
Row( Expanded(
children: <Widget>[ child: Container(
Expanded( margin: EdgeInsets.all(2.5),
child: Column( padding: EdgeInsets.all(5),
crossAxisAlignment: child: Column(
crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
'Referring Clinic', 'Referring Clinic',
fontSize: fontSize:
1.7 * SizeConfig.textMultiplier, 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
AppText( AppText(
'${widget.myReferralPatientModel.referringClinicDescription}', '${widget.myReferralPatientModel.referringClinicDescription}',
fontSize: fontSize:
1.7 * SizeConfig.textMultiplier, 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
) )
], ],
),
),
), ),
), Expanded(
Container( child: Container(
height: SizeConfig.realScreenWidth * 0.1, margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5),
width: 0.8, padding: EdgeInsets.all(5),
color: Colors.grey, child: Column(
margin: EdgeInsets.only(left: 15, right: 15), crossAxisAlignment:
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
'Frequency', 'Frequency',
fontSize: fontSize:
1.7 * SizeConfig.textMultiplier, 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
AppText( AppText(
widget.myReferralPatientModel widget.myReferralPatientModel
.frequencyDescription, .frequencyDescription,
fontSize: fontSize:
1.7 * SizeConfig.textMultiplier, 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
) )
], ],
), ),
), ),
], )
]
), ),
Divider(color: Colors.grey), TableRow(
Row( children: [
children: <Widget>[
Expanded( Expanded(
child: Column( child: Container(
crossAxisAlignment: margin: EdgeInsets.all(2.5),
CrossAxisAlignment.start, padding: EdgeInsets.all(5),
children: <Widget>[ child: Column(
AppText( crossAxisAlignment:
'Priority', CrossAxisAlignment.start,
fontSize: children: <Widget>[
1.7 * SizeConfig.textMultiplier, AppText(
fontWeight: FontWeight.bold, 'Priority',
), fontSize:
AppText( 1.7 * SizeConfig.textMultiplier,
'${widget.myReferralPatientModel.priorityDescription}', fontWeight: FontWeight.bold,
fontSize: ),
1.7 * SizeConfig.textMultiplier, AppText(
fontWeight: FontWeight.w300, '${widget.myReferralPatientModel.priorityDescription}',
) fontSize:
], 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
), ),
), ),
Container(
height: SizeConfig.realScreenWidth * 0.1,
width: 0.8,
color: Colors.grey,
margin: EdgeInsets.only(left: 15, right: 15),
),
Expanded( Expanded(
child: Column( child: Container(
crossAxisAlignment: margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5),
CrossAxisAlignment.start, padding: EdgeInsets.all(5),
children: <Widget>[ child: Column(
AppText( crossAxisAlignment:
'Max Response Time', CrossAxisAlignment.start,
fontSize: children: <Widget>[
1.7 * SizeConfig.textMultiplier, AppText(
fontWeight: FontWeight.bold, 'Max Response Time',
), fontSize:
AppText( 1.7 * SizeConfig.textMultiplier,
Helpers.getDateFormatted(widget fontWeight: FontWeight.bold,
.myReferralPatientModel ),
.mAXResponseTime), AppText(
fontSize: Helpers.getDateFormatted(widget
1.7 * SizeConfig.textMultiplier, .myReferralPatientModel
fontWeight: FontWeight.w300, .mAXResponseTime),
) fontSize:
], 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
), ),
), )
], ],
), ),
Divider(color: Colors.grey),
],
),
Divider(color: Color(0xFF000000),height: 0.5,),
SizedBox(
height: 5,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText( AppText(
'Clinic Details and Remarks', 'Clinic Details and Remarks',
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,),
),
SizedBox(
height: 5,
),
Texts( Texts(
'73 years old female known case of HTN and dm on regular medication one day prior the patient had rt sided weakness suddenly and reduced level of conscoiusness no vomting no headache no bluriing of vision no other relevant symptoms.\r\nPMH:No history of similar condition no history of surgey or blood transfusions\r\nCT brain was done apparently effaced left insular cortex', '${widget.myReferralPatientModel.referringDoctorRemarks}',
style: "bodyText1", style: "bodyText1",
readMore: true, readMore: true,
textAlign: TextAlign.start, textAlign: TextAlign.start,
maxLength: 100), maxLength: 100)
SizedBox(
height: 5,
),
AppText(
'Answer/Suggestions',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
SizedBox(
height: 5,
),
Form(
key: _formKey,
child: TextFields(
maxLines: 2,
minLines: 2,
hintText: 'Answer the patient',
initialValue: widget.myReferralPatientModel.referredDoctorRemarks ?? '',
readOnly: _isLoading,
validator: (value) {
if (value.isEmpty)
return "please enter answer";
else
return null;
},
),
),
SizedBox(height: 10.0),
if (error != null && error.isNotEmpty)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
color: Theme.of(context)
.errorColor
.withOpacity(0.06),
),
padding: EdgeInsets.symmetric(
vertical: 8.0, horizontal: 12.0),
child: Row(
children: <Widget>[
Expanded(
child: Texts(error ?? "",
style: "bodyText1",
color: Theme.of(context)
.errorColor)),
],
),
),
SizedBox(height: 10.0),
],
),
SizedBox(height: 10.0),
Container(
width: double.infinity,
child: Button(
onTap: () async {
final form = _formKey.currentState;
if (form.validate()) {
setState(() {
_isLoading = true;
});
try {
await Provider.of<MyReferralPatientProvider>(context, listen: false).replay(answerController.text.toString(), widget.myReferralPatientModel);
setState(() {
_isLoading = false;
});
} catch (e) {
setState(() {
error = e.toString();
_isLoading = false;
});
}
}
},
title: 'Reply',
loading: _isLoading,
),
)
], ],
),
SizedBox(
height: 5,
),
AppText(
'Answer/Suggestions',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
SizedBox(
height: 5,
),
Form(
key: _formKey,
child: TextFields(
maxLines: 2,
minLines: 2,
hintText: 'Answer the patient',
fontWeight: FontWeight.normal,
initialValue: widget.myReferralPatientModel.referredDoctorRemarks ?? '',
readOnly: _isLoading,
validator: (value) {
if (value.isEmpty)
return "please enter answer";
else
return null;
},
),
),
SizedBox(height: 10.0),
SizedBox(height: 10.0),
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 10,right: 10),
child: Button(
onTap: () async {
final form = _formKey.currentState;
if (form.validate()) {
setState(() {
_isLoading = true;
});
try {
await Provider.of<MyReferralPatientProvider>(context, listen: false).replay(answerController.text.toString(), widget.myReferralPatientModel);
setState(() {
_isLoading = false;
});
DrAppToastMsg.showSuccesToast('Reply Successfully');
} catch (e) {
setState(() {
_isLoading = false;
});
DrAppToastMsg.showErrorToast(e);
}
}
},
title: 'Reply',
loading: _isLoading,
),
) )
], ],
), ),

@ -1,9 +1,8 @@
import 'package:doctor_app_flutter/models/my_referral_patient_model.dart'; import 'package:doctor_app_flutter/models/my_referral_patient_model.dart';
import 'package:doctor_app_flutter/models/my_referred_patient_model.dart'; import 'package:doctor_app_flutter/models/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/referred_patient_provider.dart'; import 'package:doctor_app_flutter/providers/referred_patient_provider.dart';
@ -18,35 +17,24 @@ import 'package:flutter/cupertino.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class MyReferredPatientWidget extends StatefulWidget { class MyReferredPatientWidget extends StatefulWidget {
final MyReferredPatientModel myReferredPatientModel;
final MyReferredPatientModel myReferredPatientModel; MyReferredPatientWidget({Key key, this.myReferredPatientModel});
MyReferredPatientWidget({Key key, this.myReferredPatientModel});
@override @override
_MyReferredPatientWidgetState createState() => _MyReferredPatientWidgetState(); _MyReferredPatientWidgetState createState() =>
_MyReferredPatientWidgetState();
} }
class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> { class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
bool _showDetails = false; bool _showDetails = false;
bool _isLoading = false; bool _isLoading = false;
final _formKey = GlobalKey<FormState>();
String error;
TextEditingController answerController; TextEditingController answerController;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
} }
@override @override
@ -58,7 +46,6 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
AppText( AppText(
'${widget.myReferredPatientModel.firstName} ${widget.myReferredPatientModel.lastName}', '${widget.myReferredPatientModel.firstName} ${widget.myReferredPatientModel.lastName}',
@ -86,181 +73,205 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Divider(color: Colors.grey), SizedBox(
height: 5,
// VerticalDivider(color: Colors.black,
// thickness: 2, width: 20,
// indent: 200,
// endIndent: 200,),
Row(
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
'File No',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.patientId}',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
height: SizeConfig.realScreenWidth * .1,//0.1,
width: 0.8,
color: Colors.grey,
margin: EdgeInsets.only(left: 15, right: 15),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
'Referral Doctor',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
Texts(
widget.myReferredPatientModel
.referralDoctorName,
maxLength: 80,
readMore: true,
),
],
),
),
],
), ),
Divider(
Divider(color: Colors.grey), color: Color(0xFF000000),
Row( height: 0.5,
children: <Widget>[ ),
Expanded( Table(
child: Column( border: TableBorder.symmetric(
crossAxisAlignment: inside: BorderSide(width: 0.5),
CrossAxisAlignment.start, ),
children: <Widget>[ children: [
AppText( TableRow(children: [
'Referring Clinic', Expanded(
fontSize: child: Container(
1.7 * SizeConfig.textMultiplier, margin: EdgeInsets.all(2.5),
fontWeight: FontWeight.bold, padding: EdgeInsets.all(5),
decoration: BoxDecoration(),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'File No',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.patientId}',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
), ),
AppText( ),
'${widget.myReferredPatientModel.referralClinicDescription}',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
), ),
), Expanded(
Container( child: Container(
height: SizeConfig.realScreenWidth * 0.1, margin: EdgeInsets.only(
width: 0.8, left: 4,
color: Colors.grey, top: 2.5,
margin: EdgeInsets.only(left: 15, right: 15), right: 2.5,
), bottom: 2.5),
Expanded( padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
'Frequency', 'Referral Doctor',
fontSize: fontSize:
1.7 * SizeConfig.textMultiplier, 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
),
Texts(
widget.myReferredPatientModel
.referralDoctorName,
maxLength: 80,
readMore: true,
),
],
), ),
AppText( ),
widget.myReferredPatientModel
.frequencyDescription,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
), ),
), ]),
], TableRow(
), children: [
Divider(color: Colors.grey), Expanded(
Row( child: Container(
children: <Widget>[ margin: EdgeInsets.all(2.5),
Expanded( padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
'Priority', 'Referring Clinic',
fontSize: fontSize: 1.7 *
1.7 * SizeConfig.textMultiplier, SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.referralClinicDescription}',
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
), ),
AppText( ),
'${widget.myReferredPatientModel.priorityDescription}', Expanded(
fontSize: child: Container(
1.7 * SizeConfig.textMultiplier, margin: EdgeInsets.only(
fontWeight: FontWeight.w300, left: 4,
) top: 2.5,
], right: 2.5,
), bottom: 2.5),
), padding: EdgeInsets.all(5),
Container( child: Column(
height: SizeConfig.realScreenWidth * 0.1, crossAxisAlignment:
width: 0.8, CrossAxisAlignment.start,
color: Colors.grey, children: <Widget>[
margin: EdgeInsets.only(left: 15, right: 15), AppText(
'Frequency',
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
widget.myReferredPatientModel
.frequencyDescription,
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
)
],
), ),
Expanded( TableRow(children: [
child: Column( Expanded(
crossAxisAlignment: child: Container(
CrossAxisAlignment.start, margin: EdgeInsets.all(2.5),
children: <Widget>[ padding: EdgeInsets.all(5),
AppText( child: Column(
'Max Response Time', crossAxisAlignment:
fontSize: CrossAxisAlignment.start,
1.7 * SizeConfig.textMultiplier, children: <Widget>[
fontWeight: FontWeight.bold, AppText(
'Priority',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.priorityDescription}',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
), ),
AppText( ),
Helpers.getDateFormatted(widget
.myReferredPatientModel
.maxResponseTime),
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
), ),
), Expanded(
child: Container(
margin: EdgeInsets.only(
left: 4,
top: 2.5,
right: 2.5,
bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'Max Response Time',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
Helpers.getDateFormatted(widget
.myReferredPatientModel
.maxResponseTime),
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
)
])
], ],
), ),
Divider(color: Colors.grey), Divider(
color: Color(0xFF000000),
height: 0.5,
),
SizedBox(
height: 5,
),
AppText( AppText(
'Clinic Details and Remarks', 'Clinic Details and Remarks',
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
), ),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Texts(
Texts(
'${widget.myReferredPatientModel.referringDoctorRemarks}', '${widget.myReferredPatientModel.referringDoctorRemarks}',
style: "bodyText1", style: "bodyText1",
readMore: true, readMore: true,
@ -278,8 +289,7 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Texts(
Texts(
'${widget.myReferredPatientModel.referredDoctorRemarks}', '${widget.myReferredPatientModel.referredDoctorRemarks}',
style: "bodyText1", style: "bodyText1",
readMore: true, readMore: true,
@ -288,54 +298,26 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
SizedBox( SizedBox(
height: 5, height: 5,
), ),
SizedBox(height: 10.0),
if (error != null && error.isNotEmpty)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
color: Theme.of(context)
.errorColor
.withOpacity(0.06),
),
padding: EdgeInsets.symmetric(
vertical: 8.0, horizontal: 12.0),
child: Row(
children: <Widget>[
Expanded(
child: Texts(error ?? "",
style: "bodyText1",
color: Theme.of(context)
.errorColor)),
],
),
),
SizedBox(height: 10.0),
],
),
SizedBox(height: 10.0), SizedBox(height: 10.0),
Container( Container(
width: double.infinity, width: double.infinity,
child: Button( child: Button(
onTap: () async { onTap: () async {
final form = _formKey.currentState; try {
setState(() {
try { _isLoading = true;
await Provider.of<MyReferredPatientProvider>(context, listen: false).replay(widget.myReferredPatientModel); });
await Provider.of<MyReferredPatientProvider>(context, listen: false).verify(widget.myReferredPatientModel);
setState(() { setState(() {
_isLoading = false; _isLoading = false;
}); });
} catch (e) { DrAppToastMsg.showSuccesToast('Verify Successfully');
setState(() { } catch (e) {
error = e.toString(); setState(() {
_isLoading = false; _isLoading = false;
}); });
} DrAppToastMsg.showErrorToast(e);
}
}, },
title: 'Verify', title: 'Verify',
loading: _isLoading, loading: _isLoading,
@ -351,4 +333,4 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
), ),
); );
} }
} }

@ -226,7 +226,7 @@ class _TextsState extends State<Texts> {
}, },
child: Text(hidden ? "Read More" : "Read less", child: Text(hidden ? "Read More" : "Read less",
style: _getFontStyle().copyWith( style: _getFontStyle().copyWith(
color: Hexcolor('#515b5d'), color: Hexcolor('#FF0000'),
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontFamily: "WorkSans" fontFamily: "WorkSans"
) )

@ -21,6 +21,7 @@ class CardWithBgWidgetNew extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
//margin: EdgeInsets.symmetric(vertical: 10.0),
margin: EdgeInsets.symmetric(vertical: 10.0), margin: EdgeInsets.symmetric(vertical: 10.0),
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -33,10 +34,15 @@ class CardWithBgWidgetNew extends StatelessWidget {
color: Hexcolor('#FFFFFF'), color: Hexcolor('#FFFFFF'),
child: Stack( child: Stack(
children: [ children: [
Container( Center(
padding: EdgeInsets.all(10.0), child: Container(
margin: EdgeInsets.only(left: 10), padding:EdgeInsets.fromLTRB(0, 10,0, 10), //EdgeInsets.all(10.0),//10
child: widget) // margin: EdgeInsets.only(left: 10),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: widget,
)),
)
], ],
), ),
), ),

Loading…
Cancel
Save