small fixes

merge-requests/916/head
Elham Rababh 3 years ago
parent fedb4533c7
commit ecffe99f19

@ -5,29 +5,27 @@ class HomePageCard extends StatelessWidget {
const HomePageCard( const HomePageCard(
{this.hasBorder = false, {this.hasBorder = false,
this.imageName, this.imageName,
@required this.child, this.child,
this.onTap, this.onTap,
Key key, Key key,
this.color, this.color,
this.opacity = 0.4, this.opacity = 0.4,
this.margin}) this.margin, this.width})
: super(key: key); : super(key: key);
final bool hasBorder; final bool hasBorder;
final String imageName; final String imageName;
final Widget child; final Widget child;
final Function onTap; final GestureTapCallback onTap;
final Color color; final Color color;
final double opacity; final double opacity;
final double width;
final EdgeInsets margin; final EdgeInsets margin;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return InkWell(
onTap: onTap, onTap: onTap,
child: Container( child: Container(
width: 120, width: width,
height: MediaQuery.of(context).orientation == Orientation.portrait
? 100
: 200,
margin: this.margin, margin: this.margin,
decoration: BoxDecoration( decoration: BoxDecoration(
color: !hasBorder color: !hasBorder
@ -43,8 +41,7 @@ class HomePageCard extends StatelessWidget {
? DecorationImage( ? DecorationImage(
image: AssetImage('assets/images/dashboard/$imageName'), image: AssetImage('assets/images/dashboard/$imageName'),
fit: BoxFit.cover, fit: BoxFit.cover,
colorFilter: new ColorFilter.mode( colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn),
Colors.black.withOpacity(0.2), BlendMode.dstIn),
) )
: null, : null,
), ),

@ -10,25 +10,28 @@ class HomePatientCard extends StatelessWidget {
final Color backgroundIconColor; final Color backgroundIconColor;
final String text; final String text;
final Color textColor; final Color textColor;
final Function onTap; final VoidCallback onTap;
final double iconSize; final double iconSize;
HomePatientCard({ HomePatientCard({
@required this.backgroundColor, this.backgroundColor,
@required this.backgroundIconColor, this.backgroundIconColor,
this.cardIcon, this.cardIcon,
this.cardIconImage, this.cardIconImage,
@required this.text, this.text,
@required this.textColor, this.textColor,
@required this.onTap, this.onTap,
this.iconSize = 30, this.iconSize = 30,
}); });
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double width = SizeConfig.heightMultiplier*
(SizeConfig.isHeightVeryShort ? 16 : SizeConfig.isHeightLarge?15:13);
return HomePageCard( return HomePageCard(
color: backgroundColor, color: backgroundColor,
margin: EdgeInsets.all(4), width: width,
margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121),
child: Container( child: Container(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
child: Column( child: Column(
@ -67,7 +70,8 @@ class HomePatientCard extends StatelessWidget {
cardIcon != null cardIcon != null
? Icon( ? Icon(
cardIcon, cardIcon,
size: iconSize, size:
SizeConfig.getWidthMultiplier(width: width) * 30,
color: textColor, color: textColor,
) )
: Image.asset( : Image.asset(
@ -90,7 +94,9 @@ class HomePatientCard extends StatelessWidget {
text, text,
color: textColor, color: textColor,
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontSize: SizeConfig.textMultiplier * 1.6, fontSize:
SizeConfig.getTextMultiplierBasedOnWidth(width: width) *
(SizeConfig.isHeightVeryShort ? 11 : 10),
), ),
), ),
), ),

@ -290,9 +290,7 @@ class _HomeScreenState extends State<HomeScreen> {
firstLine: TranslationBase.of(context).patients, firstLine: TranslationBase.of(context).patients,
secondLine: TranslationBase.of(context).services, secondLine: TranslationBase.of(context).services,
), ),
SizedBox(
height: 10,
),
Container( Container(
height: 120, height: 120,
child: ListView( child: ListView(
@ -322,9 +320,9 @@ class _HomeScreenState extends State<HomeScreen> {
colorIndex = 0; colorIndex = 0;
List<Color> backgroundColors = List(3); List<Color> backgroundColors = List(3);
backgroundColors[0] = Color(0xffD02127); backgroundColors[0] = AppGlobal.appRedColor;
backgroundColors[1] = Colors.grey[300]; backgroundColors[1] = Colors.grey[300];
backgroundColors[2] = Color(0xff2B353E); backgroundColors[2] = Color(0xFF2B353E);
List<Color> backgroundIconColors = List(3); List<Color> backgroundIconColors = List(3);
backgroundIconColors[0] = Colors.white12; backgroundIconColors[0] = Colors.white12;
backgroundIconColors[1] = Colors.white38; backgroundIconColors[1] = Colors.white38;

@ -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/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -30,16 +31,16 @@ class GetActivityCard extends StatelessWidget {
value.value.toString(), value.value.toString(),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 25, fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 25,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF2B353E), color: AppGlobal.appTextColor,
letterSpacing: -0.93, letterSpacing: -0.93,
), ),
AppText( AppText(
value.kPIParameter, value.kPIParameter,
textOverflow: TextOverflow.clip, textOverflow: TextOverflow.clip,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 9), fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 9),
color: Color(0xFF2B353E), color: AppGlobal.appTextColor,
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w600,
letterSpacing: -0.33, letterSpacing: -0.33,
), ),
], ],

Loading…
Cancel
Save