Add info strings to code blocks. (#146085)
In preparation to add the lint `missing_code_block_language_in_doc_comment`, added info strings to a bunch of fenced code blocks. Related to issue: https://github.com/dart-lang/linter/issues/4904 ## Pre-launch Checklist - [X] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [X] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [X] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [X] I signed the [CLA]. - [X] I listed at least one issue that this PR fixes in the description above. - [X] I updated/added relevant documentation (doc comments with `///`). - [X] I added new tests to check the change I am making, or this PR is [test-exempt]. - [X] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [X] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat [Data Driven Fixes]: https://github.com/flutter/flutter/wiki/Data-driven-Fixes
This commit is contained in:
parent
5850651d60
commit
9fd9f042fc
@ -164,7 +164,7 @@ abstract class Recorder {
|
|||||||
///
|
///
|
||||||
/// Example:
|
/// Example:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```dart
|
||||||
/// class BenchForLoop extends RawRecorder {
|
/// class BenchForLoop extends RawRecorder {
|
||||||
/// BenchForLoop() : super(name: benchmarkName);
|
/// BenchForLoop() : super(name: benchmarkName);
|
||||||
///
|
///
|
||||||
@ -219,7 +219,7 @@ abstract class RawRecorder extends Recorder {
|
|||||||
///
|
///
|
||||||
/// Example:
|
/// Example:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```dart
|
||||||
/// class BenchDrawCircle extends SceneBuilderRecorder {
|
/// class BenchDrawCircle extends SceneBuilderRecorder {
|
||||||
/// BenchDrawCircle() : super(name: benchmarkName);
|
/// BenchDrawCircle() : super(name: benchmarkName);
|
||||||
///
|
///
|
||||||
@ -311,7 +311,7 @@ abstract class SceneBuilderRecorder extends Recorder {
|
|||||||
///
|
///
|
||||||
/// Example:
|
/// Example:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```dart
|
||||||
/// class BenchListView extends WidgetRecorder {
|
/// class BenchListView extends WidgetRecorder {
|
||||||
/// BenchListView() : super(name: benchmarkName);
|
/// BenchListView() : super(name: benchmarkName);
|
||||||
///
|
///
|
||||||
|
@ -21,7 +21,7 @@ import 'stock_strings_es.dart';
|
|||||||
/// localizationDelegates list, and the locales they support in the app's
|
/// localizationDelegates list, and the locales they support in the app's
|
||||||
/// supportedLocales list. For example:
|
/// supportedLocales list. For example:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```dart
|
||||||
/// import 'i18n/stock_strings.dart';
|
/// import 'i18n/stock_strings.dart';
|
||||||
///
|
///
|
||||||
/// return MaterialApp(
|
/// return MaterialApp(
|
||||||
@ -36,7 +36,7 @@ import 'stock_strings_es.dart';
|
|||||||
/// Please make sure to update your pubspec.yaml to include the following
|
/// Please make sure to update your pubspec.yaml to include the following
|
||||||
/// packages:
|
/// packages:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```yaml
|
||||||
/// dependencies:
|
/// dependencies:
|
||||||
/// # Internationalization support.
|
/// # Internationalization support.
|
||||||
/// flutter_localizations:
|
/// flutter_localizations:
|
||||||
|
@ -426,7 +426,7 @@ class BlinkTraceEvent {
|
|||||||
///
|
///
|
||||||
/// Sample event encoded as JSON (the data is bogus, this just shows the format):
|
/// Sample event encoded as JSON (the data is bogus, this just shows the format):
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```json
|
||||||
/// {
|
/// {
|
||||||
/// "name": "myName",
|
/// "name": "myName",
|
||||||
/// "cat": "category,list",
|
/// "cat": "category,list",
|
||||||
|
@ -41,7 +41,7 @@ const List<String> dartdocDirectiveCanaryFiles = <String>[
|
|||||||
/// sample code where the sequence is perfectly legal, e.g. for required named
|
/// sample code where the sequence is perfectly legal, e.g. for required named
|
||||||
/// parameters of a method:
|
/// parameters of a method:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```dart
|
||||||
/// void foo({@required int bar});
|
/// void foo({@required int bar});
|
||||||
/// ```
|
/// ```
|
||||||
void checkForUnresolvedDirectives(Directory dartDocDir) {
|
void checkForUnresolvedDirectives(Directory dartDocDir) {
|
||||||
|
@ -31,14 +31,14 @@ String? currentLocale;
|
|||||||
///
|
///
|
||||||
/// The following outputs the generated Dart code to the console as a dry run:
|
/// The following outputs the generated Dart code to the console as a dry run:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```bash
|
||||||
/// dart dev/tools/localization/bin/gen_date_localizations.dart
|
/// dart dev/tools/localization/bin/gen_date_localizations.dart
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// If the data looks good, use the `--overwrite` option to overwrite the
|
/// If the data looks good, use the `--overwrite` option to overwrite the
|
||||||
/// lib/src/l10n/date_localizations.dart file:
|
/// lib/src/l10n/date_localizations.dart file:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```bash
|
||||||
/// dart dev/tools/localization/bin/gen_date_localizations.dart --overwrite
|
/// dart dev/tools/localization/bin/gen_date_localizations.dart --overwrite
|
||||||
/// ```
|
/// ```
|
||||||
Future<void> main(List<String> rawArgs) async {
|
Future<void> main(List<String> rawArgs) async {
|
||||||
|
@ -31,7 +31,7 @@ import 'dart:async';
|
|||||||
/// Rationale:
|
/// Rationale:
|
||||||
///
|
///
|
||||||
/// Consider the following snippet:
|
/// Consider the following snippet:
|
||||||
/// ```
|
/// ```dart
|
||||||
/// try {
|
/// try {
|
||||||
/// await foo();
|
/// await foo();
|
||||||
/// ...
|
/// ...
|
||||||
@ -55,7 +55,7 @@ import 'dart:async';
|
|||||||
/// [asyncGuard] is intended to wrap awaited expressions occurring in a `try`
|
/// [asyncGuard] is intended to wrap awaited expressions occurring in a `try`
|
||||||
/// block. The behavior described above gives the behavior that users
|
/// block. The behavior described above gives the behavior that users
|
||||||
/// intuitively expect from `await`. Consider the snippet:
|
/// intuitively expect from `await`. Consider the snippet:
|
||||||
/// ```
|
/// ```dart
|
||||||
/// try {
|
/// try {
|
||||||
/// await asyncGuard(() async {
|
/// await asyncGuard(() async {
|
||||||
/// var c = Completer();
|
/// var c = Completer();
|
||||||
|
@ -40,19 +40,19 @@ import '../vmservice.dart';
|
|||||||
///
|
///
|
||||||
/// With an application already running, a HotRunner can be attached to it
|
/// With an application already running, a HotRunner can be attached to it
|
||||||
/// with:
|
/// with:
|
||||||
/// ```
|
/// ```bash
|
||||||
/// $ flutter attach --debug-url http://127.0.0.1:12345/QqL7EFEDNG0=/
|
/// $ flutter attach --debug-url http://127.0.0.1:12345/QqL7EFEDNG0=/
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// If `--disable-service-auth-codes` was provided to the application at startup
|
/// If `--disable-service-auth-codes` was provided to the application at startup
|
||||||
/// time, a HotRunner can be attached with just a port:
|
/// time, a HotRunner can be attached with just a port:
|
||||||
/// ```
|
/// ```bash
|
||||||
/// $ flutter attach --debug-port 12345
|
/// $ flutter attach --debug-port 12345
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// Alternatively, the attach command can start listening and scan for new
|
/// Alternatively, the attach command can start listening and scan for new
|
||||||
/// programs that become active:
|
/// programs that become active:
|
||||||
/// ```
|
/// ```bash
|
||||||
/// $ flutter attach
|
/// $ flutter attach
|
||||||
/// ```
|
/// ```
|
||||||
/// As soon as a new VM Service is detected the command attaches to it and
|
/// As soon as a new VM Service is detected the command attaches to it and
|
||||||
|
@ -692,7 +692,7 @@ class LocalizationsGenerator {
|
|||||||
/// Whether to generate the Dart localization methods with named parameters.
|
/// Whether to generate the Dart localization methods with named parameters.
|
||||||
///
|
///
|
||||||
/// If this sets to true, the generated Dart localization methods will be:
|
/// If this sets to true, the generated Dart localization methods will be:
|
||||||
/// ```
|
/// ```dart
|
||||||
/// String helloWorld({required String name});
|
/// String helloWorld({required String name});
|
||||||
/// ```
|
/// ```
|
||||||
final bool useNamedParameters;
|
final bool useNamedParameters;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user