more UI-as-code (#35516)

This commit is contained in:
Alexandre Ardhuin
2019-09-17 16:23:44 +02:00
committed by GitHub
parent d03aecab58
commit df4bf453ab
117 changed files with 1728 additions and 2132 deletions

View File

@@ -108,11 +108,12 @@ Future<void> main(List<String> arguments) async {
createSearchMetadata('$kDocsRoot/lib/opensearch.xml', '$kDocsRoot/doc/opensearch.xml');
cleanOutSnippets();
final List<String> dartdocBaseArgs = <String>['global', 'run'];
if (args['checked']) {
dartdocBaseArgs.add('-c');
}
dartdocBaseArgs.add('dartdoc');
final List<String> dartdocBaseArgs = <String>[
'global',
'run',
if (args['checked']) '-c',
'dartdoc',
];
// Verify which version of dartdoc we're using.
final ProcessResult result = Process.runSync(
@@ -123,24 +124,17 @@ Future<void> main(List<String> arguments) async {
);
print('\n${result.stdout}flutter version: $version\n');
dartdocBaseArgs.add('--allow-tools');
if (args['json']) {
dartdocBaseArgs.add('--json');
}
if (args['validate-links']) {
dartdocBaseArgs.add('--validate-links');
} else {
dartdocBaseArgs.add('--no-validate-links');
}
dartdocBaseArgs.addAll(<String>['--link-to-source-excludes', '../../bin/cache',
'--link-to-source-root', '../..',
'--link-to-source-uri-template', 'https://github.com/flutter/flutter/blob/master/%f%#L%l%']);
// Generate the documentation.
// We don't need to exclude flutter_tools in this list because it's not in the
// recursive dependencies of the package defined at dev/docs/pubspec.yaml
final List<String> dartdocArgs = <String>[
...dartdocBaseArgs,
'--allow-tools',
if (args['json']) '--json',
if (args['validate-links']) '--validate-links' else '--no-validate-links',
'--link-to-source-excludes', '../../bin/cache',
'--link-to-source-root', '../..',
'--link-to-source-uri-template', 'https://github.com/flutter/flutter/blob/master/%f%#L%l%',
'--inject-html',
'--header', 'styles.html',
'--header', 'analytics.html',

View File

@@ -52,10 +52,9 @@ class KeyData {
/// Parses the given JSON data and populates the data structure from it.
KeyData.fromJson(Map<String, dynamic> contentMap) {
data = <Key>[];
for (String key in contentMap.keys) {
data.add(Key.fromJsonMapEntry(key, contentMap[key]));
}
data = <Key>[
for (String key in contentMap.keys) Key.fromJsonMapEntry(key, contentMap[key]),
];
}
/// Converts the data structure into a JSON structure that can be parsed by

View File

@@ -3,7 +3,7 @@ description: Generates keycode source files from various resources.
environment:
# The pub client defaults to an <2.0.0 sdk constraint which we need to explicitly overwrite.
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.2.2 <3.0.0"
dependencies:
args: 1.5.2

View File

@@ -64,11 +64,9 @@ void main(List<String> args) {
return;
}
final List<FrameData> frames = <FrameData>[];
for (String filePath in argResults.rest) {
final FrameData data = interpretSvg(filePath);
frames.add(data);
}
final List<FrameData> frames = <FrameData>[
for (String filePath in argResults.rest) interpretSvg(filePath),
];
final StringBuffer generatedSb = StringBuffer();

View File

@@ -6,7 +6,7 @@ author: Flutter Authors <flutter-dev@googlegroups.com>
environment:
# The pub client defaults to an <2.0.0 sdk constraint which we need to explicitly overwrite.
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.2.2 <3.0.0"
dependencies:
args: 1.5.2