Implemented RichObjectString in text messages
This commit is contained in:
@ -0,0 +1,13 @@
|
||||
import 'package:marianum_mobile/api/marianumcloud/talk/chat/getChatResponse.dart';
|
||||
|
||||
class RichObjectStringProcessor {
|
||||
static String parse(String message, Map<String, RichObjectString>? data) {
|
||||
if(data == null) return message;
|
||||
|
||||
data.forEach((key, value) {
|
||||
message = message.replaceAll(RegExp("{$key}"), value.name);
|
||||
});
|
||||
|
||||
return message;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user