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

Commit 351466a

Browse files
authored
Add Decoding Flutter videos to API docs (#116454)
* Add Decoding Flutter videos to API docs * Review comments * Update widget of the week videos too
1 parent b113df2 commit 351466a

File tree

10 files changed

+33
-3
lines changed

10 files changed

+33
-3
lines changed

packages/flutter/lib/src/foundation/diagnostics.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3088,6 +3088,8 @@ mixin Diagnosticable {
30883088

30893089
/// Add additional properties associated with the node.
30903090
///
3091+
/// {@youtube 560 315 https://www.youtube.com/watch?v=DnC7eT-vh1k}
3092+
///
30913093
/// Use the most specific [DiagnosticsProperty] existing subclass to describe
30923094
/// each property instead of the [DiagnosticsProperty] base class. There are
30933095
/// only a small number of [DiagnosticsProperty] subclasses each covering a

packages/flutter/lib/src/gestures/arena.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ class _GestureArena {
9797
}
9898
}
9999

100+
/// Used for disambiguating the meaning of sequences of pointer events.
101+
///
102+
/// {@youtube 560 315 https://www.youtube.com/watch?v=Q85LBtBdi0U}
103+
///
100104
/// The first member to accept or the last member to not reject wins.
101105
///
102106
/// See <https://flutter.dev/gestures/#gesture-disambiguation> for more

packages/flutter/lib/src/material/material_state.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,8 @@ class _MaterialStateUnderlineInputBorder extends MaterialStateUnderlineInputBord
602602
/// on a widget's interactive "state", which is defined as a set
603603
/// of [MaterialState]s.
604604
///
605+
/// {@youtube 560 315 https://www.youtube.com/watch?v=CylXr3AF3uU}
606+
///
605607
/// Material state properties represent values that depend on a widget's material
606608
/// "state". The state is encoded as a set of [MaterialState] values, like
607609
/// [MaterialState.focused], [MaterialState.hovered], [MaterialState.pressed]. For

packages/flutter/lib/src/material/navigation_bar.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ const double _kIndicatorWidth = 64;
2626

2727
/// Material 3 Navigation Bar component.
2828
///
29+
/// {@youtube 560 315 https://www.youtube.com/watch?v=DVGYddFaLv0}
30+
///
2931
/// Navigation bars offer a persistent and convenient way to switch between
3032
/// primary destinations in an app.
3133
///

packages/flutter/lib/src/material/theme_data.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ export 'package:flutter/services.dart' show Brightness;
7070

7171
/// An interface that defines custom additions to a [ThemeData] object.
7272
///
73+
/// {@youtube 560 315 https://www.youtube.com/watch?v=8-szcYzFVao}
74+
///
7375
/// Typically used for custom colors. To use, subclass [ThemeExtension],
7476
/// define a number of fields (e.g. [Color]s), and implement the [copyWith] and
7577
/// [lerp] methods. The latter will ensure smooth transitions of properties when

packages/flutter/lib/src/widgets/async.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,11 +439,15 @@ class StreamBuilder<T> extends StreamBuilderBase<T, AsyncSnapshot<T>> {
439439
Widget build(BuildContext context, AsyncSnapshot<T> currentSummary) => builder(context, currentSummary);
440440
}
441441

442-
/// Widget that builds itself based on the latest snapshot of interaction with
442+
/// A widget that builds itself based on the latest snapshot of interaction with
443443
/// a [Future].
444444
///
445+
/// {@youtube 560 315 https://www.youtube.com/watch?v=ek8ZPdWj4Qo}
446+
///
445447
/// {@youtube 560 315 https://www.youtube.com/watch?v=zEdw_1B7JHY}
446448
///
449+
/// ## Managing the future
450+
///
447451
/// The [future] must have been obtained earlier, e.g. during [State.initState],
448452
/// [State.didUpdateWidget], or [State.didChangeDependencies]. It must not be
449453
/// created during the [State.build] or [StatelessWidget.build] method call when
@@ -454,8 +458,6 @@ class StreamBuilder<T> extends StreamBuilderBase<T, AsyncSnapshot<T>> {
454458
/// A general guideline is to assume that every `build` method could get called
455459
/// every frame, and to treat omitted calls as an optimization.
456460
///
457-
/// {@youtube 560 315 https://www.youtube.com/watch?v=ek8ZPdWj4Qo}
458-
///
459461
/// ## Timing
460462
///
461463
/// Widget rebuilding is scheduled by the completion of the future, using

packages/flutter/lib/src/widgets/framework.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,6 +1581,8 @@ abstract class ParentDataWidget<T extends ParentData> extends ProxyWidget {
15811581

15821582
/// Base class for widgets that efficiently propagate information down the tree.
15831583
///
1584+
/// {@youtube 560 315 https://www.youtube.com/watch?v=og-vJqLzg2c}
1585+
///
15841586
/// To obtain the nearest instance of a particular type of inherited widget from
15851587
/// a build context, use [BuildContext.dependOnInheritedWidgetOfExactType].
15861588
///

packages/flutter/lib/src/widgets/media_query.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ class MediaQueryData {
255255
/// level MediaQuery created by [WidgetsApp] are the same as the window
256256
/// (often the mobile device screen) that contains the app.
257257
///
258+
/// {@youtube 560 315 https://www.youtube.com/watch?v=ceCo8U0XHqw}
259+
///
258260
/// See also:
259261
///
260262
/// * [ui.window], which provides some additional detail about this property
@@ -272,6 +274,8 @@ class MediaQueryData {
272274
///
273275
/// Padding is derived from the values of [viewInsets] and [viewPadding].
274276
///
277+
/// {@youtube 560 315 https://www.youtube.com/watch?v=ceCo8U0XHqw}
278+
///
275279
/// See also:
276280
///
277281
/// * [ui.window], which provides some additional detail about this
@@ -294,6 +298,8 @@ class MediaQueryData {
294298
/// same as the window that contains the app. On mobile devices, this will
295299
/// typically be the full screen.
296300
///
301+
/// {@youtube 560 315 https://www.youtube.com/watch?v=ceCo8U0XHqw}
302+
///
297303
/// See also:
298304
///
299305
/// * [ui.window], which provides some additional detail about this

packages/flutter/lib/src/widgets/primary_scroll_controller.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ const Set<TargetPlatform> _kMobilePlatforms = <TargetPlatform>{
1717

1818
/// Associates a [ScrollController] with a subtree.
1919
///
20+
/// {@youtube 560 315 https://www.youtube.com/watch?v=33_0ABjFJUU}
21+
///
2022
/// When a [ScrollView] has [ScrollView.primary] set to true, the [ScrollView]
2123
/// uses [of] to inherit the [PrimaryScrollController] associated with its
2224
/// subtree.

packages/flutter/lib/src/widgets/scroll_view.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ abstract class ScrollView extends StatelessWidget {
180180
/// [TargetPlatformVariant.mobile] for ScrollViews in the [Axis.vertical]
181181
/// scroll direction. Adding another to your app will override the
182182
/// PrimaryScrollController above it.
183+
///
184+
/// The following video contains more information about scroll controllers,
185+
/// the PrimaryScrollController widget, and their impact on your apps:
186+
///
187+
/// {@youtube 560 315 https://www.youtube.com/watch?v=33_0ABjFJUU}
188+
///
183189
/// {@endtemplate}
184190
final bool? primary;
185191

0 commit comments

Comments
 (0)