importStatements method

Set<String> importStatements(
  1. Set<AbstractType> types
)

Return import statement for all non-standard types.

Implementation

Set<String> importStatements(Set<AbstractType> types) {
  types
    ..removeWhere((type) => type is StandardType)
    ..removeWhere((type) => type.className == className);
  return types
      .map((e) => e.className.snakeCase)
      .map((e) =>
          "import '${e}_dataclass.dart';\nimport '${e}_extensions.dart';\n")
      .toSet();
}