import 'package:flutter/material.dart'; class IconWithBg extends StatelessWidget { final IconData icon; final Color color; final Function onPress; const IconWithBg({Key key, this.icon, this.color, this.onPress}) : super(key: key); @override Widget build(BuildContext context) { return Container( margin: EdgeInsets.only(left: 25), width: 40, height: 40, decoration: BoxDecoration( color: Colors.grey[300], borderRadius: BorderRadius.circular(30), ), child: IconButton( icon: Icon(icon), color: color, onPressed: () async { onPress(); }, )); } }