I've been also checking out Dart lately. And I decided to do so after discovering this : http://www.dartflash.com/ Based on dartflash I started implementing a small ui framework which will have most of the functionality of the Flex ui components (skinning, similar api etc).
It's still VERY early to see how this will go but I have some ideas and I plan to do it in github with a colleague of mine as soon as we find time. The plan is to add some basic ui components on top of dartflash and if this succeeds then we can take it a step further. On Sat, Feb 2, 2013 at 3:17 PM, Frank Pepermans <frankp...@hotmail.com>wrote: > I've been playing around with Dart for a day, > been doing a huge Flex project for 2 years, but the next one will have to > be HTML, > so I decided to give it a good look, as I always do, by developing a small > project. > > I chose to try and build a very small Flex-like framework and see how far > I could get. > Doing so, I really started liking this Dart, and the mini Flex stuff is > doing what it is supposed to do. > > Some things that I decided to create : > - framework events > // Dart has DOM events, but nothing outside of DOM objects > - list collection > // Like ArrayCollection, it takes an Iterator as source, and dispatches > events on add, remove, ... to facilitate a dataProvider functionality in a > component > - layouts > // vertical and horizontal layouts to position elements within a DIV > - group, hgroup, vgroup > // They represent a container, in my case a DIV, and have a layout to > position elements that are added to it > - combo box > // wraps around a HTML select > > UI components, like their Flex counterparts, would have a life cycle, > and functionality to invalidate a component after properties are set, or > the layout needs updating. > > Dart has operator overloads, so my invalidateProperties for example looks > like this : > > set foo(Bar value) { > _foo = value; > > // on the next update cycle, trigger commitProperties and handle the > new property value > later > commitProperties; > } > > The ListCollection has similar overloads, so you can do : > > ListCollection list = new List(); > > // add 2 elements to the list > list + foo; > list + bar; > > // invert the list > list = -list; > > ComboBox box = new ComboBox(); > > box + foo; // adds foo to the internal dataProvider of box > > As in Flex, assign a ListCollection to a ComboBox, and any direct changes > to the list will update the ComboBox as well. > > Bring them all together and you get something like : > > void main() { > // assign a DIV to a VGroup > // VGroup auto has vertical layout > VGroup container = new VGroup('#html_div_id'); > > ComboBox comboBox = new ComboBox(); > ComboBox anotherComboBox = new ComboBox(); > > container.add(comboBox); > container.add(anotherComboBox); > > comboBox + {label: 'item 1'}; > comboBox + {label: 'item 2'}; > > anotherComboBox + {label: 'item 3'}; > anotherComboBox + {label: 'item 4'}; > } > > I'm only a good day in Dart, but liking it a lot. > > Dunno if someone is already doing a dart flex project, could very well be, > I just wanted to get my hands dirty for now, > would a dart flex framework be something worth considering for the Apache > Flex project? > I am well aware of the FalconJS effords, but they could be evaluated in > parallel? -- Nick Tsitlakidis, CEO and Software Architect at Perfect Edge LTD. www.perfectedz.com