Merge branch 'development' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into sultan-patientapp
commit
4325bd3448
@ -0,0 +1,85 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"questionEN": "Is the test intended for travel?",
|
||||||
|
"questionAR": "هل تجري التحليل بغرض السفر؟",
|
||||||
|
"ans": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"questionEN": "Coming from outside KSA within last 2 weeks?",
|
||||||
|
"questionAR": "هل قدمت من خارج المملكة خلال الأسبوعين الماضيين؟",
|
||||||
|
"ans": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"questionEN": "Do you currently have fever?",
|
||||||
|
"questionAR": "هل تعاني حاليا من حرارة؟",
|
||||||
|
"ans": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 4,
|
||||||
|
"questionEN": "Did you have fever in last 2 weeks?",
|
||||||
|
"questionAR": "هل عانيت من حرارة في الأسبوعين الماضيين؟",
|
||||||
|
"ans": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 5,
|
||||||
|
"questionEN": "Do you have a sore throat?",
|
||||||
|
"questionAR": "هل لديك التهاب في الحلق؟",
|
||||||
|
"ans": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 6,
|
||||||
|
"questionEN": "Do you have a runny nose?",
|
||||||
|
"questionAR": "هل لديك سيلان بالأنف؟"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 7,
|
||||||
|
"questionEN": "Do you have a cough?",
|
||||||
|
"questionAR": "هل لديك سعال؟",
|
||||||
|
"ans": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 8,
|
||||||
|
"questionEN": "Do you have shortness of breath?",
|
||||||
|
"questionAR": "هل تعانين من ضيق في التنفس؟",
|
||||||
|
"ans": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 9,
|
||||||
|
"questionEN": "Do you have nausea?",
|
||||||
|
"questionAR": "هل تعانين من غثيان؟",
|
||||||
|
"ans": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 10,
|
||||||
|
"questionEN": "Do you have vomiting?",
|
||||||
|
"questionAR": "هل تعاني من القيء؟",
|
||||||
|
"ans": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 11,
|
||||||
|
"questionEN": "Do you have a headache?",
|
||||||
|
"questionAR": "هل تعاني من صداع في الرأس؟",
|
||||||
|
"ans": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 12,
|
||||||
|
"questionEN": "Do you have muscle pain?",
|
||||||
|
"questionAR": "هل تعانين من آلام عضلية؟",
|
||||||
|
"ans": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 13,
|
||||||
|
"questionEN": "Do you have joint pain?",
|
||||||
|
"questionAR": "هل تعانين من آلام المفاصل؟",
|
||||||
|
"ans": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 14,
|
||||||
|
"questionEN": "Do you have diarrhea?",
|
||||||
|
"questionAR": "هل لديك اسهال؟",
|
||||||
|
"ans": 2
|
||||||
|
}
|
||||||
|
]
|
||||||
@ -1 +1 @@
|
|||||||
269226e53e3ba1b1460fd3df51f89f77
|
e52eba3667a38bec777870899c15ae7d
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,79 +1,56 @@
|
|||||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
||||||
class PatientERTransportationMethod {
|
class PatientERTransportationMethod {
|
||||||
dynamic id;
|
int id;
|
||||||
DateTime createDate;
|
String serviceID;
|
||||||
DateTime lastEditDate;
|
int orderServiceID;
|
||||||
dynamic createdBy;
|
String text;
|
||||||
dynamic lastEditBy;
|
String textN;
|
||||||
bool isActive;
|
|
||||||
String title;
|
|
||||||
String titleAR;
|
|
||||||
dynamic price;
|
dynamic price;
|
||||||
dynamic isDefault;
|
dynamic priceVAT;
|
||||||
dynamic visibility;
|
dynamic priceTotal;
|
||||||
dynamic durationId;
|
bool isEnabled;
|
||||||
String description;
|
int orderId;
|
||||||
String descriptionAR;
|
int quantity;
|
||||||
dynamic totalPrice;
|
|
||||||
dynamic vAT;
|
|
||||||
|
|
||||||
PatientERTransportationMethod(
|
PatientERTransportationMethod(
|
||||||
{
|
{this.id,
|
||||||
this.id,
|
this.serviceID,
|
||||||
this.createDate,
|
this.orderServiceID,
|
||||||
this.lastEditDate,
|
this.text,
|
||||||
this.createdBy,
|
this.textN,
|
||||||
this.lastEditBy,
|
|
||||||
this.isActive,
|
|
||||||
this.title,
|
|
||||||
this.titleAR,
|
|
||||||
this.price,
|
this.price,
|
||||||
this.isDefault,
|
this.priceVAT,
|
||||||
this.visibility,
|
this.priceTotal,
|
||||||
this.durationId,
|
this.isEnabled,
|
||||||
this.description,
|
this.orderId,
|
||||||
this.descriptionAR,
|
this.quantity});
|
||||||
this.totalPrice,
|
|
||||||
this.vAT});
|
|
||||||
|
|
||||||
PatientERTransportationMethod.fromJson(
|
PatientERTransportationMethod.fromJson(Map<String, dynamic> json) {
|
||||||
Map<String, dynamic> json) {
|
id = json['id'];
|
||||||
id = json['Id'];
|
serviceID = json['serviceID'];
|
||||||
createDate = DateUtil.convertStringToDate(json['CreateDate']);
|
orderServiceID = json['orderServiceID'];
|
||||||
lastEditDate = DateUtil.convertStringToDate(json['LastEditDate']);
|
text = json['text'];
|
||||||
createdBy = json['CreatedBy'];
|
textN = json['textN'];
|
||||||
lastEditBy = json['LastEditBy'];
|
price = json['price'];
|
||||||
isActive = json['IsActive'];
|
priceVAT = json['priceVAT'];
|
||||||
title = json['Title'];
|
priceTotal = json['priceTotal'];
|
||||||
titleAR = json['TitleAR'];
|
isEnabled = json['isEnabled'];
|
||||||
price = json['Price'];
|
orderId = json['orderId'];
|
||||||
isDefault = json['isDefault'];
|
quantity = json['quantity'];
|
||||||
visibility = json['Visibility'];
|
|
||||||
durationId = json['DurationId'];
|
|
||||||
description = json['Description'];
|
|
||||||
descriptionAR = json['DescriptionAR'];
|
|
||||||
totalPrice = json['TotalPrice'];
|
|
||||||
vAT = json['VAT'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
data['Id'] = this.id;
|
data['id'] = this.id;
|
||||||
data['CreateDate'] = this.createDate;
|
data['serviceID'] = this.serviceID;
|
||||||
data['LastEditDate'] = this.lastEditDate;
|
data['orderServiceID'] = this.orderServiceID;
|
||||||
data['CreatedBy'] = this.createdBy;
|
data['text'] = this.text;
|
||||||
data['LastEditBy'] = this.lastEditBy;
|
data['textN'] = this.textN;
|
||||||
data['IsActive'] = this.isActive;
|
data['price'] = this.price;
|
||||||
data['Title'] = this.title;
|
data['priceVAT'] = this.priceVAT;
|
||||||
data['TitleAR'] = this.titleAR;
|
data['priceTotal'] = this.priceTotal;
|
||||||
data['Price'] = this.price;
|
data['isEnabled'] = this.isEnabled;
|
||||||
data['isDefault'] = this.isDefault;
|
data['orderId'] = this.orderId;
|
||||||
data['Visibility'] = this.visibility;
|
data['quantity'] = this.quantity;
|
||||||
data['DurationId'] = this.durationId;
|
|
||||||
data['Description'] = this.description;
|
|
||||||
data['DescriptionAR'] = this.descriptionAR;
|
|
||||||
data['TotalPrice'] = this.totalPrice;
|
|
||||||
data['VAT'] = this.vAT;
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,69 +0,0 @@
|
|||||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
||||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
|
||||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
||||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
||||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:hexcolor/hexcolor.dart';
|
|
||||||
|
|
||||||
import 'home_health_care_page.dart';
|
|
||||||
|
|
||||||
class HomeHealthCareIndexPage extends StatelessWidget {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return AppScaffold(
|
|
||||||
isShowAppBar: true,
|
|
||||||
appBarTitle: TranslationBase.of(context).serviceInformation,
|
|
||||||
body: SingleChildScrollView(
|
|
||||||
padding: EdgeInsets.all(12),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
Texts(
|
|
||||||
TranslationBase.of(context).homeHealthCare,
|
|
||||||
fontWeight: FontWeight.normal,
|
|
||||||
fontSize: 25,
|
|
||||||
color: Color(0xff60686b),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 12,
|
|
||||||
),
|
|
||||||
Texts(
|
|
||||||
TranslationBase.of(context).homeHealthCareText,
|
|
||||||
fontWeight: FontWeight.normal,
|
|
||||||
fontSize: 17,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 22,
|
|
||||||
),
|
|
||||||
Center(
|
|
||||||
child: Image.asset(
|
|
||||||
'assets/images/AlHabibMedicalService/Wifi-AR.png')),
|
|
||||||
SizedBox(
|
|
||||||
height: 77,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
bottomSheet: Container(
|
|
||||||
height: MediaQuery.of(context).size.height * 0.10,
|
|
||||||
width: double.infinity,
|
|
||||||
child: Column(
|
|
||||||
children: <Widget>[
|
|
||||||
Container(
|
|
||||||
width: MediaQuery.of(context).size.width * 0.9,
|
|
||||||
child: SecondaryButton(
|
|
||||||
onTap: () => Navigator.push(
|
|
||||||
context,
|
|
||||||
FadePage(
|
|
||||||
page: HomeHealthCarePage(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
label: TranslationBase.of(context).loginRegister,
|
|
||||||
textColor: Theme.of(context).backgroundColor),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,165 @@
|
|||||||
|
import 'dart:collection';
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
|
||||||
|
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
|
import 'covid-payment-details.dart';
|
||||||
|
class CovidDirveThruQuestions extends StatefulWidget{
|
||||||
|
final String projectId;
|
||||||
|
final List<CovidTestProceduresResponse> proceduresList;
|
||||||
|
CovidDirveThruQuestions({@required this.projectId, @required this.proceduresList});
|
||||||
|
|
||||||
|
@override
|
||||||
|
CovidDirveThruQuestionsState createState() => CovidDirveThruQuestionsState();
|
||||||
|
|
||||||
|
}
|
||||||
|
class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions>{
|
||||||
|
List qa;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
qa = getQuestionsFromJson();
|
||||||
|
}
|
||||||
|
|
||||||
|
TranslationBase localize;
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
localize = TranslationBase.of(context);
|
||||||
|
var isArabic = localize.isArabic();
|
||||||
|
return AppScaffold(
|
||||||
|
appBarTitle: TranslationBase.of(context).covidTest,
|
||||||
|
isShowAppBar: true,
|
||||||
|
body: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(20),
|
||||||
|
child: Text(localize.covidSelectProcedure, style: TextStyle(fontSize: 17, letterSpacing: 1, fontWeight: FontWeight.bold)),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: ListView.separated(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||||
|
itemCount: qa.length,
|
||||||
|
itemBuilder: (ctx, idx){
|
||||||
|
var obj = qa[idx];
|
||||||
|
var qtext = isArabic ? obj["questionAR"] : obj["questionEN"];
|
||||||
|
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(qtext, style: TextStyle(fontSize: 15, letterSpacing: 1.5)),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Radio<int>(
|
||||||
|
value: 1,
|
||||||
|
groupValue: obj["ans"],
|
||||||
|
onChanged: (newValue){
|
||||||
|
setState(() {
|
||||||
|
obj["ans"] = newValue;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
),
|
||||||
|
Text(localize.yes),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Radio<int>(
|
||||||
|
value: 0,
|
||||||
|
groupValue: obj["ans"],
|
||||||
|
onChanged: (newValue){
|
||||||
|
setState(() {
|
||||||
|
obj["ans"] = newValue;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
),
|
||||||
|
Text(localize.no),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (ctx, idx) => Divider(height: 0.25, color: Colors.grey.withOpacity(0.5)),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||||
|
child: FractionallySizedBox(
|
||||||
|
widthFactor: 1,
|
||||||
|
child: MaterialButton(
|
||||||
|
height: 50,
|
||||||
|
color: Theme.of(context).appBarTheme.color,
|
||||||
|
disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25),
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ),
|
||||||
|
child: Text(localize.next, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),),
|
||||||
|
onPressed: next
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
next() async{
|
||||||
|
bool all = true;
|
||||||
|
qa.forEach((element) {
|
||||||
|
all = all && (element["ans"] == 1 || element["ans"] == 0);
|
||||||
|
});
|
||||||
|
if(all)
|
||||||
|
getPaymentInfo(context,widget.projectId);
|
||||||
|
else
|
||||||
|
AppToast.showErrorToast(message: localize.pleaseSelectAllQuestionToContinue);
|
||||||
|
}
|
||||||
|
|
||||||
|
List getQuestionsFromJson(){
|
||||||
|
var questionsJson =
|
||||||
|
"""
|
||||||
|
[{"id":1,"questionEN":"Is the test intended for travel?","questionAR":"هل تجري التحليل بغرض السفر؟","ans":2},{"id":2,"questionEN":"Coming from outside KSA within last 2 weeks?","questionAR":"هل قدمت من خارج المملكة خلال الأسبوعين الماضيين؟","ans":2},{"id":3,"questionEN":"Do you currently have fever?","questionAR":"هل تعاني حاليا من حرارة؟","ans":2},{"id":4,"questionEN":"Did you have fever in last 2 weeks?","questionAR":"هل عانيت من حرارة في الأسبوعين الماضيين؟","ans":2},{"id":5,"questionEN":"Do you have a sore throat?","questionAR":"هل لديك التهاب في الحلق؟","ans":2},{"id":6,"questionEN":"Do you have a runny nose?","questionAR":"هل لديك سيلان بالأنف؟"},{"id":7,"questionEN":"Do you have a cough?","questionAR":"هل لديك سعال؟","ans":2},{"id":8,"questionEN":"Do you have shortness of breath?","questionAR":"هل تعانين من ضيق في التنفس؟","ans":2},{"id":9,"questionEN":"Do you have nausea?","questionAR":"هل تعانين من غثيان؟","ans":2},{"id":10,"questionEN":"Do you have vomiting?","questionAR":"هل تعاني من القيء؟","ans":2},{"id":11,"questionEN":"Do you have a headache?","questionAR":"هل تعاني من صداع في الرأس؟","ans":2},{"id":12,"questionEN":"Do you have muscle pain?","questionAR":"هل تعانين من آلام عضلية؟","ans":2},{"id":13,"questionEN":"Do you have joint pain?","questionAR":"هل تعانين من آلام المفاصل؟","ans":2},{"id":14,"questionEN":"Do you have diarrhea?","questionAR":"هل لديك اسهال؟","ans":2}]""";
|
||||||
|
var map = json.decode(questionsJson) as List;
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
getPaymentInfo(BuildContext context, String projectID) {
|
||||||
|
CovidDriveThruService service = new CovidDriveThruService();
|
||||||
|
CovidPaymentInfoResponse covidPaymentInfoResponse =
|
||||||
|
new CovidPaymentInfoResponse();
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID)
|
||||||
|
.then((res) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
if (res['MessageStatus'] == 1) {
|
||||||
|
// setState(() {
|
||||||
|
// covidPaymentInfoResponse =
|
||||||
|
// CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);
|
||||||
|
// });
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
FadePage(
|
||||||
|
page: CovidPaymentDetails(
|
||||||
|
covidPaymentInfoResponse: covidPaymentInfoResponse,
|
||||||
|
projectID: int.parse(projectID),
|
||||||
|
proceduresList: widget.proceduresList,
|
||||||
|
)));
|
||||||
|
} else {}
|
||||||
|
}).catchError((err) {
|
||||||
|
print(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue