import 'package:flutter/material.dart'; class GeneralDrawerItem extends StatelessWidget { final String label; final String? subtitle; final IconData? leading; final bool trailing; final Color? color; final VoidCallback? onTap; const GeneralDrawerItem({ super.key, required this.label, this.subtitle, this.leading, this.trailing = false, this.color, this.onTap, }); @override Widget build(BuildContext context) { final onSurface = Theme.of(context).colorScheme.onSurface; return ListTile( onTap: onTap == null ? null : () => onTap!(), leading: leading == null ? null : Icon(leading, color: color ?? onSurface.withOpacity(0.75)), trailing: trailing ? Icon(Icons.keyboard_arrow_right, color: onSurface.withOpacity(0.4)) : null, title: Text( label, style: TextStyle(fontSize: 15, color: color ?? onSurface), ), subtitle: subtitle == null ? null : Text(subtitle!, style: TextStyle(color: onSurface.withOpacity(0.55))), ); } }