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 508bfe88..f5b62368 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -290,9 +290,7 @@ class _HomeScreenState extends State { firstLine: TranslationBase.of(context).patients, secondLine: TranslationBase.of(context).services, ), - SizedBox( - height: 10, - ), + Container( height: 120, child: ListView( @@ -322,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/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index 5e3cda68..f00acef4 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.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'; @@ -30,16 +31,16 @@ class GetActivityCard extends StatelessWidget { value.value.toString(), fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 25, fontWeight: FontWeight.bold, - color: Color(0xFF2B353E), + 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: Color(0xFF2B353E), + color: AppGlobal.appTextColor, textAlign: TextAlign.start, - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w600, letterSpacing: -0.33, ), ],