Spotted that project as well,

Only downside is, that it targets the HTML5 canvas (well, if you consider that a downside at all).

I've a ComboBox and RichText up and running that target HTML select and span in the background,
but with a Flex-y API.

Will dig in some more,

early demo at http://www.igindo.com/dart/dartPlay.html

the main dart for that page looks like this,
basically, it's a lot of combo boxes and a rich text, added to HGroups and a VGroup,
most are at 100% width and height, some are fixed size :

VGroup container = new VGroup(elementId: '#sample_container_id')
   ..percentWidth = 100.0
   ..percentHeight = 100.0;

 HGroup topContainer = new HGroup()
   ..percentWidth = 100.0
   ..percentHeight = 100.0;
 HGroup middleContainer = new HGroup()
   ..percentWidth = 100.0
   ..height = 100;
 HGroup bottomContainer = new HGroup()
   ..percentWidth = 100.0
   ..height = 50;

 RichText label = new RichText()
..text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut justo ligula, suscipit id venenatis eu, dictum eu augue. Vestibulum et nibh arcu. Nullam gravida risus ac ipsum congue nec ullamcorper lorem iaculis. Vestibulum tellus sapien, interdum ut mollis eget, consequat a elit. Vestibulum eu libero ac leo aliquet blandit. Suspendisse eget erat vitae risus mattis bibendum. Integer diam nibh, egestas nec commodo quis, rutrum ut lacus. Duis pellentesque metus sit amet mauris facilisis sed aliquet sem ultrices. Suspendisse eget nisi nulla. Praesent rutrum, lorem at malesuada fringilla, est mi malesuada dui, eleifend cursus velit augue sed dolor. Nunc viverra risus a elit rutrum feugiat.'
   ..width = 100
   ..percentHeight = 100.0;
 ComboBox boxA = new ComboBox()
   ..labelFunction = control_labelHandler
   ..percentWidth = 100.0
   ..percentHeight = 100.0
   ..dataProvider = createDataProvider();
 ComboBox boxB = new ComboBox()
   ..labelFunction = control_labelHandler
   ..percentWidth = 100.0
   ..percentHeight = 100.0
   ..dataProvider = createDataProvider();
 ComboBox boxC = new ComboBox()
   ..labelFunction = control_labelHandler
   ..percentWidth = 100.0
   ..percentHeight = 100.0
   ..dataProvider = createDataProvider();
 ComboBox boxD = new ComboBox()
   ..labelFunction = control_labelHandler
   ..percentWidth = 100.0
   ..percentHeight = 100.0
   ..dataProvider = createDataProvider();
 ComboBox boxE = new ComboBox()
   ..labelFunction = control_labelHandler
   ..percentWidth = 100.0
   ..percentHeight = 100.0
   ..dataProvider = createDataProvider();
 ComboBox boxF = new ComboBox()
   ..labelFunction = control_labelHandler
   ..percentWidth = 100.0
   ..percentHeight = 100.0
   ..dataProvider = createDataProvider();

 container.add(topContainer);
 container.add(middleContainer);
 container.add(bottomContainer);

 topContainer.add(label);
 topContainer.add(boxA);
 topContainer.add(boxB);

 bottomContainer.add(boxC);
 bottomContainer.add(boxD);

 middleContainer.add(boxE);
 middleContainer.add(boxF);


-----Original Message----- From: Nick Tsitlakidis
Sent: Saturday, February 02, 2013 7:49 PM
To: dev@flex.apache.org
Subject: Re: [Dart] - playing around

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

Reply via email to