diff --git a/dev/bots/docs.sh b/dev/bots/docs.sh index 21fed4fd7e..e82ed0b1a4 100755 --- a/dev/bots/docs.sh +++ b/dev/bots/docs.sh @@ -115,8 +115,8 @@ function generate_docs() { # Install and activate the snippets tool, which resides in the # assets-for-api-docs repo: - # https://github.com/flutter/assets-for-api-docs/tree/master/packages/snippets - "$DART" pub global activate snippets 0.4.2 + # https://github.com/flutter/assets-for-api-docs/tree/main/packages/snippets + "$DART" pub global activate snippets 0.4.3 # This script generates a unified doc set, and creates # a custom index.html, placing everything into DOC_DIR. diff --git a/dev/docs/README.md b/dev/docs/README.md index 097097fd1a..29ad418d67 100644 --- a/dev/docs/README.md +++ b/dev/docs/README.md @@ -25,7 +25,7 @@ the following locations: * [Web Embedder](dart-ui_web/dart-ui_web-library.html) * [Installation](https://flutter.dev/docs/get-started/install) * [Codelabs](https://flutter.dev/docs/codelabs) -* [Contributing to Flutter](https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md) +* [Contributing to Flutter](https://github.com/flutter/flutter/blob/main/CONTRIBUTING.md) ## Offline Documentation diff --git a/dev/tools/create_api_docs.dart b/dev/tools/create_api_docs.dart index 959b5c6d34..91a1b8f843 100644 --- a/dev/tools/create_api_docs.dart +++ b/dev/tools/create_api_docs.dart @@ -277,9 +277,13 @@ class Configurator { void _createPageFooter(Directory footerPath, Version version) { final String timestamp = DateFormat('yyyy-MM-dd HH:mm').format(DateTime.now()); - final String gitBranch = FlutterInformation.instance.getBranchName(); + String channel = FlutterInformation.instance.getBranchName(); + // Backward compatibility: Still support running on "master", but pretend it is "main". + if (channel == 'master') { + channel = 'main'; + } final String gitRevision = FlutterInformation.instance.getFlutterRevision(); - final String gitBranchOut = gitBranch.isEmpty ? '' : '• $gitBranch'; + final String channelOut = channel.isEmpty ? '' : '• $channel'; footerPath.childFile('footer.html').writeAsStringSync(''); publishRoot.childDirectory('flutter').childFile('footer.js') ..createSync(recursive: true) @@ -287,11 +291,11 @@ class Configurator { (function() { var span = document.querySelector('footer>span'); if (span) { - span.innerText = 'Flutter $version • $timestamp • $gitRevision $gitBranchOut'; + span.innerText = 'Flutter $version • $timestamp • $gitRevision $channelOut'; } var sourceLink = document.querySelector('a.source-link'); if (sourceLink) { - sourceLink.href = sourceLink.href.replace('/master/', '/$gitRevision/'); + sourceLink.href = sourceLink.href.replace('/main/', '/$gitRevision/'); } })(); '''); @@ -568,7 +572,7 @@ class DartdocGenerator { '--link-to-source-root', flutterRoot.path, '--link-to-source-uri-template', - 'https://github.com/flutter/flutter/blob/master/%f%#L%l%', + 'https://github.com/flutter/flutter/blob/main/%f%#L%l%', '--inject-html', '--use-base-href', '--header', diff --git a/dev/tools/test/create_api_docs_test.dart b/dev/tools/test/create_api_docs_test.dart index 560eaef590..77c3ae4944 100644 --- a/dev/tools/test/create_api_docs_test.dart +++ b/dev/tools/test/create_api_docs_test.dart @@ -288,7 +288,7 @@ void main() { '--link-to-source-root', '/flutter', '--link-to-source-uri-template', - 'https://github.com/flutter/flutter/blob/master/%f%#L%l%', + 'https://github.com/flutter/flutter/blob/main/%f%#L%l%', '--inject-html', '--use-base-href', '--header', @@ -372,7 +372,7 @@ void main() { '--link-to-source-root', '/flutter', '--link-to-source-uri-template', - 'https://github.com/flutter/flutter/blob/master/%f%#L%l%', + 'https://github.com/flutter/flutter/blob/main/%f%#L%l%', '--inject-html', '--use-base-href', '--header', diff --git a/packages/flutter/lib/animation.dart b/packages/flutter/lib/animation.dart index 5df986c1e1..cbff9fdceb 100644 --- a/packages/flutter/lib/animation.dart +++ b/packages/flutter/lib/animation.dart @@ -152,7 +152,7 @@ /// on flutter.dev. /// * [Animations tutorial](https://flutter.dev/docs/development/ui/animations/tutorial) /// on flutter.dev. -/// * [Sample app](https://github.com/flutter/samples/tree/master/animations), +/// * [Sample app](https://github.com/flutter/samples/tree/main/animations), /// which showcases Flutter's animation features. /// * [ImplicitlyAnimatedWidget] and its subclasses, which are [Widget]s that /// implicitly animate changes to their properties. diff --git a/packages/flutter/lib/src/cupertino/icons.dart b/packages/flutter/lib/src/cupertino/icons.dart index 9d9eda6210..747e5d8cf0 100644 --- a/packages/flutter/lib/src/cupertino/icons.dart +++ b/packages/flutter/lib/src/cupertino/icons.dart @@ -54,7 +54,7 @@ import 'package:flutter/widgets.dart'; /// ``` /// {@end-tool} /// -/// For versions 0.1.3 and below, see this [glyph map](https://raw.githubusercontent.com/flutter/packages/master/third_party/packages/cupertino_icons/map.png). +/// For versions 0.1.3 and below, see this [glyph map](https://raw.githubusercontent.com/flutter/packages/main/third_party/packages/cupertino_icons/map.png). /// /// See also: /// diff --git a/packages/flutter/lib/src/material/navigation_rail.dart b/packages/flutter/lib/src/material/navigation_rail.dart index cb86709e8c..4b4a44d12f 100644 --- a/packages/flutter/lib/src/material/navigation_rail.dart +++ b/packages/flutter/lib/src/material/navigation_rail.dart @@ -39,7 +39,7 @@ const double _kIndicatorHeight = 32; /// Adaptive layouts can build different instances of the [Scaffold] in order to /// have a navigation rail for more horizontal layouts and a bottom navigation /// bar for more vertical layouts. See -/// [the adaptive_scaffold.dart sample](https://github.com/flutter/samples/blob/master/experimental/web_dashboard/lib/src/widgets/third_party/adaptive_scaffold.dart) +/// [the adaptive_scaffold.dart sample](https://github.com/flutter/samples/blob/main/experimental/web_dashboard/lib/src/widgets/third_party/adaptive_scaffold.dart) /// for an example. /// /// {@tool dartpad} diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index 343388d031..6dba29d498 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -274,7 +274,7 @@ class Directionality extends _UbiquitousInheritedWidget { /// /// ```dart /// Image.network( -/// 'https://raw.githubusercontent.com/flutter/assets-for-api-docs/master/packages/diagrams/assets/blend_mode_destination.jpeg', +/// 'https://raw.githubusercontent.com/flutter/assets-for-api-docs/main/packages/diagrams/assets/blend_mode_destination.jpeg', /// color: const Color.fromRGBO(255, 255, 255, 0.5), /// colorBlendMode: BlendMode.modulate /// ) diff --git a/packages/flutter/lib/src/widgets/interactive_viewer.dart b/packages/flutter/lib/src/widgets/interactive_viewer.dart index 818ab5851a..f6d3071100 100644 --- a/packages/flutter/lib/src/widgets/interactive_viewer.dart +++ b/packages/flutter/lib/src/widgets/interactive_viewer.dart @@ -45,7 +45,7 @@ typedef InteractiveViewerWidgetBuilder = Widget Function(BuildContext context, Q /// size of the area that should be interactive. /// /// See also: -/// * The [Flutter Gallery's transformations demo](https://github.com/flutter/gallery/blob/master/lib/demos/reference/transformations_demo.dart), +/// * The [Flutter Gallery's transformations demo](https://github.com/flutter/gallery/blob/main/lib/demos/reference/transformations_demo.dart), /// which includes the use of InteractiveViewer. /// * The [flutter-go demo](https://github.com/justinmc/flutter-go), which includes robust positioning of an InteractiveViewer child /// that works for all screen sizes and child sizes.