OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // This file has classes representing the grid tracks and grid template | 5 // This file has classes representing the grid tracks and grid template |
6 | 6 |
7 /** | 7 /** |
8 * The data structure representing the grid-rows or grid-columns | 8 * The data structure representing the grid-rows or grid-columns |
9 * properties. | 9 * properties. |
10 */ | 10 */ |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 final rect = _rects[cell]; | 120 final rect = _rects[cell]; |
121 if (rect != null) { | 121 if (rect != null) { |
122 rect.add(r + 1, c + 1); | 122 rect.add(r + 1, c + 1); |
123 } else { | 123 } else { |
124 _rects[cell] = new _GridTemplateRect(cell, r + 1, c + 1); | 124 _rects[cell] = new _GridTemplateRect(cell, r + 1, c + 1); |
125 } | 125 } |
126 } | 126 } |
127 } | 127 } |
128 | 128 |
129 // Finally, check that each rectangle is valid (i.e. all spaces filled) | 129 // Finally, check that each rectangle is valid (i.e. all spaces filled) |
130 for (final rect in _rects.getValues()) { | 130 for (final rect in _rects.values) { |
131 rect.checkValid(); | 131 rect.checkValid(); |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 /** | 135 /** |
136 * Looks up the given cell in the template, and returns the rect. | 136 * Looks up the given cell in the template, and returns the rect. |
137 */ | 137 */ |
138 _GridTemplateRect lookupCell(String cell) { | 138 _GridTemplateRect lookupCell(String cell) { |
139 if (cell.length != 1) { | 139 if (cell.length != 1) { |
140 throw new UnsupportedError( | 140 throw new UnsupportedError( |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 /** | 178 /** |
179 * Used to return a row/column and span during parsing of grid-row and | 179 * Used to return a row/column and span during parsing of grid-row and |
180 * grid-column during parsing. | 180 * grid-column during parsing. |
181 */ | 181 */ |
182 class _GridLocation { | 182 class _GridLocation { |
183 final int start, length; | 183 final int start, length; |
184 _GridLocation(this.start, this.length) {} | 184 _GridLocation(this.start, this.length) {} |
185 | 185 |
186 int get end => start + length; | 186 int get end => start + length; |
187 } | 187 } |
OLD | NEW |