-
-
Save dilrajsingh1997/124ef29c97218262ac02a0661ea3f8da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file addLine "return \"$route${if (propertyMap.isNotEmpty()) "?" else ""}\" + " | |
tabs++ | |
tabs++ | |
count = 0 | |
properties.forEach { property -> | |
count++ | |
val propertyInfo = propertyMap[property] ?: run { | |
logger.error("Invalid type argument", property) | |
return | |
} | |
val argumentName = propertyInfo.propertyName | |
file addLine "\"$argumentName=" | |
file addPhrase when (propertyInfo.composeArgumentType) { | |
ComposeArgumentType.INT, | |
ComposeArgumentType.BOOLEAN, | |
ComposeArgumentType.LONG, | |
ComposeArgumentType.FLOAT, | |
ComposeArgumentType.STRING -> "$$argumentName" | |
else -> "\${Uri.encode(gson.toJson($argumentName))}" | |
} | |
if (count == propertyMap.size) { | |
file addPhrase "\"" | |
} else { | |
file addPhrase ",\"" | |
} | |
file addPhrase " + " | |
} | |
file addLine "\"\"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment