diff --git a/src/_includes/yt_shims.liquid b/src/_includes/yt_shims.liquid new file mode 100644 index 0000000000..40815dccd1 --- /dev/null +++ b/src/_includes/yt_shims.liquid @@ -0,0 +1,6 @@ +{% assign yt-set = 'frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen loading="lazy"' %} +{% assign yt-set-short = 'frameborder="0" allowfullscreen loading="lazy"' %} +{% assign yt-watch = 'https://www.youtube.com/watch' %} +{% assign yt-embed = 'https://www.youtube.com/embed' %} +{% assign yt-playlist = 'https://www.youtube.com/playlist?list=' %} +{% assign yt-std-size = 'width="560" height="315"' %} diff --git a/src/language/extension-methods.md b/src/language/extension-methods.md index 31e893215c..793f44368c 100644 --- a/src/language/extension-methods.md +++ b/src/language/extension-methods.md @@ -9,19 +9,22 @@ nextpage: title: Callable objects --- +{% include yt_shims.liquid %} + Extension methods add functionality to existing libraries. You might use extension methods without even knowing it. For example, when you use code completion in an IDE, it suggests extension methods alongside regular methods. - -_If you like to learn by watching videos, -here's a good overview of extension methods._ ## Overview diff --git a/src/null-safety/migration-guide.md b/src/null-safety/migration-guide.md index cb70bc8a19..a4cac9c5aa 100644 --- a/src/null-safety/migration-guide.md +++ b/src/null-safety/migration-guide.md @@ -3,6 +3,8 @@ title: Migrating to null safety description: How to move your existing Dart code to the world of null safety --- +{% include yt_shims.liquid %} + {{site.alert.version-note}} Dart 2.19 is the final release that supports null-safety migration, including the `dart migrate` tool. @@ -36,9 +38,15 @@ Here are the basic steps for migrating each package that you own: make sure that all of your dependencies are ready. {{site.alert.end}} -For an informal look at the experience of using the migration tool, watch this video: +To get an informal look at the experience of using the migration tool, +watch this video: - + [null safety]: /null-safety [Gradual null safety migration for large Dart projects]: https://medium.com/dartlang/gradual-null-safety-migration-for-large-dart-projects-85acb10b64a9 diff --git a/src/resources/videos.md b/src/resources/videos.md index b7ee3a18a7..ce10697199 100644 --- a/src/resources/videos.md +++ b/src/resources/videos.md @@ -4,6 +4,8 @@ description: Learn by watching! Here's a collection of videos about Dart. dart-playlist-id: PLjxrf2q8roU0Net_g1NT5_vOO3s_FR02J --- +{% include yt_shims.liquid %} + Here are some videos about the Dart language and core libraries. For more videos, see the [Flutter video page.]({{site.flutter-docs}}/resources/videos) If you'd like other videos to be listed on this page, @@ -19,6 +21,11 @@ A playlist of Google-produced videos, ranging from 5-minute talks on Dart asynchrony support to the Dart session from Google I/O 2019. - + [Playlist: Dart videos](https://www.youtube.com/playlist?list={{page.dart-playlist-id}}) diff --git a/src/tools/dart-fix.md b/src/tools/dart-fix.md index aabf1569e8..e8a4e5fe51 100644 --- a/src/tools/dart-fix.md +++ b/src/tools/dart-fix.md @@ -4,6 +4,8 @@ description: Command-line tool for applying analysis fixes and migrating API usa toc: false --- +{% include yt_shims.liquid %} + The `dart fix` command finds and fixes two types of issues: @@ -16,14 +18,17 @@ finds and fixes two types of issues: {{site.alert.tip}} To learn about `dart fix` in a video format, - check out this deep dive on **Decoding Flutter**: + check out this [deep dive][] on **Decoding Flutter**: + + +{{site.alert.end}} - -{{site.alert.end}} +[deep dive]: {{yt-watch}}/OBIuSrg_Quo ## Usage @@ -41,15 +46,15 @@ $ dart fix --apply ## Customization -The `dart fix` command only applies fixes -when there is a "problem" identified by a diagnostic. +The `dart fix` command only applies fixes +when there is a "problem" identified by a diagnostic. Some diagnostics, such as compilation errors, are implicitly enabled, -while others, such as lints, must be explicitly enabled +while others, such as lints, must be explicitly enabled in the [analysis options file](/tools/analysis), as individual preferences for these vary. You can sometimes increase the number of fixes that can be applied -by enabling additional lints. +by enabling additional lints. Note that not all diagnostics have associated fixes. ### Example @@ -68,7 +73,7 @@ class Vector3d extends Vector2d { } ``` -Dart 2.17 introduced a new language feature called super initializers, +Dart 2.17 introduced a new language feature called super initializers, which allows you to write the constructor of `Vector3d` with a more compact style: diff --git a/src/tools/pub/publishing.md b/src/tools/pub/publishing.md index a5eacce435..61ddcb38f1 100644 --- a/src/tools/pub/publishing.md +++ b/src/tools/pub/publishing.md @@ -3,6 +3,8 @@ title: Publishing packages description: Learn how to publish a Dart package to pub.dev. --- +{% include yt_shims.liquid %} + [The pub package manager][pub] isn't just for using other people's packages. It also allows you to share your packages with the world. If you have a useful project and you want others to be able to use it, use the `dart pub publish` @@ -16,7 +18,12 @@ command. Watch the following video for an overview of building and publishing packages. - + ## Publishing is forever