radioMarker function

({String content, bool selected})? radioMarker(
  1. String trimmed
)

(x) / ( ) radio. Returns (selected, content).

Implementation

({bool selected, String content})? radioMarker(String trimmed) {
  if (trimmed.startsWith('(x) ') || trimmed.startsWith('(X) ')) {
    return (selected: true, content: trimmed.substring(4));
  }
  if (trimmed.startsWith('( ) ')) {
    return (selected: false, content: trimmed.substring(4));
  }
  return null;
}