Merge branch 'master' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into elham
commit
7e154e47c0
@ -0,0 +1,60 @@
|
|||||||
|
class RequestDoctorReply {
|
||||||
|
int projectID;
|
||||||
|
int doctorID;
|
||||||
|
int transactionNo;
|
||||||
|
int languageID;
|
||||||
|
String stamp;
|
||||||
|
String iPAdress;
|
||||||
|
double versionID;
|
||||||
|
int channel;
|
||||||
|
String tokenID;
|
||||||
|
String sessionID;
|
||||||
|
bool isLoginForDoctorApp;
|
||||||
|
bool patientOutSA;
|
||||||
|
|
||||||
|
RequestDoctorReply(
|
||||||
|
{this.projectID = 15,
|
||||||
|
this.doctorID = 70907,
|
||||||
|
this.transactionNo = 0,
|
||||||
|
this.languageID = 2,
|
||||||
|
this.stamp = '2020-04-27T12:17:17.721Z',
|
||||||
|
this.iPAdress = '11.11.11.11',
|
||||||
|
this.versionID = 1.2,
|
||||||
|
this.channel = 9,
|
||||||
|
this.tokenID = '@dm!n',
|
||||||
|
this.sessionID = '2Z7FX4Lokp',
|
||||||
|
this.isLoginForDoctorApp = true,
|
||||||
|
this.patientOutSA = false});
|
||||||
|
|
||||||
|
RequestDoctorReply.fromJson(Map<String, dynamic> json) {
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
doctorID = json['DoctorID'];
|
||||||
|
transactionNo = json['TransactionNo'];
|
||||||
|
languageID = json['LanguageID'];
|
||||||
|
stamp = json['stamp'];
|
||||||
|
iPAdress = json['IPAdress'];
|
||||||
|
versionID = json['VersionID'];
|
||||||
|
channel = json['Channel'];
|
||||||
|
tokenID = json['TokenID'];
|
||||||
|
sessionID = json['SessionID'];
|
||||||
|
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
|
||||||
|
patientOutSA = json['PatientOutSA'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['DoctorID'] = this.doctorID;
|
||||||
|
data['TransactionNo'] = this.transactionNo;
|
||||||
|
data['LanguageID'] = this.languageID;
|
||||||
|
data['stamp'] = this.stamp;
|
||||||
|
data['IPAdress'] = this.iPAdress;
|
||||||
|
data['VersionID'] = this.versionID;
|
||||||
|
data['Channel'] = this.channel;
|
||||||
|
data['TokenID'] = this.tokenID;
|
||||||
|
data['SessionID'] = this.sessionID;
|
||||||
|
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
|
||||||
|
data['PatientOutSA'] = this.patientOutSA;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,108 @@
|
|||||||
|
class ListGtMyPatientsQuestions {
|
||||||
|
String setupID;
|
||||||
|
int projectID;
|
||||||
|
int transactionNo;
|
||||||
|
int patientType;
|
||||||
|
int patientID;
|
||||||
|
int doctorID;
|
||||||
|
int requestType;
|
||||||
|
String requestDate;
|
||||||
|
String requestTime;
|
||||||
|
String remarks;
|
||||||
|
int status;
|
||||||
|
int createdBy;
|
||||||
|
String createdOn;
|
||||||
|
int editedBy;
|
||||||
|
String editedOn;
|
||||||
|
String patientName;
|
||||||
|
String patientNameN;
|
||||||
|
int gender;
|
||||||
|
String dateofBirth;
|
||||||
|
String mobileNumber;
|
||||||
|
String emailAddress;
|
||||||
|
String age;
|
||||||
|
String genderDescription;
|
||||||
|
bool isVidaCall;
|
||||||
|
|
||||||
|
ListGtMyPatientsQuestions(
|
||||||
|
{this.setupID,
|
||||||
|
this.projectID,
|
||||||
|
this.transactionNo,
|
||||||
|
this.patientType,
|
||||||
|
this.patientID,
|
||||||
|
this.doctorID,
|
||||||
|
this.requestType,
|
||||||
|
this.requestDate,
|
||||||
|
this.requestTime,
|
||||||
|
this.remarks,
|
||||||
|
this.status,
|
||||||
|
this.createdBy,
|
||||||
|
this.createdOn,
|
||||||
|
this.editedBy,
|
||||||
|
this.editedOn,
|
||||||
|
this.patientName,
|
||||||
|
this.patientNameN,
|
||||||
|
this.gender,
|
||||||
|
this.dateofBirth,
|
||||||
|
this.mobileNumber,
|
||||||
|
this.emailAddress,
|
||||||
|
this.age,
|
||||||
|
this.genderDescription,
|
||||||
|
this.isVidaCall});
|
||||||
|
|
||||||
|
ListGtMyPatientsQuestions.fromJson(Map<String, dynamic> json) {
|
||||||
|
setupID = json['SetupID'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
transactionNo = json['TransactionNo'];
|
||||||
|
patientType = json['PatientType'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
doctorID = json['DoctorID'];
|
||||||
|
requestType = json['RequestType'];
|
||||||
|
requestDate = json['RequestDate'];
|
||||||
|
requestTime = json['RequestTime'];
|
||||||
|
remarks = json['Remarks'];
|
||||||
|
status = json['Status'];
|
||||||
|
createdBy = json['CreatedBy'];
|
||||||
|
createdOn = json['CreatedOn'];
|
||||||
|
editedBy = json['EditedBy'];
|
||||||
|
editedOn = json['EditedOn'];
|
||||||
|
patientName = json['PatientName'];
|
||||||
|
patientNameN = json['PatientNameN'];
|
||||||
|
gender = json['Gender'];
|
||||||
|
dateofBirth = json['DateofBirth'];
|
||||||
|
mobileNumber = json['MobileNumber'];
|
||||||
|
emailAddress = json['EmailAddress'];
|
||||||
|
age = json['Age'];
|
||||||
|
genderDescription = json['GenderDescription'];
|
||||||
|
isVidaCall = json['IsVidaCall'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['SetupID'] = this.setupID;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['TransactionNo'] = this.transactionNo;
|
||||||
|
data['PatientType'] = this.patientType;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['DoctorID'] = this.doctorID;
|
||||||
|
data['RequestType'] = this.requestType;
|
||||||
|
data['RequestDate'] = this.requestDate;
|
||||||
|
data['RequestTime'] = this.requestTime;
|
||||||
|
data['Remarks'] = this.remarks;
|
||||||
|
data['Status'] = this.status;
|
||||||
|
data['CreatedBy'] = this.createdBy;
|
||||||
|
data['CreatedOn'] = this.createdOn;
|
||||||
|
data['EditedBy'] = this.editedBy;
|
||||||
|
data['EditedOn'] = this.editedOn;
|
||||||
|
data['PatientName'] = this.patientName;
|
||||||
|
data['PatientNameN'] = this.patientNameN;
|
||||||
|
data['Gender'] = this.gender;
|
||||||
|
data['DateofBirth'] = this.dateofBirth;
|
||||||
|
data['MobileNumber'] = this.mobileNumber;
|
||||||
|
data['EmailAddress'] = this.emailAddress;
|
||||||
|
data['Age'] = this.age;
|
||||||
|
data['GenderDescription'] = this.genderDescription;
|
||||||
|
data['IsVidaCall'] = this.isVidaCall;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/RequestDoctorReply.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/list_gt_my_pationents_question_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:http/http.dart';
|
||||||
|
import 'package:http_interceptor/http_client_with_interceptor.dart';
|
||||||
|
|
||||||
|
import '../interceptor/http_interceptor.dart';
|
||||||
|
|
||||||
|
class DoctorReplyProvider with ChangeNotifier {
|
||||||
|
Client client =
|
||||||
|
HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]);
|
||||||
|
|
||||||
|
List<ListGtMyPatientsQuestions> listDoctorWorkingHoursTable = [];
|
||||||
|
bool isLoading = true;
|
||||||
|
bool isError = false;
|
||||||
|
String error = '';
|
||||||
|
RequestDoctorReply _requestSchedule = RequestDoctorReply();
|
||||||
|
|
||||||
|
DoctorReplyProvider() {
|
||||||
|
getDoctorSchedule();
|
||||||
|
}
|
||||||
|
|
||||||
|
getDoctorSchedule() async {
|
||||||
|
const url = BASE_URL + 'DoctorApplication.svc/REST/GtMyPatientsQuestions';
|
||||||
|
try {
|
||||||
|
if (await Helpers.checkConnection()) {
|
||||||
|
final response = await client.post(url,
|
||||||
|
body: json.encode(_requestSchedule.toJson()));
|
||||||
|
final int statusCode = response.statusCode;
|
||||||
|
if (statusCode < 200 || statusCode >= 400 || json == null) {
|
||||||
|
isLoading = false;
|
||||||
|
isError = true;
|
||||||
|
error = 'Error While Fetching data';
|
||||||
|
} else {
|
||||||
|
var parsed = json.decode(response.body.toString());
|
||||||
|
if (parsed['MessageStatus'] == 1) {
|
||||||
|
parsed['List_GtMyPatientsQuestions'].forEach((v) {
|
||||||
|
listDoctorWorkingHoursTable.add( ListGtMyPatientsQuestions.fromJson(v));
|
||||||
|
});
|
||||||
|
isError = false;
|
||||||
|
isLoading = false;
|
||||||
|
} else {
|
||||||
|
isError = true;
|
||||||
|
error = parsed['ErrorMessage'] ?? parsed['ErrorEndUserMessage'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
isLoading = false;
|
||||||
|
isError = true;
|
||||||
|
error = 'Please Check The Internet Connection';
|
||||||
|
}
|
||||||
|
notifyListeners();
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,125 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/providers/doctor_reply_provider.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hexcolor/hexcolor.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
/*
|
||||||
|
*@author: Mohammad Aljammal
|
||||||
|
*@Date:28/4/2020
|
||||||
|
*@param:
|
||||||
|
*@return:
|
||||||
|
*@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service
|
||||||
|
*/
|
||||||
|
class DoctorReplyScreen extends StatelessWidget {
|
||||||
|
|
||||||
|
DoctorReplyProvider _doctorReplyProvider;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
_doctorReplyProvider = Provider.of(context);
|
||||||
|
return AppScaffold(
|
||||||
|
appBarTitle: 'Doctor Reply',
|
||||||
|
showAppDrawer: false,
|
||||||
|
body:_doctorReplyProvider.isLoading? DrAppCircularProgressIndeicator():
|
||||||
|
_doctorReplyProvider.isError? Center(
|
||||||
|
child: Text(
|
||||||
|
_doctorReplyProvider.error,
|
||||||
|
style: TextStyle(color: Theme.of(context).errorColor),
|
||||||
|
),
|
||||||
|
):
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
|
||||||
|
child: ListView(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: _doctorReplyProvider.listDoctorWorkingHoursTable.map((reply) {
|
||||||
|
return CardWithBgWidget(
|
||||||
|
widget: Container(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
reply.patientName,
|
||||||
|
fontSize: 2.5 * SizeConfig.textMultiplier,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
AppText(
|
||||||
|
reply.remarks,
|
||||||
|
fontSize: 2.5 * SizeConfig.textMultiplier,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
'Time',
|
||||||
|
fontSize: 2.5 * SizeConfig.textMultiplier,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 10),
|
||||||
|
child: AppText(
|
||||||
|
reply.requestTime,
|
||||||
|
fontSize: 2.5 * SizeConfig.textMultiplier,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
'File No',
|
||||||
|
fontSize: 2.5 * SizeConfig.textMultiplier,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 10),
|
||||||
|
child: AppText(
|
||||||
|
'${reply.patientID}',
|
||||||
|
fontSize: 2.5 * SizeConfig.textMultiplier,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
'Mobile No',
|
||||||
|
fontSize: 2.5 * SizeConfig.textMultiplier,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 10),
|
||||||
|
child: AppText(
|
||||||
|
reply.mobileNumber,
|
||||||
|
fontSize: 2.5 * SizeConfig.textMultiplier,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,9 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
class DoctorReplyScreen extends StatelessWidget {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(title: Text('DoctorReply'),),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue