import 'package:flutter/cupertino.dart';

class CheckmarkListOption extends StatelessWidget {
  final String title;
  final bool isSelected;
  final Function? onTap;

  const CheckmarkListOption(this.title, this.isSelected, this.onTap, {super.key});

  @override
  Widget build(BuildContext context) {
    return CupertinoListTile(
        key: key,
        onTap: () { if (onTap != null) { onTap!(); } },
        trailing: isSelected ? const Icon(CupertinoIcons.check_mark, color: CupertinoColors.link) : null,
        title: Text(title, style: const TextStyle(decoration: TextDecoration.none, fontSize: 17))
    );
  }
}