BUG FIXES

merge-requests/404/head
Sultan Khan 3 years ago
parent 062ca5c11c
commit 5b988dff4f

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

@ -6,7 +6,6 @@ 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;
@ -14,27 +13,24 @@ class RRTLogPage extends StatefulWidget{
@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,
padding: EdgeInsets.all(21),
itemBuilder: (ctx, idx) {
var order = widget.orders[idx];
return RRTLogListItem(order, onCancel: deleteOrder);
}
);
}
);
});
});
}
deleteOrder(PrescriptionsOrder order) async {
@ -46,7 +42,4 @@ class RRTLogPageState extends State<RRTLogPage>{
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)]),
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),
),
],
),
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),
),
),
// clipBehavior: Clip.antiAlias,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
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: [
_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())
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),
),
),
],
),
);
}
Widget _contentItem({@required String label, String value}) {
return Container(
padding: EdgeInsets.symmetric(vertical: 10),
child: Column(
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
label,
style: TextStyle(color: Theme.of(_context).appBarTheme.color, fontSize: 9, letterSpacing: 1),
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),
),
),
SizedBox(
height: 5,
],
),
],
),
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
value,
style: TextStyle(color: Theme.of(_context).appBarTheme.color, fontWeight: FontWeight.bold, fontSize: 14),
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,21 +53,21 @@ 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;
bool showCurrentLocation = false;
@override
void initState() {
super.initState();
goToCurrentLocation();
super.initState();
// 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 +86,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();
}
}
@ -220,67 +219,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 +240,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 +255,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 +274,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 +297,10 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
}
goToCurrentLocation() async {
var location = await Geolocator.getLastKnownPosition();
if (location == null) {
Geolocator.getCurrentPosition().then((value) {
selectedAddress = AddressInfo(latLong: '${value.latitude},${value.longitude}');
moveToLocation(LatLng(value.latitude, value.longitude));
});
return;
}
}
// moveToLocation(LatLng(location.latitude, location.longitude), animate: false);

@ -123,7 +123,8 @@ class RRTPlaceOrderPage extends StatelessWidget {
Widget selectedAddressField() {
var address = "${selectedAddress.address1 ?? ''} ${selectedAddress.address2 ?? ''}";
return Container(
return selectedAddress.address1 != null
? Container(
margin: EdgeInsets.symmetric(vertical: 10),
child: MaterialButton(
height: 50,
@ -132,7 +133,7 @@ class RRTPlaceOrderPage extends StatelessWidget {
onPressed: () {},
child: Row(
children: [
Expanded(child: Text(address, style: TextStyle(color: Colors.black87, fontSize: 15, letterSpacing: 1))),
Expanded(child: Text(address, style: TextStyle(color: Colors.black87, fontSize: 12, letterSpacing: 1))),
Icon(
Icons.location_on_rounded,
size: 30,
@ -141,7 +142,8 @@ class RRTPlaceOrderPage extends StatelessWidget {
],
),
),
);
)
: 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) {
if (model.freeSlots.length > 0 && isPageChange == false && model.state == ViewState.Idle) {
this.freeSlots = model.freeSlots;
this.doctorScheduleResponse = model.getDoctorScheduleList;
this.generateWeeksSchedules();
} else if (model.freeSlots.length == 0 && model.state == ViewState.Idle) {
AppToast.showErrorToast(message: TranslationBase.of(context).emptySchedule);
Navigator.pop(context);
}
return AppScaffold(
appBarTitle: TranslationBase.of(context).schedule,

@ -1,4 +1,3 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
@ -7,7 +6,6 @@ import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:huawei_map/map.dart' as hmsMap;
class AppMap extends StatefulWidget {
CameraPositionCallback onCameraMove;
Map initialCamera;
@ -19,7 +17,6 @@ class AppMap extends StatefulWidget{
@override
State<StatefulWidget> createState() => _state = AppMapState();
moveTo({@required CameraPosition cameraPostion}) {
if (_state.isHuawei) {
final cameraJson = cameraPostion.toMap();
@ -32,7 +29,6 @@ class AppMap extends StatefulWidget{
}
class AppMapState extends State<AppMap> {
bool isHuawei;
Completer<GoogleMapController> _googleMapControllerComp = Completer();
@ -45,6 +41,7 @@ class AppMapState extends State<AppMap>{
isHuawei = await FlutterHmsGmsAvailability.isHmsAvailable;
setState(() {});
}
@override
void initState() {
checkIsHuawei();
@ -52,17 +49,14 @@ class AppMapState extends State<AppMap>{
@override
Widget build(BuildContext context) {
if(isHuawei == null)
return CircularProgressIndicator();
if (isHuawei == null) return CircularProgressIndicator();
return map();
}
Widget map() => isHuawei ? huaweiMap() : googleMap();
googleMap() {
return
GoogleMap(
return GoogleMap(
mapType: MapType.normal,
zoomControlsEnabled: false,
myLocationButtonEnabled: true,
@ -90,5 +84,4 @@ class AppMapState extends State<AppMap>{
},
);
}
}
Loading…
Cancel
Save