├── tus ├── 06-classes ├── assets │ └── .keep └── projects │ ├── starter │ ├── bin │ │ └── starter.dart │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ └── analysis_options.yaml │ ├── final │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ │ ├── user.dart │ │ └── final.dart │ ├── challenge │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ │ └── challenge.dart │ └── mini_exercise │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ └── mini_exercise.dart ├── 04-control-flow ├── assets │ └── .keep └── projects │ ├── final │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ └── analysis_options.yaml │ ├── starter │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── bin │ │ └── starter.dart │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ └── analysis_options.yaml │ ├── challenge │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ │ └── challenge.dart │ └── mini_exercise │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ └── mini_exercise.dart ├── 05-functions ├── assets │ └── .keep └── projects │ ├── final │ ├── .keep │ ├── CHANGELOG.md │ ├── pubspec.yaml │ ├── README.md │ ├── .gitignore │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ │ └── final.dart │ ├── challenge │ ├── .keep │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ │ └── challenge.dart │ ├── starter │ ├── .keep │ ├── bin │ │ └── starter.dart │ ├── CHANGELOG.md │ ├── pubspec.yaml │ ├── README.md │ ├── .gitignore │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ └── analysis_options.yaml │ └── mini_exercise │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ └── mini_exercise.dart ├── 07-nullability ├── assets │ └── .keep └── projects │ ├── starter │ ├── bin │ │ └── starter.dart │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ └── analysis_options.yaml │ ├── challenge │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ │ └── challenge.dart │ ├── final │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ │ └── final.dart │ └── mini_exercise │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ └── mini_exercise.dart ├── 08-collections ├── assets │ └── .keep └── projects │ ├── starter │ ├── bin │ │ └── starter.dart │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ └── analysis_options.yaml │ ├── challenge │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ │ └── challenge.dart │ ├── final │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ └── analysis_options.yaml │ └── mini_exercise │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ └── mini_exercise.dart ├── 09-advanced-classes ├── assets │ └── .keep └── projects │ ├── starter │ ├── bin │ │ └── starter.dart │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ └── analysis_options.yaml │ ├── challenge │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ │ └── challenge.dart │ ├── final │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ │ └── final.dart │ └── mini_exercise │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ └── mini_exercise.dart ├── 03-types-and-operations ├── assets │ └── .keep └── projects │ ├── challenge │ ├── .keep │ ├── CHANGELOG.md │ ├── README.md │ ├── pubspec.yaml │ ├── .gitignore │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ ├── pubspec.lock │ └── bin │ │ └── challenge.dart │ ├── final │ ├── .keep │ ├── CHANGELOG.md │ ├── pubspec.yaml │ ├── README.md │ ├── .gitignore │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ ├── pubspec.lock │ └── bin │ │ └── final.dart │ ├── starter │ ├── .keep │ ├── CHANGELOG.md │ ├── pubspec.yaml │ ├── README.md │ ├── .gitignore │ ├── pubspec.lock │ ├── .packages │ ├── bin │ │ └── starter.dart │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ └── .dart_tool │ │ └── package_config.json │ └── mini_exercise │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ └── mini_exercise.dart ├── 10-asynchronous-programming ├── assets │ └── .keep └── projects │ ├── final │ ├── .keep │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── assets │ │ └── text.txt │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ ├── pubspec.lock │ └── bin │ │ └── final.dart │ ├── challenge │ ├── .keep │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ └── pubspec.lock │ ├── starter │ ├── .keep │ ├── bin │ │ └── starter.dart │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ └── analysis_options.yaml │ └── mini_exercise │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ └── mini_exercise.dart ├── 02-expressions-variables-constants ├── assets │ └── .keep └── projects │ ├── challenge │ ├── .keep │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ │ └── challenge.dart │ ├── starter │ ├── bin │ │ └── starter.dart │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ └── analysis_options.yaml │ ├── final │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ │ └── final.dart │ └── mini_exercise │ ├── CHANGELOG.md │ ├── README.md │ ├── .gitignore │ ├── pubspec.yaml │ ├── pubspec.lock │ ├── .vscode │ └── launch.json │ ├── analysis_options.yaml │ └── bin │ └── mini_exercise.dart ├── 01-your-dart-development-environment ├── assets │ └── .keep └── projects │ ├── final │ ├── .keep │ ├── hello_dart_project │ │ ├── CHANGELOG.md │ │ ├── bin │ │ │ └── hello_dart_project.dart │ │ ├── README.md │ │ ├── .gitignore │ │ ├── pubspec.yaml │ │ ├── .vscode │ │ │ └── launch.json │ │ ├── pubspec.lock │ │ ├── .packages │ │ ├── analysis_options.yaml │ │ └── .dart_tool │ │ │ └── package_config.json │ └── hello.dart │ ├── challenge │ ├── .keep │ └── challenge.md │ └── starter │ ├── .keep │ └── hello.dart ├── README.md └── scripts ├── make-codex-branch.sh └── make-codex-subdirectory.sh /tus: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06-classes/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04-control-flow/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05-functions/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07-nullability/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08-collections/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05-functions/projects/final/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09-advanced-classes/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03-types-and-operations/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05-functions/projects/challenge/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05-functions/projects/starter/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10-asynchronous-programming/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/challenge/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/final/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/starter/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/final/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01-your-dart-development-environment/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/challenge/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/starter/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01-your-dart-development-environment/projects/final/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01-your-dart-development-environment/projects/challenge/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01-your-dart-development-environment/projects/starter/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/challenge/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08-collections/projects/starter/bin/starter.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | 3 | } -------------------------------------------------------------------------------- /05-functions/projects/starter/bin/starter.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /07-nullability/projects/starter/bin/starter.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | 3 | } -------------------------------------------------------------------------------- /06-classes/projects/starter/bin/starter.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | 3 | } 4 | 5 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/starter/bin/starter.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | 3 | } -------------------------------------------------------------------------------- /01-your-dart-development-environment/projects/starter/hello.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | 3 | } -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/starter/bin/starter.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/starter/bin/starter.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /05-functions/projects/final/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /06-classes/projects/final/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /06-classes/projects/starter/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /04-control-flow/projects/final/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /04-control-flow/projects/starter/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /05-functions/projects/challenge/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /05-functions/projects/starter/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /06-classes/projects/challenge/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /06-classes/projects/mini_exercise/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /07-nullability/projects/challenge/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /07-nullability/projects/final/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /07-nullability/projects/starter/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /08-collections/projects/challenge/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /08-collections/projects/final/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /08-collections/projects/starter/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/final/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /04-control-flow/projects/challenge/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /04-control-flow/projects/mini_exercise/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /05-functions/projects/mini_exercise/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /07-nullability/projects/mini_exercise/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /08-collections/projects/mini_exercise/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/challenge/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/final/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/starter/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/challenge/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/starter/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/mini_exercise/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/final/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/mini_exercise/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/challenge/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/starter/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/challenge/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/final/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/starter/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/mini_exercise/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/mini_exercise/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /01-your-dart-development-environment/projects/final/hello_dart_project/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/challenge/README.md: -------------------------------------------------------------------------------- 1 | ## Answers to the challenges and mini-exercises 2 | 3 | Find the answers in `bin/challenge.dart`. 4 | -------------------------------------------------------------------------------- /01-your-dart-development-environment/projects/final/hello.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | void main() { 5 | print('Hello, Dart!'); 6 | } -------------------------------------------------------------------------------- /03-types-and-operations/projects/starter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: starter_project 2 | 3 | environment: 4 | sdk: '>=2.12.2 <3.0.0' 5 | 6 | dependencies: 7 | 8 | dev_dependencies: 9 | pedantic: ^1.11.0 10 | -------------------------------------------------------------------------------- /05-functions/projects/final/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: final_project 2 | description: A simple command-line application. 3 | 4 | environment: 5 | sdk: '>=2.12.2 <3.0.0' 6 | 7 | dev_dependencies: 8 | pedantic: ^1.11.0 9 | -------------------------------------------------------------------------------- /05-functions/projects/starter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: starter 2 | description: A simple command-line application. 3 | 4 | environment: 5 | sdk: '>=2.12.2 <3.0.0' 6 | 7 | dev_dependencies: 8 | pedantic: ^1.11.0 9 | -------------------------------------------------------------------------------- /06-classes/projects/final/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /04-control-flow/projects/final/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /05-functions/projects/challenge/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /05-functions/projects/final/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /05-functions/projects/starter/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /06-classes/projects/challenge/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /06-classes/projects/starter/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /07-nullability/projects/final/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /07-nullability/projects/starter/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /08-collections/projects/final/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /08-collections/projects/starter/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/challenge/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: challenge 2 | 3 | environment: 4 | sdk: '>=2.12.2 <3.0.0' 5 | 6 | dependencies: 7 | characters: ^1.1.0 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/final/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: final_project 2 | 3 | environment: 4 | sdk: '>=2.12.2 <3.0.0' 5 | 6 | dependencies: 7 | characters: ^1.1.0 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /04-control-flow/projects/challenge/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /04-control-flow/projects/starter/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /05-functions/projects/final/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /05-functions/projects/mini_exercise/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /06-classes/projects/final/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /06-classes/projects/mini_exercise/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /06-classes/projects/starter/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /07-nullability/projects/challenge/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /08-collections/projects/challenge/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/final/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/starter/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/final/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/starter/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /04-control-flow/projects/final/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /04-control-flow/projects/mini_exercise/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /04-control-flow/projects/starter/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /05-functions/projects/challenge/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /05-functions/projects/starter/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /06-classes/projects/challenge/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /06-classes/projects/mini_exercise/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /07-nullability/projects/challenge/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /07-nullability/projects/final/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /07-nullability/projects/mini_exercise/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /07-nullability/projects/starter/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /08-collections/projects/challenge/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /08-collections/projects/final/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /08-collections/projects/mini_exercise/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /08-collections/projects/starter/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/challenge/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/final/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/mini_exercise/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /04-control-flow/projects/challenge/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /04-control-flow/projects/mini_exercise/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /05-functions/projects/mini_exercise/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /07-nullability/projects/mini_exercise/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /08-collections/projects/mini_exercise/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/challenge/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/final/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/mini_exercise/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/starter/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/challenge/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/final/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/starter/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/final/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/starter/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/challenge/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/starter/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/mini_exercise/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/final/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/mini_exercise/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/challenge/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/mini_exercise/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/challenge/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/starter/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /01-your-dart-development-environment/projects/final/hello_dart_project/bin/hello_dart_project.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | void main() { 5 | print('Hello, Dart project!'); 6 | } 7 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/challenge/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/final/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/mini_exercise/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/starter/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/mini_exercise/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/mini_exercise/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /01-your-dart-development-environment/projects/final/hello_dart_project/README.md: -------------------------------------------------------------------------------- 1 | A simple command-line application. 2 | 3 | Created from templates made available by Stagehand under a BSD-style 4 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 5 | -------------------------------------------------------------------------------- /01-your-dart-development-environment/projects/final/hello_dart_project/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build outputs 6 | build/ 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /06-classes/projects/challenge/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: challenge 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /06-classes/projects/final/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: final_project 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /06-classes/projects/starter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: starter 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /07-nullability/projects/starter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: starter 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.0 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /08-collections/projects/starter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: starter 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /04-control-flow/projects/challenge/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: challenge 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /04-control-flow/projects/final/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: final_project 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /04-control-flow/projects/starter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: starter 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /05-functions/projects/challenge/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: challenge 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /07-nullability/projects/challenge/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: challenge 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /07-nullability/projects/final/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: final_project 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.0 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /08-collections/projects/challenge/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: challenge 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /08-collections/projects/final/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: final_project 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/starter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: starter 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /05-functions/projects/mini_exercise/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: mini_exercise 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /06-classes/projects/mini_exercise/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: mini_exercise 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/challenge/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: challenge 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/final/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: final_project 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /04-control-flow/projects/mini_exercise/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: mini_exercise 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /07-nullability/projects/mini_exercise/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: mini_exercise 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /08-collections/projects/mini_exercise/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: mini_exercise 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/starter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: starter 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/starter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: starter 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /04-control-flow/projects/starter/bin/starter.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | /// Here is the emoji you'll use in the lesson today for your cut-and-paste 5 | /// convenience: 6 | /// 7 | /// ❤ 8 | void main() { 9 | 10 | } -------------------------------------------------------------------------------- /09-advanced-classes/projects/mini_exercise/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: mini_exercise 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/challenge/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: challenge 2 | description: A simple command-line application. 3 | 4 | environment: 5 | sdk: '>=2.12.2 <3.0.0' 6 | 7 | # Challenge 2 8 | dependencies: 9 | http: ^0.13.1 10 | 11 | dev_dependencies: 12 | pedantic: ^1.11.0 13 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/challenge/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: challenge 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/final/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: final_project 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/mini_exercise/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: mini_exercise 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/mini_exercise/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: mini_exercise 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/mini_exercise/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: mini_exercise 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 11 | -------------------------------------------------------------------------------- /01-your-dart-development-environment/projects/final/hello_dart_project/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: hello_dart_project 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dev_dependencies: 10 | pedantic: ^1.11.0 -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/final/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: final_project 2 | description: A simple command-line application. 3 | # version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.12.2 <3.0.0' 8 | 9 | dependencies: 10 | http: ^0.13.1 11 | 12 | dev_dependencies: 13 | pedantic: ^1.11.0 14 | -------------------------------------------------------------------------------- /01-your-dart-development-environment/projects/final/hello_dart_project/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Dart", 6 | "type": "dart", 7 | "request": "launch", 8 | "program": "bin/hello_dart_project.dart" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /05-functions/projects/final/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /05-functions/projects/starter/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /06-classes/projects/challenge/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /06-classes/projects/final/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /06-classes/projects/starter/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /07-nullability/projects/final/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.0 <3.0.0" 13 | -------------------------------------------------------------------------------- /08-collections/projects/final/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /04-control-flow/projects/challenge/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /04-control-flow/projects/final/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /04-control-flow/projects/starter/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /05-functions/projects/challenge/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /06-classes/projects/mini_exercise/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /07-nullability/projects/challenge/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /07-nullability/projects/starter/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.0 <3.0.0" 13 | -------------------------------------------------------------------------------- /08-collections/projects/challenge/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /08-collections/projects/starter/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/final/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /04-control-flow/projects/mini_exercise/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /05-functions/projects/mini_exercise/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /07-nullability/projects/mini_exercise/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /08-collections/projects/mini_exercise/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/challenge/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/starter/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/starter/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/mini_exercise/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/starter/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/final/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/mini_exercise/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/challenge/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/starter/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/mini_exercise/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/mini_exercise/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/starter/.packages: -------------------------------------------------------------------------------- 1 | # This file is deprecated. Tools should instead consume 2 | # `.dart_tools/package_config.json`. 3 | # 4 | # For more info see: https://dart.dev/go/dot-packages-deprecation 5 | # 6 | # Generated by pub on 2021-03-20 11:25:10.565417. 7 | pedantic:file:///Users/jonathan/.pub-cache/hosted/pub.dartlang.org/pedantic-1.11.0/lib/ 8 | starter_project:lib/ 9 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/starter/bin/starter.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | /// Copy and paste the following emojis as needed to complete this 5 | /// chapter's exercizes and challenges: 6 | /// 7 | /// 🎯 8 | /// 🇲🇳 9 | /// 👨‍👩‍👧‍👦 10 | /// 🇹🇩🇷🇴 11 | /// 👍🏿 12 | void main() { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /01-your-dart-development-environment/projects/final/hello_dart_project/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | pedantic: 5 | dependency: "direct dev" 6 | description: 7 | name: pedantic 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.11.0" 11 | sdks: 12 | dart: ">=2.12.2 <3.0.0" 13 | -------------------------------------------------------------------------------- /01-your-dart-development-environment/projects/final/hello_dart_project/.packages: -------------------------------------------------------------------------------- 1 | # This file is deprecated. Tools should instead consume 2 | # `.dart_tools/package_config.json`. 3 | # 4 | # For more info see: https://dart.dev/go/dot-packages-deprecation 5 | # 6 | # Generated by pub on 2021-03-20 11:31:58.030820. 7 | pedantic:file:///Users/jonathan/.pub-cache/hosted/pub.dartlang.org/pedantic-1.11.0/lib/ 8 | hello_dart_project:lib/ 9 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/final/assets/text.txt: -------------------------------------------------------------------------------- 1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -------------------------------------------------------------------------------- /06-classes/projects/final/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/final.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /04-control-flow/projects/final/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/final.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /05-functions/projects/final/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/final.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /06-classes/projects/starter/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/starter.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /07-nullability/projects/final/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/final.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /08-collections/projects/final/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/final.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /04-control-flow/projects/starter/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/starter.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /05-functions/projects/challenge/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/challenge.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /05-functions/projects/starter/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/starter.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /06-classes/projects/challenge/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/challenge.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /07-nullability/projects/starter/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/starter.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /08-collections/projects/starter/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/starter.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /09-advanced-classes/projects/final/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/final.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /03-types-and-operations/projects/final/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/final.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /04-control-flow/projects/challenge/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/challenge.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /07-nullability/projects/challenge/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/challenge.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /08-collections/projects/challenge/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/challenge.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /09-advanced-classes/projects/starter/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/starter.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /01-your-dart-development-environment/projects/challenge/challenge.md: -------------------------------------------------------------------------------- 1 | ## Chapter 1 challenges 2 | 3 | You can find challenge answers for future chapters in this folder. However, your challenge this time only involves creating and opening a Dart project, so this folder is empty for Chapter 1. 4 | 5 | ### Challenge 1 6 | 7 | Create a new project in VS Code by yourself and then run it. 8 | 9 | ### Challenge 2 10 | 11 | Open the final project in the supplemental materials. Run **hello.dart** and also **hello_dart_project**. -------------------------------------------------------------------------------- /03-types-and-operations/projects/starter/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/starter.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /05-functions/projects/mini_exercise/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/mini_exercise.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /06-classes/projects/mini_exercise/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/mini_exercise.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /07-nullability/projects/mini_exercise/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/mini_exercise.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /08-collections/projects/mini_exercise/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/mini_exercise.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /09-advanced-classes/projects/challenge/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/challenge.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/final/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/final.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/final/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/final.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /03-types-and-operations/projects/challenge/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/challenge.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /04-control-flow/projects/mini_exercise/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/mini_exercise.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /09-advanced-classes/projects/mini_exercise/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/mini_exercise.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/challenge/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/challenge.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/starter/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/starter.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/starter/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/starter.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /03-types-and-operations/projects/mini_exercise/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/mini_exercise.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/challenge/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/challenge.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /06-classes/projects/final/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/mini_exercise/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/mini_exercise.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/mini_exercise/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/mini_exercise.dart" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /04-control-flow/projects/final/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /05-functions/projects/challenge/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /05-functions/projects/final/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /05-functions/projects/starter/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /06-classes/projects/challenge/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /06-classes/projects/starter/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /07-nullability/projects/final/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /07-nullability/projects/starter/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /08-collections/projects/final/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /08-collections/projects/starter/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /04-control-flow/projects/challenge/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /04-control-flow/projects/starter/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /05-functions/projects/mini_exercise/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /06-classes/projects/mini_exercise/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /07-nullability/projects/challenge/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /08-collections/projects/challenge/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/final/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/starter/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/final/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/starter/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /04-control-flow/projects/mini_exercise/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /07-nullability/projects/mini_exercise/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /08-collections/projects/mini_exercise/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/challenge/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/challenge/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/mini_exercise/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/mini_exercise/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/challenge/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/final/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/starter/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/final/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/starter/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/mini_exercise/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/challenge/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/challenge/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | characters: 5 | dependency: "direct main" 6 | description: 7 | name: characters 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.1.0" 11 | pedantic: 12 | dependency: "direct dev" 13 | description: 14 | name: pedantic 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.11.0" 18 | sdks: 19 | dart: ">=2.12.2 <3.0.0" 20 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/final/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | characters: 5 | dependency: "direct main" 6 | description: 7 | name: characters 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.1.0" 11 | pedantic: 12 | dependency: "direct dev" 13 | description: 14 | name: pedantic 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.11.0" 18 | sdks: 19 | dart: ">=2.12.2 <3.0.0" 20 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/mini_exercise/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /01-your-dart-development-environment/projects/final/hello_dart_project/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/starter/.dart_tool/package_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "configVersion": 2, 3 | "packages": [ 4 | { 5 | "name": "pedantic", 6 | "rootUri": "file:///Users/jonathan/.pub-cache/hosted/pub.dartlang.org/pedantic-1.11.0", 7 | "packageUri": "lib/", 8 | "languageVersion": "2.12" 9 | }, 10 | { 11 | "name": "starter_project", 12 | "rootUri": "../", 13 | "packageUri": "lib/", 14 | "languageVersion": "2.12" 15 | } 16 | ], 17 | "generated": "2021-03-20T03:25:10.575071Z", 18 | "generator": "pub", 19 | "generatorVersion": "2.12.2" 20 | } 21 | -------------------------------------------------------------------------------- /01-your-dart-development-environment/projects/final/hello_dart_project/.dart_tool/package_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "configVersion": 2, 3 | "packages": [ 4 | { 5 | "name": "pedantic", 6 | "rootUri": "file:///Users/jonathan/.pub-cache/hosted/pub.dartlang.org/pedantic-1.11.0", 7 | "packageUri": "lib/", 8 | "languageVersion": "2.12" 9 | }, 10 | { 11 | "name": "hello_dart_project", 12 | "rootUri": "../", 13 | "packageUri": "lib/", 14 | "languageVersion": "2.12" 15 | } 16 | ], 17 | "generated": "2021-03-20T03:31:58.043402Z", 18 | "generator": "pub", 19 | "generatorVersion": "2.12.2" 20 | } 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dart Apprentice: Materials 2 | 3 | This repo contains all the downloadable materials and projects associated with the **[Dart Apprentice](http://raywenderlich.com/books/dart-apprentice)** from [raywenderlich.com](https://www.raywenderlich.com). 4 | 5 | Each edition has its own branch, named `editions/[EDITION]`. The default branch for this repo is for the most recent edition. 6 | 7 | ## Release History 8 | 9 | | Branch | Edition | Release Date | 10 | | --------------------------------------------------------------------------------|:-------:|:------------:| 11 | | [editions/1.0](https://github.com/raywenderlich/da-materials/tree/editions/1.0) | 1.0 | 2020-11-20 | 12 | | [editions/1.1](https://github.com/raywenderlich/da-materials/tree/editions/1.1) | 1.1 | 2021-04-07 | 13 | -------------------------------------------------------------------------------- /scripts/make-codex-branch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Need one and only one parameter 4 | if [ $# -ne 1 ]; then 5 | echo "Usage: $0 " 6 | echo "No spaces or such funny characters are allowed." 7 | exit 1 8 | fi 9 | 10 | # Make sure we're inside a git directory 11 | git status >/dev/null 2>&1 12 | if [ $? -ne 0 ]; then 13 | echo "error: run this script from inside a git repository" 14 | exit 1 15 | fi 16 | 17 | BRANCH=`git rev-parse --abbrev-ref HEAD` 18 | 19 | isEdition=`expr "$BRANCH" : 'editions'` 20 | 21 | if [ $isEdition -ne 8 ]; then 22 | echo "WARNING - you're starting a new branch from $BRANCH" 23 | echo "That doesn't look like an editions/x.x branch!" 24 | read -p "Hit Ctrl-C to cancel, or RETURN to continue" choice 25 | fi 26 | 27 | git checkout -b $1 28 | git checkout $BRANCH 29 | 30 | echo Added branch for "$1". 31 | echo "You're now back on the '$BRANCH' branch." 32 | 33 | -------------------------------------------------------------------------------- /06-classes/projects/final/bin/user.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | class User { 5 | const User({ 6 | this.id = _anonymousId, 7 | this.name = _anonymousName, 8 | }) : assert(id >= 0); 9 | 10 | const User.anonymous() : this(); 11 | 12 | // User.fromJson(Map json) 13 | // : id = json['id'] as int, 14 | // name = json['name'] as String; 15 | 16 | // factory User.fromJson(Map json) { 17 | // final userId = json['id'] as int; 18 | // final userName = json['name'] as String; 19 | // return User(id: userId, name: userName); 20 | // } 21 | 22 | static User fromJson(Map json) { 23 | final userId = json['id'] as int; 24 | final userName = json['name'] as String; 25 | return User(id: userId, name: userName); 26 | } 27 | 28 | final String name; 29 | final int id; 30 | 31 | static const _anonymousId = 0; 32 | static const _anonymousName = 'anonymous'; 33 | 34 | String toJson() { 35 | return '{"id":$id,"name":"$name"}'; 36 | } 37 | 38 | @override 39 | String toString() { 40 | return 'User(id: $id, name: $name)'; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /07-nullability/projects/mini_exercise/bin/mini_exercise.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | void main() { 5 | nullOverviewMiniExercise1(); 6 | nullOverviewMiniExercise2(); 7 | nullOverviewMiniExercise3(); 8 | } 9 | 10 | void nullOverviewMiniExercise1() { 11 | /// Null overview: Mini-exercise 1 12 | /// 13 | /// Create a `String?` variable called `profession`, but don't give it a value. 14 | /// Then you'll have `profession` `null`. :] 15 | 16 | String? profession; 17 | print(profession); 18 | } 19 | 20 | void nullOverviewMiniExercise2() { 21 | /// Null overview: Mini-exercise 2 22 | /// 23 | /// Give `profession` a value of "basketball player". 24 | 25 | String? profession; 26 | profession = 'basketball player'; 27 | print(profession); 28 | } 29 | 30 | void nullOverviewMiniExercise3() { 31 | /// Null overview: Mini-exercise 3 32 | /// 33 | /// Write the following line and then hover your cursor over the variable 34 | /// name. What type does Dart infer `iLove` to be? 35 | /// 36 | /// ``` 37 | /// const iLove = 'Dart'; 38 | /// ``` 39 | 40 | const iLove = 'Dart'; 41 | print(iLove.runtimeType); 42 | // `iLove` is of type String (non-nullable). 43 | } -------------------------------------------------------------------------------- /scripts/make-codex-subdirectory.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Need one and only one parameter 4 | if [ $# -ne 1 ]; then 5 | echo "Usage: $0 " 6 | echo "No spaces or such funny characters are allowed." 7 | exit 1 8 | fi 9 | 10 | # Make sure we're inside a git directory 11 | git status >/dev/null 2>&1 12 | if [ $? -ne 0 ]; then 13 | echo "error: run this script from inside a git repository" 14 | exit 1 15 | fi 16 | 17 | BRANCH=`git rev-parse --abbrev-ref HEAD` 18 | 19 | isEdition=`expr "$BRANCH" : 'editions'` 20 | 21 | if [ $isEdition -ne 8 ]; then 22 | echo "WARNING - you're starting a new branch from $BRANCH" 23 | echo "That doesn't look like an editions/x.x branch!" 24 | read -p "Hit Ctrl-C to cancel, or RETURN to continue" choice 25 | fi 26 | 27 | # Checkout the new branch, create the directory & enter it 28 | git checkout -b $1 29 | mkdir $1 30 | pushd $1 31 | # Create the standard directory structure, and enter it 32 | mkdir -p assets projects/starter projects/final projects/challenge 33 | touch assets/.keep projects/starter/.keep projects/final/.keep projects/challenge/.keep 34 | # Jump back out, and commit the changes 35 | popd 36 | git add $1 37 | git commit -m "Adding $1" $1 38 | git checkout $BRANCH 39 | 40 | echo Added directory, branch, and initial commit for "$1". 41 | echo "You're now back on the '$BRANCH' branch." 42 | 43 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/mini_exercise/bin/mini_exercise.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | import 'dart:math'; 5 | 6 | void main() { 7 | /// Arithmetic operations: Mini-exercise 8 | /// 9 | /// Did you know that the sine of `45°` equals `1` over the square root 10 | /// of `2`? Try it out! 11 | 12 | // Remember to add the `dart:math` import at the top of the file. 13 | print(sin(45 * pi / 180)); 14 | print(1 / sqrt(2)); 15 | 16 | /// Naming data: Mini-exercise 1 17 | /// 18 | /// Declare a constant of type `int` called `myAge` and set it to your age. 19 | 20 | const myAge = 98; 21 | print(myAge); 22 | 23 | /// Naming data: Mini-exercise 2 24 | /// 25 | /// Declare a variable of type `double` called `averageAge`. Initially, set 26 | /// the variable to your own age. Then, set it to the average of your age and 27 | /// your best friend's age. 28 | 29 | double averageAge = 98; 30 | averageAge = (98 + 27) / 2; 31 | print(averageAge); 32 | 33 | /// Naming data: Mini-exercise 3 34 | /// 35 | /// Create a constant called `testNumber` and initialize it with whatever 36 | /// integer you'd like. Next, create another constant called `evenOdd` and 37 | /// set it equal to `testNumber` modulo `2`. Now change `testNumber` to 38 | /// various numbers. What do you notice about `evenOdd`? 39 | 40 | const testNumber = 42; 41 | const evenOdd = testNumber % 2; 42 | print(evenOdd); 43 | // `evenOdd` is 0 if `testNumber` is even. 44 | // `evenOdd` is 1 if `testNumber` is odd. 45 | } -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/mini_exercise/bin/mini_exercise.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | Future main() async { 5 | await miniExercisesFutures(); 6 | await miniExercisesStreams(); 7 | } 8 | 9 | /// Mini-exercises: Futures 10 | /// 11 | /// 1. Use the `Future.delayed` constructor to provide a string after two 12 | /// seconds that says "I am from the future." 13 | /// 2. Create a `String` variable named `message` that awaits the future to 14 | /// complete with a value. 15 | /// 3. Surround the code above with a `try-catch` block. 16 | Future miniExercisesFutures() async { 17 | print('Starting miniExercisesFutures()...'); 18 | try { 19 | final message = await Future.delayed( 20 | Duration(seconds: 2), 21 | () => 'I am from the future.', 22 | ); 23 | print(message); 24 | } catch (exception) { 25 | print(exception); 26 | } 27 | } 28 | 29 | /// Mini-exercises: Streams 30 | /// 31 | /// The following code produces a stream that outputs an integer every second 32 | /// and then stops after the tenth time. 33 | /// 34 | /// ``` 35 | /// Stream.periodic( 36 | /// Duration(seconds: 1), 37 | /// (value) => value, 38 | /// ).take(10); 39 | /// ``` 40 | /// 41 | /// 1. Set the stream above to a variable named `myStream`. 42 | /// 2. Use `await for` to print the value of the integer on each data event 43 | /// coming from the stream. 44 | Future miniExercisesStreams() async { 45 | final myStream = Stream.periodic( 46 | Duration(seconds: 1), 47 | (value) => value, 48 | ).take(10); 49 | await for (var number in myStream) { 50 | print(number); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /06-classes/projects/mini_exercise/bin/mini_exercise.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | void main() { 5 | 6 | } 7 | 8 | /// Dart classes 9 | 10 | /// Dart classes: Mini-exercise 1 11 | /// 12 | /// Create a class called `Password` and give it a string property 13 | /// called `value`. 14 | 15 | // class Password { 16 | // String value = ''; 17 | // } 18 | 19 | /// Dart classes: Mini-exercise 2 20 | /// 21 | /// Override the `toString` method of `Password` so that it prints `value`. 22 | 23 | // class Password { 24 | // String value = ''; 25 | // 26 | // @override 27 | // String toString() { 28 | // return value; 29 | // } 30 | // } 31 | 32 | /// Dart classes: Mini-exercise 3 33 | /// 34 | /// Add a method to `Password` called `isValid` that returns `true` only 35 | /// if the length of `value` is greater than `8`. 36 | 37 | // class Password { 38 | // String value = ''; 39 | // 40 | // bool isValid() { 41 | // return value.length > 8; 42 | // } 43 | // 44 | // @override 45 | // String toString() { 46 | // return value; 47 | // } 48 | // } 49 | 50 | 51 | /// Constructors 52 | 53 | /// Constructors: Mini-exercise 1 54 | /// 55 | /// Given the following class: 56 | /// 57 | /// ``` 58 | /// class Password { 59 | /// String value = ''; 60 | /// } 61 | /// ``` 62 | /// 63 | /// Make `value` a `final` variable, but not private. 64 | 65 | // class Password { 66 | // final value = ''; 67 | // } 68 | 69 | /// Constructors: Mini-exercise 2 70 | /// 71 | /// Add a `const` constructor as the only way to initialize a 72 | /// `Password` object. 73 | 74 | // class Password { 75 | // const Password(this.value); 76 | // final String value; 77 | // } -------------------------------------------------------------------------------- /06-classes/projects/challenge/bin/challenge.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | void main() { 5 | /// Challenge 1: Bert and Ernie 6 | /// 7 | /// Create a `Student` class with final `firstName` and `lastName` 8 | /// `String` properties and a variable `grade` as an `int` property. 9 | /// Add a constructor to the class that initializes all the properties. 10 | /// Add a method to the class that nicely formats a `Student` for printing. 11 | /// Use the class to create students `bert` and `ernie` with grades of 95 and 12 | /// 85, respectively. 13 | 14 | final ernie = Student('Ernie', 'Henson', 95); 15 | final bert = Student('Bert', 'Oz', 85); 16 | print('$ernie\n$bert'); 17 | 18 | /// Challenge 2: Spheres 19 | /// 20 | /// Create a `Sphere` class with a `const` constructor that takes a positive 21 | /// length `radius` as a named parameter. Add getters for the the volume and 22 | /// surface area but none for the radius. Don't use the `dart:math` package 23 | /// but store your own version of `pi` as a `static` constant. Use your class 24 | /// to find the volume and surface area of a sphere with a radius of 12. 25 | 26 | const sphere = Sphere(radius: 12); 27 | final volume = sphere.volume; 28 | final area = sphere.area; 29 | print('volume: $volume, area: $area'); 30 | } 31 | 32 | class Student { 33 | Student(this.firstName, this.lastName, this.grade); 34 | 35 | final String firstName; 36 | final String lastName; 37 | int grade; 38 | 39 | @override 40 | String toString() => '$firstName $lastName: $grade'; 41 | } 42 | 43 | class Sphere { 44 | const Sphere({required int radius}) 45 | : assert(radius > 0), 46 | _radius = radius; 47 | 48 | final int _radius; 49 | 50 | double get volume => 4 / 3 * pi * _radius * _radius * _radius; 51 | double get area => 4 * pi * _radius * _radius; 52 | 53 | static const double pi = 3.14159265359; 54 | } 55 | -------------------------------------------------------------------------------- /07-nullability/projects/challenge/bin/challenge.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | import 'dart:math'; 5 | 6 | void main() { 7 | challenge1(); 8 | challenge2(); 9 | } 10 | 11 | void challenge1() { 12 | /// Challenge 1: Random nothings 13 | /// 14 | /// Write a function that randomly returns `42` or `null`. Assign 15 | /// the return value of the function to an variable named `result` that 16 | /// will never be `null`. Give `result` a default of `0` if the function 17 | /// returns `null`. 18 | 19 | int? randomNothing() { 20 | final isTrue = Random().nextBool(); 21 | return (isTrue) ? 42 : null; 22 | } 23 | 24 | final result = randomNothing() ?? 0; 25 | print(result); 26 | } 27 | 28 | void challenge2() { 29 | /// Challenge 2: Naming customs 30 | /// 31 | /// People around the world have different customs for giving names to 32 | /// children. It would be difficult to create a data class to accurately 33 | /// represent them all, but try it like this: 34 | /// 35 | /// - Create a class called `Name` with `givenName` and `surname` properties. 36 | /// - Some people write the surname last and some write it first. Add a 37 | /// Boolean property called `surnameIsFirst` to keep track of this. 38 | /// - Not everyone in the world has a surname. 39 | /// - Add a `toString` method that prints the full name. 40 | 41 | final ray = Name(givenName: 'Ray', surname: 'Wenderlich'); 42 | final liMing = Name(surname: 'Li', givenName: 'Ming', surnameIsFirst: true); 43 | final baatar = Name(givenName: 'Baatar'); 44 | 45 | print(ray); 46 | print(liMing); 47 | print(baatar); 48 | } 49 | 50 | class Name { 51 | Name({ 52 | required this.givenName, 53 | this.surname, 54 | this.surnameIsFirst = false, 55 | }); 56 | 57 | final String givenName; 58 | final String? surname; 59 | final bool surnameIsFirst; 60 | 61 | @override 62 | String toString() { 63 | if (surname == null) { 64 | return givenName; 65 | } 66 | if (surnameIsFirst) { 67 | return '$surname $givenName'; 68 | } 69 | return '$givenName $surname'; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/mini_exercise/bin/mini_exercise.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | void main() { 5 | /// Data types in Dart: Mini-exercise 1 6 | /// 7 | /// Create a constant called `age1` and set it equal to `42`. Create another 8 | /// constant called `age2` and set it equal to `21`. Check by hovering over 9 | /// the variable names that the type for both has been inferred correctly as 10 | /// `int`. 11 | 12 | const age1 = 42; 13 | const age2 = 21; 14 | 15 | /// Data types in Dart: Mini-exercise 2 16 | /// 17 | /// Create a constant called `averageAge` and set it equal to the average of 18 | /// `age1` and `age2` using the operation `(age1 + age2) / 2`. Hover over 19 | /// `averageAge` to check the type. Then check the result of `averageAge`. Why 20 | /// is it a `double` if the components are all `int`? 21 | 22 | const averageAge = (age1 + age2) / 2; 23 | print(averageAge); 24 | // `averageAge` is a `double` because any time you divide in Dart, the 25 | // result is a `double`. Division can result in non-integer answers, so 26 | // making the result an `int` could cause a loss of precision. 27 | 28 | /// Strings: Mini-exercise 1 29 | /// 30 | /// Create a string constant called `firstName` and initialize it to your 31 | /// first name. Also create a string constant called `lastName` and 32 | /// initialize it to your last name. 33 | 34 | const firstName = 'Ray'; 35 | const lastName = 'Wenderlich'; 36 | 37 | /// Strings: Mini-exercise 2 38 | /// 39 | /// Create a string constant called `fullName` by adding the `firstName` and 40 | /// `lastName` constants together, separated by a space. 41 | 42 | const fullName = firstName + ' ' + lastName; 43 | print(fullName); 44 | 45 | /// Strings: Mini-exercise 3 46 | /// 47 | /// Using interpolation, create a string constant called `myDetails` that 48 | /// uses the `fullName` constant to create a string introducing yourself. 49 | /// For example, Ray Wenderlich's string would read: "Hello, my name is Ray 50 | /// Wenderlich." 51 | 52 | const myDetails = 'Hello, my name is $fullName.'; 53 | print(myDetails); 54 | } 55 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/final/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | charcode: 5 | dependency: transitive 6 | description: 7 | name: charcode 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.2.0" 11 | collection: 12 | dependency: transitive 13 | description: 14 | name: collection 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.15.0" 18 | http: 19 | dependency: "direct main" 20 | description: 21 | name: http 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "0.13.1" 25 | http_parser: 26 | dependency: transitive 27 | description: 28 | name: http_parser 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "4.0.0" 32 | meta: 33 | dependency: transitive 34 | description: 35 | name: meta 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.3.0" 39 | path: 40 | dependency: transitive 41 | description: 42 | name: path 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.8.0" 46 | pedantic: 47 | dependency: "direct dev" 48 | description: 49 | name: pedantic 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.11.0" 53 | source_span: 54 | dependency: transitive 55 | description: 56 | name: source_span 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.8.1" 60 | string_scanner: 61 | dependency: transitive 62 | description: 63 | name: string_scanner 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.1.0" 67 | term_glyph: 68 | dependency: transitive 69 | description: 70 | name: term_glyph 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "1.2.0" 74 | typed_data: 75 | dependency: transitive 76 | description: 77 | name: typed_data 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "1.3.0" 81 | sdks: 82 | dart: ">=2.12.2 <3.0.0" 83 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/challenge/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | charcode: 5 | dependency: transitive 6 | description: 7 | name: charcode 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "1.2.0" 11 | collection: 12 | dependency: transitive 13 | description: 14 | name: collection 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.15.0" 18 | http: 19 | dependency: "direct main" 20 | description: 21 | name: http 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "0.13.1" 25 | http_parser: 26 | dependency: transitive 27 | description: 28 | name: http_parser 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "4.0.0" 32 | meta: 33 | dependency: transitive 34 | description: 35 | name: meta 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.3.0" 39 | path: 40 | dependency: transitive 41 | description: 42 | name: path 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.8.0" 46 | pedantic: 47 | dependency: "direct dev" 48 | description: 49 | name: pedantic 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.11.0" 53 | source_span: 54 | dependency: transitive 55 | description: 56 | name: source_span 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.8.1" 60 | string_scanner: 61 | dependency: transitive 62 | description: 63 | name: string_scanner 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.1.0" 67 | term_glyph: 68 | dependency: transitive 69 | description: 70 | name: term_glyph 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "1.2.0" 74 | typed_data: 75 | dependency: transitive 76 | description: 77 | name: typed_data 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "1.3.0" 81 | sdks: 82 | dart: ">=2.12.2 <3.0.0" 83 | -------------------------------------------------------------------------------- /08-collections/projects/challenge/bin/challenge.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | void main() { 5 | challenge1(); 6 | challenge2(); 7 | challenge3(); 8 | } 9 | 10 | const paragraphOfText = 'Once upon a time there was a Dart programmer who ' 11 | 'had a challenging challenge to solve. Though the challenge was great, ' 12 | 'a solution did come. The end.'; 13 | 14 | void challenge1() { 15 | /// Challenge 1: A unique request 16 | /// 17 | /// Write a function that takes a paragraph of text and returns a 18 | /// collection of unique String characters that the text contains. 19 | 20 | Set uniqueCodePoints(String text) { 21 | return text.runes 22 | .map((codePoint) => String.fromCharCode(codePoint)) 23 | .toSet(); 24 | } 25 | 26 | print(uniqueCodePoints(paragraphOfText)); 27 | } 28 | 29 | void challenge2() { 30 | /// Challenge 2: Counting on you 31 | /// 32 | /// Repeat Challenge 1 but this time have the function return a 33 | /// collection that contains the frequency count of every unique 34 | /// character. 35 | 36 | Map characterFrequencyMap(String text) { 37 | final characterFrequencyMap = {}; 38 | for (var codePoint in text.runes) { 39 | final character = String.fromCharCode(codePoint); 40 | final frequency = characterFrequencyMap[character] ?? 0; 41 | characterFrequencyMap[character] = frequency + 1; 42 | } 43 | return characterFrequencyMap; 44 | } 45 | 46 | print(characterFrequencyMap(paragraphOfText)); 47 | } 48 | 49 | void challenge3() { 50 | /// Challenge 3: Mapping users 51 | /// 52 | /// Create a class called `User` with properties for `id` and `name`. 53 | /// Make a `List` with three users, specifying any appropriate names 54 | /// and IDs you like. Then write a function that converts your user 55 | /// list to a list of maps whose keys are `id` and `name`. 56 | 57 | final users = [ 58 | User(1, 'Brian'), 59 | User(2, 'Chris'), 60 | User(3, 'Pablo'), 61 | ]; 62 | 63 | // Note: You'll find many APIs use `dynamic` instead of `Object` when 64 | // converting a custom object to a map. Either one works, though using 65 | // `Object` when possible allows you to keep type safety. 66 | List> usersToMapList(List users) { 67 | final userMapList = >[]; 68 | for (var user in users) { 69 | final userMap = { 70 | 'id': user.id, 71 | 'name': user.name, 72 | }; 73 | userMapList.add(userMap); 74 | } 75 | return userMapList; 76 | } 77 | 78 | print(usersToMapList(users)); 79 | } 80 | 81 | class User { 82 | User(this.id, this.name); 83 | final int id; 84 | final String name; 85 | } 86 | -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/final/bin/final.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | import 'dart:math'; 5 | 6 | void main() { 7 | /// Comments 8 | 9 | // This is a comment. It is not executed. 10 | 11 | // This is also a comment, 12 | // over multiple lines. 13 | 14 | /* This is also a comment. Over many... 15 | many... 16 | many lines. */ 17 | 18 | /* This is a comment. 19 | /* And inside it is 20 | another comment. */ 21 | Back to the first. */ 22 | 23 | /// I am a documentation comment 24 | /// at your service. 25 | 26 | /** 27 | * Me, too! 28 | */ 29 | 30 | // Command+click on a Mac, or Control+click on a PC, the [print] keyword. 31 | print('Hello, Dart!'); 32 | 33 | /// Printing out 34 | 35 | print('Hello, Dart Apprentice reader!'); 36 | 37 | /// Arithmetic operations 38 | 39 | /// Simple operations 40 | print(2 + 6); 41 | print(10 - 2); 42 | print(2 * 4); 43 | print(24 / 3); 44 | 45 | print(2+6); 46 | print(2 + 6); 47 | 48 | /// Decimal numbers 49 | print(22 / 7); 50 | print(22 ~/ 7); 51 | 52 | /// The Euclidean modulo operation 53 | print(28 % 10); 54 | 55 | /// Order of operations 56 | print(((8000 / (5 * 10)) - 32) ~/ (29 % 5)); 57 | print(350 / 5 + 2); 58 | print(350 / (5 + 2)); 59 | 60 | /// Math functions 61 | print(sin(45 * pi / 180)); 62 | print(cos(135 * pi / 180)); 63 | print(sqrt(2)); 64 | print(max(5, 10)); 65 | print(min(-5, -10)); 66 | print(max(sqrt(2), pi / 2)); 67 | 68 | /// Naming data 69 | 70 | /// Variables 71 | int number = 10; 72 | number = 15; 73 | double apple = 3.14159; 74 | print(10.isEven); 75 | print(3.14159.round()); 76 | 77 | /// Type safety 78 | int myInteger = 10; 79 | // myInteger = 3.14159; // No, no, no. That not allowed. 80 | 81 | num myNumber; 82 | myNumber = 10; // OK 83 | myNumber = 3.14159; // OK 84 | // myNumber = 'ten'; // No, no, no. 85 | 86 | dynamic myVariable; 87 | myVariable = 10; // OK 88 | myVariable = 3.14159; // OK 89 | myVariable = 'ten'; // OK 90 | 91 | /// Type inference 92 | var someNumber = 10; 93 | someNumber = 15; // OK 94 | // someNumber = 3.14159; // No, no, no. 95 | 96 | /// Constants 97 | const myConstant = 10; 98 | // myConstant = 0; // Not allowed. 99 | 100 | final hoursSinceMidnight = DateTime.now().hour; 101 | // hoursSinceMidnight = 0; // Not allowed. 102 | 103 | /// Increment and decrement 104 | var counter = 0; 105 | counter += 1; 106 | counter -= 1; 107 | counter = counter + 1; 108 | counter = counter - 1; 109 | counter++; 110 | counter--; 111 | 112 | double myValue = 10; 113 | myValue *= 3; 114 | myValue /= 2; 115 | myValue = myValue * 3; 116 | myValue = myValue / 2; 117 | } 118 | -------------------------------------------------------------------------------- /06-classes/projects/final/bin/final.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | import 'user.dart'; 5 | 6 | void main() { 7 | dartClasses(); 8 | constructors(); 9 | dartObjects(); 10 | staticMembers(); 11 | } 12 | 13 | void dartClasses() { 14 | final user = User(); 15 | // final user = new User(); 16 | // user.name = 'Ray'; 17 | // user.id = 42; 18 | print(user); 19 | print(user.toJson()); 20 | } 21 | 22 | void constructors() { 23 | // final user = User(42, 'Ray'); 24 | // final user = User(id: 42, name: 'Ray'); 25 | // final user = User(_id: 42, _name: 'Ray'); 26 | // final anonymousUser = User.anonymous(); 27 | final vicki = User(id: 24, name: 'Vicki'); 28 | // final vicki = User(_id: 24, _name: 'Vicki'); 29 | // vicki.name = 'Nefarious Hacker'; 30 | // vicki._name = 'Nefarious Hacker'; 31 | print(vicki); 32 | // final vicki = User(id: 24, name: 'Vicki'); 33 | // vicki._name = 'Nefarious Hacker'; 34 | // final vicki = User(id: 24, name: 'Vicki'); 35 | // vicki._name = 'Nefarious Hacker'; 36 | // final jb = User(id: -1, name: 'JB Lorenzo'); 37 | final jb = User(id: 100, name: 'JB Lorenzo'); 38 | print(jb); 39 | const user = User(id: 42, name: 'Ray'); 40 | print(user); 41 | const anonymousUser = User.anonymous(); 42 | print(anonymousUser); 43 | final map = {'id': 10, 'name': 'Manda'}; 44 | final manda = User.fromJson(map); 45 | print(manda); 46 | } 47 | 48 | void dartObjects() { 49 | final myObject = MyClass(); 50 | final anotherObject = myObject; 51 | print(myObject.myProperty); // 1 52 | anotherObject.myProperty = 2; 53 | print(myObject.myProperty); // 2 54 | const ray = User(id: 42, name: 'Ray'); 55 | print(ray.id); 56 | print(ray.name); 57 | // final email = Email(); 58 | // email.value = 'ray@example.com'; 59 | final email = Email('ray@example.com'); 60 | final emailString = email.value; 61 | print(emailString); 62 | } 63 | 64 | void staticMembers() { 65 | final value = SomeClass.myProperty; 66 | SomeClass.myMethod(); 67 | final mySingleton = MySingleton.instance; 68 | // final user = User.fromJson('{"id":42,"name":"Ray"}'); 69 | final map = {'id': 10, 'name': 'Manda'}; 70 | final manda = User.fromJson(map); 71 | print(manda); 72 | } 73 | 74 | class Address { 75 | Address(); 76 | var value = ''; 77 | } 78 | 79 | class Email { 80 | Email(this.value); 81 | final value; 82 | } 83 | 84 | class MyClass { 85 | int myProperty = 0; 86 | void myMethod() { 87 | print('Hello, Dart!'); 88 | } 89 | } 90 | 91 | class SomeClass { 92 | static int myProperty = 0; 93 | static void myMethod() { 94 | print('Hello, Dart!'); 95 | } 96 | } 97 | 98 | class MySingleton { 99 | MySingleton._(); 100 | static final MySingleton instance = MySingleton._(); 101 | } 102 | -------------------------------------------------------------------------------- /05-functions/projects/mini_exercise/bin/mini_exercise.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | void main() { 5 | functionBasicsMiniExercise1(); 6 | functionBasicsMiniExercise2(); 7 | functionBasicsMiniExercise3(); 8 | 9 | anonymousFunctionsMiniExercise1(); 10 | anonymousFunctionsMiniExercise2(); 11 | 12 | arrowFunctionsMiniExercise1(); 13 | } 14 | 15 | /// Function basics: Mini-exercise 1 16 | /// 17 | /// Write a function named `youAreWonderful` with a String parameter 18 | /// called `name`. It returns a string using `name`, something like 19 | /// "You're wonderful, Bob." 20 | void functionBasicsMiniExercise1() { 21 | String youAreWonderful(String name) { 22 | return "You're wonderful, $name."; 23 | } 24 | 25 | print(youAreWonderful('Bob')); 26 | } 27 | 28 | /// Function basics: Mini-exercise 2 29 | /// 30 | /// Add another `int` parameter called `numberPeople` so that the 31 | /// function returns something like "You're wonderful, Bob. 10 people 32 | /// think so." 33 | void functionBasicsMiniExercise2() { 34 | String youAreWonderful(String name, int numberPeople) { 35 | return "You're wonderful, $name. $numberPeople people think so."; 36 | } 37 | 38 | print(youAreWonderful('Bob', 10)); 39 | } 40 | 41 | /// Function basics: Mini-exercise 3 42 | /// 43 | /// Make both inputs named parameters. Make `name` required and 44 | /// `numberPeople` have a default of `30`. 45 | void functionBasicsMiniExercise3() { 46 | String youAreWonderful({ 47 | required String name, 48 | int numberPeople = 30, 49 | }) { 50 | return "You're wonderful, $name. $numberPeople people think so."; 51 | } 52 | 53 | print(youAreWonderful(name: 'Mary')); 54 | } 55 | 56 | /// Anonymous functions: Mini-exercise 1 57 | /// 58 | /// Change the `youAreWonderful()` function in the first mini-exercise 59 | /// of this chapter into an anonymous function. Assign it to a variable 60 | /// called `wonderful`. 61 | void anonymousFunctionsMiniExercise1() { 62 | final wonderful = (String name) { 63 | return "You're wonderful, $name."; 64 | }; 65 | 66 | print(wonderful('Bob')); 67 | } 68 | 69 | /// Anonymous functions: Mini-exercise 2 70 | /// 71 | /// Using `forEach()`, print a message telling the people in the following 72 | /// list that they're wonderful. 73 | /// 74 | /// ``` 75 | /// const people = ['Chris', 'Tiffani', 'Pablo']; 76 | /// ``` 77 | void anonymousFunctionsMiniExercise2() { 78 | const people = ['Chris', 'Tiffani', 'Pablo']; 79 | people.forEach((person) { 80 | print("You're wonderful, $person."); 81 | }); 82 | } 83 | 84 | /// Arrow functions: Mini-exercise 1 85 | /// 86 | /// Change the `forEach()` loop in the previous "You're wonderful" 87 | /// mini-exercise to use arrow syntax. 88 | void arrowFunctionsMiniExercise1() { 89 | const people = ['Chris', 'Tiffani', 'Pablo']; 90 | people.forEach((person) => print("You're wonderful, $person.")); 91 | } -------------------------------------------------------------------------------- /02-expressions-variables-constants/projects/challenge/bin/challenge.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | import 'dart:math'; 5 | 6 | void main() { 7 | /// Challenge 1: Variables 8 | /// 9 | /// Declare a constant called `myAge` and set it equal to your age. 10 | /// Also declare variable called `dogs` and set that equal to the 11 | /// number of dogs you own. Then imagine you bought a new puppy and increment 12 | /// the `dogs` variable by one. 13 | 14 | const myAge = 42; 15 | var dogs = 101; 16 | dogs++; 17 | print(myAge); 18 | print(dogs); 19 | 20 | /// Challenge 2: Make it compile 21 | /// 22 | /// Given the following code: 23 | /// 24 | /// ``` 25 | /// age = 16; 26 | /// print(age); 27 | /// age = 30; 28 | /// print(age); 29 | /// ``` 30 | /// 31 | /// Modify the first line so that it compiles. Did you use `var`, `int`, 32 | /// `final` or `const`? 33 | 34 | var age = 16; 35 | print(age); 36 | age = 30; 37 | print(age); 38 | // Using `int` rather than `var` would also have made it compile. However, 39 | // the general practice is to use `var` if the type is known and obvious from 40 | // from the value. 41 | 42 | /// Challenge 3: Compute the answer 43 | /// 44 | /// Consider the following code: 45 | /// 46 | /// ``` 47 | /// const x = 46; 48 | /// const y = 10; 49 | /// ``` 50 | /// 51 | /// Work out what answer equals when you add the following lines of code: 52 | /// 53 | /// ``` 54 | /// const answer1 = (x * 100) + y; 55 | /// const answer2 = (x * 100) + (y * 100); 56 | /// const answer3 = (x * 100) + (y / 10); 57 | /// ``` 58 | 59 | const x = 46; 60 | const y = 10; 61 | 62 | // 1 63 | const answer1 = (x * 100) + y; 64 | print(answer1); // 4610 65 | 66 | // 2 67 | const answer2 = (x * 100) + (y * 100); 68 | print(answer2); // 5600 69 | 70 | // 3 71 | const answer3 = (x * 100) + (y / 10); 72 | print(answer3); // 4601.0 73 | 74 | /// Challenge 4: Average rating 75 | /// 76 | /// Declare three constants called `rating1`, `rating2` and `rating3` of 77 | /// type `double` and assign each a value. Calculate the average of the 78 | /// three and store the result in a constant named `averageRating`. 79 | 80 | const rating1 = 7.9; 81 | const rating2 = 6.5; 82 | const rating3 = 10.0; 83 | const averageRating = (rating1 + rating2 + rating3) / 3; 84 | print(averageRating); 85 | 86 | /// Challenge 5: Quadratic equations 87 | /// 88 | /// A quadratic equation is something of the form 89 | /// 90 | /// `a⋅x² + b⋅x + c = 0`. 91 | /// 92 | /// The values of `x` which satisfy this can be solved by using the equation 93 | /// 94 | /// `x = (-b ± sqrt(b² - 4⋅a⋅c)) / (2⋅a)`. 95 | /// 96 | /// Declare three constants named `a`, `b` and `c` of type `double`. Then 97 | /// calculate the two values for `x` using the equation above (noting that 98 | /// the `±` means plus or minus, so one value of `x` for each). Store the 99 | /// results in constants called `root1` and `root2` of type `double`. 100 | 101 | const a = 2.0; 102 | const b = 3.0; 103 | const c = 1.0; 104 | final root1 = (-b + sqrt(b * b - 4 * a * c)) / (2 * a); 105 | final root2 = (-b - sqrt(b * b - 4 * a * c)) / (2 * a); 106 | print(root1); 107 | print(root2); 108 | } -------------------------------------------------------------------------------- /05-functions/projects/challenge/bin/challenge.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | import 'dart:math'; 5 | 6 | void main(List arguments) { 7 | challenge1(); 8 | challenge2(); 9 | challenge3(); 10 | } 11 | 12 | /// Challenge 1: Prime time 13 | /// 14 | /// Write a function that checks if a number is prime. 15 | /// 16 | /// Here is some help if you want a few hints before you look at the answer: 17 | /// 18 | /// First, write a function like this: 19 | /// 20 | /// ``` 21 | /// bool isNumberDivisible(int number, int divisor) 22 | /// ``` 23 | /// 24 | /// to determine if one number is divisible by another. 25 | /// Hint: Use the modulo operator %. 26 | /// 27 | /// Then, write the function 28 | /// 29 | /// ``` 30 | /// bool isPrime(int number) 31 | /// ``` 32 | /// 33 | /// that returns true if prime and false otherwise. A number is prime if 34 | /// it's only divisible by 1 and itself. Loop through the numbers from 1 35 | /// to the number and find the number's divisors. If it has any divisors 36 | /// other than 1 and itself, it's not prime. 37 | /// 38 | /// Check the following cases: 39 | /// isPrime(6); // false 40 | /// isPrime(13); // true 41 | /// isPrime(8893); // true 42 | /// 43 | /// Hint 1: Numbers less than zero are not considered prime. 44 | /// Hint 2: Use a for loop to look for divisors. You can start at 2 45 | /// and if you end before the number, return false. 46 | /// Hint 3: If you're clever, you can loop from 2 until you reach 47 | /// the square root of the number. Add the following import 48 | /// to the top of the file to access the sqrt function: 49 | /// 50 | /// import 'dart:math'; 51 | void challenge1() { 52 | bool isNumberDivisible(int number, int divisor) { 53 | return number % divisor == 0; 54 | } 55 | 56 | bool isPrime(int number) { 57 | var isPrime = true; 58 | for (var i = 2; i <= sqrt(number); i++) { 59 | if (isNumberDivisible(number, i)) { 60 | isPrime = false; 61 | } 62 | } 63 | return isPrime; 64 | } 65 | 66 | print(isPrime(6)); 67 | print(isPrime(13)); 68 | print(isPrime(8893)); 69 | } 70 | 71 | /// Challenge 2: Can you repeat that? 72 | /// 73 | /// Write a function named `repeatTask` that looks like this: 74 | /// 75 | /// ``` 76 | /// int repeatTask(int times, int input, Function task) 77 | /// ``` 78 | /// 79 | /// It repeats a given `task` on `input` for `times` number of times. 80 | /// 81 | /// Pass an anonymous function to `repeatTask` to square the input 82 | /// of 2 four times. Confirm that you get the result 65536, since 83 | /// 2 squared is 4, 84 | /// 4 squared is 16, 85 | /// 16 squared is 256, and 86 | /// 256 squared is 65536. 87 | void challenge2() { 88 | int repeatTask(int times, int input, Function task) { 89 | int result = task(input); 90 | for (var i = 1; i < times; i++) { 91 | result = task(result); 92 | } 93 | return result; 94 | } 95 | 96 | final result = repeatTask(4, 2, (num input) { 97 | return input * input; 98 | }); 99 | 100 | print(result); 101 | } 102 | 103 | /// Challenge 3: Darts and arrows 104 | /// 105 | /// Update Challenge 2 to use arrow syntax. 106 | void challenge3() { 107 | int repeatTask(int times, int input, Function task) { 108 | int result = task(input); 109 | for (var i = 1; i < times; i++) { 110 | result = task(result); 111 | } 112 | return result; 113 | } 114 | 115 | // The anonymous function now uses arrow syntax. 116 | final result = repeatTask(4, 2, (num input) => input * input); 117 | 118 | print(result); 119 | } 120 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/challenge/bin/challenge.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | void main() { 5 | challenge1(); 6 | challenge2(); 7 | challenge3(); 8 | } 9 | 10 | void challenge1() { 11 | /// Challenge 1: Heavy monotremes 12 | /// 13 | /// Dart has a class named `Comparable` which is used by the the `sort` method 14 | /// of `List` to sort its elements. Add a `weight` field to the `Platypus` 15 | /// class you made in this lesson. Then make `Platypus` implement `Comparable` 16 | /// so that when you have a list of `Platypus` objects, calling sort on the 17 | /// list will sort them by weight. 18 | 19 | final willi = Platypus(weight: 1.0); 20 | final billi = Platypus(weight: 2.4); 21 | final nilli = Platypus(weight: 2.1); 22 | final jilli = Platypus(weight: 0.4); 23 | final silli = Platypus(weight: 1.7); 24 | 25 | final platypi = [willi, billi, nilli, jilli, silli]; 26 | 27 | platypi.forEach((platypus) => print(platypus.weight)); 28 | print('---'); 29 | 30 | platypi.sort(); 31 | platypi.forEach((platypus) => print(platypus.weight)); 32 | } 33 | 34 | class Platypus extends Animal with EggLayer implements Comparable { 35 | Platypus({this.weight}); 36 | final weight; 37 | 38 | @override 39 | void eat() { 40 | print('Munch munch'); 41 | } 42 | 43 | @override 44 | void move() { 45 | print('Glide glide'); 46 | } 47 | 48 | @override 49 | int compareTo(other) { 50 | if (weight > other.weight) { 51 | return 1; 52 | } else if (weight < other.weight) { 53 | return -1; 54 | } 55 | return 0; 56 | } 57 | } 58 | 59 | mixin EggLayer { 60 | void layEggs() { 61 | print('Plop plop'); 62 | } 63 | } 64 | 65 | abstract class Animal { 66 | bool isAlive = true; 67 | void eat(); 68 | void move(); 69 | 70 | @override 71 | String toString() { 72 | return "I'm a $runtimeType"; 73 | } 74 | } 75 | 76 | void challenge2() { 77 | /// Challenge 2: Fake notes 78 | /// 79 | /// Design an interface to sit between the business logic of your 80 | /// note-taking app and a SQL database. After that, implement a fake 81 | /// database class that will return mock data. 82 | 83 | final database = DataStorage(); 84 | final note = database.findNote(42); 85 | final allNotes = database.allNotes(); 86 | database.saveNote('Water the flowers.'); 87 | print(note); 88 | print(allNotes); 89 | } 90 | 91 | abstract class DataStorage { 92 | factory DataStorage() => FakeDatabase(); 93 | String findNote(int id); 94 | List allNotes(); 95 | void saveNote(String note); 96 | } 97 | 98 | class FakeDatabase implements DataStorage { 99 | @override 100 | String findNote(int id) { 101 | return 'This is a note.'; 102 | } 103 | 104 | @override 105 | List allNotes() { 106 | return [ 107 | 'This is a note.', 108 | 'This is another note.', 109 | 'Buy milk.', 110 | 'Platypuses are nice.', 111 | ]; 112 | } 113 | 114 | @override 115 | void saveNote(String note) { 116 | // Saving note to cyberspace.... 117 | } 118 | } 119 | 120 | void challenge3() { 121 | /// Challenge 3: Time to code 122 | /// 123 | /// Dart has a `Duration` class for expressing lengths of time. Make an 124 | /// extension on `int` so that you can express a duration like so: 125 | /// 126 | /// ``` 127 | /// final timeRemaining = 3.minutes; 128 | /// ``` 129 | 130 | final timeRemaining = 3.minutes; 131 | print(timeRemaining); 132 | } 133 | 134 | extension on int { 135 | Duration get minutes => Duration(minutes: this); 136 | } -------------------------------------------------------------------------------- /03-types-and-operations/projects/challenge/bin/challenge.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | // If you get the error "Target of URI doesn't exist", make sure you have 5 | // run `dart pub get`. Then restart VS Code. 6 | import 'package:characters/characters.dart'; 7 | 8 | void main() { 9 | /// Challenge 1: Teacher's grading 10 | /// 11 | /// You're a teacher and in your class attendance is worth 20% of the grade, 12 | /// the homework is worth 30% and the exam is worth 50%. Your student got 90 13 | /// points for her attendance, 80 points for her homework and 94 points on 14 | /// her exam. Calculate her grade as an integer percentage rounded down. 15 | 16 | const attendance = 90; 17 | const homework = 80; 18 | const exam = 94; 19 | const rawGrade = (0.2 * attendance) + (0.3 * homework) + (0.5 * exam); 20 | final integerGrade = rawGrade.toInt(); 21 | print(integerGrade); 22 | 23 | /// Challenge 2: Same same, but different 24 | /// 25 | /// This string has two flags that look the same. But they aren't! One of 26 | /// them is the flag of Chad and the other is the flag of Romania. 27 | /// 28 | /// ``` 29 | /// const twoCountries = '🇹🇩🇷🇴'; 30 | /// ``` 31 | /// 32 | /// Which is which? 33 | /// 34 | /// **Hint**: Romania's regional indicator sequence is `RO`, and `R` is 35 | /// `127479` in decimal. Chad, which is _Tishād_ in Arabic and _Tchad_ in 36 | /// French, has a regional indicator sequence of `TD`. Sequence letter `T` 37 | /// is `127481` in decimal. 38 | 39 | const twoCountries = '🇹🇩🇷🇴'; 40 | print(twoCountries.runes); 41 | // (127481, 127465, 127479, 127476) 42 | // 127481 is T (127465 is D) so the first flag is Chad. 43 | // 127479 is R (127476 is O) so the second flag is Romania. 44 | 45 | /// Challenge 3: How many? 46 | /// 47 | /// Given the following string: 48 | /// 49 | /// ``` 50 | /// const vote = 'Thumbs up! 👍🏿'; 51 | /// ``` 52 | /// 53 | /// How many UTF-16 code units are there? 54 | /// How many Unicode code points are there? 55 | /// How many Unicode grapheme clusters are there? 56 | 57 | const vote = 'Thumbs up! 👍🏿'; 58 | print(vote.codeUnits.length); // 15 59 | // There are 15 code units. 60 | print(vote.runes.length); // 13 61 | // There are 13 code points. 62 | print(vote.characters.length); // 12 63 | // There are 12 grapheme clusters. 64 | // See pubspec.yaml for the characters package dependency. 65 | // See the top of this file for the characters package import. 66 | 67 | /// Challenge 4: Find the error 68 | /// 69 | /// What is wrong with the following code? 70 | /// 71 | /// ``` 72 | /// const name = 'Ray'; 73 | /// name += ' Wenderlich'; 74 | /// ``` 75 | 76 | var name = 'Ray'; 77 | name += ' Wenderlich'; 78 | print(name); 79 | // `const` variables can't be changed, so you need to use `var`. 80 | 81 | /// Challenge 5: What type? 82 | /// 83 | /// What is the type of `value`? 84 | /// 85 | /// ``` 86 | /// const value = 10 / 2; 87 | /// ``` 88 | 89 | const value = 10 / 2; 90 | print(value); // 5.0 91 | // `value` is a `double`. 92 | // Division always produces a double in Dart. 93 | // You can see the type by hovering your mouse pointer over `value`. 94 | 95 | /// Challenge 6: In summary 96 | /// 97 | /// What is the value of the constant named `summary`? 98 | /// 99 | /// ``` 100 | /// const number = 10; 101 | /// const multiplier = 5; 102 | /// final summary = '$number \u00D7 $multiplier = ${number * multiplier}'; 103 | /// ``` 104 | 105 | const number = 10; 106 | const multiplier = 5; 107 | final summary = '$number \u00D7 $multiplier = ${number * multiplier}'; 108 | print(summary); 109 | // 10 × 5 = 50 110 | } 111 | -------------------------------------------------------------------------------- /09-advanced-classes/projects/mini_exercise/bin/mini_exercise.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | void main() { 5 | extendingClassesMiniExercise1(); 6 | extendingClassesMiniExercise2(); 7 | extendingClassesMiniExercise3(); 8 | 9 | interfacesMiniExercises(); 10 | 11 | mixinsMiniExercise(); 12 | } 13 | 14 | /// Extending classes 15 | 16 | void extendingClassesMiniExercise1() { 17 | /// Extending classes: Mini-exercise 1 18 | /// 19 | /// Create a class named `Fruit` with a `String` field named `color` and a 20 | /// method named `describeColor` which uses `color` to print a message. 21 | 22 | final fruit = Fruit('yellow'); 23 | fruit.describeColor(); 24 | } 25 | 26 | class Fruit { 27 | Fruit(this.color); 28 | final color; 29 | void describeColor() { 30 | print("This fruit's color is $color."); 31 | } 32 | } 33 | 34 | void extendingClassesMiniExercise2() { 35 | /// Extending classes: Mini-exercise 2 36 | /// 37 | /// Create a subclass of `Fruit` named `Melon` and then create two `Melon` 38 | /// subclasses named `Watermelon` and `Cantaloupe`. 39 | 40 | final melon = Melon('blue'); 41 | final watermelon = Watermelon('red and green'); 42 | final cantaloupe = Cantaloupe('orange'); 43 | melon.describeColor(); 44 | watermelon.describeColor(); 45 | cantaloupe.describeColor(); 46 | } 47 | 48 | class Melon extends Fruit { 49 | Melon(String color) : super(color); 50 | } 51 | 52 | // class Watermelon extends Melon { 53 | // Watermelon(String color) : super(color); 54 | // } 55 | class Cantaloupe extends Melon { 56 | Cantaloupe(String color) : super(color); 57 | } 58 | 59 | void extendingClassesMiniExercise3() { 60 | /// Extending classes: Mini-exercise 3 61 | /// 62 | /// Override `describeColor` in the `Watermelon` class to vary the output. 63 | 64 | final fruit = Fruit('yellow'); 65 | final watermelon = Watermelon('red and green'); 66 | fruit.describeColor(); 67 | watermelon.describeColor(); 68 | } 69 | 70 | class Watermelon extends Melon { 71 | Watermelon(String color) : super(color); 72 | @override 73 | void describeColor() { 74 | print('The color of this watermelon is $color.'); 75 | } 76 | } 77 | 78 | /// Interfaces 79 | 80 | void interfacesMiniExercises() { 81 | /// Interfaces Mini-exercices 82 | /// 83 | /// 1. Create an interface called `Bottle` and add a method to it 84 | /// called `open`. 85 | /// 2. Create a concrete class called `SodaBottle` that implements 86 | /// `Bottle` and prints "Fizz fizz" when `open` is called. 87 | /// 3. Add a factory constructor to `Bottle` that returns a `SodaBottle` 88 | /// instance. 89 | /// 4. Instantiate `SodaBottle` by using the `Bottle` factory constructor 90 | /// and call `open` on the object. 91 | 92 | final bottle = Bottle(); 93 | bottle.open(); 94 | } 95 | 96 | abstract class Bottle { 97 | factory Bottle() => SodaBottle(); 98 | void open(); 99 | } 100 | 101 | class SodaBottle implements Bottle { 102 | @override 103 | void open() { 104 | print('Fizz fizz'); 105 | } 106 | } 107 | 108 | /// Mixins 109 | 110 | void mixinsMiniExercise() { 111 | /// Mixins Mini-exercices 112 | /// 113 | /// 1. Create a class called `Calculator` with a method called `sum` 114 | /// that prints the sum of the two arguments you give it. 115 | /// 2. Extract the logic in `sum` to a mixin called `Adder`. 116 | /// 3. Use the mixin in `Calculator`. 117 | 118 | final calculator = Calculator(); 119 | calculator.sum(4, 6); 120 | } 121 | 122 | // class Calculator { 123 | // void sum(num a, num b) { 124 | // print('The sum is ${a + b}.'); 125 | // } 126 | // } 127 | 128 | class Calculator with Adder {} 129 | 130 | mixin Adder { 131 | void sum(num a, num b) { 132 | print('The sum is ${a + b}.'); 133 | } 134 | } -------------------------------------------------------------------------------- /04-control-flow/projects/challenge/bin/challenge.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | void main() { 5 | /// Challenge 1: Find the error 6 | /// 7 | /// What's wrong with the following code? 8 | /// 9 | /// ``` 10 | /// const firstName = 'Bob'; 11 | /// if (firstName == 'Bob') { 12 | /// const lastName = 'Smith'; 13 | /// } else if (firstName == 'Ray') { 14 | /// const lastName = 'Wenderlich'; 15 | /// } 16 | /// final fullName = firstName + ' ' + lastName; 17 | /// ``` 18 | 19 | // `lastName` was declared in the `if` statement scope but was used 20 | // in the parent scope. You need to declare it at or above the scope 21 | // where it is needed. 22 | const firstName = 'Bob'; 23 | var lastName = ''; 24 | if (firstName == 'Bob') { 25 | lastName = 'Smith'; 26 | } else if (firstName == 'Ray') { 27 | lastName = 'Wenderlich'; 28 | } 29 | final fullName = firstName + ' ' + lastName; 30 | print(fullName); 31 | 32 | /// Challenge 2: Boolean challenge 33 | /// 34 | /// In each of the following statements, what is the value of the 35 | /// Boolean expression? 36 | /// 37 | /// ``` 38 | /// true && true 39 | /// false || false 40 | /// (true && 1 != 2) || (4 > 3 && 100 < 1) 41 | /// ((10 / 2) > 3) && ((10 % 2) == 0) 42 | /// ``` 43 | 44 | print(true && true); // true 45 | print(false || false); // false 46 | print((true && 1 != 2) || (4 > 3 && 100 < 1)); // true 47 | print(((10 / 2) > 3) && ((10 % 2) == 0)); // true 48 | 49 | /// Challenge 3: Next power of two 50 | /// 51 | /// Given a number, determine the next power of two above or equal to 52 | /// that number. 53 | 54 | const number = 946; 55 | var trial = 1; 56 | var times = 0; 57 | while (trial < number) { 58 | trial = trial * 2; 59 | times += 1; 60 | } 61 | print('Next power of 2 >= $number is $trial ' 62 | 'which is 2 to the power of $times.'); 63 | // Next power of 2 >= 946 is 1024 which is 2 to the power of 10. 64 | 65 | /// Challenge 4: Fibonacci 66 | /// 67 | /// Calculate the nth Fibonacci number. Remember that Fibonacci numbers 68 | /// start its sequence with 1 and 1, and then subsequent numbers in the 69 | /// sequence are equal to the previous two values added together. You can 70 | /// get a refresher here: https://en.wikipedia.org/wiki/Fibonacci_number 71 | 72 | const n = 10; 73 | var current = 1; 74 | var previous = 1; 75 | var done = 2; 76 | while (done < n) { 77 | final next = current + previous; 78 | previous = current; 79 | current = next; 80 | done += 1; 81 | } 82 | print('Fibonacci number $n is $current.'); 83 | // Fibonacci number 10 is 55. 84 | 85 | /// Challenge 5: How many times? 86 | /// 87 | /// In the following `for` loop, what will be the value of sum, and how many 88 | /// iterations will happen? 89 | /// 90 | /// ``` 91 | /// var sum = 0; 92 | /// for (var i = 0; i <= 5; i++) { 93 | /// sum += i; 94 | /// } 95 | /// ``` 96 | 97 | var sum = 0; 98 | var count = 0; 99 | for (var i = 0; i <= 5; i++) { 100 | sum += i; 101 | count++; 102 | } 103 | print('The value of the sum is $sum after $count iterations.'); 104 | // The value of the sum is 15 after 6 iterations. 105 | 106 | /// Challenge 6: The final countdown 107 | /// 108 | /// Print a countdown from 10 to 0. 109 | 110 | for (var i = 10; i >= 0; i--) { 111 | print(i); 112 | } 113 | 114 | /// Challenge 7: Print a sequence 115 | /// 116 | /// Print the sequence 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0. 117 | 118 | print('0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0'); 119 | // Just kidding. :] 120 | // Here's one of several other ways to do it: 121 | for (var i = 0; i <= 10; i++) { 122 | print(i / 10); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /03-types-and-operations/projects/final/bin/final.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | // If you get the error "Target of URI doesn't exist", make sure you have 5 | // run `dart pub get`. Then restart VS Code. 6 | import 'package:characters/characters.dart'; 7 | 8 | void main() { 9 | /// Type inference 10 | 11 | // int myInteger = 10; 12 | // double myDouble = 3.14; 13 | // const int myInteger = 10; 14 | // const double myDouble = 3.14; 15 | // final int myInteger = 10; 16 | // final double myDouble = 3.14; 17 | const myInteger = 10; 18 | const myDouble = 3.14; 19 | 20 | num myNumber = 3.14; 21 | print(myNumber is double); 22 | print(myNumber is int); 23 | print(myNumber.runtimeType); 24 | 25 | /// Type conversion 26 | 27 | var integer = 100; 28 | var decimal = 12.5; 29 | // integer = decimal; 30 | integer = decimal.toInt(); 31 | print(integer); 32 | 33 | const hourlyRate = 19.5; 34 | const hoursWorked = 10; 35 | // const totalCost = hourlyRate * hoursWorked; 36 | // const totalCost = (hourlyRate * hoursWorked).toInt(); 37 | final totalCost = (hourlyRate * hoursWorked).toInt(); 38 | print(totalCost); 39 | 40 | // const wantADouble = 3; 41 | // final actuallyDouble = 3.toDouble(); 42 | const double actuallyDouble = 3; 43 | const wantADouble = 3.0; 44 | 45 | num someNumber = 3; 46 | // print(someNumber.isEven); 47 | final someInt = someNumber as int; 48 | print(someInt.isEven); 49 | // final someDouble = someNumber as double; 50 | final someDouble = someNumber.toDouble(); 51 | 52 | /// Strings and characters 53 | 54 | print('Hello, Dart!'); 55 | var greeting = 'Hello, Dart!'; 56 | greeting = 'Hello, Flutter!'; 57 | print(greeting); 58 | 59 | /// Getting characters 60 | 61 | const letter = 'a'; 62 | 63 | var salutation = 'Hello!'; 64 | print(salutation.codeUnits); 65 | 66 | const dart = '🎯'; 67 | print(dart.codeUnits); 68 | print(dart.runes); 69 | 70 | /// Unicode grapheme clusters 71 | 72 | const flag = '🇲🇳'; 73 | print(flag.runes); 74 | 75 | const family = '👨‍👩‍👧‍👦'; 76 | print(family.runes); 77 | 78 | print(family.length); 79 | print(family.codeUnits.length); 80 | print(family.runes.length); 81 | print(family.characters.length); 82 | 83 | /// Single-quotes vs double-quotes 84 | 85 | print('I like cats'); 86 | print("I like cats"); 87 | print("my cat's food"); 88 | print('my cat\'s food'); 89 | 90 | /// Concatenation 91 | 92 | // var message = 'Hello' + ' my name is '; 93 | // const name = 'Ray'; 94 | // message += name; 95 | // print(message); 96 | 97 | final message = StringBuffer(); 98 | message.write('Hello'); 99 | message.write(' my name is '); 100 | message.write('Ray'); 101 | message.toString(); 102 | print(message); 103 | 104 | /// Interpolation 105 | 106 | const name = 'Ray'; 107 | const introduction = 'Hello my name is $name'; 108 | print(introduction); 109 | 110 | const oneThird = 1 / 3; 111 | // const sentence = 'One third is $oneThird.'; 112 | final sentence = 'One third is ${oneThird.toStringAsFixed(3)}.'; 113 | print(sentence); 114 | 115 | /// Multi-line strings 116 | 117 | const bigString = ''' 118 | You can have a string 119 | that contains multiple 120 | lines 121 | by 122 | doing this.'''; 123 | print(bigString); 124 | 125 | // const oneLine = 'This is only ' 126 | // 'a single ' 127 | // 'line ' 128 | // 'at runtime.'; 129 | const oneLine = 'This is only ' + 'a single ' + 'line ' + 'at runtime.'; 130 | print(oneLine); 131 | 132 | const twoLines = 'This is\ntwo lines.'; 133 | print(twoLines); 134 | 135 | const rawString = r'My name \n is $name.'; 136 | print(rawString); 137 | 138 | /// Inserting characters from their codes 139 | 140 | print('I \u2764 Dart\u0021'); 141 | print('I love \u{1F3AF}'); 142 | 143 | /// Object and dynamic types 144 | 145 | // var myVariable = 42; 146 | // myVariable = 'hello'; // compile-time error 147 | 148 | // dynamic myVariable = 42; 149 | // myVariable = 'hello'; // OK 150 | 151 | // var myVariable; // defaults to dynamic 152 | // myVariable = 42; // OK 153 | // myVariable = 'hello'; // OK 154 | 155 | Object? myVariable = 42; 156 | myVariable = 'hello'; // OK 157 | } 158 | -------------------------------------------------------------------------------- /08-collections/projects/mini_exercise/bin/mini_exercise.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | void main() { 5 | listsMiniExercise1(); 6 | listsMiniExercise2(); 7 | listsMiniExercise3(); 8 | 9 | mapsMiniExercise1(); 10 | mapsMiniExercise2(); 11 | mapsMiniExercise3(); 12 | 13 | higherOrderMethodsMiniExercise1(); 14 | higherOrderMethodsMiniExercise2(); 15 | } 16 | 17 | void listsMiniExercise1() { 18 | /// Lists: Mini-exercise 1 19 | /// 20 | /// Create an empty list of type `String`. Call it `months`. Use 21 | /// the `add` method to add the names of the twelve months. 22 | 23 | final months = []; 24 | months.add('January'); 25 | months.add('February'); 26 | months.add('March'); 27 | months.add('April'); 28 | months.add('May'); 29 | months.add('June'); 30 | months.add('July'); 31 | months.add('August'); 32 | months.add('September'); 33 | months.add('October'); 34 | months.add('November'); 35 | months.add('December'); 36 | print(months); 37 | } 38 | 39 | void listsMiniExercise2() { 40 | /// Lists: Mini-exercise 2 41 | /// 42 | /// Make an immutable list with the same elements as in Mini-exercise 1. 43 | 44 | const months = [ 45 | 'January', 46 | 'February', 47 | 'March', 48 | 'April', 49 | 'May', 50 | 'June', 51 | 'July', 52 | 'August', 53 | 'September', 54 | 'October', 55 | 'November', 56 | 'December', 57 | ]; 58 | print(months); 59 | } 60 | 61 | void listsMiniExercise3() { 62 | /// Lists: Mini-exercise 3 63 | /// 64 | /// Use collection `for` to create a new list with the month names in 65 | /// all uppercase. 66 | 67 | const months = [ 68 | 'January', 69 | 'February', 70 | 'March', 71 | 'April', 72 | 'May', 73 | 'June', 74 | 'July', 75 | 'August', 76 | 'September', 77 | 'October', 78 | 'November', 79 | 'December', 80 | ]; 81 | final bigMonths = [for (var month in months) month.toUpperCase()]; 82 | print(bigMonths); 83 | } 84 | 85 | void mapsMiniExercise1() { 86 | /// Maps: Mini-exercise 1 87 | /// 88 | /// Create a map with the following keys: `name`, `profession`, `country` 89 | /// and `city`. For the values, add your own information. 90 | 91 | final myMap = { 92 | 'name': 'Li Ming', 93 | 'profession': 'software engineer', 94 | 'country': 'China', 95 | 'city': 'Beijing', 96 | }; 97 | print(myMap); 98 | } 99 | 100 | void mapsMiniExercise2() { 101 | /// Maps: Mini-exercise 2 102 | /// 103 | /// You suddenly decide to move to Toronto, Canada. Programmatically update 104 | /// the values for `country` and `city`. 105 | 106 | final myMap = { 107 | 'name': 'Li Ming', 108 | 'profession': 'software engineer', 109 | 'country': 'China', 110 | 'city': 'Beijing', 111 | }; 112 | myMap['country'] = 'Canada'; 113 | myMap['city'] = 'Toronto'; 114 | print(myMap); 115 | } 116 | 117 | void mapsMiniExercise3() { 118 | /// Maps: Mini-exercise 3 119 | /// 120 | /// Iterate over the map and print all the values. 121 | 122 | final myMap = { 123 | 'name': 'Li Ming', 124 | 'profession': 'software engineer', 125 | 'country': 'Canada', 126 | 'city': 'Toronto', 127 | }; 128 | 129 | for (var value in myMap.values) { 130 | print(value); 131 | } 132 | 133 | // Or: 134 | myMap.forEach((key, value) => print(value)); 135 | } 136 | 137 | void higherOrderMethodsMiniExercise1() { 138 | /// Higher order methods: Mini-exercise 1 139 | /// 140 | /// Given the following exam scores: 141 | /// 142 | /// ``` 143 | /// final scores = [89, 77, 46, 93, 82, 67, 32, 88]; 144 | /// ``` 145 | /// 146 | /// Use `sort` to find the highest and lowest grades. 147 | 148 | final scores = [89, 77, 46, 93, 82, 67, 32, 88]; 149 | scores.sort(); 150 | final lowest = scores.first; 151 | final highest = scores.last; 152 | print(lowest); 153 | print(highest); 154 | } 155 | 156 | void higherOrderMethodsMiniExercise2() { 157 | /// Higher order methods: Mini-exercise 2 158 | /// 159 | /// Given the following exam scores: 160 | /// 161 | /// ``` 162 | /// final scores = [89, 77, 46, 93, 82, 67, 32, 88]; 163 | /// ``` 164 | /// 165 | /// Use `where` to find all the B grades, that is, all the scores 166 | /// between 80 and 90. 167 | 168 | final scores = [89, 77, 46, 93, 82, 67, 32, 88]; 169 | final bGrades = scores.where((score) => score >= 80 && score < 90); 170 | print(bGrades); 171 | } 172 | -------------------------------------------------------------------------------- /04-control-flow/projects/mini_exercise/bin/mini_exercise.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | import 'dart:math'; 5 | 6 | void main() { 7 | /// Comparison operators: Mini-exercise 1 8 | /// 9 | /// Create a constant called `myAge` and set it to your age. Then, create a 10 | /// constant named `isTeenager` that uses Boolean logic to determine if the 11 | /// age denotes someone in the age range of 13 to 19. 12 | 13 | const myAge = 42; 14 | const isTeenager = myAge >= 13 && myAge <= 19; 15 | print('isTeenager: $isTeenager'); 16 | 17 | /// Comparison operators: Mini-exercise 2 18 | /// 19 | /// Create another constant named `maryAge` and set it to `30`. Then, create 20 | /// a constant named `bothTeenagers` that uses Boolean logic to determine if 21 | /// both you and Mary are teenagers. 22 | 23 | const maryAge = 30; 24 | const bothTeenagers = (maryAge >= 13 && maryAge <= 19) && isTeenager; 25 | print('bothTeenagers: $bothTeenagers'); 26 | 27 | /// Comparison operators: Mini-exercise 3 28 | /// 29 | /// Create a `String` constant named `reader` and set it to your name. Create 30 | /// another `String` constant named `ray` and set it to `'Ray Wenderlich'`. 31 | /// Create a Boolean constant named `rayIsReader` that uses string equality 32 | /// to determine if `reader` and `ray` are equal. 33 | 34 | const reader = 'Bob Smith'; 35 | const ray = 'Ray Wenderlich'; 36 | const rayIsReader = reader == ray; 37 | print('rayIsReader: $rayIsReader'); 38 | 39 | /// The if statement: Mini-exercise 1 40 | /// 41 | /// Create a constant named `myAge` and initialize it with your age. Write 42 | /// an `if` statement to print out "Teenager" if your age is between `13` 43 | /// and `19`, and "Not a teenager" if your age is not between `13` and `19`. 44 | 45 | // const myAge = 42; // same as above 46 | // const isTeenager = myAge >= 13 && myAge <= 19; // same as above 47 | if (isTeenager) { 48 | print('Teenager'); 49 | } else { 50 | print('Not a teenager'); 51 | } 52 | 53 | /// The if statement: Mini-exercise 2 54 | /// 55 | /// Use a ternary conditional operator to replace the `else-if` statement 56 | /// that you used above. Set the result to a variable named `answer`. 57 | const answer = (isTeenager) ? 'Teenager' : 'Not a teenager'; 58 | print(answer); 59 | 60 | /// Loops: Mini-exercise 1 61 | /// 62 | /// Create a variable named `counter` and set it equal to `0`. Create a 63 | /// `while` loop with the condition `counter < 10`. The loop body should 64 | /// print out "counter is X" (where X is replaced with the value of 65 | /// `counter`) and then increment `counter` by 1. 66 | 67 | var counter = 0; 68 | while (counter < 10) { 69 | print('counter is $counter'); 70 | counter++; 71 | } 72 | 73 | /// Loops: Mini-exercise 2 74 | /// 75 | /// Write a `for` loop starting at `1` and ending with `10` inclusive. Print 76 | /// the square of each number. 77 | 78 | for (var i = 1; i <= 10; i++) { 79 | print(i * i); 80 | } 81 | 82 | /// Loops: Mini-exercise 3 83 | /// 84 | /// Write a `for-in` loop to iterate over the following collection of numbers. 85 | /// Print the square root of each number. 86 | /// 87 | /// ``` 88 | /// const numbers = [1, 2, 4, 7]; 89 | /// ``` 90 | 91 | // Remember to import 'dart:math'; 92 | const numbers = [1, 2, 4, 7]; 93 | for (var number in numbers) { 94 | print(sqrt(number)); 95 | } 96 | 97 | /// Loops: Mini-exercise 4 98 | /// 99 | /// Repeat Mini-exercise 3 using a `for-each` loop. 100 | 101 | numbers.forEach((number) => print(sqrt(number))); 102 | 103 | /// Switch statements: Mini-exercise 1 104 | /// 105 | /// Make an `enum` called `AudioState` and give it values to represent 106 | /// `playing`, `paused` and `stopped` states. 107 | 108 | // Find the AudioState enum below, outside of the main() function. 109 | 110 | /// Switch statements: Mini-exercise 2 111 | /// 112 | /// Create a constant called `audioState` and give it an `AudioState` value. 113 | /// Write a `switch` statement that prints a message based on the value. 114 | const audioState = AudioState.stopped; 115 | switch (audioState) { 116 | case AudioState.playing: 117 | print('Audio playing'); 118 | break; 119 | case AudioState.paused: 120 | print('Audio paused'); 121 | break; 122 | case AudioState.stopped: 123 | print('Audio stopped'); 124 | break; 125 | } 126 | } 127 | 128 | /// Switch statements: Mini-exercise 1 129 | /// 130 | /// Make an `enum` called `AudioState` and give it values to represent 131 | /// `playing`, `paused` and `stopped` states. 132 | enum AudioState { 133 | playing, 134 | paused, 135 | stopped, 136 | } -------------------------------------------------------------------------------- /07-nullability/projects/final/bin/final.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | void main() { 5 | // Null overview 6 | whatNullMeans(); 7 | problemWithNull(); 8 | nullableVsNonNullable(); 9 | 10 | // Handling nullable types 11 | handlingNullableTypes(); 12 | typePromotion(); 13 | ifNullOperator(); 14 | nullAwareAssignmentOperator(); 15 | nullAwareAccess(); 16 | nullAssertionOperator(); 17 | nullAwareCascadeOperator(); 18 | nullAwareIndexOperator(); 19 | nullableInstanceVariables(); 20 | lateKeyword(); 21 | } 22 | 23 | void whatNullMeans() { 24 | int postalCode = 12345; 25 | // int postalCode = -1; 26 | // int postalCode = null; 27 | } 28 | 29 | void problemWithNull() { 30 | bool isPositive(int anInteger) { 31 | return !anInteger.isNegative; 32 | } 33 | 34 | print(isPositive(3)); 35 | print(isPositive(-1)); 36 | // print(isPositive(null)); 37 | } 38 | 39 | void nullableVsNonNullable() { 40 | int myInt = 1; 41 | double myDouble = 3.14159265; 42 | bool myBool = true; 43 | String myString = 'Hello, Dart!'; 44 | // User myUser = User(id: 42, name: 'Ray'); 45 | 46 | // int postalCode = null; 47 | 48 | int? age; 49 | double? height; 50 | String? message; 51 | print(age); 52 | print(height); 53 | print(message); 54 | } 55 | 56 | void handlingNullableTypes() { 57 | String? name; 58 | // print(name.length); 59 | } 60 | 61 | void typePromotion() { 62 | String? name; 63 | name = 'Ray'; 64 | print(name.length); 65 | 66 | bool isPositive(int? anInteger) { 67 | if (anInteger == null) { 68 | return false; 69 | } 70 | return !anInteger.isNegative; 71 | } 72 | } 73 | 74 | void ifNullOperator() { 75 | String? message; 76 | final text = message ?? 'Error'; 77 | print(text); 78 | 79 | // String text; 80 | // if (message == null) { 81 | // text = 'Error'; 82 | // } else { 83 | // text = message; 84 | // } 85 | // print(text); 86 | } 87 | 88 | void nullAwareAssignmentOperator() { 89 | double? fontSize; 90 | fontSize = fontSize ?? 20.0; 91 | } 92 | 93 | void nullAwareAccess() { 94 | int? age; 95 | print(age?.isNegative); 96 | print(age?.toDouble()); 97 | } 98 | 99 | void nullAssertionOperator() { 100 | //String nonNullableString = nullableString!; 101 | 102 | bool? isBeautiful(String? item) { 103 | if (item == 'flower') { 104 | return true; 105 | } else if (item == 'garbage') { 106 | return false; 107 | } 108 | return null; 109 | } 110 | 111 | //bool flowerIsBeautiful = isBeautiful('flower'); 112 | //bool flowerIsBeautiful = isBeautiful('flower')!; 113 | //bool flowerIsBeautiful = isBeautiful('flower') as bool; 114 | bool flowerIsBeautiful = isBeautiful('flower') ?? true; 115 | } 116 | 117 | void nullAwareCascadeOperator() { 118 | // User user = User() 119 | // ..name = 'Ray' 120 | // ..id = 42; 121 | 122 | // User? user; 123 | // user 124 | // ?..name = 'Ray' 125 | // ..id = 42; 126 | // String? lengthString = user?.name?.length.toString(); 127 | } 128 | 129 | // class User { 130 | // String? name; 131 | // int? id; 132 | // } 133 | 134 | void nullAwareIndexOperator() { 135 | List? myList = [1, 2, 3]; 136 | myList = null; 137 | int? myItem = myList?[2]; 138 | print(myItem); 139 | } 140 | 141 | void initializingNonNullableClassFields() { 142 | // final user = User(name: null); 143 | } 144 | // class User { 145 | // String name; 146 | // } 147 | // class User { 148 | // String name = 'anonymous'; 149 | // } 150 | // class User { 151 | // User(this.name); 152 | // String name; 153 | // } 154 | // class User { 155 | // User(String name) 156 | // : _name = name; 157 | // String _name; 158 | // } 159 | // class User { 160 | // User([this.name = 'anonymous']); 161 | // String name; 162 | // } 163 | // class User { 164 | // User({this.name = 'anonymous'}); 165 | // String name; 166 | // } 167 | // class User { 168 | // User({required this.name}); 169 | // String name; 170 | // } 171 | 172 | void nullableInstanceVariables() { 173 | //final user = User(name: null); 174 | 175 | bool isLong(String? text) { 176 | if (text == null) { 177 | return false; 178 | } 179 | return text.length > 100; 180 | } 181 | } 182 | 183 | // class User { 184 | // User({this.name}); 185 | // String? name; 186 | // } 187 | 188 | // class TextWidget { 189 | // String? text; 190 | // bool isLong() { 191 | // if (text == null) { 192 | // return false; 193 | // } 194 | // //return text.length > 100; // error 195 | // return text!.length > 100; 196 | // } 197 | // } 198 | class TextWidget { 199 | String? text; 200 | bool isLong() { 201 | final text = this.text; // shadowing 202 | if (text == null) { 203 | return false; 204 | } 205 | return text.length > 100; 206 | } 207 | } 208 | 209 | void lateKeyword() { 210 | // final user = User(); 211 | // print(user.name); 212 | } 213 | 214 | // class User { 215 | // User(this.name); 216 | 217 | // final String name; 218 | // late final int _secretNumber = _calculateSecret(); 219 | 220 | // int _calculateSecret() { 221 | // return name.length + 42; 222 | // } 223 | // } 224 | 225 | // class User { 226 | // User(this.name) { 227 | // _secretNumber = _calculateSecret(); 228 | // } 229 | // late final int _secretNumber; 230 | // final String name; 231 | 232 | // int _calculateSecret() { 233 | // return name.length + 42; 234 | // } 235 | // } 236 | 237 | // class User { 238 | // late String name; 239 | // } 240 | class SomeClass { 241 | late String? value = doHeavyCalculation(); 242 | String? doHeavyCalculation() { 243 | // do heavy calculation 244 | } 245 | } -------------------------------------------------------------------------------- /09-advanced-classes/projects/final/bin/final.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | void main() { 5 | extendingClasses(); 6 | abstractClasses(); 7 | interfaces(); 8 | mixins(); 9 | extensions(); 10 | } 11 | 12 | /// Extending classes 13 | 14 | void extendingClasses() { 15 | final john = Person('John', 'Snow'); 16 | final jane = Student('Jane', 'Snow'); 17 | print(john.fullName); 18 | print(jane.fullName); 19 | 20 | final historyGrade = Grade.B; 21 | jane.grades.add(historyGrade); 22 | 23 | final jessie = SchoolBandMember('Jessie', 'Jones'); 24 | final marty = StudentAthlete('Marty', 'McFly'); 25 | 26 | final students = [jane, jessie, marty]; 27 | 28 | print(jessie is Object); 29 | print(jessie is Person); 30 | print(jessie is Student); 31 | print(jessie is SchoolBandMember); 32 | print(jessie is! StudentAthlete); 33 | } 34 | 35 | enum Grade { A, B, C, D, F } 36 | 37 | class Person { 38 | Person(this.givenName, this.surname); 39 | String givenName; 40 | String surname; 41 | String get fullName => '$givenName $surname'; 42 | @override 43 | String toString() => fullName; 44 | } 45 | 46 | class Student extends Person { 47 | Student(String givenName, String surname) : super(givenName, surname); 48 | var grades = []; 49 | @override 50 | String get fullName => '$surname, $givenName'; 51 | } 52 | 53 | class SchoolBandMember extends Student { 54 | SchoolBandMember(String givenName, String surname) 55 | : super(givenName, surname); 56 | static const minimumPracticeTime = 2; 57 | } 58 | 59 | class StudentAthlete extends Student { 60 | StudentAthlete(String givenName, String surname) : super(givenName, surname); 61 | bool get isEligible => grades.every((grade) => grade != Grade.F); 62 | } 63 | 64 | /// Abstract classes 65 | 66 | void abstractClasses() { 67 | // final animal = Animal(); 68 | final platypus = Platypus(); 69 | print(platypus.isAlive); 70 | platypus.eat(); 71 | platypus.move(); 72 | platypus.layEggs(); 73 | print(platypus); 74 | } 75 | 76 | abstract class Animal { 77 | bool isAlive = true; 78 | void eat(); 79 | void move(); 80 | 81 | @override 82 | String toString() { 83 | return "I'm a $runtimeType"; 84 | } 85 | } 86 | 87 | // class Platypus extends Animal { 88 | // @override 89 | // void eat() { 90 | // print('Munch munch'); 91 | // } 92 | 93 | // @override 94 | // void move() { 95 | // print('Glide glide'); 96 | // } 97 | 98 | // void layEggs() { 99 | // print('Plop plop'); 100 | // } 101 | // } 102 | 103 | /// Interfaces 104 | 105 | void interfaces() { 106 | // final repository = DataRepository(); 107 | // final DataRepository repository = FakeWebServer(); 108 | // final temperature = repository.fetchTemperature('Berlin'); 109 | 110 | final repository = DataRepository(); 111 | final temperature = repository.fetchTemperature('Manila'); 112 | print(temperature); 113 | 114 | final someClass = SomeClass(); 115 | print(someClass.myField); 116 | someClass.myMethod(); 117 | } 118 | 119 | abstract class DataRepository { 120 | factory DataRepository() => FakeWebServer(); 121 | double? fetchTemperature(String city); 122 | } 123 | 124 | class FakeWebServer implements DataRepository { 125 | @override 126 | double? fetchTemperature(String city) { 127 | return 42.0; 128 | } 129 | } 130 | 131 | class AnotherClass { 132 | int myField = 42; 133 | void myMethod() => print(myField); 134 | } 135 | 136 | // class SomeClass extends AnotherClass {} 137 | class SomeClass implements AnotherClass { 138 | @override 139 | int myField = 0; 140 | 141 | @override 142 | void myMethod() => print('Hello'); 143 | } 144 | 145 | /// Mixins 146 | 147 | void mixins() { 148 | final platypus = Platypus(); 149 | final robin = Robin(); 150 | platypus.layEggs(); 151 | robin.layEggs(); 152 | } 153 | 154 | abstract class Bird { 155 | void fly(); 156 | void layEggs(); 157 | } 158 | 159 | class Robin extends Bird with EggLayer, Flyer {} 160 | 161 | class Platypus extends Animal with EggLayer { 162 | @override 163 | void eat() { 164 | print('Munch munch'); 165 | } 166 | 167 | @override 168 | void move() { 169 | print('Glide glide'); 170 | } 171 | } 172 | 173 | mixin EggLayer { 174 | void layEggs() { 175 | print('Plop plop'); 176 | } 177 | } 178 | 179 | mixin Flyer { 180 | void fly() { 181 | print('Swoosh swoosh'); 182 | } 183 | } 184 | 185 | /// Extensions 186 | 187 | void extensions() { 188 | // final original = 'abc'; 189 | // final secret = encode(original); 190 | // print(secret); 191 | 192 | // final secret = 'abc'.encoded; 193 | // print(secret); 194 | 195 | final original = 'I like extensions!'; 196 | final secret = original.encoded; 197 | final revealed = secret.decoded; 198 | print(secret); 199 | print(revealed); 200 | 201 | print(5.cubed); 202 | 203 | final language = ProgrammingLanguage.dart; 204 | print(language.isStronglyTyped); 205 | } 206 | 207 | String encode(String input) { 208 | final output = StringBuffer(); 209 | for (final codePoint in input.runes) { 210 | output.writeCharCode(codePoint + 1); 211 | } 212 | return output.toString(); 213 | } 214 | 215 | extension on String { 216 | String get encoded { 217 | return _code(1); 218 | } 219 | 220 | String get decoded { 221 | return _code(-1); 222 | } 223 | 224 | String _code(int step) { 225 | final output = StringBuffer(); 226 | for (final codePoint in runes) { 227 | output.writeCharCode(codePoint + step); 228 | } 229 | return output.toString(); 230 | } 231 | } 232 | 233 | extension on int { 234 | int get cubed { 235 | return this * this * this; 236 | } 237 | } 238 | 239 | enum ProgrammingLanguage { dart, swift, javaScript } 240 | 241 | extension on ProgrammingLanguage { 242 | bool get isStronglyTyped { 243 | switch (this) { 244 | case ProgrammingLanguage.dart: 245 | case ProgrammingLanguage.swift: 246 | return true; 247 | case ProgrammingLanguage.javaScript: 248 | return false; 249 | default: 250 | throw Exception('Unknown Programming Language $this'); 251 | } 252 | } 253 | } -------------------------------------------------------------------------------- /05-functions/projects/final/bin/final.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | /// Since this lesson is about functions, the source code also 5 | /// uses nested functions to divide the sections out. This 6 | /// prevents the main function from getting too long. Notice that 7 | /// the function names also act as their own documentation, 8 | /// removing the need for so many comments. 9 | /// 10 | /// If you only want to run one section at a time, you can 11 | /// comment out all of the functions in main() except for the 12 | /// one you're testing. 13 | /// 14 | /// Remember that you can Command+click (or Control+click) a 15 | /// function name to go to its source. 16 | void main() { 17 | anatomyOfDartFunction(); 18 | usingMultipleParameters(); 19 | makingParametersOptional(); 20 | providingDefaultValues(); 21 | namingParameters(); 22 | makingNamedParametersRequired(); 23 | avoidingSideEffects(); 24 | optionalTypes(); 25 | 26 | assigningFunctionsToVariables(); 27 | usingAnonymousFunctions(); 28 | returningAFunction(); 29 | anonymousFunctionsInForEachLoops(); 30 | closuresAndScope(); 31 | 32 | arrowFunctionRefactoringExample1(); 33 | arrowFunctionRefactoringExample2(); 34 | arrowFunctionRefactoringExample3(); 35 | } 36 | 37 | void anatomyOfDartFunction() { 38 | String compliment(int number) { 39 | return '$number is a very nice number.'; 40 | } 41 | 42 | const input = 12; 43 | final output = compliment(input); 44 | print(output); 45 | } 46 | 47 | void usingMultipleParameters() { 48 | void helloPersonAndPet(String person, String pet) { 49 | print('Hello, $person, and your furry friend, $pet!'); 50 | } 51 | 52 | helloPersonAndPet('Fluffy', 'Chris'); 53 | // helloPersonAndPet(); 54 | } 55 | 56 | void makingParametersOptional() { 57 | String fullName(String first, String last, [String? title]) { 58 | if (title != null) { 59 | return '$title $first $last'; 60 | } else { 61 | return '$first $last'; 62 | } 63 | } 64 | 65 | print(fullName('Ray', 'Wenderlich')); 66 | print(fullName('Albert', 'Einstein', 'Professor')); 67 | } 68 | 69 | void providingDefaultValues() { 70 | bool withinTolerance(int value, [int min = 0, int max = 10]) { 71 | return min <= value && value <= max; 72 | } 73 | 74 | print(withinTolerance(5)); 75 | print(withinTolerance(15)); 76 | print(withinTolerance(9, 7, 11)); 77 | print(withinTolerance(9, 7)); 78 | } 79 | 80 | void namingParameters() { 81 | bool withinTolerance(int value, {int min = 0, int max = 10}) { 82 | return min <= value && value <= max; 83 | } 84 | 85 | print(withinTolerance(9, min: 7, max: 11)); 86 | print(withinTolerance(9, max: 11, min: 7)); 87 | print(withinTolerance(5)); 88 | print(withinTolerance(15)); 89 | print(withinTolerance(5, min: 7)); 90 | print(withinTolerance(15, max: 20)); 91 | } 92 | 93 | void makingNamedParametersRequired() { 94 | bool withinTolerance({ 95 | required int value, 96 | int min = 0, 97 | int max = 10, 98 | }) { 99 | return min <= value && value <= max; 100 | } 101 | 102 | // print(withinTolerance()); 103 | print(withinTolerance(value: 9)); 104 | } 105 | 106 | void avoidingSideEffects() { 107 | // void hello() { 108 | // print('Hello!'); 109 | // } 110 | // hello(); 111 | 112 | String hello() { 113 | return 'Hello!'; 114 | } 115 | 116 | print(hello()); 117 | 118 | var myPreciousData = 5782; 119 | 120 | String anInnocentLookingFunction(String name) { 121 | myPreciousData = -1; 122 | return 'Hello, $name. Heh, heh, heh.'; 123 | } 124 | 125 | print(myPreciousData); 126 | print(anInnocentLookingFunction('Bob')); 127 | print(myPreciousData); 128 | } 129 | 130 | void optionalTypes() { 131 | // String compliment(int number) { 132 | // return '$number is a very nice number.'; 133 | // } 134 | 135 | compliment(number) { 136 | return '$number is a very nice number.'; 137 | } 138 | 139 | // String compliment(dynamic number) { 140 | // return '$number is a very nice number.'; 141 | // } 142 | } 143 | 144 | void assigningFunctionsToVariables() { 145 | int number = 4; 146 | String greeting = 'hello'; 147 | bool isHungry = true; 148 | Function multiply = (int a, int b) { 149 | return a * b; 150 | }; 151 | 152 | // Function myFunction = int multiply(int a, int b) { 153 | // return a * b; 154 | // }; 155 | } 156 | 157 | void usingAnonymousFunctions() { 158 | final multiply = (int a, int b) { 159 | return a * b; 160 | }; 161 | print(multiply(2, 3)); 162 | } 163 | 164 | void returningAFunction() { 165 | Function applyMultiplier(num multiplier) { 166 | return (num value) { 167 | return value * multiplier; 168 | }; 169 | } 170 | 171 | final triple = applyMultiplier(3); 172 | print(triple(6)); 173 | print(triple(14.0)); 174 | } 175 | 176 | void anonymousFunctionsInForEachLoops() { 177 | const numbers = [1, 2, 3]; 178 | numbers.forEach((number) { 179 | final tripled = number * 3; 180 | print(tripled); 181 | }); 182 | 183 | // You can also define the function separately and pass it in 184 | // directly to `forEach()`. 185 | final triple = (int number) { 186 | final tripled = number * 3; 187 | print(tripled); 188 | }; 189 | numbers.forEach(triple); 190 | } 191 | 192 | void closuresAndScope() { 193 | var counter = 0; 194 | final incrementCounter = () { 195 | counter += 1; 196 | }; 197 | 198 | incrementCounter(); 199 | incrementCounter(); 200 | incrementCounter(); 201 | incrementCounter(); 202 | incrementCounter(); 203 | print(counter); 204 | 205 | Function countingFunction() { 206 | var counter = 0; 207 | final incrementCounter = () { 208 | counter += 1; 209 | return counter; 210 | }; 211 | return incrementCounter; 212 | } 213 | 214 | final counter1 = countingFunction(); 215 | final counter2 = countingFunction(); 216 | 217 | print(counter1()); 218 | print(counter2()); 219 | print(counter1()); 220 | print(counter1()); 221 | print(counter2()); 222 | } 223 | 224 | void arrowFunctionRefactoringExample1() { 225 | // final multiply = (int a, int b) { 226 | // return a * b; 227 | // }; 228 | 229 | final multiply = (int a, int b) => a * b; 230 | 231 | print(multiply(2, 3)); 232 | } 233 | 234 | void arrowFunctionRefactoringExample2() { 235 | // Function applyMultiplier(num multiplier) { 236 | // return (num value) { 237 | // return value * multiplier; 238 | // }; 239 | // } 240 | 241 | Function applyMultiplier(num multiplier) { 242 | return (num value) => value * multiplier; 243 | } 244 | 245 | final triple = applyMultiplier(3); 246 | print(triple(6)); 247 | print(triple(14.0)); 248 | } 249 | 250 | void arrowFunctionRefactoringExample3() { 251 | const numbers = [1, 2, 3]; 252 | 253 | numbers.forEach((number) { 254 | final tripled = number * 3; 255 | print(tripled); 256 | }); 257 | 258 | numbers.forEach((number) => print(number * 3)); 259 | } 260 | -------------------------------------------------------------------------------- /10-asynchronous-programming/projects/final/bin/final.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Razeware LLC 2 | // For full license & permission details, see LICENSE. 3 | 4 | import 'dart:async'; 5 | import 'dart:convert'; 6 | import 'dart:io'; 7 | import 'package:http/http.dart' as http; 8 | 9 | Future main() async { 10 | /// The methods below correspond to section headings in the chapter. 11 | /// Because of the asynchronous nature of this chapter. The printed results 12 | /// will be easier to follow if you only uncomment the method you want to 13 | /// examine. 14 | 15 | concurrencyInDart(); 16 | 17 | //futureType(); 18 | //gettingResultWithCallbacks(); 19 | //await gettingResultWithAsyncAwait(); 20 | //await asynchronousNetwordRequest(); 21 | 22 | //await readingAsStringDirectly(); 23 | //await readingFromStream(); 24 | //await usingAsynchronousForLoop(); 25 | //await errorHandlingCallbacks(); 26 | //await errorHandlingTryCatch(); 27 | //await cancellingStream(); 28 | //await transformingStream(); 29 | 30 | //appStoppingSynchronousCode(); 31 | //await appStoppingAsynchronousCode(); 32 | } 33 | 34 | void concurrencyInDart() { 35 | print('first'); 36 | print('second'); 37 | print('third'); 38 | } 39 | 40 | void futureType() { 41 | Future countTheAtoms() { 42 | return Future.delayed(Duration(seconds: 2), () => 9200000000000000000); 43 | } 44 | 45 | countTheAtoms().then((value) => print(value)); 46 | 47 | final myFuture = Future.delayed( 48 | Duration(seconds: 1), 49 | () => 42, 50 | ); 51 | print(myFuture); 52 | } 53 | 54 | void gettingResultWithCallbacks() { 55 | print('Before the future'); 56 | 57 | final myFuture = Future.delayed( 58 | Duration(seconds: 1), 59 | () => 42, 60 | ) 61 | .then( 62 | (value) => print('Value: $value'), 63 | ) 64 | .catchError( 65 | (error) => print(error), 66 | ) 67 | .whenComplete( 68 | () => print('Future is complete'), 69 | ); 70 | 71 | print('After the future'); 72 | } 73 | 74 | Future gettingResultWithAsyncAwait() async { 75 | print('Before the future'); 76 | 77 | try { 78 | final value = await Future.delayed( 79 | Duration(seconds: 1), 80 | () => 42, 81 | ); 82 | //throw Exception('There was an error'); 83 | print('Value: $value'); 84 | } catch (error) { 85 | print(error); 86 | } finally { 87 | print('Future is complete'); 88 | } 89 | 90 | print('After the future'); 91 | } 92 | 93 | Future asynchronousNetwordRequest() async { 94 | try { 95 | final url = 'https://jsonplaceholder.typicode.com/todos/1'; 96 | //final url = 'https://jsonplaceholder.typicode.com/todos/pink-elephants'; 97 | final parsedUrl = Uri.parse(url); 98 | final response = await http.get(parsedUrl); 99 | final statusCode = response.statusCode; 100 | if (statusCode == 200) { 101 | final rawJsonString = response.body; 102 | //final rawJsonString = 'abc'; 103 | final jsonMap = jsonDecode(rawJsonString); 104 | final todo = Todo.fromJson(jsonMap); 105 | print(todo); 106 | } else { 107 | throw HttpException('$statusCode'); 108 | } 109 | } on SocketException catch (error) { 110 | print(error); 111 | } on HttpException catch (error) { 112 | print(error); 113 | } on FormatException catch (error) { 114 | print(error); 115 | } 116 | } 117 | 118 | class Todo { 119 | Todo({ 120 | required this.userId, 121 | required this.id, 122 | required this.title, 123 | required this.completed, 124 | }); 125 | 126 | factory Todo.fromJson(Map jsonMap) { 127 | return Todo( 128 | userId: jsonMap['userId'] as int, 129 | id: jsonMap['id'] as int, 130 | title: jsonMap['title'] as String, 131 | completed: jsonMap['completed'] as bool, 132 | ); 133 | } 134 | 135 | final int userId; 136 | final int id; 137 | final String title; 138 | final bool completed; 139 | 140 | @override 141 | String toString() { 142 | return 'userId: $userId\n' 143 | 'id: $id\n' 144 | 'title: $title\n' 145 | 'completed: $completed'; 146 | } 147 | } 148 | 149 | Future readingAsStringDirectly() async { 150 | final file = File('assets/text.txt'); 151 | final contents = await file.readAsString(); 152 | print(contents); 153 | } 154 | 155 | Future readingFromStream() async { 156 | final file = File('assets/text_long.txt'); 157 | final stream = file.openRead(); 158 | stream.listen( 159 | (data) { 160 | print(data.length); 161 | }, 162 | ); 163 | } 164 | 165 | Future usingAsynchronousForLoop() async { 166 | final file = File('assets/text_long.txt'); 167 | final stream = file.openRead(); 168 | await for (var data in stream) { 169 | print(data.length); 170 | } 171 | } 172 | 173 | Future errorHandlingCallbacks() async { 174 | final file = File('assets/text_long.txt'); 175 | final stream = file.openRead(); 176 | stream.listen( 177 | (data) { 178 | print(data.length); 179 | }, 180 | onError: (error) { 181 | print(error); 182 | }, 183 | onDone: () { 184 | print('All finished'); 185 | }, 186 | ); 187 | } 188 | 189 | Future errorHandlingTryCatch() async { 190 | try { 191 | final file = File('assets/text_long.txt'); 192 | //final file = File('assets/pink_elephants.txt'); 193 | final stream = file.openRead(); 194 | await for (var data in stream) { 195 | print(data.length); 196 | } 197 | } on Exception catch (error) { 198 | print(error); 199 | } finally { 200 | print('All finished'); 201 | } 202 | } 203 | 204 | Future cancellingStream() async { 205 | final file = File('assets/text_long.txt'); 206 | final stream = file.openRead(); 207 | StreamSubscription>? subscription; 208 | subscription = stream.listen( 209 | (data) { 210 | print(data.length); 211 | subscription?.cancel(); 212 | }, 213 | cancelOnError: true, 214 | onDone: () { 215 | print('All finished'); 216 | }, 217 | ); 218 | } 219 | 220 | Future transformingStream() async { 221 | final file = File('assets/text.txt'); 222 | final stream = file.openRead(); 223 | await for (var data in stream.transform(utf8.decoder)) { 224 | print(data); 225 | } 226 | } 227 | 228 | void appStoppingSynchronousCode() { 229 | String playHideAndSeekTheLongVersion() { 230 | var counting = 0; 231 | for (var i = 1; i <= 10000000000; i++) { 232 | counting = i; 233 | } 234 | return '$counting! Ready or not, here I come!'; 235 | } 236 | 237 | print("OK, I'm counting..."); 238 | print(playHideAndSeekTheLongVersion()); 239 | } 240 | 241 | Future appStoppingAsynchronousCode() async { 242 | Future playHideAndSeekTheLongVersion() async { 243 | var counting = 0; 244 | await Future(() { 245 | for (var i = 1; i <= 10000000000; i++) { 246 | counting = i; 247 | } 248 | }); 249 | return '$counting! Ready or not, here I come!'; 250 | } 251 | 252 | print("OK, I'm counting..."); 253 | print(await playHideAndSeekTheLongVersion()); 254 | } 255 | --------------------------------------------------------------------------------