hmc services design fixed

merge-requests/390/head
Sultan Khan 5 years ago
parent 671c432cd7
commit 169aafa26b

@ -13,8 +13,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
// const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -1225,7 +1225,7 @@ const Map localizedValues = {
"en": "Choose one of the following symptoms to show the right doctors or choose a consultation to show all", "en": "Choose one of the following symptoms to show the right doctors or choose a consultation to show all",
"ar": "اختر أحد الأعراض التالية لتظهر للأطباء المناسبين أو اختر استشارة لإظهار الكل" "ar": "اختر أحد الأعراض التالية لتظهر للأطباء المناسبين أو اختر استشارة لإظهار الكل"
}, },
"continue": {"en": "CONTINUE", "ar": "إستمرار"}, "continue": {"en": "Continue", "ar": "إستمرار"},
"skip": {"en": "SKIP", "ar": "تخطى"}, "skip": {"en": "SKIP", "ar": "تخطى"},
"calorieCalcDesc": { "calorieCalcDesc": {
"en": "Calculates daily calorie intake based on several factors, like height, weight, age, gender and daily physical activity ", "en": "Calculates daily calorie intake based on several factors, like height, weight, age, gender and daily physical activity ",
@ -1461,5 +1461,5 @@ const Map localizedValues = {
"sys/dias": {"en": "SBP/DBP", "ar": "إنقباض/إنبساط"}, "sys/dias": {"en": "SBP/DBP", "ar": "إنقباض/إنبساط"},
"arm": {"en": "Arm", "ar": "الذراع"}, "arm": {"en": "Arm", "ar": "الذراع"},
"remove-measure": {"en": "Remove this measure", "ar": "إزالة هذا القياس؟"}, "remove-measure": {"en": "Remove this measure", "ar": "إزالة هذا القياس؟"},
"select-arm": {"en": "Select the Arm", "ar": "إختر الذراع"} "select-arm": {"en": "Select the Arm", "ar": "إختر الذراع"},
}; };

@ -21,32 +21,27 @@ class LocationPage extends StatefulWidget {
final double longitude; final double longitude;
final dynamic model; final dynamic model;
const LocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model}) const LocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model}) : super(key: key);
: super(key: key);
@override @override
_LocationPageState createState() => _LocationPageState createState() => _LocationPageState();
_LocationPageState();
} }
class _LocationPageState class _LocationPageState extends State<LocationPage> {
extends State<LocationPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
bool showCurrentLocation = false; bool showCurrentLocation = false;
@override @override
void initState() { void initState() {
latitude = widget.latitude; latitude = widget.latitude;
longitude = widget.longitude; longitude = widget.longitude;
if(latitude == 0.0 && longitude == 0.0) { if (latitude == 0.0 && longitude == 0.0) {
showCurrentLocation = true; showCurrentLocation = true;
} }
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -57,6 +52,8 @@ class _LocationPageState
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
showNewAppBarTitle: true,
showNewAppBar: true,
body: PlacePicker( body: PlacePicker(
apiKey: GOOGLE_API_KEY, apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true, enableMyLocationButton: true,
@ -68,10 +65,8 @@ class _LocationPageState
searchForInitialValue: false, searchForInitialValue: false,
onPlacePicked: (PickResult result) { onPlacePicked: (PickResult result) {
print(result.adrAddress); print(result.adrAddress);
}, },
selectedPlaceWidgetBuilder: selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused"); print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused return isSearchBarFocused
? Container() ? Container()
@ -91,15 +86,11 @@ class _LocationPageState
color: Colors.grey[800], color: Colors.grey[800],
textColor: Colors.white, textColor: Colors.white,
onTap: () async { onTap: () async {
AddNewAddressRequestModel AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel(
addNewAddressRequestModel =
new AddNewAddressRequestModel(
customer: Customer(addresses: [ customer: Customer(addresses: [
Addresses( Addresses(
address1: address1: selectedPlace.formattedAddress,
selectedPlace.formattedAddress, address2: selectedPlace.formattedAddress,
address2: selectedPlace
.formattedAddress,
customerAttributes: "", customerAttributes: "",
city: "", city: "",
createdOnUtc: "", createdOnUtc: "",
@ -111,29 +102,21 @@ class _LocationPageState
selectedPlace.addressComponents.forEach((e) { selectedPlace.addressComponents.forEach((e) {
if (e.types.contains("country")) { if (e.types.contains("country")) {
addNewAddressRequestModel.customer addNewAddressRequestModel.customer.addresses[0].country = e.longName;
.addresses[0].country = e.longName;
} }
if (e.types.contains("postal_code")) { if (e.types.contains("postal_code")) {
addNewAddressRequestModel.customer addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName;
.addresses[0].zipPostalCode =
e.longName;
} }
if (e.types.contains("locality")) { if (e.types.contains("locality")) {
addNewAddressRequestModel.customer addNewAddressRequestModel.customer.addresses[0].city = e.longName;
.addresses[0].city =
e.longName;
} }
}); });
await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
await model.addAddressInfo(
addNewAddressRequestModel: addNewAddressRequestModel);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
AppToast.showSuccessToast( AppToast.showSuccessToast(message: "Address Added Successfully");
message: "Address Added Successfully");
} }
Navigator.of(context).pop(addNewAddressRequestModel); Navigator.of(context).pop(addNewAddressRequestModel);
}, },

@ -5,43 +5,33 @@ import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.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:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
class NewHomeHealthCareStepOnePage extends StatefulWidget { class NewHomeHealthCareStepOnePage extends StatefulWidget {
final PatientERInsertPresOrderRequestModel final PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel;
patientERInsertPresOrderRequestModel;
final Function changePageViewIndex; final Function changePageViewIndex;
final HomeHealthCareViewModel model; final HomeHealthCareViewModel model;
const NewHomeHealthCareStepOnePage( const NewHomeHealthCareStepOnePage({Key key, this.patientERInsertPresOrderRequestModel, this.model, this.changePageViewIndex}) : super(key: key);
{Key key,
this.patientERInsertPresOrderRequestModel,
this.model,
this.changePageViewIndex})
: super(key: key);
@override @override
_NewHomeHealthCareStepOnePageState createState() => _NewHomeHealthCareStepOnePageState createState() => _NewHomeHealthCareStepOnePageState();
_NewHomeHealthCareStepOnePageState();
} }
class _NewHomeHealthCareStepOnePageState class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOnePage> {
extends State<NewHomeHealthCareStepOnePage> {
PickResult _result; PickResult _result;
@override @override
void initState() { void initState() {
if (widget.patientERInsertPresOrderRequestModel if (widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList == null) widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList = [];
.patientERHHCInsertServicesList ==
null)
widget.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList = [];
super.initState(); super.initState();
} }
@ -55,30 +45,25 @@ class _NewHomeHealthCareStepOnePageState
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: MediaQuery.of(context).size.width * 0.05, right: MediaQuery.of(context).size.width * 0.05),
left: MediaQuery.of(context).size.width * 0.05,
right: MediaQuery.of(context).size.width * 0.05),
child: Center( child: Center(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 1, widthFactor: 1,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( // Texts(
height: 12, // TranslationBase.of(context).selectHomeHealthCareServices,
), // textAlign: TextAlign.center,
Texts( // ),
TranslationBase.of(context).selectHomeHealthCareServices,
textAlign: TextAlign.center,
),
Column( Column(
children: widget.model.hhcAllServicesList.map((service) { children: widget.model.hhcAllServicesList.map((service) {
return Container( return Container(
margin: EdgeInsets.only(top: 15), margin: EdgeInsets.only(top: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey, width: 1), // border: Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Theme.of(context).primaryColor), ),
child: Column( child: Column(
children: [ children: [
Row( Row(
@ -86,21 +71,14 @@ class _NewHomeHealthCareStepOnePageState
Checkbox( Checkbox(
value: isServiceSelected(service.serviceID), value: isServiceSelected(service.serviceID),
activeColor: Colors.red[800], activeColor: Colors.red[800],
tristate: false,
onChanged: (bool newValue) { onChanged: (bool newValue) {
setState(() { setState(() {
if (!isServiceSelected( if (!isServiceSelected(service.serviceID))
service.serviceID)) widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.add(PatientERHHCInsertServicesList(
widget recordID: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length,
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.add(PatientERHHCInsertServicesList(
recordID: widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.length,
serviceID: service.serviceID, serviceID: service.serviceID,
serviceName: serviceName: service.description));
service.description));
else else
removeSelected(service.serviceID); removeSelected(service.serviceID);
// widget.patientERInsertPresOrderRequestModel // widget.patientERInsertPresOrderRequestModel
@ -109,22 +87,27 @@ class _NewHomeHealthCareStepOnePageState
}), }),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.only(left: 0.0, right: 10),
child: Texts( child: Texts(
projectViewModel.isArabic projectViewModel.isArabic ? service.descriptionN : service.description.toLowerCase()?.capitalize(),
? service.descriptionN
: service.description,
fontSize: 15, fontSize: 15,
style: 'letterSpacing: -0.48',
fontWeight: FontWeight.bold,
), ),
), ),
), ),
], ],
), ),
Divider(
height: 1,
color: Colors.grey,
)
], ],
), ),
); );
}).toList(), }).toList(),
) ),
SizedBox(height: 70)
], ],
), ),
), ),
@ -132,44 +115,73 @@ class _NewHomeHealthCareStepOnePageState
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.10, width: MediaQuery.of(context).size.width,
width: double.infinity, height: 70.0,
child: Column( margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
children: <Widget>[ child: Button(
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
label: TranslationBase.of(context).next,
disabled: this
.widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.length ==
0 ||
widget.model.state == ViewState.BusyLocal,
color: Colors.grey[800],
loading: widget.model.state == ViewState.BusyLocal,
onTap: () async { onTap: () async {
await widget.model.getCustomerInfo(); await widget.model.getCustomerInfo();
if (widget.model.state == ViewState.ErrorLocal) { if (widget.model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(); Utils.showErrorToast();
} else { } else {
widget.changePageViewIndex(1); Navigator.push(
context,
FadePage(
page: NewHomeHealthCareStepTowPage(
patientERInsertPresOrderRequestModel: widget.patientERInsertPresOrderRequestModel,
model: widget.model,
),
),
);
// widget.changePageViewIndex(1);
} }
}, },
textColor: Theme.of(context).backgroundColor), label: TranslationBase.of(context).next,
), backgroundColor: Colors.red[900],
], disabled: this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal,
loading: widget.model.state == ViewState.BusyLocal,
), ),
), ),
// 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(
// label: TranslationBase.of(context).next,
// disabled: this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal,
// color: Colors.grey[800],
// loading: widget.model.state == ViewState.BusyLocal,
// onTap: () async {
// await widget.model.getCustomerInfo();
// if (widget.model.state == ViewState.ErrorLocal) {
// Utils.showErrorToast();
// } else {
// Navigator.push(
// context,
// FadePage(
// page: NewHomeHealthCareStepTowPage(),
// ),
// );
// // widget.changePageViewIndex(1);
// }
// },
// textColor: Theme.of(context).backgroundColor),
// ),
// ],
// ),
// ),
); );
} }
isServiceSelected(int serviceId) { isServiceSelected(int serviceId) {
Iterable<PatientERHHCInsertServicesList> patientERHHCInsertServicesList = Iterable<PatientERHHCInsertServicesList> patientERHHCInsertServicesList =
widget widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.where((element) => serviceId == element.serviceID);
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
.where((element) => serviceId == element.serviceID);
if (patientERHHCInsertServicesList.length > 0) { if (patientERHHCInsertServicesList.length > 0) {
return true; return true;
} }
@ -178,15 +190,11 @@ class _NewHomeHealthCareStepOnePageState
removeSelected(int serviceId) { removeSelected(int serviceId) {
Iterable<PatientERHHCInsertServicesList> patientERHHCInsertServicesList = Iterable<PatientERHHCInsertServicesList> patientERHHCInsertServicesList =
widget widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.where((element) => serviceId == element.serviceID);
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
.where((element) => serviceId == element.serviceID);
if (patientERHHCInsertServicesList.length > 0) if (patientERHHCInsertServicesList.length > 0)
setState(() { setState(() {
widget widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.remove(patientERHHCInsertServicesList.first);
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
.remove(patientERHHCInsertServicesList.first);
}); });
} }
} }

@ -12,26 +12,21 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart';
class NewHomeHealthCareStepThreePage extends StatefulWidget { class NewHomeHealthCareStepThreePage extends StatefulWidget {
final PatientERInsertPresOrderRequestModel final PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel;
patientERInsertPresOrderRequestModel;
final Function changePageViewIndex; final Function changePageViewIndex;
final HomeHealthCareViewModel model; final HomeHealthCareViewModel model;
NewHomeHealthCareStepThreePage( NewHomeHealthCareStepThreePage({Key key, this.patientERInsertPresOrderRequestModel, this.changePageViewIndex, this.model});
{Key key,
this.patientERInsertPresOrderRequestModel,
this.changePageViewIndex,
this.model});
@override @override
_NewHomeHealthCareStepThreePageState createState() => _NewHomeHealthCareStepThreePageState createState() => _NewHomeHealthCareStepThreePageState();
_NewHomeHealthCareStepThreePageState();
} }
class _NewHomeHealthCareStepThreePageState class _NewHomeHealthCareStepThreePageState extends State<NewHomeHealthCareStepThreePage> {
extends State<NewHomeHealthCareStepThreePage> {
Completer<GoogleMapController> _controller = Completer(); Completer<GoogleMapController> _controller = Completer();
static CameraPosition _kGooglePlex = CameraPosition( static CameraPosition _kGooglePlex = CameraPosition(
@ -42,22 +37,17 @@ class _NewHomeHealthCareStepThreePageState
@override @override
void initState() { void initState() {
if (widget.patientERInsertPresOrderRequestModel.latitude != null) { if (widget.patientERInsertPresOrderRequestModel.latitude != null) {
markers.clear(); markers.clear();
markers.add( markers.add(
Marker( Marker(
markerId: MarkerId( markerId: MarkerId(
widget.patientERInsertPresOrderRequestModel.latitude.hashCode widget.patientERInsertPresOrderRequestModel.latitude.hashCode.toString(),
.toString(),
), ),
position: LatLng( position: LatLng(widget.patientERInsertPresOrderRequestModel.latitude, widget.patientERInsertPresOrderRequestModel.longitude)),
widget.patientERInsertPresOrderRequestModel.latitude,
widget.patientERInsertPresOrderRequestModel.longitude)),
); );
_kGooglePlex = CameraPosition( _kGooglePlex = CameraPosition(
target: LatLng(widget.patientERInsertPresOrderRequestModel.latitude, target: LatLng(widget.patientERInsertPresOrderRequestModel.latitude, widget.patientERInsertPresOrderRequestModel.longitude),
widget.patientERInsertPresOrderRequestModel.longitude),
zoom: 14.4746, zoom: 14.4746,
); );
} }
@ -71,6 +61,9 @@ class _NewHomeHealthCareStepThreePageState
return AppScaffold( return AppScaffold(
isShowDecPage: false, isShowDecPage: false,
baseViewModel: widget.model, baseViewModel: widget.model,
showNewAppBar: true,
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).homeHealthCare,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( child: Container(
@ -79,19 +72,20 @@ class _NewHomeHealthCareStepThreePageState
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).orderDetails, fontWeight: FontWeight.bold,),
SizedBox(
height: 12,
),
Container( Container(
decoration: BoxDecoration( padding: EdgeInsets.all(20),
color: Colors.white, child: Texts(
borderRadius: BorderRadius.circular(12)), TranslationBase.of(context).RRTSummary,
fontWeight: FontWeight.bold,
fontSize: 22,
)),
Container(
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)),
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).orderLocation, fontWeight: FontWeight.bold), Texts(TranslationBase.of(context).selectedLocation, fontWeight: FontWeight.bold),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
@ -112,30 +106,33 @@ class _NewHomeHealthCareStepThreePageState
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts(TranslationBase.of(context).selectedService + " : ", fontWeight: FontWeight.bold), Texts(TranslationBase.of(context).selectedService),
...List.generate( ...List.generate(
widget.patientERInsertPresOrderRequestModel widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length,
.patientERHHCInsertServicesList.length,
(index) => Container( (index) => Container(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( // Texts(
TranslationBase.of(context).serviceName, // TranslationBase.of(context).serviceName,
fontSize: 12, // fontSize: 12,
), // ),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Row(
children: [
Texts(
(index + 1).toString() + '. ',
fontSize: 15,
),
Texts( Texts(
widget widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList[index].serviceName,
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList[index]
.serviceName,
fontSize: 15, fontSize: 15,
bold: true,
), ),
], ],
)
],
), ),
), ),
) )
@ -158,15 +155,12 @@ class _NewHomeHealthCareStepThreePageState
width: MediaQuery.of(context).size.width * 0.9, width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).confirm, label: TranslationBase.of(context).confirm,
disabled: widget.patientERInsertPresOrderRequestModel disabled: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0,
.patientERHHCInsertServicesList.length ==
0,
color: Colors.grey[800], color: Colors.grey[800],
onTap: () async { onTap: () async {
await widget.model.insertPresPresOrder( await widget.model.insertPresPresOrder(order: widget.patientERInsertPresOrderRequestModel);
order: widget.patientERInsertPresOrderRequestModel);
if (widget.model.state != ViewState.ErrorLocal) { if (widget.model.state != ViewState.ErrorLocal) {
widget.changePageViewIndex(0); Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: NewHomeHealthCarePage));
} }
}, },
textColor: Theme.of(context).backgroundColor), textColor: Theme.of(context).backgroundColor),

@ -1,9 +1,12 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -14,41 +17,37 @@ import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'dart:async';
import 'location_page.dart'; import 'location_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart';
class NewHomeHealthCareStepTowPage extends StatefulWidget { class NewHomeHealthCareStepTowPage extends StatefulWidget {
final Function(PickResult) onPick; final Function(PickResult) onPick;
final double latitude; final double latitude;
final double longitude; final double longitude;
final PatientERInsertPresOrderRequestModel final PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel;
patientERInsertPresOrderRequestModel;
final Function changePageViewIndex; final Function changePageViewIndex;
final HomeHealthCareViewModel model; final HomeHealthCareViewModel model;
const NewHomeHealthCareStepTowPage( const NewHomeHealthCareStepTowPage({Key key, this.onPick, this.latitude, this.longitude, this.patientERInsertPresOrderRequestModel, this.changePageViewIndex, this.model}) : super(key: key);
{Key key,
this.onPick,
this.latitude,
this.longitude,
this.patientERInsertPresOrderRequestModel,
this.changePageViewIndex,
this.model})
: super(key: key);
@override @override
_NewHomeHealthCareStepTowPageState createState() => _NewHomeHealthCareStepTowPageState createState() => _NewHomeHealthCareStepTowPageState();
_NewHomeHealthCareStepTowPageState();
} }
class _NewHomeHealthCareStepTowPageState class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowPage> {
extends State<NewHomeHealthCareStepTowPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
AddressInfo _selectedAddress; AddressInfo _selectedAddress;
bool showCurrentLocation = false; bool showCurrentLocation = false;
Completer<GoogleMapController> _controller = Completer();
static CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746,
);
final Set<Marker> markers = new Set();
@override @override
void initState() { void initState() {
if (widget.patientERInsertPresOrderRequestModel.latitude == null) { if (widget.patientERInsertPresOrderRequestModel.latitude == null) {
@ -57,30 +56,38 @@ class _NewHomeHealthCareStepTowPageState
latitude = widget.patientERInsertPresOrderRequestModel.latitude; latitude = widget.patientERInsertPresOrderRequestModel.latitude;
longitude = widget.patientERInsertPresOrderRequestModel.longitude; longitude = widget.patientERInsertPresOrderRequestModel.longitude;
} }
markers.clear();
markers.add(
Marker(
markerId: MarkerId(
latitude.hashCode.toString(),
),
position: LatLng(latitude, longitude)),
);
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
super.initState(); super.initState();
} }
setLatitudeAndLongitude({bool isSetState = false, String latLong}) { setLatitudeAndLongitude({bool isSetState = false, String latLong}) {
if (latLong == null){ if (latLong == null) {
if(widget.model.addressesList.isEmpty) { if (widget.model.addressesList.isEmpty) {
setState(() { setState(() {
showCurrentLocation = true; showCurrentLocation = true;
}); });
} else { } else {
latLong = widget.model.addressesList[widget.model.addressesList latLong = widget.model.addressesList[widget.model.addressesList.length - 1].latLong;
.length - 1].latLong;
} }
} }
if(!showCurrentLocation) { if (!showCurrentLocation) {
List latLongArr = latLong.split(','); List latLongArr = latLong.split(',');
latitude = double.parse(latLongArr[0]); latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]); longitude = double.parse(latLongArr[1]);
} }
} }
@override @override
@ -88,121 +95,211 @@ class _NewHomeHealthCareStepTowPageState
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowDecPage: false, isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).homeHealthCare,
body: Stack( body: Stack(
children: [ children: [
PlacePicker( Container(
apiKey: GOOGLE_API_KEY, margin: EdgeInsets.only(top: 120),
enableMyLocationButton: true, child: GoogleMap(
automaticallyImplyAppBarLeading: false, mapType: MapType.normal,
autocompleteOnTrailingWhitespace: true, markers: markers,
selectInitialPosition: true, initialCameraPosition: _kGooglePlex,
autocompleteLanguage: projectViewModel.currentLanguage, onMapCreated: (GoogleMapController controller) {
enableMapTypeButton: true, _controller.complete(controller);
searchForInitialValue: false,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
widget.changePageViewIndex(3);
}, },
selectedPlaceWidgetBuilder: )
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused"); // PlacePicker(
return isSearchBarFocused // apiKey: GOOGLE_API_KEY,
? Container() // enableMyLocationButton: true,
: FloatingCard( // automaticallyImplyAppBarLeading: false,
bottomPosition: 0.0, // autocompleteOnTrailingWhitespace: false,
leftPosition: 0.0, // selectInitialPosition: true,
rightPosition: 0.0, // autocompleteLanguage: projectViewModel.currentLanguage,
width: 500, // enableMapTypeButton: false,
borderRadius: BorderRadius.circular(12.0), // searchForInitialValue: true,
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator()) // // onPlacePicked: (PickResult result) {
: Container( // // print(result.adrAddress);
margin: EdgeInsets.all(12), // // widget.changePageViewIndex(3);
child: Column( // // },
// selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
// print("state: $state, isSearchBarFocused: $isSearchBarFocused");
// return isSearchBarFocused
// ? Container()
// : FloatingCard(
// bottomPosition: 0.0,
// leftPosition: 0.0,
// rightPosition: 0.0,
// width: 500,
// borderRadius: BorderRadius.circular(12.0),
// child: Container(
// margin: EdgeInsets.all(12),
// child: Column(
// children: [
// // SecondaryButton(
// // color: Colors.grey[800],
// // textColor: Colors.white,
// // onTap: () {
// // Navigator.push(
// // context,
// // FadePage(
// // page: LocationPage(
// // latitude: latitude,
// // longitude: longitude,
// // ),
// // ),
// // );
// // },
// // label: TranslationBase.of(context).addNewAddress,
// // ),
// // SizedBox(
// // height: 10,
// // ),
// SecondaryButton(
// color: Colors.red[800],
// textColor: Colors.white,
// onTap: () {
// setState(() {
// widget.patientERInsertPresOrderRequestModel.latitude = selectedPlace.geometry.location.lat;
// widget.patientERInsertPresOrderRequestModel.longitude = selectedPlace.geometry.location.lng;
// });
// widget.changePageViewIndex(3);
// },
// label: TranslationBase.of(context).confirm,
// ),
// ],
// ),
// ),
// );
// },
// initialPosition: LatLng(latitude, longitude),
// useCurrentLocation: showCurrentLocation,
// )
),
if (widget.model.addressesList.isNotEmpty)
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Container(
height: 60,
width: MediaQuery.of(context).size.width * .9,
margin: EdgeInsets.only(top: 10),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white),
child: DropdownButtonHideUnderline(
child: ButtonTheme(
alignedDropdown: true,
child: DropdownButton<AddressInfo>(
hint: Text(
widget.model.addressesList[0].address1,
style: TextStyle(color: CustomColors.black, fontSize: 14),
),
iconEnabledColor: CustomColors.grey2,
style: TextStyle(color: CustomColors.black, fontSize: 14),
dropdownColor: CustomColors.white,
value: _selectedAddress,
items: widget.model.addressesList.map((AddressInfo value) {
return DropdownMenuItem<AddressInfo>(
value: value,
child: new AutoSizeText(
value.address1,
),
);
}).toList(),
onChanged: (r) {},
underline: Container(
height: 0,
),
),
),
),
)
]),
Positioned(
top: 80,
left: 20,
child: Row(
children: [ children: [
SecondaryButton( Icon(
color: Colors.grey[800], Icons.add_circle_rounded,
textColor: Colors.white, ),
InkWell(
child: Texts(
TranslationBase.of(context).addNewAddress,
fontWeight: FontWeight.bold,
),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: page: LocationPage(
LocationPage(
latitude: latitude, latitude: latitude,
longitude: longitude, longitude: longitude,
), ),
), ),
); );
}, },
label: TranslationBase.of(context).addNewAddress,
),
SizedBox(height: 10,),
SecondaryButton(
color: Colors.red[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientERInsertPresOrderRequestModel
.latitude =
selectedPlace.geometry.location.lat;
widget.patientERInsertPresOrderRequestModel
.longitude =
selectedPlace.geometry.location.lng;
});
widget.changePageViewIndex(3);
},
label: TranslationBase.of(context).confirm,
), ),
], ],
))
// Container(
// child: InkWell(
// onTap: () => confirmSelectLocationDialog(widget.model.addressesList),
// child: Container(
// padding: EdgeInsets.all(10),
// width: double.infinity,
// // height: 65,
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Expanded(
// child: Texts(
// getAddressName(),
// fontSize: 14,
// ),
// ),
// Icon(Icons.arrow_drop_down)
// ],
// ),
// ),
// ),
// height: 56,
// width: double.infinity,
// color: Theme.of(context).scaffoldBackgroundColor,
// )
],
),
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 70.0,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button(
onTap: () async {
Navigator.push(
context,
FadePage(
page: NewHomeHealthCareStepThreePage(
patientERInsertPresOrderRequestModel: widget.patientERInsertPresOrderRequestModel,
model: widget.model,
), ),
), ),
); );
}, },
initialPosition: LatLng(latitude, longitude), label: TranslationBase.of(context).continues,
useCurrentLocation: showCurrentLocation, backgroundColor: Colors.red[900],
),
if(widget.model.addressesList.isNotEmpty)
Container(
child: InkWell(
onTap: () =>
confirmSelectLocationDialog(widget.model.addressesList),
child: Container(
padding: EdgeInsets.all(10),
width: double.infinity,
// height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Texts(getAddressName(), fontSize: 14,),),
Icon(Icons.arrow_drop_down)
],
), ),
), ),
),
height: 56, width: double.infinity, color: Theme
.of(context)
.scaffoldBackgroundColor,
)
],
),
); );
} }
void confirmSelectLocationDialog(List<AddressInfo> addresses) { void confirmSelectLocationDialog(List<AddressInfo> addresses) {
showDialog( showDialog(
context: context, context: context,
child: SelectLocationDialog( child: SelectLocationDialog(
addresses: addresses, addresses: addresses,
selectedAddress: _selectedAddress selectedAddress: _selectedAddress,
,
onValueSelected: (value) { onValueSelected: (value) {
setLatitudeAndLongitude(latLong: value.latLong); setLatitudeAndLongitude(latLong: value.latLong);
setState(() { setState(() {

@ -11,12 +11,12 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import '../StepsWidget.dart'; import '../StepsWidget.dart';
import 'new_Home_health_care_step_one_page.dart'; import 'new_Home_health_care_step_one_page.dart';
@ -28,15 +28,13 @@ class NewHomeHealthCarePage extends StatefulWidget {
_NewHomeHealthCarePageState createState() => _NewHomeHealthCarePageState(); _NewHomeHealthCarePageState createState() => _NewHomeHealthCarePageState();
} }
class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with TickerProviderStateMixin {
with TickerProviderStateMixin {
PageController _controller; PageController _controller;
int _currentIndex = 1; int _currentIndex = 1;
double _latitude; double _latitude;
double _longitude; double _longitude;
PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel = PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel = new PatientERInsertPresOrderRequestModel();
new PatientERInsertPresOrderRequestModel();
@override @override
void initState() { void initState() {
@ -64,32 +62,23 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
setState(() { setState(() {
_currentIndex = tab; _currentIndex = tab;
}); });
_controller.animateToPage(tab, _controller.animateToPage(tab, duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
void showConfirmMessage(HomeHealthCareViewModel model, void showConfirmMessage(HomeHealthCareViewModel model, GetOrderDetailByOrderIDResponseModel order) {
GetOrderDetailByOrderIDResponseModel order) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmCancelOrderDialog( child: ConfirmCancelOrderDialog(
model: model, model: model,
onTap: () async { onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.presOrderID, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
UpdatePresOrderRequestModel(
presOrderID: order.presOrderID,
rejectionReason: "",
presOrderStatus: 4,
editedBy: 3);
await model.updateHHCPresOrder(updatePresOrderRequestModel); await model.updateHHCPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
AppToast.showSuccessToast( AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
message:
TranslationBase.of(context).processDoneSuccessfully);
await model.getHHCAllPresOrders(); await model.getHHCAllPresOrders();
// await model.getHHCAllServices(); // await model.getHHCAllServices();
} }
@ -106,15 +95,15 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
height: MediaQuery.of(context).size.height * 0.8, height: MediaQuery.of(context).size.height * 0.8,
child: Column( child: Column(
children: [ children: [
Container( // Container(
margin: EdgeInsets.only( // margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width * 0.05, // left: MediaQuery.of(context).size.width * 0.05,
right: MediaQuery.of(context).size.width * 0.05), // right: MediaQuery.of(context).size.width * 0.05),
child: StepsWidget( // child: StepsWidget(
index: _currentIndex, // index: _currentIndex,
changeCurrentTab: _changeCurrentTab, // changeCurrentTab: _changeCurrentTab,
), // ),
), // ),
Expanded( Expanded(
child: PageView( child: PageView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
@ -130,248 +119,284 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
? FractionallySizedBox( ? FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Row(
children: [
Expanded(
flex: 3,
child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(20.0)),
child: Container( child: Container(
width: double.infinity, padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
margin: EdgeInsets.only(top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 7),
decoration: BoxDecoration( decoration: BoxDecoration(boxShadow: [
border: Border.all( BoxShadow(color: Color(0xffcd9e1b), offset: Offset(-10, 0)),
color: Colors.grey, width: 1), ], borderRadius: const BorderRadius.all(Radius.circular(10.0)), color: Colors.white),
borderRadius: BorderRadius.circular(12), child: Row(
color: Theme.of(context).primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
SizedBox( Expanded(
height: 12,
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15,
bottom: 15,
top: 15,
right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color:
Theme.of(context).primaryColor),
child: Column( child: Column(
crossAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
CrossAxisAlignment.start, children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).OrderStatus +
.requestID, ' ' +
(projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description),
bold: false, bold: false,
fontSize: 13, fontSize: 12,
), color: Color(0xffcd9e1b),
SizedBox( fontWeight: FontWeight.bold,
height: 4,
),
Texts(
widget.model.pendingOrder.iD
.toString(),
fontSize: 22,
), ),
], ],
), ),
), Row(
Container( mainAxisAlignment: MainAxisAlignment.end,
width: double.infinity,
padding: EdgeInsets.only(
left: 15,
bottom: 15,
top: 15,
right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color:
Theme.of(context).primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
TranslationBase.of(context) DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)),
.OrderStatus, fontSize: 14,
bold: false, )
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
projectViewModel.isArabic
? widget.model.pendingOrder
.descriptionN
: widget.model.pendingOrder
.description,
fontSize: 22,
),
], ],
), ),
), Row(
Container( mainAxisAlignment: MainAxisAlignment.spaceBetween,
width: double.infinity,
padding: EdgeInsets.only( children: [
left: 15, Column(
bottom: 15, crossAxisAlignment: CrossAxisAlignment.start,
top: 15,
right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color:
Theme.of(context).primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).requestID + ' ' + widget.model.pendingOrder.iD.toString(),
.pickupDate,
bold: false, bold: false,
fontSize: 13, fontSize: 18,
),
SizedBox(
height: 4,
), ),
Texts( Texts(
DateUtil TranslationBase.of(context).serviceName,
.getDayMonthYearDateFormatted( fontSize: 12,
DateUtil
.convertStringToDate(
widget
.model
.pendingOrder
.createdOn)),
fontSize: 22,
),
],
),
), ),
...List.generate( ...List.generate(
widget.model.hhcAllOrderDetail.length, widget.model.hhcAllOrderDetail.length,
(index) => Container( (index) => Container(
width: double.infinity, child: Texts(
padding: EdgeInsets.only(
left: 15,
bottom: 15,
top: 15,
right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Theme.of(context)
.primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.serviceName,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
projectViewModel.isArabic projectViewModel.isArabic
? widget ? widget.model.hhcAllOrderDetail[index].descriptionN
.model : widget.model.hhcAllOrderDetail[index].description.capitalize(),
.hhcAllOrderDetail[ fontSize: 14,
index]
.descriptionN
: widget
.model
.hhcAllOrderDetail[
index]
.description,
fontSize: 22,
bold: true,
),
],
), ),
), ),
), ),
SizedBox( ],
height: 12,
), ),
Center( SecondaryButton(
child: Container(
width: MediaQuery.of(context)
.size
.width *
0.85,
child: SecondaryButton(
label: TranslationBase.of(context)
.cancel
.toUpperCase(),
onTap: () { onTap: () {
showConfirmMessage( showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
widget.model,
widget.model
.hhcAllOrderDetail[0]);
}, },
color: Colors.red[800], label: TranslationBase.of(context).cancel,
disabled: false, color: Colors.red[900],
textColor: Theme.of(context) small: true,
.backgroundColor), )
),
),
SizedBox(
height: 12,
),
], ],
// )
// ],
// )
// ],
), ),
), ],
), ))
],
))),
)
],
))
// Row(
// children: [
// Expanded(
// flex: 1,
// child: ClipRRect(
// borderRadius: const BorderRadius.all(Radius.circular(20.0)),
// child: Container(
// padding: EdgeInsets.only(left: 10, right: 10, top: 20, bottom: 20),
// margin: EdgeInsets.only(left: 20, right: 20, top: 7, bottom: 7),
// decoration: BoxDecoration(
// boxShadow: [
// BoxShadow(color: Colors.green, offset: Offset(-5, 0)),
// ],
// )))),
// Expanded(
// flex: 5,
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// width: double.infinity,
// padding: EdgeInsets.all(5),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: Colors.grey,
// width: 1.0,
// ),
// ),
// // borderRadius: BorderRadius.circular(12),
// ),
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase.of(context).OrderStatus,
// bold: false,
// fontSize: 12,
// ),
// SizedBox(
// height: 4,
// ),
// Texts(
// projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description,
// fontSize: 12,
// ),
// ],
// ),
// ),
// Container(
// width: double.infinity,
// padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: Colors.grey,
// width: 1.0,
// ),
// ),
// // borderRadius: BorderRadius.circular(12),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase.of(context).requestID,
// bold: false,
// fontSize: 13,
// ),
// SizedBox(
// height: 4,
// ),
// Texts(
// widget.model.pendingOrder.iD.toString(),
// fontSize: 22,
// ),
// ],
// ),
// ),
// Container(
// width: double.infinity,
// padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: Colors.grey,
// width: 1.0,
// ),
// ),
// // borderRadius: BorderRadius.circular(12),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase.of(context).pickupDate,
// bold: false,
// fontSize: 13,
// ),
// SizedBox(
// height: 4,
// ),
// Texts(
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)),
// fontSize: 22,
// ),
// ],
// ),
// ),
// ...List.generate(
// widget.model.hhcAllOrderDetail.length,
// (index) => Container(
// width: double.infinity,
// padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: Colors.grey,
// width: 1.0,
// ),
// ),
// // borderRadius: BorderRadius.circular(12),
// color: Theme.of(context).primaryColor),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase.of(context).serviceName,
// bold: false,
// fontSize: 13,
// ),
// SizedBox(
// height: 4,
// ),
// Texts(
// projectViewModel.isArabic ? widget.model.hhcAllOrderDetail[index].descriptionN : widget.model.hhcAllOrderDetail[index].description,
// fontSize: 22,
// bold: true,
// ),
// ],
// ),
// ),
// ),
// SizedBox(
// height: 12,
// ),
// Center(
// child: Container(
// width: MediaQuery.of(context).size.width * 0.85,
// child: SecondaryButton(
// label: TranslationBase.of(context).cancel.toUpperCase(),
// onTap: () {
// showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
// },
// color: Colors.red[800],
// disabled: false,
// textColor: Theme.of(context).backgroundColor),
// ),
// ),
// SizedBox(
// height: 12,
// ),
// ],
// ),
// )
// ],
// ),
//),
) )
: NewHomeHealthCareStepOnePage( : NewHomeHealthCareStepOnePage(
changePageViewIndex: _changeCurrentTab, changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
patientERInsertPresOrderRequestModel,
model: widget.model,
),
NewHomeHealthCareStepTowPage(
latitude: _latitude,
longitude: _longitude,
changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel:
patientERInsertPresOrderRequestModel,
model: widget.model, model: widget.model,
), ),
NewHomeHealthCareStepThreePage( // NewHomeHealthCareStepTowPage(
changePageViewIndex: _changeCurrentTab, // latitude: _latitude,
patientERInsertPresOrderRequestModel: // longitude: _longitude,
patientERInsertPresOrderRequestModel, // changePageViewIndex: _changeCurrentTab,
model: widget.model, // patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
) // model: widget.model,
// ),
// NewHomeHealthCareStepThreePage(
// changePageViewIndex: _changeCurrentTab,
// patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
// model: widget.model,
// )
], ],
), ),
), ),

@ -17,8 +17,7 @@ class HomeHealthCarePage extends StatefulWidget {
_HomeHealthCarePageState createState() => _HomeHealthCarePageState(); _HomeHealthCarePageState createState() => _HomeHealthCarePageState();
} }
class _HomeHealthCarePageState extends State<HomeHealthCarePage> class _HomeHealthCarePageState extends State<HomeHealthCarePage> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
@override @override
@ -43,43 +42,16 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage>
isShowAppBar: true, isShowAppBar: true,
description: TranslationBase.of(context).HHCNotAuthMsg, description: TranslationBase.of(context).HHCNotAuthMsg,
appBarTitle: TranslationBase.of(context).homeHealthCare, appBarTitle: TranslationBase.of(context).homeHealthCare,
imagesInfo: [ showNewAppBar: true,
ImagesInfo( showNewAppBarTitle: true,
imageAr: 'https://hmgwebservices.com/Images/MobileApp/HHC/ar/0.png', imagesInfo: [ImagesInfo(imageAr: 'https://hmgwebservices.com/Images/MobileApp/HHC/ar/0.png', imageEn: 'https://hmgwebservices.com/Images/MobileApp/HHC/en/0.png')],
imageEn: 'https://hmgwebservices.com/Images/MobileApp/HHC/en/0.png')
],
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: PreferredSize( appBar: PreferredSize(
preferredSize: Size.fromHeight(65.0), preferredSize: Size.fromHeight(65.0),
child: Stack( child: Stack(
children: <Widget>[ 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( 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: Theme.of(context).primaryColor),
child: Center( child: Center(
child: TabBar( child: TabBar(
isScrollable: true, isScrollable: true,
@ -88,8 +60,7 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage>
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red[800], indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
Container( Container(
@ -114,7 +85,6 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage>
), ),
), ),
), ),
),
], ],
), ),
), ),

@ -931,6 +931,12 @@ String labelFrom({@required String className}) {
return result; return result;
} }
extension StringExtension on String {
String capitalize() {
return this.splitMapJoin(RegExp(r'\w+'), onMatch: (m) => '${m.group(0)}'.substring(0, 1).toUpperCase() + '${m.group(0)}'.substring(1).toLowerCase(), onNonMatch: (n) => ' ');
}
}
/* /*
userBoard.asMap().map((i, element) => MapEntry(i, Stack( userBoard.asMap().map((i, element) => MapEntry(i, Stack(
GestureDetector(onTap: () { GestureDetector(onTap: () {

Loading…
Cancel
Save