| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 import 'package:immi/dart/immi.dart'; | |
| 6 | |
| 7 // Export generated code for nodes in menu.immi | |
| 8 import 'package:immi/dart/menu.dart'; | |
| 9 export 'package:immi/dart/menu.dart'; | |
| 10 | |
| 11 class MenuItem { | |
| 12 String title; | |
| 13 Function select; | |
| 14 | |
| 15 MenuItem(this.title, this.select); | |
| 16 | |
| 17 MenuItemNode present(Node previous) { | |
| 18 return new MenuItemNode(title: title, select:select); | |
| 19 } | |
| 20 } | |
| 21 | |
| 22 class Menu { | |
| 23 String title; | |
| 24 List<MenuItem> items = []; | |
| 25 | |
| 26 Menu(this.title); | |
| 27 | |
| 28 void add(MenuItem item) { | |
| 29 items.add(item); | |
| 30 } | |
| 31 | |
| 32 MenuNode present(Node previous) { | |
| 33 return new MenuNode( | |
| 34 title: title, | |
| 35 items:items.map((item) => item.present(null)).toList()); | |
| 36 } | |
| 37 } | |
| OLD | NEW |