Search code examples
fluttericons

What are the checkmark (✅) and cross/X (❌) icons in Flutter?


I'm trying to display tick (✅) and cross (❌) icons using Flutter. I have this code:

child: SlideAction(
    sliderButtonIconPadding: 8,
    text: Slidewords,
    textStyle: TextStyle(
        fontWeight: FontWeight.bold,
        fontSize: (18),
        color: Colors.white),
    key: key,
    submittedIcon: formvalid
          ? const Icon(Icons.visibility) // tick icon
          : const Icon(Icons.visibility_off), // cross icon
    onSubmit: () async {
        Future.delayed(
          Duration(seconds: 1),
          () => key.currentState!.reset(),
        );
        _trySubmitForm();
    })

Clearly the Icons.visibility and Icons.visibility_off values don't work, but I can't find the right ones in the documentation. Ctrl+F doesn't seem to work to search on that page and it isn't very responsive.

I also tried Icon.tick, Icon.correct, and Icon.cross; none of these give me the result I want.


Solution

  • For a cross, use Icons.close, and for a tick, Icons.check.