You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.4 KiB
Dart
49 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class HomePageCard extends StatelessWidget {
|
|
const HomePageCard(
|
|
{this.hasBorder = false,
|
|
required this.imageName,
|
|
required this.child,
|
|
required this.onTap,
|
|
required this.color,
|
|
this.opacity = 0.4,
|
|
required this.margin,
|
|
required this.width,
|
|
required this.gradient});
|
|
|
|
final bool hasBorder;
|
|
final String imageName;
|
|
final Widget child;
|
|
final GestureTapCallback onTap;
|
|
final Color color;
|
|
final double opacity;
|
|
final double width;
|
|
final EdgeInsets margin;
|
|
final LinearGradient gradient;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return InkWell(
|
|
onTap: onTap,
|
|
child: Container(
|
|
width: width,
|
|
margin: this.margin,
|
|
decoration: BoxDecoration(
|
|
gradient: gradient,
|
|
borderRadius: BorderRadius.circular(20.0),
|
|
border: hasBorder ? Border.all(width: 1.0, color: const Color(0xffcccccc)) : Border.all(width: 0.0, color: Colors.transparent),
|
|
image: imageName != null
|
|
? DecorationImage(
|
|
image: AssetImage('assets/images/patient/ucaf.png'),
|
|
fit: BoxFit.cover,
|
|
colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn),
|
|
)
|
|
: null,
|
|
),
|
|
child: child,
|
|
),
|
|
);
|
|
}
|
|
}
|