Merge branch 'sultan_new_design' into 'development_new_design_2.0'

Sultan new design

See merge request Cloud_Solution/diplomatic-quarter!404
merge-requests/405/merge
haroon amjad 3 years ago
commit 13debe83f0

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

@ -66,7 +66,9 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
setState(() {
if (!isServiceSelected(service.serviceID))
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.add(PatientERHHCInsertServicesList(
recordID: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length, serviceID: service.serviceID, serviceName: service.description));
recordID: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length,
serviceID: service.serviceID,
serviceName: projectViewModel.isArabic ? service.descriptionN : service.description));
else
removeSelected(service.serviceID);
// widget.patientERInsertPresOrderRequestModel

@ -17,8 +17,9 @@ import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/widgets/app_map/google_huawei_map.dart';
import 'location_page.dart';
import 'package:geolocator/geolocator.dart';
class NewHomeHealthCareStepTowPage extends StatefulWidget {
final Function(PickResult) onPick;
@ -39,35 +40,47 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
double longitude = 0;
AddressInfo _selectedAddress;
bool showCurrentLocation = false;
Completer<GoogleMapController> _controller = Completer();
GoogleMapController googleMapController;
final Set<Marker> markers = new Set();
AppMap appMap;
static CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746,
);
LatLng currentPostion;
Completer<GoogleMapController> mapController = Completer();
@override
void initState() {
if (widget.patientERInsertPresOrderRequestModel.latitude == null) {
setLatitudeAndLongitude();
} else {
latitude = widget.patientERInsertPresOrderRequestModel.latitude;
longitude = widget.patientERInsertPresOrderRequestModel.longitude;
}
markers.clear();
markers.add(
Marker(
markerId: MarkerId(
latitude.hashCode.toString(),
),
position: LatLng(latitude, longitude)),
appMap = AppMap(
_kGooglePlex.toMap(),
onCameraMove: (camera) {
_updatePosition(camera);
},
onMapCreated: () {
goToCurrentLocation();
setState(() {});
},
);
// if (widget.patientERInsertPresOrderRequestModel.latitude == null) {
// setLatitudeAndLongitude();
// } else {
// latitude = widget.patientERInsertPresOrderRequestModel.latitude;
// 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,
// );
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
super.initState();
}
@ -87,9 +100,21 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
currentPostion = LatLng(latitude, longitude);
setMap();
}
}
setMap() {
setState(() {
_kGooglePlex = CameraPosition(
target: currentPostion,
zoom: 14.4746,
);
appMap.moveTo(cameraPostion: _kGooglePlex);
});
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
@ -168,22 +193,35 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
),
),
),
// Expanded(
// 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,
// ),
// ],
// ),
// ),
Expanded(
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);
},
),
if (appMap != null) appMap,
Icon(
Icons.place,
color: CustomColors.accentColor,
@ -246,4 +284,27 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
else
return TranslationBase.of(context).selectAddress;
}
goToCurrentLocation() {
Geolocator.getCurrentPosition().then((value) {
_selectedAddress = AddressInfo(latLong: '${value.latitude},${value.longitude}');
moveToLocation(LatLng(value.latitude, value.longitude));
});
}
moveToLocation(LatLng location, {bool animate = true}) async {
await Future.delayed(Duration(milliseconds: 200));
_kGooglePlex = CameraPosition(
target: location,
zoom: 16.4746,
);
if (animate)
(await mapController.future).animateCamera(
CameraUpdate.newCameraPosition(_kGooglePlex),
);
else
(await mapController.future).moveCamera(
CameraUpdate.newCameraPosition(_kGooglePlex),
);
}
}

@ -6,47 +6,40 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class RRTLogPage extends StatefulWidget{
final List<PrescriptionsOrder> orders;
class RRTLogPage extends StatefulWidget {
final List<PrescriptionsOrder> orders;
const RRTLogPage({this.orders});
@override
State<StatefulWidget> createState() => RRTLogPageState();
@override
State<StatefulWidget> createState() => RRTLogPageState();
}
class RRTLogPageState extends State<RRTLogPage>{
class RRTLogPageState extends State<RRTLogPage> {
RRTViewModel viewModel;
@override
Widget build(BuildContext context) {
return BaseView<RRTViewModel>(
onModelReady: (vm) => viewModel = vm,
builder: (ctx, vm, widgetState){
return ListView.builder(
itemCount: widget.orders.length,
itemBuilder: (ctx, idx) {
var order = widget.orders[idx];
return RRTLogListItem(order, onCancel: deleteOrder);
}
);
}
);
onModelReady: (vm) => viewModel = vm,
builder: (ctx, vm, widgetState) {
return ListView.builder(
itemCount: widget.orders.length,
padding: EdgeInsets.all(21),
itemBuilder: (ctx, idx) {
var order = widget.orders[idx];
return RRTLogListItem(order, onCancel: deleteOrder);
});
});
}
deleteOrder(PrescriptionsOrder order) async {
GifLoaderDialogUtils.showMyDialog(context);
var success = await viewModel.cancelOrder(order);
GifLoaderDialogUtils.hideDialog(context);
if(success)
if (success)
setState(() {
widget.orders.remove(order);
});
}
}

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
final _item_content_seperator = Container(height: 0.25, padding: EdgeInsets.all(10), color: Colors.grey.withOpacity(0.5));
@ -22,59 +23,188 @@ class RRTLogListItem extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context);
_context = context;
localize = TranslationBase.of(context);
int status = order.status;
String _statusDisp = projectViewModel.isArabic ? order.descriptionN : order.description;
Color _color;
if (status == 1) {
//pending
_color = Color(0xffCC9B14);
} else if (status == 2) {
//processing
_color = Color(0xff2E303A);
} else if (status == 3) {
//completed
_color = Color(0xff359846);
} else if (status == 4) {
//cancel // Rejected
_color = Color(0xffD02127);
}
return Container(
padding: EdgeInsets.all(15),
margin: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(15), boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.25), spreadRadius: 1, blurRadius: 3)]),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
_contentItem(label: localize.reqId, value: order.iD.toString()),
_item_content_seperator,
_contentItem(label: localize.status, value: projectViewModel.isArabic ? order.descriptionN.toString() : order.description.toString()), //order.getStatusName(localize)),
_item_content_seperator,
_contentItem(label: localize.pickupDate, value: order.getFormattedDateTime()),
_item_content_seperator,
_contentItem(label: localize.location, value: order.getNearestProjectDescription()),
_item_content_seperator,
SizedBox(height: 10),
if (onCancel != null && order.status == 1 && order.status == 2) FractionallySizedBox(child: cancelButton())
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
color: _color,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
),
);
}
Widget _contentItem({@required String label, String value}) {
return Container(
padding: EdgeInsets.symmetric(vertical: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
label,
style: TextStyle(color: Theme.of(_context).appBarTheme.color, fontSize: 9, letterSpacing: 1),
),
SizedBox(
height: 5,
child: Container(
// decoration: containerColorRadiusLeft(Colors.white, 12),
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.only(
bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
),
Text(
value,
style: TextStyle(color: Theme.of(_context).appBarTheme.color, fontWeight: FontWeight.bold, fontSize: 14),
),
],
),
// clipBehavior: Clip.antiAlias,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_statusDisp,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 6),
Text(
'${TranslationBase.of(context).requestID}: ${order.iD}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).location + ": ",
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Expanded(
child: Text(
!projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
localize.pickupDate + ": ",
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Expanded(
child: Text(
order.getFormattedDateTime(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
),
),
],
),
],
),
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
DateUtil.formatDateToDate(order.createdOn, projectViewModel.isArabic),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 12),
if (order.status == 1 || order.status == 2)
InkWell(
onTap: () {
onCancel(order);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: Color(0xffD02127),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(10),
),
child: Text(
TranslationBase.of(context).cancel_nocaps,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
),
),
],
),
],
),
),
);
// return Container(
// padding: EdgeInsets.all(15),
// margin: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
// decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(15), boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.25), spreadRadius: 1, blurRadius: 3)]),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.stretch,
// children: [
// _contentItem(label: localize.reqId, value: order.iD.toString()),
// _item_content_seperator,
// _contentItem(label: localize.status, value: projectViewModel.isArabic ? order.descriptionN.toString() : order.description.toString()), //order.getStatusName(localize)),
// _item_content_seperator,
// _contentItem(label: localize.pickupDate, value: order.getFormattedDateTime()),
// _item_content_seperator,
// _contentItem(label: localize.location, value: order.getNearestProjectDescription()),
// _item_content_seperator,
// SizedBox(height: 10),
// if (order.status == 1 || order.status == 2) Container(child: cancelButton())
// ],
// ),
// );
}
Widget cancelButton() => MaterialButton(
height: 45,
color: Color(0xFFc5272d),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
onPressed: () => onCancel(order),
child: Text(
localize.cancel,
style: TextStyle(color: Colors.white, fontSize: 13),
),
);
// Widget _contentItem({@required String label, String value}) {
// return Container(
// padding: EdgeInsets.symmetric(vertical: 10),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// label,
// style: TextStyle(color: Theme.of(_context).appBarTheme.color, fontSize: 9, letterSpacing: 1),
// ),
// SizedBox(
// height: 5,
// ),
// Text(
// value,
// style: TextStyle(color: Theme.of(_context).appBarTheme.color, fontWeight: FontWeight.bold, fontSize: 14),
// ),
// ],
// ),
// );
// }
// Widget cancelButton() => MaterialButton(
// height: 45,
// color: Color(0xFFc5272d),
// shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
// onPressed: () => onCancel(order),
// child: Text(
// localize.cancel,
// style: TextStyle(color: Colors.white, fontSize: 13),
// ),
// );
}

@ -53,7 +53,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
Stream<int> addressStream;
StreamController<int> addressLoadingStreamController = StreamController();
Stream<int> addressLoadingStream;
AddressInfo _selectedAddress;
// AddressInfo _selectedAddress;
double latitude = 0;
double longitude = 0;
AppMap appMap;
@ -61,13 +61,23 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
@override
void initState() {
super.initState();
goToCurrentLocation();
appMap = AppMap(
cameraPosition.toMap(),
onCameraMove: (camera) {
_updatePosition(camera);
},
onMapCreated: () {
goToCurrentLocation();
setState(() {});
},
);
// addressStream = addressStreamController.stream;
// addressLoadingStream = addressLoadingStreamController.stream;
}
setLatitudeAndLongitude({bool isSetState = false, String latLong}) async {
print("latLong " + latLong.toString());
if (latLong == null) {
if (myAddresses.isEmpty) {
setState(() {
@ -86,7 +96,6 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
print("sssss1 " + latitude.toString());
print("sssss2 " + longitude.toString());
currentPostion = LatLng(latitude, longitude);
selectedAddress = AddressInfo(latLong: '${latitude},${longitude}', address1: "", address2: "");
setMap();
}
}
@ -204,9 +213,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
child: Stack(
alignment: Alignment.center,
children: [
appMap = AppMap(cameraPosition.toMap(), onCameraMove: (camera) {
_updatePosition(camera);
}),
if (appMap != null) appMap,
Icon(
Icons.place,
color: CustomColors.accentColor,
@ -220,67 +227,12 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
child: continueButton(),
),
],
)
// Column(
// crossAxisAlignment: CrossAxisAlignment.stretch,
// children: [
// StreamBuilder<Object>(
// stream: addressStream,
// builder: (context, snapshot) {
// return selectAddressField();
// }),
// StreamBuilder<Object>(
// stream: addressLoadingStream,
// builder: (context, snapshot) {
// return snapshot.hasData
// ? LinearProgressIndicator(backgroundColor: Colors.transparent)
// : Container(
// height: 4,
// );
// }),
// Expanded(
// child: PlacePicker(
// apiKey: GOOGLE_API_KEY,
// enableMyLocationButton: true,
// automaticallyImplyAppBarLeading: false,
// autocompleteOnTrailingWhitespace: true,
// selectInitialPosition: true,
// autocompleteLanguage: projectViewModel.currentLanguage,
// enableMapTypeButton: true,
// searchForInitialValue: false,
// selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
// if (state == SearchingState.Idle) {
// addressLoadingStreamController.sink.add(null);
// if (selectedPlace != null) {
// var loc = selectedPlace.geometry.location;
// var address1 = selectedPlace.addressComponents.first.longName;
// var address2 = "";
// if (selectedPlace.addressComponents.length > 1) address2 = selectedPlace.addressComponents[1].longName;
// selectedAddress = Addresses(latLong: '${loc.lat},${loc.lng}', address1: address1, address2: address2);
// addressStreamController.sink.add(0);
// }
// } else {
// addressLoadingStreamController.sink.add(0);
// }
// return Container();
// },
// initialPosition: LatLng(24.7114693, 46.67469582),
// useCurrentLocation: false,
// ),
// ),
// continueButton()
// ],
// )
));
)));
}
void _updatePosition(CameraPosition _position) {
latitude = _position.target.latitude;
longitude = _position.target.longitude;
selectedAddress = AddressInfo(latLong: '${latitude},${longitude}', address1: "", address2: "");
}
Widget centerTargetPoint() {
@ -296,30 +248,6 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
);
}
// Widget selectAddressField() {
// var text = selectedAddress == null ? localize.selectAddress : selectedAddress.toString();
// return Container(
// margin: EdgeInsets.all(10),
// height: 50,
// child: MaterialButton(
// height: 50,
// color: Colors.white,
// shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
// onPressed: openAddressSelectDialog,
// child: Row(
// children: [
// Expanded(child: Text(text, style: TextStyle(color: Colors.grey, fontSize: 13, letterSpacing: 1))),
// Icon(
// Icons.keyboard_arrow_down,
// size: 20,
// color: Colors.grey,
// )
// ],
// ),
// ),
// );
// }
Widget continueButton() {
return Padding(
padding: const EdgeInsets.all(15),
@ -335,52 +263,18 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
);
}
// openAddressSelectDialog() {
// showMaterialResponsiveDialog(
// hideButtons: true,
// context: context,
// title: localize.selectAddress,
// child: ListView.separated(
// shrinkWrap: true,
// padding: EdgeInsets.all(10),
// itemCount: myAddresses.length,
// itemBuilder: (ctx, idx) {
// var itm = myAddresses[idx];
// return ListTile(
// title: Text(itm.toString()),
// onTap: () {
// setState(() {
// selectedAddress = itm;
// Navigator.pop(context);
// if (itm.latLong != null && itm.latLong.isNotEmpty && itm.latLong.split(',').length > 1) {
// var cordinates = itm.latLong.split(',');
// var latlng = LatLng(double.parse(cordinates.first), double.parse(cordinates.last));
// //moveToLocation(latlng);
// } else {
// AppToast.showErrorToast(message: 'Invalid address coordinates');
// }
// });
// },
// );
// },
// separatorBuilder: (ctx, idx) => Container(
// height: 0.25,
// color: Colors.grey.withOpacity(0.7),
// )));
// }
void confirmSelectLocationDialog(List<AddressInfo> addresses) {
showDialog(
context: context,
child: SelectLocationDialog(
addresses: addresses,
selectedAddress: _selectedAddress,
selectedAddress: selectedAddress,
onValueSelected: (value) {
showCurrentLocation = false;
setLatitudeAndLongitude(latLong: value.latLong);
setState(() {
_selectedAddress = value;
selectedAddress = value;
});
},
),
@ -388,8 +282,8 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
}
String getAddressName() {
if (_selectedAddress != null)
return _selectedAddress.address1;
if (selectedAddress != null && selectedAddress.address1 != null)
return selectedAddress.address1;
else
return TranslationBase.of(context).selectAddress;
}
@ -411,13 +305,10 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
}
goToCurrentLocation() async {
var location = await Geolocator.getLastKnownPosition();
if (location == null) {
Geolocator.getCurrentPosition().then((value) {
moveToLocation(LatLng(value.latitude, value.longitude));
});
return;
}
Geolocator.getCurrentPosition().then((value) {
selectedAddress = AddressInfo(latLong: '${value.latitude},${value.longitude}');
moveToLocation(LatLng(value.latitude, value.longitude));
});
}
// moveToLocation(LatLng(location.latitude, location.longitude), animate: false);

@ -123,25 +123,27 @@ class RRTPlaceOrderPage extends StatelessWidget {
Widget selectedAddressField() {
var address = "${selectedAddress.address1 ?? ''} ${selectedAddress.address2 ?? ''}";
return Container(
margin: EdgeInsets.symmetric(vertical: 10),
child: MaterialButton(
height: 50,
color: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
onPressed: () {},
child: Row(
children: [
Expanded(child: Text(address, style: TextStyle(color: Colors.black87, fontSize: 15, letterSpacing: 1))),
Icon(
Icons.location_on_rounded,
size: 30,
color: Colors.black,
)
],
),
),
);
return selectedAddress.address1 != null
? Container(
margin: EdgeInsets.symmetric(vertical: 10),
child: MaterialButton(
height: 50,
color: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
onPressed: () {},
child: Row(
children: [
Expanded(child: Text(address, style: TextStyle(color: Colors.black87, fontSize: 12, letterSpacing: 1))),
Icon(
Icons.location_on_rounded,
size: 30,
color: Colors.black,
)
],
),
),
)
: SizedBox();
}
Widget submitButton(BuildContext context) {

@ -76,6 +76,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
var orders = widget.pendingOrders;
return ListView.builder(
itemCount: orders.length,
padding: EdgeInsets.all(21),
itemBuilder: (ctx, idx) {
var order = orders[idx];
return RRTLogListItem(order, onCancel: deleteOrder);

@ -19,6 +19,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
class SchedulePage extends StatefulWidget {
DoctorList doctorList;
@ -61,11 +62,14 @@ class _SchedulePageState extends State<SchedulePage> {
onModelReady: (model2) => model2.getFreeSlots(doctorList),
allowAny: true,
builder: (_, model2, widget2) {
if (model.freeSlots.length > 0 && isPageChange == false) {
this.freeSlots = model.freeSlots;
if (model2.freeSlots.length > 0 && isPageChange == false && model2.state == ViewState.Idle) {
this.freeSlots = model2.freeSlots;
this.doctorScheduleResponse = model.getDoctorScheduleList;
this.generateWeeksSchedules();
} else if (model2.freeSlots.length == 0 && model2.state == ViewState.Idle) {
AppToast.showErrorToast(message: TranslationBase.of(context).emptySchedule);
Navigator.pop(context);
}
return AppScaffold(
appBarTitle: TranslationBase.of(context).schedule,

Loading…
Cancel
Save