Unverified Commit 3d67ca43 authored by Greg Spencer's avatar Greg Spencer Committed by GitHub

Add missing links to examples that aren't linked anywhere (#130422)

## Description

This adds links to examples that were not linked anywhere.

## Related Issues
 - Fixes #129956

## Tests
 - Documentation only change
parent d75735ee
...@@ -73,7 +73,13 @@ class MyHomePage extends StatelessWidget { ...@@ -73,7 +73,13 @@ class MyHomePage extends StatelessWidget {
appBar: AppBar( appBar: AppBar(
title: Text(title), title: Text(title),
), ),
drawer: const Drawer(), drawer: Drawer(
child: Column(
children: <Widget>[
TextButton(child: const Text('Drawer Item'), onPressed: () {}),
],
),
),
body: const Center( body: const Center(
child: NextPageButton(), child: NextPageButton(),
), ),
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
/// Flutter code sample for [SearchAnchor] that shows how to fetch the suggestions /// Flutter code sample for [SearchAnchor].
/// from a remote API.
const Duration fakeAPIDuration = Duration(seconds: 1); const Duration fakeAPIDuration = Duration(seconds: 1);
...@@ -60,7 +59,7 @@ class _AsyncSearchAnchorState extends State<_AsyncSearchAnchor > { ...@@ -60,7 +59,7 @@ class _AsyncSearchAnchorState extends State<_AsyncSearchAnchor > {
final List<String> options = (await _FakeAPI.search(_searchingWithQuery!)).toList(); final List<String> options = (await _FakeAPI.search(_searchingWithQuery!)).toList();
// If another search happened after this one, throw away these options. // If another search happened after this one, throw away these options.
// Use the previous options intead and wait for the newer request to // Use the previous options instead and wait for the newer request to
// finish. // finish.
if (_searchingWithQuery != controller.text) { if (_searchingWithQuery != controller.text) {
return _lastOptions; return _lastOptions;
......
...@@ -6,8 +6,7 @@ import 'dart:async'; ...@@ -6,8 +6,7 @@ import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
/// Flutter code sample for [SearchAnchor] that demonstrates fetching the /// Flutter code sample for [SearchAnchor].
/// suggestions asynchronously and debouncing the network calls.
const Duration fakeAPIDuration = Duration(seconds: 1); const Duration fakeAPIDuration = Duration(seconds: 1);
const Duration debounceDuration = Duration(milliseconds: 500); const Duration debounceDuration = Duration(milliseconds: 500);
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
/// Flutter code sample for [SnackBar] with Material 3 specifications. /// Flutter code sample for [SnackBar].
void main() => runApp(const SnackBarExampleApp()); void main() => runApp(const SnackBarExampleApp());
// A Material 3 [SnackBar] demonstrating an optional icon, in either floating /// A Material 3 [SnackBar] demonstrating an optional icon, in either floating
// or fixed format. /// or fixed format.
class SnackBarExampleApp extends StatelessWidget { class SnackBarExampleApp extends StatelessWidget {
const SnackBarExampleApp({super.key}); const SnackBarExampleApp({super.key});
......
...@@ -16,7 +16,7 @@ class SwitchApp extends StatelessWidget { ...@@ -16,7 +16,7 @@ class SwitchApp extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
theme: ThemeData.light(useMaterial3: true).copyWith( theme: ThemeData.light(useMaterial3: true).copyWith(
// Use the ambient [CupetinoThemeData] to style all widgets which would // Use the ambient CupertinoThemeData to style all widgets which would
// otherwise use iOS defaults. // otherwise use iOS defaults.
cupertinoOverrideTheme: const CupertinoThemeData(applyThemeToAll: true), cupertinoOverrideTheme: const CupertinoThemeData(applyThemeToAll: true),
), ),
...@@ -54,7 +54,7 @@ class _SwitchExampleState extends State<SwitchExample> { ...@@ -54,7 +54,7 @@ class _SwitchExampleState extends State<SwitchExample> {
}, },
), ),
Switch.adaptive( Switch.adaptive(
// Don't use the ambient [CupetinoThemeData] to style this switch. // Don't use the ambient CupertinoThemeData to style this switch.
applyCupertinoTheme: false, applyCupertinoTheme: false,
value: light, value: light,
onChanged: (bool value) { onChanged: (bool value) {
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Examples of LinearBorder and LinearBorderEdge.
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
/// Examples for [LinearBorder] and [LinearBorderEdge].
void main() { void main() {
runApp(const ExampleApp()); runApp(const ExampleApp());
} }
...@@ -18,7 +18,8 @@ class ExampleApp extends StatelessWidget { ...@@ -18,7 +18,8 @@ class ExampleApp extends StatelessWidget {
return MaterialApp( return MaterialApp(
theme: ThemeData.light(useMaterial3: true), theme: ThemeData.light(useMaterial3: true),
home: const Directionality( home: const Directionality(
textDirection: TextDirection.ltr, // Or try rtl. // TRY THIS: Switch to TextDirection.rtl to see how the borders change.
textDirection: TextDirection.ltr,
child: Home(), child: Home(),
), ),
); );
......
...@@ -114,6 +114,13 @@ class ActionIconThemeData with Diagnosticable { ...@@ -114,6 +114,13 @@ class ActionIconThemeData with Diagnosticable {
/// An inherited widget that overrides the default icon of [BackButtonIcon], /// An inherited widget that overrides the default icon of [BackButtonIcon],
/// [CloseButtonIcon], [DrawerButtonIcon], and [EndDrawerButtonIcon] in this /// [CloseButtonIcon], [DrawerButtonIcon], and [EndDrawerButtonIcon] in this
/// widget's subtree. /// widget's subtree.
///
/// {@tool dartpad}
/// This example shows how to define custom builders for drawer and back
/// buttons.
///
/// ** See code in examples/api/lib/material/action_buttons/action_icon_theme.0.dart **
/// {@end-tool}
class ActionIconTheme extends InheritedTheme { class ActionIconTheme extends InheritedTheme {
/// Creates a theme that overrides the default icon of [BackButtonIcon], /// Creates a theme that overrides the default icon of [BackButtonIcon],
/// [CloseButtonIcon], [DrawerButtonIcon], and [EndDrawerButtonIcon] in this /// [CloseButtonIcon], [DrawerButtonIcon], and [EndDrawerButtonIcon] in this
......
...@@ -279,6 +279,12 @@ class ScaffoldMessengerState extends State<ScaffoldMessenger> with TickerProvide ...@@ -279,6 +279,12 @@ class ScaffoldMessengerState extends State<ScaffoldMessenger> with TickerProvide
/// the SnackBar to be visible. /// the SnackBar to be visible.
/// ///
/// {@tool dartpad} /// {@tool dartpad}
/// Here is an example showing how to display a [SnackBar] with [showSnackBar]
///
/// ** See code in examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.0.dart **
/// {@end-tool}
///
/// {@tool dartpad}
/// Here is an example showing that a floating [SnackBar] appears above [Scaffold.floatingActionButton]. /// Here is an example showing that a floating [SnackBar] appears above [Scaffold.floatingActionButton].
/// ///
/// ** See code in examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.1.dart ** /// ** See code in examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.1.dart **
......
...@@ -87,6 +87,19 @@ typedef ViewBuilder = Widget Function(Iterable<Widget> suggestions); ...@@ -87,6 +87,19 @@ typedef ViewBuilder = Widget Function(Iterable<Widget> suggestions);
/// ** See code in examples/api/lib/material/search_anchor/search_anchor.1.dart ** /// ** See code in examples/api/lib/material/search_anchor/search_anchor.1.dart **
/// {@end-tool} /// {@end-tool}
/// ///
/// {@tool dartpad}
/// This example shows how to fetch the search suggestions from a remote API.
///
/// ** See code in examples/api/lib/material/search_anchor/search_anchor.3.dart **
/// {@end-tool}
///
/// {@tool dartpad}
/// This example demonstrates fetching the search suggestions asynchronously and
/// debouncing network calls.
///
/// ** See code in examples/api/lib/material/search_anchor/search_anchor.4.dart **
/// {@end-tool}
///
/// See also: /// See also:
/// ///
/// * [SearchBar], a widget that defines a search bar. /// * [SearchBar], a widget that defines a search bar.
......
...@@ -250,6 +250,13 @@ class _SnackBarActionState extends State<SnackBarAction> { ...@@ -250,6 +250,13 @@ class _SnackBarActionState extends State<SnackBarAction> {
/// ** See code in examples/api/lib/material/snack_bar/snack_bar.1.dart ** /// ** See code in examples/api/lib/material/snack_bar/snack_bar.1.dart **
/// {@end-tool} /// {@end-tool}
/// ///
/// {@tool dartpad}
/// This example demonstrates the various [SnackBar] widget components,
/// including an optional icon, in either floating or fixed format.
///
/// ** See code in examples/api/lib/material/snack_bar/snack_bar.2.dart **
/// {@end-tool}
///
/// See also: /// See also:
/// ///
/// * [ScaffoldMessenger.of], to obtain the current [ScaffoldMessengerState], /// * [ScaffoldMessenger.of], to obtain the current [ScaffoldMessengerState],
......
...@@ -69,6 +69,13 @@ enum _SwitchType { material, adaptive } ...@@ -69,6 +69,13 @@ enum _SwitchType { material, adaptive }
/// ** See code in examples/api/lib/material/switch/switch.2.dart ** /// ** See code in examples/api/lib/material/switch/switch.2.dart **
/// {@end-tool} /// {@end-tool}
/// ///
/// {@tool dartpad}
/// This example shows how to use the ambient [CupertinoThemeData] to style all
/// widgets which would otherwise use iOS defaults.
///
/// ** See code in examples/api/lib/material/switch/switch.3.dart **
/// {@end-tool}
///
/// See also: /// See also:
/// ///
/// * [SwitchListTile], which combines this widget with a [ListTile] so that /// * [SwitchListTile], which combines this widget with a [ListTile] so that
......
...@@ -178,6 +178,13 @@ class _TextFieldSelectionGestureDetectorBuilder extends TextSelectionGestureDete ...@@ -178,6 +178,13 @@ class _TextFieldSelectionGestureDetectorBuilder extends TextSelectionGestureDete
/// ///
/// {@macro flutter.widgets.editableText.accessibility} /// {@macro flutter.widgets.editableText.accessibility}
/// ///
/// {@tool dartpad}
/// This sample shows how to style a text field to match a filled or outlined
/// Material Design 3 text field.
///
/// ** See code in examples/api/lib/material/text_field/text_field.2.dart **
/// {@end-tool}
///
/// See also: /// See also:
/// ///
/// * [TextFormField], which integrates with the [Form] widget. /// * [TextFormField], which integrates with the [Form] widget.
......
...@@ -132,6 +132,12 @@ class LinearBorderEdge { ...@@ -132,6 +132,12 @@ class LinearBorderEdge {
/// ///
/// Convenience constructors are included for the common case where just one edge is specified: /// Convenience constructors are included for the common case where just one edge is specified:
/// [LinearBorder.start], [LinearBorder.end], [LinearBorder.top], [LinearBorder.bottom]. /// [LinearBorder.start], [LinearBorder.end], [LinearBorder.top], [LinearBorder.bottom].
///
/// {@tool dartpad}
/// This example shows how to draw different kinds of [LinearBorder]s.
///
/// ** See code in examples/api/lib/painting/linear_border/linear_border.0.dart **
/// {@end-tool}
class LinearBorder extends OutlinedBorder { class LinearBorder extends OutlinedBorder {
/// Creates a rectangular box border that's rendered as zero to four lines. /// Creates a rectangular box border that's rendered as zero to four lines.
const LinearBorder({ const LinearBorder({
......
...@@ -3036,6 +3036,12 @@ class LimitedBox extends SingleChildRenderObjectWidget { ...@@ -3036,6 +3036,12 @@ class LimitedBox extends SingleChildRenderObjectWidget {
/// A widget that imposes different constraints on its child than it gets /// A widget that imposes different constraints on its child than it gets
/// from its parent, possibly allowing the child to overflow the parent. /// from its parent, possibly allowing the child to overflow the parent.
/// ///
/// {@tool dartpad}
/// This example shows how an [OverflowBox] is used, and what its effect is.
///
/// ** See code in examples/api/lib/widgets/basic/overflowbox.0.dart **
/// {@end-tool}
///
/// See also: /// See also:
/// ///
/// * [RenderConstrainedOverflowBox] for details about how [OverflowBox] is /// * [RenderConstrainedOverflowBox] for details about how [OverflowBox] is
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment