From 9fb781a54a587c696839775a6d2e878860d0bbf7 Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Mon, 10 Feb 2020 10:00:20 -0800 Subject: [PATCH] =?UTF-8?q?Update=20samples=20to=20work=20with=20Dartpad,?= =?UTF-8?q?=20and=20convert=20all=20that=20make=E2=80=A6=20(#50377)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR modifies the existing API docs samples to use DartPad so that all of the samples are now interactive apps on the API docs site. It also removes the restriction for the max width of the description area so that the dartpad region can expand horizontally. I updated the first paragraph on the API docs to indicate that Flutter is more than just mobile now (same text as the README.md at the top level). I modified a few of the examples so that they looked nicer, and fit better on the page. I added the sample description text above each DartPad instance, since that often defines the context of the example. I removed animations and images when they were redundant with the sample content. There were a few that made sense to keep, so I did. --- dev/docs/assets/overrides.css | 4 + dev/docs/lib/opensearch.xml | 6 +- .../config/skeletons/dartpad-sample.html | 4 + dev/snippets/config/skeletons/sample.html | 2 +- .../flutter/lib/src/animation/curves.dart | 2 +- packages/flutter/lib/src/material/about.dart | 2 +- .../src/material/bottom_navigation_bar.dart | 2 +- .../lib/src/material/bottom_sheet.dart | 4 +- packages/flutter/lib/src/material/card.dart | 4 +- .../lib/src/material/checkbox_list_tile.dart | 4 +- packages/flutter/lib/src/material/chip.dart | 2 +- .../flutter/lib/src/material/data_table.dart | 2 +- .../flutter/lib/src/material/divider.dart | 2 +- .../flutter/lib/src/material/dropdown.dart | 6 +- .../lib/src/material/expansion_panel.dart | 4 +- .../lib/src/material/flexible_space_bar.dart | 2 +- .../src/material/floating_action_button.dart | 4 +- .../flutter/lib/src/material/icon_button.dart | 4 +- .../flutter/lib/src/material/ink_well.dart | 2 +- .../lib/src/material/input_decorator.dart | 8 +- .../flutter/lib/src/material/list_tile.dart | 8 +- packages/flutter/lib/src/material/radio.dart | 2 +- .../lib/src/material/radio_list_tile.dart | 6 +- .../lib/src/material/raised_button.dart | 2 +- .../flutter/lib/src/material/scaffold.dart | 74 +++-- .../flutter/lib/src/material/stepper.dart | 4 +- .../lib/src/material/switch_list_tile.dart | 6 +- .../lib/src/services/keyboard_key.dart | 4 +- packages/flutter/lib/src/widgets/actions.dart | 2 +- .../lib/src/widgets/animated_list.dart | 14 +- packages/flutter/lib/src/widgets/async.dart | 278 +++++++++--------- packages/flutter/lib/src/widgets/basic.dart | 16 +- .../lib/src/widgets/editable_text.dart | 4 +- .../lib/src/widgets/focus_manager.dart | 2 +- .../flutter/lib/src/widgets/focus_scope.dart | 2 +- packages/flutter/lib/src/widgets/form.dart | 2 +- packages/flutter/lib/src/widgets/image.dart | 17 +- .../lib/src/widgets/implicit_animations.dart | 10 +- .../lib/src/widgets/inherited_theme.dart | 2 +- .../flutter/lib/src/widgets/media_query.dart | 2 +- .../lib/src/widgets/nested_scroll_view.dart | 2 +- .../src/widgets/single_child_scroll_view.dart | 144 ++++----- .../flutter/lib/src/widgets/sliver_fill.dart | 15 +- .../flutter/lib/src/widgets/transitions.dart | 4 +- .../src/widgets/tween_animation_builder.dart | 2 +- 45 files changed, 363 insertions(+), 331 deletions(-) diff --git a/dev/docs/assets/overrides.css b/dev/docs/assets/overrides.css index 19cd74ec984..74b249f526a 100644 --- a/dev/docs/assets/overrides.css +++ b/dev/docs/assets/overrides.css @@ -97,6 +97,10 @@ code { padding-right: 0; } +.markdown.desc { + max-width: inherit; +} + #search-box { color: #555; background-color: #fff; diff --git a/dev/docs/lib/opensearch.xml b/dev/docs/lib/opensearch.xml index 888ab40d3be..7a945ab67cd 100644 --- a/dev/docs/lib/opensearch.xml +++ b/dev/docs/lib/opensearch.xml @@ -3,8 +3,10 @@ Welcome to the Flutter API reference documentation search. -Flutter is Google’s mobile UI framework for crafting high-quality native interfaces on iOS and Android in record time. -Flutter works with existing code, is used by developers and organizations around the world, and is free and open source. +Flutter is Google's SDK for crafting beautiful, fast user experiences for +mobile, web and desktop from a single codebase. Flutter works with existing +code, is used by developers and organizations around the world, and is free and +open source. The API reference herein covers all libraries that are exported by the Flutter SDK. diff --git a/dev/snippets/config/skeletons/dartpad-sample.html b/dev/snippets/config/skeletons/dartpad-sample.html index d47dffe5d54..2f44285ab64 100644 --- a/dev/snippets/config/skeletons/dartpad-sample.html +++ b/dev/snippets/config/skeletons/dartpad-sample.html @@ -22,7 +22,11 @@
+ {{description}} +
To create a local project with this code sample, run:
+ flutter create --sample={{id}} mysample +