Skip to content

Commit

Permalink
Merge branch 'main' into clarify-mixins
Browse files Browse the repository at this point in the history
  • Loading branch information
MaryaBelanger committed May 14, 2024
2 parents d242d7e + f836c8b commit 83a6a97
Show file tree
Hide file tree
Showing 112 changed files with 1,701 additions and 1,352 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@8f596b4ae3cb3c588a5c46780b86dd53fef16c52
uses: github/codeql-action/init@b7cec7526559c32f1616476ff32d17ba4c59b2d6
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -44,7 +44,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@8f596b4ae3cb3c588a5c46780b86dd53fef16c52
uses: github/codeql-action/autobuild@b7cec7526559c32f1616476ff32d17ba4c59b2d6

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -58,4 +58,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@8f596b4ae3cb3c588a5c46780b86dd53fef16c52
uses: github/codeql-action/analyze@b7cec7526559c32f1616476ff32d17ba4c59b2d6
6 changes: 3 additions & 3 deletions .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534
with:
results_file: results.sarif
results_format: sarif
Expand All @@ -49,6 +49,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@8f596b4ae3cb3c588a5c46780b86dd53fef16c52
uses: github/codeql-action/upload-sarif@b7cec7526559c32f1616476ff32d17ba4c59b2d6
with:
sarif_file: results.sarif
14 changes: 6 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
experimental: false
continue-on-error: ${{ matrix.experimental }}
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
submodules: recursive
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30
Expand All @@ -56,7 +56,7 @@ jobs:
name: Check if code excerpts are up to date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
submodules: recursive
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30
Expand All @@ -71,17 +71,15 @@ jobs:
name: Build site and check links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
submodules: recursive
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30
with:
sdk: stable
- name: Fetch Dart packages
run: dart pub get
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d
with:
version: 8
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: ${{ env.NODE_VERSION }}
Expand All @@ -99,7 +97,7 @@ jobs:
name: Check if text can be replaced with site variables
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
submodules: recursive
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30
Expand All @@ -114,7 +112,7 @@ jobs:
name: Validate Firebase configuration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
submodules: recursive
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30
Expand Down
4 changes: 2 additions & 2 deletions examples/analysis/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: examples
description: dart.dev example code.

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
examples_util: {path: ../util}

dev_dependencies:
lints: ^3.0.0
lints: ^4.0.0
4 changes: 2 additions & 2 deletions examples/analysis_alt/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: examples
description: dart.dev example code.

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dev_dependencies:
lints: ^3.0.0
lints: ^4.0.0
4 changes: 2 additions & 2 deletions examples/async_await/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: async_await
description: dart.dev example code.

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
examples_util: {path: ../util}

dev_dependencies:
lints: ^3.0.0
lints: ^4.0.0
test: ^1.25.2
4 changes: 2 additions & 2 deletions examples/build_runner_usage/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: build_runner_usage
description: dart.dev build_runner example code.

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dev_dependencies:
args: ^2.4.0
build_runner: ^2.4.8
build_test: ^2.2.2
lints: ^3.0.0
lints: ^4.0.0
4 changes: 2 additions & 2 deletions examples/cli/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: cli_examples
description: Examples for CLI tutorials on dart.dev

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
args: ^2.4.2

dev_dependencies:
lints: ^3.0.0
lints: ^4.0.0
test: ^1.25.2
4 changes: 2 additions & 2 deletions examples/concurrency/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ version: 0.0.1
publish_to: none

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
http: any

dev_dependencies:
lints: ^3.0.0
lints: ^4.0.0
test: ^1.25.2
4 changes: 2 additions & 2 deletions examples/create_libraries/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: dart.dev example code.
version: 1.0.0

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dev_dependencies:
lints: ^3.0.0
lints: ^4.0.0
test: ^1.25.2
4 changes: 2 additions & 2 deletions examples/extension_methods/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: dart.dev example code.
version: 1.0.0

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dev_dependencies:
lints: ^3.0.0
lints: ^4.0.0
test: ^1.25.2
4 changes: 2 additions & 2 deletions examples/fetch_data/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ description: Fetch data example
version: 0.0.1

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
http: ^1.2.0

dev_dependencies:
lints: ^3.0.0
lints: ^4.0.0
4 changes: 2 additions & 2 deletions examples/futures/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ version: 0.0.1
publish_to: none

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
examples_util: {path: ../util}

dev_dependencies:
lints: ^3.0.0
lints: ^4.0.0
test: ^1.25.2
4 changes: 2 additions & 2 deletions examples/html/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ description: dart.dev example code.
version: 0.0.1

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dev_dependencies:
lints: ^3.0.0
lints: ^4.0.0
test: ^1.25.2
examples_util: {path: ../util}
4 changes: 2 additions & 2 deletions examples/iterables/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: iterables_examples
description: dart.dev example code.

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dev_dependencies:
examples_util: {path: ../util}
lints: ^3.0.0
lints: ^4.0.0
test: ^1.25.2
4 changes: 2 additions & 2 deletions examples/language/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: examples
description: dart.dev example code.

environment:
sdk: ^3.3.0
sdk: ^3.4.0

dependencies:
examples_util: { path: ../util }

dev_dependencies:
lints: ^3.0.0
lints: ^4.0.0
test: ^1.25.2
68 changes: 66 additions & 2 deletions examples/misc/lib/language_tour/classes/point_alt.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
///
// #docregion idiomatic-constructor
class Point {
double x = 0;
double y = 0;
// Initializer list of variables and values
double x = 2.0;
double y = 2.0;

// Generative constructor with initializing formal parameters:
Point(this.x, this.y);
Expand All @@ -34,3 +35,66 @@ class Point {
// #docregion idiomatic-constructor
}
// #enddocregion idiomatic-constructor

// #docregion initialize-declaration
class PointA {
double x = 1.0;
double y = 2.0;

// The implicit default constructor sets these variables to (1.0,2.0)
// PointA();

@override
String toString() {
return 'PointA($x,$y)';
}
}
// #enddocregion initialize-declaration

// #docregion initialize-formal
class PointB {
final double x;
final double y;

// Sets the x and y instance variables
// before the constructor body runs.
PointB(this.x, this.y);

// Initializing formal parameters can also be optional.
PointB.optional([this.x = 0.0, this.y = 0.0]);
}
// #enddocregion initialize-formal

// #docregion initialize-named
class PointC {
double x; // must be set in constructor
double y; // must be set in constructor

// Generative constructor with initializing formal parameters
// with default values
PointC.named({this.x = 1.0, this.y = 1.0});

@override
String toString() {
return 'PointC.named($x,$y)';
}
}

// Constructor using named variables.
final pointC = PointC.named(x: 2.0, y: 2.0);
// #enddocregion initialize-named

// #docregion initialize-null
class PointD {
double? x; // null if not set in constructor
double? y; // null if not set in constructor

// Generative constructor with initializing formal parameters
PointD(this.x, this.y);

@override
String toString() {
return 'PointD($x,$y)';
}
}
// #enddocregion initialize-null
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// #docregion named
class Vector2d {
// #enddocregion named
final double x;
final double y;

Vector2d(this.x, this.y);
// #docregion named
// ...
Vector2d.named({required this.x, required this.y});
}

class Vector3d extends Vector2d {
final double z;

// Forward the y parameter to the named super constructor like:
// Vector3d.yzPlane({required double y, required this.z})
// : super.named(x: 0, y: y);
Vector3d.yzPlane({required super.y, required this.z}) : super.named(x: 0);
}
// #enddocregion named
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// #docregion positional
class Vector2d {
final double x;
final double y;

Vector2d(this.x, this.y);
}

class Vector3d extends Vector2d {
final double z;

// Forward the x and y parameters to the default super constructor like:
// Vector3d(final double x, final double y, this.z) : super(x, y);
Vector3d(super.x, super.y, this.z);
}
// #enddocregion positional

0 comments on commit 83a6a97

Please sign in to comment.