toMessage method
General Library Documentation Undocument By General Corporation & Global Corporation & General Developer
Implementation
String toMessage({
String title = "",
List<String> ignores = const [],
int? pidProcces,
String Function(String key, String? value, String defaultValue)? rewrite,
}) {
String message = title;
toJson(pidProcces: pidProcces).forEach((key, value) {
value ??= "-";
String defaultValue =
"${key.split("_").map((e) => e.toUpperCaseFirstData()).join(" ")}: ${value}";
if (rewrite != null) {
message += rewrite.call(key, value, defaultValue);
} else {
if (ignores.contains(key)) {
return;
}
message += "\n${defaultValue}";
}
});
return message;
}