diff --git a/packages/html_builder/CHANGELOG.md b/packages/html_builder/CHANGELOG.md index 0e29ed27..becbacb2 100644 --- a/packages/html_builder/CHANGELOG.md +++ b/packages/html_builder/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.0.1 +* Added pedantic dart rules + # 2.0.0 * Migrated to work with Dart SDK 2.12.x NNBD diff --git a/packages/html_builder/README.md b/packages/html_builder/README.md index 71e787fc..2e26019b 100644 --- a/packages/html_builder/README.md +++ b/packages/html_builder/README.md @@ -1,5 +1,5 @@ # angel3_html_builder -[![version](https://img.shields.io/badge/pub-v2.0.0-brightgreen)](https://pub.dartlang.org/packages/angel3_html_builder) +[![version](https://img.shields.io/badge/pub-v2.0.1-brightgreen)](https://pub.dartlang.org/packages/angel3_html_builder) [![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion) diff --git a/packages/html_builder/analysis_options.yaml b/packages/html_builder/analysis_options.yaml index eae1e42a..c5667a80 100644 --- a/packages/html_builder/analysis_options.yaml +++ b/packages/html_builder/analysis_options.yaml @@ -1,3 +1,5 @@ +include: package:pedantic/analysis_options.yaml + analyzer: strong-mode: implicit-casts: false \ No newline at end of file diff --git a/packages/html_builder/lib/elements.dart b/packages/html_builder/lib/elements.dart index fb1df3ba..757a0689 100644 --- a/packages/html_builder/lib/elements.dart +++ b/packages/html_builder/lib/elements.dart @@ -33,10 +33,10 @@ Node a( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'a', _apply([ @@ -50,35 +50,35 @@ Node a( 'class': className, 'style': style, }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node abbr( {String? title, String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'addr', _apply([p, props], {'title': title, 'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node address( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'address', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node area( {String? alt, @@ -95,8 +95,8 @@ Node area( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}}) => + Map p = const {}, + @deprecated Map props = const {}}) => SelfClosingNode( 'area', _apply([ @@ -122,25 +122,25 @@ Node area( Node article( {className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('article', _apply([p, props], {'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node aside( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'aside', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node audio( {bool? autoplay, @@ -152,10 +152,10 @@ Node audio( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'audio', _apply([ @@ -172,18 +172,18 @@ Node audio( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node b( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('b', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node base( {String? href, @@ -191,8 +191,8 @@ Node base( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}}) => + Map p = const {}, + @deprecated Map props = const {}}) => SelfClosingNode( 'base', _apply([ @@ -210,55 +210,55 @@ Node bdi( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('bdi', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node bdo( {String? dir, String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'bdo', _apply([p, props], {'dir': dir, 'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node blockquote( {String? cite, String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'blockquote', _apply([p, props], {'cite': cite, 'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node body( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'body', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node br() => SelfClosingNode('br'); @@ -277,10 +277,10 @@ Node button( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'button', _apply([ @@ -302,7 +302,7 @@ Node button( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node canvas( {num? height, @@ -310,10 +310,10 @@ Node canvas( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'canvas', _apply([ @@ -326,100 +326,100 @@ Node canvas( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node cite( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'cite', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node caption( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'caption', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node code( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'code', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node col( {num? span, String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'col', _apply([p, props], {'span': span, 'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node colgroup( {num? span, String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'colgroup', _apply([p, props], {'span': span, 'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node datalist( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'datalist', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node dd( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('dd', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node del( {String? cite, @@ -427,10 +427,10 @@ Node del( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'del', _apply([ @@ -443,96 +443,96 @@ Node del( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node details( {bool? open, String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'details', _apply([p, props], {'open': open, 'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node dfn( {String? title, String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'dfn', _apply([p, props], {'title': title, 'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node dialog( {bool? open, String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'dialog', _apply([p, props], {'open': open, 'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node div( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('div', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node dl( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('dl', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node dt( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('dt', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node em( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('em', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node embed( {num? height, @@ -542,8 +542,8 @@ Node embed( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}}) => + Map p = const {}, + @deprecated Map props = const {}}) => SelfClosingNode( 'embed', _apply([ @@ -566,10 +566,10 @@ Node fieldset( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'fieldset', _apply([ @@ -583,46 +583,46 @@ Node fieldset( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node figcaption( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'figcaption', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node figure( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'figure', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node footer( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'footer', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node form( {String? accept, @@ -637,10 +637,10 @@ Node form( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'form', _apply([ @@ -661,98 +661,98 @@ Node form( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node h1( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('h1', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node h2( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('h2', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node h3( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('h3', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node h4( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('h4', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node h5( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('h5', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node h6( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('h6', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node head( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'head', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node header( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'header', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node hr() => SelfClosingNode('hr'); @@ -763,10 +763,10 @@ Node html( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'html', _apply([ @@ -780,18 +780,18 @@ Node html( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node i( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('i', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node iframe( {num? height, @@ -803,8 +803,8 @@ Node iframe( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}}) => + Map p = const {}, + @deprecated Map props = const {}}) => SelfClosingNode( 'iframe', _apply([ @@ -836,8 +836,8 @@ Node img( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}}) => + Map p = const {}, + @deprecated Map props = const {}}) => SelfClosingNode( 'img', _apply([ @@ -893,8 +893,8 @@ Node input( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}}) => + Map p = const {}, + @deprecated Map props = const {}}) => SelfClosingNode( 'input', _apply([ @@ -943,10 +943,10 @@ Node ins( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'ins', _apply([ @@ -959,18 +959,18 @@ Node ins( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node kbd( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('kbd', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node keygen( {bool? autofocus, @@ -982,10 +982,10 @@ Node keygen( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'keygen', _apply([ @@ -1002,7 +1002,7 @@ Node keygen( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node label( {String? for_, @@ -1010,10 +1010,10 @@ Node label( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'label', _apply([ @@ -1026,35 +1026,35 @@ Node label( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node legend( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'legend', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node li( {num? value, String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'li', _apply([p, props], {'value': value, 'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node link( {String? crossorigin, @@ -1068,8 +1068,8 @@ Node link( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}}) => + Map p = const {}, + @deprecated Map props = const {}}) => SelfClosingNode( 'link', _apply([ @@ -1093,42 +1093,42 @@ Node main( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'main', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node map( {String? name, String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'map', _apply([p, props], {'name': name, 'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node mark( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'mark', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node menu( {String? label, @@ -1136,10 +1136,10 @@ Node menu( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'menu', _apply([ @@ -1152,7 +1152,7 @@ Node menu( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node menuitem( {bool? checked, @@ -1166,10 +1166,10 @@ Node menuitem( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'menuitem', _apply([ @@ -1188,7 +1188,7 @@ Node menuitem( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node meta( {String? charset, @@ -1198,8 +1198,8 @@ Node meta( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}}) => + Map p = const {}, + @deprecated Map props = const {}}) => SelfClosingNode( 'meta', _apply([ @@ -1219,25 +1219,25 @@ Node nav( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('nav', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node noscript( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'noscript', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node object( {String? data, @@ -1250,10 +1250,10 @@ Node object( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'object', _apply([ @@ -1271,7 +1271,7 @@ Node object( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node ol( {bool? reversed, @@ -1280,10 +1280,10 @@ Node ol( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'ol', _apply([ @@ -1297,7 +1297,7 @@ Node ol( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node optgroup( {bool? disabled, @@ -1305,10 +1305,10 @@ Node optgroup( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'optgroup', _apply([ @@ -1321,7 +1321,7 @@ Node optgroup( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node option( {bool? disabled, @@ -1331,10 +1331,10 @@ Node option( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'option', _apply([ @@ -1349,7 +1349,7 @@ Node option( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node output( {String? for_, @@ -1358,10 +1358,10 @@ Node output( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'output', _apply([ @@ -1375,18 +1375,18 @@ Node output( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node p( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('p', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node param( {String? name, @@ -1394,8 +1394,8 @@ Node param( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}}) => + Map p = const {}, + @deprecated Map props = const {}}) => SelfClosingNode( 'param', _apply([ @@ -1413,25 +1413,25 @@ Node picture( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'picture', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node pre( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('pre', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node progress( {num? max, @@ -1439,10 +1439,10 @@ Node progress( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'progress', _apply([ @@ -1455,81 +1455,81 @@ Node progress( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node q( {String? cite, String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'q', _apply([p, props], {'cite': cite, 'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node rp( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('rp', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node rt( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('rt', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node ruby( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'ruby', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node s( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('s', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node samp( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'samp', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node script( {bool? async, @@ -1540,10 +1540,10 @@ Node script( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'script', _apply([ @@ -1559,20 +1559,20 @@ Node script( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node section( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'section', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node select( {bool? autofocus, @@ -1584,10 +1584,10 @@ Node select( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'select', _apply([ @@ -1604,20 +1604,20 @@ Node select( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node small( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'small', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node source( {String? src, @@ -1628,8 +1628,8 @@ Node source( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}}) => + Map p = const {}, + @deprecated Map props = const {}}) => SelfClosingNode( 'source', _apply([ @@ -1650,87 +1650,87 @@ Node span( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'span', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node strong( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'strong', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node style( {String? media, bool? scoped, String? type, String? id, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'style', _apply([p, props], {'media': media, 'scoped': scoped, 'type': type, 'id': id}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node sub( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('sub', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node summary( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'summary', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node sup( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('sup', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node table( {bool? sortable, String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'table', _apply([ @@ -1742,20 +1742,20 @@ Node table( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node tbody( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'tbody', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node td( {num? colspan, @@ -1764,10 +1764,10 @@ Node td( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'td', _apply([ @@ -1781,7 +1781,7 @@ Node td( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node textarea( {bool? autofocus, @@ -1799,10 +1799,10 @@ Node textarea( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'textarea', _apply([ @@ -1825,20 +1825,20 @@ Node textarea( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node tfoot( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'tfoot', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node th( {String? abbr, @@ -1850,10 +1850,10 @@ Node th( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'th', _apply([ @@ -1870,30 +1870,30 @@ Node th( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node thead( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'thead', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node time( {String? datetime, String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'time', _apply([ @@ -1905,31 +1905,31 @@ Node time( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node title( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'title', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node tr( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('tr', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node track( {bool? default_, @@ -1940,8 +1940,8 @@ Node track( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}}) => + Map p = const {}, + @deprecated Map props = const {}}) => SelfClosingNode( 'track', _apply([ @@ -1962,34 +1962,34 @@ Node u( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('u', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node ul( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('ul', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node var_( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('var', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node video( {bool? autoplay, @@ -2004,10 +2004,10 @@ Node video( String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h( 'video', _apply([ @@ -2027,15 +2027,15 @@ Node video( 'class': className, 'style': style }), - []..addAll(c)..addAll(children)); + [...c, ...children]); Node wbr( {String? id, className, style, - Map p: const {}, - @deprecated Map props: const {}, - Iterable c: const [], - @deprecated Iterable children: const []}) => + Map p = const {}, + @deprecated Map props = const {}, + Iterable c = const [], + @deprecated Iterable children = const []}) => h('wbr', _apply([p, props], {'id': id, 'class': className, 'style': style}), - []..addAll(c)..addAll(children)); + [...c, ...children]); diff --git a/packages/html_builder/lib/src/mutations.dart b/packages/html_builder/lib/src/mutations.dart index 04818063..3173163f 100644 --- a/packages/html_builder/lib/src/mutations.dart +++ b/packages/html_builder/lib/src/mutations.dart @@ -3,7 +3,7 @@ import 'node_builder.dart'; /// Returns a function that rebuilds an arbitrary [Node] by applying the [transform] to it. Node Function(Node) rebuild(NodeBuilder Function(NodeBuilder) transform, - {bool selfClosing: false}) { + {bool selfClosing = false}) { return (node) => transform(NodeBuilder.from(node)).build(selfClosing: selfClosing); } diff --git a/packages/html_builder/lib/src/node.dart b/packages/html_builder/lib/src/node.dart index a81b50ed..ec32488b 100644 --- a/packages/html_builder/lib/src/node.dart +++ b/packages/html_builder/lib/src/node.dart @@ -20,7 +20,7 @@ class Node { Node._selfClosing(this.tagName, [Map attributes = const {}]) { - this..attributes.addAll(attributes); + this.attributes.addAll(attributes); } @override @@ -35,7 +35,10 @@ class Node { /// Represents a self-closing tag, i.e. `
`. class SelfClosingNode extends Node { + @override final String tagName; + + @override final Map attributes = {}; @override diff --git a/packages/html_builder/lib/src/node_builder.dart b/packages/html_builder/lib/src/node_builder.dart index daea4fa2..ab566c86 100644 --- a/packages/html_builder/lib/src/node_builder.dart +++ b/packages/html_builder/lib/src/node_builder.dart @@ -8,7 +8,7 @@ class NodeBuilder { Node? _existing; NodeBuilder(this.tagName, - {this.attributes: const {}, this.children: const []}); + {this.attributes = const {}, this.children = const []}); /// Creates a [NodeBuilder] that just spits out an already-existing [Node]. factory NodeBuilder.existing(Node existingNode) => @@ -19,7 +19,7 @@ class NodeBuilder { children: List.from(node.children)); /// Builds the node. - Node build({bool selfClosing: false}) => + Node build({bool selfClosing = false}) => _existing ?? (selfClosing ? SelfClosingNode(tagName, attributes) @@ -85,9 +85,11 @@ class NodeBuilder { var clazz = attributes['class']; var classes = []; - if (clazz is String) + if (clazz is String) { classes.addAll(clazz.split(' ')); - else if (clazz is Iterable) classes.addAll(clazz.map((s) => s.toString())); + } else if (clazz is Iterable) { + classes.addAll(clazz.map((s) => s.toString())); + } return setClasses(f(classes)); } diff --git a/packages/html_builder/lib/src/renderer.dart b/packages/html_builder/lib/src/renderer.dart index d77b5461..31b2434d 100644 --- a/packages/html_builder/lib/src/renderer.dart +++ b/packages/html_builder/lib/src/renderer.dart @@ -14,10 +14,10 @@ abstract class StringRenderer implements Renderer { /// If [pretty] is `true` (default), then [whitespace] (default: `' '`) will be inserted between nodes. /// You can also provide a [doctype] (default: `html`). factory StringRenderer( - {bool html5: true, - bool pretty: true, - String doctype: 'html', - String whitespace: ' '}) => + {bool html5 = true, + bool pretty = true, + String doctype = 'html', + String whitespace = ' '}) => pretty == true ? _PrettyStringRendererImpl( html5: html5 != false, doctype: doctype, whitespace: whitespace) @@ -81,7 +81,9 @@ class _PrettyStringRendererImpl implements StringRenderer { _PrettyStringRendererImpl({this.html5, this.whitespace, this.doctype}); void _applyTabs(int tabs, StringBuffer buf) { - for (int i = 0; i < tabs; i++) buf.write(whitespace ?? ' '); + for (var i = 0; i < tabs; i++) { + buf.write(whitespace ?? ' '); + } } void _renderInto(int tabs, Node node, StringBuffer buf) { diff --git a/packages/html_builder/pubspec.yaml b/packages/html_builder/pubspec.yaml index b714b977..424ff98d 100644 --- a/packages/html_builder/pubspec.yaml +++ b/packages/html_builder/pubspec.yaml @@ -1,6 +1,6 @@ name: angel3_html_builder description: Build HTML AST's and render them to HTML. This can be used as an internal DSL, i.e. for a templating engine. -version: 2.0.0 +version: 2.0.1 homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/html_builder environment: sdk: '>=2.12.0 <3.0.0' @@ -8,4 +8,5 @@ dependencies: collection: ^1.15.0 dev_dependencies: html: ^0.15.0 - test: ^1.17.4 \ No newline at end of file + test: ^1.17.4 + pedantic: ^1.11.0 \ No newline at end of file