text
stringlengths 6
13.6M
| id
stringlengths 13
176
| metadata
dict | __index_level_0__
int64 0
1.69k
|
---|---|---|---|
/*
* Copyright 2019 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
package io.flutter.vmService;
import java.util.List;
public class ServiceExtensionDescription<T> {
private final String extension;
private final String description;
private final List<T> values;
private final List<String> tooltips;
public ServiceExtensionDescription(String extension, String description, List<T> values, List<String> tooltips) {
this.extension = extension;
this.description = description;
this.values = values;
this.tooltips = tooltips;
}
public String getExtension() {
return extension;
}
public String getDescription() {
return description;
}
public List<T> getValues() {
return values;
}
public List<String> getTooltips() {
return tooltips;
}
public Class<?> getValueClass() {
return values.get(0).getClass();
}
}
| flutter-intellij/flutter-idea/src/io/flutter/vmService/ServiceExtensionDescription.java/0 | {
"file_path": "flutter-intellij/flutter-idea/src/io/flutter/vmService/ServiceExtensionDescription.java",
"repo_id": "flutter-intellij",
"token_count": 296
} | 454 |
/*
* Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
* for details. All rights reserved. Use of this source code is governed by a
* BSD-style license that can be found in the LICENSE file.
*
* This file has been automatically generated. Please do not edit it manually.
* To regenerate the file, use the script "pkg/analysis_server/tool/spec/generate_files".
*/
package org.dartlang.analysis.server.protocol;
import com.google.common.collect.Lists;
import com.google.dart.server.utilities.general.ObjectUtilities;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* @coverage dart.server.generated.types
*/
@SuppressWarnings("unused")
public class ExtractWidgetOptions extends RefactoringOptions {
public static final ExtractWidgetOptions[] EMPTY_ARRAY = new ExtractWidgetOptions[0];
public static final List<ExtractWidgetOptions> EMPTY_LIST = Lists.newArrayList();
/**
* The name that the widget class should be given.
*/
private String name;
/**
* Constructor for {@link ExtractWidgetOptions}.
*/
public ExtractWidgetOptions(String name) {
this.name = name;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof ExtractWidgetOptions) {
ExtractWidgetOptions other = (ExtractWidgetOptions)obj;
return
ObjectUtilities.equals(other.name, name);
}
return false;
}
public static ExtractWidgetOptions fromJson(JsonObject jsonObject) {
String name = jsonObject.get("name").getAsString();
return new ExtractWidgetOptions(name);
}
public static List<ExtractWidgetOptions> fromJsonArray(JsonArray jsonArray) {
if (jsonArray == null) {
return EMPTY_LIST;
}
ArrayList<ExtractWidgetOptions> list = new ArrayList<ExtractWidgetOptions>(jsonArray.size());
Iterator<JsonElement> iterator = jsonArray.iterator();
while (iterator.hasNext()) {
list.add(fromJson(iterator.next().getAsJsonObject()));
}
return list;
}
/**
* The name that the widget class should be given.
*/
public String getName() {
return name;
}
@Override
public int hashCode() {
HashCodeBuilder builder = new HashCodeBuilder();
builder.append(name);
return builder.toHashCode();
}
/**
* The name that the widget class should be given.
*/
public void setName(String name) {
this.name = name;
}
public JsonObject toJson() {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("name", name);
return jsonObject;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("[");
builder.append("name=");
builder.append(name);
builder.append("]");
return builder.toString();
}
}
| flutter-intellij/flutter-idea/src/org/dartlang/analysis/server/protocol/ExtractWidgetOptions.java/0 | {
"file_path": "flutter-intellij/flutter-idea/src/org/dartlang/analysis/server/protocol/ExtractWidgetOptions.java",
"repo_id": "flutter-intellij",
"token_count": 947
} | 455 |
name: sample_tests
description: Sample tests used as test data for the Flutter IntelliJ plugin.
version: 0.0.1
environment:
sdk: '>=3.0.0-0.0.dev <4.0.0'
dev_dependencies:
lints: ^2.0.0
meta: any
test: ^1.17.0
| flutter-intellij/flutter-idea/testData/sample_tests/pubspec.yaml/0 | {
"file_path": "flutter-intellij/flutter-idea/testData/sample_tests/pubspec.yaml",
"repo_id": "flutter-intellij",
"token_count": 95
} | 456 |
/*
* Copyright 2017 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
package io.flutter;
import org.junit.Test;
import static io.flutter.FlutterUtils.isValidDartIdentifier;
import static io.flutter.FlutterUtils.isValidPackageName;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class FlutterUtilsTest {
@Test
public void validIdentifier() {
final String[] validIds = {"a", "_", "abc", "_abc", "a_bc", "abc$", "$", "$$", "$_$"};
for (String id : validIds) {
assertTrue("expected " + id + " to be valid", isValidDartIdentifier(id));
}
final String[] invalidIds = {"1", "1a", "a-bc", "a.b"};
for (String id : invalidIds) {
assertFalse("expected " + id + " to be invalid", isValidDartIdentifier(id));
}
}
@Test
public void validPackageNames() {
final String[] validNames = {"a", "a_b_c", "abc", "a_long_module_name_that_is_legal"};
for (String name : validNames) {
assertTrue("expected " + name + " to be valid", isValidPackageName(name));
}
final String[] invalidNames = {"_", "_a", "a_", "A", "Abc", "A_bc", "a_long_module_name_that_is_illegal_"};
for (String name : invalidNames) {
assertFalse("expected " + name + " to be invalid", isValidPackageName(name));
}
}
}
| flutter-intellij/flutter-idea/testSrc/unit/io/flutter/FlutterUtilsTest.java/0 | {
"file_path": "flutter-intellij/flutter-idea/testSrc/unit/io/flutter/FlutterUtilsTest.java",
"repo_id": "flutter-intellij",
"token_count": 514
} | 457 |
/*
* Copyright 2021 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
package io.flutter.editor;
import com.intellij.psi.PsiElement;
import com.intellij.psi.impl.source.tree.LeafPsiElement;
import com.jetbrains.lang.dart.psi.DartCallExpression;
import com.jetbrains.lang.dart.psi.DartNewExpression;
import com.jetbrains.lang.dart.psi.DartReferenceExpression;
import io.flutter.AbstractDartElementTest;
import io.flutter.dart.DartSyntax;
import org.junit.Test;
import java.awt.*;
import static org.junit.Assert.assertNotNull;
public class FlutterColorProviderTest extends AbstractDartElementTest {
@Test
public void locatesColorReference() throws Exception {
run(() -> {
final PsiElement testIdentifier = setUpDartElement("main() { Colors.blue; }", "Colors", LeafPsiElement.class);
final Color color = new FlutterColorProvider().getColorFrom(testIdentifier);
assertNotNull(color);
final DartReferenceExpression element = DartSyntax.findEnclosingReferenceExpression(testIdentifier);
assertNotNull(element);
});
}
@Test
public void locatesColorCtor() throws Exception {
run(() -> {
final PsiElement testIdentifier = setUpDartElement("main() { Color(0xFFE3F2FD); }", "Color", LeafPsiElement.class);
final Color color = new FlutterColorProvider().getColorFrom(testIdentifier);
assertNotNull(color);
final DartCallExpression element = DartSyntax.findEnclosingFunctionCall(testIdentifier, "Color");
assertNotNull(element);
});
}
@Test
public void locatesConstColorCtor() throws Exception {
run(() -> {
final PsiElement testIdentifier = setUpDartElement("main() { const Color(0xFFE3F2FD); }", "Color", LeafPsiElement.class);
final Color color = new FlutterColorProvider().getColorFrom(testIdentifier);
assertNotNull(color);
final DartNewExpression element = DartSyntax.findEnclosingNewExpression(testIdentifier);
assertNotNull(element);
});
}
@Test
public void locatesConstColorArray() throws Exception {
run(() -> {
final PsiElement testIdentifier = setUpDartElement("main() { const [Color(0xFFE3F2FD)]; }", "Color", LeafPsiElement.class);
final Color color = new FlutterColorProvider().getColorFrom(testIdentifier);
assertNotNull(color);
final DartCallExpression element = DartSyntax.findEnclosingFunctionCall(testIdentifier, "Color");
assertNotNull(element);
});
}
@Test
public void locatesConstColorWhitespace() throws Exception {
run(() -> {
final PsiElement testIdentifier = setUpDartElement("main() { const Color( 0xFFE3F2FD); }", "Color", LeafPsiElement.class);
final Color color = new FlutterColorProvider().getColorFrom(testIdentifier);
assertNotNull(color);
final DartNewExpression element = DartSyntax.findEnclosingNewExpression(testIdentifier);
assertNotNull(element);
});
}
@Test
public void locatesConstARGBColor() throws Exception {
run(() -> {
final PsiElement testIdentifier = setUpDartElement("main() { const Color.fromARGB(255, 255, 0, 0); }", "Color", LeafPsiElement.class);
final Color color = new FlutterColorProvider().getColorFrom(testIdentifier);
assertNotNull(color);
final DartNewExpression element = DartSyntax.findEnclosingNewExpression(testIdentifier);
assertNotNull(element);
});
}
@Test
public void locatesARGBColor() throws Exception {
run(() -> {
final PsiElement testIdentifier = setUpDartElement("main() { Color.fromARGB(255, 255, 0, 0); }", "Color", LeafPsiElement.class);
final Color color = new FlutterColorProvider().getColorFrom(testIdentifier);
assertNotNull(color);
final DartCallExpression element = DartSyntax.findEnclosingFunctionCall(testIdentifier, "Color.fromARGB");
assertNotNull(element);
});
}
@Test
public void locatesConstRGBOColor() throws Exception {
run(() -> {
final PsiElement testIdentifier = setUpDartElement("main() { const Color.fromRGBO(255, 0, 0, 1.0); }", "Color", LeafPsiElement.class);
final Color color = new FlutterColorProvider().getColorFrom(testIdentifier);
assertNotNull(color);
final DartNewExpression element = DartSyntax.findEnclosingNewExpression(testIdentifier);
assertNotNull(element);
});
}
@Test
public void locatesRGBOColor() throws Exception {
run(() -> {
final PsiElement testIdentifier = setUpDartElement("main() { Color.fromRGBO(255, 255, 0, 1.0); }", "Color", LeafPsiElement.class);
final Color color = new FlutterColorProvider().getColorFrom(testIdentifier);
assertNotNull(color);
final DartCallExpression element = DartSyntax.findEnclosingFunctionCall(testIdentifier, "Color.fromRGBO");
assertNotNull(element);
});
}
@Test
public void locatesColorShadeReference() throws Exception {
run(() -> {
final PsiElement testIdentifier = setUpDartElement("main() { Colors.blue.shade700; }", "shade700", LeafPsiElement.class);
final Color color = new FlutterColorProvider().getColorFrom(testIdentifier);
assertNotNull(color);
final DartReferenceExpression element = DartSyntax.findEnclosingReferenceExpression(testIdentifier);
assertNotNull(element);
});
}
@Test
public void locatesColorArrayReference() throws Exception {
run(() -> {
final PsiElement testIdentifier = setUpDartElement("main() { Colors.blue[200]; }", "blue", LeafPsiElement.class);
final Color color = new FlutterColorProvider().getColorFrom(testIdentifier);
assertNotNull(color);
final DartReferenceExpression element = DartSyntax.findEnclosingReferenceExpression(testIdentifier);
assertNotNull(element);
});
}
@Test
public void locatesCuppertinoColorReference() throws Exception {
run(() -> {
final PsiElement testIdentifier = setUpDartElement("main() { CupertinoColors.systemGreen; }", "CupertinoColors", LeafPsiElement.class);
final Color color = new FlutterColorProvider().getColorFrom(testIdentifier);
assertNotNull(color);
final DartReferenceExpression element = DartSyntax.findEnclosingReferenceExpression(testIdentifier);
assertNotNull(element);
});
}
@Test
public void locatesColorReferenceWithComment() throws Exception {
run(() -> {
final PsiElement testIdentifier = setUpDartElement("main() { Colors . blue . /* darkish */ shade700; }", "shade700", LeafPsiElement.class);
final Color color = new FlutterColorProvider().getColorFrom(testIdentifier);
assertNotNull(color);
final DartReferenceExpression element = DartSyntax.findEnclosingReferenceExpression(testIdentifier);
assertNotNull(element);
});
}
@Test
public void locatesCuppertinoColorReferenceWithWitespace() throws Exception {
run(() -> {
final PsiElement testIdentifier = setUpDartElement("main() { CupertinoColors . systemGreen; }", "CupertinoColors", LeafPsiElement.class);
final Color color = new FlutterColorProvider().getColorFrom(testIdentifier);
assertNotNull(color);
final DartReferenceExpression element = DartSyntax.findEnclosingReferenceExpression(testIdentifier);
assertNotNull(element);
});
}
@Test
public void locatesCuppertinoColorReferenceWithLineEndComment() throws Exception {
run(() -> {
final PsiElement testIdentifier = setUpDartElement("main() { CupertinoColors . // comment\n systemGreen; }", "CupertinoColors", LeafPsiElement.class);
final Color color = new FlutterColorProvider().getColorFrom(testIdentifier);
assertNotNull(color);
final DartReferenceExpression element = DartSyntax.findEnclosingReferenceExpression(testIdentifier);
assertNotNull(element);
});
}
}
| flutter-intellij/flutter-idea/testSrc/unit/io/flutter/editor/FlutterColorProviderTest.java/0 | {
"file_path": "flutter-intellij/flutter-idea/testSrc/unit/io/flutter/editor/FlutterColorProviderTest.java",
"repo_id": "flutter-intellij",
"token_count": 2659
} | 458 |
/*
* Copyright 2017 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
package io.flutter.run;
import com.google.common.collect.ImmutableList;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.roots.ModuleRootModificationUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.xdebugger.XSourcePosition;
import com.jetbrains.lang.dart.util.DartUrlResolver;
import com.jetbrains.lang.dart.util.DartUrlResolverImpl;
import io.flutter.testing.ProjectFixture;
import io.flutter.testing.TestDir;
import io.flutter.testing.Testing;
import io.flutter.vmService.DartVmServiceDebugProcess;
import org.dartlang.vm.service.element.LibraryRef;
import org.dartlang.vm.service.element.Script;
import org.dartlang.vm.service.element.ScriptRef;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
/**
* Verifies that we can map file locations.
*/
public class FlutterPositionMapperTest {
private final FakeScriptProvider scripts = new FakeScriptProvider();
@Rule
public ProjectFixture fixture = Testing.makeEmptyModule();
@Rule
public TestDir tmp = new TestDir();
VirtualFile sourceRoot;
@Before
public void setUp() throws Exception {
sourceRoot = tmp.ensureDir("root");
ModuleRootModificationUtil.addContentRoot(fixture.getModule(), sourceRoot.getPath());
}
@Test
public void shouldGetPositionInFileUnderRemoteSourceRoot() throws Exception {
tmp.writeFile("root/pubspec.yaml", "");
tmp.ensureDir("root/lib");
final VirtualFile main = tmp.writeFile("root/lib/main.dart", "");
final VirtualFile hello = tmp.writeFile("root/lib/hello.dart", "");
final FlutterPositionMapper mapper = setUpMapper(main, null);
mapper.onLibrariesDownloaded(ImmutableList.of(
makeLibraryRef("some/stuff/to/ignore/lib/main.dart")
));
assertEquals("some/stuff/to/ignore", mapper.getRemoteSourceRoot());
scripts.addScript("1", "2", "some/stuff/to/ignore/lib/hello.dart", ImmutableList.of(new Line(10, 123, 1)));
final XSourcePosition pos = mapper.getSourcePosition("1", makeScriptRef("2", "some/stuff/to/ignore/lib/hello.dart"), 123, null);
assertNotNull(pos);
assertEquals(pos.getFile(), hello);
assertEquals(pos.getLine(), 9); // zero-based
}
@Test
public void shouldGetPositionInFileUnderRemoteBaseUri() throws Exception {
tmp.writeFile("root/pubspec.yaml", "");
tmp.ensureDir("root/lib");
final VirtualFile main = tmp.writeFile("root/lib/main.dart", "");
final VirtualFile hello = tmp.writeFile("root/lib/hello.dart", "");
final FlutterPositionMapper mapper = setUpMapper(main, "remote:root");
scripts.addScript("1", "2", "remote:root/lib/hello.dart", ImmutableList.of(new Line(10, 123, 1)));
final XSourcePosition pos = mapper.getSourcePosition("1", makeScriptRef("2", "remote:root/lib/hello.dart"), 123, null);
assertNotNull(pos);
assertEquals(pos.getFile(), hello);
assertEquals(pos.getLine(), 9); // zero-based
}
@NotNull
private FlutterPositionMapper setUpMapper(VirtualFile contextFile, String remoteBaseUri) {
final FlutterPositionMapper[] mapper = new FlutterPositionMapper[1];
ApplicationManager.getApplication().runReadAction(() -> {
final DartUrlResolver resolver = new DartUrlResolverImpl(fixture.getProject(), contextFile);
mapper[0] = new FlutterPositionMapper(fixture.getProject(), sourceRoot, resolver, null);
mapper[0].onConnect(scripts, remoteBaseUri);
});
return mapper[0];
}
private LibraryRef makeLibraryRef(String uri) {
final JsonObject elt = new JsonObject();
elt.addProperty("uri", uri);
return new LibraryRef(elt);
}
private ScriptRef makeScriptRef(String scriptId, String uri) {
final JsonObject elt = new JsonObject();
elt.addProperty("id", scriptId);
elt.addProperty("uri", uri);
return new ScriptRef(elt);
}
private static final class FakeScriptProvider implements DartVmServiceDebugProcess.ScriptProvider {
final Map<String, Script> scripts = new HashMap<>();
void addScript(String isolateId, String scriptId, String uri, List<Line> table) {
final JsonArray tokenPosTable = new JsonArray();
table.forEach((line) -> tokenPosTable.add(line.json));
final JsonObject elt = new JsonObject();
elt.addProperty("uri", uri);
elt.add("tokenPosTable", tokenPosTable);
scripts.put(isolateId + "-" + scriptId, new Script(elt));
}
@Nullable
@Override
public Script downloadScript(@NotNull String isolateId, @NotNull String scriptId) {
return scripts.get(isolateId + "-" + scriptId);
}
}
private static class Line {
final JsonArray json = new JsonArray();
Line(int number) {
json.add(number);
}
Line(int number, int tokenPos, int column) {
this(number);
addToken(tokenPos, column);
}
void addToken(int tokenPos, int column) {
json.add(tokenPos);
json.add(column);
}
}
}
| flutter-intellij/flutter-idea/testSrc/unit/io/flutter/run/FlutterPositionMapperTest.java/0 | {
"file_path": "flutter-intellij/flutter-idea/testSrc/unit/io/flutter/run/FlutterPositionMapperTest.java",
"repo_id": "flutter-intellij",
"token_count": 1874
} | 459 |
/*
* Copyright 2017 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
package io.flutter.sdk;
import com.intellij.openapi.util.SystemInfo;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class FlutterSdkUtilsTest {
@Test
public void parseFlutterSdkPath() {
final String content = "# Generated by pub on 2017-07-07 12:58:30.541312.\n" +
"async:file:///Users/devoncarew/.pub-cache/hosted/pub.dartlang.org/async-1.13.3/lib/\n" +
"charcode:file:///Users/devoncarew/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.1/lib/\n" +
"collection:file:///Users/devoncarew/.pub-cache/hosted/pub.dartlang.org/collection-1.14.2/lib/\n" +
"flutter:file:///Users/devoncarew/projects/flutter/flutter/packages/flutter/lib/\n" +
"http:file:///Users/devoncarew/.pub-cache/hosted/pub.dartlang.org/http-0.11.3+13/lib/\n" +
"http_parser:file:///Users/devoncarew/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.1/lib/\n" +
"intl:file:///Users/devoncarew/.pub-cache/hosted/pub.dartlang.org/intl-0.14.0/lib/\n" +
"meta:file:///Users/devoncarew/.pub-cache/hosted/pub.dartlang.org/meta-1.0.5/lib/\n" +
"path:file:///Users/devoncarew/.pub-cache/hosted/pub.dartlang.org/path-1.4.2/lib/\n" +
"sky_engine:../../flutter/flutter/bin/cache/pkg/sky_engine/lib/\n" +
"source_span:file:///Users/devoncarew/.pub-cache/hosted/pub.dartlang.org/source_span-1.4.0/lib/\n" +
"stack_trace:file:///Users/devoncarew/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.7.4/lib/\n" +
"string_scanner:file:///Users/devoncarew/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.0.2/lib/\n" +
"typed_data:file:///Users/devoncarew/.pub-cache/hosted/pub.dartlang.org/typed_data-1.1.3/lib/\n" +
"vector_math:file:///Users/devoncarew/.pub-cache/hosted/pub.dartlang.org/vector_math-2.0.5/lib/\n" +
"flutter_sunflower:lib/\n";
String result = FlutterSdkUtil.parseFlutterSdkPath(content);
if (result != null && SystemInfo.isWindows) {
result = result.replaceAll("\\\\", "/");
}
assertEquals("/Users/devoncarew/projects/flutter/flutter", result);
}
}
| flutter-intellij/flutter-idea/testSrc/unit/io/flutter/sdk/FlutterSdkUtilsTest.java/0 | {
"file_path": "flutter-intellij/flutter-idea/testSrc/unit/io/flutter/sdk/FlutterSdkUtilsTest.java",
"repo_id": "flutter-intellij",
"token_count": 1341
} | 460 |
/*
* Copyright 2017 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
package io.flutter.utils;
import org.junit.Test;
import static org.junit.Assert.assertArrayEquals;
public class StdoutJsonParserTest {
@Test
public void simple() {
final StdoutJsonParser parser = new StdoutJsonParser();
parser.appendOutput("hello\n");
parser.appendOutput("there\n");
parser.appendOutput("[{'foo':'bar'}]\n");
parser.appendOutput("bye\n");
assertArrayEquals(
"validating parser results",
new String[]{"hello\n", "there\n", "[{'foo':'bar'}]\n", "bye\n"},
parser.getAvailableLines().toArray()
);
}
@Test
public void appendsWithoutLineBreaks() {
StdoutJsonParser parser = new StdoutJsonParser();
parser.appendOutput("hello\nnow\n");
parser.appendOutput("there");
parser.appendOutput("world");
parser.appendOutput("hello\ragain\r");
parser.appendOutput("hello\r\nwindows\r\n");
assertArrayEquals(
"validating parser results",
new String[]{"hello\n", "now\n", "there", "world", "hello\r", "again\r", "hello\r\n", "windows\r\n"},
parser.getAvailableLines().toArray()
);
parser = new StdoutJsonParser();
parser.appendOutput("hello\n");
parser.appendOutput("there");
assertArrayEquals(
"validating parser results",
new String[]{"hello\n", "there"},
parser.getAvailableLines().toArray()
);
}
@Test
public void jsonWithLineBreaks() {
final StdoutJsonParser parser = new StdoutJsonParser();
parser.appendOutput("[{'foo':'bar'}]");
parser.appendOutput("\ntest\n");
parser.appendOutput("[{'foo':'baz'}]");
parser.appendOutput("\rtest\r");
parser.appendOutput("[{'foo':'baz2'}]");
parser.appendOutput("\r\nwindows");
parser.appendOutput("bye\n");
assertArrayEquals(
"validating parser results",
new String[]{"[{'foo':'bar'}]", "test\n", "[{'foo':'baz'}]", "test\r", "[{'foo':'baz2'}]", "windows", "bye\n"},
parser.getAvailableLines().toArray()
);
}
@Test
public void splitJson() {
final StdoutJsonParser parser = new StdoutJsonParser();
parser.appendOutput("hello\n");
parser.appendOutput("there\n");
parser.appendOutput("[{'foo':");
parser.appendOutput("'bar'}]\n");
parser.appendOutput("bye\n");
assertArrayEquals(
"validating parser results",
new String[]{"hello\n", "there\n", "[{'foo':'bar'}]\n", "bye\n"},
parser.getAvailableLines().toArray()
);
}
@Test
public void deepNestedJson() {
final StdoutJsonParser parser = new StdoutJsonParser();
parser.appendOutput("hello\n");
parser.appendOutput("there\n");
parser.appendOutput("[{'foo':");
parser.appendOutput("[{'bar':'baz'}]}]\n");
parser.appendOutput("bye\n");
assertArrayEquals(
"validating parser results",
new String[]{"hello\n", "there\n", "[{'foo':[{'bar':'baz'}]}]\n", "bye\n"},
parser.getAvailableLines().toArray()
);
}
@Test
public void unterminatedJson() {
final StdoutJsonParser parser = new StdoutJsonParser();
parser.appendOutput("hello\n");
parser.appendOutput("there\n");
parser.appendOutput("[{'bar':'baz'");
// The JSON has not yet terminated with a '}]' sequence.
assertArrayEquals(
"validating parser results",
new String[]{"hello\n", "there\n"},
parser.getAvailableLines().toArray()
);
}
@Test
public void outputConcatenatedJson() {
final StdoutJsonParser parser = new StdoutJsonParser();
parser.appendOutput(
"[{\"event\":\"app.progress\",\"params\":{\"appId\":\"363879f2-74d7-46e5-bfa9-1654a8c69923\",\"id\":\"12\",\"progressId\":\"hot.restart\",\"message\":\"Performing hot restart...\"}}]Performing hot restart…");
assertArrayEquals(
"validating parser results",
new String[]{
"[{\"event\":\"app.progress\",\"params\":{\"appId\":\"363879f2-74d7-46e5-bfa9-1654a8c69923\",\"id\":\"12\",\"progressId\":\"hot.restart\",\"message\":\"Performing hot restart...\"}}]",
"Performing hot restart…"},
parser.getAvailableLines().toArray()
);
}
}
| flutter-intellij/flutter-idea/testSrc/unit/io/flutter/utils/StdoutJsonParserTest.java/0 | {
"file_path": "flutter-intellij/flutter-idea/testSrc/unit/io/flutter/utils/StdoutJsonParserTest.java",
"repo_id": "flutter-intellij",
"token_count": 1674
} | 461 |
/*
* Copyright (c) 2015, the Dart project authors.
*
* Licensed under the Eclipse Public License v1.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.dartlang.vm.service.element;
// This file is generated by the script: pkg/vm_service/tool/generate.dart in dart-lang/sdk.
@SuppressWarnings({"WeakerAccess", "unused"})
public enum ErrorKind {
/**
* The isolate has encountered an internal error. These errors should be reported as bugs.
*/
InternalError,
/**
* The isolate has encountered a Dart language error in the program.
*/
LanguageError,
/**
* The isolate has been terminated by an external source.
*/
TerminationError,
/**
* The isolate has encountered an unhandled Dart exception.
*/
UnhandledException,
/**
* Represents a value returned by the VM but unknown to this client.
*/
Unknown
}
| flutter-intellij/flutter-idea/third_party/vmServiceDrivers/org/dartlang/vm/service/element/ErrorKind.java/0 | {
"file_path": "flutter-intellij/flutter-idea/third_party/vmServiceDrivers/org/dartlang/vm/service/element/ErrorKind.java",
"repo_id": "flutter-intellij",
"token_count": 367
} | 462 |
/*
* Copyright (c) 2015, the Dart project authors.
*
* Licensed under the Eclipse Public License v1.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.dartlang.vm.service.element;
// This file is generated by the script: pkg/vm_service/tool/generate.dart in dart-lang/sdk.
import com.google.gson.JsonObject;
/**
* A {@link Message} provides information about a pending isolate message and the function that
* will be invoked to handle it.
*/
@SuppressWarnings({"WeakerAccess", "unused"})
public class Message extends Response {
public Message(JsonObject json) {
super(json);
}
/**
* A reference to the function that will be invoked to handle this message.
*
* Can return <code>null</code>.
*/
public FuncRef getHandler() {
JsonObject obj = (JsonObject) json.get("handler");
if (obj == null) return null;
final String type = json.get("type").getAsString();
if ("Instance".equals(type) || "@Instance".equals(type)) {
final String kind = json.get("kind").getAsString();
if ("Null".equals(kind)) return null;
}
return new FuncRef(obj);
}
/**
* The index in the isolate's message queue. The 0th message being the next message to be
* processed.
*/
public int getIndex() {
return getAsInt("index");
}
/**
* The source location of handler.
*
* Can return <code>null</code>.
*/
public SourceLocation getLocation() {
JsonObject obj = (JsonObject) json.get("location");
if (obj == null) return null;
final String type = json.get("type").getAsString();
if ("Instance".equals(type) || "@Instance".equals(type)) {
final String kind = json.get("kind").getAsString();
if ("Null".equals(kind)) return null;
}
return new SourceLocation(obj);
}
/**
* An instance id for the decoded message. This id can be passed to other RPCs, for example,
* getObject or evaluate.
*/
public String getMessageObjectId() {
return getAsString("messageObjectId");
}
/**
* An advisory name describing this message.
*/
public String getName() {
return getAsString("name");
}
/**
* The size (bytes) of the encoded message.
*/
public int getSize() {
return getAsInt("size");
}
}
| flutter-intellij/flutter-idea/third_party/vmServiceDrivers/org/dartlang/vm/service/element/Message.java/0 | {
"file_path": "flutter-intellij/flutter-idea/third_party/vmServiceDrivers/org/dartlang/vm/service/element/Message.java",
"repo_id": "flutter-intellij",
"token_count": 861
} | 463 |
/*
* Copyright (c) 2015, the Dart project authors.
*
* Licensed under the Eclipse Public License v1.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.dartlang.vm.service.element;
// This file is generated by the script: pkg/vm_service/tool/generate.dart in dart-lang/sdk.
import com.google.gson.JsonObject;
/**
* Every non-error response returned by the Service Protocol extends {@link Response}. By using the
* {@link type} property, the client can determine which type of response has been provided.
*/
@SuppressWarnings({"WeakerAccess", "unused"})
public class Response extends Element {
public Response(JsonObject json) {
super(json);
}
/**
* Every response returned by the VM Service has the type property. This allows the client
* distinguish between different kinds of responses.
*/
public String getType() {
return getAsString("type");
}
}
| flutter-intellij/flutter-idea/third_party/vmServiceDrivers/org/dartlang/vm/service/element/Response.java/0 | {
"file_path": "flutter-intellij/flutter-idea/third_party/vmServiceDrivers/org/dartlang/vm/service/element/Response.java",
"repo_id": "flutter-intellij",
"token_count": 368
} | 464 |
/*
* Copyright (c) 2015, the Dart project authors.
*
* Licensed under the Eclipse Public License v1.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.dartlang.vm.service.element;
// This file is generated by the script: pkg/vm_service/tool/generate.dart in dart-lang/sdk.
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
@SuppressWarnings({"WeakerAccess", "unused"})
public class Timeline extends Response {
public Timeline(JsonObject json) {
super(json);
}
/**
* The duration of time covered by the timeline.
*/
public int getTimeExtentMicros() {
return getAsInt("timeExtentMicros");
}
/**
* The start of the period of time in which traceEvents were collected.
*/
public int getTimeOriginMicros() {
return getAsInt("timeOriginMicros");
}
/**
* A list of timeline events. No order is guaranteed for these events; in particular, these
* events may be unordered with respect to their timestamps.
*/
public ElementList<TimelineEvent> getTraceEvents() {
return new ElementList<TimelineEvent>(json.get("traceEvents").getAsJsonArray()) {
@Override
protected TimelineEvent basicGet(JsonArray array, int index) {
return new TimelineEvent(array.get(index).getAsJsonObject());
}
};
}
}
| flutter-intellij/flutter-idea/third_party/vmServiceDrivers/org/dartlang/vm/service/element/Timeline.java/0 | {
"file_path": "flutter-intellij/flutter-idea/third_party/vmServiceDrivers/org/dartlang/vm/service/element/Timeline.java",
"repo_id": "flutter-intellij",
"token_count": 536
} | 465 |
/*
* Copyright (c) 2015, the Dart project authors.
*
* Licensed under the Eclipse Public License v1.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.dartlang.vm.service.internal;
import com.google.gson.JsonObject;
/**
* A destination for responses.
*/
public interface ResponseSink {
/**
* Put response into the sink.
*
* @param response the response to put, not {@code null}.
*/
void add(JsonObject response) throws Exception;
}
| flutter-intellij/flutter-idea/third_party/vmServiceDrivers/org/dartlang/vm/service/internal/ResponseSink.java/0 | {
"file_path": "flutter-intellij/flutter-idea/third_party/vmServiceDrivers/org/dartlang/vm/service/internal/ResponseSink.java",
"repo_id": "flutter-intellij",
"token_count": 252
} | 466 |
/*
* Copyright 2018 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
package io.flutter.actions;
import com.android.tools.idea.gradle.project.importing.GradleProjectImporter;
import com.intellij.ide.GeneralSettings;
import com.intellij.ide.actions.OpenFileAction;
import com.intellij.openapi.actionSystem.ActionPlaces;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.BitUtil;
import io.flutter.FlutterMessages;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.gradle.util.GradleConstants;
import java.awt.event.InputEvent;
import static com.android.tools.idea.gradle.project.ProjectImportUtil.findGradleTarget;
import static com.intellij.ide.impl.ProjectUtil.*;
import static com.intellij.openapi.fileChooser.impl.FileChooserUtil.setLastOpenedFile;
/**
* Open the selected module in Android Studio, re-using the current process
* rather than spawning a new process (as IntelliJ does).
*/
public class OpenAndroidModule extends OpenInAndroidStudioAction implements DumbAware {
@Override
public void actionPerformed(AnActionEvent e) {
final VirtualFile projectFile = findProjectFile(e);
if (projectFile == null) {
FlutterMessages.showError("Error Opening Android Studio", "Project not found.", e.getProject());
return;
}
final int modifiers = e.getModifiers();
// From ReopenProjectAction.
final boolean forceOpenInNewFrame = BitUtil.isSet(modifiers, InputEvent.CTRL_MASK)
|| BitUtil.isSet(modifiers, InputEvent.SHIFT_MASK)
|| e.getPlace() == ActionPlaces.WELCOME_SCREEN;
VirtualFile sourceFile = e.getData(CommonDataKeys.VIRTUAL_FILE);
// Using:
//ProjectUtil.openOrImport(projectFile.getPath(), e.getProject(), forceOpenInNewFrame);
// presents the user with a really imposing Gradle project import dialog.
openOrImportProject(projectFile, e.getProject(), sourceFile, forceOpenInNewFrame);
}
private static void openOrImportProject(@NotNull VirtualFile projectFile,
@Nullable Project project,
@Nullable VirtualFile sourceFile,
boolean forceOpenInNewFrame) {
// This is very similar to AndroidOpenFileAction.openOrImportProject().
if (canImportAsGradleProject(projectFile)) {
VirtualFile target = findGradleTarget(projectFile);
if (target != null) {
GradleProjectImporter gradleImporter = GradleProjectImporter.getInstance();
gradleImporter.importAndOpenProjectCore(null, true, projectFile);
for (Project proj : ProjectManager.getInstance().getOpenProjects()) {
if (projectFile.equals(proj.getBaseDir()) || projectFile.equals(proj.getProjectFile())) {
if (sourceFile != null && !sourceFile.isDirectory()) {
OpenFileAction.openFile(sourceFile, proj);
}
break;
}
}
return;
}
}
Project newProject = openOrImport(projectFile.getPath(), project, false);
if (newProject != null) {
setLastOpenedFile(newProject, projectFile);
if (sourceFile != null && !sourceFile.isDirectory()) {
OpenFileAction.openFile(sourceFile, newProject);
}
}
}
public static boolean canImportAsGradleProject(@NotNull VirtualFile importSource) {
VirtualFile target = findGradleTarget(importSource);
return target != null && GradleConstants.EXTENSION.equals(target.getExtension());
}
}
| flutter-intellij/flutter-studio/src/io/flutter/actions/OpenAndroidModule.java/0 | {
"file_path": "flutter-intellij/flutter-studio/src/io/flutter/actions/OpenAndroidModule.java",
"repo_id": "flutter-intellij",
"token_count": 1472
} | 467 |
package org.jetbrains.kotlin.tools.projectWizard.wizard;
import com.intellij.ide.util.projectWizard.EmptyModuleBuilder;
// This class definition is required to prevent an exception during extension initialization.
public class NewProjectWizardModuleBuilder extends EmptyModuleBuilder {
}
| flutter-intellij/flutter-studio/src/org/jetbrains/kotlin/tools/projectWizard/wizard/NewProjectWizardModuleBuilder.java/0 | {
"file_path": "flutter-intellij/flutter-studio/src/org/jetbrains/kotlin/tools/projectWizard/wizard/NewProjectWizardModuleBuilder.java",
"repo_id": "flutter-intellij",
"token_count": 74
} | 468 |
/*
* Copyright 2017 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
package io.flutter.tests.util;
import com.android.tools.idea.tests.gui.framework.FlutterGuiTestRule;
import com.android.tools.idea.tests.gui.framework.fixture.newProjectWizard.NewFlutterProjectWizardFixture;
import io.flutter.module.FlutterProjectType;
import io.flutter.sdk.FlutterSdkUtil;
import org.jetbrains.annotations.NotNull;
public class WizardUtils {
private WizardUtils() {
}
public static void createNewApplication(@NotNull FlutterGuiTestRule guiTest) {
createNewProject(guiTest, FlutterProjectType.APP);
}
public static void createNewModule(@NotNull FlutterGuiTestRule guiTest) {
createNewProject(guiTest, FlutterProjectType.MODULE);
}
public static void createNewPackage(@NotNull FlutterGuiTestRule guiTest) {
createNewProject(guiTest, FlutterProjectType.PACKAGE);
}
public static void createNewPlugin(@NotNull FlutterGuiTestRule guiTest) {
createNewProject(guiTest, FlutterProjectType.PLUGIN);
}
public static void createNewProject(@NotNull FlutterGuiTestRule guiTest, @NotNull FlutterProjectType type,
String name, String description, String packageName, Boolean isKotlin, Boolean isSwift) {
String sdkPath = FlutterSdkUtil.locateSdkFromPath();
if (sdkPath == null) {
// Fail fast if the Flutter SDK is not found.
System.out.println("Ensure the 'flutter' tool is on your PATH. 'which flutter' is used to find the SDK");
throw new IllegalStateException("flutter not installed properly");
}
String projectType;
switch (type) {
case APP:
projectType = "Flutter Application";
break;
case PACKAGE:
projectType = "Flutter Package";
break;
case PLUGIN:
projectType = "Flutter Plugin";
break;
case MODULE:
projectType = "Flutter Module";
break;
default:
throw new IllegalArgumentException();
}
NewFlutterProjectWizardFixture wizard = guiTest.welcomeFrame().createNewProject();
wizard.chooseProjectType(projectType);
wizard.clickNext();
if (name != null) {
wizard.getFlutterProjectStep(type).enterProjectName(name);
}
wizard.getFlutterProjectStep(type).enterSdkPath(sdkPath); // TODO(messick): Parameterize SDK.
if (description != null) {
wizard.getFlutterProjectStep(type).enterDescription(description);
}
if (type != FlutterProjectType.PACKAGE) {
wizard.clickNext();
if (packageName != null) {
wizard.getFlutterSettingsStep().enterPackageName(packageName);
}
if (type != FlutterProjectType.MODULE) {
if (isKotlin != null) {
wizard.getFlutterSettingsStep().setKotlinSupport(isKotlin);
}
if (isSwift != null) {
wizard.getFlutterSettingsStep().setSwiftSupport(isSwift);
}
}
}
wizard.clickFinish();
guiTest.waitForBackgroundTasks();
guiTest.ideFrame().waitForProjectSyncToFinish();
}
private static void createNewProject(@NotNull FlutterGuiTestRule guiTest, @NotNull FlutterProjectType type) {
createNewProject(guiTest, type, null, null, null, null, null);
}
}
| flutter-intellij/flutter-studio/testSrc/io/flutter/tests/util/WizardUtils.java/0 | {
"file_path": "flutter-intellij/flutter-studio/testSrc/io/flutter/tests/util/WizardUtils.java",
"repo_id": "flutter-intellij",
"token_count": 1220
} | 469 |
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1080 1080" style="enable-background:new 0 0 1080 1080;" xml:space="preserve">
<style type="text/css">
.st0{clip-path:url(#SVGID_2_);}
.st1{fill:#39CEFD;}
.st2{clip-path:url(#SVGID_4_);fill:#39CEFD;}
.st3{clip-path:url(#SVGID_6_);fill:#03569B;}
.st4{clip-path:url(#SVGID_8_);fill:url(#SVGID_9_);}
.st5{clip-path:url(#SVGID_11_);}
.st6{fill:#16B9FD;}
.st7{fill:url(#SVGID_12_);}
</style>
<g>
<g>
<g>
<defs>
<path id="SVGID_1_" d="M959.4,500L679.8,779.7l279.6,279.7l0,0H639.9L520,939.5l0,0L360.2,779.7L639.9,500H959.4L959.4,500
L959.4,500z M639.9,20.7L120.6,540l159.8,159.8L959.4,20.7H639.9z"/>
</defs>
<clipPath id="SVGID_2_">
<use xlink:href="#SVGID_1_" style="overflow:visible;"/>
</clipPath>
<g class="st0">
<g>
<polygon class="st1" points="959.4,500 959.4,500 959.4,500 639.9,500 360.3,779.7 520,939.5 "/>
</g>
</g>
</g>
<g>
<defs>
<path id="SVGID_3_" d="M959.4,500L679.8,779.7l279.6,279.7l0,0H639.9L520,939.5l0,0L360.2,779.7L639.9,500H959.4L959.4,500
L959.4,500z M639.9,20.7L120.6,540l159.8,159.8L959.4,20.7H639.9z"/>
</defs>
<clipPath id="SVGID_4_">
<use xlink:href="#SVGID_3_" style="overflow:visible;"/>
</clipPath>
<polygon class="st2" points="280.4,699.8 120.6,540 639.9,20.7 959.4,20.7 "/>
</g>
<g>
<defs>
<path id="SVGID_5_" d="M959.4,500L679.8,779.7l279.6,279.7l0,0H639.9L520,939.5l0,0L360.2,779.7L639.9,500H959.4L959.4,500
L959.4,500z M639.9,20.7L120.6,540l159.8,159.8L959.4,20.7H639.9z"/>
</defs>
<clipPath id="SVGID_6_">
<use xlink:href="#SVGID_5_" style="overflow:visible;"/>
</clipPath>
<polygon class="st3" points="520,939.5 639.9,1059.3 959.4,1059.3 959.4,1059.3 679.8,779.7 "/>
</g>
<g>
<defs>
<path id="SVGID_7_" d="M959.4,500L679.8,779.7l279.6,279.7l0,0H639.9L520,939.5l0,0L360.2,779.7L639.9,500H959.4L959.4,500
L959.4,500z M639.9,20.7L120.6,540l159.8,159.8L959.4,20.7H639.9z"/>
</defs>
<clipPath id="SVGID_8_">
<use xlink:href="#SVGID_7_" style="overflow:visible;"/>
</clipPath>
<linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="9514.54" y1="-6371.355" x2="9990.5996" y2="-5895.2949" gradientTransform="matrix(0.25 0 0 -0.25 -1812 -622.5)">
<stop offset="0" style="stop-color:#1A237E;stop-opacity:0.4"/>
<stop offset="1" style="stop-color:#1A237E;stop-opacity:0"/>
</linearGradient>
<polygon class="st4" points="520,939.5 757,857.4 679.8,779.7 "/>
</g>
<g>
<defs>
<path id="SVGID_10_" d="M959.4,500L679.8,779.7l279.6,279.7l0,0H639.9L520,939.5l0,0L360.2,779.7L639.9,500H959.4L959.4,500
L959.4,500z M639.9,20.7L120.6,540l159.8,159.8L959.4,20.7H639.9z"/>
</defs>
<clipPath id="SVGID_11_">
<use xlink:href="#SVGID_10_" style="overflow:visible;"/>
</clipPath>
<g class="st5">
<rect x="407.1" y="666.7" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -399.0023 596.0814)" class="st6" width="226" height="226"/>
</g>
</g>
</g>
<radialGradient id="SVGID_12_" cx="7824.6587" cy="-2855.979" r="5082.8887" gradientTransform="matrix(0.25 0 0 -0.25 -1812 -622.5)" gradientUnits="userSpaceOnUse">
<stop offset="0" style="stop-color:#FFFFFF;stop-opacity:0.1"/>
<stop offset="1" style="stop-color:#FFFFFF;stop-opacity:0"/>
</radialGradient>
<path class="st7" d="M959.4,500L679.8,779.7l279.6,279.7l0,0H639.9L520,939.5l0,0L360.2,779.7L639.9,500H959.4L959.4,500L959.4,500
z M639.9,20.7L120.6,540l159.8,159.8L959.4,20.7H639.9z"/>
</g>
</svg>
| flutter-intellij/resources/META-INF/pluginIcon.svg/0 | {
"file_path": "flutter-intellij/resources/META-INF/pluginIcon.svg",
"repo_id": "flutter-intellij",
"token_count": 2214
} | 470 |
#
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Replace <KEY> with JxBrowser license key and save this file as jxbrowser.properties
jxbrowser.license.key=<KEY>
| flutter-intellij/resources/jxbrowser/jxbrowser.properties.template/0 | {
"file_path": "flutter-intellij/resources/jxbrowser/jxbrowser.properties.template",
"repo_id": "flutter-intellij",
"token_count": 79
} | 471 |
<?xml version="1.0" encoding="UTF-8"?>
<!--
This script is the compiler-driver for the plugin tool and is not intended to be used elsewhere.
Run this script with the current working directory set to the root directory of the Flutter plugin project.
Include -D arguments to define these properties: idea.product, idea.version.
-->
<project
name="plugin-compile"
default="compile">
<property environment="env"/>
<property name="idea.product" value="ideaIC"/>
<property name="idea.version" value="2017.1.3"/>
<property name="idea.home" location="artifacts/${idea.product}"/>
<property name="javac2.home" value="artifacts/javac2"/>
<condition property="build.studio">
<contains string="${idea.product}" substring="android-studio"/>
</condition>
<patternset id="compiler.resources">
<exclude name="**/?*.java"/>
<exclude name="**/?*.form"/>
<exclude name="**/?*.class"/>
<exclude name="**/?*.kt"/>
</patternset>
<patternset id="ignored.files">
<exclude name="**/*~/**"/>
<exclude name="**/.DS_Store/**"/>
<exclude name="**/.git/**"/>
</patternset>
<path id="javac2.classpath">
<pathelement location="${javac2.home}/javac2.jar"/>
<pathelement location="${javac2.home}/jdom.jar"/>
<pathelement location="${javac2.home}/asm.jar"/>
<pathelement location="${javac2.home}/asm-all.jar"/>
<pathelement location="${javac2.home}/asm-commons.jar"/>
<pathelement location="${javac2.home}/jgoodies-forms.jar"/>
</path>
<taskdef name="javac2" classname="com.intellij.ant.Javac2" classpathref="javac2.classpath"/>
<typedef name="prefixedpath" classname="com.intellij.ant.PrefixedPath" classpathref="javac2.classpath"/>
<target name="paths">
<path id="idea.jars">
<fileset dir="${idea.home}/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${idea.home}/plugins">
<include name="**/lib/*.jar"/>
<exclude name="**/kotlin-compiler.jar"/>
</fileset>
</path>
<path id="dartplugin.jars">
<fileset dir="${basedir}/artifacts/Dart/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${basedir}/third_party/lib/jxbrowser">
<include name="*.jar"/>
</fileset>
</path>
<path id="junit.jars">
<pathelement location="${idea.home}/lib/junit-*.jar"/>
</path>
<path id="src.sourcepath">
<dirset dir=".">
<include name="src"/>
<include name="resources"/>
<include name="gen"/>
<include name="third_party/vmServiceDrivers"/>
</dirset>
</path>
<path id="studioSrc.sourcepath">
<dirset dir="flutter-studio">
<include name="src/main/java"/>
</dirset>
</path>
</target>
<target name="compile.studio" depends="paths, compile.idea" if="build.studio">
<mkdir dir="build/studio"/>
<echo message="compile flutter-studio"/>
<javac2 destdir="build/studio" memorymaximumsize="1000m" fork="true"
debug="true" debuglevel="lines,vars,source" includeantruntime="false">
<compilerarg line="-encoding UTF-8 -source 8 -target 8 -g"/>
<classpath>
<path refid="idea.jars"/>
<path refid="dartplugin.jars"/>
<path location="build/classes"/>
</classpath>
<src refid="studioSrc.sourcepath"/>
<nestedformdirs>
<prefixedpath>
<dirset dir=".">
<include name="src"/>
</dirset>
</prefixedpath>
</nestedformdirs>
<patternset refid="ignored.files"/>
</javac2>
</target>
<target name="compile.idea" depends="paths">
<mkdir dir="build/classes"/>
<echo message="compile flutter-intellij"/>
<javac2 destdir="build/classes" memorymaximumsize="1000m" fork="true"
debug="true" debuglevel="lines,vars,source" includeantruntime="false">
<compilerarg line="-encoding UTF-8 -source 8 -target 8 -g"/>
<classpath>
<path refid="idea.jars"/>
<path refid="dartplugin.jars"/>
</classpath>
<src refid="src.sourcepath"/>
<patternset refid="ignored.files"/>
</javac2>
</target>
<target name="compile" depends="compile.idea, compile.studio"/>
</project>
| flutter-intellij/tool/plugin/compile.xml/0 | {
"file_path": "flutter-intellij/tool/plugin/compile.xml",
"repo_id": "flutter-intellij",
"token_count": 1755
} | 472 |
// VSCode workspace settings that are shared among all users of this project.
// This only affects subdirectories of this project.
{
// VSCode formats files on save by default. Since Flutter source code is
// hand-formatted, the default settings are changed to prevent inadvertent
// reformatting of code.
"[dart]": {
"editor.formatOnSave": false,
"editor.formatOnType": false,
"editor.formatOnPaste": false,
},
"html.format.enable": false,
"githubPullRequests.ignoredPullRequestBranches": [
"master"
],
"files.trimTrailingWhitespace": true
}
| flutter/.vscode/settings.json/0 | {
"file_path": "flutter/.vscode/settings.json",
"repo_id": "flutter",
"token_count": 214
} | 473 |
squash
| flutter/bin/internal/engine.merge_method/0 | {
"file_path": "flutter/bin/internal/engine.merge_method",
"repo_id": "flutter",
"token_count": 3
} | 474 |
#!/usr/bin/env bash
# Copyright 2014 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# ---------------------------------- NOTE ---------------------------------- #
#
# Please keep the logic in this file consistent with the logic in the
# `update_dart_sdk.ps1` script in the same directory to ensure that Flutter
# continues to work across all platforms!
#
# -------------------------------------------------------------------------- #
set -e
FLUTTER_ROOT="$(dirname "$(dirname "$(dirname "${BASH_SOURCE[0]}")")")"
DART_SDK_PATH="$FLUTTER_ROOT/bin/cache/dart-sdk"
DART_SDK_PATH_OLD="$DART_SDK_PATH.old"
ENGINE_STAMP="$FLUTTER_ROOT/bin/cache/engine-dart-sdk.stamp"
ENGINE_VERSION=$(cat "$FLUTTER_ROOT/bin/internal/engine.version")
ENGINE_REALM=$(cat "$FLUTTER_ROOT/bin/internal/engine.realm" | tr -d '[:space:]')
OS="$(uname -s)"
if [ ! -f "$ENGINE_STAMP" ] || [ "$ENGINE_VERSION" != `cat "$ENGINE_STAMP"` ]; then
command -v curl > /dev/null 2>&1 || {
>&2 echo
>&2 echo 'Missing "curl" tool. Unable to download Dart SDK.'
case "$OS" in
Darwin)
>&2 echo 'Consider running "brew install curl".'
;;
Linux)
>&2 echo 'Consider running "sudo apt-get install curl".'
;;
*)
>&2 echo "Please install curl."
;;
esac
echo
exit 1
}
command -v unzip > /dev/null 2>&1 || {
>&2 echo
>&2 echo 'Missing "unzip" tool. Unable to extract Dart SDK.'
case "$OS" in
Darwin)
echo 'Consider running "brew install unzip".'
;;
Linux)
echo 'Consider running "sudo apt-get install unzip".'
;;
*)
echo "Please install unzip."
;;
esac
echo
exit 1
}
# `uname -m` may be running in Rosetta mode, instead query sysctl
if [ "$OS" = 'Darwin' ]; then
# Allow non-zero exit so we can do control flow
set +e
# -n means only print value, not key
QUERY="sysctl -n hw.optional.arm64"
# Do not wrap $QUERY in double quotes, otherwise the args will be treated as
# part of the command
QUERY_RESULT=$($QUERY 2>/dev/null)
if [ $? -eq 1 ]; then
# If this command fails, we're certainly not on ARM
ARCH='x64'
elif [ "$QUERY_RESULT" = '0' ]; then
# If this returns 0, we are also not on ARM
ARCH='x64'
elif [ "$QUERY_RESULT" = '1' ]; then
ARCH='arm64'
else
>&2 echo "'$QUERY' returned unexpected output: '$QUERY_RESULT'"
exit 1
fi
set -e
else
# On x64 stdout is "uname -m: x86_64"
# On arm64 stdout is "uname -m: aarch64, arm64_v8a"
case "$(uname -m)" in
x86_64)
ARCH="x64"
;;
*)
ARCH="arm64"
;;
esac
fi
case "$OS" in
Darwin)
DART_ZIP_NAME="dart-sdk-darwin-${ARCH}.zip"
IS_USER_EXECUTABLE="-perm +100"
;;
Linux)
DART_ZIP_NAME="dart-sdk-linux-${ARCH}.zip"
IS_USER_EXECUTABLE="-perm /u+x"
;;
MINGW* | MSYS* )
DART_ZIP_NAME="dart-sdk-windows-x64.zip"
IS_USER_EXECUTABLE="-perm /u+x"
;;
*)
echo "Unknown operating system. Cannot install Dart SDK."
exit 1
;;
esac
>&2 echo "Downloading $OS $ARCH Dart SDK from Flutter engine $ENGINE_VERSION..."
# Use the default find if possible.
if [ -e /usr/bin/find ]; then
FIND=/usr/bin/find
else
FIND=find
fi
DART_SDK_BASE_URL="${FLUTTER_STORAGE_BASE_URL:-https://storage.googleapis.com}${ENGINE_REALM:+/$ENGINE_REALM}"
DART_SDK_URL="$DART_SDK_BASE_URL/flutter_infra_release/flutter/$ENGINE_VERSION/$DART_ZIP_NAME"
# if the sdk path exists, copy it to a temporary location
if [ -d "$DART_SDK_PATH" ]; then
rm -rf "$DART_SDK_PATH_OLD"
mv "$DART_SDK_PATH" "$DART_SDK_PATH_OLD"
fi
# install the new sdk
rm -rf -- "$DART_SDK_PATH"
mkdir -m 755 -p -- "$DART_SDK_PATH"
DART_SDK_ZIP="$FLUTTER_ROOT/bin/cache/$DART_ZIP_NAME"
# Conditionally set verbose flag for LUCI
verbose_curl=""
if [[ -n "$LUCI_CI" ]]; then
verbose_curl="--verbose"
fi
curl ${verbose_curl} --retry 3 --continue-at - --location --output "$DART_SDK_ZIP" "$DART_SDK_URL" 2>&1 || {
curlExitCode=$?
# Handle range errors specially: retry again with disabled ranges (`--continue-at -` argument)
# When this could happen:
# - missing support of ranges in proxy servers
# - curl with broken handling of completed downloads
# This is not a proper fix, but doesn't require any user input
# - mirror of flutter storage without support of ranges
#
# 33 HTTP range error. The range "command" didn't work.
# https://man7.org/linux/man-pages/man1/curl.1.html#EXIT_CODES
if [ $curlExitCode != 33 ]; then
return $curlExitCode
fi
curl ${verbose_curl} --retry 3 --location --output "$DART_SDK_ZIP" "$DART_SDK_URL" 2>&1
} || {
>&2 echo
>&2 echo "Failed to retrieve the Dart SDK from: $DART_SDK_URL"
>&2 echo "If you're located in China, please see this page:"
>&2 echo " https://flutter.dev/community/china"
>&2 echo
rm -f -- "$DART_SDK_ZIP"
exit 1
}
unzip -o -q "$DART_SDK_ZIP" -d "$FLUTTER_ROOT/bin/cache" || {
>&2 echo
>&2 echo "It appears that the downloaded file is corrupt; please try again."
>&2 echo "If this problem persists, please report the problem at:"
>&2 echo " https://github.com/flutter/flutter/issues/new?template=1_activation.yml"
>&2 echo
rm -f -- "$DART_SDK_ZIP"
exit 1
}
rm -f -- "$DART_SDK_ZIP"
$FIND "$DART_SDK_PATH" -type d -exec chmod 755 {} \;
$FIND "$DART_SDK_PATH" -type f $IS_USER_EXECUTABLE -exec chmod a+x,a+r {} \;
echo "$ENGINE_VERSION" > "$ENGINE_STAMP"
# delete any temporary sdk path
if [ -d "$DART_SDK_PATH_OLD" ]; then
rm -rf "$DART_SDK_PATH_OLD"
fi
fi
| flutter/bin/internal/update_dart_sdk.sh/0 | {
"file_path": "flutter/bin/internal/update_dart_sdk.sh",
"repo_id": "flutter",
"token_count": 2504
} | 475 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/widgets.dart';
import 'auto_complete.dart';
import 'badge.dart';
import 'check_box_list_tile.dart';
import 'date_picker.dart';
import 'dialog.dart';
import 'material_banner.dart';
import 'navigation_bar.dart';
import 'radio_list_tile.dart';
import 'slider.dart';
import 'text_button.dart';
import 'text_field.dart';
import 'text_field_password.dart';
abstract class UseCase {
String get name;
String get route;
Widget build(BuildContext context);
}
final List<UseCase> useCases = <UseCase>[
CheckBoxListTile(),
DialogUseCase(),
SliderUseCase(),
TextFieldUseCase(),
TextFieldPasswordUseCase(),
DatePickerUseCase(),
AutoCompleteUseCase(),
BadgeUseCase(),
MaterialBannerUseCase(),
NavigationBarUseCase(),
TextButtonUseCase(),
RadioListTileUseCase(),
];
| flutter/dev/a11y_assessments/lib/use_cases/use_cases.dart/0 | {
"file_path": "flutter/dev/a11y_assessments/lib/use_cases/use_cases.dart",
"repo_id": "flutter",
"token_count": 322
} | 476 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:a11y_assessments/use_cases/text_field.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'test_utils.dart';
void main() {
testWidgets('text field can run', (WidgetTester tester) async {
await pumpsUseCase(tester, TextFieldUseCase());
expect(find.byType(TextField), findsExactly(2));
// Test the enabled text field
{
final Finder finder = find.byKey(const Key('enabled text field'));
await tester.tap(finder);
await tester.pumpAndSettle();
await tester.enterText(finder, 'abc');
await tester.pumpAndSettle();
expect(find.text('abc'), findsOneWidget);
}
// Test the disabled text field
{
final Finder finder = find.byKey(const Key('disabled text field'));
final TextField textField = tester.widget<TextField>(finder);
expect(textField.enabled, isFalse);
}
});
}
| flutter/dev/a11y_assessments/test/text_field_test.dart/0 | {
"file_path": "flutter/dev/a11y_assessments/test/text_field_test.dart",
"repo_id": "flutter",
"token_count": 384
} | 477 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/foundation.dart';
import 'package:flutter_test/flutter_test.dart';
class TestTestBinding extends AutomatedTestWidgetsFlutterBinding {
@override
DebugPrintCallback get debugPrintOverride => testPrint;
static void testPrint(String? message, { int? wrapWidth }) { print(message); }
}
Future<void> helperFunction(WidgetTester tester) async {
await tester.pump();
}
void main() {
TestTestBinding();
testWidgets('TestAsyncUtils - handling unguarded async helper functions', (WidgetTester tester) async {
helperFunction(tester);
helperFunction(tester);
// this should fail
});
}
| flutter/dev/automated_tests/flutter_test/test_async_utils_unguarded_test.dart/0 | {
"file_path": "flutter/dev/automated_tests/flutter_test/test_async_utils_unguarded_test.dart",
"repo_id": "flutter",
"token_count": 238
} | 478 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:io' as system;
import 'package:flutter_test/flutter_test.dart';
// this is a test to make sure our tests consider engine crashes to be failures
// see //flutter/dev/bots/test.dart
void main() {
test('test smoke test -- this test should fail', () async {
if (system.Process.killPid(system.pid, system.ProcessSignal.sigsegv)) {
print('system.Process.killPid returned before the process ended!');
print('Sleeping for a few seconds just in case signal delivery is delayed or our signal handler is being slow...');
system.sleep(const Duration(seconds: 10)); // don't sleep too much, we must not time out
} else {
print('system.Process.killPid reports that the SIGSEGV signal was not delivered!');
}
print('crash1_test.dart will now probably not crash, which will ruin the test.');
});
}
| flutter/dev/automated_tests/test_smoke_test/crash1_test.dart/0 | {
"file_path": "flutter/dev/automated_tests/test_smoke_test/crash1_test.dart",
"repo_id": "flutter",
"token_count": 311
} | 479 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
// Various tests to verify that animated image filtered layers do not
// dirty children even without explicit repaint boundaries. These intentionally use
// text to ensure we don't measure the opacity peephole case.
class AnimatedBlurBackdropFilter extends StatefulWidget {
const AnimatedBlurBackdropFilter({ super.key });
@override
State<AnimatedBlurBackdropFilter> createState() => _AnimatedBlurBackdropFilterState();
}
class _AnimatedBlurBackdropFilterState extends State<AnimatedBlurBackdropFilter> with SingleTickerProviderStateMixin {
late final AnimationController controller = AnimationController(vsync: this, duration: const Duration(milliseconds: 5000));
late final Animation<double> animation = controller.drive(Tween<double>(begin: 0.0, end: 1.0));
ui.ImageFilter imageFilter = ui.ImageFilter.blur();
@override
void initState() {
super.initState();
controller.repeat();
animation.addListener(() {
setState(() {
imageFilter = ui.ImageFilter.blur(
sigmaX: animation.value * 16,
sigmaY: animation.value * 16,
tileMode: TileMode.decal,
);
});
});
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Stack(
children: <Widget>[
ListView(
children: <Widget>[
for (int i = 0; i < 30; i++)
Center(
child: Transform.scale(scale: 1.01, child: const ModeratelyComplexWidget()),
),
],
),
BackdropFilter(
filter: imageFilter,
child: const SizedBox.expand(),
),
],
),
),
);
}
}
class ModeratelyComplexWidget extends StatelessWidget {
const ModeratelyComplexWidget({ super.key });
@override
Widget build(BuildContext context) {
return const Material(
elevation: 10,
clipBehavior: Clip.hardEdge,
child: ListTile(
leading: Icon(Icons.abc, size: 24),
title: DecoratedBox(decoration: BoxDecoration(color: Colors.red), child: Text('Hello World')),
trailing: FlutterLogo(),
),
);
}
}
| flutter/dev/benchmarks/macrobenchmarks/lib/src/animated_blur_backdrop_filter.dart/0 | {
"file_path": "flutter/dev/benchmarks/macrobenchmarks/lib/src/animated_blur_backdrop_filter.dart",
"repo_id": "flutter",
"token_count": 985
} | 480 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:math';
import 'dart:ui';
import 'package:flutter/material.dart';
enum FilterType {
opacity, rotateTransform, rotateFilter,
}
class FilteredChildAnimationPage extends StatefulWidget {
const FilteredChildAnimationPage(this.initialFilterType, {
super.key,
this.initialComplexChild = true,
this.initialUseRepaintBoundary = true,
});
final FilterType initialFilterType;
final bool initialComplexChild;
final bool initialUseRepaintBoundary;
@override
State<FilteredChildAnimationPage> createState() => _FilteredChildAnimationPageState();
}
class _FilteredChildAnimationPageState extends State<FilteredChildAnimationPage> with SingleTickerProviderStateMixin {
late AnimationController _controller;
final GlobalKey _childKey = GlobalKey(debugLabel: 'child to animate');
Offset _childCenter = Offset.zero;
FilterType? _filterType;
late bool _complexChild;
late bool _useRepaintBoundary;
@override
void initState() {
super.initState();
_filterType = widget.initialFilterType;
_complexChild = widget.initialComplexChild;
_useRepaintBoundary = widget.initialUseRepaintBoundary;
WidgetsBinding.instance.addPostFrameCallback((_) {
final RenderBox childBox = _childKey.currentContext!.findRenderObject()! as RenderBox;
_childCenter = childBox.paintBounds.center;
});
_controller = AnimationController(vsync: this, duration: const Duration(seconds: 2));
_controller.repeat();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
void _setFilterType(FilterType type, bool selected) {
setState(() => _filterType = selected ? type : null);
}
String get _title {
return switch (_filterType) {
FilterType.opacity => 'Fading Child Animation',
FilterType.rotateTransform => 'Transformed Child Animation',
FilterType.rotateFilter => 'Matrix Filtered Child Animation',
null => 'Static Child',
};
}
static Widget _makeChild(int rows, int cols, double fontSize, bool complex) {
final BoxDecoration decoration = BoxDecoration(
color: Colors.green,
boxShadow: complex ? <BoxShadow>[
const BoxShadow(
blurRadius: 10.0,
),
] : null,
borderRadius: BorderRadius.circular(10.0),
);
return Stack(
alignment: Alignment.center,
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: List<Widget>.generate(rows, (int r) => Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: List<Widget>.generate(cols, (int c) => Container(
decoration: decoration,
child: Text('text', style: TextStyle(fontSize: fontSize)),
)),
)),
),
const Text('child',
style: TextStyle(
color: Colors.blue,
fontSize: 36,
),
),
],
);
}
Widget _animate({required Widget child, required bool protectChild}) {
if (_filterType == null) {
_controller.reset();
return child;
}
final FilterType filterType = _filterType!;
_controller.repeat();
Widget Function(BuildContext, Widget?) builder;
switch (filterType) {
case FilterType.opacity:
builder = (BuildContext context, Widget? child) => Opacity(
opacity: (_controller.value * 2.0 - 1.0).abs(),
child: child,
);
case FilterType.rotateTransform:
builder = (BuildContext context, Widget? child) => Transform(
transform: Matrix4.rotationZ(_controller.value * 2.0 * pi),
alignment: Alignment.center,
filterQuality: FilterQuality.low,
child: child,
);
case FilterType.rotateFilter:
builder = (BuildContext context, Widget? child) => ImageFiltered(
imageFilter: ImageFilter.matrix((
Matrix4.identity()
..translate(_childCenter.dx, _childCenter.dy)
..rotateZ(_controller.value * 2.0 * pi)
..translate(- _childCenter.dx, - _childCenter.dy)
).storage),
child: child,
);
}
return RepaintBoundary(
child: AnimatedBuilder(
animation: _controller,
builder: builder,
child: protectChild ? RepaintBoundary(child: child) : child,
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(_title),
),
body: Center(
child: _animate(
child: Container(
key: _childKey,
color: Colors.yellow,
width: 300,
height: 300,
child: Center(
child: _makeChild(4, 3, 24.0, _complexChild),
),
),
protectChild: _useRepaintBoundary,
),
),
bottomNavigationBar: BottomAppBar(
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text('Opacity:'),
Checkbox(
value: _filterType == FilterType.opacity,
onChanged: (bool? b) => _setFilterType(FilterType.opacity, b ?? false),
),
const Text('Tx Rotate:'),
Checkbox(
value: _filterType == FilterType.rotateTransform,
onChanged: (bool? b) => _setFilterType(FilterType.rotateTransform, b ?? false),
),
const Text('IF Rotate:'),
Checkbox(
value: _filterType == FilterType.rotateFilter,
onChanged: (bool? b) => _setFilterType(FilterType.rotateFilter, b ?? false),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text('Complex child:'),
Checkbox(
value: _complexChild,
onChanged: (bool? b) => setState(() => _complexChild = b ?? false),
),
const Text('RPB on child:'),
Checkbox(
value: _useRepaintBoundary,
onChanged: (bool? b) => setState(() => _useRepaintBoundary = b ?? false),
),
],
),
],
),
),
);
}
}
| flutter/dev/benchmarks/macrobenchmarks/lib/src/filtered_child_animation.dart/0 | {
"file_path": "flutter/dev/benchmarks/macrobenchmarks/lib/src/filtered_child_animation.dart",
"repo_id": "flutter",
"token_count": 2977
} | 481 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
class SimpleScroll extends StatelessWidget {
const SimpleScroll({super.key});
@override
Widget build(BuildContext context) {
return ListView(
children: <Widget>[
for (int n = 0; n < 200; n += 1)
SizedBox(height: 40.0, child: Text('$n')),
],
);
}
}
| flutter/dev/benchmarks/macrobenchmarks/lib/src/simple_scroll.dart/0 | {
"file_path": "flutter/dev/benchmarks/macrobenchmarks/lib/src/simple_scroll.dart",
"repo_id": "flutter",
"token_count": 178
} | 482 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/semantics.dart';
import 'material3.dart';
import 'recorder.dart';
/// Measures the cost of semantics when constructing screens containing
/// Material 3 widgets.
class BenchMaterial3Semantics extends WidgetBuildRecorder {
BenchMaterial3Semantics() : super(name: benchmarkName);
static const String benchmarkName = 'bench_material3_semantics';
@override
Future<void> setUpAll() async {
FlutterTimeline.debugCollectionEnabled = true;
super.setUpAll();
SemanticsBinding.instance.ensureSemantics();
}
@override
Future<void> tearDownAll() async {
FlutterTimeline.debugReset();
}
@override
void frameDidDraw() {
// Only record frames that show the widget. Frames that remove the widget
// are not interesting.
if (showWidget) {
final AggregatedTimings timings = FlutterTimeline.debugCollect();
final AggregatedTimedBlock semanticsBlock = timings.getAggregated('SEMANTICS');
final AggregatedTimedBlock getFragmentBlock = timings.getAggregated('Semantics.GetFragment');
final AggregatedTimedBlock compileChildrenBlock = timings.getAggregated('Semantics.compileChildren');
profile!.addTimedBlock(semanticsBlock, reported: true);
profile!.addTimedBlock(getFragmentBlock, reported: true);
profile!.addTimedBlock(compileChildrenBlock, reported: true);
}
super.frameDidDraw();
FlutterTimeline.debugReset();
}
@override
Widget createWidget() {
return const SingleColumnMaterial3Components();
}
}
/// Measures the cost of semantics when scrolling screens containing Material 3
/// widgets.
///
/// The implementation uses a ListView that jumps the scroll position between
/// 0 and 1 every frame. Such a small delta is not enough for lazy rendering to
/// add/remove widgets, but its enough to trigger the framework to recompute
/// some of the semantics.
///
/// The expected output numbers of this benchmarks should be very small as
/// scrolling a list view should be a matter of shifting some widgets and
/// updating the projected clip imposed by the viewport. As of June 2023, the
/// numbers are not great. Semantics consumes >50% of frame time.
class BenchMaterial3ScrollSemantics extends WidgetRecorder {
BenchMaterial3ScrollSemantics() : super(name: benchmarkName);
static const String benchmarkName = 'bench_material3_scroll_semantics';
@override
Future<void> setUpAll() async {
FlutterTimeline.debugCollectionEnabled = true;
super.setUpAll();
SemanticsBinding.instance.ensureSemantics();
}
@override
Future<void> tearDownAll() async {
FlutterTimeline.debugReset();
}
@override
void frameDidDraw() {
final AggregatedTimings timings = FlutterTimeline.debugCollect();
final AggregatedTimedBlock semanticsBlock = timings.getAggregated('SEMANTICS');
final AggregatedTimedBlock getFragmentBlock = timings.getAggregated('Semantics.GetFragment');
final AggregatedTimedBlock compileChildrenBlock = timings.getAggregated('Semantics.compileChildren');
profile!.addTimedBlock(semanticsBlock, reported: true);
profile!.addTimedBlock(getFragmentBlock, reported: true);
profile!.addTimedBlock(compileChildrenBlock, reported: true);
super.frameDidDraw();
FlutterTimeline.debugReset();
}
@override
Widget createWidget() => _ScrollTest();
}
class _ScrollTest extends StatefulWidget {
@override
State<_ScrollTest> createState() => _ScrollTestState();
}
class _ScrollTestState extends State<_ScrollTest> with SingleTickerProviderStateMixin {
late final Ticker ticker;
late final ScrollController scrollController;
@override
void initState() {
super.initState();
scrollController = ScrollController();
bool forward = true;
// A one-off timer is necessary to allow the framework to measure the
// available scroll extents before the scroll controller can be exercised
// to change the scroll position.
Timer.run(() {
ticker = createTicker((_) {
scrollController.jumpTo(forward ? 1 : 0);
forward = !forward;
});
ticker.start();
});
}
@override
void dispose() {
ticker.dispose();
scrollController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return SingleColumnMaterial3Components(
scrollController: scrollController,
);
}
}
| flutter/dev/benchmarks/macrobenchmarks/lib/src/web/bench_material_3_semantics.dart/0 | {
"file_path": "flutter/dev/benchmarks/macrobenchmarks/lib/src/web/bench_material_3_semantics.dart",
"repo_id": "flutter",
"token_count": 1434
} | 483 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:convert' show json;
import 'dart:js_interop';
import 'dart:math' as math;
import 'package:web/web.dart' as web;
import 'src/web/bench_build_image.dart';
import 'src/web/bench_build_material_checkbox.dart';
import 'src/web/bench_card_infinite_scroll.dart';
import 'src/web/bench_child_layers.dart';
import 'src/web/bench_clipped_out_pictures.dart';
import 'src/web/bench_default_target_platform.dart';
import 'src/web/bench_draw_rect.dart';
import 'src/web/bench_dynamic_clip_on_static_picture.dart';
import 'src/web/bench_harness.dart';
import 'src/web/bench_image_decoding.dart';
import 'src/web/bench_material_3.dart';
import 'src/web/bench_material_3_semantics.dart';
import 'src/web/bench_mouse_region_grid_hover.dart';
import 'src/web/bench_mouse_region_grid_scroll.dart';
import 'src/web/bench_mouse_region_mixed_grid_hover.dart';
import 'src/web/bench_pageview_scroll_linethrough.dart';
import 'src/web/bench_paths.dart';
import 'src/web/bench_picture_recording.dart';
import 'src/web/bench_platform_view_infinite_scroll.dart';
import 'src/web/bench_simple_lazy_text_scroll.dart';
import 'src/web/bench_text_layout.dart';
import 'src/web/bench_text_out_of_picture_bounds.dart';
import 'src/web/bench_wrapbox_scroll.dart';
import 'src/web/recorder.dart';
typedef RecorderFactory = Recorder Function();
const bool isCanvasKit = bool.fromEnvironment('FLUTTER_WEB_USE_SKIA');
const bool isSkwasm = bool.fromEnvironment('FLUTTER_WEB_USE_SKWASM');
/// List of all benchmarks that run in the devicelab.
///
/// When adding a new benchmark, add it to this map. Make sure that the name
/// of your benchmark is unique.
final Map<String, RecorderFactory> benchmarks = <String, RecorderFactory>{
// Benchmarks the overhead of the benchmark harness itself.
BenchRawRecorder.benchmarkName: () => BenchRawRecorder(),
BenchWidgetRecorder.benchmarkName: () => BenchWidgetRecorder(),
BenchWidgetBuildRecorder.benchmarkName: () => BenchWidgetBuildRecorder(),
BenchSceneBuilderRecorder.benchmarkName: () => BenchSceneBuilderRecorder(),
// Benchmarks that run in all renderers.
BenchDefaultTargetPlatform.benchmarkName: () => BenchDefaultTargetPlatform(),
BenchBuildImage.benchmarkName: () => BenchBuildImage(),
BenchCardInfiniteScroll.benchmarkName: () => BenchCardInfiniteScroll.forward(),
BenchCardInfiniteScroll.benchmarkNameBackward: () => BenchCardInfiniteScroll.backward(),
BenchClippedOutPictures.benchmarkName: () => BenchClippedOutPictures(),
BenchDrawRect.benchmarkName: () => BenchDrawRect.staticPaint(),
BenchDrawRect.variablePaintBenchmarkName: () => BenchDrawRect.variablePaint(),
BenchPathRecording.benchmarkName: () => BenchPathRecording(),
BenchTextOutOfPictureBounds.benchmarkName: () => BenchTextOutOfPictureBounds(),
BenchSimpleLazyTextScroll.benchmarkName: () => BenchSimpleLazyTextScroll(),
BenchBuildMaterialCheckbox.benchmarkName: () => BenchBuildMaterialCheckbox(),
BenchDynamicClipOnStaticPicture.benchmarkName: () => BenchDynamicClipOnStaticPicture(),
BenchPageViewScrollLineThrough.benchmarkName: () => BenchPageViewScrollLineThrough(),
BenchPictureRecording.benchmarkName: () => BenchPictureRecording(),
BenchUpdateManyChildLayers.benchmarkName: () => BenchUpdateManyChildLayers(),
BenchMouseRegionGridScroll.benchmarkName: () => BenchMouseRegionGridScroll(),
BenchMouseRegionGridHover.benchmarkName: () => BenchMouseRegionGridHover(),
BenchMouseRegionMixedGridHover.benchmarkName: () => BenchMouseRegionMixedGridHover(),
BenchWrapBoxScroll.benchmarkName: () => BenchWrapBoxScroll(),
if (!isSkwasm) ...<String, RecorderFactory>{
// Platform views are not yet supported with Skwasm.
// https://github.com/flutter/flutter/issues/126346
BenchPlatformViewInfiniteScroll.benchmarkName: () => BenchPlatformViewInfiniteScroll.forward(),
BenchPlatformViewInfiniteScroll.benchmarkNameBackward: () => BenchPlatformViewInfiniteScroll.backward(),
},
BenchMaterial3Components.benchmarkName: () => BenchMaterial3Components(),
BenchMaterial3Semantics.benchmarkName: () => BenchMaterial3Semantics(),
BenchMaterial3ScrollSemantics.benchmarkName: () => BenchMaterial3ScrollSemantics(),
// Skia-only benchmarks
if (isCanvasKit || isSkwasm) ...<String, RecorderFactory>{
BenchTextLayout.canvasKitBenchmarkName: () => BenchTextLayout.canvasKit(),
BenchBuildColorsGrid.canvasKitBenchmarkName: () => BenchBuildColorsGrid.canvasKit(),
BenchTextCachedLayout.canvasKitBenchmarkName: () => BenchTextCachedLayout.canvasKit(),
// The HTML renderer does not decode frame-by-frame. It just drops an <img>
// element and lets it animate automatically with no feedback to the
// framework. So this benchmark only makes sense in CanvasKit.
BenchImageDecoding.benchmarkName: () => BenchImageDecoding(),
},
// HTML-only benchmarks
if (!isCanvasKit && !isSkwasm) ...<String, RecorderFactory>{
BenchTextLayout.canvasBenchmarkName: () => BenchTextLayout.canvas(),
BenchTextCachedLayout.canvasBenchmarkName: () => BenchTextCachedLayout.canvas(),
BenchBuildColorsGrid.canvasBenchmarkName: () => BenchBuildColorsGrid.canvas(),
},
};
final LocalBenchmarkServerClient _client = LocalBenchmarkServerClient();
Future<void> main() async {
// Check if the benchmark server wants us to run a specific benchmark.
final String nextBenchmark = await _client.requestNextBenchmark();
if (nextBenchmark == LocalBenchmarkServerClient.kManualFallback) {
_fallbackToManual('The server did not tell us which benchmark to run next.');
return;
}
await _runBenchmark(nextBenchmark);
web.window.location.reload();
}
Future<void> _runBenchmark(String benchmarkName) async {
final RecorderFactory? recorderFactory = benchmarks[benchmarkName];
if (recorderFactory == null) {
_fallbackToManual('Benchmark $benchmarkName not found.');
return;
}
await runZoned<Future<void>>(
() async {
final Recorder recorder = recorderFactory();
final Runner runner = recorder.isTracingEnabled && !_client.isInManualMode
? Runner(
recorder: recorder,
setUpAllDidRun: () => _client.startPerformanceTracing(benchmarkName),
tearDownAllWillRun: _client.stopPerformanceTracing,
)
: Runner(recorder: recorder);
final Profile profile = await runner.run();
if (!_client.isInManualMode) {
await _client.sendProfileData(profile);
} else {
_printResultsToScreen(profile);
print(profile);
}
},
zoneSpecification: ZoneSpecification(
print: (Zone self, ZoneDelegate parent, Zone zone, String line) async {
if (_client.isInManualMode) {
parent.print(zone, '[$benchmarkName] $line');
} else {
await _client.printToConsole(line);
}
},
handleUncaughtError: (
Zone self,
ZoneDelegate parent,
Zone zone, Object error,
StackTrace stackTrace,
) async {
if (_client.isInManualMode) {
parent.print(zone, '[$benchmarkName] $error, $stackTrace');
parent.handleUncaughtError(zone, error, stackTrace);
} else {
await _client.reportError(error, stackTrace);
}
},
),
);
}
extension WebHTMLElementExtension on web.HTMLElement {
void appendHtml(String html) {
final web.HTMLDivElement div = web.document.createElement('div') as
web.HTMLDivElement;
div.innerHTML = html;
final web.DocumentFragment fragment = web.document.createDocumentFragment();
fragment.append(div as JSAny);
web.document.adoptNode(fragment);
append(fragment as JSAny);
}
}
void _fallbackToManual(String error) {
web.document.body!.appendHtml('''
<div id="manual-panel">
<h3>$error</h3>
<p>Choose one of the following benchmarks:</p>
<!-- Absolutely position it so it receives the clicks and not the glasspane -->
<ul style="position: absolute">
${
benchmarks.keys
.map((String name) => '<li><button id="$name">$name</button></li>')
.join('\n')
}
</ul>
</div>
''');
for (final String benchmarkName in benchmarks.keys) {
final web.Element button = web.document.querySelector('#$benchmarkName')!;
button.addEventListener('click', (JSObject _) {
final web.Element? manualPanel =
web.document.querySelector('#manual-panel');
manualPanel?.remove();
_runBenchmark(benchmarkName);
}.toJS);
}
}
/// Visualizes results on the Web page for manual inspection.
void _printResultsToScreen(Profile profile) {
web.document.body!.remove();
web.document.body = web.document.createElement('body') as web.HTMLBodyElement;
web.document.body!.appendHtml('<h2>${profile.name}</h2>');
profile.scoreData.forEach((String scoreKey, Timeseries timeseries) {
web.document.body!.appendHtml('<h2>$scoreKey</h2>');
web.document.body!.appendHtml('<pre>${timeseries.computeStats()}</pre>');
web.document.body!.append(TimeseriesVisualization(timeseries).render() as JSAny);
});
}
/// Draws timeseries data and statistics on a canvas.
class TimeseriesVisualization {
TimeseriesVisualization(this._timeseries) {
_stats = _timeseries.computeStats();
_canvas = web.document.createElement('canvas') as web.HTMLCanvasElement;
_screenWidth = web.window.screen.width;
_canvas.width = _screenWidth;
_canvas.height = (_kCanvasHeight * web.window.devicePixelRatio).round();
_canvas.style
..setProperty('width', '100%')
..setProperty('height', '${_kCanvasHeight}px')
..setProperty('outline', '1px solid green');
_ctx = _canvas.getContext('2d')! as web.CanvasRenderingContext2D;
// The amount of vertical space available on the chart. Because some
// outliers can be huge they can dwarf all the useful values. So we
// limit it to 1.5 x the biggest non-outlier.
_maxValueChartRange = 1.5 * _stats.samples
.where((AnnotatedSample sample) => !sample.isOutlier)
.map<double>((AnnotatedSample sample) => sample.magnitude)
.fold<double>(0, math.max);
}
static const double _kCanvasHeight = 200;
final Timeseries _timeseries;
late TimeseriesStats _stats;
late web.HTMLCanvasElement _canvas;
late web.CanvasRenderingContext2D _ctx;
late int _screenWidth;
// Used to normalize benchmark values to chart height.
late double _maxValueChartRange;
/// Converts a sample value to vertical canvas coordinates.
///
/// This does not work for horizontal coordinates.
double _normalized(double value) {
return _kCanvasHeight * value / _maxValueChartRange;
}
/// A utility for drawing lines.
void drawLine(num x1, num y1, num x2, num y2) {
_ctx.beginPath();
_ctx.moveTo(x1.toDouble(), y1.toDouble());
_ctx.lineTo(x2.toDouble(), y2.toDouble());
_ctx.stroke();
}
/// Renders the timeseries into a `<canvas>` and returns the canvas element.
web.HTMLCanvasElement render() {
_ctx.translate(0, _kCanvasHeight * web.window.devicePixelRatio);
_ctx.scale(1, -web.window.devicePixelRatio);
final double barWidth = _screenWidth / _stats.samples.length;
double xOffset = 0;
for (int i = 0; i < _stats.samples.length; i++) {
final AnnotatedSample sample = _stats.samples[i];
if (sample.isWarmUpValue) {
// Put gray background behind warm-up samples.
_ctx.fillStyle = 'rgba(200,200,200,1)'.toJS;
_ctx.fillRect(xOffset, 0, barWidth, _normalized(_maxValueChartRange));
}
if (sample.magnitude > _maxValueChartRange) {
// The sample value is so big it doesn't fit on the chart. Paint it purple.
_ctx.fillStyle = 'rgba(100,50,100,0.8)'.toJS;
} else if (sample.isOutlier) {
// The sample is an outlier, color it light red.
_ctx.fillStyle = 'rgba(255,50,50,0.6)'.toJS;
} else {
// A non-outlier sample, color it light blue.
_ctx.fillStyle = 'rgba(50,50,255,0.6)'.toJS;
}
_ctx.fillRect(xOffset, 0, barWidth - 1, _normalized(sample.magnitude));
xOffset += barWidth;
}
// Draw a horizontal solid line corresponding to the average.
_ctx.lineWidth = 1;
drawLine(0, _normalized(_stats.average), _screenWidth, _normalized(_stats.average));
// Draw a horizontal dashed line corresponding to the outlier cut off.
_ctx.setLineDash(<JSNumber>[5.toJS, 5.toJS].toJS);
drawLine(0, _normalized(_stats.outlierCutOff), _screenWidth, _normalized(_stats.outlierCutOff));
// Draw a light red band that shows the noise (1 stddev in each direction).
_ctx.fillStyle = 'rgba(255,50,50,0.3)'.toJS;
_ctx.fillRect(
0,
_normalized(_stats.average * (1 - _stats.noise)),
_screenWidth.toDouble(),
_normalized(2 * _stats.average * _stats.noise),
);
return _canvas;
}
}
/// Implements the client REST API for the local benchmark server.
///
/// The local server is optional. If it is not available the benchmark UI must
/// implement a manual fallback. This allows debugging benchmarks using plain
/// `flutter run`.
class LocalBenchmarkServerClient {
/// This value is returned by [requestNextBenchmark].
static const String kManualFallback = '__manual_fallback__';
/// Whether we fell back to manual mode.
///
/// This happens when you run benchmarks using plain `flutter run` rather than
/// devicelab test harness. The test harness spins up a special server that
/// provides API for automatically picking the next benchmark to run.
bool isInManualMode = false;
/// Asks the local server for the name of the next benchmark to run.
///
/// Returns [kManualFallback] if local server is not available (uses 404 as a
/// signal).
Future<String> requestNextBenchmark() async {
final web.XMLHttpRequest request = await _requestXhr(
'/next-benchmark',
method: 'POST',
mimeType: 'application/json',
sendData: json.encode(benchmarks.keys.toList()),
);
// 404 is expected in the following cases:
// - The benchmark is ran using plain `flutter run`, which does not provide "next-benchmark" handler.
// - We ran all benchmarks and the benchmark is telling us there are no more benchmarks to run.
if (request.status != 200) {
isInManualMode = true;
return kManualFallback;
}
isInManualMode = false;
return request.responseText;
}
void _checkNotManualMode() {
if (isInManualMode) {
throw StateError('Operation not supported in manual fallback mode.');
}
}
/// Asks the local server to begin tracing performance.
///
/// This uses the chrome://tracing tracer, which is not available from within
/// the page itself, and therefore must be controlled from outside using the
/// DevTools Protocol.
Future<void> startPerformanceTracing(String benchmarkName) async {
_checkNotManualMode();
await _requestXhr(
'/start-performance-tracing?label=$benchmarkName',
method: 'POST',
mimeType: 'application/json',
);
}
/// Stops the performance tracing session started by [startPerformanceTracing].
Future<void> stopPerformanceTracing() async {
_checkNotManualMode();
await _requestXhr(
'/stop-performance-tracing',
method: 'POST',
mimeType: 'application/json',
);
}
/// Sends the profile data collected by the benchmark to the local benchmark
/// server.
Future<void> sendProfileData(Profile profile) async {
_checkNotManualMode();
final web.XMLHttpRequest request = await _requestXhr(
'/profile-data',
method: 'POST',
mimeType: 'application/json',
sendData: json.encode(profile.toJson()),
);
if (request.status != 200) {
throw Exception(
'Failed to report profile data to benchmark server. '
'The server responded with status code ${request.status}.'
);
}
}
/// Reports an error to the benchmark server.
///
/// The server will halt the devicelab task and log the error.
Future<void> reportError(dynamic error, StackTrace stackTrace) async {
_checkNotManualMode();
await _requestXhr(
'/on-error',
method: 'POST',
mimeType: 'application/json',
sendData: json.encode(<String, dynamic>{
'error': '$error',
'stackTrace': '$stackTrace',
}),
);
}
/// Reports a message about the demo to the benchmark server.
Future<void> printToConsole(String report) async {
_checkNotManualMode();
await _requestXhr(
'/print-to-console',
method: 'POST',
mimeType: 'text/plain',
sendData: report,
);
}
/// This is the same as calling [html.HttpRequest.request] but it doesn't
/// crash on 404, which we use to detect `flutter run`.
Future<web.XMLHttpRequest> _requestXhr(
String url, {
String? method,
bool? withCredentials,
String? responseType,
String? mimeType,
Map<String, String>? requestHeaders,
dynamic sendData,
}) {
final Completer<web.XMLHttpRequest> completer = Completer<web.XMLHttpRequest>();
final web.XMLHttpRequest xhr = web.XMLHttpRequest();
method ??= 'GET';
xhr.open(method, url, true);
if (withCredentials != null) {
xhr.withCredentials = withCredentials;
}
if (responseType != null) {
xhr.responseType = responseType;
}
if (mimeType != null) {
xhr.overrideMimeType(mimeType);
}
if (requestHeaders != null) {
requestHeaders.forEach((String header, String value) {
xhr.setRequestHeader(header, value);
});
}
xhr.addEventListener('load', (web.ProgressEvent e) {
completer.complete(xhr);
}.toJS);
xhr.addEventListener('error', (JSObject error) {
return completer.completeError(error);
}.toJS);
if (sendData != null) {
xhr.send((sendData as Object?).jsify());
} else {
xhr.send();
}
return completer.future;
}
}
| flutter/dev/benchmarks/macrobenchmarks/lib/web_benchmarks.dart/0 | {
"file_path": "flutter/dev/benchmarks/macrobenchmarks/lib/web_benchmarks.dart",
"repo_id": "flutter",
"token_count": 6417
} | 484 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/foundation.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:macrobenchmarks/common.dart';
import 'util.dart';
void main() {
macroPerfTestE2E(
'fullscreen_textfield_perf',
kFullscreenTextRouteName,
pageDelay: const Duration(seconds: 1),
body: (WidgetController controller) async {
final Finder textfield = find.byKey(const ValueKey<String>('fullscreen-textfield'));
controller.tap(textfield);
await Future<void>.delayed(const Duration(milliseconds: 5000));
},
);
}
| flutter/dev/benchmarks/macrobenchmarks/test/fullscreen_textfield_perf_e2e.dart/0 | {
"file_path": "flutter/dev/benchmarks/macrobenchmarks/test/fullscreen_textfield_perf_e2e.dart",
"repo_id": "flutter",
"token_count": 242
} | 485 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
dependencyLocking {
ignoredDependencies.add('io.flutter:*')
lockFile = file("${rootProject.projectDir}/project-${project.name}.lockfile")
lockAllConfigurations()
}
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
| flutter/dev/benchmarks/microbenchmarks/android/build.gradle/0 | {
"file_path": "flutter/dev/benchmarks/microbenchmarks/android/build.gradle",
"repo_id": "flutter",
"token_count": 247
} | 486 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/gestures.dart';
/// Data for velocity_tracker_bench.dart
final List<PointerEvent> velocityEventData = <PointerEvent>[
const PointerDownEvent(
timeStamp: Duration(milliseconds: 216690896),
pointer: 1,
position: Offset(270.0, 538.2857055664062),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216690906),
pointer: 1,
position: Offset(270.0, 538.2857055664062),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216690951),
pointer: 1,
position: Offset(270.0, 530.8571166992188),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216690959),
pointer: 1,
position: Offset(270.0, 526.8571166992188),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216690967),
pointer: 1,
position: Offset(270.0, 521.4285888671875),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216690975),
pointer: 1,
position: Offset(270.0, 515.4285888671875),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216690983),
pointer: 1,
position: Offset(270.0, 506.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216690991),
pointer: 1,
position: Offset(268.8571472167969, 496.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216690998),
pointer: 1,
position: Offset(267.4285583496094, 483.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691006),
pointer: 1,
position: Offset(266.28570556640625, 469.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691014),
pointer: 1,
position: Offset(265.4285583496094, 456.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691021),
pointer: 1,
position: Offset(264.28570556640625, 443.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691029),
pointer: 1,
position: Offset(264.0, 431.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691036),
pointer: 1,
position: Offset(263.4285583496094, 421.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691044),
pointer: 1,
position: Offset(263.4285583496094, 412.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691052),
pointer: 1,
position: Offset(263.4285583496094, 404.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691060),
pointer: 1,
position: Offset(263.4285583496094, 396.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691068),
pointer: 1,
position: Offset(264.5714416503906, 390.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691075),
pointer: 1,
position: Offset(265.1428527832031, 384.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691083),
pointer: 1,
position: Offset(266.0, 380.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691091),
pointer: 1,
position: Offset(266.5714416503906, 376.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691098),
pointer: 1,
position: Offset(267.1428527832031, 373.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691106),
pointer: 1,
position: Offset(267.71429443359375, 370.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691114),
pointer: 1,
position: Offset(268.28570556640625, 367.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691121),
pointer: 1,
position: Offset(268.5714416503906, 366.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691130),
pointer: 1,
position: Offset(268.8571472167969, 364.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691137),
pointer: 1,
position: Offset(269.1428527832031, 363.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691145),
pointer: 1,
position: Offset(269.1428527832031, 362.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691153),
pointer: 1,
position: Offset(269.4285583496094, 362.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691168),
pointer: 1,
position: Offset(268.5714416503906, 365.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691176),
pointer: 1,
position: Offset(267.1428527832031, 370.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691183),
pointer: 1,
position: Offset(265.4285583496094, 376.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691191),
pointer: 1,
position: Offset(263.1428527832031, 385.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691199),
pointer: 1,
position: Offset(261.4285583496094, 396.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691207),
pointer: 1,
position: Offset(259.71429443359375, 408.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691215),
pointer: 1,
position: Offset(258.28570556640625, 419.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691222),
pointer: 1,
position: Offset(257.4285583496094, 428.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691230),
pointer: 1,
position: Offset(256.28570556640625, 436.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691238),
pointer: 1,
position: Offset(255.7142791748047, 442.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691245),
pointer: 1,
position: Offset(255.14285278320312, 447.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691253),
pointer: 1,
position: Offset(254.85714721679688, 453.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691261),
pointer: 1,
position: Offset(254.57142639160156, 458.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691268),
pointer: 1,
position: Offset(254.2857208251953, 463.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691276),
pointer: 1,
position: Offset(254.2857208251953, 470.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691284),
pointer: 1,
position: Offset(254.2857208251953, 477.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691292),
pointer: 1,
position: Offset(255.7142791748047, 487.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691300),
pointer: 1,
position: Offset(256.8571472167969, 498.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691307),
pointer: 1,
position: Offset(258.28570556640625, 507.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691315),
pointer: 1,
position: Offset(259.4285583496094, 516.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691323),
pointer: 1,
position: Offset(260.28570556640625, 521.7142944335938),
),
const PointerUpEvent(
timeStamp: Duration(milliseconds: 216691338),
pointer: 1,
position: Offset(260.28570556640625, 521.7142944335938),
),
const PointerDownEvent(
timeStamp: Duration(milliseconds: 216691573),
pointer: 2,
position: Offset(266.0, 327.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691588),
pointer: 2,
position: Offset(266.0, 327.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691626),
pointer: 2,
position: Offset(261.1428527832031, 337.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691634),
pointer: 2,
position: Offset(258.28570556640625, 343.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691642),
pointer: 2,
position: Offset(254.57142639160156, 354.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691650),
pointer: 2,
position: Offset(250.2857208251953, 368.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691657),
pointer: 2,
position: Offset(247.42857360839844, 382.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691665),
pointer: 2,
position: Offset(245.14285278320312, 397.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691673),
pointer: 2,
position: Offset(243.14285278320312, 411.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691680),
pointer: 2,
position: Offset(242.2857208251953, 426.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691688),
pointer: 2,
position: Offset(241.7142791748047, 440.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691696),
pointer: 2,
position: Offset(241.7142791748047, 454.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691703),
pointer: 2,
position: Offset(242.57142639160156, 467.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691712),
pointer: 2,
position: Offset(243.42857360839844, 477.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691720),
pointer: 2,
position: Offset(244.85714721679688, 485.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691727),
pointer: 2,
position: Offset(246.2857208251953, 493.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216691735),
pointer: 2,
position: Offset(248.0, 499.71429443359375),
),
const PointerUpEvent(
timeStamp: Duration(milliseconds: 216691750),
pointer: 2,
position: Offset(248.0, 499.71429443359375),
),
const PointerDownEvent(
timeStamp: Duration(milliseconds: 216692255),
pointer: 3,
position: Offset(249.42857360839844, 351.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692270),
pointer: 3,
position: Offset(249.42857360839844, 351.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692309),
pointer: 3,
position: Offset(246.2857208251953, 361.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692317),
pointer: 3,
position: Offset(244.0, 368.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692325),
pointer: 3,
position: Offset(241.42857360839844, 377.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692333),
pointer: 3,
position: Offset(237.7142791748047, 391.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692340),
pointer: 3,
position: Offset(235.14285278320312, 406.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692348),
pointer: 3,
position: Offset(232.57142639160156, 421.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692356),
pointer: 3,
position: Offset(230.2857208251953, 436.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692363),
pointer: 3,
position: Offset(228.2857208251953, 451.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692371),
pointer: 3,
position: Offset(227.42857360839844, 466.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692378),
pointer: 3,
position: Offset(226.2857208251953, 479.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692387),
pointer: 3,
position: Offset(225.7142791748047, 491.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692395),
pointer: 3,
position: Offset(225.14285278320312, 501.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692402),
pointer: 3,
position: Offset(224.85714721679688, 509.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692410),
pointer: 3,
position: Offset(224.57142639160156, 514.8571166992188),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692418),
pointer: 3,
position: Offset(224.2857208251953, 519.4285888671875),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692425),
pointer: 3,
position: Offset(224.0, 523.4285888671875),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692433),
pointer: 3,
position: Offset(224.0, 527.1428833007812),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692441),
pointer: 3,
position: Offset(224.0, 530.5714111328125),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692448),
pointer: 3,
position: Offset(224.0, 533.1428833007812),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692456),
pointer: 3,
position: Offset(224.0, 535.4285888671875),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692464),
pointer: 3,
position: Offset(223.7142791748047, 536.8571166992188),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692472),
pointer: 3,
position: Offset(223.7142791748047, 538.2857055664062),
),
const PointerUpEvent(
timeStamp: Duration(milliseconds: 216692487),
pointer: 3,
position: Offset(223.7142791748047, 538.2857055664062),
),
const PointerDownEvent(
timeStamp: Duration(milliseconds: 216692678),
pointer: 4,
position: Offset(221.42857360839844, 526.2857055664062),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692701),
pointer: 4,
position: Offset(220.57142639160156, 514.8571166992188),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692708),
pointer: 4,
position: Offset(220.2857208251953, 508.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692716),
pointer: 4,
position: Offset(220.2857208251953, 498.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692724),
pointer: 4,
position: Offset(221.14285278320312, 484.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692732),
pointer: 4,
position: Offset(221.7142791748047, 469.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692740),
pointer: 4,
position: Offset(223.42857360839844, 453.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692748),
pointer: 4,
position: Offset(225.7142791748047, 436.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692755),
pointer: 4,
position: Offset(229.14285278320312, 418.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692763),
pointer: 4,
position: Offset(232.85714721679688, 400.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692770),
pointer: 4,
position: Offset(236.85714721679688, 382.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692778),
pointer: 4,
position: Offset(241.14285278320312, 366.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692786),
pointer: 4,
position: Offset(244.85714721679688, 350.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216692793),
pointer: 4,
position: Offset(249.14285278320312, 335.4285583496094),
),
const PointerUpEvent(
timeStamp: Duration(milliseconds: 216692809),
pointer: 4,
position: Offset(249.14285278320312, 335.4285583496094),
),
const PointerDownEvent(
timeStamp: Duration(milliseconds: 216693222),
pointer: 5,
position: Offset(224.0, 545.4285888671875),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216693245),
pointer: 5,
position: Offset(224.0, 545.4285888671875),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216693275),
pointer: 5,
position: Offset(222.85714721679688, 535.1428833007812),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216693284),
pointer: 5,
position: Offset(222.85714721679688, 528.8571166992188),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216693291),
pointer: 5,
position: Offset(222.2857208251953, 518.5714111328125),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216693299),
pointer: 5,
position: Offset(222.0, 503.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216693307),
pointer: 5,
position: Offset(222.0, 485.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216693314),
pointer: 5,
position: Offset(221.7142791748047, 464.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216693322),
pointer: 5,
position: Offset(222.2857208251953, 440.28570556640625),
),
const PointerUpEvent(
timeStamp: Duration(milliseconds: 216693337),
pointer: 5,
position: Offset(222.2857208251953, 440.28570556640625),
),
const PointerDownEvent(
timeStamp: Duration(milliseconds: 216693985),
pointer: 6,
position: Offset(208.0, 544.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694047),
pointer: 6,
position: Offset(208.57142639160156, 532.2857055664062),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694054),
pointer: 6,
position: Offset(208.85714721679688, 525.7142944335938),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694062),
pointer: 6,
position: Offset(208.85714721679688, 515.1428833007812),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694070),
pointer: 6,
position: Offset(208.0, 501.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694077),
pointer: 6,
position: Offset(207.42857360839844, 487.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694085),
pointer: 6,
position: Offset(206.57142639160156, 472.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694092),
pointer: 6,
position: Offset(206.57142639160156, 458.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694100),
pointer: 6,
position: Offset(206.57142639160156, 446.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694108),
pointer: 6,
position: Offset(206.57142639160156, 434.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694116),
pointer: 6,
position: Offset(207.14285278320312, 423.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694124),
pointer: 6,
position: Offset(208.57142639160156, 412.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694131),
pointer: 6,
position: Offset(209.7142791748047, 402.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694139),
pointer: 6,
position: Offset(211.7142791748047, 393.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694147),
pointer: 6,
position: Offset(213.42857360839844, 385.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694154),
pointer: 6,
position: Offset(215.42857360839844, 378.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694162),
pointer: 6,
position: Offset(217.42857360839844, 371.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694169),
pointer: 6,
position: Offset(219.42857360839844, 366.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694177),
pointer: 6,
position: Offset(221.42857360839844, 360.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694185),
pointer: 6,
position: Offset(223.42857360839844, 356.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694193),
pointer: 6,
position: Offset(225.14285278320312, 352.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694201),
pointer: 6,
position: Offset(226.85714721679688, 348.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694209),
pointer: 6,
position: Offset(228.2857208251953, 346.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694216),
pointer: 6,
position: Offset(229.14285278320312, 343.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694224),
pointer: 6,
position: Offset(230.0, 342.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694232),
pointer: 6,
position: Offset(230.57142639160156, 340.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694239),
pointer: 6,
position: Offset(230.85714721679688, 339.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694247),
pointer: 6,
position: Offset(230.85714721679688, 339.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694262),
pointer: 6,
position: Offset(230.2857208251953, 342.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694270),
pointer: 6,
position: Offset(228.85714721679688, 346.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694278),
pointer: 6,
position: Offset(227.14285278320312, 352.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694286),
pointer: 6,
position: Offset(225.42857360839844, 359.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694294),
pointer: 6,
position: Offset(223.7142791748047, 367.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694301),
pointer: 6,
position: Offset(222.57142639160156, 376.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694309),
pointer: 6,
position: Offset(221.42857360839844, 384.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694317),
pointer: 6,
position: Offset(220.85714721679688, 392.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694324),
pointer: 6,
position: Offset(220.0, 400.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694332),
pointer: 6,
position: Offset(219.14285278320312, 409.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694339),
pointer: 6,
position: Offset(218.85714721679688, 419.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694348),
pointer: 6,
position: Offset(218.2857208251953, 428.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694356),
pointer: 6,
position: Offset(218.2857208251953, 438.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694363),
pointer: 6,
position: Offset(218.2857208251953, 447.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694371),
pointer: 6,
position: Offset(218.2857208251953, 455.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694379),
pointer: 6,
position: Offset(219.14285278320312, 462.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694386),
pointer: 6,
position: Offset(220.0, 469.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694394),
pointer: 6,
position: Offset(221.14285278320312, 475.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694401),
pointer: 6,
position: Offset(222.0, 480.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694409),
pointer: 6,
position: Offset(222.85714721679688, 485.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694417),
pointer: 6,
position: Offset(224.0, 489.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694425),
pointer: 6,
position: Offset(224.85714721679688, 492.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694433),
pointer: 6,
position: Offset(225.42857360839844, 495.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694440),
pointer: 6,
position: Offset(226.0, 497.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694448),
pointer: 6,
position: Offset(226.2857208251953, 498.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694456),
pointer: 6,
position: Offset(226.2857208251953, 498.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694471),
pointer: 6,
position: Offset(226.2857208251953, 498.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694479),
pointer: 6,
position: Offset(226.2857208251953, 496.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694486),
pointer: 6,
position: Offset(226.2857208251953, 493.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694494),
pointer: 6,
position: Offset(226.2857208251953, 490.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694502),
pointer: 6,
position: Offset(226.2857208251953, 486.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694510),
pointer: 6,
position: Offset(226.2857208251953, 480.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694518),
pointer: 6,
position: Offset(226.2857208251953, 475.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694525),
pointer: 6,
position: Offset(226.2857208251953, 468.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694533),
pointer: 6,
position: Offset(226.2857208251953, 461.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694541),
pointer: 6,
position: Offset(226.2857208251953, 452.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694548),
pointer: 6,
position: Offset(226.57142639160156, 442.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694556),
pointer: 6,
position: Offset(226.57142639160156, 432.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694564),
pointer: 6,
position: Offset(226.85714721679688, 423.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694571),
pointer: 6,
position: Offset(227.42857360839844, 416.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694580),
pointer: 6,
position: Offset(227.7142791748047, 410.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694587),
pointer: 6,
position: Offset(228.2857208251953, 404.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694595),
pointer: 6,
position: Offset(228.85714721679688, 399.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694603),
pointer: 6,
position: Offset(229.14285278320312, 395.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694610),
pointer: 6,
position: Offset(229.42857360839844, 392.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694618),
pointer: 6,
position: Offset(229.7142791748047, 390.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694625),
pointer: 6,
position: Offset(229.7142791748047, 388.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694633),
pointer: 6,
position: Offset(229.7142791748047, 386.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694641),
pointer: 6,
position: Offset(229.7142791748047, 386.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694648),
pointer: 6,
position: Offset(229.7142791748047, 386.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694657),
pointer: 6,
position: Offset(228.85714721679688, 386.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694665),
pointer: 6,
position: Offset(228.0, 388.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694672),
pointer: 6,
position: Offset(226.0, 392.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694680),
pointer: 6,
position: Offset(224.0, 397.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694688),
pointer: 6,
position: Offset(222.0, 404.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694695),
pointer: 6,
position: Offset(219.7142791748047, 411.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694703),
pointer: 6,
position: Offset(218.2857208251953, 418.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694710),
pointer: 6,
position: Offset(217.14285278320312, 425.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694718),
pointer: 6,
position: Offset(215.7142791748047, 433.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694726),
pointer: 6,
position: Offset(214.85714721679688, 442.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694734),
pointer: 6,
position: Offset(214.0, 454.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694742),
pointer: 6,
position: Offset(214.0, 469.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694749),
pointer: 6,
position: Offset(215.42857360839844, 485.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694757),
pointer: 6,
position: Offset(217.7142791748047, 502.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694765),
pointer: 6,
position: Offset(221.14285278320312, 521.4285888671875),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694772),
pointer: 6,
position: Offset(224.57142639160156, 541.1428833007812),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694780),
pointer: 6,
position: Offset(229.14285278320312, 561.1428833007812),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216694788),
pointer: 6,
position: Offset(233.42857360839844, 578.8571166992188),
),
const PointerUpEvent(
timeStamp: Duration(milliseconds: 216694802),
pointer: 6,
position: Offset(233.42857360839844, 578.8571166992188),
),
const PointerDownEvent(
timeStamp: Duration(milliseconds: 216695344),
pointer: 7,
position: Offset(253.42857360839844, 310.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695352),
pointer: 7,
position: Offset(253.42857360839844, 310.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695359),
pointer: 7,
position: Offset(252.85714721679688, 318.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695367),
pointer: 7,
position: Offset(251.14285278320312, 322.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695375),
pointer: 7,
position: Offset(248.85714721679688, 327.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695382),
pointer: 7,
position: Offset(246.0, 334.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695390),
pointer: 7,
position: Offset(242.57142639160156, 344.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695397),
pointer: 7,
position: Offset(238.85714721679688, 357.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695406),
pointer: 7,
position: Offset(235.7142791748047, 371.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695414),
pointer: 7,
position: Offset(232.2857208251953, 386.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695421),
pointer: 7,
position: Offset(229.42857360839844, 402.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695429),
pointer: 7,
position: Offset(227.42857360839844, 416.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695437),
pointer: 7,
position: Offset(226.2857208251953, 431.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695444),
pointer: 7,
position: Offset(226.2857208251953, 446.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695452),
pointer: 7,
position: Offset(227.7142791748047, 460.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695459),
pointer: 7,
position: Offset(230.0, 475.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695467),
pointer: 7,
position: Offset(232.2857208251953, 489.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695475),
pointer: 7,
position: Offset(235.7142791748047, 504.0),
),
const PointerUpEvent(
timeStamp: Duration(milliseconds: 216695490),
pointer: 7,
position: Offset(235.7142791748047, 504.0),
),
const PointerDownEvent(
timeStamp: Duration(milliseconds: 216695885),
pointer: 8,
position: Offset(238.85714721679688, 524.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695908),
pointer: 8,
position: Offset(236.2857208251953, 515.7142944335938),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695916),
pointer: 8,
position: Offset(234.85714721679688, 509.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695924),
pointer: 8,
position: Offset(232.57142639160156, 498.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695931),
pointer: 8,
position: Offset(230.57142639160156, 483.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695939),
pointer: 8,
position: Offset(229.14285278320312, 466.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695947),
pointer: 8,
position: Offset(229.14285278320312, 446.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695955),
pointer: 8,
position: Offset(230.57142639160156, 424.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695963),
pointer: 8,
position: Offset(232.57142639160156, 402.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695970),
pointer: 8,
position: Offset(235.14285278320312, 380.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216695978),
pointer: 8,
position: Offset(238.57142639160156, 359.4285583496094),
),
const PointerUpEvent(
timeStamp: Duration(milliseconds: 216695993),
pointer: 8,
position: Offset(238.57142639160156, 359.4285583496094),
),
const PointerDownEvent(
timeStamp: Duration(milliseconds: 216696429),
pointer: 9,
position: Offset(238.2857208251953, 568.5714111328125),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216696459),
pointer: 9,
position: Offset(234.0, 560.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216696467),
pointer: 9,
position: Offset(231.42857360839844, 553.1428833007812),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216696475),
pointer: 9,
position: Offset(228.2857208251953, 543.1428833007812),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216696483),
pointer: 9,
position: Offset(225.42857360839844, 528.8571166992188),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216696491),
pointer: 9,
position: Offset(223.14285278320312, 512.2857055664062),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216696498),
pointer: 9,
position: Offset(222.0, 495.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216696506),
pointer: 9,
position: Offset(221.7142791748047, 477.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216696514),
pointer: 9,
position: Offset(221.7142791748047, 458.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216696521),
pointer: 9,
position: Offset(223.14285278320312, 438.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216696529),
pointer: 9,
position: Offset(224.2857208251953, 416.28570556640625),
),
const PointerUpEvent(
timeStamp: Duration(milliseconds: 216696544),
pointer: 9,
position: Offset(224.2857208251953, 416.28570556640625),
),
const PointerDownEvent(
timeStamp: Duration(milliseconds: 216696974),
pointer: 10,
position: Offset(218.57142639160156, 530.5714111328125),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697012),
pointer: 10,
position: Offset(220.2857208251953, 522.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697020),
pointer: 10,
position: Offset(221.14285278320312, 517.7142944335938),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697028),
pointer: 10,
position: Offset(222.2857208251953, 511.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697036),
pointer: 10,
position: Offset(224.0, 504.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697044),
pointer: 10,
position: Offset(227.14285278320312, 490.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697052),
pointer: 10,
position: Offset(229.42857360839844, 474.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697059),
pointer: 10,
position: Offset(231.42857360839844, 454.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697067),
pointer: 10,
position: Offset(233.7142791748047, 431.1428527832031),
),
const PointerUpEvent(
timeStamp: Duration(milliseconds: 216697082),
pointer: 10,
position: Offset(233.7142791748047, 431.1428527832031),
),
const PointerDownEvent(
timeStamp: Duration(milliseconds: 216697435),
pointer: 11,
position: Offset(257.1428527832031, 285.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697465),
pointer: 11,
position: Offset(251.7142791748047, 296.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697473),
pointer: 11,
position: Offset(248.2857208251953, 304.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697481),
pointer: 11,
position: Offset(244.57142639160156, 314.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697489),
pointer: 11,
position: Offset(240.2857208251953, 329.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697497),
pointer: 11,
position: Offset(236.85714721679688, 345.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697505),
pointer: 11,
position: Offset(233.7142791748047, 361.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697512),
pointer: 11,
position: Offset(231.14285278320312, 378.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697520),
pointer: 11,
position: Offset(229.42857360839844, 395.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697528),
pointer: 11,
position: Offset(229.42857360839844, 412.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697535),
pointer: 11,
position: Offset(230.85714721679688, 430.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697543),
pointer: 11,
position: Offset(233.42857360839844, 449.71429443359375),
),
const PointerUpEvent(
timeStamp: Duration(milliseconds: 216697558),
pointer: 11,
position: Offset(233.42857360839844, 449.71429443359375),
),
const PointerDownEvent(
timeStamp: Duration(milliseconds: 216697749),
pointer: 12,
position: Offset(246.0, 311.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697780),
pointer: 12,
position: Offset(244.57142639160156, 318.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697787),
pointer: 12,
position: Offset(243.14285278320312, 325.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697795),
pointer: 12,
position: Offset(241.42857360839844, 336.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697803),
pointer: 12,
position: Offset(239.7142791748047, 351.1428527832031),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697811),
pointer: 12,
position: Offset(238.2857208251953, 368.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697819),
pointer: 12,
position: Offset(238.0, 389.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697826),
pointer: 12,
position: Offset(239.14285278320312, 412.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697834),
pointer: 12,
position: Offset(242.2857208251953, 438.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697842),
pointer: 12,
position: Offset(247.42857360839844, 466.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216697849),
pointer: 12,
position: Offset(254.2857208251953, 497.71429443359375),
),
const PointerUpEvent(
timeStamp: Duration(milliseconds: 216697864),
pointer: 12,
position: Offset(254.2857208251953, 497.71429443359375),
),
const PointerDownEvent(
timeStamp: Duration(milliseconds: 216698321),
pointer: 13,
position: Offset(250.0, 306.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216698328),
pointer: 13,
position: Offset(250.0, 306.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216698344),
pointer: 13,
position: Offset(249.14285278320312, 314.0),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216698351),
pointer: 13,
position: Offset(247.42857360839844, 319.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216698359),
pointer: 13,
position: Offset(245.14285278320312, 326.8571472167969),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216698366),
pointer: 13,
position: Offset(241.7142791748047, 339.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216698374),
pointer: 13,
position: Offset(238.57142639160156, 355.71429443359375),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216698382),
pointer: 13,
position: Offset(236.2857208251953, 374.28570556640625),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216698390),
pointer: 13,
position: Offset(235.14285278320312, 396.5714416503906),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216698398),
pointer: 13,
position: Offset(236.57142639160156, 421.4285583496094),
),
const PointerMoveEvent(
timeStamp: Duration(milliseconds: 216698406),
pointer: 13,
position: Offset(241.14285278320312, 451.4285583496094),
),
const PointerUpEvent(
timeStamp: Duration(milliseconds: 216698421),
pointer: 13,
position: Offset(241.14285278320312, 451.4285583496094),
),
];
| flutter/dev/benchmarks/microbenchmarks/lib/gestures/data/velocity_tracker_data.dart/0 | {
"file_path": "flutter/dev/benchmarks/microbenchmarks/lib/gestures/data/velocity_tracker_data.dart",
"repo_id": "flutter",
"token_count": 19555
} | 487 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
signingConfigs {
self {
}
}
namespace "dev.flutter.multipleflutters"
compileSdk 34
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
defaultConfig {
applicationId "dev.flutter.multipleflutters"
minSdkVersion 24
targetSdkVersion 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig debug.signingConfig
}
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation project(':flutter')
}
| flutter/dev/benchmarks/multiple_flutters/android/app/build.gradle/0 | {
"file_path": "flutter/dev/benchmarks/multiple_flutters/android/app/build.gradle",
"repo_id": "flutter",
"token_count": 640
} | 488 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package dev.benchmarks.platform_views_layout_hybrid_composition;
import android.content.Context;
import androidx.annotation.Nullable;
import io.flutter.plugin.common.MessageCodec;
import io.flutter.plugin.common.StringCodec;
import io.flutter.plugin.platform.PlatformView;
import io.flutter.plugin.platform.PlatformViewFactory;
import java.nio.ByteBuffer;
public final class DummyPlatformViewFactory extends PlatformViewFactory {
DummyPlatformViewFactory() {
super(
new MessageCodec<Object>() {
@Nullable
@Override
public ByteBuffer encodeMessage(@Nullable Object o) {
if (o instanceof String) {
return StringCodec.INSTANCE.encodeMessage((String) o);
}
return null;
}
@Nullable
@Override
public Object decodeMessage(@Nullable ByteBuffer byteBuffer) {
return StringCodec.INSTANCE.decodeMessage(byteBuffer);
}
}
);
}
@SuppressWarnings("unchecked")
@Override
public PlatformView create(Context context, int id, Object args) {
return new DummyPlatformView(context, id);
}
}
| flutter/dev/benchmarks/platform_views_layout_hybrid_composition/android/app/src/main/java/dev/bechmarks/platform_views_layout/DummyPlatformViewFactory.java/0 | {
"file_path": "flutter/dev/benchmarks/platform_views_layout_hybrid_composition/android/app/src/main/java/dev/bechmarks/platform_views_layout/DummyPlatformViewFactory.java",
"repo_id": "flutter",
"token_count": 609
} | 489 |
# Regenerating the i18n files
The files in this directory are used to generate `stock_strings.dart`,
which contains the `StockStrings` class. This localizations class is
used by the stocks application to look up localized message strings.
The stocks app uses the [Dart `intl` package](https://github.com/dart-lang/intl).
To update the English and Spanish localizations, modify the
`stocks_en_US.arb`, `stocks_en.arb`, or `stocks_es.arb` files. See the
[ARB specification](https://github.com/google/app-resource-bundle/wiki/ApplicationResourceBundleSpecification)
for more info.
To modify the project's configuration of the localizations tool,
change the `l10n.yaml` file.
The `StockStrings` class creates a delegate that performs message lookups
based on the locale of the device. In this case, the stocks app supports
`en`, `en_US`, and `es` locales. Thus, the `StockStringsEn` and
`StockStringsEs` classes extends `StockStrings`. `StockStringsEnUs` extends
`StockStringsEn`. This allows `StockStringsEnUs` to fall back on messages
in `StockStringsEn`.
| flutter/dev/benchmarks/test_apps/stocks/lib/i18n/regenerate.md/0 | {
"file_path": "flutter/dev/benchmarks/test_apps/stocks/lib/i18n/regenerate.md",
"repo_id": "flutter",
"token_count": 300
} | 490 |
#!/usr/bin/env bash
# Copyright 2014 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -ex
readonly SCRIPTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly ROOT_DIR="$SCRIPTS_DIR/.."
function is_expected_failure() {
# A test target was specified with the 'build' command.
grep --quiet "is not configured for Running" "$1"
}
log_file="build_log_for_104_complete.txt"
build_command="flutter build bundle"
# Attempt to build 104-complete Shrine app from the Flutter codelabs
git clone https://github.com/material-components/material-components-flutter-codelabs.git
cd material-components-flutter-codelabs/mdc_100_series/
git checkout 104-complete
all_builds_ok=1
echo "$build_command"
$build_command 2>&1 | tee "$log_file"
if [ ${PIPESTATUS[0]} -eq 0 ] || is_expected_failure "$log_file"; then
rm "$log_file"
else
all_builds_ok=0
echo "View https://github.com/flutter/flutter/blob/master/dev/bots/README.md for steps to resolve this failed build test." >> ${log_file}
echo
echo "Log left in $log_file."
echo
fi
# If any build failed, exit with a failure exit status so continuous integration
# tools can react appropriately.
if [ "$all_builds_ok" -eq 1 ]; then
exit 0
else
exit 1
fi
| flutter/dev/bots/codelabs_build_test.sh/0 | {
"file_path": "flutter/dev/bots/codelabs_build_test.sh",
"repo_id": "flutter",
"token_count": 447
} | 491 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Runs the tests for the flutter/flutter repository.
//
//
// By default, test output is filtered and only errors are shown. (If a
// particular test takes longer than _quietTimeout in utils.dart, the output is
// shown then also, in case something has hung.)
//
// --verbose stops the output cleanup and just outputs everything verbatim.
//
//
// By default, errors are non-fatal; all tests are executed and the output
// ends with a summary of the errors that were detected.
//
// Exit code is 1 if there was an error.
//
// --abort-on-error causes the script to exit immediately when hitting an error.
//
//
// By default, all tests are run. However, the tests support being split by
// shard and subshard. (Inspect the code to see what shards and subshards are
// supported.)
//
// If the CIRRUS_TASK_NAME environment variable exists, it is used to determine
// the shard and sub-shard, by parsing it in the form shard-subshard-platform,
// ignoring the platform.
//
// For local testing you can just set the SHARD and SUBSHARD environment
// variables. For example, to run all the framework tests you can just set
// SHARD=framework_tests. Some shards support named subshards, like
// SHARD=framework_tests SUBSHARD=widgets. Others support arbitrary numbered
// subsharding, like SHARD=build_tests SUBSHARD=1_2 (where 1_2 means "one of
// two" as in run the first half of the tests).
//
// So for example to run specifically the third subshard of the Web tests you
// would set SHARD=web_tests SUBSHARD=2 (it's zero-based).
//
// By default, where supported, tests within a shard are executed in a random
// order to (eventually) catch inter-test dependencies.
//
// --test-randomize-ordering-seed=<n> sets the shuffle seed for reproducing runs.
//
//
// All other arguments are treated as arguments to pass to the flutter tool when
// running tests.
import 'dart:convert';
import 'dart:core' as system show print;
import 'dart:core' hide print;
import 'dart:io' as system show exit;
import 'dart:io' hide exit;
import 'dart:io' as io;
import 'dart:math' as math;
import 'dart:typed_data';
import 'package:archive/archive.dart';
import 'package:file/file.dart' as fs;
import 'package:file/local.dart';
import 'package:meta/meta.dart';
import 'package:path/path.dart' as path;
import 'package:process/process.dart';
import 'browser.dart';
import 'run_command.dart';
import 'service_worker_test.dart';
import 'tool_subsharding.dart';
import 'utils.dart';
typedef ShardRunner = Future<void> Function();
/// A function used to validate the output of a test.
///
/// If the output matches expectations, the function shall return null.
///
/// If the output does not match expectations, the function shall return an
/// appropriate error message.
typedef OutputChecker = String? Function(CommandResult);
final String exe = Platform.isWindows ? '.exe' : '';
final String bat = Platform.isWindows ? '.bat' : '';
final String flutterRoot = path.dirname(path.dirname(path.dirname(path.fromUri(Platform.script))));
final String flutter = path.join(flutterRoot, 'bin', 'flutter$bat');
final String dart = path.join(flutterRoot, 'bin', 'cache', 'dart-sdk', 'bin', 'dart$exe');
final String pubCache = path.join(flutterRoot, '.pub-cache');
final String engineVersionFile = path.join(flutterRoot, 'bin', 'internal', 'engine.version');
final String engineRealmFile = path.join(flutterRoot, 'bin', 'internal', 'engine.realm');
final String flutterPackagesVersionFile = path.join(flutterRoot, 'bin', 'internal', 'flutter_packages.version');
String get platformFolderName {
if (Platform.isWindows) {
return 'windows-x64';
}
if (Platform.isMacOS) {
return 'darwin-x64';
}
if (Platform.isLinux) {
return 'linux-x64';
}
throw UnsupportedError('The platform ${Platform.operatingSystem} is not supported by this script.');
}
final String flutterTester = path.join(flutterRoot, 'bin', 'cache', 'artifacts', 'engine', platformFolderName, 'flutter_tester$exe');
/// The arguments to pass to `flutter test` (typically the local engine
/// configuration) -- prefilled with the arguments passed to test.dart.
final List<String> flutterTestArgs = <String>[];
/// Environment variables to override the local engine when running `pub test`,
/// if such flags are provided to `test.dart`.
final Map<String,String> localEngineEnv = <String, String>{};
const String kShardKey = 'SHARD';
const String kSubshardKey = 'SUBSHARD';
/// The number of Cirrus jobs that run Web tests in parallel.
///
/// The default is 8 shards. Typically .cirrus.yml would define the
/// WEB_SHARD_COUNT environment variable rather than relying on the default.
///
/// WARNING: if you change this number, also change .cirrus.yml
/// and make sure it runs _all_ shards.
///
/// The last shard also runs the Web plugin tests.
int get webShardCount => Platform.environment.containsKey('WEB_SHARD_COUNT')
? int.parse(Platform.environment['WEB_SHARD_COUNT']!)
: 8;
/// Tests that we don't run on Web.
///
/// In general avoid adding new tests here. If a test cannot run on the web
/// because it fails at runtime, such as when a piece of functionality is not
/// implemented or not implementable on the web, prefer using `skip` in the
/// test code. Only add tests here that cannot be skipped using `skip`. For
/// example:
///
/// * Test code cannot be compiled because it uses Dart VM-specific
/// functionality. In this case `skip` doesn't help because the code cannot
/// reach the point where it can even run the skipping logic.
/// * Migrations. It is OK to put tests here that need to be temporarily
/// disabled in certain modes because of some migration or initial bringup.
///
/// The key in the map is the renderer type that the list applies to. The value
/// is the list of tests known to fail for that renderer.
//
// TODO(yjbanov): we're getting rid of this as part of https://github.com/flutter/flutter/projects/60
const Map<String, List<String>> kWebTestFileKnownFailures = <String, List<String>>{
'html': <String>[
// These tests are not compilable on the web due to dependencies on
// VM-specific functionality.
'test/services/message_codecs_vm_test.dart',
'test/examples/sector_layout_test.dart',
],
'canvaskit': <String>[
// These tests are not compilable on the web due to dependencies on
// VM-specific functionality.
'test/services/message_codecs_vm_test.dart',
'test/examples/sector_layout_test.dart',
// These tests are broken and need to be fixed.
// TODO(yjbanov): https://github.com/flutter/flutter/issues/71604
'test/material/text_field_test.dart',
'test/widgets/performance_overlay_test.dart',
'test/widgets/html_element_view_test.dart',
'test/cupertino/scaffold_test.dart',
'test/rendering/platform_view_test.dart',
],
};
const String kTestHarnessShardName = 'test_harness_tests';
const List<String> _kAllBuildModes = <String>['debug', 'profile', 'release'];
// The seed used to shuffle tests. If not passed with
// --test-randomize-ordering-seed=<seed> on the command line, it will be set the
// first time it is accessed. Pass zero to turn off shuffling.
String? _shuffleSeed;
String get shuffleSeed {
if (_shuffleSeed == null) {
// Change the seed at 7am, UTC.
final DateTime seedTime = DateTime.now().toUtc().subtract(const Duration(hours: 7));
// Generates YYYYMMDD as the seed, so that testing continues to fail for a
// day after the seed changes, and on other days the seed can be used to
// replicate failures.
_shuffleSeed = '${seedTime.year * 10000 + seedTime.month * 100 + seedTime.day}';
}
return _shuffleSeed!;
}
/// When you call this, you can pass additional arguments to pass custom
/// arguments to flutter test. For example, you might want to call this
/// script with the parameter --local-engine=host_debug_unopt to
/// use your own build of the engine.
///
/// To run the tool_tests part, run it with SHARD=tool_tests
///
/// Examples:
/// SHARD=tool_tests bin/cache/dart-sdk/bin/dart dev/bots/test.dart
/// bin/cache/dart-sdk/bin/dart dev/bots/test.dart --local-engine=host_debug_unopt --local-engine-host=host_debug_unopt
Future<void> main(List<String> args) async {
try {
printProgress('STARTING ANALYSIS');
for (final String arg in args) {
if (arg.startsWith('--local-engine=')) {
localEngineEnv['FLUTTER_LOCAL_ENGINE'] = arg.substring('--local-engine='.length);
flutterTestArgs.add(arg);
} else if (arg.startsWith('--local-engine-host=')) {
localEngineEnv['FLUTTER_LOCAL_ENGINE_HOST'] = arg.substring('--local-engine-host='.length);
flutterTestArgs.add(arg);
} else if (arg.startsWith('--local-engine-src-path=')) {
localEngineEnv['FLUTTER_LOCAL_ENGINE_SRC_PATH'] = arg.substring('--local-engine-src-path='.length);
flutterTestArgs.add(arg);
} else if (arg.startsWith('--test-randomize-ordering-seed=')) {
_shuffleSeed = arg.substring('--test-randomize-ordering-seed='.length);
} else if (arg.startsWith('--verbose')) {
print = (Object? message) {
system.print(message);
};
} else if (arg.startsWith('--abort-on-error')) {
onError = () {
system.exit(1);
};
} else {
flutterTestArgs.add(arg);
}
}
if (Platform.environment.containsKey(CIRRUS_TASK_NAME)) {
printProgress('Running task: ${Platform.environment[CIRRUS_TASK_NAME]}');
}
await selectShard(<String, ShardRunner>{
'add_to_app_life_cycle_tests': _runAddToAppLifeCycleTests,
'build_tests': _runBuildTests,
'framework_coverage': _runFrameworkCoverage,
'framework_tests': _runFrameworkTests,
'tool_tests': _runToolTests,
// web_tool_tests is also used by HHH: https://dart.googlesource.com/recipes/+/refs/heads/master/recipes/dart/flutter_engine.py
'web_tool_tests': _runWebToolTests,
'tool_integration_tests': _runIntegrationToolTests,
'android_preview_tool_integration_tests': _runAndroidPreviewIntegrationToolTests,
'tool_host_cross_arch_tests': _runToolHostCrossArchTests,
// All the unit/widget tests run using `flutter test --platform=chrome --web-renderer=html`
'web_tests': _runWebHtmlUnitTests,
// All the unit/widget tests run using `flutter test --platform=chrome --web-renderer=canvaskit`
'web_canvaskit_tests': _runWebCanvasKitUnitTests,
// All web integration tests
'web_long_running_tests': _runWebLongRunningTests,
'flutter_plugins': _runFlutterPackagesTests,
'skp_generator': _runSkpGeneratorTests,
'realm_checker': _runRealmCheckerTest,
'customer_testing': _runCustomerTesting,
'analyze': _runAnalyze,
'fuchsia_precache': _runFuchsiaPrecache,
'docs': _runDocs,
'verify_binaries_codesigned': _runVerifyCodesigned,
kTestHarnessShardName: _runTestHarnessTests, // Used for testing this script; also run as part of SHARD=framework_tests, SUBSHARD=misc.
});
} catch (error, stackTrace) {
foundError(<String>[
'UNEXPECTED ERROR!',
error.toString(),
...stackTrace.toString().split('\n'),
'The test.dart script should be corrected to catch this error and call foundError().',
'${yellow}Some tests are likely to have been skipped.$reset',
]);
system.exit(255);
}
if (hasError) {
reportErrorsAndExit('${bold}Test failed.$reset');
}
reportSuccessAndExit('${bold}Test successful.$reset');
}
final String _luciBotId = Platform.environment['SWARMING_BOT_ID'] ?? '';
final bool _runningInDartHHHBot =
_luciBotId.startsWith('luci-dart-') || _luciBotId.startsWith('dart-tests-');
/// Verify the Flutter Engine is the revision in
/// bin/cache/internal/engine.version.
Future<void> _validateEngineHash() async {
if (_runningInDartHHHBot) {
// The Dart HHH bots intentionally modify the local artifact cache
// and then use this script to run Flutter's test suites.
// Because the artifacts have been changed, this particular test will return
// a false positive and should be skipped.
print('${yellow}Skipping Flutter Engine Version Validation for swarming bot $_luciBotId.');
return;
}
final String expectedVersion = File(engineVersionFile).readAsStringSync().trim();
final CommandResult result = await runCommand(flutterTester, <String>['--help'], outputMode: OutputMode.capture);
if (result.flattenedStdout!.isNotEmpty) {
foundError(<String>[
'${red}The stdout of `$flutterTester --help` was not empty:$reset',
...result.flattenedStdout!.split('\n').map((String line) => ' $gray┆$reset $line'),
]);
}
final String actualVersion;
try {
actualVersion = result.flattenedStderr!.split('\n').firstWhere((final String line) {
return line.startsWith('Flutter Engine Version:');
});
} on StateError {
foundError(<String>[
'${red}Could not find "Flutter Engine Version:" line in `${path.basename(flutterTester)} --help` stderr output:$reset',
...result.flattenedStderr!.split('\n').map((String line) => ' $gray┆$reset $line'),
]);
return;
}
if (!actualVersion.contains(expectedVersion)) {
foundError(<String>['${red}Expected "Flutter Engine Version: $expectedVersion", but found "$actualVersion".$reset']);
}
}
Future<void> _runTestHarnessTests() async {
printProgress('${green}Running test harness tests...$reset');
await _validateEngineHash();
// Verify that the tests actually return failure on failure and success on
// success.
final String automatedTests = path.join(flutterRoot, 'dev', 'automated_tests');
// We want to run these tests in parallel, because they each take some time
// to run (e.g. compiling), so we don't want to run them in series, especially
// on 20-core machines. However, we have a race condition, so for now...
// Race condition issue: https://github.com/flutter/flutter/issues/90026
final List<ShardRunner> tests = <ShardRunner>[
() => _runFlutterTest(
automatedTests,
script: path.join('test_smoke_test', 'pass_test.dart'),
printOutput: false,
),
() => _runFlutterTest(
automatedTests,
script: path.join('test_smoke_test', 'fail_test.dart'),
expectFailure: true,
printOutput: false,
),
() => _runFlutterTest(
automatedTests,
script: path.join('test_smoke_test', 'pending_timer_fail_test.dart'),
expectFailure: true,
printOutput: false,
outputChecker: (CommandResult result) {
return result.flattenedStdout!.contains('failingPendingTimerTest')
? null
: 'Failed to find the stack trace for the pending Timer.\n\n'
'stdout:\n${result.flattenedStdout}\n\n'
'stderr:\n${result.flattenedStderr}';
},
),
() => _runFlutterTest(
automatedTests,
script: path.join('test_smoke_test', 'fail_test_on_exception_after_test.dart'),
expectFailure: true,
printOutput: false,
outputChecker: (CommandResult result) {
const String expectedError = '══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════\n'
'The following StateError was thrown running a test (but after the test had completed):\n'
'Bad state: Exception thrown after test completed.';
if (result.flattenedStdout!.contains(expectedError)) {
return null;
}
return 'Failed to find expected output on stdout.\n\n'
'Expected output:\n$expectedError\n\n'
'Actual stdout:\n${result.flattenedStdout}\n\n'
'Actual stderr:\n${result.flattenedStderr}';
},
),
() => _runFlutterTest(
automatedTests,
script: path.join('test_smoke_test', 'crash1_test.dart'),
expectFailure: true,
printOutput: false,
),
() => _runFlutterTest(
automatedTests,
script: path.join('test_smoke_test', 'crash2_test.dart'),
expectFailure: true,
printOutput: false,
),
() => _runFlutterTest(
automatedTests,
script: path.join('test_smoke_test', 'syntax_error_test.broken_dart'),
expectFailure: true,
printOutput: false,
),
() => _runFlutterTest(
automatedTests,
script: path.join('test_smoke_test', 'missing_import_test.broken_dart'),
expectFailure: true,
printOutput: false,
),
() => _runFlutterTest(
automatedTests,
script: path.join('test_smoke_test', 'disallow_error_reporter_modification_test.dart'),
expectFailure: true,
printOutput: false,
),
];
List<ShardRunner> testsToRun;
// Run all tests unless sharding is explicitly specified.
final String? shardName = Platform.environment[kShardKey];
if (shardName == kTestHarnessShardName) {
testsToRun = _selectIndexOfTotalSubshard<ShardRunner>(tests);
} else {
testsToRun = tests;
}
for (final ShardRunner test in testsToRun) {
await test();
}
// Verify that we correctly generated the version file.
final String? versionError = await verifyVersion(File(path.join(flutterRoot, 'version')));
if (versionError != null) {
foundError(<String>[versionError]);
}
}
final String _toolsPath = path.join(flutterRoot, 'packages', 'flutter_tools');
Future<void> _runGeneralToolTests() async {
await _runDartTest(
_toolsPath,
testPaths: <String>[path.join('test', 'general.shard')],
enableFlutterToolAsserts: false,
// Detect unit test time regressions (poor time delay handling, etc).
// This overrides the 15 minute default for tools tests.
// See the README.md and dart_test.yaml files in the flutter_tools package.
perTestTimeout: const Duration(seconds: 2),
);
}
Future<void> _runCommandsToolTests() async {
await _runDartTest(
_toolsPath,
forceSingleCore: true,
testPaths: <String>[path.join('test', 'commands.shard')],
);
}
Future<void> _runWebToolTests() async {
final List<File> allFiles = Directory(path.join(_toolsPath, 'test', 'web.shard'))
.listSync(recursive: true).whereType<File>().toList();
final List<String> allTests = <String>[];
for (final File file in allFiles) {
if (file.path.endsWith('_test.dart')) {
allTests.add(file.path);
}
}
await _runDartTest(
_toolsPath,
forceSingleCore: true,
testPaths: _selectIndexOfTotalSubshard<String>(allTests),
includeLocalEngineEnv: true,
);
}
Future<void> _runToolHostCrossArchTests() {
return _runDartTest(
_toolsPath,
// These are integration tests
forceSingleCore: true,
testPaths: <String>[path.join('test', 'host_cross_arch.shard')],
);
}
Future<void> _runIntegrationToolTests() async {
final List<String> allTests = Directory(path.join(_toolsPath, 'test', 'integration.shard'))
.listSync(recursive: true).whereType<File>()
.map<String>((FileSystemEntity entry) => path.relative(entry.path, from: _toolsPath))
.where((String testPath) => path.basename(testPath).endsWith('_test.dart')).toList();
await _runDartTest(
_toolsPath,
forceSingleCore: true,
testPaths: _selectIndexOfTotalSubshard<String>(allTests),
collectMetrics: true,
);
}
Future<void> _runAndroidPreviewIntegrationToolTests() async {
final List<String> allTests = Directory(path.join(_toolsPath, 'test', 'android_preview_integration.shard'))
.listSync(recursive: true).whereType<File>()
.map<String>((FileSystemEntity entry) => path.relative(entry.path, from: _toolsPath))
.where((String testPath) => path.basename(testPath).endsWith('_test.dart')).toList();
await _runDartTest(
_toolsPath,
forceSingleCore: true,
testPaths: _selectIndexOfTotalSubshard<String>(allTests),
collectMetrics: true,
);
}
Future<void> _runToolTests() async {
await selectSubshard(<String, ShardRunner>{
'general': _runGeneralToolTests,
'commands': _runCommandsToolTests,
});
}
Future<void> runForbiddenFromReleaseTests() async {
// Build a release APK to get the snapshot json.
final Directory tempDirectory = Directory.systemTemp.createTempSync('flutter_forbidden_imports.');
final List<String> command = <String>[
'build',
'apk',
'--target-platform',
'android-arm64',
'--release',
'--analyze-size',
'--code-size-directory',
tempDirectory.path,
'-v',
];
await runCommand(
flutter,
command,
workingDirectory: path.join(flutterRoot, 'examples', 'hello_world'),
);
// First, a smoke test.
final List<String> smokeTestArgs = <String>[
path.join(flutterRoot, 'dev', 'forbidden_from_release_tests', 'bin', 'main.dart'),
'--snapshot', path.join(tempDirectory.path, 'snapshot.arm64-v8a.json'),
'--package-config', path.join(flutterRoot, 'examples', 'hello_world', '.dart_tool', 'package_config.json'),
'--forbidden-type', 'package:flutter/src/widgets/framework.dart::Widget',
];
await runCommand(
dart,
smokeTestArgs,
workingDirectory: flutterRoot,
expectNonZeroExit: true,
);
// Actual test.
final List<String> args = <String>[
path.join(flutterRoot, 'dev', 'forbidden_from_release_tests', 'bin', 'main.dart'),
'--snapshot', path.join(tempDirectory.path, 'snapshot.arm64-v8a.json'),
'--package-config', path.join(flutterRoot, 'examples', 'hello_world', '.dart_tool', 'package_config.json'),
'--forbidden-type', 'package:flutter/src/widgets/widget_inspector.dart::WidgetInspectorService',
'--forbidden-type', 'package:flutter/src/widgets/framework.dart::DebugCreator',
'--forbidden-type', 'package:flutter/src/foundation/print.dart::debugPrint',
];
await runCommand(
dart,
args,
workingDirectory: flutterRoot,
);
}
/// Verifies that APK, and IPA (if on macOS), and native desktop builds the
/// examples apps without crashing. It does not actually launch the apps. That
/// happens later in the devicelab. This is just a smoke-test. In particular,
/// this will verify we can build when there are spaces in the path name for the
/// Flutter SDK and target app.
///
/// Also does some checking about types included in hello_world.
Future<void> _runBuildTests() async {
final List<Directory> exampleDirectories = Directory(path.join(flutterRoot, 'examples')).listSync()
// API example builds will be tested in a separate shard.
.where((FileSystemEntity entity) => entity is Directory && path.basename(entity.path) != 'api').cast<Directory>().toList()
..add(Directory(path.join(flutterRoot, 'packages', 'integration_test', 'example')))
..add(Directory(path.join(flutterRoot, 'dev', 'integration_tests', 'android_semantics_testing')))
..add(Directory(path.join(flutterRoot, 'dev', 'integration_tests', 'android_views')))
..add(Directory(path.join(flutterRoot, 'dev', 'integration_tests', 'channels')))
..add(Directory(path.join(flutterRoot, 'dev', 'integration_tests', 'hybrid_android_views')))
..add(Directory(path.join(flutterRoot, 'dev', 'integration_tests', 'flutter_gallery')))
..add(Directory(path.join(flutterRoot, 'dev', 'integration_tests', 'ios_platform_view_tests')))
..add(Directory(path.join(flutterRoot, 'dev', 'integration_tests', 'ios_app_with_extensions')))
..add(Directory(path.join(flutterRoot, 'dev', 'integration_tests', 'non_nullable')))
..add(Directory(path.join(flutterRoot, 'dev', 'integration_tests', 'platform_interaction')))
..add(Directory(path.join(flutterRoot, 'dev', 'integration_tests', 'spell_check')))
..add(Directory(path.join(flutterRoot, 'dev', 'integration_tests', 'ui')));
// The tests are randomly distributed into subshards so as to get a uniform
// distribution of costs, but the seed is fixed so that issues are reproducible.
final List<ShardRunner> tests = <ShardRunner>[
for (final Directory exampleDirectory in exampleDirectories)
() => _runExampleProjectBuildTests(exampleDirectory),
...<ShardRunner>[
// Web compilation tests.
() => _flutterBuildDart2js(
path.join('dev', 'integration_tests', 'web'),
path.join('lib', 'main.dart'),
),
// Should not fail to compile with dart:io.
() => _flutterBuildDart2js(
path.join('dev', 'integration_tests', 'web_compile_tests'),
path.join('lib', 'dart_io_import.dart'),
),
],
runForbiddenFromReleaseTests,
]..shuffle(math.Random(0));
await _runShardRunnerIndexOfTotalSubshard(tests);
}
Future<void> _runExampleProjectBuildTests(Directory exampleDirectory, [File? mainFile]) async {
// Only verify caching with flutter gallery.
final bool verifyCaching = exampleDirectory.path.contains('flutter_gallery');
final String examplePath = path.relative(exampleDirectory.path, from: Directory.current.path);
final List<String> additionalArgs = <String>[
if (mainFile != null) path.relative(mainFile.path, from: exampleDirectory.absolute.path),
];
if (Directory(path.join(examplePath, 'android')).existsSync()) {
await _flutterBuildApk(examplePath, release: false, additionalArgs: additionalArgs, verifyCaching: verifyCaching);
await _flutterBuildApk(examplePath, release: true, additionalArgs: additionalArgs, verifyCaching: verifyCaching);
} else {
print('Example project ${path.basename(examplePath)} has no android directory, skipping apk');
}
if (Platform.isMacOS) {
if (Directory(path.join(examplePath, 'ios')).existsSync()) {
await _flutterBuildIpa(examplePath, release: false, additionalArgs: additionalArgs, verifyCaching: verifyCaching);
await _flutterBuildIpa(examplePath, release: true, additionalArgs: additionalArgs, verifyCaching: verifyCaching);
} else {
print('Example project ${path.basename(examplePath)} has no ios directory, skipping ipa');
}
}
if (Platform.isLinux) {
if (Directory(path.join(examplePath, 'linux')).existsSync()) {
await _flutterBuildLinux(examplePath, release: false, additionalArgs: additionalArgs, verifyCaching: verifyCaching);
await _flutterBuildLinux(examplePath, release: true, additionalArgs: additionalArgs, verifyCaching: verifyCaching);
} else {
print('Example project ${path.basename(examplePath)} has no linux directory, skipping Linux');
}
}
if (Platform.isMacOS) {
if (Directory(path.join(examplePath, 'macos')).existsSync()) {
await _flutterBuildMacOS(examplePath, release: false, additionalArgs: additionalArgs, verifyCaching: verifyCaching);
await _flutterBuildMacOS(examplePath, release: true, additionalArgs: additionalArgs, verifyCaching: verifyCaching);
} else {
print('Example project ${path.basename(examplePath)} has no macos directory, skipping macOS');
}
}
if (Platform.isWindows) {
if (Directory(path.join(examplePath, 'windows')).existsSync()) {
await _flutterBuildWin32(examplePath, release: false, additionalArgs: additionalArgs, verifyCaching: verifyCaching);
await _flutterBuildWin32(examplePath, release: true, additionalArgs: additionalArgs, verifyCaching: verifyCaching);
} else {
print('Example project ${path.basename(examplePath)} has no windows directory, skipping Win32');
}
}
}
Future<void> _flutterBuildApk(String relativePathToApplication, {
required bool release,
bool verifyCaching = false,
List<String> additionalArgs = const <String>[],
}) async {
printProgress('${green}Testing APK ${release ? 'release' : 'debug'} build$reset for $cyan$relativePathToApplication$reset...');
await _flutterBuild(relativePathToApplication, 'APK', 'apk',
release: release,
verifyCaching: verifyCaching,
additionalArgs: additionalArgs
);
}
Future<void> _flutterBuildIpa(String relativePathToApplication, {
required bool release,
List<String> additionalArgs = const <String>[],
bool verifyCaching = false,
}) async {
assert(Platform.isMacOS);
printProgress('${green}Testing IPA ${release ? 'release' : 'debug'} build$reset for $cyan$relativePathToApplication$reset...');
await _flutterBuild(relativePathToApplication, 'IPA', 'ios',
release: release,
verifyCaching: verifyCaching,
additionalArgs: <String>[...additionalArgs, '--no-codesign'],
);
}
Future<void> _flutterBuildLinux(String relativePathToApplication, {
required bool release,
bool verifyCaching = false,
List<String> additionalArgs = const <String>[],
}) async {
assert(Platform.isLinux);
await runCommand(flutter, <String>['config', '--enable-linux-desktop']);
printProgress('${green}Testing Linux ${release ? 'release' : 'debug'} build$reset for $cyan$relativePathToApplication$reset...');
await _flutterBuild(relativePathToApplication, 'Linux', 'linux',
release: release,
verifyCaching: verifyCaching,
additionalArgs: additionalArgs
);
}
Future<void> _flutterBuildMacOS(String relativePathToApplication, {
required bool release,
bool verifyCaching = false,
List<String> additionalArgs = const <String>[],
}) async {
assert(Platform.isMacOS);
await runCommand(flutter, <String>['config', '--enable-macos-desktop']);
printProgress('${green}Testing macOS ${release ? 'release' : 'debug'} build$reset for $cyan$relativePathToApplication$reset...');
await _flutterBuild(relativePathToApplication, 'macOS', 'macos',
release: release,
verifyCaching: verifyCaching,
additionalArgs: additionalArgs
);
}
Future<void> _flutterBuildWin32(String relativePathToApplication, {
required bool release,
bool verifyCaching = false,
List<String> additionalArgs = const <String>[],
}) async {
assert(Platform.isWindows);
printProgress('${green}Testing ${release ? 'release' : 'debug'} Windows build$reset for $cyan$relativePathToApplication$reset...');
await _flutterBuild(relativePathToApplication, 'Windows', 'windows',
release: release,
verifyCaching: verifyCaching,
additionalArgs: additionalArgs
);
}
Future<void> _flutterBuild(
String relativePathToApplication,
String platformLabel,
String platformBuildName, {
required bool release,
bool verifyCaching = false,
List<String> additionalArgs = const <String>[],
}) async {
await runCommand(flutter,
<String>[
'build',
platformBuildName,
...additionalArgs,
if (release)
'--release'
else
'--debug',
'-v',
],
workingDirectory: path.join(flutterRoot, relativePathToApplication),
);
if (verifyCaching) {
printProgress('${green}Testing $platformLabel cache$reset for $cyan$relativePathToApplication$reset...');
await runCommand(flutter,
<String>[
'build',
platformBuildName,
'--performance-measurement-file=perf.json',
...additionalArgs,
if (release)
'--release'
else
'--debug',
'-v',
],
workingDirectory: path.join(flutterRoot, relativePathToApplication),
);
final File file = File(path.join(flutterRoot, relativePathToApplication, 'perf.json'));
if (!_allTargetsCached(file)) {
foundError(<String>[
'${red}Not all build targets cached after second run.$reset',
'The target performance data was: ${file.readAsStringSync().replaceAll('},', '},\n')}',
]);
}
}
}
bool _allTargetsCached(File performanceFile) {
final Map<String, Object?> data = json.decode(performanceFile.readAsStringSync())
as Map<String, Object?>;
final List<Map<String, Object?>> targets = (data['targets']! as List<Object?>)
.cast<Map<String, Object?>>();
return targets.every((Map<String, Object?> element) => element['skipped'] == true);
}
Future<void> _flutterBuildDart2js(String relativePathToApplication, String target, { bool expectNonZeroExit = false }) async {
printProgress('${green}Testing Dart2JS build$reset for $cyan$relativePathToApplication$reset...');
await runCommand(flutter,
<String>['build', 'web', '-v', '--target=$target'],
workingDirectory: path.join(flutterRoot, relativePathToApplication),
expectNonZeroExit: expectNonZeroExit,
environment: <String, String>{
'FLUTTER_WEB': 'true',
},
);
}
Future<void> _runAddToAppLifeCycleTests() async {
if (Platform.isMacOS) {
printProgress('${green}Running add-to-app life cycle iOS integration tests$reset...');
final String addToAppDir = path.join(flutterRoot, 'dev', 'integration_tests', 'ios_add2app_life_cycle');
await runCommand('./build_and_test.sh',
<String>[],
workingDirectory: addToAppDir,
);
} else {
printProgress('${yellow}Skipped on this platform (only iOS has add-to-add lifecycle tests at this time).$reset');
}
}
Future<void> _runFrameworkTests() async {
final List<String> trackWidgetCreationAlternatives = <String>['--track-widget-creation', '--no-track-widget-creation'];
Future<void> runWidgets() async {
printProgress('${green}Running packages/flutter tests $reset for ${cyan}test/widgets/$reset');
for (final String trackWidgetCreationOption in trackWidgetCreationAlternatives) {
await _runFlutterTest(
path.join(flutterRoot, 'packages', 'flutter'),
options: <String>[trackWidgetCreationOption],
tests: <String>[ path.join('test', 'widgets') + path.separator ],
);
}
// Try compiling code outside of the packages/flutter directory with and without --track-widget-creation
for (final String trackWidgetCreationOption in trackWidgetCreationAlternatives) {
await _runFlutterTest(
path.join(flutterRoot, 'dev', 'integration_tests', 'flutter_gallery'),
options: <String>[trackWidgetCreationOption],
fatalWarnings: false, // until we've migrated video_player
);
}
// Run release mode tests (see packages/flutter/test_release/README.md)
await _runFlutterTest(
path.join(flutterRoot, 'packages', 'flutter'),
options: <String>['--dart-define=dart.vm.product=true'],
tests: <String>['test_release${path.separator}'],
);
// Run profile mode tests (see packages/flutter/test_profile/README.md)
await _runFlutterTest(
path.join(flutterRoot, 'packages', 'flutter'),
options: <String>['--dart-define=dart.vm.product=false', '--dart-define=dart.vm.profile=true'],
tests: <String>['test_profile${path.separator}'],
);
}
Future<void> runImpeller() async {
printProgress('${green}Running packages/flutter tests $reset in Impeller$reset');
await _runFlutterTest(
path.join(flutterRoot, 'packages', 'flutter'),
options: <String>['--enable-impeller'],
);
}
Future<void> runLibraries() async {
final List<String> tests = Directory(path.join(flutterRoot, 'packages', 'flutter', 'test'))
.listSync(followLinks: false)
.whereType<Directory>()
.where((Directory dir) => !dir.path.endsWith('widgets'))
.map<String>((Directory dir) => path.join('test', path.basename(dir.path)) + path.separator)
.toList();
printProgress('${green}Running packages/flutter tests$reset for $cyan${tests.join(", ")}$reset');
for (final String trackWidgetCreationOption in trackWidgetCreationAlternatives) {
await _runFlutterTest(
path.join(flutterRoot, 'packages', 'flutter'),
options: <String>[trackWidgetCreationOption],
tests: tests,
);
}
}
Future<void> runExampleTests() async {
await runCommand(
flutter,
<String>['config', '--enable-${Platform.operatingSystem}-desktop'],
workingDirectory: flutterRoot,
);
await runCommand(
dart,
<String>[path.join(flutterRoot, 'dev', 'tools', 'examples_smoke_test.dart')],
workingDirectory: path.join(flutterRoot, 'examples', 'api'),
);
for (final FileSystemEntity entity in Directory(path.join(flutterRoot, 'examples')).listSync()) {
if (entity is! Directory || !Directory(path.join(entity.path, 'test')).existsSync()) {
continue;
}
await _runFlutterTest(entity.path);
}
}
Future<void> runTracingTests() async {
final String tracingDirectory = path.join(flutterRoot, 'dev', 'tracing_tests');
// run the tests for debug mode
await _runFlutterTest(tracingDirectory, options: <String>['--enable-vmservice']);
Future<List<String>> verifyTracingAppBuild({
required String modeArgument,
required String sourceFile,
required Set<String> allowed,
required Set<String> disallowed,
}) async {
try {
await runCommand(
flutter,
<String>[
'build', 'appbundle', '--$modeArgument', path.join('lib', sourceFile),
],
workingDirectory: tracingDirectory,
);
final Archive archive = ZipDecoder().decodeBytes(File(path.join(tracingDirectory, 'build', 'app', 'outputs', 'bundle', modeArgument, 'app-$modeArgument.aab')).readAsBytesSync());
final ArchiveFile libapp = archive.findFile('base/lib/arm64-v8a/libapp.so')!;
final Uint8List libappBytes = libapp.content as Uint8List; // bytes decompressed here
final String libappStrings = utf8.decode(libappBytes, allowMalformed: true);
await runCommand(flutter, <String>['clean'], workingDirectory: tracingDirectory);
final List<String> results = <String>[];
for (final String pattern in allowed) {
if (!libappStrings.contains(pattern)) {
results.add('When building with --$modeArgument, expected to find "$pattern" in libapp.so but could not find it.');
}
}
for (final String pattern in disallowed) {
if (libappStrings.contains(pattern)) {
results.add('When building with --$modeArgument, expected to not find "$pattern" in libapp.so but did find it.');
}
}
return results;
} catch (error, stackTrace) {
return <String>[
error.toString(),
...stackTrace.toString().trimRight().split('\n'),
];
}
}
final List<String> results = <String>[];
results.addAll(await verifyTracingAppBuild(
modeArgument: 'profile',
sourceFile: 'control.dart', // this is the control, the other two below are the actual test
allowed: <String>{
'TIMELINE ARGUMENTS TEST CONTROL FILE',
'toTimelineArguments used in non-debug build', // we call toTimelineArguments directly to check the message does exist
},
disallowed: <String>{
'BUILT IN DEBUG MODE', 'BUILT IN RELEASE MODE',
},
));
results.addAll(await verifyTracingAppBuild(
modeArgument: 'profile',
sourceFile: 'test.dart',
allowed: <String>{
'BUILT IN PROFILE MODE', 'RenderTest.performResize called', // controls
'BUILD', 'LAYOUT', 'PAINT', // we output these to the timeline in profile builds
// (LAYOUT and PAINT also exist because of NEEDS-LAYOUT and NEEDS-PAINT in RenderObject.toStringShort)
},
disallowed: <String>{
'BUILT IN DEBUG MODE', 'BUILT IN RELEASE MODE',
'TestWidget.debugFillProperties called', 'RenderTest.debugFillProperties called', // debug only
'toTimelineArguments used in non-debug build', // entire function should get dropped by tree shaker
},
));
results.addAll(await verifyTracingAppBuild(
modeArgument: 'release',
sourceFile: 'test.dart',
allowed: <String>{
'BUILT IN RELEASE MODE', 'RenderTest.performResize called', // controls
},
disallowed: <String>{
'BUILT IN DEBUG MODE', 'BUILT IN PROFILE MODE',
'BUILD', 'LAYOUT', 'PAINT', // these are only used in Timeline.startSync calls that should not appear in release builds
'TestWidget.debugFillProperties called', 'RenderTest.debugFillProperties called', // debug only
'toTimelineArguments used in non-debug build', // not included in release builds
},
));
if (results.isNotEmpty) {
foundError(results);
}
}
Future<void> runFixTests(String package) async {
final List<String> args = <String>[
'fix',
'--compare-to-golden',
];
await runCommand(
dart,
args,
workingDirectory: path.join(flutterRoot, 'packages', package, 'test_fixes'),
);
}
Future<void> runPrivateTests() async {
final List<String> args = <String>[
'run',
'bin/test_private.dart',
];
final Map<String, String> environment = <String, String>{
'FLUTTER_ROOT': flutterRoot,
if (Directory(pubCache).existsSync())
'PUB_CACHE': pubCache,
};
adjustEnvironmentToEnableFlutterAsserts(environment);
await runCommand(
dart,
args,
workingDirectory: path.join(flutterRoot, 'packages', 'flutter', 'test_private'),
environment: environment,
);
}
// Tests that take longer than average to run. This is usually because they
// need to compile something large or make use of the analyzer for the test.
// These tests need to be platform agnostic as they are only run on a linux
// machine to save on execution time and cost.
Future<void> runSlow() async {
printProgress('${green}Running slow package tests$reset for directories other than packages/flutter');
await runTracingTests();
await runFixTests('flutter');
await runFixTests('flutter_test');
await runFixTests('integration_test');
await runFixTests('flutter_driver');
await runPrivateTests();
}
Future<void> runMisc() async {
printProgress('${green}Running package tests$reset for directories other than packages/flutter');
await _runTestHarnessTests();
await runExampleTests();
await _runFlutterTest(
path.join(flutterRoot, 'dev', 'a11y_assessments'),
tests: <String>[ 'test' ],
);
await _runDartTest(path.join(flutterRoot, 'dev', 'bots'));
await _runDartTest(path.join(flutterRoot, 'dev', 'devicelab'), ensurePrecompiledTool: false); // See https://github.com/flutter/flutter/issues/86209
await _runDartTest(path.join(flutterRoot, 'dev', 'conductor', 'core'), forceSingleCore: true);
// TODO(gspencergoog): Remove the exception for fatalWarnings once https://github.com/flutter/flutter/issues/113782 has landed.
await _runFlutterTest(path.join(flutterRoot, 'dev', 'integration_tests', 'android_semantics_testing'), fatalWarnings: false);
await _runFlutterTest(path.join(flutterRoot, 'dev', 'integration_tests', 'ui'));
await _runFlutterTest(path.join(flutterRoot, 'dev', 'manual_tests'));
await _runFlutterTest(path.join(flutterRoot, 'dev', 'tools'));
await _runFlutterTest(path.join(flutterRoot, 'dev', 'tools', 'vitool'));
await _runFlutterTest(path.join(flutterRoot, 'dev', 'tools', 'gen_defaults'));
await _runFlutterTest(path.join(flutterRoot, 'dev', 'tools', 'gen_keycodes'));
await _runFlutterTest(path.join(flutterRoot, 'dev', 'benchmarks', 'test_apps', 'stocks'));
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_driver'), tests: <String>[path.join('test', 'src', 'real_tests')]);
await _runFlutterTest(path.join(flutterRoot, 'packages', 'integration_test'), options: <String>[
'--enable-vmservice',
// Web-specific tests depend on Chromium, so they run as part of the web_long_running_tests shard.
'--exclude-tags=web',
]);
// Run java unit tests for integration_test
//
// Generate Gradle wrapper if it doesn't exist.
Process.runSync(
flutter,
<String>['build', 'apk', '--config-only'],
workingDirectory: path.join(flutterRoot, 'packages', 'integration_test', 'example', 'android'),
);
await runCommand(
path.join(flutterRoot, 'packages', 'integration_test', 'example', 'android', 'gradlew$bat'),
<String>[
':integration_test:testDebugUnitTest',
'--tests',
'dev.flutter.plugins.integration_test.FlutterDeviceScreenshotTest',
],
workingDirectory: path.join(flutterRoot, 'packages', 'integration_test', 'example', 'android'),
);
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_goldens'));
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_localizations'));
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_test'));
await _runFlutterTest(path.join(flutterRoot, 'packages', 'fuchsia_remote_debug_protocol'));
await _runFlutterTest(path.join(flutterRoot, 'dev', 'integration_tests', 'non_nullable'));
const String httpClientWarning =
'Warning: At least one test in this suite creates an HttpClient. When running a test suite that uses\n'
'TestWidgetsFlutterBinding, all HTTP requests will return status code 400, and no network request\n'
'will actually be made. Any test expecting a real network connection and status code will fail.\n'
'To test code that needs an HttpClient, provide your own HttpClient implementation to the code under\n'
'test, so that your test can consistently provide a testable response to the code under test.';
await _runFlutterTest(
path.join(flutterRoot, 'packages', 'flutter_test'),
script: path.join('test', 'bindings_test_failure.dart'),
expectFailure: true,
printOutput: false,
outputChecker: (CommandResult result) {
final Iterable<Match> matches = httpClientWarning.allMatches(result.flattenedStdout!);
if (matches.isEmpty || matches.length > 1) {
return 'Failed to print warning about HttpClientUsage, or printed it too many times.\n\n'
'stdout:\n${result.flattenedStdout}\n\n'
'stderr:\n${result.flattenedStderr}';
}
return null;
},
);
}
await selectSubshard(<String, ShardRunner>{
'widgets': runWidgets,
'libraries': runLibraries,
'slow': runSlow,
'misc': runMisc,
'impeller': runImpeller,
});
}
Future<void> _runFrameworkCoverage() async {
final File coverageFile = File(path.join(flutterRoot, 'packages', 'flutter', 'coverage', 'lcov.info'));
if (!coverageFile.existsSync()) {
foundError(<String>[
'${red}Coverage file not found.$reset',
'Expected to find: $cyan${coverageFile.absolute.path}$reset',
'This file is normally obtained by running `${green}flutter update-packages$reset`.',
]);
return;
}
coverageFile.deleteSync();
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter'),
options: const <String>['--coverage'],
);
if (!coverageFile.existsSync()) {
foundError(<String>[
'${red}Coverage file not found.$reset',
'Expected to find: $cyan${coverageFile.absolute.path}$reset',
'This file should have been generated by the `${green}flutter test --coverage$reset` script, but was not.',
]);
return;
}
}
Future<void> _runWebHtmlUnitTests() {
return _runWebUnitTests('html');
}
Future<void> _runWebCanvasKitUnitTests() {
return _runWebUnitTests('canvaskit');
}
Future<void> _runWebUnitTests(String webRenderer) async {
final Map<String, ShardRunner> subshards = <String, ShardRunner>{};
final Directory flutterPackageDirectory = Directory(path.join(flutterRoot, 'packages', 'flutter'));
final Directory flutterPackageTestDirectory = Directory(path.join(flutterPackageDirectory.path, 'test'));
final List<String> allTests = flutterPackageTestDirectory
.listSync()
.whereType<Directory>()
.expand((Directory directory) => directory
.listSync(recursive: true)
.where((FileSystemEntity entity) => entity.path.endsWith('_test.dart'))
)
.whereType<File>()
.map<String>((File file) => path.relative(file.path, from: flutterPackageDirectory.path))
.where((String filePath) => !kWebTestFileKnownFailures[webRenderer]!.contains(path.split(filePath).join('/')))
.toList()
// Finally we shuffle the list because we want the average cost per file to be uniformly
// distributed. If the list is not sorted then different shards and batches may have
// very different characteristics.
// We use a constant seed for repeatability.
..shuffle(math.Random(0));
assert(webShardCount >= 1);
final int testsPerShard = (allTests.length / webShardCount).ceil();
assert(testsPerShard * webShardCount >= allTests.length);
// This for loop computes all but the last shard.
for (int index = 0; index < webShardCount - 1; index += 1) {
subshards['$index'] = () => _runFlutterWebTest(
webRenderer,
flutterPackageDirectory.path,
allTests.sublist(
index * testsPerShard,
(index + 1) * testsPerShard,
),
);
}
// The last shard also runs the flutter_web_plugins tests.
//
// We make sure the last shard ends in _last so it's easier to catch mismatches
// between `.cirrus.yml` and `test.dart`.
subshards['${webShardCount - 1}_last'] = () async {
await _runFlutterWebTest(
webRenderer,
flutterPackageDirectory.path,
allTests.sublist(
(webShardCount - 1) * testsPerShard,
allTests.length,
),
);
await _runFlutterWebTest(
webRenderer,
path.join(flutterRoot, 'packages', 'flutter_web_plugins'),
<String>['test'],
);
await _runFlutterWebTest(
webRenderer,
path.join(flutterRoot, 'packages', 'flutter_driver'),
<String>[path.join('test', 'src', 'web_tests', 'web_extension_test.dart')],
);
};
await selectSubshard(subshards);
}
/// Coarse-grained integration tests running on the Web.
Future<void> _runWebLongRunningTests() async {
final String engineVersion = File(engineVersionFile).readAsStringSync().trim();
final String engineRealm = File(engineRealmFile).readAsStringSync().trim();
if (engineRealm.isNotEmpty) {
return;
}
final List<ShardRunner> tests = <ShardRunner>[
for (final String buildMode in _kAllBuildModes) ...<ShardRunner>[
() => _runFlutterDriverWebTest(
testAppDirectory: path.join('packages', 'integration_test', 'example'),
target: path.join('test_driver', 'failure.dart'),
buildMode: buildMode,
renderer: 'canvaskit',
// This test intentionally fails and prints stack traces in the browser
// logs. To avoid confusion, silence browser output.
silenceBrowserOutput: true,
),
() => _runFlutterDriverWebTest(
testAppDirectory: path.join('packages', 'integration_test', 'example'),
target: path.join('integration_test', 'example_test.dart'),
driver: path.join('test_driver', 'integration_test.dart'),
buildMode: buildMode,
renderer: 'canvaskit',
expectWriteResponseFile: true,
expectResponseFileContent: 'null',
),
() => _runFlutterDriverWebTest(
testAppDirectory: path.join('packages', 'integration_test', 'example'),
target: path.join('integration_test', 'extended_test.dart'),
driver: path.join('test_driver', 'extended_integration_test.dart'),
buildMode: buildMode,
renderer: 'canvaskit',
expectWriteResponseFile: true,
expectResponseFileContent: '''
{
"screenshots": [
{
"screenshotName": "platform_name",
"bytes": []
},
{
"screenshotName": "platform_name_2",
"bytes": []
}
]
}''',
),
],
// This test doesn't do anything interesting w.r.t. rendering, so we don't run the full build mode x renderer matrix.
() => _runWebE2eTest('platform_messages_integration', buildMode: 'debug', renderer: 'canvaskit'),
() => _runWebE2eTest('platform_messages_integration', buildMode: 'profile', renderer: 'html'),
() => _runWebE2eTest('platform_messages_integration', buildMode: 'release', renderer: 'html'),
// This test doesn't do anything interesting w.r.t. rendering, so we don't run the full build mode x renderer matrix.
() => _runWebE2eTest('profile_diagnostics_integration', buildMode: 'debug', renderer: 'html'),
() => _runWebE2eTest('profile_diagnostics_integration', buildMode: 'profile', renderer: 'canvaskit'),
() => _runWebE2eTest('profile_diagnostics_integration', buildMode: 'release', renderer: 'html'),
// This test is only known to work in debug mode.
() => _runWebE2eTest('scroll_wheel_integration', buildMode: 'debug', renderer: 'html'),
// This test doesn't do anything interesting w.r.t. rendering, so we don't run the full build mode x renderer matrix.
() => _runWebE2eTest('text_editing_integration', buildMode: 'debug', renderer: 'canvaskit'),
() => _runWebE2eTest('text_editing_integration', buildMode: 'profile', renderer: 'html'),
() => _runWebE2eTest('text_editing_integration', buildMode: 'release', renderer: 'html'),
// This test doesn't do anything interesting w.r.t. rendering, so we don't run the full build mode x renderer matrix.
() => _runWebE2eTest('url_strategy_integration', buildMode: 'debug', renderer: 'html'),
() => _runWebE2eTest('url_strategy_integration', buildMode: 'profile', renderer: 'canvaskit'),
() => _runWebE2eTest('url_strategy_integration', buildMode: 'release', renderer: 'html'),
// This test doesn't do anything interesting w.r.t. rendering, so we don't run the full build mode x renderer matrix.
() => _runWebE2eTest('capabilities_integration_canvaskit', buildMode: 'debug', renderer: 'auto'),
() => _runWebE2eTest('capabilities_integration_canvaskit', buildMode: 'profile', renderer: 'canvaskit'),
() => _runWebE2eTest('capabilities_integration_html', buildMode: 'release', renderer: 'html'),
// This test doesn't do anything interesting w.r.t. rendering, so we don't run the full build mode x renderer matrix.
// CacheWidth and CacheHeight are only currently supported in CanvasKit mode, so we don't run the test in HTML mode.
() => _runWebE2eTest('cache_width_cache_height_integration', buildMode: 'debug', renderer: 'auto'),
() => _runWebE2eTest('cache_width_cache_height_integration', buildMode: 'profile', renderer: 'canvaskit'),
() => _runWebTreeshakeTest(),
() => _runFlutterDriverWebTest(
testAppDirectory: path.join(flutterRoot, 'examples', 'hello_world'),
target: 'test_driver/smoke_web_engine.dart',
buildMode: 'profile',
renderer: 'auto',
),
() => _runGalleryE2eWebTest('debug'),
() => _runGalleryE2eWebTest('debug', canvasKit: true),
() => _runGalleryE2eWebTest('profile'),
() => _runGalleryE2eWebTest('profile', canvasKit: true),
() => _runGalleryE2eWebTest('release'),
() => _runGalleryE2eWebTest('release', canvasKit: true),
() => runWebServiceWorkerTest(headless: true, testType: ServiceWorkerTestType.withoutFlutterJs),
() => runWebServiceWorkerTest(headless: true, testType: ServiceWorkerTestType.withFlutterJs),
() => runWebServiceWorkerTest(headless: true, testType: ServiceWorkerTestType.withFlutterJsShort),
() => runWebServiceWorkerTest(headless: true, testType: ServiceWorkerTestType.withFlutterJsEntrypointLoadedEvent),
() => runWebServiceWorkerTest(headless: true, testType: ServiceWorkerTestType.withFlutterJsTrustedTypesOn),
() => runWebServiceWorkerTest(headless: true, testType: ServiceWorkerTestType.withFlutterJsNonceOn),
() => runWebServiceWorkerTestWithCachingResources(headless: true, testType: ServiceWorkerTestType.withoutFlutterJs),
() => runWebServiceWorkerTestWithCachingResources(headless: true, testType: ServiceWorkerTestType.withFlutterJs),
() => runWebServiceWorkerTestWithCachingResources(headless: true, testType: ServiceWorkerTestType.withFlutterJsShort),
() => runWebServiceWorkerTestWithCachingResources(headless: true, testType: ServiceWorkerTestType.withFlutterJsEntrypointLoadedEvent),
() => runWebServiceWorkerTestWithCachingResources(headless: true, testType: ServiceWorkerTestType.withFlutterJsTrustedTypesOn),
() => runWebServiceWorkerTestWithGeneratedEntrypoint(headless: true),
() => runWebServiceWorkerTestWithBlockedServiceWorkers(headless: true),
() => runWebServiceWorkerTestWithCustomServiceWorkerVersion(headless: true),
() => _runWebStackTraceTest('profile', 'lib/stack_trace.dart'),
() => _runWebStackTraceTest('release', 'lib/stack_trace.dart'),
() => _runWebStackTraceTest('profile', 'lib/framework_stack_trace.dart'),
() => _runWebStackTraceTest('release', 'lib/framework_stack_trace.dart'),
() => _runWebDebugTest('lib/stack_trace.dart'),
() => _runWebDebugTest('lib/framework_stack_trace.dart'),
() => _runWebDebugTest('lib/web_directory_loading.dart'),
() => _runWebDebugTest('lib/web_resources_cdn_test.dart',
additionalArguments: <String>[
'--dart-define=TEST_FLUTTER_ENGINE_VERSION=$engineVersion',
]),
() => _runWebDebugTest('test/test.dart'),
() => _runWebDebugTest('lib/null_safe_main.dart'),
() => _runWebDebugTest('lib/web_define_loading.dart',
additionalArguments: <String>[
'--dart-define=test.valueA=Example,A',
'--dart-define=test.valueB=Value',
]
),
() => _runWebReleaseTest('lib/web_define_loading.dart',
additionalArguments: <String>[
'--dart-define=test.valueA=Example,A',
'--dart-define=test.valueB=Value',
]
),
() => _runWebDebugTest('lib/sound_mode.dart'),
() => _runWebReleaseTest('lib/sound_mode.dart'),
() => _runFlutterWebTest(
'html',
path.join(flutterRoot, 'packages', 'integration_test'),
<String>['test/web_extension_test.dart'],
),
() => _runFlutterWebTest(
'canvaskit',
path.join(flutterRoot, 'packages', 'integration_test'),
<String>['test/web_extension_test.dart'],
),
];
// Shuffling mixes fast tests with slow tests so shards take roughly the same
// amount of time to run.
tests.shuffle(math.Random(0));
await _ensureChromeDriverIsRunning();
await _runShardRunnerIndexOfTotalSubshard(tests);
await _stopChromeDriver();
}
/// Runs one of the `dev/integration_tests/web_e2e_tests` tests.
Future<void> _runWebE2eTest(
String name, {
required String buildMode,
required String renderer,
}) async {
await _runFlutterDriverWebTest(
target: path.join('test_driver', '$name.dart'),
buildMode: buildMode,
renderer: renderer,
testAppDirectory: path.join(flutterRoot, 'dev', 'integration_tests', 'web_e2e_tests'),
);
}
Future<void> _runFlutterDriverWebTest({
required String target,
required String buildMode,
required String renderer,
required String testAppDirectory,
String? driver,
bool expectFailure = false,
bool silenceBrowserOutput = false,
bool expectWriteResponseFile = false,
String expectResponseFileContent = '',
}) async {
printProgress('${green}Running integration tests $target in $buildMode mode.$reset');
await runCommand(
flutter,
<String>[ 'clean' ],
workingDirectory: testAppDirectory,
);
final String responseFile =
path.join(testAppDirectory, 'build', 'integration_response_data.json');
if (File(responseFile).existsSync()) {
File(responseFile).deleteSync();
}
await runCommand(
flutter,
<String>[
...flutterTestArgs,
'drive',
if (driver != null) '--driver=$driver',
'--target=$target',
'--browser-name=chrome',
'-d',
'web-server',
'--$buildMode',
'--web-renderer=$renderer',
],
expectNonZeroExit: expectFailure,
workingDirectory: testAppDirectory,
environment: <String, String>{
'FLUTTER_WEB': 'true',
},
removeLine: (String line) {
if (!silenceBrowserOutput) {
return false;
}
if (line.trim().startsWith('[INFO]')) {
return true;
}
return false;
},
);
if (expectWriteResponseFile) {
if (!File(responseFile).existsSync()) {
foundError(<String>[
'$bold${red}Command did not write the response file but expected response file written.$reset',
]);
} else {
final String response = File(responseFile).readAsStringSync();
if (response != expectResponseFileContent) {
foundError(<String>[
'$bold${red}Command write the response file with $response but expected response file with $expectResponseFileContent.$reset',
]);
}
}
}
}
// Compiles a sample web app and checks that its JS doesn't contain certain
// debug code that we expect to be tree shaken out.
//
// The app is compiled in `--profile` mode to prevent the compiler from
// minifying the symbols.
Future<void> _runWebTreeshakeTest() async {
final String testAppDirectory = path.join(flutterRoot, 'dev', 'integration_tests', 'web_e2e_tests');
final String target = path.join('lib', 'treeshaking_main.dart');
await runCommand(
flutter,
<String>[ 'clean' ],
workingDirectory: testAppDirectory,
);
await runCommand(
flutter,
<String>[
'build',
'web',
'--target=$target',
'--profile',
],
workingDirectory: testAppDirectory,
environment: <String, String>{
'FLUTTER_WEB': 'true',
},
);
final File mainDartJs = File(path.join(testAppDirectory, 'build', 'web', 'main.dart.js'));
final String javaScript = mainDartJs.readAsStringSync();
// Check that we're not looking at minified JS. Otherwise this test would result in false positive.
expect(javaScript.contains('RootElement'), true);
const String word = 'debugFillProperties';
int count = 0;
int pos = javaScript.indexOf(word);
final int contentLength = javaScript.length;
while (pos != -1) {
count += 1;
pos += word.length;
if (pos >= contentLength || count > 100) {
break;
}
pos = javaScript.indexOf(word, pos);
}
// The following are classes from `timeline.dart` that should be treeshaken
// off unless the app (typically a benchmark) uses methods that need them.
expect(javaScript.contains('AggregatedTimedBlock'), false);
expect(javaScript.contains('AggregatedTimings'), false);
expect(javaScript.contains('_BlockBuffer'), false);
expect(javaScript.contains('_StringListChain'), false);
expect(javaScript.contains('_Float64ListChain'), false);
const int kMaxExpectedDebugFillProperties = 11;
if (count > kMaxExpectedDebugFillProperties) {
throw Exception(
'Too many occurrences of "$word" in compiled JavaScript.\n'
'Expected no more than $kMaxExpectedDebugFillProperties, but found $count.'
);
}
}
/// Returns the commit hash of the flutter/packages repository that's rolled in.
///
/// The flutter/packages repository is a downstream dependency, it is only used
/// by flutter/flutter for testing purposes, to assure stable tests for a given
/// flutter commit the flutter/packages commit hash to test against is coded in
/// the bin/internal/flutter_packages.version file.
///
/// The `filesystem` parameter specified filesystem to read the packages version file from.
/// The `packagesVersionFile` parameter allows specifying an alternative path for the
/// packages version file, when null [flutterPackagesVersionFile] is used.
Future<String> getFlutterPackagesVersion({
fs.FileSystem fileSystem = const LocalFileSystem(),
String? packagesVersionFile,
}) async {
final File versionFile = fileSystem.file(packagesVersionFile ?? flutterPackagesVersionFile);
final String versionFileContents = await versionFile.readAsString();
return versionFileContents.trim();
}
/// Executes the test suite for the flutter/packages repo.
Future<void> _runFlutterPackagesTests() async {
Future<void> runAnalyze() async {
printProgress('${green}Running analysis for flutter/packages$reset');
final Directory checkout = Directory.systemTemp.createTempSync('flutter_packages.');
await runCommand(
'git',
<String>[
'-c',
'core.longPaths=true',
'clone',
'https://github.com/flutter/packages.git',
'.',
],
workingDirectory: checkout.path,
);
final String packagesCommit = await getFlutterPackagesVersion();
await runCommand(
'git',
<String>[
'-c',
'core.longPaths=true',
'checkout',
packagesCommit,
],
workingDirectory: checkout.path,
);
// Prep the repository tooling.
// This test does not use tool_runner.sh because in this context the test
// should always run on the entire packages repo, while tool_runner.sh
// is designed for flutter/packages CI and only analyzes changed repository
// files when run for anything but master.
final String toolDir = path.join(checkout.path, 'script', 'tool');
await runCommand(
'dart',
<String>[
'pub',
'get',
],
workingDirectory: toolDir,
);
final String toolScript = path.join(toolDir, 'bin', 'flutter_plugin_tools.dart');
await runCommand(
'dart',
<String>[
'run',
toolScript,
'analyze',
// Fetch the oldest possible dependencies, rather than the newest, to
// insulate flutter/flutter from out-of-band failures when new versions
// of dependencies are published. This compensates for the fact that
// flutter/packages doesn't use pinned dependencies, and for the
// purposes of this test using old dependencies is fine. See
// https://github.com/flutter/flutter/issues/129633
'--downgrade',
'--custom-analysis=script/configs/custom_analysis.yaml',
],
workingDirectory: checkout.path,
);
}
await selectSubshard(<String, ShardRunner>{
'analyze': runAnalyze,
});
}
// Runs customer_testing.
Future<void> _runCustomerTesting() async {
printProgress('${green}Running customer testing$reset');
await runCommand(
'git',
<String>[
'fetch',
'origin',
'master',
],
workingDirectory: flutterRoot,
);
await runCommand(
'git',
<String>[
'branch',
'-f',
'master',
'origin/master',
],
workingDirectory: flutterRoot,
);
final Map<String, String> env = Platform.environment;
final String? revision = env['REVISION'];
if (revision != null) {
await runCommand(
'git',
<String>[
'checkout',
revision,
],
workingDirectory: flutterRoot,
);
}
final String winScript = path.join(flutterRoot, 'dev', 'customer_testing', 'ci.bat');
await runCommand(
Platform.isWindows? winScript: './ci.sh',
<String>[],
workingDirectory: path.join(flutterRoot, 'dev', 'customer_testing'),
);
}
// Runs analysis tests.
Future<void> _runAnalyze() async {
printProgress('${green}Running analysis testing$reset');
await runCommand(
'dart',
<String>[
'--enable-asserts',
path.join(flutterRoot, 'dev', 'bots', 'analyze.dart'),
],
workingDirectory: flutterRoot,
);
}
// Runs flutter_precache.
Future<void> _runFuchsiaPrecache() async {
printProgress('${green}Running flutter precache tests$reset');
await runCommand(
'flutter',
<String>[
'config',
'--enable-fuchsia',
],
workingDirectory: flutterRoot,
);
await runCommand(
'flutter',
<String>[
'precache',
'--flutter_runner',
'--fuchsia',
'--no-android',
'--no-ios',
'--force',
],
workingDirectory: flutterRoot,
);
}
// Runs docs.
Future<void> _runDocs() async {
printProgress('${green}Running flutter doc tests$reset');
await runCommand(
'./dev/bots/docs.sh',
<String>[
'--output',
'dev/docs/api_docs.zip',
'--keep-staging',
'--staging-dir',
'dev/docs',
],
workingDirectory: flutterRoot,
);
}
// Verifies binaries are codesigned.
Future<void> _runVerifyCodesigned() async {
printProgress('${green}Running binaries codesign verification$reset');
await runCommand(
'flutter',
<String>[
'precache',
'--android',
'--ios',
'--macos'
],
workingDirectory: flutterRoot,
);
await verifyExist(flutterRoot);
await verifySignatures(flutterRoot);
}
const List<String> expectedEntitlements = <String>[
'com.apple.security.cs.allow-jit',
'com.apple.security.cs.allow-unsigned-executable-memory',
'com.apple.security.cs.allow-dyld-environment-variables',
'com.apple.security.network.client',
'com.apple.security.network.server',
'com.apple.security.cs.disable-library-validation',
];
/// Binaries that are expected to be codesigned and have entitlements.
///
/// This list should be kept in sync with the actual contents of Flutter's
/// cache.
List<String> binariesWithEntitlements(String flutterRoot) {
return <String> [
'artifacts/engine/android-arm-profile/darwin-x64/gen_snapshot',
'artifacts/engine/android-arm-release/darwin-x64/gen_snapshot',
'artifacts/engine/android-arm64-profile/darwin-x64/gen_snapshot',
'artifacts/engine/android-arm64-release/darwin-x64/gen_snapshot',
'artifacts/engine/android-x64-profile/darwin-x64/gen_snapshot',
'artifacts/engine/android-x64-release/darwin-x64/gen_snapshot',
'artifacts/engine/darwin-x64-profile/gen_snapshot',
'artifacts/engine/darwin-x64-profile/gen_snapshot_arm64',
'artifacts/engine/darwin-x64-profile/gen_snapshot_x64',
'artifacts/engine/darwin-x64-release/gen_snapshot',
'artifacts/engine/darwin-x64-release/gen_snapshot_arm64',
'artifacts/engine/darwin-x64-release/gen_snapshot_x64',
'artifacts/engine/darwin-x64/flutter_tester',
'artifacts/engine/darwin-x64/gen_snapshot',
'artifacts/engine/darwin-x64/gen_snapshot_arm64',
'artifacts/engine/darwin-x64/gen_snapshot_x64',
'artifacts/engine/ios-profile/gen_snapshot_arm64',
'artifacts/engine/ios-release/gen_snapshot_arm64',
'artifacts/engine/ios/gen_snapshot_arm64',
'artifacts/libimobiledevice/idevicescreenshot',
'artifacts/libimobiledevice/idevicesyslog',
'artifacts/libimobiledevice/libimobiledevice-1.0.6.dylib',
'artifacts/libplist/libplist-2.0.3.dylib',
'artifacts/openssl/libcrypto.1.1.dylib',
'artifacts/openssl/libssl.1.1.dylib',
'artifacts/usbmuxd/iproxy',
'artifacts/usbmuxd/libusbmuxd-2.0.6.dylib',
'dart-sdk/bin/dart',
'dart-sdk/bin/dartaotruntime',
'dart-sdk/bin/utils/gen_snapshot',
'dart-sdk/bin/utils/wasm-opt',
]
.map((String relativePath) => path.join(flutterRoot, 'bin', 'cache', relativePath)).toList();
}
/// Binaries that are only expected to be codesigned.
///
/// This list should be kept in sync with the actual contents of Flutter's
/// cache.
List<String> binariesWithoutEntitlements(String flutterRoot) {
return <String>[
'artifacts/engine/darwin-x64-profile/FlutterMacOS.xcframework/macos-arm64_x86_64/FlutterMacOS.framework/Versions/A/FlutterMacOS',
'artifacts/engine/darwin-x64-release/FlutterMacOS.xcframework/macos-arm64_x86_64/FlutterMacOS.framework/Versions/A/FlutterMacOS',
'artifacts/engine/darwin-x64/FlutterMacOS.xcframework/macos-arm64_x86_64/FlutterMacOS.framework/Versions/A/FlutterMacOS',
'artifacts/engine/darwin-x64/font-subset',
'artifacts/engine/darwin-x64/impellerc',
'artifacts/engine/darwin-x64/libpath_ops.dylib',
'artifacts/engine/darwin-x64/libtessellator.dylib',
'artifacts/engine/ios-profile/Flutter.xcframework/ios-arm64/Flutter.framework/Flutter',
'artifacts/engine/ios-profile/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Flutter',
'artifacts/engine/ios-profile/extension_safe/Flutter.xcframework/ios-arm64/Flutter.framework/Flutter',
'artifacts/engine/ios-profile/extension_safe/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Flutter',
'artifacts/engine/ios-release/Flutter.xcframework/ios-arm64/Flutter.framework/Flutter',
'artifacts/engine/ios-release/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Flutter',
'artifacts/engine/ios-release/extension_safe/Flutter.xcframework/ios-arm64/Flutter.framework/Flutter',
'artifacts/engine/ios-release/extension_safe/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Flutter',
'artifacts/engine/ios/Flutter.xcframework/ios-arm64/Flutter.framework/Flutter',
'artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Flutter',
'artifacts/engine/ios/extension_safe/Flutter.xcframework/ios-arm64/Flutter.framework/Flutter',
'artifacts/engine/ios/extension_safe/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Flutter',
'artifacts/ios-deploy/ios-deploy',
]
.map((String relativePath) => path.join(flutterRoot, 'bin', 'cache', relativePath)).toList();
}
/// xcframeworks that are expected to be codesigned.
///
/// This list should be kept in sync with the actual contents of Flutter's
/// cache.
List<String> signedXcframeworks(String flutterRoot) {
return <String>[
'artifacts/engine/ios-profile/Flutter.xcframework',
'artifacts/engine/ios-profile/extension_safe/Flutter.xcframework',
'artifacts/engine/ios-release/Flutter.xcframework',
'artifacts/engine/ios-release/extension_safe/Flutter.xcframework',
'artifacts/engine/ios/Flutter.xcframework',
'artifacts/engine/ios/extension_safe/Flutter.xcframework',
'artifacts/engine/darwin-x64-profile/FlutterMacOS.xcframework',
'artifacts/engine/darwin-x64-release/FlutterMacOS.xcframework',
'artifacts/engine/darwin-x64/FlutterMacOS.xcframework',
]
.map((String relativePath) => path.join(flutterRoot, 'bin', 'cache', relativePath)).toList();
}
/// Verify the existence of all expected binaries in cache.
///
/// This function ignores code signatures and entitlements, and is intended to
/// be run on every commit. It should throw if either new binaries are added
/// to the cache or expected binaries removed. In either case, this class'
/// [binariesWithEntitlements] or [binariesWithoutEntitlements] lists should
/// be updated accordingly.
Future<void> verifyExist(
String flutterRoot,
{@visibleForTesting ProcessManager processManager = const LocalProcessManager()
}) async {
final Set<String> foundFiles = <String>{};
final String cacheDirectory = path.join(flutterRoot, 'bin', 'cache');
for (final String binaryPath
in await findBinaryPaths(cacheDirectory, processManager: processManager)) {
if (binariesWithEntitlements(flutterRoot).contains(binaryPath)) {
foundFiles.add(binaryPath);
} else if (binariesWithoutEntitlements(flutterRoot).contains(binaryPath)) {
foundFiles.add(binaryPath);
} else {
throw Exception(
'Found unexpected binary in cache: $binaryPath');
}
}
final List<String> allExpectedFiles = binariesWithEntitlements(flutterRoot) + binariesWithoutEntitlements(flutterRoot);
if (foundFiles.length < allExpectedFiles.length) {
final List<String> unfoundFiles = allExpectedFiles
.where(
(String file) => !foundFiles.contains(file),
)
.toList();
print(
'Expected binaries not found in cache:\n\n${unfoundFiles.join('\n')}\n\n'
'If this commit is removing binaries from the cache, this test should be fixed by\n'
'removing the relevant entry from either the "binariesWithEntitlements" or\n'
'"binariesWithoutEntitlements" getters in dev/tools/lib/codesign.dart.',
);
throw Exception('Did not find all expected binaries!');
}
print('All expected binaries present.');
}
/// Verify code signatures and entitlements of all binaries in the cache.
Future<void> verifySignatures(
String flutterRoot,
{@visibleForTesting ProcessManager processManager = const LocalProcessManager()}
) async {
final List<String> unsignedFiles = <String>[];
final List<String> wrongEntitlementBinaries = <String>[];
final List<String> unexpectedFiles = <String>[];
final String cacheDirectory = path.join(flutterRoot, 'bin', 'cache');
final List<String> binariesAndXcframeworks =
(await findBinaryPaths(cacheDirectory, processManager: processManager)) + (await findXcframeworksPaths(cacheDirectory, processManager: processManager));
for (final String pathToCheck in binariesAndXcframeworks) {
bool verifySignature = false;
bool verifyEntitlements = false;
if (binariesWithEntitlements(flutterRoot).contains(pathToCheck)) {
verifySignature = true;
verifyEntitlements = true;
}
if (binariesWithoutEntitlements(flutterRoot).contains(pathToCheck)) {
verifySignature = true;
}
if (signedXcframeworks(flutterRoot).contains(pathToCheck)) {
verifySignature = true;
}
if (!verifySignature && !verifyEntitlements) {
unexpectedFiles.add(pathToCheck);
print('Unexpected binary or xcframework $pathToCheck found in cache!');
continue;
}
print('Verifying the code signature of $pathToCheck');
final io.ProcessResult codeSignResult = await processManager.run(
<String>[
'codesign',
'-vvv',
pathToCheck,
],
);
if (codeSignResult.exitCode != 0) {
unsignedFiles.add(pathToCheck);
print(
'File "$pathToCheck" does not appear to be codesigned.\n'
'The `codesign` command failed with exit code ${codeSignResult.exitCode}:\n'
'${codeSignResult.stderr}\n',
);
continue;
}
if (verifyEntitlements) {
print('Verifying entitlements of $pathToCheck');
if (!(await hasExpectedEntitlements(pathToCheck, flutterRoot, processManager: processManager))) {
wrongEntitlementBinaries.add(pathToCheck);
}
}
}
// First print all deviations from expectations
if (unsignedFiles.isNotEmpty) {
print('Found ${unsignedFiles.length} unsigned files:');
unsignedFiles.forEach(print);
}
if (wrongEntitlementBinaries.isNotEmpty) {
print('Found ${wrongEntitlementBinaries.length} files with unexpected entitlements:');
wrongEntitlementBinaries.forEach(print);
}
if (unexpectedFiles.isNotEmpty) {
print('Found ${unexpectedFiles.length} unexpected files in the cache:');
unexpectedFiles.forEach(print);
}
// Finally, exit on any invalid state
if (unsignedFiles.isNotEmpty) {
throw Exception('Test failed because unsigned files detected.');
}
if (wrongEntitlementBinaries.isNotEmpty) {
throw Exception(
'Test failed because files found with the wrong entitlements:\n'
'${wrongEntitlementBinaries.join('\n')}',
);
}
if (unexpectedFiles.isNotEmpty) {
throw Exception('Test failed because unexpected files found in the cache.');
}
print('Verified that files are codesigned and have expected entitlements.');
}
/// Find every binary file in the given [rootDirectory].
Future<List<String>> findBinaryPaths(
String rootDirectory,
{@visibleForTesting ProcessManager processManager = const LocalProcessManager()
}) async {
final List<String> allBinaryPaths = <String>[];
final io.ProcessResult result = await processManager.run(
<String>[
'find',
rootDirectory,
'-type',
'f',
],
);
final List<String> allFiles = (result.stdout as String)
.split('\n')
.where((String s) => s.isNotEmpty)
.toList();
await Future.forEach(allFiles, (String filePath) async {
if (await isBinary(filePath, processManager: processManager)) {
allBinaryPaths.add(filePath);
print('Found: $filePath\n');
}
});
return allBinaryPaths;
}
/// Find every xcframework in the given [rootDirectory].
Future<List<String>> findXcframeworksPaths(
String rootDirectory,
{@visibleForTesting ProcessManager processManager = const LocalProcessManager()
}) async {
final io.ProcessResult result = await processManager.run(
<String>[
'find',
rootDirectory,
'-type',
'd',
'-name',
'*xcframework',
],
);
final List<String> allXcframeworkPaths = LineSplitter.split(result.stdout as String)
.where((String s) => s.isNotEmpty)
.toList();
for (final String path in allXcframeworkPaths) {
print('Found: $path\n');
}
return allXcframeworkPaths;
}
/// Check mime-type of file at [filePath] to determine if it is binary.
Future<bool> isBinary(
String filePath,
{@visibleForTesting ProcessManager processManager = const LocalProcessManager()}
) async {
final io.ProcessResult result = await processManager.run(
<String>[
'file',
'--mime-type',
'-b', // is binary
filePath,
],
);
return (result.stdout as String).contains('application/x-mach-binary');
}
/// Check if the binary has the expected entitlements.
Future<bool> hasExpectedEntitlements(
String binaryPath,
String flutterRoot,
{@visibleForTesting ProcessManager processManager = const LocalProcessManager()}
) async {
final io.ProcessResult entitlementResult = await processManager.run(
<String>[
'codesign',
'--display',
'--entitlements',
':-',
binaryPath,
],
);
if (entitlementResult.exitCode != 0) {
print(
'The `codesign --entitlements` command failed with exit code ${entitlementResult.exitCode}:\n'
'${entitlementResult.stderr}\n',
);
return false;
}
bool passes = true;
final String output = entitlementResult.stdout as String;
for (final String entitlement in expectedEntitlements) {
final bool entitlementExpected =
binariesWithEntitlements(flutterRoot).contains(binaryPath);
if (output.contains(entitlement) != entitlementExpected) {
print(
'File "$binaryPath" ${entitlementExpected ? 'does not have expected' : 'has unexpected'} '
'entitlement $entitlement.',
);
passes = false;
}
}
return passes;
}
/// Runs the skp_generator from the flutter/tests repo.
///
/// See also the customer_tests shard.
///
/// Generated SKPs are ditched, this just verifies that it can run without failure.
Future<void> _runSkpGeneratorTests() async {
printProgress('${green}Running skp_generator from flutter/tests$reset');
final Directory checkout = Directory.systemTemp.createTempSync('flutter_skp_generator.');
await runCommand(
'git',
<String>[
'-c',
'core.longPaths=true',
'clone',
'https://github.com/flutter/tests.git',
'.',
],
workingDirectory: checkout.path,
);
await runCommand(
'./build.sh',
<String>[ ],
workingDirectory: path.join(checkout.path, 'skp_generator'),
);
}
Future<void> _runRealmCheckerTest() async {
final String engineRealm = File(engineRealmFile).readAsStringSync().trim();
if (engineRealm.isNotEmpty) {
foundError(<String>['The checked-in engine.realm file must be empty.']);
}
}
// The `chromedriver` process created by this test.
//
// If an existing chromedriver is already available on port 4444, the existing
// process is reused and this variable remains null.
Command? _chromeDriver;
Future<bool> _isChromeDriverRunning() async {
try {
final RawSocket socket = await RawSocket.connect('localhost', 4444);
socket.shutdown(SocketDirection.both);
await socket.close();
return true;
} on SocketException {
return false;
}
}
Future<void> _ensureChromeDriverIsRunning() async {
// If we cannot connect to ChromeDriver, assume it is not running. Launch it.
if (!await _isChromeDriverRunning()) {
printProgress('Starting chromedriver');
// Assume chromedriver is in the PATH.
_chromeDriver = await startCommand(
// TODO(ianh): this is the only remaining consumer of startCommand other than runCommand
// and it doesn't use most of startCommand's features; we could simplify this a lot by
// inlining the relevant parts of startCommand here.
'chromedriver',
<String>['--port=4444'],
);
while (!await _isChromeDriverRunning()) {
await Future<void>.delayed(const Duration(milliseconds: 100));
print('Waiting for chromedriver to start up.');
}
}
final HttpClient client = HttpClient();
final Uri chromeDriverUrl = Uri.parse('http://localhost:4444/status');
final HttpClientRequest request = await client.getUrl(chromeDriverUrl);
final HttpClientResponse response = await request.close();
final Map<String, dynamic> webDriverStatus = json.decode(await response.transform(utf8.decoder).join()) as Map<String, dynamic>;
client.close();
final bool webDriverReady = (webDriverStatus['value'] as Map<String, dynamic>)['ready'] as bool;
if (!webDriverReady) {
throw Exception('WebDriver not available.');
}
}
Future<void> _stopChromeDriver() async {
if (_chromeDriver == null) {
return;
}
print('Stopping chromedriver');
_chromeDriver!.process.kill();
}
/// Exercises the old gallery in a browser for a long period of time, looking
/// for memory leaks and dangling pointers.
///
/// This is not a performance test.
///
/// If [canvasKit] is set to true, runs the test in CanvasKit mode.
///
/// The test is written using `package:integration_test` (despite the "e2e" in
/// the name, which is there for historic reasons).
Future<void> _runGalleryE2eWebTest(String buildMode, { bool canvasKit = false }) async {
printProgress('${green}Running flutter_gallery integration test in --$buildMode using ${canvasKit ? 'CanvasKit' : 'HTML'} renderer.$reset');
final String testAppDirectory = path.join(flutterRoot, 'dev', 'integration_tests', 'flutter_gallery');
await runCommand(
flutter,
<String>[ 'clean' ],
workingDirectory: testAppDirectory,
);
await runCommand(
flutter,
<String>[
...flutterTestArgs,
'drive',
if (canvasKit)
'--dart-define=FLUTTER_WEB_USE_SKIA=true',
if (!canvasKit)
'--dart-define=FLUTTER_WEB_USE_SKIA=false',
if (!canvasKit)
'--dart-define=FLUTTER_WEB_AUTO_DETECT=false',
'--driver=test_driver/transitions_perf_e2e_test.dart',
'--target=test_driver/transitions_perf_e2e.dart',
'--browser-name=chrome',
'-d',
'web-server',
'--$buildMode',
],
workingDirectory: testAppDirectory,
environment: <String, String>{
'FLUTTER_WEB': 'true',
},
);
}
Future<void> _runWebStackTraceTest(String buildMode, String entrypoint) async {
final String testAppDirectory = path.join(flutterRoot, 'dev', 'integration_tests', 'web');
final String appBuildDirectory = path.join(testAppDirectory, 'build', 'web');
// Build the app.
await runCommand(
flutter,
<String>[ 'clean' ],
workingDirectory: testAppDirectory,
);
await runCommand(
flutter,
<String>[
'build',
'web',
'--$buildMode',
'-t',
entrypoint,
],
workingDirectory: testAppDirectory,
environment: <String, String>{
'FLUTTER_WEB': 'true',
},
);
// Run the app.
final int serverPort = await findAvailablePortAndPossiblyCauseFlakyTests();
final int browserDebugPort = await findAvailablePortAndPossiblyCauseFlakyTests();
final String result = await evalTestAppInChrome(
appUrl: 'http://localhost:$serverPort/index.html',
appDirectory: appBuildDirectory,
serverPort: serverPort,
browserDebugPort: browserDebugPort,
);
if (!result.contains('--- TEST SUCCEEDED ---')) {
foundError(<String>[
result,
'${red}Web stack trace integration test failed.$reset',
]);
}
}
/// Run a web integration test in release mode.
Future<void> _runWebReleaseTest(String target, {
List<String> additionalArguments = const<String>[],
}) async {
final String testAppDirectory = path.join(flutterRoot, 'dev', 'integration_tests', 'web');
final String appBuildDirectory = path.join(testAppDirectory, 'build', 'web');
// Build the app.
await runCommand(
flutter,
<String>[ 'clean' ],
workingDirectory: testAppDirectory,
);
await runCommand(
flutter,
<String>[
...flutterTestArgs,
'build',
'web',
'--release',
...additionalArguments,
'-t',
target,
],
workingDirectory: testAppDirectory,
environment: <String, String>{
'FLUTTER_WEB': 'true',
},
);
// Run the app.
final int serverPort = await findAvailablePortAndPossiblyCauseFlakyTests();
final int browserDebugPort = await findAvailablePortAndPossiblyCauseFlakyTests();
final String result = await evalTestAppInChrome(
appUrl: 'http://localhost:$serverPort/index.html',
appDirectory: appBuildDirectory,
serverPort: serverPort,
browserDebugPort: browserDebugPort,
);
if (!result.contains('--- TEST SUCCEEDED ---')) {
foundError(<String>[
result,
'${red}Web release mode test failed.$reset',
]);
}
}
/// Debug mode is special because `flutter build web` doesn't build in debug mode.
///
/// Instead, we use `flutter run --debug` and sniff out the standard output.
Future<void> _runWebDebugTest(String target, {
List<String> additionalArguments = const<String>[],
}) async {
final String testAppDirectory = path.join(flutterRoot, 'dev', 'integration_tests', 'web');
bool success = false;
final Map<String, String> environment = <String, String>{
'FLUTTER_WEB': 'true',
};
adjustEnvironmentToEnableFlutterAsserts(environment);
final CommandResult result = await runCommand(
flutter,
<String>[
'run',
'--debug',
'-d',
'chrome',
'--web-run-headless',
'--dart-define=FLUTTER_WEB_USE_SKIA=false',
'--dart-define=FLUTTER_WEB_AUTO_DETECT=false',
...additionalArguments,
'-t',
target,
],
outputMode: OutputMode.capture,
outputListener: (String line, Process process) {
if (line.contains('--- TEST SUCCEEDED ---')) {
success = true;
}
if (success || line.contains('--- TEST FAILED ---')) {
process.stdin.add('q'.codeUnits);
}
},
workingDirectory: testAppDirectory,
environment: environment,
);
if (!success) {
foundError(<String>[
result.flattenedStdout!,
result.flattenedStderr!,
'${red}Web stack trace integration test failed.$reset',
]);
}
}
Future<void> _runFlutterWebTest(String webRenderer, String workingDirectory, List<String> tests) async {
await runCommand(
flutter,
<String>[
'test',
'-v',
'--platform=chrome',
'--web-renderer=$webRenderer',
'--dart-define=DART_HHH_BOT=$_runningInDartHHHBot',
...flutterTestArgs,
...tests,
],
workingDirectory: workingDirectory,
environment: <String, String>{
'FLUTTER_WEB': 'true',
},
);
}
// TODO(sigmund): includeLocalEngineEnv should default to true. Currently we
// only enable it on flutter-web test because some test suites do not work
// properly when overriding the local engine (for example, because some platform
// dependent targets are only built on some engines).
// See https://github.com/flutter/flutter/issues/72368
Future<void> _runDartTest(String workingDirectory, {
List<String>? testPaths,
bool enableFlutterToolAsserts = true,
bool useBuildRunner = false,
String? coverage,
bool forceSingleCore = false,
Duration? perTestTimeout,
bool includeLocalEngineEnv = false,
bool ensurePrecompiledTool = true,
bool shuffleTests = true,
bool collectMetrics = false,
}) async {
int? cpus;
final String? cpuVariable = Platform.environment['CPU']; // CPU is set in cirrus.yml
if (cpuVariable != null) {
cpus = int.tryParse(cpuVariable, radix: 10);
if (cpus == null) {
foundError(<String>[
'${red}The CPU environment variable, if set, must be set to the integer number of available cores.$reset',
'Actual value: "$cpuVariable"',
]);
return;
}
} else {
cpus = 2; // Don't default to 1, otherwise we won't catch race conditions.
}
// Integration tests that depend on external processes like chrome
// can get stuck if there are multiple instances running at once.
if (forceSingleCore) {
cpus = 1;
}
const LocalFileSystem fileSystem = LocalFileSystem();
final File metricFile = fileSystem.file(path.join(flutterRoot, 'metrics.json'));
final List<String> args = <String>[
'run',
'test',
'--file-reporter=json:${metricFile.path}',
if (shuffleTests) '--test-randomize-ordering-seed=$shuffleSeed',
'-j$cpus',
if (!hasColor)
'--no-color',
if (coverage != null)
'--coverage=$coverage',
if (perTestTimeout != null)
'--timeout=${perTestTimeout.inMilliseconds}ms',
if (testPaths != null)
for (final String testPath in testPaths)
testPath,
];
final Map<String, String> environment = <String, String>{
'FLUTTER_ROOT': flutterRoot,
if (includeLocalEngineEnv)
...localEngineEnv,
if (Directory(pubCache).existsSync())
'PUB_CACHE': pubCache,
};
if (enableFlutterToolAsserts) {
adjustEnvironmentToEnableFlutterAsserts(environment);
}
if (ensurePrecompiledTool) {
// We rerun the `flutter` tool here just to make sure that it is compiled
// before tests run, because the tests might time out if they have to rebuild
// the tool themselves.
await runCommand(flutter, <String>['--version'], environment: environment);
}
await runCommand(
dart,
args,
workingDirectory: workingDirectory,
environment: environment,
removeLine: useBuildRunner ? (String line) => line.startsWith('[INFO]') : null,
);
final TestFileReporterResults test = TestFileReporterResults.fromFile(metricFile); // --file-reporter name
final File info = fileSystem.file(path.join(flutterRoot, 'error.log'));
info.writeAsStringSync(json.encode(test.errors));
if (collectMetrics) {
try {
final List<String> testList = <String>[];
final Map<int, TestSpecs> allTestSpecs = test.allTestSpecs;
for (final TestSpecs testSpecs in allTestSpecs.values) {
testList.add(testSpecs.toJson());
}
if (testList.isNotEmpty) {
final String testJson = json.encode(testList);
final File testResults = fileSystem.file(
path.join(flutterRoot, 'test_results.json'));
testResults.writeAsStringSync(testJson);
}
} on fs.FileSystemException catch (e) {
print('Failed to generate metrics: $e');
}
}
}
Future<void> _runFlutterTest(String workingDirectory, {
String? script,
bool expectFailure = false,
bool printOutput = true,
OutputChecker? outputChecker,
List<String> options = const <String>[],
Map<String, String>? environment,
List<String> tests = const <String>[],
bool shuffleTests = true,
bool fatalWarnings = true,
}) async {
assert(!printOutput || outputChecker == null, 'Output either can be printed or checked but not both');
final List<String> tags = <String>[];
// Recipe-configured reduced test shards will only execute tests with the
// appropriate tag.
if (Platform.environment['REDUCED_TEST_SET'] == 'True') {
tags.addAll(<String>['-t', 'reduced-test-set']);
}
final List<String> args = <String>[
'test',
if (shuffleTests) '--test-randomize-ordering-seed=$shuffleSeed',
if (fatalWarnings) '--fatal-warnings',
...options,
...tags,
...flutterTestArgs,
];
if (script != null) {
final String fullScriptPath = path.join(workingDirectory, script);
if (!FileSystemEntity.isFileSync(fullScriptPath)) {
foundError(<String>[
'${red}Could not find test$reset: $green$fullScriptPath$reset',
'Working directory: $cyan$workingDirectory$reset',
'Script: $green$script$reset',
if (!printOutput)
'This is one of the tests that does not normally print output.',
]);
return;
}
args.add(script);
}
args.addAll(tests);
final OutputMode outputMode = outputChecker == null && printOutput
? OutputMode.print
: OutputMode.capture;
final CommandResult result = await runCommand(
flutter,
args,
workingDirectory: workingDirectory,
expectNonZeroExit: expectFailure,
outputMode: outputMode,
environment: environment,
);
if (outputChecker != null) {
final String? message = outputChecker(result);
if (message != null) {
foundError(<String>[message]);
}
}
}
/// This will force the next run of the Flutter tool (if it uses the provided
/// environment) to have asserts enabled, by setting an environment variable.
void adjustEnvironmentToEnableFlutterAsserts(Map<String, String> environment) {
// If an existing env variable exists append to it, but only if
// it doesn't appear to already include enable-asserts.
String toolsArgs = Platform.environment['FLUTTER_TOOL_ARGS'] ?? '';
if (!toolsArgs.contains('--enable-asserts')) {
toolsArgs += ' --enable-asserts';
}
environment['FLUTTER_TOOL_ARGS'] = toolsArgs.trim();
}
/// Checks the given file's contents to determine if they match the allowed
/// pattern for version strings.
///
/// Returns null if the contents are good. Returns a string if they are bad.
/// The string is an error message.
Future<String?> verifyVersion(File file) async {
final RegExp pattern = RegExp(
r'^(\d+)\.(\d+)\.(\d+)((-\d+\.\d+)?\.pre(\.\d+)?)?$');
if (!file.existsSync()) {
return 'The version logic failed to create the Flutter version file.';
}
final String version = await file.readAsString();
if (version == '0.0.0-unknown') {
return 'The version logic failed to determine the Flutter version.';
}
if (!version.contains(pattern)) {
return 'The version logic generated an invalid version string: "$version".';
}
return null;
}
/// Parse (one-)index/total-named subshards from environment variable SUBSHARD
/// and equally distribute [tests] between them.
/// Subshard format is "{index}_{total number of shards}".
/// The scheduler can change the number of total shards without needing an additional
/// commit in this repository.
///
/// Examples:
/// 1_3
/// 2_3
/// 3_3
List<T> _selectIndexOfTotalSubshard<T>(List<T> tests, {String subshardKey = kSubshardKey}) {
// Example: "1_3" means the first (one-indexed) shard of three total shards.
final String? subshardName = Platform.environment[subshardKey];
if (subshardName == null) {
print('$kSubshardKey environment variable is missing, skipping sharding');
return tests;
}
printProgress('$bold$subshardKey=$subshardName$reset');
final RegExp pattern = RegExp(r'^(\d+)_(\d+)$');
final Match? match = pattern.firstMatch(subshardName);
if (match == null || match.groupCount != 2) {
foundError(<String>[
'${red}Invalid subshard name "$subshardName". Expected format "[int]_[int]" ex. "1_3"',
]);
throw Exception('Invalid subshard name: $subshardName');
}
// One-indexed.
final int index = int.parse(match.group(1)!);
final int total = int.parse(match.group(2)!);
if (index > total) {
foundError(<String>[
'${red}Invalid subshard name "$subshardName". Index number must be greater or equal to total.',
]);
return <T>[];
}
final int testsPerShard = (tests.length / total).ceil();
final int start = (index - 1) * testsPerShard;
final int end = math.min(index * testsPerShard, tests.length);
print('Selecting subshard $index of $total (tests ${start + 1}-$end of ${tests.length})');
return tests.sublist(start, end);
}
Future<void> _runShardRunnerIndexOfTotalSubshard(List<ShardRunner> tests) async {
final List<ShardRunner> sublist = _selectIndexOfTotalSubshard<ShardRunner>(tests);
for (final ShardRunner test in sublist) {
await test();
}
}
Future<void> selectShard(Map<String, ShardRunner> shards) => _runFromList(shards, kShardKey, 'shard', 0);
Future<void> selectSubshard(Map<String, ShardRunner> subshards) => _runFromList(subshards, kSubshardKey, 'subshard', 1);
const String CIRRUS_TASK_NAME = 'CIRRUS_TASK_NAME';
Future<void> _runFromList(Map<String, ShardRunner> items, String key, String name, int positionInTaskName) async {
String? item = Platform.environment[key];
if (item == null && Platform.environment.containsKey(CIRRUS_TASK_NAME)) {
final List<String> parts = Platform.environment[CIRRUS_TASK_NAME]!.split('-');
assert(positionInTaskName < parts.length);
item = parts[positionInTaskName];
}
if (item == null) {
for (final String currentItem in items.keys) {
printProgress('$bold$key=$currentItem$reset');
await items[currentItem]!();
}
} else {
printProgress('$bold$key=$item$reset');
if (!items.containsKey(item)) {
foundError(<String>[
'${red}Invalid $name: $item$reset',
'The available ${name}s are: ${items.keys.join(", ")}',
]);
return;
}
await items[item]!();
}
}
| flutter/dev/bots/test.dart/0 | {
"file_path": "flutter/dev/bots/test.dart",
"repo_id": "flutter",
"token_count": 35954
} | 492 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The reduced test set tag is missing. This should fail analysis.
@Tags(<String>['some-other-tag'])
library;
import 'package:test/test.dart';
import 'golden_class.dart';
void main() {
matchesGoldenFile('missing_tag.png');
}
| flutter/dev/bots/test/analyze-test-input/root/packages/foo/golden_missing_tag.dart/0 | {
"file_path": "flutter/dev/bots/test/analyze-test-input/root/packages/foo/golden_missing_tag.dart",
"repo_id": "flutter",
"token_count": 120
} | 493 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:io';
import 'package:file/memory.dart';
import '../tool_subsharding.dart';
import 'common.dart';
void main() {
group('generateMetrics', () {
late MemoryFileSystem fileSystem;
setUp(() {
fileSystem = MemoryFileSystem.test();
});
test('empty metrics', () async {
final File file = fileSystem.file('success_file');
const String output = '''
{"missing": "entry"}
{"other": true}''';
file.writeAsStringSync(output);
final TestFileReporterResults result = TestFileReporterResults.fromFile(file);
expect(result.allTestSpecs, isEmpty);
});
test('have metrics', () async {
final File file = fileSystem.file('success_file');
const String output = '''
{"protocolVersion":"0.1.1","runnerVersion":"1.21.6","pid":93376,"type":"start","time":0}
{"suite":{"id":0,"platform":"vm","path":"test/general.shard/project_validator_result_test.dart"},"type":"suite","time":0}
{"count":1,"time":12,"type":"allSuites"}
{"testID":1,"result":"success","skipped":false,"hidden":true,"type":"testDone","time":4798}
{"test":{"id":4,"name":"ProjectValidatorResult success status","suiteID":0,"groupIDs":[2,3],"metadata":{"skip":false,"skipReason":null},"line":159,"column":16,"url":"file:///file","root_line":50,"root_column":5,"root_url":"file:///file"},"type":"testStart","time":4803}
{"testID":4,"result":"success","skipped":false,"hidden":false,"type":"testDone","time":4837}
{"suite":{"id":1,"platform":"vm","path":"other_path"},"type":"suite","time":1000}
{"test":{"id":5,"name":"ProjectValidatorResult success status with warning","suiteID":0,"groupIDs":[2,3],"metadata":{"skip":false,"skipReason":null},"line":159,"column":16,"url":"file:///file","root_line":60,"root_column":5,"root_url":"file:///file"},"type":"testStart","time":4837}
{"testID":5,"result":"success","skipped":false,"hidden":false,"type":"testDone","time":4839}
{"test":{"id":6,"name":"ProjectValidatorResult error status","suiteID":0,"groupIDs":[2,3],"metadata":{"skip":false,"skipReason":null},"line":159,"column":16,"url":"file:///file","root_line":71,"root_column":5,"root_url":"file:///file"},"type":"testStart","time":4839}
{"testID":6,"result":"success","skipped":false,"hidden":false,"type":"testDone","time":4841}
{"group":{"id":7,"suiteID":0,"parentID":2,"name":"ProjectValidatorTask","metadata":{"skip":false,"skipReason":null},"testCount":1,"line":82,"column":3,"url":"file:///file"},"type":"group","time":4841}
{"test":{"id":8,"name":"ProjectValidatorTask error status","suiteID":0,"groupIDs":[2,7],"metadata":{"skip":false,"skipReason":null},"line":159,"column":16,"url":"file:///file","root_line":89,"root_column":5,"root_url":"file:///file"},"type":"testStart","time":4842}
{"testID":8,"result":"success","skipped":false,"hidden":false,"type":"testDone","time":4860}
{"group":{"id":7,"suiteID":1,"parentID":2,"name":"ProjectValidatorTask","metadata":{"skip":false,"skipReason":null},"testCount":1,"line":82,"column":3,"url":"file:///file"},"type":"group","time":5000}
{"success":true,"type":"done","time":4870}''';
file.writeAsStringSync(output);
final Map<int, TestSpecs> result = TestFileReporterResults.fromFile(file).allTestSpecs;
expect(result, contains(0));
expect(result, contains(1));
expect(result[0]!.path, 'test/general.shard/project_validator_result_test.dart');
expect(result[0]!.milliseconds, 4841);
expect(result[1]!.path, 'other_path');
expect(result[1]!.milliseconds, 4000);
});
test('missing success entry', () async {
final File file = fileSystem.file('success_file');
const String output = '''
{"suite":{"id":1,"platform":"vm","path":"other_path"},"type":"suite","time":1000}
{"group":{"id":7,"suiteID":1,"parentID":2,"name":"name","metadata":{"skip":false,"skipReason":null},"testCount":1,"line":82,"column":3,"url":"file:///file"},"type":"group","time":5000}''';
file.writeAsStringSync(output);
final TestFileReporterResults result = TestFileReporterResults.fromFile(file);
expect(result.hasFailedTests, true);
});
test('has failed stack traces', () async {
final File file = fileSystem.file('success_file');
const String output = '''
{"protocolVersion":"0.1.1","runnerVersion":"1.22.1","pid":47372,"type":"start","time":0}
{"suite":{"id":0,"platform":"vm","path":"test/tool_subsharding_test.dart"},"type":"suite","time":0}
{"test":{"id":1,"name":"loading test/tool_subsharding_test.dart","suiteID":0,"groupIDs":[],"metadata":{"skip":false,"skipReason":null},"line":null,"column":null,"url":null},"type":"testStart","time":2}
{"count":1,"time":11,"type":"allSuites"}
{"testID":1,"result":"success","skipped":false,"hidden":true,"type":"testDone","time":1021}
{"group":{"id":2,"suiteID":0,"parentID":null,"name":"","metadata":{"skip":false,"skipReason":null},"testCount":3,"line":null,"column":null,"url":null},"type":"group","time":1026}
{"group":{"id":3,"suiteID":0,"parentID":2,"name":"generateMetrics","metadata":{"skip":false,"skipReason":null},"testCount":3,"line":13,"column":3,"url":"file:///Users/user/Documents/flutter/dev/bots/test/tool_subsharding_test.dart"},"type":"group","time":1027}
{"test":{"id":4,"name":"generateMetrics empty metrics","suiteID":0,"groupIDs":[2,3],"metadata":{"skip":false,"skipReason":null},"line":20,"column":5,"url":"file:///Users/user/Documents/flutter/dev/bots/test/tool_subsharding_test.dart"},"type":"testStart","time":1027}
{"testID":4,"error":"Expected: <true> Actual: <false>","stackTrace":"package:test_api expect test/tool_subsharding_test.dart 28:7 main.<fn>.<fn> ","isFailure":true,"type":"error","time":1095}
{"testID":4,"result":"failure","skipped":false,"hidden":false,"type":"testDone","time":1096}
{"test":{"id":5,"name":"generateMetrics have metrics","suiteID":0,"groupIDs":[2,3],"metadata":{"skip":false,"skipReason":null},"line":31,"column":5,"url":"file:///Users/user/Documents/flutter/dev/bots/test/tool_subsharding_test.dart"},"type":"testStart","time":1097}
{"testID":5,"result":"success","skipped":false,"hidden":false,"type":"testDone","time":1103}
{"test":{"id":6,"name":"generateMetrics missing success entry","suiteID":0,"groupIDs":[2,3],"metadata":{"skip":false,"skipReason":null},"line":60,"column":5,"url":"file:///Users/user/Documents/flutter/dev/bots/test/tool_subsharding_test.dart"},"type":"testStart","time":1103}
{"testID":6,"error":"Expected: <false> Actual: <true>","stackTrace":"package:test_api expect test/tool_subsharding_test.dart 68:7 main.<fn>.<fn> ","isFailure":true,"type":"error","time":1107}
{"testID":6,"result":"failure","skipped":false,"hidden":false,"type":"testDone","time":1107}
{"testID":6,"error":"my error","isFailure":true,"type":"error","time":1107}
{"success":false,"type":"done","time":1120}''';
file.writeAsStringSync(output);
final TestFileReporterResults result = TestFileReporterResults.fromFile(file);
expect(result.hasFailedTests, true);
expect(result.errors.length == 3, true);
expect(result.errors[0].contains('Expected: <true> Actual: <false>'), true);
expect(result.errors[1].contains('Expected: <false> Actual: <true>'), true);
expect(result.errors[2].contains('my error'), true);
});
});
}
| flutter/dev/bots/test/tool_subsharding_test.dart/0 | {
"file_path": "flutter/dev/bots/test/tool_subsharding_test.dart",
"repo_id": "flutter",
"token_count": 2771
} | 494 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:file/file.dart' show File;
import 'globals.dart';
import 'proto/conductor_state.pb.dart' as pb;
import 'repository.dart';
import 'state.dart';
import 'stdio.dart' show Stdio;
/// Interface for shared functionality across all sub-commands.
///
/// Different frontends (e.g. CLI vs desktop) can share [Context]s, although
/// methods for capturing user interaction may be overridden.
abstract class Context {
const Context({
required this.checkouts,
required this.stateFile,
});
final Checkouts checkouts;
final File stateFile;
Stdio get stdio => checkouts.stdio;
/// Confirm an action with the user before proceeding.
///
/// The default implementation reads from STDIN. This can be overridden in UI
/// implementations that capture user interaction differently.
Future<bool> prompt(String message) async {
stdio.write('${message.trim()} (y/n) ');
final String response = stdio.readLineSync().trim();
final String firstChar = response[0].toUpperCase();
if (firstChar == 'Y') {
return true;
}
if (firstChar == 'N') {
return false;
}
throw ConductorException(
'Unknown user input (expected "y" or "n"): $response',
);
}
/// Save the release's [state].
///
/// This can be overridden by frontends that may not persist the state to
/// disk, and/or may need to call additional update hooks each time the state
/// is updated.
void updateState(pb.ConductorState state, [List<String> logs = const <String>[]]) {
writeStateToFile(stateFile, state, logs);
}
}
| flutter/dev/conductor/core/lib/src/context.dart/0 | {
"file_path": "flutter/dev/conductor/core/lib/src/context.dart",
"repo_id": "flutter",
"token_count": 548
} | 495 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:args/command_runner.dart';
import 'package:file/file.dart';
import 'package:platform/platform.dart';
import './proto/conductor_state.pb.dart' as pb;
import './repository.dart';
import './state.dart';
import './stdio.dart';
const String kVerboseFlag = 'verbose';
const String kStateOption = 'state-file';
/// Command to print the status of the current Flutter release.
class StatusCommand extends Command<void> {
StatusCommand({
required this.checkouts,
}) : platform = checkouts.platform,
fileSystem = checkouts.fileSystem,
stdio = checkouts.stdio {
final String defaultPath = defaultStateFilePath(platform);
argParser.addOption(
kStateOption,
defaultsTo: defaultPath,
help: 'Path to persistent state file. Defaults to $defaultPath',
);
argParser.addFlag(
kVerboseFlag,
abbr: 'v',
help: 'Also print logs.',
);
}
final Checkouts checkouts;
final FileSystem fileSystem;
final Platform platform;
final Stdio stdio;
@override
String get name => 'status';
@override
String get description => 'Print status of current release.';
@override
void run() {
final File stateFile = checkouts.fileSystem.file(argResults![kStateOption]);
if (!stateFile.existsSync()) {
stdio.printStatus(
'No persistent state file found at ${argResults![kStateOption]}.');
return;
}
final pb.ConductorState state = readStateFromFile(stateFile);
stdio.printStatus(presentState(state));
if (argResults![kVerboseFlag] as bool) {
stdio.printStatus('\nLogs:');
state.logs.forEach(stdio.printStatus);
}
}
}
| flutter/dev/conductor/core/lib/src/status.dart/0 | {
"file_path": "flutter/dev/conductor/core/lib/src/status.dart",
"repo_id": "flutter",
"token_count": 646
} | 496 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:io';
import 'package:collection/collection.dart';
import 'package:meta/meta.dart';
@immutable
class CustomerTest {
factory CustomerTest(File testFile) {
final String errorPrefix = 'Could not parse: ${testFile.path}\n';
final List<String> contacts = <String>[];
final List<String> fetch = <String>[];
final List<String> setup = <String>[];
final List<Directory> update = <Directory>[];
final List<String> test = <String>[];
int? iterations;
bool hasTests = false;
for (final String line in testFile.readAsLinesSync().map((String line) => line.trim())) {
if (line.isEmpty || line.startsWith('#')) {
// Blank line or comment.
continue;
}
final bool isUnknownDirective = _TestDirective.values.firstWhereOrNull((_TestDirective d) => line.startsWith(d.name)) == null;
if (isUnknownDirective) {
throw FormatException('${errorPrefix}Unexpected directive:\n$line');
}
_maybeAddTestConfig(line, directive: _TestDirective.contact, directiveValues: contacts);
_maybeAddTestConfig(line, directive: _TestDirective.fetch, directiveValues: fetch);
_maybeAddTestConfig(line, directive: _TestDirective.setup, directiveValues: setup, platformAgnostic: false);
final String updatePrefix = _directive(_TestDirective.update);
if (line.startsWith(updatePrefix)) {
update.add(Directory(line.substring(updatePrefix.length)));
}
final String iterationsPrefix = _directive(_TestDirective.iterations);
if (line.startsWith(iterationsPrefix)) {
if (iterations != null) {
throw FormatException('Cannot specify "${_TestDirective.iterations.name}" directive multiple times.');
}
iterations = int.parse(line.substring(iterationsPrefix.length));
if (iterations < 1) {
throw FormatException('The "${_TestDirective.iterations.name}" directive must have a positive integer value.');
}
}
if (line.startsWith(_directive(_TestDirective.test)) || line.startsWith('${_TestDirective.test.name}.')) {
hasTests = true;
}
_maybeAddTestConfig(line, directive: _TestDirective.test, directiveValues: test, platformAgnostic: false);
}
if (contacts.isEmpty) {
throw FormatException('${errorPrefix}No "${_TestDirective.contact.name}" directives specified. At least one contact e-mail address must be specified.');
}
for (final String email in contacts) {
if (!email.contains(_email) || email.endsWith('@example.com')) {
throw FormatException('${errorPrefix}The following e-mail address appears to be an invalid e-mail address: $email');
}
}
if (fetch.isEmpty) {
throw FormatException('${errorPrefix}No "${_TestDirective.fetch.name}" directives specified. Two lines are expected: "git clone https://github.com/USERNAME/REPOSITORY.git tests" and "git -C tests checkout HASH".');
}
if (fetch.length < 2) {
throw FormatException('${errorPrefix}Only one "${_TestDirective.fetch.name}" directive specified. Two lines are expected: "git clone https://github.com/USERNAME/REPOSITORY.git tests" and "git -C tests checkout HASH".');
}
if (!fetch[0].contains(_fetch1)) {
throw FormatException('${errorPrefix}First "${_TestDirective.fetch.name}" directive does not match expected pattern (expected "git clone https://github.com/USERNAME/REPOSITORY.git tests").');
}
if (!fetch[1].contains(_fetch2)) {
throw FormatException('${errorPrefix}Second "${_TestDirective.fetch.name}" directive does not match expected pattern (expected "git -C tests checkout HASH").');
}
if (update.isEmpty) {
throw FormatException('${errorPrefix}No "${_TestDirective.update.name}" directives specified. At least one directory must be specified. (It can be "." to just upgrade the root of the repository.)');
}
if (!hasTests) {
throw FormatException('${errorPrefix}No "${_TestDirective.test.name}" directives specified. At least one command must be specified to run tests.');
}
return CustomerTest._(
List<String>.unmodifiable(contacts),
List<String>.unmodifiable(fetch),
List<String>.unmodifiable(setup),
List<Directory>.unmodifiable(update),
List<String>.unmodifiable(test),
iterations,
);
}
const CustomerTest._(
this.contacts,
this.fetch,
this.setup,
this.update,
this.tests,
this.iterations,
);
// (e-mail regexp from HTML standard)
static final RegExp _email = RegExp(r"^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$");
static final RegExp _fetch1 = RegExp(r'^git(?: -c core.longPaths=true)? clone https://github.com/[-a-zA-Z0-9]+/[-_a-zA-Z0-9]+.git tests$');
static final RegExp _fetch2 = RegExp(r'^git(?: -c core.longPaths=true)? -C tests checkout [0-9a-f]+$');
final List<String> contacts;
final List<String> fetch;
final List<String> setup;
final List<Directory> update;
final List<String> tests;
final int? iterations;
static void _maybeAddTestConfig(
String line, {
required _TestDirective directive,
required List<String> directiveValues,
bool platformAgnostic = true,
}) {
final List<_PlatformType> platforms = platformAgnostic
? <_PlatformType>[_PlatformType.all]
: _PlatformType.values;
for (final _PlatformType platform in platforms) {
final String directiveName = _directive(directive, platform: platform);
if (line.startsWith(directiveName) && platform.conditionMet) {
directiveValues.add(line.substring(directiveName.length));
}
}
}
static String _directive(
_TestDirective directive, {
_PlatformType platform = _PlatformType.all,
}) {
return switch (platform) {
_PlatformType.all => '${directive.name}=',
_ => '${directive.name}.${platform.name}=',
};
}
}
enum _PlatformType {
all,
windows,
macos,
linux,
posix;
bool get conditionMet => switch (this) {
_PlatformType.all => true,
_PlatformType.windows => Platform.isWindows,
_PlatformType.macos => Platform.isMacOS,
_PlatformType.linux => Platform.isLinux,
_PlatformType.posix => Platform.isLinux || Platform.isMacOS,
};
}
enum _TestDirective {
contact,
fetch,
setup,
update,
test,
iterations,
}
| flutter/dev/customer_testing/lib/customer_test.dart/0 | {
"file_path": "flutter/dev/customer_testing/lib/customer_test.dart",
"repo_id": "flutter",
"token_count": 2433
} | 497 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_devicelab/framework/devices.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/task_result.dart';
import 'package:flutter_devicelab/framework/utils.dart';
Future<String> _runWithMode(String mode, String deviceId) async {
final StringBuffer stderr = StringBuffer();
await evalFlutter('drive', stderr: stderr, options: <String>[
mode,
'-t',
'test_driver/scroll_perf.dart',
'-d',
deviceId,
]);
return stderr.toString();
}
Future<TaskResult> run() async {
cd('${flutterDirectory.path}/dev/integration_tests/flutter_gallery');
final Device device = await devices.workingDevice;
await device.unlock();
final String deviceId = device.deviceId;
await flutter('packages', options: <String>['get']);
const String warningPiece = 'THIS BENCHMARK IS BEING RUN IN DEBUG MODE';
final String debugOutput = await _runWithMode('--debug', deviceId);
if (!debugOutput.contains(warningPiece)) {
return TaskResult.failure(
'Could not find the following warning message piece: $warningPiece'
);
}
final String profileOutput = await _runWithMode('--profile', deviceId);
if (profileOutput.contains(warningPiece)) {
return TaskResult.failure(
'Unexpected warning message piece in profile mode: $warningPiece'
);
}
return TaskResult.success(null);
}
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.android;
await task(run);
}
| flutter/dev/devicelab/bin/tasks/drive_perf_debug_warning.dart/0 | {
"file_path": "flutter/dev/devicelab/bin/tasks/drive_perf_debug_warning.dart",
"repo_id": "flutter",
"token_count": 542
} | 498 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_devicelab/framework/devices.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/ios.dart';
import 'package:flutter_devicelab/framework/task_result.dart';
import 'package:flutter_devicelab/tasks/hot_mode_tests.dart';
Future<void> main() async {
await task(() async {
deviceOperatingSystem = DeviceOperatingSystem.ios;
String? simulatorDeviceId;
try {
await testWithNewIOSSimulator('TestHotReloadSim', (String deviceId) async {
simulatorDeviceId = deviceId;
// This isn't actually a benchmark test, so do not use the returned `benchmarkScoreKeys` result.
await createHotModeTest(deviceIdOverride: deviceId, checkAppRunningOnLocalDevice: true)();
});
} finally {
await removeIOSSimulator(simulatorDeviceId);
}
return TaskResult.success(null);
});
}
| flutter/dev/devicelab/bin/tasks/hot_mode_dev_cycle_ios_simulator.dart/0 | {
"file_path": "flutter/dev/devicelab/bin/tasks/hot_mode_dev_cycle_ios_simulator.dart",
"repo_id": "flutter",
"token_count": 358
} | 499 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert';
import 'dart:io';
/// A result of running a single task.
class TaskResult {
TaskResult.buildOnly()
: succeeded = true,
data = null,
detailFiles = null,
benchmarkScoreKeys = null,
message = 'No tests run';
/// Constructs a successful result.
TaskResult.success(this.data, {
this.benchmarkScoreKeys = const <String>[],
this.detailFiles = const <String>[],
this.message = 'success',
})
: succeeded = true {
const JsonEncoder prettyJson = JsonEncoder.withIndent(' ');
if (benchmarkScoreKeys != null) {
for (final String key in benchmarkScoreKeys!) {
if (!data!.containsKey(key)) {
throw 'Invalid benchmark score key "$key". It does not exist in task '
'result data ${prettyJson.convert(data)}';
} else if (data![key] is! num) {
throw 'Invalid benchmark score for key "$key". It is expected to be a num '
'but was ${(data![key] as Object).runtimeType}: ${prettyJson.convert(data![key])}';
}
}
}
}
/// Constructs a successful result using JSON data stored in a file.
factory TaskResult.successFromFile(File file, {
List<String> benchmarkScoreKeys = const <String>[],
List<String> detailFiles = const <String>[],
}) {
return TaskResult.success(
json.decode(file.readAsStringSync()) as Map<String, dynamic>?,
benchmarkScoreKeys: benchmarkScoreKeys,
detailFiles: detailFiles,
);
}
/// Constructs a [TaskResult] from JSON.
factory TaskResult.fromJson(Map<String, dynamic> json) {
final bool success = json['success'] as bool;
if (success) {
final List<String> benchmarkScoreKeys = (json['benchmarkScoreKeys'] as List<dynamic>? ?? <String>[]).cast<String>();
final List<String> detailFiles = (json['detailFiles'] as List<dynamic>? ?? <String>[]).cast<String>();
return TaskResult.success(json['data'] as Map<String, dynamic>?,
benchmarkScoreKeys: benchmarkScoreKeys,
detailFiles: detailFiles,
message: json['reason'] as String?,
);
}
return TaskResult.failure(json['reason'] as String?);
}
/// Constructs an unsuccessful result.
TaskResult.failure(this.message)
: succeeded = false,
data = null,
detailFiles = null,
benchmarkScoreKeys = null;
/// Whether the task succeeded.
final bool succeeded;
/// Task-specific JSON data
final Map<String, dynamic>? data;
/// Files containing detail on the run (e.g. timeline trace files)
final List<String>? detailFiles;
/// Keys in [data] that store scores that will be submitted to Cocoon.
///
/// Each key is also part of a benchmark's name tracked by Cocoon.
final List<String>? benchmarkScoreKeys;
/// Whether the task failed.
bool get failed => !succeeded;
/// Explains the result in a human-readable format.
final String? message;
/// Serializes this task result to JSON format.
///
/// The JSON format is as follows:
///
/// {
/// "success": true|false,
/// "data": arbitrary JSON data valid only for successful results,
/// "detailFiles": list of filenames containing detail on the run
/// "benchmarkScoreKeys": [
/// contains keys into "data" that represent benchmarks scores, which
/// can be uploaded, for example. to golem, valid only for successful
/// results
/// ],
/// "reason": failure reason string valid only for unsuccessful results
/// }
Map<String, dynamic> toJson() {
final Map<String, dynamic> json = <String, dynamic>{
'success': succeeded,
};
if (succeeded) {
json['data'] = data;
json['detailFiles'] = detailFiles;
json['benchmarkScoreKeys'] = benchmarkScoreKeys;
}
if (message != null || !succeeded) {
json['reason'] = message;
}
return json;
}
@override
String toString() => message ?? '';
}
class TaskResultCheckProcesses extends TaskResult {
TaskResultCheckProcesses() : super.success(null);
}
| flutter/dev/devicelab/lib/framework/task_result.dart/0 | {
"file_path": "flutter/dev/devicelab/lib/framework/task_result.dart",
"repo_id": "flutter",
"token_count": 1490
} | 500 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:path/path.dart' as path;
import '../framework/devices.dart';
import '../framework/framework.dart';
import '../framework/task_result.dart';
import '../framework/utils.dart';
const String _packageName = 'package_with_native_assets';
const List<String> _buildModes = <String>[
'debug',
'profile',
'release',
];
TaskFunction createNativeAssetsTest({
String? deviceIdOverride,
bool checkAppRunningOnLocalDevice = true,
bool isIosSimulator = false,
}) {
return () async {
if (deviceIdOverride == null) {
final Device device = await devices.workingDevice;
await device.unlock();
deviceIdOverride = device.deviceId;
}
await enableNativeAssets();
for (final String buildMode in _buildModes) {
if (buildMode != 'debug' && isIosSimulator) {
continue;
}
final TaskResult buildModeResult = await inTempDir((Directory tempDirectory) async {
final Directory packageDirectory = await createTestProject(_packageName, tempDirectory);
final Directory exampleDirectory = dir(packageDirectory.uri.resolve('example/').toFilePath());
final List<String> options = <String>[
'-d',
deviceIdOverride!,
'--no-android-gradle-daemon',
'--no-publish-port',
'--verbose',
'--uninstall-first',
'--$buildMode',
];
int transitionCount = 0;
bool done = false;
await inDirectory<void>(exampleDirectory, () async {
final int runFlutterResult = await runFlutter(
options: options,
onLine: (String line, Process process) {
if (done) {
return;
}
switch (transitionCount) {
case 0:
if (!line.contains('Flutter run key commands.')) {
return;
}
if (buildMode == 'debug') {
// Do a hot reload diff on the initial dill file.
process.stdin.writeln('r');
} else {
done = true;
process.stdin.writeln('q');
}
case 1:
if (!line.contains('Reloaded')) {
return;
}
process.stdin.writeln('R');
case 2:
// Do a hot restart, pushing a new complete dill file.
if (!line.contains('Restarted application')) {
return;
}
// Do another hot reload, pushing a diff to the second dill file.
process.stdin.writeln('r');
case 3:
if (!line.contains('Reloaded')) {
return;
}
done = true;
process.stdin.writeln('q');
}
transitionCount += 1;
},
);
if (runFlutterResult != 0) {
print('Flutter run returned non-zero exit code: $runFlutterResult.');
}
});
final int expectedNumberOfTransitions = buildMode == 'debug' ? 4 : 1;
if (transitionCount != expectedNumberOfTransitions) {
return TaskResult.failure(
'Did not get expected number of transitions: $transitionCount '
'(expected $expectedNumberOfTransitions)',
);
}
return TaskResult.success(null);
});
if (buildModeResult.failed) {
return buildModeResult;
}
}
return TaskResult.success(null);
};
}
Future<int> runFlutter({
required List<String> options,
required void Function(String, Process) onLine,
}) async {
final Process process = await startFlutter(
'run',
options: options,
);
final Completer<void> stdoutDone = Completer<void>();
final Completer<void> stderrDone = Completer<void>();
process.stdout.transform<String>(utf8.decoder).transform<String>(const LineSplitter()).listen((String line) {
onLine(line, process);
print('stdout: $line');
}, onDone: stdoutDone.complete);
process.stderr.transform<String>(utf8.decoder).transform<String>(const LineSplitter()).listen(
(String line) => print('stderr: $line'),
onDone: stderrDone.complete,
);
await Future.wait<void>(<Future<void>>[stdoutDone.future, stderrDone.future]);
final int exitCode = await process.exitCode;
return exitCode;
}
final String _flutterBin = path.join(flutterDirectory.path, 'bin', 'flutter');
Future<void> enableNativeAssets() async {
print('Enabling configs for native assets...');
final int configResult = await exec(
_flutterBin,
<String>[
'config',
'-v',
'--enable-native-assets',
],
canFail: true);
if (configResult != 0) {
print('Failed to enable configuration, tasks may not run.');
}
}
Future<Directory> createTestProject(
String packageName,
Directory tempDirectory,
) async {
await exec(
_flutterBin,
<String>[
'create',
'--no-pub',
'--template=package_ffi',
packageName,
],
workingDirectory: tempDirectory.path,
);
final Directory packageDirectory = Directory(
path.join(tempDirectory.path, packageName),
);
await _pinDependencies(
File(path.join(packageDirectory.path, 'pubspec.yaml')),
);
await _pinDependencies(
File(path.join(packageDirectory.path, 'example', 'pubspec.yaml')),
);
await exec(
_flutterBin,
<String>[
'pub',
'get',
],
workingDirectory: packageDirectory.path,
);
return packageDirectory;
}
Future<void> _pinDependencies(File pubspecFile) async {
final String oldPubspec = await pubspecFile.readAsString();
final String newPubspec = oldPubspec.replaceAll(': ^', ': ');
await pubspecFile.writeAsString(newPubspec);
}
Future<T> inTempDir<T>(Future<T> Function(Directory tempDirectory) fun) async {
final Directory tempDirectory = dir(Directory.systemTemp.createTempSync().resolveSymbolicLinksSync());
try {
return await fun(tempDirectory);
} finally {
tempDirectory.deleteSync(recursive: true);
}
}
| flutter/dev/devicelab/lib/tasks/native_assets_test.dart/0 | {
"file_path": "flutter/dev/devicelab/lib/tasks/native_assets_test.dart",
"repo_id": "flutter",
"token_count": 2745
} | 501 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_devicelab/framework/metrics_center.dart';
import 'package:metrics_center/metrics_center.dart';
import 'common.dart';
class FakeFlutterDestination implements FlutterDestination {
/// Overrides the skia perf `update` function, which uploads new data to gcs if there
/// doesn't exist the commit, otherwise updates existing data by appending new ones.
@override
Future<void> update(List<MetricPoint> points, DateTime commitTime, String taskName) async {
lastUpdatedPoints = points;
time = commitTime;
name = taskName;
}
List<MetricPoint>? lastUpdatedPoints;
DateTime? time;
String? name;
}
void main() {
group('Parse', () {
test('duplicate entries for both builder name and test name', () {
final Map<String, dynamic> results = <String, dynamic>{
'CommitBranch': 'master',
'CommitSha': 'abc',
'BuilderName': 'Linux test',
'ResultData': <String, dynamic>{
'average_frame_build_time_millis': 0.4550425531914895,
},
'BenchmarkScoreKeys': <String>[
'average_frame_build_time_millis',
],
};
final List<MetricPoint> metricPoints = parse(results, <String, String>{}, 'test');
expect(metricPoints.length, 1);
expect(metricPoints[0].value, equals(0.4550425531914895));
expect(metricPoints[0].tags[kNameKey], 'test');
});
test('without additional benchmark tags', () {
final Map<String, dynamic> results = <String, dynamic>{
'CommitBranch': 'master',
'CommitSha': 'abc',
'BuilderName': 'test',
'ResultData': <String, dynamic>{
'average_frame_build_time_millis': 0.4550425531914895,
'90th_percentile_frame_build_time_millis': 0.473,
},
'BenchmarkScoreKeys': <String>[
'average_frame_build_time_millis',
'90th_percentile_frame_build_time_millis',
],
};
final List<MetricPoint> metricPoints = parse(results, <String, String>{}, 'task abc');
expect(metricPoints[0].value, equals(0.4550425531914895));
expect(metricPoints[1].value, equals(0.473));
});
test('with additional benchmark tags', () {
final Map<String, dynamic> results = <String, dynamic>{
'CommitBranch': 'master',
'CommitSha': 'abc',
'BuilderName': 'test',
'ResultData': <String, dynamic>{
'average_frame_build_time_millis': 0.4550425531914895,
'90th_percentile_frame_build_time_millis': 0.473,
},
'BenchmarkScoreKeys': <String>[
'average_frame_build_time_millis',
'90th_percentile_frame_build_time_millis',
],
};
final Map<String, dynamic> tags = <String, dynamic>{
'arch': 'intel',
'device_type': 'Moto G Play',
'device_version': 'android-25',
'host_type': 'linux',
'host_version': 'debian-10.11',
};
final List<MetricPoint> metricPoints = parse(results, tags, 'task abc');
expect(metricPoints[0].value, equals(0.4550425531914895));
expect(metricPoints[0].tags.keys.contains('arch'), isTrue);
expect(metricPoints[1].value, equals(0.473));
expect(metricPoints[1].tags.keys.contains('device_type'), isTrue);
});
test('succeeds - null ResultData', () {
final Map<String, dynamic> results = <String, dynamic>{
'CommitBranch': 'master',
'CommitSha': 'abc',
'BuilderName': 'test',
'ResultData': null,
'BenchmarkScoreKeys': null,
};
final List<MetricPoint> metricPoints = parse(results, <String, String>{}, 'tetask abcst');
expect(metricPoints.length, 0);
});
});
group('Update', () {
test('without taskName', () async {
final Map<String, dynamic> results = <String, dynamic>{
'CommitBranch': 'master',
'CommitSha': 'abc',
'BuilderName': 'test',
'ResultData': <String, dynamic>{
'average_frame_build_time_millis': 0.4550425531914895,
'90th_percentile_frame_build_time_millis': 0.473,
},
'BenchmarkScoreKeys': <String>[
'average_frame_build_time_millis',
'90th_percentile_frame_build_time_millis',
],
};
final List<MetricPoint> metricPoints = parse(results, <String, String>{}, 'task abc');
final FakeFlutterDestination flutterDestination = FakeFlutterDestination();
const String taskName = 'default';
const int commitTimeSinceEpoch = 1629220312;
await upload(flutterDestination, metricPoints, commitTimeSinceEpoch, taskName);
expect(flutterDestination.name, 'default');
});
test('with taskName', () async {
final Map<String, dynamic> results = <String, dynamic>{
'CommitBranch': 'master',
'CommitSha': 'abc',
'BuilderName': 'test',
'ResultData': <String, dynamic>{
'average_frame_build_time_millis': 0.4550425531914895,
'90th_percentile_frame_build_time_millis': 0.473,
},
'BenchmarkScoreKeys': <String>[
'average_frame_build_time_millis',
'90th_percentile_frame_build_time_millis',
],
};
final List<MetricPoint> metricPoints = parse(results, <String, String>{}, 'task abc');
final FakeFlutterDestination flutterDestination = FakeFlutterDestination();
const String taskName = 'test';
const int commitTimeSinceEpoch = 1629220312;
await upload(flutterDestination, metricPoints, commitTimeSinceEpoch, taskName);
expect(flutterDestination.name, taskName);
});
});
group('metric file name', () {
test('without tags', () async {
final Map<String, dynamic> tags = <String, dynamic>{};
final String fileName = metricFileName('test', tags);
expect(fileName, 'test');
});
test('with device tags', () async {
final Map<String, dynamic> tags = <String, dynamic>{'device_type': 'ab-c'};
final String fileName = metricFileName('test', tags);
expect(fileName, 'test_abc');
});
test('with device host and arch tags', () async {
final Map<String, dynamic> tags = <String, dynamic>{'device_type': 'ab-c', 'host_type': 'de-f', 'arch': 'm1'};
final String fileName = metricFileName('test', tags);
expect(fileName, 'test_m1_def_abc');
});
});
}
| flutter/dev/devicelab/test/metrics_center_test.dart/0 | {
"file_path": "flutter/dev/devicelab/test/metrics_center_test.dart",
"repo_id": "flutter",
"token_count": 2664
} | 502 |
/* Styles for handling custom code snippets */
.snippet-container {
padding: 10px;
overflow: auto;
}
.snippet-description {
padding: 8px 40px 12px 8px;
}
.snippet-container pre {
max-height: 500px;
overflow: auto;
padding: 10px;
margin: 0px;
}
.snippet-container ::-webkit-scrollbar {
width: 12px;
}
.snippet-container ::-webkit-scrollbar-thumb {
width: 12px;
border-radius: 6px;
}
.snippet {
position: relative;
}
.snippet-buttons button {
border-style: none;
padding: 10px 24px;
cursor: pointer;
float: left;
}
.snippet-buttons:after {
content: "";
clear: both;
display: table;
}
.snippet-buttons button:focus {
outline: none;
}
.snippet-buttons button:hover {
opacity: 1.0;
}
.snippet-buttons :not([selected]) {
opacity: 0.65;
}
.snippet-buttons [selected] {
opacity: 1.0;
}
.snippet-container [hidden] {
display: none;
}
.snippet-create-command {
text-align: end;
font-size: smaller;
font-style: normal;
font-family: courier, lucidia;
}
.snippet-dartpad {
width: 100%;
height: 500px;
}
/* Styles for the deep-link anchor button */
.anchor-container {
position: relative;
}
.anchor-button-overlay {
position: absolute;
top: 5px;
right: 5px;
height: 28px;
width: 28px;
transition: .3s ease;
}
.anchor-button {
border-style: none;
background: none;
cursor: pointer;
}
.anchor-button :focus {
outline: 0px;
}
.anchor-button :hover {
transition: .3s ease;
opacity: 0.65;
}
/* Styles for the copy-to-clipboard button */
.copyable-container {
position: relative;
}
.copy-button-overlay {
position: absolute;
top: 10px;
right: 14px;
height: 28px;
width: 28px;
transition: .3s ease;
}
.copy-button {
border-style: none;
background: none;
cursor: pointer;
}
.copy-button :focus {
outline: 0px;
}
.copy-button :hover {
transition: .3s ease;
opacity: 1.0;
}
.copy-image {
opacity: 0.65;
font-size: 28px;
padding-top: 4px;
color: var(--main-hyperlinks-color);
}
/* Light/Dark theme modifications */
.dark-theme .snippet-buttons button {
background-color: #133e59;
color: rgb(149, 149, 149);
}
.light-theme .snippet-buttons button {
background-color: #2372a3;
color: white;
}
.light-theme .snippet-container {
--main-hyperlinks-color: #005cc6;
}
.dark-theme .snippet-container {
background-color: rgb(30, 40, 51);
}
.light-theme .snippet-container {
background-color: rgb(215, 235, 252);
} | flutter/dev/docs/assets/snippets.css/0 | {
"file_path": "flutter/dev/docs/assets/snippets.css",
"repo_id": "flutter",
"token_count": 974
} | 503 |
name: renderers
environment:
sdk: '>=3.2.0-0 <4.0.0'
| flutter/dev/docs/renderers/pubspec.yaml/0 | {
"file_path": "flutter/dev/docs/renderers/pubspec.yaml",
"repo_id": "flutter",
"token_count": 31
} | 504 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:convert';
import 'package:android_semantics_testing/android_semantics_testing.dart';
import 'package:android_semantics_testing/main.dart' as app;
import 'package:android_semantics_testing/test_constants.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
// The accessibility focus actions are added when a semantics node receives or
// lose accessibility focus. This test ignores these actions since it is hard to
// predict which node has the accessibility focus after a screen changes.
const List<AndroidSemanticsAction> ignoredAccessibilityFocusActions = <AndroidSemanticsAction>[
AndroidSemanticsAction.accessibilityFocus,
AndroidSemanticsAction.clearAccessibilityFocus,
];
const MethodChannel kSemanticsChannel = MethodChannel('semantics');
Future<void> setClipboard(String message) async {
final Completer<void> completer = Completer<void>();
Future<void> completeSetClipboard([Object? _]) async {
await kSemanticsChannel.invokeMethod<dynamic>('setClipboard', <String, dynamic>{
'message': message,
});
completer.complete();
}
if (SchedulerBinding.instance.hasScheduledFrame) {
SchedulerBinding.instance.addPostFrameCallback(completeSetClipboard);
} else {
completeSetClipboard();
}
await completer.future;
}
Future<AndroidSemanticsNode> getSemantics(Finder finder, WidgetTester tester) async {
final int id = tester.getSemantics(finder).id;
final Completer<String> completer = Completer<String>();
Future<void> completeSemantics([Object? _]) async {
final dynamic result = await kSemanticsChannel.invokeMethod<dynamic>('getSemanticsNode', <String, dynamic>{
'id': id,
});
completer.complete(json.encode(result));
}
if (SchedulerBinding.instance.hasScheduledFrame) {
SchedulerBinding.instance.addPostFrameCallback(completeSemantics);
} else {
completeSemantics();
}
return AndroidSemanticsNode.deserialize(await completer.future);
}
Future<void> main() async {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('AccessibilityBridge', () {
group('TextField', () {
Future<void> prepareTextField(WidgetTester tester) async {
app.main();
await tester.pumpAndSettle();
await tester.tap(find.text(textFieldRoute));
await tester.pumpAndSettle();
// The text selection menu and related semantics vary depending on if
// the clipboard contents are pasteable. Copy some text into the
// clipboard to make sure these tests always run with pasteable content
// in the clipboard.
// Ideally this should test the case where there is nothing on the
// clipboard as well, but there is no reliable way to clear the
// clipboard on Android devices.
await setClipboard('Hello World');
await tester.pumpAndSettle();
}
testWidgets('TextField has correct Android semantics', (WidgetTester tester) async {
final Finder normalTextField = find.descendant(
of: find.byKey(const ValueKey<String>(normalTextFieldKeyValue)),
matching: find.byType(EditableText),
);
await prepareTextField(tester);
expect(
await getSemantics(normalTextField, tester),
hasAndroidSemantics(
className: AndroidClassName.editText,
isEditable: true,
isFocusable: true,
isFocused: false,
isPassword: false,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
// We can't predict the a11y focus when the screen changes.
ignoredActions: ignoredAccessibilityFocusActions,
),
);
await tester.tap(normalTextField);
await tester.pumpAndSettle();
expect(
await getSemantics(normalTextField, tester),
hasAndroidSemantics(
className: AndroidClassName.editText,
isFocusable: true,
isFocused: true,
isEditable: true,
isPassword: false,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
AndroidSemanticsAction.paste,
AndroidSemanticsAction.setSelection,
AndroidSemanticsAction.setText,
],
// We can't predict the a11y focus when the screen changes.
ignoredActions: ignoredAccessibilityFocusActions,
),
);
await tester.enterText(normalTextField, 'hello world');
await tester.pumpAndSettle();
expect(
await getSemantics(normalTextField, tester),
hasAndroidSemantics(
text: 'hello world',
className: AndroidClassName.editText,
isFocusable: true,
isFocused: true,
isEditable: true,
isPassword: false,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
AndroidSemanticsAction.paste,
AndroidSemanticsAction.setSelection,
AndroidSemanticsAction.setText,
AndroidSemanticsAction.previousAtMovementGranularity,
],
// We can't predict the a11y focus when the screen changes.
ignoredActions: ignoredAccessibilityFocusActions,
),
);
}, timeout: Timeout.none);
testWidgets('password TextField has correct Android semantics', (WidgetTester tester) async {
final Finder passwordTextField = find.descendant(
of: find.byKey(const ValueKey<String>(passwordTextFieldKeyValue)),
matching: find.byType(EditableText),
);
await prepareTextField(tester);
expect(
await getSemantics(passwordTextField, tester),
hasAndroidSemantics(
className: AndroidClassName.editText,
isEditable: true,
isFocusable: true,
isFocused: false,
isPassword: true,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
// We can't predict the a11y focus when the screen changes.
ignoredActions: ignoredAccessibilityFocusActions,
),
);
await tester.tap(passwordTextField);
await tester.pumpAndSettle();
expect(
await getSemantics(passwordTextField, tester),
hasAndroidSemantics(
className: AndroidClassName.editText,
isFocusable: true,
isFocused: true,
isEditable: true,
isPassword: true,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
AndroidSemanticsAction.paste,
AndroidSemanticsAction.setSelection,
AndroidSemanticsAction.setText,
],
// We can't predict the a11y focus when the screen changes.
ignoredActions: ignoredAccessibilityFocusActions,
),
);
await tester.enterText(passwordTextField, 'hello world');
await tester.pumpAndSettle();
expect(
await getSemantics(passwordTextField, tester),
hasAndroidSemantics(
text: '\u{2022}' * ('hello world'.length),
className: AndroidClassName.editText,
isFocusable: true,
isFocused: true,
isEditable: true,
isPassword: true,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
AndroidSemanticsAction.paste,
AndroidSemanticsAction.setSelection,
AndroidSemanticsAction.setText,
AndroidSemanticsAction.previousAtMovementGranularity,
],
// We can't predict the a11y focus when the screen changes.
ignoredActions: ignoredAccessibilityFocusActions,
),
);
}, timeout: Timeout.none);
});
group('SelectionControls', () {
Future<void> prepareSelectionControls(WidgetTester tester) async {
app.main();
await tester.pumpAndSettle();
await tester.tap(find.text(selectionControlsRoute));
await tester.pumpAndSettle();
}
testWidgets('Checkbox has correct Android semantics', (WidgetTester tester) async {
final Finder checkbox = find.byKey(const ValueKey<String>(checkboxKeyValue));
final Finder disabledCheckbox = find.byKey(const ValueKey<String>(disabledCheckboxKeyValue));
await prepareSelectionControls(tester);
expect(
await getSemantics(checkbox, tester),
hasAndroidSemantics(
className: AndroidClassName.checkBox,
isChecked: false,
isCheckable: true,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
),
);
await tester.tap(checkbox);
await tester.pumpAndSettle();
expect(
await getSemantics(checkbox, tester),
hasAndroidSemantics(
className: AndroidClassName.checkBox,
isChecked: true,
isCheckable: true,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
),
);
expect(
await getSemantics(disabledCheckbox, tester),
hasAndroidSemantics(
className: AndroidClassName.checkBox,
isCheckable: true,
isEnabled: false,
ignoredActions: ignoredAccessibilityFocusActions,
actions: const <AndroidSemanticsAction>[],
),
);
}, timeout: Timeout.none);
testWidgets('Radio has correct Android semantics', (WidgetTester tester) async {
final Finder radio = find.byKey(const ValueKey<String>(radio2KeyValue));
await prepareSelectionControls(tester);
expect(
await getSemantics(radio, tester),
hasAndroidSemantics(
className: AndroidClassName.radio,
isChecked: false,
isCheckable: true,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
),
);
await tester.tap(radio);
await tester.pumpAndSettle();
expect(
await getSemantics(radio, tester),
hasAndroidSemantics(
className: AndroidClassName.radio,
isChecked: true,
isCheckable: true,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
),
);
}, timeout: Timeout.none);
testWidgets('Switch has correct Android semantics', (WidgetTester tester) async {
final Finder switchFinder = find.byKey(const ValueKey<String>(switchKeyValue));
await prepareSelectionControls(tester);
expect(
await getSemantics(switchFinder, tester),
hasAndroidSemantics(
className: AndroidClassName.toggleSwitch,
isChecked: false,
isCheckable: true,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
),
);
await tester.tap(switchFinder);
await tester.pumpAndSettle();
expect(
await getSemantics(switchFinder, tester),
hasAndroidSemantics(
className: AndroidClassName.toggleSwitch,
isChecked: true,
isCheckable: true,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
),
);
}, timeout: Timeout.none);
// Regression test for https://github.com/flutter/flutter/issues/20820.
testWidgets('Switch can be labeled', (WidgetTester tester) async {
final Finder switchFinder = find.byKey(const ValueKey<String>(labeledSwitchKeyValue));
await prepareSelectionControls(tester);
expect(
await getSemantics(switchFinder, tester),
hasAndroidSemantics(
className: AndroidClassName.toggleSwitch,
isChecked: false,
isCheckable: true,
isEnabled: true,
isFocusable: true,
contentDescription: switchLabel,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
),
);
}, timeout: Timeout.none);
});
group('Popup Controls', () {
Future<void> preparePopupControls(WidgetTester tester) async {
app.main();
await tester.pumpAndSettle();
await tester.tap(find.text(popupControlsRoute));
await tester.pumpAndSettle();
}
testWidgets('Popup Menu has correct Android semantics', (WidgetTester tester) async {
final Finder popupButton = find.byKey(const ValueKey<String>(popupButtonKeyValue));
await preparePopupControls(tester);
expect(
await getSemantics(popupButton, tester),
hasAndroidSemantics(
className: AndroidClassName.button,
isChecked: false,
isCheckable: false,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
),
);
await tester.tap(popupButton);
await tester.pumpAndSettle();
try {
for (final String item in popupItems) {
expect(
await getSemantics(find.byKey(ValueKey<String>('$popupKeyValue.$item')), tester),
hasAndroidSemantics(
className: AndroidClassName.button,
isChecked: false,
isCheckable: false,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
),
reason: "Popup $item doesn't have the right semantics",
);
}
await tester.tap(find.byKey(ValueKey<String>('$popupKeyValue.${popupItems.first}')));
await tester.pumpAndSettle();
// Pop up the menu again, to verify that TalkBack gets the right answer
// more than just the first time.
await tester.tap(popupButton);
await tester.pumpAndSettle();
for (final String item in popupItems) {
expect(
await getSemantics(find.byKey(ValueKey<String>('$popupKeyValue.$item')), tester),
hasAndroidSemantics(
className: AndroidClassName.button,
isChecked: false,
isCheckable: false,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
),
reason: "Popup $item doesn't have the right semantics the second time",
);
}
} finally {
await tester.tap(find.byKey(ValueKey<String>('$popupKeyValue.${popupItems.first}')));
}
}, timeout: Timeout.none);
testWidgets('Dropdown Menu has correct Android semantics', (WidgetTester tester) async {
final Finder dropdownButton = find.byKey(const ValueKey<String>(dropdownButtonKeyValue));
await preparePopupControls(tester);
expect(
await getSemantics(dropdownButton, tester),
hasAndroidSemantics(
className: AndroidClassName.button,
isChecked: false,
isCheckable: false,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
),
);
await tester.tap(dropdownButton);
await tester.pumpAndSettle();
try {
for (final String item in popupItems) {
// There are two copies of each item, so we want to find the version
// that is in the overlay, not the one in the dropdown.
expect(
await getSemantics(
find.descendant(
of: find.byType(Scrollable),
matching: find.byKey(ValueKey<String>('$dropdownKeyValue.$item')),
),
tester,
),
hasAndroidSemantics(
className: AndroidClassName.view,
isChecked: false,
isCheckable: false,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
),
reason: "Dropdown $item doesn't have the right semantics",
);
}
await tester.tap(
find.descendant(
of: find.byType(Scrollable),
matching: find.byKey(ValueKey<String>('$dropdownKeyValue.${popupItems.first}')),
),
);
await tester.pumpAndSettle();
// Pop up the dropdown again, to verify that TalkBack gets the right answer
// more than just the first time.
await tester.tap(dropdownButton);
await tester.pumpAndSettle();
for (final String item in popupItems) {
// There are two copies of each item, so we want to find the version
// that is in the overlay, not the one in the dropdown.
expect(
await getSemantics(
find.descendant(
of: find.byType(Scrollable),
matching: find.byKey(ValueKey<String>('$dropdownKeyValue.$item')),
),
tester,
),
hasAndroidSemantics(
className: AndroidClassName.view,
isChecked: false,
isCheckable: false,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
),
reason: "Dropdown $item doesn't have the right semantics the second time.",
);
}
} finally {
await tester.tap(
find.descendant(
of: find.byType(Scrollable),
matching: find.byKey(ValueKey<String>('$dropdownKeyValue.${popupItems.first}')),
),
);
}
}, timeout: Timeout.none);
testWidgets('Modal alert dialog has correct Android semantics', (WidgetTester tester) async {
final Finder alertButton = find.byKey(const ValueKey<String>(alertButtonKeyValue));
await preparePopupControls(tester);
expect(
await getSemantics(alertButton, tester),
hasAndroidSemantics(
className: AndroidClassName.button,
isChecked: false,
isCheckable: false,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
),
);
await tester.tap(alertButton);
await tester.pumpAndSettle();
try {
expect(
await getSemantics(find.byKey(const ValueKey<String>('$alertKeyValue.OK')), tester),
hasAndroidSemantics(
className: AndroidClassName.button,
isChecked: false,
isCheckable: false,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
),
reason: "Alert OK button doesn't have the right semantics",
);
for (final String item in <String>['Title', 'Body1', 'Body2']) {
expect(
await getSemantics(find.byKey(ValueKey<String>('$alertKeyValue.$item')), tester),
hasAndroidSemantics(
className: AndroidClassName.view,
isChecked: false,
isCheckable: false,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[],
),
reason: "Alert $item button doesn't have the right semantics",
);
}
await tester.tap(find.byKey(const ValueKey<String>('$alertKeyValue.OK')));
await tester.pumpAndSettle();
// Pop up the alert again, to verify that TalkBack gets the right answer
// more than just the first time.
await tester.tap(alertButton);
await tester.pumpAndSettle();
expect(
await getSemantics(find.byKey(const ValueKey<String>('$alertKeyValue.OK')), tester),
hasAndroidSemantics(
className: AndroidClassName.button,
isChecked: false,
isCheckable: false,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.click,
],
),
reason: "Alert OK button doesn't have the right semantics",
);
for (final String item in <String>['Title', 'Body1', 'Body2']) {
expect(
await getSemantics(find.byKey(ValueKey<String>('$alertKeyValue.$item')), tester),
hasAndroidSemantics(
className: AndroidClassName.view,
isChecked: false,
isCheckable: false,
isEnabled: true,
isFocusable: true,
ignoredActions: ignoredAccessibilityFocusActions,
actions: <AndroidSemanticsAction>[],
),
reason: "Alert $item button doesn't have the right semantics",
);
}
} finally {
await tester.tap(find.byKey(const ValueKey<String>('$alertKeyValue.OK')));
}
}, timeout: Timeout.none);
});
group('Headings', () {
Future<void> prepareHeading(WidgetTester tester) async {
app.main();
await tester.pumpAndSettle();
await tester.tap(find.text(headingsRoute));
await tester.pumpAndSettle();
}
testWidgets('AppBar title has correct Android heading semantics', (WidgetTester tester) async {
await prepareHeading(tester);
expect(
await getSemantics(find.byKey(const ValueKey<String>(appBarTitleKeyValue)), tester),
hasAndroidSemantics(isHeading: true),
);
}, timeout: Timeout.none);
testWidgets('body text does not have Android heading semantics', (WidgetTester tester) async {
await prepareHeading(tester);
expect(
await getSemantics(find.byKey(const ValueKey<String>(bodyTextKeyValue)), tester),
hasAndroidSemantics(isHeading: false),
);
}, timeout: Timeout.none);
});
});
}
| flutter/dev/integration_tests/android_semantics_testing/integration_test/main_test.dart/0 | {
"file_path": "flutter/dev/integration_tests/android_semantics_testing/integration_test/main_test.dart",
"repo_id": "flutter",
"token_count": 11357
} | 505 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:android_semantics_testing/android_semantics_testing.dart';
import 'package:flutter_test/flutter_test.dart';
// JSON matching a serialized Android AccessibilityNodeInfo.
const String source = r'''
{
"id": 23,
"flags": {
"isChecked": false,
"isCheckable": false,
"isEditable": false,
"isFocusable": false,
"isFocused": false,
"isPassword": false,
"isLongClickable": false
},
"text": "hello",
"contentDescription": "other hello",
"className": "android.view.View",
"rect": {
"left": 0,
"top": 0,
"right": 10,
"bottom": 10
},
"actions": [1, 2, 4]
}
''';
void main() {
group(AndroidSemanticsNode, () {
test('can be parsed from json data', () {
final AndroidSemanticsNode node = AndroidSemanticsNode.deserialize(source);
expect(node.isChecked, false);
expect(node.isCheckable, false);
expect(node.isEditable, false);
expect(node.isFocusable, false);
expect(node.isFocused, false);
expect(node.isPassword, false);
expect(node.isLongClickable, false);
expect(node.text, 'hello');
expect(node.contentDescription, 'other hello');
expect(node.id, 23);
expect(node.getRect(), const Rect.fromLTRB(0.0, 0.0, 10.0, 10.0));
expect(node.getActions(), <AndroidSemanticsAction>[
AndroidSemanticsAction.focus,
AndroidSemanticsAction.clearFocus,
AndroidSemanticsAction.select,
]);
expect(node.className, 'android.view.View');
expect(node.getSize(), const Size(10.0, 10.0));
});
});
group(AndroidSemanticsAction, () {
test('can be parsed from correct constant id', () {
expect(AndroidSemanticsAction.deserialize(0x1), AndroidSemanticsAction.focus);
});
test('returns null passed a bogus id', () {
expect(AndroidSemanticsAction.deserialize(23), isNull);
});
});
group('hasAndroidSemantics', () {
test('matches all android semantics properties', () {
final AndroidSemanticsNode node = AndroidSemanticsNode.deserialize(source);
expect(node, hasAndroidSemantics(
isChecked: false,
isCheckable: false,
isEditable: false,
isFocusable: false,
isFocused: false,
isPassword: false,
isLongClickable: false,
text: 'hello',
contentDescription: 'other hello',
className: 'android.view.View',
id: 23,
rect: const Rect.fromLTRB(0.0, 0.0, 10.0, 10.0),
actions: <AndroidSemanticsAction>[
AndroidSemanticsAction.focus,
AndroidSemanticsAction.clearFocus,
AndroidSemanticsAction.select,
],
size: const Size(10.0, 10.0),
));
});
});
}
| flutter/dev/integration_tests/android_semantics_testing/test/android_semantics_testing_test.dart/0 | {
"file_path": "flutter/dev/integration_tests/android_semantics_testing/test/android_semantics_testing_test.dart",
"repo_id": "flutter",
"token_count": 1144
} | 506 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'page.dart';
class WindowManagerIntegrationsPage extends PageWidget {
const WindowManagerIntegrationsPage({Key? key})
: super('Window Manager Integrations Tests', const ValueKey<String>('WmIntegrationsListTile'), key: key);
@override
Widget build(BuildContext context) => const WindowManagerBody();
}
class WindowManagerBody extends StatefulWidget {
const WindowManagerBody({super.key});
@override
State<WindowManagerBody> createState() => WindowManagerBodyState();
}
enum _LastTestStatus {
pending,
success,
error
}
class WindowManagerBodyState extends State<WindowManagerBody> {
MethodChannel? viewChannel;
_LastTestStatus _lastTestStatus = _LastTestStatus.pending;
String? lastError;
int? id;
int windowClickCount = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Window Manager Integrations'),
),
body: Column(
children: <Widget>[
SizedBox(
height: 300,
child: AndroidView(
viewType: 'simple_view',
onPlatformViewCreated: onPlatformViewCreated,
),
),
if (_lastTestStatus != _LastTestStatus.pending) _statusWidget(),
if (viewChannel != null) ... <Widget>[
ElevatedButton(
key: const ValueKey<String>('ShowAlertDialog'),
onPressed: onShowAlertDialogPressed,
child: const Text('SHOW ALERT DIALOG'),
),
Row(
children: <Widget>[
ElevatedButton(
key: const ValueKey<String>('AddWindow'),
onPressed: onAddWindowPressed,
child: const Text('ADD WINDOW'),
),
ElevatedButton(
key: const ValueKey<String>('TapWindow'),
onPressed: onTapWindowPressed,
child: const Text('TAP WINDOW'),
),
if (windowClickCount > 0)
Text(
'Click count: $windowClickCount',
key: const ValueKey<String>('WindowClickCount'),
),
],
),
],
],
),
);
}
Widget _statusWidget() {
assert(_lastTestStatus != _LastTestStatus.pending);
final String? message = _lastTestStatus == _LastTestStatus.success ? 'Success' : lastError;
return ColoredBox(
color: _lastTestStatus == _LastTestStatus.success ? Colors.green : Colors.red,
child: Text(
message!,
key: const ValueKey<String>('Status'),
style: TextStyle(
color: _lastTestStatus == _LastTestStatus.error ? Colors.yellow : null,
),
),
);
}
Future<void> onShowAlertDialogPressed() async {
if (_lastTestStatus != _LastTestStatus.pending) {
setState(() {
_lastTestStatus = _LastTestStatus.pending;
});
}
try {
await viewChannel?.invokeMethod<void>('showAndHideAlertDialog');
setState(() {
_lastTestStatus = _LastTestStatus.success;
});
} catch (e) {
setState(() {
_lastTestStatus = _LastTestStatus.error;
lastError = '$e';
});
}
}
Future<void> onAddWindowPressed() async {
try {
await viewChannel?.invokeMethod<void>('addWindowAndWaitForClick');
setState(() {
windowClickCount++;
});
} catch (e) {
setState(() {
_lastTestStatus = _LastTestStatus.error;
lastError = '$e';
});
}
}
Future<void> onTapWindowPressed() async {
await Future<void>.delayed(const Duration(seconds: 1));
// Dispatch a tap event on the child view inside the platform view.
//
// Android mutates `MotionEvent` instances, so in this case *do not* dispatch
// new instances as it won't cover the `MotionEventTracker` class in the embedding
// which tracks events.
//
// See the issue this prevents: https://github.com/flutter/flutter/issues/61169
await Process.run('input', const <String>['tap', '250', '550']);
}
void onPlatformViewCreated(int id) {
this.id = id;
setState(() {
viewChannel = MethodChannel('simple_view/$id');
});
}
}
| flutter/dev/integration_tests/android_views/lib/wm_integrations.dart/0 | {
"file_path": "flutter/dev/integration_tests/android_views/lib/wm_integrations.dart",
"repo_id": "flutter",
"token_count": 1920
} | 507 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter/services.dart';
import 'basic_messaging.dart';
import 'test_step.dart';
Future<TestStepResult> methodCallJsonSuccessHandshake(dynamic payload) async {
const MethodChannel channel =
MethodChannel('json-method', JSONMethodCodec());
return _methodCallSuccessHandshake('JSON success($payload)', channel, payload);
}
Future<TestStepResult> methodCallJsonErrorHandshake(dynamic payload) async {
const MethodChannel channel =
MethodChannel('json-method', JSONMethodCodec());
return _methodCallErrorHandshake('JSON error($payload)', channel, payload);
}
Future<TestStepResult> methodCallJsonNotImplementedHandshake() async {
const MethodChannel channel =
MethodChannel('json-method', JSONMethodCodec());
return _methodCallNotImplementedHandshake('JSON notImplemented()', channel);
}
Future<TestStepResult> methodCallStandardSuccessHandshake(
dynamic payload) async {
const MethodChannel channel = MethodChannel(
'std-method',
StandardMethodCodec(ExtendedStandardMessageCodec()),
);
return _methodCallSuccessHandshake('Standard success($payload)', channel, payload);
}
Future<TestStepResult> methodCallStandardErrorHandshake(dynamic payload) async {
const MethodChannel channel = MethodChannel(
'std-method',
StandardMethodCodec(ExtendedStandardMessageCodec()),
);
return _methodCallErrorHandshake('Standard error($payload)', channel, payload);
}
Future<TestStepResult> methodCallStandardNotImplementedHandshake() async {
const MethodChannel channel = MethodChannel(
'std-method',
StandardMethodCodec(ExtendedStandardMessageCodec()),
);
return _methodCallNotImplementedHandshake('Standard notImplemented()', channel);
}
Future<TestStepResult> _methodCallSuccessHandshake(
String description,
MethodChannel channel,
dynamic arguments,
) async {
final List<dynamic> received = <dynamic>[];
channel.setMethodCallHandler((MethodCall call) async {
received.add(call.arguments);
return call.arguments;
});
dynamic result = nothing;
dynamic error = nothing;
try {
result = await channel.invokeMethod<dynamic>('success', arguments);
} catch (e) {
error = e;
}
return resultOfHandshake(
'Method call success handshake',
description,
arguments,
received,
result,
error,
);
}
Future<TestStepResult> _methodCallErrorHandshake(
String description,
MethodChannel channel,
dynamic arguments,
) async {
final List<dynamic> received = <dynamic>[];
channel.setMethodCallHandler((MethodCall call) async {
received.add(call.arguments);
throw PlatformException(code: 'error', details: arguments);
});
dynamic errorDetails = nothing;
dynamic error = nothing;
try {
error = await channel.invokeMethod<dynamic>('error', arguments);
} on PlatformException catch (e) {
errorDetails = e.details;
} catch (e) {
error = e;
}
return resultOfHandshake(
'Method call error handshake',
description,
arguments,
received,
errorDetails,
error,
);
}
Future<TestStepResult> _methodCallNotImplementedHandshake(
String description,
MethodChannel channel,
) async {
final List<dynamic> received = <dynamic>[];
channel.setMethodCallHandler((MethodCall call) async {
received.add(call.arguments);
throw MissingPluginException();
});
dynamic result = nothing;
dynamic error = nothing;
try {
error = await channel.invokeMethod<dynamic>('notImplemented');
} on MissingPluginException {
result = null;
} catch (e) {
error = e;
}
return resultOfHandshake(
'Method call not implemented handshake',
description,
null,
received,
result,
error,
);
}
| flutter/dev/integration_tests/channels/lib/src/method_calls.dart/0 | {
"file_path": "flutter/dev/integration_tests/channels/lib/src/method_calls.dart",
"repo_id": "flutter",
"token_count": 1196
} | 508 |
#include "../../Flutter/Flutter-Debug.xcconfig"
#include "Warnings.xcconfig"
| flutter/dev/integration_tests/channels/macos/Runner/Configs/Debug.xcconfig/0 | {
"file_path": "flutter/dev/integration_tests/channels/macos/Runner/Configs/Debug.xcconfig",
"repo_id": "flutter",
"token_count": 32
} | 509 |
package io.flutter.integration.deferred_components_test
import io.flutter.embedding.android.FlutterActivity
class MainActivity : FlutterActivity()
| flutter/dev/integration_tests/deferred_components_test/android/app/src/main/kotlin/io/flutter/integration/deferred_components_test/MainActivity.kt/0 | {
"file_path": "flutter/dev/integration_tests/deferred_components_test/android/app/src/main/kotlin/io/flutter/integration/deferred_components_test/MainActivity.kt",
"repo_id": "flutter",
"token_count": 43
} | 510 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_driver/driver_extension.dart';
import 'component1.dart' deferred as component1;
void main() {
enableFlutterDriverExtension();
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Deferred Components Example',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
MyHomePageState createState() => MyHomePageState();
}
class MyHomePageState extends State<MyHomePage> {
Future<void>? libraryFuture;
Widget postLoadDisplayWidget = const Text(
'placeholder',
key: Key('PlaceholderText'),
);
@override
void initState() {
// Automatically trigger load for release test without driver.
Future<void>.delayed(const Duration(milliseconds: 3000), () {
_pressHandler();
});
super.initState();
}
void _pressHandler() {
if (libraryFuture == null) {
setState(() {
libraryFuture = component1.loadLibrary().then((dynamic _) {
// Delay to give debug runs more than one frame to capture
// the placeholder text.
Future<void>.delayed(const Duration(milliseconds: 750), () {
setState(() {
postLoadDisplayWidget = component1.LogoScreen();
});
});
});
});
}
}
@override
Widget build(BuildContext context) {
final Widget testWidget = libraryFuture == null ? const Text('preload', key: Key('PreloadText')) :
FutureBuilder<void>(
future: libraryFuture,
builder: (BuildContext context, AsyncSnapshot<void> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.hasError) {
return Text('Error: ${snapshot.error}');
}
return postLoadDisplayWidget;
}
return postLoadDisplayWidget;
},
);
return Scaffold(
appBar: AppBar(
title: const Text('Deferred components test'),
),
body: Center(
child: testWidget,
),
floatingActionButton: FloatingActionButton(
key: const Key('FloatingActionButton'),
onPressed: _pressHandler,
tooltip: 'Load',
child: const Icon(Icons.add),
),
);
}
}
| flutter/dev/integration_tests/deferred_components_test/lib/main.dart/0 | {
"file_path": "flutter/dev/integration_tests/deferred_components_test/lib/main.dart",
"repo_id": "flutter",
"token_count": 1073
} | 511 |
#include "Generated.xcconfig"
| flutter/dev/integration_tests/external_textures/ios/Flutter/Debug.xcconfig/0 | {
"file_path": "flutter/dev/integration_tests/external_textures/ios/Flutter/Debug.xcconfig",
"repo_id": "flutter",
"token_count": 12
} | 512 |
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-40.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-60.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-58.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-87.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-80.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-120.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-120.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-180.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-20.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-40.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-58.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-40.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-80.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-152.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-167.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-1024.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
} | flutter/dev/integration_tests/flutter_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json/0 | {
"file_path": "flutter/dev/integration_tests/flutter_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json",
"repo_id": "flutter",
"token_count": 1400
} | 513 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/cupertino.dart';
import '../../gallery/demo.dart';
class CupertinoButtonsDemo extends StatefulWidget {
const CupertinoButtonsDemo({super.key});
static const String routeName = '/cupertino/buttons';
@override
State<CupertinoButtonsDemo> createState() => _CupertinoButtonDemoState();
}
class _CupertinoButtonDemoState extends State<CupertinoButtonsDemo> {
int _pressedCount = 0;
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: const Text('Buttons'),
// We're specifying a back label here because the previous page is a
// Material page. CupertinoPageRoutes could auto-populate these back
// labels.
previousPageTitle: 'Cupertino',
trailing: CupertinoDemoDocumentationButton(CupertinoButtonsDemo.routeName),
),
child: DefaultTextStyle(
style: CupertinoTheme.of(context).textTheme.textStyle,
child: SafeArea(
child: Column(
children: <Widget>[
const Padding(
padding: EdgeInsets.all(16.0),
child: Text(
'iOS themed buttons are flat. They can have borders or backgrounds but '
'only when necessary.'
),
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget> [
Text(_pressedCount > 0
? 'Button pressed $_pressedCount time${_pressedCount == 1 ? "" : "s"}'
: ' '),
const Padding(padding: EdgeInsets.all(12.0)),
Align(
alignment: const Alignment(0.0, -0.2),
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
CupertinoButton(
child: const Text('Cupertino Button'),
onPressed: () {
setState(() { _pressedCount += 1; });
},
),
const CupertinoButton(
onPressed: null,
child: Text('Disabled'),
),
],
),
),
const Padding(padding: EdgeInsets.all(12.0)),
CupertinoButton.filled(
child: const Text('With Background'),
onPressed: () {
setState(() { _pressedCount += 1; });
},
),
const Padding(padding: EdgeInsets.all(12.0)),
const CupertinoButton.filled(
onPressed: null,
child: Text('Disabled'),
),
],
),
),
],
),
),
),
);
}
}
| flutter/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_buttons_demo.dart/0 | {
"file_path": "flutter/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_buttons_demo.dart",
"repo_id": "flutter",
"token_count": 1811
} | 514 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import '../../gallery/demo.dart';
const String _kGalleryAssetsPackage = 'flutter_gallery_assets';
enum CardDemoType {
standard,
tappable,
selectable,
}
class TravelDestination {
const TravelDestination({
required this.assetName,
required this.assetPackage,
required this.title,
required this.description,
required this.city,
required this.location,
this.type = CardDemoType.standard,
});
final String assetName;
final String assetPackage;
final String title;
final String description;
final String city;
final String location;
final CardDemoType type;
}
const List<TravelDestination> destinations = <TravelDestination>[
TravelDestination(
assetName: 'places/india_thanjavur_market.png',
assetPackage: _kGalleryAssetsPackage,
title: 'Top 10 Cities to Visit in Tamil Nadu',
description: 'Number 10',
city: 'Thanjavur',
location: 'Thanjavur, Tamil Nadu',
),
TravelDestination(
assetName: 'places/india_chettinad_silk_maker.png',
assetPackage: _kGalleryAssetsPackage,
title: 'Artisans of Southern India',
description: 'Silk Spinners',
city: 'Chettinad',
location: 'Sivaganga, Tamil Nadu',
type: CardDemoType.tappable,
),
TravelDestination(
assetName: 'places/india_tanjore_thanjavur_temple.png',
assetPackage: _kGalleryAssetsPackage,
title: 'Brihadisvara Temple',
description: 'Temples',
city: 'Thanjavur',
location: 'Thanjavur, Tamil Nadu',
type: CardDemoType.selectable,
),
];
class TravelDestinationItem extends StatelessWidget {
const TravelDestinationItem({ super.key, required this.destination, this.shape });
// This height will allow for all the Card's content to fit comfortably within the card.
static const double height = 338.0;
final TravelDestination destination;
final ShapeBorder? shape;
@override
Widget build(BuildContext context) {
return SafeArea(
top: false,
bottom: false,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: <Widget>[
const SectionTitle(title: 'Normal'),
SizedBox(
height: height,
child: Card(
// This ensures that the Card's children are clipped correctly.
clipBehavior: Clip.antiAlias,
shape: shape,
child: TravelDestinationContent(destination: destination),
),
),
],
),
),
);
}
}
class TappableTravelDestinationItem extends StatelessWidget {
const TappableTravelDestinationItem({ super.key, required this.destination, this.shape });
// This height will allow for all the Card's content to fit comfortably within the card.
static const double height = 298.0;
final TravelDestination destination;
final ShapeBorder? shape;
@override
Widget build(BuildContext context) {
return SafeArea(
top: false,
bottom: false,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: <Widget>[
const SectionTitle(title: 'Tappable'),
SizedBox(
height: height,
child: Card(
// This ensures that the Card's children (including the ink splash) are clipped correctly.
clipBehavior: Clip.antiAlias,
shape: shape,
child: InkWell(
onTap: () {
print('Card was tapped');
},
// Generally, material cards use onSurface with 12% opacity for the pressed state.
splashColor: Theme.of(context).colorScheme.onSurface.withOpacity(0.12),
// Generally, material cards do not have a highlight overlay.
highlightColor: Colors.transparent,
child: TravelDestinationContent(destination: destination),
),
),
),
],
),
),
);
}
}
class SelectableTravelDestinationItem extends StatefulWidget {
const SelectableTravelDestinationItem({ super.key, required this.destination, this.shape });
final TravelDestination destination;
final ShapeBorder? shape;
@override
State<SelectableTravelDestinationItem> createState() => _SelectableTravelDestinationItemState();
}
class _SelectableTravelDestinationItemState extends State<SelectableTravelDestinationItem> {
// This height will allow for all the Card's content to fit comfortably within the card.
static const double height = 298.0;
bool _isSelected = false;
@override
Widget build(BuildContext context) {
final ColorScheme colorScheme = Theme.of(context).colorScheme;
return SafeArea(
top: false,
bottom: false,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: <Widget>[
const SectionTitle(title: 'Selectable (long press)'),
SizedBox(
height: height,
child: Card(
// This ensures that the Card's children (including the ink splash) are clipped correctly.
clipBehavior: Clip.antiAlias,
shape: widget.shape,
child: InkWell(
onLongPress: () {
print('Selectable card state changed');
setState(() {
_isSelected = !_isSelected;
});
},
// Generally, material cards use onSurface with 12% opacity for the pressed state.
splashColor: colorScheme.onSurface.withOpacity(0.12),
// Generally, material cards do not have a highlight overlay.
highlightColor: Colors.transparent,
child: Stack(
children: <Widget>[
Container(
color: _isSelected
// Generally, material cards use primary with 8% opacity for the selected state.
// See: https://material.io/design/interaction/states.html#anatomy
? colorScheme.primary.withOpacity(0.08)
: Colors.transparent,
),
TravelDestinationContent(destination: widget.destination),
Align(
alignment: Alignment.topRight,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(
Icons.check_circle,
color: _isSelected ? colorScheme.primary : Colors.transparent,
),
),
),
],
),
),
),
),
],
),
),
);
}
}
class SectionTitle extends StatelessWidget {
const SectionTitle({
super.key,
this.title,
});
final String? title;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.fromLTRB(4.0, 4.0, 4.0, 12.0),
child: Align(
alignment: Alignment.centerLeft,
child: Text(title!, style: Theme.of(context).textTheme.titleMedium),
),
);
}
}
class TravelDestinationContent extends StatelessWidget {
const TravelDestinationContent({ super.key, required this.destination });
final TravelDestination destination;
@override
Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
final TextStyle titleStyle = theme.textTheme.headlineSmall!.copyWith(color: Colors.white);
final TextStyle descriptionStyle = theme.textTheme.titleMedium!;
final ButtonStyle textButtonStyle = TextButton.styleFrom(foregroundColor: Colors.amber.shade500);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
// Photo and title.
SizedBox(
height: 184.0,
child: Stack(
children: <Widget>[
Positioned.fill(
// In order to have the ink splash appear above the image, you
// must use Ink.image. This allows the image to be painted as part
// of the Material and display ink effects above it. Using a
// standard Image will obscure the ink splash.
child: Ink.image(
image: AssetImage(destination.assetName, package: destination.assetPackage),
fit: BoxFit.cover,
child: Container(),
),
),
Positioned(
bottom: 16.0,
left: 16.0,
right: 16.0,
child: FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(
destination.title,
style: titleStyle,
),
),
),
],
),
),
// Description and share/explore buttons.
Padding(
padding: const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 0.0),
child: DefaultTextStyle(
softWrap: false,
overflow: TextOverflow.ellipsis,
style: descriptionStyle,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
// three line description
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Text(
destination.description,
style: descriptionStyle.copyWith(color: Colors.black54),
),
),
Text(destination.city),
Text(destination.location),
],
),
),
),
if (destination.type == CardDemoType.standard)
// share, explore buttons
Padding(
padding: const EdgeInsetsDirectional.only(start: 8, top: 8),
child: OverflowBar(
alignment: MainAxisAlignment.start,
spacing: 8,
children: <Widget>[
TextButton(
style: textButtonStyle,
onPressed: () { print('pressed'); },
child: Text('SHARE', semanticsLabel: 'Share ${destination.title}'),
),
TextButton(
style: textButtonStyle,
onPressed: () { print('pressed'); },
child: Text('EXPLORE', semanticsLabel: 'Explore ${destination.title}'),
),
],
),
),
],
);
}
}
class CardsDemo extends StatefulWidget {
const CardsDemo({super.key});
static const String routeName = '/material/cards';
@override
State<CardsDemo> createState() => _CardsDemoState();
}
class _CardsDemoState extends State<CardsDemo> {
ShapeBorder? _shape;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Cards'),
actions: <Widget>[
MaterialDemoDocumentationButton(CardsDemo.routeName),
IconButton(
icon: const Icon(
Icons.sentiment_very_satisfied,
semanticLabel: 'update shape',
),
onPressed: () {
setState(() {
_shape = _shape != null ? null : const RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(16.0),
topRight: Radius.circular(16.0),
bottomLeft: Radius.circular(2.0),
bottomRight: Radius.circular(2.0),
),
);
});
},
),
],
),
body: Scrollbar(
child: ListView(
primary: true,
padding: const EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0),
children: destinations.map<Widget>((TravelDestination destination) {
Widget? child;
switch (destination.type) {
case CardDemoType.standard:
child = TravelDestinationItem(destination: destination, shape: _shape);
case CardDemoType.tappable:
child = TappableTravelDestinationItem(destination: destination, shape: _shape);
case CardDemoType.selectable:
child = SelectableTravelDestinationItem(destination: destination, shape: _shape);
}
return Container(
margin: const EdgeInsets.only(bottom: 8.0),
child: child,
);
}).toList(),
),
),
);
}
}
| flutter/dev/integration_tests/flutter_gallery/lib/demo/material/cards_demo.dart/0 | {
"file_path": "flutter/dev/integration_tests/flutter_gallery/lib/demo/material/cards_demo.dart",
"repo_id": "flutter",
"token_count": 6184
} | 515 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import '../../gallery/demo.dart';
class ModalBottomSheetDemo extends StatelessWidget {
const ModalBottomSheetDemo({super.key});
static const String routeName = '/material/modal-bottom-sheet';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Modal bottom sheet'),
actions: <Widget>[MaterialDemoDocumentationButton(routeName)],
),
body: Center(
child: ElevatedButton(
child: const Text('SHOW BOTTOM SHEET'),
onPressed: () {
showModalBottomSheet<void>(context: context, builder: (BuildContext context) {
return Padding(
padding: const EdgeInsets.all(32.0),
child: Text('This is the modal bottom sheet. Slide down to dismiss.',
textAlign: TextAlign.center,
style: TextStyle(
color: Theme.of(context).colorScheme.secondary,
fontSize: 24.0,
),
),
);
});
},
),
),
);
}
}
| flutter/dev/integration_tests/flutter_gallery/lib/demo/material/modal_bottom_sheet_demo.dart/0 | {
"file_path": "flutter/dev/integration_tests/flutter_gallery/lib/demo/material/modal_bottom_sheet_demo.dart",
"repo_id": "flutter",
"token_count": 593
} | 516 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'backdrop.dart';
import 'category_menu_page.dart';
import 'colors.dart';
import 'expanding_bottom_sheet.dart';
import 'home.dart';
import 'login.dart';
import 'supplemental/cut_corners_border.dart';
class ShrineApp extends StatefulWidget {
const ShrineApp({super.key});
@override
State<ShrineApp> createState() => _ShrineAppState();
}
class _ShrineAppState extends State<ShrineApp> with SingleTickerProviderStateMixin {
// Controller to coordinate both the opening/closing of backdrop and sliding
// of expanding bottom sheet
late AnimationController _controller;
@override
void initState() {
super.initState();
_controller = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 450),
value: 1.0,
);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
// The automatically applied scrollbars on desktop can cause a crash for
// demos where many scrollables are all attached to the same
// PrimaryScrollController. The gallery needs to be migrated before
// enabling this. https://github.com/flutter/gallery/issues/523
scrollBehavior: const MaterialScrollBehavior().copyWith(scrollbars: false),
title: 'Shrine',
home: HomePage(
backdrop: Backdrop(
frontLayer: const ProductPage(),
backLayer: CategoryMenuPage(onCategoryTap: () => _controller.forward()),
frontTitle: const Text('SHRINE'),
backTitle: const Text('MENU'),
controller: _controller,
),
expandingBottomSheet: ExpandingBottomSheet(hideController: _controller),
),
initialRoute: '/login',
onGenerateRoute: _getRoute,
// Copy the platform from the main theme in order to support platform
// toggling from the Gallery options menu.
theme: _kShrineTheme.copyWith(platform: Theme.of(context).platform),
);
}
}
Route<dynamic>? _getRoute(RouteSettings settings) {
if (settings.name != '/login') {
return null;
}
return MaterialPageRoute<void>(
settings: settings,
builder: (BuildContext context) => const LoginPage(),
fullscreenDialog: true,
);
}
final ThemeData _kShrineTheme = _buildShrineTheme();
IconThemeData _customIconTheme(IconThemeData original) {
return original.copyWith(color: kShrineBrown900);
}
ThemeData _buildShrineTheme() {
final ThemeData base = ThemeData.light();
return base.copyWith(
colorScheme: kShrineColorScheme,
primaryColor: kShrinePink100,
scaffoldBackgroundColor: kShrineBackgroundWhite,
cardColor: kShrineBackgroundWhite,
primaryIconTheme: _customIconTheme(base.iconTheme),
inputDecorationTheme: const InputDecorationTheme(border: CutCornersBorder()),
textTheme: _buildShrineTextTheme(base.textTheme),
primaryTextTheme: _buildShrineTextTheme(base.primaryTextTheme),
iconTheme: _customIconTheme(base.iconTheme),
appBarTheme: const AppBarTheme(backgroundColor: kShrinePink100),
);
}
TextTheme _buildShrineTextTheme(TextTheme base) {
return base.copyWith(
headlineSmall: base.headlineSmall!.copyWith(fontWeight: FontWeight.w500),
titleLarge: base.titleLarge!.copyWith(fontSize: 18.0),
bodySmall: base.bodySmall!.copyWith(fontWeight: FontWeight.w400, fontSize: 14.0),
bodyLarge: base.bodyLarge!.copyWith(fontWeight: FontWeight.w500, fontSize: 16.0),
labelLarge: base.labelLarge!.copyWith(fontWeight: FontWeight.w500, fontSize: 14.0),
).apply(
fontFamily: 'Raleway',
displayColor: kShrineBrown900,
bodyColor: kShrineBrown900,
);
}
const ColorScheme kShrineColorScheme = ColorScheme(
primary: kShrinePink100,
secondary: kShrinePink50,
surface: kShrineSurfaceWhite,
error: kShrineErrorRed,
onPrimary: kShrineBrown900,
onSecondary: kShrineBrown900,
onSurface: kShrineBrown900,
onError: kShrineSurfaceWhite,
brightness: Brightness.light,
);
| flutter/dev/integration_tests/flutter_gallery/lib/demo/shrine/app.dart/0 | {
"file_path": "flutter/dev/integration_tests/flutter_gallery/lib/demo/shrine/app.dart",
"repo_id": "flutter",
"token_count": 1392
} | 517 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:ui' show Vertices;
import 'package:flutter/material.dart';
import 'transformations_demo_board.dart';
import 'transformations_demo_edit_board_point.dart';
import 'transformations_demo_gesture_transformable.dart';
class TransformationsDemo extends StatefulWidget {
const TransformationsDemo({ super.key });
static const String routeName = '/transformations';
@override
State<TransformationsDemo> createState() => _TransformationsDemoState();
}
class _TransformationsDemoState extends State<TransformationsDemo> {
// The radius of a hexagon tile in pixels.
static const double _kHexagonRadius = 32.0;
// The margin between hexagons.
static const double _kHexagonMargin = 1.0;
// The radius of the entire board in hexagons, not including the center.
static const int _kBoardRadius = 8;
bool _reset = false;
Board _board = Board(
boardRadius: _kBoardRadius,
hexagonRadius: _kHexagonRadius,
hexagonMargin: _kHexagonMargin,
);
@override
Widget build (BuildContext context) {
final BoardPainter painter = BoardPainter(
board: _board,
);
// The scene is drawn by a CustomPaint, but user interaction is handled by
// the GestureTransformable parent widget.
return Scaffold(
appBar: AppBar(
title: const Text('2D Transformations'),
actions: <Widget>[
IconButton(
icon: const Icon(Icons.help),
tooltip: 'Help',
onPressed: () {
showDialog<Column>(
context: context,
builder: (BuildContext context) => instructionDialog,
);
},
),
],
),
body: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
// Draw the scene as big as is available, but allow the user to
// translate beyond that to a visibleSize that's a bit bigger.
final Size size = Size(constraints.maxWidth, constraints.maxHeight);
final Size visibleSize = Size(size.width * 3, size.height * 2);
return GestureTransformable(
reset: _reset,
onResetEnd: () {
setState(() {
_reset = false;
});
},
boundaryRect: Rect.fromLTWH(
-visibleSize.width / 2,
-visibleSize.height / 2,
visibleSize.width,
visibleSize.height,
),
// Center the board in the middle of the screen. It's drawn centered
// at the origin, which is the top left corner of the
// GestureTransformable.
initialTranslation: Offset(size.width / 2, size.height / 2),
onTapUp: _onTapUp,
size: size,
child: CustomPaint(
painter: painter,
),
);
},
),
floatingActionButton: _board.selected == null ? resetButton : editButton,
);
}
Widget get instructionDialog {
return AlertDialog(
title: const Text('2D Transformations'),
content: const Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text('Tap to edit hex tiles, and use gestures to move around the scene:\n'),
Text('- Drag to pan.'),
Text('- Pinch to zoom.'),
Text('- Rotate with two fingers.'),
Text('\nYou can always press the home button to return to the starting orientation!'),
],
),
actions: <Widget>[
TextButton(
child: const Text('OK'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
}
FloatingActionButton get resetButton {
return FloatingActionButton(
onPressed: () {
setState(() {
_reset = true;
});
},
tooltip: 'Reset Transform',
backgroundColor: Theme.of(context).primaryColor,
child: const Icon(Icons.home),
);
}
FloatingActionButton get editButton {
return FloatingActionButton(
onPressed: () {
if (_board.selected == null) {
return;
}
showModalBottomSheet<Widget>(context: context, builder: (BuildContext context) {
return Container(
width: double.infinity,
height: 150,
padding: const EdgeInsets.all(12.0),
child: EditBoardPoint(
boardPoint: _board.selected!,
onColorSelection: (Color color) {
setState(() {
_board = _board.copyWithBoardPointColor(_board.selected!, color);
Navigator.pop(context);
});
},
),
);
});
},
tooltip: 'Edit Tile',
child: const Icon(Icons.edit),
);
}
void _onTapUp(TapUpDetails details) {
final Offset scenePoint = details.globalPosition;
final BoardPoint? boardPoint = _board.pointToBoardPoint(scenePoint);
setState(() {
_board = _board.copyWithSelected(boardPoint);
});
}
}
// CustomPainter is what is passed to CustomPaint and actually draws the scene
// when its `paint` method is called.
class BoardPainter extends CustomPainter {
const BoardPainter({
this.board,
});
final Board? board;
@override
void paint(Canvas canvas, Size size) {
void drawBoardPoint(BoardPoint? boardPoint) {
final Color color = boardPoint!.color.withOpacity(
board!.selected == boardPoint ? 0.2 : 1.0,
);
final Vertices vertices = board!.getVerticesForBoardPoint(boardPoint, color);
canvas.drawVertices(vertices, BlendMode.color, Paint());
vertices.dispose();
}
board!.forEach(drawBoardPoint);
}
// We should repaint whenever the board changes, such as board.selected.
@override
bool shouldRepaint(BoardPainter oldDelegate) {
return oldDelegate.board != board;
}
}
| flutter/dev/integration_tests/flutter_gallery/lib/demo/transformations/transformations_demo.dart/0 | {
"file_path": "flutter/dev/integration_tests/flutter_gallery/lib/demo/transformations/transformations_demo.dart",
"repo_id": "flutter",
"token_count": 2562
} | 518 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:developer';
import 'dart:math' as math;
import 'package:flutter/gestures.dart' show DragStartBehavior;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'backdrop.dart';
import 'demos.dart';
const String _kGalleryAssetsPackage = 'flutter_gallery_assets';
const Color _kFlutterBlue = Color(0xFF003D75);
const double _kDemoItemHeight = 64.0;
const Duration _kFrontLayerSwitchDuration = Duration(milliseconds: 300);
class _FlutterLogo extends StatelessWidget {
const _FlutterLogo();
@override
Widget build(BuildContext context) {
return Center(
child: Container(
width: 34.0,
height: 34.0,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
'logos/flutter_white/logo.png',
package: _kGalleryAssetsPackage,
),
),
),
),
);
}
}
class _CategoryItem extends StatelessWidget {
const _CategoryItem({
this.category,
this.onTap,
});
final GalleryDemoCategory? category;
final VoidCallback? onTap;
@override
Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
final bool isDark = theme.brightness == Brightness.dark;
// This repaint boundary prevents the entire _CategoriesPage from being
// repainted when the button's ink splash animates.
return RepaintBoundary(
child: RawMaterialButton(
hoverColor: theme.primaryColor.withOpacity(0.05),
splashColor: theme.primaryColor.withOpacity(0.12),
highlightColor: Colors.transparent,
onPressed: onTap,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(6.0),
child: Icon(
category!.icon,
size: 60.0,
color: isDark ? Colors.white : _kFlutterBlue,
),
),
const SizedBox(height: 10.0),
Container(
height: 48.0,
alignment: Alignment.center,
child: Text(
category!.name,
textAlign: TextAlign.center,
style: theme.textTheme.titleMedium!.copyWith(
fontFamily: 'GoogleSans',
color: isDark ? Colors.white : _kFlutterBlue,
),
),
),
],
),
),
);
}
}
class _CategoriesPage extends StatelessWidget {
const _CategoriesPage({
this.categories,
this.onCategoryTap,
});
final Iterable<GalleryDemoCategory>? categories;
final ValueChanged<GalleryDemoCategory>? onCategoryTap;
@override
Widget build(BuildContext context) {
const double aspectRatio = 160.0 / 180.0;
final List<GalleryDemoCategory> categoriesList = categories!.toList();
final int columnCount = (MediaQuery.of(context).orientation == Orientation.portrait) ? 2 : 3;
return Semantics(
scopesRoute: true,
namesRoute: true,
label: 'categories',
explicitChildNodes: true,
child: SingleChildScrollView(
key: const PageStorageKey<String>('categories'),
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
final double columnWidth = constraints.biggest.width / columnCount.toDouble();
final double rowHeight = math.min(225.0, columnWidth * aspectRatio);
final int rowCount = (categories!.length + columnCount - 1) ~/ columnCount;
// This repaint boundary prevents the inner contents of the front layer
// from repainting when the backdrop toggle triggers a repaint on the
// LayoutBuilder.
return RepaintBoundary(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: List<Widget>.generate(rowCount, (int rowIndex) {
final int columnCountForRow = rowIndex == rowCount - 1
? categories!.length - columnCount * math.max<int>(0, rowCount - 1)
: columnCount;
return Row(
children: List<Widget>.generate(columnCountForRow, (int columnIndex) {
final int index = rowIndex * columnCount + columnIndex;
final GalleryDemoCategory category = categoriesList[index];
return SizedBox(
width: columnWidth,
height: rowHeight,
child: _CategoryItem(
category: category,
onTap: () {
onCategoryTap!(category);
},
),
);
}),
);
}),
),
);
},
),
),
);
}
}
class _DemoItem extends StatelessWidget {
const _DemoItem({ this.demo });
final GalleryDemo? demo;
void _launchDemo(BuildContext context) {
if (demo != null) {
Timeline.instantSync('Start Transition', arguments: <String, String>{
'from': '/',
'to': demo!.routeName,
});
Navigator.pushNamed(context, demo!.routeName);
}
}
@override
Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
final bool isDark = theme.brightness == Brightness.dark;
// The fontSize to use for computing the heuristic UI scaling factor.
const double defaultFontSize = 14.0;
final double containerScalingFactor = MediaQuery.textScalerOf(context).scale(defaultFontSize) / defaultFontSize;
return RawMaterialButton(
splashColor: theme.primaryColor.withOpacity(0.12),
highlightColor: Colors.transparent,
onPressed: () {
_launchDemo(context);
},
child: Container(
constraints: BoxConstraints(minHeight: _kDemoItemHeight * containerScalingFactor),
child: Row(
children: <Widget>[
Container(
width: 56.0,
height: 56.0,
alignment: Alignment.center,
child: Icon(
demo!.icon,
size: 24.0,
color: isDark ? Colors.white : _kFlutterBlue,
),
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Text(
demo!.title,
style: theme.textTheme.titleMedium!.copyWith(
color: isDark ? Colors.white : const Color(0xFF202124),
),
),
if (demo!.subtitle != null)
Text(
demo!.subtitle!,
style: theme.textTheme.bodyMedium!.copyWith(
color: isDark ? Colors.white : const Color(0xFF60646B)
),
),
],
),
),
const SizedBox(width: 44.0),
],
),
),
);
}
}
class _DemosPage extends StatelessWidget {
const _DemosPage(this.category);
final GalleryDemoCategory? category;
@override
Widget build(BuildContext context) {
// When overriding ListView.padding, it is necessary to manually handle
// safe areas.
final double windowBottomPadding = MediaQuery.of(context).padding.bottom;
return KeyedSubtree(
key: const ValueKey<String>('GalleryDemoList'), // So the tests can find this ListView
child: Semantics(
scopesRoute: true,
namesRoute: true,
label: category!.name,
explicitChildNodes: true,
child: ListView(
dragStartBehavior: DragStartBehavior.down,
key: PageStorageKey<String>(category!.name),
padding: EdgeInsets.only(top: 8.0, bottom: windowBottomPadding),
children: kGalleryCategoryToDemos[category!]!.map<Widget>((GalleryDemo demo) {
return _DemoItem(demo: demo);
}).toList(),
),
),
);
}
}
class GalleryHome extends StatefulWidget {
const GalleryHome({
super.key,
this.testMode = false,
this.optionsPage,
});
final Widget? optionsPage;
final bool testMode;
// In checked mode our MaterialApp will show the default "debug" banner.
// Otherwise show the "preview" banner.
static bool showPreviewBanner = true;
@override
State<GalleryHome> createState() => _GalleryHomeState();
}
class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStateMixin {
static final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
late AnimationController _controller;
GalleryDemoCategory? _category;
static Widget _topHomeLayout(Widget? currentChild, List<Widget> previousChildren) {
return Stack(
alignment: Alignment.topCenter,
children: <Widget>[
...previousChildren,
if (currentChild != null) currentChild,
],
);
}
static const AnimatedSwitcherLayoutBuilder _centerHomeLayout = AnimatedSwitcher.defaultLayoutBuilder;
@override
void initState() {
super.initState();
_controller = AnimationController(
duration: const Duration(milliseconds: 600),
debugLabel: 'preview banner',
vsync: this,
)..forward();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
final bool isDark = theme.brightness == Brightness.dark;
final MediaQueryData media = MediaQuery.of(context);
final bool centerHome = media.orientation == Orientation.portrait && media.size.height < 800.0;
const Curve switchOutCurve = Interval(0.4, 1.0, curve: Curves.fastOutSlowIn);
const Curve switchInCurve = Interval(0.4, 1.0, curve: Curves.fastOutSlowIn);
Widget home = Scaffold(
key: _scaffoldKey,
backgroundColor: isDark ? _kFlutterBlue : theme.primaryColor,
body: SafeArea(
bottom: false,
child: PopScope(
canPop: _category == null,
onPopInvoked: (bool didPop) {
if (didPop) {
return;
}
// Pop the category page if Android back button is pressed.
setState(() => _category = null);
},
child: Backdrop(
backTitle: const Text('Options'),
backLayer: widget.optionsPage,
frontAction: AnimatedSwitcher(
duration: _kFrontLayerSwitchDuration,
switchOutCurve: switchOutCurve,
switchInCurve: switchInCurve,
child: _category == null
? const _FlutterLogo()
: IconButton(
icon: const BackButtonIcon(),
tooltip: 'Back',
onPressed: () => setState(() => _category = null),
),
),
frontTitle: AnimatedSwitcher(
duration: _kFrontLayerSwitchDuration,
child: _category == null
? const Text('Flutter gallery')
: Text(_category!.name),
),
frontHeading: widget.testMode ? null : Container(height: 24.0),
frontLayer: AnimatedSwitcher(
duration: _kFrontLayerSwitchDuration,
switchOutCurve: switchOutCurve,
switchInCurve: switchInCurve,
layoutBuilder: centerHome ? _centerHomeLayout : _topHomeLayout,
child: _category != null
? _DemosPage(_category)
: _CategoriesPage(
categories: kAllGalleryDemoCategories,
onCategoryTap: (GalleryDemoCategory category) {
setState(() => _category = category);
},
),
),
),
),
),
);
assert(() {
GalleryHome.showPreviewBanner = false;
return true;
}());
if (GalleryHome.showPreviewBanner) {
home = Stack(
fit: StackFit.expand,
children: <Widget>[
home,
FadeTransition(
opacity: CurvedAnimation(parent: _controller, curve: Curves.easeInOut),
child: const Banner(
message: 'PREVIEW',
location: BannerLocation.topEnd,
),
),
],
);
}
home = AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light,
child: home,
);
return home;
}
}
| flutter/dev/integration_tests/flutter_gallery/lib/gallery/home.dart/0 | {
"file_path": "flutter/dev/integration_tests/flutter_gallery/lib/gallery/home.dart",
"repo_id": "flutter",
"token_count": 5941
} | 519 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gallery/demo/cupertino/cupertino_navigation_demo.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Navigation demo golden', (WidgetTester tester) async {
// The point is to mainly test the cupertino icons that we don't have a
// dependency against in the flutter/cupertino package directly.
final Future<ByteData> font = rootBundle.load(
'packages/cupertino_icons/assets/CupertinoIcons.ttf'
);
await (FontLoader('packages/cupertino_icons/CupertinoIcons')..addFont(font))
.load();
await tester.pumpWidget(CupertinoApp(
home: CupertinoNavigationDemo(randomSeed: 123456),
));
await expectLater(
find.byType(CupertinoNavigationDemo),
matchesGoldenFile('cupertino_navigation_demo.screen.1.png'),
);
await tester.pump(); // Need a new frame after loading fonts to refresh layout.
// Tap some row to go to the next page.
await tester.tap(find.text('Buy this cool color').first);
await tester.pump();
await tester.pump(const Duration(milliseconds: 600));
await expectLater(
find.byType(CupertinoNavigationDemo),
matchesGoldenFile('cupertino_navigation_demo.screen.2.png'),
);
});
}
| flutter/dev/integration_tests/flutter_gallery/test/demo/cupertino/cupertino_navigation_demo_test.dart/0 | {
"file_path": "flutter/dev/integration_tests/flutter_gallery/test/demo/cupertino/cupertino_navigation_demo_test.dart",
"repo_id": "flutter",
"token_count": 528
} | 520 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// See //dev/devicelab/bin/tasks/flutter_gallery__memory_nav.dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_gallery/gallery/app.dart' show GalleryApp;
import 'package:flutter_test/flutter_test.dart';
Future<void> endOfAnimation() async {
do {
await SchedulerBinding.instance.endOfFrame;
} while (SchedulerBinding.instance.hasScheduledFrame);
}
Rect boundsFor(WidgetController controller, Finder item) {
final RenderBox box = controller.renderObject<RenderBox>(item);
return box.localToGlobal(Offset.zero) & box.size;
}
Future<void> main() async {
final Completer<void> ready = Completer<void>();
runApp(GestureDetector(
onTap: () {
debugPrint('Received tap.');
ready.complete();
},
behavior: HitTestBehavior.opaque,
child: const IgnorePointer(
child: GalleryApp(testMode: true),
),
));
await SchedulerBinding.instance.endOfFrame;
await Future<void>.delayed(const Duration(milliseconds: 50));
debugPrint('==== MEMORY BENCHMARK ==== READY ====');
await ready.future;
debugPrint('Continuing...');
// remove onTap handler, enable pointer events for app
runApp(GestureDetector(
child: const IgnorePointer(
ignoring: false,
child: GalleryApp(testMode: true),
),
));
await SchedulerBinding.instance.endOfFrame;
final WidgetController controller = LiveWidgetController(WidgetsBinding.instance);
debugPrint('Navigating...');
await controller.tap(find.text('Material'));
await Future<void>.delayed(const Duration(milliseconds: 150));
final Finder demoList = find.byKey(const Key('GalleryDemoList'));
final Finder demoItem = find.text('Text fields');
do {
await controller.drag(demoList, const Offset(0.0, -300.0));
await Future<void>.delayed(const Duration(milliseconds: 20));
} while (!demoItem.tryEvaluate());
// Ensure that the center of the "Text fields" item is visible
// because that's where we're going to tap
final Rect demoItemBounds = boundsFor(controller, demoItem);
final Rect demoListBounds = boundsFor(controller, demoList);
if (!demoListBounds.contains(demoItemBounds.center)) {
await controller.drag(demoList, Offset(0.0, demoListBounds.center.dy - demoItemBounds.center.dy));
await endOfAnimation();
}
for (int iteration = 0; iteration < 15; iteration += 1) {
debugPrint('Tapping... (iteration $iteration)');
await controller.tap(demoItem);
await endOfAnimation();
debugPrint('Backing out...');
await controller.tap(find.byTooltip('Back'));
await endOfAnimation();
await Future<void>.delayed(const Duration(milliseconds: 50));
}
debugPrint('==== MEMORY BENCHMARK ==== DONE ====');
}
| flutter/dev/integration_tests/flutter_gallery/test_memory/memory_nav.dart/0 | {
"file_path": "flutter/dev/integration_tests/flutter_gallery/test_memory/memory_nav.dart",
"repo_id": "flutter",
"token_count": 968
} | 521 |
# iOS Add2App Life Cycle Test
This application demonstrates some basic functionality for Add2App,
along with a native iOS ViewController as a baseline and to demonstrate
interaction.
The following functionality is currently implemented:
1. A regular iOS view controller (UIViewController), similar to the default
`flutter create` template (NativeViewController.m).
1. A FlutterViewController subclass that takes over the full screen. Demos showing
this both from a cold/fresh engine state and a warm engine state
(FullScreenViewController.m).
1. A demo of pushing a FlutterViewController on as a child view.
1. A demo of showing both the native and the Flutter views using a platform
channel to interact with each other (HybridViewController.m).
1. A demo of showing two FlutterViewControllers simultaneously
(DualViewController.m).
A few key things are tested here (IntegrationTests.m):
1. The ability to pre-warm the engine and attach/detach a ViewController from
it.
1. The ability to use platform channels to communicate between views.
1. The ability to simultaneously run two instances of the engine.
1. That a FlutterViewController can be freed when no longer in use (also tested
from FlutterViewControllerTests.m).
1. That a FlutterEngine can be freed when no longer in use. | flutter/dev/integration_tests/ios_add2app_life_cycle/README.md/0 | {
"file_path": "flutter/dev/integration_tests/ios_add2app_life_cycle/README.md",
"repo_id": "flutter",
"token_count": 328
} | 522 |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>watch Extension</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>WKAppBundleIdentifier</key>
<string>$(APP_BUNDLE_IDENTIFIER).watchkitapp</string>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.watchkit</string>
</dict>
<key>WKExtensionDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).ExtensionDelegate</string>
</dict>
</plist>
| flutter/dev/integration_tests/ios_app_with_extensions/ios/watch Extension/Info.plist/0 | {
"file_path": "flutter/dev/integration_tests/ios_app_with_extensions/ios/watch Extension/Info.plist",
"repo_id": "flutter",
"token_count": 498
} | 523 |
platform :ios, '12.0'
flutter_application_path = '../hello'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
target 'Host' do
install_all_flutter_pods flutter_application_path
end
post_install do |installer|
flutter_post_install(installer)
end
| flutter/dev/integration_tests/ios_host_app_swift/Podfile/0 | {
"file_path": "flutter/dev/integration_tests/ios_host_app_swift/Podfile",
"repo_id": "flutter",
"token_count": 100
} | 524 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_driver/driver_extension.dart';
void main() {
// enableFlutterDriverExtension() will disable keyboard,
// which is required for flutter_driver tests
// But breaks the XCUITests
if (const bool.fromEnvironment('ENABLE_DRIVER_EXTENSION')) {
enableFlutterDriverExtension();
}
runApp(const MyApp());
}
/// The main app entrance of the test
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
/// A page with several buttons in the center.
///
/// On press the button, a page with platform view should be pushed into the scene.
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, this.title});
final String? title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title ?? ''),
),
body: Column(children: <Widget>[
TextButton(
key: const ValueKey<String>('platform_view_button'),
child: const Text('show platform view'),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute<MergeThreadTestPage>(
builder: (BuildContext context) => const MergeThreadTestPage()),
);
},
),
// Push this button to perform an animation, which ensure the threads are unmerged after the animation.
ElevatedButton(
key: const ValueKey<String>('unmerge_button'),
child: const Text('Tap to unmerge threads'),
onPressed: () {},
),
TextButton(
key: const ValueKey<String>('platform_view_focus_test'),
child: const Text('platform view focus test'),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute<FocusTestPage>(
builder: (BuildContext context) => const FocusTestPage()),
);
},
),
TextButton(
key: const ValueKey<String>('platform_view_z_order_test'),
child: const Text('platform view z order test'),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute<ZOrderTestPage>(
builder: (BuildContext context) => const ZOrderTestPage()),
);
},
),
]),
);
}
}
/// A page to test thread merge for platform view.
class MergeThreadTestPage extends StatelessWidget {
const MergeThreadTestPage({super.key});
static Key button = const ValueKey<String>('plus_button');
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Platform View Thread Merge Tests'),
),
body: Column(
children: <Widget>[
const Expanded(
child: SizedBox(
width: 300,
child: UiKitView(viewType: 'platform_view'),
),
),
ElevatedButton(
key: button,
child: const Text('button'),
onPressed: (){},
),
],
),
);
}
}
/// A page to test platform view focus.
class FocusTestPage extends StatefulWidget {
const FocusTestPage({super.key});
@override
State<FocusTestPage> createState() => _FocusTestPageState();
}
class _FocusTestPageState extends State<FocusTestPage> {
late TextEditingController _controller;
@override
void initState() {
super.initState();
_controller = TextEditingController();
_controller.text = 'Flutter Text Field';
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Platform View Focus Tests'),
),
body: Column(
children: <Widget>[
const SizedBox(
width: 300,
height: 50,
child: UiKitView(viewType: 'platform_text_field'),
),
TextField(
controller: _controller,
),
],
),
);
}
}
/// A page to test a platform view in an alert dialog prompt is still tappable.
/// See [this issue](https://github.com/flutter/flutter/issues/118366).
class ZOrderTestPage extends StatefulWidget {
const ZOrderTestPage({super.key});
@override
State<ZOrderTestPage> createState() => _ZOrderTestPageState();
}
class _ZOrderTestPageState extends State<ZOrderTestPage> {
bool _showBackground = false;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Platform view z order test'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Visibility(
visible: _showBackground,
child: const SizedBox(
width: 500,
height: 500,
child: UiKitView(
viewType: 'platform_view',
creationParamsCodec: StandardMessageCodec(),
),
)),
TextButton(
onPressed: () {
showDialog<void>(
context: context,
builder: (BuildContext context) {
return const SizedBox(
width: 250,
height: 250,
child: UiKitView(
viewType: 'platform_button',
creationParamsCodec: StandardMessageCodec(),
),
);
});
// XCUITest fails to query the background platform view,
// Since it is covered by the dialog prompt, which removes
// semantic nodes underneath.
// As a workaround, we show the background with a delay.
Future<void>.delayed(const Duration(seconds: 1)).then((void value) {
setState(() {
_showBackground = true;
});
});
},
child: const Text('Show Alert')),
],
),
),
);
}
}
| flutter/dev/integration_tests/ios_platform_view_tests/lib/main.dart/0 | {
"file_path": "flutter/dev/integration_tests/ios_platform_view_tests/lib/main.dart",
"repo_id": "flutter",
"token_count": 3114
} | 525 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:animations/animations.dart';
import 'package:flutter/material.dart';
import '../../gallery_localizations.dart';
// BEGIN openContainerTransformDemo
const String _loremIpsumParagraph =
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod '
'tempor incididunt ut labore et dolore magna aliqua. Vulputate dignissim '
'suspendisse in est. Ut ornare lectus sit amet. Eget nunc lobortis mattis '
'aliquam faucibus purus in. Hendrerit gravida rutrum quisque non tellus '
'orci ac auctor. Mattis aliquam faucibus purus in massa. Tellus rutrum '
'tellus pellentesque eu tincidunt tortor. Nunc eget lorem dolor sed. Nulla '
'at volutpat diam ut venenatis tellus in metus. Tellus cras adipiscing enim '
'eu turpis. Pretium fusce id velit ut tortor. Adipiscing enim eu turpis '
'egestas pretium. Quis varius quam quisque id. Blandit aliquam etiam erat '
'velit scelerisque. In nisl nisi scelerisque eu. Semper risus in hendrerit '
'gravida rutrum quisque. Suspendisse in est ante in nibh mauris cursus '
'mattis molestie. Adipiscing elit duis tristique sollicitudin nibh sit '
'amet commodo nulla. Pretium viverra suspendisse potenti nullam ac tortor '
'vitae.\n'
'\n'
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod '
'tempor incididunt ut labore et dolore magna aliqua. Vulputate dignissim '
'suspendisse in est. Ut ornare lectus sit amet. Eget nunc lobortis mattis '
'aliquam faucibus purus in. Hendrerit gravida rutrum quisque non tellus '
'orci ac auctor. Mattis aliquam faucibus purus in massa. Tellus rutrum '
'tellus pellentesque eu tincidunt tortor. Nunc eget lorem dolor sed. Nulla '
'at volutpat diam ut venenatis tellus in metus. Tellus cras adipiscing enim '
'eu turpis. Pretium fusce id velit ut tortor. Adipiscing enim eu turpis '
'egestas pretium. Quis varius quam quisque id. Blandit aliquam etiam erat '
'velit scelerisque. In nisl nisi scelerisque eu. Semper risus in hendrerit '
'gravida rutrum quisque. Suspendisse in est ante in nibh mauris cursus '
'mattis molestie. Adipiscing elit duis tristique sollicitudin nibh sit '
'amet commodo nulla. Pretium viverra suspendisse potenti nullam ac tortor '
'vitae';
const double _fabDimension = 56;
class OpenContainerTransformDemo extends StatefulWidget {
const OpenContainerTransformDemo({super.key});
@override
State<OpenContainerTransformDemo> createState() =>
_OpenContainerTransformDemoState();
}
class _OpenContainerTransformDemoState
extends State<OpenContainerTransformDemo> {
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
ContainerTransitionType _transitionType = ContainerTransitionType.fade;
void _showSettingsBottomModalSheet(BuildContext context) {
final GalleryLocalizations? localizations = GalleryLocalizations.of(context);
showModalBottomSheet<void>(
context: context,
builder: (BuildContext context) {
return StatefulBuilder(
builder: (BuildContext context, void Function(void Function()) setModalState) {
return Container(
height: 125,
padding: const EdgeInsets.all(15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
localizations!.demoContainerTransformModalBottomSheetTitle,
style: Theme.of(context).textTheme.bodySmall,
),
const SizedBox(
height: 12,
),
ToggleButtons(
borderRadius: BorderRadius.circular(2),
selectedBorderColor: Theme.of(context).colorScheme.primary,
onPressed: (int index) {
setModalState(() {
setState(() {
_transitionType = index == 0
? ContainerTransitionType.fade
: ContainerTransitionType.fadeThrough;
});
});
},
isSelected: <bool>[
_transitionType == ContainerTransitionType.fade,
_transitionType == ContainerTransitionType.fadeThrough,
],
children: <Widget>[
Text(
localizations.demoContainerTransformTypeFade,
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
),
child: Text(
localizations.demoContainerTransformTypeFadeThrough,
),
),
],
),
],
),
);
},
);
},
);
}
@override
Widget build(BuildContext context) {
final GalleryLocalizations? localizations = GalleryLocalizations.of(context);
final ColorScheme colorScheme = Theme.of(context).colorScheme;
return Navigator(
// Adding [ValueKey] to make sure that the widget gets rebuilt when
// changing type.
key: ValueKey<ContainerTransitionType>(_transitionType),
onGenerateRoute: (RouteSettings settings) {
return MaterialPageRoute<void>(
builder: (BuildContext context) => Scaffold(
key: _scaffoldKey,
appBar: AppBar(
automaticallyImplyLeading: false,
title: Column(
children: <Widget>[
Text(
localizations!.demoContainerTransformTitle,
),
Text(
'(${localizations.demoContainerTransformDemoInstructions})',
style: Theme.of(context)
.textTheme
.titleSmall!
.copyWith(color: Colors.white),
),
],
),
actions: <Widget>[
IconButton(
icon: const Icon(
Icons.settings,
),
onPressed: () {
_showSettingsBottomModalSheet(context);
},
),
],
),
body: ListView(
padding: const EdgeInsets.all(8),
children: <Widget>[
_OpenContainerWrapper(
transitionType: _transitionType,
closedBuilder: (BuildContext context, void Function() openContainer) {
return _DetailsCard(openContainer: openContainer);
},
),
const SizedBox(height: 16),
_OpenContainerWrapper(
transitionType: _transitionType,
closedBuilder: (BuildContext context, void Function() openContainer) {
return _DetailsListTile(openContainer: openContainer);
},
),
const SizedBox(
height: 16,
),
Row(
children: <Widget>[
Expanded(
child: _OpenContainerWrapper(
transitionType: _transitionType,
closedBuilder: (BuildContext context, void Function() openContainer) {
return _SmallDetailsCard(
openContainer: openContainer,
subtitle:
localizations.demoMotionPlaceholderSubtitle,
);
},
),
),
const SizedBox(
width: 8,
),
Expanded(
child: _OpenContainerWrapper(
transitionType: _transitionType,
closedBuilder: (BuildContext context, void Function() openContainer) {
return _SmallDetailsCard(
openContainer: openContainer,
subtitle:
localizations.demoMotionPlaceholderSubtitle,
);
},
),
),
],
),
const SizedBox(
height: 16,
),
Row(
children: <Widget>[
Expanded(
child: _OpenContainerWrapper(
transitionType: _transitionType,
closedBuilder: (BuildContext context, void Function() openContainer) {
return _SmallDetailsCard(
openContainer: openContainer,
subtitle: localizations
.demoMotionSmallPlaceholderSubtitle,
);
},
),
),
const SizedBox(
width: 8,
),
Expanded(
child: _OpenContainerWrapper(
transitionType: _transitionType,
closedBuilder: (BuildContext context, void Function() openContainer) {
return _SmallDetailsCard(
openContainer: openContainer,
subtitle: localizations
.demoMotionSmallPlaceholderSubtitle,
);
},
),
),
const SizedBox(
width: 8,
),
Expanded(
child: _OpenContainerWrapper(
transitionType: _transitionType,
closedBuilder: (BuildContext context, void Function() openContainer) {
return _SmallDetailsCard(
openContainer: openContainer,
subtitle: localizations
.demoMotionSmallPlaceholderSubtitle,
);
},
),
),
],
),
const SizedBox(
height: 16,
),
...List<OpenContainer<bool>>.generate(10, (int index) {
return OpenContainer<bool>(
transitionType: _transitionType,
openBuilder: (BuildContext context, void Function() openContainer) =>
const _DetailsPage(),
tappable: false,
closedShape: const RoundedRectangleBorder(),
closedElevation: 0,
closedBuilder: (BuildContext context, void Function() openContainer) {
return ListTile(
leading: Image.asset(
'placeholders/avatar_logo.png',
package: 'flutter_gallery_assets',
width: 40,
),
onTap: openContainer,
title: Text(
'${localizations.demoMotionListTileTitle} ${index + 1}',
),
subtitle: Text(
localizations.demoMotionPlaceholderSubtitle,
),
);
},
);
}),
],
),
floatingActionButton: OpenContainer(
transitionType: _transitionType,
openBuilder: (BuildContext context, void Function() openContainer) => const _DetailsPage(),
closedElevation: 6,
closedShape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(_fabDimension / 2),
),
),
closedColor: colorScheme.secondary,
closedBuilder: (BuildContext context, void Function() openContainer) {
return SizedBox(
height: _fabDimension,
width: _fabDimension,
child: Center(
child: Icon(
Icons.add,
color: colorScheme.onSecondary,
),
),
);
},
),
),
);
},
);
}
}
class _OpenContainerWrapper extends StatelessWidget {
const _OpenContainerWrapper({
required this.closedBuilder,
required this.transitionType,
});
final CloseContainerBuilder closedBuilder;
final ContainerTransitionType transitionType;
@override
Widget build(BuildContext context) {
return OpenContainer<bool>(
transitionType: transitionType,
openBuilder: (BuildContext context, void Function() openContainer) => const _DetailsPage(),
tappable: false,
closedBuilder: closedBuilder,
);
}
}
class _DetailsCard extends StatelessWidget {
const _DetailsCard({required this.openContainer});
final VoidCallback openContainer;
@override
Widget build(BuildContext context) {
final GalleryLocalizations localizations = GalleryLocalizations.of(context)!;
return _InkWellOverlay(
openContainer: openContainer,
height: 300,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
child: ColoredBox(
color: Colors.black38,
child: Center(
child: Image.asset(
'placeholders/placeholder_image.png',
package: 'flutter_gallery_assets',
width: 100,
),
),
),
),
ListTile(
title: Text(
localizations.demoMotionPlaceholderTitle,
),
subtitle: Text(
localizations.demoMotionPlaceholderSubtitle,
),
),
Padding(
padding: const EdgeInsets.only(
left: 16,
right: 16,
bottom: 16,
),
child: Text(
'Lorem ipsum dolor sit amet, consectetur '
'adipiscing elit, sed do eiusmod tempor.',
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
color: Colors.black54,
inherit: false,
),
),
),
],
),
);
}
}
class _SmallDetailsCard extends StatelessWidget {
const _SmallDetailsCard({
required this.openContainer,
required this.subtitle,
});
final VoidCallback openContainer;
final String subtitle;
@override
Widget build(BuildContext context) {
final TextTheme textTheme = Theme.of(context).textTheme;
return _InkWellOverlay(
openContainer: openContainer,
height: 225,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
color: Colors.black38,
height: 150,
child: Center(
child: Image.asset(
'placeholders/placeholder_image.png',
package: 'flutter_gallery_assets',
width: 80,
),
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
GalleryLocalizations.of(context)!
.demoMotionPlaceholderTitle,
style: textTheme.titleLarge,
),
const SizedBox(
height: 4,
),
Text(
subtitle,
style: textTheme.bodySmall,
),
],
),
),
),
],
),
);
}
}
class _DetailsListTile extends StatelessWidget {
const _DetailsListTile({required this.openContainer});
final VoidCallback openContainer;
@override
Widget build(BuildContext context) {
final TextTheme textTheme = Theme.of(context).textTheme;
const double height = 120.0;
return _InkWellOverlay(
openContainer: openContainer,
height: height,
child: Row(
children: <Widget>[
Container(
color: Colors.black38,
height: height,
width: height,
child: Center(
child: Image.asset(
'placeholders/placeholder_image.png',
package: 'flutter_gallery_assets',
width: 60,
),
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
GalleryLocalizations.of(context)!
.demoMotionPlaceholderTitle,
style: textTheme.titleMedium,
),
const SizedBox(
height: 8,
),
Text(
'Lorem ipsum dolor sit amet, consectetur '
'adipiscing elit,',
style: textTheme.bodySmall,
),
],
),
),
),
],
),
);
}
}
class _InkWellOverlay extends StatelessWidget {
const _InkWellOverlay({
required this.openContainer,
required this.height,
required this.child,
});
final VoidCallback openContainer;
final double height;
final Widget child;
@override
Widget build(BuildContext context) {
return SizedBox(
height: height,
child: InkWell(
onTap: openContainer,
child: child,
),
);
}
}
class _DetailsPage extends StatelessWidget {
const _DetailsPage();
@override
Widget build(BuildContext context) {
final GalleryLocalizations localizations = GalleryLocalizations.of(context)!;
final TextTheme textTheme = Theme.of(context).textTheme;
return Scaffold(
appBar: AppBar(
title: Text(
localizations.demoMotionDetailsPageTitle,
),
),
body: ListView(
children: <Widget>[
Container(
color: Colors.black38,
height: 250,
child: Padding(
padding: const EdgeInsets.all(70),
child: Image.asset(
'placeholders/placeholder_image.png',
package: 'flutter_gallery_assets',
),
),
),
Padding(
padding: const EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
localizations.demoMotionPlaceholderTitle,
style: textTheme.headlineSmall!.copyWith(
color: Colors.black54,
fontSize: 30,
),
),
const SizedBox(
height: 10,
),
Text(
_loremIpsumParagraph,
style: textTheme.bodyMedium!.copyWith(
color: Colors.black54,
height: 1.5,
fontSize: 16,
),
),
],
),
),
],
),
);
}
}
// END openContainerTransformDemo
| flutter/dev/integration_tests/new_gallery/lib/demos/reference/motion_demo_container_transition.dart/0 | {
"file_path": "flutter/dev/integration_tests/new_gallery/lib/demos/reference/motion_demo_container_transition.dart",
"repo_id": "flutter",
"token_count": 11175
} | 526 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:intl/intl.dart' as intl;
import 'gallery_localizations.dart';
/// The translations for English (`en`).
class GalleryLocalizationsEn extends GalleryLocalizations {
GalleryLocalizationsEn([super.locale = 'en']);
@override
String githubRepo(Object repoName) {
return '$repoName GitHub repository';
}
@override
String aboutDialogDescription(Object repoLink) {
return 'To see the source code for this app, please visit the $repoLink.';
}
@override
String get deselect => 'Deselect';
@override
String get notSelected => 'Not selected';
@override
String get select => 'Select';
@override
String get selectable => 'Selectable (long press)';
@override
String get selected => 'Selected';
@override
String get signIn => 'SIGN IN';
@override
String get bannerDemoText => 'Your password was updated on your other device. Please sign in again.';
@override
String get bannerDemoResetText => 'Reset the banner';
@override
String get bannerDemoMultipleText => 'Multiple actions';
@override
String get bannerDemoLeadingText => 'Leading Icon';
@override
String get dismiss => 'DISMISS';
@override
String get backToGallery => 'Back to Gallery';
@override
String get cardsDemoExplore => 'Explore';
@override
String cardsDemoExploreSemantics(Object destinationName) {
return 'Explore $destinationName';
}
@override
String cardsDemoShareSemantics(Object destinationName) {
return 'Share $destinationName';
}
@override
String get cardsDemoTappable => 'Tappable';
@override
String get cardsDemoTravelDestinationTitle1 => 'Top 10 Cities to Visit in Tamil Nadu';
@override
String get cardsDemoTravelDestinationDescription1 => 'Number 10';
@override
String get cardsDemoTravelDestinationCity1 => 'Thanjavur';
@override
String get cardsDemoTravelDestinationLocation1 => 'Thanjavur, Tamil Nadu';
@override
String get cardsDemoTravelDestinationTitle2 => 'Artisans of Southern India';
@override
String get cardsDemoTravelDestinationDescription2 => 'Silk Spinners';
@override
String get cardsDemoTravelDestinationCity2 => 'Chettinad';
@override
String get cardsDemoTravelDestinationLocation2 => 'Sivaganga, Tamil Nadu';
@override
String get cardsDemoTravelDestinationTitle3 => 'Brihadisvara Temple';
@override
String get cardsDemoTravelDestinationDescription3 => 'Temples';
@override
String get homeHeaderGallery => 'Gallery';
@override
String get homeHeaderCategories => 'Categories';
@override
String get shrineDescription => 'A fashionable retail app';
@override
String get fortnightlyDescription => 'A content-focused news app';
@override
String get rallyDescription => 'A personal finance app';
@override
String get replyDescription => 'An efficient, focused email app';
@override
String get rallyAccountDataChecking => 'Checking';
@override
String get rallyAccountDataHomeSavings => 'Home Savings';
@override
String get rallyAccountDataCarSavings => 'Car Savings';
@override
String get rallyAccountDataVacation => 'Vacation';
@override
String get rallyAccountDetailDataAnnualPercentageYield => 'Annual Percentage Yield';
@override
String get rallyAccountDetailDataInterestRate => 'Interest Rate';
@override
String get rallyAccountDetailDataInterestYtd => 'Interest YTD';
@override
String get rallyAccountDetailDataInterestPaidLastYear => 'Interest Paid Last Year';
@override
String get rallyAccountDetailDataNextStatement => 'Next Statement';
@override
String get rallyAccountDetailDataAccountOwner => 'Account Owner';
@override
String get rallyBillDetailTotalAmount => 'Total Amount';
@override
String get rallyBillDetailAmountPaid => 'Amount Paid';
@override
String get rallyBillDetailAmountDue => 'Amount Due';
@override
String get rallyBudgetCategoryCoffeeShops => 'Coffee Shops';
@override
String get rallyBudgetCategoryGroceries => 'Groceries';
@override
String get rallyBudgetCategoryRestaurants => 'Restaurants';
@override
String get rallyBudgetCategoryClothing => 'Clothing';
@override
String get rallyBudgetDetailTotalCap => 'Total Cap';
@override
String get rallyBudgetDetailAmountUsed => 'Amount Used';
@override
String get rallyBudgetDetailAmountLeft => 'Amount Left';
@override
String get rallySettingsManageAccounts => 'Manage Accounts';
@override
String get rallySettingsTaxDocuments => 'Tax Documents';
@override
String get rallySettingsPasscodeAndTouchId => 'Passcode and Touch ID';
@override
String get rallySettingsNotifications => 'Notifications';
@override
String get rallySettingsPersonalInformation => 'Personal Information';
@override
String get rallySettingsPaperlessSettings => 'Paperless Settings';
@override
String get rallySettingsFindAtms => 'Find ATMs';
@override
String get rallySettingsHelp => 'Help';
@override
String get rallySettingsSignOut => 'Sign out';
@override
String get rallyAccountTotal => 'Total';
@override
String get rallyBillsDue => 'Due';
@override
String get rallyBudgetLeft => 'Left';
@override
String get rallyAccounts => 'Accounts';
@override
String get rallyBills => 'Bills';
@override
String get rallyBudgets => 'Budgets';
@override
String get rallyAlerts => 'Alerts';
@override
String get rallySeeAll => 'SEE ALL';
@override
String get rallyFinanceLeft => ' LEFT';
@override
String get rallyTitleOverview => 'OVERVIEW';
@override
String get rallyTitleAccounts => 'ACCOUNTS';
@override
String get rallyTitleBills => 'BILLS';
@override
String get rallyTitleBudgets => 'BUDGETS';
@override
String get rallyTitleSettings => 'SETTINGS';
@override
String get rallyLoginLoginToRally => 'Login to Rally';
@override
String get rallyLoginNoAccount => "Don't have an account?";
@override
String get rallyLoginSignUp => 'SIGN UP';
@override
String get rallyLoginUsername => 'Username';
@override
String get rallyLoginPassword => 'Password';
@override
String get rallyLoginLabelLogin => 'Login';
@override
String get rallyLoginRememberMe => 'Remember Me';
@override
String get rallyLoginButtonLogin => 'LOGIN';
@override
String rallyAlertsMessageHeadsUpShopping(Object percent) {
return "Heads up, you've used up $percent of your Shopping budget for this month.";
}
@override
String rallyAlertsMessageSpentOnRestaurants(Object amount) {
return "You've spent $amount on Restaurants this week.";
}
@override
String rallyAlertsMessageATMFees(Object amount) {
return "You've spent $amount in ATM fees this month";
}
@override
String rallyAlertsMessageCheckingAccount(Object percent) {
return 'Good work! Your checking account is $percent higher than last month.';
}
@override
String rallyAlertsMessageUnassignedTransactions(num count) {
final String temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'Increase your potential tax deduction! Assign categories to $count unassigned transactions.',
one: 'Increase your potential tax deduction! Assign categories to 1 unassigned transaction.',
);
return temp0;
}
@override
String get rallySeeAllAccounts => 'See all accounts';
@override
String get rallySeeAllBills => 'See all bills';
@override
String get rallySeeAllBudgets => 'See all budgets';
@override
String rallyAccountAmount(Object accountName, Object accountNumber, Object amount) {
return '$accountName account $accountNumber with $amount.';
}
@override
String rallyBillAmount(Object billName, Object date, Object amount) {
return '$billName bill due $date for $amount.';
}
@override
String rallyBudgetAmount(Object budgetName, Object amountUsed, Object amountTotal, Object amountLeft) {
return '$budgetName budget with $amountUsed used of $amountTotal, $amountLeft left';
}
@override
String get craneDescription => 'A personalized travel app';
@override
String get homeCategoryReference => 'STYLES & OTHER';
@override
String get demoInvalidURL => "Couldn't display URL:";
@override
String get demoOptionsTooltip => 'Options';
@override
String get demoInfoTooltip => 'Info';
@override
String get demoCodeTooltip => 'Demo Code';
@override
String get demoDocumentationTooltip => 'API Documentation';
@override
String get demoFullscreenTooltip => 'Full Screen';
@override
String get demoCodeViewerCopyAll => 'COPY ALL';
@override
String get demoCodeViewerCopiedToClipboardMessage => 'Copied to clipboard.';
@override
String demoCodeViewerFailedToCopyToClipboardMessage(Object error) {
return 'Failed to copy to clipboard: $error';
}
@override
String get demoOptionsFeatureTitle => 'View options';
@override
String get demoOptionsFeatureDescription => 'Tap here to view available options for this demo.';
@override
String get settingsTitle => 'Settings';
@override
String get settingsButtonLabel => 'Settings';
@override
String get settingsButtonCloseLabel => 'Close settings';
@override
String get settingsSystemDefault => 'System';
@override
String get settingsTextScaling => 'Text scaling';
@override
String get settingsTextScalingSmall => 'Small';
@override
String get settingsTextScalingNormal => 'Normal';
@override
String get settingsTextScalingLarge => 'Large';
@override
String get settingsTextScalingHuge => 'Huge';
@override
String get settingsTextDirection => 'Text direction';
@override
String get settingsTextDirectionLocaleBased => 'Based on locale';
@override
String get settingsTextDirectionLTR => 'LTR';
@override
String get settingsTextDirectionRTL => 'RTL';
@override
String get settingsLocale => 'Locale';
@override
String get settingsPlatformMechanics => 'Platform mechanics';
@override
String get settingsTheme => 'Theme';
@override
String get settingsDarkTheme => 'Dark';
@override
String get settingsLightTheme => 'Light';
@override
String get settingsSlowMotion => 'Slow motion';
@override
String get settingsAbout => 'About Flutter Gallery';
@override
String get settingsFeedback => 'Send feedback';
@override
String get settingsAttribution => 'Designed by TOASTER in London';
@override
String get demoAppBarTitle => 'App bar';
@override
String get demoAppBarSubtitle => 'Displays information and actions relating to the current screen';
@override
String get demoAppBarDescription => "The App bar provides content and actions related to the current screen. It's used for branding, screen titles, navigation, and actions";
@override
String get demoBottomAppBarTitle => 'Bottom app bar';
@override
String get demoBottomAppBarSubtitle => 'Displays navigation and actions at the bottom';
@override
String get demoBottomAppBarDescription => 'Bottom app bars provide access to a bottom navigation drawer and up to four actions, including the floating action button.';
@override
String get bottomAppBarNotch => 'Notch';
@override
String get bottomAppBarPosition => 'Floating Action Button Position';
@override
String get bottomAppBarPositionDockedEnd => 'Docked - End';
@override
String get bottomAppBarPositionDockedCenter => 'Docked - Center';
@override
String get bottomAppBarPositionFloatingEnd => 'Floating - End';
@override
String get bottomAppBarPositionFloatingCenter => 'Floating - Center';
@override
String get demoBannerTitle => 'Banner';
@override
String get demoBannerSubtitle => 'Displaying a banner within a list';
@override
String get demoBannerDescription => 'A banner displays an important, succinct message, and provides actions for users to address (or dismiss the banner). A user action is required for it to be dismissed.';
@override
String get demoBottomNavigationTitle => 'Bottom navigation';
@override
String get demoBottomNavigationSubtitle => 'Bottom navigation with cross-fading views';
@override
String get demoBottomNavigationPersistentLabels => 'Persistent labels';
@override
String get demoBottomNavigationSelectedLabel => 'Selected label';
@override
String get demoBottomNavigationDescription => 'Bottom navigation bars display three to five destinations at the bottom of a screen. Each destination is represented by an icon and an optional text label. When a bottom navigation icon is tapped, the user is taken to the top-level navigation destination associated with that icon.';
@override
String get demoButtonTitle => 'Buttons';
@override
String get demoButtonSubtitle => 'Text, elevated, outlined, and more';
@override
String get demoTextButtonTitle => 'Text Button';
@override
String get demoTextButtonDescription => 'A text button displays an ink splash on press but does not lift. Use text buttons on toolbars, in dialogs and inline with padding';
@override
String get demoElevatedButtonTitle => 'Elevated Button';
@override
String get demoElevatedButtonDescription => 'Elevated buttons add dimension to mostly flat layouts. They emphasize functions on busy or wide spaces.';
@override
String get demoOutlinedButtonTitle => 'Outlined Button';
@override
String get demoOutlinedButtonDescription => 'Outlined buttons become opaque and elevate when pressed. They are often paired with raised buttons to indicate an alternative, secondary action.';
@override
String get demoToggleButtonTitle => 'Toggle Buttons';
@override
String get demoToggleButtonDescription => 'Toggle buttons can be used to group related options. To emphasize groups of related toggle buttons, a group should share a common container';
@override
String get demoFloatingButtonTitle => 'Floating Action Button';
@override
String get demoFloatingButtonDescription => 'A floating action button is a circular icon button that hovers over content to promote a primary action in the application.';
@override
String get demoCardTitle => 'Cards';
@override
String get demoCardSubtitle => 'Baseline cards with rounded corners';
@override
String get demoChipTitle => 'Chips';
@override
String get demoCardDescription => 'A card is a sheet of Material used to represent some related information, for example an album, a geographical location, a meal, contact details, etc.';
@override
String get demoChipSubtitle => 'Compact elements that represent an input, attribute, or action';
@override
String get demoActionChipTitle => 'Action Chip';
@override
String get demoActionChipDescription => 'Action chips are a set of options which trigger an action related to primary content. Action chips should appear dynamically and contextually in a UI.';
@override
String get demoChoiceChipTitle => 'Choice Chip';
@override
String get demoChoiceChipDescription => 'Choice chips represent a single choice from a set. Choice chips contain related descriptive text or categories.';
@override
String get demoFilterChipTitle => 'Filter Chip';
@override
String get demoFilterChipDescription => 'Filter chips use tags or descriptive words as a way to filter content.';
@override
String get demoInputChipTitle => 'Input Chip';
@override
String get demoInputChipDescription => 'Input chips represent a complex piece of information, such as an entity (person, place, or thing) or conversational text, in a compact form.';
@override
String get demoDataTableTitle => 'Data Tables';
@override
String get demoDataTableSubtitle => 'Rows and columns of information';
@override
String get demoDataTableDescription => "Data tables display information in a grid-like format of rows and columns. They organize information in a way that's easy to scan, so that users can look for patterns and insights.";
@override
String get dataTableHeader => 'Nutrition';
@override
String get dataTableColumnDessert => 'Dessert (1 serving)';
@override
String get dataTableColumnCalories => 'Calories';
@override
String get dataTableColumnFat => 'Fat (g)';
@override
String get dataTableColumnCarbs => 'Carbs (g)';
@override
String get dataTableColumnProtein => 'Protein (g)';
@override
String get dataTableColumnSodium => 'Sodium (mg)';
@override
String get dataTableColumnCalcium => 'Calcium (%)';
@override
String get dataTableColumnIron => 'Iron (%)';
@override
String get dataTableRowFrozenYogurt => 'Frozen yogurt';
@override
String get dataTableRowIceCreamSandwich => 'Ice cream sandwich';
@override
String get dataTableRowEclair => 'Eclair';
@override
String get dataTableRowCupcake => 'Cupcake';
@override
String get dataTableRowGingerbread => 'Gingerbread';
@override
String get dataTableRowJellyBean => 'Jelly bean';
@override
String get dataTableRowLollipop => 'Lollipop';
@override
String get dataTableRowHoneycomb => 'Honeycomb';
@override
String get dataTableRowDonut => 'Donut';
@override
String get dataTableRowApplePie => 'Apple pie';
@override
String dataTableRowWithSugar(Object value) {
return '$value with sugar';
}
@override
String dataTableRowWithHoney(Object value) {
return '$value with honey';
}
@override
String get demoDialogTitle => 'Dialogs';
@override
String get demoDialogSubtitle => 'Simple, alert, and fullscreen';
@override
String get demoAlertDialogTitle => 'Alert';
@override
String get demoAlertDialogDescription => 'An alert dialog informs the user about situations that require acknowledgement. An alert dialog has an optional title and an optional list of actions.';
@override
String get demoAlertTitleDialogTitle => 'Alert With Title';
@override
String get demoSimpleDialogTitle => 'Simple';
@override
String get demoSimpleDialogDescription => 'A simple dialog offers the user a choice between several options. A simple dialog has an optional title that is displayed above the choices.';
@override
String get demoDividerTitle => 'Divider';
@override
String get demoDividerSubtitle => 'A divider is a thin line that groups content in lists and layouts.';
@override
String get demoDividerDescription => 'Dividers can be used in lists, drawers, and elsewhere to separate content.';
@override
String get demoVerticalDividerTitle => 'Vertical Divider';
@override
String get demoGridListsTitle => 'Grid Lists';
@override
String get demoGridListsSubtitle => 'Row and column layout';
@override
String get demoGridListsDescription => 'Grid Lists are best suited for presenting homogeneous data, typically images. Each item in a grid list is called a tile.';
@override
String get demoGridListsImageOnlyTitle => 'Image only';
@override
String get demoGridListsHeaderTitle => 'With header';
@override
String get demoGridListsFooterTitle => 'With footer';
@override
String get demoSlidersTitle => 'Sliders';
@override
String get demoSlidersSubtitle => 'Widgets for selecting a value by swiping';
@override
String get demoSlidersDescription => 'Sliders reflect a range of values along a bar, from which users may select a single value. They are ideal for adjusting settings such as volume, brightness, or applying image filters.';
@override
String get demoRangeSlidersTitle => 'Range Sliders';
@override
String get demoRangeSlidersDescription => 'Sliders reflect a range of values along a bar. They can have icons on both ends of the bar that reflect a range of values. They are ideal for adjusting settings such as volume, brightness, or applying image filters.';
@override
String get demoCustomSlidersTitle => 'Custom Sliders';
@override
String get demoCustomSlidersDescription => 'Sliders reflect a range of values along a bar, from which users may select a single value or range of values. The sliders can be themed and customized.';
@override
String get demoSlidersContinuousWithEditableNumericalValue => 'Continuous with Editable Numerical Value';
@override
String get demoSlidersDiscrete => 'Discrete';
@override
String get demoSlidersDiscreteSliderWithCustomTheme => 'Discrete Slider with Custom Theme';
@override
String get demoSlidersContinuousRangeSliderWithCustomTheme => 'Continuous Range Slider with Custom Theme';
@override
String get demoSlidersContinuous => 'Continuous';
@override
String get demoSlidersEditableNumericalValue => 'Editable numerical value';
@override
String get demoMenuTitle => 'Menu';
@override
String get demoContextMenuTitle => 'Context menu';
@override
String get demoSectionedMenuTitle => 'Sectioned menu';
@override
String get demoSimpleMenuTitle => 'Simple menu';
@override
String get demoChecklistMenuTitle => 'Checklist menu';
@override
String get demoMenuSubtitle => 'Menu buttons and simple menus';
@override
String get demoMenuDescription => 'A menu displays a list of choices on a temporary surface. They appear when users interact with a button, action, or other control.';
@override
String get demoMenuItemValueOne => 'Menu item one';
@override
String get demoMenuItemValueTwo => 'Menu item two';
@override
String get demoMenuItemValueThree => 'Menu item three';
@override
String get demoMenuOne => 'One';
@override
String get demoMenuTwo => 'Two';
@override
String get demoMenuThree => 'Three';
@override
String get demoMenuFour => 'Four';
@override
String get demoMenuAnItemWithAContextMenuButton => 'An item with a context menu';
@override
String get demoMenuContextMenuItemOne => 'Context menu item one';
@override
String get demoMenuADisabledMenuItem => 'Disabled menu item';
@override
String get demoMenuContextMenuItemThree => 'Context menu item three';
@override
String get demoMenuAnItemWithASectionedMenu => 'An item with a sectioned menu';
@override
String get demoMenuPreview => 'Preview';
@override
String get demoMenuShare => 'Share';
@override
String get demoMenuGetLink => 'Get link';
@override
String get demoMenuRemove => 'Remove';
@override
String demoMenuSelected(Object value) {
return 'Selected: $value';
}
@override
String demoMenuChecked(Object value) {
return 'Checked: $value';
}
@override
String get demoNavigationDrawerTitle => 'Navigation Drawer';
@override
String get demoNavigationDrawerSubtitle => 'Displaying a drawer within appbar';
@override
String get demoNavigationDrawerDescription => 'A Material Design panel that slides in horizontally from the edge of the screen to show navigation links in an application.';
@override
String get demoNavigationDrawerUserName => 'User Name';
@override
String get demoNavigationDrawerUserEmail => '[email protected]';
@override
String get demoNavigationDrawerToPageOne => 'Item One';
@override
String get demoNavigationDrawerToPageTwo => 'Item Two';
@override
String get demoNavigationDrawerText => 'Swipe from the edge or tap the upper-left icon to see the drawer';
@override
String get demoNavigationRailTitle => 'Navigation Rail';
@override
String get demoNavigationRailSubtitle => 'Displaying a Navigation Rail within an app';
@override
String get demoNavigationRailDescription => 'A material widget that is meant to be displayed at the left or right of an app to navigate between a small number of views, typically between three and five.';
@override
String get demoNavigationRailFirst => 'First';
@override
String get demoNavigationRailSecond => 'Second';
@override
String get demoNavigationRailThird => 'Third';
@override
String get demoMenuAnItemWithASimpleMenu => 'An item with a simple menu';
@override
String get demoMenuAnItemWithAChecklistMenu => 'An item with a checklist menu';
@override
String get demoFullscreenDialogTitle => 'Fullscreen';
@override
String get demoFullscreenDialogDescription => 'The fullscreenDialog property specifies whether the incoming page is a fullscreen modal dialog';
@override
String get demoCupertinoActivityIndicatorTitle => 'Activity indicator';
@override
String get demoCupertinoActivityIndicatorSubtitle => 'iOS-style activity indicators';
@override
String get demoCupertinoActivityIndicatorDescription => 'An iOS-style activity indicator that spins clockwise.';
@override
String get demoCupertinoButtonsTitle => 'Buttons';
@override
String get demoCupertinoButtonsSubtitle => 'iOS-style buttons';
@override
String get demoCupertinoButtonsDescription => 'An iOS-style button. It takes in text and/or an icon that fades out and in on touch. May optionally have a background.';
@override
String get demoCupertinoContextMenuTitle => 'Context Menu';
@override
String get demoCupertinoContextMenuSubtitle => 'iOS-style context menu';
@override
String get demoCupertinoContextMenuDescription => 'An iOS-style full screen contextual menu that appears when an element is long-pressed.';
@override
String get demoCupertinoContextMenuActionOne => 'Action one';
@override
String get demoCupertinoContextMenuActionTwo => 'Action two';
@override
String get demoCupertinoContextMenuActionText => 'Tap and hold the Flutter logo to see the context menu.';
@override
String get demoCupertinoAlertsTitle => 'Alerts';
@override
String get demoCupertinoAlertsSubtitle => 'iOS-style alert dialogs';
@override
String get demoCupertinoAlertTitle => 'Alert';
@override
String get demoCupertinoAlertDescription => 'An alert dialog informs the user about situations that require acknowledgement. An alert dialog has an optional title, optional content, and an optional list of actions. The title is displayed above the content and the actions are displayed below the content.';
@override
String get demoCupertinoAlertWithTitleTitle => 'Alert With Title';
@override
String get demoCupertinoAlertButtonsTitle => 'Alert With Buttons';
@override
String get demoCupertinoAlertButtonsOnlyTitle => 'Alert Buttons Only';
@override
String get demoCupertinoActionSheetTitle => 'Action Sheet';
@override
String get demoCupertinoActionSheetDescription => 'An action sheet is a specific style of alert that presents the user with a set of two or more choices related to the current context. An action sheet can have a title, an additional message, and a list of actions.';
@override
String get demoCupertinoNavigationBarTitle => 'Navigation bar';
@override
String get demoCupertinoNavigationBarSubtitle => 'iOS-style navigation bar';
@override
String get demoCupertinoNavigationBarDescription => 'An iOS-styled navigation bar. The navigation bar is a toolbar that minimally consists of a page title, in the middle of the toolbar.';
@override
String get demoCupertinoPickerTitle => 'Pickers';
@override
String get demoCupertinoPickerSubtitle => 'iOS-style pickers';
@override
String get demoCupertinoPickerDescription => 'An iOS-style picker widget that can be used to select strings, dates, times, or both date and time.';
@override
String get demoCupertinoPickerTimer => 'Timer';
@override
String get demoCupertinoPicker => 'Picker';
@override
String get demoCupertinoPickerDate => 'Date';
@override
String get demoCupertinoPickerTime => 'Time';
@override
String get demoCupertinoPickerDateTime => 'Date and Time';
@override
String get demoCupertinoPullToRefreshTitle => 'Pull to refresh';
@override
String get demoCupertinoPullToRefreshSubtitle => 'iOS-style pull to refresh control';
@override
String get demoCupertinoPullToRefreshDescription => 'A widget implementing the iOS-style pull to refresh content control.';
@override
String get demoCupertinoSegmentedControlTitle => 'Segmented control';
@override
String get demoCupertinoSegmentedControlSubtitle => 'iOS-style segmented control';
@override
String get demoCupertinoSegmentedControlDescription => 'Used to select between a number of mutually exclusive options. When one option in the segmented control is selected, the other options in the segmented control cease to be selected.';
@override
String get demoCupertinoSliderTitle => 'Slider';
@override
String get demoCupertinoSliderSubtitle => 'iOS-style slider';
@override
String get demoCupertinoSliderDescription => 'A slider can be used to select from either a continuous or a discrete set of values.';
@override
String demoCupertinoSliderContinuous(Object value) {
return 'Continuous: $value';
}
@override
String demoCupertinoSliderDiscrete(Object value) {
return 'Discrete: $value';
}
@override
String get demoCupertinoSwitchSubtitle => 'iOS-style switch';
@override
String get demoCupertinoSwitchDescription => 'A switch is used to toggle the on/off state of a single setting.';
@override
String get demoCupertinoTabBarTitle => 'Tab bar';
@override
String get demoCupertinoTabBarSubtitle => 'iOS-style bottom tab bar';
@override
String get demoCupertinoTabBarDescription => 'An iOS-style bottom navigation tab bar. Displays multiple tabs with one tab being active, the first tab by default.';
@override
String get cupertinoTabBarHomeTab => 'Home';
@override
String get cupertinoTabBarChatTab => 'Chat';
@override
String get cupertinoTabBarProfileTab => 'Profile';
@override
String get demoCupertinoTextFieldTitle => 'Text fields';
@override
String get demoCupertinoTextFieldSubtitle => 'iOS-style text fields';
@override
String get demoCupertinoTextFieldDescription => 'A text field lets the user enter text, either with a hardware keyboard or with an onscreen keyboard.';
@override
String get demoCupertinoTextFieldPIN => 'PIN';
@override
String get demoCupertinoSearchTextFieldTitle => 'Search text field';
@override
String get demoCupertinoSearchTextFieldSubtitle => 'iOS-style search text field';
@override
String get demoCupertinoSearchTextFieldDescription => 'A search text field that lets the user search by entering text, and that can offer and filter suggestions.';
@override
String get demoCupertinoSearchTextFieldPlaceholder => 'Enter some text';
@override
String get demoCupertinoScrollbarTitle => 'Scrollbar';
@override
String get demoCupertinoScrollbarSubtitle => 'iOS-style scrollbar';
@override
String get demoCupertinoScrollbarDescription => 'A scrollbar that wraps the given child';
@override
String get demoMotionTitle => 'Motion';
@override
String get demoMotionSubtitle => 'All of the predefined transition patterns';
@override
String get demoContainerTransformDemoInstructions => 'Cards, Lists & FAB';
@override
String get demoSharedXAxisDemoInstructions => 'Next and Back Buttons';
@override
String get demoSharedYAxisDemoInstructions => 'Sort by "Recently Played"';
@override
String get demoSharedZAxisDemoInstructions => 'Settings icon button';
@override
String get demoFadeThroughDemoInstructions => 'Bottom navigation';
@override
String get demoFadeScaleDemoInstructions => 'Modal and FAB';
@override
String get demoContainerTransformTitle => 'Container Transform';
@override
String get demoContainerTransformDescription => 'The container transform pattern is designed for transitions between UI elements that include a container. This pattern creates a visible connection between two UI elements';
@override
String get demoContainerTransformModalBottomSheetTitle => 'Fade mode';
@override
String get demoContainerTransformTypeFade => 'FADE';
@override
String get demoContainerTransformTypeFadeThrough => 'FADE THROUGH';
@override
String get demoMotionPlaceholderTitle => 'Title';
@override
String get demoMotionPlaceholderSubtitle => 'Secondary text';
@override
String get demoMotionSmallPlaceholderSubtitle => 'Secondary';
@override
String get demoMotionDetailsPageTitle => 'Details Page';
@override
String get demoMotionListTileTitle => 'List item';
@override
String get demoSharedAxisDescription => 'The shared axis pattern is used for transitions between the UI elements that have a spatial or navigational relationship. This pattern uses a shared transformation on the x, y, or z axis to reinforce the relationship between elements.';
@override
String get demoSharedXAxisTitle => 'Shared x-axis';
@override
String get demoSharedXAxisBackButtonText => 'BACK';
@override
String get demoSharedXAxisNextButtonText => 'NEXT';
@override
String get demoSharedXAxisCoursePageTitle => 'Streamline your courses';
@override
String get demoSharedXAxisCoursePageSubtitle => 'Bundled categories appear as groups in your feed. You can always change this later.';
@override
String get demoSharedXAxisArtsAndCraftsCourseTitle => 'Arts & Crafts';
@override
String get demoSharedXAxisBusinessCourseTitle => 'Business';
@override
String get demoSharedXAxisIllustrationCourseTitle => 'Illustration';
@override
String get demoSharedXAxisDesignCourseTitle => 'Design';
@override
String get demoSharedXAxisCulinaryCourseTitle => 'Culinary';
@override
String get demoSharedXAxisBundledCourseSubtitle => 'Bundled';
@override
String get demoSharedXAxisIndividualCourseSubtitle => 'Shown Individually';
@override
String get demoSharedXAxisSignInWelcomeText => 'Hi David Park';
@override
String get demoSharedXAxisSignInSubtitleText => 'Sign in with your account';
@override
String get demoSharedXAxisSignInTextFieldLabel => 'Email or phone number';
@override
String get demoSharedXAxisForgotEmailButtonText => 'FORGOT EMAIL?';
@override
String get demoSharedXAxisCreateAccountButtonText => 'CREATE ACCOUNT';
@override
String get demoSharedYAxisTitle => 'Shared y-axis';
@override
String get demoSharedYAxisAlbumCount => '268 albums';
@override
String get demoSharedYAxisAlphabeticalSortTitle => 'A-Z';
@override
String get demoSharedYAxisRecentSortTitle => 'Recently played';
@override
String get demoSharedYAxisAlbumTileTitle => 'Album';
@override
String get demoSharedYAxisAlbumTileSubtitle => 'Artist';
@override
String get demoSharedYAxisAlbumTileDurationUnit => 'min';
@override
String get demoSharedZAxisTitle => 'Shared z-axis';
@override
String get demoSharedZAxisSettingsPageTitle => 'Settings';
@override
String get demoSharedZAxisBurgerRecipeTitle => 'Burger';
@override
String get demoSharedZAxisBurgerRecipeDescription => 'Burger recipe';
@override
String get demoSharedZAxisSandwichRecipeTitle => 'Sandwich';
@override
String get demoSharedZAxisSandwichRecipeDescription => 'Sandwich recipe';
@override
String get demoSharedZAxisDessertRecipeTitle => 'Dessert';
@override
String get demoSharedZAxisDessertRecipeDescription => 'Dessert recipe';
@override
String get demoSharedZAxisShrimpPlateRecipeTitle => 'Shrimp';
@override
String get demoSharedZAxisShrimpPlateRecipeDescription => 'Shrimp plate recipe';
@override
String get demoSharedZAxisCrabPlateRecipeTitle => 'Crab';
@override
String get demoSharedZAxisCrabPlateRecipeDescription => 'Crab plate recipe';
@override
String get demoSharedZAxisBeefSandwichRecipeTitle => 'Beef Sandwich';
@override
String get demoSharedZAxisBeefSandwichRecipeDescription => 'Beef Sandwich recipe';
@override
String get demoSharedZAxisSavedRecipesListTitle => 'Saved Recipes';
@override
String get demoSharedZAxisProfileSettingLabel => 'Profile';
@override
String get demoSharedZAxisNotificationSettingLabel => 'Notifications';
@override
String get demoSharedZAxisPrivacySettingLabel => 'Privacy';
@override
String get demoSharedZAxisHelpSettingLabel => 'Help';
@override
String get demoFadeThroughTitle => 'Fade through';
@override
String get demoFadeThroughDescription => 'The fade through pattern is used for transitions between UI elements that do not have a strong relationship to each other.';
@override
String get demoFadeThroughAlbumsDestination => 'Albums';
@override
String get demoFadeThroughPhotosDestination => 'Photos';
@override
String get demoFadeThroughSearchDestination => 'Search';
@override
String get demoFadeThroughTextPlaceholder => '123 photos';
@override
String get demoFadeScaleTitle => 'Fade';
@override
String get demoFadeScaleDescription => 'The fade pattern is used for UI elements that enter or exit within the bounds of the screen, such as a dialog that fades in the center of the screen.';
@override
String get demoFadeScaleShowAlertDialogButton => 'SHOW MODAL';
@override
String get demoFadeScaleShowFabButton => 'SHOW FAB';
@override
String get demoFadeScaleHideFabButton => 'HIDE FAB';
@override
String get demoFadeScaleAlertDialogHeader => 'Alert Dialog';
@override
String get demoFadeScaleAlertDialogCancelButton => 'CANCEL';
@override
String get demoFadeScaleAlertDialogDiscardButton => 'DISCARD';
@override
String get demoColorsTitle => 'Colors';
@override
String get demoColorsSubtitle => 'All of the predefined colors';
@override
String get demoColorsDescription => "Color and color swatch constants which represent Material Design's color palette.";
@override
String get demoTypographyTitle => 'Typography';
@override
String get demoTypographySubtitle => 'All of the predefined text styles';
@override
String get demoTypographyDescription => 'Definitions for the various typographical styles found in Material Design.';
@override
String get demo2dTransformationsTitle => '2D transformations';
@override
String get demo2dTransformationsSubtitle => 'Pan and zoom';
@override
String get demo2dTransformationsDescription => 'Tap to edit tiles, and use gestures to move around the scene. Drag to pan and pinch with two fingers to zoom. Press the reset button to return to the starting orientation.';
@override
String get demo2dTransformationsResetTooltip => 'Reset transformations';
@override
String get demo2dTransformationsEditTooltip => 'Edit tile';
@override
String get buttonText => 'BUTTON';
@override
String get demoBottomSheetTitle => 'Bottom sheet';
@override
String get demoBottomSheetSubtitle => 'Persistent and modal bottom sheets';
@override
String get demoBottomSheetPersistentTitle => 'Persistent bottom sheet';
@override
String get demoBottomSheetPersistentDescription => 'A persistent bottom sheet shows information that supplements the primary content of the app. A persistent bottom sheet remains visible even when the user interacts with other parts of the app.';
@override
String get demoBottomSheetModalTitle => 'Modal bottom sheet';
@override
String get demoBottomSheetModalDescription => 'A modal bottom sheet is an alternative to a menu or a dialog and prevents the user from interacting with the rest of the app.';
@override
String get demoBottomSheetAddLabel => 'Add';
@override
String get demoBottomSheetButtonText => 'SHOW BOTTOM SHEET';
@override
String get demoBottomSheetHeader => 'Header';
@override
String demoBottomSheetItem(Object value) {
return 'Item $value';
}
@override
String get demoListsTitle => 'Lists';
@override
String get demoListsSubtitle => 'Scrolling list layouts';
@override
String get demoListsDescription => 'A single fixed-height row that typically contains some text as well as a leading or trailing icon.';
@override
String get demoOneLineListsTitle => 'One Line';
@override
String get demoTwoLineListsTitle => 'Two Lines';
@override
String get demoListsSecondary => 'Secondary text';
@override
String get demoProgressIndicatorTitle => 'Progress indicators';
@override
String get demoProgressIndicatorSubtitle => 'Linear, circular, indeterminate';
@override
String get demoCircularProgressIndicatorTitle => 'Circular Progress Indicator';
@override
String get demoCircularProgressIndicatorDescription => 'A Material Design circular progress indicator, which spins to indicate that the application is busy.';
@override
String get demoLinearProgressIndicatorTitle => 'Linear Progress Indicator';
@override
String get demoLinearProgressIndicatorDescription => 'A Material Design linear progress indicator, also known as a progress bar.';
@override
String get demoPickersTitle => 'Pickers';
@override
String get demoPickersSubtitle => 'Date and time selection';
@override
String get demoDatePickerTitle => 'Date Picker';
@override
String get demoDatePickerDescription => 'Shows a dialog containing a Material Design date picker.';
@override
String get demoTimePickerTitle => 'Time Picker';
@override
String get demoTimePickerDescription => 'Shows a dialog containing a Material Design time picker.';
@override
String get demoDateRangePickerTitle => 'Date Range Picker';
@override
String get demoDateRangePickerDescription => 'Shows a dialog containing a Material Design date range picker.';
@override
String get demoPickersShowPicker => 'SHOW PICKER';
@override
String get demoTabsTitle => 'Tabs';
@override
String get demoTabsScrollingTitle => 'Scrolling';
@override
String get demoTabsNonScrollingTitle => 'Non-scrolling';
@override
String get demoTabsSubtitle => 'Tabs with independently scrollable views';
@override
String get demoTabsDescription => 'Tabs organize content across different screens, data sets, and other interactions.';
@override
String get demoSnackbarsTitle => 'Snackbars';
@override
String get demoSnackbarsSubtitle => 'Snackbars show messages at the bottom of the screen';
@override
String get demoSnackbarsDescription => "Snackbars inform users of a process that an app has performed or will perform. They appear temporarily, towards the bottom of the screen. They shouldn't interrupt the user experience, and they don't require user input to disappear.";
@override
String get demoSnackbarsButtonLabel => 'SHOW A SNACKBAR';
@override
String get demoSnackbarsText => 'This is a snackbar.';
@override
String get demoSnackbarsActionButtonLabel => 'ACTION';
@override
String get demoSnackbarsAction => 'You pressed the snackbar action.';
@override
String get demoSelectionControlsTitle => 'Selection controls';
@override
String get demoSelectionControlsSubtitle => 'Checkboxes, radio buttons, and switches';
@override
String get demoSelectionControlsCheckboxTitle => 'Checkbox';
@override
String get demoSelectionControlsCheckboxDescription => "Checkboxes allow the user to select multiple options from a set. A normal checkbox's value is true or false and a tristate checkbox's value can also be null.";
@override
String get demoSelectionControlsRadioTitle => 'Radio';
@override
String get demoSelectionControlsRadioDescription => 'Radio buttons allow the user to select one option from a set. Use radio buttons for exclusive selection if you think that the user needs to see all available options side-by-side.';
@override
String get demoSelectionControlsSwitchTitle => 'Switch';
@override
String get demoSelectionControlsSwitchDescription => "On/off switches toggle the state of a single settings option. The option that the switch controls, as well as the state it's in, should be made clear from the corresponding inline label.";
@override
String get demoBottomTextFieldsTitle => 'Text fields';
@override
String get demoTextFieldTitle => 'Text fields';
@override
String get demoTextFieldSubtitle => 'Single line of editable text and numbers';
@override
String get demoTextFieldDescription => 'Text fields allow users to enter text into a UI. They typically appear in forms and dialogs.';
@override
String get demoTextFieldShowPasswordLabel => 'Show password';
@override
String get demoTextFieldHidePasswordLabel => 'Hide password';
@override
String get demoTextFieldFormErrors => 'Please fix the errors in red before submitting.';
@override
String get demoTextFieldNameRequired => 'Name is required.';
@override
String get demoTextFieldOnlyAlphabeticalChars => 'Please enter only alphabetical characters.';
@override
String get demoTextFieldEnterUSPhoneNumber => '(###) ###-#### - Enter a US phone number.';
@override
String get demoTextFieldEnterPassword => 'Please enter a password.';
@override
String get demoTextFieldPasswordsDoNotMatch => "The passwords don't match";
@override
String get demoTextFieldWhatDoPeopleCallYou => 'What do people call you?';
@override
String get demoTextFieldNameField => 'Name*';
@override
String get demoTextFieldWhereCanWeReachYou => 'Where can we reach you?';
@override
String get demoTextFieldPhoneNumber => 'Phone number*';
@override
String get demoTextFieldYourEmailAddress => 'Your email address';
@override
String get demoTextFieldEmail => 'Email';
@override
String get demoTextFieldTellUsAboutYourself => 'Tell us about yourself (e.g., write down what you do or what hobbies you have)';
@override
String get demoTextFieldKeepItShort => 'Keep it short, this is just a demo.';
@override
String get demoTextFieldLifeStory => 'Life story';
@override
String get demoTextFieldSalary => 'Salary';
@override
String get demoTextFieldUSD => 'USD';
@override
String get demoTextFieldNoMoreThan => 'No more than 8 characters.';
@override
String get demoTextFieldPassword => 'Password*';
@override
String get demoTextFieldRetypePassword => 'Re-type password*';
@override
String get demoTextFieldSubmit => 'SUBMIT';
@override
String demoTextFieldNameHasPhoneNumber(Object name, Object phoneNumber) {
return '$name phone number is $phoneNumber';
}
@override
String get demoTextFieldRequiredField => '* indicates required field';
@override
String get demoTooltipTitle => 'Tooltips';
@override
String get demoTooltipSubtitle => 'Short message displayed on long press or hover';
@override
String get demoTooltipDescription => 'Tooltips provide text labels that help explain the function of a button or other user interface action. Tooltips display informative text when users hover over, focus on, or long press an element.';
@override
String get demoTooltipInstructions => 'Long press or hover to display the tooltip.';
@override
String get bottomNavigationCommentsTab => 'Comments';
@override
String get bottomNavigationCalendarTab => 'Calendar';
@override
String get bottomNavigationAccountTab => 'Account';
@override
String get bottomNavigationAlarmTab => 'Alarm';
@override
String get bottomNavigationCameraTab => 'Camera';
@override
String bottomNavigationContentPlaceholder(Object title) {
return 'Placeholder for $title tab';
}
@override
String get buttonTextCreate => 'Create';
@override
String dialogSelectedOption(Object value) {
return 'You selected: "$value"';
}
@override
String get chipTurnOnLights => 'Turn on lights';
@override
String get chipSmall => 'Small';
@override
String get chipMedium => 'Medium';
@override
String get chipLarge => 'Large';
@override
String get chipElevator => 'Elevator';
@override
String get chipWasher => 'Washer';
@override
String get chipFireplace => 'Fireplace';
@override
String get chipBiking => 'Biking';
@override
String get demo => 'Demo';
@override
String get bottomAppBar => 'Bottom app bar';
@override
String get loading => 'Loading';
@override
String get dialogDiscardTitle => 'Discard draft?';
@override
String get dialogLocationTitle => "Use Google's location service?";
@override
String get dialogLocationDescription => 'Let Google help apps determine location. This means sending anonymous location data to Google, even when no apps are running.';
@override
String get dialogCancel => 'CANCEL';
@override
String get dialogDiscard => 'DISCARD';
@override
String get dialogDisagree => 'DISAGREE';
@override
String get dialogAgree => 'AGREE';
@override
String get dialogSetBackup => 'Set backup account';
@override
String get dialogAddAccount => 'Add account';
@override
String get dialogShow => 'SHOW DIALOG';
@override
String get dialogFullscreenTitle => 'Full Screen Dialog';
@override
String get dialogFullscreenSave => 'SAVE';
@override
String get dialogFullscreenDescription => 'A full screen dialog demo';
@override
String get cupertinoButton => 'Button';
@override
String get cupertinoButtonWithBackground => 'With Background';
@override
String get cupertinoAlertCancel => 'Cancel';
@override
String get cupertinoAlertDiscard => 'Discard';
@override
String get cupertinoAlertLocationTitle => 'Allow "Maps" to access your location while you are using the app?';
@override
String get cupertinoAlertLocationDescription => 'Your current location will be displayed on the map and used for directions, nearby search results, and estimated travel times.';
@override
String get cupertinoAlertAllow => 'Allow';
@override
String get cupertinoAlertDontAllow => "Don't Allow";
@override
String get cupertinoAlertFavoriteDessert => 'Select Favorite Dessert';
@override
String get cupertinoAlertDessertDescription => 'Please select your favorite type of dessert from the list below. Your selection will be used to customize the suggested list of eateries in your area.';
@override
String get cupertinoAlertCheesecake => 'Cheesecake';
@override
String get cupertinoAlertTiramisu => 'Tiramisu';
@override
String get cupertinoAlertApplePie => 'Apple Pie';
@override
String get cupertinoAlertChocolateBrownie => 'Chocolate Brownie';
@override
String get cupertinoShowAlert => 'Show Alert';
@override
String get colorsRed => 'RED';
@override
String get colorsPink => 'PINK';
@override
String get colorsPurple => 'PURPLE';
@override
String get colorsDeepPurple => 'DEEP PURPLE';
@override
String get colorsIndigo => 'INDIGO';
@override
String get colorsBlue => 'BLUE';
@override
String get colorsLightBlue => 'LIGHT BLUE';
@override
String get colorsCyan => 'CYAN';
@override
String get colorsTeal => 'TEAL';
@override
String get colorsGreen => 'GREEN';
@override
String get colorsLightGreen => 'LIGHT GREEN';
@override
String get colorsLime => 'LIME';
@override
String get colorsYellow => 'YELLOW';
@override
String get colorsAmber => 'AMBER';
@override
String get colorsOrange => 'ORANGE';
@override
String get colorsDeepOrange => 'DEEP ORANGE';
@override
String get colorsBrown => 'BROWN';
@override
String get colorsGrey => 'GREY';
@override
String get colorsBlueGrey => 'BLUE GREY';
@override
String get placeChennai => 'Chennai';
@override
String get placeTanjore => 'Tanjore';
@override
String get placeChettinad => 'Chettinad';
@override
String get placePondicherry => 'Pondicherry';
@override
String get placeFlowerMarket => 'Flower Market';
@override
String get placeBronzeWorks => 'Bronze Works';
@override
String get placeMarket => 'Market';
@override
String get placeThanjavurTemple => 'Thanjavur Temple';
@override
String get placeSaltFarm => 'Salt Farm';
@override
String get placeScooters => 'Scooters';
@override
String get placeSilkMaker => 'Silk Maker';
@override
String get placeLunchPrep => 'Lunch Prep';
@override
String get placeBeach => 'Beach';
@override
String get placeFisherman => 'Fisherman';
@override
String get starterAppTitle => 'Starter app';
@override
String get starterAppDescription => 'A responsive starter layout';
@override
String get starterAppGenericButton => 'BUTTON';
@override
String get starterAppTooltipAdd => 'Add';
@override
String get starterAppTooltipFavorite => 'Favorite';
@override
String get starterAppTooltipShare => 'Share';
@override
String get starterAppTooltipSearch => 'Search';
@override
String get starterAppGenericTitle => 'Title';
@override
String get starterAppGenericSubtitle => 'Subtitle';
@override
String get starterAppGenericHeadline => 'Headline';
@override
String get starterAppGenericBody => 'Body';
@override
String starterAppDrawerItem(Object value) {
return 'Item $value';
}
@override
String get shrineMenuCaption => 'MENU';
@override
String get shrineCategoryNameAll => 'ALL';
@override
String get shrineCategoryNameAccessories => 'ACCESSORIES';
@override
String get shrineCategoryNameClothing => 'CLOTHING';
@override
String get shrineCategoryNameHome => 'HOME';
@override
String get shrineLogoutButtonCaption => 'LOGOUT';
@override
String get shrineLoginUsernameLabel => 'Username';
@override
String get shrineLoginPasswordLabel => 'Password';
@override
String get shrineCancelButtonCaption => 'CANCEL';
@override
String get shrineNextButtonCaption => 'NEXT';
@override
String get shrineCartPageCaption => 'CART';
@override
String shrineProductQuantity(Object quantity) {
return 'Quantity: $quantity';
}
@override
String shrineProductPrice(Object price) {
return 'x $price';
}
@override
String shrineCartItemCount(num quantity) {
return intl.Intl.pluralLogic(
quantity,
locale: localeName,
other: '$quantity ITEMS',
one: '1 ITEM',
zero: 'NO ITEMS',
);
}
@override
String get shrineCartClearButtonCaption => 'CLEAR CART';
@override
String get shrineCartTotalCaption => 'TOTAL';
@override
String get shrineCartSubtotalCaption => 'Subtotal:';
@override
String get shrineCartShippingCaption => 'Shipping:';
@override
String get shrineCartTaxCaption => 'Tax:';
@override
String get shrineProductVagabondSack => 'Vagabond sack';
@override
String get shrineProductStellaSunglasses => 'Stella sunglasses';
@override
String get shrineProductWhitneyBelt => 'Whitney belt';
@override
String get shrineProductGardenStrand => 'Garden strand';
@override
String get shrineProductStrutEarrings => 'Strut earrings';
@override
String get shrineProductVarsitySocks => 'Varsity socks';
@override
String get shrineProductWeaveKeyring => 'Weave keyring';
@override
String get shrineProductGatsbyHat => 'Gatsby hat';
@override
String get shrineProductShrugBag => 'Shrug bag';
@override
String get shrineProductGiltDeskTrio => 'Gilt desk trio';
@override
String get shrineProductCopperWireRack => 'Copper wire rack';
@override
String get shrineProductSootheCeramicSet => 'Soothe ceramic set';
@override
String get shrineProductHurrahsTeaSet => 'Hurrahs tea set';
@override
String get shrineProductBlueStoneMug => 'Blue stone mug';
@override
String get shrineProductRainwaterTray => 'Rainwater tray';
@override
String get shrineProductChambrayNapkins => 'Chambray napkins';
@override
String get shrineProductSucculentPlanters => 'Succulent planters';
@override
String get shrineProductQuartetTable => 'Quartet table';
@override
String get shrineProductKitchenQuattro => 'Kitchen quattro';
@override
String get shrineProductClaySweater => 'Clay sweater';
@override
String get shrineProductSeaTunic => 'Sea tunic';
@override
String get shrineProductPlasterTunic => 'Plaster tunic';
@override
String get shrineProductWhitePinstripeShirt => 'White pinstripe shirt';
@override
String get shrineProductChambrayShirt => 'Chambray shirt';
@override
String get shrineProductSeabreezeSweater => 'Seabreeze sweater';
@override
String get shrineProductGentryJacket => 'Gentry jacket';
@override
String get shrineProductNavyTrousers => 'Navy trousers';
@override
String get shrineProductWalterHenleyWhite => 'Walter henley (white)';
@override
String get shrineProductSurfAndPerfShirt => 'Surf and perf shirt';
@override
String get shrineProductGingerScarf => 'Ginger scarf';
@override
String get shrineProductRamonaCrossover => 'Ramona crossover';
@override
String get shrineProductClassicWhiteCollar => 'Classic white collar';
@override
String get shrineProductCeriseScallopTee => 'Cerise scallop tee';
@override
String get shrineProductShoulderRollsTee => 'Shoulder rolls tee';
@override
String get shrineProductGreySlouchTank => 'Grey slouch tank';
@override
String get shrineProductSunshirtDress => 'Sunshirt dress';
@override
String get shrineProductFineLinesTee => 'Fine lines tee';
@override
String get shrineTooltipSearch => 'Search';
@override
String get shrineTooltipSettings => 'Settings';
@override
String get shrineTooltipOpenMenu => 'Open menu';
@override
String get shrineTooltipCloseMenu => 'Close menu';
@override
String get shrineTooltipCloseCart => 'Close cart';
@override
String shrineScreenReaderCart(num quantity) {
return intl.Intl.pluralLogic(
quantity,
locale: localeName,
other: 'Shopping cart, $quantity items',
one: 'Shopping cart, 1 item',
zero: 'Shopping cart, no items',
);
}
@override
String get shrineScreenReaderProductAddToCart => 'Add to cart';
@override
String shrineScreenReaderRemoveProductButton(Object product) {
return 'Remove $product';
}
@override
String get shrineTooltipRemoveItem => 'Remove item';
@override
String get craneFormDiners => 'Diners';
@override
String get craneFormDate => 'Select Date';
@override
String get craneFormTime => 'Select Time';
@override
String get craneFormLocation => 'Select Location';
@override
String get craneFormTravelers => 'Travelers';
@override
String get craneFormOrigin => 'Choose Origin';
@override
String get craneFormDestination => 'Choose Destination';
@override
String get craneFormDates => 'Select Dates';
@override
String craneHours(num hours) {
final String temp0 = intl.Intl.pluralLogic(
hours,
locale: localeName,
other: '${hours}h',
one: '1h',
);
return temp0;
}
@override
String craneMinutes(num minutes) {
final String temp0 = intl.Intl.pluralLogic(
minutes,
locale: localeName,
other: '${minutes}m',
one: '1m',
);
return temp0;
}
@override
String craneFlightDuration(Object hoursShortForm, Object minutesShortForm) {
return '$hoursShortForm $minutesShortForm';
}
@override
String get craneFly => 'FLY';
@override
String get craneSleep => 'SLEEP';
@override
String get craneEat => 'EAT';
@override
String get craneFlySubhead => 'Explore Flights by Destination';
@override
String get craneSleepSubhead => 'Explore Properties by Destination';
@override
String get craneEatSubhead => 'Explore Restaurants by Destination';
@override
String craneFlyStops(num numberOfStops) {
final String temp0 = intl.Intl.pluralLogic(
numberOfStops,
locale: localeName,
other: '$numberOfStops stops',
one: '1 stop',
zero: 'Nonstop',
);
return temp0;
}
@override
String craneSleepProperties(num totalProperties) {
final String temp0 = intl.Intl.pluralLogic(
totalProperties,
locale: localeName,
other: '$totalProperties Available Properties',
one: '1 Available Properties',
zero: 'No Available Properties',
);
return temp0;
}
@override
String craneEatRestaurants(num totalRestaurants) {
final String temp0 = intl.Intl.pluralLogic(
totalRestaurants,
locale: localeName,
other: '$totalRestaurants Restaurants',
one: '1 Restaurant',
zero: 'No Restaurants',
);
return temp0;
}
@override
String get craneFly0 => 'Aspen, United States';
@override
String get craneFly1 => 'Big Sur, United States';
@override
String get craneFly2 => 'Khumbu Valley, Nepal';
@override
String get craneFly3 => 'Machu Picchu, Peru';
@override
String get craneFly4 => 'Malé, Maldives';
@override
String get craneFly5 => 'Vitznau, Switzerland';
@override
String get craneFly6 => 'Mexico City, Mexico';
@override
String get craneFly7 => 'Mount Rushmore, United States';
@override
String get craneFly8 => 'Singapore';
@override
String get craneFly9 => 'Havana, Cuba';
@override
String get craneFly10 => 'Cairo, Egypt';
@override
String get craneFly11 => 'Lisbon, Portugal';
@override
String get craneFly12 => 'Napa, United States';
@override
String get craneFly13 => 'Bali, Indonesia';
@override
String get craneSleep0 => 'Malé, Maldives';
@override
String get craneSleep1 => 'Aspen, United States';
@override
String get craneSleep2 => 'Machu Picchu, Peru';
@override
String get craneSleep3 => 'Havana, Cuba';
@override
String get craneSleep4 => 'Vitznau, Switzerland';
@override
String get craneSleep5 => 'Big Sur, United States';
@override
String get craneSleep6 => 'Napa, United States';
@override
String get craneSleep7 => 'Porto, Portugal';
@override
String get craneSleep8 => 'Tulum, Mexico';
@override
String get craneSleep9 => 'Lisbon, Portugal';
@override
String get craneSleep10 => 'Cairo, Egypt';
@override
String get craneSleep11 => 'Taipei, Taiwan';
@override
String get craneEat0 => 'Naples, Italy';
@override
String get craneEat1 => 'Dallas, United States';
@override
String get craneEat2 => 'Córdoba, Argentina';
@override
String get craneEat3 => 'Portland, United States';
@override
String get craneEat4 => 'Paris, France';
@override
String get craneEat5 => 'Seoul, South Korea';
@override
String get craneEat6 => 'Seattle, United States';
@override
String get craneEat7 => 'Nashville, United States';
@override
String get craneEat8 => 'Atlanta, United States';
@override
String get craneEat9 => 'Madrid, Spain';
@override
String get craneEat10 => 'Lisbon, Portugal';
@override
String get craneFly0SemanticLabel => 'Chalet in a snowy landscape with evergreen trees';
@override
String get craneFly1SemanticLabel => 'Tent in a field';
@override
String get craneFly2SemanticLabel => 'Prayer flags in front of snowy mountain';
@override
String get craneFly3SemanticLabel => 'Machu Picchu citadel';
@override
String get craneFly4SemanticLabel => 'Overwater bungalows';
@override
String get craneFly5SemanticLabel => 'Lake-side hotel in front of mountains';
@override
String get craneFly6SemanticLabel => 'Aerial view of Palacio de Bellas Artes';
@override
String get craneFly7SemanticLabel => 'Mount Rushmore';
@override
String get craneFly8SemanticLabel => 'Supertree Grove';
@override
String get craneFly9SemanticLabel => 'Man leaning on an antique blue car';
@override
String get craneFly10SemanticLabel => 'Al-Azhar Mosque towers during sunset';
@override
String get craneFly11SemanticLabel => 'Brick lighthouse at sea';
@override
String get craneFly12SemanticLabel => 'Pool with palm trees';
@override
String get craneFly13SemanticLabel => 'Sea-side pool with palm trees';
@override
String get craneSleep0SemanticLabel => 'Overwater bungalows';
@override
String get craneSleep1SemanticLabel => 'Chalet in a snowy landscape with evergreen trees';
@override
String get craneSleep2SemanticLabel => 'Machu Picchu citadel';
@override
String get craneSleep3SemanticLabel => 'Man leaning on an antique blue car';
@override
String get craneSleep4SemanticLabel => 'Lake-side hotel in front of mountains';
@override
String get craneSleep5SemanticLabel => 'Tent in a field';
@override
String get craneSleep6SemanticLabel => 'Pool with palm trees';
@override
String get craneSleep7SemanticLabel => 'Colorful apartments at Riberia Square';
@override
String get craneSleep8SemanticLabel => 'Mayan ruins on a cliff above a beach';
@override
String get craneSleep9SemanticLabel => 'Brick lighthouse at sea';
@override
String get craneSleep10SemanticLabel => 'Al-Azhar Mosque towers during sunset';
@override
String get craneSleep11SemanticLabel => 'Taipei 101 skyscraper';
@override
String get craneEat0SemanticLabel => 'Pizza in a wood-fired oven';
@override
String get craneEat1SemanticLabel => 'Empty bar with diner-style stools';
@override
String get craneEat2SemanticLabel => 'Burger';
@override
String get craneEat3SemanticLabel => 'Korean taco';
@override
String get craneEat4SemanticLabel => 'Chocolate dessert';
@override
String get craneEat5SemanticLabel => 'Artsy restaurant seating area';
@override
String get craneEat6SemanticLabel => 'Shrimp dish';
@override
String get craneEat7SemanticLabel => 'Bakery entrance';
@override
String get craneEat8SemanticLabel => 'Plate of crawfish';
@override
String get craneEat9SemanticLabel => 'Cafe counter with pastries';
@override
String get craneEat10SemanticLabel => 'Woman holding huge pastrami sandwich';
@override
String get fortnightlyMenuFrontPage => 'Front Page';
@override
String get fortnightlyMenuWorld => 'World';
@override
String get fortnightlyMenuUS => 'US';
@override
String get fortnightlyMenuPolitics => 'Politics';
@override
String get fortnightlyMenuBusiness => 'Business';
@override
String get fortnightlyMenuTech => 'Tech';
@override
String get fortnightlyMenuScience => 'Science';
@override
String get fortnightlyMenuSports => 'Sports';
@override
String get fortnightlyMenuTravel => 'Travel';
@override
String get fortnightlyMenuCulture => 'Culture';
@override
String get fortnightlyTrendingTechDesign => 'TechDesign';
@override
String get fortnightlyTrendingReform => 'Reform';
@override
String get fortnightlyTrendingHealthcareRevolution => 'HealthcareRevolution';
@override
String get fortnightlyTrendingGreenArmy => 'GreenArmy';
@override
String get fortnightlyTrendingStocks => 'Stocks';
@override
String get fortnightlyLatestUpdates => 'Latest Updates';
@override
String get fortnightlyHeadlineHealthcare => 'The Quiet, Yet Powerful Healthcare Revolution';
@override
String get fortnightlyHeadlineWar => 'Divided American Lives During War';
@override
String get fortnightlyHeadlineGasoline => 'The Future of Gasoline';
@override
String get fortnightlyHeadlineArmy => 'Reforming The Green Army From Within';
@override
String get fortnightlyHeadlineStocks => 'As Stocks Stagnate, Many Look To Currency';
@override
String get fortnightlyHeadlineFabrics => 'Designers Use Tech To Make Futuristic Fabrics';
@override
String get fortnightlyHeadlineFeminists => 'Feminists Take On Partisanship';
@override
String get fortnightlyHeadlineBees => 'Farmland Bees In Short Supply';
@override
String get replyInboxLabel => 'Inbox';
@override
String get replyStarredLabel => 'Starred';
@override
String get replySentLabel => 'Sent';
@override
String get replyTrashLabel => 'Trash';
@override
String get replySpamLabel => 'Spam';
@override
String get replyDraftsLabel => 'Drafts';
@override
String get demoTwoPaneFoldableLabel => 'Foldable';
@override
String get demoTwoPaneFoldableDescription => 'This is how TwoPane behaves on a foldable device.';
@override
String get demoTwoPaneSmallScreenLabel => 'Small Screen';
@override
String get demoTwoPaneSmallScreenDescription => 'This is how TwoPane behaves on a small screen device.';
@override
String get demoTwoPaneTabletLabel => 'Tablet / Desktop';
@override
String get demoTwoPaneTabletDescription => 'This is how TwoPane behaves on a larger screen like a tablet or desktop.';
@override
String get demoTwoPaneTitle => 'TwoPane';
@override
String get demoTwoPaneSubtitle => 'Responsive layouts on foldable, large, and small screens';
@override
String get splashSelectDemo => 'Select a demo';
@override
String get demoTwoPaneList => 'List';
@override
String get demoTwoPaneDetails => 'Details';
@override
String get demoTwoPaneSelectItem => 'Select an item';
@override
String demoTwoPaneItem(Object value) {
return 'Item $value';
}
@override
String demoTwoPaneItemDetails(Object value) {
return 'Item $value details';
}
}
/// The translations for English, as used in Iceland (`en_IS`).
class GalleryLocalizationsEnIs extends GalleryLocalizationsEn {
GalleryLocalizationsEnIs(): super('en_IS');
@override
String githubRepo(Object repoName) {
return '$repoName GitHub repository';
}
@override
String aboutDialogDescription(Object repoLink) {
return 'To see the source code for this app, please visit the $repoLink.';
}
@override
String get deselect => 'Deselect';
@override
String get notSelected => 'Not selected';
@override
String get select => 'Select';
@override
String get selectable => 'Selectable (long press)';
@override
String get selected => 'Selected';
@override
String get signIn => 'SIGN IN';
@override
String get bannerDemoText => 'Your password was updated on your other device. Please sign in again.';
@override
String get bannerDemoResetText => 'Reset the banner';
@override
String get bannerDemoMultipleText => 'Multiple actions';
@override
String get bannerDemoLeadingText => 'Leading icon';
@override
String get dismiss => 'DISMISS';
@override
String get backToGallery => 'Back to Gallery';
@override
String get cardsDemoExplore => 'Explore';
@override
String cardsDemoExploreSemantics(Object destinationName) {
return 'Explore $destinationName';
}
@override
String cardsDemoShareSemantics(Object destinationName) {
return 'Share $destinationName';
}
@override
String get cardsDemoTappable => 'Tappable';
@override
String get cardsDemoTravelDestinationTitle1 => 'Top 10 cities to visit in Tamil Nadu';
@override
String get cardsDemoTravelDestinationDescription1 => 'Number 10';
@override
String get cardsDemoTravelDestinationCity1 => 'Thanjavur';
@override
String get cardsDemoTravelDestinationLocation1 => 'Thanjavur, Tamil Nadu';
@override
String get cardsDemoTravelDestinationTitle2 => 'Artisans of Southern India';
@override
String get cardsDemoTravelDestinationDescription2 => 'Silk spinners';
@override
String get cardsDemoTravelDestinationCity2 => 'Chettinad';
@override
String get cardsDemoTravelDestinationLocation2 => 'Sivaganga, Tamil Nadu';
@override
String get cardsDemoTravelDestinationTitle3 => 'Brihadisvara Temple';
@override
String get cardsDemoTravelDestinationDescription3 => 'Temples';
@override
String get homeHeaderGallery => 'Gallery';
@override
String get homeHeaderCategories => 'Categories';
@override
String get shrineDescription => 'A fashionable retail app';
@override
String get fortnightlyDescription => 'A content-focused news app';
@override
String get rallyDescription => 'A personal finance app';
@override
String get replyDescription => 'An efficient, focused email app';
@override
String get rallyAccountDataChecking => 'Current';
@override
String get rallyAccountDataHomeSavings => 'Home savings';
@override
String get rallyAccountDataCarSavings => 'Car savings';
@override
String get rallyAccountDataVacation => 'Holiday';
@override
String get rallyAccountDetailDataAnnualPercentageYield => 'Annual percentage yield';
@override
String get rallyAccountDetailDataInterestRate => 'Interest rate';
@override
String get rallyAccountDetailDataInterestYtd => 'Interest YTD';
@override
String get rallyAccountDetailDataInterestPaidLastYear => 'Interest paid last year';
@override
String get rallyAccountDetailDataNextStatement => 'Next statement';
@override
String get rallyAccountDetailDataAccountOwner => 'Account owner';
@override
String get rallyBillDetailTotalAmount => 'Total amount';
@override
String get rallyBillDetailAmountPaid => 'Amount paid';
@override
String get rallyBillDetailAmountDue => 'Amount due';
@override
String get rallyBudgetCategoryCoffeeShops => 'Coffee shops';
@override
String get rallyBudgetCategoryGroceries => 'Groceries';
@override
String get rallyBudgetCategoryRestaurants => 'Restaurants';
@override
String get rallyBudgetCategoryClothing => 'Clothing';
@override
String get rallyBudgetDetailTotalCap => 'Total cap';
@override
String get rallyBudgetDetailAmountUsed => 'Amount used';
@override
String get rallyBudgetDetailAmountLeft => 'Amount left';
@override
String get rallySettingsManageAccounts => 'Manage accounts';
@override
String get rallySettingsTaxDocuments => 'Tax documents';
@override
String get rallySettingsPasscodeAndTouchId => 'Passcode and Touch ID';
@override
String get rallySettingsNotifications => 'Notifications';
@override
String get rallySettingsPersonalInformation => 'Personal information';
@override
String get rallySettingsPaperlessSettings => 'Paperless settings';
@override
String get rallySettingsFindAtms => 'Find ATMs';
@override
String get rallySettingsHelp => 'Help';
@override
String get rallySettingsSignOut => 'Sign out';
@override
String get rallyAccountTotal => 'Total';
@override
String get rallyBillsDue => 'Due';
@override
String get rallyBudgetLeft => 'Left';
@override
String get rallyAccounts => 'Accounts';
@override
String get rallyBills => 'Bills';
@override
String get rallyBudgets => 'Budgets';
@override
String get rallyAlerts => 'Alerts';
@override
String get rallySeeAll => 'SEE ALL';
@override
String get rallyFinanceLeft => 'LEFT';
@override
String get rallyTitleOverview => 'OVERVIEW';
@override
String get rallyTitleAccounts => 'ACCOUNTS';
@override
String get rallyTitleBills => 'BILLS';
@override
String get rallyTitleBudgets => 'BUDGETS';
@override
String get rallyTitleSettings => 'SETTINGS';
@override
String get rallyLoginLoginToRally => 'Log in to Rally';
@override
String get rallyLoginNoAccount => "Don't have an account?";
@override
String get rallyLoginSignUp => 'SIGN UP';
@override
String get rallyLoginUsername => 'Username';
@override
String get rallyLoginPassword => 'Password';
@override
String get rallyLoginLabelLogin => 'Log in';
@override
String get rallyLoginRememberMe => 'Remember me';
@override
String get rallyLoginButtonLogin => 'LOGIN';
@override
String rallyAlertsMessageHeadsUpShopping(Object percent) {
return "Heads up: you've used up $percent of your shopping budget for this month.";
}
@override
String rallyAlertsMessageSpentOnRestaurants(Object amount) {
return "You've spent $amount on restaurants this week.";
}
@override
String rallyAlertsMessageATMFees(Object amount) {
return "You've spent $amount in ATM fees this month";
}
@override
String rallyAlertsMessageCheckingAccount(Object percent) {
return 'Good work! Your current account is $percent higher than last month.';
}
@override
String rallyAlertsMessageUnassignedTransactions(num count) {
final String temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'Increase your potential tax deduction! Assign categories to $count unassigned transactions.',
one: 'Increase your potential tax deduction! Assign categories to 1 unassigned transaction.',
);
return temp0;
}
@override
String get rallySeeAllAccounts => 'See all accounts';
@override
String get rallySeeAllBills => 'See all bills';
@override
String get rallySeeAllBudgets => 'See all budgets';
@override
String rallyAccountAmount(Object accountName, Object accountNumber, Object amount) {
return '$accountName account $accountNumber with $amount.';
}
@override
String rallyBillAmount(Object billName, Object date, Object amount) {
return '$billName bill due $date for $amount.';
}
@override
String rallyBudgetAmount(Object budgetName, Object amountUsed, Object amountTotal, Object amountLeft) {
return '$budgetName budget with $amountUsed used of $amountTotal, $amountLeft left';
}
@override
String get craneDescription => 'A personalised travel app';
@override
String get homeCategoryReference => 'STYLES AND OTHER';
@override
String get demoInvalidURL => "Couldn't display URL:";
@override
String get demoOptionsTooltip => 'Options';
@override
String get demoInfoTooltip => 'Info';
@override
String get demoCodeTooltip => 'Demo code';
@override
String get demoDocumentationTooltip => 'API Documentation';
@override
String get demoFullscreenTooltip => 'Full screen';
@override
String get demoCodeViewerCopyAll => 'COPY ALL';
@override
String get demoCodeViewerCopiedToClipboardMessage => 'Copied to clipboard.';
@override
String demoCodeViewerFailedToCopyToClipboardMessage(Object error) {
return 'Failed to copy to clipboard: $error';
}
@override
String get demoOptionsFeatureTitle => 'View options';
@override
String get demoOptionsFeatureDescription => 'Tap here to view available options for this demo.';
@override
String get settingsTitle => 'Settings';
@override
String get settingsButtonLabel => 'Settings';
@override
String get settingsButtonCloseLabel => 'Close settings';
@override
String get settingsSystemDefault => 'System';
@override
String get settingsTextScaling => 'Text scaling';
@override
String get settingsTextScalingSmall => 'Small';
@override
String get settingsTextScalingNormal => 'Normal';
@override
String get settingsTextScalingLarge => 'Large';
@override
String get settingsTextScalingHuge => 'Huge';
@override
String get settingsTextDirection => 'Text direction';
@override
String get settingsTextDirectionLocaleBased => 'Based on locale';
@override
String get settingsTextDirectionLTR => 'LTR';
@override
String get settingsTextDirectionRTL => 'RTL';
@override
String get settingsLocale => 'Locale';
@override
String get settingsPlatformMechanics => 'Platform mechanics';
@override
String get settingsTheme => 'Theme';
@override
String get settingsDarkTheme => 'Dark';
@override
String get settingsLightTheme => 'Light';
@override
String get settingsSlowMotion => 'Slow motion';
@override
String get settingsAbout => 'About Flutter Gallery';
@override
String get settingsFeedback => 'Send feedback';
@override
String get settingsAttribution => 'Designed by TOASTER in London';
@override
String get demoAppBarTitle => 'App bar';
@override
String get demoAppBarSubtitle => 'Displays information and actions relating to the current screen';
@override
String get demoAppBarDescription => "The app bar provides content and actions related to the current screen. It's used for branding, screen titles, navigation and actions";
@override
String get demoBottomAppBarTitle => 'Bottom app bar';
@override
String get demoBottomAppBarSubtitle => 'Displays navigation and actions at the bottom';
@override
String get demoBottomAppBarDescription => 'Bottom app bars provide access to a bottom navigation drawer and up to four actions, including the floating action button.';
@override
String get bottomAppBarNotch => 'Notch';
@override
String get bottomAppBarPosition => 'Floating action button position';
@override
String get bottomAppBarPositionDockedEnd => 'Docked - End';
@override
String get bottomAppBarPositionDockedCenter => 'Docked - Centre';
@override
String get bottomAppBarPositionFloatingEnd => 'Floating - End';
@override
String get bottomAppBarPositionFloatingCenter => 'Floating - Centre';
@override
String get demoBannerTitle => 'Banner';
@override
String get demoBannerSubtitle => 'Displaying a banner within a list';
@override
String get demoBannerDescription => 'A banner displays an important, succinct message, and provides actions for users to address (or dismiss the banner). A user action is required for it to be dismissed.';
@override
String get demoBottomNavigationTitle => 'Bottom navigation';
@override
String get demoBottomNavigationSubtitle => 'Bottom navigation with cross-fading views';
@override
String get demoBottomNavigationPersistentLabels => 'Persistent labels';
@override
String get demoBottomNavigationSelectedLabel => 'Selected label';
@override
String get demoBottomNavigationDescription => 'Bottom navigation bars display three to five destinations at the bottom of a screen. Each destination is represented by an icon and an optional text label. When a bottom navigation icon is tapped, the user is taken to the top-level navigation destination associated with that icon.';
@override
String get demoButtonTitle => 'Buttons';
@override
String get demoButtonSubtitle => 'Text, elevated, outlined and more';
@override
String get demoTextButtonTitle => 'Text button';
@override
String get demoTextButtonDescription => 'A text button displays an ink splash on press but does not lift. Use text buttons on toolbars, in dialogues and inline with padding';
@override
String get demoElevatedButtonTitle => 'Elevated button';
@override
String get demoElevatedButtonDescription => 'Elevated buttons add dimension to mostly flat layouts. They emphasise functions on busy or wide spaces.';
@override
String get demoOutlinedButtonTitle => 'Outlined button';
@override
String get demoOutlinedButtonDescription => 'Outlined buttons become opaque and elevate when pressed. They are often paired with raised buttons to indicate an alternative, secondary action.';
@override
String get demoToggleButtonTitle => 'Toggle Buttons';
@override
String get demoToggleButtonDescription => 'Toggle buttons can be used to group related options. To emphasise groups of related toggle buttons, a group should share a common container';
@override
String get demoFloatingButtonTitle => 'Floating Action Button';
@override
String get demoFloatingButtonDescription => 'A floating action button is a circular icon button that hovers over content to promote a primary action in the application.';
@override
String get demoCardTitle => 'Cards';
@override
String get demoCardSubtitle => 'Baseline cards with rounded corners';
@override
String get demoChipTitle => 'Chips';
@override
String get demoCardDescription => 'A card is a sheet of material used to represent some related information, for example, an album, a geographical location, a meal, contact details, etc.';
@override
String get demoChipSubtitle => 'Compact elements that represent an input, attribute or action';
@override
String get demoActionChipTitle => 'Action chip';
@override
String get demoActionChipDescription => 'Action chips are a set of options which trigger an action related to primary content. Action chips should appear dynamically and contextually in a UI.';
@override
String get demoChoiceChipTitle => 'Choice chip';
@override
String get demoChoiceChipDescription => 'Choice chips represent a single choice from a set. Choice chips contain related descriptive text or categories.';
@override
String get demoFilterChipTitle => 'Filter chip';
@override
String get demoFilterChipDescription => 'Filter chips use tags or descriptive words as a way to filter content.';
@override
String get demoInputChipTitle => 'Input chip';
@override
String get demoInputChipDescription => 'Input chips represent a complex piece of information, such as an entity (person, place or thing) or conversational text, in a compact form.';
@override
String get demoDataTableTitle => 'Data tables';
@override
String get demoDataTableSubtitle => 'Rows and columns of information';
@override
String get demoDataTableDescription => "Data tables display information in a grid-like format of rows and columns. They organise information in a way that's easy to scan, so that users can look for patterns and insights.";
@override
String get dataTableHeader => 'Nutrition';
@override
String get dataTableColumnDessert => 'Dessert (1 serving)';
@override
String get dataTableColumnCalories => 'Calories';
@override
String get dataTableColumnFat => 'Fat (gm)';
@override
String get dataTableColumnCarbs => 'Carbs (gm)';
@override
String get dataTableColumnProtein => 'Protein (gm)';
@override
String get dataTableColumnSodium => 'Sodium (mg)';
@override
String get dataTableColumnCalcium => 'Calcium (%)';
@override
String get dataTableColumnIron => 'Iron (%)';
@override
String get dataTableRowFrozenYogurt => 'Frozen yogurt';
@override
String get dataTableRowIceCreamSandwich => 'Ice cream sandwich';
@override
String get dataTableRowEclair => 'Eclair';
@override
String get dataTableRowCupcake => 'Cupcake';
@override
String get dataTableRowGingerbread => 'Gingerbread';
@override
String get dataTableRowJellyBean => 'Jelly bean';
@override
String get dataTableRowLollipop => 'Lollipop';
@override
String get dataTableRowHoneycomb => 'Honeycomb';
@override
String get dataTableRowDonut => 'Doughnut';
@override
String get dataTableRowApplePie => 'Apple pie';
@override
String dataTableRowWithSugar(Object value) {
return '$value with sugar';
}
@override
String dataTableRowWithHoney(Object value) {
return '$value with honey';
}
@override
String get demoDialogTitle => 'Dialogues';
@override
String get demoDialogSubtitle => 'Simple, alert and full-screen';
@override
String get demoAlertDialogTitle => 'Alert';
@override
String get demoAlertDialogDescription => 'An alert dialogue informs the user about situations that require acknowledgement. An alert dialogue has an optional title and an optional list of actions.';
@override
String get demoAlertTitleDialogTitle => 'Alert With Title';
@override
String get demoSimpleDialogTitle => 'Simple';
@override
String get demoSimpleDialogDescription => 'A simple dialogue offers the user a choice between several options. A simple dialogue has an optional title that is displayed above the choices.';
@override
String get demoDividerTitle => 'Divider';
@override
String get demoDividerSubtitle => 'A divider is a thin line that groups content in lists and layouts.';
@override
String get demoDividerDescription => 'Dividers can be used in lists, drawers and elsewhere to separate content.';
@override
String get demoVerticalDividerTitle => 'Vertical divider';
@override
String get demoGridListsTitle => 'Grid lists';
@override
String get demoGridListsSubtitle => 'Row and column layout';
@override
String get demoGridListsDescription => 'Grid lists are best suited for presenting homogeneous data, typically images. Each item in a grid list is called a tile.';
@override
String get demoGridListsImageOnlyTitle => 'Image only';
@override
String get demoGridListsHeaderTitle => 'With header';
@override
String get demoGridListsFooterTitle => 'With footer';
@override
String get demoSlidersTitle => 'Sliders';
@override
String get demoSlidersSubtitle => 'Widgets for selecting a value by swiping';
@override
String get demoSlidersDescription => 'Sliders reflect a range of values along a bar, from which users may select a single value. They are ideal for adjusting settings such as volume, brightness or applying image filters.';
@override
String get demoRangeSlidersTitle => 'Range sliders';
@override
String get demoRangeSlidersDescription => 'Sliders reflect a range of values along a bar. They can have icons on both ends of the bar that reflect a range of values. They are ideal for adjusting settings such as volume, brightness or applying image filters.';
@override
String get demoCustomSlidersTitle => 'Custom sliders';
@override
String get demoCustomSlidersDescription => 'Sliders reflect a range of values along a bar, from which users may select a single value or range of values. The sliders can be themed and customised.';
@override
String get demoSlidersContinuousWithEditableNumericalValue => 'Continuous with editable numerical value';
@override
String get demoSlidersDiscrete => 'Discrete';
@override
String get demoSlidersDiscreteSliderWithCustomTheme => 'Discrete slider with custom theme';
@override
String get demoSlidersContinuousRangeSliderWithCustomTheme => 'Continuous range slider with custom theme';
@override
String get demoSlidersContinuous => 'Continuous';
@override
String get demoSlidersEditableNumericalValue => 'Editable numerical value';
@override
String get demoMenuTitle => 'Menu';
@override
String get demoContextMenuTitle => 'Context menu';
@override
String get demoSectionedMenuTitle => 'Sectioned menu';
@override
String get demoSimpleMenuTitle => 'Simple menu';
@override
String get demoChecklistMenuTitle => 'Checklist menu';
@override
String get demoMenuSubtitle => 'Menu buttons and simple menus';
@override
String get demoMenuDescription => 'A menu displays a list of choices on a temporary surface. They appear when users interact with a button, action or other control.';
@override
String get demoMenuItemValueOne => 'Menu item one';
@override
String get demoMenuItemValueTwo => 'Menu item two';
@override
String get demoMenuItemValueThree => 'Menu item three';
@override
String get demoMenuOne => 'One';
@override
String get demoMenuTwo => 'Two';
@override
String get demoMenuThree => 'Three';
@override
String get demoMenuFour => 'Four';
@override
String get demoMenuAnItemWithAContextMenuButton => 'An item with a context menu';
@override
String get demoMenuContextMenuItemOne => 'Context menu item one';
@override
String get demoMenuADisabledMenuItem => 'Disabled menu item';
@override
String get demoMenuContextMenuItemThree => 'Context menu item three';
@override
String get demoMenuAnItemWithASectionedMenu => 'An item with a sectioned menu';
@override
String get demoMenuPreview => 'Preview';
@override
String get demoMenuShare => 'Share';
@override
String get demoMenuGetLink => 'Get link';
@override
String get demoMenuRemove => 'Remove';
@override
String demoMenuSelected(Object value) {
return 'Selected: $value';
}
@override
String demoMenuChecked(Object value) {
return 'Checked: $value';
}
@override
String get demoNavigationDrawerTitle => 'Navigation drawer';
@override
String get demoNavigationDrawerSubtitle => 'Displaying a drawer within app bar';
@override
String get demoNavigationDrawerDescription => 'A Material Design panel that slides in horizontally from the edge of the screen to show navigation links in an application.';
@override
String get demoNavigationDrawerUserName => 'User name';
@override
String get demoNavigationDrawerUserEmail => '[email protected]';
@override
String get demoNavigationDrawerToPageOne => 'Item one';
@override
String get demoNavigationDrawerToPageTwo => 'Item two';
@override
String get demoNavigationDrawerText => 'Swipe from the edge or tap the upper-left icon to see the drawer';
@override
String get demoNavigationRailTitle => 'Navigation rail';
@override
String get demoNavigationRailSubtitle => 'Displaying a navigation rail within an app';
@override
String get demoNavigationRailDescription => 'A material widget that is meant to be displayed at the left or right of an app to navigate between a small number of views, typically between three and five.';
@override
String get demoNavigationRailFirst => 'First';
@override
String get demoNavigationRailSecond => 'Second';
@override
String get demoNavigationRailThird => 'Third';
@override
String get demoMenuAnItemWithASimpleMenu => 'An item with a simple menu';
@override
String get demoMenuAnItemWithAChecklistMenu => 'An item with a checklist menu';
@override
String get demoFullscreenDialogTitle => 'Full screen';
@override
String get demoFullscreenDialogDescription => 'The fullscreenDialog property specifies whether the incoming page is a full-screen modal dialogue';
@override
String get demoCupertinoActivityIndicatorTitle => 'Activity indicator';
@override
String get demoCupertinoActivityIndicatorSubtitle => 'iOS-style activity indicators';
@override
String get demoCupertinoActivityIndicatorDescription => 'An iOS-style activity indicator that spins clockwise.';
@override
String get demoCupertinoButtonsTitle => 'Buttons';
@override
String get demoCupertinoButtonsSubtitle => 'iOS-style buttons';
@override
String get demoCupertinoButtonsDescription => 'An iOS-style button. It takes in text and/or an icon that fades out and in on touch. May optionally have a background.';
@override
String get demoCupertinoContextMenuTitle => 'Context menu';
@override
String get demoCupertinoContextMenuSubtitle => 'iOS-style context menu';
@override
String get demoCupertinoContextMenuDescription => 'An iOS-style full screen contextual menu that appears when an element is long-pressed.';
@override
String get demoCupertinoContextMenuActionOne => 'Action one';
@override
String get demoCupertinoContextMenuActionTwo => 'Action two';
@override
String get demoCupertinoContextMenuActionText => 'Tap and hold the Flutter logo to see the context menu.';
@override
String get demoCupertinoAlertsTitle => 'Alerts';
@override
String get demoCupertinoAlertsSubtitle => 'iOS-style alert dialogues';
@override
String get demoCupertinoAlertTitle => 'Alert';
@override
String get demoCupertinoAlertDescription => 'An alert dialogue informs the user about situations that require acknowledgement. An alert dialogue has an optional title, optional content and an optional list of actions. The title is displayed above the content and the actions are displayed below the content.';
@override
String get demoCupertinoAlertWithTitleTitle => 'Alert with title';
@override
String get demoCupertinoAlertButtonsTitle => 'Alert With Buttons';
@override
String get demoCupertinoAlertButtonsOnlyTitle => 'Alert Buttons Only';
@override
String get demoCupertinoActionSheetTitle => 'Action Sheet';
@override
String get demoCupertinoActionSheetDescription => 'An action sheet is a specific style of alert that presents the user with a set of two or more choices related to the current context. An action sheet can have a title, an additional message and a list of actions.';
@override
String get demoCupertinoNavigationBarTitle => 'Navigation bar';
@override
String get demoCupertinoNavigationBarSubtitle => 'iOS-style navigation bar';
@override
String get demoCupertinoNavigationBarDescription => 'An iOS-styled navigation bar. The navigation bar is a toolbar that minimally consists of a page title, in the middle of the toolbar.';
@override
String get demoCupertinoPickerTitle => 'Pickers';
@override
String get demoCupertinoPickerSubtitle => 'iOS-style pickers';
@override
String get demoCupertinoPickerDescription => 'An iOS-style picker widget that can be used to select strings, dates, times or both date and time.';
@override
String get demoCupertinoPickerTimer => 'Timer';
@override
String get demoCupertinoPicker => 'Picker';
@override
String get demoCupertinoPickerDate => 'Date';
@override
String get demoCupertinoPickerTime => 'Time';
@override
String get demoCupertinoPickerDateTime => 'Date and time';
@override
String get demoCupertinoPullToRefreshTitle => 'Pull to refresh';
@override
String get demoCupertinoPullToRefreshSubtitle => 'iOS-style pull to refresh control';
@override
String get demoCupertinoPullToRefreshDescription => 'A widget implementing the iOS-style pull to refresh content control.';
@override
String get demoCupertinoSegmentedControlTitle => 'Segmented control';
@override
String get demoCupertinoSegmentedControlSubtitle => 'iOS-style segmented control';
@override
String get demoCupertinoSegmentedControlDescription => 'Used to select between a number of mutually exclusive options. When one option in the segmented control is selected, the other options in the segmented control cease to be selected.';
@override
String get demoCupertinoSliderTitle => 'Slider';
@override
String get demoCupertinoSliderSubtitle => 'iOS-style slider';
@override
String get demoCupertinoSliderDescription => 'A slider can be used to select from either a continuous or a discrete set of values.';
@override
String demoCupertinoSliderContinuous(Object value) {
return 'Continuous: $value';
}
@override
String demoCupertinoSliderDiscrete(Object value) {
return 'Discrete: $value';
}
@override
String get demoCupertinoSwitchSubtitle => 'iOS-style switch';
@override
String get demoCupertinoSwitchDescription => 'A switch is used to toggle the on/off state of a single setting.';
@override
String get demoCupertinoTabBarTitle => 'Tab bar';
@override
String get demoCupertinoTabBarSubtitle => 'iOS-style bottom tab bar';
@override
String get demoCupertinoTabBarDescription => 'An iOS-style bottom navigation tab bar. Displays multiple tabs with one tab being active, the first tab by default.';
@override
String get cupertinoTabBarHomeTab => 'Home';
@override
String get cupertinoTabBarChatTab => 'Chat';
@override
String get cupertinoTabBarProfileTab => 'Profile';
@override
String get demoCupertinoTextFieldTitle => 'Text fields';
@override
String get demoCupertinoTextFieldSubtitle => 'iOS-style text fields';
@override
String get demoCupertinoTextFieldDescription => 'A text field allows the user to enter text, either with a hardware keyboard or with an on-screen keyboard.';
@override
String get demoCupertinoTextFieldPIN => 'PIN';
@override
String get demoCupertinoSearchTextFieldTitle => 'Search text field';
@override
String get demoCupertinoSearchTextFieldSubtitle => 'iOS-style search text field';
@override
String get demoCupertinoSearchTextFieldDescription => 'A search text field that lets the user search by entering text and that can offer and filter suggestions.';
@override
String get demoCupertinoSearchTextFieldPlaceholder => 'Enter some text';
@override
String get demoCupertinoScrollbarTitle => 'Scrollbar';
@override
String get demoCupertinoScrollbarSubtitle => 'iOS-style scrollbar';
@override
String get demoCupertinoScrollbarDescription => 'A scrollbar that wraps the given child';
@override
String get demoMotionTitle => 'Motion';
@override
String get demoMotionSubtitle => 'All of the predefined transition patterns';
@override
String get demoContainerTransformDemoInstructions => 'Cards, lists and FAB';
@override
String get demoSharedXAxisDemoInstructions => 'Next and back buttons';
@override
String get demoSharedYAxisDemoInstructions => "Sort by 'Recently played'";
@override
String get demoSharedZAxisDemoInstructions => 'Settings icon button';
@override
String get demoFadeThroughDemoInstructions => 'Bottom navigation';
@override
String get demoFadeScaleDemoInstructions => 'Modal and FAB';
@override
String get demoContainerTransformTitle => 'Container transform';
@override
String get demoContainerTransformDescription => 'The container transform pattern is designed for transitions between UI elements that include a container. This pattern creates a visible connection between two UI elements';
@override
String get demoContainerTransformModalBottomSheetTitle => 'Fade mode';
@override
String get demoContainerTransformTypeFade => 'FADE';
@override
String get demoContainerTransformTypeFadeThrough => 'FADE THROUGH';
@override
String get demoMotionPlaceholderTitle => 'Title';
@override
String get demoMotionPlaceholderSubtitle => 'Secondary text';
@override
String get demoMotionSmallPlaceholderSubtitle => 'Secondary';
@override
String get demoMotionDetailsPageTitle => 'Details page';
@override
String get demoMotionListTileTitle => 'List item';
@override
String get demoSharedAxisDescription => 'The shared axis pattern is used for transitions between the UI elements that have a spatial or navigational relationship. This pattern uses a shared transformation on the x, y or z axis to reinforce the relationship between elements.';
@override
String get demoSharedXAxisTitle => 'Shared x-axis';
@override
String get demoSharedXAxisBackButtonText => 'BACK';
@override
String get demoSharedXAxisNextButtonText => 'NEXT';
@override
String get demoSharedXAxisCoursePageTitle => 'Streamline your courses';
@override
String get demoSharedXAxisCoursePageSubtitle => 'Bundled categories appear as groups in your feed. You can always change this later.';
@override
String get demoSharedXAxisArtsAndCraftsCourseTitle => 'Arts and crafts';
@override
String get demoSharedXAxisBusinessCourseTitle => 'Business';
@override
String get demoSharedXAxisIllustrationCourseTitle => 'Illustration';
@override
String get demoSharedXAxisDesignCourseTitle => 'Design';
@override
String get demoSharedXAxisCulinaryCourseTitle => 'Culinary';
@override
String get demoSharedXAxisBundledCourseSubtitle => 'Bundled';
@override
String get demoSharedXAxisIndividualCourseSubtitle => 'Shown individually';
@override
String get demoSharedXAxisSignInWelcomeText => 'Hi David Park';
@override
String get demoSharedXAxisSignInSubtitleText => 'Sign in with your account';
@override
String get demoSharedXAxisSignInTextFieldLabel => 'Email or phone number';
@override
String get demoSharedXAxisForgotEmailButtonText => 'FORGOT EMAIL?';
@override
String get demoSharedXAxisCreateAccountButtonText => 'CREATE ACCOUNT';
@override
String get demoSharedYAxisTitle => 'Shared y-axis';
@override
String get demoSharedYAxisAlbumCount => '268 albums';
@override
String get demoSharedYAxisAlphabeticalSortTitle => 'A–Z';
@override
String get demoSharedYAxisRecentSortTitle => 'Recently played';
@override
String get demoSharedYAxisAlbumTileTitle => 'Album';
@override
String get demoSharedYAxisAlbumTileSubtitle => 'Artist';
@override
String get demoSharedYAxisAlbumTileDurationUnit => 'min';
@override
String get demoSharedZAxisTitle => 'Shared z-axis';
@override
String get demoSharedZAxisSettingsPageTitle => 'Settings';
@override
String get demoSharedZAxisBurgerRecipeTitle => 'Burger';
@override
String get demoSharedZAxisBurgerRecipeDescription => 'Burger recipe';
@override
String get demoSharedZAxisSandwichRecipeTitle => 'Sandwich';
@override
String get demoSharedZAxisSandwichRecipeDescription => 'Sandwich recipe';
@override
String get demoSharedZAxisDessertRecipeTitle => 'Dessert';
@override
String get demoSharedZAxisDessertRecipeDescription => 'Dessert recipe';
@override
String get demoSharedZAxisShrimpPlateRecipeTitle => 'Shrimp';
@override
String get demoSharedZAxisShrimpPlateRecipeDescription => 'Shrimp plate recipe';
@override
String get demoSharedZAxisCrabPlateRecipeTitle => 'Crab';
@override
String get demoSharedZAxisCrabPlateRecipeDescription => 'Crab plate recipe';
@override
String get demoSharedZAxisBeefSandwichRecipeTitle => 'Beef sandwich';
@override
String get demoSharedZAxisBeefSandwichRecipeDescription => 'Beef sandwich recipe';
@override
String get demoSharedZAxisSavedRecipesListTitle => 'Saved recipes';
@override
String get demoSharedZAxisProfileSettingLabel => 'Profile';
@override
String get demoSharedZAxisNotificationSettingLabel => 'Notifications';
@override
String get demoSharedZAxisPrivacySettingLabel => 'Privacy';
@override
String get demoSharedZAxisHelpSettingLabel => 'Help';
@override
String get demoFadeThroughTitle => 'Fade through';
@override
String get demoFadeThroughDescription => 'The fade-through pattern is used for transitions between UI elements that do not have a strong relationship to each other.';
@override
String get demoFadeThroughAlbumsDestination => 'Albums';
@override
String get demoFadeThroughPhotosDestination => 'Photos';
@override
String get demoFadeThroughSearchDestination => 'Search';
@override
String get demoFadeThroughTextPlaceholder => '123 photos';
@override
String get demoFadeScaleTitle => 'Fade';
@override
String get demoFadeScaleDescription => 'The fade pattern is used for UI elements that enter or exit within the bounds of the screen, such as a dialogue that fades in the centre of the screen.';
@override
String get demoFadeScaleShowAlertDialogButton => 'SHOW MODAL';
@override
String get demoFadeScaleShowFabButton => 'SHOW FAB';
@override
String get demoFadeScaleHideFabButton => 'HIDE FAB';
@override
String get demoFadeScaleAlertDialogHeader => 'Alert dialogue';
@override
String get demoFadeScaleAlertDialogCancelButton => 'CANCEL';
@override
String get demoFadeScaleAlertDialogDiscardButton => 'DISCARD';
@override
String get demoColorsTitle => 'Colours';
@override
String get demoColorsSubtitle => 'All of the predefined colours';
@override
String get demoColorsDescription => "Colour and colour swatch constants which represent Material Design's colour palette.";
@override
String get demoTypographyTitle => 'Typography';
@override
String get demoTypographySubtitle => 'All of the predefined text styles';
@override
String get demoTypographyDescription => 'Definitions for the various typographical styles found in Material Design.';
@override
String get demo2dTransformationsTitle => '2D transformations';
@override
String get demo2dTransformationsSubtitle => 'Pan, zoom, rotate';
@override
String get demo2dTransformationsDescription => 'Tap to edit tiles, and use gestures to move around the scene. Drag to pan, pinch to zoom, rotate with two fingers. Press the reset button to return to the starting orientation.';
@override
String get demo2dTransformationsResetTooltip => 'Reset transformations';
@override
String get demo2dTransformationsEditTooltip => 'Edit tile';
@override
String get buttonText => 'BUTTON';
@override
String get demoBottomSheetTitle => 'Bottom sheet';
@override
String get demoBottomSheetSubtitle => 'Persistent and modal bottom sheets';
@override
String get demoBottomSheetPersistentTitle => 'Persistent bottom sheet';
@override
String get demoBottomSheetPersistentDescription => 'A persistent bottom sheet shows information that supplements the primary content of the app. A persistent bottom sheet remains visible even when the user interacts with other parts of the app.';
@override
String get demoBottomSheetModalTitle => 'Modal bottom sheet';
@override
String get demoBottomSheetModalDescription => 'A modal bottom sheet is an alternative to a menu or a dialogue and prevents the user from interacting with the rest of the app.';
@override
String get demoBottomSheetAddLabel => 'Add';
@override
String get demoBottomSheetButtonText => 'SHOW BOTTOM SHEET';
@override
String get demoBottomSheetHeader => 'Header';
@override
String demoBottomSheetItem(Object value) {
return 'Item $value';
}
@override
String get demoListsTitle => 'Lists';
@override
String get demoListsSubtitle => 'Scrolling list layouts';
@override
String get demoListsDescription => 'A single fixed-height row that typically contains some text as well as a leading or trailing icon.';
@override
String get demoOneLineListsTitle => 'One line';
@override
String get demoTwoLineListsTitle => 'Two lines';
@override
String get demoListsSecondary => 'Secondary text';
@override
String get demoProgressIndicatorTitle => 'Progress indicators';
@override
String get demoProgressIndicatorSubtitle => 'Linear, circular, indeterminate';
@override
String get demoCircularProgressIndicatorTitle => 'Circular progress indicator';
@override
String get demoCircularProgressIndicatorDescription => 'A material design circular progress indicator, which spins to indicate that the application is busy.';
@override
String get demoLinearProgressIndicatorTitle => 'Linear progress indicator';
@override
String get demoLinearProgressIndicatorDescription => 'A material design linear progress indicator, also known as a progress bar.';
@override
String get demoPickersTitle => 'Pickers';
@override
String get demoPickersSubtitle => 'Date and time selection';
@override
String get demoDatePickerTitle => 'Date picker';
@override
String get demoDatePickerDescription => 'Shows a dialogue containing a material design date picker.';
@override
String get demoTimePickerTitle => 'Time picker';
@override
String get demoTimePickerDescription => 'Shows a dialogue containing a material design time picker.';
@override
String get demoDateRangePickerTitle => 'Date range picker';
@override
String get demoDateRangePickerDescription => 'Shows a dialogue containing a Material Design date range picker.';
@override
String get demoPickersShowPicker => 'SHOW PICKER';
@override
String get demoTabsTitle => 'Tabs';
@override
String get demoTabsScrollingTitle => 'Scrolling';
@override
String get demoTabsNonScrollingTitle => 'Non-scrolling';
@override
String get demoTabsSubtitle => 'Tabs with independently scrollable views';
@override
String get demoTabsDescription => 'Tabs organise content across different screens, data sets and other interactions.';
@override
String get demoSnackbarsTitle => 'Snackbars';
@override
String get demoSnackbarsSubtitle => 'Snackbars show messages at the bottom of the screen';
@override
String get demoSnackbarsDescription => "Snackbars inform users of a process that an app has performed or will perform. They appear temporarily, towards the bottom of the screen. They shouldn't interrupt the user experience, and they don't require user input to disappear.";
@override
String get demoSnackbarsButtonLabel => 'SHOW A SNACKBAR';
@override
String get demoSnackbarsText => 'This is a snackbar.';
@override
String get demoSnackbarsActionButtonLabel => 'ACTION';
@override
String get demoSnackbarsAction => 'You pressed the snackbar action.';
@override
String get demoSelectionControlsTitle => 'Selection controls';
@override
String get demoSelectionControlsSubtitle => 'Tick boxes, radio buttons and switches';
@override
String get demoSelectionControlsCheckboxTitle => 'Tick box';
@override
String get demoSelectionControlsCheckboxDescription => "Tick boxes allow the user to select multiple options from a set. A normal tick box's value is true or false and a tristate tick box's value can also be null.";
@override
String get demoSelectionControlsRadioTitle => 'Radio';
@override
String get demoSelectionControlsRadioDescription => 'Radio buttons allow the user to select one option from a set. Use radio buttons for exclusive selection if you think that the user needs to see all available options side by side.';
@override
String get demoSelectionControlsSwitchTitle => 'Switch';
@override
String get demoSelectionControlsSwitchDescription => "On/off switches toggle the state of a single settings option. The option that the switch controls, as well as the state it's in, should be made clear from the corresponding inline label.";
@override
String get demoBottomTextFieldsTitle => 'Text fields';
@override
String get demoTextFieldTitle => 'Text fields';
@override
String get demoTextFieldSubtitle => 'Single line of editable text and numbers';
@override
String get demoTextFieldDescription => 'Text fields allow users to enter text into a UI. They typically appear in forms and dialogues.';
@override
String get demoTextFieldShowPasswordLabel => 'Show password';
@override
String get demoTextFieldHidePasswordLabel => 'Hide password';
@override
String get demoTextFieldFormErrors => 'Please fix the errors in red before submitting.';
@override
String get demoTextFieldNameRequired => 'Name is required.';
@override
String get demoTextFieldOnlyAlphabeticalChars => 'Please enter only alphabetical characters.';
@override
String get demoTextFieldEnterUSPhoneNumber => '(###) ###-#### – Enter a US phone number.';
@override
String get demoTextFieldEnterPassword => 'Please enter a password.';
@override
String get demoTextFieldPasswordsDoNotMatch => "The passwords don't match";
@override
String get demoTextFieldWhatDoPeopleCallYou => 'What do people call you?';
@override
String get demoTextFieldNameField => 'Name*';
@override
String get demoTextFieldWhereCanWeReachYou => 'Where can we contact you?';
@override
String get demoTextFieldPhoneNumber => 'Phone number*';
@override
String get demoTextFieldYourEmailAddress => 'Your email address';
@override
String get demoTextFieldEmail => 'Email';
@override
String get demoTextFieldTellUsAboutYourself => 'Tell us about yourself (e.g. write down what you do or what hobbies you have)';
@override
String get demoTextFieldKeepItShort => 'Keep it short, this is just a demo.';
@override
String get demoTextFieldLifeStory => 'Life story';
@override
String get demoTextFieldSalary => 'Salary';
@override
String get demoTextFieldUSD => 'USD';
@override
String get demoTextFieldNoMoreThan => 'No more than 8 characters.';
@override
String get demoTextFieldPassword => 'Password*';
@override
String get demoTextFieldRetypePassword => 'Re-type password*';
@override
String get demoTextFieldSubmit => 'SUBMIT';
@override
String demoTextFieldNameHasPhoneNumber(Object name, Object phoneNumber) {
return '$name phone number is $phoneNumber';
}
@override
String get demoTextFieldRequiredField => '* indicates required field';
@override
String get demoTooltipTitle => 'Tooltips';
@override
String get demoTooltipSubtitle => 'Short message displayed on long press or hover';
@override
String get demoTooltipDescription => 'Tooltips provide text labels that help to explain the function of a button or other user interface action. Tooltips display informative text when users hover over, focus on or long press an element.';
@override
String get demoTooltipInstructions => 'Long press or hover to display the tooltip.';
@override
String get bottomNavigationCommentsTab => 'Comments';
@override
String get bottomNavigationCalendarTab => 'Calendar';
@override
String get bottomNavigationAccountTab => 'Account';
@override
String get bottomNavigationAlarmTab => 'Alarm';
@override
String get bottomNavigationCameraTab => 'Camera';
@override
String bottomNavigationContentPlaceholder(Object title) {
return 'Placeholder for $title tab';
}
@override
String get buttonTextCreate => 'Create';
@override
String dialogSelectedOption(Object value) {
return "You selected: '$value'";
}
@override
String get chipTurnOnLights => 'Turn on lights';
@override
String get chipSmall => 'Small';
@override
String get chipMedium => 'Medium';
@override
String get chipLarge => 'Large';
@override
String get chipElevator => 'Lift';
@override
String get chipWasher => 'Washing machine';
@override
String get chipFireplace => 'Fireplace';
@override
String get chipBiking => 'Cycling';
@override
String get demo => 'Demo';
@override
String get bottomAppBar => 'Bottom app bar';
@override
String get loading => 'Loading';
@override
String get dialogDiscardTitle => 'Discard draft?';
@override
String get dialogLocationTitle => "Use Google's location service?";
@override
String get dialogLocationDescription => 'Let Google help apps determine location. This means sending anonymous location data to Google, even when no apps are running.';
@override
String get dialogCancel => 'CANCEL';
@override
String get dialogDiscard => 'DISCARD';
@override
String get dialogDisagree => 'DISAGREE';
@override
String get dialogAgree => 'AGREE';
@override
String get dialogSetBackup => 'Set backup account';
@override
String get dialogAddAccount => 'Add account';
@override
String get dialogShow => 'SHOW DIALOGUE';
@override
String get dialogFullscreenTitle => 'Full-Screen Dialogue';
@override
String get dialogFullscreenSave => 'SAVE';
@override
String get dialogFullscreenDescription => 'A full-screen dialogue demo';
@override
String get cupertinoButton => 'Button';
@override
String get cupertinoButtonWithBackground => 'With background';
@override
String get cupertinoAlertCancel => 'Cancel';
@override
String get cupertinoAlertDiscard => 'Discard';
@override
String get cupertinoAlertLocationTitle => "Allow 'Maps' to access your location while you are using the app?";
@override
String get cupertinoAlertLocationDescription => 'Your current location will be displayed on the map and used for directions, nearby search results and estimated travel times.';
@override
String get cupertinoAlertAllow => 'Allow';
@override
String get cupertinoAlertDontAllow => "Don't allow";
@override
String get cupertinoAlertFavoriteDessert => 'Select Favourite Dessert';
@override
String get cupertinoAlertDessertDescription => 'Please select your favourite type of dessert from the list below. Your selection will be used to customise the suggested list of eateries in your area.';
@override
String get cupertinoAlertCheesecake => 'Cheesecake';
@override
String get cupertinoAlertTiramisu => 'Tiramisu';
@override
String get cupertinoAlertApplePie => 'Apple Pie';
@override
String get cupertinoAlertChocolateBrownie => 'Chocolate brownie';
@override
String get cupertinoShowAlert => 'Show alert';
@override
String get colorsRed => 'RED';
@override
String get colorsPink => 'PINK';
@override
String get colorsPurple => 'PURPLE';
@override
String get colorsDeepPurple => 'DEEP PURPLE';
@override
String get colorsIndigo => 'INDIGO';
@override
String get colorsBlue => 'BLUE';
@override
String get colorsLightBlue => 'LIGHT BLUE';
@override
String get colorsCyan => 'CYAN';
@override
String get colorsTeal => 'TEAL';
@override
String get colorsGreen => 'GREEN';
@override
String get colorsLightGreen => 'LIGHT GREEN';
@override
String get colorsLime => 'LIME';
@override
String get colorsYellow => 'YELLOW';
@override
String get colorsAmber => 'AMBER';
@override
String get colorsOrange => 'ORANGE';
@override
String get colorsDeepOrange => 'DEEP ORANGE';
@override
String get colorsBrown => 'BROWN';
@override
String get colorsGrey => 'GREY';
@override
String get colorsBlueGrey => 'BLUE GREY';
@override
String get placeChennai => 'Chennai';
@override
String get placeTanjore => 'Tanjore';
@override
String get placeChettinad => 'Chettinad';
@override
String get placePondicherry => 'Pondicherry';
@override
String get placeFlowerMarket => 'Flower market';
@override
String get placeBronzeWorks => 'Bronze works';
@override
String get placeMarket => 'Market';
@override
String get placeThanjavurTemple => 'Thanjavur Temple';
@override
String get placeSaltFarm => 'Salt farm';
@override
String get placeScooters => 'Scooters';
@override
String get placeSilkMaker => 'Silk maker';
@override
String get placeLunchPrep => 'Lunch prep';
@override
String get placeBeach => 'Beach';
@override
String get placeFisherman => 'Fisherman';
@override
String get starterAppTitle => 'Starter app';
@override
String get starterAppDescription => 'A responsive starter layout';
@override
String get starterAppGenericButton => 'BUTTON';
@override
String get starterAppTooltipAdd => 'Add';
@override
String get starterAppTooltipFavorite => 'Favourite';
@override
String get starterAppTooltipShare => 'Share';
@override
String get starterAppTooltipSearch => 'Search';
@override
String get starterAppGenericTitle => 'Title';
@override
String get starterAppGenericSubtitle => 'Subtitle';
@override
String get starterAppGenericHeadline => 'Headline';
@override
String get starterAppGenericBody => 'Body';
@override
String starterAppDrawerItem(Object value) {
return 'Item $value';
}
@override
String get shrineMenuCaption => 'MENU';
@override
String get shrineCategoryNameAll => 'ALL';
@override
String get shrineCategoryNameAccessories => 'ACCESSORIES';
@override
String get shrineCategoryNameClothing => 'CLOTHING';
@override
String get shrineCategoryNameHome => 'HOME';
@override
String get shrineLogoutButtonCaption => 'LOGOUT';
@override
String get shrineLoginUsernameLabel => 'Username';
@override
String get shrineLoginPasswordLabel => 'Password';
@override
String get shrineCancelButtonCaption => 'CANCEL';
@override
String get shrineNextButtonCaption => 'NEXT';
@override
String get shrineCartPageCaption => 'BASKET';
@override
String shrineProductQuantity(Object quantity) {
return 'Quantity: $quantity';
}
@override
String shrineProductPrice(Object price) {
return 'x $price';
}
@override
String shrineCartItemCount(num quantity) {
final String temp0 = intl.Intl.pluralLogic(
quantity,
locale: localeName,
other: '$quantity ITEMS',
one: '1 ITEM',
zero: 'NO ITEMS',
);
return temp0;
}
@override
String get shrineCartClearButtonCaption => 'CLEAR BASKET';
@override
String get shrineCartTotalCaption => 'TOTAL';
@override
String get shrineCartSubtotalCaption => 'Subtotal:';
@override
String get shrineCartShippingCaption => 'Delivery:';
@override
String get shrineCartTaxCaption => 'Tax:';
@override
String get shrineProductVagabondSack => 'Vagabond sack';
@override
String get shrineProductStellaSunglasses => 'Stella sunglasses';
@override
String get shrineProductWhitneyBelt => 'Whitney belt';
@override
String get shrineProductGardenStrand => 'Garden strand';
@override
String get shrineProductStrutEarrings => 'Strut earrings';
@override
String get shrineProductVarsitySocks => 'Varsity socks';
@override
String get shrineProductWeaveKeyring => 'Weave keyring';
@override
String get shrineProductGatsbyHat => 'Gatsby hat';
@override
String get shrineProductShrugBag => 'Shrug bag';
@override
String get shrineProductGiltDeskTrio => 'Gilt desk trio';
@override
String get shrineProductCopperWireRack => 'Copper wire rack';
@override
String get shrineProductSootheCeramicSet => 'Soothe ceramic set';
@override
String get shrineProductHurrahsTeaSet => 'Hurrahs tea set';
@override
String get shrineProductBlueStoneMug => 'Blue stone mug';
@override
String get shrineProductRainwaterTray => 'Rainwater tray';
@override
String get shrineProductChambrayNapkins => 'Chambray napkins';
@override
String get shrineProductSucculentPlanters => 'Succulent planters';
@override
String get shrineProductQuartetTable => 'Quartet table';
@override
String get shrineProductKitchenQuattro => 'Kitchen quattro';
@override
String get shrineProductClaySweater => 'Clay sweater';
@override
String get shrineProductSeaTunic => 'Sea tunic';
@override
String get shrineProductPlasterTunic => 'Plaster tunic';
@override
String get shrineProductWhitePinstripeShirt => 'White pinstripe shirt';
@override
String get shrineProductChambrayShirt => 'Chambray shirt';
@override
String get shrineProductSeabreezeSweater => 'Seabreeze sweater';
@override
String get shrineProductGentryJacket => 'Gentry jacket';
@override
String get shrineProductNavyTrousers => 'Navy trousers';
@override
String get shrineProductWalterHenleyWhite => 'Walter henley (white)';
@override
String get shrineProductSurfAndPerfShirt => 'Surf and perf shirt';
@override
String get shrineProductGingerScarf => 'Ginger scarf';
@override
String get shrineProductRamonaCrossover => 'Ramona crossover';
@override
String get shrineProductClassicWhiteCollar => 'Classic white collar';
@override
String get shrineProductCeriseScallopTee => 'Cerise scallop tee';
@override
String get shrineProductShoulderRollsTee => 'Shoulder rolls tee';
@override
String get shrineProductGreySlouchTank => 'Grey slouch tank top';
@override
String get shrineProductSunshirtDress => 'Sunshirt dress';
@override
String get shrineProductFineLinesTee => 'Fine lines tee';
@override
String get shrineTooltipSearch => 'Search';
@override
String get shrineTooltipSettings => 'Settings';
@override
String get shrineTooltipOpenMenu => 'Open menu';
@override
String get shrineTooltipCloseMenu => 'Close menu';
@override
String get shrineTooltipCloseCart => 'Close basket';
@override
String shrineScreenReaderCart(num quantity) {
final String temp0 = intl.Intl.pluralLogic(
quantity,
locale: localeName,
other: 'Shopping basket, $quantity items',
one: 'Shopping basket, 1 item',
zero: 'Shopping basket, no items',
);
return temp0;
}
@override
String get shrineScreenReaderProductAddToCart => 'Add to basket';
@override
String shrineScreenReaderRemoveProductButton(Object product) {
return 'Remove $product';
}
@override
String get shrineTooltipRemoveItem => 'Remove item';
@override
String get craneFormDiners => 'Diners';
@override
String get craneFormDate => 'Select date';
@override
String get craneFormTime => 'Select time';
@override
String get craneFormLocation => 'Select location';
@override
String get craneFormTravelers => 'Travellers';
@override
String get craneFormOrigin => 'Choose origin';
@override
String get craneFormDestination => 'Choose destination';
@override
String get craneFormDates => 'Select dates';
@override
String craneHours(num hours) {
final String temp0 = intl.Intl.pluralLogic(
hours,
locale: localeName,
other: '${hours}h',
one: '1 h',
);
return temp0;
}
@override
String craneMinutes(num minutes) {
final String temp0 = intl.Intl.pluralLogic(
minutes,
locale: localeName,
other: '${minutes}m',
one: '1 m',
);
return temp0;
}
@override
String craneFlightDuration(Object hoursShortForm, Object minutesShortForm) {
return '$hoursShortForm $minutesShortForm';
}
@override
String get craneFly => 'FLY';
@override
String get craneSleep => 'SLEEP';
@override
String get craneEat => 'EAT';
@override
String get craneFlySubhead => 'Explore flights by destination';
@override
String get craneSleepSubhead => 'Explore properties by destination';
@override
String get craneEatSubhead => 'Explore restaurants by destination';
@override
String craneFlyStops(num numberOfStops) {
final String temp0 = intl.Intl.pluralLogic(
numberOfStops,
locale: localeName,
other: '$numberOfStops stops',
one: '1 stop',
zero: 'Non-stop',
);
return temp0;
}
@override
String craneSleepProperties(num totalProperties) {
final String temp0 = intl.Intl.pluralLogic(
totalProperties,
locale: localeName,
other: '$totalProperties available properties',
one: '1 available property',
zero: 'No available properties',
);
return temp0;
}
@override
String craneEatRestaurants(num totalRestaurants) {
return intl.Intl.pluralLogic(
totalRestaurants,
locale: localeName,
other: '$totalRestaurants restaurants',
one: '1 restaurant',
zero: 'No restaurants',
);
}
@override
String get craneFly0 => 'Aspen, United States';
@override
String get craneFly1 => 'Big Sur, United States';
@override
String get craneFly2 => 'Khumbu Valley, Nepal';
@override
String get craneFly3 => 'Machu Picchu, Peru';
@override
String get craneFly4 => 'Malé, Maldives';
@override
String get craneFly5 => 'Vitznau, Switzerland';
@override
String get craneFly6 => 'Mexico City, Mexico';
@override
String get craneFly7 => 'Mount Rushmore, United States';
@override
String get craneFly8 => 'Singapore';
@override
String get craneFly9 => 'Havana, Cuba';
@override
String get craneFly10 => 'Cairo, Egypt';
@override
String get craneFly11 => 'Lisbon, Portugal';
@override
String get craneFly12 => 'Napa, United States';
@override
String get craneFly13 => 'Bali, Indonesia';
@override
String get craneSleep0 => 'Malé, Maldives';
@override
String get craneSleep1 => 'Aspen, United States';
@override
String get craneSleep2 => 'Machu Picchu, Peru';
@override
String get craneSleep3 => 'Havana, Cuba';
@override
String get craneSleep4 => 'Vitznau, Switzerland';
@override
String get craneSleep5 => 'Big Sur, United States';
@override
String get craneSleep6 => 'Napa, United States';
@override
String get craneSleep7 => 'Porto, Portugal';
@override
String get craneSleep8 => 'Tulum, Mexico';
@override
String get craneSleep9 => 'Lisbon, Portugal';
@override
String get craneSleep10 => 'Cairo, Egypt';
@override
String get craneSleep11 => 'Taipei, Taiwan';
@override
String get craneEat0 => 'Naples, Italy';
@override
String get craneEat1 => 'Dallas, United States';
@override
String get craneEat2 => 'Córdoba, Argentina';
@override
String get craneEat3 => 'Portland, United States';
@override
String get craneEat4 => 'Paris, France';
@override
String get craneEat5 => 'Seoul, South Korea';
@override
String get craneEat6 => 'Seattle, United States';
@override
String get craneEat7 => 'Nashville, United States';
@override
String get craneEat8 => 'Atlanta, United States';
@override
String get craneEat9 => 'Madrid, Spain';
@override
String get craneEat10 => 'Lisbon, Portugal';
@override
String get craneFly0SemanticLabel => 'Chalet in a snowy landscape with evergreen trees';
@override
String get craneFly1SemanticLabel => 'Tent in a field';
@override
String get craneFly2SemanticLabel => 'Prayer flags in front of snowy mountain';
@override
String get craneFly3SemanticLabel => 'Machu Picchu citadel';
@override
String get craneFly4SemanticLabel => 'Overwater bungalows';
@override
String get craneFly5SemanticLabel => 'Lake-side hotel in front of mountains';
@override
String get craneFly6SemanticLabel => 'Aerial view of Palacio de Bellas Artes';
@override
String get craneFly7SemanticLabel => 'Mount Rushmore';
@override
String get craneFly8SemanticLabel => 'Supertree Grove';
@override
String get craneFly9SemanticLabel => 'Man leaning on an antique blue car';
@override
String get craneFly10SemanticLabel => 'Al-Azhar Mosque towers during sunset';
@override
String get craneFly11SemanticLabel => 'Brick lighthouse at sea';
@override
String get craneFly12SemanticLabel => 'Pool with palm trees';
@override
String get craneFly13SemanticLabel => 'Seaside pool with palm trees';
@override
String get craneSleep0SemanticLabel => 'Overwater bungalows';
@override
String get craneSleep1SemanticLabel => 'Chalet in a snowy landscape with evergreen trees';
@override
String get craneSleep2SemanticLabel => 'Machu Picchu citadel';
@override
String get craneSleep3SemanticLabel => 'Man leaning on an antique blue car';
@override
String get craneSleep4SemanticLabel => 'Lake-side hotel in front of mountains';
@override
String get craneSleep5SemanticLabel => 'Tent in a field';
@override
String get craneSleep6SemanticLabel => 'Pool with palm trees';
@override
String get craneSleep7SemanticLabel => 'Colourful apartments at Ribeira Square';
@override
String get craneSleep8SemanticLabel => 'Mayan ruins on a cliff above a beach';
@override
String get craneSleep9SemanticLabel => 'Brick lighthouse at sea';
@override
String get craneSleep10SemanticLabel => 'Al-Azhar Mosque towers during sunset';
@override
String get craneSleep11SemanticLabel => 'Taipei 101 skyscraper';
@override
String get craneEat0SemanticLabel => 'Pizza in a wood-fired oven';
@override
String get craneEat1SemanticLabel => 'Empty bar with diner-style stools';
@override
String get craneEat2SemanticLabel => 'Burger';
@override
String get craneEat3SemanticLabel => 'Korean taco';
@override
String get craneEat4SemanticLabel => 'Chocolate dessert';
@override
String get craneEat5SemanticLabel => 'Artsy restaurant seating area';
@override
String get craneEat6SemanticLabel => 'Shrimp dish';
@override
String get craneEat7SemanticLabel => 'Bakery entrance';
@override
String get craneEat8SemanticLabel => 'Plate of crawfish';
@override
String get craneEat9SemanticLabel => 'Café counter with pastries';
@override
String get craneEat10SemanticLabel => 'Woman holding huge pastrami sandwich';
@override
String get fortnightlyMenuFrontPage => 'Front page';
@override
String get fortnightlyMenuWorld => 'World';
@override
String get fortnightlyMenuUS => 'US';
@override
String get fortnightlyMenuPolitics => 'Politics';
@override
String get fortnightlyMenuBusiness => 'Business';
@override
String get fortnightlyMenuTech => 'Tech';
@override
String get fortnightlyMenuScience => 'Science';
@override
String get fortnightlyMenuSports => 'Sport';
@override
String get fortnightlyMenuTravel => 'Travel';
@override
String get fortnightlyMenuCulture => 'Culture';
@override
String get fortnightlyTrendingTechDesign => 'TechDesign';
@override
String get fortnightlyTrendingReform => 'Reform';
@override
String get fortnightlyTrendingHealthcareRevolution => 'HealthcareRevolution';
@override
String get fortnightlyTrendingGreenArmy => 'GreenArmy';
@override
String get fortnightlyTrendingStocks => 'Stocks';
@override
String get fortnightlyLatestUpdates => 'Latest updates';
@override
String get fortnightlyHeadlineHealthcare => 'The Quiet, yet Powerful Healthcare Revolution';
@override
String get fortnightlyHeadlineWar => 'Divided American Lives During War';
@override
String get fortnightlyHeadlineGasoline => 'The Future of Petrol';
@override
String get fortnightlyHeadlineArmy => 'Reforming The Green Army from Within';
@override
String get fortnightlyHeadlineStocks => 'As Stocks Stagnate, many Look to Currency';
@override
String get fortnightlyHeadlineFabrics => 'Designers use Tech to make Futuristic Fabrics';
@override
String get fortnightlyHeadlineFeminists => 'Feminists take on Partisanship';
@override
String get fortnightlyHeadlineBees => 'Farmland Bees in Short Supply';
@override
String get replyInboxLabel => 'Inbox';
@override
String get replyStarredLabel => 'Starred';
@override
String get replySentLabel => 'Sent';
@override
String get replyTrashLabel => 'Bin';
@override
String get replySpamLabel => 'Spam';
@override
String get replyDraftsLabel => 'Drafts';
@override
String get demoTwoPaneFoldableLabel => 'Foldable';
@override
String get demoTwoPaneFoldableDescription => 'This is how TwoPane behaves on a foldable device.';
@override
String get demoTwoPaneSmallScreenLabel => 'Small screen';
@override
String get demoTwoPaneSmallScreenDescription => 'This is how TwoPane behaves on a small screen device.';
@override
String get demoTwoPaneTabletLabel => 'Tablet/Desktop';
@override
String get demoTwoPaneTabletDescription => 'This is how TwoPane behaves on a larger screen like a tablet or desktop.';
@override
String get demoTwoPaneTitle => 'TwoPane';
@override
String get demoTwoPaneSubtitle => 'Responsive layouts on foldable, large and small screens';
@override
String get splashSelectDemo => 'Select a demo';
@override
String get demoTwoPaneList => 'List';
@override
String get demoTwoPaneDetails => 'Details';
@override
String get demoTwoPaneSelectItem => 'Select an item';
@override
String demoTwoPaneItem(Object value) {
return 'Item $value';
}
@override
String demoTwoPaneItemDetails(Object value) {
return 'Item $value details';
}
}
| flutter/dev/integration_tests/new_gallery/lib/gallery_localizations_en.dart/0 | {
"file_path": "flutter/dev/integration_tests/new_gallery/lib/gallery_localizations_en.dart",
"repo_id": "flutter",
"token_count": 39484
} | 527 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:math';
import 'package:flutter/material.dart';
// Color gradients.
const Color pinkLeft = Color(0xFFFF5983);
const Color pinkRight = Color(0xFFFF8383);
const Color tealLeft = Color(0xFF1CDDC8);
const Color tealRight = Color(0xFF00A5B3);
// Dimensions.
const int unitHeight = 1;
const int unitWidth = 1;
const double stickLength = 5 / 9;
const double stickWidth = 5 / 36;
const double stickRadius = stickWidth / 2;
const double knobDiameter = 5 / 54;
const double knobRadius = knobDiameter / 2;
const double stickGap = 5 / 54;
// Locations.
const double knobDistanceFromCenter = stickGap / 2 + stickWidth / 2;
const Offset lowerKnobCenter = Offset(0, knobDistanceFromCenter);
const Offset upperKnobCenter = Offset(0, -knobDistanceFromCenter);
const double knobDeviation = stickLength / 2 - stickRadius;
// Key moments in animation.
const double _colorKnobContractionBegins = 1 / 23;
const double _monoKnobExpansionEnds = 11 / 23;
const double _colorKnobContractionEnds = 14 / 23;
// Stages.
bool isTransitionPhase(double time) => time < _colorKnobContractionEnds;
// Curve easing.
const Cubic _curve = Curves.easeInOutCubic;
double _progress(
double time, {
required double begin,
required double end,
}) =>
_curve.transform(((time - begin) / (end - begin)).clamp(0, 1).toDouble());
double _monoKnobProgress(double time) => _progress(
time,
begin: 0,
end: _monoKnobExpansionEnds,
);
double _colorKnobProgress(double time) => _progress(
time,
begin: _colorKnobContractionBegins,
end: _colorKnobContractionEnds,
);
double _rotationProgress(double time) => _progress(
time,
begin: _colorKnobContractionEnds,
end: 1,
);
// Changing lengths: mono.
double monoLength(double time) =>
_monoKnobProgress(time) * (stickLength - knobDiameter) + knobDiameter;
double _monoLengthLeft(double time) =>
min(monoLength(time) - knobRadius, stickRadius);
double _monoLengthRight(double time) =>
monoLength(time) - _monoLengthLeft(time);
double _monoHorizontalOffset(double time) =>
(_monoLengthRight(time) - _monoLengthLeft(time)) / 2 - knobDeviation;
Offset upperMonoOffset(double time) =>
upperKnobCenter + Offset(_monoHorizontalOffset(time), 0);
Offset lowerMonoOffset(double time) =>
lowerKnobCenter + Offset(-_monoHorizontalOffset(time), 0);
// Changing lengths: color.
double colorLength(double time) => (1 - _colorKnobProgress(time)) * stickLength;
Offset upperColorOffset(double time) =>
upperKnobCenter + Offset(stickLength / 2 - colorLength(time) / 2, 0);
Offset lowerColorOffset(double time) =>
lowerKnobCenter + Offset(-stickLength / 2 + colorLength(time) / 2, 0);
// Moving objects.
double knobRotation(double time) => _rotationProgress(time) * pi / 4;
Offset knobCenter(double time) {
final double progress = _rotationProgress(time);
if (progress == 0) {
return lowerKnobCenter;
} else if (progress == 1) {
return upperKnobCenter;
} else {
// Calculates the current location.
final Offset center = Offset(knobDistanceFromCenter / tan(pi / 8), 0);
final double radius = (lowerKnobCenter - center).distance;
final double angle = pi + (progress - 1 / 2) * pi / 4;
return center + Offset.fromDirection(angle, radius);
}
}
| flutter/dev/integration_tests/new_gallery/lib/pages/settings_icon/metrics.dart/0 | {
"file_path": "flutter/dev/integration_tests/new_gallery/lib/pages/settings_icon/metrics.dart",
"repo_id": "flutter",
"token_count": 1171
} | 528 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/widgets.dart';
import 'email_model.dart';
const String _avatarsLocation = 'reply/avatars';
class EmailStore with ChangeNotifier {
static final List<Email> _inbox = <Email>[
InboxEmail(
id: 1,
sender: 'Google Express',
time: '15 minutes ago',
subject: 'Package shipped!',
message: 'Cucumber Mask Facial has shipped.\n\n'
"Keep an eye out for a package to arrive between this Thursday and next Tuesday. If for any reason you don't receive your package before the end of next week, please reach out to us for details on your shipment.\n\n"
'As always, thank you for shopping with us and we hope you love our specially formulated Cucumber Mask!',
avatar: '$_avatarsLocation/avatar_express.png',
recipients: 'Jeff',
),
InboxEmail(
id: 2,
sender: 'Ali Connors',
time: '4 hrs ago',
subject: 'Brunch this weekend?',
message:
"I'll be in your neighborhood doing errands and was hoping to catch you for a coffee this Saturday. If you don't have anything scheduled, it would be great to see you! It feels like its been forever.\n\n"
'If we do get a chance to get together, remind me to tell you about Kim. She stopped over at the house to say hey to the kids and told me all about her trip to Mexico.\n\n'
'Talk to you soon,\n\n'
'Ali',
avatar: '$_avatarsLocation/avatar_5.jpg',
recipients: 'Jeff',
),
InboxEmail(
id: 3,
sender: 'Allison Trabucco',
time: '5 hrs ago',
subject: 'Bonjour from Paris',
message: 'Here are some great shots from my trip...',
avatar: '$_avatarsLocation/avatar_3.jpg',
recipients: 'Jeff',
containsPictures: true,
),
InboxEmail(
id: 4,
sender: 'Trevor Hansen',
time: '9 hrs ago',
subject: 'Brazil trip',
message:
'Thought we might be able to go over some details about our upcoming vacation.\n\n'
"I've been doing a bit of research and have come across a few paces in Northern Brazil that I think we should check out. "
'One, the north has some of the most predictable wind on the planet. '
"I'd love to get out on the ocean and kitesurf for a couple of days if we're going to be anywhere near or around Taiba. "
"I hear it's beautiful there and if you're up for it, I'd love to go. Other than that, I haven't spent too much time looking into places along our road trip route. "
"I'm assuming we can find places to stay and things to do as we drive and find places we think look interesting. But... I know you're more of a planner, so if you have ideas or places in mind, lets jot some ideas down!\n\n"
'Maybe we can jump on the phone later today if you have a second.',
avatar: '$_avatarsLocation/avatar_8.jpg',
recipients: 'Allison, Kim, Jeff',
),
InboxEmail(
id: 5,
sender: 'Frank Hawkins',
time: '10 hrs ago',
subject: 'Update to Your Itinerary',
avatar: '$_avatarsLocation/avatar_4.jpg',
recipients: 'Jeff',
),
InboxEmail(
id: 6,
sender: 'Google Express',
time: '12 hrs ago',
subject: 'Delivered',
message: 'Your shoes should be waiting for you at home!',
avatar: '$_avatarsLocation/avatar_express.png',
recipients: 'Jeff',
),
InboxEmail(
id: 7,
sender: 'Frank Hawkins',
time: '4 hrs ago',
subject: 'Your update on the Google Play Store is live!',
message:
'Your update is now live on the Play Store and available for your alpha users to start testing.\n\n'
"Your alpha testers will be automatically notified. If you'd rather send them a link directly, go to your Google Play Console and follow the instructions for obtaining an open alpha testing link.",
avatar: '$_avatarsLocation/avatar_4.jpg',
recipients: 'Jeff',
),
InboxEmail(
id: 8,
sender: 'Allison Trabucco',
time: '6 hrs ago',
subject: 'Try a free TrailGo account',
message:
'Looking for the best hiking trails in your area? TrailGo gets you on the path to the outdoors faster than you can pack a sandwich.\n\n'
"Whether you're an experienced hiker or just looking to get outside for the afternoon, there's a segment that suits you.",
avatar: '$_avatarsLocation/avatar_3.jpg',
recipients: 'Jeff',
),
InboxEmail(
id: 9,
sender: 'Allison Trabucco',
time: '4 hrs ago',
subject: 'Free money',
message:
"You've been selected as a winner in our latest raffle! To claim your prize, click on the link.",
avatar: '$_avatarsLocation/avatar_3.jpg',
recipients: 'Jeff',
inboxType: InboxType.spam,
),
];
static final List<Email> _outbox = <Email>[
Email(
id: 10,
sender: 'Kim Alen',
time: '4 hrs ago',
subject: 'High school reunion?',
message:
"Hi friends,\n\nI was at the grocery store on Sunday night.. when I ran into Genie Williams! I almost didn't recognize her afer 20 years!\n\n"
"Anyway, it turns out she is on the organizing committee for the high school reunion this fall. I don't know if you were planning on going or not, but she could definitely use our help in trying to track down lots of missing alums. "
"If you can make it, we're doing a little phone-tree party at her place next Saturday, hoping that if we can find one person, thee more will...",
avatar: '$_avatarsLocation/avatar_7.jpg',
recipients: 'Jeff',
),
Email(
id: 11,
sender: 'Sandra Adams',
time: '7 hrs ago',
subject: 'Recipe to try',
message:
'Raspberry Pie: We should make this pie recipe tonight! The filling is '
'very quick to put together.',
avatar: '$_avatarsLocation/avatar_2.jpg',
recipients: 'Jeff',
),
];
static final List<Email> _drafts = <Email>[
Email(
id: 12,
sender: 'Sandra Adams',
time: '2 hrs ago',
subject: '(No subject)',
message: 'Hey,\n\n'
'Wanted to email and see what you thought of',
avatar: '$_avatarsLocation/avatar_2.jpg',
recipients: 'Jeff',
),
];
List<Email> get _allEmails => <Email>[
..._inbox,
..._outbox,
..._drafts,
];
List<Email> get inboxEmails {
return _inbox.where((Email email) {
if (email is InboxEmail) {
return email.inboxType == InboxType.normal &&
!trashEmailIds.contains(email.id);
}
return false;
}).toList();
}
List<Email> get spamEmails {
return _inbox.where((Email email) {
if (email is InboxEmail) {
return email.inboxType == InboxType.spam &&
!trashEmailIds.contains(email.id);
}
return false;
}).toList();
}
Email get currentEmail =>
_allEmails.firstWhere((Email email) => email.id == _selectedEmailId);
List<Email> get outboxEmails =>
_outbox.where((Email email) => !trashEmailIds.contains(email.id)).toList();
List<Email> get draftEmails =>
_drafts.where((Email email) => !trashEmailIds.contains(email.id)).toList();
Set<int> starredEmailIds = <int>{};
bool isEmailStarred(int id) =>
_allEmails.any((Email email) => email.id == id && starredEmailIds.contains(id));
bool get isCurrentEmailStarred => starredEmailIds.contains(currentEmail.id);
List<Email> get starredEmails {
return _allEmails
.where((Email email) => starredEmailIds.contains(email.id))
.toList();
}
void starEmail(int id) {
starredEmailIds.add(id);
notifyListeners();
}
void unstarEmail(int id) {
starredEmailIds.remove(id);
notifyListeners();
}
Set<int> trashEmailIds = <int>{7, 8};
List<Email> get trashEmails {
return _allEmails
.where((Email email) => trashEmailIds.contains(email.id))
.toList();
}
void deleteEmail(int id) {
trashEmailIds.add(id);
notifyListeners();
}
int _selectedEmailId = -1;
int get selectedEmailId => _selectedEmailId;
set selectedEmailId(int value) {
_selectedEmailId = value;
notifyListeners();
}
bool get onMailView => _selectedEmailId > -1;
MailboxPageType _selectedMailboxPage = MailboxPageType.inbox;
MailboxPageType get selectedMailboxPage => _selectedMailboxPage;
set selectedMailboxPage(MailboxPageType mailboxPage) {
_selectedMailboxPage = mailboxPage;
notifyListeners();
}
bool _onSearchPage = false;
bool get onSearchPage => _onSearchPage;
set onSearchPage(bool value) {
_onSearchPage = value;
notifyListeners();
}
}
| flutter/dev/integration_tests/new_gallery/lib/studies/reply/model/email_store.dart/0 | {
"file_path": "flutter/dev/integration_tests/new_gallery/lib/studies/reply/model/email_store.dart",
"repo_id": "flutter",
"token_count": 3379
} | 529 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
class MaterialDemoThemeData {
static final ThemeData themeData = ThemeData(
colorScheme: _colorScheme.copyWith(
background: Colors.white,
),
canvasColor: _colorScheme.background,
highlightColor: Colors.transparent,
indicatorColor: _colorScheme.onPrimary,
scaffoldBackgroundColor: _colorScheme.background,
secondaryHeaderColor: _colorScheme.background,
typography: Typography.material2018(
platform: defaultTargetPlatform,
),
visualDensity: VisualDensity.standard,
// Component themes
appBarTheme: AppBarTheme(
color: _colorScheme.primary,
iconTheme: IconThemeData(color: _colorScheme.onPrimary),
),
bottomAppBarTheme: BottomAppBarTheme(
color: _colorScheme.primary,
),
checkboxTheme: CheckboxThemeData(
fillColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return null;
}
return states.contains(MaterialState.selected)
? _colorScheme.primary
: null;
}),
),
radioTheme: RadioThemeData(
fillColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return null;
}
return states.contains(MaterialState.selected)
? _colorScheme.primary
: null;
}),
),
snackBarTheme: const SnackBarThemeData(
behavior: SnackBarBehavior.floating,
),
switchTheme: SwitchThemeData(
thumbColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return null;
}
return states.contains(MaterialState.selected)
? _colorScheme.primary
: null;
}),
trackColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return null;
}
return states.contains(MaterialState.selected)
? _colorScheme.primary.withAlpha(0x80)
: null;
}),
));
static const ColorScheme _colorScheme = ColorScheme(
primary: Color(0xFF6200EE),
primaryContainer: Color(0xFF6200EE),
secondary: Color(0xFFFF5722),
secondaryContainer: Color(0xFFFF5722),
background: Colors.white,
surface: Color(0xFFF2F2F2),
onBackground: Colors.black,
onSurface: Colors.black,
error: Colors.red,
onError: Colors.white,
onPrimary: Colors.white,
onSecondary: Colors.white,
brightness: Brightness.light,
);
}
| flutter/dev/integration_tests/new_gallery/lib/themes/material_demo_theme_data.dart/0 | {
"file_path": "flutter/dev/integration_tests/new_gallery/lib/themes/material_demo_theme_data.dart",
"repo_id": "flutter",
"token_count": 1270
} | 530 |
#include "Generated.xcconfig"
| flutter/dev/integration_tests/non_nullable/ios/Flutter/Debug.xcconfig/0 | {
"file_path": "flutter/dev/integration_tests/non_nullable/ios/Flutter/Debug.xcconfig",
"repo_id": "flutter",
"token_count": 12
} | 531 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package com.yourcompany.platforminteraction;
import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugin.common.BasicMessageChannel;
import io.flutter.plugin.common.StringCodec;
public class MainActivity extends FlutterActivity {
BasicMessageChannel<String> channel;
@Override
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
channel =
new BasicMessageChannel<>(flutterEngine.getDartExecutor().getBinaryMessenger(), "navigation-test", StringCodec.INSTANCE);
}
public void finish() {
channel.send("ping");
}
}
| flutter/dev/integration_tests/platform_interaction/android/app/src/main/java/com/yourcompany/platforminteraction/MainActivity.java/0 | {
"file_path": "flutter/dev/integration_tests/platform_interaction/android/app/src/main/java/com/yourcompany/platforminteraction/MainActivity.java",
"repo_id": "flutter",
"token_count": 246
} | 532 |
# spell_check
A Flutter project for testing spell check for [EditableText]. | flutter/dev/integration_tests/spell_check/README.md/0 | {
"file_path": "flutter/dev/integration_tests/spell_check/README.md",
"repo_id": "flutter",
"token_count": 20
} | 533 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(camsim99): Revert this timeout change after effects are investigated.
@Timeout(Duration(seconds: 60))
library;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:spell_check/main.dart';
late DefaultSpellCheckService defaultSpellCheckService;
late Locale locale;
/// Waits to find [EditableText] that displays text with misspelled
/// words marked the same as the [TextSpan] provided and returns
/// true if it is found before timing out at 20 seconds.
Future<bool> findTextSpanTree(
WidgetTester tester,
TextSpan inlineSpan,
) async {
final RenderObject root = tester.renderObject(find.byType(EditableText));
expect(root, isNotNull);
RenderEditable? renderEditable;
void recursiveFinder(RenderObject child) {
if (child is RenderEditable && child.text == inlineSpan) {
renderEditable = child;
return;
}
child.visitChildren(recursiveFinder);
}
final DateTime endTime = tester.binding.clock.now().add(const Duration(seconds: 20));
do {
if (tester.binding.clock.now().isAfter(endTime)) {
return false;
}
await tester.pump(const Duration(seconds: 1));
root.visitChildren(recursiveFinder);
} while (renderEditable == null);
return true;
}
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
setUp(() {
defaultSpellCheckService = DefaultSpellCheckService();
locale = const Locale('en', 'us');
});
test(
'fetchSpellCheckSuggestions returns null with no misspelled words',
() async {
const String text = 'Hello, world!';
final List<SuggestionSpan>? spellCheckSuggestionSpans =
await defaultSpellCheckService.fetchSpellCheckSuggestions(locale, text);
expect(spellCheckSuggestionSpans!.length, equals(0));
expect(
defaultSpellCheckService.lastSavedResults!.spellCheckedText,
equals(text)
);
expect(
defaultSpellCheckService.lastSavedResults!.suggestionSpans,
equals(spellCheckSuggestionSpans)
);
});
test(
'fetchSpellCheckSuggestions returns correct ranges with misspelled words',
() async {
const String text = 'Hlelo, world! Yuou are magnificente';
const List<TextRange> misspelledWordRanges = <TextRange>[
TextRange(start: 0, end: 5),
TextRange(start: 14, end: 18),
TextRange(start: 23, end: 35)
];
final List<SuggestionSpan>? spellCheckSuggestionSpans =
await defaultSpellCheckService.fetchSpellCheckSuggestions(locale, text);
expect(spellCheckSuggestionSpans, isNotNull);
expect(
spellCheckSuggestionSpans!.length,
equals(misspelledWordRanges.length)
);
for (int i = 0; i < misspelledWordRanges.length; i += 1) {
expect(
spellCheckSuggestionSpans[i].range,
equals(misspelledWordRanges[i])
);
}
expect(
defaultSpellCheckService.lastSavedResults!.spellCheckedText,
equals(text)
);
expect(
defaultSpellCheckService.lastSavedResults!.suggestionSpans,
equals(spellCheckSuggestionSpans)
);
});
test(
'fetchSpellCheckSuggestions does not correct results when Gboard not ignoring composing region',
() async {
const String text = 'Wwow, whaaett a beautiful day it is!';
final List<SuggestionSpan>? spellCheckSpansWithComposingRegion =
await defaultSpellCheckService.fetchSpellCheckSuggestions(locale, text);
expect(spellCheckSpansWithComposingRegion, isNotNull);
expect(spellCheckSpansWithComposingRegion!.length, equals(2));
final List<SuggestionSpan>? spellCheckSuggestionSpans =
await defaultSpellCheckService.fetchSpellCheckSuggestions(locale, text);
expect(
spellCheckSuggestionSpans,
equals(spellCheckSpansWithComposingRegion)
);
});
test(
'fetchSpellCheckSuggestions merges results when Gboard ignoring composing region',
() async {
const String text = 'Wooahha it is an amazzinng dayyebf!';
final List<SuggestionSpan>? modifiedSpellCheckSuggestionSpans =
await defaultSpellCheckService.fetchSpellCheckSuggestions(locale, text);
final List<SuggestionSpan> expectedSpellCheckSuggestionSpans =
List<SuggestionSpan>.from(modifiedSpellCheckSuggestionSpans!);
expect(modifiedSpellCheckSuggestionSpans, isNotNull);
expect(modifiedSpellCheckSuggestionSpans.length, equals(3));
// Remove one span to simulate Gboard attempting to un-ignore the composing region, after tapping away from "Yuou".
modifiedSpellCheckSuggestionSpans.removeAt(1);
defaultSpellCheckService.lastSavedResults =
SpellCheckResults(text, modifiedSpellCheckSuggestionSpans);
final List<SuggestionSpan>? spellCheckSuggestionSpans =
await defaultSpellCheckService.fetchSpellCheckSuggestions(locale, text);
expect(spellCheckSuggestionSpans, isNotNull);
expect(
spellCheckSuggestionSpans,
equals(expectedSpellCheckSuggestionSpans)
);
});
testWidgets('EditableText spell checks when text is entered and spell check enabled', (WidgetTester tester) async {
const TextStyle style = TextStyle();
const TextStyle misspelledTextStyle = TextField.materialMisspelledTextStyle;
await tester.pumpWidget(const MyApp());
await tester.enterText(find.byType(EditableText), 'Hey cfabiueq qocnakoef! Hey!');
const TextSpan expectedTextSpanTree = TextSpan(
style: style,
children: <TextSpan>[
TextSpan(style: style, text: 'Hey '),
TextSpan(style: misspelledTextStyle, text: 'cfabiueq'),
TextSpan(style: style, text: ' '),
TextSpan(style: misspelledTextStyle, text: 'qocnakoef'),
TextSpan(style: style, text: '! Hey!'),
]);
final bool expectedTextSpanTreeFound = await findTextSpanTree(tester, expectedTextSpanTree);
expect(expectedTextSpanTreeFound, isTrue);
});
}
| flutter/dev/integration_tests/spell_check/integration_test/integration_test.dart/0 | {
"file_path": "flutter/dev/integration_tests/spell_check/integration_test/integration_test.dart",
"repo_id": "flutter",
"token_count": 2146
} | 534 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_driver/driver_extension.dart';
/// This application shows empty screen until first frame timings are acquired.
void main() {
enableFlutterDriverExtension();
final Completer<List<FrameTiming>> completer = Completer<List<FrameTiming>>();
SchedulerBinding.instance.addTimingsCallback((List<FrameTiming> timings) {
completer.complete(timings);
});
runApp(Directionality(
textDirection: TextDirection.ltr,
child: _FirstFrameTimings(completer: completer),
));
}
class _FirstFrameTimings extends StatefulWidget {
const _FirstFrameTimings({
required this.completer,
});
final Completer<List<FrameTiming>> completer;
@override
_FirstFrameTimingsState createState() => _FirstFrameTimingsState();
}
class _FirstFrameTimingsState extends State<_FirstFrameTimings> {
int? _minFrameNumber;
@override
Widget build(BuildContext context) {
widget.completer.future.then(_setMinFrameNumber);
if (_minFrameNumber != null) {
return Text(
_minFrameNumber.toString(),
key: const Key('minFrameNumber'),
);
} else {
return const Text('Waiting...');
}
}
void _setMinFrameNumber(List<FrameTiming> timings) {
final int minFrameNumber = timings
.map((FrameTiming timing) => timing.frameNumber)
.reduce(min);
setState(() {
_minFrameNumber = minFrameNumber;
});
}
}
| flutter/dev/integration_tests/ui/lib/frame_number.dart/0 | {
"file_path": "flutter/dev/integration_tests/ui/lib/frame_number.dart",
"repo_id": "flutter",
"token_count": 579
} | 535 |
<!DOCTYPE HTML>
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<html>
<head>
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<title>Integration test. App load with flutter.js and onEntrypointLoaded API. nonce required.</title>
<!-- Enable a CSP that requires a nonce for script and style-src. -->
<meta http-equiv="Content-Security-Policy" content="script-src 'nonce-SOME_NONCE' 'wasm-unsafe-eval'; font-src https://fonts.gstatic.com; style-src 'nonce-SOME_NONCE'; worker-src 'self';">
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Web Test">
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
<link rel="manifest" href="manifest.json">
<script nonce="SOME_NONCE">
// The value below is injected by flutter build, do not touch.
var serviceWorkerVersion = null;
</script>
<!-- This script adds the flutter initialization JS code -->
<script nonce="SOME_NONCE" src="flutter.js" defer></script>
</head>
<body>
<script nonce="SOME_NONCE">
window.addEventListener('load', function(ev) {
// Download main.dart.js
_flutter.loader.loadEntrypoint({
nonce: 'SOME_NONCE',
onEntrypointLoaded: onEntrypointLoaded,
serviceWorker: {
serviceWorkerVersion: serviceWorkerVersion,
}
});
// Once the entrypoint is ready, do things!
async function onEntrypointLoaded(engineInitializer) {
const appRunner = await engineInitializer.initializeEngine({
nonce: 'SOME_NONCE',
});
appRunner.runApp();
}
});
</script>
</body>
</html>
| flutter/dev/integration_tests/web/web/index_with_flutterjs_el_nonce.html/0 | {
"file_path": "flutter/dev/integration_tests/web/web/index_with_flutterjs_el_nonce.html",
"repo_id": "flutter",
"token_count": 705
} | 536 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
key: Key('mainapp'),
title: 'Integration Test App',
home: MyHomePage(title: 'Integration Test App'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, this.title});
final String? title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
String infoText = 'no-enter';
// Controller with no initial value;
final TextEditingController _emptyController = TextEditingController();
final TextEditingController _controller =
TextEditingController(text: 'Text1');
final TextEditingController _controller2 =
TextEditingController(text: 'Text2');
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title ?? ''),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'Text Editing Test 1',
),
TextFormField(
key: const Key('empty-input'),
enabled: true,
controller: _emptyController,
decoration: const InputDecoration(
contentPadding: EdgeInsets.all(10.0),
labelText: 'Empty Input Field:',
),
),
const Text(
'Text Editing Test 2',
),
TextFormField(
key: const Key('input'),
enabled: true,
controller: _controller,
decoration: const InputDecoration(
contentPadding: EdgeInsets.all(10.0),
labelText: 'Text Input Field:',
),
),
const Text(
'Text Editing Test 3',
),
TextFormField(
key: const Key('input2'),
enabled: true,
controller: _controller2,
decoration: const InputDecoration(
contentPadding: EdgeInsets.all(10.0),
labelText: 'Text Input Field 2:',
),
onFieldSubmitted: (String str) {
print('event received');
setState(() => infoText = 'enter pressed');
},
),
Text(
infoText,
key: const Key('text'),
),
const Padding(
padding: EdgeInsets.all(12.0),
child: SelectableText(
'Lorem ipsum dolor sit amet',
key: Key('selectable'),
style: TextStyle(fontFamily: 'Roboto', fontSize: 20.0),
),
),
],
),
),
);
}
}
| flutter/dev/integration_tests/web_e2e_tests/lib/text_editing_main.dart/0 | {
"file_path": "flutter/dev/integration_tests/web_e2e_tests/lib/text_editing_main.dart",
"repo_id": "flutter",
"token_count": 1508
} | 537 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:html';
import 'dart:js_util' as js_util;
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:web_e2e_tests/common.dart';
import 'package:web_e2e_tests/text_editing_main.dart' as app;
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
testWidgets('Focused text field creates a native input element',
(WidgetTester tester) async {
app.main();
await tester.pumpAndSettle();
// Focus on a TextFormField.
final Finder finder = find.byKey(const Key('input'));
expect(finder, findsOneWidget);
await tester.tap(find.byKey(const Key('input')));
// A native input element will be appended to the DOM.
final List<Node> nodeList = findElements('input');
expect(nodeList.length, equals(1));
final InputElement input = nodeList[0] as InputElement;
// The element's value will be the same as the textFormField's value.
expect(input.value, 'Text1');
// Change the value of the TextFormField.
final TextFormField textFormField = tester.widget(finder);
textFormField.controller?.text = 'New Value';
// DOM element's value also changes.
expect(input.value, 'New Value');
}, semanticsEnabled: false);
testWidgets('Input field with no initial value works',
(WidgetTester tester) async {
app.main();
await tester.pumpAndSettle();
// Focus on a TextFormField.
final Finder finder = find.byKey(const Key('empty-input'));
expect(finder, findsOneWidget);
await tester.tap(find.byKey(const Key('empty-input')));
// A native input element will be appended to the DOM.
final List<Node> nodeList = findElements('input');
expect(nodeList.length, equals(1));
final InputElement input = nodeList[0] as InputElement;
// The element's value will be empty.
expect(input.value, '');
// Change the value of the TextFormField.
final TextFormField textFormField = tester.widget(finder);
textFormField.controller?.text = 'New Value';
// DOM element's value also changes.
expect(input.value, 'New Value');
}, semanticsEnabled: false);
testWidgets('Pressing enter on the text field triggers submit',
(WidgetTester tester) async {
app.main();
await tester.pumpAndSettle();
// This text will show no-enter initially. It will have 'enter-pressed'
// after `onFieldSubmitted` of TextField is triggered.
final Finder textFinder = find.byKey(const Key('text'));
expect(textFinder, findsOneWidget);
final Text text = tester.widget(textFinder);
expect(text.data, 'no-enter');
// Focus on a TextFormField.
final Finder textFormFieldsFinder = find.byKey(const Key('input2'));
expect(textFormFieldsFinder, findsOneWidget);
await tester.tap(find.byKey(const Key('input2')));
// Press Tab. This should trigger `onFieldSubmitted` of TextField.
final InputElement input = findElements('input')[0] as InputElement;
dispatchKeyboardEvent(input, 'keydown', <String, dynamic>{
'keyCode': 13, // Enter.
'cancelable': true,
});
// Release Tab.
dispatchKeyboardEvent(input, 'keyup', <String, dynamic>{
'keyCode': 13, // Enter.
'cancelable': true,
});
await tester.pumpAndSettle();
final Finder textFinder2 = find.byKey(const Key('text'));
expect(textFinder2, findsOneWidget);
final Text text2 = tester.widget(textFinder2);
expect(text2.data, 'enter pressed');
}, semanticsEnabled: false);
testWidgets('Jump between TextFormFields with tab key',
(WidgetTester tester) async {
app.main();
await tester.pumpAndSettle();
// Focus on a TextFormField.
final Finder finder = find.byKey(const Key('input'));
expect(finder, findsOneWidget);
await tester.tap(find.byKey(const Key('input')));
// A native input element will be appended to the DOM.
final List<Node> nodeList = findElements('input');
expect(nodeList.length, equals(1));
final InputElement input = nodeList[0] as InputElement;
// Press Tab. The focus should move to the next TextFormField.
dispatchKeyboardEvent(input, 'keydown', <String, dynamic>{
'key': 'Tab',
'code': 'Tab',
'bubbles': true,
'cancelable': true,
'composed': true,
});
// Release tab.
dispatchKeyboardEvent(input, 'keyup', <String, dynamic>{
'key': 'Tab',
'code': 'Tab',
'bubbles': true,
'cancelable': true,
'composed': true,
});
await tester.pumpAndSettle();
// A native input element for the next TextField should be attached to the
// DOM.
final InputElement input2 = findElements('input')[0] as InputElement;
expect(input2.value, 'Text2');
}, semanticsEnabled: false);
testWidgets('Jump between TextFormFields with tab key after CapsLock is activated', (WidgetTester tester) async {
app.main();
await tester.pumpAndSettle();
// Focus on a TextFormField.
final Finder finder = find.byKey(const Key('input'));
expect(finder, findsOneWidget);
await tester.tap(find.byKey(const Key('input')));
// A native input element will be appended to the DOM.
final List<Node> nodeList = findElements('input');
expect(nodeList.length, equals(1));
final InputElement input = nodeList[0] as InputElement;
// Press and release CapsLock.
dispatchKeyboardEvent(input, 'keydown', <String, dynamic>{
'key': 'CapsLock',
'code': 'CapsLock',
'bubbles': true,
'cancelable': true,
'composed': true,
});
dispatchKeyboardEvent(input, 'keyup', <String, dynamic>{
'key': 'CapsLock',
'code': 'CapsLock',
'bubbles': true,
'cancelable': true,
'composed': true,
});
// Press Tab. The focus should move to the next TextFormField.
dispatchKeyboardEvent(input, 'keydown', <String, dynamic>{
'key': 'Tab',
'code': 'Tab',
'bubbles': true,
'cancelable': true,
'composed': true,
});
// Release Tab.
dispatchKeyboardEvent(input, 'keyup', <String, dynamic>{
'key': 'Tab',
'code': 'Tab',
'bubbles': true,
'cancelable': true,
'composed': true,
});
await tester.pumpAndSettle();
// A native input element for the next TextField should be attached to the
// DOM.
final InputElement input2 = findElements('input')[0] as InputElement;
expect(input2.value, 'Text2');
}, semanticsEnabled: false);
testWidgets('Read-only fields work', (WidgetTester tester) async {
const String text = 'Lorem ipsum dolor sit amet';
app.main();
await tester.pumpAndSettle();
// Select something from the selectable text.
final Finder finder = find.byKey(const Key('selectable'));
expect(finder, findsOneWidget);
final RenderBox selectable = tester.renderObject(finder);
final Offset topLeft = selectable.localToGlobal(Offset.zero);
final Offset topRight =
selectable.localToGlobal(Offset(selectable.size.width, 0.0));
// Drag by mouse to select the entire selectable text.
TestGesture gesture =
await tester.startGesture(topLeft, kind: PointerDeviceKind.mouse);
await gesture.moveTo(topRight);
await gesture.up();
// A native input element will be appended to the DOM.
final List<Node> nodeList = findElements('textarea');
expect(nodeList.length, equals(1));
final TextAreaElement input = nodeList[0] as TextAreaElement;
// The element's value should contain the selectable text.
expect(input.value, text);
expect(input.hasAttribute('readonly'), isTrue);
// Make sure the entire text is selected.
TextRange? range =
TextRange(start: input.selectionStart!, end: input.selectionEnd!);
expect(range.textInside(text), text);
// Double tap to select the first word.
final Offset firstWordOffset = topLeft.translate(10.0, 0.0);
gesture = await tester.startGesture(
firstWordOffset,
kind: PointerDeviceKind.mouse,
);
await gesture.up();
await gesture.down(firstWordOffset);
await gesture.up();
range = TextRange(start: input.selectionStart!, end: input.selectionEnd!);
expect(range.textInside(text), 'Lorem');
// Double tap to select the last word.
final Offset lastWordOffset = topRight.translate(-10.0, 0.0);
gesture = await tester.startGesture(
lastWordOffset,
kind: PointerDeviceKind.mouse,
);
await gesture.up();
await gesture.down(lastWordOffset);
await gesture.up();
range = TextRange(start: input.selectionStart!, end: input.selectionEnd!);
expect(range.textInside(text), 'amet');
}, semanticsEnabled: false);
}
KeyboardEvent dispatchKeyboardEvent(
EventTarget target, String type, Map<String, dynamic> args) {
final Object jsKeyboardEvent = js_util.getProperty(window, 'KeyboardEvent') as Object;
final List<dynamic> eventArgs = <dynamic>[
type,
args,
];
final KeyboardEvent event = js_util.callConstructor(
jsKeyboardEvent, js_util.jsify(eventArgs) as List<dynamic>)
as KeyboardEvent;
target.dispatchEvent(event);
return event;
}
| flutter/dev/integration_tests/web_e2e_tests/test_driver/text_editing_integration.dart/0 | {
"file_path": "flutter/dev/integration_tests/web_e2e_tests/test_driver/text_editing_integration.dart",
"repo_id": "flutter",
"token_count": 3355
} | 538 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:typed_data';
import 'package:flutter/services.dart';
const MethodChannel _kMethodChannel =
MethodChannel('tests.flutter.dev/windows_startup_test');
/// Returns true if the application's window is visible.
Future<bool> isWindowVisible() async {
final bool? visible = await _kMethodChannel.invokeMethod<bool?>('isWindowVisible');
if (visible == null) {
throw 'Method channel unavailable';
}
return visible;
}
/// Returns true if the app's dark mode is enabled.
Future<bool> isAppDarkModeEnabled() async {
final bool? enabled = await _kMethodChannel.invokeMethod<bool?>('isAppDarkModeEnabled');
if (enabled == null) {
throw 'Method channel unavailable';
}
return enabled;
}
/// Returns true if the operating system dark mode setting is enabled.
Future<bool> isSystemDarkModeEnabled() async {
final bool? enabled = await _kMethodChannel.invokeMethod<bool?>('isSystemDarkModeEnabled');
if (enabled == null) {
throw 'Method channel unavailable';
}
return enabled;
}
/// Test conversion of a UTF16 string to UTF8 using the app template utils.
Future<String> testStringConversion(Int32List twoByteCodes) async {
final String? converted = await _kMethodChannel.invokeMethod<String?>('convertString', twoByteCodes);
if (converted == null) {
throw 'Method channel unavailable.';
}
return converted;
}
| flutter/dev/integration_tests/windows_startup_test/lib/windows.dart/0 | {
"file_path": "flutter/dev/integration_tests/windows_startup_test/lib/windows.dart",
"repo_id": "flutter",
"token_count": 440
} | 539 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
class ColorDemoHome extends StatelessWidget {
const ColorDemoHome({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Color Demo')),
body: ListView(
padding: const EdgeInsets.all(5.0),
children: <Widget>[
Image.network('https://flutter.github.io/assets-for-api-docs/assets/tests/colors/gbr.png'),
Image.network('https://flutter.github.io/assets-for-api-docs/assets/tests/colors/tf.png'),
Image.network('https://flutter.github.io/assets-for-api-docs/assets/tests/colors/wide-gamut.png'),
const GradientRow(leftColor: Color(0xFFFF0000), rightColor: Color(0xFF00FF00)),
const GradientRow(leftColor: Color(0xFF0000FF), rightColor: Color(0xFFFFFF00)),
const GradientRow(leftColor: Color(0xFFFF0000), rightColor: Color(0xFF0000FF)),
const GradientRow(leftColor: Color(0xFF00FF00), rightColor: Color(0xFFFFFF00)),
const GradientRow(leftColor: Color(0xFF0000FF), rightColor: Color(0xFF00FF00)),
const GradientRow(leftColor: Color(0xFFFF0000), rightColor: Color(0xFFFFFF00)),
// For the following pairs, the blend result should match the opaque color.
const ColorRow(color: Color(0xFFBCBCBC)),
const ColorRow(color: Color(0x80000000)),
const ColorRow(color: Color(0xFFFFBCBC)),
const ColorRow(color: Color(0x80FF0000)),
const ColorRow(color: Color(0xFFBCFFBC)),
const ColorRow(color: Color(0x8000FF00)),
const ColorRow(color: Color(0xFFBCBCFF)),
const ColorRow(color: Color(0x800000FF)),
],
),
);
}
}
class GradientRow extends StatelessWidget {
const GradientRow({ super.key, required this.rightColor, required this.leftColor });
final Color leftColor;
final Color rightColor;
@override
Widget build(BuildContext context) {
return Container(
height: 100.0,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: <Color>[ leftColor, rightColor ],
),
),
);
}
}
class ColorRow extends StatelessWidget {
const ColorRow({ super.key, required this.color });
final Color color;
@override
Widget build(BuildContext context) {
return Container(
height: 100.0,
color: color,
);
}
}
void main() {
runApp(const MaterialApp(
title: 'Color Testing Demo',
home: ColorDemoHome(),
));
}
| flutter/dev/manual_tests/lib/color_testing_demo.dart/0 | {
"file_path": "flutter/dev/manual_tests/lib/color_testing_demo.dart",
"repo_id": "flutter",
"token_count": 1087
} | 540 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:io';
import 'package:flutter_test/flutter_test.dart';
import '../../../packages/flutter/test/image_data.dart';
// Returns a mock HTTP client that responds with an image to all requests.
FakeHttpClient createMockImageHttpClient(SecurityContext? _) {
final FakeHttpClient client = FakeHttpClient();
return client;
}
class FakeHttpClient extends Fake implements HttpClient {
FakeHttpClient([this.context]);
SecurityContext? context;
@override
bool autoUncompress = false;
final FakeHttpClientRequest request = FakeHttpClientRequest();
@override
Future<HttpClientRequest> getUrl(Uri url) async {
return request;
}
}
class FakeHttpClientRequest extends Fake implements HttpClientRequest {
final FakeHttpClientResponse response = FakeHttpClientResponse();
@override
Future<HttpClientResponse> close() async {
return response;
}
}
class FakeHttpClientResponse extends Fake implements HttpClientResponse {
@override
int get statusCode => 200;
@override
int get contentLength => kTransparentImage.length;
@override
final FakeHttpHeaders headers = FakeHttpHeaders();
@override
HttpClientResponseCompressionState get compressionState => HttpClientResponseCompressionState.notCompressed;
@override
StreamSubscription<List<int>> listen(void Function(List<int>)? onData, {
void Function()? onDone,
Function? onError,
bool? cancelOnError,
}) {
return Stream<List<int>>.fromIterable(<List<int>>[kTransparentImage])
.listen(onData, onDone: onDone, onError: onError, cancelOnError: cancelOnError);
}
}
class FakeHttpHeaders extends Fake implements HttpHeaders { }
| flutter/dev/manual_tests/test/mock_image_http.dart/0 | {
"file_path": "flutter/dev/manual_tests/test/mock_image_http.dart",
"repo_id": "flutter",
"token_count": 544
} | 541 |
{
"version": "v0_206",
"md.comp.filled-button.container.color": "primary",
"md.comp.filled-button.container.elevation": "md.sys.elevation.level0",
"md.comp.filled-button.container.height": 40.0,
"md.comp.filled-button.container.shadow-color": "shadow",
"md.comp.filled-button.container.shape": "md.sys.shape.corner.full",
"md.comp.filled-button.disabled.container.color": "onSurface",
"md.comp.filled-button.disabled.container.elevation": "md.sys.elevation.level0",
"md.comp.filled-button.disabled.container.opacity": 0.12,
"md.comp.filled-button.disabled.label-text.color": "onSurface",
"md.comp.filled-button.disabled.label-text.opacity": 0.38,
"md.comp.filled-button.focus.container.elevation": "md.sys.elevation.level0",
"md.comp.filled-button.focus.indicator.color": "secondary",
"md.comp.filled-button.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset",
"md.comp.filled-button.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness",
"md.comp.filled-button.focus.label-text.color": "onPrimary",
"md.comp.filled-button.focus.state-layer.color": "onPrimary",
"md.comp.filled-button.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity",
"md.comp.filled-button.hover.container.elevation": "md.sys.elevation.level1",
"md.comp.filled-button.hover.label-text.color": "onPrimary",
"md.comp.filled-button.hover.state-layer.color": "onPrimary",
"md.comp.filled-button.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity",
"md.comp.filled-button.label-text.color": "onPrimary",
"md.comp.filled-button.label-text.text-style": "labelLarge",
"md.comp.filled-button.pressed.container.elevation": "md.sys.elevation.level0",
"md.comp.filled-button.pressed.label-text.color": "onPrimary",
"md.comp.filled-button.pressed.state-layer.color": "onPrimary",
"md.comp.filled-button.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity",
"md.comp.filled-button.with-icon.disabled.icon.color": "onSurface",
"md.comp.filled-button.with-icon.disabled.icon.opacity": 0.38,
"md.comp.filled-button.with-icon.focus.icon.color": "onPrimary",
"md.comp.filled-button.with-icon.hover.icon.color": "onPrimary",
"md.comp.filled-button.with-icon.icon.color": "onPrimary",
"md.comp.filled-button.with-icon.icon.size": 18.0,
"md.comp.filled-button.with-icon.pressed.icon.color": "onPrimary"
}
| flutter/dev/tools/gen_defaults/data/button_filled.json/0 | {
"file_path": "flutter/dev/tools/gen_defaults/data/button_filled.json",
"repo_id": "flutter",
"token_count": 901
} | 542 |
{
"version": "v0_206",
"md.comp.date-input.modal.container.color": "surfaceContainerHigh",
"md.comp.date-input.modal.container.elevation": "md.sys.elevation.level3",
"md.comp.date-input.modal.container.height": 512.0,
"md.comp.date-input.modal.container.shape": "md.sys.shape.corner.extra-large",
"md.comp.date-input.modal.container.width": 328.0,
"md.comp.date-input.modal.header.container.height": 120.0,
"md.comp.date-input.modal.header.container.width": 328.0,
"md.comp.date-input.modal.header.headline.color": "onSurfaceVariant",
"md.comp.date-input.modal.header.headline.text-style": "headlineLarge",
"md.comp.date-input.modal.header.supporting-text.color": "onSurfaceVariant",
"md.comp.date-input.modal.header.supporting-text.text-style": "labelLarge"
}
| flutter/dev/tools/gen_defaults/data/date_picker_input_modal.json/0 | {
"file_path": "flutter/dev/tools/gen_defaults/data/date_picker_input_modal.json",
"repo_id": "flutter",
"token_count": 309
} | 543 |
{
"version": "v0_206",
"md.sys.motion.duration.extra-long1Ms": 700.0,
"md.sys.motion.duration.extra-long2Ms": 800.0,
"md.sys.motion.duration.extra-long3Ms": 900.0,
"md.sys.motion.duration.extra-long4Ms": 1000.0,
"md.sys.motion.duration.long1Ms": 450.0,
"md.sys.motion.duration.long2Ms": 500.0,
"md.sys.motion.duration.long3Ms": 550.0,
"md.sys.motion.duration.long4Ms": 600.0,
"md.sys.motion.duration.medium1Ms": 250.0,
"md.sys.motion.duration.medium2Ms": 300.0,
"md.sys.motion.duration.medium3Ms": 350.0,
"md.sys.motion.duration.medium4Ms": 400.0,
"md.sys.motion.duration.short1Ms": 50.0,
"md.sys.motion.duration.short2Ms": 100.0,
"md.sys.motion.duration.short3Ms": 150.0,
"md.sys.motion.duration.short4Ms": 200.0,
"md.sys.motion.easing.emphasized.accelerate": "Cubic(0.3, 0.0, 0.8, 0.15)",
"md.sys.motion.easing.emphasized.decelerate": "Cubic(0.05, 0.7, 0.1, 1.0)",
"md.sys.motion.easing.legacy": "Cubic(0.4, 0.0, 0.2, 1.0)",
"md.sys.motion.easing.legacy.accelerate": "Cubic(0.4, 0.0, 1.0, 1.0)",
"md.sys.motion.easing.legacy.decelerate": "Cubic(0.0, 0.0, 0.2, 1.0)",
"md.sys.motion.easing.linear": "Cubic(0.0, 0.0, 1.0, 1.0)",
"md.sys.motion.easing.standard": "Cubic(0.2, 0.0, 0.0, 1.0)",
"md.sys.motion.easing.standard.accelerate": "Cubic(0.3, 0.0, 1.0, 1.0)",
"md.sys.motion.easing.standard.decelerate": "Cubic(0.0, 0.0, 0.0, 1.0)"
}
| flutter/dev/tools/gen_defaults/data/motion.json/0 | {
"file_path": "flutter/dev/tools/gen_defaults/data/motion.json",
"repo_id": "flutter",
"token_count": 664
} | 544 |
{
"version": "v0_206",
"md.comp.snackbar.action.focus.label-text.color": "inversePrimary",
"md.comp.snackbar.action.focus.state-layer.color": "inversePrimary",
"md.comp.snackbar.action.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity",
"md.comp.snackbar.action.hover.label-text.color": "inversePrimary",
"md.comp.snackbar.action.hover.state-layer.color": "inversePrimary",
"md.comp.snackbar.action.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity",
"md.comp.snackbar.action.label-text.color": "inversePrimary",
"md.comp.snackbar.action.label-text.text-style": "labelLarge",
"md.comp.snackbar.action.pressed.label-text.color": "inversePrimary",
"md.comp.snackbar.action.pressed.state-layer.color": "inversePrimary",
"md.comp.snackbar.action.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity",
"md.comp.snackbar.container.color": "inverseSurface",
"md.comp.snackbar.container.elevation": "md.sys.elevation.level3",
"md.comp.snackbar.container.shadow-color": "shadow",
"md.comp.snackbar.container.shape": "md.sys.shape.corner.extra-small",
"md.comp.snackbar.icon.color": "onInverseSurface",
"md.comp.snackbar.icon.focus.icon.color": "onInverseSurface",
"md.comp.snackbar.icon.focus.state-layer.color": "onInverseSurface",
"md.comp.snackbar.icon.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity",
"md.comp.snackbar.icon.hover.icon.color": "onInverseSurface",
"md.comp.snackbar.icon.hover.state-layer.color": "onInverseSurface",
"md.comp.snackbar.icon.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity",
"md.comp.snackbar.icon.pressed.icon.color": "onInverseSurface",
"md.comp.snackbar.icon.pressed.state-layer.color": "onInverseSurface",
"md.comp.snackbar.icon.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity",
"md.comp.snackbar.icon.size": 24.0,
"md.comp.snackbar.supporting-text.color": "onInverseSurface",
"md.comp.snackbar.supporting-text.text-style": "bodyMedium",
"md.comp.snackbar.with-single-line.container.height": 48.0,
"md.comp.snackbar.with-two-lines.container.height": 68.0
}
| flutter/dev/tools/gen_defaults/data/snackbar.json/0 | {
"file_path": "flutter/dev/tools/gen_defaults/data/snackbar.json",
"repo_id": "flutter",
"token_count": 848
} | 545 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'template.dart';
class BottomAppBarTemplate extends TokenTemplate {
const BottomAppBarTemplate(super.blockName, super.fileName, super.tokens, {
super.colorSchemePrefix = '_colors.',
});
@override
String generate() => '''
class _${blockName}DefaultsM3 extends BottomAppBarTheme {
_${blockName}DefaultsM3(this.context)
: super(
elevation: ${elevation('md.comp.bottom-app-bar.container')},
height: ${getToken('md.comp.bottom-app-bar.container.height')},
shape: const AutomaticNotchedShape(${shape('md.comp.bottom-app-bar.container', '')}),
);
final BuildContext context;
late final ColorScheme _colors = Theme.of(context).colorScheme;
@override
Color? get color => ${componentColor('md.comp.bottom-app-bar.container')};
@override
Color? get surfaceTintColor => ${colorOrTransparent('md.comp.bottom-app-bar.container.surface-tint-layer')};
@override
Color? get shadowColor => Colors.transparent;
}
''';
}
| flutter/dev/tools/gen_defaults/lib/bottom_app_bar_template.dart/0 | {
"file_path": "flutter/dev/tools/gen_defaults/lib/bottom_app_bar_template.dart",
"repo_id": "flutter",
"token_count": 373
} | 546 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'template.dart';
class InputDecoratorTemplate extends TokenTemplate {
const InputDecoratorTemplate(super.blockName, super.fileName, super.tokens, {
super.colorSchemePrefix = '_colors.',
super.textThemePrefix = '_textTheme.'
});
@override
String generate() => '''
class _${blockName}DefaultsM3 extends InputDecorationTheme {
_${blockName}DefaultsM3(this.context)
: super();
final BuildContext context;
late final ColorScheme _colors = Theme.of(context).colorScheme;
late final TextTheme _textTheme = Theme.of(context).textTheme;
@override
TextStyle? get hintStyle => MaterialStateTextStyle.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return TextStyle(color: Theme.of(context).disabledColor);
}
return TextStyle(color: Theme.of(context).hintColor);
});
@override
Color? get fillColor => MaterialStateColor.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return ${componentColor("md.comp.filled-text-field.disabled.container")};
}
return ${componentColor("md.comp.filled-text-field.container")};
});
@override
BorderSide? get activeIndicatorBorder => MaterialStateBorderSide.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return ${border('md.comp.filled-text-field.disabled.active-indicator')};
}
if (states.contains(MaterialState.error)) {
if (states.contains(MaterialState.hovered)) {
return ${border('md.comp.filled-text-field.error.hover.active-indicator')};
}
if (states.contains(MaterialState.focused)) {
return ${mergedBorder('md.comp.filled-text-field.error.focus.active-indicator','md.comp.filled-text-field.focus.active-indicator')};
}
return ${border('md.comp.filled-text-field.error.active-indicator')};
}
if (states.contains(MaterialState.hovered)) {
return ${border('md.comp.filled-text-field.hover.active-indicator')};
}
if (states.contains(MaterialState.focused)) {
return ${border('md.comp.filled-text-field.focus.active-indicator')};
}
return ${border('md.comp.filled-text-field.active-indicator')};
});
@override
BorderSide? get outlineBorder => MaterialStateBorderSide.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return ${border('md.comp.outlined-text-field.disabled.outline')};
}
if (states.contains(MaterialState.error)) {
if (states.contains(MaterialState.hovered)) {
return ${border('md.comp.outlined-text-field.error.hover.outline')};
}
if (states.contains(MaterialState.focused)) {
return ${mergedBorder('md.comp.outlined-text-field.error.focus.outline','md.comp.outlined-text-field.focus.outline')};
}
return ${border('md.comp.outlined-text-field.error.outline')};
}
if (states.contains(MaterialState.hovered)) {
return ${border('md.comp.outlined-text-field.hover.outline')};
}
if (states.contains(MaterialState.focused)) {
return ${border('md.comp.outlined-text-field.focus.outline')};
}
return ${border('md.comp.outlined-text-field.outline')};
});
@override
Color? get iconColor => ${componentColor("md.comp.filled-text-field.leading-icon")};
@override
Color? get prefixIconColor => MaterialStateColor.resolveWith((Set<MaterialState> states) {${componentColor('md.comp.filled-text-field.error.leading-icon') == componentColor('md.comp.filled-text-field.leading-icon') ? '' : '''
if (states.contains(MaterialState.disabled)) {
return ${componentColor('md.comp.filled-text-field.disabled.leading-icon')};
}
if (states.contains(MaterialState.error)) {
if (states.contains(MaterialState.hovered)) {
return ${componentColor('md.comp.filled-text-field.error.hover.leading-icon')};
}
if (states.contains(MaterialState.focused)) {
return ${componentColor('md.comp.filled-text-field.error.focus.leading-icon')};
}
return ${componentColor('md.comp.filled-text-field.error.leading-icon')};
}'''}${componentColor('md.comp.filled-text-field.hover.leading-icon') == componentColor('md.comp.filled-text-field.leading-icon') ? '' : '''
if (states.contains(MaterialState.hovered)) {
return ${componentColor('md.comp.filled-text-field.hover.leading-icon')};
}'''}${componentColor('md.comp.filled-text-field.focus.leading-icon') == componentColor('md.comp.filled-text-field.leading-icon') ? '' : '''
if (states.contains(MaterialState.focused)) {
return ${componentColor('md.comp.filled-text-field.focus.leading-icon')};
}'''}
return ${componentColor('md.comp.filled-text-field.leading-icon')};
});
@override
Color? get suffixIconColor => MaterialStateColor.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return ${componentColor('md.comp.filled-text-field.disabled.trailing-icon')};
}
if (states.contains(MaterialState.error)) {${componentColor('md.comp.filled-text-field.error.trailing-icon') == componentColor('md.comp.filled-text-field.error.focus.trailing-icon') ? '' : '''
if (states.contains(MaterialState.hovered)) {
return ${componentColor('md.comp.filled-text-field.error.hover.trailing-icon')};
}
if (states.contains(MaterialState.focused)) {
return ${componentColor('md.comp.filled-text-field.error.focus.trailing-icon')};
}'''}
return ${componentColor('md.comp.filled-text-field.error.trailing-icon')};
}${componentColor('md.comp.filled-text-field.hover.trailing-icon') == componentColor('md.comp.filled-text-field.trailing-icon') ? '' : '''
if (states.contains(MaterialState.hovered)) {
return ${componentColor('md.comp.filled-text-field.hover.trailing-icon')};
}'''}${componentColor('md.comp.filled-text-field.focus.trailing-icon') == componentColor('md.comp.filled-text-field.trailing-icon') ? '' : '''
if (states.contains(MaterialState.focused)) {
return ${componentColor('md.comp.filled-text-field.focus.trailing-icon')};
}'''}
return ${componentColor('md.comp.filled-text-field.trailing-icon')};
});
@override
TextStyle? get labelStyle => MaterialStateTextStyle.resolveWith((Set<MaterialState> states) {
final TextStyle textStyle = ${textStyle("md.comp.filled-text-field.label-text")} ?? const TextStyle();
if (states.contains(MaterialState.disabled)) {
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.disabled.label-text')});
}
if (states.contains(MaterialState.error)) {
if (states.contains(MaterialState.hovered)) {
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.hover.label-text')});
}
if (states.contains(MaterialState.focused)) {
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.focus.label-text')});
}
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.label-text')});
}
if (states.contains(MaterialState.hovered)) {
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.hover.label-text')});
}
if (states.contains(MaterialState.focused)) {
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.focus.label-text')});
}
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.label-text')});
});
@override
TextStyle? get floatingLabelStyle => MaterialStateTextStyle.resolveWith((Set<MaterialState> states) {
final TextStyle textStyle = ${textStyle("md.comp.filled-text-field.label-text")} ?? const TextStyle();
if (states.contains(MaterialState.disabled)) {
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.disabled.label-text')});
}
if (states.contains(MaterialState.error)) {
if (states.contains(MaterialState.hovered)) {
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.hover.label-text')});
}
if (states.contains(MaterialState.focused)) {
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.focus.label-text')});
}
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.label-text')});
}
if (states.contains(MaterialState.hovered)) {
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.hover.label-text')});
}
if (states.contains(MaterialState.focused)) {
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.focus.label-text')});
}
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.label-text')});
});
@override
TextStyle? get helperStyle => MaterialStateTextStyle.resolveWith((Set<MaterialState> states) {
final TextStyle textStyle = ${textStyle("md.comp.filled-text-field.supporting-text")} ?? const TextStyle();
if (states.contains(MaterialState.disabled)) {
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.disabled.supporting-text')});
}${componentColor('md.comp.filled-text-field.hover.supporting-text') == componentColor('md.comp.filled-text-field.supporting-text') ? '' : '''
if (states.contains(MaterialState.hovered)) {
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.hover.supporting-text')});
}'''}${componentColor('md.comp.filled-text-field.focus.supporting-text') == componentColor('md.comp.filled-text-field.supporting-text') ? '' : '''
if (states.contains(MaterialState.focused)) {
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.focus.supporting-text')});
}'''}
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.supporting-text')});
});
@override
TextStyle? get errorStyle => MaterialStateTextStyle.resolveWith((Set<MaterialState> states) {
final TextStyle textStyle = ${textStyle("md.comp.filled-text-field.supporting-text")} ?? const TextStyle();${componentColor('md.comp.filled-text-field.error.hover.supporting-text') == componentColor('md.comp.filled-text-field.error.supporting-text') ? '' : '''
if (states.contains(MaterialState.hovered)) {
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.hover.supporting-text')});
}'''}${componentColor('md.comp.filled-text-field.error.focus.supporting-text') == componentColor('md.comp.filled-text-field.error.supporting-text') ? '' : '''
if (states.contains(MaterialState.focused)) {
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.focus.supporting-text')});
}'''}
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.supporting-text')});
});
}
''';
/// Generate a [BorderSide] for the given components.
String mergedBorder(String componentToken1, String componentToken2) {
final String borderColor = componentColor(componentToken1)!= 'null'
? componentColor(componentToken1)
: componentColor(componentToken2);
final double width = (
getToken('$componentToken1.width', optional: true) ??
getToken('$componentToken1.height', optional: true) ??
getToken('$componentToken2.width', optional: true) ??
getToken('$componentToken2.height', optional: true) ??
1.0) as double;
return 'BorderSide(color: $borderColor${width != 1.0 ? ", width: $width" : ""})';
}
}
| flutter/dev/tools/gen_defaults/lib/input_decorator_template.dart/0 | {
"file_path": "flutter/dev/tools/gen_defaults/lib/input_decorator_template.dart",
"repo_id": "flutter",
"token_count": 4167
} | 547 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'template.dart';
class SwitchTemplate extends TokenTemplate {
const SwitchTemplate(super.blockName, super.fileName, super.tokens, {
super.colorSchemePrefix = '_colors.',
});
@override
String generate() => '''
class _${blockName}DefaultsM3 extends SwitchThemeData {
_${blockName}DefaultsM3(this.context);
final BuildContext context;
late final ColorScheme _colors = Theme.of(context).colorScheme;
@override
MaterialStateProperty<Color> get thumbColor {
return MaterialStateProperty.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
if (states.contains(MaterialState.selected)) {
return ${componentColor('md.comp.switch.disabled.selected.handle')};
}
return ${componentColor('md.comp.switch.disabled.unselected.handle')};
}
if (states.contains(MaterialState.selected)) {
if (states.contains(MaterialState.pressed)) {
return ${componentColor('md.comp.switch.selected.pressed.handle')};
}
if (states.contains(MaterialState.hovered)) {
return ${componentColor('md.comp.switch.selected.hover.handle')};
}
if (states.contains(MaterialState.focused)) {
return ${componentColor('md.comp.switch.selected.focus.handle')};
}
return ${componentColor('md.comp.switch.selected.handle')};
}
if (states.contains(MaterialState.pressed)) {
return ${componentColor('md.comp.switch.unselected.pressed.handle')};
}
if (states.contains(MaterialState.hovered)) {
return ${componentColor('md.comp.switch.unselected.hover.handle')};
}
if (states.contains(MaterialState.focused)) {
return ${componentColor('md.comp.switch.unselected.focus.handle')};
}
return ${componentColor('md.comp.switch.unselected.handle')};
});
}
@override
MaterialStateProperty<Color> get trackColor {
return MaterialStateProperty.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
if (states.contains(MaterialState.selected)) {
return ${componentColor('md.comp.switch.disabled.selected.track')}.withOpacity(${opacity('md.comp.switch.disabled.track.opacity')});
}
return ${componentColor('md.comp.switch.disabled.unselected.track')}.withOpacity(${opacity('md.comp.switch.disabled.track.opacity')});
}
if (states.contains(MaterialState.selected)) {
if (states.contains(MaterialState.pressed)) {
return ${componentColor('md.comp.switch.selected.pressed.track')};
}
if (states.contains(MaterialState.hovered)) {
return ${componentColor('md.comp.switch.selected.hover.track')};
}
if (states.contains(MaterialState.focused)) {
return ${componentColor('md.comp.switch.selected.focus.track')};
}
return ${componentColor('md.comp.switch.selected.track')};
}
if (states.contains(MaterialState.pressed)) {
return ${componentColor('md.comp.switch.unselected.pressed.track')};
}
if (states.contains(MaterialState.hovered)) {
return ${componentColor('md.comp.switch.unselected.hover.track')};
}
if (states.contains(MaterialState.focused)) {
return ${componentColor('md.comp.switch.unselected.focus.track')};
}
return ${componentColor('md.comp.switch.unselected.track')};
});
}
@override
MaterialStateProperty<Color?> get trackOutlineColor {
return MaterialStateProperty.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
return Colors.transparent;
}
if (states.contains(MaterialState.disabled)) {
return ${componentColor('md.comp.switch.disabled.unselected.track.outline')}.withOpacity(${opacity('md.comp.switch.disabled.track.opacity')});
}
return ${componentColor('md.comp.switch.unselected.track.outline')};
});
}
@override
MaterialStateProperty<Color?> get overlayColor {
return MaterialStateProperty.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
if (states.contains(MaterialState.pressed)) {
return ${componentColor('md.comp.switch.selected.pressed.state-layer')};
}
if (states.contains(MaterialState.hovered)) {
return ${componentColor('md.comp.switch.selected.hover.state-layer')};
}
if (states.contains(MaterialState.focused)) {
return ${componentColor('md.comp.switch.selected.focus.state-layer')};
}
return null;
}
if (states.contains(MaterialState.pressed)) {
return ${componentColor('md.comp.switch.unselected.pressed.state-layer')};
}
if (states.contains(MaterialState.hovered)) {
return ${componentColor('md.comp.switch.unselected.hover.state-layer')};
}
if (states.contains(MaterialState.focused)) {
return ${componentColor('md.comp.switch.unselected.focus.state-layer')};
}
return null;
});
}
@override
MaterialStateProperty<MouseCursor> get mouseCursor {
return MaterialStateProperty.resolveWith((Set<MaterialState> states)
=> MaterialStateMouseCursor.clickable.resolve(states));
}
@override
MaterialStatePropertyAll<double> get trackOutlineWidth => const MaterialStatePropertyAll<double>(${getToken('md.comp.switch.track.outline.width')});
@override
double get splashRadius => ${getToken('md.comp.switch.state-layer.size')} / 2;
}
class _SwitchConfigM3 with _SwitchConfig {
_SwitchConfigM3(this.context)
: _colors = Theme.of(context).colorScheme;
BuildContext context;
final ColorScheme _colors;
static const double iconSize = ${getToken('md.comp.switch.unselected.icon.size')};
@override
double get activeThumbRadius => ${getToken('md.comp.switch.selected.handle.width')} / 2;
@override
MaterialStateProperty<Color> get iconColor {
return MaterialStateProperty.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
if (states.contains(MaterialState.selected)) {
return ${componentColor('md.comp.switch.disabled.selected.icon')};
}
return ${componentColor('md.comp.switch.disabled.unselected.icon')};
}
if (states.contains(MaterialState.selected)) {
if (states.contains(MaterialState.pressed)) {
return ${componentColor('md.comp.switch.selected.pressed.icon')};
}
if (states.contains(MaterialState.hovered)) {
return ${componentColor('md.comp.switch.selected.hover.icon')};
}
if (states.contains(MaterialState.focused)) {
return ${componentColor('md.comp.switch.selected.focus.icon')};
}
return ${componentColor('md.comp.switch.selected.icon')};
}
if (states.contains(MaterialState.pressed)) {
return ${componentColor('md.comp.switch.unselected.pressed.icon')};
}
if (states.contains(MaterialState.hovered)) {
return ${componentColor('md.comp.switch.unselected.hover.icon')};
}
if (states.contains(MaterialState.focused)) {
return ${componentColor('md.comp.switch.unselected.focus.icon')};
}
return ${componentColor('md.comp.switch.unselected.icon')};
});
}
@override
double get inactiveThumbRadius => ${getToken('md.comp.switch.unselected.handle.width')} / 2;
@override
double get pressedThumbRadius => ${getToken('md.comp.switch.pressed.handle.width')} / 2;
@override
double get switchHeight => _kSwitchMinSize + 8.0;
@override
double get switchHeightCollapsed => _kSwitchMinSize;
@override
double get switchWidth => trackWidth - 2 * (trackHeight / 2.0) + _kSwitchMinSize;
@override
double get thumbRadiusWithIcon => ${getToken('md.comp.switch.with-icon.handle.width')} / 2;
@override
List<BoxShadow>? get thumbShadow => kElevationToShadow[0];
@override
double get trackHeight => ${getToken('md.comp.switch.track.height')};
@override
double get trackWidth => ${getToken('md.comp.switch.track.width')};
// The thumb size at the middle of the track. Hand coded default based on the animation specs.
@override
Size get transitionalThumbSize => const Size(34, 22);
// Hand coded default based on the animation specs.
@override
int get toggleDuration => 300;
// Hand coded default based on the animation specs.
@override
double? get thumbOffset => null;
}
''';
}
| flutter/dev/tools/gen_defaults/lib/switch_template.dart/0 | {
"file_path": "flutter/dev/tools/gen_defaults/lib/switch_template.dart",
"repo_id": "flutter",
"token_count": 3181
} | 548 |
{
"Space": {
"name": "Space",
"value": 32,
"keyLabel": " ",
"names": {
"gtk": [
"KP_Space"
],
"windows": [
"SPACE"
],
"android": [
"SPACE"
],
"glfw": [
"SPACE"
]
},
"values": {
"gtk": [
65408
],
"windows": [
32
],
"android": [
62
],
"fuchsia": [
77309870124
],
"glfw": [
32
]
}
},
"Exclamation": {
"name": "Exclamation",
"value": 33,
"keyLabel": "!"
},
"Quote": {
"name": "Quote",
"value": 34,
"keyLabel": "\"",
"names": {
"windows": [
"OEM_7"
],
"android": [
"APOSTROPHE"
],
"glfw": [
"APOSTROPHE"
]
},
"values": {
"windows": [
222
],
"android": [
75
],
"fuchsia": [
77309870132
],
"glfw": [
39
]
}
},
"NumberSign": {
"name": "NumberSign",
"value": 35,
"keyLabel": "#",
"names": {
"android": [
"POUND"
]
},
"values": {
"android": [
18
]
}
},
"Dollar": {
"name": "Dollar",
"value": 36,
"keyLabel": "$"
},
"Percent": {
"name": "Percent",
"value": 37,
"keyLabel": "%"
},
"Ampersand": {
"name": "Ampersand",
"value": 38,
"keyLabel": "&"
},
"QuoteSingle": {
"name": "QuoteSingle",
"value": 39,
"keyLabel": "'"
},
"ParenthesisLeft": {
"name": "ParenthesisLeft",
"value": 40,
"keyLabel": "("
},
"ParenthesisRight": {
"name": "ParenthesisRight",
"value": 41,
"keyLabel": ")"
},
"Asterisk": {
"name": "Asterisk",
"value": 42,
"keyLabel": "*",
"names": {
"android": [
"STAR"
]
},
"values": {
"android": [
17
]
}
},
"Add": {
"name": "Add",
"value": 43,
"keyLabel": "+",
"names": {
"android": [
"PLUS"
]
},
"values": {
"android": [
81
]
}
},
"Comma": {
"name": "Comma",
"value": 44,
"keyLabel": ",",
"names": {
"windows": [
"OEM_COMMA"
],
"android": [
"COMMA"
],
"glfw": [
"COMMA"
]
},
"values": {
"windows": [
188
],
"android": [
55
],
"fuchsia": [
77309870134
],
"glfw": [
44
]
}
},
"Minus": {
"name": "Minus",
"value": 45,
"keyLabel": "-",
"names": {
"windows": [
"OEM_MINUS"
],
"android": [
"MINUS"
],
"glfw": [
"MINUS"
]
},
"values": {
"windows": [
189
],
"android": [
69
],
"fuchsia": [
77309870125
],
"glfw": [
45
]
}
},
"Period": {
"name": "Period",
"value": 46,
"keyLabel": ".",
"names": {
"gtk": [
"KP_Decimal"
],
"windows": [
"OEM_PERIOD"
],
"android": [
"PERIOD"
],
"glfw": [
"PERIOD"
]
},
"values": {
"gtk": [
65454
],
"windows": [
190
],
"android": [
56
],
"fuchsia": [
77309870135
],
"glfw": [
46
]
}
},
"Slash": {
"name": "Slash",
"value": 47,
"keyLabel": "/",
"names": {
"windows": [
"OEM_2"
],
"android": [
"SLASH"
],
"glfw": [
"SLASH"
]
},
"values": {
"windows": [
191
],
"android": [
76
],
"fuchsia": [
77309870136
],
"glfw": [
47
]
}
},
"Digit0": {
"name": "Digit0",
"value": 48,
"keyLabel": "0",
"names": {
"android": [
"0"
],
"glfw": [
"0"
]
},
"values": {
"android": [
7
],
"fuchsia": [
77309870119
],
"glfw": [
48
]
}
},
"Digit1": {
"name": "Digit1",
"value": 49,
"keyLabel": "1",
"names": {
"android": [
"1"
],
"glfw": [
"1"
]
},
"values": {
"android": [
8
],
"fuchsia": [
77309870110
],
"glfw": [
49
]
}
},
"Digit2": {
"name": "Digit2",
"value": 50,
"keyLabel": "2",
"names": {
"android": [
"2"
],
"glfw": [
"2"
]
},
"values": {
"android": [
9
],
"fuchsia": [
77309870111
],
"glfw": [
50
]
}
},
"Digit3": {
"name": "Digit3",
"value": 51,
"keyLabel": "3",
"names": {
"android": [
"3"
],
"glfw": [
"3"
]
},
"values": {
"android": [
10
],
"fuchsia": [
77309870112
],
"glfw": [
51
]
}
},
"Digit4": {
"name": "Digit4",
"value": 52,
"keyLabel": "4",
"names": {
"android": [
"4"
],
"glfw": [
"4"
]
},
"values": {
"android": [
11
],
"fuchsia": [
77309870113
],
"glfw": [
52
]
}
},
"Digit5": {
"name": "Digit5",
"value": 53,
"keyLabel": "5",
"names": {
"android": [
"5"
],
"glfw": [
"5"
]
},
"values": {
"android": [
12
],
"fuchsia": [
77309870114
],
"glfw": [
53
]
}
},
"Digit6": {
"name": "Digit6",
"value": 54,
"keyLabel": "6",
"names": {
"android": [
"6"
],
"glfw": [
"6"
]
},
"values": {
"android": [
13
],
"fuchsia": [
77309870115
],
"glfw": [
54
]
}
},
"Digit7": {
"name": "Digit7",
"value": 55,
"keyLabel": "7",
"names": {
"android": [
"7"
],
"glfw": [
"7"
]
},
"values": {
"android": [
14
],
"fuchsia": [
77309870116
],
"glfw": [
55
]
}
},
"Digit8": {
"name": "Digit8",
"value": 56,
"keyLabel": "8",
"names": {
"android": [
"8"
],
"glfw": [
"8"
]
},
"values": {
"android": [
15
],
"fuchsia": [
77309870117
],
"glfw": [
56
]
}
},
"Digit9": {
"name": "Digit9",
"value": 57,
"keyLabel": "9",
"names": {
"android": [
"9"
],
"glfw": [
"9"
]
},
"values": {
"android": [
16
],
"fuchsia": [
77309870118
],
"glfw": [
57
]
}
},
"Colon": {
"name": "Colon",
"value": 58,
"keyLabel": ":"
},
"Semicolon": {
"name": "Semicolon",
"value": 59,
"keyLabel": ";",
"names": {
"windows": [
"OEM_1"
],
"android": [
"SEMICOLON"
],
"glfw": [
"SEMICOLON"
]
},
"values": {
"windows": [
186
],
"android": [
74
],
"fuchsia": [
77309870131
],
"glfw": [
59
]
}
},
"Less": {
"name": "Less",
"value": 60,
"keyLabel": "<"
},
"Equal": {
"name": "Equal",
"value": 61,
"keyLabel": "=",
"names": {
"windows": [
"OEM_PLUS"
],
"android": [
"EQUALS"
],
"glfw": [
"EQUAL"
]
},
"values": {
"windows": [
187
],
"android": [
70
],
"fuchsia": [
77309870126
],
"glfw": [
61
]
}
},
"Greater": {
"name": "Greater",
"value": 62,
"keyLabel": ">"
},
"Question": {
"name": "Question",
"value": 63,
"keyLabel": "?"
},
"At": {
"name": "At",
"value": 64,
"keyLabel": "@",
"names": {
"android": [
"AT"
]
},
"values": {
"android": [
77
]
}
},
"BracketLeft": {
"name": "BracketLeft",
"value": 91,
"keyLabel": "[",
"names": {
"windows": [
"OEM_4"
],
"android": [
"LEFT_BRACKET"
],
"glfw": [
"LEFT_BRACKET"
]
},
"values": {
"windows": [
219
],
"android": [
71
],
"fuchsia": [
77309870127
],
"glfw": [
91
]
}
},
"Backslash": {
"name": "Backslash",
"value": 92,
"keyLabel": "\\",
"names": {
"windows": [
"OEM_5"
],
"android": [
"BACKSLASH"
],
"glfw": [
"BACKSLASH"
]
},
"values": {
"windows": [
220
],
"android": [
73
],
"fuchsia": [
77309870129
],
"glfw": [
92
]
}
},
"BracketRight": {
"name": "BracketRight",
"value": 93,
"keyLabel": "]",
"names": {
"windows": [
"OEM_6"
],
"android": [
"RIGHT_BRACKET"
],
"glfw": [
"RIGHT_BRACKET"
]
},
"values": {
"windows": [
221
],
"android": [
72
],
"fuchsia": [
77309870128
],
"glfw": [
93
]
}
},
"Caret": {
"name": "Caret",
"value": 94,
"keyLabel": "^"
},
"Underscore": {
"name": "Underscore",
"value": 95,
"keyLabel": "_"
},
"Backquote": {
"name": "Backquote",
"value": 96,
"keyLabel": "`",
"names": {
"windows": [
"OEM_3"
],
"android": [
"GRAVE"
],
"glfw": [
"GRAVE_ACCENT"
]
},
"values": {
"windows": [
192
],
"android": [
68
],
"fuchsia": [
77309870133
],
"glfw": [
96
]
}
},
"KeyA": {
"name": "KeyA",
"value": 97,
"keyLabel": "a",
"names": {
"android": [
"A"
],
"glfw": [
"A"
]
},
"values": {
"android": [
29
],
"fuchsia": [
77309870084
],
"glfw": [
65
]
}
},
"KeyB": {
"name": "KeyB",
"value": 98,
"keyLabel": "b",
"names": {
"android": [
"B"
],
"glfw": [
"B"
]
},
"values": {
"android": [
30
],
"fuchsia": [
77309870085
],
"glfw": [
66
]
}
},
"KeyC": {
"name": "KeyC",
"value": 99,
"keyLabel": "c",
"names": {
"android": [
"C"
],
"glfw": [
"C"
]
},
"values": {
"android": [
31
],
"fuchsia": [
77309870086
],
"glfw": [
67
]
}
},
"KeyD": {
"name": "KeyD",
"value": 100,
"keyLabel": "d",
"names": {
"android": [
"D"
],
"glfw": [
"D"
]
},
"values": {
"android": [
32
],
"fuchsia": [
77309870087
],
"glfw": [
68
]
}
},
"KeyE": {
"name": "KeyE",
"value": 101,
"keyLabel": "e",
"names": {
"android": [
"E"
],
"glfw": [
"E"
]
},
"values": {
"android": [
33
],
"fuchsia": [
77309870088
],
"glfw": [
69
]
}
},
"KeyF": {
"name": "KeyF",
"value": 102,
"keyLabel": "f",
"names": {
"android": [
"F"
],
"glfw": [
"F"
]
},
"values": {
"android": [
34
],
"fuchsia": [
77309870089
],
"glfw": [
70
]
}
},
"KeyG": {
"name": "KeyG",
"value": 103,
"keyLabel": "g",
"names": {
"android": [
"G"
],
"glfw": [
"G"
]
},
"values": {
"android": [
35
],
"fuchsia": [
77309870090
],
"glfw": [
71
]
}
},
"KeyH": {
"name": "KeyH",
"value": 104,
"keyLabel": "h",
"names": {
"android": [
"H"
],
"glfw": [
"H"
]
},
"values": {
"android": [
36
],
"fuchsia": [
77309870091
],
"glfw": [
72
]
}
},
"KeyI": {
"name": "KeyI",
"value": 105,
"keyLabel": "i",
"names": {
"android": [
"I"
],
"glfw": [
"I"
]
},
"values": {
"android": [
37
],
"fuchsia": [
77309870092
],
"glfw": [
73
]
}
},
"KeyJ": {
"name": "KeyJ",
"value": 106,
"keyLabel": "j",
"names": {
"android": [
"J"
],
"glfw": [
"J"
]
},
"values": {
"android": [
38
],
"fuchsia": [
77309870093
],
"glfw": [
74
]
}
},
"KeyK": {
"name": "KeyK",
"value": 107,
"keyLabel": "k",
"names": {
"android": [
"K"
],
"glfw": [
"K"
]
},
"values": {
"android": [
39
],
"fuchsia": [
77309870094
],
"glfw": [
75
]
}
},
"KeyL": {
"name": "KeyL",
"value": 108,
"keyLabel": "l",
"names": {
"android": [
"L"
],
"glfw": [
"L"
]
},
"values": {
"android": [
40
],
"fuchsia": [
77309870095
],
"glfw": [
76
]
}
},
"KeyM": {
"name": "KeyM",
"value": 109,
"keyLabel": "m",
"names": {
"android": [
"M"
],
"glfw": [
"M"
]
},
"values": {
"android": [
41
],
"fuchsia": [
77309870096
],
"glfw": [
77
]
}
},
"KeyN": {
"name": "KeyN",
"value": 110,
"keyLabel": "n",
"names": {
"android": [
"N"
],
"glfw": [
"N"
]
},
"values": {
"android": [
42
],
"fuchsia": [
77309870097
],
"glfw": [
78
]
}
},
"KeyO": {
"name": "KeyO",
"value": 111,
"keyLabel": "o",
"names": {
"android": [
"O"
],
"glfw": [
"O"
]
},
"values": {
"android": [
43
],
"fuchsia": [
77309870098
],
"glfw": [
79
]
}
},
"KeyP": {
"name": "KeyP",
"value": 112,
"keyLabel": "p",
"names": {
"android": [
"P"
],
"glfw": [
"P"
]
},
"values": {
"android": [
44
],
"fuchsia": [
77309870099
],
"glfw": [
80
]
}
},
"KeyQ": {
"name": "KeyQ",
"value": 113,
"keyLabel": "q",
"names": {
"android": [
"Q"
],
"glfw": [
"Q"
]
},
"values": {
"android": [
45
],
"fuchsia": [
77309870100
],
"glfw": [
81
]
}
},
"KeyR": {
"name": "KeyR",
"value": 114,
"keyLabel": "r",
"names": {
"android": [
"R"
],
"glfw": [
"R"
]
},
"values": {
"android": [
46
],
"fuchsia": [
77309870101
],
"glfw": [
82
]
}
},
"KeyS": {
"name": "KeyS",
"value": 115,
"keyLabel": "s",
"names": {
"android": [
"S"
],
"glfw": [
"S"
]
},
"values": {
"android": [
47
],
"fuchsia": [
77309870102
],
"glfw": [
83
]
}
},
"KeyT": {
"name": "KeyT",
"value": 116,
"keyLabel": "t",
"names": {
"android": [
"T"
],
"glfw": [
"T"
]
},
"values": {
"android": [
48
],
"fuchsia": [
77309870103
],
"glfw": [
84
]
}
},
"KeyU": {
"name": "KeyU",
"value": 117,
"keyLabel": "u",
"names": {
"android": [
"U"
],
"glfw": [
"U"
]
},
"values": {
"android": [
49
],
"fuchsia": [
77309870104
],
"glfw": [
85
]
}
},
"KeyV": {
"name": "KeyV",
"value": 118,
"keyLabel": "v",
"names": {
"android": [
"V"
],
"glfw": [
"V"
]
},
"values": {
"android": [
50
],
"fuchsia": [
77309870105
],
"glfw": [
86
]
}
},
"KeyW": {
"name": "KeyW",
"value": 119,
"keyLabel": "w",
"names": {
"android": [
"W"
],
"glfw": [
"W"
]
},
"values": {
"android": [
51
],
"fuchsia": [
77309870106
],
"glfw": [
87
]
}
},
"KeyX": {
"name": "KeyX",
"value": 120,
"keyLabel": "x",
"names": {
"android": [
"X"
],
"glfw": [
"X"
]
},
"values": {
"android": [
52
],
"fuchsia": [
77309870107
],
"glfw": [
88
]
}
},
"KeyY": {
"name": "KeyY",
"value": 121,
"keyLabel": "y",
"names": {
"android": [
"Y"
],
"glfw": [
"Y"
]
},
"values": {
"android": [
53
],
"fuchsia": [
77309870108
],
"glfw": [
89
]
}
},
"KeyZ": {
"name": "KeyZ",
"value": 122,
"keyLabel": "z",
"names": {
"android": [
"Z"
],
"glfw": [
"Z"
]
},
"values": {
"android": [
54
],
"fuchsia": [
77309870109
],
"glfw": [
90
]
}
},
"BraceLeft": {
"name": "BraceLeft",
"value": 123,
"keyLabel": "{"
},
"Bar": {
"name": "Bar",
"value": 124,
"keyLabel": "|"
},
"BraceRight": {
"name": "BraceRight",
"value": 125,
"keyLabel": "}"
},
"Tilde": {
"name": "Tilde",
"value": 126,
"keyLabel": "~"
},
"Unidentified": {
"name": "Unidentified",
"value": 4294967297,
"names": {
"web": [
"Unidentified"
]
}
},
"Backspace": {
"name": "Backspace",
"value": 4294967304,
"names": {
"web": [
"Backspace"
],
"macos": [
"Backspace"
],
"ios": [
"Backspace"
],
"gtk": [
"BackSpace"
],
"windows": [
"BACK"
],
"android": [
"DEL"
],
"glfw": [
"BACKSPACE"
]
},
"values": {
"macos": [
51
],
"ios": [
42
],
"gtk": [
65288
],
"windows": [
8
],
"android": [
67
],
"fuchsia": [
77309870122
],
"glfw": [
259
]
}
},
"Tab": {
"name": "Tab",
"value": 4294967305,
"names": {
"web": [
"Tab"
],
"macos": [
"Tab"
],
"ios": [
"Tab"
],
"gtk": [
"Tab",
"KP_Tab",
"ISO_Left_Tab"
],
"windows": [
"TAB"
],
"android": [
"TAB"
],
"glfw": [
"TAB"
]
},
"values": {
"macos": [
48
],
"ios": [
43
],
"gtk": [
65289,
65417,
65056
],
"windows": [
9
],
"android": [
61
],
"fuchsia": [
77309870123
],
"glfw": [
258
]
}
},
"Enter": {
"name": "Enter",
"value": 4294967309,
"names": {
"web": [
"Enter"
],
"macos": [
"Enter"
],
"ios": [
"Enter"
],
"gtk": [
"Return",
"ISO_Enter",
"3270_Enter"
],
"windows": [
"RETURN"
],
"android": [
"ENTER"
],
"glfw": [
"ENTER"
]
},
"values": {
"macos": [
36
],
"ios": [
40
],
"gtk": [
65293,
65076,
64798
],
"windows": [
13
],
"android": [
66
],
"fuchsia": [
77309870120
],
"glfw": [
257
]
}
},
"Escape": {
"name": "Escape",
"value": 4294967323,
"names": {
"web": [
"Escape",
"Esc"
],
"macos": [
"Escape"
],
"ios": [
"Escape"
],
"gtk": [
"Escape"
],
"windows": [
"ESCAPE"
],
"android": [
"ESCAPE"
],
"glfw": [
"ESCAPE"
]
},
"values": {
"macos": [
53
],
"ios": [
41
],
"gtk": [
65307
],
"windows": [
27
],
"android": [
111
],
"fuchsia": [
77309870121
],
"glfw": [
256
]
}
},
"Delete": {
"name": "Delete",
"value": 4294967423,
"names": {
"web": [
"Delete"
],
"macos": [
"Delete"
],
"ios": [
"Delete"
],
"gtk": [
"Delete"
],
"windows": [
"DELETE"
],
"android": [
"FORWARD_DEL"
],
"glfw": [
"DELETE"
]
},
"values": {
"macos": [
117
],
"ios": [
76
],
"gtk": [
65535
],
"windows": [
46
],
"android": [
112
],
"fuchsia": [
77309870156
],
"glfw": [
261
]
}
},
"Accel": {
"name": "Accel",
"value": 4294967553,
"names": {
"web": [
"Accel"
]
}
},
"AltGraph": {
"name": "AltGraph",
"value": 4294967555,
"names": {
"web": [
"AltGraph"
]
}
},
"CapsLock": {
"name": "CapsLock",
"value": 4294967556,
"names": {
"web": [
"CapsLock"
],
"macos": [
"CapsLock"
],
"ios": [
"CapsLock"
],
"gtk": [
"Caps_Lock"
],
"windows": [
"CAPITAL"
],
"android": [
"CAPS_LOCK"
],
"glfw": [
"CAPS_LOCK"
]
},
"values": {
"macos": [
57
],
"ios": [
57
],
"gtk": [
65509
],
"windows": [
20
],
"android": [
115
],
"fuchsia": [
77309870137
],
"glfw": [
280
]
}
},
"Fn": {
"name": "Fn",
"value": 4294967558,
"names": {
"web": [
"Fn"
],
"macos": [
"Fn"
],
"android": [
"FUNCTION"
]
},
"values": {
"macos": [
63
],
"android": [
119
],
"fuchsia": [
77309411346
]
}
},
"FnLock": {
"name": "FnLock",
"value": 4294967559,
"names": {
"web": [
"FnLock"
]
},
"values": {
"fuchsia": [
77309411347
]
}
},
"Hyper": {
"name": "Hyper",
"value": 4294967560,
"names": {
"web": [
"Hyper"
],
"gtk": [
"Hyper_L",
"Hyper_R"
]
},
"values": {
"gtk": [
65517,
65518
],
"fuchsia": [
77309411344
]
}
},
"NumLock": {
"name": "NumLock",
"value": 4294967562,
"names": {
"web": [
"NumLock"
],
"macos": [
"NumLock"
],
"ios": [
"NumLock"
],
"gtk": [
"Num_Lock"
],
"windows": [
"NUMLOCK"
],
"android": [
"NUM_LOCK"
],
"glfw": [
"NUM_LOCK"
]
},
"values": {
"macos": [
71
],
"ios": [
83
],
"gtk": [
65407
],
"windows": [
144
],
"android": [
143
],
"fuchsia": [
77309870163
],
"glfw": [
282
]
}
},
"ScrollLock": {
"name": "ScrollLock",
"value": 4294967564,
"names": {
"web": [
"ScrollLock"
],
"gtk": [
"Scroll_Lock"
],
"windows": [
"SCROLL"
],
"android": [
"SCROLL_LOCK"
]
},
"values": {
"gtk": [
65300
],
"windows": [
145
],
"android": [
116
],
"fuchsia": [
77309870151
]
}
},
"Super": {
"name": "Super",
"value": 4294967566,
"names": {
"web": [
"Super"
],
"gtk": [
"Super_L",
"Super_R"
]
},
"values": {
"gtk": [
65515,
65516
],
"fuchsia": [
77309411345
]
}
},
"Symbol": {
"name": "Symbol",
"value": 4294967567,
"names": {
"web": [
"Symbol"
],
"android": [
"SYM"
]
},
"values": {
"android": [
63
]
}
},
"SymbolLock": {
"name": "SymbolLock",
"value": 4294967568,
"names": {
"web": [
"SymbolLock"
]
}
},
"ShiftLevel5": {
"name": "ShiftLevel5",
"value": 4294967569,
"names": {
"web": [
"ShiftLevel5"
]
}
},
"ArrowDown": {
"name": "ArrowDown",
"value": 4294968065,
"names": {
"web": [
"ArrowDown"
],
"macos": [
"ArrowDown"
],
"ios": [
"ArrowDown"
],
"gtk": [
"Down"
],
"windows": [
"DOWN"
],
"android": [
"DPAD_DOWN"
],
"glfw": [
"DOWN"
]
},
"values": {
"macos": [
125
],
"ios": [
81
],
"gtk": [
65364
],
"windows": [
40
],
"android": [
20
],
"fuchsia": [
77309870161
],
"glfw": [
264
]
}
},
"ArrowLeft": {
"name": "ArrowLeft",
"value": 4294968066,
"names": {
"web": [
"ArrowLeft"
],
"macos": [
"ArrowLeft"
],
"ios": [
"ArrowLeft"
],
"gtk": [
"Left"
],
"windows": [
"LEFT"
],
"android": [
"DPAD_LEFT"
],
"glfw": [
"LEFT"
]
},
"values": {
"macos": [
123
],
"ios": [
80
],
"gtk": [
65361
],
"windows": [
37
],
"android": [
21
],
"fuchsia": [
77309870160
],
"glfw": [
263
]
}
},
"ArrowRight": {
"name": "ArrowRight",
"value": 4294968067,
"names": {
"web": [
"ArrowRight"
],
"macos": [
"ArrowRight"
],
"ios": [
"ArrowRight"
],
"gtk": [
"Right"
],
"windows": [
"RIGHT"
],
"android": [
"DPAD_RIGHT"
],
"glfw": [
"RIGHT"
]
},
"values": {
"macos": [
124
],
"ios": [
79
],
"gtk": [
65363
],
"windows": [
39
],
"android": [
22
],
"fuchsia": [
77309870159
],
"glfw": [
262
]
}
},
"ArrowUp": {
"name": "ArrowUp",
"value": 4294968068,
"names": {
"web": [
"ArrowUp"
],
"macos": [
"ArrowUp"
],
"ios": [
"ArrowUp"
],
"gtk": [
"Up"
],
"windows": [
"UP"
],
"android": [
"DPAD_UP"
],
"glfw": [
"UP"
]
},
"values": {
"macos": [
126
],
"ios": [
82
],
"gtk": [
65362
],
"windows": [
38
],
"android": [
19
],
"fuchsia": [
77309870162
],
"glfw": [
265
]
}
},
"End": {
"name": "End",
"value": 4294968069,
"names": {
"web": [
"End"
],
"macos": [
"End"
],
"ios": [
"End"
],
"gtk": [
"End"
],
"windows": [
"END"
],
"android": [
"MOVE_END"
],
"glfw": [
"END"
]
},
"values": {
"macos": [
119
],
"ios": [
77
],
"gtk": [
65367
],
"windows": [
35
],
"android": [
123
],
"fuchsia": [
77309870157
],
"glfw": [
269
]
}
},
"Home": {
"name": "Home",
"value": 4294968070,
"names": {
"web": [
"Home"
],
"macos": [
"Home"
],
"ios": [
"Home"
],
"gtk": [
"Home"
],
"windows": [
"HOME"
],
"android": [
"MOVE_HOME"
],
"glfw": [
"HOME"
]
},
"values": {
"macos": [
115
],
"ios": [
74
],
"gtk": [
65360
],
"windows": [
36
],
"android": [
122
],
"fuchsia": [
77309870154
],
"glfw": [
268
]
}
},
"PageDown": {
"name": "PageDown",
"value": 4294968071,
"names": {
"web": [
"PageDown"
],
"macos": [
"PageDown"
],
"ios": [
"PageDown"
],
"gtk": [
"Page_Down"
],
"windows": [
"NEXT"
],
"android": [
"PAGE_DOWN"
],
"glfw": [
"PAGE_DOWN"
]
},
"values": {
"macos": [
121
],
"ios": [
78
],
"gtk": [
65366
],
"windows": [
34
],
"android": [
93
],
"fuchsia": [
77309870158
],
"glfw": [
267
]
}
},
"PageUp": {
"name": "PageUp",
"value": 4294968072,
"names": {
"web": [
"PageUp"
],
"macos": [
"PageUp"
],
"ios": [
"PageUp"
],
"gtk": [
"Page_Up"
],
"windows": [
"PRIOR"
],
"android": [
"PAGE_UP"
],
"glfw": [
"PAGE_UP"
]
},
"values": {
"macos": [
116
],
"ios": [
75
],
"gtk": [
65365
],
"windows": [
33
],
"android": [
92
],
"fuchsia": [
77309870155
],
"glfw": [
266
]
}
},
"Clear": {
"name": "Clear",
"value": 4294968321,
"names": {
"web": [
"Clear"
],
"gtk": [
"Clear"
],
"windows": [
"CLEAR"
],
"android": [
"CLEAR"
]
},
"values": {
"gtk": [
65291
],
"windows": [
12
],
"android": [
28
]
}
},
"Copy": {
"name": "Copy",
"value": 4294968322,
"names": {
"web": [
"Copy"
],
"gtk": [
"3270_Copy",
"Copy"
],
"android": [
"COPY"
]
},
"values": {
"gtk": [
64789,
269025111
],
"android": [
278
],
"fuchsia": [
77309870204
]
}
},
"CrSel": {
"name": "CrSel",
"value": 4294968323,
"names": {
"web": [
"CrSel"
]
}
},
"Cut": {
"name": "Cut",
"value": 4294968324,
"names": {
"web": [
"Cut"
],
"gtk": [
"Cut"
],
"android": [
"CUT"
]
},
"values": {
"gtk": [
269025112
],
"android": [
277
],
"fuchsia": [
77309870203
]
}
},
"EraseEof": {
"name": "EraseEof",
"value": 4294968325,
"names": {
"web": [
"EraseEof"
],
"gtk": [
"3270_EraseEOF"
]
},
"values": {
"gtk": [
64774
]
}
},
"ExSel": {
"name": "ExSel",
"value": 4294968326,
"names": {
"web": [
"ExSel"
],
"gtk": [
"3270_ExSelect"
]
},
"values": {
"gtk": [
64795
]
}
},
"Insert": {
"name": "Insert",
"value": 4294968327,
"names": {
"web": [
"Insert"
],
"macos": [
"Insert"
],
"ios": [
"Insert"
],
"gtk": [
"Insert"
],
"windows": [
"INSERT"
],
"android": [
"INSERT"
],
"glfw": [
"INSERT"
]
},
"values": {
"macos": [
114
],
"ios": [
73
],
"gtk": [
65379
],
"windows": [
45
],
"android": [
124
],
"fuchsia": [
77309870153
],
"glfw": [
260
]
}
},
"Paste": {
"name": "Paste",
"value": 4294968328,
"names": {
"web": [
"Paste"
],
"gtk": [
"Paste"
],
"android": [
"PASTE"
]
},
"values": {
"gtk": [
269025133
],
"android": [
279
],
"fuchsia": [
77309870205
]
}
},
"Redo": {
"name": "Redo",
"value": 4294968329,
"names": {
"web": [
"Redo"
],
"gtk": [
"Redo"
]
},
"values": {
"gtk": [
65382
],
"fuchsia": [
77310198393
]
}
},
"Undo": {
"name": "Undo",
"value": 4294968330,
"names": {
"web": [
"Undo"
],
"gtk": [
"Undo"
]
},
"values": {
"gtk": [
65381
],
"fuchsia": [
77309870202
]
}
},
"Accept": {
"name": "Accept",
"value": 4294968577,
"names": {
"web": [
"Accept"
],
"windows": [
"ACCEPT"
]
},
"values": {
"windows": [
30
]
}
},
"Again": {
"name": "Again",
"value": 4294968578,
"names": {
"web": [
"Again"
]
},
"values": {
"fuchsia": [
77309870201
]
}
},
"Attn": {
"name": "Attn",
"value": 4294968579,
"names": {
"web": [
"Attn"
],
"gtk": [
"3270_Attn"
],
"windows": [
"ATTN"
]
},
"values": {
"gtk": [
64782
],
"windows": [
246
]
}
},
"Cancel": {
"name": "Cancel",
"value": 4294968580,
"names": {
"web": [
"Cancel"
],
"gtk": [
"Cancel"
],
"windows": [
"CANCEL"
]
},
"values": {
"gtk": [
65385
],
"windows": [
3
]
}
},
"ContextMenu": {
"name": "ContextMenu",
"value": 4294968581,
"names": {
"web": [
"ContextMenu"
],
"macos": [
"ContextMenu"
],
"ios": [
"ContextMenu"
],
"gtk": [
"Menu"
],
"windows": [
"APPS"
],
"android": [
"MENU"
],
"glfw": [
"MENU"
]
},
"values": {
"macos": [
110
],
"ios": [
101
],
"gtk": [
65383
],
"windows": [
93
],
"android": [
82
],
"fuchsia": [
77309870181
],
"glfw": [
348
]
}
},
"Execute": {
"name": "Execute",
"value": 4294968582,
"names": {
"web": [
"Execute"
],
"gtk": [
"Execute"
],
"windows": [
"EXECUTE"
]
},
"values": {
"gtk": [
65378
],
"windows": [
43
]
}
},
"Find": {
"name": "Find",
"value": 4294968583,
"names": {
"web": [
"Find"
],
"gtk": [
"Find"
]
},
"values": {
"gtk": [
65384
],
"fuchsia": [
77309870206
]
}
},
"Help": {
"name": "Help",
"value": 4294968584,
"names": {
"web": [
"Help"
],
"gtk": [
"Help"
],
"windows": [
"HELP"
],
"android": [
"HELP"
]
},
"values": {
"gtk": [
65386
],
"windows": [
47
],
"android": [
259
],
"fuchsia": [
77309870197
]
}
},
"Pause": {
"name": "Pause",
"value": 4294968585,
"names": {
"web": [
"Pause"
],
"gtk": [
"Pause"
],
"windows": [
"PAUSE"
],
"android": [
"BREAK"
],
"glfw": [
"PAUSE"
]
},
"values": {
"gtk": [
65299
],
"windows": [
19
],
"android": [
121
],
"fuchsia": [
77309870152
],
"glfw": [
284
]
}
},
"Play": {
"name": "Play",
"value": 4294968586,
"names": {
"web": [
"Play"
],
"windows": [
"PLAY"
]
},
"values": {
"windows": [
250
]
}
},
"Props": {
"name": "Props",
"value": 4294968587,
"names": {
"web": [
"Props"
]
},
"values": {
"fuchsia": [
77309870243
]
}
},
"Select": {
"name": "Select",
"value": 4294968588,
"names": {
"web": [
"Select"
],
"gtk": [
"Select"
],
"windows": [
"SELECT"
],
"android": [
"DPAD_CENTER"
]
},
"values": {
"gtk": [
65376
],
"windows": [
41
],
"android": [
23
],
"fuchsia": [
77309870199
]
}
},
"ZoomIn": {
"name": "ZoomIn",
"value": 4294968589,
"names": {
"web": [
"ZoomIn"
],
"gtk": [
"ZoomIn"
],
"android": [
"ZOOM_IN"
]
},
"values": {
"gtk": [
269025163
],
"android": [
168
],
"fuchsia": [
77310198317
]
}
},
"ZoomOut": {
"name": "ZoomOut",
"value": 4294968590,
"names": {
"web": [
"ZoomOut"
],
"gtk": [
"ZoomOut"
],
"android": [
"ZOOM_OUT"
]
},
"values": {
"gtk": [
269025164
],
"android": [
169
],
"fuchsia": [
77310198318
]
}
},
"BrightnessDown": {
"name": "BrightnessDown",
"value": 4294968833,
"names": {
"web": [
"BrightnessDown"
],
"gtk": [
"MonBrightnessDown"
],
"android": [
"BRIGHTNESS_DOWN"
]
},
"values": {
"gtk": [
269025027
],
"android": [
220
],
"fuchsia": [
77310197872
]
}
},
"BrightnessUp": {
"name": "BrightnessUp",
"value": 4294968834,
"names": {
"web": [
"BrightnessUp"
],
"gtk": [
"MonBrightnessUp"
],
"android": [
"BRIGHTNESS_UP"
]
},
"values": {
"gtk": [
269025026
],
"android": [
221
],
"fuchsia": [
77310197871
]
}
},
"Camera": {
"name": "Camera",
"value": 4294968835,
"names": {
"web": [
"Camera"
],
"android": [
"CAMERA"
]
},
"values": {
"android": [
27
]
}
},
"Eject": {
"name": "Eject",
"value": 4294968836,
"names": {
"web": [
"Eject"
],
"gtk": [
"Eject"
],
"android": [
"MEDIA_EJECT"
]
},
"values": {
"gtk": [
269025068
],
"android": [
129
],
"fuchsia": [
77310197944
]
}
},
"LogOff": {
"name": "LogOff",
"value": 4294968837,
"names": {
"web": [
"LogOff"
],
"gtk": [
"LogOff"
]
},
"values": {
"gtk": [
269025121
],
"fuchsia": [
77310198172
]
}
},
"Power": {
"name": "Power",
"value": 4294968838,
"names": {
"web": [
"Power"
],
"android": [
"POWER"
]
},
"values": {
"android": [
26
],
"fuchsia": [
77309870182
]
}
},
"PowerOff": {
"name": "PowerOff",
"value": 4294968839,
"names": {
"web": [
"PowerOff"
],
"gtk": [
"PowerOff"
]
},
"values": {
"gtk": [
269025066
]
}
},
"PrintScreen": {
"name": "PrintScreen",
"value": 4294968840,
"names": {
"web": [
"PrintScreen"
],
"gtk": [
"3270_PrintScreen"
],
"windows": [
"SNAPSHOT"
],
"android": [
"SYSRQ"
],
"glfw": [
"PRINT_SCREEN"
]
},
"values": {
"gtk": [
64797
],
"windows": [
44
],
"android": [
120
],
"fuchsia": [
77309870150
],
"glfw": [
283
]
}
},
"Hibernate": {
"name": "Hibernate",
"value": 4294968841,
"names": {
"web": [
"Hibernate"
]
}
},
"Standby": {
"name": "Standby",
"value": 4294968842,
"names": {
"web": [
"Standby"
],
"gtk": [
"Standby"
]
},
"values": {
"gtk": [
269025040
]
}
},
"WakeUp": {
"name": "WakeUp",
"value": 4294968843,
"names": {
"web": [
"WakeUp"
],
"gtk": [
"WakeUp"
],
"android": [
"WAKEUP"
]
},
"values": {
"gtk": [
269025067
],
"android": [
224
],
"fuchsia": [
77309476995
]
}
},
"AllCandidates": {
"name": "AllCandidates",
"value": 4294969089,
"names": {
"web": [
"AllCandidates"
]
}
},
"Alphanumeric": {
"name": "Alphanumeric",
"value": 4294969090,
"names": {
"web": [
"Alphanumeric"
]
}
},
"CodeInput": {
"name": "CodeInput",
"value": 4294969091,
"names": {
"web": [
"CodeInput"
],
"gtk": [
"Codeinput"
]
},
"values": {
"gtk": [
65335
]
}
},
"Compose": {
"name": "Compose",
"value": 4294969092,
"names": {
"web": [
"Compose"
]
}
},
"Convert": {
"name": "Convert",
"value": 4294969093,
"names": {
"web": [
"Convert"
],
"windows": [
"CONVERT"
],
"android": [
"HENKAN"
]
},
"values": {
"windows": [
28
],
"android": [
214
],
"fuchsia": [
77309870218
]
}
},
"FinalMode": {
"name": "FinalMode",
"value": 4294969094,
"names": {
"web": [
"FinalMode"
],
"windows": [
"FINAL"
]
},
"values": {
"windows": [
24
]
}
},
"GroupFirst": {
"name": "GroupFirst",
"value": 4294969095,
"names": {
"web": [
"GroupFirst"
],
"gtk": [
"ISO_First_Group"
]
},
"values": {
"gtk": [
65036
]
}
},
"GroupLast": {
"name": "GroupLast",
"value": 4294969096,
"names": {
"web": [
"GroupLast"
],
"gtk": [
"ISO_Last_Group"
]
},
"values": {
"gtk": [
65038
]
}
},
"GroupNext": {
"name": "GroupNext",
"value": 4294969097,
"names": {
"web": [
"GroupNext"
],
"gtk": [
"ISO_Next_Group"
],
"android": [
"LANGUAGE_SWITCH"
]
},
"values": {
"gtk": [
65032
],
"android": [
204
]
}
},
"GroupPrevious": {
"name": "GroupPrevious",
"value": 4294969098,
"names": {
"web": [
"GroupPrevious"
],
"gtk": [
"ISO_Prev_Group"
]
},
"values": {
"gtk": [
65034
]
}
},
"ModeChange": {
"name": "ModeChange",
"value": 4294969099,
"names": {
"web": [
"ModeChange"
],
"gtk": [
"Mode_switch"
],
"windows": [
"MODECHANGE"
],
"android": [
"SWITCH_CHARSET"
]
},
"values": {
"gtk": [
65406
],
"windows": [
31
],
"android": [
95
]
}
},
"NextCandidate": {
"name": "NextCandidate",
"value": 4294969100,
"names": {
"web": [
"NextCandidate"
]
}
},
"NonConvert": {
"name": "NonConvert",
"value": 4294969101,
"names": {
"web": [
"NonConvert"
],
"android": [
"MUHENKAN"
]
},
"values": {
"android": [
213
],
"fuchsia": [
77309870219
]
}
},
"PreviousCandidate": {
"name": "PreviousCandidate",
"value": 4294969102,
"names": {
"web": [
"PreviousCandidate"
],
"gtk": [
"PreviousCandidate"
]
},
"values": {
"gtk": [
65342
]
}
},
"Process": {
"name": "Process",
"value": 4294969103,
"names": {
"web": [
"Process"
]
}
},
"SingleCandidate": {
"name": "SingleCandidate",
"value": 4294969104,
"names": {
"web": [
"SingleCandidate"
],
"gtk": [
"SingleCandidate"
]
},
"values": {
"gtk": [
65340
]
}
},
"HangulMode": {
"name": "HangulMode",
"value": 4294969105,
"names": {
"web": [
"HangulMode"
],
"gtk": [
"Hangul"
]
},
"values": {
"gtk": [
65329
]
}
},
"HanjaMode": {
"name": "HanjaMode",
"value": 4294969106,
"names": {
"web": [
"HanjaMode"
],
"gtk": [
"Hangul_Hanja"
]
},
"values": {
"gtk": [
65332
]
}
},
"JunjaMode": {
"name": "JunjaMode",
"value": 4294969107,
"names": {
"web": [
"JunjaMode"
],
"windows": [
"JUNJA"
]
},
"values": {
"windows": [
23
]
}
},
"Eisu": {
"name": "Eisu",
"value": 4294969108,
"names": {
"web": [
"Eisu"
],
"gtk": [
"Eisu_Shift"
],
"android": [
"EISU"
]
},
"values": {
"gtk": [
65327
],
"android": [
212
]
}
},
"Hankaku": {
"name": "Hankaku",
"value": 4294969109,
"names": {
"web": [
"Hankaku"
],
"gtk": [
"Hankaku"
]
},
"values": {
"gtk": [
65321
]
}
},
"Hiragana": {
"name": "Hiragana",
"value": 4294969110,
"names": {
"web": [
"Hiragana"
],
"gtk": [
"Hiragana"
]
},
"values": {
"gtk": [
65317
]
}
},
"HiraganaKatakana": {
"name": "HiraganaKatakana",
"value": 4294969111,
"names": {
"web": [
"HiraganaKatakana"
],
"gtk": [
"Hiragana_Katakana"
],
"android": [
"KATAKANA_HIRAGANA"
]
},
"values": {
"gtk": [
65319
],
"android": [
215
]
}
},
"KanaMode": {
"name": "KanaMode",
"value": 4294969112,
"names": {
"web": [
"KanaMode"
]
},
"values": {
"fuchsia": [
77309870216
]
}
},
"KanjiMode": {
"name": "KanjiMode",
"value": 4294969113,
"names": {
"web": [
"KanjiMode"
],
"gtk": [
"Kanji"
],
"windows": [
"HANJA, KANJI"
],
"android": [
"KANA"
]
},
"values": {
"gtk": [
65313
],
"windows": [
25
],
"android": [
218
]
}
},
"Katakana": {
"name": "Katakana",
"value": 4294969114,
"names": {
"web": [
"Katakana"
],
"gtk": [
"Katakana"
]
},
"values": {
"gtk": [
65318
]
}
},
"Romaji": {
"name": "Romaji",
"value": 4294969115,
"names": {
"web": [
"Romaji"
],
"gtk": [
"Romaji"
]
},
"values": {
"gtk": [
65316
]
}
},
"Zenkaku": {
"name": "Zenkaku",
"value": 4294969116,
"names": {
"web": [
"Zenkaku"
],
"gtk": [
"Zenkaku"
]
},
"values": {
"gtk": [
65320
]
}
},
"ZenkakuHankaku": {
"name": "ZenkakuHankaku",
"value": 4294969117,
"names": {
"web": [
"ZenkakuHankaku"
],
"gtk": [
"Zenkaku_Hankaku"
],
"android": [
"ZENKAKU_HANKAKU"
]
},
"values": {
"gtk": [
65322
],
"android": [
211
]
}
},
"F1": {
"name": "F1",
"value": 4294969345,
"names": {
"web": [
"F1"
],
"macos": [
"F1"
],
"ios": [
"F1"
],
"gtk": [
"KP_F1",
"F1"
],
"windows": [
"F1"
],
"android": [
"F1"
],
"glfw": [
"F1"
]
},
"values": {
"macos": [
122
],
"ios": [
58
],
"gtk": [
65425,
65470
],
"windows": [
112
],
"android": [
131
],
"fuchsia": [
77309870138
],
"glfw": [
290
]
}
},
"F2": {
"name": "F2",
"value": 4294969346,
"names": {
"web": [
"F2"
],
"macos": [
"F2"
],
"ios": [
"F2"
],
"gtk": [
"KP_F2",
"F2"
],
"windows": [
"F2"
],
"android": [
"F2"
],
"glfw": [
"F2"
]
},
"values": {
"macos": [
120
],
"ios": [
59
],
"gtk": [
65426,
65471
],
"windows": [
113
],
"android": [
132
],
"fuchsia": [
77309870139
],
"glfw": [
291
]
}
},
"F3": {
"name": "F3",
"value": 4294969347,
"names": {
"web": [
"F3"
],
"macos": [
"F3"
],
"ios": [
"F3"
],
"gtk": [
"KP_F3",
"F3"
],
"windows": [
"F3"
],
"android": [
"F3"
],
"glfw": [
"F3"
]
},
"values": {
"macos": [
99
],
"ios": [
60
],
"gtk": [
65427,
65472
],
"windows": [
114
],
"android": [
133
],
"fuchsia": [
77309870140
],
"glfw": [
292
]
}
},
"F4": {
"name": "F4",
"value": 4294969348,
"names": {
"web": [
"F4"
],
"macos": [
"F4"
],
"ios": [
"F4"
],
"gtk": [
"KP_F4",
"F4"
],
"windows": [
"F4"
],
"android": [
"F4"
],
"glfw": [
"F4"
]
},
"values": {
"macos": [
118
],
"ios": [
61
],
"gtk": [
65428,
65473
],
"windows": [
115
],
"android": [
134
],
"fuchsia": [
77309870141
],
"glfw": [
293
]
}
},
"F5": {
"name": "F5",
"value": 4294969349,
"names": {
"web": [
"F5"
],
"macos": [
"F5"
],
"ios": [
"F5"
],
"gtk": [
"F5"
],
"windows": [
"F5"
],
"android": [
"F5"
],
"glfw": [
"F5"
]
},
"values": {
"macos": [
96
],
"ios": [
62
],
"gtk": [
65474
],
"windows": [
116
],
"android": [
135
],
"fuchsia": [
77309870142
],
"glfw": [
294
]
}
},
"F6": {
"name": "F6",
"value": 4294969350,
"names": {
"web": [
"F6"
],
"macos": [
"F6"
],
"ios": [
"F6"
],
"gtk": [
"F6"
],
"windows": [
"F6"
],
"android": [
"F6"
],
"glfw": [
"F6"
]
},
"values": {
"macos": [
97
],
"ios": [
63
],
"gtk": [
65475
],
"windows": [
117
],
"android": [
136
],
"fuchsia": [
77309870143
],
"glfw": [
295
]
}
},
"F7": {
"name": "F7",
"value": 4294969351,
"names": {
"web": [
"F7"
],
"macos": [
"F7"
],
"ios": [
"F7"
],
"gtk": [
"F7"
],
"windows": [
"F7"
],
"android": [
"F7"
],
"glfw": [
"F7"
]
},
"values": {
"macos": [
98
],
"ios": [
64
],
"gtk": [
65476
],
"windows": [
118
],
"android": [
137
],
"fuchsia": [
77309870144
],
"glfw": [
296
]
}
},
"F8": {
"name": "F8",
"value": 4294969352,
"names": {
"web": [
"F8"
],
"macos": [
"F8"
],
"ios": [
"F8"
],
"gtk": [
"F8"
],
"windows": [
"F8"
],
"android": [
"F8"
],
"glfw": [
"F8"
]
},
"values": {
"macos": [
100
],
"ios": [
65
],
"gtk": [
65477
],
"windows": [
119
],
"android": [
138
],
"fuchsia": [
77309870145
],
"glfw": [
297
]
}
},
"F9": {
"name": "F9",
"value": 4294969353,
"names": {
"web": [
"F9"
],
"macos": [
"F9"
],
"ios": [
"F9"
],
"gtk": [
"F9"
],
"windows": [
"F9"
],
"android": [
"F9"
],
"glfw": [
"F9"
]
},
"values": {
"macos": [
101
],
"ios": [
66
],
"gtk": [
65478
],
"windows": [
120
],
"android": [
139
],
"fuchsia": [
77309870146
],
"glfw": [
298
]
}
},
"F10": {
"name": "F10",
"value": 4294969354,
"names": {
"web": [
"F10"
],
"macos": [
"F10"
],
"ios": [
"F10"
],
"gtk": [
"F10"
],
"windows": [
"F10"
],
"android": [
"F10"
],
"glfw": [
"F10"
]
},
"values": {
"macos": [
109
],
"ios": [
67
],
"gtk": [
65479
],
"windows": [
121
],
"android": [
140
],
"fuchsia": [
77309870147
],
"glfw": [
299
]
}
},
"F11": {
"name": "F11",
"value": 4294969355,
"names": {
"web": [
"F11"
],
"macos": [
"F11"
],
"ios": [
"F11"
],
"gtk": [
"F11"
],
"windows": [
"F11"
],
"android": [
"F11"
],
"glfw": [
"F11"
]
},
"values": {
"macos": [
103
],
"ios": [
68
],
"gtk": [
65480
],
"windows": [
122
],
"android": [
141
],
"fuchsia": [
77309870148
],
"glfw": [
300
]
}
},
"F12": {
"name": "F12",
"value": 4294969356,
"names": {
"web": [
"F12"
],
"macos": [
"F12"
],
"ios": [
"F12"
],
"gtk": [
"F12"
],
"windows": [
"F12"
],
"android": [
"F12"
],
"glfw": [
"F12"
]
},
"values": {
"macos": [
111
],
"ios": [
69
],
"gtk": [
65481
],
"windows": [
123
],
"android": [
142
],
"fuchsia": [
77309870149
],
"glfw": [
301
]
}
},
"F13": {
"name": "F13",
"value": 4294969357,
"names": {
"web": [
"F13"
],
"macos": [
"F13"
],
"ios": [
"F13"
],
"gtk": [
"F13"
],
"windows": [
"F13"
],
"glfw": [
"F13"
]
},
"values": {
"macos": [
105
],
"ios": [
104
],
"gtk": [
65482
],
"windows": [
124
],
"fuchsia": [
77309870184
],
"glfw": [
302
]
}
},
"F14": {
"name": "F14",
"value": 4294969358,
"names": {
"web": [
"F14"
],
"macos": [
"F14"
],
"ios": [
"F14"
],
"gtk": [
"F14"
],
"windows": [
"F14"
],
"glfw": [
"F14"
]
},
"values": {
"macos": [
107
],
"ios": [
105
],
"gtk": [
65483
],
"windows": [
125
],
"fuchsia": [
77309870185
],
"glfw": [
303
]
}
},
"F15": {
"name": "F15",
"value": 4294969359,
"names": {
"web": [
"F15"
],
"macos": [
"F15"
],
"ios": [
"F15"
],
"gtk": [
"F15"
],
"windows": [
"F15"
],
"glfw": [
"F15"
]
},
"values": {
"macos": [
113
],
"ios": [
106
],
"gtk": [
65484
],
"windows": [
126
],
"fuchsia": [
77309870186
],
"glfw": [
304
]
}
},
"F16": {
"name": "F16",
"value": 4294969360,
"names": {
"web": [
"F16"
],
"macos": [
"F16"
],
"ios": [
"F16"
],
"gtk": [
"F16"
],
"windows": [
"F16"
],
"glfw": [
"F16"
]
},
"values": {
"macos": [
106
],
"ios": [
107
],
"gtk": [
65485
],
"windows": [
127
],
"fuchsia": [
77309870187
],
"glfw": [
305
]
}
},
"F17": {
"name": "F17",
"value": 4294969361,
"names": {
"web": [
"F17"
],
"macos": [
"F17"
],
"ios": [
"F17"
],
"gtk": [
"F17"
],
"windows": [
"F17"
],
"glfw": [
"F17"
]
},
"values": {
"macos": [
64
],
"ios": [
108
],
"gtk": [
65486
],
"windows": [
128
],
"fuchsia": [
77309870188
],
"glfw": [
306
]
}
},
"F18": {
"name": "F18",
"value": 4294969362,
"names": {
"web": [
"F18"
],
"macos": [
"F18"
],
"ios": [
"F18"
],
"gtk": [
"F18"
],
"windows": [
"F18"
],
"glfw": [
"F18"
]
},
"values": {
"macos": [
79
],
"ios": [
109
],
"gtk": [
65487
],
"windows": [
129
],
"fuchsia": [
77309870189
],
"glfw": [
307
]
}
},
"F19": {
"name": "F19",
"value": 4294969363,
"names": {
"web": [
"F19"
],
"macos": [
"F19"
],
"ios": [
"F19"
],
"gtk": [
"F19"
],
"windows": [
"F19"
],
"glfw": [
"F19"
]
},
"values": {
"macos": [
80
],
"ios": [
110
],
"gtk": [
65488
],
"windows": [
130
],
"fuchsia": [
77309870190
],
"glfw": [
308
]
}
},
"F20": {
"name": "F20",
"value": 4294969364,
"names": {
"web": [
"F20"
],
"macos": [
"F20"
],
"ios": [
"F20"
],
"gtk": [
"F20"
],
"windows": [
"F20"
],
"glfw": [
"F20"
]
},
"values": {
"macos": [
90
],
"ios": [
111
],
"gtk": [
65489
],
"windows": [
131
],
"fuchsia": [
77309870191
],
"glfw": [
309
]
}
},
"F21": {
"name": "F21",
"value": 4294969365,
"names": {
"web": [
"F21"
],
"gtk": [
"F21"
],
"windows": [
"F21"
],
"glfw": [
"F21"
]
},
"values": {
"gtk": [
65490
],
"windows": [
132
],
"fuchsia": [
77309870192
],
"glfw": [
310
]
}
},
"F22": {
"name": "F22",
"value": 4294969366,
"names": {
"web": [
"F22"
],
"gtk": [
"F22"
],
"windows": [
"F22"
],
"glfw": [
"F22"
]
},
"values": {
"gtk": [
65491
],
"windows": [
133
],
"fuchsia": [
77309870193
],
"glfw": [
311
]
}
},
"F23": {
"name": "F23",
"value": 4294969367,
"names": {
"web": [
"F23"
],
"gtk": [
"F23"
],
"windows": [
"F23"
],
"glfw": [
"F23"
]
},
"values": {
"gtk": [
65492
],
"windows": [
134
],
"fuchsia": [
77309870194
],
"glfw": [
312
]
}
},
"F24": {
"name": "F24",
"value": 4294969368,
"names": {
"web": [
"F24"
],
"gtk": [
"F24"
],
"windows": [
"F24"
]
},
"values": {
"gtk": [
65493
],
"windows": [
135
],
"fuchsia": [
77309870195
]
}
},
"Soft1": {
"name": "Soft1",
"value": 4294969601,
"names": {
"web": [
"Soft1"
]
}
},
"Soft2": {
"name": "Soft2",
"value": 4294969602,
"names": {
"web": [
"Soft2"
]
}
},
"Soft3": {
"name": "Soft3",
"value": 4294969603,
"names": {
"web": [
"Soft3"
]
}
},
"Soft4": {
"name": "Soft4",
"value": 4294969604,
"names": {
"web": [
"Soft4"
]
}
},
"Soft5": {
"name": "Soft5",
"value": 4294969605,
"names": {
"web": [
"Soft5"
]
}
},
"Soft6": {
"name": "Soft6",
"value": 4294969606,
"names": {
"web": [
"Soft6"
]
}
},
"Soft7": {
"name": "Soft7",
"value": 4294969607,
"names": {
"web": [
"Soft7"
]
}
},
"Soft8": {
"name": "Soft8",
"value": 4294969608,
"names": {
"web": [
"Soft8"
]
}
},
"Close": {
"name": "Close",
"value": 4294969857,
"names": {
"web": [
"Close"
],
"gtk": [
"Close"
],
"android": [
"MEDIA_CLOSE"
]
},
"values": {
"gtk": [
269025110
],
"android": [
128
],
"fuchsia": [
77310198275
]
}
},
"MailForward": {
"name": "MailForward",
"value": 4294969858,
"names": {
"web": [
"MailForward"
],
"gtk": [
"MailForward"
]
},
"values": {
"gtk": [
269025168
],
"fuchsia": [
77310198411
]
}
},
"MailReply": {
"name": "MailReply",
"value": 4294969859,
"names": {
"web": [
"MailReply"
],
"gtk": [
"Reply"
]
},
"values": {
"gtk": [
269025138
],
"fuchsia": [
77310198409
]
}
},
"MailSend": {
"name": "MailSend",
"value": 4294969860,
"names": {
"web": [
"MailSend"
],
"gtk": [
"Send"
]
},
"values": {
"gtk": [
269025147
],
"fuchsia": [
77310198412
]
}
},
"MediaPlayPause": {
"name": "MediaPlayPause",
"value": 4294969861,
"names": {
"web": [
"MediaPlayPause"
],
"windows": [
"MEDIA_PLAY_PAUSE"
],
"android": [
"MEDIA_PLAY_PAUSE"
]
},
"values": {
"windows": [
179
],
"android": [
85
],
"fuchsia": [
77310197965
]
}
},
"MediaStop": {
"name": "MediaStop",
"value": 4294969863,
"names": {
"web": [
"MediaStop"
],
"gtk": [
"AudioStop"
],
"windows": [
"MEDIA_STOP"
],
"android": [
"MEDIA_STOP"
]
},
"values": {
"gtk": [
269025045
],
"windows": [
178
],
"android": [
86
],
"fuchsia": [
77310197943
]
}
},
"MediaTrackNext": {
"name": "MediaTrackNext",
"value": 4294969864,
"names": {
"web": [
"MediaTrackNext"
],
"gtk": [
"AudioNext"
],
"android": [
"MEDIA_NEXT"
]
},
"values": {
"gtk": [
269025047
],
"android": [
87
],
"fuchsia": [
77310197941
]
}
},
"MediaTrackPrevious": {
"name": "MediaTrackPrevious",
"value": 4294969865,
"names": {
"web": [
"MediaTrackPrevious"
],
"gtk": [
"AudioPrev"
],
"android": [
"MEDIA_PREVIOUS"
]
},
"values": {
"gtk": [
269025046
],
"android": [
88
],
"fuchsia": [
77310197942
]
}
},
"New": {
"name": "New",
"value": 4294969866,
"names": {
"web": [
"New"
],
"gtk": [
"New"
]
},
"values": {
"gtk": [
269025128
],
"fuchsia": [
77310198273
]
}
},
"Open": {
"name": "Open",
"value": 4294969867,
"names": {
"web": [
"Open"
],
"gtk": [
"Open"
]
},
"values": {
"gtk": [
269025131
],
"fuchsia": [
77309870196
]
}
},
"Print": {
"name": "Print",
"value": 4294969868,
"names": {
"web": [
"Print"
],
"gtk": [
"Print"
],
"windows": [
"PRINT"
]
},
"values": {
"gtk": [
65377
],
"windows": [
42
],
"fuchsia": [
77310198280
]
}
},
"Save": {
"name": "Save",
"value": 4294969869,
"names": {
"web": [
"Save"
],
"gtk": [
"Save"
]
},
"values": {
"gtk": [
269025143
],
"fuchsia": [
77310198279
]
}
},
"SpellCheck": {
"name": "SpellCheck",
"value": 4294969870,
"names": {
"web": [
"SpellCheck"
],
"gtk": [
"Spell"
]
},
"values": {
"gtk": [
269025148
],
"fuchsia": [
77310198187
]
}
},
"AudioVolumeDown": {
"name": "AudioVolumeDown",
"value": 4294969871,
"names": {
"web": [
"AudioVolumeDown"
],
"macos": [
"AudioVolumeDown"
],
"ios": [
"AudioVolumeDown"
],
"gtk": [
"AudioLowerVolume"
],
"windows": [
"VOLUME_DOWN"
],
"android": [
"VOLUME_DOWN"
]
},
"values": {
"macos": [
73
],
"ios": [
129
],
"gtk": [
269025041
],
"windows": [
174
],
"android": [
25
],
"fuchsia": [
77309870209
]
}
},
"AudioVolumeUp": {
"name": "AudioVolumeUp",
"value": 4294969872,
"names": {
"web": [
"AudioVolumeUp"
],
"macos": [
"AudioVolumeUp"
],
"ios": [
"AudioVolumeUp"
],
"gtk": [
"AudioRaiseVolume"
],
"windows": [
"VOLUME_UP"
],
"android": [
"VOLUME_UP"
]
},
"values": {
"macos": [
72
],
"ios": [
128
],
"gtk": [
269025043
],
"windows": [
175
],
"android": [
24
],
"fuchsia": [
77309870208
]
}
},
"AudioVolumeMute": {
"name": "AudioVolumeMute",
"value": 4294969873,
"names": {
"web": [
"AudioVolumeMute"
],
"macos": [
"AudioVolumeMute"
],
"ios": [
"AudioVolumeMute"
],
"gtk": [
"AudioMute"
],
"windows": [
"VOLUME_MUTE"
],
"android": [
"VOLUME_MUTE"
]
},
"values": {
"macos": [
74
],
"ios": [
127
],
"gtk": [
269025042
],
"windows": [
173
],
"android": [
164
],
"fuchsia": [
77309870207
]
}
},
"LaunchApplication2": {
"name": "LaunchApplication2",
"value": 4294970113,
"names": {
"web": [
"LaunchApplication2"
]
}
},
"LaunchCalendar": {
"name": "LaunchCalendar",
"value": 4294970114,
"names": {
"web": [
"LaunchCalendar"
],
"gtk": [
"Calendar"
],
"android": [
"CALENDAR"
]
},
"values": {
"gtk": [
269025056
],
"android": [
208
],
"fuchsia": [
77310198158
]
}
},
"LaunchMail": {
"name": "LaunchMail",
"value": 4294970115,
"names": {
"web": [
"LaunchMail"
],
"gtk": [
"Mail"
],
"windows": [
"LAUNCH_MAIL"
],
"android": [
"ENVELOPE"
]
},
"values": {
"gtk": [
269025049
],
"windows": [
180
],
"android": [
65
],
"fuchsia": [
77310198154
]
}
},
"LaunchMediaPlayer": {
"name": "LaunchMediaPlayer",
"value": 4294970116,
"names": {
"web": [
"LaunchMediaPlayer"
]
}
},
"LaunchMusicPlayer": {
"name": "LaunchMusicPlayer",
"value": 4294970117,
"names": {
"web": [
"LaunchMusicPlayer"
],
"android": [
"MUSIC"
]
},
"values": {
"android": [
209
]
}
},
"LaunchApplication1": {
"name": "LaunchApplication1",
"value": 4294970118,
"names": {
"web": [
"LaunchApplication1"
]
}
},
"LaunchScreenSaver": {
"name": "LaunchScreenSaver",
"value": 4294970119,
"names": {
"web": [
"LaunchScreenSaver"
],
"gtk": [
"ScreenSaver"
]
},
"values": {
"gtk": [
269025069
],
"fuchsia": [
77310198193
]
}
},
"LaunchSpreadsheet": {
"name": "LaunchSpreadsheet",
"value": 4294970120,
"names": {
"web": [
"LaunchSpreadsheet"
]
},
"values": {
"fuchsia": [
77310198150
]
}
},
"LaunchWebBrowser": {
"name": "LaunchWebBrowser",
"value": 4294970121,
"names": {
"web": [
"LaunchWebBrowser"
],
"android": [
"EXPLORER"
]
},
"values": {
"android": [
64
]
}
},
"LaunchWebCam": {
"name": "LaunchWebCam",
"value": 4294970122,
"names": {
"web": [
"LaunchWebCam"
]
}
},
"LaunchWordProcessor": {
"name": "LaunchWordProcessor",
"value": 4294970123,
"names": {
"web": [
"LaunchWordProcessor"
]
},
"values": {
"fuchsia": [
77310198148
]
}
},
"LaunchContacts": {
"name": "LaunchContacts",
"value": 4294970124,
"names": {
"web": [
"LaunchContacts"
],
"android": [
"CONTACTS"
]
},
"values": {
"android": [
207
],
"fuchsia": [
77310198157
]
}
},
"LaunchPhone": {
"name": "LaunchPhone",
"value": 4294970125,
"names": {
"web": [
"LaunchPhone"
],
"gtk": [
"Phone"
]
},
"values": {
"gtk": [
269025134
],
"fuchsia": [
77310197900
]
}
},
"LaunchAssistant": {
"name": "LaunchAssistant",
"value": 4294970126,
"names": {
"web": [
"LaunchAssistant"
],
"android": [
"ASSIST"
]
},
"values": {
"android": [
219
],
"fuchsia": [
77310198219
]
}
},
"LaunchControlPanel": {
"name": "LaunchControlPanel",
"value": 4294970127,
"names": {
"web": [
"LaunchControlPanel"
]
},
"values": {
"fuchsia": [
77310198175
]
}
},
"BrowserBack": {
"name": "BrowserBack",
"value": 4294970369,
"names": {
"web": [
"BrowserBack"
],
"gtk": [
"Back"
],
"windows": [
"BROWSER_BACK"
]
},
"values": {
"gtk": [
269025062
],
"windows": [
166
],
"fuchsia": [
77310198308
]
}
},
"BrowserFavorites": {
"name": "BrowserFavorites",
"value": 4294970370,
"names": {
"web": [
"BrowserFavorites"
],
"gtk": [
"Favorites"
],
"windows": [
"BROWSER_FAVORITES"
],
"android": [
"BOOKMARK"
]
},
"values": {
"gtk": [
269025072
],
"windows": [
171
],
"android": [
174
],
"fuchsia": [
77310198314
]
}
},
"BrowserForward": {
"name": "BrowserForward",
"value": 4294970371,
"names": {
"web": [
"BrowserForward"
],
"gtk": [
"Forward"
],
"windows": [
"BROWSER_FORWARD"
],
"android": [
"FORWARD"
]
},
"values": {
"gtk": [
269025063
],
"windows": [
167
],
"android": [
125
],
"fuchsia": [
77310198309
]
}
},
"BrowserHome": {
"name": "BrowserHome",
"value": 4294970372,
"names": {
"web": [
"BrowserHome"
],
"gtk": [
"HomePage"
],
"windows": [
"BROWSER_HOME"
]
},
"values": {
"gtk": [
269025048
],
"windows": [
172
],
"fuchsia": [
77310198307
]
}
},
"BrowserRefresh": {
"name": "BrowserRefresh",
"value": 4294970373,
"names": {
"web": [
"BrowserRefresh"
],
"gtk": [
"Refresh"
],
"windows": [
"BROWSER_REFRESH"
]
},
"values": {
"gtk": [
269025065
],
"windows": [
168
],
"fuchsia": [
77310198311
]
}
},
"BrowserSearch": {
"name": "BrowserSearch",
"value": 4294970374,
"names": {
"web": [
"BrowserSearch"
],
"gtk": [
"Search"
],
"windows": [
"BROWSER_SEARCH"
],
"android": [
"SEARCH"
]
},
"values": {
"gtk": [
269025051
],
"windows": [
170
],
"android": [
84
],
"fuchsia": [
77310198305
]
}
},
"BrowserStop": {
"name": "BrowserStop",
"value": 4294970375,
"names": {
"web": [
"BrowserStop"
],
"gtk": [
"Stop"
],
"windows": [
"BROWSER_STOP"
]
},
"values": {
"gtk": [
269025064
],
"windows": [
169
],
"fuchsia": [
77310198310
]
}
},
"AudioBalanceLeft": {
"name": "AudioBalanceLeft",
"value": 4294970625,
"names": {
"web": [
"AudioBalanceLeft"
]
}
},
"AudioBalanceRight": {
"name": "AudioBalanceRight",
"value": 4294970626,
"names": {
"web": [
"AudioBalanceRight"
]
}
},
"AudioBassBoostDown": {
"name": "AudioBassBoostDown",
"value": 4294970627,
"names": {
"web": [
"AudioBassBoostDown"
]
}
},
"AudioBassBoostUp": {
"name": "AudioBassBoostUp",
"value": 4294970628,
"names": {
"web": [
"AudioBassBoostUp"
]
}
},
"AudioFaderFront": {
"name": "AudioFaderFront",
"value": 4294970629,
"names": {
"web": [
"AudioFaderFront"
]
}
},
"AudioFaderRear": {
"name": "AudioFaderRear",
"value": 4294970630,
"names": {
"web": [
"AudioFaderRear"
]
}
},
"AudioSurroundModeNext": {
"name": "AudioSurroundModeNext",
"value": 4294970631,
"names": {
"web": [
"AudioSurroundModeNext"
]
}
},
"AVRInput": {
"name": "AVRInput",
"value": 4294970632,
"names": {
"web": [
"AVRInput"
],
"android": [
"AVR_INPUT"
]
},
"values": {
"android": [
182
]
}
},
"AVRPower": {
"name": "AVRPower",
"value": 4294970633,
"names": {
"web": [
"AVRPower"
],
"android": [
"AVR_POWER"
]
},
"values": {
"android": [
181
]
}
},
"ChannelDown": {
"name": "ChannelDown",
"value": 4294970634,
"names": {
"web": [
"ChannelDown"
],
"android": [
"CHANNEL_DOWN"
]
},
"values": {
"android": [
167
],
"fuchsia": [
77310197917
]
}
},
"ChannelUp": {
"name": "ChannelUp",
"value": 4294970635,
"names": {
"web": [
"ChannelUp"
],
"android": [
"CHANNEL_UP"
]
},
"values": {
"android": [
166
],
"fuchsia": [
77310197916
]
}
},
"ColorF0Red": {
"name": "ColorF0Red",
"value": 4294970636,
"names": {
"web": [
"ColorF0Red"
],
"android": [
"PROG_RED"
]
},
"values": {
"android": [
183
]
}
},
"ColorF1Green": {
"name": "ColorF1Green",
"value": 4294970637,
"names": {
"web": [
"ColorF1Green"
],
"android": [
"PROG_GREEN"
]
},
"values": {
"android": [
184
]
}
},
"ColorF2Yellow": {
"name": "ColorF2Yellow",
"value": 4294970638,
"names": {
"web": [
"ColorF2Yellow"
],
"android": [
"PROG_YELLOW"
]
},
"values": {
"android": [
185
]
}
},
"ColorF3Blue": {
"name": "ColorF3Blue",
"value": 4294970639,
"names": {
"web": [
"ColorF3Blue"
],
"android": [
"PROG_BLUE"
]
},
"values": {
"android": [
186
]
}
},
"ColorF4Grey": {
"name": "ColorF4Grey",
"value": 4294970640,
"names": {
"web": [
"ColorF4Grey"
]
}
},
"ColorF5Brown": {
"name": "ColorF5Brown",
"value": 4294970641,
"names": {
"web": [
"ColorF5Brown"
]
}
},
"ClosedCaptionToggle": {
"name": "ClosedCaptionToggle",
"value": 4294970642,
"names": {
"web": [
"ClosedCaptionToggle"
],
"android": [
"CAPTIONS"
]
},
"values": {
"android": [
175
],
"fuchsia": [
77310197857
]
}
},
"Dimmer": {
"name": "Dimmer",
"value": 4294970643,
"names": {
"web": [
"Dimmer"
]
}
},
"DisplaySwap": {
"name": "DisplaySwap",
"value": 4294970644,
"names": {
"web": [
"DisplaySwap"
]
}
},
"Exit": {
"name": "Exit",
"value": 4294970645,
"names": {
"web": [
"Exit"
]
},
"values": {
"fuchsia": [
77310197908
]
}
},
"FavoriteClear0": {
"name": "FavoriteClear0",
"value": 4294970646,
"names": {
"web": [
"FavoriteClear0"
]
}
},
"FavoriteClear1": {
"name": "FavoriteClear1",
"value": 4294970647,
"names": {
"web": [
"FavoriteClear1"
]
}
},
"FavoriteClear2": {
"name": "FavoriteClear2",
"value": 4294970648,
"names": {
"web": [
"FavoriteClear2"
]
}
},
"FavoriteClear3": {
"name": "FavoriteClear3",
"value": 4294970649,
"names": {
"web": [
"FavoriteClear3"
]
}
},
"FavoriteRecall0": {
"name": "FavoriteRecall0",
"value": 4294970650,
"names": {
"web": [
"FavoriteRecall0"
]
}
},
"FavoriteRecall1": {
"name": "FavoriteRecall1",
"value": 4294970651,
"names": {
"web": [
"FavoriteRecall1"
]
}
},
"FavoriteRecall2": {
"name": "FavoriteRecall2",
"value": 4294970652,
"names": {
"web": [
"FavoriteRecall2"
]
}
},
"FavoriteRecall3": {
"name": "FavoriteRecall3",
"value": 4294970653,
"names": {
"web": [
"FavoriteRecall3"
]
}
},
"FavoriteStore0": {
"name": "FavoriteStore0",
"value": 4294970654,
"names": {
"web": [
"FavoriteStore0"
]
}
},
"FavoriteStore1": {
"name": "FavoriteStore1",
"value": 4294970655,
"names": {
"web": [
"FavoriteStore1"
]
}
},
"FavoriteStore2": {
"name": "FavoriteStore2",
"value": 4294970656,
"names": {
"web": [
"FavoriteStore2"
]
}
},
"FavoriteStore3": {
"name": "FavoriteStore3",
"value": 4294970657,
"names": {
"web": [
"FavoriteStore3"
]
}
},
"Guide": {
"name": "Guide",
"value": 4294970658,
"names": {
"web": [
"Guide"
],
"android": [
"GUIDE"
]
},
"values": {
"android": [
172
]
}
},
"GuideNextDay": {
"name": "GuideNextDay",
"value": 4294970659,
"names": {
"web": [
"GuideNextDay"
]
}
},
"GuidePreviousDay": {
"name": "GuidePreviousDay",
"value": 4294970660,
"names": {
"web": [
"GuidePreviousDay"
]
}
},
"Info": {
"name": "Info",
"value": 4294970661,
"names": {
"web": [
"Info"
],
"android": [
"INFO"
]
},
"values": {
"android": [
165
],
"fuchsia": [
77310197856
]
}
},
"InstantReplay": {
"name": "InstantReplay",
"value": 4294970662,
"names": {
"web": [
"InstantReplay"
]
}
},
"Link": {
"name": "Link",
"value": 4294970663,
"names": {
"web": [
"Link"
]
}
},
"ListProgram": {
"name": "ListProgram",
"value": 4294970664,
"names": {
"web": [
"ListProgram"
]
}
},
"LiveContent": {
"name": "LiveContent",
"value": 4294970665,
"names": {
"web": [
"LiveContent"
]
}
},
"Lock": {
"name": "Lock",
"value": 4294970666,
"names": {
"web": [
"Lock"
]
}
},
"MediaApps": {
"name": "MediaApps",
"value": 4294970667,
"names": {
"web": [
"MediaApps"
]
}
},
"MediaFastForward": {
"name": "MediaFastForward",
"value": 4294970668,
"names": {
"web": [
"MediaFastForward"
],
"gtk": [
"AudioForward"
],
"android": [
"MEDIA_FAST_FORWARD"
]
},
"values": {
"gtk": [
269025175
],
"android": [
90
],
"fuchsia": [
77310197939
]
}
},
"MediaLast": {
"name": "MediaLast",
"value": 4294970669,
"names": {
"web": [
"MediaLast"
],
"android": [
"LAST_CHANNEL"
]
},
"values": {
"android": [
229
],
"fuchsia": [
77310197891
]
}
},
"MediaPause": {
"name": "MediaPause",
"value": 4294970670,
"names": {
"web": [
"MediaPause"
],
"gtk": [
"AudioPause"
],
"android": [
"MEDIA_PAUSE"
]
},
"values": {
"gtk": [
269025073
],
"android": [
127
],
"fuchsia": [
77310197937
]
}
},
"MediaPlay": {
"name": "MediaPlay",
"value": 4294970671,
"names": {
"web": [
"MediaPlay"
],
"gtk": [
"3270_Play",
"AudioPlay"
],
"android": [
"MEDIA_PLAY"
]
},
"values": {
"gtk": [
64790,
269025044
],
"android": [
126
],
"fuchsia": [
77310197936
]
}
},
"MediaRecord": {
"name": "MediaRecord",
"value": 4294970672,
"names": {
"web": [
"MediaRecord"
],
"gtk": [
"AudioRecord"
],
"android": [
"MEDIA_RECORD"
]
},
"values": {
"gtk": [
269025052
],
"android": [
130
],
"fuchsia": [
77310197938
]
}
},
"MediaRewind": {
"name": "MediaRewind",
"value": 4294970673,
"names": {
"web": [
"MediaRewind"
],
"gtk": [
"AudioRewind"
],
"android": [
"MEDIA_REWIND"
]
},
"values": {
"gtk": [
269025086
],
"android": [
89
],
"fuchsia": [
77310197940
]
}
},
"MediaSkip": {
"name": "MediaSkip",
"value": 4294970674,
"names": {
"web": [
"MediaSkip"
]
}
},
"NextFavoriteChannel": {
"name": "NextFavoriteChannel",
"value": 4294970675,
"names": {
"web": [
"NextFavoriteChannel"
]
}
},
"NextUserProfile": {
"name": "NextUserProfile",
"value": 4294970676,
"names": {
"web": [
"NextUserProfile"
]
}
},
"OnDemand": {
"name": "OnDemand",
"value": 4294970677,
"names": {
"web": [
"OnDemand"
]
}
},
"PInPDown": {
"name": "PInPDown",
"value": 4294970678,
"names": {
"web": [
"PinPDown"
]
}
},
"PInPMove": {
"name": "PInPMove",
"value": 4294970679,
"names": {
"web": [
"PinPMove"
]
}
},
"PInPToggle": {
"name": "PInPToggle",
"value": 4294970680,
"names": {
"web": [
"PinPToggle"
]
}
},
"PInPUp": {
"name": "PInPUp",
"value": 4294970681,
"names": {
"web": [
"PinPUp"
]
}
},
"PlaySpeedDown": {
"name": "PlaySpeedDown",
"value": 4294970682,
"names": {
"web": [
"PlaySpeedDown"
]
}
},
"PlaySpeedReset": {
"name": "PlaySpeedReset",
"value": 4294970683,
"names": {
"web": [
"PlaySpeedReset"
]
}
},
"PlaySpeedUp": {
"name": "PlaySpeedUp",
"value": 4294970684,
"names": {
"web": [
"PlaySpeedUp"
]
}
},
"RandomToggle": {
"name": "RandomToggle",
"value": 4294970685,
"names": {
"web": [
"RandomToggle"
]
}
},
"RcLowBattery": {
"name": "RcLowBattery",
"value": 4294970686,
"names": {
"web": [
"RcLowBattery"
]
}
},
"RecordSpeedNext": {
"name": "RecordSpeedNext",
"value": 4294970687,
"names": {
"web": [
"RecordSpeedNext"
]
}
},
"RfBypass": {
"name": "RfBypass",
"value": 4294970688,
"names": {
"web": [
"RfBypass"
]
}
},
"ScanChannelsToggle": {
"name": "ScanChannelsToggle",
"value": 4294970689,
"names": {
"web": [
"ScanChannelsToggle"
]
}
},
"ScreenModeNext": {
"name": "ScreenModeNext",
"value": 4294970690,
"names": {
"web": [
"ScreenModeNext"
]
}
},
"Settings": {
"name": "Settings",
"value": 4294970691,
"names": {
"web": [
"Settings"
],
"android": [
"SETTINGS"
]
},
"values": {
"android": [
176
]
}
},
"SplitScreenToggle": {
"name": "SplitScreenToggle",
"value": 4294970692,
"names": {
"web": [
"SplitScreenToggle"
]
}
},
"STBInput": {
"name": "STBInput",
"value": 4294970693,
"names": {
"web": [
"STBInput"
],
"android": [
"STB_INPUT"
]
},
"values": {
"android": [
180
]
}
},
"STBPower": {
"name": "STBPower",
"value": 4294970694,
"names": {
"web": [
"STBPower"
],
"android": [
"STB_POWER"
]
},
"values": {
"android": [
179
]
}
},
"Subtitle": {
"name": "Subtitle",
"value": 4294970695,
"names": {
"web": [
"Subtitle"
]
}
},
"Teletext": {
"name": "Teletext",
"value": 4294970696,
"names": {
"web": [
"Teletext"
],
"android": [
"TV_TELETEXT"
]
},
"values": {
"android": [
233
]
}
},
"TV": {
"name": "TV",
"value": 4294970697,
"names": {
"web": [
"TV"
],
"android": [
"TV"
]
},
"values": {
"android": [
170
]
}
},
"TVInput": {
"name": "TVInput",
"value": 4294970698,
"names": {
"web": [
"TVInput"
],
"android": [
"TV_INPUT"
]
},
"values": {
"android": [
178
]
}
},
"TVPower": {
"name": "TVPower",
"value": 4294970699,
"names": {
"web": [
"TVPower"
],
"android": [
"TV_POWER"
]
},
"values": {
"android": [
177
]
}
},
"VideoModeNext": {
"name": "VideoModeNext",
"value": 4294970700,
"names": {
"web": [
"VideoModeNext"
]
}
},
"Wink": {
"name": "Wink",
"value": 4294970701,
"names": {
"web": [
"Wink"
]
}
},
"ZoomToggle": {
"name": "ZoomToggle",
"value": 4294970702,
"names": {
"web": [
"ZoomToggle"
],
"android": [
"TV_ZOOM_MODE"
]
},
"values": {
"android": [
255
],
"fuchsia": [
77310198322
]
}
},
"DVR": {
"name": "DVR",
"value": 4294970703,
"names": {
"web": [
"DVR"
],
"android": [
"DVR"
]
},
"values": {
"android": [
173
]
}
},
"MediaAudioTrack": {
"name": "MediaAudioTrack",
"value": 4294970704,
"names": {
"web": [
"MediaAudioTrack"
],
"android": [
"MEDIA_AUDIO_TRACK"
]
},
"values": {
"android": [
222
]
}
},
"MediaSkipBackward": {
"name": "MediaSkipBackward",
"value": 4294970705,
"names": {
"web": [
"MediaSkipBackward"
],
"android": [
"MEDIA_SKIP_BACKWARD"
]
},
"values": {
"android": [
273
]
}
},
"MediaSkipForward": {
"name": "MediaSkipForward",
"value": 4294970706,
"names": {
"web": [
"MediaSkipForward"
],
"android": [
"MEDIA_SKIP_FORWARD"
]
},
"values": {
"android": [
272
]
}
},
"MediaStepBackward": {
"name": "MediaStepBackward",
"value": 4294970707,
"names": {
"web": [
"MediaStepBackward"
],
"android": [
"MEDIA_STEP_BACKWARD"
]
},
"values": {
"android": [
275
]
}
},
"MediaStepForward": {
"name": "MediaStepForward",
"value": 4294970708,
"names": {
"web": [
"MediaStepForward"
],
"android": [
"MEDIA_STEP_FORWARD"
]
},
"values": {
"android": [
274
]
}
},
"MediaTopMenu": {
"name": "MediaTopMenu",
"value": 4294970709,
"names": {
"web": [
"MediaTopMenu"
],
"android": [
"MEDIA_TOP_MENU"
]
},
"values": {
"android": [
226
]
}
},
"NavigateIn": {
"name": "NavigateIn",
"value": 4294970710,
"names": {
"web": [
"NavigateIn"
],
"android": [
"NAVIGATE_IN"
]
},
"values": {
"android": [
262
]
}
},
"NavigateNext": {
"name": "NavigateNext",
"value": 4294970711,
"names": {
"web": [
"NavigateNext"
],
"android": [
"NAVIGATE_NEXT"
]
},
"values": {
"android": [
261
]
}
},
"NavigateOut": {
"name": "NavigateOut",
"value": 4294970712,
"names": {
"web": [
"NavigateOut"
],
"android": [
"NAVIGATE_OUT"
]
},
"values": {
"android": [
263
]
}
},
"NavigatePrevious": {
"name": "NavigatePrevious",
"value": 4294970713,
"names": {
"web": [
"NavigatePrevious"
],
"android": [
"NAVIGATE_PREVIOUS"
]
},
"values": {
"android": [
260
]
}
},
"Pairing": {
"name": "Pairing",
"value": 4294970714,
"names": {
"web": [
"Pairing"
],
"android": [
"PAIRING"
]
},
"values": {
"android": [
225
]
}
},
"MediaClose": {
"name": "MediaClose",
"value": 4294970715,
"names": {
"web": [
"MediaClose"
]
}
},
"AudioBassBoostToggle": {
"name": "AudioBassBoostToggle",
"value": 4294970882,
"names": {
"web": [
"AudioBassBoostToggle"
]
}
},
"AudioTrebleDown": {
"name": "AudioTrebleDown",
"value": 4294970884,
"names": {
"web": [
"AudioTrebleDown"
]
}
},
"AudioTrebleUp": {
"name": "AudioTrebleUp",
"value": 4294970885,
"names": {
"web": [
"AudioTrebleUp"
]
}
},
"MicrophoneToggle": {
"name": "MicrophoneToggle",
"value": 4294970886,
"names": {
"web": [
"MicrophoneToggle"
]
}
},
"MicrophoneVolumeDown": {
"name": "MicrophoneVolumeDown",
"value": 4294970887,
"names": {
"web": [
"MicrophoneVolumeDown"
]
}
},
"MicrophoneVolumeUp": {
"name": "MicrophoneVolumeUp",
"value": 4294970888,
"names": {
"web": [
"MicrophoneVolumeUp"
]
}
},
"MicrophoneVolumeMute": {
"name": "MicrophoneVolumeMute",
"value": 4294970889,
"names": {
"web": [
"MicrophoneVolumeMute"
],
"android": [
"MUTE"
]
},
"values": {
"android": [
91
]
}
},
"SpeechCorrectionList": {
"name": "SpeechCorrectionList",
"value": 4294971137,
"names": {
"web": [
"SpeechCorrectionList"
]
}
},
"SpeechInputToggle": {
"name": "SpeechInputToggle",
"value": 4294971138,
"names": {
"web": [
"SpeechInputToggle"
]
},
"values": {
"fuchsia": [
77310197967
]
}
},
"AppSwitch": {
"name": "AppSwitch",
"value": 4294971393,
"names": {
"web": [
"AppSwitch"
],
"android": [
"APP_SWITCH"
]
},
"values": {
"android": [
187
]
}
},
"Call": {
"name": "Call",
"value": 4294971394,
"names": {
"web": [
"Call"
],
"android": [
"CALL"
]
},
"values": {
"android": [
5
]
}
},
"CameraFocus": {
"name": "CameraFocus",
"value": 4294971395,
"names": {
"web": [
"CameraFocus"
],
"android": [
"FOCUS"
]
},
"values": {
"android": [
80
]
}
},
"EndCall": {
"name": "EndCall",
"value": 4294971396,
"names": {
"web": [
"EndCall"
],
"android": [
"ENDCALL"
]
},
"values": {
"android": [
6
]
}
},
"GoBack": {
"name": "GoBack",
"value": 4294971397,
"names": {
"web": [
"GoBack"
],
"android": [
"BACK"
]
},
"values": {
"android": [
4
]
}
},
"GoHome": {
"name": "GoHome",
"value": 4294971398,
"names": {
"web": [
"GoHome"
],
"android": [
"HOME"
]
},
"values": {
"android": [
3
]
}
},
"HeadsetHook": {
"name": "HeadsetHook",
"value": 4294971399,
"names": {
"web": [
"HeadsetHook"
],
"android": [
"HEADSETHOOK"
]
},
"values": {
"android": [
79
]
}
},
"LastNumberRedial": {
"name": "LastNumberRedial",
"value": 4294971400,
"names": {
"web": [
"LastNumberRedial"
]
}
},
"Notification": {
"name": "Notification",
"value": 4294971401,
"names": {
"web": [
"Notification"
],
"android": [
"NOTIFICATION"
]
},
"values": {
"android": [
83
]
}
},
"MannerMode": {
"name": "MannerMode",
"value": 4294971402,
"names": {
"web": [
"MannerMode"
],
"android": [
"MANNER_MODE"
]
},
"values": {
"android": [
205
]
}
},
"VoiceDial": {
"name": "VoiceDial",
"value": 4294971403,
"names": {
"web": [
"VoiceDial"
]
}
},
"TV3DMode": {
"name": "TV3DMode",
"value": 4294971649,
"names": {
"web": [
"TV3DMode"
],
"android": [
"3D_MODE"
]
},
"values": {
"android": [
206
]
}
},
"TVAntennaCable": {
"name": "TVAntennaCable",
"value": 4294971650,
"names": {
"web": [
"TVAntennaCable"
],
"android": [
"TV_ANTENNA_CABLE"
]
},
"values": {
"android": [
242
]
}
},
"TVAudioDescription": {
"name": "TVAudioDescription",
"value": 4294971651,
"names": {
"web": [
"TVAudioDescription"
],
"android": [
"TV_AUDIO_DESCRIPTION"
]
},
"values": {
"android": [
252
]
}
},
"TVAudioDescriptionMixDown": {
"name": "TVAudioDescriptionMixDown",
"value": 4294971652,
"names": {
"web": [
"TVAudioDescriptionMixDown"
],
"android": [
"TV_AUDIO_DESCRIPTION_MIX_DOWN"
]
},
"values": {
"android": [
254
]
}
},
"TVAudioDescriptionMixUp": {
"name": "TVAudioDescriptionMixUp",
"value": 4294971653,
"names": {
"web": [
"TVAudioDescriptionMixUp"
],
"android": [
"TV_AUDIO_DESCRIPTION_MIX_UP"
]
},
"values": {
"android": [
253
]
}
},
"TVContentsMenu": {
"name": "TVContentsMenu",
"value": 4294971654,
"names": {
"web": [
"TVContentsMenu"
],
"android": [
"TV_CONTENTS_MENU"
]
},
"values": {
"android": [
256
]
}
},
"TVDataService": {
"name": "TVDataService",
"value": 4294971655,
"names": {
"web": [
"TVDataService"
],
"android": [
"TV_DATA_SERVICE"
]
},
"values": {
"android": [
230
]
}
},
"TVInputComponent1": {
"name": "TVInputComponent1",
"value": 4294971656,
"names": {
"web": [
"TVInputComponent1"
],
"android": [
"TV_INPUT_COMPONENT_1"
]
},
"values": {
"android": [
249
]
}
},
"TVInputComponent2": {
"name": "TVInputComponent2",
"value": 4294971657,
"names": {
"web": [
"TVInputComponent2"
],
"android": [
"TV_INPUT_COMPONENT_2"
]
},
"values": {
"android": [
250
]
}
},
"TVInputComposite1": {
"name": "TVInputComposite1",
"value": 4294971658,
"names": {
"web": [
"TVInputComposite1"
],
"android": [
"TV_INPUT_COMPOSITE_1"
]
},
"values": {
"android": [
247
]
}
},
"TVInputComposite2": {
"name": "TVInputComposite2",
"value": 4294971659,
"names": {
"web": [
"TVInputComposite2"
],
"android": [
"TV_INPUT_COMPOSITE_2"
]
},
"values": {
"android": [
248
]
}
},
"TVInputHDMI1": {
"name": "TVInputHDMI1",
"value": 4294971660,
"names": {
"web": [
"TVInputHDMI1"
],
"android": [
"TV_INPUT_HDMI_1"
]
},
"values": {
"android": [
243
]
}
},
"TVInputHDMI2": {
"name": "TVInputHDMI2",
"value": 4294971661,
"names": {
"web": [
"TVInputHDMI2"
],
"android": [
"TV_INPUT_HDMI_2"
]
},
"values": {
"android": [
244
]
}
},
"TVInputHDMI3": {
"name": "TVInputHDMI3",
"value": 4294971662,
"names": {
"web": [
"TVInputHDMI3"
],
"android": [
"TV_INPUT_HDMI_3"
]
},
"values": {
"android": [
245
]
}
},
"TVInputHDMI4": {
"name": "TVInputHDMI4",
"value": 4294971663,
"names": {
"web": [
"TVInputHDMI4"
],
"android": [
"TV_INPUT_HDMI_4"
]
},
"values": {
"android": [
246
]
}
},
"TVInputVGA1": {
"name": "TVInputVGA1",
"value": 4294971664,
"names": {
"web": [
"TVInputVGA1"
],
"android": [
"TV_INPUT_VGA_1"
]
},
"values": {
"android": [
251
]
}
},
"TVMediaContext": {
"name": "TVMediaContext",
"value": 4294971665,
"names": {
"web": [
"TVMediaContext"
]
}
},
"TVNetwork": {
"name": "TVNetwork",
"value": 4294971666,
"names": {
"web": [
"TVNetwork"
],
"android": [
"TV_NETWORK"
]
},
"values": {
"android": [
241
]
}
},
"TVNumberEntry": {
"name": "TVNumberEntry",
"value": 4294971667,
"names": {
"web": [
"TVNumberEntry"
],
"android": [
"TV_NUMBER_ENTRY"
]
},
"values": {
"android": [
234
]
}
},
"TVRadioService": {
"name": "TVRadioService",
"value": 4294971668,
"names": {
"web": [
"TVRadioService"
],
"android": [
"TV_RADIO_SERVICE"
]
},
"values": {
"android": [
232
]
}
},
"TVSatellite": {
"name": "TVSatellite",
"value": 4294971669,
"names": {
"web": [
"TVSatellite"
],
"android": [
"TV_SATELLITE"
]
},
"values": {
"android": [
237
]
}
},
"TVSatelliteBS": {
"name": "TVSatelliteBS",
"value": 4294971670,
"names": {
"web": [
"TVSatelliteBS"
],
"android": [
"TV_SATELLITE_BS"
]
},
"values": {
"android": [
238
]
}
},
"TVSatelliteCS": {
"name": "TVSatelliteCS",
"value": 4294971671,
"names": {
"web": [
"TVSatelliteCS"
],
"android": [
"TV_SATELLITE_CS"
]
},
"values": {
"android": [
239
]
}
},
"TVSatelliteToggle": {
"name": "TVSatelliteToggle",
"value": 4294971672,
"names": {
"web": [
"TVSatelliteToggle"
],
"android": [
"TV_SATELLITE_SERVICE"
]
},
"values": {
"android": [
240
]
}
},
"TVTerrestrialAnalog": {
"name": "TVTerrestrialAnalog",
"value": 4294971673,
"names": {
"web": [
"TVTerrestrialAnalog"
],
"android": [
"TV_TERRESTRIAL_ANALOG"
]
},
"values": {
"android": [
235
]
}
},
"TVTerrestrialDigital": {
"name": "TVTerrestrialDigital",
"value": 4294971674,
"names": {
"web": [
"TVTerrestrialDigital"
],
"android": [
"TV_TERRESTRIAL_DIGITAL"
]
},
"values": {
"android": [
236
]
}
},
"TVTimer": {
"name": "TVTimer",
"value": 4294971675,
"names": {
"web": [
"TVTimer"
],
"android": [
"TV_TIMER_PROGRAMMING"
]
},
"values": {
"android": [
258
]
}
},
"Key11": {
"name": "Key11",
"value": 4294971905,
"names": {
"web": [
"Key11"
]
}
},
"Key12": {
"name": "Key12",
"value": 4294971906,
"names": {
"web": [
"Key12"
]
}
},
"Suspend": {
"name": "Suspend",
"value": 8589934592,
"names": {
"gtk": [
"Suspend"
]
},
"values": {
"gtk": [
269025191
],
"fuchsia": [
77309411348
]
}
},
"Resume": {
"name": "Resume",
"value": 8589934593,
"values": {
"fuchsia": [
77309411349
]
}
},
"Sleep": {
"name": "Sleep",
"value": 8589934594,
"names": {
"gtk": [
"Sleep"
],
"windows": [
"SLEEP"
],
"android": [
"SLEEP"
]
},
"values": {
"gtk": [
269025071
],
"windows": [
95
],
"android": [
223
],
"fuchsia": [
77309476994
]
}
},
"Abort": {
"name": "Abort",
"value": 8589934595,
"values": {
"fuchsia": [
77309870235
]
}
},
"Lang1": {
"name": "Lang1",
"value": 8589934608,
"names": {
"macos": [
"Lang1"
],
"ios": [
"Lang1"
],
"windows": [
"KANA, HANGEUL, HANGUL"
]
},
"values": {
"macos": [
104
],
"ios": [
144
],
"windows": [
21
],
"fuchsia": [
77309870224
]
}
},
"Lang2": {
"name": "Lang2",
"value": 8589934609,
"names": {
"macos": [
"Lang2"
],
"ios": [
"Lang2"
]
},
"values": {
"macos": [
102
],
"ios": [
145
],
"fuchsia": [
77309870225
]
}
},
"Lang3": {
"name": "Lang3",
"value": 8589934610,
"names": {
"ios": [
"Lang3"
]
},
"values": {
"ios": [
146
],
"fuchsia": [
77309870226
]
}
},
"Lang4": {
"name": "Lang4",
"value": 8589934611,
"names": {
"ios": [
"Lang4"
]
},
"values": {
"ios": [
147
],
"fuchsia": [
77309870227
]
}
},
"Lang5": {
"name": "Lang5",
"value": 8589934612,
"names": {
"ios": [
"Lang5"
]
},
"values": {
"ios": [
148
],
"fuchsia": [
77309870228
]
}
},
"IntlBackslash": {
"name": "IntlBackslash",
"value": 8589934624,
"values": {
"fuchsia": [
77309870180
]
}
},
"IntlRo": {
"name": "IntlRo",
"value": 8589934625,
"names": {
"macos": [
"IntlRo"
],
"ios": [
"IntlRo"
],
"android": [
"RO"
]
},
"values": {
"macos": [
94
],
"ios": [
135
],
"android": [
217
],
"fuchsia": [
77309870215
]
}
},
"IntlYen": {
"name": "IntlYen",
"value": 8589934626,
"names": {
"macos": [
"IntlYen"
],
"ios": [
"IntlYen"
],
"gtk": [
"yen"
],
"android": [
"YEN"
]
},
"values": {
"macos": [
93
],
"ios": [
137
],
"gtk": [
165
],
"android": [
216
],
"fuchsia": [
77309870217
]
}
},
"ControlLeft": {
"name": "ControlLeft",
"value": 8589934848,
"names": {
"macos": [
"ControlLeft"
],
"ios": [
"ControlLeft"
],
"gtk": [
"Control_L"
],
"windows": [
"CONTROL",
"LCONTROL"
],
"android": [
"CTRL_LEFT"
],
"glfw": [
"LEFT_CONTROL"
]
},
"values": {
"macos": [
59
],
"ios": [
224
],
"gtk": [
65507
],
"windows": [
17,
162
],
"android": [
113
],
"fuchsia": [
77309870304
],
"glfw": [
341
]
}
},
"ControlRight": {
"name": "ControlRight",
"value": 8589934849,
"names": {
"macos": [
"ControlRight"
],
"ios": [
"ControlRight"
],
"gtk": [
"Control_R"
],
"windows": [
"RCONTROL"
],
"android": [
"CTRL_RIGHT"
],
"glfw": [
"RIGHT_CONTROL"
]
},
"values": {
"macos": [
62
],
"ios": [
228
],
"gtk": [
65508
],
"windows": [
163
],
"android": [
114
],
"fuchsia": [
77309870308
],
"glfw": [
345
]
}
},
"ShiftLeft": {
"name": "ShiftLeft",
"value": 8589934850,
"names": {
"macos": [
"ShiftLeft"
],
"ios": [
"ShiftLeft"
],
"gtk": [
"Shift_L"
],
"windows": [
"SHIFT",
"LSHIFT"
],
"android": [
"SHIFT_LEFT"
],
"glfw": [
"LEFT_SHIFT"
]
},
"values": {
"macos": [
56
],
"ios": [
225
],
"gtk": [
65505
],
"windows": [
16,
160
],
"android": [
59
],
"fuchsia": [
77309870305
],
"glfw": [
340
]
}
},
"ShiftRight": {
"name": "ShiftRight",
"value": 8589934851,
"names": {
"macos": [
"ShiftRight"
],
"ios": [
"ShiftRight"
],
"gtk": [
"Shift_R"
],
"windows": [
"RSHIFT"
],
"android": [
"SHIFT_RIGHT"
],
"glfw": [
"RIGHT_SHIFT"
]
},
"values": {
"macos": [
60
],
"ios": [
229
],
"gtk": [
65506
],
"windows": [
161
],
"android": [
60
],
"fuchsia": [
77309870309
],
"glfw": [
344
]
}
},
"AltLeft": {
"name": "AltLeft",
"value": 8589934852,
"names": {
"macos": [
"AltLeft"
],
"ios": [
"AltLeft"
],
"gtk": [
"Alt_L"
],
"windows": [
"LMENU"
],
"android": [
"ALT_LEFT"
],
"glfw": [
"LEFT_ALT"
]
},
"values": {
"macos": [
58
],
"ios": [
226
],
"gtk": [
65513
],
"windows": [
164
],
"android": [
57
],
"fuchsia": [
77309870306
],
"glfw": [
342
]
}
},
"AltRight": {
"name": "AltRight",
"value": 8589934853,
"names": {
"macos": [
"AltRight"
],
"ios": [
"AltRight"
],
"gtk": [
"Alt_R",
"ISO_Level3_Shift"
],
"windows": [
"RMENU"
],
"android": [
"ALT_RIGHT"
],
"glfw": [
"RIGHT_ALT"
]
},
"values": {
"macos": [
61
],
"ios": [
230
],
"gtk": [
65514,
65027
],
"windows": [
165
],
"android": [
58
],
"fuchsia": [
77309870310
],
"glfw": [
346
]
}
},
"MetaLeft": {
"name": "MetaLeft",
"value": 8589934854,
"names": {
"macos": [
"MetaLeft"
],
"ios": [
"MetaLeft"
],
"gtk": [
"Meta_L"
],
"windows": [
"LWIN"
],
"android": [
"META_LEFT"
],
"glfw": [
"LEFT_SUPER"
]
},
"values": {
"macos": [
55
],
"ios": [
227
],
"gtk": [
65511
],
"windows": [
91
],
"android": [
117
],
"fuchsia": [
77309870307
],
"glfw": [
343
]
}
},
"MetaRight": {
"name": "MetaRight",
"value": 8589934855,
"names": {
"macos": [
"MetaRight"
],
"ios": [
"MetaRight"
],
"gtk": [
"Meta_R"
],
"windows": [
"RWIN"
],
"android": [
"META_RIGHT"
],
"glfw": [
"RIGHT_SUPER"
]
},
"values": {
"macos": [
54
],
"ios": [
231
],
"gtk": [
65512
],
"windows": [
92
],
"android": [
118
],
"fuchsia": [
77309870311
],
"glfw": [
347
]
}
},
"Control": {
"name": "Control",
"value": 8589935088
},
"Shift": {
"name": "Shift",
"value": 8589935090
},
"Alt": {
"name": "Alt",
"value": 8589935092
},
"Meta": {
"name": "Meta",
"value": 8589935094
},
"NumpadEnter": {
"name": "NumpadEnter",
"value": 8589935117,
"names": {
"macos": [
"NumpadEnter"
],
"ios": [
"NumpadEnter"
],
"gtk": [
"KP_Enter"
],
"android": [
"NUMPAD_ENTER"
],
"glfw": [
"KP_ENTER"
]
},
"values": {
"macos": [
76
],
"ios": [
88
],
"gtk": [
65421
],
"android": [
160
],
"fuchsia": [
77309870168
],
"glfw": [
335
]
}
},
"NumpadParenLeft": {
"name": "NumpadParenLeft",
"value": 8589935144,
"names": {
"android": [
"NUMPAD_LEFT_PAREN"
]
},
"values": {
"android": [
162
],
"fuchsia": [
77309870262
]
}
},
"NumpadParenRight": {
"name": "NumpadParenRight",
"value": 8589935145,
"names": {
"android": [
"NUMPAD_RIGHT_PAREN"
]
},
"values": {
"android": [
163
],
"fuchsia": [
77309870263
]
}
},
"NumpadMultiply": {
"name": "NumpadMultiply",
"value": 8589935146,
"names": {
"macos": [
"NumpadMultiply"
],
"ios": [
"NumpadMultiply"
],
"gtk": [
"KP_Multiply"
],
"windows": [
"MULTIPLY"
],
"android": [
"NUMPAD_MULTIPLY"
],
"glfw": [
"KP_MULTIPLY"
]
},
"values": {
"macos": [
67
],
"ios": [
85
],
"gtk": [
65450
],
"windows": [
106
],
"android": [
155
],
"fuchsia": [
77309870165
],
"glfw": [
332
]
}
},
"NumpadAdd": {
"name": "NumpadAdd",
"value": 8589935147,
"names": {
"macos": [
"NumpadAdd"
],
"ios": [
"NumpadAdd"
],
"gtk": [
"KP_Add"
],
"windows": [
"ADD"
],
"android": [
"NUMPAD_ADD"
],
"glfw": [
"KP_ADD"
]
},
"values": {
"macos": [
69
],
"ios": [
87
],
"gtk": [
65451
],
"windows": [
107
],
"android": [
157
],
"fuchsia": [
77309870167
],
"glfw": [
334
]
}
},
"NumpadComma": {
"name": "NumpadComma",
"value": 8589935148,
"names": {
"macos": [
"NumpadComma"
],
"ios": [
"NumpadComma"
],
"windows": [
"SEPARATOR"
],
"android": [
"NUMPAD_COMMA"
]
},
"values": {
"macos": [
95
],
"ios": [
133
],
"windows": [
108
],
"android": [
159
],
"fuchsia": [
77309870213
]
}
},
"NumpadSubtract": {
"name": "NumpadSubtract",
"value": 8589935149,
"names": {
"macos": [
"NumpadSubtract"
],
"ios": [
"NumpadSubtract"
],
"gtk": [
"KP_Subtract"
],
"windows": [
"SUBTRACT"
],
"android": [
"NUMPAD_SUBTRACT"
]
},
"values": {
"macos": [
78
],
"ios": [
86
],
"gtk": [
65453
],
"windows": [
109
],
"android": [
156
],
"fuchsia": [
77309870166
]
}
},
"NumpadDecimal": {
"name": "NumpadDecimal",
"value": 8589935150,
"names": {
"macos": [
"NumpadDecimal"
],
"ios": [
"NumpadDecimal"
],
"gtk": [
"KP_Delete"
],
"windows": [
"DECIMAL"
],
"android": [
"NUMPAD_DOT"
],
"glfw": [
"KP_DECIMAL"
]
},
"values": {
"macos": [
65
],
"ios": [
99
],
"gtk": [
65439
],
"windows": [
110
],
"android": [
158
],
"fuchsia": [
77309870179
],
"glfw": [
330
]
}
},
"NumpadDivide": {
"name": "NumpadDivide",
"value": 8589935151,
"names": {
"macos": [
"NumpadDivide"
],
"ios": [
"NumpadDivide"
],
"gtk": [
"KP_Divide"
],
"windows": [
"DIVIDE"
],
"android": [
"NUMPAD_DIVIDE"
],
"glfw": [
"KP_DIVIDE"
]
},
"values": {
"macos": [
75
],
"ios": [
84
],
"gtk": [
65455
],
"windows": [
111
],
"android": [
154
],
"fuchsia": [
77309870164
],
"glfw": [
331
]
}
},
"Numpad0": {
"name": "Numpad0",
"value": 8589935152,
"names": {
"macos": [
"Numpad0"
],
"ios": [
"Numpad0"
],
"gtk": [
"KP_Insert",
"KP_0"
],
"windows": [
"NUMPAD0"
],
"android": [
"NUMPAD_0"
],
"glfw": [
"KP_0"
]
},
"values": {
"macos": [
82
],
"ios": [
98
],
"gtk": [
65438,
65456
],
"windows": [
96
],
"android": [
144
],
"fuchsia": [
77309870178
],
"glfw": [
320
]
}
},
"Numpad1": {
"name": "Numpad1",
"value": 8589935153,
"names": {
"macos": [
"Numpad1"
],
"ios": [
"Numpad1"
],
"gtk": [
"KP_End",
"KP_1"
],
"windows": [
"NUMPAD1"
],
"android": [
"NUMPAD_1"
],
"glfw": [
"KP_1"
]
},
"values": {
"macos": [
83
],
"ios": [
89
],
"gtk": [
65436,
65457
],
"windows": [
97
],
"android": [
145
],
"fuchsia": [
77309870169
],
"glfw": [
321
]
}
},
"Numpad2": {
"name": "Numpad2",
"value": 8589935154,
"names": {
"macos": [
"Numpad2"
],
"ios": [
"Numpad2"
],
"gtk": [
"KP_Down",
"KP_2"
],
"windows": [
"NUMPAD2"
],
"android": [
"NUMPAD_2"
],
"glfw": [
"KP_2"
]
},
"values": {
"macos": [
84
],
"ios": [
90
],
"gtk": [
65433,
65458
],
"windows": [
98
],
"android": [
146
],
"fuchsia": [
77309870170
],
"glfw": [
322
]
}
},
"Numpad3": {
"name": "Numpad3",
"value": 8589935155,
"names": {
"macos": [
"Numpad3"
],
"ios": [
"Numpad3"
],
"gtk": [
"KP_Page_Down",
"KP_3"
],
"windows": [
"NUMPAD3"
],
"android": [
"NUMPAD_3"
],
"glfw": [
"KP_3"
]
},
"values": {
"macos": [
85
],
"ios": [
91
],
"gtk": [
65435,
65459
],
"windows": [
99
],
"android": [
147
],
"fuchsia": [
77309870171
],
"glfw": [
323
]
}
},
"Numpad4": {
"name": "Numpad4",
"value": 8589935156,
"names": {
"macos": [
"Numpad4"
],
"ios": [
"Numpad4"
],
"gtk": [
"KP_Left",
"KP_4"
],
"windows": [
"NUMPAD4"
],
"android": [
"NUMPAD_4"
],
"glfw": [
"KP_4"
]
},
"values": {
"macos": [
86
],
"ios": [
92
],
"gtk": [
65430,
65460
],
"windows": [
100
],
"android": [
148
],
"fuchsia": [
77309870172
],
"glfw": [
324
]
}
},
"Numpad5": {
"name": "Numpad5",
"value": 8589935157,
"names": {
"macos": [
"Numpad5"
],
"ios": [
"Numpad5"
],
"gtk": [
"KP_5"
],
"windows": [
"NUMPAD5"
],
"android": [
"NUMPAD_5"
],
"glfw": [
"KP_5"
]
},
"values": {
"macos": [
87
],
"ios": [
93
],
"gtk": [
65461
],
"windows": [
101
],
"android": [
149
],
"fuchsia": [
77309870173
],
"glfw": [
325
]
}
},
"Numpad6": {
"name": "Numpad6",
"value": 8589935158,
"names": {
"macos": [
"Numpad6"
],
"ios": [
"Numpad6"
],
"gtk": [
"KP_Right",
"KP_6"
],
"windows": [
"NUMPAD6"
],
"android": [
"NUMPAD_6"
],
"glfw": [
"KP_6"
]
},
"values": {
"macos": [
88
],
"ios": [
94
],
"gtk": [
65432,
65462
],
"windows": [
102
],
"android": [
150
],
"fuchsia": [
77309870174
],
"glfw": [
326
]
}
},
"Numpad7": {
"name": "Numpad7",
"value": 8589935159,
"names": {
"macos": [
"Numpad7"
],
"ios": [
"Numpad7"
],
"gtk": [
"KP_Home",
"KP_7"
],
"windows": [
"NUMPAD7"
],
"android": [
"NUMPAD_7"
],
"glfw": [
"KP_7"
]
},
"values": {
"macos": [
89
],
"ios": [
95
],
"gtk": [
65429,
65463
],
"windows": [
103
],
"android": [
151
],
"fuchsia": [
77309870175
],
"glfw": [
327
]
}
},
"Numpad8": {
"name": "Numpad8",
"value": 8589935160,
"names": {
"macos": [
"Numpad8"
],
"ios": [
"Numpad8"
],
"gtk": [
"KP_Up",
"KP_8"
],
"windows": [
"NUMPAD8"
],
"android": [
"NUMPAD_8"
],
"glfw": [
"KP_8"
]
},
"values": {
"macos": [
91
],
"ios": [
96
],
"gtk": [
65431,
65464
],
"windows": [
104
],
"android": [
152
],
"fuchsia": [
77309870176
],
"glfw": [
328
]
}
},
"Numpad9": {
"name": "Numpad9",
"value": 8589935161,
"names": {
"macos": [
"Numpad9"
],
"ios": [
"Numpad9"
],
"gtk": [
"KP_Page_Up",
"KP_9"
],
"windows": [
"NUMPAD9"
],
"android": [
"NUMPAD_9"
],
"glfw": [
"KP_9"
]
},
"values": {
"macos": [
92
],
"ios": [
97
],
"gtk": [
65434,
65465
],
"windows": [
105
],
"android": [
153
],
"fuchsia": [
77309870177
],
"glfw": [
329
]
}
},
"NumpadEqual": {
"name": "NumpadEqual",
"value": 8589935165,
"names": {
"macos": [
"NumpadEqual"
],
"ios": [
"NumpadEqual"
],
"gtk": [
"KP_Equal"
],
"windows": [
"OEM_NEC_EQUAL"
],
"android": [
"NUMPAD_EQUALS"
],
"glfw": [
"KP_EQUAL"
]
},
"values": {
"macos": [
81
],
"ios": [
103
],
"gtk": [
65469
],
"windows": [
146
],
"android": [
161
],
"fuchsia": [
77309870183
],
"glfw": [
336
]
}
},
"GameButton1": {
"name": "GameButton1",
"value": 8589935361,
"names": {
"android": [
"BUTTON_1"
]
},
"values": {
"android": [
188
],
"fuchsia": [
77309804289
]
}
},
"GameButton2": {
"name": "GameButton2",
"value": 8589935362,
"names": {
"android": [
"BUTTON_2"
]
},
"values": {
"android": [
189
],
"fuchsia": [
77309804290
]
}
},
"GameButton3": {
"name": "GameButton3",
"value": 8589935363,
"names": {
"android": [
"BUTTON_3"
]
},
"values": {
"android": [
190
],
"fuchsia": [
77309804291
]
}
},
"GameButton4": {
"name": "GameButton4",
"value": 8589935364,
"names": {
"android": [
"BUTTON_4"
]
},
"values": {
"android": [
191
],
"fuchsia": [
77309804292
]
}
},
"GameButton5": {
"name": "GameButton5",
"value": 8589935365,
"names": {
"android": [
"BUTTON_5"
]
},
"values": {
"android": [
192
],
"fuchsia": [
77309804293
]
}
},
"GameButton6": {
"name": "GameButton6",
"value": 8589935366,
"names": {
"android": [
"BUTTON_6"
]
},
"values": {
"android": [
193
],
"fuchsia": [
77309804294
]
}
},
"GameButton7": {
"name": "GameButton7",
"value": 8589935367,
"names": {
"android": [
"BUTTON_7"
]
},
"values": {
"android": [
194
],
"fuchsia": [
77309804295
]
}
},
"GameButton8": {
"name": "GameButton8",
"value": 8589935368,
"names": {
"windows": [
"GAMEPAD_A"
],
"android": [
"BUTTON_8"
]
},
"values": {
"windows": [
195
],
"android": [
195
],
"fuchsia": [
77309804296
]
}
},
"GameButton9": {
"name": "GameButton9",
"value": 8589935369,
"names": {
"windows": [
"GAMEPAD_B"
],
"android": [
"BUTTON_9"
]
},
"values": {
"windows": [
196
],
"android": [
196
],
"fuchsia": [
77309804297
]
}
},
"GameButton10": {
"name": "GameButton10",
"value": 8589935370,
"names": {
"windows": [
"GAMEPAD_X"
],
"android": [
"BUTTON_10"
]
},
"values": {
"windows": [
197
],
"android": [
197
],
"fuchsia": [
77309804298
]
}
},
"GameButton11": {
"name": "GameButton11",
"value": 8589935371,
"names": {
"windows": [
"GAMEPAD_Y"
],
"android": [
"BUTTON_11"
]
},
"values": {
"windows": [
198
],
"android": [
198
],
"fuchsia": [
77309804299
]
}
},
"GameButton12": {
"name": "GameButton12",
"value": 8589935372,
"names": {
"windows": [
"GAMEPAD_RIGHT_SHOULDER"
],
"android": [
"BUTTON_12"
]
},
"values": {
"windows": [
199
],
"android": [
199
],
"fuchsia": [
77309804300
]
}
},
"GameButton13": {
"name": "GameButton13",
"value": 8589935373,
"names": {
"windows": [
"GAMEPAD_LEFT_SHOULDER"
],
"android": [
"BUTTON_13"
]
},
"values": {
"windows": [
200
],
"android": [
200
],
"fuchsia": [
77309804301
]
}
},
"GameButton14": {
"name": "GameButton14",
"value": 8589935374,
"names": {
"windows": [
"GAMEPAD_LEFT_TRIGGER"
],
"android": [
"BUTTON_14"
]
},
"values": {
"windows": [
201
],
"android": [
201
],
"fuchsia": [
77309804302
]
}
},
"GameButton15": {
"name": "GameButton15",
"value": 8589935375,
"names": {
"windows": [
"GAMEPAD_RIGHT_TRIGGER"
],
"android": [
"BUTTON_15"
]
},
"values": {
"windows": [
202
],
"android": [
202
],
"fuchsia": [
77309804303
]
}
},
"GameButton16": {
"name": "GameButton16",
"value": 8589935376,
"names": {
"windows": [
"GAMEPAD_DPAD_UP"
],
"android": [
"BUTTON_16"
]
},
"values": {
"windows": [
203
],
"android": [
203
],
"fuchsia": [
77309804304
]
}
},
"GameButtonA": {
"name": "GameButtonA",
"value": 8589935377,
"names": {
"android": [
"BUTTON_A"
]
},
"values": {
"android": [
96
],
"fuchsia": [
77309804305
]
}
},
"GameButtonB": {
"name": "GameButtonB",
"value": 8589935378,
"names": {
"android": [
"BUTTON_B"
]
},
"values": {
"android": [
97
],
"fuchsia": [
77309804306
]
}
},
"GameButtonC": {
"name": "GameButtonC",
"value": 8589935379,
"names": {
"android": [
"BUTTON_C"
]
},
"values": {
"android": [
98
],
"fuchsia": [
77309804307
]
}
},
"GameButtonLeft1": {
"name": "GameButtonLeft1",
"value": 8589935380,
"names": {
"android": [
"BUTTON_L1"
]
},
"values": {
"android": [
102
],
"fuchsia": [
77309804308
]
}
},
"GameButtonLeft2": {
"name": "GameButtonLeft2",
"value": 8589935381,
"names": {
"android": [
"BUTTON_L2"
]
},
"values": {
"android": [
104
],
"fuchsia": [
77309804309
]
}
},
"GameButtonMode": {
"name": "GameButtonMode",
"value": 8589935382,
"names": {
"android": [
"BUTTON_MODE"
]
},
"values": {
"android": [
110
],
"fuchsia": [
77309804310
]
}
},
"GameButtonRight1": {
"name": "GameButtonRight1",
"value": 8589935383,
"names": {
"android": [
"BUTTON_R1"
]
},
"values": {
"android": [
103
],
"fuchsia": [
77309804311
]
}
},
"GameButtonRight2": {
"name": "GameButtonRight2",
"value": 8589935384,
"names": {
"android": [
"BUTTON_R2"
]
},
"values": {
"android": [
105
],
"fuchsia": [
77309804312
]
}
},
"GameButtonSelect": {
"name": "GameButtonSelect",
"value": 8589935385,
"names": {
"android": [
"BUTTON_SELECT"
]
},
"values": {
"android": [
109
],
"fuchsia": [
77309804313
]
}
},
"GameButtonStart": {
"name": "GameButtonStart",
"value": 8589935386,
"names": {
"android": [
"BUTTON_START"
]
},
"values": {
"android": [
108
],
"fuchsia": [
77309804314
]
}
},
"GameButtonThumbLeft": {
"name": "GameButtonThumbLeft",
"value": 8589935387,
"names": {
"android": [
"BUTTON_THUMBL"
]
},
"values": {
"android": [
106
],
"fuchsia": [
77309804315
]
}
},
"GameButtonThumbRight": {
"name": "GameButtonThumbRight",
"value": 8589935388,
"names": {
"android": [
"BUTTON_THUMBR"
]
},
"values": {
"android": [
107
],
"fuchsia": [
77309804316
]
}
},
"GameButtonX": {
"name": "GameButtonX",
"value": 8589935389,
"names": {
"android": [
"BUTTON_X"
]
},
"values": {
"android": [
99
],
"fuchsia": [
77309804317
]
}
},
"GameButtonY": {
"name": "GameButtonY",
"value": 8589935390,
"names": {
"android": [
"BUTTON_Y"
]
},
"values": {
"android": [
100
],
"fuchsia": [
77309804318
]
}
},
"GameButtonZ": {
"name": "GameButtonZ",
"value": 8589935391,
"names": {
"android": [
"BUTTON_Z"
]
},
"values": {
"android": [
101
],
"fuchsia": [
77309804319
]
}
}
}
| flutter/dev/tools/gen_keycodes/data/logical_key_data.g.json/0 | {
"file_path": "flutter/dev/tools/gen_keycodes/data/logical_key_data.g.json",
"repo_id": "flutter",
"token_count": 88126
} | 549 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// Maps iOS's special key labels to logical key names.
///
/// See https://developer.apple.com/documentation/uikit/uikeycommand/input_strings_for_special_keys?language=objc
const Map<String, String> kIosSpecialKeyMapping = <String, String>{
'UIKeyInputEscape': 'Escape',
'UIKeyInputF1': 'F1',
'UIKeyInputF2': 'F2',
'UIKeyInputF3': 'F3',
'UIKeyInputF4': 'F4',
'UIKeyInputF5': 'F5',
'UIKeyInputF6': 'F6',
'UIKeyInputF7': 'F7',
'UIKeyInputF8': 'F8',
'UIKeyInputF9': 'F9',
'UIKeyInputF10': 'F10',
'UIKeyInputF11': 'F11',
'UIKeyInputF12': 'F12',
'UIKeyInputUpArrow': 'ArrowUp',
'UIKeyInputDownArrow': 'ArrowDown',
'UIKeyInputLeftArrow': 'ArrowLeft',
'UIKeyInputRightArrow': 'ArrowRight',
'UIKeyInputHome': 'Home',
'UIKeyInputEnd': 'Enter',
'UIKeyInputPageUp': 'PageUp',
'UIKeyInputPageDown': 'PageDown',
};
| flutter/dev/tools/gen_keycodes/lib/data.dart/0 | {
"file_path": "flutter/dev/tools/gen_keycodes/lib/data.dart",
"repo_id": "flutter",
"token_count": 396
} | 550 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:path/path.dart' as path;
import '../localizations_utils.dart';
const String _kCommandName = 'gen_date_localizations.dart';
// Used to let _jsonToMap know what locale it's date symbols converting for.
// Date symbols for the Kannada locale ('kn') are handled specially because
// some of the strings contain characters that can crash Emacs on Linux.
// See packages/flutter_localizations/lib/src/l10n/README for more information.
String? currentLocale;
/// This program extracts localized date symbols and patterns from the intl
/// package for the subset of locales supported by the flutter_localizations
/// package.
///
/// The extracted data is written into:
/// packages/flutter_localizations/lib/src/l10n/generated_date_localizations.dart
///
/// ## Usage
///
/// Run this program from the root of the git repository.
///
/// The following outputs the generated Dart code to the console as a dry run:
///
/// ```
/// dart dev/tools/localization/bin/gen_date_localizations.dart
/// ```
///
/// If the data looks good, use the `--overwrite` option to overwrite the
/// lib/src/l10n/date_localizations.dart file:
///
/// ```
/// dart dev/tools/localization/bin/gen_date_localizations.dart --overwrite
/// ```
Future<void> main(List<String> rawArgs) async {
checkCwdIsRepoRoot(_kCommandName);
final bool writeToFile = parseArgs(rawArgs).writeToFile;
final File packageConfigFile = File(path.join('packages', 'flutter_localizations', '.dart_tool', 'package_config.json'));
final bool packageConfigExists = packageConfigFile.existsSync();
if (!packageConfigExists) {
exitWithError(
'File not found: ${packageConfigFile.path}. $_kCommandName must be run '
'after a successful "flutter update-packages".'
);
}
final List<Object?> packages = (
json.decode(packageConfigFile.readAsStringSync()) as Map<String, Object?>
)['packages']! as List<Object?>;
String? pathToIntl;
for (final Object? package in packages) {
final Map<String, Object?> packageAsMap = package! as Map<String, Object?>;
if (packageAsMap['name'] == 'intl') {
pathToIntl = Uri.parse(packageAsMap['rootUri']! as String).toFilePath();
break;
}
}
if (pathToIntl == null) {
exitWithError(
'Could not find "intl" package. $_kCommandName must be run '
'after a successful "flutter update-packages".'
);
}
final Directory dateSymbolsDirectory = Directory(path.join(pathToIntl!, 'lib', 'src', 'data', 'dates', 'symbols'));
final Map<String, File> symbolFiles = _listIntlData(dateSymbolsDirectory);
final Directory datePatternsDirectory = Directory(path.join(pathToIntl, 'lib', 'src', 'data', 'dates', 'patterns'));
final Map<String, File> patternFiles = _listIntlData(datePatternsDirectory);
final StringBuffer buffer = StringBuffer();
final Set<String> supportedLocales = _supportedLocales();
buffer.writeln(
'''
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file has been automatically generated. Please do not edit it manually.
// To regenerate run (omit --overwrite to print to console instead of the file):
// dart --enable-asserts dev/tools/localization/bin/gen_date_localizations.dart --overwrite
import 'package:intl/date_symbols.dart' as intl;
'''
);
buffer.writeln('''
/// The subset of date symbols supported by the intl package which are also
/// supported by flutter_localizations.''');
buffer.writeln('final Map<String, intl.DateSymbols> dateSymbols = <String, intl.DateSymbols> {');
symbolFiles.forEach((String locale, File data) {
currentLocale = locale;
if (supportedLocales.contains(locale)) {
final Map<String, Object?> objData = json.decode(data.readAsStringSync()) as Map<String, Object?>;
buffer.writeln("'$locale': intl.DateSymbols(");
objData.forEach((String key, Object? value) {
if (value == null) {
return;
}
buffer.writeln(_jsonToConstructorEntry(key, value));
});
buffer.writeln('),');
}
});
currentLocale = null;
buffer.writeln('};');
// Code that uses datePatterns expects it to contain values of type
// Map<String, String> not Map<String, dynamic>.
buffer.writeln('''
/// The subset of date patterns supported by the intl package which are also
/// supported by flutter_localizations.''');
buffer.writeln('const Map<String, Map<String, String>> datePatterns = <String, Map<String, String>> {');
patternFiles.forEach((String locale, File data) {
if (supportedLocales.contains(locale)) {
final Map<String, dynamic> patterns = json.decode(data.readAsStringSync()) as Map<String, dynamic>;
buffer.writeln("'$locale': <String, String>{");
patterns.forEach((String key, dynamic value) {
assert(value is String);
buffer.writeln(_jsonToMapEntry(key, value));
});
buffer.writeln('},');
}
});
buffer.writeln('};');
if (writeToFile) {
final File dateLocalizationsFile = File(path.join('packages', 'flutter_localizations', 'lib', 'src', 'l10n', 'generated_date_localizations.dart'));
dateLocalizationsFile.writeAsStringSync(buffer.toString());
final String extension = Platform.isWindows ? '.exe' : '';
final ProcessResult result = Process.runSync(path.join('bin', 'cache', 'dart-sdk', 'bin', 'dart$extension'), <String>[
'format',
dateLocalizationsFile.path,
]);
if (result.exitCode != 0) {
print(result.exitCode);
print(result.stdout);
print(result.stderr);
}
} else {
print(buffer);
}
}
String _jsonToConstructorEntry(String key, dynamic value) {
return '$key: ${_jsonToObject(value)},';
}
String _jsonToMapEntry(String key, dynamic value) {
return "'$key': ${_jsonToMap(value)},";
}
String _jsonToObject(dynamic json) {
if (json == null || json is num || json is bool) {
return '$json';
}
if (json is String) {
return generateEncodedString(currentLocale, json);
}
if (json is Iterable<Object?>) {
final String type = json.first.runtimeType.toString();
final StringBuffer buffer = StringBuffer('const <$type>[');
for (final dynamic value in json) {
buffer.writeln('${_jsonToMap(value)},');
}
buffer.write(']');
return buffer.toString();
}
if (json is Map<String, dynamic>) {
final StringBuffer buffer = StringBuffer('<String, Object>{');
json.forEach((String key, dynamic value) {
buffer.writeln(_jsonToMapEntry(key, value));
});
buffer.write('}');
return buffer.toString();
}
throw 'Unsupported JSON type ${json.runtimeType} of value $json.';
}
String _jsonToMap(dynamic json) {
if (json == null || json is num || json is bool) {
return '$json';
}
if (json is String) {
return generateEncodedString(currentLocale, json);
}
if (json is Iterable) {
final StringBuffer buffer = StringBuffer('<String>[');
for (final dynamic value in json) {
buffer.writeln('${_jsonToMap(value)},');
}
buffer.write(']');
return buffer.toString();
}
if (json is Map<String, dynamic>) {
final StringBuffer buffer = StringBuffer('<String, Object>{');
json.forEach((String key, dynamic value) {
buffer.writeln(_jsonToMapEntry(key, value));
});
buffer.write('}');
return buffer.toString();
}
throw 'Unsupported JSON type ${json.runtimeType} of value $json.';
}
Set<String> _supportedLocales() {
// Assumes that en_US is a supported locale by default. Without this, usage
// of the intl package APIs before Flutter populates its set of supported i18n
// date patterns and symbols may cause problems.
//
// For more context, see https://github.com/flutter/flutter/issues/67644.
final Set<String> supportedLocales = <String>{
'en_US',
};
final RegExp filenameRE = RegExp(r'(?:material|cupertino)_(\w+)\.arb$');
final Directory supportedLocalesDirectory = Directory(path.join('packages', 'flutter_localizations', 'lib', 'src', 'l10n'));
for (final FileSystemEntity entity in supportedLocalesDirectory.listSync()) {
final String filePath = entity.path;
if (FileSystemEntity.isFileSync(filePath) && filenameRE.hasMatch(filePath)) {
supportedLocales.add(filenameRE.firstMatch(filePath)![1]!);
}
}
return supportedLocales;
}
Map<String, File> _listIntlData(Directory directory) {
final Map<String, File> localeFiles = <String, File>{};
final Iterable<File> files = directory
.listSync()
.whereType<File>()
.where((File file) => file.path.endsWith('.json'));
for (final File file in files) {
final String locale = path.basenameWithoutExtension(file.path);
localeFiles[locale] = file;
}
final List<String> locales = localeFiles.keys.toList(growable: false);
locales.sort();
return Map<String, File>.fromIterable(locales, value: (dynamic locale) => localeFiles[locale]!);
}
| flutter/dev/tools/localization/bin/gen_date_localizations.dart/0 | {
"file_path": "flutter/dev/tools/localization/bin/gen_date_localizations.dart",
"repo_id": "flutter",
"token_count": 3090
} | 551 |
<svg id="svg_build_00" xmlns="http://www.w3.org/2000/svg" width="48px" height="48px" >
<path id="path_1" d="M 1.0 !!!" fill="#000000" />
</svg>
| flutter/dev/tools/vitool/test_assets/illegal_path.svg/0 | {
"file_path": "flutter/dev/tools/vitool/test_assets/illegal_path.svg",
"repo_id": "flutter",
"token_count": 68
} | 552 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/scheduler.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'common.dart';
void main() {
ZoneIgnoringTestBinding.ensureInitialized();
initTimelineTests();
test('Widgets with updated keys produce well formed timelines', () async {
await runFrame(() { runApp(const TestRoot()); });
await SchedulerBinding.instance.endOfFrame;
debugProfileBuildsEnabled = true;
await runFrame(() {
TestRoot.state.updateKey();
});
int buildCount = 0;
for (final TimelineEvent event in await fetchTimelineEvents()) {
if (event.json!['name'] == 'BUILD') {
final String ph = event.json!['ph'] as String;
if (ph == 'B') {
buildCount++;
} else if (ph == 'E') {
buildCount--;
}
}
}
expect(buildCount, 0);
debugProfileBuildsEnabled = false;
}, skip: isBrowser); // [intended] uses dart:isolate and io.
}
class TestRoot extends StatefulWidget {
const TestRoot({super.key});
static late TestRootState state;
@override
State<TestRoot> createState() => TestRootState();
}
class TestRootState extends State<TestRoot> {
final Key _globalKey = GlobalKey();
Key _localKey = UniqueKey();
@override
void initState() {
super.initState();
TestRoot.state = this;
}
void updateKey() {
setState(() {
_localKey = UniqueKey();
});
}
@override
Widget build(BuildContext context) {
return Center(
key: _localKey,
child: SizedBox(
key: _globalKey,
width: 100,
height: 100,
),
);
}
}
| flutter/dev/tracing_tests/test/inflate_widget_update_test.dart/0 | {
"file_path": "flutter/dev/tracing_tests/test/inflate_widget_update_test.dart",
"repo_id": "flutter",
"token_count": 676
} | 553 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.