updates & fixes

merge-update-with-lab-changes
haroon amjad 5 years ago
parent ad3463bbfc
commit 92bfe27a6e

@ -1504,4 +1504,5 @@ const Map localizedValues = {
"seeDoctorsList": { "en": "See List Of Doctors", "ar": "اعرض قائمة الأطباء" }, "seeDoctorsList": { "en": "See List Of Doctors", "ar": "اعرض قائمة الأطباء" },
"covidQuestionnaire": { "en": "Please answer below questionnaire:", "ar": "الرجاء الإجابة على الاستبيان أدناه:" }, "covidQuestionnaire": { "en": "Please answer below questionnaire:", "ar": "الرجاء الإجابة على الاستبيان أدناه:" },
"covidBookAppo": { "en": "Booking Appointment For: ", "ar": "موعد الحجز لـ: " }, "covidBookAppo": { "en": "Booking Appointment For: ", "ar": "موعد الحجز لـ: " },
"emptySchedule": { "en": "Doctor has no schedule.", "ar": "لا يوجد جدول حضور مسجل للطبيب" }
}; };

@ -11,8 +11,8 @@ class ActiveMedicationsService extends BaseService{
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
// body['PatientID'] = 1298851; body['PatientID'] = 1298851;
// body['TokenID'] = "@dm!n"; body['TokenID'] = "@dm!n";
await baseAppClient.post(ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID, await baseAppClient.post(ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
activePrescriptionReport.clear(); activePrescriptionReport.clear();

@ -1,14 +1,14 @@
class ServicePrice { class ServicePrice {
String currency; String currency;
double maxPrice; dynamic maxPrice;
double maxTotalPrice; dynamic maxTotalPrice;
double maxVAT; dynamic maxVAT;
double minPrice; dynamic minPrice;
double minTotalPrice; dynamic minTotalPrice;
double minVAT; dynamic minVAT;
int price; dynamic price;
int totalPrice; dynamic totalPrice;
int vat; dynamic vat;
ServicePrice({ ServicePrice({
this.currency, this.currency,

@ -117,6 +117,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
), ),
buttonIcon: 'assets/images/new/Boo_ Appointment.svg', buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false, showConfirmMessageDialog: false,
isNeedToShowButton: !widget.isLiveCareAppointment,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
@ -139,7 +140,14 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
TabBar( TabBar(
onTap: (index) { onTap: (index) {
setState(() { setState(() {
index == 1 ? showFooterButton = true : showFooterButton = false; if (index == 1) {
if (widget.doctor.clinicID == 17 || widget.doctor.clinicID == 23 || widget.isLiveCareAppointment) {
_tabController.index = _tabController.previousIndex;
showFooterButton = false;
} else {
showFooterButton = true;
}
}
print(showFooterButton); print(showFooterButton);
}); });
}, },

@ -39,6 +39,8 @@ class RRTMainScreenState extends State<RRTMainScreen> with SingleTickerProviderS
return AppScaffold( return AppScaffold(
appBarTitle: localize.rapidResponseTeam, appBarTitle: localize.rapidResponseTeam,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
description: TranslationBase.of(context).rrtDDetails, description: TranslationBase.of(context).rrtDDetails,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
body: BaseView<RRTViewModel>( body: BaseView<RRTViewModel>(
@ -73,7 +75,7 @@ class RRTMainScreenState extends State<RRTMainScreen> with SingleTickerProviderS
} }
Widget tabBar() => Container( Widget tabBar() => Container(
margin: EdgeInsets.all(15), margin: EdgeInsets.all(0.0),
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)), decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)),
child: TabBar(onTap: onPageChanged, indicatorWeight: 3, indicatorColor: Color(0xFFc5272d), isScrollable: false, controller: tabController, indicatorSize: TabBarIndicatorSize.label, tabs: [ child: TabBar(onTap: onPageChanged, indicatorWeight: 3, indicatorColor: Color(0xFFc5272d), isScrollable: false, controller: tabController, indicatorSize: TabBarIndicatorSize.label, tabs: [

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/models/rrt/service_price.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -20,16 +21,16 @@ import 'package:provider/provider.dart';
import 'rrt-place-order.dart'; import 'rrt-place-order.dart';
class RRTRequestPickupAddressPage extends StatefulWidget{ class RRTRequestPickupAddressPage extends StatefulWidget {
final ServicePrice servicePrice; final ServicePrice servicePrice;
RRTRequestPickupAddressPage({@required this.servicePrice}); RRTRequestPickupAddressPage({@required this.servicePrice});
@override @override
State<StatefulWidget> createState() => RRTRequestPickupAddressPageState(); State<StatefulWidget> createState() => RRTRequestPickupAddressPageState();
} }
class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage> with SingleTickerProviderStateMixin{
class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage> with SingleTickerProviderStateMixin {
bool acceptTerms = false; bool acceptTerms = false;
bool mapIdle = true; bool mapIdle = true;
@ -39,7 +40,6 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
zoom: 14.4746, zoom: 14.4746,
); );
List<Addresses> myAddresses = []; List<Addresses> myAddresses = [];
Addresses selectedAddress; Addresses selectedAddress;
StreamController<int> addressStreamController = StreamController(); StreamController<int> addressStreamController = StreamController();
@ -48,20 +48,19 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
Stream<int> addressLoadingStream; Stream<int> addressLoadingStream;
@override @override
void initState(){ void initState() {
super.initState(); super.initState();
goToCurrentLocation(); goToCurrentLocation();
addressStream = addressStreamController.stream; addressStream = addressStreamController.stream;
addressLoadingStream = addressLoadingStreamController.stream; addressLoadingStream = addressLoadingStreamController.stream;
} }
void loadAddresses() async{ void loadAddresses() async {
// GifLoaderDialogUtils.showMyDialog(context); // GifLoaderDialogUtils.showMyDialog(context);
myAddresses = await viewModel.getAddresses(); myAddresses = await viewModel.getAddresses();
// GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
if(myAddresses.isNotEmpty) if (myAddresses.isNotEmpty) setState(() {});
setState(() {});
} }
TranslationBase localize; TranslationBase localize;
@ -75,13 +74,15 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
addressStreamController.sink.add(0); addressStreamController.sink.add(0);
return BaseView<RRTViewModel>( return BaseView<RRTViewModel>(
onModelReady: (vm){ onModelReady: (vm) {
viewModel = vm; viewModel = vm;
loadAddresses(); loadAddresses();
}, },
builder: (ctx, vm, widget) => AppScaffold( builder: (ctx, vm, widget) => AppScaffold(
appBarTitle: localize.pickupLocation, appBarTitle: localize.pickupLocation,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
@ -89,17 +90,18 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
stream: addressStream, stream: addressStream,
builder: (context, snapshot) { builder: (context, snapshot) {
return selectAddressField(); return selectAddressField();
} }),
),
StreamBuilder<Object>( StreamBuilder<Object>(
stream: addressLoadingStream, stream: addressLoadingStream,
builder: (context, snapshot) { builder: (context, snapshot) {
return snapshot.hasData ? LinearProgressIndicator(backgroundColor: Colors.transparent) : Container(height: 4,); return snapshot.hasData
} ? LinearProgressIndicator(backgroundColor: Colors.transparent)
), : Container(
height: 4,
);
}),
Expanded( Expanded(
child: child: PlacePicker(
PlacePicker(
apiKey: GOOGLE_API_KEY, apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true, enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false, automaticallyImplyAppBarLeading: false,
@ -109,19 +111,18 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
enableMapTypeButton: true, enableMapTypeButton: true,
searchForInitialValue: false, searchForInitialValue: false,
selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
if(state == SearchingState.Idle){ if (state == SearchingState.Idle) {
addressLoadingStreamController.sink.add(null); addressLoadingStreamController.sink.add(null);
if(selectedPlace != null){ if (selectedPlace != null) {
var loc = selectedPlace.geometry.location; var loc = selectedPlace.geometry.location;
var address1 = selectedPlace.addressComponents.first.longName; var address1 = selectedPlace.addressComponents.first.longName;
var address2 = ""; var address2 = "";
if(selectedPlace.addressComponents.length > 1) if (selectedPlace.addressComponents.length > 1) address2 = selectedPlace.addressComponents[1].longName;
address2 = selectedPlace.addressComponents[1].longName;
selectedAddress = Addresses(latLong: '${loc.lat},${loc.lng}', address1: address1, address2: address2); selectedAddress = Addresses(latLong: '${loc.lat},${loc.lng}', address1: address1, address2: address2);
addressStreamController.sink.add(0); addressStreamController.sink.add(0);
} }
}else{ } else {
addressLoadingStreamController.sink.add(0); addressLoadingStreamController.sink.add(0);
} }
return Container(); return Container();
@ -132,68 +133,62 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
), ),
continueButton() continueButton()
], ],
) )));
)
);
} }
Widget centerTargetPoint(){ Widget centerTargetPoint() {
double size = mapIdle ? 20 : 30; double size = mapIdle ? 20 : 30;
double margin = mapIdle ? 3 : 10; double margin = mapIdle ? 3 : 10;
return Center( return Center(
child: Container( child: Container(
width: size, height: size, width: size,
decoration: BoxDecoration( height: size,
borderRadius: BorderRadius.circular(20), border: Border.all(width: 2, color: Theme.of(context).appBarTheme.color) decoration: BoxDecoration(borderRadius: BorderRadius.circular(20), border: Border.all(width: 2, color: Theme.of(context).appBarTheme.color)),
), child: Container(margin: EdgeInsets.all(margin), decoration: BoxDecoration(color: Theme.of(context).appBarTheme.color, borderRadius: BorderRadius.circular(20))),
child: Container(
margin: EdgeInsets.all(margin),
decoration: BoxDecoration(
color: Theme.of(context).appBarTheme.color,
borderRadius: BorderRadius.circular(20))
),
), ),
); );
} }
Widget selectAddressField(){ Widget selectAddressField() {
var text = selectedAddress == null ? localize.selectAddress : selectedAddress.toString(); var text = selectedAddress == null ? localize.selectAddress : selectedAddress.toString();
return Container( return Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
height: 50, height: 50,
child: MaterialButton( child: MaterialButton(
height: 50, color: Colors.white, height: 50,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), color: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
onPressed: openAddressSelectDialog, onPressed: openAddressSelectDialog,
child: Row( child: Row(
children: [ children: [
Expanded(child: Text(text, style: TextStyle(color: Colors.grey, fontSize: 13, letterSpacing: 1))), Expanded(child: Text(text, style: TextStyle(color: Colors.grey, fontSize: 13, letterSpacing: 1))),
Icon(Icons.keyboard_arrow_down, size: 20, color: Colors.grey,) Icon(
Icons.keyboard_arrow_down,
size: 20,
color: Colors.grey,
)
], ],
), ),
), ),
); );
} }
Widget continueButton(){ Widget continueButton() {
return Padding( return Padding(
padding: const EdgeInsets.all(15), padding: const EdgeInsets.all(15),
child: MaterialButton( child: DefaultButton(TranslationBase.of(context).continues, () {
height: 50,
color: Theme.of(context).appBarTheme.color,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ),
onPressed: () =>
Navigator.push( Navigator.push(
context, context,
FadePage(page: RRTPlaceOrderPage(selectedAddress: selectedAddress, servicePrice: widget.servicePrice,)) FadePage(
), page: RRTPlaceOrderPage(
child: Text(localize.continues, style: TextStyle(color: Colors.white, fontSize: 15, letterSpacing: 1),), selectedAddress: selectedAddress,
), servicePrice: widget.servicePrice,
)));
}),
); );
} }
openAddressSelectDialog() {
openAddressSelectDialog(){
showMaterialResponsiveDialog( showMaterialResponsiveDialog(
hideButtons: true, hideButtons: true,
context: context, context: context,
@ -202,43 +197,51 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
itemCount: myAddresses.length, itemCount: myAddresses.length,
itemBuilder: (ctx,idx) { itemBuilder: (ctx, idx) {
var itm = myAddresses[idx]; var itm = myAddresses[idx];
return ListTile( return ListTile(
title: Text(itm.toString()), title: Text(itm.toString()),
onTap: (){ onTap: () {
setState(() { setState(() {
selectedAddress = itm; selectedAddress = itm;
Navigator.pop(context); Navigator.pop(context);
if(itm.latLong != null && itm.latLong.isNotEmpty && itm.latLong.split(',').length > 1){ if (itm.latLong != null && itm.latLong.isNotEmpty && itm.latLong.split(',').length > 1) {
var cordinates = itm.latLong.split(','); var cordinates = itm.latLong.split(',');
var latlng = LatLng(double.parse(cordinates.first), double.parse(cordinates.last)); var latlng = LatLng(double.parse(cordinates.first), double.parse(cordinates.last));
moveToLocation(latlng); moveToLocation(latlng);
}else{ } else {
AppToast.showErrorToast(message: 'Invalid address coordinates'); AppToast.showErrorToast(message: 'Invalid address coordinates');
} }
}); });
}, },
); );
}, },
separatorBuilder: (ctx,idx) => Container(height: 0.25, color: Colors.grey.withOpacity(0.7),) separatorBuilder: (ctx, idx) => Container(
) height: 0.25,
); color: Colors.grey.withOpacity(0.7),
)));
} }
moveToLocation(LatLng location, {bool animate = true}) async{ moveToLocation(LatLng location, {bool animate = true}) async {
await Future.delayed(Duration(milliseconds: 200)); await Future.delayed(Duration(milliseconds: 200));
mapCameraPosition = CameraPosition(target: location, zoom: 16.4746,); mapCameraPosition = CameraPosition(
if(animate) target: location,
(await mapController.future).animateCamera(CameraUpdate.newCameraPosition(mapCameraPosition),); zoom: 16.4746,
);
if (animate)
(await mapController.future).animateCamera(
CameraUpdate.newCameraPosition(mapCameraPosition),
);
else else
(await mapController.future).moveCamera(CameraUpdate.newCameraPosition(mapCameraPosition),); (await mapController.future).moveCamera(
CameraUpdate.newCameraPosition(mapCameraPosition),
);
} }
goToCurrentLocation() async{ goToCurrentLocation() async {
var location = await Geolocator.getLastKnownPosition(); var location = await Geolocator.getLastKnownPosition();
if(location == null){ if (location == null) {
Geolocator.getCurrentPosition().then((value){ Geolocator.getCurrentPosition().then((value) {
moveToLocation(LatLng(value.latitude, value.longitude)); moveToLocation(LatLng(value.latitude, value.longitude));
}); });
return; return;

@ -7,12 +7,13 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.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/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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';
class RRTPlaceOrderPage extends StatelessWidget{ class RRTPlaceOrderPage extends StatelessWidget {
TranslationBase localize; TranslationBase localize;
RRTViewModel viewModel; RRTViewModel viewModel;
Addresses selectedAddress; Addresses selectedAddress;
@ -22,6 +23,7 @@ class RRTPlaceOrderPage extends StatelessWidget{
TextEditingController noteController = TextEditingController(text: ''); TextEditingController noteController = TextEditingController(text: '');
BuildContext _context; BuildContext _context;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_context = context; _context = context;
@ -31,10 +33,12 @@ class RRTPlaceOrderPage extends StatelessWidget{
return BaseView<RRTViewModel>( return BaseView<RRTViewModel>(
onModelReady: (vm) => viewModel = vm, onModelReady: (vm) => viewModel = vm,
builder: (ctx,vm,wState){ builder: (ctx, vm, wState) {
return AppScaffold( return AppScaffold(
appBarTitle: localize.rapidResponseTeam, appBarTitle: localize.rapidResponseTeam,
isShowAppBar: true, isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
@ -44,51 +48,59 @@ class RRTPlaceOrderPage extends StatelessWidget{
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
Text(localize.selectedLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),), Text(
localize.selectedLocation,
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
),
selectedAddressField(), selectedAddressField(),
AspectRatio( AspectRatio(
aspectRatio: 3/1, aspectRatio: 3 / 1,
child: ClipRRect( child: ClipRRect(
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
child: Image.network( child: Image.network(
"https://maps.googleapis.com/maps/api/staticmap?center=$lat,$lng &zoom=16&size=800x400&maptype=roadmap&markers=color:red%7C$lat,$lng&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8", "https://maps.googleapis.com/maps/api/staticmap?center=$lat,$lng &zoom=16&size=800x600&maptype=roadmap&markers=color:red%7C$lat,$lng&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8",
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
), ),
SizedBox(
SizedBox(height: 10,), height: 10,
),
Container( Container(
height: 70, height: 80,
margin: EdgeInsets.symmetric(vertical: 5), margin: EdgeInsets.symmetric(vertical: 5),
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10), padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(10), color: Colors.white,
boxShadow: [BoxShadow(blurRadius: 5, spreadRadius: 2, offset: Offset(2,2), color: Colors.grey.withOpacity(0.25))] borderRadius: BorderRadius.circular(10),
), boxShadow: [BoxShadow(blurRadius: 5, spreadRadius: 2, offset: Offset(2, 2), color: Colors.grey.withOpacity(0.25))]),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(localize.totalAmountPayable, style: TextStyle(fontSize: 13),), Text(
SizedBox(height: 5,), localize.totalAmountPayable,
Text("${servicePrice.totalPrice ?? '- - -'} ${localize.sar}" , style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),), style: TextStyle(fontSize: 13),
),
SizedBox(
height: 5,
),
Text(
"${servicePrice.totalPrice ?? '- - -'} ${localize.sar}",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
),
], ],
), ),
), ),
Container( Container(
height: 70, height: 70,
margin: EdgeInsets.symmetric(vertical: 5), margin: EdgeInsets.symmetric(vertical: 5),
padding: EdgeInsets.symmetric(horizontal: 0, vertical: 10), padding: EdgeInsets.symmetric(horizontal: 0, vertical: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(10), color: Colors.white,
boxShadow: [BoxShadow(blurRadius: 5, spreadRadius: 2, offset: Offset(2,2), color: Colors.grey.withOpacity(0.25))] borderRadius: BorderRadius.circular(10),
), boxShadow: [BoxShadow(blurRadius: 5, spreadRadius: 2, offset: Offset(2, 2), color: Colors.grey.withOpacity(0.25))]),
child: TextField( child: TextField(
controller: noteController, controller: noteController,
style: TextStyle(fontSize: 18.0), style: TextStyle(fontSize: 18.0),
@ -105,8 +117,7 @@ class RRTPlaceOrderPage extends StatelessWidget{
borderSide: BorderSide(color: Colors.white), borderSide: BorderSide(color: Colors.white),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),
) )),
),
), ),
], ],
), ),
@ -114,26 +125,29 @@ class RRTPlaceOrderPage extends StatelessWidget{
), ),
submitButton(context) submitButton(context)
], ],
) ));
);
}, },
); );
} }
Widget selectedAddressField() {
Widget selectedAddressField(){
var address = "${selectedAddress.address1 ?? ''} ${selectedAddress.address2 ?? ''}"; var address = "${selectedAddress.address1 ?? ''} ${selectedAddress.address2 ?? ''}";
return Container( return Container(
margin: EdgeInsets.symmetric(vertical: 10), margin: EdgeInsets.symmetric(vertical: 10),
child: Expanded( child: Expanded(
child: MaterialButton( child: MaterialButton(
height: 50, color: Colors.white, height: 50,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), color: Colors.white,
onPressed: (){}, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
onPressed: () {},
child: Row( child: Row(
children: [ children: [
Expanded(child: Text(address, style: TextStyle(color: Colors.black87, fontSize: 15, letterSpacing: 1))), Expanded(child: Text(address, style: TextStyle(color: Colors.black87, fontSize: 15, letterSpacing: 1))),
Icon(Icons.location_on_rounded, size: 30, color: Colors.black,) Icon(
Icons.location_on_rounded,
size: 30,
color: Colors.black,
)
], ],
), ),
), ),
@ -141,22 +155,18 @@ class RRTPlaceOrderPage extends StatelessWidget{
); );
} }
Widget submitButton(BuildContext context) {
Widget submitButton(BuildContext context){
return Padding( return Padding(
padding: const EdgeInsets.all(15), padding: const EdgeInsets.all(15),
child: MaterialButton( child: DefaultButton(
height: 50, localize.submit,
color: Theme.of(context).appBarTheme.color, () => placeOrder(),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
onPressed: () => placeOrder(),
child: Text(localize.submit, style: TextStyle(color: Colors.white, fontSize: 15, letterSpacing: 1),),
), ),
); );
} }
placeOrder() async{ placeOrder() async {
if(selectedAddress != null && selectedAddress.latLong != null && selectedAddress.latLong.isNotEmpty && selectedAddress.latLong.split(',').length > 1){ if (selectedAddress != null && selectedAddress.latLong != null && selectedAddress.latLong.isNotEmpty && selectedAddress.latLong.split(',').length > 1) {
GifLoaderDialogUtils.showMyDialog(_context); GifLoaderDialogUtils.showMyDialog(_context);
Map<String, dynamic> params = {}; Map<String, dynamic> params = {};
@ -169,25 +179,23 @@ class RRTPlaceOrderPage extends StatelessWidget{
GifLoaderDialogUtils.hideDialog(_context); GifLoaderDialogUtils.hideDialog(_context);
if(requestId != null){ if (requestId != null) {
AlertDialogBox( AlertDialogBox(
context: _context, context: _context,
title: '', title: '',
confirmMessage: localize.rrtOrderSuccessMessage, confirmMessage: localize.rrtOrderSuccessMessage,
okText: localize.ok, okText: localize.ok,
okFunction: (){ okFunction: () {
AlertDialogBox.closeAlertDialog(_context); AlertDialogBox.closeAlertDialog(_context);
gotoRRTRoot(); gotoRRTRoot();
}).showAlertDialog(_context);
} }
).showAlertDialog(_context); } else {
}
}else{
AppToast.showErrorToast(message: 'Invalid location selected'); AppToast.showErrorToast(message: 'Invalid location selected');
} }
} }
gotoRRTRoot(){ gotoRRTRoot() {
Navigator.popUntil(_context, (route) => Utils.route(route, equalsTo: ErOptions)); Navigator.popUntil(_context, (route) => Utils.route(route, equalsTo: ErOptions));
} }
} }

@ -8,12 +8,12 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class RRTRequestPage extends StatefulWidget{ class RRTRequestPage extends StatefulWidget {
final List<PrescriptionsOrder> pendingOrders; final List<PrescriptionsOrder> pendingOrders;
final ServicePrice servicePrice; final ServicePrice servicePrice;
@ -21,9 +21,9 @@ class RRTRequestPage extends StatefulWidget{
@override @override
State<StatefulWidget> createState() => RRTRequestPageState(); State<StatefulWidget> createState() => RRTRequestPageState();
} }
class RRTRequestPageState extends State<RRTRequestPage>{
class RRTRequestPageState extends State<RRTRequestPage> {
bool acceptTerms = false; bool acceptTerms = false;
TranslationBase localize; TranslationBase localize;
@ -33,22 +33,19 @@ class RRTRequestPageState extends State<RRTRequestPage>{
Widget build(BuildContext context) { Widget build(BuildContext context) {
localize = TranslationBase.of(context); localize = TranslationBase.of(context);
return BaseView<RRTViewModel>( return BaseView<RRTViewModel>(
onModelReady: (vm){ onModelReady: (vm) {
viewModel = vm; viewModel = vm;
}, },
builder: (ctx, vm, widgetState){ builder: (ctx, vm, widgetState) {
if (widget.pendingOrders.isNotEmpty)
if(widget.pendingOrders.isNotEmpty)
return currentOrderContent(); return currentOrderContent();
else else
return requestContent(); return requestContent();
}, },
); );
} }
Widget requestContent(){ Widget requestContent() {
return Column( return Column(
children: [ children: [
Expanded( Expanded(
@ -61,37 +58,33 @@ class RRTRequestPageState extends State<RRTRequestPage>{
acceptPolicy(), acceptPolicy(),
Container(height: 0.5, color: Theme.of(context).appBarTheme.color),// Seperator Container(height: 0.5, color: Theme.of(context).appBarTheme.color), // Seperator
Container( Container(
padding: EdgeInsets.only(top: 20, bottom: 5), padding: EdgeInsets.only(top: 20, bottom: 5),
alignment: Alignment.center, alignment: Alignment.center,
child: Text(localize.youCanPayByTheFollowingOptions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w500), maxLines: 2) child: Text(localize.youCanPayByTheFollowingOptions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w500), maxLines: 2)),
),
paymentOptions(), paymentOptions(),
], ],
), ),
), ),
actionButtons() actionButtons()
], ],
); );
} }
Widget currentOrderContent(){ Widget currentOrderContent() {
var orders = widget.pendingOrders; var orders = widget.pendingOrders;
return ListView.builder( return ListView.builder(
itemCount: orders.length, itemCount: orders.length,
itemBuilder: (ctx, idx) { itemBuilder: (ctx, idx) {
var order = orders[idx]; var order = orders[idx];
return RRTLogListItem(order, onCancel: deleteOrder); return RRTLogListItem(order, onCancel: deleteOrder);
} });
);
} }
Widget serviceDescription(BuildContext context) => Widget serviceDescription(BuildContext context) => Padding(
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10), padding: const EdgeInsets.symmetric(horizontal: 10),
child: Text( child: Text(
localize.rrtDDetails, localize.rrtDDetails,
@ -100,7 +93,7 @@ class RRTRequestPageState extends State<RRTRequestPage>{
), ),
); );
Widget priceTable(BuildContext context){ Widget priceTable(BuildContext context) {
var radius = Radius.circular(8); var radius = Radius.circular(8);
String amount = widget.servicePrice.price.toString(); String amount = widget.servicePrice.price.toString();
String vat = widget.servicePrice.vat.toString(); String vat = widget.servicePrice.vat.toString();
@ -113,124 +106,107 @@ class RRTRequestPageState extends State<RRTRequestPage>{
decoration: BoxDecoration(color: Theme.of(context).appBarTheme.color, borderRadius: BorderRadius.only(topLeft: radius, topRight: radius)), decoration: BoxDecoration(color: Theme.of(context).appBarTheme.color, borderRadius: BorderRadius.only(topLeft: radius, topRight: radius)),
child: Center(child: Text(localize.approximateServiceFee, style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))), child: Center(child: Text(localize.approximateServiceFee, style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))),
), ),
pricingRow(label: localize.amountBeforeTax, value: '$amount ${localize.sar}'), pricingRow(label: localize.amountBeforeTax, value: '$amount ${localize.sar}'),
Container(height: 0.5, color: Theme.of(context).appBarTheme.color), Container(height: 0.5, color: Theme.of(context).appBarTheme.color),
pricingRow(label: localize.taxAmount, value: '$vat ${localize.sar}'), pricingRow(label: localize.taxAmount, value: '$vat ${localize.sar}'),
Container(height: 0.5, color: Theme.of(context).appBarTheme.color), Container(height: 0.5, color: Theme.of(context).appBarTheme.color),
pricingRow(label: localize.totalAmountPayable, value: '$total ${localize.sar}', labelBold: true), pricingRow(label: localize.totalAmountPayable, value: '$total ${localize.sar}', labelBold: true),
Container(height: 0.5, color: Theme.of(context).appBarTheme.color), Container(height: 0.5, color: Theme.of(context).appBarTheme.color),
], ],
); );
} }
Widget pricingRow({@required String label, @required String value, bool labelBold = false, bool valueBold = false}){ Widget pricingRow({@required String label, @required String value, bool labelBold = false, bool valueBold = false}) {
return return Container(
Container( height: 40,
height: 40, margin: EdgeInsets.symmetric(horizontal: 10), margin: EdgeInsets.symmetric(horizontal: 10),
child: Row( child: Row(
children: [ children: [
Text(label, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: labelBold ? FontWeight.bold : FontWeight.normal)), Text(label, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: labelBold ? FontWeight.bold : FontWeight.normal)),
Spacer(), Spacer(),
Container(height: 40, color: Theme.of(context).appBarTheme.color, width: 0.5,), Container(
height: 40,
color: Theme.of(context).appBarTheme.color,
width: 0.5,
),
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
width: MediaQuery.of(context).size.width * 0.25, width: MediaQuery.of(context).size.width * 0.25,
child: Text(value, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: valueBold ? FontWeight.bold : FontWeight.normal)) child: Text(value, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: valueBold ? FontWeight.bold : FontWeight.normal))),
),
], ],
), ),
); );
} }
Widget acceptPolicy() {
Widget acceptPolicy(){
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 10), padding: const EdgeInsets.symmetric(vertical: 10),
child: Row( child: Row(
children: [ children: [
Checkbox(value: acceptTerms, onChanged: (v){ Checkbox(
value: acceptTerms,
onChanged: (v) {
setState(() => acceptTerms = v); setState(() => acceptTerms = v);
}), }),
SizedBox(width: 10), SizedBox(width: 10),
Expanded( Expanded(child: Text(localize.iAcceptTermsConditions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color), maxLines: 2)),
child: Text(localize.iAcceptTermsConditions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color), maxLines: 2)
),
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
width: MediaQuery.of(context).size.width * 0.25, width: MediaQuery.of(context).size.width * 0.25,
child: TextButton( child: TextButton(
child: Text(localize.clickHere, style: TextStyle(fontSize: 12, color: Colors.blue, fontWeight: FontWeight.w400)), child: Text(localize.clickHere, style: TextStyle(fontSize: 12, color: Colors.blue, fontWeight: FontWeight.w400)),
onPressed: (){ onPressed: () {
Navigator.push( Navigator.push(context, FadePage(page: RRTAgreementPage()));
context, }),
FadePage(
page: RRTAgreementPage()));
}
),
) )
], ],
), ),
); );
} }
Widget paymentOptions()=> Container( Widget paymentOptions() => Container(
height: 30, height: 30,
alignment: Alignment.center, alignment: Alignment.center,
child: Image.asset("assets/payment_options/payment_options.png", fit: BoxFit.fill,) child: Image.asset(
); "assets/payment_options/payment_options.png",
fit: BoxFit.fill,
));
Widget actionButtons(){ Widget actionButtons() {
return Container( return Container(
margin: EdgeInsets.all(15), margin: EdgeInsets.all(15),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: MaterialButton( child: DefaultButton(
height: 50, TranslationBase.of(context).next,
color: Theme.of(context).appBarTheme.color, () {
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), if (acceptTerms)
onPressed: () { },
child: Text(localize.cancel, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),),
),
),
SizedBox(width: 20,),
Expanded(
child: MaterialButton(
height: 50,
color: Theme.of(context).appBarTheme.color,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ),
child: Text(localize.ok, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),),
onPressed: () {
if(acceptTerms)
goToPickupAddress(); goToPickupAddress();
else else
AppToast.showErrorToast(message: localize.pleaseAcceptTerms); AppToast.showErrorToast(message: localize.pleaseAcceptTerms);
} },
),
), ),
)
], ],
), ),
); );
} }
goToPickupAddress()async{ goToPickupAddress() async {
Navigator.push( Navigator.push(
context, context,
FadePage(page: RRTRequestPickupAddressPage(servicePrice: widget.servicePrice,)) FadePage(
); page: RRTRequestPickupAddressPage(
servicePrice: widget.servicePrice,
)));
} }
deleteOrder(PrescriptionsOrder order) async { deleteOrder(PrescriptionsOrder order) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
var success = await viewModel.cancelOrder(order); var success = await viewModel.cancelOrder(order);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if(success) if (success)
setState(() { setState(() {
widget.pendingOrders.remove(order); widget.pendingOrders.remove(order);
}); });

@ -107,7 +107,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
"", "",
//model.user.emailAddress, //model.user.emailAddress,
), ),
isNeedToShowButton: _tabController.index == 1, isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true,
buttonTitle: TranslationBase.of(context).schedule, buttonTitle: TranslationBase.of(context).schedule,
buttonIcon: 'assets/images/new/Boo_ Appointment.svg', buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false, showConfirmMessageDialog: false,
@ -263,10 +263,10 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
} }
void goToBookConfirm() { void goToBookConfirm() {
if (DocAvailableAppointments.areSlotsAvailable) if (DocAvailableAppointments.areAppointmentsAvailable)
navigateToBookConfirm(context); navigateToBookConfirm(context);
else else
AppToast.showErrorToast(message: "Please select Time Slot to continue"); AppToast.showErrorToast(message: TranslationBase.of(context).emptySchedule);
} }
Future navigateToBookConfirm(context) async { Future navigateToBookConfirm(context) async {

@ -1,3 +1,6 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
@ -6,6 +9,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/indicator.dart
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
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/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -15,10 +19,12 @@ import 'package:flutter/material.dart';
class SchedulePage extends StatefulWidget { class SchedulePage extends StatefulWidget {
DoctorList doctorList; DoctorList doctorList;
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
SchedulePage({ SchedulePage({
this.appo, this.appo,
this.doctorList, this.doctorList,
}); });
@override @override
_SchedulePageState createState() => _SchedulePageState(); _SchedulePageState createState() => _SchedulePageState();
} }
@ -36,6 +42,7 @@ class _SchedulePageState extends State<SchedulePage> {
bool isPageChange = false; bool isPageChange = false;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
@override @override
void initState() { void initState() {
this.doctorList = widget.doctorList; this.doctorList = widget.doctorList;
@ -67,7 +74,7 @@ class _SchedulePageState extends State<SchedulePage> {
isShowDecPage: false, isShowDecPage: false,
body: SizedBox( body: SizedBox(
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
child: Stack( child: model.freeSlots.length > 0 ? Stack(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 40), margin: EdgeInsets.only(top: 40),
@ -145,17 +152,28 @@ class _SchedulePageState extends State<SchedulePage> {
length: weeks.length, length: weeks.length,
) )
], ],
) : Container(
child: Center(
child: Text(TranslationBase.of(context).emptySchedule, style: TextStyle(
fontSize: 16.0,
color: Color(0xffC5272D)
)),
),
))); )));
})); }));
} }
generateWeeksSchedules() { generateWeeksSchedules() {
if (this.doctorScheduleResponse.length > 0) {
this.weeks.clear(); this.weeks.clear();
for (var i = 0; i < 8; i++) { for (var i = 0; i < 8; i++) {
var weekSchedule = generateNewWeekSchedule(i); var weekSchedule = generateNewWeekSchedule(i);
this.markWeekFreeDays(weekSchedule); this.markWeekFreeDays(weekSchedule);
this.weeks.add(weekSchedule); this.weeks.add(weekSchedule);
} }
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).emptySchedule);
}
//print(this.weeks); //print(this.weeks);
} }

@ -2260,6 +2260,8 @@ class TranslationBase {
String get covidBookAppo => localizedValues["covidBookAppo"][locale.languageCode]; String get covidBookAppo => localizedValues["covidBookAppo"][locale.languageCode];
String get emptySchedule => localizedValues["emptySchedule"][locale.languageCode];
} }

@ -346,6 +346,7 @@ class TimelineNewWidget extends StatelessWidget {
FadePage( FadePage(
page: AppointmentDetails( page: AppointmentDetails(
appo: appoitmentAllHistoryResul, appo: appoitmentAllHistoryResul,
parentIndex: 2,
))); )));
}, },
name: appoitmentAllHistoryResul.doctorNameObj, name: appoitmentAllHistoryResul.doctorNameObj,

Loading…
Cancel
Save