Originally the dashboard TS expression ``heroes.slice(1, 5))` had been written as: > _heroService.getHeroes().getRange(1, 5) which is brittle; it fails if there are not enough heroes. Slice doesn't fail; an equivalent express ion in Dart is > _heroService.getHeroes().skip(1).take(4) This is now used. Other changes: - Fix in css (missed TS-side update). - Ran `dartfmt` on `heroes_component.dart`.
7 lines
75 B
Dart
7 lines
75 B
Dart
class Hero {
|
|
final int id;
|
|
String name;
|
|
|
|
Hero(this.id, this.name);
|
|
}
|