From 47357fe84e7a3bc2aaabeb9b5759777f8bda0017 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 7 Dec 2021 16:31:05 +0200 Subject: [PATCH 1/3] bottom nav and dashboard_referral_patient --- .../home/dashboard_referral_patient.dart | 17 ++-- lib/widgets/dashboard/out_patient_stack.dart | 44 +--------- .../shared/bottom_navigation_item.dart | 81 +++++++++++-------- 3 files changed, 59 insertions(+), 83 deletions(-) diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index e616f1ca..147bd2ab 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -1,4 +1,5 @@ import 'package:charts_flutter/flutter.dart' as charts; +import 'package:doctor_app_flutter/config/config.dart'; 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'; @@ -96,19 +97,19 @@ class DashboardReferralPatient extends StatelessWidget { RowCounts( dashboardItemList[2].summaryoptions[0].kPIParameter, dashboardItemList[2].summaryoptions[0].value, - Colors.black, + AppGlobal.appTextColor, height: height, ), RowCounts( dashboardItemList[2].summaryoptions[1].kPIParameter, dashboardItemList[2].summaryoptions[1].value, - Colors.grey, + Color(0xFFC8D0DC), height: height, ), RowCounts( dashboardItemList[2].summaryoptions[2].kPIParameter, dashboardItemList[2].summaryoptions[2].value, - Colors.red, + Color(0xFFEC6666), height: height, ), ], @@ -132,7 +133,7 @@ class DashboardReferralPatient extends StatelessWidget { ) ], ), - top: height * (SizeConfig.isHeightVeryShort ? 0.35 : 0.40), + top: height * (SizeConfig.isHeightVeryShort ? 0.35 : 0.35), left: 0, right: 0) ]), @@ -146,11 +147,11 @@ class DashboardReferralPatient extends StatelessWidget { static List> _createReferralData(List dashboardItemList) { final data = [ new GaugeSegment(dashboardItemList[2].summaryoptions[0].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[0].value), charts.MaterialPalette.black), + getValue(dashboardItemList[1].summaryoptions[0].value), charts.ColorUtil.fromDartColor(AppGlobal.appTextColor)), new GaugeSegment(dashboardItemList[2].summaryoptions[1].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[1].value), charts.MaterialPalette.gray.shadeDefault), + getValue(dashboardItemList[1].summaryoptions[1].value), charts.ColorUtil.fromDartColor(Color(0xFFC6CEDA),),), new GaugeSegment(dashboardItemList[2].summaryoptions[2].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[2].value), charts.MaterialPalette.red.shadeDefault), + getValue(dashboardItemList[1].summaryoptions[2].value), charts.ColorUtil.fromDartColor(Color(0xFFEC6666),),), ]; return [ @@ -158,6 +159,8 @@ class DashboardReferralPatient extends StatelessWidget { id: 'Segments', domainFn: (GaugeSegment segment, _) => segment.segment, measureFn: (GaugeSegment segment, _) => segment.size, + strokeWidthPxFn: (GaugeSegment segment, _)=>200, + data: data, colorFn: (GaugeSegment segment, _) => segment.color, ) diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index fb67d954..4fa6ac82 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -1,5 +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/screens/home/label.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'; @@ -88,7 +89,7 @@ class GetOutPatientStack extends StatelessWidget { gradient: LinearGradient( begin: Alignment.topLeft, end: Alignment(0.0, 1.0), // 10% of the width, so there are ten blinds. - colors: [Color(0x8FF5F6FA), Colors.red[50]], // red to yellow + colors: [Color(0x8FF5F6FA), Colors.red[100]], // red to yellow tileMode: TileMode.mirror, // repeats the gradient over the canvas ), borderRadius: BorderRadius.circular(4), @@ -105,7 +106,7 @@ class GetOutPatientStack extends StatelessWidget { height: max != 0 ? ((barHeight) * value.value) / max : 0, decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), - color: Color(0x63D02127), + color: Color(0xFFD02127).withOpacity(0.39), ), ), ), @@ -149,42 +150,3 @@ class GetOutPatientStack extends StatelessWidget { } -// 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/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 02b64c78..151855a0 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -1,4 +1,6 @@ import 'package:badges/badges.dart'; +import 'package:doctor_app_flutter/config/config.dart'; +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/core/viewModel/doctor_replay_view_model.dart'; import 'package:flutter/cupertino.dart'; @@ -16,16 +18,14 @@ class BottomNavigationItem extends StatelessWidget { final String name; final DashboardViewModel dashboardViewModel; - - BottomNavigationItem( {this.icon, this.activeIcon, this.changeIndex, this.index, this.currentIndex, - this.name, this.dashboardViewModel}); - + this.name, + this.dashboardViewModel}); @override Widget build(BuildContext context) { @@ -41,51 +41,62 @@ class BottomNavigationItem extends StatelessWidget { child: Stack( alignment: AlignmentDirectional.center, children: [ + if (currentIndex == index) + Positioned( + top: 0, + child: Container( - + color: AppGlobal.appRedColor, + width: 100, + height: 3, + )), Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ - SizedBox(height: 15,), + SizedBox( + height: 15, + ), Container( child: Icon(currentIndex == index ? activeIcon : icon, - color: currentIndex == index - ? Color(0xFF333C45) - : Theme.of(context).dividerColor, - size: 22.0), + color: AppGlobal.appTextColor, size: 22.0), + ), + SizedBox( + height: 8, ), - SizedBox(height: 5,), Expanded( - child: Text( - name, - style: TextStyle( - color: currentIndex == index - ? Theme.of(context).primaryColor - : Theme.of(context).dividerColor, - ), - ), + child: Text(name ?? "", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth() * + 2, + color: AppGlobal.appTextColor, + fontWeight: FontWeight.w600) //#989898, + ), ), ], ), - if(currentIndex == 3 && dashboardViewModel.notRepliedCount != 0) - Positioned( - right: 18.0, - bottom: 40.0, - child: Badge( - toAnimate: false, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, - badgeColor: Colors.red[800], - borderRadius: BorderRadius.circular(8), - badgeContent: Container( - // padding: EdgeInsets.all(2.0), - child: Text(dashboardViewModel.notRepliedCount.toString(), - style: TextStyle( - color: Colors.white, fontSize: 12.0)), + if (currentIndex == 3 && + dashboardViewModel.notRepliedCount != 0) + Positioned( + right: 18.0, + bottom: 40.0, + child: Badge( + toAnimate: false, + position: BadgePosition.topEnd(), + shape: BadgeShape.circle, + badgeColor: Colors.red[800], + borderRadius: BorderRadius.circular(8), + badgeContent: Container( + // padding: EdgeInsets.all(2.0), + child: Text( + dashboardViewModel.notRepliedCount.toString(), + style: + TextStyle(color: Colors.white, fontSize: 12.0)), + ), ), ), - ), ], ), ), From 6c78fda3929cc3d162459ee0f2aa7406a5100a06 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 7 Dec 2021 16:57:14 +0200 Subject: [PATCH 2/3] fix in slider --- .../home/dashboard_referral_patient.dart | 4 ++- lib/widgets/dashboard/activity_button.dart | 2 +- lib/widgets/dashboard/row_count.dart | 26 +++++++++++-------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 147bd2ab..0bae430a 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -110,6 +110,7 @@ class DashboardReferralPatient extends StatelessWidget { dashboardItemList[2].summaryoptions[2].kPIParameter, dashboardItemList[2].summaryoptions[2].value, Color(0xFFEC6666), + height: height, ), ], @@ -128,7 +129,8 @@ class DashboardReferralPatient extends StatelessWidget { children: [ AppText( model.getPatientCount(dashboardItemList[2]).toString(), - fontSize: SizeConfig.textMultiplier * 3.0, + fontSize: SizeConfig.textMultiplier * 3.2, + color: AppGlobal.appTextColor, fontWeight: FontWeight.bold, ) ], diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index f00acef4..b28149b8 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -17,7 +17,7 @@ class GetActivityCard extends StatelessWidget { margin: EdgeInsets.all(SizeConfig.widthMultiplier *1), decoration: BoxDecoration( color: Colors.white, - border: Border.all(width: 1, color: Color(0xFFEFEFEF)), + border: Border.all(width: 1.5, color: Color(0xFFEFEFEF)), borderRadius: BorderRadius.circular(15), ), child: Padding( diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index bf39ed27..820dcd37 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/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'; @@ -24,20 +25,23 @@ class RowCounts extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded( - child: AppText( - name, - color: Colors.black, - textAlign: TextAlign.start, // from TextAlign.center - fontSize: 11, - textOverflow: TextOverflow.ellipsis, - ), + AppText( + name, + color: AppGlobal.appTextColor, + fontWeight: FontWeight.w400, + textAlign: TextAlign.start, // from TextAlign.center + fontSize: 14, + letterSpacing: -0.84, + + textOverflow: TextOverflow.ellipsis, ), + SizedBox(width: 4,), AppText( - ' (' + count.toString() + ')', - color: Colors.black, + count.toString(), + color: AppGlobal.appTextColor, textAlign: TextAlign.center, - fontSize: 12, + fontSize: 14, + letterSpacing: -0.84, fontWeight: FontWeight.bold, ) ], From a02e89febbd23ae0a8f3596f03cc9baa529cbe2a Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 7 Dec 2021 17:31:25 +0200 Subject: [PATCH 3/3] add verfication svgs --- lib/widgets/auth/method_type_card.dart | 133 +++++++++++++----- .../auth/verification_methods_list.dart | 9 +- pubspec.lock | 2 +- pubspec.yaml | 3 +- 4 files changed, 109 insertions(+), 38 deletions(-) diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 6d091756..34b5938c 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -1,21 +1,91 @@ +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'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:hexcolor/hexcolor.dart'; +// class MethodTypeCard extends StatelessWidget { +// const MethodTypeCard({ +// Key key, +// this.assetPath, +// this.onTap, +// this.label, this.height = 20, this.isSvg = true, +// }) : super(key: key); +// final String assetPath; +// final Function onTap; +// final String label; +// final double height; +// final bool isSvg; +// +// @override +// Widget build(BuildContext context) { +// return InkWell( +// onTap: onTap, +// child: Container( +// margin: EdgeInsets.all(10), +// decoration: BoxDecoration( +// color: Colors.white, +// borderRadius: BorderRadius.all( +// Radius.circular(10), +// ), +// border: Border.all( +// color: HexColor('#707070'), +// width: 0.1), +// ), +// height: 170, +// child: Padding( +// padding: EdgeInsets.fromLTRB(20, 15, 20, 15), +// child: Column( +// mainAxisAlignment: MainAxisAlignment.center, +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Row( +// children: [ +// isSvg?SvgPicture.asset(assetPath, height: 60, +// width: 60,):Image.asset( +// assetPath, +// height: 60, +// width: 60, +// ), +// ], +// ), +// SizedBox( +// height:height , +// ), +// AppText( +// label, +// fontSize: 14, +// color: Color(0xFF2E303A), +// fontWeight: FontWeight.bold, +// ) +// ], +// ), +// )), +// ); +// } +// } +// +// +// + class MethodTypeCard extends StatelessWidget { const MethodTypeCard({ Key key, - this.assetPath, - this.onTap, - this.label, this.height = 20, + this.assetPath, + this.onTap, + this.label, + this.height = 20, this.isSvg = true, }) : super(key: key); final String assetPath; - final Function onTap; + final GestureTapCallback onTap; final String label; final double height; + final bool isSvg; + @override Widget build(BuildContext context) { + double cardHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort? 22 : SizeConfig.isHeightLarge?25:20); return InkWell( onTap: onTap, child: Container( @@ -25,38 +95,37 @@ class MethodTypeCard extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10), ), - border: Border.all( - color: HexColor('#707070'), - width: 0.1), + border: Border.all(color: HexColor('#707070'), width: 0.1), ), - height: 170, + height: cardHeight, child: Padding( - padding: EdgeInsets.fromLTRB(20, 15, 20, 15), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Image.asset( - assetPath, - height: 60, - width: 60, - ), - ], - ), - SizedBox( - height:height , - ), - AppText( - label, - fontSize: 14, - color: Color(0xFF2E303A), - fontWeight: FontWeight.bold, - ) - ], + padding: const EdgeInsets.all(12.0), + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + isSvg?SvgPicture.asset(assetPath, width: SizeConfig.widthMultiplier* (14), + height: cardHeight * 0.20): Image.asset( + assetPath, + width: SizeConfig.widthMultiplier* (12), + height: cardHeight * 0.35, + // height: , + ), + SizedBox( + height: height, + ), + AppText( + label, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* (SizeConfig.isHeightVeryShort?3:3.7), + color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ) + ], + ), ), )), ); } } + diff --git a/lib/widgets/auth/verification_methods_list.dart b/lib/widgets/auth/verification_methods_list.dart index 27dbe8bf..97fbb42b 100644 --- a/lib/widgets/auth/verification_methods_list.dart +++ b/lib/widgets/auth/verification_methods_list.dart @@ -37,7 +37,7 @@ class _VerificationMethodsListState extends State { switch (widget.authMethodType) { case AuthMethodTypes.WhatsApp: return MethodTypeCard( - assetPath: 'assets/images/verify-whtsapp.png', + assetPath: 'assets/images/svgs/verification/verify-whtsapp.svg', onTap: () => {widget.authenticateUser(AuthMethodTypes.WhatsApp, true)}, label: TranslationBase @@ -47,7 +47,7 @@ class _VerificationMethodsListState extends State { break; case AuthMethodTypes.SMS: return MethodTypeCard( - assetPath: "assets/images/verify-sms.png", + assetPath: "assets/images/svgs/verification/verify-sms.svg", onTap: () => {widget.authenticateUser(AuthMethodTypes.SMS, true)}, label:TranslationBase .of(context) @@ -56,7 +56,7 @@ class _VerificationMethodsListState extends State { break; case AuthMethodTypes.Fingerprint: return MethodTypeCard( - assetPath: 'assets/images/verification_fingerprint_icon.png', + assetPath: 'assets/images/svgs/verification/verify-finger.svg', onTap: () async { if (await widget.authenticationViewModel .checkIfBiometricAvailable(BiometricType.fingerprint)) { @@ -71,7 +71,7 @@ class _VerificationMethodsListState extends State { break; case AuthMethodTypes.FaceID: return MethodTypeCard( - assetPath: 'assets/images/verification_faceid_icon.png', + assetPath: 'assets/images/svgs/verification/verify-face.svg', onTap: () async { if (await widget.authenticationViewModel .checkIfBiometricAvailable(BiometricType.face)) { @@ -88,6 +88,7 @@ class _VerificationMethodsListState extends State { return MethodTypeCard( assetPath: 'assets/images/login/more_icon.png', onTap: widget.onShowMore, + isSvg: false, label: TranslationBase.of(context).moreVerification, height: 0, ); diff --git a/pubspec.lock b/pubspec.lock index 3f1537d3..55c25acc 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -516,7 +516,7 @@ packages: source: hosted version: "0.3.4" flutter_svg: - dependency: transitive + dependency: "direct main" description: name: flutter_svg url: "https://pub.dartlang.org" diff --git a/pubspec.yaml b/pubspec.yaml index 6423a46c..db678f9e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -60,7 +60,7 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.2 # SVG - #flutter_svg: ^0.17.4 + flutter_svg: ^0.18.1 percent_indicator: ^2.1.1 #Dependency Injection @@ -130,6 +130,7 @@ flutter: - assets/images/ - assets/images/dashboard/ - assets/images/login/ + - assets/images/svgs/verification/ - assets/images/patient/ - assets/images/patient/vital_signs/