toYesNo method

String toYesNo()

Converts the boolean to a string representation: 'Yes' for true, 'No' for false.

Example:

bool flag = true;
print(flag.toYesNo()); // Output: Yes

Implementation

String toYesNo() => this ? 'Yes' : 'No';