import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:gap/gap.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:tanami_app/core/styles/app_color.dart';

class SettingsListItem extends StatelessWidget {
  final String icon;
  final String title;
  final String trailing;
  final Function() onTapFunc;

  const SettingsListItem({
    super.key,
    required this.icon,
    required this.title,
    required this.trailing,
    required this.onTapFunc,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.symmetric(
        vertical: 8.0,
      ),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(22.0),
        color: AppColor.fillColor,
      ),
      child: ListTile(
        onTap: onTapFunc,
        leading: SvgPicture.asset(icon),
        title: Text(
          title,
          style: GoogleFonts.dmSans(
              fontSize: 14,
              fontWeight: FontWeight.w600,
              color: AppColor.textLabelColor),
        ),
        trailing: Row(
          mainAxisSize: MainAxisSize.min,
          children: [
            Text(trailing,
                style: GoogleFonts.dmSans(
                    fontSize: 15,
                    fontWeight: FontWeight.w500,
                    color: AppColor.plainBlack)),
            const Gap(10),
            const Icon(Icons.arrow_forward_ios, size: 16.0),
          ],
        ),
      ),
    );
  }
}
