Skip to content

Commit

Permalink
Merge branch 'main' into feat/remove-low-level-html-tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough committed Dec 20, 2023
2 parents c9cbd2a + c74e5fe commit 0196d4a
Show file tree
Hide file tree
Showing 6 changed files with 328 additions and 49 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
submodules: recursive
- run: make build
- run: make write-prod-robots
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm install -g [email protected]
Expand All @@ -95,7 +95,7 @@ jobs:
with:
submodules: recursive
- run: make build
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm install -g [email protected]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.2-slim-bookworm@sha256:14eba677236d3360f2b66595c7fa0f2440ed6e33c519befe4d11c1242a8815a8 as base
FROM ruby:3.2-slim-bookworm@sha256:00c43b85a45aead761e9a1d438d31f2811c073cb32ac3d56cb740d089fa647a4 as base

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=US/Pacific
Expand Down
6 changes: 3 additions & 3 deletions src/_data/linter_rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
{
"name": "avoid_empty_else",
"description": "Avoid empty else statements.",
"description": "Avoid empty statements in else clauses.",
"group": "errors",
"state": "stable",
"incompatible": [],
Expand All @@ -35,7 +35,7 @@
"flutter"
],
"fixStatus": "hasFix",
"details": "**AVOID** empty else statements.\n\n**BAD:**\n```dart\nif (x > y)\n print(\"1\");\nelse ;\n print(\"2\");\n```\n\n",
"details": "**AVOID** empty statements in the `else` clause of `if` statements.\n\n**BAD:**\n```dart\nif (x > y)\n print('1');\nelse ;\n print('2');\n```\n\nIf you want a statement that follows the empty clause to _conditionally_ run,\nremove the dangling semicolon to include it in the `else` clause.\nOptionally, also enclose the else's statement in a block.\n\n**GOOD:**\n```dart\nif (x > y)\n print('1');\nelse\n print('2');\n```\n\n**GOOD:**\n```dart\nif (x > y) {\n print('1');\n} else {\n print('2');\n}\n```\n\nIf you want a statement that follows the empty clause to _unconditionally_ run,\nremove the `else` clause.\n\n**GOOD:**\n```dart\nif (x > y) print('1');\n\nprint('2');\n```\n",
"sinceDartSdk": "2.0.0"
},
{
Expand Down Expand Up @@ -482,7 +482,7 @@
"flutter"
],
"fixStatus": "noFix",
"details": "**DON'T** use BuildContext across asynchronous gaps.\n\nStoring `BuildContext` for later usage can easily lead to difficult to diagnose\ncrashes. Asynchronous gaps are implicitly storing `BuildContext` and are some of\nthe easiest to overlook when writing code.\n\nWhen a `BuildContext` is used, its `mounted` property must be checked after an\nasynchronous gap.\n\n**BAD:**\n```dart\nvoid onButtonTapped(BuildContext context) async {\n await Future.delayed(const Duration(seconds: 1));\n Navigator.of(context).pop();\n}\n```\n\n**GOOD:**\n```dart\nvoid onButtonTapped(BuildContext context) {\n Navigator.of(context).pop();\n}\n```\n\n**GOOD:**\n```dart\nvoid onButtonTapped() async {\n await Future.delayed(const Duration(seconds: 1));\n\n if (!context.mounted) return;\n Navigator.of(context).pop();\n}\n```\n",
"details": "**DON'T** use BuildContext across asynchronous gaps.\n\nStoring `BuildContext` for later usage can easily lead to difficult to diagnose\ncrashes. Asynchronous gaps are implicitly storing `BuildContext` and are some of\nthe easiest to overlook when writing code.\n\nWhen a `BuildContext` is used, a `mounted` property must be checked after an\nasynchronous gap, depending on how the `BuildContext` is accessed:\n\n* When using a `State`'s `context` property, the `State`'s `mounted` property\n must be checked.\n* For other `BuildContext` instances (like a local variable or function\n argument), the `BuildContext`'s `mounted` property must be checked.\n\n**BAD:**\n```dart\nvoid onButtonTapped(BuildContext context) async {\n await Future.delayed(const Duration(seconds: 1));\n Navigator.of(context).pop();\n}\n```\n\n**GOOD:**\n```dart\nvoid onButtonTapped(BuildContext context) {\n Navigator.of(context).pop();\n}\n```\n\n**GOOD:**\n```dart\nvoid onButtonTapped(BuildContext context) async {\n await Future.delayed(const Duration(seconds: 1));\n\n if (!context.mounted) return;\n Navigator.of(context).pop();\n}\n```\n\n**GOOD:**\n```dart\nabstract class MyState extends State<MyWidget> {\n void foo() async {\n await Future.delayed(const Duration(seconds: 1));\n if (!mounted) return; // Checks `this.mounted`, not `context.mounted`.\n Navigator.of(context).pop();\n }\n}\n```\n",
"sinceDartSdk": "2.13.0"
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/get-sdk.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Once you're ready to move beyond DartPad and develop real apps,
To develop real apps,
you need an SDK.
You can either download the Dart SDK directly
(as described below)
Expand Down
78 changes: 37 additions & 41 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
layout: homepage
title: Dart programming language
description: Dart is a client-optimized language for fast apps on any platform.
description: >-
Dart is an approachable, portable, and productive language for
high-quality apps on any platform.
js:
- url: /assets/dash/js/dartpad_picker_main.dart.js
defer: true
Expand All @@ -26,7 +28,7 @@
<!-- Dart tag-line -->
<section class="dash-header-callout">
<div class="callout-title">
Dart is a client-optimized language for fast apps on any platform
An approachable, portable, and productive language for high-quality apps on any platform
</div>
<div class="callout-button">
<button class="btn btn-link btn-icon" type="button" data-toggle="modal" data-target="#videoModal" data-video="5F-6n_2XWR8">
Expand All @@ -53,9 +55,9 @@
<div class="col-md-4 col-sm-12">
<div class="feature">
<div class="feature-icon"><img src="assets/dash/2x/multiplatform performance light [email protected]" alt="Multiplatform performance"/></div>
<div class="feature-title">Optimized<br/>for UI</div>
<div class="feature-desc">Develop with a programming language
specialized around the needs of user interface creation
<div class="feature-title">Approachable<br></div>
<div class="feature-desc">Develop with a consistent, concise, and strongly typed
programming language that offers modern features like null safety and pattern matching.
</div>
</div>
</div>
Expand All @@ -64,18 +66,17 @@
<div class="feature-icon"><img src="assets/dash/2x/client optimised light [email protected]" alt="Client optimised"/></div>
<div class="feature-title">Productive</br>development</div>
<div class="feature-desc">Make changes iteratively: use hot
reload to see the result instantly in your running app
reload to see the result instantly in your running app.
</div>
</div>
</div>
<div class="col-md-4 col-sm-12">
<div class="feature">
<div class="feature-icon"><img src="assets/dash/2x/productive dev light [email protected]" alt="Productive development"/></div>
<div class="feature-title">Fast on all<br/>platforms</div>
<div class="feature-desc">Compile to ARM & x64 machine
code for mobile, desktop, and backend. Or compile to JavaScript
for the web
</div>
<div class="feature-title">Portable and fast<br/>on all platforms</div>
<div class="feature-desc">Compile to ARM, x64, and RISC-V machine
code for mobile, desktop, and backend. Or, compile to JavaScript & WebAssembly
for the web.</div>
</div>
</div>
</div>
Expand All @@ -93,7 +94,7 @@
<div class="content-icon">
<img src="assets/dash/2x/multiplatform performance light [email protected]" alt="Multiplatform performance"/>
</div>
<div class="content-feature">Optimized for UI</div>
<div class="content-feature">Approachable</div>
<div class="content-desc" id="gallerySix">
<ul class="selector">
<li class="highlight" data-banner="assets/dash/svg/1-1 async await.svg">
Expand All @@ -114,11 +115,9 @@
<div class="animated-bullet"></div>
</div>
<div class="bullet-text">
A programming language optimized for building user
interfaces with features such as <a href="/null-safety">sound null safety</a>,
the <a href="/language/collections#spread-operators">spread operator</a> for
expanding collections, and <a href="/language/collections#control-flow-operators">collection if</a> for
customizing UI for each platform
Write safe and concise code using features like <a href="/null-safety">sound null safety</a>,
<a href="/language/collections#control-flow-operators">collection if</a>,
and <a href="/language/patterns">pattern matching</a>.
</div>
</div>
</li>
Expand All @@ -128,8 +127,8 @@
<div class="animated-bullet"></div>
</div>
<div class="bullet-text">
A programming language that is easy to learn, with a
<a href="/language">familiar syntax</a>
A consistent programming language, with an easy to learn and
<a href="/language">familiar syntax</a>.
</div>
</div>
</li>
Expand Down Expand Up @@ -160,7 +159,7 @@
Make changes to your source code iteratively, using
<a href="https://flutter.dev/docs/development/tools/hot-reload" class="no-automatic-external">hot
reload</a>
to instantly see the effect in the running app
to instantly see the effect in the running app.
</div>
</div>
</li>
Expand All @@ -171,7 +170,7 @@
</div>
<div class="bullet-text">
Write code using a flexible type system with rich
static analysis and powerful, <a href="/tools/analysis">configurable tooling</a>
static analysis and powerful, <a href="/tools/analysis">configurable tooling</a>.
</div>
</div>
</li>
Expand All @@ -185,7 +184,7 @@
<a href="https://flutter.dev/docs/development/tools/devtools/logging" class="no-automatic-external">logging</a>,
and <a href="https://flutter.dev/docs/development/tools/devtools/debugger"
class="no-automatic-external">debugging</a>
with your code editor of choice
with your code editor of choice.
</div>
</div>
</li>
Expand Down Expand Up @@ -214,7 +213,7 @@
</div>
<div class="bullet-text">
<a href="/overview#native-platform">AOT-compile</a> apps to native
machine code for <a href="https://github.com/timsneath/time">instant startup</a>
machine code for <a href="https://github.com/timsneath/time">instant startup</a>.
</div>
</div>
</li>
Expand All @@ -225,7 +224,7 @@
</div>
<div class="bullet-text">
Target the web with complete, mature, fast
<a href="/overview#web-platform">compilers for JavaScript</a>
<a href="/overview#web-platform">compilers for JavaScript & WebAssembly</a>.
</div>
</div>
</li>
Expand All @@ -236,7 +235,7 @@
</div>
<div class="bullet-text">
Run <a href="/tutorials/server/httpserver">backend code</a>
supporting your app, written using a single programming language
supporting your app, written using a single programming language.
</div>
</div>
</li>
Expand All @@ -253,7 +252,7 @@
<div class="col-lg-5 col-md-6 col-sm-12 content-info">
<div class="content-container dash-align-right">
<div class="content-icon"><img src="assets/dash/2x/multiplatform performance light [email protected]" alt="Multiplatform performance"/> </div>
<div class="content-feature">Optimized for UI</div>
<div class="content-feature">Approachable</div>
<div class="content-desc" id="galleryOne">
<ul class="selector">
<li class="highlight" tabindex="0" data-banner="assets/dash/svg/1-1 async await.svg">
Expand All @@ -264,22 +263,19 @@
<div class="bullet-text">
Mature and complete <a href="/codelabs/async-await">async-await</a>
for user interfaces containing event-driven code, paired with
<a href="/language/concurrency">isolate-based concurrency</a>
<a href="/language/concurrency">isolate-based concurrency</a>.
</div>
</div>
</li>

<li tabindex="0" data-banner="assets/dash/svg/1-2 language optimized.svg">
<div>
<div class="bullet-container">
<div class="animated-bullet"></div>
</div>
<div class="bullet-text">
A programming language optimized for building user
interfaces with features such as <a href="/null-safety">sound null safety</a>,
the <a href="/language/collections#spread-operators">spread operator</a> for
expanding collections, and <a href="/language/collections#control-flow-operators">collection if</a> for
customizing UI for each platform
Write safe and concise code using features like <a href="/null-safety">sound null safety</a>,
<a href="/language/collections#control-flow-operators">collection if</a>,
and <a href="/language/patterns">pattern matching</a>.
</div>
</div>
</li>
Expand All @@ -289,8 +285,8 @@
<div class="animated-bullet"></div>
</div>
<div class="bullet-text">
A programming language that is easy to learn, with a
<a href="/language">familiar syntax</a>
A consistent programming language, with an easy to learn and
<a href="/language">familiar syntax</a>.
</div>
</div>
</li>
Expand Down Expand Up @@ -322,7 +318,7 @@
Make changes to your source code iteratively, using
<a href="https://flutter.dev/docs/development/tools/hot-reload" class="no-automatic-external">hot
reload</a>
to instantly see the effect in the running app
to instantly see the effect in the running app.
</div>
</div>
</li>
Expand All @@ -333,7 +329,7 @@
</div>
<div class="bullet-text">
Write code using a flexible type system with rich
static analysis and powerful, <a href="/tools/analysis">configurable tooling</a>
static analysis and powerful, <a href="/tools/analysis">configurable tooling</a>.
</div>
</div>
</li>
Expand All @@ -347,7 +343,7 @@
<a href="https://flutter.dev/docs/development/tools/devtools/logging" class="no-automatic-external">logging</a>,
and <a href="https://flutter.dev/docs/development/tools/devtools/debugger"
class="no-automatic-external">debugging</a>
with your code editor of choice
with your code editor of choice.
</div>
</div>

Expand All @@ -372,7 +368,7 @@
</div>
<div class="bullet-text">
<a href="/overview#native-platform">AOT-compile</a> apps to native
machine code for <a href="https://github.com/timsneath/time">instant startup</a>
machine code for <a href="https://github.com/timsneath/time">instant startup</a>.
</div>
</div>

Expand All @@ -384,7 +380,7 @@
</div>
<div class="bullet-text">
Target the web with complete, mature, fast
<a href="/overview#web-platform">compilers for JavaScript</a>
<a href="/overview#web-platform">compilers for JavaScript and WebAssembly</a>.
</div>
</div>

Expand All @@ -396,7 +392,7 @@
</div>
<div class="bullet-text">
Run <a href="/tutorials/server/httpserver">backend code</a>
supporting your app, written using a single programming language
supporting your app, written using a single programming language.
</div>
</div>
</li>
Expand Down
Loading

0 comments on commit 0196d4a

Please sign in to comment.