appointment list and detail ui changed

merge-requests/390/head
Sikander Saleem 4 years ago
parent 4152eafa17
commit d605084a91

@ -0,0 +1,6 @@
<svg id="bell_2_" data-name="bell (2)" xmlns="http://www.w3.org/2000/svg" width="19.11" height="20.848" viewBox="0 0 19.11 20.848">
<path id="Path_4605" data-name="Path 4605" d="M358.606,24.8a.869.869,0,0,1-.869-.869,9.063,9.063,0,0,0-2.671-6.45.868.868,0,0,1,1.228-1.228,10.787,10.787,0,0,1,3.18,7.678A.869.869,0,0,1,358.606,24.8Zm0,0" transform="translate(-340.364 -15.344)"/>
<path id="Path_4606" data-name="Path 4606" d="M.869,24.8A.869.869,0,0,1,0,23.928,10.787,10.787,0,0,1,3.18,16.25a.868.868,0,0,1,1.228,1.228,9.062,9.062,0,0,0-2.671,6.45A.869.869,0,0,1,.869,24.8Zm0,0" transform="translate(0 -15.344)"/>
<path id="Path_4607" data-name="Path 4607" d="M38.166,14.692A5.818,5.818,0,0,1,36.1,10.24V7.818a6.085,6.085,0,0,0-5.212-6.011V.869a.869.869,0,0,0-1.737,0v.938a6.085,6.085,0,0,0-5.212,6.011V10.24A5.825,5.825,0,0,1,21.864,14.7a1.52,1.52,0,0,0,.989,2.675H37.185a1.52,1.52,0,0,0,.981-2.682Zm0,0" transform="translate(-20.463)"/>
<path id="Path_4608" data-name="Path 4608" d="M159.481,450.606A3.263,3.263,0,0,0,162.672,448h-6.383A3.263,3.263,0,0,0,159.481,450.606Zm0,0" transform="translate(-149.925 -429.758)"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -2,14 +2,18 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -25,8 +29,9 @@ class AppointmentDetails extends StatefulWidget {
static bool isLoading = false;
static bool showFooterButton = false;
final int parentIndex;
AppointmentDetails({@required this.appo});
AppointmentDetails({@required this.appo, this.parentIndex});
@override
_AppointmentDetailsState createState() => _AppointmentDetailsState();
@ -37,6 +42,8 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
List<DoctorRateDetails> doctorDetailsList = List();
ToDoCountProviderModel toDoProvider;
@override
void initState() {
_tabController = new TabController(length: 2, vsync: this);
@ -55,179 +62,235 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold(
appBarTitle: widget.appo.doctorNameObj,
isShowAppBar: true,
showNewAppBar: true,
backgroundColor: Color(0xffF8F8F8),
backgroundColor: Colors.white,
showNewAppBarTitle: true,
bottomSheet: AppointmentDetails.showFooterButton
? Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: goToBookConfirm,
child: Text(TranslationBase.of(context).bookNow, style: TextStyle(fontSize: 18.0)),
),
),
)
: null,
body: Container(
color: new Color(0xFFf8f8f8),
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
// Container(
// margin: EdgeInsets.only(top: 20.0),
// alignment: Alignment.center,
// child: ClipRRect(
// borderRadius: BorderRadius.circular(100.0),
// child: Image.network(widget.appo.doctorImageURL, fit: BoxFit.fill, height: 120.0, width: 120.0),
// ),
// ),
// Container(
// margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0),
// alignment: Alignment.center,
// child:
// Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0, color: Colors.grey[900], letterSpacing: 1.0)),
// ),
// Container(
// margin: EdgeInsets.only(top: 10.0),
// alignment: Alignment.center,
// child: Text(getDoctorSpeciality(widget.appo.doctorSpeciality), style: TextStyle(fontSize: 12.0, color: Colors.grey[900], letterSpacing: 1.0)),
// ),
// Container(
// margin: EdgeInsets.only(top: 5.0),
// alignment: Alignment.center,
// child: RatingBar.readOnly(
// initialRating: widget.appo.actualDoctorRate.toDouble(),
// size: 35.0,
// filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
// ),
// InkWell(
// onTap: () {
// getDoctorRatingsDetails();
// },
// child: Container(
// margin: EdgeInsets.only(top: 5.0),
// alignment: Alignment.center,
// child: Text("(" + widget.appo.noOfPatientsRate.toString() + " " + TranslationBase.of(context).reviews + ")",
// style: TextStyle(
// fontSize: 14.0,
// color: Colors.blue[800],
// letterSpacing: 1.0,
// decoration: TextDecoration.underline,
// )),
// ),
// ),
// Container(
// alignment: Alignment.center,
// child: Text(DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(widget.appo.appointmentDate), projectViewModel.isArabic ? "ar" : "en")),
// ),
// Container(
// alignment: Alignment.center,
// child: Text(widget.appo.startTime.substring(0, 5)),
// ),
// Container(
// margin: EdgeInsets.only(top: 10.0),
// child: Divider(
// color: Colors.grey[500],
// ),
// ),
DoctorHeader(
headerModel: HeaderModel(
widget.appo.doctorTitle + " " + widget.appo.doctorNameObj,
widget.appo.doctorImageURL,
widget.appo.doctorSpeciality,
"",
widget.appo.projectName,
DateUtil.convertStringToDate(widget.appo.appointmentDate),
widget.appo.startTime.substring(0, 5),
null,
widget.appo.doctorRate,
widget.appo.actualDoctorRate,
widget.appo.noOfPatientsRate,
"",
//model.user.emailAddress,
),
isNeedToShowButton: _tabController.index == 1,
buttonTitle: TranslationBase.of(context).schedule,
buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false,
onRatingAndReviewTap: getDoctorRatingsDetails,
onTap: () {},
bottomSheet: _bottomButtons(),
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
// Container(
// margin: EdgeInsets.only(top: 20.0),
// alignment: Alignment.center,
// child: ClipRRect(
// borderRadius: BorderRadius.circular(100.0),
// child: Image.network(widget.appo.doctorImageURL, fit: BoxFit.fill, height: 120.0, width: 120.0),
// ),
// ),
// Container(
// margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0),
// alignment: Alignment.center,
// child:
// Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0, color: Colors.grey[900], letterSpacing: 1.0)),
// ),
// Container(
// margin: EdgeInsets.only(top: 10.0),
// alignment: Alignment.center,
// child: Text(getDoctorSpeciality(widget.appo.doctorSpeciality), style: TextStyle(fontSize: 12.0, color: Colors.grey[900], letterSpacing: 1.0)),
// ),
// Container(
// margin: EdgeInsets.only(top: 5.0),
// alignment: Alignment.center,
// child: RatingBar.readOnly(
// initialRating: widget.appo.actualDoctorRate.toDouble(),
// size: 35.0,
// filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
// ),
// InkWell(
// onTap: () {
// getDoctorRatingsDetails();
// },
// child: Container(
// margin: EdgeInsets.only(top: 5.0),
// alignment: Alignment.center,
// child: Text("(" + widget.appo.noOfPatientsRate.toString() + " " + TranslationBase.of(context).reviews + ")",
// style: TextStyle(
// fontSize: 14.0,
// color: Colors.blue[800],
// letterSpacing: 1.0,
// decoration: TextDecoration.underline,
// )),
// ),
// ),
// Container(
// alignment: Alignment.center,
// child: Text(DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(widget.appo.appointmentDate), projectViewModel.isArabic ? "ar" : "en")),
// ),
// Container(
// alignment: Alignment.center,
// child: Text(widget.appo.startTime.substring(0, 5)),
// ),
// Container(
// margin: EdgeInsets.only(top: 10.0),
// child: Divider(
// color: Colors.grey[500],
// ),
// ),
DoctorHeader(
headerModel: HeaderModel(
widget.appo.doctorTitle + " " + widget.appo.doctorNameObj,
widget.appo.doctorImageURL,
widget.appo.doctorSpeciality,
"",
widget.appo.projectName,
DateUtil.convertStringToDate(widget.appo.appointmentDate),
widget.appo.startTime.substring(0, 5),
null,
widget.appo.doctorRate,
widget.appo.actualDoctorRate,
widget.appo.noOfPatientsRate,
"",
//model.user.emailAddress,
),
SizedBox(height: 10),
TabBar(
onTap: (index) {
setState(() {
if (index == 1) {
if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor) {
_tabController.index = _tabController.previousIndex;
AppointmentDetails.showFooterButton = false;
} else {
AppointmentDetails.showFooterButton = true;
}
isNeedToShowButton: _tabController.index == 1,
buttonTitle: TranslationBase.of(context).schedule,
buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false,
onRatingAndReviewTap: getDoctorRatingsDetails,
onTap: () {},
),
SizedBox(height: 10),
TabBar(
onTap: (index) {
setState(() {
if (index == 1) {
if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor) {
_tabController.index = _tabController.previousIndex;
AppointmentDetails.showFooterButton = false;
} else {
AppointmentDetails.showFooterButton = true;
}
});
},
tabs: [
Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))),
widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor
? Tab(
child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)),
)
: Tab(
child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.black)),
)
],
controller: _tabController,
),
],
),
}
});
},
tabs: [
Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))),
widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor
? Tab(
child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)),
)
: Tab(
child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.black)),
)
],
controller: _tabController,
),
],
),
Container(
height: MediaQuery.of(context).size.height * 0.87,
child: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton),
DocAvailableAppointments(doctor: getDoctorObject(), isLiveCareAppointment: widget.appo.isLiveCareAppointment)
],
controller: _tabController,
),
),
Container(
height: MediaQuery.of(context).size.height * 0.87,
color: Color(0xffF8F8F8),
child: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton),
DocAvailableAppointments(doctor: getDoctorObject(), isLiveCareAppointment: widget.appo.isLiveCareAppointment)
],
controller: _tabController,
),
],
),
),
],
),
),
);
}
Widget _bottomButtons() {
if (widget.parentIndex == null) {
return null;
} else {
List<Widget> list = [];
if (widget.parentIndex == 0 && _tabController.index == 0) {
list.add(
Expanded(
child: DefaultButton(
TranslationBase.of(context).cancel,
() {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).cancelAppoMsg,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: cancelAppointment,
cancelFunction: () => {});
dialog.showAlertDialog(context);
},
color: Color(0xffEAEAEA),
textColor: Color(0xff000000),
),
),
);
list.add(
SizedBox(width: 8),
);
list.add(
Expanded(
child: DefaultButton(
TranslationBase.of(context).confirm,
confirmAppointment,
color: Color(0xff359846),
),
),
);
} else if (widget.parentIndex == 1 && _tabController.index == 0) {
list.add(
Expanded(
child: DefaultButton(
TranslationBase.of(context).cancel,
() => {
// Navigator.of(context).push(FadePage(page: Register())),
},
color: Color(0xffEAEAEA),
textColor: Color(0xff000000),
),
),
);
} else if (_tabController.index == 1) {
list.add(
Expanded(
child: DefaultButton(
TranslationBase.of(context).bookNow,
DocAvailableAppointments.areSlotsAvailable ? goToBookConfirm : null,
color: Color(0xFFD02127),
disabledColor: Color(0xff28323A).withOpacity(0.3),
),
),
);
}
if (list.isEmpty) {
return null;
} else
return Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: Row(
mainAxisSize: MainAxisSize.min,
children: list,
),
);
}
}
void enableFooterButton() {
setState(() {
AppointmentDetails.showFooterButton = true;
@ -498,4 +561,54 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
void openSchedule() {
Navigator.push(context, FadePage(page: SchedulePage(getDoctorObject())));
}
confirmAppointment() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, widget.appo.projectID, widget.appo.isLiveCareAppointment, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
Navigator.of(context).pop();
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
cancelAppointment() {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.cancelAppointment(widget.appo, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res);
if (res['MessageStatus'] == 1) {
getToDoCount();
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
Navigator.of(context).pop();
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
getToDoCount() {
toDoProvider.setState(0, true);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true);
} else {}
}).catchError((err) {
print(err);
});
}
}

@ -44,8 +44,6 @@ class MyAppointments extends StatefulWidget {
}
class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProviderStateMixin {
TabController _tabController;
bool isDataLoaded = false;
var sharedPref = new AppSharedPreferences();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
@ -54,9 +52,10 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
FilterType filterType;
int _currentPage = 0;
@override
void initState() {
_tabController = new TabController(length: 3, vsync: this);
filterType = FilterType.Clinic;
WidgetsBinding.instance.addPostFrameCallback((_) {
if (Provider.of<ProjectViewModel>(context, listen: false).isLogin) getPatientAppointmentHistory();
@ -68,6 +67,11 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
@ -77,25 +81,21 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
showNewAppBar: true,
backgroundColor: Color(0xffF8F8F8),
showNewAppBarTitle: true,
showDropDown: true,
dropdownIndexValue: _currentPage,
dropDownIndexChange: (index) {
setState(() {
_currentPage = index;
});
},
dropDownList: [
TranslationBase.of(context).booked,
TranslationBase.of(context).confirmed,
TranslationBase.of(context).arrived,
],
description: TranslationBase.of(context).infoMyAppointments,
body: Container(
child: Column(children: [
TabBar(
tabs: [
Tab(child: Text(TranslationBase.of(context).booked, style: TextStyle(color: Colors.black))),
Tab(
child: Text(TranslationBase.of(context).confirmed, style: TextStyle(color: Colors.black)),
),
Tab(
child: Text(TranslationBase.of(context).arrived, style: TextStyle(color: Colors.black)),
)
],
controller: _tabController,
),
Divider(
color: Colors.grey[600],
thickness: 0.5,
),
Row(
children: [
MyTabView(TranslationBase.of(context).byClinic, FilterType.Clinic, filterType, () {
@ -106,12 +106,23 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
}),
],
),
SizedBox(height: 20),
Padding(
padding: EdgeInsets.only(left: 21, right: 21),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
myRadioButton(TranslationBase.of(context).booked, 0),
myRadioButton(TranslationBase.of(context).confirmed, 1),
myRadioButton(TranslationBase.of(context).arrived, 2),
],
),
),
isDataLoaded
? Expanded(
child: new TabBarView(
physics: NeverScrollableScrollPhysics(),
child: IndexedStack(
index: _currentPage,
children: [getBookedAppointments(), getConfirmedAppointments(), getArrivedAppointments()],
controller: _tabController,
),
)
: Container(),
@ -273,23 +284,25 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
openAppointmentsTab() async {
var flag = await this.sharedPref.getInt(IS_SEARCH_APPO);
int index;
if (flag == 1) {
_tabController.index = 0;
index = 0;
} else if (flag == 2) {
_tabController.index = 1;
index = 1;
} else if (flag == 3) {
_tabController.index = 2;
index = 2;
} else {
if (widget._patientBookedAppointmentListClinic.length != 0) {
_tabController.index = 0;
index = 0;
} else if (widget._patientConfirmedAppointmentListClinic.length != 0) {
_tabController.index = 1;
index = 1;
} else if (widget._patientArrivedAppointmentListClinic.length != 0) {
_tabController.index = 2;
return;
index = 2;
// return;
}
}
_currentPage = index;
}
Widget getBookedAppointments() {
@ -328,7 +341,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
Widget _appointmentExpandableList(List<PatientAppointmentList> _patientAppointmentList) {
return ListView.separated(
physics: BouncingScrollPhysics(),
// padding: EdgeInsets.only(left: 21, right: 21),
padding: EdgeInsets.only(top: 12),
separatorBuilder: (context, index) {
return Container(
height: 1,
@ -347,22 +360,33 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
itemBuilder: (context, _index) {
AppoitmentAllHistoryResultList _appointmentResult = _appointmentAllHistoryResultList[_index];
bool _isSortByClinic = filterType == FilterType.Clinic;
return DoctorCard(
onTap: () => Navigator.push(context, FadePage(page: AppointmentDetails(appo: _appointmentResult))).then((value) {
getPatientAppointmentHistory();
}),
isInOutPatient: _appointmentResult.isInOutPatient,
name: _appointmentResult.doctorTitle + " " + _appointmentResult.doctorNameObj,
// billNo: _appointmentResult.invoiceNo,
profileUrl: _appointmentResult.doctorImageURL,
subName: _isSortByClinic ? _appointmentResult.projectName : _appointmentResult.clinicName,
isLiveCareAppointment: _appointmentResult.isLiveCareAppointment,
date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate),
isSortByClinic: _isSortByClinic,
rating: _appointmentResult.actualDoctorRate + 0.0,
appointmentTime: _appointmentResult.startTime.substring(0, 5),
//projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(labOrder.orderDate) : DateUtil.getMonthDayYearDateFormatted(labOrder.orderDate),
);
onTap: () => Navigator.push(
context,
FadePage(
page: AppointmentDetails(
appo: _appointmentResult,
parentIndex: _currentPage,
))).then((value) {
getPatientAppointmentHistory();
}),
isInOutPatient: _appointmentResult.isInOutPatient,
name: _appointmentResult.doctorTitle + " " + _appointmentResult.doctorNameObj,
// billNo: _appointmentResult.invoiceNo,
profileUrl: _appointmentResult.doctorImageURL,
subName: _isSortByClinic ? _appointmentResult.projectName : _appointmentResult.clinicName,
isLiveCareAppointment: _appointmentResult.isLiveCareAppointment,
date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate),
isSortByClinic: _isSortByClinic,
rating: _appointmentResult.actualDoctorRate + 0.0,
appointmentTime: _appointmentResult.startTime.substring(0, 5),
remainingTimeInMinutes: (_appointmentResult.patientStatusType == AppointmentType.BOOKED || _appointmentResult.patientStatusType == AppointmentType.CONFIRMED)
? _appointmentResult.remaniningHoursTocanPay
: null
//projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(labOrder.orderDate) : DateUtil.getMonthDayYearDateFormatted(labOrder.orderDate),
);
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: _appointmentAllHistoryResultList.length),
@ -385,4 +409,37 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
this.filterType = filterType;
});
}
Widget myRadioButton(String _label, int _value) {
return Row(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
width: 22,
height: 22,
child: Radio(
value: _value,
activeColor: _value == _currentPage ? Color(0xffD02127) : Color(0xffE8E8E8),
groupValue: _currentPage,
onChanged: (index) {
setState(() {
_currentPage = index;
});
//_pageController.animateToPage(index, duration: Duration(milliseconds: 250), curve: Curves.easeInOut);
},
),
),
SizedBox(width: 10),
Text(
_label,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Color(0xff575757),
letterSpacing: -0.56,
),
),
],
);
}
}

@ -3,41 +3,41 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
class BookedButtons {
var buttons = [
{
"title": TranslationBase.of(AppGlobal.context).confirm,
"subtitle": TranslationBase.of(AppGlobal.context).appointment,
"icon": "assets/images/new-design/confirm_icon.png",
"caller": "confirmAppointment"
},
// {
// "title": TranslationBase.of(AppGlobal.context).confirm,
// "subtitle": TranslationBase.of(AppGlobal.context).appointment,
// "icon": "assets/images/new-design/confirm_icon.png",
// "caller": "confirmAppointment",
// },
{
"title": TranslationBase.of(AppGlobal.context).reschedule,
"subtitle": TranslationBase.of(AppGlobal.context).appointment,
"icon": "assets/images/new-design/reschedule_icon.png",
"caller": "openReschedule"
},
{
"title": TranslationBase.of(AppGlobal.context).cancel_nocaps,
"subtitle": TranslationBase.of(AppGlobal.context).appointment,
"icon": "assets/images/new-design/cancel_icon.png",
"caller": "onCancelAppointment"
"icon": "reschedule.svg",
"caller": "openReschedule",
},
// {
// "title": TranslationBase.of(AppGlobal.context).cancel_nocaps,
// "subtitle": TranslationBase.of(AppGlobal.context).appointment,
// "icon": "assets/images/new-design/cancel_icon.png",
// "caller": "onCancelAppointment",
// },
{
"title": TranslationBase.of(AppGlobal.context).raise,
"subtitle": TranslationBase.of(AppGlobal.context).complaint,
"icon": "assets/images/new-design/Complaint_icon.png",
"caller": "insertComplaint"
"icon": "raise_comp.svg",
"caller": "insertComplaint",
},
{
"title": TranslationBase.of(AppGlobal.context).add,
"subtitle": TranslationBase.of(AppGlobal.context).reminder,
"icon": "assets/images/new-design/reminder_icon.png",
"caller": "addReminder"
"icon": "add_reminder.svg",
"caller": "addReminder",
},
{
"title": TranslationBase.of(AppGlobal.context).hospital,
"subtitle": TranslationBase.of(AppGlobal.context).location,
"icon": "assets/images/new-design/location_icon.png",
"caller": "navigateToProject"
"icon": "hosp_location.svg",
"caller": "navigateToProject",
}
];
}

@ -24,7 +24,7 @@ class BookedButtonsAllowCheckIn {
{
"title": TranslationBase.of(AppGlobal.context).raise,
"subtitle": TranslationBase.of(AppGlobal.context).complaint,
"icon": "assets/images/new-design/Complaint_icon.png",
"icon": "raise_comp.svg",
"caller": "insertComplaint",
},
{

@ -3,47 +3,22 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
class ConfirmedButtons {
var buttons = [
{
"title": TranslationBase.of(AppGlobal.context).reschedule,
"subtitle": TranslationBase.of(AppGlobal.context).appointment,
"icon": "assets/images/new-design/reschedule_icon.png",
"caller": "openReschedule"
},
{"title": TranslationBase.of(AppGlobal.context).reschedule, "subtitle": TranslationBase.of(AppGlobal.context).appointment, "icon": "reschedule.svg", "caller": "openReschedule"},
{
"title": TranslationBase.of(AppGlobal.context).cancel_nocaps,
"subtitle": TranslationBase.of(AppGlobal.context).appointment,
"icon": "assets/images/new-design/cancel_icon.png",
"caller": "onCancelAppointment"
},
{
"title": TranslationBase.of(AppGlobal.context).raise,
"subtitle": TranslationBase.of(AppGlobal.context).complaint,
"icon": "assets/images/new-design/Complaint_icon.png",
"caller": "insertComplaint"
},
{
"title": TranslationBase.of(AppGlobal.context).add,
"subtitle": TranslationBase.of(AppGlobal.context).reminder,
"icon": "assets/images/new-design/reminder_icon.png",
"caller": "addReminder"
},
{
"title": TranslationBase.of(AppGlobal.context).hospital,
"subtitle": TranslationBase.of(AppGlobal.context).location,
"icon": "assets/images/new-design/location_icon.png",
"caller": "navigateToProject"
},
{"title": TranslationBase.of(AppGlobal.context).raise, "subtitle": TranslationBase.of(AppGlobal.context).complaint, "icon": "raise_comp.svg", "caller": "insertComplaint"},
{"title": TranslationBase.of(AppGlobal.context).add, "subtitle": TranslationBase.of(AppGlobal.context).reminder, "icon": "add_reminder.svg", "caller": "addReminder"},
{"title": TranslationBase.of(AppGlobal.context).hospital, "subtitle": TranslationBase.of(AppGlobal.context).location, "icon": "hosp_location.svg", "caller": "navigateToProject"},
// {
// "title": "Generate",
// "subtitle": "Visit Ticket",
// "icon": "assets/images/new-design/generate_visit_ticket.png",
// "caller": "visitTicket"
// },
{
"title": TranslationBase.of(AppGlobal.context).online,
"subtitle": TranslationBase.of(AppGlobal.context).payment,
"icon": "assets/images/new-design/check-in.png",
"caller": "goToTodoList"
}
{"title": TranslationBase.of(AppGlobal.context).online, "subtitle": TranslationBase.of(AppGlobal.context).payment, "icon": "online_payment.svg", "caller": "goToTodoList"}
];
}

@ -51,8 +51,6 @@ class AppointmentActions extends StatefulWidget {
class _AppointmentActionsState extends State<AppointmentActions> {
List<AppoDetailsButton> appoButtonsList = [];
ToDoCountProviderModel toDoProvider;
@override
void initState() {
_getAppointmentActionButtons();
@ -62,7 +60,6 @@ class _AppointmentActionsState extends State<AppointmentActions> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
var size = MediaQuery.of(context).size;
final double itemHeight = projectViewModel.isArabic ? ((size.height - kToolbarHeight - 24) * 0.5) / 2 : ((size.height - kToolbarHeight - 24) * 0.45) / 2;
final double itemWidth = size.width / 2;
@ -83,6 +80,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
subTitle: appoButtonsList[index].subtitle,
hasBadge: true,
isEnable: projectViewModel.havePrivilege(5),
imgColor: Color(0xff28323A),
),
);
},
@ -166,20 +164,20 @@ class _AppointmentActionsState extends State<AppointmentActions> {
});
break;
case "onCancelAppointment":
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).cancelAppoMsg,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {cancelAppointment()},
cancelFunction: () => {});
dialog.showAlertDialog(context);
break;
case "confirmAppointment":
confirmAppointment();
break;
// case "onCancelAppointment":
// ConfirmDialog dialog = new ConfirmDialog(
// context: context,
// confirmMessage: TranslationBase.of(context).cancelAppoMsg,
// okText: TranslationBase.of(context).confirm,
// cancelText: TranslationBase.of(context).cancel_nocaps,
// okFunction: () => {cancelAppointment()},
// cancelFunction: () => {});
// dialog.showAlertDialog(context);
// break;
// case "confirmAppointment":
// confirmAppointment();
// break;
case "navigateToProject":
openMap(double.parse(widget.appo.latitude), double.parse(widget.appo.longitude));
@ -384,38 +382,38 @@ class _AppointmentActionsState extends State<AppointmentActions> {
});
}
cancelAppointment() {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.cancelAppointment(widget.appo, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res);
if (res['MessageStatus'] == 1) {
getToDoCount();
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
Navigator.of(context).pop();
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
getToDoCount() {
toDoProvider.setState(0, true);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true);
} else {}
}).catchError((err) {
print(err);
});
}
// cancelAppointment() {
// ConfirmDialog.closeAlertDialog(context);
// GifLoaderDialogUtils.showMyDialog(context);
// DoctorsListService service = new DoctorsListService();
// service.cancelAppointment(widget.appo, context).then((res) {
// GifLoaderDialogUtils.hideDialog(context);
// print(res);
// if (res['MessageStatus'] == 1) {
// getToDoCount();
// AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
// Navigator.of(context).pop();
// } else {
// AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
// }
// }).catchError((err) {
// GifLoaderDialogUtils.hideDialog(context);
// print(err);
// });
// }
// getToDoCount() {
// toDoProvider.setState(0, true);
// ClinicListService service = new ClinicListService();
// service.getActiveAppointmentNo(context).then((res) {
// print(res['AppointmentActiveNumber']);
// if (res['MessageStatus'] == 1) {
// toDoProvider.setState(res['AppointmentActiveNumber'], true);
// } else {}
// }).catchError((err) {
// print(err);
// });
// }
openAppointmentLabResults() {
GifLoaderDialogUtils.showMyDialog(context);
@ -613,22 +611,22 @@ class _AppointmentActionsState extends State<AppointmentActions> {
});
}
confirmAppointment() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, widget.appo.projectID, widget.appo.isLiveCareAppointment, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
Navigator.of(context).pop();
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
// confirmAppointment() {
// GifLoaderDialogUtils.showMyDialog(context);
// DoctorsListService service = new DoctorsListService();
// service.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, widget.appo.projectID, widget.appo.isLiveCareAppointment, context).then((res) {
// GifLoaderDialogUtils.hideDialog(context);
// if (res['MessageStatus'] == 1) {
// AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
// Navigator.of(context).pop();
// } else {
// AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
// }
// }).catchError((err) {
// GifLoaderDialogUtils.hideDialog(context);
// print(err);
// });
// }
navigateToInsuranceApprovals(int appoNo) {
Navigator.push(context, FadePage(page: InsuranceApproval(appointmentNo: appoNo)));

@ -52,6 +52,7 @@ class LabsHomePage extends StatelessWidget {
widthFactor: 1.0,
child: ListView.separated(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(top: 12),
separatorBuilder: (context, index) {
return Container(
height: 1,

@ -55,6 +55,7 @@ class RadiologyHomePage extends StatelessWidget {
widthFactor: 1.0,
child: ListView.separated(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(top: 12),
separatorBuilder: (context, index) {
return Container(
height: 1,

@ -8,6 +8,9 @@ import 'package:diplomaticquarterapp/widgets/others/rounded_container_widget.dar
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:flutter_countdown_timer/countdown_timer_controller.dart';
import 'package:flutter_countdown_timer/current_remaining_time.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
@ -25,6 +28,7 @@ class DoctorCard extends StatelessWidget {
final bool isSortByClinic;
final String appointmentTime;
final bool isParentAppointment;
final int remainingTimeInMinutes;
DoctorCard(
{this.name,
@ -39,6 +43,7 @@ class DoctorCard extends StatelessWidget {
this.isInOutPatient,
this.isLiveCareAppointment = false,
this.appointmentTime,
this.remainingTimeInMinutes,
this.isParentAppointment = false});
@override
@ -146,24 +151,41 @@ class DoctorCard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
myRichText(isSortByClinic ? TranslationBase.of(context).hospital : TranslationBase.of(context).clinic + ":", subName),
if (rating == null) myRichText(TranslationBase.of(context).invoiceNo, billNo ?? ""),
if (rating != null)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: rating,
size: 16.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if (rating == null) myRichText(TranslationBase.of(context).invoiceNo, billNo ?? ""),
if (rating != null)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: rating,
size: 16.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
],
),
],
),
if (remainingTimeInMinutes != null)
CountdownTimer(
controller: CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (remainingTimeInMinutes * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime time) {
return time != null
? Text(
"${time.days ?? 0}:${time.hours ?? 0}:${time.min}:${time.sec}",
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xffD02127), letterSpacing: -0.48, height: 18 / 12),
)
: Container();
},
),
],
),
],
),
),

@ -17,14 +17,9 @@ class MedicalProfileItem extends StatelessWidget {
final String subTitle;
final bool hasBadge = false;
bool isEnable;
Color imgColor;
MedicalProfileItem({
@required this.imagePath,
@required this.title,
@required this.subTitle,
hasBadge,
this.isEnable = true,
});
MedicalProfileItem({@required this.imagePath, @required this.title, @required this.subTitle, hasBadge, this.isEnable = true, this.imgColor});
@override
Widget build(BuildContext context) {
@ -55,6 +50,7 @@ class MedicalProfileItem extends StatelessWidget {
"assets/images/new/services/$imagePath",
height: SizeConfig.widthMultiplier * 7,
width: SizeConfig.widthMultiplier * 7,
color: imgColor,
),
mFlex(2),
Text(

@ -52,11 +52,13 @@ class TimeLineWidget extends StatelessWidget {
onTap: () {
//AppointmentDetails
Navigator.push(
context,
FadePage(
page: AppointmentDetails(
context,
FadePage(
page: AppointmentDetails(
appo: appoitmentAllHistoryResul,
)));
),
),
);
},
name: appoitmentAllHistoryResul.doctorNameObj,
url: appoitmentAllHistoryResul.doctorImageURL,
@ -84,10 +86,7 @@ class TimeLineWidget extends StatelessWidget {
height: 4,
),
Texts(
DateUtil.getMonthDayYearLangDateFormatted(
DateUtil.convertStringToDate(
appoitmentAllHistoryResul.appointmentDate),
projectViewModel.isArabic ? "ar" : "en"),
DateUtil.getMonthDayYearLangDateFormatted(DateUtil.convertStringToDate(appoitmentAllHistoryResul.appointmentDate), projectViewModel.isArabic ? "ar" : "en"),
color: Colors.white,
fontSize: 12.5,
fontWeight: FontWeight.normal,
@ -116,10 +115,7 @@ class TimeLineWidget extends StatelessWidget {
fontWeight: FontWeight.normal,
),
Texts(
DateUtil.getMonthDayYearLangDateFormatted(
DateUtil.convertStringToDate(
appoitmentAllHistoryResul.appointmentDate),
projectViewModel.isArabic ? "ar" : "en"),
DateUtil.getMonthDayYearLangDateFormatted(DateUtil.convertStringToDate(appoitmentAllHistoryResul.appointmentDate), projectViewModel.isArabic ? "ar" : "en"),
color: Colors.white,
fontSize: 12.5,
fontWeight: FontWeight.normal,

@ -78,76 +78,79 @@ class DoctorHeader extends StatelessWidget {
headerModel.time ?? DateUtil.formatDateToTime(headerModel.date),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
),
// Padding(
// padding: const EdgeInsets.only(top: 8.0),
// child: Image.network(headerModel.nationalityFlagURL ?? "", height: 16),
// ),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Image.network(headerModel.nationalityFlagURL ?? "", height: 16),
),
],
)
],
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: onRatingAndReviewTap,
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(width: 21),
RatingBar.readOnly(
initialRating: headerModel.actualDoctorRate + 0.0,
size: 15.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
SizedBox(width: 6),
Text(
"${headerModel.totalReviews} ${TranslationBase.of(context).reviews}",
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.48,
height: 18 / 12,
decoration: onRatingAndReviewTap != null ? TextDecoration.underline : null,
SizedBox(
height: 43,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: onRatingAndReviewTap,
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(width: 21),
RatingBar.readOnly(
initialRating: headerModel.actualDoctorRate + 0.0,
size: 15.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
),
],
),
),
isNeedToShowButton
? InkWell(
onTap: () {
if (showConfirmMessageDialog)
showConfirmMessage(context, onTap, headerModel.email);
else
onTap();
},
child: Container(
padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15),
decoration: BoxDecoration(color: Color(0XFFD02127), borderRadius: BorderRadius.only(topLeft: Radius.circular(10))),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
SvgPicture.asset(buttonIcon ?? 'assets/images/new/email.svg', width: 19.0),
SizedBox(width: 6),
Text(
buttonTitle == null ? TranslationBase.of(context).sendEmail : buttonTitle,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 25 / 16),
),
],
SizedBox(width: 6),
Text(
"${headerModel.totalReviews} ${TranslationBase.of(context).reviews}",
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.48,
height: 18 / 12,
decoration: onRatingAndReviewTap != null ? TextDecoration.underline : null,
),
),
)
: Container(),
],
],
),
),
isNeedToShowButton
? InkWell(
onTap: () {
if (showConfirmMessageDialog)
showConfirmMessage(context, onTap, headerModel.email);
else
onTap();
},
child: Container(
padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15),
decoration: BoxDecoration(color: Color(0XFFD02127), borderRadius: BorderRadius.only(topLeft: Radius.circular(10))),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
SvgPicture.asset(buttonIcon ?? 'assets/images/new/email.svg', width: 19.0),
SizedBox(width: 6),
Text(
buttonTitle == null ? TranslationBase.of(context).sendEmail : buttonTitle,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 25 / 16),
),
],
),
),
)
: Container(),
],
),
)
],
),

@ -1,17 +1,18 @@
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
class MyTabView extends StatelessWidget {
final String title;
final FilterType value;
final FilterType groupValue;
final VoidCallback onPressed;
MyTabView(
this.title,
this.value,
this.groupValue,
this.onPressed, {
Key key,
}) : super(key: key);
this.title,
this.value,
this.groupValue,
this.onPressed, {
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -27,7 +28,6 @@ class MyTabView extends StatelessWidget {
title,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: value == groupValue ? Color(0xff2B353E) : Color(0xff575757),
letterSpacing: -0.48,

@ -1,3 +1,4 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:badges/badges.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
@ -11,7 +12,9 @@ import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart';
@ -61,36 +64,46 @@ class AppScaffold extends StatelessWidget {
final List<ImagesInfo> imagesInfo;
final bool isHelp;
final String icon;
final bool showDropDown;
final int dropdownIndexValue;
List<String> dropDownList;
final Function(int) dropDownIndexChange;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AppBarWidget appBar;
AppScaffold(
{@required this.body,
this.appBarTitle = '',
this.isLoading = false,
this.isShowAppBar = false,
this.showNewAppBar = false,
this.showNewAppBarTitle = false,
this.hasAppBarParam,
this.bottomSheet,
this.baseViewModel,
this.floatingActionButton,
this.isPharmacy = false,
this.showPharmacyCart = true,
this.isOfferPackages = false,
this.showOfferPackagesCart = false,
this.title,
this.description,
this.isShowDecPage = true,
this.isBottomBar,
this.backgroundColor,
this.preferredSize = 0.0,
this.appBarIcons,
this.infoList,
this.isHelp = false,
this.icon,
this.showHomeAppBarIcon = true,
this.imagesInfo});
AppScaffold({
@required this.body,
this.appBarTitle = '',
this.isLoading = false,
this.isShowAppBar = false,
this.showNewAppBar = false,
this.showNewAppBarTitle = false,
this.hasAppBarParam,
this.bottomSheet,
this.baseViewModel,
this.floatingActionButton,
this.isPharmacy = false,
this.showPharmacyCart = true,
this.isOfferPackages = false,
this.showOfferPackagesCart = false,
this.title,
this.description,
this.isShowDecPage = true,
this.isBottomBar,
this.backgroundColor,
this.preferredSize = 0.0,
this.appBarIcons,
this.infoList,
this.isHelp = false,
this.icon,
this.showHomeAppBarIcon = true,
this.imagesInfo,
this.showDropDown = false,
this.dropDownList,
this.dropdownIndexValue,
this.dropDownIndexChange,
});
AppScaffold setOnAppBarCartClick(VoidCallback onClick) {
_onCartClick = onClick;
@ -106,6 +119,10 @@ class AppScaffold extends StatelessWidget {
? NewAppBarWidget(
title: appBarTitle,
showTitle: showNewAppBarTitle,
showDropDown: showDropDown,
dropdownIndexValue: dropdownIndexValue,
dropDownList: dropDownList ?? [],
dropDownIndexChange: dropDownIndexChange,
)
: (isShowAppBar
? appBar = AppBarWidget(
@ -154,11 +171,16 @@ class AppScaffold extends StatelessWidget {
class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
final bool showTitle;
final String title;
NewAppBarWidget({Key key, this.showTitle = false, this.title = ""}) : super(key: key);
final bool showDropDown;
final int dropdownIndexValue;
List<String> dropDownList;
final Function(int) dropDownIndexChange;
NewAppBarWidget({Key key, this.showTitle = false, this.showDropDown = false, this.title = "", this.dropDownList, this.dropdownIndexValue, this.dropDownIndexChange}) : super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppBar(
elevation: 0,
backgroundColor: showTitle ? Colors.white : Colors.transparent,
@ -174,6 +196,43 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
style: TextStyle(
fontSize: 24, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
),
),
if (showDropDown)
Container(
decoration: containerRadius(Color(0xFFF7F7F7), 30),
height: 30,
child: DropdownButtonHideUnderline(
child: ButtonTheme(
alignedDropdown: true,
child: DropdownButton<int>(
iconEnabledColor: CustomColors.grey2,
style: TextStyle(color: CustomColors.lightGreyColor, fontSize: 12),
dropdownColor: CustomColors.lightGreyColor,
value: dropdownIndexValue,
items: [
for (int i = 0; i < dropDownList.length; i++)
DropdownMenuItem<int>(
value: i,
child: AutoSizeText(
dropDownList[i],
style: TextStyle(
fontSize: 12,
fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
fontWeight: FontWeight.w600,
color: Color(0xff2B2E31),
letterSpacing: -.48,
// height: 12 / 18
),
),
)
],
onChanged: dropDownIndexChange,
underline: Container(
height: 0,
),
),
),
),
)
],
),

Loading…
Cancel
Save