parseOptionalBooleanAttribute static method
bool
parseOptionalBooleanAttribute(
{ - required String line,
- required String pattern,
- required bool defaultValue,
})
Implementation
static bool parseOptionalBooleanAttribute({
required String line,
required String pattern,
required bool defaultValue,
}) {
final regExp = RegExp(pattern);
final List<Match> list = regExp.allMatches(line).toList();
final ret = list.isEmpty
? defaultValue
: line
.substring(list.first.start, list.first.end)
.contains(booleanTrue);
return ret;
}