[
+ publishRoot.childDirectory('assets').childFile('overrides.css'),
+ flutterDirectory.childDirectory('dart-io').childFile('File-class.html'),
+ flutterDirectory.childDirectory('dart-ui').childFile('Canvas-class.html'),
+ flutterDirectory.childDirectory('dart-ui').childDirectory('Canvas').childFile('drawRect.html'),
+ flutterDirectory
+ .childDirectory('flutter_driver')
+ .childDirectory('FlutterDriver')
+ .childFile('FlutterDriver.connectedTo.html'),
+ flutterDirectory.childDirectory('flutter_test').childDirectory('WidgetTester').childFile('pumpWidget.html'),
+ flutterDirectory.childDirectory('material').childFile('Material-class.html'),
+ flutterDirectory.childDirectory('material').childFile('Tooltip-class.html'),
+ widgetsDirectory.childFile('Widget-class.html'),
+ widgetsDirectory.childFile('Listener-class.html'),
+ ];
+ for (final File canary in canaries) {
+ if (!canary.existsSync()) {
+ throw Exception('Missing "${canary.path}", which probably means the documentation failed to build correctly.');
+ }
+ }
+ // Make sure at least one example of each kind includes source code.
+
+ // Check a "sample" example, any one will do.
+ _sanityCheckExample(
+ widgetsDirectory.childFile('showGeneralDialog.html').path,
+ r'\s*\s*import 'package:flutter/material.dart';',
+ );
+
+ // Check a "snippet" example, any one will do.
+ _sanityCheckExample(
+ widgetsDirectory.childDirectory('ModalRoute').childFile('barrierColor.html').path,
+ r'\s*.*Color\s+get\s+barrierColor.*
',
+ );
+
+ // Check a "dartpad" example, any one will do, and check for the correct URL
+ // arguments.
+ // Just use "master" for any branch other than the LUCI_BRANCH.
+ final String? luciBranch = platform.environment['LUCI_BRANCH']?.trim();
+ final String expectedBranch = luciBranch != null && luciBranch.isNotEmpty ? luciBranch : 'master';
+ final List argumentRegExps = [
+ r'split=\d+',
+ r'run=true',
+ r'sample_id=widgets\.Listener\.\d+',
+ 'sample_channel=$expectedBranch',
+ 'channel=$expectedBranch',
+ ];
+ for (final String argumentRegExp in argumentRegExps) {
+ _sanityCheckExample(
+ widgetsDirectory.childFile('Listener-class.html').path,
+ r'\s*