You might want to see how Flutter is being used, as it might provide some real-world examples of constructing nested object graphs. If there's ever a case for an improved syntax for constructing trees of objects, I'm not sure what is :)
await showDialog(navigator, (NavigatorState navigator) {
return new Dialog(
title: new Text('Not Implemented'),
content: new Text('This feature has not yet been implemented.'),
actions: [
new FlatButton(
child: new Row([
new Icon(
type: 'device/dvr',
size: 18
),
new Container(
width: 8.0
),
new Text('DUMP APP TO CONSOLE'),
]),
onPressed: () { debugDumpApp(); }
),
new FlatButton(
child: new Text('OH WELL'),
onPressed: () {
navigator.pop(false);
}
),
]
return new Material(
type: MaterialType.canvas,
child: new ScrollableViewport(
child: new Container(
padding: const EdgeDims.symmetric(vertical: 20.0),
child: new BlockBody([
new DrawerItem(
icon: 'action/thumb_up',
onPressed: () => _confirmOptimismChange(),
child: new Row([
new Flexible(child: new Text('Everything is awesome')),
new Checkbox(
value: config.optimism == StockMode.optimistic,
onChanged: (_) => _confirmOptimismChange()
),
])
),
new DrawerItem(
icon: 'action/backup',
onPressed: () { _handleBackupChanged(!(config.backup == BackupMode.enabled)); },
child: new Row([
new Flexible(child: new Text('Back up stock list to the cloud')),
new Switch(
value: config.backup == BackupMode.enabled,
onChanged: _handleBackupChanged
),
])
),
])
)
)