From 5903fdd8b82990817ac4ad61be3c9589f651ecd7 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 23 Mar 2021 10:13:17 +0300 Subject: [PATCH 1/2] tab bar changes --- .../search_medicine_patient_screen.dart | 51 +++++++------------ .../referral/patient_referral_screen.dart | 1 + 2 files changed, 20 insertions(+), 32 deletions(-) diff --git a/lib/screens/medicine/search_medicine_patient_screen.dart b/lib/screens/medicine/search_medicine_patient_screen.dart index 0e4d7e86..245c0602 100644 --- a/lib/screens/medicine/search_medicine_patient_screen.dart +++ b/lib/screens/medicine/search_medicine_patient_screen.dart @@ -50,17 +50,15 @@ class _SearchMedicinePatientScreen extends State child: Center( child: Container( height: 60.0, - color: Colors.white, margin: EdgeInsets.only(top: 10.0), - - width: MediaQuery.of(context).size.width, // 0.9, - // decoration: BoxDecoration( - // border: Border( - // bottom: BorderSide( - // color: Theme.of(context).dividerColor, - // width: 0.9), //width: 0.7 - // ), - // color: Colors.white), + width: MediaQuery.of(context).size.width * 0.92, // 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.9), //width: 0.7 + ), + color: Colors.white), child: TabBar( isScrollable: true, onTap: (index) { @@ -69,42 +67,31 @@ class _SearchMedicinePatientScreen extends State }); }, controller: _tabController, - indicatorWeight: 0.01, - indicatorSize: TabBarIndicatorSize.label, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.tab, + indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, - indicatorColor: Colors.grey[800], - // labelPadding: - // EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + labelPadding: + EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( - width: MediaQuery.of(context).size.width * 0.40, - decoration: BoxDecoration( - color: activeIndex == 0 - ? Colors.red[700] - : Colors.grey[200], - borderRadius: BorderRadius.circular(5)), + width: MediaQuery.of(context).size.width * 0.30, child: Center( child: AppText( TranslationBase.of(context).searchPatient, - color: activeIndex == 0 ? Colors.white : Colors.black, + color: Colors.black, fontWeight: FontWeight.bold, ), ), ), Container( - width: MediaQuery.of(context).size.width * 0.40, - decoration: BoxDecoration( - color: activeIndex == 1 - ? Colors.red[700] - : Colors.grey[200], - borderRadius: BorderRadius.circular(5)), + width: MediaQuery.of(context).size.width * 0.30, child: Center( child: AppText( - TranslationBase.of(context).searchMedicine, - fontWeight: FontWeight.bold, - color: activeIndex == 1 ? Colors.white : Colors.black, - ), + TranslationBase.of(context).searchMedicine, + fontWeight: FontWeight.bold, + color: Colors.black), ), ), ], diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index f4b04d02..80f30aad 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -55,6 +55,7 @@ class _PatientReferralScreen extends State child: TabBar( isScrollable: true, controller: _tabController, + indicatorColor: Colors.red[800], indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, From 495898f8c84d90a1872c984fbdcfc72fc717b8ab Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 23 Mar 2021 10:28:08 +0300 Subject: [PATCH 2/2] patient card --- lib/widgets/patients/PatientCard.dart | 35 +++++++++++++++------------ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 997cb83d..93a176ea 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -240,22 +240,25 @@ class PatientCard extends StatelessWidget { " : ", fontSize: 14, ), - Container( - height: 15, - width: 60, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(25), - color: HexColor("#20A169"), - ), - child: AppText( - patientInfo.startTime, - color: Colors.white, - fontSize: - 1.5 * SizeConfig.textMultiplier, - textAlign: TextAlign.center, - fontWeight: FontWeight.bold, - ), - ), + patientInfo.startTime != null + ? Container( + height: 15, + width: 60, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(25), + color: HexColor("#20A169"), + ), + child: AppText( + patientInfo.startTime, + color: Colors.white, + fontSize: 1.5 * + SizeConfig.textMultiplier, + textAlign: TextAlign.center, + fontWeight: FontWeight.bold, + ), + ) + : SizedBox(), SizedBox( width: 3.5, ),