diff --git a/.gitattributes b/.gitattributes index 2554128e82..6c1cce5559 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,5 @@ *.html linguist-detectable=false *.html linguist-documentation=false + +# Allow dart files in examples/ to be detectable +examples/**/*.dart -linguist-documentation diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index efc51bbfd7..16f65204d2 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,8 @@ -**IMPORTANT:** Due to work on the docs.flutter.dev infrastructure, this repo is **not accepting pull requests**. +_Description of what this PR is changing or adding, and why:_ -Instead of creating a PR, please file an issue (https://github.com/flutter/website/issues/new/choose) about the needed change. +_Issues fixed by this PR (if any):_ -We expect to start accepting PRs again the week of January 24th. \ No newline at end of file +## Presubmit checklist +- [ ] This PR doesn’t contain automatically generated corrections (Grammarly or similar). +- [ ] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style) — for example, it doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person). +- [ ] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/master/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer. diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 2fa234b211..beffad8650 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'javascript', 'python', 'ruby' ] + language: [ 'javascript', 'ruby' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://git.io/codeql-language-support @@ -33,7 +33,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 + uses: github/codeql-action/init@a34ca99b4610d924e04c68db79e503e1f79f9f02 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -44,7 +44,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 + uses: github/codeql-action/autobuild@a34ca99b4610d924e04c68db79e503e1f79f9f02 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -58,4 +58,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 + uses: github/codeql-action/analyze@a34ca99b4610d924e04c68db79e503e1f79f9f02 diff --git a/.github/workflows/link-validate.yml b/.github/workflows/link-check.yml similarity index 56% rename from .github/workflows/link-validate.yml rename to .github/workflows/link-check.yml index 8b3e971faa..7e47aa08fc 100644 --- a/.github/workflows/link-validate.yml +++ b/.github/workflows/link-check.yml @@ -1,4 +1,4 @@ -name: Validate link references in built HTML +name: Check links and link references on: push: @@ -18,9 +18,5 @@ jobs: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c with: submodules: "recursive" - - name: Build - run: make build - - uses: actions/setup-python@5ccb29d8773c3f3f653e1705f474dfaa8a06a912 - with: - python-version: "3.x" - - run: python tool/check_link_references.py + - name: Build and check links + run: make build # Runs tool/check-links.sh as part of build diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index 3e4f878483..23135cf9ae 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -50,6 +50,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 + uses: github/codeql-action/upload-sarif@a34ca99b4610d924e04c68db79e503e1f79f9f02 with: sarif_file: results.sarif diff --git a/Dockerfile b/Dockerfile index baf98daba7..a06f547bb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,16 @@ -FROM ruby:3.1.3-buster@sha256:0c11f1c83646da663bbf0be421d6e3536c49b7d792d2d7d5dcbe31db65a7fe09 AS base +FROM ruby:3.2-0-slim-bullseye@sha256:8fa9d24fc80b48ba9dd2223b4e8c8ffaa2fbc4d5f63e5f8028e5d047a3aa7b55 AS base ENV TZ=US/Pacific RUN apt-get update && apt-get install -yq --no-install-recommends \ + apt-transport-https \ build-essential \ + ca-certificates \ + curl \ diffutils \ git \ lsof \ + make \ + unzip \ vim-nox \ xdg-user-dirs \ && rm -rf /var/lib/apt/lists/* diff --git a/Gemfile b/Gemfile index 8c36f1c404..f6957af324 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,7 @@ source 'https://rubygems.org' -gem 'jekyll', '4.3.1' +gem 'jekyll', '4.3.2' +gem 'jekyll-sass-converter', '~> 2.2.0' gem 'webrick' # Used for custom _plugins @@ -9,5 +10,5 @@ gem 'liquid-tag-parser', '~> 2.0.2' group :jekyll_plugins do gem 'jekyll-include-cache', '~> 0.2.1' - gem 'jekyll-toc', '~> 0.17.1' + gem 'jekyll-toc', '~> 0.18.0' end diff --git a/Gemfile.lock b/Gemfile.lock index 2936120ad2..f83d827abd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - activesupport (7.0.4) + activesupport (7.0.4.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -21,7 +21,7 @@ GEM http_parser.rb (0.8.0) i18n (1.12.0) concurrent-ruby (~> 1.0) - jekyll (4.3.1) + jekyll (4.3.2) addressable (~> 2.4) colorator (~> 1.0) em-websocket (~> 0.5) @@ -41,41 +41,41 @@ GEM jekyll (>= 3.7, < 5.0) jekyll-sass-converter (2.2.0) sassc (> 2.0.1, < 3.0) - jekyll-toc (0.17.1) + jekyll-toc (0.18.0) jekyll (>= 3.9) - nokogiri (~> 1.11) + nokogiri (~> 1.12) jekyll-watch (2.2.1) listen (~> 3.0) kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - liquid (4.0.3) + liquid (4.0.4) liquid-tag-parser (2.0.2) extras (~> 0.3) liquid (>= 3.0, < 5.0) - listen (3.7.1) + listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.4.0) - mini_portile2 (2.8.0) - minitest (5.16.3) - nokogiri (1.13.10) + mini_portile2 (2.8.1) + minitest (5.17.0) + nokogiri (1.14.0) mini_portile2 (~> 2.8.0) racc (~> 1.4) - nokogiri (1.13.10-aarch64-linux) + nokogiri (1.14.0-aarch64-linux) racc (~> 1.4) - nokogiri (1.13.10-x86_64-linux) + nokogiri (1.14.0-x86_64-linux) racc (~> 1.4) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (5.0.0) - racc (1.6.1) + public_suffix (5.0.1) + racc (1.6.2) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) rexml (3.2.5) - rouge (4.0.0) + rouge (4.0.1) safe_yaml (1.0.5) sassc (2.4.0) ffi (~> 1.9) @@ -83,7 +83,7 @@ GEM unicode-display_width (>= 1.1.1, < 3) tzinfo (2.0.5) concurrent-ruby (~> 1.0) - unicode-display_width (2.3.0) + unicode-display_width (2.4.2) webrick (1.7.0) PLATFORMS @@ -93,11 +93,12 @@ PLATFORMS DEPENDENCIES activesupport (~> 7.0.4) - jekyll (= 4.3.1) + jekyll (= 4.3.2) jekyll-include-cache (~> 0.2.1) - jekyll-toc (~> 0.17.1) + jekyll-sass-converter (~> 2.2.0) + jekyll-toc (~> 0.18.0) liquid-tag-parser (~> 2.0.2) webrick BUNDLED WITH - 2.3.12 + 2.4.4 diff --git a/examples/codelabs b/examples/codelabs index 644dc338f5..a6b830b17c 160000 --- a/examples/codelabs +++ b/examples/codelabs @@ -1 +1 @@ -Subproject commit 644dc338f5fc2004c09cd6226dd47bfb9a70eceb +Subproject commit a6b830b17cd0d967e2deb9ec22d6e134d4f3b6fc diff --git a/examples/cookbook/design/orientation/lib/main.dart b/examples/cookbook/design/orientation/lib/main.dart index ad9ccbbbf4..9169584dcf 100644 --- a/examples/cookbook/design/orientation/lib/main.dart +++ b/examples/cookbook/design/orientation/lib/main.dart @@ -40,7 +40,7 @@ class OrientationList extends StatelessWidget { return Center( child: Text( 'Item $index', - style: Theme.of(context).textTheme.headline1, + style: Theme.of(context).textTheme.displayLarge, ), ); }), diff --git a/examples/cookbook/design/themes/lib/main.dart b/examples/cookbook/design/themes/lib/main.dart index fd022547e4..ece96c5c8a 100644 --- a/examples/cookbook/design/themes/lib/main.dart +++ b/examples/cookbook/design/themes/lib/main.dart @@ -25,9 +25,9 @@ class MyApp extends StatelessWidget { // Define the default `TextTheme`. Use this to specify the default // text styling for headlines, titles, bodies of text, and more. textTheme: const TextTheme( - headline1: TextStyle(fontSize: 72.0, fontWeight: FontWeight.bold), - headline6: TextStyle(fontSize: 36.0, fontStyle: FontStyle.italic), - bodyText2: TextStyle(fontSize: 14.0, fontFamily: 'Hind'), + displayLarge: TextStyle(fontSize: 72.0, fontWeight: FontWeight.bold), + titleLarge: TextStyle(fontSize: 36.0, fontStyle: FontStyle.italic), + bodyMedium: TextStyle(fontSize: 14.0, fontFamily: 'Hind'), ), ), home: const MyHomePage( @@ -55,7 +55,7 @@ class MyHomePage extends StatelessWidget { color: Theme.of(context).colorScheme.secondary, child: Text( 'Text with a background color', - style: Theme.of(context).textTheme.headline6, + style: Theme.of(context).textTheme.titleLarge, ), ), // #enddocregion Container diff --git a/examples/cookbook/effects/download_button/lib/button_taps.dart b/examples/cookbook/effects/download_button/lib/button_taps.dart index 6393e1d666..e0fc4d018f 100644 --- a/examples/cookbook/effects/download_button/lib/button_taps.dart +++ b/examples/cookbook/effects/download_button/lib/button_taps.dart @@ -46,7 +46,7 @@ class ButtonShapeWidget extends StatelessWidget { child: Text( isDownloaded ? 'OPEN' : 'GET', textAlign: TextAlign.center, - style: Theme.of(context).textTheme.button?.copyWith( + style: Theme.of(context).textTheme.labelLarge?.copyWith( fontWeight: FontWeight.bold, color: CupertinoColors.activeBlue, ), diff --git a/examples/cookbook/effects/download_button/lib/display_text.dart b/examples/cookbook/effects/download_button/lib/display_text.dart index 798bd44314..8e3517aa4c 100644 --- a/examples/cookbook/effects/download_button/lib/display_text.dart +++ b/examples/cookbook/effects/download_button/lib/display_text.dart @@ -45,7 +45,7 @@ class ButtonShapeWidget extends StatelessWidget { child: Text( isDownloaded ? 'OPEN' : 'GET', textAlign: TextAlign.center, - style: Theme.of(context).textTheme.button?.copyWith( + style: Theme.of(context).textTheme.labelLarge?.copyWith( fontWeight: FontWeight.bold, color: CupertinoColors.activeBlue, ), diff --git a/examples/cookbook/effects/download_button/lib/main.dart b/examples/cookbook/effects/download_button/lib/main.dart index dbb06eba9a..ac1ebe62f1 100644 --- a/examples/cookbook/effects/download_button/lib/main.dart +++ b/examples/cookbook/effects/download_button/lib/main.dart @@ -63,12 +63,12 @@ class _ExampleCupertinoDownloadButtonState title: Text( 'App ${index + 1}', overflow: TextOverflow.ellipsis, - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, ), subtitle: Text( 'Lorem ipsum dolor #${index + 1}', overflow: TextOverflow.ellipsis, - style: theme.textTheme.caption, + style: theme.textTheme.bodySmall, ), trailing: SizedBox( width: 96, @@ -357,7 +357,7 @@ class ButtonShapeWidget extends StatelessWidget { child: Text( isDownloaded ? 'OPEN' : 'GET', textAlign: TextAlign.center, - style: Theme.of(context).textTheme.button?.copyWith( + style: Theme.of(context).textTheme.labelLarge?.copyWith( fontWeight: FontWeight.bold, color: CupertinoColors.activeBlue, ), diff --git a/examples/cookbook/effects/download_button/lib/spinner.dart b/examples/cookbook/effects/download_button/lib/spinner.dart index bda5caadd4..12c2075d25 100644 --- a/examples/cookbook/effects/download_button/lib/spinner.dart +++ b/examples/cookbook/effects/download_button/lib/spinner.dart @@ -44,7 +44,7 @@ class ButtonShapeWidget extends StatelessWidget { child: Text( isDownloaded ? 'OPEN' : 'GET', textAlign: TextAlign.center, - style: Theme.of(context).textTheme.button?.copyWith( + style: Theme.of(context).textTheme.labelLarge?.copyWith( fontWeight: FontWeight.bold, color: CupertinoColors.activeBlue, ), diff --git a/examples/cookbook/effects/download_button/lib/stop.dart b/examples/cookbook/effects/download_button/lib/stop.dart index 100ae3443e..3aa6ea8151 100644 --- a/examples/cookbook/effects/download_button/lib/stop.dart +++ b/examples/cookbook/effects/download_button/lib/stop.dart @@ -44,7 +44,7 @@ class ButtonShapeWidget extends StatelessWidget { child: Text( isDownloaded ? 'OPEN' : 'GET', textAlign: TextAlign.center, - style: Theme.of(context).textTheme.button?.copyWith( + style: Theme.of(context).textTheme.labelLarge?.copyWith( fontWeight: FontWeight.bold, color: CupertinoColors.activeBlue, ), diff --git a/examples/cookbook/effects/drag_a_widget/lib/main.dart b/examples/cookbook/effects/drag_a_widget/lib/main.dart index 11f7466169..8fcfe55dab 100644 --- a/examples/cookbook/effects/drag_a_widget/lib/main.dart +++ b/examples/cookbook/effects/drag_a_widget/lib/main.dart @@ -88,7 +88,7 @@ class _ExampleDragAndDropState extends State iconTheme: const IconThemeData(color: Color(0xFFF64209)), title: Text( 'Order Food', - style: Theme.of(context).textTheme.headline4?.copyWith( + style: Theme.of(context).textTheme.headlineMedium?.copyWith( fontSize: 36, color: const Color(0xFFF64209), fontWeight: FontWeight.bold, @@ -241,7 +241,7 @@ class CustomerCart extends StatelessWidget { const SizedBox(height: 8.0), Text( customer.name, - style: Theme.of(context).textTheme.subtitle1?.copyWith( + style: Theme.of(context).textTheme.titleMedium?.copyWith( color: textColor, fontWeight: hasItems ? FontWeight.normal : FontWeight.bold, @@ -257,7 +257,7 @@ class CustomerCart extends StatelessWidget { const SizedBox(height: 4.0), Text( customer.formattedTotalItemPrice, - style: Theme.of(context).textTheme.caption!.copyWith( + style: Theme.of(context).textTheme.bodySmall!.copyWith( color: textColor, fontSize: 16.0, fontWeight: FontWeight.bold, @@ -266,7 +266,7 @@ class CustomerCart extends StatelessWidget { const SizedBox(height: 4.0), Text( '${customer.items.length} item${customer.items.length != 1 ? 's' : ''}', - style: Theme.of(context).textTheme.subtitle1!.copyWith( + style: Theme.of(context).textTheme.titleMedium!.copyWith( color: textColor, fontSize: 12.0, ), @@ -332,14 +332,14 @@ class MenuListItem extends StatelessWidget { children: [ Text( name, - style: Theme.of(context).textTheme.subtitle1?.copyWith( + style: Theme.of(context).textTheme.titleMedium?.copyWith( fontSize: 18.0, ), ), const SizedBox(height: 10.0), Text( price, - style: Theme.of(context).textTheme.subtitle1?.copyWith( + style: Theme.of(context).textTheme.titleMedium?.copyWith( fontWeight: FontWeight.bold, fontSize: 18.0, ), diff --git a/examples/cookbook/effects/nested_nav/lib/add_navigator.dart b/examples/cookbook/effects/nested_nav/lib/add_navigator.dart index 4052f86952..b18b8117b8 100644 --- a/examples/cookbook/effects/nested_nav/lib/add_navigator.dart +++ b/examples/cookbook/effects/nested_nav/lib/add_navigator.dart @@ -211,7 +211,7 @@ class SelectDevicePage extends StatelessWidget { children: [ Text( 'Select a nearby device:', - style: Theme.of(context).textTheme.headline6, + style: Theme.of(context).textTheme.titleLarge, ), const SizedBox(height: 24), SizedBox( diff --git a/examples/cookbook/effects/nested_nav/lib/main.dart b/examples/cookbook/effects/nested_nav/lib/main.dart index 4dd4846df3..9d074d06cf 100644 --- a/examples/cookbook/effects/nested_nav/lib/main.dart +++ b/examples/cookbook/effects/nested_nav/lib/main.dart @@ -209,7 +209,7 @@ class SelectDevicePage extends StatelessWidget { children: [ Text( 'Select a nearby device:', - style: Theme.of(context).textTheme.headline6, + style: Theme.of(context).textTheme.titleLarge, ), const SizedBox(height: 24), SizedBox( diff --git a/examples/cookbook/effects/nested_nav/lib/original_example.dart b/examples/cookbook/effects/nested_nav/lib/original_example.dart index a7dc538573..9db3401832 100644 --- a/examples/cookbook/effects/nested_nav/lib/original_example.dart +++ b/examples/cookbook/effects/nested_nav/lib/original_example.dart @@ -205,7 +205,7 @@ class SelectDevicePage extends StatelessWidget { children: [ Text( 'Select a nearby device:', - style: Theme.of(context).textTheme.headline6, + style: Theme.of(context).textTheme.titleLarge, ), const SizedBox(height: 24), SizedBox( diff --git a/examples/cookbook/effects/parallax_scrolling/lib/excerpt2.dart b/examples/cookbook/effects/parallax_scrolling/lib/excerpt2.dart index 3a42e3a710..d80f38b579 100644 --- a/examples/cookbook/effects/parallax_scrolling/lib/excerpt2.dart +++ b/examples/cookbook/effects/parallax_scrolling/lib/excerpt2.dart @@ -84,4 +84,4 @@ class LocationListItem extends StatelessWidget { ); } } -// #enddocregion LocationListItem \ No newline at end of file +// #enddocregion LocationListItem diff --git a/examples/cookbook/effects/parallax_scrolling/lib/excerpt5.dart b/examples/cookbook/effects/parallax_scrolling/lib/excerpt5.dart index aec4787506..a25cb17593 100644 --- a/examples/cookbook/effects/parallax_scrolling/lib/excerpt5.dart +++ b/examples/cookbook/effects/parallax_scrolling/lib/excerpt5.dart @@ -8,7 +8,7 @@ class LocationListItem extends StatelessWidget { Widget _buildParallaxBackground(BuildContext context) { return Flow( delegate: ParallaxFlowDelegate( - scrollable: Scrollable.of(context)!, + scrollable: Scrollable.of(context), listItemContext: context, backgroundImageKey: _backgroundImageKey, ), diff --git a/examples/cookbook/effects/parallax_scrolling/lib/main.dart b/examples/cookbook/effects/parallax_scrolling/lib/main.dart index 1c0d83bfae..c20cd4aa1b 100644 --- a/examples/cookbook/effects/parallax_scrolling/lib/main.dart +++ b/examples/cookbook/effects/parallax_scrolling/lib/main.dart @@ -82,7 +82,7 @@ class LocationListItem extends StatelessWidget { Widget _buildParallaxBackground(BuildContext context) { return Flow( delegate: ParallaxFlowDelegate( - scrollable: Scrollable.of(context)!, + scrollable: Scrollable.of(context), listItemContext: context, backgroundImageKey: _backgroundImageKey, ), @@ -217,13 +217,13 @@ class Parallax extends SingleChildRenderObjectWidget { @override RenderObject createRenderObject(BuildContext context) { - return RenderParallax(scrollable: Scrollable.of(context)!); + return RenderParallax(scrollable: Scrollable.of(context)); } @override void updateRenderObject( BuildContext context, covariant RenderParallax renderObject) { - renderObject.scrollable = Scrollable.of(context)!; + renderObject.scrollable = Scrollable.of(context); } } diff --git a/examples/cookbook/lists/grid_lists/lib/main.dart b/examples/cookbook/lists/grid_lists/lib/main.dart index 885481debc..6f4e28c54e 100644 --- a/examples/cookbook/lists/grid_lists/lib/main.dart +++ b/examples/cookbook/lists/grid_lists/lib/main.dart @@ -27,7 +27,7 @@ class MyApp extends StatelessWidget { return Center( child: Text( 'Item $index', - style: Theme.of(context).textTheme.headline5, + style: Theme.of(context).textTheme.headlineSmall, ), ); }), diff --git a/examples/cookbook/lists/mixed_list/lib/main.dart b/examples/cookbook/lists/mixed_list/lib/main.dart index a02111b682..944eb4464e 100644 --- a/examples/cookbook/lists/mixed_list/lib/main.dart +++ b/examples/cookbook/lists/mixed_list/lib/main.dart @@ -71,7 +71,7 @@ class HeadingItem implements ListItem { Widget buildTitle(BuildContext context) { return Text( heading, - style: Theme.of(context).textTheme.headline5, + style: Theme.of(context).textTheme.headlineSmall, ); } diff --git a/examples/cookbook/persistence/key_value/lib/main.dart b/examples/cookbook/persistence/key_value/lib/main.dart index 1b3924c53b..3fd11afef7 100644 --- a/examples/cookbook/persistence/key_value/lib/main.dart +++ b/examples/cookbook/persistence/key_value/lib/main.dart @@ -66,7 +66,7 @@ class _MyHomePageState extends State { ), Text( '$_counter', - style: Theme.of(context).textTheme.headline4, + style: Theme.of(context).textTheme.headlineMedium, ), ], ), diff --git a/examples/development/platform_integration/pubspec.yaml b/examples/development/platform_integration/pubspec.yaml index 4ee427de6a..33f7fa753f 100644 --- a/examples/development/platform_integration/pubspec.yaml +++ b/examples/development/platform_integration/pubspec.yaml @@ -29,7 +29,7 @@ environment: dependencies: flutter: sdk: flutter - pigeon: ^5.0.0 + pigeon: ^7.0.0 # The following adds the Cupertino Icons font to your application. diff --git a/examples/get-started/codelab_web/lib/main.dart b/examples/get-started/codelab_web/lib/main.dart index aa85805427..578eedd8fb 100644 --- a/examples/get-started/codelab_web/lib/main.dart +++ b/examples/get-started/codelab_web/lib/main.dart @@ -42,7 +42,8 @@ class WelcomeScreen extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( body: Center( - child: Text('Welcome!', style: Theme.of(context).textTheme.headline2), + child: + Text('Welcome!', style: Theme.of(context).textTheme.displayMedium), ), ); } @@ -91,7 +92,7 @@ class _SignUpFormState extends State { mainAxisSize: MainAxisSize.min, children: [ AnimatedProgressIndicator(value: _formProgress), - Text('Sign up', style: Theme.of(context).textTheme.headline4), + Text('Sign up', style: Theme.of(context).textTheme.headlineMedium), Padding( padding: const EdgeInsets.all(8.0), child: TextFormField( diff --git a/examples/get-started/codelab_web/lib/starter.dart b/examples/get-started/codelab_web/lib/starter.dart index 3cdd29b9c1..073458f1b0 100644 --- a/examples/get-started/codelab_web/lib/starter.dart +++ b/examples/get-started/codelab_web/lib/starter.dart @@ -56,7 +56,7 @@ class _SignUpFormState extends State { mainAxisSize: MainAxisSize.min, children: [ LinearProgressIndicator(value: _formProgress), - Text('Sign up', style: Theme.of(context).textTheme.headline4), + Text('Sign up', style: Theme.of(context).textTheme.headlineMedium), Padding( padding: const EdgeInsets.all(8.0), child: TextFormField( @@ -106,5 +106,3 @@ class _SignUpFormState extends State { // Avoid warning on "double _formProgress = 0;" //_ignore_for_file: prefer_final_fields /* {$ end test.dart $} */ - - diff --git a/examples/get-started/codelab_web/lib/step1.dart b/examples/get-started/codelab_web/lib/step1.dart index 3e4aed1a3b..1300e4f0bf 100644 --- a/examples/get-started/codelab_web/lib/step1.dart +++ b/examples/get-started/codelab_web/lib/step1.dart @@ -8,7 +8,8 @@ class WelcomeScreen extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( body: Center( - child: Text('Welcome!', style: Theme.of(context).textTheme.headline2), + child: + Text('Welcome!', style: Theme.of(context).textTheme.displayMedium), ), ); } @@ -79,7 +80,7 @@ class _SignUpFormState extends State { mainAxisSize: MainAxisSize.min, children: [ LinearProgressIndicator(value: _formProgress), - Text('Sign up', style: Theme.of(context).textTheme.headline4), + Text('Sign up', style: Theme.of(context).textTheme.headlineMedium), Padding( padding: const EdgeInsets.all(8.0), child: TextFormField( diff --git a/examples/get-started/codelab_web/lib/step2.dart b/examples/get-started/codelab_web/lib/step2.dart index 98afaa88d4..e376e47ea5 100644 --- a/examples/get-started/codelab_web/lib/step2.dart +++ b/examples/get-started/codelab_web/lib/step2.dart @@ -7,7 +7,8 @@ class WelcomeScreen extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( body: Center( - child: Text('Welcome!', style: Theme.of(context).textTheme.headline2), + child: + Text('Welcome!', style: Theme.of(context).textTheme.displayMedium), ), ); } @@ -99,7 +100,7 @@ class _SignUpFormState extends State { mainAxisSize: MainAxisSize.min, children: [ LinearProgressIndicator(value: _formProgress), - Text('Sign up', style: Theme.of(context).textTheme.headline4), + Text('Sign up', style: Theme.of(context).textTheme.headlineMedium), Padding( padding: const EdgeInsets.all(8.0), child: TextFormField( diff --git a/examples/get-started/codelab_web/lib/step3.dart b/examples/get-started/codelab_web/lib/step3.dart index e1e4ac2517..0cd8be44a0 100644 --- a/examples/get-started/codelab_web/lib/step3.dart +++ b/examples/get-started/codelab_web/lib/step3.dart @@ -7,7 +7,8 @@ class WelcomeScreen extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( body: Center( - child: Text('Welcome!', style: Theme.of(context).textTheme.headline2), + child: + Text('Welcome!', style: Theme.of(context).textTheme.displayMedium), ), ); } @@ -94,7 +95,7 @@ class _SignUpFormState extends State { mainAxisSize: MainAxisSize.min, children: [ AnimatedProgressIndicator(value: _formProgress), // NEW - Text('Sign up', style: Theme.of(context).textTheme.headline4), + Text('Sign up', style: Theme.of(context).textTheme.headlineMedium), Padding( // #enddocregion UseAnimatedProgressIndicator padding: const EdgeInsets.all(8.0), @@ -205,4 +206,4 @@ class _AnimatedProgressIndicatorState extends State ); } } -// #enddocregion AnimatedProgressIndicator \ No newline at end of file +// #enddocregion AnimatedProgressIndicator diff --git a/examples/googleapis/pubspec.yaml b/examples/googleapis/pubspec.yaml index 8cd16ec116..692051f3ed 100644 --- a/examples/googleapis/pubspec.yaml +++ b/examples/googleapis/pubspec.yaml @@ -10,7 +10,7 @@ dependencies: flutter: sdk: flutter google_sign_in: ^5.0.2 - googleapis: ^9.1.0 + googleapis: ^10.0.0 http: ^0.13.0 dev_dependencies: diff --git a/examples/internationalization/add_language/pubspec.yaml b/examples/internationalization/add_language/pubspec.yaml index fe81f6dc5f..fa79533c20 100644 --- a/examples/internationalization/add_language/pubspec.yaml +++ b/examples/internationalization/add_language/pubspec.yaml @@ -9,7 +9,7 @@ dependencies: sdk: flutter flutter_localizations: sdk: flutter - intl: any # Take the version from Flutter. + intl: any # Use the pinned version from flutter_localizations dev_dependencies: flutter_test: diff --git a/examples/internationalization/gen_l10n_example/lib/examples.txt b/examples/internationalization/gen_l10n_example/lib/examples.dart similarity index 67% rename from examples/internationalization/gen_l10n_example/lib/examples.txt rename to examples/internationalization/gen_l10n_example/lib/examples.dart index 8308f77bd6..9cd8c872be 100644 --- a/examples/internationalization/gen_l10n_example/lib/examples.txt +++ b/examples/internationalization/gen_l10n_example/lib/examples.dart @@ -1,21 +1,18 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; // ignore_for_file: unused_local_variable -// #docregion Create -flutter create -// #enddocregion Create +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; void examples(BuildContext context) { -// #docregion MaterialAppExample + // #docregion MaterialAppExample const MaterialApp( title: 'Localizations Sample App', localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: AppLocalizations.supportedLocales, ); -// #enddocregion MaterialAppExample + // #enddocregion MaterialAppExample -// #docregion LocaleResolution + // #docregion LocaleResolution MaterialApp( localeResolutionCallback: ( locale, @@ -24,9 +21,51 @@ void examples(BuildContext context) { return locale; }, ); -// #enddocregion LocaleResolution + // #enddocregion LocaleResolution + + // #docregion MyLocale + Locale myLocale = Localizations.localeOf(context); + // #enddocregion MyLocale + + const MaterialApp( + // #docregion SupportedLocales + supportedLocales: [ + Locale.fromSubtags(languageCode: 'zh'), // generic Chinese 'zh' + Locale.fromSubtags( + languageCode: 'zh', + scriptCode: 'Hans'), // generic simplified Chinese 'zh_Hans' + Locale.fromSubtags( + languageCode: 'zh', + scriptCode: 'Hant'), // generic traditional Chinese 'zh_Hant' + Locale.fromSubtags( + languageCode: 'zh', + scriptCode: 'Hans', + countryCode: 'CN'), // 'zh_Hans_CN' + Locale.fromSubtags( + languageCode: 'zh', + scriptCode: 'Hant', + countryCode: 'TW'), // 'zh_Hant_TW' + Locale.fromSubtags( + languageCode: 'zh', + scriptCode: 'Hant', + countryCode: 'HK'), // 'zh_Hant_HK' + ], + // #enddocregion SupportedLocales + ); +} + +class PageWithDatePicker extends StatefulWidget { + const PageWithDatePicker({super.key}); -// #docregion CalendarDatePicker + final String title = 'Localizations Sample App'; + + @override + State createState() => _PageWithDatePickerState(); +} + +class _PageWithDatePickerState extends State { + @override + // #docregion CalendarDatePicker Widget build(BuildContext context) { return Scaffold( appBar: AppBar( @@ -34,7 +73,7 @@ void examples(BuildContext context) { ), body: Center( child: Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, children: [ // Add the following code Localizations.override( @@ -44,7 +83,7 @@ void examples(BuildContext context) { // Alternatively, you can create a new widget and Localizations.override // will pass the updated BuildContext to the new widget. child: Builder( - builder: (BuildContext context) { + builder: (context) { // A toy example for an internationalized Material widget. return CalendarDatePicker( initialDate: DateTime.now(), @@ -60,52 +99,5 @@ void examples(BuildContext context) { ), ); } -// #enddocregion CalendarDatePicker -// #docregion Example - Text(AppLocalizations.of(context)!.helloWorld); -// #enddocregion Example - -// #docregion PlaceholderSyntax -"{placeholder}" -// #enddocregion PlaceholderSyntax -// #docregion PluralSyntax -"{countPlaceholder, plural, =0{message0} =1{message1} ... other{messageOther}}" -// #enddocregion PluralSyntax -// #docregion SelectSyntax -"{selectPlaceholder, select, case{message} ... other{messageOther}}" -// #enddocregion SelectSyntax - -// #docregion MyLocale - Locale myLocale = Localizations.localeOf(context); -// #enddocregion MyLocale - -// #docregion PluralSyntax -"{countPlaceholder, plural, =0{message0} =1{message1} =2{message2} few{messageFew} many{messageMany} other{messageOther}}" -// #enddocregion PluralSyntax - - const MaterialApp( -// #docregion SupportedLocales - supportedLocales: [ - Locale.fromSubtags(languageCode: 'zh'), // generic Chinese 'zh' - Locale.fromSubtags( - languageCode: 'zh', - scriptCode: 'Hans'), // generic simplified Chinese 'zh_Hans' - Locale.fromSubtags( - languageCode: 'zh', - scriptCode: 'Hant'), // generic traditional Chinese 'zh_Hant' - Locale.fromSubtags( - languageCode: 'zh', - scriptCode: 'Hans', - countryCode: 'CN'), // 'zh_Hans_CN' - Locale.fromSubtags( - languageCode: 'zh', - scriptCode: 'Hant', - countryCode: 'TW'), // 'zh_Hant_TW' - Locale.fromSubtags( - languageCode: 'zh', - scriptCode: 'Hant', - countryCode: 'HK'), // 'zh_Hant_HK' - ], -// #enddocregion SupportedLocales - ); + // #enddocregion CalendarDatePicker } diff --git a/examples/internationalization/gen_l10n_example/lib/main.dart b/examples/internationalization/gen_l10n_example/lib/main.dart index 0374066894..73c6424b01 100644 --- a/examples/internationalization/gen_l10n_example/lib/main.dart +++ b/examples/internationalization/gen_l10n_example/lib/main.dart @@ -13,7 +13,7 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { -// #docregion MaterialApp + // #docregion MaterialApp return const MaterialApp( title: 'Localizations Sample App', localizationsDelegates: [ @@ -28,7 +28,7 @@ class MyApp extends StatelessWidget { ], home: MyHomePage(), ); -// #enddocregion MaterialApp + // #enddocregion MaterialApp } } @@ -54,7 +54,7 @@ class _MyHomePageState extends State { // #enddocregion InternationalizedTitle body: Center( child: Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, children: [ // Add the following code Localizations.override( diff --git a/examples/internationalization/gen_l10n_example/pubspec.yaml b/examples/internationalization/gen_l10n_example/pubspec.yaml index 1e97f0f97e..16481ca334 100644 --- a/examples/internationalization/gen_l10n_example/pubspec.yaml +++ b/examples/internationalization/gen_l10n_example/pubspec.yaml @@ -5,15 +5,13 @@ environment: sdk: '>=2.18.5 <3.0.0' # #docregion FlutterLocalizations -# #docregion Intl dependencies: flutter: sdk: flutter - flutter_localizations: # Add this line - sdk: flutter # Add this line - intl: ^0.17.0 # Add this line + flutter_localizations: + sdk: flutter + intl: any # #enddocregion FlutterLocalizations -# #enddocregion Intl dev_dependencies: flutter_lints: ^2.0.1 diff --git a/examples/internationalization/intl_example/lib/l10n/messages_all.dart b/examples/internationalization/intl_example/lib/l10n/messages_all.dart index d725868cf3..fc55d77948 100644 --- a/examples/internationalization/intl_example/lib/l10n/messages_all.dart +++ b/examples/internationalization/intl_example/lib/l10n/messages_all.dart @@ -2,55 +2,6 @@ // This is a library that looks up messages for specific locales by // delegating to the appropriate library. -import 'dart:async'; +export 'messages_all_locales.dart' + show initializeMessages; -import 'package:intl/intl.dart'; -import 'package:intl/message_lookup_by_library.dart'; -import 'package:intl/src/intl_helpers.dart'; - -import 'messages_en.dart' as messages_en; -import 'messages_es.dart' as messages_es; -import 'messages_messages.dart' as messages_messages; - -typedef Future LibraryLoader(); -Map _deferredLibraries = { - 'en': () => Future.value(null), - 'es': () => Future.value(null), - 'messages': () => Future.value(null), -}; - -MessageLookupByLibrary? _findExact(localeName) { - switch (localeName) { - case 'en': - return messages_en.messages; - case 'es': - return messages_es.messages; - case 'messages': - return messages_messages.messages; - default: - return null; - } -} - -/// User programs should call this before using [localeName] for messages. -Future initializeMessages(String localeName) async { - var lib = _deferredLibraries[Intl.canonicalizedLocale(localeName)]; - await (lib == null ? Future.value(false) : lib()); - initializeInternalMessageLookup(() => CompositeMessageLookup()); - messageLookup.addLocale(localeName, _findGeneratedMessagesFor); -} - -bool _messagesExistFor(String locale) { - try { - return _findExact(locale) != null; - } catch (e) { - return false; - } -} - -MessageLookupByLibrary? _findGeneratedMessagesFor(locale) { - var actualLocale = - Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null); - if (actualLocale == null) return null; - return _findExact(actualLocale); -} diff --git a/examples/internationalization/intl_example/lib/l10n/messages_all_locales.dart b/examples/internationalization/intl_example/lib/l10n/messages_all_locales.dart new file mode 100644 index 0000000000..4e5651ab04 --- /dev/null +++ b/examples/internationalization/intl_example/lib/l10n/messages_all_locales.dart @@ -0,0 +1,69 @@ +// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart +// This is a library that looks up messages for specific locales by +// delegating to the appropriate library. + +// Ignore issues from commonly used lints in this file. +// ignore_for_file:implementation_imports, file_names +// ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering +// ignore_for_file:argument_type_not_assignable, invalid_assignment +// ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases +// ignore_for_file:comment_references + +import 'package:intl/intl.dart'; +import 'package:intl/message_lookup_by_library.dart'; +import 'package:intl/src/intl_helpers.dart'; + +import 'messages_en.dart' as messages_en; +import 'messages_es.dart' as messages_es; +import 'messages_messages.dart' as messages_messages; + +typedef Future LibraryLoader(); +Map _deferredLibraries = { + 'en': () => Future.value(null), + 'es': () => Future.value(null), + 'messages': () => Future.value(null), +}; + +MessageLookupByLibrary? _findExact(String localeName) { + switch (localeName) { + case 'en': + return messages_en.messages; + case 'es': + return messages_es.messages; + case 'messages': + return messages_messages.messages; + default: + return null; + } +} + +/// User programs should call this before using [localeName] for messages. +Future initializeMessages(String? localeName) async { + var availableLocale = Intl.verifiedLocale( + localeName, + (locale) => _deferredLibraries[locale] != null, + onFailure: (_) => null); + if (availableLocale == null) { + return Future.value(false); + } + var lib = _deferredLibraries[availableLocale]; + await (lib == null ? Future.value(false) : lib()); + initializeInternalMessageLookup(() => CompositeMessageLookup()); + messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor); + return Future.value(true); +} + +bool _messagesExistFor(String locale) { + try { + return _findExact(locale) != null; + } catch (e) { + return false; + } +} + +MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) { + var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor, + onFailure: (_) => null); + if (actualLocale == null) return null; + return _findExact(actualLocale); +} diff --git a/examples/internationalization/intl_example/lib/l10n/messages_en.dart b/examples/internationalization/intl_example/lib/l10n/messages_en.dart index 2b2c763efb..f524bbd4d1 100644 --- a/examples/internationalization/intl_example/lib/l10n/messages_en.dart +++ b/examples/internationalization/intl_example/lib/l10n/messages_en.dart @@ -3,19 +3,28 @@ // messages from the main program should be duplicated here with the same // function name. +// Ignore issues from commonly used lints in this file. +// ignore_for_file:unnecessary_brace_in_string_interps +// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering +// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases +// ignore_for_file:unused_import, file_names + import 'package:intl/intl.dart'; import 'package:intl/message_lookup_by_library.dart'; final messages = MessageLookup(); -final _keepAnalysisHappy = Intl.defaultLocale; - -typedef MessageIfAbsent(String message_str, List args); +typedef String? MessageIfAbsent( + String? messageStr, List? args); class MessageLookup extends MessageLookupByLibrary { - get localeName => 'en'; + @override + String get localeName => 'en'; + + @override + final Map messages = _notInlinedMessages(_notInlinedMessages); - final messages = _notInlinedMessages(_notInlinedMessages); - static _notInlinedMessages(_) => - {"title": MessageLookupByLibrary.simpleMessage("Hello World")}; + static Map _notInlinedMessages(_) => { + 'title': MessageLookupByLibrary.simpleMessage('Hello World') + }; } diff --git a/examples/internationalization/intl_example/lib/l10n/messages_es.dart b/examples/internationalization/intl_example/lib/l10n/messages_es.dart index fca23cc7ce..e81197a0c0 100644 --- a/examples/internationalization/intl_example/lib/l10n/messages_es.dart +++ b/examples/internationalization/intl_example/lib/l10n/messages_es.dart @@ -3,19 +3,28 @@ // messages from the main program should be duplicated here with the same // function name. +// Ignore issues from commonly used lints in this file. +// ignore_for_file:unnecessary_brace_in_string_interps +// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering +// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases +// ignore_for_file:unused_import, file_names + import 'package:intl/intl.dart'; import 'package:intl/message_lookup_by_library.dart'; final messages = MessageLookup(); -final _keepAnalysisHappy = Intl.defaultLocale; - -typedef MessageIfAbsent(String message_str, List args); +typedef String? MessageIfAbsent( + String? messageStr, List? args); class MessageLookup extends MessageLookupByLibrary { - get localeName => 'es'; + @override + String get localeName => 'es'; + + @override + final Map messages = _notInlinedMessages(_notInlinedMessages); - final messages = _notInlinedMessages(_notInlinedMessages); - static _notInlinedMessages(_) => - {"title": MessageLookupByLibrary.simpleMessage("Hola Mundo")}; + static Map _notInlinedMessages(_) => { + 'title': MessageLookupByLibrary.simpleMessage('Hola Mundo') + }; } diff --git a/examples/internationalization/intl_example/lib/l10n/messages_messages.dart b/examples/internationalization/intl_example/lib/l10n/messages_messages.dart index d2b7969eb0..13be5f8307 100644 --- a/examples/internationalization/intl_example/lib/l10n/messages_messages.dart +++ b/examples/internationalization/intl_example/lib/l10n/messages_messages.dart @@ -3,19 +3,28 @@ // messages from the main program should be duplicated here with the same // function name. +// Ignore issues from commonly used lints in this file. +// ignore_for_file:unnecessary_brace_in_string_interps +// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering +// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases +// ignore_for_file:unused_import, file_names + import 'package:intl/intl.dart'; import 'package:intl/message_lookup_by_library.dart'; final messages = MessageLookup(); -final _keepAnalysisHappy = Intl.defaultLocale; - -typedef MessageIfAbsent(String message_str, List args); +typedef String? MessageIfAbsent( + String? messageStr, List? args); class MessageLookup extends MessageLookupByLibrary { - get localeName => 'messages'; + @override + String get localeName => 'messages'; + + @override + final Map messages = _notInlinedMessages(_notInlinedMessages); - final messages = _notInlinedMessages(_notInlinedMessages); - static _notInlinedMessages(_) => - {"title": MessageLookupByLibrary.simpleMessage("Hello World")}; + static Map _notInlinedMessages(_) => { + 'title': MessageLookupByLibrary.simpleMessage('Hello World') + }; } diff --git a/examples/internationalization/intl_example/lib/main.dart b/examples/internationalization/intl_example/lib/main.dart index 6953f783fb..a99f66c1a5 100644 --- a/examples/internationalization/intl_example/lib/main.dart +++ b/examples/internationalization/intl_example/lib/main.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. // A simple example of localizing a Flutter app written with the -// Dart intl package (see https://pub.dartlang.org/packages/intl). +// Dart intl package (see https://pub.dev/packages/intl). // // Spanish and English (locale language codes 'en' and 'es') are // supported. @@ -16,8 +16,7 @@ // sdk: flutter // flutter_localizations: // sdk: flutter -// intl: 0.17.0 -// intl_generator: 0.3.0 +// intl: any # Use the pinned version from flutter_localizations // If you run this app with the device's locale set to anything but // English or Spanish, the app's locale will be English. If you @@ -35,8 +34,8 @@ import 'package:intl/intl.dart'; // directory: // // flutter pub get -// flutter pub run intl_generator:extract_to_arb --output-dir=lib/l10n lib/main.dart -// flutter pub run intl_generator:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/main.dart lib/l10n/intl_*.arb +// dart run intl_translation:extract_to_arb --output-dir=lib/l10n lib/main.dart +// dart run intl_translation:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/main.dart lib/l10n/intl_*.arb // // The second command generates intl_messages.arb and the third generates // messages_all.dart. There's more about this process in @@ -112,14 +111,13 @@ class Demo extends StatelessWidget { @override Widget build(BuildContext context) { -// #docregion MaterialAppTitleExample + // #docregion MaterialAppTitleExample return MaterialApp( - onGenerateTitle: (context) => - DemoLocalizations.of(context).title, -// #enddocregion MaterialAppTitleExample + onGenerateTitle: (context) => DemoLocalizations.of(context).title, + // #enddocregion MaterialAppTitleExample localizationsDelegates: const [ DemoLocalizationsDelegate(), - GlobalMaterialLocalizations.delegate, + ...GlobalMaterialLocalizations.delegates, GlobalWidgetsLocalizations.delegate, ], supportedLocales: const [ diff --git a/examples/internationalization/intl_example/pubspec.yaml b/examples/internationalization/intl_example/pubspec.yaml index 58dbdb633f..c23a88c76c 100644 --- a/examples/internationalization/intl_example/pubspec.yaml +++ b/examples/internationalization/intl_example/pubspec.yaml @@ -9,12 +9,13 @@ dependencies: sdk: flutter flutter_localizations: sdk: flutter - intl: ^0.17.0 + intl: any # Use the pinned version from flutter_localizations dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^2.0.1 + intl_translation: ^0.18.0 flutter: uses-material-design: true diff --git a/examples/internationalization/intl_example/test/widget_test.dart b/examples/internationalization/intl_example/test/widget_test.dart new file mode 100644 index 0000000000..f8bdf83cfd --- /dev/null +++ b/examples/internationalization/intl_example/test/widget_test.dart @@ -0,0 +1,26 @@ +import 'package:flutter_test/flutter_test.dart'; + +import 'package:intl_example/main.dart'; + +void main() { + testWidgets('Test localized strings in demo app', (tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const Demo()); + + // // Set the app's locale to English + await tester.binding.setLocale('en', ''); + await tester.pumpAndSettle(); + + // Verify that our text is English + expect(find.text('Hello World'), findsWidgets); + expect(find.text('Hola Mundo'), findsNothing); + + // Set the app's locale to Spanish + await tester.binding.setLocale('es', ''); + await tester.pumpAndSettle(); + + // Verify that our text is Spanish + expect(find.text('Hola Mundo'), findsWidgets); + expect(find.text('Hello World'), findsNothing); + }); +} diff --git a/examples/resources/architectural_overview/lib/ffi.dart b/examples/resources/architectural_overview/lib/ffi.dart index dbce010a55..d09005cbeb 100644 --- a/examples/resources/architectural_overview/lib/ffi.dart +++ b/examples/resources/architectural_overview/lib/ffi.dart @@ -30,4 +30,4 @@ void exampleFfi() { 0, // OK button only ); } -// #enddocregion FFI \ No newline at end of file +// #enddocregion FFI diff --git a/examples/resources/architectural_overview/lib/main.dart b/examples/resources/architectural_overview/lib/main.dart index a55271daa7..fd8aac4ee2 100644 --- a/examples/resources/architectural_overview/lib/main.dart +++ b/examples/resources/architectural_overview/lib/main.dart @@ -44,7 +44,7 @@ void containerExample(BuildContext context) { color: Theme.of(context).secondaryHeaderColor, child: Text( 'Text with a background color', - style: Theme.of(context).textTheme.headline6, + style: Theme.of(context).textTheme.titleLarge, ), ); // #enddocregion Container diff --git a/examples/testing/common_errors/lib/renderflex_overflow.dart b/examples/testing/common_errors/lib/renderflex_overflow.dart index 0487454ea4..c8fa07bd90 100644 --- a/examples/testing/common_errors/lib/renderflex_overflow.dart +++ b/examples/testing/common_errors/lib/renderflex_overflow.dart @@ -13,7 +13,7 @@ class ProblemWidget extends StatelessWidget { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('Title', style: Theme.of(context).textTheme.headline4), + Text('Title', style: Theme.of(context).textTheme.headlineMedium), const Text( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed' ' do eiusmod tempor incididunt ut labore et dolore magna ' diff --git a/examples/ui/widgets_intro/lib/main_myappbar.dart b/examples/ui/widgets_intro/lib/main_myappbar.dart index 575698e12d..af89c89f79 100644 --- a/examples/ui/widgets_intro/lib/main_myappbar.dart +++ b/examples/ui/widgets_intro/lib/main_myappbar.dart @@ -53,7 +53,7 @@ class MyScaffold extends StatelessWidget { 'Example title', style: Theme.of(context) // .primaryTextTheme - .headline6, + .titleLarge, ), ), const Expanded( diff --git a/flutter b/flutter index 135454af32..b06b8b2710 160000 --- a/flutter +++ b/flutter @@ -1 +1 @@ -Subproject commit 135454af32477f815a7525073027a3ff9eff1bfd +Subproject commit b06b8b2710955028a6b562f5aa6fe62941d6febf diff --git a/pubspec.yaml b/pubspec.yaml index e150915568..c9e7b4fe59 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -9,4 +9,5 @@ dev_dependencies: path: site-shared/packages/code_excerpt_updater code_excerpter: path: site-shared/packages/code_excerpter - linkcheck: ^2.0.19 + linkcheck: ^3.0.0 + path: ^1.8.3 diff --git a/site-shared b/site-shared index faddba841c..04233ee5f5 160000 --- a/site-shared +++ b/site-shared @@ -1 +1 @@ -Subproject commit faddba841c6e052136a74f842efa38eb723120db +Subproject commit 04233ee5f5d53c0bf6189e6c687f411a6dcd927a diff --git a/src/_data/catalog/widgets.json b/src/_data/catalog/widgets.json index 86335e57cb..60147befa0 100644 --- a/src/_data/catalog/widgets.json +++ b/src/_data/catalog/widgets.json @@ -607,6 +607,26 @@ "link": "https://api.flutter.dev/flutter/cupertino/CupertinoTextField-class.html", "image": "" }, + { + "name": "CupertinoListSection", + "description": "An iOS-style container for a scrollable view.", + "categories": [ + "Cupertino (iOS-style widgets)" + ], + "subcategories": [], + "link": "https://api.flutter.dev/flutter/cupertino/CupertinoListSection-class.html", + "image": "" + }, + { + "name": "CupertinoListTile", + "description": "An iOS-style tile that makes up a row in a list.", + "categories": [ + "Cupertino (iOS-style widgets)" + ], + "subcategories": [], + "link": "https://api.flutter.dev/flutter/cupertino/CupertinoListTile-class.html", + "image": "" + }, { "name": "CupertinoTimerPicker", "description": "An iOS-style countdown timer picker.", diff --git a/src/_data/sidenav.yml b/src/_data/sidenav.yml index c1f7732e09..3db8a51f55 100644 --- a/src/_data/sidenav.yml +++ b/src/_data/sidenav.yml @@ -218,6 +218,8 @@ permalink: /development/platform-integration/windows/run-loop-migration - title: Version information migration permalink: /development/platform-integration/windows/version-migration + - title: Dark mode migration + permalink: /development/platform-integration/windows/dark-mode-migration - title: Packages & plugins permalink: /development/packages-and-plugins children: @@ -441,6 +443,8 @@ permalink: https://flutter.dev/brand - title: Platform adaptations permalink: /resources/platform-adaptations + - title: Security false positives **NEW** + permalink: /resources/security-false-positives - title: Videos and online courses permalink: /resources/videos diff --git a/src/_includes/banner.html b/src/_includes/banner.html index b590c5cd78..b7c3557173 100644 --- a/src/_includes/banner.html +++ b/src/_includes/banner.html @@ -2,9 +2,8 @@ For headings use

elements. {% endcomment -%}