Change design patiant profile

merge-requests/89/head
Amjad Amireh 6 years ago
parent 02f45e21f7
commit c792aa1fc7

@ -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 = '';

@ -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,15 +62,6 @@ 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(),//_requestAddReferredDoctorRemarks.toJson(),
@ -86,11 +72,11 @@ class MyReferredPatientProvider with ChangeNotifier {
notifyListeners(); notifyListeners();
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
throw (error); helpers.showErrorToast(error);
}, },
); );
} catch (error) { } catch (error) {
throw error; helpers.showErrorToast(error);
} }
} }
} }

@ -1,9 +1,7 @@
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: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 +16,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 +45,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,43 +72,48 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Divider(color: Colors.grey), Divider(color: Colors.grey),
// VerticalDivider(color: Colors.black, // VerticalDivider(color: Colors.black,
// thickness: 2, width: 20, // thickness: 2, width: 20,
// indent: 200, // indent: 200,
// endIndent: 200,), // endIndent: 200,),
Row( Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
children: <Widget>[ CrossAxisAlignment.start,
AppText( children: <Widget>[
'File No', AppText(
fontSize: 'File No',
1.7 * SizeConfig.textMultiplier, fontSize:
fontWeight: FontWeight.bold, 1.7 * SizeConfig.textMultiplier,
), fontWeight: FontWeight.bold,
AppText( ),
'${widget.myReferredPatientModel.patientId}', AppText(
fontSize: '${widget.myReferredPatientModel.patientId}',
1.7 * SizeConfig.textMultiplier, fontSize:
fontWeight: FontWeight.w300, 1.7 * SizeConfig.textMultiplier,
) fontWeight: FontWeight.w300,
], )
), ],
),
), ),
Container( Container(
height: SizeConfig.realScreenWidth * .1,//0.1, height:
SizeConfig.realScreenWidth * .1, //0.1,
width: 0.8, width: 0.8,
color: Colors.grey, color: Colors.grey,
margin: EdgeInsets.only(left: 15, right: 15), margin: EdgeInsets.only(left: 15, right: 15),
), ),
// VerticalDivider(color:Colors.black,thickness: 1, width: 2,
// indent: 1,
// endIndent: 2,),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
'Referral Doctor', 'Referral Doctor',
@ -133,10 +124,9 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
Texts( Texts(
widget.myReferredPatientModel widget.myReferredPatientModel
.referralDoctorName, .referralDoctorName,
maxLength: 80, maxLength: 80,
readMore: true, readMore: true,
), ),
], ],
), ),
), ),
@ -260,7 +250,7 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
height: 5, height: 5,
), ),
Texts( Texts(
'${widget.myReferredPatientModel.referringDoctorRemarks}', '${widget.myReferredPatientModel.referringDoctorRemarks}',
style: "bodyText1", style: "bodyText1",
readMore: true, readMore: true,
@ -279,7 +269,7 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
height: 5, height: 5,
), ),
Texts( Texts(
'${widget.myReferredPatientModel.referredDoctorRemarks}', '${widget.myReferredPatientModel.referredDoctorRemarks}',
style: "bodyText1", style: "bodyText1",
readMore: true, readMore: true,
@ -289,53 +279,18 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
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; await Provider.of<MyReferredPatientProvider>(
context,
try { listen: false)
await Provider.of<MyReferredPatientProvider>(context, listen: false).replay(widget.myReferredPatientModel); .verify(widget.myReferredPatientModel);
setState(() {
setState(() { _isLoading = false;
_isLoading = false; });
});
} catch (e) {
setState(() {
error = e.toString();
_isLoading = false;
});
}
}, },
title: 'Verify', title: 'Verify',
loading: _isLoading, loading: _isLoading,

@ -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