parseLoyalty function
Parses a loyalty value (e.g., "3", "X") and returns a TextSpan.
Returns null
if the input is null
.
Implementation
TextSpan? parseLoyalty(String? loyalty) {
if (loyalty == null) return null;
return TextSpan(
text: loyalty,
style: const TextStyle(fontWeight: FontWeight.bold),
);
}