yjbanov / butterfly

A web framework for Dart based on Flutter's widget model
Apache License 2.0
157 stars 13 forks source link

Flutter like API vs Butterfly API #18

Closed jonahwilliams closed 7 years ago

jonahwilliams commented 7 years ago

There is a big stylistic/visual clash between flutter style widgets (new Foo) versus the current VirtualElementBuilder widgets.

Part of the todo demo with a Column widget:

        section(attrs: const {'id': 'main'})([
          input('checkbox',
              attrs: const {'id': 'toggle-all'},
              eventListeners: {EventType.click: toggleAll})(),
          label(attrs: const {'for': 'toggle-all'})(
              [text('Mark all as complete')]),
          new Column(children: listItems, id: 'todo-list')
        ]),

I think we should only have a single style of widget, however the current Builder style doesn't really work well with layout/structural widgets because of all the noise introduced by the extra ()s:

column(id: 'todo-list)([])

Especially since many of these identifiers could clash with common local variable names (row, column, container).