updates & fixes

merge-requests/400/head
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';
@ -21,14 +22,14 @@ 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;
@ -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();
@ -60,8 +60,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
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;
@ -82,6 +81,8 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
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,
@ -115,8 +117,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
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);
@ -132,9 +133,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
), ),
continueButton() continueButton()
], ],
) )));
)
);
} }
Widget centerTargetPoint() { Widget centerTargetPoint() {
@ -142,16 +141,10 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
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))
),
), ),
); );
} }
@ -162,13 +155,18 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
height: 50, height: 50,
child: MaterialButton( child: MaterialButton(
height: 50, color: Colors.white, height: 50,
color: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), 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,
)
], ],
), ),
), ),
@ -178,21 +176,18 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
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,
@ -221,18 +216,26 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
}, },
); );
}, },
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(
target: location,
zoom: 16.4746,
);
if (animate) if (animate)
(await mapController.future).animateCamera(CameraUpdate.newCameraPosition(mapCameraPosition),); (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 {

@ -7,6 +7,7 @@ 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';
@ -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;
@ -35,6 +37,8 @@ class RRTPlaceOrderPage extends StatelessWidget{
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,
color: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
onPressed: () {}, 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,16 +155,12 @@ 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),),
), ),
); );
} }
@ -178,13 +188,11 @@ class RRTPlaceOrderPage extends StatelessWidget{
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() {

@ -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,8 +21,8 @@ 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;
@ -37,15 +37,12 @@ class RRTRequestPageState extends State<RRTRequestPage>{
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() {
@ -66,14 +63,12 @@ class RRTRequestPageState extends State<RRTRequestPage>{
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()
], ],
); );
@ -86,12 +81,10 @@ class RRTRequestPageState extends State<RRTRequestPage>{
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,
@ -113,13 +106,10 @@ 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),
], ],
@ -127,49 +117,47 @@ class RRTRequestPageState extends State<RRTRequestPage>{
} }
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()));
}
),
) )
], ],
), ),
@ -179,8 +167,10 @@ class RRTRequestPageState extends State<RRTRequestPage>{
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(
@ -188,30 +178,16 @@ class RRTRequestPageState extends State<RRTRequestPage>{
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) ),
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) if (acceptTerms)
goToPickupAddress(); goToPickupAddress();
else else
AppToast.showErrorToast(message: localize.pleaseAcceptTerms); AppToast.showErrorToast(message: localize.pleaseAcceptTerms);
} },
),
), ),
)
], ],
), ),
); );
@ -220,12 +196,12 @@ class RRTRequestPageState extends State<RRTRequestPage>{
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);

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