getCustomMessage method
Message
getCustomMessage({})
Get a message with the given parameters.
Implementation
Message getCustomMessage({
final String? message,
final Map<String, String> replacements = const {},
final AssetReference? sound,
final double? gain,
final bool keepAlive = false,
}) {
var text = message;
if (text != null) {
for (final entry in replacements.entries) {
text = text?.replaceAll('{${entry.key}}', entry.value);
}
}
return Message(
gain: gain ?? world.soundOptions.defaultGain,
keepAlive: keepAlive,
sound: sound,
text: text,
);
}