wrapPage static method

String wrapPage(
  1. String svg
)

Implementation

static String wrapPage(String svg) {
  const String header = '''<!doctype html>
  <html>
    <head>
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      <style>
          html, body {
              height: 100%;
              overflow: hidden;
              width: 100%;
          }
          body {
              margin: 0;
              padding: 0;
          }
          svg {
              height: 100%;
              left: 0;
              position: fixed;
              top: 0;
              width:100%;
          }
      </style>
    </head>
    <body>
  ''';
  const String footer = '''
    </body>
    </html>''';
  return shortenCode(header) + svg + shortenCode(footer);
}