import 'package:flutter/material.dart'; class CardHome extends StatelessWidget { final image; final backgroundImage; final text; final textColor; const CardHome( {@required this.image, @required this.backgroundImage, @required this.text, @required this.textColor}); @override Widget build(BuildContext context) { return GestureDetector( onTap: () {}, child: Container( height: 140.0, margin: EdgeInsets.fromLTRB(9.0, 9.0, 8.0, 9.0), decoration: BoxDecoration( boxShadow: [ BoxShadow( color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0 ) ], image: DecorationImage( image: AssetImage(this.backgroundImage), fit: BoxFit.fill), borderRadius: BorderRadius.circular(5)), child: Column( children: [ Container( margin: EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 5.0), child: Image.asset(this.image, width: 60.0, height: 60.0), ), Container( width: MediaQuery.of(context).size.width * 0.29, padding: EdgeInsets.all(5.0), child: Text(this.text, textAlign: TextAlign.center, overflow: TextOverflow.clip, style: TextStyle( color: this.textColor, fontSize: 15.0, fontWeight: FontWeight.w500)), ), ], ), ), ); } }