constructorParametersValue function
String
constructorParametersValue(
- ConstructorElement constructor,
- int messageIndex, {
- Map<DartType, String>? replace,
})
Implementation
String constructorParametersValue(
final ConstructorElement constructor,
int messageIndex, {
Map<DartType, String>? replace,
}) {
String arg = "";
for (var par in constructor.parameters) {
if (replace?.containsKey(par.type) ?? false) {
arg += par.isNamed
? "${par.name}: ${replace![par.type]},"
: "${replace![par.type]},";
continue;
}
arg += par.isNamed
? "${par.name}:message[${messageIndex++}],"
: "message[${messageIndex++}],";
}
return arg;
}