(由特里斯坦·麥克納布達特討論郵件列表)我可以動態應用Dart的字符串插值嗎?
我試圖建立一個基於模板和諸如此類的服務器端MVC框架和產生的看法,以及我在想,如果我可以動態地應用飛鏢的字符串插值。例如,這將是我的視圖模板:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>${ViewData["Title"]}</title>
<link href="/Content/css/site.css" rel="stylesheet" />
</head>
<body>
<h1>${ViewData["Title"]}</h1>
<div id="container">
<p>Hello world!</p>
</div>
</body>
</html>
而且我想使用應用的ViewData變量:
static String applyViewData(String html, Map ViewData) {
// apply interpolation here
}
這是目前在所有可能的?我對API的搜索表明它不是。