Document constructor

const Document({
  1. String? title,
  2. String? lang,
  3. String? base,
  4. String? charset,
  5. String? viewport,
  6. Map<String, String>? meta,
  7. List<StyleRule>? styles,
  8. List<Component> head,
  9. required Component body,
})

Sets up a basic document structure at the root of your app and renders the main <html>, <head> and <body> tags.

The title and base parameters are rendered as the <title> and <base> elements respectively. The charset, viewport and meta values are rendered as <meta> elements in <head>. The styles parameter is rendered to css in a <style element inside <head>. The head components are also rendered inside <head>.

The body component is rendered inside the <body> element.

Implementation

const factory Document({
  String? title,
  String? lang,
  String? base,
  String? charset,
  String? viewport,
  Map<String, String>? meta,
  List<StyleRule>? styles,
  List<Component> head,
  required Component body,
}) = BaseDocument;