From cfa3ca62b6bc5adbdfa5b3d552f64a45bc31e46a Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 30 Aug 2021 16:09:30 +0300 Subject: [PATCH] prescription tab bar improvement. --- .../MyAppointments/AppointmentDetails.dart | 2 +- lib/pages/MyAppointments/MyAppointments.dart | 10 ++- .../prescriptions_home_page.dart | 86 +++++++++---------- .../data_display/medical/doctor_card.dart | 2 +- 4 files changed, 49 insertions(+), 51 deletions(-) diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 45f104ab..f9ed2bf7 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -268,7 +268,7 @@ class _AppointmentDetailsState extends State with SingleTick list.add( Expanded( child: DefaultButton( - TranslationBase.of(context).bookNow, + TranslationBase.of(context).reviewAppointment, DocAvailableAppointments.areSlotsAvailable ? goToBookConfirm : null, color: Color(0xFFD02127), disabledColor: Color(0xff28323A).withOpacity(0.3), diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 07f10eb5..dff915cc 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -362,12 +362,14 @@ class _MyAppointmentsState extends State with SingleTickerProvid return DoctorCard( onTap: () => Navigator.push( - context, - FadePage( - page: AppointmentDetails( + context, + FadePage( + page: AppointmentDetails( appo: _appointmentResult, parentIndex: _currentPage, - ))).then((value) { + ), + ), + ).then((value) { getPatientAppointmentHistory(); }), isInOutPatient: _appointmentResult.isInOutPatient, diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart index 442c3b04..7345c3fe 100644 --- a/lib/pages/medical/prescriptions/prescriptions_home_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_home_page.dart @@ -18,8 +18,7 @@ class HomePrescriptionsPage extends StatefulWidget { _HomePrescriptionsPageState createState() => _HomePrescriptionsPageState(); } -class _HomePrescriptionsPageState extends State - with SingleTickerProviderStateMixin { +class _HomePrescriptionsPageState extends State with SingleTickerProviderStateMixin { TabController _tabController; List imagesInfo = List(); @@ -27,8 +26,10 @@ class _HomePrescriptionsPageState extends State void initState() { super.initState(); _tabController = TabController(length: 2, vsync: this); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/0.png')); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/1.png')); + imagesInfo.add(ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/1.png')); } @override @@ -50,48 +51,43 @@ class _HomePrescriptionsPageState extends State showNewAppBar: true, backgroundColor: Color(0xffF8F8F8), showNewAppBarTitle: true, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), - child: Column( - children: [ - - TabBar( - tabs: [ - Tab(child: Text(TranslationBase.of(context).prescriptions, style: TextStyle(color: Colors.black))), - Tab( - child: Text(TranslationBase.of(context).history, style: TextStyle(color: Colors.black)), - ), - - ], - controller: _tabController, - ), - Divider( - color: Colors.grey[600], - thickness: 0.5, - ), - ], + body: Column( + children: [ + TabBar( + // isScrollable: true, + controller: _tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + labelStyle: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + unselectedLabelStyle: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + tabs: [Text(TranslationBase.of(context).prescriptions), Text(TranslationBase.of(context).history)], ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - PrescriptionsPage( - prescriptionsViewModel: model, - ), - PrescriptionsHistoryPage( - prescriptionsViewModel: model, - ) - ], - ), - ) - ], - ), + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + PrescriptionsPage( + prescriptionsViewModel: model, + ), + PrescriptionsHistoryPage( + prescriptionsViewModel: model, + ) + ], + ), + ) + ], ), ), ); diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index dc3ff85a..b4f6a92a 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -132,7 +132,7 @@ class DoctorCard extends StatelessWidget { ), Text( // DateUtil.formatDateToTime(date), - appointmentTime, + appointmentTime ?? "", style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48, height: 18 / 12), ), ],