getHtmlString function

String getHtmlString(
  1. List<ProjectTodo> todo
)

Implementation

String getHtmlString(List<ProjectTodo> todo) {
  return """
  <!DOCTYPE html>
  <html>
    <head>
      <title>TODO</title>
        <script src="https://cdn.tailwindcss.com"></script>
    </head>
    <body class="p-8">
      <h1
      class="text-4xl text-center text-blue-500"
      >TODOs</h1>
      ${todo.map((e) {
    return """
            <h2
            class="text-red-500"
            >${e.filePath} - Line ${e.lineNumber}</h2>
            <code
            class="text-sm text-gray-500 bg-gray-100 p-2 rounded-lg block mt-2"
            >
              ${e.todoContent.replaceAll("\n", "<br>")}
            </code>
          """;
  }).join("\n")}
    </body>
  """;
}