parse method Null safety

Future<DocumentationModel> parse(
  1. DocumentationModel model
)

Implementation

Future<DocumentationModel> parse(DocumentationModel model) async {
  String warnings='';
  try {
    await TagParser().parse(model);
  } on ParserWarning catch (parseWarning) {
    warnings+=parseWarning.toString();
  }

  try {
    await LinkParser().parse(model);
  } on ParserWarning catch (parseWarning) {
    warnings+=parseWarning.toString();
  }

  if (warnings.isNotEmpty) throw ParserWarning(warnings);
  return model;
}