text
stringlengths 6
13.6M
| id
stringlengths 13
176
| metadata
dict | __index_level_0__
int64 0
1.69k
|
---|---|---|---|
// 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.
part of 'reporting.dart';
class DisabledUsage implements Usage {
@override
bool get suppressAnalytics => true;
@override
set suppressAnalytics(bool value) { }
@override
bool get enabled => false;
@override
set enabled(bool value) { }
@override
String get clientId => '';
@override
void sendCommand(String command, { CustomDimensions? parameters }) { }
@override
void sendEvent(
String category,
String parameter, {
String? label,
int? value,
CustomDimensions? parameters,
}) { }
@override
void sendTiming(String category, String variableName, Duration duration, { String? label }) { }
@override
void sendException(dynamic exception) { }
@override
Stream<Map<String, dynamic>> get onSend => const Stream<Map<String, dynamic>>.empty();
@override
Future<void> ensureAnalyticsSent() => Future<void>.value();
@override
void printWelcome() { }
}
| flutter/packages/flutter_tools/lib/src/reporting/disabled_usage.dart/0 | {
"file_path": "flutter/packages/flutter_tools/lib/src/reporting/disabled_usage.dart",
"repo_id": "flutter",
"token_count": 328
} | 786 |
// 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';
import 'package:package_config/package_config.dart';
import 'package:package_config/package_config_types.dart';
import 'base/common.dart';
import 'base/context.dart';
import 'base/file_system.dart';
import 'base/logger.dart';
import 'base/template.dart';
import 'cache.dart';
import 'dart/package_map.dart';
/// The Kotlin keywords which are not Java keywords.
/// They are escaped in Kotlin files.
///
/// https://kotlinlang.org/docs/keyword-reference.html
const List<String> kReservedKotlinKeywords = <String>['when', 'in', 'is'];
/// Provides the path where templates used by flutter_tools are stored.
class TemplatePathProvider {
const TemplatePathProvider();
/// Returns the directory containing the 'name' template directory.
Directory directoryInPackage(String name, FileSystem fileSystem) {
final String templatesDir = fileSystem.path.join(Cache.flutterRoot!,
'packages', 'flutter_tools', 'templates');
return fileSystem.directory(fileSystem.path.join(templatesDir, name));
}
/// Returns the directory containing the 'name' template directory in
/// flutter_template_images, to resolve image placeholder against.
/// if 'name' is null, return the parent template directory.
Future<Directory> imageDirectory(String? name, FileSystem fileSystem, Logger logger) async {
final String toolPackagePath = fileSystem.path.join(
Cache.flutterRoot!, 'packages', 'flutter_tools');
final String packageFilePath = fileSystem.path.join(toolPackagePath, '.dart_tool', 'package_config.json');
final PackageConfig packageConfig = await loadPackageConfigWithLogging(
fileSystem.file(packageFilePath),
logger: logger,
);
final Uri? imagePackageLibDir = packageConfig['flutter_template_images']?.packageUriRoot;
final Directory templateDirectory = fileSystem.directory(imagePackageLibDir)
.parent
.childDirectory('templates');
return name == null ? templateDirectory : templateDirectory.childDirectory(name);
}
}
TemplatePathProvider get templatePathProvider => context.get<TemplatePathProvider>() ?? const TemplatePathProvider();
/// Expands templates in a directory to a destination. All files that must
/// undergo template expansion should end with the '.tmpl' extension. All files
/// that should be replaced with the corresponding image from
/// flutter_template_images should end with the '.img.tmpl' extension. All other
/// files are ignored. In case the contents of entire directories must be copied
/// as is, the directory itself can end with '.tmpl' extension. Files within
/// such a directory may also contain the '.tmpl' or '.img.tmpl' extensions and
/// will be considered for expansion. In case certain files need to be copied
/// but without template expansion (data files, etc.), the '.copy.tmpl'
/// extension may be used. Furthermore, templates may contain additional
/// test files intended to run on the CI. Test files must end in `.test.tmpl`
/// and are only included when the --implementation-tests flag is enabled.
///
/// Folders with platform/language-specific content must be named
/// '<platform>-<language>.tmpl'.
///
/// Files in the destination will contain none of the '.tmpl', '.copy.tmpl',
/// 'img.tmpl', or '-<language>.tmpl' extensions.
class Template {
factory Template(Directory templateSource, Directory? imageSourceDir, {
required FileSystem fileSystem,
required Logger logger,
required TemplateRenderer templateRenderer,
Set<Uri>? templateManifest,
}) {
return Template._(
<Directory>[templateSource],
imageSourceDir != null ? <Directory>[imageSourceDir] : <Directory>[],
fileSystem: fileSystem,
logger: logger,
templateRenderer: templateRenderer,
templateManifest: templateManifest,
);
}
Template._(
List<Directory> templateSources, this.imageSourceDirectories, {
required FileSystem fileSystem,
required Logger logger,
required TemplateRenderer templateRenderer,
required Set<Uri>? templateManifest,
}) : _fileSystem = fileSystem,
_logger = logger,
_templateRenderer = templateRenderer,
_templateManifest = templateManifest ?? <Uri>{} {
for (final Directory sourceDirectory in templateSources) {
if (!sourceDirectory.existsSync()) {
throwToolExit('Template source directory does not exist: ${sourceDirectory.absolute.path}');
}
}
final Map<FileSystemEntity, Directory> templateFiles = <FileSystemEntity, Directory>{
for (final Directory sourceDirectory in templateSources)
for (final FileSystemEntity entity in sourceDirectory.listSync(recursive: true))
entity: sourceDirectory,
};
for (final FileSystemEntity entity in templateFiles.keys.whereType<File>()) {
if (_templateManifest.isNotEmpty && !_templateManifest.contains(Uri.file(entity.absolute.path))) {
_logger.printTrace('Skipping ${entity.absolute.path}, missing from the template manifest.');
// Skip stale files in the flutter_tools directory.
continue;
}
final String relativePath = fileSystem.path.relative(entity.path,
from: templateFiles[entity]!.absolute.path);
if (relativePath.contains(templateExtension)) {
// If '.tmpl' appears anywhere within the path of this entity, it is
// a candidate for rendering. This catches cases where the folder
// itself is a template.
_templateFilePaths[relativePath] = fileSystem.path.absolute(entity.path);
}
}
}
static Future<Template> fromName(String name, {
required FileSystem fileSystem,
required Set<Uri>? templateManifest,
required Logger logger,
required TemplateRenderer templateRenderer,
}) async {
// All named templates are placed in the 'templates' directory
final Directory templateDir = templatePathProvider.directoryInPackage(name, fileSystem);
final Directory imageDir = await templatePathProvider.imageDirectory(name, fileSystem, logger);
return Template._(
<Directory>[templateDir],
<Directory>[imageDir],
fileSystem: fileSystem,
logger: logger,
templateRenderer: templateRenderer,
templateManifest: templateManifest,
);
}
static Future<Template> merged(List<String> names, Directory directory, {
required FileSystem fileSystem,
required Set<Uri> templateManifest,
required Logger logger,
required TemplateRenderer templateRenderer,
}) async {
// All named templates are placed in the 'templates' directory
return Template._(
<Directory>[
for (final String name in names)
templatePathProvider.directoryInPackage(name, fileSystem),
],
<Directory>[
for (final String name in names)
if ((await templatePathProvider.imageDirectory(name, fileSystem, logger)).existsSync())
await templatePathProvider.imageDirectory(name, fileSystem, logger),
],
fileSystem: fileSystem,
logger: logger,
templateRenderer: templateRenderer,
templateManifest: templateManifest,
);
}
final FileSystem _fileSystem;
final Logger _logger;
final Set<Uri> _templateManifest;
final TemplateRenderer _templateRenderer;
static const String templateExtension = '.tmpl';
static const String copyTemplateExtension = '.copy.tmpl';
static const String imageTemplateExtension = '.img.tmpl';
static const String testTemplateExtension = '.test.tmpl';
final Pattern _kTemplateLanguageVariant = RegExp(r'(\w+)-(\w+)\.tmpl.*');
final List<Directory> imageSourceDirectories;
final Map<String /* relative */, String /* absolute source */> _templateFilePaths = <String, String>{};
/// Render the template into [directory].
///
/// May throw a [ToolExit] if the directory is not writable.
int render(
Directory destination,
Map<String, Object?> context, {
bool overwriteExisting = true,
bool printStatusWhenWriting = true,
}) {
try {
destination.createSync(recursive: true);
} on FileSystemException catch (err) {
_logger.printError(err.toString());
throwToolExit('Failed to flutter create at ${destination.path}.');
}
int fileCount = 0;
final bool implementationTests = (context['implementationTests'] as bool?) ?? false;
/// Returns the resolved destination path corresponding to the specified
/// raw destination path, after performing language filtering and template
/// expansion on the path itself.
///
/// Returns null if the given raw destination path has been filtered.
String? renderPath(String relativeDestinationPath) {
final Match? match = _kTemplateLanguageVariant.matchAsPrefix(relativeDestinationPath);
if (match != null) {
final String platform = match.group(1)!;
final String? language = context['${platform}Language'] as String?;
if (language != match.group(2)) {
return null;
}
relativeDestinationPath = relativeDestinationPath.replaceAll('$platform-$language.tmpl', platform);
}
final bool android = (context['android'] as bool?) ?? false;
if (relativeDestinationPath.contains('android') && !android) {
return null;
}
final bool ios = (context['ios'] as bool?) ?? false;
if (relativeDestinationPath.contains('ios') && !ios) {
return null;
}
// Only build a web project if explicitly asked.
final bool web = (context['web'] as bool?) ?? false;
if (relativeDestinationPath.contains('web') && !web) {
return null;
}
// Only build a Linux project if explicitly asked.
final bool linux = (context['linux'] as bool?) ?? false;
if (relativeDestinationPath.startsWith('linux.tmpl') && !linux) {
return null;
}
// Only build a macOS project if explicitly asked.
final bool macOS = (context['macos'] as bool?) ?? false;
if (relativeDestinationPath.startsWith('macos.tmpl') && !macOS) {
return null;
}
// Only build a Windows project if explicitly asked.
final bool windows = (context['windows'] as bool?) ?? false;
if (relativeDestinationPath.startsWith('windows.tmpl') && !windows) {
return null;
}
final String? projectName = context['projectName'] as String?;
final String? androidIdentifier = context['androidIdentifier'] as String?;
final String? pluginClass = context['pluginClass'] as String?;
final String? pluginClassSnakeCase = context['pluginClassSnakeCase'] as String?;
final String destinationDirPath = destination.absolute.path;
final String pathSeparator = _fileSystem.path.separator;
String finalDestinationPath = _fileSystem.path
.join(destinationDirPath, relativeDestinationPath)
.replaceAll(copyTemplateExtension, '')
.replaceAll(imageTemplateExtension, '')
.replaceAll(testTemplateExtension, '')
.replaceAll(templateExtension, '');
if (android && androidIdentifier != null) {
finalDestinationPath = finalDestinationPath
.replaceAll('androidIdentifier', androidIdentifier.replaceAll('.', pathSeparator));
}
if (projectName != null) {
finalDestinationPath = finalDestinationPath.replaceAll('projectName', projectName);
}
// This must be before the pluginClass replacement step.
if (pluginClassSnakeCase != null) {
finalDestinationPath = finalDestinationPath.replaceAll('pluginClassSnakeCase', pluginClassSnakeCase);
}
if (pluginClass != null) {
finalDestinationPath = finalDestinationPath.replaceAll('pluginClass', pluginClass);
}
return finalDestinationPath;
}
_templateFilePaths.forEach((String relativeDestinationPath, String absoluteSourcePath) {
final bool withRootModule = context['withRootModule'] as bool? ?? false;
if (!withRootModule && absoluteSourcePath.contains('flutter_root')) {
return;
}
if (!implementationTests && absoluteSourcePath.contains(testTemplateExtension)) {
return;
}
final String? finalDestinationPath = renderPath(relativeDestinationPath);
if (finalDestinationPath == null) {
return;
}
final File finalDestinationFile = _fileSystem.file(finalDestinationPath);
final String relativePathForLogging = _fileSystem.path.relative(finalDestinationFile.path);
// Step 1: Check if the file needs to be overwritten.
if (finalDestinationFile.existsSync()) {
if (overwriteExisting) {
finalDestinationFile.deleteSync(recursive: true);
if (printStatusWhenWriting) {
_logger.printStatus(' $relativePathForLogging (overwritten)');
}
} else {
// The file exists but we cannot overwrite it, move on.
if (printStatusWhenWriting) {
_logger.printTrace(' $relativePathForLogging (existing - skipped)');
}
return;
}
} else {
if (printStatusWhenWriting) {
_logger.printStatus(' $relativePathForLogging (created)');
}
}
fileCount += 1;
finalDestinationFile.createSync(recursive: true);
final File sourceFile = _fileSystem.file(absoluteSourcePath);
// Step 2: If the absolute paths ends with a '.copy.tmpl', this file does
// not need mustache rendering but needs to be directly copied.
if (sourceFile.path.endsWith(copyTemplateExtension)) {
sourceFile.copySync(finalDestinationFile.path);
return;
}
// Step 3: If the absolute paths ends with a '.img.tmpl', this file needs
// to be copied from the template image package.
if (sourceFile.path.endsWith(imageTemplateExtension)) {
final List<File> potentials = <File>[
for (final Directory imageSourceDir in imageSourceDirectories)
_fileSystem.file(_fileSystem.path
.join(imageSourceDir.path, relativeDestinationPath.replaceAll(imageTemplateExtension, ''))),
];
if (potentials.any((File file) => file.existsSync())) {
final File imageSourceFile = potentials.firstWhere((File file) => file.existsSync());
imageSourceFile.copySync(finalDestinationFile.path);
} else {
throwToolExit('Image File not found ${finalDestinationFile.path}');
}
return;
}
// Step 4: If the absolute path ends with a '.tmpl', this file needs
// rendering via mustache.
if (sourceFile.path.endsWith(templateExtension)) {
final String templateContents = sourceFile.readAsStringSync();
final String? androidIdentifier = context['androidIdentifier'] as String?;
if (finalDestinationFile.path.endsWith('.kt') && androidIdentifier != null) {
context['androidIdentifier'] = _escapeKotlinKeywords(androidIdentifier);
}
// Use a copy of the context,
// since the original is used in rendering other templates.
final Map<String, Object?> localContext = finalDestinationFile.path.endsWith('.yaml')
? _createEscapedContextCopy(context)
: context;
final String renderedContents = _templateRenderer.renderString(templateContents, localContext);
finalDestinationFile.writeAsStringSync(renderedContents);
return;
}
// Step 5: This file does not end in .tmpl but is in a directory that
// does. Directly copy the file to the destination.
sourceFile.copySync(finalDestinationFile.path);
});
return fileCount;
}
}
/// Create a copy of the given [context], escaping its values when necessary.
///
/// Returns the copied context.
Map<String, Object?> _createEscapedContextCopy(Map<String, Object?> context) {
final Map<String, Object?> localContext = Map<String, Object?>.of(context);
final String? description = localContext['description'] as String?;
if (description != null && description.isNotEmpty) {
localContext['description'] = escapeYamlString(description);
}
return localContext;
}
String _escapeKotlinKeywords(String androidIdentifier) {
final List<String> segments = androidIdentifier.split('.');
final List<String> correctedSegments = segments.map(
(String segment) => kReservedKotlinKeywords.contains(segment) ? '`$segment`' : segment
).toList();
return correctedSegments.join('.');
}
String escapeYamlString(String value) {
final StringBuffer result = StringBuffer();
result.write('"');
for (final int rune in value.runes) {
result.write(
switch (rune) {
0x00 => r'\0',
0x09 => r'\t',
0x0A => r'\n',
0x0D => r'\r',
0x22 => r'\"',
0x5C => r'\\',
< 0x20 => '\\x${rune.toRadixString(16).padLeft(2, "0")}',
_ => String.fromCharCode(rune),
}
);
}
result.write('"');
return result.toString();
}
| flutter/packages/flutter_tools/lib/src/template.dart/0 | {
"file_path": "flutter/packages/flutter_tools/lib/src/template.dart",
"repo_id": "flutter",
"token_count": 5811
} | 787 |
// 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:package_config/package_config.dart';
import 'package:process/process.dart';
import '../artifacts.dart';
import '../base/common.dart';
import '../base/config.dart';
import '../base/file_system.dart';
import '../base/logger.dart';
import '../base/platform.dart';
import '../build_info.dart';
import '../bundle.dart';
import '../cache.dart';
import '../compile.dart';
import '../dart/language_version.dart';
import '../web/bootstrap.dart';
import '../web/compile.dart';
import '../web/memory_fs.dart';
import 'test_config.dart';
/// A web compiler for the test runner.
class WebTestCompiler {
WebTestCompiler({
required FileSystem fileSystem,
required Logger logger,
required Artifacts artifacts,
required Platform platform,
required ProcessManager processManager,
required Config config,
}) : _logger = logger,
_fileSystem = fileSystem,
_artifacts = artifacts,
_platform = platform,
_processManager = processManager,
_config = config;
final Logger _logger;
final FileSystem _fileSystem;
final Artifacts _artifacts;
final Platform _platform;
final ProcessManager _processManager;
final Config _config;
Future<WebMemoryFS> initialize({
required Directory projectDirectory,
required String testOutputDir,
required List<String> testFiles,
required BuildInfo buildInfo,
required WebRendererMode webRenderer,
}) async {
LanguageVersion languageVersion = LanguageVersion(2, 8);
late final String platformDillName;
// TODO(zanderso): to support autodetect this would need to partition the source code into
// a sound and unsound set and perform separate compilations
final List<String> extraFrontEndOptions = List<String>.of(buildInfo.extraFrontEndOptions);
switch (buildInfo.nullSafetyMode) {
case NullSafetyMode.unsound || NullSafetyMode.autodetect:
platformDillName = 'ddc_outline.dill';
if (!extraFrontEndOptions.contains('--no-sound-null-safety')) {
extraFrontEndOptions.add('--no-sound-null-safety');
}
case NullSafetyMode.sound:
languageVersion = currentLanguageVersion(_fileSystem, Cache.flutterRoot!);
platformDillName = 'ddc_outline_sound.dill';
if (!extraFrontEndOptions.contains('--sound-null-safety')) {
extraFrontEndOptions.add('--sound-null-safety');
}
}
final String platformDillPath = _fileSystem.path.join(
_artifacts.getHostArtifact(HostArtifact.webPlatformKernelFolder).path,
platformDillName
);
final Directory outputDirectory = _fileSystem.directory(testOutputDir)
..createSync(recursive: true);
final List<File> generatedFiles = <File>[];
for (final String testFilePath in testFiles) {
final List<String> relativeTestSegments = _fileSystem.path.split(
_fileSystem.path.relative(testFilePath, from: projectDirectory.childDirectory('test').path));
final File generatedFile = _fileSystem.file(
_fileSystem.path.join(outputDirectory.path, '${relativeTestSegments.join('_')}.test.dart'));
generatedFile
..createSync(recursive: true)
..writeAsStringSync(generateTestEntrypoint(
relativeTestPath: relativeTestSegments.join('/'),
absolutePath: testFilePath,
testConfigPath: findTestConfigFile(_fileSystem.file(testFilePath), _logger)?.path,
languageVersion: languageVersion,
));
generatedFiles.add(generatedFile);
}
// Generate a fake main file that imports all tests to be executed. This will force
// each of them to be compiled.
final StringBuffer buffer = StringBuffer('// @dart=${languageVersion.major}.${languageVersion.minor}\n');
for (final File generatedFile in generatedFiles) {
buffer.writeln('import "${_fileSystem.path.basename(generatedFile.path)}";');
}
buffer.writeln('void main() {}');
_fileSystem.file(_fileSystem.path.join(outputDirectory.path, 'main.dart'))
..createSync()
..writeAsStringSync(buffer.toString());
final String cachedKernelPath = getDefaultCachedKernelPath(
trackWidgetCreation: buildInfo.trackWidgetCreation,
dartDefines: buildInfo.dartDefines,
extraFrontEndOptions: extraFrontEndOptions,
fileSystem: _fileSystem,
config: _config,
);
final List<String> dartDefines = webRenderer.updateDartDefines(buildInfo.dartDefines);
final ResidentCompiler residentCompiler = ResidentCompiler(
_artifacts.getHostArtifact(HostArtifact.flutterWebSdk).path,
buildMode: buildInfo.mode,
trackWidgetCreation: buildInfo.trackWidgetCreation,
fileSystemRoots: <String>[
projectDirectory.childDirectory('test').path,
testOutputDir,
],
// Override the filesystem scheme so that the frontend_server can find
// the generated entrypoint code.
fileSystemScheme: 'org-dartlang-app',
initializeFromDill: cachedKernelPath,
targetModel: TargetModel.dartdevc,
extraFrontEndOptions: extraFrontEndOptions,
platformDill: _fileSystem.file(platformDillPath).absolute.uri.toString(),
dartDefines: dartDefines,
librariesSpec: _artifacts.getHostArtifact(HostArtifact.flutterWebLibrariesJson).uri.toString(),
packagesPath: buildInfo.packagesPath,
artifacts: _artifacts,
processManager: _processManager,
logger: _logger,
platform: _platform,
fileSystem: _fileSystem,
);
final CompilerOutput? output = await residentCompiler.recompile(
Uri.parse('org-dartlang-app:///main.dart'),
<Uri>[],
outputPath: outputDirectory.childFile('out').path,
packageConfig: buildInfo.packageConfig,
fs: _fileSystem,
projectRootPath: projectDirectory.absolute.path,
);
if (output == null || output.errorCount > 0) {
throwToolExit('Failed to compile');
}
// Cache the output kernel file to speed up subsequent compiles.
_fileSystem.file(cachedKernelPath).parent.createSync(recursive: true);
_fileSystem.file(output.outputFilename).copySync(cachedKernelPath);
final File codeFile = outputDirectory.childFile('${output.outputFilename}.sources');
final File manifestFile = outputDirectory.childFile('${output.outputFilename}.json');
final File sourcemapFile = outputDirectory.childFile('${output.outputFilename}.map');
final File metadataFile = outputDirectory.childFile('${output.outputFilename}.metadata');
return WebMemoryFS()
..write(codeFile, manifestFile, sourcemapFile, metadataFile);
}
}
| flutter/packages/flutter_tools/lib/src/test/web_test_compiler.dart/0 | {
"file_path": "flutter/packages/flutter_tools/lib/src/test/web_test_compiler.dart",
"repo_id": "flutter",
"token_count": 2336
} | 788 |
// 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 '../../base/file_system.dart';
import '../../base/logger.dart';
import '../../base/project_migrator.dart';
import '../../project.dart';
/// Remove lib/generated_plugin_registrant.dart if it exists.
class ScrubGeneratedPluginRegistrant extends ProjectMigrator {
ScrubGeneratedPluginRegistrant(
WebProject project,
super.logger,
) : _project = project, _logger = logger;
final WebProject _project;
final Logger _logger;
@override
void migrate() {
final File registrant = _project.libDirectory.childFile('generated_plugin_registrant.dart');
final File gitignore = _project.parent.directory.childFile('.gitignore');
if (!removeFile(registrant)) {
return;
}
if (gitignore.existsSync()) {
processFileLines(gitignore);
}
}
// Cleans up the .gitignore by removing the line that mentions generated_plugin_registrant.
@override
String? migrateLine(String line) {
return line.contains('lib/generated_plugin_registrant.dart') ? null : line;
}
bool removeFile(File file) {
if (!file.existsSync()) {
_logger.printTrace('${file.basename} not found. Skipping.');
return true;
}
try {
file.deleteSync();
_logger.printStatus('${file.basename} found. Deleted.');
return true;
} on FileSystemException catch (e, s) {
_logger.printError(e.message, stackTrace: s);
}
return false;
}
}
| flutter/packages/flutter_tools/lib/src/web/migrations/scrub_generated_plugin_registrant.dart/0 | {
"file_path": "flutter/packages/flutter_tools/lib/src/web/migrations/scrub_generated_plugin_registrant.dart",
"repo_id": "flutter",
"token_count": 559
} | 789 |
// 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:process/process.dart';
import '../base/io.dart';
import '../base/os.dart';
import '../doctor_validator.dart';
/// Flutter only supports development on Windows host machines version 10 and greater.
const List<String> kUnsupportedVersions = <String>[
'6',
'7',
'8',
];
/// Regex pattern for identifying line from systeminfo stdout with windows version
/// (ie. 10.5.4123)
const String kWindowsOSVersionSemVerPattern = r'([0-9]+)\.([0-9]+)\.([0-9\.]+)';
/// Regex pattern for identifying a running instance of the Topaz OFD process.
/// This is a known process that interferes with the build toolchain.
/// See https://github.com/flutter/flutter/issues/121366
const String kCoreProcessPattern = r'Topaz\s+OFD\\Warsaw\\core\.exe';
/// Validator for supported Windows host machine operating system version.
class WindowsVersionValidator extends DoctorValidator {
const WindowsVersionValidator({
required OperatingSystemUtils operatingSystemUtils,
required ProcessLister processLister,
}) : _operatingSystemUtils = operatingSystemUtils,
_processLister = processLister,
super('Windows Version');
final OperatingSystemUtils _operatingSystemUtils;
final ProcessLister _processLister;
Future<ValidationResult> _topazScan() async {
final ProcessResult getProcessesResult = await _processLister.getProcessesWithPath();
if (getProcessesResult.exitCode != 0) {
return const ValidationResult(ValidationType.missing, <ValidationMessage>[ValidationMessage.hint('Get-Process failed to complete')]);
}
final RegExp topazRegex = RegExp(kCoreProcessPattern, caseSensitive: false, multiLine: true);
final String processes = getProcessesResult.stdout as String;
final bool topazFound = topazRegex.hasMatch(processes);
if (topazFound) {
return const ValidationResult(
ValidationType.missing,
<ValidationMessage>[
ValidationMessage.hint(
'The Topaz OFD Security Module was detected on your machine. '
'You may need to disable it to build Flutter applications.',
),
],
);
}
return const ValidationResult(ValidationType.success, <ValidationMessage>[]);
}
@override
Future<ValidationResult> validate() async {
final RegExp regex =
RegExp(kWindowsOSVersionSemVerPattern, multiLine: true);
final String commandResult = _operatingSystemUtils.name;
final Iterable<RegExpMatch> matches = regex.allMatches(commandResult);
// Use the string split method to extract the major version
// and check against the [kUnsupportedVersions] list
ValidationType windowsVersionStatus;
final List<ValidationMessage> messages = <ValidationMessage>[];
String statusInfo;
if (matches.length == 1 &&
!kUnsupportedVersions.contains(matches.elementAt(0).group(1))) {
windowsVersionStatus = ValidationType.success;
statusInfo = 'Installed version of Windows is version 10 or higher';
// Check if the Topaz OFD security module is running, and warn the user if it is.
// See https://github.com/flutter/flutter/issues/121366
final List<ValidationResult> subResults = <ValidationResult>[
await _topazScan(),
];
for (final ValidationResult subResult in subResults) {
if (subResult.type != ValidationType.success) {
statusInfo = 'Problem detected with Windows installation';
windowsVersionStatus = ValidationType.partial;
messages.addAll(subResult.messages);
}
}
} else {
windowsVersionStatus = ValidationType.missing;
statusInfo =
'Unable to determine Windows version (command `ver` returned $commandResult)';
}
return ValidationResult(
windowsVersionStatus,
messages,
statusInfo: statusInfo,
);
}
}
class ProcessLister {
ProcessLister(this.processManager);
final ProcessManager processManager;
Future<ProcessResult> getProcessesWithPath() async {
const String argument = 'Get-Process | Format-List Path';
return processManager.run(<String>['powershell', '-command', argument]);
}
}
| flutter/packages/flutter_tools/lib/src/windows/windows_version_validator.dart/0 | {
"file_path": "flutter/packages/flutter_tools/lib/src/windows/windows_version_validator.dart",
"repo_id": "flutter",
"token_count": 1452
} | 790 |
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="main.dart" type="FlutterRunConfigurationType" factoryName="Flutter">
<option name="filePath" value="$PROJECT_DIR$/lib/main.dart" />
<method />
</configuration>
</component> | flutter/packages/flutter_tools/templates/app_shared/.idea/runConfigurations/main_dart.xml.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/app_shared/.idea/runConfigurations/main_dart.xml.tmpl",
"repo_id": "flutter",
"token_count": 84
} | 791 |
#import <Flutter/Flutter.h>
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
{{#withPlatformChannelPluginHook}}
@import {{pluginProjectName}};
// This demonstrates a simple unit test of the Objective-C portion of this plugin's implementation.
//
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
{{/withPlatformChannelPluginHook}}
@interface RunnerTests : XCTestCase
@end
@implementation RunnerTests
{{#withPlatformChannelPluginHook}}
- (void)testExample {
{{pluginClass}} *plugin = [[{{pluginClass}} alloc] init];
FlutterMethodCall *call = [FlutterMethodCall methodCallWithMethodName:@"getPlatformVersion"
arguments:nil];
XCTestExpectation *expectation = [self expectationWithDescription:@"result block must be called"];
[plugin handleMethodCall:call
result:^(id result) {
NSString *expected = [NSString
stringWithFormat:@"iOS %@", UIDevice.currentDevice.systemVersion];
XCTAssertEqualObjects(result, expected);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:1 handler:nil];
}
{{/withPlatformChannelPluginHook}}
{{^withPlatformChannelPluginHook}}
- (void)testExample {
// If you add code to the Runner application, consider adding tests here.
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
}
{{/withPlatformChannelPluginHook}}
@end
| flutter/packages/flutter_tools/templates/app_shared/ios-objc.tmpl/RunnerTests/RunnerTests.m.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/app_shared/ios-objc.tmpl/RunnerTests/RunnerTests.m.tmpl",
"repo_id": "flutter",
"token_count": 605
} | 792 |
#include "ephemeral/Flutter-Generated.xcconfig"
| flutter/packages/flutter_tools/templates/app_shared/macos.tmpl/Flutter/Flutter-Release.xcconfig/0 | {
"file_path": "flutter/packages/flutter_tools/templates/app_shared/macos.tmpl/Flutter/Flutter-Release.xcconfig",
"repo_id": "flutter",
"token_count": 19
} | 793 |
{
"name": "{{projectName}}",
"short_name": "{{projectName}}",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "{{description}}",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": [
{
"src": "icons/Icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "icons/Icon-maskable-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "icons/Icon-maskable-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
]
}
| flutter/packages/flutter_tools/templates/app_shared/web/manifest.json.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/app_shared/web/manifest.json.tmpl",
"repo_id": "flutter",
"token_count": 515
} | 794 |
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
</resources>
| flutter/packages/flutter_tools/templates/module/android/host_app_common/app.tmpl/src/main/res/values/styles.xml/0 | {
"file_path": "flutter/packages/flutter_tools/templates/module/android/host_app_common/app.tmpl/src/main/res/values/styles.xml",
"repo_id": "flutter",
"token_count": 127
} | 795 |
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.idea" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Flutter Plugins" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>
| flutter/packages/flutter_tools/templates/module/common/projectName.iml.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/module/common/projectName.iml.tmpl",
"repo_id": "flutter",
"token_count": 316
} | 796 |
# 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.
require 'json'
# Install pods needed to embed Flutter application, Flutter engine, and plugins
# from the host application Podfile.
#
# @example
# target 'MyApp' do
# install_all_flutter_pods 'my_flutter'
# end
# @param [String] flutter_application_path Path of the root directory of the Flutter module.
# Optional, defaults to two levels up from the directory of this script.
# MyApp/my_flutter/.ios/Flutter/../..
def install_all_flutter_pods(flutter_application_path = nil)
# defined_in_file is a Pathname to the Podfile set by CocoaPods.
pod_contents = File.read(defined_in_file)
unless pod_contents.include? 'flutter_post_install'
puts <<~POSTINSTALL
Add `flutter_post_install(installer)` to your Podfile `post_install` block to build Flutter plugins:
post_install do |installer|
flutter_post_install(installer)
end
POSTINSTALL
raise 'Missing `flutter_post_install(installer)` in Podfile `post_install` block'
end
flutter_application_path ||= File.join('..', '..')
install_flutter_engine_pod(flutter_application_path)
install_flutter_plugin_pods(flutter_application_path)
install_flutter_application_pod(flutter_application_path)
end
# Install Flutter engine pod.
#
# @example
# target 'MyApp' do
# install_flutter_engine_pod
# end
def install_flutter_engine_pod(flutter_application_path = nil)
flutter_application_path ||= File.join('..', '..')
ios_application_path = File.join(flutter_application_path, '.ios')
# flutter_install_ios_engine_pod is in Flutter root podhelper.rb
flutter_install_ios_engine_pod(ios_application_path)
end
# Install Flutter plugin pods.
#
# @example
# target 'MyApp' do
# install_flutter_plugin_pods 'my_flutter'
# end
# @param [String] flutter_application_path Path of the root directory of the Flutter module.
# Optional, defaults to two levels up from the directory of this script.
# MyApp/my_flutter/.ios/Flutter/../..
def install_flutter_plugin_pods(flutter_application_path)
flutter_application_path ||= File.join('..', '..')
ios_application_path = File.join(flutter_application_path, '.ios')
# flutter_install_plugin_pods is in Flutter root podhelper.rb
flutter_install_plugin_pods(ios_application_path, '.symlinks', 'ios')
# Keep pod path relative so it can be checked into Podfile.lock.
relative = flutter_relative_path_from_podfile(ios_application_path)
pod 'FlutterPluginRegistrant', path: File.join(relative, 'Flutter', 'FlutterPluginRegistrant'), inhibit_warnings: true
end
# Install Flutter application pod.
#
# @example
# target 'MyApp' do
# install_flutter_application_pod '../flutter_settings_repository'
# end
# @param [String] flutter_application_path Path of the root directory of the Flutter module.
# Optional, defaults to two levels up from the directory of this script.
# MyApp/my_flutter/.ios/Flutter/../..
def install_flutter_application_pod(flutter_application_path)
flutter_application_path ||= File.join('..', '..')
export_script_directory = File.join(flutter_application_path, '.ios', 'Flutter')
# Keep script phase paths relative so they can be checked into source control.
relative = flutter_relative_path_from_podfile(export_script_directory)
flutter_export_environment_path = File.join('${SRCROOT}', relative, 'flutter_export_environment.sh')
# Compile App.framework and move it and Flutter.framework to "BUILT_PRODUCTS_DIR"
script_phase name: 'Run Flutter Build {{projectName}} Script',
script: "set -e\nset -u\nsource \"#{flutter_export_environment_path}\"\nexport VERBOSE_SCRIPT_LOGGING=1 && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/xcode_backend.sh build",
execution_position: :before_compile
# Embed App.framework AND Flutter.framework.
script_phase name: 'Embed Flutter Build {{projectName}} Script',
script: "set -e\nset -u\nsource \"#{flutter_export_environment_path}\"\nexport VERBOSE_SCRIPT_LOGGING=1 && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/xcode_backend.sh embed_and_thin",
execution_position: :after_compile
end
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', '..', 'Flutter', 'Generated.xcconfig'), __FILE__)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" unless File.exist?(generated_xcode_build_settings_path)
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT=(.*)/)
return matches[1].strip if matches
end
# This should never happen...
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
# Run the post-install script to set build settings on Flutter plugins.
#
# @example
# post_install do |installer|
# flutter_post_install(installer)
# end
# @param [Pod::Installer] installer Passed to the `post_install` block.
# @param [boolean] skip Do not change any build configurations. Set to suppress
# "Missing `flutter_post_install" exception.
def flutter_post_install(installer, skip: false)
return if skip
installer.pods_project.targets.each do |target|
target.build_configurations.each do |_build_configuration|
# flutter_additional_ios_build_settings is in Flutter root podhelper.rb
flutter_additional_ios_build_settings(target)
end
end
end
| flutter/packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb.tmpl",
"repo_id": "flutter",
"token_count": 2132
} | 797 |
package {{androidIdentifier}};
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import org.junit.Test;
/**
* This demonstrates a simple unit test of the Java portion of this plugin's implementation.
*
* Once you have built the plugin's example app, you can run these tests from the command
* line by running `./gradlew testDebugUnitTest` in the `example/android/` directory, or
* you can run them directly from IDEs that support JUnit such as Android Studio.
*/
public class {{pluginClass}}Test {
@Test
public void onMethodCall_getPlatformVersion_returnsExpectedValue() {
{{pluginClass}} plugin = new {{pluginClass}}();
final MethodCall call = new MethodCall("getPlatformVersion", null);
MethodChannel.Result mockResult = mock(MethodChannel.Result.class);
plugin.onMethodCall(call, mockResult);
verify(mockResult).success("Android " + android.os.Build.VERSION.RELEASE);
}
}
| flutter/packages/flutter_tools/templates/plugin/android-java.tmpl/src/test/java/androidIdentifier/pluginClassTest.java.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/plugin/android-java.tmpl/src/test/java/androidIdentifier/pluginClassTest.java.tmpl",
"repo_id": "flutter",
"token_count": 303
} | 798 |
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import '{{projectName}}_platform_interface.dart';
/// An implementation of [{{pluginDartClass}}Platform] that uses method channels.
class MethodChannel{{pluginDartClass}} extends {{pluginDartClass}}Platform {
/// The method channel used to interact with the native platform.
@visibleForTesting
final methodChannel = const MethodChannel('{{projectName}}');
@override
Future<String?> getPlatformVersion() async {
final version = await methodChannel.invokeMethod<String>('getPlatformVersion');
return version;
}
}
| flutter/packages/flutter_tools/templates/plugin/lib/projectName_method_channel.dart.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/plugin/lib/projectName_method_channel.dart.tmpl",
"repo_id": "flutter",
"token_count": 167
} | 799 |
#include <flutter/method_call.h>
#include <flutter/method_result_functions.h>
#include <flutter/standard_method_codec.h>
#include <gtest/gtest.h>
#include <windows.h>
#include <memory>
#include <string>
#include <variant>
#include "{{pluginClassSnakeCase}}.h"
namespace {{projectName}} {
namespace test {
namespace {
using flutter::EncodableMap;
using flutter::EncodableValue;
using flutter::MethodCall;
using flutter::MethodResultFunctions;
} // namespace
TEST({{pluginClass}}, GetPlatformVersion) {
{{pluginClass}} plugin;
// Save the reply value from the success callback.
std::string result_string;
plugin.HandleMethodCall(
MethodCall("getPlatformVersion", std::make_unique<EncodableValue>()),
std::make_unique<MethodResultFunctions<>>(
[&result_string](const EncodableValue* result) {
result_string = std::get<std::string>(*result);
},
nullptr, nullptr));
// Since the exact string varies by host, just ensure that it's a string
// with the expected format.
EXPECT_TRUE(result_string.rfind("Windows ", 0) == 0);
}
} // namespace test
} // namespace {{projectName}}
| flutter/packages/flutter_tools/templates/plugin/windows.tmpl/test/pluginClassSnakeCase_test.cpp.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/plugin/windows.tmpl/test/pluginClassSnakeCase_test.cpp.tmpl",
"repo_id": "flutter",
"token_count": 404
} | 800 |
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: {{flutterRevision}}
channel: {{flutterChannel}}
{{#withFfiPluginHook}}
project_type: plugin_ffi
{{/withFfiPluginHook}}
{{#withFfiPackage}}
project_type: package_ffi
{{/withFfiPackage}}
{{#withPlatformChannelPluginHook}}
project_type: plugin
{{/withPlatformChannelPluginHook}}
| flutter/packages/flutter_tools/templates/plugin_shared/.metadata.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/plugin_shared/.metadata.tmpl",
"repo_id": "flutter",
"token_count": 148
} | 801 |
import 'package:flutter/material.dart';
import 'src/app.dart';
import 'src/settings/settings_controller.dart';
import 'src/settings/settings_service.dart';
void main() async {
// Set up the SettingsController, which will glue user settings to multiple
// Flutter Widgets.
final settingsController = SettingsController(SettingsService());
// Load the user's preferred theme while the splash screen is displayed.
// This prevents a sudden theme change when the app is first displayed.
await settingsController.loadSettings();
// Run the app and pass in the SettingsController. The app listens to the
// SettingsController for changes, then passes it further down to the
// SettingsView.
runApp(MyApp(settingsController: settingsController));
}
| flutter/packages/flutter_tools/templates/skeleton/lib/main.dart.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/skeleton/lib/main.dart.tmpl",
"repo_id": "flutter",
"token_count": 191
} | 802 |
// 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:file/memory.dart';
import 'package:flutter_tools/src/android/android_device.dart';
import 'package:flutter_tools/src/application_package.dart';
import 'package:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/base/common.dart';
import 'package:flutter_tools/src/base/dds.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/signals.dart';
import 'package:flutter_tools/src/base/terminal.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/attach.dart';
import 'package:flutter_tools/src/compile.dart';
import 'package:flutter_tools/src/device.dart';
import 'package:flutter_tools/src/device_port_forwarder.dart';
import 'package:flutter_tools/src/ios/application_package.dart';
import 'package:flutter_tools/src/ios/devices.dart';
import 'package:flutter_tools/src/mdns_discovery.dart';
import 'package:flutter_tools/src/project.dart';
import 'package:flutter_tools/src/reporting/reporting.dart';
import 'package:flutter_tools/src/resident_runner.dart';
import 'package:flutter_tools/src/run_hot.dart';
import 'package:flutter_tools/src/vmservice.dart';
import 'package:multicast_dns/multicast_dns.dart';
import 'package:test/fake.dart';
import 'package:unified_analytics/unified_analytics.dart';
import 'package:vm_service/vm_service.dart' as vm_service;
import '../../src/common.dart';
import '../../src/context.dart';
import '../../src/fake_devices.dart';
import '../../src/test_flutter_command_runner.dart';
class FakeStdio extends Fake implements Stdio {
@override
bool stdinHasTerminal = false;
}
class FakeProcessInfo extends Fake implements ProcessInfo {
@override
int maxRss = 0;
}
void main() {
group('attach', () {
late StreamLogger logger;
late FileSystem testFileSystem;
late TestDeviceManager testDeviceManager;
late Artifacts artifacts;
late Stdio stdio;
late Terminal terminal;
late Signals signals;
late Platform platform;
late ProcessInfo processInfo;
setUp(() {
Cache.disableLocking();
logger = StreamLogger();
platform = FakePlatform();
testFileSystem = MemoryFileSystem.test();
testFileSystem.directory('lib').createSync();
testFileSystem.file(testFileSystem.path.join('lib', 'main.dart')).createSync();
artifacts = Artifacts.test(fileSystem: testFileSystem);
stdio = FakeStdio();
terminal = FakeTerminal();
signals = Signals.test();
processInfo = FakeProcessInfo();
testDeviceManager = TestDeviceManager(logger: logger);
});
group('with one device and no specified target file', () {
const int devicePort = 499;
const int hostPort = 42;
final int future = DateTime.now().add(const Duration(days: 1)).millisecondsSinceEpoch;
late FakeDeviceLogReader fakeLogReader;
late RecordingPortForwarder portForwarder;
late FakeDartDevelopmentService fakeDds;
late FakeAndroidDevice device;
setUp(() {
fakeLogReader = FakeDeviceLogReader();
portForwarder = RecordingPortForwarder(hostPort);
fakeDds = FakeDartDevelopmentService();
device = FakeAndroidDevice(id: '1')
..portForwarder = portForwarder
..dds = fakeDds;
});
tearDown(() {
fakeLogReader.dispose();
});
testUsingContext('succeeds with iOS device with protocol discovery', () async {
final FakeIOSDevice device = FakeIOSDevice(
portForwarder: portForwarder,
majorSdkVersion: 12,
onGetLogReader: () {
fakeLogReader.addLine('Foo');
fakeLogReader.addLine('The Dart VM service is listening on http://127.0.0.1:$devicePort');
return fakeLogReader;
},
);
testDeviceManager.devices = <Device>[device];
final Completer<void> completer = Completer<void>();
final StreamSubscription<String> loggerSubscription = logger.stream.listen((String message) {
if (message == '[verbose] VM Service URL on device: http://127.0.0.1:$devicePort') {
// The "VM Service URL on device" message is output by the ProtocolDiscovery when it found the VM Service.
completer.complete();
}
});
final FakeHotRunner hotRunner = FakeHotRunner();
hotRunner.onAttach = (
Completer<DebugConnectionInfo>? connectionInfoCompleter,
Completer<void>? appStartedCompleter,
bool allowExistingDdsInstance,
bool enableDevTools,
) async => 0;
hotRunner.exited = false;
hotRunner.isWaitingForVmService = false;
final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory()
..hotRunner = hotRunner;
await createTestCommandRunner(AttachCommand(
hotRunnerFactory: hotRunnerFactory,
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
)).run(<String>['attach']);
await completer.future;
expect(portForwarder.devicePort, devicePort);
expect(portForwarder.hostPort, hostPort);
await fakeLogReader.dispose();
await loggerSubscription.cancel();
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
Logger: () => logger,
DeviceManager: () => testDeviceManager,
MDnsVmServiceDiscovery: () => MDnsVmServiceDiscovery(
mdnsClient: FakeMDnsClient(<PtrResourceRecord>[], <String, List<SrvResourceRecord>>{}),
preliminaryMDnsClient: FakeMDnsClient(<PtrResourceRecord>[], <String, List<SrvResourceRecord>>{}),
logger: logger,
flutterUsage: TestUsage(),
analytics: const NoOpAnalytics(),
),
});
testUsingContext('restores terminal to singleCharMode == false on command exit', () async {
final FakeIOSDevice device = FakeIOSDevice(
portForwarder: portForwarder,
majorSdkVersion: 12,
onGetLogReader: () {
fakeLogReader.addLine('Foo');
fakeLogReader.addLine('The Dart VM service is listening on http://127.0.0.1:$devicePort');
return fakeLogReader;
},
);
testDeviceManager.devices = <Device>[device];
final Completer<void> completer = Completer<void>();
final StreamSubscription<String> loggerSubscription = logger.stream.listen((String message) {
if (message == '[verbose] VM Service URL on device: http://127.0.0.1:$devicePort') {
// The "VM Service URL on device" message is output by the ProtocolDiscovery when it found the VM Service.
completer.complete();
}
});
final FakeHotRunner hotRunner = FakeHotRunner();
hotRunner.onAttach = (
Completer<DebugConnectionInfo>? connectionInfoCompleter,
Completer<void>? appStartedCompleter,
bool allowExistingDdsInstance,
bool enableDevTools,
) async {
appStartedCompleter?.complete();
return 0;
};
hotRunner.exited = false;
hotRunner.isWaitingForVmService = false;
final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory()
..hotRunner = hotRunner;
await createTestCommandRunner(AttachCommand(
hotRunnerFactory: hotRunnerFactory,
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
)).run(<String>['attach']);
await Future.wait<void>(<Future<void>>[
completer.future,
fakeLogReader.dispose(),
loggerSubscription.cancel(),
]);
expect(terminal.singleCharMode, isFalse);
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
Logger: () => logger,
DeviceManager: () => testDeviceManager,
MDnsVmServiceDiscovery: () => MDnsVmServiceDiscovery(
mdnsClient: FakeMDnsClient(<PtrResourceRecord>[], <String, List<SrvResourceRecord>>{}),
preliminaryMDnsClient: FakeMDnsClient(<PtrResourceRecord>[], <String, List<SrvResourceRecord>>{}),
logger: logger,
flutterUsage: TestUsage(),
analytics: const NoOpAnalytics(),
),
Signals: () => FakeSignals(),
});
testUsingContext('local engine artifacts are passed to runner', () async {
const String localEngineSrc = '/path/to/local/engine/src';
const String localEngineDir = 'host_debug_unopt';
testFileSystem.directory('$localEngineSrc/out/$localEngineDir').createSync(recursive: true);
final FakeIOSDevice device = FakeIOSDevice(
portForwarder: portForwarder,
majorSdkVersion: 12,
onGetLogReader: () {
fakeLogReader.addLine('Foo');
fakeLogReader.addLine('The Dart VM service is listening on http://127.0.0.1:$devicePort');
return fakeLogReader;
},
);
testDeviceManager.devices = <Device>[device];
final Completer<void> completer = Completer<void>();
final StreamSubscription<String> loggerSubscription = logger.stream.listen((String message) {
if (message == '[verbose] VM Service URL on device: http://127.0.0.1:$devicePort') {
// The "VM Service URL on device" message is output by the ProtocolDiscovery when it found the VM Service.
completer.complete();
}
});
final FakeHotRunner hotRunner = FakeHotRunner();
hotRunner.onAttach = (
Completer<DebugConnectionInfo>? connectionInfoCompleter,
Completer<void>? appStartedCompleter,
bool allowExistingDdsInstance,
bool enableDevTools,
) async => 0;
hotRunner.exited = false;
hotRunner.isWaitingForVmService = false;
bool passedArtifactTest = false;
final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory()
..hotRunner = hotRunner
.._artifactTester = (Artifacts artifacts) {
expect(artifacts, isA<CachedLocalEngineArtifacts>());
// expecting this to be true ensures this test ran
passedArtifactTest = true;
};
await createTestCommandRunner(AttachCommand(
hotRunnerFactory: hotRunnerFactory,
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
)).run(<String>['attach', '--local-engine-src-path=$localEngineSrc', '--local-engine=$localEngineDir', '--local-engine-host=$localEngineDir']);
await Future.wait<void>(<Future<void>>[
completer.future,
fakeLogReader.dispose(),
loggerSubscription.cancel(),
]);
expect(passedArtifactTest, isTrue);
}, overrides: <Type, Generator>{
Artifacts: () => artifacts,
DeviceManager: () => testDeviceManager,
FileSystem: () => testFileSystem,
Logger: () => logger,
MDnsVmServiceDiscovery: () => MDnsVmServiceDiscovery(
mdnsClient: FakeMDnsClient(<PtrResourceRecord>[], <String, List<SrvResourceRecord>>{}),
preliminaryMDnsClient: FakeMDnsClient(<PtrResourceRecord>[], <String, List<SrvResourceRecord>>{}),
logger: logger,
flutterUsage: TestUsage(),
analytics: const NoOpAnalytics(),
),
ProcessManager: () => FakeProcessManager.empty(),
});
testUsingContext('succeeds with iOS device with mDNS', () async {
final FakeIOSDevice device = FakeIOSDevice(
portForwarder: portForwarder,
majorSdkVersion: 16,
onGetLogReader: () {
fakeLogReader.addLine('Foo');
fakeLogReader.addLine('The Dart VM service is listening on http://127.0.0.1:$devicePort');
return fakeLogReader;
},
);
testDeviceManager.devices = <Device>[device];
final FakeHotRunner hotRunner = FakeHotRunner();
hotRunner.onAttach = (
Completer<DebugConnectionInfo>? connectionInfoCompleter,
Completer<void>? appStartedCompleter,
bool allowExistingDdsInstance,
bool enableDevTools,
) async => 0;
hotRunner.exited = false;
hotRunner.isWaitingForVmService = false;
final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory()
..hotRunner = hotRunner;
await createTestCommandRunner(AttachCommand(
hotRunnerFactory: hotRunnerFactory,
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
)).run(<String>['attach']);
await fakeLogReader.dispose();
expect(portForwarder.devicePort, devicePort);
expect(portForwarder.hostPort, hostPort);
expect(hotRunnerFactory.devices, hasLength(1));
final FlutterDevice flutterDevice = hotRunnerFactory.devices.first;
final Uri? vmServiceUri = await flutterDevice.vmServiceUris?.first;
expect(vmServiceUri.toString(), 'http://127.0.0.1:$hostPort/xyz/');
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
Logger: () => logger,
DeviceManager: () => testDeviceManager,
MDnsVmServiceDiscovery: () => MDnsVmServiceDiscovery(
mdnsClient: FakeMDnsClient(<PtrResourceRecord>[], <String, List<SrvResourceRecord>>{}),
preliminaryMDnsClient: FakeMDnsClient(
<PtrResourceRecord>[
PtrResourceRecord('foo', future, domainName: 'bar'),
],
<String, List<SrvResourceRecord>>{
'bar': <SrvResourceRecord>[
SrvResourceRecord('bar', future, port: devicePort, weight: 1, priority: 1, target: 'appId'),
],
},
txtResponse: <String, List<TxtResourceRecord>>{
'bar': <TxtResourceRecord>[
TxtResourceRecord('bar', future, text: 'authCode=xyz\n'),
],
},
),
logger: logger,
flutterUsage: TestUsage(),
analytics: const NoOpAnalytics(),
),
});
testUsingContext('succeeds with iOS device with mDNS wireless device', () async {
final FakeIOSDevice device = FakeIOSDevice(
portForwarder: portForwarder,
majorSdkVersion: 16,
connectionInterface: DeviceConnectionInterface.wireless,
);
testDeviceManager.devices = <Device>[device];
final FakeHotRunner hotRunner = FakeHotRunner();
hotRunner.onAttach = (
Completer<DebugConnectionInfo>? connectionInfoCompleter,
Completer<void>? appStartedCompleter,
bool allowExistingDdsInstance,
bool enableDevTools,
) async => 0;
hotRunner.exited = false;
hotRunner.isWaitingForVmService = false;
final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory()
..hotRunner = hotRunner;
await createTestCommandRunner(AttachCommand(
hotRunnerFactory: hotRunnerFactory,
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
)).run(<String>['attach']);
await fakeLogReader.dispose();
expect(portForwarder.devicePort, null);
expect(portForwarder.hostPort, hostPort);
expect(hotRunnerFactory.devices, hasLength(1));
final FlutterDevice flutterDevice = hotRunnerFactory.devices.first;
final Uri? vmServiceUri = await flutterDevice.vmServiceUris?.first;
expect(vmServiceUri.toString(), 'http://111.111.111.111:123/xyz/');
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
Logger: () => logger,
DeviceManager: () => testDeviceManager,
MDnsVmServiceDiscovery: () => MDnsVmServiceDiscovery(
mdnsClient: FakeMDnsClient(<PtrResourceRecord>[], <String, List<SrvResourceRecord>>{}),
preliminaryMDnsClient: FakeMDnsClient(
<PtrResourceRecord>[
PtrResourceRecord('foo', future, domainName: 'srv-foo'),
],
<String, List<SrvResourceRecord>>{
'srv-foo': <SrvResourceRecord>[
SrvResourceRecord('srv-foo', future, port: 123, weight: 1, priority: 1, target: 'target-foo'),
],
},
ipResponse: <String, List<IPAddressResourceRecord>>{
'target-foo': <IPAddressResourceRecord>[
IPAddressResourceRecord('target-foo', 0, address: InternetAddress.tryParse('111.111.111.111')!),
],
},
txtResponse: <String, List<TxtResourceRecord>>{
'srv-foo': <TxtResourceRecord>[
TxtResourceRecord('srv-foo', future, text: 'authCode=xyz\n'),
],
},
),
logger: logger,
flutterUsage: TestUsage(),
analytics: const NoOpAnalytics(),
),
});
testUsingContext('succeeds with iOS device with mDNS wireless device with debug-port', () async {
final FakeIOSDevice device = FakeIOSDevice(
portForwarder: portForwarder,
majorSdkVersion: 16,
connectionInterface: DeviceConnectionInterface.wireless,
);
testDeviceManager.devices = <Device>[device];
final FakeHotRunner hotRunner = FakeHotRunner();
hotRunner.onAttach = (
Completer<DebugConnectionInfo>? connectionInfoCompleter,
Completer<void>? appStartedCompleter,
bool allowExistingDdsInstance,
bool enableDevTools,
) async => 0;
hotRunner.exited = false;
hotRunner.isWaitingForVmService = false;
final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory()
..hotRunner = hotRunner;
await createTestCommandRunner(AttachCommand(
hotRunnerFactory: hotRunnerFactory,
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
)).run(<String>['attach', '--debug-port', '123']);
await fakeLogReader.dispose();
expect(portForwarder.devicePort, null);
expect(portForwarder.hostPort, hostPort);
expect(hotRunnerFactory.devices, hasLength(1));
final FlutterDevice flutterDevice = hotRunnerFactory.devices.first;
final Uri? vmServiceUri = await flutterDevice.vmServiceUris?.first;
expect(vmServiceUri.toString(), 'http://111.111.111.111:123/xyz/');
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
Logger: () => logger,
DeviceManager: () => testDeviceManager,
MDnsVmServiceDiscovery: () => MDnsVmServiceDiscovery(
mdnsClient: FakeMDnsClient(<PtrResourceRecord>[], <String, List<SrvResourceRecord>>{}),
preliminaryMDnsClient: FakeMDnsClient(
<PtrResourceRecord>[
PtrResourceRecord('bar', future, domainName: 'srv-bar'),
PtrResourceRecord('foo', future, domainName: 'srv-foo'),
],
<String, List<SrvResourceRecord>>{
'srv-bar': <SrvResourceRecord>[
SrvResourceRecord('srv-bar', future, port: 321, weight: 1, priority: 1, target: 'target-bar'),
],
'srv-foo': <SrvResourceRecord>[
SrvResourceRecord('srv-foo', future, port: 123, weight: 1, priority: 1, target: 'target-foo'),
],
},
ipResponse: <String, List<IPAddressResourceRecord>>{
'target-foo': <IPAddressResourceRecord>[
IPAddressResourceRecord('target-foo', 0, address: InternetAddress.tryParse('111.111.111.111')!),
],
},
txtResponse: <String, List<TxtResourceRecord>>{
'srv-foo': <TxtResourceRecord>[
TxtResourceRecord('srv-foo', future, text: 'authCode=xyz\n'),
],
},
),
logger: logger,
flutterUsage: TestUsage(),
analytics: const NoOpAnalytics(),
),
});
testUsingContext('succeeds with iOS device with mDNS wireless device with debug-url', () async {
final FakeIOSDevice device = FakeIOSDevice(
portForwarder: portForwarder,
majorSdkVersion: 16,
connectionInterface: DeviceConnectionInterface.wireless,
);
testDeviceManager.devices = <Device>[device];
final FakeHotRunner hotRunner = FakeHotRunner();
hotRunner.onAttach = (
Completer<DebugConnectionInfo>? connectionInfoCompleter,
Completer<void>? appStartedCompleter,
bool allowExistingDdsInstance,
bool enableDevTools,
) async => 0;
hotRunner.exited = false;
hotRunner.isWaitingForVmService = false;
final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory()
..hotRunner = hotRunner;
await createTestCommandRunner(AttachCommand(
hotRunnerFactory: hotRunnerFactory,
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
)).run(<String>['attach', '--debug-url', 'https://0.0.0.0:123']);
await fakeLogReader.dispose();
expect(portForwarder.devicePort, null);
expect(portForwarder.hostPort, hostPort);
expect(hotRunnerFactory.devices, hasLength(1));
final FlutterDevice flutterDevice = hotRunnerFactory.devices.first;
final Uri? vmServiceUri = await flutterDevice.vmServiceUris?.first;
expect(vmServiceUri.toString(), 'http://111.111.111.111:123/xyz/');
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
Logger: () => logger,
DeviceManager: () => testDeviceManager,
MDnsVmServiceDiscovery: () => MDnsVmServiceDiscovery(
mdnsClient: FakeMDnsClient(<PtrResourceRecord>[], <String, List<SrvResourceRecord>>{}),
preliminaryMDnsClient: FakeMDnsClient(
<PtrResourceRecord>[
PtrResourceRecord('bar', future, domainName: 'srv-bar'),
PtrResourceRecord('foo', future, domainName: 'srv-foo'),
],
<String, List<SrvResourceRecord>>{
'srv-bar': <SrvResourceRecord>[
SrvResourceRecord('srv-bar', future, port: 321, weight: 1, priority: 1, target: 'target-bar'),
],
'srv-foo': <SrvResourceRecord>[
SrvResourceRecord('srv-foo', future, port: 123, weight: 1, priority: 1, target: 'target-foo'),
],
},
ipResponse: <String, List<IPAddressResourceRecord>>{
'target-foo': <IPAddressResourceRecord>[
IPAddressResourceRecord('target-foo', 0, address: InternetAddress.tryParse('111.111.111.111')!),
],
},
txtResponse: <String, List<TxtResourceRecord>>{
'srv-foo': <TxtResourceRecord>[
TxtResourceRecord('srv-foo', future, text: 'authCode=xyz\n'),
],
},
),
logger: logger,
flutterUsage: TestUsage(),
analytics: const NoOpAnalytics(),
),
});
testUsingContext('finds VM Service port and forwards', () async {
device.onGetLogReader = () {
fakeLogReader.addLine('Foo');
fakeLogReader.addLine('The Dart VM service is listening on http://127.0.0.1:$devicePort');
return fakeLogReader;
};
testDeviceManager.devices = <Device>[device];
final Completer<void> completer = Completer<void>();
final StreamSubscription<String> loggerSubscription = logger.stream.listen((String message) {
if (message == '[verbose] VM Service URL on device: http://127.0.0.1:$devicePort') {
// The "VM Service URL on device" message is output by the ProtocolDiscovery when it found the VM Service.
completer.complete();
}
});
final Future<void> task = createTestCommandRunner(AttachCommand(
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
)).run(<String>['attach']);
await completer.future;
expect(portForwarder.devicePort, devicePort);
expect(portForwarder.hostPort, hostPort);
await fakeLogReader.dispose();
await expectLoggerInterruptEndsTask(task, logger);
await loggerSubscription.cancel();
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
Logger: () => logger,
DeviceManager: () => testDeviceManager,
});
testUsingContext('Fails with tool exit on bad VmService uri', () async {
device.onGetLogReader = () {
fakeLogReader.addLine('Foo');
fakeLogReader.addLine('The Dart VM service is listening on http://127.0.0.1:$devicePort');
fakeLogReader.dispose();
return fakeLogReader;
};
testDeviceManager.devices = <Device>[device];
expect(() => createTestCommandRunner(AttachCommand(
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
)).run(<String>['attach']), throwsToolExit());
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
Logger: () => logger,
DeviceManager: () => testDeviceManager,
});
testUsingContext('accepts filesystem parameters', () async {
device.onGetLogReader = () {
fakeLogReader.addLine('Foo');
fakeLogReader.addLine('The Dart VM service is listening on http://127.0.0.1:$devicePort');
return fakeLogReader;
};
testDeviceManager.devices = <Device>[device];
const String filesystemScheme = 'foo';
const String filesystemRoot = '/build-output/';
const String projectRoot = '/build-output/project-root';
const String outputDill = '/tmp/output.dill';
final FakeHotRunner hotRunner = FakeHotRunner();
hotRunner.onAttach = (
Completer<DebugConnectionInfo>? connectionInfoCompleter,
Completer<void>? appStartedCompleter,
bool allowExistingDdsInstance,
bool enableDevTools,
) async => 0;
hotRunner.exited = false;
hotRunner.isWaitingForVmService = false;
final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory()
..hotRunner = hotRunner;
final AttachCommand command = AttachCommand(
hotRunnerFactory: hotRunnerFactory,
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
);
await createTestCommandRunner(command).run(<String>[
'attach',
'--filesystem-scheme',
filesystemScheme,
'--filesystem-root',
filesystemRoot,
'--project-root',
projectRoot,
'--output-dill',
outputDill,
'-v', // enables verbose logging
]);
// Validate the attach call built a fake runner with the right
// project root and output dill.
expect(hotRunnerFactory.projectRootPath, projectRoot);
expect(hotRunnerFactory.dillOutputPath, outputDill);
expect(hotRunnerFactory.devices, hasLength(1));
// Validate that the attach call built a flutter device with the right
// output dill, filesystem scheme, and filesystem root.
final FlutterDevice flutterDevice = hotRunnerFactory.devices.first;
expect(flutterDevice.buildInfo.fileSystemScheme, filesystemScheme);
expect(flutterDevice.buildInfo.fileSystemRoots, const <String>[filesystemRoot]);
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
DeviceManager: () => testDeviceManager,
});
testUsingContext('exits when ipv6 is specified and debug-port is not on non-iOS device', () async {
testDeviceManager.devices = <Device>[device];
final AttachCommand command = AttachCommand(
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
);
await expectLater(
createTestCommandRunner(command).run(<String>['attach', '--ipv6']),
throwsToolExit(
message: 'When the --debug-port or --debug-url is unknown, this command determines '
'the value of --ipv6 on its own.',
),
);
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
DeviceManager: () => testDeviceManager,
});
testUsingContext('succeeds when ipv6 is specified and debug-port is not on iOS device', () async {
final FakeIOSDevice device = FakeIOSDevice(
portForwarder: portForwarder,
majorSdkVersion: 12,
onGetLogReader: () {
fakeLogReader.addLine('Foo');
fakeLogReader.addLine('The Dart VM service is listening on http://[::1]:$devicePort');
return fakeLogReader;
},
);
testDeviceManager.devices = <Device>[device];
final Completer<void> completer = Completer<void>();
final StreamSubscription<String> loggerSubscription = logger.stream.listen((String message) {
if (message == '[verbose] VM Service URL on device: http://[::1]:$devicePort') {
// The "VM Service URL on device" message is output by the ProtocolDiscovery when it found the VM Service.
completer.complete();
}
});
final FakeHotRunner hotRunner = FakeHotRunner();
hotRunner.onAttach = (
Completer<DebugConnectionInfo>? connectionInfoCompleter,
Completer<void>? appStartedCompleter,
bool allowExistingDdsInstance,
bool enableDevTools,
) async => 0;
hotRunner.exited = false;
hotRunner.isWaitingForVmService = false;
final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory()
..hotRunner = hotRunner;
await createTestCommandRunner(AttachCommand(
hotRunnerFactory: hotRunnerFactory,
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
)).run(<String>['attach', '--ipv6']);
await completer.future;
expect(portForwarder.devicePort, devicePort);
expect(portForwarder.hostPort, hostPort);
await fakeLogReader.dispose();
await loggerSubscription.cancel();
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
Logger: () => logger,
DeviceManager: () => testDeviceManager,
});
testUsingContext('exits when vm-service-port is specified and debug-port is not', () async {
device.onGetLogReader = () {
fakeLogReader.addLine('Foo');
fakeLogReader.addLine('The Dart VM service is listening on http://127.0.0.1:$devicePort');
return fakeLogReader;
};
testDeviceManager.devices = <Device>[device];
final AttachCommand command = AttachCommand(
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
);
await expectLater(
createTestCommandRunner(command).run(<String>['attach', '--vm-service-port', '100']),
throwsToolExit(
message: 'When the --debug-port or --debug-url is unknown, this command does not use '
'the value of --vm-service-port.',
),
);
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
DeviceManager: () => testDeviceManager,
},);
});
group('forwarding to given port', () {
const int devicePort = 499;
const int hostPort = 42;
late RecordingPortForwarder portForwarder;
late FakeAndroidDevice device;
setUp(() {
final FakeDartDevelopmentService fakeDds = FakeDartDevelopmentService();
portForwarder = RecordingPortForwarder(hostPort);
device = FakeAndroidDevice(id: '1')
..portForwarder = portForwarder
..dds = fakeDds;
});
testUsingContext('succeeds in ipv4 mode', () async {
testDeviceManager.devices = <Device>[device];
final Completer<void> completer = Completer<void>();
final StreamSubscription<String> loggerSubscription = logger.stream.listen((String message) {
if (message == '[verbose] Connecting to service protocol: http://127.0.0.1:42/') {
// Wait until resident_runner.dart tries to connect.
// There's nothing to connect _to_, so that's as far as we care to go.
completer.complete();
}
});
final Future<void> task = createTestCommandRunner(AttachCommand(
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
))
.run(<String>['attach', '--debug-port', '$devicePort']);
await completer.future;
expect(portForwarder.devicePort, devicePort);
expect(portForwarder.hostPort, hostPort);
await expectLoggerInterruptEndsTask(task, logger);
await loggerSubscription.cancel();
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
Logger: () => logger,
DeviceManager: () => testDeviceManager,
});
testUsingContext('succeeds in ipv6 mode', () async {
testDeviceManager.devices = <Device>[device];
final Completer<void> completer = Completer<void>();
final StreamSubscription<String> loggerSubscription = logger.stream.listen((String message) {
if (message == '[verbose] Connecting to service protocol: http://[::1]:42/') {
// Wait until resident_runner.dart tries to connect.
// There's nothing to connect _to_, so that's as far as we care to go.
completer.complete();
}
});
final Future<void> task = createTestCommandRunner(AttachCommand(
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
))
.run(<String>['attach', '--debug-port', '$devicePort', '--ipv6']);
await completer.future;
expect(portForwarder.devicePort, devicePort);
expect(portForwarder.hostPort, hostPort);
await expectLoggerInterruptEndsTask(task, logger);
await loggerSubscription.cancel();
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
Logger: () => logger,
DeviceManager: () => testDeviceManager,
});
testUsingContext('skips in ipv4 mode with a provided VM Service port', () async {
testDeviceManager.devices = <Device>[device];
final Completer<void> completer = Completer<void>();
final StreamSubscription<String> loggerSubscription = logger.stream.listen((String message) {
if (message == '[verbose] Connecting to service protocol: http://127.0.0.1:42/') {
// Wait until resident_runner.dart tries to connect.
// There's nothing to connect _to_, so that's as far as we care to go.
completer.complete();
}
});
final Future<void> task = createTestCommandRunner(AttachCommand(
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
)).run(
<String>[
'attach',
'--debug-port',
'$devicePort',
'--vm-service-port',
'$hostPort',
// Ensure DDS doesn't use hostPort by binding to a random port.
'--dds-port',
'0',
],
);
await completer.future;
expect(portForwarder.devicePort, null);
expect(portForwarder.hostPort, 42);
await expectLoggerInterruptEndsTask(task, logger);
await loggerSubscription.cancel();
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
Logger: () => logger,
DeviceManager: () => testDeviceManager,
});
testUsingContext('skips in ipv6 mode with a provided VM Service port', () async {
testDeviceManager.devices = <Device>[device];
final Completer<void> completer = Completer<void>();
final StreamSubscription<String> loggerSubscription = logger.stream.listen((String message) {
if (message == '[verbose] Connecting to service protocol: http://[::1]:42/') {
// Wait until resident_runner.dart tries to connect.
// There's nothing to connect _to_, so that's as far as we care to go.
completer.complete();
}
});
final Future<void> task = createTestCommandRunner(AttachCommand(
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
)).run(
<String>[
'attach',
'--debug-port',
'$devicePort',
'--vm-service-port',
'$hostPort',
'--ipv6',
// Ensure DDS doesn't use hostPort by binding to a random port.
'--dds-port',
'0',
],
);
await completer.future;
expect(portForwarder.devicePort, null);
expect(portForwarder.hostPort, 42);
await expectLoggerInterruptEndsTask(task, logger);
await loggerSubscription.cancel();
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
Logger: () => logger,
DeviceManager: () => testDeviceManager,
});
});
testUsingContext('exits when no device connected', () async {
final AttachCommand command = AttachCommand(
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
);
await expectLater(
createTestCommandRunner(command).run(<String>['attach']),
throwsToolExit(),
);
expect(testLogger.statusText, containsIgnoringWhitespace('No supported devices connected'));
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
DeviceManager: () => testDeviceManager,
});
testUsingContext('fails when targeted device is not Android with --device-user', () async {
final FakeIOSDevice device = FakeIOSDevice();
testDeviceManager.devices = <Device>[device];
expect(createTestCommandRunner(AttachCommand(
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
)).run(<String>[
'attach',
'--device-user',
'10',
]), throwsToolExit(message: '--device-user is only supported for Android'));
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
DeviceManager: () => testDeviceManager,
});
testUsingContext('exits when multiple devices connected', () async {
final AttachCommand command = AttachCommand(
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
);
testDeviceManager.devices = <Device>[
FakeAndroidDevice(id: 'xx1'),
FakeAndroidDevice(id: 'yy2'),
];
await expectLater(
createTestCommandRunner(command).run(<String>['attach']),
throwsToolExit(),
);
expect(testLogger.statusText, containsIgnoringWhitespace('More than one device'));
expect(testLogger.statusText, contains('xx1'));
expect(testLogger.statusText, contains('yy2'));
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
DeviceManager: () => testDeviceManager,
AnsiTerminal: () => FakeTerminal(stdinHasTerminal: false),
});
testUsingContext('Catches service disappeared error', () async {
final FakeAndroidDevice device = FakeAndroidDevice(id: '1')
..portForwarder = const NoOpDevicePortForwarder()
..onGetLogReader = () => NoOpDeviceLogReader('test');
final FakeHotRunner hotRunner = FakeHotRunner();
final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory()
..hotRunner = hotRunner;
hotRunner.onAttach = (
Completer<DebugConnectionInfo>? connectionInfoCompleter,
Completer<void>? appStartedCompleter,
bool allowExistingDdsInstance,
bool enableDevTools,
) async {
await null;
throw vm_service.RPCError('flutter._listViews', RPCErrorCodes.kServiceDisappeared, '');
};
testDeviceManager.devices = <Device>[device];
testFileSystem.file('lib/main.dart').createSync();
final AttachCommand command = AttachCommand(
hotRunnerFactory: hotRunnerFactory,
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
);
await expectLater(createTestCommandRunner(command).run(<String>[
'attach',
]), throwsToolExit(message: 'Lost connection to device.'));
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
DeviceManager: () => testDeviceManager,
});
testUsingContext('Does not catch generic RPC error', () async {
final FakeAndroidDevice device = FakeAndroidDevice(id: '1')
..portForwarder = const NoOpDevicePortForwarder()
..onGetLogReader = () => NoOpDeviceLogReader('test');
final FakeHotRunner hotRunner = FakeHotRunner();
final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory()
..hotRunner = hotRunner;
hotRunner.onAttach = (
Completer<DebugConnectionInfo>? connectionInfoCompleter,
Completer<void>? appStartedCompleter,
bool allowExistingDdsInstance,
bool enableDevTools,
) async {
await null;
throw vm_service.RPCError('flutter._listViews', RPCErrorCodes.kInvalidParams, '');
};
testDeviceManager.devices = <Device>[device];
testFileSystem.file('lib/main.dart').createSync();
final AttachCommand command = AttachCommand(
hotRunnerFactory: hotRunnerFactory,
stdio: stdio,
logger: logger,
terminal: terminal,
signals: signals,
platform: platform,
processInfo: processInfo,
fileSystem: testFileSystem,
);
await expectLater(createTestCommandRunner(command).run(<String>[
'attach',
]), throwsA(isA<vm_service.RPCError>()));
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
DeviceManager: () => testDeviceManager,
});
});
}
class FakeHotRunner extends Fake implements HotRunner {
late Future<int> Function(Completer<DebugConnectionInfo>?, Completer<void>?, bool, bool) onAttach;
@override
bool exited = false;
@override
bool isWaitingForVmService = true;
@override
Future<int> attach({
Completer<DebugConnectionInfo>? connectionInfoCompleter,
Completer<void>? appStartedCompleter,
bool allowExistingDdsInstance = false,
bool enableDevTools = false,
bool needsFullRestart = true,
}) {
return onAttach(connectionInfoCompleter, appStartedCompleter, allowExistingDdsInstance, enableDevTools);
}
@override
bool supportsServiceProtocol = false;
@override
bool stayResident = true;
@override
void printHelp({required bool details}) {}
}
class FakeHotRunnerFactory extends Fake implements HotRunnerFactory {
late HotRunner hotRunner;
String? dillOutputPath;
String? projectRootPath;
late List<FlutterDevice> devices;
void Function(Artifacts artifacts)? _artifactTester;
@override
HotRunner build(
List<FlutterDevice> devices, {
required String target,
required DebuggingOptions debuggingOptions,
bool benchmarkMode = false,
File? applicationBinary,
bool hostIsIde = false,
String? projectRootPath,
String? packagesFilePath,
String? dillOutputPath,
bool stayResident = true,
bool ipv6 = false,
FlutterProject? flutterProject,
Analytics? analytics,
String? nativeAssetsYamlFile,
HotRunnerNativeAssetsBuilder? nativeAssetsBuilder,
}) {
if (_artifactTester != null) {
for (final FlutterDevice device in devices) {
_artifactTester!((device.generator! as DefaultResidentCompiler).artifacts);
}
}
this.devices = devices;
this.dillOutputPath = dillOutputPath;
this.projectRootPath = projectRootPath;
return hotRunner;
}
}
class RecordingPortForwarder implements DevicePortForwarder {
RecordingPortForwarder([this.hostPort]);
int? devicePort;
int? hostPort;
@override
Future<void> dispose() async { }
@override
Future<int> forward(int devicePort, {int? hostPort}) async {
this.devicePort = devicePort;
this.hostPort ??= hostPort;
return this.hostPort!;
}
@override
List<ForwardedPort> get forwardedPorts => <ForwardedPort>[];
@override
Future<void> unforward(ForwardedPort forwardedPort) async { }
}
class StreamLogger extends Logger {
@override
bool get isVerbose => true;
@override
void printError(
String message, {
StackTrace? stackTrace,
bool? emphasis,
TerminalColor? color,
int? indent,
int? hangingIndent,
bool? wrap,
}) {
hadErrorOutput = true;
_log('[stderr] $message');
}
@override
void printWarning(
String message, {
bool? emphasis,
TerminalColor? color,
int? indent,
int? hangingIndent,
bool? wrap,
bool fatal = true,
}) {
hadWarningOutput = hadWarningOutput || fatal;
_log('[stderr] $message');
}
@override
void printStatus(
String message, {
bool? emphasis,
TerminalColor? color,
bool? newline,
int? indent,
int? hangingIndent,
bool? wrap,
}) {
_log('[stdout] $message');
}
@override
void printBox(
String message, {
String? title,
}) {
if (title == null) {
_log('[stdout] $message');
} else {
_log('[stdout] $title: $message');
}
}
@override
void printTrace(String message) {
_log('[verbose] $message');
}
@override
Status startProgress(
String message, {
Duration? timeout,
String? progressId,
bool multilineOutput = false,
bool includeTiming = true,
int progressIndicatorPadding = kDefaultStatusPadding,
}) {
_log('[progress] $message');
return SilentStatus(
stopwatch: Stopwatch(),
)..start();
}
@override
Status startSpinner({
VoidCallback? onFinish,
Duration? timeout,
SlowWarningCallback? slowWarningCallback,
TerminalColor? warningColor,
}) {
return SilentStatus(
stopwatch: Stopwatch(),
onFinish: onFinish,
)..start();
}
bool _interrupt = false;
void interrupt() {
_interrupt = true;
}
final StreamController<String> _controller = StreamController<String>.broadcast();
void _log(String message) {
_controller.add(message);
if (_interrupt) {
_interrupt = false;
throw const LoggerInterrupted();
}
}
Stream<String> get stream => _controller.stream;
@override
void sendEvent(String name, [Map<String, dynamic>? args]) { }
@override
bool get supportsColor => throw UnimplementedError();
@override
bool get hasTerminal => false;
@override
void clear() => _log('[stdout] ${terminal.clearScreen()}\n');
@override
Terminal get terminal => Terminal.test();
}
class LoggerInterrupted implements Exception {
const LoggerInterrupted();
}
Future<void> expectLoggerInterruptEndsTask(Future<void> task, StreamLogger logger) async {
logger.interrupt(); // an exception during the task should cause it to fail...
await expectLater(
() => task,
throwsA(isA<ToolExit>().having((ToolExit error) => error.exitCode, 'exitCode', 2)),
);
}
class FakeDartDevelopmentService extends Fake implements DartDevelopmentService {
@override
Future<void> get done => noopCompleter.future;
final Completer<void> noopCompleter = Completer<void>();
@override
Future<void> startDartDevelopmentService(
Uri vmServiceUri, {
required Logger logger,
int? hostPort,
bool? ipv6,
bool? disableServiceAuthCodes,
bool cacheStartupProfile = false,
}) async {}
@override
Uri get uri => Uri.parse('http://localhost:8181');
}
class FakeAndroidDevice extends Fake implements AndroidDevice {
FakeAndroidDevice({required this.id});
@override
late DartDevelopmentService dds;
@override
final String id;
@override
String get name => 'd$id';
@override
Future<bool> get isLocalEmulator async => false;
@override
Future<String> get sdkNameAndVersion async => 'Android 46';
@override
Future<String> get targetPlatformDisplayName async => 'android';
@override
Future<TargetPlatform> get targetPlatform async => TargetPlatform.android_arm;
@override
DeviceConnectionInterface get connectionInterface =>
DeviceConnectionInterface.attached;
@override
bool isSupported() => true;
@override
bool get isConnected => true;
@override
bool get supportsHotRestart => true;
@override
bool get supportsFlutterExit => false;
@override
bool isSupportedForProject(FlutterProject flutterProject) => true;
@override
DevicePortForwarder? portForwarder;
DeviceLogReader Function()? onGetLogReader;
@override
FutureOr<DeviceLogReader> getLogReader({
ApplicationPackage? app,
bool includePastLogs = false,
}) {
if (onGetLogReader == null) {
throw UnimplementedError(
'Called getLogReader but no onGetLogReader callback was supplied in the constructor to FakeAndroidDevice.',
);
}
return onGetLogReader!();
}
@override
final PlatformType platformType = PlatformType.android;
@override
Category get category => Category.mobile;
@override
bool get ephemeral => true;
}
class FakeIOSDevice extends Fake implements IOSDevice {
FakeIOSDevice({
DevicePortForwarder? portForwarder,
this.onGetLogReader,
this.connectionInterface = DeviceConnectionInterface.attached,
this.majorSdkVersion = 0,
}) : _portForwarder = portForwarder;
final DevicePortForwarder? _portForwarder;
@override
int majorSdkVersion;
@override
final DeviceConnectionInterface connectionInterface;
@override
bool get isWirelesslyConnected =>
connectionInterface == DeviceConnectionInterface.wireless;
@override
DevicePortForwarder get portForwarder => _portForwarder!;
@override
DartDevelopmentService get dds => throw UnimplementedError('getter dds not implemented');
final DeviceLogReader Function()? onGetLogReader;
@override
DeviceLogReader getLogReader({
IOSApp? app,
bool includePastLogs = false,
bool usingCISystem = false,
}) {
if (onGetLogReader == null) {
throw UnimplementedError(
'Called getLogReader but no onGetLogReader callback was supplied in the constructor to FakeIOSDevice',
);
}
return onGetLogReader!();
}
@override
final String name = 'name';
@override
Future<TargetPlatform> get targetPlatform async => TargetPlatform.ios;
@override
final PlatformType platformType = PlatformType.ios;
@override
bool isSupported() => true;
@override
bool isSupportedForProject(FlutterProject project) => true;
@override
bool get isConnected => true;
@override
bool get ephemeral => true;
}
class FakeMDnsClient extends Fake implements MDnsClient {
FakeMDnsClient(this.ptrRecords, this.srvResponse, {
this.txtResponse = const <String, List<TxtResourceRecord>>{},
this.ipResponse = const <String, List<IPAddressResourceRecord>>{},
this.osErrorOnStart = false,
});
final List<PtrResourceRecord> ptrRecords;
final Map<String, List<SrvResourceRecord>> srvResponse;
final Map<String, List<TxtResourceRecord>> txtResponse;
final Map<String, List<IPAddressResourceRecord>> ipResponse;
final bool osErrorOnStart;
@override
Future<void> start({
InternetAddress? listenAddress,
NetworkInterfacesFactory? interfacesFactory,
int mDnsPort = 5353,
InternetAddress? mDnsAddress,
}) async {
if (osErrorOnStart) {
throw const OSError('Operation not supported on socket', 102);
}
}
@override
Stream<T> lookup<T extends ResourceRecord>(
ResourceRecordQuery query, {
Duration timeout = const Duration(seconds: 5),
}) {
if (T == PtrResourceRecord && query.fullyQualifiedName == MDnsVmServiceDiscovery.dartVmServiceName) {
return Stream<PtrResourceRecord>.fromIterable(ptrRecords) as Stream<T>;
}
if (T == SrvResourceRecord) {
final String key = query.fullyQualifiedName;
return Stream<SrvResourceRecord>.fromIterable(srvResponse[key] ?? <SrvResourceRecord>[]) as Stream<T>;
}
if (T == TxtResourceRecord) {
final String key = query.fullyQualifiedName;
return Stream<TxtResourceRecord>.fromIterable(txtResponse[key] ?? <TxtResourceRecord>[]) as Stream<T>;
}
if (T == IPAddressResourceRecord) {
final String key = query.fullyQualifiedName;
return Stream<IPAddressResourceRecord>.fromIterable(ipResponse[key] ?? <IPAddressResourceRecord>[]) as Stream<T>;
}
throw UnsupportedError('Unsupported query type $T');
}
@override
void stop() {}
}
class TestDeviceManager extends DeviceManager {
TestDeviceManager({required super.logger});
List<Device> devices = <Device>[];
@override
List<DeviceDiscovery> get deviceDiscoverers {
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
devices.forEach(discoverer.addDevice);
return <DeviceDiscovery>[discoverer];
}
}
class FakeTerminal extends Fake implements AnsiTerminal {
FakeTerminal({this.stdinHasTerminal = true});
@override
final bool stdinHasTerminal;
@override
bool usesTerminalUi = false;
@override
bool singleCharMode = false;
@override
Stream<String> get keystrokes => StreamController<String>().stream;
}
| flutter/packages/flutter_tools/test/commands.shard/hermetic/attach_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/commands.shard/hermetic/attach_test.dart",
"repo_id": "flutter",
"token_count": 23234
} | 803 |
// 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:fake_async/fake_async.dart';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/android/android_studio_validator.dart';
import 'package:flutter_tools/src/android/android_workflow.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/terminal.dart';
import 'package:flutter_tools/src/base/time.dart';
import 'package:flutter_tools/src/base/user_messages.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/custom_devices/custom_device_workflow.dart';
import 'package:flutter_tools/src/device.dart';
import 'package:flutter_tools/src/doctor.dart';
import 'package:flutter_tools/src/doctor_validator.dart';
import 'package:flutter_tools/src/globals.dart' as globals;
import 'package:flutter_tools/src/reporting/reporting.dart';
import 'package:flutter_tools/src/version.dart';
import 'package:flutter_tools/src/vscode/vscode.dart';
import 'package:flutter_tools/src/vscode/vscode_validator.dart';
import 'package:flutter_tools/src/web/workflow.dart';
import 'package:test/fake.dart';
import 'package:unified_analytics/unified_analytics.dart';
import '../../src/common.dart';
import '../../src/context.dart';
import '../../src/fakes.dart';
void main() {
late BufferLogger logger;
late FakeProcessManager fakeProcessManager;
late MemoryFileSystem fs;
setUp(() {
logger = BufferLogger.test();
fakeProcessManager = FakeProcessManager.empty();
fs = MemoryFileSystem.test();
});
testWithoutContext('ValidationMessage equality and hashCode includes contextUrl', () {
const ValidationMessage messageA = ValidationMessage('ab', contextUrl: 'a');
const ValidationMessage messageB = ValidationMessage('ab', contextUrl: 'b');
expect(messageB, isNot(messageA));
expect(messageB.hashCode, isNot(messageA.hashCode));
expect(messageA, isNot(messageB));
expect(messageA.hashCode, isNot(messageB.hashCode));
});
group('doctor', () {
testUsingContext('vs code validator when both installed', () async {
final ValidationResult result = await VsCodeValidatorTestTargets.installedWithExtension.validate();
expect(result.type, ValidationType.success);
expect(result.statusInfo, 'version 1.2.3');
expect(result.messages, hasLength(2));
ValidationMessage message = result.messages
.firstWhere((ValidationMessage m) => m.message.startsWith('VS Code '));
expect(message.message, 'VS Code at ${VsCodeValidatorTestTargets.validInstall}');
message = result.messages
.firstWhere((ValidationMessage m) => m.message.startsWith('Flutter '));
expect(message.message, 'Flutter extension version 4.5.6');
expect(message.isError, isFalse);
});
testUsingContext('No IDE Validator includes expected installation messages', () async {
final ValidationResult result = await NoIdeValidator().validate();
expect(result.type, ValidationType.notAvailable);
expect(
result.messages.map((ValidationMessage vm) => vm.message),
UserMessages().noIdeInstallationInfo,
);
});
testUsingContext('vs code validator when 64bit installed', () async {
expect(VsCodeValidatorTestTargets.installedWithExtension64bit.title, 'VS Code, 64-bit edition');
final ValidationResult result = await VsCodeValidatorTestTargets.installedWithExtension64bit.validate();
expect(result.type, ValidationType.success);
expect(result.statusInfo, 'version 1.2.3');
expect(result.messages, hasLength(2));
ValidationMessage message = result.messages
.firstWhere((ValidationMessage m) => m.message.startsWith('VS Code '));
expect(message.message, 'VS Code at ${VsCodeValidatorTestTargets.validInstall}');
message = result.messages
.firstWhere((ValidationMessage m) => m.message.startsWith('Flutter '));
expect(message.message, 'Flutter extension version 4.5.6');
});
testUsingContext('vs code validator when extension missing', () async {
final ValidationResult result = await VsCodeValidatorTestTargets.installedWithoutExtension.validate();
expect(result.type, ValidationType.success);
expect(result.statusInfo, 'version 1.2.3');
expect(result.messages, hasLength(2));
ValidationMessage message = result.messages
.firstWhere((ValidationMessage m) => m.message.startsWith('VS Code '));
expect(message.message, 'VS Code at ${VsCodeValidatorTestTargets.validInstall}');
message = result.messages
.firstWhere((ValidationMessage m) => m.message.startsWith('Flutter '));
expect(message.message, startsWith('Flutter extension can be installed from'));
expect(message.contextUrl, 'https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter');
expect(message.isError, false);
});
group('device validator', () {
testWithoutContext('no devices', () async {
final FakeDeviceManager deviceManager = FakeDeviceManager();
final DeviceValidator deviceValidator = DeviceValidator(
deviceManager: deviceManager,
userMessages: UserMessages(),
);
final ValidationResult result = await deviceValidator.validate();
expect(result.type, ValidationType.notAvailable);
expect(result.messages, const <ValidationMessage>[
ValidationMessage.hint('No devices available'),
]);
expect(result.statusInfo, isNull);
});
testWithoutContext('diagnostic message', () async {
final FakeDeviceManager deviceManager = FakeDeviceManager()
..diagnostics = <String>['Device locked'];
final DeviceValidator deviceValidator = DeviceValidator(
deviceManager: deviceManager,
userMessages: UserMessages(),
);
final ValidationResult result = await deviceValidator.validate();
expect(result.type, ValidationType.notAvailable);
expect(result.messages, const <ValidationMessage>[
ValidationMessage.hint('Device locked'),
]);
expect(result.statusInfo, isNull);
});
testWithoutContext('diagnostic message and devices', () async {
final FakeDevice device = FakeDevice();
final FakeDeviceManager deviceManager = FakeDeviceManager()
..devices = <Device>[device]
..diagnostics = <String>['Device locked'];
final DeviceValidator deviceValidator = DeviceValidator(
deviceManager: deviceManager,
userMessages: UserMessages(),
);
final ValidationResult result = await deviceValidator.validate();
expect(result.type, ValidationType.success);
expect(result.messages, const <ValidationMessage>[
ValidationMessage('name (mobile) • device-id • android • 1.2.3'),
ValidationMessage.hint('Device locked'),
]);
expect(result.statusInfo, '1 available');
});
});
});
group('doctor with overridden validators', () {
testUsingContext('validate non-verbose output format for run without issues', () async {
final Doctor doctor = Doctor(logger: logger, clock: const SystemClock());
expect(await doctor.diagnose(verbose: false), isTrue);
expect(logger.statusText, equals(
'Doctor summary (to see all details, run flutter doctor -v):\n'
'[✓] Passing Validator (with statusInfo)\n'
'[✓] Another Passing Validator (with statusInfo)\n'
'[✓] Providing validators is fun (with statusInfo)\n'
'\n'
'• No issues found!\n'
));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
DoctorValidatorsProvider: () => FakeDoctorValidatorsProvider(),
});
});
group('doctor usage params', () {
late TestUsage testUsage;
setUp(() {
testUsage = TestUsage();
});
testUsingContext('contains installed', () async {
final Doctor doctor = Doctor(logger: logger, clock: const SystemClock());
await doctor.diagnose(verbose: false);
expect(testUsage.events.length, 3);
expect(testUsage.events, contains(
const TestUsageEvent(
'doctor-result',
'PassingValidator',
label: 'installed',
),
));
}, overrides: <Type, Generator>{
DoctorValidatorsProvider: () => FakeDoctorValidatorsProvider(),
Usage: () => testUsage,
});
testUsingContext('contains installed and partial', () async {
await FakePassingDoctor(logger).diagnose(verbose: false);
expect(testUsage.events, unorderedEquals(<TestUsageEvent>[
const TestUsageEvent(
'doctor-result',
'PassingValidator',
label: 'installed',
),
const TestUsageEvent(
'doctor-result',
'PassingValidator',
label: 'installed',
),
const TestUsageEvent(
'doctor-result',
'PartialValidatorWithHintsOnly',
label: 'partial',
),
const TestUsageEvent(
'doctor-result',
'PartialValidatorWithErrors',
label: 'partial',
),
]));
}, overrides: <Type, Generator>{
Usage: () => testUsage,
});
testUsingContext('contains installed, missing and partial', () async {
await FakeDoctor(logger).diagnose(verbose: false);
expect(testUsage.events, unorderedEquals(<TestUsageEvent>[
const TestUsageEvent(
'doctor-result',
'PassingValidator',
label: 'installed',
),
const TestUsageEvent(
'doctor-result',
'MissingValidator',
label: 'missing',
),
const TestUsageEvent(
'doctor-result',
'NotAvailableValidator',
label: 'notAvailable',
),
const TestUsageEvent(
'doctor-result',
'PartialValidatorWithHintsOnly',
label: 'partial',
),
const TestUsageEvent(
'doctor-result',
'PartialValidatorWithErrors',
label: 'partial',
),
]));
}, overrides: <Type, Generator>{
Usage: () => testUsage,
});
testUsingContext('events for grouped validators are properly decomposed', () async {
await FakeGroupedDoctor(logger).diagnose(verbose: false);
expect(testUsage.events, unorderedEquals(<TestUsageEvent>[
const TestUsageEvent(
'doctor-result',
'PassingGroupedValidator',
label: 'installed',
),
const TestUsageEvent(
'doctor-result',
'PassingGroupedValidator',
label: 'installed',
),
const TestUsageEvent(
'doctor-result',
'PassingGroupedValidator',
label: 'installed',
),
const TestUsageEvent(
'doctor-result',
'MissingGroupedValidator',
label: 'missing',
),
]));
}, overrides: <Type, Generator>{
Usage: () => testUsage,
});
testUsingContext('sending events can be skipped', () async {
await FakePassingDoctor(logger).diagnose(verbose: false, sendEvent: false);
expect(testUsage.events, isEmpty);
}, overrides: <Type, Generator>{
Usage: () => testUsage,
});
});
group('doctor with fake validators', () {
testUsingContext('validate non-verbose output format for run without issues', () async {
expect(await FakeQuietDoctor(logger).diagnose(verbose: false), isTrue);
expect(logger.statusText, equals(
'Doctor summary (to see all details, run flutter doctor -v):\n'
'[✓] Passing Validator (with statusInfo)\n'
'[✓] Another Passing Validator (with statusInfo)\n'
'[✓] Validators are fun (with statusInfo)\n'
'[✓] Four score and seven validators ago (with statusInfo)\n'
'\n'
'• No issues found!\n'
));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate non-verbose output format for run with crash', () async {
expect(await FakeCrashingDoctor(logger).diagnose(verbose: false), isFalse);
expect(logger.statusText, equals(
'Doctor summary (to see all details, run flutter doctor -v):\n'
'[✓] Passing Validator (with statusInfo)\n'
'[✓] Another Passing Validator (with statusInfo)\n'
'[☠] Crashing validator (the doctor check crashed)\n'
' ✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, '
'please let us know about this issue at https://github.com/flutter/flutter/issues.\n'
' ✗ Bad state: fatal error\n'
'[✓] Validators are fun (with statusInfo)\n'
'[✓] Four score and seven validators ago (with statusInfo)\n'
'\n'
'! Doctor found issues in 1 category.\n'
));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate verbose output format contains trace for run with crash', () async {
expect(await FakeCrashingDoctor(logger).diagnose(), isFalse);
expect(logger.statusText, contains('#0 CrashingValidator.validate'));
});
testUsingContext('validate tool exit when exceeding timeout', () async {
FakeAsync().run<void>((FakeAsync time) {
final Doctor doctor = FakeAsyncStuckDoctor(logger);
doctor.diagnose(verbose: false);
time.elapse(const Duration(minutes: 5));
time.flushMicrotasks();
});
expect(logger.statusText, contains('Stuck validator that never completes exceeded maximum allowed duration of '));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate non-verbose output format for run with an async crash', () async {
final Completer<void> completer = Completer<void>();
await FakeAsync().run((FakeAsync time) {
unawaited(FakeAsyncCrashingDoctor(time, logger).diagnose(verbose: false).then((bool r) {
expect(r, isFalse);
completer.complete();
}));
time.elapse(const Duration(seconds: 1));
time.flushMicrotasks();
return completer.future;
});
expect(logger.statusText, equals(
'Doctor summary (to see all details, run flutter doctor -v):\n'
'[✓] Passing Validator (with statusInfo)\n'
'[✓] Another Passing Validator (with statusInfo)\n'
'[☠] Async crashing validator (the doctor check crashed)\n'
' ✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, '
'please let us know about this issue at https://github.com/flutter/flutter/issues.\n'
' ✗ Bad state: fatal error\n'
'[✓] Validators are fun (with statusInfo)\n'
'[✓] Four score and seven validators ago (with statusInfo)\n'
'\n'
'! Doctor found issues in 1 category.\n'
));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate non-verbose output format when only one category fails', () async {
expect(await FakeSinglePassingDoctor(logger).diagnose(verbose: false), isTrue);
expect(logger.statusText, equals(
'Doctor summary (to see all details, run flutter doctor -v):\n'
'[!] Partial Validator with only a Hint\n'
' ! There is a hint here\n'
'\n'
'! Doctor found issues in 1 category.\n'
));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate non-verbose output format for a passing run', () async {
expect(await FakePassingDoctor(logger).diagnose(verbose: false), isTrue);
expect(logger.statusText, equals(
'Doctor summary (to see all details, run flutter doctor -v):\n'
'[✓] Passing Validator (with statusInfo)\n'
'[!] Partial Validator with only a Hint\n'
' ! There is a hint here\n'
'[!] Partial Validator with Errors\n'
' ✗ An error message indicating partial installation\n'
' ! Maybe a hint will help the user\n'
'[✓] Another Passing Validator (with statusInfo)\n'
'\n'
'! Doctor found issues in 2 categories.\n'
));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate non-verbose output format', () async {
expect(await FakeDoctor(logger).diagnose(verbose: false), isFalse);
expect(logger.statusText, equals(
'Doctor summary (to see all details, run flutter doctor -v):\n'
'[✓] Passing Validator (with statusInfo)\n'
'[✗] Missing Validator\n'
' ✗ A useful error message\n'
' ! A hint message\n'
'[!] Not Available Validator\n'
' ✗ A useful error message\n'
' ! A hint message\n'
'[!] Partial Validator with only a Hint\n'
' ! There is a hint here\n'
'[!] Partial Validator with Errors\n'
' ✗ An error message indicating partial installation\n'
' ! Maybe a hint will help the user\n'
'\n'
'! Doctor found issues in 4 categories.\n'
));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate verbose output format', () async {
expect(await FakeDoctor(logger).diagnose(), isFalse);
expect(logger.statusText, equals(
'[✓] Passing Validator (with statusInfo)\n'
' • A helpful message\n'
' • A second, somewhat longer helpful message\n'
'\n'
'[✗] Missing Validator\n'
' ✗ A useful error message\n'
' • A message that is not an error\n'
' ! A hint message\n'
'\n'
'[!] Not Available Validator\n'
' ✗ A useful error message\n'
' • A message that is not an error\n'
' ! A hint message\n'
'\n'
'[!] Partial Validator with only a Hint\n'
' ! There is a hint here\n'
' • But there is no error\n'
'\n'
'[!] Partial Validator with Errors\n'
' ✗ An error message indicating partial installation\n'
' ! Maybe a hint will help the user\n'
' • An extra message with some verbose details\n'
'\n'
'! Doctor found issues in 4 categories.\n'
));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate PII can be hidden', () async {
expect(await FakePiiDoctor(logger).diagnose(showPii: false), isTrue);
expect(logger.statusText, equals(
'[✓] PII Validator\n'
' • Does not contain PII\n'
'\n'
'• No issues found!\n'
));
logger.clear();
// PII shown.
expect(await FakePiiDoctor(logger).diagnose(), isTrue);
expect(logger.statusText, equals(
'[✓] PII Validator\n'
' • Contains PII path/to/username\n'
'\n'
'• No issues found!\n'
));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
});
group('doctor diagnosis wrapper', () {
late TestUsage testUsage;
late BufferLogger logger;
setUp(() {
testUsage = TestUsage();
logger = BufferLogger.test();
});
testUsingContext('PII separated, events only sent once', () async {
final Doctor fakeDoctor = FakePiiDoctor(logger);
final DoctorText doctorText = DoctorText(logger,doctor: fakeDoctor);
const String expectedPiiText = '[✓] PII Validator\n'
' • Contains PII path/to/username\n'
'\n'
'• No issues found!\n';
const String expectedPiiStrippedText =
'[✓] PII Validator\n'
' • Does not contain PII\n'
'\n'
'• No issues found!\n';
// Run each multiple times to make sure the logger buffer is being cleared,
// and that events are only sent once.
expect(await doctorText.text, expectedPiiText);
expect(await doctorText.text, expectedPiiText);
expect(await doctorText.piiStrippedText, expectedPiiStrippedText);
expect(await doctorText.piiStrippedText, expectedPiiStrippedText);
// Only one event sent.
expect(testUsage.events, <TestUsageEvent>[
const TestUsageEvent(
'doctor-result',
'PiiValidator',
label: 'installed',
),
]);
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
Usage: () => testUsage,
});
testUsingContext('without PII has same text and PII-stripped text', () async {
final Doctor fakeDoctor = FakePassingDoctor(logger);
final DoctorText doctorText = DoctorText(logger, doctor: fakeDoctor);
final String piiText = await doctorText.text;
expect(piiText, isNotEmpty);
expect(piiText, await doctorText.piiStrippedText);
}, overrides: <Type, Generator>{
Usage: () => testUsage,
});
});
testUsingContext('validate non-verbose output wrapping', () async {
final BufferLogger wrapLogger = BufferLogger.test(
outputPreferences: OutputPreferences(wrapText: true, wrapColumn: 30),
);
expect(await FakeDoctor(wrapLogger).diagnose(verbose: false), isFalse);
expect(wrapLogger.statusText, equals(
'Doctor summary (to see all\n'
'details, run flutter doctor\n'
'-v):\n'
'[✓] Passing Validator (with\n'
' statusInfo)\n'
'[✗] Missing Validator\n'
' ✗ A useful error message\n'
' ! A hint message\n'
'[!] Not Available Validator\n'
' ✗ A useful error message\n'
' ! A hint message\n'
'[!] Partial Validator with\n'
' only a Hint\n'
' ! There is a hint here\n'
'[!] Partial Validator with\n'
' Errors\n'
' ✗ An error message\n'
' indicating partial\n'
' installation\n'
' ! Maybe a hint will help\n'
' the user\n'
'\n'
'! Doctor found issues in 4\n'
' categories.\n'
));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate verbose output wrapping', () async {
final BufferLogger wrapLogger = BufferLogger.test(
outputPreferences: OutputPreferences(wrapText: true, wrapColumn: 30),
);
expect(await FakeDoctor(wrapLogger).diagnose(), isFalse);
expect(wrapLogger.statusText, equals(
'[✓] Passing Validator (with\n'
' statusInfo)\n'
' • A helpful message\n'
' • A second, somewhat\n'
' longer helpful message\n'
'\n'
'[✗] Missing Validator\n'
' ✗ A useful error message\n'
' • A message that is not an\n'
' error\n'
' ! A hint message\n'
'\n'
'[!] Not Available Validator\n'
' ✗ A useful error message\n'
' • A message that is not an\n'
' error\n'
' ! A hint message\n'
'\n'
'[!] Partial Validator with\n'
' only a Hint\n'
' ! There is a hint here\n'
' • But there is no error\n'
'\n'
'[!] Partial Validator with\n'
' Errors\n'
' ✗ An error message\n'
' indicating partial\n'
' installation\n'
' ! Maybe a hint will help\n'
' the user\n'
' • An extra message with\n'
' some verbose details\n'
'\n'
'! Doctor found issues in 4\n'
' categories.\n'
));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
group('doctor with grouped validators', () {
testUsingContext('validate diagnose combines validator output', () async {
expect(await FakeGroupedDoctor(logger).diagnose(), isTrue);
expect(logger.statusText, equals(
'[✓] Category 1\n'
' • A helpful message\n'
' • A helpful message\n'
'\n'
'[!] Category 2\n'
' • A helpful message\n'
' ✗ A useful error message\n'
'\n'
'! Doctor found issues in 1 category.\n'
));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate merging assigns statusInfo and title', () async {
// There are two subvalidators. Only the second contains statusInfo.
expect(await FakeGroupedDoctorWithStatus(logger).diagnose(), isTrue);
expect(logger.statusText, equals(
'[✓] First validator title (A status message)\n'
' • A helpful message\n'
' • A different message\n'
'\n'
'• No issues found!\n'
));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
});
group('grouped validator merging results', () {
final PassingGroupedValidator installed = PassingGroupedValidator('Category');
final PartialGroupedValidator partial = PartialGroupedValidator('Category');
final MissingGroupedValidator missing = MissingGroupedValidator('Category');
testUsingContext('validate installed + installed = installed', () async {
expect(await FakeSmallGroupDoctor(logger, installed, installed).diagnose(), isTrue);
expect(logger.statusText, startsWith('[✓]'));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate installed + partial = partial', () async {
expect(await FakeSmallGroupDoctor(logger, installed, partial).diagnose(), isTrue);
expect(logger.statusText, startsWith('[!]'));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate installed + missing = partial', () async {
expect(await FakeSmallGroupDoctor(logger, installed, missing).diagnose(), isTrue);
expect(logger.statusText, startsWith('[!]'));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate partial + installed = partial', () async {
expect(await FakeSmallGroupDoctor(logger, partial, installed).diagnose(), isTrue);
expect(logger.statusText, startsWith('[!]'));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate partial + partial = partial', () async {
expect(await FakeSmallGroupDoctor(logger, partial, partial).diagnose(), isTrue);
expect(logger.statusText, startsWith('[!]'));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate partial + missing = partial', () async {
expect(await FakeSmallGroupDoctor(logger, partial, missing).diagnose(), isTrue);
expect(logger.statusText, startsWith('[!]'));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate missing + installed = partial', () async {
expect(await FakeSmallGroupDoctor(logger, missing, installed).diagnose(), isTrue);
expect(logger.statusText, startsWith('[!]'));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate missing + partial = partial', () async {
expect(await FakeSmallGroupDoctor(logger, missing, partial).diagnose(), isTrue);
expect(logger.statusText, startsWith('[!]'));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
testUsingContext('validate missing + missing = missing', () async {
expect(await FakeSmallGroupDoctor(logger, missing, missing).diagnose(), isFalse);
expect(logger.statusText, startsWith('[✗]'));
}, overrides: <Type, Generator>{
AnsiTerminal: () => FakeTerminal(),
});
});
testUsingContext('WebWorkflow is a part of validator workflows if enabled', () async {
final List<Workflow> workflows = DoctorValidatorsProvider.test(
featureFlags: TestFeatureFlags(isWebEnabled: true),
platform: FakePlatform(),
).workflows;
expect(
workflows,
contains(isA<WebWorkflow>()),
);
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => fakeProcessManager,
});
testUsingContext('CustomDevicesWorkflow is a part of validator workflows if enabled', () async {
final List<Workflow> workflows = DoctorValidatorsProvider.test(
featureFlags: TestFeatureFlags(areCustomDevicesEnabled: true),
platform: FakePlatform(),
).workflows;
expect(
workflows,
contains(isA<CustomDeviceWorkflow>()),
);
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => fakeProcessManager,
});
group('FlutterValidator', () {
late FakeFlutterVersion initialVersion;
late FakeFlutterVersion secondVersion;
late TestFeatureFlags featureFlags;
setUp(() {
secondVersion = FakeFlutterVersion(frameworkRevisionShort: '222');
initialVersion = FakeFlutterVersion(
frameworkRevisionShort: '111',
nextFlutterVersion: secondVersion,
);
featureFlags = TestFeatureFlags();
});
testUsingContext('FlutterValidator fetches tags and gets fresh version', () async {
final Directory devtoolsDir = fs.directory('/path/to/flutter/bin/cache/dart-sdk/bin/resources/devtools')
..createSync(recursive: true);
fs.directory('/path/to/flutter/bin/cache/artifacts').createSync(recursive: true);
devtoolsDir.childFile('version.json').writeAsStringSync('{"version": "123"}');
fakeProcessManager.addCommands(const <FakeCommand>[
FakeCommand(command: <String>['which', 'java']),
]);
final List<DoctorValidator> validators = DoctorValidatorsProvider.test(
featureFlags: featureFlags,
platform: FakePlatform(),
).validators;
final FlutterValidator flutterValidator = validators.whereType<FlutterValidator>().first;
final ValidationResult result = await flutterValidator.validate();
expect(
result.messages.map((ValidationMessage msg) => msg.message),
contains(contains('Framework revision 222')),
);
}, overrides: <Type, Generator>{
Cache: () => Cache.test(
rootOverride: fs.directory('/path/to/flutter'),
fileSystem: fs,
processManager: fakeProcessManager,
),
FileSystem: () => fs,
FlutterVersion: () => initialVersion,
Platform: () => FakePlatform(),
ProcessManager: () => fakeProcessManager,
TestFeatureFlags: () => featureFlags,
});
});
testUsingContext('If android workflow is disabled, AndroidStudio validator is not included', () {
final DoctorValidatorsProvider provider = DoctorValidatorsProvider.test(
featureFlags: TestFeatureFlags(isAndroidEnabled: false),
);
expect(provider.validators, isNot(contains(isA<AndroidStudioValidator>())));
expect(provider.validators, isNot(contains(isA<NoAndroidStudioValidator>())));
}, overrides: <Type, Generator>{
AndroidWorkflow: () => FakeAndroidWorkflow(appliesToHostPlatform: false),
});
group('Doctor events with unified_analytics', () {
late FakeAnalytics fakeAnalytics;
final FakeFlutterVersion fakeFlutterVersion = FakeFlutterVersion();
final DateTime fakeDate = DateTime(1995, 3, 3);
final SystemClock fakeSystemClock = SystemClock.fixed(fakeDate);
setUp(() {
fakeAnalytics = getInitializedFakeAnalyticsInstance(
fakeFlutterVersion: fakeFlutterVersion,
fs: fs,
);
});
testUsingContext('ensure fake is being used and initialized', () {
expect(fakeAnalytics.sentEvents.length, 0);
expect(fakeAnalytics.okToSend, true);
}, overrides: <Type, Generator>{
Analytics: () => fakeAnalytics,
});
testUsingContext('contains installed', () async {
final Doctor doctor = Doctor(logger: logger, clock: fakeSystemClock, analytics: fakeAnalytics);
await doctor.diagnose(verbose: false);
expect(fakeAnalytics.sentEvents.length, 3);
// The event that should have been fired off during the doctor invocation
final Event eventToFind = Event.doctorValidatorResult(
validatorName: 'Passing Validator',
result: 'installed',
partOfGroupedValidator: false,
doctorInvocationId: DateTime(1995, 3, 3).millisecondsSinceEpoch,
statusInfo: 'with statusInfo',
);
expect(fakeAnalytics.sentEvents, contains(eventToFind));
}, overrides: <Type, Generator>{
DoctorValidatorsProvider: () => FakeDoctorValidatorsProvider(),
});
testUsingContext('contains installed and partial', () async {
await FakePassingDoctor(logger, clock: fakeSystemClock).diagnose(verbose: false);
expect(fakeAnalytics.sentEvents, hasLength(4));
expect(fakeAnalytics.sentEvents, unorderedEquals(<Event>[
Event.doctorValidatorResult(
validatorName: 'Passing Validator',
result: 'installed',
partOfGroupedValidator: false,
doctorInvocationId: fakeDate.millisecondsSinceEpoch,
statusInfo: 'with statusInfo',
),
Event.doctorValidatorResult(
validatorName: 'Partial Validator with only a Hint',
result: 'partial',
partOfGroupedValidator: false,
doctorInvocationId: fakeDate.millisecondsSinceEpoch,
),
Event.doctorValidatorResult(
validatorName: 'Partial Validator with Errors',
result: 'partial',
partOfGroupedValidator: false,
doctorInvocationId: fakeDate.millisecondsSinceEpoch,
),
Event.doctorValidatorResult(
validatorName: 'Another Passing Validator',
result: 'installed',
partOfGroupedValidator: false,
doctorInvocationId: fakeDate.millisecondsSinceEpoch,
statusInfo: 'with statusInfo',
),
]));
}, overrides: <Type, Generator>{
DoctorValidatorsProvider: () => FakeDoctorValidatorsProvider(),
Analytics: () => fakeAnalytics,
});
testUsingContext('contains installed, missing and partial', () async {
await FakeDoctor(logger, clock: fakeSystemClock).diagnose(verbose: false);
expect(fakeAnalytics.sentEvents, hasLength(5));
expect(fakeAnalytics.sentEvents, unorderedEquals(<Event>[
Event.doctorValidatorResult(
validatorName: 'Passing Validator',
result: 'installed',
partOfGroupedValidator: false,
doctorInvocationId: fakeDate.millisecondsSinceEpoch,
statusInfo: 'with statusInfo',
),
Event.doctorValidatorResult(
validatorName: 'Missing Validator',
result: 'missing',
partOfGroupedValidator: false,
doctorInvocationId: fakeDate.millisecondsSinceEpoch,
),
Event.doctorValidatorResult(
validatorName: 'Not Available Validator',
result: 'notAvailable',
partOfGroupedValidator: false,
doctorInvocationId: fakeDate.millisecondsSinceEpoch,
),
Event.doctorValidatorResult(
validatorName: 'Partial Validator with only a Hint',
result: 'partial',
partOfGroupedValidator: false,
doctorInvocationId: fakeDate.millisecondsSinceEpoch,
),
Event.doctorValidatorResult(
validatorName: 'Partial Validator with Errors',
result: 'partial',
partOfGroupedValidator: false,
doctorInvocationId: fakeDate.millisecondsSinceEpoch,
),
]));
}, overrides: <Type, Generator>{
DoctorValidatorsProvider: () => FakeDoctorValidatorsProvider(),
Analytics: () => fakeAnalytics,
});
testUsingContext('events for grouped validators are properly decomposed', () async {
await FakeGroupedDoctor(logger, clock: fakeSystemClock).diagnose(verbose: false);
expect(fakeAnalytics.sentEvents, hasLength(4));
expect(fakeAnalytics.sentEvents, unorderedEquals(<Event>[
Event.doctorValidatorResult(
validatorName: 'Category 1',
result: 'installed',
partOfGroupedValidator: true,
doctorInvocationId: fakeDate.millisecondsSinceEpoch,
),
Event.doctorValidatorResult(
validatorName: 'Category 1',
result: 'installed',
partOfGroupedValidator: true,
doctorInvocationId: fakeDate.millisecondsSinceEpoch,
),
Event.doctorValidatorResult(
validatorName: 'Category 2',
result: 'installed',
partOfGroupedValidator: true,
doctorInvocationId: fakeDate.millisecondsSinceEpoch,
),
Event.doctorValidatorResult(
validatorName: 'Category 2',
result: 'missing',
partOfGroupedValidator: true,
doctorInvocationId: fakeDate.millisecondsSinceEpoch,
),
]));
}, overrides: <Type, Generator>{
DoctorValidatorsProvider: () => FakeDoctorValidatorsProvider(),
Analytics: () => fakeAnalytics,
});
testUsingContext('grouped validator subresult and subvalidators different lengths', () async {
final FakeGroupedDoctorWithCrash fakeDoctor = FakeGroupedDoctorWithCrash(logger, clock: fakeSystemClock);
await fakeDoctor.diagnose(verbose: false);
expect(fakeDoctor.validators, hasLength(1));
expect(fakeDoctor.validators.first.runtimeType == FakeGroupedValidatorWithCrash, true);
expect(fakeAnalytics.sentEvents, hasLength(0));
// Attempt to send a random event to ensure that the
// analytics package is still working, despite not sending
// above (as expected)
final Event testEvent = Event.analyticsCollectionEnabled(status: true);
fakeAnalytics.send(testEvent);
expect(fakeAnalytics.sentEvents, hasLength(1));
expect(fakeAnalytics.sentEvents, contains(testEvent));
}, overrides: <Type, Generator>{Analytics: () => fakeAnalytics});
testUsingContext('sending events can be skipped', () async {
await FakePassingDoctor(logger).diagnose(verbose: false, sendEvent: false);
expect(fakeAnalytics.sentEvents, isEmpty);
}
,overrides: <Type, Generator>{Analytics: () => fakeAnalytics});
});
}
class FakeAndroidWorkflow extends Fake implements AndroidWorkflow {
FakeAndroidWorkflow({
this.canListDevices = true,
this.appliesToHostPlatform = true,
});
@override
final bool canListDevices;
@override
final bool appliesToHostPlatform;
}
class PassingValidator extends DoctorValidator {
PassingValidator(super.title);
@override
Future<ValidationResult> validate() async {
const List<ValidationMessage> messages = <ValidationMessage>[
ValidationMessage('A helpful message'),
ValidationMessage('A second, somewhat longer helpful message'),
];
return const ValidationResult(ValidationType.success, messages, statusInfo: 'with statusInfo');
}
}
class PiiValidator extends DoctorValidator {
PiiValidator() : super('PII Validator');
@override
Future<ValidationResult> validate() async {
const List<ValidationMessage> messages = <ValidationMessage>[
ValidationMessage('Contains PII path/to/username', piiStrippedMessage: 'Does not contain PII'),
];
return const ValidationResult(ValidationType.success, messages);
}
}
class MissingValidator extends DoctorValidator {
MissingValidator() : super('Missing Validator');
@override
Future<ValidationResult> validate() async {
const List<ValidationMessage> messages = <ValidationMessage>[
ValidationMessage.error('A useful error message'),
ValidationMessage('A message that is not an error'),
ValidationMessage.hint('A hint message'),
];
return const ValidationResult(ValidationType.missing, messages);
}
}
class NotAvailableValidator extends DoctorValidator {
NotAvailableValidator() : super('Not Available Validator');
@override
Future<ValidationResult> validate() async {
const List<ValidationMessage> messages = <ValidationMessage>[
ValidationMessage.error('A useful error message'),
ValidationMessage('A message that is not an error'),
ValidationMessage.hint('A hint message'),
];
return const ValidationResult(ValidationType.notAvailable, messages);
}
}
class StuckValidator extends DoctorValidator {
StuckValidator() : super('Stuck validator that never completes');
@override
Future<ValidationResult> validate() {
final Completer<ValidationResult> completer = Completer<ValidationResult>();
// This future will never complete
return completer.future;
}
}
class PartialValidatorWithErrors extends DoctorValidator {
PartialValidatorWithErrors() : super('Partial Validator with Errors');
@override
Future<ValidationResult> validate() async {
const List<ValidationMessage> messages = <ValidationMessage>[
ValidationMessage.error('An error message indicating partial installation'),
ValidationMessage.hint('Maybe a hint will help the user'),
ValidationMessage('An extra message with some verbose details'),
];
return const ValidationResult(ValidationType.partial, messages);
}
}
class PartialValidatorWithHintsOnly extends DoctorValidator {
PartialValidatorWithHintsOnly() : super('Partial Validator with only a Hint');
@override
Future<ValidationResult> validate() async {
const List<ValidationMessage> messages = <ValidationMessage>[
ValidationMessage.hint('There is a hint here'),
ValidationMessage('But there is no error'),
];
return const ValidationResult(ValidationType.partial, messages);
}
}
class CrashingValidator extends DoctorValidator {
CrashingValidator() : super('Crashing validator');
@override
Future<ValidationResult> validate() async {
throw StateError('fatal error');
}
}
class AsyncCrashingValidator extends DoctorValidator {
AsyncCrashingValidator(this._time) : super('Async crashing validator');
final FakeAsync _time;
@override
Future<ValidationResult> validate() {
const Duration delay = Duration(seconds: 1);
final Future<ValidationResult> result = Future<ValidationResult>.delayed(
delay,
() => throw StateError('fatal error'),
);
_time.elapse(const Duration(seconds: 1));
_time.flushMicrotasks();
return result;
}
}
/// A doctor that fails with a missing [ValidationResult].
class FakeDoctor extends Doctor {
FakeDoctor(Logger logger, {super.clock = const SystemClock()})
: super(logger: logger);
@override
late final List<DoctorValidator> validators = <DoctorValidator>[
PassingValidator('Passing Validator'),
MissingValidator(),
NotAvailableValidator(),
PartialValidatorWithHintsOnly(),
PartialValidatorWithErrors(),
];
}
/// A doctor that should pass, but still has issues in some categories.
class FakePassingDoctor extends Doctor {
FakePassingDoctor(Logger logger, {super.clock = const SystemClock()})
: super(logger: logger);
@override
late final List<DoctorValidator> validators = <DoctorValidator>[
PassingValidator('Passing Validator'),
PartialValidatorWithHintsOnly(),
PartialValidatorWithErrors(),
PassingValidator('Another Passing Validator'),
];
}
/// A doctor that should pass, but still has 1 issue to test the singular of
/// categories.
class FakeSinglePassingDoctor extends Doctor {
FakeSinglePassingDoctor(Logger logger, {super.clock = const SystemClock()})
: super(logger: logger);
@override
late final List<DoctorValidator> validators = <DoctorValidator>[
PartialValidatorWithHintsOnly(),
];
}
/// A doctor that passes and has no issues anywhere.
class FakeQuietDoctor extends Doctor {
FakeQuietDoctor(Logger logger, {super.clock = const SystemClock()})
: super(logger: logger);
@override
late final List<DoctorValidator> validators = <DoctorValidator>[
PassingValidator('Passing Validator'),
PassingValidator('Another Passing Validator'),
PassingValidator('Validators are fun'),
PassingValidator('Four score and seven validators ago'),
];
}
/// A doctor that passes and contains PII that can be hidden.
class FakePiiDoctor extends Doctor {
FakePiiDoctor(Logger logger, {super.clock = const SystemClock()})
: super(logger: logger);
@override
late final List<DoctorValidator> validators = <DoctorValidator>[
PiiValidator(),
];
}
/// A doctor with a validator that throws an exception.
class FakeCrashingDoctor extends Doctor {
FakeCrashingDoctor(Logger logger, {super.clock = const SystemClock()})
: super(logger: logger);
@override
late final List<DoctorValidator> validators = <DoctorValidator>[
PassingValidator('Passing Validator'),
PassingValidator('Another Passing Validator'),
CrashingValidator(),
PassingValidator('Validators are fun'),
PassingValidator('Four score and seven validators ago'),
];
}
/// A doctor with a validator that will never finish.
class FakeAsyncStuckDoctor extends Doctor {
FakeAsyncStuckDoctor(Logger logger, {super.clock = const SystemClock()})
: super(logger: logger);
@override
late final List<DoctorValidator> validators = <DoctorValidator>[
PassingValidator('Passing Validator'),
PassingValidator('Another Passing Validator'),
StuckValidator(),
PassingValidator('Validators are fun'),
PassingValidator('Four score and seven validators ago'),
];
}
/// A doctor with a validator that throws an exception.
class FakeAsyncCrashingDoctor extends Doctor {
FakeAsyncCrashingDoctor(this._time, Logger logger,
{super.clock = const SystemClock()})
: super(logger: logger);
final FakeAsync _time;
@override
late final List<DoctorValidator> validators = <DoctorValidator>[
PassingValidator('Passing Validator'),
PassingValidator('Another Passing Validator'),
AsyncCrashingValidator(_time),
PassingValidator('Validators are fun'),
PassingValidator('Four score and seven validators ago'),
];
}
/// A DoctorValidatorsProvider that overrides the default validators without
/// overriding the doctor.
class FakeDoctorValidatorsProvider implements DoctorValidatorsProvider {
@override
List<DoctorValidator> get validators {
return <DoctorValidator>[
PassingValidator('Passing Validator'),
PassingValidator('Another Passing Validator'),
PassingValidator('Providing validators is fun'),
];
}
@override
List<Workflow> get workflows => <Workflow>[];
}
class PassingGroupedValidator extends DoctorValidator {
PassingGroupedValidator(super.title);
@override
Future<ValidationResult> validate() async {
const List<ValidationMessage> messages = <ValidationMessage>[
ValidationMessage('A helpful message'),
];
return const ValidationResult(ValidationType.success, messages);
}
}
class MissingGroupedValidator extends DoctorValidator {
MissingGroupedValidator(super.title);
@override
Future<ValidationResult> validate() async {
const List<ValidationMessage> messages = <ValidationMessage>[
ValidationMessage.error('A useful error message'),
];
return const ValidationResult(ValidationType.missing, messages);
}
}
class PartialGroupedValidator extends DoctorValidator {
PartialGroupedValidator(super.title);
@override
Future<ValidationResult> validate() async {
const List<ValidationMessage> messages = <ValidationMessage>[
ValidationMessage.error('An error message for partial installation'),
];
return const ValidationResult(ValidationType.partial, messages);
}
}
class PassingGroupedValidatorWithStatus extends DoctorValidator {
PassingGroupedValidatorWithStatus(super.title);
@override
Future<ValidationResult> validate() async {
const List<ValidationMessage> messages = <ValidationMessage>[
ValidationMessage('A different message'),
];
return const ValidationResult(ValidationType.success, messages, statusInfo: 'A status message');
}
}
/// A doctor that has two groups of two validators each.
class FakeGroupedDoctor extends Doctor {
FakeGroupedDoctor(Logger logger, {super.clock = const SystemClock()})
: super(logger: logger);
@override
late final List<DoctorValidator> validators = <DoctorValidator>[
GroupedValidator(<DoctorValidator>[
PassingGroupedValidator('Category 1'),
PassingGroupedValidator('Category 1'),
]),
GroupedValidator(<DoctorValidator>[
PassingGroupedValidator('Category 2'),
MissingGroupedValidator('Category 2'),
]),
];
}
/// Fake grouped doctor that is intended to be used with [FakeGroupedValidatorWithCrash].
class FakeGroupedDoctorWithCrash extends Doctor {
FakeGroupedDoctorWithCrash(Logger logger, {super.clock = const SystemClock()})
: super(logger: logger);
@override
late final List<DoctorValidator> validators = <DoctorValidator>[
FakeGroupedValidatorWithCrash(<DoctorValidator>[
PassingGroupedValidator('Category 1'),
PassingGroupedValidator('Category 1'),
]),
];
}
/// This extended grouped validator will have a list of sub validators
/// provided in the constructor, but it will have no [subResults] in the
/// list which simulates what happens if a validator crashes.
///
/// Usually, the grouped validators have 2 lists, a [subValidators] and
/// a [subResults] list, and if nothing crashes, those 2 lists will have the
/// same length. This fake is simulating what happens when the validators
/// crash and results in no results getting returned.
class FakeGroupedValidatorWithCrash extends GroupedValidator {
FakeGroupedValidatorWithCrash(super.subValidators);
@override
List<ValidationResult> get subResults => <ValidationResult>[];
}
class FakeGroupedDoctorWithStatus extends Doctor {
FakeGroupedDoctorWithStatus(Logger logger,
{super.clock = const SystemClock()})
: super(logger: logger);
@override
late final List<DoctorValidator> validators = <DoctorValidator>[
GroupedValidator(<DoctorValidator>[
PassingGroupedValidator('First validator title'),
PassingGroupedValidatorWithStatus('Second validator title'),
]),
];
}
/// A doctor that takes any two validators. Used to check behavior when
/// merging ValidationTypes (installed, missing, partial).
class FakeSmallGroupDoctor extends Doctor {
FakeSmallGroupDoctor(
Logger logger, DoctorValidator val1, DoctorValidator val2,
{super.clock = const SystemClock()})
: validators = <DoctorValidator>[GroupedValidator(<DoctorValidator>[val1, val2])],
super(logger: logger);
@override
final List<DoctorValidator> validators;
}
class VsCodeValidatorTestTargets extends VsCodeValidator {
VsCodeValidatorTestTargets._(String installDirectory, String extensionDirectory, {String? edition})
: super(VsCode.fromDirectory(installDirectory, extensionDirectory, edition: edition, fileSystem: globals.fs));
static VsCodeValidatorTestTargets get installedWithExtension =>
VsCodeValidatorTestTargets._(validInstall, validExtensions);
static VsCodeValidatorTestTargets get installedWithExtension64bit =>
VsCodeValidatorTestTargets._(validInstall, validExtensions, edition: '64-bit edition');
static VsCodeValidatorTestTargets get installedWithoutExtension =>
VsCodeValidatorTestTargets._(validInstall, missingExtensions);
static final String validInstall = globals.fs.path.join('test', 'data', 'vscode', 'application');
static final String validExtensions = globals.fs.path.join('test', 'data', 'vscode', 'extensions');
static final String missingExtensions = globals.fs.path.join('test', 'data', 'vscode', 'notExtensions');
}
class FakeDeviceManager extends Fake implements DeviceManager {
List<String> diagnostics = <String>[];
List<Device> devices = <Device>[];
@override
Future<List<Device>> getAllDevices({
DeviceDiscoveryFilter? filter,
}) async => devices;
@override
Future<List<Device>> refreshAllDevices({
Duration? timeout,
DeviceDiscoveryFilter? filter,
}) async => devices;
@override
Future<List<String>> getDeviceDiagnostics() async => diagnostics;
}
class FakeDevice extends Fake implements Device {
@override
String get name => 'name';
@override
String get id => 'device-id';
@override
Category get category => Category.mobile;
@override
bool isSupported() => true;
@override
Future<bool> get isLocalEmulator async => false;
@override
Future<String> get targetPlatformDisplayName async => 'android';
@override
Future<String> get sdkNameAndVersion async => '1.2.3';
@override
Future<TargetPlatform> get targetPlatform => Future<TargetPlatform>.value(TargetPlatform.android);
}
class FakeTerminal extends Fake implements AnsiTerminal {
@override
final bool supportsColor = false;
@override
bool get isCliAnimationEnabled => supportsColor;
}
| flutter/packages/flutter_tools/test/commands.shard/hermetic/doctor_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/commands.shard/hermetic/doctor_test.dart",
"repo_id": "flutter",
"token_count": 20528
} | 804 |
// 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/memory.dart';
import 'package:flutter_tools/src/base/common.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/shell_completion.dart';
import 'package:flutter_tools/src/globals.dart' as globals;
import '../../src/context.dart';
import '../../src/fakes.dart';
import '../../src/test_flutter_command_runner.dart';
void main() {
group('shell_completion', () {
late FakeStdio fakeStdio;
setUp(() {
Cache.disableLocking();
fakeStdio = FakeStdio()..stdout.terminalColumns = 80;
});
testUsingContext('generates bash initialization script to stdout', () async {
final ShellCompletionCommand command = ShellCompletionCommand();
await createTestCommandRunner(command).run(<String>['bash-completion']);
expect(fakeStdio.writtenToStdout.length, equals(1));
expect(fakeStdio.writtenToStdout.first, contains('__flutter_completion'));
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => FakeProcessManager.any(),
Stdio: () => fakeStdio,
});
testUsingContext('generates bash initialization script to stdout with arg', () async {
final ShellCompletionCommand command = ShellCompletionCommand();
await createTestCommandRunner(command).run(<String>['bash-completion', '-']);
expect(fakeStdio.writtenToStdout.length, equals(1));
expect(fakeStdio.writtenToStdout.first, contains('__flutter_completion'));
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => FakeProcessManager.any(),
Stdio: () => fakeStdio,
});
testUsingContext('generates bash initialization script to output file', () async {
final ShellCompletionCommand command = ShellCompletionCommand();
const String outputFile = 'bash-setup.sh';
await createTestCommandRunner(command).run(
<String>['bash-completion', outputFile],
);
expect(globals.fs.isFileSync(outputFile), isTrue);
expect(globals.fs.file(outputFile).readAsStringSync(), contains('__flutter_completion'));
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => FakeProcessManager.any(),
Stdio: () => fakeStdio,
});
testUsingContext("won't overwrite existing output file ", () async {
final ShellCompletionCommand command = ShellCompletionCommand();
const String outputFile = 'bash-setup.sh';
globals.fs.file(outputFile).createSync();
await expectLater(
() => createTestCommandRunner(command).run(
<String>['bash-completion', outputFile],
),
throwsA(
isA<ToolExit>()
.having((ToolExit error) => error.exitCode, 'exitCode', anyOf(isNull, 1))
.having((ToolExit error) => error.message, 'message', contains('Use --overwrite')),
),
);
expect(globals.fs.isFileSync(outputFile), isTrue);
expect(globals.fs.file(outputFile).readAsStringSync(), isEmpty);
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => FakeProcessManager.any(),
Stdio: () => fakeStdio,
});
testUsingContext('will overwrite existing output file if given --overwrite', () async {
final ShellCompletionCommand command = ShellCompletionCommand();
const String outputFile = 'bash-setup.sh';
globals.fs.file(outputFile).createSync();
await createTestCommandRunner(command).run(
<String>['bash-completion', '--overwrite', outputFile],
);
expect(globals.fs.isFileSync(outputFile), isTrue);
expect(globals.fs.file(outputFile).readAsStringSync(), contains('__flutter_completion'));
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => FakeProcessManager.any(),
Stdio: () => fakeStdio,
});
});
}
| flutter/packages/flutter_tools/test/commands.shard/hermetic/shell_completion_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/commands.shard/hermetic/shell_completion_test.dart",
"repo_id": "flutter",
"token_count": 1544
} | 805 |
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQC/Vj4UCdQIN0IMCHDWwDo3QyH9I8sBm/OwIiiJbQ0RpyfWCn4i
lzZwu98okwUCu5PwlFQZd67aDooxhFS2FSw4iRZCUGJlgV7BG1JX9q0xqVy33V6r
xFFYQYHw6r7FHPaw2FuRCOoiuDqE+ua6lbV2YP/eXiRnq5hT5vWfEX5rYwIDAQAB
AoGAaL5oq4WZ2omNkZLJWvbOp9QLdk2y44WhSOnaMSlOvzw3tZf25y7KcbqXdtnN
I2rWmRxKUcrQILVW97aOvUMn+jOCN6+IY1kiT6Un4H1Ow+rVj3CDvCjBCZhfkExK
osTzpwbiRyHueWOLOB3RZUNXC+5OfTBVoYgQp85INykwUHECQQD10XsOKDtkuCh4
yNf68lXC7TUSPAwAjX+I4xJ1UWMO5DWBpuyuA2GSlYHWZg4ae0xm9zUijb6A5WDW
aVTvi9S5AkEAx0MSU2qD837lXAjkcyBS9WqtoJebC263uUaiQ8WZQhDE+R8aeXj+
e80hY8FOc6WogC2VbQgYO52t82KWLDKq+wJAS+2Xl+jfZ53mimBnLhE6YkpIsUgw
4N7T/OE+q1QnR8s/p7t6sclDkzZw81t0kcNx9v/2vqSPqlqvjardXFyRqQJBAIAW
jWExx0BvAeD3lmKrFKjNum7RBcmDknZ3ATevfaUKQpQhelM7g9rxMdV+HYAZrQc4
RiWgXnN0GK2rYf1nVKECQQCo5UHoukW89+UX/SbamoMeUZJxL3bQAqv71B59C6cy
NQuDZlHOqDajyxaX2y8tJWgk3ciGXlIqByHQFXb2Rhuw
-----END RSA PRIVATE KEY-----
| flutter/packages/flutter_tools/test/data/asset_test/tls_cert/dummy-key.pem/0 | {
"file_path": "flutter/packages/flutter_tools/test/data/asset_test/tls_cert/dummy-key.pem",
"repo_id": "flutter",
"token_count": 677
} | 806 |
// 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/memory.dart';
import 'package:flutter_tools/src/android/android_sdk.dart';
import 'package:flutter_tools/src/android/android_workflow.dart';
import 'package:flutter_tools/src/android/java.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/user_messages.dart';
import 'package:flutter_tools/src/base/version.dart';
import 'package:flutter_tools/src/doctor_validator.dart';
import 'package:test/fake.dart';
import '../../src/common.dart';
import '../../src/context.dart';
import '../../src/fake_process_manager.dart';
import '../../src/fakes.dart';
void main() {
late FakeAndroidSdk sdk;
late Logger logger;
late MemoryFileSystem fileSystem;
late FakeProcessManager processManager;
late FakeStdio stdio;
setUp(() {
sdk = FakeAndroidSdk();
fileSystem = MemoryFileSystem.test();
fileSystem.directory('/home/me').createSync(recursive: true);
logger = BufferLogger.test();
processManager = FakeProcessManager.empty();
stdio = FakeStdio();
});
testWithoutContext('AndroidWorkflow handles a null AndroidSDK', () {
final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(),
androidSdk: null,
);
expect(androidWorkflow.canLaunchDevices, false);
expect(androidWorkflow.canListDevices, false);
expect(androidWorkflow.canListEmulators, false);
});
testWithoutContext('AndroidWorkflow handles a null adb', () {
final FakeAndroidSdk androidSdk = FakeAndroidSdk();
androidSdk.adbPath = null;
final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(),
androidSdk: androidSdk,
);
expect(androidWorkflow.canLaunchDevices, false);
expect(androidWorkflow.canListDevices, false);
expect(androidWorkflow.canListEmulators, false);
});
// Android SDK is actually supported on Linux Arm64 hosts.
testWithoutContext('Support for Android SDK on Linux Arm Hosts', () {
final FakeAndroidSdk androidSdk = FakeAndroidSdk();
androidSdk.adbPath = null;
final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(),
androidSdk: androidSdk,
);
expect(androidWorkflow.appliesToHostPlatform, isTrue);
expect(androidWorkflow.canLaunchDevices, isFalse);
expect(androidWorkflow.canListDevices, isFalse);
expect(androidWorkflow.canListEmulators, isFalse);
});
testWithoutContext('AndroidWorkflow is disabled if feature is disabled', () {
final FakeAndroidSdk androidSdk = FakeAndroidSdk();
androidSdk.adbPath = 'path/to/adb';
final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(isAndroidEnabled: false),
androidSdk: androidSdk,
);
expect(androidWorkflow.appliesToHostPlatform, false);
expect(androidWorkflow.canLaunchDevices, false);
expect(androidWorkflow.canListDevices, false);
expect(androidWorkflow.canListEmulators, false);
});
testWithoutContext('AndroidWorkflow cannot list emulators if emulatorPath is null', () {
final FakeAndroidSdk androidSdk = FakeAndroidSdk();
androidSdk.adbPath = 'path/to/adb';
final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(),
androidSdk: androidSdk,
);
expect(androidWorkflow.appliesToHostPlatform, true);
expect(androidWorkflow.canLaunchDevices, true);
expect(androidWorkflow.canListDevices, true);
expect(androidWorkflow.canListEmulators, false);
});
testWithoutContext('AndroidWorkflow can list emulators', () {
final FakeAndroidSdk androidSdk = FakeAndroidSdk();
androidSdk.adbPath = 'path/to/adb';
androidSdk.emulatorPath = 'path/to/emulator';
final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(),
androidSdk: androidSdk,
);
expect(androidWorkflow.appliesToHostPlatform, true);
expect(androidWorkflow.canLaunchDevices, true);
expect(androidWorkflow.canListDevices, true);
expect(androidWorkflow.canListEmulators, true);
});
testWithoutContext('licensesAccepted returns LicensesAccepted.unknown if cannot find sdkmanager', () async {
sdk.sdkManagerPath = '/foo/bar/sdkmanager';
processManager.excludedExecutables.add('/foo/bar/sdkmanager');
final AndroidLicenseValidator licenseValidator = AndroidLicenseValidator(
java: FakeJava(),
androidSdk: sdk,
processManager: processManager,
platform: FakePlatform(environment: <String, String>{'HOME': '/home/me'}),
stdio: stdio,
logger: BufferLogger.test(),
userMessages: UserMessages(),
);
final LicensesAccepted licenseStatus = await licenseValidator.licensesAccepted;
expect(licenseStatus, LicensesAccepted.unknown);
});
testWithoutContext('licensesAccepted returns LicensesAccepted.unknown if cannot run sdkmanager', () async {
sdk.sdkManagerPath = '/foo/bar/sdkmanager';
processManager.excludedExecutables.add('/foo/bar/sdkmanager');
final AndroidLicenseValidator licenseValidator = AndroidLicenseValidator(
java: FakeJava(),
androidSdk: sdk,
processManager: processManager,
platform: FakePlatform(environment: <String, String>{'HOME': '/home/me'}),
stdio: stdio,
logger: BufferLogger.test(),
userMessages: UserMessages(),
);
final LicensesAccepted licenseStatus = await licenseValidator.licensesAccepted;
expect(licenseStatus, LicensesAccepted.unknown);
});
testWithoutContext('licensesAccepted handles garbage/no output', () async {
sdk.sdkManagerPath = '/foo/bar/sdkmanager';
processManager.addCommand(const FakeCommand(
command: <String>[
'/foo/bar/sdkmanager',
'--licenses',
], stdout: 'asdasassad',
));
final AndroidLicenseValidator licenseValidator = AndroidLicenseValidator(
java: FakeJava(),
androidSdk: sdk,
processManager: processManager,
platform: FakePlatform(environment: <String, String>{'HOME': '/home/me'}),
stdio: stdio,
logger: BufferLogger.test(),
userMessages: UserMessages(),
);
final LicensesAccepted result = await licenseValidator.licensesAccepted;
expect(result, LicensesAccepted.unknown);
});
testWithoutContext('licensesAccepted works for all licenses accepted', () async {
sdk.sdkManagerPath = '/foo/bar/sdkmanager';
const String output = '''
[=======================================] 100% Computing updates...
All SDK package licenses accepted.
''';
processManager.addCommand(const FakeCommand(
command: <String>[
'/foo/bar/sdkmanager',
'--licenses',
], stdout: output,
));
final AndroidLicenseValidator licenseValidator = AndroidLicenseValidator(
java: FakeJava(),
androidSdk: sdk,
processManager: processManager,
platform: FakePlatform(environment: <String, String>{'HOME': '/home/me'}),
stdio: stdio,
logger: BufferLogger.test(),
userMessages: UserMessages(),
);
final LicensesAccepted result = await licenseValidator.licensesAccepted;
expect(result, LicensesAccepted.all);
});
testWithoutContext('licensesAccepted sets environment for finding java', () async {
final Java java = FakeJava();
sdk.sdkManagerPath = '/foo/bar/sdkmanager';
processManager.addCommand(
FakeCommand(
command: <String>[sdk.sdkManagerPath!, '--licenses'],
stdout: 'All SDK package licenses accepted.',
environment: <String, String>{
'JAVA_HOME': java.javaHome!,
'PATH': fileSystem.path.join(java.javaHome!, 'bin'),
}
)
);
final AndroidLicenseValidator licenseValidator = AndroidLicenseValidator(
java: java,
androidSdk: sdk,
processManager: processManager,
platform: FakePlatform(environment: <String, String>{'HOME': '/home/me'}),
stdio: stdio,
logger: BufferLogger.test(),
userMessages: UserMessages(),
);
final LicensesAccepted licenseStatus = await licenseValidator.licensesAccepted;
expect(licenseStatus, LicensesAccepted.all);
});
testWithoutContext('licensesAccepted works for some licenses accepted', () async {
sdk.sdkManagerPath = '/foo/bar/sdkmanager';
const String output = '''
[=======================================] 100% Computing updates...
2 of 5 SDK package licenses not accepted.
Review licenses that have not been accepted (y/N)?
''';
processManager.addCommand(const FakeCommand(
command: <String>[
'/foo/bar/sdkmanager',
'--licenses',
], stdout: output,
));
final AndroidLicenseValidator licenseValidator = AndroidLicenseValidator(
java: FakeJava(),
androidSdk: sdk,
processManager: processManager,
platform: FakePlatform(environment: <String, String>{'HOME': '/home/me'}),
stdio: stdio,
logger: BufferLogger.test(),
userMessages: UserMessages(),
);
final LicensesAccepted result = await licenseValidator.licensesAccepted;
expect(result, LicensesAccepted.some);
});
testWithoutContext('licensesAccepted works for no licenses accepted', () async {
sdk.sdkManagerPath = '/foo/bar/sdkmanager';
const String output = '''
[=======================================] 100% Computing updates...
5 of 5 SDK package licenses not accepted.
Review licenses that have not been accepted (y/N)?
''';
processManager.addCommand(const FakeCommand(
command: <String>[
'/foo/bar/sdkmanager',
'--licenses',
], stdout: output,
));
final AndroidLicenseValidator licenseValidator = AndroidLicenseValidator(
java: FakeJava(),
androidSdk: sdk,
processManager: processManager,
platform: FakePlatform(environment: <String, String>{'HOME': '/home/me'}),
stdio: stdio,
logger: BufferLogger.test(),
userMessages: UserMessages(),
);
final LicensesAccepted result = await licenseValidator.licensesAccepted;
expect(result, LicensesAccepted.none);
});
testWithoutContext('runLicenseManager succeeds for version >= 26', () async {
sdk.sdkManagerPath = '/foo/bar/sdkmanager';
sdk.sdkManagerVersion = '26.0.0';
processManager.addCommand(const FakeCommand(
command: <String>[
'/foo/bar/sdkmanager',
'--licenses',
],
));
final AndroidLicenseValidator licenseValidator = AndroidLicenseValidator(
java: FakeJava(),
androidSdk: sdk,
processManager: processManager,
platform: FakePlatform(environment: <String, String>{'HOME': '/home/me'}),
stdio: stdio,
logger: BufferLogger.test(),
userMessages: UserMessages(),
);
expect(await licenseValidator.runLicenseManager(), isTrue);
});
testWithoutContext('runLicenseManager errors when sdkmanager is not found', () async {
sdk.sdkManagerPath = '/foo/bar/sdkmanager';
processManager.excludedExecutables.add('/foo/bar/sdkmanager');
final AndroidLicenseValidator licenseValidator = AndroidLicenseValidator(
java: FakeJava(),
androidSdk: sdk,
processManager: processManager,
platform: FakePlatform(environment: <String, String>{'HOME': '/home/me'}),
stdio: stdio,
logger: BufferLogger.test(),
userMessages: UserMessages(),
);
expect(licenseValidator.runLicenseManager(), throwsToolExit());
});
testWithoutContext('runLicenseManager handles broken pipe without ArgumentError', () async {
sdk.sdkManagerPath = '/foo/bar/sdkmanager';
const String exceptionMessage = 'Write failed (OS Error: Broken pipe, errno = 32), port = 0';
const SocketException exception = SocketException(exceptionMessage);
// By using a `Socket` generic parameter, the stdin.addStream will return a `Future<Socket>`
// We are testing that our error handling properly handles futures of this type
final ThrowingStdin<Socket> fakeStdin = ThrowingStdin<Socket>(exception);
final FakeCommand licenseCommand = FakeCommand(
command: <String>[sdk.sdkManagerPath!, '--licenses'],
stdin: fakeStdin,
);
processManager.addCommand(licenseCommand);
final BufferLogger logger = BufferLogger.test();
final AndroidLicenseValidator licenseValidator = AndroidLicenseValidator(
java: FakeJava(),
androidSdk: sdk,
processManager: processManager,
platform: FakePlatform(environment: <String, String>{'HOME': '/home/me'}),
stdio: stdio,
logger: logger,
userMessages: UserMessages(),
);
await licenseValidator.runLicenseManager();
expect(logger.traceText, contains(exceptionMessage));
expect(processManager, hasNoRemainingExpectations);
});
testWithoutContext('runLicenseManager errors when sdkmanager fails to run', () async {
sdk.sdkManagerPath = '/foo/bar/sdkmanager';
processManager.excludedExecutables.add('/foo/bar/sdkmanager');
final AndroidLicenseValidator licenseValidator = AndroidLicenseValidator(
java: FakeJava(),
androidSdk: sdk,
processManager: processManager,
platform: FakePlatform(environment: <String, String>{'HOME': '/home/me'}),
stdio: stdio,
logger: BufferLogger.test(),
userMessages: UserMessages(),
);
expect(licenseValidator.runLicenseManager(), throwsToolExit());
});
testWithoutContext('runLicenseManager errors when sdkmanager exits non-zero', () async {
const String sdkManagerPath = '/foo/bar/sdkmanager';
sdk.sdkManagerPath = sdkManagerPath;
final BufferLogger logger = BufferLogger.test();
processManager.addCommand(
const FakeCommand(
command: <String>[sdkManagerPath, '--licenses'],
exitCode: 1,
stderr: 'sdkmanager crash',
),
);
final AndroidLicenseValidator licenseValidator = AndroidLicenseValidator(
java: FakeJava(),
androidSdk: sdk,
processManager: processManager,
platform: FakePlatform(environment: <String, String>{'HOME': '/home/me'}),
stdio: stdio,
logger: logger,
userMessages: UserMessages(),
);
await expectLater(
licenseValidator.runLicenseManager(),
throwsToolExit(
message: 'Android sdkmanager tool was found, but failed to run ($sdkManagerPath): "exited code 1"',
),
);
expect(processManager, hasNoRemainingExpectations);
expect(logger.traceText, isEmpty);
expect(stdio.writtenToStdout, isEmpty);
expect(stdio.writtenToStderr, contains('sdkmanager crash'));
});
testWithoutContext('detects license-only SDK installation with cmdline-tools', () async {
sdk
..licensesAvailable = true
..platformToolsAvailable = false
..cmdlineToolsAvailable = true
..directory = fileSystem.directory('/foo/bar');
final ValidationResult validationResult = await AndroidValidator(
java: FakeJava(),
androidSdk: sdk,
logger: logger,
platform: FakePlatform()..environment = <String, String>{'HOME': '/home/me'},
userMessages: UserMessages(),
).validate();
expect(validationResult.type, ValidationType.partial);
final ValidationMessage sdkMessage = validationResult.messages.first;
expect(sdkMessage.type, ValidationMessageType.information);
expect(sdkMessage.message, 'Android SDK at /foo/bar');
final ValidationMessage licenseMessage = validationResult.messages.last;
expect(licenseMessage.type, ValidationMessageType.hint);
expect(licenseMessage.message, UserMessages().androidSdkLicenseOnly(kAndroidHome));
});
testUsingContext('detects minimum required SDK and buildtools', () async {
final FakeAndroidSdkVersion sdkVersion = FakeAndroidSdkVersion()
..sdkLevel = 28
..buildToolsVersion = Version(26, 0, 3);
sdk
..licensesAvailable = true
..platformToolsAvailable = true
..cmdlineToolsAvailable = true
// Test with invalid SDK and build tools
..directory = fileSystem.directory('/foo/bar')
..sdkManagerPath = '/foo/bar/sdkmanager'
..latestVersion = sdkVersion;
final String errorMessage = UserMessages().androidSdkBuildToolsOutdated(
kAndroidSdkMinVersion,
kAndroidSdkBuildToolsMinVersion.toString(),
FakePlatform(),
);
final AndroidValidator androidValidator = AndroidValidator(
java: null,
androidSdk: sdk,
logger: logger,
platform: FakePlatform()..environment = <String, String>{'HOME': '/home/me'},
userMessages: UserMessages(),
);
ValidationResult validationResult = await androidValidator.validate();
expect(validationResult.type, ValidationType.missing);
expect(
validationResult.messages.last.message,
errorMessage,
);
// Test with valid SDK but invalid build tools
sdkVersion.sdkLevel = 29;
sdkVersion.buildToolsVersion = Version(28, 0, 2);
validationResult = await androidValidator.validate();
expect(validationResult.type, ValidationType.missing);
expect(
validationResult.messages.last.message,
errorMessage,
);
// Test with valid SDK and valid build tools
// Will still be partial because AndroidSdk.findJavaBinary is static :(
sdkVersion.sdkLevel = kAndroidSdkMinVersion;
sdkVersion.buildToolsVersion = kAndroidSdkBuildToolsMinVersion;
validationResult = await androidValidator.validate();
expect(validationResult.type, ValidationType.partial); // No Java binary
expect(
validationResult.messages.any((ValidationMessage message) => message.message == errorMessage),
isFalse,
);
});
testWithoutContext('detects missing cmdline tools', () async {
sdk
..licensesAvailable = true
..platformToolsAvailable = true
..cmdlineToolsAvailable = false
..directory = fileSystem.directory('/foo/bar');
final AndroidValidator androidValidator = AndroidValidator(
java: FakeJava(),
androidSdk: sdk,
logger: logger,
platform: FakePlatform()..environment = <String, String>{'HOME': '/home/me'},
userMessages: UserMessages(),
);
final String errorMessage = UserMessages().androidMissingCmdTools;
final ValidationResult validationResult = await androidValidator.validate();
expect(validationResult.type, ValidationType.missing);
final ValidationMessage sdkMessage = validationResult.messages.first;
expect(sdkMessage.type, ValidationMessageType.information);
expect(sdkMessage.message, 'Android SDK at /foo/bar');
final ValidationMessage cmdlineMessage = validationResult.messages.last;
expect(cmdlineMessage.type, ValidationMessageType.error);
expect(cmdlineMessage.message, errorMessage);
});
testUsingContext('detects minimum required java version', () async {
// Test with older version of JDK
final Platform platform = FakePlatform()..environment = <String, String>{
'HOME': '/home/me',
Java.javaHomeEnvironmentVariable: 'home/java',
'PATH': '',
};
final FakeAndroidSdkVersion sdkVersion = FakeAndroidSdkVersion()
..sdkLevel = 29
..buildToolsVersion = Version(28, 0, 3);
// Mock a pass through scenario to reach _checkJavaVersion()
sdk
..licensesAvailable = true
..platformToolsAvailable = true
..cmdlineToolsAvailable = true
..directory = fileSystem.directory('/foo/bar')
..sdkManagerPath = '/foo/bar/sdkmanager';
sdk.latestVersion = sdkVersion;
const String javaVersionText = 'openjdk version "1.7.0_212"';
final String errorMessage = UserMessages().androidJavaMinimumVersion(javaVersionText);
final ValidationResult validationResult = await AndroidValidator(
java: FakeJava(version: const Version.withText(1, 7, 0, javaVersionText)),
androidSdk: sdk,
logger: logger,
platform: platform,
userMessages: UserMessages(),
).validate();
expect(validationResult.type, ValidationType.partial);
expect(
validationResult.messages.last.message,
errorMessage,
);
expect(
validationResult.messages.any(
(ValidationMessage message) => message.message.contains('Unable to locate Android SDK')
),
false,
);
});
testWithoutContext('Mentions `flutter config --android-sdk if user has no AndroidSdk`', () async {
final ValidationResult validationResult = await AndroidValidator(
java: FakeJava(),
androidSdk: null,
logger: logger,
platform: FakePlatform()..environment = <String, String>{'HOME': '/home/me', Java.javaHomeEnvironmentVariable: 'home/java'},
userMessages: UserMessages(),
).validate();
expect(
validationResult.messages.any(
(ValidationMessage message) => message.message.contains('flutter config --android-sdk')
),
true,
);
});
testWithoutContext('Asks user to upgrade Android Studio when it is too far behind the Android SDK', () async {
const String sdkManagerPath = '/foo/bar/sdkmanager';
sdk.sdkManagerPath = sdkManagerPath;
final BufferLogger logger = BufferLogger.test();
processManager.addCommand(
const FakeCommand(
command: <String>[sdkManagerPath, '--licenses'],
exitCode: 1,
stderr: '''
Error: LinkageError occurred while loading main class com.android.sdklib.tool.sdkmanager.SdkManagerCli
java.lang.UnsupportedClassVersionError: com/android/sdklib/tool/sdkmanager/SdkManagerCli has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
Android sdkmanager tool was found, but failed to run
''',
),
);
final AndroidLicenseValidator licenseValidator = AndroidLicenseValidator(
java: FakeJava(),
androidSdk: sdk,
processManager: processManager,
platform: FakePlatform(environment: <String, String>{'HOME': '/home/me'}),
stdio: stdio,
logger: logger,
userMessages: UserMessages(),
);
await expectLater(
licenseValidator.runLicenseManager(),
throwsToolExit(
message: RegExp('.*consider updating your installation of Android studio. Alternatively, you.*'),
),
);
expect(processManager, hasNoRemainingExpectations);
expect(stdio.stderr.getAndClear(), contains('UnsupportedClassVersionError'));
});
}
class FakeAndroidSdk extends Fake implements AndroidSdk {
@override
String? sdkManagerPath;
@override
String? sdkManagerVersion;
@override
String? adbPath;
@override
bool licensesAvailable = false;
@override
bool platformToolsAvailable = false;
@override
bool cmdlineToolsAvailable = false;
@override
Directory directory = MemoryFileSystem.test().directory('/foo/bar');
@override
AndroidSdkVersion? latestVersion;
@override
String? emulatorPath;
@override
List<String> validateSdkWellFormed() => <String>[];
}
class FakeAndroidSdkVersion extends Fake implements AndroidSdkVersion {
@override
int sdkLevel = 0;
@override
Version buildToolsVersion = Version(0, 0, 0);
@override
String get buildToolsVersionName => '';
@override
String get platformName => '';
}
class ThrowingStdin<T> extends Fake implements IOSink {
ThrowingStdin(this.exception);
final Exception exception;
@override
Future<dynamic> addStream(Stream<List<int>> stream) {
return Future<T>.error(exception);
}
}
| flutter/packages/flutter_tools/test/general.shard/android/android_workflow_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/android/android_workflow_test.dart",
"repo_id": "flutter",
"token_count": 8122
} | 807 |
// 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 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/asset.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/globals.dart' as globals;
import '../src/common.dart';
import '../src/context.dart';
void main() {
String fixPath(String path) {
// The in-memory file system is strict about slashes on Windows being the
// correct way so until https://github.com/google/file.dart/issues/112 is
// fixed we fix them here.
// TODO(dantup): Remove this function once the above issue is fixed and
// rolls into Flutter.
return path.replaceAll('/', globals.fs.path.separator);
}
void writePubspecFile(String path, String name, { String? fontsSection }) {
if (fontsSection == null) {
fontsSection = '';
} else {
fontsSection = '''
flutter:
fonts:
$fontsSection
''';
}
globals.fs.file(fixPath(path))
..createSync(recursive: true)
..writeAsStringSync('''
name: $name
dependencies:
flutter:
sdk: flutter
$fontsSection
''');
}
void writePackagesFile(String packages) {
globals.fs.file('.packages')
..createSync()
..writeAsStringSync(packages);
}
Future<void> buildAndVerifyFonts(
List<String> localFonts,
List<String> packageFonts,
List<String> packages,
String expectedAssetManifest,
) async {
final AssetBundle bundle = AssetBundleFactory.instance.createBundle();
await bundle.build(packagesPath: '.packages');
for (final String packageName in packages) {
for (final String packageFont in packageFonts) {
final String entryKey = 'packages/$packageName/$packageFont';
expect(bundle.entries.containsKey(entryKey), true);
expect(
utf8.decode(await bundle.entries[entryKey]!.contentsAsBytes()),
packageFont,
);
}
for (final String localFont in localFonts) {
expect(bundle.entries.containsKey(localFont), true);
expect(
utf8.decode(await bundle.entries[localFont]!.contentsAsBytes()),
localFont,
);
}
}
expect(
json.decode(utf8.decode(await bundle.entries['FontManifest.json']!.contentsAsBytes())),
json.decode(expectedAssetManifest),
);
}
void writeFontAsset(String path, String font) {
globals.fs.file(fixPath('$path$font'))
..createSync(recursive: true)
..writeAsStringSync(font);
}
group('AssetBundle fonts from packages', () {
FileSystem? testFileSystem;
setUp(() async {
testFileSystem = MemoryFileSystem(
style: globals.platform.isWindows
? FileSystemStyle.windows
: FileSystemStyle.posix,
);
testFileSystem!.currentDirectory = testFileSystem!.systemTempDirectory.createTempSync('flutter_asset_bundle_test.');
});
testUsingContext('App includes neither font manifest nor fonts when no defines fonts', () async {
writePubspecFile('pubspec.yaml', 'test');
writePackagesFile('test_package:p/p/lib/');
writePubspecFile('p/p/pubspec.yaml', 'test_package');
final AssetBundle bundle = AssetBundleFactory.instance.createBundle();
await bundle.build(packagesPath: '.packages');
expect(bundle.entries.keys, unorderedEquals(<String>['AssetManifest.bin',
'AssetManifest.json', 'FontManifest.json', 'NOTICES.Z']));
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('App font uses font file from package', () async {
const String fontsSection = '''
- family: foo
fonts:
- asset: packages/test_package/bar
''';
writePubspecFile('pubspec.yaml', 'test', fontsSection: fontsSection);
writePackagesFile('test_package:p/p/lib/');
writePubspecFile('p/p/pubspec.yaml', 'test_package');
const String font = 'bar';
writeFontAsset('p/p/lib/', font);
const String expectedFontManifest =
'[{"fonts":[{"asset":"packages/test_package/bar"}],"family":"foo"}]';
await buildAndVerifyFonts(
<String>[],
<String>[font],
<String>['test_package'],
expectedFontManifest,
);
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('App font uses local font file and package font file', () async {
const String fontsSection = '''
- family: foo
fonts:
- asset: packages/test_package/bar
- asset: a/bar
''';
writePubspecFile('pubspec.yaml', 'test', fontsSection: fontsSection);
writePackagesFile('test_package:p/p/lib/');
writePubspecFile('p/p/pubspec.yaml', 'test_package');
const String packageFont = 'bar';
writeFontAsset('p/p/lib/', packageFont);
const String localFont = 'a/bar';
writeFontAsset('', localFont);
const String expectedFontManifest =
'[{"fonts":[{"asset":"packages/test_package/bar"},{"asset":"a/bar"}],'
'"family":"foo"}]';
await buildAndVerifyFonts(
<String>[localFont],
<String>[packageFont],
<String>['test_package'],
expectedFontManifest,
);
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('App uses package font with own font file', () async {
writePubspecFile('pubspec.yaml', 'test');
writePackagesFile('test_package:p/p/lib/');
const String fontsSection = '''
- family: foo
fonts:
- asset: a/bar
''';
writePubspecFile(
'p/p/pubspec.yaml',
'test_package',
fontsSection: fontsSection,
);
const String font = 'a/bar';
writeFontAsset('p/p/', font);
const String expectedFontManifest =
'[{"family":"packages/test_package/foo",'
'"fonts":[{"asset":"packages/test_package/a/bar"}]}]';
await buildAndVerifyFonts(
<String>[],
<String>[font],
<String>['test_package'],
expectedFontManifest,
);
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('App uses package font with font file from another package', () async {
writePubspecFile('pubspec.yaml', 'test');
writePackagesFile('test_package:p/p/lib/\ntest_package2:p2/p/lib/');
const String fontsSection = '''
- family: foo
fonts:
- asset: packages/test_package2/bar
''';
writePubspecFile(
'p/p/pubspec.yaml',
'test_package',
fontsSection: fontsSection,
);
writePubspecFile('p2/p/pubspec.yaml', 'test_package2');
const String font = 'bar';
writeFontAsset('p2/p/lib/', font);
const String expectedFontManifest =
'[{"family":"packages/test_package/foo",'
'"fonts":[{"asset":"packages/test_package2/bar"}]}]';
await buildAndVerifyFonts(
<String>[],
<String>[font],
<String>['test_package2'],
expectedFontManifest,
);
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('App uses package font with properties and own font file', () async {
writePubspecFile('pubspec.yaml', 'test');
writePackagesFile('test_package:p/p/lib/');
const String pubspec = '''
- family: foo
fonts:
- style: italic
weight: 400
asset: a/bar
''';
writePubspecFile(
'p/p/pubspec.yaml',
'test_package',
fontsSection: pubspec,
);
const String font = 'a/bar';
writeFontAsset('p/p/', font);
const String expectedFontManifest =
'[{"family":"packages/test_package/foo",'
'"fonts":[{"weight":400,"style":"italic","asset":"packages/test_package/a/bar"}]}]';
await buildAndVerifyFonts(
<String>[],
<String>[font],
<String>['test_package'],
expectedFontManifest,
);
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('App uses local font and package font with own font file.', () async {
const String fontsSection = '''
- family: foo
fonts:
- asset: a/bar
''';
writePubspecFile(
'pubspec.yaml',
'test',
fontsSection: fontsSection,
);
writePackagesFile('test_package:p/p/lib/');
writePubspecFile(
'p/p/pubspec.yaml',
'test_package',
fontsSection: fontsSection,
);
const String font = 'a/bar';
writeFontAsset('', font);
writeFontAsset('p/p/', font);
const String expectedFontManifest =
'[{"fonts":[{"asset":"a/bar"}],"family":"foo"},'
'{"family":"packages/test_package/foo",'
'"fonts":[{"asset":"packages/test_package/a/bar"}]}]';
await buildAndVerifyFonts(
<String>[font],
<String>[font],
<String>['test_package'],
expectedFontManifest,
);
}, overrides: <Type, Generator>{
FileSystem: () => testFileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
});
}
| flutter/packages/flutter_tools/test/general.shard/asset_bundle_package_fonts_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/asset_bundle_package_fonts_test.dart",
"repo_id": "flutter",
"token_count": 4005
} | 808 |
// 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' as io;
import 'package:file/memory.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:test/fake.dart';
import '../../src/common.dart';
import '../../src/io.dart';
void main() {
testWithoutContext('IOOverrides can inject a memory file system', () async {
final MemoryFileSystem memoryFileSystem = MemoryFileSystem.test();
final FlutterIOOverrides flutterIOOverrides = FlutterIOOverrides(fileSystem: memoryFileSystem);
await io.IOOverrides.runWithIOOverrides(() async {
// statics delegate correctly.
expect(io.FileSystemEntity.isWatchSupported, memoryFileSystem.isWatchSupported);
expect(io.Directory.systemTemp.path, memoryFileSystem.systemTempDirectory.path);
// can create and write to files/directories sync.
final io.File file = io.File('abc');
file.writeAsStringSync('def');
final io.Directory directory = io.Directory('foobar');
directory.createSync();
expect(memoryFileSystem.file('abc').existsSync(), true);
expect(memoryFileSystem.file('abc').readAsStringSync(), 'def');
expect(memoryFileSystem.directory('foobar').existsSync(), true);
// can create and write to files/directories async.
final io.File fileB = io.File('xyz');
await fileB.writeAsString('def');
final io.Directory directoryB = io.Directory('barfoo');
await directoryB.create();
expect(memoryFileSystem.file('xyz').existsSync(), true);
expect(memoryFileSystem.file('xyz').readAsStringSync(), 'def');
expect(memoryFileSystem.directory('barfoo').existsSync(), true);
// Links
final io.Link linkA = io.Link('hhh');
final io.Link linkB = io.Link('ggg');
io.File('jjj').createSync();
io.File('lll').createSync();
await linkA.create('jjj');
linkB.createSync('lll');
expect(await memoryFileSystem.link('hhh').resolveSymbolicLinks(), await linkA.resolveSymbolicLinks());
expect(memoryFileSystem.link('ggg').resolveSymbolicLinksSync(), linkB.resolveSymbolicLinksSync());
}, flutterIOOverrides);
});
testWithoutContext('ProcessSignal signals are properly delegated', () async {
final FakeProcessSignal signal = FakeProcessSignal();
final ProcessSignal signalUnderTest = ProcessSignal(signal);
signal.controller.add(signal);
expect(signalUnderTest, await signalUnderTest.watch().first);
});
testWithoutContext('ProcessSignal toString() works', () async {
expect(io.ProcessSignal.sigint.toString(), ProcessSignal.sigint.toString());
});
testWithoutContext('exit throws a StateError if called without being overridden', () {
expect(() => exit(0), throwsAssertionError);
});
testWithoutContext('exit does not throw a StateError if overridden', () {
try {
setExitFunctionForTests((int value) {});
expect(() => exit(0), returnsNormally);
} finally {
restoreExitFunction();
}
});
testWithoutContext('test_api defines the Declarer in a known place', () {
expect(Zone.current[#test.declarer], isNotNull);
});
testWithoutContext('listNetworkInterfaces() uses overrides', () async {
setNetworkInterfaceLister(
({
bool? includeLoopback,
bool? includeLinkLocal,
InternetAddressType? type,
}) async => <NetworkInterface>[],
);
expect(await listNetworkInterfaces(), isEmpty);
resetNetworkInterfaceLister();
});
testWithoutContext('Does not listen to Posix process signals on windows', () async {
final FakePlatform windows = FakePlatform(operatingSystem: 'windows');
final FakePlatform linux = FakePlatform();
final FakeProcessSignal fakeSignalA = FakeProcessSignal();
final FakeProcessSignal fakeSignalB = FakeProcessSignal();
fakeSignalA.controller.add(fakeSignalA);
fakeSignalB.controller.add(fakeSignalB);
expect(await PosixProcessSignal(fakeSignalA, platform: windows).watch().isEmpty, true);
expect(await PosixProcessSignal(fakeSignalB, platform: linux).watch().first, isNotNull);
});
}
class FakeProcessSignal extends Fake implements io.ProcessSignal {
final StreamController<io.ProcessSignal> controller = StreamController<io.ProcessSignal>();
@override
Stream<io.ProcessSignal> watch() => controller.stream;
}
| flutter/packages/flutter_tools/test/general.shard/base/io_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/base/io_test.dart",
"repo_id": "flutter",
"token_count": 1503
} | 809 |
// 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_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/build_system/exceptions.dart';
import 'package:flutter_tools/src/globals.dart' as globals;
import '../../src/common.dart';
void main() {
test('Exceptions', () {
final MissingInputException missingInputException = MissingInputException(
<File>[globals.fs.file('foo'), globals.fs.file('bar')], 'example');
final CycleException cycleException = CycleException(<Target>{
TestTarget()..name = 'foo',
TestTarget()..name = 'bar',
});
final InvalidPatternException invalidPatternException = InvalidPatternException(
'ABC'
);
final MissingOutputException missingOutputException = MissingOutputException(
<File>[ globals.fs.file('foo'), globals.fs.file('bar') ],
'example',
);
final MisplacedOutputException misplacedOutputException = MisplacedOutputException(
'foo',
'example',
);
final MissingDefineException missingDefineException = MissingDefineException(
'foobar',
'example',
);
expect(
missingInputException.toString(),
'foo, bar were declared as an inputs, '
'but did not exist. Check the definition of target:example for errors');
expect(
cycleException.toString(),
'Dependency cycle detected in build: foo -> bar',
);
expect(
invalidPatternException.toString(),
'The pattern "ABC" is not valid',
);
expect(
missingOutputException.toString(),
'foo, bar were declared as outputs, but were not generated by the '
'action. Check the definition of target:example for errors',
);
expect(
misplacedOutputException.toString(),
'Target example produced an output at foo which is outside of the '
'current build or project directory',
);
expect(
missingDefineException.toString(),
'Target example required define foobar but it was not provided',
);
});
}
class TestTarget extends Target {
@override
Future<void> build(Environment environment) async {}
@override
List<Target> dependencies = <Target>[];
@override
List<Source> inputs = <Source>[];
@override
String name = 'test';
@override
List<Source> outputs = <Source>[];
}
| flutter/packages/flutter_tools/test/general.shard/build_system/exceptions_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/build_system/exceptions_test.dart",
"repo_id": "flutter",
"token_count": 866
} | 810 |
// 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/memory.dart';
import 'package:file_testing/file_testing.dart';
import 'package:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/build_system/targets/macos.dart';
import 'package:flutter_tools/src/convert.dart';
import 'package:flutter_tools/src/reporting/reporting.dart';
import 'package:unified_analytics/unified_analytics.dart';
import '../../../src/common.dart';
import '../../../src/context.dart';
import '../../../src/fake_process_manager.dart';
import '../../../src/fakes.dart';
void main() {
late Environment environment;
late FileSystem fileSystem;
late Artifacts artifacts;
late FakeProcessManager processManager;
late File binary;
late BufferLogger logger;
late FakeCommand copyFrameworkCommand;
late FakeCommand lipoInfoNonFatCommand;
late FakeCommand lipoInfoFatCommand;
late FakeCommand lipoVerifyX86_64Command;
late TestUsage usage;
late FakeAnalytics fakeAnalytics;
setUp(() {
processManager = FakeProcessManager.empty();
artifacts = Artifacts.test();
fileSystem = MemoryFileSystem.test();
logger = BufferLogger.test();
usage = TestUsage();
fakeAnalytics = getInitializedFakeAnalyticsInstance(
fs: fileSystem,
fakeFlutterVersion: FakeFlutterVersion(),
);
environment = Environment.test(
fileSystem.currentDirectory,
defines: <String, String>{
kBuildMode: 'debug',
kTargetPlatform: 'darwin',
kDarwinArchs: 'x86_64',
},
inputs: <String, String>{},
artifacts: artifacts,
processManager: processManager,
logger: logger,
fileSystem: fileSystem,
engineVersion: '2',
usage: usage,
analytics: fakeAnalytics,
);
binary = environment.outputDir
.childDirectory('FlutterMacOS.framework')
.childDirectory('Versions')
.childDirectory('A')
.childFile('FlutterMacOS');
copyFrameworkCommand = FakeCommand(
command: <String>[
'rsync',
'-av',
'--delete',
'--filter',
'- .DS_Store/',
'Artifact.flutterMacOSFramework.debug',
environment.outputDir.path,
],
);
lipoInfoNonFatCommand = FakeCommand(command: <String>[
'lipo',
'-info',
binary.path,
], stdout: 'Non-fat file:');
lipoInfoFatCommand = FakeCommand(command: <String>[
'lipo',
'-info',
binary.path,
], stdout: 'Architectures in the fat file:');
lipoVerifyX86_64Command = FakeCommand(command: <String>[
'lipo',
binary.path,
'-verify_arch',
'x86_64',
]);
});
testUsingContext('Copies files to correct cache directory', () async {
binary.createSync(recursive: true);
processManager.addCommands(<FakeCommand>[
copyFrameworkCommand,
lipoInfoNonFatCommand,
lipoVerifyX86_64Command,
]);
await const DebugUnpackMacOS().build(environment);
expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('deletes entitlements.txt and without_entitlements.txt files after copying', () async {
binary.createSync(recursive: true);
final File entitlements = environment.outputDir.childFile('entitlements.txt');
final File withoutEntitlements = environment.outputDir.childFile('without_entitlements.txt');
final File nestedEntitlements = environment
.outputDir
.childDirectory('first_level')
.childDirectory('second_level')
.childFile('entitlements.txt')
..createSync(recursive: true);
processManager.addCommands(<FakeCommand>[
FakeCommand(
command: <String>[
'rsync',
'-av',
'--delete',
'--filter',
'- .DS_Store/',
// source
'Artifact.flutterMacOSFramework.debug',
// destination
environment.outputDir.path,
],
onRun: (_) {
entitlements.writeAsStringSync('foo');
withoutEntitlements.writeAsStringSync('bar');
nestedEntitlements.writeAsStringSync('somefile.bin');
},
),
lipoInfoNonFatCommand,
lipoVerifyX86_64Command,
]);
await const DebugUnpackMacOS().build(environment);
expect(entitlements.existsSync(), isFalse);
expect(withoutEntitlements.existsSync(), isFalse);
expect(nestedEntitlements.existsSync(), isFalse);
expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('thinning fails when framework missing', () async {
processManager.addCommand(copyFrameworkCommand);
await expectLater(
const DebugUnpackMacOS().build(environment),
throwsA(isException.having(
(Exception exception) => exception.toString(),
'description',
contains('FlutterMacOS.framework/Versions/A/FlutterMacOS does not exist, cannot thin'),
)),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('lipo fails when arch missing from framework', () async {
environment.defines[kDarwinArchs] = 'arm64 x86_64';
binary.createSync(recursive: true);
processManager.addCommands(<FakeCommand>[
copyFrameworkCommand,
lipoInfoFatCommand,
FakeCommand(command: <String>[
'lipo',
binary.path,
'-verify_arch',
'arm64',
'x86_64',
], exitCode: 1),
]);
await expectLater(
const DebugUnpackMacOS().build(environment),
throwsA(isException.having(
(Exception exception) => exception.toString(),
'description',
contains('does not contain arm64 x86_64. Running lipo -info:\nArchitectures in the fat file:'),
)),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('skips thins framework', () async {
binary.createSync(recursive: true);
processManager.addCommands(<FakeCommand>[
copyFrameworkCommand,
lipoInfoNonFatCommand,
lipoVerifyX86_64Command,
]);
await const DebugUnpackMacOS().build(environment);
expect(logger.traceText, contains('Skipping lipo for non-fat file /FlutterMacOS.framework/Versions/A/FlutterMacOS'));
});
testUsingContext('thins fat framework', () async {
binary.createSync(recursive: true);
processManager.addCommands(<FakeCommand>[
copyFrameworkCommand,
lipoInfoFatCommand,
lipoVerifyX86_64Command,
FakeCommand(command: <String>[
'lipo',
'-output',
binary.path,
'-extract',
'x86_64',
binary.path,
]),
]);
await const DebugUnpackMacOS().build(environment);
expect(processManager, hasNoRemainingExpectations);
});
testUsingContext('debug macOS application fails if App.framework missing', () async {
fileSystem.directory(
artifacts.getArtifactPath(
Artifact.flutterMacOSFramework,
mode: BuildMode.debug,
))
.createSync();
final String inputKernel = fileSystem.path.join(environment.buildDir.path, 'app.dill');
fileSystem.file(inputKernel)
..createSync(recursive: true)
..writeAsStringSync('testing');
expect(() async => const DebugMacOSBundleFlutterAssets().build(environment),
throwsException);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('debug macOS application creates correctly structured framework', () async {
fileSystem.directory(
artifacts.getArtifactPath(
Artifact.flutterMacOSFramework,
mode: BuildMode.debug,
))
.createSync();
environment.defines[kBundleSkSLPath] = 'bundle.sksl';
fileSystem.file(
artifacts.getArtifactPath(
Artifact.vmSnapshotData,
platform: TargetPlatform.darwin,
mode: BuildMode.debug,
)).createSync(recursive: true);
fileSystem.file(
artifacts.getArtifactPath(
Artifact.isolateSnapshotData,
platform: TargetPlatform.darwin,
mode: BuildMode.debug,
)).createSync(recursive: true);
fileSystem.file('${environment.buildDir.path}/App.framework/App')
.createSync(recursive: true);
// sksl bundle
fileSystem.file('bundle.sksl').writeAsStringSync(json.encode(
<String, Object>{
'engineRevision': '2',
'platform': 'ios',
'data': <String, Object>{
'A': 'B',
},
},
));
final String inputKernel = '${environment.buildDir.path}/app.dill';
fileSystem.file(inputKernel)
..createSync(recursive: true)
..writeAsStringSync('testing');
await const DebugMacOSBundleFlutterAssets().build(environment);
expect(fileSystem.file(
'App.framework/Versions/A/Resources/flutter_assets/kernel_blob.bin').readAsStringSync(),
'testing',
);
expect(fileSystem.file(
'App.framework/Versions/A/Resources/Info.plist').readAsStringSync(),
contains('io.flutter.flutter.app'),
);
expect(fileSystem.file(
'App.framework/Versions/A/Resources/flutter_assets/vm_snapshot_data'),
exists,
);
expect(fileSystem.file(
'App.framework/Versions/A/Resources/flutter_assets/isolate_snapshot_data'),
exists,
);
final File skslFile = fileSystem.file('App.framework/Versions/A/Resources/flutter_assets/io.flutter.shaders.json');
expect(skslFile, exists);
expect(skslFile.readAsStringSync(), '{"data":{"A":"B"}}');
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('release/profile macOS application has no blob or precompiled runtime', () async {
fileSystem.file('bin/cache/artifacts/engine/darwin-x64/vm_isolate_snapshot.bin')
.createSync(recursive: true);
fileSystem.file('bin/cache/artifacts/engine/darwin-x64/isolate_snapshot.bin')
.createSync(recursive: true);
fileSystem.file('${environment.buildDir.path}/App.framework/App')
.createSync(recursive: true);
await const ProfileMacOSBundleFlutterAssets().build(environment..defines[kBuildMode] = 'profile');
expect(fileSystem.file(
'App.framework/Versions/A/Resources/flutter_assets/kernel_blob.bin'),
isNot(exists),
);
expect(fileSystem.file(
'App.framework/Versions/A/Resources/flutter_assets/vm_snapshot_data'),
isNot(exists),
);
expect(fileSystem.file(
'App.framework/Versions/A/Resources/flutter_assets/isolate_snapshot_data'),
isNot(exists),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('release macOS application creates App.framework.dSYM', () async {
fileSystem.file('bin/cache/artifacts/engine/darwin-x64/vm_isolate_snapshot.bin')
.createSync(recursive: true);
fileSystem.file('bin/cache/artifacts/engine/darwin-x64/isolate_snapshot.bin')
.createSync(recursive: true);
fileSystem.file('${environment.buildDir.path}/App.framework/App')
.createSync(recursive: true);
fileSystem.file('${environment.buildDir.path}/App.framework.dSYM/Contents/Resources/DWARF/App')
.createSync(recursive: true);
await const ReleaseMacOSBundleFlutterAssets()
.build(environment..defines[kBuildMode] = 'release');
expect(fileSystem.file(
'App.framework.dSYM/Contents/Resources/DWARF/App'),
exists,
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('release/profile macOS application updates when App.framework updates', () async {
fileSystem.file('bin/cache/artifacts/engine/darwin-x64/vm_isolate_snapshot.bin')
.createSync(recursive: true);
fileSystem.file('bin/cache/artifacts/engine/darwin-x64/isolate_snapshot.bin')
.createSync(recursive: true);
final File inputFramework = fileSystem.file(fileSystem.path.join(environment.buildDir.path, 'App.framework', 'App'))
..createSync(recursive: true)
..writeAsStringSync('ABC');
await const ProfileMacOSBundleFlutterAssets().build(environment..defines[kBuildMode] = 'profile');
final File outputFramework = fileSystem.file(fileSystem.path.join(environment.outputDir.path, 'App.framework', 'App'));
expect(outputFramework.readAsStringSync(), 'ABC');
inputFramework.writeAsStringSync('DEF');
await const ProfileMacOSBundleFlutterAssets().build(environment..defines[kBuildMode] = 'profile');
expect(outputFramework.readAsStringSync(), 'DEF');
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('ReleaseMacOSBundleFlutterAssets sends archive success event', () async {
environment.defines[kBuildMode] = 'release';
environment.defines[kXcodeAction] = 'install';
fileSystem.file('bin/cache/artifacts/engine/darwin-x64/vm_isolate_snapshot.bin')
.createSync(recursive: true);
fileSystem.file('bin/cache/artifacts/engine/darwin-x64/isolate_snapshot.bin')
.createSync(recursive: true);
fileSystem.file(fileSystem.path.join(environment.buildDir.path, 'App.framework', 'App'))
.createSync(recursive: true);
await const ReleaseMacOSBundleFlutterAssets().build(environment);
expect(usage.events, contains(const TestUsageEvent('assemble', 'macos-archive', label: 'success')));
expect(fakeAnalytics.sentEvents, contains(
Event.appleUsageEvent(
workflow: 'assemble',
parameter: 'macos-archive',
result: 'success',
),
));
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('ReleaseMacOSBundleFlutterAssets sends archive fail event', () async {
environment.defines[kBuildMode] = 'release';
environment.defines[kXcodeAction] = 'install';
// Throws because the project files are not set up.
await expectLater(() => const ReleaseMacOSBundleFlutterAssets().build(environment),
throwsA(const TypeMatcher<FileSystemException>()));
expect(usage.events, contains(const TestUsageEvent('assemble', 'macos-archive', label: 'fail')));
expect(fakeAnalytics.sentEvents, contains(
Event.appleUsageEvent(
workflow: 'assemble',
parameter: 'macos-archive',
result: 'fail',
),
));
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('DebugMacOSFramework creates expected binary with arm64 only arch', () async {
environment.defines[kDarwinArchs] = 'arm64';
processManager.addCommand(
FakeCommand(command: <String>[
'xcrun',
'clang',
'-x',
'c',
environment.buildDir.childFile('debug_app.cc').path,
'-arch',
'arm64',
'-dynamiclib',
'-Xlinker', '-rpath', '-Xlinker', '@executable_path/Frameworks',
'-Xlinker', '-rpath', '-Xlinker', '@loader_path/Frameworks',
'-fapplication-extension',
'-install_name', '@rpath/App.framework/App',
'-o',
environment.buildDir
.childDirectory('App.framework')
.childFile('App')
.path,
]),
);
await const DebugMacOSFramework().build(environment);
expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('DebugMacOSFramework creates universal binary', () async {
environment.defines[kDarwinArchs] = 'arm64 x86_64';
processManager.addCommand(
FakeCommand(command: <String>[
'xcrun',
'clang',
'-x',
'c',
environment.buildDir.childFile('debug_app.cc').path,
'-arch',
'arm64',
'-arch',
'x86_64',
'-dynamiclib',
'-Xlinker', '-rpath', '-Xlinker', '@executable_path/Frameworks',
'-Xlinker', '-rpath', '-Xlinker', '@loader_path/Frameworks',
'-fapplication-extension',
'-install_name', '@rpath/App.framework/App',
'-o',
environment.buildDir
.childDirectory('App.framework')
.childFile('App')
.path,
]),
);
await const DebugMacOSFramework().build(environment);
expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('CompileMacOSFramework creates universal binary', () async {
environment.defines[kDarwinArchs] = 'arm64 x86_64';
environment.defines[kBuildMode] = 'release';
// Input dSYMs need to exist for `lipo` to combine them
environment.buildDir
.childFile('arm64/App.framework.dSYM/Contents/Resources/DWARF/App')
.createSync(recursive: true);
environment.buildDir
.childFile('x86_64/App.framework.dSYM/Contents/Resources/DWARF/App')
.createSync(recursive: true);
processManager.addCommands(<FakeCommand>[
FakeCommand(command: <String>[
'Artifact.genSnapshot.TargetPlatform.darwin.release_arm64',
'--deterministic',
'--snapshot_kind=app-aot-assembly',
'--assembly=${environment.buildDir.childFile('arm64/snapshot_assembly.S').path}',
environment.buildDir.childFile('app.dill').path,
]),
FakeCommand(command: <String>[
'Artifact.genSnapshot.TargetPlatform.darwin.release_x64',
'--deterministic',
'--snapshot_kind=app-aot-assembly',
'--assembly=${environment.buildDir.childFile('x86_64/snapshot_assembly.S').path}',
environment.buildDir.childFile('app.dill').path,
]),
FakeCommand(command: <String>[
'xcrun', 'cc', '-arch', 'arm64',
'-c', environment.buildDir.childFile('arm64/snapshot_assembly.S').path,
'-o', environment.buildDir.childFile('arm64/snapshot_assembly.o').path,
]),
FakeCommand(command: <String>[
'xcrun', 'cc', '-arch', 'x86_64',
'-c', environment.buildDir.childFile('x86_64/snapshot_assembly.S').path,
'-o', environment.buildDir.childFile('x86_64/snapshot_assembly.o').path,
]),
FakeCommand(command: <String>[
'xcrun', 'clang', '-arch', 'arm64', '-dynamiclib', '-Xlinker', '-rpath',
'-Xlinker', '@executable_path/Frameworks', '-Xlinker', '-rpath',
'-Xlinker', '@loader_path/Frameworks',
'-fapplication-extension',
'-install_name', '@rpath/App.framework/App',
'-o', environment.buildDir.childFile('arm64/App.framework/App').path,
environment.buildDir.childFile('arm64/snapshot_assembly.o').path,
]),
FakeCommand(command: <String>[
'xcrun', 'clang', '-arch', 'x86_64', '-dynamiclib', '-Xlinker', '-rpath',
'-Xlinker', '@executable_path/Frameworks', '-Xlinker', '-rpath',
'-Xlinker', '@loader_path/Frameworks',
'-fapplication-extension',
'-install_name', '@rpath/App.framework/App',
'-o', environment.buildDir.childFile('x86_64/App.framework/App').path,
environment.buildDir.childFile('x86_64/snapshot_assembly.o').path,
]),
FakeCommand(command: <String>[
'xcrun',
'dsymutil',
'-o',
environment.buildDir.childFile('arm64/App.framework.dSYM').path,
environment.buildDir.childFile('arm64/App.framework/App').path,
]),
FakeCommand(command: <String>[
'xcrun',
'dsymutil',
'-o',
environment.buildDir.childFile('x86_64/App.framework.dSYM').path,
environment.buildDir.childFile('x86_64/App.framework/App').path,
]),
FakeCommand(command: <String>[
'xcrun',
'strip',
'-x',
environment.buildDir.childFile('arm64/App.framework/App').path,
'-o',
environment.buildDir.childFile('arm64/App.framework/App').path,
]),
FakeCommand(command: <String>[
'xcrun',
'strip',
'-x',
environment.buildDir.childFile('x86_64/App.framework/App').path,
'-o',
environment.buildDir.childFile('x86_64/App.framework/App').path,
]),
FakeCommand(command: <String>[
'lipo',
environment.buildDir.childFile('arm64/App.framework/App').path,
environment.buildDir.childFile('x86_64/App.framework/App').path,
'-create',
'-output',
environment.buildDir.childFile('App.framework/App').path,
]),
FakeCommand(command: <String>[
'lipo',
environment.buildDir.childFile('arm64/App.framework.dSYM/Contents/Resources/DWARF/App').path,
environment.buildDir.childFile('x86_64/App.framework.dSYM/Contents/Resources/DWARF/App').path,
'-create',
'-output',
environment.buildDir.childFile('App.framework.dSYM/Contents/Resources/DWARF/App').path,
]),
]);
await const CompileMacOSFramework().build(environment);
expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
}
| flutter/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart",
"repo_id": "flutter",
"token_count": 8670
} | 811 |
// 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:file/memory.dart';
import 'package:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/compile.dart';
import 'package:flutter_tools/src/convert.dart';
import 'package:package_config/package_config.dart';
import 'package:process/process.dart';
import 'package:test/fake.dart';
import '../src/common.dart';
import '../src/fake_process_manager.dart';
import '../src/fakes.dart';
void main() {
late FakeProcessManager processManager;
late ResidentCompiler generator;
late MemoryIOSink frontendServerStdIn;
late StreamController<String> stdErrStreamController;
late BufferLogger testLogger;
late MemoryFileSystem fileSystem;
setUp(() {
testLogger = BufferLogger.test();
processManager = FakeProcessManager();
frontendServerStdIn = MemoryIOSink();
fileSystem = MemoryFileSystem.test();
generator = ResidentCompiler(
'sdkroot',
buildMode: BuildMode.debug,
artifacts: Artifacts.test(),
processManager: processManager,
logger: testLogger,
platform: FakePlatform(),
fileSystem: fileSystem,
);
stdErrStreamController = StreamController<String>();
processManager.process.stdin = frontendServerStdIn;
processManager.process.stderr = stdErrStreamController.stream.transform(utf8.encoder);
});
testWithoutContext('compile expression fails if not previously compiled', () async {
final CompilerOutput? result = await generator.compileExpression(
'2+2', null, null, null, null, null, null, null, null, false);
expect(result, isNull);
});
testWithoutContext('compile expression can compile single expression', () async {
final Completer<List<int>> compileResponseCompleter =
Completer<List<int>>();
final Completer<List<int>> compileExpressionResponseCompleter =
Completer<List<int>>();
fileSystem.file('/path/to/main.dart.dill')
..createSync(recursive: true)
..writeAsBytesSync(<int>[1, 2, 3, 4]);
processManager.process.stdout = Stream<List<int>>.fromFutures(
<Future<List<int>>>[
compileResponseCompleter.future,
compileExpressionResponseCompleter.future,
],
);
compileResponseCompleter.complete(Future<List<int>>.value(utf8.encode(
'result abc\nline1\nline2\nabc\nabc /path/to/main.dart.dill 0\n'
)));
await generator.recompile(
Uri.file('/path/to/main.dart'),
null, /* invalidatedFiles */
outputPath: '/build/',
packageConfig: PackageConfig.empty,
projectRootPath: '',
fs: fileSystem,
).then((CompilerOutput? output) {
expect(frontendServerStdIn.getAndClear(),
'compile file:///path/to/main.dart\n');
expect(testLogger.errorText,
equals('line1\nline2\n'));
expect(output!.outputFilename, equals('/path/to/main.dart.dill'));
compileExpressionResponseCompleter.complete(
Future<List<int>>.value(utf8.encode(
'result def\nline1\nline2\ndef\ndef /path/to/main.dart.dill.incremental 0\n'
)));
generator.compileExpression(
'2+2', null, null, null, null, null, null, null, null, false).then(
(CompilerOutput? outputExpression) {
expect(outputExpression, isNotNull);
expect(outputExpression!.expressionData, <int>[1, 2, 3, 4]);
}
);
});
});
testWithoutContext('compile expressions without awaiting', () async {
final Completer<List<int>> compileResponseCompleter = Completer<List<int>>();
final Completer<List<int>> compileExpressionResponseCompleter1 = Completer<List<int>>();
final Completer<List<int>> compileExpressionResponseCompleter2 = Completer<List<int>>();
processManager.process.stdout =
Stream<List<int>>.fromFutures(
<Future<List<int>>>[
compileResponseCompleter.future,
compileExpressionResponseCompleter1.future,
compileExpressionResponseCompleter2.future,
]);
// The test manages timing via completers.
unawaited(
generator.recompile(
Uri.parse('/path/to/main.dart'),
null, /* invalidatedFiles */
outputPath: '/build/',
packageConfig: PackageConfig.empty,
projectRootPath: '',
fs: MemoryFileSystem(),
).then((CompilerOutput? outputCompile) {
expect(testLogger.errorText,
equals('line1\nline2\n'));
expect(outputCompile!.outputFilename, equals('/path/to/main.dart.dill'));
fileSystem.file('/path/to/main.dart.dill.incremental')
..createSync(recursive: true)
..writeAsBytesSync(<int>[0, 1, 2, 3]);
compileExpressionResponseCompleter1.complete(Future<List<int>>.value(utf8.encode(
'result def\nline1\nline2\ndef /path/to/main.dart.dill.incremental 0\n'
)));
}),
);
// The test manages timing via completers.
final Completer<bool> lastExpressionCompleted = Completer<bool>();
unawaited(
generator.compileExpression('0+1', null, null, null, null, null, null,
null, null, false).then(
(CompilerOutput? outputExpression) {
expect(outputExpression, isNotNull);
expect(outputExpression!.expressionData, <int>[0, 1, 2, 3]);
fileSystem.file('/path/to/main.dart.dill.incremental')
..createSync(recursive: true)
..writeAsBytesSync(<int>[4, 5, 6, 7]);
compileExpressionResponseCompleter2.complete(Future<List<int>>.value(utf8.encode(
'result def\nline1\nline2\ndef /path/to/main.dart.dill.incremental 0\n'
)));
},
),
);
// The test manages timing via completers.
unawaited(
generator.compileExpression('1+1', null, null, null, null, null, null,
null, null, false).then(
(CompilerOutput? outputExpression) {
expect(outputExpression, isNotNull);
expect(outputExpression!.expressionData, <int>[4, 5, 6, 7]);
lastExpressionCompleted.complete(true);
},
),
);
compileResponseCompleter.complete(Future<List<int>>.value(utf8.encode(
'result abc\nline1\nline2\nabc\nabc /path/to/main.dart.dill 0\n'
)));
expect(await lastExpressionCompleted.future, isTrue);
});
}
class FakeProcess extends Fake implements Process {
@override
Stream<List<int>> stdout = const Stream<List<int>>.empty();
@override
Stream<List<int>> stderr = const Stream<List<int>>.empty();
@override
IOSink stdin = IOSink(StreamController<List<int>>().sink);
@override
Future<int> get exitCode => Completer<int>().future;
}
class FakeProcessManager extends Fake implements ProcessManager {
final FakeProcess process = FakeProcess();
@override
bool canRun(dynamic executable, {String? workingDirectory}) {
return true;
}
@override
Future<Process> start(List<Object> command, {String? workingDirectory, Map<String, String>? environment, bool includeParentEnvironment = true, bool runInShell = false, ProcessStartMode mode = ProcessStartMode.normal}) async {
return process;
}
}
| flutter/packages/flutter_tools/test/general.shard/compile_expression_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/compile_expression_test.dart",
"repo_id": "flutter",
"token_count": 2949
} | 812 |
// 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/memory.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/dart/language_version.dart';
import 'package:package_config/package_config.dart';
import '../../src/common.dart';
const String flutterRoot = '';
const String testVersionString = '2.13';
final LanguageVersion testCurrentLanguageVersion = LanguageVersion(2, 13);
void setUpLanguageVersion(FileSystem fileSystem, [String version = testVersionString]) {
fileSystem.file(fileSystem.path.join('bin', 'cache', 'dart-sdk', 'version'))
..createSync(recursive: true)
..writeAsStringSync(version);
}
void main() {
testWithoutContext('detects language version in comment', () {
final FileSystem fileSystem = MemoryFileSystem.test();
setUpLanguageVersion(fileSystem);
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
// @dart = 2.9
''');
expect(determineLanguageVersion(file, null, flutterRoot), LanguageVersion(2, 9));
});
testWithoutContext('detects language version in comment without spacing', () {
final FileSystem fileSystem = MemoryFileSystem.test();
setUpLanguageVersion(fileSystem);
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
// @dart=2.9
''');
expect(determineLanguageVersion(file, null, flutterRoot), LanguageVersion(2, 9));
});
testWithoutContext('detects language version in comment with more numbers', () {
final FileSystem fileSystem = MemoryFileSystem.test();
setUpLanguageVersion(fileSystem);
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
// @dart=2.12
''');
expect(determineLanguageVersion(file, null, flutterRoot), nullSafeVersion);
});
testWithoutContext('does not detect invalid language version', () {
final FileSystem fileSystem = MemoryFileSystem.test();
setUpLanguageVersion(fileSystem);
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
// @dart
''');
expect(determineLanguageVersion(file, null, flutterRoot), testCurrentLanguageVersion);
});
testWithoutContext('detects language version with leading whitespace', () {
final FileSystem fileSystem = MemoryFileSystem.test();
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
// @dart = 2.9
''');
expect(determineLanguageVersion(file, null, flutterRoot), LanguageVersion(2, 9));
});
testWithoutContext('detects language version with tabs', () {
final FileSystem fileSystem = MemoryFileSystem.test();
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
//\t@dart = 2.9
''');
expect(determineLanguageVersion(file, null, flutterRoot), LanguageVersion(2, 9));
});
testWithoutContext('detects language version with tons of whitespace', () {
final FileSystem fileSystem = MemoryFileSystem.test();
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
// @dart = 2.23
''');
expect(determineLanguageVersion(file, null, flutterRoot), LanguageVersion(2, 23));
});
testWithoutContext('does not detect language version in dartdoc', () {
final FileSystem fileSystem = MemoryFileSystem.test();
setUpLanguageVersion(fileSystem);
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
/// @dart = 2.9
''');
expect(determineLanguageVersion(file, null, flutterRoot), testCurrentLanguageVersion);
});
testWithoutContext('does not detect language version in block comment', () {
final FileSystem fileSystem = MemoryFileSystem.test();
setUpLanguageVersion(fileSystem);
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
/*
// @dart = 2.9
*/
''');
expect(determineLanguageVersion(file, null, flutterRoot), testCurrentLanguageVersion);
});
testWithoutContext('does not detect language version in nested block comment', () {
final FileSystem fileSystem = MemoryFileSystem.test();
setUpLanguageVersion(fileSystem);
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
/*
/*
// @dart = 2.9
*/
*/
''');
expect(determineLanguageVersion(file, null, flutterRoot), testCurrentLanguageVersion);
});
testWithoutContext('detects language version after nested block comment', () {
final FileSystem fileSystem = MemoryFileSystem.test();
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
/* /*
*/
*/
// @dart = 2.9
''');
expect(determineLanguageVersion(file, null, flutterRoot), LanguageVersion(2, 9));
});
testWithoutContext('does not crash with unbalanced opening block comments', () {
final FileSystem fileSystem = MemoryFileSystem.test();
setUpLanguageVersion(fileSystem);
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
/*
/*
*/
// @dart = 2.9
''');
expect(determineLanguageVersion(file, null, flutterRoot), testCurrentLanguageVersion);
});
testWithoutContext('does not crash with unbalanced closing block comments', () {
final FileSystem fileSystem = MemoryFileSystem.test();
setUpLanguageVersion(fileSystem);
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
/*
*/
*/
// @dart = 2.9
''');
expect(determineLanguageVersion(file, null, flutterRoot), testCurrentLanguageVersion);
});
testWithoutContext('does not detect language version in single line block comment', () {
final FileSystem fileSystem = MemoryFileSystem.test();
setUpLanguageVersion(fileSystem);
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
/* // @dart = 2.9 */
''');
expect(determineLanguageVersion(file, null, flutterRoot), testCurrentLanguageVersion);
});
testWithoutContext('does not detect language version after import declaration', () {
final FileSystem fileSystem = MemoryFileSystem.test();
setUpLanguageVersion(fileSystem);
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
import 'dart:ui' as ui;
// @dart = 2.9
''');
expect(determineLanguageVersion(file, null, flutterRoot), testCurrentLanguageVersion);
});
testWithoutContext('does not detect language version after part declaration', () {
final FileSystem fileSystem = MemoryFileSystem.test();
setUpLanguageVersion(fileSystem);
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
part of 'foo.dart';
// @dart = 2.9
''');
expect(determineLanguageVersion(file, null, flutterRoot), testCurrentLanguageVersion);
});
testWithoutContext('does not detect language version after library declaration', () {
final FileSystem fileSystem = MemoryFileSystem.test();
setUpLanguageVersion(fileSystem);
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
library funstuff;
// @dart = 2.9
''');
expect(determineLanguageVersion(file, null, flutterRoot), testCurrentLanguageVersion);
});
testWithoutContext('looks up language version from package if not found in file', () {
final FileSystem fileSystem = MemoryFileSystem.test();
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
''');
final Package package = Package(
'foo',
Uri.parse('file://foo/'),
languageVersion: LanguageVersion(2, 7),
);
expect(determineLanguageVersion(file, package, flutterRoot), LanguageVersion(2, 7));
});
testWithoutContext('defaults to current version if package lookup returns null', () {
final FileSystem fileSystem = MemoryFileSystem.test();
setUpLanguageVersion(fileSystem);
final File file = fileSystem.file('example.dart')
..writeAsStringSync('''
// Some license
''');
final Package package = Package(
'foo',
Uri.parse('file://foo/'),
);
expect(determineLanguageVersion(file, package, flutterRoot), testCurrentLanguageVersion);
});
testWithoutContext('Returns null safe error if reading the file throws a FileSystemException', () {
final FileExceptionHandler handler = FileExceptionHandler();
final FileSystem fileSystem = MemoryFileSystem.test(opHandle: handler.opHandle);
setUpLanguageVersion(fileSystem);
final File errorFile = fileSystem.file('foo');
handler.addError(errorFile, FileSystemOp.read, const FileSystemException());
final Package package = Package(
'foo',
Uri.parse('file://foo/'),
languageVersion: LanguageVersion(2, 7),
);
expect(determineLanguageVersion(errorFile, package, flutterRoot), testCurrentLanguageVersion);
});
testWithoutContext('Can parse Dart language version with pre/post suffix', () {
final FileSystem fileSystem = MemoryFileSystem.test();
setUpLanguageVersion(fileSystem, '2.13.0-150.0.dev');
expect(currentLanguageVersion(fileSystem, flutterRoot), LanguageVersion(2, 13));
});
}
| flutter/packages/flutter_tools/test/general.shard/dart/language_version_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/dart/language_version_test.dart",
"repo_id": "flutter",
"token_count": 2968
} | 813 |
// 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/memory.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/device.dart';
import 'package:flutter_tools/src/test/flutter_platform.dart';
import 'package:test_core/backend.dart';
import '../src/common.dart';
import '../src/context.dart';
void main() {
late FileSystem fileSystem;
setUp(() {
fileSystem = MemoryFileSystem.test();
fileSystem.file('.dart_tool/package_config.json')
..createSync(recursive: true)
..writeAsStringSync('{"configVersion":2,"packages":[]}');
});
group('FlutterPlatform', () {
late SuitePlatform fakeSuitePlatform;
setUp(() {
fakeSuitePlatform = SuitePlatform(Runtime.vm);
});
testUsingContext('ensureConfiguration throws an error if an '
'explicitVmServicePort is specified and more than one test file', () async {
final FlutterPlatform flutterPlatform = FlutterPlatform(
shellPath: '/',
debuggingOptions: DebuggingOptions.enabled(
BuildInfo.debug,
hostVmServicePort: 1234,
),
enableVmService: false,
);
flutterPlatform.loadChannel('test1.dart', fakeSuitePlatform);
expect(() => flutterPlatform.loadChannel('test2.dart', fakeSuitePlatform), throwsToolExit());
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('ensureConfiguration throws an error if a precompiled '
'entrypoint is specified and more that one test file', () {
final FlutterPlatform flutterPlatform = FlutterPlatform(
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
shellPath: '/',
precompiledDillPath: 'example.dill',
enableVmService: false,
);
flutterPlatform.loadChannel('test1.dart', fakeSuitePlatform);
expect(() => flutterPlatform.loadChannel('test2.dart', fakeSuitePlatform), throwsToolExit());
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('installHook creates a FlutterPlatform', () {
expect(() => installHook(
shellPath: 'abc',
debuggingOptions: DebuggingOptions.enabled(
BuildInfo.debug,
startPaused: true,
),
), throwsAssertionError);
expect(() => installHook(
shellPath: 'abc',
debuggingOptions: DebuggingOptions.enabled(
BuildInfo.debug,
startPaused: true,
hostVmServicePort: 123,
),
), throwsAssertionError);
FlutterPlatform? capturedPlatform;
final Map<String, String> expectedPrecompiledDillFiles = <String, String>{'Key': 'Value'};
final FlutterPlatform flutterPlatform = installHook(
shellPath: 'abc',
debuggingOptions: DebuggingOptions.enabled(
BuildInfo.debug,
startPaused: true,
disableServiceAuthCodes: true,
hostVmServicePort: 200,
),
enableVmService: true,
machine: true,
precompiledDillPath: 'def',
precompiledDillFiles: expectedPrecompiledDillFiles,
updateGoldens: true,
testAssetDirectory: '/build/test',
serverType: InternetAddressType.IPv6,
icudtlPath: 'ghi',
platformPluginRegistration: (FlutterPlatform platform) {
capturedPlatform = platform;
},
uriConverter: (String input) => '$input/test',
);
expect(identical(capturedPlatform, flutterPlatform), equals(true));
expect(flutterPlatform.shellPath, equals('abc'));
expect(flutterPlatform.debuggingOptions.buildInfo, equals(BuildInfo.debug));
expect(flutterPlatform.debuggingOptions.startPaused, equals(true));
expect(flutterPlatform.debuggingOptions.disableServiceAuthCodes, equals(true));
expect(flutterPlatform.debuggingOptions.hostVmServicePort, equals(200));
expect(flutterPlatform.enableVmService, equals(true));
expect(flutterPlatform.machine, equals(true));
expect(flutterPlatform.host, InternetAddress.loopbackIPv6);
expect(flutterPlatform.precompiledDillPath, equals('def'));
expect(flutterPlatform.precompiledDillFiles, expectedPrecompiledDillFiles);
expect(flutterPlatform.updateGoldens, equals(true));
expect(flutterPlatform.testAssetDirectory, '/build/test');
expect(flutterPlatform.icudtlPath, equals('ghi'));
expect(flutterPlatform.uriConverter?.call('hello'), 'hello/test');
});
});
}
| flutter/packages/flutter_tools/test/general.shard/flutter_platform_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/flutter_platform_test.dart",
"repo_id": "flutter",
"token_count": 1816
} | 814 |
// 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:archive/archive.dart';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/user_messages.dart';
import 'package:flutter_tools/src/convert.dart';
import 'package:flutter_tools/src/doctor_validator.dart';
import 'package:flutter_tools/src/intellij/intellij_validator.dart';
import 'package:flutter_tools/src/ios/plist_parser.dart';
import 'package:test/fake.dart';
import '../../src/common.dart';
import '../../src/fake_process_manager.dart';
import '../../src/fakes.dart';
final Platform macPlatform = FakePlatform(
operatingSystem: 'macos',
environment: <String, String>{'HOME': '/foo/bar'}
);
final Platform linuxPlatform = FakePlatform(
environment: <String, String>{
'HOME': '/foo/bar',
},
);
final Platform windowsPlatform = FakePlatform(
operatingSystem: 'windows',
environment: <String, String>{
'USERPROFILE': r'C:\Users\foo',
'APPDATA': r'C:\Users\foo\AppData\Roaming',
'LOCALAPPDATA': r'C:\Users\foo\AppData\Local',
},
);
void main() {
testWithoutContext('Intellij validator can parse plugin manifest from plugin JAR', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
// Create plugin JAR file for Flutter and Dart plugin.
createIntellijFlutterPluginJar('plugins/flutter-intellij.jar', fileSystem);
createIntellijDartPluginJar('plugins/Dart/lib/Dart.jar', fileSystem);
final ValidationResult result = await IntelliJValidatorTestTarget('', 'path/to/intellij', fileSystem).validate();
expect(result.type, ValidationType.partial);
expect(result.statusInfo, 'version test.test.test');
expect(result.messages, const <ValidationMessage>[
ValidationMessage('IntelliJ at path/to/intellij'),
ValidationMessage.error('Flutter plugin version 0.1.3 - the recommended minimum version is 16.0.0'),
ValidationMessage('Dart plugin version 162.2485'),
ValidationMessage('For information about installing plugins, see\n'
'https://flutter.dev/intellij-setup/#installing-the-plugins'),
]);
});
testWithoutContext('legacy intellij(<2020) plugins check on linux', () async {
const String cachePath = '/foo/bar/.IntelliJIdea2019.10/system';
const String installPath = '/foo/bar/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-1/2019.10.1';
const String pluginPath = '/foo/bar/.IntelliJIdea2019.10/config/plugins';
final FileSystem fileSystem = MemoryFileSystem.test();
final Directory cacheDirectory = fileSystem.directory(cachePath)
..createSync(recursive: true);
cacheDirectory
.childFile('.home')
.writeAsStringSync(installPath, flush: true);
final Directory installedDirectory = fileSystem.directory(installPath);
installedDirectory.createSync(recursive: true);
// Create plugin JAR file for Flutter and Dart plugin.
createIntellijFlutterPluginJar('$pluginPath/flutter-intellij/lib/flutter-intellij.jar', fileSystem, version: '50.0');
createIntellijDartPluginJar('$pluginPath/Dart/lib/Dart.jar', fileSystem);
final Iterable<DoctorValidator> installed = IntelliJValidatorOnLinux.installed(
fileSystem: fileSystem,
fileSystemUtils: FileSystemUtils(fileSystem: fileSystem, platform: linuxPlatform),
userMessages: UserMessages(),
);
expect(1, installed.length);
final ValidationResult result = await installed.toList()[0].validate();
expect(ValidationType.success, result.type);
});
testWithoutContext('intellij(2020.1) plugins check on linux (installed via JetBrains ToolBox app)', () async {
const String cachePath = '/foo/bar/.cache/JetBrains/IntelliJIdea2020.10';
const String installPath = '/foo/bar/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-1/2020.10.1';
const String pluginPath = '/foo/bar/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-1/2020.10.1.plugins';
final FileSystem fileSystem = MemoryFileSystem.test();
final Directory cacheDirectory = fileSystem.directory(cachePath)
..createSync(recursive: true);
cacheDirectory
.childFile('.home')
.writeAsStringSync(installPath, flush: true);
final Directory installedDirectory = fileSystem.directory(installPath);
installedDirectory.createSync(recursive: true);
// Create plugin JAR file for Flutter and Dart plugin.
createIntellijFlutterPluginJar('$pluginPath/flutter-intellij/lib/flutter-intellij.jar', fileSystem, version: '50.0');
createIntellijDartPluginJar('$pluginPath/Dart/lib/Dart.jar', fileSystem);
final Iterable<DoctorValidator> installed = IntelliJValidatorOnLinux.installed(
fileSystem: fileSystem,
fileSystemUtils: FileSystemUtils(fileSystem: fileSystem, platform: linuxPlatform),
userMessages: UserMessages(),
);
expect(1, installed.length);
final ValidationResult result = await installed.toList()[0].validate();
expect(ValidationType.success, result.type);
});
testWithoutContext('intellij(>=2020.2) plugins check on linux (installed via JetBrains ToolBox app)', () async {
const String cachePath = '/foo/bar/.cache/JetBrains/IntelliJIdea2020.10';
const String installPath = '/foo/bar/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-1/2020.10.1';
const String pluginPath = '/foo/bar/.local/share/JetBrains/IntelliJIdea2020.10';
final FileSystem fileSystem = MemoryFileSystem.test();
final Directory cacheDirectory = fileSystem.directory(cachePath)
..createSync(recursive: true);
cacheDirectory
.childFile('.home')
.writeAsStringSync(installPath, flush: true);
final Directory installedDirectory = fileSystem.directory(installPath);
installedDirectory.createSync(recursive: true);
// Create plugin JAR file for Flutter and Dart plugin.
createIntellijFlutterPluginJar('$pluginPath/flutter-intellij/lib/flutter-intellij.jar', fileSystem, version: '50.0');
createIntellijDartPluginJar('$pluginPath/Dart/lib/Dart.jar', fileSystem);
final Iterable<DoctorValidator> installed = IntelliJValidatorOnLinux.installed(
fileSystem: fileSystem,
fileSystemUtils: FileSystemUtils(fileSystem: fileSystem, platform: linuxPlatform),
userMessages: UserMessages(),
);
expect(1, installed.length);
final ValidationResult result = await installed.toList()[0].validate();
expect(ValidationType.success, result.type);
});
testWithoutContext('intellij(2020.1~) plugins check on linux (installed via tar.gz)', () async {
const String cachePath = '/foo/bar/.cache/JetBrains/IdeaIC2020.10';
const String installPath = '/foo/bar/some/dir/ideaIC-2020.10.1/idea-IC-201.0000.00';
const String pluginPath = '/foo/bar/.local/share/JetBrains/IdeaIC2020.10';
final FileSystem fileSystem = MemoryFileSystem.test();
final Directory cacheDirectory = fileSystem.directory(cachePath)
..createSync(recursive: true);
cacheDirectory
.childFile('.home')
.writeAsStringSync(installPath, flush: true);
final Directory installedDirectory = fileSystem.directory(installPath);
installedDirectory.createSync(recursive: true);
// Create plugin JAR file for Flutter and Dart plugin.
createIntellijFlutterPluginJar('$pluginPath/flutter-intellij/lib/flutter-intellij.jar', fileSystem, version: '50.0');
createIntellijDartPluginJar('$pluginPath/Dart/lib/Dart.jar', fileSystem);
final Iterable<DoctorValidator> installed = IntelliJValidatorOnLinux.installed(
fileSystem: fileSystem,
fileSystemUtils: FileSystemUtils(fileSystem: fileSystem, platform: linuxPlatform),
userMessages: UserMessages(),
);
expect(1, installed.length);
final ValidationResult result = await installed.toList()[0].validate();
expect(ValidationType.success, result.type);
});
testWithoutContext('legacy intellij(<2020) plugins check on windows', () async {
const String cachePath = r'C:\Users\foo\.IntelliJIdea2019.10\system';
const String installPath = r'C:\Program Files\JetBrains\IntelliJ IDEA Ultimate Edition 2019.10.1';
const String pluginPath = r'C:\Users\foo\.IntelliJIdea2019.10\config\plugins';
final FileSystem fileSystem = MemoryFileSystem.test(style: FileSystemStyle.windows);
final Directory cacheDirectory = fileSystem.directory(cachePath)
..createSync(recursive: true);
cacheDirectory
.childFile('.home')
.writeAsStringSync(installPath, flush: true);
final Directory installedDirectory = fileSystem.directory(installPath);
installedDirectory.createSync(recursive: true);
createIntellijFlutterPluginJar('$pluginPath/flutter-intellij/lib/flutter-intellij.jar', fileSystem, version: '50.0');
createIntellijDartPluginJar('$pluginPath/Dart/lib/Dart.jar', fileSystem);
final Iterable<DoctorValidator> installed = IntelliJValidatorOnWindows.installed(
fileSystem: fileSystem,
fileSystemUtils: FileSystemUtils(fileSystem: fileSystem, platform: windowsPlatform),
platform: windowsPlatform,
userMessages: UserMessages(),
);
expect(1, installed.length);
final ValidationResult result = await installed.toList()[0].validate();
expect(ValidationType.success, result.type);
});
testWithoutContext('intellij(2020.1 ~ 2020.2) plugins check on windows (installed via JetBrains ToolBox app)', () async {
const String cachePath = r'C:\Users\foo\AppData\Local\JetBrains\IntelliJIdea2020.10';
const String installPath = r'C:\Users\foo\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\201.0000.00';
const String pluginPath = r'C:\Users\foo\AppData\Roaming\JetBrains\IntelliJIdea2020.10\plugins';
final FileSystem fileSystem = MemoryFileSystem.test(style: FileSystemStyle.windows);
final Directory cacheDirectory = fileSystem.directory(cachePath)
..createSync(recursive: true);
cacheDirectory
.childFile('.home')
.writeAsStringSync(installPath, flush: true);
final Directory installedDirectory = fileSystem.directory(installPath);
installedDirectory.createSync(recursive: true);
createIntellijFlutterPluginJar(pluginPath + r'\flutter-intellij\lib\flutter-intellij.jar', fileSystem, version: '50.0');
createIntellijDartPluginJar(pluginPath + r'\Dart\lib\Dart.jar', fileSystem);
final Iterable<DoctorValidator> installed = IntelliJValidatorOnWindows.installed(
fileSystem: fileSystem,
fileSystemUtils: FileSystemUtils(fileSystem: fileSystem, platform: windowsPlatform),
platform: windowsPlatform,
userMessages: UserMessages(),
);
expect(1, installed.length);
final ValidationResult result = await installed.toList()[0].validate();
expect(ValidationType.success, result.type);
});
testWithoutContext('intellij(>=2020.3) plugins check on windows (installed via JetBrains ToolBox app and plugins)', () async {
const String cachePath = r'C:\Users\foo\AppData\Local\JetBrains\IntelliJIdea2020.10';
const String installPath = r'C:\Users\foo\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\201.0000.00';
const String pluginPath = r'C:\Users\foo\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\201.0000.00.plugins';
final FileSystem fileSystem = MemoryFileSystem.test(style: FileSystemStyle.windows);
final Directory cacheDirectory = fileSystem.directory(cachePath)
..createSync(recursive: true);
cacheDirectory
.childFile('.home')
.writeAsStringSync(installPath, flush: true);
final Directory installedDirectory = fileSystem.directory(installPath);
installedDirectory.createSync(recursive: true);
createIntellijFlutterPluginJar(pluginPath + r'\flutter-intellij\lib\flutter-intellij.jar', fileSystem, version: '50.0');
createIntellijDartPluginJar(pluginPath + r'\Dart\lib\Dart.jar', fileSystem);
final Iterable<DoctorValidator> installed = IntelliJValidatorOnWindows.installed(
fileSystem: fileSystem,
fileSystemUtils: FileSystemUtils(fileSystem: fileSystem, platform: windowsPlatform),
platform: windowsPlatform,
userMessages: UserMessages(),
);
expect(1, installed.length);
final ValidationResult result = await installed.toList()[0].validate();
expect(ValidationType.success, result.type);
});
testWithoutContext('intellij(2020.1~) plugins check on windows (installed via installer)', () async {
const String cachePath = r'C:\Users\foo\AppData\Local\JetBrains\IdeaIC2020.10';
const String installPath = r'C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.10.1';
const String pluginPath = r'C:\Users\foo\AppData\Roaming\JetBrains\IdeaIC2020.10\plugins';
final FileSystem fileSystem = MemoryFileSystem.test(style: FileSystemStyle.windows);
final Directory cacheDirectory = fileSystem.directory(cachePath)
..createSync(recursive: true);
cacheDirectory
.childFile('.home')
.writeAsStringSync(installPath, flush: true);
final Directory installedDirectory = fileSystem.directory(installPath);
installedDirectory.createSync(recursive: true);
createIntellijFlutterPluginJar(pluginPath + r'\flutter-intellij\lib\flutter-intellij.jar', fileSystem, version: '50.0');
createIntellijDartPluginJar(pluginPath + r'\Dart\lib\Dart.jar', fileSystem);
final Iterable<DoctorValidator> installed = IntelliJValidatorOnWindows.installed(
fileSystem: fileSystem,
fileSystemUtils: FileSystemUtils(fileSystem: fileSystem, platform: windowsPlatform),
platform: windowsPlatform,
userMessages: UserMessages(),
);
expect(1, installed.length);
final ValidationResult result = await installed.toList()[0].validate();
expect(ValidationType.success, result.type);
});
testWithoutContext('can locate installations on macOS from Spotlight', () {
final FileSystem fileSystem = MemoryFileSystem.test();
final String ceRandomLocation = fileSystem.path.join(
'/',
'random',
'IntelliJ CE (stable).app',
);
final String ultimateRandomLocation = fileSystem.path.join(
'/',
'random',
'IntelliJ UE (stable).app',
);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>[
'mdfind',
'kMDItemCFBundleIdentifier="com.jetbrains.intellij.ce"',
],
stdout: ceRandomLocation,
),
FakeCommand(
command: const <String>[
'mdfind',
'kMDItemCFBundleIdentifier="com.jetbrains.intellij*"',
],
stdout: '$ultimateRandomLocation\n$ceRandomLocation',
),
]);
final Iterable<IntelliJValidatorOnMac> validators = IntelliJValidator.installedValidators(
fileSystem: fileSystem,
platform: macPlatform,
userMessages: UserMessages(),
processManager: processManager,
plistParser: FakePlistParser(<String, String>{
PlistParser.kCFBundleShortVersionStringKey: '2020.10',
PlistParser.kCFBundleIdentifierKey: 'com.jetbrains.intellij',
}),
logger: BufferLogger.test(),
).whereType<IntelliJValidatorOnMac>();
expect(validators.length, 2);
final IntelliJValidatorOnMac ce = validators.where((IntelliJValidatorOnMac validator) => validator.id == 'IdeaIC').single;
expect(ce.title, 'IntelliJ IDEA Community Edition');
expect(ce.installPath, ceRandomLocation);
final IntelliJValidatorOnMac ultimate = validators.where((IntelliJValidatorOnMac validator) => validator.id == 'IntelliJIdea').single;
expect(ultimate.title, 'IntelliJ IDEA Ultimate Edition');
expect(ultimate.installPath, ultimateRandomLocation);
});
testWithoutContext('Intellij plugins path checking on mac', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final Directory pluginsDirectory = fileSystem.directory('/foo/bar/Library/Application Support/JetBrains/TestID2020.10/plugins')
..createSync(recursive: true);
final IntelliJValidatorOnMac validator = IntelliJValidatorOnMac(
'Test',
'TestID',
'/path/to/app',
fileSystem: fileSystem,
homeDirPath: '/foo/bar',
userMessages: UserMessages(),
plistParser: FakePlistParser(<String, String>{
PlistParser.kCFBundleShortVersionStringKey: '2020.10',
})
);
expect(validator.plistFile, '/path/to/app/Contents/Info.plist');
expect(validator.pluginsPath, pluginsDirectory.path);
});
testWithoutContext('legacy Intellij plugins path checking on mac', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final IntelliJValidatorOnMac validator = IntelliJValidatorOnMac(
'Test',
'TestID',
'/foo',
fileSystem: fileSystem,
homeDirPath: '/foo/bar',
userMessages: UserMessages(),
plistParser: FakePlistParser(<String, String>{
PlistParser.kCFBundleShortVersionStringKey: '2020.10',
})
);
expect(validator.pluginsPath, '/foo/bar/Library/Application Support/TestID2020.10');
});
testWithoutContext('Intellij plugins path checking on mac with JetBrains toolbox override', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final IntelliJValidatorOnMac validator = IntelliJValidatorOnMac(
'Test',
'TestID',
'/foo',
fileSystem: fileSystem,
homeDirPath: '/foo/bar',
userMessages: UserMessages(),
plistParser: FakePlistParser(<String, String>{
'JetBrainsToolboxApp': '/path/to/JetBrainsToolboxApp',
})
);
expect(validator.pluginsPath, '/path/to/JetBrainsToolboxApp.plugins');
});
testWithoutContext('IntelliJValidatorOnMac.installed() handles FileSystemExceptions)', () async {
const FileSystemException exception = FileSystemException('cannot list');
final FileSystem fileSystem = _ThrowingFileSystem(exception);
final FakeProcessManager processManager = FakeProcessManager.empty();
final Iterable<DoctorValidator> validators = IntelliJValidatorOnMac.installed(
fileSystem: fileSystem,
fileSystemUtils: FileSystemUtils(fileSystem: fileSystem, platform: macPlatform),
userMessages: UserMessages(),
plistParser: FakePlistParser(<String, String>{
'JetBrainsToolboxApp': '/path/to/JetBrainsToolboxApp',
'CFBundleIdentifier': 'com.jetbrains.toolbox.linkapp',
}),
processManager: processManager,
logger: BufferLogger.test(),
);
expect(validators.length, 1);
final DoctorValidator validator = validators.first;
expect(validator, isA<ValidatorWithResult>());
expect(validator.title, 'Cannot determine if IntelliJ is installed');
});
testWithoutContext('Remove JetBrains Toolbox', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final List<String> installPaths = <String>[
fileSystem.path.join('/', 'foo', 'bar', 'Applications',
'JetBrains Toolbox', 'IntelliJ IDEA Ultimate.app'),
fileSystem.path.join('/', 'foo', 'bar', 'Applications',
'JetBrains Toolbox', 'IntelliJ IDEA Community Edition.app')
];
for (final String installPath in installPaths) {
fileSystem.directory(installPath).createSync(recursive: true);
}
final FakeProcessManager processManager =
FakeProcessManager.list(<FakeCommand>[
const FakeCommand(command: <String>[
'mdfind',
'kMDItemCFBundleIdentifier="com.jetbrains.intellij.ce"',
], stdout: 'skip'),
const FakeCommand(command: <String>[
'mdfind',
'kMDItemCFBundleIdentifier="com.jetbrains.intellij*"',
], stdout: 'skip')
]);
final Iterable<DoctorValidator> installed = IntelliJValidatorOnMac.installed(
fileSystem: fileSystem,
fileSystemUtils: FileSystemUtils(fileSystem: fileSystem, platform: macPlatform),
userMessages: UserMessages(),
plistParser: FakePlistParser(<String, String>{
'JetBrainsToolboxApp': '/path/to/JetBrainsToolboxApp',
'CFBundleIdentifier': 'com.jetbrains.toolbox.linkapp',
}),
processManager: processManager,
logger: BufferLogger.test(),
);
expect(installed.length, 0);
expect(processManager, hasNoRemainingExpectations);
});
testWithoutContext('Does not crash when installation is missing its CFBundleIdentifier property', () async {
final BufferLogger logger = BufferLogger.test();
final FileSystem fileSystem = MemoryFileSystem.test();
final String ultimatePath = fileSystem.path.join('/', 'foo', 'bar', 'Applications',
'JetBrains Toolbox', 'IntelliJ IDEA Ultimate.app');
final String communityEditionPath = fileSystem.path.join('/', 'foo', 'bar', 'Applications',
'JetBrains Toolbox', 'IntelliJ IDEA Community Edition.app');
final List<String> installPaths = <String>[
ultimatePath,
communityEditionPath
];
for (final String installPath in installPaths) {
fileSystem.directory(installPath).createSync(recursive: true);
}
final FakeProcessManager processManager =
FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: const <String>[
'mdfind',
'kMDItemCFBundleIdentifier="com.jetbrains.intellij.ce"',
], stdout: communityEditionPath),
FakeCommand(command: const <String>[
'mdfind',
'kMDItemCFBundleIdentifier="com.jetbrains.intellij*"',
], stdout: ultimatePath)
]);
final Iterable<DoctorValidator> installed = IntelliJValidatorOnMac.installed(
fileSystem: fileSystem,
fileSystemUtils: FileSystemUtils(fileSystem: fileSystem, platform: macPlatform),
userMessages: UserMessages(),
plistParser: FakePlistParser(<String, String>{
'JetBrainsToolboxApp': '/path/to/JetBrainsToolboxApp',
}),
processManager: processManager,
logger: logger,
);
expect(installed.length, 2);
expect(logger.traceText, contains('installation at $ultimatePath has a null CFBundleIdentifierKey'));
expect(processManager, hasNoRemainingExpectations);
});
}
class IntelliJValidatorTestTarget extends IntelliJValidator {
IntelliJValidatorTestTarget(super.title, super.installPath, FileSystem fileSystem)
: super(fileSystem: fileSystem, userMessages: UserMessages());
@override
String get pluginsPath => 'plugins';
@override
String get version => 'test.test.test';
}
/// A helper to create a Intellij Flutter plugin jar.
///
/// These file contents were derived from the META-INF/plugin.xml from an Intellij Flutter
/// plugin installation.
///
/// The file is located in a plugin JAR, which can be located by looking at the plugin
/// path for the Intellij and Android Studio validators.
///
/// If more XML contents are needed, prefer modifying these contents over checking
/// in another JAR.
void createIntellijFlutterPluginJar(String pluginJarPath, FileSystem fileSystem, {String version = '0.1.3'}) {
final String intellijFlutterPluginXml = '''
<idea-plugin version="2">
<id>io.flutter</id>
<name>Flutter</name>
<description>Support for developing Flutter applications.</description>
<vendor url="https://github.com/flutter/flutter-intellij">flutter.io</vendor>
<category>Custom Languages</category>
<version>$version</version>
<idea-version since-build="162.1" until-build="163.*"/>
</idea-plugin>
''';
final List<int> flutterPluginBytes = utf8.encode(intellijFlutterPluginXml);
final Archive flutterPlugins = Archive();
flutterPlugins.addFile(ArchiveFile('META-INF/plugin.xml', flutterPluginBytes.length, flutterPluginBytes));
fileSystem.file(pluginJarPath)
..createSync(recursive: true)
..writeAsBytesSync(ZipEncoder().encode(flutterPlugins)!);
}
/// A helper to create a Intellij Dart plugin jar.
///
/// This jar contains META-INF/plugin.xml.
/// Its contents were derived from the META-INF/plugin.xml from an Intellij Dart
/// plugin installation.
///
/// The file is located in a plugin JAR, which can be located by looking at the plugin
/// path for the Intellij and Android Studio validators.
///
/// If more XML contents are needed, prefer modifying these contents over checking
/// in another JAR.
void createIntellijDartPluginJar(String pluginJarPath, FileSystem fileSystem) {
const String intellijDartPluginXml = r'''
<idea-plugin version="2">
<name>Dart</name>
<version>162.2485</version>
<idea-version since-build="162.1121" until-build="162.*"/>
<description>Support for Dart programming language</description>
<vendor>JetBrains</vendor>
<depends>com.intellij.modules.xml</depends>
<depends optional="true" config-file="dartium-debugger-support.xml">JavaScriptDebugger</depends>
<depends optional="true" config-file="dart-yaml.xml">org.jetbrains.plugins.yaml</depends>
<depends optional="true" config-file="dart-copyright.xml">com.intellij.copyright</depends>
<depends optional="true" config-file="dart-coverage.xml">com.intellij.modules.coverage</depends>
</idea-plugin>
''';
final List<int> dartPluginBytes = utf8.encode(intellijDartPluginXml);
final Archive dartPlugins = Archive();
dartPlugins.addFile(ArchiveFile('META-INF/plugin.xml', dartPluginBytes.length, dartPluginBytes));
fileSystem.file(pluginJarPath)
..createSync(recursive: true)
..writeAsBytesSync(ZipEncoder().encode(dartPlugins)!);
}
// TODO(fujino): this should use the MemoryFileSystem and a
// FileExceptionHandler, blocked by https://github.com/google/file.dart/issues/227.
class _ThrowingFileSystem extends Fake implements FileSystem {
_ThrowingFileSystem(this._exception);
final Exception _exception;
final MemoryFileSystem memfs = MemoryFileSystem.test();
@override
Context get path => memfs.path;
@override
Directory directory(dynamic _) => _ThrowingDirectory(_exception);
}
class _ThrowingDirectory extends Fake implements Directory {
_ThrowingDirectory(this._exception);
final Exception _exception;
@override
bool existsSync() => true;
@override
List<FileSystemEntity> listSync({bool recursive = false, bool followLinks = true}) => throw _exception;
}
| flutter/packages/flutter_tools/test/general.shard/intellij/intellij_validator_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/intellij/intellij_validator_test.dart",
"repo_id": "flutter",
"token_count": 9027
} | 815 |
// 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_tools/src/base/platform.dart';
import 'package:flutter_tools/src/features.dart';
import 'package:flutter_tools/src/linux/linux_workflow.dart';
import '../../src/common.dart';
import '../../src/fakes.dart';
void main() {
final Platform linux = FakePlatform(
environment: <String, String>{},
);
final Platform notLinux = FakePlatform(
operatingSystem: 'windows',
environment: <String, String>{},
);
final FeatureFlags enabledFlags = TestFeatureFlags(
isLinuxEnabled: true,
);
final FeatureFlags disabledFlags = TestFeatureFlags();
testWithoutContext('Applies to Linux platform', () {
final LinuxWorkflow linuxWorkflow = LinuxWorkflow(
platform: linux,
featureFlags: enabledFlags,
);
expect(linuxWorkflow.appliesToHostPlatform, true);
expect(linuxWorkflow.canLaunchDevices, true);
expect(linuxWorkflow.canListDevices, true);
expect(linuxWorkflow.canListEmulators, false);
});
testWithoutContext('Does not apply to non-Linux platform', () {
final LinuxWorkflow linuxWorkflow = LinuxWorkflow(
platform: notLinux,
featureFlags: enabledFlags,
);
expect(linuxWorkflow.appliesToHostPlatform, false);
expect(linuxWorkflow.canLaunchDevices, false);
expect(linuxWorkflow.canListDevices, false);
expect(linuxWorkflow.canListEmulators, false);
});
testWithoutContext('Does not apply when the Linux desktop feature is disabled', () {
final LinuxWorkflow linuxWorkflow = LinuxWorkflow(
platform: linux,
featureFlags: disabledFlags,
);
expect(linuxWorkflow.appliesToHostPlatform, false);
expect(linuxWorkflow.canLaunchDevices, false);
expect(linuxWorkflow.canListDevices, false);
expect(linuxWorkflow.canListEmulators, false);
});
}
| flutter/packages/flutter_tools/test/general.shard/linux/linux_workflow_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/linux/linux_workflow_test.dart",
"repo_id": "flutter",
"token_count": 628
} | 816 |
// 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:file/memory.dart';
import 'package:flutter_tools/src/application_package.dart';
import 'package:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/bundle.dart';
import 'package:flutter_tools/src/bundle_builder.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/device.dart';
import 'package:flutter_tools/src/preview_device.dart';
import 'package:flutter_tools/src/project.dart';
import 'package:meta/meta.dart';
import 'package:test/fake.dart';
import '../src/common.dart';
import '../src/context.dart';
import '../src/fakes.dart';
void main() {
String? flutterRootBackup;
late MemoryFileSystem fs;
late File previewBinary;
setUp(() {
fs = MemoryFileSystem.test(style: FileSystemStyle.windows);
Cache.flutterRoot = r'C:\path\to\flutter';
previewBinary = fs.file('${Cache.flutterRoot}\\bin\\cache\\artifacts\\flutter_preview\\flutter_preview.exe');
previewBinary.createSync(recursive: true);
flutterRootBackup = Cache.flutterRoot;
});
tearDown(() {
Cache.flutterRoot = flutterRootBackup;
});
testWithoutContext('PreviewDevice defaults', () async {
final PreviewDevice device = PreviewDevice(
artifacts: Artifacts.test(),
fileSystem: fs,
processManager: FakeProcessManager.any(),
previewBinary: previewBinary,
logger: BufferLogger.test(),
);
expect(await device.isLocalEmulator, false);
expect(device.name, 'Preview');
expect(await device.sdkNameAndVersion, 'preview');
expect(await device.targetPlatform, TargetPlatform.windows_x64);
expect(device.category, Category.desktop);
expect(device.ephemeral, false);
expect(device.id, 'preview');
expect(device.isSupported(), true);
expect(device.isSupportedForProject(FakeFlutterProject()), true);
expect(await device.isLatestBuildInstalled(FakeApplicationPackage()), false);
expect(await device.isAppInstalled(FakeApplicationPackage()), false);
expect(await device.uninstallApp(FakeApplicationPackage()), true);
});
testUsingContext('Can build a simulator app', () async {
final Completer<void> completer = Completer<void>();
final BufferLogger logger = BufferLogger.test();
final PreviewDevice device = PreviewDevice(
artifacts: Artifacts.test(),
fileSystem: fs,
previewBinary: previewBinary,
processManager: FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>[
r'C:\.tmp_rand0\flutter_preview.rand0\flutter_preview.exe',
],
stdout: 'The Dart VM service is listening on http://127.0.0.1:64494/fZ_B2N6JRwY=/\n',
completer: completer,
),
]),
logger: logger,
builderFactory: () => FakeBundleBuilder(fs),
);
final Directory previewDeviceCacheDir = fs
.directory('Artifact.windowsDesktopPath.TargetPlatform.windows_x64.debug')
..createSync(recursive: true);
previewDeviceCacheDir.childFile('flutter_windows.dll').writeAsStringSync('1010101');
previewDeviceCacheDir.childFile('icudtl.dat').writeAsStringSync('1010101');
final LaunchResult result = await device.startApp(
FakeApplicationPackage(),
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
);
expect(result.started, true);
expect(result.vmServiceUri, Uri.parse('http://127.0.0.1:64494/fZ_B2N6JRwY=/'));
});
group('PreviewDeviceDiscovery', () {
late Artifacts artifacts;
late ProcessManager processManager;
final FakePlatform windowsPlatform = FakePlatform(operatingSystem: 'windows');
final FakePlatform macPlatform = FakePlatform(operatingSystem: 'macos');
final FakePlatform linuxPlatform = FakePlatform();
final TestFeatureFlags featureFlags = TestFeatureFlags(isPreviewDeviceEnabled: true);
setUp(() {
artifacts = Artifacts.test(fileSystem: fs);
processManager = FakeProcessManager.empty();
});
testWithoutContext('PreviewDeviceDiscovery on linux', () async {
final PreviewDeviceDiscovery discovery = PreviewDeviceDiscovery(
artifacts: artifacts,
fileSystem: fs,
logger: BufferLogger.test(),
processManager: processManager,
platform: linuxPlatform,
featureFlags: featureFlags,
);
final List<Device> devices = await discovery.devices();
expect(devices, isEmpty);
});
testWithoutContext('PreviewDeviceDiscovery on macOS', () async {
final PreviewDeviceDiscovery discovery = PreviewDeviceDiscovery(
artifacts: artifacts,
fileSystem: fs,
logger: BufferLogger.test(),
processManager: processManager,
platform: macPlatform,
featureFlags: featureFlags,
);
final List<Device> devices = await discovery.devices();
expect(devices, isEmpty);
});
testWithoutContext('PreviewDeviceDiscovery on Windows returns preview when binary exists', () async {
// ensure Flutter preview binary exists in cache.
fs.file(artifacts.getArtifactPath(Artifact.flutterPreviewDevice)).writeAsBytesSync(<int>[1, 0, 0, 1]);
final PreviewDeviceDiscovery discovery = PreviewDeviceDiscovery(
artifacts: artifacts,
fileSystem: fs,
logger: BufferLogger.test(),
processManager: processManager,
platform: windowsPlatform,
featureFlags: featureFlags,
);
final List<Device> devices = await discovery.devices();
expect(devices, hasLength(1));
final Device previewDevice = devices.first;
expect(previewDevice, isA<PreviewDevice>());
});
testWithoutContext('PreviewDeviceDiscovery on Windows returns nothing when binary does not exist', () async {
final PreviewDeviceDiscovery discovery = PreviewDeviceDiscovery(
artifacts: artifacts,
fileSystem: fs,
logger: BufferLogger.test(),
processManager: processManager,
platform: windowsPlatform,
featureFlags: featureFlags,
);
final List<Device> devices = await discovery.devices();
expect(devices, isEmpty);
});
});
}
class FakeFlutterProject extends Fake implements FlutterProject { }
class FakeApplicationPackage extends Fake implements ApplicationPackage { }
class FakeBundleBuilder extends Fake implements BundleBuilder {
FakeBundleBuilder(this.fileSystem);
final FileSystem fileSystem;
@override
Future<void> build({
required TargetPlatform platform,
required BuildInfo buildInfo,
FlutterProject? project,
String? mainPath,
String manifestPath = defaultManifestPath,
String? applicationKernelFilePath,
String? depfilePath,
String? assetDirPath,
bool buildNativeAssets = true,
@visibleForTesting BuildSystem? buildSystem
}) async {
final Directory assetDirectory = fileSystem
.directory(assetDirPath)
.childDirectory('flutter_assets')
..createSync(recursive: true);
assetDirectory.childFile('kernel_blob.bin').createSync();
}
}
| flutter/packages/flutter_tools/test/general.shard/preview_device_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/preview_device_test.dart",
"repo_id": "flutter",
"token_count": 2564
} | 817 |
// 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_tools/src/devfs.dart';
import 'package:flutter_tools/src/reporting/reporting.dart';
import 'package:flutter_tools/src/resident_runner.dart';
import 'package:flutter_tools/src/run_hot.dart';
import 'package:flutter_tools/src/vmservice.dart';
import 'package:test/fake.dart';
import 'package:unified_analytics/unified_analytics.dart';
import 'package:vm_service/vm_service.dart' as vm_service;
//import '../src/context.dart';
import '../src/common.dart';
void main() {
testWithoutContext('defaultReloadSourcesHelper() handles empty DeviceReloadReports)', () {
defaultReloadSourcesHelper(
_FakeHotRunner(),
<FlutterDevice?>[_FakeFlutterDevice()],
false,
const <String, dynamic>{},
'android',
'flutter-sdk',
false,
'test-reason',
TestUsage(),
const NoOpAnalytics(),
);
});
}
class _FakeHotRunner extends Fake implements HotRunner {}
class _FakeDevFS extends Fake implements DevFS {
@override
final Uri? baseUri = Uri();
@override
void resetLastCompiled() {}
}
class _FakeFlutterDevice extends Fake implements FlutterDevice {
@override
final DevFS? devFS = _FakeDevFS();
@override
final FlutterVmService? vmService = _FakeFlutterVmService();
}
class _FakeFlutterVmService extends Fake implements FlutterVmService {
@override
final vm_service.VmService service = _FakeVmService();
}
class _FakeVmService extends Fake implements vm_service.VmService {
@override
Future<_FakeVm> getVM() async => _FakeVm();
}
class _FakeVm extends Fake implements vm_service.VM {
final List<vm_service.IsolateRef> _isolates = <vm_service.IsolateRef>[];
@override
List<vm_service.IsolateRef>? get isolates => _isolates;
}
| flutter/packages/flutter_tools/test/general.shard/run_hot_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/run_hot_test.dart",
"repo_id": "flutter",
"token_count": 655
} | 818 |
// 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:fake_async/fake_async.dart';
import 'package:file/memory.dart';
import 'package:file_testing/file_testing.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/convert.dart';
import 'package:flutter_tools/src/tracing.dart';
import 'package:flutter_tools/src/vmservice.dart';
import 'package:vm_service/vm_service.dart' as vm_service;
import '../src/common.dart';
import '../src/fake_vm_services.dart';
final vm_service.Isolate fakeUnpausedIsolate = vm_service.Isolate(
id: '1',
pauseEvent: vm_service.Event(
kind: vm_service.EventKind.kResume,
timestamp: 0
),
breakpoints: <vm_service.Breakpoint>[],
libraries: <vm_service.LibraryRef>[
vm_service.LibraryRef(
id: '1',
uri: 'file:///hello_world/main.dart',
name: '',
),
],
livePorts: 0,
name: 'test',
number: '1',
pauseOnExit: false,
runnable: true,
startTime: 0,
isSystemIsolate: false,
isolateFlags: <vm_service.IsolateFlag>[],
);
final FlutterView fakeFlutterView = FlutterView(
id: 'a',
uiIsolate: fakeUnpausedIsolate,
);
final FakeVmServiceRequest listViews = FakeVmServiceRequest(
method: kListViewsMethod,
jsonResponse: <String, Object>{
'views': <Object>[
fakeFlutterView.toJson(),
],
},
);
final List<FakeVmServiceRequest> vmServiceSetup = <FakeVmServiceRequest>[
const FakeVmServiceRequest(
method: 'streamListen',
args: <String, Object>{
'streamId': vm_service.EventKind.kExtension,
}
),
listViews,
// Satisfies didAwaitFirstFrame
const FakeVmServiceRequest(
method: 'ext.flutter.didSendFirstFrameRasterizedEvent',
args: <String, Object>{
'isolateId': '1',
},
jsonResponse: <String, Object>{
'enabled': 'true',
},
),
];
void main() {
testWithoutContext('Can trace application startup', () async {
final BufferLogger logger = BufferLogger.test();
final FileSystem fileSystem = MemoryFileSystem.test();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(requests: <FakeVmServiceRequest>[
...vmServiceSetup,
FakeVmServiceRequest(
method: 'getVMTimeline',
jsonResponse: vm_service.Timeline(
timeExtentMicros: 4,
timeOriginMicros: 0,
traceEvents: <vm_service.TimelineEvent>[
vm_service.TimelineEvent.parse(<String, Object>{
'name': kFlutterEngineMainEnterEventName,
'ts': 0,
})!,
vm_service.TimelineEvent.parse(<String, Object>{
'name': kFrameworkInitEventName,
'ts': 1,
})!,
vm_service.TimelineEvent.parse(<String, Object>{
'name': kFirstFrameBuiltEventName,
'ts': 2,
})!,
vm_service.TimelineEvent.parse(<String, Object>{
'name': kFirstFrameRasterizedEventName,
'ts': 3,
})!,
],
).toJson(),
),
const FakeVmServiceRequest(
method: 'setVMTimelineFlags',
args: <String, Object>{
'recordedStreams': <Object>[],
},
),
]);
// Validate that old tracing data is deleted.
final File outFile = fileSystem.currentDirectory.childFile('start_up_info.json')
..writeAsStringSync('stale');
await downloadStartupTrace(fakeVmServiceHost.vmService,
output: fileSystem.currentDirectory,
logger: logger,
);
expect(outFile, exists);
expect(json.decode(outFile.readAsStringSync()), <String, Object>{
'engineEnterTimestampMicros': 0,
'timeToFrameworkInitMicros': 1,
'timeToFirstFrameRasterizedMicros': 3,
'timeToFirstFrameMicros': 2,
'timeAfterFrameworkInitMicros': 1,
});
});
testWithoutContext('throws tool exit if the vmservice disconnects', () async {
final BufferLogger logger = BufferLogger.test();
final FileSystem fileSystem = MemoryFileSystem.test();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(requests: <FakeVmServiceRequest>[
...vmServiceSetup,
const FakeVmServiceRequest(
method: 'getVMTimeline',
error: FakeRPCError(code: RPCErrorCodes.kServiceDisappeared),
),
const FakeVmServiceRequest(
method: 'setVMTimelineFlags',
args: <String, Object>{
'recordedStreams': <Object>[],
},
),
]);
await expectLater(() async => downloadStartupTrace(fakeVmServiceHost.vmService,
output: fileSystem.currentDirectory,
logger: logger,
), throwsToolExit(message: 'The device disconnected before the timeline could be retrieved.'));
});
testWithoutContext('throws tool exit if timeline is missing the engine start event', () async {
final BufferLogger logger = BufferLogger.test();
final FileSystem fileSystem = MemoryFileSystem.test();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(requests: <FakeVmServiceRequest>[
...vmServiceSetup,
FakeVmServiceRequest(
method: 'getVMTimeline',
jsonResponse: vm_service.Timeline(
timeExtentMicros: 4,
timeOriginMicros: 0,
traceEvents: <vm_service.TimelineEvent>[],
).toJson(),
),
const FakeVmServiceRequest(
method: 'setVMTimelineFlags',
args: <String, Object>{
'recordedStreams': <Object>[],
},
),
]);
await expectLater(() async => downloadStartupTrace(fakeVmServiceHost.vmService,
output: fileSystem.currentDirectory,
logger: logger,
), throwsToolExit(message: 'Engine start event is missing in the timeline'));
});
testWithoutContext('prints when first frame is taking a long time', () async {
final BufferLogger logger = BufferLogger.test();
final FileSystem fileSystem = MemoryFileSystem.test();
final Completer<void> completer = Completer<void>();
await FakeAsync().run((FakeAsync time) {
final Map<String, String> extensionData = <String, String>{
'test': 'data',
'renderedErrorText': 'error text',
};
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[
const FakeVmServiceRequest(
method: 'streamListen',
args: <String, Object>{
'streamId': vm_service.EventKind.kExtension,
}
),
const FakeVmServiceRequest(
method: kListViewsMethod,
jsonResponse: <String, Object>{
'views': <Object>[
<String, Object?>{
'id': '1',
// No isolate, no views.
'isolate': null,
}
],
},
),
FakeVmServiceStreamResponse(
streamId: 'Extension',
event: vm_service.Event(
timestamp: 0,
extensionKind: 'Flutter.Error',
extensionData: vm_service.ExtensionData.parse(extensionData),
kind: vm_service.EventStreams.kExtension,
),
),
]);
unawaited(downloadStartupTrace(fakeVmServiceHost.vmService,
output: fileSystem.currentDirectory,
logger: logger,
));
time.elapse(const Duration(seconds: 11));
time.flushMicrotasks();
completer.complete();
return completer.future;
});
expect(logger.statusText, contains('First frame is taking longer than expected'));
expect(logger.traceText, contains('View ID: 1'));
expect(logger.traceText, contains('No isolate ID associated with the view'));
expect(logger.traceText, contains('Flutter.Error: [ExtensionData {test: data, renderedErrorText: error text}]'));
});
testWithoutContext('throws tool exit if first frame events are missing', () async {
final BufferLogger logger = BufferLogger.test();
final FileSystem fileSystem = MemoryFileSystem.test();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(requests: <FakeVmServiceRequest>[
...vmServiceSetup,
FakeVmServiceRequest(
method: 'getVMTimeline',
jsonResponse: vm_service.Timeline(
timeExtentMicros: 4,
timeOriginMicros: 0,
traceEvents: <vm_service.TimelineEvent>[
vm_service.TimelineEvent.parse(<String, Object>{
'name': kFlutterEngineMainEnterEventName,
'ts': 0,
})!,
vm_service.TimelineEvent.parse(<String, Object>{
'name': kFrameworkInitEventName,
'ts': 1,
})!,
],
).toJson(),
),
const FakeVmServiceRequest(
method: 'setVMTimelineFlags',
args: <String, Object>{
'recordedStreams': <Object>[],
},
),
]);
await expectLater(() async => downloadStartupTrace(fakeVmServiceHost.vmService,
output: fileSystem.currentDirectory,
logger: logger,
), throwsToolExit(message: 'First frame events are missing in the timeline'));
});
testWithoutContext('Can trace application startup without awaiting for first frame', () async {
final BufferLogger logger = BufferLogger.test();
final FileSystem fileSystem = MemoryFileSystem.test();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(requests: <FakeVmServiceRequest>[
FakeVmServiceRequest(
method: 'getVMTimeline',
jsonResponse: vm_service.Timeline(
timeExtentMicros: 4,
timeOriginMicros: 0,
traceEvents: <vm_service.TimelineEvent>[
vm_service.TimelineEvent.parse(<String, Object>{
'name': kFlutterEngineMainEnterEventName,
'ts': 0,
})!,
vm_service.TimelineEvent.parse(<String, Object>{
'name': kFrameworkInitEventName,
'ts': 1,
})!,
],
).toJson(),
),
const FakeVmServiceRequest(
method: 'setVMTimelineFlags',
args: <String, Object>{
'recordedStreams': <Object>[],
},
),
]);
final File outFile = fileSystem.currentDirectory.childFile('start_up_info.json');
await downloadStartupTrace(fakeVmServiceHost.vmService,
output: fileSystem.currentDirectory,
logger: logger,
awaitFirstFrame: false,
);
expect(outFile, exists);
expect(json.decode(outFile.readAsStringSync()), <String, Object>{
'engineEnterTimestampMicros': 0,
'timeToFrameworkInitMicros': 1,
});
});
testWithoutContext('downloadStartupTrace also downloads the timeline', () async {
final BufferLogger logger = BufferLogger.test();
final FileSystem fileSystem = MemoryFileSystem.test();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(requests: <FakeVmServiceRequest>[
...vmServiceSetup,
FakeVmServiceRequest(
method: 'getVMTimeline',
jsonResponse: vm_service.Timeline(
timeExtentMicros: 4,
timeOriginMicros: 0,
traceEvents: <vm_service.TimelineEvent>[
vm_service.TimelineEvent.parse(<String, Object>{
'name': kFlutterEngineMainEnterEventName,
'ts': 0,
})!,
vm_service.TimelineEvent.parse(<String, Object>{
'name': kFrameworkInitEventName,
'ts': 1,
})!,
vm_service.TimelineEvent.parse(<String, Object>{
'name': kFirstFrameBuiltEventName,
'ts': 2,
})!,
vm_service.TimelineEvent.parse(<String, Object>{
'name': kFirstFrameRasterizedEventName,
'ts': 3,
})!,
],
).toJson(),
),
const FakeVmServiceRequest(
method: 'setVMTimelineFlags',
args: <String, Object>{
'recordedStreams': <Object>[],
},
),
]);
// Validate that old tracing data is deleted.
final File timelineFile = fileSystem.currentDirectory.childFile('start_up_timeline.json')
..writeAsStringSync('stale');
await downloadStartupTrace(fakeVmServiceHost.vmService,
output: fileSystem.currentDirectory,
logger: logger,
);
final Map<String, Object> expectedTimeline = <String, Object>{
'type': 'Timeline',
'traceEvents': <Object>[
<String, Object>{
'name': 'FlutterEngineMainEnter',
'ts': 0,
'type': 'TimelineEvent',
},
<String, Object>{
'name': 'Framework initialization',
'ts': 1,
'type': 'TimelineEvent',
},
<String, Object>{
'name': 'Widgets built first useful frame',
'ts': 2,
'type': 'TimelineEvent',
},
<String, Object>{
'name': 'Rasterized first useful frame',
'ts': 3,
'type': 'TimelineEvent',
},
],
'timeOriginMicros': 0,
'timeExtentMicros': 4,
};
expect(timelineFile, exists);
expect(json.decode(timelineFile.readAsStringSync()), expectedTimeline);
});
}
| flutter/packages/flutter_tools/test/general.shard/tracing_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/tracing_test.dart",
"repo_id": "flutter",
"token_count": 5668
} | 819 |
// 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/memory.dart';
import 'package:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/process.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/build.dart';
import '../../../src/context.dart'; // legacy
import '../../../src/fakes.dart';
import '../../../src/test_build_system.dart';
import '../../../src/test_flutter_command_runner.dart'; // legacy
void main() {
setUpAll(() {
Cache.flutterRoot = '';
Cache.disableLocking();
});
group('ScrubGeneratedPluginRegistrant', () {
// The files this migration deals with
late File gitignore;
late File registrant;
// Environment overrides
late Artifacts artifacts;
late FileSystem fileSystem;
late ProcessManager processManager;
late BuildSystem buildSystem;
late ProcessUtils processUtils;
late BufferLogger logger;
setUp(() {
// Prepare environment overrides
fileSystem = MemoryFileSystem.test();
artifacts = Artifacts.test(fileSystem: fileSystem);
processManager = FakeProcessManager.any();
logger = BufferLogger.test();
processUtils = ProcessUtils(
processManager: processManager,
logger: logger,
);
buildSystem = TestBuildSystem.all(BuildResult(success: true));
// Write some initial state into our testing filesystem
setupFileSystemForEndToEndTest(fileSystem);
// Initialize fileSystem references
gitignore = fileSystem.file('.gitignore');
registrant = fileSystem.file(fileSystem.path.join('lib', 'generated_plugin_registrant.dart'));
});
testUsingContext('noop - nothing to do - build runs', () async {
expect(gitignore.existsSync(), isFalse);
expect(registrant.existsSync(), isFalse);
await createTestCommandRunner(BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: buildSystem,
fileSystem: fileSystem,
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
processUtils: processUtils,
))
.run(<String>['build', 'web', '--no-pub']);
final Directory buildDir = fileSystem.directory(fileSystem.path.join('build', 'web'));
expect(buildDir.existsSync(), true);
}, overrides: <Type, Generator> {
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
BuildSystem: () => buildSystem,
});
testUsingContext('noop - .gitignore does not reference generated_plugin_registrant.dart - untouched', () async {
writeGitignore(fileSystem, mentionsPluginRegistrant: false);
final String contentsBeforeBuild = gitignore.readAsStringSync();
expect(contentsBeforeBuild, isNot(contains('lib/generated_plugin_registrant.dart')));
await createTestCommandRunner(BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: buildSystem,
fileSystem: fileSystem,
logger: logger,
osUtils: FakeOperatingSystemUtils(),
processUtils: processUtils,
))
.run(<String>['build', 'web', '--no-pub']);
expect(gitignore.readAsStringSync(), contentsBeforeBuild);
}, overrides: <Type, Generator> {
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
BuildSystem: () => buildSystem,
});
testUsingContext('.gitignore references generated_plugin_registrant - cleans it up', () async {
writeGitignore(fileSystem);
expect(gitignore.existsSync(), isTrue);
expect(gitignore.readAsStringSync(), contains('lib/generated_plugin_registrant.dart'));
await createTestCommandRunner(BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: buildSystem,
fileSystem: fileSystem,
logger: logger,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
))
.run(<String>['build', 'web', '--no-pub']);
expect(gitignore.readAsStringSync(), isNot(contains('lib/generated_plugin_registrant.dart')));
}, overrides: <Type, Generator> {
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
BuildSystem: () => buildSystem,
});
testUsingContext('generated_plugin_registrant.dart exists - gets deleted', () async {
writeGeneratedPluginRegistrant(fileSystem);
expect(registrant.existsSync(), isTrue);
await createTestCommandRunner(BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: buildSystem,
fileSystem: fileSystem,
logger: logger,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
))
.run(<String>['build', 'web', '--no-pub']);
expect(registrant.existsSync(), isFalse);
}, overrides: <Type, Generator> {
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
BuildSystem: () => buildSystem,
});
testUsingContext('scrubs generated_plugin_registrant file and cleans .gitignore', () async {
writeGitignore(fileSystem);
writeGeneratedPluginRegistrant(fileSystem);
expect(registrant.existsSync(), isTrue);
expect(gitignore.readAsStringSync(), contains('lib/generated_plugin_registrant.dart'));
await createTestCommandRunner(BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: buildSystem,
fileSystem: fileSystem,
logger: logger,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
))
.run(<String>['build', 'web', '--no-pub']);
expect(registrant.existsSync(), isFalse);
expect(gitignore.readAsStringSync(), isNot(contains('lib/generated_plugin_registrant.dart')));
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
BuildSystem: () => buildSystem,
});
});
}
// Writes something that resembles the contents of Flutter's .gitignore file
void writeGitignore(FileSystem fs, { bool mentionsPluginRegistrant = true }) {
fs.file('.gitignore').createSync(recursive: true);
fs.file('.gitignore')
.writeAsStringSync('''
/build/
# Web related
${mentionsPluginRegistrant ? 'lib/generated_plugin_registrant.dart':'another_file.dart'}
# Symbolication related
''');
}
// Creates an empty generated_plugin_registrant.dart file
void writeGeneratedPluginRegistrant(FileSystem fs) {
final String path = fs.path.join('lib', 'generated_plugin_registrant.dart');
fs.file(path).createSync(recursive: true);
}
// Adds a bunch of files to the filesystem
// (taken from commands.shard/hermetic/build_web_test.dart)
void setupFileSystemForEndToEndTest(FileSystem fileSystem) {
final List<String> dependencies = <String>[
'.packages',
fileSystem.path.join('web', 'index.html'),
fileSystem.path.join('lib', 'main.dart'),
fileSystem.path.join('packages', 'flutter_tools', 'lib', 'src', 'build_system', 'targets', 'web.dart'),
fileSystem.path.join('bin', 'cache', 'flutter_web_sdk'),
fileSystem.path.join('bin', 'cache', 'dart-sdk', 'bin', 'snapshots', 'dart2js.dart.snapshot'),
fileSystem.path.join('bin', 'cache', 'dart-sdk', 'bin', 'dart'),
fileSystem.path.join('bin', 'cache', 'dart-sdk '),
];
for (final String dependency in dependencies) {
fileSystem.file(dependency).createSync(recursive: true);
}
// Project files.
fileSystem.file('.packages')
.writeAsStringSync('''
foo:lib/
fizz:bar/lib/
''');
fileSystem.file('pubspec.yaml')
.writeAsStringSync('''
name: foo
dependencies:
flutter:
sdk: flutter
fizz:
path:
bar/
''');
fileSystem.file(fileSystem.path.join('bar', 'pubspec.yaml'))
..createSync(recursive: true)
..writeAsStringSync('''
name: bar
flutter:
plugin:
platforms:
web:
pluginClass: UrlLauncherPlugin
fileName: url_launcher_web.dart
''');
fileSystem.file(fileSystem.path.join('bar', 'lib', 'url_launcher_web.dart'))
..createSync(recursive: true)
..writeAsStringSync('''
class UrlLauncherPlugin {}
''');
fileSystem.file(fileSystem.path.join('lib', 'main.dart'))
.writeAsStringSync('void main() { }');
}
| flutter/packages/flutter_tools/test/general.shard/web/migrations/scrub_generated_plugin_registrant_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/web/migrations/scrub_generated_plugin_registrant_test.dart",
"repo_id": "flutter",
"token_count": 3225
} | 820 |
// 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';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/base/io.dart';
import '../../bin/xcode_backend.dart';
import '../src/common.dart' hide Context;
import '../src/fake_process_manager.dart';
void main() {
late MemoryFileSystem fileSystem;
setUp(() {
fileSystem = MemoryFileSystem();
});
group('build', () {
test('exits with useful error message when build mode not set', () {
final Directory buildDir = fileSystem.directory('/path/to/builds')
..createSync(recursive: true);
final Directory flutterRoot = fileSystem.directory('/path/to/flutter')
..createSync(recursive: true);
final File pipe = fileSystem.file('/tmp/pipe')
..createSync(recursive: true);
const String buildMode = 'Debug';
final TestContext context = TestContext(
<String>['build'],
<String, String>{
'ACTION': 'build',
'BUILT_PRODUCTS_DIR': buildDir.path,
'FLUTTER_ROOT': flutterRoot.path,
'INFOPLIST_PATH': 'Info.plist',
},
commands: <FakeCommand>[
FakeCommand(
command: <String>[
'${flutterRoot.path}/bin/flutter',
'assemble',
'--no-version-check',
'--output=${buildDir.path}/',
'-dTargetPlatform=ios',
'-dTargetFile=lib/main.dart',
'-dBuildMode=${buildMode.toLowerCase()}',
'-dIosArchs=',
'-dSdkRoot=',
'-dSplitDebugInfo=',
'-dTreeShakeIcons=',
'-dTrackWidgetCreation=',
'-dDartObfuscation=',
'-dAction=build',
'-dFrontendServerStarterPath=',
'--ExtraGenSnapshotOptions=',
'--DartDefines=',
'--ExtraFrontEndOptions=',
'debug_ios_bundle_flutter_assets',
],
),
],
fileSystem: fileSystem,
scriptOutputStreamFile: pipe,
);
expect(
() => context.run(),
throwsException,
);
expect(
context.stderr,
contains('ERROR: Unknown FLUTTER_BUILD_MODE: null.\n'),
);
});
test('calls flutter assemble', () {
final Directory buildDir = fileSystem.directory('/path/to/builds')
..createSync(recursive: true);
final Directory flutterRoot = fileSystem.directory('/path/to/flutter')
..createSync(recursive: true);
final File pipe = fileSystem.file('/tmp/pipe')
..createSync(recursive: true);
const String buildMode = 'Debug';
final TestContext context = TestContext(
<String>['build'],
<String, String>{
'BUILT_PRODUCTS_DIR': buildDir.path,
'CONFIGURATION': buildMode,
'FLUTTER_ROOT': flutterRoot.path,
'INFOPLIST_PATH': 'Info.plist',
},
commands: <FakeCommand>[
FakeCommand(
command: <String>[
'${flutterRoot.path}/bin/flutter',
'assemble',
'--no-version-check',
'--output=${buildDir.path}/',
'-dTargetPlatform=ios',
'-dTargetFile=lib/main.dart',
'-dBuildMode=${buildMode.toLowerCase()}',
'-dIosArchs=',
'-dSdkRoot=',
'-dSplitDebugInfo=',
'-dTreeShakeIcons=',
'-dTrackWidgetCreation=',
'-dDartObfuscation=',
'-dAction=',
'-dFrontendServerStarterPath=',
'--ExtraGenSnapshotOptions=',
'--DartDefines=',
'--ExtraFrontEndOptions=',
'debug_ios_bundle_flutter_assets',
],
),
],
fileSystem: fileSystem,
scriptOutputStreamFile: pipe,
)..run();
final List<String> streamedLines = pipe.readAsLinesSync();
// Ensure after line splitting, the exact string 'done' appears
expect(streamedLines, contains('done'));
expect(streamedLines, contains(' └─Compiling, linking and signing...'));
expect(
context.stdout,
contains('built and packaged successfully.'),
);
expect(context.stderr, isEmpty);
});
test('forwards all env variables to flutter assemble', () {
final Directory buildDir = fileSystem.directory('/path/to/builds')
..createSync(recursive: true);
final Directory flutterRoot = fileSystem.directory('/path/to/flutter')
..createSync(recursive: true);
const String archs = 'arm64';
const String buildMode = 'Release';
const String dartObfuscation = 'false';
const String dartDefines = 'flutter.inspector.structuredErrors%3Dtrue';
const String expandedCodeSignIdentity = 'F1326572E0B71C3C8442805230CB4B33B708A2E2';
const String extraFrontEndOptions = '--some-option';
const String extraGenSnapshotOptions = '--obfuscate';
const String frontendServerStarterPath = '/path/to/frontend_server_starter.dart';
const String sdkRoot = '/path/to/sdk';
const String splitDebugInfo = '/path/to/split/debug/info';
const String trackWidgetCreation = 'true';
const String treeShake = 'true';
final TestContext context = TestContext(
<String>['build'],
<String, String>{
'ACTION': 'install',
'ARCHS': archs,
'BUILT_PRODUCTS_DIR': buildDir.path,
'CODE_SIGNING_REQUIRED': 'YES',
'CONFIGURATION': buildMode,
'DART_DEFINES': dartDefines,
'DART_OBFUSCATION': dartObfuscation,
'EXPANDED_CODE_SIGN_IDENTITY': expandedCodeSignIdentity,
'EXTRA_FRONT_END_OPTIONS': extraFrontEndOptions,
'EXTRA_GEN_SNAPSHOT_OPTIONS': extraGenSnapshotOptions,
'FLUTTER_ROOT': flutterRoot.path,
'FRONTEND_SERVER_STARTER_PATH': frontendServerStarterPath,
'INFOPLIST_PATH': 'Info.plist',
'SDKROOT': sdkRoot,
'FLAVOR': 'strawberry',
'SPLIT_DEBUG_INFO': splitDebugInfo,
'TRACK_WIDGET_CREATION': trackWidgetCreation,
'TREE_SHAKE_ICONS': treeShake,
},
commands: <FakeCommand>[
FakeCommand(
command: <String>[
'${flutterRoot.path}/bin/flutter',
'assemble',
'--no-version-check',
'--output=${buildDir.path}/',
'-dTargetPlatform=ios',
'-dTargetFile=lib/main.dart',
'-dBuildMode=${buildMode.toLowerCase()}',
'-dFlavor=strawberry',
'-dIosArchs=$archs',
'-dSdkRoot=$sdkRoot',
'-dSplitDebugInfo=$splitDebugInfo',
'-dTreeShakeIcons=$treeShake',
'-dTrackWidgetCreation=$trackWidgetCreation',
'-dDartObfuscation=$dartObfuscation',
'-dAction=install',
'-dFrontendServerStarterPath=$frontendServerStarterPath',
'--ExtraGenSnapshotOptions=$extraGenSnapshotOptions',
'--DartDefines=$dartDefines',
'--ExtraFrontEndOptions=$extraFrontEndOptions',
'-dCodesignIdentity=$expandedCodeSignIdentity',
'release_ios_bundle_flutter_assets',
],
),
],
fileSystem: fileSystem,
)..run();
expect(
context.stdout,
contains('built and packaged successfully.'),
);
expect(context.stderr, isEmpty);
});
});
group('test_vm_service_bonjour_service', () {
test('handles when the Info.plist is missing', () {
final Directory buildDir = fileSystem.directory('/path/to/builds');
buildDir.createSync(recursive: true);
final TestContext context = TestContext(
<String>['test_vm_service_bonjour_service'],
<String, String>{
'CONFIGURATION': 'Debug',
'BUILT_PRODUCTS_DIR': buildDir.path,
'INFOPLIST_PATH': 'Info.plist',
},
commands: <FakeCommand>[],
fileSystem: fileSystem,
)..run();
expect(
context.stdout,
contains(
'Info.plist does not exist. Skipping _dartVmService._tcp NSBonjourServices insertion.'),
);
});
});
}
class TestContext extends Context {
TestContext(
List<String> arguments,
Map<String, String> environment, {
required this.fileSystem,
required List<FakeCommand> commands,
File? scriptOutputStreamFile,
}) : processManager = FakeProcessManager.list(commands),
super(arguments: arguments, environment: environment, scriptOutputStreamFile: scriptOutputStreamFile);
final FileSystem fileSystem;
final FakeProcessManager processManager;
String stdout = '';
String stderr = '';
@override
bool existsFile(String path) {
return fileSystem.file(path).existsSync();
}
@override
ProcessResult runSync(
String bin,
List<String> args, {
bool verbose = false,
bool allowFail = false,
String? workingDirectory,
}) {
return processManager.runSync(
<dynamic>[bin, ...args],
workingDirectory: workingDirectory,
environment: environment,
);
}
@override
void echoError(String message) {
stderr += '$message\n';
}
@override
void echo(String message) {
stdout += message;
}
@override
Never exitApp(int code) {
// This is an exception for the benefit of unit tests.
// The real implementation calls `exit(code)`.
throw Exception('App exited with code $code');
}
}
| flutter/packages/flutter_tools/test/general.shard/xcode_backend_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/xcode_backend_test.dart",
"repo_id": "flutter",
"token_count": 4467
} | 821 |
// 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_testing/file_testing.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/cache.dart';
import '../src/common.dart';
import 'test_utils.dart';
void main() {
late Directory tempDir;
setUp(() {
Cache.flutterRoot = getFlutterRoot();
tempDir = createResolvedTempDirectorySync('flutter_plugin_test.');
});
tearDown(() async {
tryToDelete(tempDir);
});
test('error logged when plugin Android compileSdk version higher than project', () async {
final String flutterBin = fileSystem.path.join(
getFlutterRoot(),
'bin',
'flutter',
);
// Create dummy plugin
processManager.runSync(<String>[
flutterBin,
...getLocalEngineArguments(),
'create',
'--template=plugin',
'--platforms=android',
'test_plugin',
], workingDirectory: tempDir.path);
final Directory pluginAppDir = tempDir.childDirectory('test_plugin');
final File pluginGradleFile = pluginAppDir.childDirectory('android').childFile('build.gradle');
expect(pluginGradleFile, exists);
final String pluginBuildGradle = pluginGradleFile.readAsStringSync();
// Bump up plugin compileSdk version to 31
final RegExp androidCompileSdkVersionRegExp = RegExp(r'compileSdk = ([0-9]+|flutter.compileSdkVersion)');
final String newPluginGradleFile = pluginBuildGradle.replaceAll(
androidCompileSdkVersionRegExp, 'compileSdk = 31');
pluginGradleFile.writeAsStringSync(newPluginGradleFile);
final Directory pluginExampleAppDir = pluginAppDir.childDirectory('example');
final File projectGradleFile = pluginExampleAppDir.childDirectory('android').childDirectory('app').childFile('build.gradle');
expect(projectGradleFile, exists);
final String projectBuildGradle = projectGradleFile.readAsStringSync();
// Bump down plugin example app compileSdk version to 30
final String newProjectGradleFile = projectBuildGradle.replaceAll(
androidCompileSdkVersionRegExp, 'compileSdk = 30');
projectGradleFile.writeAsStringSync(newProjectGradleFile);
// Run flutter build apk to build plugin example project
final ProcessResult result = processManager.runSync(<String>[
flutterBin,
...getLocalEngineArguments(),
'build',
'apk',
'--target-platform=android-arm',
], workingDirectory: pluginExampleAppDir.path);
// Check error message is thrown
expect(
result.stdout,
contains(
'Warning: The plugin test_plugin requires Android SDK version 31 or higher.'));
expect(
result.stderr,
contains('One or more plugins require a higher Android SDK version.'),
);
expect(
result.stderr,
contains(
'Fix this issue by adding the following to ${projectGradleFile.path}'));
});
}
| flutter/packages/flutter_tools/test/integration.shard/android_plugin_compilesdkversion_mismatch_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/integration.shard/android_plugin_compilesdkversion_mismatch_test.dart",
"repo_id": "flutter",
"token_count": 1051
} | 822 |
// 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:dds/dap.dart';
import 'package:file/file.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/convert.dart';
import 'package:flutter_tools/src/globals.dart' as globals;
import '../../src/common.dart';
import '../test_data/basic_project.dart';
import '../test_data/compile_error_project.dart';
import '../test_data/project.dart';
import '../test_utils.dart';
import 'test_client.dart';
import 'test_server.dart';
import 'test_support.dart';
void main() {
late Directory tempDir;
late DapTestSession dap;
final String relativeMainPath = 'lib${fileSystem.path.separator}main.dart';
setUpAll(() {
Cache.flutterRoot = getFlutterRoot();
});
setUp(() async {
tempDir = createResolvedTempDirectorySync('flutter_adapter_test.');
dap = await DapTestSession.setUp();
});
tearDown(() async {
await dap.tearDown();
tryToDelete(tempDir);
});
group('launch', () {
testWithoutContext('can run and terminate a Flutter app in debug mode', () async {
final BasicProject project = BasicProject();
await project.setUpIn(tempDir);
// Once the "topLevelFunction" output arrives, we can terminate the app.
unawaited(
dap.client.output
.firstWhere((String output) => output.startsWith('topLevelFunction'))
.whenComplete(() => dap.client.terminate()),
);
final List<OutputEventBody> outputEvents = await dap.client.collectAllOutput(
launch: () => dap.client
.launch(
cwd: project.dir.path,
toolArgs: <String>['-d', 'flutter-tester'],
),
);
final String output = _uniqueOutputLines(outputEvents);
expectLines(
output,
<Object>[
'Launching $relativeMainPath on Flutter test device in debug mode...',
startsWith('Connecting to VM Service at'),
'topLevelFunction',
'Application finished.',
'',
startsWith('Exited'),
],
allowExtras: true,
);
});
testWithoutContext('logs to client when sendLogsToClient=true', () async {
final BasicProject project = BasicProject();
await project.setUpIn(tempDir);
// Launch the app and wait for it to print "topLevelFunction".
await Future.wait(<Future<void>>[
dap.client.stdoutOutput.firstWhere((String output) => output.startsWith('topLevelFunction')),
dap.client.start(
launch: () => dap.client.launch(
cwd: project.dir.path,
noDebug: true,
toolArgs: <String>['-d', 'flutter-tester'],
sendLogsToClient: true,
),
),
], eagerError: true);
// Capture events while terminating.
final Future<List<Event>> logEventsFuture = dap.client.events('dart.log').toList();
await dap.client.terminate();
// Ensure logs contain both the app.stop request and the result.
final List<Event> logEvents = await logEventsFuture;
final List<String> logMessages = logEvents.map((Event l) => (l.body! as Map<String, Object?>)['message']! as String).toList();
expect(
logMessages,
containsAll(<Matcher>[
startsWith('==> [Flutter] [{"id":1,"method":"app.stop"'),
startsWith('<== [Flutter] [{"id":1,"result":true}]'),
]),
);
});
testWithoutContext('can run and terminate a Flutter app in noDebug mode', () async {
final BasicProject project = BasicProject();
await project.setUpIn(tempDir);
// Once the "topLevelFunction" output arrives, we can terminate the app.
unawaited(
dap.client.stdoutOutput
.firstWhere((String output) => output.startsWith('topLevelFunction'))
.whenComplete(() => dap.client.terminate()),
);
final List<OutputEventBody> outputEvents = await dap.client.collectAllOutput(
launch: () => dap.client
.launch(
cwd: project.dir.path,
noDebug: true,
toolArgs: <String>['-d', 'flutter-tester'],
),
);
final String output = _uniqueOutputLines(outputEvents);
expectLines(
output,
<Object>[
'Launching $relativeMainPath on Flutter test device in debug mode...',
'topLevelFunction',
'Application finished.',
'',
startsWith('Exited'),
],
allowExtras: true,
);
// If we're running with an out-of-process debug adapter, ensure that its
// own process shuts down after we terminated.
final DapTestServer server = dap.server;
if (server is OutOfProcessDapTestServer) {
await server.exitCode;
}
});
testWithoutContext('outputs useful message on invalid DAP protocol messages', () async {
final OutOfProcessDapTestServer server = dap.server as OutOfProcessDapTestServer;
final CompileErrorProject project = CompileErrorProject();
await project.setUpIn(tempDir);
final StringBuffer stderrOutput = StringBuffer();
dap.server.onStderrOutput = stderrOutput.write;
// Write invalid headers and await the error.
dap.server.sink.add(utf8.encode('foo\r\nbar\r\n\r\n'));
await server.exitCode;
// Verify the user-friendly message was included in the output.
final String error = stderrOutput.toString();
expect(error, contains('Input could not be parsed as a Debug Adapter Protocol message'));
expect(error, contains('The "flutter debug-adapter" command is intended for use by tooling'));
// This test only runs with out-of-process DAP as it's testing _actual_
// stderr output and that the debug-adapter process terminates, which is
// not possible when running the DAP Server in-process.
}, skip: useInProcessDap); // [intended] See above.
testWithoutContext('correctly outputs launch errors and terminates', () async {
final CompileErrorProject project = CompileErrorProject();
await project.setUpIn(tempDir);
final List<OutputEventBody> outputEvents = await dap.client.collectAllOutput(
launch: () => dap.client
.launch(
cwd: project.dir.path,
toolArgs: <String>['-d', 'flutter-tester'],
),
);
final String output = _uniqueOutputLines(outputEvents);
expect(output, contains('this code does not compile'));
expect(output, contains('Error: Failed to build'));
expect(output, contains('Exited (1)'));
});
group('structured errors', () {
/// Helper that runs [project] and collects the output.
///
/// Line and column numbers are replaced with "1" to avoid fragile tests.
Future<String> getExceptionOutput(
Project project, {
required bool noDebug,
required bool ansiColors,
}) async {
await project.setUpIn(tempDir);
final List<OutputEventBody> outputEvents = await dap.client.collectAllOutput(launch: () {
// Terminate the app after we see the exception because otherwise
// it will keep running and `collectAllOutput` won't end.
dap.client.output
.firstWhere((String output) => output.contains(endOfErrorOutputMarker))
.then((_) => dap.client.terminate());
return dap.client.launch(
noDebug: noDebug,
cwd: project.dir.path,
toolArgs: <String>['-d', 'flutter-tester'],
allowAnsiColorOutput: ansiColors,
);
});
String output = _uniqueOutputLines(outputEvents);
// Replace out any line/columns to make tests less fragile.
output = output.replaceAll(RegExp(r'\.dart:\d+:\d+'), '.dart:1:1');
return output;
}
testWithoutContext('correctly outputs exceptions in debug mode', () async {
final BasicProjectThatThrows project = BasicProjectThatThrows();
final String output = await getExceptionOutput(project, noDebug: false, ansiColors: false);
expect(
output,
contains('''
════════ Exception caught by widgets library ═══════════════════════════════════
The following _Exception was thrown building App(dirty):
Exception: c
The relevant error-causing widget was:
App App:${Uri.file(project.dir.path)}/lib/main.dart:1:1'''),
);
});
testWithoutContext('correctly outputs colored exceptions when supported', () async {
final BasicProjectThatThrows project = BasicProjectThatThrows();
final String output = await getExceptionOutput(project, noDebug: false, ansiColors: true);
// Frames in the stack trace that are the users own code will be unformatted, but
// frames from the framework are faint (starting with `\x1B[2m`).
expect(
output,
contains('''
════════ Exception caught by widgets library ═══════════════════════════════════
The following _Exception was thrown building App(dirty):
Exception: c
The relevant error-causing widget was:
App App:${Uri.file(project.dir.path)}/lib/main.dart:1:1
When the exception was thrown, this was the stack:
#0 c (package:test/main.dart:1:1)
^ source: package:test/main.dart
#1 App.build (package:test/main.dart:1:1)
^ source: package:test/main.dart
\x1B[2m#2 StatelessElement.build (package:flutter/src/widgets/framework.dart:1:1)\x1B[0m
^ source: package:flutter/src/widgets/framework.dart
\x1B[2m#3 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:1:1)\x1B[0m
^ source: package:flutter/src/widgets/framework.dart'''),
);
});
testWithoutContext('correctly outputs exceptions in noDebug mode', () async {
final BasicProjectThatThrows project = BasicProjectThatThrows();
final String output = await getExceptionOutput(project, noDebug: true, ansiColors: false);
// When running in noDebug mode, we don't get the Flutter.Error event so
// we get the basic Flutter-formatted version of the error.
expect(
output,
contains('''
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following _Exception was thrown building App(dirty):
Exception: c
The relevant error-causing widget was:
App'''),
);
expect(
output,
contains('App:${Uri.file(project.dir.path)}/lib/main.dart:1:1'),
);
});
});
testWithoutContext('can hot reload', () async {
final BasicProject project = BasicProject();
await project.setUpIn(tempDir);
// Launch the app and wait for it to print "topLevelFunction".
await Future.wait(<Future<void>>[
dap.client.stdoutOutput.firstWhere((String output) => output.startsWith('topLevelFunction')),
dap.client.start(
launch: () => dap.client.launch(
cwd: project.dir.path,
noDebug: true,
toolArgs: <String>['-d', 'flutter-tester'],
),
),
], eagerError: true);
// Capture the next two output events that we expect to be the Reload
// notification and then topLevelFunction being printed again.
final Future<List<String>> outputEventsFuture = dap.client.stdoutOutput
// But skip any topLevelFunctions that come before the reload.
.skipWhile((String output) => output.startsWith('topLevelFunction'))
.take(2)
.toList();
await dap.client.hotReload();
expectLines(
(await outputEventsFuture).join(),
<Object>[
startsWith('Reloaded'),
'topLevelFunction',
],
allowExtras: true,
);
// Repeat the test for hot reload with custom syntax.
final Future<List<String>> customOutputEventsFuture = dap.client.stdoutOutput
// But skip any topLevelFunctions that come before the reload.
.skipWhile((String output) => output.startsWith('topLevelFunction'))
.take(2)
.toList();
await dap.client.customSyntaxHotReload();
expectLines(
(await customOutputEventsFuture).join(),
<Object>[
startsWith('Reloaded'),
'topLevelFunction',
],
allowExtras: true,
);
await dap.client.terminate();
});
testWithoutContext('sends progress notifications during hot reload', () async {
final BasicProject project = BasicProject();
await project.setUpIn(tempDir);
// Launch the app and wait for it to print "topLevelFunction".
await Future.wait(<Future<void>>[
dap.client.stdoutOutput.firstWhere((String output) => output.startsWith('topLevelFunction')),
dap.client.initialize(supportsProgressReporting: true),
dap.client.launch(
cwd: project.dir.path,
noDebug: true,
toolArgs: <String>['-d', 'flutter-tester'],
),
], eagerError: true);
// Capture progress events during a reload.
final Future<List<Event>> progressEventsFuture = dap.client.progressEvents().toList();
await dap.client.hotReload();
await dap.client.terminate();
// Verify the progress events.
final List<Event> progressEvents = await progressEventsFuture;
expect(progressEvents, hasLength(2));
final List<String> eventKinds = progressEvents.map((Event event) => event.event).toList();
expect(eventKinds, <String>['progressStart', 'progressEnd']);
final List<Map<String, Object?>> eventBodies = progressEvents.map((Event event) => event.body).cast<Map<String, Object?>>().toList();
final ProgressStartEventBody start = ProgressStartEventBody.fromMap(eventBodies[0]);
final ProgressEndEventBody end = ProgressEndEventBody.fromMap(eventBodies[1]);
expect(start.progressId, isNotNull);
expect(start.title, 'Flutter');
expect(start.message, 'Hot reloading…');
expect(end.progressId, start.progressId);
expect(end.message, isNull);
});
testWithoutContext('can hot restart', () async {
final BasicProject project = BasicProject();
await project.setUpIn(tempDir);
// Launch the app and wait for it to print "topLevelFunction".
await Future.wait(<Future<void>>[
dap.client.stdoutOutput.firstWhere((String output) => output.startsWith('topLevelFunction')),
dap.client.start(
launch: () => dap.client.launch(
cwd: project.dir.path,
noDebug: true,
toolArgs: <String>['-d', 'flutter-tester'],
),
),
], eagerError: true);
// Capture the next two output events that we expect to be the Restart
// notification and then topLevelFunction being printed again.
final Future<List<String>> outputEventsFuture = dap.client.stdoutOutput
// But skip any topLevelFunctions that come before the restart.
.skipWhile((String output) => output.startsWith('topLevelFunction'))
.take(2)
.toList();
await dap.client.hotRestart();
expectLines(
(await outputEventsFuture).join(),
<Object>[
startsWith('Restarted application'),
'topLevelFunction',
],
allowExtras: true,
);
await dap.client.terminate();
});
testWithoutContext('sends progress notifications during hot restart', () async {
final BasicProject project = BasicProject();
await project.setUpIn(tempDir);
// Launch the app and wait for it to print "topLevelFunction".
await Future.wait(<Future<void>>[
dap.client.stdoutOutput.firstWhere((String output) => output.startsWith('topLevelFunction')),
dap.client.initialize(supportsProgressReporting: true),
dap.client.launch(
cwd: project.dir.path,
noDebug: true,
toolArgs: <String>['-d', 'flutter-tester'],
),
], eagerError: true);
// Capture progress events during a restart.
final Future<List<Event>> progressEventsFuture = dap.client.progressEvents().toList();
await dap.client.hotRestart();
await dap.client.terminate();
// Verify the progress events.
final List<Event> progressEvents = await progressEventsFuture;
expect(progressEvents, hasLength(2));
final List<String> eventKinds = progressEvents.map((Event event) => event.event).toList();
expect(eventKinds, <String>['progressStart', 'progressEnd']);
final List<Map<String, Object?>> eventBodies = progressEvents.map((Event event) => event.body).cast<Map<String, Object?>>().toList();
final ProgressStartEventBody start = ProgressStartEventBody.fromMap(eventBodies[0]);
final ProgressEndEventBody end = ProgressEndEventBody.fromMap(eventBodies[1]);
expect(start.progressId, isNotNull);
expect(start.title, 'Flutter');
expect(start.message, 'Hot restarting…');
expect(end.progressId, start.progressId);
expect(end.message, isNull);
});
testWithoutContext('can hot restart when exceptions occur on outgoing isolates', () async {
final BasicProjectThatThrows project = BasicProjectThatThrows();
await project.setUpIn(tempDir);
// Launch the app and wait for it to stop at an exception.
late int originalThreadId, newThreadId;
await Future.wait(<Future<void>>[
// Capture the thread ID of the stopped thread.
dap.client.stoppedEvents.first.then((StoppedEventBody event) => originalThreadId = event.threadId!),
dap.client.start(
exceptionPauseMode: 'All', // Ensure we stop on all exceptions
launch: () => dap.client.launch(
cwd: project.dir.path,
toolArgs: <String>['-d', 'flutter-tester'],
),
),
], eagerError: true);
// Hot restart, ensuring it completes and capturing the ID of the new thread
// to pause.
await Future.wait(<Future<void>>[
// Capture the thread ID of the newly stopped thread.
dap.client.stoppedEvents.first.then((StoppedEventBody event) => newThreadId = event.threadId!),
dap.client.hotRestart(),
], eagerError: true);
// We should not have stopped on the original thread, but the new thread
// from after the restart.
expect(newThreadId, isNot(equals(originalThreadId)));
await dap.client.terminate();
});
testWithoutContext('sends events for extension state updates', () async {
final BasicProject project = BasicProject();
await project.setUpIn(tempDir);
const String debugPaintRpc = 'ext.flutter.debugPaint';
// Create a future to capture the isolate ID when the debug paint service
// extension loads, as we'll need that to call it later.
final Future<String> isolateIdForDebugPaint = dap.client
.serviceExtensionAdded(debugPaintRpc)
.then((Map<String, Object?> body) => body['isolateId']! as String);
// Launch the app and wait for it to print "topLevelFunction" so we know
// it's up and running.
await Future.wait(<Future<void>>[
dap.client.stdoutOutput.firstWhere((String output) => output.startsWith('topLevelFunction')),
dap.client.start(
launch: () => dap.client.launch(
cwd: project.dir.path,
toolArgs: <String>['-d', 'flutter-tester'],
),
),
], eagerError: true);
// Capture the next relevant state-change event (which should occur as a
// result of the call below).
final Future<Map<String, Object?>> stateChangeEventFuture =
dap.client.serviceExtensionStateChanged(debugPaintRpc);
// Enable debug paint to trigger the state change.
await dap.client.custom(
'callService',
<String, Object?>{
'method': debugPaintRpc,
'params': <String, Object?>{
'enabled': true,
'isolateId': await isolateIdForDebugPaint,
},
},
);
// Ensure the event occurred, and its value was as expected.
final Map<String, Object?> stateChangeEvent = await stateChangeEventFuture;
expect(stateChangeEvent['value'], 'true'); // extension state change values are always strings
await dap.client.terminate();
});
testWithoutContext('provides appStarted events to the client', () async {
final BasicProject project = BasicProject();
await project.setUpIn(tempDir);
// Launch the app and wait for it to send a 'flutter.appStart' event.
final Future<Event> appStartFuture = dap.client.event('flutter.appStart');
await Future.wait(<Future<void>>[
appStartFuture,
dap.client.start(
launch: () => dap.client.launch(
cwd: project.dir.path,
toolArgs: <String>['-d', 'flutter-tester'],
),
),
], eagerError: true);
await dap.client.terminate();
final Event appStart = await appStartFuture;
final Map<String, Object?> params = appStart.body! as Map<String, Object?>;
expect(params['deviceId'], 'flutter-tester');
expect(params['mode'], 'debug');
});
testWithoutContext('provides appStarted events to the client', () async {
final BasicProject project = BasicProject();
await project.setUpIn(tempDir);
// Launch the app and wait for it to send a 'flutter.appStarted' event.
await Future.wait(<Future<void>>[
dap.client.event('flutter.appStarted'),
dap.client.start(
launch: () => dap.client.launch(
cwd: project.dir.path,
toolArgs: <String>['-d', 'flutter-tester'],
),
),
], eagerError: true);
await dap.client.terminate();
});
});
group('attach', () {
late SimpleFlutterRunner testProcess;
late BasicProject project;
late String breakpointFilePath;
late int breakpointLine;
setUp(() async {
project = BasicProject();
await project.setUpIn(tempDir);
testProcess = await SimpleFlutterRunner.start(tempDir);
breakpointFilePath = globals.fs.path.join(project.dir.path, 'lib', 'main.dart');
breakpointLine = project.buildMethodBreakpointLine;
});
tearDown(() async {
testProcess.process.kill();
await testProcess.process.exitCode;
});
testWithoutContext('can attach to an already-running Flutter app and reload', () async {
final Uri vmServiceUri = await testProcess.vmServiceUri;
// Launch the app and wait for it to print "topLevelFunction".
await Future.wait(<Future<void>>[
dap.client.stdoutOutput.firstWhere((String output) => output.startsWith('topLevelFunction')),
dap.client.start(
launch: () => dap.client.attach(
cwd: project.dir.path,
toolArgs: <String>['-d', 'flutter-tester'],
vmServiceUri: vmServiceUri.toString(),
),
),
], eagerError: true);
// Capture the "Reloaded" output and events immediately after.
final Future<List<String>> outputEventsFuture = dap.client.stdoutOutput
.skipWhile((String output) => !output.startsWith('Reloaded'))
.take(4)
.toList();
// Perform the reload, and expect we get the Reloaded output followed
// by printed output, to ensure the app is running again.
await dap.client.hotReload();
expectLines(
(await outputEventsFuture).join(),
<Object>[
startsWith('Reloaded'),
'topLevelFunction',
],
allowExtras: true,
);
await dap.client.terminate();
});
testWithoutContext('can attach to an already-running Flutter app and hit breakpoints', () async {
final Uri vmServiceUri = await testProcess.vmServiceUri;
// Launch the app and wait for it to print "topLevelFunction".
await Future.wait(<Future<void>>[
dap.client.stdoutOutput.firstWhere((String output) => output.startsWith('topLevelFunction')),
dap.client.start(
launch: () => dap.client.attach(
cwd: project.dir.path,
toolArgs: <String>['-d', 'flutter-tester'],
vmServiceUri: vmServiceUri.toString(),
),
),
], eagerError: true);
// Set a breakpoint and expect to hit it.
final Future<StoppedEventBody> stoppedFuture = dap.client.stoppedEvents.firstWhere((StoppedEventBody e) => e.reason == 'breakpoint');
await Future.wait(<Future<void>>[
stoppedFuture,
dap.client.setBreakpoint(breakpointFilePath, breakpointLine),
], eagerError: true);
});
testWithoutContext('resumes and removes breakpoints on detach', () async {
final Uri vmServiceUri = await testProcess.vmServiceUri;
// Launch the app and wait for it to print "topLevelFunction".
await Future.wait(<Future<void>>[
dap.client.stdoutOutput.firstWhere((String output) => output.startsWith('topLevelFunction')),
dap.client.start(
launch: () => dap.client.attach(
cwd: project.dir.path,
toolArgs: <String>['-d', 'flutter-tester'],
vmServiceUri: vmServiceUri.toString(),
),
),
], eagerError: true);
// Set a breakpoint and expect to hit it.
final Future<StoppedEventBody> stoppedFuture = dap.client.stoppedEvents.firstWhere((StoppedEventBody e) => e.reason == 'breakpoint');
await Future.wait(<Future<void>>[
stoppedFuture,
dap.client.setBreakpoint(breakpointFilePath, breakpointLine),
], eagerError: true);
// Detach and expected resume and correct output.
await Future.wait(<Future<void>>[
// We should print "Detached" instead of "Exited".
dap.client.outputEvents.firstWhere((OutputEventBody event) => event.output.contains('\nDetached')),
// We should still get terminatedEvent (this signals the DAP server terminating).
dap.client.event('terminated'),
// We should get output showing the app resumed.
testProcess.output.firstWhere((String output) => output.contains('topLevelFunction')),
// Trigger the detach.
dap.client.terminate(),
]);
});
});
}
/// Extracts the output from a set of [OutputEventBody], removing any
/// adjacent duplicates and combining into a single string.
///
/// If the output event contains a [Source], the name will be shown on the
/// following line indented and prefixed with `^ source:`.
String _uniqueOutputLines(List<OutputEventBody> outputEvents) {
String? lastItem;
return outputEvents
.map((OutputEventBody e) {
final String output = e.output;
final Source? source = e.source;
return source != null
? '$output ^ source: ${source.name}\n'
: output;
})
.where((String output) {
// Skip the item if it's the same as the previous one.
final bool isDupe = output == lastItem;
lastItem = output;
return !isDupe;
})
.join();
}
| flutter/packages/flutter_tools/test/integration.shard/debug_adapter/flutter_adapter_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/integration.shard/debug_adapter/flutter_adapter_test.dart",
"repo_id": "flutter",
"token_count": 10792
} | 823 |
// 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_testing/file_testing.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/features.dart';
import '../src/common.dart';
import 'test_utils.dart';
void main() {
late Directory tempDir;
late String flutterBin;
late Directory exampleAppDir;
setUp(() async {
tempDir = createResolvedTempDirectorySync('flutter_web_wasm_test.');
flutterBin = fileSystem.path.join(
getFlutterRoot(),
'bin',
'flutter',
);
exampleAppDir = tempDir.childDirectory('test_app');
processManager.runSync(<String>[
flutterBin,
'create',
'--platforms=web',
'test_app',
], workingDirectory: tempDir.path);
});
test('building web with --wasm produces expected files', () async {
final ProcessResult result = processManager.runSync(
<String>[
flutterBin,
'build',
'web',
'--wasm',
],
workingDirectory: exampleAppDir.path,
environment: <String, String>{
flutterWebWasm.environmentOverride!: 'true'
},
);
expect(result, const ProcessResultMatcher());
final Directory appBuildDir = fileSystem.directory(fileSystem.path.join(
exampleAppDir.path,
'build',
'web',
));
for (final String filename in const <String>[
'flutter.js',
'flutter_service_worker.js',
'index.html',
'main.dart.wasm',
'main.dart.mjs',
'main.dart.js',
]) {
expect(appBuildDir.childFile(filename), exists);
}
});
}
| flutter/packages/flutter_tools/test/integration.shard/flutter_build_wasm_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/integration.shard/flutter_build_wasm_test.dart",
"repo_id": "flutter",
"token_count": 692
} | 824 |
// 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 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/terminal.dart';
import 'package:flutter_tools/src/ios/plist_parser.dart';
import '../src/common.dart';
import '../src/fakes.dart';
import 'test_utils.dart';
const String base64PlistXml =
'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHBsaXN0I'
'FBVQkxJQyAiLS8vQXBwbGUvL0RURCBQTElTVCAxLjAvL0VOIiAiaHR0cDovL3d3dy5hcHBsZS'
'5jb20vRFREcy9Qcm9wZXJ0eUxpc3QtMS4wLmR0ZCI+CjxwbGlzdCB2ZXJzaW9uPSIxLjAiPgo'
'8ZGljdD4KICA8a2V5PkNGQnVuZGxlRXhlY3V0YWJsZTwva2V5PgogIDxzdHJpbmc+QXBwPC9z'
'dHJpbmc+CiAgPGtleT5DRkJ1bmRsZUlkZW50aWZpZXI8L2tleT4KICA8c3RyaW5nPmlvLmZsd'
'XR0ZXIuZmx1dHRlci5hcHA8L3N0cmluZz4KPC9kaWN0Pgo8L3BsaXN0Pgo=';
const String base64PlistBinary =
'YnBsaXN0MDDSAQIDBF8QEkNGQnVuZGxlRXhlY3V0YWJsZV8QEkNGQnVuZGxlSWRlbnRpZmllc'
'lNBcHBfEBZpby5mbHV0dGVyLmZsdXR0ZXIuYXBwCA0iNzsAAAAAAAABAQAAAAAAAAAFAAAAAA'
'AAAAAAAAAAAAAAVA==';
const String base64PlistJson =
'eyJDRkJ1bmRsZUV4ZWN1dGFibGUiOiJBcHAiLCJDRkJ1bmRsZUlkZW50aWZpZXIiOiJpby5mb'
'HV0dGVyLmZsdXR0ZXIuYXBwIn0=';
const String base64PlistXmlWithComplexDatatypes =
'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHBsaXN0I'
'FBVQkxJQyAiLS8vQXBwbGUvL0RURCBQTElTVCAxLjAvL0VOIiAiaHR0cDovL3d3dy5hcHBsZS'
'5jb20vRFREcy9Qcm9wZXJ0eUxpc3QtMS4wLmR0ZCI+CjxwbGlzdCB2ZXJzaW9uPSIxLjAiPgo'
'8ZGljdD4KICA8a2V5PkNGQnVuZGxlRXhlY3V0YWJsZTwva2V5PgogIDxzdHJpbmc+QXBwPC9z'
'dHJpbmc+CiAgPGtleT5DRkJ1bmRsZUlkZW50aWZpZXI8L2tleT4KICA8c3RyaW5nPmlvLmZsd'
'XR0ZXIuZmx1dHRlci5hcHA8L3N0cmluZz4KICA8a2V5PmludFZhbHVlPC9rZXk+CiAgPGludG'
'VnZXI+MjwvaW50ZWdlcj4KICA8a2V5PmRvdWJsZVZhbHVlPC9rZXk+CiAgPHJlYWw+MS41PC9'
'yZWFsPgogIDxrZXk+YmluYXJ5VmFsdWU8L2tleT4KICA8ZGF0YT5ZV0pqWkE9PTwvZGF0YT4K'
'ICA8a2V5PmFycmF5VmFsdWU8L2tleT4KICA8YXJyYXk+CiAgICA8dHJ1ZSAvPgogICAgPGZhb'
'HNlIC8+CiAgICA8aW50ZWdlcj4zPC9pbnRlZ2VyPgogIDwvYXJyYXk+CiAgPGtleT5kYXRlVm'
'FsdWU8L2tleT4KICA8ZGF0ZT4yMDIxLTEyLTAxVDEyOjM0OjU2WjwvZGF0ZT4KPC9kaWN0Pgo'
'8L3BsaXN0Pg==';
void main() {
// The tests herein explicitly don't use `MemoryFileSystem` or a mocked
// `ProcessManager` because doing so wouldn't actually test what we want to
// test, which is that the underlying tool we're using to parse Plist files
// works with the way we're calling it.
late File file;
late PlistParser parser;
late BufferLogger logger;
setUp(() {
logger = BufferLogger(
outputPreferences: OutputPreferences.test(),
terminal: AnsiTerminal(
platform: const LocalPlatform(),
stdio: FakeStdio(),
),
);
parser = PlistParser(
fileSystem: fileSystem,
processManager: processManager,
logger: logger,
);
file = fileSystem.file('foo.plist')..createSync();
});
tearDown(() {
file.deleteSync();
});
testWithoutContext('PlistParser.getValueFromFile<String> works with an XML file', () {
file.writeAsBytesSync(base64.decode(base64PlistXml));
expect(parser.getValueFromFile<String>(file.path, 'CFBundleIdentifier'), 'io.flutter.flutter.app');
expect(parser.getValueFromFile<String>(file.absolute.path, 'CFBundleIdentifier'), 'io.flutter.flutter.app');
expect(logger.statusText, isEmpty);
expect(logger.errorText, isEmpty);
}, skip: !platform.isMacOS); // [intended] requires macos tool chain.
testWithoutContext('PlistParser.getValueFromFile<String> works with a binary file', () {
file.writeAsBytesSync(base64.decode(base64PlistBinary));
expect(parser.getValueFromFile<String>(file.path, 'CFBundleIdentifier'), 'io.flutter.flutter.app');
expect(parser.getValueFromFile<String>(file.absolute.path, 'CFBundleIdentifier'), 'io.flutter.flutter.app');
expect(logger.statusText, isEmpty);
expect(logger.errorText, isEmpty);
}, skip: !platform.isMacOS); // [intended] requires macos tool chain.
testWithoutContext('PlistParser.getValueFromFile<String> works with a JSON file', () {
file.writeAsBytesSync(base64.decode(base64PlistJson));
expect(parser.getValueFromFile<String>(file.path, 'CFBundleIdentifier'), 'io.flutter.flutter.app');
expect(parser.getValueFromFile<String>(file.absolute.path, 'CFBundleIdentifier'), 'io.flutter.flutter.app');
expect(logger.statusText, isEmpty);
expect(logger.errorText, isEmpty);
}, skip: !platform.isMacOS); // [intended] requires macos tool chain.
testWithoutContext('PlistParser.getValueFromFile<String> returns null for a non-existent plist file', () {
expect(parser.getValueFromFile<String>('missing.plist', 'CFBundleIdentifier'), null);
expect(logger.statusText, isEmpty);
expect(logger.errorText, isEmpty);
}, skip: !platform.isMacOS); // [intended] requires macos tool chain.
testWithoutContext('PlistParser.getValueFromFile<String> returns null for a non-existent key within a plist', () {
file.writeAsBytesSync(base64.decode(base64PlistXml));
expect(parser.getValueFromFile<String>(file.path, 'BadKey'), null);
expect(parser.getValueFromFile<String>(file.absolute.path, 'BadKey'), null);
expect(logger.statusText, isEmpty);
expect(logger.errorText, isEmpty);
}, skip: !platform.isMacOS); // [intended] requires macos tool chain.
testWithoutContext('PlistParser.getValueFromFile<String> returns null for a malformed plist file', () {
file.writeAsBytesSync(const <int>[1, 2, 3, 4, 5, 6]);
expect(parser.getValueFromFile<String>(file.path, 'CFBundleIdentifier'), null);
expect(logger.statusText, contains('Property List error: Unexpected character \x01 at line 1 / '
'JSON error: JSON text did not start with array or object and option to allow fragments not '
'set. around line 1, column 0.\n'));
expect(logger.errorText, 'ProcessException: The command failed with exit code 1\n'
' Command: /usr/bin/plutil -convert xml1 -o - ${file.absolute.path}\n');
}, skip: !platform.isMacOS); // [intended] requires macos tool chain.
testWithoutContext('PlistParser.getValueFromFile<String> throws when /usr/bin/plutil is not found', () async {
file.writeAsBytesSync(base64.decode(base64PlistXml));
expect(
() => parser.getValueFromFile<String>(file.path, 'unused'),
throwsA(isA<FileNotFoundException>()),
);
expect(logger.statusText, isEmpty);
expect(logger.errorText, isEmpty);
}, skip: platform.isMacOS); // [intended] requires absence of macos tool chain.
testWithoutContext('PlistParser.replaceKey can replace a key', () async {
file.writeAsBytesSync(base64.decode(base64PlistXml));
expect(parser.getValueFromFile<String>(file.path, 'CFBundleIdentifier'), 'io.flutter.flutter.app');
expect(parser.replaceKey(file.path, key: 'CFBundleIdentifier', value: 'dev.flutter.fake'), isTrue);
expect(logger.statusText, isEmpty);
expect(logger.errorText, isEmpty);
expect(parser.getValueFromFile<String>(file.path, 'CFBundleIdentifier'), equals('dev.flutter.fake'));
}, skip: !platform.isMacOS); // [intended] requires macos tool chain.
testWithoutContext('PlistParser.replaceKey can create a new key', () async {
file.writeAsBytesSync(base64.decode(base64PlistXml));
expect(parser.getValueFromFile<String>(file.path, 'CFNewKey'), isNull);
expect(parser.replaceKey(file.path, key: 'CFNewKey', value: 'dev.flutter.fake'), isTrue);
expect(logger.statusText, isEmpty);
expect(logger.errorText, isEmpty);
expect(parser.getValueFromFile<String>(file.path, 'CFNewKey'), equals('dev.flutter.fake'));
}, skip: !platform.isMacOS); // [intended] requires macos tool chain.
testWithoutContext('PlistParser.replaceKey can delete a key', () async {
file.writeAsBytesSync(base64.decode(base64PlistXml));
expect(parser.replaceKey(file.path, key: 'CFBundleIdentifier'), isTrue);
expect(logger.statusText, isEmpty);
expect(logger.errorText, isEmpty);
expect(parser.getValueFromFile<String>(file.path, 'CFBundleIdentifier'), isNull);
}, skip: !platform.isMacOS); // [intended] requires macos tool chain.
testWithoutContext('PlistParser.replaceKey throws when /usr/bin/plutil is not found', () async {
file.writeAsBytesSync(base64.decode(base64PlistXml));
expect(
() => parser.replaceKey(file.path, key: 'CFBundleIdentifier', value: 'dev.flutter.fake'),
throwsA(isA<FileNotFoundException>()),
);
expect(logger.statusText, isEmpty);
expect(logger.errorText, isEmpty);
}, skip: platform.isMacOS); // [intended] requires absence of macos tool chain.
testWithoutContext('PlistParser.replaceKey returns false for a malformed plist file', () {
file.writeAsBytesSync(const <int>[1, 2, 3, 4, 5, 6]);
expect(parser.replaceKey(file.path, key: 'CFBundleIdentifier', value: 'dev.flutter.fake'), isFalse);
expect(logger.statusText, contains('foo.plist: Property List error: Unexpected character \x01 '
'at line 1 / JSON error: JSON text did not start with array or object and option to allow '
'fragments not set. around line 1, column 0.\n'));
expect(logger.errorText, equals('ProcessException: The command failed with exit code 1\n'
' Command: /usr/bin/plutil -replace CFBundleIdentifier -string dev.flutter.fake foo.plist\n'));
}, skip: !platform.isMacOS); // [intended] requires macos tool chain.
testWithoutContext('PlistParser.replaceKey works with a JSON file', () {
file.writeAsBytesSync(base64.decode(base64PlistJson));
expect(parser.getValueFromFile<String>(file.absolute.path, 'CFBundleIdentifier'), 'io.flutter.flutter.app');
expect(parser.replaceKey(file.path, key:'CFBundleIdentifier', value: 'dev.flutter.fake'), isTrue);
expect(parser.getValueFromFile<String>(file.absolute.path, 'CFBundleIdentifier'), 'dev.flutter.fake');
expect(logger.statusText, isEmpty);
expect(logger.errorText, isEmpty);
}, skip: !platform.isMacOS); // [intended] requires macos tool chain.
testWithoutContext('PlistParser.parseFile can handle different datatypes', () async {
file.writeAsBytesSync(base64.decode(base64PlistXmlWithComplexDatatypes));
final Map<String, Object> values = parser.parseFile(file.path);
expect(values['CFBundleIdentifier'], 'io.flutter.flutter.app');
expect(values['CFBundleIdentifier'], 'io.flutter.flutter.app');
expect(values['intValue'], 2);
expect(values['doubleValue'], 1.5);
expect(values['binaryValue'], base64.decode('YWJjZA=='));
expect(values['arrayValue'], <dynamic>[true, false, 3]);
expect(values['dateValue'], DateTime.utc(2021, 12, 1, 12, 34, 56));
expect(logger.statusText, isEmpty);
expect(logger.errorText, isEmpty);
}, skip: !platform.isMacOS); // [intended] requires macos tool chain.
}
| flutter/packages/flutter_tools/test/integration.shard/plist_parser_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/integration.shard/plist_parser_test.dart",
"repo_id": "flutter",
"token_count": 4514
} | 825 |
// 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.
@Timeout(Duration(seconds: 600))
library;
import 'dart:io';
import 'package:file/file.dart';
import '../../src/common.dart';
import '../test_utils.dart';
import 'project.dart';
class MigrateProject extends Project {
MigrateProject(this.version, {this.vanilla = true});
@override
Future<void> setUpIn(Directory dir, {
bool useDeferredLoading = false,
bool useSyntheticPackage = false,
}) async {
this.dir = dir;
_appPath = dir.path;
writeFile(fileSystem.path.join(dir.path, 'android', 'local.properties'), androidLocalProperties);
final Directory tempDir = createResolvedTempDirectorySync('cipd_dest.');
final Directory depotToolsDir = createResolvedTempDirectorySync('depot_tools.');
await processManager.run(<String>[
'git',
'clone',
'https://chromium.googlesource.com/chromium/tools/depot_tools',
depotToolsDir.path,
], workingDirectory: dir.path);
final File cipdFile = depotToolsDir.childFile(Platform.isWindows ? 'cipd.bat' : 'cipd');
await processManager.run(<String>[
cipdFile.path,
'init',
tempDir.path,
'-force',
], workingDirectory: dir.path);
await processManager.run(<String>[
cipdFile.path,
'install',
'flutter/test/full_app_fixtures/vanilla',
version,
'-root',
tempDir.path,
], workingDirectory: dir.path);
if (Platform.isWindows) {
await processManager.run(<String>[
'robocopy',
tempDir.path,
dir.path,
'*',
'/E',
'/mov',
]);
// Add full access permissions to Users
await processManager.run(<String>[
'icacls',
tempDir.path,
'/q',
'/c',
'/t',
'/grant',
'Users:F',
]);
} else {
// This cp command changes the symlinks to real files so the tool can edit them.
await processManager.run(<String>[
'cp',
'-R',
'-L',
'-f',
'${tempDir.path}/.',
dir.path,
]);
await processManager.run(<String>[
'rm',
'-rf',
'.cipd',
], workingDirectory: dir.path);
final List<FileSystemEntity> allFiles = dir.listSync(recursive: true);
for (final FileSystemEntity file in allFiles) {
if (file is! File) {
continue;
}
await processManager.run(<String>[
'chmod',
'+w',
file.path,
], workingDirectory: dir.path);
}
}
if (!vanilla) {
writeFile(fileSystem.path.join(dir.path, 'lib', 'main.dart'), libMain);
writeFile(fileSystem.path.join(dir.path, 'lib', 'other.dart'), libOther);
writeFile(fileSystem.path.join(dir.path, 'pubspec.yaml'), pubspecCustom);
}
tryToDelete(tempDir);
tryToDelete(depotToolsDir);
}
final String version;
final bool vanilla;
late String _appPath;
// Maintain the same pubspec as the configured app.
@override
String get pubspec => fileSystem.file(fileSystem.path.join(_appPath, 'pubspec.yaml')).readAsStringSync();
String get androidLocalProperties => '''
flutter.sdk=${getFlutterRoot()}
''';
String get libMain => '''
import 'package:flutter/material.dart';
import 'other.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: OtherWidget(),
);
}
}
''';
String get libOther => '''
class OtherWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(width: 100, height: 100);
}
}
''';
String get pubspecCustom => '''
name: vanilla_app_1_22_6_stable
description: This is a modified description from the default.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.0
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- images/a_dot_burr.jpeg
- images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
''';
}
| flutter/packages/flutter_tools/test/integration.shard/test_data/migrate_project.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/integration.shard/test_data/migrate_project.dart",
"repo_id": "flutter",
"token_count": 2554
} | 826 |
// 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.
// Not a test file, invoked by `variable_expansion_windows_test.dart`.
void main(List<String> args) {
// This print is used for communicating with the test host.
print('args: $args'); // ignore: avoid_print
}
| flutter/packages/flutter_tools/test/integration.shard/variable_expansion_windows.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/integration.shard/variable_expansion_windows.dart",
"repo_id": "flutter",
"token_count": 106
} | 827 |
// 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_tools/src/flutter_manifest.dart';
import 'package:flutter_tools/src/globals.dart' as globals;
import 'package:yaml/yaml.dart';
import 'common.dart';
/// Check if the pubspec.yaml file under the `projectDir` is valid for a plugin project.
void validatePubspecForPlugin({
required String projectDir,
String? pluginClass,
bool ffiPlugin = false,
required List<String> expectedPlatforms,
List<String> unexpectedPlatforms = const <String>[],
String? androidIdentifier,
String? webFileName,
}) {
assert(pluginClass != null || ffiPlugin);
final FlutterManifest manifest =
FlutterManifest.createFromPath('$projectDir/pubspec.yaml', fileSystem: globals.fs, logger: globals.logger)!;
final YamlMap platformMaps = YamlMap.wrap(manifest.supportedPlatforms!);
for (final String platform in expectedPlatforms) {
expect(platformMaps[platform], isNotNull);
final YamlMap platformMap = platformMaps[platform]! as YamlMap;
if (pluginClass != null) {
expect(platformMap['pluginClass'], pluginClass);
}
if (platform == 'android') {
expect(platformMap['package'], androidIdentifier);
}
if (platform == 'web') {
expect(platformMap['fileName'], webFileName);
}
}
for (final String platform in unexpectedPlatforms) {
expect(platformMaps[platform], isNull);
}
}
| flutter/packages/flutter_tools/test/src/pubspec_schema.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/src/pubspec_schema.dart",
"repo_id": "flutter",
"token_count": 488
} | 828 |
// 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.
@TestOn('browser') // Uses web-only Flutter SDK
library;
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_web_plugins/src/navigation/utils.dart';
void main() {
test('checks base href', () {
expect(() => checkBaseHref(null), throwsException);
expect(() => checkBaseHref('foo'), throwsException);
expect(() => checkBaseHref('/foo'), throwsException);
expect(() => checkBaseHref('foo/bar'), throwsException);
expect(() => checkBaseHref('/foo/bar'), throwsException);
expect(() => checkBaseHref('/'), returnsNormally);
expect(() => checkBaseHref('/foo/'), returnsNormally);
expect(() => checkBaseHref('/foo/bar/'), returnsNormally);
});
test('extracts pathname from URL', () {
expect(extractPathname('/'), '/');
expect(extractPathname('/foo'), '/foo');
expect(extractPathname('/foo/'), '/foo/');
expect(extractPathname('/foo/bar'), '/foo/bar');
expect(extractPathname('/foo/bar/'), '/foo/bar/');
expect(extractPathname('https://example.com'), '/');
expect(extractPathname('https://example.com/'), '/');
expect(extractPathname('https://example.com/foo'), '/foo');
expect(extractPathname('https://example.com/foo#bar'), '/foo');
expect(extractPathname('https://example.com/foo/#bar'), '/foo/');
// URL encoding.
expect(extractPathname('/foo bar'), '/foo%20bar');
expect(extractPathname('https://example.com/foo bar'), '/foo%20bar');
});
}
| flutter/packages/flutter_web_plugins/test/navigation/utils_test.dart/0 | {
"file_path": "flutter/packages/flutter_web_plugins/test/navigation/utils_test.dart",
"repo_id": "flutter",
"token_count": 555
} | 829 |
# integration_test
This package enables self-driving testing of Flutter code on devices and emulators.
It adapts flutter_test results into a format that is compatible with `flutter drive`
and native Android instrumentation testing.
## Usage
Add a dependency on the `integration_test` and `flutter_test` package in the
`dev_dependencies` section of `pubspec.yaml`. For plugins, do this in the
`pubspec.yaml` of the example app:
```yaml
dev_dependencies:
integration_test:
sdk: flutter
flutter_test:
sdk: flutter
```
Create a `integration_test/` directory for your package. In this directory,
create a `<name>_test.dart`, using the following as a starting point to make
assertions.
```dart
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
testWidgets("failing test example", (WidgetTester tester) async {
expect(2 + 2, equals(5));
});
}
```
### Driver Entrypoint
An accompanying driver script will be needed that can be shared across all
integration tests. Create a file named `integration_test.dart` in the
`test_driver/` directory with the following contents:
```dart
import 'package:integration_test/integration_test_driver.dart';
Future<void> main() => integrationDriver();
```
You can also use different driver scripts to customize the behavior of the app
under test. For example, `FlutterDriver` can also be parameterized with
different [options](https://api.flutter.dev/flutter/flutter_driver/FlutterDriver/connect.html).
See the [extended driver](https://github.com/flutter/flutter/blob/master/packages/integration_test/example/test_driver/extended_integration_test.dart) for an example.
### Package Structure
Your package should have a structure that looks like this:
```
lib/
...
integration_test/
foo_test.dart
bar_test.dart
test/
# Other unit tests go here.
test_driver/
integration_test.dart
```
[Example](https://github.com/flutter/flutter/tree/master/packages/integration_test/example)
## Using Flutter Driver to Run Tests
These tests can be launched with the `flutter drive` command.
To run the `integration_test/foo_test.dart` test with the
`test_driver/integration_test.dart` driver, use the following command:
```sh
flutter drive \
--driver=test_driver/integration_test.dart \
--target=integration_test/foo_test.dart
```
### Web
Make sure you have [enabled web support](https://flutter.dev/docs/get-started/web#set-up)
then [download and run](https://docs.flutter.dev/cookbook/testing/integration/introduction#5b-web)
the web driver in another process.
Use following command to execute the tests:
```sh
flutter drive \
--driver=test_driver/integration_test.dart \
--target=integration_test/foo_test.dart \
-d web-server
```
### Screenshots
You can use `integration_test` to take screenshots of the UI rendered on the mobile device or
Web browser at a specific time during the test.
This feature is currently supported on Android, iOS, and Web.
#### Android and iOS
**integration_test/screenshot_test.dart**
```dart
void main() {
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized()
as IntegrationTestWidgetsFlutterBinding;
testWidgets('screenshot', (WidgetTester tester) async {
// Build the app.
app.main();
// This is required prior to taking the screenshot (Android only).
await binding.convertFlutterSurfaceToImage();
// Trigger a frame.
await tester.pumpAndSettle();
await binding.takeScreenshot('screenshot-1');
});
}
```
You can use a driver script to pull in the screenshot from the device.
This way, you can store the images locally on your computer. On iOS, the
screenshot will also be available in Xcode test results.
**test_driver/integration_test.dart**
```dart
import 'dart:io';
import 'package:integration_test/integration_test_driver_extended.dart';
Future<void> main() async {
await integrationDriver(
onScreenshot: (String screenshotName, List<int> screenshotBytes, [Map<String, Object?>? args]) async {
final File image = File('$screenshotName.png');
image.writeAsBytesSync(screenshotBytes);
// Return false if the screenshot is invalid.
return true;
},
);
}
```
#### Web
**integration_test/screenshot_test.dart**
```dart
void main() {
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized()
as IntegrationTestWidgetsFlutterBinding;
testWidgets('screenshot', (WidgetTester tester) async {
// Build the app.
app.main();
// Trigger a frame.
await tester.pumpAndSettle();
await binding.takeScreenshot('screenshot-1');
});
}
```
## Android Device Testing
Create an instrumentation test file in your application's
**android/app/src/androidTest/java/com/example/myapp/** directory (replacing
com, example, and myapp with values from your app's package name). You can name
this test file `MainActivityTest.java` or another name of your choice.
```java
package com.example.myapp;
import androidx.test.rule.ActivityTestRule;
import dev.flutter.plugins.integration_test.FlutterTestRunner;
import org.junit.Rule;
import org.junit.runner.RunWith;
@RunWith(FlutterTestRunner.class)
public class MainActivityTest {
@Rule
public ActivityTestRule<MainActivity> rule = new ActivityTestRule<>(MainActivity.class, true, false);
}
```
Update your application's **myapp/android/app/build.gradle** to make sure it
uses androidx's version of `AndroidJUnitRunner` and has androidx libraries as a
dependency.
```gradle
android {
...
defaultConfig {
...
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
}
dependencies {
testImplementation 'junit:junit:4.12'
// https://developer.android.com/jetpack/androidx/releases/test/#1.2.0
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
```
To run `integration_test/foo_test.dart` on a local Android device (emulated or
physical):
```sh
./gradlew app:connectedAndroidTest -Ptarget=`pwd`/../integration_test/foo_test.dart
```
Note:
To use `--dart-define` with `gradlew` you must `base64` encode all parameters,
and pass them to gradle in a comma separated list:
```bash
./gradlew project:task -Pdart-defines="{base64(key=value)},[...]"
```
## Firebase Test Lab
If this is your first time testing with Firebase Test Lab, you'll need to follow
the guides in the [Firebase test lab
documentation](https://firebase.google.com/docs/test-lab/?gclid=EAIaIQobChMIs5qVwqW25QIV8iCtBh3DrwyUEAAYASAAEgLFU_D_BwE)
to set up a project.
To run a test on Android devices using Firebase Test Lab, use gradle commands to build an
instrumentation test for Android, after creating `androidTest` as suggested in the last section.
```bash
pushd android
# flutter build generates files in android/ for building the app
flutter build apk
./gradlew app:assembleAndroidTest
./gradlew app:assembleDebug -Ptarget=<path_to_test>.dart
popd
```
Upload the build apks Firebase Test Lab, making sure to replace <PATH_TO_KEY_FILE>,
<PROJECT_NAME>, <RESULTS_BUCKET>, and <RESULTS_DIRECTORY> with your values.
```bash
gcloud auth activate-service-account --key-file=<PATH_TO_KEY_FILE>
gcloud --quiet config set project <PROJECT_NAME>
gcloud firebase test android run --type instrumentation \
--app build/app/outputs/apk/debug/app-debug.apk \
--test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk\
--timeout 2m \
--results-bucket=<RESULTS_BUCKET> \
--results-dir=<RESULTS_DIRECTORY>
```
You can pass additional parameters on the command line, such as the
devices you want to test on. See
[gcloud firebase test android run](https://cloud.google.com/sdk/gcloud/reference/firebase/test/android/run).
## iOS Device Testing
Open `ios/Runner.xcworkspace` in Xcode. Create a test target if you
do not already have one via `File > New > Target...` and select `Unit Testing Bundle`.
Change the `Product Name` to `RunnerTests`. Make sure `Target to be Tested` is set to `Runner` and language is set to `Objective-C`.
Select `Finish`.
Make sure that the **iOS Deployment Target** of `RunnerTests` within the **Build Settings** section is the same as `Runner`.
Add the new test target to `ios/Podfile` by embedding in the existing `Runner` target.
```ruby
target 'Runner' do
# Do not change existing lines.
...
target 'RunnerTests' do
inherit! :search_paths
end
end
```
To build `integration_test/foo_test.dart` from the command line, run:
```sh
flutter build ios --config-only integration_test/foo_test.dart
```
In Xcode, add a test file called `RunnerTests.m` (or any name of your choice) to the new target and
replace the file:
```objective-c
@import XCTest;
@import integration_test;
INTEGRATION_TEST_IOS_RUNNER(RunnerTests)
```
Run `Product > Test` to run the integration tests on your selected device.
To deploy it to Firebase Test Lab you can follow these steps:
Execute this script at the root of your Flutter app:
```sh
output="../build/ios_integ"
product="build/ios_integ/Build/Products"
flutter clean
# Pass --simulator if building for the simulator.
flutter build ios integration_test/foo_test.dart --release
pushd ios
xcodebuild build-for-testing \
-workspace Runner.xcworkspace \
-scheme Runner \
-xcconfig Flutter/Release.xcconfig \
-configuration Release \
-derivedDataPath \
$output -sdk iphoneos
popd
pushd $product
find . -name "Runner_*.xctestrun" -exec zip -r --must-match "ios_tests.zip" "Release-iphoneos" {} +
popd
```
You can verify locally that your tests are successful by running the following command:
```sh
xcodebuild test-without-building \
-xctestrun "build/ios_integ/Build/Products/Runner_*.xctestrun" \
-destination id=<YOUR_DEVICE_ID>
```
Once everything is ok, you can upload the resulting zip to Firebase Test Lab (change the model with your values):
```sh
gcloud firebase test ios run \
--test "build/ios_integ/Build/Products/ios_tests.zip" \
--device model=iphone11pro,version=14.1,locale=fr_FR,orientation=portrait
```
| flutter/packages/integration_test/README.md/0 | {
"file_path": "flutter/packages/integration_test/README.md",
"repo_id": "flutter",
"token_count": 3277
} | 830 |
# Intentionally empty. Validation is that apps can set their own proguard files.
| flutter/packages/integration_test/example/android/app/proguard-rules.pro/0 | {
"file_path": "flutter/packages/integration_test/example/android/app/proguard-rules.pro",
"repo_id": "flutter",
"token_count": 21
} | 831 |
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
| flutter/packages/integration_test/example/android/gradle/wrapper/gradle-wrapper.properties/0 | {
"file_path": "flutter/packages/integration_test/example/android/gradle/wrapper/gradle-wrapper.properties",
"repo_id": "flutter",
"token_count": 71
} | 832 |
// 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 XCTest;
@import integration_test;
#pragma mark - Dynamic tests
INTEGRATION_TEST_IOS_RUNNER(RunnerTests)
@interface RunnerTests (DynamicTests)
@end
@implementation RunnerTests (DynamicTests)
- (void)setUp {
// Verify tests have been dynamically added from FLUTTER_TARGET=integration_test/extended_test.dart
XCTAssertTrue([self respondsToSelector:NSSelectorFromString(@"testVerifyScreenshot")]);
XCTAssertTrue([self respondsToSelector:NSSelectorFromString(@"testVerifyText")]);
XCTAssertTrue([self respondsToSelector:NSSelectorFromString(@"screenshotPlaceholder")]);
}
@end
#pragma mark - Fake test results
@interface IntegrationTestPlugin ()
- (instancetype)initForRegistration;
@end
@interface FLTIntegrationTestRunner ()
@property IntegrationTestPlugin *integrationTestPlugin;
@end
@interface FakeIntegrationTestPlugin : IntegrationTestPlugin
@property(nonatomic, nullable) NSDictionary<NSString *, NSString *> *testResults;
@end
@implementation FakeIntegrationTestPlugin
@synthesize testResults;
@end
#pragma mark - Behavior tests
@interface IntegrationTestTests : XCTestCase
@end
@implementation IntegrationTestTests
- (void)testDeprecatedIntegrationTest {
NSString *testResult;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
BOOL testPass = [[IntegrationTestIosTest new] testIntegrationTest:&testResult];
#pragma clang diagnostic pop
XCTAssertTrue(testPass, @"%@", testResult);
}
- (void)testMethodNamesFromDartTests {
XCTAssertEqualObjects([FLTIntegrationTestRunner
testCaseNameFromDartTestName:@"this is a test"], @"testThisIsATest");
XCTAssertEqualObjects([FLTIntegrationTestRunner
testCaseNameFromDartTestName:@"VALIDATE multi-point 🚀 UNICODE123: 😁"], @"testValidateMultiPointUnicode123");
XCTAssertEqualObjects([FLTIntegrationTestRunner
testCaseNameFromDartTestName:@"!UPPERCASE:\\ lower_separate?"], @"testUppercaseLowerSeparate");
}
- (void)testDuplicatedDartTests {
FakeIntegrationTestPlugin *fakePlugin = [[FakeIntegrationTestPlugin alloc] initForRegistration];
// These are unique test names in dart, but would result in duplicate
// XCTestCase names when the emojis are stripped.
fakePlugin.testResults = @{@"unique": @"dart test failure", @"emoji 🐢": @"success", @"emoji 🐇": @"failure"};
FLTIntegrationTestRunner *runner = [[FLTIntegrationTestRunner alloc] init];
runner.integrationTestPlugin = fakePlugin;
NSMutableDictionary<NSString *, NSString *> *failuresByTestName = [[NSMutableDictionary alloc] init];
[runner testIntegrationTestWithResults:^(SEL nativeTestSelector, BOOL success, NSString *failureMessage) {
NSString *testName = NSStringFromSelector(nativeTestSelector);
XCTAssertFalse([failuresByTestName.allKeys containsObject:testName]);
failuresByTestName[testName] = failureMessage;
}];
XCTAssertEqualObjects(failuresByTestName,
(@{@"testUnique": @"dart test failure",
@"testDuplicateTestNames": @"Cannot test \"emoji 🐇\", duplicate XCTestCase tests named testEmoji"}));
}
@end
| flutter/packages/integration_test/example/ios/RunnerTests/RunnerTests.m/0 | {
"file_path": "flutter/packages/integration_test/example/ios/RunnerTests/RunnerTests.m",
"repo_id": "flutter",
"token_count": 1147
} | 833 |
package com.example.digital_clock
import android.os.Bundle
import io.flutter.app.FlutterActivity
import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
GeneratedPluginRegistrant.registerWith(this)
}
}
| flutter_clock/digital_clock/android/app/src/main/kotlin/com/example/digital_clock/MainActivity.kt/0 | {
"file_path": "flutter_clock/digital_clock/android/app/src/main/kotlin/com/example/digital_clock/MainActivity.kt",
"repo_id": "flutter_clock",
"token_count": 118
} | 834 |
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id "com.google.firebase.crashlytics"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
namespace "io.flutter.demo.gallery"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "io.flutter.demo.gallery"
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
if (keystorePropertiesFile.exists()) {
signingConfig signingConfigs.release
} else {
signingConfig signingConfigs.debug
}
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.google.android.play:core:1.10.0"
}
| gallery/android/app/build.gradle/0 | {
"file_path": "gallery/android/app/build.gradle",
"repo_id": "gallery",
"token_count": 914
} | 835 |
// Copyright 2019 The Flutter team. 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/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
// BEGIN cupertinoSearchTextFieldDemo
class CupertinoSearchTextFieldDemo extends StatefulWidget {
const CupertinoSearchTextFieldDemo({super.key});
@override
State<CupertinoSearchTextFieldDemo> createState() =>
_CupertinoSearchTextFieldDemoState();
}
class _CupertinoSearchTextFieldDemoState
extends State<CupertinoSearchTextFieldDemo> {
final List<String> platforms = [
'Android',
'iOS',
'Windows',
'Linux',
'MacOS',
'Web'
];
final TextEditingController _queryTextController = TextEditingController();
String _searchPlatform = '';
List<String> filteredPlatforms = [];
@override
void initState() {
super.initState();
filteredPlatforms = platforms;
_queryTextController.addListener(() {
if (_queryTextController.text.isEmpty) {
setState(() {
_searchPlatform = '';
filteredPlatforms = platforms;
});
} else {
setState(() {
_searchPlatform = _queryTextController.text;
});
}
});
}
@override
Widget build(BuildContext context) {
final localizations = GalleryLocalizations.of(context)!;
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
automaticallyImplyLeading: false,
middle: Text(localizations.demoCupertinoSearchTextFieldTitle),
),
child: SafeArea(
child: Column(
children: [
CupertinoSearchTextField(
controller: _queryTextController,
restorationId: 'search_text_field',
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 12),
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0,
color: CupertinoColors.inactiveGray,
),
),
),
placeholder:
localizations.demoCupertinoSearchTextFieldPlaceholder,
),
_buildPlatformList(),
],
),
),
);
}
Widget _buildPlatformList() {
if (_searchPlatform.isNotEmpty) {
List<String> tempList = [];
for (int i = 0; i < filteredPlatforms.length; i++) {
if (filteredPlatforms[i]
.toLowerCase()
.contains(_searchPlatform.toLowerCase())) {
tempList.add(filteredPlatforms[i]);
}
}
filteredPlatforms = tempList;
}
return ListView.builder(
itemCount: filteredPlatforms.length,
shrinkWrap: true,
itemBuilder: (context, index) {
return ListTile(title: Text(filteredPlatforms[index]));
},
);
}
}
// END
| gallery/lib/demos/cupertino/cupertino_search_text_field_demo.dart/0 | {
"file_path": "gallery/lib/demos/cupertino/cupertino_search_text_field_demo.dart",
"repo_id": "gallery",
"token_count": 1289
} | 836 |
// Copyright 2019 The Flutter team. 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_gen/gen_l10n/gallery_localizations.dart';
import 'package:gallery/data/gallery_options.dart';
import 'package:gallery/demos/material/material_demo_types.dart';
// BEGIN dialogDemo
class DialogDemo extends StatefulWidget {
const DialogDemo({super.key, required this.type});
final DialogDemoType type;
@override
State<DialogDemo> createState() => _DialogDemoState();
}
class _DialogDemoState extends State<DialogDemo> with RestorationMixin {
late RestorableRouteFuture<String> _alertDialogRoute;
late RestorableRouteFuture<String> _alertDialogWithTitleRoute;
late RestorableRouteFuture<String> _simpleDialogRoute;
@override
String get restorationId => 'dialog_demo';
@override
void restoreState(RestorationBucket? oldBucket, bool initialRestore) {
registerForRestoration(
_alertDialogRoute,
'alert_demo_dialog_route',
);
registerForRestoration(
_alertDialogWithTitleRoute,
'alert_demo_with_title_dialog_route',
);
registerForRestoration(
_simpleDialogRoute,
'simple_dialog_route',
);
}
// Displays the popped String value in a SnackBar.
void _showInSnackBar(String value) {
// The value passed to Navigator.pop() or null.
ScaffoldMessenger.of(context).hideCurrentSnackBar();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
GalleryLocalizations.of(context)!.dialogSelectedOption(value),
),
),
);
}
@override
void initState() {
super.initState();
_alertDialogRoute = RestorableRouteFuture<String>(
onPresent: (navigator, arguments) {
return navigator.restorablePush(_alertDialogDemoRoute);
},
onComplete: _showInSnackBar,
);
_alertDialogWithTitleRoute = RestorableRouteFuture<String>(
onPresent: (navigator, arguments) {
return navigator.restorablePush(_alertDialogWithTitleDemoRoute);
},
onComplete: _showInSnackBar,
);
_simpleDialogRoute = RestorableRouteFuture<String>(
onPresent: (navigator, arguments) {
return navigator.restorablePush(_simpleDialogDemoRoute);
},
onComplete: _showInSnackBar,
);
}
String _title(BuildContext context) {
final localizations = GalleryLocalizations.of(context)!;
switch (widget.type) {
case DialogDemoType.alert:
return localizations.demoAlertDialogTitle;
case DialogDemoType.alertTitle:
return localizations.demoAlertTitleDialogTitle;
case DialogDemoType.simple:
return localizations.demoSimpleDialogTitle;
case DialogDemoType.fullscreen:
return localizations.demoFullscreenDialogTitle;
}
}
static Route<String> _alertDialogDemoRoute(
BuildContext context,
Object? arguments,
) {
final theme = Theme.of(context);
final dialogTextStyle = theme.textTheme.titleMedium!
.copyWith(color: theme.textTheme.bodySmall!.color);
return DialogRoute<String>(
context: context,
builder: (context) {
final localizations = GalleryLocalizations.of(context)!;
return ApplyTextOptions(
child: AlertDialog(
content: Text(
localizations.dialogDiscardTitle,
style: dialogTextStyle,
),
actions: [
_DialogButton(text: localizations.dialogCancel),
_DialogButton(text: localizations.dialogDiscard),
],
));
},
);
}
static Route<String> _alertDialogWithTitleDemoRoute(
BuildContext context,
Object? arguments,
) {
final theme = Theme.of(context);
final dialogTextStyle = theme.textTheme.titleMedium!
.copyWith(color: theme.textTheme.bodySmall!.color);
return DialogRoute<String>(
context: context,
builder: (context) {
final localizations = GalleryLocalizations.of(context)!;
return ApplyTextOptions(
child: AlertDialog(
title: Text(localizations.dialogLocationTitle),
content: Text(
localizations.dialogLocationDescription,
style: dialogTextStyle,
),
actions: [
_DialogButton(text: localizations.dialogDisagree),
_DialogButton(text: localizations.dialogAgree),
],
),
);
},
);
}
static Route<String> _simpleDialogDemoRoute(
BuildContext context,
Object? arguments,
) {
final theme = Theme.of(context);
return DialogRoute<String>(
context: context,
builder: (context) => ApplyTextOptions(
child: SimpleDialog(
title: Text(GalleryLocalizations.of(context)!.dialogSetBackup),
children: [
_DialogDemoItem(
icon: Icons.account_circle,
color: theme.colorScheme.primary,
text: '[email protected]',
),
_DialogDemoItem(
icon: Icons.account_circle,
color: theme.colorScheme.secondary,
text: '[email protected]',
),
_DialogDemoItem(
icon: Icons.add_circle,
text: GalleryLocalizations.of(context)!.dialogAddAccount,
color: theme.disabledColor,
),
],
),
),
);
}
static Route<void> _fullscreenDialogRoute(
BuildContext context,
Object? arguments,
) {
return MaterialPageRoute<void>(
builder: (context) => _FullScreenDialogDemo(),
fullscreenDialog: true,
);
}
@override
Widget build(BuildContext context) {
return Navigator(
// Adding [ValueKey] to make sure that the widget gets rebuilt when
// changing type.
key: ValueKey(widget.type),
restorationScopeId: 'navigator',
onGenerateRoute: (settings) {
return _NoAnimationMaterialPageRoute<void>(
settings: settings,
builder: (context) => Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
title: Text(_title(context)),
),
body: Center(
child: ElevatedButton(
onPressed: () {
switch (widget.type) {
case DialogDemoType.alert:
_alertDialogRoute.present();
break;
case DialogDemoType.alertTitle:
_alertDialogWithTitleRoute.present();
break;
case DialogDemoType.simple:
_simpleDialogRoute.present();
break;
case DialogDemoType.fullscreen:
Navigator.restorablePush<void>(
context, _fullscreenDialogRoute);
break;
}
},
child: Text(GalleryLocalizations.of(context)!.dialogShow),
),
),
),
);
},
);
}
}
/// A MaterialPageRoute without any transition animations.
class _NoAnimationMaterialPageRoute<T> extends MaterialPageRoute<T> {
_NoAnimationMaterialPageRoute({
required super.builder,
super.settings,
super.maintainState,
super.fullscreenDialog,
});
@override
Widget buildTransitions(
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
Widget child,
) {
return child;
}
}
class _DialogButton extends StatelessWidget {
const _DialogButton({required this.text});
final String text;
@override
Widget build(BuildContext context) {
return TextButton(
onPressed: () {
Navigator.of(context).pop(text);
},
child: Text(text),
);
}
}
class _DialogDemoItem extends StatelessWidget {
const _DialogDemoItem({
this.icon,
this.color,
required this.text,
});
final IconData? icon;
final Color? color;
final String text;
@override
Widget build(BuildContext context) {
return SimpleDialogOption(
onPressed: () {
Navigator.of(context).pop(text);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(icon, size: 36, color: color),
Flexible(
child: Padding(
padding: const EdgeInsetsDirectional.only(start: 16),
child: Text(text),
),
),
],
),
);
}
}
class _FullScreenDialogDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final localizations = GalleryLocalizations.of(context)!;
// Remove the MediaQuery padding because the demo is rendered inside of a
// different page that already accounts for this padding.
return MediaQuery.removePadding(
context: context,
removeTop: true,
removeBottom: true,
child: ApplyTextOptions(
child: Scaffold(
appBar: AppBar(
title: Text(localizations.dialogFullscreenTitle),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: Text(
localizations.dialogFullscreenSave,
style: theme.textTheme.bodyMedium!.copyWith(
color: theme.colorScheme.onPrimary,
),
),
),
],
),
body: Center(
child: Text(
localizations.dialogFullscreenDescription,
),
),
),
),
);
}
}
// END
| gallery/lib/demos/material/dialog_demo.dart/0 | {
"file_path": "gallery/lib/demos/material/dialog_demo.dart",
"repo_id": "gallery",
"token_count": 4347
} | 837 |
// Copyright 2019 The Flutter team. 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_gen/gen_l10n/gallery_localizations.dart';
// BEGIN tooltipDemo
class TooltipDemo extends StatelessWidget {
const TooltipDemo({super.key});
@override
Widget build(BuildContext context) {
final localizations = GalleryLocalizations.of(context)!;
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
title: Text(localizations.demoTooltipTitle),
),
body: Center(
child: Padding(
padding: const EdgeInsets.all(8),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
localizations.demoTooltipInstructions,
textAlign: TextAlign.center,
),
const SizedBox(height: 16),
Tooltip(
message: localizations.starterAppTooltipSearch,
child: IconButton(
color: Theme.of(context).colorScheme.primary,
onPressed: () {},
icon: const Icon(Icons.search),
),
),
],
),
),
),
);
}
}
// END
| gallery/lib/demos/material/tooltip_demo.dart/0 | {
"file_path": "gallery/lib/demos/material/tooltip_demo.dart",
"repo_id": "gallery",
"token_count": 650
} | 838 |
// Copyright 2019 The Flutter team. 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';
import 'package:gallery/feature_discovery/animation.dart';
const contentHeight = 80.0;
const contentWidth = 300.0;
const contentHorizontalPadding = 40.0;
const tapTargetRadius = 44.0;
const tapTargetToContentDistance = 20.0;
const gutterHeight = 88.0;
/// Background of the overlay.
class Background extends StatelessWidget {
/// Animations.
final Animations animations;
/// Overlay center position.
final Offset center;
/// Color of the background.
final Color color;
/// Device size.
final Size deviceSize;
/// Status of the parent overlay.
final FeatureDiscoveryStatus status;
/// Directionality of content.
final TextDirection textDirection;
static const horizontalShift = 20.0;
static const padding = 40.0;
const Background({
super.key,
required this.animations,
required this.center,
required this.color,
required this.deviceSize,
required this.status,
required this.textDirection,
});
/// Compute the center position of the background.
///
/// If [center] is near the top or bottom edges of the screen, then
/// background is centered there.
/// Otherwise, background center is calculated and upon opening, animated
/// from [center] to the new calculated position.
Offset get centerPosition {
if (_isNearTopOrBottomEdges(center, deviceSize)) {
return center;
} else {
final start = center;
// dy of centerPosition is calculated to be the furthest point in
// [Content] from the [center].
double endY;
if (_isOnTopHalfOfScreen(center, deviceSize)) {
endY = center.dy -
tapTargetRadius -
tapTargetToContentDistance -
contentHeight;
if (endY < 0.0) {
endY = center.dy + tapTargetRadius + tapTargetToContentDistance;
}
} else {
endY = center.dy + tapTargetRadius + tapTargetToContentDistance;
if (endY + contentHeight > deviceSize.height) {
endY = center.dy -
tapTargetRadius -
tapTargetToContentDistance -
contentHeight;
}
}
// Horizontal background center shift based on whether the tap target is
// on the left, center, or right side of the screen.
double shift;
if (_isOnLeftHalfOfScreen(center, deviceSize)) {
shift = horizontalShift;
} else if (center.dx == deviceSize.width / 2) {
shift = textDirection == TextDirection.ltr
? -horizontalShift
: horizontalShift;
} else {
shift = -horizontalShift;
}
// dx of centerPosition is calculated to be the middle point of the
// [Content] bounds shifted by [horizontalShift].
final textBounds = _getContentBounds(deviceSize, center);
final left = min(textBounds.left, center.dx - 88.0);
final right = max(textBounds.right, center.dx + 88.0);
final endX = (left + right) / 2 + shift;
final end = Offset(endX, endY);
return animations.backgroundCenter(status, start, end).value;
}
}
/// Compute the radius.
///
/// Radius is a function of the greatest distance from [center] to one of
/// the corners of [Content].
double get radius {
final textBounds = _getContentBounds(deviceSize, center);
final textRadius = _maxDistance(center, textBounds) + padding;
if (_isNearTopOrBottomEdges(center, deviceSize)) {
return animations.backgroundRadius(status, textRadius).value;
} else {
// Scale down radius if icon is towards the middle of the screen.
return animations.backgroundRadius(status, textRadius).value * 0.8;
}
}
double get opacity => animations.backgroundOpacity(status).value;
@override
Widget build(BuildContext context) {
return Positioned(
left: centerPosition.dx,
top: centerPosition.dy,
child: FractionalTranslation(
translation: const Offset(-0.5, -0.5),
child: Opacity(
opacity: opacity,
child: Container(
height: radius * 2,
width: radius * 2,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: color,
),
),
),
));
}
/// Compute the maximum distance from [point] to the four corners of [bounds].
double _maxDistance(Offset point, Rect bounds) {
double distance(double x1, double y1, double x2, double y2) {
return sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
}
final tl = distance(point.dx, point.dy, bounds.left, bounds.top);
final tr = distance(point.dx, point.dy, bounds.right, bounds.top);
final bl = distance(point.dx, point.dy, bounds.left, bounds.bottom);
final br = distance(point.dx, point.dy, bounds.right, bounds.bottom);
return max(tl, max(tr, max(bl, br)));
}
}
/// Widget that represents the text to show in the overlay.
class Content extends StatelessWidget {
/// Animations.
final Animations animations;
/// Overlay center position.
final Offset center;
/// Description.
final String description;
/// Device size.
final Size deviceSize;
/// Status of the parent overlay.
final FeatureDiscoveryStatus status;
/// Title.
final String title;
/// [TextTheme] to use for drawing the [title] and the [description].
final TextTheme textTheme;
const Content({
super.key,
required this.animations,
required this.center,
required this.description,
required this.deviceSize,
required this.status,
required this.title,
required this.textTheme,
});
double get opacity => animations.contentOpacity(status).value;
@override
Widget build(BuildContext context) {
final position = _getContentBounds(deviceSize, center);
return Positioned(
left: position.left,
height: position.bottom - position.top,
width: position.right - position.left,
top: position.top,
child: Opacity(
opacity: opacity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildTitle(textTheme),
const SizedBox(height: 12.0),
_buildDescription(textTheme),
],
),
),
);
}
Widget _buildTitle(TextTheme theme) {
return Text(
title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: theme.titleLarge?.copyWith(color: Colors.white),
);
}
Widget _buildDescription(TextTheme theme) {
return Text(
description,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: theme.titleMedium?.copyWith(color: Colors.white70),
);
}
}
/// Widget that represents the ripple effect of [TapTarget].
class Ripple extends StatelessWidget {
/// Animations.
final Animations animations;
/// Overlay center position.
final Offset center;
/// Status of the parent overlay.
final FeatureDiscoveryStatus status;
const Ripple({
super.key,
required this.animations,
required this.center,
required this.status,
});
double get radius => animations.rippleRadius(status).value;
double get opacity => animations.rippleOpacity(status).value;
@override
Widget build(BuildContext context) {
return Positioned(
left: center.dx,
top: center.dy,
child: FractionalTranslation(
translation: const Offset(-0.5, -0.5),
child: Opacity(
opacity: opacity,
child: Container(
height: radius * 2,
width: radius * 2,
decoration: const BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
),
),
),
);
}
}
/// Wrapper widget around [child] representing the anchor of the overlay.
class TapTarget extends StatelessWidget {
/// Animations.
final Animations animations;
/// Device size.
final Offset center;
/// Status of the parent overlay.
final FeatureDiscoveryStatus status;
/// Callback invoked when the user taps on the [TapTarget].
final void Function() onTap;
/// Child widget that will be promoted by the overlay.
final Icon child;
const TapTarget({
super.key,
required this.animations,
required this.center,
required this.status,
required this.onTap,
required this.child,
});
double get radius => animations.tapTargetRadius(status).value;
double get opacity => animations.tapTargetOpacity(status).value;
@override
Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
return Positioned(
left: center.dx,
top: center.dy,
child: FractionalTranslation(
translation: const Offset(-0.5, -0.5),
child: InkWell(
onTap: onTap,
child: Opacity(
opacity: opacity,
child: Container(
height: radius * 2,
width: radius * 2,
decoration: BoxDecoration(
color: theme.brightness == Brightness.dark
? theme.colorScheme.primary
: Colors.white,
shape: BoxShape.circle,
),
child: child,
),
),
),
),
);
}
}
/// Method to compute the bounds of the content.
///
/// This is exposed so it can be used for calculating the background radius
/// and center and for laying out the content.
Rect _getContentBounds(Size deviceSize, Offset overlayCenter) {
double top;
if (_isOnTopHalfOfScreen(overlayCenter, deviceSize)) {
top = overlayCenter.dy -
tapTargetRadius -
tapTargetToContentDistance -
contentHeight;
if (top < 0) {
top = overlayCenter.dy + tapTargetRadius + tapTargetToContentDistance;
}
} else {
top = overlayCenter.dy + tapTargetRadius + tapTargetToContentDistance;
if (top + contentHeight > deviceSize.height) {
top = overlayCenter.dy -
tapTargetRadius -
tapTargetToContentDistance -
contentHeight;
}
}
final left = max(contentHorizontalPadding, overlayCenter.dx - contentWidth);
final right =
min(deviceSize.width - contentHorizontalPadding, left + contentWidth);
return Rect.fromLTRB(left, top, right, top + contentHeight);
}
bool _isNearTopOrBottomEdges(Offset position, Size deviceSize) {
return position.dy <= gutterHeight ||
(deviceSize.height - position.dy) <= gutterHeight;
}
bool _isOnTopHalfOfScreen(Offset position, Size deviceSize) {
return position.dy < (deviceSize.height / 2.0);
}
bool _isOnLeftHalfOfScreen(Offset position, Size deviceSize) {
return position.dx < (deviceSize.width / 2.0);
}
| gallery/lib/feature_discovery/overlay.dart/0 | {
"file_path": "gallery/lib/feature_discovery/overlay.dart",
"repo_id": "gallery",
"token_count": 4095
} | 839 |
{
"loading": "Načítání",
"deselect": "Zrušit výběr",
"select": "Vybrat",
"selectable": "Vybratelné (dlouhé stisknutí)",
"selected": "Vybráno",
"demo": "Ukázka",
"bottomAppBar": "Dolní panel aplikace",
"notSelected": "Nevybráno",
"demoCupertinoSearchTextFieldTitle": "Textové pole pro vyhledávání",
"demoCupertinoPicker": "Výběr",
"demoCupertinoSearchTextFieldSubtitle": "Textové pole pro vyhledávání ve stylu iOS",
"demoCupertinoSearchTextFieldDescription": "Textové pole, které uživateli umožní vyhledávat zadáním textu a které může nabízet a filtrovat návrhy.",
"demoCupertinoSearchTextFieldPlaceholder": "Zadejte text",
"demoCupertinoScrollbarTitle": "Posuvník",
"demoCupertinoScrollbarSubtitle": "Posuvník ve stylu iOS",
"demoCupertinoScrollbarDescription": "Posuvník k zabalení podřízeného prvku",
"demoTwoPaneItem": "Položka {value}",
"demoTwoPaneList": "Seznam",
"demoTwoPaneFoldableLabel": "Rozkládací",
"demoTwoPaneSmallScreenLabel": "Malá obrazovka",
"demoTwoPaneSmallScreenDescription": "Takto se TwoPane chová na zařízení s malou obrazovkou.",
"demoTwoPaneTabletLabel": "Tablet / počítač",
"demoTwoPaneTabletDescription": "Takto se TwoPane chová na větší obrazovce, například na tabletu nebo počítači.",
"demoTwoPaneTitle": "TwoPane",
"demoTwoPaneSubtitle": "Responzivní rozvržení na rozkládacích, velkých a malých obrazovkách",
"splashSelectDemo": "Vyberte ukázku",
"demoTwoPaneFoldableDescription": "Takto se TwoPane chová na rozkládacím zařízení.",
"demoTwoPaneDetails": "Podrobnosti",
"demoTwoPaneSelectItem": "Vyberte položku",
"demoTwoPaneItemDetails": "Podrobnosti položky {value}",
"demoCupertinoContextMenuActionText": "Podržením loga Flutter zobrazíte kontextovou nabídku.",
"demoCupertinoContextMenuDescription": "Celoobrazovková kontextová nabídka ve stylu iOS, která se zobrazí při dlouhém stisknutí prvku.",
"demoAppBarTitle": "Panel aplikace",
"demoAppBarDescription": "Panel aplikace poskytuje obsah a akce související s aktuální obrazovkou. Používá se k brandingu, navigaci, akcím a pro názvy obrazovek.",
"demoDividerTitle": "Oddělovač",
"demoDividerSubtitle": "Oddělovač je tenká čára, která seskupuje obsah do seznamů a rozvržení.",
"demoDividerDescription": "Oddělovače lze použít k oddělení obsahu v seznamech, vysouvacích panelech a jinde.",
"demoVerticalDividerTitle": "Vertikální oddělovač",
"demoCupertinoContextMenuTitle": "Kontextová nabídka",
"demoCupertinoContextMenuSubtitle": "Kontextová nabídka ve stylu iOS",
"demoAppBarSubtitle": "Zobrazuje informace a akce týkající se aktuální obrazovky",
"demoCupertinoContextMenuActionOne": "Akce jedna",
"demoCupertinoContextMenuActionTwo": "Akce dvě",
"demoDateRangePickerDescription": "Zobrazuje dialogové okno pro výběr období ve vzhledu Material Design.",
"demoDateRangePickerTitle": "Nástroj pro výběr období",
"demoNavigationDrawerUserName": "Uživatelské jméno",
"demoNavigationDrawerUserEmail": "[email protected]",
"demoNavigationDrawerText": "Zobrazte panel přejetím prstem od okraje nebo klepněte na ikonu vlevo nahoře",
"demoNavigationRailTitle": "Navigační sloupec",
"demoNavigationRailSubtitle": "Zobrazí navigační sloupec v aplikaci",
"demoNavigationRailDescription": "Widget Material Design, který by se měl zobrazovat na levé nebo pravé straně aplikace a slouží k navigaci mezi několika zobrazeními (obvykle 3–5).",
"demoNavigationRailFirst": "1.",
"demoNavigationDrawerTitle": "Vysouvací panel navigace",
"demoNavigationRailThird": "3.",
"replyStarredLabel": "S hvězdičkou",
"demoTextButtonDescription": "Textové tlačítko při stisknutí zobrazí inkoustovou kaňku, ale nezvedne se. Textová tlačítka používejte na lištách, v dialogových oknech a v textu s odsazením",
"demoElevatedButtonTitle": "Zvýšené tlačítko",
"demoElevatedButtonDescription": "Zvýšená tlačítka vnášejí rozměr do převážně plochých rozvržení. Upozorňují na funkce v místech, která jsou hodně navštěvovaná nebo rozsáhlá.",
"demoOutlinedButtonTitle": "Obrysové tlačítko",
"demoOutlinedButtonDescription": "Obrysová tlačítka se při stisknutí zdvihnou a zneprůhlední. Obvykle se vyskytují v páru se zvýšenými tlačítky za účelem označení alternativní, sekundární akce.",
"demoContainerTransformDemoInstructions": "Karty, seznamy a plovoucí tlačítka akce",
"demoNavigationDrawerSubtitle": "Zobrazí vysouvací panel na panelu aplikace",
"replyDescription": "Efektivní a přímočará e-mailová aplikace",
"demoNavigationDrawerDescription": "Panel Material Design, který se posouvá horizontálně od okraje obrazovky a obsahuje navigační odkazy v aplikaci.",
"replyDraftsLabel": "Koncepty",
"demoNavigationDrawerToPageOne": "Položka číslo jedna",
"replyInboxLabel": "Doručené",
"demoSharedXAxisDemoInstructions": "Tlačítka Další a zpět",
"replySpamLabel": "Spam",
"replyTrashLabel": "Koš",
"replySentLabel": "Odesláno",
"demoNavigationRailSecond": "2.",
"demoNavigationDrawerToPageTwo": "Položka číslo dva",
"demoFadeScaleDemoInstructions": "Modální okna a plovoucí tlačítka akce",
"demoFadeThroughDemoInstructions": "Spodní navigace",
"demoSharedZAxisDemoInstructions": "Tlačítko ikony Nastavení",
"demoSharedYAxisDemoInstructions": "Seřadit podle nedávno hraných",
"demoTextButtonTitle": "Textové tlačítko",
"demoSharedZAxisBeefSandwichRecipeTitle": "Hovězí sendvič",
"demoSharedZAxisDessertRecipeDescription": "Recepty na zákusek",
"demoSharedYAxisAlbumTileSubtitle": "Interpret",
"demoSharedYAxisAlbumTileTitle": "Album",
"demoSharedYAxisRecentSortTitle": "Nedávno přehráno",
"demoSharedYAxisAlphabeticalSortTitle": "A–Z",
"demoSharedYAxisAlbumCount": "268 alb",
"demoSharedYAxisTitle": "Sdílená osa y",
"demoSharedXAxisCreateAccountButtonText": "VYTVOŘIT ÚČET",
"demoFadeScaleAlertDialogDiscardButton": "ZAHODIT",
"demoSharedXAxisSignInTextFieldLabel": "E-mail nebo telefonní číslo",
"demoSharedXAxisSignInSubtitleText": "Přihlásit se k účtu",
"demoSharedXAxisSignInWelcomeText": "Ahoj, uživateli David Park",
"demoSharedXAxisIndividualCourseSubtitle": "Zobrazováno samostatně",
"demoSharedXAxisBundledCourseSubtitle": "Seskupeno",
"demoFadeThroughAlbumsDestination": "Alba",
"demoSharedXAxisDesignCourseTitle": "Design",
"demoSharedXAxisIllustrationCourseTitle": "Ilustrace",
"demoSharedXAxisBusinessCourseTitle": "Byznys",
"demoSharedXAxisArtsAndCraftsCourseTitle": "Umění a řemesla",
"demoMotionPlaceholderSubtitle": "Sekundární text",
"demoFadeScaleAlertDialogCancelButton": "ZRUŠIT",
"demoFadeScaleAlertDialogHeader": "Dialog výstrahy",
"demoFadeScaleHideFabButton": "SKRÝT FAB",
"demoFadeScaleShowFabButton": "ZOBRAZIT FAB",
"demoFadeScaleShowAlertDialogButton": "ZOBRAZIT MODÁLNÍ OKNO",
"demoFadeScaleDescription": "Model prolínání je určen pro prvky uživatelského rozhraní, které se zobrazí v prostoru obrazovky nebo odtud zmizí, jako například dialogové okno, které se prolnutím postupně zobrazí uprostřed obrazovky.",
"demoFadeScaleTitle": "Prolínání",
"demoFadeThroughTextPlaceholder": "123 fotek",
"demoFadeThroughSearchDestination": "Vyhledávání",
"demoFadeThroughPhotosDestination": "Fotky",
"demoSharedXAxisCoursePageSubtitle": "Seskupené kategorie se v informačním kanále zobrazují jako skupiny. Toto nastavení můžete později kdykoliv změnit.",
"demoFadeThroughDescription": "Model vyblednutí slouží k přechodu mezi prvky uživatelského rozhraní, které nemají zásadní vzájemnou souvislost.",
"demoFadeThroughTitle": "Vyblednutí",
"demoSharedZAxisHelpSettingLabel": "Nápověda",
"demoMotionSubtitle": "Všechny předdefinované modely pohybu",
"demoSharedZAxisNotificationSettingLabel": "Oznámení",
"demoSharedZAxisProfileSettingLabel": "Profil",
"demoSharedZAxisSavedRecipesListTitle": "Uložené recepty",
"demoSharedZAxisBeefSandwichRecipeDescription": "Recepty na hovězí sendvič",
"demoSharedZAxisCrabPlateRecipeDescription": "Recepty na kraba",
"demoSharedXAxisCoursePageTitle": "Zjednodušení kurzů",
"demoSharedZAxisCrabPlateRecipeTitle": "Krab",
"demoSharedZAxisShrimpPlateRecipeDescription": "Recepty na krevety",
"demoSharedZAxisShrimpPlateRecipeTitle": "Krevety",
"demoContainerTransformTypeFadeThrough": "VYBLEDNUTÍ",
"demoSharedZAxisDessertRecipeTitle": "Zákusek",
"demoSharedZAxisSandwichRecipeDescription": "Recepty na sendvič",
"demoSharedZAxisSandwichRecipeTitle": "Sendvič",
"demoSharedZAxisBurgerRecipeDescription": "Recepty na hamburger",
"demoSharedZAxisBurgerRecipeTitle": "Hamburger",
"demoSharedZAxisSettingsPageTitle": "Nastavení",
"demoSharedZAxisTitle": "Sdílená osa z",
"demoSharedZAxisPrivacySettingLabel": "Ochrana soukromí",
"demoMotionTitle": "Pohyb",
"demoContainerTransformTitle": "Transformace kontejneru",
"demoContainerTransformDescription": "Model transformace kontejneru je určen pro přechody mezi prvky uživatelského rozhraní, které obsahují kontejner. Tento model vytváří viditelnou spojitost mezi dvěma prvky uživatelského rozhraní.",
"demoContainerTransformModalBottomSheetTitle": "Režim prolínání",
"demoContainerTransformTypeFade": "PROLÍNÁNÍ",
"demoSharedYAxisAlbumTileDurationUnit": "min",
"demoMotionPlaceholderTitle": "Název",
"demoSharedXAxisForgotEmailButtonText": "ZAPOMNĚLI JSTE SVŮJ E-MAIL?",
"demoMotionSmallPlaceholderSubtitle": "Sekundární",
"demoMotionDetailsPageTitle": "Stránka s podrobnostmi",
"demoMotionListTileTitle": "Položka seznamu",
"demoSharedAxisDescription": "Model sdílené osy slouží k přechodu mezi prvky uživatelského rozhraní, které spolu souvisí prostorově nebo z hlediska navigačních prvků. Tento model zvýrazňuje vztahy mezi prvky prostřednictvím sdílené transformace na ose x, y nebo z.",
"demoSharedXAxisTitle": "Sdílená osa x",
"demoSharedXAxisBackButtonText": "ZPĚT",
"demoSharedXAxisNextButtonText": "DALŠÍ",
"demoSharedXAxisCulinaryCourseTitle": "Vaření",
"githubRepo": "Repozitář GitHub {repoName}",
"fortnightlyMenuUS": "USA",
"fortnightlyMenuBusiness": "Byznys",
"fortnightlyMenuScience": "Věda",
"fortnightlyMenuSports": "Sport",
"fortnightlyMenuTravel": "Cestování",
"fortnightlyMenuCulture": "Kultura",
"fortnightlyTrendingTechDesign": "Technologický_návrh",
"rallyBudgetDetailAmountLeft": "Zbývající částka",
"fortnightlyHeadlineArmy": "Reforma Zelené armády zevnitř",
"fortnightlyDescription": "Zpravodajská aplikace zaměřená na kvalitní obsah",
"rallyBillDetailAmountDue": "Dlužná částka",
"rallyBudgetDetailTotalCap": "Celkový limit",
"rallyBudgetDetailAmountUsed": "Využitá částka",
"fortnightlyTrendingHealthcareRevolution": "Revoluce_ve_zdravotnictví",
"fortnightlyMenuFrontPage": "Titulní stránka",
"fortnightlyMenuWorld": "Svět",
"rallyBillDetailAmountPaid": "Zaplacená částka",
"fortnightlyMenuPolitics": "Politika",
"fortnightlyHeadlineBees": "Nízké stavy včelstev pro opylování zemědělských plodin",
"fortnightlyHeadlineGasoline": "Budoucnost benzínu",
"fortnightlyTrendingGreenArmy": "Zelená_armáda",
"fortnightlyHeadlineFeminists": "Feministky brojí proti předpojatosti",
"fortnightlyHeadlineFabrics": "Designéři využívají technologie k vytváření látek budoucnosti",
"fortnightlyHeadlineStocks": "Akcie stagnují a mnozí se uchylují k hotovosti",
"fortnightlyTrendingReform": "Reforma",
"fortnightlyMenuTech": "Technologie",
"fortnightlyHeadlineWar": "Rozdělené životy Američanů za války",
"fortnightlyHeadlineHealthcare": "Nenápadná, zato však zásadní revoluce ve zdravotní péči",
"fortnightlyLatestUpdates": "Novinky",
"fortnightlyTrendingStocks": "Akcie",
"rallyBillDetailTotalAmount": "Celková částka",
"demoCupertinoPickerDateTime": "Datum a čas",
"signIn": "PŘIHLÁSIT SE",
"dataTableRowWithSugar": "{value} s cukrem",
"dataTableRowApplePie": "Jablečný koláč",
"dataTableRowDonut": "Kobliha",
"dataTableRowHoneycomb": "Medová plástev",
"dataTableRowLollipop": "Lízátko",
"dataTableRowJellyBean": "Želatinová fazolka",
"dataTableRowGingerbread": "Perník",
"dataTableRowCupcake": "Dortík",
"dataTableRowEclair": "Banánek",
"dataTableRowIceCreamSandwich": "Zmrzlinový sendvič",
"dataTableRowFrozenYogurt": "Mražený jogurt",
"dataTableColumnIron": "Železo (%)",
"dataTableColumnCalcium": "Vápník (%)",
"dataTableColumnSodium": "Sodík (mg)",
"demoTimePickerTitle": "Výběr času",
"demo2dTransformationsResetTooltip": "Resetovat transformace",
"dataTableColumnFat": "Tuky (g)",
"dataTableColumnCalories": "Kalorie",
"dataTableColumnDessert": "Dezert (1 porce)",
"cardsDemoTravelDestinationLocation1": "Taňčávúr, Tamilnádu",
"demoTimePickerDescription": "Zobrazuje dialog s výběrem času ve vzhledu Material Design.",
"demoPickersShowPicker": "ZOBRAZIT VÝBĚR",
"demoTabsScrollingTitle": "Posuvné",
"demoTabsNonScrollingTitle": "Neposuvné",
"craneHours": "{hours,plural,=1{1 h}few{{hours} h}many{{hours} h}other{{hours} h}}",
"craneMinutes": "{minutes,plural,=1{1 min}few{{minutes} min}many{{minutes} min}other{{minutes} min}}",
"craneFlightDuration": "{hoursShortForm} {minutesShortForm}",
"dataTableHeader": "Výživa",
"demoDatePickerTitle": "Výběr data",
"demoPickersSubtitle": "Výběr data a času",
"demoPickersTitle": "Výběry",
"demo2dTransformationsEditTooltip": "Upravit pole",
"demoDataTableDescription": "Tabulky údajů zobrazují informace ve formátu mřížky tvořené řádky a sloupci. Informace jsou v nich uspořádány tak, aby byly snadno dohledatelné a uživatelé mohli hledat určité vzorce nebo statistiky.",
"demo2dTransformationsDescription": "Klepnutím upravujte pole a pomocí gest se pohybujte po scéně. Přetažením posunete, stažením prstů přiblížíte, dvěma prsty otočíte. Pomocí tlačítka resetování obnovíte původní orientaci.",
"demo2dTransformationsSubtitle": "Posunutí, přiblížení, otočení",
"demo2dTransformationsTitle": "2D transformace",
"demoCupertinoTextFieldPIN": "PIN",
"demoCupertinoTextFieldDescription": "Textová pole, do kterých mohou uživatelé zadat text pomocí hardwarové nebo softwarové klávesnice.",
"demoCupertinoTextFieldSubtitle": "Textová pole ve stylu iOS",
"demoCupertinoTextFieldTitle": "Textová pole",
"demoDatePickerDescription": "Zobrazuje dialog s výběrem data ve vzhledu Material Design.",
"demoCupertinoPickerTime": "Čas",
"demoCupertinoPickerDate": "Datum",
"demoCupertinoPickerTimer": "Časovač",
"demoCupertinoPickerDescription": "Widget výběru ve stylu iOS, pomocí kterého lze vybírat textové řetězce, datum, čas, nebo datum i čas.",
"demoCupertinoPickerSubtitle": "Výběry ve stylu iOS",
"demoCupertinoPickerTitle": "Výběry",
"dataTableRowWithHoney": "{value} s medem",
"cardsDemoTravelDestinationCity2": "Chettinad",
"bannerDemoResetText": "Resetovat banner",
"bannerDemoMultipleText": "Více akcí",
"bannerDemoLeadingText": "Ikona na začátku",
"dismiss": "ZAVŘÍT",
"cardsDemoTappable": "Klepnutelné",
"cardsDemoSelectable": "Vybratelné (dlouhé stisknutí)",
"cardsDemoExplore": "Prozkoumat",
"cardsDemoExploreSemantics": "Prozkoumat {destinationName}",
"cardsDemoShareSemantics": "Sdílet {destinationName}",
"cardsDemoTravelDestinationTitle1": "10 nejčastěji navštěvovaných měst v Tamilnádu",
"cardsDemoTravelDestinationDescription1": "Číslo 10",
"cardsDemoTravelDestinationCity1": "Taňčávúr",
"dataTableColumnProtein": "Bílkoviny (g)",
"cardsDemoTravelDestinationTitle2": "Řemeslníci z jižní Indie",
"cardsDemoTravelDestinationDescription2": "Předení hedvábí",
"bannerDemoText": "Ve druhém zařízení bylo aktualizováno heslo. Přihlaste se znovu.",
"cardsDemoTravelDestinationLocation2": "Sivaganga, Tamilnádu",
"cardsDemoTravelDestinationTitle3": "Chrám Brihadišvára",
"cardsDemoTravelDestinationDescription3": "Chrámy",
"demoBannerTitle": "Banner",
"demoBannerSubtitle": "Zobrazení banneru se seznamem",
"demoBannerDescription": "Banner zobrazuje důležité, stručné informace a umožňuje uživatelům provádět akce (nebo banner zavřít). K zavření je zapotřebí akce uživatele.",
"demoCardTitle": "Karty",
"demoCardSubtitle": "Základní karty se zaoblenými rohy",
"demoCardDescription": "Karta je list ve vzhledu Material, který slouží k uvedení souvisejících informací, jako je album, zeměpisná poloha, pokrm, kontaktní údaje apod.",
"demoDataTableTitle": "Tabulky údajů",
"demoDataTableSubtitle": "Řádky a sloupce s informacemi",
"dataTableColumnCarbs": "Sacharidy (g)",
"placeTanjore": "Taňčávúr",
"demoGridListsTitle": "Mřížkové seznamy",
"placeFlowerMarket": "Květinový trh",
"placeBronzeWorks": "Slévárna bronzu",
"placeMarket": "Trh",
"placeThanjavurTemple": "Chrám v Taňčávúru",
"placeSaltFarm": "Solná farma",
"placeScooters": "Skútry",
"placeSilkMaker": "Výrobce hedvábí",
"placeLunchPrep": "Příprava jídla",
"placeBeach": "Pláž",
"placeFisherman": "Rybář",
"demoMenuSelected": "Vybráno: {value}",
"demoMenuRemove": "Odstranit",
"demoMenuGetLink": "Získat odkaz",
"demoMenuShare": "Sdílet",
"demoBottomAppBarSubtitle": "Zobrazuje navigační prvky a akce dole",
"demoMenuAnItemWithASectionedMenu": "Položka s členěnou nabídkou",
"demoMenuADisabledMenuItem": "Neaktivní položka nabídky",
"demoLinearProgressIndicatorTitle": "Lineární ukazatel průběhu",
"demoMenuContextMenuItemOne": "1. položka kontextové nabídky",
"demoMenuAnItemWithASimpleMenu": "Položka s jednoduchou nabídkou",
"demoCustomSlidersTitle": "Vlastní posuvníky",
"demoMenuAnItemWithAChecklistMenu": "Položka s nabídkou se zaškrtávacími položkami",
"demoCupertinoActivityIndicatorTitle": "Indikátor aktivity",
"demoCupertinoActivityIndicatorSubtitle": "Indikátory aktivity ve stylu iOS",
"demoCupertinoActivityIndicatorDescription": "Indikátor aktivity ve stylu iOS, který rotuje ve směru hodinových ručiček.",
"demoCupertinoNavigationBarTitle": "Navigační panel",
"demoCupertinoNavigationBarSubtitle": "Navigační panel ve stylu iOS",
"demoCupertinoNavigationBarDescription": "Navigační panel ve stylu iOS. Navigační panel je nástroj, který má uprostřed název stránky (i kdyby už neměl žádné další prvky).",
"demoCupertinoPullToRefreshTitle": "Potažením dolů aktualizujete obsah",
"demoCupertinoPullToRefreshSubtitle": "Ovládací prvek ve stylu iOS, v němž potažením dolů aktualizujete obsah",
"demoCupertinoPullToRefreshDescription": "Widget ve stylu iOS, jehož obsah aktualizujete potažením dolů.",
"demoProgressIndicatorTitle": "Ukazatele průběhu",
"demoProgressIndicatorSubtitle": "Lineární, kruhový, neurčitý",
"demoCircularProgressIndicatorTitle": "Kruhový ukazatel průběhu",
"demoCircularProgressIndicatorDescription": "Kruhový ukazatel průběhu Material Design, který otáčením signalizuje, že aplikace je zaneprázdněná.",
"demoMenuFour": "Čtyři",
"demoLinearProgressIndicatorDescription": "Lineární ukazatel průběhu Material Design.",
"demoTooltipTitle": "Popisky",
"demoTooltipSubtitle": "Krátká zpráva, která se zobrazí při dlouhém stisknutí nebo umístění kurzoru",
"demoTooltipDescription": "Popisky jsou textové štítky, které vysvětlují funkci tlačítka nebo jiného prvku uživatelského rozhraní. Informativní text popisku se zobrazí, když uživatel umístí na prvek kurzor, vybere ho nebo ho dlouze stiskne.",
"demoTooltipInstructions": "Dlouhým stisknutím nebo umístěním kurzoru zobrazíte popisek.",
"placeChennai": "Čennaj",
"demoMenuChecked": "Zaškrtnuto: {value}",
"placeChettinad": "Chettinad",
"demoMenuPreview": "Náhled",
"demoBottomAppBarTitle": "Dolní panel aplikace",
"demoBottomAppBarDescription": "Dolní panely aplikací poskytují přístup k dolnímu vysouvacímu panelu navigace a až čtyřem akcím včetně plovoucího tlačítka akce.",
"bottomAppBarNotch": "S výřezem",
"bottomAppBarPosition": "Pozice plovoucího tlačítka akce",
"bottomAppBarPositionDockedEnd": "Dokované, na konci",
"bottomAppBarPositionDockedCenter": "Dokované, uprostřed",
"bottomAppBarPositionFloatingEnd": "Plovoucí, na konci",
"bottomAppBarPositionFloatingCenter": "Plovoucí, uprostřed",
"demoSlidersEditableNumericalValue": "Upravitelná číselná hodnota",
"demoGridListsSubtitle": "Rozvržení řádků a sloupců",
"demoGridListsDescription": "Mřížkové seznamy se hodí především pro prezentaci homogenních dat, jako jsou obrázky. Jednotlivé položky mřížkového seznamu se označují jako dlaždice.",
"demoGridListsImageOnlyTitle": "Pouze obrázky",
"demoGridListsHeaderTitle": "Se záhlavím",
"demoGridListsFooterTitle": "Se zápatím",
"demoSlidersTitle": "Posuvníky",
"demoSlidersSubtitle": "Widgety pro výběr hodnoty přejetím prstem",
"demoSlidersDescription": "Posuvníky představují rozsah hodnot podél panelu, ze kterých může uživatel zvolit jednu hodnotu. Jsou ideální pro úpravu nastavení jako hlasitost nebo jas nebo pro aplikování filtrů na obrázky.",
"demoRangeSlidersTitle": "Posuvníky s rozsahem",
"demoRangeSlidersDescription": "Posuvníky představují rozsah hodnot podél panelu. Mohou mít na obou koncích panelu ikony, které představují rozsah hodnot. Jsou ideální pro úpravu nastavení jako hlasitost nebo jas nebo pro aplikování filtrů na obrázky.",
"demoMenuAnItemWithAContextMenuButton": "Položka s kontextovou nabídkou",
"demoCustomSlidersDescription": "Posuvníky představují rozsah hodnot podél panelu, ze kterých může uživatel zvolit jednu hodnotu nebo rozsah hodnot. Posuvníkům lze přidělit motiv a lze je přizpůsobit.",
"demoSlidersContinuousWithEditableNumericalValue": "Spojitý s upravitelnou číselnou hodnotou",
"demoSlidersDiscrete": "Diskrétní",
"demoSlidersDiscreteSliderWithCustomTheme": "Diskrétní posuvník s vlastním motivem",
"demoSlidersContinuousRangeSliderWithCustomTheme": "Posuvník se spojitým rozsahem s vlastním motivem",
"demoSlidersContinuous": "Spojitý",
"placePondicherry": "Puduččéri",
"demoMenuTitle": "Nabídka",
"demoContextMenuTitle": "Kontextová nabídka",
"demoSectionedMenuTitle": "Členěná nabídka",
"demoSimpleMenuTitle": "Jednoduchá nabídka",
"demoChecklistMenuTitle": "Nabídka se zaškrtávacími položkami",
"demoMenuSubtitle": "Tlačítka nabídek a jednoduché nabídky",
"demoMenuDescription": "Nabídka obsahuje seznam voleb na dočasné ploše. Zobrazí se, když uživatel interaguje s tlačítkem, příkazem nebo jiným ovládacím prvkem.",
"demoMenuItemValueOne": "1. položka nabídky",
"demoMenuItemValueTwo": "2. položka nabídky",
"demoMenuItemValueThree": "3. položka nabídky",
"demoMenuOne": "Jedna",
"demoMenuTwo": "Dva",
"demoMenuThree": "Tři",
"demoMenuContextMenuItemThree": "3. položka kontextové nabídky",
"demoCupertinoSwitchSubtitle": "Přepínač ve stylu iOS",
"demoSnackbarsText": "Toto je dočasné oznámení.",
"demoCupertinoSliderSubtitle": "Posuvník ve stylu iOS",
"demoCupertinoSliderDescription": "Pomocí posuvníku lze vybírat ze spojité nebo diskrétní množiny hodnot.",
"demoCupertinoSliderContinuous": "Spojité: {value}",
"demoCupertinoSliderDiscrete": "Diskrétní: {value}",
"demoSnackbarsAction": "Stiskli jste akci dočasného oznámení",
"backToGallery": "Zpět do galerie",
"demoCupertinoTabBarTitle": "Lišta karet",
"demoCupertinoSwitchDescription": "Přepínač slouží k zapnutí nebo vypnutí jednoho nastavení.",
"demoSnackbarsActionButtonLabel": "AKCE",
"cupertinoTabBarProfileTab": "Profil",
"demoSnackbarsButtonLabel": "ZOBRAZIT DOČASNÉ OZNÁMENÍ",
"demoSnackbarsDescription": "Dočasná oznámení informují uživatele o procesu, který aplikace provedla nebo provede. Zobrazují se dočasně v dolní části obrazovky. Neměla by rušit uživatelský dojem a k jejich zavření není potřeba interakce uživatele.",
"demoSnackbarsSubtitle": "Dočasná oznámení zobrazují zprávy v dolní části obrazovky",
"demoSnackbarsTitle": "Dočasná oznámení",
"demoCupertinoSliderTitle": "Posuvník",
"cupertinoTabBarChatTab": "Chat",
"cupertinoTabBarHomeTab": "Domovská karta",
"demoCupertinoTabBarDescription": "Dolní navigační lišta karet ve stylu iOS. Zobrazuje několik karet, přičemž jedna (ve výchozím nastavení první) karta je aktivní.",
"demoCupertinoTabBarSubtitle": "Dolní lišta karet ve stylu iOS",
"demoOptionsFeatureTitle": "Zobrazit možnosti",
"demoOptionsFeatureDescription": "Klepnutím sem zobrazíte dostupné možnosti pro tuto ukázku.",
"demoCodeViewerCopyAll": "KOPÍROVAT VŠE",
"shrineScreenReaderRemoveProductButton": "Odstranit produkt {product}",
"shrineScreenReaderProductAddToCart": "Přidat do košíku",
"shrineScreenReaderCart": "{quantity,plural,=0{Nákupní košík, prázdný}=1{Nákupní košík, 1 položka}few{Nákupní košík, {quantity} položky}many{Nákupní košík, {quantity} položky}other{Nákupní košík, {quantity} položek}}",
"demoCodeViewerFailedToCopyToClipboardMessage": "Kopírování do schránky se nezdařilo: {error}",
"demoCodeViewerCopiedToClipboardMessage": "Zkopírováno do schránky.",
"craneSleep8SemanticLabel": "Mayské ruiny na útesu nad pláží",
"craneSleep4SemanticLabel": "Hotel u jezera na úpatí hor",
"craneSleep2SemanticLabel": "Pevnost Machu Picchu",
"craneSleep1SemanticLabel": "Chata v zasněžené krajině se stálezelenými stromy",
"craneSleep0SemanticLabel": "Bungalovy nad vodou",
"craneFly13SemanticLabel": "Bazén u moře s palmami",
"craneFly12SemanticLabel": "Bazén s palmami",
"craneFly11SemanticLabel": "Cihlový maják u moře",
"craneFly10SemanticLabel": "Minarety mešity al-Azhar při západu slunce",
"craneFly9SemanticLabel": "Muž opírající se o staré modré auto",
"craneFly8SemanticLabel": "Supertree Grove",
"craneEat9SemanticLabel": "Kavárenský pult s cukrovím",
"craneEat2SemanticLabel": "Hamburger",
"craneFly5SemanticLabel": "Hotel u jezera na úpatí hor",
"demoSelectionControlsSubtitle": "Zaškrtávací tlačítka, tlačítkové přepínače a přepínače",
"craneEat10SemanticLabel": "Žena držící velký sendvič pastrami",
"craneFly4SemanticLabel": "Bungalovy nad vodou",
"craneEat7SemanticLabel": "Vchod do pekárny",
"craneEat6SemanticLabel": "Pokrm z krevet",
"craneEat5SemanticLabel": "Posezení ve stylové restauraci",
"craneEat4SemanticLabel": "Čokoládový dezert",
"craneEat3SemanticLabel": "Korejské taco",
"craneFly3SemanticLabel": "Pevnost Machu Picchu",
"craneEat1SemanticLabel": "Prázdný bar s vysokými stoličkami",
"craneEat0SemanticLabel": "Pizza v peci na dřevo",
"craneSleep11SemanticLabel": "Mrakodrap Tchaj-pej 101",
"craneSleep10SemanticLabel": "Minarety mešity al-Azhar při západu slunce",
"craneSleep9SemanticLabel": "Cihlový maják u moře",
"craneEat8SemanticLabel": "Talíř s humrem",
"craneSleep7SemanticLabel": "Pestrobarevné domy na náměstí Ribeira",
"craneSleep6SemanticLabel": "Bazén s palmami",
"craneSleep5SemanticLabel": "Stan na poli",
"settingsButtonCloseLabel": "Zavřít nastavení",
"demoSelectionControlsCheckboxDescription": "Zaškrtávací políčka umožňují uživatelům vybrat několik možností z celé sady. Běžná hodnota zaškrtávacího políčka je True nebo False, ale zaškrtávací políčko se třemi stavy může mít také hodnotu Null.",
"settingsButtonLabel": "Nastavení",
"demoListsTitle": "Seznamy",
"demoListsSubtitle": "Rozložení posouvacích seznamů",
"demoListsDescription": "Jeden řádek s pevnou výškou, který obvykle obsahuje text a ikonu na začátku nebo na konci.",
"demoOneLineListsTitle": "Jeden řádek",
"demoTwoLineListsTitle": "Dva řádky",
"demoListsSecondary": "Sekundární text",
"demoSelectionControlsTitle": "Ovládací prvky výběru",
"craneFly7SemanticLabel": "Mount Rushmore",
"demoSelectionControlsCheckboxTitle": "Zaškrtávací políčko",
"craneSleep3SemanticLabel": "Muž opírající se o staré modré auto",
"demoSelectionControlsRadioTitle": "Tlačítkový přepínač",
"demoSelectionControlsRadioDescription": "Tlačítkové přepínače umožňují uživatelům vybrat jednu možnost z celé sady. Tlačítkové přepínače použijte pro výběr, pokud se domníváte, že uživatel potřebuje vidět všechny dostupné možnosti vedle sebe.",
"demoSelectionControlsSwitchTitle": "Přepínač",
"demoSelectionControlsSwitchDescription": "Přepínače mění stav jedné možnosti nastavení. Možnost, kterou přepínač ovládá, i stav, ve kterém se nachází, musejí být zřejmé z příslušného textového štítku.",
"craneFly0SemanticLabel": "Chata v zasněžené krajině se stálezelenými stromy",
"craneFly1SemanticLabel": "Stan na poli",
"craneFly2SemanticLabel": "Modlitební praporky se zasněženou horou v pozadí",
"craneFly6SemanticLabel": "Letecký snímek Paláce výtvarných umění",
"rallySeeAllAccounts": "Zobrazit všechny účty",
"rallyBillAmount": "Faktura {billName} ve výši {amount} je splatná do {date}.",
"shrineTooltipCloseCart": "Zavřít košík",
"shrineTooltipCloseMenu": "Zavřít nabídku",
"shrineTooltipOpenMenu": "Otevřít nabídku",
"shrineTooltipSettings": "Nastavení",
"shrineTooltipSearch": "Hledat",
"demoTabsDescription": "Karty třídí obsah z různých obrazovek, datových sad a dalších interakcí.",
"demoTabsSubtitle": "Karty se zobrazením, která lze nezávisle na sobě posouvat",
"demoTabsTitle": "Karty",
"rallyBudgetAmount": "Rozpočet {budgetName}: využito {amountUsed} z {amountTotal}, zbývá {amountLeft}",
"shrineTooltipRemoveItem": "Odstranit položku",
"rallyAccountAmount": "Účet {accountName} č. {accountNumber} s částkou {amount}.",
"rallySeeAllBudgets": "Zobrazit všechny rozpočty",
"rallySeeAllBills": "Zobrazit všechny faktury",
"craneFormDate": "Vyberte datum",
"craneFormOrigin": "Vyberte počátek cesty",
"craneFly2": "Údolí Khumbu, Nepál",
"craneFly3": "Machu Picchu, Peru",
"craneFly4": "Malé, Maledivy",
"craneFly5": "Vitznau, Švýcarsko",
"craneFly6": "Ciudad de México, Mexiko",
"craneFly7": "Mount Rushmore, USA",
"settingsTextDirectionLocaleBased": "Podle jazyka",
"craneFly9": "Havana, Kuba",
"craneFly10": "Káhira, Egypt",
"craneFly11": "Lisabon, Portugalsko",
"craneFly12": "Napa, USA",
"craneFly13": "Bali, Indonésie",
"craneSleep0": "Malé, Maledivy",
"craneSleep1": "Aspen, USA",
"craneSleep2": "Machu Picchu, Peru",
"demoCupertinoSegmentedControlTitle": "Segmentová kontrola",
"craneSleep4": "Vitznau, Švýcarsko",
"craneSleep5": "Big Sur, USA",
"craneSleep6": "Napa, USA",
"craneSleep7": "Porto, Portugalsko",
"craneSleep8": "Tulum, Mexiko",
"craneEat5": "Soul, Jižní Korea",
"demoChipTitle": "Prvky",
"demoChipSubtitle": "Kompaktní prvky představující vstup, atribut nebo akci",
"demoActionChipTitle": "Prvek akce",
"demoActionChipDescription": "Prvky akce jsou sada možností, které spustí akci související s primárním obsahem. Měly by se objevovat dynamicky a kontextově v uživatelském rozhraní.",
"demoChoiceChipTitle": "Prvek volby",
"demoChoiceChipDescription": "Prvky volby představují jednu volbu ze sady. Obsahují související popisný text nebo kategorie.",
"demoFilterChipTitle": "Filtr",
"demoFilterChipDescription": "Prvky filtru filtrují obsah pomocí značek nebo popisných slov.",
"demoInputChipTitle": "Prvek vstupu",
"demoInputChipDescription": "Prvky vstupu představují komplexní informaci v kompaktní podobě, např. entitu (osobu, místo či věc) nebo text konverzace.",
"craneSleep9": "Lisabon, Portugalsko",
"craneEat10": "Lisabon, Portugalsko",
"demoCupertinoSegmentedControlDescription": "Slouží k výběru mezi možnostmi, které se vzájemně vylučují. Výběrem jedné možnosti segmentové kontroly zrušíte výběr ostatních možností.",
"chipTurnOnLights": "Zapnout osvětlení",
"chipSmall": "Malý",
"chipMedium": "Střední",
"chipLarge": "Velký",
"chipElevator": "Výtah",
"chipWasher": "Pračka",
"chipFireplace": "Krb",
"chipBiking": "Cyklistika",
"craneFormDiners": "Bary s občerstvením",
"rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{Zvyšte potenciální odečet z daní! Přiřaďte k 1 nezařazené transakci kategorie.}few{Zvyšte potenciální odečet z daní! Přiřaďte ke {count} nezařazeným transakcím kategorie.}many{Zvyšte potenciální odečet z daní! Přiřaďte k {count} nezařazené transakce kategorie.}other{Zvyšte potenciální odečet z daní! Přiřaďte k {count} nezařazeným transakcím kategorie.}}",
"craneFormTime": "Vyberte čas",
"craneFormLocation": "Vyberte místo",
"craneFormTravelers": "Cestovatelé",
"craneEat8": "Atlanta, USA",
"craneFormDestination": "Zvolte cíl",
"craneFormDates": "Zvolte data",
"craneFly": "LÉTÁNÍ",
"craneSleep": "SPÁNEK",
"craneEat": "JÍDLO",
"craneFlySubhead": "Objevte lety podle destinace",
"craneSleepSubhead": "Objevte ubytování podle destinace",
"craneEatSubhead": "Objevte restaurace podle destinace",
"craneFlyStops": "{numberOfStops,plural,=0{Bez mezipřistání}=1{1 mezipřistání}few{{numberOfStops} mezipřistání}many{{numberOfStops} mezipřistání}other{{numberOfStops} mezipřistání}}",
"craneSleepProperties": "{totalProperties,plural,=0{Žádné dostupné služby}=1{1 dostupná služba}few{{totalProperties} dostupné služby}many{{totalProperties} dostupné služby}other{{totalProperties} dostupných služeb}}",
"craneEatRestaurants": "{totalRestaurants,plural,=0{Žádné restaurace}=1{1 restaurace}few{{totalRestaurants} restaurace}many{{totalRestaurants} restaurace}other{{totalRestaurants} restaurací}}",
"craneFly0": "Aspen, USA",
"demoCupertinoSegmentedControlSubtitle": "Segmentová kontrola ve stylu iOS",
"craneSleep10": "Káhira, Egypt",
"craneEat9": "Madrid, Španělsko",
"craneFly1": "Big Sur, USA",
"craneEat7": "Nashville, USA",
"craneEat6": "Seattle, USA",
"craneFly8": "Singapur",
"craneEat4": "Paříž, Francie",
"craneEat3": "Portland, USA",
"craneEat2": "Córdoba, Argentina",
"craneEat1": "Dallas, USA",
"craneEat0": "Neapol, Itálie",
"craneSleep11": "Tchaj-pej, Tchaj-wan",
"craneSleep3": "Havana, Kuba",
"shrineLogoutButtonCaption": "ODHLÁSIT SE",
"rallyTitleBills": "FAKTURY",
"rallyTitleAccounts": "ÚČTY",
"shrineProductVagabondSack": "Batoh Vagabond",
"rallyAccountDetailDataInterestYtd": "Úrok od začátku roku do dnes",
"shrineProductWhitneyBelt": "Pásek Whitney",
"shrineProductGardenStrand": "Pás zahrady",
"shrineProductStrutEarrings": "Parádní náušnice",
"shrineProductVarsitySocks": "Ponožky s pruhem",
"shrineProductWeaveKeyring": "Pletená klíčenka",
"shrineProductGatsbyHat": "Bekovka",
"shrineProductShrugBag": "Taška na rameno",
"shrineProductGiltDeskTrio": "Trojice pozlacených stolků",
"shrineProductCopperWireRack": "Regál z měděného drátu",
"shrineProductSootheCeramicSet": "Uklidňující keramická sada",
"shrineProductHurrahsTeaSet": "Čajová sada Hurrahs",
"shrineProductBlueStoneMug": "Břidlicový hrnek",
"shrineProductRainwaterTray": "Kanálek na dešťovou vodu",
"shrineProductChambrayNapkins": "Kapesníky Chambray",
"shrineProductSucculentPlanters": "Květináče se sukulenty",
"shrineProductQuartetTable": "Stůl pro čtyři",
"shrineProductKitchenQuattro": "Kuchyňská čtyřka",
"shrineProductClaySweater": "Svetr barvy jílu",
"shrineProductSeaTunic": "Tunika barvy moře",
"shrineProductPlasterTunic": "Tělová tunika",
"rallyBudgetCategoryRestaurants": "Restaurace",
"shrineProductChambrayShirt": "Košile Chambray",
"shrineProductSeabreezeSweater": "Svetr jako mořský vánek",
"shrineProductGentryJacket": "Sako Gentry",
"shrineProductNavyTrousers": "Kalhoty barvy námořnické modři",
"shrineProductWalterHenleyWhite": "Triko s knoflíkovou légou Walter (bílé)",
"shrineProductSurfAndPerfShirt": "Funkční triko na surfování",
"shrineProductGingerScarf": "Zázvorová šála",
"shrineProductRamonaCrossover": "Crossover Ramona",
"shrineProductClassicWhiteCollar": "Klasický bílý límeček",
"shrineProductSunshirtDress": "Košilové šaty proti slunci",
"rallyAccountDetailDataInterestRate": "Úroková sazba",
"rallyAccountDetailDataAnnualPercentageYield": "Roční procentuální výtěžek",
"rallyAccountDataVacation": "Dovolená",
"shrineProductFineLinesTee": "Tričko s jemným proužkem",
"rallyAccountDataHomeSavings": "Úspory na domácnost",
"rallyAccountDataChecking": "Běžný",
"rallyAccountDetailDataInterestPaidLastYear": "Úrok zaplacený minulý rok",
"rallyAccountDetailDataNextStatement": "Další výpis",
"rallyAccountDetailDataAccountOwner": "Vlastník účtu",
"rallyBudgetCategoryCoffeeShops": "Kavárny",
"rallyBudgetCategoryGroceries": "Potraviny",
"shrineProductCeriseScallopTee": "Třešňové triko se zaobleným lemem",
"rallyBudgetCategoryClothing": "Oblečení",
"rallySettingsManageAccounts": "Spravovat účty",
"rallyAccountDataCarSavings": "Úspory na auto",
"rallySettingsTaxDocuments": "Daňové doklady",
"rallySettingsPasscodeAndTouchId": "Heslo a Touch ID",
"rallySettingsNotifications": "Oznámení",
"rallySettingsPersonalInformation": "Osobní údaje",
"rallySettingsPaperlessSettings": "Nastavení bezpapírového přístupu",
"rallySettingsFindAtms": "Najít bankomaty",
"rallySettingsHelp": "Nápověda",
"rallySettingsSignOut": "Odhlásit se",
"rallyAccountTotal": "Celkem",
"rallyBillsDue": "Splatnost",
"rallyBudgetLeft": "Zbývá",
"rallyAccounts": "Účty",
"rallyBills": "Faktury",
"rallyBudgets": "Rozpočty",
"rallyAlerts": "Upozornění",
"rallySeeAll": "ZOBRAZIT VŠE",
"rallyFinanceLeft": "ZBÝVÁ",
"rallyTitleOverview": "PŘEHLED",
"shrineProductShoulderRollsTee": "Tričko s odhalenými rameny",
"shrineNextButtonCaption": "DALŠÍ",
"rallyTitleBudgets": "ROZPOČTY",
"rallyTitleSettings": "NASTAVENÍ",
"rallyLoginLoginToRally": "Přihlášení do aplikace Rally",
"rallyLoginNoAccount": "Nemáte účet?",
"rallyLoginSignUp": "ZAREGISTROVAT SE",
"rallyLoginUsername": "Uživatelské jméno",
"rallyLoginPassword": "Heslo",
"rallyLoginLabelLogin": "Přihlásit se",
"rallyLoginRememberMe": "Zapamatovat si mě",
"rallyLoginButtonLogin": "PŘIHLÁSIT SE",
"rallyAlertsMessageHeadsUpShopping": "Pozor, už jste využili {percent} rozpočtu na nákupy na tento měsíc.",
"rallyAlertsMessageSpentOnRestaurants": "Tento týden jste utratili {amount} za restaurace.",
"rallyAlertsMessageATMFees": "Tento měsíc jste utratili {amount} za poplatky za bankomat",
"rallyAlertsMessageCheckingAccount": "Dobrá práce! Na běžném účtu máte o {percent} vyšší zůstatek než minulý měsíc.",
"shrineMenuCaption": "NABÍDKA",
"shrineCategoryNameAll": "VŠE",
"shrineCategoryNameAccessories": "DOPLŇKY",
"shrineCategoryNameClothing": "OBLEČENÍ",
"shrineCategoryNameHome": "DOMÁCNOST",
"shrineLoginUsernameLabel": "Uživatelské jméno",
"shrineLoginPasswordLabel": "Heslo",
"shrineCancelButtonCaption": "ZRUŠIT",
"shrineCartTaxCaption": "Daň:",
"shrineCartPageCaption": "KOŠÍK",
"shrineProductQuantity": "Počet: {quantity}",
"shrineProductPrice": "× {price}",
"shrineCartItemCount": "{quantity,plural,=0{ŽÁDNÉ POLOŽKY}=1{1 POLOŽKA}few{{quantity} POLOŽKY}many{{quantity} POLOŽKY}other{{quantity} POLOŽEK}}",
"shrineCartClearButtonCaption": "VYSYPAT KOŠÍK",
"shrineCartTotalCaption": "CELKEM",
"shrineCartSubtotalCaption": "Mezisoučet:",
"shrineCartShippingCaption": "Doprava:",
"shrineProductGreySlouchTank": "Volné šedé tílko",
"shrineProductStellaSunglasses": "Slunečná brýle Stella",
"shrineProductWhitePinstripeShirt": "Košile s úzkým bílým proužkem",
"demoTextFieldWhereCanWeReachYou": "Kde vás můžeme zastihnout?",
"settingsTextDirectionLTR": "Zleva doprava",
"settingsTextScalingLarge": "Velké",
"demoBottomSheetHeader": "Záhlaví",
"demoBottomSheetItem": "Položka {value}",
"demoBottomTextFieldsTitle": "Textová pole",
"demoTextFieldTitle": "Textová pole",
"demoTextFieldSubtitle": "Jeden řádek s upravitelným textem a čísly",
"demoTextFieldDescription": "Textová pole uživatelům umožňují zadat do uživatelského rozhraní text. Obvykle se vyskytují ve formulářích a dialogových oknech.",
"demoTextFieldShowPasswordLabel": "Zobrazit heslo",
"demoTextFieldHidePasswordLabel": "Skrýt heslo",
"demoTextFieldFormErrors": "Před odesláním formuláře opravte červeně zvýrazněné chyby.",
"demoTextFieldNameRequired": "Jméno je povinné.",
"demoTextFieldOnlyAlphabeticalChars": "Zadejte jen písmena abecedy.",
"demoTextFieldEnterUSPhoneNumber": "(###) ###-#### – Zadejte telefonní číslo do USA.",
"demoTextFieldEnterPassword": "Zadejte heslo.",
"demoTextFieldPasswordsDoNotMatch": "Hesla se neshodují",
"demoTextFieldWhatDoPeopleCallYou": "Jak vám lidé říkají?",
"demoTextFieldNameField": "Jméno*",
"demoBottomSheetButtonText": "ZOBRAZIT SPODNÍ TABULKU",
"demoTextFieldPhoneNumber": "Telefonní číslo*",
"demoBottomSheetTitle": "Spodní tabulka",
"demoTextFieldEmail": "E-mail",
"demoTextFieldTellUsAboutYourself": "Řekněte nám něco o sobě (např. napište, co děláte nebo jaké máte koníčky)",
"demoTextFieldKeepItShort": "Buďte struční, je to jen ukázka.",
"starterAppGenericButton": "TLAČÍTKO",
"demoTextFieldLifeStory": "Životní příběh",
"demoTextFieldSalary": "Plat",
"demoTextFieldUSD": "USD",
"demoTextFieldNoMoreThan": "Maximálně osm znaků.",
"demoTextFieldPassword": "Heslo*",
"demoTextFieldRetypePassword": "Zadejte heslo znovu*",
"demoTextFieldSubmit": "ODESLAT",
"demoBottomNavigationSubtitle": "Spodní navigace s prolínajícím zobrazením",
"demoBottomSheetAddLabel": "Přidat",
"demoBottomSheetModalDescription": "Modální spodní tabulka je alternativou k nabídce nebo dialogovému oknu a zabraňuje uživateli v interakci se zbytkem aplikace.",
"demoBottomSheetModalTitle": "Modální spodní tabulka",
"demoBottomSheetPersistentDescription": "Stálá spodní tabulka zobrazuje informace, které doplňují primární obsah aplikace. Stálá spodní tabulka zůstává viditelná i při interakci uživatele s ostatními částmi aplikace.",
"demoBottomSheetPersistentTitle": "Trvalá spodní tabulka",
"demoBottomSheetSubtitle": "Trvalé a modální spodní tabulky",
"demoTextFieldNameHasPhoneNumber": "{name} má telefonní číslo {phoneNumber}",
"buttonText": "TLAČÍTKO",
"demoTypographyDescription": "Definice různých typografických stylů, které se vyskytují ve vzhledu Material Design.",
"demoTypographySubtitle": "Všechny předdefinované styly textu",
"demoTypographyTitle": "Typografie",
"demoFullscreenDialogDescription": "Hodnota fullscreenDialog určuje, zda následující stránka bude mít podobu modálního dialogového okna na celou obrazovku",
"demoFlatButtonDescription": "Ploché tlačítko při stisknutí zobrazí inkoustovou kaňku, ale nezvedne se. Plochá tlačítka používejte na lištách, v dialogových oknech a v textu s odsazením",
"demoBottomNavigationDescription": "Spodní navigační panely zobrazují ve spodní části obrazovky tři až pět cílů. Každý cíl zastupuje ikona a volitelný textový štítek. Po klepnutí na spodní navigační ikonu je uživatel přenesen na nejvyšší úroveň cíle navigace, který je k dané ikoně přidružen.",
"demoBottomNavigationSelectedLabel": "Vybraný štítek",
"demoBottomNavigationPersistentLabels": "Trvale zobrazené štítky",
"starterAppDrawerItem": "Položka {value}",
"demoTextFieldRequiredField": "Hvězdička (*) označuje povinné pole",
"demoBottomNavigationTitle": "Spodní navigace",
"settingsLightTheme": "Světlý",
"settingsTheme": "Motiv",
"settingsPlatformIOS": "iOS",
"settingsPlatformAndroid": "Android",
"settingsTextDirectionRTL": "Zprava doleva",
"settingsTextScalingHuge": "Velmi velké",
"cupertinoButton": "Tlačítko",
"settingsTextScalingNormal": "Normální",
"settingsTextScalingSmall": "Malé",
"settingsSystemDefault": "Systém",
"settingsTitle": "Nastavení",
"rallyDescription": "Aplikace pro osobní finance",
"aboutDialogDescription": "Chcete-li zobrazit zdrojový kód této aplikace, přejděte na {repoLink}.",
"bottomNavigationCommentsTab": "Komentáře",
"starterAppGenericBody": "Text",
"starterAppGenericHeadline": "Nadpis",
"starterAppGenericSubtitle": "Podtitul",
"starterAppGenericTitle": "Název",
"starterAppTooltipSearch": "Hledat",
"starterAppTooltipShare": "Sdílet",
"starterAppTooltipFavorite": "Oblíbené",
"starterAppTooltipAdd": "Přidat",
"bottomNavigationCalendarTab": "Kalendář",
"starterAppDescription": "Responzivní rozvržení úvodní aplikace",
"starterAppTitle": "Úvodní aplikace",
"aboutFlutterSamplesRepo": "Ukázky pro Flutter v repozitáři GitHub",
"bottomNavigationContentPlaceholder": "Zástupný symbol karty {title}",
"bottomNavigationCameraTab": "Fotoaparát",
"bottomNavigationAlarmTab": "Upozornění",
"bottomNavigationAccountTab": "Účet",
"demoTextFieldYourEmailAddress": "Vaše e-mailová adresa",
"demoToggleButtonDescription": "Přepínače lze použít k seskupení souvisejících možností. Chcete-li zvýraznit skupiny souvisejících přepínačů, umístěte skupinu do stejného kontejneru",
"colorsGrey": "ŠEDÁ",
"colorsBrown": "HNĚDÁ",
"colorsDeepOrange": "TMAVĚ ORANŽOVÁ",
"colorsOrange": "ORANŽOVÁ",
"colorsAmber": "JANTAROVÁ",
"colorsYellow": "ŽLUTÁ",
"colorsLime": "LIMETKOVÁ",
"colorsLightGreen": "SVĚTLE ZELENÁ",
"colorsGreen": "ZELENÁ",
"homeHeaderGallery": "Galerie",
"homeHeaderCategories": "Kategorie",
"shrineDescription": "Elegantní maloobchodní aplikace",
"craneDescription": "Personalizovaná cestovní aplikace",
"homeCategoryReference": "STYLY A DALŠÍ",
"demoInvalidURL": "Adresu URL nelze zobrazit:",
"demoOptionsTooltip": "Možnosti",
"demoInfoTooltip": "Informace",
"demoCodeTooltip": "Ukázkový kód",
"demoDocumentationTooltip": "Dokumentace API",
"demoFullscreenTooltip": "Celá obrazovka",
"settingsTextScaling": "Zvětšení/zmenšení textu",
"settingsTextDirection": "Směr textu",
"settingsLocale": "Národní prostředí",
"settingsPlatformMechanics": "Mechanika platformy",
"settingsDarkTheme": "Tmavý",
"settingsSlowMotion": "Zpomalení",
"settingsAbout": "Informace o aplikaci Flutter Gallery",
"settingsFeedback": "Odeslat zpětnou vazbu",
"settingsAttribution": "Design: TOASTER, Londýn",
"demoButtonTitle": "Tlačítka",
"demoButtonSubtitle": "Textová, zvýšená, obrysová a další tlačítka",
"demoFlatButtonTitle": "Ploché tlačítko",
"demoRaisedButtonDescription": "Zvýšená tlačítka vnášejí rozměr do převážně plochých rozvržení. Upozorňují na funkce v místech, která jsou hodně navštěvovaná nebo rozsáhlá.",
"demoRaisedButtonTitle": "Zvýšené tlačítko",
"demoOutlineButtonTitle": "Obrysové tlačítko",
"demoOutlineButtonDescription": "Obrysová tlačítka se při stisknutí zdvihnou a zneprůhlední. Obvykle se vyskytují v páru se zvýšenými tlačítky za účelem označení alternativní, sekundární akce.",
"demoToggleButtonTitle": "Přepínače",
"colorsTeal": "ŠEDOZELENÁ",
"demoFloatingButtonTitle": "Plovoucí tlačítko akce",
"demoFloatingButtonDescription": "Plovoucí tlačítko akce je kruhové tlačítko akce, které se vznáší nad obsahem za účelem upozornění na hlavní akci v aplikaci.",
"demoDialogTitle": "Dialogová okna",
"demoDialogSubtitle": "Jednoduché, s upozorněním a na celou obrazovku",
"demoAlertDialogTitle": "Upozornění",
"demoAlertDialogDescription": "Dialogové okno s upozorněním uživatele informuje o situacích, které vyžadují pozornost. Dialogové okno s upozorněním má volitelný název a volitelný seznam akcí.",
"demoAlertTitleDialogTitle": "Upozornění s názvem",
"demoSimpleDialogTitle": "Jednoduché",
"demoSimpleDialogDescription": "Jednoduché dialogové okno nabízí uživateli na výběr mezi několika možnostmi. Jednoduché dialogové okno má volitelný název, který je zobrazen nad možnostmi.",
"demoFullscreenDialogTitle": "Celá obrazovka",
"demoCupertinoButtonsTitle": "Tlačítka",
"demoCupertinoButtonsSubtitle": "Tlačítka ve stylu iOS",
"demoCupertinoButtonsDescription": "Tlačítko ve stylu systému iOS. Jedná se o text nebo ikonu, která při dotyku postupně zmizí nebo se objeví. Volitelně může mít i pozadí.",
"demoCupertinoAlertsTitle": "Upozornění",
"demoCupertinoAlertsSubtitle": "Dialogová okna s upozorněním ve stylu iOS",
"demoCupertinoAlertTitle": "Upozornění",
"demoCupertinoAlertDescription": "Dialogové okno s upozorněním uživatele informuje o situacích, které vyžadují pozornost. Dialogové okno s upozorněním má volitelný název, volitelný obsah a volitelný seznam akcí. Název je zobrazen nad obsahem a akce jsou zobrazeny pod obsahem.",
"demoCupertinoAlertWithTitleTitle": "Upozornění s názvem",
"demoCupertinoAlertButtonsTitle": "Upozornění s tlačítky",
"demoCupertinoAlertButtonsOnlyTitle": "Pouze tlačítka s upozorněním",
"demoCupertinoActionSheetTitle": "List akcí",
"demoCupertinoActionSheetDescription": "List akcí je zvláštní typ upozornění, které uživateli předkládá sadu dvou či více možností souvisejících se stávající situací. List akcí může obsahovat název, další zprávu a seznam akcí.",
"demoColorsTitle": "Barvy",
"demoColorsSubtitle": "Všechny předdefinované barvy",
"demoColorsDescription": "Konstanty barvy a vzorníku barev, které představují barevnou škálu vzhledu Material Design.",
"buttonTextEnabled": "ENABLED",
"buttonTextDisabled": "DISABLED",
"buttonTextCreate": "Vytvořit",
"dialogSelectedOption": "Vybrali jste: „{value}“",
"dialogDiscardTitle": "Zahodit koncept?",
"dialogLocationTitle": "Chcete používat službu určování polohy Google?",
"dialogLocationDescription": "Povolte, aby Google mohl aplikacím pomáhat s určováním polohy. To znamená, že budete do Googlu odesílat anonymní údaje o poloze, i když nebudou spuštěny žádné aplikace.",
"dialogCancel": "ZRUŠIT",
"dialogDiscard": "ZAHODIT",
"dialogDisagree": "NESOUHLASÍM",
"dialogAgree": "SOUHLASÍM",
"dialogSetBackup": "Nastavit záložní účet",
"colorsBlueGrey": "ŠEDOMODRÁ",
"dialogShow": "ZOBRAZIT DIALOGOVÉ OKNO",
"dialogFullscreenTitle": "Dialogové okno na celou obrazovku",
"dialogFullscreenSave": "ULOŽIT",
"dialogFullscreenDescription": "Ukázka dialogového okna na celou obrazovku",
"cupertinoButtonEnabled": "Enabled",
"cupertinoButtonDisabled": "Disabled",
"cupertinoButtonWithBackground": "S pozadím",
"cupertinoAlertCancel": "Zrušit",
"cupertinoAlertDiscard": "Zahodit",
"cupertinoAlertLocationTitle": "Povolit Mapám přístup k poloze, když budete aplikaci používat?",
"cupertinoAlertLocationDescription": "Vaše aktuální poloha se bude zobrazovat na mapě a bude sloužit k zobrazení tras, výsledků vyhledávání v okolí a odhadovaných časů cesty.",
"cupertinoAlertAllow": "Povolit",
"cupertinoAlertDontAllow": "Nepovolovat",
"cupertinoAlertFavoriteDessert": "Vyberte oblíbený zákusek",
"cupertinoAlertDessertDescription": "Ze seznamu níže vyberte svůj oblíbený zákusek. Na základě výběru vám přizpůsobíme navrhovaný seznam stravovacích zařízení ve vašem okolí.",
"cupertinoAlertCheesecake": "Cheesecake",
"cupertinoAlertTiramisu": "Tiramisu",
"cupertinoAlertApplePie": "Jablečný koláč",
"cupertinoAlertChocolateBrownie": "Čokoládové brownie",
"cupertinoShowAlert": "Zobrazit upozornění",
"colorsRed": "ČERVENÁ",
"colorsPink": "RŮŽOVÁ",
"colorsPurple": "NACHOVÁ",
"colorsDeepPurple": "TMAVĚ NACHOVÁ",
"colorsIndigo": "INDIGOVÁ",
"colorsBlue": "MODRÁ",
"colorsLightBlue": "SVĚTLE MODRÁ",
"colorsCyan": "AZUROVÁ",
"dialogAddAccount": "Přidat účet",
"Gallery": "Galerie",
"Categories": "Kategorie",
"SHRINE": "SHRINE",
"Basic shopping app": "Základní aplikace pro nakupování",
"RALLY": "RALLY",
"CRANE": "CRANE",
"Travel app": "Cestovní aplikace",
"MATERIAL": "MATERIAL",
"CUPERTINO": "CUPERTINO",
"REFERENCE STYLES & MEDIA": "REFERENČNÍ STYLY A MÉDIA"
}
| gallery/lib/l10n/intl_cs.arb/0 | {
"file_path": "gallery/lib/l10n/intl_cs.arb",
"repo_id": "gallery",
"token_count": 23308
} | 840 |
{
"loading": "લોડ થઈ રહ્યું છે",
"deselect": "નાપસંદ કરો",
"select": "પસંદ કરો",
"selectable": "પસંદ કરવા યોગ્ય (થોડીવાર દબાવી રાખો)",
"selected": "પસંદ કરી",
"demo": "ડેમો",
"bottomAppBar": "ઍપનો સૌથી નીચેનો બાર",
"notSelected": "પસંદ કરી નથી",
"demoCupertinoSearchTextFieldTitle": "શોધ ટેક્સ્ટનું ફીલ્ડ",
"demoCupertinoPicker": "પિકર",
"demoCupertinoSearchTextFieldSubtitle": "iOS-શૈલીનું શોધ ટેક્સ્ટનું ફીલ્ડ",
"demoCupertinoSearchTextFieldDescription": "શોધ ટેક્સ્ટનું ફીલ્ડ કે જે વપરાશકર્તાને ટેક્સ્ટ દાખલ કરીને શોધ કરવા દે છે, અને તે સૂચનો ઑફર તથા ફિલ્ટર કરી શકે છે.",
"demoCupertinoSearchTextFieldPlaceholder": "અમુક ટેક્સ્ટ દાખલ કરો",
"demoCupertinoScrollbarTitle": "સ્ક્રોલ બાર",
"demoCupertinoScrollbarSubtitle": "iOS-શૈલીનું સ્ક્રોલ બાર",
"demoCupertinoScrollbarDescription": "આપેલા ચાઇલ્ડને આવરી લેતું સ્ક્રોલ બાર",
"demoTwoPaneItem": "આઇટમ {value}",
"demoTwoPaneList": "સૂચિ",
"demoTwoPaneFoldableLabel": "ફોલ્ડ કરી શકાય એવું",
"demoTwoPaneSmallScreenLabel": "નાની સ્ક્રીન",
"demoTwoPaneSmallScreenDescription": "નાની સ્ક્રીનવાળા ડિવાઇસ પર TwoPane આ રીતે કામ કરે છે.",
"demoTwoPaneTabletLabel": "ટૅબ્લેટ / ડેસ્કટૉપ",
"demoTwoPaneTabletDescription": "ટૅબ્લેટ અથવા ડેસ્કટૉપ જેવા ડિવાઇસ પર TwoPane આ રીતે કામ કરે છે.",
"demoTwoPaneTitle": "TwoPane",
"demoTwoPaneSubtitle": "ફોલ્ડ કરી શકાય તેવી, મોટી અને નાની સ્ક્રીન પર રિસ્પૉન્સિવ લેઆઉટ",
"splashSelectDemo": "ડેમો પસંદ કરો",
"demoTwoPaneFoldableDescription": "ફોલ્ડ કરી શકાય તેવા ડિવાઇસ પર TwoPane આ રીતે કામ કરે છે.",
"demoTwoPaneDetails": "વિગતો",
"demoTwoPaneSelectItem": "આઇટમ પસંદ કરો",
"demoTwoPaneItemDetails": "આઇટમ {value}ની વિગતો",
"demoCupertinoContextMenuActionText": "સંદર્ભ મેનૂ જોવા માટે, ફ્લટર લોગો પર ટૅપ કરીને દબાવી રાખો.",
"demoCupertinoContextMenuDescription": "જ્યારે કોઈ ઘટકને થોડીવાર દબાવી રાખવામાં આવે, ત્યારે iOS-શૈલીની પૂર્ણ સ્ક્રીનનું કોઈ સાંદર્ભિક મેનૂ દેખાય છે.",
"demoAppBarTitle": "ઍપ બાર",
"demoAppBarDescription": "ઍપ બાર હાલની સ્ક્રીન સંબંધિત કન્ટેન્ટ અને ક્રિયાઓ પ્રદાન કરે છે. તેનો ઉપયોગ બ્રાંડિંગ, સ્ક્રીનના શીર્ષકો, નૅવિગેશન અને ક્રિયાઓ માટે થાય છે",
"demoDividerTitle": "વિભાજક",
"demoDividerSubtitle": "વિભાજક એ કોઈ પાતળી લાઇન છે કે જે સૂચિ અને લેઆઉટમાં કન્ટેન્ટનું ગ્રૂપ બનાવે છે.",
"demoDividerDescription": "કન્ટેન્ટને અલગ કરવા માટે, વિભાજકોનો ઉપયોગ સૂચિઓ, ડ્રોઅર અને કોઈ બીજી જગ્યામાં કરી શકાય છે.",
"demoVerticalDividerTitle": "ઊભું વિભાજક",
"demoCupertinoContextMenuTitle": "સંદર્ભ મેનૂ",
"demoCupertinoContextMenuSubtitle": "iOS-શૈલીનું સંદર્ભ મેનૂ",
"demoAppBarSubtitle": "હાલની સ્ક્રીન સંબંધિત માહિતી અને ક્રિયાઓ બતાવે છે",
"demoCupertinoContextMenuActionOne": "ક્રિયા એક",
"demoCupertinoContextMenuActionTwo": "ક્રિયા બે",
"demoDateRangePickerDescription": "મટિરિયલ ડિઝાઇનની તારીખની શ્રેણીનું પિકર ધરાવતો કોઈ સંવાદ બતાવે છે.",
"demoDateRangePickerTitle": "તારીખની શ્રેણીનું પિકર",
"demoNavigationDrawerUserName": "વપરાશકર્તાનું નામ",
"demoNavigationDrawerUserEmail": "[email protected]",
"demoNavigationDrawerText": "ડ્રોઅર જોવા માટે કિનારી પરથી સ્વાઇપ કરો અથવા ઉપર ડાબી બાજુના આઇકન પર ટૅપ કરો",
"demoNavigationRailTitle": "નૅવિગેશન રેલ",
"demoNavigationRailSubtitle": "ઍપની અંદર નૅવિગેશન રેલ બતાવે છે",
"demoNavigationRailDescription": "એક મટિરિયલ વિજેટ જેને અમુક વ્યૂની વચ્ચે નૅવિગેટ કરવા માટે, ઍપની ડાબી કે જમણી બાજુએ બતાવવામાં આવે છે, સામાન્ય રીતે ત્રણ અને પાંચની વચ્ચેના વ્યૂ.",
"demoNavigationRailFirst": "પહેલું",
"demoNavigationDrawerTitle": "નૅવિગેશન ડ્રોઅર",
"demoNavigationRailThird": "ત્રીજું",
"replyStarredLabel": "તારાંકિત",
"demoTextButtonDescription": "ટેક્સ્ટ બટન દબાવવા પર ઇંક સ્પ્લૅશ બતાવે છે પરંતુ તે ઉપસી આવતું નથી. ટૂલબાર પર, સંવાદમાં અને પૅડિંગની સાથે ઇનલાઇનમાં ટેક્સ્ટ બટનનો ઉપયોગ કરો",
"demoElevatedButtonTitle": "ઉપર ચડાવેલું બટન",
"demoElevatedButtonDescription": "ઉપર ચડાવેલા બટન મોટાભાગના સમતલ લેઆઉટ પર પરિમાણ ઉમેરે છે. તે વ્યસ્ત અથવા વ્યાપક સ્થાનો પર ફંક્શન પર ભાર આપે છે.",
"demoOutlinedButtonTitle": "આઉટલાઇન બટન",
"demoOutlinedButtonDescription": "આઉટલાઇન બટન દબાવવા પર અપારદર્શી બને છે અને તે ઉપસી આવે છે. વૈકલ્પિક, ગૌણ ક્રિયા બતાવવા માટે અવારનવાર ઉપસેલા બટન સાથે તેનું જોડાણ બનાવવામાં આવે છે.",
"demoContainerTransformDemoInstructions": "કાર્ડ, સૂચિઓ, અને FAB",
"demoNavigationDrawerSubtitle": "ઍપ બારની અંદર ડ્રોઅર બતાવે છે",
"replyDescription": "એક અસરકારક, વિશેષ રૂપે કેન્દ્રિત ઇમેઇલ ઍપ",
"demoNavigationDrawerDescription": "એક મટિરિયલ ડિઝાઇનની પૅનલ, જે ઍપ્લિકેશનમાં નૅવિગેશનની લિંક બતાવવા માટે, સ્ક્રીનની કિનારી પરથી આડી રીતે સ્લાઇડ થઈને આવે છે.",
"replyDraftsLabel": "ડ્રાફ્ટ",
"demoNavigationDrawerToPageOne": "આઇટમ એક",
"replyInboxLabel": "ઇનબૉકસ",
"demoSharedXAxisDemoInstructions": "આગળ અને પાછળ બટન",
"replySpamLabel": "સ્પામ",
"replyTrashLabel": "ટ્રેશ",
"replySentLabel": "મોકલેલા",
"demoNavigationRailSecond": "બીજું",
"demoNavigationDrawerToPageTwo": "આઇટમ બે",
"demoFadeScaleDemoInstructions": "મોડલ અને FAB",
"demoFadeThroughDemoInstructions": "બોટમ નૅવિગેશન",
"demoSharedZAxisDemoInstructions": "સેટિંગ આઇકનનું બટન",
"demoSharedYAxisDemoInstructions": "\"તાજેતરમાં ચલાવેલા\" અનુસાર સૉર્ટ કરો",
"demoTextButtonTitle": "ટેક્સ્ટ બટન",
"demoSharedZAxisBeefSandwichRecipeTitle": "બીફ સૅન્ડવિચ",
"demoSharedZAxisDessertRecipeDescription": "ડેઝર્ટની રૅસિપિ",
"demoSharedYAxisAlbumTileSubtitle": "કલાકાર",
"demoSharedYAxisAlbumTileTitle": "આલ્બમ",
"demoSharedYAxisRecentSortTitle": "તાજેતરમાં ચલાવેલા",
"demoSharedYAxisAlphabeticalSortTitle": "A-Z",
"demoSharedYAxisAlbumCount": "268 આલ્બમ",
"demoSharedYAxisTitle": "શેર કરેલા y-અક્ષ",
"demoSharedXAxisCreateAccountButtonText": "એકાઉન્ટ બનાવો",
"demoFadeScaleAlertDialogDiscardButton": "કાઢી નાખો",
"demoSharedXAxisSignInTextFieldLabel": "ઇમેઇલ અથવા ફોન નંબર",
"demoSharedXAxisSignInSubtitleText": "તમારા એકાઉન્ટથી સાઇન ઇન કરો",
"demoSharedXAxisSignInWelcomeText": "નમસ્તે David Park",
"demoSharedXAxisIndividualCourseSubtitle": "વ્યક્તિગત રીતે બતાવેલ",
"demoSharedXAxisBundledCourseSubtitle": "બંડલ કરેલા",
"demoFadeThroughAlbumsDestination": "આલ્બમ",
"demoSharedXAxisDesignCourseTitle": "ડિઝાઇન",
"demoSharedXAxisIllustrationCourseTitle": "ઉદાહરણ",
"demoSharedXAxisBusinessCourseTitle": "વ્યવસાય",
"demoSharedXAxisArtsAndCraftsCourseTitle": "કળા અને હસ્તકળા",
"demoMotionPlaceholderSubtitle": "ગૌણ ટેક્સ્ટ",
"demoFadeScaleAlertDialogCancelButton": "રદ કરો",
"demoFadeScaleAlertDialogHeader": "ચેતવણી સંવાદ",
"demoFadeScaleHideFabButton": "ફેબ છુપાવો",
"demoFadeScaleShowFabButton": "ફેબ બતાવો",
"demoFadeScaleShowAlertDialogButton": "મોડલ બતાવો",
"demoFadeScaleDescription": "ફેડ પૅટર્નનો ઉપયોગ તેવા UI ઘટકો માટે થાય છે કે જે સ્ક્રીનની સીમામાં અંદર જાય છે અથવા બહાર નીકળે છે, જેમ કે એક સંવાદ જે સ્ક્રીનના કેંદ્રમાં ફેડ થાય છે.",
"demoFadeScaleTitle": "ઝાંખો",
"demoFadeThroughTextPlaceholder": "123 ફોટા",
"demoFadeThroughSearchDestination": "શોધો",
"demoFadeThroughPhotosDestination": "ફોટા",
"demoSharedXAxisCoursePageSubtitle": "બંડલ બનાવેલી કૅટેગરી તમારા ફીડમાં ગ્રૂપ તરીકે દેખાય છે. તમે આને પછીથી ગમે-ત્યારે બદલી શકો છો.",
"demoFadeThroughDescription": "ફેડ થ્રૂ પૅટર્નનો ઉપયોગ તેવા UI ઘટકોની વચ્ચે ટ્રાંઝિશન માટે થાય છે કે જેનો એકબીજાની સાથે મજબૂત સંબંધ હોતો નથી.",
"demoFadeThroughTitle": "ફેડ થ્રૂ",
"demoSharedZAxisHelpSettingLabel": "સહાય",
"demoMotionSubtitle": "પૂર્વવ્યાખ્યાયિત ટ્રાંઝિશનની બધી જ પૅટર્ન",
"demoSharedZAxisNotificationSettingLabel": "નોટિફિકેશન",
"demoSharedZAxisProfileSettingLabel": "પ્રોફાઇલ",
"demoSharedZAxisSavedRecipesListTitle": "સાચવેલી રૅસિપિ",
"demoSharedZAxisBeefSandwichRecipeDescription": "બીફ સૅન્ડવિચની રૅસિપિ",
"demoSharedZAxisCrabPlateRecipeDescription": "કરચલાની રૅસિપિ",
"demoSharedXAxisCoursePageTitle": "તમારા કોર્સને સુવ્યવસ્થિત કરો",
"demoSharedZAxisCrabPlateRecipeTitle": "કરચલા",
"demoSharedZAxisShrimpPlateRecipeDescription": "ઝીંગાની રૅસિપિ",
"demoSharedZAxisShrimpPlateRecipeTitle": "ઝીંગા",
"demoContainerTransformTypeFadeThrough": "ફેડ થ્રૂ",
"demoSharedZAxisDessertRecipeTitle": "ડેઝર્ટ",
"demoSharedZAxisSandwichRecipeDescription": "સૅન્ડવિચની રૅસિપિ",
"demoSharedZAxisSandwichRecipeTitle": "સૅન્ડવિચ",
"demoSharedZAxisBurgerRecipeDescription": "બર્ગરની રૅસિપિ",
"demoSharedZAxisBurgerRecipeTitle": "બર્ગર",
"demoSharedZAxisSettingsPageTitle": "સેટિંગ",
"demoSharedZAxisTitle": "શેર કરેલા z-અક્ષ",
"demoSharedZAxisPrivacySettingLabel": "પ્રાઇવસી",
"demoMotionTitle": "મોશન",
"demoContainerTransformTitle": "કન્ટેનર ટ્રાંસ્ફોર્મ",
"demoContainerTransformDescription": "કન્ટેનર ટ્રાંસ્ફોર્મ પૅટર્નની રચના કન્ટેનર સમાવતા UI ઘટકોની વચ્ચે ટ્રાંઝિશન માટે થઈ છે. આ પૅટર્ન બે UI ઘટકોની વચ્ચે એક દેખાતું કનેક્શન બનાવે છે",
"demoContainerTransformModalBottomSheetTitle": "ઝાંખો મોડ",
"demoContainerTransformTypeFade": "ઝાંખો",
"demoSharedYAxisAlbumTileDurationUnit": "મિનિટ",
"demoMotionPlaceholderTitle": "શીર્ષક",
"demoSharedXAxisForgotEmailButtonText": "ઇમેઇલ ભૂલી ગયાં છો?",
"demoMotionSmallPlaceholderSubtitle": "ગૌણ",
"demoMotionDetailsPageTitle": "વિગતોનું પેજ",
"demoMotionListTileTitle": "સૂચિ આઇટમ",
"demoSharedAxisDescription": "શેર કરેલી અક્ષ પૅટર્નનો ઉપયોગ તેવા UI ઘટકોની વચ્ચે ટ્રાંઝિશન માટે થાય છે કે જેનો અંતર સંબંધી અથવા નૅવિગેશન સંબંધી સંબંધ હોય છે. આ પૅટર્ન ઘટકોની વચ્ચેના સંબંધને વધુ મજબૂત બનાવવા માટે x, y અથવા z અક્ષ પરના શેર કરેલા ટ્રાંસ્ફોર્મેશનનો ઉપયોગ કરે છે.",
"demoSharedXAxisTitle": "શેર કરેલા x-અક્ષ",
"demoSharedXAxisBackButtonText": "પાછળ",
"demoSharedXAxisNextButtonText": "આગળ",
"demoSharedXAxisCulinaryCourseTitle": "રસોઈ",
"githubRepo": "{repoName} GitHub ડેટા સ્ટોરેજ સ્થાન",
"fortnightlyMenuUS": "યુએસ",
"fortnightlyMenuBusiness": "વ્યવસાય",
"fortnightlyMenuScience": "વિજ્ઞાન",
"fortnightlyMenuSports": "રમતગમત",
"fortnightlyMenuTravel": "મુસાફરી",
"fortnightlyMenuCulture": "સંસ્કૃતિ",
"fortnightlyTrendingTechDesign": "TechDesign",
"rallyBudgetDetailAmountLeft": "બાકી રહેલી રકમ",
"fortnightlyHeadlineArmy": "પર્યાવરણની રક્ષકોના સંગાથે",
"fortnightlyDescription": "કન્ટેન્ટ પર ફોકસ રાખતી સમાચાર ઍપ",
"rallyBillDetailAmountDue": "ચુકવવાની રકમ",
"rallyBudgetDetailTotalCap": "કુલ બજેટ",
"rallyBudgetDetailAmountUsed": "વપરાયેલી રકમ",
"fortnightlyTrendingHealthcareRevolution": "HealthcareRevolution",
"fortnightlyMenuFrontPage": "ફ્રન્ટ પેજ",
"fortnightlyMenuWorld": "વિશ્વ",
"rallyBillDetailAmountPaid": "ચુકવેલી રકમ",
"fortnightlyMenuPolitics": "રાજકારણ",
"fortnightlyHeadlineBees": "ક્યાં છે મધમાખીઓ!",
"fortnightlyHeadlineGasoline": "પેટ્રોલનું ભવિતવ્ય",
"fortnightlyTrendingGreenArmy": "GreenArmy",
"fortnightlyHeadlineFeminists": "છેડાઈ ગયો જંગ નારીવાદીઓ અને પક્ષપાતીઓ વચ્ચે",
"fortnightlyHeadlineFabrics": "ભવિષ્યના વસ્ત્રો માટે ડિઝાઇનરોએ લીધો ટેકનો સહારો",
"fortnightlyHeadlineStocks": "સ્ટૉકમાં સ્થિરતા પછી લોકોનો ચલણ તરફી ઝુકાવ",
"fortnightlyTrendingReform": "Reform",
"fortnightlyMenuTech": "ટૅક",
"fortnightlyHeadlineWar": "યુદ્ધે અમેરિકન લોકોને બે પક્ષમાં વહેંચી દીધા",
"fortnightlyHeadlineHealthcare": "આરોગ્યસંભાળની સશક્ત ક્રાંતિ, તે પણ કશા શોરબકોર વિના",
"fortnightlyLatestUpdates": "તાજેતરના અપડેટ",
"fortnightlyTrendingStocks": "Stocks",
"rallyBillDetailTotalAmount": "કુલ રકમ",
"demoCupertinoPickerDateTime": "તારીખ અને સમય",
"signIn": "સાઇન ઇન કરો",
"dataTableRowWithSugar": "ખાંડની સાથે {value}",
"dataTableRowApplePie": "એપલ પાઇ",
"dataTableRowDonut": "ડૉનટ",
"dataTableRowHoneycomb": "હનીકોમ્બ",
"dataTableRowLollipop": "લૉલીપૉપ",
"dataTableRowJellyBean": "જેલીબિન",
"dataTableRowGingerbread": "જિંજરબ્રેડ",
"dataTableRowCupcake": "કપકેક",
"dataTableRowEclair": "ઇક્લેર",
"dataTableRowIceCreamSandwich": "આઇસક્રીમ સેન્ડવિચ",
"dataTableRowFrozenYogurt": "ફ્રોઝન યોગર્ટ",
"dataTableColumnIron": "આયર્ન (%)",
"dataTableColumnCalcium": "કૅલ્શિયમ (%)",
"dataTableColumnSodium": "સોડિયમ (મિલિગ્રા)",
"demoTimePickerTitle": "સમય પિકર",
"demo2dTransformationsResetTooltip": "રૂપાંતરણો રીસેટ કરો",
"dataTableColumnFat": "ચરબી (ગ્રા)",
"dataTableColumnCalories": "કૅલરી",
"dataTableColumnDessert": "ડેઝર્ટ (નંગ 1)",
"cardsDemoTravelDestinationLocation1": "તંજાવુર, તમિળનાડુ",
"demoTimePickerDescription": "સામગ્રીની ડિઝાઇનવાળા સમય પિકરને સમાવતો સંવાદ બતાવે છે.",
"demoPickersShowPicker": "પિકર બતાવો",
"demoTabsScrollingTitle": "સ્ક્રોલ થાય તેવું",
"demoTabsNonScrollingTitle": "સ્ક્રોલ ન થાય તેવું",
"craneHours": "{hours,plural,=1{1 કલાક}other{{hours} કલાક}}",
"craneMinutes": "{minutes,plural,=1{1 મિનિટ}other{{minutes} મિનિટ}}",
"craneFlightDuration": "{hoursShortForm} {minutesShortForm}",
"dataTableHeader": "પોષણ",
"demoDatePickerTitle": "તારીખ પિકર",
"demoPickersSubtitle": "તારીખ અને સમયની પસંદગી",
"demoPickersTitle": "પિકર",
"demo2dTransformationsEditTooltip": "ટાઇલમાં ફેરફાર કરો",
"demoDataTableDescription": "ડેટા ટેબલ પંક્તિઓ અને કૉલમના ગ્રિડ જેવા ફૉર્મેટમાં માહિતી બતાવે છે. તે માહિતીને એવી રીતે ગોઠવે છે કે જેનાથી સ્કૅન કરવાનું સરળ બની રહે છે, જેથી વપરાશકર્તાઓ પૅટર્ન અને જાણકારી શોધી શકે.",
"demo2dTransformationsDescription": "ટાઇલમાં ફેરફાર કરવા માટે ટૅપ કરો અને દૃશ્યની આસપાસ ફરવા માટે સંકેતનો ઉપયોગ કરો. પૅન કરવા ખેંચો, નાનું-મોટું કરવા માટે પિન્ચ કરો, બે આંગળીઓથી ફેરવો. પ્રારંભિક ઓરિએન્ટેશન પર પાછા ફરવા માટે રીસેટ કરો બટન દબાવો.",
"demo2dTransformationsSubtitle": "પૅન કરો, નાનું-મોટું કરો, ફેરવો",
"demo2dTransformationsTitle": "2D રૂપાંતરણો",
"demoCupertinoTextFieldPIN": "પિન",
"demoCupertinoTextFieldDescription": "ટેક્સ્ટ ફીલ્ડની મદદથી વપરાશકર્તા ટેક્સ્ટને હાર્ડવેરના કીબોર્ડ અથવા ઑનસ્ક્રીન કીબોર્ડ વડે દાખલ કરી શકે છે.",
"demoCupertinoTextFieldSubtitle": "iOS-શૈલીની ટેક્સ્ટ ફીલ્ડ",
"demoCupertinoTextFieldTitle": "ટેક્સ્ટ ફીલ્ડ",
"demoDatePickerDescription": "સામગ્રીની ડિઝાઇનવાળા તારીખ પિકરને સમાવતો સંવાદ બતાવે છે.",
"demoCupertinoPickerTime": "સમય",
"demoCupertinoPickerDate": "તારીખ",
"demoCupertinoPickerTimer": "ટાઇમર",
"demoCupertinoPickerDescription": "iOS-શૈલીનું પિકર વિજેટ જેનો ઉપયોગ સ્ટ્રિંગ, તારીખ, સમય અથવા તારીખ અને સમય એમ બન્ને પસંદ કરવા માટે કરી શકાય છે.",
"demoCupertinoPickerSubtitle": "iOS-શૈલીના પિકર",
"demoCupertinoPickerTitle": "પિકર",
"dataTableRowWithHoney": "મધની સાથે {value}",
"cardsDemoTravelDestinationCity2": "ચેટ્ટીનાડ",
"bannerDemoResetText": "બૅનરને રીસેટ કરો",
"bannerDemoMultipleText": "એકથી વધુ ક્રિયાઓ",
"bannerDemoLeadingText": "લીડિંગ આઇકન",
"dismiss": "છોડી દો",
"cardsDemoTappable": "ટૅપ કરવા યોગ્ય",
"cardsDemoSelectable": "પસંદ કરવા યોગ્ય (થોડીવાર દબાવી રાખો)",
"cardsDemoExplore": "શોધખોળ કરો",
"cardsDemoExploreSemantics": "{destinationName}ની શોધખોળ કરો",
"cardsDemoShareSemantics": "{destinationName}ને શેર કરો",
"cardsDemoTravelDestinationTitle1": "તમિળનાડુના મુલાકાત લેવા માટેના લોકપ્રિય 10 શહેર",
"cardsDemoTravelDestinationDescription1": "નંબર 10",
"cardsDemoTravelDestinationCity1": "તંજાવુર",
"dataTableColumnProtein": "પ્રોટિન (ગ્રા)",
"cardsDemoTravelDestinationTitle2": "દક્ષિણ ભારતના કલાકાર",
"cardsDemoTravelDestinationDescription2": "સિલ્ક સ્પિનર",
"bannerDemoText": "તમારા અન્ય ડિવાઇસ પર તમારો પાસવર્ડ અપડેટ કર્યો હતો. કૃપા કરીને ફરી સાઇન ઇન કરો.",
"cardsDemoTravelDestinationLocation2": "શિવાગંગા, તમિળનાડુ",
"cardsDemoTravelDestinationTitle3": "બૃહદેશ્વર મંદિર",
"cardsDemoTravelDestinationDescription3": "મંદિરો",
"demoBannerTitle": "બૅનર",
"demoBannerSubtitle": "સૂચિમાં બૅનર બતાવવું",
"demoBannerDescription": "બૅનર મહત્ત્વપૂર્ણ, મુદ્દાસર સંદેશ બતાવે છે અને વપરાશકર્તા આગળ શું કરી શકે છે તે માટેની ક્રિયાઓ આપે છે (અથવા બૅનરને છોડી દેવાનો વિકલ્પ પણ આપે છે). બૅનર રદ કરવા માટે, વપરાશકર્તા ક્રિયા જરૂરી હોય છે.",
"demoCardTitle": "કાર્ડ",
"demoCardSubtitle": "બેઝલાઇન કાર્ડ કે જેના ગોળ ખૂણા હોય છે",
"demoCardDescription": "કાર્ડ એ એવી કેટલીક સંબંધિત માહિતીને રજૂ કરવા માટે વપરાતી સામગ્રીની શીટ હોય છે, ઉદાહરણ તરીકે, આલ્બમ, ભૌગોલિક સ્થાન, ભોજન, સંપર્કની વિગતો, વગેરે.",
"demoDataTableTitle": "ડેટા ટેબલ",
"demoDataTableSubtitle": "માહિતીની પંક્તિઓ અને કૉલમ",
"dataTableColumnCarbs": "કાર્બોહાઇડ્રેટ (ગ્રા)",
"placeTanjore": "તાંજોર",
"demoGridListsTitle": "ગ્રિડ સૂચિઓ",
"placeFlowerMarket": "ફૂલ બજાર",
"placeBronzeWorks": "બ્રૉન્ઝ વર્ક",
"placeMarket": "બજાર",
"placeThanjavurTemple": "તંજાવુર મંદિર",
"placeSaltFarm": "મીઠાનું ફાર્મ",
"placeScooters": "સ્કૂટર",
"placeSilkMaker": "રેશમ નિર્માતા",
"placeLunchPrep": "બપોરના ભોજનની તૈયારી",
"placeBeach": "બીચ",
"placeFisherman": "માછીમાર",
"demoMenuSelected": "પસંદ કર્યું: {value}",
"demoMenuRemove": "કાઢી નાખો",
"demoMenuGetLink": "લિંક મેળવો",
"demoMenuShare": "શેર કરો",
"demoBottomAppBarSubtitle": "સૌથી નીચે નૅવિગેશન અને ક્રિયાઓ બતાવે છે",
"demoMenuAnItemWithASectionedMenu": "વિભાગીય મેનૂવાળી આઇટમ",
"demoMenuADisabledMenuItem": "બંધ કરેલી મેનૂ આઇટમ",
"demoLinearProgressIndicatorTitle": "રેખીય પ્રગતિ સૂચક",
"demoMenuContextMenuItemOne": "સંદર્ભ મેનૂમાં પહેલી આઇટમ",
"demoMenuAnItemWithASimpleMenu": "સરળ મેનૂવાળી આઇટમ",
"demoCustomSlidersTitle": "કસ્ટમ સ્લાઇડર",
"demoMenuAnItemWithAChecklistMenu": "ચેકલિસ્ટ મેનૂવાળી આઇટમ",
"demoCupertinoActivityIndicatorTitle": "પ્રવૃત્તિ સૂચક",
"demoCupertinoActivityIndicatorSubtitle": "iOS-શૈલીના પ્રવૃત્તિ સૂચકો",
"demoCupertinoActivityIndicatorDescription": "iOS-શૈલીનું એક પ્રવૃત્તિ સૂચક જે ઘડિયાળની દિશામાં ફરે છે.",
"demoCupertinoNavigationBarTitle": "નૅવિગેશન બાર",
"demoCupertinoNavigationBarSubtitle": "iOS-શૈલીનો નૅવિગેશન બાર",
"demoCupertinoNavigationBarDescription": "iOS-શૈલીનો નૅવિગેશન બાર. નૅવિગેશન બાર એ ટૂલબાર છે, જેમાં ટૂલબારની મધ્યમાં ઓછામાં ઓછું પેજ શીર્ષક શામેલ હોય છે.",
"demoCupertinoPullToRefreshTitle": "રિફ્રેશ કરવા માટે ખેંચો",
"demoCupertinoPullToRefreshSubtitle": "નિયંત્રણ રિફ્રેશ કરવા માટે iOS-શૈલીમાં ખેંચો",
"demoCupertinoPullToRefreshDescription": "વિજેટ કે જે કન્ટેન્ટ નિયંત્રણને રિફ્રેશ કરવા માટે iOS-શૈલીમાં ખેંચવાની સુવિધાનો અમલ કરે છે.",
"demoProgressIndicatorTitle": "પ્રગતિ સૂચકો",
"demoProgressIndicatorSubtitle": "રેખીય, વર્તુળાકાર, અનિશ્ચિત",
"demoCircularProgressIndicatorTitle": "વર્તુળાકાર પ્રગતિ સૂચક",
"demoCircularProgressIndicatorDescription": "સામગ્રીની ડિઝાઇનનું એક વર્તુળાકાર પ્રગતિ સૂચક, જે ઍપ્લિકેશન વ્યસ્ત છે તેવું બતાવવા માટે ગોળ ફરે છે.",
"demoMenuFour": "ચાર",
"demoLinearProgressIndicatorDescription": "સામગ્રીની ડિઝાઇનનું એક રેખીય પ્રગતિ સૂચક, જે પ્રોગ્રેસ બાર તરીકે પણ ઓળખાય છે.",
"demoTooltipTitle": "ટૂલટિપ",
"demoTooltipSubtitle": "ટૂંકા સંદેશ પર થોડીવાર દબાવી રાખવાથી અથવા તેના પર લઈ જવાથી તે પ્રદર્શિત થાય છે",
"demoTooltipDescription": "ટૂલટિપ ટેક્સ્ટ લેબલ આપે છે, જે બટન અથવા યૂઝર ઇન્ટરફેસની અન્ય ક્રિયાના ફંક્શન સમજાવવામાં સહાય કરે છે. જ્યારે વપરાશકર્તા કોઈ ઘટક પર લઈ જાય, તેના પર ફોકસ કરે અથવા તેના પર થોડીવાર દબાવી રાખે, ત્યારે ટૂલટિપ માહિતીપ્રદ ટેક્સ્ટ પ્રદર્શિત કરે છે.",
"demoTooltipInstructions": "ટૂલટિપ બતાવવા માટે થોડીવાર દબાવી રાખો અથવા તેના પર લઈ જાઓ.",
"placeChennai": "ચેન્નઈ",
"demoMenuChecked": "ચેક કર્યું: {value}",
"placeChettinad": "ચેટ્ટીનાડ",
"demoMenuPreview": "પ્રીવ્યૂ કરો",
"demoBottomAppBarTitle": "ઍપનો સૌથી નીચેનો બાર",
"demoBottomAppBarDescription": "ઍપના સૌથી નીચેના બાર, ફ્લોટિંગ એક્શન બટન સહિત સૌથી નીચેના નૅવિગેશન ડ્રોઅર અને વધુમાં વધુ ચાર ક્રિયાઓનો ઍક્સેસ પ્રદાન કરે છે.",
"bottomAppBarNotch": "નૉચ",
"bottomAppBarPosition": "ફ્લોટિંગ ઍક્શન બટનની સ્થિતિ",
"bottomAppBarPositionDockedEnd": "ડૉક કર્યુ - અંતમાં",
"bottomAppBarPositionDockedCenter": "ડૉક કર્યુ - મધ્યમાં",
"bottomAppBarPositionFloatingEnd": "ફ્લોટિંગ - અંતમાં",
"bottomAppBarPositionFloatingCenter": "ફ્લોટિંગ - મધ્યમાં",
"demoSlidersEditableNumericalValue": "ફેરફાર કરી શકાય તેવું સંખ્યાત્મક મૂલ્ય",
"demoGridListsSubtitle": "પંક્તિ અને કૉલમ લેઆઉટ",
"demoGridListsDescription": "એક જ પ્રકારનો ડેટા ખાસ કરીને છબીઓ પ્રસ્તુત કરવા માટે ગ્રિડ સૂચિઓ શ્રેષ્ઠપણે અનુકૂળ છે. ગ્રિડ સૂચિમાંની દરેક આઇટમને ટાઇલ કહેવામાં આવે છે.",
"demoGridListsImageOnlyTitle": "માત્ર છબી",
"demoGridListsHeaderTitle": "હેડર સાથે",
"demoGridListsFooterTitle": "ફૂટર સાથે",
"demoSlidersTitle": "સ્લાઇડર",
"demoSlidersSubtitle": "સ્વાઇપ કરીને મૂલ્ય પસંદ કરવા માટેના વિજેટ",
"demoSlidersDescription": "'સ્લાઇડર' બારમાં મૂલ્યોની શ્રેણી બતાવે છે, જેમાંથી વપરાશકર્તાઓ એક મૂલ્ય પસંદ કરી શકે છે. તેઓ વૉલ્યૂમ, બ્રાઇટનેસ, અથવા છબી ફિલ્ટર લાગુ કરવા જેવી સેટિંગની ગોઠવણ કરવા માટે આદર્શ છે.",
"demoRangeSlidersTitle": "સ્લાઇડરની શ્રેણી",
"demoRangeSlidersDescription": "સ્લાઇડર બારમાં મૂલ્યોની શ્રેણી બતાવે છે. તેઓ બારના બન્ને છેડા પર એવા આઇકન ધરાવી શકે છે, જે મૂલ્યોની શ્રેણી બતાવે છે. તેઓ વૉલ્યૂમ, બ્રાઇટનેસ, અથવા છબી ફિલ્ટર લાગુ કરવા જેવી સેટિંગની ગોઠવણ કરવા માટે આદર્શ છે.",
"demoMenuAnItemWithAContextMenuButton": "સંદર્ભ મેનૂવાળી આઇટમ",
"demoCustomSlidersDescription": "સ્લાઇડર બારમાં મૂલ્યોની શ્રેણી બતાવે છે, જેમાંથી વપરાશકર્તાઓ એક મૂલ્ય અથવા મૂલ્યોની શ્રેણી પસંદ કરી શકે છે. સ્લાઇડરની થીમ નક્કી કરી શકાય છે અને તેઓને કસ્ટમાઇઝ પણ કરી શકાય છે.",
"demoSlidersContinuousWithEditableNumericalValue": "ફેરફાર કરી શકાય તેવા સતત સંખ્યાત્મક મૂલ્યો ધરાવતું",
"demoSlidersDiscrete": "અલગ",
"demoSlidersDiscreteSliderWithCustomTheme": "કસ્ટમ થીમ સાથેનું અલગ સ્લાઇડર",
"demoSlidersContinuousRangeSliderWithCustomTheme": "કસ્ટમ થીમ સાથેનું સતત શ્રેણી ધરાવતું સ્લાઇડર",
"demoSlidersContinuous": "સતત",
"placePondicherry": "પોંડિચેરી",
"demoMenuTitle": "મેનૂ",
"demoContextMenuTitle": "સંદર્ભ મેનૂ",
"demoSectionedMenuTitle": "વિભાગીય મેનૂ",
"demoSimpleMenuTitle": "સરળ મેનૂ",
"demoChecklistMenuTitle": "ચેકલિસ્ટ મેનૂ",
"demoMenuSubtitle": "મેનૂ બટન અને સરળ મેનૂ",
"demoMenuDescription": "મેનૂ હંગામી સપાટી પર પસંદગીઓની સૂચિ બતાવે છે. જ્યારે વપરાશકર્તાઓ બટન, ક્રિયા અથવા અન્ય નિયંત્રણથી ક્રિયાપ્રતિક્રિયા કરે, ત્યારે તે દેખાય છે.",
"demoMenuItemValueOne": "મેનૂમાં પહેલી આઇટમ",
"demoMenuItemValueTwo": "મેનૂમાં બીજી આઇટમ",
"demoMenuItemValueThree": "મેનૂમાં ત્રીજી આઇટમ",
"demoMenuOne": "એક",
"demoMenuTwo": "બે",
"demoMenuThree": "ત્રણ",
"demoMenuContextMenuItemThree": "સંદર્ભ મેનૂમાં ત્રીજી આઇટમ",
"demoCupertinoSwitchSubtitle": "iOS-શૈલીનું સ્વિચ",
"demoSnackbarsText": "આ સ્નૅકબાર છે.",
"demoCupertinoSliderSubtitle": "iOS-શૈલીનું સ્લાઇડર",
"demoCupertinoSliderDescription": "સ્લાઇડરનો ઉપયોગ સતત અથવા અલગ મૂલ્યોના સેટમાંથી પસંદ કરવા માટે કરી શકાય છે.",
"demoCupertinoSliderContinuous": "સતત: {value}",
"demoCupertinoSliderDiscrete": "અલગ: {value}",
"demoSnackbarsAction": "તમે સ્નૅકબાર ઍક્શન દબાવ્યું.",
"backToGallery": "ગૅલેરી પર પાછા જાઓ",
"demoCupertinoTabBarTitle": "ટૅબ બાર",
"demoCupertinoSwitchDescription": "સ્વિચનો ઉપયોગ સિંગલ સેટિંગની ચાલુ/બંધ સ્થિતિને ટૉગલ કરવા માટે થાય છે.",
"demoSnackbarsActionButtonLabel": "ઍક્શન",
"cupertinoTabBarProfileTab": "પ્રોફાઇલ",
"demoSnackbarsButtonLabel": "સ્નૅકબાર બતાવો",
"demoSnackbarsDescription": "સ્નૅકબાર વપરાશકર્તાઓને ઍપ દ્વારા કરવામાં આવેલી અથવા ભવિષ્યમાં કરવાની છે તે પ્રક્રિયા અંગે સૂચના આપે છે. તે સ્ક્રીનની નીચેની બાજુએ હંગામી રીતે દેખાય છે. તેના કારણે વપરાશકર્તાના અનુભવમાં વિક્ષેપ પડશે નહીં અને અદૃશ્ય થવા માટે તેને વપરાશકર્તાના ઇનપુટની જરૂર હોતી નથી.",
"demoSnackbarsSubtitle": "સ્નૅકબાર, સ્ક્રીનના તળિયા પર સંદેશા બતાવે છે",
"demoSnackbarsTitle": "સ્નૅકબાર",
"demoCupertinoSliderTitle": "સ્લાઇડર",
"cupertinoTabBarChatTab": "Chat",
"cupertinoTabBarHomeTab": "હોમ",
"demoCupertinoTabBarDescription": "iOS-શૈલીના તળિયાના નૅવિગેશન ટૅબનું બાર. એક ટૅબ સક્રિય હોવાની સાથે એકથી વધુ ટૅબ બતાવે છે, જેમાં પહેલી ટૅબ ડિફૉલ્ટ તરીકે હોય છે.",
"demoCupertinoTabBarSubtitle": "iOS-શૈલીના તળિયાની ટૅબનું બાર",
"demoOptionsFeatureTitle": "વિકલ્પો જુઓ",
"demoOptionsFeatureDescription": "આ ડેમો માટે ઉપલબ્ધ વિકલ્પો જોવા માટે અહીં ટૅપ કરો.",
"demoCodeViewerCopyAll": "બધા કૉપિ કરો",
"shrineScreenReaderRemoveProductButton": "{product} કાઢી નાખો",
"shrineScreenReaderProductAddToCart": "કાર્ટમાં ઉમેરો",
"shrineScreenReaderCart": "{quantity,plural,=0{શોપિંગ કાર્ટ, કોઈ આઇટમ નથી}=1{શોપિંગ કાર્ટ, 1 આઇટમ}other{શોપિંગ કાર્ટ, {quantity} આઇટમ}}",
"demoCodeViewerFailedToCopyToClipboardMessage": "ક્લિપબોર્ડ પર કૉપિ કરવામાં નિષ્ફળ રહ્યાં: {error}",
"demoCodeViewerCopiedToClipboardMessage": "ક્લિપબોર્ડ પર કૉપિ કર્યા.",
"craneSleep8SemanticLabel": "મય બીચના ખડક પર ખંડેર",
"craneSleep4SemanticLabel": "પર્વતોની સામે તળાવ બાજુ હોટલ",
"craneSleep2SemanticLabel": "માચુ પિચ્ચુનો રાજગઢ",
"craneSleep1SemanticLabel": "સદાબહાર ઝાડવાળા બર્ફીલા લૅન્ડસ્કેપમાં ચેલેટ",
"craneSleep0SemanticLabel": "પાણીની ઉપર બનાવેલો બંગલો",
"craneFly13SemanticLabel": "સમુદ્ર કિનારે પામના વૃક્ષોવાળો પૂલ",
"craneFly12SemanticLabel": "પામના વૃક્ષોવાળો પૂલ",
"craneFly11SemanticLabel": "સમુદ્ર કિનારે ઈંટથી બનાવેલી દીવાદાંડી",
"craneFly10SemanticLabel": "સૂર્યાસ્ત પછી અલ-અઝહર મસ્જિદના ટાવર",
"craneFly9SemanticLabel": "પ્રાચીન વાદળી કારને ટેકો આપીને ઉભેલો માણસ",
"craneFly8SemanticLabel": "સુપરટ્રી ગ્રોવ",
"craneEat9SemanticLabel": "પેસ્ટ્રી સાથે કૅફે કાઉન્ટર",
"craneEat2SemanticLabel": "બર્ગર",
"craneFly5SemanticLabel": "પર્વતોની સામે તળાવ બાજુ હોટલ",
"demoSelectionControlsSubtitle": "ચેકબૉક્સ, રેડિયો બટન અને સ્વિચ",
"craneEat10SemanticLabel": "મોટી પાસ્ટ્રામી સેન્ડવિચ પકડીને ઉભેલી સ્ત્રી",
"craneFly4SemanticLabel": "પાણીની ઉપર બનાવેલો બંગલો",
"craneEat7SemanticLabel": "બેકરીનો પ્રવેશદ્વાર",
"craneEat6SemanticLabel": "ઝીંગાની વાનગી",
"craneEat5SemanticLabel": "કલાત્મક રીતે બનાવેલા રેસ્ટોરન્ટનો બેઠક વિસ્તાર",
"craneEat4SemanticLabel": "ચોકલેટ ડેઝર્ટ",
"craneEat3SemanticLabel": "કોરિયન ટાકો",
"craneFly3SemanticLabel": "માચુ પિચ્ચુનો રાજગઢ",
"craneEat1SemanticLabel": "ડાઇનર-સ્ટાઇલ સ્ટૂલવાળો ખાલી બાર",
"craneEat0SemanticLabel": "ચૂલામાં લાકડાથી પકાવેલા પિઝા",
"craneSleep11SemanticLabel": "તાઇપેઇ 101 સ્કાયસ્ક્રેપર",
"craneSleep10SemanticLabel": "સૂર્યાસ્ત પછી અલ-અઝહર મસ્જિદના ટાવર",
"craneSleep9SemanticLabel": "સમુદ્ર કિનારે ઈંટથી બનાવેલી દીવાદાંડી",
"craneEat8SemanticLabel": "ક્રોફિશથી ભરેલી પ્લેટ",
"craneSleep7SemanticLabel": "રિબેરિયા સ્ક્વેરમાં રંગીન એપાર્ટમેન્ટ",
"craneSleep6SemanticLabel": "પામના વૃક્ષોવાળો પૂલ",
"craneSleep5SemanticLabel": "ફીલ્ડમાં તંબુ",
"settingsButtonCloseLabel": "સેટિંગ બંધ કરો",
"demoSelectionControlsCheckboxDescription": "ચેકબૉક્સ વપરાશકર્તાને સેટમાંથી એકથી વધુ વિકલ્પો પસંદ કરવાની મંજૂરી આપે છે. સામાન્ય ચેકબૉક્સનું મૂલ્ય સાચું અથવા ખોટું છે અને ત્રણ સ્ટેટના ચેકબોક્સનું મૂલ્ય શૂન્ય પણ હોઈ શકે છે.",
"settingsButtonLabel": "સેટિંગ",
"demoListsTitle": "સૂચિઓ",
"demoListsSubtitle": "સ્ક્રોલિંગ સૂચિ લેઆઉટ",
"demoListsDescription": "એક નિશ્ચિત-ઊંચાઈની પંક્તિમાં સામાન્ય રીતે અમુક ટેક્સ્ટ તેમજ તેની આગળ કે પાછળ આઇકન શામેલ હોય છે.",
"demoOneLineListsTitle": "એક લાઇન",
"demoTwoLineListsTitle": "બે લાઇન",
"demoListsSecondary": "ગૌણ ટેક્સ્ટ",
"demoSelectionControlsTitle": "પસંદગીના નિયંત્રણો",
"craneFly7SemanticLabel": "માઉન્ટ રુશ્મોર",
"demoSelectionControlsCheckboxTitle": "ચેકબૉક્સ",
"craneSleep3SemanticLabel": "પ્રાચીન વાદળી કારને ટેકો આપીને ઉભેલો માણસ",
"demoSelectionControlsRadioTitle": "રેડિયો",
"demoSelectionControlsRadioDescription": "રેડિયો બટન વપરાશકર્તાને સેટમાંથી એક વિકલ્પ પસંદ કરવાની મંજૂરી આપે છે. જો તમને લાગે કે વપરાશકર્તાને એક પછી એક ઉપલબ્ધ બધા વિકલ્પો જોવાની જરૂર છે, તો વિશિષ્ટ પસંદગી માટે રેડિયો બટનનો ઉપયોગ કરો.",
"demoSelectionControlsSwitchTitle": "સ્વિચ",
"demoSelectionControlsSwitchDescription": "ચાલુ/બંધ સ્વિચ સિંગલ સેટિંગ વિકલ્પની સ્થિતિને ટૉગલ કરે છે. સ્વિચ દ્વારા નિયંત્રિત વિકલ્પ તેમજ તેની સ્થિતિ, સંબંધિત ઇનલાઇન લેબલથી સ્પષ્ટ થવી જોઈએ.",
"craneFly0SemanticLabel": "સદાબહાર ઝાડવાળા બર્ફીલા લૅન્ડસ્કેપમાં ચેલેટ",
"craneFly1SemanticLabel": "ફીલ્ડમાં તંબુ",
"craneFly2SemanticLabel": "બર્ફીલા પર્વતની આગળ પ્રાર્થના માટે લગાવેલા ધ્વજ",
"craneFly6SemanticLabel": "પેલેસિઓ ડી બેલાસ આર્ટસનું ઉપરથી દેખાતું દૃશ્ય",
"rallySeeAllAccounts": "બધા એકાઉન્ટ જુઓ",
"rallyBillAmount": "{billName}નું {amount}નું બિલ ચુકવવાની નિયત તારીખ {date} છે.",
"shrineTooltipCloseCart": "કાર્ટ બંધ કરો",
"shrineTooltipCloseMenu": "મેનૂ બંધ કરો",
"shrineTooltipOpenMenu": "મેનૂ ખોલો",
"shrineTooltipSettings": "સેટિંગ",
"shrineTooltipSearch": "Search",
"demoTabsDescription": "ટૅબ અલગ અલગ સ્ક્રીન, ડેટા સેટ અને અન્ય ક્રિયાપ્રતિક્રિયાઓ પર કન્ટેન્ટને ગોઠવે છે.",
"demoTabsSubtitle": "સ્વતંત્ર રીતે સ્ક્રોલ કરવા યોગ્ય વ્યૂ ટૅબ",
"demoTabsTitle": "ટૅબ",
"rallyBudgetAmount": "{budgetName}ના {amountTotal}ના બજેટમાંથી {amountUsed} વપરાયા, {amountLeft} બાકી છે",
"shrineTooltipRemoveItem": "આઇટમ કાઢી નાખો",
"rallyAccountAmount": "{accountName}ના એકાઉન્ટ નંબર {accountNumber}માં {amount} જમા કર્યાં.",
"rallySeeAllBudgets": "બધા બજેટ જુઓ",
"rallySeeAllBills": "બધા બિલ જુઓ",
"craneFormDate": "તારીખ પસંદ કરો",
"craneFormOrigin": "મૂળ સ્ટેશન પસંદ કરો",
"craneFly2": "ખુમ્બુ વેલી, નેપાળ",
"craneFly3": "માચુ પિચ્ચુ, પેરુ",
"craneFly4": "માલી, માલદીવ્સ",
"craneFly5": "વિઝનાઉ, સ્વિટ્ઝરલૅન્ડ",
"craneFly6": "મેક્સિકો સિટી, મેક્સિકો",
"craneFly7": "માઉન્ટ રુશમોરે, યુનાઇટેડ સ્ટેટ્સ",
"settingsTextDirectionLocaleBased": "લોકેલ પર આધારિત",
"craneFly9": "હવાના, ક્યૂબા",
"craneFly10": "કેરો, ઇજિપ્ત",
"craneFly11": "લિસ્બન, પોર્ટુગલ",
"craneFly12": "નાપા, યુનાઇટેડ સ્ટેટ્સ",
"craneFly13": "બાલી, ઇન્ડોનેશિયા",
"craneSleep0": "માલી, માલદીવ્સ",
"craneSleep1": "અસ્પેન, યુનાઇટેડ સ્ટેટ્સ",
"craneSleep2": "માચુ પિચ્ચુ, પેરુ",
"demoCupertinoSegmentedControlTitle": "વિભાગ મુજબ નિયંત્રણ",
"craneSleep4": "વિઝનાઉ, સ્વિટ્ઝરલૅન્ડ",
"craneSleep5": "બિગ સર, યુનાઇટેડ સ્ટેટ્સ",
"craneSleep6": "નાપા, યુનાઇટેડ સ્ટેટ્સ",
"craneSleep7": "પોર્ટો, પોર્ટુગલ",
"craneSleep8": "ટુલુમ, મેક્સિકો",
"craneEat5": "સિઓલ, દક્ષિણ કોરિયા",
"demoChipTitle": "ચિપ",
"demoChipSubtitle": "સંક્ષિપ્ત ઘટકો કે જે ઇનપુટ, એટ્રિબ્યુટ અથવા ઍક્શનને પ્રસ્તુત કરે છે",
"demoActionChipTitle": "ઍક્શન ચિપ",
"demoActionChipDescription": "ઍક્શન ચિપ એ વિકલ્પોનો સેટ છે જે મુખ્ય કન્ટેન્ટથી સંબંધિત ઍક્શનને ટ્રિગર કરે છે. ઍક્શન ચિપ, UIમાં ડાયનામિક રીતે અને સાંદર્ભિક રીતે દેખાવા જોઈએ.",
"demoChoiceChipTitle": "ચૉઇસ ચિપ",
"demoChoiceChipDescription": "ચૉઇસ ચિપ એ કોઈ સેટની એકલ પસંદગીને પ્રસ્તુત કરે છે. ચૉઇસ ચિપમાં સંબંધિત વર્ણનાત્મક ટેક્સ્ટ અથવા શ્રેણીઓ શામેલ હોય છે.",
"demoFilterChipTitle": "ફિલ્ટર ચિપ",
"demoFilterChipDescription": "ફિલ્ટર ચિપ, કન્ટેન્ટને ફિલ્ટર કરવા માટે ટૅગ અથવા વર્ણનાત્મક શબ્દોનો ઉપયોગ કરે છે.",
"demoInputChipTitle": "ઇનપુટ ચિપ",
"demoInputChipDescription": "ઇનપુટ ચિપ, એકમ (વ્યક્તિ, સ્થાન અથવા વસ્તુ) અથવા સંવાદી ટેક્સ્ટ જેવી જટિલ માહિતીને સંક્ષિપ્ત રૂપમાં પ્રસ્તુત કરે છે.",
"craneSleep9": "લિસ્બન, પોર્ટુગલ",
"craneEat10": "લિસ્બન, પોર્ટુગલ",
"demoCupertinoSegmentedControlDescription": "આનો ઉપયોગ પરસ્પર ખાસ વિકલ્પોમાંથી પસંદ કરવા માટે થાય છે. જ્યારે વિભાગ મુજબ નિયંત્રણમાંથી એક વિકલ્પ પસંદ કર્યો હોય, ત્યારે વિભાગ મુજબ નિયંત્રણના અન્ય વિકલ્પો પસંદ કરવાની સુવિધા બંધ કરવામાં આવે છે.",
"chipTurnOnLights": "લાઇટ ચાલુ કરો",
"chipSmall": "નાનું",
"chipMedium": "મધ્યમ",
"chipLarge": "મોટું",
"chipElevator": "એલિવેટર",
"chipWasher": "વૉશર",
"chipFireplace": "ફાયરપ્લેસ",
"chipBiking": "બાઇકિંગ",
"craneFormDiners": "ડાઇનર",
"rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{તમારો સંભવિત કર કપાત વધારો! ન સોંપાયેલ 1 વ્યવહાર માટે કૅટેગરી સોંપો.}other{તમારો સંભવિત કર કપાત વધારો! ન સોંપાયેલ {count} વ્યવહાર માટે કૅટેગરી સોંપો.}}",
"craneFormTime": "સમય પસંદ કરો",
"craneFormLocation": "સ્થાન પસંદ કરો",
"craneFormTravelers": "મુસાફરો",
"craneEat8": "એટલાન્ટા, યુનાઇટેડ સ્ટેટ્સ",
"craneFormDestination": "નિર્ધારિત સ્થાન પસંદ કરો",
"craneFormDates": "તારીખ પસંદ કરો",
"craneFly": "ઉડાન",
"craneSleep": "સ્લીપ",
"craneEat": "ખાવા માટેના સ્થાન",
"craneFlySubhead": "નિર્ધારિત સ્થાન દ્વારા ફ્લાઇટની શોધખોળ કરો",
"craneSleepSubhead": "નિર્ધારિત સ્થાન દ્વારા પ્રોપર્ટીની શોધખોળ કરો",
"craneEatSubhead": "નિર્ધારિત સ્થાન દ્વારા રેસ્ટોરન્ટની શોધખોળ કરો",
"craneFlyStops": "{numberOfStops,plural,=0{નૉનસ્ટોપ}=1{1 સ્ટૉપ}other{{numberOfStops} સ્ટૉપ}}",
"craneSleepProperties": "{totalProperties,plural,=0{કોઈ પ્રોપર્ટી ઉપલબ્ધ નથી}=1{1 પ્રોપર્ટી ઉપલબ્ધ છે}other{{totalProperties} પ્રોપર્ટી ઉપલબ્ધ છે}}",
"craneEatRestaurants": "{totalRestaurants,plural,=0{કોઈ રેસ્ટોરન્ટ નથી}=1{1 રેસ્ટોરન્ટ}other{{totalRestaurants} રેસ્ટોરન્ટ}}",
"craneFly0": "અસ્પેન, યુનાઇટેડ સ્ટેટ્સ",
"demoCupertinoSegmentedControlSubtitle": "iOS-શૈલીના વિભાગ મુજબ નિયંત્રણ",
"craneSleep10": "કેરો, ઇજિપ્ત",
"craneEat9": "મેડ્રિડ, સ્પેઇન",
"craneFly1": "બિગ સર, યુનાઇટેડ સ્ટેટ્સ",
"craneEat7": "નેશવિલે, યુનાઇટેડ સ્ટેટ્સ",
"craneEat6": "સિએટલ, યુનાઇટેડ સ્ટેટ્સ",
"craneFly8": "સિંગાપુર",
"craneEat4": "પેરિસ, ફ્રાન્સ",
"craneEat3": "પૉર્ટલેન્ડ, યુનાઇટેડ સ્ટેટ્સ",
"craneEat2": "કોર્ડોબા, આર્જેન્ટિના",
"craneEat1": "ડલાસ, યુનાઇટેડ સ્ટેટ્સ",
"craneEat0": "નેપલ્સ, ઇટાલી",
"craneSleep11": "તાઇપેઇ, તાઇવાન",
"craneSleep3": "હવાના, ક્યૂબા",
"shrineLogoutButtonCaption": "લૉગ આઉટ",
"rallyTitleBills": "બિલ",
"rallyTitleAccounts": "એકાઉન્ટ",
"shrineProductVagabondSack": "Vagabond sack",
"rallyAccountDetailDataInterestYtd": "વ્યાજ YTD",
"shrineProductWhitneyBelt": "Whitney belt",
"shrineProductGardenStrand": "Garden strand",
"shrineProductStrutEarrings": "Strut earrings",
"shrineProductVarsitySocks": "Varsity socks",
"shrineProductWeaveKeyring": "Weave keyring",
"shrineProductGatsbyHat": "Gatsby hat",
"shrineProductShrugBag": "Shrug bag",
"shrineProductGiltDeskTrio": "Gilt desk trio",
"shrineProductCopperWireRack": "Copper wire rack",
"shrineProductSootheCeramicSet": "Soothe ceramic set",
"shrineProductHurrahsTeaSet": "Hurrahs tea set",
"shrineProductBlueStoneMug": "Blue stone mug",
"shrineProductRainwaterTray": "Rainwater tray",
"shrineProductChambrayNapkins": "Chambray napkins",
"shrineProductSucculentPlanters": "Succulent planters",
"shrineProductQuartetTable": "Quartet table",
"shrineProductKitchenQuattro": "Kitchen quattro",
"shrineProductClaySweater": "Clay sweater",
"shrineProductSeaTunic": "Sea tunic",
"shrineProductPlasterTunic": "Plaster tunic",
"rallyBudgetCategoryRestaurants": "રેસ્ટોરન્ટ",
"shrineProductChambrayShirt": "Chambray shirt",
"shrineProductSeabreezeSweater": "Seabreeze sweater",
"shrineProductGentryJacket": "Gentry jacket",
"shrineProductNavyTrousers": "Navy trousers",
"shrineProductWalterHenleyWhite": "Walter henley (white)",
"shrineProductSurfAndPerfShirt": "Surf and perf shirt",
"shrineProductGingerScarf": "Ginger scarf",
"shrineProductRamonaCrossover": "Ramona crossover",
"shrineProductClassicWhiteCollar": "Classic white collar",
"shrineProductSunshirtDress": "Sunshirt dress",
"rallyAccountDetailDataInterestRate": "વ્યાજનો દર",
"rallyAccountDetailDataAnnualPercentageYield": "વાર્ષિક ઉપજની ટકાવારી",
"rallyAccountDataVacation": "વેકેશન",
"shrineProductFineLinesTee": "Fine lines tee",
"rallyAccountDataHomeSavings": "ઘરેલુ બચત",
"rallyAccountDataChecking": "ચેક કરી રહ્યાં છીએ",
"rallyAccountDetailDataInterestPaidLastYear": "ગયા વર્ષે ચૂકવેલું વ્યાજ",
"rallyAccountDetailDataNextStatement": "આગલું સ્ટેટમેન્ટ",
"rallyAccountDetailDataAccountOwner": "એકાઉન્ટના માલિક",
"rallyBudgetCategoryCoffeeShops": "કૉફી શૉપ",
"rallyBudgetCategoryGroceries": "કરિયાણું",
"shrineProductCeriseScallopTee": "Cerise scallop tee",
"rallyBudgetCategoryClothing": "વસ્ત્રો",
"rallySettingsManageAccounts": "એકાઉન્ટ મેનેજ કરો",
"rallyAccountDataCarSavings": "કાર બચત",
"rallySettingsTaxDocuments": "કરવેરાના દસ્તાવેજો",
"rallySettingsPasscodeAndTouchId": "પાસકોડ અને સ્પર્શ ID",
"rallySettingsNotifications": "નોટિફિકેશન",
"rallySettingsPersonalInformation": "વ્યક્તિગત માહિતી",
"rallySettingsPaperlessSettings": "પેપરલેસ સેટિંગ",
"rallySettingsFindAtms": "ATMs શોધો",
"rallySettingsHelp": "સહાય",
"rallySettingsSignOut": "સાઇન આઉટ કરો",
"rallyAccountTotal": "કુલ",
"rallyBillsDue": "બાકી",
"rallyBudgetLeft": "બાકી",
"rallyAccounts": "એકાઉન્ટ",
"rallyBills": "બિલ",
"rallyBudgets": "બજેટ",
"rallyAlerts": "અલર્ટ",
"rallySeeAll": "બધું જુઓ",
"rallyFinanceLeft": "બાકી",
"rallyTitleOverview": "ઝલક",
"shrineProductShoulderRollsTee": "Shoulder rolls tee",
"shrineNextButtonCaption": "આગળ",
"rallyTitleBudgets": "બજેટ",
"rallyTitleSettings": "સેટિંગ",
"rallyLoginLoginToRally": "Rallyમાં લૉગ ઇન કરો",
"rallyLoginNoAccount": "કોઈ એકાઉન્ટ નથી?",
"rallyLoginSignUp": "સાઇન અપ કરો",
"rallyLoginUsername": "વપરાશકર્તાનું નામ",
"rallyLoginPassword": "પાસવર્ડ",
"rallyLoginLabelLogin": "લૉગ ઇન",
"rallyLoginRememberMe": "મને યાદ રાખો",
"rallyLoginButtonLogin": "લૉગ ઇન",
"rallyAlertsMessageHeadsUpShopping": "સચેત રહો, તમે ખરીદી માટેના આ મહિનાના તમારા બજેટમાંથી {percent} વાપર્યા છે.",
"rallyAlertsMessageSpentOnRestaurants": "આ અઠવાડિયે તમે રેસ્ટોરન્ટ પાછળ {amount} વાપર્યા છે.",
"rallyAlertsMessageATMFees": "આ મહિને તમે ATM ફી માટે {amount} વાપર્યા છે",
"rallyAlertsMessageCheckingAccount": "ઘણું સરસ! તમારું ચેકિંગ એકાઉન્ટ પાછલા મહિના કરતાં {percent} વધારે છે.",
"shrineMenuCaption": "મેનૂ",
"shrineCategoryNameAll": "બધા",
"shrineCategoryNameAccessories": "ઍક્સેસરી",
"shrineCategoryNameClothing": "કપડાં",
"shrineCategoryNameHome": "હોમ",
"shrineLoginUsernameLabel": "વપરાશકર્તાનું નામ",
"shrineLoginPasswordLabel": "પાસવર્ડ",
"shrineCancelButtonCaption": "રદ કરો",
"shrineCartTaxCaption": "કર:",
"shrineCartPageCaption": "કાર્ટ",
"shrineProductQuantity": "જથ્થો: {quantity}",
"shrineProductPrice": "x {price}",
"shrineCartItemCount": "{quantity,plural,=0{કોઈ આઇટમ નથી}=1{1 આઇટમ}other{{quantity} આઇટમ}}",
"shrineCartClearButtonCaption": "કાર્ટ ખાલી કરો",
"shrineCartTotalCaption": "કુલ",
"shrineCartSubtotalCaption": "પેટાસરવાળો:",
"shrineCartShippingCaption": "શિપિંગ:",
"shrineProductGreySlouchTank": "Grey slouch tank",
"shrineProductStellaSunglasses": "Stella sunglasses",
"shrineProductWhitePinstripeShirt": "White pinstripe shirt",
"demoTextFieldWhereCanWeReachYou": "અમે ક્યાં તમારો સંપર્ક કરી શકીએ?",
"settingsTextDirectionLTR": "LTR",
"settingsTextScalingLarge": "મોટું",
"demoBottomSheetHeader": "હેડર",
"demoBottomSheetItem": "આઇટમ {value}",
"demoBottomTextFieldsTitle": "ટેક્સ્ટ ફીલ્ડ",
"demoTextFieldTitle": "ટેક્સ્ટ ફીલ્ડ",
"demoTextFieldSubtitle": "ફેરફાર કરી શકાય તેવા ટેક્સ્ટ અને નંબરની સિંગલ લાઇન",
"demoTextFieldDescription": "ટેક્સ્ટ ફીલ્ડ વડે વપરાશકર્તાઓ UIમાં ટેક્સ્ટ દાખલ કરી શકે છે. સામાન્ય રીતે તે ફોર્મ અને સંવાદમાં આવતા હોય છે.",
"demoTextFieldShowPasswordLabel": "પાસવર્ડ બતાવો",
"demoTextFieldHidePasswordLabel": "પાસવર્ડ છુપાવો",
"demoTextFieldFormErrors": "સબમિટ કરતા પહેલાં કૃપા કરીને લાલ રંગે દર્શાવેલી ભૂલો ઠીક કરો.",
"demoTextFieldNameRequired": "નામ જરૂરી છે.",
"demoTextFieldOnlyAlphabeticalChars": "કૃપા કરીને માત્ર મૂળાક્ષરના અક્ષરો દાખલ કરો.",
"demoTextFieldEnterUSPhoneNumber": "(###) ###-#### - અમેરિકાનો ફોન નંબર દાખલ કરો.",
"demoTextFieldEnterPassword": "કૃપા કરીને પાસવર્ડ દાખલ કરો.",
"demoTextFieldPasswordsDoNotMatch": "પાસવર્ડનો મેળ બેસતો નથી",
"demoTextFieldWhatDoPeopleCallYou": "લોકો તમને શું કહીને બોલાવે છે?",
"demoTextFieldNameField": "નામ*",
"demoBottomSheetButtonText": "બોટમ શીટ બતાવો",
"demoTextFieldPhoneNumber": "ફોન નંબર*",
"demoBottomSheetTitle": "બોટમ શીટ",
"demoTextFieldEmail": "ઇમેઇલ",
"demoTextFieldTellUsAboutYourself": "અમને તમારા વિશે જણાવો (દા.ત., તમે શું કરો છો તે અથવા તમારા શોખ વિશે લખો)",
"demoTextFieldKeepItShort": "ટૂંકું જ બનાવો, આ માત્ર ડેમો છે.",
"starterAppGenericButton": "બટન",
"demoTextFieldLifeStory": "જીવન વૃત્તાંત",
"demoTextFieldSalary": "પગાર",
"demoTextFieldUSD": "USD",
"demoTextFieldNoMoreThan": "8 અક્ષર કરતાં વધુ નહીં.",
"demoTextFieldPassword": "પાસવર્ડ*",
"demoTextFieldRetypePassword": "પાસવર્ડ ફરીથી લખો*",
"demoTextFieldSubmit": "સબમિટ કરો",
"demoBottomNavigationSubtitle": "અરસપરસ ફેડ થતા દૃશ્યો સાથે બોટમ નૅવિગેશન",
"demoBottomSheetAddLabel": "ઉમેરો",
"demoBottomSheetModalDescription": "મોડલ બોટમ શીટ મેનૂ અથવા સંવાદના વિકલ્પરૂપે હોય છે અને વપરાશકર્તાને ઍપના બાકીના ભાગ સાથે ક્રિયાપ્રતિક્રિયા કરતા અટકાવે છે.",
"demoBottomSheetModalTitle": "મોડલ બોટમ શીટ",
"demoBottomSheetPersistentDescription": "પર્સીસ્ટન્ટ બોટમ શીટ ઍપના મુખ્ય કન્ટેન્ટને પૂરક હોય તેવી માહિતી બતાવે છે. વપરાશકર્તા ઍપના અન્ય ભાગ સાથે ક્રિયાપ્રતિક્રિયા કરતા હોય ત્યારે પણ પર્સીસ્ટન્ટ બોટમ શીટ દેખાતી રહે છે.",
"demoBottomSheetPersistentTitle": "પર્સીસ્ટન્ટ બોટમ શીટ",
"demoBottomSheetSubtitle": "પર્સીસ્ટન્ટ અને મોડલ બોટમ શીટ",
"demoTextFieldNameHasPhoneNumber": "{name} ફોન નંબર {phoneNumber} છે",
"buttonText": "બટન",
"demoTypographyDescription": "સામગ્રીની ડિઝાઇનમાં જોવા મળતી ટાઇપોગ્રાફીની વિવિધ શૈલીઓ માટેની વ્યાખ્યાઓ.",
"demoTypographySubtitle": "ટેક્સ્ટની પૂર્વવ્યાખ્યાયિત બધી જ શૈલીઓ",
"demoTypographyTitle": "ટાઇપોગ્રાફી",
"demoFullscreenDialogDescription": "fullscreenDialog પ્રોપર્ટી ઇનકમિંગ પેજ પૂર્ણસ્ક્રીન મૉડલ સંવાદ હશે કે કેમ તેનો ઉલ્લેખ કરે છે",
"demoFlatButtonDescription": "સમતલ બટન દબાવવા પર ઇંક સ્પ્લૅશ બતાવે છે પરંતુ તે ઉપસી આવતું નથી. ટૂલબાર પર, સંવાદમાં અને પૅડિંગની સાથે ઇનલાઇનમાં સમતલ બટનનો ઉપયોગ કરો",
"demoBottomNavigationDescription": "બોટમ નૅવિગેશન બાર સ્ક્રીનના તળિયે ત્રણથી પાંચ સ્થાન બતાવે છે. દરેક સ્થાન આઇકન અને વૈકલ્પિક ટેક્સ્ટ લેબલ દ્વારા દર્શાવાય છે. બોટમ નૅવિગેશન આઇકન પર ટૅપ કરવામાં આવે, ત્યારે વપરાશકર્તાને તે આઇકન સાથે સંકળાયેલા ટોચના સ્તરના નૅવિગેશન સ્થાન પર લઈ જવામાં આવે છે.",
"demoBottomNavigationSelectedLabel": "પસંદ કરેલું લેબલ",
"demoBottomNavigationPersistentLabels": "પર્સીસ્ટન્ટ લેબલ",
"starterAppDrawerItem": "આઇટમ {value}",
"demoTextFieldRequiredField": "* ફરજિયાત ફીલ્ડ સૂચવે છે",
"demoBottomNavigationTitle": "બોટમ નૅવિગેશન",
"settingsLightTheme": "આછી",
"settingsTheme": "થીમ",
"settingsPlatformIOS": "iOS",
"settingsPlatformAndroid": "Android",
"settingsTextDirectionRTL": "RTL",
"settingsTextScalingHuge": "વિશાળ",
"cupertinoButton": "બટન",
"settingsTextScalingNormal": "સામાન્ય",
"settingsTextScalingSmall": "નાનું",
"settingsSystemDefault": "સિસ્ટમ",
"settingsTitle": "સેટિંગ",
"rallyDescription": "વ્યક્તિગત નાણાંકીય આયોજન માટેની ઍપ",
"aboutDialogDescription": "આ ઍપનો સૉર્સ કોડ જોવા માટે, કૃપા કરીને {repoLink}ની મુલાકાત લો.\n",
"bottomNavigationCommentsTab": "કૉમેન્ટ",
"starterAppGenericBody": "મુખ્ય ભાગ",
"starterAppGenericHeadline": "હેડલાઇન",
"starterAppGenericSubtitle": "ઉપશીર્ષક",
"starterAppGenericTitle": "શીર્ષક",
"starterAppTooltipSearch": "Search",
"starterAppTooltipShare": "શેર કરો",
"starterAppTooltipFavorite": "મનપસંદ",
"starterAppTooltipAdd": "ઉમેરો",
"bottomNavigationCalendarTab": "Calendar",
"starterAppDescription": "પ્રતિભાવ આપતું સ્ટાર્ટર લેઆઉટ",
"starterAppTitle": "સ્ટાર્ટર ઍપ",
"aboutFlutterSamplesRepo": "Flutter samples GitHub repo",
"bottomNavigationContentPlaceholder": "{title} ટૅબ માટેનું પ્લેસહોલ્ડર",
"bottomNavigationCameraTab": "કૅમેરા",
"bottomNavigationAlarmTab": "એલાર્મ",
"bottomNavigationAccountTab": "એકાઉન્ટ",
"demoTextFieldYourEmailAddress": "તમારું ઇમેઇલ ઍડ્રેસ",
"demoToggleButtonDescription": "સંબંધિત વિકલ્પોનું ગ્રૂપ બનાવવા માટે ટૉગલ બટનનો ઉપયોગ કરી શકાય છે. સંબંધિત ટૉગલ બટનના ગ્રૂપ પર ભાર આપવા માટે, ગ્રૂપે એક કૉમન કન્ટેનર શેર કરવું જોઈએ",
"colorsGrey": "રાખોડી",
"colorsBrown": "તપખીરિયો રંગ",
"colorsDeepOrange": "ઘાટો નારંગી",
"colorsOrange": "નારંગી",
"colorsAmber": "અંબર",
"colorsYellow": "પીળો",
"colorsLime": "લિંબુડિયો",
"colorsLightGreen": "આછો લીલો",
"colorsGreen": "લીલો",
"homeHeaderGallery": "ગૅલેરી",
"homeHeaderCategories": "કૅટેગરી",
"shrineDescription": "છૂટક વેચાણ માટેની ફેશનેબલ ઍપ",
"craneDescription": "તમને મનગમતી બનાવાયેલી પ્રવાસ માટેની ઍપ",
"homeCategoryReference": "શૈલી અને અન્ય",
"demoInvalidURL": "URL બતાવી શકાયું નથી:",
"demoOptionsTooltip": "વિકલ્પો",
"demoInfoTooltip": "માહિતી",
"demoCodeTooltip": "ડેમો કોડ",
"demoDocumentationTooltip": "API દસ્તાવેજો",
"demoFullscreenTooltip": "પૂર્ણ સ્ક્રીન",
"settingsTextScaling": "ટેક્સ્ટનું કદ",
"settingsTextDirection": "ટેક્સ્ટની દિશા",
"settingsLocale": "લોકેલ",
"settingsPlatformMechanics": "પ્લૅટફૉર્મ મેકૅનિક્સ",
"settingsDarkTheme": "ઘેરી",
"settingsSlowMotion": "સ્લો મોશન",
"settingsAbout": "Flutter Gallery વિશે",
"settingsFeedback": "પ્રતિસાદ મોકલો",
"settingsAttribution": "લંડનમાં TOASTER દ્વારા ડિઝાઇન કરાયેલ",
"demoButtonTitle": "બટન",
"demoButtonSubtitle": "ટેક્સ્ટ, ઉપર ચડાવેલું, આઉટલાઇન, અને ઘણું બધું",
"demoFlatButtonTitle": "સમતલ બટન",
"demoRaisedButtonDescription": "ઉપસેલા બટન મોટાભાગના સમતલ લેઆઉટ પર પરિમાણ ઉમેરે છે. તે વ્યસ્ત અથવા વ્યાપક સ્થાનો પર ફંક્શન પર ભાર આપે છે.",
"demoRaisedButtonTitle": "ઉપસેલું બટન",
"demoOutlineButtonTitle": "આઉટલાઇન બટન",
"demoOutlineButtonDescription": "આઉટલાઇન બટન દબાવવા પર અપારદર્શી બને છે અને તે ઉપસી આવે છે. વૈકલ્પિક, ગૌણ ક્રિયા બતાવવા માટે અવારનવાર ઉપસેલા બટન સાથે તેઓનું જોડાણ બનાવવામાં આવે છે.",
"demoToggleButtonTitle": "ટૉગલ બટન",
"colorsTeal": "મોરપીચ્છ",
"demoFloatingButtonTitle": "ફ્લોટિંગ ઍક્શન બટન",
"demoFloatingButtonDescription": "ફ્લોટિંગ ઍક્શન બટન એ એક સર્ક્યુલર આઇકન બટન છે જે ઍપમાં મુખ્ય ક્રિયાનો પ્રચાર કરવા માટે કન્ટેન્ટ પર હૉવર કરે છે.",
"demoDialogTitle": "સંવાદો",
"demoDialogSubtitle": "સરળ, અલર્ટ અને પૂર્ણસ્ક્રીન",
"demoAlertDialogTitle": "અલર્ટ",
"demoAlertDialogDescription": "અલર્ટ સંવાદ વપરાશકર્તાને જ્યાં સંમતિ જરૂરી હોય એવી સ્થિતિઓ વિશે સૂચિત કરે છે. અલર્ટ સંવાદમાં વૈકલ્પિક શીર્ષક અને ક્રિયાઓની વૈકલ્પિક સૂચિ હોય છે.",
"demoAlertTitleDialogTitle": "શીર્ષકની સાથે અલર્ટ",
"demoSimpleDialogTitle": "સરળ",
"demoSimpleDialogDescription": "સરળ સંવાદ વપરાશકર્તાને ઘણા વિકલ્પો વચ્ચે પસંદગીની તક આપે છે. સરળ સંવાદમાં વૈકલ્પિક શીર્ષક હોય છે જે વિકલ્પોની ઉપર બતાવવામાં આવે છે.",
"demoFullscreenDialogTitle": "પૂર્ણસ્ક્રીન",
"demoCupertinoButtonsTitle": "બટન",
"demoCupertinoButtonsSubtitle": "iOS-શૈલીના બટન",
"demoCupertinoButtonsDescription": "iOS-શૈલીનું બટન. તે ટેક્સ્ટ અને/અથવા આઇકનનો ઉપયોગ કરે છે કે જે સ્પર્શ કરવા પર ઝાંખું થાય છે તથા ઝાંખું નથી થતું. તેમાં વૈકલ્પિક રૂપે બૅકગ્રાઉન્ડ હોઈ શકે છે.",
"demoCupertinoAlertsTitle": "અલર્ટ",
"demoCupertinoAlertsSubtitle": "iOS-શૈલીના અલર્ટ સંવાદ",
"demoCupertinoAlertTitle": "અલર્ટ",
"demoCupertinoAlertDescription": "અલર્ટ સંવાદ વપરાશકર્તાને જ્યાં સંમતિ જરૂરી હોય એવી સ્થિતિઓ વિશે સૂચિત કરે છે. અલર્ટ સંવાદમાં વૈકલ્પિક શીર્ષક, વૈકલ્પિક કન્ટેન્ટ અને ક્રિયાઓની વૈકલ્પિક સૂચિ હોય છે. શીર્ષક, કન્ટેન્ટની ઉપર બતાવવામાં આવે છે અને ક્રિયાઓ, કન્ટેન્ટની નીચે બતાવવામાં આવે છે.",
"demoCupertinoAlertWithTitleTitle": "શીર્ષકની સાથે અલર્ટ",
"demoCupertinoAlertButtonsTitle": "બટનની સાથે અલર્ટ",
"demoCupertinoAlertButtonsOnlyTitle": "ફક્ત અલર્ટ બટન",
"demoCupertinoActionSheetTitle": "ઍક્શન શીટ",
"demoCupertinoActionSheetDescription": "ઍક્શન શીટ એ અલર્ટની એક ચોક્કસ શૈલી છે જે વપરાશકર્તા સમક્ષ વર્તમાન સંદર્ભથી સંબંધિત બે કે તેથી વધુ વિકલ્પોનો સેટ પ્રસ્તુત કરે છે. ઍક્શન શીટમાં શીર્ષક, વૈકલ્પિક સંદેશ અને ક્રિયાઓની સૂચિ હોય શકે છે.",
"demoColorsTitle": "રંગો",
"demoColorsSubtitle": "તમામ પૂર્વનિર્ધારિત રંગ",
"demoColorsDescription": "સામગ્રીની ડિઝાઇનના વિવિધ રંગનું પ્રતિનિધિત્વ કરતા રંગ અને રંગ સ્વૉચ કૉન્સ્ટન્ટ.",
"buttonTextEnabled": "ENABLED",
"buttonTextDisabled": "DISABLED",
"buttonTextCreate": "બનાવો",
"dialogSelectedOption": "તમે પસંદ કર્યું: \"{value}\"",
"dialogDiscardTitle": "ડ્રાફ્ટ કાઢી નાખવો છે?",
"dialogLocationTitle": "Googleની સ્થાન સેવાનો ઉપયોગ કરીએ?",
"dialogLocationDescription": "Googleને સ્થાન નિર્ધારિત કરવામાં ઍપની સહાય કરવા દો. આનો અર્થ છે જ્યારે કોઈ ઍપ ચાલી ન રહી હોય ત્યારે પણ Googleને અનામ સ્થાન ડેટા મોકલવો.",
"dialogCancel": "રદ કરો",
"dialogDiscard": "કાઢી નાખો",
"dialogDisagree": "અસંમત",
"dialogAgree": "સંમત",
"dialogSetBackup": "બૅકઅપ એકાઉન્ટ સેટ કરો",
"colorsBlueGrey": "વાદળી ગ્રે",
"dialogShow": "સંવાદ બતાવો",
"dialogFullscreenTitle": "પૂર્ણ-સ્ક્રીન સંવાદ",
"dialogFullscreenSave": "સાચવો",
"dialogFullscreenDescription": "પૂર્ણ-સ્ક્રીન સંવાદ ડેમો",
"cupertinoButtonEnabled": "Enabled",
"cupertinoButtonDisabled": "Disabled",
"cupertinoButtonWithBackground": "બૅકગ્રાઉન્ડની સાથે",
"cupertinoAlertCancel": "રદ કરો",
"cupertinoAlertDiscard": "કાઢી નાખો",
"cupertinoAlertLocationTitle": "તમે ઍપનો ઉપયોગ કરી રહ્યાં હો તે વખતે \"Maps\"ને તમારા સ્થાનના ઍક્સેસની મંજૂરી આપીએ?",
"cupertinoAlertLocationDescription": "નકશા પર તમારું વર્તમાન સ્થાન બતાવવામાં આવશે અને દિશા નિર્દેશો, નજીકના શોધ પરિણામ અને મુસાફરીના અંદાજિત સમયને બતાવવા માટે તેનો ઉપયોગ કરવામાં આવશે.",
"cupertinoAlertAllow": "મંજૂરી આપો",
"cupertinoAlertDontAllow": "મંજૂરી આપશો નહીં",
"cupertinoAlertFavoriteDessert": "મનપસંદ મીઠાઈ પસંદ કરો",
"cupertinoAlertDessertDescription": "નીચેની સૂચિમાંથી કૃપા કરીને તમારા મનપસંદ પ્રકારની મીઠાઈને પસંદ કરો. તમારા ક્ષેત્રમાં રહેલી ખાવા-પીવાની દુકાનોની સૂચવેલી સૂચિને કસ્ટમાઇઝ કરવા માટે તમારી પસંદગીનો ઉપયોગ કરવામાં આવશે.",
"cupertinoAlertCheesecake": "ચીઝકેક",
"cupertinoAlertTiramisu": "ટિરામિસુ",
"cupertinoAlertApplePie": "એપલ પાઇ",
"cupertinoAlertChocolateBrownie": "ચોકલેટ બ્રાઉની",
"cupertinoShowAlert": "અલર્ટ બતાવો",
"colorsRed": "લાલ",
"colorsPink": "ગુલાબી",
"colorsPurple": "જાંબલી",
"colorsDeepPurple": "ઘાટો જાંબલી",
"colorsIndigo": "ઘેરો વાદળી રંગ",
"colorsBlue": "વાદળી",
"colorsLightBlue": "આછો વાદળી",
"colorsCyan": "સ્યાન",
"dialogAddAccount": "એકાઉન્ટ ઉમેરો",
"Gallery": "ગૅલેરી",
"Categories": "કૅટેગરી",
"SHRINE": "સમાધિ",
"Basic shopping app": "મૂળભૂત શોપિંગ ઍપ",
"RALLY": "રૅલી",
"CRANE": "ક્રેન",
"Travel app": "મુસાફરી માટેની ઍપ",
"MATERIAL": "MATERIAL",
"CUPERTINO": "CUPERTINO",
"REFERENCE STYLES & MEDIA": "સંદર્ભ શૈલીઓ અને મીડિયા"
}
| gallery/lib/l10n/intl_gu.arb/0 | {
"file_path": "gallery/lib/l10n/intl_gu.arb",
"repo_id": "gallery",
"token_count": 65377
} | 841 |
{
"loading": "ກຳລັງໂຫຼດ",
"deselect": "ເຊົາເລືອກ",
"select": "ເລືອກ",
"selectable": "ສາມາດເລືອກໄດ້ (ກົດຄ້າງໄວ້)",
"selected": "ເລືອກແລ້ວ",
"demo": "ເດໂມ",
"bottomAppBar": "ແຖບທາງລຸ່ມຂອງແອັບ",
"notSelected": "ບໍ່ໄດ້ເລືອກ",
"demoCupertinoSearchTextFieldTitle": "ຫ້ອງປ້ອນຂໍ້ຄວາມການຄົ້ນຫາ",
"demoCupertinoPicker": "ຕົວເລືອກ",
"demoCupertinoSearchTextFieldSubtitle": "ຫ້ອງປ້ອນຂໍ້ຄວາມການຄົ້ນຫາຮູບແບບ iOS",
"demoCupertinoSearchTextFieldDescription": "ຫ້ອງປ້ອນຂໍ້ຄວາມການຄົ້ນຫາທີ່ຊ່ວຍໃຫ້ຜູ້ໃຊ້ຄົ້ນຫາໄດ້ໂດຍການປ້ອນຂໍ້ຄວາມ ແລະ ຍັງສາມາດສະເໜີ ແລະ ກັ່ນຕອງການແນະນຳໄດ້.",
"demoCupertinoSearchTextFieldPlaceholder": "ປ້ອນຂໍ້ຄວາມ",
"demoCupertinoScrollbarTitle": "ແຖບເລື່ອນ",
"demoCupertinoScrollbarSubtitle": "ແຖບເລື່ອນຮູບແບບ iOS",
"demoCupertinoScrollbarDescription": "ແຖບເລື່ອນທີ່ຮວມອົງປະກອບຍ່ອຍທີ່ລະບຸ",
"demoTwoPaneItem": "ລາຍການ {value}",
"demoTwoPaneList": "ລາຍຊື່",
"demoTwoPaneFoldableLabel": "ພັບໄດ້",
"demoTwoPaneSmallScreenLabel": "ຈໍນ້ອຍ",
"demoTwoPaneSmallScreenDescription": "ນີ້ແມ່ນວິທີທີ່ TwoPane ເຮັດວຽກຢູ່ອຸປະກອນຈໍນ້ອຍ.",
"demoTwoPaneTabletLabel": "ແທັບເລັດ / ເດັສທັອບ",
"demoTwoPaneTabletDescription": "ນີ້ແມ່ນວິທີທີ່ TwoPane ເຮັດວຽກຢູ່ໜ້າຈໍໃຫຍ່ຂຶ້ນ ເຊັ່ນ: ແທັບເລັດ ຫຼື ເດັສທັອບ.",
"demoTwoPaneTitle": "TwoPane",
"demoTwoPaneSubtitle": "ໂຄງຮ່າງແບບ responsive ຢູ່ອຸປະກອນທີ່ພັບໄດ້, ໜ້າຈໍໃຫຍ່ ແລະ ນ້ອຍ",
"splashSelectDemo": "ເລືອກເດໂມ",
"demoTwoPaneFoldableDescription": "ນີ້ແມ່ນວິທີທີ່ TwoPane ເຮັດວຽກຢູ່ອຸປະກອນທີ່ພັບໄດ້.",
"demoTwoPaneDetails": "ລາຍລະອຽດ",
"demoTwoPaneSelectItem": "ເລືອກລາຍການໃດໜຶ່ງ",
"demoTwoPaneItemDetails": "ລາຍລະອຽດລາຍການ {value}",
"demoCupertinoContextMenuActionText": "ແຕະໃສ່ໂລໂກ້ Flutter ຄ້າງໄວ້ເພື່ອເບິ່ງເມນູບໍລິບົດ.",
"demoCupertinoContextMenuDescription": "ເມນູບໍລິບົດແບບເຕັມຈໍຮູບແບບ iOS ທີ່ປາກົດເມື່ອກົດໃສ່ອົງປະກອບໃດໜຶ່ງຄ້າງໄວ້.",
"demoAppBarTitle": "ແອັບບາ",
"demoAppBarDescription": "ແຖບແອັບຈະສະແດງເນື້ອຫາ ແລະ ຄຳສັ່ງຕ່າງໆທີ່ກ່ຽວຂ້ອງກັບໜ້າຈໍປັດຈຸບັນ. ມັນໃຊ້ສຳລັບການສ້າງແບຣນ, ຊື່ໜ້າຈໍ, ການນຳທາງ ແລະ ຄຳສັ່ງຕ່າງໆ",
"demoDividerTitle": "ຕົວຂັ້ນ",
"demoDividerSubtitle": "ຕົວຂັ້ນແມ່ນເສັ້ນບາງໆທີ່ຈັດກຸ່ມເນື້ອຫາໄວ້ໃນລາຍຊື່ ແລະ ໂຄງຮ່າງຕ່າງໆ.",
"demoDividerDescription": "ສາມາດໃຊ້ຕົວຂັ້ນໃນລາຍຊື່, ລິ້ນຊັກ ແລະ ບ່ອນອື່ນໆເພື່ອແຍກເນື້ອຫາໄດ້.",
"demoVerticalDividerTitle": "ຕົວຂັ້ນລວງຕັ້ງ",
"demoCupertinoContextMenuTitle": "ເມນູບໍລິບົດ",
"demoCupertinoContextMenuSubtitle": "ເມນູບໍລິບົດຮູບແບບ iOS",
"demoAppBarSubtitle": "ສະແດງຂໍ້ມູນ ແລະ ຄຳສັ່ງຕ່າງໆທີ່ກ່ຽວຂ້ອງກັບໜ້າຈໍປັດຈຸບັນ",
"demoCupertinoContextMenuActionOne": "ຄຳສັ່ງໜຶ່ງ",
"demoCupertinoContextMenuActionTwo": "ຄຳສັ່ງສອງ",
"demoDateRangePickerDescription": "ສະແດງກ່ອງໂຕ້ຕອບທີ່ມີຕົວເລືອກໄລຍະວັນທີແບບ Material Design.",
"demoDateRangePickerTitle": "ຕົວເລືອກໄລຍະວັນທີ",
"demoNavigationDrawerUserName": "ຊື່ຜູ້ໃຊ້",
"demoNavigationDrawerUserEmail": "[email protected]",
"demoNavigationDrawerText": "ປັດຈາກຂອບ ຫຼື ແຕະໃສ່ໄອຄອນຂວາເທິງເພື່ອເບິ່ງລິ້ນຊັກ",
"demoNavigationRailTitle": "ລາງການນຳທາງ",
"demoNavigationRailSubtitle": "ການສະແດງລາງການນຳທາງພາຍໃນແອັບໃດໜຶ່ງ",
"demoNavigationRailDescription": "ວິດເຈັດ material ແມ່ນໃຊ້ເພື່ອສະແດງຢູ່ທາງຊ້າຍ ຫຼື ຂວາຂອງແອັບໃດໜຶ່ງເພື່ອເລື່ອນໄປມາລະຫວ່າງມຸມມອງຈຳນວນໜຶ່ງ, ໂດຍປົກກະຕິແລ້ວແມ່ນສອງຫາສາມມຸມມອງ.",
"demoNavigationRailFirst": "ໜຶ່ງ",
"demoNavigationDrawerTitle": "ແຜງການນຳທາງ",
"demoNavigationRailThird": "ທີສາມ",
"replyStarredLabel": "ຕິດດາວ",
"demoTextButtonDescription": "ປຸ່ມຂໍ້ຄວາມຈະສະແດງຮອຍແຕ້ມໝຶກເມື່ອກົດແຕ່ຈະບໍ່ຍົກຂຶ້ນ. ໃຊ້ປຸ່ມຂໍ້ຄວາມຢູ່ແຖບເຄື່ອງມື, ໃນກ່ອງໂຕ້ຕອບ ແລະ ໃນແຖວທີ່ມີໄລຍະຫ່າງຈາກຂອບ.",
"demoElevatedButtonTitle": "ປຸ່ມຍົກຂຶ້ນ",
"demoElevatedButtonDescription": "ປຸ່ມຍົກຂຶ້ນຈະເພີ່ມມິຕິໃຫ້ກັບໂຄງຮ່າງທີ່ສ່ວນໃຫຍ່ຮາບພຽງ. ພວກມັນຈະເນັ້ນຟັງຊັນຕ່າງໆທີ່ສຳຄັນໃນພື້ນທີ່ກວ້າງ ຫຼື ມີການໃຊ້ວຽກຫຼາຍ.",
"demoOutlinedButtonTitle": "ປຸ່ມມີຂອບ",
"demoOutlinedButtonDescription": "ປຸ່ມມີຂອບຈະເປັນສີທຶບ ແລະ ຍົກຂຶ້ນເມື່ອກົດໃສ່. ມັກຈະຈັບຄູ່ກັບປຸ່ມແບບຍົກຂຶ້ນເພື່ອລະບຸວ່າມີການດຳເນີນການສຳຮອງຢ່າງອື່ນ.",
"demoContainerTransformDemoInstructions": "ບັດ, ລາຍຊື່ ແລະ FAB",
"demoNavigationDrawerSubtitle": "ການສະແດງລິ້ນຊັກພາຍໃນແຖບແອັບ",
"replyDescription": "ແອັບທີ່ເນັ້ນອີເມວຢ່າງມີປະສິດທິພາບ",
"demoNavigationDrawerDescription": "ແຜງ Material Design ທີ່ເລື່ອນເຂົ້າມາທາງລວງນອນຈາກຂອບຈໍເພື່ອສະແດງລິ້ງການນຳທາງໃນແອັບພລິເຄຊັນໃດໜຶ່ງ.",
"replyDraftsLabel": "ສະບັບຮ່າງ",
"demoNavigationDrawerToPageOne": "ລາຍການໜຶ່ງ",
"replyInboxLabel": "ອິນບັອກ",
"demoSharedXAxisDemoInstructions": "ປຸ່ມຕໍ່ໄປ ແລະ ກັບຄືນ",
"replySpamLabel": "ສະແປມ",
"replyTrashLabel": "ຖັງຂີ້ເຫຍື້ອ",
"replySentLabel": "ສົ່ງແລ້ວ",
"demoNavigationRailSecond": "ສອງ",
"demoNavigationDrawerToPageTwo": "ລາຍການສອງ",
"demoFadeScaleDemoInstructions": "Modal ແລະ FAB",
"demoFadeThroughDemoInstructions": "ການນຳທາງລຸ່ມສຸດ",
"demoSharedZAxisDemoInstructions": "ປຸ່ມໄອຄອນການຕັ້ງຄ່າ",
"demoSharedYAxisDemoInstructions": "ຈັດຮຽງຕາມ \"ຫຼິ້ນຫຼ້າສຸດ\"",
"demoTextButtonTitle": "ປຸ່ມຂໍ້ຄວາມ",
"demoSharedZAxisBeefSandwichRecipeTitle": "ແຊນວິດງົວ",
"demoSharedZAxisDessertRecipeDescription": "ສູດຂອງຫວານ",
"demoSharedYAxisAlbumTileSubtitle": "ສິນລະປິນ",
"demoSharedYAxisAlbumTileTitle": "ອະລະບໍ້າ",
"demoSharedYAxisRecentSortTitle": "ຫຼິ້ນບໍ່ດົນມານີ້",
"demoSharedYAxisAlphabeticalSortTitle": "A-Z",
"demoSharedYAxisAlbumCount": "268 ອະລະບ້ຳ",
"demoSharedYAxisTitle": "ແກນ y ທີ່ແບ່ງປັນ",
"demoSharedXAxisCreateAccountButtonText": "ສ້າງບັນຊີ",
"demoFadeScaleAlertDialogDiscardButton": "ຍົກເລີກ",
"demoSharedXAxisSignInTextFieldLabel": "ອີເມວ ຫຼື ເບີໂທລະສັບ",
"demoSharedXAxisSignInSubtitleText": "ເຂົ້າສູ່ລະບົບຫາບັນຊີຂອງທ່ານ",
"demoSharedXAxisSignInWelcomeText": "ສະບາຍດີ David Park",
"demoSharedXAxisIndividualCourseSubtitle": "ສະແດງແຍກກັນ",
"demoSharedXAxisBundledCourseSubtitle": "ເປັນຊຸດ",
"demoFadeThroughAlbumsDestination": "ອະລະບ້ຳ",
"demoSharedXAxisDesignCourseTitle": "ການອອກແບບ",
"demoSharedXAxisIllustrationCourseTitle": "ຮູບປະກອບ",
"demoSharedXAxisBusinessCourseTitle": "ທຸລະກິດ",
"demoSharedXAxisArtsAndCraftsCourseTitle": "ສິນລະປະ ແລະ ງານສີມື",
"demoMotionPlaceholderSubtitle": "ຂໍ້ຄວາມສຳຮອງ",
"demoFadeScaleAlertDialogCancelButton": "ຍົກເລີກ",
"demoFadeScaleAlertDialogHeader": "ກ່ອງໂຕ້ຕອບການແຈ້ງເຕືອນ",
"demoFadeScaleHideFabButton": "ເຊື່ອງ FAB",
"demoFadeScaleShowFabButton": "ສະແດງ FAB",
"demoFadeScaleShowAlertDialogButton": "ສະແດງ",
"demoFadeScaleDescription": "ຮູບແບບຈາງແມ່ນໃຊ້ສຳລັບອົງປະກອບສ່ວນຕິດຕໍ່ຜູ້ໃຊ້ທີ່ເຂົ້າ ຫຼື ອອກພາຍໃນຂອບຂອງໜ້າຈໍ ເຊັ່ນ: ກ່ອງໂຕ້ຕອບທີ່ຈາງເຂົ້າໄປທາງກາງຂອງຈໍ.",
"demoFadeScaleTitle": "ຈາງ",
"demoFadeThroughTextPlaceholder": "123 ຮູບ",
"demoFadeThroughSearchDestination": "ຊອກຫາ",
"demoFadeThroughPhotosDestination": "ຮູບພາບ",
"demoSharedXAxisCoursePageSubtitle": "ໝວດໝູ່ທີ່ຮວມຈະປາກົດເປັນກຸ່ມໃນຟີດຂອງທ່ານ. ທ່ານສາມາດປ່ຽນຕົວເລືອກນີ້ໄດ້ທຸກເມື່ອໃນພາຍຫຼັງ.",
"demoFadeThroughDescription": "ຮູບແບບຈາງຫາຍແມ່ນໃຊ້ສຳລັບການປ່ຽນລະຫວ່າງອົງປະກອບສ່ວນຕິດຕໍ່ຜູ້ໃຊ້ທີ່ບໍ່ມີຄວາມສຳພັນໜັກແນ້ນຕໍ່ກັນແລະກັນ.",
"demoFadeThroughTitle": "ຈາງຫາຍ",
"demoSharedZAxisHelpSettingLabel": "ຊ່ວຍເຫຼືອ",
"demoMotionSubtitle": "ຮູບແບບການປ່ຽນທີ່ກຳນົດໄວ້ລ່ວງໜ້າທັງໝົດ",
"demoSharedZAxisNotificationSettingLabel": "ການແຈ້ງເຕືອນ",
"demoSharedZAxisProfileSettingLabel": "ໂປຣໄຟລ໌",
"demoSharedZAxisSavedRecipesListTitle": "ສູດອາຫານທີ່ບັນທຶກໄວ້",
"demoSharedZAxisBeefSandwichRecipeDescription": "ສູດແຊນວິດງົວ",
"demoSharedZAxisCrabPlateRecipeDescription": "ສູດອາຫານປູ",
"demoSharedXAxisCoursePageTitle": "ເພີ່ມປະສິດທິພາບຫຼັກສູດຂອງທ່ານ",
"demoSharedZAxisCrabPlateRecipeTitle": "ກະປູ",
"demoSharedZAxisShrimpPlateRecipeDescription": "ສູດອາຫານກຸ້ງ",
"demoSharedZAxisShrimpPlateRecipeTitle": "ກຸ້ງ",
"demoContainerTransformTypeFadeThrough": "ຈາງຫາຍ",
"demoSharedZAxisDessertRecipeTitle": "ຂອງຫວານ",
"demoSharedZAxisSandwichRecipeDescription": "ສູດແຊນວິດ",
"demoSharedZAxisSandwichRecipeTitle": "ແຊນວິດ",
"demoSharedZAxisBurgerRecipeDescription": "ສູດເບີເກີ",
"demoSharedZAxisBurgerRecipeTitle": "ເບີເກີ",
"demoSharedZAxisSettingsPageTitle": "ການຕັ້ງຄ່າ",
"demoSharedZAxisTitle": "ແກນ z ທີ່ແບ່ງປັນ",
"demoSharedZAxisPrivacySettingLabel": "ຄວາມເປັນສ່ວນຕົວ",
"demoMotionTitle": "ໂມຊັນ",
"demoContainerTransformTitle": "ການປ່ຽນກ່ອງບັນຈຸ",
"demoContainerTransformDescription": "ຮູບແບບການປ່ຽນຕົວບັນຈຸແມ່ນອອກແບບມາສຳລັບການປ່ຽນລະຫວ່າງອົງປະກອບສ່ວນຕິດຕໍ່ຜູ້ໃຊ້ທີ່ມີກ່ອງບັນຈຸໃດໜຶ່ງ. ຮູບແບບນີ້ຈະສ້າງການເຊື່ອມຕໍ່ທີ່ເບິ່ງເຫັນໄດ້ລະຫວ່າງອົງປະກອບສ່ວນຕິດຕໍ່ຜູ້ໃຊ້ສອງອັນ",
"demoContainerTransformModalBottomSheetTitle": "ໂໝດຈາງ",
"demoContainerTransformTypeFade": "ຈາງ",
"demoSharedYAxisAlbumTileDurationUnit": "ນທ",
"demoMotionPlaceholderTitle": "ຫົວຂໍ້",
"demoSharedXAxisForgotEmailButtonText": "ລືມອີເມວບໍ?",
"demoMotionSmallPlaceholderSubtitle": "ສຳຮອງ",
"demoMotionDetailsPageTitle": "ໜ້າລາຍລະອຽດ",
"demoMotionListTileTitle": "ລາຍການລາຍຊື່",
"demoSharedAxisDescription": "ຮູບແບບແກນທີ່ແບ່ງປັນແມ່ນຖືກໃຊ້ສຳລັບການປ່ຽນລະຫວ່າງອົງປະກອບສ່ວນຕິດຕໍ່ຜູ້ໃຊ້ທີ່ມີຄວາມສຳພັນກ່ຽວກັບການນຳທາງ ຫຼື ຕຳແໜ່ງ. ຮູບແບບນີ້ໃຊ້ຂໍ້ມູນທີ່ແບ່ງປັນຢູ່ແກນ x, y ຫຼື z ເພື່ອສະໜັບສະໜຸນຄວາມສຳພັນລະຫວ່າງອົງປະກອບຕ່າງໆ.",
"demoSharedXAxisTitle": "ແກນ x ທີ່ແບ່ງປັນ",
"demoSharedXAxisBackButtonText": "ກັບຄືນ",
"demoSharedXAxisNextButtonText": "ຕໍ່ໄປ",
"demoSharedXAxisCulinaryCourseTitle": "ການຄົວກິນ",
"githubRepo": "ບ່ອນເກັບຂໍ້ມູນ {repoName} GitHub",
"fortnightlyMenuUS": "ສະຫະລັດ",
"fortnightlyMenuBusiness": "ທຸລະກິດ",
"fortnightlyMenuScience": "ວິທະຍາສາດ",
"fortnightlyMenuSports": "ກິລາ",
"fortnightlyMenuTravel": "ທ່ອງທ່ຽວ",
"fortnightlyMenuCulture": "ວັດທະນະທຳ",
"fortnightlyTrendingTechDesign": "ອອກແບບເທັກໂນໂລຢີ",
"rallyBudgetDetailAmountLeft": "ຈຳນວນທີ່ຍັງເຫຼືອ",
"fortnightlyHeadlineArmy": "ການປະຕິຮູບກອງທັບຂຽວຈາກພາຍໃນ",
"fortnightlyDescription": "ແອັບຂ່າວທີ່ເນັ້ນເນື້ອຫາ",
"rallyBillDetailAmountDue": "ຈຳນວນທີ່ຕ້ອງຈ່າຍ",
"rallyBudgetDetailTotalCap": "ຄວາມຈຸທັງໝົດ",
"rallyBudgetDetailAmountUsed": "ຈຳນວນທີ່ໃຊ້ໄປແລ້ວ",
"fortnightlyTrendingHealthcareRevolution": "ວິວັດທະນາການສຸຂະພາບ",
"fortnightlyMenuFrontPage": "ໜ້າຫຼັກ",
"fortnightlyMenuWorld": "ໂລກ",
"rallyBillDetailAmountPaid": "ຈຳນວນທີ່ຈ່າຍແລ້ວ",
"fortnightlyMenuPolitics": "ການເມືອງ",
"fortnightlyHeadlineBees": "ເຜິ້ງໃນຟາມກຳລັງຂາດຕະຫຼາດ",
"fortnightlyHeadlineGasoline": "ອະນາຄົດຂອງນ້ຳມັນເຊື້ອໄຟ",
"fortnightlyTrendingGreenArmy": "ກອງທັບຂຽວ",
"fortnightlyHeadlineFeminists": "ຄວາມເຫັນແມ່ຍິງຕໍ່ການແບ່ງແຍກ",
"fortnightlyHeadlineFabrics": "ນັກອອກແບບໃຊ້ເທັກໂນໂລຢີໃນການສ້າງຜ້າແຫ່ງອະນາຄົດ",
"fortnightlyHeadlineStocks": "ເມື່ອຮຸ້ນຊົບເຊົາ, ຫຼາຍຄົນກໍສົນໃຈສະກຸນເງິນ",
"fortnightlyTrendingReform": "ປະຕິຮູບ",
"fortnightlyMenuTech": "ເທັກໂນໂລຢີ",
"fortnightlyHeadlineWar": "ຊາວອະເມຣິກັນທີ່ຖືກແບ່ງແຍກໃນຊ່ວງສົງຄາມ",
"fortnightlyHeadlineHealthcare": "ວິວັດທະນາການທີ່ງຽບແຕ່ຊົງພະລັງດ້ານສຸຂະພາບ",
"fortnightlyLatestUpdates": "ອັບເດດຫຼ້າສຸດ",
"fortnightlyTrendingStocks": "ຮຸ້ນ",
"rallyBillDetailTotalAmount": "ຈຳນວນຮວມ",
"demoCupertinoPickerDateTime": "ວັນທີແລະເວລາ",
"signIn": "ເຂົ້າສູ່ລະບົບ",
"dataTableRowWithSugar": "{value} ໃສ່ນ້ຳຕານ",
"dataTableRowApplePie": "ພາຍໝາກໂປ່ມ",
"dataTableRowDonut": "ໂດນັດ",
"dataTableRowHoneycomb": "ຮັງເຜິ້ງ",
"dataTableRowLollipop": "ໂລລິປັອບ",
"dataTableRowJellyBean": "ເຈລີບີນ",
"dataTableRowGingerbread": "ເຂົ້າຈີ່ຂິງ",
"dataTableRowCupcake": "ຄັບເຄັກ",
"dataTableRowEclair": "ເອແຄ",
"dataTableRowIceCreamSandwich": "ໄອສະຄຣີມແຊນວິດ",
"dataTableRowFrozenYogurt": "ນົມສົ້ມແຊ່ແຂັງ",
"dataTableColumnIron": "ເຫຼັກ (%)",
"dataTableColumnCalcium": "ແຄຊຽມ (%)",
"dataTableColumnSodium": "ໂຊດຽມ (mg)",
"demoTimePickerTitle": "ຕົວເລືອກເວລາ",
"demo2dTransformationsResetTooltip": "ຣີເຊັດການປັບປ່ຽນ",
"dataTableColumnFat": "ໄຂມັນ (g)",
"dataTableColumnCalories": "ແຄລໍຣີ",
"dataTableColumnDessert": "ຂອງຫວານ (ສຳລັບ 1 ຄົນ)",
"cardsDemoTravelDestinationLocation1": "ທານຈາວູ, ທະມິນນາດູ",
"demoTimePickerDescription": "ສະແດງກ່ອງໂຕ້ຕອບທີ່ມີຕົວເລືອກເວລາແບບ Material Design.",
"demoPickersShowPicker": "ສະແດງຕົວເລືອກ",
"demoTabsScrollingTitle": "ເລື່ອນໄດ້",
"demoTabsNonScrollingTitle": "ເລື່ອນບໍ່ໄດ້",
"craneHours": "{hours,plural,=1{1ຊມ}other{{hours}ຊມ}}",
"craneMinutes": "{minutes,plural,=1{1ນທ}other{{minutes}ນທ}}",
"craneFlightDuration": "{hoursShortForm} {minutesShortForm}",
"dataTableHeader": "ໂພຊະນາການ",
"demoDatePickerTitle": "ຕົວເລືອກວັນທີ",
"demoPickersSubtitle": "ການເລືອກວັນທີ ແລະ ເວລາ",
"demoPickersTitle": "ຕົວເລືອກ",
"demo2dTransformationsEditTooltip": "ແກ້ໄຂແຜ່ນ",
"demoDataTableDescription": "ຕາຕະລາງຂໍ້ມູນຈະສະແດງຂໍ້ມູນໃນຮູບແບບຊ່ອງທີ່ປະກອບດ້ວຍແຖວ ແລະ ຖັນ. ພວກມັນຈະຈັດລະບຽບຂໍ້ມູນໃນແບບທີ່ສາມາດສະແກນໄດ້ງ່າຍ, ເພື່ອໃຫ້ຜູ້ໃຊ້ສາມາດຊອກຫາຮູບແບບ ແລະ ຂໍ້ມູນເຈາະເລິກໄດ້.",
"demo2dTransformationsDescription": "ແຕະເພື່ອແກ້ໄຂແຜ່ນ ແລະ ໃຊ້ທ່າທາງເພື່ອຍ້າຍໄປມາໃນສາກ. ລາກເພື່ອເລື່ອນ, ຖ່າງເພື່ອຊູມ, ໝຸນດ້ວຍສອງນິ້ວ. ກົດປຸ່ມຣີເຊັດເພື່ອກັບໄປຫາທິດທາງການເລີ່ມຕົ້ນ.",
"demo2dTransformationsSubtitle": "ເລື່ອນ, ຊູມ, ໝຸນ",
"demo2dTransformationsTitle": "ການປັບປ່ຽນ 2 ມິຕິ",
"demoCupertinoTextFieldPIN": "PIN",
"demoCupertinoTextFieldDescription": "ຊ່ອງຂໍ້ຄວາມທີ່ໃຫ້ຜູ້ໃຊ້ພິມຂໍ້ຄວາມຈາກແປ້ນພິມຮາດແວ ຫຼື ແປ້ນພິມຢູ່ໜ້າຈໍໄດ້.",
"demoCupertinoTextFieldSubtitle": "ຊ່ອງຂໍ້ຄວາມຮູບແບບ iOS",
"demoCupertinoTextFieldTitle": "ຊ່ອງຂໍ້ຄວາມ",
"demoDatePickerDescription": "ສະແດງກ່ອງໂຕ້ຕອບທີ່ມີຕົວເລືອກວັນທີແບບ Material Design.",
"demoCupertinoPickerTime": "ເວລາ",
"demoCupertinoPickerDate": "ວັນທີ",
"demoCupertinoPickerTimer": "ໂມງຈັບເວລາ",
"demoCupertinoPickerDescription": "ວິດເຈັດຕົວເລືອກຮູບແບບ iOS ທີ່ສາມາດໃຊ້ເພື່ອເລືອກສະຕຣິງ, ວັນທີ, ເວລາ ຫຼື ທັງວັນທີ ແລະ ເວລາໄດ້.",
"demoCupertinoPickerSubtitle": "ຕົວເລືອກຮູບແບບ iOS",
"demoCupertinoPickerTitle": "ຕົວເລືອກ",
"dataTableRowWithHoney": "{value} ໃສ່ນ້ຳເຜິ້ງ",
"cardsDemoTravelDestinationCity2": "ເຊຕິນາດ",
"bannerDemoResetText": "ຣີເຊັດແບນເນີ",
"bannerDemoMultipleText": "ຄຳສັ່ງຫຼາຍອັນ",
"bannerDemoLeadingText": "ໄອຄອນນຳ",
"dismiss": "ປິດໄວ້",
"cardsDemoTappable": "ສາມາດແຕະໄດ້",
"cardsDemoSelectable": "ສາມາດເລືອກໄດ້ (ກົດຄ້າງໄວ້)",
"cardsDemoExplore": "ສຳຫຼວດ",
"cardsDemoExploreSemantics": "ສຳຫຼວດ {destinationName}",
"cardsDemoShareSemantics": "ແບ່ງປັນ {destinationName}",
"cardsDemoTravelDestinationTitle1": "10 ເມືອງຕິດອັນດັບໃຫ້ໄປທ່ອງທ່ຽວໃນທະມິນນາດູ",
"cardsDemoTravelDestinationDescription1": "ໝາຍເລກ 10",
"cardsDemoTravelDestinationCity1": "ທານຈາວູ",
"dataTableColumnProtein": "ໂປຣຕີນ (g)",
"cardsDemoTravelDestinationTitle2": "ຊ່າງສີມືແຫ່ງອິນເດຍໃຕ້",
"cardsDemoTravelDestinationDescription2": "ເຄື່ອງປັ່ນໄໝ",
"bannerDemoText": "ລະຫັດຜ່ານຂອງທ່ານຖືກອັບເດດຢູ່ອຸປະກອນອື່ນແລ້ວ. ກະລຸນາເຂົ້າສູ່ລະບົບອີກເທື່ອໜຶ່ງ.",
"cardsDemoTravelDestinationLocation2": "ຊິວາກັນກາ, ທະມິນນາດູ",
"cardsDemoTravelDestinationTitle3": "ວັດບໍລິຫາດີສະວາຣາ",
"cardsDemoTravelDestinationDescription3": "ວັດ",
"demoBannerTitle": "ແບນເນີ",
"demoBannerSubtitle": "ກຳລັງສະແດງແບນເນີພາຍໃນລາຍຊື່",
"demoBannerDescription": "ແບນເນີຈະສະແດງຂໍ້ຄວາມສຳຄັນສັ້ນໆ ແລະ ສະໜອງຄຳສັ່ງເພື່ອໃຫ້ຜູ້ໃຊ້ຈັດການ (ຫຼື ປິດແບນເນີ). ຜູ້ໃຊ້ຈະຕ້ອງດຳເນີນການໃດໜຶ່ງເພື່ອປິດມັນ.",
"demoCardTitle": "ບັດ",
"demoCardSubtitle": "ບັດພື້ນຖານແບບມີມຸມໂຄ້ງມົນ",
"demoCardDescription": "ບັດແມ່ນແຜ່ນເອກະສານທີ່ໃຊ້ສະແດງຂໍ້ມູນທີ່ກ່ຽວຂ້ອງ ເຊັ່ນ: ອະລະບ້ຳ, ສະຖານທີ່ຕັ້ງທາງພູມສາດ, ຄາບເຂົ້າ, ຂໍ້ມູນການຕິດຕໍ່ ແລະ ອື່ນໆ.",
"demoDataTableTitle": "ຕາຕະລາງຂໍ້ມູນ",
"demoDataTableSubtitle": "ແຖວ ແລະ ຖັນຂໍ້ມູນ",
"dataTableColumnCarbs": "ຄາໂບໄຮເດຣດ (g)",
"placeTanjore": "ທານຈໍ",
"demoGridListsTitle": "ລາຍຊື່ຕາຕະລາງ",
"placeFlowerMarket": "ຕະຫຼາດດອກໄມ້",
"placeBronzeWorks": "ໂຮງຫຼໍ່ທອງແດງ",
"placeMarket": "ຕະຫຼາດ",
"placeThanjavurTemple": "ວັນທານຈາວູ",
"placeSaltFarm": "ນາເກືອ",
"placeScooters": "ສະກູດເຕີ",
"placeSilkMaker": "ເຄື່ອງທໍຜ້າໄໝ",
"placeLunchPrep": "ກຽມອາຫານສວາຍ",
"placeBeach": "ຫາດຊາຍ",
"placeFisherman": "ຊາວປະມົງ",
"demoMenuSelected": "ເລືອກແລ້ວ: {value}",
"demoMenuRemove": "ລຶບ",
"demoMenuGetLink": "ຮັບລິ້ງ",
"demoMenuShare": "ແບ່ງປັນ",
"demoBottomAppBarSubtitle": "ສະແດງການນຳທາງ ແລະ ຄຳສັ່ງຢູ່ລຸ່ມສຸດ",
"demoMenuAnItemWithASectionedMenu": "ລາຍການທີ່ມີເມນູແບບພາກສ່ວນ",
"demoMenuADisabledMenuItem": "ລາຍການເມນູບໍລິບົດສອງ",
"demoLinearProgressIndicatorTitle": "ຕົວຊີ້ບອກສະຖານະແບບເສັ້ນຊື່",
"demoMenuContextMenuItemOne": "ລາຍການເມນູບໍລິບົດໜຶ່ງ",
"demoMenuAnItemWithASimpleMenu": "ລາຍການທີ່ມີເມນູແບບງ່າຍ",
"demoCustomSlidersTitle": "ຕົວເລື່ອນແບບກຳນົດເອງ",
"demoMenuAnItemWithAChecklistMenu": "ລາຍການທີ່ມີເມນູລາຍການກວດສອບ",
"demoCupertinoActivityIndicatorTitle": "ຕົວຊີ້ບອກການເຄື່ອນໄຫວ",
"demoCupertinoActivityIndicatorSubtitle": "ຕົວຊີ້ບອກການເຄື່ອນໄຫວແບບ iOS",
"demoCupertinoActivityIndicatorDescription": "ຕົວຊີ້ບອກການເຄື່ອນໄຫວແບບ iOS ທີ່ມຸນຕາມເຂັມໂມງ",
"demoCupertinoNavigationBarTitle": "ແຖບການນຳທາງ",
"demoCupertinoNavigationBarSubtitle": "ແຖບການນຳທາງແບບ iOS",
"demoCupertinoNavigationBarDescription": "ແຖບການນຳທາງແບບ iOS. ແຖບການນຳທາງແມ່ນແຖບເຄື່ອງມືທີ່ຢ່າງໜ້ອຍທີ່ສຸດຈະປະກອບມີຊື່ໜ້າ, ໃນທາງກາງຂອງແຖບເຄື່ອງມື.",
"demoCupertinoPullToRefreshTitle": "ດຶງເພື່ອໂຫຼດຂໍ້ມູນຄືນໃໝ່",
"demoCupertinoPullToRefreshSubtitle": "ການຄວບຄຸມການດຶງເພື່ອໂຫຼດຂໍ້ມູນຄືນໃໝ່ iOS",
"demoCupertinoPullToRefreshDescription": "ວິດເຈັດທີ່ນຳໃຊ້ການຄວບຄຸມເນື້ອຫາການໂຫຼດຂໍ້ມູນຄືນໃໝ່ແບບ iOS.",
"demoProgressIndicatorTitle": "ຕົວຊີ້ບອກການສະຖານະ",
"demoProgressIndicatorSubtitle": "ເສັ້ນຊື່, ວົງມົນ, ບໍ່ຊັດເຈນ",
"demoCircularProgressIndicatorTitle": "ຕົວຊີ້ບອກສະຖານະແບບວົງມົນ",
"demoCircularProgressIndicatorDescription": "ຕົວຊີ້ບອກສະຖານະແບບວົງມົນ Material Design, ເຊິ່ງຈະໝຸນເພື່ອບອກວ່າແອັບພລິເຄຊັນກຳລັງເຮັດວຽກຢູ່.",
"demoMenuFour": "ສີ່",
"demoLinearProgressIndicatorDescription": "ຕົວຊີ້ບອກສະຖານະແບບເສັ້ນຊື່ Material Design, ເອີ້ນອີກຢ່າງໜຶ່ງວ່າແຖບສະຖານະ.",
"demoTooltipTitle": "ຄຳແນະນຳ",
"demoTooltipSubtitle": "ຂໍ້ຄວາມສັ້ນໆທີ່ສະແດງເມື່ອກົດຄ້າງໄວ້ ຫຼື ເມື່ອເລື່ອນໄປໃສ່",
"demoTooltipDescription": "ຄຳແນະນຳຈະສະໜອງປ້າຍກຳກັບແບບຂໍ້ຄວາມເພື່ອຊ່ວຍອະທິບາຍຟັງຊັນຂອງປຸ່ມ ຫຼື ຄຳສັ່ງສ່ວນຕິດຕໍ່ຜູ້ໃຊ້ອື່ນໆ. ຄຳແນະນຳຈະສະແດງຂໍ້ຄວາມທີ່ເປັນຂໍ້ມູນເມື່ອຜູ້ໃຊ້ເລື່ອນໄປໃສ່, ເລືອກໃສ່ ຫຼື ກົດຄ້າງໃສ່ອົງປະກອບໃດໜຶ່ງ.",
"demoTooltipInstructions": "ກົດຄ້າງໄວ້ ຫຼື ເລື່ອນໄປໃສ່ເພື່ອສະແດງຄຳແນະນຳ.",
"placeChennai": "ເຈນໄນ",
"demoMenuChecked": "ເລືອກແລ້ວ: {value}",
"placeChettinad": "ເຊຕິນາດ",
"demoMenuPreview": "ຕົວຢ່າງ",
"demoBottomAppBarTitle": "ແຖບແອັບທາງລຸ່ມ",
"demoBottomAppBarDescription": "ແຖບແອັບທາງລຸ່ມຈະເຮັດໃຫ້ສາມາດເຂົ້າເຖິງແຖບນຳທາງ ແລະ ຄຳສັ່ງຕ່າງໆໄດ້ສູງສຸດ 4 ຄຳສັ່ງ, ຮວມທັງປຸ່ມຄຳສັ່ງທີ່ລອຍຢູ່ໄດ້ນຳ.",
"bottomAppBarNotch": "ຮອຍບາກ",
"bottomAppBarPosition": "ຕຳແໜ່ງປຸ່ມຄຳສັ່ງແບບລອຍ",
"bottomAppBarPositionDockedEnd": "ວາງແລ້ວ - ຈຸດສິ້ນສຸດ",
"bottomAppBarPositionDockedCenter": "ວາງແລ້ວ - ຈຸດທາງກາງ",
"bottomAppBarPositionFloatingEnd": "ລອຍຢູ່ - ຈຸດສິ້ນສຸດ",
"bottomAppBarPositionFloatingCenter": "ລອຍຢູ່ - ຈຸດທາງກາງ",
"demoSlidersEditableNumericalValue": "ຄ່າຕົວເລກທີ່ແກ້ໄຂໄດ້",
"demoGridListsSubtitle": "ໂຄງຮ່າງແຖວ ແລະ ຖັນ",
"demoGridListsDescription": "ລາຍຊື່ຕາຕະລາງແມ່ນດີທີ່ສຸດສຳລັບການນຳສະເໜີຂໍ້ມູນທີ່ມີຄຸນລັກສະນະຄ້າຍກັນ, ໂດຍທົ່ວໄປແມ່ນຮູບພາບຕ່າງໆ. ແຕ່ລະລາຍການໃນລາຍຊື່ຕາຕະລາງແມ່ນເອີ້ນວ່າແຜ່ນ.",
"demoGridListsImageOnlyTitle": "ຮູບພາບເທົ່ານັ້ນ",
"demoGridListsHeaderTitle": "ພ້ອມກັບສ່ວນຫົວ",
"demoGridListsFooterTitle": "ພ້ອມກັບສ່ວນທ້າຍ",
"demoSlidersTitle": "ຕົວເລື່ອນ",
"demoSlidersSubtitle": "ວິດເຈັດສຳລັບການເລືອກຄ່າໂດຍການປັດ",
"demoSlidersDescription": "ຕົວເລື່ອນຈະມີໄລຍະຂອງຄ່າໄປຕາມແຖບໃດໜຶ່ງ, ເຊິ່ງຜູ້ໃຊ້ສາມາດເລືອກຄ່າດຽວໄດ້. ພວກມັນເໝາະສຳລັບການປັບແຕ່ງການຕັ້ງຄ່າຕ່າງໆ ເຊັ່ນ: ລະດັບສຽງ, ຄວາມສະຫວ່າງ ຫຼື ການນຳໃຊ້ຟິວເຕີຮູບພາບ.",
"demoRangeSlidersTitle": "ຕົວເລື່ອນໄລຍ",
"demoRangeSlidersDescription": "ຕົວເລື່ອນຈະມີໄລຍະຂອງຄ່າໄປຕາມແຖບໃດໜຶ່ງ. ພວກມັນສາມາດມີໄອຄອນຢູ່ປາຍທັງສອງຂອງແຖບທີ່ມີໄລຍະຂອງຄ່າຕ່າງໆໄດ້. ພວກມັນເໝາະສຳລັບການປັບແຕ່ງການຕັ້ງຄ່າຕ່າງໆ ເຊັ່ນ: ລະດັບສຽງ, ຄວາມສະຫວ່າງ ຫຼື ການນຳໃຊ້ຟິວເຕີຮູບພາບ.",
"demoMenuAnItemWithAContextMenuButton": "ລາຍການທີ່ມີເມນູບໍລິບົດ",
"demoCustomSlidersDescription": "ຕົວເລື່ອນຈະມີໄລຍະຂອງຄ່າໄປຕາມແຖບໃດໜຶ່ງ, ເຊິ່ງຜູ້ໃຊ້ສາມາດເລືອກຄ່າດຽວ ຫຼື ໄລຍະຂອງຄ່າຕ່າງໆໄດ້. ຕົວເລື່ອນສາມາດໃຊ້ຮູບແບບສີສັນ ແລະ ປັບແຕ່ງໄດ້.",
"demoSlidersContinuousWithEditableNumericalValue": "ຕໍ່ເນື່ອງກັບຄ່າຕົວເລກທີ່ແກ້ໄຂໄດ້",
"demoSlidersDiscrete": "ແຍກຈາກກັນ",
"demoSlidersDiscreteSliderWithCustomTheme": "ຕົວເລື່ອນແບບແຍກຈາກກັນໂດຍມີຮູບແບບສີສັນກຳນົດເອງ",
"demoSlidersContinuousRangeSliderWithCustomTheme": "ຕົວເລື່ອນໄລຍະແບບຕໍ່ເນື່ອງໂດຍມີຮູບແບບສີສັນກຳນົດເອງ",
"demoSlidersContinuous": "ຕໍ່ເນື່ອງ",
"placePondicherry": "ພອນດິເຊີຣີ",
"demoMenuTitle": "ເມນູ",
"demoContextMenuTitle": "ເມນູບໍລິບົດ",
"demoSectionedMenuTitle": "ເມນູແບບພາກສ່ວນ",
"demoSimpleMenuTitle": "ເມນູແບບງ່າຍ",
"demoChecklistMenuTitle": "ເມນູລາຍການກວດສອບ",
"demoMenuSubtitle": "ປຸ່ມເມນູ ແລະ ເມນູແບບງ່າຍໆ",
"demoMenuDescription": "ເມນູຈະສະແດງລາຍຊື່ຂອງຕົວເລືອກຢູ່ພື້ນຜິວຊົ່ວຄາວ. ພວກມັນຈະປາກົດເມື່ອຜູ້ໃຊ້ໂຕ້ຕອບກັບປຸ່ມ, ຄຳສັ່ງ ຫຼື ການຄວບຄຸມອື່ນໆ.",
"demoMenuItemValueOne": "ລາຍການເມນູໜຶ່ງ",
"demoMenuItemValueTwo": "ລາຍການເມນູສອງ",
"demoMenuItemValueThree": "ລາຍການເມນູສາມ",
"demoMenuOne": "ໜຶ່ງ",
"demoMenuTwo": "ສອງ",
"demoMenuThree": "ສາມ",
"demoMenuContextMenuItemThree": "ລາຍການເມນູບໍລິບົດສາມ",
"demoCupertinoSwitchSubtitle": "ປຸ່ມກົດແບບ iOS",
"demoSnackbarsText": "ນີ້ແມ່ນແຖບສະແດງຂໍ້ຄວາມ.",
"demoCupertinoSliderSubtitle": "ແຖບເລື່ອນແບບ iOS",
"demoCupertinoSliderDescription": "ແຖບເລື່ອນສາມາດໃຊ້ເພື່ອເລືອກຈາກຊຸດຄ່າຕໍ່ເນື່ອງ ຫຼື ບໍ່ຕໍ່ເນື່ອງໄດ້",
"demoCupertinoSliderContinuous": "ຕໍ່ເນື່ອງ: {value}",
"demoCupertinoSliderDiscrete": "ບໍ່ຕໍ່ເນື່ອງ: {value}",
"demoSnackbarsAction": "ທ່ານກົດຄຳສັ່ງແຖບສະແດງຂໍ້ຄວາມແລ້ວ.",
"backToGallery": "ກັບໄປຄັງຮູບ",
"demoCupertinoTabBarTitle": "ແຖບ",
"demoCupertinoSwitchDescription": "ປຸ່ມກົດແມ່ນໃຊ້ເພື່ອສະຫຼັບສະຖານະ ເປີດ/ປິດ ຂອງການຕັ້ງຄ່າດ່ຽວໃດໜຶ່ງ.",
"demoSnackbarsActionButtonLabel": "ຄຳສັ່ງ",
"cupertinoTabBarProfileTab": "ໂປຣໄຟລ໌",
"demoSnackbarsButtonLabel": "ສະແດງແຖບສະແດງຂໍ້ຄວາມ",
"demoSnackbarsDescription": "ແຖບສະແດງຂໍ້ຄວາມຈະແຈ້ງເຕືອນຜູ້ໃຊ້ກ່ຽວກັບຂັ້ນຕອນທີ່ແອັບໃດໜຶ່ງດຳເນີນໄປແລ້ວ ຫຼື ຈະດຳເນີນການ. ພວກມັນຈະປາກົດຊົ່ວຄາວ, ຢູ່ລຸ່ມສຸດຂອງໜ້າຈໍ. ພວກມັນຈະບໍ່ລົບກວນປະສົບການຂອງຜູ້ໃຊ້ ແລະ ຜູ້ໃຊ້ບໍ່ຈຳເປັນຕ້ອງກົດເພື່ອໃຫ້ຫາຍໄປ.",
"demoSnackbarsSubtitle": "ແຖບສະແດງຂໍ້ຄວາມຈະສະແດງຂໍ້ຄວາມຢູ່ລຸ່ມສຸດຂອງໜ້າຈໍ",
"demoSnackbarsTitle": "ແຖບສະແດງຂໍ້ຄວາມ",
"demoCupertinoSliderTitle": "ແຖບເລື່ອນ",
"cupertinoTabBarChatTab": "ສົນທະນາ",
"cupertinoTabBarHomeTab": "ໜ້າຫຼັກ",
"demoCupertinoTabBarDescription": "ແຖບການນຳທາງລຸ່ມສຸດແບບ iOS. ສະແດງຫຼາຍແຖບທີ່ມີແຖບນຳໃຊ້ຢູ່ແຖບດຽວ, ແຖບທຳອິດເປັນຄ່າເລີ່ມຕົ້ນ.",
"demoCupertinoTabBarSubtitle": "ແຖບລຸ່ມສຸດແບບ iOS",
"demoOptionsFeatureTitle": "ເບິ່ງຕົວເລືອກ",
"demoOptionsFeatureDescription": "ແຕະບ່ອນນີ້ເພື່ອເບິ່ງຕົວເລືອກທີ່ສາມາດໃຊ້ໄດ້ສຳລັບການສາທິດນີ້.",
"demoCodeViewerCopyAll": "ສຳເນົາທັງໝົດ",
"shrineScreenReaderRemoveProductButton": "ລຶບ {product} ອອກ",
"shrineScreenReaderProductAddToCart": "ເພີ່ມໃສ່ກະຕ່າ",
"shrineScreenReaderCart": "{quantity,plural,=0{ກະຕ່າຊື້ເຄື່ອງ, ບໍ່ມີລາຍການ}=1{ກະຕ່າຊື້ເຄື່ອງ, 1 ລາຍການ}other{ກະຕ່າຊື້ເຄື່ອງ, {quantity} ລາຍການ}}",
"demoCodeViewerFailedToCopyToClipboardMessage": "ສຳເນົາໄປໃສ່ຄລິບບອດບໍ່ສຳເລັດ: {error}",
"demoCodeViewerCopiedToClipboardMessage": "ສຳເນົາໃສ່ຄລິບບອດແລ້ວ.",
"craneSleep8SemanticLabel": "ຊາກເປ່ເພຂອງສິ່ງກໍ່ສ້າງຊາວມາຢັນຢູ່ໜ້າຜາເໜືອຫາດຊາຍ",
"craneSleep4SemanticLabel": "ໂຮງແຮມຮິມທະເລສາບທີ່ຢູ່ໜ້າພູ",
"craneSleep2SemanticLabel": "ປ້ອມມາຊູປິກຊູ",
"craneSleep1SemanticLabel": "ກະຕູບຫຼັງນ້ອຍຢູ່ກາງທິວທັດທີ່ມີຫິມະ ແລະ ຕົ້ນໄມ້ຂຽວ",
"craneSleep0SemanticLabel": "ບັງກະໂລເໜືອນ້ຳ",
"craneFly13SemanticLabel": "ສະລອຍນ້ຳຕິດທະເລທີ່ມີຕົ້ນປາມ",
"craneFly12SemanticLabel": "ສະລອຍນ້ຳທີ່ມີຕົ້ນປາມ",
"craneFly11SemanticLabel": "ປະພາຄານດິນຈີ່ກາງທະເລ",
"craneFly10SemanticLabel": "Al-Azhar Mosque ໃນຕອນຕາເວັນຕົກ",
"craneFly9SemanticLabel": "ຜູ້ຊາຍຢືນພິງລົດບູຮານສີຟ້າ",
"craneFly8SemanticLabel": "Supertree Grove",
"craneEat9SemanticLabel": "ເຄົາເຕີໃນຄາເຟ່ທີ່ມີເຂົ້າໜົມອົບຊະນິດຕ່າງໆ",
"craneEat2SemanticLabel": "ເບີເກີ",
"craneFly5SemanticLabel": "ໂຮງແຮມຮິມທະເລສາບທີ່ຢູ່ໜ້າພູ",
"demoSelectionControlsSubtitle": "ກ່ອງໝາຍ, ປຸ່ມຕົວເລືອກ ແລະ ປຸ່ມເປີດປິດຕ່າງໆ",
"craneEat10SemanticLabel": "ຜູ້ຍິງຖືແຊນວິດພາສທຣາມີໃຫຍ່",
"craneFly4SemanticLabel": "ບັງກະໂລເໜືອນ້ຳ",
"craneEat7SemanticLabel": "ທາງເຂົ້າຮ້ານເບເກີຣີ",
"craneEat6SemanticLabel": "ເມນູໃສ່ກຸ້ງ",
"craneEat5SemanticLabel": "ບໍລິເວນບ່ອນນັ່ງໃນຮ້ານອາຫານທີ່ມີສິລະປະ",
"craneEat4SemanticLabel": "ຂອງຫວານຊັອກໂກແລັດ",
"craneEat3SemanticLabel": "ທາໂຄເກົາຫລີ",
"craneFly3SemanticLabel": "ປ້ອມມາຊູປິກຊູ",
"craneEat1SemanticLabel": "ບາທີ່ບໍ່ມີລູກຄ້າເຊິ່ງມີຕັ່ງນັ່ງແບບສູງແຕ່ບໍ່ມີພະນັກ",
"craneEat0SemanticLabel": "ພິດຊ່າໃນເຕົາອົບຟືນ",
"craneSleep11SemanticLabel": "ຕຶກໄທເປ 101",
"craneSleep10SemanticLabel": "Al-Azhar Mosque ໃນຕອນຕາເວັນຕົກ",
"craneSleep9SemanticLabel": "ປະພາຄານດິນຈີ່ກາງທະເລ",
"craneEat8SemanticLabel": "ຈານໃສ່ກຸ້ງນ້ຳຈືດ",
"craneSleep7SemanticLabel": "ຫ້ອງພັກທີ່ມີສີສັນສົດໃສຢູ່ຈະຕຸລັດ Ribeira",
"craneSleep6SemanticLabel": "ສະລອຍນ້ຳທີ່ມີຕົ້ນປາມ",
"craneSleep5SemanticLabel": "ເຕັ້ນພັກແຮມໃນທົ່ງ",
"settingsButtonCloseLabel": "ປິດການຕັ້ງຄ່າ",
"demoSelectionControlsCheckboxDescription": "ກ່ອງໝາຍຈະເຮັດໃຫ້ຜູ້ໃຊ້ສາມາດເລືອກຫຼາຍຕົວເລືອກຈາກຊຸດໃດໜຶ່ງໄດ້. ຄ່າຂອງກ່ອງໝາຍປົກກະຕິທີ່ເປັນ true ຫຼື false ແລະ ຄ່າຂອງກ່ອງໝາຍທີ່ມີສາມຄ່າສາມາດເປັນຄ່າ null ໄດ້ນຳ.",
"settingsButtonLabel": "ການຕັ້ງຄ່າ",
"demoListsTitle": "ລາຍຊື່",
"demoListsSubtitle": "ໂຄງຮ່າງລາຍຊື່ແບບເລື່ອນໄດ້",
"demoListsDescription": "ແຖບທີ່ມີຄວາມສູງແບບຕາຍຕົວແຖວດ່ຽວທີ່ປົກກະຕິຈະມີຂໍ້ຄວາມຈຳນວນໜຶ່ງຮວມທັງໄອຄອນນຳໜ້າ ຫຼື ຕໍ່ທ້າຍ",
"demoOneLineListsTitle": "ແຖວດຽວ",
"demoTwoLineListsTitle": "ສອງແຖວ",
"demoListsSecondary": "ຂໍ້ຄວາມສຳຮອງ",
"demoSelectionControlsTitle": "ການຄວບຄຸມການເລືອກ",
"craneFly7SemanticLabel": "ພູຣັຊມໍ",
"demoSelectionControlsCheckboxTitle": "ກ່ອງໝາຍ",
"craneSleep3SemanticLabel": "ຜູ້ຊາຍຢືນພິງລົດບູຮານສີຟ້າ",
"demoSelectionControlsRadioTitle": "ປຸ່ມຕົວເລືອກ",
"demoSelectionControlsRadioDescription": "ປຸ່ມຕົວເລືອກທີ່ເຮັດໃຫ້ຜູ້ໃຊ້ສາມາດເລືອກຕົວເລືອກຈາກຊຸດໃດໜຶ່ງໄດ້. ໃຊ້ປຸ່ມຕົວເລືອກສຳລັບການເລືອກສະເພາະຫາກທ່ານຄິດວ່າຜູ້ໃຊ້ຕ້ອງການເບິ່ງຕົວເລືອກທັງໝົດທີ່ມີຂ້າງໆກັນ.",
"demoSelectionControlsSwitchTitle": "ປຸ່ມ",
"demoSelectionControlsSwitchDescription": "ປຸ່ມເປີດ/ປິດທີ່ຈະສະຫຼັບຕົວເລືອກການຕັ້ງຄ່າໃດໜຶ່ງ. ຕົວເລືອກທີ່ສະຫຼັບການຄວບຄຸມ, ຮວມທັງສະຖານະທີ່ມັນເປັນຢູ່, ຄວນເຮັດໃຫ້ຈະແຈ້ງຈາກປ້າຍກຳກັບໃນແຖວທີ່ສອດຄ່ອງກັນ.",
"craneFly0SemanticLabel": "ກະຕູບຫຼັງນ້ອຍຢູ່ກາງທິວທັດທີ່ມີຫິມະ ແລະ ຕົ້ນໄມ້ຂຽວ",
"craneFly1SemanticLabel": "ເຕັ້ນພັກແຮມໃນທົ່ງ",
"craneFly2SemanticLabel": "ທຸງມົນຕາໜ້າພູທີ່ປົກຄຸມດ້ວຍຫິມະ",
"craneFly6SemanticLabel": "ພາບຖ່າຍທາງອາກາດຂອງພະລາດຊະວັງ Palacio de Bellas Artes",
"rallySeeAllAccounts": "ເບິ່ງບັນຊີທັງໝົດ",
"rallyBillAmount": "ບິນ {billName} ຮອດກຳນົດ {date} ຈຳນວນ {amount}.",
"shrineTooltipCloseCart": "ປິດກະຕ່າ",
"shrineTooltipCloseMenu": "ປິດເມນູ",
"shrineTooltipOpenMenu": "ເປີດເມນູ",
"shrineTooltipSettings": "ການຕັ້ງຄ່າ",
"shrineTooltipSearch": "ຊອກຫາ",
"demoTabsDescription": "ແຖບຕ່າງໆຈະເປັນການຈັດລະບຽບເນື້ອຫາໃນແຕ່ລະໜ້າຈໍ, ຊຸດຂໍ້ມູນ ແລະ ການໂຕ້ຕອບອື່ນໆ.",
"demoTabsSubtitle": "ແຖບຕ່າງໆທີ່ມີມຸມມອງແບບເລື່ອນໄດ້ຂອງຕົນເອງ",
"demoTabsTitle": "ແຖບ",
"rallyBudgetAmount": "ງົບປະມານ {budgetName} ໃຊ້ໄປແລ້ວ {amountUsed} ຈາກຈຳນວນ {amountTotal}, ເຫຼືອ {amountLeft}",
"shrineTooltipRemoveItem": "ລຶບລາຍການ",
"rallyAccountAmount": "ບັນຊີ {accountName} ໝາຍເລກ {accountNumber} ຈຳນວນ {amount}.",
"rallySeeAllBudgets": "ເບິ່ງງົບປະມານທັງໝົດ",
"rallySeeAllBills": "ເບິ່ງບິນທັງໝົດ",
"craneFormDate": "ເລືອກວັນທີ",
"craneFormOrigin": "ເລືອກຕົ້ນທາງ",
"craneFly2": "ຫຸບເຂົາແຄມບູ, ເນປານ",
"craneFly3": "ມາຈູ ພິຈູ, ເປຣູ",
"craneFly4": "ມາເລ່, ມັລດີຟ",
"craneFly5": "ວິຊເນົາ, ສະວິດເຊີແລນ",
"craneFly6": "ເມັກຊິກໂກຊິຕີ, ເມັກຊິໂກ",
"craneFly7": "ພູຣັຊມໍ, ສະຫະລັດ",
"settingsTextDirectionLocaleBased": "ອ້າງອີງຈາກພາສາ",
"craneFly9": "ຮາວານາ, ຄິວບາ",
"craneFly10": "ໄຄໂຣ, ອີຢິບ",
"craneFly11": "ລິສບອນ, ປໍຕູກອລ",
"craneFly12": "ນາປາ, ສະຫະລັດ",
"craneFly13": "ບາຫຼີ, ອິນໂດເນເຊຍ",
"craneSleep0": "ມາເລ່, ມັລດີຟ",
"craneSleep1": "ແອສເພນ, ສະຫະລັດ",
"craneSleep2": "ມາຈູ ພິຈູ, ເປຣູ",
"demoCupertinoSegmentedControlTitle": "ການຄວບຄຸມແບບແຍກສ່ວນ",
"craneSleep4": "ວິຊເນົາ, ສະວິດເຊີແລນ",
"craneSleep5": "ບິກເຊີ, ສະຫະລັດ",
"craneSleep6": "ນາປາ, ສະຫະລັດ",
"craneSleep7": "ປໍໂຕ, ປໍຕູກອລ",
"craneSleep8": "ທູລຳ, ເມັກຊິໂກ",
"craneEat5": "ໂຊລ, ເກົາຫຼີໃຕ້",
"demoChipTitle": "ຊິບ",
"demoChipSubtitle": "ອົງປະກອບກະທັດຮັດທີ່ການປ້ອນຂໍ້ມູນ, ຄຸນສົມບັດ ຫຼື ຄຳສັ່ງໃດໜຶ່ງ",
"demoActionChipTitle": "ຊິບຄຳສັ່ງ",
"demoActionChipDescription": "ຊິບຄຳສັ່ງເປັນຊຸດຕົວເລືອກທີ່ຈະເອີ້ນຄຳສັ່ງວຽກທີ່ກ່ຽວກັບເນື້ອຫາຫຼັກ. ຊິບຄຳສັ່ງຄວນຈະສະແດງແບບໄດນາມິກ ແລະ ຕາມບໍລິບົດໃນສ່ວນຕິດຕໍ່ຜູ້ໃຊ້.",
"demoChoiceChipTitle": "ຊິບຕົວເລືອກ",
"demoChoiceChipDescription": "ຊິບຕົວເລືອກຈະສະແດງຕົວເລືອກດ່ຽວຈາກຊຸດໃດໜຶ່ງ. ຊິບຕົວເລືອກມີຂໍ້ຄວາມຄຳອະທິບາຍ ຫຼື ການຈັດໝວດໝູ່ທີ່ກ່ຽວຂ້ອງ.",
"demoFilterChipTitle": "ຊິບຕົວກັ່ນຕອງ",
"demoFilterChipDescription": "ຊິບຕົວກັ່ນຕອງໃຊ້ແທັກ ຫຼື ຄຳອະທິບາຍລາຍລະອຽດເປັນວິທີກັ່ນຕອງເນື້ອຫາ.",
"demoInputChipTitle": "ຊິບອິນພຸດ",
"demoInputChipDescription": "ຊິບອິນພຸດທີ່ສະແດງຂໍ້ມູນທີ່ຊັບຊ້ອນໃນຮູບແບບກະທັດຮັດ ເຊັ່ນ: ຂໍ້ມູນເອນທິທີ (ບຸກຄົນ, ສະຖານທີ່ ຫຼື ສິ່ງຂອງ) ຫຼື ຂໍ້ຄວາມຂອງການສົນທະນາ.",
"craneSleep9": "ລິສບອນ, ປໍຕູກອລ",
"craneEat10": "ລິສບອນ, ປໍຕູກອລ",
"demoCupertinoSegmentedControlDescription": "ໃຊ້ເພື່ອເລືອກລະຫວ່າງຕົວເລືອກທີ່ສະເພາະຕົວຄືກັນ. ການເລືອກຕົວເລືອກໜຶ່ງໃນສ່ວນຄວບຄຸມທີ່ແບ່ງບກຸ່ມຈະເປັນການຍົກເລີກການເລືອກຕົວເລືອກອື່ນໆໃນສ່ວນຄວບຄຸມທີ່ແບ່ງກຸ່ມນັ້ນ.",
"chipTurnOnLights": "ເປີດໄຟ",
"chipSmall": "ນ້ອຍ",
"chipMedium": "ປານກາງ",
"chipLarge": "ໃຫຍ່",
"chipElevator": "ລິບ",
"chipWasher": "ຈັກຊັກເຄື່ອງ",
"chipFireplace": "ເຕົາຜິງໄຟ",
"chipBiking": "ຖີບລົດ",
"craneFormDiners": "ຮ້ານອາຫານ",
"rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{ເພີ່ມການຫຼຸດພາສີທີ່ເປັນໄປໄດ້ຂອງທ່ານ! ມອບໝາຍໝວດໝູ່ໃຫ້ 1 ທຸລະກຳທີ່ຍັງບໍ່ໄດ້ຮັບມອບໝາຍເທື່ອ.}other{ເພີ່ມການຫຼຸດພາສີທີ່ເປັນໄປໄດ້ຂອງທ່ານ! ມອບໝາຍໝວດໝູ່ໃຫ້ {count} ທຸລະກຳທີ່ຍັງບໍ່ໄດ້ຮັບມອບໝາຍເທື່ອ.}}",
"craneFormTime": "ເລືອກເວລາ",
"craneFormLocation": "ເລືອກສະຖານທີ່",
"craneFormTravelers": "ນັກທ່ອງທ່ຽວ",
"craneEat8": "ແອັດລັນຕາ, ສະຫະລັດ",
"craneFormDestination": "ເລືອກປາຍທາງ",
"craneFormDates": "ເລືອກວັນທີ",
"craneFly": "ບິນ",
"craneSleep": "ນອນ",
"craneEat": "ກິນ",
"craneFlySubhead": "ສຳຫຼວດຖ້ຽວບິນຕາມປາຍທາງ",
"craneSleepSubhead": "ສຳຫຼວດທີ່ພັກຕາມປາຍທາງ",
"craneEatSubhead": "ສຳຫຼວດຮ້ານອາຫານຕາມປາຍທາງ",
"craneFlyStops": "{numberOfStops,plural,=0{ບໍ່ຈອດ}=1{1 ຈຸດຈອດ}other{{numberOfStops} ຈຸດຈອດ}}",
"craneSleepProperties": "{totalProperties,plural,=0{ບໍ່ມີຕົວເລືອກບ່ອນພັກ}=1{ມີ 1 ຕົວເລືອກບ່ອນພັກ}other{ມີ {totalProperties} ຕົວເລືອກບ່ອນພັກ}}",
"craneEatRestaurants": "{totalRestaurants,plural,=0{ບໍ່ມີຮ້ານອາຫານ}=1{ຮ້ານອາຫານ 1 ຮ້ານ}other{ຮ້ານອາຫານ {totalRestaurants} ຮ້ານ}}",
"craneFly0": "ແອສເພນ, ສະຫະລັດ",
"demoCupertinoSegmentedControlSubtitle": "ການຄວບຄຸມແຍກສ່ວນແບບ iOS",
"craneSleep10": "ໄຄໂຣ, ອີຢິບ",
"craneEat9": "ມາດຣິດ, ສະເປນ",
"craneFly1": "ບິກເຊີ, ສະຫະລັດ",
"craneEat7": "ແນຊວິວ, ສະຫະລັດ",
"craneEat6": "ຊີເອເທິນ, ສະຫະລັດ",
"craneFly8": "ສິງກະໂປ",
"craneEat4": "ປາຣີສ, ຝຣັ່ງ",
"craneEat3": "ພອດແລນ, ສະຫະລັດ",
"craneEat2": "ຄໍໂດບາ, ອາເຈນທິນາ",
"craneEat1": "ດາລັສ, ສະຫະລັດ",
"craneEat0": "ເນໂປ, ສະຫະລັດ",
"craneSleep11": "ໄທເປ, ໄຕ້ຫວັນ",
"craneSleep3": "ຮາວານາ, ຄິວບາ",
"shrineLogoutButtonCaption": "ອອກຈາກລະບົບ",
"rallyTitleBills": "ໃບບິນ",
"rallyTitleAccounts": "ບັນຊີ",
"shrineProductVagabondSack": "ຖົງສະພາຍ",
"rallyAccountDetailDataInterestYtd": "ດອກເບ້ຍຕັ້ງແຕ່ຕົ້ນປີຮອດປັດຈຸບັນ",
"shrineProductWhitneyBelt": "ສາຍແອວ Whitney",
"shrineProductGardenStrand": "ເຊືອກເຮັດສວນ",
"shrineProductStrutEarrings": "ຕຸ້ມຫູ Strut",
"shrineProductVarsitySocks": "ຖົງຕີນທີມກິລາມະຫາວິທະຍາໄລ",
"shrineProductWeaveKeyring": "ພວງກະແຈຖັກ",
"shrineProductGatsbyHat": "ໝວກ Gatsby",
"shrineProductShrugBag": "ກະເປົາສະພາຍໄຫຼ່",
"shrineProductGiltDeskTrio": "ໂຕະເຄືອບຄຳ 3 ອັນ",
"shrineProductCopperWireRack": "ຕະແກງສີທອງແດງ",
"shrineProductSootheCeramicSet": "ຊຸດເຄື່ອງເຄືອບສີລະມຸນ",
"shrineProductHurrahsTeaSet": "ຊຸດນ້ຳຊາ Hurrahs",
"shrineProductBlueStoneMug": "ຈອກກາເຟບລູສະໂຕນ",
"shrineProductRainwaterTray": "ຮາງນ້ຳຝົນ",
"shrineProductChambrayNapkins": "ຜ້າເຊັດປາກແຊມເບຣ",
"shrineProductSucculentPlanters": "ກະຖາງສຳລັບພືດໂອບນ້ຳ",
"shrineProductQuartetTable": "ໂຕະສຳລັບ 4 ຄົນ",
"shrineProductKitchenQuattro": "Quattro ຫ້ອງຄົວ",
"shrineProductClaySweater": "ເສື້ອກັນໜາວສີຕັບໝູ",
"shrineProductSeaTunic": "ຊຸດກະໂປງຫາດຊາຍ",
"shrineProductPlasterTunic": "ເສື້ອຄຸມສີພລາສເຕີ",
"rallyBudgetCategoryRestaurants": "ຮ້ານອາຫານ",
"shrineProductChambrayShirt": "ເສື້ອແຊມເບຣ",
"shrineProductSeabreezeSweater": "ເສື້ອກັນໜາວແບບຖັກຫ່າງ",
"shrineProductGentryJacket": "ແຈັກເກັດແບບຄົນຊັ້ນສູງ",
"shrineProductNavyTrousers": "ໂສ້ງຂາຍາວສີຟ້າແກ່",
"shrineProductWalterHenleyWhite": "ເສື້ອເຮນຣີ Walter (ຂາວ)",
"shrineProductSurfAndPerfShirt": "ເສື້ອ Surf and perf",
"shrineProductGingerScarf": "ຜ້າພັນຄໍສີເຫຼືອອົມນ້ຳຕານແດງ",
"shrineProductRamonaCrossover": "Ramona ຄຣອສໂອເວີ",
"shrineProductClassicWhiteCollar": "ເສື້ອເຊີດສີຂາວແບບຄລາດສິກ",
"shrineProductSunshirtDress": "ຊຸດກະໂປງ Sunshirt",
"rallyAccountDetailDataInterestRate": "ອັດຕາດອກເບ້ຍ",
"rallyAccountDetailDataAnnualPercentageYield": "ຜົນຕອບແທນລາຍປີເປັນເປີເຊັນ",
"rallyAccountDataVacation": "ມື້ພັກ",
"shrineProductFineLinesTee": "ເສື້ອຍືດລາຍຂວາງແບບຖີ່",
"rallyAccountDataHomeSavings": "ບັນຊີເງິນຝາກເຮືອນ",
"rallyAccountDataChecking": "ເງິນຝາກປະຈຳ",
"rallyAccountDetailDataInterestPaidLastYear": "ດອກເບ້ຍທີ່ຈ່າຍປີກາຍ",
"rallyAccountDetailDataNextStatement": "ລາຍການເຄື່ອນໄຫວຂອງບັນຊີຮອບຕໍ່ໄປ",
"rallyAccountDetailDataAccountOwner": "ເຈົ້າຂອງບັນຊີ",
"rallyBudgetCategoryCoffeeShops": "ຮ້ານກາເຟ",
"rallyBudgetCategoryGroceries": "ເຄື່ອງໃຊ້ສອຍ",
"shrineProductCeriseScallopTee": "ເສື້ອຍືດຊາຍໂຄ້ງສີແດງອົມສີບົວ",
"rallyBudgetCategoryClothing": "ເສື້ອຜ້າ",
"rallySettingsManageAccounts": "ຈັດການບັນຊີ",
"rallyAccountDataCarSavings": "ເງິນທ້ອນສຳລັບຊື້ລົດ",
"rallySettingsTaxDocuments": "ເອກະສານພາສີ",
"rallySettingsPasscodeAndTouchId": "ລະຫັດ ແລະ Touch ID",
"rallySettingsNotifications": "ການແຈ້ງເຕືອນ",
"rallySettingsPersonalInformation": "ຂໍ້ມູນສ່ວນຕົວ",
"rallySettingsPaperlessSettings": "ການຕັ້ງຄ່າສຳລັບເອກະສານທີ່ບໍ່ໃຊ້ເຈ້ຍ",
"rallySettingsFindAtms": "ຊອກຫາຕູ້ ATM",
"rallySettingsHelp": "ຊ່ວຍເຫຼືອ",
"rallySettingsSignOut": "ອອກຈາກລະບົບ",
"rallyAccountTotal": "ຮວມ",
"rallyBillsDue": "ຮອດກຳນົດ",
"rallyBudgetLeft": "ຊ້າຍ",
"rallyAccounts": "ບັນຊີ",
"rallyBills": "ໃບບິນ",
"rallyBudgets": "ງົບປະມານ",
"rallyAlerts": "ການແຈ້ງເຕືອນ",
"rallySeeAll": "ເບິ່ງທັງໝົດ",
"rallyFinanceLeft": "ຊ້າຍ",
"rallyTitleOverview": "ພາບຮວມ",
"shrineProductShoulderRollsTee": "ເສື້ອຍືດ Shoulder Rolls",
"shrineNextButtonCaption": "ຕໍ່ໄປ",
"rallyTitleBudgets": "ງົບປະມານ",
"rallyTitleSettings": "ການຕັ້ງຄ່າ",
"rallyLoginLoginToRally": "ເຂົ້າສູ່ລະບົບ Rally",
"rallyLoginNoAccount": "ຍັງບໍ່ມີບັນຊີເທື່ອບໍ?",
"rallyLoginSignUp": "ລົງທະບຽນ",
"rallyLoginUsername": "ຊື່ຜູ້ໃຊ້",
"rallyLoginPassword": "ລະຫັດຜ່ານ",
"rallyLoginLabelLogin": "ເຂົ້າສູ່ລະບົບ",
"rallyLoginRememberMe": "ຈື່ຂ້ອຍໄວ້",
"rallyLoginButtonLogin": "ເຂົ້າສູ່ລະບົບ",
"rallyAlertsMessageHeadsUpShopping": "ກະລຸນາຮັບຊາບ, ຕອນນີ້ທ່ານໃຊ້ງົບປະມານຊື້ເຄື່ອງເດືອນນີ້ໄປແລ້ວ {percent}.",
"rallyAlertsMessageSpentOnRestaurants": "ທ່ານໃຊ້ເງິນຢູ່ຮ້ານອາຫານໃນອາທິດນີ້ໄປແລ້ວ {amount}.",
"rallyAlertsMessageATMFees": "ທ່ານຈ່າຍຄ່າທຳນຽມ ATM ໃນເດືອນນີ້ໄປ {amount}",
"rallyAlertsMessageCheckingAccount": "ດີຫຼາຍ! ບັນຊີເງິນຝາກຂອງທ່ານມີເງິນຫຼາຍກວ່າເດືອນແລ້ວ {percent}.",
"shrineMenuCaption": "ເມນູ",
"shrineCategoryNameAll": "ທັງໝົດ",
"shrineCategoryNameAccessories": "ອຸປະກອນເສີມ",
"shrineCategoryNameClothing": "ເສື້ອຜ້າ",
"shrineCategoryNameHome": "ເຮືອນ",
"shrineLoginUsernameLabel": "ຊື່ຜູ້ໃຊ້",
"shrineLoginPasswordLabel": "ລະຫັດຜ່ານ",
"shrineCancelButtonCaption": "ຍົກເລີກ",
"shrineCartTaxCaption": "ພາສີ:",
"shrineCartPageCaption": "ກະຕ່າ",
"shrineProductQuantity": "ຈຳນວນ: {quantity}",
"shrineProductPrice": "x {price}",
"shrineCartItemCount": "{quantity,plural,=0{ບໍ່ມີລາຍການ}=1{1 ລາຍການ}other{{quantity} ລາຍການ}}",
"shrineCartClearButtonCaption": "ລ້າງລົດເຂັນ",
"shrineCartTotalCaption": "ຮວມ",
"shrineCartSubtotalCaption": "ຍອດຮວມຍ່ອຍ:",
"shrineCartShippingCaption": "ການສົ່ງ:",
"shrineProductGreySlouchTank": "ເສື້ອກ້າມສີເທົາ",
"shrineProductStellaSunglasses": "ແວ່ນຕາກັນແດດ Stella",
"shrineProductWhitePinstripeShirt": "ເສື້ອເຊີດສີຂາວລາຍທາງລວງຕັ້ງ",
"demoTextFieldWhereCanWeReachYou": "ພວກເຮົາຈະຕິດຕໍ່ຫາທ່ານຢູ່ເບີໃດ?",
"settingsTextDirectionLTR": "LTR",
"settingsTextScalingLarge": "ໃຫຍ່",
"demoBottomSheetHeader": "ສ່ວນຫົວ",
"demoBottomSheetItem": "ລາຍການ {value}",
"demoBottomTextFieldsTitle": "ຊ່ອງຂໍ້ຄວາມ",
"demoTextFieldTitle": "ຊ່ອງຂໍ້ຄວາມ",
"demoTextFieldSubtitle": "ຂໍ້ຄວາມ ແລະ ຕົວເລກທີ່ແກ້ໄຂໄດ້ແຖວດຽວ",
"demoTextFieldDescription": "ຊ່ອງຂໍ້ຄວາມຈະເຮັດໃຫ້ຜູ້ໃຊ້ສາມາດພິມຂໍ້ຄວາມໄປໃສ່ສ່ວນຕິດຕໍ່ຜູ້ໃຊ້ໄດ້. ປົກກະຕິພວກມັນຈະປາກົດໃນແບບຟອມ ແລະ ກ່ອງໂຕ້ຕອບຕ່າງໆ.",
"demoTextFieldShowPasswordLabel": "ສະແດງລະຫັດຜ່ານ",
"demoTextFieldHidePasswordLabel": "ເຊື່ອງລະຫັດຜ່ານ",
"demoTextFieldFormErrors": "ກະລຸນາແກ້ໄຂຂໍ້ຜິດພາດສີແດງກ່ອນການສົ່ງຂໍ້ມູນ.",
"demoTextFieldNameRequired": "ຕ້ອງລະບຸຊື່.",
"demoTextFieldOnlyAlphabeticalChars": "ກະລຸນາປ້ອນຕົວອັກສອນພະຍັນຊະນະເທົ່ານັ້ນ.",
"demoTextFieldEnterUSPhoneNumber": "(###) ###-#### - ໃສ່ເບີໂທສະຫະລັດ.",
"demoTextFieldEnterPassword": "ກະລຸນາປ້ອນລະຫັດຜ່ານ.",
"demoTextFieldPasswordsDoNotMatch": "ລະຫັດຜ່ານບໍ່ກົງກັນ",
"demoTextFieldWhatDoPeopleCallYou": "ຄົນອື່ນເອີ້ນທ່ານວ່າແນວໃດ?",
"demoTextFieldNameField": "ຊື່*",
"demoBottomSheetButtonText": "ສະແດງ BOTTOM SHEET",
"demoTextFieldPhoneNumber": "ເບີໂທລະສັບ*",
"demoBottomSheetTitle": "Bottom sheet",
"demoTextFieldEmail": "ອີເມວ",
"demoTextFieldTellUsAboutYourself": "ບອກພວກເຮົາກ່ຽວກັບຕົວທ່ານ (ຕົວຢ່າງ: ໃຫ້ຈົດສິ່ງທີ່ທ່ານເຮັດ ຫຼື ວຽກຍາມຫວ່າງຂອງທ່ານ)",
"demoTextFieldKeepItShort": "ຂຽນສັ້ນໆເພາະນີ້ເປັນພຽງການສາທິດ.",
"starterAppGenericButton": "ປຸ່ມ",
"demoTextFieldLifeStory": "ເລື່ອງລາວຊີວິດ",
"demoTextFieldSalary": "ເງິນເດືອນ",
"demoTextFieldUSD": "USD",
"demoTextFieldNoMoreThan": "ບໍ່ເກີນ 8 ຕົວອັກສອນ.",
"demoTextFieldPassword": "ລະຫັດຜ່ານ*",
"demoTextFieldRetypePassword": "ພິມລະຫັດຜ່ານຄືນໃໝ່*",
"demoTextFieldSubmit": "ສົ່ງຂໍ້ມູນ",
"demoBottomNavigationSubtitle": "ການນຳທາງທາງລຸ່ມທີ່ມີມຸມມອງແບບຄ່ອຍໆປາກົດ",
"demoBottomSheetAddLabel": "ເພີ່ມ",
"demoBottomSheetModalDescription": "Modal bottom sheet ເປັນທາງເລືອກທີ່ໃຊ້ແທນເມນູ ຫຼື ກ່ອງໂຕ້ຕອບ ແລະ ປ້ອງກັນບໍ່ໃຫ້ຜູ້ໃຊ້ໂຕ້ຕອບກັບສ່ວນທີ່ເຫຼືອຂອງແອັບ.",
"demoBottomSheetModalTitle": "Modal bottom sheet",
"demoBottomSheetPersistentDescription": "Persistent bottom sheet ຈະສະແດງຂໍ້ມູນທີ່ເສີມເນື້ອຫາຫຼັກຂອງແອັບ. ຜູ້ໃຊ້ຈະຍັງສາມາດເບິ່ງເຫັນອົງປະກອບນີ້ໄດ້ເຖິງແມ່ນວ່າຈະໂຕ້ຕອບກັບສ່ວນອື່ນໆຂອງແອັບຢູ່ກໍຕາມ.",
"demoBottomSheetPersistentTitle": "Persistent bottom sheet",
"demoBottomSheetSubtitle": "Persistent ແລະ modal bottom sheets",
"demoTextFieldNameHasPhoneNumber": "ເບີໂທລະສັບຂອງ {name} ແມ່ນ {phoneNumber}",
"buttonText": "ປຸ່ມ",
"demoTypographyDescription": "ຄຳຈຳກັດຄວາມຂອງຕົວອັກສອນຮູບແບບຕ່າງໆທີ່ພົບໃນ Material Design.",
"demoTypographySubtitle": "ຮູບແບບຂໍ້ຄວາມທັງໝົດທີ່ກຳນົດໄວ້ລ່ວງໜ້າ",
"demoTypographyTitle": "ການພິມ",
"demoFullscreenDialogDescription": "ຄຸນສົມບັດ fullscreenDialog ກຳນົດວ່າຈະໃຫ້ໜ້າທີ່ສົ່ງເຂົ້າມານັ້ນເປັນກ່ອງໂຕ້ຕອບແບບເຕັມຈໍຫຼືບໍ່",
"demoFlatButtonDescription": "ປຸ່ມຮາບພຽງຈະສະແດງຮອຍແຕ້ມໝຶກເມື່ອກົດແຕ່ຈະບໍ່ຍົກຂຶ້ນ. ໃຊ້ປຸ່ມຮາບພຽງຢູ່ແຖບເຄື່ອງມື, ໃນກ່ອງໂຕ້ຕອບ ແລະ ໃນແຖວທີ່ມີໄລຍະຫ່າງຈາກຂອບ.",
"demoBottomNavigationDescription": "ແຖບນຳທາງທາງລຸ່ມສະແດງປາຍທາງ 3-5 ບ່ອນຢູ່ລຸ່ມຂອງໜ້າຈໍ. ປາຍທາງແຕ່ລະບ່ອນຈະສະແດງດ້ວຍໄອຄອນ ແລະ ປ້າຍກຳກັບແບບຂໍ້ຄວາມທີ່ບໍ່ບັງຄັບ. ເມື່ອຜູ້ໃຊ້ແຕະໃສ່ໄອຄອນນຳທາງທາງລຸ່ມແລ້ວ, ລະບົບຈະພາໄປຫາປາຍທາງຂອງການນຳທາງລະດັບເທິງສຸດທີ່ເຊື່ອມໂຍງກັບໄອຄອນນັ້ນ.",
"demoBottomNavigationSelectedLabel": "ປ້າຍກຳກັບທີ່ເລືອກ",
"demoBottomNavigationPersistentLabels": "ປ້າຍກຳກັບທີ່ສະແດງຕະຫຼອດ",
"starterAppDrawerItem": "ລາຍການ {value}",
"demoTextFieldRequiredField": "* ເປັນຊ່ອງທີ່ຕ້ອງລະບຸຂໍ້ມູນ",
"demoBottomNavigationTitle": "ການນຳທາງລຸ່ມສຸດ",
"settingsLightTheme": "ແຈ້ງ",
"settingsTheme": "ຮູບແບບສີສັນ",
"settingsPlatformIOS": "iOS",
"settingsPlatformAndroid": "Android",
"settingsTextDirectionRTL": "RTL",
"settingsTextScalingHuge": "ໃຫຍ່ຫຼາຍ",
"cupertinoButton": "ປຸ່ມ",
"settingsTextScalingNormal": "ປົກກະຕິ",
"settingsTextScalingSmall": "ນ້ອຍ",
"settingsSystemDefault": "ລະບົບ",
"settingsTitle": "ການຕັ້ງຄ່າ",
"rallyDescription": "ແອັບການເງິນສ່ວນຕົວ",
"aboutDialogDescription": "ເພື່ອເບິ່ງຊອດໂຄດສຳລັບແອັບນີ້, ກະລຸນາໄປທີ່ {repoLink}.",
"bottomNavigationCommentsTab": "ຄຳເຫັນ",
"starterAppGenericBody": "ສ່ວນເນື້ອຫາ",
"starterAppGenericHeadline": "ຫົວຂໍ້",
"starterAppGenericSubtitle": "ຄຳແປ",
"starterAppGenericTitle": "ຊື່",
"starterAppTooltipSearch": "ຊອກຫາ",
"starterAppTooltipShare": "ແບ່ງປັນ",
"starterAppTooltipFavorite": "ລາຍການທີ່ມັກ",
"starterAppTooltipAdd": "ເພີ່ມ",
"bottomNavigationCalendarTab": "ປະຕິທິນ",
"starterAppDescription": "ໂຄງຮ່າງເລີ່ມຕົ້ນທີ່ມີການຕອບສະໜອງ",
"starterAppTitle": "ແອັບເລີ່ມຕົ້ນ",
"aboutFlutterSamplesRepo": "ບ່ອນເກັບ GitHub ສຳລັບຕົວຢ່າງ Flutter",
"bottomNavigationContentPlaceholder": "ຕົວແທນບ່ອນສຳລັບແຖບ {title}",
"bottomNavigationCameraTab": "ກ້ອງຖ່າຍຮູບ",
"bottomNavigationAlarmTab": "ໂມງປຸກ",
"bottomNavigationAccountTab": "ບັນຊີ",
"demoTextFieldYourEmailAddress": "ທີ່ຢູ່ອີເມວຂອງທ່ານ",
"demoToggleButtonDescription": "ປຸ່ມເປີດ/ປິດອາດໃຊ້ເພື່ອຈັດກຸ່ມຕົວເລືອກທີ່ກ່ຽວຂ້ອງກັນ. ກຸ່ມຂອງປຸ່ມເປີດ/ປິດທີ່ກ່ຽວຂ້ອງກັນຄວນໃຊ້ຄອນເທນເນີຮ່ວມກັນເພື່ອເປັນການເນັ້ນກຸ່ມເຫຼົ່ານັ້ນ",
"colorsGrey": "ສີເທົາ",
"colorsBrown": "ສີນ້ຳຕານ",
"colorsDeepOrange": "ສີສົ້ມແກ່",
"colorsOrange": "ສີສົ້ມ",
"colorsAmber": "ສີເຫຼືອງອຳພັນ",
"colorsYellow": "ສີເຫຼືອງ",
"colorsLime": "ສີເຫຼືອງໝາກນາວ",
"colorsLightGreen": "ສີຂຽວອ່ອນ",
"colorsGreen": "ສີຂຽວ",
"homeHeaderGallery": "ຄັງຮູບພາບ",
"homeHeaderCategories": "ໝວດໝູ່",
"shrineDescription": "ແອັບຂາຍຍ່ອຍດ້ານແຟຊັນ",
"craneDescription": "ແອັບການທ່ອງທ່ຽວທີ່ປັບແຕ່ງສ່ວນຕົວ",
"homeCategoryReference": "ຮູບແບບ ແລະ ອື່ນໆ",
"demoInvalidURL": "ບໍ່ສາມາດສະແດງ URL ໄດ້:",
"demoOptionsTooltip": "ຕົວເລືອກ",
"demoInfoTooltip": "ຂໍ້ມູນ",
"demoCodeTooltip": "ລະຫັດສາທິດ",
"demoDocumentationTooltip": "ເອກະສານ API",
"demoFullscreenTooltip": "ເຕັມຈໍ",
"settingsTextScaling": "ການຂະຫຍາຍຂໍ້ຄວາມ",
"settingsTextDirection": "ທິດທາງຂໍ້ຄວາມ",
"settingsLocale": "ພາສາ",
"settingsPlatformMechanics": "ໂຄງສ້າງຂອງແພລດຟອມ",
"settingsDarkTheme": "ມືດ",
"settingsSlowMotion": "ສະໂລໂມຊັນ",
"settingsAbout": "ກ່ຽວກັບ Flutter Gallery",
"settingsFeedback": "ສົ່ງຄຳຕິຊົມ",
"settingsAttribution": "ອອກແບບໂດຍ TOASTER ໃນລອນດອນ",
"demoButtonTitle": "ປຸ່ມ",
"demoButtonSubtitle": "ຂໍ້ຄວາມ, ຍົກຂຶ້ນ, ມີຂອບ ແລະ ອື່ນໆ",
"demoFlatButtonTitle": "ປຸ່ມຮາບພຽງ",
"demoRaisedButtonDescription": "ປຸ່ມແບບຍົກຂຶ້ນຈະເພີ່ມມິຕິໃຫ້ກັບໂຄງຮ່າງທີ່ສ່ວນໃຫຍ່ຮາບພຽງ. ພວກມັນຈະເນັ້ນຟັງຊັນຕ່າງໆທີ່ສຳຄັນໃນພື້ນທີ່ກວ້າງ ຫຼື ມີການໃຊ້ວຽກຫຼາຍ.",
"demoRaisedButtonTitle": "ປຸ່ມແບບຍົກຂຶ້ນ",
"demoOutlineButtonTitle": "ປຸ່ມມີເສັ້ນຂອບ",
"demoOutlineButtonDescription": "ປຸ່ມແບບມີເສັ້ນຂອບຈະເປັນສີທຶບ ແລະ ຍົກຂຶ້ນເມື່ອກົດໃສ່. ມັກຈະຈັບຄູ່ກັບປຸ່ມແບບຍົກຂຶ້ນເພື່ອລະບຸວ່າມີການດຳເນີນການສຳຮອງຢ່າງອື່ນ.",
"demoToggleButtonTitle": "ປຸ່ມເປີດ/ປິດ",
"colorsTeal": "ສີຟ້າອົມຂຽວ",
"demoFloatingButtonTitle": "ປຸ່ມຄຳສັ່ງແບບລອຍ",
"demoFloatingButtonDescription": "ປຸ່ມການເຮັດວຽກແບບລອຍເປັນປຸ່ມໄອຄອນຮູບວົງມົນທີ່ລອຍຢູ່ເທິງເນື້ອຫາເພື່ອໂປຣໂໝດການດຳເນີນການຫຼັກໃນແອັບພລິເຄຊັນ.",
"demoDialogTitle": "ກ່ອງໂຕ້ຕອບ",
"demoDialogSubtitle": "ງ່າຍໆ, ການແຈ້ງເຕືອນ ແລະ ເຕັມຈໍ",
"demoAlertDialogTitle": "ການແຈ້ງເຕືອນ",
"demoAlertDialogDescription": "ກ່ອງໂຕ້ຕອບການແຈ້ງເຕືອນເພື່ອບອກໃຫ້ຜູ້ໃຊ້ຮູ້ກ່ຽວກັບສະຖານະການທີ່ຕ້ອງຮັບຮູ້. ກ່ອງໂຕ້ຕອບການແຈ້ງເຕືອນທີ່ມີຊື່ ແລະ ລາຍຊື່ຄຳສັ່ງແບບບໍ່ບັງຄັບ.",
"demoAlertTitleDialogTitle": "ການແຈ້ງເຕືອນທີ່ມີຊື່",
"demoSimpleDialogTitle": "ງ່າຍໆ",
"demoSimpleDialogDescription": "ກ່ອງໂຕ້ຕອບງ່າຍໆທີ່ສະເໜີຕົວເລືອກໃຫ້ຜູ້ໃຊ້ລະຫວ່າງຫຼາຍໆຕົວເລືອກ. ກ່ອງໂຕ້ຕອບແບບງ່າຍໆຈະມີຊື່ແບບບໍ່ບັງຄັບທີ່ສະແດງທາງເທິງຕົວເລືອກ.",
"demoFullscreenDialogTitle": "ເຕັມຈໍ",
"demoCupertinoButtonsTitle": "ປຸ່ມ",
"demoCupertinoButtonsSubtitle": "ປຸ່ມແບບ iOS",
"demoCupertinoButtonsDescription": "ປຸ່ມແບບ iOS. ມັນຈະໃສ່ຂໍ້ຄວາມ ແລະ/ຫຼື ໄອຄອນທີ່ຄ່ອຍໆປາກົດຂຶ້ນ ແລະ ຄ່ອຍໆຈາງລົງເມື່ອແຕະໃສ່. ອາດມີ ຫຼື ບໍ່ມີພື້ນຫຼັງກໍໄດ້.",
"demoCupertinoAlertsTitle": "ການແຈ້ງເຕືອນ",
"demoCupertinoAlertsSubtitle": "ກ່ອງໂຕ້ຕອບການເຕືອນແບບ iOS",
"demoCupertinoAlertTitle": "ການເຕືອນ",
"demoCupertinoAlertDescription": "ກ່ອງໂຕ້ຕອບການແຈ້ງເຕືອນເພື່ອບອກໃຫ້ຜູ້ໃຊ້ຮູ້ກ່ຽວກັບສະຖານະການທີ່ຕ້ອງຮັບຮູ້. ກ່ອງໂຕ້ຕອບການແຈ້ງເຕືອນທີ່ມີຊື່, ເນື້ອຫາ ແລະ ລາຍຊື່ຄຳສັ່ງແບບບໍ່ບັງຄັບ. ຊື່ຈະສະແດງຢູ່ທາງເທິງຂອງເນື້ອຫາ ແລະ ຄຳສັ່ງແມ່ນຈະສະແດງຢູ່ທາງລຸ່ມຂອງເນື້ອຫາ.",
"demoCupertinoAlertWithTitleTitle": "ການແຈ້ງເຕືອນທີ່ມີຊື່",
"demoCupertinoAlertButtonsTitle": "ການແຈ້ງເຕືອນແບບມີປຸ່ມ",
"demoCupertinoAlertButtonsOnlyTitle": "ປຸ່ມການແຈ້ງເຕືອນເທົ່ານັ້ນ",
"demoCupertinoActionSheetTitle": "ຊີດຄຳສັ່ງ",
"demoCupertinoActionSheetDescription": "ຊີດຄຳສັ່ງເປັນຮູບແບບການແຈ້ງເຕືອນທີ່ເຈາະຈົງເຊິ່ງນຳສະເໜີຊຸດຕົວເລືອກຢ່າງໜ້ອຍສອງຢ່າງທີ່ກ່ຽວຂ້ອງກັບບໍລິບົດປັດຈຸບັນໃຫ້ກັບຜູ້ໃຊ້. ຊີດຄຳສັ່ງສາມາດມີຊື່, ຂໍ້ຄວາມເພີ່ມເຕີມ ແລະ ລາຍຊື່ຄຳສັ່ງໄດ້.",
"demoColorsTitle": "ສີ",
"demoColorsSubtitle": "ສີທີ່ລະບຸໄວ້ລ່ວງໜ້າທັງໝົດ",
"demoColorsDescription": "ສີ ຫຼື ແຜງສີຄົງທີ່ເຊິ່ງເປັນຕົວແທນຊຸດສີຂອງ Material Design.",
"buttonTextEnabled": "ENABLED",
"buttonTextDisabled": "DISABLED",
"buttonTextCreate": "ສ້າງ",
"dialogSelectedOption": "ທ່ານເລືອກ: \"{value}\" ແລ້ວ",
"dialogDiscardTitle": "ຍົກເລີກຮ່າງຖິ້ມບໍ?",
"dialogLocationTitle": "ໃຊ້ບໍລິການສະຖານທີ່ຂອງ Google ບໍ?",
"dialogLocationDescription": "ໃຫ້ Google ຊ່ວຍລະບຸສະຖານທີ່. ນີ້ໝາຍເຖິງການສົ່ງຂໍ້ມູນສະຖານທີ່ທີ່ບໍ່ລະບຸຕົວຕົນໄປໃຫ້ Google, ເຖິງແມ່ນວ່າຈະບໍ່ມີແອັບເປີດໃຊ້ຢູ່ກໍຕາມ.",
"dialogCancel": "ຍົກເລີກ",
"dialogDiscard": "ຍົກເລີກ",
"dialogDisagree": "ບໍ່ຍອມຮັບ",
"dialogAgree": "ເຫັນດີ",
"dialogSetBackup": "ຕັ້ງບັນຊີສຳຮອງ",
"colorsBlueGrey": "ສີຟ້າເທົາ",
"dialogShow": "ສະແດງກ່ອງໂຕ້ຕອບ",
"dialogFullscreenTitle": "ກ່ອງໂຕ້ຕອບແບບເຕັມຈໍ",
"dialogFullscreenSave": "ບັນທຶກ",
"dialogFullscreenDescription": "ເດໂມກ່ອງໂຕ້ຕອບແບບເຕັມຈໍ",
"cupertinoButtonEnabled": "Enabled",
"cupertinoButtonDisabled": "Disabled",
"cupertinoButtonWithBackground": "ມີພື້ນຫຼັງ",
"cupertinoAlertCancel": "ຍົກເລີກ",
"cupertinoAlertDiscard": "ຍົກເລີກ",
"cupertinoAlertLocationTitle": "ອະນຸຍາດໃຫ້ \"ແຜນທີ່\" ເຂົ້າເຖິງສະຖານທີ່ຂອງທ່ານໄດ້ໃນຂະນະທີ່ທ່ານກຳລັງໃຊ້ແອັບບໍ?",
"cupertinoAlertLocationDescription": "ສະຖານທີ່ປັດຈຸບັນຂອງທ່ານຈະຖືກສະແດງຢູ່ແຜນທີ່ ແລະ ຖືກໃຊ້ເພື່ອເສັ້ນທາງ, ຜົນການຊອກຫາທີ່ຢູ່ໃກ້ຄຽງ ແລະ ເວລາເດີນທາງໂດຍປະມານ.",
"cupertinoAlertAllow": "ອະນຸຍາດ",
"cupertinoAlertDontAllow": "ບໍ່ອະນຸຍາດ",
"cupertinoAlertFavoriteDessert": "ເລືອກຂອງຫວານທີ່ມັກ",
"cupertinoAlertDessertDescription": "ກະລຸນາເລືອກປະເພດຂອງຫວານທີ່ທ່ານມັກຈາກລາຍຊື່ທາງລຸ່ມ. ການເລືອກຂອງທ່ານຈະຖືກໃຊ້ເພື່ອປັບແຕ່ງລາຍຊື່ຮ້ານອາຫານທີ່ແນະນຳໃນພື້ນທີ່ຂອງທ່ານ.",
"cupertinoAlertCheesecake": "ຊີສເຄັກ",
"cupertinoAlertTiramisu": "ທີຣາມິສຸ",
"cupertinoAlertApplePie": "Apple Pie",
"cupertinoAlertChocolateBrownie": "ຊັອກໂກແລັດບຣາວນີ",
"cupertinoShowAlert": "ສະແດງການແຈ້ງເຕືອນ",
"colorsRed": "ສີແດງ",
"colorsPink": "ສີບົວ",
"colorsPurple": "ສີມ່ວງ",
"colorsDeepPurple": "ສີມ່ວງເຂັ້ມ",
"colorsIndigo": "ສີຄາມ",
"colorsBlue": "ສີຟ້າ",
"colorsLightBlue": "ສີຟ້າອ່ອນ",
"colorsCyan": "ສີຟ້າຂຽວ",
"dialogAddAccount": "ເພີ່ມບັນຊີ",
"Gallery": "ຄັງຮູບພາບ",
"Categories": "ໝວດໝູ່",
"SHRINE": "ເທວະສະຖານ",
"Basic shopping app": "ແອັບຊື້ເຄື່ອງພື້ນຖານ",
"RALLY": "ການແຂ່ງລົດ",
"CRANE": "ເຄຣນ",
"Travel app": "ແອັບທ່ອງທ່ຽວ",
"MATERIAL": "ວັດຖຸ",
"CUPERTINO": "ຄູເປີຕິໂນ",
"REFERENCE STYLES & MEDIA": "ຮູບແບບການອ້າງອີງ ແລະ ສື່"
}
| gallery/lib/l10n/intl_lo.arb/0 | {
"file_path": "gallery/lib/l10n/intl_lo.arb",
"repo_id": "gallery",
"token_count": 65584
} | 842 |
{
"loading": "Yükleniyor",
"deselect": "Seçimi kaldır",
"select": "Seç",
"selectable": "Seçilebilir (uzun basma)",
"selected": "Seçili",
"demo": "Demo",
"bottomAppBar": "Alt uygulama çubuğu",
"notSelected": "Seçili değil",
"demoCupertinoSearchTextFieldTitle": "Arama metni alanı",
"demoCupertinoPicker": "Seçici",
"demoCupertinoSearchTextFieldSubtitle": "iOS stili arama metin alanı",
"demoCupertinoSearchTextFieldDescription": "Kullanıcının metin girerek arama yapmasını sağlayan ve öneriler sunup filtreleme yapabilen bir arama metin alanı.",
"demoCupertinoSearchTextFieldPlaceholder": "Metin girin",
"demoCupertinoScrollbarTitle": "Kaydırma çubuğu",
"demoCupertinoScrollbarSubtitle": "iOS stili kaydırma çubuğu",
"demoCupertinoScrollbarDescription": "Belirtilen alt öğeyi sarmalayan kaydırma çubuğu",
"demoTwoPaneItem": "{value} öğesi",
"demoTwoPaneList": "Liste",
"demoTwoPaneFoldableLabel": "Katlanabilir",
"demoTwoPaneSmallScreenLabel": "Küçük Ekran",
"demoTwoPaneSmallScreenDescription": "TwoPane, küçük ekranlı bir cihazda bu şekilde davranır.",
"demoTwoPaneTabletLabel": "Tablet/Masaüstü",
"demoTwoPaneTabletDescription": "TwoPane, tablet veya masaüstü gibi büyük bir ekranda bu şekilde davranır.",
"demoTwoPaneTitle": "TwoPane",
"demoTwoPaneSubtitle": "Katlanabilir, büyük ve küçük ekranlarla uyumlu düzenler",
"splashSelectDemo": "Demo seçin",
"demoTwoPaneFoldableDescription": "TwoPane, katlanabilir bir cihazda bu şekilde davranır.",
"demoTwoPaneDetails": "Ayrıntılar",
"demoTwoPaneSelectItem": "Öğe seçin",
"demoTwoPaneItemDetails": "{value} öğe ayrıntıları",
"demoCupertinoContextMenuActionText": "İçerik menüsünü görmek için Flutter logosuna dokunup basılı tutun.",
"demoCupertinoContextMenuDescription": "Bir öğeye uzun basıldığında görünen iOS stili tam ekran içerik menüsü.",
"demoAppBarTitle": "Uygulama çubuğu",
"demoAppBarDescription": "Uygulama çubuğu, geçerli ekranla ilgili içerikleri ve işlemleri gösterir. Bu çubuk; marka bilinci oluşturma, ekran başlıkları, gezinme ve işlemler için kullanılır",
"demoDividerTitle": "Ayırıcı",
"demoDividerSubtitle": "Ayırıcı, içeriği listelerde ve düzenlerde gruplandıran ince bir çizgidir.",
"demoDividerDescription": "Ayırıcılar, içeriği ayırmak için listelerde, çekmecelerde ve başka yerlerde kullanılabilir.",
"demoVerticalDividerTitle": "Dikey Ayırıcı",
"demoCupertinoContextMenuTitle": "İçerik Menüsü",
"demoCupertinoContextMenuSubtitle": "iOS stili içerik menüsü",
"demoAppBarSubtitle": "Geçerli ekranla ilgili bilgileri ve işlemleri gösterir",
"demoCupertinoContextMenuActionOne": "Birinci işlem",
"demoCupertinoContextMenuActionTwo": "İkinci işlem",
"demoDateRangePickerDescription": "Materyal Tasarıma sahip tarih seçici içeren bir iletişim kutusu gösterir.",
"demoDateRangePickerTitle": "Tarih Aralığı Seçici",
"demoNavigationDrawerUserName": "Kullanıcı Adı",
"demoNavigationDrawerUserEmail": "[email protected]",
"demoNavigationDrawerText": "Çekmeceyi görmek için kenardan kaydırın veya sol üstteki simgeye dokunun",
"demoNavigationRailTitle": "Gezinme Sütunu",
"demoNavigationRailSubtitle": "Uygulamada Gezinme Sütunu'nu görüntüleme",
"demoNavigationRailDescription": "Az sayıda, genellikle üç ila beş görünüm arasında gezinmek için uygulamanın solunda veya sağında görüntülenmesi amaçlanan bir materyal widget'ı.",
"demoNavigationRailFirst": "Birinci",
"demoNavigationDrawerTitle": "Gezinme Çekmecesi",
"demoNavigationRailThird": "Üçüncü",
"replyStarredLabel": "Yıldızlı",
"demoTextButtonDescription": "Basıldığında mürekkep sıçraması görüntüleyen ancak basıldıktan sonra yukarı kalkmayan metin düğmesi. Metin düğmelerini araç çubuklarında, iletişim kutularında ve dolgulu satır içinde kullanın",
"demoElevatedButtonTitle": "Yükseltilmiş Düğme",
"demoElevatedButtonDescription": "Yükseltilmiş düğmeler çoğunlukla düz düzenlere boyut ekler. Yoğun veya geniş alanlarda işlevleri vurgular.",
"demoOutlinedButtonTitle": "Dış Çizgili Düğme",
"demoOutlinedButtonDescription": "Dış çizgili düğmeler basıldığında opak olur ve yükselir. Alternatif, ikincil işlemi belirtmek için genellikle yükseltilmiş düğmelerle eşlenirler.",
"demoContainerTransformDemoInstructions": "Kartlar, Listeler ve FAB",
"demoNavigationDrawerSubtitle": "Uygulama çubuğunda çekmece görüntüleme",
"replyDescription": "Verimli, hedef odaklı bir e-posta uygulaması",
"demoNavigationDrawerDescription": "Uygulamada gezinme bağlantılarını göstermek için ekranın köşesinden yatay olarak kayan Materyal Tasarım paneli.",
"replyDraftsLabel": "Taslaklar",
"demoNavigationDrawerToPageOne": "Birinci Öğe",
"replyInboxLabel": "Gelen Kutusu",
"demoSharedXAxisDemoInstructions": "İleri ve Geri Düğmeleri",
"replySpamLabel": "Spam",
"replyTrashLabel": "Çöp Kutusu",
"replySentLabel": "Gönderilmiş",
"demoNavigationRailSecond": "İkinci",
"demoNavigationDrawerToPageTwo": "İkinci Öğe",
"demoFadeScaleDemoInstructions": "Kalıcı iletişim kutusu ve FAB",
"demoFadeThroughDemoInstructions": "Alt gezinme",
"demoSharedZAxisDemoInstructions": "Ayarlar simge düğmesi",
"demoSharedYAxisDemoInstructions": "\"Son Çalınanlar\"a göre sıralama",
"demoTextButtonTitle": "Metin Düğmesi",
"demoSharedZAxisBeefSandwichRecipeTitle": "Etli Sandviç",
"demoSharedZAxisDessertRecipeDescription": "Tatlı tarifi",
"demoSharedYAxisAlbumTileSubtitle": "Sanatçı",
"demoSharedYAxisAlbumTileTitle": "Albüm",
"demoSharedYAxisRecentSortTitle": "Son çalınanlar",
"demoSharedYAxisAlphabeticalSortTitle": "A'dan Z'ye",
"demoSharedYAxisAlbumCount": "268 albüm",
"demoSharedYAxisTitle": "Paylaşılan y ekseni",
"demoSharedXAxisCreateAccountButtonText": "HESAP OLUŞTUR",
"demoFadeScaleAlertDialogDiscardButton": "SİL",
"demoSharedXAxisSignInTextFieldLabel": "E-posta adresi veya telefon numarası",
"demoSharedXAxisSignInSubtitleText": "Hesabınızla oturum açın",
"demoSharedXAxisSignInWelcomeText": "Merhaba David Park",
"demoSharedXAxisIndividualCourseSubtitle": "Ayrı Olarak Gösterilir",
"demoSharedXAxisBundledCourseSubtitle": "Paket",
"demoFadeThroughAlbumsDestination": "Albümler",
"demoSharedXAxisDesignCourseTitle": "Tasarım",
"demoSharedXAxisIllustrationCourseTitle": "Resim",
"demoSharedXAxisBusinessCourseTitle": "İş",
"demoSharedXAxisArtsAndCraftsCourseTitle": "Sanat ve El Sanatları",
"demoMotionPlaceholderSubtitle": "İkincil metin",
"demoFadeScaleAlertDialogCancelButton": "İPTAL",
"demoFadeScaleAlertDialogHeader": "Uyarı İletişim Kutusu",
"demoFadeScaleHideFabButton": "FAB'I GİZLE",
"demoFadeScaleShowFabButton": "FAB'I GÖSTER",
"demoFadeScaleShowAlertDialogButton": "KALICI İLETİŞİM KUTUSUNU GÖSTER",
"demoFadeScaleDescription": "Şeffaflaşan desen, ekranın ortasında kararan iletişim kutusu gibi ekran sınırları içine giren veya dışına çıkan kullanıcı arayüzü öğeleri için kullanılır.",
"demoFadeScaleTitle": "Şeffaflaştırma",
"demoFadeThroughTextPlaceholder": "123 fotoğraf",
"demoFadeThroughSearchDestination": "Ara",
"demoFadeThroughPhotosDestination": "Fotoğraflar",
"demoSharedXAxisCoursePageSubtitle": "Pakete dahil edilen kategoriler, feed'inizde grup olarak görünür. Bunu daha sonra istediğiniz zaman değiştirebilirsiniz.",
"demoFadeThroughDescription": "Şeffaflaşarak geçiş deseni, birbiriyle güçlü bir ilişkisi olmayan kullanıcı arayüzü öğeleri arasındaki geçişler için kullanılır.",
"demoFadeThroughTitle": "Şeffaflaşarak geçiş",
"demoSharedZAxisHelpSettingLabel": "Yardım",
"demoMotionSubtitle": "Önceden tanımlanmış tüm geçiş desenleri",
"demoSharedZAxisNotificationSettingLabel": "Bildirimler",
"demoSharedZAxisProfileSettingLabel": "Profil",
"demoSharedZAxisSavedRecipesListTitle": "Kaydedilen Tarifler",
"demoSharedZAxisBeefSandwichRecipeDescription": "Etli Sandviç tarifi",
"demoSharedZAxisCrabPlateRecipeDescription": "Yengeç tabağı tarifi",
"demoSharedXAxisCoursePageTitle": "Kurslarınızı düzenleme",
"demoSharedZAxisCrabPlateRecipeTitle": "Yengeç",
"demoSharedZAxisShrimpPlateRecipeDescription": "Karides tabağı tarifi",
"demoSharedZAxisShrimpPlateRecipeTitle": "Karides",
"demoContainerTransformTypeFadeThrough": "ŞEFFAFLAŞARAK GEÇİŞ",
"demoSharedZAxisDessertRecipeTitle": "Tatlı",
"demoSharedZAxisSandwichRecipeDescription": "Sandviç tarifi",
"demoSharedZAxisSandwichRecipeTitle": "Sandviç",
"demoSharedZAxisBurgerRecipeDescription": "Burger tarifi",
"demoSharedZAxisBurgerRecipeTitle": "Burger",
"demoSharedZAxisSettingsPageTitle": "Ayarlar",
"demoSharedZAxisTitle": "Paylaşılan z ekseni",
"demoSharedZAxisPrivacySettingLabel": "Gizlilik",
"demoMotionTitle": "Hareket",
"demoContainerTransformTitle": "Kapsayıcı Dönüşümü",
"demoContainerTransformDescription": "Kapsayıcı dönüşüm deseni, kapsayıcı içeren kullanıcı arayüzü öğeleri arasındaki geçişler için tasarlanmıştır. Bu desen, iki kullanıcı arayüzü öğesi arasında görünür bir bağlantı oluşturur",
"demoContainerTransformModalBottomSheetTitle": "Şeffaflaştırma modu",
"demoContainerTransformTypeFade": "ŞEFFAFLAŞTIRMA",
"demoSharedYAxisAlbumTileDurationUnit": "dk.",
"demoMotionPlaceholderTitle": "Başlık",
"demoSharedXAxisForgotEmailButtonText": "E-POSTA ADRESİNİZİ Mİ UNUTTUNUZ?",
"demoMotionSmallPlaceholderSubtitle": "İkincil",
"demoMotionDetailsPageTitle": "Ayrıntılar Sayfası",
"demoMotionListTileTitle": "Liste öğesi",
"demoSharedAxisDescription": "Paylaşılan eksen deseni, uzamsal veya gezinme ilişkisi olan kullanıcı arayüzü öğeleri arasındaki geçişler için kullanılır. Bu desen, öğeler arasındaki ilişkiyi güçlendirmek için x, y veya z eksenlerinde paylaşılan bir dönüşüm kullanır.",
"demoSharedXAxisTitle": "Paylaşılan x ekseni",
"demoSharedXAxisBackButtonText": "GERİ",
"demoSharedXAxisNextButtonText": "İLERİ",
"demoSharedXAxisCulinaryCourseTitle": "Mutfak",
"githubRepo": "{repoName} GitHub havuzu",
"fortnightlyMenuUS": "ABD",
"fortnightlyMenuBusiness": "İş Dünyası",
"fortnightlyMenuScience": "Bilim",
"fortnightlyMenuSports": "Spor",
"fortnightlyMenuTravel": "Seyahat",
"fortnightlyMenuCulture": "Kültür",
"fortnightlyTrendingTechDesign": "TechDesign",
"rallyBudgetDetailAmountLeft": "Kalan Miktar",
"fortnightlyHeadlineArmy": "Green Army'yi İçeriden Değiştirme",
"fortnightlyDescription": "İçeriğe odaklanmış haberler uygulaması",
"rallyBillDetailAmountDue": "Ödenmesi Gereken Tutar",
"rallyBudgetDetailTotalCap": "Toplam Değer",
"rallyBudgetDetailAmountUsed": "Kullanılan Miktar",
"fortnightlyTrendingHealthcareRevolution": "HealthcareRevolution",
"fortnightlyMenuFrontPage": "Ön Sayfa",
"fortnightlyMenuWorld": "Dünya",
"rallyBillDetailAmountPaid": "Ödenen Tutar",
"fortnightlyMenuPolitics": "Siyaset",
"fortnightlyHeadlineBees": "Çiftlik Arılarında Azalma",
"fortnightlyHeadlineGasoline": "Benzinin Geleceği",
"fortnightlyTrendingGreenArmy": "GreenArmy",
"fortnightlyHeadlineFeminists": "Partizanlıkta Feministler Öne Çıkıyor",
"fortnightlyHeadlineFabrics": "Tasarımcılar Modern Fabrikalar İnşa Etmek için Teknolojiden Yararlanıyorlar",
"fortnightlyHeadlineStocks": "Hisse Senetleri Piyasası Durgunlaştıkça Çoğu Yatırımcı Dövize Yöneliyor",
"fortnightlyTrendingReform": "Reform",
"fortnightlyMenuTech": "Teknoloji",
"fortnightlyHeadlineWar": "Amerikalıların Savaş Sırasında Bölünmüş Yaşamları",
"fortnightlyHeadlineHealthcare": "Sessiz, Ancak Güçlü Bir Sağlık Reformu",
"fortnightlyLatestUpdates": "Son Güncellemeler",
"fortnightlyTrendingStocks": "Hisse senetleri",
"rallyBillDetailTotalAmount": "Toplam Tutar",
"demoCupertinoPickerDateTime": "Tarih ve Saat",
"signIn": "OTURUM AÇ",
"dataTableRowWithSugar": "Şekerli {value}",
"dataTableRowApplePie": "Elmalı turta",
"dataTableRowDonut": "Simit",
"dataTableRowHoneycomb": "Bal peteği",
"dataTableRowLollipop": "Lolipop",
"dataTableRowJellyBean": "Jelibon",
"dataTableRowGingerbread": "Kurabiye",
"dataTableRowCupcake": "Küçük kek",
"dataTableRowEclair": "Ekler",
"dataTableRowIceCreamSandwich": "Dondurmalı sandviç",
"dataTableRowFrozenYogurt": "Dondurulmuş yoğurt",
"dataTableColumnIron": "Demir (%)",
"dataTableColumnCalcium": "Kalsiyum (%)",
"dataTableColumnSodium": "Sodyum (mg)",
"demoTimePickerTitle": "Saat Seçici",
"demo2dTransformationsResetTooltip": "Dönüşümleri sıfırla",
"dataTableColumnFat": "Yağ ( g)",
"dataTableColumnCalories": "Kalori",
"dataTableColumnDessert": "Tatlı (1 porsiyon)",
"cardsDemoTravelDestinationLocation1": "Thanjavur, Tamil Nadu",
"demoTimePickerDescription": "Materyal Tasarıma sahip saat seçici içeren bir iletişim kutusu gösterir.",
"demoPickersShowPicker": "SEÇİCİYİ GÖSTER",
"demoTabsScrollingTitle": "Kaydırarak",
"demoTabsNonScrollingTitle": "Kaydırma olmadan",
"craneHours": "{hours,plural,=1{1 sa.}other{{hours} sa.}}",
"craneMinutes": "{minutes,plural,=1{1 dk.}other{{minutes} dk.}}",
"craneFlightDuration": "{hoursShortForm} {minutesShortForm}",
"dataTableHeader": "Beslenme",
"demoDatePickerTitle": "Tarih Seçici",
"demoPickersSubtitle": "Tarih ve saat seçme",
"demoPickersTitle": "Seçiciler",
"demo2dTransformationsEditTooltip": "Bloğu düzenle",
"demoDataTableDescription": "Veri tabloları bilgileri ızgara biçimindeki satırlar ve sütunlarda görüntüler. Kullanıcıların model ve sonuç arayabilmesi için bilgiyi kolayca taranabilecek şekilde düzenler.",
"demo2dTransformationsDescription": "Blokları düzenlemek için dokunun ve sahnede farklı yerlere taşımak için hareketleri kullanın. Kaydırmak için sürükleyin, yakınlaştırmak için sıkıştırın, iki parmağınızla döndürün. Başlangıç yönüne geri döndürmek için sıfırlama düğmesine basın.",
"demo2dTransformationsSubtitle": "Kaydırma, yakınlaştırma, döndürme",
"demo2dTransformationsTitle": "2D dönüşümler",
"demoCupertinoTextFieldPIN": "PIN",
"demoCupertinoTextFieldDescription": "Metin alanı, kullanıcının donanım klavyesi veya ekran klavyesi ile metin girmesini sağlar.",
"demoCupertinoTextFieldSubtitle": "iOS stili metin alanı",
"demoCupertinoTextFieldTitle": "Metin-alanları",
"demoDatePickerDescription": "Materyal Tasarıma sahip tarih seçici içeren bir iletişim kutusu gösterir.",
"demoCupertinoPickerTime": "Saat",
"demoCupertinoPickerDate": "Tarih",
"demoCupertinoPickerTimer": "Zamanlayıcı",
"demoCupertinoPickerDescription": "Dize, tarih, saat veya hem tarih hem de saat seçmek için kullanılabilen iOS stili seçici widget'ı.",
"demoCupertinoPickerSubtitle": "iOS stili seçiciler",
"demoCupertinoPickerTitle": "Seçiciler",
"dataTableRowWithHoney": "Ballı {value}",
"cardsDemoTravelDestinationCity2": "Chettinad",
"bannerDemoResetText": "Banner'ı sıfırla",
"bannerDemoMultipleText": "Birden çok işlem",
"bannerDemoLeadingText": "Ön Simge",
"dismiss": "KAPAT",
"cardsDemoTappable": "Dokunulabilen",
"cardsDemoSelectable": "Seçilebilir (uzun basma)",
"cardsDemoExplore": "Keşfet",
"cardsDemoExploreSemantics": "Keşfedin: {destinationName}",
"cardsDemoShareSemantics": "Paylaşın: {destinationName}",
"cardsDemoTravelDestinationTitle1": "Tamil Nadu'da Gezilecek İlk 10 Şehir",
"cardsDemoTravelDestinationDescription1": "10 Numara",
"cardsDemoTravelDestinationCity1": "Thanjavur",
"dataTableColumnProtein": "Protein ( g)",
"cardsDemoTravelDestinationTitle2": "Güney Hindistan'ın Zanaatkarları",
"cardsDemoTravelDestinationDescription2": "İpek Üreticileri",
"bannerDemoText": "Şifreniz diğer cihazınızda güncellendi. Lütfen tekrar oturum açın.",
"cardsDemoTravelDestinationLocation2": "Sivaganga, Tamil Nadu",
"cardsDemoTravelDestinationTitle3": "Brihadisvara Tapınağı",
"cardsDemoTravelDestinationDescription3": "Tapınaklar",
"demoBannerTitle": "Banner",
"demoBannerSubtitle": "Liste içinde banner görüntüleme",
"demoBannerDescription": "Bannerlar önemli kısa mesajlar görüntüler ve kullanıcıların yerine getirmeleri (veya banner'ı kapatmaları) için işlemler sunar. Banner'ın kapanması için kullanıcının işlem yapması gerekir.",
"demoCardTitle": "Kartlar",
"demoCardSubtitle": "Yuvarlatılmış köşeli temel kartlar",
"demoCardDescription": "Kartlar; albüm, coğrafi konum, yemek, iletişim bilgileri gibi alakalı bilgileri temsil etmek için kullanılan Materyal sayfalarıdır.",
"demoDataTableTitle": "Veri Tabloları",
"demoDataTableSubtitle": "Bilgi satırları ve sütunları",
"dataTableColumnCarbs": "Karbonhidrat ( g)",
"placeTanjore": "Thanjavur",
"demoGridListsTitle": "Tablo Listeler",
"placeFlowerMarket": "Çiçek Pazarı",
"placeBronzeWorks": "Bronz İşler",
"placeMarket": "Pazar",
"placeThanjavurTemple": "Thanjavur Tapınağı",
"placeSaltFarm": "Tuz Çiftliği",
"placeScooters": "Scooter'lar",
"placeSilkMaker": "İpek Üreticisi",
"placeLunchPrep": "Öğle Yemeği Hazırlığı",
"placeBeach": "Kumsal",
"placeFisherman": "Balıkçı",
"demoMenuSelected": "Seçildi: {value}",
"demoMenuRemove": "Kaldır",
"demoMenuGetLink": "Bağlantıyı al",
"demoMenuShare": "Paylaş",
"demoBottomAppBarSubtitle": "Gezinmeyi ve işlemleri altta gösterir",
"demoMenuAnItemWithASectionedMenu": "Bölümlere ayrılmış menüsü olan öğe",
"demoMenuADisabledMenuItem": "Devre dışı menü öğesi",
"demoLinearProgressIndicatorTitle": "Doğrusal İlerleme Durumu Göstergesi",
"demoMenuContextMenuItemOne": "İçerik menüsü öğesi bir",
"demoMenuAnItemWithASimpleMenu": "Basit menüsü olan öğe",
"demoCustomSlidersTitle": "Özel Kaydırma Çubukları",
"demoMenuAnItemWithAChecklistMenu": "Liste menüsü olan öğe",
"demoCupertinoActivityIndicatorTitle": "Etkinlik göstergesi",
"demoCupertinoActivityIndicatorSubtitle": "iOS stili işlem göstergeleri",
"demoCupertinoActivityIndicatorDescription": "Saat yönünde dönen iOS-tarzında işlem göstergesi",
"demoCupertinoNavigationBarTitle": "Gezinme çubuğu",
"demoCupertinoNavigationBarSubtitle": "iOS stili gezinme çubuğu",
"demoCupertinoNavigationBarDescription": "iOS stili bir gezinme çubuğu. Gezinme çubuğu, ortasında sayfa başlığını minimum düzeyde içeren bir araç çubuğudur.",
"demoCupertinoPullToRefreshTitle": "Yenilemek için aşağı çekin",
"demoCupertinoPullToRefreshSubtitle": "iOS stili yenilemek için aşağı çekme denetimi",
"demoCupertinoPullToRefreshDescription": "iOS stili yenilemek için aşağı çekme denetimini uygulayan widget.",
"demoProgressIndicatorTitle": "İlerleme durumu göstergeleri",
"demoProgressIndicatorSubtitle": "Doğrusal, dairesel, belirsiz",
"demoCircularProgressIndicatorTitle": "Dairesel İlerleme Durumu Göstergesi",
"demoCircularProgressIndicatorDescription": "Dönerek uygulamanın meşgul olduğunu gösteren Materyal Tasarıma sahip dairesel ilerleme durumu göstergesi",
"demoMenuFour": "Dört",
"demoLinearProgressIndicatorDescription": "İlerleme çubuğu olarak da bilinen, Materyal Tasarıma sahip doğrusal ilerleme durumu göstergesi",
"demoTooltipTitle": "İpuçları",
"demoTooltipSubtitle": "Uzun basmada veya fareyle üzerine gelmede görüntülenen kısa mesaj",
"demoTooltipDescription": "İpuçları, bir düğmenin işlevini veya diğer kullanıcı arayüzü işlemini açıklamaya yardımcı olan metin etiketleri sağlar. İpuçları, kullanıcı fareyle bir öğenin üzerine geldiğinde veya öğeye odaklandığında ya da uzun bastığında bilgilendirici metin görüntüler.",
"demoTooltipInstructions": "İpucunu görüntülemek için uzun basın veya fareyle üzerine gelin.",
"placeChennai": "Chennai",
"demoMenuChecked": "İşaretlendi: {value}",
"placeChettinad": "Chettinad",
"demoMenuPreview": "Önizle",
"demoBottomAppBarTitle": "Alt uygulama çubuğu",
"demoBottomAppBarDescription": "Alt uygulama çubuğu, hem alt gezinme çekmecesine hem de kayan işlem düğmesi dahil olmak üzere dörde kadar işleme erişim sağlar.",
"bottomAppBarNotch": "Çentik",
"bottomAppBarPosition": "Kayan İşlem Düğmesinin Konumu",
"bottomAppBarPositionDockedEnd": "Yerleştirilmiş - Uçta",
"bottomAppBarPositionDockedCenter": "Yerleştirilmiş - Ortada",
"bottomAppBarPositionFloatingEnd": "Kayan - Uçta",
"bottomAppBarPositionFloatingCenter": "Kayan - Ortada",
"demoSlidersEditableNumericalValue": "Düzenlenebilir sayısal değer",
"demoGridListsSubtitle": "Satır ve sütun düzeni",
"demoGridListsDescription": "Tablo Listeler, genellikle resimler gibi benzer türdeki verileri sunmanın en uygun yöntemidir. Tablodaki her öğeye kutu denir.",
"demoGridListsImageOnlyTitle": "Yalnızca resim",
"demoGridListsHeaderTitle": "Üst bilgisi olan",
"demoGridListsFooterTitle": "Alt bilgisi olan",
"demoSlidersTitle": "Kaydırma Çubukları",
"demoSlidersSubtitle": "Kaydırarak bir değer seçmeyi sağlayan widget",
"demoSlidersDescription": "Kullanıcılar, kaydırma çubuklarını kullanarak belirtilen değer aralığı içinde bir değeri seçebilir. Kaydırma çubukları, ses düzeyi ve parlaklık gibi ayarları düzenlemek veya görüntü filtreleri uygulamak için idealdir.",
"demoRangeSlidersTitle": "Aralık Kaydırma Çubukları",
"demoRangeSlidersDescription": "Kaydırma çubukları, bir çubuk boyunca çeşitli değerler yansıtır. Kaydırma çubuklarının her iki ucunda değer aralığının alt ve üst değerlerini gösteren simgeler bulunabilir. Kaydırma çubukları, ses düzeyi ve parlaklık gibi ayarları düzenlemek veya görüntü filtreleri uygulamak için idealdir.",
"demoMenuAnItemWithAContextMenuButton": "İçerik menüsü olan öğe",
"demoCustomSlidersDescription": "Kullanıcılar, kaydırma çubuklarını kullanarak belirtilen değer aralığı içinde bir değer veya değer aralığını seçebilir. Kaydırma çubukları temalı veya özelleştirilmiş olabilir.",
"demoSlidersContinuousWithEditableNumericalValue": "Düzenlenebilir Sayısal Değere Sahip Kesintisiz",
"demoSlidersDiscrete": "Ayrık",
"demoSlidersDiscreteSliderWithCustomTheme": "Özelleştirilmiş Temaya Sahip Ayrık Değerli Kaydırma Çubuğu",
"demoSlidersContinuousRangeSliderWithCustomTheme": "Özelleştirilmiş Temaya Sahip Sürekli Aralık Değerli Çubuğu",
"demoSlidersContinuous": "Sürekli",
"placePondicherry": "Pondicherry",
"demoMenuTitle": "Menü",
"demoContextMenuTitle": "İçerik menüsü",
"demoSectionedMenuTitle": "Bölümlere ayrılmış menü",
"demoSimpleMenuTitle": "Basit menü",
"demoChecklistMenuTitle": "Liste menü",
"demoMenuSubtitle": "Menü düğmeleri ve basit menüler",
"demoMenuDescription": "Menü, geçici bir yüzeyde seçenekler listesini görüntüler. Menüler, kullanıcılar bir düğme, işlem veya başka bir kontrolle etkileşimde bulunduğunda görünür.",
"demoMenuItemValueOne": "Menü öğesi bir",
"demoMenuItemValueTwo": "Menü öğesi iki",
"demoMenuItemValueThree": "Menü öğesi üç",
"demoMenuOne": "Bir",
"demoMenuTwo": "İki",
"demoMenuThree": "Üç",
"demoMenuContextMenuItemThree": "İçerik menüsü öğesi üç",
"demoCupertinoSwitchSubtitle": "iOS tarzında anahtar",
"demoSnackbarsText": "Bu bir snackbar.",
"demoCupertinoSliderSubtitle": "iOS tarzında kaydırma çubuğu",
"demoCupertinoSliderDescription": "Kaydırma çubukları sürekli veya aralıklı değerler içinden seçim yapmak için kullanılır.",
"demoCupertinoSliderContinuous": "Sürekli: {value}",
"demoCupertinoSliderDiscrete": "Aralıklı: {value}",
"demoSnackbarsAction": "Snackbar işlemine bastınız.",
"backToGallery": "Galeriye dön",
"demoCupertinoTabBarTitle": "Sekme çubuğu",
"demoCupertinoSwitchDescription": "Anahtarlar tek bir ayarın açık/kapalı durumunu değiştirmek için kullanılır.",
"demoSnackbarsActionButtonLabel": "İŞLEM",
"cupertinoTabBarProfileTab": "Profil",
"demoSnackbarsButtonLabel": "SNACKBAR GÖSTER",
"demoSnackbarsDescription": "Snackbar'lar bir uygulamanın gerçekleştirdiği veya gerçekleştireceği bir işlemi kullanıcılara bildirir. Ekranın altına yakın bir yerde geçici olarak görünür. Kullanıcı deneyimini engellememeli ve ekrandan kaybolması için kullanıcının bir işlem yapmasını gerektirmemelidir.",
"demoSnackbarsSubtitle": "Snackbar'lar ekranın alt bölümünde mesaj gösterir",
"demoSnackbarsTitle": "Snackbar'lar",
"demoCupertinoSliderTitle": "Kaydırma çubuğu",
"cupertinoTabBarChatTab": "Sohbet",
"cupertinoTabBarHomeTab": "Ana sayfa",
"demoCupertinoTabBarDescription": "iOS tarzında alt gezinme sekmesi çubuğu. Birden fazla sekme gösterilir. Varsayılan olarak ilk sekme olmak üzere içlerinden biri etkin durumda olur.",
"demoCupertinoTabBarSubtitle": "iOS tarzında alt sekme çubuğu",
"demoOptionsFeatureTitle": "Seçenekleri göster",
"demoOptionsFeatureDescription": "Bu demodaki kullanılabilir seçenekleri görmek için buraya dokunun.",
"demoCodeViewerCopyAll": "TÜMÜNÜ KOPYALA",
"shrineScreenReaderRemoveProductButton": "{product} ürününü kaldır",
"shrineScreenReaderProductAddToCart": "Sepete ekle",
"shrineScreenReaderCart": "{quantity,plural,=0{Alışveriş sepeti, ürün yok}=1{Alışveriş sepeti, 1 ürün}other{Alışveriş sepeti, {quantity} ürün}}",
"demoCodeViewerFailedToCopyToClipboardMessage": "Panoya kopyalanamadı: {error}",
"demoCodeViewerCopiedToClipboardMessage": "Panoya kopyalandı.",
"craneSleep8SemanticLabel": "Sahilin üst tarafında falezdeki Maya kalıntıları",
"craneSleep4SemanticLabel": "Dağların yamacında, göl kenarında otel",
"craneSleep2SemanticLabel": "Machu Picchu kalesi",
"craneSleep1SemanticLabel": "Yaprak dökmeyen ağaçların bulunduğu karla kaplı bir arazideki şale",
"craneSleep0SemanticLabel": "Su üzerinde bungalovlar",
"craneFly13SemanticLabel": "Palmiye ağaçlı deniz kenarı havuzu",
"craneFly12SemanticLabel": "Palmiye ağaçlarıyla havuz",
"craneFly11SemanticLabel": "Denizde tuğla deniz feneri",
"craneFly10SemanticLabel": "Gün batımında El-Ezher Camisi'nin minareleri",
"craneFly9SemanticLabel": "Mavi antika bir arabaya dayanan adam",
"craneFly8SemanticLabel": "Supertree Korusu",
"craneEat9SemanticLabel": "Pastalarla kafe tezgahı",
"craneEat2SemanticLabel": "Burger",
"craneFly5SemanticLabel": "Dağların yamacında, göl kenarında otel",
"demoSelectionControlsSubtitle": "Onay kutuları, radyo düğmeleri ve anahtarlar",
"craneEat10SemanticLabel": "Büyük pastırmalı sandviç tutan kadın",
"craneFly4SemanticLabel": "Su üzerinde bungalovlar",
"craneEat7SemanticLabel": "Fırın girişi",
"craneEat6SemanticLabel": "Karides yemeği",
"craneEat5SemanticLabel": "Gösterişli restoran oturma alanı",
"craneEat4SemanticLabel": "Çikolatalı tatlı",
"craneEat3SemanticLabel": "Kore takosu",
"craneFly3SemanticLabel": "Machu Picchu kalesi",
"craneEat1SemanticLabel": "Restoran tarzı taburelerle boş bar",
"craneEat0SemanticLabel": "Odun fırınında pişmiş pizza",
"craneSleep11SemanticLabel": "Taipei 101 gökdeleni",
"craneSleep10SemanticLabel": "Gün batımında El-Ezher Camisi'nin minareleri",
"craneSleep9SemanticLabel": "Denizde tuğla deniz feneri",
"craneEat8SemanticLabel": "Kerevit tabağı",
"craneSleep7SemanticLabel": "Ribeira Meydanı'nda renkli apartmanlar",
"craneSleep6SemanticLabel": "Palmiye ağaçlarıyla havuz",
"craneSleep5SemanticLabel": "Bir arazideki çadır",
"settingsButtonCloseLabel": "Ayarları kapat",
"demoSelectionControlsCheckboxDescription": "Onay kutuları, kullanıcıya bir dizi seçenek arasından birden fazlasını belirlemesine olanak sağlar. Normal bir onay kutusunun değeri true (doğru) veya false (yanlış) olur. Üç durumlu onay kutusunun değeri boş da olabilir.",
"settingsButtonLabel": "Ayarlar",
"demoListsTitle": "Listeler",
"demoListsSubtitle": "Kayan liste düzenleri",
"demoListsDescription": "Tipik olarak biraz metnin yanı sıra başında veya sonunda simge olan sabit yükseklikli tek satır.",
"demoOneLineListsTitle": "Tek Satır",
"demoTwoLineListsTitle": "İki Satır",
"demoListsSecondary": "İkincil metin",
"demoSelectionControlsTitle": "Seçim kontrolleri",
"craneFly7SemanticLabel": "Rushmore Dağı",
"demoSelectionControlsCheckboxTitle": "Onay Kutusu",
"craneSleep3SemanticLabel": "Mavi antika bir arabaya dayanan adam",
"demoSelectionControlsRadioTitle": "Radyo düğmesi",
"demoSelectionControlsRadioDescription": "Radyo düğmeleri, kullanıcının bir dizi seçenek arasından birini belirlemesine olanak sağlar. Kullanıcının tüm mevcut seçenekleri yan yana görmesi gerektiğini düşünüyorsanız özel seçim için radyo düğmelerini kullanın.",
"demoSelectionControlsSwitchTitle": "Anahtar",
"demoSelectionControlsSwitchDescription": "Açık/kapalı anahtarları, tek bir ayarlar seçeneğinin durumunu açar veya kapatır. Anahtarın kontrol ettiği seçeneğin yanı sıra seçeneğin bulunduğu durum, karşılık gelen satır içi etikette açıkça belirtilmelidir.",
"craneFly0SemanticLabel": "Yaprak dökmeyen ağaçların bulunduğu karla kaplı bir arazideki şale",
"craneFly1SemanticLabel": "Bir arazideki çadır",
"craneFly2SemanticLabel": "Karlı dağ önünde dua bayrakları",
"craneFly6SemanticLabel": "Güzel Sanatlar Sarayı'nın havadan görünüşü",
"rallySeeAllAccounts": "Tüm hesapları göster",
"rallyBillAmount": "Son ödeme tarihi {date} olan {amount} tutarındaki {billName} faturası.",
"shrineTooltipCloseCart": "Alışveriş sepetini kapat",
"shrineTooltipCloseMenu": "Menüyü kapat",
"shrineTooltipOpenMenu": "Menüyü aç",
"shrineTooltipSettings": "Ayarlar",
"shrineTooltipSearch": "Ara",
"demoTabsDescription": "Sekmeler farklı ekranlarda, veri kümelerinde ve diğer etkileşimlerde bulunan içeriği düzenler.",
"demoTabsSubtitle": "Bağımsız olarak kaydırılabilen görünümlü sekmeler",
"demoTabsTitle": "Sekmeler",
"rallyBudgetAmount": "Toplamı {amountTotal} olan ve {amountUsed} kullanıldıktan sonra {amountLeft} kalan {budgetName} bütçesi",
"shrineTooltipRemoveItem": "Öğeyi kaldır",
"rallyAccountAmount": "Bakiyesi {amount} olan {accountNumber} numaralı {accountName} hesabı.",
"rallySeeAllBudgets": "Tüm bütçeleri göster",
"rallySeeAllBills": "Tüm faturaları göster",
"craneFormDate": "Tarih Seçin",
"craneFormOrigin": "Kalkış Noktası Seçin",
"craneFly2": "Khumbu Vadisi, Nepal",
"craneFly3": "Machu Picchu, Peru",
"craneFly4": "Malé, Maldivler",
"craneFly5": "Vitznau, İsviçre",
"craneFly6": "Mexico City, Meksika",
"craneFly7": "Rushmore Dağı, ABD",
"settingsTextDirectionLocaleBased": "Yerel ayara göre",
"craneFly9": "Havana, Küba",
"craneFly10": "Kahire, Mısır",
"craneFly11": "Lizbon, Portekiz",
"craneFly12": "Napa, ABD",
"craneFly13": "Bali, Endonezya",
"craneSleep0": "Malé, Maldivler",
"craneSleep1": "Aspen, ABD",
"craneSleep2": "Machu Picchu, Peru",
"demoCupertinoSegmentedControlTitle": "Bölümlere ayrılmış kontrol",
"craneSleep4": "Vitznau, İsviçre",
"craneSleep5": "Big Sur, ABD",
"craneSleep6": "Napa, ABD",
"craneSleep7": "Porto, Portekiz",
"craneSleep8": "Tulum, Meksika",
"craneEat5": "Seul, Güney Kore",
"demoChipTitle": "Çipler",
"demoChipSubtitle": "Giriş, özellik ve işlem temsil eden kompakt öğeler",
"demoActionChipTitle": "İşlem Çipi",
"demoActionChipDescription": "İşlem çipleri, asıl içerikle ilgili bir işlemi tetikleyen bir dizi seçenektir. İşlem çipleri, kullanıcı arayüzünde dinamik ve içeriğe dayalı olarak görünmelidir.",
"demoChoiceChipTitle": "Seçenek Çipi",
"demoChoiceChipDescription": "Seçenek çipleri, bir dizi seçenekten tek bir seçeneği temsil eder. Seçenek çipleri ilgili açıklayıcı metin veya kategoriler içerir.",
"demoFilterChipTitle": "Filtre çipi",
"demoFilterChipDescription": "Filtre çipleri, içeriği filtreleme yöntemi olarak etiketler ve açıklayıcı kelimeler kullanır.",
"demoInputChipTitle": "Giriş Çipi",
"demoInputChipDescription": "Giriş çipleri, bir varlık (kişi, yer veya şey) gibi karmaşık bir bilgi parçasını ya da kompakt bir formda konuşma dili metnini temsil eder.",
"craneSleep9": "Lizbon, Portekiz",
"craneEat10": "Lizbon, Portekiz",
"demoCupertinoSegmentedControlDescription": "Birbirini dışlayan bir dizi seçenek arasında seçim yapmak için kullanıldı. Segmentlere ayrılmış kontrolde bir seçenek belirlendiğinde, segmentlere ayrılmış denetimdeki diğer seçenek belirlenemez.",
"chipTurnOnLights": "Işıkları aç",
"chipSmall": "Küçük",
"chipMedium": "Orta",
"chipLarge": "Büyük",
"chipElevator": "Asansör",
"chipWasher": "Çamaşır makinesi",
"chipFireplace": "Şömine",
"chipBiking": "Bisiklet",
"craneFormDiners": "Lokanta sayısı",
"rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{Olası vergi iadenizi artırın. 1 atanmamış işleme kategoriler atayın.}other{Olası vergi iadenizi artırın. {count} atanmamış işleme kategoriler atayın.}}",
"craneFormTime": "Saat Seçin",
"craneFormLocation": "Konum Seçin",
"craneFormTravelers": "Yolcu sayısı",
"craneEat8": "Atlanta, ABD",
"craneFormDestination": "Varış Noktası Seçin",
"craneFormDates": "Tarihleri Seçin",
"craneFly": "UÇUŞ",
"craneSleep": "UYKU",
"craneEat": "YEME",
"craneFlySubhead": "Varış Noktasına Göre Uçuş Araştırma",
"craneSleepSubhead": "Varış Noktasına Göre Mülk Araştırma",
"craneEatSubhead": "Varış Noktasına Göre Restoran Araştırma",
"craneFlyStops": "{numberOfStops,plural,=0{Aktarmasız}=1{1 aktarma}other{{numberOfStops} aktarma}}",
"craneSleepProperties": "{totalProperties,plural,=0{Müsait Mülk Yok}=1{Kullanılabilir 1 Özellik}other{Kullanılabilir {totalProperties} Özellik}}",
"craneEatRestaurants": "{totalRestaurants,plural,=0{Restoran Yok}=1{1 Restoran}other{{totalRestaurants} Restoran}}",
"craneFly0": "Aspen, ABD",
"demoCupertinoSegmentedControlSubtitle": "iOS-tarzı bölümlere ayrılmış kontrol",
"craneSleep10": "Kahire, Mısır",
"craneEat9": "Madrid, İspanya",
"craneFly1": "Big Sur, ABD",
"craneEat7": "Nashville, ABD",
"craneEat6": "Seattle, ABD",
"craneFly8": "Singapur",
"craneEat4": "Paris, Fransa",
"craneEat3": "Portland, ABD",
"craneEat2": "Córdoba, Arjantin",
"craneEat1": "Dallas, ABD",
"craneEat0": "Napoli, İtalya",
"craneSleep11": "Taipei, Tayvan",
"craneSleep3": "Havana, Küba",
"shrineLogoutButtonCaption": "ÇIKIŞ YAP",
"rallyTitleBills": "FATURALAR",
"rallyTitleAccounts": "HESAPLAR",
"shrineProductVagabondSack": "Vagabond çanta",
"rallyAccountDetailDataInterestYtd": "Yılın Başından Bugüne Faiz",
"shrineProductWhitneyBelt": "Whitney kemer",
"shrineProductGardenStrand": "Bahçe teli",
"shrineProductStrutEarrings": "Strut küpeler",
"shrineProductVarsitySocks": "Varis çorabı",
"shrineProductWeaveKeyring": "Örgülü anahtarlık",
"shrineProductGatsbyHat": "Gatsby şapka",
"shrineProductShrugBag": "Askılı çanta",
"shrineProductGiltDeskTrio": "Yaldızlı üçlü sehpa",
"shrineProductCopperWireRack": "Bakır tel raf",
"shrineProductSootheCeramicSet": "Rahatlatıcı seramik takım",
"shrineProductHurrahsTeaSet": "Hurrahs çay takımı",
"shrineProductBlueStoneMug": "Mavi taş kupa",
"shrineProductRainwaterTray": "Yağmur gideri",
"shrineProductChambrayNapkins": "Şambre peçete",
"shrineProductSucculentPlanters": "Sukulent bitki saksıları",
"shrineProductQuartetTable": "Dört kişilik masa",
"shrineProductKitchenQuattro": "Quattro mutfak",
"shrineProductClaySweater": "Kil kazak",
"shrineProductSeaTunic": "Deniz tuniği",
"shrineProductPlasterTunic": "İnce tunik",
"rallyBudgetCategoryRestaurants": "Restoranlar",
"shrineProductChambrayShirt": "Patiska gömlek",
"shrineProductSeabreezeSweater": "Deniz esintisi kazağı",
"shrineProductGentryJacket": "Gentry ceket",
"shrineProductNavyTrousers": "Lacivert pantolon",
"shrineProductWalterHenleyWhite": "Walter Henley (beyaz)",
"shrineProductSurfAndPerfShirt": "\"Surf and perf\" gömlek",
"shrineProductGingerScarf": "Kırmızı eşarp",
"shrineProductRamonaCrossover": "Ramona crossover",
"shrineProductClassicWhiteCollar": "Klasik beyaz yaka",
"shrineProductSunshirtDress": "Yazlık elbise",
"rallyAccountDetailDataInterestRate": "Faiz Oranı",
"rallyAccountDetailDataAnnualPercentageYield": "Yıllık Faiz Getirisi",
"rallyAccountDataVacation": "Tatil",
"shrineProductFineLinesTee": "İnce çizgili tişört",
"rallyAccountDataHomeSavings": "Ev İçin Biriktirilen",
"rallyAccountDataChecking": "Mevduat",
"rallyAccountDetailDataInterestPaidLastYear": "Geçen Yıl Ödenen Faiz",
"rallyAccountDetailDataNextStatement": "Sonraki Ekstre",
"rallyAccountDetailDataAccountOwner": "Hesap Sahibi",
"rallyBudgetCategoryCoffeeShops": "Kafeler",
"rallyBudgetCategoryGroceries": "Market Alışverişi",
"shrineProductCeriseScallopTee": "Kiraz kırmızısı fistolu tişört",
"rallyBudgetCategoryClothing": "Giyim",
"rallySettingsManageAccounts": "Hesapları Yönet",
"rallyAccountDataCarSavings": "Araba İçin Biriktirilen",
"rallySettingsTaxDocuments": "Vergi Dokümanları",
"rallySettingsPasscodeAndTouchId": "Şifre kodu ve Touch ID",
"rallySettingsNotifications": "Bildirimler",
"rallySettingsPersonalInformation": "Kişisel Bilgiler",
"rallySettingsPaperlessSettings": "Kağıt kullanmayan Ayarlar",
"rallySettingsFindAtms": "ATMi bul",
"rallySettingsHelp": "Yardım",
"rallySettingsSignOut": "Oturumu kapat",
"rallyAccountTotal": "Toplam",
"rallyBillsDue": "Ödenecek tutar:",
"rallyBudgetLeft": "Sol",
"rallyAccounts": "Hesaplar",
"rallyBills": "Faturalar",
"rallyBudgets": "Bütçeler",
"rallyAlerts": "Uyarılar",
"rallySeeAll": "TÜMÜNÜ GÖSTER",
"rallyFinanceLeft": "KALDI",
"rallyTitleOverview": "GENEL BAKIŞ",
"shrineProductShoulderRollsTee": "Açık omuzlu tişört",
"shrineNextButtonCaption": "SONRAKİ",
"rallyTitleBudgets": "BÜTÇELER",
"rallyTitleSettings": "AYARLAR",
"rallyLoginLoginToRally": "Rally'ye giriş yapın",
"rallyLoginNoAccount": "Hesabınız yok mu?",
"rallyLoginSignUp": "KAYDOL",
"rallyLoginUsername": "Kullanıcı adı",
"rallyLoginPassword": "Şifre",
"rallyLoginLabelLogin": "Giriş yapın",
"rallyLoginRememberMe": "Beni Hatırla",
"rallyLoginButtonLogin": "GİRİŞ YAP",
"rallyAlertsMessageHeadsUpShopping": "Dikkat! Bu ayki alışveriş bütçenizi {percent} oranında harcadınız.",
"rallyAlertsMessageSpentOnRestaurants": "Bu hafta restoranlarda {amount} harcadınız.",
"rallyAlertsMessageATMFees": "Bu ay {amount} ATM komisyonu ödediniz",
"rallyAlertsMessageCheckingAccount": "Harika! Çek hesabınız geçen aya göre {percent} daha fazla.",
"shrineMenuCaption": "MENÜ",
"shrineCategoryNameAll": "TÜMÜ",
"shrineCategoryNameAccessories": "AKSESUARLAR",
"shrineCategoryNameClothing": "GİYİM",
"shrineCategoryNameHome": "EV",
"shrineLoginUsernameLabel": "Kullanıcı adı",
"shrineLoginPasswordLabel": "Şifre",
"shrineCancelButtonCaption": "İPTAL",
"shrineCartTaxCaption": "Vergi:",
"shrineCartPageCaption": "ALIŞVERİŞ SEPETİ",
"shrineProductQuantity": "Miktar: {quantity}",
"shrineProductPrice": "x {price}",
"shrineCartItemCount": "{quantity,plural,=0{ÖĞE YOK}=1{1 ÖĞE}other{{quantity} ÖĞE}}",
"shrineCartClearButtonCaption": "ALIŞVERİŞ SEPETİNİ BOŞALT",
"shrineCartTotalCaption": "TOPLAM",
"shrineCartSubtotalCaption": "Alt toplam:",
"shrineCartShippingCaption": "Gönderim:",
"shrineProductGreySlouchTank": "Gri bol kolsuz tişört",
"shrineProductStellaSunglasses": "Stella güneş gözlüğü",
"shrineProductWhitePinstripeShirt": "İnce çizgili beyaz gömlek",
"demoTextFieldWhereCanWeReachYou": "Size nereden ulaşabiliriz?",
"settingsTextDirectionLTR": "LTR",
"settingsTextScalingLarge": "Büyük",
"demoBottomSheetHeader": "Üst bilgi",
"demoBottomSheetItem": "Ürün {value}",
"demoBottomTextFieldsTitle": "Metin-alanları",
"demoTextFieldTitle": "Metin-alanları",
"demoTextFieldSubtitle": "Tek satır düzenlenebilir metin ve sayılar",
"demoTextFieldDescription": "Metin alanları, kullanıcıların bir kullanıcı arayüzüne metin girmesini sağlar. Genellikle formlarda ve iletişim kutularında görünürler.",
"demoTextFieldShowPasswordLabel": "Şifreyi göster",
"demoTextFieldHidePasswordLabel": "Şifreyi gizle",
"demoTextFieldFormErrors": "Göndermeden önce lütfen kırmızı renkle belirtilen hataları düzeltin",
"demoTextFieldNameRequired": "Ad gerekli.",
"demoTextFieldOnlyAlphabeticalChars": "Lütfen sadece alfabetik karakterler girin.",
"demoTextFieldEnterUSPhoneNumber": "(###) ###-#### - ABD'ye ait bir telefon numarası girin.",
"demoTextFieldEnterPassword": "Lütfen bir şifre girin.",
"demoTextFieldPasswordsDoNotMatch": "Şifreler eşleşmiyor",
"demoTextFieldWhatDoPeopleCallYou": "Size hangi adla hitap ediliyor?",
"demoTextFieldNameField": "Ad*",
"demoBottomSheetButtonText": "ALT SAYFAYI GÖSTER",
"demoTextFieldPhoneNumber": "Telefon numarası*",
"demoBottomSheetTitle": "Alt sayfa",
"demoTextFieldEmail": "E-posta",
"demoTextFieldTellUsAboutYourself": "Bize kendinizden bahsedin (örneğin, ne iş yaptığınızı veya hobilerinizi yazın)",
"demoTextFieldKeepItShort": "Kısa tutun, bu sadece bir demo.",
"starterAppGenericButton": "DÜĞME",
"demoTextFieldLifeStory": "Hayat hikayesi",
"demoTextFieldSalary": "Salary",
"demoTextFieldUSD": "USD",
"demoTextFieldNoMoreThan": "En fazla 8 karakter.",
"demoTextFieldPassword": "Şifre*",
"demoTextFieldRetypePassword": "Şifreyi yeniden yazın*",
"demoTextFieldSubmit": "GÖNDER",
"demoBottomNavigationSubtitle": "Çapraz şeffaflaşan görünümlü alt gezinme",
"demoBottomSheetAddLabel": "Ekle",
"demoBottomSheetModalDescription": "Kalıcı alt sayfa, alternatif bir menü veya iletişim kutusudur ve kullanıcının uygulamanın geri kalanı ile etkileşimde bulunmasını önler.",
"demoBottomSheetModalTitle": "Kalıcı alt sayfa",
"demoBottomSheetPersistentDescription": "Sürekli görüntülenen alt sayfa, uygulamanın asıl içeriğine ek bilgileri gösterir ve kullanıcı uygulamanın diğer bölümleriyle etkileşimde bulunurken görünmeye devam eder.",
"demoBottomSheetPersistentTitle": "Sürekli görüntülenen alt sayfa",
"demoBottomSheetSubtitle": "Sürekli ve kalıcı alt sayfalar",
"demoTextFieldNameHasPhoneNumber": "{name} adlı kişinin telefon numarası: {phoneNumber}",
"buttonText": "DÜĞME",
"demoTypographyDescription": "Materyal Tasarımında bulunan çeşitli tipografik stillerin tanımları.",
"demoTypographySubtitle": "Önceden tanımlanmış tüm metin stilleri",
"demoTypographyTitle": "Yazı biçimi",
"demoFullscreenDialogDescription": "Tam ekran iletişim kutusu özelliği, gelen sayfanın tam ekran kalıcı bir iletişim kutusu olup olmadığını belirtir.",
"demoFlatButtonDescription": "Basıldığında mürekkep sıçraması görüntüleyen ancak basıldıktan sonra yukarı kalkmayan düz düğme. Düz düğmeleri araç çubuklarında, iletişim kutularında ve dolgulu satır içinde kullanın",
"demoBottomNavigationDescription": "Alt gezinme çubukları, ekranın altında 3 ila beş arasında varış noktası görüntüler. Her bir varış noktası bir simge ve tercihe bağlı olarak metin etiketiyle temsil edilir. Kullanıcı, bir alt gezinme simgesine dokunduğunda, bu simge ile ilişkilendirilmiş üst düzey gezinme varış noktasına gider.",
"demoBottomNavigationSelectedLabel": "Seçilen etiket",
"demoBottomNavigationPersistentLabels": "Sürekli etiketler",
"starterAppDrawerItem": "Ürün {value}",
"demoTextFieldRequiredField": "* zorunlu alanı belirtir",
"demoBottomNavigationTitle": "Alt gezinme",
"settingsLightTheme": "Açık",
"settingsTheme": "Tema",
"settingsPlatformIOS": "iOS",
"settingsPlatformAndroid": "Android",
"settingsTextDirectionRTL": "RTL",
"settingsTextScalingHuge": "Çok büyük",
"cupertinoButton": "Düğme",
"settingsTextScalingNormal": "Normal",
"settingsTextScalingSmall": "Küçük",
"settingsSystemDefault": "Sistem",
"settingsTitle": "Ayarlar",
"rallyDescription": "Kişisel finans uygulaması",
"aboutDialogDescription": "Bu uygulamanın kaynak kodunu görmek için lütfen {repoLink} sayfasını ziyaret edin.",
"bottomNavigationCommentsTab": "Yorumlar",
"starterAppGenericBody": "Gövde",
"starterAppGenericHeadline": "Başlık",
"starterAppGenericSubtitle": "Alt başlık",
"starterAppGenericTitle": "Başlık",
"starterAppTooltipSearch": "Ara",
"starterAppTooltipShare": "Paylaş",
"starterAppTooltipFavorite": "Favoriler listesine ekle",
"starterAppTooltipAdd": "Ekle",
"bottomNavigationCalendarTab": "Takvim",
"starterAppDescription": "Duyarlı başlangıç düzeni",
"starterAppTitle": "Başlangıç uygulaması",
"aboutFlutterSamplesRepo": "Flutter örnekleri GitHub havuzu",
"bottomNavigationContentPlaceholder": "{title} sekmesi için yer tutucu",
"bottomNavigationCameraTab": "Kamera",
"bottomNavigationAlarmTab": "Alarm",
"bottomNavigationAccountTab": "Hesap",
"demoTextFieldYourEmailAddress": "E-posta adresiniz",
"demoToggleButtonDescription": "Açma/kapatma düğmeleri benzer seçenekleri gruplamak için kullanılabilir. Benzer açma/kapatma düğmesi gruplarını vurgulamak için grubun ortak bir kapsayıcıyı paylaşması gerekir.",
"colorsGrey": "GRİ",
"colorsBrown": "KAHVERENGİ",
"colorsDeepOrange": "KOYU TURUNCU",
"colorsOrange": "TURUNCU",
"colorsAmber": "KEHRİBAR RENNGİ",
"colorsYellow": "SARI",
"colorsLime": "KÜF YEŞİLİ",
"colorsLightGreen": "AÇIK YEŞİL",
"colorsGreen": "YEŞİL",
"homeHeaderGallery": "Galeri",
"homeHeaderCategories": "Kategoriler",
"shrineDescription": "Şık bir perakende uygulaması",
"craneDescription": "Kişiselleştirilmiş seyahat uygulaması",
"homeCategoryReference": "STİLLER VE DİĞERLERİ",
"demoInvalidURL": "URL görüntülenemedi:",
"demoOptionsTooltip": "Seçenekler",
"demoInfoTooltip": "Bilgi",
"demoCodeTooltip": "Demo Kodu",
"demoDocumentationTooltip": "API Dokümanları",
"demoFullscreenTooltip": "Tam Ekran",
"settingsTextScaling": "Metin ölçekleme",
"settingsTextDirection": "Metin yönü",
"settingsLocale": "Yerel ayar",
"settingsPlatformMechanics": "Platform mekaniği",
"settingsDarkTheme": "Koyu",
"settingsSlowMotion": "Ağır çekim",
"settingsAbout": "Flutter Gallery hakkında",
"settingsFeedback": "Geri bildirim gönder",
"settingsAttribution": "Londra'da TOASTER tarafından tasarlandı",
"demoButtonTitle": "Düğmeler",
"demoButtonSubtitle": "Metin, yükseltilmiş, dış çizgili ve daha fazlası",
"demoFlatButtonTitle": "Düz Düğme",
"demoRaisedButtonDescription": "Yükseltilmiş düğmeler çoğunlukla düz düzenlere boyut ekler. Yoğun veya geniş alanlarda işlevleri vurgular.",
"demoRaisedButtonTitle": "Yükseltilmiş Düğme",
"demoOutlineButtonTitle": "Dış Çizgili Düğme",
"demoOutlineButtonDescription": "Dış çizgili düğmeler basıldığında opak olur ve yükselir. Alternatif, ikincil işlemi belirtmek için genellikle yükseltilmiş düğmelerle eşlenirler.",
"demoToggleButtonTitle": "Açma/Kapatma Düğmeleri",
"colorsTeal": "TURKUAZ",
"demoFloatingButtonTitle": "Kayan İşlem Düğmesi",
"demoFloatingButtonDescription": "Kayan işlem düğmesi, uygulamadaki birincil işlemi öne çıkarmak için içeriğin üzerine gelen dairesel bir simge düğmesidir.",
"demoDialogTitle": "İletişim kutuları",
"demoDialogSubtitle": "Basit, uyarı ve tam ekran",
"demoAlertDialogTitle": "Uyarı",
"demoAlertDialogDescription": "Uyarı iletişim kutusu, kullanıcıyı onay gerektiren durumlar hakkında bilgilendirir. Uyarı iletişim kutusunun isteğe bağlı başlığı ve isteğe bağlı işlemler listesi vardır.",
"demoAlertTitleDialogTitle": "Başlıklı Uyarı",
"demoSimpleDialogTitle": "Basit",
"demoSimpleDialogDescription": "Basit iletişim kutusu, kullanıcıya birkaç seçenek arasından seçim yapma olanağı sunar. Basit iletişim kutusunun seçeneklerin üzerinde görüntülenen isteğe bağlı bir başlığı vardır.",
"demoFullscreenDialogTitle": "Tam Ekran",
"demoCupertinoButtonsTitle": "Düğmeler",
"demoCupertinoButtonsSubtitle": "iOS tarzı düğmeler",
"demoCupertinoButtonsDescription": "iOS tarzı düğme. Dokunulduğunda rengi açılan ve kararan metin ve/veya simge içerir. İsteğe bağlı olarak arka planı bulunabilir.",
"demoCupertinoAlertsTitle": "Uyarılar",
"demoCupertinoAlertsSubtitle": "iOS tarzı uyarı iletişim kutuları",
"demoCupertinoAlertTitle": "Uyarı",
"demoCupertinoAlertDescription": "Uyarı iletişim kutusu, kullanıcıyı onay gerektiren durumlar hakkında bilgilendirir. Uyarı iletişim kutusunun isteğe bağlı başlığı, isteğe bağlı içeriği ve isteğe bağlı işlemler listesi vardır. Başlık içeriğin üzerinde görüntülenir ve işlemler içeriğin altında görüntülenir.",
"demoCupertinoAlertWithTitleTitle": "Başlıklı Uyarı",
"demoCupertinoAlertButtonsTitle": "Düğmeli Uyarı",
"demoCupertinoAlertButtonsOnlyTitle": "Yalnızca Uyarı Düğmeleri",
"demoCupertinoActionSheetTitle": "İşlem Sayfası",
"demoCupertinoActionSheetDescription": "İşlem sayfası, kullanıcıya geçerli bağlamla ilgili iki veya daha fazla seçenek sunan belirli bir uyarı tarzıdır. Bir işlem sayfasının başlığı, ek mesajı ve işlemler listesi olabilir.",
"demoColorsTitle": "Renkler",
"demoColorsSubtitle": "Önceden tanımlanmış renklerin tümü",
"demoColorsDescription": "Materyal Tasarımın renk paletini temsil eden renk ve renk örneği sabitleri.",
"buttonTextEnabled": "ENABLED",
"buttonTextDisabled": "DISABLED",
"buttonTextCreate": "Oluştur",
"dialogSelectedOption": "Şunu seçtiniz: \"{value}\"",
"dialogDiscardTitle": "Taslak silinsin mi?",
"dialogLocationTitle": "Google'ın konum hizmeti kullanılsın mı?",
"dialogLocationDescription": "Google'ın, uygulamaların konum tespiti yapmasına yardımcı olmasına izin verin. Bu, hiçbir uygulama çalışmıyorken bile anonim konum verilerinin Google'a gönderilmesi anlamına gelir.",
"dialogCancel": "İPTAL",
"dialogDiscard": "SİL",
"dialogDisagree": "KABUL ETMİYORUM",
"dialogAgree": "KABUL EDİYORUM",
"dialogSetBackup": "Yedekleme hesabı ayarla",
"colorsBlueGrey": "MAVİYE ÇALAN GRİ",
"dialogShow": "İLETİŞİM KUTUSUNU GÖSTER",
"dialogFullscreenTitle": "Tam Ekran İletişim Kutusu",
"dialogFullscreenSave": "KAYDET",
"dialogFullscreenDescription": "Tam ekran iletişim kutusu demosu",
"cupertinoButtonEnabled": "Enabled",
"cupertinoButtonDisabled": "Disabled",
"cupertinoButtonWithBackground": "Arka Planı Olan",
"cupertinoAlertCancel": "İptal",
"cupertinoAlertDiscard": "Sil",
"cupertinoAlertLocationTitle": "Uygulamayı kullanırken \"Haritalar\"ın konumunuza erişmesine izin verilsin mi?",
"cupertinoAlertLocationDescription": "Geçerli konumunuz haritada gösterilecek, yol tarifleri, yakındaki arama sonuçları ve tahmini seyahat süreleri için kullanılacak.",
"cupertinoAlertAllow": "İzin ver",
"cupertinoAlertDontAllow": "İzin Verme",
"cupertinoAlertFavoriteDessert": "Select Favorite Dessert",
"cupertinoAlertDessertDescription": "Lütfen aşağıdaki listeden en sevdiğiniz tatlı türünü seçin. Seçiminiz, bölgenizdeki önerilen restoranlar listesini özelleştirmek için kullanılacak.",
"cupertinoAlertCheesecake": "Cheesecake",
"cupertinoAlertTiramisu": "Tiramisu",
"cupertinoAlertApplePie": "Elmalı Turta",
"cupertinoAlertChocolateBrownie": "Çikolatalı Browni",
"cupertinoShowAlert": "Uyarıyı Göster",
"colorsRed": "KIRMIZI",
"colorsPink": "PEMBE",
"colorsPurple": "MOR",
"colorsDeepPurple": "KOYU MOR",
"colorsIndigo": "ÇİVİT MAVİSİ",
"colorsBlue": "MAVİ",
"colorsLightBlue": "AÇIK MAVİ",
"colorsCyan": "CAMGÖBEĞİ",
"dialogAddAccount": "Hesap ekle",
"Gallery": "Galeri",
"Categories": "Kategoriler",
"SHRINE": "SHRINE",
"Basic shopping app": "Temel alışveriş uygulaması",
"RALLY": "RALLY",
"CRANE": "CRANE",
"Travel app": "Seyahat uygulaması",
"MATERIAL": "MALZEME",
"CUPERTINO": "CUPERTINO",
"REFERENCE STYLES & MEDIA": "REFERANS STİLLERİ VE MEDYA"
}
| gallery/lib/l10n/intl_tr.arb/0 | {
"file_path": "gallery/lib/l10n/intl_tr.arb",
"repo_id": "gallery",
"token_count": 22193
} | 843 |
// Copyright 2019 The Flutter team. 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';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
import 'package:url_launcher/url_launcher.dart';
void showAboutDialog({
required BuildContext context,
}) {
showDialog<void>(
context: context,
builder: (context) {
return _AboutDialog();
},
);
}
Future<String> getVersionNumber() async {
return '2.10.2+021002';
}
class _AboutDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
final textTheme = Theme.of(context).textTheme;
final bodyTextStyle =
textTheme.bodyLarge!.apply(color: colorScheme.onPrimary);
final localizations = GalleryLocalizations.of(context)!;
const name = 'Flutter Gallery'; // Don't need to localize.
const legalese = '© 2021 The Flutter team'; // Don't need to localize.
final repoText = localizations.githubRepo(name);
final seeSource = localizations.aboutDialogDescription(repoText);
final repoLinkIndex = seeSource.indexOf(repoText);
final repoLinkIndexEnd = repoLinkIndex + repoText.length;
final seeSourceFirst = seeSource.substring(0, repoLinkIndex);
final seeSourceSecond = seeSource.substring(repoLinkIndexEnd);
return AlertDialog(
backgroundColor: colorScheme.background,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
content: Container(
constraints: const BoxConstraints(maxWidth: 400),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
FutureBuilder(
future: getVersionNumber(),
builder: (context, snapshot) => SelectableText(
snapshot.hasData ? '$name ${snapshot.data}' : name,
style: textTheme.headlineMedium!.apply(
color: colorScheme.onPrimary,
),
),
),
const SizedBox(height: 24),
SelectableText.rich(
TextSpan(
children: [
TextSpan(
style: bodyTextStyle,
text: seeSourceFirst,
),
TextSpan(
style: bodyTextStyle.copyWith(
color: colorScheme.primary,
),
text: repoText,
recognizer: TapGestureRecognizer()
..onTap = () async {
final url =
Uri.parse('https://github.com/flutter/gallery/');
if (await canLaunchUrl(url)) {
await launchUrl(url);
}
},
),
TextSpan(
style: bodyTextStyle,
text: seeSourceSecond,
),
],
),
),
const SizedBox(height: 18),
SelectableText(
legalese,
style: bodyTextStyle,
),
],
),
),
actions: [
TextButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute<void>(
builder: (context) => Theme(
data: Theme.of(context).copyWith(
textTheme: Typography.material2018(
platform: Theme.of(context).platform,
).black,
cardColor: Colors.white,
),
child: const LicensePage(
applicationName: name,
applicationLegalese: legalese,
),
),
));
},
child: Text(
MaterialLocalizations.of(context).viewLicensesButtonLabel,
),
),
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: Text(MaterialLocalizations.of(context).closeButtonLabel),
),
],
);
}
}
| gallery/lib/pages/about.dart/0 | {
"file_path": "gallery/lib/pages/about.dart",
"repo_id": "gallery",
"token_count": 2165
} | 844 |
// Copyright 2019 The Flutter team. 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_gen/gen_l10n/gallery_localizations.dart';
import 'package:gallery/studies/crane/backlayer.dart';
import 'package:gallery/studies/crane/header_form.dart';
class EatForm extends BackLayerItem {
const EatForm({super.key}) : super(index: 2);
@override
State<EatForm> createState() => _EatFormState();
}
class _EatFormState extends State<EatForm> with RestorationMixin {
final dinerController = RestorableTextEditingController();
final dateController = RestorableTextEditingController();
final timeController = RestorableTextEditingController();
final locationController = RestorableTextEditingController();
@override
String get restorationId => 'eat_form';
@override
void restoreState(RestorationBucket? oldBucket, bool initialRestore) {
registerForRestoration(dinerController, 'diner_controller');
registerForRestoration(dateController, 'date_controller');
registerForRestoration(timeController, 'time_controller');
registerForRestoration(locationController, 'location_controller');
}
@override
void dispose() {
dinerController.dispose();
dateController.dispose();
timeController.dispose();
locationController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final localizations = GalleryLocalizations.of(context)!;
return HeaderForm(
fields: <HeaderFormField>[
HeaderFormField(
index: 0,
iconData: Icons.person,
title: localizations.craneFormDiners,
textController: dinerController.value,
),
HeaderFormField(
index: 1,
iconData: Icons.date_range,
title: localizations.craneFormDate,
textController: dateController.value,
),
HeaderFormField(
index: 2,
iconData: Icons.access_time,
title: localizations.craneFormTime,
textController: timeController.value,
),
HeaderFormField(
index: 3,
iconData: Icons.restaurant_menu,
title: localizations.craneFormLocation,
textController: locationController.value,
),
],
);
}
}
| gallery/lib/studies/crane/eat_form.dart/0 | {
"file_path": "gallery/lib/studies/crane/eat_form.dart",
"repo_id": "gallery",
"token_count": 862
} | 845 |
// Copyright 2019 The Flutter team. 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 VerticalFractionBar extends StatelessWidget {
const VerticalFractionBar({
super.key,
this.color,
required this.fraction,
});
final Color? color;
final double fraction;
@override
Widget build(BuildContext context) {
return LayoutBuilder(builder: (context, constraints) {
return SizedBox(
height: constraints.maxHeight,
width: 4,
child: Column(
children: [
SizedBox(
height: (1 - fraction) * constraints.maxHeight,
child: Container(
color: Colors.black,
),
),
SizedBox(
height: fraction * constraints.maxHeight,
child: Container(color: color),
),
],
),
);
});
}
}
| gallery/lib/studies/rally/charts/vertical_fraction_bar.dart/0 | {
"file_path": "gallery/lib/studies/rally/charts/vertical_fraction_bar.dart",
"repo_id": "gallery",
"token_count": 434
} | 846 |
// Copyright 2019 The Flutter team. 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';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
import 'package:gallery/layout/adaptive.dart';
import 'package:gallery/layout/text_scale.dart';
import 'package:gallery/studies/shrine/colors.dart';
import 'package:gallery/studies/shrine/model/app_state_model.dart';
import 'package:gallery/studies/shrine/model/product.dart';
import 'package:gallery/studies/shrine/page_status.dart';
import 'package:gallery/studies/shrine/shopping_cart.dart';
import 'package:scoped_model/scoped_model.dart';
// These curves define the emphasized easing curve.
const Cubic _accelerateCurve = Cubic(0.548, 0, 0.757, 0.464);
const Cubic _decelerateCurve = Cubic(0.23, 0.94, 0.41, 1);
// The time at which the accelerate and decelerate curves switch off
const _peakVelocityTime = 0.248210;
// Percent (as a decimal) of animation that should be completed at _peakVelocityTime
const _peakVelocityProgress = 0.379146;
// Radius of the shape on the top start of the sheet for mobile layouts.
const _mobileCornerRadius = 24.0;
// Radius of the shape on the top start and bottom start of the sheet for mobile layouts.
const _desktopCornerRadius = 12.0;
// Width for just the cart icon and no thumbnails.
const _cartIconWidth = 64.0;
// Height for just the cart icon and no thumbnails.
const _cartIconHeight = 56.0;
// Height of a thumbnail.
const _defaultThumbnailHeight = 40.0;
// Gap between thumbnails.
const _thumbnailGap = 16.0;
// Maximum number of thumbnails shown in the cart.
const _maxThumbnailCount = 3;
double _thumbnailHeight(BuildContext context) {
return _defaultThumbnailHeight * reducedTextScale(context);
}
double _paddedThumbnailHeight(BuildContext context) {
return _thumbnailHeight(context) + _thumbnailGap;
}
class ExpandingBottomSheet extends StatefulWidget {
const ExpandingBottomSheet({
super.key,
required this.hideController,
required this.expandingController,
});
final AnimationController hideController;
final AnimationController expandingController;
@override
ExpandingBottomSheetState createState() => ExpandingBottomSheetState();
static ExpandingBottomSheetState? of(BuildContext context,
{bool isNullOk = false}) {
final result = context.findAncestorStateOfType<ExpandingBottomSheetState>();
if (isNullOk || result != null) {
return result;
}
throw FlutterError(
'ExpandingBottomSheet.of() called with a context that does not contain a ExpandingBottomSheet.\n');
}
}
// Emphasized Easing is a motion curve that has an organic, exciting feeling.
// It's very fast to begin with and then very slow to finish. Unlike standard
// curves, like [Curves.fastOutSlowIn], it can't be expressed in a cubic bezier
// curve formula. It's quintic, not cubic. But it _can_ be expressed as one
// curve followed by another, which we do here.
Animation<T> _getEmphasizedEasingAnimation<T>({
required T begin,
required T peak,
required T end,
required bool isForward,
required Animation<double> parent,
}) {
Curve firstCurve;
Curve secondCurve;
double firstWeight;
double secondWeight;
if (isForward) {
firstCurve = _accelerateCurve;
secondCurve = _decelerateCurve;
firstWeight = _peakVelocityTime;
secondWeight = 1 - _peakVelocityTime;
} else {
firstCurve = _decelerateCurve.flipped;
secondCurve = _accelerateCurve.flipped;
firstWeight = 1 - _peakVelocityTime;
secondWeight = _peakVelocityTime;
}
return TweenSequence<T>(
[
TweenSequenceItem<T>(
weight: firstWeight,
tween: Tween<T>(
begin: begin,
end: peak,
).chain(CurveTween(curve: firstCurve)),
),
TweenSequenceItem<T>(
weight: secondWeight,
tween: Tween<T>(
begin: peak,
end: end,
).chain(CurveTween(curve: secondCurve)),
),
],
).animate(parent);
}
// Calculates the value where two double Animations should be joined. Used by
// callers of _getEmphasisedEasing<double>().
double _getPeakPoint({required double begin, required double end}) {
return begin + (end - begin) * _peakVelocityProgress;
}
class ExpandingBottomSheetState extends State<ExpandingBottomSheet> {
final GlobalKey _expandingBottomSheetKey =
GlobalKey(debugLabel: 'Expanding bottom sheet');
// The width of the Material, calculated by _widthFor() & based on the number
// of products in the cart. 64.0 is the width when there are 0 products
// (_kWidthForZeroProducts)
double _width = _cartIconWidth;
double _height = _cartIconHeight;
// Controller for the opening and closing of the ExpandingBottomSheet
AnimationController get _controller => widget.expandingController;
// Animations for the opening and closing of the ExpandingBottomSheet
late Animation<double> _widthAnimation;
late Animation<double> _heightAnimation;
late Animation<double> _thumbnailOpacityAnimation;
late Animation<double> _cartOpacityAnimation;
late Animation<double> _topStartShapeAnimation;
late Animation<double> _bottomStartShapeAnimation;
late Animation<Offset> _slideAnimation;
late Animation<double> _gapAnimation;
Animation<double> _getWidthAnimation(double screenWidth) {
if (_controller.status == AnimationStatus.forward) {
// Opening animation
return Tween<double>(begin: _width, end: screenWidth).animate(
CurvedAnimation(
parent: _controller.view,
curve: const Interval(0, 0.3, curve: Curves.fastOutSlowIn),
),
);
} else {
// Closing animation
return _getEmphasizedEasingAnimation(
begin: _width,
peak: _getPeakPoint(begin: _width, end: screenWidth),
end: screenWidth,
isForward: false,
parent: CurvedAnimation(
parent: _controller.view, curve: const Interval(0, 0.87)),
);
}
}
Animation<double> _getHeightAnimation(double screenHeight) {
if (_controller.status == AnimationStatus.forward) {
// Opening animation
return _getEmphasizedEasingAnimation(
begin: _height,
peak: _getPeakPoint(begin: _height, end: screenHeight),
end: screenHeight,
isForward: true,
parent: _controller.view,
);
} else {
// Closing animation
return Tween<double>(
begin: _height,
end: screenHeight,
).animate(
CurvedAnimation(
parent: _controller.view,
curve: const Interval(0.434, 1, curve: Curves.linear), // not used
// only the reverseCurve will be used
reverseCurve: Interval(0.434, 1, curve: Curves.fastOutSlowIn.flipped),
),
);
}
}
Animation<double> _getDesktopGapAnimation(double gapHeight) {
final collapsedGapHeight = gapHeight;
const expandedGapHeight = 0.0;
if (_controller.status == AnimationStatus.forward) {
// Opening animation
return _getEmphasizedEasingAnimation(
begin: collapsedGapHeight,
peak: collapsedGapHeight +
(expandedGapHeight - collapsedGapHeight) * _peakVelocityProgress,
end: expandedGapHeight,
isForward: true,
parent: _controller.view,
);
} else {
// Closing animation
return Tween<double>(
begin: collapsedGapHeight,
end: expandedGapHeight,
).animate(
CurvedAnimation(
parent: _controller.view,
curve: const Interval(0.434, 1), // not used
// only the reverseCurve will be used
reverseCurve: Interval(0.434, 1, curve: Curves.fastOutSlowIn.flipped),
),
);
}
}
// Animation of the top-start cut corner. It's cut when closed and not cut when open.
Animation<double> _getShapeTopStartAnimation(BuildContext context) {
final isDesktop = isDisplayDesktop(context);
final cornerRadius = isDesktop ? _desktopCornerRadius : _mobileCornerRadius;
if (_controller.status == AnimationStatus.forward) {
return Tween<double>(begin: cornerRadius, end: 0).animate(
CurvedAnimation(
parent: _controller.view,
curve: const Interval(0, 0.3, curve: Curves.fastOutSlowIn),
),
);
} else {
return _getEmphasizedEasingAnimation(
begin: cornerRadius,
peak: _getPeakPoint(begin: cornerRadius, end: 0),
end: 0,
isForward: false,
parent: _controller.view,
);
}
}
// Animation of the bottom-start cut corner. It's cut when closed and not cut when open.
Animation<double> _getShapeBottomStartAnimation(BuildContext context) {
final isDesktop = isDisplayDesktop(context);
final cornerRadius = isDesktop ? _desktopCornerRadius : 0.0;
if (_controller.status == AnimationStatus.forward) {
return Tween<double>(begin: cornerRadius, end: 0).animate(
CurvedAnimation(
parent: _controller.view,
curve: const Interval(0, 0.3, curve: Curves.fastOutSlowIn),
),
);
} else {
return _getEmphasizedEasingAnimation(
begin: cornerRadius,
peak: _getPeakPoint(begin: cornerRadius, end: 0),
end: 0,
isForward: false,
parent: _controller.view,
);
}
}
Animation<double> _getThumbnailOpacityAnimation() {
return Tween<double>(begin: 1, end: 0).animate(
CurvedAnimation(
parent: _controller.view,
curve: _controller.status == AnimationStatus.forward
? const Interval(0, 0.3)
: const Interval(0.532, 0.766),
),
);
}
Animation<double> _getCartOpacityAnimation() {
return CurvedAnimation(
parent: _controller.view,
curve: _controller.status == AnimationStatus.forward
? const Interval(0.3, 0.6)
: const Interval(0.766, 1),
);
}
// Returns the correct width of the ExpandingBottomSheet based on the number of
// products and the text scaling options in the cart in the mobile layout.
double _mobileWidthFor(int numProducts, BuildContext context) {
final cartThumbnailGap = numProducts > 0 ? 16 : 0;
final thumbnailsWidth =
min(numProducts, _maxThumbnailCount) * _paddedThumbnailHeight(context);
final overflowNumberWidth =
numProducts > _maxThumbnailCount ? 30 * cappedTextScale(context) : 0;
return _cartIconWidth +
cartThumbnailGap +
thumbnailsWidth +
overflowNumberWidth;
}
// Returns the correct height of the ExpandingBottomSheet based on the text scaling
// options in the mobile layout.
double _mobileHeightFor(BuildContext context) {
return _paddedThumbnailHeight(context);
}
// Returns the correct width of the ExpandingBottomSheet based on the text scaling
// options in the desktop layout.
double _desktopWidthFor(BuildContext context) {
return _paddedThumbnailHeight(context) + 8;
}
// Returns the correct height of the ExpandingBottomSheet based on the number of
// products and the text scaling options in the cart in the desktop layout.
double _desktopHeightFor(int numProducts, BuildContext context) {
final cartThumbnailGap = numProducts > 0 ? 8 : 0;
final thumbnailsHeight =
min(numProducts, _maxThumbnailCount) * _paddedThumbnailHeight(context);
final overflowNumberHeight =
numProducts > _maxThumbnailCount ? 28 * reducedTextScale(context) : 0;
return _cartIconHeight +
cartThumbnailGap +
thumbnailsHeight +
overflowNumberHeight;
}
// Returns true if the cart is open or opening and false otherwise.
bool get _isOpen {
final status = _controller.status;
return status == AnimationStatus.completed ||
status == AnimationStatus.forward;
}
// Opens the ExpandingBottomSheet if it's closed, otherwise does nothing.
void open() {
if (!_isOpen) {
_controller.forward();
}
}
// Closes the ExpandingBottomSheet if it's open or opening, otherwise does nothing.
void close() {
if (_isOpen) {
_controller.reverse();
}
}
// Changes the padding between the start edge of the Material and the cart icon
// based on the number of products in the cart (padding increases when > 0
// products.)
EdgeInsetsDirectional _horizontalCartPaddingFor(int numProducts) {
return (numProducts == 0)
? const EdgeInsetsDirectional.only(start: 20, end: 8)
: const EdgeInsetsDirectional.only(start: 32, end: 8);
}
// Changes the padding above and below the cart icon
// based on the number of products in the cart (padding increases when > 0
// products.)
EdgeInsets _verticalCartPaddingFor(int numProducts) {
return (numProducts == 0)
? const EdgeInsets.only(top: 16, bottom: 16)
: const EdgeInsets.only(top: 16, bottom: 24);
}
bool get _cartIsVisible => _thumbnailOpacityAnimation.value == 0;
// We take 16 pts off of the bottom padding to ensure the collapsed shopping
// cart is not too tall.
double get _bottomSafeArea {
return max(MediaQuery.of(context).viewPadding.bottom - 16, 0);
}
Widget _buildThumbnails(BuildContext context, int numProducts) {
final isDesktop = isDisplayDesktop(context);
Widget thumbnails;
if (isDesktop) {
thumbnails = Column(
children: [
AnimatedPadding(
padding: _verticalCartPaddingFor(numProducts),
duration: const Duration(milliseconds: 225),
child: const Icon(Icons.shopping_cart),
),
SizedBox(
width: _width,
height: min(numProducts, _maxThumbnailCount) *
_paddedThumbnailHeight(context),
child: const ProductThumbnailRow(),
),
const ExtraProductsNumber(),
],
);
} else {
thumbnails = Column(
children: [
Row(
children: [
AnimatedPadding(
padding: _horizontalCartPaddingFor(numProducts),
duration: const Duration(milliseconds: 225),
child: const Icon(Icons.shopping_cart),
),
Container(
// Accounts for the overflow number
width: min(numProducts, _maxThumbnailCount) *
_paddedThumbnailHeight(context) +
(numProducts > 0 ? _thumbnailGap : 0),
height: _height - _bottomSafeArea,
padding: const EdgeInsets.symmetric(vertical: 8),
child: const ProductThumbnailRow(),
),
const ExtraProductsNumber(),
],
),
],
);
}
return ExcludeSemantics(
child: Opacity(
opacity: _thumbnailOpacityAnimation.value,
child: thumbnails,
),
);
}
Widget _buildShoppingCartPage() {
return Opacity(
opacity: _cartOpacityAnimation.value,
child: const ShoppingCartPage(),
);
}
Widget _buildCart(BuildContext context) {
// numProducts is the number of different products in the cart (does not
// include multiples of the same product).
final isDesktop = isDisplayDesktop(context);
final model = ScopedModel.of<AppStateModel>(context);
final numProducts = model.productsInCart.keys.length;
final totalCartQuantity = model.totalCartQuantity;
final screenSize = MediaQuery.of(context).size;
final screenWidth = screenSize.width;
final screenHeight = screenSize.height;
final expandedCartWidth = isDesktop
? (360 * cappedTextScale(context)).clamp(360, screenWidth).toDouble()
: screenWidth;
_width = isDesktop
? _desktopWidthFor(context)
: _mobileWidthFor(numProducts, context);
_widthAnimation = _getWidthAnimation(expandedCartWidth);
_height = isDesktop
? _desktopHeightFor(numProducts, context)
: _mobileHeightFor(context) + _bottomSafeArea;
_heightAnimation = _getHeightAnimation(screenHeight);
_topStartShapeAnimation = _getShapeTopStartAnimation(context);
_bottomStartShapeAnimation = _getShapeBottomStartAnimation(context);
_thumbnailOpacityAnimation = _getThumbnailOpacityAnimation();
_cartOpacityAnimation = _getCartOpacityAnimation();
_gapAnimation = isDesktop
? _getDesktopGapAnimation(116)
: const AlwaysStoppedAnimation(0);
final Widget child = SizedBox(
width: _widthAnimation.value,
height: _heightAnimation.value,
child: Material(
animationDuration: const Duration(milliseconds: 0),
shape: BeveledRectangleBorder(
borderRadius: BorderRadiusDirectional.only(
topStart: Radius.circular(_topStartShapeAnimation.value),
bottomStart: Radius.circular(_bottomStartShapeAnimation.value),
),
),
elevation: 4,
color: shrinePink50,
child: _cartIsVisible
? _buildShoppingCartPage()
: _buildThumbnails(context, numProducts),
),
);
final childWithInteraction = productPageIsVisible(context)
? Semantics(
button: true,
enabled: true,
label: GalleryLocalizations.of(context)!
.shrineScreenReaderCart(totalCartQuantity),
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: open,
child: child,
),
),
)
: child;
return Padding(
padding: EdgeInsets.only(top: _gapAnimation.value),
child: childWithInteraction,
);
}
// Builder for the hide and reveal animation when the backdrop opens and closes
Widget _buildSlideAnimation(BuildContext context, Widget child) {
final isDesktop = isDisplayDesktop(context);
if (isDesktop) {
return child;
} else {
final textDirectionScalar =
Directionality.of(context) == TextDirection.ltr ? 1 : -1;
_slideAnimation = _getEmphasizedEasingAnimation(
begin: Offset(1.0 * textDirectionScalar, 0.0),
peak: Offset(_peakVelocityProgress * textDirectionScalar, 0),
end: const Offset(0, 0),
isForward: widget.hideController.status == AnimationStatus.forward,
parent: widget.hideController,
);
return SlideTransition(
position: _slideAnimation,
child: child,
);
}
}
@override
Widget build(BuildContext context) {
return AnimatedSize(
key: _expandingBottomSheetKey,
duration: const Duration(milliseconds: 225),
curve: Curves.easeInOut,
alignment: AlignmentDirectional.topStart,
child: AnimatedBuilder(
animation: widget.hideController,
builder: (context, child) => AnimatedBuilder(
animation: widget.expandingController,
builder: (context, child) => ScopedModelDescendant<AppStateModel>(
builder: (context, child, model) =>
_buildSlideAnimation(context, _buildCart(context)),
),
),
),
);
}
}
class ProductThumbnailRow extends StatefulWidget {
const ProductThumbnailRow({super.key});
@override
State<ProductThumbnailRow> createState() => _ProductThumbnailRowState();
}
class _ProductThumbnailRowState extends State<ProductThumbnailRow> {
final GlobalKey<AnimatedListState> _listKey = GlobalKey<AnimatedListState>();
// _list represents what's currently on screen. If _internalList updates,
// it will need to be updated to match it.
late _ListModel _list;
// _internalList represents the list as it is updated by the AppStateModel.
late List<int> _internalList;
@override
void initState() {
super.initState();
_list = _ListModel(
listKey: _listKey,
initialItems:
ScopedModel.of<AppStateModel>(context).productsInCart.keys.toList(),
removedItemBuilder: _buildRemovedThumbnail,
);
_internalList = List<int>.from(_list.list);
}
Product _productWithId(int productId) {
final model = ScopedModel.of<AppStateModel>(context);
final product = model.getProductById(productId);
return product;
}
Widget _buildRemovedThumbnail(
int item, BuildContext context, Animation<double> animation) {
return ProductThumbnail(animation, animation, _productWithId(item));
}
Widget _buildThumbnail(
BuildContext context, int index, Animation<double> animation) {
final thumbnailSize = Tween<double>(begin: 0.8, end: 1).animate(
CurvedAnimation(
curve: const Interval(0.33, 1, curve: Curves.easeIn),
parent: animation,
),
);
final Animation<double> opacity = CurvedAnimation(
curve: const Interval(0.33, 1, curve: Curves.linear),
parent: animation,
);
return ProductThumbnail(
thumbnailSize, opacity, _productWithId(_list[index]));
}
// If the lists are the same length, assume nothing has changed.
// If the internalList is shorter than the ListModel, an item has been removed.
// If the internalList is longer, then an item has been added.
void _updateLists() {
// Update _internalList based on the model
_internalList =
ScopedModel.of<AppStateModel>(context).productsInCart.keys.toList();
final internalSet = Set<int>.from(_internalList);
final listSet = Set<int>.from(_list.list);
final difference = internalSet.difference(listSet);
if (difference.isEmpty) {
return;
}
for (final product in difference) {
if (_internalList.length < _list.length) {
_list.remove(product);
} else if (_internalList.length > _list.length) {
_list.add(product);
}
}
while (_internalList.length != _list.length) {
var index = 0;
// Check bounds and that the list elements are the same
while (_internalList.isNotEmpty &&
_list.length > 0 &&
index < _internalList.length &&
index < _list.length &&
_internalList[index] == _list[index]) {
index++;
}
}
}
Widget _buildAnimatedList(BuildContext context) {
final isDesktop = isDisplayDesktop(context);
return AnimatedList(
key: _listKey,
shrinkWrap: true,
itemBuilder: _buildThumbnail,
initialItemCount: _list.length,
scrollDirection: isDesktop ? Axis.vertical : Axis.horizontal,
physics: const NeverScrollableScrollPhysics(), // Cart shouldn't scroll
);
}
@override
Widget build(BuildContext context) {
return ScopedModelDescendant<AppStateModel>(
builder: (context, child, model) {
_updateLists();
return _buildAnimatedList(context);
},
);
}
}
class ExtraProductsNumber extends StatelessWidget {
const ExtraProductsNumber({super.key});
// Calculates the number to be displayed at the end of the row if there are
// more than three products in the cart. This calculates overflow products,
// including their duplicates (but not duplicates of products shown as
// thumbnails).
int _calculateOverflow(AppStateModel model) {
final productMap = model.productsInCart;
// List created to be able to access products by index instead of ID.
// Order is guaranteed because productsInCart returns a LinkedHashMap.
final products = productMap.keys.toList();
var overflow = 0;
final numProducts = products.length;
for (var i = _maxThumbnailCount; i < numProducts; i++) {
overflow += productMap[products[i]]!;
}
return overflow;
}
Widget _buildOverflow(AppStateModel model, BuildContext context) {
if (model.productsInCart.length <= _maxThumbnailCount) {
return Container();
}
final numOverflowProducts = _calculateOverflow(model);
// Maximum of 99 so padding doesn't get messy.
final displayedOverflowProducts =
numOverflowProducts <= 99 ? numOverflowProducts : 99;
return Text(
'+$displayedOverflowProducts',
style: Theme.of(context).primaryTextTheme.labelLarge,
);
}
@override
Widget build(BuildContext context) {
return ScopedModelDescendant<AppStateModel>(
builder: (builder, child, model) => _buildOverflow(model, context),
);
}
}
class ProductThumbnail extends StatelessWidget {
const ProductThumbnail(this.animation, this.opacityAnimation, this.product,
{super.key});
final Animation<double> animation;
final Animation<double> opacityAnimation;
final Product product;
@override
Widget build(BuildContext context) {
final isDesktop = isDisplayDesktop(context);
return FadeTransition(
opacity: opacityAnimation,
child: ScaleTransition(
scale: animation,
child: Container(
width: _thumbnailHeight(context),
height: _thumbnailHeight(context),
decoration: BoxDecoration(
image: DecorationImage(
image: ExactAssetImage(
product.assetName, // asset name
package: product.assetPackage, // asset package
),
fit: BoxFit.cover,
),
borderRadius: const BorderRadius.all(Radius.circular(10)),
),
margin: isDesktop
? const EdgeInsetsDirectional.only(start: 12, end: 12, bottom: 16)
: const EdgeInsetsDirectional.only(start: 16),
),
),
);
}
}
// _ListModel manipulates an internal list and an AnimatedList
class _ListModel {
_ListModel({
required this.listKey,
required this.removedItemBuilder,
Iterable<int>? initialItems,
}) : _items = initialItems?.toList() ?? [];
final GlobalKey<AnimatedListState> listKey;
final Widget Function(int, BuildContext, Animation<double>)
removedItemBuilder;
final List<int> _items;
AnimatedListState? get _animatedList => listKey.currentState;
void add(int product) {
_insert(_items.length, product);
}
void _insert(int index, int item) {
_items.insert(index, item);
_animatedList!
.insertItem(index, duration: const Duration(milliseconds: 225));
}
void remove(int product) {
final index = _items.indexOf(product);
if (index >= 0) {
_removeAt(index);
}
}
void _removeAt(int index) {
final removedItem = _items.removeAt(index);
_animatedList!.removeItem(index, (context, animation) {
return removedItemBuilder(removedItem, context, animation);
});
}
int get length => _items.length;
int operator [](int index) => _items[index];
int indexOf(int item) => _items.indexOf(item);
List<int> get list => _items;
}
| gallery/lib/studies/shrine/expanding_bottom_sheet.dart/0 | {
"file_path": "gallery/lib/studies/shrine/expanding_bottom_sheet.dart",
"repo_id": "gallery",
"token_count": 9871
} | 847 |
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="production" type="FlutterRunConfigurationType" factoryName="Flutter">
<option name="buildFlavor" value="production" />
<option name="filePath" value="$PROJECT_DIR$/lib/main_production.dart" />
<method v="2" />
</configuration>
</component>
| io_flip/.idea/runConfigurations/production.xml/0 | {
"file_path": "io_flip/.idea/runConfigurations/production.xml",
"repo_id": "io_flip",
"token_count": 105
} | 848 |
import 'package:dart_frog/dart_frog.dart';
import 'package:shelf_cors_headers/shelf_cors_headers.dart' as shelf;
import '../main.dart';
Middleware corsHeaders() {
return fromShelfMiddleware(
shelf.corsHeaders(
headers: {
shelf.ACCESS_CONTROL_ALLOW_ORIGIN: gameUrl.url,
},
),
);
}
| io_flip/api/headers/cors_headers.dart/0 | {
"file_path": "io_flip/api/headers/cors_headers.dart",
"repo_id": "io_flip",
"token_count": 140
} | 849 |
import 'dart:math';
import 'package:config_repository/config_repository.dart';
import 'package:db_client/db_client.dart';
import 'package:game_domain/game_domain.dart';
import 'package:game_script_machine/game_script_machine.dart';
import 'package:image_model_repository/image_model_repository.dart';
import 'package:language_model_repository/language_model_repository.dart';
/// {@template cards_repository}
/// Access to Cards Datasource.
/// {@endtemplate}
class CardsRepository {
/// {@macro cards_repository}
CardsRepository({
required ImageModelRepository imageModelRepository,
required LanguageModelRepository languageModelRepository,
required ConfigRepository configRepository,
required DbClient dbClient,
required GameScriptMachine gameScriptMachine,
Random? rng,
}) : _dbClient = dbClient,
_imageModelRepository = imageModelRepository,
_languageModelRepository = languageModelRepository,
_configRepository = configRepository,
_gameScriptMachine = gameScriptMachine,
_rng = rng ?? Random();
final DbClient _dbClient;
final Random _rng;
final GameScriptMachine _gameScriptMachine;
final ImageModelRepository _imageModelRepository;
final LanguageModelRepository _languageModelRepository;
final ConfigRepository _configRepository;
/// Generates a random card.
Future<List<Card>> generateCards({
required String characterClass,
required String characterPower,
}) async {
final variations = await _configRepository.getCardVariations();
const deckSize = 12;
final images = await _imageModelRepository.generateImages(
characterClass: characterClass,
variationsAvailable: variations,
deckSize: deckSize,
);
return Future.wait(
images.map((image) async {
final isRare = _gameScriptMachine.rollCardRarity();
final [name, description] = await Future.wait([
_languageModelRepository.generateCardName(
characterName: image.character,
characterClass: image.characterClass,
characterPower: characterPower,
),
_languageModelRepository.generateFlavorText(
character: image.character,
characterClass: image.characterClass,
characterPower: characterPower,
location: image.location,
),
]);
final rarity = isRare;
final power = _gameScriptMachine.rollCardPower(isRare: isRare);
final suit = Suit.values[_rng.nextInt(Suit.values.length)];
final id = await _dbClient.add('cards', {
'name': name,
'description': description,
'image': image.url,
'rarity': rarity,
'power': power,
'suit': suit.name,
});
return Card(
id: id,
name: name,
description: description,
image: image.url,
rarity: isRare,
power: power,
suit: suit,
);
}).toList(),
);
}
/// Creates a deck for cpu using the given cards.
Future<String> createCpuDeck({
required List<Card> cards,
required String userId,
}) {
final randomDouble = _rng.nextDouble();
final force = 0.4 * randomDouble + 0.6;
cards.sort((a, b) => a.power.compareTo(b.power));
final startIndex = ((cards.length - 3) * force).round();
final deck = cards.sublist(startIndex, startIndex + 3);
return _dbClient.add('decks', {
'cards': deck.map((e) => e.id).toList(),
'userId': 'CPU_$userId',
});
}
/// Creates a deck with the given cards.
Future<String> createDeck({
required List<String> cardIds,
required String userId,
}) {
return _dbClient.add('decks', {
'cards': cardIds,
'userId': userId,
});
}
/// Finds a deck with the given [deckId].
Future<Deck?> getDeck(String deckId) async {
final deckData = await _dbClient.getById('decks', deckId);
if (deckData == null) {
return null;
}
final cardIds = (deckData.data['cards'] as List).cast<String>();
final cardsData = await Future.wait(
cardIds.map((id) => _dbClient.getById('cards', id)),
);
return Deck.fromJson({
'id': deckData.id,
'userId': deckData.data['userId'],
'shareImage': deckData.data['shareImage'],
'cards': cardsData
.whereType<DbEntityRecord>()
.map(
(data) => {'id': data.id, ...data.data},
)
.toList(),
});
}
/// Finds a card with the given [cardId].
Future<Card?> getCard(String cardId) async {
final cardData = await _dbClient.getById('cards', cardId);
if (cardData == null) {
return null;
}
return Card.fromJson({
'id': cardData.id,
...cardData.data,
});
}
/// Updates the given [card] in the database.
Future<void> updateCard(Card card) async {
final data = card.toJson()..remove('id');
await _dbClient.update(
'cards',
DbEntityRecord(
id: card.id,
data: data,
),
);
}
/// Updates the given [deck] in the database.
Future<void> updateDeck(Deck deck) async {
final data = deck.toJson()..remove('id');
data['cards'] = (data['cards'] as List<Map<String, dynamic>>)
.map((card) => card['id'])
.toList();
await _dbClient.update(
'decks',
DbEntityRecord(
id: deck.id,
data: data,
),
);
}
}
| io_flip/api/packages/cards_repository/lib/src/cards_repository.dart/0 | {
"file_path": "io_flip/api/packages/cards_repository/lib/src/cards_repository.dart",
"repo_id": "io_flip",
"token_count": 2197
} | 850 |
import 'package:equatable/equatable.dart';
import 'package:firedart/firedart.dart';
import 'package:grpc/grpc.dart';
/// {@template db_entity_record}
/// A model representing a record in an entity.
/// {@endtemplate}
class DbEntityRecord extends Equatable {
/// {@macro db_entity_record}
const DbEntityRecord({
required this.id,
this.data = const {},
});
/// Record's id.
final String id;
/// Record's data.
final Map<String, dynamic> data;
@override
List<Object> get props => [id, data];
}
/// {@template db_client}
/// Client used to access the game database
/// {@endtemplate}
class DbClient {
/// {@macro db_client}
const DbClient({required Firestore firestore}) : _firestore = firestore;
/// {@macro db_client}
///
/// This factory returns an already initialized instance of the client.
factory DbClient.initialize(
String projectId, {
bool useEmulator = false,
}) {
try {
Firestore.initialize(
projectId,
emulator: useEmulator ? Emulator('127.0.0.1', 8081) : null,
useApplicationDefaultAuth: true,
);
} on Exception catch (e) {
if (e.toString() ==
'Exception: Firestore instance was already initialized') {
// ignore
} else {
rethrow;
}
}
return DbClient(firestore: Firestore.instance);
}
final Firestore _firestore;
static const _maxRetries = 2;
/// Adds a new entry to the given [entity], returning the generated id.
Future<String> add(String entity, Map<String, dynamic> data) =>
_add(entity, data, 0);
Future<String> _add(
String entity,
Map<String, dynamic> data,
int attempt,
) async {
try {
final collection = _firestore.collection(entity);
final reference = await collection.add(data);
return reference.id;
} on GrpcError catch (_) {
if (attempt < _maxRetries) {
return _add(entity, data, attempt + 1);
} else {
rethrow;
}
}
}
/// Updates a record with the given data.
Future<void> update(String entity, DbEntityRecord record) =>
_update(entity, record, 0);
Future<void> _update(
String entity,
DbEntityRecord record,
int attempt,
) async {
try {
final collection = _firestore.collection(entity);
final reference = collection.document(record.id);
await reference.update(record.data);
} on GrpcError catch (_) {
if (attempt < _maxRetries) {
return _update(entity, record, attempt + 1);
} else {
rethrow;
}
}
}
/// Creates or updates a record with the given data and document id.
Future<void> set(String entity, DbEntityRecord record) =>
_set(entity, record, 0);
Future<void> _set(String entity, DbEntityRecord record, int attempt) async {
try {
final collection = _firestore.collection(entity);
final reference = collection.document(record.id);
await reference.set(record.data);
} on GrpcError catch (_) {
if (attempt < _maxRetries) {
return _set(entity, record, attempt + 1);
} else {
rethrow;
}
}
}
/// Gets a record by id on the given [entity].
Future<DbEntityRecord?> getById(String entity, String id) =>
_getById(entity, id, 0);
Future<DbEntityRecord?> _getById(
String entity,
String id,
int attempt,
) async {
try {
final collection = _firestore.collection(entity);
final documentReference = collection.document(id);
final exists = await documentReference.exists;
if (!exists) {
return null;
}
final document = await documentReference.get();
return DbEntityRecord(
id: document.id,
data: document.map,
);
} on GrpcError catch (_) {
if (attempt < _maxRetries) {
return _getById(entity, id, attempt + 1);
} else {
rethrow;
}
}
}
List<DbEntityRecord> _mapResult(List<Document> results) {
if (results.isNotEmpty) {
return results.map((document) {
return DbEntityRecord(
id: document.id,
data: document.map,
);
}).toList();
}
return [];
}
/// Search for records where the [field] match the [value].
Future<List<DbEntityRecord>> findBy(
String entity,
String field,
dynamic value,
) =>
_findBy(entity, field, value, 0);
Future<List<DbEntityRecord>> _findBy(
String entity,
String field,
dynamic value,
int attempt,
) async {
try {
final collection = _firestore.collection(entity);
final results = await collection.where(field, isEqualTo: value).get();
return _mapResult(results);
} on GrpcError catch (_) {
if (attempt < _maxRetries) {
return _findBy(entity, field, value, attempt + 1);
} else {
rethrow;
}
}
}
/// Search for records where the [where] clause is true.
///
/// The [where] map should contain the field name as key and the value
/// to compare to.
Future<List<DbEntityRecord>> find(
String entity,
Map<String, dynamic> where,
) =>
_find(entity, where, 0);
Future<List<DbEntityRecord>> _find(
String entity,
Map<String, dynamic> where,
int attempt,
) async {
try {
final collection = _firestore.collection(entity);
var query = collection.where(
where.keys.first,
isEqualTo: where.values.first,
);
for (var i = 1; i < where.length; i++) {
query = query.where(
where.keys.elementAt(i),
isEqualTo: where.values.elementAt(i),
);
}
final results = await query.get();
return _mapResult(results);
} on GrpcError catch (_) {
if (attempt < _maxRetries) {
return _find(entity, where, attempt + 1);
} else {
rethrow;
}
}
}
/// Gets the [limit] records sorted by the specified [field].
Future<List<DbEntityRecord>> orderBy(
String entity,
String field, {
int limit = 10,
bool descending = true,
}) =>
_orderBy(
entity,
field,
limit: limit,
descending: descending,
attempt: 0,
);
Future<List<DbEntityRecord>> _orderBy(
String entity,
String field, {
required int attempt,
int limit = 10,
bool descending = true,
}) async {
try {
final collection = _firestore.collection(entity);
final results = await collection
.orderBy(field, descending: descending)
.limit(limit)
.get();
return results.map((document) {
return DbEntityRecord(
id: document.id,
data: document.map,
);
}).toList();
} on GrpcError catch (_) {
if (attempt < _maxRetries) {
return _orderBy(
entity,
field,
limit: limit,
descending: descending,
attempt: attempt + 1,
);
} else {
rethrow;
}
}
}
}
| io_flip/api/packages/db_client/lib/src/db_client.dart/0 | {
"file_path": "io_flip/api/packages/db_client/lib/src/db_client.dart",
"repo_id": "io_flip",
"token_count": 2832
} | 851 |
import 'dart:io';
import 'dart:typed_data';
import 'package:grpc/grpc.dart' hide Response;
import 'package:http/http.dart';
/// {@template firebase_cloud_storage_upload_failure}
/// Thrown when the upload to Firebase Cloud Storage fails.
/// Contains the error message and the stack trace.
/// {@endtemplate}
class FirebaseCloudStorageUploadFailure implements Exception {
/// {@macro firebase_cloud_storage_upload_failure}
const FirebaseCloudStorageUploadFailure(this.message, this.stackTrace);
/// The error message.
final String message;
/// The stack trace.
final StackTrace stackTrace;
@override
String toString() => message;
}
/// A function that builds an [HttpBasedAuthenticator].
typedef AuthenticatorBuilder = Future<HttpBasedAuthenticator> Function(
List<String> scopes,
);
/// A function that posts a request to a URL.
typedef PostCall = Future<Response> Function(
Uri uri, {
Map<String, String>? headers,
dynamic body,
});
/// {@template firebase_cloud_storage}
/// Allows files to be uploaded to Firebase Cloud Storage.
///
/// Throws a [FirebaseCloudStorageUploadFailure] if the upload fails.
/// {@endtemplate}
class FirebaseCloudStorage {
/// {@macro firebase_cloud_storage}
const FirebaseCloudStorage({
required this.bucketName,
AuthenticatorBuilder authenticatorBuilder =
applicationDefaultCredentialsAuthenticator,
PostCall postCall = post,
}) : _authenticatorBuilder = authenticatorBuilder,
_post = postCall;
final AuthenticatorBuilder _authenticatorBuilder;
final PostCall _post;
/// The name of the bucket.
final String bucketName;
/// Uploads a file to Firebase Cloud Storage.
Future<String> uploadFile(Uint8List data, String filename) async {
final url =
'https://storage.googleapis.com/upload/storage/v1/b/$bucketName/o?uploadType=media&name=$filename';
final headers = await _authenticate(url);
final response = await _post(
Uri.parse(url),
body: data,
headers: {
...headers,
'Content-Type': 'image/png',
},
);
if (response.statusCode != HttpStatus.ok) {
throw FirebaseCloudStorageUploadFailure(
response.body,
StackTrace.current,
);
}
final urlFilename = Uri.encodeComponent(filename);
return 'https://firebasestorage.googleapis.com/v0/b/$bucketName/o/$urlFilename?alt=media';
}
Future<Map<String, String>> _authenticate(String uri) async {
final delegate = await _authenticatorBuilder([
'https://www.googleapis.com/auth/storage',
]);
final metadata = <String, String>{};
await delegate.authenticate(metadata, uri);
return metadata;
}
}
| io_flip/api/packages/firebase_cloud_storage/lib/src/firebase_cloud_storage.dart/0 | {
"file_path": "io_flip/api/packages/firebase_cloud_storage/lib/src/firebase_cloud_storage.dart",
"repo_id": "io_flip",
"token_count": 889
} | 852 |
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'match.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Match _$MatchFromJson(Map<String, dynamic> json) => Match(
id: json['id'] as String,
hostDeck: Deck.fromJson(json['hostDeck'] as Map<String, dynamic>),
guestDeck: Deck.fromJson(json['guestDeck'] as Map<String, dynamic>),
hostConnected: json['hostConnected'] as bool? ?? false,
guestConnected: json['guestConnected'] as bool? ?? false,
);
Map<String, dynamic> _$MatchToJson(Match instance) => <String, dynamic>{
'id': instance.id,
'hostDeck': instance.hostDeck.toJson(),
'guestDeck': instance.guestDeck.toJson(),
'hostConnected': instance.hostConnected,
'guestConnected': instance.guestConnected,
};
| io_flip/api/packages/game_domain/lib/src/models/match.g.dart/0 | {
"file_path": "io_flip/api/packages/game_domain/lib/src/models/match.g.dart",
"repo_id": "io_flip",
"token_count": 316
} | 853 |
// ignore_for_file: prefer_const_constructors
import 'package:game_domain/game_domain.dart';
import 'package:test/test.dart';
void main() {
group('Card', () {
test('can be instantiated', () {
expect(
Card(
id: '',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
),
isNotNull,
);
});
test('toJson returns the instance as json', () {
expect(
Card(
id: '',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
).toJson(),
equals({
'id': '',
'name': '',
'description': '',
'image': '',
'rarity': false,
'power': 1,
'suit': 'air',
'shareImage': null,
}),
);
});
test('fromJson returns the correct instance', () {
expect(
Card.fromJson(const {
'id': '',
'name': '',
'description': '',
'image': '',
'rarity': false,
'power': 1,
'suit': 'air',
}),
equals(
Card(
id: '',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
),
),
);
});
test('supports equality', () {
expect(
Card(
id: '',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
),
equals(
Card(
id: '',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
),
),
);
expect(
Card(
id: '',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
),
isNot(
equals(
Card(
id: '1',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
),
),
),
);
expect(
Card(
id: '',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
),
isNot(
equals(
Card(
id: '',
name: 'a',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
),
),
),
);
expect(
Card(
id: '',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
),
isNot(
equals(
Card(
id: '',
name: '',
description: 'a',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
),
),
),
);
expect(
Card(
id: '',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
),
isNot(
equals(
Card(
id: '',
name: '',
description: '',
image: 'a',
rarity: false,
power: 1,
suit: Suit.air,
),
),
),
);
expect(
Card(
id: '',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
),
isNot(
equals(
Card(
id: '',
name: '',
description: '',
image: '',
rarity: false,
power: 2,
suit: Suit.air,
),
),
),
);
expect(
Card(
id: '',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.fire,
),
isNot(
equals(
Card(
id: '',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
),
),
),
);
});
test(
'copyWithShareImage returns the instance with the new shareImage value',
() {
expect(
Card(
id: '',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
).copyWithShareImage('a'),
equals(
Card(
id: '',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
shareImage: 'a',
),
),
);
},
);
});
}
| io_flip/api/packages/game_domain/test/src/models/card_test.dart/0 | {
"file_path": "io_flip/api/packages/game_domain/test/src/models/card_test.dart",
"repo_id": "io_flip",
"token_count": 3565
} | 854 |
import 'dart:math';
import 'package:game_domain/game_domain.dart';
import 'package:hetu_script/hetu_script.dart';
/// {@template game_script_machine}
/// Holds and proccess the scripts responsible for calculating the result of a
/// game match.
/// {@endtemplate}
class GameScriptMachine {
/// {@macro game_script_machine}
GameScriptMachine._(this._rng);
/// Initializes and return a new machine instance.
factory GameScriptMachine.initialize(String script, {Random? rng}) {
return GameScriptMachine._(rng ?? Random())..currentScript = script;
}
final Random _rng;
late Hetu _hetu;
late String _currentScript;
/// Updates the current script in this machine.
set currentScript(String value) {
_currentScript = value;
_hetu = Hetu()
..init(
externalFunctions: {
'rollDoubleValue': _rng.nextDouble,
},
)
..eval(_currentScript);
}
/// Returns the running script of the machine.
String get currentScript => _currentScript;
/// Rolls the chance of a card be rare, return true if it is.
bool rollCardRarity() {
return _hetu.invoke('rollCardRarity') as bool;
}
/// Rolls the chance of a card be rare, return true if it is.
int rollCardPower({required bool isRare}) {
return _hetu.invoke('rollCardPower', positionalArgs: [isRare]) as int;
}
/// Evaluates the two cards against each other.
/// Returns 1 if bigger, -1 if smaller, 0 is equals.
int compare(Card a, Card b) {
final value = _hetu.invoke(
'compareCards',
positionalArgs: [a.power, b.power, a.suit.name, b.suit.name],
) as int;
return value;
}
/// Evaluates the two suits against each other.
/// Returns 1 if `a` is bigger, -1 if `a` is smaller, 0 if both are equal.
int compareSuits(Suit a, Suit b) {
final value = _hetu.invoke(
'compareSuits',
positionalArgs: [a.name, b.name],
) as int;
return value;
}
}
| io_flip/api/packages/game_script_machine/lib/src/game_script_machine.dart/0 | {
"file_path": "io_flip/api/packages/game_script_machine/lib/src/game_script_machine.dart",
"repo_id": "io_flip",
"token_count": 675
} | 855 |
import 'package:equatable/equatable.dart';
/// {@template authenticated_user}
/// Represents an authenticated user of the api.
/// {@endtemplate}
class AuthenticatedUser extends Equatable {
/// {@macro authenticated_user}
const AuthenticatedUser(this.id);
/// The firebase user id of the user.
final String id;
@override
List<Object?> get props => [id];
}
| io_flip/api/packages/jwt_middleware/lib/src/authenticated_user.dart/0 | {
"file_path": "io_flip/api/packages/jwt_middleware/lib/src/authenticated_user.dart",
"repo_id": "io_flip",
"token_count": 111
} | 856 |
include: package:very_good_analysis/analysis_options.3.1.0.yaml
| io_flip/api/packages/leaderboard_repository/analysis_options.yaml/0 | {
"file_path": "io_flip/api/packages/leaderboard_repository/analysis_options.yaml",
"repo_id": "io_flip",
"token_count": 23
} | 857 |
import 'dart:async';
import 'dart:io';
import 'package:dart_frog/dart_frog.dart';
import 'package:game_script_machine/game_script_machine.dart';
import 'package:scripts_repository/scripts_repository.dart';
import '../../../main.dart';
FutureOr<Response> onRequest(RequestContext context, String scriptId) async {
final scriptsRepository = context.read<ScriptsRepository>();
final scritpsState = context.read<ScriptsState>();
if (context.request.method == HttpMethod.get) {
if (scriptId != 'current') {
return Response(statusCode: HttpStatus.notFound);
}
final script = await scriptsRepository.getCurrentScript();
return Response(body: script);
} else if (context.request.method == HttpMethod.put &&
scritpsState == ScriptsState.enabled) {
if (scriptId != 'current') {
return Response(statusCode: HttpStatus.notFound);
}
final content = await context.request.body();
context.read<GameScriptMachine>().currentScript = content;
await scriptsRepository.updateCurrentScript(content);
return Response(statusCode: HttpStatus.noContent);
}
return Response(statusCode: HttpStatus.methodNotAllowed);
}
| io_flip/api/routes/game/scripts/[scriptId].dart/0 | {
"file_path": "io_flip/api/routes/game/scripts/[scriptId].dart",
"repo_id": "io_flip",
"token_count": 382
} | 858 |
import 'dart:io';
import 'package:dart_frog/dart_frog.dart';
import 'package:game_domain/game_domain.dart';
import 'package:logging/logging.dart';
import 'package:match_repository/match_repository.dart';
import 'package:mocktail/mocktail.dart';
import 'package:test/test.dart';
import '../../../../../routes/game/matches/[matchId]/result.dart' as route;
class _MockRequestContext extends Mock implements RequestContext {}
class _MockMatchRepository extends Mock implements MatchRepository {}
class _MockRequest extends Mock implements Request {}
class _MockLogger extends Mock implements Logger {}
class _FakeMatch extends Fake implements Match {}
class _FakeMatchState extends Fake implements MatchState {}
void main() {
group('PATCH /game/matches/[matchId]/result', () {
late MatchRepository matchRepository;
late Request request;
late RequestContext context;
late Logger logger;
const deck = Deck(id: 'id', userId: 'userId', cards: []);
const match = Match(id: 'id', hostDeck: deck, guestDeck: deck);
const matchState = MatchState(
id: '',
matchId: '',
guestPlayedCards: [],
hostPlayedCards: [],
);
setUpAll(() {
registerFallbackValue(_FakeMatch());
registerFallbackValue(_FakeMatchState());
});
setUp(() {
matchRepository = _MockMatchRepository();
when(() => matchRepository.getMatch(match.id)).thenAnswer(
(_) async => match,
);
when(() => matchRepository.getMatchState(match.id)).thenAnswer(
(_) async => matchState,
);
when(
() => matchRepository.calculateMatchResult(
match: any(named: 'match'),
matchState: any(named: 'matchState'),
),
).thenAnswer(
(_) async {},
);
request = _MockRequest();
when(() => request.method).thenReturn(HttpMethod.patch);
logger = _MockLogger();
context = _MockRequestContext();
when(() => context.request).thenReturn(request);
when(() => context.read<MatchRepository>()).thenReturn(matchRepository);
when(() => context.read<Logger>()).thenReturn(logger);
});
test('responds with a 204', () async {
final response = await route.onRequest(context, match.id);
expect(response.statusCode, equals(HttpStatus.noContent));
});
test('responds 400 when something goes wrong', () async {
when(
() => matchRepository.calculateMatchResult(
match: any(named: 'match'),
matchState: any(named: 'matchState'),
),
).thenThrow(CalculateResultFailure());
final response = await route.onRequest(context, match.id);
expect(response.statusCode, equals(HttpStatus.badRequest));
});
test("responds 404 when the match doesn't exists", () async {
when(() => matchRepository.getMatch(match.id)).thenAnswer(
(_) async => null,
);
final response = await route.onRequest(context, match.id);
expect(response.statusCode, equals(HttpStatus.notFound));
});
test("responds 404 when the match state doesn't exists", () async {
when(() => matchRepository.getMatchState(match.id)).thenAnswer(
(_) async => null,
);
final response = await route.onRequest(context, match.id);
expect(response.statusCode, equals(HttpStatus.notFound));
});
test('allows only patch methods', () async {
when(() => request.method).thenReturn(HttpMethod.post);
final response = await route.onRequest(context, match.id);
expect(response.statusCode, equals(HttpStatus.methodNotAllowed));
});
});
}
| io_flip/api/test/routes/game/matches/[matchId]/result_test.dart/0 | {
"file_path": "io_flip/api/test/routes/game/matches/[matchId]/result_test.dart",
"repo_id": "io_flip",
"token_count": 1338
} | 859 |
// ignore_for_file: avoid_print
import 'dart:io';
import 'package:data_loader/src/prompt_mapper.dart';
import 'package:db_client/db_client.dart';
import 'package:game_domain/game_domain.dart';
/// {@template check_missing_image_tables}
/// Dart tool that checks if there are any missing tables.
/// {@endtemplate}
class MissingImageTables {
/// {@macro check_missing_image_tables}
const MissingImageTables({
required DbClient dbClient,
required File csv,
required String character,
}) : _dbClient = dbClient,
_csv = csv,
_character = character;
final File _csv;
final DbClient _dbClient;
final String _character;
String _normalizeTerm(String term) {
return term.trim().toLowerCase().replaceAll(' ', '_');
}
/// Checks if the database have all the image tables.
/// [onProgress] is called everytime there is progress,
/// it takes in the current inserted and the total to insert.
Future<void> checkMissing(void Function(int, int) onProgress) async {
final lines = await _csv.readAsLines();
final map = mapCsvToPrompts(lines);
final queries = <String>[];
for (final characterClass in map[PromptTermType.characterClass]!) {
for (final location in map[PromptTermType.location]!) {
queries.add(
'${_normalizeTerm(_character)}_${_normalizeTerm(characterClass)}'
'_${_normalizeTerm(location)}',
);
}
}
for (final query in queries) {
final result = await _dbClient.findBy(
'image_lookup_table',
'prompt',
query,
);
if (result.isEmpty) {
print(query);
}
}
print('Done');
}
}
| io_flip/api/tools/data_loader/lib/src/check_missing_image_tables.dart/0 | {
"file_path": "io_flip/api/tools/data_loader/lib/src/check_missing_image_tables.dart",
"repo_id": "io_flip",
"token_count": 627
} | 860 |
{
"hosting": [
{
"target": "app_prod",
"public": "build/web",
"cleanUrls": true,
"trailingSlash": false,
"ignore": [
".firebase",
"firebase.json",
"functions/node_modules",
"functions/src",
"__/**"
],
"headers": [
{
"source": "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
"headers": [
{
"key": "Access-Control-Allow-Origin",
"value": "*"
}
]
},
{
"source": "**/*.@(jpg|jpeg|gif|png)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=3600"
}
]
},
{
"source": "**",
"headers": [
{
"key": "Cache-Control",
"value": "no-cache, no-store, must-revalidate"
}
]
}
],
"predeploy": []
},
{
"target": "app_dev",
"public": "build/web",
"cleanUrls": true,
"trailingSlash": false,
"ignore": [
".firebase",
"firebase.json",
"functions/node_modules",
"functions/src",
"__/**"
],
"headers": [
{
"source": "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
"headers": [
{
"key": "Access-Control-Allow-Origin",
"value": "*"
}
]
},
{
"source": "**/*.@(jpg|jpeg|gif|png)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=3600"
}
]
},
{
"source": "**",
"headers": [
{
"key": "Cache-Control",
"value": "no-cache, no-store, must-revalidate"
}
]
}
],
"predeploy": []
},
{
"target": "flop_dev",
"public": "flop/build/web",
"cleanUrls": true,
"trailingSlash": false,
"ignore": [
".firebase",
"firebase.json",
"functions/node_modules",
"functions/src",
"__/**"
],
"headers": [
{
"source": "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
"headers": [
{
"key": "Access-Control-Allow-Origin",
"value": "*"
}
]
},
{
"source": "**/*.@(jpg|jpeg|gif|png)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=3600"
}
]
},
{
"source": "**",
"headers": [
{
"key": "Cache-Control",
"value": "no-cache, no-store, must-revalidate"
}
]
}
],
"predeploy": []
},
{
"target": "app_staging",
"public": "build/web",
"cleanUrls": true,
"trailingSlash": false,
"ignore": [
".firebase",
"firebase.json",
"functions/node_modules",
"functions/src",
"__/**"
],
"headers": [
{
"source": "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
"headers": [
{
"key": "Access-Control-Allow-Origin",
"value": "*"
}
]
},
{
"source": "**/*.@(jpg|jpeg|gif|png)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=3600"
}
]
},
{
"source": "**",
"headers": [
{
"key": "Cache-Control",
"value": "no-cache, no-store, must-revalidate"
}
]
}
],
"predeploy": []
}
],
"firestore": {
"rules": "firestore.rules"
},
"storage": {
"rules": "storage.rules"
},
"emulators": {
"hosting": {
"name": "app",
"port": 5003,
"host": "0.0.0.0"
},
"functions": {
"name": "api",
"port": 5001,
"host": "0.0.0.0"
},
"ui": {
"enabled": true,
"port": 5002,
"host": "0.0.0.0"
},
"auth": {
"port": 9099
},
"firestore": {
"port": 8081
},
"storage": {
"port": 9199
},
"singleProjectMode": true
},
"functions": [
{
"source": "functions",
"codebase": "default",
"ignore": [
"node_modules",
".git",
"firebase-debug.log",
"firebase-debug.*.log"
],
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint",
"npm --prefix \"$RESOURCE_DIR\" run build"
]
}
]
}
| io_flip/firebase.json/0 | {
"file_path": "io_flip/firebase.json",
"repo_id": "io_flip",
"token_count": 2969
} | 861 |
part of 'flop_bloc.dart';
abstract class FlopEvent extends Equatable {
const FlopEvent();
}
class NextStepRequested extends FlopEvent {
const NextStepRequested();
@override
List<Object> get props => [];
}
| io_flip/flop/lib/flop/bloc/flop_event.dart/0 | {
"file_path": "io_flip/flop/lib/flop/bloc/flop_event.dart",
"repo_id": "io_flip",
"token_count": 71
} | 862 |
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'google',
'plugin:@typescript-eslint/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['tsconfig.json', 'tsconfig.dev.json'],
sourceType: 'module',
},
ignorePatterns: [
'/lib/**/*', // Ignore built files.
],
plugins: [
'@typescript-eslint',
'import',
],
rules: {
'quotes': ['error', 'single'],
'import/no-unresolved': 0,
'indent': ['error', 2],
'max-len': ['error', {'code': 100, 'tabWidth': 2}],
'require-jsdoc': 0,
},
};
| io_flip/functions/.eslintrc.js/0 | {
"file_path": "io_flip/functions/.eslintrc.js",
"repo_id": "io_flip",
"token_count": 319
} | 863 |
// Copyright 2022, the Flutter 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.
import 'dart:collection';
import 'package:audioplayers/audioplayers.dart';
import 'package:flutter/widgets.dart';
import 'package:io_flip/audio/songs.dart';
import 'package:io_flip/gen/assets.gen.dart';
import 'package:io_flip/settings/settings.dart';
import 'package:logging/logging.dart';
typedef CreateAudioPlayer = AudioPlayer Function({required String playerId});
/// Allows playing music and sound. A facade to `package:audioplayers`.
class AudioController {
/// Creates an instance that plays music and sound.
///
/// Use [polyphony] to configure the number of sound effects (SFX) that can
/// play at the same time. A [polyphony] of `1` will always only play one
/// sound (a new sound will stop the previous one). See discussion
/// of [_sfxPlayers] to learn why this is the case.
///
/// Background music does not count into the [polyphony] limit. Music will
/// never be overridden by sound effects because that would be silly.
AudioController({
int polyphony = 2,
CreateAudioPlayer createPlayer = AudioPlayer.new,
}) : assert(polyphony >= 1, 'polyphony must be bigger or equals than 1'),
_musicPlayer = createPlayer(playerId: 'musicPlayer'),
_sfxPlayers = Iterable.generate(
polyphony,
(i) => createPlayer(playerId: 'sfxPlayer#$i'),
).toList(growable: false),
_playlist = Queue.of(List<Song>.of(songs)..shuffle()) {
_musicPlayer.onPlayerComplete.listen(_changeSong);
}
static final _log = Logger('AudioController');
final AudioPlayer _musicPlayer;
/// This is a list of [AudioPlayer] instances which are rotated to play
/// sound effects.
final List<AudioPlayer> _sfxPlayers;
int _currentSfxPlayer = 0;
final Queue<Song> _playlist;
SettingsController? _settings;
ValueNotifier<AppLifecycleState>? _lifecycleNotifier;
/// Enables the [AudioController] to listen to [AppLifecycleState] events,
/// and therefore do things like stopping playback when the game
/// goes into the background.
void attachLifecycleNotifier(
ValueNotifier<AppLifecycleState> lifecycleNotifier,
) {
_lifecycleNotifier?.removeListener(_handleAppLifecycle);
lifecycleNotifier.addListener(_handleAppLifecycle);
_lifecycleNotifier = lifecycleNotifier;
}
/// Enables the [AudioController] to track changes to settings.
/// Namely, when any of [SettingsController.muted],
/// [SettingsController.musicOn] or [SettingsController.soundsOn] changes,
/// the audio controller will act accordingly.
void attachSettings(SettingsController settingsController) {
if (_settings == settingsController) {
// Already attached to this instance. Nothing to do.
return;
}
// Remove handlers from the old settings controller if present
final oldSettings = _settings;
if (oldSettings != null) {
oldSettings.muted.removeListener(_mutedHandler);
oldSettings.musicOn.removeListener(_musicOnHandler);
oldSettings.soundsOn.removeListener(_soundsOnHandler);
}
_settings = settingsController;
// Add handlers to the new settings controller
settingsController.muted.addListener(_mutedHandler);
settingsController.musicOn.addListener(_musicOnHandler);
settingsController.soundsOn.addListener(_soundsOnHandler);
if (!settingsController.muted.value && settingsController.musicOn.value) {
_startMusic();
}
}
void dispose() {
_lifecycleNotifier?.removeListener(_handleAppLifecycle);
_stopAllSound();
_musicPlayer.dispose();
for (final player in _sfxPlayers) {
player.dispose();
}
}
/// Preloads all sound effects.
Future<void> initialize() async {
_log.info('Preloading sound effects');
// This assumes there is only a limited number of sound effects in the game.
// If there are hundreds of long sound effect files, it's better
// to be more selective when preloading.
await AudioCache.instance.loadAll(
Assets.sfx.values.map(_replaceUrl).toList(),
);
}
String _replaceUrl(String asset) {
return asset.replaceFirst('assets/', '');
}
/// Plays a single sound effect.
///
/// The controller will ignore this call when the attached settings'
/// [SettingsController.muted] is `true` or if its
/// [SettingsController.soundsOn] is `false`.
void playSfx(String sfx) {
if (!Assets.sfx.values.contains(sfx)) {
throw ArgumentError.value(
sfx,
'sfx',
'The given sfx is not a valid sound effect.',
);
}
final muted = _settings?.muted.value ?? true;
if (muted) {
_log.info(() => 'Ignoring playing sound ($sfx) because audio is muted.');
return;
}
final soundsOn = _settings?.soundsOn.value ?? false;
if (!soundsOn) {
_log.info(
() => 'Ignoring playing sound ($sfx) because sounds are turned off.',
);
return;
}
_log.info(() => 'Playing sound: $sfx');
_sfxPlayers[_currentSfxPlayer].play(
AssetSource(_replaceUrl(sfx)),
);
_currentSfxPlayer = (_currentSfxPlayer + 1) % _sfxPlayers.length;
}
void _changeSong(void _) {
_log.info('Last song finished playing.');
// Put the song that just finished playing to the end of the playlist.
_playlist.addLast(_playlist.removeFirst());
// Play the next song.
_playFirstSongInPlaylist();
}
void _handleAppLifecycle() {
switch (_lifecycleNotifier!.value) {
case AppLifecycleState.paused:
case AppLifecycleState.detached:
_stopAllSound();
break;
case AppLifecycleState.resumed:
if (!_settings!.muted.value && _settings!.musicOn.value) {
_resumeMusic();
}
break;
case AppLifecycleState.inactive:
// No need to react to this state change.
break;
}
}
void _musicOnHandler() {
if (_settings!.musicOn.value) {
// Music got turned on.
if (!_settings!.muted.value) {
_resumeMusic();
}
} else {
// Music got turned off.
_stopMusic();
}
}
void _mutedHandler() {
if (_settings!.muted.value) {
// All sound just got muted.
_stopAllSound();
} else {
// All sound just got un-muted.
if (_settings!.musicOn.value) {
_resumeMusic();
}
}
}
Future<void> _playFirstSongInPlaylist() async {
_log.info(() => 'Playing ${_playlist.first} now.');
await _musicPlayer.play(
AssetSource('music/${_playlist.first.filename}'),
volume: 0.3,
);
}
Future<void> _resumeMusic() async {
_log.info('Resuming music');
switch (_musicPlayer.state) {
case PlayerState.paused:
_log.info('Calling _musicPlayer.resume()');
try {
await _musicPlayer.resume();
} catch (e) {
// Sometimes, resuming fails with an "Unexpected" error.
_log.severe(e);
await _playFirstSongInPlaylist();
}
break;
case PlayerState.stopped:
_log.info('resumeMusic() called when music is stopped. '
"This probably means we haven't yet started the music. "
'For example, the game was started with sound off.');
await _playFirstSongInPlaylist();
break;
case PlayerState.playing:
_log.warning(
'resumeMusic() called when music is playing. '
'Nothing to do.',
);
break;
case PlayerState.completed:
_log.warning(
'resumeMusic() called when music is completed. '
"Music should never be 'completed' as it's either not playing "
'or looping forever.',
);
await _playFirstSongInPlaylist();
break;
}
}
void _soundsOnHandler() {
for (final player in _sfxPlayers) {
if (player.state == PlayerState.playing) {
player.stop();
}
}
}
void _startMusic() {
_log.info('starting music');
_playFirstSongInPlaylist();
}
void _stopAllSound() {
if (_musicPlayer.state == PlayerState.playing) {
_musicPlayer.pause();
}
for (final player in _sfxPlayers) {
player.stop();
}
}
void _stopMusic() {
_log.info('Stopping music');
if (_musicPlayer.state == PlayerState.playing) {
_musicPlayer.pause();
}
}
}
| io_flip/lib/audio/audio_controller.dart/0 | {
"file_path": "io_flip/lib/audio/audio_controller.dart",
"repo_id": "io_flip",
"token_count": 3125
} | 864 |
import 'package:api_client/api_client.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:game_domain/game_domain.dart';
import 'package:go_router/go_router.dart';
import 'package:io_flip/audio/audio_controller.dart';
import 'package:io_flip/draft/draft.dart';
class DraftPage extends StatelessWidget {
const DraftPage({required this.prompts, super.key});
factory DraftPage.routeBuilder(_, GoRouterState state) {
final prompts = state.extra as Prompt?;
return DraftPage(
prompts: prompts ?? const Prompt(),
key: const Key('draft'),
);
}
final Prompt prompts;
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) {
final gameResource = context.read<GameResource>();
final audioController = context.read<AudioController>();
return DraftBloc(
gameResource: gameResource,
audioController: audioController,
)..add(DeckRequested(prompts));
},
child: const DraftView(),
);
}
}
| io_flip/lib/draft/views/draft_page.dart/0 | {
"file_path": "io_flip/lib/draft/views/draft_page.dart",
"repo_id": "io_flip",
"token_count": 397
} | 865 |
import 'package:flame/cache.dart';
import 'package:flame/extensions.dart';
import 'package:flame/widgets.dart';
import 'package:flutter/material.dart';
import 'package:io_flip/game/game.dart';
import 'package:io_flip/gen/assets.gen.dart';
import 'package:io_flip_ui/io_flip_ui.dart';
import 'package:provider/provider.dart';
class MatchResultSplash extends StatefulWidget {
const MatchResultSplash({
required this.child,
required this.result,
required this.isWeb,
super.key,
});
final Widget child;
final bool isWeb;
final GameResult result;
@override
State<MatchResultSplash> createState() => MatchResultSplashState();
}
@visibleForTesting
class MatchResultSplashState extends State<MatchResultSplash> {
bool isSplashFinished = false;
void onComplete() {
setState(() {
isSplashFinished = true;
});
}
@override
Widget build(BuildContext context) {
final isMobile = MediaQuery.sizeOf(context).width < IoFlipBreakpoints.small;
final width = isMobile ? 314.0 : 471.0;
return isSplashFinished
? widget.child
: Center(
child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: width),
child: SizedBox.expand(
child: platformAwareAsset(
isWeb: widget.isWeb,
mobile: _MobileMatchResultSplash(
result: widget.result,
onComplete: onComplete,
),
desktop: _DesktopMatchResultSplash(
result: widget.result,
onComplete: onComplete,
),
),
),
),
);
}
}
class _MobileMatchResultSplash extends StatelessWidget {
const _MobileMatchResultSplash({
required this.result,
required this.onComplete,
});
final GameResult result;
final VoidCallback onComplete;
@override
Widget build(BuildContext context) {
final Widget child;
switch (result) {
case GameResult.win:
child = Assets.images.mobile.win.svg(
key: const Key('matchResultSplash_win_mobile'),
);
break;
case GameResult.lose:
child = Assets.images.mobile.loss.svg(
key: const Key('matchResultSplash_loss_mobile'),
);
break;
case GameResult.draw:
child = Assets.images.mobile.draw.svg(
key: const Key('matchResultSplash_draw_mobile'),
);
break;
}
return StretchAnimation(
animating: true,
onComplete: onComplete,
child: child,
);
}
}
class _DesktopMatchResultSplash extends StatelessWidget {
const _DesktopMatchResultSplash({
required this.result,
required this.onComplete,
});
final GameResult result;
final VoidCallback onComplete;
@override
Widget build(BuildContext context) {
final images = context.watch<Images>();
final String resultImageKey;
final textureSize = platformAwareAsset(
desktop: Vector2(1150, 750),
mobile: Vector2(575, 375),
);
switch (result) {
case GameResult.win:
resultImageKey = Assets.images.desktop.winSplash.keyName;
break;
case GameResult.lose:
resultImageKey = Assets.images.desktop.lossSplash.keyName;
break;
case GameResult.draw:
resultImageKey = Assets.images.desktop.drawSplash.keyName;
break;
}
return SpriteAnimationWidget.asset(
path: resultImageKey,
images: images,
anchor: Anchor.center,
onComplete: onComplete,
data: SpriteAnimationData.sequenced(
amount: 28,
amountPerRow: 4,
textureSize: textureSize,
stepTime: 0.04,
loop: false,
),
);
}
}
| io_flip/lib/game/widgets/match_result_splash.dart/0 | {
"file_path": "io_flip/lib/game/widgets/match_result_splash.dart",
"repo_id": "io_flip",
"token_count": 1612
} | 866 |
export 'view/info_view.dart';
export 'widgets/widgets.dart';
| io_flip/lib/info/info.dart/0 | {
"file_path": "io_flip/lib/info/info.dart",
"repo_id": "io_flip",
"token_count": 24
} | 867 |
import 'package:flutter/material.dart';
import 'package:io_flip/l10n/l10n.dart';
import 'package:io_flip/leaderboard/initials_form/initials_form.dart';
import 'package:io_flip/share/share.dart';
import 'package:io_flip_ui/io_flip_ui.dart';
class LeaderboardEntryView extends StatelessWidget {
const LeaderboardEntryView({
required this.scoreCardId,
this.shareHandPageData,
super.key,
});
final String scoreCardId;
final ShareHandPageData? shareHandPageData;
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
return IoFlipScaffold(
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: IoFlipSpacing.xxlg),
child: Center(
child: Column(
children: [
const SizedBox(height: IoFlipSpacing.xlg),
IoFlipLogo(width: 96.96, height: 64),
const Spacer(),
Text(
l10n.enterYourInitials,
textAlign: TextAlign.center,
style: IoFlipTextStyles.mobileH4Light,
),
const SizedBox(height: IoFlipSpacing.xlg),
InitialsForm(
scoreCardId: scoreCardId,
shareHandPageData: shareHandPageData,
),
const Spacer(),
],
),
),
),
);
}
}
| io_flip/lib/leaderboard/views/leaderboard_entry_view.dart/0 | {
"file_path": "io_flip/lib/leaderboard/views/leaderboard_entry_view.dart",
"repo_id": "io_flip",
"token_count": 673
} | 868 |
export 'match_making_page.dart';
export 'match_making_view.dart';
| io_flip/lib/match_making/views/views.dart/0 | {
"file_path": "io_flip/lib/match_making/views/views.dart",
"repo_id": "io_flip",
"token_count": 24
} | 869 |
part of 'scripts_cubit.dart';
enum ScriptsStateStatus {
loading,
loaded,
failed,
}
class ScriptsState extends Equatable {
const ScriptsState({
required this.status,
required this.current,
});
final ScriptsStateStatus status;
final String current;
ScriptsState copyWith({
ScriptsStateStatus? status,
String? current,
}) {
return ScriptsState(
status: status ?? this.status,
current: current ?? this.current,
);
}
@override
List<Object?> get props => [status, current];
}
| io_flip/lib/scripts/cubit/scripts_state.dart/0 | {
"file_path": "io_flip/lib/scripts/cubit/scripts_state.dart",
"repo_id": "io_flip",
"token_count": 186
} | 870 |
import 'package:api_client/api_client.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart' hide Card;
import 'package:game_domain/game_domain.dart';
import 'package:io_flip/l10n/l10n.dart';
import 'package:io_flip/share/share.dart';
import 'package:io_flip_ui/io_flip_ui.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher_string.dart';
class ShareCardDialog extends StatelessWidget {
const ShareCardDialog({
required this.card,
this.urlLauncher = launchUrlString,
super.key,
});
final AsyncValueSetter<String> urlLauncher;
final Card card;
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
final shareResource = context.read<ShareResource>();
return ShareDialog(
twitterShareUrl: shareResource.twitterShareCardUrl(card.id),
facebookShareUrl: shareResource.facebookShareCardUrl(card.id),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
GameCard(
size: const GameCardSize.md(),
image: card.image,
name: card.name,
description: card.description,
suitName: card.suit.name,
power: card.power,
isRare: card.rarity,
),
const SizedBox(height: IoFlipSpacing.lg),
Text(
card.name,
style: IoFlipTextStyles.mobileH4Light,
textAlign: TextAlign.center,
),
const SizedBox(height: IoFlipSpacing.sm),
Text(
l10n.shareCardDialogDescription,
style: IoFlipTextStyles.bodyLG,
textAlign: TextAlign.center,
),
const SizedBox(height: IoFlipSpacing.lg),
],
),
downloadCards: [card],
);
}
}
| io_flip/lib/share/views/share_card_dialog.dart/0 | {
"file_path": "io_flip/lib/share/views/share_card_dialog.dart",
"repo_id": "io_flip",
"token_count": 819
} | 871 |
import 'package:flutter/widgets.dart';
Size calculateTextSize(String text, TextStyle style) {
final textPainter = TextPainter(
text: TextSpan(text: text, style: style),
maxLines: 1,
textDirection: TextDirection.ltr,
)..layout();
return textPainter.size;
}
| io_flip/lib/utils/text_size.dart/0 | {
"file_path": "io_flip/lib/utils/text_size.dart",
"repo_id": "io_flip",
"token_count": 100
} | 872 |
name: api_client
description: Client to access the api
version: 0.1.0+1
publish_to: none
environment:
sdk: ">=3.0.0 <4.0.0"
dev_dependencies:
mocktail: ^0.3.0
test: ^1.19.2
very_good_analysis: ^4.0.0
dependencies:
encrypt: ^5.0.1
equatable: ^2.0.5
game_domain:
path: ../../api/packages/game_domain
http: ^0.13.5
web_socket_client: ^0.1.0-dev.3
| io_flip/packages/api_client/pubspec.yaml/0 | {
"file_path": "io_flip/packages/api_client/pubspec.yaml",
"repo_id": "io_flip",
"token_count": 173
} | 873 |
import 'dart:async';
import 'package:authentication_repository/authentication_repository.dart';
import 'package:firebase_auth/firebase_auth.dart' as fb;
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
class _MockFirebaseCore extends Mock
with MockPlatformInterfaceMixin
implements FirebasePlatform {}
class _MockFirebaseAuth extends Mock implements fb.FirebaseAuth {}
class _MockFirebaseUser extends Mock implements fb.User {}
class _MockUserCredential extends Mock implements fb.UserCredential {}
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
group('AuthenticationRepository', () {
const userId = 'mock-userId';
late fb.FirebaseAuth firebaseAuth;
late fb.UserCredential userCredential;
late AuthenticationRepository authenticationRepository;
setUp(() {
const options = FirebaseOptions(
apiKey: 'apiKey',
appId: 'appId',
messagingSenderId: 'messagingSenderId',
projectId: 'projectId',
);
final platformApp = FirebaseAppPlatform(defaultFirebaseAppName, options);
final firebaseCore = _MockFirebaseCore();
when(() => firebaseCore.apps).thenReturn([platformApp]);
when(firebaseCore.app).thenReturn(platformApp);
when(
() => firebaseCore.initializeApp(
name: defaultFirebaseAppName,
options: options,
),
).thenAnswer((_) async => platformApp);
Firebase.delegatePackingProperty = firebaseCore;
firebaseAuth = _MockFirebaseAuth();
userCredential = _MockUserCredential();
authenticationRepository = AuthenticationRepository(
firebaseAuth: firebaseAuth,
);
});
test('can be instantiated', () {
expect(AuthenticationRepository(), isNotNull);
});
group('user', () {
test('emits User.unauthenticated when firebase user is null', () async {
when(() => firebaseAuth.authStateChanges()).thenAnswer(
(_) => Stream.value(null),
);
await expectLater(
authenticationRepository.user,
emitsInOrder(const <User>[User.unauthenticated]),
);
});
test('emits returning user when firebase user is not null', () async {
final firebaseUser = _MockFirebaseUser();
when(() => firebaseUser.uid).thenReturn(userId);
when(() => firebaseAuth.authStateChanges()).thenAnswer(
(_) => Stream.value(firebaseUser),
);
await expectLater(
authenticationRepository.user,
emitsInOrder(const <User>[User(id: userId)]),
);
});
});
group('idToken', () {
test('returns stream of idTokens from FirebaseAuth', () async {
final user1 = _MockFirebaseUser();
final user2 = _MockFirebaseUser();
when(user1.getIdToken).thenAnswer((_) async => 'token1');
when(user2.getIdToken).thenAnswer((_) async => 'token2');
when(() => firebaseAuth.idTokenChanges()).thenAnswer(
(_) => Stream.fromIterable([user1, null, user2]),
);
await expectLater(
authenticationRepository.idToken,
emitsInOrder(['token1', null, 'token2']),
);
verify(user1.getIdToken).called(1);
verify(user2.getIdToken).called(1);
});
});
group('refreshIdToken', () {
test('calls getIdToken on firebase user', () async {
final user = _MockFirebaseUser();
when(() => firebaseAuth.currentUser).thenReturn(user);
when(() => user.getIdToken(true)).thenAnswer((_) async => 'token');
final result = await authenticationRepository.refreshIdToken();
expect(result, 'token');
verify(() => user.getIdToken(true)).called(1);
});
});
group('signInAnonymously', () {
test('calls signInAnonymously on FirebaseAuth', () async {
when(() => firebaseAuth.signInAnonymously()).thenAnswer(
(_) async => userCredential,
);
await authenticationRepository.signInAnonymously();
verify(() => firebaseAuth.signInAnonymously()).called(1);
});
test('throws AuthenticationException on failure', () async {
when(() => firebaseAuth.signInAnonymously()).thenThrow(
Exception('oops!'),
);
expect(
() => authenticationRepository.signInAnonymously(),
throwsA(isA<AuthenticationException>()),
);
});
});
group('dispose', () {
test('cancels internal subscriptions', () async {
final controller = StreamController<fb.User>();
final emittedUsers = <User>[];
final firebaseUser = _MockFirebaseUser();
when(() => firebaseUser.uid).thenReturn(userId);
when(() => firebaseAuth.authStateChanges()).thenAnswer(
(_) => controller.stream,
);
final subscription = authenticationRepository.user.listen(
emittedUsers.add,
);
authenticationRepository.dispose();
controller.add(firebaseUser);
await Future<void>.delayed(Duration.zero);
expect(emittedUsers, isEmpty);
await subscription.cancel();
});
});
});
}
| io_flip/packages/authentication_repository/test/src/authentication_repository_test.dart/0 | {
"file_path": "io_flip/packages/authentication_repository/test/src/authentication_repository_test.dart",
"repo_id": "io_flip",
"token_count": 2143
} | 874 |
name: connection_repository
description: Repository to manage the connection state
version: 0.1.0+1
publish_to: none
environment:
sdk: ">=3.0.0 <4.0.0"
dependencies:
api_client:
path: ../api_client
equatable: ^2.0.5
game_domain:
path: ../../api/packages/game_domain
web_socket_client: ^0.1.0-dev.3
dev_dependencies:
mocktail: ^0.3.0
test: ^1.19.2
very_good_analysis: ^4.0.0
| io_flip/packages/connection_repository/pubspec.yaml/0 | {
"file_path": "io_flip/packages/connection_repository/pubspec.yaml",
"repo_id": "io_flip",
"token_count": 174
} | 875 |
import 'package:dashbook/dashbook.dart';
import 'package:gallery/colors/app_colors_story.dart';
import 'package:gallery/spacing/app_spacing_story.dart';
import 'package:gallery/typography/typography_story.dart';
import 'package:gallery/widgets/bottom_bar_story.dart';
import 'package:gallery/widgets/widgets.dart';
import 'package:io_flip_ui/io_flip_ui.dart';
final _controller = AnimatedCardController();
void addStories(Dashbook dashbook) {
dashbook.storiesOf('AppSpacing').add(
'default',
(_) => const AppSpacingStory(),
);
dashbook.storiesOf('AppColors').add(
'default',
(_) => const AppColorsStory(),
);
dashbook.storiesOf('Typography').add(
'default',
(_) => const TypographyStory(),
);
dashbook.storiesOf('Layouts').add(
'Responsive Layout',
(_) => const ResponsiveLayoutStory(),
);
dashbook.storiesOf('Layout Components').add(
'Bottom bar',
(_) => const BottomBarStory(),
);
dashbook.storiesOf('Buttons').add(
'Rounded Button',
(_) => const RoundedButtonStory(),
);
dashbook.storiesOf('Loaders').add(
'Fading Dots',
(_) => const FadingDotLoaderStory(),
);
dashbook.storiesOf('Shaders').add(
'Foil Shader',
(_) => const FoilShaderStory(),
);
dashbook.storiesOf('Flip Countdown').add(
'Flip Countdown',
(_) => const FlipCountdownStory(),
);
dashbook.storiesOf('Card Landing Puff').add(
'Card landing puff',
(_) => const CardLandingPuffStory(),
);
dashbook
.storiesOf('Elemental Damage Story')
.add(
'All elements',
(context) => const AllElementsStory(),
)
.add(
'Metal Damage Story',
(context) => const ElementalDamageStory(Element.metal),
)
.add(
'Earth Damage Story',
(context) => const ElementalDamageStory(Element.earth),
)
.add(
'Air Damage Story',
(context) => const ElementalDamageStory(Element.air),
)
.add(
'Fire Damage Story',
(context) => const ElementalDamageStory(Element.fire),
)
.add(
'Water Damage Story',
(context) => const ElementalDamageStory(Element.water),
);
dashbook
.storiesOf('Cards')
.add(
'Game Card Suits',
(_) => const GameCardSuitsStory(),
)
.add(
'Game Card',
(context) => GameCardStory(
name: context.textProperty('name', 'Dash, the Great'),
description: context.textProperty(
'description',
'Dash, the Great, is the most popular bird in all of the dashland, '
'mastering the development skills in all of the possible '
'platforms.',
),
isRare: context.boolProperty('isRare', false),
),
)
.add(
'Game Card Overlay',
(_) => const GameCardOverlayStory(),
)
.add(
'Flipped Game Card',
(_) => const FlippedGameCardStory(),
)
.add(
'Animated Card',
(ctx) {
ctx
..action('Small Flip', (_) => _controller.run(smallFlipAnimation))
..action('Big Flip', (_) => _controller.run(bigFlipAnimation))
..action('Jump', (_) => _controller.run(jumpAnimation))
..action(
'Player Knock Out',
(_) => _controller.run(playerKnockOutAnimation),
)
..action(
'Opponent Knock Out',
(_) => _controller.run(opponentKnockOutAnimation),
)
..action(
'Flip and Jump',
(_) => _controller
.run(smallFlipAnimation)
.then((_) => _controller.run(jumpAnimation)),
)
..action(
'Player Attack Forward',
(_) => _controller.run(playerAttackForwardAnimation),
)
..action(
'Player Attack Back',
(_) => _controller.run(playerAttackBackAnimation),
)
..action(
'Opponent Attack Forward',
(_) => _controller.run(opponentAttackForwardAnimation),
)
..action(
'Opponent Attack Back',
(_) => _controller.run(opponentAttackBackAnimation),
);
return AnimatedCardStory(controller: _controller);
},
).add(
'Simple flow',
(_) => const SimpleFlowStory(),
);
}
| io_flip/packages/io_flip_ui/gallery/lib/stories.dart/0 | {
"file_path": "io_flip/packages/io_flip_ui/gallery/lib/stories.dart",
"repo_id": "io_flip",
"token_count": 1976
} | 876 |
import 'package:flutter/material.dart';
import 'package:gallery/story_scaffold.dart';
import 'package:io_flip_ui/io_flip_ui.dart';
class RoundedButtonStory extends StatelessWidget {
const RoundedButtonStory({super.key});
@override
Widget build(BuildContext context) {
return StoryScaffold(
title: 'Rounded Button',
body: Padding(
padding: const EdgeInsets.all(IoFlipSpacing.lg),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: IoFlipSpacing.lg),
Wrap(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text('Icon button'),
RoundedButton.icon(
Icons.add_circle,
onPressed: () {},
),
],
),
const SizedBox(width: IoFlipSpacing.lg),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text('Icon button (disabled)'),
RoundedButton.icon(
Icons.add_circle,
),
],
),
],
),
const Divider(),
Wrap(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text('Text button'),
RoundedButton.text(
'Text Button',
onPressed: () {},
),
],
),
const SizedBox(width: IoFlipSpacing.lg),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text('Text Button (disabled)'),
RoundedButton.text(
'Text Button (disabled)',
),
],
),
],
),
const Divider(),
],
),
),
);
}
}
| io_flip/packages/io_flip_ui/gallery/lib/widgets/rounded_button_story.dart/0 | {
"file_path": "io_flip/packages/io_flip_ui/gallery/lib/widgets/rounded_button_story.dart",
"repo_id": "io_flip",
"token_count": 1377
} | 877 |
import 'dart:math' as math;
import 'package:flutter/animation.dart';
import 'package:flutter/rendering.dart';
import 'package:io_flip_ui/io_flip_ui.dart';
/// A simple flip animation.
final smallFlipAnimation = CardAnimation(
curve: Curves.easeOutExpo,
duration: const Duration(milliseconds: 800),
flipsCard: true,
animatable: TransformTween(
endRotateY: math.pi,
),
);
/// A flip that moves the card toward the viewer while it flips.
final bigFlipAnimation = CardAnimation(
curve: Curves.ease,
duration: const Duration(milliseconds: 800),
flipsCard: true,
animatable: TweenSequence<Matrix4>([
TweenSequenceItem(
tween: TransformTween(
endTranslateZ: -100,
),
weight: .2,
),
TweenSequenceItem(
tween: TransformTween(
endRotateY: 3 * math.pi / 4,
beginTranslateZ: -100,
endTranslateZ: -300,
),
weight: .6,
),
TweenSequenceItem(
tween: TransformTween(
beginRotateY: 3 * math.pi / 4,
endRotateY: math.pi,
beginTranslateZ: -300,
endTranslateZ: -200,
),
weight: .2,
),
TweenSequenceItem(
tween: TransformTween(
beginRotateY: math.pi,
endRotateY: math.pi,
beginTranslateZ: -200,
),
weight: .1,
),
]),
);
/// A jump and rotate animation.
final jumpAnimation = CardAnimation(
curve: Curves.slowMiddle,
duration: const Duration(milliseconds: 400),
animatable: ThereAndBackAgain(
TransformTween(
endTranslateZ: -300,
endRotateX: -math.pi / 20,
endRotateY: math.pi / 20,
endRotateZ: -math.pi / 20,
),
),
);
/// An animation that moves the card to the bottom right,
/// as if it had been knocked out.
final playerKnockOutAnimation = CardAnimation(
curve: Curves.easeOut,
duration: const Duration(seconds: 1),
animatable: TransformTween(
endTranslateX: 100,
endTranslateY: 100,
endTranslateZ: 100,
endRotateZ: math.pi / 12,
),
);
/// An animation that moves the card to the top left,
/// as if it had been knocked out.
final opponentKnockOutAnimation = CardAnimation(
curve: Curves.easeOut,
duration: const Duration(seconds: 1),
animatable: TransformTween(
endTranslateX: -100,
endTranslateY: -100,
endTranslateZ: 100,
endRotateZ: -math.pi / 12,
),
);
/// An animation that causes the card to strike to the bottom right.
final opponentAttackForwardAnimation = CardAnimation(
duration: const Duration(seconds: 1),
animatable: TweenSequence([
TweenSequenceItem(
tween: TransformTween(
endTranslateZ: -50,
),
weight: 0.1,
),
TweenSequenceItem(
tween: TransformTween(
beginTranslateZ: -50,
endTranslateZ: -100,
endRotateZ: -math.pi / 30,
).chain(CurveTween(curve: Curves.easeIn)),
weight: 0.4,
),
TweenSequenceItem(
tween: TransformTween(
beginTranslateZ: -100,
endTranslateZ: -100,
endTranslateX: 50,
endTranslateY: 50,
beginRotateZ: -math.pi / 30,
).chain(CurveTween(curve: Curves.easeInExpo)),
weight: 0.5,
),
]),
);
/// An animation that causes the card to strike to the bottom right.
final opponentAttackBackAnimation = CardAnimation(
duration: const Duration(seconds: 1),
animatable: TransformTween(
beginTranslateZ: -300,
endTranslateZ: -300,
beginTranslateX: 50,
beginTranslateY: 50,
beginRotateZ: math.pi / 30,
),
);
/// An animation that causes the card to strike to the top left.
final playerAttackForwardAnimation = CardAnimation(
duration: const Duration(seconds: 1),
animatable: TweenSequence([
TweenSequenceItem(
tween: TransformTween(
endTranslateZ: -50,
),
weight: 0.1,
),
TweenSequenceItem(
tween: TransformTween(
beginTranslateZ: -50,
endTranslateZ: -100,
endRotateZ: math.pi / 30,
).chain(CurveTween(curve: Curves.easeIn)),
weight: 0.4,
),
TweenSequenceItem(
tween: TransformTween(
beginTranslateZ: -100,
endTranslateZ: -100,
endTranslateX: -50,
endTranslateY: -50,
beginRotateZ: math.pi / 30,
).chain(CurveTween(curve: Curves.easeInExpo)),
weight: 0.5,
),
]),
);
/// An animation that causes the card to strike to the top left.
final playerAttackBackAnimation = CardAnimation(
duration: const Duration(seconds: 1),
animatable: TransformTween(
beginTranslateZ: -300,
endTranslateZ: -300,
beginTranslateX: -50,
beginTranslateY: -50,
beginRotateZ: -math.pi / 30,
),
);
| io_flip/packages/io_flip_ui/lib/src/animations/card_animations.dart/0 | {
"file_path": "io_flip/packages/io_flip_ui/lib/src/animations/card_animations.dart",
"repo_id": "io_flip",
"token_count": 1952
} | 878 |
import 'dart:ui';
import 'package:flutter/material.dart';
/// Colors used in the I/O FLIP UI.
abstract class IoFlipColors {
/// Gold
static const Color seedGold = Color(0xffffbb00);
/// Silver
static const Color seedSilver = Color(0xffdadce0);
/// Bronze
static const Color seedBronze = Color(0xffff5145);
/// seedLightBlue
static const Color seedLightBlue = Color(0xff54c5f8);
/// seedBlue
static const Color seedBlue = Color(0xff428eff);
/// seedRed
static const Color seedRed = Color(0xffff5145);
/// seedYellow
static const Color seedYellow = Color(0xffffbb00);
/// seedGreen
static const Color seedGreen = Color(0xff38a852);
/// seedBrown
static const Color seedBrown = Color(0xff94513d);
/// seedBlack
static const Color seedBlack = Color(0xff202124);
/// seedGrey30
static const Color seedGrey30 = Color(0xff5f6368);
/// seedGrey50
static const Color seedGrey50 = Color(0xff80868b);
/// seedGrey70
static const Color seedGrey70 = Color(0xffbdc1c6);
/// seedGrey80
static const Color seedGrey80 = Color(0xffdadce0);
/// seedGrey90
static const Color seedGrey90 = Color(0xffe8eaed);
/// seedWhite
static const Color seedWhite = Color(0xffffffff);
/// seedPatternTint
static const Color seedPatternTint = Color(0x08e8eaed);
/// seedScrim
static const Color seedScrim = Color(0xbf000000);
/// seedPaletteLightBlue0
static const Color seedPaletteLightBlue0 = Color(0xff000000);
/// seedPaletteLightBlue10
static const Color seedPaletteLightBlue10 = Color(0xff022535);
/// seedPaletteLightBlue20
static const Color seedPaletteLightBlue20 = Color(0xff044a6a);
/// seedPaletteLightBlue30
static const Color seedPaletteLightBlue30 = Color(0xff076f9f);
/// seedPaletteLightBlue40
static const Color seedPaletteLightBlue40 = Color(0xff0994d4);
/// seedPaletteLightBlue50
static const Color seedPaletteLightBlue50 = Color(0xff1fb2f6);
/// seedPaletteLightBlue60
static const Color seedPaletteLightBlue60 = Color(0xff54c5f8);
/// seedPaletteLightBlue70
static const Color seedPaletteLightBlue70 = Color(0xff7fd3fa);
/// seedPaletteLightBlue80
static const Color seedPaletteLightBlue80 = Color(0xffa9e1fb);
/// seedPaletteLightBlue90
static const Color seedPaletteLightBlue90 = Color(0xffd4f0fd);
/// seedPaletteLightBlue95
static const Color seedPaletteLightBlue95 = Color(0xffe7f7fe);
/// seedPaletteLightBlue99
static const Color seedPaletteLightBlue99 = Color(0xfff5fcff);
/// seedPaletteLightBlue100
static const Color seedPaletteLightBlue100 = Color(0xffffffff);
/// seedPaletteBlue0
static const Color seedPaletteBlue0 = Color(0xff000000);
/// seedPaletteBlue10
static const Color seedPaletteBlue10 = Color(0xff001536);
/// seedPaletteBlue20
static const Color seedPaletteBlue20 = Color(0xff002b6b);
/// seedPaletteBlue30
static const Color seedPaletteBlue30 = Color(0xff0040a1);
/// seedPaletteBlue40
static const Color seedPaletteBlue40 = Color(0xff0056d6);
/// seedPaletteBlue50
static const Color seedPaletteBlue50 = Color(0xff0d6eff);
/// seedPaletteBlue60
static const Color seedPaletteBlue60 = Color(0xff428eff);
/// seedPaletteBlue70
static const Color seedPaletteBlue70 = Color(0xff72aaff);
/// seedPaletteBlue80
static const Color seedPaletteBlue80 = Color(0xffa1c6ff);
/// seedPaletteBlue90
static const Color seedPaletteBlue90 = Color(0xffd0e3ff);
/// seedPaletteBlue95
static const Color seedPaletteBlue95 = Color(0xffe5f0ff);
/// seedPaletteBlue99
static const Color seedPaletteBlue99 = Color(0xfff5f9ff);
/// seedPaletteBlue100
static const Color seedPaletteBlue100 = Color(0xffffffff);
/// seedPaletteRed0
static const Color seedPaletteRed0 = Color(0xff000000);
/// seedPaletteRed10
static const Color seedPaletteRed10 = Color(0xff370400);
/// seedPaletteRed20
static const Color seedPaletteRed20 = Color(0xff6d0700);
/// seedPaletteRed30
static const Color seedPaletteRed30 = Color(0xffa30b00);
/// seedPaletteRed40
static const Color seedPaletteRed40 = Color(0xffda0f00);
/// seedPaletteRed50
static const Color seedPaletteRed50 = Color(0xffff2111);
/// seedPaletteRed60
static const Color seedPaletteRed60 = Color(0xffff5145);
/// seedPaletteRed70
static const Color seedPaletteRed70 = Color(0xffff7e75);
/// seedPaletteRed80
static const Color seedPaletteRed80 = Color(0xffffa9a3);
/// seedPaletteRed90
static const Color seedPaletteRed90 = Color(0xffffd4d1);
/// seedPaletteRed95
static const Color seedPaletteRed95 = Color(0xffffe7e5);
/// seedPaletteRed99
static const Color seedPaletteRed99 = Color(0xfffff5f5);
/// seedPaletteRed100
static const Color seedPaletteRed100 = Color(0xffffffff);
/// seedPaletteGreen0
static const Color seedPaletteGreen0 = Color(0xff000000);
/// seedPaletteGreen10
static const Color seedPaletteGreen10 = Color(0xff0f2e16);
/// seedPaletteGreen20
static const Color seedPaletteGreen20 = Color(0xff164120);
/// seedPaletteGreen30
static const Color seedPaletteGreen30 = Color(0xff236a34);
/// seedPaletteGreen40
static const Color seedPaletteGreen40 = Color(0xff38a852);
/// seedPaletteGreen50
static const Color seedPaletteGreen50 = Color(0xff4cc368);
/// seedPaletteGreen60
static const Color seedPaletteGreen60 = Color(0xff70cf87);
/// seedPaletteGreen70
static const Color seedPaletteGreen70 = Color(0xff94dba5);
/// seedPaletteGreen80
static const Color seedPaletteGreen80 = Color(0xffb7e7c3);
/// seedPaletteGreen90
static const Color seedPaletteGreen90 = Color(0xffdbf3e1);
/// seedPaletteGreen95
static const Color seedPaletteGreen95 = Color(0xffecf9ef);
/// seedPaletteGreen99
static const Color seedPaletteGreen99 = Color(0xfff7fcf9);
/// seedPaletteGreen100
static const Color seedPaletteGreen100 = Color(0xffffffff);
/// seedPaletteYellow0
static const Color seedPaletteYellow0 = Color(0xff000000);
/// seedPaletteYellow10
static const Color seedPaletteYellow10 = Color(0xff5c4300);
/// seedPaletteYellow20
static const Color seedPaletteYellow20 = Color(0xff8c6700);
/// seedPaletteYellow30
static const Color seedPaletteYellow30 = Color(0xffbd8a00);
/// seedPaletteYellow40
static const Color seedPaletteYellow40 = Color(0xffedae00);
/// seedPaletteYellow50
static const Color seedPaletteYellow50 = Color(0xffffbb00);
/// seedPaletteYellow60
static const Color seedPaletteYellow60 = Color(0xffffc933);
/// seedPaletteYellow70
static const Color seedPaletteYellow70 = Color(0xffffd666);
/// seedPaletteYellow80
static const Color seedPaletteYellow80 = Color(0xffffe499);
/// seedPaletteYellow90
static const Color seedPaletteYellow90 = Color(0xfffff1cc);
/// seedPaletteYellow95
static const Color seedPaletteYellow95 = Color(0xfffff8e5);
/// seedPaletteYellow99
static const Color seedPaletteYellow99 = Color(0xfffffcf5);
/// seedPaletteYellow100
static const Color seedPaletteYellow100 = Color(0xffffffff);
/// seedPaletteBrown0
static const Color seedPaletteBrown0 = Color(0xff000000);
/// seedPaletteBrown10
static const Color seedPaletteBrown10 = Color(0xff2a1711);
/// seedPaletteBrown20
static const Color seedPaletteBrown20 = Color(0xff3b2018);
/// seedPaletteBrown30
static const Color seedPaletteBrown30 = Color(0xff5f3427);
/// seedPaletteBrown40
static const Color seedPaletteBrown40 = Color(0xff94513d);
/// seedPaletteBrown50
static const Color seedPaletteBrown50 = Color(0xffb6654d);
/// seedPaletteBrown60
static const Color seedPaletteBrown60 = Color(0xffc58471);
/// seedPaletteBrown70
static const Color seedPaletteBrown70 = Color(0xffd3a394);
/// seedPaletteBrown80
static const Color seedPaletteBrown80 = Color(0xffe2c2b8);
/// seedPaletteBrown90
static const Color seedPaletteBrown90 = Color(0xfff1e0dc);
/// seedPaletteBrown95
static const Color seedPaletteBrown95 = Color(0xfff8efed);
/// seedPaletteBrown99
static const Color seedPaletteBrown99 = Color(0xfffcf9f8);
/// seedPaletteBrown100
static const Color seedPaletteBrown100 = Color(0xffffffff);
/// seedPaletteNeutral0
static const Color seedPaletteNeutral0 = Color(0xff000000);
/// seedPaletteNeutral10
static const Color seedPaletteNeutral10 = Color(0xff202124);
/// seedPaletteNeutral20
static const Color seedPaletteNeutral20 = Color(0xff494d51);
/// seedPaletteNeutral30
static const Color seedPaletteNeutral30 = Color(0xff5f6368);
/// seedPaletteNeutral40
static const Color seedPaletteNeutral40 = Color(0xff747980);
/// seedPaletteNeutral50
static const Color seedPaletteNeutral50 = Color(0xff80868b);
/// seedPaletteNeutral60
static const Color seedPaletteNeutral60 = Color(0xffa2a6aa);
/// seedPaletteNeutral70
static const Color seedPaletteNeutral70 = Color(0xffbdc1c6);
/// seedPaletteNeutral80
static const Color seedPaletteNeutral80 = Color(0xffd0d2d5);
/// seedPaletteNeutral90
static const Color seedPaletteNeutral90 = Color(0xffe8e9ea);
/// seedPaletteNeutral95
static const Color seedPaletteNeutral95 = Color(0xfff2f2f3);
/// seedPaletteNeutral99
static const Color seedPaletteNeutral99 = Color(0xfffafafa);
/// seedPaletteNeutral100
static const Color seedPaletteNeutral100 = Color(0xffffffff);
/// seedArchiveGrey99
static const Color seedArchiveGrey99 = Color(0xfffafafa);
/// seedArchiveGrey95
static const Color seedArchiveGrey95 = Color(0xfff2f2f3);
/// accessibleBlack
static const Color accessibleBlack = Color(0xff202124);
/// accessibleGrey
static const Color accessibleGrey = Color(0xff5f6368);
/// accessibleBrandLightBlue
static const Color accessibleBrandLightBlue = Color(0xff076f9f);
/// accessibleBrandBlue
static const Color accessibleBrandBlue = Color(0xff0056d6);
/// accessibleBrandRed
static const Color accessibleBrandRed = Color(0xffda0f00);
/// accessibleBrandYellow
static const Color accessibleBrandYellow = Color(0xff8c6700);
/// accessibleBrandGreen
static const Color accessibleBrandGreen = Color(0xff236a34);
}
| io_flip/packages/io_flip_ui/lib/src/theme/io_flip_colors.dart/0 | {
"file_path": "io_flip/packages/io_flip_ui/lib/src/theme/io_flip_colors.dart",
"repo_id": "io_flip",
"token_count": 3239
} | 879 |
import 'package:flutter/material.dart';
import 'package:io_flip_ui/io_flip_ui.dart';
/// {@template dual_animation_controller}
/// Controls the completion state of the front and back animations in a
/// [DualAnimation] widget.
///
/// Listens to the completion of front and back animations and triggers the
/// [onComplete] callback when both animations are finished.
/// {@endtemplate}
class DualAnimationController {
/// {@macro dual_animation_controller}
DualAnimationController(this.onComplete);
/// Called when both animations are completed
final VoidCallback? onComplete;
bool _frontAnimationCompleted = false;
bool _backAnimationCompleted = false;
void _checkCompletion() {
if (_frontAnimationCompleted && _backAnimationCompleted) {
onComplete?.call();
// Reset the completion status to avoid calling onComplete multiple times.
_frontAnimationCompleted = false;
_backAnimationCompleted = false;
}
}
/// Marks the front animation as completed and checks
/// if both animations are finished.
///
/// If both animations are finished, the [onComplete] callback will be called.
void frontAnimationCompleted() {
_frontAnimationCompleted = true;
_checkCompletion();
}
/// Marks the back animation as completed and checks
/// if both animations are finished.
///
/// If both animations are finished, the [onComplete] callback will be called
void backAnimationCompleted() {
_backAnimationCompleted = true;
_checkCompletion();
}
}
/// {@template elemental_damage_animation}
// ignore: comment_references
/// A widget that renders two [SpriteAnimation] one over the other
/// {@endtemplate}
class DualAnimation extends StatefulWidget {
/// {@macro elemental_damage_animation}
DualAnimation({
required this.back,
required this.front,
required VoidCallback onComplete,
required this.assetSize,
required this.cardSize,
required this.cardOffset,
super.key,
}) : controller = DualAnimationController(onComplete);
/// Represents the widget containing the animation in the back
final Widget Function(VoidCallback? onComplete, AssetSize assetSize) back;
/// Represents the widget containing the animation in the front
final Widget Function(VoidCallback? onComplete, AssetSize assetSize) front;
/// Controller that check the completion of the animations
final DualAnimationController controller;
/// Size of the assets to use, large or small
final AssetSize assetSize;
/// Size of the cards
final GameCardSize cardSize;
/// Offset of the card within this widget
final Offset cardOffset;
@override
State<DualAnimation> createState() => _DualAnimationState();
}
class _DualAnimationState extends State<DualAnimation> {
@override
Widget build(BuildContext context) {
return Stack(
children: [
ClipPath(
clipper: ReverseRRectClipper(
RRect.fromRectAndRadius(
widget.cardOffset & widget.cardSize.size,
Radius.circular(widget.cardSize.width * 0.085),
),
),
child: widget.back.call(
widget.controller.backAnimationCompleted,
widget.assetSize,
),
),
widget.front.call(
widget.controller.frontAnimationCompleted,
widget.assetSize,
),
],
);
}
}
/// {@template reverse_rrect_clip}
/// Clips to the opposite of the given [RRect].
/// {@endtemplate}
@visibleForTesting
class ReverseRRectClipper extends CustomClipper<Path> {
/// {@macro reverse_rrect_clip}
const ReverseRRectClipper(this.roundedRect);
/// The rounded rect that should be cutout.
final RRect roundedRect;
@override
Path getClip(Size size) {
return Path()
..fillType = PathFillType.evenOdd
..addRect(Offset.zero & size)
..addRRect(roundedRect);
}
@override
bool shouldReclip(covariant ReverseRRectClipper oldClipper) {
return oldClipper.roundedRect != roundedRect;
}
}
| io_flip/packages/io_flip_ui/lib/src/widgets/damages/dual_animation.dart/0 | {
"file_path": "io_flip/packages/io_flip_ui/lib/src/widgets/damages/dual_animation.dart",
"repo_id": "io_flip",
"token_count": 1280
} | 880 |
import 'package:flutter/widgets.dart';
import 'package:io_flip_ui/gen/assets.gen.dart';
/// {@template suit_icon}
/// IO Flip suit icon.
/// {@endtemplate}
class SuitIcon extends StatelessWidget {
/// [SuitIcon] for the air element.
SuitIcon.air({
super.key,
this.scale = 1,
}) : asset = Assets.images.suits.onboarding.air;
/// [SuitIcon] for the earth element.
SuitIcon.earth({
super.key,
this.scale = 1,
}) : asset = Assets.images.suits.onboarding.earth;
/// [SuitIcon] for the fire element.
SuitIcon.fire({
super.key,
this.scale = 1,
}) : asset = Assets.images.suits.onboarding.fire;
/// [SuitIcon] for the metal element.
SuitIcon.metal({
super.key,
this.scale = 1,
}) : asset = Assets.images.suits.onboarding.metal;
/// [SuitIcon] for the water element.
SuitIcon.water({
super.key,
this.scale = 1,
}) : asset = Assets.images.suits.onboarding.water;
/// Image icon for the element.
final SvgGenImage asset;
/// Scale factor to resize the image.
final double scale;
// Original size of the image.
static const _size = 96;
/// Rendered size of the image
double get size => scale * _size;
@override
Widget build(BuildContext context) {
return asset.svg(
height: size,
width: size,
);
}
}
| io_flip/packages/io_flip_ui/lib/src/widgets/suit_icons.dart/0 | {
"file_path": "io_flip/packages/io_flip_ui/lib/src/widgets/suit_icons.dart",
"repo_id": "io_flip",
"token_count": 471
} | 881 |
import 'package:flame/cache.dart';
import 'package:flame/widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:io_flip_ui/io_flip_ui.dart';
import 'package:mocktail/mocktail.dart';
import 'package:provider/provider.dart';
class _MockImages extends Mock implements Images {}
void main() {
group('ChargeFront', () {
late Images images;
setUp(() {
images = _MockImages();
});
testWidgets('renders SpriteAnimationWidget', (tester) async {
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: Provider.value(
value: images,
child: const ChargeFront(
'',
size: GameCardSize.md(),
assetSize: AssetSize.large,
animationColor: Colors.white,
),
),
),
);
expect(find.byType(SpriteAnimationWidget), findsOneWidget);
});
});
}
| io_flip/packages/io_flip_ui/test/src/widgets/damages/charge_front_test.dart/0 | {
"file_path": "io_flip/packages/io_flip_ui/test/src/widgets/damages/charge_front_test.dart",
"repo_id": "io_flip",
"token_count": 440
} | 882 |
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:io_flip_ui/io_flip_ui.dart';
extension _IoFlipWidgetTester on WidgetTester {
void setDisplaySize(Size size) {
view
..physicalSize = size
..devicePixelRatio = 1.0;
addTearDown(() {
view
..resetPhysicalSize()
..resetDevicePixelRatio();
});
}
}
void main() {
group('ResponsiveLayout', () {
testWidgets('displays a large layout', (tester) async {
tester.setDisplaySize(const Size(IoFlipBreakpoints.medium, 800));
const smallKey = Key('__small__');
const largeKey = Key('__large__');
await tester.pumpWidget(
ResponsiveLayoutBuilder(
small: (_, __) => const SizedBox(key: smallKey),
large: (_, __) => const SizedBox(key: largeKey),
),
);
expect(find.byKey(largeKey), findsOneWidget);
expect(find.byKey(smallKey), findsNothing);
});
testWidgets('displays a small layout', (tester) async {
tester.setDisplaySize(const Size(IoFlipBreakpoints.medium, 1200));
const smallKey = Key('__small__');
const largeKey = Key('__large__');
await tester.pumpWidget(
ResponsiveLayoutBuilder(
small: (_, __) => const SizedBox(key: smallKey),
large: (_, __) => const SizedBox(key: largeKey),
),
);
expect(find.byKey(largeKey), findsNothing);
expect(find.byKey(smallKey), findsOneWidget);
});
testWidgets('displays child when available (large)', (tester) async {
const smallKey = Key('__small__');
const largeKey = Key('__large__');
const childKey = Key('__child__');
await tester.pumpWidget(
ResponsiveLayoutBuilder(
small: (_, child) => SizedBox(key: smallKey, child: child),
large: (_, child) => SizedBox(key: largeKey, child: child),
child: const SizedBox(key: childKey),
),
);
expect(find.byKey(largeKey), findsNothing);
expect(find.byKey(smallKey), findsOneWidget);
expect(find.byKey(childKey), findsOneWidget);
});
testWidgets('displays child when available (small)', (tester) async {
tester.setDisplaySize(const Size(IoFlipBreakpoints.medium, 800));
const smallKey = Key('__small__');
const largeKey = Key('__large__');
const childKey = Key('__child__');
await tester.pumpWidget(
ResponsiveLayoutBuilder(
small: (_, child) => SizedBox(key: smallKey, child: child),
large: (_, child) => SizedBox(key: largeKey, child: child),
child: const SizedBox(key: childKey),
),
);
expect(find.byKey(largeKey), findsOneWidget);
expect(find.byKey(smallKey), findsNothing);
expect(find.byKey(childKey), findsOneWidget);
addTearDown(tester.view.resetPhysicalSize);
});
});
}
| io_flip/packages/io_flip_ui/test/src/widgets/responsive_layout_test.dart/0 | {
"file_path": "io_flip/packages/io_flip_ui/test/src/widgets/responsive_layout_test.dart",
"repo_id": "io_flip",
"token_count": 1204
} | 883 |
// ignore_for_file: subtype_of_sealed_class, prefer_const_constructors
import 'dart:async';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:game_domain/game_domain.dart';
import 'package:match_maker_repository/match_maker_repository.dart';
import 'package:mocktail/mocktail.dart';
class _MockFirebaseFirestore extends Mock implements FirebaseFirestore {
Transaction? mockTransaction;
@override
Future<T> runTransaction<T>(
TransactionHandler<T> transactionHandler, {
Duration timeout = const Duration(seconds: 30),
int maxAttempts = 5,
}) async {
if (mockTransaction == null) {
throw Exception('No mock transaction set');
}
final value = await transactionHandler(mockTransaction!);
mockTransaction = null;
return value;
}
}
class _MockCollectionReference<T> extends Mock
implements CollectionReference<T> {}
class _MockDocumentSnapshot<T> extends Mock implements DocumentSnapshot<T> {}
class _MockQuerySnapshot<T> extends Mock implements QuerySnapshot<T> {}
class _MockQueryDocumentSnapshot<T> extends Mock
implements QueryDocumentSnapshot<T> {}
class _MockDocumentReference<T> extends Mock implements DocumentReference<T> {}
class _MockTransaction extends Mock implements Transaction {}
void main() {
group('MatchMakerRepository', () {
late _MockFirebaseFirestore db;
late CollectionReference<Map<String, dynamic>> collection;
late CollectionReference<Map<String, dynamic>> matchStateCollection;
late CollectionReference<Map<String, dynamic>> scoreCardsCollection;
late MatchMakerRepository matchMakerRepository;
setUpAll(() {
registerFallbackValue(Timestamp(0, 0));
});
setUp(() {
db = _MockFirebaseFirestore();
collection = _MockCollectionReference();
matchStateCollection = _MockCollectionReference();
scoreCardsCollection = _MockCollectionReference();
when(() => db.collection('matches')).thenReturn(collection);
when(() => db.collection('score_cards')).thenReturn(scoreCardsCollection);
when(() => db.collection('match_states'))
.thenReturn(matchStateCollection);
matchMakerRepository = MatchMakerRepository(
db: db,
retryDelay: 0,
inviteCode: () => 'inviteCode',
);
});
void mockQueryResult({List<DraftMatch> matches = const []}) {
when(() => collection.where('guest', isEqualTo: 'EMPTY'))
.thenReturn(collection);
when(
() => collection.where(
'hostConnected',
isEqualTo: true,
),
).thenReturn(collection);
when(() => collection.limit(3)).thenReturn(collection);
final query = _MockQuerySnapshot<Map<String, dynamic>>();
final docs = <QueryDocumentSnapshot<Map<String, dynamic>>>[];
for (final match in matches) {
final doc = _MockQueryDocumentSnapshot<Map<String, dynamic>>();
when(() => doc.id).thenReturn(match.id);
when(doc.data).thenReturn({
'host': match.host,
'guest': match.guest == null ? 'EMPTY' : '',
});
docs.add(doc);
}
when(() => query.docs).thenReturn(docs);
when(collection.get).thenAnswer((_) async => query);
}
void mockInviteQueryResult(
String inviteCode, {
List<DraftMatch> matches = const [],
}) {
when(() => collection.where('guest', isEqualTo: 'INVITE'))
.thenReturn(collection);
when(
() => collection.where(
'inviteCode',
isEqualTo: inviteCode,
),
).thenReturn(collection);
when(() => collection.limit(3)).thenReturn(collection);
final query = _MockQuerySnapshot<Map<String, dynamic>>();
final docs = <QueryDocumentSnapshot<Map<String, dynamic>>>[];
for (final match in matches) {
final doc = _MockQueryDocumentSnapshot<Map<String, dynamic>>();
when(() => doc.id).thenReturn(match.id);
when(doc.data).thenReturn({
'host': match.host,
'guest': match.guest == null ? 'INVITE' : '',
'inviteCode': match.inviteCode,
});
docs.add(doc);
}
when(() => query.docs).thenReturn(docs);
when(collection.get).thenAnswer((_) async => query);
}
void mockAdd(
String host,
String guest,
String id, {
String? inviteCode,
}) {
when(
() => collection.add(
{
'host': host,
'guest': guest,
if (inviteCode != null) 'inviteCode': inviteCode,
},
),
).thenAnswer(
(_) async {
final docRef = _MockDocumentReference<Map<String, dynamic>>();
when(() => docRef.id).thenReturn(id);
return docRef;
},
);
}
void mockAddState(
String matchId,
List<String> hostPlayedCards,
List<String> guestPlayedCards,
) {
when(
() => matchStateCollection.add(
{
'matchId': matchId,
'hostPlayedCards': hostPlayedCards,
'guestPlayedCards': guestPlayedCards,
},
),
).thenAnswer(
(_) async {
final docRef = _MockDocumentReference<Map<String, dynamic>>();
when(() => docRef.id).thenReturn('state_of_$matchId');
return docRef;
},
);
}
void mockSuccessfulTransaction(
String guestId,
String matchId,
) {
final docRef = _MockDocumentReference<Map<String, dynamic>>();
when(() => collection.doc(matchId)).thenReturn(docRef);
final transaction = _MockTransaction();
when(
() => transaction.update(
docRef,
{'guest': guestId},
),
).thenReturn(transaction);
final document = _MockDocumentSnapshot<Map<String, dynamic>>();
when(document.data).thenReturn(<String, dynamic>{
'host': 'host',
'guest': 'EMPTY',
});
when(() => transaction.get(docRef)).thenAnswer((_) async => document);
db.mockTransaction = transaction;
}
void mockRaceConditionErrorTransaction(
String guestId,
String matchId,
) {
final docRef = _MockDocumentReference<Map<String, dynamic>>();
when(() => collection.doc(matchId)).thenReturn(docRef);
final transaction = _MockTransaction();
when(
() => transaction.update(
docRef,
{'guest': guestId},
),
).thenReturn(transaction);
final document = _MockDocumentSnapshot<Map<String, dynamic>>();
when(document.data).thenReturn(<String, dynamic>{
'host': 'host',
'guest': 'some_other_id',
});
when(() => transaction.get(docRef)).thenAnswer((_) async => document);
db.mockTransaction = transaction;
}
void mockSnapshots(
String matchId,
Stream<DocumentSnapshot<Map<String, dynamic>>> stream,
) {
final docRef = _MockDocumentReference<Map<String, dynamic>>();
when(() => collection.doc(matchId)).thenReturn(docRef);
when(docRef.snapshots).thenAnswer((_) => stream);
}
void mockMatchStateSnapshots(
String matchStateId,
Stream<DocumentSnapshot<Map<String, dynamic>>> stream,
) {
final docRef = _MockDocumentReference<Map<String, dynamic>>();
when(() => matchStateCollection.doc(matchStateId)).thenReturn(docRef);
when(docRef.snapshots).thenAnswer((_) => stream);
}
test('can be instantiated', () {
expect(
MatchMakerRepository(db: db),
isNotNull,
);
});
test('can generate an invite code', () {
expect(
MatchMakerRepository.defaultInviteCodeGenerator(),
isA<String>(),
);
});
test('returns a new match as host when there are no matches', () async {
mockQueryResult();
mockAdd('hostId', 'EMPTY', 'matchId');
mockAddState('matchId', const [], const []);
final match = await matchMakerRepository.findMatch('hostId');
expect(
match,
equals(
DraftMatch(
id: 'matchId',
host: 'hostId',
),
),
);
verify(
() => matchStateCollection.add(
{
'matchId': 'matchId',
'hostPlayedCards': const <String>[],
'guestPlayedCards': const <String>[],
},
),
).called(1);
});
test('returns a new match with CPU when forced CPU is true', () async {
mockQueryResult();
mockAdd('hostId', 'RESERVED_EMPTY', 'matchId');
mockAddState('matchId', const [], const []);
final match = await matchMakerRepository.findMatch(
'hostId',
forcedCpu: true,
);
expect(
match,
equals(
DraftMatch(
id: 'matchId',
host: 'hostId',
),
),
);
verify(
() => matchStateCollection.add(
{
'matchId': 'matchId',
'hostPlayedCards': const <String>[],
'guestPlayedCards': const <String>[],
},
),
).called(1);
});
test('creates a new match as host when creating a private match', () async {
mockQueryResult();
mockAdd('hostId', 'INVITE', 'matchId', inviteCode: 'inviteCode');
mockAddState('matchId', const [], const []);
final match = await matchMakerRepository.createPrivateMatch('hostId');
expect(
match,
equals(
DraftMatch(
id: 'matchId',
host: 'hostId',
inviteCode: 'inviteCode',
),
),
);
verify(
() => matchStateCollection.add(
{
'matchId': 'matchId',
'hostPlayedCards': const <String>[],
'guestPlayedCards': const <String>[],
},
),
).called(1);
});
test('joins a private match', () async {
mockInviteQueryResult(
'inviteCode',
matches: [
DraftMatch(
id: 'matchId',
host: 'hostId',
inviteCode: 'inviteCode',
),
],
);
mockSuccessfulTransaction('guestId', 'matchId');
final match = await matchMakerRepository.joinPrivateMatch(
inviteCode: 'inviteCode',
guestId: 'guestId',
);
expect(
match,
equals(
DraftMatch(
id: 'matchId',
host: 'hostId',
guest: 'guestId',
inviteCode: 'inviteCode',
),
),
);
});
test(
'joins a match when one is available and no concurrence error happens',
() async {
mockQueryResult(
matches: [
DraftMatch(
id: 'match123',
host: 'host123',
),
],
);
mockSuccessfulTransaction('guest123', 'match123');
final match = await matchMakerRepository.findMatch('guest123');
expect(
match,
equals(
DraftMatch(
id: 'match123',
host: 'host123',
guest: 'guest123',
),
),
);
},
);
test(
'creates a new match when a race condition happens',
() async {
mockQueryResult(
matches: [
DraftMatch(
id: 'match123',
host: 'host123',
),
],
);
mockRaceConditionErrorTransaction('guest123', 'match123');
mockAdd('guest123', emptyKey, 'matchId');
mockAddState('matchId', const [], const []);
final match = await matchMakerRepository.findMatch('guest123');
expect(
match,
equals(
DraftMatch(
id: 'matchId',
host: 'guest123',
),
),
);
verify(
() => matchStateCollection.add(
{
'matchId': 'matchId',
'hostPlayedCards': const <String>[],
'guestPlayedCards': const <String>[],
},
),
).called(1);
},
);
test(
'returns a new match as host when when max retry reaches its maximum',
() async {
mockQueryResult(
matches: [
DraftMatch(
id: 'match123',
host: 'host123',
),
],
);
mockAdd('hostId', emptyKey, 'matchId');
mockAddState('matchId', const [], const []);
// The mock default behavior is to fail the transaction. So no need
// manually mock a failed transaction.
final match = await matchMakerRepository.findMatch('hostId');
expect(
match,
equals(
DraftMatch(
id: 'matchId',
host: 'hostId',
),
),
);
verify(
() => matchStateCollection.add(
{
'matchId': 'matchId',
'hostPlayedCards': const <String>[],
'guestPlayedCards': const <String>[],
},
),
).called(1);
},
);
test('can watch a match', () async {
final streamController =
StreamController<DocumentSnapshot<Map<String, dynamic>>>();
mockSnapshots('123', streamController.stream);
final values = <DraftMatch>[];
final subscription =
matchMakerRepository.watchMatch('123').listen(values.add);
final snapshot = _MockQueryDocumentSnapshot<Map<String, dynamic>>();
when(() => snapshot.id).thenReturn('123');
when(snapshot.data).thenReturn({
'host': 'host1',
'guest': 'guest1',
'hostConnected': true,
'guestConnected': true,
});
streamController.add(snapshot);
await Future.microtask(() {});
expect(
values,
equals([
DraftMatch(
id: '123',
host: 'host1',
guest: 'guest1',
hostConnected: true,
guestConnected: true,
)
]),
);
await subscription.cancel();
});
test('correctly maps a match when the spot is vacant', () async {
final streamController =
StreamController<DocumentSnapshot<Map<String, dynamic>>>();
mockSnapshots('123', streamController.stream);
final values = <DraftMatch>[];
final subscription =
matchMakerRepository.watchMatch('123').listen(values.add);
final snapshot = _MockQueryDocumentSnapshot<Map<String, dynamic>>();
when(() => snapshot.id).thenReturn('123');
when(snapshot.data).thenReturn({
'host': 'host1',
'guest': 'EMPTY',
});
streamController.add(snapshot);
await Future.microtask(() {});
expect(
values,
equals([
DraftMatch(
id: '123',
host: 'host1',
)
]),
);
await subscription.cancel();
});
test('can watch match states', () async {
final streamController =
StreamController<DocumentSnapshot<Map<String, dynamic>>>();
mockMatchStateSnapshots('123', streamController.stream);
final values = <MatchState>[];
final subscription =
matchMakerRepository.watchMatchState('123').listen(values.add);
final snapshot = _MockQueryDocumentSnapshot<Map<String, dynamic>>();
when(() => snapshot.id).thenReturn('123');
when(snapshot.data).thenReturn({
'matchId': '1234',
'guestPlayedCards': ['321'],
'hostPlayedCards': ['322'],
'result': 'host',
});
streamController.add(snapshot);
await Future.microtask(() {});
expect(
values,
equals([
MatchState(
id: '123',
matchId: '1234',
guestPlayedCards: const ['321'],
hostPlayedCards: const ['322'],
result: MatchResult.host,
)
]),
);
await subscription.cancel();
});
test('can get a ScoreCard', () async {
final ref = _MockDocumentReference<Map<String, dynamic>>();
final doc = _MockDocumentSnapshot<Map<String, dynamic>>();
when(() => scoreCardsCollection.doc('id')).thenReturn(ref);
when(ref.get).thenAnswer((invocation) async => doc);
when(() => doc.exists).thenReturn(true);
when(doc.data).thenReturn({
'wins': 1,
'currentStreak': 1,
'longestStreak': 1,
});
final result = await matchMakerRepository.getScoreCard('id');
expect(
result,
ScoreCard(
id: 'id',
wins: 1,
currentStreak: 1,
longestStreak: 1,
),
);
});
test('can watch a ScoreCard', () async {
final streamController =
StreamController<DocumentSnapshot<Map<String, dynamic>>>();
final snapshot = _MockDocumentSnapshot<Map<String, dynamic>>();
final ref = _MockDocumentReference<Map<String, dynamic>>();
when(() => scoreCardsCollection.doc(any())).thenReturn(ref);
when(ref.snapshots).thenAnswer((_) => streamController.stream);
when(() => snapshot.id).thenReturn('123');
when(snapshot.data).thenReturn({
'wins': 1,
'currentStreak': 1,
'longestStreak': 1,
});
final values = <ScoreCard>[];
final subscription =
matchMakerRepository.watchScoreCard('123').listen(values.add);
streamController.add(snapshot);
await Future.microtask(() {});
expect(
values,
equals([
ScoreCard(
id: '123',
wins: 1,
currentStreak: 1,
longestStreak: 1,
)
]),
);
await subscription.cancel();
});
test('creates a ScoreCard when one does not exist', () async {
final ref = _MockDocumentReference<Map<String, dynamic>>();
final doc = _MockDocumentSnapshot<Map<String, dynamic>>();
when(() => scoreCardsCollection.doc('id')).thenReturn(ref);
when(ref.get).thenAnswer((_) async => doc);
when(() => doc.exists).thenReturn(false);
when(doc.data).thenReturn(null);
when(() => ref.set(any())).thenAnswer((_) async {});
final result = await matchMakerRepository.getScoreCard('id');
verify(
() => ref.set({
'wins': 0,
'currentStreak': 0,
'longestStreak': 0,
}),
).called(1);
expect(
result,
ScoreCard(
id: 'id',
),
);
});
});
}
| io_flip/packages/match_maker_repository/test/src/match_maker_repository_test.dart/0 | {
"file_path": "io_flip/packages/match_maker_repository/test/src/match_maker_repository_test.dart",
"repo_id": "io_flip",
"token_count": 8464
} | 884 |
// ignore_for_file: prefer_const_constructors
import 'package:flutter_test/flutter_test.dart';
import 'package:game_domain/game_domain.dart';
import 'package:io_flip/connection/connection.dart';
void main() {
group('ConnectionEvent', () {
group('ConnectionRequested', () {
test('uses value equality', () {
expect(
ConnectionRequested(),
equals(ConnectionRequested()),
);
});
});
group('ConnectionClosed', () {
test('uses value equality', () {
expect(
ConnectionClosed(),
equals(ConnectionClosed()),
);
});
});
group('WebSocketMessageReceived', () {
test('uses value equality', () {
final a = WebSocketMessageReceived(WebSocketMessage.connected());
final b = WebSocketMessageReceived(WebSocketMessage.connected());
final c = WebSocketMessageReceived(
WebSocketMessage.error(
WebSocketErrorCode.playerAlreadyConnected,
),
);
expect(a, equals(b));
expect(a, isNot(equals(c)));
});
});
});
}
| io_flip/test/connection/bloc/connection_event_test.dart/0 | {
"file_path": "io_flip/test/connection/bloc/connection_event_test.dart",
"repo_id": "io_flip",
"token_count": 460
} | 885 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.