diff --git a/diagrams/ui/article-hero-image.svg b/diagrams/ui/article-hero-image.svg index ac46e685e5c..dcf3f0546c5 100644 --- a/diagrams/ui/article-hero-image.svg +++ b/diagrams/ui/article-hero-image.svg @@ -1,259 +1,59 @@ - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Constraints go down.Sizes go up.Parent sets position. - - - - - - - - - - - - + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" viewBox="0 0 1920 1080" version="1.1" id="svg38" sodipodi:docname="article-hero-image.svg" width="1920" height="1080" inkscape:version="1.0 (4035a4f, 2020-05-01)" inkscape:export-filename="article-hero-image.png" inkscape:export-xdpi="96" inkscape:export-ydpi="96"> + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Constraints go down. + Sizes go up. + Parent sets position. + + + + + + + + + + + + + diff --git a/eleventy.config.ts b/eleventy.config.ts index 6e914589b45..89d6cddb135 100644 --- a/eleventy.config.ts +++ b/eleventy.config.ts @@ -2,15 +2,15 @@ // It configures the core 11ty behavior and registers // plugins and customization that live in `/src/_11ty`. +import { UserConfig } from '@11ty/eleventy'; import { registerFilters } from './src/_11ty/filters.js'; -import { registerShortcodes } from './src/_11ty/shortcodes.js'; -import { markdown } from './src/_11ty/plugins/markdown.js'; import { configureHighlighting } from './src/_11ty/plugins/highlight.js'; -import { UserConfig } from '@11ty/eleventy'; +import { markdown } from './src/_11ty/plugins/markdown.js'; +import { registerShortcodes } from './src/_11ty/shortcodes.js'; +import { EleventyRenderPlugin } from '@11ty/eleventy'; import swcHtml from '@swc/html'; import yaml from 'js-yaml'; -import { EleventyRenderPlugin } from '@11ty/eleventy'; import * as path from 'node:path'; import * as sass from 'sass'; diff --git a/examples/app-architecture/offline_first/lib/domain/model/user_profile.freezed.dart b/examples/app-architecture/offline_first/lib/domain/model/user_profile.freezed.dart index a17039e9278..4db21c01b78 100644 --- a/examples/app-architecture/offline_first/lib/domain/model/user_profile.freezed.dart +++ b/examples/app-architecture/offline_first/lib/domain/model/user_profile.freezed.dart @@ -80,7 +80,7 @@ as bool, class _UserProfile implements UserProfile { const _UserProfile({required this.name, required this.photoUrl, this.synchronized = false}); - + @override final String name; @override final String photoUrl; diff --git a/examples/app-architecture/offline_first/lib/ui/user_profile/user_profile_viewmodel.dart b/examples/app-architecture/offline_first/lib/ui/user_profile/user_profile_viewmodel.dart index 6a96c891bfe..735292928f2 100644 --- a/examples/app-architecture/offline_first/lib/ui/user_profile/user_profile_viewmodel.dart +++ b/examples/app-architecture/offline_first/lib/ui/user_profile/user_profile_viewmodel.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import '../../data/repositories/user_profile_repository.dart'; import '../../domain/model/user_profile.dart'; diff --git a/examples/app-architecture/todo_data_service/lib/business/model/todo.freezed.dart b/examples/app-architecture/todo_data_service/lib/business/model/todo.freezed.dart index 840b4b2a2ed..eb118455d8a 100644 --- a/examples/app-architecture/todo_data_service/lib/business/model/todo.freezed.dart +++ b/examples/app-architecture/todo_data_service/lib/business/model/todo.freezed.dart @@ -81,7 +81,7 @@ as String, class _Todo implements Todo { const _Todo({required this.id, required this.task}); - + /// The unique identifier of the Todo item. @override final int id; diff --git a/examples/app-architecture/todo_data_service/lib/ui/theme_config/widgets/theme_switch.dart b/examples/app-architecture/todo_data_service/lib/ui/theme_config/widgets/theme_switch.dart index 7ce7f1a9acc..7cf5052bd70 100644 --- a/examples/app-architecture/todo_data_service/lib/ui/theme_config/widgets/theme_switch.dart +++ b/examples/app-architecture/todo_data_service/lib/ui/theme_config/widgets/theme_switch.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import '../viewmodel/theme_switch_viewmodel.dart'; // #docregion ThemeSwitch diff --git a/examples/app-architecture/todo_data_service/lib/ui/todo_list/widgets/todo_list_screen.dart b/examples/app-architecture/todo_data_service/lib/ui/todo_list/widgets/todo_list_screen.dart index 5f83c386241..48e33f66f90 100644 --- a/examples/app-architecture/todo_data_service/lib/ui/todo_list/widgets/todo_list_screen.dart +++ b/examples/app-architecture/todo_data_service/lib/ui/todo_list/widgets/todo_list_screen.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import '../viewmodel/todo_list_viewmodel.dart'; class TodoListScreen extends StatefulWidget { diff --git a/examples/app-architecture/todo_data_service/pubspec.yaml b/examples/app-architecture/todo_data_service/pubspec.yaml index 7299cafd0be..f511df03f67 100644 --- a/examples/app-architecture/todo_data_service/pubspec.yaml +++ b/examples/app-architecture/todo_data_service/pubspec.yaml @@ -23,4 +23,4 @@ dev_dependencies: json_serializable: ^6.10.0 flutter: - uses-material-design: true \ No newline at end of file + uses-material-design: true diff --git a/examples/cookbook/effects/staggered_menu_animation/pubspec.yaml b/examples/cookbook/effects/staggered_menu_animation/pubspec.yaml index f3d1902d58d..d281cc9caf6 100644 --- a/examples/cookbook/effects/staggered_menu_animation/pubspec.yaml +++ b/examples/cookbook/effects/staggered_menu_animation/pubspec.yaml @@ -20,4 +20,3 @@ dev_dependencies: flutter: uses-material-design: true - diff --git a/examples/cookbook/networking/send_data/lib/create_album.dart b/examples/cookbook/networking/send_data/lib/create_album.dart index c0e1b9fc530..d960f8d8b04 100644 --- a/examples/cookbook/networking/send_data/lib/create_album.dart +++ b/examples/cookbook/networking/send_data/lib/create_album.dart @@ -1,5 +1,6 @@ // #docregion convert-import import 'dart:convert'; + // #enddocregion convert-import import 'package:http/http.dart' as http; diff --git a/examples/cookbook/plugins/picture_using_camera/lib/image_file.dart b/examples/cookbook/plugins/picture_using_camera/lib/image_file.dart index 89863e1dcf1..a68b80337bb 100644 --- a/examples/cookbook/plugins/picture_using_camera/lib/image_file.dart +++ b/examples/cookbook/plugins/picture_using_camera/lib/image_file.dart @@ -1,4 +1,5 @@ import 'dart:io'; + import 'package:flutter/material.dart'; class MyImage extends StatelessWidget { diff --git a/examples/cookbook/testing/widget/scrolling/test/widget_test.dart b/examples/cookbook/testing/widget/scrolling/test/widget_test.dart index dd81b135b20..25b39e687df 100644 --- a/examples/cookbook/testing/widget/scrolling/test/widget_test.dart +++ b/examples/cookbook/testing/widget/scrolling/test/widget_test.dart @@ -9,7 +9,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; - import 'package:scrolling/main.dart'; void main() { diff --git a/examples/data-and-backend/json/lib/extras.dart b/examples/data-and-backend/json/lib/extras.dart index 8b137891791..e69de29bb2d 100644 --- a/examples/data-and-backend/json/lib/extras.dart +++ b/examples/data-and-backend/json/lib/extras.dart @@ -1 +0,0 @@ - diff --git a/examples/data-and-backend/json/lib/nested/address.dart b/examples/data-and-backend/json/lib/nested/address.dart index 2469775f030..36a2a5941ef 100644 --- a/examples/data-and-backend/json/lib/nested/address.dart +++ b/examples/data-and-backend/json/lib/nested/address.dart @@ -1,4 +1,5 @@ import 'package:json_annotation/json_annotation.dart'; + part 'address.g.dart'; @JsonSerializable() diff --git a/examples/get-started/flutter-for/android_devs/analysis_options.yaml b/examples/get-started/flutter-for/android_devs/analysis_options.yaml index dd477a43b41..e2badd73ea0 100644 --- a/examples/get-started/flutter-for/android_devs/analysis_options.yaml +++ b/examples/get-started/flutter-for/android_devs/analysis_options.yaml @@ -1,3 +1 @@ include: ../../../analysis_options.yaml - - diff --git a/examples/get-started/flutter-for/android_devs/lib/network.dart b/examples/get-started/flutter-for/android_devs/lib/network.dart index f1ac27f219d..8ffa1588d3e 100644 --- a/examples/get-started/flutter-for/android_devs/lib/network.dart +++ b/examples/get-started/flutter-for/android_devs/lib/network.dart @@ -1,4 +1,5 @@ import 'dart:developer' as developer; + import 'package:http/http.dart' as http; Future loadData() async { diff --git a/examples/get-started/flutter-for/android_devs/lib/shared_prefs.dart b/examples/get-started/flutter-for/android_devs/lib/shared_prefs.dart index 2d1182bfdd2..aa1892393ff 100644 --- a/examples/get-started/flutter-for/android_devs/lib/shared_prefs.dart +++ b/examples/get-started/flutter-for/android_devs/lib/shared_prefs.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:flutter/material.dart'; +import 'package:flutter/material.dart'; import 'package:shared_preferences/shared_preferences.dart'; void main() { diff --git a/examples/get-started/flutter-for/ios_devs/lib/asset_bundle.dart b/examples/get-started/flutter-for/ios_devs/lib/asset_bundle.dart index d4c5f193189..883a5505bcf 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/asset_bundle.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/asset_bundle.dart @@ -1,4 +1,5 @@ import 'dart:async' show Future; + import 'package:flutter/services.dart' show rootBundle; Future loadAsset() async { diff --git a/examples/get-started/flutter-for/ios_devs/lib/events.dart b/examples/get-started/flutter-for/ios_devs/lib/events.dart index b5fe72a6c41..f74252bb787 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/events.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/events.dart @@ -1,4 +1,5 @@ import 'dart:developer' as developer; + import 'package:flutter/material.dart'; class MyButton extends StatelessWidget { diff --git a/examples/get-started/flutter-for/ios_devs/lib/list_item_tapped.dart b/examples/get-started/flutter-for/ios_devs/lib/list_item_tapped.dart index ea0b731a517..15bedc6e870 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/list_item_tapped.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/list_item_tapped.dart @@ -1,4 +1,5 @@ import 'dart:developer' as developer; + import 'package:flutter/material.dart'; void main() { diff --git a/examples/get-started/flutter-for/ios_devs/lib/shared_prefs.dart b/examples/get-started/flutter-for/ios_devs/lib/shared_prefs.dart index 2d1182bfdd2..aa1892393ff 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/shared_prefs.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/shared_prefs.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:flutter/material.dart'; +import 'package:flutter/material.dart'; import 'package:shared_preferences/shared_preferences.dart'; void main() { diff --git a/examples/get-started/flutter-for/react_native_devs/lib/examples.dart b/examples/get-started/flutter-for/react_native_devs/lib/examples.dart index 7068c6ba82f..3f00efd3f2e 100644 --- a/examples/get-started/flutter-for/react_native_devs/lib/examples.dart +++ b/examples/get-started/flutter-for/react_native_devs/lib/examples.dart @@ -3,6 +3,7 @@ import 'dart:convert'; // #docregion import-dart-io import 'dart:io'; + // #enddocregion import-dart-io // #docregion package-import diff --git a/examples/get-started/flutter-for/react_native_devs/lib/stateful.dart b/examples/get-started/flutter-for/react_native_devs/lib/stateful.dart index f59a41e62c5..e031153d283 100644 --- a/examples/get-started/flutter-for/react_native_devs/lib/stateful.dart +++ b/examples/get-started/flutter-for/react_native_devs/lib/stateful.dart @@ -1,4 +1,5 @@ import 'dart:async'; + import 'package:flutter/material.dart'; // #docregion stateful-widget diff --git a/examples/get-started/flutter-for/xamarin_devs/lib/dynamic_listview.dart b/examples/get-started/flutter-for/xamarin_devs/lib/dynamic_listview.dart index 6c60a735163..874674ac477 100644 --- a/examples/get-started/flutter-for/xamarin_devs/lib/dynamic_listview.dart +++ b/examples/get-started/flutter-for/xamarin_devs/lib/dynamic_listview.dart @@ -1,4 +1,5 @@ import 'dart:developer' as developer; + import 'package:flutter/material.dart'; void main() { diff --git a/examples/get-started/flutter-for/xamarin_devs/lib/gestures.dart b/examples/get-started/flutter-for/xamarin_devs/lib/gestures.dart index 26202fce0f7..0d6bbf0eef0 100644 --- a/examples/get-started/flutter-for/xamarin_devs/lib/gestures.dart +++ b/examples/get-started/flutter-for/xamarin_devs/lib/gestures.dart @@ -1,4 +1,5 @@ import 'dart:developer' as developer; + import 'package:flutter/material.dart'; class MyWidget extends StatelessWidget { diff --git a/examples/get-started/flutter-for/xamarin_devs/lib/listview_builder.dart b/examples/get-started/flutter-for/xamarin_devs/lib/listview_builder.dart index dc0ba4a0391..c19499b10b7 100644 --- a/examples/get-started/flutter-for/xamarin_devs/lib/listview_builder.dart +++ b/examples/get-started/flutter-for/xamarin_devs/lib/listview_builder.dart @@ -1,4 +1,5 @@ import 'dart:developer' as developer; + import 'package:flutter/material.dart'; void main() { diff --git a/examples/get-started/flutter-for/xamarin_devs/lib/listview_item_clicked.dart b/examples/get-started/flutter-for/xamarin_devs/lib/listview_item_clicked.dart index f6dc9f3b368..0519476e441 100644 --- a/examples/get-started/flutter-for/xamarin_devs/lib/listview_item_clicked.dart +++ b/examples/get-started/flutter-for/xamarin_devs/lib/listview_item_clicked.dart @@ -1,4 +1,5 @@ import 'dart:developer' as developer; + import 'package:flutter/material.dart'; void main() { diff --git a/examples/integration_test/integration_test/counter_test.dart b/examples/integration_test/integration_test/counter_test.dart index 5c65b5567f3..3cc94255082 100644 --- a/examples/integration_test/integration_test/counter_test.dart +++ b/examples/integration_test/integration_test/counter_test.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; - // The application under test. import 'package:integration_test_example/main.dart' as app; diff --git a/examples/integration_test_migration/.gitignore b/examples/integration_test_migration/.gitignore index ffb035428aa..8bec51b4f7f 100644 --- a/examples/integration_test_migration/.gitignore +++ b/examples/integration_test_migration/.gitignore @@ -48,4 +48,4 @@ app.*.map.json /android /ios /web -/linux \ No newline at end of file +/linux diff --git a/examples/internationalization/gen_l10n_example/lib/main.dart b/examples/internationalization/gen_l10n_example/lib/main.dart index bd302d08686..784906de6f9 100644 --- a/examples/internationalization/gen_l10n_example/lib/main.dart +++ b/examples/internationalization/gen_l10n_example/lib/main.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; - // #docregion localization-delegates-import import 'package:flutter_localizations/flutter_localizations.dart'; + // #enddocregion localization-delegates-import // #docregion app-localizations-import diff --git a/examples/internationalization/intl_example/test/widget_test.dart b/examples/internationalization/intl_example/test/widget_test.dart index f8bdf83cfd4..fd708d17e9b 100644 --- a/examples/internationalization/intl_example/test/widget_test.dart +++ b/examples/internationalization/intl_example/test/widget_test.dart @@ -1,5 +1,4 @@ import 'package:flutter_test/flutter_test.dart'; - import 'package:intl_example/main.dart'; void main() { diff --git a/examples/perf/deferred_components/lib/use_deferred_box.dart b/examples/perf/deferred_components/lib/use_deferred_box.dart index 5b4dfb381f8..6d9d9703e91 100644 --- a/examples/perf/deferred_components/lib/use_deferred_box.dart +++ b/examples/perf/deferred_components/lib/use_deferred_box.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'box.dart' deferred as box; class SomeWidget extends StatefulWidget { diff --git a/examples/platform_integration/platform_channels/lib/platform_channels.dart b/examples/platform_integration/platform_channels/lib/platform_channels.dart index c86180c57a7..06fd4caaafd 100644 --- a/examples/platform_integration/platform_channels/lib/platform_channels.dart +++ b/examples/platform_integration/platform_channels/lib/platform_channels.dart @@ -1,5 +1,6 @@ // #docregion import import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; // #enddocregion import diff --git a/examples/resources/architectural_overview/lib/ffi.dart b/examples/resources/architectural_overview/lib/ffi.dart index 5a27e40746a..8cd07ab030f 100644 --- a/examples/resources/architectural_overview/lib/ffi.dart +++ b/examples/resources/architectural_overview/lib/ffi.dart @@ -1,4 +1,5 @@ import 'dart:ffi'; + import 'package:ffi/ffi.dart'; // contains .toNativeUtf16() extension method typedef MessageBoxNative = diff --git a/examples/state_mgmt/simple/lib/main.dart b/examples/state_mgmt/simple/lib/main.dart index 44cec6ea860..d1f1d3091f3 100644 --- a/examples/state_mgmt/simple/lib/main.dart +++ b/examples/state_mgmt/simple/lib/main.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; + import 'src/passing_callbacks.dart' as callbacks; import 'src/performance.dart' as performance; import 'src/provider.dart'; diff --git a/examples/state_mgmt/simple/lib/src/passing_callbacks.dart b/examples/state_mgmt/simple/lib/src/passing_callbacks.dart index 1760e68873b..eeed93e410d 100644 --- a/examples/state_mgmt/simple/lib/src/passing_callbacks.dart +++ b/examples/state_mgmt/simple/lib/src/passing_callbacks.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import 'common.dart'; class CallbackPasser extends StatelessWidget { diff --git a/examples/state_mgmt/simple/lib/src/performance.dart b/examples/state_mgmt/simple/lib/src/performance.dart index 17a427ad997..c0a47a3e3f1 100644 --- a/examples/state_mgmt/simple/lib/src/performance.dart +++ b/examples/state_mgmt/simple/lib/src/performance.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; + import 'provider.dart'; class AnotherMonstrousWidget extends SomeExpensiveWidget { diff --git a/examples/state_mgmt/simple/lib/src/provider.dart b/examples/state_mgmt/simple/lib/src/provider.dart index 571e3361b83..7c65722aba5 100644 --- a/examples/state_mgmt/simple/lib/src/provider.dart +++ b/examples/state_mgmt/simple/lib/src/provider.dart @@ -2,6 +2,7 @@ import 'dart:collection'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; + import 'common.dart'; CartModel somehowGetMyCartModel(BuildContext context) { diff --git a/examples/tools/lib/hot-reload/after.dart b/examples/tools/lib/hot-reload/after.dart index 29a5755ef9e..a1829bce9d2 100644 --- a/examples/tools/lib/hot-reload/after.dart +++ b/examples/tools/lib/hot-reload/after.dart @@ -1,7 +1,6 @@ // ignore_for_file: avoid_print, prefer_const_declarations import 'package:flutter/material.dart'; - // #docregion main import 'package:flutter/widgets.dart'; diff --git a/examples/tools/pubspec.yaml b/examples/tools/pubspec.yaml index e53d395bd6e..7331d926b3a 100644 --- a/examples/tools/pubspec.yaml +++ b/examples/tools/pubspec.yaml @@ -20,4 +20,3 @@ dev_dependencies: flutter: uses-material-design: true - diff --git a/examples/ui/adaptive_app_demos/README.md b/examples/ui/adaptive_app_demos/README.md index bc86e1e5423..9109cfe5794 100644 --- a/examples/ui/adaptive_app_demos/README.md +++ b/examples/ui/adaptive_app_demos/README.md @@ -1,7 +1,7 @@ # adaptive_app_demos This project contains demo code for adaptive app development techniques from -https://github.com/gskinnerTeam/flutter-adaptive-demo. +https://github.com/gskinnerTeam/flutter-adaptive-demo. Additional example code in this project was moved from code snippets originally seen in @@ -9,4 +9,3 @@ code snippets originally seen in to ensure analysis in the flutter.dev CI pipeline. These snippets were intended to illustrate concepts and may therefore not be fully integrated/a functional part of the original demo code. - diff --git a/examples/ui/assets_and_images/assets/logo.svg b/examples/ui/assets_and_images/assets/logo.svg index d6b48e353be..519c58387c7 100755 --- a/examples/ui/assets_and_images/assets/logo.svg +++ b/examples/ui/assets_and_images/assets/logo.svg @@ -1,87 +1,89 @@ - - + - - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + - - - - - - - - - + + + + - - - - - - - - + + + + - - - - + + + + + - - - - - - - - - + + + + + + - - - - - + + + - + diff --git a/examples/visual_debugging/lib/highlight_repaints.dart b/examples/visual_debugging/lib/highlight_repaints.dart index 2ede3efaa3e..d111fecf8e8 100644 --- a/examples/visual_debugging/lib/highlight_repaints.dart +++ b/examples/visual_debugging/lib/highlight_repaints.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; - // #docregion toggle import 'package:flutter/rendering.dart'; diff --git a/prompts/llmstxt_instructions.md b/prompts/llmstxt_instructions.md index 9bfc40678ed..e0df2c861b1 100644 --- a/prompts/llmstxt_instructions.md +++ b/prompts/llmstxt_instructions.md @@ -60,4 +60,4 @@ If I encounter an error while performing an operation (for example, a tool fails --- -By following these instructions, I will help keep the `llms.txt` file accurate and up-to-date. \ No newline at end of file +By following these instructions, I will help keep the `llms.txt` file accurate and up-to-date. diff --git a/src/_11ty/filters.ts b/src/_11ty/filters.ts index 280c554b95c..7c968f68380 100644 --- a/src/_11ty/filters.ts +++ b/src/_11ty/filters.ts @@ -1,10 +1,10 @@ -import { getPageInfo } from './utils/get-page-info.js'; -import { slugify } from "./utils/slugify.js"; +import { UserConfig } from '@11ty/eleventy'; import { fromHtml } from 'hast-util-from-html'; import { selectAll } from 'hast-util-select'; import { toText } from 'hast-util-to-text'; import { escapeHtml } from 'markdown-it/lib/common/utils.mjs'; -import { UserConfig } from '@11ty/eleventy'; +import { getPageInfo } from './utils/get-page-info.js'; +import { slugify } from "./utils/slugify.js"; export function registerFilters(eleventyConfig: UserConfig): void { eleventyConfig.addFilter('childPagesOf', function (pages: any[], pageUrl: string) { @@ -59,8 +59,8 @@ function _startsWith(content: string, prefix: string): boolean { function _camelCaseBreaker(stringToBreak: string): string { // Only consider non-empty text. if (!stringToBreak - || typeof stringToBreak !== 'string' - || stringToBreak.length === 0) { + || typeof stringToBreak !== 'string' + || stringToBreak.length === 0) { return stringToBreak; } @@ -69,7 +69,7 @@ function _camelCaseBreaker(stringToBreak: string): string { // Replace all capital letters in the rest of the string with + letter. const processedRest = - restOfString.replace(/([A-Z])/g, '$&'); + restOfString.replace(/([A-Z])/g, '$&'); return firstCharacter + processedRest; } @@ -187,13 +187,13 @@ function _generateToc(contents: string) { // TODO(parlough): Speed this up. // Perhaps do the processing before HTML rendering? // Maybe shouldn't be a filter. - const dom = fromHtml(contents, {fragment: true}); + const dom = fromHtml(contents, { fragment: true }); const headers = selectAll('h2, h3', dom); if (headers.length < 1) { // If there's only one header, there's no point of a TOC. return null; } - let currentH2: {text: string, id: string, children: {text: string, id: string}[]} | null = null; + let currentH2: { text: string, id: string, children: { text: string, id: string }[] } | null = null; const builtToc = []; let count = 0; for (const header of headers) { @@ -234,7 +234,7 @@ function _generateToc(contents: string) { }; } -function _breadcrumbsForPage(page: any): {title: string, url: string}[] { +function _breadcrumbsForPage(page: any): { title: string, url: string }[] { const breadcrumbs = []; // Retrieve the liquid data for this page. @@ -242,8 +242,8 @@ function _breadcrumbsForPage(page: any): {title: string, url: string}[] { while (page) { const urlSegments = (page.url as string) - .split('/') - .filter((segment) => segment.length > 0); + .split('/') + .filter((segment) => segment.length > 0); breadcrumbs.push({ title: data['breadcrumb'] ?? data['shortTitle'] ?? data['short-title'] ?? data.title, diff --git a/src/_11ty/plugins/highlight.ts b/src/_11ty/plugins/highlight.ts index 7c537d39f66..ae69fcfd674 100644 --- a/src/_11ty/plugins/highlight.ts +++ b/src/_11ty/plugins/highlight.ts @@ -1,8 +1,8 @@ +import * as hast from 'hast'; +import MarkdownIt from 'markdown-it'; import { getSingletonHighlighter, Highlighter } from 'shiki'; import dashDarkTheme from '../syntax/dark-dark.js'; import dashLightTheme from '../syntax/dash-light.js'; -import MarkdownIt from 'markdown-it'; -import * as hast from 'hast'; const _terminalLanguages = { 'console': '$', @@ -157,12 +157,12 @@ function _highlight( // Find the spans enclosed in `[!` and `!]` that we should mark // and remove them from the text. - const {updatedText, linesToMarkedRanges} = - noHighlight ? { - updatedText: content, - linesToMarkedRanges: {}, - } : - _findMarkedTextAndUpdate(content); + const { updatedText, linesToMarkedRanges } = + noHighlight ? { + updatedText: content, + linesToMarkedRanges: {}, + } : + _findMarkedTextAndUpdate(content); // Update the content with the markers removed and // with any extra whitespace trimmed off the end. @@ -314,8 +314,8 @@ const _attributesPattern = /([^\s=]+)(?:="([^"]*)"|=(\S+))?/g; * @param attributeString The string containing configuration. * @return The parsed attributes. */ -function _parseAttributes(attributeString: string): {[index: string]: string | null} { - const attributes: {[index: string]: string | null} = {}; +function _parseAttributes(attributeString: string): { [index: string]: string | null } { + const attributes: { [index: string]: string | null } = {}; if (attributeString === '') return attributes; let match: RegExpExecArray | null; @@ -377,7 +377,7 @@ function _parseNumbersAndRanges(input: string): Set { */ function _wrapMarkedText( spans: hast.ElementContent[], - ranges: {startIndex: number, endIndex: number}[], + ranges: { startIndex: number, endIndex: number }[], ): hast.Element[] { /** * The current index in the text across all spans. @@ -563,7 +563,7 @@ function _findMarkedTextAndUpdate(text: string): { } { const lines = text.split('\n'); - const linesToMarkedRanges: {[index: number]: {startIndex: number, endIndex: number}[]} = {}; + const linesToMarkedRanges: { [index: number]: { startIndex: number, endIndex: number }[] } = {}; const textWithMarksRemoved: string[] = []; for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) { @@ -578,7 +578,7 @@ function _findMarkedTextAndUpdate(text: string): { /** * The ranges of marked text in the current line. */ - let markedRanges: {startIndex: number, endIndex: number}[] = []; + let markedRanges: { startIndex: number, endIndex: number }[] = []; while (currentIndexInLine < line.length) { const startIndex = line.indexOf('[!', currentIndexInLine); @@ -591,7 +591,7 @@ function _findMarkedTextAndUpdate(text: string): { const endIndex = line.indexOf('!]', startIndex); if (endIndex === -1) { - throw new Error(`Invalid syntax in line ${lineIndex + 1}. + throw new Error(`Invalid syntax in line ${lineIndex + 1}. An opening marker was found, but no closing marker was found.`); } diff --git a/src/_11ty/plugins/markdown.ts b/src/_11ty/plugins/markdown.ts index 6e8e6b8c4ed..a077d319116 100644 --- a/src/_11ty/plugins/markdown.ts +++ b/src/_11ty/plugins/markdown.ts @@ -1,9 +1,9 @@ import MarkdownIt from 'markdown-it'; +import markdownItAnchor from 'markdown-it-anchor'; +import markdownItAttrs from 'markdown-it-attrs'; import markdownItContainer from 'markdown-it-container'; import markdownItDefinitionList from 'markdown-it-deflist'; import markdownItFootnote from 'markdown-it-footnote'; -import markdownItAttrs from 'markdown-it-attrs'; -import markdownItAnchor from 'markdown-it-anchor'; import { slugify } from '../utils/slugify.js'; export const markdown = (() => { diff --git a/src/_11ty/shortcodes.ts b/src/_11ty/shortcodes.ts index fafa88e1c00..e9d2b803a01 100644 --- a/src/_11ty/shortcodes.ts +++ b/src/_11ty/shortcodes.ts @@ -1,9 +1,9 @@ -import {UserConfig} from '@11ty/eleventy'; -import {slugify} from './utils/slugify.js'; -import {fromHtml} from 'hast-util-from-html'; -import {selectAll} from 'hast-util-select'; -import {toHtml} from 'hast-util-to-html'; -import {escapeHtml} from 'markdown-it/lib/common/utils.mjs'; +import { UserConfig } from '@11ty/eleventy'; +import { fromHtml } from 'hast-util-from-html'; +import { selectAll } from 'hast-util-select'; +import { toHtml } from 'hast-util-to-html'; +import { escapeHtml } from 'markdown-it/lib/common/utils.mjs'; +import { slugify } from './utils/slugify.js'; export function registerShortcodes(eleventyConfig: UserConfig): void { _setupTabs(eleventyConfig); diff --git a/src/_data/architectureRecommendations.yml b/src/_data/architectureRecommendations.yml index e7659902cc6..e38dd705985 100644 --- a/src/_data/architectureRecommendations.yml +++ b/src/_data/architectureRecommendations.yml @@ -4,21 +4,21 @@ recommendations: - recommendation: Use clearly defined data and UI layers. description: | - Separation of concerns is the most important architectural principle. + Separation of concerns is the most important architectural principle. The data layer exposes application data to the rest of the app, and contains most of the business logic in your application. The UI layer displays application data and listens for user events from users. The UI layer contains separate classes for UI logic and widgets. confidence: strong - recommendation: Use the repository pattern in the data layer. description: | - The repository pattern is a software design pattern that isolates the data access logic from the rest of the application. + The repository pattern is a software design pattern that isolates the data access logic from the rest of the application. It creates an abstraction layer between the application's business logic and the underlying data storage mechanisms (databases, APIs, file systems, etc.). In practice, this means creating Repository classes and Service classes. confidence: strong - recommendation: Use ViewModels and Views in the UI layer. (MVVM) description: | - Separation of concerns is the most important architectural principle. + Separation of concerns is the most important architectural principle. This particular separation makes your code much less error prone because your widgets remain "dumb". confidence: strong @@ -41,8 +41,8 @@ - recommendation: Use a domain layer. description: | - A domain layer is only needed if your application has exceeding complex logic that crowds your ViewModels, - or if you find yourself repeating logic in ViewModels. + A domain layer is only needed if your application has exceeding complex logic that crowds your ViewModels, + or if you find yourself repeating logic in ViewModels. In very large apps, use-cases are useful, but in most apps they add unnecessary overhead. confidence: conditional confidence-description: | @@ -55,27 +55,27 @@ recommendations: - recommendation: Use unidirectional data flow. description: | - Data updates should only flow from the data layer to the UI layer. + Data updates should only flow from the data layer to the UI layer. Interactions in the UI layer are sent to the data layer where they're processed. confidence: strong - recommendation: Use `Commands` to handle events from user interaction. description: | - Commands prevent rendering errors in your app, and standardize how the UI layer sends events to the data layer. + Commands prevent rendering errors in your app, and standardize how the UI layer sends events to the data layer. Read about commands in the [architecture case study][]. confidence: recommend - recommendation: Use immutable data models. description: | - Immutable data is crucial in ensuring that any necessary changes occur only in the proper place, usually the data or domain layer. - Because immutable objects can't be modified after creation, you must create a new instance to reflect changes. + Immutable data is crucial in ensuring that any necessary changes occur only in the proper place, usually the data or domain layer. + Because immutable objects can't be modified after creation, you must create a new instance to reflect changes. This process prevents accidental updates in the UI layer and supports a clear, unidirectional data flow. confidence: strong - recommendation: Use freezed or built_value to generate immutable data models. description: | - You can use packages to help generate useful functionality in your data models, [freezed][] or [built_value][]. - These can generate common model methods like JSON ser/des, deep equality checking and copy methods. + You can use packages to help generate useful functionality in your data models, [freezed][] or [built_value][]. + These can generate common model methods like JSON ser/des, deep equality checking and copy methods. These code generation packages can add significant build time to your applications if you have a lot of models. confidence: recommend @@ -92,43 +92,43 @@ - recommendation: Use dependency injection. description: | - Dependency injection prevents your app from having globally accessible objects, which makes your code less error prone. + Dependency injection prevents your app from having globally accessible objects, which makes your code less error prone. We recommend you use the [provider](https://pub.dev/packages/provider) package to handle dependency injection. confidence: strong - recommendation: Use [go_router](https://pub.dev/packages/go_router) for navigation. description: | - Go_router is the preferred way to write 90% of Flutter applications. - There are some specific use-cases that go_router doesn't solve, + Go_router is the preferred way to write 90% of Flutter applications. + There are some specific use-cases that go_router doesn't solve, in which case you can use the [Flutter Navigator API][] directly or try other packages found on [pub.dev][]. confidence: recommend - recommendation: Use standardized naming conventions for classes, files and directories. description: | - We recommend naming classes for the architectural component they represent. + We recommend naming classes for the architectural component they represent. For example, you may have the following classes: - + * HomeViewModel * HomeScreen * UserRepository * ClientApiService - - For clarity, we do not recommend using names that can be confused with objects from the Flutter SDK. - For example, you should put your shared widgets in a directory called `ui/core/`, + + For clarity, we do not recommend using names that can be confused with objects from the Flutter SDK. + For example, you should put your shared widgets in a directory called `ui/core/`, rather than a directory called `/widgets`. confidence: recommend - recommendation: Use abstract repository classes description: | - Repository classes are the sources of truth for all data in your app, - and facilitate communication with external APIs. - Creating abstract repository classes allows you to create different implementations, + Repository classes are the sources of truth for all data in your app, + and facilitate communication with external APIs. + Creating abstract repository classes allows you to create different implementations, which can be used for different app environments, such as "development" and "staging". confidence: strong - category: Testing description: | - Good testing practices makes your app flexible. + Good testing practices makes your app flexible. It also makes it straightforward and low risk to add new logic and new UI. recommendations: @@ -140,7 +140,7 @@ - recommendation: Make fakes for testing (and write code that takes advantage of fakes.) description: | - Fakes aren't concerned with the inner workings of any given method as much - as they're concerned with inputs and outputs. If you have this in mind while writing application code, + Fakes aren't concerned with the inner workings of any given method as much + as they're concerned with inputs and outputs. If you have this in mind while writing application code, you're forced to write modular, lightweight functions and classes with well defined inputs and outputs. confidence: strong diff --git a/src/_data/learning-resources-index/codelabs.yml b/src/_data/learning-resources-index/codelabs.yml index 94678fc901d..f6504426ab5 100644 --- a/src/_data/learning-resources-index/codelabs.yml +++ b/src/_data/learning-resources-index/codelabs.yml @@ -107,7 +107,7 @@ - name: Animations in Flutter description: | Learn how to build animated effects in Flutter. You'll learn how to build - implicit and explicit animations, and customize + implicit and explicit animations, and customize navigation transition animations the animations package and predictive back on Android. tags: @@ -131,7 +131,7 @@ - name: How to debug layout issues with the Flutter Inspector description: | - Step-by-step instructions on how to debug + Step-by-step instructions on how to debug common layout problems using the Flutter Inspector and Layout Explorer. tags: @@ -425,7 +425,7 @@ - name: Write a Flutter desktop application description: | Build a Flutter desktop app (Windows, Linux, or macOS) - that accesses GitHub APIs, and + that accesses GitHub APIs, and create and use plugins to interact with native APIs and desktop applications. tags: - desktop @@ -435,4 +435,4 @@ type: codelab link: label: Google Codelab - url: https://codelabs.developers.google.com/codelabs/flutter-github-client \ No newline at end of file + url: https://codelabs.developers.google.com/codelabs/flutter-github-client diff --git a/src/_data/learning-resources-index/quickstarts_dart.yml b/src/_data/learning-resources-index/quickstarts_dart.yml index 5ec885850bb..88a058aa7eb 100644 --- a/src/_data/learning-resources-index/quickstarts_dart.yml +++ b/src/_data/learning-resources-index/quickstarts_dart.yml @@ -66,4 +66,4 @@ type: quickstart link: url: https://github.com/dart-lang/samples/tree/main/server - label: Dart Github \ No newline at end of file + label: Dart Github diff --git a/src/_data/learning-resources-index/quickstarts_flutter.yml b/src/_data/learning-resources-index/quickstarts_flutter.yml index 5e7af8d438d..bc10d3d310d 100644 --- a/src/_data/learning-resources-index/quickstarts_flutter.yml +++ b/src/_data/learning-resources-index/quickstarts_flutter.yml @@ -24,7 +24,7 @@ link: url: https://github.com/flutter/samples/tree/main/code_sharing label: Flutter Github - + - name: Context menus description: This sample shows how to create and customize cross-platform context menus, such as the text selection toolbar on mobile or the right click menu on desktop. tags: diff --git a/src/_data/mirrors.yml b/src/_data/mirrors.yml index bb5e003ebd3..8e1869628de 100644 --- a/src/_data/mirrors.yml +++ b/src/_data/mirrors.yml @@ -19,4 +19,3 @@ flutterstorage: 'https://mirrors.tuna.tsinghua.edu.cn/flutter' issues: 'https://github.com/tuna/issues' group: https://tuna.moe - diff --git a/src/_includes/banner.html b/src/_includes/banner.html index 43962ea3bd9..5bee21012d1 100644 --- a/src/_includes/banner.html +++ b/src/_includes/banner.html @@ -1,2 +1,4 @@ -Flutter 3.35 has landed! Get ready for a performance boost and stateful hot reload on the web. Learn more
-Help improve Flutter! Take our Q4 survey
+Flutter 3.35 has landed! Get ready for a performance boost and stateful hot reload on the web. Learn more
+Help improve Flutter! Take our Q4 + survey
diff --git a/src/_includes/breadcrumbs.html b/src/_includes/breadcrumbs.html index ab55161cf6d..cc3d7156199 100644 --- a/src/_includes/breadcrumbs.html +++ b/src/_includes/breadcrumbs.html @@ -14,9 +14,8 @@