|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/home/home_page_card.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
class HomePatientCard extends StatelessWidget {
|
|
|
|
|
final Color backgroundColor;
|
|
|
|
|
final IconData cardIcon;
|
|
|
|
|
final Color backgroundIconColor;
|
|
|
|
|
final String text;
|
|
|
|
|
final Color textColor;
|
|
|
|
|
final GestureTapCallback onTap;
|
|
|
|
|
final double iconSize;
|
|
|
|
|
|
|
|
|
|
HomePatientCard({
|
|
|
|
|
required this.backgroundColor,
|
|
|
|
|
required this.backgroundIconColor,
|
|
|
|
|
required this.cardIcon,
|
|
|
|
|
required this.text,
|
|
|
|
|
required this.textColor,
|
|
|
|
|
required 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,
|
|
|
|
|
width: width,
|
|
|
|
|
margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121),
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.all(8),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Stack(
|
|
|
|
|
children: [
|
|
|
|
|
Positioned(
|
|
|
|
|
top: SizeConfig.isHeightVeryShort ? 8 : 8,
|
|
|
|
|
left: SizeConfig.isHeightVeryShort ? 5 : 10,
|
|
|
|
|
width: SizeConfig.getWidthMultiplier(width: width) * 10,
|
|
|
|
|
height: SizeConfig.getWidthMultiplier(width: width) * 15,
|
|
|
|
|
child: Icon(
|
|
|
|
|
cardIcon,
|
|
|
|
|
size: SizeConfig.getWidthMultiplier(width: width) *
|
|
|
|
|
(SizeConfig.isHeightVeryShort ? 45 : 60),
|
|
|
|
|
color: backgroundIconColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Icon(
|
|
|
|
|
cardIcon,
|
|
|
|
|
size:
|
|
|
|
|
SizeConfig.getWidthMultiplier(width: width) * 22,
|
|
|
|
|
color: textColor,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
child: AppText(
|
|
|
|
|
text,
|
|
|
|
|
color: textColor,
|
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
|
fontSize:
|
|
|
|
|
SizeConfig.getTextMultiplierBasedOnWidth(width: width) *
|
|
|
|
|
(SizeConfig.isHeightVeryShort ? 11 : 10),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
hasBorder: false,
|
|
|
|
|
onTap: onTap,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|