Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Updating the tutorial to Dart 1.9+, which introduces an additional #141

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions Chapter_01/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ packages:
analyzer:
description: analyzer
source: hosted
version: "0.22.4"
version: "0.24.6"
angular:
description: angular
source: hosted
version: "1.1.0"
version: "1.1.2"
args:
description: args
source: hosted
Expand All @@ -28,11 +28,11 @@ packages:
code_transformers:
description: code_transformers
source: hosted
version: "0.2.7+2"
version: "0.2.8"
collection:
description: collection
source: hosted
version: "0.9.4"
version: "1.1.0"
csslib:
description: csslib
source: hosted
Expand All @@ -56,27 +56,27 @@ packages:
intl:
description: intl
source: hosted
version: "0.11.12"
version: "0.8.10+4"
logging:
description: logging
source: hosted
version: "0.9.3"
meta:
description: meta
source: hosted
version: "0.8.8"
observe:
description: observe
source: hosted
version: "0.12.2+1"
version: "0.13.0+2"
path:
description: path
source: hosted
version: "1.3.4"
version: "1.3.5"
perf_api:
description: perf_api
source: hosted
version: "0.0.9"
petitparser:
description: petitparser
source: hosted
version: "1.3.7"
pool:
description: pool
source: hosted
Expand All @@ -92,15 +92,15 @@ packages:
source_maps:
description: source_maps
source: hosted
version: "0.10.0+2"
version: "0.10.1"
source_span:
description: source_span
source: hosted
version: "1.1.2"
stack_trace:
description: stack_trace
source: hosted
version: "1.2.4"
version: "1.3.2"
utf:
description: utf
source: hosted
Expand Down
4 changes: 2 additions & 2 deletions Chapter_01/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: tutorial
version: 1.0.0
version: 1.1.2
dependencies:
angular: "1.1.0"
angular: "1.1.2"
web_components: "0.10.1"
browser: ">=0.10.0+2 <0.11.0"
transformers:
Expand Down
24 changes: 12 additions & 12 deletions Chapter_02/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ packages:
analyzer:
description: analyzer
source: hosted
version: "0.22.4"
version: "0.24.6"
angular:
description: angular
source: hosted
version: "1.1.0"
version: "1.1.2"
args:
description: args
source: hosted
Expand All @@ -28,19 +28,19 @@ packages:
code_transformers:
description: code_transformers
source: hosted
version: "0.2.5"
version: "0.2.9"
collection:
description: collection
source: hosted
version: "0.9.4"
version: "1.1.0"
csslib:
description: csslib
source: hosted
version: "0.11.0+4"
di:
description: di
source: hosted
version: "3.3.3"
version: "3.3.4"
html5lib:
description: html5lib
source: hosted
Expand All @@ -52,7 +52,7 @@ packages:
intl:
description: intl
source: hosted
version: "0.11.9"
version: "0.8.10+4"
logging:
description: logging
source: hosted
Expand All @@ -61,14 +61,18 @@ packages:
description: matcher
source: hosted
version: "0.11.1"
meta:
description: meta
source: hosted
version: "0.8.8"
mock:
description: mock
source: hosted
version: "0.11.0+2"
observe:
description: observe
source: hosted
version: "0.12.2+1"
version: "0.13.1"
path:
description: path
source: hosted
Expand All @@ -77,10 +81,6 @@ packages:
description: perf_api
source: hosted
version: "0.0.9"
petitparser:
description: petitparser
source: hosted
version: "1.2.2"
pool:
description: pool
source: hosted
Expand All @@ -92,7 +92,7 @@ packages:
smoke:
description: smoke
source: hosted
version: "0.3.1"
version: "0.3.3"
source_maps:
description: source_maps
source: hosted
Expand Down
4 changes: 2 additions & 2 deletions Chapter_02/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: tutorial
version: 1.0.0
version: 1.1.2
dependencies:
angular: "1.1.0"
angular: "1.1.2"
web_components: "0.10.1"
browser: ">=0.10.0+2 <0.11.0"
dev_dependencies:
Expand Down
16 changes: 8 additions & 8 deletions Chapter_03/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ packages:
analyzer:
description: analyzer
source: hosted
version: "0.22.4"
version: "0.24.6"
angular:
description: angular
source: hosted
version: "1.1.0"
version: "1.1.2"
args:
description: args
source: hosted
Expand All @@ -28,19 +28,19 @@ packages:
code_transformers:
description: code_transformers
source: hosted
version: "0.2.5"
version: "0.2.9"
collection:
description: collection
source: hosted
version: "0.9.1"
version: "1.1.0"
csslib:
description: csslib
source: hosted
version: "0.11.0+4"
di:
description: di
source: hosted
version: "3.3.3"
version: "3.3.4"
html5lib:
description: html5lib
source: hosted
Expand All @@ -56,7 +56,7 @@ packages:
logging:
description: logging
source: hosted
version: "0.9.1+1"
version: "0.9.3"
matcher:
description: matcher
source: hosted
Expand All @@ -72,7 +72,7 @@ packages:
observe:
description: observe
source: hosted
version: "0.12.2+1"
version: "0.13.1"
path:
description: path
source: hosted
Expand All @@ -92,7 +92,7 @@ packages:
smoke:
description: smoke
source: hosted
version: "0.3.1"
version: "0.3.3"
source_maps:
description: source_maps
source: hosted
Expand Down
4 changes: 2 additions & 2 deletions Chapter_03/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: tutorial
version: 1.0.0
version: 1.1.2
dependencies:
angular: "1.1.0"
angular: "1.1.2"
web_components: "0.10.1"
browser: ">=0.10.0+2 <0.11.0"
dev_dependencies:
Expand Down
6 changes: 4 additions & 2 deletions Chapter_04/lib/component/rating.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ class RatingComponent {
stars = new List.generate(count, (i) => i + 1);
}

String starClass(int star) => star > rating ? _STAR_OFF_CLASS : _STAR_ON_CLASS;
String starClass(int star) =>
rating == null || star > rating ? _STAR_OFF_CLASS : _STAR_ON_CLASS;

String starChar(int star) => star > rating ? _STAR_OFF_CHAR : _STAR_ON_CHAR;
String starChar(int star) =>
rating == null || star > rating ? _STAR_OFF_CHAR : _STAR_ON_CHAR;

void handleClick(int star) {
rating = (star == 1 && rating == 1) ? 0 : star;
Expand Down
16 changes: 8 additions & 8 deletions Chapter_04/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ packages:
analyzer:
description: analyzer
source: hosted
version: "0.22.4"
version: "0.24.6"
angular:
description: angular
source: hosted
version: "1.1.0"
version: "1.1.2"
args:
description: args
source: hosted
Expand All @@ -28,19 +28,19 @@ packages:
code_transformers:
description: code_transformers
source: hosted
version: "0.2.5"
version: "0.2.9"
collection:
description: collection
source: hosted
version: "0.9.1"
version: "1.1.0"
csslib:
description: csslib
source: hosted
version: "0.11.0+4"
di:
description: di
source: hosted
version: "3.3.3"
version: "3.3.4"
html5lib:
description: html5lib
source: hosted
Expand All @@ -56,7 +56,7 @@ packages:
logging:
description: logging
source: hosted
version: "0.9.1+1"
version: "0.9.3"
matcher:
description: matcher
source: hosted
Expand All @@ -72,7 +72,7 @@ packages:
observe:
description: observe
source: hosted
version: "0.12.2+1"
version: "0.13.1"
path:
description: path
source: hosted
Expand All @@ -92,7 +92,7 @@ packages:
smoke:
description: smoke
source: hosted
version: "0.3.1"
version: "0.3.3"
source_maps:
description: source_maps
source: hosted
Expand Down
4 changes: 2 additions & 2 deletions Chapter_04/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: tutorial
version: 1.0.0
version: 1.1.2
dependencies:
angular: "1.1.0"
angular: "1.1.2"
web_components: "0.10.1"
browser: ">=0.10.0+2 <0.11.0"
dev_dependencies:
Expand Down
9 changes: 6 additions & 3 deletions Chapter_05/lib/component/rating.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import 'package:angular/angular.dart';
templateUrl: 'rating.html',
cssUrl: 'rating.css')
class RatingComponent {

static const String _STAR_ON_CHAR = "\u2605";
static const String _STAR_OFF_CHAR = "\u2606";
static const String _STAR_ON_CLASS = "star-on";
Expand All @@ -52,11 +53,13 @@ class RatingComponent {
stars = new List.generate(count, (i) => i + 1);
}

String starClass(int star) => star > rating ? _STAR_OFF_CLASS : _STAR_ON_CLASS;
String starClass(int star) =>
rating == null || star > rating ? _STAR_OFF_CLASS : _STAR_ON_CLASS;

String starChar(int star) => star > rating ? _STAR_OFF_CHAR : _STAR_ON_CHAR;
String starChar(int star) =>
rating == null || star > rating ? _STAR_OFF_CHAR : _STAR_ON_CHAR;

void handleClick(int star) {
rating = (star == 1 && rating == 1) ? 0 : star;
}
}
}
Loading