fix taps inside in patient

merge-requests/922/head
Elham Rababh 4 years ago
parent efe25b898d
commit 25e09fa105

@ -52,11 +52,11 @@ const Map<String, Map<String, String>> localizedValues = {
"radiology": {"en": "Radiology", "ar": "الأشعة"}, "radiology": {"en": "Radiology", "ar": "الأشعة"},
"service": {"en": "Service", "ar": "خدمة"}, "service": {"en": "Service", "ar": "خدمة"},
"referral": {"en": "Referral", "ar": "الإحالة"}, "referral": {"en": "Referral", "ar": "الإحالة"},
"inPatient": {"en": "InPatients", "ar": "مرضاي"}, "inPatient": {"en": "In Patients", "ar": "مرضاي"},
"myInPatient": {"en": "My\nInPatients", "ar": "مرضاي\nالمنومين"}, "myInPatient": {"en": "My\n Patients", "ar": "مرضاي\nالمنومين"},
"myInPatientTitle": {"en": "My InPatients", "ar": "مرضاي المنومين"}, "myInPatientTitle": {"en": "My Patients", "ar": "مرضاي المنومين"},
"inPatientLabel": {"en": "InPatients", "ar": "المريض المنوم"}, "inPatientLabel": {"en": "InPatients", "ar": "المريض المنوم"},
"inPatientAll": {"en": "All InPatients", "ar": "جميع المرضى المنومين"}, "inPatientAll": {"en": "All Patients", "ar": "جميع المرضى المنومين"},
"operations": {"en": "Operations", "ar": "عمليات"}, "operations": {"en": "Operations", "ar": "عمليات"},
"patientServices": {"en": "Patient Services", "ar": "خدمات المرضى"}, "patientServices": {"en": "Patient Services", "ar": "خدمات المرضى"},
"searchMedicineDashboard": { "searchMedicineDashboard": {

@ -130,7 +130,7 @@ class _InPatientScreenState extends State<InPatientScreen>
child: TabBar( child: TabBar(
isScrollable: false, isScrollable: false,
controller: _tabController, controller: _tabController,
indicatorColor: Colors.red, indicatorColor: AppGlobal.appRedColor,
indicatorWeight: 0.001, indicatorWeight: 0.001,
indicator:BoxDecoration(), indicator:BoxDecoration(),
// indicatorSize: TabBarIndicatorSize.tab, // indicatorSize: TabBarIndicatorSize.tab,
@ -202,38 +202,14 @@ class _InPatientScreenState extends State<InPatientScreen>
bool isLast = false,}) { bool isLast = false,}) {
return Center( return Center(
child: Container( child: Container(
height: screenSize.height * 0.060, height: Helpers.getTabHeight(context),
decoration:Helpers.getBoxTabsBoxDecoration(isActive: isActive,isFirst: isFirst, isMiddle: isMiddle, isLast: isLast), decoration:Helpers.getBoxTabsBoxDecoration(isActive: isActive,isFirst: isFirst, isMiddle: isMiddle, isLast: isLast),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
AppText( Helpers.getTabText(title:title, isActive:isActive),
title,
fontSize: SizeConfig.textMultiplier * 1.5,
color: isActive ? Colors.white : AppGlobal.appTextColor,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
if (counter != -1) if (counter != -1)
Container( Helpers.getTabCounter(isActive:isActive,counter:counter)
margin: EdgeInsets.all(4),
width: 15,
height: 15,
decoration: BoxDecoration(
color: isActive ? Colors.white : AppGlobal.appRedColor,
shape: BoxShape.circle,
),
child: Center(
child: FittedBox(
child: AppText(
"$counter",
fontSize: SizeConfig.textMultiplier * 1.5,
color: !isActive ? Colors.white : AppGlobal.appRedColor,
fontWeight: FontWeight.w700,
),
),
),
),
], ],
), ),
), ),

@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -105,7 +106,7 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
children: [ children: [
Container( Container(
// color: Colors.red, // color: Colors.red,
height: screenSize.height * 0.070, height: Helpers.getTabHeight(context),
decoration: TextFieldsUtils.containerBorderDecoration( decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC), Color(0Xffffffff), Color(0xFFCCCCCC),
borderRadius: 4, borderWidth: 0), borderRadius: 4, borderWidth: 0),
@ -143,52 +144,24 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
child: Center( child: Center(
child: Container( child: Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: decoration: Helpers.getBoxTabsBoxDecoration(
TextFieldsUtils.containerBorderDecoration( isActive: _isActive,
_isActive isFirst: _times.indexOf(item) == 0,
? Color(0xFFD02127 /*B8382B*/) isLast:
: Color(0xFFEAEAEA), _times.indexOf(item) == _times.length - 1,
_isActive isMiddle: _times.indexOf(item) != 0 && _times.indexOf(item) != _times.length - 1
? Color(0xFFD02127)
: Color(0xFFEAEAEA), ),
borderRadius: 4,
borderWidth: 0),
child: Center( child: Center(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
AppText( Helpers.getTabText(title: item, isActive: _isActive),
item,
fontSize: SizeConfig.textMultiplier * 1.8,
color: _isActive
? Colors.white
: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
_isActive && _isActive &&
_activeLocation != 0 && _activeLocation != 0 &&
model.state == ViewState.Idle model.state == ViewState.Idle
? Container( ? Helpers.getTabCounter(isActive:_isActive,counter: model.filterData.length)
padding: EdgeInsets.all(2),
margin: EdgeInsets.symmetric(
horizontal: 5),
decoration: new BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.circular(50),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: new Text(
model.filterData.length.toString(),
style: new TextStyle(
color: Colors.red,
fontSize: 10),
textAlign: TextAlign.center,
),
)
: Container(), : Container(),
], ],
), ),
@ -245,7 +218,6 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
}, },
), ),
), ),
Expanded( Expanded(
child: Container( child: Container(
child: model.filterData.isEmpty child: model.filterData.isEmpty
@ -267,7 +239,8 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
.patientStatusType == .patientStatusType ==
43)) 43))
return Padding( return Padding(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0), padding: EdgeInsets.symmetric(
horizontal: 8, vertical: 0),
child: PatientCard( child: PatientCard(
patientInfo: model.filterData[index], patientInfo: model.filterData[index],
patientType: patientType, patientType: patientType,

@ -348,4 +348,45 @@ class Helpers {
), ),
); );
} }
static getTabText({String title, bool isActive = false,}){
return AppText(
title,
fontSize: SizeConfig.textMultiplier * 1.8,
color: isActive ? Colors.white : AppGlobal.appTextColor,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
);
}
static getTabHeight(BuildContext context){
final screenSize = MediaQuery.of(context).size;
return screenSize.height * 0.07;
}
static getTabCounter({bool isActive: false,int counter}){
return Container(
margin: EdgeInsets.all(4),
width: 15,
height: 15,
decoration: BoxDecoration(
color: isActive ? Colors.white : AppGlobal.appRedColor,
shape: BoxShape.circle,
),
child: Center(
child: FittedBox(
child: AppText(
"$counter",
fontSize: SizeConfig.textMultiplier * 1.5,
color: !isActive ? Colors.white : AppGlobal.appRedColor,
fontWeight: FontWeight.w700,
),
),
),
);
}
} }

Loading…
Cancel
Save