From 2bff3a594c268d281a8c38f9e5c8d29e422f8b31 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 30 May 2021 15:25:56 +0300 Subject: [PATCH] first step from fix home page design --- ios/Podfile.lock | 2 +- lib/config/config.dart | 4 +-- .../home/dashboard_slider-item-widget.dart | 6 ++-- lib/screens/home/dashboard_swipe_widget.dart | 4 +-- lib/screens/home/home_page_card.dart | 6 ++-- lib/screens/home/home_patient_card.dart | 10 +++---- lib/screens/home/home_screen.dart | 29 +++++++++---------- lib/widgets/dashboard/activity_button.dart | 9 +++--- lib/widgets/dashboard/out_patient_stack.dart | 10 +++---- lib/widgets/dashboard/row_count.dart | 5 ++-- .../profile/profile-welcome-widget.dart | 5 ++-- pubspec.lock | 6 ++-- 12 files changed, 47 insertions(+), 49 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 59cdf14c..1cf7499c 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -328,4 +328,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.0.rc.1 diff --git a/lib/config/config.dart b/lib/config/config.dart index c8af8ad9..0283577e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 4b7c4f46..62176ae8 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -18,18 +18,18 @@ class DashboardSliderItemWidget extends StatelessWidget { children: [ AppText( item.kPIName, - fontSize: SizeConfig.textMultiplier * 2.2, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, fontWeight: FontWeight.bold, ), ], ), new Container( - height: 110, + height: SizeConfig.heightMultiplier* 20, child: ListView( scrollDirection: Axis.horizontal, children: List.generate(item.summaryoptions.length, (int index) { - return GetActivityButton(item.summaryoptions[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 de5cc05f..05065539 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -143,14 +143,14 @@ class _DashboardSwipeWidgetState extends State { AppText( TranslationBase.of(context) .patients, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, fontWeight: FontWeight.bold, fontHeight: 0.5, ), AppText( TranslationBase.of(context) .referral, - fontSize: 22, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, fontWeight: FontWeight.bold, ), ], diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 503bbe60..6da90d5c 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -24,10 +25,7 @@ class HomePageCard extends StatelessWidget { return InkWell( onTap: onTap, child: Container( - width: 120, - height: MediaQuery.of(context).orientation == Orientation.portrait - ? 100 - : 200, + width: SizeConfig.widthMultiplier * 22, margin: this.margin, decoration: BoxDecoration( color: !hasBorder diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index bdaac7a7..a0a24b89 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -35,13 +35,13 @@ class HomePatientCard extends StatelessWidget { child: Stack( children: [ Positioned( - bottom: 0.1, - right: 0.5, - width: 23.0, + bottom: 0.01, + right: 0.2, + width: 10.0, height: 25.0, child: Icon( cardIcon, - size: 60, + size: SizeConfig.widthMultiplier* 15, color: backgroundIconColor, ), ), @@ -52,7 +52,7 @@ class HomePatientCard extends StatelessWidget { children: [ Icon( cardIcon, - size: 30, + size: SizeConfig.widthMultiplier* 8, color: textColor, ), SizedBox( diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index c305b752..9ee7a6f5 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_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'; @@ -48,7 +49,6 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { bool isLoading = false; ProjectViewModel projectsProvider; - var _isInit = true; DoctorProfileModel profile; bool isExpanded = false; bool isInpatient = false; @@ -87,7 +87,7 @@ class _HomeScreenState extends State { child: Stack(children: [ IconButton( icon: Image.asset('assets/images/menu.png', - height: 50, width: 50), + width:SizeConfig.widthMultiplier* 7,), iconSize: 18, color: Colors.black, onPressed: () => Scaffold.of(context).openDrawer(), @@ -112,7 +112,7 @@ class _HomeScreenState extends State { ? projectsProvider .doctorClinicsList[0].clinicID : clinicId, - iconSize: 25, + iconSize: SizeConfig.widthMultiplier* 7, elevation: 16, selectedItemBuilder: (BuildContext context) { @@ -122,7 +122,7 @@ class _HomeScreenState extends State { return Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: - MainAxisAlignment.end, + MainAxisAlignment.start, children: [ Column( mainAxisAlignment: @@ -159,8 +159,8 @@ class _HomeScreenState extends State { fontSize: projectsProvider .isArabic - ? 10 - : 11, + ? SizeConfig.widthMultiplier* 3.5 + : SizeConfig.widthMultiplier* 4, textAlign: TextAlign .center, @@ -169,8 +169,9 @@ class _HomeScreenState extends State { ], ), AppText(item.clinicName, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.width * .6) * 5, color: Colors.black, + textOverflow:TextOverflow.ellipsis , fontWeight: FontWeight.bold, textAlign: TextAlign.end), @@ -264,8 +265,7 @@ class _HomeScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 10, - ), + height: SizeConfig.heightMultiplier *1, ), Container( child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -273,30 +273,27 @@ class _HomeScreenState extends State { children: [ AppText( TranslationBase.of(context).patients, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* 3, fontWeight: FontWeight.bold, fontHeight: .5, ), AppText( TranslationBase.of(context).services, - fontSize: 22, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* 6, fontWeight: FontWeight.bold, ), ], )), SizedBox( - height: 10, + height: SizeConfig.heightMultiplier *1, ), Container( - height: 120, + height: SizeConfig.heightMultiplier* 18, child: ListView( scrollDirection: Axis.horizontal, children: [ ...homePatientsCardsWidget(model), ])), - SizedBox( - height: 20, - ), ], ), ), diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index ff9db962..ed38de96 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -1,10 +1,11 @@ +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) { @@ -24,14 +25,14 @@ class GetActivityButton extends StatelessWidget { children: [ AppText( value.value.toString(), - fontSize: 27, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.height * 0.125)* 12, fontWeight: FontWeight.bold, color: Color(0xFF2B353E), ), AppText( value.kPIParameter, textOverflow: TextOverflow.clip, - fontSize: 10, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.height * 0.125)* 12, color: Color(0xFF2B353E), textAlign: TextAlign.start, fontWeight: FontWeight.w700, diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index fe05d69d..41fe28e2 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; 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'; @@ -20,11 +21,10 @@ class GetOutPatientStack extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Container( - height: 30, child: AppText( value.kPIName, medium: true, - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, ), ), Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) @@ -63,7 +63,7 @@ class GetOutPatientStack extends StatelessWidget { ), ), Container( - height: (MediaQuery.of(context).size.height * 0.24 ), + height: MediaQuery.of(context).size.height * 0.20, margin: EdgeInsets.only(left: 5, top: 5), padding: EdgeInsets.all(10), child: RotatedBox( @@ -75,14 +75,14 @@ class GetOutPatientStack extends StatelessWidget { children: [ AppText( value.kPIParameter, - fontSize: 10, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, textAlign: TextAlign.center, color: Color(0xFF2B353E), fontWeight: FontWeight.w700, ), AppText( ' (' + value.value.toString() + ') ', - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, textAlign: TextAlign.center, color: Color(0xFF2B353E), fontWeight: FontWeight.bold, diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index a22932f4..a23fb8b9 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'; @@ -24,7 +25,7 @@ class RowCounts extends StatelessWidget { name, color: Colors.black, textAlign: TextAlign.start, // from TextAlign.center - fontSize: 11, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, textOverflow: TextOverflow.ellipsis, ), ), @@ -32,7 +33,7 @@ class RowCounts extends StatelessWidget { ' (' + count.toString() + ')', color: Colors.black, textAlign: TextAlign.center, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2, fontWeight: FontWeight.bold, ) ], diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index 53228bc2..a7621115 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -35,8 +36,8 @@ class ProfileWelcomeWidget extends StatelessWidget { child: Image.network( authenticationViewModel.doctorProfile.doctorImageURL, fit: BoxFit.fill, - width: 75, - height: 75, + width: SizeConfig.widthMultiplier* 11, + height: SizeConfig.widthMultiplier* 11, ), ), backgroundColor: Colors.transparent, diff --git a/pubspec.lock b/pubspec.lock index 613c2753..4b6a9b7a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -629,7 +629,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: @@ -921,7 +921,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: @@ -1119,5 +1119,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <=2.11.0-213.1.beta" + dart: ">=2.10.0 <2.11.0" flutter: ">=1.22.0 <2.0.0"