From fd9ce277482c906a2324066c4107779536d6edfe Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Mon, 4 Oct 2021 12:16:17 -0700 Subject: [PATCH] Clean up examples, remove section markers and --template args (#91133) This does a cleanup of the examples, removing all of the "section" markers and extra comments that we don't need anymore now that the samples are no longer in the source code. It also removes the --template arguments from the {@tool dartpad} and {@tool sample} directives, since those are no longer used. It converts two examples that I discovered were still embedded into linked examples in the examples folder. I didn't delete the templates from the snippets config folder yet, because there are still embedded samples in the dart:ui package from the engine that use them. Once dart:ui no longer uses the templates, they can be removed. I bumped the version of the snippets package to pick up a change that allows removal of the --template argument. --- dev/bots/analyze_sample_code.dart | 2 +- dev/bots/docs.sh | 2 +- .../api/lib/animation/curves/curve2_d.0.dart | 29 ----- .../cupertino_context_menu.0.dart | 29 ----- .../nav_bar/cupertino_navigation_bar.0.dart | 25 ----- .../cupertino_page_scaffold.0.dart | 25 ----- .../cupertino_sliver_refresh_control.0.dart | 25 ----- .../route/show_cupertino_dialog.0.dart | 27 ----- .../route/show_cupertino_modal_popup.0.dart | 27 ----- .../scrollbar/cupertino_scrollbar.0.dart | 32 ------ .../scrollbar/cupertino_scrollbar.1.dart | 31 ------ .../cupertino_text_form_field_row.1.dart | 30 ------ .../pointer_signal_resolver.0.dart | 46 -------- .../lib/material/about/about_list_tile.0.dart | 23 ---- .../api/lib/material/app_bar/app_bar.0.dart | 23 ---- .../api/lib/material/app_bar/app_bar.1.dart | 22 ---- .../material/app_bar/sliver_app_bar.1.dart | 24 ----- .../material/autocomplete/autocomplete.0.dart | 20 ---- .../material/autocomplete/autocomplete.1.dart | 20 ---- .../material/banner/material_banner.0.dart | 22 ---- .../material/banner/material_banner.1.dart | 23 ---- .../bottom_app_bar/bottom_app_bar.1.dart | 27 ----- .../bottom_navigation_bar.0.dart | 28 ----- .../bottom_navigation_bar.1.dart | 31 ------ .../show_modal_bottom_sheet.0.dart | 25 ----- examples/api/lib/material/card/card.0.dart | 23 ---- examples/api/lib/material/card/card.1.dart | 24 ----- .../api/lib/material/checkbox/checkbox.0.dart | 27 ----- .../checkbox_list_tile.0.dart | 35 ------ .../checkbox_list_tile.1.dart | 39 ------- .../checkbox_list_tile.2.dart | 32 ------ ...eletable_chip_attributes.on_deleted.0.dart | 30 ------ .../lib/material/data_table/data_table.0.dart | 27 ----- .../lib/material/data_table/data_table.1.dart | 24 ----- .../date_picker/show_date_picker.0.dart | 26 ----- .../date_picker/show_date_range_picker.0.dart | 26 ----- .../lib/material/dialog/alert_dialog.1.dart | 24 ----- .../lib/material/dialog/show_dialog.0.dart | 27 ----- .../api/lib/material/divider/divider.0.dart | 27 ----- .../material/divider/vertical_divider.0.dart | 25 ----- .../material/dropdown/dropdown_button.0.dart | 27 ----- ...opdown_button.selected_item_builder.0.dart | 24 ----- .../dropdown/dropdown_button.style.0.dart | 24 ----- .../elevated_button/elevated_button.0.dart | 23 ---- .../expansion_panel_list.0.dart | 29 ----- ...nel_list.expansion_panel_list_radio.0.dart | 29 ----- .../expansion_tile/expansion_tile.0.dart | 23 ---- .../flexible_space_bar.0.dart | 30 ------ .../floating_action_button.0.dart | 25 ----- .../floating_action_button.1.dart | 26 ----- .../standard_fab_location.0.dart | 38 ------- .../material/icon_button/icon_button.0.dart | 32 ------ .../material/icon_button/icon_button.1.dart | 27 ----- .../api/lib/material/ink_well/ink_well.0.dart | 24 ----- .../input_decorator/input_decoration.0.dart | 28 ----- .../input_decorator/input_decoration.1.dart | 26 ----- .../input_decorator/input_decoration.2.dart | 26 ----- .../input_decorator/input_decoration.3.dart | 26 ----- .../input_decoration.label.0.dart | 23 ---- ..._decoration.prefix_icon_constraints.0.dart | 29 ----- ..._decoration.suffix_icon_constraints.0.dart | 29 ----- .../lib/material/list_tile/list_tile.4.dart | 31 ------ .../lib/material/list_tile/list_tile.5.dart | 32 ------ .../list_tile/list_tile.selected.0.dart | 25 ----- .../material_state_border_side.0.dart | 24 ----- .../material_state_mouse_cursor.0.dart | 35 ------ .../material_state_outlined_border.0.dart | 31 ------ .../material_state_property.0.dart | 26 ----- .../navigation_rail/navigation_rail.0.dart | 26 ----- .../navigation_rail.extended_animation.0.dart | 42 -------- .../outlined_button/outlined_button.0.dart | 22 ---- .../circular_progress_indicator.0.dart | 23 ---- .../linear_progress_indicator.0.dart | 23 ---- examples/api/lib/material/radio/radio.0.dart | 42 -------- .../material/radio/radio.toggleable.0.dart | 24 ----- .../radio_list_tile/radio_list_tile.0.dart | 32 ------ .../radio_list_tile/radio_list_tile.1.dart | 39 ------- .../radio_list_tile/radio_list_tile.2.dart | 32 ------ .../radio_list_tile.toggleable.0.dart | 24 ----- .../material/range_slider/range_slider.0.dart | 28 ----- .../reorderable_list_view.0.dart | 23 ---- ...ist_view.build_default_drag_handles.0.dart | 23 ---- ..._view.reorderable_list_view_builder.0.dart | 23 ---- .../api/lib/material/scaffold/scaffold.0.dart | 28 ----- .../api/lib/material/scaffold/scaffold.1.dart | 28 ----- .../api/lib/material/scaffold/scaffold.2.dart | 30 ------ .../material/scaffold/scaffold.drawer.0.dart | 26 ----- .../scaffold/scaffold.end_drawer.0.dart | 26 ----- .../lib/material/scaffold/scaffold.of.0.dart | 38 ------- .../lib/material/scaffold/scaffold.of.1.dart | 27 ----- .../scaffold/scaffold_messenger.0.dart | 22 ---- .../scaffold/scaffold_messenger.of.0.dart | 23 ---- .../scaffold/scaffold_messenger.of.1.dart | 30 ------ ...essenger_state.show_material_banner.0.dart | 22 ---- ...fold_messenger_state.show_snack_bar.0.dart | 22 ---- .../scaffold_state.show_bottom_sheet.0.dart | 24 ----- .../scaffold_state.show_snack_bar.0.dart | 22 ---- .../lib/material/scrollbar/scrollbar.0.dart | 23 ---- .../lib/material/scrollbar/scrollbar.1.dart | 25 ----- .../api/lib/material/slider/slider.0.dart | 27 ----- .../lib/material/snack_bar/snack_bar.0.dart | 23 ---- .../lib/material/snack_bar/snack_bar.1.dart | 24 ----- .../api/lib/material/stepper/stepper.0.dart | 23 ---- .../stepper/stepper.controls_builder.0.dart | 22 ---- .../switch_list_tile/switch_list_tile.0.dart | 26 ----- .../switch_list_tile/switch_list_tile.1.dart | 39 ------- .../switch_list_tile/switch_list_tile.2.dart | 32 ------ .../tab_controller/tab_controller.1.dart | 29 ----- examples/api/lib/material/tabs/tab_bar.0.dart | 23 ---- examples/api/lib/material/tabs/tab_bar.1.dart | 25 ----- .../material/text_button/text_button.0.dart | 23 ---- .../lib/material/text_field/text_field.1.dart | 24 ----- .../text_form_field/text_form_field.1.dart | 30 ------ .../api/lib/material/tooltip/tooltip.0.dart | 25 ----- .../api/lib/material/tooltip/tooltip.1.dart | 32 ------ .../api/lib/material/tooltip/tooltip.2.dart | 25 ----- .../painting/gradient/linear_gradient.0.dart | 23 ---- ...elegate_with_fixed_cross_axis_count.0.dart | 24 ----- ...elegate_with_fixed_cross_axis_count.1.dart | 24 ----- .../keyboard_key/logical_keyboard_key.0.dart | 30 ------ .../keyboard_key/physical_keyboard_key.0.dart | 30 ------ ...chrome.set_system_u_i_overlay_style.1.dart | 36 ------- .../actions/action.action_overridable.0.dart | 36 ------- .../widgets/actions/action_listener.0.dart | 30 ------ .../api/lib/widgets/actions/actions.0.dart | 42 -------- .../actions/focusable_action_detector.0.dart | 44 -------- .../animated_list/animated_list.0.dart | 26 ----- .../animated_list/sliver_animated_list.0.dart | 26 ----- .../animated_size/animated_size.0.dart | 23 ---- .../animated_switcher.0.dart | 24 ----- .../lib/widgets/async/future_builder.0.dart | 27 ----- .../lib/widgets/async/stream_builder.0.dart | 27 ----- .../autocomplete/raw_autocomplete.0.dart | 20 ---- .../autocomplete/raw_autocomplete.1.dart | 20 ---- .../autocomplete/raw_autocomplete.2.dart | 19 ---- .../raw_autocomplete.focus_node.0.dart | 20 ---- .../widgets/autofill/autofill_group.0.dart | 24 ----- .../lib/widgets/basic/absorb_pointer.0.dart | 24 ----- .../api/lib/widgets/basic/aspect_ratio.0.dart | 27 ----- .../api/lib/widgets/basic/aspect_ratio.1.dart | 22 ---- .../api/lib/widgets/basic/aspect_ratio.2.dart | 22 ---- .../api/lib/widgets/basic/expanded.0.dart | 25 ----- .../api/lib/widgets/basic/expanded.1.dart | 25 ----- .../api/lib/widgets/basic/fitted_box.0.dart | 23 ---- examples/api/lib/widgets/basic/flow.0.dart | 21 ---- .../basic/fractionally_sized_box.0.dart | 24 ----- .../lib/widgets/basic/ignore_pointer.0.dart | 27 ----- .../api/lib/widgets/basic/listener.0.dart | 30 ------ .../api/lib/widgets/basic/mouse_region.0.dart | 30 ------ .../widgets/basic/mouse_region.on_exit.0.dart | 26 ----- .../widgets/basic/mouse_region.on_exit.1.dart | 35 ------ .../api/lib/widgets/basic/offstage.0.dart | 26 ----- .../lib/widgets/basic/physical_shape.0.dart | 24 ----- .../color_filter/color_filtered.0.dart | 29 +---- .../widgets/dismissible/dismissible.0.dart | 25 ----- .../lib/widgets/drag_target/draggable.0.dart | 25 ----- .../editable_text.on_changed.0.dart | 24 ----- .../text_editing_controller.0.dart | 25 ----- .../widgets/focus_manager/focus_node.0.dart | 36 ------- .../focus_manager/focus_node.unfocus.0.dart | 37 ------- .../api/lib/widgets/focus_scope/focus.0.dart | 31 ------ .../api/lib/widgets/focus_scope/focus.1.dart | 34 ------ .../api/lib/widgets/focus_scope/focus.2.dart | 28 ----- .../widgets/focus_scope/focus_scope.0.dart | 31 ------ .../focus_traversal_group.0.dart | 33 ------ .../ordered_traversal_policy.0.dart | 30 ------ examples/api/lib/widgets/form/form.0.dart | 27 ----- .../lib/widgets/framework/build_owner.0.dart | 27 ----- .../lib/widgets/framework/error_widget.0.dart | 28 ----- .../gesture_detector/gesture_detector.0.dart | 25 ----- .../gesture_detector/gesture_detector.1.dart | 29 ----- examples/api/lib/widgets/heroes/hero.0.dart | 31 ------ .../widgets/image/image.error_builder.0.dart | 23 ---- .../widgets/image/image.frame_builder.0.dart | 26 ----- .../image/image.loading_builder.0.dart | 23 ---- .../implicit_animations/animated_align.0.dart | 24 ----- .../animated_container.0.dart | 25 ----- .../animated_padding.0.dart | 24 ----- .../animated_positioned.0.dart | 25 ----- .../implicit_animations/animated_slide.0.dart | 24 ----- .../sliver_animated_opacity.0.dart | 23 ---- .../inherited_notifier.0.dart | 46 -------- .../inherited_theme/inherited_theme.0.dart | 38 ------- .../interactive_viewer.0.dart | 22 ---- .../interactive_viewer.builder.0.dart | 21 ---- .../interactive_viewer.constrained.0.dart | 25 ----- ...ve_viewer.transformation_controller.0.dart | 24 ----- .../layout_builder/layout_builder.0.dart | 23 ---- ...ia_query_data.system_gesture_insets.0.dart | 29 ----- .../lib/widgets/navigator/navigator.0.dart | 38 ------- .../navigator.restorable_push.0.dart | 23 ---- ...or.restorable_push_and_remove_until.0.dart | 23 ---- ...vigator.restorable_push_replacement.0.dart | 23 ---- .../navigator_state.restorable_push.0.dart | 23 ---- ...te.restorable_push_and_remove_until.0.dart | 23 ---- ...r_state.restorable_push_replacement.0.dart | 23 ---- .../navigator/restorable_route_future.0.dart | 38 ------- .../nested_scroll_view.0.dart | 28 ----- .../nested_scroll_view.1.dart | 25 ----- .../nested_scroll_view.2.dart | 27 ----- .../nested_scroll_view_state.0.dart | 30 ------ .../notification_listener/notification.0.dart | 26 ----- .../widgets/overflow_bar/overflow_bar.0.dart | 27 ----- .../glowing_overscroll_indicator.0.dart | 25 ----- .../glowing_overscroll_indicator.1.dart | 25 ----- .../widgets/page_storage/page_storage.0.dart | 34 ------ .../lib/widgets/page_view/page_view.0.dart | 23 ---- .../preferred_size/preferred_size.0.dart | 31 ------ .../restoration/restoration_mixin.0.dart | 97 +++++++++++++++++ .../restorable_value.0.dart | 23 ---- .../widgets/routes/show_general_dialog.0.dart | 27 ----- .../scroll_metrics_notification.0.dart | 21 ---- .../scroll_view/custom_scroll_view.1.dart | 30 ------ .../widgets/scrollbar/raw_scrollbar.0.dart | 31 ------ .../widgets/scrollbar/raw_scrollbar.1.dart | 26 ----- .../widgets/scrollbar/raw_scrollbar.2.dart | 27 ----- .../scrollbar/raw_scrollbar.shape.0.dart | 45 ++++++++ .../shortcuts/character_activator.0.dart | 30 ------ .../widgets/shortcuts/logical_key_set.0.dart | 44 -------- .../lib/widgets/shortcuts/shortcuts.0.dart | 41 ------- .../lib/widgets/shortcuts/shortcuts.1.dart | 45 -------- .../single_activator.single_activator.0.dart | 35 ------ .../single_child_scroll_view.0.dart | 27 ----- .../single_child_scroll_view.1.dart | 23 ---- .../sliver_fill/sliver_fill_remaining.0.dart | 24 ----- .../sliver_fill/sliver_fill_remaining.1.dart | 24 ----- .../sliver_fill/sliver_fill_remaining.2.dart | 24 ----- .../sliver_fill/sliver_fill_remaining.3.dart | 28 ----- examples/api/lib/widgets/table/table.0.dart | 22 ---- .../transitions/align_transition.0.dart | 24 ----- .../transitions/animated_builder.0.dart | 31 ------ .../transitions/animated_widget.0.dart | 36 ------- .../decorated_box_transition.0.dart | 24 ----- .../default_text_style_transition.0.dart | 24 ----- .../transitions/fade_transition.0.dart | 24 ----- .../transitions/positioned_transition.0.dart | 24 ----- .../relative_positioned_transition.0.dart | 24 ----- .../transitions/rotation_transition.0.dart | 24 ----- .../transitions/scale_transition.0.dart | 24 ----- .../transitions/size_transition.0.dart | 25 ----- .../transitions/slide_transition.0.dart | 23 ---- .../transitions/sliver_fade_transition.0.dart | 23 ---- .../tween_animation_builder.0.dart | 26 ----- .../will_pop_scope/will_pop_scope.1.dart | 23 ---- .../flutter/lib/src/animation/curves.dart | 2 +- .../lib/src/cupertino/context_menu.dart | 2 +- .../flutter/lib/src/cupertino/nav_bar.dart | 2 +- .../lib/src/cupertino/page_scaffold.dart | 2 +- .../flutter/lib/src/cupertino/refresh.dart | 2 +- packages/flutter/lib/src/cupertino/route.dart | 4 +- .../flutter/lib/src/cupertino/scrollbar.dart | 4 +- .../src/cupertino/text_form_field_row.dart | 2 +- .../src/gestures/pointer_signal_resolver.dart | 2 +- packages/flutter/lib/src/material/about.dart | 2 +- .../flutter/lib/src/material/app_bar.dart | 6 +- .../lib/src/material/autocomplete.dart | 4 +- packages/flutter/lib/src/material/banner.dart | 4 +- .../lib/src/material/bottom_app_bar.dart | 2 +- .../src/material/bottom_navigation_bar.dart | 4 +- .../lib/src/material/bottom_sheet.dart | 2 +- packages/flutter/lib/src/material/card.dart | 4 +- .../flutter/lib/src/material/checkbox.dart | 2 +- .../lib/src/material/checkbox_list_tile.dart | 6 +- packages/flutter/lib/src/material/chip.dart | 2 +- .../flutter/lib/src/material/data_table.dart | 4 +- .../flutter/lib/src/material/date_picker.dart | 4 +- packages/flutter/lib/src/material/dialog.dart | 4 +- .../flutter/lib/src/material/divider.dart | 4 +- .../flutter/lib/src/material/dropdown.dart | 6 +- .../lib/src/material/elevated_button.dart | 2 +- .../lib/src/material/expansion_panel.dart | 4 +- .../lib/src/material/expansion_tile.dart | 2 +- .../lib/src/material/flexible_space_bar.dart | 2 +- .../src/material/floating_action_button.dart | 4 +- .../floating_action_button_location.dart | 2 +- .../flutter/lib/src/material/icon_button.dart | 4 +- .../flutter/lib/src/material/ink_well.dart | 2 +- .../lib/src/material/input_decorator.dart | 14 +-- .../flutter/lib/src/material/list_tile.dart | 6 +- .../lib/src/material/material_state.dart | 8 +- .../lib/src/material/navigation_rail.dart | 4 +- .../lib/src/material/outlined_button.dart | 2 +- .../lib/src/material/progress_indicator.dart | 4 +- packages/flutter/lib/src/material/radio.dart | 4 +- .../lib/src/material/radio_list_tile.dart | 8 +- .../lib/src/material/range_slider.dart | 2 +- .../lib/src/material/reorderable_list.dart | 6 +- .../flutter/lib/src/material/scaffold.dart | 28 ++--- .../flutter/lib/src/material/scrollbar.dart | 4 +- packages/flutter/lib/src/material/slider.dart | 2 +- .../flutter/lib/src/material/snack_bar.dart | 4 +- .../flutter/lib/src/material/stepper.dart | 7 +- .../lib/src/material/switch_list_tile.dart | 6 +- .../lib/src/material/tab_controller.dart | 2 +- packages/flutter/lib/src/material/tabs.dart | 4 +- .../flutter/lib/src/material/text_button.dart | 2 +- .../flutter/lib/src/material/text_field.dart | 2 +- .../lib/src/material/text_form_field.dart | 2 +- .../flutter/lib/src/material/tooltip.dart | 6 +- .../flutter/lib/src/painting/gradient.dart | 2 +- .../lib/src/rendering/sliver_grid.dart | 4 +- .../lib/src/services/keyboard_key.dart | 4 +- .../lib/src/services/system_chrome.dart | 2 +- packages/flutter/lib/src/widgets/actions.dart | 8 +- .../lib/src/widgets/animated_list.dart | 4 +- .../lib/src/widgets/animated_size.dart | 2 +- .../lib/src/widgets/animated_switcher.dart | 2 +- packages/flutter/lib/src/widgets/async.dart | 4 +- .../flutter/lib/src/widgets/autocomplete.dart | 8 +- .../flutter/lib/src/widgets/autofill.dart | 2 +- packages/flutter/lib/src/widgets/basic.dart | 32 +++--- .../flutter/lib/src/widgets/color_filter.dart | 2 +- .../flutter/lib/src/widgets/dismissible.dart | 2 +- .../flutter/lib/src/widgets/drag_target.dart | 2 +- .../lib/src/widgets/editable_text.dart | 4 +- .../lib/src/widgets/focus_manager.dart | 4 +- .../flutter/lib/src/widgets/focus_scope.dart | 8 +- .../lib/src/widgets/focus_traversal.dart | 4 +- packages/flutter/lib/src/widgets/form.dart | 2 +- .../flutter/lib/src/widgets/framework.dart | 4 +- .../lib/src/widgets/gesture_detector.dart | 4 +- packages/flutter/lib/src/widgets/heroes.dart | 2 +- packages/flutter/lib/src/widgets/image.dart | 6 +- .../lib/src/widgets/implicit_animations.dart | 12 +-- .../lib/src/widgets/inherited_notifier.dart | 2 +- .../lib/src/widgets/inherited_theme.dart | 2 +- .../lib/src/widgets/interactive_viewer.dart | 8 +- .../lib/src/widgets/layout_builder.dart | 2 +- .../flutter/lib/src/widgets/media_query.dart | 2 +- .../flutter/lib/src/widgets/navigator.dart | 16 +-- .../lib/src/widgets/nested_scroll_view.dart | 8 +- .../src/widgets/notification_listener.dart | 2 +- .../flutter/lib/src/widgets/overflow_bar.dart | 2 +- .../lib/src/widgets/overscroll_indicator.dart | 4 +- .../flutter/lib/src/widgets/page_storage.dart | 2 +- .../flutter/lib/src/widgets/page_view.dart | 2 +- .../lib/src/widgets/preferred_size.dart | 2 +- .../flutter/lib/src/widgets/restoration.dart | 101 +----------------- .../src/widgets/restoration_properties.dart | 2 +- packages/flutter/lib/src/widgets/routes.dart | 2 +- .../lib/src/widgets/scroll_position.dart | 2 +- .../flutter/lib/src/widgets/scroll_view.dart | 2 +- .../flutter/lib/src/widgets/scrollbar.dart | 29 ++--- .../flutter/lib/src/widgets/shortcuts.dart | 10 +- .../src/widgets/single_child_scroll_view.dart | 4 +- .../flutter/lib/src/widgets/sliver_fill.dart | 8 +- packages/flutter/lib/src/widgets/table.dart | 2 +- .../flutter/lib/src/widgets/transitions.dart | 26 ++--- .../src/widgets/tween_animation_builder.dart | 2 +- .../lib/src/widgets/will_pop_scope.dart | 2 +- 350 files changed, 396 insertions(+), 6885 deletions(-) create mode 100644 examples/api/lib/widgets/restoration/restoration_mixin.0.dart create mode 100644 examples/api/lib/widgets/scrollbar/raw_scrollbar.shape.0.dart diff --git a/dev/bots/analyze_sample_code.dart b/dev/bots/analyze_sample_code.dart index faa2acf750..73669aabf7 100644 --- a/dev/bots/analyze_sample_code.dart +++ b/dev/bots/analyze_sample_code.dart @@ -19,7 +19,7 @@ import 'package:path/path.dart' as path; import 'package:watcher/watcher.dart'; // If you update this version, also update it in dev/bots/docs.sh -const String _snippetsActivateVersion = '0.2.3'; +const String _snippetsActivateVersion = '0.2.5'; final String _flutterRoot = path.dirname(path.dirname(path.dirname(path.fromUri(Platform.script)))); final String _defaultFlutterPackage = path.join(_flutterRoot, 'packages', 'flutter', 'lib'); diff --git a/dev/bots/docs.sh b/dev/bots/docs.sh index bd8a5188ac..49029483c3 100755 --- a/dev/bots/docs.sh +++ b/dev/bots/docs.sh @@ -26,7 +26,7 @@ function generate_docs() { # assets-for-api-docs repo: # https://github.com/flutter/assets-for-api-docs/tree/master/packages/snippets # >>> If you update this version, also update it in dev/bots/analyze_sample_code.dart <<< - "$DART" pub global activate snippets 0.2.3 + "$DART" pub global activate snippets 0.2.5 # This script generates a unified doc set, and creates # a custom index.html, placing everything into dev/docs/doc. diff --git a/examples/api/lib/animation/curves/curve2_d.0.dart b/examples/api/lib/animation/curves/curve2_d.0.dart index 9ca455a60a..367862b6ac 100644 --- a/examples/api/lib/animation/curves/curve2_d.0.dart +++ b/examples/api/lib/animation/curves/curve2_d.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Curve2D -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to use a [Curve2D] to modify the position of a widget -// so that it can follow an arbitrary path. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,9 +22,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - // This is the path that the child will follow. It's a CatmullRomSpline so // that the coordinates can be specified that it must pass through. If the // tension is set to 1.0, it will linearly interpolate between those points, @@ -115,17 +97,10 @@ class _FollowCurve2DState extends State } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Container( color: Colors.white, @@ -144,8 +119,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/cupertino/context_menu/cupertino_context_menu.0.dart b/examples/api/lib/cupertino/context_menu/cupertino_context_menu.0.dart index 73b5e752ac..314069514e 100644 --- a/examples/api/lib/cupertino/context_menu/cupertino_context_menu.0.dart +++ b/examples/api/lib/cupertino/context_menu/cupertino_context_menu.0.dart @@ -2,35 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for CupertinoContextMenu -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows a very simple CupertinoContextMenu for an empty red -// 100x100 Container. Simply long press on it to open. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/cupertino.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -45,14 +24,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( body: Center( @@ -82,8 +57,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/cupertino/nav_bar/cupertino_navigation_bar.0.dart b/examples/api/lib/cupertino/nav_bar/cupertino_navigation_bar.0.dart index 7b3740769e..5b6f7474b8 100644 --- a/examples/api/lib/cupertino/nav_bar/cupertino_navigation_bar.0.dart +++ b/examples/api/lib/cupertino/nav_bar/cupertino_navigation_bar.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_cupertino.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for CupertinoNavigationBar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a [CupertinoNavigationBar] placed in a [CupertinoPageScaffold]. -// Since [backgroundColor]'s opacity is not 1.0, there is a blur effect and -// content slides underneath. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/cupertino.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -38,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -46,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - @override Widget build(BuildContext context) { return CupertinoPageScaffold( @@ -69,8 +48,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/cupertino/page_scaffold/cupertino_page_scaffold.0.dart b/examples/api/lib/cupertino/page_scaffold/cupertino_page_scaffold.0.dart index 42903e90ce..bc78fb06fe 100644 --- a/examples/api/lib/cupertino/page_scaffold/cupertino_page_scaffold.0.dart +++ b/examples/api/lib/cupertino/page_scaffold/cupertino_page_scaffold.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_cupertino.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for CupertinoPageScaffold -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a [CupertinoPageScaffold] with a [ListView] as a [child]. -// The [CupertinoButton] is connected to a callback that increments a counter. -// The [backgroundColor] can be changed. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/cupertino.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -38,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -46,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int _count = 0; @override @@ -74,8 +53,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/cupertino/refresh/cupertino_sliver_refresh_control.0.dart b/examples/api/lib/cupertino/refresh/cupertino_sliver_refresh_control.0.dart index ed1248cef3..4ba371a63d 100644 --- a/examples/api/lib/cupertino/refresh/cupertino_sliver_refresh_control.0.dart +++ b/examples/api/lib/cupertino/refresh/cupertino_sliver_refresh_control.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_cupertino.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for CupertinoSliverRefreshControl -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// When the user scrolls past [refreshTriggerPullDistance], -// this sample shows the default iOS pull to refresh indicator for 1 second and -// adds a new item to the top of the list view. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/cupertino.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -38,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -46,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - List colors = [ CupertinoColors.systemYellow, CupertinoColors.systemOrange, @@ -98,8 +77,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/cupertino/route/show_cupertino_dialog.0.dart b/examples/api/lib/cupertino/route/show_cupertino_dialog.0.dart index 721e7325be..94d6600e4e 100644 --- a/examples/api/lib/cupertino/route/show_cupertino_dialog.0.dart +++ b/examples/api/lib/cupertino/route/show_cupertino_dialog.0.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_restoration_cupertino.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for showCupertinoDialog -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample demonstrates how to create a restorable Cupertino dialog. This is -// accomplished by enabling state restoration by specifying -// [CupertinoApp.restorationScopeId] and using [Navigator.restorablePush] to -// push [CupertinoDialogRoute] when the [CupertinoButton] is tapped. -// -// {@macro flutter.widgets.RestorationManager} - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/cupertino.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,14 +23,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return CupertinoPageScaffold( navigationBar: const CupertinoNavigationBar( @@ -81,8 +58,4 @@ class MyStatelessWidget extends StatelessWidget { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/cupertino/route/show_cupertino_modal_popup.0.dart b/examples/api/lib/cupertino/route/show_cupertino_modal_popup.0.dart index 2148565b3f..f5086f6fae 100644 --- a/examples/api/lib/cupertino/route/show_cupertino_modal_popup.0.dart +++ b/examples/api/lib/cupertino/route/show_cupertino_modal_popup.0.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_restoration_cupertino.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for showCupertinoModalPopup -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample demonstrates how to create a restorable Cupertino modal route. -// This is accomplished by enabling state restoration by specifying -// [CupertinoApp.restorationScopeId] and using [Navigator.restorablePush] to -// push [CupertinoModalPopupRoute] when the [CupertinoButton] is tapped. -// -// {@macro flutter.widgets.RestorationManager} - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/cupertino.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,14 +23,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return CupertinoPageScaffold( navigationBar: const CupertinoNavigationBar( @@ -89,8 +66,4 @@ class MyStatelessWidget extends StatelessWidget { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.0.dart b/examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.0.dart index 8cc9c656ba..3bfe42bdf8 100644 --- a/examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.0.dart +++ b/examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.0.dart @@ -2,38 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for CupertinoScrollbar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows a [CupertinoScrollbar] that fades in and out of view as scrolling occurs. -// The scrollbar will fade into view as the user scrolls, and fade out when scrolling stops. -// The `thickness` of the scrollbar will animate from 6 pixels to the `thicknessWhileDragging` of 10 -// when it is dragged by the user. The `radius` of the scrollbar thumb corners will animate from 34 -// to the `radiusWhileDragging` of 0 when the scrollbar is being dragged by the user. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/cupertino.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -51,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - @override Widget build(BuildContext context) { return CupertinoScrollbar( @@ -76,8 +48,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.1.dart b/examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.1.dart index 7abe4cdc9a..3297223001 100644 --- a/examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.1.dart +++ b/examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.1.dart @@ -2,36 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for CupertinoScrollbar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// When `isAlwaysShown` is true, the scrollbar thumb will remain visible without the -// fade animation. This requires that a [ScrollController] is provided to controller, -// or that the [PrimaryScrollController] is available. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/cupertino.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -49,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -57,11 +34,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final ScrollController _controllerOne = ScrollController(); @override @@ -84,8 +57,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/cupertino/text_form_field_row/cupertino_text_form_field_row.1.dart b/examples/api/lib/cupertino/text_form_field_row/cupertino_text_form_field_row.1.dart index 0bca5434f1..fdf1000230 100644 --- a/examples/api/lib/cupertino/text_form_field_row/cupertino_text_form_field_row.1.dart +++ b/examples/api/lib/cupertino/text_form_field_row/cupertino_text_form_field_row.1.dart @@ -2,35 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for CupertinoTextFormFieldRow -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to move the focus to the next field when the user -// presses the SPACE key. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/cupertino.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -45,7 +24,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -53,11 +31,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - @override Widget build(BuildContext context) { return CupertinoPageScaffold( @@ -86,8 +60,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/gestures/pointer_signal_resolver/pointer_signal_resolver.0.dart b/examples/api/lib/gestures/pointer_signal_resolver/pointer_signal_resolver.0.dart index d04aaf91c7..3831047f6a 100644 --- a/examples/api/lib/gestures/pointer_signal_resolver/pointer_signal_resolver.0.dart +++ b/examples/api/lib/gestures/pointer_signal_resolver/pointer_signal_resolver.0.dart @@ -2,45 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for PointerSignalResolver -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is an example that demonstrates the effect of not using the resolver -// versus using it. -// -// When this example is set to _not_ use the resolver, then triggering the -// mouse wheel over the outer box will cause only the outer box to change -// color, but triggering the mouse wheel over the inner box will cause _both_ -// the outer and the inner boxes to change color (because they're both -// receiving the event). -// -// When this example is set to _use_ the resolver, then only the box located -// directly under the cursor will change color when the mouse wheel is -// triggered. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/gestures.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -55,9 +24,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class ColorChanger extends StatefulWidget { const ColorChanger({ Key? key, @@ -119,10 +85,6 @@ class _ColorChangerState extends State { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -130,11 +92,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool useResolver = false; @override @@ -179,8 +137,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/about/about_list_tile.0.dart b/examples/api/lib/material/about/about_list_tile.0.dart index 6c3906fcee..663eb163b8 100644 --- a/examples/api/lib/material/about/about_list_tile.0.dart +++ b/examples/api/lib/material/about/about_list_tile.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AboutListTile -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows two ways to open [AboutDialog]. The first one -// uses an [AboutListTile], and the second uses the [showAboutDialog] function. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { final ThemeData theme = Theme.of(context); final TextStyle textStyle = theme.textTheme.bodyText2!; @@ -102,8 +83,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/app_bar/app_bar.0.dart b/examples/api/lib/material/app_bar/app_bar.0.dart index cb168a44ce..1d436c7313 100644 --- a/examples/api/lib/material/app_bar/app_bar.0.dart +++ b/examples/api/lib/material/app_bar/app_bar.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AppBar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows an [AppBar] with two simple actions. The first action -// opens a [SnackBar], while the second action navigates to a new page. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( appBar: AppBar( @@ -89,8 +70,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/app_bar/app_bar.1.dart b/examples/api/lib/material/app_bar/app_bar.1.dart index 279c75b309..5522382839 100644 --- a/examples/api/lib/material/app_bar/app_bar.1.dart +++ b/examples/api/lib/material/app_bar/app_bar.1.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AppBar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -36,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { final ButtonStyle style = TextButton.styleFrom(primary: Theme.of(context).colorScheme.onPrimary); @@ -64,8 +46,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/app_bar/sliver_app_bar.1.dart b/examples/api/lib/material/app_bar/sliver_app_bar.1.dart index 31e2f64520..59eccf0f52 100644 --- a/examples/api/lib/material/app_bar/sliver_app_bar.1.dart +++ b/examples/api/lib/material/app_bar/sliver_app_bar.1.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SliverAppBar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows a [SliverAppBar] and it's behavior when using the -// [pinned], [snap] and [floating] parameters. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -45,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool _pinned = true; bool _snap = false; bool _floating = false; @@ -152,8 +132,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/autocomplete/autocomplete.0.dart b/examples/api/lib/material/autocomplete/autocomplete.0.dart index 3275c2e2b9..7f89258a3d 100644 --- a/examples/api/lib/material/autocomplete/autocomplete.0.dart +++ b/examples/api/lib/material/autocomplete/autocomplete.0.dart @@ -2,24 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Autocomplete -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to create a very basic Autocomplete widget using the -// default UI. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//************************************************************************* -//* ▼▼▼▼▼▼▼▼ code-main ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; @@ -69,6 +52,3 @@ class AutocompleteBasicExample extends StatelessWidget { ); } } - -//* ▲▲▲▲▲▲▲▲ code-main ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//************************************************************************* diff --git a/examples/api/lib/material/autocomplete/autocomplete.1.dart b/examples/api/lib/material/autocomplete/autocomplete.1.dart index 3a3c6cb1cc..497e692d40 100644 --- a/examples/api/lib/material/autocomplete/autocomplete.1.dart +++ b/examples/api/lib/material/autocomplete/autocomplete.1.dart @@ -2,24 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Autocomplete -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to create an Autocomplete widget with a custom type. -// Try searching with text from the name or email field. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//************************************************************************* -//* ▼▼▼▼▼▼▼▼ code-main ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; @@ -101,6 +84,3 @@ class AutocompleteBasicUserExample extends StatelessWidget { ); } } - -//* ▲▲▲▲▲▲▲▲ code-main ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//************************************************************************* diff --git a/examples/api/lib/material/banner/material_banner.0.dart b/examples/api/lib/material/banner/material_banner.0.dart index dedd2d376a..934d7f73f7 100644 --- a/examples/api/lib/material/banner/material_banner.0.dart +++ b/examples/api/lib/material/banner/material_banner.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for MaterialBanner -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Banners placed directly into the widget tree are static. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -36,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( appBar: AppBar( @@ -67,8 +49,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/banner/material_banner.1.dart b/examples/api/lib/material/banner/material_banner.1.dart index 9ff96d7b1a..fdfc513097 100644 --- a/examples/api/lib/material/banner/material_banner.1.dart +++ b/examples/api/lib/material/banner/material_banner.1.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for MaterialBanner -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// MaterialBanner's can also be presented through a [ScaffoldMessenger]. -// Here is an example where ScaffoldMessengerState.showMaterialBanner() is used to show the MaterialBanner. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( appBar: AppBar( @@ -71,8 +52,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/bottom_app_bar/bottom_app_bar.1.dart b/examples/api/lib/material/bottom_app_bar/bottom_app_bar.1.dart index 43f512805c..51312205a9 100644 --- a/examples/api/lib/material/bottom_app_bar/bottom_app_bar.1.dart +++ b/examples/api/lib/material/bottom_app_bar/bottom_app_bar.1.dart @@ -2,34 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for BottomAppBar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows the [BottomAppBar], which can be configured to have a notch using the -// [BottomAppBar.shape] property. This also includes an optional [FloatingActionButton], which illustrates -// the [FloatingActionButtonLocation]s in relation to the [BottomAppBar]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - void main() { runApp(const BottomAppBarDemo()); } @@ -181,6 +157,3 @@ class _DemoBottomAppBar extends StatelessWidget { ); } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.0.dart b/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.0.dart index a84ad21444..629249aa61 100644 --- a/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.0.dart +++ b/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.0.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for BottomNavigationBar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a [BottomNavigationBar] as it is used within a [Scaffold] -// widget. The [BottomNavigationBar] has three [BottomNavigationBarItem] -// widgets, which means it defaults to [BottomNavigationBarType.fixed], and -// the [currentIndex] is set to index 0. The selected item is -// amber. The `_onItemTapped` function changes the selected item's index -// and displays a corresponding message in the center of the [Scaffold]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -49,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int _selectedIndex = 0; static const TextStyle optionStyle = TextStyle(fontSize: 30, fontWeight: FontWeight.bold); @@ -108,8 +84,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.1.dart b/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.1.dart index 8aa61241d5..c7d3662db3 100644 --- a/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.1.dart +++ b/examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.1.dart @@ -2,34 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for BottomNavigationBar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a [BottomNavigationBar] as it is used within a [Scaffold] -// widget. The [BottomNavigationBar] has four [BottomNavigationBarItem] -// widgets, which means it defaults to [BottomNavigationBarType.shifting], and -// the [currentIndex] is set to index 0. The selected item is amber in color. -// With each [BottomNavigationBarItem] widget, backgroundColor property is -// also defined, which changes the background color of [BottomNavigationBar], -// when that item is selected. The `_onItemTapped` function changes the -// selected item's index and displays a corresponding message in the center of -// the [Scaffold]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -44,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -52,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int _selectedIndex = 0; static const TextStyle optionStyle = TextStyle(fontSize: 30, fontWeight: FontWeight.bold); @@ -123,8 +96,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.0.dart b/examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.0.dart index 7cae3c786c..ae6e4800e4 100644 --- a/examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.0.dart +++ b/examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for showModalBottomSheet -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example demonstrates how to use `showModalBottomSheet` to display a -// bottom sheet that obscures the content behind it when a user taps a button. -// It also demonstrates how to close the bottom sheet using the [Navigator] -// when a user taps on a button inside the bottom sheet. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Center( child: ElevatedButton( @@ -81,8 +60,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/card/card.0.dart b/examples/api/lib/material/card/card.0.dart index abafd5c83b..96ef832790 100644 --- a/examples/api/lib/material/card/card.0.dart +++ b/examples/api/lib/material/card/card.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Card -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows creation of a [Card] widget that shows album information -// and two actions. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Center( child: Card( @@ -79,8 +60,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/card/card.1.dart b/examples/api/lib/material/card/card.1.dart index 09ccd12aa5..5a3038cd88 100644 --- a/examples/api/lib/material/card/card.1.dart +++ b/examples/api/lib/material/card/card.1.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Card -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows creation of a [Card] widget that can be tapped. When -// tapped this [Card]'s [InkWell] displays an "ink splash" that fills the -// entire card. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Center( child: Card( @@ -66,8 +46,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/checkbox/checkbox.0.dart b/examples/api/lib/material/checkbox/checkbox.0.dart index c5a4a90c10..134fd9e642 100644 --- a/examples/api/lib/material/checkbox/checkbox.0.dart +++ b/examples/api/lib/material/checkbox/checkbox.0.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Checkbox -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how you can override the default theme of -// of a [Checkbox] with a [MaterialStateProperty]. -// In this example, the checkbox's color will be `Colors.blue` when the [Checkbox] -// is being pressed, hovered, or focused. Otherwise, the checkbox's color will -// be `Colors.red`. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -45,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -53,11 +34,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool isChecked = false; @override @@ -85,8 +62,4 @@ class _MyStatefulWidgetState extends State { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.0.dart b/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.0.dart index b4252ad7c7..b1e15de6a7 100644 --- a/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.0.dart +++ b/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.0.dart @@ -2,39 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for CheckboxListTile -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// ![CheckboxListTile sample](https://flutter.github.io/assets-for-api-docs/assets/material/checkbox_list_tile.png) -// -// This widget shows a checkbox that, when checked, slows down all animations -// (including the animation of the checkbox itself getting checked!). -// -// This sample requires that you also import 'package:flutter/scheduler.dart', -// so that you can reference [timeDilation]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - import 'package:flutter/scheduler.dart' show timeDilation; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -54,7 +28,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -62,11 +35,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - @override Widget build(BuildContext context) { return CheckboxListTile( @@ -80,8 +49,4 @@ class _MyStatefulWidgetState extends State { secondary: const Icon(Icons.hourglass_empty), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.1.dart b/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.1.dart index 98858387e3..78319e8bf9 100644 --- a/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.1.dart +++ b/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.1.dart @@ -2,38 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for CheckboxListTile -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// ![Checkbox list tile semantics sample](https://flutter.github.io/assets-for-api-docs/assets/material/checkbox_list_tile_semantics.png) -// -// Here is an example of a custom labeled checkbox widget, called -// LinkedLabelCheckbox, that includes an interactive [RichText] widget that -// handles tap gestures. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/gestures.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -53,9 +29,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class LinkedLabelCheckbox extends StatelessWidget { const LinkedLabelCheckbox({ Key? key, @@ -103,10 +76,6 @@ class LinkedLabelCheckbox extends StatelessWidget { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -114,11 +83,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool _isSelected = false; @override @@ -134,8 +99,4 @@ class _MyStatefulWidgetState extends State { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.2.dart b/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.2.dart index 3b06398133..c8a966fb0c 100644 --- a/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.2.dart +++ b/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.2.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for CheckboxListTile -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// ![Custom checkbox list tile sample](https://flutter.github.io/assets-for-api-docs/assets/material/checkbox_list_tile_custom.png) -// -// Here is an example of a custom LabeledCheckbox widget, but you can easily -// make your own configurable widget. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -44,9 +27,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class LabeledCheckbox extends StatelessWidget { const LabeledCheckbox({ Key? key, @@ -85,10 +65,6 @@ class LabeledCheckbox extends StatelessWidget { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -96,11 +72,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool _isSelected = false; @override @@ -116,8 +88,4 @@ class _MyStatefulWidgetState extends State { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/chip/deletable_chip_attributes.on_deleted.0.dart b/examples/api/lib/material/chip/deletable_chip_attributes.on_deleted.0.dart index 816c0b9450..67a6f6fb4c 100644 --- a/examples/api/lib/material/chip/deletable_chip_attributes.on_deleted.0.dart +++ b/examples/api/lib/material/chip/deletable_chip_attributes.on_deleted.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for DeletableChipAttributes.onDeleted -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows how to use [onDeleted] to remove an entry when the -// delete button is tapped. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,9 +27,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class Actor { const Actor(this.name, this.initials); final String name; @@ -93,10 +75,6 @@ class CastListState extends State { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -104,17 +82,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - @override Widget build(BuildContext context) { return const CastList(); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/data_table/data_table.0.dart b/examples/api/lib/material/data_table/data_table.0.dart index 9df66572bb..eb2167aee2 100644 --- a/examples/api/lib/material/data_table/data_table.0.dart +++ b/examples/api/lib/material/data_table/data_table.0.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for DataTable -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows how to display a [DataTable] with three columns: name, age, and -// role. The columns are defined by three [DataColumn] objects. The table -// contains three rows of data for three example users, the data for which -// is defined by three [DataRow] objects. -// -// ![](https://flutter.github.io/assets-for-api-docs/assets/material/data_table.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -44,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return DataTable( columns: const [ @@ -99,8 +76,4 @@ class MyStatelessWidget extends StatelessWidget { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/data_table/data_table.1.dart b/examples/api/lib/material/data_table/data_table.1.dart index 454c24857d..381fd85641 100644 --- a/examples/api/lib/material/data_table/data_table.1.dart +++ b/examples/api/lib/material/data_table/data_table.1.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for DataTable -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows how to display a [DataTable] with alternate colors per -// row, and a custom color for when the row is selected. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -48,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - static const int numItems = 10; List selected = List.generate(numItems, (int index) => false); @@ -93,8 +73,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/date_picker/show_date_picker.0.dart b/examples/api/lib/material/date_picker/show_date_picker.0.dart index 09403e3a82..73cb2c33aa 100644 --- a/examples/api/lib/material/date_picker/show_date_picker.0.dart +++ b/examples/api/lib/material/date_picker/show_date_picker.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_restoration_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for showDatePicker -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample demonstrates how to create a restorable Material date picker. -// This is accomplished by enabling state restoration by specifying -// [MaterialApp.restorationScopeId] and using [Navigator.restorablePush] to -// push [DatePickerDialog] when the button is tapped. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,7 +23,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key, this.restorationId}) : super(key: key); @@ -50,7 +32,6 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// RestorationProperty objects can be used because of RestorationMixin. class _MyStatefulWidgetState extends State with RestorationMixin { @@ -59,9 +40,6 @@ class _MyStatefulWidgetState extends State @override String? get restorationId => widget.restorationId; -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final RestorableDateTime _selectedDate = RestorableDateTime(DateTime(2021, 7, 25)); late final RestorableRouteFuture _restorableDatePickerRouteFuture = @@ -125,8 +103,4 @@ class _MyStatefulWidgetState extends State ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/date_picker/show_date_range_picker.0.dart b/examples/api/lib/material/date_picker/show_date_range_picker.0.dart index 7deac2c22b..62a96eca14 100644 --- a/examples/api/lib/material/date_picker/show_date_range_picker.0.dart +++ b/examples/api/lib/material/date_picker/show_date_range_picker.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_restoration_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for showDateRangePicker -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample demonstrates how to create a restorable Material date range picker. -// This is accomplished by enabling state restoration by specifying -// [MaterialApp.restorationScopeId] and using [Navigator.restorablePush] to -// push [DateRangePickerDialog] when the button is tapped. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,7 +23,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key, this.restorationId}) : super(key: key); @@ -50,7 +32,6 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// RestorationProperty objects can be used because of RestorationMixin. class _MyStatefulWidgetState extends State with RestorationMixin { @@ -59,9 +40,6 @@ class _MyStatefulWidgetState extends State @override String? get restorationId => widget.restorationId; -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final RestorableDateTimeN _startDate = RestorableDateTimeN(DateTime(2021, 1, 1)); final RestorableDateTimeN _endDate = @@ -142,8 +120,4 @@ class _MyStatefulWidgetState extends State ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/dialog/alert_dialog.1.dart b/examples/api/lib/material/dialog/alert_dialog.1.dart index 98c7e1beb6..4e552474d3 100644 --- a/examples/api/lib/material/dialog/alert_dialog.1.dart +++ b/examples/api/lib/material/dialog/alert_dialog.1.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AlertDialog -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This demo shows a [TextButton] which when pressed, calls [showDialog]. When called, this method -// displays a Material dialog above the current contents of the app and returns -// a [Future] that completes when the dialog is dismissed. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -43,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return TextButton( onPressed: () => showDialog( @@ -73,8 +53,4 @@ class MyStatelessWidget extends StatelessWidget { child: const Text('Show Dialog'), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/dialog/show_dialog.0.dart b/examples/api/lib/material/dialog/show_dialog.0.dart index 0e44b63bfa..262c2d61a9 100644 --- a/examples/api/lib/material/dialog/show_dialog.0.dart +++ b/examples/api/lib/material/dialog/show_dialog.0.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_restoration_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for showDialog -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample demonstrates how to create a restorable Material dialog. This is -// accomplished by enabling state restoration by specifying -// [MaterialApp.restorationScopeId] and using [Navigator.restorablePush] to -// push [DialogRoute] when the button is tapped. -// -// {@macro flutter.widgets.RestorationManager} - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,14 +23,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( body: Center( @@ -71,8 +48,4 @@ class MyStatelessWidget extends StatelessWidget { const AlertDialog(title: Text('Material Alert!')), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/divider/divider.0.dart b/examples/api/lib/material/divider/divider.0.dart index e38b8fa82d..bc1402bdf3 100644 --- a/examples/api/lib/material/divider/divider.0.dart +++ b/examples/api/lib/material/divider/divider.0.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Divider -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows how to display a Divider between an orange and blue box -// inside a column. The Divider is 20 logical pixels in height and contains a -// vertically centered black line that is 5 logical pixels thick. The black -// line is indented by 20 logical pixels. -// -// ![](https://flutter.github.io/assets-for-api-docs/assets/material/divider.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -44,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Center( child: Column( @@ -96,8 +73,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/divider/vertical_divider.0.dart b/examples/api/lib/material/divider/vertical_divider.0.dart index d8f0cda59a..65a29b8988 100644 --- a/examples/api/lib/material/divider/vertical_divider.0.dart +++ b/examples/api/lib/material/divider/vertical_divider.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for VerticalDivider -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows how to display a [VerticalDivider] between a purple and orange box -// inside a [Row]. The [VerticalDivider] is 20 logical pixels in width and contains a -// horizontally centered black line that is 1 logical pixels thick. The grey -// line is indented by 20 logical pixels. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Container( padding: const EdgeInsets.all(10), @@ -82,8 +61,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/dropdown/dropdown_button.0.dart b/examples/api/lib/material/dropdown/dropdown_button.0.dart index 98327b766b..3ceb1a1cfa 100644 --- a/examples/api/lib/material/dropdown/dropdown_button.0.dart +++ b/examples/api/lib/material/dropdown/dropdown_button.0.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for DropdownButton -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows a `DropdownButton` with a large arrow icon, -// purple text style, and bold purple underline, whose value is one of "One", -// "Two", "Free", or "Four". -// -// ![](https://flutter.github.io/assets-for-api-docs/assets/material/dropdown_button.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -45,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -53,11 +34,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - String dropdownValue = 'One'; @override @@ -86,8 +63,4 @@ class _MyStatefulWidgetState extends State { }).toList(), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/dropdown/dropdown_button.selected_item_builder.0.dart b/examples/api/lib/material/dropdown/dropdown_button.selected_item_builder.0.dart index ebd4982e66..a0175858f7 100644 --- a/examples/api/lib/material/dropdown/dropdown_button.selected_item_builder.0.dart +++ b/examples/api/lib/material/dropdown/dropdown_button.selected_item_builder.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for DropdownButton.selectedItemBuilder -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows a `DropdownButton` with a button with [Text] that -// corresponds to but is unique from [DropdownMenuItem]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -48,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final List items = ['1', '2', '3']; String selectedItem = '1'; @@ -77,8 +57,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/dropdown/dropdown_button.style.0.dart b/examples/api/lib/material/dropdown/dropdown_button.style.0.dart index 1776848558..a544695287 100644 --- a/examples/api/lib/material/dropdown/dropdown_button.style.0.dart +++ b/examples/api/lib/material/dropdown/dropdown_button.style.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for DropdownButton.style -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows a `DropdownButton` with a dropdown button text style -// that is different than its menu items. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -48,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - List options = ['One', 'Two', 'Free', 'Four']; String dropdownValue = 'One'; @@ -86,8 +66,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/elevated_button/elevated_button.0.dart b/examples/api/lib/material/elevated_button/elevated_button.0.dart index a87dc98ae7..a827d4d173 100644 --- a/examples/api/lib/material/elevated_button/elevated_button.0.dart +++ b/examples/api/lib/material/elevated_button/elevated_button.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ElevatedButton -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample produces an enabled and a disabled ElevatedButton. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -47,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - @override Widget build(BuildContext context) { final ButtonStyle style = @@ -76,8 +57,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/expansion_panel/expansion_panel_list.0.dart b/examples/api/lib/material/expansion_panel/expansion_panel_list.0.dart index 54335dcb44..0cc5fd3c59 100644 --- a/examples/api/lib/material/expansion_panel/expansion_panel_list.0.dart +++ b/examples/api/lib/material/expansion_panel/expansion_panel_list.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ExpansionPanelList -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is a simple example of how to implement ExpansionPanelList. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,9 +25,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - // stores ExpansionPanel state information class Item { Item({ @@ -64,10 +47,6 @@ List generateItems(int numberOfItems) { }); } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -75,11 +54,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final List _data = generateItems(8); @override @@ -120,8 +95,4 @@ class _MyStatefulWidgetState extends State { }).toList(), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/expansion_panel/expansion_panel_list.expansion_panel_list_radio.0.dart b/examples/api/lib/material/expansion_panel/expansion_panel_list.expansion_panel_list_radio.0.dart index 7c68edd189..5e295a7319 100644 --- a/examples/api/lib/material/expansion_panel/expansion_panel_list.expansion_panel_list_radio.0.dart +++ b/examples/api/lib/material/expansion_panel/expansion_panel_list.expansion_panel_list_radio.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ExpansionPanelList.ExpansionPanelList.radio -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is a simple example of how to implement ExpansionPanelList.radio. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,9 +25,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - // stores ExpansionPanel state information class Item { Item({ @@ -65,10 +48,6 @@ List generateItems(int numberOfItems) { }); } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -76,11 +55,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final List _data = generateItems(8); @override @@ -117,8 +92,4 @@ class _MyStatefulWidgetState extends State { }).toList(), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/expansion_tile/expansion_tile.0.dart b/examples/api/lib/material/expansion_tile/expansion_tile.0.dart index 9ac967e09d..e49bdf7ad5 100644 --- a/examples/api/lib/material/expansion_tile/expansion_tile.0.dart +++ b/examples/api/lib/material/expansion_tile/expansion_tile.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ExpansionTile -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example demonstrates different configurations of ExpansionTile. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -47,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool _customTileExpanded = false; @override @@ -91,8 +72,4 @@ class _MyStatefulWidgetState extends State { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/flexible_space_bar/flexible_space_bar.0.dart b/examples/api/lib/material/flexible_space_bar/flexible_space_bar.0.dart index beff081730..480ddfea49 100644 --- a/examples/api/lib/material/flexible_space_bar/flexible_space_bar.0.dart +++ b/examples/api/lib/material/flexible_space_bar/flexible_space_bar.0.dart @@ -2,37 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for FlexibleSpaceBar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample application demonstrates the different features of the -// [FlexibleSpaceBar] when used in a [SliverAppBar]. This app bar is configured -// to stretch into the overscroll space, and uses the -// [FlexibleSpaceBar.stretchModes] to apply `fadeTitle`, `blurBackground` and -// `zoomBackground`. The app bar also makes use of [CollapseMode.parallax] by -// default. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - void main() => runApp(const MaterialApp(home: MyApp())); class MyApp extends StatelessWidget { @@ -105,6 +78,3 @@ class MyApp extends StatelessWidget { ); } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/material/floating_action_button/floating_action_button.0.dart b/examples/api/lib/material/floating_action_button/floating_action_button.0.dart index e515da123d..77eefc2ae9 100644 --- a/examples/api/lib/material/floating_action_button/floating_action_button.0.dart +++ b/examples/api/lib/material/floating_action_button/floating_action_button.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for FloatingActionButton -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to display a [FloatingActionButton] in a -// [Scaffold], with a pink [backgroundColor] and a thumbs up [Icon]. -// -// ![](https://flutter.github.io/assets-for-api-docs/assets/material/floating_action_button.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( appBar: AppBar( @@ -62,8 +41,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/floating_action_button/floating_action_button.1.dart b/examples/api/lib/material/floating_action_button/floating_action_button.1.dart index 81b99e665a..ccba7cce18 100644 --- a/examples/api/lib/material/floating_action_button/floating_action_button.1.dart +++ b/examples/api/lib/material/floating_action_button/floating_action_button.1.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for FloatingActionButton -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to make an extended [FloatingActionButton] in a -// [Scaffold], with a pink [backgroundColor], a thumbs up [Icon] and a -// [Text] label that reads "Approve". -// -// ![](https://flutter.github.io/assets-for-api-docs/assets/material/floating_action_button_label.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( appBar: AppBar( @@ -66,8 +44,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/floating_action_button_location/standard_fab_location.0.dart b/examples/api/lib/material/floating_action_button_location/standard_fab_location.0.dart index 13b1ff996a..db5fc0faf4 100644 --- a/examples/api/lib/material/floating_action_button_location/standard_fab_location.0.dart +++ b/examples/api/lib/material/floating_action_button_location/standard_fab_location.0.dart @@ -2,36 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for StandardFabLocation -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This is an example of a user-defined [FloatingActionButtonLocation]. -// -// The example shows a [Scaffold] with an [AppBar], a [BottomAppBar], and a -// [FloatingActionButton] using a custom [FloatingActionButtonLocation]. -// -// The new [FloatingActionButtonLocation] is defined -// by extending [StandardFabLocation] with two mixins, -// [FabEndOffsetX] and [FabFloatOffsetY], and overriding the -// [getOffsetX] method to adjust the FAB's x-coordinate, creating a -// [FloatingActionButtonLocation] slightly different from -// [FloatingActionButtonLocation.endFloat]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -46,9 +22,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class AlmostEndFloatFabLocation extends StandardFabLocation with FabEndOffsetX, FabFloatOffsetY { @override @@ -61,17 +34,10 @@ class AlmostEndFloatFabLocation extends StandardFabLocation } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( appBar: AppBar( @@ -87,8 +53,4 @@ class MyStatelessWidget extends StatelessWidget { floatingActionButtonLocation: AlmostEndFloatFabLocation(), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/icon_button/icon_button.0.dart b/examples/api/lib/material/icon_button/icon_button.0.dart index 83ac1954ee..9180f15ac7 100644 --- a/examples/api/lib/material/icon_button/icon_button.0.dart +++ b/examples/api/lib/material/icon_button/icon_button.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for IconButton -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows an `IconButton` that uses the Material icon "volume_up" to -// increase the volume. -// -// ![](https://flutter.github.io/assets-for-api-docs/assets/material/icon_button.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -44,15 +27,8 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - double _volume = 0.0; -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -60,11 +36,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - @override Widget build(BuildContext context) { return Column( @@ -83,8 +55,4 @@ class _MyStatefulWidgetState extends State { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/icon_button/icon_button.1.dart b/examples/api/lib/material/icon_button/icon_button.1.dart index 1e9df6ea6c..f88848a926 100644 --- a/examples/api/lib/material/icon_button/icon_button.1.dart +++ b/examples/api/lib/material/icon_button/icon_button.1.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for IconButton -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// In this sample the icon button's background color is defined with an [Ink] -// widget whose child is an [IconButton]. The icon button's filled background -// is a light shade of blue, it's a filled circle, and it's as big as the -// button is. -// -// ![](https://flutter.github.io/assets-for-api-docs/assets/material/icon_button_background.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -44,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - @override Widget build(BuildContext context) { return Material( @@ -71,8 +48,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/ink_well/ink_well.0.dart b/examples/api/lib/material/ink_well/ink_well.0.dart index 62dfdfd6ab..1bc2d28089 100644 --- a/examples/api/lib/material/ink_well/ink_well.0.dart +++ b/examples/api/lib/material/ink_well/ink_well.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for InkWell -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Tap the container to cause it to grow. Then, tap it again and hold before -// the widget reaches its maximum size to observe the clipped ink splash. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -50,11 +34,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - double sideLength = 50; @override @@ -76,8 +56,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/input_decorator/input_decoration.0.dart b/examples/api/lib/material/input_decorator/input_decoration.0.dart index 7b1bb00743..1fbe1f9cd6 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.0.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.0.dart @@ -2,32 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for InputDecoration -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows how to style a `TextField` using an `InputDecorator`. The -// TextField displays a "send message" icon to the left of the input area, -// which is surrounded by a border an all sides. It displays the `hintText` -// inside the input area to help the user understand what input is required. It -// displays the `helperText` and `counterText` below the input area. -// -// ![](https://flutter.github.io/assets-for-api-docs/assets/material/input_decoration.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -45,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return const TextField( decoration: InputDecoration( @@ -64,8 +40,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/input_decorator/input_decoration.1.dart b/examples/api/lib/material/input_decorator/input_decoration.1.dart index a0368b724e..c461afccb4 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.1.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.1.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for InputDecoration -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows how to style a "collapsed" `TextField` using an -// `InputDecorator`. The collapsed `TextField` surrounds the hint text and -// input area with a border, but does not add padding around them. -// -// ![](https://flutter.github.io/assets-for-api-docs/assets/material/input_decoration_collapsed.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -43,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return const TextField( decoration: InputDecoration.collapsed( @@ -59,8 +37,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/input_decorator/input_decoration.2.dart b/examples/api/lib/material/input_decorator/input_decoration.2.dart index a04d025d3b..f2d025a65e 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.2.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.2.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for InputDecoration -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows how to create a `TextField` with hint text, a red border -// on all sides, and an error message. To display a red border and error -// message, provide `errorText` to the `InputDecoration` constructor. -// -// ![](https://flutter.github.io/assets-for-api-docs/assets/material/input_decoration_error.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -43,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return const TextField( decoration: InputDecoration( @@ -60,8 +38,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/input_decorator/input_decoration.3.dart b/examples/api/lib/material/input_decorator/input_decoration.3.dart index b2dd8ba32e..6098556300 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.3.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.3.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for InputDecoration -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows how to style a `TextField` with a round border and -// additional text before and after the input area. It displays "Prefix" before -// the input area, and "Suffix" after the input area. -// -// ![](https://flutter.github.io/assets-for-api-docs/assets/material/input_decoration_prefix_suffix.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -43,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return TextFormField( initialValue: 'abc', @@ -61,8 +39,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/input_decorator/input_decoration.label.0.dart b/examples/api/lib/material/input_decorator/input_decoration.label.0.dart index 93eec55771..f731640b7d 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.label.0.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.label.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for InputDecoration.label -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a `TextField` with a [Text.rich] widget as the [label]. -// The widget contains multiple [Text] widgets with different [TextStyle]'s. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return const Center( child: TextField( @@ -73,8 +54,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart b/examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart index 439dfc07cc..994dde3713 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart @@ -2,33 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for InputDecoration.prefixIconConstraints -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows the differences between two `TextField` widgets when -// [prefixIconConstraints] is set to the default value and when one is not. -// -// Note that [isDense] must be set to true to be able to -// set the constraints smaller than 48px. -// -// If null, [BoxConstraints] with a minimum width and height of 48px is -// used. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -46,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), @@ -82,8 +57,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart b/examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart index 231c95fae6..795df5ba1d 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart @@ -2,33 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for InputDecoration.suffixIconConstraints -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows the differences between two `TextField` widgets when -// [suffixIconConstraints] is set to the default value and when one is not. -// -// Note that [isDense] must be set to true to be able to -// set the constraints smaller than 48px. -// -// If null, [BoxConstraints] with a minimum width and height of 48px is -// used. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -46,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), @@ -82,8 +57,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/list_tile/list_tile.4.dart b/examples/api/lib/material/list_tile/list_tile.4.dart index c9703c006f..16468fa4da 100644 --- a/examples/api/lib/material/list_tile/list_tile.4.dart +++ b/examples/api/lib/material/list_tile/list_tile.4.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ListTile -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is an example of a custom list item that resembles a YouTube-related -// video list item created with [Expanded] and [Container] widgets. -// -// ![Custom list item a](https://flutter.github.io/assets-for-api-docs/assets/widgets/custom_list_item_a.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,9 +25,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class CustomListItem extends StatelessWidget { const CustomListItem({ Key? key, @@ -130,17 +110,10 @@ class _VideoDescription extends StatelessWidget { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return ListView( padding: const EdgeInsets.all(8.0), @@ -165,8 +138,4 @@ class MyStatelessWidget extends StatelessWidget { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/list_tile/list_tile.5.dart b/examples/api/lib/material/list_tile/list_tile.5.dart index b777770015..6a350ebc66 100644 --- a/examples/api/lib/material/list_tile/list_tile.5.dart +++ b/examples/api/lib/material/list_tile/list_tile.5.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ListTile -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is an example of an article list item with multiline titles and -// subtitles. It utilizes [Row]s and [Column]s, as well as [Expanded] and -// [AspectRatio] widgets to organize its layout. -// -// ![Custom list item b](https://flutter.github.io/assets-for-api-docs/assets/widgets/custom_list_item_b.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -43,9 +25,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class _ArticleDescription extends StatelessWidget { const _ArticleDescription({ Key? key, @@ -171,17 +150,10 @@ class CustomListItemTwo extends StatelessWidget { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return ListView( padding: const EdgeInsets.all(10.0), @@ -210,8 +182,4 @@ class MyStatelessWidget extends StatelessWidget { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/list_tile/list_tile.selected.0.dart b/examples/api/lib/material/list_tile/list_tile.selected.0.dart index 7429b95163..79a4996762 100644 --- a/examples/api/lib/material/list_tile/list_tile.selected.0.dart +++ b/examples/api/lib/material/list_tile/list_tile.selected.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ListTile.selected -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is an example of using a [StatefulWidget] to keep track of the -// selected index, and using that to set the `selected` property on the -// corresponding [ListTile]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -49,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int _selectedIndex = 0; @override @@ -73,8 +52,4 @@ class _MyStatefulWidgetState extends State { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/material_state/material_state_border_side.0.dart b/examples/api/lib/material/material_state/material_state_border_side.0.dart index c6d329e709..4130382c94 100644 --- a/examples/api/lib/material/material_state/material_state_border_side.0.dart +++ b/examples/api/lib/material/material_state/material_state_border_side.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for MaterialStateBorderSide -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example defines a subclass of [MaterialStateBorderSide], that resolves -// to a red border side when its widget is selected. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -50,11 +34,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool isSelected = true; @override @@ -75,8 +55,4 @@ class _MyStatefulWidgetState extends State { }), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/material_state/material_state_mouse_cursor.0.dart b/examples/api/lib/material/material_state/material_state_mouse_cursor.0.dart index d3e9d5615c..d1ef717611 100644 --- a/examples/api/lib/material/material_state/material_state_mouse_cursor.0.dart +++ b/examples/api/lib/material/material_state/material_state_mouse_cursor.0.dart @@ -2,34 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for MaterialStateMouseCursor -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example defines a mouse cursor that resolves to -// [SystemMouseCursors.forbidden] when its widget is disabled. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - import 'package:flutter/rendering.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -49,9 +28,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class ListTileCursor extends MaterialStateMouseCursor { @override MouseCursor resolve(Set states) { @@ -65,17 +41,10 @@ class ListTileCursor extends MaterialStateMouseCursor { String get debugDescription => 'ListTileCursor()'; } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return ListTile( title: const Text('Disabled ListTile'), @@ -83,8 +52,4 @@ class MyStatelessWidget extends StatelessWidget { mouseCursor: ListTileCursor(), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/material_state/material_state_outlined_border.0.dart b/examples/api/lib/material/material_state/material_state_outlined_border.0.dart index e9fb8a4424..f6287e0bb7 100644 --- a/examples/api/lib/material/material_state/material_state_outlined_border.0.dart +++ b/examples/api/lib/material/material_state/material_state_outlined_border.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for MaterialStateOutlinedBorder -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example defines a subclass of [RoundedRectangleBorder] and an -// implementation of [MaterialStateOutlinedBorder], that resolves to -// [RoundedRectangleBorder] when its widget is selected. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -38,9 +22,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class SelectedBorder extends RoundedRectangleBorder implements MaterialStateOutlinedBorder { @override @@ -52,10 +33,6 @@ class SelectedBorder extends RoundedRectangleBorder } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -63,11 +40,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool isSelected = true; @override @@ -85,8 +58,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/material_state/material_state_property.0.dart b/examples/api/lib/material/material_state/material_state_property.0.dart index 57f7021987..1f189978a9 100644 --- a/examples/api/lib/material/material_state/material_state_property.0.dart +++ b/examples/api/lib/material/material_state/material_state_property.0.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for MaterialStateProperty -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how you can override the default text and icon -// color (the "foreground color") of a [TextButton] with a -// [MaterialStateProperty]. In this example, the button's text color -// will be `Colors.blue` when the button is being pressed, hovered, -// or focused. Otherwise, the text color will be `Colors.red`. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -45,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { Color getColor(Set states) { const Set interactiveStates = { @@ -74,8 +52,4 @@ class MyStatelessWidget extends StatelessWidget { child: const Text('TextButton'), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/navigation_rail/navigation_rail.0.dart b/examples/api/lib/material/navigation_rail/navigation_rail.0.dart index 2bb70b87e1..9c4ffa0622 100644 --- a/examples/api/lib/material/navigation_rail/navigation_rail.0.dart +++ b/examples/api/lib/material/navigation_rail/navigation_rail.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for NavigationRail -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a [NavigationRail] used within a Scaffold with 3 -// [NavigationRailDestination]s. The main content is separated by a divider -// (although elevation on the navigation rail can be used instead). The -// `_selectedIndex` is updated by the `onDestinationSelected` callback. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -47,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int _selectedIndex = 0; @override @@ -96,8 +74,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/navigation_rail/navigation_rail.extended_animation.0.dart b/examples/api/lib/material/navigation_rail/navigation_rail.extended_animation.0.dart index 212718bc8c..38763c1414 100644 --- a/examples/api/lib/material/navigation_rail/navigation_rail.extended_animation.0.dart +++ b/examples/api/lib/material/navigation_rail/navigation_rail.extended_animation.0.dart @@ -2,47 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for NavigationRail.extendedAnimation -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to use this animation to create a [FloatingActionButton] -// that animates itself between the normal and extended states of the -// [NavigationRail]. -// -// An instance of `MyNavigationRailFab` is created for [NavigationRail.leading]. -// Pressing the FAB button toggles the "extended" state of the [NavigationRail]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//******************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-dartImports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'dart:ui'; -//* ▲▲▲▲▲▲▲▲ code-dartImports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************************** - import 'package:flutter/material.dart'; -//******************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-main ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - void main() => runApp(const MyApp()); -//* ▲▲▲▲▲▲▲▲ code-main ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************************** - -//******************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -119,12 +86,6 @@ class _MyNavigationRailState extends State { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************************** - -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class MyNavigationRailFab extends StatelessWidget { const MyNavigationRailFab({Key? key, this.onPressed}) : super(key: key); @@ -164,6 +125,3 @@ class MyNavigationRailFab extends StatelessWidget { ); } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/material/outlined_button/outlined_button.0.dart b/examples/api/lib/material/outlined_button/outlined_button.0.dart index c7f07350ec..c55d0edbdf 100644 --- a/examples/api/lib/material/outlined_button/outlined_button.0.dart +++ b/examples/api/lib/material/outlined_button/outlined_button.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for OutlinedButton -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is an example of a basic [OutlinedButton]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return OutlinedButton( onPressed: () { @@ -57,8 +39,4 @@ class MyStatelessWidget extends StatelessWidget { child: const Text('Click Me'), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/progress_indicator/circular_progress_indicator.0.dart b/examples/api/lib/material/progress_indicator/circular_progress_indicator.0.dart index 45b39cf86c..e07d0006c6 100644 --- a/examples/api/lib/material/progress_indicator/circular_progress_indicator.0.dart +++ b/examples/api/lib/material/progress_indicator/circular_progress_indicator.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material_ticker.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for CircularProgressIndicator -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a [CircularProgressIndicator] with a changing value. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -36,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -44,13 +29,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin. class _MyStatefulWidgetState extends State with TickerProviderStateMixin { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - late AnimationController controller; @override @@ -92,8 +73,4 @@ class _MyStatefulWidgetState extends State ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/progress_indicator/linear_progress_indicator.0.dart b/examples/api/lib/material/progress_indicator/linear_progress_indicator.0.dart index d2f0ee184e..ab70d74d8a 100644 --- a/examples/api/lib/material/progress_indicator/linear_progress_indicator.0.dart +++ b/examples/api/lib/material/progress_indicator/linear_progress_indicator.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material_ticker.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for LinearProgressIndicator -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a [LinearProgressIndicator] with a changing value. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -36,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -44,13 +29,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin. class _MyStatefulWidgetState extends State with TickerProviderStateMixin { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - late AnimationController controller; @override @@ -92,8 +73,4 @@ class _MyStatefulWidgetState extends State ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/radio/radio.0.dart b/examples/api/lib/material/radio/radio.0.dart index a814bfbdb4..ea54405389 100644 --- a/examples/api/lib/material/radio/radio.0.dart +++ b/examples/api/lib/material/radio/radio.0.dart @@ -2,39 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Radio -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is an example of Radio widgets wrapped in ListTiles, which is similar -// to what you could get with the RadioListTile widget. -// -// The currently selected character is passed into `groupValue`, which is -// maintained by the example's `State`. In this case, the first `Radio` -// will start off selected because `_character` is initialized to -// `SingingCharacter.lafayette`. -// -// If the second radio button is pressed, the example's state is updated -// with `setState`, updating `_character` to `SingingCharacter.jefferson`. -// This causes the buttons to rebuild with the updated `groupValue`, and -// therefore the selection of the second button. -// -// Requires one of its ancestors to be a [Material] widget. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -54,15 +27,8 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - enum SingingCharacter { lafayette, jefferson } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -70,11 +36,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - SingingCharacter? _character = SingingCharacter.lafayette; @override @@ -108,8 +70,4 @@ class _MyStatefulWidgetState extends State { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/radio/radio.toggleable.0.dart b/examples/api/lib/material/radio/radio.toggleable.0.dart index 4c8049443e..6a0c0c18d2 100644 --- a/examples/api/lib/material/radio/radio.toggleable.0.dart +++ b/examples/api/lib/material/radio/radio.toggleable.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Radio.toggleable -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to enable deselecting a radio button by setting the -// [toggleable] attribute. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -48,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int? groupValue; static const List selections = [ 'Hercules Mulligan', @@ -90,8 +70,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/radio_list_tile/radio_list_tile.0.dart b/examples/api/lib/material/radio_list_tile/radio_list_tile.0.dart index 1c6dfb1d9b..877f6cd5e5 100644 --- a/examples/api/lib/material/radio_list_tile/radio_list_tile.0.dart +++ b/examples/api/lib/material/radio_list_tile/radio_list_tile.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for RadioListTile -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// ![RadioListTile sample](https://flutter.github.io/assets-for-api-docs/assets/material/radio_list_tile.png) -// -// This widget shows a pair of radio buttons that control the `_character` -// field. The field is of the type `SingingCharacter`, an enum. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,15 +25,8 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - enum SingingCharacter { lafayette, jefferson } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -58,11 +34,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - SingingCharacter? _character = SingingCharacter.lafayette; @override @@ -92,8 +64,4 @@ class _MyStatefulWidgetState extends State { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/radio_list_tile/radio_list_tile.1.dart b/examples/api/lib/material/radio_list_tile/radio_list_tile.1.dart index bc40b81ed7..98cc2f4131 100644 --- a/examples/api/lib/material/radio_list_tile/radio_list_tile.1.dart +++ b/examples/api/lib/material/radio_list_tile/radio_list_tile.1.dart @@ -2,38 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for RadioListTile -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// ![Radio list tile semantics sample](https://flutter.github.io/assets-for-api-docs/assets/material/radio_list_tile_semantics.png) -// -// Here is an example of a custom labeled radio widget, called -// LinkedLabelRadio, that includes an interactive [RichText] widget that -// handles tap gestures. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/gestures.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -51,9 +27,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class LinkedLabelRadio extends StatelessWidget { const LinkedLabelRadio({ Key? key, @@ -101,10 +74,6 @@ class LinkedLabelRadio extends StatelessWidget { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -112,11 +81,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool _isRadioSelected = false; @override @@ -151,8 +116,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/radio_list_tile/radio_list_tile.2.dart b/examples/api/lib/material/radio_list_tile/radio_list_tile.2.dart index 968360c3df..07449c4eac 100644 --- a/examples/api/lib/material/radio_list_tile/radio_list_tile.2.dart +++ b/examples/api/lib/material/radio_list_tile/radio_list_tile.2.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for RadioListTile -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// ![Custom radio list tile sample](https://flutter.github.io/assets-for-api-docs/assets/material/radio_list_tile_custom.png) -// -// Here is an example of a custom LabeledRadio widget, but you can easily -// make your own configurable widget. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,9 +25,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class LabeledRadio extends StatelessWidget { const LabeledRadio({ Key? key, @@ -88,10 +68,6 @@ class LabeledRadio extends StatelessWidget { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -99,11 +75,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool _isRadioSelected = false; @override @@ -138,8 +110,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/radio_list_tile/radio_list_tile.toggleable.0.dart b/examples/api/lib/material/radio_list_tile/radio_list_tile.toggleable.0.dart index 1cde466ce8..9d1cbfe5a5 100644 --- a/examples/api/lib/material/radio_list_tile/radio_list_tile.toggleable.0.dart +++ b/examples/api/lib/material/radio_list_tile/radio_list_tile.toggleable.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for RadioListTile.toggleable -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to enable deselecting a radio button by setting the -// [toggleable] attribute. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -48,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int? groupValue; static const List selections = [ 'Hercules Mulligan', @@ -83,8 +63,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/range_slider/range_slider.0.dart b/examples/api/lib/material/range_slider/range_slider.0.dart index 56b414f82b..c4da141b3d 100644 --- a/examples/api/lib/material/range_slider/range_slider.0.dart +++ b/examples/api/lib/material/range_slider/range_slider.0.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for RangeSlider -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// ![A range slider widget, consisting of 5 divisions and showing the default -// value indicator.](https://flutter.github.io/assets-for-api-docs/assets/material/range_slider.png) -// -// This range values are in intervals of 20 because the Range Slider has 5 -// divisions, from 0 to 100. This means are values are split between 0, 20, 40, -// 60, 80, and 100. The range values are initialized with 40 and 80 in this demo. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -44,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -52,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - RangeValues _currentRangeValues = const RangeValues(40, 80); @override @@ -77,8 +53,4 @@ class _MyStatefulWidgetState extends State { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/reorderable_list/reorderable_list_view.0.dart b/examples/api/lib/material/reorderable_list/reorderable_list_view.0.dart index 76b8a1b1e9..ff9bd683b2 100644 --- a/examples/api/lib/material/reorderable_list/reorderable_list_view.0.dart +++ b/examples/api/lib/material/reorderable_list/reorderable_list_view.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ReorderableListView -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -47,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final List _items = List.generate(50, (int index) => index); @override @@ -81,8 +62,4 @@ class _MyStatefulWidgetState extends State { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/reorderable_list/reorderable_list_view.build_default_drag_handles.0.dart b/examples/api/lib/material/reorderable_list/reorderable_list_view.build_default_drag_handles.0.dart index bd0ad6b949..f28cfab9b9 100644 --- a/examples/api/lib/material/reorderable_list/reorderable_list_view.build_default_drag_handles.0.dart +++ b/examples/api/lib/material/reorderable_list/reorderable_list_view.build_default_drag_handles.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ReorderableListView.buildDefaultDragHandles -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -47,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final List _items = List.generate(50, (int index) => index); @override @@ -97,8 +78,4 @@ class _MyStatefulWidgetState extends State { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/reorderable_list/reorderable_list_view.reorderable_list_view_builder.0.dart b/examples/api/lib/material/reorderable_list/reorderable_list_view.reorderable_list_view_builder.0.dart index 0ecc998e18..6cd3bbfdda 100644 --- a/examples/api/lib/material/reorderable_list/reorderable_list_view.reorderable_list_view_builder.0.dart +++ b/examples/api/lib/material/reorderable_list/reorderable_list_view.reorderable_list_view_builder.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ReorderableListView.ReorderableListView.builder -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -49,11 +34,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final List _items = List.generate(50, (int index) => index); @override @@ -83,8 +64,4 @@ class _MyStatefulWidgetState extends State { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/scaffold/scaffold.0.dart b/examples/api/lib/material/scaffold/scaffold.0.dart index 702622685b..110c0c98d3 100644 --- a/examples/api/lib/material/scaffold/scaffold.0.dart +++ b/examples/api/lib/material/scaffold/scaffold.0.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Scaffold -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a [Scaffold] with a [body] and [FloatingActionButton]. -// The [body] is a [Text] placed in a [Center] in order to center the text -// within the [Scaffold]. The [FloatingActionButton] is connected to a -// callback that increments a counter. -// -// ![The Scaffold has a white background with a blue AppBar at the top. A blue FloatingActionButton is positioned at the bottom right corner of the Scaffold.](https://flutter.github.io/assets-for-api-docs/assets/material/scaffold.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -49,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int _count = 0; @override @@ -70,8 +46,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/scaffold/scaffold.1.dart b/examples/api/lib/material/scaffold/scaffold.1.dart index 8b84ce8d55..06a6539ed0 100644 --- a/examples/api/lib/material/scaffold/scaffold.1.dart +++ b/examples/api/lib/material/scaffold/scaffold.1.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Scaffold -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a [Scaffold] with a blueGrey [backgroundColor], [body] -// and [FloatingActionButton]. The [body] is a [Text] placed in a [Center] in -// order to center the text within the [Scaffold]. The [FloatingActionButton] -// is connected to a callback that increments a counter. -// -// ![](https://flutter.github.io/assets-for-api-docs/assets/material/scaffold_background_color.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -49,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int _count = 0; @override @@ -71,8 +47,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/scaffold/scaffold.2.dart b/examples/api/lib/material/scaffold/scaffold.2.dart index cf27d3ddac..f2d350ee5f 100644 --- a/examples/api/lib/material/scaffold/scaffold.2.dart +++ b/examples/api/lib/material/scaffold/scaffold.2.dart @@ -2,33 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Scaffold -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a [Scaffold] with an [AppBar], a [BottomAppBar] and a -// [FloatingActionButton]. The [body] is a [Text] placed in a [Center] in order -// to center the text within the [Scaffold]. The [FloatingActionButton] is -// centered and docked within the [BottomAppBar] using -// [FloatingActionButtonLocation.centerDocked]. The [FloatingActionButton] is -// connected to a callback that increments a counter. -// -// ![](https://flutter.github.io/assets-for-api-docs/assets/material/scaffold_bottom_app_bar.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -43,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -51,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int _count = 0; @override @@ -81,8 +55,4 @@ class _MyStatefulWidgetState extends State { floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/scaffold/scaffold.drawer.0.dart b/examples/api/lib/material/scaffold/scaffold.drawer.0.dart index 906e260ee4..784c020d16 100644 --- a/examples/api/lib/material/scaffold/scaffold.drawer.0.dart +++ b/examples/api/lib/material/scaffold/scaffold.drawer.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Scaffold.drawer -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// To disable the drawer edge swipe, set the -// [Scaffold.drawerEnableOpenDragGesture] to false. Then, use -// [ScaffoldState.openDrawer] to open the drawer and [Navigator.pop] to close -// it. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -47,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final GlobalKey _scaffoldKey = GlobalKey(); void _openDrawer() { @@ -91,8 +69,4 @@ class _MyStatefulWidgetState extends State { drawerEnableOpenDragGesture: false, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/scaffold/scaffold.end_drawer.0.dart b/examples/api/lib/material/scaffold/scaffold.end_drawer.0.dart index 9930556792..bd41629be2 100644 --- a/examples/api/lib/material/scaffold/scaffold.end_drawer.0.dart +++ b/examples/api/lib/material/scaffold/scaffold.end_drawer.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Scaffold.endDrawer -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// To disable the drawer edge swipe, set the -// [Scaffold.endDrawerEnableOpenDragGesture] to false. Then, use -// [ScaffoldState.openEndDrawer] to open the drawer and [Navigator.pop] to -// close it. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -47,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final GlobalKey _scaffoldKey = GlobalKey(); void _openEndDrawer() { @@ -91,8 +69,4 @@ class _MyStatefulWidgetState extends State { endDrawerEnableOpenDragGesture: false, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/scaffold/scaffold.of.0.dart b/examples/api/lib/material/scaffold/scaffold.of.0.dart index 817be5a5df..48e7cebf20 100644 --- a/examples/api/lib/material/scaffold/scaffold.of.0.dart +++ b/examples/api/lib/material/scaffold/scaffold.of.0.dart @@ -2,41 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Scaffold.of -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Typical usage of the [Scaffold.of] function is to call it from within the -// `build` method of a child of a [Scaffold]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - -//************************************************************************* -//* ▼▼▼▼▼▼▼▼ code-main ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - void main() => runApp(const MyApp()); -//* ▲▲▲▲▲▲▲▲ code-main ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//************************************************************************* - -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -57,12 +28,6 @@ class MyApp extends StatelessWidget { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class MyScaffoldBody extends StatelessWidget { const MyScaffoldBody({Key? key}) : super(key: key); @@ -100,6 +65,3 @@ class MyScaffoldBody extends StatelessWidget { ); } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/material/scaffold/scaffold.of.1.dart b/examples/api/lib/material/scaffold/scaffold.of.1.dart index 045af593bf..c2a73a2839 100644 --- a/examples/api/lib/material/scaffold/scaffold.of.1.dart +++ b/examples/api/lib/material/scaffold/scaffold.of.1.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Scaffold.of -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// When the [Scaffold] is actually created in the same `build` function, the -// `context` argument to the `build` function can't be used to find the -// [Scaffold] (since it's "above" the widget being returned in the widget -// tree). In such cases, the following technique with a [Builder] can be used -// to provide a new scope with a [BuildContext] that is "under" the -// [Scaffold]: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('Demo')), @@ -90,8 +67,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/scaffold/scaffold_messenger.0.dart b/examples/api/lib/material/scaffold/scaffold_messenger.0.dart index 273e65a1ff..6d3ab9de94 100644 --- a/examples/api/lib/material/scaffold/scaffold_messenger.0.dart +++ b/examples/api/lib/material/scaffold/scaffold_messenger.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ScaffoldMessenger -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is an example of showing a [SnackBar] when the user presses a button. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return OutlinedButton( onPressed: () { @@ -61,8 +43,4 @@ class MyStatelessWidget extends StatelessWidget { child: const Text('Show SnackBar'), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/scaffold/scaffold_messenger.of.0.dart b/examples/api/lib/material/scaffold/scaffold_messenger.of.0.dart index ba6c6af95e..11e54aac80 100644 --- a/examples/api/lib/material/scaffold/scaffold_messenger.of.0.dart +++ b/examples/api/lib/material/scaffold/scaffold_messenger.of.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ScaffoldMessenger.of -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Typical usage of the [ScaffoldMessenger.of] function is to call it in -// response to a user gesture or an application state change. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return ElevatedButton( child: const Text('SHOW A SNACKBAR'), @@ -62,8 +43,4 @@ class MyStatelessWidget extends StatelessWidget { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/scaffold/scaffold_messenger.of.1.dart b/examples/api/lib/material/scaffold/scaffold_messenger.of.1.dart index 1cfac77f78..992fc593ea 100644 --- a/examples/api/lib/material/scaffold/scaffold_messenger.of.1.dart +++ b/examples/api/lib/material/scaffold/scaffold_messenger.of.1.dart @@ -2,37 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ScaffoldMessenger.of -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Sometimes [SnackBar]s are produced by code that doesn't have ready access -// to a valid [BuildContext]. One such example of this is when you show a -// SnackBar from a method outside of the `build` function. In these -// cases, you can assign a [GlobalKey] to the [ScaffoldMessenger]. This -// example shows a key being used to obtain the [ScaffoldMessengerState] -// provided by the [MaterialApp]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - void main() => runApp(const MyApp()); class MyApp extends StatefulWidget { @@ -87,6 +60,3 @@ class _MyAppState extends State { ); } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/material/scaffold/scaffold_messenger_state.show_material_banner.0.dart b/examples/api/lib/material/scaffold/scaffold_messenger_state.show_material_banner.0.dart index bd607e6972..a5b0761da9 100644 --- a/examples/api/lib/material/scaffold/scaffold_messenger_state.show_material_banner.0.dart +++ b/examples/api/lib/material/scaffold/scaffold_messenger_state.show_material_banner.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ScaffoldMessengerState.showMaterialBanner -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is an example of showing a [MaterialBanner] when the user presses a button. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return OutlinedButton( onPressed: () { @@ -67,8 +49,4 @@ class MyStatelessWidget extends StatelessWidget { child: const Text('Show MaterialBanner'), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.0.dart b/examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.0.dart index b3d0f4cffa..13272dd1c6 100644 --- a/examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.0.dart +++ b/examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ScaffoldMessengerState.showSnackBar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is an example of showing a [SnackBar] when the user presses a button. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return OutlinedButton( onPressed: () { @@ -61,8 +43,4 @@ class MyStatelessWidget extends StatelessWidget { child: const Text('Show SnackBar'), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/scaffold/scaffold_state.show_bottom_sheet.0.dart b/examples/api/lib/material/scaffold/scaffold_state.show_bottom_sheet.0.dart index 84fa82e386..d3e6993b90 100644 --- a/examples/api/lib/material/scaffold/scaffold_state.show_bottom_sheet.0.dart +++ b/examples/api/lib/material/scaffold/scaffold_state.show_bottom_sheet.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ScaffoldState.showBottomSheet -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example demonstrates how to use `showBottomSheet` to display a -// bottom sheet when a user taps a button. It also demonstrates how to -// close a bottom sheet using the Navigator. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Center( child: ElevatedButton( @@ -80,8 +60,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/scaffold/scaffold_state.show_snack_bar.0.dart b/examples/api/lib/material/scaffold/scaffold_state.show_snack_bar.0.dart index a61bcb4cfd..9703233c35 100644 --- a/examples/api/lib/material/scaffold/scaffold_state.show_snack_bar.0.dart +++ b/examples/api/lib/material/scaffold/scaffold_state.show_snack_bar.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ScaffoldState.showSnackBar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is an example of showing a [SnackBar] when the user presses a button. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return OutlinedButton( onPressed: () { @@ -61,8 +43,4 @@ class MyStatelessWidget extends StatelessWidget { child: const Text('Show SnackBar'), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/scrollbar/scrollbar.0.dart b/examples/api/lib/material/scrollbar/scrollbar.0.dart index 74658dfc10..fd43270616 100644 --- a/examples/api/lib/material/scrollbar/scrollbar.0.dart +++ b/examples/api/lib/material/scrollbar/scrollbar.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Scrollbar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows a [Scrollbar] that executes a fade animation as scrolling occurs. -// The Scrollbar will fade into view as the user scrolls, and fade out when scrolling stops. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scrollbar( child: GridView.builder( @@ -62,8 +43,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/scrollbar/scrollbar.1.dart b/examples/api/lib/material/scrollbar/scrollbar.1.dart index 27fa0b916a..5ede5bd537 100644 --- a/examples/api/lib/material/scrollbar/scrollbar.1.dart +++ b/examples/api/lib/material/scrollbar/scrollbar.1.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Scrollbar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// When isAlwaysShown is true, the scrollbar thumb will remain visible without the -// fade animation. This requires that a ScrollController is provided to controller, -// or that the PrimaryScrollController is available. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -49,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final ScrollController _controllerOne = ScrollController(); @override @@ -74,8 +53,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/slider/slider.0.dart b/examples/api/lib/material/slider/slider.0.dart index 0c86e40780..ea17910346 100644 --- a/examples/api/lib/material/slider/slider.0.dart +++ b/examples/api/lib/material/slider/slider.0.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Slider -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// ![A slider widget, consisting of 5 divisions and showing the default value -// indicator.](https://flutter.github.io/assets-for-api-docs/assets/material/slider.png) -// -// The Sliders value is part of the Stateful widget subclass to change the value -// setState was called. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -43,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -51,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - double _currentSliderValue = 20; @override @@ -73,8 +50,4 @@ class _MyStatefulWidgetState extends State { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/snack_bar/snack_bar.0.dart b/examples/api/lib/material/snack_bar/snack_bar.0.dart index 72887d18de..15f93d4bde 100644 --- a/examples/api/lib/material/snack_bar/snack_bar.0.dart +++ b/examples/api/lib/material/snack_bar/snack_bar.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SnackBar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is an example of a [SnackBar] with an [action] button implemented using -// [SnackBarAction]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return ElevatedButton( child: const Text('Show Snackbar'), @@ -68,8 +49,4 @@ class MyStatelessWidget extends StatelessWidget { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/snack_bar/snack_bar.1.dart b/examples/api/lib/material/snack_bar/snack_bar.1.dart index a2347b9927..c376554866 100644 --- a/examples/api/lib/material/snack_bar/snack_bar.1.dart +++ b/examples/api/lib/material/snack_bar/snack_bar.1.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SnackBar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is an example of a customized [SnackBar]. It utilizes -// [behavior], [shape], [padding], [width], and [duration] to customize the -// location, appearance, and the duration for which the [SnackBar] is visible. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -43,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return ElevatedButton( child: const Text('Show Snackbar'), @@ -78,8 +58,4 @@ class MyStatelessWidget extends StatelessWidget { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/stepper/stepper.0.dart b/examples/api/lib/material/stepper/stepper.0.dart index 1e6aec6a37..be246c799a 100644 --- a/examples/api/lib/material/stepper/stepper.0.dart +++ b/examples/api/lib/material/stepper/stepper.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Stepper -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -49,11 +34,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int _index = 0; @override @@ -93,8 +74,4 @@ class _MyStatefulWidgetState extends State { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/stepper/stepper.controls_builder.0.dart b/examples/api/lib/material/stepper/stepper.controls_builder.0.dart index f7f407b5a2..5f394d3d03 100644 --- a/examples/api/lib/material/stepper/stepper.controls_builder.0.dart +++ b/examples/api/lib/material/stepper/stepper.controls_builder.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Stepper.controlsBuilder -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Creates a stepper control with custom buttons. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Stepper( controlsBuilder: (BuildContext context, ControlsDetails details) { @@ -81,8 +63,4 @@ class MyStatelessWidget extends StatelessWidget { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/switch_list_tile/switch_list_tile.0.dart b/examples/api/lib/material/switch_list_tile/switch_list_tile.0.dart index 73b26dee13..e995fbf1e5 100644 --- a/examples/api/lib/material/switch_list_tile/switch_list_tile.0.dart +++ b/examples/api/lib/material/switch_list_tile/switch_list_tile.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SwitchListTile -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// ![SwitchListTile sample](https://flutter.github.io/assets-for-api-docs/assets/material/switch_list_tile.png) -// -// This widget shows a switch that, when toggled, changes the state of a [bool] -// member field called `_lights`. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -44,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -52,11 +34,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool _lights = false; @override @@ -72,8 +50,4 @@ class _MyStatefulWidgetState extends State { secondary: const Icon(Icons.lightbulb_outline), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/switch_list_tile/switch_list_tile.1.dart b/examples/api/lib/material/switch_list_tile/switch_list_tile.1.dart index 3931541b1f..c810ac8a4d 100644 --- a/examples/api/lib/material/switch_list_tile/switch_list_tile.1.dart +++ b/examples/api/lib/material/switch_list_tile/switch_list_tile.1.dart @@ -2,38 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SwitchListTile -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// ![Switch list tile semantics sample](https://flutter.github.io/assets-for-api-docs/assets/material/switch_list_tile_semantics.png) -// -// Here is an example of a custom labeled radio widget, called -// LinkedLabelRadio, that includes an interactive [RichText] widget that -// handles tap gestures. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/gestures.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -53,9 +29,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class LinkedLabelSwitch extends StatelessWidget { const LinkedLabelSwitch({ Key? key, @@ -103,10 +76,6 @@ class LinkedLabelSwitch extends StatelessWidget { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -114,11 +83,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool _isSelected = false; @override @@ -134,8 +99,4 @@ class _MyStatefulWidgetState extends State { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/switch_list_tile/switch_list_tile.2.dart b/examples/api/lib/material/switch_list_tile/switch_list_tile.2.dart index 2939ad8afe..8c6a5def2c 100644 --- a/examples/api/lib/material/switch_list_tile/switch_list_tile.2.dart +++ b/examples/api/lib/material/switch_list_tile/switch_list_tile.2.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SwitchListTile -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// ![Custom switch list tile sample](https://flutter.github.io/assets-for-api-docs/assets/material/switch_list_tile_custom.png) -// -// Here is an example of a custom LabeledSwitch widget, but you can easily -// make your own configurable widget. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -44,9 +27,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class LabeledSwitch extends StatelessWidget { const LabeledSwitch({ Key? key, @@ -85,10 +65,6 @@ class LabeledSwitch extends StatelessWidget { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -96,11 +72,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool _isSelected = false; @override @@ -116,8 +88,4 @@ class _MyStatefulWidgetState extends State { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/tab_controller/tab_controller.1.dart b/examples/api/lib/material/tab_controller/tab_controller.1.dart index 7ebb657cb8..b49af92dd8 100644 --- a/examples/api/lib/material/tab_controller/tab_controller.1.dart +++ b/examples/api/lib/material/tab_controller/tab_controller.1.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for TabController -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to listen to page updates in [TabBar] and [TabBarView] -// when using [DefaultTabController]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,26 +22,16 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - const List tabs = [ Tab(text: 'Zeroth'), Tab(text: 'First'), Tab(text: 'Second'), ]; -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return DefaultTabController( length: tabs.length, @@ -90,8 +65,4 @@ class MyStatelessWidget extends StatelessWidget { }), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/tabs/tab_bar.0.dart b/examples/api/lib/material/tabs/tab_bar.0.dart index 0919b9f6e2..ad9322c1b7 100644 --- a/examples/api/lib/material/tabs/tab_bar.0.dart +++ b/examples/api/lib/material/tabs/tab_bar.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for TabBar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows the implementation of [TabBar] and [TabBarView] using a [DefaultTabController]. -// Each [Tab] corresponds to a child of the [TabBarView] in the order they are written. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return DefaultTabController( initialIndex: 1, @@ -82,8 +63,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/tabs/tab_bar.1.dart b/examples/api/lib/material/tabs/tab_bar.1.dart index 387450c96c..ae803d49f7 100644 --- a/examples/api/lib/material/tabs/tab_bar.1.dart +++ b/examples/api/lib/material/tabs/tab_bar.1.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material_ticker.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for TabBar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// [TabBar] can also be implemented by using a [TabController] which provides more options -// to control the behavior of the [TabBar] and [TabBarView]. This can be used instead of -// a [DefaultTabController], demonstrated below. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -38,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -46,13 +29,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin. class _MyStatefulWidgetState extends State with TickerProviderStateMixin { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - late TabController _tabController; @override @@ -97,8 +76,4 @@ class _MyStatefulWidgetState extends State ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/text_button/text_button.0.dart b/examples/api/lib/material/text_button/text_button.0.dart index 6d183c4d4b..d9e75e3ffb 100644 --- a/examples/api/lib/material/text_button/text_button.0.dart +++ b/examples/api/lib/material/text_button/text_button.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for TextButton -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows how to render a disabled TextButton, an enabled TextButton -// and lastly a TextButton with gradient background. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Center( child: Column( @@ -102,8 +83,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/text_field/text_field.1.dart b/examples/api/lib/material/text_field/text_field.1.dart index cfa0418100..92bdd86462 100644 --- a/examples/api/lib/material/text_field/text_field.1.dart +++ b/examples/api/lib/material/text_field/text_field.1.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for TextField -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows how to get a value from a TextField via the [onSubmitted] -// callback. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -45,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - late TextEditingController _controller; @override @@ -94,8 +74,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/text_form_field/text_form_field.1.dart b/examples/api/lib/material/text_form_field/text_form_field.1.dart index 97f0e0df15..aa2c1d864c 100644 --- a/examples/api/lib/material/text_form_field/text_form_field.1.dart +++ b/examples/api/lib/material/text_form_field/text_form_field.1.dart @@ -2,34 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for TextFormField -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to move the focus to the next field when the user -// presses the SPACE key. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - import 'package:flutter/services.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -44,7 +23,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -52,11 +30,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - @override Widget build(BuildContext context) { return Material( @@ -93,8 +67,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/tooltip/tooltip.0.dart b/examples/api/lib/material/tooltip/tooltip.0.dart index 06cc953f24..634274ab11 100644 --- a/examples/api/lib/material/tooltip/tooltip.0.dart +++ b/examples/api/lib/material/tooltip/tooltip.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Tooltip -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example show a basic [Tooltip] which has a [Text] as child. -// [message] contains your label to be shown by the tooltip when -// the child that Tooltip wraps is hovered over on web or desktop. On mobile, -// the tooltip is shown when the widget is long pressed. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -44,22 +27,14 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return const Tooltip( message: 'I am a Tooltip', child: Text('Hover over the text to show a tooltip.'), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/tooltip/tooltip.1.dart b/examples/api/lib/material/tooltip/tooltip.1.dart index 6ab2a7c69b..17fb1ce77f 100644 --- a/examples/api/lib/material/tooltip/tooltip.1.dart +++ b/examples/api/lib/material/tooltip/tooltip.1.dart @@ -2,36 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Tooltip -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example covers most of the attributes available in Tooltip. -// `decoration` has been used to give a gradient and borderRadius to Tooltip. -// `height` has been used to set a specific height of the Tooltip. -// `preferBelow` is false, the tooltip will prefer showing above [Tooltip]'s child widget. -// However, it may show the tooltip below if there's not enough space -// above the widget. -// `textStyle` has been used to set the font size of the 'message'. -// `showDuration` accepts a Duration to continue showing the message after the long -// press has been released or the mouse pointer exits the child widget. -// `waitDuration` accepts a Duration for which a mouse pointer has to hover over the child -// widget before the tooltip is shown. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -51,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Tooltip( message: 'I am a Tooltip', @@ -78,8 +50,4 @@ class MyStatelessWidget extends StatelessWidget { waitDuration: const Duration(seconds: 1), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/material/tooltip/tooltip.2.dart b/examples/api/lib/material/tooltip/tooltip.2.dart index d250598543..1f8f40b389 100644 --- a/examples/api/lib/material/tooltip/tooltip.2.dart +++ b/examples/api/lib/material/tooltip/tooltip.2.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Tooltip -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a rich [Tooltip] that specifies the [richMessage] -// parameter instead of the [message] parameter (only one of these may be -// non-null. Any [InlineSpan] can be specified for the [richMessage] attribute, -// including [WidgetSpan]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -44,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return const Tooltip( richMessage: TextSpan( @@ -67,8 +46,4 @@ class MyStatelessWidget extends StatelessWidget { child: Text('Tap this text and hold down to show a tooltip.'), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/painting/gradient/linear_gradient.0.dart b/examples/api/lib/painting/gradient/linear_gradient.0.dart index a6416fde3e..5662e6df3e 100644 --- a/examples/api/lib/painting/gradient/linear_gradient.0.dart +++ b/examples/api/lib/painting/gradient/linear_gradient.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for LinearGradient -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample draws a picture that looks like vertical window shades by having -// a [Container] display a [BoxDecoration] with a [LinearGradient]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Container( decoration: const BoxDecoration( @@ -61,8 +42,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.0.dart b/examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.0.dart index 3161cf58c6..1f9bb3651a 100644 --- a/examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.0.dart +++ b/examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SliverGridDelegateWithFixedCrossAxisCount -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is an example using the [childAspectRatio] property. On a device with a -// screen width of 800.0, it creates a GridView with each tile with a width of -// 200.0 and a height of 100.0. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return GridView( gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( @@ -62,8 +42,4 @@ class MyStatelessWidget extends StatelessWidget { }), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.1.dart b/examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.1.dart index 237ec95a76..f249eb842e 100644 --- a/examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.1.dart +++ b/examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.1.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SliverGridDelegateWithFixedCrossAxisCount -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is an example using the [mainAxisExtent] property. On a device with a -// screen width of 800.0, it creates a GridView with each tile with a width of -// 200.0 and a height of 150.0. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return GridView( gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( @@ -62,8 +42,4 @@ class MyStatelessWidget extends StatelessWidget { }), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/services/keyboard_key/logical_keyboard_key.0.dart b/examples/api/lib/services/keyboard_key/logical_keyboard_key.0.dart index 6815402b2e..f8bb12dbde 100644 --- a/examples/api/lib/services/keyboard_key/logical_keyboard_key.0.dart +++ b/examples/api/lib/services/keyboard_key/logical_keyboard_key.0.dart @@ -2,35 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for LogicalKeyboardKey -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to detect if the user has selected the logical "Q" -// key. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -48,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -56,11 +34,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - // The node used to request the keyboard focus. final FocusNode _focusNode = FocusNode(); // The message to display. @@ -120,8 +94,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/services/keyboard_key/physical_keyboard_key.0.dart b/examples/api/lib/services/keyboard_key/physical_keyboard_key.0.dart index 01b046d8fa..3fb07d76ec 100644 --- a/examples/api/lib/services/keyboard_key/physical_keyboard_key.0.dart +++ b/examples/api/lib/services/keyboard_key/physical_keyboard_key.0.dart @@ -2,34 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for PhysicalKeyboardKey -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to detect if the user has selected the physical key -// to the right of the CAPS LOCK key. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - import 'package:flutter/services.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -47,7 +26,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -55,11 +33,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - // The node used to request the keyboard focus. final FocusNode _focusNode = FocusNode(); // The message to display. @@ -113,8 +87,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart b/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart index 2d61616b84..4904487b06 100644 --- a/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart +++ b/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart @@ -2,42 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SystemChrome.setSystemUIOverlayStyle -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following example creates a widget that changes the status bar color -// to a random value on Android. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//******************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-dartImports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'dart:math' as math; -//* ▲▲▲▲▲▲▲▲ code-dartImports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************************** - import 'package:flutter/material.dart'; -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - import 'package:flutter/services.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -52,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -60,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final math.Random _random = math.Random(); SystemUiOverlayStyle _currentStyle = SystemUiOverlayStyle.light; @@ -94,8 +62,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/actions/action.action_overridable.0.dart b/examples/api/lib/widgets/actions/action.action_overridable.0.dart index 0f35817558..d46fda69d1 100644 --- a/examples/api/lib/widgets/actions/action.action_overridable.0.dart +++ b/examples/api/lib/widgets/actions/action.action_overridable.0.dart @@ -2,38 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Action.Action.overridable -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample implements a custom text input field that handles the -// [DeleteTextIntent] intent, as well as a US telephone number input widget -// that consists of multiple text fields for area code, prefix and line -// number. When the backspace key is pressed, the phone number input widget -// sends the focus to the preceding text field when the currently focused -// field becomes empty. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - -//************************************************************************* -//* ▼▼▼▼▼▼▼▼ code-main ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - void main() { runApp( const MaterialApp( @@ -44,12 +17,6 @@ void main() { ); } -//* ▲▲▲▲▲▲▲▲ code-main ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//************************************************************************* - -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - // This implements a custom phone number input field that handles the // [DeleteTextIntent] intent. class DigitInput extends StatefulWidget { @@ -196,6 +163,3 @@ class _SimpleUSPhoneNumberEntryState extends State { ); } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/widgets/actions/action_listener.0.dart b/examples/api/lib/widgets/actions/action_listener.0.dart index 0a1a43ba40..42fb6fe296 100644 --- a/examples/api/lib/widgets/actions/action_listener.0.dart +++ b/examples/api/lib/widgets/actions/action_listener.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ActionListener -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how ActionListener handles adding and removing of -// the [listener] in the widget lifecycle. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,9 +27,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class ActionListenerExample extends StatefulWidget { const ActionListenerExample({Key? key}) : super(key: key); @@ -129,10 +111,6 @@ class MyIntent extends Intent { const MyIntent(); } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -140,17 +118,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - @override Widget build(BuildContext context) { return const ActionListenerExample(); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/actions/actions.0.dart b/examples/api/lib/widgets/actions/actions.0.dart index 2a7c3a7d04..c037053ab1 100644 --- a/examples/api/lib/widgets/actions/actions.0.dart +++ b/examples/api/lib/widgets/actions/actions.0.dart @@ -2,39 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Actions -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example creates a custom [Action] subclass `ModifyAction` for modifying -// a model, and another, `SaveAction` for saving it. -// -// This example demonstrates passing arguments to the [Intent] to be carried to -// the [Action]. Actions can get data either from their own construction (like -// the `model` in this example), or from the intent passed to them when invoked -// (like the increment `amount` in this example). -// -// This example also demonstrates how to use Intents to limit a widget's -// dependencies on its surroundings. The `SaveButton` widget defined in this -// example can invoke actions defined in its ancestor widgets, which can be -// customized to match the part of the widget tree that it is in. It doesn't -// need to know about the `SaveAction` class, only the `SaveIntent`, and it -// only needs to know about a value notifier, not the entire model. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -54,9 +27,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - // A simple model class that notifies listeners when it changes. class Model { ValueNotifier isDirty = ValueNotifier(false); @@ -146,10 +116,6 @@ class _SaveButtonState extends State { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -157,11 +123,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Model model = Model(); int count = 0; @@ -212,8 +174,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/actions/focusable_action_detector.0.dart b/examples/api/lib/widgets/actions/focusable_action_detector.0.dart index b650993d52..81476d7c3b 100644 --- a/examples/api/lib/widgets/actions/focusable_action_detector.0.dart +++ b/examples/api/lib/widgets/actions/focusable_action_detector.0.dart @@ -2,42 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for FocusableActionDetector -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how keyboard interaction can be added to a custom control -// that changes color when hovered and focused, and can toggle a light when -// activated, either by touch or by hitting the `X` key on the keyboard when -// the "And Me" button has the keyboard focus (be sure to use TAB to move the -// focus to the "And Me" button before trying it out). -// -// This example defines its own key binding for the `X` key, but in this case, -// there is also a default key binding for [ActivateAction] in the default key -// bindings created by [WidgetsApp] (the parent for [MaterialApp], and -// [CupertinoApp]), so the `ENTER` key will also activate the buttons. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - import 'package:flutter/services.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -52,9 +23,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class FadButton extends StatefulWidget { const FadButton({ Key? key, @@ -147,10 +115,6 @@ class _FadButtonState extends State { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -158,11 +122,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - @override Widget build(BuildContext context) { return Scaffold( @@ -187,8 +147,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/animated_list/animated_list.0.dart b/examples/api/lib/widgets/animated_list/animated_list.0.dart index 6dcb51c18a..390284a9b7 100644 --- a/examples/api/lib/widgets/animated_list/animated_list.0.dart +++ b/examples/api/lib/widgets/animated_list/animated_list.0.dart @@ -2,34 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AnimatedList -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample application uses an [AnimatedList] to create an effect when -// items are removed or added to the list. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - void main() { runApp(const AnimatedListSample()); } @@ -238,6 +215,3 @@ class CardItem extends StatelessWidget { ); } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/widgets/animated_list/sliver_animated_list.0.dart b/examples/api/lib/widgets/animated_list/sliver_animated_list.0.dart index 1e809e65b2..4a07081cb3 100644 --- a/examples/api/lib/widgets/animated_list/sliver_animated_list.0.dart +++ b/examples/api/lib/widgets/animated_list/sliver_animated_list.0.dart @@ -2,34 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SliverAnimatedList -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample application uses a [SliverAnimatedList] to create an animated -// effect when items are removed or added to the list. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - void main() => runApp(const SliverAnimatedListSample()); class SliverAnimatedListSample extends StatefulWidget { @@ -262,6 +239,3 @@ class CardItem extends StatelessWidget { ); } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/widgets/animated_size/animated_size.0.dart b/examples/api/lib/widgets/animated_size/animated_size.0.dart index 1512250c05..975b385279 100644 --- a/examples/api/lib/widgets/animated_size/animated_size.0.dart +++ b/examples/api/lib/widgets/animated_size/animated_size.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center_freeform_state.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AnimatedSize -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example makes a [Container] react to being touched, causing the child -// of the [AnimatedSize] widget, here a [FlutterLogo], to animate. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -50,10 +34,6 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class _MyStatefulWidgetState extends State { double _size = 50.0; bool _large = false; @@ -80,6 +60,3 @@ class _MyStatefulWidgetState extends State { ); } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/widgets/animated_switcher/animated_switcher.0.dart b/examples/api/lib/widgets/animated_switcher/animated_switcher.0.dart index 15622a4073..3cc7e00839 100644 --- a/examples/api/lib/widgets/animated_switcher/animated_switcher.0.dart +++ b/examples/api/lib/widgets/animated_switcher/animated_switcher.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AnimatedSwitcher -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows a counter that animates the scale of a text widget -// whenever the value changes. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -45,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int _count = 0; @override @@ -85,8 +65,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/async/future_builder.0.dart b/examples/api/lib/widgets/async/future_builder.0.dart index 8d684d6566..2570893fab 100644 --- a/examples/api/lib/widgets/async/future_builder.0.dart +++ b/examples/api/lib/widgets/async/future_builder.0.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for FutureBuilder -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows a [FutureBuilder] that displays a loading spinner while it -// loads data. It displays a success icon and text if the [Future] completes -// with a result, or an error icon and text if the [Future] completes with an -// error. Assume the `_calculation` field is set by pressing a button elsewhere -// in the UI. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -48,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final Future _calculation = Future.delayed( const Duration(seconds: 2), () => 'Data Loaded', @@ -115,8 +92,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/async/stream_builder.0.dart b/examples/api/lib/widgets/async/stream_builder.0.dart index b25bdc9259..46f4a23125 100644 --- a/examples/api/lib/widgets/async/stream_builder.0.dart +++ b/examples/api/lib/widgets/async/stream_builder.0.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for StreamBuilder -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows a [StreamBuilder] that listens to a Stream that emits bids -// for an auction. Every time the StreamBuilder receives a bid from the Stream, -// it will display the price of the bid below an icon. If the Stream emits an -// error, the error is displayed below an error icon. When the Stream finishes -// emitting bids, the final price is displayed. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -48,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final Stream _bids = (() async* { await Future.delayed(const Duration(seconds: 1)); yield 1; @@ -154,8 +131,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/autocomplete/raw_autocomplete.0.dart b/examples/api/lib/widgets/autocomplete/raw_autocomplete.0.dart index 1c8b31557d..1dae19e5d7 100644 --- a/examples/api/lib/widgets/autocomplete/raw_autocomplete.0.dart +++ b/examples/api/lib/widgets/autocomplete/raw_autocomplete.0.dart @@ -2,24 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for RawAutocomplete -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to create a very basic autocomplete widget using the -// [fieldViewBuilder] and [optionsViewBuilder] parameters. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//************************************************************************* -//* ▼▼▼▼▼▼▼▼ code-main ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; @@ -103,6 +86,3 @@ class AutocompleteBasicExample extends StatelessWidget { ); } } - -//* ▲▲▲▲▲▲▲▲ code-main ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//************************************************************************* diff --git a/examples/api/lib/widgets/autocomplete/raw_autocomplete.1.dart b/examples/api/lib/widgets/autocomplete/raw_autocomplete.1.dart index 2a16259197..ced20be36b 100644 --- a/examples/api/lib/widgets/autocomplete/raw_autocomplete.1.dart +++ b/examples/api/lib/widgets/autocomplete/raw_autocomplete.1.dart @@ -2,24 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for RawAutocomplete -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example is similar to the previous example, but it uses a custom T data -// type instead of directly using String. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//************************************************************************* -//* ▼▼▼▼▼▼▼▼ code-main ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; @@ -138,6 +121,3 @@ class AutocompleteCustomTypeExample extends StatelessWidget { ); } } - -//* ▲▲▲▲▲▲▲▲ code-main ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//************************************************************************* diff --git a/examples/api/lib/widgets/autocomplete/raw_autocomplete.2.dart b/examples/api/lib/widgets/autocomplete/raw_autocomplete.2.dart index 253e616409..0a358eaf6c 100644 --- a/examples/api/lib/widgets/autocomplete/raw_autocomplete.2.dart +++ b/examples/api/lib/widgets/autocomplete/raw_autocomplete.2.dart @@ -2,23 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for RawAutocomplete -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows the use of RawAutocomplete in a form. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//************************************************************************* -//* ▼▼▼▼▼▼▼▼ code-main ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; @@ -207,6 +191,3 @@ class AutocompleteFormExampleState extends State { ); } } - -//* ▲▲▲▲▲▲▲▲ code-main ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//************************************************************************* diff --git a/examples/api/lib/widgets/autocomplete/raw_autocomplete.focus_node.0.dart b/examples/api/lib/widgets/autocomplete/raw_autocomplete.focus_node.0.dart index 42b800e604..02d28a38e4 100644 --- a/examples/api/lib/widgets/autocomplete/raw_autocomplete.focus_node.0.dart +++ b/examples/api/lib/widgets/autocomplete/raw_autocomplete.focus_node.0.dart @@ -2,24 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for RawAutocomplete.focusNode -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This examples shows how to create an autocomplete widget with the text -// field in the AppBar and the results in the main body of the app. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//************************************************************************* -//* ▼▼▼▼▼▼▼▼ code-main ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; @@ -106,6 +89,3 @@ class RawAutocompleteSplitState extends State { ); } } - -//* ▲▲▲▲▲▲▲▲ code-main ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//************************************************************************* diff --git a/examples/api/lib/widgets/autofill/autofill_group.0.dart b/examples/api/lib/widgets/autofill/autofill_group.0.dart index ef41276e50..d63badaceb 100644 --- a/examples/api/lib/widgets/autofill/autofill_group.0.dart +++ b/examples/api/lib/widgets/autofill/autofill_group.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AutofillGroup -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// An example form with autofillable fields grouped into different -// `AutofillGroup`s. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -48,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool isSameAddress = true; final TextEditingController shippingAddress1 = TextEditingController(); final TextEditingController shippingAddress2 = TextEditingController(); @@ -145,8 +125,4 @@ class _MyStatefulWidgetState extends State { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/basic/absorb_pointer.0.dart b/examples/api/lib/widgets/basic/absorb_pointer.0.dart index a5f5960f3e..00e0f9cd84 100644 --- a/examples/api/lib/widgets/basic/absorb_pointer.0.dart +++ b/examples/api/lib/widgets/basic/absorb_pointer.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AbsorbPointer -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following sample has an [AbsorbPointer] widget wrapping the button on -// top of the stack, which absorbs pointer events, preventing its child button -// __and__ the button below it in the stack from receiving the pointer events. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -43,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Stack( alignment: AlignmentDirectional.center, @@ -80,8 +60,4 @@ class MyStatelessWidget extends StatelessWidget { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/basic/aspect_ratio.0.dart b/examples/api/lib/widgets/basic/aspect_ratio.0.dart index 81f928c395..3244e76e92 100644 --- a/examples/api/lib/widgets/basic/aspect_ratio.0.dart +++ b/examples/api/lib/widgets/basic/aspect_ratio.0.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AspectRatio -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This examples shows how AspectRatio sets width when its parent's width -// constraint is infinite. Since its parent's allowed height is a fixed value, -// the actual width is determined via the given AspectRatio. -// -// Since the height is fixed at 100.0 in this example and the aspect ratio is -// set to 16 / 9, the width should then be 100.0 / 9 * 16. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -44,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Container( color: Colors.blue, @@ -66,8 +43,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/basic/aspect_ratio.1.dart b/examples/api/lib/widgets/basic/aspect_ratio.1.dart index e114038a82..708c919c07 100644 --- a/examples/api/lib/widgets/basic/aspect_ratio.1.dart +++ b/examples/api/lib/widgets/basic/aspect_ratio.1.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AspectRatio -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Container( color: Colors.blue, @@ -63,8 +45,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/basic/aspect_ratio.2.dart b/examples/api/lib/widgets/basic/aspect_ratio.2.dart index a43cf5dd3d..297719e526 100644 --- a/examples/api/lib/widgets/basic/aspect_ratio.2.dart +++ b/examples/api/lib/widgets/basic/aspect_ratio.2.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AspectRatio -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Container( color: Colors.blue, @@ -63,8 +45,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/basic/expanded.0.dart b/examples/api/lib/widgets/basic/expanded.0.dart index 214dd80c81..ae4a59fdec 100644 --- a/examples/api/lib/widgets/basic/expanded.0.dart +++ b/examples/api/lib/widgets/basic/expanded.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Expanded -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to use an [Expanded] widget in a [Column] so that -// its middle child, a [Container] here, expands to fill the space. -// -// ![This results in two thin blue boxes with a larger amber box in between.](https://flutter.github.io/assets-for-api-docs/assets/widgets/expanded_column.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( appBar: AppBar( @@ -76,8 +55,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/basic/expanded.1.dart b/examples/api/lib/widgets/basic/expanded.1.dart index dd705fe7bc..78a8fd75fe 100644 --- a/examples/api/lib/widgets/basic/expanded.1.dart +++ b/examples/api/lib/widgets/basic/expanded.1.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Expanded -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to use an [Expanded] widget in a [Row] with multiple -// children expanded, utilizing the [flex] factor to prioritize available space. -// -// ![This results in a wide amber box, followed by a thin blue box, with a medium width amber box at the end.](https://flutter.github.io/assets-for-api-docs/assets/widgets/expanded_row.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( appBar: AppBar( @@ -79,8 +58,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/basic/fitted_box.0.dart b/examples/api/lib/widgets/basic/fitted_box.0.dart index 262a695a96..a11747c132 100644 --- a/examples/api/lib/widgets/basic/fitted_box.0.dart +++ b/examples/api/lib/widgets/basic/fitted_box.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for FittedBox -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// In this example, the image is stretched to fill the entire [Container], which would -// not happen normally without using FittedBox. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Container( height: 400, @@ -62,8 +43,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/basic/flow.0.dart b/examples/api/lib/widgets/basic/flow.0.dart index 6c1c12ed95..af62c223c3 100644 --- a/examples/api/lib/widgets/basic/flow.0.dart +++ b/examples/api/lib/widgets/basic/flow.0.dart @@ -2,25 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Flow -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example uses the [Flow] widget to create a menu that opens and closes -// as it is interacted with, shown above. The color of the button in the menu -// changes to indicate which one has been selected. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//************************************************************************* -//* ▼▼▼▼▼▼▼▼ code-main ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; @@ -138,6 +120,3 @@ class FlowMenuDelegate extends FlowDelegate { } } } - -//* ▲▲▲▲▲▲▲▲ code-main ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//************************************************************************* diff --git a/examples/api/lib/widgets/basic/fractionally_sized_box.0.dart b/examples/api/lib/widgets/basic/fractionally_sized_box.0.dart index 2bf6b55c19..aca209abf9 100644 --- a/examples/api/lib/widgets/basic/fractionally_sized_box.0.dart +++ b/examples/api/lib/widgets/basic/fractionally_sized_box.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for FractionallySizedBox -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows a [FractionallySizedBox] whose one child is 50% of -// the box's size per the width and height factor parameters, and centered -// within that box by the alignment parameter. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return SizedBox.expand( child: FractionallySizedBox( @@ -66,8 +46,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/basic/ignore_pointer.0.dart b/examples/api/lib/widgets/basic/ignore_pointer.0.dart index d1ede6ca5b..1ac2423760 100644 --- a/examples/api/lib/widgets/basic/ignore_pointer.0.dart +++ b/examples/api/lib/widgets/basic/ignore_pointer.0.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for IgnorePointer -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following sample has an [IgnorePointer] widget wrapping the `Column` -// which contains a button. -// When [ignoring] is set to `true` anything inside the `Column` can -// not be tapped. When [ignoring] is set to `false` anything -// inside the `Column` can be tapped. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -48,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool ignoring = false; void setIgnoring(bool newValue) { setState(() { @@ -91,8 +68,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/basic/listener.0.dart b/examples/api/lib/widgets/basic/listener.0.dart index 99282bd76e..6e80e1059e 100644 --- a/examples/api/lib/widgets/basic/listener.0.dart +++ b/examples/api/lib/widgets/basic/listener.0.dart @@ -2,34 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Listener -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example makes a [Container] react to being touched, showing a count of -// the number of pointer downs and ups. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - import 'package:flutter/widgets.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -49,7 +28,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -57,11 +35,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int _downCounter = 0; int _upCounter = 0; double x = 0.0; @@ -116,8 +90,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/basic/mouse_region.0.dart b/examples/api/lib/widgets/basic/mouse_region.0.dart index 3b11edc9cf..4a540f0909 100644 --- a/examples/api/lib/widgets/basic/mouse_region.0.dart +++ b/examples/api/lib/widgets/basic/mouse_region.0.dart @@ -2,34 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for MouseRegion -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example makes a [Container] react to being entered by a mouse -// pointer, showing a count of the number of entries and exits. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - import 'package:flutter/widgets.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -49,7 +28,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -57,11 +35,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int _enterCounter = 0; int _exitCounter = 0; double x = 0.0; @@ -114,8 +88,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/basic/mouse_region.on_exit.0.dart b/examples/api/lib/widgets/basic/mouse_region.on_exit.0.dart index b9304987b6..cd586c60d2 100644 --- a/examples/api/lib/widgets/basic/mouse_region.on_exit.0.dart +++ b/examples/api/lib/widgets/basic/mouse_region.on_exit.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for MouseRegion.onExit -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following example shows a blue rectangular that turns yellow when -// hovered. Since the hover state is completely contained within a widget -// that unconditionally creates the `MouseRegion`, you can ignore the -// aforementioned restriction. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -44,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -52,11 +34,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool hovered = false; @override @@ -79,8 +57,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/basic/mouse_region.on_exit.1.dart b/examples/api/lib/widgets/basic/mouse_region.on_exit.1.dart index 35cdbebe6f..0916dfbf58 100644 --- a/examples/api/lib/widgets/basic/mouse_region.on_exit.1.dart +++ b/examples/api/lib/widgets/basic/mouse_region.on_exit.1.dart @@ -2,32 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for MouseRegion.onExit -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following example shows a widget that hides its content one second -// after being hovered, and also exposes the enter and exit callbacks. -// Because the widget conditionally creates the `MouseRegion`, and leaks the -// hover state, it needs to take the restriction into consideration. In this -// case, since it has access to the event that triggers the disappearance of -// the `MouseRegion`, it simply trigger the exit callback during that event -// as well. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -47,9 +27,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - // A region that hides its content one second after being hovered. class MyTimedButton extends StatefulWidget { const MyTimedButton( @@ -111,10 +88,6 @@ class _MyTimedButton extends State { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -122,11 +95,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Key key = UniqueKey(); bool hovering = false; @@ -160,8 +129,4 @@ class _MyStatefulWidgetState extends State { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/basic/offstage.0.dart b/examples/api/lib/widgets/basic/offstage.0.dart index 30ae69ce02..4920e00cf5 100644 --- a/examples/api/lib/widgets/basic/offstage.0.dart +++ b/examples/api/lib/widgets/basic/offstage.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Offstage -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a [FlutterLogo] widget when the `_offstage` member field -// is false, and hides it without any room in the parent when it is true. When -// offstage, this app displays a button to get the logo size, which will be -// displayed in a [SnackBar]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -44,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -52,11 +34,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final GlobalKey _key = GlobalKey(); bool _offstage = true; @@ -101,8 +79,4 @@ class _MyStatefulWidgetState extends State { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/basic/physical_shape.0.dart b/examples/api/lib/widgets/basic/physical_shape.0.dart index 60845b4411..fa4533bfe7 100644 --- a/examples/api/lib/widgets/basic/physical_shape.0.dart +++ b/examples/api/lib/widgets/basic/physical_shape.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for PhysicalShape -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to use a [PhysicalShape] on a centered [SizedBox] -// to clip it to a rounded rectangle using a [ShapeBorderClipper] and give it -// an orange color along with a shadow. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -38,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( appBar: AppBar( @@ -76,8 +56,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/color_filter/color_filtered.0.dart b/examples/api/lib/widgets/color_filter/color_filtered.0.dart index 75eb997124..583aef241b 100644 --- a/examples/api/lib/widgets/color_filter/color_filtered.0.dart +++ b/examples/api/lib/widgets/color_filter/color_filtered.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ColorFiltered -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// These two images have two [ColorFilter]s applied with different [BlendMode]s, -// one with red color and [BlendMode.modulate] another with a grey color and [BlendMode.saturation]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return SingleChildScrollView( child: Column( @@ -58,7 +39,8 @@ class MyStatelessWidget extends StatelessWidget { BlendMode.modulate, ), child: Image.network( - 'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg'), + 'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg', + ), ), ColorFiltered( colorFilter: const ColorFilter.mode( @@ -66,14 +48,11 @@ class MyStatelessWidget extends StatelessWidget { BlendMode.saturation, ), child: Image.network( - 'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl.jpg'), + 'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl.jpg', + ), ), ], ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/dismissible/dismissible.0.dart b/examples/api/lib/widgets/dismissible/dismissible.0.dart index 35231519f6..fc8e3f546d 100644 --- a/examples/api/lib/widgets/dismissible/dismissible.0.dart +++ b/examples/api/lib/widgets/dismissible/dismissible.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Dismissible -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows how you can use the [Dismissible] widget to -// remove list items using swipe gestures. Swipe any of the list -// tiles to the left or right to dismiss them from the [ListView]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -49,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - List items = List.generate(100, (int index) => index); @override @@ -81,8 +60,4 @@ class _MyStatefulWidgetState extends State { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/drag_target/draggable.0.dart b/examples/api/lib/widgets/drag_target/draggable.0.dart index c5884af03a..de5812df7f 100644 --- a/examples/api/lib/widgets/drag_target/draggable.0.dart +++ b/examples/api/lib/widgets/drag_target/draggable.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Draggable -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following example has a [Draggable] widget along with a [DragTarget] -// in a row demonstrating an incremented `acceptedData` integer value when -// you drag the element to the target. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -49,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int acceptedData = 0; @override @@ -111,8 +90,4 @@ class _MyStatefulWidgetState extends State { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/editable_text/editable_text.on_changed.0.dart b/examples/api/lib/widgets/editable_text/editable_text.on_changed.0.dart index 81d7d91cbd..41559343d0 100644 --- a/examples/api/lib/widgets/editable_text/editable_text.on_changed.0.dart +++ b/examples/api/lib/widgets/editable_text/editable_text.on_changed.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for EditableText.onChanged -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how onChanged could be used to check the TextField's -// current value each time the user inserts or deletes a character. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -45,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final TextEditingController _controller = TextEditingController(); @override @@ -95,8 +75,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/editable_text/text_editing_controller.0.dart b/examples/api/lib/widgets/editable_text/text_editing_controller.0.dart index a8ff55f2d8..fbe62f501b 100644 --- a/examples/api/lib/widgets/editable_text/text_editing_controller.0.dart +++ b/examples/api/lib/widgets/editable_text/text_editing_controller.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for TextEditingController -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example creates a [TextField] with a [TextEditingController] whose -// change listener forces the entered text to be lower case and keeps the -// cursor at the end of the input. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -38,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -46,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final TextEditingController _controller = TextEditingController(); @override @@ -86,8 +65,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/focus_manager/focus_node.0.dart b/examples/api/lib/widgets/focus_manager/focus_node.0.dart index a0dd6bb146..7c32781a73 100644 --- a/examples/api/lib/widgets/focus_manager/focus_node.0.dart +++ b/examples/api/lib/widgets/focus_manager/focus_node.0.dart @@ -2,35 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for FocusNode -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how a FocusNode should be managed if not using the -// [Focus] or [FocusScope] widgets. See the [Focus] widget for a similar -// example using [Focus] and [FocusScope] widgets. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - import 'package:flutter/services.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -48,9 +26,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class ColorfulButton extends StatefulWidget { const ColorfulButton({Key? key}) : super(key: key); @@ -139,17 +114,10 @@ class _ColorfulButtonState extends State { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { final TextTheme textTheme = Theme.of(context).textTheme; return DefaultTextStyle( @@ -157,8 +125,4 @@ class MyStatelessWidget extends StatelessWidget { child: const ColorfulButton(), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/focus_manager/focus_node.unfocus.0.dart b/examples/api/lib/widgets/focus_manager/focus_node.unfocus.0.dart index 17b230dbd6..6005b48cb3 100644 --- a/examples/api/lib/widgets/focus_manager/focus_node.unfocus.0.dart +++ b/examples/api/lib/widgets/focus_manager/focus_node.unfocus.0.dart @@ -2,42 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for FocusNode.unfocus -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows the difference between the different [UnfocusDisposition] -// values for [unfocus]. -// -// Try setting focus on the four text fields by selecting them, and then -// select "UNFOCUS" to see what happens when the current -// [FocusManager.primaryFocus] is unfocused. -// -// Try pressing the TAB key after unfocusing to see what the next widget -// chosen is. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/foundation.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -52,7 +24,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -60,11 +31,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - UnfocusDisposition disposition = UnfocusDisposition.scope; @override @@ -126,8 +93,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/focus_scope/focus.0.dart b/examples/api/lib/widgets/focus_scope/focus.0.dart index 3625b12b63..adcef1ec88 100644 --- a/examples/api/lib/widgets/focus_scope/focus.0.dart +++ b/examples/api/lib/widgets/focus_scope/focus.0.dart @@ -2,35 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Focus -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to manage focus using the [Focus] and [FocusScope] -// widgets. See [FocusNode] for a similar example that doesn't use [Focus] or -// [FocusScope]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - import 'package:flutter/services.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -48,7 +26,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -56,11 +33,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Color _color = Colors.white; KeyEventResult _handleKeyPress(FocusNode node, RawKeyEvent event) { @@ -130,8 +103,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/focus_scope/focus.1.dart b/examples/api/lib/widgets/focus_scope/focus.1.dart index e2a22f1838..0449e6301b 100644 --- a/examples/api/lib/widgets/focus_scope/focus.1.dart +++ b/examples/api/lib/widgets/focus_scope/focus.1.dart @@ -2,32 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Focus -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to wrap another widget in a [Focus] widget to make it -// focusable. It wraps a [Container], and changes the container's color when it -// is set as the [FocusManager.primaryFocus]. -// -// If you also want to handle mouse hover and/or keyboard actions on a widget, -// consider using a [FocusableActionDetector], which combines several different -// widgets to provide those capabilities. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,9 +22,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class FocusableText extends StatelessWidget { const FocusableText( this.data, { @@ -81,17 +58,10 @@ class FocusableText extends StatelessWidget { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( body: ListView.builder( @@ -103,8 +73,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/focus_scope/focus.2.dart b/examples/api/lib/widgets/focus_scope/focus.2.dart index 0dee82bdd1..34a567b8a3 100644 --- a/examples/api/lib/widgets/focus_scope/focus.2.dart +++ b/examples/api/lib/widgets/focus_scope/focus.2.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Focus -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to focus a newly-created widget immediately after it -// is created. -// -// The focus node will not actually be given the focus until after the frame in -// which it has requested focus is drawn, so it is OK to call -// [FocusNode.requestFocus] on a node which is not yet in the focus tree. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -49,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int focusedChild = 0; List children = []; List childFocusNodes = []; @@ -108,8 +84,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/focus_scope/focus_scope.0.dart b/examples/api/lib/widgets/focus_scope/focus_scope.0.dart index 9c1d79be3c..e905a84e32 100644 --- a/examples/api/lib/widgets/focus_scope/focus_scope.0.dart +++ b/examples/api/lib/widgets/focus_scope/focus_scope.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for FocusScope -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example demonstrates using a [FocusScope] to restrict focus to a particular -// portion of the app. In this case, restricting focus to the visible part of a -// Stack. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -38,9 +22,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - /// A demonstration pane. /// /// This is just a separate widget to simplify the example. @@ -85,10 +66,6 @@ class Pane extends StatelessWidget { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -96,11 +73,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool backdropIsVisible = false; FocusNode backdropNode = FocusNode(debugLabel: 'Close Backdrop Button'); FocusNode foregroundNode = FocusNode(debugLabel: 'Option Button'); @@ -189,8 +162,4 @@ class _MyStatefulWidgetState extends State { // of its parent. return LayoutBuilder(builder: _buildStack); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/focus_traversal/focus_traversal_group.0.dart b/examples/api/lib/widgets/focus_traversal/focus_traversal_group.0.dart index f9a3b384d2..84e404f636 100644 --- a/examples/api/lib/widgets/focus_traversal/focus_traversal_group.0.dart +++ b/examples/api/lib/widgets/focus_traversal/focus_traversal_group.0.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for FocusTraversalGroup -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows three rows of buttons, each grouped by a -// [FocusTraversalGroup], each with different traversal order policies. Use tab -// traversal to see the order they are traversed in. The first row follows a -// numerical order, the second follows a lexical order (ordered to traverse -// right to left), and the third ignores the numerical order assigned to it and -// traverses in widget order. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,9 +22,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - /// A button wrapper that adds either a numerical or lexical order, depending on /// the type of T. class OrderedButton extends StatefulWidget { @@ -142,17 +120,10 @@ class _OrderedButtonState extends State> { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Container( color: Colors.white, @@ -214,8 +185,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/focus_traversal/ordered_traversal_policy.0.dart b/examples/api/lib/widgets/focus_traversal/ordered_traversal_policy.0.dart index 2b24e00254..e7f1173455 100644 --- a/examples/api/lib/widgets/focus_traversal/ordered_traversal_policy.0.dart +++ b/examples/api/lib/widgets/focus_traversal/ordered_traversal_policy.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for OrderedTraversalPolicy -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows how to assign a traversal order to a widget. In the -// example, the focus order goes from bottom right (the "One" button) to top -// left (the "Six" button). - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -43,9 +27,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class DemoButton extends StatelessWidget { const DemoButton({ Key? key, @@ -76,17 +57,10 @@ class DemoButton extends StatelessWidget { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return FocusTraversalGroup( policy: OrderedTraversalPolicy(), @@ -118,8 +92,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/form/form.0.dart b/examples/api/lib/widgets/form/form.0.dart index 1b3caf9993..e88c639af7 100644 --- a/examples/api/lib/widgets/form/form.0.dart +++ b/examples/api/lib/widgets/form/form.0.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Form -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a [Form] with one [TextFormField] to enter an email -// address and an [ElevatedButton] to submit the form. A [GlobalKey] is used here -// to identify the [Form] and validate input. -// -// ![](https://flutter.github.io/assets-for-api-docs/assets/widgets/form.png) - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -43,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -51,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final GlobalKey _formKey = GlobalKey(); @override @@ -93,8 +70,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/framework/build_owner.0.dart b/examples/api/lib/widgets/framework/build_owner.0.dart index 9dd91f2b75..3a029e2df2 100644 --- a/examples/api/lib/widgets/framework/build_owner.0.dart +++ b/examples/api/lib/widgets/framework/build_owner.0.dart @@ -2,36 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for BuildOwner -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to build an off-screen widget tree used to measure -// the layout size of the rendered tree. For some use cases, the simpler -// [Offstage] widget may be a better alternative to this approach. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - void main() { WidgetsFlutterBinding.ensureInitialized(); final Size size = measureWidget(const SizedBox(width: 640, height: 480)); @@ -83,6 +59,3 @@ class MeasurementView extends RenderBox with RenderObjectWithChildMixin true; } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/widgets/framework/error_widget.0.dart b/examples/api/lib/widgets/framework/error_widget.0.dart index 3d3e8ab727..6456120b43 100644 --- a/examples/api/lib/widgets/framework/error_widget.0.dart +++ b/examples/api/lib/widgets/framework/error_widget.0.dart @@ -2,35 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ErrorWidget -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to override the standard error widget builder in release -// mode, but use the standard one in debug mode. -// -// The error occurs when you click the "Error Prone" button. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//************************************************************************* -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//************************************************************************* - -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - void main() { // Set the ErrorWidget's builder before the app is started. ErrorWidget.builder = (FlutterErrorDetails details) { @@ -101,6 +76,3 @@ class _MyAppState extends State { } } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/widgets/gesture_detector/gesture_detector.0.dart b/examples/api/lib/widgets/gesture_detector/gesture_detector.0.dart index c2c75172ca..b936536a04 100644 --- a/examples/api/lib/widgets/gesture_detector/gesture_detector.0.dart +++ b/examples/api/lib/widgets/gesture_detector/gesture_detector.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for GestureDetector -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example contains a black light bulb wrapped in a [GestureDetector]. It -// turns the light bulb yellow when the "TURN LIGHT ON" button is tapped by -// setting the `_lights` field, and off again when "TURN LIGHT OFF" is tapped. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -38,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -46,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool _lightIsOn = false; @override @@ -88,8 +67,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/gesture_detector/gesture_detector.1.dart b/examples/api/lib/widgets/gesture_detector/gesture_detector.1.dart index 06dd3e9f0c..74ebc9f3f3 100644 --- a/examples/api/lib/widgets/gesture_detector/gesture_detector.1.dart +++ b/examples/api/lib/widgets/gesture_detector/gesture_detector.1.dart @@ -2,32 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for GestureDetector -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example uses a [Container] that wraps a [GestureDetector] widget which -// detects a tap. -// -// Since the [GestureDetector] does not have a child, it takes on the size of its -// parent, making the entire area of the surrounding [Container] clickable. When -// tapped, the [Container] turns yellow by setting the `_color` field. When -// tapped again, it goes back to white. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -50,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Color _color = Colors.white; @override @@ -74,8 +49,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/heroes/hero.0.dart b/examples/api/lib/widgets/heroes/hero.0.dart index 5c784aefd7..0014789d4f 100644 --- a/examples/api/lib/widgets/heroes/hero.0.dart +++ b/examples/api/lib/widgets/heroes/hero.0.dart @@ -2,35 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Hero -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows a [Hero] used within a [ListTile]. -// -// Tapping on the Hero-wrapped rectangle triggers a hero -// animation as a new [MaterialPageRoute] is pushed. Both the size -// and location of the rectangle animates. -// -// Both widgets use the same [Hero.tag]. -// -// The Hero widget uses the matching tags to identify and execute this -// animation. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -50,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -106,8 +79,4 @@ class MyStatelessWidget extends StatelessWidget { ), )); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/image/image.error_builder.0.dart b/examples/api/lib/widgets/image/image.error_builder.0.dart index b9af8a3e77..d97763f27c 100644 --- a/examples/api/lib/widgets/image/image.error_builder.0.dart +++ b/examples/api/lib/widgets/image/image.error_builder.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Image.errorBuilder -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following sample uses [errorBuilder] to show a '😢' in place of the -// image that fails to load, and prints the error to the console. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +26,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return DecoratedBox( decoration: BoxDecoration( @@ -71,8 +52,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/image/image.frame_builder.0.dart b/examples/api/lib/widgets/image/image.frame_builder.0.dart index c9b65691f2..6c183bea0a 100644 --- a/examples/api/lib/widgets/image/image.frame_builder.0.dart +++ b/examples/api/lib/widgets/image/image.frame_builder.0.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Image.frameBuilder -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following sample demonstrates how to use this builder to implement an -// image that fades in once it's been loaded. -// -// This sample contains a limited subset of the functionality that the -// [FadeInImage] widget provides out of the box. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - @override Widget build(BuildContext context) { return DecoratedBox( @@ -73,8 +51,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/image/image.loading_builder.0.dart b/examples/api/lib/widgets/image/image.loading_builder.0.dart index 5fdf183a8d..8f5bff7b14 100644 --- a/examples/api/lib/widgets/image/image.loading_builder.0.dart +++ b/examples/api/lib/widgets/image/image.loading_builder.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Image.loadingBuilder -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following sample uses [loadingBuilder] to show a -// [CircularProgressIndicator] while an image loads over the network. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return DecoratedBox( decoration: BoxDecoration( @@ -71,8 +52,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/implicit_animations/animated_align.0.dart b/examples/api/lib/widgets/implicit_animations/animated_align.0.dart index 12f5527321..d3752891d2 100644 --- a/examples/api/lib/widgets/implicit_animations/animated_align.0.dart +++ b/examples/api/lib/widgets/implicit_animations/animated_align.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AnimatedAlign -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following code implements the [AnimatedAlign] widget, using a [curve] of -// [Curves.fastOutSlowIn]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -48,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool selected = false; @override @@ -78,8 +58,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/implicit_animations/animated_container.0.dart b/examples/api/lib/widgets/implicit_animations/animated_container.0.dart index a089ee1dfb..526ed1b7db 100644 --- a/examples/api/lib/widgets/implicit_animations/animated_container.0.dart +++ b/examples/api/lib/widgets/implicit_animations/animated_container.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AnimatedContainer -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following example (depicted above) transitions an AnimatedContainer -// between two states. It adjusts the `height`, `width`, `color`, and -// [alignment] properties when tapped. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -49,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool selected = false; @override @@ -78,8 +57,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/implicit_animations/animated_padding.0.dart b/examples/api/lib/widgets/implicit_animations/animated_padding.0.dart index e85e667305..de65957c11 100644 --- a/examples/api/lib/widgets/implicit_animations/animated_padding.0.dart +++ b/examples/api/lib/widgets/implicit_animations/animated_padding.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AnimatedPadding -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following code implements the [AnimatedPadding] widget, using a [curve] of -// [Curves.easeInOut]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -48,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - double padValue = 0.0; void _updatePadding(double value) { setState(() { @@ -84,8 +64,4 @@ class _MyStatefulWidgetState extends State { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/implicit_animations/animated_positioned.0.dart b/examples/api/lib/widgets/implicit_animations/animated_positioned.0.dart index 087e5b5f8e..d0bfd56f81 100644 --- a/examples/api/lib/widgets/implicit_animations/animated_positioned.0.dart +++ b/examples/api/lib/widgets/implicit_animations/animated_positioned.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AnimatedPositioned -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following example transitions an AnimatedPositioned -// between two states. It adjusts the `height`, `width`, and -// [Positioned] properties when tapped. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -43,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -51,11 +34,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool selected = false; @override @@ -87,8 +66,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/implicit_animations/animated_slide.0.dart b/examples/api/lib/widgets/implicit_animations/animated_slide.0.dart index f4242f77b0..1509822b10 100644 --- a/examples/api/lib/widgets/implicit_animations/animated_slide.0.dart +++ b/examples/api/lib/widgets/implicit_animations/animated_slide.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AnimatedSlide -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This code defines a widget that uses [AnimatedSlide] to translate a [FlutterLogo] -// up or down by the amount of it's height with each press of the corresponding button. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -48,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Offset offset = Offset.zero; void _slideUp() { @@ -88,8 +68,4 @@ class _MyStatefulWidgetState extends State { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/implicit_animations/sliver_animated_opacity.0.dart b/examples/api/lib/widgets/implicit_animations/sliver_animated_opacity.0.dart index d601f5c642..2fc14bc7e3 100644 --- a/examples/api/lib/widgets/implicit_animations/sliver_animated_opacity.0.dart +++ b/examples/api/lib/widgets/implicit_animations/sliver_animated_opacity.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center_freeform_state.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SliverAnimatedOpacity -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Creates a [CustomScrollView] with a [SliverFixedExtentList] and a -// [FloatingActionButton]. Pressing the button animates the lists' opacity. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -50,10 +34,6 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class _MyStatefulWidgetState extends State with SingleTickerProviderStateMixin { bool _visible = true; @@ -89,6 +69,3 @@ class _MyStatefulWidgetState extends State ]); } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/widgets/inherited_notifier/inherited_notifier.0.dart b/examples/api/lib/widgets/inherited_notifier/inherited_notifier.0.dart index 145634ddd4..0e77243431 100644 --- a/examples/api/lib/widgets/inherited_notifier/inherited_notifier.0.dart +++ b/examples/api/lib/widgets/inherited_notifier/inherited_notifier.0.dart @@ -2,45 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material_ticker.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for InheritedNotifier -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows three spinning squares that use the value of the notifier -// on an ancestor [InheritedNotifier] (`SpinModel`) to give them their -// rotation. The [InheritedNotifier] doesn't need to know about the children, -// and the `notifier` argument doesn't need to be an animation controller, it -// can be anything that implements [Listenable] (like a [ChangeNotifier]). -// -// The `SpinModel` class could just as easily listen to another object (say, a -// separate object that keeps the value of an input or data model value) that -// is a [Listenable], and get the value from that. The descendants also don't -// need to have an instance of the [InheritedNotifier] in order to use it, they -// just need to know that there is one in their ancestry. This can help with -// decoupling widgets from their models. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//******************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-dartImports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'dart:math' as math; -//* ▲▲▲▲▲▲▲▲ code-dartImports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************************** - import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -55,9 +24,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class SpinModel extends InheritedNotifier { const SpinModel({ Key? key, @@ -92,10 +58,6 @@ class Spinner extends StatelessWidget { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -103,13 +65,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin. class _MyStatefulWidgetState extends State with TickerProviderStateMixin { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - late AnimationController _controller; @override @@ -141,8 +99,4 @@ class _MyStatefulWidgetState extends State ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/inherited_theme/inherited_theme.0.dart b/examples/api/lib/widgets/inherited_theme/inherited_theme.0.dart index 174902f8cf..af6d628f6d 100644 --- a/examples/api/lib/widgets/inherited_theme/inherited_theme.0.dart +++ b/examples/api/lib/widgets/inherited_theme/inherited_theme.0.dart @@ -2,49 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for InheritedTheme -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example demonstrates how `InheritedTheme.capture()` can be used -// to wrap the contents of a new route with the inherited themes that -// are present when the route was built - but are not present when route -// is actually shown. -// -// If the same code is run without `InheritedTheme.capture(), the -// new route's Text widget will inherit the "something must be wrong" -// fallback text style, rather than the default text style defined in MyApp. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - -//************************************************************************* -//* ▼▼▼▼▼▼▼▼ code-main ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - void main() { runApp(const MyApp()); } -//* ▲▲▲▲▲▲▲▲ code-main ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//************************************************************************* - -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class MyAppBody extends StatelessWidget { const MyAppBody({Key? key}) : super(key: key); @@ -100,6 +65,3 @@ class MyApp extends StatelessWidget { ); } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/widgets/interactive_viewer/interactive_viewer.0.dart b/examples/api/lib/widgets/interactive_viewer/interactive_viewer.0.dart index 06261a64e6..e40704d0a5 100644 --- a/examples/api/lib/widgets/interactive_viewer/interactive_viewer.0.dart +++ b/examples/api/lib/widgets/interactive_viewer/interactive_viewer.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for InteractiveViewer -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a simple Container that can be panned and zoomed. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Center( child: InteractiveViewer( @@ -66,8 +48,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/interactive_viewer/interactive_viewer.builder.0.dart b/examples/api/lib/widgets/interactive_viewer/interactive_viewer.builder.0.dart index 354c1442d9..3efa90e348 100644 --- a/examples/api/lib/widgets/interactive_viewer/interactive_viewer.builder.0.dart +++ b/examples/api/lib/widgets/interactive_viewer/interactive_viewer.builder.0.dart @@ -2,28 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for InteractiveViewer.builder -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to use builder to create a [Table] whose cell -// contents are only built when they are visible. Built and remove cells are -// logged in the console for illustration. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; -//************************************************************************* -//* ▼▼▼▼▼▼▼▼ code-main ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - import 'package:vector_math/vector_math_64.dart' show Quad, Vector3; void main() => runApp(const IVBuilderExampleApp()); @@ -203,6 +185,3 @@ class _TableBuilder extends StatelessWidget { ); } } - -//* ▲▲▲▲▲▲▲▲ code-main ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//************************************************************************* diff --git a/examples/api/lib/widgets/interactive_viewer/interactive_viewer.constrained.0.dart b/examples/api/lib/widgets/interactive_viewer/interactive_viewer.constrained.0.dart index eb8e0027df..c15ccedbfd 100644 --- a/examples/api/lib/widgets/interactive_viewer/interactive_viewer.constrained.0.dart +++ b/examples/api/lib/widgets/interactive_viewer/interactive_viewer.constrained.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for InteractiveViewer.constrained -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how to create a pannable table. Because the table is -// larger than the entire screen, setting `constrained` to false is necessary -// to allow it to be drawn to its full size. The parts of the table that -// exceed the screen size can then be panned into view. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { const int _rowCount = 48; const int _columnCount = 6; @@ -84,8 +63,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/interactive_viewer/interactive_viewer.transformation_controller.0.dart b/examples/api/lib/widgets/interactive_viewer/interactive_viewer.transformation_controller.0.dart index 9f9a18dac4..8b0f51e729 100644 --- a/examples/api/lib/widgets/interactive_viewer/interactive_viewer.transformation_controller.0.dart +++ b/examples/api/lib/widgets/interactive_viewer/interactive_viewer.transformation_controller.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material_ticker.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for InteractiveViewer.transformationController -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows how transformationController can be used to animate the -// transformation back to its starting position. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -45,13 +29,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin. class _MyStatefulWidgetState extends State with TickerProviderStateMixin { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final TransformationController _transformationController = TransformationController(); Animation? _animationReset; @@ -144,8 +124,4 @@ class _MyStatefulWidgetState extends State ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/layout_builder/layout_builder.0.dart b/examples/api/lib/widgets/layout_builder/layout_builder.0.dart index 03cceff7d1..b1561aaa33 100644 --- a/examples/api/lib/widgets/layout_builder/layout_builder.0.dart +++ b/examples/api/lib/widgets/layout_builder/layout_builder.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for LayoutBuilder -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example uses a [LayoutBuilder] to build a different widget depending on the available width. Resize the -// DartPad window to see [LayoutBuilder] in action! - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('LayoutBuilder Example')), @@ -89,8 +70,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/media_query/media_query_data.system_gesture_insets.0.dart b/examples/api/lib/widgets/media_query/media_query_data.system_gesture_insets.0.dart index fec9c60b63..1c85e78c99 100644 --- a/examples/api/lib/widgets/media_query/media_query_data.system_gesture_insets.0.dart +++ b/examples/api/lib/widgets/media_query/media_query_data.system_gesture_insets.0.dart @@ -2,32 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for MediaQueryData.systemGestureInsets -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// For apps that might be deployed on Android Q devices with full gesture -// navigation enabled, use [systemGestureInsets] with [Padding] -// to avoid having the left and right edges of the [Slider] from appearing -// within the area reserved for system gesture navigation. -// -// By default, [Slider]s expand to fill the available width. So, we pad the -// left and right sides. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -50,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - double _currentValue = 0.2; @override @@ -81,8 +56,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/navigator/navigator.0.dart b/examples/api/lib/widgets/navigator/navigator.0.dart index 9e8af243ea..65e42b26db 100644 --- a/examples/api/lib/widgets/navigator/navigator.0.dart +++ b/examples/api/lib/widgets/navigator/navigator.0.dart @@ -2,47 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Navigator -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following example demonstrates how a nested [Navigator] can be used to -// present a standalone user registration journey. -// -// Even though this example uses two [Navigator]s to demonstrate nested -// [Navigator]s, a similar result is possible using only a single [Navigator]. -// -// Run this example with `flutter run --route=/signup` to start it with -// the signup flow instead of on the home page. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - -//************************************************************************* -//* ▼▼▼▼▼▼▼▼ code-main ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - void main() => runApp(const MyApp()); -//* ▲▲▲▲▲▲▲▲ code-main ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//************************************************************************* - -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -163,6 +128,3 @@ class SignUpPage extends StatelessWidget { ); } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/widgets/navigator/navigator.restorable_push.0.dart b/examples/api/lib/widgets/navigator/navigator.restorable_push.0.dart index 573e275e03..1a3fc3222d 100644 --- a/examples/api/lib/widgets/navigator/navigator.restorable_push.0.dart +++ b/examples/api/lib/widgets/navigator/navigator.restorable_push.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Navigator.restorablePush -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Typical usage is as follows: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -36,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -44,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - static Route _myRouteBuilder(BuildContext context, Object? arguments) { return MaterialPageRoute( builder: (BuildContext context) => const MyStatefulWidget(), @@ -68,8 +49,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/navigator/navigator.restorable_push_and_remove_until.0.dart b/examples/api/lib/widgets/navigator/navigator.restorable_push_and_remove_until.0.dart index a8575bffe9..78282a8660 100644 --- a/examples/api/lib/widgets/navigator/navigator.restorable_push_and_remove_until.0.dart +++ b/examples/api/lib/widgets/navigator/navigator.restorable_push_and_remove_until.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Navigator.restorablePushAndRemoveUntil -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Typical usage is as follows: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -36,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -44,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - static Route _myRouteBuilder(BuildContext context, Object? arguments) { return MaterialPageRoute( builder: (BuildContext context) => const MyStatefulWidget(), @@ -72,8 +53,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/navigator/navigator.restorable_push_replacement.0.dart b/examples/api/lib/widgets/navigator/navigator.restorable_push_replacement.0.dart index 99e120421d..fe1f4ddcc4 100644 --- a/examples/api/lib/widgets/navigator/navigator.restorable_push_replacement.0.dart +++ b/examples/api/lib/widgets/navigator/navigator.restorable_push_replacement.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Navigator.restorablePushReplacement -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Typical usage is as follows: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -36,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -44,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - static Route _myRouteBuilder(BuildContext context, Object? arguments) { return MaterialPageRoute( builder: (BuildContext context) => const MyStatefulWidget(), @@ -69,8 +50,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/navigator/navigator_state.restorable_push.0.dart b/examples/api/lib/widgets/navigator/navigator_state.restorable_push.0.dart index c5de28ba77..754b4d9ac9 100644 --- a/examples/api/lib/widgets/navigator/navigator_state.restorable_push.0.dart +++ b/examples/api/lib/widgets/navigator/navigator_state.restorable_push.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for NavigatorState.restorablePush -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Typical usage is as follows: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -36,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -44,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - static Route _myRouteBuilder(BuildContext context, Object? arguments) { return MaterialPageRoute( builder: (BuildContext context) => const MyStatefulWidget(), @@ -68,8 +49,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/navigator/navigator_state.restorable_push_and_remove_until.0.dart b/examples/api/lib/widgets/navigator/navigator_state.restorable_push_and_remove_until.0.dart index f2e6b9267f..4c7fe48c10 100644 --- a/examples/api/lib/widgets/navigator/navigator_state.restorable_push_and_remove_until.0.dart +++ b/examples/api/lib/widgets/navigator/navigator_state.restorable_push_and_remove_until.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for NavigatorState.restorablePushAndRemoveUntil -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Typical usage is as follows: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -36,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -44,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - static Route _myRouteBuilder(BuildContext context, Object? arguments) { return MaterialPageRoute( builder: (BuildContext context) => const MyStatefulWidget(), @@ -71,8 +52,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/navigator/navigator_state.restorable_push_replacement.0.dart b/examples/api/lib/widgets/navigator/navigator_state.restorable_push_replacement.0.dart index 9d1bdf524e..0a190424a4 100644 --- a/examples/api/lib/widgets/navigator/navigator_state.restorable_push_replacement.0.dart +++ b/examples/api/lib/widgets/navigator/navigator_state.restorable_push_replacement.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for NavigatorState.restorablePushReplacement -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Typical usage is as follows: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -36,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -44,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - static Route _myRouteBuilder(BuildContext context, Object? arguments) { return MaterialPageRoute( builder: (BuildContext context) => const MyStatefulWidget(), @@ -70,8 +51,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/navigator/restorable_route_future.0.dart b/examples/api/lib/widgets/navigator/restorable_route_future.0.dart index 7d952eda15..b52dc8968c 100644 --- a/examples/api/lib/widgets/navigator/restorable_route_future.0.dart +++ b/examples/api/lib/widgets/navigator/restorable_route_future.0.dart @@ -2,41 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for RestorableRouteFuture -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example uses a [RestorableRouteFuture] in the `_MyHomeState` to push a -// new `MyCounter` route and to retrieve its return value. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - -//************************************************************************* -//* ▼▼▼▼▼▼▼▼ code-main ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - void main() => runApp(const MyApp()); -//* ▲▲▲▲▲▲▲▲ code-main ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//************************************************************************* - -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -52,12 +23,6 @@ class MyApp extends StatelessWidget { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class MyHome extends StatefulWidget { const MyHome({Key? key}) : super(key: key); @@ -190,6 +155,3 @@ class _MyCounterState extends State with RestorationMixin { ); } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.0.dart b/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.0.dart index ce4ae4cc1a..57bb9ca7af 100644 --- a/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.0.dart +++ b/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.0.dart @@ -2,32 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for NestedScrollView -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a [NestedScrollView] whose header is the combination of a -// [TabBar] in a [SliverAppBar] and whose body is a [TabBarView]. It uses a -// [SliverOverlapAbsorber]/[SliverOverlapInjector] pair to make the inner lists -// align correctly, and it uses [SafeArea] to avoid any horizontal disturbances -// (e.g. the "notch" on iOS when the phone is horizontal). In addition, -// [PageStorageKey]s are used to remember the scroll position of each tab's -// list. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { final List _tabs = ['Tab 1', 'Tab 2']; return DefaultTabController( @@ -159,8 +135,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.1.dart b/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.1.dart index 8e982d1dce..1dbae81913 100644 --- a/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.1.dart +++ b/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.1.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for NestedScrollView -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This simple example shows a [NestedScrollView] whose header contains a -// floating [SliverAppBar]. By using the [floatHeaderSlivers] property, the -// floating behavior is coordinated between the outer and inner [Scrollable]s, -// so it behaves as it would in a single scrollable. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( body: NestedScrollView( @@ -74,8 +53,4 @@ class MyStatelessWidget extends StatelessWidget { ); }))); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.2.dart b/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.2.dart index da5a1dc21c..f858793ccf 100644 --- a/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.2.dart +++ b/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view.2.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for NestedScrollView -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This simple example shows a [NestedScrollView] whose header contains a -// snapping, floating [SliverAppBar]. _Without_ setting any additional flags, -// e.g [NestedScrollView.floatHeaderSlivers], the [SliverAppBar] will animate -// in and out without floating. The [SliverOverlapAbsorber] and -// [SliverOverlapInjector] maintain the proper alignment between the two -// separate scroll views. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( body: NestedScrollView(headerSliverBuilder: @@ -87,8 +64,4 @@ class MyStatelessWidget extends StatelessWidget { ); }))); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view_state.0.dart b/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view_state.0.dart index 434342a172..6ee0e5f859 100644 --- a/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view_state.0.dart +++ b/examples/api/lib/widgets/nested_scroll_view/nested_scroll_view_state.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for NestedScrollViewState -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// [NestedScrollViewState] can be obtained using a [GlobalKey]. -// Using the following setup, you can access the inner scroll controller -// using `globalKey.currentState.innerController`. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -38,22 +22,12 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final GlobalKey globalKey = GlobalKey(); -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - @override Widget build(BuildContext context) { return NestedScrollView( @@ -74,8 +48,4 @@ class MyStatelessWidget extends StatelessWidget { ScrollController get innerController { return globalKey.currentState!.innerController; } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/notification_listener/notification.0.dart b/examples/api/lib/widgets/notification_listener/notification.0.dart index 02ea516f66..c8103ebcd4 100644 --- a/examples/api/lib/widgets/notification_listener/notification.0.dart +++ b/examples/api/lib/widgets/notification_listener/notification.0.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Notification -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows a [NotificationListener] widget -// that listens for [ScrollNotification] notifications. When a scroll -// event occurs in the [NestedScrollView], -// this widget is notified. The events could be either a -// [ScrollStartNotification]or[ScrollEndNotification]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { const List _tabs = ['Months', 'Days']; const List _months = [ @@ -109,8 +87,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/overflow_bar/overflow_bar.0.dart b/examples/api/lib/widgets/overflow_bar/overflow_bar.0.dart index e210d23c8e..9185c78037 100644 --- a/examples/api/lib/widgets/overflow_bar/overflow_bar.0.dart +++ b/examples/api/lib/widgets/overflow_bar/overflow_bar.0.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for OverflowBar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example defines a simple approximation of a dialog -// layout, where the layout of the dialog's action buttons are -// defined by an [OverflowBar]. The content is wrapped in a -// [SingleChildScrollView], so that if overflow occurs, the -// action buttons will still be accessible by scrolling, -// no matter how much vertical space is available. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -46,14 +27,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Container( alignment: Alignment.center, @@ -93,8 +70,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.0.dart b/examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.0.dart index 04da096776..99e0198dc6 100644 --- a/examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.0.dart +++ b/examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for GlowingOverscrollIndicator -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example demonstrates how to use a [NotificationListener] to manipulate -// the placement of a [GlowingOverscrollIndicator] when building a -// [CustomScrollView]. Drag the scrollable to see the bounds of the overscroll -// indicator. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { final double leadingPaintOffset = MediaQuery.of(context).padding.top + AppBar().preferredSize.height; @@ -75,8 +54,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.1.dart b/examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.1.dart index a9edb9ecef..ba6b46b193 100644 --- a/examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.1.dart +++ b/examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.1.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for GlowingOverscrollIndicator -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example demonstrates how to use a [NestedScrollView] to manipulate the -// placement of a [GlowingOverscrollIndicator] when building a -// [CustomScrollView]. Drag the scrollable to see the bounds of the overscroll -// indicator. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return NestedScrollView( headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { @@ -71,8 +50,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/page_storage/page_storage.0.dart b/examples/api/lib/widgets/page_storage/page_storage.0.dart index d25dbb4298..5311646ee6 100644 --- a/examples/api/lib/widgets/page_storage/page_storage.0.dart +++ b/examples/api/lib/widgets/page_storage/page_storage.0.dart @@ -2,43 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for PageStorage -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows how to explicitly use a [PageStorage] to -// store the states of its children pages. Each page includes a scrollable -// list, whose position is preserved when switching between the tabs thanks to -// the help of [PageStorageKey]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - -//************************************************************************* -//* ▼▼▼▼▼▼▼▼ code-main ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - void main() => runApp(const MyApp()); -//* ▲▲▲▲▲▲▲▲ code-main ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//************************************************************************* - -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -120,6 +89,3 @@ class ColorBoxPage extends StatelessWidget { ); } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/widgets/page_view/page_view.0.dart b/examples/api/lib/widgets/page_view/page_view.0.dart index a4e0038cdc..9a9952c141 100644 --- a/examples/api/lib/widgets/page_view/page_view.0.dart +++ b/examples/api/lib/widgets/page_view/page_view.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for PageView -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here is an example of [PageView]. It creates a centered [Text] in each of the three pages -// which scroll horizontally. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -40,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { final PageController controller = PageController(initialPage: 0); return PageView( @@ -68,8 +49,4 @@ class MyStatelessWidget extends StatelessWidget { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/preferred_size/preferred_size.0.dart b/examples/api/lib/widgets/preferred_size/preferred_size.0.dart index 123dfc1b2a..47675d0322 100644 --- a/examples/api/lib/widgets/preferred_size/preferred_size.0.dart +++ b/examples/api/lib/widgets/preferred_size/preferred_size.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for PreferredSize -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows a custom widget, similar to an [AppBar], which uses a -// [PreferredSize] widget, with its height set to 80 logical pixels. -// Changing the [PreferredSize] can be used to change the height -// of the custom app bar. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,9 +22,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class AppBarContent extends StatelessWidget { const AppBarContent({Key? key}) : super(key: key); @@ -83,17 +63,10 @@ class AppBarContent extends StatelessWidget { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( appBar: PreferredSize( @@ -112,8 +85,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/restoration/restoration_mixin.0.dart b/examples/api/lib/widgets/restoration/restoration_mixin.0.dart new file mode 100644 index 0000000000..193ffddff2 --- /dev/null +++ b/examples/api/lib/widgets/restoration/restoration_mixin.0.dart @@ -0,0 +1,97 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Flutter code sample for RestorationMixin + +import 'package:flutter/material.dart'; + +void main() => runApp(const RestorationExampleApp()); + +class RestorationExampleApp extends StatelessWidget { + const RestorationExampleApp({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return const MaterialApp( + restorationScopeId: 'app', + title: 'Restorable Counter', + home: RestorableCounter(restorationId: 'counter'), + ); + } +} + +class RestorableCounter extends StatefulWidget { + const RestorableCounter({Key? key, this.restorationId}) : super(key: key); + + final String? restorationId; + + @override + State createState() => _RestorableCounterState(); +} + +// The [State] object uses the [RestorationMixin] to make the current value +// of the counter restorable. +class _RestorableCounterState extends State + with RestorationMixin { + // The current value of the counter is stored in a [RestorableProperty]. + // During state restoration it is automatically restored to its old value. + // If no restoration data is available to restore the counter from, it is + // initialized to the specified default value of zero. + final RestorableInt _counter = RestorableInt(0); + + // In this example, the restoration ID for the mixin is passed in through + // the [StatefulWidget]'s constructor. + @override + String? get restorationId => widget.restorationId; + + @override + void restoreState(RestorationBucket? oldBucket, bool initialRestore) { + // All restorable properties must be registered with the mixin. After + // registration, the counter either has its old value restored or is + // initialized to its default value. + registerForRestoration(_counter, 'count'); + } + + void _incrementCounter() { + setState(() { + // The current value of the property can be accessed and modified via + // the value getter and setter. + _counter.value++; + }); + } + + @override + void dispose() { + _counter.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Restorable Counter'), + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text( + 'You have pushed the button this many times:', + ), + Text( + '${_counter.value}', + style: Theme.of(context).textTheme.headline4, + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: _incrementCounter, + tooltip: 'Increment', + child: const Icon(Icons.add), + ), + ); + } +} diff --git a/examples/api/lib/widgets/restoration_properties/restorable_value.0.dart b/examples/api/lib/widgets/restoration_properties/restorable_value.0.dart index f44e1b90e7..55d39cd19a 100644 --- a/examples/api/lib/widgets/restoration_properties/restorable_value.0.dart +++ b/examples/api/lib/widgets/restoration_properties/restorable_value.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_restoration.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for RestorableValue -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// A [StatefulWidget] that has a restorable [int] property. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key, this.restorationId}) : super(key: key); @@ -49,7 +34,6 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// RestorationProperty objects can be used because of RestorationMixin. class _MyStatefulWidgetState extends State with RestorationMixin { @@ -58,9 +42,6 @@ class _MyStatefulWidgetState extends State @override String? get restorationId => widget.restorationId; -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - // The current value of the answer is stored in a [RestorableProperty]. // During state restoration it is automatically restored to its old value. // If no restoration data is available to restore the answer from, it is @@ -97,8 +78,4 @@ class _MyStatefulWidgetState extends State onPressed: _incrementAnswer, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/routes/show_general_dialog.0.dart b/examples/api/lib/widgets/routes/show_general_dialog.0.dart index 5214a43b81..2b1a82fac4 100644 --- a/examples/api/lib/widgets/routes/show_general_dialog.0.dart +++ b/examples/api/lib/widgets/routes/show_general_dialog.0.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_restoration_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for showGeneralDialog -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample demonstrates how to create a restorable dialog. This is -// accomplished by enabling state restoration by specifying -// [WidgetsApp.restorationScopeId] and using [Navigator.restorablePush] to -// push [RawDialogRoute] when the button is tapped. -// -// {@macro flutter.widgets.RestorationManager} - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,14 +23,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Scaffold( body: Center( @@ -75,8 +52,4 @@ class MyStatelessWidget extends StatelessWidget { }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/scroll_position/scroll_metrics_notification.0.dart b/examples/api/lib/widgets/scroll_position/scroll_metrics_notification.0.dart index 27bde4c7fe..496015fea8 100644 --- a/examples/api/lib/widgets/scroll_position/scroll_metrics_notification.0.dart +++ b/examples/api/lib/widgets/scroll_position/scroll_metrics_notification.0.dart @@ -2,25 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/freeform.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ScrollMetricsNotification -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows how a [ScrollMetricsNotification] is dispatched when -// the `windowSize` is changed. Press the floating action button to increase -// the scrollable window's size. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//************************************************************************* -//* ▼▼▼▼▼▼▼▼ code-main ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'package:flutter/material.dart'; @@ -75,6 +57,3 @@ class ScrollMetricsDemoState extends State { ); } } - -//* ▲▲▲▲▲▲▲▲ code-main ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//************************************************************************* diff --git a/examples/api/lib/widgets/scroll_view/custom_scroll_view.1.dart b/examples/api/lib/widgets/scroll_view/custom_scroll_view.1.dart index 827328b117..bd05e866a5 100644 --- a/examples/api/lib/widgets/scroll_view/custom_scroll_view.1.dart +++ b/examples/api/lib/widgets/scroll_view/custom_scroll_view.1.dart @@ -2,33 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for CustomScrollView -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// By default, if items are inserted at the "top" of a scrolling container like -// [ListView] or [CustomScrollView], the top item and all of the items below it -// are scrolled downwards. In some applications, it's preferable to have the -// top of the list just grow upwards, without changing the scroll position. -// This example demonstrates how to do that with a [CustomScrollView] with -// two [SliverList] children, and the [CustomScrollView.center] set to the key -// of the bottom SliverList. The top one SliverList will grow upwards, and the -// bottom SliverList will grow downwards. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -43,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -51,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - List top = []; List bottom = [0]; @@ -109,8 +83,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/scrollbar/raw_scrollbar.0.dart b/examples/api/lib/widgets/scrollbar/raw_scrollbar.0.dart index f6c497d1c7..0d5bdcfb62 100644 --- a/examples/api/lib/widgets/scrollbar/raw_scrollbar.0.dart +++ b/examples/api/lib/widgets/scrollbar/raw_scrollbar.0.dart @@ -2,34 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for RawScrollbar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows an app with two scrollables in the same route. Since by -// default, there is one [PrimaryScrollController] per route, and they both have a -// scroll direction of [Axis.vertical], they would both try to attach to that -// controller. The [Scrollbar] cannot support multiple positions attached to -// the same controller, so one [ListView], and its [Scrollbar] have been -// provided a unique [ScrollController]. -// -// Alternatively, a new PrimaryScrollController could be created above one of -// the [ListView]s. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -49,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -57,11 +34,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final ScrollController _firstController = ScrollController(); @override @@ -114,8 +87,4 @@ class _MyStatefulWidgetState extends State { ); }); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/scrollbar/raw_scrollbar.1.dart b/examples/api/lib/widgets/scrollbar/raw_scrollbar.1.dart index 08b2bda958..53214ea98a 100644 --- a/examples/api/lib/widgets/scrollbar/raw_scrollbar.1.dart +++ b/examples/api/lib/widgets/scrollbar/raw_scrollbar.1.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for RawScrollbar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows a [RawScrollbar] that executes a fade animation as -// scrolling occurs. The RawScrollbar will fade into view as the user scrolls, -// and fade out when scrolling stops. The [GridView] uses the -// [PrimaryScrollController] since it has an [Axis.vertical] scroll direction -// and has not been provided a [ScrollController]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -43,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return RawScrollbar( child: GridView.builder( @@ -65,8 +43,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/scrollbar/raw_scrollbar.2.dart b/examples/api/lib/widgets/scrollbar/raw_scrollbar.2.dart index e9b8ec96ff..8e9debd94a 100644 --- a/examples/api/lib/widgets/scrollbar/raw_scrollbar.2.dart +++ b/examples/api/lib/widgets/scrollbar/raw_scrollbar.2.dart @@ -2,30 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for RawScrollbar -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// When `isAlwaysShown` is true, the scrollbar thumb will remain visible without -// the fade animation. This requires that a [ScrollController] is provided to -// `controller` for both the [RawScrollbar] and the [GridView]. -// Alternatively, the [PrimaryScrollController] can be used automatically so long -// as it is attached to the singular [ScrollPosition] associated with the GridView. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -43,7 +25,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -51,11 +32,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final ScrollController _controllerOne = ScrollController(); @override @@ -76,8 +53,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/scrollbar/raw_scrollbar.shape.0.dart b/examples/api/lib/widgets/scrollbar/raw_scrollbar.shape.0.dart new file mode 100644 index 0000000000..869c9f58e3 --- /dev/null +++ b/examples/api/lib/widgets/scrollbar/raw_scrollbar.shape.0.dart @@ -0,0 +1,45 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Flutter code sample for RawScrollbar.shape + +import 'package:flutter/material.dart'; + +void main() => runApp(const MyApp()); + +class MyApp extends StatelessWidget { + const MyApp({Key? key}) : super(key: key); + + static const String _title = 'Flutter Code Sample'; + + @override + Widget build(BuildContext context) { + return const MaterialApp( + title: _title, + home: MyStatelessWidget(), + ); + } +} + +class MyStatelessWidget extends StatelessWidget { + const MyStatelessWidget({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + body: RawScrollbar( + child: ListView( + children: List.generate( + 100, (int index) => Text((index * index).toString())), + physics: const BouncingScrollPhysics(), + ), + shape: const StadiumBorder( + side: BorderSide(color: Colors.brown, width: 3.0)), + thickness: 15.0, + thumbColor: Colors.blue, + isAlwaysShown: true, + ), + ); + } +} diff --git a/examples/api/lib/widgets/shortcuts/character_activator.0.dart b/examples/api/lib/widgets/shortcuts/character_activator.0.dart index 392d988fad..bf05a3c6e4 100644 --- a/examples/api/lib/widgets/shortcuts/character_activator.0.dart +++ b/examples/api/lib/widgets/shortcuts/character_activator.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for CharacterActivator -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// In the following example, when a key combination results in a question mark, -// the counter is increased: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,17 +27,10 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class HelpMenuIntent extends Intent { const HelpMenuIntent(); } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -60,11 +38,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - @override Widget build(BuildContext context) { return Shortcuts( @@ -93,8 +67,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/shortcuts/logical_key_set.0.dart b/examples/api/lib/widgets/shortcuts/logical_key_set.0.dart index fe5103a701..241b03b1c6 100644 --- a/examples/api/lib/widgets/shortcuts/logical_key_set.0.dart +++ b/examples/api/lib/widgets/shortcuts/logical_key_set.0.dart @@ -2,42 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for LogicalKeySet -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// In the following example, the counter is increased when the following key -// sequences are pressed: -// -// * Control left, then C. -// * Control right, then C. -// * C, then Control left. -// -// But not when: -// -// * Control left, then A, then C. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - import 'package:flutter/services.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -57,17 +28,10 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class IncrementIntent extends Intent { const IncrementIntent(); } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -75,11 +39,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int count = 0; @override @@ -109,8 +69,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/shortcuts/shortcuts.0.dart b/examples/api/lib/widgets/shortcuts/shortcuts.0.dart index f8448e22df..c81217ab69 100644 --- a/examples/api/lib/widgets/shortcuts/shortcuts.0.dart +++ b/examples/api/lib/widgets/shortcuts/shortcuts.0.dart @@ -2,39 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Shortcuts -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Here, we will use the [Shortcuts] and [Actions] widgets to add and subtract -// from a counter. When the child widget has keyboard focus, and a user presses -// the keys that have been defined in [Shortcuts], the action that is bound -// to the appropriate [Intent] for the key is invoked. -// -// It also shows the use of a [CallbackAction] to avoid creating a new [Action] -// subclass. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - import 'package:flutter/services.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -54,9 +28,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class IncrementIntent extends Intent { const IncrementIntent(); } @@ -65,10 +36,6 @@ class DecrementIntent extends Intent { const DecrementIntent(); } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -76,11 +43,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int count = 0; @override @@ -117,8 +80,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/shortcuts/shortcuts.1.dart b/examples/api/lib/widgets/shortcuts/shortcuts.1.dart index a556b2a935..6c640d9844 100644 --- a/examples/api/lib/widgets/shortcuts/shortcuts.1.dart +++ b/examples/api/lib/widgets/shortcuts/shortcuts.1.dart @@ -2,43 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Shortcuts -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This slightly more complicated, but more flexible, example creates a custom -// [Action] subclass to increment and decrement within a widget (a [Column]) -// that has keyboard focus. When the user presses the up and down arrow keys, -// the counter will increment and decrement a data model using the custom -// actions. -// -// One thing that this demonstrates is passing arguments to the [Intent] to be -// carried to the [Action]. This shows how actions can get data either from -// their own construction (like the `model` in this example), or from the -// intent passed to them when invoked (like the increment `amount` in this -// example). - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - import 'package:flutter/services.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -58,9 +28,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class Model with ChangeNotifier { int count = 0; void incrementBy(int amount) { @@ -108,10 +75,6 @@ class DecrementAction extends Action { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -119,11 +82,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Model model = Model(); @override @@ -157,8 +116,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/shortcuts/single_activator.single_activator.0.dart b/examples/api/lib/widgets/shortcuts/single_activator.single_activator.0.dart index f1ad6626b4..7ac1965c3d 100644 --- a/examples/api/lib/widgets/shortcuts/single_activator.single_activator.0.dart +++ b/examples/api/lib/widgets/shortcuts/single_activator.single_activator.0.dart @@ -2,33 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SingleActivator.SingleActivator -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// In the following example, the shortcut `Control + C` increases the counter: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; -//**************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-imports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - import 'package:flutter/services.dart'; -//* ▲▲▲▲▲▲▲▲ code-imports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//**************************************************************************** - void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -48,17 +28,10 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class IncrementIntent extends Intent { const IncrementIntent(); } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -66,11 +39,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - int count = 0; @override @@ -100,8 +69,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.0.dart b/examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.0.dart index 2dbb01a5d3..04782c1e75 100644 --- a/examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.0.dart +++ b/examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.0.dart @@ -2,31 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SingleChildScrollView -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// In this example, the children are spaced out equally, unless there's no more -// room, in which case they stack vertically and scroll. -// -// When using this technique, [Expanded] and [Flexible] are not useful, because -// in both cases the "available space" is infinite (since this is in a viewport). -// The next section describes a technique for providing a maximum height constraint. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return DefaultTextStyle( style: Theme.of(context).textTheme.bodyText2!, @@ -85,8 +62,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.1.dart b/examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.1.dart index 5c7d43700f..36aee6533e 100644 --- a/examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.1.dart +++ b/examples/api/lib/widgets/single_child_scroll_view/single_child_scroll_view.1.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SingleChildScrollView -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// In this example, the column becomes either as big as viewport, or as big as -// the contents, whichever is biggest. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,14 +22,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return DefaultTextStyle( style: Theme.of(context).textTheme.bodyText2!, @@ -84,8 +65,4 @@ class MyStatelessWidget extends StatelessWidget { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.0.dart b/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.0.dart index 5ed1739090..5402261d77 100644 --- a/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.0.dart +++ b/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SliverFillRemaining -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// In this sample the [SliverFillRemaining] sizes its [child] to fill the -// remaining extent of the viewport in both axes. The icon is centered in the -// sliver, and would be in any computed extent for the sliver. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return CustomScrollView( slivers: [ @@ -72,8 +52,4 @@ class MyStatelessWidget extends StatelessWidget { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.1.dart b/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.1.dart index 5c0f481725..93ba978393 100644 --- a/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.1.dart +++ b/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.1.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SliverFillRemaining -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// In this sample the [SliverFillRemaining] defers to the size of its [child] -// because the child's extent exceeds that of the remaining extent of the -// viewport's main axis. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return CustomScrollView( slivers: [ @@ -76,8 +56,4 @@ class MyStatelessWidget extends StatelessWidget { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.2.dart b/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.2.dart index b0b9b920b5..19ce28db60 100644 --- a/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.2.dart +++ b/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.2.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SliverFillRemaining -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// In this sample the [SliverFillRemaining] defers to the size of its [child] -// because the [SliverConstraints.precedingScrollExtent] has gone -// beyond that of the viewport's main axis. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -41,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return CustomScrollView( slivers: [ @@ -77,8 +57,4 @@ class MyStatelessWidget extends StatelessWidget { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.3.dart b/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.3.dart index a01414edb6..7f13009e20 100644 --- a/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.3.dart +++ b/examples/api/lib/widgets/sliver_fill/sliver_fill_remaining.3.dart @@ -2,32 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SliverFillRemaining -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// In this sample the [SliverFillRemaining]'s child stretches to fill the -// overscroll area when [fillOverscroll] is true. This sample also features a -// button that is pinned to the bottom of the sliver, regardless of size or -// overscroll behavior. Try switching [fillOverscroll] to see the difference. -// -// This sample only shows the overscroll behavior on devices that support -// overscroll. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -45,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return CustomScrollView( // The ScrollPhysics are overridden here to illustrate the functionality @@ -97,8 +73,4 @@ class MyStatelessWidget extends StatelessWidget { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/table/table.0.dart b/examples/api/lib/widgets/table/table.0.dart index 622e005277..f883bdf599 100644 --- a/examples/api/lib/widgets/table/table.0.dart +++ b/examples/api/lib/widgets/table/table.0.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateless_widget_scaffold.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for Table -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This sample shows a `Table` with borders, multiple types of column widths and different vertical cell alignments. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -39,14 +25,10 @@ class MyApp extends StatelessWidget { } } -/// This is the stateless widget that the main application instantiates. class MyStatelessWidget extends StatelessWidget { const MyStatelessWidget({Key? key}) : super(key: key); @override -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - Widget build(BuildContext context) { return Table( border: TableBorder.all(), @@ -103,8 +85,4 @@ class MyStatelessWidget extends StatelessWidget { ], ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/transitions/align_transition.0.dart b/examples/api/lib/widgets/transitions/align_transition.0.dart index 0391f4322b..3cfeda424d 100644 --- a/examples/api/lib/widgets/transitions/align_transition.0.dart +++ b/examples/api/lib/widgets/transitions/align_transition.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material_ticker.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AlignTransition -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following code implements the [AlignTransition] as seen in the video -// above: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -45,13 +29,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin. class _MyStatefulWidgetState extends State with TickerProviderStateMixin { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - // Using `late final` for [lazy initialization](https://dart.dev/null-safety/understanding-null-safety#lazy-initialization). late final AnimationController _controller = AnimationController( duration: const Duration(seconds: 2), @@ -86,8 +66,4 @@ class _MyStatefulWidgetState extends State ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/transitions/animated_builder.0.dart b/examples/api/lib/widgets/transitions/animated_builder.0.dart index efdc13d42b..5054be3616 100644 --- a/examples/api/lib/widgets/transitions/animated_builder.0.dart +++ b/examples/api/lib/widgets/transitions/animated_builder.0.dart @@ -2,36 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material_ticker.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AnimatedBuilder -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This code defines a widget that spins a green square continually. It is -// built with an [AnimatedBuilder] and makes use of the [child] feature to -// avoid having to rebuild the [Container] each time. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//******************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-dartImports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'dart:math' as math; -//* ▲▲▲▲▲▲▲▲ code-dartImports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************************** - import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -46,7 +24,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -54,13 +31,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin. class _MyStatefulWidgetState extends State with TickerProviderStateMixin { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - late final AnimationController _controller = AnimationController( duration: const Duration(seconds: 10), vsync: this, @@ -92,8 +65,4 @@ class _MyStatefulWidgetState extends State }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/transitions/animated_widget.0.dart b/examples/api/lib/widgets/transitions/animated_widget.0.dart index 928e7f7aed..d24fe121ec 100644 --- a/examples/api/lib/widgets/transitions/animated_widget.0.dart +++ b/examples/api/lib/widgets/transitions/animated_widget.0.dart @@ -2,35 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material_ticker.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for AnimatedWidget -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This code defines a widget called `Spinner` that spins a green square -// continually. It is built with an [AnimatedWidget]. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** - -//******************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-dartImports ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) import 'dart:math' as math; -//* ▲▲▲▲▲▲▲▲ code-dartImports ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************************** - import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -45,9 +24,6 @@ class MyApp extends StatelessWidget { } } -//***************************************************************************** -//* ▼▼▼▼▼▼▼▼ code-preamble ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class SpinningContainer extends AnimatedWidget { const SpinningContainer({ Key? key, @@ -65,10 +41,6 @@ class SpinningContainer extends AnimatedWidget { } } -//* ▲▲▲▲▲▲▲▲ code-preamble ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//***************************************************************************** - -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -76,13 +48,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin. class _MyStatefulWidgetState extends State with TickerProviderStateMixin { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - late final AnimationController _controller = AnimationController( duration: const Duration(seconds: 10), vsync: this, @@ -98,8 +66,4 @@ class _MyStatefulWidgetState extends State Widget build(BuildContext context) { return SpinningContainer(controller: _controller); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/transitions/decorated_box_transition.0.dart b/examples/api/lib/widgets/transitions/decorated_box_transition.0.dart index 6c4f5b6d8c..4dad636920 100644 --- a/examples/api/lib/widgets/transitions/decorated_box_transition.0.dart +++ b/examples/api/lib/widgets/transitions/decorated_box_transition.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material_ticker.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for DecoratedBoxTransition -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following code implements the [DecoratedBoxTransition] as seen in the video -// above: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -45,13 +29,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin. class _MyStatefulWidgetState extends State with TickerProviderStateMixin { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - final DecorationTween decorationTween = DecorationTween( begin: BoxDecoration( color: const Color(0xFFFFFFFF), @@ -106,8 +86,4 @@ class _MyStatefulWidgetState extends State ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/transitions/default_text_style_transition.0.dart b/examples/api/lib/widgets/transitions/default_text_style_transition.0.dart index 2b5fa03145..5c35aa03cf 100644 --- a/examples/api/lib/widgets/transitions/default_text_style_transition.0.dart +++ b/examples/api/lib/widgets/transitions/default_text_style_transition.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material_ticker.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for DefaultTextStyleTransition -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following code implements the [DefaultTextStyleTransition] that shows -// a transition between thick blue font and thin red font. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -45,13 +29,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin. class _MyStatefulWidgetState extends State with TickerProviderStateMixin { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - late AnimationController _controller; late TextStyleTween _styleTween; late CurvedAnimation _curvedAnimation; @@ -90,8 +70,4 @@ class _MyStatefulWidgetState extends State ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/transitions/fade_transition.0.dart b/examples/api/lib/widgets/transitions/fade_transition.0.dart index 8e70c225ca..c2ab325025 100644 --- a/examples/api/lib/widgets/transitions/fade_transition.0.dart +++ b/examples/api/lib/widgets/transitions/fade_transition.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material_ticker.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for FadeTransition -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following code implements the [FadeTransition] using -// the Flutter logo: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -45,13 +29,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin. class _MyStatefulWidgetState extends State with TickerProviderStateMixin { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - late final AnimationController _controller = AnimationController( duration: const Duration(seconds: 2), vsync: this, @@ -77,8 +57,4 @@ class _MyStatefulWidgetState extends State ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/transitions/positioned_transition.0.dart b/examples/api/lib/widgets/transitions/positioned_transition.0.dart index 766896847d..ebaf2204bb 100644 --- a/examples/api/lib/widgets/transitions/positioned_transition.0.dart +++ b/examples/api/lib/widgets/transitions/positioned_transition.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material_ticker.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for PositionedTransition -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following code implements the [PositionedTransition] as seen in the video -// above: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -45,13 +29,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin. class _MyStatefulWidgetState extends State with TickerProviderStateMixin { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - late final AnimationController _controller = AnimationController( duration: const Duration(seconds: 2), vsync: this, @@ -93,8 +73,4 @@ class _MyStatefulWidgetState extends State }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/transitions/relative_positioned_transition.0.dart b/examples/api/lib/widgets/transitions/relative_positioned_transition.0.dart index 1c0c0b9d33..b1edf2e1ae 100644 --- a/examples/api/lib/widgets/transitions/relative_positioned_transition.0.dart +++ b/examples/api/lib/widgets/transitions/relative_positioned_transition.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material_ticker.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for RelativePositionedTransition -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following code implements the [RelativePositionedTransition] as seen in the video -// above: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -45,13 +29,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin. class _MyStatefulWidgetState extends State with TickerProviderStateMixin { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - late final AnimationController _controller = AnimationController( duration: const Duration(seconds: 2), vsync: this, @@ -91,8 +71,4 @@ class _MyStatefulWidgetState extends State }, ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/transitions/rotation_transition.0.dart b/examples/api/lib/widgets/transitions/rotation_transition.0.dart index 1c22fd64c7..a9a3192102 100644 --- a/examples/api/lib/widgets/transitions/rotation_transition.0.dart +++ b/examples/api/lib/widgets/transitions/rotation_transition.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material_ticker.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for RotationTransition -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following code implements the [RotationTransition] as seen in the video -// above: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -45,13 +29,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin. class _MyStatefulWidgetState extends State with TickerProviderStateMixin { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - late final AnimationController _controller = AnimationController( duration: const Duration(seconds: 2), vsync: this, @@ -81,8 +61,4 @@ class _MyStatefulWidgetState extends State ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/transitions/scale_transition.0.dart b/examples/api/lib/widgets/transitions/scale_transition.0.dart index a78bc7f6b0..97e5b52736 100644 --- a/examples/api/lib/widgets/transitions/scale_transition.0.dart +++ b/examples/api/lib/widgets/transitions/scale_transition.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material_ticker.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for ScaleTransition -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following code implements the [ScaleTransition] as seen in the video -// above: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -37,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -45,13 +29,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin. class _MyStatefulWidgetState extends State with TickerProviderStateMixin { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - late final AnimationController _controller = AnimationController( duration: const Duration(seconds: 2), vsync: this, @@ -81,8 +61,4 @@ class _MyStatefulWidgetState extends State ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/transitions/size_transition.0.dart b/examples/api/lib/widgets/transitions/size_transition.0.dart index 7a9b061b0f..b7731a83a9 100644 --- a/examples/api/lib/widgets/transitions/size_transition.0.dart +++ b/examples/api/lib/widgets/transitions/size_transition.0.dart @@ -2,28 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material_ticker.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SizeTransition -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This code defines a widget that uses [SizeTransition] to change the size -// of [FlutterLogo] continually. It is built with a [Scaffold] -// where the internal widget has space to change its size. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -38,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -46,13 +29,9 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. /// AnimationControllers can be created with `vsync: this` because of TickerProviderStateMixin. class _MyStatefulWidgetState extends State with TickerProviderStateMixin { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - late final AnimationController _controller = AnimationController( duration: const Duration(seconds: 3), vsync: this, @@ -81,8 +60,4 @@ class _MyStatefulWidgetState extends State ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/transitions/slide_transition.0.dart b/examples/api/lib/widgets/transitions/slide_transition.0.dart index b37a437438..a7c550720c 100644 --- a/examples/api/lib/widgets/transitions/slide_transition.0.dart +++ b/examples/api/lib/widgets/transitions/slide_transition.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center_freeform_state.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SlideTransition -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// The following code implements the [SlideTransition] as seen in the video -// above: - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -50,10 +34,6 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class _MyStatefulWidgetState extends State with SingleTickerProviderStateMixin { late final AnimationController _controller = AnimationController( @@ -85,6 +65,3 @@ class _MyStatefulWidgetState extends State ); } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/widgets/transitions/sliver_fade_transition.0.dart b/examples/api/lib/widgets/transitions/sliver_fade_transition.0.dart index 345670763f..2440e70ad7 100644 --- a/examples/api/lib/widgets/transitions/sliver_fade_transition.0.dart +++ b/examples/api/lib/widgets/transitions/sliver_fade_transition.0.dart @@ -2,27 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center_freeform_state.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for SliverFadeTransition -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// Creates a [CustomScrollView] with a [SliverFixedExtentList] that uses a -// [SliverFadeTransition] to fade the list in and out. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -42,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -50,10 +34,6 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - class _MyStatefulWidgetState extends State with SingleTickerProviderStateMixin { late final AnimationController controller = AnimationController( @@ -104,6 +84,3 @@ class _MyStatefulWidgetState extends State ]); } } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** diff --git a/examples/api/lib/widgets/tween_animation_builder/tween_animation_builder.0.dart b/examples/api/lib/widgets/tween_animation_builder/tween_animation_builder.0.dart index 189a87b20b..95be7d72e0 100644 --- a/examples/api/lib/widgets/tween_animation_builder/tween_animation_builder.0.dart +++ b/examples/api/lib/widgets/tween_animation_builder/tween_animation_builder.0.dart @@ -2,29 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_scaffold_center.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for TweenAnimationBuilder -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// This example shows an [IconButton] that "zooms" in when the widget first -// builds (its size smoothly increases from 0 to 24) and whenever the button -// is pressed, it smoothly changes its size to the new target value of either -// 48 or 24. - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -44,7 +27,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -52,11 +34,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - double targetValue = 24.0; @override @@ -79,8 +57,4 @@ class _MyStatefulWidgetState extends State { child: const Icon(Icons.aspect_ratio), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/examples/api/lib/widgets/will_pop_scope/will_pop_scope.1.dart b/examples/api/lib/widgets/will_pop_scope/will_pop_scope.1.dart index b3a79229f4..bef2d32816 100644 --- a/examples/api/lib/widgets/will_pop_scope/will_pop_scope.1.dart +++ b/examples/api/lib/widgets/will_pop_scope/will_pop_scope.1.dart @@ -2,26 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Template: dev/snippets/config/templates/stateful_widget_material.tmpl -// -// Comment lines marked with "▼▼▼" and "▲▲▲" are used for authoring -// of samples, and may be ignored if you are just exploring the sample. - // Flutter code sample for WillPopScope -// -//*************************************************************************** -//* ▼▼▼▼▼▼▼▼ description ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - -// - -//* ▲▲▲▲▲▲▲▲ description ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//*************************************************************************** import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); -/// This is the main application widget. class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -36,7 +22,6 @@ class MyApp extends StatelessWidget { } } -/// This is the stateful widget that the main application instantiates. class MyStatefulWidget extends StatefulWidget { const MyStatefulWidget({Key? key}) : super(key: key); @@ -44,11 +29,7 @@ class MyStatefulWidget extends StatefulWidget { State createState() => _MyStatefulWidgetState(); } -/// This is the private State class that goes with MyStatefulWidget. class _MyStatefulWidgetState extends State { -//******************************************************************** -//* ▼▼▼▼▼▼▼▼ code ▼▼▼▼▼▼▼▼ (do not modify or remove section marker) - bool shouldPop = true; @override Widget build(BuildContext context) { @@ -96,8 +77,4 @@ class _MyStatefulWidgetState extends State { ), ); } - -//* ▲▲▲▲▲▲▲▲ code ▲▲▲▲▲▲▲▲ (do not modify or remove section marker) -//******************************************************************** - } diff --git a/packages/flutter/lib/src/animation/curves.dart b/packages/flutter/lib/src/animation/curves.dart index 775af04c08..e968c25cb7 100644 --- a/packages/flutter/lib/src/animation/curves.dart +++ b/packages/flutter/lib/src/animation/curves.dart @@ -466,7 +466,7 @@ class ThreePointCubic extends Curve { /// part of the curve, or hardly at all in another part of the curve, depending /// on the definition of the curve. /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This example shows how to use a [Curve2D] to modify the position of a widget /// so that it can follow an arbitrary path. /// diff --git a/packages/flutter/lib/src/cupertino/context_menu.dart b/packages/flutter/lib/src/cupertino/context_menu.dart index 619fec6dae..39414cb75d 100644 --- a/packages/flutter/lib/src/cupertino/context_menu.dart +++ b/packages/flutter/lib/src/cupertino/context_menu.dart @@ -73,7 +73,7 @@ enum _ContextMenuLocation { /// child's corners and allowing its aspect ratio to expand, similar to the /// Photos app on iOS. /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This sample shows a very simple CupertinoContextMenu for an empty red /// 100x100 Container. Simply long press on it to open. /// diff --git a/packages/flutter/lib/src/cupertino/nav_bar.dart b/packages/flutter/lib/src/cupertino/nav_bar.dart index 8bbfdd5b9e..b863680abe 100644 --- a/packages/flutter/lib/src/cupertino/nav_bar.dart +++ b/packages/flutter/lib/src/cupertino/nav_bar.dart @@ -228,7 +228,7 @@ bool _isTransitionable(BuildContext context) { /// value from the operating system can be retrieved in many ways, such as querying /// [MediaQuery.textScaleFactorOf] against [CupertinoApp]'s [BuildContext]. /// -/// {@tool dartpad --template=stateful_widget_cupertino} +/// {@tool dartpad} /// This example shows a [CupertinoNavigationBar] placed in a [CupertinoPageScaffold]. /// Since [backgroundColor]'s opacity is not 1.0, there is a blur effect and /// content slides underneath. diff --git a/packages/flutter/lib/src/cupertino/page_scaffold.dart b/packages/flutter/lib/src/cupertino/page_scaffold.dart index 25fd92b599..3ad2a5a676 100644 --- a/packages/flutter/lib/src/cupertino/page_scaffold.dart +++ b/packages/flutter/lib/src/cupertino/page_scaffold.dart @@ -18,7 +18,7 @@ import 'theme.dart'; /// encloses the [ScrollView]. The [ScrollView.primary] flag is used to connect /// a [ScrollView] to the enclosing [PrimaryScrollController]. /// -/// {@tool dartpad --template=stateful_widget_cupertino} +/// {@tool dartpad} /// This example shows a [CupertinoPageScaffold] with a [ListView] as a [child]. /// The [CupertinoButton] is connected to a callback that increments a counter. /// The [backgroundColor] can be changed. diff --git a/packages/flutter/lib/src/cupertino/refresh.dart b/packages/flutter/lib/src/cupertino/refresh.dart index 4712a88877..5d541f1d38 100644 --- a/packages/flutter/lib/src/cupertino/refresh.dart +++ b/packages/flutter/lib/src/cupertino/refresh.dart @@ -266,7 +266,7 @@ typedef RefreshCallback = Future Function(); /// sliver such as [CupertinoSliverNavigationBar] and your main scrollable /// content's sliver. /// -/// {@tool dartpad --template=stateful_widget_cupertino} +/// {@tool dartpad} /// When the user scrolls past [refreshTriggerPullDistance], /// this sample shows the default iOS pull to refresh indicator for 1 second and /// adds a new item to the top of the list view. diff --git a/packages/flutter/lib/src/cupertino/route.dart b/packages/flutter/lib/src/cupertino/route.dart index 72c5dec0fa..faffbfd9a0 100644 --- a/packages/flutter/lib/src/cupertino/route.dart +++ b/packages/flutter/lib/src/cupertino/route.dart @@ -1127,7 +1127,7 @@ class CupertinoModalPopupRoute extends PopupRoute { /// /// For more information about state restoration, see [RestorationManager]. /// -/// {@tool sample --template=stateless_widget_restoration_cupertino} +/// {@tool sample} /// This sample demonstrates how to create a restorable Cupertino modal route. /// This is accomplished by enabling state restoration by specifying /// [CupertinoApp.restorationScopeId] and using [Navigator.restorablePush] to @@ -1227,7 +1227,7 @@ Widget _buildCupertinoDialogTransitions(BuildContext context, Animation /// /// For more information about state restoration, see [RestorationManager]. /// -/// {@tool sample --template=stateless_widget_restoration_cupertino} +/// {@tool sample} /// This sample demonstrates how to create a restorable Cupertino dialog. This is /// accomplished by enabling state restoration by specifying /// [CupertinoApp.restorationScopeId] and using [Navigator.restorablePush] to diff --git a/packages/flutter/lib/src/cupertino/scrollbar.dart b/packages/flutter/lib/src/cupertino/scrollbar.dart index 62f83c85ea..7e468fbd97 100644 --- a/packages/flutter/lib/src/cupertino/scrollbar.dart +++ b/packages/flutter/lib/src/cupertino/scrollbar.dart @@ -38,7 +38,7 @@ const double _kScrollbarCrossAxisMargin = 3.0; /// animate from [thickness] and [radius] to [thicknessWhileDragging] and /// [radiusWhileDragging], respectively. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This sample shows a [CupertinoScrollbar] that fades in and out of view as scrolling occurs. /// The scrollbar will fade into view as the user scrolls, and fade out when scrolling stops. /// The `thickness` of the scrollbar will animate from 6 pixels to the `thicknessWhileDragging` of 10 @@ -48,7 +48,7 @@ const double _kScrollbarCrossAxisMargin = 3.0; /// ** See code in examples/api/lib/cupertino/scrollbar/cupertino_scrollbar.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// When `isAlwaysShown` is true, the scrollbar thumb will remain visible without the /// fade animation. This requires that a [ScrollController] is provided to controller, /// or that the [PrimaryScrollController] is available. diff --git a/packages/flutter/lib/src/cupertino/text_form_field_row.dart b/packages/flutter/lib/src/cupertino/text_form_field_row.dart index f2a41adade..8c282a2201 100644 --- a/packages/flutter/lib/src/cupertino/text_form_field_row.dart +++ b/packages/flutter/lib/src/cupertino/text_form_field_row.dart @@ -70,7 +70,7 @@ import 'text_field.dart'; /// ``` /// {@end-tool} /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This example shows how to move the focus to the next field when the user /// presses the SPACE key. /// diff --git a/packages/flutter/lib/src/gestures/pointer_signal_resolver.dart b/packages/flutter/lib/src/gestures/pointer_signal_resolver.dart index b5a1dc8564..8d162c36e0 100644 --- a/packages/flutter/lib/src/gestures/pointer_signal_resolver.dart +++ b/packages/flutter/lib/src/gestures/pointer_signal_resolver.dart @@ -36,7 +36,7 @@ bool _isSameEvent(PointerSignalEvent event1, PointerSignalEvent event2) { /// } /// ``` /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// Here is an example that demonstrates the effect of not using the resolver /// versus using it. /// diff --git a/packages/flutter/lib/src/material/about.dart b/packages/flutter/lib/src/material/about.dart index cbea1c9dc3..e16bf7a84d 100644 --- a/packages/flutter/lib/src/material/about.dart +++ b/packages/flutter/lib/src/material/about.dart @@ -43,7 +43,7 @@ import 'theme.dart'; /// If your application does not have a [Drawer], you should provide an /// affordance to call [showAboutDialog] or (at least) [showLicensePage]. /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This sample shows two ways to open [AboutDialog]. The first one /// uses an [AboutListTile], and the second uses the [showAboutDialog] function. /// diff --git a/packages/flutter/lib/src/material/app_bar.dart b/packages/flutter/lib/src/material/app_bar.dart index 28e5f4c204..cb3eccc8e0 100644 --- a/packages/flutter/lib/src/material/app_bar.dart +++ b/packages/flutter/lib/src/material/app_bar.dart @@ -100,7 +100,7 @@ class _PreferredAppBarSize extends Size { /// to false. In that case a null leading widget will result in the middle/title widget /// stretching to start. /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This sample shows an [AppBar] with two simple actions. The first action /// opens a [SnackBar], while the second action navigates to a new page. /// @@ -124,7 +124,7 @@ class _PreferredAppBarSize extends Size { /// [ColorScheme.primary]. to remedy the problem, override /// [TextButton.style]: /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// /// /// ** See code in examples/api/lib/material/app_bar/app_bar.1.dart ** @@ -1312,7 +1312,7 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { /// ``` /// {@end-tool} /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This sample shows a [SliverAppBar] and it's behavior when using the /// [pinned], [snap] and [floating] parameters. /// diff --git a/packages/flutter/lib/src/material/autocomplete.dart b/packages/flutter/lib/src/material/autocomplete.dart index 44d270807c..a7508bd451 100644 --- a/packages/flutter/lib/src/material/autocomplete.dart +++ b/packages/flutter/lib/src/material/autocomplete.dart @@ -12,14 +12,14 @@ import 'theme.dart'; /// {@macro flutter.widgets.RawAutocomplete.RawAutocomplete} /// -/// {@tool dartpad --template=freeform} +/// {@tool dartpad} /// This example shows how to create a very basic Autocomplete widget using the /// default UI. /// /// ** See code in examples/api/lib/material/autocomplete/autocomplete.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=freeform} +/// {@tool dartpad} /// This example shows how to create an Autocomplete widget with a custom type. /// Try searching with text from the name or email field. /// diff --git a/packages/flutter/lib/src/material/banner.dart b/packages/flutter/lib/src/material/banner.dart index 6764a88ffa..463c55b3b7 100644 --- a/packages/flutter/lib/src/material/banner.dart +++ b/packages/flutter/lib/src/material/banner.dart @@ -54,13 +54,13 @@ enum MaterialBannerClosedReason { /// They are persistent and non-modal, allowing the user to either ignore them or /// interact with them at any time. /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// Banners placed directly into the widget tree are static. /// /// ** See code in examples/api/lib/material/banner/material_banner.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// MaterialBanner's can also be presented through a [ScaffoldMessenger]. /// Here is an example where ScaffoldMessengerState.showMaterialBanner() is used to show the MaterialBanner. /// diff --git a/packages/flutter/lib/src/material/bottom_app_bar.dart b/packages/flutter/lib/src/material/bottom_app_bar.dart index fecb6c91bf..b337d35e44 100644 --- a/packages/flutter/lib/src/material/bottom_app_bar.dart +++ b/packages/flutter/lib/src/material/bottom_app_bar.dart @@ -32,7 +32,7 @@ import 'theme.dart'; /// ``` /// {@end-tool} /// -/// {@tool dartpad --template=freeform} +/// {@tool dartpad} /// This example shows the [BottomAppBar], which can be configured to have a notch using the /// [BottomAppBar.shape] property. This also includes an optional [FloatingActionButton], which illustrates /// the [FloatingActionButtonLocation]s in relation to the [BottomAppBar]. diff --git a/packages/flutter/lib/src/material/bottom_navigation_bar.dart b/packages/flutter/lib/src/material/bottom_navigation_bar.dart index 54cef4b190..f657695099 100644 --- a/packages/flutter/lib/src/material/bottom_navigation_bar.dart +++ b/packages/flutter/lib/src/material/bottom_navigation_bar.dart @@ -93,7 +93,7 @@ enum BottomNavigationBarLandscapeLayout { /// case it's assumed that each item will have a different background color /// and that background color will contrast well with white. /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This example shows a [BottomNavigationBar] as it is used within a [Scaffold] /// widget. The [BottomNavigationBar] has three [BottomNavigationBarItem] /// widgets, which means it defaults to [BottomNavigationBarType.fixed], and @@ -104,7 +104,7 @@ enum BottomNavigationBarLandscapeLayout { /// ** See code in examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This example shows a [BottomNavigationBar] as it is used within a [Scaffold] /// widget. The [BottomNavigationBar] has four [BottomNavigationBarItem] /// widgets, which means it defaults to [BottomNavigationBarType.shifting], and diff --git a/packages/flutter/lib/src/material/bottom_sheet.dart b/packages/flutter/lib/src/material/bottom_sheet.dart index cf06bbde4e..82a5a24255 100644 --- a/packages/flutter/lib/src/material/bottom_sheet.dart +++ b/packages/flutter/lib/src/material/bottom_sheet.dart @@ -641,7 +641,7 @@ class _BottomSheetSuspendedCurve extends ParametricCurve { /// Returns a `Future` that resolves to the value (if any) that was passed to /// [Navigator.pop] when the modal bottom sheet was closed. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This example demonstrates how to use `showModalBottomSheet` to display a /// bottom sheet that obscures the content behind it when a user taps a button. /// It also demonstrates how to close the bottom sheet using the [Navigator] diff --git a/packages/flutter/lib/src/material/card.dart b/packages/flutter/lib/src/material/card.dart index 753b7b6aa5..81f2a3c31a 100644 --- a/packages/flutter/lib/src/material/card.dart +++ b/packages/flutter/lib/src/material/card.dart @@ -20,7 +20,7 @@ import 'theme.dart'; /// some text describing a musical, and the other with buttons for buying /// tickets or listening to the show.](https://flutter.github.io/assets-for-api-docs/assets/material/card.png) /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This sample shows creation of a [Card] widget that shows album information /// and two actions. /// @@ -30,7 +30,7 @@ import 'theme.dart'; /// Sometimes the primary action area of a card is the card itself. Cards can be /// one large touch target that shows a detail screen when tapped. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This sample shows creation of a [Card] widget that can be tapped. When /// tapped this [Card]'s [InkWell] displays an "ink splash" that fills the /// entire card. diff --git a/packages/flutter/lib/src/material/checkbox.dart b/packages/flutter/lib/src/material/checkbox.dart index 6e76007ade..075974ede2 100644 --- a/packages/flutter/lib/src/material/checkbox.dart +++ b/packages/flutter/lib/src/material/checkbox.dart @@ -25,7 +25,7 @@ import 'toggleable.dart'; /// /// Requires one of its ancestors to be a [Material] widget. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// This example shows how you can override the default theme of /// of a [Checkbox] with a [MaterialStateProperty]. /// In this example, the checkbox's color will be `Colors.blue` when the [Checkbox] diff --git a/packages/flutter/lib/src/material/checkbox_list_tile.dart b/packages/flutter/lib/src/material/checkbox_list_tile.dart index ed7939f867..499657b019 100644 --- a/packages/flutter/lib/src/material/checkbox_list_tile.dart +++ b/packages/flutter/lib/src/material/checkbox_list_tile.dart @@ -40,7 +40,7 @@ import 'theme_data.dart'; /// To show the [CheckboxListTile] as disabled, pass null as the [onChanged] /// callback. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// ![CheckboxListTile sample](https://flutter.github.io/assets-for-api-docs/assets/material/checkbox_list_tile.png) /// /// This widget shows a checkbox that, when checked, slows down all animations @@ -69,7 +69,7 @@ import 'theme_data.dart'; /// into one. Therefore, it may be necessary to create a custom radio tile /// widget to accommodate similar use cases. /// -/// {@tool sample --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// ![Checkbox list tile semantics sample](https://flutter.github.io/assets-for-api-docs/assets/material/checkbox_list_tile_semantics.png) /// /// Here is an example of a custom labeled checkbox widget, called @@ -86,7 +86,7 @@ import 'theme_data.dart'; /// combining [Checkbox] with other widgets, such as [Text], [Padding] and /// [InkWell]. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// ![Custom checkbox list tile sample](https://flutter.github.io/assets-for-api-docs/assets/material/checkbox_list_tile_custom.png) /// /// Here is an example of a custom LabeledCheckbox widget, but you can easily diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart index 448668dad7..a622703464 100644 --- a/packages/flutter/lib/src/material/chip.dart +++ b/packages/flutter/lib/src/material/chip.dart @@ -217,7 +217,7 @@ abstract class DeletableChipAttributes { /// that the user tapped the delete button. In order to delete the chip, you /// have to do something similar to the following sample: /// - /// {@tool dartpad --template=stateful_widget_scaffold_center} + /// {@tool dartpad} /// This sample shows how to use [onDeleted] to remove an entry when the /// delete button is tapped. /// diff --git a/packages/flutter/lib/src/material/data_table.dart b/packages/flutter/lib/src/material/data_table.dart index 29e8acf488..becd51d923 100644 --- a/packages/flutter/lib/src/material/data_table.dart +++ b/packages/flutter/lib/src/material/data_table.dart @@ -314,7 +314,7 @@ class DataCell { /// [PaginatedDataTable] which automatically splits the data into /// multiple pages. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This sample shows how to display a [DataTable] with three columns: name, age, and /// role. The columns are defined by three [DataColumn] objects. The table /// contains three rows of data for three example users, the data for which @@ -326,7 +326,7 @@ class DataCell { /// {@end-tool} /// /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// This sample shows how to display a [DataTable] with alternate colors per /// row, and a custom color for when the row is selected. /// diff --git a/packages/flutter/lib/src/material/date_picker.dart b/packages/flutter/lib/src/material/date_picker.dart index 35bf918599..ddf85c39ea 100644 --- a/packages/flutter/lib/src/material/date_picker.dart +++ b/packages/flutter/lib/src/material/date_picker.dart @@ -113,7 +113,7 @@ const double _inputFormLandscapeHeight = 108.0; /// /// {@macro flutter.widgets.RestorationManager} /// -/// {@tool sample --template=stateful_widget_restoration_material} +/// {@tool sample} /// This sample demonstrates how to create a restorable Material date picker. /// This is accomplished by enabling state restoration by specifying /// [MaterialApp.restorationScopeId] and using [Navigator.restorablePush] to @@ -874,7 +874,7 @@ class _DatePickerHeader extends StatelessWidget { /// /// {@macro flutter.widgets.RestorationManager} /// -/// {@tool sample --template=stateful_widget_restoration_material} +/// {@tool sample} /// This sample demonstrates how to create a restorable Material date range picker. /// This is accomplished by enabling state restoration by specifying /// [MaterialApp.restorationScopeId] and using [Navigator.restorablePush] to diff --git a/packages/flutter/lib/src/material/dialog.dart b/packages/flutter/lib/src/material/dialog.dart index 8d0f3bbc9c..a8f362fed5 100644 --- a/packages/flutter/lib/src/material/dialog.dart +++ b/packages/flutter/lib/src/material/dialog.dart @@ -227,7 +227,7 @@ class Dialog extends StatelessWidget { /// ``` /// {@end-tool} /// -/// {@tool dartpad --template=stateless_widget_scaffold_center} +/// {@tool dartpad} /// This demo shows a [TextButton] which when pressed, calls [showDialog]. When called, this method /// displays a Material dialog above the current contents of the app and returns /// a [Future] that completes when the dialog is dismissed. @@ -995,7 +995,7 @@ Widget _buildMaterialDialogTransitions(BuildContext context, Animation a /// /// For more information about state restoration, see [RestorationManager]. /// -/// {@tool sample --template=stateless_widget_restoration_material} +/// {@tool sample} /// This sample demonstrates how to create a restorable Material dialog. This is /// accomplished by enabling state restoration by specifying /// [MaterialApp.restorationScopeId] and using [Navigator.restorablePush] to diff --git a/packages/flutter/lib/src/material/divider.dart b/packages/flutter/lib/src/material/divider.dart index 78d6976c56..dfa1ad9285 100644 --- a/packages/flutter/lib/src/material/divider.dart +++ b/packages/flutter/lib/src/material/divider.dart @@ -23,7 +23,7 @@ import 'theme.dart'; /// The box's total height is controlled by [height]. The appropriate /// padding is automatically computed from the height. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This sample shows how to display a Divider between an orange and blue box /// inside a column. The Divider is 20 logical pixels in height and contains a /// vertically centered black line that is 5 logical pixels thick. The black @@ -187,7 +187,7 @@ class Divider extends StatelessWidget { /// The box's total width is controlled by [width]. The appropriate /// padding is automatically computed from the width. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This sample shows how to display a [VerticalDivider] between a purple and orange box /// inside a [Row]. The [VerticalDivider] is 20 logical pixels in width and contains a /// horizontally centered black line that is 1 logical pixels thick. The grey diff --git a/packages/flutter/lib/src/material/dropdown.dart b/packages/flutter/lib/src/material/dropdown.dart index 265410e769..974ed765a8 100644 --- a/packages/flutter/lib/src/material/dropdown.dart +++ b/packages/flutter/lib/src/material/dropdown.dart @@ -812,7 +812,7 @@ class DropdownButtonHideUnderline extends InheritedWidget { /// dropdown's value. It should also call [State.setState] to rebuild the /// dropdown with the new value. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// This sample shows a `DropdownButton` with a large arrow icon, /// purple text style, and bold purple underline, whose value is one of "One", /// "Two", "Free", or "Four". @@ -968,7 +968,7 @@ class DropdownButton extends StatefulWidget { /// from the list corresponds to the [DropdownMenuItem] of the same index /// in [items]. /// - /// {@tool dartpad --template=stateful_widget_scaffold} + /// {@tool dartpad} /// This sample shows a `DropdownButton` with a button with [Text] that /// corresponds to but is unique from [DropdownMenuItem]. /// @@ -993,7 +993,7 @@ class DropdownButton extends StatefulWidget { /// To use a separate text style for selected item when it's displayed within /// the dropdown button, consider using [selectedItemBuilder]. /// - /// {@tool dartpad --template=stateful_widget_scaffold} + /// {@tool dartpad} /// This sample shows a `DropdownButton` with a dropdown button text style /// that is different than its menu items. /// diff --git a/packages/flutter/lib/src/material/elevated_button.dart b/packages/flutter/lib/src/material/elevated_button.dart index 51c5e1d7f3..cd9b2b6f54 100644 --- a/packages/flutter/lib/src/material/elevated_button.dart +++ b/packages/flutter/lib/src/material/elevated_button.dart @@ -46,7 +46,7 @@ import 'theme_data.dart'; /// If [onPressed] and [onLongPress] callbacks are null, then the /// button will be disabled. /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// This sample produces an enabled and a disabled ElevatedButton. /// /// ** See code in examples/api/lib/material/elevated_button/elevated_button.0.dart ** diff --git a/packages/flutter/lib/src/material/expansion_panel.dart b/packages/flutter/lib/src/material/expansion_panel.dart index 36a389abbc..b82d76bcfc 100644 --- a/packages/flutter/lib/src/material/expansion_panel.dart +++ b/packages/flutter/lib/src/material/expansion_panel.dart @@ -147,7 +147,7 @@ class ExpansionPanelRadio extends ExpansionPanel { /// Note that [expansionCallback] behaves differently for [ExpansionPanelList] /// and [ExpansionPanelList.radio]. /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// Here is a simple example of how to implement ExpansionPanelList. /// /// ** See code in examples/api/lib/material/expansion_panel/expansion_panel_list.0.dart ** @@ -185,7 +185,7 @@ class ExpansionPanelList extends StatefulWidget { /// arguments must not be null. The [children] objects must be instances /// of [ExpansionPanelRadio]. /// - /// {@tool dartpad --template=stateful_widget_scaffold} + /// {@tool dartpad} /// Here is a simple example of how to implement ExpansionPanelList.radio. /// /// ** See code in examples/api/lib/material/expansion_panel/expansion_panel_list.expansion_panel_list_radio.0.dart ** diff --git a/packages/flutter/lib/src/material/expansion_tile.dart b/packages/flutter/lib/src/material/expansion_tile.dart index 8f88430684..2b025d51c7 100644 --- a/packages/flutter/lib/src/material/expansion_tile.dart +++ b/packages/flutter/lib/src/material/expansion_tile.dart @@ -30,7 +30,7 @@ const Duration _kExpand = Duration(milliseconds: 200); /// (i.e. the trailing edge). This can be changed using [controlAffinity]. This maps /// to the [leading] and [trailing] properties of [ExpansionTile]. /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// This example demonstrates different configurations of ExpansionTile. /// /// ** See code in examples/api/lib/material/expansion_tile/expansion_tile.0.dart ** diff --git a/packages/flutter/lib/src/material/flexible_space_bar.dart b/packages/flutter/lib/src/material/flexible_space_bar.dart index 5cd8ad1ed1..1ca2fe6121 100644 --- a/packages/flutter/lib/src/material/flexible_space_bar.dart +++ b/packages/flutter/lib/src/material/flexible_space_bar.dart @@ -54,7 +54,7 @@ enum StretchMode { /// [FlexibleSpaceBar.createSettings], to convey sizing information down to the /// [FlexibleSpaceBar]. /// -/// {@tool dartpad --template=freeform} +/// {@tool dartpad} /// This sample application demonstrates the different features of the /// [FlexibleSpaceBar] when used in a [SliverAppBar]. This app bar is configured /// to stretch into the overscroll space, and uses the diff --git a/packages/flutter/lib/src/material/floating_action_button.dart b/packages/flutter/lib/src/material/floating_action_button.dart index f5672dfa7b..0b7fefddf1 100644 --- a/packages/flutter/lib/src/material/floating_action_button.dart +++ b/packages/flutter/lib/src/material/floating_action_button.dart @@ -67,7 +67,7 @@ enum _FloatingActionButtonType { /// disabled. Consider changing the [backgroundColor] if disabling the floating /// action button. /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This example shows how to display a [FloatingActionButton] in a /// [Scaffold], with a pink [backgroundColor] and a thumbs up [Icon]. /// @@ -76,7 +76,7 @@ enum _FloatingActionButtonType { /// ** See code in examples/api/lib/material/floating_action_button/floating_action_button.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This example shows how to make an extended [FloatingActionButton] in a /// [Scaffold], with a pink [backgroundColor], a thumbs up [Icon] and a /// [Text] label that reads "Approve". diff --git a/packages/flutter/lib/src/material/floating_action_button_location.dart b/packages/flutter/lib/src/material/floating_action_button_location.dart index 9a76dcf814..acfb89f243 100644 --- a/packages/flutter/lib/src/material/floating_action_button_location.dart +++ b/packages/flutter/lib/src/material/floating_action_button_location.dart @@ -449,7 +449,7 @@ abstract class FloatingActionButtonLocation { /// You can create your own subclass of [StandardFabLocation] /// to implement a custom [FloatingActionButtonLocation]. /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This is an example of a user-defined [FloatingActionButtonLocation]. /// /// The example shows a [Scaffold] with an [AppBar], a [BottomAppBar], and a diff --git a/packages/flutter/lib/src/material/icon_button.dart b/packages/flutter/lib/src/material/icon_button.dart index dd8ec4d772..ce90231083 100644 --- a/packages/flutter/lib/src/material/icon_button.dart +++ b/packages/flutter/lib/src/material/icon_button.dart @@ -40,7 +40,7 @@ const double _kMinButtonSize = kMinInteractiveDimension; /// requirements in the Material Design specification. The [alignment] controls /// how the icon itself is positioned within the hit region. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// This sample shows an `IconButton` that uses the Material icon "volume_up" to /// increase the volume. /// @@ -81,7 +81,7 @@ const double _kMinButtonSize = kMinInteractiveDimension; /// the underlying [Material] along with the splash and highlight /// [InkResponse] contributed by descendant widgets. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// In this sample the icon button's background color is defined with an [Ink] /// widget whose child is an [IconButton]. The icon button's filled background /// is a light shade of blue, it's a filled circle, and it's as big as the diff --git a/packages/flutter/lib/src/material/ink_well.dart b/packages/flutter/lib/src/material/ink_well.dart index d006f01e04..0f8786cb4e 100644 --- a/packages/flutter/lib/src/material/ink_well.dart +++ b/packages/flutter/lib/src/material/ink_well.dart @@ -1166,7 +1166,7 @@ class _InkResponseState extends State<_InkResponseStateWidget> /// /// An example of this situation is as follows: /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// Tap the container to cause it to grow. Then, tap it again and hold before /// the widget reaches its maximum size to observe the clipped ink splash. /// diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart index 06bd59dc1c..9b2d4f4b3d 100644 --- a/packages/flutter/lib/src/material/input_decorator.dart +++ b/packages/flutter/lib/src/material/input_decorator.dart @@ -2440,7 +2440,7 @@ class _InputDecoratorState extends State with TickerProviderStat /// to describe their decoration. (In fact, this class is merely the /// configuration of an [InputDecorator], which does all the heavy lifting.) /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This sample shows how to style a `TextField` using an `InputDecorator`. The /// TextField displays a "send message" icon to the left of the input area, /// which is surrounded by a border an all sides. It displays the `hintText` @@ -2452,7 +2452,7 @@ class _InputDecoratorState extends State with TickerProviderStat /// ** See code in examples/api/lib/material/input_decorator/input_decoration.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This sample shows how to style a "collapsed" `TextField` using an /// `InputDecorator`. The collapsed `TextField` surrounds the hint text and /// input area with a border, but does not add padding around them. @@ -2462,7 +2462,7 @@ class _InputDecoratorState extends State with TickerProviderStat /// ** See code in examples/api/lib/material/input_decorator/input_decoration.1.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This sample shows how to create a `TextField` with hint text, a red border /// on all sides, and an error message. To display a red border and error /// message, provide `errorText` to the `InputDecoration` constructor. @@ -2472,7 +2472,7 @@ class _InputDecoratorState extends State with TickerProviderStat /// ** See code in examples/api/lib/material/input_decorator/input_decoration.2.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This sample shows how to style a `TextField` with a round border and /// additional text before and after the input area. It displays "Prefix" before /// the input area, and "Suffix" after the input area. @@ -2641,7 +2641,7 @@ class InputDecoration { /// This can be used, for example, to add multiple [TextStyle]'s to a label that would /// otherwise be specified using [labelText], which only takes one [TextStyle]. /// - /// {@tool dartpad --template=stateless_widget_scaffold} + /// {@tool dartpad} /// This example shows a `TextField` with a [Text.rich] widget as the [label]. /// The widget contains multiple [Text] widgets with different [TextStyle]'s. /// @@ -2857,7 +2857,7 @@ class InputDecoration { /// setting the constraints' minimum height and width to a value lower than /// 48px. /// - /// {@tool dartpad --template=stateless_widget_scaffold} + /// {@tool dartpad} /// This example shows the differences between two `TextField` widgets when /// [prefixIconConstraints] is set to the default value and when one is not. /// @@ -2996,7 +2996,7 @@ class InputDecoration { /// If null, a [BoxConstraints] with a minimum width and height of 48px is /// used. /// - /// {@tool dartpad --template=stateless_widget_scaffold} + /// {@tool dartpad} /// This example shows the differences between two `TextField` widgets when /// [suffixIconConstraints] is set to the default value and when one is not. /// diff --git a/packages/flutter/lib/src/material/list_tile.dart b/packages/flutter/lib/src/material/list_tile.dart index 83740607fb..1a143c6087 100644 --- a/packages/flutter/lib/src/material/list_tile.dart +++ b/packages/flutter/lib/src/material/list_tile.dart @@ -439,7 +439,7 @@ enum ListTileControlAffinity { /// you're looking for, it's easy to create custom list items with a /// combination of other widgets, such as [Row]s and [Column]s. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// Here is an example of a custom list item that resembles a YouTube-related /// video list item created with [Expanded] and [Container] widgets. /// @@ -448,7 +448,7 @@ enum ListTileControlAffinity { /// ** See code in examples/api/lib/material/list_tile/list_tile.4.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// Here is an example of an article list item with multiline titles and /// subtitles. It utilizes [Row]s and [Column]s, as well as [Expanded] and /// [AspectRatio] widgets to organize its layout. @@ -636,7 +636,7 @@ class ListTile extends StatelessWidget { /// By default the selected color is the theme's primary color. The selected color /// can be overridden with a [ListTileTheme]. /// - /// {@tool dartpad --template=stateful_widget_scaffold} + /// {@tool dartpad} /// Here is an example of using a [StatefulWidget] to keep track of the /// selected index, and using that to set the `selected` property on the /// corresponding [ListTile]. diff --git a/packages/flutter/lib/src/material/material_state.dart b/packages/flutter/lib/src/material/material_state.dart index 57d1e36a97..fbb6d45094 100644 --- a/packages/flutter/lib/src/material/material_state.dart +++ b/packages/flutter/lib/src/material/material_state.dart @@ -190,7 +190,7 @@ class _MaterialStateColor extends MaterialStateColor { /// To use a [MaterialStateMouseCursor], you should create a subclass of /// [MaterialStateMouseCursor] and implement the abstract `resolve` method. /// -/// {@tool dartpad --template=stateless_widget_scaffold_center} +/// {@tool dartpad} /// This example defines a mouse cursor that resolves to /// [SystemMouseCursors.forbidden] when its widget is disabled. /// @@ -284,7 +284,7 @@ class _EnabledAndDisabledMouseCursor extends MaterialStateMouseCursor { /// property values. [MaterialStateBorderSide] should only be used with widgets that document /// their support, like [ActionChip.side]. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// This example defines a subclass of [MaterialStateBorderSide], that resolves /// to a red border side when its widget is selected. /// @@ -365,7 +365,7 @@ class _MaterialStateBorderSide extends MaterialStateBorderSide { /// [OutlinedBorder] and implement [MaterialStateOutlinedBorder]'s abstract /// `resolve` method. /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This example defines a subclass of [RoundedRectangleBorder] and an /// implementation of [MaterialStateOutlinedBorder], that resolves to /// [RoundedRectangleBorder] when its widget is selected. @@ -409,7 +409,7 @@ abstract class MaterialStateOutlinedBorder extends OutlinedBorder implements Mat /// of their current material state and [resolve] the button style's /// material state properties when their value is needed. /// -/// {@tool dartpad --template=stateless_widget_scaffold_center} +/// {@tool dartpad} /// This example shows how you can override the default text and icon /// color (the "foreground color") of a [TextButton] with a /// [MaterialStateProperty]. In this example, the button's text color diff --git a/packages/flutter/lib/src/material/navigation_rail.dart b/packages/flutter/lib/src/material/navigation_rail.dart index 08815fccd5..21031365c0 100644 --- a/packages/flutter/lib/src/material/navigation_rail.dart +++ b/packages/flutter/lib/src/material/navigation_rail.dart @@ -35,7 +35,7 @@ import 'theme.dart'; /// [the adaptive_scaffold.dart sample](https://github.com/flutter/samples/blob/master/experimental/web_dashboard/lib/src/widgets/third_party/adaptive_scaffold.dart) /// for an example. /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This example shows a [NavigationRail] used within a Scaffold with 3 /// [NavigationRailDestination]s. The main content is separated by a divider /// (although elevation on the navigation rail can be used instead). The @@ -284,7 +284,7 @@ class NavigationRail extends StatefulWidget { /// This can be used to synchronize animations in the [leading] or [trailing] /// widget, such as an animated menu or a [FloatingActionButton] animation. /// - /// {@tool dartpad --template=freeform} + /// {@tool dartpad} /// This example shows how to use this animation to create a [FloatingActionButton] /// that animates itself between the normal and extended states of the /// [NavigationRail]. diff --git a/packages/flutter/lib/src/material/outlined_button.dart b/packages/flutter/lib/src/material/outlined_button.dart index d97f35f77d..5e7b8f3a2d 100644 --- a/packages/flutter/lib/src/material/outlined_button.dart +++ b/packages/flutter/lib/src/material/outlined_button.dart @@ -48,7 +48,7 @@ import 'theme_data.dart'; /// appearance of its outline, both the [ButtonStyle.shape] and /// [ButtonStyle.side] properties must be specified. /// -/// {@tool dartpad --template=stateless_widget_scaffold_center} +/// {@tool dartpad} /// Here is an example of a basic [OutlinedButton]. /// /// ** See code in examples/api/lib/material/outlined_button/outlined_button.0.dart ** diff --git a/packages/flutter/lib/src/material/progress_indicator.dart b/packages/flutter/lib/src/material/progress_indicator.dart index 6b7da70822..9805a914c8 100644 --- a/packages/flutter/lib/src/material/progress_indicator.dart +++ b/packages/flutter/lib/src/material/progress_indicator.dart @@ -246,7 +246,7 @@ class _LinearProgressIndicatorPainter extends CustomPainter { /// The minimum height of the indicator can be specified using [minHeight]. /// The indicator can be made taller by wrapping the widget with a [SizedBox]. /// -/// {@tool dartpad --template=stateful_widget_material_ticker} +/// {@tool dartpad} /// This example shows a [LinearProgressIndicator] with a changing value. /// /// ** See code in examples/api/lib/material/progress_indicator/linear_progress_indicator.0.dart ** @@ -466,7 +466,7 @@ class _CircularProgressIndicatorPainter extends CustomPainter { /// The indicator arc is displayed with [valueColor], an animated value. To /// specify a constant color use: `AlwaysStoppedAnimation(color)`. /// -/// {@tool dartpad --template=stateful_widget_material_ticker} +/// {@tool dartpad} /// This example shows a [CircularProgressIndicator] with a changing value. /// /// ** See code in examples/api/lib/material/progress_indicator/circular_progress_indicator.0.dart ** diff --git a/packages/flutter/lib/src/material/radio.dart b/packages/flutter/lib/src/material/radio.dart index ad9b4ff8eb..d320f0d8c5 100644 --- a/packages/flutter/lib/src/material/radio.dart +++ b/packages/flutter/lib/src/material/radio.dart @@ -27,7 +27,7 @@ const double _kInnerRadius = 4.5; /// will respond to [onChanged] by calling [State.setState] to update the /// radio button's [groupValue]. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// Here is an example of Radio widgets wrapped in ListTiles, which is similar /// to what you could get with the RadioListTile widget. /// @@ -165,7 +165,7 @@ class Radio extends StatefulWidget { /// /// The default is false. /// - /// {@tool dartpad --template=stateful_widget_scaffold} + /// {@tool dartpad} /// This example shows how to enable deselecting a radio button by setting the /// [toggleable] attribute. /// diff --git a/packages/flutter/lib/src/material/radio_list_tile.dart b/packages/flutter/lib/src/material/radio_list_tile.dart index 32d233ce55..45e056852d 100644 --- a/packages/flutter/lib/src/material/radio_list_tile.dart +++ b/packages/flutter/lib/src/material/radio_list_tile.dart @@ -42,7 +42,7 @@ import 'theme_data.dart'; /// To show the [RadioListTile] as disabled, pass null as the [onChanged] /// callback. /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// ![RadioListTile sample](https://flutter.github.io/assets-for-api-docs/assets/material/radio_list_tile.png) /// /// This widget shows a pair of radio buttons that control the `_character` @@ -68,7 +68,7 @@ import 'theme_data.dart'; /// into one. Therefore, it may be necessary to create a custom radio tile /// widget to accommodate similar use cases. /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// ![Radio list tile semantics sample](https://flutter.github.io/assets-for-api-docs/assets/material/radio_list_tile_semantics.png) /// /// Here is an example of a custom labeled radio widget, called @@ -85,7 +85,7 @@ import 'theme_data.dart'; /// combining [Radio] with other widgets, such as [Text], [Padding] and /// [InkWell]. /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// ![Custom radio list tile sample](https://flutter.github.io/assets-for-api-docs/assets/material/radio_list_tile_custom.png) /// /// Here is an example of a custom LabeledRadio widget, but you can easily @@ -200,7 +200,7 @@ class RadioListTile extends StatelessWidget { /// /// The default is false. /// - /// {@tool dartpad --template=stateful_widget_scaffold} + /// {@tool dartpad} /// This example shows how to enable deselecting a radio button by setting the /// [toggleable] attribute. /// diff --git a/packages/flutter/lib/src/material/range_slider.dart b/packages/flutter/lib/src/material/range_slider.dart index 83c08f377e..2dcf4d3371 100644 --- a/packages/flutter/lib/src/material/range_slider.dart +++ b/packages/flutter/lib/src/material/range_slider.dart @@ -33,7 +33,7 @@ typedef PaintRangeValueIndicator = void Function(PaintingContext context, Offset /// /// {@youtube 560 315 https://www.youtube.com/watch?v=ufb4gIPDmEs} /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// ![A range slider widget, consisting of 5 divisions and showing the default /// value indicator.](https://flutter.github.io/assets-for-api-docs/assets/material/range_slider.png) /// diff --git a/packages/flutter/lib/src/material/reorderable_list.dart b/packages/flutter/lib/src/material/reorderable_list.dart index f2fa59d856..9b05827521 100644 --- a/packages/flutter/lib/src/material/reorderable_list.dart +++ b/packages/flutter/lib/src/material/reorderable_list.dart @@ -29,7 +29,7 @@ import 'theme.dart'; /// The [onReorder] parameter is required and will be called when a child /// widget is dragged to a new position. /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// /// /// ** See code in examples/api/lib/material/reorderable_list/reorderable_list_view.0.dart ** @@ -99,7 +99,7 @@ class ReorderableListView extends StatefulWidget { /// This example creates a list using the /// [ReorderableListView.builder] constructor. Using the [IndexedWidgetBuilder], The /// list items are built lazily on demand. - /// {@tool dartpad --template=stateful_widget_material} + /// {@tool dartpad} /// /// /// ** See code in examples/api/lib/material/reorderable_list/reorderable_list_view.reorderable_list_view_builder.0.dart ** @@ -171,7 +171,7 @@ class ReorderableListView extends StatefulWidget { /// The following sample specifies `buildDefaultDragHandles: false`, and /// uses a [Card] at the leading edge of each item for the item's drag handle. /// - /// {@tool dartpad --template=stateful_widget_scaffold} + /// {@tool dartpad} /// /// /// ** See code in examples/api/lib/material/reorderable_list/reorderable_list_view.build_default_drag_handles.0.dart ** diff --git a/packages/flutter/lib/src/material/scaffold.dart b/packages/flutter/lib/src/material/scaffold.dart index 6e6a3a42c2..d661125b8a 100644 --- a/packages/flutter/lib/src/material/scaffold.dart +++ b/packages/flutter/lib/src/material/scaffold.dart @@ -76,7 +76,7 @@ enum _ScaffoldSlot { /// Scaffolds, set a new scope by instantiating a new ScaffoldMessenger in /// between the levels of nesting. /// -/// {@tool dartpad --template=stateless_widget_scaffold_center} +/// {@tool dartpad} /// Here is an example of showing a [SnackBar] when the user presses a button. /// /// ** See code in examples/api/lib/material/scaffold/scaffold_messenger.0.dart ** @@ -107,7 +107,7 @@ class ScaffoldMessenger extends StatefulWidget { /// The state from the closest instance of this class that encloses the given /// context. /// - /// {@tool dartpad --template=stateless_widget_scaffold_center} + /// {@tool dartpad} /// Typical usage of the [ScaffoldMessenger.of] function is to call it in /// response to a user gesture or an application state change. /// @@ -120,7 +120,7 @@ class ScaffoldMessenger extends StatefulWidget { /// function. The [MaterialApp.scaffoldMessengerKey] refers to the root /// ScaffoldMessenger that is provided by default. /// - /// {@tool dartpad --template=freeform} + /// {@tool dartpad} /// Sometimes [SnackBar]s are produced by code that doesn't have ready access /// to a valid [BuildContext]. One such example of this is when you show a /// SnackBar from a method outside of the `build` function. In these @@ -258,7 +258,7 @@ class ScaffoldMessengerState extends State with TickerProvide /// See [ScaffoldMessenger.of] for information about how to obtain the /// [ScaffoldMessengerState]. /// - /// {@tool dartpad --template=stateless_widget_scaffold_center} + /// {@tool dartpad} /// Here is an example of showing a [SnackBar] when the user presses a button. /// /// ** See code in examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.0.dart ** @@ -384,7 +384,7 @@ class ScaffoldMessengerState extends State with TickerProvide /// See [ScaffoldMessenger.of] for information about how to obtain the /// [ScaffoldMessengerState]. /// - /// {@tool dartpad --template=stateless_widget_scaffold_center} + /// {@tool dartpad} /// Here is an example of showing a [MaterialBanner] when the user presses a button. /// /// ** See code in examples/api/lib/material/scaffold/scaffold_messenger_state.show_material_banner.0.dart ** @@ -1353,7 +1353,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr /// [ScaffoldState] for the current [BuildContext] via [Scaffold.of] and use the /// [ScaffoldState.showBottomSheet] function. /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This example shows a [Scaffold] with a [body] and [FloatingActionButton]. /// The [body] is a [Text] placed in a [Center] in order to center the text /// within the [Scaffold]. The [FloatingActionButton] is connected to a @@ -1364,7 +1364,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr /// ** See code in examples/api/lib/material/scaffold/scaffold.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This example shows a [Scaffold] with a blueGrey [backgroundColor], [body] /// and [FloatingActionButton]. The [body] is a [Text] placed in a [Center] in /// order to center the text within the [Scaffold]. The [FloatingActionButton] @@ -1375,7 +1375,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr /// ** See code in examples/api/lib/material/scaffold/scaffold.1.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This example shows a [Scaffold] with an [AppBar], a [BottomAppBar] and a /// [FloatingActionButton]. The [body] is a [Text] placed in a [Center] in order /// to center the text within the [Scaffold]. The [FloatingActionButton] is @@ -1592,7 +1592,7 @@ class Scaffold extends StatefulWidget { /// /// To close the drawer, use [Navigator.pop]. /// - /// {@tool dartpad --template=stateful_widget_material} + /// {@tool dartpad} /// To disable the drawer edge swipe, set the /// [Scaffold.drawerEnableOpenDragGesture] to false. Then, use /// [ScaffoldState.openDrawer] to open the drawer and [Navigator.pop] to close @@ -1615,7 +1615,7 @@ class Scaffold extends StatefulWidget { /// /// To close the drawer, use [Navigator.pop]. /// - /// {@tool dartpad --template=stateful_widget_material} + /// {@tool dartpad} /// To disable the drawer edge swipe, set the /// [Scaffold.endDrawerEnableOpenDragGesture] to false. Then, use /// [ScaffoldState.openEndDrawer] to open the drawer and [Navigator.pop] to @@ -1747,14 +1747,14 @@ class Scaffold extends StatefulWidget { /// /// This method can be expensive (it walks the element tree). /// - /// {@tool dartpad --template=freeform} + /// {@tool dartpad} /// Typical usage of the [Scaffold.of] function is to call it from within the /// `build` method of a child of a [Scaffold]. /// /// ** See code in examples/api/lib/material/scaffold/scaffold.of.0.dart ** /// {@end-tool} /// - /// {@tool dartpad --template=stateless_widget_material} + /// {@tool dartpad} /// When the [Scaffold] is actually created in the same `build` function, the /// `context` argument to the `build` function can't be used to find the /// [Scaffold] (since it's "above" the widget being returned in the widget @@ -2038,7 +2038,7 @@ class ScaffoldState extends State with TickerProviderStateMixin, Resto /// See [ScaffoldMessenger.of] for information about how to obtain the /// [ScaffoldMessengerState]. /// - /// {@tool dartpad --template=stateless_widget_scaffold_center} + /// {@tool dartpad} /// Here is an example of showing a [SnackBar] when the user presses a button. /// /// ** See code in examples/api/lib/material/scaffold/scaffold_state.show_snack_bar.0.dart ** @@ -2441,7 +2441,7 @@ class ScaffoldState extends State with TickerProviderStateMixin, Resto /// of the app. Modal bottom sheets can be created and displayed with the /// [showModalBottomSheet] function. /// - /// {@tool dartpad --template=stateless_widget_scaffold} + /// {@tool dartpad} /// This example demonstrates how to use `showBottomSheet` to display a /// bottom sheet when a user taps a button. It also demonstrates how to /// close a bottom sheet using the Navigator. diff --git a/packages/flutter/lib/src/material/scrollbar.dart b/packages/flutter/lib/src/material/scrollbar.dart index 15009f4fbb..959ef70093 100644 --- a/packages/flutter/lib/src/material/scrollbar.dart +++ b/packages/flutter/lib/src/material/scrollbar.dart @@ -34,14 +34,14 @@ const Duration _kScrollbarTimeToFade = Duration(milliseconds: 600); /// [showTrackOnHover]. The thickness of the track and scrollbar thumb will /// become larger when hovering, unless overridden by [hoverThickness]. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This sample shows a [Scrollbar] that executes a fade animation as scrolling occurs. /// The Scrollbar will fade into view as the user scrolls, and fade out when scrolling stops. /// /// ** See code in examples/api/lib/material/scrollbar/scrollbar.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// When isAlwaysShown is true, the scrollbar thumb will remain visible without the /// fade animation. This requires that a ScrollController is provided to controller, /// or that the PrimaryScrollController is available. diff --git a/packages/flutter/lib/src/material/slider.dart b/packages/flutter/lib/src/material/slider.dart index 1d2c60fb7c..5c19812dfb 100644 --- a/packages/flutter/lib/src/material/slider.dart +++ b/packages/flutter/lib/src/material/slider.dart @@ -38,7 +38,7 @@ enum _SliderType { material, adaptive } /// /// {@youtube 560 315 https://www.youtube.com/watch?v=ufb4gIPDmEs} /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// ![A slider widget, consisting of 5 divisions and showing the default value /// indicator.](https://flutter.github.io/assets-for-api-docs/assets/material/slider.png) /// diff --git a/packages/flutter/lib/src/material/snack_bar.dart b/packages/flutter/lib/src/material/snack_bar.dart index e0277da2a9..cb6fd9c89b 100644 --- a/packages/flutter/lib/src/material/snack_bar.dart +++ b/packages/flutter/lib/src/material/snack_bar.dart @@ -157,14 +157,14 @@ class _SnackBarActionState extends State { /// A SnackBar with an action will not time out when TalkBack or VoiceOver are /// enabled. This is controlled by [AccessibilityFeatures.accessibleNavigation]. /// -/// {@tool dartpad --template=stateless_widget_scaffold_center} +/// {@tool dartpad} /// Here is an example of a [SnackBar] with an [action] button implemented using /// [SnackBarAction]. /// /// ** See code in examples/api/lib/material/snack_bar/snack_bar.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateless_widget_scaffold_center} +/// {@tool dartpad} /// Here is an example of a customized [SnackBar]. It utilizes /// [behavior], [shape], [padding], [width], and [duration] to customize the /// location, appearance, and the duration for which the [SnackBar] is visible. diff --git a/packages/flutter/lib/src/material/stepper.dart b/packages/flutter/lib/src/material/stepper.dart index f6723365b6..134bfdcf1b 100755 --- a/packages/flutter/lib/src/material/stepper.dart +++ b/packages/flutter/lib/src/material/stepper.dart @@ -173,8 +173,9 @@ class Step { /// to this widget based on some logic triggered by the three callbacks that it /// provides. /// -/// {@tool sample --template=stateful_widget_scaffold_center} -/// +/// {@tool dartpad} +/// An example the shows how to use the [Stepper], and the [Stepper] UI +/// appearance. /// /// ** See code in examples/api/lib/material/stepper/stepper.0.dart ** /// {@end-tool} @@ -256,7 +257,7 @@ class Stepper extends StatefulWidget { /// [ControlsDetails.currentStep] value within the callback can change the text /// of the continue or cancel button depending on which step users are at. /// - /// {@tool dartpad --template=stateless_widget_scaffold} + /// {@tool dartpad} /// Creates a stepper control with custom buttons. /// /// ```dart diff --git a/packages/flutter/lib/src/material/switch_list_tile.dart b/packages/flutter/lib/src/material/switch_list_tile.dart index 60800f60ea..2caf4d34c4 100644 --- a/packages/flutter/lib/src/material/switch_list_tile.dart +++ b/packages/flutter/lib/src/material/switch_list_tile.dart @@ -49,7 +49,7 @@ enum _SwitchListTileType { material, adaptive } /// To show the [SwitchListTile] as disabled, pass null as the [onChanged] /// callback. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// ![SwitchListTile sample](https://flutter.github.io/assets-for-api-docs/assets/material/switch_list_tile.png) /// /// This widget shows a switch that, when toggled, changes the state of a [bool] @@ -75,7 +75,7 @@ enum _SwitchListTileType { material, adaptive } /// into one. Therefore, it may be necessary to create a custom radio tile /// widget to accommodate similar use cases. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// ![Switch list tile semantics sample](https://flutter.github.io/assets-for-api-docs/assets/material/switch_list_tile_semantics.png) /// /// Here is an example of a custom labeled radio widget, called @@ -92,7 +92,7 @@ enum _SwitchListTileType { material, adaptive } /// combining [Switch] with other widgets, such as [Text], [Padding] and /// [InkWell]. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// ![Custom switch list tile sample](https://flutter.github.io/assets-for-api-docs/assets/material/switch_list_tile_custom.png) /// /// Here is an example of a custom LabeledSwitch widget, but you can easily diff --git a/packages/flutter/lib/src/material/tab_controller.dart b/packages/flutter/lib/src/material/tab_controller.dart index 8c2d74b408..fd20e091a5 100644 --- a/packages/flutter/lib/src/material/tab_controller.dart +++ b/packages/flutter/lib/src/material/tab_controller.dart @@ -84,7 +84,7 @@ import 'constants.dart'; /// ``` /// {@end-tool} /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This example shows how to listen to page updates in [TabBar] and [TabBarView] /// when using [DefaultTabController]. /// diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart index 43d7375439..7ff22a687e 100644 --- a/packages/flutter/lib/src/material/tabs.dart +++ b/packages/flutter/lib/src/material/tabs.dart @@ -587,14 +587,14 @@ class _TabBarScrollController extends ScrollController { /// /// Uses values from [TabBarTheme] if it is set in the current context. /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This sample shows the implementation of [TabBar] and [TabBarView] using a [DefaultTabController]. /// Each [Tab] corresponds to a child of the [TabBarView] in the order they are written. /// /// ** See code in examples/api/lib/material/tabs/tab_bar.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateful_widget_material_ticker} +/// {@tool dartpad} /// [TabBar] can also be implemented by using a [TabController] which provides more options /// to control the behavior of the [TabBar] and [TabBarView]. This can be used instead of /// a [DefaultTabController], demonstrated below. diff --git a/packages/flutter/lib/src/material/text_button.dart b/packages/flutter/lib/src/material/text_button.dart index 7efd6b9580..8b5cdab64e 100644 --- a/packages/flutter/lib/src/material/text_button.dart +++ b/packages/flutter/lib/src/material/text_button.dart @@ -50,7 +50,7 @@ import 'theme_data.dart'; /// If the [onPressed] and [onLongPress] callbacks are null, then this /// button will be disabled, it will not react to touch. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This sample shows how to render a disabled TextButton, an enabled TextButton /// and lastly a TextButton with gradient background. /// diff --git a/packages/flutter/lib/src/material/text_field.dart b/packages/flutter/lib/src/material/text_field.dart index 5222ef4e6c..8e6dc27f5f 100644 --- a/packages/flutter/lib/src/material/text_field.dart +++ b/packages/flutter/lib/src/material/text_field.dart @@ -196,7 +196,7 @@ class _TextFieldSelectionGestureDetectorBuilder extends TextSelectionGestureDete /// callback. This callback is applied to the text field's current value when /// the user finishes editing. /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This sample shows how to get a value from a TextField via the [onSubmitted] /// callback. /// diff --git a/packages/flutter/lib/src/material/text_form_field.dart b/packages/flutter/lib/src/material/text_form_field.dart index dcd38f4baf..9d458f321a 100644 --- a/packages/flutter/lib/src/material/text_form_field.dart +++ b/packages/flutter/lib/src/material/text_form_field.dart @@ -67,7 +67,7 @@ export 'package:flutter/services.dart' show SmartQuotesType, SmartDashesType; /// ``` /// {@end-tool} /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This example shows how to move the focus to the next field when the user /// presses the SPACE key. /// diff --git a/packages/flutter/lib/src/material/tooltip.dart b/packages/flutter/lib/src/material/tooltip.dart index 9b072f17c3..e755bda89a 100644 --- a/packages/flutter/lib/src/material/tooltip.dart +++ b/packages/flutter/lib/src/material/tooltip.dart @@ -31,7 +31,7 @@ import 'tooltip_theme.dart'; /// /// {@youtube 560 315 https://www.youtube.com/watch?v=EeEfD5fI-5Q} /// -/// {@tool dartpad --template=stateless_widget_scaffold_center} +/// {@tool dartpad} /// This example show a basic [Tooltip] which has a [Text] as child. /// [message] contains your label to be shown by the tooltip when /// the child that Tooltip wraps is hovered over on web or desktop. On mobile, @@ -40,7 +40,7 @@ import 'tooltip_theme.dart'; /// ** See code in examples/api/lib/material/tooltip/tooltip.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateless_widget_scaffold_center} +/// {@tool dartpad} /// This example covers most of the attributes available in Tooltip. /// `decoration` has been used to give a gradient and borderRadius to Tooltip. /// `height` has been used to set a specific height of the Tooltip. @@ -56,7 +56,7 @@ import 'tooltip_theme.dart'; /// ** See code in examples/api/lib/material/tooltip/tooltip.1.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateless_widget_scaffold_center} +/// {@tool dartpad} /// This example shows a rich [Tooltip] that specifies the [richMessage] /// parameter instead of the [message] parameter (only one of these may be /// non-null. Any [InlineSpan] can be specified for the [richMessage] attribute, diff --git a/packages/flutter/lib/src/painting/gradient.dart b/packages/flutter/lib/src/painting/gradient.dart index fa96fb96e6..48fb755c98 100644 --- a/packages/flutter/lib/src/painting/gradient.dart +++ b/packages/flutter/lib/src/painting/gradient.dart @@ -331,7 +331,7 @@ abstract class Gradient { /// Typically this class is used with [BoxDecoration], which does the painting. /// To use a [LinearGradient] to paint on a canvas directly, see [createShader]. /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This sample draws a picture that looks like vertical window shades by having /// a [Container] display a [BoxDecoration] with a [LinearGradient]. /// diff --git a/packages/flutter/lib/src/rendering/sliver_grid.dart b/packages/flutter/lib/src/rendering/sliver_grid.dart index cf54395a0e..86e5005a9f 100644 --- a/packages/flutter/lib/src/rendering/sliver_grid.dart +++ b/packages/flutter/lib/src/rendering/sliver_grid.dart @@ -275,7 +275,7 @@ abstract class SliverGridDelegate { /// /// This delegate creates grids with equally sized and spaced tiles. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// Here is an example using the [childAspectRatio] property. On a device with a /// screen width of 800.0, it creates a GridView with each tile with a width of /// 200.0 and a height of 100.0. @@ -283,7 +283,7 @@ abstract class SliverGridDelegate { /// ** See code in examples/api/lib/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// Here is an example using the [mainAxisExtent] property. On a device with a /// screen width of 800.0, it creates a GridView with each tile with a width of /// 200.0 and a height of 150.0. diff --git a/packages/flutter/lib/src/services/keyboard_key.dart b/packages/flutter/lib/src/services/keyboard_key.dart index bc9f75cf01..006b5acb86 100644 --- a/packages/flutter/lib/src/services/keyboard_key.dart +++ b/packages/flutter/lib/src/services/keyboard_key.dart @@ -46,7 +46,7 @@ abstract class KeyboardKey with Diagnosticable { /// look at the physical key to make sure that regardless of the character the /// key produces, you got the key that is in that location on the keyboard. /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// This example shows how to detect if the user has selected the logical "Q" /// key. /// @@ -3492,7 +3492,7 @@ class LogicalKeyboardKey extends KeyboardKey { /// looking for "the key next to the TAB key", since on a French keyboard, /// the key next to the TAB key has an "A" on it. /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// This example shows how to detect if the user has selected the physical key /// to the right of the CAPS LOCK key. /// diff --git a/packages/flutter/lib/src/services/system_chrome.dart b/packages/flutter/lib/src/services/system_chrome.dart index 112596dac9..9894f1d534 100644 --- a/packages/flutter/lib/src/services/system_chrome.dart +++ b/packages/flutter/lib/src/services/system_chrome.dart @@ -566,7 +566,7 @@ class SystemChrome { /// navigation bar and synthesize them into a single style. This can be used /// to configure the system styles when an app bar is not used. /// - /// {@tool sample --template=stateful_widget_material} + /// {@tool sample} /// The following example creates a widget that changes the status bar color /// to a random value on Android. /// diff --git a/packages/flutter/lib/src/widgets/actions.dart b/packages/flutter/lib/src/widgets/actions.dart index 002b9c3df2..8a09437af5 100644 --- a/packages/flutter/lib/src/widgets/actions.dart +++ b/packages/flutter/lib/src/widgets/actions.dart @@ -140,7 +140,7 @@ abstract class Action with Diagnosticable { /// to allow further overriding, or to allow the [Intent] to propagate to /// parent widgets that also support this [Intent]. /// - /// {@tool sample --template=freeform} + /// {@tool dartpad} /// This sample implements a custom text input field that handles the /// [DeleteTextIntent] intent, as well as a US telephone number input widget /// that consists of multiple text fields for area code, prefix and line @@ -386,7 +386,7 @@ abstract class Action with Diagnosticable { /// this widget. If you are using an [Action] outside of a widget context, then /// you must call removeListener yourself. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// This example shows how ActionListener handles adding and removing of /// the [listener] in the widget lifecycle. /// @@ -580,7 +580,7 @@ class ActionDispatcher with Diagnosticable { /// Actions are typically invoked using [Actions.invoke] with the context /// containing the ambient [Actions] widget. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// This example creates a custom [Action] subclass `ModifyAction` for modifying /// a model, and another, `SaveAction` for saving it. /// @@ -1034,7 +1034,7 @@ class _ActionsMarker extends InheritedWidget { /// widget, and the new control should be enabled for keyboard traversal and /// activation. /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This example shows how keyboard interaction can be added to a custom control /// that changes color when hovered and focused, and can toggle a light when /// activated, either by touch or by hitting the `X` key on the keyboard when diff --git a/packages/flutter/lib/src/widgets/animated_list.dart b/packages/flutter/lib/src/widgets/animated_list.dart index 7abba1f076..867bb4b1ae 100644 --- a/packages/flutter/lib/src/widgets/animated_list.dart +++ b/packages/flutter/lib/src/widgets/animated_list.dart @@ -47,7 +47,7 @@ class _ActiveItem implements Comparable<_ActiveItem> { /// /// {@youtube 560 315 https://www.youtube.com/watch?v=ZtfItHwFlZ8} /// -/// {@tool dartpad --template=freeform} +/// {@tool dartpad} /// This sample application uses an [AnimatedList] to create an effect when /// items are removed or added to the list. /// @@ -321,7 +321,7 @@ class AnimatedListState extends State with TickerProviderStateMixi /// [GlobalKey] or use the static [SliverAnimatedList.of] method from an item's /// input callback. /// -/// {@tool dartpad --template=freeform} +/// {@tool dartpad} /// This sample application uses a [SliverAnimatedList] to create an animated /// effect when items are removed or added to the list. /// diff --git a/packages/flutter/lib/src/widgets/animated_size.dart b/packages/flutter/lib/src/widgets/animated_size.dart index 4ff314683a..75829bac92 100644 --- a/packages/flutter/lib/src/widgets/animated_size.dart +++ b/packages/flutter/lib/src/widgets/animated_size.dart @@ -11,7 +11,7 @@ import 'ticker_provider.dart'; /// Animated widget that automatically transitions its size over a given /// duration whenever the given child's size changes. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center_freeform_state} +/// {@tool dartpad} /// This example makes a [Container] react to being touched, causing the child /// of the [AnimatedSize] widget, here a [FlutterLogo], to animate. /// diff --git a/packages/flutter/lib/src/widgets/animated_switcher.dart b/packages/flutter/lib/src/widgets/animated_switcher.dart index 9fcf6ba757..e2c4f10421 100644 --- a/packages/flutter/lib/src/widgets/animated_switcher.dart +++ b/packages/flutter/lib/src/widgets/animated_switcher.dart @@ -89,7 +89,7 @@ typedef AnimatedSwitcherLayoutBuilder = Widget Function(Widget? currentChild, Li /// The type of transition can be changed from a cross-fade to a custom /// transition by setting the [transitionBuilder]. /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This sample shows a counter that animates the scale of a text widget /// whenever the value changes. /// diff --git a/packages/flutter/lib/src/widgets/async.dart b/packages/flutter/lib/src/widgets/async.dart index 7cbbac860f..7d5319f9c7 100644 --- a/packages/flutter/lib/src/widgets/async.dart +++ b/packages/flutter/lib/src/widgets/async.dart @@ -366,7 +366,7 @@ typedef AsyncWidgetBuilder = Widget Function(BuildContext context, AsyncSnaps /// as the builder will always be called before the stream listener has a chance /// to be processed. /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This sample shows a [StreamBuilder] that listens to a Stream that emits bids /// for an auction. Every time the StreamBuilder receives a bid from the Stream, /// it will display the price of the bid below an icon. If the Stream emits an @@ -506,7 +506,7 @@ class StreamBuilder extends StreamBuilderBase> { /// `future?.asStream()`, except that snapshots with `ConnectionState.active` /// may appear for the latter, depending on how the stream is implemented. /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This sample shows a [FutureBuilder] that displays a loading spinner while it /// loads data. It displays a success icon and text if the [Future] completes /// with a result, or an error icon and text if the [Future] completes with an diff --git a/packages/flutter/lib/src/widgets/autocomplete.dart b/packages/flutter/lib/src/widgets/autocomplete.dart index 863aee3594..5802fdeba9 100644 --- a/packages/flutter/lib/src/widgets/autocomplete.dart +++ b/packages/flutter/lib/src/widgets/autocomplete.dart @@ -85,7 +85,7 @@ typedef AutocompleteOptionToString = String Function(T option) /// /// This is a core framework widget with very basic UI. /// -/// {@tool dartpad --template=freeform} +/// {@tool dartpad} /// This example shows how to create a very basic autocomplete widget using the /// [fieldViewBuilder] and [optionsViewBuilder] parameters. /// @@ -98,14 +98,14 @@ typedef AutocompleteOptionToString = String Function(T option) /// Options will be compared using `==`, so it may be beneficial to override /// [Object.==] and [Object.hashCode] for custom types. /// -/// {@tool dartpad --template=freeform} +/// {@tool dartpad} /// This example is similar to the previous example, but it uses a custom T data /// type instead of directly using String. /// /// ** See code in examples/api/lib/widgets/autocomplete/raw_autocomplete.1.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=freeform} +/// {@tool dartpad} /// This example shows the use of RawAutocomplete in a form. /// /// ** See code in examples/api/lib/widgets/autocomplete/raw_autocomplete.2.dart ** @@ -167,7 +167,7 @@ class RawAutocomplete extends StatefulWidget { /// FocusNode and TextEditingController can be passed both to that text field /// and to RawAutocomplete. /// - /// {@tool dartpad --template=freeform} + /// {@tool dartpad} /// This examples shows how to create an autocomplete widget with the text /// field in the AppBar and the results in the main body of the app. /// diff --git a/packages/flutter/lib/src/widgets/autofill.dart b/packages/flutter/lib/src/widgets/autofill.dart index d10569946c..31569f27bf 100644 --- a/packages/flutter/lib/src/widgets/autofill.dart +++ b/packages/flutter/lib/src/widgets/autofill.dart @@ -51,7 +51,7 @@ enum AutofillContextAction { /// autofillable input fields in an [AutofillGroup], so the user input of the /// [Form] can be saved for future autofill by the platform. /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// An example form with autofillable fields grouped into different /// `AutofillGroup`s. /// diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index 5c08a36779..43c9fa2195 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -1049,7 +1049,7 @@ class PhysicalModel extends SingleChildRenderObjectWidget { /// [PhysicalModel] does the same but only supports shapes that can be expressed /// as rectangles with rounded corners. /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This example shows how to use a [PhysicalShape] on a centered [SizedBox] /// to clip it to a rounded rectangle using a [ShapeBorderClipper] and give it /// an orange color along with a shadow. @@ -1534,7 +1534,7 @@ class CompositedTransformFollower extends SingleChildRenderObjectWidget { /// /// {@youtube 560 315 https://www.youtube.com/watch?v=T4Uehk3_wlY} /// -/// {@tool dartpad --template=stateless_widget_scaffold_center} +/// {@tool dartpad} /// In this example, the image is stretched to fill the entire [Container], which would /// not happen normally without using FittedBox. /// @@ -2696,7 +2696,7 @@ class UnconstrainedBox extends StatelessWidget { /// /// {@youtube 560 315 https://www.youtube.com/watch?v=PEsY654EGZ0} /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This sample shows a [FractionallySizedBox] whose one child is 50% of /// the box's size per the width and height factor parameters, and centered /// within that box by the alignment parameter. @@ -3050,7 +3050,7 @@ class SizedOverflowBox extends SingleChildRenderObjectWidget { /// needed, prefer removing the widget from the tree entirely rather than /// keeping it alive in an [Offstage] subtree. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// This example shows a [FlutterLogo] widget when the `_offstage` member field /// is false, and hides it without any room in the parent when it is true. When /// offstage, this app displays a button to get the logo size, which will be @@ -3129,7 +3129,7 @@ class _OffstageElement extends SingleChildRenderObjectElement { /// 16.0/9.0. If the maximum width is infinite, the initial width is determined /// by applying the aspect ratio to the maximum height. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This examples shows how AspectRatio sets width when its parent's width /// constraint is infinite. Since its parent's allowed height is a fixed value, /// the actual width is determined via the given AspectRatio. @@ -3145,7 +3145,7 @@ class _OffstageElement extends SingleChildRenderObjectElement { /// the height to be between 0.0 and 100.0. We'll select a width of 100.0 (the /// biggest allowed) and a height of 50.0 (to match the aspect ratio). /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// /// /// ** See code in examples/api/lib/widgets/basic/aspect_ratio.1.dart ** @@ -3163,7 +3163,7 @@ class _OffstageElement extends SingleChildRenderObjectElement { /// will eventually select a size for the child that meets the layout /// constraints but fails to meet the aspect ratio constraints. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// /// /// ** See code in examples/api/lib/widgets/basic/aspect_ratio.2.dart ** @@ -5008,7 +5008,7 @@ class Flexible extends ParentDataWidget { /// /// {@youtube 560 315 https://www.youtube.com/watch?v=_rnZaagadyo} /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This example shows how to use an [Expanded] widget in a [Column] so that /// its middle child, a [Container] here, expands to fill the space. /// @@ -5017,7 +5017,7 @@ class Flexible extends ParentDataWidget { /// ** See code in examples/api/lib/widgets/basic/expanded.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This example shows how to use an [Expanded] widget in a [Row] with multiple /// children expanded, utilizing the [flex] factor to prioritize available space. /// @@ -5335,7 +5335,7 @@ class Wrap extends MultiChildRenderObjectWidget { /// * The [catalog of layout widgets](https://flutter.dev/widgets/layout/). /// /// -/// {@tool dartpad --template=freeform} +/// {@tool dartpad} /// This example uses the [Flow] widget to create a menu that opens and closes /// as it is interacted with, shown above. The color of the button in the menu /// changes to indicate which one has been selected. @@ -6039,7 +6039,7 @@ class WidgetToRenderBoxAdapter extends LeafRenderObjectWidget { /// If it has a child, this widget defers to the child for sizing behavior. If /// it does not have a child, it grows to fit the parent instead. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// This example makes a [Container] react to being touched, showing a count of /// the number of pointer downs and ups. /// @@ -6153,7 +6153,7 @@ class Listener extends SingleChildRenderObjectWidget { /// If it has a child, this widget defers to the child for sizing behavior. If /// it does not have a child, it grows to fit the parent instead. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// This example makes a [Container] react to being entered by a mouse /// pointer, showing a count of the number of entries and exits. /// @@ -6268,7 +6268,7 @@ class MouseRegion extends StatefulWidget { /// override [State.dispose] and call [onExit], or create your own widget /// using [RenderMouseRegion]. /// - /// {@tool dartpad --template=stateful_widget_scaffold_center} + /// {@tool dartpad} /// The following example shows a blue rectangular that turns yellow when /// hovered. Since the hover state is completely contained within a widget /// that unconditionally creates the `MouseRegion`, you can ignore the @@ -6277,7 +6277,7 @@ class MouseRegion extends StatefulWidget { /// ** See code in examples/api/lib/widgets/basic/mouse_region.on_exit.0.dart ** /// {@end-tool} /// - /// {@tool dartpad --template=stateful_widget_scaffold_center} + /// {@tool dartpad} /// The following example shows a widget that hides its content one second /// after being hovered, and also exposes the enter and exit callbacks. /// Because the widget conditionally creates the `MouseRegion`, and leaks the @@ -6486,7 +6486,7 @@ class RepaintBoundary extends SingleChildRenderObjectWidget { /// /// {@youtube 560 315 https://www.youtube.com/watch?v=qV9pqHWxYgI} /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// The following sample has an [IgnorePointer] widget wrapping the `Column` /// which contains a button. /// When [ignoring] is set to `true` anything inside the `Column` can @@ -6559,7 +6559,7 @@ class IgnorePointer extends SingleChildRenderObjectWidget { /// /// {@youtube 560 315 https://www.youtube.com/watch?v=65HoWqBboI8} /// -/// {@tool dartpad --template=stateless_widget_scaffold_center} +/// {@tool dartpad} /// The following sample has an [AbsorbPointer] widget wrapping the button on /// top of the stack, which absorbs pointer events, preventing its child button /// __and__ the button below it in the stack from receiving the pointer events. diff --git a/packages/flutter/lib/src/widgets/color_filter.dart b/packages/flutter/lib/src/widgets/color_filter.dart index a76f0ad0c2..462697bde4 100644 --- a/packages/flutter/lib/src/widgets/color_filter.dart +++ b/packages/flutter/lib/src/widgets/color_filter.dart @@ -17,7 +17,7 @@ import 'framework.dart'; /// /// {@youtube 560 315 https://www.youtube.com/watch?v=F7Cll22Dno8} /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// These two images have two [ColorFilter]s applied with different [BlendMode]s, /// one with red color and [BlendMode.modulate] another with a grey color and [BlendMode.saturation]. /// diff --git a/packages/flutter/lib/src/widgets/dismissible.dart b/packages/flutter/lib/src/widgets/dismissible.dart index dc5748ceac..f86a22020d 100644 --- a/packages/flutter/lib/src/widgets/dismissible.dart +++ b/packages/flutter/lib/src/widgets/dismissible.dart @@ -65,7 +65,7 @@ enum DismissDirection { /// /// {@youtube 560 315 https://www.youtube.com/watch?v=iEMgjrfuc58} /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// This sample shows how you can use the [Dismissible] widget to /// remove list items using swipe gestures. Swipe any of the list /// tiles to the left or right to dismiss them from the [ListView]. diff --git a/packages/flutter/lib/src/widgets/drag_target.dart b/packages/flutter/lib/src/widgets/drag_target.dart index a9243ac147..58a249bfbf 100644 --- a/packages/flutter/lib/src/widgets/drag_target.dart +++ b/packages/flutter/lib/src/widgets/drag_target.dart @@ -165,7 +165,7 @@ enum DragAnchor { /// /// {@youtube 560 315 https://www.youtube.com/watch?v=QzA4c4QHZCY} /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// The following example has a [Draggable] widget along with a [DragTarget] /// in a row demonstrating an incremented `acceptedData` integer value when /// you drag the element to the target. diff --git a/packages/flutter/lib/src/widgets/editable_text.dart b/packages/flutter/lib/src/widgets/editable_text.dart index 702830604b..abb3d568c7 100644 --- a/packages/flutter/lib/src/widgets/editable_text.dart +++ b/packages/flutter/lib/src/widgets/editable_text.dart @@ -85,7 +85,7 @@ const int _kObscureShowLatestCharCursorTicks = 3; /// /// Remember to [dispose] of the [TextEditingController] when it is no longer /// needed. This will ensure we discard any resources used by the object. -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This example creates a [TextField] with a [TextEditingController] whose /// change listener forces the entered text to be lower case and keeps the /// cursor at the end of the input. @@ -916,7 +916,7 @@ class EditableText extends StatefulWidget { /// and selection, one can add a listener to its [controller] with /// [TextEditingController.addListener]. /// - /// {@tool dartpad --template=stateful_widget_material} + /// {@tool dartpad} /// This example shows how onChanged could be used to check the TextField's /// current value each time the user inserts or deletes a character. /// diff --git a/packages/flutter/lib/src/widgets/focus_manager.dart b/packages/flutter/lib/src/widgets/focus_manager.dart index fb8fa12b83..c13ec28fe2 100644 --- a/packages/flutter/lib/src/widgets/focus_manager.dart +++ b/packages/flutter/lib/src/widgets/focus_manager.dart @@ -373,7 +373,7 @@ enum UnfocusDisposition { /// [DirectionalFocusTraversalPolicyMixin], but custom policies can be built /// based upon these policies. See [FocusTraversalPolicy] for more information. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This example shows how a FocusNode should be managed if not using the /// [Focus] or [FocusScope] widgets. See the [Focus] widget for a similar /// example using [Focus] and [FocusScope] widgets. @@ -768,7 +768,7 @@ class FocusNode with DiagnosticableTreeMixin, ChangeNotifier { /// previous node in the enclosing [FocusTraversalGroup], call [nextFocus] or /// [previousFocus] instead of calling `unfocus`. /// - /// {@tool dartpad --template=stateful_widget_material} + /// {@tool dartpad} /// This example shows the difference between the different [UnfocusDisposition] /// values for [unfocus]. /// diff --git a/packages/flutter/lib/src/widgets/focus_scope.dart b/packages/flutter/lib/src/widgets/focus_scope.dart index 1b794d971b..034f27dcf1 100644 --- a/packages/flutter/lib/src/widgets/focus_scope.dart +++ b/packages/flutter/lib/src/widgets/focus_scope.dart @@ -61,7 +61,7 @@ import 'inherited_notifier.dart'; /// the focus traversal order, call `Focus.of(context).nextFocus()`. To unfocus /// a widget, call `Focus.of(context).unfocus()`. /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// This example shows how to manage focus using the [Focus] and [FocusScope] /// widgets. See [FocusNode] for a similar example that doesn't use [Focus] or /// [FocusScope]. @@ -69,7 +69,7 @@ import 'inherited_notifier.dart'; /// ** See code in examples/api/lib/widgets/focus_scope/focus.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This example shows how to wrap another widget in a [Focus] widget to make it /// focusable. It wraps a [Container], and changes the container's color when it /// is set as the [FocusManager.primaryFocus]. @@ -81,7 +81,7 @@ import 'inherited_notifier.dart'; /// ** See code in examples/api/lib/widgets/focus_scope/focus.1.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This example shows how to focus a newly-created widget immediately after it /// is created. /// @@ -672,7 +672,7 @@ class _FocusState extends State { /// the focus traversal order, call `Focus.of(context).nextFocus()`. To unfocus /// a widget, call `Focus.of(context).unfocus()`. /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This example demonstrates using a [FocusScope] to restrict focus to a particular /// portion of the app. In this case, restricting focus to the visible part of a /// Stack. diff --git a/packages/flutter/lib/src/widgets/focus_traversal.dart b/packages/flutter/lib/src/widgets/focus_traversal.dart index 178b36e1d1..a1407568b3 100644 --- a/packages/flutter/lib/src/widgets/focus_traversal.dart +++ b/packages/flutter/lib/src/widgets/focus_traversal.dart @@ -1267,7 +1267,7 @@ class _OrderedFocusInfo { /// /// {@macro flutter.widgets.FocusOrder.comparable} /// -/// {@tool dartpad --template=stateless_widget_scaffold_center} +/// {@tool dartpad} /// This sample shows how to assign a traversal order to a widget. In the /// example, the focus order goes from bottom right (the "One" button) to top /// left (the "Six" button). @@ -1419,7 +1419,7 @@ class FocusTraversalOrder extends InheritedWidget { /// To prevent the members of the group from being focused, set the /// [descendantsAreFocusable] attribute to false. /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This sample shows three rows of buttons, each grouped by a /// [FocusTraversalGroup], each with different traversal order policies. Use tab /// traversal to see the order they are traversed in. The first row follows a diff --git a/packages/flutter/lib/src/widgets/form.dart b/packages/flutter/lib/src/widgets/form.dart index 39175b5ddd..27e2b54da6 100644 --- a/packages/flutter/lib/src/widgets/form.dart +++ b/packages/flutter/lib/src/widgets/form.dart @@ -18,7 +18,7 @@ import 'will_pop_scope.dart'; /// with a context whose ancestor is the [Form], or pass a [GlobalKey] to the /// [Form] constructor and call [GlobalKey.currentState]. /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// This example shows a [Form] with one [TextFormField] to enter an email /// address and an [ElevatedButton] to submit the form. A [GlobalKey] is used here /// to identify the [Form] and validate input. diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index 616e610ce6..3104e4eb9e 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -2331,7 +2331,7 @@ abstract class BuildContext { /// [RootRenderObjectElement.assignOwner] method on the root element of the /// widget tree. /// -/// {@tool dartpad --template=freeform} +/// {@tool dartpad} /// This example shows how to build an off-screen widget tree used to measure /// the layout size of the rendered tree. For some use cases, the simpler /// [Offstage] widget may be a better alternative to this approach. @@ -4371,7 +4371,7 @@ typedef ErrorWidgetBuilder = Widget Function(FlutterErrorDetails details); /// /// It is possible to override this widget. /// -/// {@tool dartpad --template=freeform} +/// {@tool dartpad} /// This example shows how to override the standard error widget builder in release /// mode, but use the standard one in debug mode. /// diff --git a/packages/flutter/lib/src/widgets/gesture_detector.dart b/packages/flutter/lib/src/widgets/gesture_detector.dart index 463f65b455..bbdbbdda1e 100644 --- a/packages/flutter/lib/src/widgets/gesture_detector.dart +++ b/packages/flutter/lib/src/widgets/gesture_detector.dart @@ -127,7 +127,7 @@ class GestureRecognizerFactoryWithHandlers extends /// effects. The [InkWell] class implements this effect and can be used in place /// of a [GestureDetector] for handling taps. /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This example contains a black light bulb wrapped in a [GestureDetector]. It /// turns the light bulb yellow when the "TURN LIGHT ON" button is tapped by /// setting the `_lights` field, and off again when "TURN LIGHT OFF" is tapped. @@ -135,7 +135,7 @@ class GestureRecognizerFactoryWithHandlers extends /// ** See code in examples/api/lib/widgets/gesture_detector/gesture_detector.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// This example uses a [Container] that wraps a [GestureDetector] widget which /// detects a tap. /// diff --git a/packages/flutter/lib/src/widgets/heroes.dart b/packages/flutter/lib/src/widgets/heroes.dart index 95c4897592..1f474fa92c 100644 --- a/packages/flutter/lib/src/widgets/heroes.dart +++ b/packages/flutter/lib/src/widgets/heroes.dart @@ -101,7 +101,7 @@ enum HeroFlightDirection { /// /// {@youtube 560 315 https://www.youtube.com/watch?v=Be9UH1kXFDw} /// -/// {@tool dartpad --template=stateless_widget_scaffold_center} +/// {@tool dartpad} /// This sample shows a [Hero] used within a [ListTile]. /// /// Tapping on the Hero-wrapped rectangle triggers a hero diff --git a/packages/flutter/lib/src/widgets/image.dart b/packages/flutter/lib/src/widgets/image.dart index 80d84bebb4..41726191af 100644 --- a/packages/flutter/lib/src/widgets/image.dart +++ b/packages/flutter/lib/src/widgets/image.dart @@ -756,7 +756,7 @@ class Image extends StatefulWidget { /// ``` /// {@endtemplate} /// - /// {@tool dartpad --template=stateless_widget_material} + /// {@tool dartpad} /// The following sample demonstrates how to use this builder to implement an /// image that fades in once it's been loaded. /// @@ -796,7 +796,7 @@ class Image extends StatefulWidget { /// /// {@macro flutter.widgets.Image.frameBuilder.chainedBuildersExample} /// - /// {@tool dartpad --template=stateless_widget_material} + /// {@tool dartpad} /// The following sample uses [loadingBuilder] to show a /// [CircularProgressIndicator] while an image loads over the network. /// @@ -816,7 +816,7 @@ class Image extends StatefulWidget { /// [FlutterError.onError]. If it is provided, the caller should either handle /// the exception by providing a replacement widget, or rethrow the exception. /// - /// {@tool dartpad --template=stateless_widget_scaffold_center} + /// {@tool dartpad} /// The following sample uses [errorBuilder] to show a '😢' in place of the /// image that fails to load, and prints the error to the console. /// diff --git a/packages/flutter/lib/src/widgets/implicit_animations.dart b/packages/flutter/lib/src/widgets/implicit_animations.dart index a16fc21386..de3923065e 100644 --- a/packages/flutter/lib/src/widgets/implicit_animations.dart +++ b/packages/flutter/lib/src/widgets/implicit_animations.dart @@ -575,7 +575,7 @@ abstract class AnimatedWidgetBaseState exten /// /// {@youtube 560 315 https://www.youtube.com/watch?v=yI-8QHpGIP4} /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// The following example (depicted above) transitions an AnimatedContainer /// between two states. It adjusts the `height`, `width`, `color`, and /// [alignment] properties when tapped. @@ -789,7 +789,7 @@ class _AnimatedContainerState extends AnimatedWidgetBaseState /// of [Curves.fastOutSlowIn]. /// {@animation 250 266 https://flutter.github.io/assets-for-api-docs/assets/widgets/animated_padding.mp4} /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// The following code implements the [AnimatedPadding] widget, using a [curve] of /// [Curves.easeInOut]. /// @@ -876,7 +876,7 @@ class _AnimatedPaddingState extends AnimatedWidgetBaseState { /// it also requires more development overhead as you have to manually manage /// the lifecycle of the underlying [AnimationController]. /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// The following code implements the [AnimatedAlign] widget, using a [curve] of /// [Curves.fastOutSlowIn]. /// @@ -1015,7 +1015,7 @@ class _AnimatedAlignState extends AnimatedWidgetBaseState { /// it also requires more development overhead as you have to manually manage /// the lifecycle of the underlying [AnimationController]. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// The following example transitions an AnimatedPositioned /// between two states. It adjusts the `height`, `width`, and /// [Positioned] properties when tapped. @@ -1562,7 +1562,7 @@ class _AnimatedRotationState extends ImplicitlyAnimatedWidgetState extends TransitionDelegate { /// [WidgetsApp] and [CupertinoTabView] widgets and do not need to be explicitly /// created or managed. /// -/// {@tool sample --template=freeform} +/// {@tool sample} /// The following example demonstrates how a nested [Navigator] can be used to /// present a standalone user registration journey. /// @@ -2039,7 +2039,7 @@ class Navigator extends StatefulWidget { /// /// {@macro flutter.widgets.Navigator.restorablePushNamed.returnValue} /// - /// {@tool dartpad --template=stateful_widget_material} + /// {@tool dartpad} /// Typical usage is as follows: /// /// ** See code in examples/api/lib/widgets/navigator/navigator.restorable_push.0.dart ** @@ -2118,7 +2118,7 @@ class Navigator extends StatefulWidget { /// /// {@macro flutter.widgets.Navigator.restorablePushNamed.returnValue} /// - /// {@tool dartpad --template=stateful_widget_material} + /// {@tool dartpad} /// Typical usage is as follows: /// /// ** See code in examples/api/lib/widgets/navigator/navigator.restorable_push_replacement.0.dart ** @@ -2203,7 +2203,7 @@ class Navigator extends StatefulWidget { /// /// {@macro flutter.widgets.Navigator.restorablePushNamed.returnValue} /// - /// {@tool dartpad --template=stateful_widget_material} + /// {@tool dartpad} /// Typical usage is as follows: /// /// ** See code in examples/api/lib/widgets/navigator/navigator.restorable_push_and_remove_until.0.dart ** @@ -4362,7 +4362,7 @@ class NavigatorState extends State with TickerProviderStateMixin, Res /// /// {@macro flutter.widgets.Navigator.restorablePushNamed.returnValue} /// - /// {@tool dartpad --template=stateful_widget_material} + /// {@tool dartpad} /// Typical usage is as follows: /// /// ** See code in examples/api/lib/widgets/navigator/navigator_state.restorable_push.0.dart ** @@ -4484,7 +4484,7 @@ class NavigatorState extends State with TickerProviderStateMixin, Res /// /// {@macro flutter.widgets.Navigator.restorablePushNamed.returnValue} /// - /// {@tool dartpad --template=stateful_widget_material} + /// {@tool dartpad} /// Typical usage is as follows: /// /// ** See code in examples/api/lib/widgets/navigator/navigator_state.restorable_push_replacement.0.dart ** @@ -4569,7 +4569,7 @@ class NavigatorState extends State with TickerProviderStateMixin, Res /// /// {@macro flutter.widgets.Navigator.restorablePushNamed.returnValue} /// - /// {@tool dartpad --template=stateful_widget_material} + /// {@tool dartpad} /// Typical usage is as follows: /// /// ** See code in examples/api/lib/widgets/navigator/navigator_state.restorable_push_and_remove_until.0.dart ** @@ -5466,7 +5466,7 @@ typedef RouteCompletionCallback = void Function(T result); /// When [present] has been called to add a route, it may only be called again /// after the previously added route has completed. /// -/// {@tool dartpad --template=freeform} +/// {@tool dartpad} /// This example uses a [RestorableRouteFuture] in the `_MyHomeState` to push a /// new `MyCounter` route and to retrieve its return value. /// diff --git a/packages/flutter/lib/src/widgets/nested_scroll_view.dart b/packages/flutter/lib/src/widgets/nested_scroll_view.dart index 277df791de..2c0b5cf2eb 100644 --- a/packages/flutter/lib/src/widgets/nested_scroll_view.dart +++ b/packages/flutter/lib/src/widgets/nested_scroll_view.dart @@ -55,7 +55,7 @@ typedef NestedScrollViewHeaderSliversBuilder = List Function(BuildContex /// (those inside the [TabBarView], hooking them together so that they appear, /// to the user, as one coherent scroll view. /// -/// {@tool sample --template=stateless_widget_material} +/// {@tool sample} /// This example shows a [NestedScrollView] whose header is the combination of a /// [TabBar] in a [SliverAppBar] and whose body is a [TabBarView]. It uses a /// [SliverOverlapAbsorber]/[SliverOverlapInjector] pair to make the inner lists @@ -110,7 +110,7 @@ typedef NestedScrollViewHeaderSliversBuilder = List Function(BuildContex /// configuration, the flexible space of the app bar will open and collapse, /// while the primary portion of the app bar remains pinned. /// -/// {@tool sample --template=stateless_widget_material} +/// {@tool sample} /// This simple example shows a [NestedScrollView] whose header contains a /// floating [SliverAppBar]. By using the [floatHeaderSlivers] property, the /// floating behavior is coordinated between the outer and inner [Scrollable]s, @@ -140,7 +140,7 @@ typedef NestedScrollViewHeaderSliversBuilder = List Function(BuildContex /// for the nested "inner" scroll view below to end up under the [SliverAppBar] /// even when the inner scroll view thinks it has not been scrolled. /// -/// {@tool sample --template=stateless_widget_material} +/// {@tool sample} /// This simple example shows a [NestedScrollView] whose header contains a /// snapping, floating [SliverAppBar]. _Without_ setting any additional flags, /// e.g [NestedScrollView.floatHeaderSlivers], the [SliverAppBar] will animate @@ -335,7 +335,7 @@ class NestedScrollView extends StatefulWidget { /// [NestedScrollView], you can get its [NestedScrollViewState] by supplying a /// `GlobalKey` to the [NestedScrollView.key] parameter). /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// [NestedScrollViewState] can be obtained using a [GlobalKey]. /// Using the following setup, you can access the inner scroll controller /// using `globalKey.currentState.innerController`. diff --git a/packages/flutter/lib/src/widgets/notification_listener.dart b/packages/flutter/lib/src/widgets/notification_listener.dart index 906f282d76..ed78d46d1e 100644 --- a/packages/flutter/lib/src/widgets/notification_listener.dart +++ b/packages/flutter/lib/src/widgets/notification_listener.dart @@ -28,7 +28,7 @@ typedef NotificationListenerCallback = bool Function(T n /// widgets with the appropriate type parameters that are ancestors of the given /// [BuildContext]. /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This example shows a [NotificationListener] widget /// that listens for [ScrollNotification] notifications. When a scroll /// event occurs in the [NestedScrollView], diff --git a/packages/flutter/lib/src/widgets/overflow_bar.dart b/packages/flutter/lib/src/widgets/overflow_bar.dart index 88d32859de..29866777ad 100644 --- a/packages/flutter/lib/src/widgets/overflow_bar.dart +++ b/packages/flutter/lib/src/widgets/overflow_bar.dart @@ -43,7 +43,7 @@ enum OverflowBarAlignment { /// If the layout overflows, then children's order within their /// column is specified by [overflowDirection] instead. /// -/// {@tool dartpad --template=stateless_widget_scaffold_center} +/// {@tool dartpad} /// This example defines a simple approximation of a dialog /// layout, where the layout of the dialog's action buttons are /// defined by an [OverflowBar]. The content is wrapped in a diff --git a/packages/flutter/lib/src/widgets/overscroll_indicator.dart b/packages/flutter/lib/src/widgets/overscroll_indicator.dart index d99e849624..b0c2e2522b 100644 --- a/packages/flutter/lib/src/widgets/overscroll_indicator.dart +++ b/packages/flutter/lib/src/widgets/overscroll_indicator.dart @@ -47,7 +47,7 @@ import 'transitions.dart'; /// [OverscrollIndicatorNotification.paintOffset] to the /// notification, or use a [NestedScrollView]. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This example demonstrates how to use a [NotificationListener] to manipulate /// the placement of a [GlowingOverscrollIndicator] when building a /// [CustomScrollView]. Drag the scrollable to see the bounds of the overscroll @@ -56,7 +56,7 @@ import 'transitions.dart'; /// ** See code in examples/api/lib/widgets/overscroll_indicator/glowing_overscroll_indicator.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This example demonstrates how to use a [NestedScrollView] to manipulate the /// placement of a [GlowingOverscrollIndicator] when building a /// [CustomScrollView]. Drag the scrollable to see the bounds of the overscroll diff --git a/packages/flutter/lib/src/widgets/page_storage.dart b/packages/flutter/lib/src/widgets/page_storage.dart index ce834747ae..78429fe574 100644 --- a/packages/flutter/lib/src/widgets/page_storage.dart +++ b/packages/flutter/lib/src/widgets/page_storage.dart @@ -136,7 +136,7 @@ class PageStorageBucket { /// you should give each of them unique [PageStorageKey]s, or set some of their /// `keepScrollOffset` false to prevent saving. /// -/// {@tool dartpad --template=freeform} +/// {@tool dartpad} /// This sample shows how to explicitly use a [PageStorage] to /// store the states of its children pages. Each page includes a scrollable /// list, whose position is preserved when switching between the tabs thanks to diff --git a/packages/flutter/lib/src/widgets/page_view.dart b/packages/flutter/lib/src/widgets/page_view.dart index 58a5c87af5..e6bbe784f7 100644 --- a/packages/flutter/lib/src/widgets/page_view.dart +++ b/packages/flutter/lib/src/widgets/page_view.dart @@ -596,7 +596,7 @@ const PageScrollPhysics _kPagePhysics = PageScrollPhysics(); /// /// {@youtube 560 315 https://www.youtube.com/watch?v=J1gE9xvph-A} /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// Here is an example of [PageView]. It creates a centered [Text] in each of the three pages /// which scroll horizontally. /// diff --git a/packages/flutter/lib/src/widgets/preferred_size.dart b/packages/flutter/lib/src/widgets/preferred_size.dart index 1f5594b112..fb1edf379e 100644 --- a/packages/flutter/lib/src/widgets/preferred_size.dart +++ b/packages/flutter/lib/src/widgets/preferred_size.dart @@ -45,7 +45,7 @@ abstract class PreferredSizeWidget implements Widget { /// Widgets like [AppBar] implement a [PreferredSizeWidget], so that this /// [PreferredSize] widget is not necessary for them. /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// This sample shows a custom widget, similar to an [AppBar], which uses a /// [PreferredSize] widget, with its height set to 80 logical pixels. /// Changing the [PreferredSize] can be used to change the height diff --git a/packages/flutter/lib/src/widgets/restoration.dart b/packages/flutter/lib/src/widgets/restoration.dart index 7fc141d5dc..3ff29c328f 100644 --- a/packages/flutter/lib/src/widgets/restoration.dart +++ b/packages/flutter/lib/src/widgets/restoration.dart @@ -598,108 +598,11 @@ abstract class RestorableProperty extends ChangeNotifier { /// [didUpdateRestorationId] must be called (unless the change already triggers /// a call to [didUpdateWidget]). /// -/// {@tool dartpad --template=freeform} +/// {@tool dartpad} /// This example demonstrates how to make a simple counter app restorable by /// using the [RestorationMixin] and a [RestorableInt]. /// -/// ```dart imports -/// import 'package:flutter/material.dart'; -/// ``` -/// -/// ```dart main -/// void main() => runApp(const RestorationExampleApp()); -/// ``` -/// -/// ```dart preamble -/// class RestorationExampleApp extends StatelessWidget { -/// const RestorationExampleApp({Key? key}) : super(key: key); -/// -/// @override -/// Widget build(BuildContext context) { -/// return const MaterialApp( -/// restorationScopeId: 'app', -/// title: 'Restorable Counter', -/// home: RestorableCounter(restorationId: 'counter'), -/// ); -/// } -/// } -/// ``` -/// -/// ```dart -/// class RestorableCounter extends StatefulWidget { -/// const RestorableCounter({Key? key, this.restorationId}) : super(key: key); -/// -/// final String? restorationId; -/// -/// @override -/// State createState() => _RestorableCounterState(); -/// } -/// -/// // The [State] object uses the [RestorationMixin] to make the current value -/// // of the counter restorable. -/// class _RestorableCounterState extends State with RestorationMixin { -/// // The current value of the counter is stored in a [RestorableProperty]. -/// // During state restoration it is automatically restored to its old value. -/// // If no restoration data is available to restore the counter from, it is -/// // initialized to the specified default value of zero. -/// final RestorableInt _counter = RestorableInt(0); -/// -/// // In this example, the restoration ID for the mixin is passed in through -/// // the [StatefulWidget]'s constructor. -/// @override -/// String? get restorationId => widget.restorationId; -/// -/// @override -/// void restoreState(RestorationBucket? oldBucket, bool initialRestore) { -/// // All restorable properties must be registered with the mixin. After -/// // registration, the counter either has its old value restored or is -/// // initialized to its default value. -/// registerForRestoration(_counter, 'count'); -/// } -/// -/// void _incrementCounter() { -/// setState(() { -/// // The current value of the property can be accessed and modified via -/// // the value getter and setter. -/// _counter.value++; -/// }); -/// } -/// -/// @override -/// void dispose() { -/// _counter.dispose(); -/// super.dispose(); -/// } -/// -/// @override -/// Widget build(BuildContext context) { -/// return Scaffold( -/// appBar: AppBar( -/// title: const Text('Restorable Counter'), -/// ), -/// body: Center( -/// child: Column( -/// mainAxisAlignment: MainAxisAlignment.center, -/// children: [ -/// const Text( -/// 'You have pushed the button this many times:', -/// ), -/// Text( -/// '${_counter.value}', -/// style: Theme.of(context).textTheme.headline4, -/// ), -/// ], -/// ), -/// ), -/// floatingActionButton: FloatingActionButton( -/// onPressed: _incrementCounter, -/// tooltip: 'Increment', -/// child: const Icon(Icons.add), -/// ), -/// ); -/// } -/// } -/// ``` +/// ** See code in examples/api/lib/widgets/restoration/restoration_mixin.0.dart ** /// {@end-tool} /// /// See also: diff --git a/packages/flutter/lib/src/widgets/restoration_properties.dart b/packages/flutter/lib/src/widgets/restoration_properties.dart index e4d3a7aeff..86755fb94f 100644 --- a/packages/flutter/lib/src/widgets/restoration_properties.dart +++ b/packages/flutter/lib/src/widgets/restoration_properties.dart @@ -19,7 +19,7 @@ import 'restoration.dart'; /// /// ## Using a RestorableValue /// -/// {@tool dartpad --template=stateful_widget_restoration} +/// {@tool dartpad} /// A [StatefulWidget] that has a restorable [int] property. /// /// ** See code in examples/api/lib/widgets/restoration_properties/restorable_value.0.dart ** diff --git a/packages/flutter/lib/src/widgets/routes.dart b/packages/flutter/lib/src/widgets/routes.dart index 8d9c00a2df..69ba3f6ea4 100644 --- a/packages/flutter/lib/src/widgets/routes.dart +++ b/packages/flutter/lib/src/widgets/routes.dart @@ -1985,7 +1985,7 @@ class RawDialogRoute extends PopupRoute { /// /// For more information about state restoration, see [RestorationManager]. /// -/// {@tool sample --template=stateless_widget_restoration_material} +/// {@tool sample} /// This sample demonstrates how to create a restorable dialog. This is /// accomplished by enabling state restoration by specifying /// [WidgetsApp.restorationScopeId] and using [Navigator.restorablePush] to diff --git a/packages/flutter/lib/src/widgets/scroll_position.dart b/packages/flutter/lib/src/widgets/scroll_position.dart index 0b785d1391..52f3aeb09a 100644 --- a/packages/flutter/lib/src/widgets/scroll_position.dart +++ b/packages/flutter/lib/src/widgets/scroll_position.dart @@ -989,7 +989,7 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics { /// so this is useful for listening to [ScrollMetrics] changes that are not /// caused by the user scrolling. /// -/// {@tool dartpad --template=freeform} +/// {@tool dartpad} /// This sample shows how a [ScrollMetricsNotification] is dispatched when /// the `windowSize` is changed. Press the floating action button to increase /// the scrollable window's size. diff --git a/packages/flutter/lib/src/widgets/scroll_view.dart b/packages/flutter/lib/src/widgets/scroll_view.dart index d123533a86..ad78e2b9ae 100644 --- a/packages/flutter/lib/src/widgets/scroll_view.dart +++ b/packages/flutter/lib/src/widgets/scroll_view.dart @@ -499,7 +499,7 @@ abstract class ScrollView extends StatelessWidget { /// ``` /// {@end-tool} /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// By default, if items are inserted at the "top" of a scrolling container like /// [ListView] or [CustomScrollView], the top item and all of the items below it /// are scrolled downwards. In some applications, it's preferable to have the diff --git a/packages/flutter/lib/src/widgets/scrollbar.dart b/packages/flutter/lib/src/widgets/scrollbar.dart index 26076e590f..921657dd87 100644 --- a/packages/flutter/lib/src/widgets/scrollbar.dart +++ b/packages/flutter/lib/src/widgets/scrollbar.dart @@ -750,7 +750,7 @@ class ScrollbarPainter extends ChangeNotifier implements CustomPainter { /// [Scrollable] in this case to prevent having multiple ScrollPositions /// attached to the PrimaryScrollController. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// This sample shows an app with two scrollables in the same route. Since by /// default, there is one [PrimaryScrollController] per route, and they both have a /// scroll direction of [Axis.vertical], they would both try to attach to that @@ -784,7 +784,7 @@ class ScrollbarPainter extends ChangeNotifier implements CustomPainter { /// * [DropdownButton] /// {@endtemplate} /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This sample shows a [RawScrollbar] that executes a fade animation as /// scrolling occurs. The RawScrollbar will fade into view as the user scrolls, /// and fade out when scrolling stops. The [GridView] uses the @@ -794,7 +794,7 @@ class ScrollbarPainter extends ChangeNotifier implements CustomPainter { /// ** See code in examples/api/lib/widgets/scrollbar/raw_scrollbar.1.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateful_widget_scaffold} +/// {@tool dartpad} /// When `isAlwaysShown` is true, the scrollbar thumb will remain visible without /// the fade animation. This requires that a [ScrollController] is provided to /// `controller` for both the [RawScrollbar] and the [GridView]. @@ -1001,26 +1001,11 @@ class RawScrollbar extends StatefulWidget { /// [OutlinedBorder] and fill itself with [thumbColor] (or grey if it /// is unspecified). /// - /// Here is an example of using a [StadiumBorder] for drawing the [shape] of the - /// thumb in a [RawScrollbar]: + /// {@tool dartpad} + /// This is an example of using a [StadiumBorder] for drawing the [shape] of the + /// thumb in a [RawScrollbar]. /// - /// {@tool dartpad --template=stateless_widget_material} - /// ```dart - /// Widget build(BuildContext context) { - /// return Scaffold( - /// body: RawScrollbar( - /// child: ListView( - /// children: List.generate(100, (int index) => Text((index * index).toString())), - /// physics: const BouncingScrollPhysics(), - /// ), - /// shape: const StadiumBorder(side: BorderSide(color: Colors.brown, width: 3.0)), - /// thickness: 15.0, - /// thumbColor: Colors.blue, - /// isAlwaysShown: true, - /// ), - /// ); - /// } - /// ``` + /// ** See code in examples/api/lib/widgets/scrollbar/raw_scrollbar.shape.0.dart ** /// {@end-tool} final OutlinedBorder? shape; diff --git a/packages/flutter/lib/src/widgets/shortcuts.dart b/packages/flutter/lib/src/widgets/shortcuts.dart index dce0ebff4c..7f1e637ec0 100644 --- a/packages/flutter/lib/src/widgets/shortcuts.dart +++ b/packages/flutter/lib/src/widgets/shortcuts.dart @@ -229,7 +229,7 @@ abstract class ShortcutActivator { /// considered without considering sides (e.g. control left and control right are /// considered the same). /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// In the following example, the counter is increased when the following key /// sequences are pressed: /// @@ -401,7 +401,7 @@ class SingleActivator with Diagnosticable implements ShortcutActivator { /// On each [RawKeyDownEvent] of the [trigger] key, this activator checks /// whether the specified modifier conditions are met. /// - /// {@tool dartpad --template=stateful_widget_scaffold_center} + /// {@tool dartpad} /// In the following example, the shortcut `Control + C` increases the counter: /// /// ** See code in examples/api/lib/widgets/shortcuts/single_activator.single_activator.0.dart ** @@ -540,7 +540,7 @@ class SingleActivator with Diagnosticable implements ShortcutActivator { /// results in a question mark, which is 'Shift+Slash' on a US keyboard, but /// 'Shift+Comma' on a French keyboard. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// In the following example, when a key combination results in a question mark, /// the counter is increased: /// @@ -739,7 +739,7 @@ class ShortcutManager extends ChangeNotifier with Diagnosticable { /// when invoking an [Action] via a keyboard key combination that maps to an /// [Intent]. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// Here, we will use the [Shortcuts] and [Actions] widgets to add and subtract /// from a counter. When the child widget has keyboard focus, and a user presses /// the keys that have been defined in [Shortcuts], the action that is bound @@ -751,7 +751,7 @@ class ShortcutManager extends ChangeNotifier with Diagnosticable { /// ** See code in examples/api/lib/widgets/shortcuts/shortcuts.0.dart ** /// {@end-tool} /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// This slightly more complicated, but more flexible, example creates a custom /// [Action] subclass to increment and decrement within a widget (a [Column]) /// that has keyboard focus. When the user presses the up and down arrow keys, diff --git a/packages/flutter/lib/src/widgets/single_child_scroll_view.dart b/packages/flutter/lib/src/widgets/single_child_scroll_view.dart index 6a4b1e452a..2b2e40ea74 100644 --- a/packages/flutter/lib/src/widgets/single_child_scroll_view.dart +++ b/packages/flutter/lib/src/widgets/single_child_scroll_view.dart @@ -85,7 +85,7 @@ import 'scrollable.dart'; /// with some remaining space to allocate as specified by its /// [Column.mainAxisAlignment] argument. /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// In this example, the children are spaced out equally, unless there's no more /// room, in which case they stack vertically and scroll. /// @@ -122,7 +122,7 @@ import 'scrollable.dart'; /// so that the intrinsic sizing algorithm can short-circuit the computation when it /// reaches those parts of the subtree. /// -/// {@tool dartpad --template=stateless_widget_material} +/// {@tool dartpad} /// In this example, the column becomes either as big as viewport, or as big as /// the contents, whichever is biggest. /// diff --git a/packages/flutter/lib/src/widgets/sliver_fill.dart b/packages/flutter/lib/src/widgets/sliver_fill.dart index e9ef99423c..66334100c5 100644 --- a/packages/flutter/lib/src/widgets/sliver_fill.dart +++ b/packages/flutter/lib/src/widgets/sliver_fill.dart @@ -202,7 +202,7 @@ class _RenderSliverFractionalPadding extends RenderSliverEdgeInsetsPadding { /// of space that has been scrolled beforehand has not exceeded the main axis /// extent of the viewport. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// In this sample the [SliverFillRemaining] sizes its [child] to fill the /// remaining extent of the viewport in both axes. The icon is centered in the /// sliver, and would be in any computed extent for the sliver. @@ -213,7 +213,7 @@ class _RenderSliverFractionalPadding extends RenderSliverEdgeInsetsPadding { /// [SliverFillRemaining] will defer to the size of its [child] if the /// child's size exceeds the remaining space in the viewport. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// In this sample the [SliverFillRemaining] defers to the size of its [child] /// because the child's extent exceeds that of the remaining extent of the /// viewport's main axis. @@ -224,7 +224,7 @@ class _RenderSliverFractionalPadding extends RenderSliverEdgeInsetsPadding { /// [SliverFillRemaining] will defer to the size of its [child] if the /// [SliverConstraints.precedingScrollExtent] exceeded the length of the viewport's main axis. /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// In this sample the [SliverFillRemaining] defers to the size of its [child] /// because the [SliverConstraints.precedingScrollExtent] has gone /// beyond that of the viewport's main axis. @@ -239,7 +239,7 @@ class _RenderSliverFractionalPadding extends RenderSliverEdgeInsetsPadding { /// /// {@animation 250 500 https://flutter.github.io/assets-for-api-docs/assets/widgets/sliver_fill_remaining_fill_overscroll.mp4} /// -/// {@tool sample --template=stateless_widget_scaffold} +/// {@tool sample} /// In this sample the [SliverFillRemaining]'s child stretches to fill the /// overscroll area when [fillOverscroll] is true. This sample also features a /// button that is pinned to the bottom of the sliver, regardless of size or diff --git a/packages/flutter/lib/src/widgets/table.dart b/packages/flutter/lib/src/widgets/table.dart index 88a4fe6f48..19199973de 100644 --- a/packages/flutter/lib/src/widgets/table.dart +++ b/packages/flutter/lib/src/widgets/table.dart @@ -81,7 +81,7 @@ class _TableElementRow { /// /// {@youtube 560 315 https://www.youtube.com/watch?v=_lbE0wsVZSw} /// -/// {@tool dartpad --template=stateless_widget_scaffold} +/// {@tool dartpad} /// This sample shows a `Table` with borders, multiple types of column widths and different vertical cell alignments. /// /// ** See code in examples/api/lib/widgets/table/table.0.dart ** diff --git a/packages/flutter/lib/src/widgets/transitions.dart b/packages/flutter/lib/src/widgets/transitions.dart index 7a5a0229b6..75742a191c 100644 --- a/packages/flutter/lib/src/widgets/transitions.dart +++ b/packages/flutter/lib/src/widgets/transitions.dart @@ -24,7 +24,7 @@ export 'package:flutter/rendering.dart' show RelativeRect; /// [AnimatedWidget] is most useful for widgets that are otherwise stateless. To /// use [AnimatedWidget], simply subclass it and implement the build function. /// -/// {@tool dartpad --template=stateful_widget_material_ticker} +/// {@tool dartpad} /// This code defines a widget called `Spinner` that spins a green square /// continually. It is built with an [AnimatedWidget]. /// @@ -150,7 +150,7 @@ class _AnimatedState extends State { /// animated by a [CurvedAnimation] set to [Curves.elasticIn]: /// {@animation 300 378 https://flutter.github.io/assets-for-api-docs/assets/widgets/slide_transition.mp4} /// -/// {@tool dartpad --template=stateful_widget_scaffold_center_freeform_state} +/// {@tool dartpad} /// The following code implements the [SlideTransition] as seen in the video /// above: /// @@ -230,7 +230,7 @@ class SlideTransition extends AnimatedWidget { /// animated by a [CurvedAnimation] set to [Curves.fastOutSlowIn]: /// {@animation 300 378 https://flutter.github.io/assets-for-api-docs/assets/widgets/scale_transition.mp4} /// -/// {@tool dartpad --template=stateful_widget_material_ticker} +/// {@tool dartpad} /// The following code implements the [ScaleTransition] as seen in the video /// above: /// @@ -299,7 +299,7 @@ class ScaleTransition extends AnimatedWidget { /// animated by a [CurvedAnimation] set to [Curves.elasticOut]: /// {@animation 300 378 https://flutter.github.io/assets-for-api-docs/assets/widgets/rotation_transition.mp4} /// -/// {@tool dartpad --template=stateful_widget_material_ticker} +/// {@tool dartpad} /// The following code implements the [RotationTransition] as seen in the video /// above: /// @@ -375,7 +375,7 @@ class RotationTransition extends AnimatedWidget { /// animated by a [CurvedAnimation] set to [Curves.fastOutSlowIn]: /// {@animation 300 378 https://flutter.github.io/assets-for-api-docs/assets/widgets/size_transition.mp4} /// -/// {@tool dartpad --template=stateful_widget_material_ticker} +/// {@tool dartpad} /// This code defines a widget that uses [SizeTransition] to change the size /// of [FlutterLogo] continually. It is built with a [Scaffold] /// where the internal widget has space to change its size. @@ -471,7 +471,7 @@ class SizeTransition extends AnimatedWidget { /// Here's an illustration of the [FadeTransition] widget, with it's [opacity] /// animated by a [CurvedAnimation] set to [Curves.fastOutSlowIn]: /// -/// {@tool dartpad --template=stateful_widget_material_ticker} +/// {@tool dartpad} /// The following code implements the [FadeTransition] using /// the Flutter logo: /// @@ -538,7 +538,7 @@ class FadeTransition extends SingleChildRenderObjectWidget { /// Animates the opacity of a sliver widget. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center_freeform_state} +/// {@tool dartpad} /// Creates a [CustomScrollView] with a [SliverFixedExtentList] that uses a /// [SliverFadeTransition] to fade the list in and out. /// @@ -636,7 +636,7 @@ class RelativeRectTween extends Tween { /// animated by a [CurvedAnimation] set to [Curves.elasticInOut]: /// {@animation 300 378 https://flutter.github.io/assets-for-api-docs/assets/widgets/positioned_transition.mp4} /// -/// {@tool dartpad --template=stateful_widget_material_ticker} +/// {@tool dartpad} /// The following code implements the [PositionedTransition] as seen in the video /// above: /// @@ -695,7 +695,7 @@ class PositionedTransition extends AnimatedWidget { /// animated by a [CurvedAnimation] set to [Curves.elasticInOut]: /// {@animation 300 378 https://flutter.github.io/assets-for-api-docs/assets/widgets/relative_positioned_transition.mp4} /// -/// {@tool dartpad --template=stateful_widget_material_ticker} +/// {@tool dartpad} /// The following code implements the [RelativePositionedTransition] as seen in the video /// above: /// @@ -769,7 +769,7 @@ class RelativePositionedTransition extends AnimatedWidget { /// [decoration] animated by a [CurvedAnimation] set to [Curves.decelerate]: /// {@animation 300 378 https://flutter.github.io/assets-for-api-docs/assets/widgets/decorated_box_transition.mp4} /// -/// {@tool dartpad --template=stateful_widget_material_ticker} +/// {@tool dartpad} /// The following code implements the [DecoratedBoxTransition] as seen in the video /// above: /// @@ -831,7 +831,7 @@ class DecoratedBoxTransition extends AnimatedWidget { /// /// {@animation 300 378 https://flutter.github.io/assets-for-api-docs/assets/widgets/align_transition.mp4} /// -/// {@tool dartpad --template=stateful_widget_material_ticker} +/// {@tool dartpad} /// The following code implements the [AlignTransition] as seen in the video /// above: /// @@ -895,7 +895,7 @@ class AlignTransition extends AnimatedWidget { /// Animated version of a [DefaultTextStyle] that animates the different properties /// of its [TextStyle]. /// -/// {@tool dartpad --template=stateful_widget_material_ticker} +/// {@tool dartpad} /// The following code implements the [DefaultTextStyleTransition] that shows /// a transition between thick blue font and thin red font. /// @@ -985,7 +985,7 @@ class DefaultTextStyleTransition extends AnimatedWidget { /// Using this pre-built child is entirely optional, but can improve /// performance significantly in some cases and is therefore a good practice. /// -/// {@tool dartpad --template=stateful_widget_material_ticker} +/// {@tool dartpad} /// This code defines a widget that spins a green square continually. It is /// built with an [AnimatedBuilder] and makes use of the [child] feature to /// avoid having to rebuild the [Container] each time. diff --git a/packages/flutter/lib/src/widgets/tween_animation_builder.dart b/packages/flutter/lib/src/widgets/tween_animation_builder.dart index 8e7b988e8c..481d260973 100644 --- a/packages/flutter/lib/src/widgets/tween_animation_builder.dart +++ b/packages/flutter/lib/src/widgets/tween_animation_builder.dart @@ -61,7 +61,7 @@ import 'value_listenable_builder.dart'; /// /// ## Example Code /// -/// {@tool dartpad --template=stateful_widget_scaffold_center} +/// {@tool dartpad} /// This example shows an [IconButton] that "zooms" in when the widget first /// builds (its size smoothly increases from 0 to 24) and whenever the button /// is pressed, it smoothly changes its size to the new target value of either diff --git a/packages/flutter/lib/src/widgets/will_pop_scope.dart b/packages/flutter/lib/src/widgets/will_pop_scope.dart index 3dd14b55e3..af5fb1bf06 100644 --- a/packages/flutter/lib/src/widgets/will_pop_scope.dart +++ b/packages/flutter/lib/src/widgets/will_pop_scope.dart @@ -29,7 +29,7 @@ import 'routes.dart'; /// ``` /// {@end-tool} /// -/// {@tool dartpad --template=stateful_widget_material} +/// {@tool dartpad} /// /// /// ** See code in examples/api/lib/widgets/will_pop_scope/will_pop_scope.1.dart **