importPath method

String importPath({
  1. String relativeness = "../",
  2. Set<String> enumSet = const {},
  3. Set<String> structSet = const {},
  4. Set<String> callbackStructSet = const {},
  5. Set<String> interfaceSet = const {},
})

returns the path of type in order to import

Implementation

String importPath({
  String relativeness = "../",
  Set<String> enumSet = const {},
  Set<String> structSet = const {},
  Set<String> callbackStructSet = const {},
  Set<String> interfaceSet = const {},
}) {
  String packageName = "";
  if (enumSet.contains(this)) {
    packageName =
        "${relativeness}enums/e${this.clearEnumName().toFileName()}.dart";
  } else if (structSet.contains(this)) {
    packageName = "${relativeness}structs/${this.toFileName()}.dart";
  } else if (callbackStructSet.contains(this)) {
    packageName = "${relativeness}callback_structs/${this.toFileName()}.dart";
  } else if (interfaceSet.contains(this)) {
    packageName =
        "${relativeness}interfaces/i${this.clearInterfaceName().toFileName()}.dart";
  }

  return packageName;
}