finish home-refactoring
parent
f1babb776b
commit
4ce9a3c5bf
@ -0,0 +1,83 @@
|
|||||||
|
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 Function onTap;
|
||||||
|
|
||||||
|
HomePatientCard({
|
||||||
|
@required this.backgroundColor,
|
||||||
|
@required this.backgroundIconColor,
|
||||||
|
@required this.cardIcon,
|
||||||
|
@required this.text,
|
||||||
|
@required this.textColor,
|
||||||
|
@required this.onTap,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return HomePageCard(
|
||||||
|
color: backgroundColor,
|
||||||
|
margin: EdgeInsets.all(4),
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(8),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Positioned(
|
||||||
|
bottom: 0.1,
|
||||||
|
right: 0.5,
|
||||||
|
width: 23.0,
|
||||||
|
height: 25.0,
|
||||||
|
child: Icon(
|
||||||
|
cardIcon,
|
||||||
|
size: 60,
|
||||||
|
color: backgroundIconColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
cardIcon,
|
||||||
|
size: 30,
|
||||||
|
color: textColor,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 4,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: AppText(
|
||||||
|
text,
|
||||||
|
color: textColor,
|
||||||
|
textAlign: TextAlign.start,
|
||||||
|
fontSize: SizeConfig.textMultiplier * 1.6,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
hasBorder: false,
|
||||||
|
onTap: onTap,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue