import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class MenuItem extends StatelessWidget { final VoidCallback onTap; final IconData icon; final String title; const MenuItem({ super.key, required this.onTap, required this.icon, required this.title, }); @override Widget build(BuildContext context) { return Container( height: 150, margin: EdgeInsets.all(5), child: Material( color: Colors.transparent, child: InkWell( borderRadius: BorderRadius.circular(30), splashColor: Colors.blue.withAlpha(30), highlightColor: Colors.blue.withAlpha(60), onTap: onTap, child: Container( margin: EdgeInsets.all(10), decoration: BoxDecoration( borderRadius: BorderRadius.circular(30), color: Colors.blue[300]), child: Flex( direction: Axis.vertical, children: [ Expanded( flex: 2, child: Icon( icon, size: 70, color: Colors.white, )), Expanded(child: Text(title)) ], ), ), ), ) ); } } // return InkWell( // splashColor: Colors.blue.withAlpha(30), // highlightColor: Colors.blue.withAlpha(60), // onTap: () { // // }, // child: Container( // margin: EdgeInsets.all(20), // decoration: BoxDecoration( // shape: BoxShape.circle, // color: Colors.orange // ), // child: Flex( // direction: Axis.vertical, // children: [ // Icon(Icons.ac_unit), // Text('data') // ], // ), // ), // );