|
|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCenterModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-details.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/routes.dart';
|
|
|
|
|
@ -22,6 +24,7 @@ class CovidDrivethruLocation extends StatefulWidget {
|
|
|
|
|
class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
|
|
|
|
|
String projectDropdownValue;
|
|
|
|
|
List<DriveThroughTestingCenterModel> projectsList = [];
|
|
|
|
|
List<CovidTestProceduresResponse> proceduresList = [];
|
|
|
|
|
bool isLocationSelected = false;
|
|
|
|
|
String projectLat = "";
|
|
|
|
|
String projectLong = "";
|
|
|
|
|
@ -42,21 +45,32 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
|
|
|
|
|
imageAr:
|
|
|
|
|
'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'),
|
|
|
|
|
);
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
|
if (projectViewModel.isLogin) {
|
|
|
|
|
getProjectsList(context);
|
|
|
|
|
getTestProcedures(context);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
projectViewModel = Provider.of(context);
|
|
|
|
|
imagesInfo.add(ImagesInfo(
|
|
|
|
|
imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png',
|
|
|
|
|
imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'));
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
appBarTitle: TranslationBase.of(context).covidTest,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
imagesInfo: imagesInfo,
|
|
|
|
|
description: TranslationBase.of(context).covidInfo,
|
|
|
|
|
isShowDecPage: true,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
alignment: projectViewModel.isArabic
|
|
|
|
|
@ -147,12 +161,10 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
|
|
|
|
|
this.projectLong +
|
|
|
|
|
"&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"),
|
|
|
|
|
)
|
|
|
|
|
: Container(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
: SizedBox(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.35,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
bottomSheet: Container(
|
|
|
|
|
Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.15,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Column(
|
|
|
|
|
@ -191,7 +203,8 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
minWidth: MediaQuery.of(context).size.width * 0.7,
|
|
|
|
|
minWidth:
|
|
|
|
|
MediaQuery.of(context).size.width * 0.7,
|
|
|
|
|
height: 45.0,
|
|
|
|
|
child: RaisedButton(
|
|
|
|
|
color: new Color(0xFF60686b),
|
|
|
|
|
@ -215,7 +228,8 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
minWidth: MediaQuery.of(context).size.width * 0.7,
|
|
|
|
|
minWidth:
|
|
|
|
|
MediaQuery.of(context).size.width * 0.7,
|
|
|
|
|
height: 45.0,
|
|
|
|
|
child: RaisedButton(
|
|
|
|
|
color: new Color(0xFF60686b),
|
|
|
|
|
@ -237,6 +251,10 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -279,21 +297,18 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
|
|
|
|
|
|
|
|
|
|
getPaymentInfo(BuildContext context, String projectID) {
|
|
|
|
|
CovidDriveThruService service = new CovidDriveThruService();
|
|
|
|
|
|
|
|
|
|
CovidPaymentInfoResponse covidPaymentInfoResponse =
|
|
|
|
|
new CovidPaymentInfoResponse();
|
|
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
|
|
|
|
|
service
|
|
|
|
|
.getCovidPaymentInformation(context, int.parse(projectID))
|
|
|
|
|
.getCovidPaymentInformation(
|
|
|
|
|
context, int.parse(projectID), proceduresList[0].procedureID)
|
|
|
|
|
.then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
setState(() {
|
|
|
|
|
covidPaymentInfoResponse =
|
|
|
|
|
CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);
|
|
|
|
|
print(covidPaymentInfoResponse.procedureNameField);
|
|
|
|
|
});
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
@ -301,6 +316,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
|
|
|
|
|
page: CovidPaymentDetails(
|
|
|
|
|
covidPaymentInfoResponse: covidPaymentInfoResponse,
|
|
|
|
|
projectID: int.parse(projectID),
|
|
|
|
|
proceduresList: proceduresList,
|
|
|
|
|
)));
|
|
|
|
|
} else {}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
@ -308,13 +324,36 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getTestProcedures(BuildContext context) {
|
|
|
|
|
CovidDriveThruService service = new CovidDriveThruService();
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
|
|
|
|
|
CovidTestProceduresResponse covidTestProceduresResponse =
|
|
|
|
|
new CovidTestProceduresResponse();
|
|
|
|
|
|
|
|
|
|
service.getCovidTestProceduresList(context).then((res) {
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
print(res);
|
|
|
|
|
setState(() {
|
|
|
|
|
res['COVID19_TestProceduresList'].forEach((v) {
|
|
|
|
|
proceduresList.add(new CovidTestProceduresResponse.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
print(proceduresList.length);
|
|
|
|
|
print(proceduresList[0].procedureName);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
} else {}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getProjectsList(BuildContext context) {
|
|
|
|
|
CovidDriveThruService service = new CovidDriveThruService();
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
service.getCovidProjectsList(context).then((res) {
|
|
|
|
|
print(res);
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
print(res);
|
|
|
|
|
setState(() {
|
|
|
|
|
res['List_COVID19_ProjectDriveThroughTestingCenter'].forEach((v) {
|
|
|
|
|
projectsList.add(new DriveThroughTestingCenterModel.fromJson(v));
|
|
|
|
|
|