import '../../../../food_delivery_client.dart';

class AppListTile extends StatelessWidget {
  const AppListTile({
    super.key,
    required this.onPressed,
    required this.isSelected,
    required this.svgPath,
    required this.title,
    this.contentPadding,
    this.leading,
    this.titleWidget,
    this.trailing,
    this.titleTextStyle,
    this.subTitle,
  });

  final VoidCallback onPressed;
  final bool isSelected;
  final String svgPath;
  final String title;
  final EdgeInsets? contentPadding;
  final Widget? leading;
  final Widget? titleWidget;
  final Widget? trailing;
  final TextStyle? titleTextStyle;
  final Widget? subTitle;

  @override
  Widget build(BuildContext context) {
    return ListTile(
      onTap: onPressed,
      subtitle: subTitle,
      contentPadding:
          contentPadding ?? EdgeInsetsGeometry.only(left: 20, right: 27),
      leading:leading ?? SvgPicture.asset(svgPath),
      title:
          titleWidget ??
          Text(title, style: titleTextStyle ?? AppTextStyles.size16Regular),
      trailing:
          trailing ?? (isSelected ? SvgPicture.asset(AppIcons.icCheck) : null),
    );
  }
}
