Merge branch 'mohammad' into 'master'

Mohammad

See merge request Cloud_Solution/doctor_app_flutter!66
merge-requests/67/merge
Mohammad Aljammal 6 years ago
commit 425b60405d

@ -44,3 +44,13 @@ var SERVICES_PATIANT_HEADER = [
// Colors ////// by : ibrahim // Colors ////// by : ibrahim
const PRIMARY_COLOR = 0xff58434F; const PRIMARY_COLOR = 0xff58434F;
const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '11.11.11.11';
const VERSION_ID = 1.2;
const CHANNEL = 9;
const SESSION_ID = '2Z7FX4Lokp';
const IS_LOGIN_FOR_DOCTOR_APP = true;
const PATIENT_OUT_SA = false;

@ -1,3 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart';
class RequestDoctorReply { class RequestDoctorReply {
int projectID; int projectID;
int doctorID; int doctorID;
@ -13,18 +15,18 @@ class RequestDoctorReply {
bool patientOutSA; bool patientOutSA;
RequestDoctorReply( RequestDoctorReply(
{this.projectID = 15, {this.projectID ,
this.doctorID = 70907, this.doctorID ,
this.transactionNo = 0, this.transactionNo = TRANSACTION_NO,
this.languageID = 2, this.languageID = LANGUAGE_ID,
this.stamp = '2020-04-27T12:17:17.721Z', this.stamp = STAMP,
this.iPAdress = '11.11.11.11', this.iPAdress = IP_ADDRESS,
this.versionID = 1.2, this.versionID = VERSION_ID,
this.channel = 9, this.channel = CHANNEL,
this.tokenID = '@dm!n', this.tokenID ,
this.sessionID = '2Z7FX4Lokp', this.sessionID = SESSION_ID,
this.isLoginForDoctorApp = true, this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP,
this.patientOutSA = false}); this.patientOutSA = PATIENT_OUT_SA});
RequestDoctorReply.fromJson(Map<String, dynamic> json) { RequestDoctorReply.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID']; projectID = json['ProjectID'];

@ -1,3 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart';
class RequestSchedule { class RequestSchedule {
int projectID; int projectID;
int clinicID; int clinicID;
@ -14,21 +16,21 @@ class RequestSchedule {
bool patientOutSA; bool patientOutSA;
int patientTypeID; int patientTypeID;
RequestSchedule( RequestSchedule({
this.projectID, this.projectID,
this.clinicID, this.clinicID,
this.doctorID, this.doctorID,
this.doctorWorkingHoursDays, this.doctorWorkingHoursDays = 7,
this.languageID, this.languageID = LANGUAGE_ID,
this.stamp, this.stamp = STAMP,
this.iPAdress, this.iPAdress = IP_ADDRESS,
this.versionID, this.versionID = VERSION_ID,
this.channel, this.channel = CHANNEL,
this.tokenID, this.tokenID,
this.sessionID, this.sessionID = SESSION_ID,
this.isLoginForDoctorApp, this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP,
this.patientOutSA, this.patientOutSA = PATIENT_OUT_SA,
this.patientTypeID); this.patientTypeID = 1});
RequestSchedule.fromJson(Map<String, dynamic> json) { RequestSchedule.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID']; projectID = json['ProjectID'];

@ -20,24 +20,24 @@ class DoctorReplyProvider with ChangeNotifier {
bool isLoading = true; bool isLoading = true;
bool isError = false; bool isError = false;
String error = ''; String error = '';
RequestDoctorReply _requestSchedule = RequestDoctorReply(); RequestDoctorReply _requestDoctorReply = RequestDoctorReply();
DoctorReplyProvider() { DoctorReplyProvider() {
getDoctorSchedule(); getDoctorReply();
} }
getDoctorSchedule() async { getDoctorReply() async {
const url = BASE_URL + 'DoctorApplication.svc/REST/GtMyPatientsQuestions'; const url = BASE_URL + 'DoctorApplication.svc/REST/GtMyPatientsQuestions';
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
_requestSchedule.doctorID = doctorProfile.doctorID; _requestDoctorReply.doctorID = doctorProfile.doctorID;
_requestSchedule.projectID = doctorProfile.projectID; _requestDoctorReply.projectID = doctorProfile.projectID;
_requestSchedule.tokenID = token; _requestDoctorReply.tokenID = token;
try { try {
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = await client.post(url, final response = await client.post(url,
body: json.encode(_requestSchedule.toJson())); body: json.encode(_requestDoctorReply.toJson()));
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
isLoading = false; isLoading = false;

@ -20,7 +20,7 @@ class ScheduleProvider with ChangeNotifier {
bool isLoading = true; bool isLoading = true;
bool isError = false; bool isError = false;
String error = ''; String error = '';
RequestSchedule requestSchedule = RequestSchedule(15, 1, 1485, 7, 2, '2020-04-22T11:25:57.640Z', '11.11.11.11', 1.2, 9, '2lMDFT8U+Uy5jxRzCO8n2w==', 'vV6tg9yyVJ222', true, false, 1); RequestSchedule requestSchedule = RequestSchedule();
ScheduleProvider() { ScheduleProvider() {
getDoctorSchedule(); getDoctorSchedule();

@ -1,6 +1,7 @@
import 'package:barcode_scan/platform_wrapper.dart'; import 'package:barcode_scan/platform_wrapper.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart';
@ -153,6 +154,14 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
patientList = []; patientList = [];
}); });
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
// Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
// DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);
// patient.PatientID = 8808;
// patient.TokenID = token;
// patient.setDoctorID = doctorProfile.projectID;
// patient.setClinicID = doctorProfile.clinicID;
// patient.setProjectID = doctorProfile.projectID;
// Provider.of<PatientsProvider>(context, listen: false);
patient.PatientID = 8808; patient.PatientID = 8808;
patient.TokenID = token; patient.TokenID = token;
Provider.of<PatientsProvider>(context, listen: false) Provider.of<PatientsProvider>(context, listen: false)

Loading…
Cancel
Save