Merge branch 'development' into development_new_design_2.0

merge-requests/390/head
Sikander Saleem 3 years ago
commit ef5f737084

@ -7,9 +7,6 @@ class ErService extends BaseService {
List<ProjectAvgERWaitingTime> projectAvgERWaitingTimeModelList = List(); List<ProjectAvgERWaitingTime> projectAvgERWaitingTimeModelList = List();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
String Latitude = "";
String Longitude = "";
String PhoneNumber = "";
Future getProjectAvgERWaitingTimeOrders({int id, int projectID}) async { Future getProjectAvgERWaitingTimeOrders({int id, int projectID}) async {
hasError = false; hasError = false;
@ -23,21 +20,15 @@ class ErService extends BaseService {
body['Latitude'] = lat ?? 0; body['Latitude'] = lat ?? 0;
body['Longitude'] = long ?? 0; body['Longitude'] = long ?? 0;
dynamic localRes;
await baseAppClient.post(GET_NEAREST_HOSPITAL, await baseAppClient.post(GET_NEAREST_HOSPITAL,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
projectAvgERWaitingTimeModelList.clear(); localRes = response;
response['List_ProjectAvgERWaitingTime'].forEach((vital) {
projectAvgERWaitingTimeModelList
.add(ProjectAvgERWaitingTime.fromJson(vital));
});
projectAvgERWaitingTimeModelList.forEach((element) {
Latitude = '${element.latitude}';
Longitude = '${element.longitude}';
PhoneNumber = '${element.phoneNumber}';
});
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
return Future.value(localRes);
} }
} }

@ -17,7 +17,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
class MyBalanceService extends BaseService { class MyBalanceService extends BaseService {
List<PatientAdvanceBalanceAmount> patientAdvanceBalanceAmountList = List(); List<PatientAdvanceBalanceAmount> patientAdvanceBalanceAmountList = List();
double totalAdvanceBalanceAmount; dynamic totalAdvanceBalanceAmount;
List<PatientInfo> patientInfoList = List(); List<PatientInfo> patientInfoList = List();
GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse =
GetAllSharedRecordsByStatusResponse(); GetAllSharedRecordsByStatusResponse();

@ -38,7 +38,7 @@ class MyBalanceViewModel extends BaseViewModel {
//=========================== //===========================
double get totalAdvanceBalanceAmount => dynamic get totalAdvanceBalanceAmount =>
_myBalanceService.totalAdvanceBalanceAmount; _myBalanceService.totalAdvanceBalanceAmount;
String get updatedRegisterBloodMessage => String get updatedRegisterBloodMessage =>

@ -218,7 +218,9 @@ class ConfirmPaymentPage extends StatelessWidget {
authenticatedUser.patientID, authenticatedUser.patientID,
authenticatedUser, authenticatedUser,
browser, browser,
false); false,
null,
null);
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {

@ -509,6 +509,8 @@ class _BookSuccessState extends State<BookSuccess> {
authenticatedUser, authenticatedUser,
widget.browser, widget.browser,
widget.patientShareResponse.isLiveCareAppointment, widget.patientShareResponse.isLiveCareAppointment,
null,
null,
widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo, widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.clinicID, widget.patientShareResponse.clinicID,

@ -152,6 +152,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID).then((res) { service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(

@ -14,7 +14,6 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'covid-dirvethru-questions.dart'; import 'covid-dirvethru-questions.dart';
@ -34,15 +33,14 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
String projectID = ""; String projectID = "";
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
DriveThroughTestingCenterModel selectedProject;
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
imagesInfo.add( imagesInfo.add(
ImagesInfo( ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'),
imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'),
); );
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectViewModel.isLogin) { if (projectViewModel.isLogin) {
@ -56,9 +54,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
imagesInfo.add(ImagesInfo( imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'));
imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png',
imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'));
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
@ -72,31 +68,17 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Container( Container(
alignment: projectViewModel.isArabic alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft,
? Alignment.centerRight child: Text(TranslationBase.of(context).resultHeader, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 22.0, color: Colors.black)),
: Alignment.centerLeft,
child: Text(TranslationBase.of(context).resultHeader,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 22.0,
color: Colors.black)),
), ),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Text(TranslationBase.of(context).covidInfo, child: Text(TranslationBase.of(context).covidInfo, style: TextStyle(fontSize: 16.0, color: Colors.black)),
style: TextStyle(fontSize: 16.0, color: Colors.black)),
), ),
Container( Container(
margin: EdgeInsets.only(top: 20.0), margin: EdgeInsets.only(top: 20.0),
alignment: projectViewModel.isArabic alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft,
? Alignment.centerRight child: Text(TranslationBase.of(context).selectLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, letterSpacing: 0.8, color: Colors.grey[700])),
: Alignment.centerLeft,
child: Text(TranslationBase.of(context).selectLocation,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
letterSpacing: 0.8,
color: Colors.grey[700])),
), ),
Container( Container(
height: 60.0, height: 60.0,
@ -112,18 +94,18 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(top: 15.0), margin: EdgeInsets.only(top: 15.0),
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButton<String>( child: DropdownButton<DriveThroughTestingCenterModel>(
hint: new Text(TranslationBase.of(context).selectAddress), hint: new Text(TranslationBase.of(context).selectAddress),
value: projectDropdownValue, value: selectedProject,
items: projectsList.map((item) { items: projectsList.map((DriveThroughTestingCenterModel item) {
return new DropdownMenuItem<String>( return new DropdownMenuItem<DriveThroughTestingCenterModel>(
value: item.iD.toString(), value: item,
child: new Text(item.projectName), child: new Text(item.projectName),
); );
}).toList(), }).toList(),
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
projectDropdownValue = newValue; selectedProject = newValue;
setProjectLocation(newValue); setProjectLocation(newValue);
}); });
}, },
@ -132,15 +114,8 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
isLocationSelected isLocationSelected
? Container( ? Container(
margin: EdgeInsets.only(top: 15.0), margin: EdgeInsets.only(top: 15.0),
alignment: projectViewModel.isArabic alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft,
? Alignment.centerRight child: Text(TranslationBase.of(context).selectLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, letterSpacing: 0.8, color: Colors.black)),
: Alignment.centerLeft,
child: Text(TranslationBase.of(context).selectLocation,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
letterSpacing: 0.8,
color: Colors.black)),
) )
: Container(), : Container(),
isLocationSelected isLocationSelected
@ -149,16 +124,15 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey[400], width: 1.0), border: Border.all(color: Colors.grey[400], width: 1.0),
), ),
child: Image.network( child: Image.network("https://maps.googleapis.com/maps/api/staticmap?center=" +
"https://maps.googleapis.com/maps/api/staticmap?center=" + this.projectLat +
this.projectLat + "," +
"," + this.projectLong +
this.projectLong + "&zoom=15&size=800x400&maptype=roadmap&markers=color:red%7C" +
"&zoom=15&size=800x400&maptype=roadmap&markers=color:red%7C" + this.projectLat +
this.projectLat + "," +
"," + this.projectLong +
this.projectLong + "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"),
"&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"),
) )
: SizedBox( : SizedBox(
height: MediaQuery.of(context).size.height * 0.35, height: MediaQuery.of(context).size.height * 0.35,
@ -184,8 +158,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
onPressed: () { onPressed: () {
getDirections(); getDirections();
}, },
child: Text(TranslationBase.of(context).getDirections, child: Text(TranslationBase.of(context).getDirections, style: TextStyle(fontSize: 18.0)),
style: TextStyle(fontSize: 18.0)),
), ),
), ),
), ),
@ -202,8 +175,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
minWidth: minWidth: MediaQuery.of(context).size.width * 0.7,
MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 45.0,
child: RaisedButton( child: RaisedButton(
color: new Color(0xFF60686b), color: new Color(0xFF60686b),
@ -213,8 +185,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
onPressed: () { onPressed: () {
back(); back();
}, },
child: Text(TranslationBase.of(context).back, child: Text(TranslationBase.of(context).back, style: TextStyle(fontSize: 18.0)),
style: TextStyle(fontSize: 18.0)),
), ),
), ),
), ),
@ -227,8 +198,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
minWidth: minWidth: MediaQuery.of(context).size.width * 0.7,
MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 45.0,
child: RaisedButton( child: RaisedButton(
color: new Color(0xFF60686b), color: new Color(0xFF60686b),
@ -238,8 +208,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
onPressed: () { onPressed: () {
next(); next();
}, },
child: Text(TranslationBase.of(context).next, child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)),
style: TextStyle(fontSize: 18.0)),
), ),
), ),
), ),
@ -259,22 +228,17 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
getDirections() { getDirections() {
if (isLocationSelected) { if (isLocationSelected) {
MapsLauncher.launchCoordinates(double.parse(projectLat), MapsLauncher.launchCoordinates(double.parse(projectLat), double.parse(projectLong), this.projectName);
double.parse(projectLong), this.projectName);
} else { } else {
Utils.showErrorToast( Utils.showErrorToast("Please select address from the dropdown menu to get directions");
"Please select address from the dropdown menu to get directions");
} }
} }
next() { next() {
if (isLocationSelected) { if (isLocationSelected) {
Navigator.push( Navigator.push(context, FadePage(page: CovidDirveThruQuestions(projectId: projectID, proceduresList: proceduresList)));
context,
FadePage(page: CovidDirveThruQuestions(projectId: projectID, proceduresList: proceduresList,)));
} else { } else {
Utils.showErrorToast( Utils.showErrorToast("Please select address from the dropdown menu to continue");
"Please select address from the dropdown menu to continue");
} }
} }
@ -282,34 +246,25 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
Navigator.of(context).popAndPushNamed(HOME); Navigator.of(context).popAndPushNamed(HOME);
} }
setProjectLocation(newValue) { setProjectLocation(DriveThroughTestingCenterModel newValue) {
print(newValue);
setState(() { setState(() {
this.projectLat = this.projectLat = newValue.latitude.toString();
projectsList[(int.parse(newValue) - 1)].latitude.toString(); this.projectLong = newValue.longitude.toString();
this.projectLong = this.projectName = newValue.projectName;
projectsList[(int.parse(newValue) - 1)].longitude.toString(); this.projectID = newValue.projectID.toString();
this.projectName = projectsList[(int.parse(newValue) - 1)].projectName;
this.projectID =
projectsList[(int.parse(newValue) - 1)].projectID.toString();
isLocationSelected = true; isLocationSelected = true;
}); });
} }
getPaymentInfo(BuildContext context, String projectID) { getPaymentInfo(BuildContext context, String projectID) {
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
CovidPaymentInfoResponse covidPaymentInfoResponse = CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse();
new CovidPaymentInfoResponse();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service.getCovidPaymentInformation(context, int.parse(projectID), proceduresList[0].procedureID).then((res) {
.getCovidPaymentInformation(
context, int.parse(projectID), proceduresList[0].procedureID)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
covidPaymentInfoResponse = covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);
CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);
}); });
Navigator.push( Navigator.push(
context, context,
@ -329,8 +284,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
CovidTestProceduresResponse covidTestProceduresResponse = CovidTestProceduresResponse covidTestProceduresResponse = new CovidTestProceduresResponse();
new CovidTestProceduresResponse();
service.getCovidTestProceduresList(context).then((res) { service.getCovidTestProceduresList(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {

@ -30,7 +30,6 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
@override @override
void initState() { void initState() {
print(widget.proceduresList[0].procedureName);
widget.selectedProcedure = widget.proceduresList[0]; widget.selectedProcedure = widget.proceduresList[0];
super.initState(); super.initState();
} }
@ -336,14 +335,6 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
widget.covidPaymentInfoResponse = widget.covidPaymentInfoResponse =
CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);
}); });
// Navigator.push(
// context,
// FadePage(
// page: CovidPaymentDetails(
// covidPaymentInfoResponse: covidPaymentInfoResponse,
// projectID: int.parse(projectID),
// proceduresList: proceduresList,
// )));
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -191,6 +191,8 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
authenticatedUser, authenticatedUser,
widget.browser, widget.browser,
widget.patientShareResponse.isLiveCareAppointment, widget.patientShareResponse.isLiveCareAppointment,
null,
null,
widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo, widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.clinicID, widget.patientShareResponse.clinicID,

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/er/TriageInformationRequest.dart
import 'package:diplomaticquarterapp/core/model/er/TriageQuestionsModel.dart'; import 'package:diplomaticquarterapp/core/model/er/TriageQuestionsModel.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -44,36 +45,39 @@ class _DdServicesPageState extends State<DdServicesPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Scaffold( return AppScaffold(
appBar: AppBar( appBarTitle: 'ED Online',
elevation: 0, isShowDecPage: true,
textTheme: TextTheme( isShowAppBar: true,
headline6: TextStyle( // appBarTitle: AppBar(
color: Theme.of(context).textTheme.headline1.color, // elevation: 0,
fontWeight: FontWeight.bold), // textTheme: TextTheme(
), // headline6: TextStyle(
title: Text( // color: Theme.of(context).textTheme.headline1.color,
'ED Online', // fontWeight: FontWeight.bold),
style: TextStyle( // ),
fontWeight: FontWeight.bold, // title: Text(
color: Theme.of(context).textTheme.headline1.color, // 'ED Online',
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), // style: TextStyle(
// bold: true, // fontWeight: FontWeight.bold,
// color: Colors.white, // color: Theme.of(context).textTheme.headline1.color,
), // fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
leading: Builder( // // bold: true,
builder: (BuildContext context) { // // color: Colors.white,
return IconButton( // ),
icon: Icon(Icons.arrow_back), // leading: Builder(
color: Theme.of(context).textTheme.headline1.color, // builder: (BuildContext context) {
onPressed: () { // return IconButton(
showConfirmMessage(context); // icon: Icon(Icons.arrow_back),
}, // color: Theme.of(context).textTheme.headline1.color,
); // onPressed: () {
}, // showConfirmMessage(context);
), // },
centerTitle: true, // );
), // },
// ),
// centerTitle: true,
// ),
body: PageView( body: PageView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: pageController, controller: pageController,

@ -1,16 +1,15 @@
import 'package:diplomaticquarterapp/core/viewModels/er/near_hospital_view_model.dart'; import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/core/service/er/er_service.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../uitl/translations_delegate_base.dart'; import '../../uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart';
import 'widgets/card_position.dart'; import 'widgets/card_position.dart';
class NearestEr extends StatelessWidget { class NearestEr extends StatefulWidget {
static const String _url = "assets/images/"; static const String _url = "assets/images/";
int appointmentNo; int appointmentNo;
@ -18,92 +17,89 @@ class NearestEr extends StatelessWidget {
NearestEr({this.appointmentNo, this.projectID}); NearestEr({this.appointmentNo, this.projectID});
@override
_NearestErState createState() => _NearestErState();
}
class _NearestErState extends State<NearestEr> {
List<ProjectAvgERWaitingTime> projectAvgERWaitingTimeModelList = List();
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getERList());
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var size = MediaQuery.of(context).size; var size = MediaQuery.of(context).size;
final double itemHeight = (size.height - kToolbarHeight - 24) / 2; final double itemHeight = (size.height - kToolbarHeight - 24) / 2;
final double itemWidth = size.width / 2; final double itemWidth = size.width / 2;
return BaseView<NearHospitalViewModel>( return AppScaffold(
onModelReady: appointmentNo != null && projectID != null isShowAppBar: true,
? (model) => model.getProjectAvgERWaitingTimeOrders( isShowDecPage: false,
id: appointmentNo, projectID: projectID) appBarTitle: TranslationBase.of(context).NearestEr,
: (model) => model.getProjectAvgERWaitingTimeOrders(), body: projectAvgERWaitingTimeModelList.length > 0
builder: (_, mode, widget) => AppScaffold( ? Container(
isShowAppBar: true, child: ListView(
isShowDecPage: false, children: <Widget>[
appBarTitle: TranslationBase.of(context).NearestEr, Text("${TranslationBase.of(context).NearestErDesc}",
baseViewModel: mode, textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0, letterSpacing: 1.0, fontWeight: FontWeight.w900, color: new Color(0xFF60686b))),
body: mode.ProjectAvgERWaitingTimeModeList.length > 0 Container(
? Container( margin: EdgeInsets.fromLTRB(2.0, 10.0, 0.0, 10.0),
child: ListView( child: GridView.count(
children: <Widget>[ crossAxisCount: 2,
Text( childAspectRatio: (itemWidth / itemWidth),
"${TranslationBase.of(context).NearestErDesc}", crossAxisSpacing: 10,
textAlign: TextAlign.center, mainAxisSpacing: 10,
style: TextStyle( controller: new ScrollController(keepScrollOffset: false),
fontSize: 18.0, shrinkWrap: true,
letterSpacing: 1.0, padding: const EdgeInsets.all(4.0),
fontWeight: FontWeight.w900, children: List.generate(7, (index) {
color: new Color(0xFF60686b))), return Container(
Container( child: CardPosition(
margin: EdgeInsets.fromLTRB(2.0, 10.0, 0.0, 10.0), waitingTime: projectAvgERWaitingTimeModelList[index].avgTimeInHHMM.toString(),
child: GridView.count( text: projectAvgERWaitingTimeModelList[index].projectName.toString(),
crossAxisCount: 2, image: 'assets/images/new-design/find_us_icon.png',
childAspectRatio: (itemWidth / itemWidth), subText: '${projectAvgERWaitingTimeModelList[index].distanceInKilometers ?? 0.0} ${TranslationBase.of(context).km_}',
crossAxisSpacing: 10, type: projectAvgERWaitingTimeModelList[index].iD.toString(),
mainAxisSpacing: 10, telephone: projectAvgERWaitingTimeModelList[index].phoneNumber.toString(),
controller: networkImage: projectAvgERWaitingTimeModelList[index].projectImageURL.toString(),
new ScrollController(keepScrollOffset: false), latitude: projectAvgERWaitingTimeModelList[index].latitude,
shrinkWrap: true, longitude: projectAvgERWaitingTimeModelList[index].longitude,
padding: const EdgeInsets.all(4.0), projectname: projectAvgERWaitingTimeModelList[index].projectName,
children: List.generate(7, (index) { cardSize: itemWidth,
return Container( ),
child: CardPosition( );
waitingTime: mode }),
.ProjectAvgERWaitingTimeModeList[index]
.avgTimeInHHMM
.toString(),
text: mode
.ProjectAvgERWaitingTimeModeList[index]
.projectName
.toString(),
image:
'assets/images/new-design/find_us_icon.png',
subText: '${mode.ProjectAvgERWaitingTimeModeList[index].distanceInKilometers ?? 0.0} ${TranslationBase.of(context).km_}',
type: mode
.ProjectAvgERWaitingTimeModeList[index].iD
.toString(),
telephone: mode
.ProjectAvgERWaitingTimeModeList[index]
.phoneNumber
.toString(),
networkImage: mode
.ProjectAvgERWaitingTimeModeList[index]
.projectImageURL
.toString(),
latitude: mode
.ProjectAvgERWaitingTimeModeList[index]
.latitude,
longitude: mode
.ProjectAvgERWaitingTimeModeList[index]
.longitude,
projectname: mode
.ProjectAvgERWaitingTimeModeList[index]
.projectName,
cardSize: itemWidth,
),
);
}),
),
), ),
], ),
), ],
)
: Center(
child: Texts('No Data'),
), ),
), )
: Center(
child: Texts('No Data'),
),
); );
} }
getERList() async {
GifLoaderDialogUtils.showMyDialog(context);
ErService service = new ErService();
service.getProjectAvgERWaitingTimeOrders().then((response) {
if (response['MessageStatus'] == 1) {
setState(() {
projectAvgERWaitingTimeModelList.clear();
response['List_ProjectAvgERWaitingTime'].forEach((vital) {
projectAvgERWaitingTimeModelList.add(ProjectAvgERWaitingTime.fromJson(vital));
});
});
GifLoaderDialogUtils.hideDialog(context);
} else {}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
});
}
} }

@ -612,6 +612,8 @@ class _ToDoState extends State<ToDo> {
authenticatedUser, authenticatedUser,
widget.browser, widget.browser,
appo.isLiveCareAppointment, appo.isLiveCareAppointment,
null,
null,
appo.appointmentDate, appo.appointmentDate,
appo.appointmentNo, appo.appointmentNo,
appo.clinicID, appo.clinicID,

@ -39,7 +39,7 @@ class _State extends State<ClinicCard> {
children: <Widget>[ children: <Widget>[
Card( Card(
margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0), margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0),
color: widget.isSelected ? Colors.blue : widget.patientERGetClinicsList.isOnline == 1 ? Colors.white : Colors.grey, color: widget.isSelected ? Color(0xff06b806) : widget.patientERGetClinicsList.isOnline == 1 ? Colors.white : Colors.grey,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),

@ -256,7 +256,7 @@ class _clinic_listState extends State<ClinicList> {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(12, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod, browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(12, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod,
authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false); authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID.toString());
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {

@ -226,7 +226,9 @@ class ConfirmPaymentPage extends StatelessWidget {
advanceModel.fileNumber, advanceModel.fileNumber,
authenticatedUser, authenticatedUser,
browser, browser,
false); false,
null,
null);
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {

@ -167,6 +167,8 @@ class MyInAppBrowser extends InAppBrowser {
AuthenticatedUser authenticatedUser, AuthenticatedUser authenticatedUser,
InAppBrowser browser, InAppBrowser browser,
bool isLiveCareAppo, bool isLiveCareAppo,
var servID,
var LiveServID,
[var appoDate, [var appoDate,
var appoNo, var appoNo,
var clinicID, var clinicID,
@ -185,6 +187,8 @@ class MyInAppBrowser extends InAppBrowser {
patientID, patientID,
authenticatedUser, authenticatedUser,
isLiveCareAppo, isLiveCareAppo,
servID,
LiveServID,
appoDate, appoDate,
appoNo, appoNo,
clinicID, clinicID,
@ -232,13 +236,13 @@ class MyInAppBrowser extends InAppBrowser {
dynamic patientID, dynamic patientID,
AuthenticatedUser authUser, AuthenticatedUser authUser,
bool isLiveCareAppo, bool isLiveCareAppo,
var servID,
var LiveServID,
[var appoDate, [var appoDate,
var appoNo, var appoNo,
var clinicID, var clinicID,
var doctorID, var doctorID,
var patientData, var patientData]) async {
var servID,
var LiveServID]) async {
getDeviceToken(); getDeviceToken();
String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN'; String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN';
String form = isLiveCareAppo ? getLiveCareForm() : getForm(); String form = isLiveCareAppo ? getLiveCareForm() : getForm();

Loading…
Cancel
Save