Search code examples
dartrikulo

Is there any way to use support the Builder pattern in Rikulo?


I am interested in using the Builder pattern for declaratively creating UI with Rikulo. Is there a way to do so? Does the Dart syntax support a similar mechanism?

For example,

div(
  label(value:"OK")
);

Solution

  • Yes, it is possible. First, you have to define global functions for div, label and other ui objects. For example,

    TextView textView([String text, String html])
    => html != null ? new TextView.html(html): new TextView(text);
    

    It could be an excellent addon.