home health care

merge-update-with-lab-changes
Sultan Khan 5 years ago
parent 4d00664045
commit c6fd52aad2

@ -120,6 +120,7 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0), margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button( child: Button(
onTap: () async { onTap: () async {
widget.model.setState(ViewState.Busy);
await widget.model.getCustomerInfo(); await widget.model.getCustomerInfo();
if (widget.model.state == ViewState.ErrorLocal) { if (widget.model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(); Utils.showErrorToast();

@ -93,16 +93,29 @@ class _NewHomeHealthCareStepThreePageState extends State<NewHomeHealthCareStepTh
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
height: 200, height: 200,
child: GoogleMap( // child: GoogleMap(
mapType: MapType.normal, // mapType: MapType.normal,
markers: markers, // markers: markers,
initialCameraPosition: _kGooglePlex, // initialCameraPosition: _kGooglePlex,
onMapCreated: (GoogleMapController controller) { // onMapCreated: (GoogleMapController controller) {
_controller.complete(controller); // _controller.complete(controller);
}, // },
), // ),
), child: Image.network(
"https://maps.googleapis.com/maps/api/staticmap?center=" +
widget.patientERInsertPresOrderRequestModel.latitude.toString() +
"," +
widget.patientERInsertPresOrderRequestModel.longitude.toString() +
"&zoom=16&size=600x300&maptype=roadmap&markers=color:red%7C" +
widget.patientERInsertPresOrderRequestModel.latitude.toString() +
"," +
widget.patientERInsertPresOrderRequestModel.longitude.toString() +
"&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8",
width: double.infinity,
height: double.infinity,
fit: BoxFit.cover,
)),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
@ -159,8 +172,9 @@ class _NewHomeHealthCareStepThreePageState extends State<NewHomeHealthCareStepTh
disabled: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0, disabled: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0,
color: Colors.grey[800], color: Colors.grey[800],
onTap: () async { onTap: () async {
widget.model.setState(ViewState.Busy);
widget.model.insertPresPresOrder(order: widget.patientERInsertPresOrderRequestModel).then((value) => { widget.model.insertPresPresOrder(order: widget.patientERInsertPresOrderRequestModel).then((value) => {
print(widget.model.hhcResponse), widget.model.setState(ViewState.Idle),
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(

@ -42,12 +42,12 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
AddressInfo _selectedAddress; AddressInfo _selectedAddress;
bool showCurrentLocation = false; bool showCurrentLocation = false;
Completer<GoogleMapController> _controller = Completer(); Completer<GoogleMapController> _controller = Completer();
GoogleMapController googleMapController;
final Set<Marker> markers = new Set();
static CameraPosition _kGooglePlex = CameraPosition( static CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962), target: LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746, 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) {
@ -56,6 +56,7 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
latitude = widget.patientERInsertPresOrderRequestModel.latitude; latitude = widget.patientERInsertPresOrderRequestModel.latitude;
longitude = widget.patientERInsertPresOrderRequestModel.longitude; longitude = widget.patientERInsertPresOrderRequestModel.longitude;
} }
markers.clear(); markers.clear();
markers.add( markers.add(
Marker( Marker(
@ -64,6 +65,7 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
), ),
position: LatLng(latitude, longitude)), position: LatLng(latitude, longitude)),
); );
_kGooglePlex = CameraPosition( _kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude), target: LatLng(latitude, longitude),
zoom: 14.4746, zoom: 14.4746,
@ -98,202 +100,132 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
appBarTitle: TranslationBase.of(context).homeHealthCare, appBarTitle: TranslationBase.of(context).homeHealthCare,
body: Stack( body: Column(
children: [ children: [
Container(
margin: EdgeInsets.only(top: 120),
child: GoogleMap(
mapType: MapType.normal,
markers: markers,
initialCameraPosition: _kGooglePlex,
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
)
// 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,
// )
),
if (widget.model.addressesList.isNotEmpty) if (widget.model.addressesList.isNotEmpty)
Row(mainAxisAlignment: MainAxisAlignment.center, children: [ Card(
Container( margin: EdgeInsets.only(left: 12, right: 12, bottom: 12, top: 12),
height: 60, shape: cardRadius(12),
width: MediaQuery.of(context).size.width * .9, elevation: 3,
margin: EdgeInsets.only(top: 10), child: Container(
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white), child: InkWell(
child: DropdownButtonHideUnderline( onTap: () => confirmSelectLocationDialog(widget.model.addressesList),
child: ButtonTheme( child: Container(
alignedDropdown: true, padding: EdgeInsets.all(8),
child: DropdownButton<AddressInfo>( width: double.infinity,
hint: Text( // height: 65,
widget.model.addressesList[0].address1, decoration: BoxDecoration(
style: TextStyle(color: CustomColors.black, fontSize: 14), borderRadius: BorderRadius.circular(10),
), color: Colors.white,
iconEnabledColor: CustomColors.grey2, ),
style: TextStyle(color: CustomColors.black, fontSize: 14), child: Row(
dropdownColor: CustomColors.white, mainAxisAlignment: MainAxisAlignment.spaceBetween,
value: _selectedAddress, children: [
items: widget.model.addressesList.map((AddressInfo value) { Expanded(
return DropdownMenuItem<AddressInfo>( child: Text(
value: value, getAddressName(),
child: new AutoSizeText( style: TextStyle(
value.address1, fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.45,
),
), ),
); ),
}).toList(), Icon(Icons.arrow_drop_down)
onChanged: (r) {}, ],
underline: Container(
height: 0,
),
), ),
), ),
), ),
) height: 50,
]), width: double.infinity,
Positioned( ),
top: 80, ),
left: 20, InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: LocationPage(
latitude: latitude,
longitude: longitude,
),
),
);
},
child: Padding(
padding: EdgeInsets.only(left: 12, right: 12, bottom: 16, top: 8),
child: Row( child: Row(
children: [ children: [
Icon( Icon(Icons.add_circle_outline_sharp),
Icons.add_circle_rounded, mWidth(12),
), Text(
InkWell( TranslationBase.of(context).addNewAddress,
child: Texts( style: TextStyle(
TranslationBase.of(context).addNewAddress, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.w600,
letterSpacing: -0.46,
), ),
onTap: () {
Navigator.push(
context,
FadePage(
page: LocationPage(
latitude: latitude,
longitude: longitude,
),
),
);
},
), ),
], ],
))
// 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,
),
), ),
); ),
}, ),
label: TranslationBase.of(context).continues, Expanded(
backgroundColor: Colors.red[900], child: Stack(
), alignment: Alignment.center,
children: [
GoogleMap(
mapType: MapType.normal,
zoomControlsEnabled: false,
myLocationButtonEnabled: true,
myLocationEnabled: true,
initialCameraPosition: _kGooglePlex,
onCameraMove: ((_position) => _updatePosition(_position)),
onMapCreated: (GoogleMapController controller) {
googleMapController = controller;
_controller.complete(controller);
},
),
Icon(
Icons.place,
color: CustomColors.accentColor,
size: 50,
),
],
),
),
Padding(
padding: const EdgeInsets.only(left: 20, right: 20, top: 14, bottom: 14),
child: SecondaryButton(
color: Colors.red[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientERInsertPresOrderRequestModel.latitude = latitude;
widget.patientERInsertPresOrderRequestModel.longitude = longitude;
});
navigateTo(
context,
NewHomeHealthCareStepThreePage(
patientERInsertPresOrderRequestModel: widget.patientERInsertPresOrderRequestModel,
model: widget.model,
),
);
},
label: TranslationBase.of(context).continues,
),
),
],
), ),
); );
} }
void _updatePosition(CameraPosition _position) {
latitude = _position.target.latitude;
longitude = _position.target.longitude;
}
void confirmSelectLocationDialog(List<AddressInfo> addresses) { void confirmSelectLocationDialog(List<AddressInfo> addresses) {
showDialog( showDialog(
context: context, context: context,

@ -18,6 +18,7 @@ import 'package:geolocator/geolocator.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import '../StepsWidget.dart'; import '../StepsWidget.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'new_Home_health_care_step_one_page.dart'; import 'new_Home_health_care_step_one_page.dart';
class NewHomeHealthCarePage extends StatefulWidget { class NewHomeHealthCarePage extends StatefulWidget {
@ -120,287 +121,103 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
widthFactor: 0.9, widthFactor: 0.9,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.all(10), // margin: EdgeInsets.all(10),
child: Row( child: Container(
children: [ width: double.infinity,
Expanded( padding: EdgeInsets.only(left: 12, right: 12, top: 12),
flex: 3, child: Card(
child: ClipRRect( shape: cardRadius(12),
borderRadius: const BorderRadius.all(Radius.circular(20.0)), elevation: 2,
child: Container( margin: EdgeInsets.zero,
padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10), color: Color(0xffcd9e1b),
margin: EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 7), clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(boxShadow: [ child: Container(
BoxShadow(color: Color(0xffcd9e1b), offset: Offset(-10, 0)), // decoration: containerColorRadiusLeft(Colors.white, 12),
], borderRadius: const BorderRadius.all(Radius.circular(10.0)), color: Colors.white), margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0),
child: Row( padding: EdgeInsets.all(12),
children: [ // color: Colors.white,
Expanded( decoration: BoxDecoration(
child: Column( shape: BoxShape.rectangle,
mainAxisAlignment: MainAxisAlignment.start, color: Colors.white,
children: [ borderRadius: BorderRadius.only(
Row( topLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0),
crossAxisAlignment: CrossAxisAlignment.start, topRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero,
children: [ bottomLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0),
Texts( bottomRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero,
TranslationBase.of(context).OrderStatus + ),
' ' + ),
(projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description), // clipBehavior: Clip.antiAlias,
bold: false, child: Row(
fontSize: 12, children: [
color: Color(0xffcd9e1b), Expanded(
fontWeight: FontWeight.bold, child: Column(
), mainAxisAlignment: MainAxisAlignment.start,
], crossAxisAlignment: CrossAxisAlignment.start,
), children: [
Row( Texts(
mainAxisAlignment: MainAxisAlignment.end, TranslationBase.of(context).OrderStatus +
children: [ ' ' +
Texts( (projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description),
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)), bold: false,
fontSize: 14, fontSize: 12,
) color: Color(0xffcd9e1b),
], fontWeight: FontWeight.bold,
), ),
Row( Texts(
mainAxisAlignment: MainAxisAlignment.spaceBetween, TranslationBase.of(context).requestID + ' ' + widget.model.pendingOrder.iD.toString(),
fontWeight: FontWeight.w600,
children: [ fontSize: 18,
Column( ),
crossAxisAlignment: CrossAxisAlignment.start, Texts(
children: [ TranslationBase.of(context).serviceName,
Texts( fontSize: 12,
TranslationBase.of(context).requestID + ' ' + widget.model.pendingOrder.iD.toString(), fontWeight: FontWeight.w600,
fontWeight: FontWeight.w600, ),
fontSize: 18, ...List.generate(
), widget.model.hhcAllOrderDetail.length,
Texts( (index) => Container(
TranslationBase.of(context).serviceName, child: Texts(
fontSize: 12, projectViewModel.isArabic ? widget.model.hhcAllOrderDetail[index].descriptionN : widget.model.hhcAllOrderDetail[index].description.capitalize(),
fontWeight: FontWeight.w600, fontSize: 13,
), bold: false,
...List.generate( ),
widget.model.hhcAllOrderDetail.length, ),
(index) => Container( ),
child: Texts( ],
projectViewModel.isArabic )),
? widget.model.hhcAllOrderDetail[index].descriptionN Column(
: widget.model.hhcAllOrderDetail[index].description.capitalize(), children: [
fontSize: 13, Texts(
bold: false, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)),
), fontSize: 14,
), ),
), mHeight(8),
], SecondaryButton(
), onTap: () {
SecondaryButton( showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
onTap: () { },
showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]); label: TranslationBase.of(context).cancel,
}, color: Colors.red[900],
label: TranslationBase.of(context).cancel, small: true,
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(
// latitude: _latitude,
// longitude: _longitude,
// changePageViewIndex: _changeCurrentTab,
// patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
// model: widget.model,
// ),
// NewHomeHealthCareStepThreePage(
// changePageViewIndex: _changeCurrentTab,
// patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
// model: widget.model,
// )
], ],
), ),
), ),

@ -14,6 +14,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'Dialog/confirm_cancel_order_dialog.dart'; import 'Dialog/confirm_cancel_order_dialog.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
class OrdersLogDetailsPage extends StatelessWidget { class OrdersLogDetailsPage extends StatelessWidget {
final HomeHealthCareViewModel model; final HomeHealthCareViewModel model;
@ -59,295 +60,101 @@ class OrdersLogDetailsPage extends StatelessWidget {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: model.hhcAllPresOrders.map((order) { children: model.hhcAllPresOrders.map((order) {
return Row( return Container(
children: [ // margin: EdgeInsets.all(10),
Expanded( child: Container(
flex: 3, width: double.infinity,
child: ClipRRect( padding: EdgeInsets.only(left: 12, right: 12, top: 12),
borderRadius: const BorderRadius.all(Radius.circular(20.0)), child: Card(
child: Container( shape: cardRadius(12),
padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10), elevation: 2,
margin: EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 7), margin: EdgeInsets.zero,
decoration: BoxDecoration(boxShadow: [ color: order.status == 4
BoxShadow( ? Colors.red[900]
: order.status == 3
? Colors.green[400]
: Color(0xffcd9e1b),
clipBehavior: Clip.antiAlias,
child: Container(
// decoration: containerColorRadiusLeft(Colors.white, 12),
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0),
padding: EdgeInsets.all(12),
// color: Colors.white,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0),
topRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero,
bottomLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0),
bottomRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero,
),
),
// clipBehavior: Clip.antiAlias,
child: Row(
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).OrderStatus + ' ' + (projectViewModel.isArabic ? order.descriptionN : order.description),
bold: false,
fontSize: 12,
color: order.status == 4 color: order.status == 4
? Colors.red[900] ? Colors.red[900]
: order.status == 3 : order.status == 3
? Colors.green[400] ? Colors.green[400]
: Color(0xffcd9e1b), : Color(0xffcd9e1b),
offset: Offset(-10, 0)), fontWeight: FontWeight.bold,
], borderRadius: const BorderRadius.all(Radius.circular(10.0)), color: Colors.white), ),
child: Row( Texts(
children: [ TranslationBase.of(context).requestID + ' ' + order.iD.toString(),
Expanded( fontWeight: FontWeight.w600,
child: Column( fontSize: 18,
mainAxisAlignment: MainAxisAlignment.start, ),
Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Texts(
crossAxisAlignment: CrossAxisAlignment.start, TranslationBase.of(context).orderLocation,
children: [ bold: false,
Texts( fontSize: 13,
TranslationBase.of(context).OrderStatus + ' ' + (projectViewModel.isArabic ? order.descriptionN : order.description),
bold: false,
fontSize: 12,
color: order.status == 4
? Colors.red[900]
: order.status == 3
? Colors.green[400]
: Color(0xffcd9e1b),
fontWeight: FontWeight.bold,
),
],
), ),
Row( SizedBox(
mainAxisAlignment: MainAxisAlignment.end, height: 4,
children: [
Texts(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)),
fontSize: 14,
)
],
), ),
Row( Texts(
mainAxisAlignment: MainAxisAlignment.spaceBetween, !projectViewModel.isArabic ? order.nearestProjectDescription.toString() : order.nearestProjectDescriptionN.toString(),
fontSize: 13,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).requestID + ' ' + order.iD.toString(),
bold: false,
fontSize: 18,
),
],
),
(order.status == 1 || order.status == 2)
? SecondaryButton(
onTap: () {
showConfirmMessage(model, order);
},
label: TranslationBase.of(context).cancel,
color: Colors.red[900],
small: true,
)
: SizedBox()
],
// )
// ],
// )
// ],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).orderLocation,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
!projectViewModel.isArabic ? order.nearestProjectDescription.toString() : order.nearestProjectDescriptionN.toString(),
fontSize: 13,
),
],
), ),
], ],
)) )
], ],
))), )),
) Column(
], children: [
); Texts(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)),
// return Container( fontSize: 14,
// width: double.infinity, ),
// margin: EdgeInsets.only(top: 15), SizedBox(height: 8),
// decoration: BoxDecoration( (order.status == 1 || order.status == 2)
// border: ? SecondaryButton(
// Border.all(color: Colors.grey, width: 1), onTap: () {
// borderRadius: BorderRadius.circular(12), showConfirmMessage(model, order);
// color: Colors.white), },
// child: Column( label: TranslationBase.of(context).cancel,
// crossAxisAlignment: CrossAxisAlignment.start, color: Colors.red[900],
// children: [ small: true,
// SizedBox( )
// height: 12, : SizedBox()
// ), ],
// 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: Colors.white),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase
// .of(context)
// .requestID,
// bold: false,
// fontSize: 13,
// ),
// SizedBox(
// height: 4,
// ),
// Texts(
// order.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: Colors.white),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase
// .of(context)
// .OrderStatus,
// bold: false,
// fontSize: 13,
// ),
// SizedBox(
// height: 4,
// ),
// Texts(
// projectViewModel.isArabic ? order.descriptionN : order.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: Colors.white),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase
// .of(context)
// .pickupDate,
// bold: false,
// fontSize: 13,
// ),
// SizedBox(
// height: 4,
// ),
// Texts(
// DateUtil.getDayMonthYearDateFormatted(
// DateUtil.convertStringToDate(order.createdOn)),
// fontSize: 22,
// ),
// ],
// ),
// ),
// 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: Colors.white),
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase.of(context).orderLocation,
// bold: false,
// fontSize: 13,
// ),
// SizedBox(
// height: 4,
// ),
// Texts(
// !projectViewModel.isArabic ?order.nearestProjectDescription
// .toString() :
// order.nearestProjectDescriptionN
// .toString(),
// fontSize: 22,
// ),
// ],
// ),
// ),
// SizedBox(
// height: 12,
// ),
// if (order.status == 1 ||order.status == 2 )
// Center(
// child: Container(
// width: MediaQuery
// .of(context)
// .size
// .width *
// 0.85,
// child: SecondaryButton(
// label: "Cancel".toUpperCase(),
// onTap: () {
// showConfirmMessage(model, order);
// }
// ,
// color: Colors.red[800],
// disabled: false,
// textColor: Theme
// .of(context)
// .backgroundColor),
// ),
// ),
// SizedBox(
// height: 12,
// ),
// ],
// ),
// );
}).toList()) }).toList())
], ],
), ),

Loading…
Cancel
Save