spacesCount property
int
get
spacesCount
Returns the count of space characters in the artifacts.
This getter iterates through all artifacts and counts how many have a matching character of space ' '. It uses fold to accumulate the count efficiently.
Returns: An integer representing the total number of space characters.
Implementation
int get spacesCount => artifacts.fold(
0,
(count, a) => a.characterMatched == ' ' ? count + 1 : count,
);