side_menu_item.dart 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_clock/model/constants.dart';
  3. class SideMenuItem extends StatelessWidget {
  4. const SideMenuItem({
  5. Key? key,
  6. required this.isActive,
  7. this.isHover = false,
  8. required this.itemCount,
  9. this.showBorder = true,
  10. required this.iconSrc,
  11. required this.title,
  12. required this.press,
  13. }) : super(key: key);
  14. final bool isActive, isHover, showBorder;
  15. final int itemCount;
  16. final String iconSrc, title;
  17. final VoidCallback press;
  18. @override
  19. Widget build(BuildContext context) {
  20. return Padding(
  21. padding: const EdgeInsets.only(top: kDefaultPadding),
  22. child: InkWell(
  23. onTap: press,
  24. child: Row(
  25. children: [
  26. SizedBox(width: kDefaultPadding / 4),
  27. Expanded(
  28. child: Container(
  29. padding: EdgeInsets.only(bottom: 15, right: 5),
  30. decoration: showBorder
  31. ? BoxDecoration(
  32. border: Border(
  33. bottom: BorderSide(color: Color(0xFFDFE2EF)),
  34. ),
  35. )
  36. : null,
  37. child: Row(
  38. children: [
  39. SizedBox(width: kDefaultPadding * 0.75),
  40. Text(
  41. title,
  42. style: Theme.of(context).textTheme.button?.copyWith(
  43. color:
  44. (isActive || isHover) ? kTextColor : kGrayColor,
  45. ),
  46. ),
  47. ],
  48. ),
  49. ),
  50. ),
  51. ],
  52. ),
  53. ),
  54. );
  55. }
  56. }