Merge branch 'diplomatic-quarter-live' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into diplomatic-quarter-haroon

fix_issues
haroon amjad 4 years ago
commit 6062716209

@ -1,68 +1,68 @@
class GetAllSharedRecordsByStatusResponse { class GetAllSharedRecordsByStatusResponse {
Null date; dynamic date;
int languageID; int languageID;
int serviceName; int serviceName;
Null time; dynamic time;
Null androidLink; dynamic androidLink;
Null authenticationTokenID; dynamic authenticationTokenID;
Null data; dynamic data;
bool dataw; bool dataw;
int dietType; int dietType;
Null errorCode; dynamic errorCode;
Null errorEndUserMessage; dynamic errorEndUserMessage;
Null errorEndUserMessageN; dynamic errorEndUserMessageN;
Null errorMessage; dynamic errorMessage;
int errorType; int errorType;
int foodCategory; int foodCategory;
Null iOSLink; dynamic iOSLink;
bool isAuthenticated; bool isAuthenticated;
int mealOrderStatus; int mealOrderStatus;
int mealType; int mealType;
int messageStatus; int messageStatus;
int numberOfResultRecords; int numberOfResultRecords;
Null patientBlodType; dynamic patientBlodType;
Null successMsg; dynamic successMsg;
Null successMsgN; dynamic successMsgN;
Null doctorInformationList; dynamic doctorInformationList;
Null getAllPendingRecordsList; List<GetAllSharedRecordsByStatusList> getAllPendingRecordsList;
List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList; List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList;
Null getResponseFileList; List<GetAllSharedRecordsByStatusList> getResponseFileList;
bool isHMGPatient; bool isHMGPatient;
bool isLoginSuccessfully; bool isLoginSuccessfully;
bool isNeedUpdateIdintificationNo; bool isNeedUpdateIdintificationNo;
bool kioskSendSMS; bool kioskSendSMS;
Null list; dynamic list;
Null listAskHabibMobileLoginInfo; dynamic listAskHabibMobileLoginInfo;
Null listAskHabibPatientFile; dynamic listAskHabibPatientFile;
Null listMergeFiles; dynamic listMergeFiles;
Null listMobileLoginInfo; dynamic listMobileLoginInfo;
Null listPatientCount; dynamic listPatientCount;
Null logInTokenID; dynamic logInTokenID;
Null mohemmPrivilegeList; dynamic mohemmPrivilegeList;
int pateintID; int pateintID;
Null patientBloodType; dynamic patientBloodType;
Null patientERDriverFile; dynamic patientERDriverFile;
Null patientERDriverFileList; dynamic patientERDriverFileList;
bool patientHasFile; bool patientHasFile;
Null patientMergedIDs; dynamic patientMergedIDs;
bool patientOutSA; bool patientOutSA;
int patientShareRequestID; int patientShareRequestID;
int patientType; int patientType;
int projectIDOut; int projectIDOut;
Null returnMessage; dynamic returnMessage;
bool sMSLoginRequired; bool sMSLoginRequired;
Null servicePrivilegeList; dynamic servicePrivilegeList;
Null sharePatientName; dynamic sharePatientName;
Null verificationCode; dynamic verificationCode;
Null email; dynamic email;
Null errorList; dynamic errorList;
bool hasFile; bool hasFile;
bool isActiveCode; bool isActiveCode;
bool isMerged; bool isMerged;
bool isNeedUserAgreement; bool isNeedUserAgreement;
bool isSMSSent; bool isSMSSent;
Null memberList; dynamic memberList;
Null message; dynamic message;
int statusCode; int statusCode;
GetAllSharedRecordsByStatusResponse( GetAllSharedRecordsByStatusResponse(
@ -133,78 +133,92 @@ class GetAllSharedRecordsByStatusResponse {
this.statusCode}); this.statusCode});
GetAllSharedRecordsByStatusResponse.fromJson(Map<String, dynamic> json) { GetAllSharedRecordsByStatusResponse.fromJson(Map<String, dynamic> json) {
date = json['Date']; try {
languageID = json['LanguageID']; date = json['Date'];
serviceName = json['ServiceName']; languageID = json['LanguageID'];
time = json['Time']; serviceName = json['ServiceName'];
androidLink = json['AndroidLink']; time = json['Time'];
authenticationTokenID = json['AuthenticationTokenID']; androidLink = json['AndroidLink'];
data = json['Data']; authenticationTokenID = json['AuthenticationTokenID'];
dataw = json['Dataw']; data = json['Data'];
dietType = json['DietType']; dataw = json['Dataw'];
errorCode = json['ErrorCode']; dietType = json['DietType'];
errorEndUserMessage = json['ErrorEndUserMessage']; errorCode = json['ErrorCode'];
errorEndUserMessageN = json['ErrorEndUserMessageN']; errorEndUserMessage = json['ErrorEndUserMessage'];
errorMessage = json['ErrorMessage']; errorEndUserMessageN = json['ErrorEndUserMessageN'];
errorType = json['ErrorType']; errorMessage = json['ErrorMessage'];
foodCategory = json['FoodCategory']; errorType = json['ErrorType'];
iOSLink = json['IOSLink']; foodCategory = json['FoodCategory'];
isAuthenticated = json['IsAuthenticated']; iOSLink = json['IOSLink'];
mealOrderStatus = json['MealOrderStatus']; isAuthenticated = json['IsAuthenticated'];
mealType = json['MealType']; mealOrderStatus = json['MealOrderStatus'];
messageStatus = json['MessageStatus']; mealType = json['MealType'];
numberOfResultRecords = json['NumberOfResultRecords']; messageStatus = json['MessageStatus'];
patientBlodType = json['PatientBlodType']; numberOfResultRecords = json['NumberOfResultRecords'];
successMsg = json['SuccessMsg']; patientBlodType = json['PatientBlodType'];
successMsgN = json['SuccessMsgN']; successMsg = json['SuccessMsg'];
doctorInformationList = json['DoctorInformation_List']; successMsgN = json['SuccessMsgN'];
getAllPendingRecordsList = json['GetAllPendingRecordsList']; doctorInformationList = json['DoctorInformation_List'];
if (json['GetAllSharedRecordsByStatusList'] != null) { // getAllPendingRecordsList = json['GetAllPendingRecordsList'];
getAllSharedRecordsByStatusList =
new List<GetAllSharedRecordsByStatusList>(); if (json['GetAllPendingRecordsList'] != null) {
json['GetAllSharedRecordsByStatusList'].forEach((v) { getAllSharedRecordsByStatusList = new List<GetAllSharedRecordsByStatusList>();
getAllSharedRecordsByStatusList json['GetAllPendingRecordsList'].forEach((v) {
.add(new GetAllSharedRecordsByStatusList.fromJson(v)); getAllSharedRecordsByStatusList
}); .add(new GetAllSharedRecordsByStatusList.fromJson(v));
});
}
if (json['GetAllSharedRecordsByStatusList'] != null) {
getAllSharedRecordsByStatusList = new List<GetAllSharedRecordsByStatusList>();
json['GetAllSharedRecordsByStatusList'].forEach((v) {
getAllSharedRecordsByStatusList
.add(new GetAllSharedRecordsByStatusList.fromJson(v));
});
}
getResponseFileList = json['GetResponseFileList'];
isHMGPatient = json['IsHMGPatient'];
isLoginSuccessfully = json['IsLoginSuccessfully'];
isNeedUpdateIdintificationNo = json['IsNeedUpdateIdintificationNo'];
kioskSendSMS = json['KioskSendSMS'];
list = json['List'];
listAskHabibMobileLoginInfo = json['List_AskHabibMobileLoginInfo'];
listAskHabibPatientFile = json['List_AskHabibPatientFile'];
listMergeFiles = json['List_MergeFiles'];
listMobileLoginInfo = json['List_MobileLoginInfo'];
listPatientCount = json['List_PatientCount'];
logInTokenID = json['LogInTokenID'];
mohemmPrivilegeList = json['MohemmPrivilege_List'];
pateintID = json['PateintID'];
patientBloodType = json['PatientBloodType'];
patientERDriverFile = json['PatientER_DriverFile'];
patientERDriverFileList = json['PatientER_DriverFileList'];
patientHasFile = json['PatientHasFile'];
patientMergedIDs = json['PatientMergedIDs'];
patientOutSA = json['PatientOutSA'];
patientShareRequestID = json['PatientShareRequestID'];
patientType = json['PatientType'];
projectIDOut = json['ProjectIDOut'];
returnMessage = json['ReturnMessage'];
sMSLoginRequired = json['SMSLoginRequired'];
servicePrivilegeList = json['ServicePrivilege_List'];
sharePatientName = json['SharePatientName'];
verificationCode = json['VerificationCode'];
email = json['email'];
errorList = json['errorList'];
hasFile = json['hasFile'];
isActiveCode = json['isActiveCode'];
isMerged = json['isMerged'];
isNeedUserAgreement = json['isNeedUserAgreement'];
isSMSSent = json['isSMSSent'];
memberList = json['memberList'];
message = json['message'];
statusCode = json['statusCode'];
}catch (e){
var asd ="";
print(e);
} }
getResponseFileList = json['GetResponseFileList'];
isHMGPatient = json['IsHMGPatient'];
isLoginSuccessfully = json['IsLoginSuccessfully'];
isNeedUpdateIdintificationNo = json['IsNeedUpdateIdintificationNo'];
kioskSendSMS = json['KioskSendSMS'];
list = json['List'];
listAskHabibMobileLoginInfo = json['List_AskHabibMobileLoginInfo'];
listAskHabibPatientFile = json['List_AskHabibPatientFile'];
listMergeFiles = json['List_MergeFiles'];
listMobileLoginInfo = json['List_MobileLoginInfo'];
listPatientCount = json['List_PatientCount'];
logInTokenID = json['LogInTokenID'];
mohemmPrivilegeList = json['MohemmPrivilege_List'];
pateintID = json['PateintID'];
patientBloodType = json['PatientBloodType'];
patientERDriverFile = json['PatientER_DriverFile'];
patientERDriverFileList = json['PatientER_DriverFileList'];
patientHasFile = json['PatientHasFile'];
patientMergedIDs = json['PatientMergedIDs'];
patientOutSA = json['PatientOutSA'];
patientShareRequestID = json['PatientShareRequestID'];
patientType = json['PatientType'];
projectIDOut = json['ProjectIDOut'];
returnMessage = json['ReturnMessage'];
sMSLoginRequired = json['SMSLoginRequired'];
servicePrivilegeList = json['ServicePrivilege_List'];
sharePatientName = json['SharePatientName'];
verificationCode = json['VerificationCode'];
email = json['email'];
errorList = json['errorList'];
hasFile = json['hasFile'];
isActiveCode = json['isActiveCode'];
isMerged = json['isMerged'];
isNeedUserAgreement = json['isNeedUserAgreement'];
isSMSSent = json['isSMSSent'];
memberList = json['memberList'];
message = json['message'];
statusCode = json['statusCode'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -287,7 +301,7 @@ class GetAllSharedRecordsByStatusList {
int responseID; int responseID;
int regionID; int regionID;
int status; int status;
Null isActive; dynamic isActive;
String editedOn; String editedOn;
String createdOn; String createdOn;
String emaiLAddress; String emaiLAddress;

@ -220,20 +220,171 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Widget myFamilyRequest(context) { Widget myFamilyRequest(context) {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0), padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column( child: SingleChildScrollView(
children: <Widget>[ child: Column(
// SizedBox(height: 20.0), children: <Widget>[
RoundedContainer( // SizedBox(height: 20.0),
child: ExpansionTile( RoundedContainer(
child: ExpansionTile(
title: Text(
TranslationBase.of(context).userViewRequest,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
FutureBuilder(
future: getUserViewRequest(), // async work
builder: (BuildContext context,
AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text('No data found'));
else
return Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 3,
child: Text(TranslationBase.of(context)
.request)),
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context)
.switchUser,
)),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context)
.deleteView,
)),
],
),
Column(children: [
Row(children: [
Expanded(flex: 3, child: AppText('Name')),
Expanded(flex: 1, child: AppText('Allow')),
Expanded(flex: 1, child: AppText('Reject')),
]),
Column(
children:familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child:
Text(result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.check_circle,
color: Colors.black,
),
onPressed: () {
acceptRequest(
result, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteRequest(
result, context);
},
))
],
));
}).toList())
])
],
);
}
})
],
),
),
RoundedContainer(
child: ExpansionTile(
title: Text( title: Text(
TranslationBase.of(context).userViewRequest, TranslationBase.of(context).sentRequest,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold), style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
), ),
children: <Widget>[ children: <Widget>[
FutureBuilder( FutureBuilder(
future: getUserViewRequest(), // async work future: getSentRequest(), // async work
builder: (BuildContext context, builder: (BuildContext context,
AsyncSnapshot<dynamic> snapshot) { AsyncSnapshot<GetAllSharedRecordsByStatusResponse>
snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text('No data found'));
else
return SingleChildScrollView(
child: Container(
height: SizeConfig.screenHeight * .3,
child: ListView(
children: snapshot
.data.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child:
Text(result.patientName)),
Expanded(
flex: 2,
child: AppText(
result.statusDescription,
color: Colors.red,
)),
],
));
}).toList(),
)));
}
})
],
)),
RoundedContainer(
child: ExpansionTile(
title: Text(
TranslationBase.of(context).userView,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
FutureBuilder(
future: getUserViewRequest(), // async work
builder:
(BuildContext context, AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return Padding( return Padding(
@ -253,31 +404,27 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 3, flex: 3,
child: Text(TranslationBase.of(context) child: Text(
.request)), TranslationBase.of(context).request)),
Expanded( Expanded(
flex: 2, flex: 2,
child: Text( child: Text(
TranslationBase.of(context) TranslationBase.of(context).switchUser,
.switchUser,
)), )),
Expanded( Expanded(
flex: 1, flex: 1,
child: Text( child: Text(
TranslationBase.of(context) TranslationBase.of(context).deleteView,
.deleteView,
)), )),
], ],
), ),
Column(children: [ Column(children: [
Row(children: [ Row(children: [
Expanded(flex: 3, child: AppText('Name')), Expanded(flex: 3, child: AppText('Name')),
Expanded(flex: 1, child: AppText('Allow')), Expanded(flex: 1, child: AppText('Delete')),
Expanded(flex: 1, child: AppText('Reject')),
]), ]),
Column( Column(
children: snapshot children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList
.data['GetAllPendingRecordsList']
.map<Widget>((result) { .map<Widget>((result) {
return Padding( return Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
@ -285,20 +432,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 3, flex: 3,
child: child: Text(result.patientName)),
Text(result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.check_circle,
color: Colors.black,
),
onPressed: () {
acceptRequest(
result, context);
},
)),
Expanded( Expanded(
flex: 1, flex: 1,
child: IconButton( child: IconButton(
@ -310,7 +444,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
deleteRequest( deleteRequest(
result, context); result, context);
}, },
)) )),
], ],
)); ));
}).toList()) }).toList())
@ -320,143 +454,9 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
} }
}) })
], ],
), ))
), ],
RoundedContainer( ),
child: ExpansionTile(
title: Text(
TranslationBase.of(context).sentRequest,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
FutureBuilder(
future: getSentRequest(), // async work
builder: (BuildContext context,
AsyncSnapshot<GetAllSharedRecordsByStatusResponse>
snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text('No data found'));
else
return SingleChildScrollView(
child: Container(
height: SizeConfig.screenHeight * .3,
child: ListView(
children: snapshot
.data.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child:
Text(result.patientName)),
Expanded(
flex: 2,
child: AppText(
result.statusDescription,
color: Colors.red,
)),
],
));
}).toList(),
)));
}
})
],
)),
RoundedContainer(
child: ExpansionTile(
title: Text(
TranslationBase.of(context).userView,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
FutureBuilder(
future: getUserViewRequest(), // async work
builder:
(BuildContext context, AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text('No data found'));
else
return Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 3,
child: Text(
TranslationBase.of(context).request)),
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context).switchUser,
)),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context).deleteView,
)),
],
),
Column(children: [
Row(children: [
Expanded(flex: 3, child: AppText('Name')),
Expanded(flex: 1, child: AppText('Delete')),
]),
Column(
children: snapshot
.data['GetAllPendingRecordsList']
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child: Text(result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteRequest(
result, context);
},
)),
],
));
}).toList())
])
],
);
}
})
],
))
],
), ),
); );
} }

@ -42,7 +42,7 @@ class FamilyFilesProvider with ChangeNotifier {
bool isLogin = false; bool isLogin = false;
bool isLoading = true; bool isLoading = true;
dynamic authenticatedUser; dynamic authenticatedUser;
GetAllSharedRecordsByStatusResponse allSharedRecordsByStatusResponse;
Future<GetAllSharedRecordsByStatusResponse> getSharedRecordByStatus() async { Future<GetAllSharedRecordsByStatusResponse> getSharedRecordByStatus() async {
try { try {
dynamic localRes; dynamic localRes;
@ -64,7 +64,7 @@ class FamilyFilesProvider with ChangeNotifier {
} }
} }
Future getUserViewRequest(responseID) async { Future<GetAllSharedRecordsByStatusResponse> getUserViewRequest(responseID) async {
try { try {
dynamic localRes; dynamic localRes;
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
@ -73,14 +73,17 @@ class FamilyFilesProvider with ChangeNotifier {
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
return Future.value(error); return Future.error(error);
}, body: request); }, body: request);
if(localRes!=null){
sharedPref.setObject(FAMILY_FILE, localRes); sharedPref.setObject(FAMILY_FILE, localRes);
return Future.value( allSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse.fromJson(localRes);
GetAllSharedRecordsByStatusResponse.fromJson(localRes)); return Future.value(allSharedRecordsByStatusResponse);}
else
return Future.error("No Data");
} catch (error) { } catch (error) {
print(error); print(error);
throw error; return Future.error(error);
} }
} }

Loading…
Cancel
Save