From 1a5937229eba29a46aab6fbb7f20e03ad0df8c98 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Sat, 23 Mar 2019 10:07:40 -0400 Subject: [PATCH] Add example, analysis opts, etc. --- jael_web/analysis_options.yaml | 3 +++ jael_web/example/main.dart | 3 +++ jael_web/lib/jael_web.dart | 1 + jael_web/lib/src/dom_builder.dart | 11 ++++++++--- jael_web/pubspec.yaml | 3 ++- 5 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 jael_web/analysis_options.yaml create mode 100644 jael_web/example/main.dart create mode 100644 jael_web/lib/jael_web.dart diff --git a/jael_web/analysis_options.yaml b/jael_web/analysis_options.yaml new file mode 100644 index 00000000..eae1e42a --- /dev/null +++ b/jael_web/analysis_options.yaml @@ -0,0 +1,3 @@ +analyzer: + strong-mode: + implicit-casts: false \ No newline at end of file diff --git a/jael_web/example/main.dart b/jael_web/example/main.dart new file mode 100644 index 00000000..56b835fd --- /dev/null +++ b/jael_web/example/main.dart @@ -0,0 +1,3 @@ +import 'package:jael_web/jael_web.dart'; + +void main() {} diff --git a/jael_web/lib/jael_web.dart b/jael_web/lib/jael_web.dart new file mode 100644 index 00000000..15d44cf4 --- /dev/null +++ b/jael_web/lib/jael_web.dart @@ -0,0 +1 @@ +export 'src/dom_builder.dart'; \ No newline at end of file diff --git a/jael_web/lib/src/dom_builder.dart b/jael_web/lib/src/dom_builder.dart index 0657ac95..6800529b 100644 --- a/jael_web/lib/src/dom_builder.dart +++ b/jael_web/lib/src/dom_builder.dart @@ -1,9 +1,14 @@ abstract class DomBuilder { - DomBuilderElement open(String tagName); + DomBuilderElement append( + String tagName, void Function(DomBuilderElement) f); - void emitText(String value); + void text(String value); } -abstract class DomBuilderElement implements DomBuilder { +abstract class DomBuilderElement extends DomBuilder { + void attr(String name, [String value]); + + void attrs(Map map); + T close(); } diff --git a/jael_web/pubspec.yaml b/jael_web/pubspec.yaml index 79c36fee..c8a0d607 100644 --- a/jael_web/pubspec.yaml +++ b/jael_web/pubspec.yaml @@ -10,4 +10,5 @@ dependencies: source_gen: ^0.9.0 dev_dependencies: build_runner: ^1.0.0 - build_web_compilers: ^1.0.0 \ No newline at end of file + build_web_compilers: ^1.0.0 + pedantic: ^1.0.0 \ No newline at end of file