Merge branch 'amjad_amireh' into 'master'

edit card_position.dart

See merge request Cloud_Solution/diplomatic-quarter!47
merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
commit 14f3e08077

@ -54,6 +54,10 @@ const GET_PATIENT_VITAL_SIGN =
const GET_NEAREST_HOSPITAL= const GET_NEAREST_HOSPITAL=
'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
///Er Nearest
const GET_AMBULANCE_REQUEST=
'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod';

@ -0,0 +1,79 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class PatientER_RRT_GetAllTransportationMethodListModel {
int id;
DateTime createDate;
DateTime lastEditDate;
int createdBy;
int lastEditBy;
bool isActive;
String title;
String titleAR;
int price;
Null isDefault;
int visibility;
Null durationId;
String description;
String descriptionAR;
int totalPrice;
int vAT;
PatientER_RRT_GetAllTransportationMethodListModel(
{
this.id,
this.createDate,
this.lastEditDate,
this.createdBy,
this.lastEditBy,
this.isActive,
this.title,
this.titleAR,
this.price,
this.isDefault,
this.visibility,
this.durationId,
this.description,
this.descriptionAR,
this.totalPrice,
this.vAT});
PatientER_RRT_GetAllTransportationMethodListModel.fromJson(
Map<String, dynamic> json) {
id = json['Id'];
createDate = DateUtil.convertStringToDate(json['CreateDate']);
lastEditDate = DateUtil.convertStringToDate(json['LastEditDate']);
createdBy = json['CreatedBy'];
lastEditBy = json['LastEditBy'];
isActive = json['IsActive'];
title = json['Title'];
titleAR = json['TitleAR'];
price = json['Price'];
isDefault = json['isDefault'];
visibility = json['Visibility'];
durationId = json['DurationId'];
description = json['Description'];
descriptionAR = json['DescriptionAR'];
totalPrice = json['TotalPrice'];
vAT = json['VAT'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Id'] = this.id;
data['CreateDate'] = this.createDate;
data['LastEditDate'] = this.lastEditDate;
data['CreatedBy'] = this.createdBy;
data['LastEditBy'] = this.lastEditBy;
data['IsActive'] = this.isActive;
data['Title'] = this.title;
data['TitleAR'] = this.titleAR;
data['Price'] = this.price;
data['isDefault'] = this.isDefault;
data['Visibility'] = this.visibility;
data['DurationId'] = this.durationId;
data['Description'] = this.description;
data['DescriptionAR'] = this.descriptionAR;
data['TotalPrice'] = this.totalPrice;
data['VAT'] = this.vAT;
return data;
}
}

@ -0,0 +1,25 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
import '../base_service.dart';
class AmService extends BaseService {
List<PatientER_RRT_GetAllTransportationMethodListModel> AmModelList = List();
Map<String, dynamic> body = Map();
Future getAllTransportationOrders() async {
hasError = false;
await baseAppClient.post(GET_AMBULANCE_REQUEST,
onSuccess: (dynamic response, int statusCode) {
AmModelList.clear();
response['AmModelList'].forEach((vital) {
AmModelList.add(
PatientER_RRT_GetAllTransportationMethodListModel.fromJson(vital));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -0,0 +1,32 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
import 'package:diplomaticquarterapp/core/service/er/am_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../base_view_model.dart';
import '../../../locator.dart';
class AmRequestViewModel extends BaseViewModel{
AmService _amService = locator<AmService>();
List<PatientER_RRT_GetAllTransportationMethodListModel> get AmRequestModeList=>
_amService.AmModelList;
getAmRequestOrders({int id, int projectID}) async {
setState(ViewState.Busy);
await _amService.getAllTransportationOrders();
if ( _amService.hasError) {
error = _amService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -5,6 +5,7 @@ import 'package:get_it/get_it.dart';
import 'core/service/appointment_rate_service.dart'; import 'core/service/appointment_rate_service.dart';
import 'core/service/dashboard_service.dart'; import 'core/service/dashboard_service.dart';
import 'core/service/er/am_service.dart';
import 'core/service/er/er_service.dart'; import 'core/service/er/er_service.dart';
import 'core/service/feedback/feedback_service.dart'; import 'core/service/feedback/feedback_service.dart';
import 'core/service/hospital_service.dart'; import 'core/service/hospital_service.dart';
@ -18,6 +19,7 @@ import 'core/service/medical/radiology_service.dart';
import 'core/service/medical/reports_monthly_service.dart'; import 'core/service/medical/reports_monthly_service.dart';
import 'core/service/medical/vital_sign_service.dart'; import 'core/service/medical/vital_sign_service.dart';
import 'core/viewModels/appointment_rate_view_model.dart'; import 'core/viewModels/appointment_rate_view_model.dart';
import 'core/viewModels/er/am_request_view_model.dart';
import 'core/viewModels/er/near_hospital_view_model.dart'; import 'core/viewModels/er/near_hospital_view_model.dart';
import 'core/viewModels/feedback/feedback_view_model.dart'; import 'core/viewModels/feedback/feedback_view_model.dart';
import 'core/service/medical/reports_service.dart'; import 'core/service/medical/reports_service.dart';
@ -63,6 +65,9 @@ void setupLocator() {
locator.registerFactory(() => VaccineService()); locator.registerFactory(() => VaccineService());
locator.registerLazySingleton(() => ReportsMonthlyService()); locator.registerLazySingleton(() => ReportsMonthlyService());
locator.registerLazySingleton(() => ErService()); locator.registerLazySingleton(() => ErService());
locator.registerLazySingleton(() => AmService());
locator.registerLazySingleton(() => PatientSickLeaveService()); locator.registerLazySingleton(() => PatientSickLeaveService());
locator.registerLazySingleton(() => MyBalanceService()); locator.registerLazySingleton(() => MyBalanceService());
@ -84,6 +89,7 @@ void setupLocator() {
locator.registerFactory(() => QrViewModel()); locator.registerFactory(() => QrViewModel());
locator.registerFactory(() => ReportsMonthlyViewModel()); locator.registerFactory(() => ReportsMonthlyViewModel());
locator.registerFactory(() => NearHospitalViewModel()); locator.registerFactory(() => NearHospitalViewModel());
locator.registerFactory(() => AmRequestViewModel());
locator.registerFactory(() => PatientSickLeaveViewMode()); locator.registerFactory(() => PatientSickLeaveViewMode());
locator.registerFactory(() => MyBalanceViewModel()); locator.registerFactory(() => MyBalanceViewModel());

@ -0,0 +1,125 @@
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'dart:ui';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
class AmbulanceReq extends StatefulWidget {
@override
_AmbulanceReqState createState() => _AmbulanceReqState();
}
class _AmbulanceReqState extends State<AmbulanceReq>
with SingleTickerProviderStateMixin {
TabController _tabController;
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
}
@override
void dispose() {
super.dispose();
_tabController.dispose();
}
@override
Widget build(BuildContext context) {
return BaseView<PrescriptionsViewModel>(
onModelReady: (model) => model.getPrescriptions(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: "Ambulance Request",
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize: Size.fromHeight(65.0),
child: Stack(
children: <Widget>[
Positioned(
bottom: 1,
left: 0,
right: 0,
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
child: Container(
color: Theme.of(context)
.scaffoldBackgroundColor
.withOpacity(0.8),
height: 70.0,
),
),
),
Center(
child: Container(
height: 60.0,
margin: EdgeInsets.only(top: 10.0),
width: MediaQuery.of(context).size.width * 0.9,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Theme.of(context).dividerColor,
width: 0.7),
),
color: Colors.white),
child: Center(
child: TabBar(
isScrollable: true,
controller: _tabController,
indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.label,
indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor,
labelPadding:
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.40,
child: Center(
child: Texts("Ambulance Request"),//TranslationBase.of(context).prescriptions
),
),
Container(
width: MediaQuery.of(context).size.width * 0.30,
child: Center(
child: Texts("Orders Log"),
),
),
],
),
),
),
),
],
),
),
body: Column(
children: <Widget>[
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: <Widget>[
PrescriptionsPage(
prescriptionsViewModel: model,
),
PrescriptionsHistoryPage(
prescriptionsViewModel: model,
)
],
),
)
],
),
),
),
);
}
}

@ -37,12 +37,7 @@ class _ErOptionsState extends State<ErOptions> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
// Text(TranslationBase.of(context).searchBy,
// style: TextStyle(
// fontSize: 24.0,
// letterSpacing: 1.0,
// fontWeight: FontWeight.bold,
// color: new Color(0xFF60686b))),
Container( Container(
margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0),
child: Row( child: Row(

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../AmbulanceReq.dart';
import '../NearestEr.dart'; import '../NearestEr.dart';
class CardCommonEr extends StatelessWidget { class CardCommonEr extends StatelessWidget {
@ -21,7 +22,7 @@ class CardCommonEr extends StatelessWidget {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
navigateToSearch(context, this.type); navigateToSearch(context, this.type);
print("=============this.type============="+this.type);
}, },
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0), margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0),
@ -61,16 +62,15 @@ class CardCommonEr extends StatelessWidget {
Future navigateToSearch(context, type) async { Future navigateToSearch(context, type) async {
//===Switch case=== //===Switch case===
if(type==0) if(type==0)
{print("========Ambalunce=========");} {
Navigator.push(
context,
FadePage(
page: AmbulanceReq()));
}
else{ else{
print("=========Nearest ER===========");
// Navigator.push(
// context,
//
// FadePage(
// // page: NearestEr(isAppbar: true,)));
// page: NearestEr()));
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -79,11 +79,5 @@ class CardCommonEr extends StatelessWidget {
} }
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => Search(
// type: type,
// )));
} }
} }

@ -40,7 +40,7 @@ class CardPosition extends StatelessWidget {
}, },
child: Container( child: Container(
width:170, width:MediaQuery.of(context).size.width * 0.47,//165,
margin: EdgeInsets.fromLTRB(7.0, 7.0, 7.0, 7.0), margin: EdgeInsets.fromLTRB(7.0, 7.0, 7.0, 7.0),
decoration: BoxDecoration(boxShadow: [ decoration: BoxDecoration(boxShadow: [
BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)
@ -79,10 +79,8 @@ class CardPosition extends StatelessWidget {
Future navigateToSearch(context, type,telephone,networkImage,latitude,longitude,projectname) async { Future navigateToSearch(context, type,telephone,networkImage,latitude,longitude,projectname) async {
//===Switch case===
print("================"+type);
print("================"+telephone);
print("================"+networkImage);
showDialog( showDialog(
context: context,builder: (_) => AssetGiffyDialog( context: context,builder: (_) => AssetGiffyDialog(
@ -98,22 +96,6 @@ class CardPosition extends StatelessWidget {
onOkButtonPressed: () { MapsLauncher.launchCoordinates(double.parse(latitude),double.parse(longitude),projectname);}, onOkButtonPressed: () { MapsLauncher.launchCoordinates(double.parse(latitude),double.parse(longitude),projectname);},
onCancelButtonPressed :() {launch("tel://" +telephone);} onCancelButtonPressed :() {launch("tel://" +telephone);}
// double.parse(
// _medicineProvider.pharmaciesList[index]["Latitude"]),
// double.parse(
// _medicineProvider.pharmaciesList[index]["Longitude"]),
// _medicineProvider.pharmaciesList[index]
// ["LocationDescription"]);
//launch("tel://" +telephone);
//================
// MapsLauncher.launchCoordinates(
// double.parse(
// _medicineProvider.pharmaciesList[index]["Latitude"]),
// double.parse(
// _medicineProvider.pharmaciesList[index]["Longitude"]),
// _medicineProvider.pharmaciesList[index]
// ["LocationDescription"]);
//=================

Loading…
Cancel
Save