appendClassContent method

String appendClassContent(
  1. String className,
  2. String value
)

Implementation

String appendClassContent(String className, String value) {
  var matches =
      RegExp('class $className {.*?(^})', multiLine: true, dotAll: true)
          .allMatches(this);
  var match = matches.first;
  return insert(match.end - 1, value);
}