hmc services design fixed

merge-update-with-lab-changes
Sultan Khan 4 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,132 +21,115 @@ 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);
return BaseView<HomeHealthCareViewModel>( return BaseView<HomeHealthCareViewModel>(
onModelReady: (model) {}, onModelReady: (model) {},
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
appBarTitle: TranslationBase.of(context).addAddress, appBarTitle: TranslationBase.of(context).addAddress,
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
body: PlacePicker( showNewAppBarTitle: true,
apiKey: GOOGLE_API_KEY, showNewAppBar: true,
enableMyLocationButton: true, body: PlacePicker(
automaticallyImplyAppBarLeading: false, apiKey: GOOGLE_API_KEY,
autocompleteOnTrailingWhitespace: true, enableMyLocationButton: true,
selectInitialPosition: true, automaticallyImplyAppBarLeading: false,
autocompleteLanguage: projectViewModel.currentLanguage, autocompleteOnTrailingWhitespace: true,
enableMapTypeButton: true, selectInitialPosition: true,
searchForInitialValue: false, autocompleteLanguage: projectViewModel.currentLanguage,
onPlacePicked: (PickResult result) { enableMapTypeButton: true,
print(result.adrAddress); searchForInitialValue: false,
onPlacePicked: (PickResult result) {
}, print(result.adrAddress);
selectedPlaceWidgetBuilder: },
(_, selectedPlace, state, isSearchBarFocused) { selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused"); print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused return isSearchBarFocused
? Container() ? Container()
: FloatingCard( : FloatingCard(
bottomPosition: 0.0, bottomPosition: 0.0,
leftPosition: 0.0, leftPosition: 0.0,
rightPosition: 0.0, rightPosition: 0.0,
width: 500, width: 500,
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator()) ? Center(child: CircularProgressIndicator())
: Container( : Container(
margin: EdgeInsets.all(12), margin: EdgeInsets.all(12),
child: Column( child: Column(
children: [ children: [
SecondaryButton( SecondaryButton(
color: Colors.grey[800], color: Colors.grey[800],
textColor: Colors.white, textColor: Colors.white,
onTap: () async { onTap: () async {
AddNewAddressRequestModel AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel(
addNewAddressRequestModel = customer: Customer(addresses: [
new AddNewAddressRequestModel( Addresses(
customer: Customer(addresses: [ address1: selectedPlace.formattedAddress,
Addresses( address2: selectedPlace.formattedAddress,
address1: customerAttributes: "",
selectedPlace.formattedAddress, city: "",
address2: selectedPlace createdOnUtc: "",
.formattedAddress, id: 0,
customerAttributes: "", latLong: "$latitude,$longitude",
city: "", email: "")
createdOnUtc: "", ]),
id: 0, );
latLong: "$latitude,$longitude",
email: "")
]),
);
selectedPlace.addressComponents.forEach((e) {
if (e.types.contains("country")) {
addNewAddressRequestModel.customer
.addresses[0].country = e.longName;
}
if (e.types.contains("postal_code")) {
addNewAddressRequestModel.customer
.addresses[0].zipPostalCode =
e.longName;
}
if (e.types.contains("locality")) {
addNewAddressRequestModel.customer
.addresses[0].city =
e.longName;
}
});
selectedPlace.addressComponents.forEach((e) {
if (e.types.contains("country")) {
addNewAddressRequestModel.customer.addresses[0].country = e.longName;
}
if (e.types.contains("postal_code")) {
addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName;
}
if (e.types.contains("locality")) {
addNewAddressRequestModel.customer.addresses[0].city = e.longName;
}
});
await model.addAddressInfo( await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
addNewAddressRequestModel: addNewAddressRequestModel); if (model.state == ViewState.ErrorLocal) {
if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error);
Utils.showErrorToast(model.error); } else {
} else { AppToast.showSuccessToast(message: "Address Added Successfully");
AppToast.showSuccessToast( }
message: "Address Added Successfully"); Navigator.of(context).pop(addNewAddressRequestModel);
} },
Navigator.of(context).pop(addNewAddressRequestModel); label: TranslationBase.of(context).addNewAddress,
}, ),
label: TranslationBase.of(context).addNewAddress, ],
), ),
], ),
), );
), },
); initialPosition: LatLng(latitude, longitude),
}, useCurrentLocation: showCurrentLocation,
initialPosition: LatLng(latitude, longitude), ),
useCurrentLocation: showCurrentLocation, ));
),
));
} }
} }

@ -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 serviceID: service.serviceID,
.patientERHHCInsertServicesList serviceName: service.description));
.add(PatientERHHCInsertServicesList(
recordID: widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.length,
serviceID: service.serviceID,
serviceName:
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( onTap: () async {
width: MediaQuery.of(context).size.width * 0.9, await widget.model.getCustomerInfo();
child: SecondaryButton( if (widget.model.state == ViewState.ErrorLocal) {
label: TranslationBase.of(context).next, Utils.showErrorToast();
disabled: this } else {
.widget Navigator.push(
.patientERInsertPresOrderRequestModel context,
.patientERHHCInsertServicesList FadePage(
.length == page: NewHomeHealthCareStepTowPage(
0 || patientERInsertPresOrderRequestModel: widget.patientERInsertPresOrderRequestModel,
widget.model.state == ViewState.BusyLocal, model: widget.model,
color: Colors.grey[800], ),
loading: widget.model.state == ViewState.BusyLocal, ),
onTap: () async { );
await widget.model.getCustomerInfo();
if (widget.model.state == ViewState.ErrorLocal) { // widget.changePageViewIndex(1);
Utils.showErrorToast(); }
} else { },
widget.changePageViewIndex(1); label: TranslationBase.of(context).next,
} backgroundColor: Colors.red[900],
}, disabled: this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal,
textColor: Theme.of(context).backgroundColor), 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,29 +106,32 @@ 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,
), ),
Texts( Row(
widget children: [
.patientERInsertPresOrderRequestModel Texts(
.patientERHHCInsertServicesList[index] (index + 1).toString() + '. ',
.serviceName, fontSize: 15,
fontSize: 15, ),
bold: true, Texts(
), widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList[index].serviceName,
fontSize: 15,
),
],
)
], ],
), ),
), ),
@ -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, },
)
// PlacePicker(
// apiKey: GOOGLE_API_KEY,
// enableMyLocationButton: true,
// automaticallyImplyAppBarLeading: false,
// autocompleteOnTrailingWhitespace: false,
// selectInitialPosition: true,
// autocompleteLanguage: projectViewModel.currentLanguage,
// enableMapTypeButton: false,
// searchForInitialValue: true,
// // onPlacePicked: (PickResult result) {
// // print(result.adrAddress);
// // widget.changePageViewIndex(3);
// // },
// 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,
// )
onPlacePicked: (PickResult result) { ),
print(result.adrAddress); if (widget.model.addressesList.isNotEmpty)
widget.changePageViewIndex(3); Row(mainAxisAlignment: MainAxisAlignment.center, children: [
}, Container(
selectedPlaceWidgetBuilder: height: 60,
(_, selectedPlace, state, isSearchBarFocused) { width: MediaQuery.of(context).size.width * .9,
print("state: $state, isSearchBarFocused: $isSearchBarFocused"); margin: EdgeInsets.only(top: 10),
return isSearchBarFocused decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white),
? Container() child: DropdownButtonHideUnderline(
: FloatingCard( child: ButtonTheme(
bottomPosition: 0.0, alignedDropdown: true,
leftPosition: 0.0, child: DropdownButton<AddressInfo>(
rightPosition: 0.0, hint: Text(
width: 500, widget.model.addressesList[0].address1,
borderRadius: BorderRadius.circular(12.0), style: TextStyle(color: CustomColors.black, fontSize: 14),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: 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,), iconEnabledColor: CustomColors.grey2,
SecondaryButton( style: TextStyle(color: CustomColors.black, fontSize: 14),
color: Colors.red[800], dropdownColor: CustomColors.white,
textColor: Colors.white, value: _selectedAddress,
onTap: () { items: widget.model.addressesList.map((AddressInfo value) {
setState(() { return DropdownMenuItem<AddressInfo>(
widget.patientERInsertPresOrderRequestModel value: value,
.latitude = child: new AutoSizeText(
selectedPlace.geometry.location.lat; value.address1,
widget.patientERInsertPresOrderRequestModel ),
.longitude = );
selectedPlace.geometry.location.lng; }).toList(),
}); onChanged: (r) {},
widget.changePageViewIndex(3); underline: Container(
}, height: 0,
label: TranslationBase.of(context).confirm,
), ),
], ),
), ),
), ),
); )
}, ]),
initialPosition: LatLng(latitude, longitude), Positioned(
useCurrentLocation: showCurrentLocation, top: 80,
), left: 20,
if(widget.model.addressesList.isNotEmpty) child: Row(
Container( children: [
child: InkWell( Icon(
onTap: () => Icons.add_circle_rounded,
confirmSelectLocationDialog(widget.model.addressesList), ),
child: Container( InkWell(
padding: EdgeInsets.all(10), child: Texts(
width: double.infinity, TranslationBase.of(context).addNewAddress,
// height: 65, fontWeight: FontWeight.bold,
decoration: BoxDecoration( ),
borderRadius: BorderRadius.circular(10), onTap: () {
color: Colors.white), Navigator.push(
child: Row( context,
mainAxisAlignment: FadePage(
MainAxisAlignment.spaceBetween, page: LocationPage(
children: [ latitude: latitude,
Expanded(child: Texts(getAddressName(), fontSize: 14,),), longitude: longitude,
Icon(Icons.arrow_drop_down) ),
], ),
);
},
),
],
))
// 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,
), ),
), ),
), );
height: 56, width: double.infinity, color: Theme },
.of(context) label: TranslationBase.of(context).continues,
.scaffoldBackgroundColor, backgroundColor: Colors.red[900],
),
)
],
), ),
); );
} }
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: Container( child: Row(
width: double.infinity, children: [
margin: EdgeInsets.only(top: 15), Expanded(
decoration: BoxDecoration( flex: 3,
border: Border.all( child: ClipRRect(
color: Colors.grey, width: 1), borderRadius: const BorderRadius.all(Radius.circular(20.0)),
borderRadius: BorderRadius.circular(12),
color: Theme.of(context).primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(
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(
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),
color:
Theme.of(context).primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.OrderStatus,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
projectViewModel.isArabic
? widget.model.pendingOrder
.descriptionN
: widget.model.pendingOrder
.description,
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),
color:
Theme.of(context).primaryColor),
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( child: Container(
width: MediaQuery.of(context) padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
.size margin: EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 7),
.width * decoration: BoxDecoration(boxShadow: [
0.85, BoxShadow(color: Color(0xffcd9e1b), offset: Offset(-10, 0)),
child: SecondaryButton( ], borderRadius: const BorderRadius.all(Radius.circular(10.0)), color: Colors.white),
label: TranslationBase.of(context) child: Row(
.cancel children: [
.toUpperCase(), Expanded(
onTap: () { child: Column(
showConfirmMessage( mainAxisAlignment: MainAxisAlignment.start,
widget.model, children: [
widget.model Row(
.hhcAllOrderDetail[0]); crossAxisAlignment: CrossAxisAlignment.start,
}, children: [
color: Colors.red[800], Texts(
disabled: false, TranslationBase.of(context).OrderStatus +
textColor: Theme.of(context) ' ' +
.backgroundColor), (projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description),
), bold: false,
), fontSize: 12,
SizedBox( color: Color(0xffcd9e1b),
height: 12, fontWeight: FontWeight.bold,
), ),
], ],
), ),
), Row(
), mainAxisAlignment: MainAxisAlignment.end,
) children: [
Texts(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)),
fontSize: 14,
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).requestID + ' ' + widget.model.pendingOrder.iD.toString(),
bold: false,
fontSize: 18,
),
Texts(
TranslationBase.of(context).serviceName,
fontSize: 12,
),
...List.generate(
widget.model.hhcAllOrderDetail.length,
(index) => Container(
child: Texts(
projectViewModel.isArabic
? widget.model.hhcAllOrderDetail[index].descriptionN
: widget.model.hhcAllOrderDetail[index].description.capitalize(),
fontSize: 14,
),
),
),
],
),
SecondaryButton(
onTap: () {
showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
},
label: TranslationBase.of(context).cancel,
color: Colors.red[900],
small: true,
)
],
// )
// ],
// )
// ],
),
],
))
],
))),
)
],
))
// 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, model: widget.model,
), ),
NewHomeHealthCareStepTowPage( // NewHomeHealthCareStepTowPage(
latitude: _latitude, // latitude: _latitude,
longitude: _longitude, // longitude: _longitude,
changePageViewIndex: _changeCurrentTab, // changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel: // patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
patientERInsertPresOrderRequestModel, // model: widget.model,
model: widget.model, // ),
), // NewHomeHealthCareStepThreePage(
NewHomeHealthCareStepThreePage( // changePageViewIndex: _changeCurrentTab,
changePageViewIndex: _changeCurrentTab, // patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
patientERInsertPresOrderRequestModel: // model: widget.model,
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,75 +42,46 @@ 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( child: Center(
height: 60.0, child: TabBar(
margin: EdgeInsets.only(top: 10.0), isScrollable: true,
width: MediaQuery.of(context).size.width * 0.9, controller: _tabController,
decoration: BoxDecoration( indicatorWeight: 5.0,
border: Border( indicatorSize: TabBarIndicatorSize.tab,
bottom: BorderSide( indicatorColor: Colors.red[800],
color: Theme.of(context).dividerColor, labelColor: Theme.of(context).primaryColor,
width: 0.7), labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
), unselectedLabelColor: Colors.grey[800],
color: Theme.of(context).primaryColor), tabs: [
child: Center( Container(
child: TabBar( width: MediaQuery.of(context).size.width * 0.37,
isScrollable: true, child: Center(
controller: _tabController, child: Texts(
indicatorWeight: 5.0, TranslationBase.of(context).homeHealthCare,
indicatorSize: TabBarIndicatorSize.tab, color: Colors.black,
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.37,
child: Center(
child: Texts(
TranslationBase.of(context).homeHealthCare,
color: Colors.black,
),
), ),
), ),
Container( ),
width: MediaQuery.of(context).size.width * 0.37, Container(
child: Center( width: MediaQuery.of(context).size.width * 0.37,
child: Texts( child: Center(
TranslationBase.of(context).orderLog, child: Texts(
color: Colors.black, TranslationBase.of(context).orderLog,
), color: Colors.black,
), ),
), ),
], ),
), ],
), ),
), ),
), ),

@ -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