diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index f2d57d5f..ed9cfe0c 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -88,8 +88,6 @@ class BaseAppClient { print("URL : $url"); print("Body : ${json.encode(body)}"); - String req = json.encode(body); - var asd=""; if (await Helpers.checkConnection()) { final response = await http.post(url, @@ -105,7 +103,8 @@ class BaseAppClient { var parsed = json.decode(response.body.toString()); if (parsed['ErrorType'] == 4) { - helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],parsed['AndroidLink'],parsed['IOSLink']); + helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], + parsed['AndroidLink'], parsed['IOSLink']); } if (!parsed['IsAuthenticated']) { @@ -225,7 +224,8 @@ class BaseAppClient { onSuccess(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { - helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],parsed['AndroidLink'],parsed['IOSLink']); + helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], + parsed['AndroidLink'], parsed['IOSLink']); } if (parsed['IsAuthenticated'] == null) { if (parsed['isSMSSent'] == true) { @@ -289,7 +289,6 @@ class BaseAppClient { } } - String getError(parsed) { //TODO change this fun String error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index cce59e39..c9f89cb8 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -18,7 +18,11 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/activity_button.dart'; import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/out_patient_stack.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/swiper_rounded_pagination.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -28,6 +32,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; +import 'package:sticky_headers/sticky_headers/widget.dart'; import '../../routes.dart'; import '../../widgets/shared/app_texts_widget.dart'; @@ -130,122 +135,125 @@ class _HomeScreenState extends State { baseViewModel: model, isShowAppBar: false, body: ListView(children: [ - Column( - children: [ - SizedBox(height: 20), - Stack(children: [ - IconButton( - icon: Image.asset('assets/images/menu.png', - height: 50, width: 50), - iconSize: 18, - color: Colors.black, - onPressed: () => Scaffold.of(context).openDrawer(), - ), - Column( - children: [ - ProfileWelcomeWidget( - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: MediaQuery.of(context).size.width * .6, - // // height: 100, - child: projectsProvider.doctorClinicsList.length > 0 - ? Stack( - children: [ - DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.black, - isExpanded: true, - value: clinicId == null - ? projectsProvider - .doctorClinicsList[0].clinicID - : clinicId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return projectsProvider - .doctorClinicsList - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.end, - children: [ - Container( - padding: EdgeInsets.all(2), - margin: EdgeInsets.all(2), - decoration: new BoxDecoration( - color: Colors.red[800], - borderRadius: - BorderRadius.circular( - 20), - ), - constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: new Text( - projectsProvider - .doctorClinicsList - .length - .toString(), - style: new TextStyle( - color: Colors.white, - fontSize: projectsProvider - .isArabic - ? 10 - : 11, + Column(children: [ + StickyHeader( + header: Container( + color: Colors.grey[100], + padding: EdgeInsets.only(top: 10), + child: Stack(children: [ + IconButton( + icon: Image.asset('assets/images/menu.png', + height: 50, width: 50), + iconSize: 18, + color: Colors.black, + onPressed: () => Scaffold.of(context).openDrawer(), + ), + Column(children: [ + ProfileWelcomeWidget( + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width * .6, + // // height: 100, + child: projectsProvider.doctorClinicsList.length > + 0 + ? Stack( + children: [ + DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: clinicId == null + ? projectsProvider + .doctorClinicsList[0].clinicID + : clinicId, + iconSize: 25, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return projectsProvider + .doctorClinicsList + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + Container( + padding: EdgeInsets.all(2), + margin: EdgeInsets.all(2), + decoration: + new BoxDecoration( + color: Colors.red[800], + borderRadius: + BorderRadius.circular( + 20), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: new Text( + projectsProvider + .doctorClinicsList + .length + .toString(), + style: new TextStyle( + color: Colors.white, + fontSize: + projectsProvider + .isArabic + ? 10 + : 11, + ), + textAlign: + TextAlign.center, ), - textAlign: TextAlign.center, ), - ), - AppText(item.clinicName, - fontSize: 12, - color: Colors.black, - fontWeight: FontWeight.bold, - textAlign: TextAlign.end), - ], + AppText(item.clinicName, + fontSize: 12, + color: Colors.black, + fontWeight: + FontWeight.bold, + textAlign: TextAlign.end), + ], + ); + }).toList(); + }, + onChanged: (newValue) { + clinicId = newValue; + changeClinic( + newValue, context, model); + }, + items: projectsProvider + .doctorClinicsList + .map((item) { + return DropdownMenuItem( + child: AppText( + item.clinicName, + textAlign: TextAlign.right, + ), + value: item.clinicID, ); - }).toList(); - }, - onChanged: (newValue) { - clinicId = newValue; - changeClinic( - newValue, context, model); - }, - items: projectsProvider - .doctorClinicsList - .map((item) { - return DropdownMenuItem( - child: AppText( - item.clinicName, - textAlign: TextAlign.right, - ), - value: item.clinicID, - ); - }).toList(), - )), - ], - ) - : AppText(TranslationBase.of(context).noClinic), - ), - ], + }).toList(), + )), + ], + ) + : AppText( + TranslationBase.of(context).noClinic), + ), + ], + ), + isClilic: true, + height: 50, ), - isClilic: true, - ), - Container( - height: MediaQuery.of(context).size.height * 0.24, - ), - ], - ), - Positioned( - right: 9.0, - left: 9, - top: MediaQuery.of(context).size.height * .08, - child: Container( + ]) + ])), + content: Column( + children: [ + Container( height: MediaQuery.of(context).size.height * 0.35, child: model.dashboardItemsList.length > 0 ? new Swiper( @@ -279,19 +287,19 @@ class _HomeScreenState extends State { .spaceBetween, children: [ config.activeIndex == 0 - ? getSwiperPagiantion( + ? SwiperRoundedPagination( true) - : getSwiperPagiantion( + : SwiperRoundedPagination( false), config.activeIndex == 1 - ? getSwiperPagiantion( + ? SwiperRoundedPagination( true) - : getSwiperPagiantion( + : SwiperRoundedPagination( false), config.activeIndex == 2 - ? getSwiperPagiantion( + ? SwiperRoundedPagination( true) - : getSwiperPagiantion( + : SwiperRoundedPagination( false), ], ))))) @@ -302,59 +310,17 @@ class _HomeScreenState extends State { // control: new SwiperControl(), ) : SizedBox()), - ) - ]), - model.dashboardItemsList.length > 0 - ? FractionallySizedBox( - widthFactor: 0.90, - child: Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - sliderActiveIndex == 1 - ? Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - model.dashboardItemsList[3].kPIName, - fontSize: - SizeConfig.textMultiplier * 2.2, - fontWeight: FontWeight.bold, - ), - ], - ), - new Container( - height: MediaQuery.of(context) - .orientation == - Orientation.portrait - ? MediaQuery.of(context) - .size - .height * - 0.15 - : MediaQuery.of(context) - .size - .height * - 0.20, - child: new ListView( - scrollDirection: Axis.horizontal, - children: new List.generate( - model - .dashboardItemsList[3] - .summaryoptions - .length, (int index) { - return getActivityButton(model - .dashboardItemsList[3] - .summaryoptions[index]); - }))) - ], - ) - : sliderActiveIndex == 0 + model.dashboardItemsList.length > 0 + ? FractionallySizedBox( + widthFactor: 0.90, + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + sliderActiveIndex == 1 ? Column( children: [ Row( @@ -362,7 +328,7 @@ class _HomeScreenState extends State { MainAxisAlignment.start, children: [ AppText( - model.dashboardItemsList[6] + model.dashboardItemsList[3] .kPIName, fontSize: SizeConfig.textMultiplier * @@ -388,241 +354,297 @@ class _HomeScreenState extends State { Axis.horizontal, children: new List.generate( model - .dashboardItemsList[6] + .dashboardItemsList[3] .summaryoptions .length, (int index) { - return getActivityButton(model - .dashboardItemsList[6] + return GetActivityButton(model + .dashboardItemsList[3] .summaryoptions[index]); }))) ], ) - : Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - model.dashboardItemsList[4] - .kPIName, - fontSize: - SizeConfig.textMultiplier * + : sliderActiveIndex == 0 + ? Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + model.dashboardItemsList[6] + .kPIName, + fontSize: SizeConfig + .textMultiplier * 2.2, - fontWeight: FontWeight.bold, + fontWeight: FontWeight.bold, + ), + ], + ), + new Container( + height: MediaQuery.of(context) + .orientation == + Orientation.portrait + ? MediaQuery.of(context) + .size + .height * + 0.15 + : MediaQuery.of(context) + .size + .height * + 0.20, + child: new ListView( + scrollDirection: Axis + .horizontal, + children: new List + .generate( + model + .dashboardItemsList[ + 6] + .summaryoptions + .length, + (int index) { + return GetActivityButton(model + .dashboardItemsList[ + 6] + .summaryoptions[index]); + }))) + ], + ) + : Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + model.dashboardItemsList[4] + .kPIName, + fontSize: SizeConfig + .textMultiplier * + 2.2, + fontWeight: FontWeight.bold, + ), + ], ), + new Container( + height: MediaQuery.of(context) + .orientation == + Orientation.portrait + ? MediaQuery.of(context) + .size + .height * + 0.15 + : MediaQuery.of(context) + .size + .height * + 0.20, + child: new ListView( + scrollDirection: Axis + .horizontal, + children: new List + .generate( + model + .dashboardItemsList[ + 4] + .summaryoptions + .length, + (int index) { + return GetActivityButton(model + .dashboardItemsList[ + 4] + .summaryoptions[index]); + }))) ], ), - new Container( - height: MediaQuery.of(context) - .orientation == - Orientation.portrait - ? MediaQuery.of(context) - .size - .height * - 0.15 - : MediaQuery.of(context) - .size - .height * - 0.20, - child: new ListView( - scrollDirection: - Axis.horizontal, - children: new List.generate( - model - .dashboardItemsList[4] - .summaryoptions - .length, (int index) { - return getActivityButton(model - .dashboardItemsList[4] - .summaryoptions[index]); - }))) - ], - ), - ]))) - : SizedBox(), - FractionallySizedBox( - // widthFactor: 0.90, - child: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topRight: Radius.circular(50), - )), - padding: EdgeInsets.only(left: 20, top: 10, right: 20), - margin: EdgeInsets.only(top: 10), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - Row( - children: [ - Container( - width: 150, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).patients, - style: TextStyle( - fontSize: 12, - height: .5, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins'), - ), - Text( - TranslationBase.of(context).services, - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins'), - ), - ], - )), - ], - ), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, + ]))) + : SizedBox(), + FractionallySizedBox( + // widthFactor: 0.90, + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topRight: Radius.circular(50), + )), + padding: EdgeInsets.only(left: 20, top: 10, right: 20), + margin: EdgeInsets.only(top: 10), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, children: [ - HomePageCard( - color: Colors.red[800], - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - top: 10, left: 10, right: 0), - child: Icon( - DoctorApp.referral_1, - size: 35, - color: Colors.white, - )), - Container( - padding: EdgeInsets.all(10), - child: AppText( - TranslationBase.of(context) - .patientsreferral, - color: Colors.white, - textAlign: TextAlign.start, - fontSize: 15, - )) - ], - ), - hasBorder: false, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PatientReferralScreen(), - // MyReferredPatient(), + SizedBox( + height: 10, + ), + Row( + children: [ + Container( + width: 150, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).patients, + style: TextStyle( + fontSize: 12, + height: .5, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins'), + ), + Text( + TranslationBase.of(context).services, + style: TextStyle( + fontSize: 22, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins'), + ), + ], + )), + ], + ), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + HomePageCard( + color: Colors.red[800], + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.referral_1, + size: 35, + color: Colors.white, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context) + .patientsreferral, + color: Colors.white, + textAlign: TextAlign.start, + fontSize: 15, + )) + ], + ), + hasBorder: false, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PatientReferralScreen(), + // MyReferredPatient(), + ), + ); + }, + ), + HomePageCard( + color: Colors.grey[300], + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.arrival_patients, + size: 35, + color: Colors.black, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context) + .arrivalpatient, + color: Colors.black, + textAlign: TextAlign.start, + fontSize: 15, + )) + ], + ), + hasBorder: false, + onTap: () { + Navigator.of(context) + .pushNamed(PATIENTS, arguments: { + "patientSearchForm": + _patientSearchFormValues, + "selectedType": "7", + "arrivalType": "1" + }); + }, + ), + HomePageCard( + color: Colors.black, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.search, + size: 32, + color: Colors.white, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context) + .searchmedicinepatient, + color: Colors.white, + textAlign: TextAlign.start, + fontSize: 13, + )) + ], ), - ); - }, + hasBorder: false, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + SearchMedicinePatientScreen(), + )); + }, + ) + ], ), - HomePageCard( - color: Colors.grey[300], - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - top: 10, left: 10, right: 0), - child: Icon( - DoctorApp.arrival_patients, - size: 35, - color: Colors.black, - )), - Container( - padding: EdgeInsets.all(10), - child: AppText( - TranslationBase.of(context) - .arrivalpatient, - color: Colors.black, - textAlign: TextAlign.start, - fontSize: 15, - )) - ], - ), - hasBorder: false, - onTap: () { - Navigator.of(context) - .pushNamed(PATIENTS, arguments: { - "patientSearchForm": _patientSearchFormValues, - "selectedType": "7", - "arrivalType": "1" - }); - }, + SizedBox( + height: 10, ), - HomePageCard( - color: Colors.black, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - top: 10, left: 10, right: 0), - child: Icon( - DoctorApp.search, - size: 32, - color: Colors.white, - )), - Container( - padding: EdgeInsets.all(10), - child: AppText( - TranslationBase.of(context) - .searchmedicinepatient, - color: Colors.white, - textAlign: TextAlign.start, - fontSize: 13, - )) - ], - ), - hasBorder: false, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - SearchMedicinePatientScreen(), - )); - }, - ) - ], - ), - SizedBox( - height: 10, - ), - SizedBox( - height: 20, - ), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ SizedBox( - width: 8, + height: 20, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + width: 8, + ), + ], + ), + SizedBox( + height: 20, ), ], ), - SizedBox( - height: 20, - ), - ], + ), ), - ), + ], ), - ], - ), + ) + ]), ]), ), ); @@ -671,12 +693,9 @@ class _HomeScreenState extends State { projectID: doctorProfile.projectID, tokenID: '', languageID: 2); - - // authProvider.getDocProfiles(docInfo) authProvider.getDocProfiles(docInfo.toJson()).then((res) async { changeIsLoading(false); sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); - // model.getDashboard(); }).catchError((err) { changeIsLoading(false); Helpers.showErrorToast(err); @@ -696,135 +715,6 @@ class _HomeScreenState extends State { return value.toString(); } - Widget getActivityButton(value) { - return Container( - width: MediaQuery.of(context).size.width * 0.24, - padding: EdgeInsets.all(5), - margin: EdgeInsets.all(5), - height: MediaQuery.of(context).orientation == Orientation.portrait - ? MediaQuery.of(context).size.height * 0.15 - : MediaQuery.of(context).size.height * 0.20, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(10), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.all(10), - child: AppText(value.value.toString(), - fontSize: 28, fontWeight: FontWeight.bold)), - Expanded( - child: AppText( - value.kPIParameter, - textOverflow: TextOverflow.clip, - fontSize: 12, - textAlign: TextAlign.center, - ), - ), - ], - ), - ); - } - - Widget dot(Color c) { - return Container( - padding: EdgeInsets.all(5.0), - margin: EdgeInsets.all(5.0), - decoration: BoxDecoration(color: c, shape: BoxShape.circle)); - } - - Widget rowCount(name, int count, Color c) { - return Row( - children: [ - dot(c), - Padding( - padding: EdgeInsets.only(top: 5, bottom: 5), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - name, - color: Colors.black, - textAlign: TextAlign.center, - fontSize: 12, - textOverflow: TextOverflow.ellipsis, - ), - AppText( - ' (' + count.toString() + ')', - color: Colors.black, - textAlign: TextAlign.center, - fontSize: 14, - fontWeight: FontWeight.bold, - ) - ], - )), - ], - ); - } - - Widget getOutPatientStack(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))}); - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - AppText( - value.kPIName, - medium: true, - ), - Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) - ], - ); - } - - getStack(Summaryoptions value, max) { - return Stack(children: [ - Container( - height: 150, - margin: EdgeInsets.all(5), - width: 40, - child: SizedBox(), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), color: Colors.red[50]), - ), - Positioned( - bottom: 0, - child: Container( - child: SizedBox(), - margin: EdgeInsets.all(5), - padding: EdgeInsets.all(10), - height: max != 0 ? (150 * value.value) / max : 0, - width: 40, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.red[300]))), - Container( - height: 150, - margin: EdgeInsets.only(left: 5, top: 5), - padding: EdgeInsets.all(10), - child: RotatedBox( - quarterTurns: 1, - child: Center( - child: Align( - child: AppText( - value.kPIParameter + ' (' + value.value.toString() + ') ', - fontSize: 10, - textAlign: TextAlign.center, - fontWeight: FontWeight.bold, - )), - ), - )) - ]); - } - List getSwipeWidget(model) { return [ RoundedContainer( @@ -832,13 +722,13 @@ class _HomeScreenState extends State { margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: Padding( padding: const EdgeInsets.all(5.0), - child: getOutPatientStack(model.dashboardItemsList[1]))), + child: GetOutPatientStack(model.dashboardItemsList[1]))), RoundedContainer( height: MediaQuery.of(context).size.height * 0.35, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: Padding( padding: const EdgeInsets.all(5.0), - child: getOutPatientStack(model.dashboardItemsList[0]))), + child: GetOutPatientStack(model.dashboardItemsList[0]))), RoundedContainer( height: MediaQuery.of(context).size.height * 0.35, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), @@ -892,19 +782,19 @@ class _HomeScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - rowCount( + RowCounts( model.dashboardItemsList[2] .summaryoptions[0].kPIParameter, model.dashboardItemsList[2] .summaryoptions[0].value, Colors.black), - rowCount( + RowCounts( model.dashboardItemsList[2] .summaryoptions[1].kPIParameter, model.dashboardItemsList[2] .summaryoptions[1].value, Colors.grey), - rowCount( + RowCounts( model.dashboardItemsList[2] .summaryoptions[2].kPIParameter, model.dashboardItemsList[2] @@ -942,21 +832,4 @@ class _HomeScreenState extends State { ])), ]; } - - getSwiperPagiantion(active) { - return active == true - ? Container( - height: 5, - width: 30, - // margin: EdgeInsets.only(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), color: Colors.black), - ) - : Container( - height: 5, - width: 8, - margin: EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), color: Colors.grey)); - } } diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 61cc686c..9c19d629 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/widgets/shared/buttons/secondary_button.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/secondary_button.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -88,7 +88,7 @@ class RadiologyDetailsPage extends StatelessWidget { ), bottomSheet: model.radImageURL.isNotEmpty ? Container( - height: 80, + height: 80, width: double.maxFinite, child: Container( margin: diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 8488c94d..a79bd20c 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -44,406 +44,414 @@ class VitalSignDetailsScreen extends StatelessWidget { appBarTitle: TranslationBase.of(context).vitalSign, body: mode.patientVitalSignsHistory.length > 0 ? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.all(16.0), + children: [ + Expanded( + child: Container( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - "${patient.firstName ?? patient.patientDetails.firstName}'s", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.6, - fontWeight: FontWeight.w600, - ), - AppText( - TranslationBase.of(context).vitalSign, - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 3, - fontWeight: FontWeight.bold, - ) - ], - ), - ), - Container( - height: MediaQuery.of(context).size.height * 0.23, - width: double.infinity, - padding: EdgeInsets.all(12.0), - margin: EdgeInsets.symmetric(horizontal: 16.0), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.circular(16), - border: Border.fromBorderSide(BorderSide( - color: Colors.grey.shade400, - width: 0.4, - )), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - "${TranslationBase.of(context).yourBodyMassIndex} ${mode.bodyMax}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 2.0, - fontWeight: FontWeight.w700, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - mode.getBMIStatus() != 1 - ? '${assetBasePath}underweight_BMI.png' - : '${assetBasePath}underweight_BMI-r.png', - height: - MediaQuery.of(context).size.height * 0.10, - ), - const SizedBox( - height: 4, - ), - AppText( - "${TranslationBase.of(context).bmiUnderWeight}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - color: mode.getBMIStatus() == 1 - ? Color(0XFFD02127) - : null, - fontWeight: FontWeight.w700, - ), - AppText( - "(<18.5)", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - color: mode.getBMIStatus() == 1 - ? Color(0XFFD02127) - : null, - fontWeight: FontWeight.w700, - ), - ], - )), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - mode.getBMIStatus() != 2 - ? '${assetBasePath}health_BMI.png' - : '${assetBasePath}health_BMI-r.png', - height: - MediaQuery.of(context).size.height * 0.10, - ), - const SizedBox( - height: 4, - ), - Container( - child: AppText( - "${TranslationBase.of(context).normal}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 2 - ? Color(0XFFD02127) - : null, - ), - ), - AppText( - "(18.5-24.9)", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 2 - ? Color(0XFFD02127) - : null, - ), - ], - )), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image.asset( - mode.getBMIStatus() != 3 - ? '${assetBasePath}ovrweight_BMI.png' - : '${assetBasePath}ovrweight_BMI-r.png', - height: - MediaQuery.of(context).size.height * 0.10, - ), - const SizedBox( - height: 4, - ), AppText( - "${TranslationBase.of(context).bmiOverWeight}", + "${patient.firstName ?? patient.patientDetails.firstName}'s", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.155, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 3 - ? Color(0XFFD02127) - : null, + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, ), AppText( - "(25-29.9)", + TranslationBase.of(context).vitalSign, fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.155, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 3 - ? Color(0XFFD02127) - : null, - ), + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + ) ], - )), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.23, + width: double.infinity, + padding: EdgeInsets.all(12.0), + margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.circular(16), + border: Border.fromBorderSide(BorderSide( + color: Colors.grey.shade400, + width: 0.4, + )), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image.asset( - mode.getBMIStatus() != 4 - ? '${assetBasePath}Obese_BMI.png' - : '${assetBasePath}Obese_BMI-r.png', - height: - MediaQuery.of(context).size.height * 0.10, - ), - const SizedBox( - height: 4, - ), AppText( - "${TranslationBase.of(context).bmiObese}", + "${TranslationBase.of(context).yourBodyMassIndex} ${mode.bodyMax}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier * 2.0, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, - ), - AppText( - "(30-34.9)", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 1 + ? '${assetBasePath}underweight_BMI.png' + : '${assetBasePath}underweight_BMI-r.png', + height: + MediaQuery.of(context).size.height * 0.10, + ), + const SizedBox( + height: 4, + ), + AppText( + "${TranslationBase.of(context).bmiUnderWeight}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.15, + color: mode.getBMIStatus() == 1 + ? Color(0XFFD02127) + : null, + fontWeight: FontWeight.w700, + ), + AppText( + "(<18.5)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.15, + color: mode.getBMIStatus() == 1 + ? Color(0XFFD02127) + : null, + fontWeight: FontWeight.w700, + ), + ], + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 2 + ? '${assetBasePath}health_BMI.png' + : '${assetBasePath}health_BMI-r.png', + height: + MediaQuery.of(context).size.height * 0.10, + ), + const SizedBox( + height: 4, + ), + Container( + child: AppText( + "${TranslationBase.of(context).normal}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 2 + ? Color(0XFFD02127) + : null, + ), + ), + AppText( + "(18.5-24.9)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 2 + ? Color(0XFFD02127) + : null, + ), + ], + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 3 + ? '${assetBasePath}ovrweight_BMI.png' + : '${assetBasePath}ovrweight_BMI-r.png', + height: + MediaQuery.of(context).size.height * 0.10, + ), + const SizedBox( + height: 4, + ), + AppText( + "${TranslationBase.of(context).bmiOverWeight}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.155, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 3 + ? Color(0XFFD02127) + : null, + ), + AppText( + "(25-29.9)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.155, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 3 + ? Color(0XFFD02127) + : null, + ), + ], + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 4 + ? '${assetBasePath}Obese_BMI.png' + : '${assetBasePath}Obese_BMI-r.png', + height: + MediaQuery.of(context).size.height * 0.10, + ), + const SizedBox( + height: 4, + ), + AppText( + "${TranslationBase.of(context).bmiObese}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 4 + ? Color(0XFFD02127) + : null, + ), + AppText( + "(30-34.9)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 4 + ? Color(0XFFD02127) + : null, + ), + ], + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 5 + ? '${assetBasePath}Obese_BMI.png' + : '${assetBasePath}Obese_BMI-r.png', + height: + MediaQuery.of(context).size.height * 0.10, + ), + const SizedBox( + height: 4, + ), + FittedBox( + fit: BoxFit.fitWidth, + child: AppText( + "${TranslationBase.of(context).bmiObeseExtreme}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 5 + ? Color(0XFFD02127) + : null, + ), + ), + AppText( + "(35<)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 5 + ? Color(0XFFD02127) + : null, + ), + ], + )), + ], + ) ], - )), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - mode.getBMIStatus() != 5 - ? '${assetBasePath}Obese_BMI.png' - : '${assetBasePath}Obese_BMI-r.png', - height: - MediaQuery.of(context).size.height * 0.10, - ), - const SizedBox( - height: 4, - ), - FittedBox( - fit: BoxFit.fitWidth, - child: AppText( - "${TranslationBase.of(context).bmiObeseExtreme}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 5 - ? Color(0XFFD02127) + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 4), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 6, + mainAxisSpacing: 6, + childAspectRatio: 1.0 / 1.0, + crossAxisCount: 3, + children: [ + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Height, + pageTitle: + TranslationBase.of(context).height, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) : null, - ), - ), - AppText( - "(35<)", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 5 - ? Color(0XFFD02127) - : null, - ), - ], - )), - ], - ) - ], - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.symmetric(horizontal: 8.0), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 4, - mainAxisSpacing: 4, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Height, - pageTitle: - TranslationBase.of(context).height, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + child: Container( + child: VitalSignItem( + des: TranslationBase.of(context).height, + imagePath: "${assetBasePath}height.png", + lastVal: mode.heightCm, + unit: TranslationBase.of(context).cm, ), ), - ) - : null, - child: Container( - child: VitalSignItem( - des: TranslationBase.of(context).height, - imagePath: "${assetBasePath}height.png", - lastVal: mode.heightCm, - unit: TranslationBase.of(context).cm, - ), - ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Weight, - pageTitle: - TranslationBase.of(context).weight, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + ), + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Weight, + pageTitle: + TranslationBase.of(context).weight, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context).weight, + imagePath: "${assetBasePath}weight.png", + unit: TranslationBase.of(context).kg, + lastVal: mode.weightKg, ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).weight, - imagePath: "${assetBasePath}weight.png", - unit: TranslationBase.of(context).kg, - lastVal: mode.weightKg, - ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Temperature, - pageTitle: TranslationBase.of(context) - .temperature, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + ), + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Temperature, + pageTitle: TranslationBase.of(context) + .temperature, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: Container( + child: VitalSignItem( + des: TranslationBase.of(context).temperature, + imagePath: "${assetBasePath}temperature.png", + lastVal: mode.temperatureCelcius, + unit: TranslationBase.of(context).tempC, ), ), - ) - : null, - child: Container( - child: VitalSignItem( - des: TranslationBase.of(context).temperature, - imagePath: "${assetBasePath}temperature.png", - lastVal: mode.temperatureCelcius, - unit: TranslationBase.of(context).tempC, - ), - ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.heart, - pageTitle: - TranslationBase.of(context).heart, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + ), + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.heart, + pageTitle: + TranslationBase.of(context).heart, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context).heart, + imagePath: "${assetBasePath}heart_rate.png", + lastVal: mode.hartRat, + unit: TranslationBase.of(context).bpm, ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).heart, - imagePath: "${assetBasePath}heart_rate.png", - lastVal: mode.hartRat, - unit: TranslationBase.of(context).bpm, - ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Respiration, - pageTitle: TranslationBase.of(context) - .respirationRate, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + ), + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Respiration, + pageTitle: TranslationBase.of(context) + .respirationRate, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context).respirationRate, + imagePath: "${assetBasePath}respiration_rate.png", + lastVal: mode.respirationBeatPerMinute, + unit: + TranslationBase.of(context).respirationSigns, ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).respirationRate, - imagePath: "${assetBasePath}respiration_rate.png", - lastVal: mode.respirationBeatPerMinute, - unit: - TranslationBase.of(context).respirationSigns, - ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.BloodPressure, - pageTitle: TranslationBase.of(context) - .bloodPressure, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + ), + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.BloodPressure, + pageTitle: TranslationBase.of(context) + .bloodPressure, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context).bloodPressure, + imagePath: "${assetBasePath}blood_pressure.png", + lastVal: mode.bloodPressure, + unit: TranslationBase.of(context).sysDias, ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).bloodPressure, - imagePath: "${assetBasePath}blood_pressure.png", - lastVal: mode.bloodPressure, - unit: TranslationBase.of(context).sysDias, + ), + ], + ), ), ), ], ), - ), ), - ], - ) + ), + ], + ) : Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart index 3431a011..a24d1a6b 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart @@ -55,13 +55,17 @@ class VitalSignItem extends StatelessWidget { margin: 0, ), Expanded( - child: AppText( - "$unit", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.2, - fontWeight: FontWeight.w700, - color: HexColor('#B8382C'), - margin: 0, + child: Column( + children: [ + AppText( + "$unit", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.2, + fontWeight: FontWeight.w700, + color: Color(0xFFB8382C), + margin: 0, + ), + ], ), ), ], diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index f165291f..f71b1ee8 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -164,7 +164,7 @@ class ProcedureCard extends StatelessWidget { ), ], ), - Container( + /*Container( alignment: Alignment.centerRight, child: InkWell( onTap: () { @@ -184,7 +184,7 @@ class ProcedureCard extends StatelessWidget { color: Colors.blue, ), ), - ), + ),*/ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 184f9f9a..dd980f33 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -252,7 +252,8 @@ class AddSickLeavScreen extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText('No Sick Leave Found'), + child: AppText( + TranslationBase.of(context).noSickLeave), ) ], ), diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index 6085dc19..895745c3 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -5,19 +5,14 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; class ShowSickLeaveScreen extends StatelessWidget { PatiantInformtion patient; @@ -32,6 +27,7 @@ class ShowSickLeaveScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, + backgroundColor: Colors.grey[100], appBar: PatientProfileHeaderNewDesignAppBar( patient, routeArgs['patientType'] ?? "0", @@ -42,132 +38,153 @@ class ShowSickLeaveScreen extends StatelessWidget { children: [ // PatientProfileHeaderNewDesign( // patient, routeArgs['patientType'], routeArgs['arrivalType']), - Column( - children: model.getAllSIckLeave - .map((GetAllSickLeaveResponse item) { - return RoundedContainer( - child: Column( - children: [ - Container( - decoration: BoxDecoration( - border: Border( - left: BorderSide( - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, - width: 5.0, - ))), - padding: EdgeInsets.all(10), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 4, - child: Wrap( - // mainAxisAlignment: - // MainAxisAlignment.start, + model.getAllSIckLeave.length > 0 + ? Column( + children: model.getAllSIckLeave + .map((GetAllSickLeaveResponse item) { + return RoundedContainer( + child: Column( + children: [ + Container( + decoration: BoxDecoration( + border: Border( + left: BorderSide( + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, + width: 5.0, + ))), + padding: EdgeInsets.all(10), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.all(3), - child: AppText( - item.status == 1 - ? TranslationBase.of(context) - .hold - : item.status == 2 - ? TranslationBase.of( - context) - .active - : TranslationBase.of( - context) - .all, - fontWeight: FontWeight.bold, - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, - ), - ), - Row( - children: [ - AppText(TranslationBase.of(context) - .daysSickleave), - AppText( - item.noOfDays.toString(), - fontWeight: FontWeight.bold, - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .startDate + - ' ', - ), - Flexible( + Expanded( + flex: 4, + child: Wrap( + // mainAxisAlignment: + // MainAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(3), child: AppText( - DateUtils - .convertStringToDateFormat( - item.startDate, - 'dd-MMM-yyyy'), - fontWeight: FontWeight.bold, - )) - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - AppText( - item.remarks ?? "", + item.status == 1 + ? TranslationBase.of( + context) + .hold + : item.status == 2 + ? TranslationBase.of( + context) + .active + : TranslationBase.of( + context) + .all, + fontWeight: FontWeight.bold, + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, + ), + ), + Row( + children: [ + AppText(TranslationBase.of( + context) + .daysSickleave), + AppText( + item.noOfDays.toString(), + fontWeight: FontWeight.bold, + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .startDate + + ' ', + ), + Flexible( + child: AppText( + DateUtils + .convertStringToDateFormat( + item.startDate, + 'dd-MMM-yyyy'), + fontWeight: FontWeight.bold, + )) + ], ), - (item.status == 1) - ? IconButton( - icon: Image.asset( - 'assets/images/edit.png'), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + AppText( + item.remarks ?? "", + ), + (item.status == 1) + ? IconButton( + icon: Image.asset( + 'assets/images/edit.png'), - // color: Colors.green, //Colors.black, - onPressed: () => { - if (item.status == 1) - { - DrAppToastMsg.showErrorToast( - TranslationBase.of( - context) - .sickleaveonhold) - } - // else - // { - // openSickLeave( - // context, - // true, - // extendedData: - // item) - // } - }, - ) - : SizedBox() - ]), - ], - ), - SizedBox( - width: 20, + // color: Colors.green, //Colors.black, + onPressed: () => { + if (item.status == + 1) + { + DrAppToastMsg.showErrorToast( + TranslationBase.of( + context) + .sickleaveonhold) + } + // else + // { + // openSickLeave( + // context, + // true, + // extendedData: + // item) + // } + }, + ) + : SizedBox() + ]), + ], + ), + SizedBox( + width: 20, + ), + ], + ), ), ], - ), - ), - ], - )), - ], - )); - }).toList(), - ) + )), + ], + )); + }).toList(), + ) + : Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + TranslationBase.of(context).noSickLeave), + ) + ], + ), + ) ], ), ), diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart new file mode 100644 index 00000000..0dad5cec --- /dev/null +++ b/lib/widgets/dashboard/activity_button.dart @@ -0,0 +1,39 @@ +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class GetActivityButton extends StatelessWidget { + final value; + GetActivityButton(this.value); + @override + Widget build(BuildContext context) { + return Container( + width: 120, + padding: EdgeInsets.all(5), + margin: EdgeInsets.all(5), + height: 120, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(20), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: AppText(value.value.toString(), + fontSize: 28, fontWeight: FontWeight.bold)), + Expanded( + child: AppText( + value.kPIParameter, + textOverflow: TextOverflow.clip, + fontSize: 12, + textAlign: TextAlign.center, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ); + } +} diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart new file mode 100644 index 00000000..d5da97c6 --- /dev/null +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -0,0 +1,68 @@ +import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class GetOutPatientStack extends StatelessWidget { + final value; + GetOutPatientStack(this.value); + @override + Widget build(BuildContext context) { + 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))}); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText( + value.kPIName, + medium: true, + ), + Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) + ], + ); + } + + getStack(Summaryoptions value, max) { + return Stack(children: [ + Container( + height: 150, + margin: EdgeInsets.all(5), + width: 40, + child: SizedBox(), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), color: Colors.red[50]), + ), + Positioned( + bottom: 0, + child: Container( + child: SizedBox(), + margin: EdgeInsets.all(5), + padding: EdgeInsets.all(10), + height: max != 0 ? (150 * value.value) / max : 0, + width: 40, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.red[300]))), + Container( + height: 150, + margin: EdgeInsets.only(left: 5, top: 5), + padding: EdgeInsets.all(10), + child: RotatedBox( + quarterTurns: 1, + child: Center( + child: Align( + child: AppText( + value.kPIParameter + ' (' + value.value.toString() + ') ', + fontSize: 10, + textAlign: TextAlign.center, + fontWeight: FontWeight.bold, + )), + ), + )) + ]); + } +} diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart new file mode 100644 index 00000000..c56613da --- /dev/null +++ b/lib/widgets/dashboard/row_count.dart @@ -0,0 +1,45 @@ +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class RowCounts extends StatelessWidget { + final name; + final int count; + final Color c; + RowCounts(this.name, this.count, this.c); + @override + Widget build(BuildContext context) { + return Row( + children: [ + dot(c), + Padding( + padding: EdgeInsets.only(top: 5, bottom: 5), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + name, + color: Colors.black, + textAlign: TextAlign.center, + fontSize: 12, + textOverflow: TextOverflow.ellipsis, + ), + AppText( + ' (' + count.toString() + ')', + color: Colors.black, + textAlign: TextAlign.center, + fontSize: 14, + fontWeight: FontWeight.bold, + ) + ], + )), + ], + ); + } + + Widget dot(Color c) { + return Container( + padding: EdgeInsets.all(5.0), + margin: EdgeInsets.all(5.0), + decoration: BoxDecoration(color: c, shape: BoxShape.circle)); + } +} diff --git a/lib/widgets/dashboard/swiper_rounded_pagination.dart b/lib/widgets/dashboard/swiper_rounded_pagination.dart new file mode 100644 index 00000000..c3b73dd3 --- /dev/null +++ b/lib/widgets/dashboard/swiper_rounded_pagination.dart @@ -0,0 +1,24 @@ +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class SwiperRoundedPagination extends StatelessWidget { + final active; + SwiperRoundedPagination(this.active); + @override + Widget build(BuildContext context) { + return active == true + ? Container( + height: 5, + width: 30, + // margin: EdgeInsets.only(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), color: Colors.black), + ) + : Container( + height: 5, + width: 8, + margin: EdgeInsets.all(2), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), color: Colors.grey)); + } +} diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 9acf6c96..d8d5a928 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -32,7 +32,7 @@ class AppText extends StatefulWidget { AppText( this.text, { this.color = Colors.black, - this.fontWeight = FontWeight.normal, + this.fontWeight, this.variant, this.fontSize, this.fontFamily = 'Poppins', diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index e135310a..36f9d983 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -107,7 +107,7 @@ class _AppButtonState extends State { shape: RoundedRectangleBorder( side: BorderSide( color: - widget.hasBorder ? widget.borderColor : widget.color, + widget.hasBorder ? widget.borderColor : widget.color ?? Color(0xFFB8382C), width: 0.8, ), borderRadius: BorderRadius.all(Radius.circular(widget.radius))), diff --git a/pubspec.lock b/pubspec.lock index 46eca7cf..d338a618 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -901,6 +901,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.10.0-nullsafety.1" + sticky_headers: + dependency: "direct main" + description: + name: sticky_headers + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.8+1" stream_channel: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 3318ff05..1dd7ae8b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -78,7 +78,7 @@ dependencies: # Flutter Html View flutter_html: 1.0.2 - + sticky_headers: "^0.1.8" #speech to text