diff --git a/assets/fonts/Poppins/Poppins-SemiBold.ttf b/assets/fonts/Poppins/Poppins-SemiBold.ttf new file mode 100644 index 00000000..8987d800 Binary files /dev/null and b/assets/fonts/Poppins/Poppins-SemiBold.ttf differ diff --git a/lib/config/config.dart b/lib/config/config.dart index 4c5374ae..03c74f52 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -455,6 +455,7 @@ const TIMER_MIN = 10; class AppGlobal { static var CONTEX; - static Color appPrimaryColor = Color(0xFFB9382C); + static Color appRedColor = Color(0xFFD02127); static Color appGreenColor = Color(0xFF359846); + static Color appTextColor = Color(0xFF2B353E); } diff --git a/lib/models/patient/get_clinic_by_project_id_request.dart b/lib/models/patient/get_clinic_by_project_id_request.dart index 09198dc0..47122bf1 100644 --- a/lib/models/patient/get_clinic_by_project_id_request.dart +++ b/lib/models/patient/get_clinic_by_project_id_request.dart @@ -40,7 +40,6 @@ class ClinicByProjectIdRequest { this.languageID = 2, this.stamp = "2020-06-03T11:18:19.979Z", this.iPAdress = "11.11.11.11", - this.versionID = 5.5, this.channel = 9, this.tokenID, this.sessionID = "JBXRsDl37L", @@ -53,7 +52,6 @@ class ClinicByProjectIdRequest { languageID = json['LanguageID']; stamp = json['stamp']; iPAdress = json['IPAdress']; - versionID = json['VersionID']; channel = json['Channel']; tokenID = json['TokenID']; sessionID = json['SessionID']; @@ -68,7 +66,6 @@ class ClinicByProjectIdRequest { data['LanguageID'] = this.languageID; data['stamp'] = this.stamp; data['IPAdress'] = this.iPAdress; - data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['TokenID'] = this.tokenID; data['SessionID'] = this.sessionID; diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart new file mode 100644 index 00000000..e616f1ca --- /dev/null +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -0,0 +1,170 @@ +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; +import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:flutter/material.dart'; + +import 'label.dart'; + +class DashboardReferralPatient extends StatelessWidget { + final List dashboardItemList; + final double height; + final DashboardViewModel model; + + const DashboardReferralPatient({Key key, this.dashboardItemList, this.height, this.model}) : super(key: key); + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(bottom: 20, top: 10, left: 5, right: 5), + decoration: BoxDecoration( + + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + bottomLeft: Radius.circular(20), + bottomRight: Radius.circular(20) + ), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 0, + blurRadius: 9, + offset: Offset(0, 0), // changes position of shadow + ), + ], + ), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ + Expanded( + flex: 1, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(8), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: SizeConfig.getHeightMultiplier(height: height) * + (SizeConfig.isHeightVeryShort? + 3 + : SizeConfig.isHeightShort? + 2 + : 2)), + Label( + firstLine: TranslationBase.of(context).patients, + secondLine: TranslationBase.of(context).referral, + color: Color(0xFF2B353E), + secondLineFontSize: SizeConfig.getHeightMultiplier(height: height) * + (SizeConfig.isHeightVeryShort? + 5 + : SizeConfig.isHeightShort? + 7 + : 12), + ), + SizedBox( + height: SizeConfig.getHeightMultiplier(height: height) * + (SizeConfig.isHeightVeryShort? + 5 + : SizeConfig.isHeightShort? + 10 + : 5)) + ], + ), + ), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RowCounts( + dashboardItemList[2].summaryoptions[0].kPIParameter, + dashboardItemList[2].summaryoptions[0].value, + Colors.black, + height: height, + ), + RowCounts( + dashboardItemList[2].summaryoptions[1].kPIParameter, + dashboardItemList[2].summaryoptions[1].value, + Colors.grey, + height: height, + ), + RowCounts( + dashboardItemList[2].summaryoptions[2].kPIParameter, + dashboardItemList[2].summaryoptions[2].value, + Colors.red, + height: height, + ), + ], + ), + ) + ], + )), + ), + Expanded( + flex: 3, + child: Stack(children: [ + Container(padding: EdgeInsets.all(0), child: GaugeChart(_createReferralData(dashboardItemList))), + Positioned( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + AppText( + model.getPatientCount(dashboardItemList[2]).toString(), + fontSize: SizeConfig.textMultiplier * 3.0, + fontWeight: FontWeight.bold, + ) + ], + ), + top: height * (SizeConfig.isHeightVeryShort ? 0.35 : 0.40), + left: 0, + right: 0) + ]), + ), + ], + )), + ]), + ); + } + + static List> _createReferralData(List dashboardItemList) { + final data = [ + new GaugeSegment(dashboardItemList[2].summaryoptions[0].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[0].value), charts.MaterialPalette.black), + new GaugeSegment(dashboardItemList[2].summaryoptions[1].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[1].value), charts.MaterialPalette.gray.shadeDefault), + new GaugeSegment(dashboardItemList[2].summaryoptions[2].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[2].value), charts.MaterialPalette.red.shadeDefault), + ]; + + return [ + new charts.Series( + id: 'Segments', + domainFn: (GaugeSegment segment, _) => segment.segment, + measureFn: (GaugeSegment segment, _) => segment.size, + data: data, + colorFn: (GaugeSegment segment, _) => segment.color, + ) + ]; + } + + static int getValue(value) { + return value == 0 ? 1 : value; + } +} diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 4b7c4f46..9005b816 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -1,9 +1,12 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/dashboard/activity_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; +import 'label.dart'; + class DashboardSliderItemWidget extends StatelessWidget { final DashboardModel item; @@ -11,27 +14,37 @@ class DashboardSliderItemWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return Column( + return Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - AppText( - item.kPIName, - fontSize: SizeConfig.textMultiplier * 2.2, - fontWeight: FontWeight.bold, + Container( + margin: EdgeInsets.symmetric(horizontal: SizeConfig.widthMultiplier *1), + + child: Label( + firstLine: Helpers.getLabelFromKPI(item.kPIName), + secondLine: Helpers.getNameFromKPI(item.kPIName), + ), ), ], ), new Container( - height: 110, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 16 + : SizeConfig.isHeightShort + ? 14 + : SizeConfig.isHeightLarge + ? 15 + : 13), child: ListView( scrollDirection: Axis.horizontal, - children: - List.generate(item.summaryoptions.length, (int index) { - return GetActivityButton(item.summaryoptions[index]); + children: List.generate(item.summaryoptions.length, (int index) { + return GetActivityCard(item.summaryoptions[index]); }))) ], ); + } } diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 66261292..bcd7864c 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -12,6 +12,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:charts_flutter/flutter.dart' as charts; +import 'dashboard_referral_patient.dart'; + class DashboardSwipeWidget extends StatefulWidget { final List dashboardItemList; final DashboardViewModel model; @@ -28,8 +30,11 @@ class _DashboardSwipeWidgetState extends State { @override Widget build(BuildContext context) { + double height = SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 40 : SizeConfig.isHeightLarge?33:31); + return Container( - height: MediaQuery.of(context).size.height * 0.35, + height: height, // height: 230, child: Swiper( onIndexChanged: (index) { @@ -41,7 +46,7 @@ class _DashboardSwipeWidgetState extends State { } }, itemBuilder: (BuildContext context, int index) { - return getSwipeWidget(widget.dashboardItemList, index); + return getSwipeWidget(widget.dashboardItemList, index, height); }, itemCount: 3, // itemHeight: 300, @@ -84,146 +89,14 @@ class _DashboardSwipeWidgetState extends State { ); } - Widget getSwipeWidget(List dashboardItemList, int index) { + Widget getSwipeWidget(List dashboardItemList, int index,double height ) { if (index == 1) - return RoundedContainer( - raduis: 16, - showBorder: false, - borderColor: Colors.white, - shadowWidth: 0.1, - shadowSpreadRadius: 2, - shadowDy: 1, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: Padding( - padding: const EdgeInsets.all(5.0), - child: GetOutPatientStack(dashboardItemList[1]))); + return GetOutPatientStack(dashboardItemList[1]); if (index == 0) - return RoundedContainer( - raduis: 16, - showBorder: false, - borderColor: Colors.white, - shadowWidth: 0.1, - shadowSpreadRadius: 2, - shadowDy: 1, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: Padding( - padding: const EdgeInsets.all(5.0), - child: GetOutPatientStack(dashboardItemList[0]))); + return GetOutPatientStack(dashboardItemList[0]); if (index == 2) - return RoundedContainer( - raduis: 16, - showBorder: false, - borderColor: Colors.white, - shadowWidth: 0.1, - shadowSpreadRadius: 2, - shadowDy: 1, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - flex: 1, - child: Row( - children: [ - Expanded( - flex: 4, - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(8), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .patients, - fontSize: 12, - fontWeight: FontWeight.bold, - fontHeight: 0.5, - ), - AppText( - TranslationBase.of(context) - .referral, - fontSize: 22, - fontWeight: FontWeight.bold, - ), - ], - )), - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: RowCounts( - dashboardItemList[2] - .summaryoptions[0] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[0] - .value, - Colors.black), - ), - Expanded( - child: RowCounts( - dashboardItemList[2] - .summaryoptions[1] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[1] - .value, - Colors.grey), - ), - Expanded( - child: RowCounts( - dashboardItemList[2] - .summaryoptions[2] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[2] - .value, - Colors.red), - ), - ], - ), - ) - ], - )), - ), - Expanded( - flex: 3, - child: Stack(children: [ - Container( - child: GaugeChart( - _createReferralData(widget.dashboardItemList))), - Positioned( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - AppText( - widget.model - .getPatientCount(dashboardItemList[2]) - .toString(), - fontSize: SizeConfig.textMultiplier * 3.0, - fontWeight: FontWeight.bold, - ) - ], - ), - top: MediaQuery.of(context).size.height * 0.13, - left: 0, - right: 0) - ]), - ), - ], - )), - ])); + return DashboardReferralPatient(dashboardItemList: widget.dashboardItemList,height: height,model: widget.model,); + return Container(); } diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 503bbe60..df4ae48f 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -4,36 +4,34 @@ import 'package:hexcolor/hexcolor.dart'; class HomePageCard extends StatelessWidget { const HomePageCard( {this.hasBorder = false, - this.imageName, - @required this.child, - this.onTap, - Key key, - this.color, - this.opacity = 0.4, - this.margin}) + this.imageName, + this.child, + this.onTap, + Key key, + this.color, + this.opacity = 0.4, + this.margin, this.width}) : super(key: key); final bool hasBorder; final String imageName; final Widget child; - final Function onTap; + final GestureTapCallback onTap; final Color color; final double opacity; + final double width; final EdgeInsets margin; @override Widget build(BuildContext context) { return InkWell( onTap: onTap, child: Container( - width: 120, - height: MediaQuery.of(context).orientation == Orientation.portrait - ? 100 - : 200, + width: width, margin: this.margin, decoration: BoxDecoration( color: !hasBorder ? color != null - ? color - : HexColor('#050705').withOpacity(opacity) + ? color + : HexColor('#050705').withOpacity(opacity) : Colors.white, borderRadius: BorderRadius.circular(17.0), border: hasBorder @@ -41,11 +39,10 @@ class HomePageCard extends StatelessWidget { : Border.all(width: 0.0, color: Colors.transparent), image: imageName != null ? DecorationImage( - image: AssetImage('assets/images/dashboard/$imageName'), - fit: BoxFit.cover, - colorFilter: new ColorFilter.mode( - Colors.black.withOpacity(0.2), BlendMode.dstIn), - ) + image: AssetImage('assets/images/dashboard/$imageName'), + fit: BoxFit.cover, + colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn), + ) : null, ), child: child, diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index a0d0bce7..06ef380f 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -10,25 +10,28 @@ class HomePatientCard extends StatelessWidget { final Color backgroundIconColor; final String text; final Color textColor; - final Function onTap; + final VoidCallback onTap; final double iconSize; HomePatientCard({ - @required this.backgroundColor, - @required this.backgroundIconColor, - this.cardIcon, + this.backgroundColor, + this.backgroundIconColor, + this.cardIcon, this.cardIconImage, - @required this.text, - @required this.textColor, - @required this.onTap, - this.iconSize = 30, + this.text, + this.textColor, + this.onTap, + this.iconSize = 30, }); @override Widget build(BuildContext context) { + double width = SizeConfig.heightMultiplier* + (SizeConfig.isHeightVeryShort ? 16 : SizeConfig.isHeightLarge?15:13); return HomePageCard( color: backgroundColor, - margin: EdgeInsets.all(4), + width: width, + margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121), child: Container( padding: EdgeInsets.all(8), child: Column( @@ -43,21 +46,21 @@ class HomePatientCard extends StatelessWidget { color: Colors.transparent, child: cardIcon != null ? Icon( - cardIcon, - size: iconSize * 2, - color: backgroundIconColor, - ) + cardIcon, + size: iconSize * 2, + color: backgroundIconColor, + ) : IconButton( - icon: Image.asset( - 'assets/images/patient_register.png', - width: iconSize * 2, - height: iconSize * 2, - fit: BoxFit.fill, - ), - iconSize: iconSize * 2, - color: backgroundIconColor, - onPressed: () => null, - ), + icon: Image.asset( + 'assets/images/patient_register.png', + width: iconSize * 2, + height: iconSize * 2, + fit: BoxFit.fill, + ), + iconSize: iconSize * 2, + color: backgroundIconColor, + onPressed: () => null, + ), ), Container( child: Column( @@ -66,15 +69,16 @@ class HomePatientCard extends StatelessWidget { children: [ cardIcon != null ? Icon( - cardIcon, - size: iconSize, - color: textColor, - ) + cardIcon, + size: + SizeConfig.getWidthMultiplier(width: width) * 30, + color: textColor, + ) : Image.asset( - cardIconImage, - height: iconSize, - width: iconSize, - ), + cardIconImage, + height: iconSize, + width: iconSize, + ), SizedBox( height: 4, ), @@ -90,7 +94,9 @@ class HomePatientCard extends StatelessWidget { text, color: textColor, textAlign: TextAlign.start, - fontSize: SizeConfig.textMultiplier * 1.6, + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth(width: width) * + (SizeConfig.isHeightVeryShort ? 11 : 10), ), ), ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 62988caa..f5b62368 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; @@ -33,6 +34,7 @@ import 'package:sticky_headers/sticky_headers/widget.dart'; import '../../routes.dart'; import '../../widgets/shared/app_texts_widget.dart'; +import 'label.dart'; class HomeScreen extends StatefulWidget { HomeScreen({Key key, this.title}) : super(key: key); @@ -102,7 +104,8 @@ class _HomeScreenState extends State { DropdownButtonHideUnderline( child: DropdownButton( dropdownColor: Colors.white, - iconEnabledColor: Colors.black, + iconEnabledColor: AppGlobal.appTextColor, + icon: Icon(Icons.keyboard_arrow_down), isExpanded: true, value: clinicId == null ? projectsProvider @@ -127,13 +130,13 @@ class _HomeScreenState extends State { children: [ Container( padding: - EdgeInsets.all(2), + EdgeInsets.all(0), margin: EdgeInsets.all(2), decoration: new BoxDecoration( color: - Colors.red[800], + AppGlobal.appRedColor, borderRadius: BorderRadius .circular( @@ -152,11 +155,13 @@ class _HomeScreenState extends State { .toString(), color: Colors.white, + letterSpacing: -0.72, + fontWeight: FontWeight.w600, fontSize: projectsProvider .isArabic ? 10 - : 11, + : 12, textAlign: TextAlign .center, @@ -165,8 +170,9 @@ class _HomeScreenState extends State { ], ), AppText(item.clinicName, - fontSize: 12, - color: Colors.black, + fontSize: 14, + letterSpacing: -0.96, + color: AppGlobal.appTextColor, fontWeight: FontWeight.bold, textAlign: TextAlign.end), @@ -194,6 +200,11 @@ class _HomeScreenState extends State { return DropdownMenuItem( child: AppText( item.clinicName, + fontSize: 14, + letterSpacing: -0.96, + color: AppGlobal.appTextColor, + fontWeight: + FontWeight.bold, textAlign: TextAlign.left, ), value: item.clinicID, @@ -274,27 +285,12 @@ class _HomeScreenState extends State { SizedBox( height: 10, ), - Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).patients, - fontSize: 12, - fontWeight: FontWeight.bold, - fontHeight: .5, - ), - AppText( - TranslationBase.of(context).services, - fontSize: 22, - fontWeight: FontWeight.bold, - ), - ], - )), - SizedBox( - height: 10, + + Label( + firstLine: TranslationBase.of(context).patients, + secondLine: TranslationBase.of(context).services, ), + Container( height: 120, child: ListView( @@ -324,9 +320,9 @@ class _HomeScreenState extends State { colorIndex = 0; List backgroundColors = List(3); - backgroundColors[0] = Color(0xffD02127); + backgroundColors[0] = AppGlobal.appRedColor; backgroundColors[1] = Colors.grey[300]; - backgroundColors[2] = Color(0xff2B353E); + backgroundColors[2] = Color(0xFF2B353E); List backgroundIconColors = List(3); backgroundIconColors[0] = Colors.white12; backgroundIconColors[1] = Colors.white38; diff --git a/lib/screens/home/label.dart b/lib/screens/home/label.dart new file mode 100644 index 00000000..0d316652 --- /dev/null +++ b/lib/screens/home/label.dart @@ -0,0 +1,43 @@ +// ignore: must_be_immutable +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class Label extends StatelessWidget { + Label({ + Key key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, + }) : super(key: key); + final String firstLine; + final String secondLine; + Color color; + final double secondLineFontSize; + final double firstLineFontSize; + + @override + Widget build(BuildContext context) { + + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + firstLine, + fontSize: firstLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , + // fontWeight: FontWeight.bold, + color: color, + fontHeight: .5, + letterSpacing: -0.72, + fontWeight: FontWeight.w600, + ), + AppText( + secondLine, + color: color, + fontSize: secondLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?4:6.40), + fontWeight: FontWeight.bold, + letterSpacing: -1.44, + + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/screens/patients/In_patient/in_patient_list_page.dart b/lib/screens/patients/In_patient/in_patient_list_page.dart index 6e9ad14f..7498257d 100644 --- a/lib/screens/patients/In_patient/in_patient_list_page.dart +++ b/lib/screens/patients/In_patient/in_patient_list_page.dart @@ -53,6 +53,7 @@ class _InPatientListPageState extends State { return AppScaffold( baseViewModel: widget.patientSearchViewModel, isShowAppBar: false, + backgroundColor: Color(0xFFF8F8F8), body: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index e0e4fb4a..5a6a0083 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -245,9 +245,7 @@ class _OutPatientsScreenState extends State { }, ), ), - SizedBox( - height: 10.0, - ), + Expanded( child: Container( child: model.filterData.isEmpty @@ -269,7 +267,7 @@ class _OutPatientsScreenState extends State { .patientStatusType == 43)) return Padding( - padding: EdgeInsets.all(8.0), + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0), child: PatientCard( patientInfo: model.filterData[index], patientType: patientType, diff --git a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart index 305b0c65..57698f56 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart @@ -76,7 +76,7 @@ class _PriorityBarState extends State { ), ), if(_isActive) - Container(width: 120,height: 4,color: AppGlobal.appPrimaryColor,) + Container(width: 120,height: 4,color: AppGlobal.appRedColor,) ], ), ), diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 368a4c94..86a09468 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -188,6 +188,21 @@ class Helpers { static clearSharedPref() async { await sharedPref.clear(); } + static getCardBoxDecoration(){ + return BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + shape: BoxShape.rectangle, + boxShadow: [ + BoxShadow( + color: Color(0xFF0000000D), + spreadRadius: 10, + blurRadius: 27, + offset: Offset(0, -3), // changes position of shadow + ), + ], + ); + } navigateToUpdatePage(String message, String androidLink, iosLink) { locator().pushAndRemoveUntil( @@ -298,4 +313,20 @@ class Helpers { ? 8 : 6); } + + static getLabelFromKPI(String kpi) { + if (kpi.indexOf("(") > -1 && kpi.indexOf(")") > -1) + return kpi.substring(kpi.indexOf("(") + 1, kpi.indexOf(")")); + else + return ''; + } + + static getNameFromKPI(String kpi) { + if (kpi.indexOf("(") > -1) + return kpi.substring(0, kpi.indexOf("(")); + else + return kpi; + } + + } diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index ff9db962..f00acef4 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -1,42 +1,50 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -class GetActivityButton extends StatelessWidget { +class GetActivityCard extends StatelessWidget { final value; - GetActivityButton(this.value); + GetActivityCard(this.value); @override Widget build(BuildContext context) { + double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:SizeConfig.isHeightLarge?15:13); return Container( - width: MediaQuery.of(context).size.height * 0.125, - padding: EdgeInsets.all(5), - margin: EdgeInsets.all(5), + width: width, + padding: EdgeInsets.symmetric(horizontal: SizeConfig.heightMultiplier * .4, vertical: SizeConfig.heightMultiplier * .2), + margin: EdgeInsets.all(SizeConfig.widthMultiplier *1), decoration: BoxDecoration( color: Colors.white, + border: Border.all(width: 1, color: Color(0xFFEFEFEF)), borderRadius: BorderRadius.circular(15), ), child: Padding( - padding: const EdgeInsets.fromLTRB(8, 0, 8, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - value.value.toString(), - fontSize: 27, - fontWeight: FontWeight.bold, - color: Color(0xFF2B353E), - ), - AppText( - value.kPIParameter, - textOverflow: TextOverflow.clip, - fontSize: 10, - color: Color(0xFF2B353E), - textAlign: TextAlign.start, - fontWeight: FontWeight.w700, - ), - ], + padding: const EdgeInsets.fromLTRB(8,8, 8, 4), + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + value.value.toString(), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 25, + fontWeight: FontWeight.bold, + color: AppGlobal.appTextColor, + letterSpacing: -0.93, + ), + AppText( + value.kPIParameter, + textOverflow: TextOverflow.clip, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 9), + color: AppGlobal.appTextColor, + textAlign: TextAlign.start, + fontWeight: FontWeight.w600, + letterSpacing: -0.33, + ), + ], + ), ), ), ); diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index fe05d69d..fb67d954 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -1,4 +1,6 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -9,42 +11,87 @@ class GetOutPatientStack extends StatelessWidget { @override Widget build(BuildContext context) { + + double barHeight = + SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : SizeConfig.isHeightLarge?20:17); + value.summaryoptions.sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); + value.summaryoptions .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); var list = new List(); value.summaryoptions.forEach((result) => - {list.add(getStack(result, value.summaryoptions.first.value,context))}); - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - height: 30, - child: AppText( - value.kPIName, - medium: true, - fontSize: 14, - ), + {list.add(getStack(result, value.summaryoptions.first.value,context,barHeight))}); + return Container( + margin: EdgeInsets.only(bottom: 20, top: 10, left: 5, right: 5), + decoration: BoxDecoration( + + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + bottomLeft: Radius.circular(20), + bottomRight: Radius.circular(20) ), - Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) - ], + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 0, + blurRadius: 9, + offset: Offset(0, 0), // changes position of shadow + ), + ], + ), + child: Padding( + padding: const EdgeInsets.all(5.0), + child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5), + child: Label( + firstLine: Helpers.getLabelFromKPI(value.kPIName), + secondLine: Helpers.getNameFromKPI(value.kPIName), + color: Color(0xFF2B353E), + firstLineFontSize: + SizeConfig.getHeightMultiplier(height: barHeight) * + (SizeConfig.isHeightVeryShort + ? 10 + : SizeConfig.isHeightShort + ? 10 + : 8.5), + secondLineFontSize: + SizeConfig.getHeightMultiplier(height: barHeight) * + (SizeConfig.isHeightVeryShort + ? 15 + : SizeConfig.isHeightShort + ? 15 + : 14.5), + ), + ), + Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) + ], + ) + + ), ); } - getStack(Summaryoptions value, max,context) { + + + getStack(Summaryoptions value, max, context, barHeight) { return Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 2), decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topLeft, - end: Alignment( - 0.0, 1.0), // 10% of the width, so there are ten blinds. + end: Alignment(0.0, 1.0), // 10% of the width, so there are ten blinds. colors: [Color(0x8FF5F6FA), Colors.red[50]], // red to yellow tileMode: TileMode.mirror, // repeats the gradient over the canvas ), - borderRadius: BorderRadius.circular(8), + borderRadius: BorderRadius.circular(4), // color: Colors.red[50], ), child: Stack(children: [ @@ -55,15 +102,15 @@ class GetOutPatientStack extends StatelessWidget { child: Container( child: SizedBox(), padding: EdgeInsets.all(10), - height: max != 0 ? ((MediaQuery.of(context).size.height * 0.24 )* value.value) / max : 0, + height: max != 0 ? ((barHeight) * value.value) / max : 0, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), + borderRadius: BorderRadius.circular(4), color: Color(0x63D02127), ), ), ), Container( - height: (MediaQuery.of(context).size.height * 0.24 ), + height: barHeight, margin: EdgeInsets.only(left: 5, top: 5), padding: EdgeInsets.all(10), child: RotatedBox( @@ -71,29 +118,73 @@ class GetOutPatientStack extends StatelessWidget { child: Center( child: Align( child: FittedBox( - child: Row( - children: [ - AppText( - value.kPIParameter, - fontSize: 10, - textAlign: TextAlign.center, - color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - AppText( - ' (' + value.value.toString() + ') ', - fontSize: 12, - textAlign: TextAlign.center, - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, + child: Row( + children: [ + AppText( + value.kPIParameter, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, + textAlign: TextAlign.center, + color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, + letterSpacing: -0.3, + ), + AppText( + ' (' + value.value.toString() + ') ', + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, + textAlign: TextAlign.center, + color: Color(0xFF2B353E), + letterSpacing: -0.3, + fontWeight: FontWeight.bold, + ), + ], ), - ], - ), - )), + )), ), )) ]), ), ); } + +} + + +// ignore: must_be_immutable +class Label extends StatelessWidget { + Label({ + Key key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, + }) : super(key: key); + final String firstLine; + final String secondLine; + Color color; + final double secondLineFontSize; + final double firstLineFontSize; + + @override + Widget build(BuildContext context) { + + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + firstLine, + fontSize: firstLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , + // fontWeight: FontWeight.bold, + color: color, + fontHeight: .5, + letterSpacing: -0.72, + fontWeight: FontWeight.w600, + ), + AppText( + secondLine, + color: color, + fontSize: secondLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?4:6.40), + fontWeight: FontWeight.bold, + letterSpacing: -1.44, + + ), + ], + ); + } } diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index a22932f4..bf39ed27 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -5,11 +6,15 @@ class RowCounts extends StatelessWidget { final name; final int count; final Color c; - RowCounts(this.name, this.count, this.c); + final double height; + + + RowCounts(this.name, this.count, this.c, {this.height}); @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.only(top: 5, bottom: 5), + padding: EdgeInsets.only(top:SizeConfig.getHeightMultiplier(height:height )* 0.2 , bottom: SizeConfig.getHeightMultiplier(height:height )* 0.2), + child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 5354bb5e..1365871c 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -12,7 +12,6 @@ import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:cached_network_image/cached_network_image.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../../../util/extenstions.dart'; @@ -46,29 +45,20 @@ class PatientCard extends StatelessWidget { String nationalityName = patientInfo.nationalityName != null ? patientInfo.nationalityName.trim() : patientInfo.nationality != null - ? patientInfo.nationality.trim() - : patientInfo.nationalityId != - null - ? patientInfo.nationalityId - : ""; + ? patientInfo.nationality.trim() + : patientInfo.nationalityId != null + ? patientInfo.nationalityId + : ""; return Container( width: SizeConfig.screenWidth * 0.9, margin: EdgeInsets.all(6), - padding: EdgeInsets.only(left: projectViewModel.isArabic?5:0, right: projectViewModel.isArabic?0:5, bottom: 0, top: 0), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white, - shape: BoxShape.rectangle, - boxShadow: [ - BoxShadow( - color: Color(0x0000000D), - spreadRadius: 10, - blurRadius: 2.7, - offset: Offset(0, -3 ), // changes position of shadow - ), - ], - ), + padding: EdgeInsets.only( + left: projectViewModel.isArabic ? 5 : 0, + right: projectViewModel.isArabic ? 0 : 5, + bottom: 0, + top: 0), + decoration: Helpers.getCardBoxDecoration(), child: CardWithBgWidget( padding: 0, marginLeft: (!isMyPatient && isInpatient) ? 0 : 10, @@ -108,13 +98,10 @@ class PatientCard extends StatelessWidget { patientInfo.patientStatusType == 43 ? Row( children: [ - AppText( - TranslationBase.of(context) + PatientStatus( + label: TranslationBase.of(context) .arrivedP, color: AppGlobal.appGreenColor, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 10, ), SizedBox( width: 8, @@ -129,29 +116,24 @@ class PatientCard extends StatelessWidget { SizedBox( width: 8, ), - AppText( - patientInfo.status == 2 + PatientStatus( + label: patientInfo.status == 2 ? 'Confirmed' : 'Booked', color: patientInfo.status == 2 ? AppGlobal.appGreenColor : Colors.grey, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 10, ), ], ) : patientInfo.patientStatusType == 42 ? Row( children: [ - AppText( - TranslationBase.of(context) - .notArrived, + PatientStatus( + label: + TranslationBase.of(context) + .notArrived, color: Colors.red[800], - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 10, ), SizedBox( width: 8, @@ -166,17 +148,14 @@ class PatientCard extends StatelessWidget { SizedBox( width: 8, ), - AppText( - patientInfo.status == 2 + PatientStatus( + label: patientInfo.status == 2 ? 'Confirmed' : 'Booked', color: patientInfo.status == 2 ? AppGlobal.appGreenColor : Colors.grey, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 10, - ), + ) ], ) : !isFromSearch && @@ -185,13 +164,11 @@ class PatientCard extends StatelessWidget { null ? Row( children: [ - AppText( - TranslationBase.of(context) + PatientStatus( + label: TranslationBase.of( + context) .notArrived, color: Colors.red[800], - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, ), SizedBox( width: 8, @@ -206,17 +183,16 @@ class PatientCard extends StatelessWidget { SizedBox( width: 8, ), - AppText( - patientInfo.status == 2 - ? 'Booked' - : 'Confirmed', + PatientStatus( + label: + patientInfo.status == 2 + ? 'Booked' + : 'Confirmed', color: patientInfo.status == 2 ? Colors.grey - : AppGlobal.appGreenColor, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, + : AppGlobal + .appGreenColor, ) ], ) @@ -230,29 +206,55 @@ class PatientCard extends StatelessWidget { fontWeight: FontWeight.w400, ) : patientInfo.arrivedOn != null - ? AppText( - AppDateUtils.getDayMonthYearDate( - AppDateUtils - .convertStringToDate( - patientInfo.arrivedOn, - )) + - " " + + ? Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + AppText( + AppDateUtils + .getDayMonthYearDateFormatted( + AppDateUtils + .convertStringToDate( + patientInfo.arrivedOn, + ), + isMonthShort: true, + ), + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + fontSize: 15, + ), + AppText( "${AppDateUtils.getStartTime(patientInfo.startTime)}", - fontFamily: 'Poppins', - fontWeight: FontWeight.w400, - fontSize: 15, + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + fontSize: 15, + ), + ], ) : (patientInfo.appointmentDate != null && patientInfo .appointmentDate.isNotEmpty) - ? AppText( - "${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate( - patientInfo.appointmentDate, - ))} ${AppDateUtils.getStartTime(patientInfo.startTime)}", - fontFamily: 'Poppins', - fontWeight: FontWeight.w400, - fontSize: 15, + ? Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + AppText( + "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate( + patientInfo + .appointmentDate, + ), isMonthShort: true)}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + fontSize: 15, + ), + AppText( + " ${AppDateUtils.getStartTime(patientInfo.startTime)}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + fontSize: 15, + ), + ], ) : SizedBox() ], @@ -264,12 +266,8 @@ class PatientCard extends StatelessWidget { SizedBox( width: 12, ), - AppText( - 'My Patient', - color: AppGlobal.appGreenColor, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, + PatientStatus( + label: 'My Patient', ), ], ), @@ -282,37 +280,36 @@ class PatientCard extends StatelessWidget { Expanded( flex: 2, child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded( - // width: MediaQuery.of(context).size.width*0.51, - child: AppText( - isFromLiveCare - ? Helpers.capitalize( - patientInfo.fullName) - : (Helpers.capitalize( - patientInfo.firstName) + - " " + - Helpers.capitalize( - patientInfo.lastName)), - fontSize: 16, - color: Color(0xff2e303a), - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - textOverflow: TextOverflow.ellipsis, - ), + AppText( + isFromLiveCare + ? Helpers.capitalize( + patientInfo.fullName) + : (Helpers.capitalize( + patientInfo.firstName) + + " " + + Helpers.capitalize( + patientInfo.lastName)), + fontSize: 16, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + letterSpacing: -0.64, + textOverflow: TextOverflow.ellipsis, ), if (patientInfo.gender == 1) Icon( DoctorApp.male_2, color: Colors.blue, + size: 18, ) else Icon( DoctorApp.female_1, color: Colors.pink, + size: 18, ), if (isFromLiveCare) ShowTimer( @@ -323,15 +320,17 @@ class PatientCard extends StatelessWidget { Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, children: [ Expanded( child: Container( + padding: EdgeInsets.only(top: 8), alignment: Alignment.centerRight, child: AppText( nationalityName.truncate(14), - fontWeight: FontWeight.bold, - fontSize: 14, + fontWeight: FontWeight.w600, + fontSize: 10, + color: Color(0xFF2E303A), textOverflow: TextOverflow.ellipsis, ), ), @@ -347,8 +346,8 @@ class PatientCard extends StatelessWidget { null ? patientInfo.nationalityFlagURL : '', - height: 25, - width: 30, + height: 16, + width: 22, errorWidget: (context, url, error) => AppText( @@ -362,12 +361,14 @@ class PatientCard extends StatelessWidget { ) ], )), - Row(children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, + SizedBox( + height: 10, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.only(left: 12.0), + padding: EdgeInsets.only(left: 12.0, top: 5), child: Container( width: 60, height: 60, @@ -379,82 +380,86 @@ class PatientCard extends StatelessWidget { ), ), ), - ], - ), - SizedBox( - width: 10, - ), - Expanded( - child: Row( - children: [ + SizedBox( + width: 10, + ), Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CustomRow( - label: - TranslationBase.of(context).fileNumber, - value: patientInfo.patientId.toString(), - ), - CustomRow( - label: - TranslationBase.of(context).age + " : ", - value: - "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", - ), - if (isInpatient) - CustomRow( - label: patientInfo.admissionDate == null - ? "" - : TranslationBase.of(context) - .admissionDate + + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // SizedBox(height: 10,), + CustomRow( + label: TranslationBase.of(context) + .fileNumber, + value: patientInfo.patientId.toString(), + ), + CustomRow( + label: TranslationBase.of(context).age + + " : ", + value: + "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", + ), + if (isInpatient) + CustomRow( + label: + patientInfo.admissionDate == null + ? "" + : TranslationBase.of(context) + .admissionDate + + " : ", + value: patientInfo.admissionDate == + null + ? "" + : "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate.toString()), isMonthShort: true)}", + ), + if (patientInfo.admissionDate != null) + CustomRow( + label: TranslationBase.of(context) + .numOfDays + " : ", - value: patientInfo.admissionDate == null - ? "" - : "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", - ), - if (patientInfo.admissionDate != null) - CustomRow( - label: TranslationBase.of(context) - .numOfDays + - " : ", - value: - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", - ), - if (patientInfo.admissionDate != null) - CustomRow( - label: TranslationBase.of(context) - .clinicName + - " : ", - value: "${patientInfo.clinicDescription}", - ), - if (patientInfo.admissionDate != null) - CustomRow( - label: - TranslationBase.of(context).roomNo + + value: + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + ), + if (patientInfo.admissionDate != null) + CustomRow( + label: TranslationBase.of(context) + .clinicName + " : ", - value: "${patientInfo.roomId}", - ), - if (isFromLiveCare) - Column( - children: [ + value: + "${patientInfo.clinicDescription}", + ), + if (patientInfo.admissionDate != null) CustomRow( label: TranslationBase.of(context) - .clinic + + .roomNo + " : ", - value: patientInfo.clinicName, + value: "${patientInfo.roomId}", ), - ], - ), - ]), - ), - Icon( - Icons.arrow_forward, - size: 24, - ), - ], - )) - ]), + if (isFromLiveCare) + Column( + children: [ + CustomRow( + label: TranslationBase.of(context) + .clinic + + " : ", + value: patientInfo.clinicName, + ), + ], + ), + ]), + ), + Icon( + Icons.arrow_forward, + size: 24, + ), + ], + )) + ]), isFromLiveCare ? Row( mainAxisAlignment: MainAxisAlignment.end, @@ -508,3 +513,24 @@ class PatientCard extends StatelessWidget { )); } } + +class PatientStatus extends StatelessWidget { + PatientStatus({ + Key key, + this.label, + this.color, + }) : super(key: key); + final String label; + final Color color; + + @override + Widget build(BuildContext context) { + return AppText( + label, + color: color ?? AppGlobal.appGreenColor, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + fontSize: 10, + ); + } +} diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index e36b84a4..8dd7ba65 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -47,7 +47,7 @@ class CardWithBgWidget extends StatelessWidget { bottomRight: Radius.circular(10), ), ), - width: 10, + width: 6, ), bottom: 1, top: 1, @@ -63,7 +63,7 @@ class CardWithBgWidget extends StatelessWidget { bottomLeft: Radius.circular(10), ), ), - width: 7, + width: 5, ), bottom: 1, top: 1, diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index b66d4926..0c364474 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -24,18 +24,20 @@ class CustomRow extends StatelessWidget { children: [ AppText( label, - fontSize: labelSize??SizeConfig.getTextMultiplierBasedOnWidth() * 2.8, + fontSize: labelSize??SizeConfig.getTextMultiplierBasedOnWidth() * 2.7, color: Color(0xFF575757), fontWeight: FontWeight.w600, + letterSpacing: -0.4, ), SizedBox( width: 1, ), AppText( value, - fontSize: valueSize??SizeConfig.getTextMultiplierBasedOnWidth() * 3, - color: Color(0xFF2E303A), + fontSize: valueSize??SizeConfig.getTextMultiplierBasedOnWidth() * 2.9, + color: Color(0xFF2B353E), fontWeight: FontWeight.w700, + letterSpacing: -0.48, isCopyable: isCopyable, ), ], diff --git a/pubspec.lock b/pubspec.lock index 4fcb6792..3f1537d3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -14,7 +14,7 @@ packages: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.40.6" + version: "0.40.7" archive: dependency: transitive description: @@ -112,7 +112,7 @@ packages: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "1.11.1" + version: "1.11.1+1" build_runner_core: dependency: transitive description: @@ -664,7 +664,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.1" + version: "0.6.2" json_annotation: dependency: transitive description: @@ -706,7 +706,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -1040,7 +1040,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: @@ -1245,5 +1245,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.2 <=2.11.0-213.1.beta" + dart: ">=2.10.2 <2.11.0" flutter: ">=1.22.2 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 23d6a2aa..6423a46c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -152,6 +152,8 @@ flutter: weight: 400 - asset: assets/fonts/Poppins/Poppins-Medium.ttf weight: 500 + - asset: assets/fonts/Poppins/Poppins-SemiBold.ttf + weight: 600 - asset: assets/fonts/Poppins/Poppins-Bold.ttf weight: 700 - asset: assets/fonts/Poppins/Poppins-Bold.ttf