asBool method

bool asBool()

Will attempt to convert to a bool from a series of strings that can represent a true value.

Implementation

bool asBool() {
  List<String> trueStrings = [
    "true",
    "1",
    "t",
    "y",
    "yes",
    "yeah",
    "yup",
    "certainly",
    "uh-huh"
  ];
  return trueStrings.contains(toLowerCase());
}