text
stringlengths
6
13.6M
id
stringlengths
13
176
metadata
dict
__index_level_0__
int64
0
1.69k
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="FileEditorManager"> <leaf> <file leaf-file-name="main.dart" pinned="false" current-in-tab="true"> <entry file="file://$PROJECT_DIR$/lib/main.dart"> <provider selected="true" editor-type-id="text-editor"> <state relative-caret-position="0"> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> </state> </provider> </entry> </file> </leaf> </component> <component name="ToolWindowManager"> <editor active="true" /> <layout> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> </layout> </component> <component name="ProjectView"> <navigator currentView="ProjectPane" proportions="" version="1"> </navigator> <panes> <pane id="ProjectPane"> <option name="show-excluded-files" value="false" /> </pane> </panes> </component> <component name="PropertiesComponent"> <property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="dart.analysis.tool.window.force.activate" value="true" /> <property name="show.migrate.to.gradle.popup" value="false" /> </component> </project>
flutter/packages/flutter_tools/templates/module/common/.idea/workspace.xml.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/module/common/.idea/workspace.xml.tmpl", "repo_id": "flutter", "token_count": 604 }
839
#include "Flutter.xcconfig" #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
flutter/packages/flutter_tools/templates/module/ios/host_app_ephemeral_cocoapods/Config.tmpl/Release.xcconfig/0
{ "file_path": "flutter/packages/flutter_tools/templates/module/ios/host_app_ephemeral_cocoapods/Config.tmpl/Release.xcconfig", "repo_id": "flutter", "token_count": 41 }
840
<?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="jdk" jdkName="Android API {{androidSdkVersion}} Platform" jdkType="Android SDK" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="library" name="Dart Packages" level="project" /> <orderEntry type="library" name="Dart SDK" level="project" /> <orderEntry type="library" name="Flutter Plugins" level="project" /> </component> </module>
flutter/packages/flutter_tools/templates/package/projectName.iml.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/package/projectName.iml.tmpl", "repo_id": "flutter", "token_count": 350 }
841
import 'package:test/test.dart'; import 'package:{{projectName}}/{{projectName}}.dart'; void main() { test('invoke native function', () { // Tests are run in debug mode. expect(sum(24, 18), 1042); }); test('invoke async native callback', () async { expect(await sumAsync(24, 18), 42); }); }
flutter/packages/flutter_tools/templates/package_ffi/test/projectName_test.dart.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/package_ffi/test/projectName_test.dart.tmpl", "repo_id": "flutter", "token_count": 111 }
842
import Flutter import UIKit public class {{pluginClass}}: NSObject, FlutterPlugin { public static func register(with registrar: FlutterPluginRegistrar) { let channel = FlutterMethodChannel(name: "{{projectName}}", binaryMessenger: registrar.messenger()) let instance = {{pluginClass}}() registrar.addMethodCallDelegate(instance, channel: channel) } public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { switch call.method { case "getPlatformVersion": result("iOS " + UIDevice.current.systemVersion) default: result(FlutterMethodNotImplemented) } } }
flutter/packages/flutter_tools/templates/plugin/ios-swift.tmpl/Classes/pluginClass.swift.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/plugin/ios-swift.tmpl/Classes/pluginClass.swift.tmpl", "repo_id": "flutter", "token_count": 201 }
843
# The Flutter tooling requires that developers have a version of Visual Studio # installed that includes CMake 3.14 or later. You should not increase this # version, as doing so will cause the plugin to fail to compile for some # customers of the plugin. cmake_minimum_required(VERSION 3.14) # Project-level configuration. set(PROJECT_NAME "{{projectName}}") project(${PROJECT_NAME} LANGUAGES CXX) # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. cmake_policy(VERSION 3.14...3.25) # This value is used when generating builds using this plugin, so it must # not be changed set(PLUGIN_NAME "{{projectName}}_plugin") # Any new source files that you add to the plugin should be added here. list(APPEND PLUGIN_SOURCES "{{pluginClassSnakeCase}}.cpp" "{{pluginClassSnakeCase}}.h" ) # Define the plugin library target. Its name must not be changed (see comment # on PLUGIN_NAME above). add_library(${PLUGIN_NAME} SHARED "include/{{projectName}}/{{pluginClassSnakeCase}}_c_api.h" "{{pluginClassSnakeCase}}_c_api.cpp" ${PLUGIN_SOURCES} ) # Apply a standard set of build settings that are configured in the # application-level CMakeLists.txt. This can be removed for plugins that want # full control over build settings. apply_standard_settings(${PLUGIN_NAME}) # Symbols are hidden by default to reduce the chance of accidental conflicts # between plugins. This should not be removed; any symbols that should be # exported should be explicitly exported with the FLUTTER_PLUGIN_EXPORT macro. set_target_properties(${PLUGIN_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden) target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) # Source include directories and library dependencies. Add any plugin-specific # dependencies here. target_include_directories(${PLUGIN_NAME} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin) # List of absolute paths to libraries that should be bundled with the plugin. # This list could contain prebuilt libraries, or libraries created by an # external build triggered from this build file. set({{projectName}}_bundled_libraries "" PARENT_SCOPE ) # === Tests === # These unit tests can be run from a terminal after building the example, or # from Visual Studio after opening the generated solution file. # Only enable test builds when building the example (which sets this variable) # so that plugin clients aren't building the tests. if (${include_${PROJECT_NAME}_tests}) set(TEST_RUNNER "${PROJECT_NAME}_test") enable_testing() # Add the Google Test dependency. include(FetchContent) FetchContent_Declare( googletest URL https://github.com/google/googletest/archive/release-1.11.0.zip ) # Prevent overriding the parent project's compiler/linker settings set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) # Disable install commands for gtest so it doesn't end up in the bundle. set(INSTALL_GTEST OFF CACHE BOOL "Disable installation of googletest" FORCE) FetchContent_MakeAvailable(googletest) # The plugin's C API is not very useful for unit testing, so build the sources # directly into the test binary rather than using the DLL. add_executable(${TEST_RUNNER} test/{{pluginClassSnakeCase}}_test.cpp ${PLUGIN_SOURCES} ) apply_standard_settings(${TEST_RUNNER}) target_include_directories(${TEST_RUNNER} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_link_libraries(${TEST_RUNNER} PRIVATE flutter_wrapper_plugin) target_link_libraries(${TEST_RUNNER} PRIVATE gtest_main gmock) # flutter_wrapper_plugin has link dependencies on the Flutter DLL. add_custom_command(TARGET ${TEST_RUNNER} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${FLUTTER_LIBRARY}" $<TARGET_FILE_DIR:${TEST_RUNNER}> ) # Enable automatic test discovery. include(GoogleTest) gtest_discover_tests(${TEST_RUNNER}) endif()
flutter/packages/flutter_tools/templates/plugin/windows.tmpl/CMakeLists.txt.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/plugin/windows.tmpl/CMakeLists.txt.tmpl", "repo_id": "flutter", "token_count": 1215 }
844
# The Flutter tooling requires that developers have CMake 3.10 or later # installed. You should not increase this version, as doing so will cause # the plugin to fail to compile for some customers of the plugin. cmake_minimum_required(VERSION 3.10) project({{projectName}}_library VERSION 0.0.1 LANGUAGES C) add_library({{projectName}} SHARED "{{projectName}}.c" ) set_target_properties({{projectName}} PROPERTIES PUBLIC_HEADER {{projectName}}.h OUTPUT_NAME "{{projectName}}" ) target_compile_definitions({{projectName}} PUBLIC DART_SHARED_LIB)
flutter/packages/flutter_tools/templates/plugin_ffi/src.tmpl/CMakeLists.txt.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/plugin_ffi/src.tmpl/CMakeLists.txt.tmpl", "repo_id": "flutter", "token_count": 175 }
845
# {{projectName}} {{description}} ## Getting Started This project is a starting point for a Flutter application that follows the [simple app state management tutorial](https://flutter.dev/docs/development/data-and-backend/state-mgmt/simple). For help getting started with Flutter development, view the [online documentation](https://flutter.dev/docs), which offers tutorials, samples, guidance on mobile development, and a full API reference. ## Assets The `assets` directory houses images, fonts, and any other files you want to include with your application. The `assets/images` directory contains [resolution-aware images](https://flutter.dev/docs/development/ui/assets-and-images#resolution-aware). ## Localization This project generates localized messages based on arb files found in the `lib/src/localization` directory. To support additional languages, please visit the tutorial on [Internationalizing Flutter apps](https://flutter.dev/docs/development/accessibility-and-localization/internationalization)
flutter/packages/flutter_tools/templates/skeleton/README.md.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/skeleton/README.md.tmpl", "repo_id": "flutter", "token_count": 256 }
846
// This is an example unit test. // // A unit test tests a single function, method, or class. To learn more about // writing unit tests, visit // https://flutter.dev/docs/cookbook/testing/unit/introduction import 'package:flutter_test/flutter_test.dart'; void main() { group('Plus Operator', () { test('should add two numbers together', () { expect(1 + 1, 2); }); }); }
flutter/packages/flutter_tools/templates/skeleton/test/unit_test.dart.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/skeleton/test/unit_test.dart.tmpl", "repo_id": "flutter", "token_count": 129 }
847
// 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/artifacts.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/terminal.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/commands/analyze.dart'; import 'package:flutter_tools/src/dart/analysis.dart'; import 'package:flutter_tools/src/dart/pub.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/project.dart'; import 'package:flutter_tools/src/project_validator.dart'; import 'package:process/process.dart'; import '../../src/common.dart'; import '../../src/context.dart'; import '../../src/fake_process_manager.dart'; import '../../src/fakes.dart'; import '../../src/test_flutter_command_runner.dart'; void main() { setUpAll(() { Cache.flutterRoot = getFlutterRoot(); }); late Directory tempDir; late FileSystem fileSystem; late Platform platform; late ProcessManager processManager; late AnsiTerminal terminal; late Logger logger; late FakeStdio mockStdio; setUp(() { fileSystem = globals.localFileSystem; platform = const LocalPlatform(); processManager = const LocalProcessManager(); terminal = AnsiTerminal(platform: platform, stdio: Stdio()); logger = BufferLogger(outputPreferences: OutputPreferences.test(), terminal: terminal); tempDir = fileSystem.systemTempDirectory.createTempSync('flutter_analysis_test.'); mockStdio = FakeStdio(); }); tearDown(() { tryToDelete(tempDir); }); void createSampleProject(Directory directory, { bool brokenCode = false }) { final File pubspecFile = fileSystem.file(fileSystem.path.join(directory.path, 'pubspec.yaml')); pubspecFile.writeAsStringSync(''' name: foo_project environment: sdk: '>=3.2.0-0 <4.0.0' '''); final File dartFile = fileSystem.file(fileSystem.path.join(directory.path, 'lib', 'main.dart')); dartFile.parent.createSync(); dartFile.writeAsStringSync(''' void main() { print('hello world'); ${brokenCode ? 'prints("hello world");' : ''} } '''); } group('analyze --watch', () { testUsingContext('AnalysisServer success', () async { createSampleProject(tempDir); final Pub pub = Pub.test( fileSystem: fileSystem, logger: logger, processManager: processManager, platform: const LocalPlatform(), botDetector: globals.botDetector, usage: globals.flutterUsage, stdio: mockStdio, ); await pub.get( context: PubContext.flutterTests, project: FlutterProject.fromDirectoryTest(tempDir), ); final AnalysisServer server = AnalysisServer( globals.artifacts!.getArtifactPath(Artifact.engineDartSdkPath), <String>[tempDir.path], fileSystem: fileSystem, platform: platform, processManager: processManager, logger: logger, terminal: terminal, suppressAnalytics: true, ); int errorCount = 0; final Future<bool> onDone = server.onAnalyzing.where((bool analyzing) => !analyzing).first; server.onErrors.listen((FileAnalysisErrors errors) => errorCount += errors.errors.length); await server.start(); await onDone; expect(errorCount, 0); await server.dispose(); }); }); testUsingContext('AnalysisServer errors', () async { createSampleProject(tempDir, brokenCode: true); final Pub pub = Pub.test( fileSystem: fileSystem, logger: logger, processManager: processManager, platform: const LocalPlatform(), usage: globals.flutterUsage, botDetector: globals.botDetector, stdio: mockStdio, ); await pub.get( context: PubContext.flutterTests, project: FlutterProject.fromDirectoryTest(tempDir), ); final AnalysisServer server = AnalysisServer( globals.artifacts!.getArtifactPath(Artifact.engineDartSdkPath), <String>[tempDir.path], fileSystem: fileSystem, platform: platform, processManager: processManager, logger: logger, terminal: terminal, suppressAnalytics: true, ); int errorCount = 0; final Future<bool> onDone = server.onAnalyzing.where((bool analyzing) => !analyzing).first; server.onErrors.listen((FileAnalysisErrors errors) { errorCount += errors.errors.length; }); await server.start(); await onDone; expect(errorCount, greaterThan(0)); await server.dispose(); }); testUsingContext('Returns no errors when source is error-free', () async { const String contents = "StringBuffer bar = StringBuffer('baz');"; tempDir.childFile('main.dart').writeAsStringSync(contents); final AnalysisServer server = AnalysisServer( globals.artifacts!.getArtifactPath(Artifact.engineDartSdkPath), <String>[tempDir.path], fileSystem: fileSystem, platform: platform, processManager: processManager, logger: logger, terminal: terminal, suppressAnalytics: true, ); int errorCount = 0; final Future<bool> onDone = server.onAnalyzing.where((bool analyzing) => !analyzing).first; server.onErrors.listen((FileAnalysisErrors errors) { errorCount += errors.errors.length; }); await server.start(); await onDone; expect(errorCount, 0); await server.dispose(); }); testUsingContext('Can run AnalysisService without suppressing analytics', () async { final StreamController<List<int>> stdin = StreamController<List<int>>(); final FakeProcessManager processManager = FakeProcessManager.list( <FakeCommand>[ FakeCommand( command: const <String>[ 'Artifact.engineDartSdkPath/bin/dart', '--disable-dart-dev', 'Artifact.engineDartSdkPath/bin/snapshots/analysis_server.dart.snapshot', '--disable-server-feature-completion', '--disable-server-feature-search', '--sdk', 'Artifact.engineDartSdkPath', ], stdin: IOSink(stdin.sink), ), ]); final Artifacts artifacts = Artifacts.test(); final AnalyzeCommand command = AnalyzeCommand( terminal: Terminal.test(), artifacts: artifacts, logger: BufferLogger.test(), platform: FakePlatform(), fileSystem: MemoryFileSystem.test(), processManager: processManager, allProjectValidators: <ProjectValidator>[], suppressAnalytics: false, ); final TestFlutterCommandRunner commandRunner = TestFlutterCommandRunner(); commandRunner.addCommand(command); unawaited(commandRunner.run(<String>['analyze', '--watch'])); await stdin.stream.first; expect(processManager, hasNoRemainingExpectations); }); testUsingContext('Can run AnalysisService with customized cache location', () async { final StreamController<List<int>> stdin = StreamController<List<int>>(); final FakeProcessManager processManager = FakeProcessManager.list( <FakeCommand>[ FakeCommand( command: const <String>[ 'Artifact.engineDartSdkPath/bin/dart', '--disable-dart-dev', 'Artifact.engineDartSdkPath/bin/snapshots/analysis_server.dart.snapshot', '--disable-server-feature-completion', '--disable-server-feature-search', '--sdk', 'Artifact.engineDartSdkPath', '--suppress-analytics', ], stdin: IOSink(stdin.sink), ), ]); final Artifacts artifacts = Artifacts.test(); final AnalyzeCommand command = AnalyzeCommand( terminal: Terminal.test(), artifacts: artifacts, logger: BufferLogger.test(), platform: FakePlatform(), fileSystem: MemoryFileSystem.test(), processManager: processManager, allProjectValidators: <ProjectValidator>[], suppressAnalytics: true, ); final TestFlutterCommandRunner commandRunner = TestFlutterCommandRunner(); commandRunner.addCommand(command); unawaited(commandRunner.run(<String>['analyze', '--watch'])); await stdin.stream.first; expect(processManager, hasNoRemainingExpectations); }); testUsingContext('Can run AnalysisService with customized cache location --watch', () async { final MemoryFileSystem fileSystem = MemoryFileSystem.test(); fileSystem.directory('directoryA').childFile('foo').createSync(recursive: true); final BufferLogger logger = BufferLogger.test(); final Completer<void> completer = Completer<void>(); final StreamController<List<int>> stdin = StreamController<List<int>>(); final FakeProcessManager processManager = FakeProcessManager.list( <FakeCommand>[ FakeCommand( command: const <String>[ 'Artifact.engineDartSdkPath/bin/dart', '--disable-dart-dev', 'Artifact.engineDartSdkPath/bin/snapshots/analysis_server.dart.snapshot', '--disable-server-feature-completion', '--disable-server-feature-search', '--sdk', 'Artifact.engineDartSdkPath', '--suppress-analytics', ], stdin: IOSink(stdin.sink), stdout: ''' {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}} {"event":"analysis.errors","params":{"file":"/directoryA/foo","errors":[{"type":"TestError","message":"It's an error.","severity":"warning","code":"500","location":{"file":"/directoryA/foo","startLine": 100,"startColumn":5,"offset":0}}]}} {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}} ''' ), ]); final Artifacts artifacts = Artifacts.test(); final AnalyzeCommand command = AnalyzeCommand( terminal: Terminal.test(), artifacts: artifacts, logger: logger, platform: FakePlatform(), fileSystem: fileSystem, processManager: processManager, allProjectValidators: <ProjectValidator>[], suppressAnalytics: true, ); await FakeAsync().run((FakeAsync time) async { final TestFlutterCommandRunner commandRunner = TestFlutterCommandRunner(); commandRunner.addCommand(command); unawaited(commandRunner.run(<String>['analyze', '--watch'])); while (!logger.statusText.contains('analyzed 1 file')) { time.flushMicrotasks(); } completer.complete(); return completer.future; }); expect(logger.statusText, contains("warning • It's an error • directoryA/foo:100:5 • 500")); expect(logger.statusText, contains('1 issue found. (1 new)')); expect(logger.errorText, isEmpty); expect(processManager, hasNoRemainingExpectations); }); testUsingContext('AnalysisService --watch skips errors from non-files', () async { final BufferLogger logger = BufferLogger.test(); final Completer<void> completer = Completer<void>(); final StreamController<List<int>> stdin = StreamController<List<int>>(); final FakeProcessManager processManager = FakeProcessManager.list( <FakeCommand>[ FakeCommand( command: const <String>[ 'Artifact.engineDartSdkPath/bin/dart', '--disable-dart-dev', 'Artifact.engineDartSdkPath/bin/snapshots/analysis_server.dart.snapshot', '--disable-server-feature-completion', '--disable-server-feature-search', '--sdk', 'Artifact.engineDartSdkPath', '--suppress-analytics', ], stdin: IOSink(stdin.sink), stdout: ''' {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}} {"event":"analysis.errors","params":{"file":"/directoryA/bar","errors":[{"type":"TestError","message":"It's an error.","severity":"warning","code":"500","location":{"file":"/directoryA/bar","startLine":100,"startColumn":5,"offset":0}}]}} {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}} ''' ), ]); final Artifacts artifacts = Artifacts.test(); final AnalyzeCommand command = AnalyzeCommand( terminal: Terminal.test(), artifacts: artifacts, logger: logger, platform: FakePlatform(), fileSystem: MemoryFileSystem.test(), processManager: processManager, allProjectValidators: <ProjectValidator>[], suppressAnalytics: true, ); await FakeAsync().run((FakeAsync time) async { final TestFlutterCommandRunner commandRunner = TestFlutterCommandRunner(); commandRunner.addCommand(command); unawaited(commandRunner.run(<String>['analyze', '--watch'])); while (!logger.statusText.contains('analyzed 1 file')) { time.flushMicrotasks(); } completer.complete(); return completer.future; }); expect(logger.statusText, contains('No issues found!')); expect(logger.errorText, isEmpty); expect(processManager, hasNoRemainingExpectations); }); }
flutter/packages/flutter_tools/test/commands.shard/hermetic/analyze_continuously_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/commands.shard/hermetic/analyze_continuously_test.dart", "repo_id": "flutter", "token_count": 5020 }
848
// 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:args/command_runner.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/android/android_sdk.dart'; import 'package:flutter_tools/src/android/android_studio.dart'; import 'package:flutter_tools/src/android/java.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/build_info.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/commands/config.dart'; import 'package:flutter_tools/src/features.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:test/fake.dart'; import 'package:unified_analytics/unified_analytics.dart'; import '../../src/common.dart'; import '../../src/context.dart'; import '../../src/fakes.dart' as fakes; import '../../src/test_flutter_command_runner.dart'; void main() { late Java fakeJava; late FakeAndroidStudio fakeAndroidStudio; late FakeAndroidSdk fakeAndroidSdk; late FakeFlutterVersion fakeFlutterVersion; late TestUsage testUsage; late FakeAnalytics fakeAnalytics; setUpAll(() { Cache.disableLocking(); }); setUp(() { fakeJava = fakes.FakeJava(); fakeAndroidStudio = FakeAndroidStudio(); fakeAndroidSdk = FakeAndroidSdk(); fakeFlutterVersion = FakeFlutterVersion(); testUsage = TestUsage(); fakeAnalytics = getInitializedFakeAnalyticsInstance( fs: MemoryFileSystem.test(), fakeFlutterVersion: fakes.FakeFlutterVersion(), ); }); void verifyNoAnalytics() { expect(testUsage.commands, isEmpty); expect(testUsage.events, isEmpty); expect(testUsage.timings, isEmpty); expect(fakeAnalytics.sentEvents, isEmpty); } group('config', () { testUsingContext('prints all settings with --list', () async { final ConfigCommand configCommand = ConfigCommand(); final CommandRunner<void> commandRunner = createTestCommandRunner(configCommand); await commandRunner.run(<String>['config', '--list']); expect( testLogger.statusText, 'All Settings:\n' '${allFeatures .where((Feature e) => e.configSetting != null) .map((Feature e) => ' ${e.configSetting}: (Not set)') .join('\n')}' '\n\n', ); }, overrides: <Type, Generator>{ Usage: () => testUsage, }); testUsingContext('throws error on excess arguments', () { final ConfigCommand configCommand = ConfigCommand(); final CommandRunner<void> commandRunner = createTestCommandRunner(configCommand); expect(() => commandRunner.run(<String>[ 'config', '--android-studio-dir=/opt/My', 'Android', 'Studio', ]), throwsToolExit()); verifyNoAnalytics(); }, overrides: <Type, Generator>{ Usage: () => testUsage, }); testUsingContext('machine flag', () async { final ConfigCommand command = ConfigCommand(); await command.handleMachine(); expect(testLogger.statusText, isNotEmpty); final dynamic jsonObject = json.decode(testLogger.statusText); expect(jsonObject, const TypeMatcher<Map<String, dynamic>>()); if (jsonObject is Map<String, dynamic>) { expect(jsonObject['android-studio-dir'], fakeAndroidStudio.directory); expect(jsonObject['android-sdk'], fakeAndroidSdk.directory.path); expect(jsonObject['jdk-dir'], fakeJava.javaHome); } verifyNoAnalytics(); }, overrides: <Type, Generator>{ AndroidStudio: () => fakeAndroidStudio, AndroidSdk: () => fakeAndroidSdk, Java: () => fakeJava, Usage: () => testUsage, }); testUsingContext('Can set build-dir', () async { final ConfigCommand configCommand = ConfigCommand(); final CommandRunner<void> commandRunner = createTestCommandRunner(configCommand); await commandRunner.run(<String>[ 'config', '--build-dir=foo', ]); expect(getBuildDirectory(), 'foo'); verifyNoAnalytics(); }, overrides: <Type, Generator>{ Usage: () => testUsage, }); testUsingContext('throws error on absolute path to build-dir', () async { final ConfigCommand configCommand = ConfigCommand(); final CommandRunner<void> commandRunner = createTestCommandRunner(configCommand); expect(() => commandRunner.run(<String>[ 'config', '--build-dir=/foo', ]), throwsToolExit()); verifyNoAnalytics(); }, overrides: <Type, Generator>{ Usage: () => testUsage, }); testUsingContext('allows setting and removing feature flags', () async { final ConfigCommand configCommand = ConfigCommand(); final CommandRunner<void> commandRunner = createTestCommandRunner(configCommand); await commandRunner.run(<String>[ 'config', '--enable-android', '--enable-ios', '--enable-web', '--enable-linux-desktop', '--enable-windows-desktop', '--enable-macos-desktop', ]); expect(globals.config.getValue('enable-android'), true); expect(globals.config.getValue('enable-ios'), true); expect(globals.config.getValue('enable-web'), true); expect(globals.config.getValue('enable-linux-desktop'), true); expect(globals.config.getValue('enable-windows-desktop'), true); expect(globals.config.getValue('enable-macos-desktop'), true); await commandRunner.run(<String>[ 'config', '--clear-features', ]); expect(globals.config.getValue('enable-android'), null); expect(globals.config.getValue('enable-ios'), null); expect(globals.config.getValue('enable-web'), null); expect(globals.config.getValue('enable-linux-desktop'), null); expect(globals.config.getValue('enable-windows-desktop'), null); expect(globals.config.getValue('enable-macos-desktop'), null); await commandRunner.run(<String>[ 'config', '--no-enable-android', '--no-enable-ios', '--no-enable-web', '--no-enable-linux-desktop', '--no-enable-windows-desktop', '--no-enable-macos-desktop', ]); expect(globals.config.getValue('enable-android'), false); expect(globals.config.getValue('enable-ios'), false); expect(globals.config.getValue('enable-web'), false); expect(globals.config.getValue('enable-linux-desktop'), false); expect(globals.config.getValue('enable-windows-desktop'), false); expect(globals.config.getValue('enable-macos-desktop'), false); verifyNoAnalytics(); }, overrides: <Type, Generator>{ AndroidStudio: () => fakeAndroidStudio, AndroidSdk: () => fakeAndroidSdk, Usage: () => testUsage, }); testUsingContext('warns the user to reload IDE', () async { final ConfigCommand configCommand = ConfigCommand(); final CommandRunner<void> commandRunner = createTestCommandRunner(configCommand); await commandRunner.run(<String>[ 'config', '--enable-web', ]); expect( testLogger.statusText, containsIgnoringWhitespace('You may need to restart any open editors'), ); }, overrides: <Type, Generator>{ Usage: () => testUsage, }); testUsingContext('displays which config settings are available on stable', () async { fakeFlutterVersion.channel = 'stable'; final ConfigCommand configCommand = ConfigCommand(); final CommandRunner<void> commandRunner = createTestCommandRunner(configCommand); await commandRunner.run(<String>[ 'config', '--enable-web', '--enable-linux-desktop', '--enable-windows-desktop', '--enable-macos-desktop', ]); await commandRunner.run(<String>[ 'config', '--list' ]); expect( testLogger.statusText, containsIgnoringWhitespace('enable-web: true'), ); expect( testLogger.statusText, containsIgnoringWhitespace('enable-linux-desktop: true'), ); expect( testLogger.statusText, containsIgnoringWhitespace('enable-windows-desktop: true'), ); expect( testLogger.statusText, containsIgnoringWhitespace('enable-macos-desktop: true'), ); verifyNoAnalytics(); }, overrides: <Type, Generator>{ AndroidStudio: () => fakeAndroidStudio, AndroidSdk: () => fakeAndroidSdk, FlutterVersion: () => fakeFlutterVersion, Usage: () => testUsage, }); testUsingContext('no-analytics flag flips usage flag and sends event', () async { final ConfigCommand configCommand = ConfigCommand(); final CommandRunner<void> commandRunner = createTestCommandRunner(configCommand); expect(testUsage.enabled, true); await commandRunner.run(<String>[ 'config', '--no-analytics', ]); expect(testUsage.enabled, false); // Verify that we flushed the analytics queue. expect(testUsage.ensureAnalyticsSentCalls, 1); // Verify that we only send the analytics disable event, and no other // info. expect(testUsage.events, equals(<TestUsageEvent>[ const TestUsageEvent('analytics', 'enabled', label: 'false'), ])); expect(testUsage.commands, isEmpty); expect(testUsage.timings, isEmpty); expect(fakeAnalytics.sentEvents, isEmpty); }, overrides: <Type, Generator>{ Usage: () => testUsage, }); testUsingContext('analytics flag flips usage flag and sends event', () async { final ConfigCommand configCommand = ConfigCommand(); final CommandRunner<void> commandRunner = createTestCommandRunner(configCommand); await commandRunner.run(<String>[ 'config', '--analytics', ]); expect(testUsage.enabled, true); // Verify that we only send the analytics enable event, and no other // info. expect(testUsage.events, equals(<TestUsageEvent>[ const TestUsageEvent('analytics', 'enabled', label: 'true'), ])); expect(testUsage.commands, isEmpty); expect(testUsage.timings, isEmpty); expect(fakeAnalytics.sentEvents, isEmpty); }, overrides: <Type, Generator>{ Usage: () => testUsage, }); testUsingContext('analytics reported with help usages', () async { final ConfigCommand configCommand = ConfigCommand(); createTestCommandRunner(configCommand); testUsage.suppressAnalytics = true; expect( configCommand.usage, containsIgnoringWhitespace('Analytics reporting is currently disabled'), ); testUsage.suppressAnalytics = false; expect( configCommand.usage, containsIgnoringWhitespace('Analytics reporting is currently enabled'), ); }, overrides: <Type, Generator>{ Usage: () => testUsage, }); }); } class FakeAndroidStudio extends Fake implements AndroidStudio, Comparable<AndroidStudio> { @override String get directory => 'path/to/android/studio'; @override String? get javaPath => 'path/to/android/studio/jbr'; } class FakeAndroidSdk extends Fake implements AndroidSdk { @override Directory get directory => globals.fs.directory('path/to/android/sdk'); } class FakeFlutterVersion extends Fake implements FlutterVersion { @override late String channel; @override void ensureVersionFile() {} @override Future<void> checkFlutterVersionFreshness() async {} }
flutter/packages/flutter_tools/test/commands.shard/hermetic/config_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/commands.shard/hermetic/config_test.dart", "repo_id": "flutter", "token_count": 4320 }
849
// 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/android/java.dart'; import 'package:flutter_tools/src/application_package.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/commands/daemon.dart'; import 'package:flutter_tools/src/daemon.dart'; import 'package:flutter_tools/src/device.dart'; import 'package:flutter_tools/src/proxied_devices/devices.dart'; import 'package:flutter_tools/src/vmservice.dart'; import 'package:test/fake.dart'; import '../../src/common.dart'; import '../../src/context.dart'; import '../../src/fake_devices.dart'; import '../../src/fakes.dart'; void main() { Daemon? daemon; late NotifyingLogger notifyingLogger; late BufferLogger bufferLogger; late FakeAndroidDevice fakeDevice; late FakeApplicationPackageFactory applicationPackageFactory; late MemoryFileSystem memoryFileSystem; late FakeProcessManager fakeProcessManager; group('ProxiedDevices', () { late DaemonConnection serverDaemonConnection; late DaemonConnection clientDaemonConnection; setUp(() { bufferLogger = BufferLogger.test(); notifyingLogger = NotifyingLogger(verbose: false, parent: bufferLogger); final FakeDaemonStreams serverDaemonStreams = FakeDaemonStreams(); serverDaemonConnection = DaemonConnection( daemonStreams: serverDaemonStreams, logger: bufferLogger, ); final FakeDaemonStreams clientDaemonStreams = FakeDaemonStreams(); clientDaemonConnection = DaemonConnection( daemonStreams: clientDaemonStreams, logger: bufferLogger, ); serverDaemonStreams.inputs.addStream(clientDaemonStreams.outputs.stream); clientDaemonStreams.inputs.addStream(serverDaemonStreams.outputs.stream); applicationPackageFactory = FakeApplicationPackageFactory(); memoryFileSystem = MemoryFileSystem(); fakeProcessManager = FakeProcessManager.empty(); }); tearDown(() async { if (daemon != null) { return daemon!.shutdown(); } notifyingLogger.dispose(); await serverDaemonConnection.dispose(); await clientDaemonConnection.dispose(); }); testUsingContext('can list devices', () async { daemon = Daemon( serverDaemonConnection, notifyingLogger: notifyingLogger, ); fakeDevice = FakeAndroidDevice(); final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery(); daemon!.deviceDomain.addDeviceDiscoverer(discoverer); discoverer.addDevice(fakeDevice); final ProxiedDevices proxiedDevices = ProxiedDevices(clientDaemonConnection, logger: bufferLogger); final List<Device> devices = await proxiedDevices.discoverDevices(); expect(devices, hasLength(1)); final Device device = devices[0]; expect(device.id, fakeDevice.id); expect(device.name, 'Proxied ${fakeDevice.name}'); expect(await device.targetPlatform, await fakeDevice.targetPlatform); expect(await device.isLocalEmulator, await fakeDevice.isLocalEmulator); }); testUsingContext('calls supportsRuntimeMode', () async { daemon = Daemon( serverDaemonConnection, notifyingLogger: notifyingLogger, ); fakeDevice = FakeAndroidDevice(); final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery(); daemon!.deviceDomain.addDeviceDiscoverer(discoverer); discoverer.addDevice(fakeDevice); final ProxiedDevices proxiedDevices = ProxiedDevices(clientDaemonConnection, logger: bufferLogger); final List<Device> devices = await proxiedDevices.devices(); expect(devices, hasLength(1)); final Device device = devices[0]; final bool supportsRuntimeMode = await device.supportsRuntimeMode(BuildMode.release); expect(fakeDevice.supportsRuntimeModeCalledBuildMode, BuildMode.release); expect(supportsRuntimeMode, true); }, overrides: <Type, Generator>{ Java: () => FakeJava(), }); testUsingContext('redirects logs', () async { daemon = Daemon( serverDaemonConnection, notifyingLogger: notifyingLogger, ); fakeDevice = FakeAndroidDevice(); final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery(); daemon!.deviceDomain.addDeviceDiscoverer(discoverer); discoverer.addDevice(fakeDevice); final ProxiedDevices proxiedDevices = ProxiedDevices(clientDaemonConnection, logger: bufferLogger); final FakeDeviceLogReader fakeLogReader = FakeDeviceLogReader(); fakeDevice.logReader = fakeLogReader; final List<Device> devices = await proxiedDevices.devices(); expect(devices, hasLength(1)); final Device device = devices[0]; final DeviceLogReader logReader = await device.getLogReader(); fakeLogReader.logLinesController.add('Some log line'); final String receivedLogLine = await logReader.logLines.first; expect(receivedLogLine, 'Some log line'); // Now try to stop the log reader expect(fakeLogReader.disposeCalled, false); logReader.dispose(); await pumpEventQueue(); expect(fakeLogReader.disposeCalled, true); }); testUsingContext('starts and stops app', () async { daemon = Daemon( serverDaemonConnection, notifyingLogger: notifyingLogger, ); fakeDevice = FakeAndroidDevice(); final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery(); daemon!.deviceDomain.addDeviceDiscoverer(discoverer); discoverer.addDevice(fakeDevice); final ProxiedDevices proxiedDevices = ProxiedDevices(clientDaemonConnection, logger: bufferLogger); final FakePrebuiltApplicationPackage prebuiltApplicationPackage = FakePrebuiltApplicationPackage(); final File dummyApplicationBinary = memoryFileSystem.file('/directory/dummy_file'); dummyApplicationBinary.parent.createSync(); dummyApplicationBinary.writeAsStringSync('dummy content'); prebuiltApplicationPackage.applicationPackage = dummyApplicationBinary; final List<Device> devices = await proxiedDevices.devices(); expect(devices, hasLength(1)); final Device device = devices[0]; // Now try to start the app final FakeApplicationPackage applicationPackage = FakeApplicationPackage(); applicationPackageFactory.applicationPackage = applicationPackage; final Uri vmServiceUri = Uri.parse('http://127.0.0.1:12345/vmService'); fakeDevice.launchResult = LaunchResult.succeeded(vmServiceUri: vmServiceUri); final LaunchResult launchResult = await device.startApp( prebuiltApplicationPackage, debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), ); expect(launchResult.started, true); // The returned vmServiceUri was a forwarded port, so we cannot compare them directly. expect(launchResult.vmServiceUri!.path, vmServiceUri.path); expect(applicationPackageFactory.applicationBinaryRequested!.readAsStringSync(), 'dummy content'); expect(applicationPackageFactory.platformRequested, TargetPlatform.android_arm); expect(fakeDevice.startAppPackage, applicationPackage); // Now try to stop the app final bool stopAppResult = await device.stopApp(prebuiltApplicationPackage); expect(fakeDevice.stopAppPackage, applicationPackage); expect(stopAppResult, true); }, overrides: <Type, Generator>{ Java: () => FakeJava(), ApplicationPackageFactory: () => applicationPackageFactory, FileSystem: () => memoryFileSystem, ProcessManager: () => fakeProcessManager, }); testUsingContext('takes screenshot', () async { daemon = Daemon( serverDaemonConnection, notifyingLogger: notifyingLogger, ); fakeDevice = FakeAndroidDevice(); final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery(); daemon!.deviceDomain.addDeviceDiscoverer(discoverer); discoverer.addDevice(fakeDevice); final ProxiedDevices proxiedDevices = ProxiedDevices(clientDaemonConnection, logger: bufferLogger); final List<Device> devices = await proxiedDevices.devices(); expect(devices, hasLength(1)); final Device device = devices[0]; final List<int> screenshot = <int>[1,2,3,4,5]; fakeDevice.screenshot = screenshot; final File screenshotOutputFile = memoryFileSystem.file('screenshot_file'); await device.takeScreenshot(screenshotOutputFile); expect(await screenshotOutputFile.readAsBytes(), screenshot); }, overrides: <Type, Generator>{ Java: () => FakeJava(), FileSystem: () => memoryFileSystem, ProcessManager: () => fakeProcessManager, }); }); } class FakeDaemonStreams implements DaemonStreams { final StreamController<DaemonMessage> inputs = StreamController<DaemonMessage>(); final StreamController<DaemonMessage> outputs = StreamController<DaemonMessage>(); @override Stream<DaemonMessage> get inputStream { return inputs.stream; } @override void send(Map<String, dynamic> message, [ List<int>? binary ]) { outputs.add(DaemonMessage(message, binary != null ? Stream<List<int>>.value(binary) : null)); } @override Future<void> dispose() async { await inputs.close(); // In some tests, outputs have no listeners. We don't wait for outputs to close. unawaited(outputs.close()); } } class FakeAndroidDevice extends Fake implements AndroidDevice { @override final String id = 'device'; @override final String name = 'device'; @override Future<String> get emulatorId async => 'device'; @override Future<TargetPlatform> get targetPlatform async => TargetPlatform.android_arm; @override Future<bool> get isLocalEmulator async => false; @override final Category category = Category.mobile; @override final PlatformType platformType = PlatformType.android; @override final bool ephemeral = false; @override bool get isConnected => true; @override final DeviceConnectionInterface connectionInterface = DeviceConnectionInterface.attached; @override Future<String> get sdkNameAndVersion async => 'Android 12'; @override bool get supportsHotReload => true; @override bool get supportsHotRestart => true; @override bool get supportsScreenshot => true; @override bool get supportsFastStart => true; @override bool get supportsFlutterExit => true; @override Future<bool> get supportsHardwareRendering async => true; @override bool get supportsStartPaused => true; BuildMode? supportsRuntimeModeCalledBuildMode; @override Future<bool> supportsRuntimeMode(BuildMode buildMode) async { supportsRuntimeModeCalledBuildMode = buildMode; return true; } late DeviceLogReader logReader; @override FutureOr<DeviceLogReader> getLogReader({ ApplicationPackage? app, bool includePastLogs = false, }) => logReader; ApplicationPackage? startAppPackage; late LaunchResult launchResult; @override Future<LaunchResult> startApp( ApplicationPackage? package, { String? mainPath, String? route, DebuggingOptions? debuggingOptions, Map<String, Object?> platformArgs = const <String, Object>{}, bool prebuiltApplication = false, bool ipv6 = false, String? userIdentifier, }) async { startAppPackage = package; return launchResult; } ApplicationPackage? stopAppPackage; @override Future<bool> stopApp( ApplicationPackage? app, { String? userIdentifier, }) async { stopAppPackage = app; return true; } late List<int> screenshot; @override Future<void> takeScreenshot(File outputFile) { return outputFile.writeAsBytes(screenshot); } } class FakeDeviceLogReader implements DeviceLogReader { final StreamController<String> logLinesController = StreamController<String>(); bool disposeCalled = false; @override int? appPid; @override FlutterVmService? connectedVMService; @override void dispose() { disposeCalled = true; } @override Stream<String> get logLines => logLinesController.stream; @override String get name => 'device'; } class FakeApplicationPackageFactory implements ApplicationPackageFactory { TargetPlatform? platformRequested; File? applicationBinaryRequested; ApplicationPackage? applicationPackage; @override Future<ApplicationPackage?> getPackageForPlatform(TargetPlatform platform, {BuildInfo? buildInfo, File? applicationBinary}) async { platformRequested = platform; applicationBinaryRequested = applicationBinary; return applicationPackage; } } class FakeApplicationPackage extends Fake implements ApplicationPackage {} class FakePrebuiltApplicationPackage extends Fake implements PrebuiltApplicationPackage { @override late File applicationPackage; }
flutter/packages/flutter_tools/test/commands.shard/hermetic/proxied_devices_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/commands.shard/hermetic/proxied_devices_test.dart", "repo_id": "flutter", "token_count": 4299 }
850
// 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:args/command_runner.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/commands/devices.dart'; import 'package:flutter_tools/src/device.dart'; import 'package:flutter_tools/src/features.dart'; import 'package:flutter_tools/src/web/web_device.dart'; import 'package:test/fake.dart'; import '../../src/context.dart'; import '../../src/fakes.dart'; import '../../src/test_flutter_command_runner.dart'; void main() { late FakeDeviceManager deviceManager; late BufferLogger logger; setUpAll(() { Cache.disableLocking(); }); setUp(() { deviceManager = FakeDeviceManager(); logger = BufferLogger.test(); }); testUsingContext('devices can display no connected devices with the --machine flag', () async { final DevicesCommand command = DevicesCommand(); final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['devices', '--machine']); expect( json.decode(logger.statusText), isEmpty, ); }, overrides: <Type, Generator>{ FeatureFlags: () => TestFeatureFlags(), Logger: () => logger, }); testUsingContext('devices can display via the --machine flag', () async { deviceManager.devices = <Device>[ WebServerDevice(logger: logger), ]; final DevicesCommand command = DevicesCommand(); final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['devices', '--machine']); expect( json.decode(logger.statusText), contains(equals( <String, Object>{ 'name': 'Web Server', 'id': 'web-server', 'isSupported': true, 'targetPlatform': 'web-javascript', 'emulator': false, 'sdk': 'Flutter Tools', 'capabilities': <String, Object>{ 'hotReload': true, 'hotRestart': true, 'screenshot': false, 'fastStart': false, 'flutterExit': false, 'hardwareRendering': false, 'startPaused': true, }, }, )), ); }, overrides: <Type, Generator>{ FeatureFlags: () => TestFeatureFlags(isWebEnabled: true), DeviceManager: () => deviceManager, Logger: () => logger, }); } class FakeDeviceManager extends Fake implements DeviceManager { List<Device> devices = <Device>[]; @override String? specifiedDeviceId; @override Future<List<Device>> getAllDevices({ DeviceDiscoveryFilter? filter, }) async { return devices; } @override Future<List<Device>> refreshAllDevices({ Duration? timeout, DeviceDiscoveryFilter? filter, }) async { return devices; } }
flutter/packages/flutter_tools/test/commands.shard/permeable/devices_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/commands.shard/permeable/devices_test.dart", "repo_id": "flutter", "token_count": 1094 }
851
// 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_device.dart'; import 'package:flutter_tools/src/android/android_sdk.dart'; import 'package:flutter_tools/src/android/application_package.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:test/fake.dart'; import '../../src/common.dart'; import '../../src/fake_process_manager.dart'; const FakeCommand kAdbVersionCommand = FakeCommand( command: <String>['adb', 'version'], stdout: 'Android Debug Bridge version 1.0.39', ); const FakeCommand kAdbStartServerCommand = FakeCommand( command: <String>['adb', 'start-server'] ); const FakeCommand kInstallCommand = FakeCommand( command: <String>[ 'adb', '-s', '1234', 'install', '-t', '-r', '--user', '10', 'app-debug.apk', ], ); const FakeCommand kStoreShaCommand = FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'echo', '-n', '', '>', '/data/local/tmp/sky.app.sha1'] ); void main() { late FileSystem fileSystem; late BufferLogger logger; setUp(() { fileSystem = MemoryFileSystem.test(); logger = BufferLogger.test(); }); AndroidDevice setUpAndroidDevice({ AndroidSdk? androidSdk, ProcessManager? processManager, }) { androidSdk ??= FakeAndroidSdk(); return AndroidDevice('1234', modelID: 'TestModel', logger: logger, platform: FakePlatform(), androidSdk: androidSdk, fileSystem: fileSystem, processManager: processManager ?? FakeProcessManager.any(), ); } testWithoutContext('Cannot install app on API level below 16', () async { final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ kAdbVersionCommand, kAdbStartServerCommand, const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'getprop'], stdout: '[ro.build.version.sdk]: [11]', ), ]); final File apk = fileSystem.file('app-debug.apk')..createSync(); final AndroidApk androidApk = AndroidApk( applicationPackage: apk, id: 'app', versionCode: 22, launchActivity: 'Main', ); final AndroidDevice androidDevice = setUpAndroidDevice( processManager: processManager, ); expect(await androidDevice.installApp(androidApk), false); expect(processManager, hasNoRemainingExpectations); }); testWithoutContext('Cannot install app if APK file is missing', () async { final File apk = fileSystem.file('app-debug.apk'); final AndroidApk androidApk = AndroidApk( applicationPackage: apk, id: 'app', versionCode: 22, launchActivity: 'Main', ); final AndroidDevice androidDevice = setUpAndroidDevice( ); expect(await androidDevice.installApp(androidApk), false); }); testWithoutContext('Can install app on API level 16 or greater', () async { final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ kAdbVersionCommand, kAdbStartServerCommand, const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'getprop'], stdout: '[ro.build.version.sdk]: [16]', ), const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'pm', 'list', 'packages', '--user', '10', 'app'], stdout: '\n' ), kInstallCommand, kStoreShaCommand, ]); final File apk = fileSystem.file('app-debug.apk')..createSync(); final AndroidApk androidApk = AndroidApk( applicationPackage: apk, id: 'app', versionCode: 22, launchActivity: 'Main', ); final AndroidDevice androidDevice = setUpAndroidDevice( processManager: processManager, ); expect(await androidDevice.installApp(androidApk, userIdentifier: '10'), true); expect(processManager, hasNoRemainingExpectations); }); testWithoutContext('Defaults to API level 16 if adb returns a null response', () async { final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ kAdbVersionCommand, kAdbStartServerCommand, const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'getprop'], ), const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'pm', 'list', 'packages', '--user', '10', 'app'], stdout: '\n' ), kInstallCommand, kStoreShaCommand, ]); final File apk = fileSystem.file('app-debug.apk')..createSync(); final AndroidApk androidApk = AndroidApk( applicationPackage: apk, id: 'app', versionCode: 22, launchActivity: 'Main', ); final AndroidDevice androidDevice = setUpAndroidDevice( processManager: processManager, ); expect(await androidDevice.installApp(androidApk, userIdentifier: '10'), true); expect(processManager, hasNoRemainingExpectations); }); testWithoutContext('displays error if user not found', () async { final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ kAdbVersionCommand, kAdbStartServerCommand, const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'getprop'], ), // This command is run before the user is checked and is allowed to fail. const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'pm', 'list', 'packages', '--user', 'jane', 'app'], stderr: 'Blah blah', exitCode: 1, ), const FakeCommand( command: <String>[ 'adb', '-s', '1234', 'install', '-t', '-r', '--user', 'jane', 'app-debug.apk', ], exitCode: 1, stderr: 'Exception occurred while executing: java.lang.IllegalArgumentException: Bad user number: jane', ), ]); final File apk = fileSystem.file('app-debug.apk')..createSync(); final AndroidApk androidApk = AndroidApk( applicationPackage: apk, id: 'app', versionCode: 22, launchActivity: 'Main', ); final AndroidDevice androidDevice = setUpAndroidDevice( processManager: processManager, ); expect(await androidDevice.installApp(androidApk, userIdentifier: 'jane'), false); expect(logger.errorText, contains('Error: User "jane" not found. Run "adb shell pm list users" to see list of available identifiers.')); expect(processManager, hasNoRemainingExpectations); }); testWithoutContext('Will skip install if the correct version is up to date', () async { final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ kAdbVersionCommand, kAdbStartServerCommand, const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'getprop'], stdout: '[ro.build.version.sdk]: [16]', ), const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'pm', 'list', 'packages', '--user', '10', 'app'], stdout: 'package:app\n' ), const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'cat', '/data/local/tmp/sky.app.sha1'], stdout: 'example_sha', ), ]); final File apk = fileSystem.file('app-debug.apk')..createSync(); fileSystem.file('app-debug.apk.sha1').writeAsStringSync('example_sha'); final AndroidApk androidApk = AndroidApk( applicationPackage: apk, id: 'app', versionCode: 22, launchActivity: 'Main', ); final AndroidDevice androidDevice = setUpAndroidDevice( processManager: processManager, ); expect(await androidDevice.installApp(androidApk, userIdentifier: '10'), true); expect(processManager, hasNoRemainingExpectations); }); testWithoutContext('Will uninstall if the correct version is not up to date and install fails', () async { final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ kAdbVersionCommand, kAdbStartServerCommand, const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'getprop'], stdout: '[ro.build.version.sdk]: [16]', ), const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'pm', 'list', 'packages', '--user', '10', 'app'], stdout: 'package:app\n' ), const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'cat', '/data/local/tmp/sky.app.sha1'], stdout: 'different_example_sha', ), const FakeCommand( command: <String>['adb', '-s', '1234', 'install', '-t', '-r', '--user', '10', 'app-debug.apk'], exitCode: 1, stderr: '[INSTALL_FAILED_INSUFFICIENT_STORAGE]', ), const FakeCommand(command: <String>['adb', '-s', '1234', 'uninstall', '--user', '10', 'app']), kInstallCommand, const FakeCommand(command: <String>['adb', '-s', '1234', 'shell', 'echo', '-n', 'example_sha', '>', '/data/local/tmp/sky.app.sha1']), ]); final File apk = fileSystem.file('app-debug.apk')..createSync(); fileSystem.file('app-debug.apk.sha1').writeAsStringSync('example_sha'); final AndroidApk androidApk = AndroidApk( applicationPackage: apk, id: 'app', versionCode: 22, launchActivity: 'Main', ); final AndroidDevice androidDevice = setUpAndroidDevice( processManager: processManager, ); expect(await androidDevice.installApp(androidApk, userIdentifier: '10'), true); expect(processManager, hasNoRemainingExpectations); }); testWithoutContext('Will fail to install if the apk was never installed and it fails the first time', () async { final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ kAdbVersionCommand, kAdbStartServerCommand, const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'getprop'], stdout: '[ro.build.version.sdk]: [16]', ), const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'pm', 'list', 'packages', '--user', '10', 'app'], stdout: '\n' ), const FakeCommand( command: <String>['adb', '-s', '1234', 'install', '-t', '-r', '--user', '10', 'app-debug.apk'], exitCode: 1, stderr: '[INSTALL_FAILED_INSUFFICIENT_STORAGE]', ), ]); final File apk = fileSystem.file('app-debug.apk')..createSync(); final AndroidApk androidApk = AndroidApk( applicationPackage: apk, id: 'app', versionCode: 22, launchActivity: 'Main', ); final AndroidDevice androidDevice = setUpAndroidDevice( processManager: processManager, ); expect(await androidDevice.installApp(androidApk, userIdentifier: '10'), false); expect(processManager, hasNoRemainingExpectations); }); } class FakeAndroidSdk extends Fake implements AndroidSdk { @override String get adbPath => 'adb'; }
flutter/packages/flutter_tools/test/general.shard/android/android_install_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/android/android_install_test.dart", "repo_id": "flutter", "token_count": 4416 }
852
// 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/android/android_sdk.dart'; import 'package:flutter_tools/src/android/application_package.dart'; import 'package:flutter_tools/src/application_package.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/os.dart'; import 'package:flutter_tools/src/base/process.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/fuchsia/application_package.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/ios/application_package.dart'; import 'package:flutter_tools/src/ios/plist_parser.dart'; import 'package:flutter_tools/src/project.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() { group('Apk with partial Android SDK works', () { late FakeAndroidSdk sdk; late FakeProcessManager fakeProcessManager; late MemoryFileSystem fs; late Cache cache; final Map<Type, Generator> overrides = <Type, Generator>{ AndroidSdk: () => sdk, ProcessManager: () => fakeProcessManager, FileSystem: () => fs, Cache: () => cache, }; setUp(() async { sdk = FakeAndroidSdk(); fakeProcessManager = FakeProcessManager.empty(); fs = MemoryFileSystem.test(); cache = Cache.test( processManager: FakeProcessManager.any(), ); Cache.flutterRoot = '../..'; sdk.licensesAvailable = true; final FlutterProject project = FlutterProject.fromDirectoryTest(fs.currentDirectory); fs.file(project.android.hostAppGradleRoot.childFile( globals.platform.isWindows ? 'gradlew.bat' : 'gradlew', ).path).createSync(recursive: true); }); testUsingContext('correct debug filename in module projects', () async { const String aaptPath = 'aaptPath'; final File apkFile = globals.fs.file('app-debug.apk'); final FakeAndroidSdkVersion sdkVersion = FakeAndroidSdkVersion(); sdkVersion.aaptPath = aaptPath; sdk.latestVersion = sdkVersion; sdk.platformToolsAvailable = true; sdk.licensesAvailable = false; fakeProcessManager.addCommand( FakeCommand( command: <String>[ aaptPath, 'dump', 'xmltree', apkFile.path, 'AndroidManifest.xml', ], stdout: _aaptDataWithDefaultEnabledAndMainLauncherActivity ) ); fakeProcessManager.addCommand( FakeCommand( command: <String>[ aaptPath, 'dump', 'xmltree', fs.path.join('module_project', 'build', 'host', 'outputs', 'apk', 'debug', 'app-debug.apk'), 'AndroidManifest.xml', ], stdout: _aaptDataWithDefaultEnabledAndMainLauncherActivity ) ); await ApplicationPackageFactory.instance!.getPackageForPlatform( TargetPlatform.android_arm, applicationBinary: apkFile, ); final BufferLogger logger = BufferLogger.test(); final FlutterProject project = await aModuleProject(); project.android.hostAppGradleRoot.childFile('build.gradle').createSync(recursive: true); final File appGradle = project.android.hostAppGradleRoot.childFile( fs.path.join('app', 'build.gradle')); appGradle.createSync(recursive: true); appGradle.writeAsStringSync("def flutterPluginVersion = 'managed'"); final File apkDebugFile = project.directory .childDirectory('build') .childDirectory('host') .childDirectory('outputs') .childDirectory('apk') .childDirectory('debug') .childFile('app-debug.apk'); apkDebugFile.createSync(recursive: true); final AndroidApk? androidApk = await AndroidApk.fromAndroidProject( project.android, androidSdk: sdk, processManager: fakeProcessManager, userMessages: UserMessages(), processUtils: ProcessUtils(processManager: fakeProcessManager, logger: logger), logger: logger, fileSystem: fs, buildInfo: const BuildInfo(BuildMode.debug, null, treeShakeIcons: false), ); expect(androidApk, isNotNull); }, overrides: overrides); testUsingContext('Licenses not available, platform and buildtools available, apk exists', () async { const String aaptPath = 'aaptPath'; final File apkFile = globals.fs.file('app-debug.apk'); final FakeAndroidSdkVersion sdkVersion = FakeAndroidSdkVersion(); sdkVersion.aaptPath = aaptPath; sdk.latestVersion = sdkVersion; sdk.platformToolsAvailable = true; sdk.licensesAvailable = false; fakeProcessManager.addCommand( FakeCommand( command: <String>[ aaptPath, 'dump', 'xmltree', apkFile.path, 'AndroidManifest.xml', ], stdout: _aaptDataWithDefaultEnabledAndMainLauncherActivity ) ); final ApplicationPackage applicationPackage = (await ApplicationPackageFactory.instance!.getPackageForPlatform( TargetPlatform.android_arm, applicationBinary: apkFile, ))!; expect(applicationPackage.name, 'app-debug.apk'); expect(applicationPackage, isA<PrebuiltApplicationPackage>()); expect((applicationPackage as PrebuiltApplicationPackage).applicationPackage.path, apkFile.path); expect(fakeProcessManager, hasNoRemainingExpectations); }, overrides: overrides); testUsingContext('Licenses available, build tools not, apk exists', () async { sdk.latestVersion = null; final FlutterProject project = FlutterProject.fromDirectoryTest(fs.currentDirectory); project.android.hostAppGradleRoot .childFile('gradle.properties') .writeAsStringSync('irrelevant'); final Directory gradleWrapperDir = cache.getArtifactDirectory('gradle_wrapper'); gradleWrapperDir.fileSystem.directory(gradleWrapperDir.childDirectory('gradle').childDirectory('wrapper')) .createSync(recursive: true); gradleWrapperDir.childFile('gradlew').writeAsStringSync('irrelevant'); gradleWrapperDir.childFile('gradlew.bat').writeAsStringSync('irrelevant'); await ApplicationPackageFactory.instance!.getPackageForPlatform( TargetPlatform.android_arm, applicationBinary: globals.fs.file('app-debug.apk'), ); expect(fakeProcessManager, hasNoRemainingExpectations); }, overrides: overrides); testUsingContext('Licenses available, build tools available, does not call gradle dependencies', () async { final AndroidSdkVersion sdkVersion = FakeAndroidSdkVersion(); sdk.latestVersion = sdkVersion; await ApplicationPackageFactory.instance!.getPackageForPlatform( TargetPlatform.android_arm, ); expect(fakeProcessManager, hasNoRemainingExpectations); }, overrides: overrides); testWithoutContext('returns null when failed to extract manifest', () async { final Logger logger = BufferLogger.test(); final AndroidApk? androidApk = AndroidApk.fromApk( fs.file(''), processManager: fakeProcessManager, logger: logger, userMessages: UserMessages(), androidSdk: sdk, processUtils: ProcessUtils(processManager: fakeProcessManager, logger: logger), ); expect(androidApk, isNull); expect(fakeProcessManager, hasNoRemainingExpectations); }); }); group('ApkManifestData', () { testWithoutContext('Parses manifest with an Activity that has enabled set to true, action set to android.intent.action.MAIN and category set to android.intent.category.LAUNCHER', () { final ApkManifestData data = ApkManifestData.parseFromXmlDump( _aaptDataWithExplicitEnabledAndMainLauncherActivity, BufferLogger.test(), )!; expect(data, isNotNull); expect(data.packageName, 'io.flutter.examples.hello_world'); expect(data.launchableActivityName, 'io.flutter.examples.hello_world.MainActivity2'); }); testWithoutContext('Parses manifest with an Activity that has no value for its enabled field, action set to android.intent.action.MAIN and category set to android.intent.category.LAUNCHER', () { final ApkManifestData data = ApkManifestData.parseFromXmlDump( _aaptDataWithDefaultEnabledAndMainLauncherActivity, BufferLogger.test(), )!; expect(data, isNotNull); expect(data.packageName, 'io.flutter.examples.hello_world'); expect(data.launchableActivityName, 'io.flutter.examples.hello_world.MainActivity2'); }); testWithoutContext('Parses manifest with a dist namespace', () { final ApkManifestData data = ApkManifestData.parseFromXmlDump( _aaptDataWithDistNamespace, BufferLogger.test(), )!; expect(data, isNotNull); expect(data.packageName, 'io.flutter.examples.hello_world'); expect(data.launchableActivityName, 'io.flutter.examples.hello_world.MainActivity'); }); testWithoutContext('Error when parsing manifest with no Activity that has enabled set to true nor has no value for its enabled field', () { final BufferLogger logger = BufferLogger.test(); final ApkManifestData? data = ApkManifestData.parseFromXmlDump( _aaptDataWithNoEnabledActivity, logger, ); expect(data, isNull); expect( logger.errorText, 'Error running io.flutter.examples.hello_world. Default activity not found\n', ); }); testWithoutContext('Error when parsing manifest with no Activity that has action set to android.intent.action.MAIN', () { final BufferLogger logger = BufferLogger.test(); final ApkManifestData? data = ApkManifestData.parseFromXmlDump( _aaptDataWithNoMainActivity, logger, ); expect(data, isNull); expect( logger.errorText, 'Error running io.flutter.examples.hello_world. Default activity not found\n', ); }); testWithoutContext('Error when parsing manifest with no Activity that has category set to android.intent.category.LAUNCHER', () { final BufferLogger logger = BufferLogger.test(); final ApkManifestData? data = ApkManifestData.parseFromXmlDump( _aaptDataWithNoLauncherActivity, logger, ); expect(data, isNull); expect( logger.errorText, 'Error running io.flutter.examples.hello_world. Default activity not found\n', ); }); testWithoutContext('Parsing manifest with Activity that has multiple category, android.intent.category.LAUNCHER and android.intent.category.DEFAULT', () { final ApkManifestData data = ApkManifestData.parseFromXmlDump( _aaptDataWithLauncherAndDefaultActivity, BufferLogger.test(), )!; expect(data, isNotNull); expect(data.packageName, 'io.flutter.examples.hello_world'); expect(data.launchableActivityName, 'io.flutter.examples.hello_world.MainActivity'); }); testWithoutContext('Parses manifest with missing application tag', () async { final ApkManifestData? data = ApkManifestData.parseFromXmlDump( _aaptDataWithoutApplication, BufferLogger.test(), ); expect(data, isNull); }); }); group('PrebuiltIOSApp', () { late FakeOperatingSystemUtils os; late FakePlistParser testPlistParser; final Map<Type, Generator> overrides = <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), PlistParser: () => testPlistParser, OperatingSystemUtils: () => os, }; setUp(() { os = FakeOperatingSystemUtils(); testPlistParser = FakePlistParser(); }); testUsingContext('Error on non-existing file', () { final PrebuiltIOSApp? iosApp = IOSApp.fromPrebuiltApp(globals.fs.file('not_existing.ipa')) as PrebuiltIOSApp?; expect(iosApp, isNull); expect( testLogger.errorText, 'File "not_existing.ipa" does not exist. Use an app bundle or an ipa.\n', ); }, overrides: overrides); testUsingContext('Error on non-app-bundle folder', () { globals.fs.directory('regular_folder').createSync(); final PrebuiltIOSApp? iosApp = IOSApp.fromPrebuiltApp(globals.fs.file('regular_folder')) as PrebuiltIOSApp?; expect(iosApp, isNull); expect( testLogger.errorText, 'Folder "regular_folder" is not an app bundle.\n'); }, overrides: overrides); testUsingContext('Error on no info.plist', () { globals.fs.directory('bundle.app').createSync(); final PrebuiltIOSApp? iosApp = IOSApp.fromPrebuiltApp(globals.fs.file('bundle.app')) as PrebuiltIOSApp?; expect(iosApp, isNull); expect( testLogger.errorText, 'Invalid prebuilt iOS app. Does not contain Info.plist.\n', ); }, overrides: overrides); testUsingContext('Error on bad info.plist', () { globals.fs.directory('bundle.app').createSync(); globals.fs.file('bundle.app/Info.plist').createSync(); final PrebuiltIOSApp? iosApp = IOSApp.fromPrebuiltApp(globals.fs.file('bundle.app')) as PrebuiltIOSApp?; expect(iosApp, isNull); expect( testLogger.errorText, contains( 'Invalid prebuilt iOS app. Info.plist does not contain bundle identifier\n'), ); }, overrides: overrides); testUsingContext('Success with app bundle', () { globals.fs.directory('bundle.app').createSync(); globals.fs.file('bundle.app/Info.plist').createSync(); testPlistParser.setProperty('CFBundleIdentifier', 'fooBundleId'); final PrebuiltIOSApp iosApp = IOSApp.fromPrebuiltApp(globals.fs.file('bundle.app'))! as PrebuiltIOSApp; expect(testLogger.errorText, isEmpty); expect(iosApp.uncompressedBundle.path, 'bundle.app'); expect(iosApp.id, 'fooBundleId'); expect(iosApp.bundleName, 'bundle.app'); expect(iosApp.applicationPackage.path, globals.fs.directory('bundle.app').path); }, overrides: overrides); testUsingContext('Bad ipa zip-file, no payload dir', () { globals.fs.file('app.ipa').createSync(); final PrebuiltIOSApp? iosApp = IOSApp.fromPrebuiltApp(globals.fs.file('app.ipa')) as PrebuiltIOSApp?; expect(iosApp, isNull); expect( testLogger.errorText, 'Invalid prebuilt iOS ipa. Does not contain a "Payload" directory.\n', ); }, overrides: overrides); testUsingContext('Bad ipa zip-file, two app bundles', () { globals.fs.file('app.ipa').createSync(); os.onUnzip = (File zipFile, Directory targetDirectory) { if (zipFile.path != 'app.ipa') { return; } final String bundlePath1 = globals.fs.path.join(targetDirectory.path, 'Payload', 'bundle1.app'); final String bundlePath2 = globals.fs.path.join(targetDirectory.path, 'Payload', 'bundle2.app'); globals.fs.directory(bundlePath1).createSync(recursive: true); globals.fs.directory(bundlePath2).createSync(recursive: true); }; final PrebuiltIOSApp? iosApp = IOSApp.fromPrebuiltApp(globals.fs.file('app.ipa')) as PrebuiltIOSApp?; expect(iosApp, isNull); expect(testLogger.errorText, 'Invalid prebuilt iOS ipa. Does not contain a single app bundle.\n'); }, overrides: overrides); testUsingContext('Success with ipa', () { globals.fs.file('app.ipa').createSync(); os.onUnzip = (File zipFile, Directory targetDirectory) { if (zipFile.path != 'app.ipa') { return; } final Directory bundleAppDir = globals.fs.directory( globals.fs.path.join(targetDirectory.path, 'Payload', 'bundle.app')); bundleAppDir.createSync(recursive: true); testPlistParser.setProperty('CFBundleIdentifier', 'fooBundleId'); globals.fs .file(globals.fs.path.join(bundleAppDir.path, 'Info.plist')) .createSync(); }; final PrebuiltIOSApp iosApp = IOSApp.fromPrebuiltApp(globals.fs.file('app.ipa'))! as PrebuiltIOSApp; expect(testLogger.errorText, isEmpty); expect(iosApp.uncompressedBundle.path, endsWith('bundle.app')); expect(iosApp.id, 'fooBundleId'); expect(iosApp.bundleName, 'bundle.app'); expect(iosApp.applicationPackage.path, globals.fs.file('app.ipa').path); }, overrides: overrides); testUsingContext('returns null when there is no ios or .ios directory', () async { globals.fs.file('pubspec.yaml').createSync(); globals.fs.file('.packages').createSync(); final BuildableIOSApp? iosApp = await IOSApp.fromIosProject( FlutterProject.fromDirectory(globals.fs.currentDirectory).ios, null) as BuildableIOSApp?; expect(iosApp, null); }, overrides: overrides); testUsingContext('returns null when there is no Runner.xcodeproj', () async { globals.fs.file('pubspec.yaml').createSync(); globals.fs.file('.packages').createSync(); globals.fs.file('ios/FooBar.xcodeproj').createSync(recursive: true); final BuildableIOSApp? iosApp = await IOSApp.fromIosProject( FlutterProject.fromDirectory(globals.fs.currentDirectory).ios, null) as BuildableIOSApp?; expect(iosApp, null); }, overrides: overrides); testUsingContext('returns null when there is no Runner.xcodeproj/project.pbxproj', () async { globals.fs.file('pubspec.yaml').createSync(); globals.fs.file('.packages').createSync(); globals.fs.file('ios/Runner.xcodeproj').createSync(recursive: true); final BuildableIOSApp? iosApp = await IOSApp.fromIosProject( FlutterProject.fromDirectory(globals.fs.currentDirectory).ios, null) as BuildableIOSApp?; expect(iosApp, null); }, overrides: overrides); testUsingContext('returns null when there with no product identifier', () async { globals.fs.file('pubspec.yaml').createSync(); globals.fs.file('.packages').createSync(); final Directory project = globals.fs.directory('ios/Runner.xcodeproj')..createSync(recursive: true); project.childFile('project.pbxproj').createSync(); final BuildableIOSApp? iosApp = await IOSApp.fromIosProject( FlutterProject.fromDirectory(globals.fs.currentDirectory).ios, null) as BuildableIOSApp?; expect(iosApp, null); }, overrides: overrides); testUsingContext('returns project app icon dirname', () async { final BuildableIOSApp iosApp = BuildableIOSApp( IosProject.fromFlutter(FlutterProject.fromDirectory(globals.fs.currentDirectory)), 'com.foo.bar', 'Runner', ); final String iconDirSuffix = globals.fs.path.join( 'Runner', 'Assets.xcassets', 'AppIcon.appiconset', ); expect(iosApp.projectAppIconDirName, globals.fs.path.join('ios', iconDirSuffix)); }, overrides: overrides); testUsingContext('returns template app icon dirname for Contents.json', () async { final BuildableIOSApp iosApp = BuildableIOSApp( IosProject.fromFlutter(FlutterProject.fromDirectory(globals.fs.currentDirectory)), 'com.foo.bar', 'Runner', ); final String iconDirSuffix = globals.fs.path.join( 'Runner', 'Assets.xcassets', 'AppIcon.appiconset', ); expect( iosApp.templateAppIconDirNameForContentsJson, globals.fs.path.join( Cache.flutterRoot!, 'packages', 'flutter_tools', 'templates', 'app_shared', 'ios.tmpl', iconDirSuffix, ), ); }, overrides: overrides); testUsingContext('returns template app icon dirname for images', () async { final String toolsDir = globals.fs.path.join( Cache.flutterRoot!, 'packages', 'flutter_tools', ); final String packageConfigPath = globals.fs.path.join( toolsDir, '.dart_tool', 'package_config.json' ); globals.fs.file(packageConfigPath) ..createSync(recursive: true) ..writeAsStringSync(''' { "configVersion": 2, "packages": [ { "name": "flutter_template_images", "rootUri": "/flutter_template_images", "packageUri": "lib/", "languageVersion": "2.12" } ] } '''); final BuildableIOSApp iosApp = BuildableIOSApp( IosProject.fromFlutter(FlutterProject.fromDirectory(globals.fs.currentDirectory)), 'com.foo.bar', 'Runner'); final String iconDirSuffix = globals.fs.path.join( 'Runner', 'Assets.xcassets', 'AppIcon.appiconset', ); expect( await iosApp.templateAppIconDirNameForImages, globals.fs.path.absolute( 'flutter_template_images', 'templates', 'app_shared', 'ios.tmpl', iconDirSuffix, ), ); }, overrides: overrides); testUsingContext('returns project launch image dirname', () async { final BuildableIOSApp iosApp = BuildableIOSApp( IosProject.fromFlutter(FlutterProject.fromDirectory(globals.fs.currentDirectory)), 'com.foo.bar', 'Runner', ); final String launchImageDirSuffix = globals.fs.path.join( 'Runner', 'Assets.xcassets', 'LaunchImage.imageset', ); expect(iosApp.projectLaunchImageDirName, globals.fs.path.join('ios', launchImageDirSuffix)); }, overrides: overrides); testUsingContext('returns template launch image dirname for Contents.json', () async { final BuildableIOSApp iosApp = BuildableIOSApp( IosProject.fromFlutter(FlutterProject.fromDirectory(globals.fs.currentDirectory)), 'com.foo.bar', 'Runner', ); final String launchImageDirSuffix = globals.fs.path.join( 'Runner', 'Assets.xcassets', 'LaunchImage.imageset', ); expect( iosApp.templateLaunchImageDirNameForContentsJson, globals.fs.path.join( Cache.flutterRoot!, 'packages', 'flutter_tools', 'templates', 'app_shared', 'ios.tmpl', launchImageDirSuffix, ), ); }, overrides: overrides); testUsingContext('returns template launch image dirname for images', () async { final String toolsDir = globals.fs.path.join( Cache.flutterRoot!, 'packages', 'flutter_tools', ); final String packageConfigPath = globals.fs.path.join( toolsDir, '.dart_tool', 'package_config.json' ); globals.fs.file(packageConfigPath) ..createSync(recursive: true) ..writeAsStringSync(''' { "configVersion": 2, "packages": [ { "name": "flutter_template_images", "rootUri": "/flutter_template_images", "packageUri": "lib/", "languageVersion": "2.12" } ] } '''); final BuildableIOSApp iosApp = BuildableIOSApp( IosProject.fromFlutter(FlutterProject.fromDirectory(globals.fs.currentDirectory)), 'com.foo.bar', 'Runner'); final String launchImageDirSuffix = globals.fs.path.join( 'Runner', 'Assets.xcassets', 'LaunchImage.imageset', ); expect( await iosApp.templateLaunchImageDirNameForImages, globals.fs.path.absolute( 'flutter_template_images', 'templates', 'app_shared', 'ios.tmpl', launchImageDirSuffix, ), ); }, overrides: overrides); }); group('FuchsiaApp', () { final Map<Type, Generator> overrides = <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), OperatingSystemUtils: () => FakeOperatingSystemUtils(), }; testUsingContext('Error on non-existing file', () { final PrebuiltFuchsiaApp? fuchsiaApp = FuchsiaApp.fromPrebuiltApp(globals.fs.file('not_existing.far')) as PrebuiltFuchsiaApp?; expect(fuchsiaApp, isNull); expect( testLogger.errorText, 'File "not_existing.far" does not exist or is not a .far file. Use far archive.\n', ); }, overrides: overrides); testUsingContext('Error on non-far file', () { globals.fs.directory('regular_folder').createSync(); final PrebuiltFuchsiaApp? fuchsiaApp = FuchsiaApp.fromPrebuiltApp(globals.fs.file('regular_folder')) as PrebuiltFuchsiaApp?; expect(fuchsiaApp, isNull); expect( testLogger.errorText, 'File "regular_folder" does not exist or is not a .far file. Use far archive.\n', ); }, overrides: overrides); testUsingContext('Success with far file', () { globals.fs.file('bundle.far').createSync(); final PrebuiltFuchsiaApp fuchsiaApp = FuchsiaApp.fromPrebuiltApp(globals.fs.file('bundle.far'))! as PrebuiltFuchsiaApp; expect(testLogger.errorText, isEmpty); expect(fuchsiaApp.id, 'bundle.far'); expect(fuchsiaApp.applicationPackage.path, globals.fs.file('bundle.far').path); }, overrides: overrides); testUsingContext('returns null when there is no fuchsia', () async { globals.fs.file('pubspec.yaml').createSync(); globals.fs.file('.packages').createSync(); final BuildableFuchsiaApp? fuchsiaApp = FuchsiaApp.fromFuchsiaProject(FlutterProject.fromDirectory(globals.fs.currentDirectory).fuchsia) as BuildableFuchsiaApp?; expect(fuchsiaApp, null); }, overrides: overrides); }); } const String _aaptDataWithExplicitEnabledAndMainLauncherActivity = ''' N: android=http://schemas.android.com/apk/res/android E: manifest (line=7) A: android:versionCode(0x0101021b)=(type 0x10)0x1 A: android:versionName(0x0101021c)="0.0.1" (Raw: "0.0.1") A: package="io.flutter.examples.hello_world" (Raw: "io.flutter.examples.hello_world") E: uses-sdk (line=12) A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1b E: uses-permission (line=21) A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET") E: application (line=29) A: android:label(0x01010001)="hello_world" (Raw: "hello_world") A: android:icon(0x01010002)=@0x7f010000 A: android:name(0x01010003)="io.flutter.app.FlutterApplication" (Raw: "io.flutter.app.FlutterApplication") A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff E: activity (line=34) A: android:theme(0x01010000)=@0x1030009 A: android:name(0x01010003)="io.flutter.examples.hello_world.MainActivity" (Raw: "io.flutter.examples.hello_world.MainActivity") A: android:enabled(0x0101000e)=(type 0x12)0x0 A: android:launchMode(0x0101001d)=(type 0x10)0x1 A: android:configChanges(0x0101001f)=(type 0x11)0x400035b4 A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10 A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff E: intent-filter (line=42) E: action (line=43) A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN") E: category (line=45) A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER") E: activity (line=48) A: android:theme(0x01010000)=@0x1030009 A: android:label(0x01010001)="app2" (Raw: "app2") A: android:name(0x01010003)="io.flutter.examples.hello_world.MainActivity2" (Raw: "io.flutter.examples.hello_world.MainActivity2") A: android:enabled(0x0101000e)=(type 0x12)0xffffffff E: intent-filter (line=53) E: action (line=54) A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN") E: category (line=56) A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")'''; const String _aaptDataWithDefaultEnabledAndMainLauncherActivity = ''' N: android=http://schemas.android.com/apk/res/android E: manifest (line=7) A: android:versionCode(0x0101021b)=(type 0x10)0x1 A: android:versionName(0x0101021c)="0.0.1" (Raw: "0.0.1") A: package="io.flutter.examples.hello_world" (Raw: "io.flutter.examples.hello_world") E: uses-sdk (line=12) A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1b E: uses-permission (line=21) A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET") E: application (line=29) A: android:label(0x01010001)="hello_world" (Raw: "hello_world") A: android:icon(0x01010002)=@0x7f010000 A: android:name(0x01010003)="io.flutter.app.FlutterApplication" (Raw: "io.flutter.app.FlutterApplication") A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff E: activity (line=34) A: android:theme(0x01010000)=@0x1030009 A: android:name(0x01010003)="io.flutter.examples.hello_world.MainActivity" (Raw: "io.flutter.examples.hello_world.MainActivity") A: android:enabled(0x0101000e)=(type 0x12)0x0 A: android:launchMode(0x0101001d)=(type 0x10)0x1 A: android:configChanges(0x0101001f)=(type 0x11)0x400035b4 A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10 A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff E: intent-filter (line=42) E: action (line=43) A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN") E: category (line=45) A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER") E: activity (line=48) A: android:theme(0x01010000)=@0x1030009 A: android:label(0x01010001)="app2" (Raw: "app2") A: android:name(0x01010003)="io.flutter.examples.hello_world.MainActivity2" (Raw: "io.flutter.examples.hello_world.MainActivity2") E: intent-filter (line=53) E: action (line=54) A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN") E: category (line=56) A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")'''; const String _aaptDataWithNoEnabledActivity = ''' N: android=http://schemas.android.com/apk/res/android E: manifest (line=7) A: android:versionCode(0x0101021b)=(type 0x10)0x1 A: android:versionName(0x0101021c)="0.0.1" (Raw: "0.0.1") A: package="io.flutter.examples.hello_world" (Raw: "io.flutter.examples.hello_world") E: uses-sdk (line=12) A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1b E: uses-permission (line=21) A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET") E: application (line=29) A: android:label(0x01010001)="hello_world" (Raw: "hello_world") A: android:icon(0x01010002)=@0x7f010000 A: android:name(0x01010003)="io.flutter.app.FlutterApplication" (Raw: "io.flutter.app.FlutterApplication") A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff E: activity (line=34) A: android:theme(0x01010000)=@0x1030009 A: android:name(0x01010003)="io.flutter.examples.hello_world.MainActivity" (Raw: "io.flutter.examples.hello_world.MainActivity") A: android:enabled(0x0101000e)=(type 0x12)0x0 A: android:launchMode(0x0101001d)=(type 0x10)0x1 A: android:configChanges(0x0101001f)=(type 0x11)0x400035b4 A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10 A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff E: intent-filter (line=42) E: action (line=43) A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN") E: category (line=45) A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")'''; const String _aaptDataWithNoMainActivity = ''' N: android=http://schemas.android.com/apk/res/android E: manifest (line=7) A: android:versionCode(0x0101021b)=(type 0x10)0x1 A: android:versionName(0x0101021c)="0.0.1" (Raw: "0.0.1") A: package="io.flutter.examples.hello_world" (Raw: "io.flutter.examples.hello_world") E: uses-sdk (line=12) A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1b E: uses-permission (line=21) A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET") E: application (line=29) A: android:label(0x01010001)="hello_world" (Raw: "hello_world") A: android:icon(0x01010002)=@0x7f010000 A: android:name(0x01010003)="io.flutter.app.FlutterApplication" (Raw: "io.flutter.app.FlutterApplication") A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff E: activity (line=34) A: android:theme(0x01010000)=@0x1030009 A: android:name(0x01010003)="io.flutter.examples.hello_world.MainActivity" (Raw: "io.flutter.examples.hello_world.MainActivity") A: android:enabled(0x0101000e)=(type 0x12)0xffffffff A: android:launchMode(0x0101001d)=(type 0x10)0x1 A: android:configChanges(0x0101001f)=(type 0x11)0x400035b4 A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10 A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff E: intent-filter (line=42) E: category (line=43) A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")'''; const String _aaptDataWithNoLauncherActivity = ''' N: android=http://schemas.android.com/apk/res/android E: manifest (line=7) A: android:versionCode(0x0101021b)=(type 0x10)0x1 A: android:versionName(0x0101021c)="0.0.1" (Raw: "0.0.1") A: package="io.flutter.examples.hello_world" (Raw: "io.flutter.examples.hello_world") E: uses-sdk (line=12) A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1b E: uses-permission (line=21) A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET") E: application (line=29) A: android:label(0x01010001)="hello_world" (Raw: "hello_world") A: android:icon(0x01010002)=@0x7f010000 A: android:name(0x01010003)="io.flutter.app.FlutterApplication" (Raw: "io.flutter.app.FlutterApplication") A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff E: activity (line=34) A: android:theme(0x01010000)=@0x1030009 A: android:name(0x01010003)="io.flutter.examples.hello_world.MainActivity" (Raw: "io.flutter.examples.hello_world.MainActivity") A: android:enabled(0x0101000e)=(type 0x12)0xffffffff A: android:launchMode(0x0101001d)=(type 0x10)0x1 A: android:configChanges(0x0101001f)=(type 0x11)0x400035b4 A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10 A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff E: intent-filter (line=42) E: action (line=43) A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")'''; const String _aaptDataWithLauncherAndDefaultActivity = ''' N: android=http://schemas.android.com/apk/res/android N: dist=http://schemas.android.com/apk/distribution E: manifest (line=7) A: android:versionCode(0x0101021b)=(type 0x10)0x1 A: android:versionName(0x0101021c)="1.0" (Raw: "1.0") A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1c A: android:compileSdkVersionCodename(0x01010573)="9" (Raw: "9") A: package="io.flutter.examples.hello_world" (Raw: "io.flutter.examples.hello_world") A: platformBuildVersionCode=(type 0x10)0x1 A: platformBuildVersionName=(type 0x4)0x3f800000 E: uses-sdk (line=13) A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1c E: dist:module (line=17) A: dist:instant=(type 0x12)0xffffffff E: uses-permission (line=24) A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET") E: application (line=32) A: android:label(0x01010001)="hello_world" (Raw: "hello_world") A: android:icon(0x01010002)=@0x7f010000 A: android:name(0x01010003)="io.flutter.app.FlutterApplication" (Raw: "io.flutter.app.FlutterApplication") E: activity (line=36) A: android:theme(0x01010000)=@0x01030009 A: android:name(0x01010003)="io.flutter.examples.hello_world.MainActivity" (Raw: "io.flutter.examples.hello_world.MainActivity") A: android:launchMode(0x0101001d)=(type 0x10)0x1 A: android:configChanges(0x0101001f)=(type 0x11)0x400037b4 A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10 A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff E: intent-filter (line=43) E: action (line=44) A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN") E: category (line=46) A: android:name(0x01010003)="android.intent.category.DEFAULT" (Raw: "android.intent.category.DEFAULT") E: category (line=47) A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER") '''; const String _aaptDataWithDistNamespace = ''' N: android=http://schemas.android.com/apk/res/android N: dist=http://schemas.android.com/apk/distribution E: manifest (line=7) A: android:versionCode(0x0101021b)=(type 0x10)0x1 A: android:versionName(0x0101021c)="1.0" (Raw: "1.0") A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1c A: android:compileSdkVersionCodename(0x01010573)="9" (Raw: "9") A: package="io.flutter.examples.hello_world" (Raw: "io.flutter.examples.hello_world") A: platformBuildVersionCode=(type 0x10)0x1 A: platformBuildVersionName=(type 0x4)0x3f800000 E: uses-sdk (line=13) A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1c E: dist:module (line=17) A: dist:instant=(type 0x12)0xffffffff E: uses-permission (line=24) A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET") E: application (line=32) A: android:label(0x01010001)="hello_world" (Raw: "hello_world") A: android:icon(0x01010002)=@0x7f010000 A: android:name(0x01010003)="io.flutter.app.FlutterApplication" (Raw: "io.flutter.app.FlutterApplication") E: activity (line=36) A: android:theme(0x01010000)=@0x01030009 A: android:name(0x01010003)="io.flutter.examples.hello_world.MainActivity" (Raw: "io.flutter.examples.hello_world.MainActivity") A: android:launchMode(0x0101001d)=(type 0x10)0x1 A: android:configChanges(0x0101001f)=(type 0x11)0x400037b4 A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10 A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff E: intent-filter (line=43) E: action (line=44) A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN") E: category (line=46) A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER") '''; const String _aaptDataWithoutApplication = ''' N: android=http://schemas.android.com/apk/res/android N: dist=http://schemas.android.com/apk/distribution E: manifest (line=7) A: android:versionCode(0x0101021b)=(type 0x10)0x1 A: android:versionName(0x0101021c)="1.0" (Raw: "1.0") A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1c A: android:compileSdkVersionCodename(0x01010573)="9" (Raw: "9") A: package="io.flutter.examples.hello_world" (Raw: "io.flutter.examples.hello_world") A: platformBuildVersionCode=(type 0x10)0x1 A: platformBuildVersionName=(type 0x4)0x3f800000 E: uses-sdk (line=13) A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1c E: dist:module (line=17) A: dist:instant=(type 0x12)0xffffffff E: uses-permission (line=24) A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET") '''; class FakeOperatingSystemUtils extends Fake implements OperatingSystemUtils { void Function(File, Directory)? onUnzip; @override void unzip(File file, Directory targetDirectory) { onUnzip?.call(file, targetDirectory); } } class FakeAndroidSdk extends Fake implements AndroidSdk { @override late bool platformToolsAvailable; @override late bool licensesAvailable; @override AndroidSdkVersion? latestVersion; } class FakeAndroidSdkVersion extends Fake implements AndroidSdkVersion { @override late String aaptPath; } Future<FlutterProject> aModuleProject() async { final Directory directory = globals.fs.directory('module_project'); directory .childDirectory('.dart_tool') .childFile('package_config.json') ..createSync(recursive: true) ..writeAsStringSync('{"configVersion":2,"packages":[]}'); directory.childFile('pubspec.yaml').writeAsStringSync(''' name: my_module flutter: module: androidPackage: com.example '''); return FlutterProject.fromDirectory(directory); }
flutter/packages/flutter_tools/test/general.shard/application_package_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/application_package_test.dart", "repo_id": "flutter", "token_count": 17957 }
853
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'package:flutter_tools/src/base/context.dart'; import '../../src/common.dart'; void main() { group('AppContext', () { group('global getter', () { late bool called; setUp(() { called = false; }); test('returns non-null context in the root zone', () { expect(context, isNotNull); }); test('returns root context in child of root zone if zone was manually created', () { final Zone rootZone = Zone.current; final AppContext rootContext = context; runZoned<void>(() { expect(Zone.current, isNot(rootZone)); expect(Zone.current.parent, rootZone); expect(context, rootContext); called = true; }); expect(called, isTrue); }); test('returns child context after run', () async { final AppContext rootContext = context; await rootContext.run<void>(name: 'child', body: () { expect(context, isNot(rootContext)); expect(context.name, 'child'); called = true; }); expect(called, isTrue); }); test('returns grandchild context after nested run', () async { final AppContext rootContext = context; await rootContext.run<void>(name: 'child', body: () async { final AppContext childContext = context; await childContext.run<void>(name: 'grandchild', body: () { expect(context, isNot(rootContext)); expect(context, isNot(childContext)); expect(context.name, 'grandchild'); called = true; }); }); expect(called, isTrue); }); test('scans up zone hierarchy for first context', () async { final AppContext rootContext = context; await rootContext.run<void>(name: 'child', body: () { final AppContext childContext = context; runZoned<void>(() { expect(context, isNot(rootContext)); expect(context, same(childContext)); expect(context.name, 'child'); called = true; }); }); expect(called, isTrue); }); }); group('operator[]', () { test('still finds values if async code runs after body has finished', () async { final Completer<void> outer = Completer<void>(); final Completer<void> inner = Completer<void>(); String? value; await context.run<void>( body: () { outer.future.then<void>((_) { value = context.get<String>(); inner.complete(); }); }, fallbacks: <Type, Generator>{ String: () => 'value', }, ); expect(value, isNull); outer.complete(); await inner.future; expect(value, 'value'); }); test('caches generated override values', () async { int consultationCount = 0; String? value; await context.run<void>( body: () async { final StringBuffer buf = StringBuffer(context.get<String>()!); buf.write(context.get<String>()); await context.run<void>(body: () { buf.write(context.get<String>()); }); value = buf.toString(); }, overrides: <Type, Generator>{ String: () { consultationCount++; return 'v'; }, }, ); expect(value, 'vvv'); expect(consultationCount, 1); }); test('caches generated fallback values', () async { int consultationCount = 0; String? value; await context.run( body: () async { final StringBuffer buf = StringBuffer(context.get<String>()!); buf.write(context.get<String>()); await context.run<void>(body: () { buf.write(context.get<String>()); }); value = buf.toString(); }, fallbacks: <Type, Generator>{ String: () { consultationCount++; return 'v'; }, }, ); expect(value, 'vvv'); expect(consultationCount, 1); }); test('returns null if generated value is null', () async { final String? value = await context.run<String?>( body: () => context.get<String>(), overrides: <Type, Generator>{ String: () => null, }, ); expect(value, isNull); }); test('throws if generator has dependency cycle', () async { final Future<String?> value = context.run<String?>( body: () async { return context.get<String>(); }, fallbacks: <Type, Generator>{ int: () => int.parse(context.get<String>() ?? ''), String: () => '${context.get<double>()}', double: () => context.get<int>()! * 1.0, }, ); expect( () => value, throwsA( isA<ContextDependencyCycleException>() .having((ContextDependencyCycleException error) => error.cycle, 'cycle', <Type>[String, double, int]) .having( (ContextDependencyCycleException error) => error.toString(), 'toString()', 'Dependency cycle detected: String -> double -> int', ), ), ); }); }); group('run', () { test('returns the value returned by body', () async { expect(await context.run<int>(body: () => 123), 123); expect(await context.run<String>(body: () => 'value'), 'value'); expect(await context.run<int>(body: () async => 456), 456); }); test('passes name to child context', () async { await context.run<void>(name: 'child', body: () { expect(context.name, 'child'); }); }); group('fallbacks', () { late bool called; setUp(() { called = false; }); test('are applied after parent context is consulted', () async { final String? value = await context.run<String?>( body: () { return context.run<String?>( body: () { called = true; return context.get<String>(); }, fallbacks: <Type, Generator>{ String: () => 'child', }, ); }, ); expect(called, isTrue); expect(value, 'child'); }); test('are not applied if parent context supplies value', () async { bool childConsulted = false; final String? value = await context.run<String?>( body: () { return context.run<String?>( body: () { called = true; return context.get<String>(); }, fallbacks: <Type, Generator>{ String: () { childConsulted = true; return 'child'; }, }, ); }, fallbacks: <Type, Generator>{ String: () => 'parent', }, ); expect(called, isTrue); expect(value, 'parent'); expect(childConsulted, isFalse); }); test('may depend on one another', () async { final String? value = await context.run<String?>( body: () { return context.get<String>(); }, fallbacks: <Type, Generator>{ int: () => 123, String: () => '-${context.get<int>()}-', }, ); expect(value, '-123-'); }); }); group('overrides', () { test('intercept consultation of parent context', () async { bool parentConsulted = false; final String? value = await context.run<String?>( body: () { return context.run<String?>( body: () => context.get<String>(), overrides: <Type, Generator>{ String: () => 'child', }, ); }, fallbacks: <Type, Generator>{ String: () { parentConsulted = true; return 'parent'; }, }, ); expect(value, 'child'); expect(parentConsulted, isFalse); }); }); }); }); }
flutter/packages/flutter_tools/test/general.shard/base/context_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/base/context_test.dart", "repo_id": "flutter", "token_count": 4319 }
854
// 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/base/user_messages.dart'; import '../../src/common.dart'; typedef _InstallationMessage = String Function(Platform); void main() { final FakePlatform macPlatform = FakePlatform(operatingSystem: 'macos'); final FakePlatform linuxPlatform = FakePlatform(); final FakePlatform windowsPlatform = FakePlatform(operatingSystem: 'windows'); void checkInstallationURL(_InstallationMessage message) { expect(message(macPlatform), contains('https://flutter.dev/docs/get-started/install/macos#android-setup')); expect(message(linuxPlatform), contains('https://flutter.dev/docs/get-started/install/linux#android-setup')); expect(message(windowsPlatform), contains('https://flutter.dev/docs/get-started/install/windows#android-setup')); expect(message(FakePlatform(operatingSystem: '')), contains('https://flutter.dev/docs/get-started/install ')); } testWithoutContext('Android installation instructions', () { final UserMessages userMessages = UserMessages(); checkInstallationURL((Platform platform) => userMessages.androidMissingSdkInstructions(platform)); checkInstallationURL((Platform platform) => userMessages.androidSdkInstallHelp(platform)); checkInstallationURL((Platform platform) => userMessages.androidMissingSdkManager('/', platform)); checkInstallationURL((Platform platform) => userMessages.androidCannotRunSdkManager('/', '', platform)); checkInstallationURL((Platform platform) => userMessages.androidSdkBuildToolsOutdated(0, '', platform)); checkInstallationURL((Platform platform) => userMessages.androidStudioInstallation(platform)); }); testWithoutContext('Xcode installation instructions', () { final UserMessages userMessages = UserMessages(); expect(userMessages.xcodeMissing, contains('iOS and macOS')); expect(userMessages.xcodeIncomplete, contains('iOS and macOS')); }); }
flutter/packages/flutter_tools/test/general.shard/base/user_messages_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/base/user_messages_test.dart", "repo_id": "flutter", "token_count": 585 }
855
// 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/base/file_system.dart'; import 'package:flutter_tools/src/build_system/depfile.dart'; import 'package:flutter_tools/src/build_system/targets/desktop.dart'; import '../../../src/common.dart'; void main() { testWithoutContext('unpackDesktopArtifacts copies files/directories to target', () async { final FileSystem fileSystem = MemoryFileSystem.test(); fileSystem.directory('inputs/foo').createSync(recursive: true); // Should be copied. fileSystem.file('inputs/a.txt').createSync(); fileSystem.file('inputs/b.txt').createSync(); fileSystem.file('foo/c.txt').createSync(recursive: true); // Should not be copied. fileSystem.file('inputs/d.txt').createSync(); final Depfile depfile = unpackDesktopArtifacts( fileSystem: fileSystem, engineSourcePath: 'inputs', outputDirectory: fileSystem.directory('outputs'), artifacts: <String>[ 'a.txt', 'b.txt', ], clientSourcePaths: <String>['foo'], ); // Files are copied expect(fileSystem.file('outputs/a.txt'), exists); expect(fileSystem.file('outputs/b.txt'), exists); expect(fileSystem.file('outputs/foo/c.txt'), exists); expect(fileSystem.file('outputs/d.txt'), isNot(exists)); // Depfile is correct. expect(depfile.inputs.map((File file) => file.path), unorderedEquals(<String>[ 'inputs/a.txt', 'inputs/b.txt', 'foo/c.txt', ])); expect(depfile.outputs.map((File file) => file.path), unorderedEquals(<String>[ 'outputs/a.txt', 'outputs/b.txt', 'outputs/foo/c.txt', ])); }); testWithoutContext('unpackDesktopArtifacts throws when attempting to copy missing file', () async { final FileSystem fileSystem = MemoryFileSystem.test(); expect(() => unpackDesktopArtifacts( fileSystem: fileSystem, engineSourcePath: 'inputs', outputDirectory: fileSystem.directory('outputs'), artifacts: <String>[ 'a.txt', ], clientSourcePaths: <String>['foo'], ), throwsException); }); testWithoutContext('unpackDesktopArtifacts throws when attempting to copy missing directory', () async { final FileSystem fileSystem = MemoryFileSystem.test(); fileSystem.file('inputs/a.txt').createSync(recursive: true); expect(() => unpackDesktopArtifacts( fileSystem: fileSystem, engineSourcePath: 'inputs', outputDirectory: fileSystem.directory('outputs'), artifacts: <String>[ 'a.txt', ], clientSourcePaths: <String>['foo'], ), throwsException); }); testWithoutContext('unpackDesktopArtifacts does not require a client source path', () async { final FileSystem fileSystem = MemoryFileSystem.test(); fileSystem.file('inputs/a.txt').createSync(recursive: true); expect(() => unpackDesktopArtifacts( fileSystem: fileSystem, engineSourcePath: 'inputs', outputDirectory: fileSystem.directory('outputs'), artifacts: <String>[ 'a.txt', ], ), returnsNormally); }); }
flutter/packages/flutter_tools/test/general.shard/build_system/targets/desktop_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/build_system/targets/desktop_test.dart", "repo_id": "flutter", "token_count": 1204 }
856
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:args/args.dart'; import 'package:args/command_runner.dart'; 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/io.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/platform.dart'; import 'package:flutter_tools/src/base/process.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/build_system/build_system.dart'; import 'package:flutter_tools/src/commands/attach.dart'; import 'package:flutter_tools/src/commands/build.dart'; import 'package:flutter_tools/src/commands/build_aar.dart'; import 'package:flutter_tools/src/commands/build_apk.dart'; import 'package:flutter_tools/src/commands/build_appbundle.dart'; import 'package:flutter_tools/src/commands/build_ios.dart'; import 'package:flutter_tools/src/commands/build_ios_framework.dart'; import 'package:flutter_tools/src/commands/build_linux.dart'; import 'package:flutter_tools/src/commands/build_macos.dart'; import 'package:flutter_tools/src/commands/build_web.dart'; import 'package:flutter_tools/src/commands/build_windows.dart'; import 'package:flutter_tools/src/runner/flutter_command.dart'; import 'package:test/fake.dart'; import '../../src/common.dart'; import '../../src/context.dart'; import '../../src/fakes.dart'; import '../../src/test_build_system.dart'; class FakeTerminal extends Fake implements AnsiTerminal { FakeTerminal({this.stdinHasTerminal = true}); @override final bool stdinHasTerminal; } class FakeProcessInfo extends Fake implements ProcessInfo { @override int maxRss = 0; } void main() { testUsingContext('All build commands support null safety options', () { final FileSystem fileSystem = MemoryFileSystem.test(); final Platform platform = FakePlatform(); final BufferLogger logger = BufferLogger.test(); final List<FlutterCommand> commands = <FlutterCommand>[ BuildWindowsCommand(logger: BufferLogger.test(), operatingSystemUtils: FakeOperatingSystemUtils()), BuildLinuxCommand(logger: BufferLogger.test(), operatingSystemUtils: FakeOperatingSystemUtils()), BuildMacosCommand(logger: BufferLogger.test(), verboseHelp: false), BuildWebCommand(fileSystem: fileSystem, logger: BufferLogger.test(), verboseHelp: false), BuildApkCommand(logger: BufferLogger.test()), BuildIOSCommand(logger: BufferLogger.test(), verboseHelp: false), BuildIOSArchiveCommand(logger: BufferLogger.test(), verboseHelp: false), BuildAppBundleCommand(logger: BufferLogger.test()), BuildAarCommand( logger: BufferLogger.test(), androidSdk: FakeAndroidSdk(), fileSystem: fileSystem, verboseHelp: false, ), BuildIOSFrameworkCommand( logger: BufferLogger.test(), verboseHelp: false, buildSystem: FlutterBuildSystem( fileSystem: fileSystem, platform: platform, logger: logger, ), ), AttachCommand( stdio: FakeStdio(), logger: logger, terminal: FakeTerminal(), signals: Signals.test(), platform: platform, processInfo: FakeProcessInfo(), fileSystem: MemoryFileSystem.test(), ), ]; for (final FlutterCommand command in commands) { final ArgResults results = command.argParser.parse(<String>[ '--sound-null-safety', '--enable-experiment=non-nullable', ]); expect(results.wasParsed('sound-null-safety'), true); expect(results.wasParsed('enable-experiment'), true); } }); testUsingContext('BuildSubCommand displays current null safety mode', () async { const BuildInfo unsound = BuildInfo( BuildMode.debug, '', nullSafetyMode: NullSafetyMode.unsound, treeShakeIcons: false, ); final BufferLogger logger = BufferLogger.test(); FakeBuildSubCommand(logger).test(unsound); expect(logger.statusText, contains('Building without sound null safety ⚠️')); }); testUsingContext('Include only supported sub commands', () { final BufferLogger logger = BufferLogger.test(); final ProcessUtils processUtils = ProcessUtils( logger: logger, processManager: FakeProcessManager.empty(), ); final MemoryFileSystem fs = MemoryFileSystem.test(); final BuildCommand command = BuildCommand( artifacts: Artifacts.test(fileSystem: fs), androidSdk: FakeAndroidSdk(), buildSystem: TestBuildSystem.all(BuildResult(success: true)), fileSystem: fs, logger: logger, processUtils: processUtils, osUtils: FakeOperatingSystemUtils(), ); for (final Command<void> x in command.subcommands.values) { expect((x as BuildSubCommand).supported, isTrue); } }); } class FakeBuildSubCommand extends BuildSubCommand { FakeBuildSubCommand(Logger logger) : super(logger: logger, verboseHelp: false); @override String get description => throw UnimplementedError(); @override String get name => throw UnimplementedError(); void test(BuildInfo buildInfo) { displayNullSafetyMode(buildInfo); } @override Future<FlutterCommandResult> runCommand() { throw UnimplementedError(); } }
flutter/packages/flutter_tools/test/general.shard/commands/build_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/commands/build_test.dart", "repo_id": "flutter", "token_count": 2001 }
857
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/convert.dart'; import 'package:flutter_tools/src/daemon.dart'; import '../src/common.dart'; class FakeDaemonStreams implements DaemonStreams { final StreamController<DaemonMessage> inputs = StreamController<DaemonMessage>(); final StreamController<DaemonMessage> outputs = StreamController<DaemonMessage>(); @override Stream<DaemonMessage> get inputStream { return inputs.stream; } @override void send(Map<String, dynamic> message, [ List<int>? binary ]) { outputs.add(DaemonMessage(message, binary != null ? Stream<List<int>>.value(binary) : null)); } @override Future<void> dispose() async { await inputs.close(); // In some tests, outputs have no listeners. We don't wait for outputs to close. unawaited(outputs.close()); } } void main() { late BufferLogger bufferLogger; late FakeDaemonStreams daemonStreams; late DaemonConnection daemonConnection; setUp(() { bufferLogger = BufferLogger.test(); daemonStreams = FakeDaemonStreams(); daemonConnection = DaemonConnection( daemonStreams: daemonStreams, logger: bufferLogger, ); }); tearDown(() async { await daemonConnection.dispose(); }); group('DaemonConnection receiving end', () { testWithoutContext('redirects input to incoming commands', () async { final Map<String, dynamic> commandToSend = <String, dynamic>{'id': 0, 'method': 'some_method'}; daemonStreams.inputs.add(DaemonMessage(commandToSend)); final DaemonMessage commandReceived = await daemonConnection.incomingCommands.first; await daemonStreams.dispose(); expect(commandReceived.data, commandToSend); }); testWithoutContext('listenToEvent can receive the right events', () async { final Future<List<DaemonEventData>> events = daemonConnection.listenToEvent('event1').toList(); daemonStreams.inputs.add(DaemonMessage(<String, dynamic>{'event': 'event1', 'params': '1'})); daemonStreams.inputs.add(DaemonMessage(<String, dynamic>{'event': 'event2', 'params': '2'})); daemonStreams.inputs.add(DaemonMessage(<String, dynamic>{'event': 'event1', 'params': null})); daemonStreams.inputs.add(DaemonMessage(<String, dynamic>{'event': 'event1', 'params': 3})); await pumpEventQueue(); await daemonConnection.dispose(); expect((await events).map((DaemonEventData event) => event.data).toList(), <dynamic>['1', null, 3]); }); }); group('DaemonConnection sending end', () { testWithoutContext('sending requests', () async { unawaited(daemonConnection.sendRequest('some_method', 'param')); final DaemonMessage message = await daemonStreams.outputs.stream.first; expect(message.data['id'], isNotNull); expect(message.data['method'], 'some_method'); expect(message.data['params'], 'param'); }); testWithoutContext('sending requests without param', () async { unawaited(daemonConnection.sendRequest('some_method')); final DaemonMessage message = await daemonStreams.outputs.stream.first; expect(message.data['id'], isNotNull); expect(message.data['method'], 'some_method'); expect(message.data['params'], isNull); }); testWithoutContext('sending response', () async { daemonConnection.sendResponse('1', 'some_data'); final DaemonMessage message = await daemonStreams.outputs.stream.first; expect(message.data['id'], '1'); expect(message.data['method'], isNull); expect(message.data['error'], isNull); expect(message.data['result'], 'some_data'); }); testWithoutContext('sending response without data', () async { daemonConnection.sendResponse('1'); final DaemonMessage message = await daemonStreams.outputs.stream.first; expect(message.data['id'], '1'); expect(message.data['method'], isNull); expect(message.data['error'], isNull); expect(message.data['result'], isNull); }); testWithoutContext('sending error response', () async { daemonConnection.sendErrorResponse('1', 'error', StackTrace.fromString('stack trace')); final DaemonMessage message = await daemonStreams.outputs.stream.first; expect(message.data['id'], '1'); expect(message.data['method'], isNull); expect(message.data['error'], 'error'); expect(message.data['trace'], 'stack trace'); }); testWithoutContext('sending events', () async { daemonConnection.sendEvent('some_event', '123'); final DaemonMessage message = await daemonStreams.outputs.stream.first; expect(message.data['id'], isNull); expect(message.data['event'], 'some_event'); expect(message.data['params'], '123'); }); testWithoutContext('sending events without params', () async { daemonConnection.sendEvent('some_event'); final DaemonMessage message = await daemonStreams.outputs.stream.first; expect(message.data['id'], isNull); expect(message.data['event'], 'some_event'); expect(message.data['params'], isNull); }); }); group('DaemonConnection request and response', () { testWithoutContext('receiving response from requests', () async { final Future<dynamic> requestFuture = daemonConnection.sendRequest('some_method', 'param'); final DaemonMessage message = await daemonStreams.outputs.stream.first; expect(message.data['id'], isNotNull); expect(message.data['method'], 'some_method'); expect(message.data['params'], 'param'); final String id = message.data['id']! as String; daemonStreams.inputs.add(DaemonMessage(<String, dynamic>{'id': id, 'result': '123'})); expect(await requestFuture, '123'); }); testWithoutContext('receiving response from requests without result', () async { final Future<dynamic> requestFuture = daemonConnection.sendRequest('some_method', 'param'); final DaemonMessage message = await daemonStreams.outputs.stream.first; expect(message.data['id'], isNotNull); expect(message.data['method'], 'some_method'); expect(message.data['params'], 'param'); final String id = message.data['id']! as String; daemonStreams.inputs.add(DaemonMessage(<String, dynamic>{'id': id})); expect(await requestFuture, null); }); testWithoutContext('receiving error response from requests without result', () async { final Future<dynamic> requestFuture = daemonConnection.sendRequest('some_method', 'param'); final DaemonMessage message = await daemonStreams.outputs.stream.first; expect(message.data['id'], isNotNull); expect(message.data['method'], 'some_method'); expect(message.data['params'], 'param'); final String id = message.data['id']! as String; daemonStreams.inputs.add(DaemonMessage(<String, dynamic>{'id': id, 'error': 'some_error', 'trace': 'stack trace'})); Object? gotError; StackTrace? gotStackTrace; try { await requestFuture; } on Object catch (error, stackTrace) { gotError = error; gotStackTrace = stackTrace; } expect(gotError, 'some_error'); expect(gotStackTrace.toString(), 'stack trace'); }); }); group('DaemonInputStreamConverter', () { Map<String, Object?> testCommand(int id, [int? binarySize]) => <String, Object?>{ 'id': id, 'method': 'test', if (binarySize != null) '_binaryLength': binarySize, }; List<int> testCommandBinary(int id, [int? binarySize]) => utf8.encode('[${json.encode(testCommand(id, binarySize))}]\n'); testWithoutContext('can parse a single message', () async { final Stream<List<int>> inputStream = Stream<List<int>>.fromIterable(<List<int>>[ testCommandBinary(10), ]); final DaemonInputStreamConverter converter = DaemonInputStreamConverter(inputStream); final Stream<DaemonMessage> outputStream = converter.convertedStream; final List<DaemonMessage> outputs = await outputStream.toList(); expect(outputs, hasLength(1)); expect(outputs[0].data, testCommand(10)); expect(outputs[0].binary, null); }); testWithoutContext('can parse multiple messages', () async { final Stream<List<int>> inputStream = Stream<List<int>>.fromIterable(<List<int>>[ testCommandBinary(10), testCommandBinary(20), ]); final DaemonInputStreamConverter converter = DaemonInputStreamConverter(inputStream); final Stream<DaemonMessage> outputStream = converter.convertedStream; final List<DaemonMessage> outputs = await outputStream.toList(); expect(outputs, hasLength(2)); expect(outputs[0].data, testCommand(10)); expect(outputs[0].binary, null); expect(outputs[1].data, testCommand(20)); expect(outputs[1].binary, null); }); testWithoutContext('can parse multiple messages while ignoring non json data in between', () async { final Stream<List<int>> inputStream = Stream<List<int>>.fromIterable(<List<int>>[ testCommandBinary(10), utf8.encode('This is not a json data...\n'), testCommandBinary(20), ]); final DaemonInputStreamConverter converter = DaemonInputStreamConverter(inputStream); final Stream<DaemonMessage> outputStream = converter.convertedStream; final List<DaemonMessage> outputs = await outputStream.toList(); expect(outputs, hasLength(2)); expect(outputs[0].data, testCommand(10)); expect(outputs[0].binary, null); expect(outputs[1].data, testCommand(20)); expect(outputs[1].binary, null); }); testWithoutContext('can parse multiple messages even when they are split in multiple packets', () async { final List<int> binary1 = testCommandBinary(10); final List<int> binary2 = testCommandBinary(20); final Stream<List<int>> inputStream = Stream<List<int>>.fromIterable(<List<int>>[ binary1.sublist(0, 5), binary1.sublist(5, 15), binary1.sublist(15) + binary2.sublist(0, 13), binary2.sublist(13), ]); final DaemonInputStreamConverter converter = DaemonInputStreamConverter(inputStream); final Stream<DaemonMessage> outputStream = converter.convertedStream; final List<DaemonMessage> outputs = await outputStream.toList(); expect(outputs, hasLength(2)); expect(outputs[0].data, testCommand(10)); expect(outputs[0].binary, null); expect(outputs[1].data, testCommand(20)); expect(outputs[1].binary, null); }); testWithoutContext('can parse multiple messages even when they are combined in a single packet', () async { final List<int> binary1 = testCommandBinary(10); final List<int> binary2 = testCommandBinary(20); final Stream<List<int>> inputStream = Stream<List<int>>.fromIterable(<List<int>>[ binary1 + binary2, ]); final DaemonInputStreamConverter converter = DaemonInputStreamConverter(inputStream); final Stream<DaemonMessage> outputStream = converter.convertedStream; final List<DaemonMessage> outputs = await outputStream.toList(); expect(outputs, hasLength(2)); expect(outputs[0].data, testCommand(10)); expect(outputs[0].binary, null); expect(outputs[1].data, testCommand(20)); expect(outputs[1].binary, null); }); testWithoutContext('can parse a single message with binary stream', () async { final List<int> binary = <int>[1,2,3,4,5]; final Stream<List<int>> inputStream = Stream<List<int>>.fromIterable(<List<int>>[ testCommandBinary(10, binary.length), binary, ]); final DaemonInputStreamConverter converter = DaemonInputStreamConverter(inputStream); final Stream<DaemonMessage> outputStream = converter.convertedStream; final List<_DaemonMessageAndBinary> allOutputs = await _readAllBinaries(outputStream); expect(allOutputs, hasLength(1)); expect(allOutputs[0].message.data, testCommand(10, binary.length)); expect(allOutputs[0].binary, binary); }); testWithoutContext('can parse a single message with binary stream when messages are combined in a single packet', () async { final List<int> binary = <int>[1,2,3,4,5]; final Stream<List<int>> inputStream = Stream<List<int>>.fromIterable(<List<int>>[ testCommandBinary(10, binary.length) + binary, ]); final DaemonInputStreamConverter converter = DaemonInputStreamConverter(inputStream); final Stream<DaemonMessage> outputStream = converter.convertedStream; final List<_DaemonMessageAndBinary> allOutputs = await _readAllBinaries(outputStream); expect(allOutputs, hasLength(1)); expect(allOutputs[0].message.data, testCommand(10, binary.length)); expect(allOutputs[0].binary, binary); }); testWithoutContext('can parse multiple messages with binary stream', () async { final List<int> binary1 = <int>[1,2,3,4,5]; final List<int> binary2 = <int>[6,7,8,9,10,11,12]; final Stream<List<int>> inputStream = Stream<List<int>>.fromIterable(<List<int>>[ testCommandBinary(10, binary1.length), binary1, testCommandBinary(20, binary2.length), binary2, ]); final DaemonInputStreamConverter converter = DaemonInputStreamConverter(inputStream); final Stream<DaemonMessage> outputStream = converter.convertedStream; final List<_DaemonMessageAndBinary> allOutputs = await _readAllBinaries(outputStream); expect(allOutputs, hasLength(2)); expect(allOutputs[0].message.data, testCommand(10, binary1.length)); expect(allOutputs[0].binary, binary1); expect(allOutputs[1].message.data, testCommand(20, binary2.length)); expect(allOutputs[1].binary, binary2); }); testWithoutContext('can parse multiple messages with binary stream when messages are split', () async { final List<int> binary1 = <int>[1,2,3,4,5]; final List<int> message1 = testCommandBinary(10, binary1.length); final List<int> binary2 = <int>[6,7,8,9,10,11,12]; final List<int> message2 = testCommandBinary(20, binary2.length); final Stream<List<int>> inputStream = Stream<List<int>>.fromIterable(<List<int>>[ message1.sublist(0, 10), message1.sublist(10) + binary1 + message2.sublist(0, 5), message2.sublist(5) + binary2.sublist(0, 3), binary2.sublist(3, 5), binary2.sublist(5), ]); final DaemonInputStreamConverter converter = DaemonInputStreamConverter(inputStream); final Stream<DaemonMessage> outputStream = converter.convertedStream; final List<_DaemonMessageAndBinary> allOutputs = await _readAllBinaries(outputStream); expect(allOutputs, hasLength(2)); expect(allOutputs[0].message.data, testCommand(10, binary1.length)); expect(allOutputs[0].binary, binary1); expect(allOutputs[1].message.data, testCommand(20, binary2.length)); expect(allOutputs[1].binary, binary2); }); }); group('DaemonStreams', () { final Map<String, Object?> testCommand = <String, Object?>{ 'id': 100, 'method': 'test', }; late StreamController<List<int>> inputStream; late StreamController<List<int>> outputStream; late DaemonStreams daemonStreams; setUp(() { inputStream = StreamController<List<int>>(); outputStream = StreamController<List<int>>(); daemonStreams = DaemonStreams(inputStream.stream, outputStream.sink, logger: bufferLogger); }); testWithoutContext('parses the message received on the stream', () async { inputStream.add(utf8.encode('[${jsonEncode(testCommand)}]\n')); final DaemonMessage command = await daemonStreams.inputStream.first; expect(command.data, testCommand); expect(command.binary, null); }); testWithoutContext('sends the encoded message through the sink', () async { daemonStreams.send(testCommand); final List<int> commands = await outputStream.stream.first; expect(commands, utf8.encode('[${jsonEncode(testCommand)}]\n')); }); testWithoutContext('dispose closes the sink', () async { await daemonStreams.dispose(); expect(outputStream.isClosed, true); }); testWithoutContext('handles sending to a closed sink', () async { // Unless the stream is listened to, the call to .close() will never // complete outputStream.stream.listen((List<int> _) {}); await outputStream.sink.close(); daemonStreams.send(testCommand); expect( bufferLogger.errorText, contains( 'Failed to write daemon command response: Bad state: Cannot add event after closing', ), ); }); }); } class _DaemonMessageAndBinary { _DaemonMessageAndBinary(this.message, this.binary); final DaemonMessage message; final List<int>? binary; } Future<List<_DaemonMessageAndBinary>> _readAllBinaries(Stream<DaemonMessage> inputStream) async { final StreamIterator<DaemonMessage> iterator = StreamIterator<DaemonMessage>(inputStream); final List<_DaemonMessageAndBinary> outputs = <_DaemonMessageAndBinary>[]; while (await iterator.moveNext()) { List<int>? binary; if (iterator.current.binary != null) { binary = await iterator.current.binary!.reduce((List<int> a, List<int> b) => a + b); } outputs.add(_DaemonMessageAndBinary(iterator.current, binary)); } return outputs; }
flutter/packages/flutter_tools/test/general.shard/daemon_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/daemon_test.dart", "repo_id": "flutter", "token_count": 6363 }
858
// 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:flutter_tools/src/base/io.dart'; import 'package:flutter_tools/src/convert.dart' show utf8; import '../src/common.dart'; import '../src/fake_process_manager.dart'; void main() { group(FakeProcess, () { testWithoutContext('exits with specified exit code', () async { final FakeProcess process = FakeProcess(exitCode: 42); expect(await process.exitCode, 42); }); testWithoutContext('exits with specified stderr, stdout', () async { final FakeProcess process = FakeProcess( stderr: 'stderr\u{FFFD}'.codeUnits, stdout: 'stdout\u{FFFD}'.codeUnits, ); await process.exitCode; // Verify that no encoding changes have been applied to output. // // In the past, we had hardcoded UTF-8 encoding for these streams in // FakeProcess. When a specific encoding is desired, it can be specified // on FakeCommand or in the encoding parameter of FakeProcessManager.run // or FakeProcessManager.runAsync. expect((await process.stderr.toList()).expand((List<int> x) => x), 'stderr\u{FFFD}'.codeUnits); expect((await process.stdout.toList()).expand((List<int> x) => x), 'stdout\u{FFFD}'.codeUnits); }); testWithoutContext('exits after specified delay (if no completer specified)', () { final bool done = FakeAsync().run<bool>((FakeAsync time) { final FakeProcess process = FakeProcess( duration: const Duration(seconds: 30), ); bool hasExited = false; unawaited(process.exitCode.then((int _) { hasExited = true; })); // Verify process hasn't exited before specified delay. time.elapse(const Duration(seconds: 15)); expect(hasExited, isFalse); // Verify process has exited after specified delay. time.elapse(const Duration(seconds: 20)); expect(hasExited, isTrue); return true; }); expect(done, isTrue); }); testWithoutContext('exits when completer completes (if no duration specified)', () { final bool done = FakeAsync().run<bool>((FakeAsync time) { final Completer<void> completer = Completer<void>(); final FakeProcess process = FakeProcess( completer: completer, ); bool hasExited = false; unawaited(process.exitCode.then((int _) { hasExited = true; })); // Verify process hasn't exited when all async tasks flushed. time.elapse(Duration.zero); expect(hasExited, isFalse); // Verify process has exited after completer completes. completer.complete(); time.flushMicrotasks(); expect(hasExited, isTrue); return true; }); expect(done, isTrue); }); testWithoutContext('when completer and duration are specified, does not exit until completer is completed', () { final bool done = FakeAsync().run<bool>((FakeAsync time) { final Completer<void> completer = Completer<void>(); final FakeProcess process = FakeProcess( duration: const Duration(seconds: 30), completer: completer, ); bool hasExited = false; unawaited(process.exitCode.then((int _) { hasExited = true; })); // Verify process hasn't exited before specified delay. time.elapse(const Duration(seconds: 15)); expect(hasExited, isFalse); // Verify process hasn't exited until the completer completes. time.elapse(const Duration(seconds: 20)); expect(hasExited, isFalse); // Verify process exits after the completer completes. completer.complete(); time.flushMicrotasks(); expect(hasExited, isTrue); return true; }); expect(done, isTrue); }); testWithoutContext('when completer and duration are specified, does not exit until duration has elapsed', () { final bool done = FakeAsync().run<bool>((FakeAsync time) { final Completer<void> completer = Completer<void>(); final FakeProcess process = FakeProcess( duration: const Duration(seconds: 30), completer: completer, ); bool hasExited = false; unawaited(process.exitCode.then((int _) { hasExited = true; })); // Verify process hasn't exited before specified delay. time.elapse(const Duration(seconds: 15)); expect(hasExited, isFalse); // Verify process does not exit until duration has elapsed. completer.complete(); expect(hasExited, isFalse); // Verify process exits after the duration elapses. time.elapse(const Duration(seconds: 20)); expect(hasExited, isTrue); return true; }); expect(done, isTrue); }); testWithoutContext('process exit is asynchronous', () async { final FakeProcess process = FakeProcess(); bool hasExited = false; unawaited(process.exitCode.then((int _) { hasExited = true; })); // Verify process hasn't completed. expect(hasExited, isFalse); // Flush async tasks. Verify process completes. await Future<void>.delayed(Duration.zero); expect(hasExited, isTrue); }); testWithoutContext('stderr, stdout stream data after exit when outputFollowsExit is true', () async { final FakeProcess process = FakeProcess( stderr: 'stderr'.codeUnits, stdout: 'stdout'.codeUnits, outputFollowsExit: true, ); final List<int> stderr = <int>[]; final List<int> stdout = <int>[]; process.stderr.listen(stderr.addAll); process.stdout.listen(stdout.addAll); // Ensure that no bytes have been received at process exit. await process.exitCode; expect(stderr, isEmpty); expect(stdout, isEmpty); // Flush all remaining async work. Ensure stderr, stdout is received. await Future<void>.delayed(Duration.zero); expect(stderr, 'stderr'.codeUnits); expect(stdout, 'stdout'.codeUnits); }); }); group(FakeProcessManager, () { late FakeProcessManager manager; setUp(() { manager = FakeProcessManager.empty(); }); group('start', () { testWithoutContext('can run a fake command', () async { manager.addCommand(const FakeCommand(command: <String>['faketool'])); final Process process = await manager.start(<String>['faketool']); expect(await process.exitCode, 0); expect(await utf8.decodeStream(process.stdout), isEmpty); expect(await utf8.decodeStream(process.stderr), isEmpty); }); testWithoutContext('outputFollowsExit delays stderr, stdout until after process exit', () async { manager.addCommand(const FakeCommand( command: <String>['faketool'], stderr: 'hello', stdout: 'world', outputFollowsExit: true, )); final List<int> stderrBytes = <int>[]; final List<int> stdoutBytes = <int>[]; // Start the process. final Process process = await manager.start(<String>['faketool']); final StreamSubscription<List<int>> stderrSubscription = process.stderr.listen((List<int> chunk) { stderrBytes.addAll(chunk); }); final StreamSubscription<List<int>> stdoutSubscription = process.stdout.listen((List<int> chunk) { stdoutBytes.addAll(chunk); }); // Immediately after exit, no output is emitted. await process.exitCode; expect(utf8.decode(stderrBytes), isEmpty); expect(utf8.decode(stdoutBytes), isEmpty); // Output is emitted asynchronously after process exit. await Future.wait(<Future<void>>[ stderrSubscription.asFuture(), stdoutSubscription.asFuture(), ]); expect(utf8.decode(stderrBytes), 'hello'); expect(utf8.decode(stdoutBytes), 'world'); // Clean up stream subscriptions. await stderrSubscription.cancel(); await stdoutSubscription.cancel(); }); }); group('run', () { testWithoutContext('can run a fake command', () async { manager.addCommand(const FakeCommand(command: <String>['faketool'])); final ProcessResult result = await manager.run(<String>['faketool']); expect(result.exitCode, 0); expect(result.stdout, isEmpty); expect(result.stderr, isEmpty); }); testWithoutContext('stderr, stdout are String if encoding is unspecified', () async { manager.addCommand(const FakeCommand(command: <String>['faketool'])); final ProcessResult result = await manager.run(<String>['faketool']); expect(result.exitCode, 0); expect(result.stdout, isA<String>()); expect(result.stderr, isA<String>()); }); testWithoutContext('stderr, stdout are List<int> if encoding is null', () async { manager.addCommand(const FakeCommand(command: <String>['faketool'])); final ProcessResult result = await manager.run( <String>['faketool'], stderrEncoding: null, stdoutEncoding: null, ); expect(result.exitCode, 0); expect(result.stdout, isA<List<int>>()); expect(result.stderr, isA<List<int>>()); }); testWithoutContext('stderr, stdout are String if encoding is specified', () async { manager.addCommand(const FakeCommand(command: <String>['faketool'])); final ProcessResult result = await manager.run( <String>['faketool'], stderrEncoding: utf8, stdoutEncoding: utf8, ); expect(result.exitCode, 0); expect(result.stdout, isA<String>()); expect(result.stderr, isA<String>()); }); }); group('runSync', () { testWithoutContext('can run a fake command', () { manager.addCommand(const FakeCommand(command: <String>['faketool'])); final ProcessResult result = manager.runSync(<String>['faketool']); expect(result.exitCode, 0); expect(result.stdout, isEmpty); expect(result.stderr, isEmpty); }); testWithoutContext('stderr, stdout are String if encoding is unspecified', () { manager.addCommand(const FakeCommand(command: <String>['faketool'])); final ProcessResult result = manager.runSync(<String>['faketool']); expect(result.exitCode, 0); expect(result.stdout, isA<String>()); expect(result.stderr, isA<String>()); }); testWithoutContext('stderr, stdout are List<int> if encoding is null', () { manager.addCommand(const FakeCommand(command: <String>['faketool'])); final ProcessResult result = manager.runSync( <String>['faketool'], stderrEncoding: null, stdoutEncoding: null, ); expect(result.exitCode, 0); expect(result.stdout, isA<List<int>>()); expect(result.stderr, isA<List<int>>()); }); testWithoutContext('stderr, stdout are String if encoding is specified', () { manager.addCommand(const FakeCommand(command: <String>['faketool'])); final ProcessResult result = manager.runSync( <String>['faketool'], stderrEncoding: utf8, stdoutEncoding: utf8, ); expect(result.exitCode, 0); expect(result.stdout, isA<String>()); expect(result.stderr, isA<String>()); }); }); }); }
flutter/packages/flutter_tools/test/general.shard/fake_process_manager_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/fake_process_manager_test.dart", "repo_id": "flutter", "token_count": 4613 }
859
// 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 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/devfs.dart'; import 'package:flutter_tools/src/project.dart'; import 'package:flutter_tools/src/reporting/github_template.dart'; import '../src/common.dart'; import '../src/context.dart'; void main() { late BufferLogger logger; late FileSystem fs; setUp(() { logger = BufferLogger.test(); fs = MemoryFileSystem.test(); }); group('GitHub template creator', () { testWithoutContext('similar issues URL', () { expect( GitHubTemplateCreator.toolCrashSimilarIssuesURL('this is a 100% error'), 'https://github.com/flutter/flutter/issues?q=is%3Aissue+this+is+a+100%25+error', ); }); group('sanitized error message', () { testWithoutContext('ProcessException', () { expect( GitHubTemplateCreator.sanitizedCrashException( const ProcessException('cd', <String>['path/to/something']) ), 'ProcessException: Command: cd, OS error code: 0', ); expect( GitHubTemplateCreator.sanitizedCrashException( const ProcessException('cd', <String>['path/to/something'], 'message') ), 'ProcessException: message Command: cd, OS error code: 0', ); expect( GitHubTemplateCreator.sanitizedCrashException( const ProcessException('cd', <String>['path/to/something'], 'message', -19) ), 'ProcessException: message Command: cd, OS error code: -19', ); }); testWithoutContext('FileSystemException', () { expect( GitHubTemplateCreator.sanitizedCrashException( const FileSystemException('delete failed', 'path/to/something') ), 'FileSystemException: delete failed, null', ); expect( GitHubTemplateCreator.sanitizedCrashException( const FileSystemException('delete failed', 'path/to/something', OSError('message', -19)) ), 'FileSystemException: delete failed, OS Error: message, errno = -19', ); }); testWithoutContext('SocketException', () { expect( GitHubTemplateCreator.sanitizedCrashException( SocketException( 'message', osError: const OSError('message', -19), address: InternetAddress.anyIPv6, port: 2000 ) ), 'SocketException: message, OS Error: message, errno = -19', ); }); testWithoutContext('DevFSException', () { final StackTrace stackTrace = StackTrace.fromString(''' #0 _File.open.<anonymous closure> (dart:io/file_impl.dart:366:9) #1 _rootRunUnary (dart:async/zone.dart:1141:38)'''); expect( GitHubTemplateCreator.sanitizedCrashException( DevFSException('message', ArgumentError('argument error message'), stackTrace) ), 'DevFSException: message', ); }); testWithoutContext('ArgumentError', () { expect( GitHubTemplateCreator.sanitizedCrashException( ArgumentError('argument error message') ), 'ArgumentError: Invalid argument(s): argument error message', ); }); testWithoutContext('Error', () { expect( GitHubTemplateCreator.sanitizedCrashException( FakeError() ), 'FakeError: (#0 _File.open.<anonymous closure> (dart:io/file_impl.dart:366:9))', ); }); testWithoutContext('String', () { expect( GitHubTemplateCreator.sanitizedCrashException( 'May have non-tool-internal info, very long string, 0b8abb4724aa590dd0f429683339b' // ignore: missing_whitespace_between_adjacent_strings '24aa590dd0f429683339b1e045a1594d0b8abb4724aa590dd0f429683339b1e045a1594d0b8abb' '24aa590dd0f429683339b1e045a1594d0b8abb4724aa590dd0f429683339b1e045a1594d0b8abb' '24aa590dd0f429683339b1e045a1594d0b8abb4724aa590dd0f429683339b1e045a1594d0b8abb' '24aa590dd0f429683339b1e045a1594d0b8abb4724aa590dd0f429683339b1e045a1594d0b8abb' '24aa590dd0f429683339b1e045a1594d0b8abb4724aa590dd0f429683339b1e045a1594d0b8abb' '24aa590dd0f429683339b1e045a1594d0b8abb4724aa590dd0f429683339b1e045a1594d0b8abb' '24aa590dd0f429683339b1e045a1594d0b8abb4724aa590dd0f429683339b1e045a1594d0b8abb' '24aa590dd0f429683339b1e045a1594d0b8abb4724aa590dd0f429683339b1e045a1594d0b8abb' '24aa590dd0f429683339b1e045a1594d0b8abb4724aa590dd0f429683339b1e045a1594d0b8abb' '24aa590dd0f429683339b1e045a1594d0b8abb4724aa590dd0f429683339b1e045a1594d0b8abb' '24aa590dd0f429683339b1e045a1594d0b8abb4724aa590dd0f429683339b1e045a1594d0b8abb' '24aa590dd0f429683339b1e045a1594d0b8abb4724aa590dd0f429683339b1e045a1594d0b8abb' ), 'String: <1,016 characters>', ); }); testWithoutContext('Exception', () { expect( GitHubTemplateCreator.sanitizedCrashException( Exception('May have non-tool-internal info') ), '_Exception', ); }); }); group('new issue template URL', () { late StackTrace stackTrace; late Error error; const String command = 'flutter test'; const String doctorText = ' [✓] Flutter (Channel report'; setUp(() async { stackTrace = StackTrace.fromString('trace'); error = ArgumentError('argument error message'); }); testUsingContext('shows GitHub issue URL', () async { final GitHubTemplateCreator creator = GitHubTemplateCreator( fileSystem: fs, logger: logger, flutterProjectFactory: FlutterProjectFactory( fileSystem: fs, logger: logger, ), ); expect( await creator.toolCrashIssueTemplateGitHubURL(command, error, stackTrace, doctorText), 'https://github.com/flutter/flutter/issues/new?title=%5Btool_crash%5D+ArgumentError%3A+' 'Invalid+argument%28s%29%3A+argument+error+message&body=%23%23+Command%0A%60%60%60%0A' 'flutter+test%0A%60%60%60%0A%0A%23%23+Steps+to+Reproduce%0A1.+...%0A2.+...%0A3.+...%0' 'A%0A%23%23+Logs%0AArgumentError%3A+Invalid+argument%28s%29%3A+argument+error+message' '%0A%60%60%60%0Atrace%0A%60%60%60%0A%60%60%60%0A+%5B%E2%9C%93%5D+Flutter+%28Channel+r' 'eport%0A%60%60%60%0A%0A%23%23+Flutter+Application+Metadata%0ANo+pubspec+in+working+d' 'irectory.%0A&labels=tool%2Csevere%3A+crash' ); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('app metadata', () async { final GitHubTemplateCreator creator = GitHubTemplateCreator( fileSystem: fs, logger: logger, flutterProjectFactory: FlutterProjectFactory( fileSystem: fs, logger: logger, ), ); final Directory projectDirectory = fs.currentDirectory; projectDirectory .childFile('pubspec.yaml') .writeAsStringSync(''' name: failing_app version: 2.0.1+100 flutter: uses-material-design: true module: androidX: true androidPackage: com.example.failing.android iosBundleIdentifier: com.example.failing.ios '''); final File pluginsFile = projectDirectory.childFile('.flutter-plugins'); pluginsFile .writeAsStringSync(''' camera=/fake/pub.dartlang.org/camera-0.5.7+2/ device_info=/fake/pub.dartlang.org/pub.dartlang.org/device_info-0.4.1+4/ '''); final File metadataFile = projectDirectory.childFile('.metadata'); metadataFile .writeAsStringSync(''' version: revision: 0b8abb4724aa590dd0f429683339b1e045a1594d channel: stable project_type: app '''); final String actualURL = await creator.toolCrashIssueTemplateGitHubURL(command, error, stackTrace, doctorText); final String? actualBody = Uri.parse(actualURL).queryParameters['body']; const String expectedBody = ''' ## Command ``` flutter test ``` ## Steps to Reproduce 1. ... 2. ... 3. ... ## Logs ArgumentError: Invalid argument(s): argument error message ``` trace ``` ``` [✓] Flutter (Channel report ``` ## Flutter Application Metadata **Type**: app **Version**: 2.0.1+100 **Material**: true **Android X**: true **Module**: true **Plugin**: false **Android package**: com.example.failing.android **iOS bundle identifier**: com.example.failing.ios **Creation channel**: stable **Creation framework version**: 0b8abb4724aa590dd0f429683339b1e045a1594d ### Plugins camera-0.5.7+2 device_info-0.4.1+4 '''; expect(actualBody, expectedBody); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); }); }); } class FakeError extends Error { @override StackTrace get stackTrace => StackTrace.fromString(''' #0 _File.open.<anonymous closure> (dart:io/file_impl.dart:366:9) #1 _rootRunUnary (dart:async/zone.dart:1141:38)'''); @override String toString() => 'PII to ignore'; }
flutter/packages/flutter_tools/test/general.shard/github_template_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/github_template_test.dart", "repo_id": "flutter", "token_count": 4375 }
860
// 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/logger.dart'; import 'package:flutter_tools/src/base/project_migrator.dart'; import 'package:flutter_tools/src/base/version.dart'; import 'package:flutter_tools/src/ios/migrations/host_app_info_plist_migration.dart'; import 'package:flutter_tools/src/ios/migrations/ios_deployment_target_migration.dart'; import 'package:flutter_tools/src/ios/migrations/project_base_configuration_migration.dart'; import 'package:flutter_tools/src/ios/migrations/project_build_location_migration.dart'; import 'package:flutter_tools/src/ios/migrations/remove_bitcode_migration.dart'; import 'package:flutter_tools/src/ios/migrations/remove_framework_link_and_embedding_migration.dart'; import 'package:flutter_tools/src/ios/migrations/xcode_build_system_migration.dart'; import 'package:flutter_tools/src/ios/xcodeproj.dart'; import 'package:flutter_tools/src/migrations/cocoapods_script_symlink.dart'; import 'package:flutter_tools/src/migrations/cocoapods_toolchain_directory_migration.dart'; import 'package:flutter_tools/src/migrations/xcode_project_object_version_migration.dart'; import 'package:flutter_tools/src/migrations/xcode_script_build_phase_migration.dart'; import 'package:flutter_tools/src/migrations/xcode_thin_binary_build_phase_input_paths_migration.dart'; import 'package:flutter_tools/src/reporting/reporting.dart'; import 'package:flutter_tools/src/xcode_project.dart'; import 'package:test/fake.dart'; import 'package:unified_analytics/unified_analytics.dart'; import '../../src/common.dart'; import '../../src/fake_process_manager.dart'; import '../../src/fakes.dart'; void main () { group('iOS migration', () { late TestUsage testUsage; late FakeAnalytics fakeAnalytics; setUp(() { testUsage = TestUsage(); final MemoryFileSystem fs = MemoryFileSystem.test(); fakeAnalytics = getInitializedFakeAnalyticsInstance( fs: fs, fakeFlutterVersion: FakeFlutterVersion(), ); }); testWithoutContext('migrators succeed', () { final FakeIOSMigrator fakeIOSMigrator = FakeIOSMigrator(); final ProjectMigration migration = ProjectMigration(<ProjectMigrator>[fakeIOSMigrator]); migration.run(); }); group('remove framework linking and embedding migration', () { late MemoryFileSystem memoryFileSystem; late BufferLogger testLogger; late FakeIosProject project; late File xcodeProjectInfoFile; setUp(() { memoryFileSystem = MemoryFileSystem.test(); xcodeProjectInfoFile = memoryFileSystem.file('project.pbxproj'); testLogger = BufferLogger.test(); project = FakeIosProject(); project.xcodeProjectInfoFile = xcodeProjectInfoFile; }); testWithoutContext('skipped if files are missing', () { final RemoveFrameworkLinkAndEmbeddingMigration iosProjectMigration = RemoveFrameworkLinkAndEmbeddingMigration( project, testLogger, testUsage, fakeAnalytics, ); iosProjectMigration.migrate(); expect(testUsage.events, isEmpty); expect(fakeAnalytics.sentEvents, isEmpty); expect(xcodeProjectInfoFile.existsSync(), isFalse); expect(testLogger.traceText, contains('Xcode project not found, skipping framework link and embedding migration')); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if nothing to upgrade', () { const String contents = 'Nothing to upgrade'; xcodeProjectInfoFile.writeAsStringSync(contents); final DateTime projectLastModified = xcodeProjectInfoFile.lastModifiedSync(); final RemoveFrameworkLinkAndEmbeddingMigration iosProjectMigration = RemoveFrameworkLinkAndEmbeddingMigration( project, testLogger, testUsage, fakeAnalytics, ); iosProjectMigration.migrate(); expect(testUsage.events, isEmpty); expect(fakeAnalytics.sentEvents, isEmpty); expect(xcodeProjectInfoFile.lastModifiedSync(), projectLastModified); expect(xcodeProjectInfoFile.readAsStringSync(), contents); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skips migrating script with embed', () { const String contents = r''' shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed\n/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; '''; xcodeProjectInfoFile.writeAsStringSync(contents); final RemoveFrameworkLinkAndEmbeddingMigration iosProjectMigration = RemoveFrameworkLinkAndEmbeddingMigration( project, testLogger, testUsage, fakeAnalytics, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.readAsStringSync(), contents); expect(testLogger.statusText, isEmpty); }); testWithoutContext('Xcode project is migrated', () { xcodeProjectInfoFile.writeAsStringSync(r''' prefix 3B80C3941E831B6300D905FE 3B80C3951E831B6300D905FE suffix 741F496821356857001E2961 keep this 1 3B80C3931E831B6300D905FE spaces 741F496521356807001E2961 9705A1C61CF904A100538489 9705A1C71CF904A300538489 741F496221355F47001E2961 9740EEBA1CF902C7004384FC 741F495E21355F27001E2961 shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; keep this 2 '''); final RemoveFrameworkLinkAndEmbeddingMigration iosProjectMigration = RemoveFrameworkLinkAndEmbeddingMigration( project, testLogger, testUsage, fakeAnalytics, ); iosProjectMigration.migrate(); expect(testUsage.events, isEmpty); expect(fakeAnalytics.sentEvents, isEmpty); expect(xcodeProjectInfoFile.readAsStringSync(), r''' keep this 1 shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; keep this 2 '''); expect(testLogger.statusText, contains('Upgrading project.pbxproj')); }); testWithoutContext('migration fails with leftover App.framework reference', () { xcodeProjectInfoFile.writeAsStringSync(''' 746232531E83B71900CC1A5E /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 746232521E83B71900CC1A5E /* App.framework */; }; '''); final RemoveFrameworkLinkAndEmbeddingMigration iosProjectMigration = RemoveFrameworkLinkAndEmbeddingMigration( project, testLogger, testUsage, fakeAnalytics, ); expect(iosProjectMigration.migrate, throwsToolExit(message: 'Your Xcode project requires migration')); expect(testUsage.events, contains( const TestUsageEvent('ios-migration', 'remove-frameworks', label: 'failure'), )); expect(fakeAnalytics.sentEvents, contains( Event.appleUsageEvent( workflow: 'ios-migration', parameter: 'remove-frameworks', result: 'failure', ) )); }); testWithoutContext('migration fails with leftover Flutter.framework reference', () { xcodeProjectInfoFile.writeAsStringSync(''' 9705A1C71CF904A300538480 /* Flutter.framework in Embed Frameworks */, '''); final RemoveFrameworkLinkAndEmbeddingMigration iosProjectMigration = RemoveFrameworkLinkAndEmbeddingMigration( project, testLogger, testUsage, fakeAnalytics, ); expect(iosProjectMigration.migrate, throwsToolExit(message: 'Your Xcode project requires migration')); expect(testUsage.events, contains( const TestUsageEvent('ios-migration', 'remove-frameworks', label: 'failure'), )); expect(fakeAnalytics.sentEvents, contains( Event.appleUsageEvent( workflow: 'ios-migration', parameter: 'remove-frameworks', result: 'failure', ) )); }); testWithoutContext('migration fails without Xcode installed', () { xcodeProjectInfoFile.writeAsStringSync(''' 746232531E83B71900CC1A5E /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 746232521E83B71900CC1A5E /* App.framework */; }; '''); final RemoveFrameworkLinkAndEmbeddingMigration iosProjectMigration = RemoveFrameworkLinkAndEmbeddingMigration( project, testLogger, testUsage, fakeAnalytics, ); expect(iosProjectMigration.migrate, throwsToolExit(message: 'Your Xcode project requires migration')); expect(testUsage.events, contains( const TestUsageEvent('ios-migration', 'remove-frameworks', label: 'failure'), )); expect(fakeAnalytics.sentEvents, contains( Event.appleUsageEvent( workflow: 'ios-migration', parameter: 'remove-frameworks', result: 'failure', ) )); }); }); group('new Xcode build system', () { late MemoryFileSystem memoryFileSystem; late BufferLogger testLogger; late FakeIosProject project; late File xcodeWorkspaceSharedSettings; setUp(() { memoryFileSystem = MemoryFileSystem.test(); xcodeWorkspaceSharedSettings = memoryFileSystem.file('WorkspaceSettings.xcsettings'); testLogger = BufferLogger.test(); project = FakeIosProject(); project.xcodeWorkspaceSharedSettings = xcodeWorkspaceSharedSettings; }); testWithoutContext('skipped if files are missing', () { final XcodeBuildSystemMigration iosProjectMigration = XcodeBuildSystemMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeWorkspaceSharedSettings.existsSync(), isFalse); expect(testLogger.traceText, contains('Xcode workspace settings not found, skipping build system migration')); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if _xcodeWorkspaceSharedSettings is null', () { final XcodeBuildSystemMigration iosProjectMigration = XcodeBuildSystemMigration( project, testLogger, ); project.xcodeWorkspaceSharedSettings = null; iosProjectMigration.migrate(); expect(xcodeWorkspaceSharedSettings.existsSync(), isFalse); expect(testLogger.traceText, contains('Xcode workspace settings not found, skipping build system migration')); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if nothing to upgrade', () { const String contents = ''' <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>BuildSystemType</key> <string></string> </dict> </plist>'''; xcodeWorkspaceSharedSettings.writeAsStringSync(contents); final XcodeBuildSystemMigration iosProjectMigration = XcodeBuildSystemMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeWorkspaceSharedSettings.existsSync(), isTrue); expect(testLogger.statusText, isEmpty); }); testWithoutContext('Xcode project is migrated', () { const String contents = ''' <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>BuildSystemType</key> <string>Original</string> <key>PreviewsEnabled</key> <false/> </dict> </plist>'''; xcodeWorkspaceSharedSettings.writeAsStringSync(contents); final XcodeBuildSystemMigration iosProjectMigration = XcodeBuildSystemMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeWorkspaceSharedSettings.existsSync(), isFalse); expect(testLogger.statusText, contains('Legacy build system detected, removing')); }); }); group('Xcode default build location', () { late MemoryFileSystem memoryFileSystem; late BufferLogger testLogger; late FakeIosProject project; late File xcodeProjectWorkspaceData; setUp(() { memoryFileSystem = MemoryFileSystem(); xcodeProjectWorkspaceData = memoryFileSystem.file('contents.xcworkspacedata'); testLogger = BufferLogger.test(); project = FakeIosProject(); project.xcodeProjectWorkspaceData = xcodeProjectWorkspaceData; }); testWithoutContext('skipped if files are missing', () { final ProjectBuildLocationMigration iosProjectMigration = ProjectBuildLocationMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectWorkspaceData.existsSync(), isFalse); expect(testLogger.traceText, contains('Xcode project workspace data not found, skipping build location migration.')); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if nothing to upgrade', () { const String contents = ''' <?xml version="1.0" encoding="UTF-8"?> <Workspace version = "1.0"> <FileRef location = "self:"> </FileRef> </Workspace>'''; xcodeProjectWorkspaceData.writeAsStringSync(contents); final ProjectBuildLocationMigration iosProjectMigration = ProjectBuildLocationMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectWorkspaceData.existsSync(), isTrue); expect(testLogger.statusText, isEmpty); }); testWithoutContext('Xcode project is migrated', () { const String contents = ''' <?xml version="1.0" encoding="UTF-8"?> <Workspace version = "1.0"> <FileRef location = "group:Runner.xcodeproj"> </FileRef> <FileRef location = "group:Pods/Pods.xcodeproj"> </FileRef> </Workspace> '''; xcodeProjectWorkspaceData.writeAsStringSync(contents); final ProjectBuildLocationMigration iosProjectMigration = ProjectBuildLocationMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectWorkspaceData.readAsStringSync(), ''' <?xml version="1.0" encoding="UTF-8"?> <Workspace version = "1.0"> <FileRef location = "self:"> </FileRef> </Workspace> '''); expect(testLogger.statusText, contains('Upgrading contents.xcworkspacedata')); }); }); group('remove Runner project base configuration', () { late MemoryFileSystem memoryFileSystem; late BufferLogger testLogger; late FakeIosProject project; late File xcodeProjectInfoFile; setUp(() { memoryFileSystem = MemoryFileSystem(); xcodeProjectInfoFile = memoryFileSystem.file('project.pbxproj'); testLogger = BufferLogger.test(); project = FakeIosProject(); project.xcodeProjectInfoFile = xcodeProjectInfoFile; }); testWithoutContext('skipped if files are missing', () { final ProjectBaseConfigurationMigration iosProjectMigration = ProjectBaseConfigurationMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.existsSync(), isFalse); expect(testLogger.traceText, contains('Xcode project not found, skipping Runner project build settings and configuration migration')); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if nothing to upgrade', () { const String contents = 'Nothing to upgrade'; xcodeProjectInfoFile.writeAsStringSync(contents); final DateTime projectLastModified = xcodeProjectInfoFile.lastModifiedSync(); final ProjectBaseConfigurationMigration iosProjectMigration = ProjectBaseConfigurationMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.lastModifiedSync(), projectLastModified); expect(xcodeProjectInfoFile.readAsStringSync(), contents); expect(testLogger.statusText, isEmpty); }); testWithoutContext('Xcode project is migrated with template identifiers', () { xcodeProjectInfoFile.writeAsStringSync(''' 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; keep this 1 249021D3217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; keep this 2 97C147041CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; keep this 3 '''); final ProjectBaseConfigurationMigration iosProjectMigration = ProjectBaseConfigurationMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.readAsStringSync(), ''' 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; keep this 1 249021D3217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; keep this 2 97C147041CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; keep this 3 '''); expect(testLogger.statusText, contains('Project base configurations detected, removing.')); }); testWithoutContext('Xcode project is migrated with custom identifiers', () { xcodeProjectInfoFile.writeAsStringSync(''' 97C147031CF9000F007C1171 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 2436755321828D23008C7051 /* Profile */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 97C147041CF9000F007C1171 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; /* Begin XCConfigurationList section */ 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( 97C147031CF9000F007C1171 /* Debug */, 97C147041CF9000F007C1171 /* Release */, 2436755321828D23008C7051 /* Profile */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( 97C147061CF9000F007C117D /* Debug */, 97C147071CF9000F007C117D /* Release */, 2436755421828D23008C705F /* Profile */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ '''); final ProjectBaseConfigurationMigration iosProjectMigration = ProjectBaseConfigurationMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.readAsStringSync(), ''' 97C147031CF9000F007C1171 /* Debug */ = { isa = XCBuildConfiguration; 2436755321828D23008C7051 /* Profile */ = { isa = XCBuildConfiguration; 97C147041CF9000F007C1171 /* Release */ = { isa = XCBuildConfiguration; /* Begin XCConfigurationList section */ 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( 97C147031CF9000F007C1171 /* Debug */, 97C147041CF9000F007C1171 /* Release */, 2436755321828D23008C7051 /* Profile */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( 97C147061CF9000F007C117D /* Debug */, 97C147071CF9000F007C117D /* Release */, 2436755421828D23008C705F /* Profile */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ '''); expect(testLogger.statusText, contains('Project base configurations detected, removing.')); }); }); group('update deployment target version', () { late MemoryFileSystem memoryFileSystem; late BufferLogger testLogger; late FakeIosProject project; late File xcodeProjectInfoFile; late File appFrameworkInfoPlist; late File podfile; setUp(() { memoryFileSystem = MemoryFileSystem(); testLogger = BufferLogger.test(); project = FakeIosProject(); xcodeProjectInfoFile = memoryFileSystem.file('project.pbxproj'); project.xcodeProjectInfoFile = xcodeProjectInfoFile; appFrameworkInfoPlist = memoryFileSystem.file('AppFrameworkInfo.plist'); project.appFrameworkInfoPlist = appFrameworkInfoPlist; podfile = memoryFileSystem.file('Podfile'); project.podfile = podfile; }); testWithoutContext('skipped if files are missing', () { final IOSDeploymentTargetMigration iosProjectMigration = IOSDeploymentTargetMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.existsSync(), isFalse); expect(appFrameworkInfoPlist.existsSync(), isFalse); expect(podfile.existsSync(), isFalse); expect(testLogger.traceText, contains('Xcode project not found, skipping iOS deployment target version migration')); expect(testLogger.traceText, contains('AppFrameworkInfo.plist not found, skipping minimum OS version migration')); expect(testLogger.traceText, contains('Podfile not found, skipping global platform iOS version migration')); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if nothing to upgrade', () { const String xcodeProjectInfoFileContents = 'IPHONEOS_DEPLOYMENT_TARGET = 12.0;'; xcodeProjectInfoFile.writeAsStringSync(xcodeProjectInfoFileContents); const String appFrameworkInfoPlistContents = ''' <key>MinimumOSVersion</key> <string>12.0</string> '''; appFrameworkInfoPlist.writeAsStringSync(appFrameworkInfoPlistContents); final DateTime projectLastModified = xcodeProjectInfoFile.lastModifiedSync(); const String podfileFileContents = "# platform :ios, '12.0'"; podfile.writeAsStringSync(podfileFileContents); final DateTime podfileLastModified = podfile.lastModifiedSync(); final IOSDeploymentTargetMigration iosProjectMigration = IOSDeploymentTargetMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.lastModifiedSync(), projectLastModified); expect(xcodeProjectInfoFile.readAsStringSync(), xcodeProjectInfoFileContents); expect(appFrameworkInfoPlist.readAsStringSync(), appFrameworkInfoPlistContents); expect(podfile.lastModifiedSync(), podfileLastModified); expect(podfile.readAsStringSync(), podfileFileContents); expect(testLogger.statusText, isEmpty); }); testWithoutContext('Xcode project is migrated to 12', () { xcodeProjectInfoFile.writeAsStringSync(''' GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0; '''); appFrameworkInfoPlist.writeAsStringSync(''' <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1.0</string> <key>MinimumOSVersion</key> <string>8.0</string> <key>MinimumOSVersion</key> <string>11.0</string> <key>MinimumOSVersion</key> <string>12.0</string> </dict> </plist> '''); podfile.writeAsStringSync(''' # platform :ios, '9.0' platform :ios, '9.0' # platform :ios, '11.0' platform :ios, '11.0' '''); final IOSDeploymentTargetMigration iosProjectMigration = IOSDeploymentTargetMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.readAsStringSync(), ''' GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0; '''); expect(appFrameworkInfoPlist.readAsStringSync(), ''' <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1.0</string> <key>MinimumOSVersion</key> <string>12.0</string> <key>MinimumOSVersion</key> <string>12.0</string> <key>MinimumOSVersion</key> <string>12.0</string> </dict> </plist> '''); expect(podfile.readAsStringSync(), ''' # platform :ios, '12.0' platform :ios, '12.0' # platform :ios, '12.0' platform :ios, '12.0' '''); // Only print once even though 2 lines were changed. expect('Updating minimum iOS deployment target to 12.0'.allMatches(testLogger.statusText).length, 1); }); }); group('update Xcode project object version', () { late MemoryFileSystem memoryFileSystem; late BufferLogger testLogger; late FakeIosProject project; late File xcodeProjectInfoFile; late File xcodeProjectSchemeFile; setUp(() { memoryFileSystem = MemoryFileSystem(); testLogger = BufferLogger.test(); project = FakeIosProject(); xcodeProjectInfoFile = memoryFileSystem.file('project.pbxproj'); project.xcodeProjectInfoFile = xcodeProjectInfoFile; xcodeProjectSchemeFile = memoryFileSystem.file('Runner.xcscheme'); project.schemeFile = xcodeProjectSchemeFile; }); testWithoutContext('skipped if files are missing', () { final XcodeProjectObjectVersionMigration iosProjectMigration = XcodeProjectObjectVersionMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.existsSync(), isFalse); expect(xcodeProjectSchemeFile.existsSync(), isFalse); expect(testLogger.traceText, contains('Xcode project not found, skipping Xcode compatibility migration')); expect(testLogger.traceText, contains('Runner scheme not found, skipping Xcode compatibility migration')); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if nothing to upgrade', () { const String xcodeProjectInfoFileContents = ''' classes = { }; objectVersion = 54; objects = { attributes = { LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; '''; xcodeProjectInfoFile.writeAsStringSync(xcodeProjectInfoFileContents); const String xcodeProjectSchemeFileContents = ''' LastUpgradeVersion = "1510" '''; xcodeProjectSchemeFile.writeAsStringSync(xcodeProjectSchemeFileContents); final DateTime projectLastModified = xcodeProjectInfoFile.lastModifiedSync(); final XcodeProjectObjectVersionMigration iosProjectMigration = XcodeProjectObjectVersionMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.lastModifiedSync(), projectLastModified); expect(xcodeProjectInfoFile.readAsStringSync(), xcodeProjectInfoFileContents); expect(xcodeProjectSchemeFile.readAsStringSync(), xcodeProjectSchemeFileContents); expect(testLogger.statusText, isEmpty); }); testWithoutContext('Xcode project is migrated to newest objectVersion', () { xcodeProjectInfoFile.writeAsStringSync(''' classes = { }; objectVersion = 46; objects = { attributes = { LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; '''); xcodeProjectSchemeFile.writeAsStringSync(''' <Scheme LastUpgradeVersion = "1430" version = "1.3"> '''); final XcodeProjectObjectVersionMigration iosProjectMigration = XcodeProjectObjectVersionMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.readAsStringSync(), ''' classes = { }; objectVersion = 54; objects = { attributes = { LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; '''); expect(xcodeProjectSchemeFile.readAsStringSync(), ''' <Scheme LastUpgradeVersion = "1510" version = "1.3"> '''); // Only print once even though 3 lines were changed. expect('Updating project for Xcode compatibility'.allMatches(testLogger.statusText).length, 1); }); }); group('update info.plist migration', () { late MemoryFileSystem memoryFileSystem; late BufferLogger testLogger; late FakeIosProject project; late File infoPlistFile; setUp(() { memoryFileSystem = MemoryFileSystem(); testLogger = BufferLogger.test(); project = FakeIosProject(); infoPlistFile = memoryFileSystem.file('info.plist'); project.defaultHostInfoPlist = infoPlistFile; }); testWithoutContext('skipped if files are missing', () { final HostAppInfoPlistMigration iosProjectMigration = HostAppInfoPlistMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(infoPlistFile.existsSync(), isFalse); expect(testLogger.traceText, contains('Info.plist not found, skipping host app Info.plist migration.')); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if nothing to upgrade', () { const String infoPlistFileContent = ''' <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CADisableMinimumFrameDurationOnPhone</key> <true/> <key>UIApplicationSupportsIndirectInputEvents</key> <true/> </dict> </plist> '''; infoPlistFile.writeAsStringSync(infoPlistFileContent); final HostAppInfoPlistMigration iosProjectMigration = HostAppInfoPlistMigration( project, testLogger, ); final DateTime infoPlistFileLastModified = infoPlistFile.lastModifiedSync(); iosProjectMigration.migrate(); expect(infoPlistFile.lastModifiedSync(), infoPlistFileLastModified); expect(testLogger.statusText, isEmpty); }); testWithoutContext('info.plist is migrated', () { const String infoPlistFileContent = ''' <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> </dict> </plist> '''; infoPlistFile.writeAsStringSync(infoPlistFileContent); final HostAppInfoPlistMigration iosProjectMigration = HostAppInfoPlistMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(infoPlistFile.readAsStringSync(), equals(''' <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CADisableMinimumFrameDurationOnPhone</key> <true/> <key>UIApplicationSupportsIndirectInputEvents</key> <true/> </dict> </plist> ''')); }); }); group('remove bitcode build setting', () { late MemoryFileSystem memoryFileSystem; late BufferLogger testLogger; late FakeIosProject project; late File xcodeProjectInfoFile; setUp(() { memoryFileSystem = MemoryFileSystem(); testLogger = BufferLogger.test(); project = FakeIosProject(); xcodeProjectInfoFile = memoryFileSystem.file('project.pbxproj'); project.xcodeProjectInfoFile = xcodeProjectInfoFile; }); testWithoutContext('skipped if files are missing', () { final RemoveBitcodeMigration migration = RemoveBitcodeMigration( project, testLogger, ); expect(migration.migrate(), isTrue); expect(xcodeProjectInfoFile.existsSync(), isFalse); expect(testLogger.traceText, contains('Xcode project not found, skipping removing bitcode migration')); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if nothing to upgrade', () { const String xcodeProjectInfoFileContents = 'IPHONEOS_DEPLOYMENT_TARGET = 12.0;'; xcodeProjectInfoFile.writeAsStringSync(xcodeProjectInfoFileContents); final DateTime projectLastModified = xcodeProjectInfoFile.lastModifiedSync(); final RemoveBitcodeMigration migration = RemoveBitcodeMigration( project, testLogger, ); expect(migration.migrate(), isTrue); expect(xcodeProjectInfoFile.lastModifiedSync(), projectLastModified); expect(xcodeProjectInfoFile.readAsStringSync(), xcodeProjectInfoFileContents); expect(testLogger.statusText, isEmpty); }); testWithoutContext('bitcode build setting is removed', () { xcodeProjectInfoFile.writeAsStringSync(''' ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ENABLE_BITCODE = YES; INFOPLIST_FILE = Runner/Info.plist; ENABLE_BITCODE = YES; '''); final RemoveBitcodeMigration migration = RemoveBitcodeMigration( project, testLogger, ); expect(migration.migrate(), isTrue); expect(xcodeProjectInfoFile.readAsStringSync(), ''' ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; ENABLE_BITCODE = NO; '''); // Only print once even though 2 lines were changed. expect('Disabling deprecated bitcode Xcode build setting'.allMatches(testLogger.warningText).length, 1); }); }); group('CocoaPods script readlink', () { late MemoryFileSystem memoryFileSystem; late BufferLogger testLogger; late FakeIosProject project; late File podRunnerFrameworksScript; late ProcessManager processManager; late XcodeProjectInterpreter xcode143ProjectInterpreter; setUp(() { memoryFileSystem = MemoryFileSystem(); podRunnerFrameworksScript = memoryFileSystem.file('Pods-Runner-frameworks.sh'); testLogger = BufferLogger.test(); project = FakeIosProject(); processManager = FakeProcessManager.any(); xcode143ProjectInterpreter = XcodeProjectInterpreter.test(processManager: processManager, version: Version(14, 3, 0)); project.podRunnerFrameworksScript = podRunnerFrameworksScript; }); testWithoutContext('skipped if files are missing', () { final CocoaPodsScriptReadlink iosProjectMigration = CocoaPodsScriptReadlink( project, xcode143ProjectInterpreter, testLogger, ); iosProjectMigration.migrate(); expect(podRunnerFrameworksScript.existsSync(), isFalse); expect(testLogger.traceText, contains('CocoaPods Pods-Runner-frameworks.sh script not found')); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if nothing to upgrade', () { const String contents = r''' if [ -L "${source}" ]; then echo "Symlinked..." source="$(readlink -f "${source}")" fi'''; podRunnerFrameworksScript.writeAsStringSync(contents); final CocoaPodsScriptReadlink iosProjectMigration = CocoaPodsScriptReadlink( project, xcode143ProjectInterpreter, testLogger, ); iosProjectMigration.migrate(); expect(podRunnerFrameworksScript.existsSync(), isTrue); expect(testLogger.traceText, isEmpty); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if Xcode version below 14.3', () { const String contents = r''' if [ -L "${source}" ]; then echo "Symlinked..." source="$(readlink "${source}")" fi'''; podRunnerFrameworksScript.writeAsStringSync(contents); final XcodeProjectInterpreter xcode142ProjectInterpreter = XcodeProjectInterpreter.test( processManager: processManager, version: Version(14, 2, 0), ); final CocoaPodsScriptReadlink iosProjectMigration = CocoaPodsScriptReadlink( project, xcode142ProjectInterpreter, testLogger, ); iosProjectMigration.migrate(); expect(podRunnerFrameworksScript.existsSync(), isTrue); expect(testLogger.traceText, contains('Detected Xcode version is 14.2.0, below 14.3, skipping "readlink -f" workaround')); expect(testLogger.statusText, isEmpty); }); testWithoutContext('Xcode project is migrated', () { const String contents = r''' if [ -L "${source}" ]; then echo "Symlinked..." source="$(readlink "${source}")" fi'''; podRunnerFrameworksScript.writeAsStringSync(contents); final CocoaPodsScriptReadlink iosProjectMigration = CocoaPodsScriptReadlink( project, xcode143ProjectInterpreter, testLogger, ); iosProjectMigration.migrate(); expect(podRunnerFrameworksScript.readAsStringSync(), r''' if [ -L "${source}" ]; then echo "Symlinked..." source="$(readlink -f "${source}")" fi '''); expect(testLogger.statusText, contains('Upgrading Pods-Runner-frameworks.sh')); }); }); group('Cocoapods migrate toolchain directory', () { late MemoryFileSystem memoryFileSystem; late BufferLogger testLogger; late FakeIosProject project; late Directory podRunnerTargetSupportFiles; late ProcessManager processManager; late XcodeProjectInterpreter xcode15ProjectInterpreter; setUp(() { memoryFileSystem = MemoryFileSystem(); podRunnerTargetSupportFiles = memoryFileSystem.directory('Pods-Runner'); testLogger = BufferLogger.test(); project = FakeIosProject(); processManager = FakeProcessManager.any(); xcode15ProjectInterpreter = XcodeProjectInterpreter.test(processManager: processManager, version: Version(15, 0, 0)); project.podRunnerTargetSupportFiles = podRunnerTargetSupportFiles; }); testWithoutContext('skip if directory is missing', () { final CocoaPodsToolchainDirectoryMigration iosProjectMigration = CocoaPodsToolchainDirectoryMigration( project, xcode15ProjectInterpreter, testLogger, ); iosProjectMigration.migrate(); expect(podRunnerTargetSupportFiles.existsSync(), isFalse); expect(testLogger.traceText, contains('CocoaPods Pods-Runner Target Support Files not found')); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skip if xcconfig files are missing', () { podRunnerTargetSupportFiles.createSync(); final CocoaPodsToolchainDirectoryMigration iosProjectMigration = CocoaPodsToolchainDirectoryMigration( project, xcode15ProjectInterpreter, testLogger, ); iosProjectMigration.migrate(); expect(podRunnerTargetSupportFiles.existsSync(), isTrue); expect(testLogger.traceText, isEmpty); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skip if nothing to upgrade', () { podRunnerTargetSupportFiles.createSync(); final File debugConfig = podRunnerTargetSupportFiles.childFile('Pods-Runner.debug.xcconfig'); const String contents = r''' LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/../Frameworks' '@loader_path/Frameworks' "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift '''; debugConfig.writeAsStringSync(contents); final File profileConfig = podRunnerTargetSupportFiles.childFile('Pods-Runner.profile.xcconfig'); profileConfig.writeAsStringSync(contents); final File releaseConfig = podRunnerTargetSupportFiles.childFile('Pods-Runner.release.xcconfig'); releaseConfig.writeAsStringSync(contents); final CocoaPodsToolchainDirectoryMigration iosProjectMigration = CocoaPodsToolchainDirectoryMigration( project, xcode15ProjectInterpreter, testLogger, ); iosProjectMigration.migrate(); expect(debugConfig.existsSync(), isTrue); expect(testLogger.traceText, isEmpty); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if Xcode version below 15', () { podRunnerTargetSupportFiles.createSync(); final File debugConfig = podRunnerTargetSupportFiles.childFile('Pods-Runner.debug.xcconfig'); const String contents = r''' LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/../Frameworks' '@loader_path/Frameworks' "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift '''; debugConfig.writeAsStringSync(contents); final File profileConfig = podRunnerTargetSupportFiles.childFile('Pods-Runner.profile.xcconfig'); profileConfig.writeAsStringSync(contents); final File releaseConfig = podRunnerTargetSupportFiles.childFile('Pods-Runner.release.xcconfig'); releaseConfig.writeAsStringSync(contents); final XcodeProjectInterpreter xcode14ProjectInterpreter = XcodeProjectInterpreter.test( processManager: processManager, version: Version(14, 0, 0), ); final CocoaPodsToolchainDirectoryMigration iosProjectMigration = CocoaPodsToolchainDirectoryMigration( project, xcode14ProjectInterpreter, testLogger, ); iosProjectMigration.migrate(); expect(debugConfig.existsSync(), isTrue); expect(testLogger.traceText, contains('Detected Xcode version is 14.0.0, below 15.0')); expect(testLogger.statusText, isEmpty); }); testWithoutContext('Xcode project is migrated and ignores leading whitespace', () { podRunnerTargetSupportFiles.createSync(); final File debugConfig = podRunnerTargetSupportFiles.childFile('Pods-Runner.debug.xcconfig'); const String contents = r''' LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/../Frameworks' '@loader_path/Frameworks' "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift '''; debugConfig.writeAsStringSync(contents); final File profileConfig = podRunnerTargetSupportFiles.childFile('Pods-Runner.profile.xcconfig'); profileConfig.writeAsStringSync(contents); final File releaseConfig = podRunnerTargetSupportFiles.childFile('Pods-Runner.release.xcconfig'); releaseConfig.writeAsStringSync(contents); final CocoaPodsToolchainDirectoryMigration iosProjectMigration = CocoaPodsToolchainDirectoryMigration( project, xcode15ProjectInterpreter, testLogger, ); iosProjectMigration.migrate(); expect(debugConfig.existsSync(), isTrue); expect(debugConfig.readAsStringSync(), r''' LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/../Frameworks' '@loader_path/Frameworks' "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift '''); expect(profileConfig.existsSync(), isTrue); expect(profileConfig.readAsStringSync(), r''' LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/../Frameworks' '@loader_path/Frameworks' "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift '''); expect(releaseConfig.existsSync(), isTrue); expect(releaseConfig.readAsStringSync(), r''' LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/../Frameworks' '@loader_path/Frameworks' "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift '''); expect(testLogger.statusText, contains('Upgrading Pods-Runner.debug.xcconfig')); expect(testLogger.statusText, contains('Upgrading Pods-Runner.profile.xcconfig')); expect(testLogger.statusText, contains('Upgrading Pods-Runner.release.xcconfig')); }); }); }); group('update Xcode script build phase', () { late MemoryFileSystem memoryFileSystem; late BufferLogger testLogger; late FakeIosProject project; late File xcodeProjectInfoFile; setUp(() { memoryFileSystem = MemoryFileSystem(); testLogger = BufferLogger.test(); project = FakeIosProject(); xcodeProjectInfoFile = memoryFileSystem.file('project.pbxproj'); project.xcodeProjectInfoFile = xcodeProjectInfoFile; }); testWithoutContext('skipped if files are missing', () { final XcodeScriptBuildPhaseMigration iosProjectMigration = XcodeScriptBuildPhaseMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.existsSync(), isFalse); expect(testLogger.traceText, contains('Xcode project not found, skipping script build phase dependency analysis removal')); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if nothing to upgrade', () { const String xcodeProjectInfoFileContents = ''' /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( '''; xcodeProjectInfoFile.writeAsStringSync(xcodeProjectInfoFileContents); final DateTime projectLastModified = xcodeProjectInfoFile.lastModifiedSync(); final XcodeScriptBuildPhaseMigration iosProjectMigration = XcodeScriptBuildPhaseMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.lastModifiedSync(), projectLastModified); expect(xcodeProjectInfoFile.readAsStringSync(), xcodeProjectInfoFileContents); expect(testLogger.statusText, isEmpty); }); testWithoutContext('alwaysOutOfDate is migrated', () { xcodeProjectInfoFile.writeAsStringSync(''' /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); '''); final XcodeScriptBuildPhaseMigration iosProjectMigration = XcodeScriptBuildPhaseMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.readAsStringSync(), ''' /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); '''); expect(testLogger.statusText, contains('Removing script build phase dependency analysis')); }); }); group('update Xcode Thin Binary build phase to have input path', () { late MemoryFileSystem memoryFileSystem; late BufferLogger testLogger; late FakeIosProject project; late File xcodeProjectInfoFile; setUp(() { memoryFileSystem = MemoryFileSystem(); testLogger = BufferLogger.test(); project = FakeIosProject(); xcodeProjectInfoFile = memoryFileSystem.file('project.pbxproj'); project.xcodeProjectInfoFile = xcodeProjectInfoFile; }); testWithoutContext('skipped if files are missing', () { final XcodeThinBinaryBuildPhaseInputPathsMigration iosProjectMigration = XcodeThinBinaryBuildPhaseInputPathsMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.existsSync(), isFalse); expect(testLogger.traceText, contains('Xcode project not found, skipping script build phase dependency analysis removal')); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if nothing to upgrade', () { const String xcodeProjectInfoFileContents = r''' /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); '''; xcodeProjectInfoFile.writeAsStringSync(xcodeProjectInfoFileContents); final DateTime projectLastModified = xcodeProjectInfoFile.lastModifiedSync(); final XcodeThinBinaryBuildPhaseInputPathsMigration iosProjectMigration = XcodeThinBinaryBuildPhaseInputPathsMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.lastModifiedSync(), projectLastModified); expect(xcodeProjectInfoFile.readAsStringSync(), xcodeProjectInfoFileContents); expect(testLogger.statusText, isEmpty); }); testWithoutContext('Thin Binary inputPaths is migrated', () { xcodeProjectInfoFile.writeAsStringSync(r''' /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); '''); final XcodeThinBinaryBuildPhaseInputPathsMigration iosProjectMigration = XcodeThinBinaryBuildPhaseInputPathsMigration( project, testLogger, ); iosProjectMigration.migrate(); expect(xcodeProjectInfoFile.readAsStringSync(), r''' /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); '''); expect(testLogger.statusText, contains('Adding input path to Thin Binary build phase.')); }); }); } class FakeIosProject extends Fake implements IosProject { @override File xcodeProjectWorkspaceData = MemoryFileSystem.test().file('xcodeProjectWorkspaceData'); @override File? xcodeWorkspaceSharedSettings = MemoryFileSystem.test().file('xcodeWorkspaceSharedSettings'); @override File xcodeProjectInfoFile = MemoryFileSystem.test().file('xcodeProjectInfoFile'); File? schemeFile; @override File xcodeProjectSchemeFile({String? scheme}) => schemeFile ?? MemoryFileSystem.test().file('xcodeProjectSchemeFile'); @override File appFrameworkInfoPlist = MemoryFileSystem.test().file('appFrameworkInfoPlist'); @override File defaultHostInfoPlist = MemoryFileSystem.test().file('defaultHostInfoPlist'); @override File podfile = MemoryFileSystem.test().file('Podfile'); @override File podRunnerFrameworksScript = MemoryFileSystem.test().file('podRunnerFrameworksScript'); @override Directory podRunnerTargetSupportFiles = MemoryFileSystem.test().directory('Pods-Runner'); } class FakeIOSMigrator extends ProjectMigrator { FakeIOSMigrator() : super(BufferLogger.test()); @override void migrate() {} @override String migrateLine(String line) { return line; } }
flutter/packages/flutter_tools/test/general.shard/ios/ios_project_migration_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/ios/ios_project_migration_test.dart", "repo_id": "flutter", "token_count": 20853 }
861
// 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/build_info.dart'; import 'package:flutter_tools/src/device.dart'; import 'package:flutter_tools/src/features.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/resident_devtools_handler.dart'; import 'package:flutter_tools/src/resident_runner.dart'; import 'package:flutter_tools/src/run_hot.dart'; import 'package:unified_analytics/unified_analytics.dart'; import '../../src/common.dart'; import '../../src/context.dart'; import '../../src/fake_vm_services.dart'; import '../../src/fakes.dart'; import '../../src/testbed.dart'; import '../resident_runner_helpers.dart'; import 'fake_native_assets_build_runner.dart'; void main() { late Testbed testbed; late FakeFlutterDevice flutterDevice; late FakeDevFS devFS; late ResidentRunner residentRunner; late FakeDevice device; late FakeAnalytics fakeAnalytics; FakeVmServiceHost? fakeVmServiceHost; setUp(() { testbed = Testbed(setup: () { fakeAnalytics = getInitializedFakeAnalyticsInstance( fs: globals.fs, fakeFlutterVersion: FakeFlutterVersion(), ); globals.fs.file('.packages') .writeAsStringSync('\n'); globals.fs.file(globals.fs.path.join('build', 'app.dill')) ..createSync(recursive: true) ..writeAsStringSync('ABC'); residentRunner = HotRunner( <FlutterDevice>[ flutterDevice, ], stayResident: false, debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), target: 'main.dart', devtoolsHandler: createNoOpHandler, analytics: fakeAnalytics, ); }); device = FakeDevice(); devFS = FakeDevFS(); flutterDevice = FakeFlutterDevice() ..testUri = testUri ..vmServiceHost = (() => fakeVmServiceHost) ..device = device ..fakeDevFS = devFS; }); testUsingContext( 'use the nativeAssetsYamlFile when provided', () => testbed.run(() async { final FakeDevice device = FakeDevice( targetPlatform: TargetPlatform.darwin, sdkNameAndVersion: 'Macos', ); final FakeResidentCompiler residentCompiler = FakeResidentCompiler(); final FakeFlutterDevice flutterDevice = FakeFlutterDevice() ..testUri = testUri ..vmServiceHost = (() => fakeVmServiceHost) ..device = device ..fakeDevFS = devFS ..targetPlatform = TargetPlatform.darwin ..generator = residentCompiler; fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[ listViews, listViews, ]); globals.fs .file(globals.fs.path.join('lib', 'main.dart')) .createSync(recursive: true); final FakeNativeAssetsBuildRunner buildRunner = FakeNativeAssetsBuildRunner(); residentRunner = HotRunner( <FlutterDevice>[ flutterDevice, ], stayResident: false, debuggingOptions: DebuggingOptions.enabled(const BuildInfo( BuildMode.debug, '', treeShakeIcons: false, trackWidgetCreation: true, )), target: 'main.dart', devtoolsHandler: createNoOpHandler, nativeAssetsBuilder: FakeHotRunnerNativeAssetsBuilder(buildRunner), analytics: fakeAnalytics, nativeAssetsYamlFile: 'foo.yaml', ); final int? result = await residentRunner.run(); expect(result, 0); expect(buildRunner.buildInvocations, 0); expect(buildRunner.dryRunInvocations, 0); expect(buildRunner.hasPackageConfigInvocations, 0); expect(buildRunner.packagesWithNativeAssetsInvocations, 0); expect(residentCompiler.recompileCalled, true); expect(residentCompiler.receivedNativeAssetsYaml, globals.fs.path.toUri('foo.yaml')); }), overrides: <Type, Generator>{ ProcessManager: () => FakeProcessManager.any(), FeatureFlags: () => TestFeatureFlags(isNativeAssetsEnabled: true, isMacOSEnabled: true), }); }
flutter/packages/flutter_tools/test/general.shard/isolated/resident_runner_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/isolated/resident_runner_test.dart", "repo_id": "flutter", "token_count": 1753 }
862
// 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/localizations/gen_l10n_types.dart'; import 'package:flutter_tools/src/localizations/message_parser.dart'; import '../src/common.dart'; void main() { // Going to test that operator== is overloaded properly since the rest // of the test depends on it. testWithoutContext('node equality', () { final Node actual = Node( ST.placeholderExpr, 0, expectedSymbolCount: 3, children: <Node>[ Node.openBrace(0), Node.string(1, 'var'), Node.closeBrace(4), ], ); final Node expected = Node( ST.placeholderExpr, 0, expectedSymbolCount: 3, children: <Node>[ Node.openBrace(0), Node.string(1, 'var'), Node.closeBrace(4), ], ); expect(actual, equals(expected)); final Node wrongType = Node( ST.pluralExpr, 0, expectedSymbolCount: 3, children: <Node>[ Node.openBrace(0), Node.string(1, 'var'), Node.closeBrace(4), ], ); expect(actual, isNot(equals(wrongType))); final Node wrongPosition = Node( ST.placeholderExpr, 1, expectedSymbolCount: 3, children: <Node>[ Node.openBrace(0), Node.string(1, 'var'), Node.closeBrace(4), ], ); expect(actual, isNot(equals(wrongPosition))); final Node wrongChildrenCount = Node( ST.placeholderExpr, 0, expectedSymbolCount: 3, children: <Node>[ Node.string(1, 'var'), Node.closeBrace(4), ], ); expect(actual, isNot(equals(wrongChildrenCount))); final Node wrongChild = Node( ST.placeholderExpr, 0, expectedSymbolCount: 3, children: <Node>[ Node.closeBrace(0), Node.string(1, 'var'), Node.closeBrace(4), ], ); expect(actual, isNot(equals(wrongChild))); }); testWithoutContext('lexer basic', () { final List<Node> tokens1 = Parser( 'helloWorld', 'app_en.arb', 'Hello {name}' ).lexIntoTokens(); expect(tokens1, equals(<Node>[ Node.string(0, 'Hello '), Node.openBrace(6), Node.identifier(7, 'name'), Node.closeBrace(11), ])); final List<Node> tokens2 = Parser( 'plural', 'app_en.arb', 'There are {count} {count, plural, =1{cat} other{cats}}' ).lexIntoTokens(); expect(tokens2, equals(<Node>[ Node.string(0, 'There are '), Node.openBrace(10), Node.identifier(11, 'count'), Node.closeBrace(16), Node.string(17, ' '), Node.openBrace(18), Node.identifier(19, 'count'), Node.comma(24), Node.pluralKeyword(26), Node.comma(32), Node.equalSign(34), Node.number(35, '1'), Node.openBrace(36), Node.string(37, 'cat'), Node.closeBrace(40), Node.otherKeyword(42), Node.openBrace(47), Node.string(48, 'cats'), Node.closeBrace(52), Node.closeBrace(53), ])); final List<Node> tokens3 = Parser( 'gender', 'app_en.arb', '{gender, select, male{he} female{she} other{they}}' ).lexIntoTokens(); expect(tokens3, equals(<Node>[ Node.openBrace(0), Node.identifier(1, 'gender'), Node.comma(7), Node.selectKeyword(9), Node.comma(15), Node.identifier(17, 'male'), Node.openBrace(21), Node.string(22, 'he'), Node.closeBrace(24), Node.identifier(26, 'female'), Node.openBrace(32), Node.string(33, 'she'), Node.closeBrace(36), Node.otherKeyword(38), Node.openBrace(43), Node.string(44, 'they'), Node.closeBrace(48), Node.closeBrace(49), ])); }); testWithoutContext('lexer recursive', () { final List<Node> tokens = Parser( 'plural', 'app_en.arb', '{count, plural, =1{{gender, select, male{he} female{she}}} other{they}}' ).lexIntoTokens(); expect(tokens, equals(<Node>[ Node.openBrace(0), Node.identifier(1, 'count'), Node.comma(6), Node.pluralKeyword(8), Node.comma(14), Node.equalSign(16), Node.number(17, '1'), Node.openBrace(18), Node.openBrace(19), Node.identifier(20, 'gender'), Node.comma(26), Node.selectKeyword(28), Node.comma(34), Node.identifier(36, 'male'), Node.openBrace(40), Node.string(41, 'he'), Node.closeBrace(43), Node.identifier(45, 'female'), Node.openBrace(51), Node.string(52, 'she'), Node.closeBrace(55), Node.closeBrace(56), Node.closeBrace(57), Node.otherKeyword(59), Node.openBrace(64), Node.string(65, 'they'), Node.closeBrace(69), Node.closeBrace(70), ])); }); testWithoutContext('lexer escaping', () { final List<Node> tokens1 = Parser('escaping', 'app_en.arb', "''", useEscaping: true).lexIntoTokens(); expect(tokens1, equals(<Node>[Node.string(0, "'")])); final List<Node> tokens2 = Parser('escaping', 'app_en.arb', "'hello world { name }'", useEscaping: true).lexIntoTokens(); expect(tokens2, equals(<Node>[Node.string(0, 'hello world { name }')])); final List<Node> tokens3 = Parser('escaping', 'app_en.arb', "'{ escaped string }' { not escaped }", useEscaping: true).lexIntoTokens(); expect(tokens3, equals(<Node>[ Node.string(0, '{ escaped string }'), Node.string(20, ' '), Node.openBrace(21), Node.identifier(23, 'not'), Node.identifier(27, 'escaped'), Node.closeBrace(35), ])); final List<Node> tokens4 = Parser('escaping', 'app_en.arb', "Flutter''s amazing!", useEscaping: true).lexIntoTokens(); expect(tokens4, equals(<Node>[ Node.string(0, 'Flutter'), Node.string(7, "'"), Node.string(9, 's amazing!'), ])); final List<Node> tokens5 = Parser('escaping', 'app_en.arb', "'Flutter''s amazing!'", useEscaping: true).lexIntoTokens(); expect(tokens5, equals(<Node>[ Node(ST.string, 0, value: 'Flutter'), Node(ST.string, 9, value: "'s amazing!"), ])); }); testWithoutContext('lexer identifier names can be "select" or "plural"', () { final List<Node> tokens = Parser('keywords', 'app_en.arb', '{ select } { plural, select, singular{test} other{hmm} }').lexIntoTokens(); expect(tokens[1].value, equals('select')); expect(tokens[1].type, equals(ST.identifier)); expect(tokens[5].value, equals('plural')); expect(tokens[5].type, equals(ST.identifier)); }); testWithoutContext('lexer identifier names can contain underscores', () { final List<Node> tokens = Parser('keywords', 'app_en.arb', '{ test_placeholder } { test_select, select, singular{test} other{hmm} }').lexIntoTokens(); expect(tokens[1].value, equals('test_placeholder')); expect(tokens[1].type, equals(ST.identifier)); expect(tokens[5].value, equals('test_select')); expect(tokens[5].type, equals(ST.identifier)); }); testWithoutContext('lexer identifier names can contain the strings select or plural', () { final List<Node> tokens = Parser('keywords', 'app_en.arb', '{ selectTest } { pluralTest, select, singular{test} other{hmm} }').lexIntoTokens(); expect(tokens[1].value, equals('selectTest')); expect(tokens[1].type, equals(ST.identifier)); expect(tokens[5].value, equals('pluralTest')); expect(tokens[5].type, equals(ST.identifier)); }); testWithoutContext('lexer: lexically correct but syntactically incorrect', () { final List<Node> tokens = Parser( 'syntax', 'app_en.arb', 'string { identifier { string { identifier } } }' ).lexIntoTokens(); expect(tokens, equals(<Node>[ Node.string(0, 'string '), Node.openBrace(7), Node.identifier(9, 'identifier'), Node.openBrace(20), Node.string(21, ' string '), Node.openBrace(29), Node.identifier(31, 'identifier'), Node.closeBrace(42), Node.string(43, ' '), Node.closeBrace(44), Node.closeBrace(46), ])); }); testWithoutContext('lexer unmatched single quote', () { const String message = "here''s an unmatched single quote: '"; const String expectedError = ''' [app_en.arb:escaping] ICU Lexing Error: Unmatched single quotes. here''s an unmatched single quote: ' ^'''; expect( () => Parser('escaping', 'app_en.arb', message, useEscaping: true).lexIntoTokens(), throwsA(isA<L10nException>().having( (L10nException e) => e.message, 'message', contains(expectedError), ))); }); testWithoutContext('lexer unexpected character', () { const String message = '{ * }'; const String expectedError = ''' [app_en.arb:lex] ICU Lexing Error: Unexpected character. { * } ^'''; expect( () => Parser('lex', 'app_en.arb', message).lexIntoTokens(), throwsA(isA<L10nException>().having( (L10nException e) => e.message, 'message', contains(expectedError), ))); }); testWithoutContext('relaxed lexer', () { final List<Node> tokens1 = Parser( 'string', 'app_en.arb', '{ }', placeholders: <String>[], ).lexIntoTokens(); expect(tokens1, equals(<Node>[ Node(ST.string, 0, value: '{'), Node(ST.string, 1, value: ' '), Node(ST.string, 2, value: '}') ])); final List<Node> tokens2 = Parser( 'string', 'app_en.arb', '{ notAPlaceholder }', placeholders: <String>['isAPlaceholder'], ).lexIntoTokens(); expect(tokens2, equals(<Node>[ Node(ST.string, 0, value: '{'), Node(ST.string, 1, value: ' notAPlaceholder '), Node(ST.string, 18, value: '}') ])); final List<Node> tokens3 = Parser( 'string', 'app_en.arb', '{ isAPlaceholder }', placeholders: <String>['isAPlaceholder'], ).lexIntoTokens(); expect(tokens3, equals(<Node>[ Node(ST.openBrace, 0, value: '{'), Node(ST.identifier, 2, value: 'isAPlaceholder'), Node(ST.closeBrace, 17, value: '}') ])); }); testWithoutContext('relaxed lexer complex', () { const String message = '{ notPlaceholder } {count,plural, =0{Hello} =1{Hello World} =2{Hello two worlds} few{Hello {count} worlds} many{Hello all {count} worlds} other{Hello other {count} worlds}}'; final List<Node> tokens = Parser( 'string', 'app_en.arb', message, placeholders: <String>['count'], ).lexIntoTokens(); expect(tokens[0].type, equals(ST.string)); }); testWithoutContext('parser basic', () { expect(Parser('helloWorld', 'app_en.arb', 'Hello {name}').parse(), equals( Node(ST.message, 0, children: <Node>[ Node(ST.string, 0, value: 'Hello '), Node(ST.placeholderExpr, 6, children: <Node>[ Node(ST.openBrace, 6, value: '{'), Node(ST.identifier, 7, value: 'name'), Node(ST.closeBrace, 11, value: '}') ]) ]) )); expect(Parser('argumentTest', 'app_en.arb', 'Today is {date, date, ::yMMd}').parse(), equals( Node(ST.message, 0, children: <Node>[ Node(ST.string, 0, value: 'Today is '), Node(ST.argumentExpr, 9, children: <Node>[ Node(ST.openBrace, 9, value: '{'), Node(ST.identifier, 10, value: 'date'), Node(ST.comma, 14, value: ','), Node(ST.argType, 16, children: <Node>[ Node(ST.date, 16, value: 'date'), ]), Node(ST.comma, 20, value: ','), Node(ST.colon, 22, value: ':'), Node(ST.colon, 23, value: ':'), Node(ST.identifier, 24, value: 'yMMd'), Node(ST.closeBrace, 28, value: '}'), ]), ]) )); expect(Parser( 'plural', 'app_en.arb', 'There are {count} {count, plural, =1{cat} other{cats}}' ).parse(), equals( Node(ST.message, 0, children: <Node>[ Node(ST.string, 0, value: 'There are '), Node(ST.placeholderExpr, 10, children: <Node>[ Node(ST.openBrace, 10, value: '{'), Node(ST.identifier, 11, value: 'count'), Node(ST.closeBrace, 16, value: '}') ]), Node(ST.string, 17, value: ' '), Node(ST.pluralExpr, 18, children: <Node>[ Node(ST.openBrace, 18, value: '{'), Node(ST.identifier, 19, value: 'count'), Node(ST.comma, 24, value: ','), Node(ST.plural, 26, value: 'plural'), Node(ST.comma, 32, value: ','), Node(ST.pluralParts, 34, children: <Node>[ Node(ST.pluralPart, 34, children: <Node>[ Node(ST.equalSign, 34, value: '='), Node(ST.number, 35, value: '1'), Node(ST.openBrace, 36, value: '{'), Node(ST.message, 37, children: <Node>[ Node(ST.string, 37, value: 'cat') ]), Node(ST.closeBrace, 40, value: '}') ]), Node(ST.pluralPart, 42, children: <Node>[ Node(ST.other, 42, value: 'other'), Node(ST.openBrace, 47, value: '{'), Node(ST.message, 48, children: <Node>[ Node(ST.string, 48, value: 'cats') ]), Node(ST.closeBrace, 52, value: '}') ]) ]), Node(ST.closeBrace, 53, value: '}') ]), ]), )); expect(Parser( 'gender', 'app_en.arb', '{gender, select, male{he} female{she} other{they}}' ).parse(), equals( Node(ST.message, 0, children: <Node>[ Node(ST.selectExpr, 0, children: <Node>[ Node(ST.openBrace, 0, value: '{'), Node(ST.identifier, 1, value: 'gender'), Node(ST.comma, 7, value: ','), Node(ST.select, 9, value: 'select'), Node(ST.comma, 15, value: ','), Node(ST.selectParts, 17, children: <Node>[ Node(ST.selectPart, 17, children: <Node>[ Node(ST.identifier, 17, value: 'male'), Node(ST.openBrace, 21, value: '{'), Node(ST.message, 22, children: <Node>[ Node(ST.string, 22, value: 'he'), ]), Node(ST.closeBrace, 24, value: '}'), ]), Node(ST.selectPart, 26, children: <Node>[ Node(ST.identifier, 26, value: 'female'), Node(ST.openBrace, 32, value: '{'), Node(ST.message, 33, children: <Node>[ Node(ST.string, 33, value: 'she'), ]), Node(ST.closeBrace, 36, value: '}'), ]), Node(ST.selectPart, 38, children: <Node>[ Node(ST.other, 38, value: 'other'), Node(ST.openBrace, 43, value: '{'), Node(ST.message, 44, children: <Node>[ Node(ST.string, 44, value: 'they'), ]), Node(ST.closeBrace, 48, value: '}'), ]), ]), Node(ST.closeBrace, 49, value: '}'), ]), ]) )); }); testWithoutContext('parser escaping', () { expect(Parser('escaping', 'app_en.arb', "Flutter''s amazing!", useEscaping: true).parse(), equals( Node(ST.message, 0, children: <Node>[ Node(ST.string, 0, value: 'Flutter'), Node(ST.string, 7, value: "'"), Node(ST.string, 9, value: 's amazing!'), ]) )); expect(Parser('escaping', 'app_en.arb', "'Flutter''s amazing!'", useEscaping: true).parse(), equals( Node(ST.message, 0, children: <Node> [ Node(ST.string, 0, value: 'Flutter'), Node(ST.string, 9, value: "'s amazing!"), ]) )); }); testWithoutContext('parser recursive', () { expect(Parser( 'pluralGender', 'app_en.arb', '{count, plural, =1{{gender, select, male{he} female{she} other{they}}} other{they}}' ).parse(), equals( Node(ST.message, 0, children: <Node>[ Node(ST.pluralExpr, 0, children: <Node>[ Node(ST.openBrace, 0, value: '{'), Node(ST.identifier, 1, value: 'count'), Node(ST.comma, 6, value: ','), Node(ST.plural, 8, value: 'plural'), Node(ST.comma, 14, value: ','), Node(ST.pluralParts, 16, children: <Node>[ Node(ST.pluralPart, 16, children: <Node>[ Node(ST.equalSign, 16, value: '='), Node(ST.number, 17, value: '1'), Node(ST.openBrace, 18, value: '{'), Node(ST.message, 19, children: <Node>[ Node(ST.selectExpr, 19, children: <Node>[ Node(ST.openBrace, 19, value: '{'), Node(ST.identifier, 20, value: 'gender'), Node(ST.comma, 26, value: ','), Node(ST.select, 28, value: 'select'), Node(ST.comma, 34, value: ','), Node(ST.selectParts, 36, children: <Node>[ Node(ST.selectPart, 36, children: <Node>[ Node(ST.identifier, 36, value: 'male'), Node(ST.openBrace, 40, value: '{'), Node(ST.message, 41, children: <Node>[ Node(ST.string, 41, value: 'he'), ]), Node(ST.closeBrace, 43, value: '}'), ]), Node(ST.selectPart, 45, children: <Node>[ Node(ST.identifier, 45, value: 'female'), Node(ST.openBrace, 51, value: '{'), Node(ST.message, 52, children: <Node>[ Node(ST.string, 52, value: 'she'), ]), Node(ST.closeBrace, 55, value: '}'), ]), Node(ST.selectPart, 57, children: <Node>[ Node(ST.other, 57, value: 'other'), Node(ST.openBrace, 62, value: '{'), Node(ST.message, 63, children: <Node>[ Node(ST.string, 63, value: 'they'), ]), Node(ST.closeBrace, 67, value: '}'), ]), ]), Node(ST.closeBrace, 68, value: '}'), ]), ]), Node(ST.closeBrace, 69, value: '}'), ]), Node(ST.pluralPart, 71, children: <Node>[ Node(ST.other, 71, value: 'other'), Node(ST.openBrace, 76, value: '{'), Node(ST.message, 77, children: <Node>[ Node(ST.string, 77, value: 'they'), ]), Node(ST.closeBrace, 81, value: '}'), ]), ]), Node(ST.closeBrace, 82, value: '}'), ]), ]) )); }); testWithoutContext('parser unexpected token', () { // unexpected token const String expectedError1 = ''' [app_en.arb:unexpectedToken] ICU Syntax Error: Expected "}" but found "=". { placeholder = ^'''; expect( () => Parser('unexpectedToken', 'app_en.arb', '{ placeholder =').parseIntoTree(), throwsA(isA<L10nException>().having( (L10nException e) => e.message, 'message', contains(expectedError1), ))); const String expectedError2 = ''' [app_en.arb:unexpectedToken] ICU Syntax Error: Expected "number" but found "}". { count, plural, = } ^'''; expect( () => Parser('unexpectedToken', 'app_en.arb', '{ count, plural, = }').parseIntoTree(), throwsA(isA<L10nException>().having( (L10nException e) => e.message, 'message', contains(expectedError2), ))); const String expectedError3 = ''' [app_en.arb:unexpectedToken] ICU Syntax Error: Expected "identifier" but found ",". { , plural , = } ^'''; expect( () => Parser('unexpectedToken', 'app_en.arb', '{ , plural , = }').parseIntoTree(), throwsA(isA<L10nException>().having( (L10nException e) => e.message, 'message', contains(expectedError3), ))); }); testWithoutContext('parser allows select cases with numbers', () { final Node node = Parser('numberSelect', 'app_en.arb', '{ count, select, 0{none} 100{perfect} other{required!} }').parse(); final Node selectExpr = node.children[0]; final Node selectParts = selectExpr.children[5]; final Node selectPart = selectParts.children[0]; expect(selectPart.children[0].value, equals('0')); expect(selectPart.children[1].value, equals('{')); expect(selectPart.children[2].type, equals(ST.message)); expect(selectPart.children[3].value, equals('}')); }); }
flutter/packages/flutter_tools/test/general.shard/message_parser_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/message_parser_test.dart", "repo_id": "flutter", "token_count": 9906 }
863
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'package:flutter_tools/src/base/dds.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/build_info.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/device.dart'; import 'package:flutter_tools/src/devtools_launcher.dart'; import 'package:flutter_tools/src/resident_devtools_handler.dart'; import 'package:flutter_tools/src/resident_runner.dart'; import 'package:flutter_tools/src/vmservice.dart'; import 'package:test/fake.dart'; import 'package:vm_service/vm_service.dart' as vm_service; import '../src/common.dart'; import '../src/fake_process_manager.dart'; import '../src/fake_vm_services.dart'; import '../src/fakes.dart'; final vm_service.Isolate isolate = 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>[], extensionRPCs: <String>['ext.flutter.connectedVmServiceUri'], ); final FakeVmServiceRequest listViews = FakeVmServiceRequest( method: kListViewsMethod, jsonResponse: <String, Object>{ 'views': <Object>[ FlutterView( id: 'a', uiIsolate: isolate, ).toJson(), ], }, ); void main() { Cache.flutterRoot = ''; testWithoutContext('Does not serve devtools if launcher is null', () async { final ResidentDevtoolsHandler handler = FlutterResidentDevtoolsHandler( null, FakeResidentRunner(), BufferLogger.test(), ); await handler.serveAndAnnounceDevTools(flutterDevices: <FlutterDevice>[]); expect(handler.activeDevToolsServer, null); }); testWithoutContext('Does not serve devtools if ResidentRunner does not support the service protocol', () async { final ResidentDevtoolsHandler handler = FlutterResidentDevtoolsHandler( FakeDevtoolsLauncher(), FakeResidentRunner()..supportsServiceProtocol = false, BufferLogger.test(), ); await handler.serveAndAnnounceDevTools(flutterDevices: <FlutterDevice>[]); expect(handler.activeDevToolsServer, null); }); testWithoutContext('Can use devtools with existing devtools URI', () async { final DevtoolsServerLauncher launcher = DevtoolsServerLauncher( processManager: FakeProcessManager.empty(), dartExecutable: 'dart', logger: BufferLogger.test(), botDetector: const FakeBotDetector(false), ); final ResidentDevtoolsHandler handler = FlutterResidentDevtoolsHandler( // Uses real devtools instance which should be a no-op if // URI is already set. launcher, FakeResidentRunner(), BufferLogger.test(), ); await handler.serveAndAnnounceDevTools( devToolsServerAddress: Uri.parse('http://localhost:8181'), flutterDevices: <FlutterDevice>[], ); expect(handler.activeDevToolsServer!.host, 'localhost'); expect(handler.activeDevToolsServer!.port, 8181); }); testWithoutContext('serveAndAnnounceDevTools with attached device does not fail on null vm service', () async { final ResidentDevtoolsHandler handler = FlutterResidentDevtoolsHandler( FakeDevtoolsLauncher() ..activeDevToolsServer = DevToolsServerAddress('localhost', 8080) ..devToolsUrl = Uri.parse('http://localhost:8080'), FakeResidentRunner(), BufferLogger.test(), ); // VM Service is intentionally null final FakeFlutterDevice device = FakeFlutterDevice(); await handler.serveAndAnnounceDevTools( flutterDevices: <FlutterDevice>[device], ); }); testWithoutContext('serveAndAnnounceDevTools with invokes devtools and vm_service setter', () async { final ResidentDevtoolsHandler handler = FlutterResidentDevtoolsHandler( FakeDevtoolsLauncher() ..activeDevToolsServer = DevToolsServerAddress('localhost', 8080) ..devToolsUrl = Uri.parse('http://localhost:8080'), FakeResidentRunner(), BufferLogger.test(), ); final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[ const FakeVmServiceRequest( method: 'streamListen', args: <String, Object>{ 'streamId': 'Isolate', } ), listViews, FakeVmServiceRequest( method: 'getIsolate', jsonResponse: isolate.toJson(), args: <String, Object>{ 'isolateId': '1', }, ), const FakeVmServiceRequest( method: 'streamCancel', args: <String, Object>{ 'streamId': 'Isolate', }, ), listViews, listViews, const FakeVmServiceRequest( method: 'ext.flutter.activeDevToolsServerAddress', args: <String, Object>{ 'isolateId': '1', 'value': 'http://localhost:8080', }, ), const FakeVmServiceRequest( method: 'ext.flutter.connectedVmServiceUri', args: <String, Object>{ 'isolateId': '1', 'value': 'http://localhost:1234', }, ), ], httpAddress: Uri.parse('http://localhost:1234')); final FakeFlutterDevice device = FakeFlutterDevice() ..vmService = fakeVmServiceHost.vmService; await handler.serveAndAnnounceDevTools( flutterDevices: <FlutterDevice>[device], ); }); testWithoutContext('serveAndAnnounceDevTools will bail if launching devtools fails', () async { final ResidentDevtoolsHandler handler = FlutterResidentDevtoolsHandler( FakeDevtoolsLauncher()..activeDevToolsServer = null, FakeResidentRunner(), BufferLogger.test(), ); final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[], httpAddress: Uri.parse('http://localhost:1234')); final FakeFlutterDevice device = FakeFlutterDevice() ..vmService = fakeVmServiceHost.vmService; await handler.serveAndAnnounceDevTools( flutterDevices: <FlutterDevice>[device], ); }); testWithoutContext('serveAndAnnounceDevTools with web device', () async { final ResidentDevtoolsHandler handler = FlutterResidentDevtoolsHandler( FakeDevtoolsLauncher() ..activeDevToolsServer = DevToolsServerAddress('localhost', 8080) ..devToolsUrl = Uri.parse('http://localhost:8080'), FakeResidentRunner(), BufferLogger.test(), ); final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[ const FakeVmServiceRequest( method: 'streamListen', args: <String, Object>{ 'streamId': 'Isolate', } ), listViews, FakeVmServiceRequest( method: 'getIsolate', jsonResponse: isolate.toJson(), args: <String, Object>{ 'isolateId': '1', }, ), const FakeVmServiceRequest( method: 'streamCancel', args: <String, Object>{ 'streamId': 'Isolate', }, ), const FakeVmServiceRequest( method: 'ext.flutter.activeDevToolsServerAddress', args: <String, Object>{ 'value': 'http://localhost:8080', }, ), const FakeVmServiceRequest( method: 'ext.flutter.connectedVmServiceUri', args: <String, Object>{ 'value': 'http://localhost:1234', }, ), ], httpAddress: Uri.parse('http://localhost:1234')); final FakeFlutterDevice device = FakeFlutterDevice() ..vmService = fakeVmServiceHost.vmService ..targetPlatform = TargetPlatform.web_javascript; await handler.serveAndAnnounceDevTools( flutterDevices: <FlutterDevice>[device], ); }); testWithoutContext('serveAndAnnounceDevTools with skips calling service extensions when VM service disappears', () async { final ResidentDevtoolsHandler handler = FlutterResidentDevtoolsHandler( FakeDevtoolsLauncher()..activeDevToolsServer = DevToolsServerAddress('localhost', 8080), FakeResidentRunner(), BufferLogger.test(), ); final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[ const FakeVmServiceRequest( method: 'streamListen', args: <String, Object>{ 'streamId': 'Isolate', }, ), const FakeVmServiceRequest( method: kListViewsMethod, error: FakeRPCError(code: RPCErrorCodes.kServiceDisappeared), ), const FakeVmServiceRequest( method: 'streamCancel', args: <String, Object>{ 'streamId': 'Isolate', }, error: FakeRPCError(code: RPCErrorCodes.kServiceDisappeared), ), ], httpAddress: Uri.parse('http://localhost:1234')); final FakeFlutterDevice device = FakeFlutterDevice() ..vmService = fakeVmServiceHost.vmService; await handler.serveAndAnnounceDevTools( flutterDevices: <FlutterDevice>[device], ); }); testWithoutContext('serveAndAnnounceDevTools with multiple devices and VM service disappears on one', () async { final ResidentDevtoolsHandler handler = FlutterResidentDevtoolsHandler( FakeDevtoolsLauncher() ..activeDevToolsServer = DevToolsServerAddress('localhost', 8080) ..devToolsUrl = Uri.parse('http://localhost:8080'), FakeResidentRunner(), BufferLogger.test(), ); final FakeVmServiceHost vmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[ const FakeVmServiceRequest( method: 'streamListen', args: <String, Object>{ 'streamId': 'Isolate', }, ), listViews, FakeVmServiceRequest( method: 'getIsolate', jsonResponse: isolate.toJson(), args: <String, Object>{ 'isolateId': '1', }, ), const FakeVmServiceRequest( method: 'streamCancel', args: <String, Object>{ 'streamId': 'Isolate', }, ), listViews, listViews, const FakeVmServiceRequest( method: 'ext.flutter.activeDevToolsServerAddress', args: <String, Object>{ 'isolateId': '1', 'value': 'http://localhost:8080', }, ), const FakeVmServiceRequest( method: 'ext.flutter.connectedVmServiceUri', args: <String, Object>{ 'isolateId': '1', 'value': 'http://localhost:1234', }, ), ], httpAddress: Uri.parse('http://localhost:1234')); final FakeVmServiceHost vmServiceHostThatDisappears = FakeVmServiceHost(requests: <VmServiceExpectation>[ const FakeVmServiceRequest( method: 'streamListen', args: <String, Object>{ 'streamId': 'Isolate', }, ), const FakeVmServiceRequest( method: kListViewsMethod, error: FakeRPCError(code: RPCErrorCodes.kServiceDisappeared), ), const FakeVmServiceRequest( method: 'streamCancel', args: <String, Object>{ 'streamId': 'Isolate', }, error: FakeRPCError(code: RPCErrorCodes.kServiceDisappeared), ), ], httpAddress: Uri.parse('http://localhost:5678')); await handler.serveAndAnnounceDevTools( flutterDevices: <FlutterDevice>[ FakeFlutterDevice() ..vmService = vmServiceHostThatDisappears.vmService, FakeFlutterDevice() ..vmService = vmServiceHost.vmService, ], ); }); testWithoutContext('Does not launch devtools in browser if launcher is null', () async { final FlutterResidentDevtoolsHandler handler = FlutterResidentDevtoolsHandler( null, FakeResidentRunner(), BufferLogger.test(), ); handler.launchDevToolsInBrowser(flutterDevices: <FlutterDevice>[]); expect(handler.launchedInBrowser, isFalse); expect(handler.activeDevToolsServer, null); }); testWithoutContext('Does not launch devtools in browser if ResidentRunner does not support the service protocol', () async { final FlutterResidentDevtoolsHandler handler = FlutterResidentDevtoolsHandler( FakeDevtoolsLauncher(), FakeResidentRunner()..supportsServiceProtocol = false, BufferLogger.test(), ); handler.launchDevToolsInBrowser(flutterDevices: <FlutterDevice>[]); expect(handler.launchedInBrowser, isFalse); expect(handler.activeDevToolsServer, null); }); testWithoutContext('launchDevToolsInBrowser launches after _devToolsLauncher.ready completes', () async { final Completer<void> completer = Completer<void>(); final FlutterResidentDevtoolsHandler handler = FlutterResidentDevtoolsHandler( FakeDevtoolsLauncher() ..devToolsUrl = null // We need to set [activeDevToolsServer] to simulate the state we would // be in after serving devtools completes. ..activeDevToolsServer = DevToolsServerAddress('localhost', 8080) ..readyCompleter = completer, FakeResidentRunner(), BufferLogger.test(), ); expect(handler.launchDevToolsInBrowser(flutterDevices: <FlutterDevice>[]), isTrue); expect(handler.launchedInBrowser, isFalse); completer.complete(); // Await a short delay to give DevTools time to launch. await Future<void>.delayed(const Duration(microseconds: 100)); expect(handler.launchedInBrowser, isTrue); }); testWithoutContext('launchDevToolsInBrowser launches successfully', () async { final FlutterResidentDevtoolsHandler handler = FlutterResidentDevtoolsHandler( FakeDevtoolsLauncher() ..devToolsUrl = Uri(host: 'localhost', port: 8080) ..activeDevToolsServer = DevToolsServerAddress('localhost', 8080), FakeResidentRunner(), BufferLogger.test(), ); expect(handler.launchDevToolsInBrowser(flutterDevices: <FlutterDevice>[]), isTrue); expect(handler.launchedInBrowser, isTrue); }); testWithoutContext('Converts a VM Service URI with a query parameter to a pretty display string', () { const String value = 'http://127.0.0.1:9100?uri=http%3A%2F%2F127.0.0.1%3A57922%2F_MXpzytpH20%3D%2F'; final Uri uri = Uri.parse(value); expect(urlToDisplayString(uri), 'http://127.0.0.1:9100?uri=http://127.0.0.1:57922/_MXpzytpH20=/'); }); } class FakeDevtoolsLauncher extends Fake implements DevtoolsLauncher { @override DevToolsServerAddress? activeDevToolsServer; @override Uri? devToolsUrl; @override Future<DevToolsServerAddress?> serve() async => null; @override Future<void> get ready => readyCompleter.future; Completer<void> readyCompleter = Completer<void>()..complete(); } class FakeResidentRunner extends Fake implements ResidentRunner { @override bool supportsServiceProtocol = true; @override bool reportedDebuggers = false; @override DebuggingOptions debuggingOptions = DebuggingOptions.disabled(BuildInfo.debug); } class FakeFlutterDevice extends Fake implements FlutterDevice { @override final Device device = FakeDevice(); @override FlutterVmService? vmService; @override TargetPlatform targetPlatform = TargetPlatform.android_arm; } class FakeDevice extends Fake implements Device { @override DartDevelopmentService get dds => FakeDartDevelopmentService(); } class FakeDartDevelopmentService extends Fake implements DartDevelopmentService { bool started = false; bool disposed = false; @override final Uri uri = Uri.parse('http://127.0.0.1:1234/'); @override Future<void> startDartDevelopmentService( Uri observatoryUri, { required Logger logger, int? hostPort, bool? ipv6, bool? disableServiceAuthCodes, bool cacheStartupProfile = false, }) async { started = true; } @override Future<void> shutdown() async { disposed = true; } @override void setExternalDevToolsUri(Uri uri) {} }
flutter/packages/flutter_tools/test/general.shard/resident_devtools_handler_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/resident_devtools_handler_test.dart", "repo_id": "flutter", "token_count": 6117 }
864
// 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/test/test_time_recorder.dart'; import '../../src/common.dart'; import '../../src/fakes.dart'; import '../../src/logging_logger.dart'; void main() { testWithoutContext('Test phases prints correctly', () { const Duration zero = Duration.zero; const Duration combinedDuration = Duration(seconds: 42); const Duration wallClockDuration = Duration(seconds: 21); for (final TestTimePhases phase in TestTimePhases.values) { final TestTimeRecorder recorder = createRecorderWithTimesForPhase( phase, combinedDuration, wallClockDuration); final Set<String> prints = recorder.getPrintAsListForTesting().toSet(); // Expect one entry per phase. expect(prints, hasLength(TestTimePhases.values.length)); // Expect this phase to have the specified times. expect( prints, contains('Runtime for phase ${phase.name}: ' 'Wall-clock: $wallClockDuration; combined: $combinedDuration.'), ); // Expect all other phases to say 0. for (final TestTimePhases innerPhase in TestTimePhases.values) { if (phase == innerPhase) { continue; } expect( prints, contains('Runtime for phase ${innerPhase.name}: ' 'Wall-clock: $zero; combined: $zero.'), ); } } }); } TestTimeRecorder createRecorderWithTimesForPhase(TestTimePhases phase, Duration combinedDuration, Duration wallClockDuration) { final LoggingLogger logger = LoggingLogger(); final TestTimeRecorder recorder = TestTimeRecorder(logger, stopwatchFactory: FakeStopwatchFactory()); final FakeStopwatch combinedStopwatch = recorder.start(phase) as FakeStopwatch; final FakeStopwatch wallClockStopwatch = recorder.getPhaseWallClockStopwatchForTesting(phase) as FakeStopwatch; wallClockStopwatch.elapsed = wallClockDuration; combinedStopwatch.elapsed = combinedDuration; recorder.stop(phase, combinedStopwatch); return recorder; }
flutter/packages/flutter_tools/test/general.shard/test/test_time_recorder_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/test/test_time_recorder_test.dart", "repo_id": "flutter", "token_count": 742 }
865
// 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' hide Directory, File; import 'package:dwds/dwds.dart'; import 'package:fake_async/fake_async.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/tools/shader_compiler.dart'; import 'package:flutter_tools/src/compile.dart'; import 'package:flutter_tools/src/convert.dart'; import 'package:flutter_tools/src/devfs.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/isolated/devfs_web.dart'; import 'package:flutter_tools/src/web/compile.dart'; import 'package:flutter_tools/src/web_template.dart'; import 'package:logging/logging.dart' as logging; import 'package:package_config/package_config.dart'; import 'package:shelf/shelf.dart'; import 'package:test/fake.dart'; import 'package:vm_service/vm_service.dart' as vm_service; import '../../src/common.dart'; import '../../src/testbed.dart'; const List<int> kTransparentImage = <int>[ 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F, 0x15, 0xC4, 0x89, 0x00, 0x00, 0x00, 0x0A, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9C, 0x63, 0x00, 0x01, 0x00, 0x00, 0x05, 0x00, 0x01, 0x0D, 0x0A, 0x2D, 0xB4, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, ]; void main() { late Testbed testbed; late WebAssetServer webAssetServer; late ReleaseAssetServer releaseAssetServer; late Platform linux; late PackageConfig packages; late Platform windows; late FakeHttpServer httpServer; late BufferLogger logger; const bool usesDdcModuleSystem = false; setUpAll(() async { packages = PackageConfig(<Package>[ Package('flutter_tools', Uri.file('/flutter_tools/lib/').normalizePath()), ]); }); setUp(() { httpServer = FakeHttpServer(); linux = FakePlatform(environment: <String, String>{}); windows = FakePlatform(operatingSystem: 'windows', environment: <String, String>{}); logger = BufferLogger.test(); testbed = Testbed(setup: () { webAssetServer = WebAssetServer( httpServer, packages, InternetAddress.loopbackIPv4, <String, String>{}, <String, String>{}, NullSafetyMode.unsound, usesDdcModuleSystem, webRenderer: WebRendererMode.canvaskit, ); releaseAssetServer = ReleaseAssetServer( globals.fs.file('main.dart').uri, fileSystem: globals.fs, flutterRoot: null, platform: FakePlatform(), webBuildDirectory: null, ); }, overrides: <Type, Generator>{ Logger: () => logger, }); }); test('.log() reports warnings', () => testbed.run(() { const String unresolvedUriMessage = 'Unresolved uri:'; const String otherMessage = 'Something bad happened'; final List<logging.LogRecord> events = <logging.LogRecord>[ logging.LogRecord( logging.Level.WARNING, unresolvedUriMessage, 'DartUri', ), logging.LogRecord( logging.Level.WARNING, otherMessage, 'DartUri', ), ]; events.forEach(log); expect(logger.warningText, contains(unresolvedUriMessage)); expect(logger.warningText, contains(otherMessage)); })); test('Handles against malformed manifest', () => testbed.run(() async { final File source = globals.fs.file('source') ..writeAsStringSync('main() {}'); final File sourcemap = globals.fs.file('sourcemap') ..writeAsStringSync('{}'); final File metadata = globals.fs.file('metadata') ..writeAsStringSync('{}'); // Missing ending offset. final File manifestMissingOffset = globals.fs.file('manifestA') ..writeAsStringSync(json.encode(<String, Object>{ '/foo.js': <String, Object>{ 'code': <int>[0], 'sourcemap': <int>[0], 'metadata': <int>[0], }, })); final File manifestOutOfBounds = globals.fs.file('manifest') ..writeAsStringSync(json.encode(<String, Object>{ '/foo.js': <String, Object>{ 'code': <int>[0, 100], 'sourcemap': <int>[0], 'metadata': <int>[0], }, })); expect(webAssetServer.write(source, manifestMissingOffset, sourcemap, metadata), isEmpty); expect(webAssetServer.write(source, manifestOutOfBounds, sourcemap, metadata), isEmpty); })); test('serves JavaScript files from in memory cache', () => testbed.run(() async { final File source = globals.fs.file('source') ..writeAsStringSync('main() {}'); final File sourcemap = globals.fs.file('sourcemap') ..writeAsStringSync('{}'); final File metadata = globals.fs.file('metadata') ..writeAsStringSync('{}'); final File manifest = globals.fs.file('manifest') ..writeAsStringSync(json.encode(<String, Object>{ '/foo.js': <String, Object>{ 'code': <int>[0, source.lengthSync()], 'sourcemap': <int>[0, 2], 'metadata': <int>[0, 2], }, })); webAssetServer.write(source, manifest, sourcemap, metadata); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/foo.js'))); expect(response.headers, allOf(<Matcher>[ containsPair(HttpHeaders.contentLengthHeader, source.lengthSync().toString()), containsPair(HttpHeaders.contentTypeHeader, 'application/javascript'), containsPair(HttpHeaders.etagHeader, isNotNull), ])); expect((await response.read().toList()).first, source.readAsBytesSync()); }, overrides: <Type, Generator>{ Platform: () => linux, })); test('serves metadata files from in memory cache', () => testbed.run(() async { const String metadataContents = '{"name":"foo"}'; final File source = globals.fs.file('source') ..writeAsStringSync('main() {}'); final File sourcemap = globals.fs.file('sourcemap') ..writeAsStringSync('{}'); final File metadata = globals.fs.file('metadata') ..writeAsStringSync(metadataContents); final File manifest = globals.fs.file('manifest') ..writeAsStringSync(json.encode(<String, Object>{ '/foo.js': <String, Object>{ 'code': <int>[0, source.lengthSync()], 'sourcemap': <int>[0, sourcemap.lengthSync()], 'metadata': <int>[0, metadata.lengthSync()], }, })); webAssetServer.write(source, manifest, sourcemap, metadata); final String? merged = await webAssetServer.metadataContents('main_module.ddc_merged_metadata'); expect(merged, equals(metadataContents)); final String? single = await webAssetServer.metadataContents('foo.js.metadata'); expect(single, equals(metadataContents)); }, overrides: <Type, Generator>{ Platform: () => linux, })); test('Removes leading slashes for valid requests to avoid requesting outside' ' of served directory', () => testbed.run(() async { globals.fs.file('foo.png').createSync(); globals.fs.currentDirectory = globals.fs.directory('project_directory') ..createSync(); final File source = globals.fs.file(globals.fs.path.join('web', 'foo.png')) ..createSync(recursive: true) ..writeAsBytesSync(kTransparentImage); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar////foo.png'))); expect(response.headers, allOf(<Matcher>[ containsPair(HttpHeaders.contentLengthHeader, source.lengthSync().toString()), containsPair(HttpHeaders.contentTypeHeader, 'image/png'), containsPair(HttpHeaders.etagHeader, isNotNull), containsPair(HttpHeaders.cacheControlHeader, 'max-age=0, must-revalidate'), ])); expect((await response.read().toList()).first, source.readAsBytesSync()); })); test('takes base path into account when serving', () => testbed.run(() async { webAssetServer.basePath = 'base/path'; globals.fs.file('foo.png').createSync(); globals.fs.currentDirectory = globals.fs.directory('project_directory') ..createSync(); final File source = globals.fs.file(globals.fs.path.join('web', 'foo.png')) ..createSync(recursive: true) ..writeAsBytesSync(kTransparentImage); final Response response = await webAssetServer.handleRequest( Request('GET', Uri.parse('http://foobar/base/path/foo.png')), ); expect(response.headers, allOf(<Matcher>[ containsPair(HttpHeaders.contentLengthHeader, source.lengthSync().toString()), containsPair(HttpHeaders.contentTypeHeader, 'image/png'), containsPair(HttpHeaders.etagHeader, isNotNull), containsPair(HttpHeaders.cacheControlHeader, 'max-age=0, must-revalidate'), ])); expect((await response.read().toList()).first, source.readAsBytesSync()); })); test('serves index.html at the base path', () => testbed.run(() async { webAssetServer.basePath = 'base/path'; const String htmlContent = '<html><head></head><body id="test"></body></html>'; final Directory webDir = globals.fs.currentDirectory .childDirectory('web') ..createSync(); webDir.childFile('index.html').writeAsStringSync(htmlContent); globals.fs.file(globals.fs.path.join( globals.artifacts!.getHostArtifact(HostArtifact.flutterJsDirectory).path, 'flutter.js', ))..createSync(recursive: true)..writeAsStringSync('flutter.js content'); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/base/path/'))); expect(response.statusCode, HttpStatus.ok); expect(await response.readAsString(), htmlContent); })); test('serves index.html at / if href attribute is $kBaseHrefPlaceholder', () => testbed.run(() async { const String htmlContent = '<html><head><base href ="$kBaseHrefPlaceholder"></head><body id="test"></body></html>'; final Directory webDir = globals.fs.currentDirectory.childDirectory('web') ..createSync(); webDir.childFile('index.html').writeAsStringSync(htmlContent); globals.fs.file(globals.fs.path.join( globals.artifacts!.getHostArtifact(HostArtifact.flutterJsDirectory).path, 'flutter.js', ))..createSync(recursive: true)..writeAsStringSync('flutter.js content'); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/'))); expect(response.statusCode, HttpStatus.ok); expect(await response.readAsString(), htmlContent.replaceAll(kBaseHrefPlaceholder, '/')); })); test('does not serve outside the base path', () => testbed.run(() async { webAssetServer.basePath = 'base/path'; const String htmlContent = '<html><head></head><body id="test"></body></html>'; final Directory webDir = globals.fs.currentDirectory .childDirectory('web') ..createSync(); webDir.childFile('index.html').writeAsStringSync(htmlContent); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/'))); expect(response.statusCode, HttpStatus.notFound); })); test('parses base path from index.html', () => testbed.run(() async { const String htmlContent = '<html><head><base href="/foo/bar/"></head><body id="test"></body></html>'; final Directory webDir = globals.fs.currentDirectory .childDirectory('web') ..createSync(); webDir.childFile('index.html').writeAsStringSync(htmlContent); final WebAssetServer webAssetServer = WebAssetServer( httpServer, packages, InternetAddress.loopbackIPv4, <String, String>{}, <String, String>{}, NullSafetyMode.unsound, usesDdcModuleSystem, webRenderer: WebRendererMode.canvaskit, ); expect(webAssetServer.basePath, 'foo/bar'); })); test('handles lack of base path in index.html', () => testbed.run(() async { const String htmlContent = '<html><head></head><body id="test"></body></html>'; final Directory webDir = globals.fs.currentDirectory .childDirectory('web') ..createSync(); webDir.childFile('index.html').writeAsStringSync(htmlContent); final WebAssetServer webAssetServer = WebAssetServer( httpServer, packages, InternetAddress.loopbackIPv4, <String, String>{}, <String, String>{}, NullSafetyMode.unsound, usesDdcModuleSystem, webRenderer: WebRendererMode.canvaskit, ); // Defaults to "/" when there's no base element. expect(webAssetServer.basePath, ''); })); test('throws if base path is relative', () => testbed.run(() async { const String htmlContent = '<html><head><base href="foo/bar/"></head><body id="test"></body></html>'; final Directory webDir = globals.fs.currentDirectory .childDirectory('web') ..createSync(); webDir.childFile('index.html').writeAsStringSync(htmlContent); expect( () => WebAssetServer( httpServer, packages, InternetAddress.loopbackIPv4, <String, String>{}, <String, String>{}, NullSafetyMode.unsound, usesDdcModuleSystem, webRenderer: WebRendererMode.canvaskit, ), throwsToolExit(), ); })); test('throws if base path does not end with slash', () => testbed.run(() async { const String htmlContent = '<html><head><base href="/foo/bar"></head><body id="test"></body></html>'; final Directory webDir = globals.fs.currentDirectory .childDirectory('web') ..createSync(); webDir.childFile('index.html').writeAsStringSync(htmlContent); expect( () => WebAssetServer( httpServer, packages, InternetAddress.loopbackIPv4, <String, String>{}, <String, String>{}, NullSafetyMode.unsound, usesDdcModuleSystem, webRenderer: WebRendererMode.canvaskit, ), throwsToolExit(), ); })); test('serves JavaScript files from in memory cache not from manifest', () => testbed.run(() async { webAssetServer.writeFile('foo.js', 'main() {}'); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/foo.js'))); expect(response.headers, allOf(<Matcher>[ containsPair(HttpHeaders.contentLengthHeader, '9'), containsPair(HttpHeaders.contentTypeHeader, 'application/javascript'), containsPair(HttpHeaders.etagHeader, isNotNull), containsPair(HttpHeaders.cacheControlHeader, 'max-age=0, must-revalidate'), ])); expect((await response.read().toList()).first, utf8.encode('main() {}')); })); test('Returns notModified when the ifNoneMatch header matches the etag', () => testbed.run(() async { webAssetServer.writeFile('foo.js', 'main() {}'); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/foo.js'))); final String etag = response.headers[HttpHeaders.etagHeader]!; final Response cachedResponse = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/foo.js'), headers: <String, String>{ HttpHeaders.ifNoneMatchHeader: etag, })); expect(cachedResponse.statusCode, HttpStatus.notModified); expect(await cachedResponse.read().toList(), isEmpty); })); test('serves index.html when path is unknown', () => testbed.run(() async { const String htmlContent = '<html><head></head><body id="test"></body></html>'; final Directory webDir = globals.fs.currentDirectory .childDirectory('web') ..createSync(); webDir.childFile('index.html').writeAsStringSync(htmlContent); globals.fs.file(globals.fs.path.join( globals.artifacts!.getHostArtifact(HostArtifact.flutterJsDirectory).path, 'flutter.js', ))..createSync(recursive: true)..writeAsStringSync('flutter.js content'); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/bar/baz'))); expect(response.statusCode, HttpStatus.ok); expect(await response.readAsString(), htmlContent); })); test('does not serve outside the base path', () => testbed.run(() async { webAssetServer.basePath = 'base/path'; const String htmlContent = '<html><head></head><body id="test"></body></html>'; final Directory webDir = globals.fs.currentDirectory .childDirectory('web') ..createSync(); webDir.childFile('index.html').writeAsStringSync(htmlContent); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/'))); expect(response.statusCode, HttpStatus.notFound); })); test('does not serve index.html when path is inside assets or packages', () => testbed.run(() async { const String htmlContent = '<html><head></head><body id="test"></body></html>'; final Directory webDir = globals.fs.currentDirectory .childDirectory('web') ..createSync(); webDir.childFile('index.html').writeAsStringSync(htmlContent); Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/assets/foo/bar.png'))); expect(response.statusCode, HttpStatus.notFound); response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/packages/foo/bar.dart.js'))); expect(response.statusCode, HttpStatus.notFound); webAssetServer.basePath = 'base/path'; response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/base/path/assets/foo/bar.png'))); expect(response.statusCode, HttpStatus.notFound); response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/base/path/packages/foo/bar.dart.js'))); expect(response.statusCode, HttpStatus.notFound); })); test('serves default index.html', () => testbed.run(() async { globals.fs.file(globals.fs.path.join( globals.artifacts!.getHostArtifact(HostArtifact.flutterJsDirectory).path, 'flutter.js', ))..createSync(recursive: true)..writeAsStringSync('flutter.js content'); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/'))); expect(response.statusCode, HttpStatus.ok); expect((await response.read().toList()).first, containsAllInOrder(utf8.encode('<html>'))); })); test('handles web server paths without .lib extension', () => testbed.run(() async { final File source = globals.fs.file('source') ..writeAsStringSync('main() {}'); final File sourcemap = globals.fs.file('sourcemap') ..writeAsStringSync('{}'); final File metadata = globals.fs.file('metadata') ..writeAsStringSync('{}'); final File manifest = globals.fs.file('manifest') ..writeAsStringSync(json.encode(<String, Object>{ '/foo.dart.lib.js': <String, Object>{ 'code': <int>[0, source.lengthSync()], 'sourcemap': <int>[0, 2], 'metadata': <int>[0, 2], }, })); webAssetServer.write(source, manifest, sourcemap, metadata); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/foo.dart.js'))); expect(response.statusCode, HttpStatus.ok); })); test('serves JavaScript files from in memory cache on Windows', () => testbed.run(() async { final File source = globals.fs.file('source') ..writeAsStringSync('main() {}'); final File sourcemap = globals.fs.file('sourcemap') ..writeAsStringSync('{}'); final File metadata = globals.fs.file('metadata') ..writeAsStringSync('{}'); final File manifest = globals.fs.file('manifest') ..writeAsStringSync(json.encode(<String, Object>{ '/foo.js': <String, Object>{ 'code': <int>[0, source.lengthSync()], 'sourcemap': <int>[0, 2], 'metadata': <int>[0, 2], }, })); webAssetServer.write(source, manifest, sourcemap, metadata); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://localhost/foo.js'))); expect(response.headers, allOf(<Matcher>[ containsPair(HttpHeaders.contentLengthHeader, source.lengthSync().toString()), containsPair(HttpHeaders.contentTypeHeader, 'application/javascript'), containsPair(HttpHeaders.etagHeader, isNotNull), containsPair(HttpHeaders.cacheControlHeader, 'max-age=0, must-revalidate'), ])); expect((await response.read().toList()).first, source.readAsBytesSync()); }, overrides: <Type, Generator>{ Platform: () => windows, })); test('serves asset files from in filesystem with url-encoded paths', () => testbed.run(() async { final File source = globals.fs.file(globals.fs.path.join('build', 'flutter_assets', Uri.encodeFull('abcd象形字.png'))) ..createSync(recursive: true) ..writeAsBytesSync(kTransparentImage); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/assets/abcd%25E8%25B1%25A1%25E5%25BD%25A2%25E5%25AD%2597.png'))); expect(response.headers, allOf(<Matcher>[ containsPair(HttpHeaders.contentLengthHeader, source.lengthSync().toString()), containsPair(HttpHeaders.contentTypeHeader, 'image/png'), containsPair(HttpHeaders.etagHeader, isNotNull), containsPair(HttpHeaders.cacheControlHeader, 'max-age=0, must-revalidate'), ])); expect((await response.read().toList()).first, source.readAsBytesSync()); })); test('serves files from web directory', () => testbed.run(() async { final File source = globals.fs.file(globals.fs.path.join('web', 'foo.png')) ..createSync(recursive: true) ..writeAsBytesSync(kTransparentImage); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/foo.png'))); expect(response.headers, allOf(<Matcher>[ containsPair(HttpHeaders.contentLengthHeader, source.lengthSync().toString()), containsPair(HttpHeaders.contentTypeHeader, 'image/png'), containsPair(HttpHeaders.etagHeader, isNotNull), containsPair(HttpHeaders.cacheControlHeader, 'max-age=0, must-revalidate'), ])); expect((await response.read().toList()).first, source.readAsBytesSync()); })); test('serves asset files from in filesystem with known mime type on Windows', () => testbed.run(() async { final File source = globals.fs.file(globals.fs.path.join('build', 'flutter_assets', 'foo.png')) ..createSync(recursive: true) ..writeAsBytesSync(kTransparentImage); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/assets/foo.png'))); expect(response.headers, allOf(<Matcher>[ containsPair(HttpHeaders.contentLengthHeader, source.lengthSync().toString()), containsPair(HttpHeaders.contentTypeHeader, 'image/png'), containsPair(HttpHeaders.etagHeader, isNotNull), containsPair(HttpHeaders.cacheControlHeader, 'max-age=0, must-revalidate'), ])); expect((await response.read().toList()).first, source.readAsBytesSync()); }, overrides: <Type, Generator>{ Platform: () => windows, })); test('serves Dart files from in filesystem on Linux/macOS', () => testbed.run(() async { final File source = globals.fs.file('foo.dart').absolute ..createSync(recursive: true) ..writeAsStringSync('void main() {}'); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/foo.dart'))); expect(response.headers, containsPair(HttpHeaders.contentLengthHeader, source.lengthSync().toString())); expect((await response.read().toList()).first, source.readAsBytesSync()); }, overrides: <Type, Generator>{ Platform: () => linux, })); test('serves asset files from in filesystem with known mime type', () => testbed.run(() async { final File source = globals.fs.file(globals.fs.path.join('build', 'flutter_assets', 'foo.png')) ..createSync(recursive: true) ..writeAsBytesSync(kTransparentImage); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/assets/foo.png'))); expect(response.headers, allOf(<Matcher>[ containsPair(HttpHeaders.contentLengthHeader, source.lengthSync().toString()), containsPair(HttpHeaders.contentTypeHeader, 'image/png'), ])); expect((await response.read().toList()).first, source.readAsBytesSync()); })); test('serves asset files from in filesystem with known mime type and empty content', () => testbed.run(() async { final File source = globals.fs.file(globals.fs.path.join('web', 'foo.js')) ..createSync(recursive: true); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/foo.js'))); expect(response.headers, allOf(<Matcher>[ containsPair(HttpHeaders.contentLengthHeader, '0'), containsPair(HttpHeaders.contentTypeHeader, 'text/javascript'), ])); expect((await response.read().toList()).first, source.readAsBytesSync()); })); test('serves asset files from in filesystem with unknown mime type', () => testbed.run(() async { final File source = globals.fs.file(globals.fs.path.join('build', 'flutter_assets', 'foo')) ..createSync(recursive: true) ..writeAsBytesSync(List<int>.filled(100, 0)); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/assets/foo'))); expect(response.headers, allOf(<Matcher>[ containsPair(HttpHeaders.contentLengthHeader, '100'), containsPair(HttpHeaders.contentTypeHeader, 'application/octet-stream'), ])); expect((await response.read().toList()).first, source.readAsBytesSync()); })); test('serves valid etag header for asset files with non-ascii characters', () => testbed.run(() async { globals.fs.file(globals.fs.path.join('build', 'flutter_assets', 'fooπ')) ..createSync(recursive: true) ..writeAsBytesSync(<int>[1, 2, 3]); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http://foobar/assets/fooπ'))); final String etag = response.headers[HttpHeaders.etagHeader]!; expect(etag.runes, everyElement(predicate((int char) => char < 255))); })); test('serves /packages/<package>/<path> files as if they were ' 'package:<package>/<path> uris', () => testbed.run(() async { final Uri? expectedUri = packages.resolve( Uri.parse('package:flutter_tools/foo.dart')); final File source = globals.fs.file(globals.fs.path.fromUri(expectedUri)) ..createSync(recursive: true) ..writeAsBytesSync(<int>[1, 2, 3]); final Response response = await webAssetServer .handleRequest(Request('GET', Uri.parse('http:///packages/flutter_tools/foo.dart'))); expect(response.headers, allOf(<Matcher>[ containsPair(HttpHeaders.contentLengthHeader, '3'), containsPair(HttpHeaders.contentTypeHeader, 'text/x-dart'), ])); expect((await response.read().toList()).first, source.readAsBytesSync()); })); test('calling dispose closes the http server', () => testbed.run(() async { await webAssetServer.dispose(); expect(httpServer.closed, true); })); test('Can start web server with specified AMD module system assets', () => testbed.run(() async { final File outputFile = globals.fs.file(globals.fs.path.join('lib', 'main.dart')) ..createSync(recursive: true); outputFile.parent.childFile('a.sources').writeAsStringSync(''); outputFile.parent.childFile('a.json').writeAsStringSync('{}'); outputFile.parent.childFile('a.map').writeAsStringSync('{}'); outputFile.parent.childFile('a.metadata').writeAsStringSync('{}'); final ResidentCompiler residentCompiler = FakeResidentCompiler() ..output = const CompilerOutput('a', 0, <Uri>[]); final WebDevFS webDevFS = WebDevFS( hostname: 'localhost', port: 0, tlsCertPath: null, tlsCertKeyPath: null, packagesFilePath: '.packages', urlTunneller: null, useSseForDebugProxy: true, useSseForDebugBackend: true, useSseForInjectedClient: true, nullAssertions: true, nativeNullAssertions: true, buildInfo: const BuildInfo( BuildMode.debug, '', treeShakeIcons: false, nullSafetyMode: NullSafetyMode.unsound, ), enableDwds: false, enableDds: false, entrypoint: Uri.base, testMode: true, expressionCompiler: null, extraHeaders: const <String, String>{}, chromiumLauncher: null, nullSafetyMode: NullSafetyMode.unsound, ddcModuleSystem: usesDdcModuleSystem, webRenderer: WebRendererMode.html, rootDirectory: globals.fs.currentDirectory, ); webDevFS.requireJS.createSync(recursive: true); webDevFS.flutterJs.createSync(recursive: true); webDevFS.stackTraceMapper.createSync(recursive: true); final Uri uri = await webDevFS.create(); webDevFS.webAssetServer.entrypointCacheDirectory = globals.fs.currentDirectory; final String webPrecompiledSdk = globals.artifacts! .getHostArtifact(HostArtifact.webPrecompiledAmdSdk).path; final String webPrecompiledSdkSourcemaps = globals.artifacts! .getHostArtifact(HostArtifact.webPrecompiledAmdSdkSourcemaps).path; final String webPrecompiledCanvaskitSdk = globals.artifacts! .getHostArtifact(HostArtifact.webPrecompiledAmdCanvaskitSdk).path; final String webPrecompiledCanvaskitSdkSourcemaps = globals.artifacts! .getHostArtifact(HostArtifact.webPrecompiledAmdCanvaskitSdkSourcemaps).path; globals.fs.currentDirectory .childDirectory('lib') .childFile('web_entrypoint.dart') ..createSync(recursive: true) ..writeAsStringSync('GENERATED'); globals.fs.file(webPrecompiledSdk) ..createSync(recursive: true) ..writeAsStringSync('HELLO'); globals.fs.file(webPrecompiledSdkSourcemaps) ..createSync(recursive: true) ..writeAsStringSync('THERE'); globals.fs.file(webPrecompiledCanvaskitSdk) ..createSync(recursive: true) ..writeAsStringSync('OL'); globals.fs.file(webPrecompiledCanvaskitSdkSourcemaps) ..createSync(recursive: true) ..writeAsStringSync('CHUM'); await webDevFS.update( mainUri: globals.fs.file(globals.fs.path.join('lib', 'main.dart')).uri, generator: residentCompiler, trackWidgetCreation: true, bundleFirstUpload: true, invalidatedFiles: <Uri>[], packageConfig: PackageConfig.empty, pathToReload: '', dillOutputPath: 'out.dill', shaderCompiler: const FakeShaderCompiler(), ); expect(webDevFS.webAssetServer.getFile('require.js'), isNotNull); expect(webDevFS.webAssetServer.getFile('stack_trace_mapper.js'), isNotNull); expect(webDevFS.webAssetServer.getFile('main.dart'), isNotNull); expect(webDevFS.webAssetServer.getFile('manifest.json'), isNotNull); expect(webDevFS.webAssetServer.getFile('flutter.js'), isNotNull); expect(webDevFS.webAssetServer.getFile('flutter_service_worker.js'), isNotNull); expect(webDevFS.webAssetServer.getFile('version.json'),isNotNull); expect(await webDevFS.webAssetServer.dartSourceContents('dart_sdk.js'), 'HELLO'); expect(await webDevFS.webAssetServer.dartSourceContents('dart_sdk.js.map'), 'THERE'); // Update to the SDK. globals.fs.file(webPrecompiledSdk).writeAsStringSync('BELLOW'); // New SDK should be visible.. expect(await webDevFS.webAssetServer.dartSourceContents('dart_sdk.js'), 'BELLOW'); // Generated entrypoint. expect(await webDevFS.webAssetServer.dartSourceContents('web_entrypoint.dart'), contains('GENERATED')); // served on localhost expect(uri.host, 'localhost'); await webDevFS.destroy(); }, overrides: <Type, Generator>{ Artifacts: () => Artifacts.test(), })); test('Can start web server with specified assets in sound null safety mode', () => testbed.run(() async { final File outputFile = globals.fs.file(globals.fs.path.join('lib', 'main.dart')) ..createSync(recursive: true); outputFile.parent.childFile('a.sources').writeAsStringSync(''); outputFile.parent.childFile('a.json').writeAsStringSync('{}'); outputFile.parent.childFile('a.map').writeAsStringSync('{}'); outputFile.parent.childFile('a.metadata').writeAsStringSync('{}'); final ResidentCompiler residentCompiler = FakeResidentCompiler() ..output = const CompilerOutput('a', 0, <Uri>[]); final WebDevFS webDevFS = WebDevFS( hostname: 'localhost', port: 0, tlsCertPath: null, tlsCertKeyPath: null, packagesFilePath: '.packages', urlTunneller: null, useSseForDebugProxy: true, useSseForDebugBackend: true, useSseForInjectedClient: true, nullAssertions: true, nativeNullAssertions: true, buildInfo: const BuildInfo( BuildMode.debug, '', treeShakeIcons: false, ), enableDwds: false, enableDds: false, entrypoint: Uri.base, testMode: true, expressionCompiler: null, extraHeaders: const <String, String>{}, chromiumLauncher: null, nullSafetyMode: NullSafetyMode.sound, ddcModuleSystem: usesDdcModuleSystem, webRenderer: WebRendererMode.html, rootDirectory: globals.fs.currentDirectory, ); webDevFS.requireJS.createSync(recursive: true); webDevFS.flutterJs.createSync(recursive: true); webDevFS.stackTraceMapper.createSync(recursive: true); final Uri uri = await webDevFS.create(); webDevFS.webAssetServer.entrypointCacheDirectory = globals.fs.currentDirectory; globals.fs.currentDirectory .childDirectory('lib') .childFile('web_entrypoint.dart') ..createSync(recursive: true) ..writeAsStringSync('GENERATED'); final String webPrecompiledSdk = globals.artifacts! .getHostArtifact(HostArtifact.webPrecompiledAmdSoundSdk).path; final String webPrecompiledSdkSourcemaps = globals.artifacts! .getHostArtifact(HostArtifact.webPrecompiledAmdSoundSdkSourcemaps).path; final String webPrecompiledCanvaskitSdk = globals.artifacts! .getHostArtifact(HostArtifact.webPrecompiledAmdCanvaskitSoundSdk).path; final String webPrecompiledCanvaskitSdkSourcemaps = globals.artifacts! .getHostArtifact(HostArtifact.webPrecompiledAmdCanvaskitSoundSdkSourcemaps).path; final String flutterJs = globals.fs.path.join( globals.artifacts!.getHostArtifact(HostArtifact.flutterJsDirectory).path, 'flutter.js', ); globals.fs.file(webPrecompiledSdk) ..createSync(recursive: true) ..writeAsStringSync('HELLO'); globals.fs.file(webPrecompiledSdkSourcemaps) ..createSync(recursive: true) ..writeAsStringSync('THERE'); globals.fs.file(webPrecompiledCanvaskitSdk) ..createSync(recursive: true) ..writeAsStringSync('OL'); globals.fs.file(webPrecompiledCanvaskitSdkSourcemaps) ..createSync(recursive: true) ..writeAsStringSync('CHUM'); globals.fs.file(flutterJs) ..createSync(recursive: true) ..writeAsStringSync('(flutter.js content)'); await webDevFS.update( mainUri: globals.fs.file(globals.fs.path.join('lib', 'main.dart')).uri, generator: residentCompiler, trackWidgetCreation: true, bundleFirstUpload: true, invalidatedFiles: <Uri>[], packageConfig: PackageConfig.empty, pathToReload: '', dillOutputPath: '', shaderCompiler: const FakeShaderCompiler(), ); expect(webDevFS.webAssetServer.getFile('require.js'), isNotNull); expect(webDevFS.webAssetServer.getFile('stack_trace_mapper.js'), isNotNull); expect(webDevFS.webAssetServer.getFile('main.dart'), isNotNull); expect(webDevFS.webAssetServer.getFile('manifest.json'), isNotNull); expect(webDevFS.webAssetServer.getFile('flutter.js'), isNotNull); expect(webDevFS.webAssetServer.getFile('flutter_service_worker.js'), isNotNull); expect(webDevFS.webAssetServer.getFile('version.json'), isNotNull); expect(await webDevFS.webAssetServer.dartSourceContents('dart_sdk.js'), 'HELLO'); expect(await webDevFS.webAssetServer.dartSourceContents('dart_sdk.js.map'), 'THERE'); // Update to the SDK. globals.fs.file(webPrecompiledSdk).writeAsStringSync('BELLOW'); // New SDK should be visible.. expect(await webDevFS.webAssetServer.dartSourceContents('dart_sdk.js'), 'BELLOW'); // Generated entrypoint. expect(await webDevFS.webAssetServer.dartSourceContents('web_entrypoint.dart'), contains('GENERATED')); // served on localhost expect(uri.host, 'localhost'); await webDevFS.destroy(); }, overrides: <Type, Generator>{ Artifacts: () => Artifacts.test(), })); test('.connect() will never call vmServiceFactory twice', () => testbed.run(() async { await FakeAsync().run<Future<void>>((FakeAsync time) { final File outputFile = globals.fs.file(globals.fs.path.join('lib', 'main.dart')) ..createSync(recursive: true); outputFile.parent.childFile('a.sources').writeAsStringSync(''); outputFile.parent.childFile('a.json').writeAsStringSync('{}'); outputFile.parent.childFile('a.map').writeAsStringSync('{}'); outputFile.parent.childFile('a.metadata').writeAsStringSync('{}'); final WebDevFS webDevFS = WebDevFS( // if this is any other value, we will do a real ip lookup hostname: 'any', port: 0, tlsCertPath: null, tlsCertKeyPath: null, packagesFilePath: '.packages', urlTunneller: null, useSseForDebugProxy: true, useSseForDebugBackend: true, useSseForInjectedClient: true, nullAssertions: true, nativeNullAssertions: true, buildInfo: const BuildInfo( BuildMode.debug, '', treeShakeIcons: false, ), enableDwds: true, enableDds: false, entrypoint: Uri.base, testMode: true, expressionCompiler: null, extraHeaders: const <String, String>{}, chromiumLauncher: null, nullSafetyMode: NullSafetyMode.sound, ddcModuleSystem: usesDdcModuleSystem, webRenderer: WebRendererMode.canvaskit, rootDirectory: globals.fs.currentDirectory, ); webDevFS.requireJS.createSync(recursive: true); webDevFS.stackTraceMapper.createSync(recursive: true); final FakeAppConnection firstConnection = FakeAppConnection(); final FakeAppConnection secondConnection = FakeAppConnection(); final Future<void> done = webDevFS.create().then<void>((Uri _) { // In non-test mode, webDevFS.create() would have initialized DWDS webDevFS.webAssetServer.dwds = FakeDwds(<AppConnection>[firstConnection, secondConnection]); int vmServiceFactoryInvocationCount = 0; Future<vm_service.VmService> vmServiceFactory(Uri uri, {CompressionOptions? compression, required Logger logger}) { if (vmServiceFactoryInvocationCount > 0) { fail('Called vmServiceFactory twice!'); } vmServiceFactoryInvocationCount += 1; return Future<vm_service.VmService>.delayed( const Duration(seconds: 2), () => FakeVmService(), ); } return webDevFS.connect(false, vmServiceFactory: vmServiceFactory).then<void>((ConnectionResult? firstConnectionResult) { return webDevFS.destroy(); }); }); time.elapse(const Duration(seconds: 1)); time.elapse(const Duration(seconds: 2)); return done; }); }, overrides: <Type, Generator>{ Artifacts: () => Artifacts.test(), })); test('Can start web server with hostname any', () => testbed.run(() async { final File outputFile = globals.fs.file(globals.fs.path.join('lib', 'main.dart')) ..createSync(recursive: true); outputFile.parent.childFile('a.sources').writeAsStringSync(''); outputFile.parent.childFile('a.json').writeAsStringSync('{}'); outputFile.parent.childFile('a.map').writeAsStringSync('{}'); final WebDevFS webDevFS = WebDevFS( hostname: 'any', port: 0, tlsCertPath: null, tlsCertKeyPath: null, packagesFilePath: '.packages', urlTunneller: null, useSseForDebugProxy: true, useSseForDebugBackend: true, useSseForInjectedClient: true, buildInfo: BuildInfo.debug, enableDwds: false, enableDds: false, entrypoint: Uri.base, testMode: true, expressionCompiler: null, extraHeaders: const <String, String>{}, chromiumLauncher: null, nullAssertions: true, nativeNullAssertions: true, nullSafetyMode: NullSafetyMode.sound, ddcModuleSystem: usesDdcModuleSystem, webRenderer: WebRendererMode.canvaskit, rootDirectory: globals.fs.currentDirectory, ); webDevFS.requireJS.createSync(recursive: true); webDevFS.stackTraceMapper.createSync(recursive: true); final Uri uri = await webDevFS.create(); expect(uri.host, 'localhost'); await webDevFS.destroy(); })); test('Can start web server with canvaskit enabled', () => testbed.run(() async { final File outputFile = globals.fs.file(globals.fs.path.join('lib', 'main.dart')) ..createSync(recursive: true); outputFile.parent.childFile('a.sources').writeAsStringSync(''); outputFile.parent.childFile('a.json').writeAsStringSync('{}'); outputFile.parent.childFile('a.map').writeAsStringSync('{}'); final WebDevFS webDevFS = WebDevFS( hostname: 'localhost', port: 0, tlsCertPath: null, tlsCertKeyPath: null, packagesFilePath: '.packages', urlTunneller: null, useSseForDebugProxy: true, useSseForDebugBackend: true, useSseForInjectedClient: true, nullAssertions: true, nativeNullAssertions: true, buildInfo: const BuildInfo( BuildMode.debug, '', treeShakeIcons: false, dartDefines: <String>[ 'FLUTTER_WEB_USE_SKIA=true', ] ), enableDwds: false, enableDds: false, entrypoint: Uri.base, testMode: true, expressionCompiler: null, extraHeaders: const <String, String>{}, chromiumLauncher: null, nullSafetyMode: NullSafetyMode.sound, ddcModuleSystem: usesDdcModuleSystem, webRenderer: WebRendererMode.canvaskit, rootDirectory: globals.fs.currentDirectory, ); webDevFS.requireJS.createSync(recursive: true); webDevFS.stackTraceMapper.createSync(recursive: true); await webDevFS.create(); expect(webDevFS.webAssetServer.webRenderer, WebRendererMode.canvaskit); await webDevFS.destroy(); })); test('Can start web server with auto detect enabled', () => testbed.run(() async { final File outputFile = globals.fs.file(globals.fs.path.join('lib', 'main.dart')) ..createSync(recursive: true); outputFile.parent.childFile('a.sources').writeAsStringSync(''); outputFile.parent.childFile('a.json').writeAsStringSync('{}'); outputFile.parent.childFile('a.map').writeAsStringSync('{}'); final WebDevFS webDevFS = WebDevFS( hostname: 'localhost', port: 0, tlsCertPath: null, tlsCertKeyPath: null, packagesFilePath: '.packages', urlTunneller: null, useSseForDebugProxy: true, useSseForDebugBackend: true, useSseForInjectedClient: true, nullAssertions: true, nativeNullAssertions: true, buildInfo: const BuildInfo( BuildMode.debug, '', treeShakeIcons: false, dartDefines: <String>[ 'FLUTTER_WEB_AUTO_DETECT=true', ] ), enableDwds: false, enableDds: false, entrypoint: Uri.base, testMode: true, expressionCompiler: null, extraHeaders: const <String, String>{}, chromiumLauncher: null, nullSafetyMode: NullSafetyMode.sound, ddcModuleSystem: usesDdcModuleSystem, webRenderer: WebRendererMode.auto, rootDirectory: globals.fs.currentDirectory, ); webDevFS.requireJS.createSync(recursive: true); webDevFS.stackTraceMapper.createSync(recursive: true); await webDevFS.create(); expect(webDevFS.webAssetServer.webRenderer, WebRendererMode.auto); await webDevFS.destroy(); })); test('Can start web server with tls connection', () => testbed.run(() async { final String dataPath = globals.fs.path.join( getFlutterRoot(), 'packages', 'flutter_tools', 'test', 'data', 'asset_test', ); final String dummyCertPath = globals.fs.path.join(dataPath, 'tls_cert', 'dummy-cert.pem'); final String dummyCertKeyPath = globals.fs.path.join(dataPath, 'tls_cert', 'dummy-key.pem'); final WebDevFS webDevFS = WebDevFS( hostname: 'localhost', port: 0, tlsCertPath: dummyCertPath, tlsCertKeyPath: dummyCertKeyPath, packagesFilePath: '.packages', urlTunneller: null, useSseForDebugProxy: true, useSseForDebugBackend: true, useSseForInjectedClient: true, nullAssertions: true, nativeNullAssertions: true, buildInfo: BuildInfo.debug, enableDwds: false, enableDds: false, entrypoint: Uri.base, testMode: true, expressionCompiler: null, extraHeaders: const <String, String>{}, chromiumLauncher: null, nullSafetyMode: NullSafetyMode.unsound, ddcModuleSystem: usesDdcModuleSystem, webRenderer: WebRendererMode.canvaskit, rootDirectory: globals.fs.currentDirectory, ); webDevFS.requireJS.createSync(recursive: true); webDevFS.stackTraceMapper.createSync(recursive: true); final Uri uri = await webDevFS.create(); // Ensure the connection established is secure expect(uri.scheme, 'https'); await webDevFS.destroy(); }, overrides: <Type, Generator>{ Artifacts: () => Artifacts.test(), })); test('allows frame embedding', () async { final WebAssetServer webAssetServer = await WebAssetServer.start( null, 'localhost', 0, null, null, null, true, true, true, const BuildInfo( BuildMode.debug, '', treeShakeIcons: false, ), false, false, Uri.base, null, const <String, String>{}, NullSafetyMode.unsound, webRenderer: WebRendererMode.canvaskit, testMode: true ); expect(webAssetServer.defaultResponseHeaders['x-frame-options'], null); await webAssetServer.dispose(); }); test('passes on extra headers', () async { const String extraHeaderKey = 'hurray'; const String extraHeaderValue = 'flutter'; final WebAssetServer webAssetServer = await WebAssetServer.start( null, 'localhost', 0, null, null, null, true, true, true, const BuildInfo( BuildMode.debug, '', treeShakeIcons: false, ), false, false, Uri.base, null, const <String, String>{ extraHeaderKey: extraHeaderValue, }, NullSafetyMode.unsound, webRenderer: WebRendererMode.canvaskit, testMode: true ); expect(webAssetServer.defaultResponseHeaders[extraHeaderKey], <String>[extraHeaderValue]); await webAssetServer.dispose(); }); test('WebAssetServer responds to POST requests with 404 not found', () => testbed.run(() async { final Response response = await webAssetServer.handleRequest( Request('POST', Uri.parse('http://foobar/something')), ); expect(response.statusCode, 404); })); test('ReleaseAssetServer responds to POST requests with 404 not found', () => testbed.run(() async { final Response response = await releaseAssetServer.handle( Request('POST', Uri.parse('http://foobar/something')), ); expect(response.statusCode, 404); })); test('WebAssetServer strips leading base href off of asset requests', () => testbed.run(() async { const String htmlContent = '<html><head><base href="/foo/"></head><body id="test"></body></html>'; globals.fs.currentDirectory .childDirectory('web') .childFile('index.html') ..createSync(recursive: true) ..writeAsStringSync(htmlContent); final WebAssetServer webAssetServer = WebAssetServer( FakeHttpServer(), PackageConfig.empty, InternetAddress.anyIPv4, <String, String>{}, <String, String>{}, NullSafetyMode.sound, usesDdcModuleSystem, webRenderer: WebRendererMode.canvaskit, ); expect(await webAssetServer.metadataContents('foo/main_module.ddc_merged_metadata'), null); // Not base href. expect(() async => webAssetServer.metadataContents('bar/main_module.ddc_merged_metadata'), throwsException); })); test('DevFS URI includes any specified base path.', () => testbed.run(() async { final File outputFile = globals.fs.file(globals.fs.path.join('lib', 'main.dart')) ..createSync(recursive: true); const String htmlContent = '<html><head><base href="/foo/"></head><body id="test"></body></html>'; globals.fs.currentDirectory .childDirectory('web') .childFile('index.html') ..createSync(recursive: true) ..writeAsStringSync(htmlContent); outputFile.parent.childFile('a.sources').writeAsStringSync(''); outputFile.parent.childFile('a.json').writeAsStringSync('{}'); outputFile.parent.childFile('a.map').writeAsStringSync('{}'); outputFile.parent.childFile('a.metadata').writeAsStringSync('{}'); final WebDevFS webDevFS = WebDevFS( hostname: 'localhost', port: 0, tlsCertPath: null, tlsCertKeyPath: null, packagesFilePath: '.packages', urlTunneller: null, useSseForDebugProxy: true, useSseForDebugBackend: true, useSseForInjectedClient: true, nullAssertions: true, nativeNullAssertions: true, buildInfo: BuildInfo.debug, enableDwds: false, enableDds: false, entrypoint: Uri.base, testMode: true, expressionCompiler: null, extraHeaders: const <String, String>{}, chromiumLauncher: null, nullSafetyMode: NullSafetyMode.unsound, ddcModuleSystem: usesDdcModuleSystem, webRenderer: WebRendererMode.canvaskit, rootDirectory: globals.fs.currentDirectory, ); webDevFS.requireJS.createSync(recursive: true); webDevFS.stackTraceMapper.createSync(recursive: true); final Uri uri = await webDevFS.create(); // served on localhost expect(uri.host, 'localhost'); // Matches base URI specified in html. expect(uri.path, '/foo'); await webDevFS.destroy(); }, overrides: <Type, Generator>{ Artifacts: () => Artifacts.test(), })); } class FakeHttpServer extends Fake implements HttpServer { bool closed = false; @override Future<void> close({bool force = false}) async { closed = true; } } class FakeResidentCompiler extends Fake implements ResidentCompiler { CompilerOutput? output; @override void addFileSystemRoot(String root) { } @override Future<CompilerOutput?> recompile(Uri mainUri, List<Uri>? invalidatedFiles, { String? outputPath, PackageConfig? packageConfig, String? projectRootPath, FileSystem? fs, bool suppressErrors = false, bool checkDartPluginRegistry = false, File? dartPluginRegistrant, Uri? nativeAssetsYaml, }) async { return output; } } class FakeShaderCompiler implements DevelopmentShaderCompiler { const FakeShaderCompiler(); @override void configureCompiler(TargetPlatform? platform) { } @override Future<DevFSContent> recompileShader(DevFSContent inputShader) { throw UnimplementedError(); } } class FakeDwds extends Fake implements Dwds { FakeDwds(Iterable<AppConnection> connectedAppsIterable) : connectedApps = Stream<AppConnection>.fromIterable(connectedAppsIterable); @override final Stream<AppConnection> connectedApps; @override Future<DebugConnection> debugConnection(AppConnection appConnection) => Future<DebugConnection>.value(FakeDebugConnection()); } class FakeAppConnection extends Fake implements AppConnection { @override void runMain() {} } class FakeDebugConnection extends Fake implements DebugConnection { FakeDebugConnection({ this.uri = 'http://foo', }); @override final String uri; } class FakeVmService extends Fake implements vm_service.VmService {}
flutter/packages/flutter_tools/test/general.shard/web/devfs_web_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/web/devfs_web_test.dart", "repo_id": "flutter", "token_count": 20280 }
866
// 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' show ProcessException; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/platform.dart'; import 'package:flutter_tools/src/convert.dart'; import 'package:flutter_tools/src/windows/visual_studio.dart'; import '../../src/common.dart'; import '../../src/context.dart'; import '../../src/fakes.dart'; const String programFilesPath = r'C:\Program Files (x86)'; const String visualStudioPath = programFilesPath + r'\Microsoft Visual Studio\2017\Community'; const String cmakePath = visualStudioPath + r'\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe'; const String vswherePath = programFilesPath + r'\Microsoft Visual Studio\Installer\vswhere.exe'; const String clPath = visualStudioPath + r'\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64\cl.exe'; const String libPath = visualStudioPath + r'\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64\lib.exe'; const String linkPath = visualStudioPath + r'\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64\link.exe'; const String vcvarsPath = visualStudioPath + r'\VC\Auxiliary\Build\vcvars64.bat'; final Platform windowsPlatform = FakePlatform( operatingSystem: 'windows', environment: <String, String>{ 'PROGRAMFILES(X86)': r'C:\Program Files (x86)\', }, ); // A minimum version of a response where a VS installation was found. const Map<String, dynamic> _defaultResponse = <String, dynamic>{ 'installationPath': visualStudioPath, 'displayName': 'Visual Studio Community 2019', 'installationVersion': '16.2.29306.81', 'isRebootRequired': false, 'isComplete': true, 'isLaunchable': true, 'isPrerelease': false, 'catalog': <String, dynamic>{ 'productDisplayVersion': '16.2.5', }, }; // A minimum version of a response where a VS 2022 installation was found. const Map<String, dynamic> _vs2022Response = <String, dynamic>{ 'installationPath': visualStudioPath, 'displayName': 'Visual Studio Community 2022', 'installationVersion': '17.0.31903.59', 'isRebootRequired': false, 'isComplete': true, 'isLaunchable': true, 'isPrerelease': false, 'catalog': <String, dynamic>{ 'productDisplayVersion': '17.0.0', }, }; // A minimum version of a response where a Build Tools installation was found. const Map<String, dynamic> _defaultBuildToolsResponse = <String, dynamic>{ 'installationPath': visualStudioPath, 'displayName': 'Visual Studio Build Tools 2019', 'installationVersion': '16.7.30413.136', 'isRebootRequired': false, 'isComplete': true, 'isLaunchable': true, 'isPrerelease': false, 'catalog': <String, dynamic>{ 'productDisplayVersion': '16.7.2', }, }; // A response for a VS installation that's too old. const Map<String, dynamic> _tooOldResponse = <String, dynamic>{ 'installationPath': visualStudioPath, 'displayName': 'Visual Studio Community 2017', 'installationVersion': '15.9.28307.665', 'isRebootRequired': false, 'isComplete': true, 'isLaunchable': true, 'isPrerelease': false, 'catalog': <String, dynamic>{ 'productDisplayVersion': '15.9.12', }, }; // A version of a response that doesn't include certain installation status // information that might be missing in older vswhere. const Map<String, dynamic> _missingStatusResponse = <String, dynamic>{ 'installationPath': visualStudioPath, 'displayName': 'Visual Studio Community 2017', 'installationVersion': '16.4.29609.76', 'catalog': <String, dynamic>{ 'productDisplayVersion': '16.4.1', }, }; const String _malformedDescriptionResponse = r''' [ { "installationPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community", "displayName": "Visual Studio Community 2019", "description": "This description has too many "quotes", "installationVersion": "16.2.29306.81", "isRebootRequired": false, "isComplete": true, "isPrerelease": false, "catalog": { "productDisplayVersion": "16.2.5" } } ] '''; // Arguments for a vswhere query to search for an installation with the // requirements. const List<String> _requirements = <String>[ 'Microsoft.VisualStudio.Workload.NativeDesktop', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64', 'Microsoft.VisualStudio.Component.VC.CMake.Project', ]; // Arguments for a vswhere query to search for a Build Tools installation with the // requirements. const List<String> _requirementsBuildTools = <String>[ 'Microsoft.VisualStudio.Workload.VCTools', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64', 'Microsoft.VisualStudio.Component.VC.CMake.Project', ]; // Sets up the mock environment so that searching for Visual Studio with // exactly the given required components will provide a result. By default it // return a preset installation, but the response can be overridden. void setMockVswhereResponse( FileSystem fileSystem, FakeProcessManager processManager, [ List<String>? requiredComponents, List<String>? additionalArguments, Map<String, dynamic>? response, String? responseOverride, int? exitCode, Exception? exception, ]) { fileSystem.file(vswherePath).createSync(recursive: true); fileSystem.file(cmakePath).createSync(recursive: true); fileSystem.file(clPath).createSync(recursive: true); final String finalResponse = responseOverride ?? (response != null ? json.encode(<Map<String, dynamic>>[response]) : '[]'); final List<String> requirementArguments = requiredComponents == null ? <String>[] : <String>['-requires', ...requiredComponents]; processManager.addCommand(FakeCommand( command: <String>[ vswherePath, '-format', 'json', '-products', '*', '-utf8', '-latest', ...?additionalArguments, ...requirementArguments, ], stdout: finalResponse, exception: exception, exitCode: exitCode ?? 0, )); } // Sets whether or not a vswhere query with the required components will // return an installation. void setMockCompatibleVisualStudioInstallation( Map<String, dynamic>? response, FileSystem fileSystem, FakeProcessManager processManager, [ int? exitCode, Exception? exception, ]) { setMockVswhereResponse( fileSystem, processManager, _requirements, <String>['-version', '16'], response, null, exitCode, exception, ); } // Sets whether or not a vswhere query with the required components will // return a pre-release installation. void setMockPrereleaseVisualStudioInstallation( Map<String, dynamic>? response, FileSystem fileSystem, FakeProcessManager processManager, [ int? exitCode, Exception? exception, ]) { setMockVswhereResponse( fileSystem, processManager, _requirements, <String>['-version', '16', '-prerelease'], response, null, exitCode, exception, ); } // Sets whether or not a vswhere query with the required components will // return an Build Tools installation. void setMockCompatibleVisualStudioBuildToolsInstallation( Map<String, dynamic>? response, FileSystem fileSystem, FakeProcessManager processManager, [ int? exitCode, Exception? exception, ]) { setMockVswhereResponse( fileSystem, processManager, _requirementsBuildTools, <String>['-version', '16'], response, null, exitCode, exception, ); } // Sets whether or not a vswhere query with the required components will // return a pre-release Build Tools installation. void setMockPrereleaseVisualStudioBuildToolsInstallation( Map<String, dynamic>? response, FileSystem fileSystem, FakeProcessManager processManager, [ int? exitCode, Exception? exception, ]) { setMockVswhereResponse( fileSystem, processManager, _requirementsBuildTools, <String>['-version', '16', '-prerelease'], response, null, exitCode, exception, ); } // Sets whether or not a vswhere query searching for 'all' and 'prerelease' // versions will return an installation. void setMockAnyVisualStudioInstallation( Map<String, dynamic>? response, FileSystem fileSystem, FakeProcessManager processManager, [ int? exitCode, Exception? exception, ]) { setMockVswhereResponse( fileSystem, processManager, null, <String>['-prerelease', '-all'], response, null, exitCode, exception, ); } // Set a pre-encoded query result. void setMockEncodedAnyVisualStudioInstallation( String response, FileSystem fileSystem, FakeProcessManager processManager, ) { setMockVswhereResponse( fileSystem, processManager, null, <String>['-prerelease', '-all'], null, response, ); } // Sets up the mock environment for a Windows 10 SDK query. // // registryPresent controls whether or not the registry key is found. // filesPresent controls where or not there are any SDK folders at the location // returned by the registry query. void setMockSdkRegResponse( FileSystem fileSystem, FakeProcessManager processManager, { bool registryPresent = true, bool filesPresent = true, }) { const String registryPath = r'HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0'; const String registryKey = r'InstallationFolder'; const String installationPath = r'C:\Program Files (x86)\Windows Kits\10\'; final String stdout = registryPresent ? ''' $registryPath $registryKey REG_SZ $installationPath ''' : ''' ERROR: The system was unable to find the specified registry key or value. '''; if (filesPresent) { final Directory includeDirectory = fileSystem.directory(installationPath).childDirectory('Include'); includeDirectory.childDirectory('10.0.17763.0').createSync(recursive: true); includeDirectory.childDirectory('10.0.18362.0').createSync(recursive: true); // Not an actual version; added to ensure that version comparison is number, not string-based. includeDirectory.childDirectory('10.0.184.0').createSync(recursive: true); } processManager.addCommand(FakeCommand( command: const <String>[ 'reg', 'query', registryPath, '/v', registryKey, ], stdout: stdout, )); } // Create a visual studio instance with a FakeProcessManager. VisualStudioFixture setUpVisualStudio() { final FakeProcessManager processManager = FakeProcessManager.empty(); final FileSystem fileSystem = MemoryFileSystem.test(style: FileSystemStyle.windows); final BufferLogger logger = BufferLogger.test(); final VisualStudio visualStudio = VisualStudio( fileSystem: fileSystem, platform: windowsPlatform, logger: logger, processManager: processManager, osUtils: FakeOperatingSystemUtils(), ); return VisualStudioFixture(visualStudio, fileSystem, processManager, logger); } // Set all vswhere query with the required components return null. void setNoViableToolchainInstallation( VisualStudioFixture fixture, ) { setMockCompatibleVisualStudioInstallation( null, fixture.fileSystem, fixture.processManager, ); setMockCompatibleVisualStudioBuildToolsInstallation( null, fixture.fileSystem, fixture.processManager, ); setMockPrereleaseVisualStudioInstallation( null, fixture.fileSystem, fixture.processManager, ); setMockPrereleaseVisualStudioBuildToolsInstallation( null, fixture.fileSystem, fixture.processManager, ); } void main() { group('Visual Studio', () { testWithoutContext('isInstalled throws when PROGRAMFILES(X86) env not set', () { final VisualStudio visualStudio = VisualStudio( logger: BufferLogger.test(), fileSystem: MemoryFileSystem.test(style: FileSystemStyle.windows), platform: FakePlatform(operatingSystem: 'windows'), processManager: FakeProcessManager.any(), osUtils: FakeOperatingSystemUtils(), ); expect(() => visualStudio.isInstalled, throwsToolExit(message: '%PROGRAMFILES(X86)% environment variable not found')); }); testWithoutContext('isInstalled and cmakePath correct when vswhere is missing', () { final FileSystem fileSystem = MemoryFileSystem.test(style: FileSystemStyle.windows); const Exception exception = ProcessException('vswhere', <String>[]); final FakeProcessManager fakeProcessManager = FakeProcessManager.empty(); setMockCompatibleVisualStudioInstallation(null, fileSystem, fakeProcessManager, null, exception); setMockCompatibleVisualStudioBuildToolsInstallation(null, fileSystem, fakeProcessManager, null, exception); setMockPrereleaseVisualStudioInstallation(null, fileSystem, fakeProcessManager, null, exception); setMockPrereleaseVisualStudioBuildToolsInstallation(null, fileSystem, fakeProcessManager, null, exception); setMockAnyVisualStudioInstallation(null, fileSystem, fakeProcessManager, null, exception); final VisualStudio visualStudio = VisualStudio( logger: BufferLogger.test(), fileSystem: fileSystem, platform: windowsPlatform, processManager: fakeProcessManager, osUtils: FakeOperatingSystemUtils(), ); expect(visualStudio.isInstalled, false); expect(visualStudio.cmakePath, isNull); }); testWithoutContext( 'isInstalled returns false when vswhere returns non-zero', () { final FileSystem fileSystem = MemoryFileSystem.test(style: FileSystemStyle.windows); final FakeProcessManager fakeProcessManager = FakeProcessManager.empty(); setMockCompatibleVisualStudioInstallation(null, fileSystem, fakeProcessManager, 1); setMockCompatibleVisualStudioBuildToolsInstallation(null, fileSystem, fakeProcessManager, 1); setMockPrereleaseVisualStudioInstallation(null, fileSystem, fakeProcessManager, 1); setMockPrereleaseVisualStudioBuildToolsInstallation(null, fileSystem, fakeProcessManager, 1); setMockAnyVisualStudioInstallation(null, fileSystem, fakeProcessManager, 1); final VisualStudio visualStudio = VisualStudio( logger: BufferLogger.test(), fileSystem: fileSystem, platform: windowsPlatform, processManager: fakeProcessManager, osUtils: FakeOperatingSystemUtils(), ); expect(visualStudio.isInstalled, false); expect(visualStudio.cmakePath, isNull); }); testWithoutContext('VisualStudio getters return the right values if no installation is found', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setNoViableToolchainInstallation(fixture); setMockAnyVisualStudioInstallation( null, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.isInstalled, false); expect(visualStudio.isAtLeastMinimumVersion, false); expect(visualStudio.hasNecessaryComponents, false); expect(visualStudio.isComplete, false); expect(visualStudio.isRebootRequired, false); expect(visualStudio.isLaunchable, false); expect(visualStudio.displayName, null); expect(visualStudio.displayVersion, null); expect(visualStudio.installLocation, null); expect(visualStudio.fullVersion, null); }); testWithoutContext('necessaryComponentDescriptions suggest the right VS tools on major version 16', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setMockCompatibleVisualStudioInstallation( _defaultResponse, fixture.fileSystem, fixture.processManager, ); final String toolsString = visualStudio.necessaryComponentDescriptions()[0]; expect(toolsString.contains('v142'), true); }); testWithoutContext('necessaryComponentDescriptions suggest the right VS tools on an old version', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setNoViableToolchainInstallation(fixture); setMockAnyVisualStudioInstallation( _tooOldResponse, fixture.fileSystem, fixture.processManager, ); final String toolsString = visualStudio.necessaryComponentDescriptions()[0]; expect(toolsString.contains('v142'), true); }); testWithoutContext('isInstalled returns true even with missing status information', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setNoViableToolchainInstallation(fixture); setMockAnyVisualStudioInstallation( _missingStatusResponse, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.isInstalled, true); }); testWithoutContext('isInstalled returns true when VS is present but missing components', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setNoViableToolchainInstallation(fixture); setMockAnyVisualStudioInstallation( _defaultResponse, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.isInstalled, true); }); testWithoutContext('isInstalled returns true when VS is present but too old', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setNoViableToolchainInstallation(fixture); setMockAnyVisualStudioInstallation( _tooOldResponse, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.isInstalled, true); }); testWithoutContext('isInstalled returns true when a prerelease version of VS is present', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; final Map<String, dynamic> response = Map<String, dynamic>.of(_defaultResponse) ..['isPrerelease'] = true; setMockCompatibleVisualStudioInstallation( null, fixture.fileSystem, fixture.processManager, ); setMockCompatibleVisualStudioBuildToolsInstallation( null, fixture.fileSystem, fixture.processManager, ); setMockPrereleaseVisualStudioInstallation( response, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.isInstalled, true); expect(visualStudio.isPrerelease, true); }); testWithoutContext('isInstalled returns true when a prerelease version of Build Tools is present', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; final Map<String, dynamic> response = Map<String, dynamic>.of(_defaultBuildToolsResponse) ..['isPrerelease'] = true; setMockCompatibleVisualStudioInstallation( null, fixture.fileSystem, fixture.processManager, ); setMockCompatibleVisualStudioBuildToolsInstallation( null, fixture.fileSystem, fixture.processManager, ); setMockPrereleaseVisualStudioInstallation( null, fixture.fileSystem, fixture.processManager, ); setMockPrereleaseVisualStudioBuildToolsInstallation( response, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.isInstalled, true); expect(visualStudio.isPrerelease, true); }); testWithoutContext('isAtLeastMinimumVersion returns false when the version found is too old', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setNoViableToolchainInstallation(fixture); setMockAnyVisualStudioInstallation( _tooOldResponse, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.isInstalled, true); expect(visualStudio.isAtLeastMinimumVersion, false); }); testWithoutContext('isComplete returns false when an incomplete installation is found', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setNoViableToolchainInstallation(fixture); final Map<String, dynamic> response = Map<String, dynamic>.of(_defaultResponse) ..['isComplete'] = false; setMockAnyVisualStudioInstallation( response, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.isInstalled, true); expect(visualStudio.isComplete, false); }); testWithoutContext( "isLaunchable returns false if the installation can't be launched", () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setNoViableToolchainInstallation(fixture); final Map<String, dynamic> response = Map<String, dynamic>.of(_defaultResponse) ..['isLaunchable'] = false; setMockAnyVisualStudioInstallation( response, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.isInstalled, true); expect(visualStudio.isLaunchable, false); }); testWithoutContext('isRebootRequired returns true if the installation needs a reboot', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setNoViableToolchainInstallation(fixture); final Map<String, dynamic> response = Map<String, dynamic>.of(_defaultResponse) ..['isRebootRequired'] = true; setMockAnyVisualStudioInstallation( response, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.isInstalled, true); expect(visualStudio.isRebootRequired, true); }); testWithoutContext('hasNecessaryComponents returns false when VS is present but missing components', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setNoViableToolchainInstallation(fixture); setMockAnyVisualStudioInstallation( _defaultResponse, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.hasNecessaryComponents, false); }); testWithoutContext('cmakePath returns null when VS is present but missing components', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setNoViableToolchainInstallation(fixture); setMockAnyVisualStudioInstallation( _defaultResponse, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.cmakePath, isNull); }); testWithoutContext('cmakePath returns null when VS is present but with require components but installation is faulty', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; final Map<String, dynamic> response = Map<String, dynamic>.of(_defaultResponse) ..['isRebootRequired'] = true; setMockCompatibleVisualStudioInstallation( response, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.cmakePath, isNull); }); testWithoutContext('hasNecessaryComponents returns false when VS is present with required components but installation is faulty', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; final Map<String, dynamic> response = Map<String, dynamic>.of(_defaultResponse) ..['isRebootRequired'] = true; setMockCompatibleVisualStudioInstallation( response, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.hasNecessaryComponents, false); }); testWithoutContext('VS metadata is available when VS is present, even if missing components', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setNoViableToolchainInstallation(fixture); setMockAnyVisualStudioInstallation( _defaultResponse, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.displayName, equals('Visual Studio Community 2019')); expect(visualStudio.displayVersion, equals('16.2.5')); expect(visualStudio.installLocation, equals(visualStudioPath)); expect(visualStudio.fullVersion, equals('16.2.29306.81')); }); testWithoutContext('Warns and returns no installation when VS is present but vswhere returns invalid JSON', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setNoViableToolchainInstallation(fixture); setMockEncodedAnyVisualStudioInstallation( '{', fixture.fileSystem, fixture.processManager, ); expect(visualStudio.isInstalled, isFalse); expect(visualStudio.isComplete, isFalse); expect(visualStudio.isLaunchable, isFalse); expect(visualStudio.isPrerelease, isFalse); expect(visualStudio.isRebootRequired, isFalse); expect(visualStudio.hasNecessaryComponents, isFalse); expect(visualStudio.displayName, isNull); expect(visualStudio.displayVersion, isNull); expect(visualStudio.installLocation, isNull); expect(visualStudio.fullVersion, isNull); expect(visualStudio.cmakePath, isNull); expect(fixture.logger.warningText, contains('Warning: Unexpected vswhere.exe JSON output')); }); testWithoutContext('Everything returns good values when VS is present with all components', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setMockCompatibleVisualStudioInstallation( _defaultResponse, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.isInstalled, true); expect(visualStudio.isAtLeastMinimumVersion, true); expect(visualStudio.hasNecessaryComponents, true); expect(visualStudio.cmakePath, equals(cmakePath)); expect(visualStudio.cmakeGenerator, equals('Visual Studio 16 2019')); expect(visualStudio.clPath, equals(clPath)); expect(visualStudio.libPath, equals(libPath)); expect(visualStudio.linkPath, equals(linkPath)); expect(visualStudio.vcvarsPath, equals(vcvarsPath)); }); testWithoutContext('Everything returns good values when Build Tools is present with all components', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setMockCompatibleVisualStudioInstallation( null, fixture.fileSystem, fixture.processManager, ); setMockCompatibleVisualStudioBuildToolsInstallation( _defaultBuildToolsResponse, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.isInstalled, true); expect(visualStudio.isAtLeastMinimumVersion, true); expect(visualStudio.hasNecessaryComponents, true); expect(visualStudio.cmakePath, equals(cmakePath)); }); testWithoutContext('properties return the right value for Visual Studio 2022', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setMockCompatibleVisualStudioInstallation( _vs2022Response, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.isInstalled, true); expect(visualStudio.isAtLeastMinimumVersion, true); expect(visualStudio.hasNecessaryComponents, true); expect(visualStudio.cmakePath, equals(cmakePath)); expect(visualStudio.cmakeGenerator, equals('Visual Studio 17 2022')); expect(visualStudio.clPath, equals(clPath)); expect(visualStudio.libPath, equals(libPath)); expect(visualStudio.linkPath, equals(linkPath)); expect(visualStudio.vcvarsPath, equals(vcvarsPath)); }); testWithoutContext('Metadata is for compatible version when latest is missing components', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; // Return a different version for queries without the required packages. final Map<String, dynamic> olderButCompleteVersionResponse = <String, dynamic>{ 'installationPath': visualStudioPath, 'displayName': 'Visual Studio Community 2017', 'installationVersion': '15.9.28307.665', 'catalog': <String, dynamic>{ 'productDisplayVersion': '15.9.12', }, }; setMockCompatibleVisualStudioInstallation( olderButCompleteVersionResponse, fixture.fileSystem, fixture.processManager, ); // Return a different version for queries without the required packages. final Map<String, dynamic> incompleteVersionResponse = <String, dynamic>{ 'installationPath': visualStudioPath, 'displayName': 'Visual Studio Community 2019', 'installationVersion': '16.1.1.1', 'catalog': <String, String>{ 'productDisplayVersion': '16.1', }, }; setMockAnyVisualStudioInstallation( incompleteVersionResponse, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.displayName, equals('Visual Studio Community 2017')); expect(visualStudio.displayVersion, equals('15.9.12')); }); testWithoutContext('SDK version returns the latest version when present', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setMockSdkRegResponse( fixture.fileSystem, fixture.processManager, ); expect(visualStudio.getWindows10SDKVersion(), '10.0.18362.0'); }); testWithoutContext('SDK version returns null when the registry key is not present', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setMockSdkRegResponse( fixture.fileSystem, fixture.processManager, registryPresent: false, ); expect(visualStudio.getWindows10SDKVersion(), null); }); testWithoutContext('SDK version returns null when there are no SDK files present', () { final VisualStudioFixture fixture = setUpVisualStudio(); final VisualStudio visualStudio = fixture.visualStudio; setMockSdkRegResponse( fixture.fileSystem, fixture.processManager, filesPresent: false, ); expect(visualStudio.getWindows10SDKVersion(), null); }); }); // The output of vswhere.exe is known to contain bad UTF8. // See: https://github.com/flutter/flutter/issues/102451 group('Correctly handles bad UTF-8 from vswhere.exe output', () { late VisualStudioFixture fixture; late VisualStudio visualStudio; setUp(() { fixture = setUpVisualStudio(); visualStudio = fixture.visualStudio; }); testWithoutContext('Ignores unicode replacement char in unused properties', () { final Map<String, dynamic> response = Map<String, dynamic>.of(_defaultResponse)..['unused'] = 'Bad UTF8 \u{FFFD}'; setMockCompatibleVisualStudioInstallation( response, fixture.fileSystem, fixture.processManager, ); expect(visualStudio.isInstalled, true); expect(visualStudio.isAtLeastMinimumVersion, true); expect(visualStudio.hasNecessaryComponents, true); expect(visualStudio.cmakePath, equals(cmakePath)); expect(visualStudio.cmakeGenerator, equals('Visual Studio 16 2019')); expect(visualStudio.clPath, equals(clPath)); expect(visualStudio.libPath, equals(libPath)); expect(visualStudio.linkPath, equals(linkPath)); expect(visualStudio.vcvarsPath, equals(vcvarsPath)); }); testWithoutContext('Throws ToolExit on bad UTF-8 in installationPath', () { final Map<String, dynamic> response = Map<String, dynamic>.of(_defaultResponse) ..['installationPath'] = '\u{FFFD}'; setMockCompatibleVisualStudioInstallation(response, fixture.fileSystem, fixture.processManager); expect(() => visualStudio.isInstalled, throwsToolExit(message: 'Bad UTF-8 encoding (U+FFFD; REPLACEMENT CHARACTER) found in string')); }); testWithoutContext('Throws ToolExit on bad UTF-8 in installationVersion', () { final Map<String, dynamic> response = Map<String, dynamic>.of(_defaultResponse) ..['installationVersion'] = '\u{FFFD}'; setMockCompatibleVisualStudioInstallation(response, fixture.fileSystem, fixture.processManager); expect(() => visualStudio.isInstalled, throwsToolExit(message: 'Bad UTF-8 encoding (U+FFFD; REPLACEMENT CHARACTER) found in string')); }); testWithoutContext('Ignores bad UTF-8 in displayName', () { final Map<String, dynamic> response = Map<String, dynamic>.of(_defaultResponse) ..['displayName'] = '\u{FFFD}'; setMockCompatibleVisualStudioInstallation(response, fixture.fileSystem, fixture.processManager); expect(visualStudio.isInstalled, true); expect(visualStudio.isAtLeastMinimumVersion, true); expect(visualStudio.hasNecessaryComponents, true); expect(visualStudio.cmakePath, equals(cmakePath)); expect(visualStudio.cmakeGenerator, equals('Visual Studio 16 2019')); expect(visualStudio.displayName, equals('\u{FFFD}')); expect(visualStudio.clPath, equals(clPath)); expect(visualStudio.libPath, equals(libPath)); expect(visualStudio.linkPath, equals(linkPath)); expect(visualStudio.vcvarsPath, equals(vcvarsPath)); }); testWithoutContext("Ignores bad UTF-8 in catalog's productDisplayVersion", () { final Map<String, dynamic> catalog = Map<String, dynamic>.of(_defaultResponse['catalog'] as Map<String, dynamic>) ..['productDisplayVersion'] = '\u{FFFD}'; final Map<String, dynamic> response = Map<String, dynamic>.of(_defaultResponse)..['catalog'] = catalog; setMockCompatibleVisualStudioInstallation(response, fixture.fileSystem, fixture.processManager); expect(visualStudio.isInstalled, true); expect(visualStudio.isAtLeastMinimumVersion, true); expect(visualStudio.hasNecessaryComponents, true); expect(visualStudio.cmakePath, equals(cmakePath)); expect(visualStudio.cmakeGenerator, equals('Visual Studio 16 2019')); expect(visualStudio.displayVersion, equals('\u{FFFD}')); expect(visualStudio.clPath, equals(clPath)); expect(visualStudio.libPath, equals(libPath)); expect(visualStudio.linkPath, equals(linkPath)); expect(visualStudio.vcvarsPath, equals(vcvarsPath)); }); testWithoutContext('Ignores malformed JSON in description property', () { setMockVswhereResponse( fixture.fileSystem, fixture.processManager, _requirements, <String>['-version', '16'], null, _malformedDescriptionResponse, ); expect(visualStudio.isInstalled, true); expect(visualStudio.isAtLeastMinimumVersion, true); expect(visualStudio.hasNecessaryComponents, true); expect(visualStudio.cmakePath, equals(cmakePath)); expect(visualStudio.cmakeGenerator, equals('Visual Studio 16 2019')); expect(visualStudio.displayVersion, equals('16.2.5')); expect(visualStudio.clPath, equals(clPath)); expect(visualStudio.libPath, equals(libPath)); expect(visualStudio.linkPath, equals(linkPath)); expect(visualStudio.vcvarsPath, equals(vcvarsPath)); expect(fixture.logger.warningText, isEmpty); }); }); group(VswhereDetails, () { test('Accepts empty JSON', () { const bool meetsRequirements = true; final Map<String, dynamic> json = <String, dynamic>{}; const String msvcVersion = ''; final VswhereDetails result = VswhereDetails.fromJson(meetsRequirements, json, msvcVersion); expect(result.installationPath, null); expect(result.displayName, null); expect(result.fullVersion, null); expect(result.isComplete, null); expect(result.isLaunchable, null); expect(result.isRebootRequired, null); expect(result.isPrerelease, null); expect(result.catalogDisplayVersion, null); expect(result.isUsable, isTrue); }); test('Ignores unknown JSON properties', () { const bool meetsRequirements = true; final Map<String, dynamic> json = <String, dynamic>{ 'hello': 'world', }; const String msvcVersion = ''; final VswhereDetails result = VswhereDetails.fromJson(meetsRequirements, json, msvcVersion); expect(result.installationPath, null); expect(result.displayName, null); expect(result.fullVersion, null); expect(result.isComplete, null); expect(result.isLaunchable, null); expect(result.isRebootRequired, null); expect(result.isPrerelease, null); expect(result.catalogDisplayVersion, null); expect(result.isUsable, isTrue); }); test('Accepts JSON', () { const bool meetsRequirements = true; const String msvcVersion = ''; final VswhereDetails result = VswhereDetails.fromJson(meetsRequirements, _defaultResponse, msvcVersion); expect(result.installationPath, visualStudioPath); expect(result.displayName, 'Visual Studio Community 2019'); expect(result.fullVersion, '16.2.29306.81'); expect(result.isComplete, true); expect(result.isLaunchable, true); expect(result.isRebootRequired, false); expect(result.isPrerelease, false); expect(result.catalogDisplayVersion, '16.2.5'); expect(result.isUsable, isTrue); }); test('Installation that does not satisfy requirements is not usable', () { const bool meetsRequirements = false; const String msvcVersion = ''; final VswhereDetails result = VswhereDetails.fromJson(meetsRequirements, _defaultResponse, msvcVersion); expect(result.isUsable, isFalse); }); test('Incomplete installation is not usable', () { const bool meetsRequirements = true; final Map<String, dynamic> json = Map<String, dynamic>.of(_defaultResponse)..['isComplete'] = false; const String msvcVersion = ''; final VswhereDetails result = VswhereDetails.fromJson(meetsRequirements, json, msvcVersion); expect(result.isUsable, isFalse); }); test('Unlaunchable installation is not usable', () { const bool meetsRequirements = true; final Map<String, dynamic> json = Map<String, dynamic>.of(_defaultResponse)..['isLaunchable'] = false; const String msvcVersion = ''; final VswhereDetails result = VswhereDetails.fromJson(meetsRequirements, json, msvcVersion); expect(result.isUsable, isFalse); }); test('Installation that requires reboot is not usable', () { const bool meetsRequirements = true; final Map<String, dynamic> json = Map<String, dynamic>.of(_defaultResponse)..['isRebootRequired'] = true; const String msvcVersion = ''; final VswhereDetails result = VswhereDetails.fromJson(meetsRequirements, json, msvcVersion); expect(result.isUsable, isFalse); }); }); } class VisualStudioFixture { VisualStudioFixture(this.visualStudio, this.fileSystem, this.processManager, this.logger); final VisualStudio visualStudio; final FileSystem fileSystem; final FakeProcessManager processManager; final BufferLogger logger; }
flutter/packages/flutter_tools/test/general.shard/windows/visual_studio_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/windows/visual_studio_test.dart", "repo_id": "flutter", "token_count": 13595 }
867
// 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:flutter_tools/src/base/io.dart'; import '../src/common.dart'; import 'test_utils.dart'; void main() { late Directory tempDir; setUp(() async { tempDir = createResolvedTempDirectorySync('run_test.'); }); tearDown(() async { tryToDelete(tempDir); }); testWithoutContext( 'gradle prints warning when Flutter\'s Gradle plugins are applied using deprecated "apply plugin" way', () async { // Create a new flutter project. final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter'); ProcessResult result = await processManager.run(<String>[ flutterBin, 'create', tempDir.path, '--project-name=testapp', ], workingDirectory: tempDir.path); expect(result.exitCode, 0); // Ensure that gradle files exists from templates. result = await processManager.run(<String>[ flutterBin, 'build', 'apk', '--config-only', ], workingDirectory: tempDir.path); expect(result.exitCode, 0); // Change build files to use deprecated "apply plugin:" way. // Contents are taken from https://github.com/flutter/flutter/issues/135392 (for Flutter 3.10) final File settings = tempDir.childDirectory('android').childFile('settings.gradle'); final File buildGradle = tempDir.childDirectory('android').childFile('build.gradle'); final File appBuildGradle = tempDir.childDirectory('android').childDirectory('app').childFile('build.gradle'); settings.writeAsStringSync(r''' include ':app' def localPropertiesFile = new File(rootProject.projectDir, "local.properties") def properties = new Properties() assert localPropertiesFile.exists() localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" ''' ); buildGradle.writeAsStringSync(r''' buildscript { ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } allprojects { repositories { google() mavenCentral() } } rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { project.evaluationDependsOn(':app') } tasks.register("clean", Delete) { delete rootProject.buildDir } '''); appBuildGradle.writeAsStringSync(r''' def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } } def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' } def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' } apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion namespace "com.example.testapp" compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.testapp" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.debug } } } flutter { source '../..' } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } '''); result = await processManager.run(<String>[ flutterBin, 'build', 'apk', '--debug', ], workingDirectory: tempDir.path); expect(result.exitCode, 0); // Verify that stderr output contains deprecation warnings. final List<String> actualLines = LineSplitter.split(result.stderr.toString()).toList(); expect( actualLines.any((String msg) => msg.contains( "You are applying Flutter's main Gradle plugin imperatively"), ), isTrue, ); expect( actualLines.any((String msg) => msg.contains( "You are applying Flutter's app_plugin_loader Gradle plugin imperatively"), ), isTrue, ); }); }
flutter/packages/flutter_tools/test/integration.shard/android_gradle_deprecated_plugin_apply_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/android_gradle_deprecated_plugin_apply_test.dart", "repo_id": "flutter", "token_count": 2154 }
868
// 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/base/platform.dart'; import 'package:flutter_tools/src/cache.dart'; import '../src/common.dart'; import '../src/context.dart'; import 'test_utils.dart'; void main() { Cache.disableLocking(); late Directory tempDir; final FileSystem fs = LocalFileSystemBlockingSetCurrentDirectory(); final String flutterBin = fs.path.join(getFlutterRoot(), 'bin', 'flutter'); final File previewBin = fs .directory(getFlutterRoot()) .childDirectory('bin') .childDirectory('cache') .childDirectory('artifacts') .childDirectory('flutter_preview') .childFile('flutter_preview.exe'); setUp(() { tempDir = fs.systemTempDirectory.createTempSync('flutter_tools_preview_integration_test.'); }); tearDown(() { tryToDelete(tempDir); tryToDelete(previewBin); }); testUsingContext('flutter build _preview creates preview device', () async { final ProcessResult result = await processManager.run(<String>[ flutterBin, 'build', '_preview', '--verbose', ]); expect(result, const ProcessResultMatcher()); expect( previewBin, exists, ); }, skip: !const LocalPlatform().isWindows); // [intended] Flutter Preview only supported on Windows currently }
flutter/packages/flutter_tools/test/integration.shard/build_preview_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/build_preview_test.dart", "repo_id": "flutter", "token_count": 569 }
869
// 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:vm_service/vm_service.dart'; import '../src/common.dart'; import 'test_data/basic_project.dart'; import 'test_data/integration_tests_project.dart'; import 'test_data/tests_project.dart'; import 'test_driver.dart'; import 'test_utils.dart'; void batch1() { final BasicProject project = BasicProject(); late Directory tempDir; late FlutterRunTestDriver flutter; Future<void> initProject() async { tempDir = createResolvedTempDirectorySync('run_expression_eval_test.'); await project.setUpIn(tempDir); flutter = FlutterRunTestDriver(tempDir); } Future<void> cleanProject() async { await flutter.stop(); tryToDelete(tempDir); } Future<void> breakInBuildMethod(FlutterTestDriver flutter) async { await flutter.breakAt( project.buildMethodBreakpointUri, project.buildMethodBreakpointLine, ); } Future<void> breakInTopLevelFunction(FlutterTestDriver flutter) async { await flutter.breakAt( project.topLevelFunctionBreakpointUri, project.topLevelFunctionBreakpointLine, ); } testWithoutContext('flutter run expression evaluation - can evaluate trivial expressions in top level function', () async { await initProject(); await flutter.run(withDebugger: true); await breakInTopLevelFunction(flutter); await evaluateTrivialExpressions(flutter); await cleanProject(); }); testWithoutContext('flutter run expression evaluation - can evaluate trivial expressions in build method', () async { await initProject(); await flutter.run(withDebugger: true); await breakInBuildMethod(flutter); await evaluateTrivialExpressions(flutter); await cleanProject(); }); testWithoutContext('flutter run expression evaluation - can evaluate complex expressions in top level function', () async { await initProject(); await flutter.run(withDebugger: true); await breakInTopLevelFunction(flutter); await evaluateComplexExpressions(flutter); await cleanProject(); }); testWithoutContext('flutter run expression evaluation - can evaluate complex expressions in build method', () async { await initProject(); await flutter.run(withDebugger: true); await breakInBuildMethod(flutter); await evaluateComplexExpressions(flutter); await cleanProject(); }); testWithoutContext('flutter run expression evaluation - can evaluate expressions returning complex objects in top level function', () async { await initProject(); await flutter.run(withDebugger: true); await breakInTopLevelFunction(flutter); await evaluateComplexReturningExpressions(flutter); await cleanProject(); }); testWithoutContext('flutter run expression evaluation - can evaluate expressions returning complex objects in build method', () async { await initProject(); await flutter.run(withDebugger: true); await breakInBuildMethod(flutter); await evaluateComplexReturningExpressions(flutter); await cleanProject(); }); } void batch2() { final TestsProject project = TestsProject(); late Directory tempDir; late FlutterTestTestDriver flutter; Future<void> initProject() async { tempDir = createResolvedTempDirectorySync('test_expression_eval_test.'); await project.setUpIn(tempDir); flutter = FlutterTestTestDriver(tempDir); } Future<void> cleanProject() async { await flutter.waitForCompletion(); tryToDelete(tempDir); } testWithoutContext('flutter test expression evaluation - can evaluate trivial expressions in a test', () async { await initProject(); await flutter.test( withDebugger: true, beforeStart: () => flutter.addBreakpoint(project.breakpointUri, project.breakpointLine), ); await flutter.waitForPause(); await evaluateTrivialExpressions(flutter); // Ensure we did not leave a dill file alongside the test. // https://github.com/Dart-Code/Dart-Code/issues/4243. final String dillFilename = '${project.testFilePath}.dill'; expect(fileSystem.file(dillFilename).existsSync(), isFalse); await cleanProject(); }); testWithoutContext('flutter test expression evaluation - can evaluate complex expressions in a test', () async { await initProject(); await flutter.test( withDebugger: true, beforeStart: () => flutter.addBreakpoint(project.breakpointUri, project.breakpointLine), ); await flutter.waitForPause(); await evaluateComplexExpressions(flutter); await cleanProject(); }); testWithoutContext('flutter test expression evaluation - can evaluate expressions returning complex objects in a test', () async { await initProject(); await flutter.test( withDebugger: true, beforeStart: () => flutter.addBreakpoint(project.breakpointUri, project.breakpointLine), ); await flutter.waitForPause(); await evaluateComplexReturningExpressions(flutter); await cleanProject(); }); } void batch3() { final IntegrationTestsProject project = IntegrationTestsProject(); late Directory tempDir; late FlutterTestTestDriver flutter; Future<void> initProject() async { tempDir = createResolvedTempDirectorySync('integration_test_expression_eval_test.'); await project.setUpIn(tempDir); flutter = FlutterTestTestDriver(tempDir); } Future<void> cleanProject() async { await flutter.waitForCompletion(); tryToDelete(tempDir); } testWithoutContext('flutter integration test expression evaluation - can evaluate expressions in a test', () async { await initProject(); await flutter.test( deviceId: 'flutter-tester', testFile: project.testFilePath, withDebugger: true, beforeStart: () => flutter.addBreakpoint(project.breakpointUri, project.breakpointLine), ); await flutter.waitForPause(); await evaluateTrivialExpressions(flutter); // Ensure we did not leave a dill file alongside the test. // https://github.com/Dart-Code/Dart-Code/issues/4243. final String dillFilename = '${project.testFilePath}.dill'; expect(fileSystem.file(dillFilename).existsSync(), isFalse); await cleanProject(); }); } Future<void> evaluateTrivialExpressions(FlutterTestDriver flutter) async { ObjRef res; res = await flutter.evaluateInFrame('"test"'); expectValueOfType(res, InstanceKind.kString, 'test'); res = await flutter.evaluateInFrame('1'); expectValueOfType(res, InstanceKind.kInt, 1.toString()); res = await flutter.evaluateInFrame('true'); expectValueOfType(res, InstanceKind.kBool, true.toString()); } Future<void> evaluateComplexExpressions(FlutterTestDriver flutter) async { final ObjRef res = await flutter.evaluateInFrame('new DateTime(2000).year'); expectValueOfType(res, InstanceKind.kInt, '2000'); } Future<void> evaluateComplexReturningExpressions(FlutterTestDriver flutter) async { final DateTime date = DateTime(2000); final ObjRef resp = await flutter.evaluateInFrame('new DateTime(2000)'); expectInstanceOfClass(resp, 'DateTime'); final ObjRef res = await flutter.evaluate(resp.id!, r'"$year-$month-$day"'); expectValue(res, '${date.year}-${date.month}-${date.day}'); } void expectInstanceOfClass(ObjRef result, String name) { expect(result, const TypeMatcher<InstanceRef>() .having((InstanceRef instance) => instance.classRef!.name, 'resp.classRef.name', name)); } void expectValueOfType(ObjRef result, String kind, String message) { expect(result, const TypeMatcher<InstanceRef>() .having((InstanceRef instance) => instance.kind, 'kind', kind) .having((InstanceRef instance) => instance.valueAsString, 'valueAsString', message)); } void expectValue(ObjRef result, String message) { expect(result, const TypeMatcher<InstanceRef>() .having((InstanceRef instance) => instance.valueAsString, 'valueAsString', message)); } void main() { batch1(); batch2(); batch3(); }
flutter/packages/flutter_tools/test/integration.shard/expression_evaluation_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/expression_evaluation_test.dart", "repo_id": "flutter", "token_count": 2527 }
870
// 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/file.dart'; import '../src/common.dart'; import 'test_data/hot_reload_with_asset.dart'; import 'test_driver.dart'; import 'test_utils.dart'; void main() { late Directory tempDir; final HotReloadWithAssetProject project = HotReloadWithAssetProject(); late FlutterRunTestDriver flutter; setUp(() async { tempDir = createResolvedTempDirectorySync('hot_reload_test.'); await project.setUpIn(tempDir); flutter = FlutterRunTestDriver(tempDir); }); tearDown(() async { await flutter.stop(); tryToDelete(tempDir); }); testWithoutContext('hot reload does not need to sync assets on the first reload', () async { final Completer<void> onFirstLoad = Completer<void>(); final Completer<void> onSecondLoad = Completer<void>(); flutter.stdout.listen((String line) { // If the asset fails to load, this message will be printed instead. // this indicates that the devFS was not able to locate the asset // after the hot reload. if (line.contains('FAILED TO LOAD')) { fail('Did not load asset: $line'); } if (line.contains('LOADED DATA')) { onFirstLoad.complete(); } if (line.contains('SECOND DATA')) { onSecondLoad.complete(); } }); flutter.stdout.listen(printOnFailure); await flutter.run(); await onFirstLoad.future; project.uncommentHotReloadPrint(); await flutter.hotReload(); await onSecondLoad.future; }); testWithoutContext('hot restart does not need to sync assets on the first reload', () async { final Completer<void> onFirstLoad = Completer<void>(); final Completer<void> onSecondLoad = Completer<void>(); flutter.stdout.listen((String line) { // If the asset fails to load, this message will be printed instead. // this indicates that the devFS was not able to locate the asset // after the hot reload. if (line.contains('FAILED TO LOAD')) { fail('Did not load asset: $line'); } if (line.contains('LOADED DATA')) { onFirstLoad.complete(); } if (line.contains('SECOND DATA')) { onSecondLoad.complete(); } }); flutter.stdout.listen(printOnFailure); await flutter.run(); await onFirstLoad.future; project.uncommentHotReloadPrint(); await flutter.hotRestart(); await onSecondLoad.future; }); }
flutter/packages/flutter_tools/test/integration.shard/hot_reload_with_asset_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/hot_reload_with_asset_test.dart", "repo_id": "flutter", "token_count": 945 }
871
// 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 '../test_utils.dart'; import 'project.dart'; class HotReloadConstProject extends Project { @override final String pubspec = ''' name: test environment: sdk: '>=3.2.0-0 <4.0.0' dependencies: flutter: sdk: flutter '''; @override final String main = r''' import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); final ByteData message = const StringCodec().encodeMessage('AppLifecycleState.resumed')!; await ServicesBinding.instance!.defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { }); runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp(); final int field = 2; @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', home: Container(), ); } } '''; void removeFieldFromConstClass() { final String newMainContents = main.replaceAll( 'final int field = 2;', '// final int field = 2;', ); writeFile( fileSystem.path.join(dir.path, 'lib', 'main.dart'), newMainContents, writeFutureModifiedDate: true, ); } }
flutter/packages/flutter_tools/test/integration.shard/test_data/hot_reload_const_project.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/test_data/hot_reload_const_project.dart", "repo_id": "flutter", "token_count": 546 }
872
// 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/local.dart'; import 'package:flutter_tools/src/base/io.dart'; import 'package:flutter_tools/src/base/platform.dart'; import 'package:process/process.dart'; import 'package:vm_service/vm_service.dart'; import '../src/common.dart'; import 'test_driver.dart'; /// The [FileSystem] for the integration test environment. const FileSystem fileSystem = LocalFileSystem(); /// The [Platform] for the integration test environment. const Platform platform = LocalPlatform(); /// The [ProcessManager] for the integration test environment. const ProcessManager processManager = LocalProcessManager(); /// Creates a temporary directory but resolves any symlinks to return the real /// underlying path to avoid issues with breakpoints/hot reload. /// https://github.com/flutter/flutter/pull/21741 Directory createResolvedTempDirectorySync(String prefix) { assert(prefix.endsWith('.')); final Directory tempDirectory = fileSystem.systemTempDirectory.createTempSync('flutter_$prefix'); return fileSystem.directory(tempDirectory.resolveSymbolicLinksSync()); } void writeFile(String path, String content, {bool writeFutureModifiedDate = false}) { final File file = fileSystem.file(path) ..createSync(recursive: true) ..writeAsStringSync(content, flush: true); // Some integration tests on Windows to not see this file as being modified // recently enough for the hot reload to pick this change up unless the // modified time is written in the future. if (writeFutureModifiedDate) { file.setLastModifiedSync(DateTime.now().add(const Duration(seconds: 5))); } } void writeBytesFile(String path, List<int> content) { fileSystem.file(path) ..createSync(recursive: true) ..writeAsBytesSync(content, flush: true); } void writePackages(String folder) { writeFile(fileSystem.path.join(folder, '.packages'), ''' test:${fileSystem.path.join(fileSystem.currentDirectory.path, 'lib')}/ '''); } Future<void> getPackages(String folder) async { final List<String> command = <String>[ fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter'), 'pub', 'get', ]; final ProcessResult result = await processManager.run(command, workingDirectory: folder); if (result.exitCode != 0) { throw Exception('flutter pub get failed: ${result.stderr}\n${result.stdout}'); } } const String kLocalEngineEnvironment = 'FLUTTER_LOCAL_ENGINE'; const String kLocalEngineHostEnvironment = 'FLUTTER_LOCAL_ENGINE_HOST'; const String kLocalEngineLocation = 'FLUTTER_LOCAL_ENGINE_SRC_PATH'; List<String> getLocalEngineArguments() { return <String>[ if (platform.environment.containsKey(kLocalEngineEnvironment)) '--local-engine=${platform.environment[kLocalEngineEnvironment]}', if (platform.environment.containsKey(kLocalEngineLocation)) '--local-engine-src-path=${platform.environment[kLocalEngineLocation]}', if (platform.environment.containsKey(kLocalEngineHostEnvironment)) '--local-engine-host=${platform.environment[kLocalEngineHostEnvironment]}', ]; } Future<void> pollForServiceExtensionValue<T>({ required FlutterTestDriver testDriver, required String extension, required T continuePollingValue, required Matcher matches, String valueKey = 'value', }) async { for (int i = 0; i < 10; i++) { final Response response = await testDriver.callServiceExtension(extension); if (response.json?[valueKey] as T == continuePollingValue) { await Future<void>.delayed(const Duration(seconds: 1)); } else { expect(response.json?[valueKey] as T, matches); return; } } fail( "Did not find expected value for service extension '$extension'. All call" " attempts responded with '$continuePollingValue'.", ); } abstract final class AppleTestUtils { static const List<String> requiredSymbols = <String>[ '_kDartIsolateSnapshotData', '_kDartIsolateSnapshotInstructions', '_kDartVmSnapshotData', '_kDartVmSnapshotInstructions' ]; static List<String> getExportedSymbols(String dwarfPath) { final ProcessResult nm = processManager.runSync( <String>[ 'nm', '--debug-syms', // nm docs: 'Show all symbols, even debugger only' '--defined-only', '--just-symbol-name', dwarfPath, '-arch', 'arm64', ], ); final String nmOutput = (nm.stdout as String).trim(); return nmOutput.isEmpty ? const <String>[] : nmOutput.split('\n'); } } /// Matcher to be used for [ProcessResult] returned /// from a process run /// /// The default for [exitCode] will be 0 while /// [stdoutPattern] and [stderrPattern] are both optional class ProcessResultMatcher extends Matcher { const ProcessResultMatcher({ this.exitCode = 0, this.stdoutPattern, this.stderrPattern, }); /// The expected exit code to get returned from a process run final int exitCode; /// Substring to find in the process's stdout final Pattern? stdoutPattern; /// Substring to find in the process's stderr final Pattern? stderrPattern; @override Description describe(Description description) { description.add('a process with exit code $exitCode'); if (stdoutPattern != null) { description.add(' and stdout: "$stdoutPattern"'); } if (stderrPattern != null) { description.add(' and stderr: "$stderrPattern"'); } return description; } @override bool matches(dynamic item, Map<dynamic, dynamic> matchState) { final ProcessResult result = item as ProcessResult; bool foundStdout = true; bool foundStderr = true; final String stdout = result.stdout as String; final String stderr = result.stderr as String; if (stdoutPattern != null) { foundStdout = stdout.contains(stdoutPattern!); matchState['stdout'] = stdout; } else if (stdout.isNotEmpty) { // even if we were not asserting on stdout, show stdout for debug purposes matchState['stdout'] = stdout; } if (stderrPattern != null) { foundStderr = stderr.contains(stderrPattern!); matchState['stderr'] = stderr; } else if (stderr.isNotEmpty) { matchState['stderr'] = stderr; } return result.exitCode == exitCode && foundStdout && foundStderr; } @override Description describeMismatch( Object? item, Description mismatchDescription, Map<dynamic, dynamic> matchState, bool verbose, ) { final ProcessResult result = item! as ProcessResult; if (result.exitCode != exitCode) { mismatchDescription.add('Actual exitCode was ${result.exitCode}\n'); } if (matchState.containsKey('stdout')) { mismatchDescription.add('Actual stdout:\n${matchState["stdout"]}\n'); } if (matchState.containsKey('stderr')) { mismatchDescription.add('Actual stderr:\n${matchState["stderr"]}\n'); } return mismatchDescription; } }
flutter/packages/flutter_tools/test/integration.shard/test_utils.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/test_utils.dart", "repo_id": "flutter", "token_count": 2365 }
873
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'dart:convert'; import 'dart:io' as io show Process, ProcessResult, ProcessSignal, ProcessStartMode, systemEncoding; import 'package:file/file.dart'; import 'package:meta/meta.dart'; import 'package:process/process.dart'; import 'test_wrapper.dart'; export 'package:process/process.dart' show ProcessManager; typedef VoidCallback = void Function(); /// A command for [FakeProcessManager]. @immutable class FakeCommand { const FakeCommand({ required this.command, this.workingDirectory, this.environment, this.encoding, this.duration = Duration.zero, this.onRun, this.exitCode = 0, this.stdout = '', this.stderr = '', this.completer, this.stdin, this.exception, this.outputFollowsExit = false, this.processStartMode, }); /// The exact commands that must be matched for this [FakeCommand] to be /// considered correct. final List<Pattern> command; /// The exact working directory that must be matched for this [FakeCommand] to /// be considered correct. /// /// If this is null, the working directory is ignored. final String? workingDirectory; /// The environment that must be matched for this [FakeCommand] to be considered correct. /// /// If this is null, then the environment is ignored. /// /// Otherwise, each key in this environment must be present and must have a /// value that matches the one given here for the [FakeCommand] to match. final Map<String, String>? environment; /// The stdout and stderr encoding that must be matched for this [FakeCommand] /// to be considered correct. /// /// If this is null, then the encodings are ignored. final Encoding? encoding; /// The time to allow to elapse before returning the [exitCode], if this command /// is "executed". /// /// If you set this to a non-zero time, you should use a [FakeAsync] zone, /// otherwise the test will be artificially slow. final Duration duration; /// A callback that is run after [duration] expires but before the [exitCode] /// (and output) are passed back. /// /// The callback will be provided the full command that matched this instance. /// This can be useful in the rare scenario where the full command cannot be known /// ahead of time (i.e. when one or more instances of [RegExp] are used to /// match the command). For example, the command may contain one or more /// randomly-generated elements, such as a temporary directory path. final void Function(List<String> command)? onRun; /// The process' exit code. /// /// To simulate a never-ending process, set [duration] to a value greater than /// 15 minutes (the timeout for our tests). /// /// To simulate a crash, subtract the crash signal number from 256. For example, /// SIGPIPE (-13) is 243. final int exitCode; /// The output to simulate on stdout. This will be encoded as UTF-8 and /// returned in one go. final String stdout; /// The output to simulate on stderr. This will be encoded as UTF-8 and /// returned in one go. final String stderr; /// If provided, allows the command completion to be blocked until the future /// resolves. final Completer<void>? completer; /// An optional stdin sink that will be exposed through the resulting /// [FakeProcess]. final IOSink? stdin; /// If provided, this exception will be thrown when the fake command is run. final Object? exception; /// When true, stdout and stderr will only be emitted after the `exitCode` /// [Future] on [io.Process] completes. final bool outputFollowsExit; final io.ProcessStartMode? processStartMode; void _matches( List<String> command, String? workingDirectory, Map<String, String>? environment, Encoding? encoding, io.ProcessStartMode? mode, ) { final List<dynamic> matchers = this.command.map((Pattern x) => x is String ? x : matches(x)).toList(); expect(command, matchers); if (processStartMode != null) { expect(mode, processStartMode); } if (this.workingDirectory != null) { expect(workingDirectory, this.workingDirectory); } if (this.environment != null) { expect(environment, this.environment); } if (this.encoding != null) { expect(encoding, this.encoding); } } } /// A fake process for use with [FakeProcessManager]. /// /// The process delays exit until both [duration] (if specified) has elapsed /// and [completer] (if specified) has completed. /// /// When [outputFollowsExit] is specified, bytes are streamed to [stderr] and /// [stdout] after the process exits. @visibleForTesting class FakeProcess implements io.Process { FakeProcess({ int exitCode = 0, Duration duration = Duration.zero, this.pid = 1234, List<int> stderr = const <int>[], IOSink? stdin, List<int> stdout = const <int>[], Completer<void>? completer, bool outputFollowsExit = false, }) : _exitCode = exitCode, exitCode = Future<void>.delayed(duration).then((void value) { if (completer != null) { return completer.future.then((void _) => exitCode); } return exitCode; }), _stderr = stderr, stdin = stdin ?? IOSink(StreamController<List<int>>().sink), _stdout = stdout, _completer = completer { if (_stderr.isEmpty) { this.stderr = const Stream<List<int>>.empty(); } else if (outputFollowsExit) { // Wait for the process to exit before emitting stderr. this.stderr = Stream<List<int>>.fromFuture(this.exitCode.then((_) { // Return a Future so stderr isn't immediately available to those who // await exitCode, but is available asynchronously later. return Future<List<int>>(() => _stderr); })); } else { this.stderr = Stream<List<int>>.value(_stderr); } if (_stdout.isEmpty) { this.stdout = const Stream<List<int>>.empty(); } else if (outputFollowsExit) { // Wait for the process to exit before emitting stdout. this.stdout = Stream<List<int>>.fromFuture(this.exitCode.then((_) { // Return a Future so stdout isn't immediately available to those who // await exitCode, but is available asynchronously later. return Future<List<int>>(() => _stdout); })); } else { this.stdout = Stream<List<int>>.value(_stdout); } } /// The process exit code. final int _exitCode; /// When specified, blocks process exit until completed. final Completer<void>? _completer; @override final Future<int> exitCode; @override final int pid; /// The raw byte content of stderr. final List<int> _stderr; @override late final Stream<List<int>> stderr; @override final IOSink stdin; @override late final Stream<List<int>> stdout; /// The raw byte content of stdout. final List<int> _stdout; /// The list of [kill] signals this process received so far. @visibleForTesting List<io.ProcessSignal> get signals => _signals; final List<io.ProcessSignal> _signals = <io.ProcessSignal>[]; @override bool kill([io.ProcessSignal signal = io.ProcessSignal.sigterm]) { _signals.add(signal); // Killing a fake process has no effect. return true; } } abstract class FakeProcessManager implements ProcessManager { /// A fake [ProcessManager] which responds to all commands as if they had run /// instantaneously with an exit code of 0 and no output. factory FakeProcessManager.any() = _FakeAnyProcessManager; /// A fake [ProcessManager] which responds to particular commands with /// particular results. /// /// On creation, pass in a list of [FakeCommand] objects. When the /// [ProcessManager] methods such as [start] are invoked, the next /// [FakeCommand] must match (otherwise the test fails); its settings are used /// to simulate the result of running that command. /// /// If no command is found, then one is implied which immediately returns exit /// code 0 with no output. /// /// There is no logic to ensure that all the listed commands are run. Use /// [FakeCommand.onRun] to set a flag, or specify a sentinel command as your /// last command and verify its execution is successful, to ensure that all /// the specified commands are actually called. factory FakeProcessManager.list(List<FakeCommand> commands) = _SequenceProcessManager; factory FakeProcessManager.empty() => _SequenceProcessManager(<FakeCommand>[]); FakeProcessManager._(); /// Adds a new [FakeCommand] to the current process manager. /// /// This can be used to configure test expectations after the [ProcessManager] has been /// provided to another interface. /// /// This is a no-op on [FakeProcessManager.any]. void addCommand(FakeCommand command); /// Add multiple [FakeCommand] to the current process manager. void addCommands(Iterable<FakeCommand> commands) { commands.forEach(addCommand); } final Map<int, FakeProcess> _fakeRunningProcesses = <int, FakeProcess>{}; /// Whether this fake has more [FakeCommand]s that are expected to run. /// /// This is always `true` for [FakeProcessManager.any]. bool get hasRemainingExpectations; /// The expected [FakeCommand]s that have not yet run. List<FakeCommand> get _remainingExpectations; @protected FakeCommand findCommand( List<String> command, String? workingDirectory, Map<String, String>? environment, Encoding? encoding, io.ProcessStartMode? mode, ); int _pid = 9999; FakeProcess _runCommand( List<String> command, { String? workingDirectory, Map<String, String>? environment, Encoding? encoding, io.ProcessStartMode? mode, }) { _pid += 1; final FakeCommand fakeCommand = findCommand( command, workingDirectory, environment, encoding, mode, ); if (fakeCommand.exception != null) { assert(fakeCommand.exception is Exception || fakeCommand.exception is Error); throw fakeCommand.exception!; // ignore: only_throw_errors } if (fakeCommand.onRun != null) { fakeCommand.onRun!(command); } return FakeProcess( duration: fakeCommand.duration, exitCode: fakeCommand.exitCode, pid: _pid, stderr: encoding?.encode(fakeCommand.stderr) ?? fakeCommand.stderr.codeUnits, stdin: fakeCommand.stdin, stdout: encoding?.encode(fakeCommand.stdout) ?? fakeCommand.stdout.codeUnits, completer: fakeCommand.completer, outputFollowsExit: fakeCommand.outputFollowsExit, ); } @override Future<io.Process> start( List<dynamic> command, { String? workingDirectory, Map<String, String>? environment, bool includeParentEnvironment = true, // ignored bool runInShell = false, // ignored io.ProcessStartMode mode = io.ProcessStartMode.normal, }) { final FakeProcess process = _runCommand( command.cast<String>(), workingDirectory: workingDirectory, environment: environment, encoding: io.systemEncoding, mode: mode, ); if (process._completer != null) { _fakeRunningProcesses[process.pid] = process; process.exitCode.whenComplete(() { _fakeRunningProcesses.remove(process.pid); }); } return Future<io.Process>.value(process); } @override Future<io.ProcessResult> run( List<dynamic> command, { String? workingDirectory, Map<String, String>? environment, bool includeParentEnvironment = true, // ignored bool runInShell = false, // ignored Encoding? stdoutEncoding = io.systemEncoding, Encoding? stderrEncoding = io.systemEncoding, }) async { final FakeProcess process = _runCommand( command.cast<String>(), workingDirectory: workingDirectory, environment: environment, encoding: stdoutEncoding, ); await process.exitCode; return io.ProcessResult( process.pid, process._exitCode, stdoutEncoding == null ? process._stdout : await stdoutEncoding.decodeStream(process.stdout), stderrEncoding == null ? process._stderr : await stderrEncoding.decodeStream(process.stderr), ); } @override io.ProcessResult runSync( List<dynamic> command, { String? workingDirectory, Map<String, String>? environment, bool includeParentEnvironment = true, // ignored bool runInShell = false, // ignored Encoding? stdoutEncoding = io.systemEncoding, Encoding? stderrEncoding = io.systemEncoding, }) { final FakeProcess process = _runCommand( command.cast<String>(), workingDirectory: workingDirectory, environment: environment, encoding: stdoutEncoding, ); return io.ProcessResult( process.pid, process._exitCode, stdoutEncoding == null ? process._stdout : stdoutEncoding.decode(process._stdout), stderrEncoding == null ? process._stderr : stderrEncoding.decode(process._stderr), ); } /// Returns false if executable in [excludedExecutables]. @override bool canRun(dynamic executable, {String? workingDirectory}) => !excludedExecutables.contains(executable); Set<String> excludedExecutables = <String>{}; @override bool killPid(int pid, [io.ProcessSignal signal = io.ProcessSignal.sigterm]) { // Killing a fake process has no effect unless it has an attached completer. final FakeProcess? fakeProcess = _fakeRunningProcesses[pid]; if (fakeProcess == null) { return false; } fakeProcess.kill(signal); if (fakeProcess._completer != null) { fakeProcess._completer.complete(); } return true; } } class _FakeAnyProcessManager extends FakeProcessManager { _FakeAnyProcessManager() : super._(); @override FakeCommand findCommand( List<String> command, String? workingDirectory, Map<String, String>? environment, Encoding? encoding, io.ProcessStartMode? mode, ) { return FakeCommand( command: command, workingDirectory: workingDirectory, environment: environment, encoding: encoding, processStartMode: mode, ); } @override void addCommand(FakeCommand command) { } @override bool get hasRemainingExpectations => true; @override List<FakeCommand> get _remainingExpectations => <FakeCommand>[]; } class _SequenceProcessManager extends FakeProcessManager { _SequenceProcessManager(this._commands) : super._(); final List<FakeCommand> _commands; @override FakeCommand findCommand( List<String> command, String? workingDirectory, Map<String, String>? environment, Encoding? encoding, io.ProcessStartMode? mode, ) { expect(_commands, isNotEmpty, reason: 'ProcessManager was told to execute $command (in $workingDirectory) ' 'but the FakeProcessManager.list expected no more processes.' ); _commands.first._matches(command, workingDirectory, environment, encoding, mode); return _commands.removeAt(0); } @override void addCommand(FakeCommand command) { _commands.add(command); } @override bool get hasRemainingExpectations => _commands.isNotEmpty; @override List<FakeCommand> get _remainingExpectations => _commands; } /// Matcher that successfully matches against a [FakeProcessManager] with /// no remaining expectations ([item.hasRemainingExpectations] returns false). const Matcher hasNoRemainingExpectations = _HasNoRemainingExpectations(); class _HasNoRemainingExpectations extends Matcher { const _HasNoRemainingExpectations(); @override bool matches(dynamic item, Map<dynamic, dynamic> matchState) => item is FakeProcessManager && !item.hasRemainingExpectations; @override Description describe(Description description) => description.add('a fake process manager with no remaining expectations'); @override Description describeMismatch( dynamic item, Description description, Map<dynamic, dynamic> matchState, bool verbose, ) { final FakeProcessManager fakeProcessManager = item as FakeProcessManager; return description.add( 'has remaining expectations:\n${fakeProcessManager._remainingExpectations.map((FakeCommand command) => command.command).join('\n')}'); } }
flutter/packages/flutter_tools/test/src/fake_process_manager.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/src/fake_process_manager.dart", "repo_id": "flutter", "token_count": 5366 }
874
// 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:flutter_tools/src/base/file_system.dart'; import 'package:vm_service/vm_service.dart'; import '../integration.shard/test_data/basic_project.dart'; import '../integration.shard/test_driver.dart'; import '../integration.shard/test_utils.dart'; import '../src/common.dart'; void main() { late Directory tempDir; final BasicProjectWithUnaryMain project = BasicProjectWithUnaryMain(); late FlutterRunTestDriver flutter; setUp(() async { tempDir = createResolvedTempDirectorySync('run_test.'); await project.setUpIn(tempDir); flutter = FlutterRunTestDriver(tempDir); }); tearDown(() async { await flutter.stop(); tryToDelete(tempDir); }); Future<void> start({bool verbose = false}) async { // The non-test project has a loop around its breakpoints. // No need to start paused as all breakpoint would be eventually reached. await flutter.run( withDebugger: true, chrome: true, additionalCommandArgs: <String>[ if (verbose) '--verbose', '--web-renderer=html', ]); } Future<void> evaluate() async { final ObjRef res = await flutter.evaluate('package:characters/characters.dart', 'true'); expect(res, isA<InstanceRef>() .having((InstanceRef o) => o.kind, 'kind', 'Bool')); } testWithoutContext('flutter run outputs info messages from dwds in verbose mode', () async { final Future<dynamic> info = expectLater( flutter.stdout, emitsThrough(contains('Loaded debug metadata'))); await start(verbose: true); await evaluate(); await flutter.stop(); await info; }); }
flutter/packages/flutter_tools/test/web.shard/output_web_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/web.shard/output_web_test.dart", "repo_id": "flutter", "token_count": 647 }
875
// 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:fuchsia_remote_debug_protocol/fuchsia_remote_debug_protocol.dart'; import 'package:test/fake.dart'; import 'package:test/test.dart'; import 'package:vm_service/vm_service.dart' as vms; void main() { group('FuchsiaRemoteConnection.connect', () { late List<FakePortForwarder> forwardedPorts; List<FakeVmService> fakeVmServices; late List<Uri> uriConnections; setUp(() { final List<Map<String, dynamic>> flutterViewCannedResponses = <Map<String, dynamic>>[ <String, dynamic>{ 'views': <Map<String, dynamic>>[ <String, dynamic>{ 'type': 'FlutterView', 'id': 'flutterView0', }, ], }, <String, dynamic>{ 'views': <Map<String, dynamic>>[ <String, dynamic>{ 'type': 'FlutterView', 'id': 'flutterView1', 'isolate': <String, dynamic>{ 'type': '@Isolate', 'fixedId': 'true', 'id': 'isolates/1', 'name': 'file://flutterBinary1', 'number': '1', }, }, ], }, <String, dynamic>{ 'views': <Map<String, dynamic>>[ <String, dynamic>{ 'type': 'FlutterView', 'id': 'flutterView2', 'isolate': <String, dynamic>{ 'type': '@Isolate', 'fixedId': 'true', 'id': 'isolates/2', 'name': 'file://flutterBinary2', 'number': '2', }, }, ], }, ]; forwardedPorts = <FakePortForwarder>[]; fakeVmServices = <FakeVmService>[]; uriConnections = <Uri>[]; Future<vms.VmService> fakeVmConnectionFunction( Uri uri, { Duration? timeout, }) { return Future<vms.VmService>(() async { final FakeVmService service = FakeVmService(); fakeVmServices.add(service); uriConnections.add(uri); service.flutterListViews = vms.Response.parse(flutterViewCannedResponses[uri.port]); return service; }); } fuchsiaVmServiceConnectionFunction = fakeVmConnectionFunction; }); tearDown(() { /// Most tests will fake out the port forwarding and connection /// functions. restoreFuchsiaPortForwardingFunction(); restoreVmServiceConnectionFunction(); }); test('end-to-end with one vm connection and flutter view query', () async { int port = 0; Future<PortForwarder> fakePortForwardingFunction( String address, int remotePort, [ String? interface = '', String? configFile, ]) { return Future<PortForwarder>(() { final FakePortForwarder pf = FakePortForwarder(); forwardedPorts.add(pf); pf.port = port++; pf.remotePort = remotePort; return pf; }); } fuchsiaPortForwardingFunction = fakePortForwardingFunction; final FakeSshCommandRunner fakeRunner = FakeSshCommandRunner(); // Adds some extra junk to make sure the strings will be cleaned up. fakeRunner.iqueryResponse = <String>[ '[', ' {', ' "data_source": "Inspect",', ' "metadata": {', ' "filename": "fuchsia.inspect.Tree",', ' "component_url": "fuchsia-pkg://fuchsia.com/flutter_runner#meta/flutter_runner.cm",', ' "timestamp": 12345678901234', ' },', ' "moniker": "core/session-manager/session/flutter_runner",', ' "payload": {', ' "root": {', ' "vm_service_port": "12345",', ' "16859221": {', ' "empty_tree": "this semantic tree is empty"', ' },', ' "build_info": {', ' "dart_sdk_git_revision": "77e83fcc14fa94049f363d554579f48fbd6bb7a1",', ' "dart_sdk_semantic_version": "2.19.0-317.0.dev",', ' "flutter_engine_git_revision": "563b8e830c697a543bf0a8a9f4ae3edfad86ea86",', ' "fuchsia_sdk_version": "10.20221018.0.1"', ' },', ' "vm": {', ' "dst_status": 1,', ' "get_profile_status": 0,', ' "num_get_profile_calls": 1,', ' "num_intl_provider_errors": 0,', ' "num_on_change_calls": 0,', ' "timezone_content_status": 0,', ' "tz_data_close_status": -1,', ' "tz_data_status": -1', ' }', ' }', ' },', ' "version": 1', ' }', ' ]' ]; fakeRunner.address = 'fe80::8eae:4cff:fef4:9247'; fakeRunner.interface = 'eno1'; final FuchsiaRemoteConnection connection = await FuchsiaRemoteConnection.connectWithSshCommandRunner(fakeRunner); expect(forwardedPorts.length, 1); expect(forwardedPorts[0].remotePort, 12345); // VMs should be accessed via localhost ports given by // [fakePortForwardingFunction]. expect(uriConnections[0], Uri(scheme: 'ws', host: '[::1]', port: 0, path: '/ws')); final List<FlutterView> views = await connection.getFlutterViews(); expect(views, isNot(null)); expect(views.length, 1); // Since name can be null, check for the ID on all of them. expect(views[0].id, 'flutterView0'); expect(views[0].name, equals(null)); // Ensure the ports are all closed after stop was called. await connection.stop(); expect(forwardedPorts[0].stopped, true); }); test('end-to-end with one vm and remote open port', () async { int port = 0; Future<PortForwarder> fakePortForwardingFunction( String address, int remotePort, [ String? interface = '', String? configFile, ]) { return Future<PortForwarder>(() { final FakePortForwarder pf = FakePortForwarder(); forwardedPorts.add(pf); pf.port = port++; pf.remotePort = remotePort; pf.openPortAddress = 'fe80::1:2%eno2'; return pf; }); } fuchsiaPortForwardingFunction = fakePortForwardingFunction; final FakeSshCommandRunner fakeRunner = FakeSshCommandRunner(); // Adds some extra junk to make sure the strings will be cleaned up. fakeRunner.iqueryResponse = <String>[ '[', ' {', ' "data_source": "Inspect",', ' "metadata": {', ' "filename": "fuchsia.inspect.Tree",', ' "component_url": "fuchsia-pkg://fuchsia.com/flutter_runner#meta/flutter_runner.cm",', ' "timestamp": 12345678901234', ' },', ' "moniker": "core/session-manager/session/flutter_runner",', ' "payload": {', ' "root": {', ' "vm_service_port": "12345",', ' "16859221": {', ' "empty_tree": "this semantic tree is empty"', ' },', ' "build_info": {', ' "dart_sdk_git_revision": "77e83fcc14fa94049f363d554579f48fbd6bb7a1",', ' "dart_sdk_semantic_version": "2.19.0-317.0.dev",', ' "flutter_engine_git_revision": "563b8e830c697a543bf0a8a9f4ae3edfad86ea86",', ' "fuchsia_sdk_version": "10.20221018.0.1"', ' },', ' "vm": {', ' "dst_status": 1,', ' "get_profile_status": 0,', ' "num_get_profile_calls": 1,', ' "num_intl_provider_errors": 0,', ' "num_on_change_calls": 0,', ' "timezone_content_status": 0,', ' "tz_data_close_status": -1,', ' "tz_data_status": -1', ' }', ' }', ' },', ' "version": 1', ' }', ' ]' ]; fakeRunner.address = 'fe80::8eae:4cff:fef4:9247'; fakeRunner.interface = 'eno1'; final FuchsiaRemoteConnection connection = await FuchsiaRemoteConnection.connectWithSshCommandRunner(fakeRunner); expect(forwardedPorts.length, 1); expect(forwardedPorts[0].remotePort, 12345); // VMs should be accessed via the alternate address given by // [fakePortForwardingFunction]. expect(uriConnections[0], Uri(scheme: 'ws', host: '[fe80::1:2%25eno2]', port: 0, path: '/ws')); final List<FlutterView> views = await connection.getFlutterViews(); expect(views, isNot(null)); expect(views.length, 1); // Since name can be null, check for the ID on all of them. expect(views[0].id, 'flutterView0'); expect(views[0].name, equals(null)); // Ensure the ports are all closed after stop was called. await connection.stop(); expect(forwardedPorts[0].stopped, true); }); test('end-to-end with one vm and ipv4', () async { int port = 0; Future<PortForwarder> fakePortForwardingFunction( String address, int remotePort, [ String? interface = '', String? configFile, ]) { return Future<PortForwarder>(() { final FakePortForwarder pf = FakePortForwarder(); forwardedPorts.add(pf); pf.port = port++; pf.remotePort = remotePort; return pf; }); } fuchsiaPortForwardingFunction = fakePortForwardingFunction; final FakeSshCommandRunner fakeRunner = FakeSshCommandRunner(); // Adds some extra junk to make sure the strings will be cleaned up. fakeRunner.iqueryResponse = <String>[ '[', ' {', ' "data_source": "Inspect",', ' "metadata": {', ' "filename": "fuchsia.inspect.Tree",', ' "component_url": "fuchsia-pkg://fuchsia.com/flutter_runner#meta/flutter_runner.cm",', ' "timestamp": 12345678901234', ' },', ' "moniker": "core/session-manager/session/flutter_runner",', ' "payload": {', ' "root": {', ' "vm_service_port": "12345",', ' "16859221": {', ' "empty_tree": "this semantic tree is empty"', ' },', ' "build_info": {', ' "dart_sdk_git_revision": "77e83fcc14fa94049f363d554579f48fbd6bb7a1",', ' "dart_sdk_semantic_version": "2.19.0-317.0.dev",', ' "flutter_engine_git_revision": "563b8e830c697a543bf0a8a9f4ae3edfad86ea86",', ' "fuchsia_sdk_version": "10.20221018.0.1"', ' },', ' "vm": {', ' "dst_status": 1,', ' "get_profile_status": 0,', ' "num_get_profile_calls": 1,', ' "num_intl_provider_errors": 0,', ' "num_on_change_calls": 0,', ' "timezone_content_status": 0,', ' "tz_data_close_status": -1,', ' "tz_data_status": -1', ' }', ' }', ' },', ' "version": 1', ' }', ' ]' ]; fakeRunner.address = '196.168.1.4'; final FuchsiaRemoteConnection connection = await FuchsiaRemoteConnection.connectWithSshCommandRunner(fakeRunner); expect(forwardedPorts.length, 1); expect(forwardedPorts[0].remotePort, 12345); // VMs should be accessed via the ipv4 loopback. expect(uriConnections[0], Uri(scheme: 'ws', host: '127.0.0.1', port: 0, path: '/ws')); final List<FlutterView> views = await connection.getFlutterViews(); expect(views, isNot(null)); expect(views.length, 1); // Since name can be null, check for the ID on all of them. expect(views[0].id, 'flutterView0'); expect(views[0].name, equals(null)); // Ensure the ports are all closed after stop was called. await connection.stop(); expect(forwardedPorts[0].stopped, true); }); test('env variable test without remote addr', () async { Future<void> failingFunction() async { await FuchsiaRemoteConnection.connect(); } // Should fail as no env variable has been passed. expect(failingFunction, throwsA(isA<FuchsiaRemoteConnectionError>())); }); }); } class FakeSshCommandRunner extends Fake implements SshCommandRunner { List<String>? iqueryResponse; @override Future<List<String>> run(String command) async { if (command.startsWith('iquery --format json show')) { return iqueryResponse!; } throw UnimplementedError(command); } @override String interface = ''; @override String address = ''; @override String get sshConfigPath => '~/.ssh'; } class FakePortForwarder extends Fake implements PortForwarder { @override int port = 0; @override int remotePort = 0; @override String? openPortAddress; bool stopped = false; @override Future<void> stop() async { stopped = true; } } class FakeVmService extends Fake implements vms.VmService { bool disposed = false; vms.Response? flutterListViews; @override Future<void> dispose() async { disposed = true; } @override Future<vms.Response> callMethod(String method, {String? isolateId, Map<String, dynamic>? args}) async { if (method == '_flutter.listViews') { return flutterListViews!; } throw UnimplementedError(method); } @override Future<void> onDone = Future<void>.value(); @override Future<vms.Version> getVersion() async { return vms.Version(major: -1, minor: -1); } }
flutter/packages/fuchsia_remote_debug_protocol/test/fuchsia_remote_connection_test.dart/0
{ "file_path": "flutter/packages/fuchsia_remote_debug_protocol/test/fuchsia_remote_connection_test.dart", "repo_id": "flutter", "token_count": 6844 }
876
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package dev.flutter.plugins.integration_test; import org.junit.Test; import static org.junit.Assert.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import org.junit.runner.RunWith; import android.app.Activity; import androidx.test.ext.junit.runners.AndroidJUnit4; import io.flutter.embedding.android.FlutterActivity; import io.flutter.embedding.android.FlutterFragment; import io.flutter.embedding.android.FlutterFragmentActivity; import io.flutter.embedding.android.FlutterView; @RunWith(AndroidJUnit4.class) public class FlutterDeviceScreenshotTest { @Test public void getFlutterView_returnsNullForNonFlutterActivity() { Activity mockActivity = mock(Activity.class); assertNull(FlutterDeviceScreenshot.getFlutterView(mockActivity)); } @Test public void getFlutterView_returnsFlutterViewForFlutterActivity() { FlutterView mockFlutterView = mock(FlutterView.class); FlutterActivity mockFlutterActivity = mock(FlutterActivity.class); when(mockFlutterActivity.findViewById(FlutterActivity.FLUTTER_VIEW_ID)) .thenReturn(mockFlutterView); assertEquals( FlutterDeviceScreenshot.getFlutterView(mockFlutterActivity), mockFlutterView ); } @Test public void getFlutterView_returnsFlutterViewForFlutterFragmentActivity() { FlutterView mockFlutterView = mock(FlutterView.class); FlutterFragmentActivity mockFlutterFragmentActivity = mock(FlutterFragmentActivity.class); when(mockFlutterFragmentActivity.findViewById(FlutterFragment.FLUTTER_VIEW_ID)) .thenReturn(mockFlutterView); assertEquals( FlutterDeviceScreenshot.getFlutterView(mockFlutterFragmentActivity), mockFlutterView ); } }
flutter/packages/integration_test/android/src/test/java/dev/flutter/plugins/integration_test/FlutterDeviceScreenshotTest.java/0
{ "file_path": "flutter/packages/integration_test/android/src/test/java/dev/flutter/plugins/integration_test/FlutterDeviceScreenshotTest.java", "repo_id": "flutter", "token_count": 755 }
877
// 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 "IntegrationTestPlugin.h" @import UIKit; static NSString *const kIntegrationTestPluginChannel = @"plugins.flutter.io/integration_test"; static NSString *const kMethodTestFinished = @"allTestsFinished"; static NSString *const kMethodScreenshot = @"captureScreenshot"; static NSString *const kMethodConvertSurfaceToImage = @"convertFlutterSurfaceToImage"; static NSString *const kMethodRevertImage = @"revertFlutterImage"; @interface IntegrationTestPlugin () @property(nonatomic, readwrite) NSDictionary<NSString *, NSString *> *testResults; - (instancetype)init NS_DESIGNATED_INITIALIZER; @end @implementation IntegrationTestPlugin { NSDictionary<NSString *, NSString *> *_testResults; NSMutableDictionary<NSString *, UIImage *> *_capturedScreenshotsByName; } + (instancetype)instance { static dispatch_once_t onceToken; static IntegrationTestPlugin *sInstance; dispatch_once(&onceToken, ^{ sInstance = [[IntegrationTestPlugin alloc] initForRegistration]; }); return sInstance; } - (instancetype)initForRegistration { return [self init]; } - (instancetype)init { self = [super init]; _capturedScreenshotsByName = [NSMutableDictionary new]; return self; } + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar { FlutterMethodChannel *channel = [FlutterMethodChannel methodChannelWithName:kIntegrationTestPluginChannel binaryMessenger:registrar.messenger]; [registrar addMethodCallDelegate:[self instance] channel:channel]; } - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { if ([call.method isEqualToString:kMethodTestFinished]) { self.testResults = call.arguments[@"results"]; result(nil); } else if ([call.method isEqualToString:kMethodScreenshot]) { // If running as a native Xcode test, attach to test. UIImage *screenshot = [self capturePngScreenshot]; NSString *name = call.arguments[@"name"]; _capturedScreenshotsByName[name] = screenshot; // Also pass back along the channel for the driver to handle. NSData *pngData = UIImagePNGRepresentation(screenshot); result([FlutterStandardTypedData typedDataWithBytes:pngData]); } else if ([call.method isEqualToString:kMethodConvertSurfaceToImage] || [call.method isEqualToString:kMethodRevertImage]) { // Android only, no-op on iOS. result(nil); } else { result(FlutterMethodNotImplemented); } } - (UIImage *)capturePngScreenshot { UIWindow *window = [UIApplication.sharedApplication.windows filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"keyWindow = YES"]].firstObject; CGRect screenshotBounds = window.bounds; UIImage *image; UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithBounds:screenshotBounds]; image = [renderer imageWithActions:^(UIGraphicsImageRendererContext *rendererContext) { [window drawViewHierarchyInRect:screenshotBounds afterScreenUpdates:YES]; }]; return image; } @end
flutter/packages/integration_test/ios/Classes/IntegrationTestPlugin.m/0
{ "file_path": "flutter/packages/integration_test/ios/Classes/IntegrationTestPlugin.m", "repo_id": "flutter", "token_count": 1091 }
878
name: integration_test description: Runs tests that use the flutter_test API as integration tests. publish_to: none environment: sdk: '>=3.2.0-0 <4.0.0' dependencies: flutter: sdk: flutter flutter_driver: sdk: flutter flutter_test: sdk: flutter path: 1.9.0 vm_service: 14.2.0 async: 2.11.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" boolean_selector: 2.1.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" characters: 1.3.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" clock: 1.1.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" collection: 1.18.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" fake_async: 1.3.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" file: 7.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" leak_tracker: 10.0.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" leak_tracker_flutter_testing: 3.0.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" leak_tracker_testing: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" matcher: 0.12.16+1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" material_color_utilities: 0.8.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" meta: 1.12.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" source_span: 1.10.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" stack_trace: 1.11.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" stream_channel: 2.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" string_scanner: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" sync_http: 0.3.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" term_glyph: 1.2.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" test_api: 0.7.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" vector_math: 2.1.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" webdriver: 3.0.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" flutter: plugin: platforms: android: package: dev.flutter.plugins.integration_test pluginClass: IntegrationTestPlugin ios: pluginClass: IntegrationTestPlugin # PUBSPEC CHECKSUM: b865
flutter/packages/integration_test/pubspec.yaml/0
{ "file_path": "flutter/packages/integration_test/pubspec.yaml", "repo_id": "flutter", "token_count": 1019 }
879
org.gradle.jvmargs=-Xmx1536M android.enableR8=true android.useAndroidX=true android.enableJetifier=true
flutter_clock/analog_clock/android/gradle.properties/0
{ "file_path": "flutter_clock/analog_clock/android/gradle.properties", "repo_id": "flutter_clock", "token_count": 39 }
880
# Digital Clock This app is an example of a digital clock. It has a light theme and a dark theme. See the [Analog Clock](../analog_clock) if you'd like an example that displays the weather and location. <img src='digital.gif' width='350'> <img src='digital_dark.png' width='350'> <img src='digital_light.png' width='350'>
flutter_clock/digital_clock/README.md/0
{ "file_path": "flutter_clock/digital_clock/README.md", "repo_id": "flutter_clock", "token_count": 100 }
881
# Flutter Gallery **NOTE**: The Flutter Gallery is now deprecated, and no longer being active maintained. Flutter Gallery was a resource to help developers evaluate and use Flutter. It is now being used primarily for testing. For posterity, the web version remains [hosted here](https://flutter-gallery-archive.web.app). We recommend Flutter developers check out the following resources: * **Wonderous** ([web demo](https://wonderous.app/web/), [App Store](https://apps.apple.com/us/app/wonderous/id1612491897), [Google Play](https://play.google.com/store/apps/details?id=com.gskinner.flutter.wonders), [source code](https://github.com/gskinnerTeam/flutter-wonderous-app)):<br> A Flutter app that showcases Flutter's support for elegant design and rich animations. * **Material 3 Demo** ([web demo](https://flutter.github.io/samples/web/material_3_demo/), [source code](https://github.com/flutter/samples/tree/main/material_3_demo)):<br> A Flutter app that showcases Material 3 features in the Flutter Material library. * **Flutter Samples** ([samples](https://flutter.github.io/samples), [source code](https://github.com/flutter/samples)):<br> A collection of open source samples that illustrate best practices for Flutter. * **Widget catalogs** ([Material](https://docs.flutter.dev/ui/widgets/material), [Cupertino](https://docs.flutter.dev/ui/widgets/cupertino)):<br> Catalogs for Material, Cupertino, and other widgets available for use in UI.
gallery/README.md/0
{ "file_path": "gallery/README.md", "repo_id": "gallery", "token_count": 446 }
882
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>$(DEVELOPMENT_LANGUAGE)</string> <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>Flutter Gallery</string> <key>CFBundleLocalizations</key> <array> <string>en</string> <string>af</string> <string>am</string> <string>ar_EG</string> <string>ar_JO</string> <string>ar_MA</string> <string>ar_SA</string> <string>ar_XB</string> <string>ar</string> <string>as</string> <string>az</string> <string>be</string> <string>bg</string> <string>bn</string> <string>bs</string> <string>ca</string> <string>cs</string> <string>da</string> <string>de_AT</string> <string>de_CH</string> <string>de</string> <string>el</string> <string>en_AU</string> <string>en_CA</string> <string>en_GB</string> <string>en_IE</string> <string>en_IN</string> <string>en_NZ</string> <string>en_SG</string> <string>en_XA</string> <string>en_XC</string> <string>en_ZA</string> <string>es_419</string> <string>es_AR</string> <string>es_BO</string> <string>es_CL</string> <string>es_CO</string> <string>es_CR</string> <string>es_DO</string> <string>es_EC</string> <string>es_GT</string> <string>es_HN</string> <string>es_MX</string> <string>es_NI</string> <string>es_PA</string> <string>es_PE</string> <string>es_PR</string> <string>es_PY</string> <string>es_SV</string> <string>es_US</string> <string>es_UY</string> <string>es_VE</string> <string>es</string> <string>et</string> <string>eu</string> <string>fa</string> <string>fi</string> <string>fil</string> <string>fr_CA</string> <string>fr_CH</string> <string>fr</string> <string>gl</string> <string>gsw</string> <string>gu</string> <string>he</string> <string>hi</string> <string>hr</string> <string>hu</string> <string>hy</string> <string>id</string> <string>in</string> <string>is</string> <string>it</string> <string>iw</string> <string>ja</string> <string>ka</string> <string>kk</string> <string>km</string> <string>kn</string> <string>ko</string> <string>ky</string> <string>ln</string> <string>lo</string> <string>lt</string> <string>lv</string> <string>mk</string> <string>ml</string> <string>mn</string> <string>mo</string> <string>mr</string> <string>ms</string> <string>my</string> <string>nb</string> <string>ne</string> <string>nl</string> <string>no</string> <string>or</string> <string>pa</string> <string>pl</string> <string>pt_BR</string> <string>pt_PT</string> <string>pt</string> <string>ro</string> <string>ru</string> <string>si</string> <string>sk</string> <string>sl</string> <string>sq</string> <string>sr_Latn</string> <string>sr</string> <string>sv</string> <string>sw</string> <string>ta</string> <string>te</string> <string>th</string> <string>tl</string> <string>tr</string> <string>uk</string> <string>ur</string> <string>uz</string> <string>vi</string> <string>zh_CN</string> <string>zh_HK</string> <string>zh_TW</string> <string>zh</string> <string>zu</string> </array> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>$(FLUTTER_BUILD_NAME)</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>$(FLUTTER_BUILD_NUMBER)</string> <key>LSRequiresIPhoneOS</key> <true/> <key>UILaunchStoryboardName</key> <string>LaunchScreen</string> <key>UIMainStoryboardFile</key> <string>Main</string> <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> <key>UISupportedInterfaceOrientations~ipad</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> <key>UIViewControllerBasedStatusBarAppearance</key> <false/> <key>CADisableMinimumFrameDurationOnPhone</key> <true/> <key>UIApplicationSupportsIndirectInputEvents</key> <true/> </dict> </plist>
gallery/ios/Runner/Info.plist/0
{ "file_path": "gallery/ios/Runner/Info.plist", "repo_id": "gallery", "token_count": 2027 }
883
// 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 cupertinoContextMenuDemo class CupertinoContextMenuDemo extends StatelessWidget { const CupertinoContextMenuDemo({super.key}); @override Widget build(BuildContext context) { final galleryLocalizations = GalleryLocalizations.of(context)!; return CupertinoPageScaffold( navigationBar: CupertinoNavigationBar( automaticallyImplyLeading: false, middle: Text( galleryLocalizations.demoCupertinoContextMenuTitle, ), ), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Center( child: SizedBox( width: 100, height: 100, child: CupertinoContextMenu( actions: [ CupertinoContextMenuAction( onPressed: () { Navigator.pop(context); }, child: Text( galleryLocalizations.demoCupertinoContextMenuActionOne, ), ), CupertinoContextMenuAction( onPressed: () { Navigator.pop(context); }, child: Text( galleryLocalizations.demoCupertinoContextMenuActionTwo, ), ), ], child: const FlutterLogo(size: 250), ), ), ), const SizedBox(height: 20), Padding( padding: const EdgeInsets.all(30), child: Text( galleryLocalizations.demoCupertinoContextMenuActionText, textAlign: TextAlign.center, style: const TextStyle( color: Colors.black, ), ), ), ], ), ); } } // END
gallery/lib/demos/cupertino/cupertino_context_menu_demo.dart/0
{ "file_path": "gallery/lib/demos/cupertino/cupertino_context_menu_demo.dart", "repo_id": "gallery", "token_count": 1136 }
884
// 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/demos/material/material_demo_types.dart'; class BottomSheetDemo extends StatelessWidget { const BottomSheetDemo({ super.key, required this.type, }); final BottomSheetDemoType type; String _title(BuildContext context) { final localizations = GalleryLocalizations.of(context)!; switch (type) { case BottomSheetDemoType.persistent: return localizations.demoBottomSheetPersistentTitle; case BottomSheetDemoType.modal: return localizations.demoBottomSheetModalTitle; } } Widget _bottomSheetDemo(BuildContext context) { switch (type) { case BottomSheetDemoType.persistent: return _PersistentBottomSheetDemo(); case BottomSheetDemoType.modal: default: return _ModalBottomSheetDemo(); } } @override Widget build(BuildContext context) { // We wrap the demo in a [Navigator] to make sure that the modal bottom // sheets gets dismissed when changing demo. return Navigator( // Adding [ValueKey] to make sure that the widget gets rebuilt when // changing type. key: ValueKey(type), onGenerateRoute: (settings) { return MaterialPageRoute<void>( builder: (context) => Scaffold( appBar: AppBar( automaticallyImplyLeading: false, title: Text(_title(context)), ), floatingActionButton: FloatingActionButton( onPressed: () {}, backgroundColor: Theme.of(context).colorScheme.secondary, child: Icon( Icons.add, semanticLabel: GalleryLocalizations.of(context)!.demoBottomSheetAddLabel, ), ), body: _bottomSheetDemo(context), ), ); }, ); } } // BEGIN bottomSheetDemoModal#1 bottomSheetDemoPersistent#1 class _BottomSheetContent extends StatelessWidget { @override Widget build(BuildContext context) { final localizations = GalleryLocalizations.of(context)!; return SizedBox( height: 300, child: Column( children: [ SizedBox( height: 70, child: Center( child: Text( localizations.demoBottomSheetHeader, textAlign: TextAlign.center, ), ), ), const Divider(thickness: 1), Expanded( child: ListView.builder( itemCount: 21, itemBuilder: (context, index) { return ListTile( title: Text(localizations.demoBottomSheetItem(index)), ); }, ), ), ], ), ); } } // END bottomSheetDemoModal#1 bottomSheetDemoPersistent#1 // BEGIN bottomSheetDemoModal#2 class _ModalBottomSheetDemo extends StatelessWidget { void _showModalBottomSheet(BuildContext context) { showModalBottomSheet<void>( context: context, builder: (context) { return _BottomSheetContent(); }, ); } @override Widget build(BuildContext context) { return Center( child: ElevatedButton( onPressed: () { _showModalBottomSheet(context); }, child: Text(GalleryLocalizations.of(context)!.demoBottomSheetButtonText), ), ); } } // END // BEGIN bottomSheetDemoPersistent#2 class _PersistentBottomSheetDemo extends StatefulWidget { @override _PersistentBottomSheetDemoState createState() => _PersistentBottomSheetDemoState(); } class _PersistentBottomSheetDemoState extends State<_PersistentBottomSheetDemo> { VoidCallback? _showBottomSheetCallback; @override void initState() { super.initState(); _showBottomSheetCallback = _showPersistentBottomSheet; } void _showPersistentBottomSheet() { setState(() { // Disable the show bottom sheet button. _showBottomSheetCallback = null; }); Scaffold.of(context) .showBottomSheet( (context) { return _BottomSheetContent(); }, elevation: 25, ) .closed .whenComplete(() { if (mounted) { setState(() { // Re-enable the bottom sheet button. _showBottomSheetCallback = _showPersistentBottomSheet; }); } }); } @override Widget build(BuildContext context) { return Center( child: ElevatedButton( onPressed: _showBottomSheetCallback, child: Text(GalleryLocalizations.of(context)!.demoBottomSheetButtonText), ), ); } } // END
gallery/lib/demos/material/bottom_sheet_demo.dart/0
{ "file_path": "gallery/lib/demos/material/bottom_sheet_demo.dart", "repo_id": "gallery", "token_count": 2195 }
885
// 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/demos/material/material_demo_types.dart'; class SelectionControlsDemo extends StatelessWidget { const SelectionControlsDemo({super.key, required this.type}); final SelectionControlsDemoType type; String _title(BuildContext context) { switch (type) { case SelectionControlsDemoType.checkbox: return GalleryLocalizations.of(context)! .demoSelectionControlsCheckboxTitle; case SelectionControlsDemoType.radio: return GalleryLocalizations.of(context)! .demoSelectionControlsRadioTitle; case SelectionControlsDemoType.switches: return GalleryLocalizations.of(context)! .demoSelectionControlsSwitchTitle; } } @override Widget build(BuildContext context) { Widget? controls; switch (type) { case SelectionControlsDemoType.checkbox: controls = _CheckboxDemo(); break; case SelectionControlsDemoType.radio: controls = _RadioDemo(); break; case SelectionControlsDemoType.switches: controls = _SwitchDemo(); break; } return Scaffold( appBar: AppBar( automaticallyImplyLeading: false, title: Text(_title(context)), ), body: controls, ); } } // BEGIN selectionControlsDemoCheckbox class _CheckboxDemo extends StatefulWidget { @override _CheckboxDemoState createState() => _CheckboxDemoState(); } class _CheckboxDemoState extends State<_CheckboxDemo> with RestorationMixin { RestorableBoolN checkboxValueA = RestorableBoolN(true); RestorableBoolN checkboxValueB = RestorableBoolN(false); RestorableBoolN checkboxValueC = RestorableBoolN(null); @override String get restorationId => 'checkbox_demo'; @override void restoreState(RestorationBucket? oldBucket, bool initialRestore) { registerForRestoration(checkboxValueA, 'checkbox_a'); registerForRestoration(checkboxValueB, 'checkbox_b'); registerForRestoration(checkboxValueC, 'checkbox_c'); } @override void dispose() { checkboxValueA.dispose(); checkboxValueB.dispose(); checkboxValueC.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Checkbox( value: checkboxValueA.value, onChanged: (value) { setState(() { checkboxValueA.value = value; }); }, ), Checkbox( value: checkboxValueB.value, onChanged: (value) { setState(() { checkboxValueB.value = value; }); }, ), Checkbox( value: checkboxValueC.value, tristate: true, onChanged: (value) { setState(() { checkboxValueC.value = value; }); }, ), ], ), // Disabled checkboxes Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Checkbox( value: checkboxValueA.value, onChanged: null, ), Checkbox( value: checkboxValueB.value, onChanged: null, ), Checkbox( value: checkboxValueC.value, tristate: true, onChanged: null, ), ], ), ], ); } } // END // BEGIN selectionControlsDemoRadio class _RadioDemo extends StatefulWidget { @override _RadioDemoState createState() => _RadioDemoState(); } class _RadioDemoState extends State<_RadioDemo> with RestorationMixin { final RestorableInt radioValue = RestorableInt(0); @override String get restorationId => 'radio_demo'; @override void restoreState(RestorationBucket? oldBucket, bool initialRestore) { registerForRestoration(radioValue, 'radio_value'); } void handleRadioValueChanged(int? value) { setState(() { radioValue.value = value!; }); } @override void dispose() { radioValue.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( mainAxisAlignment: MainAxisAlignment.center, children: [ for (int index = 0; index < 2; ++index) Radio<int>( value: index, groupValue: radioValue.value, onChanged: handleRadioValueChanged, ), ], ), // Disabled radio buttons Row( mainAxisAlignment: MainAxisAlignment.center, children: [ for (int index = 0; index < 2; ++index) Radio<int>( value: index, groupValue: radioValue.value, onChanged: null, ), ], ), ], ); } } // END // BEGIN selectionControlsDemoSwitches class _SwitchDemo extends StatefulWidget { @override _SwitchDemoState createState() => _SwitchDemoState(); } class _SwitchDemoState extends State<_SwitchDemo> with RestorationMixin { RestorableBool switchValueA = RestorableBool(true); RestorableBool switchValueB = RestorableBool(false); @override String get restorationId => 'switch_demo'; @override void restoreState(RestorationBucket? oldBucket, bool initialRestore) { registerForRestoration(switchValueA, 'switch_value1'); registerForRestoration(switchValueB, 'switch_value2'); } @override void dispose() { switchValueA.dispose(); switchValueB.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Switch( value: switchValueA.value, onChanged: (value) { setState(() { switchValueA.value = value; }); }, ), Switch( value: switchValueB.value, onChanged: (value) { setState(() { switchValueB.value = value; }); }, ), ], ), // Disabled switches Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Switch( value: switchValueA.value, onChanged: null, ), Switch( value: switchValueB.value, onChanged: null, ), ], ), ], ); } } // END
gallery/lib/demos/material/selection_controls_demo.dart/0
{ "file_path": "gallery/lib/demos/material/selection_controls_demo.dart", "repo_id": "gallery", "token_count": 3389 }
886
// 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:gallery/themes/gallery_theme_data.dart'; import 'transformations_demo_board.dart'; import 'transformations_demo_color_picker.dart'; const backgroundColor = Color(0xFF272727); // The panel for editing a board point. @immutable class EditBoardPoint extends StatelessWidget { const EditBoardPoint({ super.key, required this.boardPoint, this.onColorSelection, }); final BoardPoint boardPoint; final ValueChanged<Color>? onColorSelection; @override Widget build(BuildContext context) { final boardPointColors = <Color>{ Colors.white, GalleryThemeData.darkColorScheme.primary, GalleryThemeData.darkColorScheme.primaryContainer, GalleryThemeData.darkColorScheme.secondary, backgroundColor, }; return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Text( '${boardPoint.q}, ${boardPoint.r}', textAlign: TextAlign.right, style: const TextStyle(fontWeight: FontWeight.bold), ), ColorPicker( colors: boardPointColors, selectedColor: boardPoint.color, onColorSelection: onColorSelection, ), ], ); } }
gallery/lib/demos/reference/transformations_demo_edit_board_point.dart/0
{ "file_path": "gallery/lib/demos/reference/transformations_demo_edit_board_point.dart", "repo_id": "gallery", "token_count": 529 }
887
{ "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": "Каб адкрыць кантэкстнае меню, націсніце і ўтрымлівайце лагатып Flutter.", "demoCupertinoContextMenuDescription": "Поўнаэкраннае кантэкстнае меню ў стылі iOS, якое паказваецца пры доўгім націсканні на элемент.", "demoAppBarTitle": "Панэль праграм", "demoAppBarDescription": "Панэль праграм прапануе змесціва і дзеянні, звязаныя з бягучым экранам. Яна выкарыстоўваецца для брэндынгу, назваў экранаў, навігацыі і дзеянняў", "demoDividerTitle": "Раздзяляльнік", "demoDividerSubtitle": "Раздзяляльнік – гэта тонкая лінія, якая раздзяляе групы змесціва ў спісах і макетах.", "demoDividerDescription": "Раздзяляльнікі можна выкарыстоўваць у спісах, высоўных меню і іншых месцах для раздзялення змесціва.", "demoVerticalDividerTitle": "Вертыкальны раздзяляльнік", "demoCupertinoContextMenuTitle": "Кантэкстнае меню", "demoCupertinoContextMenuSubtitle": "Кантэкстнае меню ў стылі iOS", "demoAppBarSubtitle": "Паказвае інфармацыю і дзеянні, звязаныя з бягучым экранам", "demoCupertinoContextMenuActionOne": "Першае дзеянне", "demoCupertinoContextMenuActionTwo": "Другое дзеянне", "demoDateRangePickerDescription": "Дыялогавае акно ў Матэрыяльным дызайне, у якім можна выбраць дыяпазон дат.", "demoDateRangePickerTitle": "Сродак выбару дыяпазону дат", "demoNavigationDrawerUserName": "Імя карыстальніка", "demoNavigationDrawerUserEmail": "[email protected]", "demoNavigationDrawerText": "Каб пабачыць высоўнае меню, правядзіце пальцам ад краю ці дакраніцеся да верхняга левага значка", "demoNavigationRailTitle": "Планка навігацыі", "demoNavigationRailSubtitle": "Паказ планкі навігацыі ў праграме", "demoNavigationRailDescription": "Матэрыяльны віджэт, які паказваецца з левага ці правага боку на экране праграмы і прызначаны для навігацыі паміж невялікай колькасцю старонак (звычайна 3-5).", "demoNavigationRailFirst": "Першая", "demoNavigationDrawerTitle": "Высоўнае меню навігацыі", "demoNavigationRailThird": "Трэцяя", "replyStarredLabel": "Пазначаныя", "demoTextButtonDescription": "Пры націсканні тэкставай кнопкі паказваецца эфект чарніла, і кнопка не падымаецца ўверх. Выкарыстоўвайце тэкставыя кнопкі на панэлі інструментаў, у дыялогавых вокнах і ў тэксце з палямі", "demoElevatedButtonTitle": "Прыпаднятая кнопка", "demoElevatedButtonDescription": "Прыпаднятыя кнопкі надаюць аб'ёмнасць пераважна плоскім макетам. Яны паказваюць функцыі ў занятых або шырокіх абласцях.", "demoOutlinedButtonTitle": "Кнопка з контурам", "demoOutlinedButtonDescription": "Кнопкі з контурамі цямнеюць і падымаюцца ўгору пры націсканні. Яны часта спалучаюцца з выпуклымі кнопкамі для вызначэння альтэрнатыўнага, другаснага дзеяння.", "demoContainerTransformDemoInstructions": "Карткі, спісы і рухомая кнопка дзеяння", "demoNavigationDrawerSubtitle": "Паказ высоўнага меню на панэлі праграм", "replyDescription": "Эфектыўная спецыялізаваная праграма электроннай пошты", "demoNavigationDrawerDescription": "Панэль \"Матэрыяльны дызайн\" высоўваецца па гарызанталі з краю экрана і змяшчае спасылкі для навігацыі па праграме.", "replyDraftsLabel": "Чарнавікі", "demoNavigationDrawerToPageOne": "Першы элемент", "replyInboxLabel": "Уваходныя", "demoSharedXAxisDemoInstructions": "Кнопкі \"Далей\" і \"Назад\"", "replySpamLabel": "Спам", "replyTrashLabel": "Сметніца", "replySentLabel": "Адпраўленыя", "demoNavigationRailSecond": "Другая", "demoNavigationDrawerToPageTwo": "Другі элемент", "demoFadeScaleDemoInstructions": "Мадальная кнопка і рухомая кнопка дзеяння", "demoFadeThroughDemoInstructions": "Навігацыя ўнізе экрана", "demoSharedZAxisDemoInstructions": "Кнопка са значком налад", "demoSharedYAxisDemoInstructions": "Парадак сартавання: \"Нядаўна прайгравалася\"", "demoTextButtonTitle": "Тэкставая кнопка", "demoSharedZAxisBeefSandwichRecipeTitle": "Сандвіч з ялавічынай", "demoSharedZAxisDessertRecipeDescription": "Рэцэпт дэсерта", "demoSharedYAxisAlbumTileSubtitle": "Выканаўца", "demoSharedYAxisAlbumTileTitle": "Альбом", "demoSharedYAxisRecentSortTitle": "Нядаўна прайгравалася", "demoSharedYAxisAlphabeticalSortTitle": "А-Я", "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": "Шаблон затухання выкарыстоўваецца для элементаў карыстальніцкага інтэрфейсу, якія з'яўляюцца ці знікаюць у межах экрана, напрыклад для дыялогавага акна, якое затухае ў цэнтры экрана.", "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": "Рэпазітар GitHub {repoName}", "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": "Акцыі", "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": "Дыялогавае акно ў Material Design, у якім можна выбраць час.", "demoPickersShowPicker": "ПАКАЗАЦЬ ІНСТРУМЕНТ ВЫБАРУ", "demoTabsScrollingTitle": "Прагортка", "demoTabsNonScrollingTitle": "Без прагорткі", "craneHours": "{hours,plural,=1{1 гадз}few{{hours} гадз}many{{hours} гадз}other{{hours} гадз}}", "craneMinutes": "{minutes,plural,=1{1 хв}few{{minutes} хв}many{{minutes} хв}other{{minutes} хв}}", "craneFlightDuration": "{hoursShortForm} {minutesShortForm}", "dataTableHeader": "Харчаванне", "demoDatePickerTitle": "Інструмент выбару даты", "demoPickersSubtitle": "Выбар даты і часу", "demoPickersTitle": "Інструменты выбару", "demo2dTransformationsEditTooltip": "Змяніць плітку", "demoDataTableDescription": "Табліцы з данымі паказваюць інфармацыю ў выглядзе сеткі з радкамі і слупкамі. У іх інфармацыя ўпарадкавана так, каб яе было лёгка знайсці і параўнаць.", "demo2dTransformationsDescription": "Націсніце, каб змяніць пліткі, і выкарыстоўвайце жэсты, каб перамяшчацца па паверхні. Перацягніце, каб зрушыць, зводзьце і разводзьце пальцы для змянення маштабу, паварочвайце двума пальцамі. Націсніце кнопку скіду, каб вярнуцца да першапачатковага становішча.", "demo2dTransformationsSubtitle": "Зрушыць, змяніць маштаб, павярнуць", "demo2dTransformationsTitle": "Двухмерныя пераўтварэнні", "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": "Бялкі (г)", "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": "Кругавы індыкатар выканання Material Design, які круціцца, калі праграма занятая.", "demoMenuFour": "Чатыры", "demoLinearProgressIndicatorDescription": "Лінейны індыкатар прагрэсу Material Design, таксама вядомы як індыкатар выканання.", "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": "Чат", "cupertinoTabBarHomeTab": "Галоўная", "demoCupertinoTabBarDescription": "Ніжняя навігацыйная панэль укладак у стылі iOS. Змяшчае некалькі ўкладак, адна з якіх актыўная (стандартна – першая).", "demoCupertinoTabBarSubtitle": "Ніжняя панэль укладак у стылі iOS", "demoOptionsFeatureTitle": "Праглядзець варыянты", "demoOptionsFeatureDescription": "Націсніце тут, каб праглядзець даступныя варыянты для гэтай дэманстрацыі.", "demoCodeViewerCopyAll": "КАПІРАВАЦЬ УСЁ", "shrineScreenReaderRemoveProductButton": "Выдаліць прадукт: {product}", "shrineScreenReaderProductAddToCart": "Дадаць у кошык", "shrineScreenReaderCart": "{quantity,plural,=0{Кошык, няма прадуктаў}=1{Кошык, 1 прадукт}few{Кошык, {quantity} прадукты}many{Кошык, {quantity} прадуктаў}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": "Палі для птушак дазваляюць карыстальніку выбраць з набору некалькі параметраў. Звычайнае значэнне ў полі для птушак – гэта \"true\" або \"false\", а значэнне поля для птушак з трыма станамі можа быць роўным нулю.", "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": "Пошук", "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 непрызначанай трансакцыі.}few{Павялічце свой патэнцыяльны падатковы вылік! Прызначце катэгорыі для {count} непрызначаных трансакцый.}many{Павялічце свой патэнцыяльны падатковы вылік! Прызначце катэгорыі для {count} непрызначаных трансакцый.}other{Павялічце свой патэнцыяльны падатковы вылік! Прызначце катэгорыі для {count} непрызначаных трансакцый.}}", "craneFormTime": "Выберыце час", "craneFormLocation": "Выберыце месца", "craneFormTravelers": "Падарожнікі", "craneEat8": "Атланта, ЗША", "craneFormDestination": "Выберыце пункт прызначэння", "craneFormDates": "Выберыце даты", "craneFly": "РЭЙС", "craneSleep": "НАЧЛЕГ", "craneEat": "ЕЖА", "craneFlySubhead": "Агляд рэйсаў у пункт прызначэння", "craneSleepSubhead": "Агляд месцаў для пражывання ў пункце прызначэння", "craneEatSubhead": "Агляд рэстаранаў у пункце прызначэння", "craneFlyStops": "{numberOfStops,plural,=0{Без перасадак}=1{1 перасадка}few{{numberOfStops} перасадкі}many{{numberOfStops} перасадак}other{{numberOfStops} перасадкі}}", "craneSleepProperties": "{totalProperties,plural,=0{Няма даступных месцаў для пражывання}=1{Даступна 1 месца для пражывання}few{Даступна {totalProperties} месцы для пражывання}many{Даступна {totalProperties} месцаў для пражывання}other{Даступна {totalProperties} месца для пражывання}}", "craneEatRestaurants": "{totalRestaurants,plural,=0{Няма рэстаранаў}=1{1 рэстаран}few{{totalRestaurants} рэстараны}many{{totalRestaurants} рэстаранаў}other{{totalRestaurants} рэстарана}}", "craneFly0": "Аспен, ЗША", "demoCupertinoSegmentedControlSubtitle": "Сегментаваныя элементы кіравання ў стылі iOS", "craneSleep10": "Каір, Егіпет", "craneEat9": "Мадрыд, Іспанія", "craneFly1": "Біг-Сур, ЗША", "craneEat7": "Нашвіл, ЗША", "craneEat6": "Сіэтл, ЗША", "craneFly8": "Сінгапур", "craneEat4": "Парыж, Францыя", "craneEat3": "Портланд, ЗША", "craneEat2": "Кордава, Аргенціна", "craneEat1": "Далас, ЗША", "craneEat0": "Неапаль, Італія", "craneSleep11": "Тайбэй, Тайвань", "craneSleep3": "Гавана, Куба", "shrineLogoutButtonCaption": "ВЫЙСЦІ", "rallyTitleBills": "РАХУНКІ", "rallyTitleAccounts": "УЛІКОВЫЯ ЗАПІСЫ", "shrineProductVagabondSack": "Сумка-ранец", "rallyAccountDetailDataInterestYtd": "Працэнты ад пачатку года да сённяшняга дня", "shrineProductWhitneyBelt": "Скураны рамень", "shrineProductGardenStrand": "Кветачныя пацеркі", "shrineProductStrutEarrings": "Завушніцы \"цвікі\"", "shrineProductVarsitySocks": "Спартыўныя шкарпэткі", "shrineProductWeaveKeyring": "Плеценая бірулька", "shrineProductGatsbyHat": "Картуз", "shrineProductShrugBag": "Сумка балеро", "shrineProductGiltDeskTrio": "Трайны стол", "shrineProductCopperWireRack": "Драцяная стойка", "shrineProductSootheCeramicSet": "Набор керамічнага посуду", "shrineProductHurrahsTeaSet": "Чайны набор", "shrineProductBlueStoneMug": "Сіні кубак", "shrineProductRainwaterTray": "Латок для дажджавой вады", "shrineProductChambrayNapkins": "Ільняныя сурвэткі", "shrineProductSucculentPlanters": "Вазоны для сукулентаў", "shrineProductQuartetTable": "Квадратны стол", "shrineProductKitchenQuattro": "Кухонны набор", "shrineProductClaySweater": "Бэжавы світар", "shrineProductSeaTunic": "Пляжная туніка", "shrineProductPlasterTunic": "Крэмавая туніка", "rallyBudgetCategoryRestaurants": "Рэстараны", "shrineProductChambrayShirt": "Ільняная клятчастая кашуля", "shrineProductSeabreezeSweater": "Джэмпер", "shrineProductGentryJacket": "Куртка ў стылі джэнтры", "shrineProductNavyTrousers": "Цёмна-сінія штаны", "shrineProductWalterHenleyWhite": "Лёгкая кофта (белая)", "shrineProductSurfAndPerfShirt": "Бірузовая футболка", "shrineProductGingerScarf": "Рыжы шаль", "shrineProductRamonaCrossover": "Жаноцкая блузка з захватам", "shrineProductClassicWhiteCollar": "Класічная белая блузка", "shrineProductSunshirtDress": "Летняя сукенка", "rallyAccountDetailDataInterestRate": "Працэнтная стаўка", "rallyAccountDetailDataAnnualPercentageYield": "Гадавая працэнтная даходнасць", "rallyAccountDataVacation": "Адпачынак", "shrineProductFineLinesTee": "Кофта ў палоску", "rallyAccountDataHomeSavings": "Зберажэнні для дома", "rallyAccountDataChecking": "Разліковы", "rallyAccountDetailDataInterestPaidLastYear": "Працэнты, выплачаныя ў мінулым годзе", "rallyAccountDetailDataNextStatement": "Наступная выпіска з банкаўскага рахунку", "rallyAccountDetailDataAccountOwner": "Уладальнік уліковага запісу", "rallyBudgetCategoryCoffeeShops": "Кавярні", "rallyBudgetCategoryGroceries": "Прадуктовыя тавары", "shrineProductCeriseScallopTee": "Светла-вішнёвая футболка", "rallyBudgetCategoryClothing": "Адзенне", "rallySettingsManageAccounts": "Кіраваць уліковымі запісамі", "rallyAccountDataCarSavings": "Зберажэнні на аўтамабіль", "rallySettingsTaxDocuments": "Падатковыя дакументы", "rallySettingsPasscodeAndTouchId": "Пароль і Touch ID", "rallySettingsNotifications": "Апавяшчэнні", "rallySettingsPersonalInformation": "Асабістая інфармацыя", "rallySettingsPaperlessSettings": "Віртуальныя налады", "rallySettingsFindAtms": "Знайсці банкаматы", "rallySettingsHelp": "Даведка", "rallySettingsSignOut": "Выйсці", "rallyAccountTotal": "Усяго", "rallyBillsDue": "Тэрмін пагашэння", "rallyBudgetLeft": "Засталося", "rallyAccounts": "Уліковыя запісы", "rallyBills": "Рахункі", "rallyBudgets": "Бюджэты", "rallyAlerts": "Абвесткі", "rallySeeAll": "ПРАГЛЕДЗЕЦЬ УСЁ", "rallyFinanceLeft": "ЗАСТАЛОСЯ", "rallyTitleOverview": "АГЛЯД", "shrineProductShoulderRollsTee": "Футболка са свабодным рукавом", "shrineNextButtonCaption": "ДАЛЕЙ", "rallyTitleBudgets": "БЮДЖЭТЫ", "rallyTitleSettings": "НАЛАДЫ", "rallyLoginLoginToRally": "Уваход у Rally", "rallyLoginNoAccount": "Няма ўліковага запісу?", "rallyLoginSignUp": "ЗАРЭГІСТРАВАЦЦА", "rallyLoginUsername": "Імя карыстальніка", "rallyLoginPassword": "Пароль", "rallyLoginLabelLogin": "Увайсці", "rallyLoginRememberMe": "Запомніць мяне", "rallyLoginButtonLogin": "УВАЙСЦІ", "rallyAlertsMessageHeadsUpShopping": "Увага! Вы зрасходавалі {percent} свайго месячнага бюджэту на пакупкі.", "rallyAlertsMessageSpentOnRestaurants": "На гэтым тыдні вы выдаткавалі {amount} на рэстараны.", "rallyAlertsMessageATMFees": "У гэтым месяцы вы патрацілі {amount} на аплату камісіі ў банкаматах", "rallyAlertsMessageCheckingAccount": "Выдатна! У гэтым месяцы на вашым разліковым рахунку засталося на {percent} больш сродкаў, чым у мінулым.", "shrineMenuCaption": "МЕНЮ", "shrineCategoryNameAll": "УСЕ", "shrineCategoryNameAccessories": "АКСЕСУАРЫ", "shrineCategoryNameClothing": "АДЗЕННЕ", "shrineCategoryNameHome": "ДОМ", "shrineLoginUsernameLabel": "Імя карыстальніка", "shrineLoginPasswordLabel": "Пароль", "shrineCancelButtonCaption": "СКАСАВАЦЬ", "shrineCartTaxCaption": "Падатак:", "shrineCartPageCaption": "КОШЫК", "shrineProductQuantity": "Колькасць: {quantity}", "shrineProductPrice": "x {price}", "shrineCartItemCount": "{quantity,plural,=0{НЯМА ЭЛЕМЕНТАЎ}=1{1 ЭЛЕМЕНТ}few{{quantity} ЭЛЕМЕНТЫ}many{{quantity} ЭЛЕМЕНТАЎ}other{{quantity} ЭЛЕМЕНТА}}", "shrineCartClearButtonCaption": "АЧЫСЦІЦЬ КОШЫК", "shrineCartTotalCaption": "УСЯГО", "shrineCartSubtotalCaption": "Прамежкавы вынік:", "shrineCartShippingCaption": "Дастаўка:", "shrineProductGreySlouchTank": "Шэрая майка", "shrineProductStellaSunglasses": "Сонцаахоўныя акуляры Stella", "shrineProductWhitePinstripeShirt": "Кашуля ў белую палоску", "demoTextFieldWhereCanWeReachYou": "Па якім нумары з вамі можна звязацца?", "settingsTextDirectionLTR": "Злева направа", "settingsTextScalingLarge": "Вялікі", "demoBottomSheetHeader": "Загаловак", "demoBottomSheetItem": "Элемент {value}", "demoBottomTextFieldsTitle": "Тэкставыя палі", "demoTextFieldTitle": "Тэкставыя палі", "demoTextFieldSubtitle": "Адзін радок тэксту і лічбаў, якія можна змяніць", "demoTextFieldDescription": "Тэкставыя палі дазваляюць карыстальнікам уводзіць тэкст у карыстальніцкі інтэрфейс. Звычайна яны паяўляюцца ў формах і дыялогавых вокнах.", "demoTextFieldShowPasswordLabel": "Паказаць пароль", "demoTextFieldHidePasswordLabel": "Схаваць пароль", "demoTextFieldFormErrors": "Перад адпраўкай выправіце памылкі, пазначаныя чырвоным колерам.", "demoTextFieldNameRequired": "Увядзіце назву.", "demoTextFieldOnlyAlphabeticalChars": "Уводзьце толькі літары.", "demoTextFieldEnterUSPhoneNumber": "Увядзіце нумар тэлефона ў ЗША ў наступным фармаце: (###) ###-####.", "demoTextFieldEnterPassword": "Увядзіце пароль.", "demoTextFieldPasswordsDoNotMatch": "Паролі не супадаюць", "demoTextFieldWhatDoPeopleCallYou": "Як вас завуць?", "demoTextFieldNameField": "Імя*", "demoBottomSheetButtonText": "ПАКАЗАЦЬ НІЖНІ АРКУШ", "demoTextFieldPhoneNumber": "Нумар тэлефона*", "demoBottomSheetTitle": "Ніжні аркуш", "demoTextFieldEmail": "Адрас электроннай пошты", "demoTextFieldTellUsAboutYourself": "Паведаміце нам пра сябе (напрыклад, напішыце, чым вы захапляецеся)", "demoTextFieldKeepItShort": "Не пішыце многа – біяграфія павінна быць сціслай.", "starterAppGenericButton": "КНОПКА", "demoTextFieldLifeStory": "Біяграфія", "demoTextFieldSalary": "Зарплата", "demoTextFieldUSD": "Долар ЗША", "demoTextFieldNoMoreThan": "Не больш за 8 сімвалаў.", "demoTextFieldPassword": "Пароль*", "demoTextFieldRetypePassword": "Увядзіце пароль яшчэ раз*", "demoTextFieldSubmit": "АДПРАВІЦЬ", "demoBottomNavigationSubtitle": "Ніжняя панэль навігацыі з плаўным пераходам", "demoBottomSheetAddLabel": "Дадаць", "demoBottomSheetModalDescription": "Мадальны ніжні аркуш можна выкарыстоўваць замест меню ці дыялогавага акна. Дзякуючы яму карыстальнік можа не ўзаемадзейнічаць з астатнімі раздзеламі праграмы.", "demoBottomSheetModalTitle": "Мадальны ніжні аркуш", "demoBottomSheetPersistentDescription": "Пастаянны ніжні аркуш паказвае дадатковую інфармацыю да асноўнага змесціва праграмы. Ён заўсёды застаецца бачным, нават калі карыстальнік узаемадзейнічае з іншымі раздзеламі праграмы.", "demoBottomSheetPersistentTitle": "Пастаянны ніжні аркуш", "demoBottomSheetSubtitle": "Пастаянныя і мадальныя ніжнія аркушы", "demoTextFieldNameHasPhoneNumber": "Нумар тэлефона карыстальніка {name}: {phoneNumber}", "buttonText": "КНОПКА", "demoTypographyDescription": "Азначэнні для розных друкарскіх стыляў з каталога матэрыяльнага дызайну.", "demoTypographySubtitle": "Усе стандартныя стылі тэксту", "demoTypographyTitle": "Афармленне тэксту", "demoFullscreenDialogDescription": "Уласцівасць поўнаэкраннасці вызначае, ці будзе ўваходная старонка выглядаць як мадальнае дыялогавае акно ў поўнаэкранным рэжыме", "demoFlatButtonDescription": "Пры націсканні плоскай кнопкі паказваецца эфект чарніла, і кнопка не падымаецца ўверх. Выкарыстоўвайце плоскія кнопкі на панэлі інструментаў, у дыялогавых вокнах і ў тэксце з палямі", "demoBottomNavigationDescription": "На панэлях навігацыі ў ніжняй частцы экрана могуць змяшчацца ад трох да пяці элементаў. Кожны з іх мае значок і (неабавязкова) тэкставую метку. Націснуўшы значок на ніжняй панэлі, карыстальнік пяройдзе на элемент вышэйшага ўзроўню навігацыі, звязаны з гэтым значком.", "demoBottomNavigationSelectedLabel": "Выбраная метка", "demoBottomNavigationPersistentLabels": "Пастаянныя меткі", "starterAppDrawerItem": "Элемент {value}", "demoTextFieldRequiredField": "* абавязковае поле", "demoBottomNavigationTitle": "Навігацыя ўнізе экрана", "settingsLightTheme": "Светлая", "settingsTheme": "Тэма", "settingsPlatformIOS": "iOS", "settingsPlatformAndroid": "Android", "settingsTextDirectionRTL": "Справа налева", "settingsTextScalingHuge": "Вялізны", "cupertinoButton": "Кнопка", "settingsTextScalingNormal": "Звычайны", "settingsTextScalingSmall": "Дробны", "settingsSystemDefault": "Сістэма", "settingsTitle": "Налады", "rallyDescription": "Праграма для кіравання асабістымі фінансамі", "aboutDialogDescription": "Каб праглядзець зыходны код гэтай праграмы, акрыйце старонку {repoLink}.", "bottomNavigationCommentsTab": "Каментарыі", "starterAppGenericBody": "Асноўны тэкст", "starterAppGenericHeadline": "Загаловак", "starterAppGenericSubtitle": "Падзагаловак", "starterAppGenericTitle": "Назва", "starterAppTooltipSearch": "Пошук", "starterAppTooltipShare": "Абагуліць", "starterAppTooltipFavorite": "Абранае", "starterAppTooltipAdd": "Дадаць", "bottomNavigationCalendarTab": "Каляндар", "starterAppDescription": "Адаптыўны макет запуску", "starterAppTitle": "Праграма запуску", "aboutFlutterSamplesRepo": "Узоры Flutter са сховішча GitHub", "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": "Дазволіць \"Картам\" мець доступ да звестак пра ваша месцазнаходжанне падчас выкарыстання праграмы?", "cupertinoAlertLocationDescription": "Ваша месцазнаходжанне будзе паказвацца на карце і выкарыстоўвацца для пракладкі маршрутаў, пошуку месцаў паблізу і вызначэння прыкладнага часу паездак.", "cupertinoAlertAllow": "Дазволіць", "cupertinoAlertDontAllow": "Не дазваляць", "cupertinoAlertFavoriteDessert": "Выберыце ўлюбёны дэсерт", "cupertinoAlertDessertDescription": "Выберыце ўлюбёны тып дэсерту са спіса ўнізе. З улікам выбранага вамі варыянта будзе складацца спіс месцаў паблізу, дзе гатуюць падобныя ласункі.", "cupertinoAlertCheesecake": "Чызкейк", "cupertinoAlertTiramisu": "Тырамісу", "cupertinoAlertApplePie": "Apple Pie", "cupertinoAlertChocolateBrownie": "Шакаладны браўні", "cupertinoShowAlert": "Паказаць абвестку", "colorsRed": "ЧЫРВОНЫ", "colorsPink": "РУЖОВЫ", "colorsPurple": "ФІЯЛЕТАВЫ", "colorsDeepPurple": "ЦЁМНА-ФІЯЛЕТАВЫ", "colorsIndigo": "ІНДЫГА", "colorsBlue": "СІНІ", "colorsLightBlue": "СВЕТЛА-СІНІ", "colorsCyan": "БЛАКІТНЫ", "dialogAddAccount": "Дадаць уліковы запіс", "Gallery": "Галерэя", "Categories": "Катэгорыі", "SHRINE": "SHRINE", "Basic shopping app": "Асноўная праграма для купляў", "RALLY": "RALLY", "CRANE": "CRANE", "Travel app": "Праграма для падарожжаў", "MATERIAL": "МАТЭРЫЯЛ", "CUPERTINO": "CUPERTINO", "REFERENCE STYLES & MEDIA": "АПОРНЫЯ СТЫЛІ І МУЛЬТЫМЕДЫЯ" }
gallery/lib/l10n/intl_be.arb/0
{ "file_path": "gallery/lib/l10n/intl_be.arb", "repo_id": "gallery", "token_count": 40150 }
888
{ "loading": "Chargement…", "deselect": "Désélectionner", "select": "Sélectionner", "selectable": "Sélectionnable (appui de manière prolongée)", "selected": "Sélectionné", "demo": "Version de démonstration", "bottomAppBar": "Barre d'application inférieure", "notSelected": "Non sélectionné", "demoCupertinoSearchTextFieldTitle": "Champ de recherche de texte", "demoCupertinoPicker": "Sélecteur", "demoCupertinoSearchTextFieldSubtitle": "Champ de recherche de texte de style iOS", "demoCupertinoSearchTextFieldDescription": "Champ de recherche de texte qui permet à l'utilisateur de saisir le texte à rechercher, et qui peut proposer et filtrer des suggestions.", "demoCupertinoSearchTextFieldPlaceholder": "Saisissez du texte", "demoCupertinoScrollbarTitle": "Barre de défilement", "demoCupertinoScrollbarSubtitle": "Barre de défilement de style iOS", "demoCupertinoScrollbarDescription": "Barre de défilement qui encapsule l'enfant donné", "demoTwoPaneItem": "Élément {value}", "demoTwoPaneList": "Liste", "demoTwoPaneFoldableLabel": "Pliable", "demoTwoPaneSmallScreenLabel": "Petit écran", "demoTwoPaneSmallScreenDescription": "Comportement de TwoPane sur un appareil avec petit écran.", "demoTwoPaneTabletLabel": "Tablette/Ordinateur de bureau", "demoTwoPaneTabletDescription": "Comportement de TwoPane sur un appareil avec grand écran, comme une tablette ou un ordinateur de bureau.", "demoTwoPaneTitle": "TwoPane", "demoTwoPaneSubtitle": "Mises en page responsives sur les écrans pliables, petits et grands", "splashSelectDemo": "Sélectionner une démo", "demoTwoPaneFoldableDescription": "Comportement de TwoPane sur un appareil pliable.", "demoTwoPaneDetails": "Détails", "demoTwoPaneSelectItem": "Sélectionner un élément", "demoTwoPaneItemDetails": "Détails de l'élément {value}", "demoCupertinoContextMenuActionText": "Appuyez de manière prolongée sur le logo Flutter pour afficher le menu contextuel.", "demoCupertinoContextMenuDescription": "Menu contextuel plein écran de style iOS qui s'affiche lorsque vous appuyez de manière prolongée sur un élément.", "demoAppBarTitle": "Barre d'appli", "demoAppBarDescription": "La barre d'appli fournit des contenus et des actions liés à l'écran actuel. Elle est utilisée pour les marques, les titres d'écran, la navigation et les actions.", "demoDividerTitle": "Séparateur", "demoDividerSubtitle": "Un séparateur est une ligne fine qui regroupe des contenus en listes et dispositions.", "demoDividerDescription": "Les séparateurs permettent de séparer des contenus dans des listes, panneaux, etc.", "demoVerticalDividerTitle": "Séparateur vertical", "demoCupertinoContextMenuTitle": "Menu contextuel", "demoCupertinoContextMenuSubtitle": "Menu contextuel de style iOS", "demoAppBarSubtitle": "Affiche des informations et des actions liées à l'écran actuel", "demoCupertinoContextMenuActionOne": "Action un", "demoCupertinoContextMenuActionTwo": "Action deux", "demoDateRangePickerDescription": "Affiche une boîte de dialogue comportant un sélecteur de plage de dates Material Design.", "demoDateRangePickerTitle": "Outil de sélection de la plage de dates", "demoNavigationDrawerUserName": "Nom de l’utilisateur", "demoNavigationDrawerUserEmail": "[email protected]", "demoNavigationDrawerText": "Balayez l'écran depuis le bord ou appuyez sur l'icône située en haut à gauche pour afficher le panneau", "demoNavigationRailTitle": "Rail de navigation", "demoNavigationRailSubtitle": "Affichage d'un rail de navigation dans une application", "demoNavigationRailDescription": "Widget Material qui doit être affiché sur la gauche ou la droite d'une application pour naviguer entre un petit nombre de vues (généralement entre trois et cinq).", "demoNavigationRailFirst": "Premier", "demoNavigationDrawerTitle": "Panneau de navigation", "demoNavigationRailThird": "Troisième", "replyStarredLabel": "Suivis", "demoTextButtonDescription": "Un bouton de texte présente une tache de couleur lorsque l'on appuie dessus, mais ne se relève pas. Utilisez les boutons de texte sur la barre d'outils, dans les boîtes de dialogue et intégrés à la marge intérieure.", "demoElevatedButtonTitle": "Bouton surélevé", "demoElevatedButtonDescription": "Les boutons surélevés ajoutent du relief aux présentations le plus souvent plates. Ils mettent en avant des fonctions lorsque l'espace est grand ou chargé.", "demoOutlinedButtonTitle": "Bouton avec contours", "demoOutlinedButtonDescription": "Les boutons avec contours deviennent opaques et se relèvent lorsqu'on appuie dessus. Ils sont souvent associés à des boutons en relief pour indiquer une action secondaire alternative.", "demoContainerTransformDemoInstructions": "Cartes, listes et bouton d'action flottant", "demoNavigationDrawerSubtitle": "Affichage d'un panneau dans la barre d'application", "replyDescription": "Une application de messagerie efficace et dédiée", "demoNavigationDrawerDescription": "Panneau Material Design à faire glisser horizontalement vers l'intérieur depuis le bord de l'écran pour afficher les liens de navigation dans une application.", "replyDraftsLabel": "Brouillons", "demoNavigationDrawerToPageOne": "Premier élément", "replyInboxLabel": "Boîte de réception", "demoSharedXAxisDemoInstructions": "Boutons \"Suivant\" et \"Retour\"", "replySpamLabel": "Spam", "replyTrashLabel": "Corbeille", "replySentLabel": "Envoyés", "demoNavigationRailSecond": "Deuxième", "demoNavigationDrawerToPageTwo": "Deuxième élément", "demoFadeScaleDemoInstructions": "Fenêtre et bouton d'action flottant", "demoFadeThroughDemoInstructions": "Navigation inférieure", "demoSharedZAxisDemoInstructions": "Bouton de l'icône des paramètres", "demoSharedYAxisDemoInstructions": "Trier par \"Écoutés récemment\"", "demoTextButtonTitle": "Bouton de texte", "demoSharedZAxisBeefSandwichRecipeTitle": "Sandwich au bœuf", "demoSharedZAxisDessertRecipeDescription": "Recette de dessert", "demoSharedYAxisAlbumTileSubtitle": "Artiste", "demoSharedYAxisAlbumTileTitle": "Album", "demoSharedYAxisRecentSortTitle": "Écouté récemment", "demoSharedYAxisAlphabeticalSortTitle": "A-Z", "demoSharedYAxisAlbumCount": "268 albums", "demoSharedYAxisTitle": "Axe y partagé", "demoSharedXAxisCreateAccountButtonText": "CRÉER UN COMPTE", "demoFadeScaleAlertDialogDiscardButton": "SUPPRIMER", "demoSharedXAxisSignInTextFieldLabel": "Adresse e-mail ou numéro de téléphone", "demoSharedXAxisSignInSubtitleText": "Connectez-vous avec votre compte", "demoSharedXAxisSignInWelcomeText": "Bonjour David Dupond", "demoSharedXAxisIndividualCourseSubtitle": "Cours individuels", "demoSharedXAxisBundledCourseSubtitle": "Cours groupés", "demoFadeThroughAlbumsDestination": "Albums", "demoSharedXAxisDesignCourseTitle": "Design", "demoSharedXAxisIllustrationCourseTitle": "Illustration", "demoSharedXAxisBusinessCourseTitle": "Économie", "demoSharedXAxisArtsAndCraftsCourseTitle": "Art et artisanat", "demoMotionPlaceholderSubtitle": "Texte secondaire", "demoFadeScaleAlertDialogCancelButton": "ANNULER", "demoFadeScaleAlertDialogHeader": "Boîte de dialogue d'alerte", "demoFadeScaleHideFabButton": "MASQUER LE BOUTON D'ACTION FLOTTANT", "demoFadeScaleShowFabButton": "AFFICHER LE BOUTON D'ACTION FLOTTANT", "demoFadeScaleShowAlertDialogButton": "AFFICHER LE MODULE", "demoFadeScaleDescription": "Le schéma \"Fondu\" est un type de transition utilisé pour les éléments d'UI qui apparaissent ou disparaissent sans dépasser de l'écran. Par exemple, une boîte de dialogue qui apparaît au centre de ce dernier.", "demoFadeScaleTitle": "Fondu", "demoFadeThroughTextPlaceholder": "123 photos", "demoFadeThroughSearchDestination": "Rechercher", "demoFadeThroughPhotosDestination": "Photos", "demoSharedXAxisCoursePageSubtitle": "Les cours groupés s'affichent comme tels dans votre flux. Vous pouvez modifier ce paramètre ultérieurement.", "demoFadeThroughDescription": "Le schéma \"Fondu total\" est un type de transition utilisé pour des éléments d'UI qui n'ont pas de lien de parenté fort.", "demoFadeThroughTitle": "Fondu total", "demoSharedZAxisHelpSettingLabel": "Aide", "demoMotionSubtitle": "Tous les schémas de transition prédéfinis", "demoSharedZAxisNotificationSettingLabel": "Notifications", "demoSharedZAxisProfileSettingLabel": "Profil", "demoSharedZAxisSavedRecipesListTitle": "Recettes enregistrées", "demoSharedZAxisBeefSandwichRecipeDescription": "Recette de sandwich au bœuf", "demoSharedZAxisCrabPlateRecipeDescription": "Recette à base de crabe", "demoSharedXAxisCoursePageTitle": "Organiser vos cours", "demoSharedZAxisCrabPlateRecipeTitle": "Crabe", "demoSharedZAxisShrimpPlateRecipeDescription": "Recette à base de crevettes", "demoSharedZAxisShrimpPlateRecipeTitle": "Crevettes", "demoContainerTransformTypeFadeThrough": "FONDU TOTAL", "demoSharedZAxisDessertRecipeTitle": "Dessert", "demoSharedZAxisSandwichRecipeDescription": "Recette de sandwich", "demoSharedZAxisSandwichRecipeTitle": "Sandwich", "demoSharedZAxisBurgerRecipeDescription": "Recette de hamburger", "demoSharedZAxisBurgerRecipeTitle": "Hamburger", "demoSharedZAxisSettingsPageTitle": "Paramètres", "demoSharedZAxisTitle": "Axe z partagé", "demoSharedZAxisPrivacySettingLabel": "Confidentialité", "demoMotionTitle": "Mouvement", "demoContainerTransformTitle": "Transformation du conteneur", "demoContainerTransformDescription": "Le schéma \"Transformation du conteneur\" est un type de transition conçu pour les éléments d'UI qui comportent un conteneur. Ce schéma permet de faire visuellement le lien entre deux éléments d'UI", "demoContainerTransformModalBottomSheetTitle": "Mode Fondu", "demoContainerTransformTypeFade": "FONDU", "demoSharedYAxisAlbumTileDurationUnit": "min", "demoMotionPlaceholderTitle": "Titre", "demoSharedXAxisForgotEmailButtonText": "ADRESSE E-MAIL OUBLIÉE ?", "demoMotionSmallPlaceholderSubtitle": "Secondaire", "demoMotionDetailsPageTitle": "Page d'informations", "demoMotionListTileTitle": "Élément de liste", "demoSharedAxisDescription": "Le schéma \"Axe partagé\" est un type de transition utilisé pour des éléments d'UI qui partagent la même logique spatiale ou de navigation. Ce schéma utilise une transformation basée sur l'axe x, y ou z pour renforcer le lien de parenté entre ces éléments.", "demoSharedXAxisTitle": "Axe x partagé", "demoSharedXAxisBackButtonText": "RETOUR", "demoSharedXAxisNextButtonText": "SUIVANT", "demoSharedXAxisCulinaryCourseTitle": "Cuisine", "githubRepo": "dépôt GitHub {repoName}", "fortnightlyMenuUS": "États-Unis", "fortnightlyMenuBusiness": "Économie", "fortnightlyMenuScience": "Science", "fortnightlyMenuSports": "Sport", "fortnightlyMenuTravel": "Voyages", "fortnightlyMenuCulture": "Culture", "fortnightlyTrendingTechDesign": "TechDesign", "rallyBudgetDetailAmountLeft": "Montant restant", "fortnightlyHeadlineArmy": "Reforming The Green Army From Within (Réformer l'armée verte de l'intérieur)", "fortnightlyDescription": "Application d'actualités centrée sur les contenus", "rallyBillDetailAmountDue": "Montant dû", "rallyBudgetDetailTotalCap": "Limite totale", "rallyBudgetDetailAmountUsed": "Montant utilisé", "fortnightlyTrendingHealthcareRevolution": "HealthcareRevolution", "fortnightlyMenuFrontPage": "Page de couverture", "fortnightlyMenuWorld": "Monde", "rallyBillDetailAmountPaid": "Montant payé", "fortnightlyMenuPolitics": "Politique", "fortnightlyHeadlineBees": "Farmland Bees In Short Supply (Les abeilles désertent les terres agricoles)", "fortnightlyHeadlineGasoline": "The Future of Gasoline (L'avenir du gasoil)", "fortnightlyTrendingGreenArmy": "GreenArmy", "fortnightlyHeadlineFeminists": "Feminists Take On Partisanship (Les féministes ne sont plus impartiaux)", "fortnightlyHeadlineFabrics": "Designers Use Tech To Make Futuristic Fabrics (Les designers s'appuient sur les technologies pour créer les tissus du futur)", "fortnightlyHeadlineStocks": "As Stocks Stagnate, Many Look To Currency (La Bourse stagne, beaucoup d'investisseurs se tournent vers l'échange de devises)", "fortnightlyTrendingReform": "Reform", "fortnightlyMenuTech": "Technologies", "fortnightlyHeadlineWar": "Divided American Lives During War (Comment la guerre a séparé des vies)", "fortnightlyHeadlineHealthcare": "The Quiet, Yet Powerful Healthcare Revolution (La révolution du système de santé, discrète mais efficace)", "fortnightlyLatestUpdates": "Dernières actualités", "fortnightlyTrendingStocks": "Stocks", "rallyBillDetailTotalAmount": "Montant total", "demoCupertinoPickerDateTime": "Date et heure", "signIn": "CONNEXION", "dataTableRowWithSugar": "{value} avec du sucre", "dataTableRowApplePie": "Apple Pie", "dataTableRowDonut": "Donut", "dataTableRowHoneycomb": "Honeycomb", "dataTableRowLollipop": "Lollipop", "dataTableRowJellyBean": "Jelly Bean", "dataTableRowGingerbread": "Gingerbread", "dataTableRowCupcake": "Cupcake", "dataTableRowEclair": "Eclair", "dataTableRowIceCreamSandwich": "Ice Cream Sandwich", "dataTableRowFrozenYogurt": "Frozen Yogurt", "dataTableColumnIron": "Fer (%)", "dataTableColumnCalcium": "Calcium (%)", "dataTableColumnSodium": "Sodium (mg)", "demoTimePickerTitle": "Outil de sélection de l'heure", "demo2dTransformationsResetTooltip": "Réinitialiser les transformations", "dataTableColumnFat": "Lipides (g)", "dataTableColumnCalories": "Calories", "dataTableColumnDessert": "Dessert (pour 1 personne)", "cardsDemoTravelDestinationLocation1": "Thanjavur, Tamil Nadu", "demoTimePickerDescription": "Affiche une boîte de dialogue comportant un outil Material Design de sélection de l'heure.", "demoPickersShowPicker": "AFFICHER L'OUTIL DE SÉLECTION", "demoTabsScrollingTitle": "Défilement", "demoTabsNonScrollingTitle": "Pas de défilement", "craneHours": "{hours,plural,=1{1 h}other{{hours} h}}", "craneMinutes": "{minutes,plural,=1{1 min}other{{minutes} min}}", "craneFlightDuration": "{hoursShortForm} {minutesShortForm}", "dataTableHeader": "Informations nutritionnelles", "demoDatePickerTitle": "Sélecteur de date", "demoPickersSubtitle": "Sélection de la date et de l'heure", "demoPickersTitle": "Outils de sélection", "demo2dTransformationsEditTooltip": "Modifier une tuile", "demoDataTableDescription": "Les tableaux de données présentent des informations sous forme de grilles composées de lignes et de colonnes. Ce format permet de parcourir facilement les données et d'identifier des tendances.", "demo2dTransformationsDescription": "Appuyez pour modifier des tuiles et utilisez des gestes pour vous déplacer dans la scène. Faites glisser un doigt pour faire un panoramique, pincez l'écran pour zoomer, faites pivoter un élément avec deux doigts. Appuyez sur le bouton de réinitialisation pour retourner à l'orientation de départ.", "demo2dTransformationsSubtitle": "Panoramique, zoom, rotation", "demo2dTransformationsTitle": "Transformations en 2D", "demoCupertinoTextFieldPIN": "Code", "demoCupertinoTextFieldDescription": "Un champ de texte permet à l'utilisateur de saisir du texte à l'aide d'un clavier physique ou tactile.", "demoCupertinoTextFieldSubtitle": "Champs de texte de style iOS", "demoCupertinoTextFieldTitle": "Champs de texte", "demoDatePickerDescription": "Affiche une boîte de dialogue comportant un sélecteur de date Material Design.", "demoCupertinoPickerTime": "Heure", "demoCupertinoPickerDate": "Date", "demoCupertinoPickerTimer": "Minuteur", "demoCupertinoPickerDescription": "Widget de sélection de style iOS pouvant être utilisé pour le choix d'une date, d'une heure, de ces deux éléments ou d'une chaîne.", "demoCupertinoPickerSubtitle": "Sélecteurs de styles iOS", "demoCupertinoPickerTitle": "Outils de sélection", "dataTableRowWithHoney": "{value} avec du miel", "cardsDemoTravelDestinationCity2": "Chettinad", "bannerDemoResetText": "Réinitialiser la bannière", "bannerDemoMultipleText": "Actions multiples", "bannerDemoLeadingText": "Icône précédant le texte", "dismiss": "FERMER", "cardsDemoTappable": "Accessible d'une simple pression", "cardsDemoSelectable": "Accessible en appuyant de manière prolongée", "cardsDemoExplore": "Explorer", "cardsDemoExploreSemantics": "Explorer {destinationName}", "cardsDemoShareSemantics": "Partager {destinationName}", "cardsDemoTravelDestinationTitle1": "10 villes à voir absolument au Tamil Nadu", "cardsDemoTravelDestinationDescription1": "Numéro 10", "cardsDemoTravelDestinationCity1": "Thanjavur", "dataTableColumnProtein": "Protéines (g)", "cardsDemoTravelDestinationTitle2": "Artisans du sud de l'Inde", "cardsDemoTravelDestinationDescription2": "Fileurs de soie", "bannerDemoText": "Votre mot de passe a été mis à jour sur un autre appareil. Veuillez vous reconnecter.", "cardsDemoTravelDestinationLocation2": "Sivaganga, Tamil Nadu", "cardsDemoTravelDestinationTitle3": "Temple de Brihadesvara", "cardsDemoTravelDestinationDescription3": "Temples", "demoBannerTitle": "Bannière", "demoBannerSubtitle": "Affichage d'une bannière au sein d'une liste", "demoBannerDescription": "Une bannière comporte un message court mais important, ainsi que des suggestions d'actions pour les utilisateurs (ou une option permettant de fermer la bannière). L'utilisateur doit agir pour que la bannière disparaisse.", "demoCardTitle": "Fiches", "demoCardSubtitle": "Fiches de base avec angles arrondis", "demoCardDescription": "Une fiche est un cadre où sont présentées des informations liées à une recherche, telles qu'un album, un lieu, un plat, des coordonnées, etc.", "demoDataTableTitle": "Tableaux de données", "demoDataTableSubtitle": "Lignes et colonnes de données", "dataTableColumnCarbs": "Glucides (g)", "placeTanjore": "Tanjore", "demoGridListsTitle": "Liste sous forme de grille", "placeFlowerMarket": "Marché aux fleurs", "placeBronzeWorks": "Fonderie de bronze", "placeMarket": "Marché", "placeThanjavurTemple": "Temple de Thanjavur", "placeSaltFarm": "Marais salant", "placeScooters": "Scooters", "placeSilkMaker": "Tisserand de soie", "placeLunchPrep": "Préparation du déjeuner", "placeBeach": "Plage", "placeFisherman": "Pêcheur", "demoMenuSelected": "Sélection : {value}", "demoMenuRemove": "Supprimer", "demoMenuGetLink": "Obtenir le lien", "demoMenuShare": "Partager", "demoBottomAppBarSubtitle": "Affiche des informations liées à la navigation et des actions au bas de l'écran", "demoMenuAnItemWithASectionedMenu": "Un élément avec un menu à sections", "demoMenuADisabledMenuItem": "Élément de menu désactivé", "demoLinearProgressIndicatorTitle": "Indicateur de progression linéaire", "demoMenuContextMenuItemOne": "Élément de menu contextuel 1", "demoMenuAnItemWithASimpleMenu": "Un élément avec un menu simple", "demoCustomSlidersTitle": "Curseurs personnalisés", "demoMenuAnItemWithAChecklistMenu": "Un élément avec un menu de type checklist", "demoCupertinoActivityIndicatorTitle": "Indicateur d'activité", "demoCupertinoActivityIndicatorSubtitle": "Indicateurs d'activité de style iOS", "demoCupertinoActivityIndicatorDescription": "Indicateur d'activité de style iOS tournant dans le sens des aiguilles d'une montre", "demoCupertinoNavigationBarTitle": "Barre de navigation", "demoCupertinoNavigationBarSubtitle": "Barre de navigation de style iOS", "demoCupertinoNavigationBarDescription": "Une barre de navigation de style iOS. Il s'agit d'une barre d'outils au milieu de laquelle est indiqué au minimum le titre de la page consultée.", "demoCupertinoPullToRefreshTitle": "Balayer vers le bas pour actualiser l'affichage", "demoCupertinoPullToRefreshSubtitle": "Commande de style iOS pour balayer l'écran vers le bas afin d'actualiser l'affichage", "demoCupertinoPullToRefreshDescription": "Un widget permettant d'intégrer une commande de style iOS pour balayer l'écran vers le bas afin d'actualiser l'affichage.", "demoProgressIndicatorTitle": "Indicateurs de progression", "demoProgressIndicatorSubtitle": "Linéaire, circulaire, indéterminé", "demoCircularProgressIndicatorTitle": "Indicateur de progression circulaire", "demoCircularProgressIndicatorDescription": "Indicateur de progression circulaire Material Design, tournant pour signifier que l'application est occupée.", "demoMenuFour": "Quatre", "demoLinearProgressIndicatorDescription": "Indicateur de progression linéaire Material Design, également appelé barre de progression.", "demoTooltipTitle": "Info-bulles", "demoTooltipSubtitle": "Court message affiché en cas d'appui de manière prolongée ou de passage de la souris sur un élément", "demoTooltipDescription": "Les info-bulles sont des libellés textuels expliquant la fonction d'un bouton ou d'une autre action d'une interface utilisateur. Le texte informatif s'affiche lorsque les utilisateurs passent leur souris, placent leur curseur ou appuient de manière prolongée sur un élément.", "demoTooltipInstructions": "Appuyez de manière prolongée ou passez la souris sur l'élément pour afficher l'info-bulle.", "placeChennai": "Chennai", "demoMenuChecked": "Case cochée : {value}", "placeChettinad": "Chettinad", "demoMenuPreview": "Aperçu", "demoBottomAppBarTitle": "Barre d'application inférieure", "demoBottomAppBarDescription": "La barre d'application inférieure permet d'accéder à un panneau de navigation et à un maximum de quatre actions, y compris au bouton d'action flottant.", "bottomAppBarNotch": "Encoche", "bottomAppBarPosition": "Position du bouton d'action flottant", "bottomAppBarPositionDockedEnd": "Épinglé - Extrémité", "bottomAppBarPositionDockedCenter": "Épinglé - Milieu", "bottomAppBarPositionFloatingEnd": "Flottant - Extrémité", "bottomAppBarPositionFloatingCenter": "Flottant - Milieu", "demoSlidersEditableNumericalValue": "Valeur numérique modifiable", "demoGridListsSubtitle": "Disposition en lignes et colonnes", "demoGridListsDescription": "Les listes sous forme de grille sont particulièrement adaptées à la présentation de données homogènes telles que des images. Chaque élément d'une liste sous forme de grille est appelé une tuile.", "demoGridListsImageOnlyTitle": "Image uniquement", "demoGridListsHeaderTitle": "Avec en-tête", "demoGridListsFooterTitle": "Avec pied de page", "demoSlidersTitle": "Curseurs", "demoSlidersSubtitle": "Widgets pour sélectionner une valeur en balayant l'écran", "demoSlidersDescription": "Les curseurs permettent aux utilisateurs de sélectionner une valeur sur une plage donnée représentée sur une ligne horizontale. Ils sont idéaux pour ajuster des paramètres comme le volume, la luminosité ou des filtres appliqués sur des images.", "demoRangeSlidersTitle": "Curseurs de plage", "demoRangeSlidersDescription": "Les curseurs présentent une plage de valeurs sur une ligne horizontale. Ils peuvent comporter des icônes aux deux extrémités représentant les limites de la plage de valeurs. Ils sont idéaux pour ajuster des paramètres comme le volume, la luminosité ou des filtres appliqués sur des images.", "demoMenuAnItemWithAContextMenuButton": "Un élément avec un menu contextuel", "demoCustomSlidersDescription": "Les curseurs permettent aux utilisateurs de sélectionner une valeur ou une plage de valeurs sur une plage donnée représentée sur une ligne horizontale. Des thèmes peuvent leur être appliqués et ils peuvent être personnalisés.", "demoSlidersContinuousWithEditableNumericalValue": "Continu avec une valeur numérique modifiable", "demoSlidersDiscrete": "Discret", "demoSlidersDiscreteSliderWithCustomTheme": "Curseur discret avec un thème personnalisé", "demoSlidersContinuousRangeSliderWithCustomTheme": "Curseur de plage continue avec un thème personnalisé", "demoSlidersContinuous": "Continu", "placePondicherry": "Pondichéry", "demoMenuTitle": "Menu", "demoContextMenuTitle": "Menu contextuel", "demoSectionedMenuTitle": "Menu à sections", "demoSimpleMenuTitle": "Menu simple", "demoChecklistMenuTitle": "Menu de type checklist", "demoMenuSubtitle": "Boutons de menu et menus simples", "demoMenuDescription": "Un menu présente une liste d'options de manière temporaire. Il s'affiche lorsque les utilisateurs interagissent avec un bouton, une action ou un autre type de commande.", "demoMenuItemValueOne": "Élément de menu 1", "demoMenuItemValueTwo": "Élément de menu 2", "demoMenuItemValueThree": "Élément de menu 3", "demoMenuOne": "Un", "demoMenuTwo": "Deux", "demoMenuThree": "Trois", "demoMenuContextMenuItemThree": "Élément de menu contextuel 3", "demoCupertinoSwitchSubtitle": "Bouton bascule de style iOS", "demoSnackbarsText": "Ceci est un snackbar.", "demoCupertinoSliderSubtitle": "Curseur de style iOS", "demoCupertinoSliderDescription": "Vous pouvez utiliser un curseur pour sélectionner un ensemble de valeurs discrètes ou continues.", "demoCupertinoSliderContinuous": "Continu : {value}", "demoCupertinoSliderDiscrete": "Discret : {value}", "demoSnackbarsAction": "Vous avez appuyé sur l'action du snackbar.", "backToGallery": "Retour à la galerie", "demoCupertinoTabBarTitle": "Barre d'onglets", "demoCupertinoSwitchDescription": "Vous pouvez utiliser un bouton bascule pour permettre d'activer ou de désactiver un paramètre.", "demoSnackbarsActionButtonLabel": "ACTION", "cupertinoTabBarProfileTab": "Profil", "demoSnackbarsButtonLabel": "AFFICHER UN SNACKBAR", "demoSnackbarsDescription": "Les snackbars informent les utilisateurs d'un processus qu'une appli a lancé ou va lancer. Ils s'affichent de façon temporaire en bas de l'écran. Ils ne doivent pas interrompre l'expérience utilisateur et ils ne nécessitent pas l'intervention de l'utilisateur pour disparaître.", "demoSnackbarsSubtitle": "Les snackbars affichent des messages en bas de l'écran", "demoSnackbarsTitle": "Snackbars", "demoCupertinoSliderTitle": "Curseur", "cupertinoTabBarChatTab": "Chat", "cupertinoTabBarHomeTab": "Accueil", "demoCupertinoTabBarDescription": "Une barre d'onglets de navigation de style iOS s'affichant en bas de l'écran. Affiche plusieurs onglets, dont un actif, par défaut le premier.", "demoCupertinoTabBarSubtitle": "Barre d'onglets de style iOS s'affichant en bas de l'écran", "demoOptionsFeatureTitle": "Afficher les options", "demoOptionsFeatureDescription": "Appuyez ici pour afficher les options disponibles pour cette démo.", "demoCodeViewerCopyAll": "TOUT COPIER", "shrineScreenReaderRemoveProductButton": "Supprimer {product}", "shrineScreenReaderProductAddToCart": "Ajouter au panier", "shrineScreenReaderCart": "{quantity,plural,=0{Panier, aucun article}=1{Panier, 1 article}other{Panier, {quantity} articles}}", "demoCodeViewerFailedToCopyToClipboardMessage": "Échec de la copie dans le presse-papiers : {error}", "demoCodeViewerCopiedToClipboardMessage": "Copié dans le presse-papiers.", "craneSleep8SemanticLabel": "Ruines mayas sur une falaise surplombant une plage", "craneSleep4SemanticLabel": "Hôtel au bord d'un lac au pied des montagnes", "craneSleep2SemanticLabel": "Citadelle du Machu Picchu", "craneSleep1SemanticLabel": "Chalet dans un paysage enneigé avec des sapins", "craneSleep0SemanticLabel": "Bungalows sur pilotis", "craneFly13SemanticLabel": "Piscine en bord de mer avec des palmiers", "craneFly12SemanticLabel": "Piscine et palmiers", "craneFly11SemanticLabel": "Phare en briques dans la mer", "craneFly10SemanticLabel": "Minarets de la mosquée Al-Azhar au coucher du soleil", "craneFly9SemanticLabel": "Homme s'appuyant sur une ancienne voiture bleue", "craneFly8SemanticLabel": "Supertree Grove", "craneEat9SemanticLabel": "Comptoir de café avec des viennoiseries", "craneEat2SemanticLabel": "Hamburger", "craneFly5SemanticLabel": "Hôtel au bord d'un lac au pied des montagnes", "demoSelectionControlsSubtitle": "Cases à cocher, cases d'option et boutons bascule", "craneEat10SemanticLabel": "Femme tenant un énorme sandwich au pastrami", "craneFly4SemanticLabel": "Bungalows sur pilotis", "craneEat7SemanticLabel": "Entrée d'une boulangerie", "craneEat6SemanticLabel": "Plat de crevettes", "craneEat5SemanticLabel": "Sièges dans un restaurant artistique", "craneEat4SemanticLabel": "Dessert au chocolat", "craneEat3SemanticLabel": "Taco coréen", "craneFly3SemanticLabel": "Citadelle du Machu Picchu", "craneEat1SemanticLabel": "Bar inoccupé avec des tabourets de café-restaurant", "craneEat0SemanticLabel": "Pizza dans un four à bois", "craneSleep11SemanticLabel": "Gratte-ciel Taipei 101", "craneSleep10SemanticLabel": "Minarets de la mosquée Al-Azhar au coucher du soleil", "craneSleep9SemanticLabel": "Phare en briques dans la mer", "craneEat8SemanticLabel": "Plat d'écrevisses", "craneSleep7SemanticLabel": "Appartements colorés place Ribeira", "craneSleep6SemanticLabel": "Piscine et palmiers", "craneSleep5SemanticLabel": "Tente dans un champ", "settingsButtonCloseLabel": "Fermer les paramètres", "demoSelectionControlsCheckboxDescription": "Les cases à cocher permettent à l'utilisateur de sélectionner plusieurs options dans une liste. La valeur normale d'une case à cocher est \"vrai\" ou \"faux\", et une case à trois états peut également avoir une valeur \"nulle\".", "settingsButtonLabel": "Paramètres", "demoListsTitle": "Listes", "demoListsSubtitle": "Dispositions avec liste déroulante", "demoListsDescription": "Ligne unique à hauteur fixe qui contient généralement du texte ainsi qu'une icône au début ou à la fin.", "demoOneLineListsTitle": "Une ligne", "demoTwoLineListsTitle": "Deux lignes", "demoListsSecondary": "Texte secondaire", "demoSelectionControlsTitle": "Commandes de sélection", "craneFly7SemanticLabel": "Mont Rushmore", "demoSelectionControlsCheckboxTitle": "Case à cocher", "craneSleep3SemanticLabel": "Homme s'appuyant sur une ancienne voiture bleue", "demoSelectionControlsRadioTitle": "Case d'option", "demoSelectionControlsRadioDescription": "Les cases d'option permettent à l'utilisateur de sélectionner une option dans une liste. Utilisez les cases d'option pour effectuer des sélections exclusives si vous pensez que l'utilisateur doit voir toutes les options proposées côte à côte.", "demoSelectionControlsSwitchTitle": "Bouton bascule", "demoSelectionControlsSwitchDescription": "Les boutons bascule permettent d'activer ou de désactiver des options. L'option contrôlée par le bouton, ainsi que l'état dans lequel elle se trouve, doivent être explicites dans le libellé correspondant.", "craneFly0SemanticLabel": "Chalet dans un paysage enneigé avec des sapins", "craneFly1SemanticLabel": "Tente dans un champ", "craneFly2SemanticLabel": "Drapeaux de prière devant une montagne enneigée", "craneFly6SemanticLabel": "Vue aérienne du Palacio de Bellas Artes", "rallySeeAllAccounts": "Voir tous les comptes", "rallyBillAmount": "Facture {billName} de {amount} à payer avant le {date}.", "shrineTooltipCloseCart": "Fermer le panier", "shrineTooltipCloseMenu": "Fermer le menu", "shrineTooltipOpenMenu": "Ouvrir le menu", "shrineTooltipSettings": "Paramètres", "shrineTooltipSearch": "Rechercher", "demoTabsDescription": "Les onglets organisent le contenu sur différents écrans et ensembles de données, et en fonction d'autres interactions.", "demoTabsSubtitle": "Onglets avec affichage à défilement indépendant", "demoTabsTitle": "Onglets", "rallyBudgetAmount": "Budget {budgetName} avec {amountUsed} utilisés sur {amountTotal}, {amountLeft} restants", "shrineTooltipRemoveItem": "Supprimer l'élément", "rallyAccountAmount": "Compte {accountName} {accountNumber} avec {amount}.", "rallySeeAllBudgets": "Voir tous les budgets", "rallySeeAllBills": "Voir toutes les factures", "craneFormDate": "Sélectionner une date", "craneFormOrigin": "Choisir le point de départ", "craneFly2": "Vallée du Khumbu, Népal", "craneFly3": "Machu Picchu, Pérou", "craneFly4": "Malé, Maldives", "craneFly5": "Vitznau, Suisse", "craneFly6": "Mexico, Mexique", "craneFly7": "Mont Rushmore, États-Unis", "settingsTextDirectionLocaleBased": "En fonction des paramètres régionaux", "craneFly9": "La Havane, Cuba", "craneFly10": "Le Caire, Égypte", "craneFly11": "Lisbonne, Portugal", "craneFly12": "Napa, États-Unis", "craneFly13": "Bali, Indonésie", "craneSleep0": "Malé, Maldives", "craneSleep1": "Aspen, États-Unis", "craneSleep2": "Machu Picchu, Pérou", "demoCupertinoSegmentedControlTitle": "Contrôle segmenté", "craneSleep4": "Vitznau, Suisse", "craneSleep5": "Big Sur, États-Unis", "craneSleep6": "Napa, États-Unis", "craneSleep7": "Porto, Portugal", "craneSleep8": "Tulum, Mexique", "craneEat5": "Séoul, Corée du Sud", "demoChipTitle": "Chips", "demoChipSubtitle": "Éléments compacts représentant une entrée, un attribut ou une action", "demoActionChipTitle": "Chip d'action", "demoActionChipDescription": "Les chips d'action sont un ensemble d'options qui déclenchent une action en lien avec le contenu principal. Ces chips s'affichent de façon dynamique et contextuelle dans l'interface utilisateur.", "demoChoiceChipTitle": "Chip de choix", "demoChoiceChipDescription": "Les chips de choix représentent un choix unique à faire dans un ensemble d'options. Ces chips contiennent des catégories ou du texte descriptif associés.", "demoFilterChipTitle": "Chip de filtre", "demoFilterChipDescription": "Les chips de filtre utilisent des tags ou des mots descriptifs pour filtrer le contenu.", "demoInputChipTitle": "Chip d'entrée", "demoInputChipDescription": "Les chips d'entrée représentent une information complexe, telle qu'une entité (personne, lieu ou objet) ou du texte dialogué sous forme compacte.", "craneSleep9": "Lisbonne, Portugal", "craneEat10": "Lisbonne, Portugal", "demoCupertinoSegmentedControlDescription": "Utilisé pour effectuer une sélection parmi plusieurs options s'excluant mutuellement. Lorsqu'une option est sélectionnée dans le contrôle segmenté, les autres options ne le sont plus.", "chipTurnOnLights": "Allumer les lumières", "chipSmall": "Petite", "chipMedium": "Moyenne", "chipLarge": "Grande", "chipElevator": "Ascenseur", "chipWasher": "Lave-linge", "chipFireplace": "Cheminée", "chipBiking": "Vélo", "craneFormDiners": "Personnes", "rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{Bénéficiez d'une déduction fiscale potentielle plus importante ! Attribuez une catégorie à 1 transaction non catégorisée.}other{Bénéficiez d'une déduction fiscale potentielle plus importante ! Attribuez des catégories à {count} transactions non catégorisées.}}", "craneFormTime": "Sélectionner une heure", "craneFormLocation": "Sélectionner un lieu", "craneFormTravelers": "Voyageurs", "craneEat8": "Atlanta, États-Unis", "craneFormDestination": "Sélectionner une destination", "craneFormDates": "Sélectionner des dates", "craneFly": "VOLER", "craneSleep": "DORMIR", "craneEat": "MANGER", "craneFlySubhead": "Explorer les vols par destination", "craneSleepSubhead": "Explorer les locations par destination", "craneEatSubhead": "Explorer les restaurants par destination", "craneFlyStops": "{numberOfStops,plural,=0{Sans escale}=1{1 escale}other{{numberOfStops} escales}}", "craneSleepProperties": "{totalProperties,plural,=0{Aucune location disponible}=1{1 location disponible}other{{totalProperties} locations disponibles}}", "craneEatRestaurants": "{totalRestaurants,plural,=0{Aucun restaurant}=1{1 restaurant}other{{totalRestaurants} restaurants}}", "craneFly0": "Aspen, États-Unis", "demoCupertinoSegmentedControlSubtitle": "Contrôle segmenté de style iOS", "craneSleep10": "Le Caire, Égypte", "craneEat9": "Madrid, Espagne", "craneFly1": "Big Sur, États-Unis", "craneEat7": "Nashville, États-Unis", "craneEat6": "Seattle, États-Unis", "craneFly8": "Singapour", "craneEat4": "Paris, France", "craneEat3": "Portland, États-Unis", "craneEat2": "Córdoba, Argentine", "craneEat1": "Dallas, États-Unis", "craneEat0": "Naples, Italie", "craneSleep11": "Taipei (Taïwan)", "craneSleep3": "La Havane, Cuba", "shrineLogoutButtonCaption": "SE DÉCONNECTER", "rallyTitleBills": "FACTURES", "rallyTitleAccounts": "COMPTES", "shrineProductVagabondSack": "Sac Vagabond", "rallyAccountDetailDataInterestYtd": "Cumul annuel des intérêts", "shrineProductWhitneyBelt": "Ceinture Whitney", "shrineProductGardenStrand": "Collier", "shrineProductStrutEarrings": "Boucles d'oreilles Strut", "shrineProductVarsitySocks": "Chaussettes de sport", "shrineProductWeaveKeyring": "Porte-clés tressé", "shrineProductGatsbyHat": "Casquette Gatsby", "shrineProductShrugBag": "Sac à main", "shrineProductGiltDeskTrio": "Trois accessoires de bureau dorés", "shrineProductCopperWireRack": "Grille en cuivre", "shrineProductSootheCeramicSet": "Ensemble céramique apaisant", "shrineProductHurrahsTeaSet": "Service à thé Hurrahs", "shrineProductBlueStoneMug": "Mug bleu pierre", "shrineProductRainwaterTray": "Bac à eau de pluie", "shrineProductChambrayNapkins": "Serviettes de batiste", "shrineProductSucculentPlanters": "Pots pour plantes grasses", "shrineProductQuartetTable": "Table de quatre", "shrineProductKitchenQuattro": "Quatre accessoires de cuisine", "shrineProductClaySweater": "Pull couleur argile", "shrineProductSeaTunic": "Tunique de plage", "shrineProductPlasterTunic": "Tunique couleur plâtre", "rallyBudgetCategoryRestaurants": "Restaurants", "shrineProductChambrayShirt": "Chemise de batiste", "shrineProductSeabreezeSweater": "Pull brise marine", "shrineProductGentryJacket": "Veste aristo", "shrineProductNavyTrousers": "Pantalon bleu marine", "shrineProductWalterHenleyWhite": "Walter Henley (blanc)", "shrineProductSurfAndPerfShirt": "T-shirt d'été", "shrineProductGingerScarf": "Écharpe rousse", "shrineProductRamonaCrossover": "Mélange de différents styles Ramona", "shrineProductClassicWhiteCollar": "Col blanc classique", "shrineProductSunshirtDress": "Robe d'été", "rallyAccountDetailDataInterestRate": "Taux d'intérêt", "rallyAccountDetailDataAnnualPercentageYield": "Pourcentage annuel de rendement", "rallyAccountDataVacation": "Vacances", "shrineProductFineLinesTee": "T-shirt à rayures fines", "rallyAccountDataHomeSavings": "Compte épargne logement", "rallyAccountDataChecking": "Compte courant", "rallyAccountDetailDataInterestPaidLastYear": "Intérêts payés l'an dernier", "rallyAccountDetailDataNextStatement": "Relevé suivant", "rallyAccountDetailDataAccountOwner": "Titulaire du compte", "rallyBudgetCategoryCoffeeShops": "Cafés", "rallyBudgetCategoryGroceries": "Courses", "shrineProductCeriseScallopTee": "T-shirt couleur cerise", "rallyBudgetCategoryClothing": "Vêtements", "rallySettingsManageAccounts": "Gérer les comptes", "rallyAccountDataCarSavings": "Économies pour la voiture", "rallySettingsTaxDocuments": "Documents fiscaux", "rallySettingsPasscodeAndTouchId": "Code secret et fonctionnalité Touch ID", "rallySettingsNotifications": "Notifications", "rallySettingsPersonalInformation": "Informations personnelles", "rallySettingsPaperlessSettings": "Paramètres sans papier", "rallySettingsFindAtms": "Trouver un distributeur de billets", "rallySettingsHelp": "Aide", "rallySettingsSignOut": "Se déconnecter", "rallyAccountTotal": "Total", "rallyBillsDue": "Montant dû", "rallyBudgetLeft": "Budget restant", "rallyAccounts": "Comptes", "rallyBills": "Factures", "rallyBudgets": "Budgets", "rallyAlerts": "Alertes", "rallySeeAll": "TOUT AFFICHER", "rallyFinanceLeft": "RESTANTS", "rallyTitleOverview": "APERÇU", "shrineProductShoulderRollsTee": "T-shirt", "shrineNextButtonCaption": "SUIVANT", "rallyTitleBudgets": "BUDGETS", "rallyTitleSettings": "PARAMÈTRES", "rallyLoginLoginToRally": "Se connecter à Rally", "rallyLoginNoAccount": "Vous n'avez pas de compte ?", "rallyLoginSignUp": "S'INSCRIRE", "rallyLoginUsername": "Nom d'utilisateur", "rallyLoginPassword": "Mot de passe", "rallyLoginLabelLogin": "Se connecter", "rallyLoginRememberMe": "Mémoriser", "rallyLoginButtonLogin": "SE CONNECTER", "rallyAlertsMessageHeadsUpShopping": "Pour information, vous avez utilisé {percent} de votre budget de courses ce mois-ci.", "rallyAlertsMessageSpentOnRestaurants": "Vous avez dépensé {amount} en restaurants cette semaine.", "rallyAlertsMessageATMFees": "Vos frais liés à l'utilisation de distributeurs de billets s'élèvent à {amount} ce mois-ci", "rallyAlertsMessageCheckingAccount": "Bravo ! Le montant sur votre compte courant est {percent} plus élevé que le mois dernier.", "shrineMenuCaption": "MENU", "shrineCategoryNameAll": "TOUT", "shrineCategoryNameAccessories": "ACCESSOIRES", "shrineCategoryNameClothing": "VÊTEMENTS", "shrineCategoryNameHome": "MAISON", "shrineLoginUsernameLabel": "Nom d'utilisateur", "shrineLoginPasswordLabel": "Mot de passe", "shrineCancelButtonCaption": "ANNULER", "shrineCartTaxCaption": "Taxes :", "shrineCartPageCaption": "PANIER", "shrineProductQuantity": "Quantité : {quantity}", "shrineProductPrice": "x {price}", "shrineCartItemCount": "{quantity,plural,=0{AUCUN ARTICLE}=1{1 ARTICLE}other{{quantity} ARTICLES}}", "shrineCartClearButtonCaption": "VIDER LE PANIER", "shrineCartTotalCaption": "TOTAL", "shrineCartSubtotalCaption": "Sous-total :", "shrineCartShippingCaption": "Frais de port :", "shrineProductGreySlouchTank": "Débardeur gris", "shrineProductStellaSunglasses": "Lunettes de soleil Stella", "shrineProductWhitePinstripeShirt": "Chemise blanche à fines rayures", "demoTextFieldWhereCanWeReachYou": "Où pouvons-nous vous joindre ?", "settingsTextDirectionLTR": "De gauche à droite", "settingsTextScalingLarge": "Grande", "demoBottomSheetHeader": "En-tête", "demoBottomSheetItem": "Article {value}", "demoBottomTextFieldsTitle": "Champs de texte", "demoTextFieldTitle": "Champs de texte", "demoTextFieldSubtitle": "Une seule ligne de texte et de chiffres modifiables", "demoTextFieldDescription": "Les champs de texte permettent aux utilisateurs de saisir du texte dans une interface utilisateur. Ils figurent généralement dans des formulaires et des boîtes de dialogue.", "demoTextFieldShowPasswordLabel": "Afficher le mot de passe", "demoTextFieldHidePasswordLabel": "Masquer le mot de passe", "demoTextFieldFormErrors": "Veuillez corriger les erreurs en rouge avant de réessayer.", "demoTextFieldNameRequired": "Veuillez indiquer votre nom.", "demoTextFieldOnlyAlphabeticalChars": "Veuillez ne saisir que des caractères alphabétiques.", "demoTextFieldEnterUSPhoneNumber": "(###) ###-#### - Saisissez un numéro de téléphone américain.", "demoTextFieldEnterPassword": "Veuillez saisir un mot de passe.", "demoTextFieldPasswordsDoNotMatch": "Les mots de passe sont différents", "demoTextFieldWhatDoPeopleCallYou": "Comment vous appelle-t-on ?", "demoTextFieldNameField": "Nom*", "demoBottomSheetButtonText": "AFFICHER LA PAGE DE CONTENU EN BAS DE L'ÉCRAN", "demoTextFieldPhoneNumber": "Numéro de téléphone*", "demoBottomSheetTitle": "Page de contenu en bas de l'écran", "demoTextFieldEmail": "Adresse e-mail", "demoTextFieldTellUsAboutYourself": "Parlez-nous de vous (par exemple, indiquez ce que vous faites ou quels sont vos loisirs)", "demoTextFieldKeepItShort": "Soyez bref, il s'agit juste d'une démonstration.", "starterAppGenericButton": "BOUTON", "demoTextFieldLifeStory": "Récit de vie", "demoTextFieldSalary": "Salaire", "demoTextFieldUSD": "USD", "demoTextFieldNoMoreThan": "Huit caractères maximum.", "demoTextFieldPassword": "Mot de passe*", "demoTextFieldRetypePassword": "Confirmer votre mot de passe*", "demoTextFieldSubmit": "ENVOYER", "demoBottomNavigationSubtitle": "Barre de navigation inférieure avec vues en fondu enchaîné", "demoBottomSheetAddLabel": "Ajouter", "demoBottomSheetModalDescription": "Une page de contenu flottante qui s'affiche depuis le bas de l'écran offre une alternative à un menu ou à une boîte de dialogue. Elle empêche l'utilisateur d'interagir avec le reste de l'application.", "demoBottomSheetModalTitle": "Page de contenu flottante en bas de l'écran", "demoBottomSheetPersistentDescription": "Une page de contenu fixe en bas de l'écran affiche des informations qui complètent le contenu principal de l'application. Elle reste visible même lorsque l'utilisateur interagit avec d'autres parties de l'application.", "demoBottomSheetPersistentTitle": "Page de contenu fixe en bas de l'écran", "demoBottomSheetSubtitle": "Pages de contenu flottantes et fixes en bas de l'écran", "demoTextFieldNameHasPhoneNumber": "Le numéro de téléphone de {name} est le {phoneNumber}", "buttonText": "BOUTON", "demoTypographyDescription": "Définition des différents styles typographiques de Material Design.", "demoTypographySubtitle": "Tous les styles de texte prédéfinis", "demoTypographyTitle": "Typographie", "demoFullscreenDialogDescription": "La propriété \"fullscreenDialog\" indique si la page demandée est une boîte de dialogue modale en plein écran", "demoFlatButtonDescription": "Un bouton plat présente une tache de couleur lorsque l'on appuie dessus, mais ne se relève pas. Utilisez les boutons plats sur la barre d'outils, dans les boîtes de dialogue et intégrés à la marge intérieure", "demoBottomNavigationDescription": "Les barres de navigation inférieures affichent trois à cinq destinations au bas de l'écran. Chaque destination est représentée par une icône et un libellé facultatif. Lorsque l'utilisateur appuie sur une de ces icônes, il est redirigé vers la destination de premier niveau associée à cette icône.", "demoBottomNavigationSelectedLabel": "Libellé sélectionné", "demoBottomNavigationPersistentLabels": "Libellés fixes", "starterAppDrawerItem": "Article {value}", "demoTextFieldRequiredField": "* Champ obligatoire", "demoBottomNavigationTitle": "Barre de navigation inférieure", "settingsLightTheme": "Clair", "settingsTheme": "Thème", "settingsPlatformIOS": "iOS", "settingsPlatformAndroid": "Android", "settingsTextDirectionRTL": "De droite à gauche", "settingsTextScalingHuge": "Très grande", "cupertinoButton": "Bouton", "settingsTextScalingNormal": "Normale", "settingsTextScalingSmall": "Petite", "settingsSystemDefault": "Système", "settingsTitle": "Paramètres", "rallyDescription": "Une application financière personnelle", "aboutDialogDescription": "Pour voir le code source de cette application, veuillez consulter le {repoLink}.", "bottomNavigationCommentsTab": "Commentaires", "starterAppGenericBody": "Corps", "starterAppGenericHeadline": "Titre", "starterAppGenericSubtitle": "Sous-titre", "starterAppGenericTitle": "Titre", "starterAppTooltipSearch": "Rechercher", "starterAppTooltipShare": "Partager", "starterAppTooltipFavorite": "Ajouter aux favoris", "starterAppTooltipAdd": "Ajouter", "bottomNavigationCalendarTab": "Agenda", "starterAppDescription": "Une mise en page réactive", "starterAppTitle": "Application de base", "aboutFlutterSamplesRepo": "Dépôt GitHub avec des exemples Flutter", "bottomNavigationContentPlaceholder": "Espace réservé pour l'onglet \"{title}\"", "bottomNavigationCameraTab": "Caméra", "bottomNavigationAlarmTab": "Alarme", "bottomNavigationAccountTab": "Compte", "demoTextFieldYourEmailAddress": "Votre adresse e-mail", "demoToggleButtonDescription": "Vous pouvez utiliser des boutons d'activation pour regrouper des options associées. Pour mettre en avant des boutons d'activation associés, un groupe doit partager un conteneur commun", "colorsGrey": "GRIS", "colorsBrown": "MARRON", "colorsDeepOrange": "ORANGE FONCÉ", "colorsOrange": "ORANGE", "colorsAmber": "AMBRE", "colorsYellow": "JAUNE", "colorsLime": "VERT CITRON", "colorsLightGreen": "VERT CLAIR", "colorsGreen": "VERT", "homeHeaderGallery": "Galerie", "homeHeaderCategories": "Catégories", "shrineDescription": "Une application tendance de vente au détail", "craneDescription": "Une application de voyage personnalisée", "homeCategoryReference": "STYLES ET AUTRES", "demoInvalidURL": "Impossible d'afficher l'URL :", "demoOptionsTooltip": "Options", "demoInfoTooltip": "Informations", "demoCodeTooltip": "Code de démonstration", "demoDocumentationTooltip": "Documentation relative aux API", "demoFullscreenTooltip": "Plein écran", "settingsTextScaling": "Mise à l'échelle du texte", "settingsTextDirection": "Orientation du texte", "settingsLocale": "Paramètres régionaux", "settingsPlatformMechanics": "Mécanique des plates-formes", "settingsDarkTheme": "Sombre", "settingsSlowMotion": "Ralenti", "settingsAbout": "À propos de la galerie Flutter", "settingsFeedback": "Envoyer des commentaires", "settingsAttribution": "Conçu par TOASTER à Londres", "demoButtonTitle": "Boutons", "demoButtonSubtitle": "Bouton de texte, bouton surélevé, bouton avec contours, etc.", "demoFlatButtonTitle": "Bouton plat", "demoRaisedButtonDescription": "Ces boutons ajoutent du relief aux présentations le plus souvent plates. Ils mettent en avant des fonctions lorsque l'espace est grand ou chargé.", "demoRaisedButtonTitle": "Bouton en relief", "demoOutlineButtonTitle": "Bouton avec contours", "demoOutlineButtonDescription": "Les boutons avec contours deviennent opaques et se relèvent lorsqu'on appuie dessus. Ils sont souvent associés à des boutons en relief pour indiquer une action secondaire alternative.", "demoToggleButtonTitle": "Boutons d'activation", "colorsTeal": "TURQUOISE", "demoFloatingButtonTitle": "Bouton d'action flottant", "demoFloatingButtonDescription": "Un bouton d'action flottant est une icône circulaire qui s'affiche au-dessus d'un contenu dans le but d'encourager l'utilisateur à effectuer une action principale dans l'application.", "demoDialogTitle": "Boîtes de dialogue", "demoDialogSubtitle": "Simple, alerte et plein écran", "demoAlertDialogTitle": "Alerte", "demoAlertDialogDescription": "Une boîte de dialogue d'alerte informe lorsqu'une confirmation de lecture est nécessaire. Elle peut présenter un titre et une liste d'actions.", "demoAlertTitleDialogTitle": "Alerte avec son titre", "demoSimpleDialogTitle": "Simple", "demoSimpleDialogDescription": "Une boîte de dialogue simple donne à l'utilisateur le choix entre plusieurs options. Elle peut comporter un titre qui s'affiche au-dessus des choix.", "demoFullscreenDialogTitle": "Plein écran", "demoCupertinoButtonsTitle": "Boutons", "demoCupertinoButtonsSubtitle": "Boutons de style iOS", "demoCupertinoButtonsDescription": "Un bouton de style iOS. Il prend la forme d'un texte et/ou d'une icône qui s'affiche ou disparaît simplement en appuyant dessus. Il est possible d'y ajouter un arrière-plan.", "demoCupertinoAlertsTitle": "Alertes", "demoCupertinoAlertsSubtitle": "Boîtes de dialogue d'alerte de style iOS", "demoCupertinoAlertTitle": "Alerte", "demoCupertinoAlertDescription": "Une boîte de dialogue d'alerte informe lorsqu'une confirmation de lecture est nécessaire. Elle peut présenter un titre, un contenu et une liste d'actions. Le titre s'affiche au-dessus du contenu, et les actions s'affichent quant à elles sous le contenu.", "demoCupertinoAlertWithTitleTitle": "Alerte avec son titre", "demoCupertinoAlertButtonsTitle": "Alerte avec des boutons", "demoCupertinoAlertButtonsOnlyTitle": "Boutons d'alerte uniquement", "demoCupertinoActionSheetTitle": "Feuille d'action", "demoCupertinoActionSheetDescription": "Une feuille d'action est un style d'alertes spécifique qui présente à l'utilisateur un groupe de deux choix ou plus en rapport avec le contexte à ce moment précis. Elle peut comporter un titre, un message complémentaire et une liste d'actions.", "demoColorsTitle": "Couleurs", "demoColorsSubtitle": "Toutes les couleurs prédéfinies", "demoColorsDescription": "Constantes de couleurs et du sélecteur de couleurs représentant la palette de couleurs du Material Design.", "buttonTextEnabled": "ENABLED", "buttonTextDisabled": "DISABLED", "buttonTextCreate": "Créer", "dialogSelectedOption": "Vous avez sélectionné : \"{value}\"", "dialogDiscardTitle": "Supprimer le brouillon ?", "dialogLocationTitle": "Utiliser le service de localisation Google ?", "dialogLocationDescription": "Autoriser Google à aider les applications à déterminer votre position. Cela signifie que des données de localisation anonymes sont envoyées à Google, même si aucune application n'est en cours d'exécution.", "dialogCancel": "ANNULER", "dialogDiscard": "SUPPRIMER", "dialogDisagree": "REFUSER", "dialogAgree": "ACCEPTER", "dialogSetBackup": "Définir un compte de sauvegarde", "colorsBlueGrey": "GRIS-BLEU", "dialogShow": "AFFICHER LA BOÎTE DE DIALOGUE", "dialogFullscreenTitle": "Boîte de dialogue en plein écran", "dialogFullscreenSave": "ENREGISTRER", "dialogFullscreenDescription": "Une boîte de dialogue en plein écran de démonstration", "cupertinoButtonEnabled": "Enabled", "cupertinoButtonDisabled": "Disabled", "cupertinoButtonWithBackground": "Avec un arrière-plan", "cupertinoAlertCancel": "Annuler", "cupertinoAlertDiscard": "Supprimer", "cupertinoAlertLocationTitle": "Autoriser \"Maps\" à accéder à votre position lorsque vous utilisez l'application ?", "cupertinoAlertLocationDescription": "Votre position actuelle sera affichée sur la carte et utilisée pour vous fournir des itinéraires, des résultats de recherche à proximité et des estimations de temps de trajet.", "cupertinoAlertAllow": "Autoriser", "cupertinoAlertDontAllow": "Ne pas autoriser", "cupertinoAlertFavoriteDessert": "Sélectionner un dessert préféré", "cupertinoAlertDessertDescription": "Veuillez sélectionner votre type de dessert préféré dans la liste ci-dessous. Votre choix sera utilisé pour personnaliser la liste des restaurants recommandés dans votre région.", "cupertinoAlertCheesecake": "Cheesecake", "cupertinoAlertTiramisu": "Tiramisu", "cupertinoAlertApplePie": "Tarte aux pommes", "cupertinoAlertChocolateBrownie": "Brownie au chocolat", "cupertinoShowAlert": "Afficher l'alerte", "colorsRed": "ROUGE", "colorsPink": "ROSE", "colorsPurple": "VIOLET", "colorsDeepPurple": "VIOLET FONCÉ", "colorsIndigo": "INDIGO", "colorsBlue": "BLEU", "colorsLightBlue": "BLEU CLAIR", "colorsCyan": "CYAN", "dialogAddAccount": "Ajouter un compte", "Gallery": "Galerie", "Categories": "Catégories", "SHRINE": "SHRINE", "Basic shopping app": "Application de shopping simple", "RALLY": "RALLY", "CRANE": "CRANE", "Travel app": "Application de voyage", "MATERIAL": "MATERIAL", "CUPERTINO": "CUPERTINO", "REFERENCE STYLES & MEDIA": "STYLES ET MÉDIAS DE RÉFÉRENCE" }
gallery/lib/l10n/intl_fr.arb/0
{ "file_path": "gallery/lib/l10n/intl_fr.arb", "repo_id": "gallery", "token_count": 19464 }
889
{ "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": "Контекстік мәзірді көру үшін 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": "Қолданбаның оң немесе сол жағында көрсетіліп, аздаған көріністер арасында (әдетте 3-5) өтуге арналған материалдық виджет.", "demoNavigationRailFirst": "Бірінші", "demoNavigationDrawerTitle": "Навигация тартпасы", "demoNavigationRailThird": "Үшінші", "replyStarredLabel": "Жұлдызшалы", "demoTextButtonDescription": "\"Мәтін\" түймесін басқан кезде, ол көтерілмейді. Бірақ экранға сия дағы шығады. \"Мәтін\" түймелерін құралдар тақталарында, диалогтік терезелерде және шегініс қолданылған мәтінде пайдаланыңыз.", "demoElevatedButtonTitle": "Көтеріңкі түйме", "demoElevatedButtonDescription": "Көтеріңкі түймелер тегіс форматтағы контентдарға көлем береді. Олар контент тығыз не сирек орналасқан кезде функцияларды ерекшелеу үшін қолданылады.", "demoOutlinedButtonTitle": "Контурлы түйме", "demoOutlinedButtonDescription": "Контурлы түймелер күңгірт болады және оларды басқан кезде көтеріледі. Олар көбіне көтеріңкі түймелермен жұптасып, балама және қосымша әрекетті көрсетеді.", "demoContainerTransformDemoInstructions": "Карталар, Тізімдер және Қалқымалы әрекет түймелері", "demoNavigationDrawerSubtitle": "Қолданба жолағындағы тартпа көрсетілуде", "replyDescription": "Өнімді әрі нақты электрондық пошта қолданбасы", "demoNavigationDrawerDescription": "Қолданбада навигация сілтемелерін көрсету үшін экран шетінен көлденеңінен жылжытылатын Material Design панелі.", "replyDraftsLabel": "Жоба жазбалар", "demoNavigationDrawerToPageOne": "Бірінші элемент", "replyInboxLabel": "\"Кіріс\" қалтасы", "demoSharedXAxisDemoInstructions": "\"Келесі\" және \"Артқа\" түймелері", "replySpamLabel": "Спам", "replyTrashLabel": "Себет", "replySentLabel": "Жіберілді", "demoNavigationRailSecond": "Екінші", "demoNavigationDrawerToPageTwo": "Екінші элемент", "demoFadeScaleDemoInstructions": "Модальдік және қалқымалы әрекет түймелері", "demoFadeThroughDemoInstructions": "Төменгі навигация", "demoSharedZAxisDemoInstructions": "Параметрлер белгішесі түймесі", "demoSharedYAxisDemoInstructions": "\"Соңғы ойнатылған\" бойынша сұрыптау", "demoTextButtonTitle": "\"Мәтін\" түймесі", "demoSharedZAxisBeefSandwichRecipeTitle": "Сиыр етінен жасалған сэндвич", "demoSharedZAxisDessertRecipeDescription": "Десерт рецепті", "demoSharedYAxisAlbumTileSubtitle": "Орындаушы", "demoSharedYAxisAlbumTileTitle": "Альбом", "demoSharedYAxisRecentSortTitle": "Соңғы ойнатылған", "demoSharedYAxisAlphabeticalSortTitle": "А-Я", "demoSharedYAxisAlbumCount": "268 альбом", "demoSharedYAxisTitle": "Ортақ y осі", "demoSharedXAxisCreateAccountButtonText": "АККАУНТ ЖАСАУ", "demoFadeScaleAlertDialogDiscardButton": "ЖАБУ", "demoSharedXAxisSignInTextFieldLabel": "Электрондық пошта немесе телефон нөмірі", "demoSharedXAxisSignInSubtitleText": "Аккаунтыңызбен кіріңіз.", "demoSharedXAxisSignInWelcomeText": "Сәлеметсіз бе, Дэвид Парк!", "demoSharedXAxisIndividualCourseSubtitle": "Жеке-жеке көрсетіледі.", "demoSharedXAxisBundledCourseSubtitle": "Жинақталған", "demoFadeThroughAlbumsDestination": "Aльбомдар", "demoSharedXAxisDesignCourseTitle": "Дизайн", "demoSharedXAxisIllustrationCourseTitle": "Сурет", "demoSharedXAxisBusinessCourseTitle": "Бизнес", "demoSharedXAxisArtsAndCraftsCourseTitle": "Өнер және қолөнер", "demoMotionPlaceholderSubtitle": "Қосымша мәтін", "demoFadeScaleAlertDialogCancelButton": "БАС ТАРТУ", "demoFadeScaleAlertDialogHeader": "Ескерту туралы диалогтік терезе", "demoFadeScaleHideFabButton": "БЛОКТЫ ЖАСЫРУ", "demoFadeScaleShowFabButton": "БЛОКТЫ КӨРСЕТУ", "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": "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": "Акциялар", "rallyBillDetailTotalAmount": "Жалпы сома", "demoCupertinoPickerDateTime": "Күн және уақыт", "signIn": "КІРУ", "dataTableRowWithSugar": "{value} қант", "dataTableRowApplePie": "Алма бәліші", "dataTableRowDonut": "Бәліш", "dataTableRowHoneycomb": "Honeycomb", "dataTableRowLollipop": "Мұз кәмпит", "dataTableRowJellyBean": "Желе кәмпиттер", "dataTableRowGingerbread": "Gingerbread", "dataTableRowCupcake": "Кекс", "dataTableRowEclair": "Эклер", "dataTableRowIceCreamSandwich": "Ice cream sandwich", "dataTableRowFrozenYogurt": "Мұздатылған иогурт", "dataTableColumnIron": "Темір (%)", "dataTableColumnCalcium": "Кальций (%)", "dataTableColumnSodium": "Натрий (мг)", "demoTimePickerTitle": "Уақыт таңдағыш", "demo2dTransformationsResetTooltip": "Түрлендірулерді бастапқы күйге қайтару", "dataTableColumnFat": "Май (г)", "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": "2D түрлендірулер", "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": "Ақуыз (г)", "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": "Қолданбаның бос емес екенін көрсету үшін айналып тұратын Material Design шеңбер түріндегі орындалу индикаторы.", "demoMenuFour": "Төрт", "demoLinearProgressIndicatorDescription": "Material Design сызықтық орындалу индикаторы сондай-ақ орындалу жолағы деп те аталады.", "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": "Mәзір", "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": "Күн батқан кездегі Әл-Азхар мешітінің мұнаралары", "craneFly9SemanticLabel": "Ескі көк автокөлікке сүйеніп тұрған ер адам", "craneFly8SemanticLabel": "Суперағаштар орманы", "craneEat9SemanticLabel": "Кафедегі тоқаштар қойылған сөре", "craneEat2SemanticLabel": "Бургер", "craneFly5SemanticLabel": "Таулар алдындағы көл жағасындағы қонақ үй", "demoSelectionControlsSubtitle": "Құсбелгі ұяшықтары, ауыстырып қосқыштар және ауыстырғыштар", "craneEat10SemanticLabel": "Пастрами қосылған үлкен сэндвичті ұстаған әйел", "craneFly4SemanticLabel": "Су үстіндегі бунгалолар", "craneEat7SemanticLabel": "Наубайхана есігі", "craneEat6SemanticLabel": "Асшаян тағамы", "craneEat5SemanticLabel": "Artsy мейрамханасының демалыс орны", "craneEat4SemanticLabel": "Шоколад десерті", "craneEat3SemanticLabel": "Корей такосы", "craneFly3SemanticLabel": "Мачу-пикчу цитаделі", "craneEat1SemanticLabel": "Дөңгелек орындықтар қойылған бос бар", "craneEat0SemanticLabel": "Ағаш жағылатын пештегі пицца", "craneSleep11SemanticLabel": "Тайбэй 101 зәулім үйі", "craneSleep10SemanticLabel": "Күн батқан кездегі Әл-Азхар мешітінің мұнаралары", "craneSleep9SemanticLabel": "Теңіз жағалауындағы кірпіш шамшырақ", "craneEat8SemanticLabel": "Шаян салынған тәрелке", "craneSleep7SemanticLabel": "Рибейра алаңындағы түрлі түсті үйлер", "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": "Әсем өнерлер сарайының үстінен көрінісі", "rallySeeAllAccounts": "Барлық аккаунттарды көру", "rallyBillAmount": "{amount} сомасындағы {billName} төлемі {date} күні төленуі керек.", "shrineTooltipCloseCart": "Себетті жабу", "shrineTooltipCloseMenu": "Мәзірді жабу", "shrineTooltipOpenMenu": "Мәзірді ашу", "shrineTooltipSettings": "Параметрлер", "shrineTooltipSearch": "Іздеу", "demoTabsDescription": "Қойындылар түрлі экрандардағы, деректер жинағындағы және тағы басқа өзара қатынастардағы контентті реттейді.", "demoTabsSubtitle": "Жеке айналмалы көріністері бар қойындылар", "demoTabsTitle": "Қойындылар", "rallyBudgetAmount": "{budgetName} бюджеті: пайдаланылғаны: {amountUsed}/{amountTotal}, қалғаны: {amountLeft}", "shrineTooltipRemoveItem": "Элементті өшіру", "rallyAccountAmount": "{accountNumber} нөмірлі {accountName} банк шотында {amount} сома бар.", "rallySeeAllBudgets": "Барлық бюджеттерді көру", "rallySeeAllBills": "Барлық төлемдерді көру", "craneFormDate": "Күнді таңдау", "craneFormOrigin": "Жөнелу орнын таңдаңыз", "craneFly2": "Кхумбу, Непал", "craneFly3": "Мачу-Пикчу, Перу", "craneFly4": "Мале, Мальдив аралдары", "craneFly5": "Вицнау, Швейцария", "craneFly6": "Мехико, Мексика", "craneFly7": "Рашмор, АҚШ", "settingsTextDirectionLocaleBased": "Тіл негізінде", "craneFly9": "Гавана, Куба", "craneFly10": "Каир, Мысыр", "craneFly11": "Лиссабон, Португалия", "craneFly12": "Напа, АҚШ", "craneFly13": "Бали, Индонезия", "craneSleep0": "Мале, Мальдив аралдары", "craneSleep1": "Аспен, АҚШ", "craneSleep2": "Мачу-Пикчу, Перу", "demoCupertinoSegmentedControlTitle": "Cегменттелген басқару", "craneSleep4": "Вицнау, Швейцария", "craneSleep5": "Биг-Сур, АҚШ", "craneSleep6": "Напа, АҚШ", "craneSleep7": "Порту, Потугалия", "craneSleep8": "Тулум, Мексика", "craneEat5": "Сеул, Оңтүстік Корея", "demoChipTitle": "Чиптер", "demoChipSubtitle": "Енгізуді, атрибутты немесе әрекетті көрсететін шағын элементтер", "demoActionChipTitle": "Әрекет чипі", "demoActionChipDescription": "Әрекет чиптері — негізгі контентке қатысты әрекетті іске қосатын параметрлер жиынтығы. Олар пайдаланушы интерфейсінде динамикалық және контекстік күйде көрсетілуі керек.", "demoChoiceChipTitle": "Таңдау чипі", "demoChoiceChipDescription": "Таңдау чиптері жиынтықтан бір таңдауды көрсетеді. Оларда сипаттайтын мәтін немесе санаттар болады.", "demoFilterChipTitle": "Сүзгі чипі", "demoFilterChipDescription": "Cүзгі чиптері контентті сүзу үшін тэгтер немесе сипаттаушы сөздер пайдаланады.", "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": "Былғары белдік", "shrineProductGardenStrand": "Гүлдерден жасалған моншақ", "shrineProductStrutEarrings": "Дөңгелек пішінді сырғалар", "shrineProductVarsitySocks": "Спорттық шұлықтар", "shrineProductWeaveKeyring": "Өрілген салпыншақ", "shrineProductGatsbyHat": "Гэтсби стиліндегі шляпа", "shrineProductShrugBag": "Хобо сөмкесі", "shrineProductGiltDeskTrio": "Үстелдер жиынтығы", "shrineProductCopperWireRack": "Мыс сымнан тоқылған себет", "shrineProductSootheCeramicSet": "Керамика ыдыс-аяқтар жиынтығы", "shrineProductHurrahsTeaSet": "Hurrahs шай сервизі", "shrineProductBlueStoneMug": "Көк саптыаяқ", "shrineProductRainwaterTray": "Жаңбырдың суы ағатын науа", "shrineProductChambrayNapkins": "Шүберек майлықтар", "shrineProductSucculentPlanters": "Суккуленттер", "shrineProductQuartetTable": "Төртбұрышты үстел", "shrineProductKitchenQuattro": "Quattro ас үйі", "shrineProductClaySweater": "Ақшыл сары свитер", "shrineProductSeaTunic": "Жеңіл туника", "shrineProductPlasterTunic": "Ақшыл сары туника", "rallyBudgetCategoryRestaurants": "Мейрамханалар", "shrineProductChambrayShirt": "Шамбре жейде", "shrineProductSeabreezeSweater": "Көкшіл свитер", "shrineProductGentryJacket": "Джентри стиліндегі күртке", "shrineProductNavyTrousers": "Қысқа балақ шалбарлар", "shrineProductWalterHenleyWhite": "Жеңіл ақ кофта", "shrineProductSurfAndPerfShirt": "Көкшіл жасыл футболка", "shrineProductGingerScarf": "Зімбір түсті мойынорағыш", "shrineProductRamonaCrossover": "Қаусырмалы блузка", "shrineProductClassicWhiteCollar": "Классикалық ақ жаға", "shrineProductSunshirtDress": "Жаздық көйлек", "rallyAccountDetailDataInterestRate": "Пайыздық мөлшерлеме", "rallyAccountDetailDataAnnualPercentageYield": "Жылдық пайыздық көрсеткіш", "rallyAccountDataVacation": "Демалыс", "shrineProductFineLinesTee": "Жолақты футболка", "rallyAccountDataHomeSavings": "Үй алуға арналған жинақ", "rallyAccountDataChecking": "Банк шоты", "rallyAccountDetailDataInterestPaidLastYear": "Өткен жылы төленген пайыз", "rallyAccountDetailDataNextStatement": "Келесі үзінді", "rallyAccountDetailDataAccountOwner": "Аккаунт иесі", "rallyBudgetCategoryCoffeeShops": "Кофеханалар", "rallyBudgetCategoryGroceries": "Азық-түлік", "shrineProductCeriseScallopTee": "Қызғылт сары футболка", "rallyBudgetCategoryClothing": "Киім", "rallySettingsManageAccounts": "Аккаунттарды басқару", "rallyAccountDataCarSavings": "Көлік алуға арналған жинақ", "rallySettingsTaxDocuments": "Салық құжаттары", "rallySettingsPasscodeAndTouchId": "Рұқсат коды және Touch ID", "rallySettingsNotifications": "Хабарландырулар", "rallySettingsPersonalInformation": "Жеке ақпарат", "rallySettingsPaperlessSettings": "Виртуалдық реттеулер", "rallySettingsFindAtms": "Банкоматтар табу", "rallySettingsHelp": "Анықтама", "rallySettingsSignOut": "Шығу", "rallyAccountTotal": "Барлығы", "rallyBillsDue": "Төленетін сома:", "rallyBudgetLeft": "Қалды", "rallyAccounts": "Аккаунттар", "rallyBills": "Шоттар", "rallyBudgets": "Бюджеттер", "rallyAlerts": "Ескертулер", "rallySeeAll": "БАРЛЫҒЫН КӨРУ", "rallyFinanceLeft": "ҚАЛДЫ", "rallyTitleOverview": "ШОЛУ", "shrineProductShoulderRollsTee": "Кең жеңді футболка", "shrineNextButtonCaption": "КЕЛЕСІ", "rallyTitleBudgets": "БЮДЖЕТТЕР", "rallyTitleSettings": "ПАРАМЕТРЛЕР", "rallyLoginLoginToRally": "Rally-ге кіру", "rallyLoginNoAccount": "Аккаунтыңыз жоқ па?", "rallyLoginSignUp": "ТІРКЕЛУ", "rallyLoginUsername": "Пайдаланушы аты", "rallyLoginPassword": "Құпия сөз", "rallyLoginLabelLogin": "Кіру", "rallyLoginRememberMe": "Мені есте сақтасын.", "rallyLoginButtonLogin": "КІРУ", "rallyAlertsMessageHeadsUpShopping": "Назар аударыңыз! Осы айға арналған сауда-саттық бюджетінің {percent} жұмсап қойдыңыз.", "rallyAlertsMessageSpentOnRestaurants": "Осы аптада мейрамханаларға {amount} жұмсадыңыз.", "rallyAlertsMessageATMFees": "Осы айда банкоматтардың комиссиялық алымына {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": "СОЛДАН ОҢҒА", "settingsTextScalingLarge": "Үлкен", "demoBottomSheetHeader": "Тақырып", "demoBottomSheetItem": "{value}", "demoBottomTextFieldsTitle": "Мәтін өрістері", "demoTextFieldTitle": "Мәтін өрістері", "demoTextFieldSubtitle": "Мәтін мен сандарды өңдеуге арналған жалғыз сызық", "demoTextFieldDescription": "Мәтін өрістері арқылы пайдаланушы интерфейсіне мәтін енгізуге болады. Әдетте олар үлгілер мен диалогтік терезелерге шығады.", "demoTextFieldShowPasswordLabel": "Құпия сөзді көрсету", "demoTextFieldHidePasswordLabel": "Құпия сөзді жасыру", "demoTextFieldFormErrors": "Жібермес бұрын қызылмен берілген қателерді түзетіңіз.", "demoTextFieldNameRequired": "Аты-жөніңізді енгізіңіз.", "demoTextFieldOnlyAlphabeticalChars": "Тек әріптер енгізіңіз.", "demoTextFieldEnterUSPhoneNumber": "(###) ###-#### – АҚШ телефон нөмірін енгізіңіз.", "demoTextFieldEnterPassword": "Құпия сөзді енгізіңіз.", "demoTextFieldPasswordsDoNotMatch": "Құпия сөздер сәйкес емес.", "demoTextFieldWhatDoPeopleCallYou": "Адамдар сізді қалай атайды?", "demoTextFieldNameField": "Аты*", "demoBottomSheetButtonText": "ТӨМЕНГІ ПАРАҚШАНЫ КӨРСЕТУ", "demoTextFieldPhoneNumber": "Телефон нөмірі*", "demoBottomSheetTitle": "Төменгі парақша", "demoTextFieldEmail": "Электрондық пошта", "demoTextFieldTellUsAboutYourself": "Өзіңіз туралы айтып беріңіз (мысалы, немен айналысасыз немесе хоббиіңіз қандай).", "demoTextFieldKeepItShort": "Қысқаша жазыңыз. Бұл – жай демо нұсқа.", "starterAppGenericButton": "ТҮЙМЕ", "demoTextFieldLifeStory": "Өмірбаян", "demoTextFieldSalary": "Жалақы", "demoTextFieldUSD": "АҚШ доллары", "demoTextFieldNoMoreThan": "8 таңбадан артық емес.", "demoTextFieldPassword": "Құпия сөз*", "demoTextFieldRetypePassword": "Құпия сөзді қайта теріңіз*", "demoTextFieldSubmit": "ЖІБЕРУ", "demoBottomNavigationSubtitle": "Біртіндеп күңгірттелген төменгі навигация", "demoBottomSheetAddLabel": "Қосу", "demoBottomSheetModalDescription": "Модальдік төменгі парақшаны мәзірдің немесе диалогтік терезенің орнына пайдалануға болады. Бұл парақша ашық кезде, пайдаланушы қолданбаның басқа бөлімдеріне өте алмайды.", "demoBottomSheetModalTitle": "Модальдік төменгі парақша", "demoBottomSheetPersistentDescription": "Тұрақты төменгі парақшада қолданбаның негізгі бөлімдеріне қосымша ақпарат көрсетіледі. Пайдаланушы басқа бөлімдерді пайдаланғанда да, мұндай парақша әрдайым экранның төменгі жағында тұрады.", "demoBottomSheetPersistentTitle": "Тұрақты төменгі парақша", "demoBottomSheetSubtitle": "Тұрақты және модальдік төменгі парақшалар", "demoTextFieldNameHasPhoneNumber": "{name}: {phoneNumber}", "buttonText": "ТҮЙМЕ", "demoTypographyDescription": "Material Design-дағы түрлі стильдердің анықтамалары бар.", "demoTypographySubtitle": "Алдын ала анықталған мәтін стильдері", "demoTypographyTitle": "Типография", "demoFullscreenDialogDescription": "fullscreenDialog сипаты кіріс бетінің толық экранды модальдік диалогтік терезе екенін анықтайды.", "demoFlatButtonDescription": "Тегіс түймені басқан кезде, ол көтерілмейді. Бірақ экранға сия дағы шығады. Тегіс түймелерді аспаптар тақтасында, диалогтік терезелерде және шегініс қолданылған мәтінде пайдаланыңыз.", "demoBottomNavigationDescription": "Төменгі навигация жолағына үштен беске дейін бөлім енгізуге болады. Әр бөлімнің белгішесі және мәтіні (міндетті емес) болады. Пайдаланушы осы белгішелердің біреуін түртсе, сәйкес бөлімге өтеді.", "demoBottomNavigationSelectedLabel": "Таңдалған белгі", "demoBottomNavigationPersistentLabels": "Тұрақты белгілер", "starterAppDrawerItem": "{value}", "demoTextFieldRequiredField": "* міндетті өрісті білдіреді", "demoBottomNavigationTitle": "Төменгі навигация", "settingsLightTheme": "Ашық", "settingsTheme": "Тақырып", "settingsPlatformIOS": "iOS", "settingsPlatformAndroid": "Android", "settingsTextDirectionRTL": "ОҢНАН СОЛҒА", "settingsTextScalingHuge": "Өте үлкен", "cupertinoButton": "Түйме", "settingsTextScalingNormal": "Қалыпты", "settingsTextScalingSmall": "Кішi", "settingsSystemDefault": "Жүйе", "settingsTitle": "Параметрлер", "rallyDescription": "Бюджет жоспарлауға арналған қолданба", "aboutDialogDescription": "Осы қолданбаның бастапқы кодын көру үшін {repoLink} бетін ашыңыз.\n", "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": "Oпциялар", "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": "Қолданбаны пайдаланған кезде, \"Maps\" қызметінің геодерегіңізді қолдануына рұқсат бересіз бе?", "cupertinoAlertLocationDescription": "Қазіргі геодерегіңіз картада көрсетіледі және бағыттар, маңайдағы іздеу нәтижелері және болжалды сапар уақытын анықтау үшін пайдаланылады.", "cupertinoAlertAllow": "Рұқсат беру", "cupertinoAlertDontAllow": "Рұқсат бермеу", "cupertinoAlertFavoriteDessert": "Ұнайтын десертті таңдау", "cupertinoAlertDessertDescription": "Төмендегі тізімнен өзіңізге ұнайтын десерт түрін таңдаңыз. Таңдауыңызға сәйкес аймағыңыздағы асханалардың ұсынылған тізімі реттеледі.", "cupertinoAlertCheesecake": "Чизкейк", "cupertinoAlertTiramisu": "Тирамису", "cupertinoAlertApplePie": "Алма бәліші", "cupertinoAlertChocolateBrownie": "\"Брауни\" шоколад бәліші", "cupertinoShowAlert": "Ескертуді көрсету", "colorsRed": "ҚЫЗЫЛ", "colorsPink": "ҚЫЗҒЫЛТ", "colorsPurple": "КҮЛГІН", "colorsDeepPurple": "ҚОЮ КҮЛГІН", "colorsIndigo": "ИНДИГО", "colorsBlue": "КӨК", "colorsLightBlue": "КӨГІЛДІР", "colorsCyan": "КӨКШІЛ", "dialogAddAccount": "Аккаунтты енгізу", "Gallery": "Галерея", "Categories": "Санаттар", "SHRINE": "SHRINE", "Basic shopping app": "Негізгі сауда қолданбасы", "RALLY": "РАЛЛИ", "CRANE": "CRANE", "Travel app": "Саяхат қолданбасы", "MATERIAL": "МАТЕРИАЛ", "CUPERTINO": "КУПЕРТИНО", "REFERENCE STYLES & MEDIA": "АНЫҚТАМАЛЫҚ СТИЛЬДЕР ЖӘНЕ МЕДИАМАЗМҰН" }
gallery/lib/l10n/intl_kk.arb/0
{ "file_path": "gallery/lib/l10n/intl_kk.arb", "repo_id": "gallery", "token_count": 39072 }
890
{ "loading": "Laden", "deselect": "Deselecteren", "select": "Selecteren", "selectable": "Selecteerbaar (lang indrukken)", "selected": "Geselecteerd", "demo": "Demo", "bottomAppBar": "App-balk onderaan", "notSelected": "Niet geselecteerd", "demoCupertinoSearchTextFieldTitle": "Zoektekstveld", "demoCupertinoPicker": "Kiezer", "demoCupertinoSearchTextFieldSubtitle": "Zoektekstveld in iOS-stijl", "demoCupertinoSearchTextFieldDescription": "Een zoektekstveld waarmee de gebruiker kan zoeken door tekst in te vullen en dat suggesties kan aanbieden en filteren.", "demoCupertinoSearchTextFieldPlaceholder": "Geef tekst op", "demoCupertinoScrollbarTitle": "Scrollbalk", "demoCupertinoScrollbarSubtitle": "Scrollbalk in iOS-stijl", "demoCupertinoScrollbarDescription": "Een scrollbalk die het betreffende onderliggende item verpakt", "demoTwoPaneItem": "Item {value}", "demoTwoPaneList": "Lijst", "demoTwoPaneFoldableLabel": "Opvouwbaar", "demoTwoPaneSmallScreenLabel": "Klein scherm", "demoTwoPaneSmallScreenDescription": "Dit is het gedrag van TwoPane op een apparaat met een klein scherm.", "demoTwoPaneTabletLabel": "Tablet/desktop", "demoTwoPaneTabletDescription": "Dit is het gedrag van TwoPane op een groter scherm zoals een tablet of desktop.", "demoTwoPaneTitle": "TwoPane", "demoTwoPaneSubtitle": "Responsieve lay-out op opvouwbare, grote en kleine schermen", "splashSelectDemo": "Selecteer een demo", "demoTwoPaneFoldableDescription": "Dit is het gedrag van TwoPane op een opvouwbaar apparaat.", "demoTwoPaneDetails": "Details", "demoTwoPaneSelectItem": "Selecteer een item", "demoTwoPaneItemDetails": "Details van item {value}", "demoCupertinoContextMenuActionText": "Tik op het Flutter-logo en houd dit vast om het contextmenu te zien.", "demoCupertinoContextMenuDescription": "Een contextmenu in iOS-stijl op volledig scherm dat verschijnt als een element lang wordt ingedrukt.", "demoAppBarTitle": "App-balk", "demoAppBarDescription": "De app-balk biedt content en acties voor het huidige scherm. De balk wordt gebruikt voor branding, schermtitels, navigatie en acties.", "demoDividerTitle": "Scheidingslijn", "demoDividerSubtitle": "Een scheidingslijn is een dunne lijn waarmee content wordt gegroepeerd in lijsten en indelingen.", "demoDividerDescription": "Scheidingslijnen kunnen worden gebruikt in lijsten, lades en op andere plaatsen om content te scheiden.", "demoVerticalDividerTitle": "Verticale scheidingslijn", "demoCupertinoContextMenuTitle": "Contextmenu", "demoCupertinoContextMenuSubtitle": "Contextmenu in iOS-stijl", "demoAppBarSubtitle": "Toont informatie en acties voor het huidige scherm", "demoCupertinoContextMenuActionOne": "Actie 1", "demoCupertinoContextMenuActionTwo": "Actie 2", "demoDateRangePickerDescription": "Toont een dialoogvenster met een Material Design-periodekiezer.", "demoDateRangePickerTitle": "Periodekiezer", "demoNavigationDrawerUserName": "Gebruikersnaam", "demoNavigationDrawerUserEmail": "[email protected]", "demoNavigationDrawerText": "Swipe vanaf de rand of tik op het icoon linksboven om het zijmenu weer te geven", "demoNavigationRailTitle": "Navigatierail", "demoNavigationRailSubtitle": "Een navigatierail weergeven in een app", "demoNavigationRailDescription": "Een materiaalwidget die links of rechts van een app moet worden weergegeven om te navigeren tussen een klein aantal weergaven, meestal tussen drie en vijf.", "demoNavigationRailFirst": "Eerste", "demoNavigationDrawerTitle": "Zijmenu", "demoNavigationRailThird": "Derde", "replyStarredLabel": "Met ster", "demoTextButtonDescription": "Als je op een tekstknop drukt, wordt een inktvlekeffect weergegeven, maar gaat de knop niet omhoog. Gebruik tekstknoppen op taakbalken, in dialoogvensters en inline met opvulling", "demoElevatedButtonTitle": "Verhoogde knop", "demoElevatedButtonDescription": "Verhoogde knoppen voegen een dimensie toe aan vormgevingen die voornamelijk plat zijn. Ze lichten functies uit als de achtergrond druk is of breed wordt weergegeven.", "demoOutlinedButtonTitle": "Contourknop", "demoOutlinedButtonDescription": "Contourknoppen worden ondoorzichtig en verhoogd als je ze indrukt. Ze worden vaak gekoppeld aan verhoogde knoppen om een alternatieve tweede actie aan te geven.", "demoContainerTransformDemoInstructions": "Kaarten, lijsten en FAB", "demoNavigationDrawerSubtitle": "Een zijmenu in de app-balk weergeven", "replyDescription": "Een efficiënte, gefocuste e-mail-app", "demoNavigationDrawerDescription": "Een Material Design-deelvenster dat horizontaal inschuift vanaf de rand van het scherm om navigatielinks in een app te tonen.", "replyDraftsLabel": "Concepten", "demoNavigationDrawerToPageOne": "Item één", "replyInboxLabel": "Inbox", "demoSharedXAxisDemoInstructions": "Knoppen voor volgende en terug", "replySpamLabel": "Spam", "replyTrashLabel": "Prullenbak", "replySentLabel": "Gestuurd", "demoNavigationRailSecond": "Tweede", "demoNavigationDrawerToPageTwo": "Item twee", "demoFadeScaleDemoInstructions": "Modaal venster en FAB", "demoFadeThroughDemoInstructions": "Navigatie onderaan", "demoSharedZAxisDemoInstructions": "Knop voor icoon Instellingen", "demoSharedYAxisDemoInstructions": "Sorteren op Onlangs afgespeeld", "demoTextButtonTitle": "Tekstknop", "demoSharedZAxisBeefSandwichRecipeTitle": "Sandwich met rundvlees", "demoSharedZAxisDessertRecipeDescription": "Recept voor dessert", "demoSharedYAxisAlbumTileSubtitle": "Artist", "demoSharedYAxisAlbumTileTitle": "Album", "demoSharedYAxisRecentSortTitle": "Onlangs geluisterd", "demoSharedYAxisAlphabeticalSortTitle": "A-Z", "demoSharedYAxisAlbumCount": "268 albums", "demoSharedYAxisTitle": "Gedeelde Y-as", "demoSharedXAxisCreateAccountButtonText": "ACCOUNT MAKEN", "demoFadeScaleAlertDialogDiscardButton": "NIET OPSLAAN", "demoSharedXAxisSignInTextFieldLabel": "E-mailadres of telefoonnummer", "demoSharedXAxisSignInSubtitleText": "Inloggen met je account", "demoSharedXAxisSignInWelcomeText": "Hallo David Park", "demoSharedXAxisIndividualCourseSubtitle": "Afzonderlijk getoond", "demoSharedXAxisBundledCourseSubtitle": "Gebundeld", "demoFadeThroughAlbumsDestination": "Albums", "demoSharedXAxisDesignCourseTitle": "Design", "demoSharedXAxisIllustrationCourseTitle": "Illustratie", "demoSharedXAxisBusinessCourseTitle": "Zakelijk", "demoSharedXAxisArtsAndCraftsCourseTitle": "Kunst en creatief", "demoMotionPlaceholderSubtitle": "Secundaire tekst", "demoFadeScaleAlertDialogCancelButton": "ANNULEREN", "demoFadeScaleAlertDialogHeader": "Dialoogvenster voor meldingen", "demoFadeScaleHideFabButton": "ZWEVENDE ACTIEKNOP VERBERGEN", "demoFadeScaleShowFabButton": "ZWEVENDE ACTIEKNOP TONEN", "demoFadeScaleShowAlertDialogButton": "MODAAL VENSTER TONEN", "demoFadeScaleDescription": "Het patroon 'Vervagen' wordt gebruikt voor UI-elementen die binnen de begrenzing van het scherm verschijnen of verdwijnen, zoals een dialoogvenster dat vervaagt in het midden van het scherm.", "demoFadeScaleTitle": "Vervagen", "demoFadeThroughTextPlaceholder": "123 foto's", "demoFadeThroughSearchDestination": "Zoeken", "demoFadeThroughPhotosDestination": "Foto's", "demoSharedXAxisCoursePageSubtitle": "Gebundelde categorieën worden als groepen weergegeven in je feed. Je kunt dit later altijd wijzigen.", "demoFadeThroughDescription": "Het patroon 'Fade-through' wordt gebruikt voor overgangen tussen UI-elementen die geen sterk onderling verband hebben.", "demoFadeThroughTitle": "Fade-through", "demoSharedZAxisHelpSettingLabel": "Hulp", "demoMotionSubtitle": "Alle vooraf gedefinieerde overgangspatronen", "demoSharedZAxisNotificationSettingLabel": "Meldingen", "demoSharedZAxisProfileSettingLabel": "Profiel", "demoSharedZAxisSavedRecipesListTitle": "Opgeslagen recepten", "demoSharedZAxisBeefSandwichRecipeDescription": "Recept voor sandwich met rundvlees", "demoSharedZAxisCrabPlateRecipeDescription": "Recept voor gerecht met krab", "demoSharedXAxisCoursePageTitle": "Je cursussen stroomlijnen", "demoSharedZAxisCrabPlateRecipeTitle": "Krab", "demoSharedZAxisShrimpPlateRecipeDescription": "Recept voor gerecht met garnalen", "demoSharedZAxisShrimpPlateRecipeTitle": "Garnalen", "demoContainerTransformTypeFadeThrough": "FADE-THROUGH", "demoSharedZAxisDessertRecipeTitle": "Dessert", "demoSharedZAxisSandwichRecipeDescription": "Recept voor sandwich", "demoSharedZAxisSandwichRecipeTitle": "Sandwich", "demoSharedZAxisBurgerRecipeDescription": "Recept voor hamburger", "demoSharedZAxisBurgerRecipeTitle": "Hamburger", "demoSharedZAxisSettingsPageTitle": "Instellingen", "demoSharedZAxisTitle": "Gedeelde Z-as", "demoSharedZAxisPrivacySettingLabel": "Privacy", "demoMotionTitle": "Beweging", "demoContainerTransformTitle": "Containertransformatie", "demoContainerTransformDescription": "Het patroon 'Containertransformatie' is ontworpen voor overgangen tussen UI-elementen die een container bevatten. Dit patroon zorgt voor een zichtbare connectie tussen twee UI-elementen.", "demoContainerTransformModalBottomSheetTitle": "Vervagingsmodus", "demoContainerTransformTypeFade": "VERVAGEN", "demoSharedYAxisAlbumTileDurationUnit": "min", "demoMotionPlaceholderTitle": "Titel", "demoSharedXAxisForgotEmailButtonText": "E-MAILADRES VERGETEN?", "demoMotionSmallPlaceholderSubtitle": "Secundair", "demoMotionDetailsPageTitle": "Detailpagina", "demoMotionListTileTitle": "Lijstitem", "demoSharedAxisDescription": "Het patroon 'Gedeelde as' wordt gebruikt voor overgangen tussen UI-elementen die een ruimtelijke of navigatiegebonden relatie hebben. Dit patroon gebruikt een gedeelde transformatie op de X-, Y- of Z-as om de relatie tussen elementen te benadrukken.", "demoSharedXAxisTitle": "Gedeelde X-as", "demoSharedXAxisBackButtonText": "TERUG", "demoSharedXAxisNextButtonText": "VOLGENDE", "demoSharedXAxisCulinaryCourseTitle": "Culinair", "githubRepo": "GitHub-opslagplaats {repoName}", "fortnightlyMenuUS": "Verenigde Staten", "fortnightlyMenuBusiness": "Zakelijk", "fortnightlyMenuScience": "Wetenschap", "fortnightlyMenuSports": "Sport", "fortnightlyMenuTravel": "Reizen", "fortnightlyMenuCulture": "Cultuur", "fortnightlyTrendingTechDesign": "TechDesign", "rallyBudgetDetailAmountLeft": "Resterend bedrag", "fortnightlyHeadlineArmy": "Hervorming van het Groene Leger van binnenuit", "fortnightlyDescription": "Een op content gerichte nieuws-app", "rallyBillDetailAmountDue": "Te betalen bedrag", "rallyBudgetDetailTotalCap": "Totaallimiet", "rallyBudgetDetailAmountUsed": "Gebruikt bedrag", "fortnightlyTrendingHealthcareRevolution": "HealthcareRevolution", "fortnightlyMenuFrontPage": "Voorpagina", "fortnightlyMenuWorld": "Wereld", "rallyBillDetailAmountPaid": "Betaald bedrag", "fortnightlyMenuPolitics": "Politiek", "fortnightlyHeadlineBees": "Bijentekort in landbouwgebied", "fortnightlyHeadlineGasoline": "De toekomst van benzine", "fortnightlyTrendingGreenArmy": "GreenArmy", "fortnightlyHeadlineFeminists": "Feministen pakken de partijgeest aan", "fortnightlyHeadlineFabrics": "Ontwerpers gebruiken technologie voor futuristische stoffen", "fortnightlyHeadlineStocks": "Stagnerende aandelenkoersen maken valuta populair", "fortnightlyTrendingReform": "Reform", "fortnightlyMenuTech": "Technologie", "fortnightlyHeadlineWar": "Verdeelde Amerikaanse levens tijdens de oorlog", "fortnightlyHeadlineHealthcare": "De stille maar sterke revolutie in de gezondheidszorg", "fortnightlyLatestUpdates": "Nieuwste updates", "fortnightlyTrendingStocks": "Stocks", "rallyBillDetailTotalAmount": "Totaalbedrag", "demoCupertinoPickerDateTime": "Datum en tijd", "signIn": "INLOGGEN", "dataTableRowWithSugar": "{value} met suiker", "dataTableRowApplePie": "Appeltaart", "dataTableRowDonut": "Donut", "dataTableRowHoneycomb": "Honeycomb", "dataTableRowLollipop": "Lolly", "dataTableRowJellyBean": "Jellybean", "dataTableRowGingerbread": "Gingerbread", "dataTableRowCupcake": "Cupcake", "dataTableRowEclair": "Eclair", "dataTableRowIceCreamSandwich": "IJswafel", "dataTableRowFrozenYogurt": "Yoghurtijs", "dataTableColumnIron": "IJzer (%)", "dataTableColumnCalcium": "Calcium (%)", "dataTableColumnSodium": "Natrium (mg)", "demoTimePickerTitle": "Tijdkiezer", "demo2dTransformationsResetTooltip": "Transformaties resetten", "dataTableColumnFat": "Vetten (g)", "dataTableColumnCalories": "Calorieën", "dataTableColumnDessert": "Dessert (1 portie)", "cardsDemoTravelDestinationLocation1": "Thanjavur, Tamil Nadu", "demoTimePickerDescription": "Toont een dialoogvenster met een tijdkiezer in material design.", "demoPickersShowPicker": "KIEZER TONEN", "demoTabsScrollingTitle": "Scrollend", "demoTabsNonScrollingTitle": "Niet-scrollend", "craneHours": "{hours,plural,=1{1 u}other{{hours} u}}", "craneMinutes": "{minutes,plural,=1{1 m}other{{minutes} m}}", "craneFlightDuration": "{hoursShortForm} {minutesShortForm}", "dataTableHeader": "Voedingswaarde", "demoDatePickerTitle": "Datumkiezer", "demoPickersSubtitle": "Selectie van datum en tijd", "demoPickersTitle": "Kiezers", "demo2dTransformationsEditTooltip": "Tegel bewerken", "demoDataTableDescription": "Gegevenstabellen tonen informatie in een rasterindeling met rijen en kolommen. Op die manier is de informatie makkelijk snel te bekijken, zodat gebruikers patronen kunnen herkennen of inzichten kunnen opdoen.", "demo2dTransformationsDescription": "Tik om tegels te bewerken en gebruik gebaren om rond te bewegen in de scène. Sleep om mee te draaien, knijp om te zoomen en draai met twee vingers. Druk op de startknop om weer naar de beginstand te gaan.", "demo2dTransformationsSubtitle": "Meedraaien, zoomen, draaien", "demo2dTransformationsTitle": "2D-transformaties", "demoCupertinoTextFieldPIN": "Pincode", "demoCupertinoTextFieldDescription": "In een tekstveld kan een gebruiker tekst invoeren, via een fysiektoetsenbord of een schermtoetsenbord.", "demoCupertinoTextFieldSubtitle": "Tekstvelden in iOS-stijl", "demoCupertinoTextFieldTitle": "Tekstvelden", "demoDatePickerDescription": "Toont een dialoogvenster met een datumkiezer in material design.", "demoCupertinoPickerTime": "Tijd", "demoCupertinoPickerDate": "Datum", "demoCupertinoPickerTimer": "Timer", "demoCupertinoPickerDescription": "Een kiezerwidget in iOS-stijl waarmee tekenreeksen, datums, tijden of datum en tijd kunnen worden geselecteerd.", "demoCupertinoPickerSubtitle": "Kiezers in iOS-stijl", "demoCupertinoPickerTitle": "Kiezers", "dataTableRowWithHoney": "{value} met honing", "cardsDemoTravelDestinationCity2": "Chettinad", "bannerDemoResetText": "Banner resetten", "bannerDemoMultipleText": "Meerdere acties", "bannerDemoLeadingText": "Icoon vóór tekst", "dismiss": "SLUITEN", "cardsDemoTappable": "Tikbaar", "cardsDemoSelectable": "Selecteerbaar (lang indrukken)", "cardsDemoExplore": "Ontdekken", "cardsDemoExploreSemantics": "{destinationName} ontdekken", "cardsDemoShareSemantics": "{destinationName} delen", "cardsDemoTravelDestinationTitle1": "De tien mooiste steden om te bezoeken in Tamil Nadu", "cardsDemoTravelDestinationDescription1": "Nummer 10", "cardsDemoTravelDestinationCity1": "Thanjavur", "dataTableColumnProtein": "Eiwitten (g)", "cardsDemoTravelDestinationTitle2": "Ambachtslieden van Zuid-India", "cardsDemoTravelDestinationDescription2": "Zijdespinners", "bannerDemoText": "Je wachtwoord is geüpdatet op je andere apparaat. Log opnieuw in.", "cardsDemoTravelDestinationLocation2": "Sivaganga, Tamil Nadu", "cardsDemoTravelDestinationTitle3": "Brihadisvaratempel", "cardsDemoTravelDestinationDescription3": "Tempels", "demoBannerTitle": "Banner", "demoBannerSubtitle": "Een banner weergeven in een lijst", "demoBannerDescription": "Een banner toont een belangrijk, kort geformuleerd bericht en biedt acties die gebruikers kunnen uitvoeren (of ze kunnen de banner sluiten). De banner kan alleen worden gesloten door een gebruikersactie.", "demoCardTitle": "Kaarten", "demoCardSubtitle": "Voedingsinformatiekaarten met afgeronde hoeken", "demoCardDescription": "Een kaart is een blad waarop bepaalde gerelateerde informatie wordt weergegeven, zoals een album, geografische locatie, gerecht, contactgegevens, enz.", "demoDataTableTitle": "Gegevenstabellen", "demoDataTableSubtitle": "Rijen en kolommen met informatie", "dataTableColumnCarbs": "Koolhydraten (g)", "placeTanjore": "Tanjore", "demoGridListsTitle": "Rasterlijsten", "placeFlowerMarket": "Bloemenmarkt", "placeBronzeWorks": "Bronsgieterij", "placeMarket": "Markt", "placeThanjavurTemple": "Thanjavur-tempel", "placeSaltFarm": "Zoutpan", "placeScooters": "Scooters", "placeSilkMaker": "Zijdewever", "placeLunchPrep": "Lunchbereiding", "placeBeach": "Strand", "placeFisherman": "Visser", "demoMenuSelected": "Geselecteerd: {value}", "demoMenuRemove": "Verwijderen", "demoMenuGetLink": "Link ophalen", "demoMenuShare": "Delen", "demoBottomAppBarSubtitle": "Geeft navigatie en acties onderaan weer", "demoMenuAnItemWithASectionedMenu": "Een item met een in secties opgesplitst menu", "demoMenuADisabledMenuItem": "Uitgezet menu-item", "demoLinearProgressIndicatorTitle": "Lineaire voortgangsindicator", "demoMenuContextMenuItemOne": "Contextmenu-item één", "demoMenuAnItemWithASimpleMenu": "Een item met een eenvoudig menu", "demoCustomSlidersTitle": "Aangepaste schuifregelaars", "demoMenuAnItemWithAChecklistMenu": "Een item met een checklistmenu", "demoCupertinoActivityIndicatorTitle": "Activiteitsindicator", "demoCupertinoActivityIndicatorSubtitle": "Activiteitsindicatoren in iOS-stijl", "demoCupertinoActivityIndicatorDescription": "Een activiteitsindicator in iOS-stijl die rechtsom ronddraait.", "demoCupertinoNavigationBarTitle": "Navigatiebalk", "demoCupertinoNavigationBarSubtitle": "Navigatiebalk in iOS-stijl", "demoCupertinoNavigationBarDescription": "Een navigatiebalk in iOS-stijl. De navigatiebalk is een werkbalk die in elk geval bestaat uit een paginatitel (in het midden van de werkbalk).", "demoCupertinoPullToRefreshTitle": "Trek omlaag om te vernieuwen", "demoCupertinoPullToRefreshSubtitle": "Optie voor omlaag trekken om te vernieuwen in iOS-stijl", "demoCupertinoPullToRefreshDescription": "Een widget voor implementatie van de optie voor omlaag trekken om te vernieuwen in iOS-stijl.", "demoProgressIndicatorTitle": "Voortgangsindicatoren", "demoProgressIndicatorSubtitle": "Lineair, rond, onbepaald", "demoCircularProgressIndicatorTitle": "Ronde voortgangsindicator", "demoCircularProgressIndicatorDescription": "Een ronde voortgangsindicator volgens material design, die ronddraait om aan te geven dat de app bezig is.", "demoMenuFour": "Vier", "demoLinearProgressIndicatorDescription": "Een lineaire voortgangsindicator volgens material design, ook wel een voortgangsbalk genoemd.", "demoTooltipTitle": "Tooltip", "demoTooltipSubtitle": "Kort bericht dat wordt weergegeven bij lang indrukken of muisaanwijzer plaatsen", "demoTooltipDescription": "Tooltip bevat een label dat de functie uitlegt van een knop of andere gebruikersinterface-actie. In tooltip wordt informatieve tekst weergegeven als gebruikers de muisaanwijzer of focus op een element plaatsen of het lang indrukken.", "demoTooltipInstructions": "Druk lang op een element of plaats de muisaanwijzer erop om de tooltip weer te geven.", "placeChennai": "Chennai", "demoMenuChecked": "Aangevinkt: {value}", "placeChettinad": "Chettinad", "demoMenuPreview": "Voorbeeld", "demoBottomAppBarTitle": "App-balk onderaan", "demoBottomAppBarDescription": "Met de app-balken onderaan heb je toegang tot een navigatiemenu onderaan en maximaal vier acties, waaronder de zwevende actieknop.", "bottomAppBarNotch": "Inkeping", "bottomAppBarPosition": "Positie van zwevende actieknop", "bottomAppBarPositionDockedEnd": "Gedockt - Uiteinde", "bottomAppBarPositionDockedCenter": "Gedockt - Midden", "bottomAppBarPositionFloatingEnd": "Zwevend - Uiteinde", "bottomAppBarPositionFloatingCenter": "Zwevend - Midden", "demoSlidersEditableNumericalValue": "Bewerkbare numerieke waarde", "demoGridListsSubtitle": "Rij- en kolomopmaak", "demoGridListsDescription": "Rasterlijsten zijn geschikt voor het presenteren van homogene gegevens (vaak afbeeldingen). Elk item in een rasterlijst wordt een tegel genoemd.", "demoGridListsImageOnlyTitle": "Alleen afbeelding", "demoGridListsHeaderTitle": "Met koptekst", "demoGridListsFooterTitle": "Met voettekst", "demoSlidersTitle": "Schuifregelaars", "demoSlidersSubtitle": "Widgets om een waarde te selecteren door middel van vegen", "demoSlidersDescription": "Schuifregelaars geven een waardebereik langs een balk weer, waarop gebruikers één waarde kunnen selecteren. Ze zijn ideaal om instellingen (zoals volume of helderheid) aan te passen en afbeeldingsfilters toe te passen.", "demoRangeSlidersTitle": "Schuifregelaars voor bereik", "demoRangeSlidersDescription": "Schuifregelaars geven een waardebereik langs een balk weer. Ze kunnen pictogrammen aan beide uiteinden van de balk hebben die overeenkomen met een waardebereik. Ze zijn ideaal om instellingen (zoals volume of helderheid) aan te passen en afbeeldingsfilters toe te passen.", "demoMenuAnItemWithAContextMenuButton": "Een item met een contextmenu", "demoCustomSlidersDescription": "Schuifregelaars geven een waardebereik langs een balk weer, waarop gebruikers één waarde of een waardebereik kunnen selecteren. De schuifregelaars kunnen worden voorzien van een thema en worden aangepast.", "demoSlidersContinuousWithEditableNumericalValue": "Doorlopend met bewerkbare numerieke waarde", "demoSlidersDiscrete": "Afzonderlijk", "demoSlidersDiscreteSliderWithCustomTheme": "Afzonderlijke schuifregelaar met aangepast thema", "demoSlidersContinuousRangeSliderWithCustomTheme": "Doorlopende schuifregelaar voor bereik met aangepast thema", "demoSlidersContinuous": "Doorlopend", "placePondicherry": "Pondicherry", "demoMenuTitle": "Menu", "demoContextMenuTitle": "Contextmenu", "demoSectionedMenuTitle": "In secties opgesplitst menu", "demoSimpleMenuTitle": "Eenvoudig menu", "demoChecklistMenuTitle": "Checklistmenu", "demoMenuSubtitle": "Menuknoppen en eenvoudige menu's", "demoMenuDescription": "Een menu toont een lijst met keuzes in een tijdelijke weergave. Menu's worden weergegeven als gebruikers interactie hebben met een knop, actie of andere bedieningsoptie.", "demoMenuItemValueOne": "Menu-item één", "demoMenuItemValueTwo": "Menu-item twee", "demoMenuItemValueThree": "Menu-item drie", "demoMenuOne": "Eén", "demoMenuTwo": "Twee", "demoMenuThree": "Drie", "demoMenuContextMenuItemThree": "Contextmenu-item drie", "demoCupertinoSwitchSubtitle": "Schakelaar in iOS-stijl", "demoSnackbarsText": "Dit is een snackbar.", "demoCupertinoSliderSubtitle": "Schuifregelaar in iOS-stijl", "demoCupertinoSliderDescription": "Met een schuifregelaar kun je selecteren uit een doorlopende of afzonderlijke reeks waarden.", "demoCupertinoSliderContinuous": "Doorlopend: {value}", "demoCupertinoSliderDiscrete": "Afzonderlijk: {value}", "demoSnackbarsAction": "Je hebt op de snackbaractie gedrukt.", "backToGallery": "Terug naar galerij", "demoCupertinoTabBarTitle": "Tabbladbalk", "demoCupertinoSwitchDescription": "Met een schakelaar kun je de aan/uit-status van een enkele instelling schakelen.", "demoSnackbarsActionButtonLabel": "ACTIE", "cupertinoTabBarProfileTab": "Profiel", "demoSnackbarsButtonLabel": "EEN SNACKBAR TONEN", "demoSnackbarsDescription": "Snackbars informeren gebruikers over een proces dat een app heeft uitgevoerd of gaat uitvoeren. Ze zijn tijdelijk zichtbaar, onderaan het scherm. Ze verstoren de gebruikerservaring niet en verdwijnen zonder invoer van de gebruiker.", "demoSnackbarsSubtitle": "Snackbars tonen berichten onderaan het scherm", "demoSnackbarsTitle": "Snackbars", "demoCupertinoSliderTitle": "Schuifregelaar", "cupertinoTabBarChatTab": "Chat", "cupertinoTabBarHomeTab": "Home", "demoCupertinoTabBarDescription": "Een navigatietabbladbalk onderaan in iOS-stijl. Geeft meerdere tabbladen weer met één actief tabblad (standaard het eerste tabblad).", "demoCupertinoTabBarSubtitle": "Tabbladbalk onderaan in iOS-stijl", "demoOptionsFeatureTitle": "Opties bekijken", "demoOptionsFeatureDescription": "Tik hier om de beschikbare opties voor deze demo te bekijken.", "demoCodeViewerCopyAll": "ALLES KOPIËREN", "shrineScreenReaderRemoveProductButton": "{product} verwijderen", "shrineScreenReaderProductAddToCart": "Toevoegen aan winkelwagen", "shrineScreenReaderCart": "{quantity,plural,=0{Winkelwagen, geen artikelen}=1{Winkelwagen, 1 artikel}other{Winkelwagen, {quantity} artikelen}}", "demoCodeViewerFailedToCopyToClipboardMessage": "Kopiëren naar klembord is mislukt: {error}", "demoCodeViewerCopiedToClipboardMessage": "Naar klembord gekopieerd.", "craneSleep8SemanticLabel": "Maya-ruïnes aan een klif boven een strand", "craneSleep4SemanticLabel": "Hotel aan een meer met bergen op de achtergrond", "craneSleep2SemanticLabel": "Citadel Machu Picchu", "craneSleep1SemanticLabel": "Chalet in een sneeuwlandschap met naaldbomen", "craneSleep0SemanticLabel": "Bungalows op palen boven het water", "craneFly13SemanticLabel": "Zwembad aan zee met palmbomen", "craneFly12SemanticLabel": "Zwembad met palmbomen", "craneFly11SemanticLabel": "Bakstenen vuurtoren aan zee", "craneFly10SemanticLabel": "Torens van de Al-Azhar-moskee bij zonsondergang", "craneFly9SemanticLabel": "Man leunt op een antieke blauwe auto", "craneFly8SemanticLabel": "Supertree Grove", "craneEat9SemanticLabel": "Cafétoonbank met gebakjes", "craneEat2SemanticLabel": "Hamburger", "craneFly5SemanticLabel": "Hotel aan een meer met bergen op de achtergrond", "demoSelectionControlsSubtitle": "Selectievakjes, keuzerondjes en schakelaars", "craneEat10SemanticLabel": "Vrouw houdt een enorme pastrami-sandwich vast", "craneFly4SemanticLabel": "Bungalows op palen boven het water", "craneEat7SemanticLabel": "Ingang van bakkerij", "craneEat6SemanticLabel": "Gerecht met garnalen", "craneEat5SemanticLabel": "Kunstzinnig zitgedeelte in restaurant", "craneEat4SemanticLabel": "Chocoladetoetje", "craneEat3SemanticLabel": "Koreaanse taco", "craneFly3SemanticLabel": "Citadel Machu Picchu", "craneEat1SemanticLabel": "Lege bar met barkrukken", "craneEat0SemanticLabel": "Pizza in een houtoven", "craneSleep11SemanticLabel": "Taipei 101-skyscraper", "craneSleep10SemanticLabel": "Torens van de Al-Azhar-moskee bij zonsondergang", "craneSleep9SemanticLabel": "Bakstenen vuurtoren aan zee", "craneEat8SemanticLabel": "Bord met rivierkreeft", "craneSleep7SemanticLabel": "Kleurige appartementen aan het Ribeira-plein", "craneSleep6SemanticLabel": "Zwembad met palmbomen", "craneSleep5SemanticLabel": "Kampeertent in een veld", "settingsButtonCloseLabel": "Instellingen sluiten", "demoSelectionControlsCheckboxDescription": "Met selectievakjes kan de gebruiker meerdere opties selecteren uit een set. De waarde voor een normaal selectievakje is 'true' of 'false'. De waarde van een selectievakje met drie statussen kan ook 'null' zijn.", "settingsButtonLabel": "Instellingen", "demoListsTitle": "Lijsten", "demoListsSubtitle": "Indelingen voor scrollende lijsten", "demoListsDescription": "Eén rij met een vaste hoogte die meestal wat tekst bevat die wordt voorafgegaan of gevolgd door een icoon.", "demoOneLineListsTitle": "Eén regel", "demoTwoLineListsTitle": "Twee regels", "demoListsSecondary": "Secundaire tekst", "demoSelectionControlsTitle": "Selectieopties", "craneFly7SemanticLabel": "Mount Rushmore", "demoSelectionControlsCheckboxTitle": "Selectievakje", "craneSleep3SemanticLabel": "Man leunt op een antieke blauwe auto", "demoSelectionControlsRadioTitle": "Radio", "demoSelectionControlsRadioDescription": "Met keuzerondjes kan de gebruiker één optie selecteren uit een set. Gebruik keuzerondjes voor exclusieve selectie als de gebruiker alle beschikbare opties op een rij moet kunnen bekijken.", "demoSelectionControlsSwitchTitle": "Schakelaar", "demoSelectionControlsSwitchDescription": "Aan/uit-schakelaars bepalen de status van 1 instellingsoptie. De optie die door de schakelaar wordt beheerd, en de status waarin de schakelaar zich bevindt, moeten duidelijk worden gemaakt via het bijbehorende inline label.", "craneFly0SemanticLabel": "Chalet in een sneeuwlandschap met naaldbomen", "craneFly1SemanticLabel": "Kampeertent in een veld", "craneFly2SemanticLabel": "Gebedsvlaggen met op de achtergrond een besneeuwde berg", "craneFly6SemanticLabel": "Luchtfoto van het Palacio de Bellas Artes", "rallySeeAllAccounts": "Alle rekeningen bekijken", "rallyBillAmount": "Rekening van {billName} voor {amount}, te betalen vóór {date}.", "shrineTooltipCloseCart": "Winkelwagen sluiten", "shrineTooltipCloseMenu": "Menu sluiten", "shrineTooltipOpenMenu": "Menu openen", "shrineTooltipSettings": "Instellingen", "shrineTooltipSearch": "Zoeken", "demoTabsDescription": "Tabbladen delen content in op basis van verschillende schermen, datasets en andere interacties.", "demoTabsSubtitle": "Tabbladen met onafhankelijk scrollbare weergaven", "demoTabsTitle": "Tabbladen", "rallyBudgetAmount": "{budgetName}-budget met {amountUsed} van {amountTotal} verbruikt, nog {amountLeft} over", "shrineTooltipRemoveItem": "Item verwijderen", "rallyAccountAmount": "{accountName}-rekening {accountNumber} met {amount}.", "rallySeeAllBudgets": "Alle budgetten bekijken", "rallySeeAllBills": "Alle facturen bekijken", "craneFormDate": "Datum selecteren", "craneFormOrigin": "Vertrekpunt kiezen", "craneFly2": "Khumbu-vallei, Nepal", "craneFly3": "Machu Picchu, Peru", "craneFly4": "Malé, Maldiven", "craneFly5": "Vitznau, Zwitserland", "craneFly6": "Mexico-Stad, Mexico", "craneFly7": "Mount Rushmore, Verenigde Staten", "settingsTextDirectionLocaleBased": "Gebaseerd op land", "craneFly9": "Havana, Cuba", "craneFly10": "Caïro, Egypte", "craneFly11": "Lissabon, Portugal", "craneFly12": "Napa, Verenigde Staten", "craneFly13": "Bali, Indonesië", "craneSleep0": "Malé, Maldiven", "craneSleep1": "Aspen, Verenigde Staten", "craneSleep2": "Machu Picchu, Peru", "demoCupertinoSegmentedControlTitle": "Gesegmenteerde bediening", "craneSleep4": "Vitznau, Zwitserland", "craneSleep5": "Big Sur, Verenigde Staten", "craneSleep6": "Napa, Verenigde Staten", "craneSleep7": "Porto, Portugal", "craneSleep8": "Tulum, Mexico", "craneEat5": "Seoul, Zuid-Korea", "demoChipTitle": "Chips", "demoChipSubtitle": "Compacte elementen die een invoer, kenmerk of actie kunnen vertegenwoordigen", "demoActionChipTitle": "Actiechip", "demoActionChipDescription": "Actiechips zijn een reeks opties die een actie activeren voor primaire content. Actiechips zouden dynamisch en contextueel moeten worden weergegeven in een gebruikersinterface.", "demoChoiceChipTitle": "Keuzechip", "demoChoiceChipDescription": "Keuzechips laten de gebruiker één optie kiezen uit een reeks. Keuzechips kunnen gerelateerde beschrijvende tekst of categorieën bevatten.", "demoFilterChipTitle": "Filterchip", "demoFilterChipDescription": "Filterchips gebruiken tags of beschrijvende woorden als methode om content te filteren.", "demoInputChipTitle": "Invoerchip", "demoInputChipDescription": "Invoerchips bevatten een complex informatiefragment, zoals een entiteit (persoon, plaats of object) of gesprekstekst, in compacte vorm.", "craneSleep9": "Lissabon, Portugal", "craneEat10": "Lissabon, Portugal", "demoCupertinoSegmentedControlDescription": "Wordt gebruikt om een keuze te maken uit verschillende opties die elkaar wederzijds uitsluiten. Als één optie in de gesegmenteerde bediening is geselecteerd, zijn de andere opties in de gesegmenteerde bediening niet meer geselecteerd.", "chipTurnOnLights": "Verlichting aanzetten", "chipSmall": "Klein", "chipMedium": "Gemiddeld", "chipLarge": "Groot", "chipElevator": "Lift", "chipWasher": "Wasmachine", "chipFireplace": "Haard", "chipBiking": "Fietsen", "craneFormDiners": "Gasten", "rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{Verhoog je potentiële belastingaftrek: wijs categorieën toe aan één niet-toegewezen transactie.}other{Verhoog je potentiële belastingaftrek: wijs categorieën toe aan {count} niet-toegewezen transacties.}}", "craneFormTime": "Tijd selecteren", "craneFormLocation": "Locatie selecteren", "craneFormTravelers": "Reizigers", "craneEat8": "Atlanta, Verenigde Staten", "craneFormDestination": "Bestemming kiezen", "craneFormDates": "Datums selecteren", "craneFly": "VLIEGEN", "craneSleep": "OVERNACHTEN", "craneEat": "ETEN", "craneFlySubhead": "Vluchten bekijken per bestemming", "craneSleepSubhead": "Accommodaties bekijken per bestemming", "craneEatSubhead": "Restaurants bekijken per bestemming", "craneFlyStops": "{numberOfStops,plural,=0{Directe vlucht}=1{1 tussenstop}other{{numberOfStops} tussenstops}}", "craneSleepProperties": "{totalProperties,plural,=0{Geen beschikbare accommodaties}=1{1 beschikbare accommodatie}other{{totalProperties} beschikbare accommodaties}}", "craneEatRestaurants": "{totalRestaurants,plural,=0{Geen restaurants}=1{1 restaurant}other{{totalRestaurants} restaurants}}", "craneFly0": "Aspen, Verenigde Staten", "demoCupertinoSegmentedControlSubtitle": "Gesegmenteerde bediening in iOS-stijl", "craneSleep10": "Caïro, Egypte", "craneEat9": "Madrid, Spanje", "craneFly1": "Big Sur, Verenigde Staten", "craneEat7": "Nashville, Verenigde Staten", "craneEat6": "Seattle, Verenigde Staten", "craneFly8": "Singapore", "craneEat4": "Parijs, Frankrijk", "craneEat3": "Portland, Verenigde Staten", "craneEat2": "Córdoba, Argentinië", "craneEat1": "Dallas, Verenigde Staten", "craneEat0": "Napels, Italië", "craneSleep11": "Taipei, Taiwan", "craneSleep3": "Havana, Cuba", "shrineLogoutButtonCaption": "UITLOGGEN", "rallyTitleBills": "FACTUREN", "rallyTitleAccounts": "ACCOUNTS", "shrineProductVagabondSack": "Vagabond-rugtas", "rallyAccountDetailDataInterestYtd": "Rente (jaar tot nu toe)", "shrineProductWhitneyBelt": "Whitney-riem", "shrineProductGardenStrand": "Garden-ketting", "shrineProductStrutEarrings": "Strut-oorbellen", "shrineProductVarsitySocks": "Sportsokken", "shrineProductWeaveKeyring": "Geweven sleutelhanger", "shrineProductGatsbyHat": "Gatsby-pet", "shrineProductShrugBag": "Schoudertas", "shrineProductGiltDeskTrio": "Goudkleurig bureautrio", "shrineProductCopperWireRack": "Koperen rooster", "shrineProductSootheCeramicSet": "Soothe-keramiekset", "shrineProductHurrahsTeaSet": "Hurrahs-theeset", "shrineProductBlueStoneMug": "Blauwe aardewerken mok", "shrineProductRainwaterTray": "Opvangbak voor regenwater", "shrineProductChambrayNapkins": "Servetten (gebroken wit)", "shrineProductSucculentPlanters": "Vetplantpotten", "shrineProductQuartetTable": "Quartet-tafel", "shrineProductKitchenQuattro": "Keukenquattro", "shrineProductClaySweater": "Clay-sweater", "shrineProductSeaTunic": "Tuniek (zeegroen)", "shrineProductPlasterTunic": "Tuniek (gebroken wit)", "rallyBudgetCategoryRestaurants": "Restaurants", "shrineProductChambrayShirt": "Spijkeroverhemd", "shrineProductSeabreezeSweater": "Seabreeze-sweater", "shrineProductGentryJacket": "Gentry-jas", "shrineProductNavyTrousers": "Broek (marineblauw)", "shrineProductWalterHenleyWhite": "Walter henley (wit)", "shrineProductSurfAndPerfShirt": "Surf and perf-shirt", "shrineProductGingerScarf": "Sjaal (oker)", "shrineProductRamonaCrossover": "Ramona-crossover", "shrineProductClassicWhiteCollar": "Klassieke witte kraag", "shrineProductSunshirtDress": "Overhemdjurk", "rallyAccountDetailDataInterestRate": "Rentepercentage", "rallyAccountDetailDataAnnualPercentageYield": "Jaarlijks rentepercentage", "rallyAccountDataVacation": "Vakantie", "shrineProductFineLinesTee": "T-shirt met fijne lijnen", "rallyAccountDataHomeSavings": "Spaarrekening huishouden", "rallyAccountDataChecking": "Lopende rekening", "rallyAccountDetailDataInterestPaidLastYear": "Betaalde rente vorig jaar", "rallyAccountDetailDataNextStatement": "Volgend afschrift", "rallyAccountDetailDataAccountOwner": "Accounteigenaar", "rallyBudgetCategoryCoffeeShops": "Koffiebars", "rallyBudgetCategoryGroceries": "Boodschappen", "shrineProductCeriseScallopTee": "T-shirt met geschulpte kraag (cerise)", "rallyBudgetCategoryClothing": "Kleding", "rallySettingsManageAccounts": "Accounts beheren", "rallyAccountDataCarSavings": "Spaarrekening auto", "rallySettingsTaxDocuments": "Belastingdocumenten", "rallySettingsPasscodeAndTouchId": "Toegangscode en Touch ID", "rallySettingsNotifications": "Meldingen", "rallySettingsPersonalInformation": "Persoonlijke informatie", "rallySettingsPaperlessSettings": "Instellingen voor papierloos gebruik", "rallySettingsFindAtms": "Geldautomaten vinden", "rallySettingsHelp": "Hulp", "rallySettingsSignOut": "Uitloggen", "rallyAccountTotal": "Totaal", "rallyBillsDue": "Vervaldatum", "rallyBudgetLeft": "Resterend", "rallyAccounts": "Accounts", "rallyBills": "Facturen", "rallyBudgets": "Budgetten", "rallyAlerts": "Meldingen", "rallySeeAll": "ALLES WEERGEVEN", "rallyFinanceLeft": "RESTEREND", "rallyTitleOverview": "OVERZICHT", "shrineProductShoulderRollsTee": "T-shirt met gerolde schouders", "shrineNextButtonCaption": "VOLGENDE", "rallyTitleBudgets": "BUDGETTEN", "rallyTitleSettings": "INSTELLINGEN", "rallyLoginLoginToRally": "Inloggen bij Rally", "rallyLoginNoAccount": "Heb je geen account?", "rallyLoginSignUp": "AANMELDEN", "rallyLoginUsername": "Gebruikersnaam", "rallyLoginPassword": "Wachtwoord", "rallyLoginLabelLogin": "Inloggen", "rallyLoginRememberMe": "Onthouden", "rallyLoginButtonLogin": "INLOGGEN", "rallyAlertsMessageHeadsUpShopping": "Let op, je hebt {percent} van je Shopping-budget voor deze maand gebruikt.", "rallyAlertsMessageSpentOnRestaurants": "Je hebt deze week {amount} besteed aan restaurants.", "rallyAlertsMessageATMFees": "Je hebt deze maand {amount} besteed aan geldautomaatkosten.", "rallyAlertsMessageCheckingAccount": "Goed bezig! Er staat {percent} meer op je lopende rekening dan vorige maand.", "shrineMenuCaption": "MENU", "shrineCategoryNameAll": "ALLE", "shrineCategoryNameAccessories": "ACCESSOIRES", "shrineCategoryNameClothing": "KLEDING", "shrineCategoryNameHome": "IN HUIS", "shrineLoginUsernameLabel": "Gebruikersnaam", "shrineLoginPasswordLabel": "Wachtwoord", "shrineCancelButtonCaption": "ANNULEREN", "shrineCartTaxCaption": "Btw:", "shrineCartPageCaption": "WINKELWAGEN", "shrineProductQuantity": "Aantal: {quantity}", "shrineProductPrice": "x {price}", "shrineCartItemCount": "{quantity,plural,=0{GEEN ITEMS}=1{1 ITEM}other{{quantity} ITEMS}}", "shrineCartClearButtonCaption": "WINKELWAGEN LEEGMAKEN", "shrineCartTotalCaption": "TOTAAL", "shrineCartSubtotalCaption": "Subtotaal:", "shrineCartShippingCaption": "Verzendkosten:", "shrineProductGreySlouchTank": "Ruimvallende tanktop (grijs)", "shrineProductStellaSunglasses": "Stella-zonnebril", "shrineProductWhitePinstripeShirt": "Wit shirt met krijtstreep", "demoTextFieldWhereCanWeReachYou": "Op welk nummer kunnen we je bereiken?", "settingsTextDirectionLTR": "Van links naar rechts", "settingsTextScalingLarge": "Groot", "demoBottomSheetHeader": "Kop", "demoBottomSheetItem": "Item {value}", "demoBottomTextFieldsTitle": "Tekstvelden", "demoTextFieldTitle": "TEKSTVELDEN", "demoTextFieldSubtitle": "Eén regel bewerkbare tekst en cijfers", "demoTextFieldDescription": "Met tekstvelden kunnen gebruikers tekst invoeren in een gebruikersinterface. Ze worden meestal gebruikt in formulieren en dialoogvensters.", "demoTextFieldShowPasswordLabel": "Wachtwoord tonen", "demoTextFieldHidePasswordLabel": "Wachtwoord verbergen", "demoTextFieldFormErrors": "Los de rood gemarkeerde fouten op voordat je het formulier indient.", "demoTextFieldNameRequired": "Naam is vereist.", "demoTextFieldOnlyAlphabeticalChars": "Geef alleen letters op.", "demoTextFieldEnterUSPhoneNumber": "(###) ###-#### - geef een Amerikaans telefoonnummer op.", "demoTextFieldEnterPassword": "Geef een wachtwoord op.", "demoTextFieldPasswordsDoNotMatch": "De wachtwoorden komen niet overeen", "demoTextFieldWhatDoPeopleCallYou": "Hoe noemen mensen je?", "demoTextFieldNameField": "Naam*", "demoBottomSheetButtonText": "BLAD ONDERAAN TONEN", "demoTextFieldPhoneNumber": "Telefoonnummer*", "demoBottomSheetTitle": "Blad onderaan", "demoTextFieldEmail": "E-mailadres", "demoTextFieldTellUsAboutYourself": "Vertel ons meer over jezelf (bijvoorbeeld wat voor werk je doet of wat je hobby's zijn)", "demoTextFieldKeepItShort": "Houd het kort, dit is een demo.", "starterAppGenericButton": "KNOP", "demoTextFieldLifeStory": "Levensverhaal", "demoTextFieldSalary": "Salaris", "demoTextFieldUSD": "USD", "demoTextFieldNoMoreThan": "Maximaal acht tekens.", "demoTextFieldPassword": "Wachtwoord*", "demoTextFieldRetypePassword": "Typ het wachtwoord opnieuw*", "demoTextFieldSubmit": "INDIENEN", "demoBottomNavigationSubtitle": "Navigatie onderaan met weergaven met cross-fading", "demoBottomSheetAddLabel": "Toevoegen", "demoBottomSheetModalDescription": "Een modaal blad onderaan (modal bottom sheet) is een alternatief voor een menu of dialoogvenster. Het voorkomt dat de gebruiker interactie kan hebben met de rest van de app.", "demoBottomSheetModalTitle": "Modaal blad onderaan", "demoBottomSheetPersistentDescription": "Een persistent blad onderaan (persistent bottom sheet) bevat informatie in aanvulling op de primaire content van de app. Een persistent blad onderaan blijft ook zichtbaar als de gebruiker interactie heeft met andere gedeelten van de app.", "demoBottomSheetPersistentTitle": "Persistent blad onderaan", "demoBottomSheetSubtitle": "Persistente en modale bladen onderaan", "demoTextFieldNameHasPhoneNumber": "Het telefoonnummer van {name} is {phoneNumber}", "buttonText": "KNOP", "demoTypographyDescription": "Definities voor de verschillende typografische stijlen van material design.", "demoTypographySubtitle": "Alle vooraf gedefinieerde tekststijlen", "demoTypographyTitle": "Typografie", "demoFullscreenDialogDescription": "De eigenschap fullscreenDialog geeft aan of de binnenkomende pagina een dialoogvenster is in de modus volledig scherm", "demoFlatButtonDescription": "Als je op een platte knop drukt, wordt een inktvlekeffect weergegeven, maar de knop gaat niet omhoog. Gebruik platte knoppen op taakbalken, in dialoogvensters en inline met opvulling", "demoBottomNavigationDescription": "Navigatiebalken onderaan geven drie tot vijf bestemmingen weer onderaan een scherm. Elke bestemming wordt weergegeven als een icoon en een optioneel tekstlabel. Als er op een navigatieicoon onderaan wordt getikt, gaat de gebruiker naar de bestemming op hoofdniveau die aan dat icoon is gekoppeld.", "demoBottomNavigationSelectedLabel": "Geselecteerd label", "demoBottomNavigationPersistentLabels": "Persistente labels", "starterAppDrawerItem": "Item {value}", "demoTextFieldRequiredField": "* geeft een verplicht veld aan", "demoBottomNavigationTitle": "Navigatie onderaan", "settingsLightTheme": "Licht", "settingsTheme": "Thema", "settingsPlatformIOS": "iOS", "settingsPlatformAndroid": "Android", "settingsTextDirectionRTL": "Van rechts naar links", "settingsTextScalingHuge": "Enorm", "cupertinoButton": "Knop", "settingsTextScalingNormal": "Normaal", "settingsTextScalingSmall": "Klein", "settingsSystemDefault": "Systeem", "settingsTitle": "Instellingen", "rallyDescription": "Een app voor persoonlijke financiën", "aboutDialogDescription": "Als je de broncode voor deze app wilt bekijken, ga je naar de {repoLink}.", "bottomNavigationCommentsTab": "Reacties", "starterAppGenericBody": "Hoofdtekst", "starterAppGenericHeadline": "Kop", "starterAppGenericSubtitle": "Subtitel", "starterAppGenericTitle": "Titel", "starterAppTooltipSearch": "Zoeken", "starterAppTooltipShare": "Delen", "starterAppTooltipFavorite": "Favoriet", "starterAppTooltipAdd": "Toevoegen", "bottomNavigationCalendarTab": "Agenda", "starterAppDescription": "Een responsieve starterlay-out", "starterAppTitle": "Starter-app", "aboutFlutterSamplesRepo": "Flutter-voorbeelden GitHub-repository", "bottomNavigationContentPlaceholder": "Tijdelijke aanduiding voor tabblad {title}", "bottomNavigationCameraTab": "Camera", "bottomNavigationAlarmTab": "Wekker", "bottomNavigationAccountTab": "Account", "demoTextFieldYourEmailAddress": "Je e-mailadres", "demoToggleButtonDescription": "Schakelknoppen kunnen worden gebruikt om gerelateerde opties tot een groep samen te voegen. Een groep moet een gemeenschappelijke container hebben om een groep gerelateerde schakelknoppen te benadrukken.", "colorsGrey": "GRIJS", "colorsBrown": "BRUIN", "colorsDeepOrange": "DIEPORANJE", "colorsOrange": "ORANJE", "colorsAmber": "GEELBRUIN", "colorsYellow": "GEEL", "colorsLime": "LIMOENGROEN", "colorsLightGreen": "LICHTGROEN", "colorsGreen": "GROEN", "homeHeaderGallery": "Galerij", "homeHeaderCategories": "Categorieën", "shrineDescription": "Een modieuze winkel-app", "craneDescription": "Een gepersonaliseerde reis-app", "homeCategoryReference": "STIJLEN EN OVERIG", "demoInvalidURL": "Kan URL niet weergeven:", "demoOptionsTooltip": "Opties", "demoInfoTooltip": "Informatie", "demoCodeTooltip": "Democode", "demoDocumentationTooltip": "API-documentatie", "demoFullscreenTooltip": "Volledig scherm", "settingsTextScaling": "Tekstgrootte", "settingsTextDirection": "Tekstrichting", "settingsLocale": "Land", "settingsPlatformMechanics": "Platformmechanica", "settingsDarkTheme": "Donker", "settingsSlowMotion": "Slow motion", "settingsAbout": "Over Flutter Gallery", "settingsFeedback": "Feedback versturen", "settingsAttribution": "Ontworpen door TOASTER uit Londen", "demoButtonTitle": "Knoppen", "demoButtonSubtitle": "Tekst, verhoogd, contour en meer", "demoFlatButtonTitle": "Platte knop", "demoRaisedButtonDescription": "Verhoogde knoppen voegen een dimensie toe aan vormgevingen die voornamelijk plat zijn. Ze lichten functies uit als de achtergrond druk is of breed wordt weergegeven.", "demoRaisedButtonTitle": "Verhoogde knop", "demoOutlineButtonTitle": "Contourknop", "demoOutlineButtonDescription": "Contourknoppen worden ondoorzichtig en verhoogd als je ze indrukt. Ze worden vaak gekoppeld aan verhoogde knoppen om een alternatieve tweede actie aan te geven.", "demoToggleButtonTitle": "Schakelknoppen", "colorsTeal": "BLAUWGROEN", "demoFloatingButtonTitle": "Zwevende actieknop", "demoFloatingButtonDescription": "Een zwevende actieknop is een knop met een rond icoon die boven content zweeft om een primaire actie in de app te promoten.", "demoDialogTitle": "Dialoogvensters", "demoDialogSubtitle": "Eenvoudig, melding en volledig scherm", "demoAlertDialogTitle": "Melding", "demoAlertDialogDescription": "Een dialoogvenster voor meldingen informeert de gebruiker over situaties die aandacht vereisen. Een dialoogvenster voor meldingen heeft een optionele titel en een optionele lijst met acties.", "demoAlertTitleDialogTitle": "Melding met titel", "demoSimpleDialogTitle": "Eenvoudig", "demoSimpleDialogDescription": "Een eenvoudig dialoogvenster biedt de gebruiker een keuze tussen meerdere opties. Een eenvoudig dialoogvenster bevat een optionele titel die boven de keuzes wordt weergegeven.", "demoFullscreenDialogTitle": "Volledig scherm", "demoCupertinoButtonsTitle": "Knoppen", "demoCupertinoButtonsSubtitle": "Knoppen in iOS-stijl", "demoCupertinoButtonsDescription": "Een knop in iOS-stijl. Deze bevat tekst en/of een icoon dat vervaagt en tevoorschijnkomt bij aanraking. Mag een achtergrond hebben.", "demoCupertinoAlertsTitle": "Meldingen", "demoCupertinoAlertsSubtitle": "Dialoogvensters voor meldingen in iOS-stijl", "demoCupertinoAlertTitle": "Melding", "demoCupertinoAlertDescription": "Een dialoogvenster voor meldingen informeert de gebruiker over situaties die aandacht vereisen. Een dialoogvenster voor meldingen heeft een optionele titel, optionele content en een optionele lijst met acties. De titel wordt boven de content weergegeven en de acties worden onder de content weergegeven.", "demoCupertinoAlertWithTitleTitle": "Melding met titel", "demoCupertinoAlertButtonsTitle": "Melding met knoppen", "demoCupertinoAlertButtonsOnlyTitle": "Alleen meldingknoppen", "demoCupertinoActionSheetTitle": "Actieblad", "demoCupertinoActionSheetDescription": "Een actieblad is een specifieke stijl voor een melding die de gebruiker een set van twee of meer keuzes biedt, gerelateerd aan de huidige context. Een actieblad kan een titel, een aanvullende boodschap en een lijst met acties bevatten.", "demoColorsTitle": "Kleuren", "demoColorsSubtitle": "Alle vooraf gedefinieerde kleuren", "demoColorsDescription": "Constanten van kleuren en kleurstalen die het kleurenpalet van material design vertegenwoordigen.", "buttonTextEnabled": "ENABLED", "buttonTextDisabled": "DISABLED", "buttonTextCreate": "Maken", "dialogSelectedOption": "Je hebt '{value}' geselecteerd", "dialogDiscardTitle": "Concept weggooien?", "dialogLocationTitle": "Locatieservice van Google gebruiken?", "dialogLocationDescription": "Laat Google apps helpen bij het bepalen van de locatie. Dit houdt in dat anonieme locatiegegevens naar Google worden verzonden, zelfs als er geen apps actief zijn.", "dialogCancel": "ANNULEREN", "dialogDiscard": "NIET OPSLAAN", "dialogDisagree": "NIET AKKOORD", "dialogAgree": "AKKOORD", "dialogSetBackup": "Back-upaccount instellen", "colorsBlueGrey": "BLAUWGRIJS", "dialogShow": "DIALOOGVENSTER TONEN", "dialogFullscreenTitle": "Dialoogvenster voor volledig scherm", "dialogFullscreenSave": "OPSLAAN", "dialogFullscreenDescription": "Een demo van een dialoogvenster op volledig scherm", "cupertinoButtonEnabled": "Enabled", "cupertinoButtonDisabled": "Disabled", "cupertinoButtonWithBackground": "Met achtergrond", "cupertinoAlertCancel": "Annuleren", "cupertinoAlertDiscard": "Niet opslaan", "cupertinoAlertLocationTitle": "Wil je Maps toegang geven tot je locatie als je de app gebruikt?", "cupertinoAlertLocationDescription": "Je huidige locatie wordt op de kaart weergegeven en gebruikt voor routes, zoekresultaten in de buurt en geschatte reistijden.", "cupertinoAlertAllow": "Toestaan", "cupertinoAlertDontAllow": "Niet toestaan", "cupertinoAlertFavoriteDessert": "Selecteer je favoriete toetje", "cupertinoAlertDessertDescription": "Selecteer hieronder je favoriete soort toetje uit de lijst. Je selectie wordt gebruikt om de voorgestelde lijst met eetgelegenheden in jouw omgeving aan te passen.", "cupertinoAlertCheesecake": "Kwarktaart", "cupertinoAlertTiramisu": "Tiramisu", "cupertinoAlertApplePie": "Appeltaart", "cupertinoAlertChocolateBrownie": "Chocoladebrownie", "cupertinoShowAlert": "Melding tonen", "colorsRed": "ROOD", "colorsPink": "ROZE", "colorsPurple": "PAARS", "colorsDeepPurple": "DIEPPAARS", "colorsIndigo": "INDIGO", "colorsBlue": "BLAUW", "colorsLightBlue": "LICHTBLAUW", "colorsCyan": "CYAAN", "dialogAddAccount": "Account toevoegen", "Gallery": "Galerij", "Categories": "Categorieën", "SHRINE": "HEILIGDOM", "Basic shopping app": "Algemene shopping-app", "RALLY": "RALLY", "CRANE": "KRAAN", "Travel app": "Reis-app", "MATERIAL": "MATERIAAL", "CUPERTINO": "CUPERTINO", "REFERENCE STYLES & MEDIA": "REFERENTIESTIJLEN EN -MEDIA" }
gallery/lib/l10n/intl_nl.arb/0
{ "file_path": "gallery/lib/l10n/intl_nl.arb", "repo_id": "gallery", "token_count": 19486 }
891
{ "loading": "Inapakia", "deselect": "Acha kuchagua", "select": "Chagua", "selectable": "Inayoweza kuchaguliwa (bonyeza kwa muda mrefu)", "selected": "Imechaguliwa", "demo": "Toleo la kujaribu", "bottomAppBar": "Upau wa chini wa programu", "notSelected": "Hujachagua", "demoCupertinoSearchTextFieldTitle": "Sehemu ya kutafuta maandishi", "demoCupertinoPicker": "Kiteua muundo", "demoCupertinoSearchTextFieldSubtitle": "Sehemu ya kutafuta maandishi ya muundo wa iOS", "demoCupertinoSearchTextFieldDescription": "Sehemu ya kutafuta maandishi inayomuwezesha mtumiaji kutafuta kwa kuweka maandishi na inayoweza kumpatia na kuchuja mapendekezo.", "demoCupertinoSearchTextFieldPlaceholder": "Weka maandishi", "demoCupertinoScrollbarTitle": "Upau wa kusogeza", "demoCupertinoScrollbarSubtitle": "Upau wa kusogeza wa muundo wa iOS", "demoCupertinoScrollbarDescription": "Upau wa kusogeza unaofunika ukurasa wa mwanzo", "demoTwoPaneItem": "Kipengee cha {value}", "demoTwoPaneList": "Orodha", "demoTwoPaneFoldableLabel": "kifaa kinachokunjwa", "demoTwoPaneSmallScreenLabel": "Skrini Ndogo", "demoTwoPaneSmallScreenDescription": "Hivi ndivyo TwoPane hufanya kazi kwenye kifaa chenye skrini ndogo.", "demoTwoPaneTabletLabel": "Kompyuta kibao au Kompyuta ya mezani", "demoTwoPaneTabletDescription": "Hivi ndivyo TwoPane hufanya kazi kwenye kifaa chenye skrini kubwa kama vile kompyuta kibao au kompyuta ya mezani.", "demoTwoPaneTitle": "TwoPane", "demoTwoPaneSubtitle": "Miundo inayoweza kubadilika kwenye skrini kubwa, ndogo na zinazokunjwa", "splashSelectDemo": "Chagua toleo la kujaribu", "demoTwoPaneFoldableDescription": "Hivi ndivyo TwoPane hufanya kazi kwenye kifaa kinachokunjwa.", "demoTwoPaneDetails": "Maelezo", "demoTwoPaneSelectItem": "Chagua kipengee", "demoTwoPaneItemDetails": "Maelezo ya kipengee cha {value}", "demoCupertinoContextMenuActionText": "Gusa na ushikilie nembo ya Flutter ili uone menyu.", "demoCupertinoContextMenuDescription": "Menyu ya skrini nzima ya muundo wa iOS ambayo inaonekana kipengele kinapobonyezwa kwa muda mrefu.", "demoAppBarTitle": "Upau wa programu", "demoAppBarDescription": "Upau wa programu hutoa maudhui na vitendo vinavyohusiana na skrini ya sasa. Unatumika kutangaza chapa, majina ya skrini, usogezaji na vitendo", "demoDividerTitle": "Kigawaji", "demoDividerSubtitle": "Kigawaji ni mstari mwembamba unaoweka maudhui pamoja kwenye orodha na miundo.", "demoDividerDescription": "Vigawaji huweza kutumika kwenye orodha, droo na kwingineko ili kutenganisha maudhui.", "demoVerticalDividerTitle": "Kigawaji cha Wima", "demoCupertinoContextMenuTitle": "Menyu", "demoCupertinoContextMenuSubtitle": "Menyu ya muundo wa iOS", "demoAppBarSubtitle": "Huonyesha maelezo na vitendo vinavyohusiana na skrini ya sasa", "demoCupertinoContextMenuActionOne": "Kitendo cha kwanza", "demoCupertinoContextMenuActionTwo": "Kitendo cha pili", "demoDateRangePickerDescription": "Huonyesha kidirisha chenye kiteua kipindi cha Usanifu Bora.", "demoDateRangePickerTitle": "Kiteua Kipindi", "demoNavigationDrawerUserName": "Jina la Mtumiaji", "demoNavigationDrawerUserEmail": "[email protected]", "demoNavigationDrawerText": "Telezesha kidole kuanzia kwenye ukingo au uguse aikoni iliyo juu kushoto ili uone droo", "demoNavigationRailTitle": "Reli ya Usogezaji", "demoNavigationRailSubtitle": "Inaonyesha Reli ya Usogezaji katika programu", "demoNavigationRailDescription": "Wijeti ya usanifu bora ambayo imeundwa kwa ajili ya kuonyeshwa kwenye upande wa kushoto au kulia wa programu ili kusogeza kati ya idadi ndogo ya kutazamwa, kwa kawaida kati ya tatu na tano.", "demoNavigationRailFirst": "Ya kwanza", "demoNavigationDrawerTitle": "Droo ya Kusogeza", "demoNavigationRailThird": "Ya tatu", "replyStarredLabel": "Zenye Nyota", "demoTextButtonDescription": "Kitufe cha maandishi huonyesha madoadoa ya wino wakati wa kubonyeza lakini hakiinuki. Tumia vitufe vya maandishi kwenye upau wa vidhibiti, katika vidirisha na kulingana na maandishi yenye nafasi", "demoElevatedButtonTitle": "Kitufe Kilichoinuliwa", "demoElevatedButtonDescription": "Vitufe vilivyoinuliwa huongeza kina kwenye miundo iliyo bapa kwa sehemu kubwa. Vinasisitiza utendaji kwenye nafasi pana au yenye shughuli nyingi.", "demoOutlinedButtonTitle": "Kitufe chenye Mpaka wa Mstari", "demoOutlinedButtonDescription": "Vitufe vyenye mipaka ya mistari huwa havipenyezi nuru na huinuka vinapobonyezwa. Mara nyingi vinaoanishwa na vitufe vilivyoinuliwa ili kuashiria kitendo mbadala, cha pili.", "demoContainerTransformDemoInstructions": "Kadi, Orodha na FAB", "demoNavigationDrawerSubtitle": "Inaonyesha droo katika upau wa programu", "replyDescription": "Programu maalum ya barua pepe, yenye ufanisi", "demoNavigationDrawerDescription": "Kidirisha cha Usanifu Bora kinachoteleza kwa mlalo kuanzia ukingo wa skrini ili kuonyesha viungo vya usogezaji katika programu.", "replyDraftsLabel": "Rasimu", "demoNavigationDrawerToPageOne": "Kipengee cha Kwanza", "replyInboxLabel": "Kikasha", "demoSharedXAxisDemoInstructions": "Vitufe vya Kuendelea na Kurudi Nyuma", "replySpamLabel": "Taka", "replyTrashLabel": "Tupio", "replySentLabel": "Zimetumwa", "demoNavigationRailSecond": "Ya pili", "demoNavigationDrawerToPageTwo": "Kipengee cha Pili", "demoFadeScaleDemoInstructions": "Kidirisha na FAB", "demoFadeThroughDemoInstructions": "Usogezaji katika sehemu ya chini", "demoSharedZAxisDemoInstructions": "Kitufe cha aikoni ya mipangilio", "demoSharedYAxisDemoInstructions": "Panga kulingana na \"Ulizocheza Karibuni\"", "demoTextButtonTitle": "Kitufe cha Maandishi", "demoSharedZAxisBeefSandwichRecipeTitle": "Sandwichi ya nyama ya ng'ombe", "demoSharedZAxisDessertRecipeDescription": "Mapishi ya kitindamlo", "demoSharedYAxisAlbumTileSubtitle": "Msanii", "demoSharedYAxisAlbumTileTitle": "Albamu", "demoSharedYAxisRecentSortTitle": "Ulizocheza Karibuni", "demoSharedYAxisAlphabeticalSortTitle": "A-Z", "demoSharedYAxisAlbumCount": "Albamu 268", "demoSharedYAxisTitle": "Mhimili wa y unaoshirikiwa", "demoSharedXAxisCreateAccountButtonText": "FUNGUA AKAUNTI", "demoFadeScaleAlertDialogDiscardButton": "FUTA", "demoSharedXAxisSignInTextFieldLabel": "Anwani ya barua pepe au nambari ya simu", "demoSharedXAxisSignInSubtitleText": "Ingia ukitumia akaunti yako", "demoSharedXAxisSignInWelcomeText": "Hujambo David Park", "demoSharedXAxisIndividualCourseSubtitle": "Huonyeshwa moja moja", "demoSharedXAxisBundledCourseSubtitle": "Imewekwa katika fungu", "demoFadeThroughAlbumsDestination": "Albamu", "demoSharedXAxisDesignCourseTitle": "Muundo", "demoSharedXAxisIllustrationCourseTitle": "Mchoro", "demoSharedXAxisBusinessCourseTitle": "Biashara", "demoSharedXAxisArtsAndCraftsCourseTitle": "Sanaa na Ufundi", "demoMotionPlaceholderSubtitle": "Maandishi ya mada ndogo", "demoFadeScaleAlertDialogCancelButton": "GHAIRI", "demoFadeScaleAlertDialogHeader": "Kidirisha cha Tahadhari", "demoFadeScaleHideFabButton": "FICHA FAB", "demoFadeScaleShowFabButton": "ONYESHA FAB", "demoFadeScaleShowAlertDialogButton": "ONYESHA KIDIRISHA", "demoFadeScaleDescription": "Mchoro wa kufifisha hutumiwa kwenye vipengele vya kiolesura vinavyoingia au kuondoka katika mipaka ya skrini, kama vile kidirisha kinachofifia katikati ya skrini.", "demoFadeScaleTitle": "Fifisha", "demoFadeThroughTextPlaceholder": "Picha 123", "demoFadeThroughSearchDestination": "Tafuta", "demoFadeThroughPhotosDestination": "Picha", "demoSharedXAxisCoursePageSubtitle": "Aina zilizowekwa kwenye mafungu huonekana kama makundi katika mipasho yako. Unaweza kubadilisha mipangilio hii wakati wowote baadaye.", "demoFadeThroughDescription": "Mchoro unaoruhusu kufifisha hutumiwa kubadilisha kati ya vipengele vya kiolesura ambavyo havina uhusiano thabiti kati yake.", "demoFadeThroughTitle": "Inayoruhusu kufifisha", "demoSharedZAxisHelpSettingLabel": "Usaidizi", "demoMotionSubtitle": "Michoro yote ya kubadilisha iliyobainishwa mapema", "demoSharedZAxisNotificationSettingLabel": "Arifa", "demoSharedZAxisProfileSettingLabel": "Wasifu", "demoSharedZAxisSavedRecipesListTitle": "Mapishi Yaliyohifadhiwa", "demoSharedZAxisBeefSandwichRecipeDescription": "Mapishi ya sandwichi ya nyama ya ng'ombe", "demoSharedZAxisCrabPlateRecipeDescription": "Mapishi ya mlo wa kaa", "demoSharedXAxisCoursePageTitle": "Ratibu kozi zako", "demoSharedZAxisCrabPlateRecipeTitle": "Kaa", "demoSharedZAxisShrimpPlateRecipeDescription": "Mapishi ya mlo wa uduvi", "demoSharedZAxisShrimpPlateRecipeTitle": "Uduvi", "demoContainerTransformTypeFadeThrough": "INAYORUHUSU KUFIFISHA", "demoSharedZAxisDessertRecipeTitle": "Kitindamlo", "demoSharedZAxisSandwichRecipeDescription": "Mapishi ya sandwichi", "demoSharedZAxisSandwichRecipeTitle": "Sandwichi", "demoSharedZAxisBurgerRecipeDescription": "Mapishi ya baga", "demoSharedZAxisBurgerRecipeTitle": "Baga", "demoSharedZAxisSettingsPageTitle": "Mipangilio", "demoSharedZAxisTitle": "Mhimili wa z unaoshirikiwa", "demoSharedZAxisPrivacySettingLabel": "Faragha", "demoMotionTitle": "Picha video", "demoContainerTransformTitle": "Ubadilishaji wa Metadata", "demoContainerTransformDescription": "Mchoro wa kubadilisha metadata umeundwa ili kubadilisha kati ya vipengele vya kiolesura ambavyo vinajumuisha metadata. Mchoro huu huunda muunganisho unaoonekana kati ya vipengele viwili vya kiolesura", "demoContainerTransformModalBottomSheetTitle": "Hali ya kufifisha", "demoContainerTransformTypeFade": "FIFISHA", "demoSharedYAxisAlbumTileDurationUnit": "dakika", "demoMotionPlaceholderTitle": "Mada", "demoSharedXAxisForgotEmailButtonText": "JE, UMESAHAU ANWANI YA BARUA PEPE?", "demoMotionSmallPlaceholderSubtitle": "Mada ndogo", "demoMotionDetailsPageTitle": "Ukurasa wa Maelezo", "demoMotionListTileTitle": "Kipengee cha orodha", "demoSharedAxisDescription": "Mchoro wa mhimili unaoshirikiwa hutumika kubadilisha kati ya vipengele vya kiolesura ambavyo vina uhusiano wa uelekezaji au wa eneo. Mchoro huu hutumia ubadilishaji unaoshirikiwa kwenye mhimili wa x, y au z ili kutilia mkazo uhusiano kati ya vipengele.", "demoSharedXAxisTitle": "Mhimili wa x unaoshirikiwa", "demoSharedXAxisBackButtonText": "NYUMA", "demoSharedXAxisNextButtonText": "ENDELEA", "demoSharedXAxisCulinaryCourseTitle": "Upishi", "githubRepo": "{repoName} Hazina ya GitHub", "fortnightlyMenuUS": "Marekani", "fortnightlyMenuBusiness": "Biashara", "fortnightlyMenuScience": "Sayansi", "fortnightlyMenuSports": "Spoti", "fortnightlyMenuTravel": "Usafiri", "fortnightlyMenuCulture": "Utamaduni", "fortnightlyTrendingTechDesign": "Usanifu wa Teknolojia", "rallyBudgetDetailAmountLeft": "Kiasi Kilichosalia", "fortnightlyHeadlineArmy": "Mageuzi ya Jeshi la Kijani Kukota Ndani", "fortnightlyDescription": "Programu ya habari inayoangazia maudhui", "rallyBillDetailAmountDue": "Kiasi Kinachofaa Kulipwa", "rallyBudgetDetailTotalCap": "Jumla ya Kiasi cha Bajeti", "rallyBudgetDetailAmountUsed": "Kiasi Ulichotumia", "fortnightlyTrendingHealthcareRevolution": "Mapinduzi ya Huduma za Afya", "fortnightlyMenuFrontPage": "Ukurasa wa Mbele", "fortnightlyMenuWorld": "Dunia", "rallyBillDetailAmountPaid": "Kiasi Ulicholipa", "fortnightlyMenuPolitics": "Siasa", "fortnightlyHeadlineBees": "Upungufu wa Nyuki wa Shambani", "fortnightlyHeadlineGasoline": "Mustakabali wa Mafuta", "fortnightlyTrendingGreenArmy": "Jeshi la Kijani", "fortnightlyHeadlineFeminists": "Watetezi wa Nadharia ya Haki na Usawa wa Wanawake Wanavyopambana na Ubaguzi", "fortnightlyHeadlineFabrics": "Wanamitindo Wanatumia Teknolojia Kutengeneza Vitambaa vya Kisasa", "fortnightlyHeadlineStocks": "Hisa Zinapodoroa, Wengi Huwekeza Kwenye Sarafu", "fortnightlyTrendingReform": "Mageuzi", "fortnightlyMenuTech": "Teknolojia", "fortnightlyHeadlineWar": "Maisha ya Utengano ya Marekani Wakati wa Vita", "fortnightlyHeadlineHealthcare": "Mapinduzi Kimya, Ila Yenye Nguvu ya Huduma za Afya", "fortnightlyLatestUpdates": "Taarifa za Hivi Karibuni", "fortnightlyTrendingStocks": "Hisa", "rallyBillDetailTotalAmount": "Jumla ya Pesa", "demoCupertinoPickerDateTime": "Tarehe na Wakati", "signIn": "INGIA KATIKA AKAUNTI", "dataTableRowWithSugar": "{value} yenye sukari", "dataTableRowApplePie": "Apple pie", "dataTableRowDonut": "Donut", "dataTableRowHoneycomb": "Honeycomb", "dataTableRowLollipop": "Lollipop", "dataTableRowJellyBean": "Jelly bean", "dataTableRowGingerbread": "Gingerbread", "dataTableRowCupcake": "Cupcake", "dataTableRowEclair": "Eclair", "dataTableRowIceCreamSandwich": "Ice cream sandwich", "dataTableRowFrozenYogurt": "Frozen yogurt", "dataTableColumnIron": "Chuma (%)", "dataTableColumnCalcium": "Kalisi (%)", "dataTableColumnSodium": "Sodiamu (miligramu)", "demoTimePickerTitle": "Kiteua Wakati", "demo2dTransformationsResetTooltip": "Weka upya ubadilishaji", "dataTableColumnFat": "Mafuta (g)", "dataTableColumnCalories": "Kalori", "dataTableColumnDessert": "Kitindamlo (sahani 1)", "cardsDemoTravelDestinationLocation1": "Thanjavur, Tamil Nadu", "demoTimePickerDescription": "Huonyesha kidirisha chenye kiteua wakati cha Usanifu Bora.", "demoPickersShowPicker": "ONYESHA KITEUA", "demoTabsScrollingTitle": "Inayosogeza", "demoTabsNonScrollingTitle": "Isiyosogeza", "craneHours": "{hours,plural,=1{Saa 1}other{Saa {hours}}}", "craneMinutes": "{minutes,plural,=1{Dak 1}other{Dak {minutes}}}", "craneFlightDuration": "{hoursShortForm} {minutesShortForm}", "dataTableHeader": "Lishe", "demoDatePickerTitle": "Kiteua Tarehe", "demoPickersSubtitle": "Kuchagua tarehe na wakati", "demoPickersTitle": "Viteua", "demo2dTransformationsEditTooltip": "Badilisha kigae", "demoDataTableDescription": "Majedwali ya data huonyesha maelezo katika muundo wa gridi ya safu mlalo na safu wima. Hupanga maelezo kwa njia ambayo ni rahisi kukagua, ili watumiaji waweze kutafuta mitindo na maarifa.", "demo2dTransformationsDescription": "Gusa ili ubadilishe vigae na utumie ishara kusogea hapa na pale kwenye tukio. Buruta ili ugeuze upande, bana ili ukuze, zungusha ukitumia vidole viwili. Bonyeza kitufe cha kuweka upya ili urejeshe kwenye mkao wa kuanza.", "demo2dTransformationsSubtitle": "Geuza upande, kuza, zungusha", "demo2dTransformationsTitle": "Ubadilishaji wa 2D", "demoCupertinoTextFieldPIN": "PIN", "demoCupertinoTextFieldDescription": "Sehemu ya maandishi humruhusu mtumiaji kuweka maandishi, kwa kutumia kibodi ya maunzi au kutumia kibodi iliyo kwenye skrini.", "demoCupertinoTextFieldSubtitle": "Sehemu za maandishi za muundo wa iOS", "demoCupertinoTextFieldTitle": "Sehemu za maandishi", "demoDatePickerDescription": "Huonyesha kidirisha chenye kiteua tarehe cha Usanifu Bora.", "demoCupertinoPickerTime": "Wakati", "demoCupertinoPickerDate": "Tarehe", "demoCupertinoPickerTimer": "Kipima muda", "demoCupertinoPickerDescription": "Wijeti ya kiteua muundo wa iOS kinachoweza kutumika kuchagua mifuatano ya herufi au data, tarehe, muda au tarehe pamoja na muda.", "demoCupertinoPickerSubtitle": "Viteua muundo wa iOS", "demoCupertinoPickerTitle": "Viteua", "dataTableRowWithHoney": "{value} yenye asali", "cardsDemoTravelDestinationCity2": "Chettinad", "bannerDemoResetText": "Badilisha bango", "bannerDemoMultipleText": "Vitendo vingi", "bannerDemoLeadingText": "Aikoni ya Msingi", "dismiss": "ONDOA", "cardsDemoTappable": "Inayoweza kuguswa", "cardsDemoSelectable": "Inayoweza kuchaguliwa (bonyeza kwa muda mrefu)", "cardsDemoExplore": "Gundua", "cardsDemoExploreSemantics": "Gundua {destinationName}", "cardsDemoShareSemantics": "Shiriki {destinationName}", "cardsDemoTravelDestinationTitle1": "Miji 10 Maarufu ya Kutembelea jimboni Tamil Nadu", "cardsDemoTravelDestinationDescription1": "Nambari ya 10", "cardsDemoTravelDestinationCity1": "Thanjavur", "dataTableColumnProtein": "Protini (g)", "cardsDemoTravelDestinationTitle2": "Fundi wa India ya Kaskazini", "cardsDemoTravelDestinationDescription2": "Watengenezaji wa Hariri", "bannerDemoText": "Nenosiri lako limesasishwa kwenye kifaa chako kingine. Tafadhali ingia tena katika akaunti.", "cardsDemoTravelDestinationLocation2": "Sivaganga, Tamil Nadu", "cardsDemoTravelDestinationTitle3": "Hekalu la Brihadisvara", "cardsDemoTravelDestinationDescription3": "Hekalu", "demoBannerTitle": "Bango", "demoBannerSubtitle": "Kuonyesha bango katika orodha", "demoBannerDescription": "Bango huonyesha ujumbe muhimu na dhahiri na kuwapa watumiaji hatua za kutekeleza (au kuondoa bango). Mtumiaji anahitajika kuchukua hatua ili kuiondoa.", "demoCardTitle": "Kadi", "demoCardSubtitle": "Kadi za msingi zenye pembe za mviringo", "demoCardDescription": "Kadi ni laha ya Nyenzo inayotumika kuwasilisha maelezo fulani yanayohusiana, kwa mfano maelezo ya anwani, albamu, eneo, mlo n.k.", "demoDataTableTitle": "Majedwali ya Data", "demoDataTableSubtitle": "Safu mlalo na wima za maelezo", "dataTableColumnCarbs": "Kabohaidreti (g)", "placeTanjore": "Tanjore", "demoGridListsTitle": "Orodha za Gridi", "placeFlowerMarket": "Soko la Maua", "placeBronzeWorks": "Kazi ya Shaba", "placeMarket": "Soko", "placeThanjavurTemple": "Hekalu la Thanjavur", "placeSaltFarm": "Shamba la Chumvi", "placeScooters": "Pikipiki", "placeSilkMaker": "Mtengenezaji wa Hariri", "placeLunchPrep": "Matayarisho ya Chamcha", "placeBeach": "Ufuo", "placeFisherman": "Mvuvi", "demoMenuSelected": "Imechaguliwa: {value}", "demoMenuRemove": "Ondoa", "demoMenuGetLink": "Pata kiungo", "demoMenuShare": "Shiriki", "demoBottomAppBarSubtitle": "Huonyesha usogezaji na vitendo katika sehemu ya chini", "demoMenuAnItemWithASectionedMenu": "Kipengee chenye menyu ya vijisehemu", "demoMenuADisabledMenuItem": "Kipengee cha menyu kilichozimwa", "demoLinearProgressIndicatorTitle": "Kiashirio cha Shughuli cha Mstari", "demoMenuContextMenuItemOne": "Kipengee cha kwanza cha menyu", "demoMenuAnItemWithASimpleMenu": "Kipengee chenye menyu sahili", "demoCustomSlidersTitle": "Vitelezi Maalum", "demoMenuAnItemWithAChecklistMenu": "Kipengee chenye menyu ya orodha hakikishi", "demoCupertinoActivityIndicatorTitle": "Kiashirio cha shughuli", "demoCupertinoActivityIndicatorSubtitle": "Viashirio vya shughuli vya muundo wa iOS", "demoCupertinoActivityIndicatorDescription": "Kiashirio cha shughuli cha muundo wa iOS chenye mzunguko wa saa.", "demoCupertinoNavigationBarTitle": "Sehemu ya viungo muhimu", "demoCupertinoNavigationBarSubtitle": "Sehemu ya viungo muhimu ya muundo wa iOs", "demoCupertinoNavigationBarDescription": "Sehemu ya viungo muhimu ya muundo wa iOS. Sehemu ya viungo muhimu ni upau wa vidhibiti ambao kwa kiasi kidogo una kichwa cha ukurasa, katikati ya upau wa vidhibiti.", "demoCupertinoPullToRefreshTitle": "Vuta ili uonyeshe upya", "demoCupertinoPullToRefreshSubtitle": "Kidhibiti cha \"vuta ili uonyeshe upya\" cha muundo wa iOS", "demoCupertinoPullToRefreshDescription": "Wijeti inayotekeleza kidhibiti cha maudhui cha \"vuta ili uonyeshe upya\" cha muundo wa iOS.", "demoProgressIndicatorTitle": "Viashirio vya shughuli", "demoProgressIndicatorSubtitle": "Cha mstari, cha mviringo, kisichopimika", "demoCircularProgressIndicatorTitle": "Kiashirio cha Shughuli cha Mduara", "demoCircularProgressIndicatorDescription": "Kiashirio cha Usanifu Bora cha shughuli cha mduara, kinachozunguka kuonyesha kuwa programu inatumika.", "demoMenuFour": "Nne", "demoLinearProgressIndicatorDescription": "Kiashirio cha Usanifu Bora cha shughuli cha mstari, pia huitwa upau wa shughuli.", "demoTooltipTitle": "Vidirisha vya vidokezo", "demoTooltipSubtitle": "Ujumbe mfupi unaoonyeshwa ukibonyeza kwa muda mrefu au kuelea juu", "demoTooltipDescription": "Vidirisha vya vidokezo hutoa lebo za matini zinazosaidia kueleza umuhimu wa kitufe au kitendo kingine cha kiolesura. Vidirisha vya vidokezo huonyesha matini ya maelezo watumiaji wanapoelea, lenga au kubonyeza kipengee kwa muda mrefu.", "demoTooltipInstructions": "Bonyeza kwa muda mrefu au uelee ili uonyeshe kidirisha cha vidokezo.", "placeChennai": "Chennai", "demoMenuChecked": "Imeteuliwa: {value}", "placeChettinad": "Chettinad", "demoMenuPreview": "Kagua kwanza", "demoBottomAppBarTitle": "Upau wa chini wa programu", "demoBottomAppBarDescription": "Pau za chini za programu hutoa uwezo wa kufikia droo ya chini ya kusogeza na hadi vitendo vinne, ikiwa ni pamoja na kitufe cha kutenda kinachoelea.", "bottomAppBarNotch": "Pengo", "bottomAppBarPosition": "Nafasi ya Kitufe cha Kutenda Kinachoelea", "bottomAppBarPositionDockedEnd": "Kilichoambatishwa - Mwisho", "bottomAppBarPositionDockedCenter": "Kilichoambatishwa - Katikati", "bottomAppBarPositionFloatingEnd": "Kinachoelea - Mwisho", "bottomAppBarPositionFloatingCenter": "Kinachoelea - Katikati", "demoSlidersEditableNumericalValue": "Thamani ya nambari inayoweza kubadilishwa", "demoGridListsSubtitle": "Muundo wa safu mlalo na safu wima", "demoGridListsDescription": "Orodha za Gridi zinafaa zaidi kwa kuwasilisha data ya aina moja, picha kwa kawaida. Kila kipengee katika orodha ya gridi huitwa kigae.", "demoGridListsImageOnlyTitle": "Picha pekee", "demoGridListsHeaderTitle": "Yenye vijajuu", "demoGridListsFooterTitle": "Yenye vijachini", "demoSlidersTitle": "Vitelezi", "demoSlidersSubtitle": "Wijeti za kuchagua thamani kwa kutelezesha kidole", "demoSlidersDescription": "Vitelezi huonyesha thamani mbalimbali kwenye upau, ambapo watumiaji wanaweza kuchagua thamani moja. Hutumika kurekebisha mipangilio kama vile kiwango cha sauti, mwangaza au kutumia vichujio vya picha.", "demoRangeSlidersTitle": "Vitelezi vya Fungu la Visanduku", "demoRangeSlidersDescription": "Vitelezi huonyesha thamani mbalimbali kwenye upau. Vinaweza kuwa na aikoni kwenye pande zote za upau zinazoonyesha thamani mbalimbali. Hutumika kurekebisha mipangilio kama vile kiwango cha sauti, mwangaza au kutumia vichujio vya picha.", "demoMenuAnItemWithAContextMenuButton": "Kipengee chenye menyu", "demoCustomSlidersDescription": "Vitelezi huonyesha thamani mbalimbali kwenye upau, ambapo watumiaji wanaweza kuchagua thamani moja au thamani mbalimbali. Unaweza kuwekea vitelezi mapendeleo na dhamira.", "demoSlidersContinuousWithEditableNumericalValue": "Endelevu yenye Thamani ya Nambari Inayoweza Kubadilishwa", "demoSlidersDiscrete": "Zenye kikomo", "demoSlidersDiscreteSliderWithCustomTheme": "Kitelezi chenye Kikomo kilicho na Mandhari Maalum", "demoSlidersContinuousRangeSliderWithCustomTheme": "Kitelezi cha Fungu Endelevu la Visanduku chenye Mandhari Maalum", "demoSlidersContinuous": "Endelevu", "placePondicherry": "Pondicherry", "demoMenuTitle": "Menyu", "demoContextMenuTitle": "Menyu", "demoSectionedMenuTitle": "Menyu yenye vijisehemu", "demoSimpleMenuTitle": "Menyu sahili", "demoChecklistMenuTitle": "Menyu ya orodha hakikishi", "demoMenuSubtitle": "Vitufe vya menyu na menyu sahili", "demoMenuDescription": "Menyu huonyesha orodha ya chaguo kwenye sehemu ya muda mfupi. Huonekana watumiaji wanapotumia kitufe, kitendo au kidhibiti kingine.", "demoMenuItemValueOne": "Kipengee cha kwanza cha menyu", "demoMenuItemValueTwo": "Kipengee cha pili cha menyu", "demoMenuItemValueThree": "Kipengee cha tatu cha menyu", "demoMenuOne": "Moja", "demoMenuTwo": "Mbili", "demoMenuThree": "Tatu", "demoMenuContextMenuItemThree": "Kipengee cha tatu cha menyu", "demoCupertinoSwitchSubtitle": "Swichi ya muundo wa iOS", "demoSnackbarsText": "Hiki ni kidirisha cha arifa.", "demoCupertinoSliderSubtitle": "Kitelezi cha muundo wa iOS", "demoCupertinoSliderDescription": "Kitelezi kinaweza kutumiwa ili kuchagua kati ya seti za thamani endelevu au zenye kikomo.", "demoCupertinoSliderContinuous": "Endelevu: {value}", "demoCupertinoSliderDiscrete": "Zenye kikomo: {value}", "demoSnackbarsAction": "Umebonyeza kitendo cha kidirisha cha arifa.", "backToGallery": "Rudi kwenye Gallery", "demoCupertinoTabBarTitle": "Upao wa kichupo", "demoCupertinoSwitchDescription": "Swichi inatumika kugeuza hali ya kuwasha/kuzima ya chaguo moja la mipangilio.", "demoSnackbarsActionButtonLabel": "KITENDO", "cupertinoTabBarProfileTab": "Wasifu", "demoSnackbarsButtonLabel": "ONYESHA KIDIRISHA CHA ARIFA", "demoSnackbarsDescription": "Vidirisha vya arifa huwajulisha watumiaji kuhusu mchakato ambao programu imetekeleza au itatekeleza. Huonekana kwa muda mfupi, kuelekea sehemu ya chini ya skrini. Havitakiwi visumbue hali ya utumiaji, na havihitaji mtumiaji achukue hatua yoyote ili viondoke.", "demoSnackbarsSubtitle": "Vidirisha vya arifa huonyesha ujumbe katika sehemu ya chini ya skrini", "demoSnackbarsTitle": "Vidirisha vya arifa", "demoCupertinoSliderTitle": "Kitelezi", "cupertinoTabBarChatTab": "Piga gumzo", "cupertinoTabBarHomeTab": "Skrini ya kwanza", "demoCupertinoTabBarDescription": "Upau wa kichupo cha kusogeza wa upande wa chini wa muundo wa iOS. Huonyesha vichupo vingi huku kichupo kimoja kikitumika, kichupo cha kwanza kwa chaguomsingi.", "demoCupertinoTabBarSubtitle": "Upau wa kichupo wa upande wa chini wa muundo wa iOS", "demoOptionsFeatureTitle": "Angalia chaguo", "demoOptionsFeatureDescription": "Gusa hapa ili uangalie chaguo zinazopatikana kwa onyesho hili.", "demoCodeViewerCopyAll": "NAKILI YOTE", "shrineScreenReaderRemoveProductButton": "Ondoa {product}", "shrineScreenReaderProductAddToCart": "Ongeza kwenye kikapu", "shrineScreenReaderCart": "{quantity,plural,=0{Kikapu, hakuna bidhaa}=1{Kikapu, bidhaa 1}other{Kikapu, bidhaa {quantity}}}", "demoCodeViewerFailedToCopyToClipboardMessage": "Imeshindwa kuyaweka kwenye ubao wa kunakili: {error}", "demoCodeViewerCopiedToClipboardMessage": "Imewekwa kwenye ubao wa kunakili.", "craneSleep8SemanticLabel": "Magofu ya Maya kwenye jabali juu ya ufuo", "craneSleep4SemanticLabel": "Hoteli kando ya ziwa na mbele ya milima", "craneSleep2SemanticLabel": "Ngome ya Machu Picchu", "craneSleep1SemanticLabel": "Nyumba ndogo ya kupumzika katika mandhari ya theluji yenye miti ya kijani kibichi", "craneSleep0SemanticLabel": "Nyumba zisizo na ghorofa zilizojengwa juu ya maji", "craneFly13SemanticLabel": "Bwawa lenye michikichi kando ya bahari", "craneFly12SemanticLabel": "Bwawa lenye michikichi", "craneFly11SemanticLabel": "Mnara wa taa wa matofali baharini", "craneFly10SemanticLabel": "Minara ya Msikiti wa Al-Azhar wakati wa machweo", "craneFly9SemanticLabel": "Mwanaume aliyeegemea gari la kale la samawati", "craneFly8SemanticLabel": "Kijisitu cha Supertree", "craneEat9SemanticLabel": "Kaunta ya mkahawa yenye vitobosha", "craneEat2SemanticLabel": "Baga", "craneFly5SemanticLabel": "Hoteli kando ya ziwa na mbele ya milima", "demoSelectionControlsSubtitle": "Visanduku vya kuteua, vitufe vya mviringo na swichi", "craneEat10SemanticLabel": "Mwanamke aliyeshika sandiwichi kubwa ya pastrami", "craneFly4SemanticLabel": "Nyumba zisizo na ghorofa zilizojengwa juu ya maji", "craneEat7SemanticLabel": "Mlango wa kuingia katika tanuri mikate", "craneEat6SemanticLabel": "Chakula cha uduvi", "craneEat5SemanticLabel": "Eneo la kukaa la mkahawa wa kisanii", "craneEat4SemanticLabel": "Kitindamlo cha chokoleti", "craneEat3SemanticLabel": "Taco ya Kikorea", "craneFly3SemanticLabel": "Ngome ya Machu Picchu", "craneEat1SemanticLabel": "Baa tupu yenye stuli za muundo wa behewa", "craneEat0SemanticLabel": "Piza ndani ya tanuri la kuni", "craneSleep11SemanticLabel": "Maghorofa ya Taipei 101", "craneSleep10SemanticLabel": "Minara ya Msikiti wa Al-Azhar wakati wa machweo", "craneSleep9SemanticLabel": "Mnara wa taa wa matofali baharini", "craneEat8SemanticLabel": "Sahani ya kamba wa maji baridi", "craneSleep7SemanticLabel": "Nyumba maridadi katika Mraba wa Riberia", "craneSleep6SemanticLabel": "Bwawa lenye michikichi", "craneSleep5SemanticLabel": "Hema katika uwanja", "settingsButtonCloseLabel": "Funga mipangilio", "demoSelectionControlsCheckboxDescription": "Visanduku vya kuteua humruhusu mtumiaji kuteua chaguo nyingi kwenye seti. Thamani ya kawaida ya kisanduku cha kuteua ni ndivyo au saivyo na thamani ya hali tatu ya kisanduku cha kuteua pia inaweza kuwa batili.", "settingsButtonLabel": "Mipangilio", "demoListsTitle": "Orodha", "demoListsSubtitle": "Miundo ya orodha za kusogeza", "demoListsDescription": "Safu wima moja ya urefu usiobadilika ambayo kwa kawaida ina baadhi ya maandishi na pia aikoni ya mwanzoni au mwishoni.", "demoOneLineListsTitle": "Mstari Mmoja", "demoTwoLineListsTitle": "Mistari Miwili", "demoListsSecondary": "Maandishi katika mstari wa pili", "demoSelectionControlsTitle": "Vidhibiti vya kuteua", "craneFly7SemanticLabel": "Mlima Rushmore", "demoSelectionControlsCheckboxTitle": "Kisanduku cha kuteua", "craneSleep3SemanticLabel": "Mwanaume aliyeegemea gari la kale la samawati", "demoSelectionControlsRadioTitle": "Redio", "demoSelectionControlsRadioDescription": "Vitufe vya mviringo humruhusu mtumiaji kuteua chaguo moja kwenye seti. Tumia vitufe vya mviringo kwa uteuzi wa kipekee ikiwa unafikiri kuwa mtumiaji anahitaji kuona chaguo zote upande kwa upande.", "demoSelectionControlsSwitchTitle": "Swichi", "demoSelectionControlsSwitchDescription": "Swichi za kuwasha/kuzima hugeuza hali ya chaguo moja la mipangilio. Chaguo ambalo linadhibitiwa na swichi pamoja na hali ya chaguo hilo, linapaswa kubainishwa wazi kwenye lebo inayolingana na maandishi.", "craneFly0SemanticLabel": "Nyumba ndogo ya kupumzika katika mandhari ya theluji yenye miti ya kijani kibichi", "craneFly1SemanticLabel": "Hema katika uwanja", "craneFly2SemanticLabel": "Bendera za maombi mbele ya mlima uliofunikwa kwa theluji", "craneFly6SemanticLabel": "Mwonekeno wa juu wa Palacio de Bellas Artes", "rallySeeAllAccounts": "Angalia akaunti zote", "rallyBillAmount": "Bili ya {amount} ya {billName} inapaswa kulipwa {date}.", "shrineTooltipCloseCart": "Funga kikapu", "shrineTooltipCloseMenu": "Funga menyu", "shrineTooltipOpenMenu": "Fungua menyu", "shrineTooltipSettings": "Mipangilio", "shrineTooltipSearch": "Tafuta", "demoTabsDescription": "Vichupo hupanga maudhui kwenye skrini tofauti, seti za data na shughuli zingine.", "demoTabsSubtitle": "Vichupo vyenye mionekano huru inayoweza kusogezwa", "demoTabsTitle": "Vichupo", "rallyBudgetAmount": "Bajeti ya {budgetName} yenye {amountUsed} ambazo zimetumika kati ya {amountTotal}, zimesalia {amountLeft}", "shrineTooltipRemoveItem": "Ondoa bidhaa", "rallyAccountAmount": "Akaunti ya {accountName} {accountNumber} iliyo na {amount}.", "rallySeeAllBudgets": "Angalia bajeti zote", "rallySeeAllBills": "Angalia bili zote", "craneFormDate": "Chagua Tarehe", "craneFormOrigin": "Chagua Asili", "craneFly2": "Bonde la Khumbu, NepalI", "craneFly3": "Machu Picchu, Peruu", "craneFly4": "Malé, Maldives", "craneFly5": "Vitznau, Uswisi", "craneFly6": "Jiji la Meksiko, Meksiko", "craneFly7": "Mount Rushmore, Marekani", "settingsTextDirectionLocaleBased": "Kulingana na lugha", "craneFly9": "Havana, Kuba", "craneFly10": "Kairo, Misri", "craneFly11": "Lisbon, Ureno", "craneFly12": "Napa, Marekani", "craneFly13": "Bali, Indonesia", "craneSleep0": "Malé, Maldives", "craneSleep1": "Aspen, Marekani", "craneSleep2": "Machu Picchu, Peruu", "demoCupertinoSegmentedControlTitle": "Udhibiti wa vikundi", "craneSleep4": "Vitznau, Uswisi", "craneSleep5": "Big Sur, Marekani", "craneSleep6": "Napa, Marekani", "craneSleep7": "Porto, Ureno", "craneSleep8": "Tulum, Meksiko", "craneEat5": "Seoul, Korea Kusini", "demoChipTitle": "Chipu", "demoChipSubtitle": "Vipengee vilivyoshikamana vinavyowakilisha ingizo, sifa au kitendo", "demoActionChipTitle": "Chipu ya Kutenda", "demoActionChipDescription": "Chipu za kutenda ni seti ya chaguo zinazosababisha kitendo kinachohusiana na maudhui ya msingi. Chipu za kutenda zinafaa kuonekana kwa urahisi na kwa utaratibu katika kiolesura.", "demoChoiceChipTitle": "Chipu ya Kuchagua", "demoChoiceChipDescription": "Chipu za kuchagua zinawakilisha chaguo moja kwenye seti. Chipu za kuchagua zina aina au maandishi ya ufafanuzi yanayohusiana.", "demoFilterChipTitle": "Chipu ya Kichujio", "demoFilterChipDescription": "Chipu za kuchuja hutumia lebo au maneno ya ufafanuzi kama mbinu ya kuchuja maudhui.", "demoInputChipTitle": "Chipu ya Kuingiza", "demoInputChipDescription": "Chipu za kuingiza huwakilisha taarifa ya kina, kama vile huluki (mtu, mahali au kitu) au maandishi ya mazungumzo katika muundo wa kushikamana.", "craneSleep9": "Lisbon, Ureno", "craneEat10": "Lisbon, Ureno", "demoCupertinoSegmentedControlDescription": "Hutumika kuchagua kati ya chaguo kadhaa za kipekee. Chaguo moja katika udhibiti wa vikundi ikichaguliwa, chaguo zingine katika udhibiti wa vikundi hazitachaguliwa.", "chipTurnOnLights": "Washa taa", "chipSmall": "Ndogo", "chipMedium": "Wastani", "chipLarge": "Kubwa", "chipElevator": "Lifti", "chipWasher": "Mashine ya kufua nguo", "chipFireplace": "Mekoni", "chipBiking": "Kuendesha baiskeli", "craneFormDiners": "Migahawa", "rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{Ongeza kiwango cha kodi unayoweza kupunguziwa! Weka aina kwenye muamala 1 ambao hauna aina.}other{Ongeza kiwango cha kodi unayoweza kupunguziwa! Weka aina kwenye miamala {count} ambayo haina aina.}}", "craneFormTime": "Chagua Wakati", "craneFormLocation": "Chagua Eneo", "craneFormTravelers": "Wasafiri", "craneEat8": "Atlanta, Marekani", "craneFormDestination": "Chagua Unakoenda", "craneFormDates": "Chagua Tarehe", "craneFly": "RUKA", "craneSleep": "HALI TULI", "craneEat": "KULA", "craneFlySubhead": "Gundua Ndege kwa Kutumia Vituo", "craneSleepSubhead": "Gundua Mali kwa Kutumia Vituo", "craneEatSubhead": "Gundua Mikahawa kwa Kutumia Vituo", "craneFlyStops": "{numberOfStops,plural,=0{Moja kwa moja}=1{Kituo 1}other{Vituo {numberOfStops}}}", "craneSleepProperties": "{totalProperties,plural,=0{Hakuna Mali Inayopatikana}=1{Mali 1 Inayopatikana}other{Mali {totalProperties} Zinazopatikana}}", "craneEatRestaurants": "{totalRestaurants,plural,=0{Hakuna Mikahawa}=1{Mkahawa 1}other{Mikahawa {totalRestaurants}}}", "craneFly0": "Aspen, Marekani", "demoCupertinoSegmentedControlSubtitle": "Udhibiti wa vikundi vya muundo wa iOS", "craneSleep10": "Kairo, Misri", "craneEat9": "Madrid, Uhispania", "craneFly1": "Big Sur, Marekani", "craneEat7": "Nashville, Marekani", "craneEat6": "Seattle, Marekani", "craneFly8": "Singapoo", "craneEat4": "Paris, Ufaransa", "craneEat3": "Portland, Marekani", "craneEat2": "Córdoba, Ajentina", "craneEat1": "Dallas, Marekani", "craneEat0": "Naples, Italia", "craneSleep11": "Taipei, Taiwani", "craneSleep3": "Havana, Kuba", "shrineLogoutButtonCaption": "ONDOKA", "rallyTitleBills": "BILI", "rallyTitleAccounts": "AKAUNTI", "shrineProductVagabondSack": "Mfuko wa mgongoni", "rallyAccountDetailDataInterestYtd": "Riba ya Mwaka hadi leo", "shrineProductWhitneyBelt": "Mshipi wa Whitney", "shrineProductGardenStrand": "Garden strand", "shrineProductStrutEarrings": "Herini", "shrineProductVarsitySocks": "Soksi za Varsity", "shrineProductWeaveKeyring": "Pete ya ufunguo ya Weave", "shrineProductGatsbyHat": "Kofia ya Gatsby", "shrineProductShrugBag": "Mkoba", "shrineProductGiltDeskTrio": "Vifaa vya dawatini", "shrineProductCopperWireRack": "Copper wire rack", "shrineProductSootheCeramicSet": "Vyombo vya kauri vya Soothe", "shrineProductHurrahsTeaSet": "Vyombo vya chai", "shrineProductBlueStoneMug": "Magi ya Blue stone", "shrineProductRainwaterTray": "Trei ya maji", "shrineProductChambrayNapkins": "Kitambaa cha Chambray", "shrineProductSucculentPlanters": "Mimea", "shrineProductQuartetTable": "Meza", "shrineProductKitchenQuattro": "Kitchen quattro", "shrineProductClaySweater": "Sweta ya Clay", "shrineProductSeaTunic": "Sweta ya kijivu", "shrineProductPlasterTunic": "Gwanda la Plaster", "rallyBudgetCategoryRestaurants": "Mikahawa", "shrineProductChambrayShirt": "Shati ya Chambray", "shrineProductSeabreezeSweater": "Sweta ya Seabreeze", "shrineProductGentryJacket": "Jaketi ya ngozi", "shrineProductNavyTrousers": "Suruali ya buluu", "shrineProductWalterHenleyWhite": "Fulana ya vifungo (nyeupe)", "shrineProductSurfAndPerfShirt": "Shati ya Surf and perf", "shrineProductGingerScarf": "Skafu ya Ginger", "shrineProductRamonaCrossover": "Blauzi iliyofunguka kidogo kifuani", "shrineProductClassicWhiteCollar": "Blauzi nyeupe ya kawaida", "shrineProductSunshirtDress": "Nguo", "rallyAccountDetailDataInterestRate": "Kiwango cha Riba", "rallyAccountDetailDataAnnualPercentageYield": "Asilimia ya Mapato kila Mwaka", "rallyAccountDataVacation": "Likizo", "shrineProductFineLinesTee": "Fulana yenye milia", "rallyAccountDataHomeSavings": "Akiba ya Nyumbani", "rallyAccountDataChecking": "Inakagua", "rallyAccountDetailDataInterestPaidLastYear": "Riba Iliyolipwa Mwaka Uliopita", "rallyAccountDetailDataNextStatement": "Taarifa Inayofuata", "rallyAccountDetailDataAccountOwner": "Mmiliki wa Akaunti", "rallyBudgetCategoryCoffeeShops": "Maduka ya Kahawa", "rallyBudgetCategoryGroceries": "Maduka ya vyakula", "shrineProductCeriseScallopTee": "Fulana ya Cerise", "rallyBudgetCategoryClothing": "Mavazi", "rallySettingsManageAccounts": "Dhibiti Akaunti", "rallyAccountDataCarSavings": "Akiba ya Gari", "rallySettingsTaxDocuments": "Hati za Kodi", "rallySettingsPasscodeAndTouchId": "Nambari ya siri na Touch ID", "rallySettingsNotifications": "Arifa", "rallySettingsPersonalInformation": "Taarifa Binafsi", "rallySettingsPaperlessSettings": "Mipangilio ya Kutotumia Karatasi", "rallySettingsFindAtms": "Tafuta ATM", "rallySettingsHelp": "Usaidizi", "rallySettingsSignOut": "Ondoka", "rallyAccountTotal": "Jumla", "rallyBillsDue": "Zinahitajika mnamo", "rallyBudgetLeft": "Kushoto", "rallyAccounts": "Akaunti", "rallyBills": "Bili", "rallyBudgets": "Bajeti", "rallyAlerts": "Arifa", "rallySeeAll": "ANGALIA YOTE", "rallyFinanceLeft": "KUSHOTO", "rallyTitleOverview": "MUHTASARI", "shrineProductShoulderRollsTee": "Fulana ya mikono", "shrineNextButtonCaption": "ENDELEA", "rallyTitleBudgets": "BAJETI", "rallyTitleSettings": "MIPANGILIO", "rallyLoginLoginToRally": "Ingia katika programu ya Rally", "rallyLoginNoAccount": "Huna akaunti?", "rallyLoginSignUp": "JISAJILI", "rallyLoginUsername": "Jina la mtumiaji", "rallyLoginPassword": "Nenosiri", "rallyLoginLabelLogin": "Ingia katika akaunti", "rallyLoginRememberMe": "Nikumbuke", "rallyLoginButtonLogin": "INGIA KATIKA AKAUNTI", "rallyAlertsMessageHeadsUpShopping": "Ilani: umetumia {percent} ya bajeti yako ya Ununuzi kwa mwezi huu.", "rallyAlertsMessageSpentOnRestaurants": "Umetumia {amount} kwenye Migahawa wiki hii.", "rallyAlertsMessageATMFees": "Umetumia {amount} katika ada za ATM mwezi huu", "rallyAlertsMessageCheckingAccount": "Kazi nzuri! Kiwango cha akaunti yako ya hundi kimezidi cha mwezi uliopita kwa {percent}.", "shrineMenuCaption": "MENYU", "shrineCategoryNameAll": "ZOTE", "shrineCategoryNameAccessories": "VIFUASI", "shrineCategoryNameClothing": "MAVAZI", "shrineCategoryNameHome": "NYUMBANI", "shrineLoginUsernameLabel": "Jina la mtumiaji", "shrineLoginPasswordLabel": "Nenosiri", "shrineCancelButtonCaption": "GHAIRI", "shrineCartTaxCaption": "Ushuru:", "shrineCartPageCaption": "KIKAPU", "shrineProductQuantity": "Kiasi: {quantity}", "shrineProductPrice": "x {price}", "shrineCartItemCount": "{quantity,plural,=0{HAKUNA BIDHAA}=1{BIDHAA 1}other{BIDHAA {quantity}}}", "shrineCartClearButtonCaption": "ONDOA KILA KITU KWENYE KIKAPU", "shrineCartTotalCaption": "JUMLA", "shrineCartSubtotalCaption": "Jumla ndogo:", "shrineCartShippingCaption": "Usafirishaji:", "shrineProductGreySlouchTank": "Fulana yenye mikono mifupi", "shrineProductStellaSunglasses": "Miwani ya Stella", "shrineProductWhitePinstripeShirt": "Shati nyeupe yenye milia", "demoTextFieldWhereCanWeReachYou": "Je, tunawezaje kuwasiliana nawe?", "settingsTextDirectionLTR": "Kushoto kuelekea kulia", "settingsTextScalingLarge": "Kubwa", "demoBottomSheetHeader": "Kijajuu", "demoBottomSheetItem": "Bidhaa ya {value}", "demoBottomTextFieldsTitle": "Sehemu za maandishi", "demoTextFieldTitle": "Sehemu za maandishi", "demoTextFieldSubtitle": "Mstari mmoja wa maandishi na nambari zinazoweza kubadilishwa", "demoTextFieldDescription": "Sehemu za maandishi huwaruhusu watumiaji kuweka maandishi kwenye kiolesura. Kwa kawaida huwa zinaonekana katika fomu na vidirisha.", "demoTextFieldShowPasswordLabel": "Onyesha nenosiri", "demoTextFieldHidePasswordLabel": "Ficha nenosiri", "demoTextFieldFormErrors": "Tafadhali tatua hitilafu zilizo katika rangi nyekundu kabla ya kuwasilisha.", "demoTextFieldNameRequired": "Ni sharti ujaze jina.", "demoTextFieldOnlyAlphabeticalChars": "Tafadhali weka herufi za kialfabeti pekee.", "demoTextFieldEnterUSPhoneNumber": "(###) ###-#### - Weka nambari ya simu ya Marekani.", "demoTextFieldEnterPassword": "Tafadhali weka nenosiri.", "demoTextFieldPasswordsDoNotMatch": "Manenosiri hayalingani", "demoTextFieldWhatDoPeopleCallYou": "Je, watu hukuitaje?", "demoTextFieldNameField": "Jina*", "demoBottomSheetButtonText": "ONYESHA LAHA YA CHINI", "demoTextFieldPhoneNumber": "Nambari ya simu*", "demoBottomSheetTitle": "Laha ya chini", "demoTextFieldEmail": "Barua pepe", "demoTextFieldTellUsAboutYourself": "Tueleze kukuhusu (k.m., andika kazi unayofanya au mambo unayopenda kupitishia muda)", "demoTextFieldKeepItShort": "Tumia herufi chache, hili ni onyesho tu.", "starterAppGenericButton": "KITUFE", "demoTextFieldLifeStory": "Hadithi ya wasifu", "demoTextFieldSalary": "Mshahara", "demoTextFieldUSD": "USD", "demoTextFieldNoMoreThan": "Zisizozidi herufi 8.", "demoTextFieldPassword": "Nenosiri*", "demoTextFieldRetypePassword": "Andika tena nenosiri*", "demoTextFieldSubmit": "TUMA", "demoBottomNavigationSubtitle": "Usogezaji katika sehemu ya chini na mwonekano unaofifia kwa kupishana", "demoBottomSheetAddLabel": "Ongeza", "demoBottomSheetModalDescription": "Laha ya kawaida ya chini ni mbadala wa menyu au kidirisha na humzuia mtumiaji kutumia sehemu inayosalia ya programu.", "demoBottomSheetModalTitle": "Laha ya kawaida ya chini", "demoBottomSheetPersistentDescription": "Laha endelevu ya chini huonyesha maelezo yanayojaliza maudhui ya msingi ya programu. Laha endelevu ya chini huendelea kuonekana hata wakati mtumiaji anatumia sehemu zingine za programu.", "demoBottomSheetPersistentTitle": "Laha endelevu ya chini", "demoBottomSheetSubtitle": "Laha za kawaida na endelevu za chini", "demoTextFieldNameHasPhoneNumber": "Nambari ya simu ya {name} ni {phoneNumber}", "buttonText": "KITUFE", "demoTypographyDescription": "Ufafanuzi wa miundo mbalimbali ya taipografia inayopatikana katika Usanifu Bora.", "demoTypographySubtitle": "Miundo yote ya maandishi iliyobainishwa", "demoTypographyTitle": "Taipografia", "demoFullscreenDialogDescription": "Sifa ya fullscreenDialog hubainisha iwapo ukurasa ujao ni wa kidirisha cha kawaida cha skrini nzima", "demoFlatButtonDescription": "Kitufe bapa huonyesha madoadoa ya wino wakati wa kubonyeza lakini hakiinuki. Tumia vitufe bapa kwenye upau wa vidhibiti, katika vidirisha na kulingana na maandishi yenye nafasi", "demoBottomNavigationDescription": "Sehemu za chini za viungo muhimu huonyesha vituo vitatu hadi vitano katika sehemu ya chini ya skrini. Kila kituo kinawakilishwa na aikoni na lebo ya maandishi isiyo ya lazima. Aikoni ya usogezaji ya chini inapoguswa, mtumiaji hupelekwa kwenye kituo cha usogezaji cha kiwango cha juu kinachohusiana na aikoni hiyo.", "demoBottomNavigationSelectedLabel": "Lebo iliyochaguliwa", "demoBottomNavigationPersistentLabels": "Lebo endelevu", "starterAppDrawerItem": "Bidhaa ya {value}", "demoTextFieldRequiredField": "* inaonyesha sehemu ambayo sharti ijazwe", "demoBottomNavigationTitle": "Usogezaji katika sehemu ya chini", "settingsLightTheme": "Meupe", "settingsTheme": "Mandhari", "settingsPlatformIOS": "iOS", "settingsPlatformAndroid": "Android", "settingsTextDirectionRTL": "Kulia kuelekea kushoto", "settingsTextScalingHuge": "Kubwa", "cupertinoButton": "Kitufe", "settingsTextScalingNormal": "Ya Kawaida", "settingsTextScalingSmall": "Ndogo", "settingsSystemDefault": "Mfumo", "settingsTitle": "Mipangilio", "rallyDescription": "Programu ya fedha ya binafsi", "aboutDialogDescription": "Ili uangalie msimbo wa programu hii, tafadhali tembelea {repoLink}.", "bottomNavigationCommentsTab": "Maoni", "starterAppGenericBody": "Mwili", "starterAppGenericHeadline": "Kichwa", "starterAppGenericSubtitle": "Kichwa kidogo", "starterAppGenericTitle": "Kichwa", "starterAppTooltipSearch": "Tafuta", "starterAppTooltipShare": "Shiriki", "starterAppTooltipFavorite": "Kipendwa", "starterAppTooltipAdd": "Ongeza", "bottomNavigationCalendarTab": "Kalenda", "starterAppDescription": "Muundo wa kuanzisha unaobadilika kulingana na kifaa", "starterAppTitle": "Programu ya kuanza", "aboutFlutterSamplesRepo": "Hifadhi ya GitHub ya sampuli za Flutter", "bottomNavigationContentPlaceholder": "Kishikilia nafasi cha kichupo cha {title}", "bottomNavigationCameraTab": "Kamera", "bottomNavigationAlarmTab": "Kengele", "bottomNavigationAccountTab": "Akaunti", "demoTextFieldYourEmailAddress": "Anwani yako ya barua pepe", "demoToggleButtonDescription": "Vitufe vya kugeuza vinaweza kutumiwa kuweka chaguo zinazohusiana katika vikundi. Ili kusisitiza vikundi vya vitufe vya kugeuza vinavyohusiana, kikundi kinafaa kushiriki metadata ya kawaida", "colorsGrey": "KIJIVU", "colorsBrown": "HUDHURUNGI", "colorsDeepOrange": "RANGI YA MACHUNGWA ILIYOKOLEA", "colorsOrange": "RANGI YA MACHUNGWA", "colorsAmber": "KAHARABU", "colorsYellow": "MANJANO", "colorsLime": "RANGI YA NDIMU", "colorsLightGreen": "KIJANI KISICHOKOLEA", "colorsGreen": "KIJANI", "homeHeaderGallery": "Matunzio", "homeHeaderCategories": "Aina", "shrineDescription": "Programu ya kisasa ya uuzaji wa rejareja", "craneDescription": "Programu ya usafiri iliyogeuzwa kukufaa", "homeCategoryReference": "MIUNDO NA MENGINE", "demoInvalidURL": "Imeshindwa kuonyesha URL:", "demoOptionsTooltip": "Chaguo", "demoInfoTooltip": "Maelezo", "demoCodeTooltip": "Msimbo wa Onyesho", "demoDocumentationTooltip": "Uwekaji hati wa API", "demoFullscreenTooltip": "Skrini Nzima", "settingsTextScaling": "Ubadilishaji ukubwa wa maandishi", "settingsTextDirection": "Mwelekeo wa maandishi", "settingsLocale": "Lugha", "settingsPlatformMechanics": "Umakanika wa mfumo", "settingsDarkTheme": "Meusi", "settingsSlowMotion": "Mwendopole", "settingsAbout": "Kuhusu Matunzio ya Flutter", "settingsFeedback": "Tuma maoni", "settingsAttribution": "Imebuniwa na TOASTER mjini London", "demoButtonTitle": "Vitufe", "demoButtonSubtitle": "Kilichoinuliwa, chenye mpaka wa mstari, maandishi na zaidi", "demoFlatButtonTitle": "Kitufe Bapa", "demoRaisedButtonDescription": "Vitufe vilivyoinuliwa huongeza kivimbe kwenye miundo iliyo bapa kwa sehemu kubwa. Vinasisitiza utendaji kwenye nafasi pana au yenye shughuli nyingi.", "demoRaisedButtonTitle": "Kitufe Kilichoinuliwa", "demoOutlineButtonTitle": "Kitufe chenye Mpaka wa Mstari", "demoOutlineButtonDescription": "Vitufe vya mipaka ya mistari huwa havipenyezi nuru na huinuka vinapobonyezwa. Mara nyingi vinaoanishwa na vitufe vilivyoinuliwa ili kuashiria kitendo mbadala, cha pili.", "demoToggleButtonTitle": "Vitufe vya Kugeuza", "colorsTeal": "SAMAWATI YA KIJANI", "demoFloatingButtonTitle": "Kitufe cha Kutenda Kinachoelea", "demoFloatingButtonDescription": "Kitufe cha kutenda kinachoelea ni kitufe cha aikoni ya mduara kinachoelea juu ya maudhui ili kukuza kitendo cha msingi katika programu.", "demoDialogTitle": "Vidirisha", "demoDialogSubtitle": "Rahisi, arifa na skrini nzima", "demoAlertDialogTitle": "Arifa", "demoAlertDialogDescription": "Kidirisha cha arifa humjulisha mtumiaji kuhusu hali zinazohitaji uthibitisho. Kidirisha cha arifa kina kichwa kisicho cha lazima na orodha isiyo ya lazima ya vitendo.", "demoAlertTitleDialogTitle": "Arifa Yenye Jina", "demoSimpleDialogTitle": "Rahisi", "demoSimpleDialogDescription": "Kidirisha rahisi humpa mtumiaji chaguo kati ya chaguo nyingi. Kidirisha rahisi kina kichwa kisicho cha lazima kinachoonyeshwa juu ya chaguo.", "demoFullscreenDialogTitle": "Skrini nzima", "demoCupertinoButtonsTitle": "Vitufe", "demoCupertinoButtonsSubtitle": "Vitufe vya muundo wa iOS", "demoCupertinoButtonsDescription": "Kitufe cha muundo wa iOS. Huchukua maandishi na/au aikoni ambayo hufifia nje na ndani inapoguswa. Huenda kwa hiari ikawa na mandharinyuma.", "demoCupertinoAlertsTitle": "Arifa", "demoCupertinoAlertsSubtitle": "Vidirisha vya arifa vya muundo wa iOS.", "demoCupertinoAlertTitle": "Arifa", "demoCupertinoAlertDescription": "Kidirisha cha arifa humjulisha mtumiaji kuhusu hali zinazohitaji uthibitisho. Kidirisha cha arifa kina kichwa kisicho cha lazima, maudhui yasiyo ya lazima na orodha isiyo ya lazima ya vitendo. Kichwa huonyeshwa juu ya maudhui na vitendo huonyeshwa chini ya maudhui.", "demoCupertinoAlertWithTitleTitle": "Arifa Yenye Kichwa", "demoCupertinoAlertButtonsTitle": "Arifa Zenye Vitufe", "demoCupertinoAlertButtonsOnlyTitle": "Vitufe vya Arifa Pekee", "demoCupertinoActionSheetTitle": "Laha la Kutenda", "demoCupertinoActionSheetDescription": "Laha ya kutenda ni muundo mahususi wa arifa unaompa mtumiaji seti ya chaguo mbili au zaidi zinazohusiana na muktadha wa sasa. Laha ya kutenda inaweza kuwa na kichwa, ujumbe wa ziada na orodha ya vitendo.", "demoColorsTitle": "Rangi", "demoColorsSubtitle": "Rangi zote zilizobainishwa mapema", "demoColorsDescription": "Rangi na seti ya rangi isiyobadilika ambayo inawakilisha safu ya rangi ya Usanifu Bora.", "buttonTextEnabled": "ENABLED", "buttonTextDisabled": "DISABLED", "buttonTextCreate": "Fungua", "dialogSelectedOption": "Umechagua: \"{value}\"", "dialogDiscardTitle": "Ungependa kufuta rasimu?", "dialogLocationTitle": "Ungependa kutumia huduma ya mahali ya Google?", "dialogLocationDescription": "Ruhusu Google isaidie programu kutambua mahali. Hii inamaanisha kutuma data isiyokutambulisha kwa Google, hata wakati hakuna programu zinazotumika.", "dialogCancel": "GHAIRI", "dialogDiscard": "ONDOA", "dialogDisagree": "KATAA", "dialogAgree": "KUBALI", "dialogSetBackup": "Weka akaunti ya kuhifadhi nakala", "colorsBlueGrey": "SAMAWATI YA KIJIVU", "dialogShow": "ONYESHA KIDIRISHA", "dialogFullscreenTitle": "Kidirisha cha Skrini Nzima", "dialogFullscreenSave": "HIFADHI", "dialogFullscreenDescription": "Onyesho la kidirisha cha skrini nzima", "cupertinoButtonEnabled": "Enabled", "cupertinoButtonDisabled": "Disabled", "cupertinoButtonWithBackground": "Na Mandharinyuma", "cupertinoAlertCancel": "Ghairi", "cupertinoAlertDiscard": "Ondoa", "cupertinoAlertLocationTitle": "Ungependa kuruhusu \"Ramani\" zifikie maelezo ya mahali ulipo unapotumia programu?", "cupertinoAlertLocationDescription": "Mahali ulipo sasa pataonyeshwa kwenye ramani na kutumiwa kwa maelekezo, matokeo ya utafutaji wa karibu na muda uliokadiriwa wa kusafiri.", "cupertinoAlertAllow": "Ruhusu", "cupertinoAlertDontAllow": "Usiruhusu", "cupertinoAlertFavoriteDessert": "Chagua Kitindamlo Unachopenda", "cupertinoAlertDessertDescription": "Tafadhali chagua aina unayoipenda ya kitindamlo kwenye orodha iliyo hapa chini. Uteuzi wako utatumiwa kuweka mapendeleo kwenye orodha iliyopendekezwa ya mikahawa katika eneo lako.", "cupertinoAlertCheesecake": "Keki ya jibini", "cupertinoAlertTiramisu": "Tiramisu", "cupertinoAlertApplePie": "Mkate wa Tufaha", "cupertinoAlertChocolateBrownie": "Keki ya Chokoleti", "cupertinoShowAlert": "Onyesha Arifa", "colorsRed": "NYEKUNDU", "colorsPink": "WARIDI", "colorsPurple": "ZAMBARAU", "colorsDeepPurple": "ZAMBARAU ILIYOKOLEA", "colorsIndigo": "NILI", "colorsBlue": "SAMAWATI", "colorsLightBlue": "SAMAWATI ISIYOKOLEA", "colorsCyan": "SAMAWATI-KIJANI", "dialogAddAccount": "Ongeza akaunti", "Gallery": "Matunzio", "Categories": "Aina", "SHRINE": "MADHABAHU", "Basic shopping app": "Programu ya msingi ya ununuzi", "RALLY": "MASHINDANO YA MAGARI", "CRANE": "KORONGO", "Travel app": "Programu ya usafiri", "MATERIAL": "NYENZO", "CUPERTINO": "CUPERTINO", "REFERENCE STYLES & MEDIA": "MIUNDO NA MAUDHUI YA MAREJELEO" }
gallery/lib/l10n/intl_sw.arb/0
{ "file_path": "gallery/lib/l10n/intl_sw.arb", "repo_id": "gallery", "token_count": 20992 }
892
// 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/services.dart'; /// [HighlightFocus] is a helper widget for giving a child focus /// allowing tab-navigation. /// Wrap your widget as [child] of a [HighlightFocus] widget. class HighlightFocus extends StatefulWidget { const HighlightFocus({ super.key, required this.onPressed, required this.child, this.highlightColor, this.borderColor, this.hasFocus = true, this.debugLabel, }); /// [onPressed] is called when you press space, enter, or numpad-enter /// when the widget is focused. final VoidCallback onPressed; /// [child] is your widget. final Widget child; /// [highlightColor] is the color filled in the border when the widget /// is focused. /// Use [Colors.transparent] if you do not want one. /// Use an opacity less than 1 to make the underlying widget visible. final Color? highlightColor; /// [borderColor] is the color of the border when the widget is focused. final Color? borderColor; /// [hasFocus] is true when focusing on the widget is allowed. /// Set to false if you want the child to skip focus. final bool hasFocus; final String? debugLabel; @override State<HighlightFocus> createState() => _HighlightFocusState(); } class _HighlightFocusState extends State<HighlightFocus> { late bool isFocused; @override void initState() { isFocused = false; super.initState(); } @override Widget build(BuildContext context) { final highlightColor = widget.highlightColor ?? Theme.of(context).colorScheme.primary.withOpacity(0.5); final borderColor = widget.borderColor ?? Theme.of(context).colorScheme.onPrimary; final highlightedDecoration = BoxDecoration( color: highlightColor, border: Border.all( color: borderColor, width: 2, strokeAlign: BorderSide.strokeAlignOutside, ), ); return Focus( canRequestFocus: widget.hasFocus, debugLabel: widget.debugLabel, onFocusChange: (newValue) { setState(() { isFocused = newValue; }); }, onKeyEvent: (node, event) { if ((event is KeyDownEvent || event is KeyRepeatEvent) && (event.logicalKey == LogicalKeyboardKey.space || event.logicalKey == LogicalKeyboardKey.enter || event.logicalKey == LogicalKeyboardKey.numpadEnter)) { widget.onPressed(); return KeyEventResult.handled; } else { return KeyEventResult.ignored; } }, child: Container( foregroundDecoration: isFocused ? highlightedDecoration : null, child: widget.child, ), ); } }
gallery/lib/layout/highlight_focus.dart/0
{ "file_path": "gallery/lib/layout/highlight_focus.dart", "repo_id": "gallery", "token_count": 1032 }
893
// 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/studies/crane/backdrop.dart'; import 'package:gallery/studies/crane/eat_form.dart'; import 'package:gallery/studies/crane/fly_form.dart'; import 'package:gallery/studies/crane/routes.dart' as routes; import 'package:gallery/studies/crane/sleep_form.dart'; import 'package:gallery/studies/crane/theme.dart'; class CraneApp extends StatelessWidget { const CraneApp({super.key}); static const String defaultRoute = routes.defaultRoute; @override Widget build(BuildContext context) { return MaterialApp( restorationScopeId: 'crane_app', title: 'Crane', debugShowCheckedModeBanner: false, localizationsDelegates: GalleryLocalizations.localizationsDelegates, supportedLocales: GalleryLocalizations.supportedLocales, locale: GalleryOptions.of(context).locale, initialRoute: CraneApp.defaultRoute, routes: { CraneApp.defaultRoute: (context) => const _Home(), }, theme: craneTheme.copyWith( platform: GalleryOptions.of(context).platform, ), ); } } class _Home extends StatelessWidget { const _Home(); @override Widget build(BuildContext context) { return const ApplyTextOptions( child: Backdrop( frontLayer: SizedBox(), backLayerItems: [ FlyForm(), SleepForm(), EatForm(), ], frontTitle: Text('CRANE'), backTitle: Text('MENU'), ), ); } }
gallery/lib/studies/crane/app.dart/0
{ "file_path": "gallery/lib/studies/crane/app.dart", "repo_id": "gallery", "token_count": 653 }
894
// 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' as math; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_gen/gen_l10n/gallery_localizations.dart'; import 'package:gallery/data/gallery_options.dart'; import 'package:gallery/layout/adaptive.dart'; import 'package:gallery/layout/text_scale.dart'; import 'package:gallery/studies/rally/colors.dart'; import 'package:gallery/studies/rally/data.dart'; import 'package:gallery/studies/rally/finance.dart'; import 'package:gallery/studies/rally/formatters.dart'; /// A page that shows a status overview. class OverviewView extends StatefulWidget { const OverviewView({super.key}); @override State<OverviewView> createState() => _OverviewViewState(); } class _OverviewViewState extends State<OverviewView> { @override Widget build(BuildContext context) { final alerts = DummyDataService.getAlerts(context); if (isDisplayDesktop(context)) { const sortKeyName = 'Overview'; return SingleChildScrollView( restorationId: 'overview_scroll_view', child: Padding( padding: const EdgeInsets.symmetric(vertical: 24), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Flexible( flex: 7, child: Semantics( sortKey: const OrdinalSortKey(1, name: sortKeyName), child: const _OverviewGrid(spacing: 24), ), ), const SizedBox(width: 24), Flexible( flex: 3, child: SizedBox( width: 400, child: Semantics( sortKey: const OrdinalSortKey(2, name: sortKeyName), child: FocusTraversalGroup( child: _AlertsView(alerts: alerts), ), ), ), ), ], ), ), ); } else { return SingleChildScrollView( restorationId: 'overview_scroll_view', child: Padding( padding: const EdgeInsets.symmetric(vertical: 12), child: Column( children: [ _AlertsView(alerts: alerts.sublist(0, 1)), const SizedBox(height: 12), const _OverviewGrid(spacing: 12), ], ), ), ); } } } class _OverviewGrid extends StatelessWidget { const _OverviewGrid({required this.spacing}); final double spacing; @override Widget build(BuildContext context) { final accountDataList = DummyDataService.getAccountDataList(context); final billDataList = DummyDataService.getBillDataList(context); final budgetDataList = DummyDataService.getBudgetDataList(context); final localizations = GalleryLocalizations.of(context)!; return LayoutBuilder(builder: (context, constraints) { final textScaleFactor = GalleryOptions.of(context).textScaleFactor(context); // Only display multiple columns when the constraints allow it and we // have a regular text scale factor. const minWidthForTwoColumns = 600; final hasMultipleColumns = isDisplayDesktop(context) && constraints.maxWidth > minWidthForTwoColumns && textScaleFactor <= 2; final boxWidth = hasMultipleColumns ? constraints.maxWidth / 2 - spacing / 2 : double.infinity; return Wrap( runSpacing: spacing, children: [ SizedBox( width: boxWidth, child: _FinancialView( title: localizations.rallyAccounts, total: sumAccountDataPrimaryAmount(accountDataList), financialItemViews: buildAccountDataListViews(accountDataList, context), buttonSemanticsLabel: localizations.rallySeeAllAccounts, order: 1, ), ), if (hasMultipleColumns) SizedBox(width: spacing), SizedBox( width: boxWidth, child: _FinancialView( title: localizations.rallyBills, total: sumBillDataPrimaryAmount(billDataList), financialItemViews: buildBillDataListViews(billDataList, context), buttonSemanticsLabel: localizations.rallySeeAllBills, order: 2, ), ), _FinancialView( title: localizations.rallyBudgets, total: sumBudgetDataPrimaryAmount(budgetDataList), financialItemViews: buildBudgetDataListViews(budgetDataList, context), buttonSemanticsLabel: localizations.rallySeeAllBudgets, order: 3, ), ], ); }); } } class _AlertsView extends StatelessWidget { const _AlertsView({this.alerts}); final List<AlertData>? alerts; @override Widget build(BuildContext context) { final isDesktop = isDisplayDesktop(context); final localizations = GalleryLocalizations.of(context)!; return Container( padding: const EdgeInsetsDirectional.only(start: 16, top: 4, bottom: 4), color: RallyColors.cardBackground, child: Column( children: [ Container( width: double.infinity, padding: isDesktop ? const EdgeInsets.symmetric(vertical: 16) : null, child: MergeSemantics( child: Wrap( alignment: WrapAlignment.spaceBetween, crossAxisAlignment: WrapCrossAlignment.center, children: [ Text(localizations.rallyAlerts), if (!isDesktop) TextButton( style: TextButton.styleFrom( foregroundColor: Colors.white, ), onPressed: () {}, child: Text(localizations.rallySeeAll), ), ], ), ), ), for (AlertData alert in alerts!) ...[ Container(color: RallyColors.primaryBackground, height: 1), _Alert(alert: alert), ] ], ), ); } } class _Alert extends StatelessWidget { const _Alert({required this.alert}); final AlertData alert; @override Widget build(BuildContext context) { return MergeSemantics( child: Container( padding: isDisplayDesktop(context) ? const EdgeInsets.symmetric(vertical: 8) : null, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( child: SelectableText(alert.message!), ), SizedBox( width: 100, child: Align( alignment: Alignment.topRight, child: IconButton( onPressed: () {}, icon: Icon(alert.iconData, color: RallyColors.white60), ), ), ), ], ), ), ); } } class _FinancialView extends StatelessWidget { const _FinancialView({ this.title, this.total, this.financialItemViews, this.buttonSemanticsLabel, this.order, }); final String? title; final String? buttonSemanticsLabel; final double? total; final List<FinancialEntityCategoryView>? financialItemViews; final double? order; @override Widget build(BuildContext context) { final theme = Theme.of(context); return FocusTraversalOrder( order: NumericFocusOrder(order!), child: Container( color: RallyColors.cardBackground, child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ MergeSemantics( child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Padding( padding: const EdgeInsets.only( top: 16, left: 16, right: 16, ), child: SelectableText(title!), ), Padding( padding: const EdgeInsets.only(left: 16, right: 16), child: SelectableText( usdWithSignFormat(context).format(total), style: theme.textTheme.bodyLarge!.copyWith( fontSize: 44 / reducedTextScale(context), fontWeight: FontWeight.w600, ), ), ), ], ), ), ...financialItemViews! .sublist(0, math.min(financialItemViews!.length, 3)), TextButton( style: TextButton.styleFrom(foregroundColor: Colors.white), onPressed: () {}, child: Text( GalleryLocalizations.of(context)!.rallySeeAll, semanticsLabel: buttonSemanticsLabel, ), ), ], ), ), ); } }
gallery/lib/studies/rally/tabs/overview.dart/0
{ "file_path": "gallery/lib/studies/rally/tabs/overview.dart", "repo_id": "gallery", "token_count": 4533 }
895
import 'dart:math' as math; import 'package:flutter/material.dart'; /// A rectangle with a smooth circular notch. /// /// See also: /// /// * [CircleBorder], a [ShapeBorder] that describes a circle. class WaterfallNotchedRectangle extends NotchedShape { /// Creates a [WaterfallNotchedRectangle]. /// /// The same object can be used to create multiple shapes. const WaterfallNotchedRectangle(); /// Creates a [Path] that describes a rectangle with a smooth circular notch. /// /// `host` is the bounding box for the returned shape. Conceptually this is /// the rectangle to which the notch will be applied. /// /// `guest` is the bounding box of a circle that the notch accommodates. All /// points in the circle bounded by `guest` will be outside of the returned /// path. /// /// The notch is curve that smoothly connects the host's top edge and /// the guest circle. @override Path getOuterPath(Rect host, Rect? guest) { if (guest == null || !host.overlaps(guest)) return Path()..addRect(host); // The guest's shape is a circle bounded by the guest rectangle. // So the guest's radius is half the guest width. final notchRadius = guest.width / 2.0; // We build a path for the notch from 3 segments: // Segment A - a Bezier curve from the host's top edge to segment B. // Segment B - an arc with radius notchRadius. // Segment C - a Bezier curve from segment B back to the host's top edge. // // A detailed explanation and the derivation of the formulas below is // available at: https://goo.gl/Ufzrqn // s1, s2 are the two knobs controlling the behavior of the bezzier curve. const s1 = 21.0; const s2 = 6.0; final r = notchRadius; final a = -1.0 * r - s2; final b = host.top - guest.center.dy; final n2 = math.sqrt(b * b * r * r * (a * a + b * b - r * r)); final p2xA = ((a * r * r) - n2) / (a * a + b * b); final p2xB = ((a * r * r) + n2) / (a * a + b * b); final p2yA = math.sqrt(r * r - p2xA * p2xA); final p2yB = math.sqrt(r * r - p2xB * p2xB); final p = List<Offset?>.filled(6, null, growable: false); // p0, p1, and p2 are the control points for segment A. p[0] = Offset(a - s1, b); p[1] = Offset(a, b); final cmp = b < 0 ? -1.0 : 1.0; p[2] = cmp * p2yA > cmp * p2yB ? Offset(p2xA, p2yA) : Offset(p2xB, p2yB); // p3, p4, and p5 are the control points for segment B, which is a mirror // of segment A around the y axis. p[3] = Offset(-1.0 * p[2]!.dx, p[2]!.dy); p[4] = Offset(-1.0 * p[1]!.dx, p[1]!.dy); p[5] = Offset(-1.0 * p[0]!.dx, p[0]!.dy); // translate all points back to the absolute coordinate system. for (var i = 0; i < p.length; i += 1) { p[i] = p[i]! + guest.center; } return Path() ..moveTo(host.left, host.top) ..lineTo(p[0]!.dx, p[0]!.dy) ..quadraticBezierTo(p[1]!.dx, p[1]!.dy, p[2]!.dx, p[2]!.dy) ..arcToPoint( p[3]!, radius: Radius.circular(notchRadius), clockwise: false, ) ..quadraticBezierTo(p[4]!.dx, p[4]!.dy, p[5]!.dx, p[5]!.dy) ..lineTo(host.right, host.top) ..lineTo(host.right, host.bottom) ..lineTo(host.left, host.bottom) ..close(); } }
gallery/lib/studies/reply/waterfall_notched_rectangle.dart/0
{ "file_path": "gallery/lib/studies/reply/waterfall_notched_rectangle.dart", "repo_id": "gallery", "token_count": 1334 }
896
// 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:gallery/studies/shrine/model/product.dart'; import 'package:gallery/studies/shrine/supplemental/desktop_product_columns.dart'; import 'package:gallery/studies/shrine/supplemental/layout_cache.dart'; /// A placeholder id for an empty element. See [_iterateUntilBalanced] /// for more information. const _emptyElement = -1; /// To avoid infinite loops, improvements to the layout are only performed /// when a column's height changes by more than /// [_deviationImprovementThreshold] pixels. const _deviationImprovementThreshold = 10; /// Height of a product image, paired with the product's id. class _TaggedHeightData { const _TaggedHeightData({ required this.index, required this.height, }); /// The id of the corresponding product. final int index; /// The height of the product image. final double height; } /// Converts a set of [_TaggedHeightData] elements to a list, /// and add an empty element. /// Used for iteration. List<_TaggedHeightData> _toListAndAddEmpty(Set<_TaggedHeightData> set) { final result = List<_TaggedHeightData>.from(set); result.add(const _TaggedHeightData(index: _emptyElement, height: 0)); return result; } /// Encode parameters for caching. String _encodeParameters({ required int columnCount, required List<Product> products, required double largeImageWidth, required double smallImageWidth, }) { final productString = [for (final product in products) product.id.toString()].join(','); return '$columnCount;$productString,$largeImageWidth,$smallImageWidth'; } /// Given a layout, replace integers by their corresponding products. List<List<Product>> _generateLayout({ required List<Product> products, required List<List<int>> layout, }) { return [ for (final column in layout) [ for (final index in column) products[index], ] ]; } /// Given [columnObjects], list of the set of objects in each column, /// and [columnHeights], list of heights of each column, /// [_iterateUntilBalanced] moves and swaps objects between columns /// until their heights are sufficiently close to each other. /// This prevents the layout having significant, avoidable gaps at the bottom. void _iterateUntilBalanced( List<Set<_TaggedHeightData>> columnObjects, List<double> columnHeights, ) { var failedMoves = 0; final columnCount = columnObjects.length; // No need to rearrange a 1-column layout. if (columnCount == 1) { return; } while (true) { // Loop through all possible 2-combinations of columns. for (var source = 0; source < columnCount; ++source) { for (var target = source + 1; target < columnCount; ++target) { // Tries to find an object A from source column // and an object B from target column, such that switching them // causes the height of the two columns to be closer. // A or B can be empty; in this case, moving an object from one // column to the other is the best choice. var success = false; final bestHeight = (columnHeights[source] + columnHeights[target]) / 2; final scoreLimit = (columnHeights[source] - bestHeight).abs(); final sourceObjects = _toListAndAddEmpty(columnObjects[source]); final targetObjects = _toListAndAddEmpty(columnObjects[target]); _TaggedHeightData? bestA, bestB; double? bestScore; for (final a in sourceObjects) { for (final b in targetObjects) { if (a.index == _emptyElement && b.index == _emptyElement) { continue; } else { final score = (columnHeights[source] - a.height + b.height - bestHeight) .abs(); if (score < scoreLimit - _deviationImprovementThreshold) { success = true; if (bestScore == null || score < bestScore) { bestScore = score; bestA = a; bestB = b; } } } } } if (!success) { ++failedMoves; } else { failedMoves = 0; // Switch A and B. if (bestA != null && bestA.index != _emptyElement) { columnObjects[source].remove(bestA); columnObjects[target].add(bestA); } if (bestB != null && bestB.index != _emptyElement) { columnObjects[target].remove(bestB); columnObjects[source].add(bestB); } columnHeights[source] += bestB!.height - bestA!.height; columnHeights[target] += bestA.height - bestB.height; } // If no two columns' heights can be made closer by switching // elements, the layout is sufficiently balanced. if (failedMoves >= columnCount * (columnCount - 1) ~/ 2) { return; } } } } } /// Given a list of numbers [data], representing the heights of each image, /// and a list of numbers [biases], representing the heights of the space /// above each column, [_balancedDistribution] returns a layout of [data] /// so that the height of each column is sufficiently close to each other, /// represented as a list of lists of integers, each integer being an ID /// for a product. List<List<int>> _balancedDistribution({ required int columnCount, required List<double> data, required List<double> biases, }) { assert(biases.length == columnCount); final columnObjects = List<Set<_TaggedHeightData>>.generate( columnCount, (column) => <_TaggedHeightData>{}); final columnHeights = List<double>.from(biases); for (var i = 0; i < data.length; ++i) { final column = i % columnCount; columnHeights[column] += data[i]; columnObjects[column].add(_TaggedHeightData(index: i, height: data[i])); } _iterateUntilBalanced(columnObjects, columnHeights); return [ for (final column in columnObjects) [for (final object in column) object.index]..sort(), ]; } /// Generates a balanced layout for [columnCount] columns, /// with products specified by the list [products], /// where the larger images have width [largeImageWidth] /// and the smaller images have width [smallImageWidth]. /// The current [context] is also given to allow caching. List<List<Product>> balancedLayout({ required BuildContext context, required int columnCount, required List<Product> products, required double largeImageWidth, required double smallImageWidth, }) { final encodedParameters = _encodeParameters( columnCount: columnCount, products: products, largeImageWidth: largeImageWidth, smallImageWidth: smallImageWidth, ); // Check if this layout is cached. if (LayoutCache.of(context).containsKey(encodedParameters)) { return _generateLayout( products: products, layout: LayoutCache.of(context)[encodedParameters]!, ); } final productHeights = [ for (final product in products) 1 / product.assetAspectRatio * (largeImageWidth + smallImageWidth) / 2 + productCardAdditionalHeight, ]; final layout = _balancedDistribution( columnCount: columnCount, data: productHeights, biases: List<double>.generate( columnCount, (column) => (column % 2 == 0 ? 0 : columnTopSpace), ), ); // Add tailored layout to cache. LayoutCache.of(context)[encodedParameters] = layout; final result = _generateLayout( products: products, layout: layout, ); return result; }
gallery/lib/studies/shrine/supplemental/balanced_layout.dart/0
{ "file_path": "gallery/lib/studies/shrine/supplemental/balanced_layout.dart", "repo_id": "gallery", "token_count": 2709 }
897
# Web Benchmark Tests This directory, `lib/benchmarks/`, is used for performance testing for the Gallery on Web. It is used by `web_benchmarks` in the Flutter repository to collect benchmarks that indicate Gallery's performance. For more information, especially how to run these tests, see: https://github.com/flutter/flutter/tree/master/dev/benchmarks/macrobenchmarks#web-benchmarks
gallery/test_benchmarks/benchmarks/README.md/0
{ "file_path": "gallery/test_benchmarks/benchmarks/README.md", "repo_id": "gallery", "token_count": 104 }
898
// 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:async'; import 'dart:convert'; import 'dart:io'; const _l10nDir = 'lib/l10n'; // Note that the filename for `intl_en_US.xml` is used by the internal // translation console and changing the filename may require manually updating // already translated messages to point to the new file. Therefore, avoid doing so // unless necessary. const _englishXmlPath = '$_l10nDir/intl_en_US.xml'; const _englishArbPath = '$_l10nDir/intl_en.arb'; const _xmlHeader = ''' <?xml version="1.0" encoding="utf-8"?> <!-- This file was automatically generated. Please do not edit it manually. It is based on lib/l10n/intl_en.arb. --> <resources> '''; const _pluralSuffixes = <String>[ 'Zero', 'One', 'Two', 'Few', 'Many', 'Other', ]; String _escapeXml(String xml) { return xml .replaceAll('&', '&amp;') .replaceAll('"', '&quot;') .replaceAll("'", '&apos;') .replaceAll('>', '&gt;') .replaceAll('<', '&lt;'); } String readEnglishXml() => File(_englishXmlPath).readAsStringSync(); /// Updates an intl_*.xml file from an intl_*.arb file. Defaults to English (US). Future<void> arbToXml({ String arbPath = _englishArbPath, String xmlPath = _englishXmlPath, bool isDryRun = false, }) async { final output = isDryRun ? stdout : File(xmlPath).openWrite(); final outputXml = await generateXmlFromArb(arbPath); output.write(outputXml); await output.close(); } Future<String> generateXmlFromArb([String arbPath = _englishArbPath]) async { final inputArb = File(arbPath); final bundle = jsonDecode(await inputArb.readAsString()) as Map<String, dynamic>; String translationFor(String key) { assert(bundle[key] != null); return _escapeXml(bundle[key] as String); } final xml = StringBuffer(_xmlHeader); for (final key in bundle.keys) { if (key == '@@last_modified') { continue; } if (!key.startsWith('@')) { continue; } final resourceId = key.substring(1); final name = _escapeXml(resourceId); final metaInfo = bundle[key] as Map<String, dynamic>; assert(metaInfo['description'] != null); var description = _escapeXml(metaInfo['description'] as String); if (metaInfo.containsKey('plural')) { // Generate a plurals resource element formatted like this: // <plurals // name="dartVariableName" // description="description"> // <item // quantity="other" // >%d translation</item> // ... items for quantities one, two, etc. // </plurals> final quantityVar = "\$${metaInfo['plural']}"; description = description.replaceAll('\$$quantityVar', '%d'); xml.writeln(' <plurals'); xml.writeln(' name="$name"'); xml.writeln(' description="$description">'); for (final suffix in _pluralSuffixes) { final pluralKey = '$resourceId$suffix'; if (bundle.containsKey(pluralKey)) { final translation = translationFor(pluralKey).replaceFirst(quantityVar, '%d'); xml.writeln(' <item'); xml.writeln(' quantity="${suffix.toLowerCase()}"'); xml.writeln(' >$translation</item>'); } } xml.writeln(' </plurals>'); } else if (metaInfo.containsKey('parameters')) { // Generate a parameterized string resource element formatted like this: // <string // name="dartVariableName" // description="string description" // >string %1$s %2$s translation</string> // The translated string's original $vars, which must be listed in its // description's 'parameters' value, are replaced with printf positional // string arguments, like "%1$s". var translation = translationFor(resourceId); assert((metaInfo['parameters'] as String).trim().isNotEmpty); final parameters = (metaInfo['parameters'] as String) .split(',') .map<String>((s) => s.trim()) .toList(); var index = 1; for (final parameter in parameters) { translation = translation.replaceAll('\$$parameter', '%$index\$s'); description = description.replaceAll('\$$parameter', '%$index\$s'); index += 1; } xml.writeln(' <string'); xml.writeln(' name="$name"'); xml.writeln(' description="$description"'); xml.writeln(' >$translation</string>'); } else { // Generate a string resource element formatted like this: // <string // name="dartVariableName" // description="string description" // >string translation</string> final translation = translationFor(resourceId); xml.writeln(' <string'); xml.writeln(' name="$name"'); xml.writeln(' description="$description"'); xml.writeln(' >$translation</string>'); } } xml.writeln('</resources>'); return xml.toString(); }
gallery/tool/l10n_cli/l10n_cli.dart/0
{ "file_path": "gallery/tool/l10n_cli/l10n_cli.dart", "repo_id": "gallery", "token_count": 1965 }
899
# Official Dart image: https://hub.docker.com/_/dart # Specify the Dart SDK base image version using dart:<version> (ex: dart:2.17) FROM dart:beta AS build WORKDIR /app # Copy Dependencies COPY packages/card_renderer ./packages/card_renderer COPY packages/cards_repository ./packages/cards_repository COPY packages/config_repository ./packages/config_repository COPY packages/db_client ./packages/db_client COPY packages/encryption_middleware ./packages/encryption_middleware COPY packages/firebase_cloud_storage ./packages/firebase_cloud_storage COPY packages/game_domain ./packages/game_domain COPY packages/game_script_machine ./packages/game_script_machine COPY packages/image_model_repository ./packages/image_model_repository COPY packages/jwt_middleware ./packages/jwt_middleware COPY packages/language_model_repository ./packages/language_model_repository COPY packages/leaderboard_repository ./packages/leaderboard_repository COPY packages/match_repository ./packages/match_repository COPY packages/prompt_repository ./packages/prompt_repository COPY packages/scripts_repository ./packages/scripts_repository # Install Dependencies RUN dart pub get -C packages/card_renderer RUN dart pub get -C packages/cards_repository RUN dart pub get -C packages/db_client RUN dart pub get -C packages/encryption_middleware RUN dart pub get -C packages/firebase_cloud_storage RUN dart pub get -C packages/game_domain RUN dart pub get -C packages/game_script_machine RUN dart pub get -C packages/image_model_repository RUN dart pub get -C packages/jwt_middleware RUN dart pub get -C packages/language_model_repository RUN dart pub get -C packages/leaderboard_repository RUN dart pub get -C packages/match_repository RUN dart pub get -C packages/prompt_repository RUN dart pub get -C packages/scripts_repository # Resolve app dependencies. COPY pubspec.* ./ RUN dart pub get # Copy app source code and AOT compile it. COPY . . # Ensure packages are still up-to-date if anything has changed RUN dart pub get --offline RUN dart compile exe bin/server.dart -o bin/server # Build minimal serving image from AOT-compiled `/server` and required system # libraries and configuration files stored in `/runtime/` from the build stage. FROM scratch COPY --from=build /runtime/ / COPY --from=build /app/bin/server /app/bin/ COPY --from=build /app/public /public/ # Start server. CMD ["/app/bin/server"]
io_flip/api/Dockerfile/0
{ "file_path": "io_flip/api/Dockerfile", "repo_id": "io_flip", "token_count": 757 }
900
# Card Renderer [![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link] [![Powered by Mason](https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge)](https://github.com/felangel/mason) [![License: MIT][license_badge]][license_link] Renders a card based on its metadata and illustration ## Installation 💻 **❗ In order to start using Card Renderer you must have the [Dart SDK][dart_install_link] installed on your machine.** Add `card_renderer` to your `pubspec.yaml`: ```yaml dependencies: card_renderer: ``` Install it: ```sh dart pub get ``` --- ## Continuous Integration 🤖 Card Renderer comes with a built-in [GitHub Actions workflow][github_actions_link] powered by [Very Good Workflows][very_good_workflows_link] but you can also add your preferred CI/CD solution. Out of the box, on each pull request and push, the CI `formats`, `lints`, and `tests` the code. This ensures the code remains consistent and behaves correctly as you add functionality or make changes. The project uses [Very Good Analysis][very_good_analysis_link] for a strict set of analysis options used by our team. Code coverage is enforced using the [Very Good Workflows][very_good_coverage_link]. --- ## Running Tests 🧪 To run all unit tests: ```sh dart pub global activate coverage 1.2.0 dart test --coverage=coverage dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info ``` To view the generated coverage report you can use [lcov](https://github.com/linux-test-project/lcov). ```sh # Generate Coverage Report genhtml coverage/lcov.info -o coverage/ # Open Coverage Report open coverage/index.html ``` [dart_install_link]: https://dart.dev/get-dart [github_actions_link]: https://docs.github.com/en/actions/learn-github-actions [license_badge]: https://img.shields.io/badge/license-MIT-blue.svg [license_link]: https://opensource.org/licenses/MIT [logo_black]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_black.png#gh-light-mode-only [logo_white]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_white.png#gh-dark-mode-only [mason_link]: https://github.com/felangel/mason [very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg [very_good_analysis_link]: https://pub.dev/packages/very_good_analysis [very_good_coverage_link]: https://github.com/marketplace/actions/very-good-coverage [very_good_ventures_link]: https://verygood.ventures [very_good_ventures_link_light]: https://verygood.ventures#gh-light-mode-only [very_good_ventures_link_dark]: https://verygood.ventures#gh-dark-mode-only [very_good_workflows_link]: https://github.com/VeryGoodOpenSource/very_good_workflows
io_flip/api/packages/card_renderer/README.md/0
{ "file_path": "io_flip/api/packages/card_renderer/README.md", "repo_id": "io_flip", "token_count": 929 }
901
import 'package:card_renderer/card_renderer.dart'; import 'package:image/image.dart'; import 'package:test/test.dart'; void main() { group('rainbowFilter', () { final expected = Command() ..decodeImageFile('test/src/rainbow_filter.png') ..encodePng(); setUpAll(() async { await expected.execute(); }); test('applies rainbow on top of image', () async { final command = Command() ..createImage(width: 500, height: 500) ..fill(color: ColorRgb8(128, 128, 128)) ..filter(rainbowFilter) ..encodePng(); await command.execute(); expect(command.outputBytes, equals(expected.outputBytes)); }); }); }
io_flip/api/packages/card_renderer/test/src/rainbow_filter_test.dart/0
{ "file_path": "io_flip/api/packages/card_renderer/test/src/rainbow_filter_test.dart", "repo_id": "io_flip", "token_count": 271 }
902
import 'package:equatable/equatable.dart'; import 'package:game_domain/game_domain.dart'; import 'package:json_annotation/json_annotation.dart'; part 'deck.g.dart'; /// {@template deck} /// A model that represents a deck of cards. /// {@endtemplate} @JsonSerializable(ignoreUnannotated: true, explicitToJson: true) class Deck extends Equatable { /// {@macro deck} const Deck({ required this.id, required this.userId, required this.cards, this.shareImage, }); /// {@macro deck} factory Deck.fromJson(Map<String, dynamic> json) => _$DeckFromJson(json); /// Deck id. @JsonKey() final String id; /// User id. @JsonKey() final String userId; /// Card list. @JsonKey() final List<Card> cards; /// Share image. @JsonKey() final String? shareImage; /// Returns a json representation from this instance. Map<String, dynamic> toJson() => _$DeckToJson(this); /// Returns a copy of this instance with the new [shareImage]. Deck copyWithShareImage(String? shareImage) => Deck( id: id, userId: userId, cards: cards, shareImage: shareImage, ); @override List<Object?> get props => [id, cards, userId, shareImage]; }
io_flip/api/packages/game_domain/lib/src/models/deck.dart/0
{ "file_path": "io_flip/api/packages/game_domain/lib/src/models/deck.dart", "repo_id": "io_flip", "token_count": 439 }
903
// GENERATED CODE - DO NOT MODIFY BY HAND part of 'web_socket_message.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** Map<String, dynamic> _$WebSocketMessageToJson(WebSocketMessage instance) => <String, dynamic>{ 'messageType': _$MessageTypeEnumMap[instance.messageType]!, 'payload': instance.payload, }; const _$MessageTypeEnumMap = { MessageType.connected: 'connected', MessageType.error: 'error', MessageType.token: 'token', MessageType.matchJoined: 'matchJoined', MessageType.matchLeft: 'matchLeft', }; WebSocketTokenPayload _$WebSocketTokenPayloadFromJson( Map<String, dynamic> json) => WebSocketTokenPayload( token: json['token'] as String, reconnect: json['reconnect'] as bool, ); Map<String, dynamic> _$WebSocketTokenPayloadToJson( WebSocketTokenPayload instance) => <String, dynamic>{ 'token': instance.token, 'reconnect': instance.reconnect, }; WebSocketErrorPayload _$WebSocketErrorPayloadFromJson( Map<String, dynamic> json) => WebSocketErrorPayload( errorCode: $enumDecode(_$WebSocketErrorCodeEnumMap, json['errorCode']), ); Map<String, dynamic> _$WebSocketErrorPayloadToJson( WebSocketErrorPayload instance) => <String, dynamic>{ 'errorCode': _$WebSocketErrorCodeEnumMap[instance.errorCode]!, }; const _$WebSocketErrorCodeEnumMap = { WebSocketErrorCode.badRequest: 'badRequest', WebSocketErrorCode.firebaseException: 'firebaseException', WebSocketErrorCode.playerAlreadyConnected: 'playerAlreadyConnected', WebSocketErrorCode.unknown: 'unknown', }; WebSocketMatchJoinedPayload _$WebSocketMatchJoinedPayloadFromJson( Map<String, dynamic> json) => WebSocketMatchJoinedPayload( matchId: json['matchId'] as String, isHost: json['isHost'] as bool, ); Map<String, dynamic> _$WebSocketMatchJoinedPayloadToJson( WebSocketMatchJoinedPayload instance) => <String, dynamic>{ 'matchId': instance.matchId, 'isHost': instance.isHost, };
io_flip/api/packages/game_domain/lib/src/models/web_socket_message.g.dart/0
{ "file_path": "io_flip/api/packages/game_domain/lib/src/models/web_socket_message.g.dart", "repo_id": "io_flip", "token_count": 754 }
904
/// Repository providing access language model services library language_model_repository; export 'src/language_model_repository.dart';
io_flip/api/packages/language_model_repository/lib/language_model_repository.dart/0
{ "file_path": "io_flip/api/packages/language_model_repository/lib/language_model_repository.dart", "repo_id": "io_flip", "token_count": 36 }
905
import 'dart:async'; import 'dart:math'; import 'package:cards_repository/cards_repository.dart'; import 'package:db_client/db_client.dart'; import 'package:game_domain/game_domain.dart'; /// Throw when getting a match fails. class GetMatchFailure extends Error {} /// Throw when adding a move to a match fails. class PlayCardFailure implements Exception {} /// Throw when a match is not found. class MatchNotFoundFailure implements Exception {} /// Throw when calculating the result of a match fails. class CalculateResultFailure extends Error {} /// {@template match_repository} /// Access to Match datasource /// {@endtemplate} class MatchRepository { /// {@macro match_repository} const MatchRepository({ required CardsRepository cardsRepository, required DbClient dbClient, required MatchSolver matchSolver, this.trackPlayerPresence = true, }) : _cardsRepository = cardsRepository, _dbClient = dbClient, _matchSolver = matchSolver; final CardsRepository _cardsRepository; final DbClient _dbClient; final MatchSolver _matchSolver; static const _cpuPrefix = 'CPU_'; /// Configures whether we should actually track player presence or not. /// Used to disable the multiple tab check in staging. final bool trackPlayerPresence; /// Return the ScoreCard with the given [scoreCardId]. Future<ScoreCard> getScoreCard(String scoreCardId, String deckId) async { final scoreData = await _dbClient.getById('score_cards', scoreCardId); if (scoreData == null) { await _dbClient.set( 'score_cards', DbEntityRecord( id: scoreCardId, data: { 'wins': 0, 'currentStreak': 0, 'longestStreak': 0, 'currentDeck': deckId, }, ), ); return ScoreCard(id: scoreCardId, currentDeck: deckId); } final data = {...scoreData.data, 'id': scoreCardId}; if (data['currentDeck'] != deckId) { data['currentStreak'] = 0; } data['currentDeck'] = deckId; return ScoreCard.fromJson(data); } /// Return the match with the given [matchId]. Future<Match?> getMatch(String matchId) async { final matchData = await _dbClient.getById('matches', matchId); if (matchData == null) { return null; } final hostDeckId = matchData.data['host'] as String; final guestDeckId = matchData.data['guest'] as String; final decks = await Future.wait([ _cardsRepository.getDeck(hostDeckId), _cardsRepository.getDeck(guestDeckId), ]); final matchDecks = decks.whereType<Deck>(); if (matchDecks.length != decks.length) { throw GetMatchFailure(); } return Match( id: matchData.id, hostDeck: matchDecks.first, guestDeck: matchDecks.last, ); } /// Returns true if match exists and guest is empty, else returns false Future<bool> isDraftMatch(String matchId) async { final matchData = await _dbClient.getById('matches', matchId); if (matchData == null) { return false; } final guestDeckId = matchData.data['guest'] as String; if (guestDeckId == emptyKey || guestDeckId == reservedKey) { return true; } return false; } Future<DbEntityRecord?> _findMatchStateByMatchId(String matchId) async { final result = await _dbClient.findBy( 'match_states', 'matchId', matchId, ); if (result.isNotEmpty) { return result.first; } return null; } /// Returns the match state from the given [matchId]. Future<MatchState?> getMatchState(String matchId) async { final record = await _findMatchStateByMatchId(matchId); if (record != null) { return MatchState( id: record.id, matchId: matchId, hostPlayedCards: (record.data['hostPlayedCards'] as List).cast<String>(), guestPlayedCards: (record.data['guestPlayedCards'] as List).cast<String>(), result: MatchResult.valueOf(record.data['result'] as String?), ); } return null; } /// Plays a card on the given match. If the match is against a CPU, it plays /// the CPU card next. /// /// throws [MatchNotFoundFailure] if any of the match, deck or match state. /// throws [PlayCardFailure] if the move is invalid. /// /// are not found. Future<void> playCard({ required String matchId, required String cardId, required String deckId, required String userId, Random? random, }) async { final rng = random ?? Random(); final match = await getMatch(matchId); if (match == null) throw MatchNotFoundFailure(); final deck = await _cardsRepository.getDeck(deckId); if (deck == null || deck.userId != userId) throw MatchNotFoundFailure(); final matchState = await getMatchState(matchId); if (matchState == null) throw MatchNotFoundFailure(); final newMatchState = await _playCard( match: match, matchState: matchState, cardId: cardId, deckId: deckId, userId: userId, ); if (match.guestDeck.userId.startsWith(_cpuPrefix) && newMatchState.guestPlayedCards.length < 3 && newMatchState.guestPlayedCards.length <= newMatchState.hostPlayedCards.length) { final unplayedCards = match.guestDeck.cards .where( (card) => !newMatchState.guestPlayedCards.contains(card.id), ) .toList(); unawaited( Future.delayed(const Duration(seconds: 1), () { _playCard( match: match, matchState: newMatchState, cardId: unplayedCards[rng.nextInt(unplayedCards.length)].id, deckId: match.guestDeck.id, userId: match.guestDeck.userId, ); }), ); } } /// Plays a card on the given match. /// /// throws [PlayCardFailure] if the card cannot be played. Future<MatchState> _playCard({ required Match match, required MatchState matchState, required String cardId, required String deckId, required String userId, }) async { final isHost = userId == match.hostDeck.userId; if (!_matchSolver.canPlayCard(matchState, cardId, isHost: isHost)) { throw PlayCardFailure(); } var newMatchState = match.hostDeck.id == deckId ? matchState.addHostPlayedCard(cardId) : matchState.addGuestPlayedCard(cardId); if (newMatchState.isOver()) { final result = _matchSolver.calculateMatchResult(match, newMatchState); newMatchState = newMatchState.setResult(result); await _setScoreCard(match, result); } await _dbClient.update( 'match_states', DbEntityRecord( id: newMatchState.id, data: { 'matchId': match.id, if (isHost) 'hostPlayedCards': newMatchState.hostPlayedCards else 'guestPlayedCards': newMatchState.guestPlayedCards, 'result': newMatchState.result?.name, }, ), ); return newMatchState; } /// calculates and updates the result of a match /// /// Throws a [CalculateResultFailure] if match is not over Future<void> calculateMatchResult({ required Match match, required MatchState matchState, }) async { final matchId = match.id; if (matchState.isOver() && matchState.result == null) { final result = _matchSolver.calculateMatchResult(match, matchState); final newMatchState = matchState.setResult(result); await _setScoreCard(match, result); await _dbClient.update( 'match_states', DbEntityRecord( id: newMatchState.id, data: { 'matchId': matchId, 'hostPlayedCards': newMatchState.hostPlayedCards, 'guestPlayedCards': newMatchState.guestPlayedCards, 'result': newMatchState.result?.name, }, ), ); } else { throw CalculateResultFailure(); } } Future<void> _setScoreCard(Match match, MatchResult result) async { final host = await getScoreCard(match.hostDeck.userId, match.hostDeck.id); final guest = await getScoreCard( match.guestDeck.userId, match.guestDeck.id, ); if (result == MatchResult.host) { await _playerWon(host); await _playerLost(guest); } else if (result == MatchResult.guest) { await _playerWon(guest); await _playerLost(host); } } Future<void> _playerWon(ScoreCard scoreCard) async { final newStreak = scoreCard.currentStreak + 1; final isLongestStreak = newStreak > scoreCard.longestStreak; await _dbClient.update( 'score_cards', DbEntityRecord( id: scoreCard.id, data: { 'wins': scoreCard.wins + 1, 'currentStreak': newStreak, 'latestStreak': newStreak, if (isLongestStreak) 'longestStreak': newStreak, 'currentDeck': scoreCard.currentDeck, 'latestDeck': scoreCard.currentDeck, if (isLongestStreak) 'longestStreakDeck': scoreCard.currentDeck, }, ), ); } Future<void> _playerLost(ScoreCard scoreCard) async { await _dbClient.update( 'score_cards', DbEntityRecord( id: scoreCard.id, data: { 'currentStreak': 0, if (scoreCard.currentDeck != scoreCard.latestDeck) 'latestStreak': 0, 'currentDeck': scoreCard.currentDeck, 'latestDeck': scoreCard.currentDeck, }, ), ); } /// Sets the `hostConnected` attribute on a match to true or false. Future<void> setHostConnectivity({ required String match, required bool active, }) async { await _dbClient.update( 'matches', DbEntityRecord( id: match, data: { 'hostConnected': active, }, ), ); } /// Sets the `guestConnected` attribute on a match to true or false. Future<void> setGuestConnectivity({ required String match, required bool active, }) async { await _dbClient.update( 'matches', DbEntityRecord( id: match, data: { 'guestConnected': active, }, ), ); } /// Sets the `guestConnected` attribute as true for CPU guest. Future<void> setCpuConnectivity({ required String matchId, required String deckId, }) async { await _dbClient.update( 'matches', DbEntityRecord( id: matchId, data: { 'guestConnected': true, 'guest': deckId, }, ), ); } /// Return whether a player with the given [userId] is connected to the game. Future<bool> getPlayerConnectivity({required String userId}) async { final entity = await _dbClient.getById('connection_states', userId); return ((entity?.data['connected'] as bool?) ?? false) && trackPlayerPresence; } /// Sets the player with the given [userId] as connected or disconnected. Future<void> setPlayerConnectivity({ required String userId, required bool connected, }) async { await _dbClient.update( 'connection_states', DbEntityRecord( id: userId, data: { 'connected': connected, }, ), ); } }
io_flip/api/packages/match_repository/lib/src/match_repository.dart/0
{ "file_path": "io_flip/api/packages/match_repository/lib/src/match_repository.dart", "repo_id": "io_flip", "token_count": 4548 }
906
name: scripts_repository description: Access to the game scripts data source version: 0.1.0+1 publish_to: none environment: sdk: ">=2.19.0 <3.0.0" dependencies: db_client: path: ../db_client game_script_machine: path: ../game_script_machine dev_dependencies: mocktail: ^0.3.0 test: ^1.19.2 very_good_analysis: ^4.0.0
io_flip/api/packages/scripts_repository/pubspec.yaml/0
{ "file_path": "io_flip/api/packages/scripts_repository/pubspec.yaml", "repo_id": "io_flip", "token_count": 144 }
907
import 'dart:async'; import 'dart:io'; import 'package:dart_frog/dart_frog.dart'; import 'package:jwt_middleware/jwt_middleware.dart'; import 'package:logging/logging.dart'; import 'package:match_repository/match_repository.dart'; FutureOr<Response> onRequest( RequestContext context, String matchId, String deckId, String cardId, ) async { if (context.request.method == HttpMethod.post) { final matchRepository = context.read<MatchRepository>(); final user = context.read<AuthenticatedUser>(); try { await matchRepository.playCard( matchId: matchId, cardId: cardId, deckId: deckId, userId: user.id, ); } on MatchNotFoundFailure { return Response(statusCode: HttpStatus.notFound); } on PlayCardFailure { return Response(statusCode: HttpStatus.badRequest); } catch (e, s) { context.read<Logger>().severe('Error playing a move', e, s); rethrow; } return Response(statusCode: HttpStatus.noContent); } return Response(statusCode: HttpStatus.methodNotAllowed); }
io_flip/api/routes/game/matches/[matchId]/decks/[deckId]/cards/[cardId].dart/0
{ "file_path": "io_flip/api/routes/game/matches/[matchId]/decks/[deckId]/cards/[cardId].dart", "repo_id": "io_flip", "token_count": 412 }
908
import 'dart:io'; import 'package:dart_frog/dart_frog.dart'; import 'package:leaderboard_repository/leaderboard_repository.dart'; import 'package:mocktail/mocktail.dart'; import 'package:test/test.dart'; import '../../../../../routes/game/leaderboard/initials_blacklist/index.dart' as route; class _MockLeaderboardRepository extends Mock implements LeaderboardRepository {} class _MockRequest extends Mock implements Request {} class _MockRequestContext extends Mock implements RequestContext {} void main() { group('GET /', () { late LeaderboardRepository leaderboardRepository; late Request request; late RequestContext context; const blacklist = ['AAA', 'BBB', 'CCC']; setUp(() { leaderboardRepository = _MockLeaderboardRepository(); when(() => leaderboardRepository.getInitialsBlacklist()) .thenAnswer((_) async => blacklist); request = _MockRequest(); when(() => request.method).thenReturn(HttpMethod.get); context = _MockRequestContext(); when(() => context.request).thenReturn(request); when(() => context.read<LeaderboardRepository>()) .thenReturn(leaderboardRepository); }); test('responds with a 200', () async { final response = await route.onRequest(context); expect(response.statusCode, equals(HttpStatus.ok)); }); test('only allows get methods', () async { when(() => request.method).thenReturn(HttpMethod.post); final response = await route.onRequest(context); expect(response.statusCode, equals(HttpStatus.methodNotAllowed)); }); test('responds with the blacklist', () async { final response = await route.onRequest(context); final json = await response.json(); expect( json, equals({ 'list': ['AAA', 'BBB', 'CCC'], }), ); }); }); }
io_flip/api/test/routes/game/leaderboard/initials_blacklist/index_test.dart/0
{ "file_path": "io_flip/api/test/routes/game/leaderboard/initials_blacklist/index_test.dart", "repo_id": "io_flip", "token_count": 669 }
909
// ignore_for_file: avoid_print import 'dart:io'; import 'package:data_loader/data_loader.dart'; import 'package:db_client/db_client.dart'; import 'package:prompt_repository/prompt_repository.dart'; void main(List<String> args) async { if (args.isEmpty) { print('No command specified'); return; } final subcommand = args.first; if (subcommand == 'prompts') { if (args.length == 3) { final projectId = args[1]; final csv = args[2]; final csvFile = File(csv); final dbClient = DbClient.initialize(projectId); final promptRepository = PromptRepository( dbClient: dbClient, ); final dataLoader = DataLoader( promptRepository: promptRepository, csv: csvFile, ); await dataLoader.loadPromptTerms((current, total) { print('Progress: ($current of $total)'); }); } else { print('Usage: dart data_loader.dart prompts <projectId> <csv>'); } } else if (subcommand == 'descriptions') { if (args.length == 3) { final projectId = args[1]; final csv = args[2]; final csvFile = File(csv); final dbClient = DbClient.initialize(projectId); final descriptionsLoader = DescriptionsLoader( dbClient: dbClient, csv: csvFile, ); await descriptionsLoader.loadDescriptions((current, total) { print('Progress: ($current of $total)'); }); } else { print('Usage: dart data_loader.dart descriptions <projectId> <csv>'); } } else if (subcommand == 'images') { if (args.length == 5) { final dest = args[1]; final csv = args[2]; final image = args[3]; final cardVariation = int.parse(args.last); final csvFile = File(csv); final imageFile = File(image); final imageLoader = ImageLoader( csv: csvFile, image: imageFile, dest: dest, variations: cardVariation, ); await imageLoader.loadImages((current, total) { print('Progress: ($current of $total)'); }); } else { print( 'Usage: dart data_loader.dart images <dest> <csv> ' '<images_folder> <card_variation_number>', ); } } else if (subcommand == 'validate_images') { if (args.length == 5) { final imagesFolder = args[1]; final csv = args[2]; final variations = args[3]; final character = args[4]; final csvFile = File(csv); final imagesFolderDirectory = Directory(imagesFolder); final descriptionsLoader = CharacterFolderValidator( csv: csvFile, imagesFolder: imagesFolderDirectory, variations: int.parse(variations), character: character, ); final missingFiles = await descriptionsLoader.validate((current, total) { print('Progress: ($current of $total)'); }); print('========== '); print('= Result = '); print('========== '); print(''); print('Missing files: ${missingFiles.length}'); for (final missingFile in missingFiles) { print(missingFile); } } else { print( 'Usage: dart bin/data_loader.dart validate_images <images_folder> <csv_file_location.csv> ' '<card_variation_number> <character>', ); } } else if (subcommand == 'generate_tables') { if (args.length == 6) { final projectId = args[1]; final imagesFolder = args[2]; final csv = args[3]; final variations = args[4]; final character = args[5]; final dbClient = DbClient.initialize(projectId); final csvFile = File(csv); final imagesFolderDirectory = Directory(imagesFolder); final generator = CreateImageLookup( dbClient: dbClient, csv: csvFile, imagesFolder: imagesFolderDirectory, variations: int.parse(variations), character: character, ); await generator.generateLookupTable((current, total) { print('Progress: ($current of $total)'); }); } else { print( 'Usage: dart bin/data_loader.dart generate_tables <project_id> <images_folder> <csv_file_location.csv> ' '<card_variation_number> <character>', ); } } else if (subcommand == 'normalize') { if (args.length == 3) { final imagesFolder = args[1]; final destinationFolder = args[2]; final imagesFolderDirectory = Directory(imagesFolder); final destinationFolderDirectory = Directory(destinationFolder); final generator = NormalizeImageNames( imagesFolder: imagesFolderDirectory, destImagesFolder: destinationFolderDirectory, ); await generator.normalize((current, total) { print('Progress: ($current of $total)'); }); } else { print( 'Usage: dart bin/data_loader.dart normalize <images_folder> ', ); } } else if (subcommand == 'missing_descriptions') { if (args.length == 4) { final projectId = args[1]; final csvPath = args[2]; final character = args[3]; final csv = File(csvPath); final dbClient = DbClient.initialize(projectId); final generator = MissingDescriptions( dbClient: dbClient, csv: csv, character: character, ); await generator.checkMissing((__, _) { // Progress printing gets in the way on this command. }); print('Done'); } else { print( 'Usage: dart bin/data_loader.dart missing_descriptions <project_id> <images_folder> <character>', ); } } else if (subcommand == 'missing_image_tables') { if (args.length == 4) { final projectId = args[1]; final csvPath = args[2]; final character = args[3]; final csv = File(csvPath); final dbClient = DbClient.initialize(projectId); final generator = MissingImageTables( dbClient: dbClient, csv: csv, character: character, ); await generator.checkMissing((__, _) { // Progress printing gets in the way on this command. }); print('Done'); } else { print( 'Usage: dart bin/data_loader.dart missing_image_tables <project_id> <images_folder> <character>', ); } } else { print('Unknown command: $subcommand'); } }
io_flip/api/tools/data_loader/bin/data_loader.dart/0
{ "file_path": "io_flip/api/tools/data_loader/bin/data_loader.dart", "repo_id": "io_flip", "token_count": 2569 }
910
// ignore_for_file: prefer_const_constructors import 'dart:io'; import 'package:csv/csv.dart'; import 'package:data_loader/data_loader.dart'; import 'package:db_client/db_client.dart'; import 'package:game_domain/game_domain.dart'; import 'package:mocktail/mocktail.dart'; import 'package:test/test.dart'; class _MockDbClient extends Mock implements DbClient {} class _MockFile extends Mock implements File {} void main() { group('DescriptionsLoader', () { late DescriptionsLoader dataLoader; late DbClient dbClient; late File csv; setUpAll(() { registerFallbackValue( PromptTerm(term: '', type: PromptTermType.character), ); }); setUp(() { dbClient = _MockDbClient(); when(() => dbClient.add(any(), any())).thenAnswer( (_) async => '', ); csv = _MockFile(); dataLoader = DescriptionsLoader( dbClient: dbClient, csv: csv, ); }); test('can be instantiated', () { expect( DescriptionsLoader( dbClient: _MockDbClient(), csv: _MockFile(), ), isNotNull, ); }); group('loadDescriptions', () { test('load descriptions correctly', () async { when(() => csv.readAsString()).thenAnswer( (_) async => ListToCsvConverter().convert([ ['Character', 'Class', 'Power', 'Location', 'Desc 1', 'Desc 2'], ['Dash', 'Alien', 'Banjos', 'City', 'Desc 1', 'Desc 2'], ['Sparky', 'Alien', 'Banjos', 'City', 'Desc 1', 'Desc 2'], ]), ); await dataLoader.loadDescriptions((_, __) {}); verify( () => dbClient.add( 'card_descriptions', { 'character': 'dash', 'characterClass': 'alien', 'power': 'banjos', 'location': 'city', 'description': 'Desc 1', }, ), ).called(1); verify( () => dbClient.add( 'card_descriptions', { 'character': 'dash', 'characterClass': 'alien', 'power': 'banjos', 'location': 'city', 'description': 'Desc 2', }, ), ).called(1); verify( () => dbClient.add( 'card_descriptions', { 'character': 'sparky', 'characterClass': 'alien', 'power': 'banjos', 'location': 'city', 'description': 'Desc 1', }, ), ).called(1); verify( () => dbClient.add( 'card_descriptions', { 'character': 'sparky', 'characterClass': 'alien', 'power': 'banjos', 'location': 'city', 'description': 'Desc 2', }, ), ).called(1); }); test('does nothing when inserting fails', () async { when(() => dbClient.add(any(), any())).thenThrow(Exception()); when(() => csv.readAsString()).thenAnswer( (_) async => ListToCsvConverter().convert([ ['Character', 'Class', 'Power', 'Location', 'Desc 1', 'Desc 2'], ['Dash', 'Alien', 'Banjos', 'City', 'Desc 1', 'Desc 2'], ['Sparky', 'Alien', 'Banjos', 'City', 'Desc 1', 'Desc 2'], ]), ); await expectLater(dataLoader.loadDescriptions((_, __) {}), completes); }); test('progress is called correctly', () async { when(() => csv.readAsString()).thenAnswer( (_) async => ListToCsvConverter().convert([ ['Character', 'Class', 'Power', 'Location', 'Desc 1', 'Desc 2'], ['Dash', 'Alien', 'Banjos', 'City', 'Desc 1', 'Desc 2'], ['Sparky', 'Alien', 'Banjos', 'City', 'Desc 1', 'Desc 2'], ]), ); final progress = <List<int>>[]; await dataLoader.loadDescriptions((current, total) { progress.add([current, total]); }); expect( progress, equals( [ [0, 4], [1, 4], [2, 4], [3, 4], [4, 4], ], ), ); }); }); }); }
io_flip/api/tools/data_loader/test/src/description_loader_test.dart/0
{ "file_path": "io_flip/api/tools/data_loader/test/src/description_loader_test.dart", "repo_id": "io_flip", "token_count": 2218 }
911
Music in the template is by Mr Smith, and licensed under Creative Commons Attribution 4.0 International (CC BY 4.0). https://freemusicarchive.org/music/mr-smith Mr Smith's music is used in this template project with his explicit permission.
io_flip/assets/music/README.md/0
{ "file_path": "io_flip/assets/music/README.md", "repo_id": "io_flip", "token_count": 63 }
912
export 'view/app.dart';
io_flip/flop/lib/app/app.dart/0
{ "file_path": "io_flip/flop/lib/app/app.dart", "repo_id": "io_flip", "token_count": 10 }
913
arb-dir: lib/l10n/arb template-arb-file: app_en.arb output-localization-file: app_localizations.dart nullable-getter: false
io_flip/l10n.yaml/0
{ "file_path": "io_flip/l10n.yaml", "repo_id": "io_flip", "token_count": 47 }
914
// 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:async'; import 'dart:isolate'; import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:logging/logging.dart'; /// Runs [mainFunction] in a guarded [Zone]. /// /// If a non-null [FirebaseCrashlytics] instance is provided through /// [crashlytics], then all errors will be reported through it. /// /// These errors will also include latest logs from anywhere in the app /// that use `package:logging`. Future<void> guardWithCrashlytics( void Function() mainFunction, { required FirebaseCrashlytics? crashlytics, }) async { // Running the initialization code and [mainFunction] inside a guarded // zone, so that all errors (even those occurring in callbacks) are // caught and can be sent to Crashlytics. await runZonedGuarded<Future<void>>(() async { if (kDebugMode) { // Log more when in debug mode. Logger.root.level = Level.FINE; } // Subscribe to log messages. Logger.root.onRecord.listen((record) { final message = '${record.level.name}: ${record.time}: ' '${record.loggerName}: ' '${record.message}'; debugPrint(message); // Add the message to the rotating Crashlytics log. crashlytics?.log(message); if (record.level >= Level.SEVERE) { crashlytics?.recordError( message, filterStackTrace(StackTrace.current), fatal: true, ); } }); // Pass all uncaught errors from the framework to Crashlytics. if (crashlytics != null) { WidgetsFlutterBinding.ensureInitialized(); FlutterError.onError = crashlytics.recordFlutterFatalError; } if (!kIsWeb) { // To catch errors outside of the Flutter context, we attach an error // listener to the current isolate. Isolate.current.addErrorListener( RawReceivePort((dynamic pair) async { final errorAndStacktrace = pair as List<dynamic>; await crashlytics?.recordError( errorAndStacktrace.first, errorAndStacktrace.last as StackTrace?, fatal: true, ); }).sendPort, ); } // Run the actual code. mainFunction(); }, (error, stack) { // This sees all errors that occur in the runZonedGuarded zone. debugPrint('ERROR: $error\n\n' 'STACK:$stack'); crashlytics?.recordError(error, stack, fatal: true); }); } /// Takes a [stackTrace] and creates a new one, but without the lines that /// have to do with this file and logging. This way, Crashlytics won't group /// all messages that come from this file into one big heap just because /// the head of the StackTrace is identical. /// /// See this: /// https://stackoverflow.com/questions/47654410/how-to-effectively-group-non-fatal-exceptions-in-crashlytics-fabrics. @visibleForTesting StackTrace filterStackTrace(StackTrace stackTrace) { try { final lines = stackTrace.toString().split('\n'); final buf = StringBuffer(); for (final line in lines) { if (line.contains('crashlytics.dart') || line.contains('_BroadcastStreamController.java') || line.contains('logger.dart')) { continue; } buf.writeln(line); } return StackTrace.fromString(buf.toString()); } catch (e) { debugPrint('Problem while filtering stack trace: $e'); } // If there was an error while filtering, // return the original, unfiltered stack track. return stackTrace; }
io_flip/lib/crashlytics/crashlytics.dart/0
{ "file_path": "io_flip/lib/crashlytics/crashlytics.dart", "repo_id": "io_flip", "token_count": 1359 }
915
import 'package:api_client/api_client.dart'; import 'package:authentication_repository/authentication_repository.dart'; import 'package:connection_repository/connection_repository.dart'; import 'package:equatable/equatable.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/game/game.dart'; import 'package:match_maker_repository/match_maker_repository.dart'; class GamePage extends StatelessWidget { const GamePage({ required this.matchId, required this.isHost, required this.deck, super.key, }); factory GamePage.routeBuilder(_, GoRouterState state) { final data = state.extra as GamePageData?; return GamePage( key: const Key('game'), matchId: data?.matchId ?? '', isHost: data?.isHost ?? false, deck: data?.deck, ); } final String matchId; final bool isHost; final Deck? deck; @override Widget build(BuildContext context) { return BlocProvider( create: (context) { final gameResource = context.read<GameResource>(); final matchMakerRepository = context.read<MatchMakerRepository>(); final connectionRepository = context.read<ConnectionRepository>(); final audioController = context.read<AudioController>(); final matchSolver = context.read<MatchSolver>(); final user = context.read<User>(); return GameBloc( gameResource: gameResource, matchMakerRepository: matchMakerRepository, audioController: audioController, connectionRepository: connectionRepository, matchSolver: matchSolver, user: user, isHost: isHost, )..add(MatchRequested(matchId, deck)); }, child: const GameView(), ); } } class GamePageData extends Equatable { const GamePageData({ required this.isHost, required this.matchId, required this.deck, }); final bool isHost; final String? matchId; final Deck deck; @override List<Object?> get props => [isHost, matchId, deck]; }
io_flip/lib/game/views/game_page.dart/0
{ "file_path": "io_flip/lib/game/views/game_page.dart", "repo_id": "io_flip", "token_count": 825 }
916
import 'package:flutter/material.dart'; class CircularAlignmentTween extends AlignmentTween { CircularAlignmentTween({super.begin, super.end}); @override Alignment lerp(double t) { final t1 = 1 - t; final beginOffset = Offset(begin!.x, begin!.y); final endOffset = Offset(end!.x, end!.y); final control = (beginOffset + endOffset) * .75; final result = beginOffset * t1 * t1 + control * 2 * t1 * t + endOffset * t * t; return Alignment(result.dx, result.dy); } }
io_flip/lib/how_to_play/widgets/circular_alignment_tween.dart/0
{ "file_path": "io_flip/lib/how_to_play/widgets/circular_alignment_tween.dart", "repo_id": "io_flip", "token_count": 191 }
917
part of 'initials_form_bloc.dart'; enum InitialsFormStatus { initial, valid, invalid, blacklisted, success, failure; bool get isInvalid => this == InitialsFormStatus.invalid; } class InitialsFormState extends Equatable { const InitialsFormState({ List<String>? initials, this.status = InitialsFormStatus.initial, }) : initials = initials ?? const ['', '', '']; final List<String> initials; final InitialsFormStatus status; InitialsFormState copyWith({ List<String>? initials, InitialsFormStatus? status, }) { return InitialsFormState( initials: initials ?? this.initials, status: status ?? this.status, ); } @override List<Object> get props => [initials, status]; }
io_flip/lib/leaderboard/initials_form/bloc/initials_form_state.dart/0
{ "file_path": "io_flip/lib/leaderboard/initials_form/bloc/initials_form_state.dart", "repo_id": "io_flip", "token_count": 249 }
918
part of 'match_making_bloc.dart'; abstract class MatchMakingEvent extends Equatable { const MatchMakingEvent(); } class MatchRequested extends MatchMakingEvent { const MatchRequested(); @override List<Object> get props => []; } class PrivateMatchRequested extends MatchMakingEvent { const PrivateMatchRequested(); @override List<Object> get props => []; } class GuestPrivateMatchRequested extends MatchMakingEvent { const GuestPrivateMatchRequested(this.inviteCode); final String inviteCode; @override List<Object> get props => [inviteCode]; }
io_flip/lib/match_making/bloc/match_making_event.dart/0
{ "file_path": "io_flip/lib/match_making/bloc/match_making_event.dart", "repo_id": "io_flip", "token_count": 163 }
919
import 'package:flame/cache.dart'; import 'package:flame/components.dart'; import 'package:flame/widgets.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:io_flip/gen/assets.gen.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; class CardMaster extends StatefulWidget { const CardMaster({ super.key, this.deviceInfoAwareAsset, }); final DeviceInfoAwareAsset<String>? deviceInfoAwareAsset; static const cardMasterHeight = 312.0; @override State<CardMaster> createState() => _CardMasterState(); } class _CardMasterState extends State<CardMaster> { late final Images images; late final bool isStill; String? asset; @override void initState() { super.initState(); images = context.read<Images>(); _loadAsset(); } Future<void> _loadAsset() async { final loaded = await (widget.deviceInfoAwareAsset ?? deviceInfoAwareAsset)( predicate: isAndroid, asset: () => Assets.images.mobile.cardMasterStill.keyName, orElse: () => platformAwareAsset( desktop: Assets.images.desktop.cardMaster.keyName, mobile: Assets.images.mobile.cardMaster.keyName, ), ); setState(() { asset = loaded; isStill = asset == Assets.images.mobile.cardMasterStill.keyName; }); } @override void dispose() { super.dispose(); if (asset != null) { images.clear(asset!); } } @override Widget build(BuildContext context) { final loadedAsset = asset; if (loadedAsset == null) { return const SizedBox.square(dimension: CardMaster.cardMasterHeight); } if (isStill) { return Image.asset( loadedAsset, height: CardMaster.cardMasterHeight, ); } else { return SizedBox.square( dimension: CardMaster.cardMasterHeight, child: SpriteAnimationWidget.asset( path: loadedAsset, images: images, data: SpriteAnimationData.sequenced( amount: 57, amountPerRow: 19, textureSize: platformAwareAsset( desktop: Vector2(812, 812), mobile: Vector2(406, 406), ), stepTime: 0.04, ), ), ); } } }
io_flip/lib/prompt/widgets/card_master.dart/0
{ "file_path": "io_flip/lib/prompt/widgets/card_master.dart", "repo_id": "io_flip", "token_count": 926 }
920
import 'package:api_client/api_client.dart'; import 'package:bloc/bloc.dart'; import 'package:cross_file/cross_file.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/foundation.dart'; import 'package:game_domain/game_domain.dart'; part 'download_event.dart'; part 'download_state.dart'; class DownloadBloc extends Bloc<DownloadEvent, DownloadState> { DownloadBloc({ required ShareResource shareResource, XFile Function(Uint8List, {String? mimeType, String? name})? parseBytes, }) : _shareResource = shareResource, _parseBytes = parseBytes ?? XFile.fromData, super(const DownloadState()) { on<DownloadCardsRequested>(_onDownloadCardRequested); on<DownloadDeckRequested>(_onDownloadDeckRequested); } final ShareResource _shareResource; late final XFile Function(Uint8List, {String? mimeType, String? name}) _parseBytes; Future<void> _onDownloadCardRequested( DownloadCardsRequested event, Emitter<DownloadState> emit, ) async { emit(state.copyWith(status: DownloadStatus.loading)); try { for (final card in event.cards) { final bytes = await _shareResource.getShareCardImage(card.id); final file = _parseBytes( bytes, mimeType: 'image/png', name: card.name, ); await file.saveTo('${card.name}.png'); emit(state.copyWith(status: DownloadStatus.completed)); } } catch (e, s) { addError(e, s); emit(state.copyWith(status: DownloadStatus.failure)); } } Future<void> _onDownloadDeckRequested( DownloadDeckRequested event, Emitter<DownloadState> emit, ) async { emit(state.copyWith(status: DownloadStatus.loading)); try { final bytes = await _shareResource.getShareDeckImage(event.deck.id); final file = _parseBytes( bytes, mimeType: 'image/png', name: 'My Team', ); await file.saveTo('My Team.png'); emit(state.copyWith(status: DownloadStatus.completed)); } catch (e, s) { addError(e, s); emit(state.copyWith(status: DownloadStatus.failure)); } } }
io_flip/lib/share/bloc/download_bloc.dart/0
{ "file_path": "io_flip/lib/share/bloc/download_bloc.dart", "repo_id": "io_flip", "token_count": 833 }
921
export 'cubit/terms_of_use_cubit.dart'; export 'view/terms_of_use_view.dart';
io_flip/lib/terms_of_use/terms_of_use.dart/0
{ "file_path": "io_flip/lib/terms_of_use/terms_of_use.dart", "repo_id": "io_flip", "token_count": 36 }
922
import 'dart:convert'; import 'dart:io'; import 'package:api_client/api_client.dart'; import 'package:game_domain/game_domain.dart'; /// {@template leaderboard_resource} /// An api resource for interacting with the leaderboard. /// {@endtemplate} class LeaderboardResource { /// {@macro leaderboard_resource} LeaderboardResource({ required ApiClient apiClient, }) : _apiClient = apiClient; final ApiClient _apiClient; /// Get /game/leaderboard/results /// /// Returns a list of [LeaderboardPlayer]. Future<List<LeaderboardPlayer>> getLeaderboardResults() async { final response = await _apiClient.get('/game/leaderboard/results'); if (response.statusCode != HttpStatus.ok) { throw ApiClientError( 'GET /leaderboard/results returned status ${response.statusCode} with the following response: "${response.body}"', StackTrace.current, ); } try { final json = jsonDecode(response.body) as Map<String, dynamic>; final leaderboardPlayers = json['leaderboardPlayers'] as List; return leaderboardPlayers .map( (json) => LeaderboardPlayer.fromJson(json as Map<String, dynamic>), ) .toList(); } catch (e) { throw ApiClientError( 'GET /leaderboard/results returned invalid response "${response.body}"', StackTrace.current, ); } } /// Get /game/leaderboard/initials_blacklist /// /// Returns a [List<String>]. Future<List<String>> getInitialsBlacklist() async { final response = await _apiClient.get('/game/leaderboard/initials_blacklist'); if (response.statusCode == HttpStatus.notFound) { return []; } if (response.statusCode != HttpStatus.ok) { throw ApiClientError( 'GET /leaderboard/initials_blacklist returned status ${response.statusCode} with the following response: "${response.body}"', StackTrace.current, ); } try { final json = jsonDecode(response.body) as Map<String, dynamic>; return (json['list'] as List).cast<String>(); } catch (e) { throw ApiClientError( 'GET /leaderboard/initials_blacklist returned invalid response "${response.body}"', StackTrace.current, ); } } /// Post /game/leaderboard/initials Future<void> addInitialsToScoreCard({ required String scoreCardId, required String initials, }) async { final response = await _apiClient.post( '/game/leaderboard/initials', body: jsonEncode({ 'scoreCardId': scoreCardId, 'initials': initials, }), ); if (response.statusCode != HttpStatus.noContent) { throw ApiClientError( 'POST /leaderboard/initials returned status ${response.statusCode} with the following response: "${response.body}"', StackTrace.current, ); } } }
io_flip/packages/api_client/lib/src/resources/leaderboard_resource.dart/0
{ "file_path": "io_flip/packages/api_client/lib/src/resources/leaderboard_resource.dart", "repo_id": "io_flip", "token_count": 1068 }
923
/// Repository to manage authentication. library authentication_repository; export 'src/authentication_repository.dart'; export 'src/models/models.dart';
io_flip/packages/authentication_repository/lib/authentication_repository.dart/0
{ "file_path": "io_flip/packages/authentication_repository/lib/authentication_repository.dart", "repo_id": "io_flip", "token_count": 44 }
924
# Connection Repository [![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link] [![Powered by Mason](https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge)](https://github.com/felangel/mason) [![License: MIT][license_badge]][license_link] Repository to manage the connection state. ## Installation 💻 **❗ In order to start using Connection Repository you must have the [Flutter SDK][flutter_install_link] installed on your machine.** Add `connection_repository` to your `pubspec.yaml`: ```yaml dependencies: connection_repository: ``` Install it: ```sh flutter packages get ``` --- ## Continuous Integration 🤖 Connection Repository comes with a built-in [GitHub Actions workflow][github_actions_link] powered by [Very Good Workflows][very_good_workflows_link] but you can also add your preferred CI/CD solution. Out of the box, on each pull request and push, the CI `formats`, `lints`, and `tests` the code. This ensures the code remains consistent and behaves correctly as you add functionality or make changes. The project uses [Very Good Analysis][very_good_analysis_link] for a strict set of analysis options used by our team. Code coverage is enforced using the [Very Good Workflows][very_good_coverage_link]. --- ## Running Tests 🧪 For first time users, install the [very_good_cli][very_good_cli_link]: ```sh dart pub global activate very_good_cli ``` To run all unit tests: ```sh very_good test --coverage ``` To view the generated coverage report you can use [lcov](https://github.com/linux-test-project/lcov). ```sh # Generate Coverage Report genhtml coverage/lcov.info -o coverage/ # Open Coverage Report open coverage/index.html ``` [flutter_install_link]: https://docs.flutter.dev/get-started/install [github_actions_link]: https://docs.github.com/en/actions/learn-github-actions [license_badge]: https://img.shields.io/badge/license-MIT-blue.svg [license_link]: https://opensource.org/licenses/MIT [logo_black]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_black.png#gh-light-mode-only [logo_white]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_white.png#gh-dark-mode-only [mason_link]: https://github.com/felangel/mason [very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg [very_good_analysis_link]: https://pub.dev/packages/very_good_analysis [very_good_cli_link]: https://pub.dev/packages/very_good_cli [very_good_coverage_link]: https://github.com/marketplace/actions/very-good-coverage [very_good_ventures_link]: https://verygood.ventures [very_good_ventures_link_light]: https://verygood.ventures#gh-light-mode-only [very_good_ventures_link_dark]: https://verygood.ventures#gh-dark-mode-only [very_good_workflows_link]: https://github.com/VeryGoodOpenSource/very_good_workflows
io_flip/packages/connection_repository/README.md/0
{ "file_path": "io_flip/packages/connection_repository/README.md", "repo_id": "io_flip", "token_count": 954 }
925
# gallery Gallery project to showcase app_ui. To run click `run` in `gallery/lib/main.dart`
io_flip/packages/io_flip_ui/gallery/README.md/0
{ "file_path": "io_flip/packages/io_flip_ui/gallery/README.md", "repo_id": "io_flip", "token_count": 32 }
926
import 'package:flutter/material.dart'; import 'package:gallery/story_scaffold.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; class FoilShaderStory extends StatefulWidget { const FoilShaderStory({super.key}); @override State<FoilShaderStory> createState() => _FoilShaderStoryState(); } class _FoilShaderStoryState extends State<FoilShaderStory> { Offset? mousePosition; @override Widget build(BuildContext context) { return StoryScaffold( title: 'Foil Shader', body: Center( child: LayoutBuilder( builder: (context, constraints) { final size = Size.square(constraints.biggest.shortestSide * 0.5); final dx = ((mousePosition?.dx ?? 0) / size.width) * 2 - 1; final dy = ((mousePosition?.dy ?? 0) / size.height) * 2 - 1; return SizedBox.fromSize( size: size, child: MouseRegion( onHover: (event) { setState(() { mousePosition = event.localPosition; }); }, child: FoilShader( dx: dx, dy: dy, child: ColoredBox( color: Colors.white, child: Center( child: IoFlipLogo( width: size.width, height: size.height, ), ), ), ), ), ); }, ), ), ); } }
io_flip/packages/io_flip_ui/gallery/lib/widgets/foil_shader_story.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/gallery/lib/widgets/foil_shader_story.dart", "repo_id": "io_flip", "token_count": 861 }
927
/// GENERATED CODE - DO NOT MODIFY BY HAND /// ***************************************************** /// FlutterGen /// ***************************************************** // coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use import 'package:flutter/widgets.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter/services.dart'; class $AssetsImagesGen { const $AssetsImagesGen(); /// File path: assets/images/background_pattern.png AssetGenImage get backgroundPattern => const AssetGenImage('assets/images/background_pattern.png'); $AssetsImagesCardFramesGen get cardFrames => const $AssetsImagesCardFramesGen(); /// File path: assets/images/card_landing.png AssetGenImage get cardLanding => const AssetGenImage('assets/images/card_landing.png'); $AssetsImagesElementsGen get elements => const $AssetsImagesElementsGen(); $AssetsImagesFlipCountdownGen get flipCountdown => const $AssetsImagesFlipCountdownGen(); /// File path: assets/images/io_flip_logo.svg SvgGenImage get ioFlipLogo => const SvgGenImage('assets/images/io_flip_logo.svg'); /// File path: assets/images/io_flip_logo_03.svg SvgGenImage get ioFlipLogo03 => const SvgGenImage('assets/images/io_flip_logo_03.svg'); $AssetsImagesResultBadgesGen get resultBadges => const $AssetsImagesResultBadgesGen(); $AssetsImagesSuitsGen get suits => const $AssetsImagesSuitsGen(); /// List of all assets List<dynamic> get values => [backgroundPattern, cardLanding, ioFlipLogo, ioFlipLogo03]; } class $AssetsImagesCardFramesGen { const $AssetsImagesCardFramesGen(); /// File path: assets/images/card_frames/card_air.png AssetGenImage get cardAir => const AssetGenImage('assets/images/card_frames/card_air.png'); /// File path: assets/images/card_frames/card_back.png AssetGenImage get cardBack => const AssetGenImage('assets/images/card_frames/card_back.png'); /// File path: assets/images/card_frames/card_earth.png AssetGenImage get cardEarth => const AssetGenImage('assets/images/card_frames/card_earth.png'); /// File path: assets/images/card_frames/card_fire.png AssetGenImage get cardFire => const AssetGenImage('assets/images/card_frames/card_fire.png'); /// File path: assets/images/card_frames/card_metal.png AssetGenImage get cardMetal => const AssetGenImage('assets/images/card_frames/card_metal.png'); /// File path: assets/images/card_frames/card_water.png AssetGenImage get cardWater => const AssetGenImage('assets/images/card_frames/card_water.png'); $AssetsImagesCardFramesHolosGen get holos => const $AssetsImagesCardFramesHolosGen(); /// List of all assets List<AssetGenImage> get values => [cardAir, cardBack, cardEarth, cardFire, cardMetal, cardWater]; } class $AssetsImagesElementsGen { const $AssetsImagesElementsGen(); $AssetsImagesElementsDesktopGen get desktop => const $AssetsImagesElementsDesktopGen(); $AssetsImagesElementsMobileGen get mobile => const $AssetsImagesElementsMobileGen(); } class $AssetsImagesFlipCountdownGen { const $AssetsImagesFlipCountdownGen(); $AssetsImagesFlipCountdownDesktopGen get desktop => const $AssetsImagesFlipCountdownDesktopGen(); $AssetsImagesFlipCountdownMobileGen get mobile => const $AssetsImagesFlipCountdownMobileGen(); } class $AssetsImagesResultBadgesGen { const $AssetsImagesResultBadgesGen(); /// File path: assets/images/result_badges/draw.png AssetGenImage get draw => const AssetGenImage('assets/images/result_badges/draw.png'); /// File path: assets/images/result_badges/lose.png AssetGenImage get lose => const AssetGenImage('assets/images/result_badges/lose.png'); /// File path: assets/images/result_badges/win.png AssetGenImage get win => const AssetGenImage('assets/images/result_badges/win.png'); /// List of all assets List<AssetGenImage> get values => [draw, lose, win]; } class $AssetsImagesSuitsGen { const $AssetsImagesSuitsGen(); $AssetsImagesSuitsCardGen get card => const $AssetsImagesSuitsCardGen(); $AssetsImagesSuitsOnboardingGen get onboarding => const $AssetsImagesSuitsOnboardingGen(); } class $AssetsImagesCardFramesHolosGen { const $AssetsImagesCardFramesHolosGen(); /// File path: assets/images/card_frames/holos/card_air.png AssetGenImage get cardAir => const AssetGenImage('assets/images/card_frames/holos/card_air.png'); /// File path: assets/images/card_frames/holos/card_earth.png AssetGenImage get cardEarth => const AssetGenImage('assets/images/card_frames/holos/card_earth.png'); /// File path: assets/images/card_frames/holos/card_fire.png AssetGenImage get cardFire => const AssetGenImage('assets/images/card_frames/holos/card_fire.png'); /// File path: assets/images/card_frames/holos/card_metal.png AssetGenImage get cardMetal => const AssetGenImage('assets/images/card_frames/holos/card_metal.png'); /// File path: assets/images/card_frames/holos/card_water.png AssetGenImage get cardWater => const AssetGenImage('assets/images/card_frames/holos/card_water.png'); /// List of all assets List<AssetGenImage> get values => [cardAir, cardEarth, cardFire, cardMetal, cardWater]; } class $AssetsImagesElementsDesktopGen { const $AssetsImagesElementsDesktopGen(); $AssetsImagesElementsDesktopAirGen get air => const $AssetsImagesElementsDesktopAirGen(); $AssetsImagesElementsDesktopEarthGen get earth => const $AssetsImagesElementsDesktopEarthGen(); $AssetsImagesElementsDesktopFireGen get fire => const $AssetsImagesElementsDesktopFireGen(); $AssetsImagesElementsDesktopMetalGen get metal => const $AssetsImagesElementsDesktopMetalGen(); $AssetsImagesElementsDesktopWaterGen get water => const $AssetsImagesElementsDesktopWaterGen(); } class $AssetsImagesElementsMobileGen { const $AssetsImagesElementsMobileGen(); $AssetsImagesElementsMobileAirGen get air => const $AssetsImagesElementsMobileAirGen(); $AssetsImagesElementsMobileEarthGen get earth => const $AssetsImagesElementsMobileEarthGen(); $AssetsImagesElementsMobileFireGen get fire => const $AssetsImagesElementsMobileFireGen(); $AssetsImagesElementsMobileMetalGen get metal => const $AssetsImagesElementsMobileMetalGen(); $AssetsImagesElementsMobileWaterGen get water => const $AssetsImagesElementsMobileWaterGen(); } class $AssetsImagesFlipCountdownDesktopGen { const $AssetsImagesFlipCountdownDesktopGen(); /// File path: assets/images/flip_countdown/desktop/flip_countdown.png AssetGenImage get flipCountdown => const AssetGenImage( 'assets/images/flip_countdown/desktop/flip_countdown.png'); /// List of all assets List<AssetGenImage> get values => [flipCountdown]; } class $AssetsImagesFlipCountdownMobileGen { const $AssetsImagesFlipCountdownMobileGen(); /// File path: assets/images/flip_countdown/mobile/flip_countdown_1.png AssetGenImage get flipCountdown1 => const AssetGenImage( 'assets/images/flip_countdown/mobile/flip_countdown_1.png'); /// File path: assets/images/flip_countdown/mobile/flip_countdown_2.png AssetGenImage get flipCountdown2 => const AssetGenImage( 'assets/images/flip_countdown/mobile/flip_countdown_2.png'); /// File path: assets/images/flip_countdown/mobile/flip_countdown_3.png AssetGenImage get flipCountdown3 => const AssetGenImage( 'assets/images/flip_countdown/mobile/flip_countdown_3.png'); /// File path: assets/images/flip_countdown/mobile/flip_countdown_flip.png AssetGenImage get flipCountdownFlip => const AssetGenImage( 'assets/images/flip_countdown/mobile/flip_countdown_flip.png'); /// List of all assets List<AssetGenImage> get values => [flipCountdown1, flipCountdown2, flipCountdown3, flipCountdownFlip]; } class $AssetsImagesSuitsCardGen { const $AssetsImagesSuitsCardGen(); /// File path: assets/images/suits/card/air.svg SvgGenImage get air => const SvgGenImage('assets/images/suits/card/air.svg'); /// File path: assets/images/suits/card/earth.svg SvgGenImage get earth => const SvgGenImage('assets/images/suits/card/earth.svg'); /// File path: assets/images/suits/card/fire.svg SvgGenImage get fire => const SvgGenImage('assets/images/suits/card/fire.svg'); /// File path: assets/images/suits/card/metal.svg SvgGenImage get metal => const SvgGenImage('assets/images/suits/card/metal.svg'); /// File path: assets/images/suits/card/water.svg SvgGenImage get water => const SvgGenImage('assets/images/suits/card/water.svg'); /// List of all assets List<SvgGenImage> get values => [air, earth, fire, metal, water]; } class $AssetsImagesSuitsOnboardingGen { const $AssetsImagesSuitsOnboardingGen(); /// File path: assets/images/suits/onboarding/air.svg SvgGenImage get air => const SvgGenImage('assets/images/suits/onboarding/air.svg'); /// File path: assets/images/suits/onboarding/earth.svg SvgGenImage get earth => const SvgGenImage('assets/images/suits/onboarding/earth.svg'); /// File path: assets/images/suits/onboarding/fire.svg SvgGenImage get fire => const SvgGenImage('assets/images/suits/onboarding/fire.svg'); /// File path: assets/images/suits/onboarding/metal.svg SvgGenImage get metal => const SvgGenImage('assets/images/suits/onboarding/metal.svg'); /// File path: assets/images/suits/onboarding/water.svg SvgGenImage get water => const SvgGenImage('assets/images/suits/onboarding/water.svg'); /// List of all assets List<SvgGenImage> get values => [air, earth, fire, metal, water]; } class $AssetsImagesElementsDesktopAirGen { const $AssetsImagesElementsDesktopAirGen(); /// File path: assets/images/elements/desktop/air/charge_back.png AssetGenImage get chargeBack => const AssetGenImage('assets/images/elements/desktop/air/charge_back.png'); /// File path: assets/images/elements/desktop/air/charge_front.png AssetGenImage get chargeFront => const AssetGenImage( 'assets/images/elements/desktop/air/charge_front.png'); /// File path: assets/images/elements/desktop/air/damage_receive.png AssetGenImage get damageReceive => const AssetGenImage( 'assets/images/elements/desktop/air/damage_receive.png'); /// File path: assets/images/elements/desktop/air/damage_send.png AssetGenImage get damageSend => const AssetGenImage('assets/images/elements/desktop/air/damage_send.png'); /// File path: assets/images/elements/desktop/air/victory_charge_back.png AssetGenImage get victoryChargeBack => const AssetGenImage( 'assets/images/elements/desktop/air/victory_charge_back.png'); /// File path: assets/images/elements/desktop/air/victory_charge_front.png AssetGenImage get victoryChargeFront => const AssetGenImage( 'assets/images/elements/desktop/air/victory_charge_front.png'); /// List of all assets List<AssetGenImage> get values => [ chargeBack, chargeFront, damageReceive, damageSend, victoryChargeBack, victoryChargeFront ]; } class $AssetsImagesElementsDesktopEarthGen { const $AssetsImagesElementsDesktopEarthGen(); /// File path: assets/images/elements/desktop/earth/charge_back.png AssetGenImage get chargeBack => const AssetGenImage( 'assets/images/elements/desktop/earth/charge_back.png'); /// File path: assets/images/elements/desktop/earth/charge_front.png AssetGenImage get chargeFront => const AssetGenImage( 'assets/images/elements/desktop/earth/charge_front.png'); /// File path: assets/images/elements/desktop/earth/damage_receive.png AssetGenImage get damageReceive => const AssetGenImage( 'assets/images/elements/desktop/earth/damage_receive.png'); /// File path: assets/images/elements/desktop/earth/damage_send.png AssetGenImage get damageSend => const AssetGenImage( 'assets/images/elements/desktop/earth/damage_send.png'); /// File path: assets/images/elements/desktop/earth/victory_charge_back.png AssetGenImage get victoryChargeBack => const AssetGenImage( 'assets/images/elements/desktop/earth/victory_charge_back.png'); /// File path: assets/images/elements/desktop/earth/victory_charge_front.png AssetGenImage get victoryChargeFront => const AssetGenImage( 'assets/images/elements/desktop/earth/victory_charge_front.png'); /// List of all assets List<AssetGenImage> get values => [ chargeBack, chargeFront, damageReceive, damageSend, victoryChargeBack, victoryChargeFront ]; } class $AssetsImagesElementsDesktopFireGen { const $AssetsImagesElementsDesktopFireGen(); /// File path: assets/images/elements/desktop/fire/charge_back.png AssetGenImage get chargeBack => const AssetGenImage( 'assets/images/elements/desktop/fire/charge_back.png'); /// File path: assets/images/elements/desktop/fire/charge_front.png AssetGenImage get chargeFront => const AssetGenImage( 'assets/images/elements/desktop/fire/charge_front.png'); /// File path: assets/images/elements/desktop/fire/damage_receive.png AssetGenImage get damageReceive => const AssetGenImage( 'assets/images/elements/desktop/fire/damage_receive.png'); /// File path: assets/images/elements/desktop/fire/damage_send.png AssetGenImage get damageSend => const AssetGenImage( 'assets/images/elements/desktop/fire/damage_send.png'); /// File path: assets/images/elements/desktop/fire/victory_charge_back.png AssetGenImage get victoryChargeBack => const AssetGenImage( 'assets/images/elements/desktop/fire/victory_charge_back.png'); /// File path: assets/images/elements/desktop/fire/victory_charge_front.png AssetGenImage get victoryChargeFront => const AssetGenImage( 'assets/images/elements/desktop/fire/victory_charge_front.png'); /// List of all assets List<AssetGenImage> get values => [ chargeBack, chargeFront, damageReceive, damageSend, victoryChargeBack, victoryChargeFront ]; } class $AssetsImagesElementsDesktopMetalGen { const $AssetsImagesElementsDesktopMetalGen(); /// File path: assets/images/elements/desktop/metal/charge_back.png AssetGenImage get chargeBack => const AssetGenImage( 'assets/images/elements/desktop/metal/charge_back.png'); /// File path: assets/images/elements/desktop/metal/charge_front.png AssetGenImage get chargeFront => const AssetGenImage( 'assets/images/elements/desktop/metal/charge_front.png'); /// File path: assets/images/elements/desktop/metal/damage_receive.png AssetGenImage get damageReceive => const AssetGenImage( 'assets/images/elements/desktop/metal/damage_receive.png'); /// File path: assets/images/elements/desktop/metal/damage_send.png AssetGenImage get damageSend => const AssetGenImage( 'assets/images/elements/desktop/metal/damage_send.png'); /// File path: assets/images/elements/desktop/metal/victory_charge_back.png AssetGenImage get victoryChargeBack => const AssetGenImage( 'assets/images/elements/desktop/metal/victory_charge_back.png'); /// File path: assets/images/elements/desktop/metal/victory_charge_front.png AssetGenImage get victoryChargeFront => const AssetGenImage( 'assets/images/elements/desktop/metal/victory_charge_front.png'); /// List of all assets List<AssetGenImage> get values => [ chargeBack, chargeFront, damageReceive, damageSend, victoryChargeBack, victoryChargeFront ]; } class $AssetsImagesElementsDesktopWaterGen { const $AssetsImagesElementsDesktopWaterGen(); /// File path: assets/images/elements/desktop/water/charge_back.png AssetGenImage get chargeBack => const AssetGenImage( 'assets/images/elements/desktop/water/charge_back.png'); /// File path: assets/images/elements/desktop/water/charge_front.png AssetGenImage get chargeFront => const AssetGenImage( 'assets/images/elements/desktop/water/charge_front.png'); /// File path: assets/images/elements/desktop/water/damage_receive.png AssetGenImage get damageReceive => const AssetGenImage( 'assets/images/elements/desktop/water/damage_receive.png'); /// File path: assets/images/elements/desktop/water/damage_send.png AssetGenImage get damageSend => const AssetGenImage( 'assets/images/elements/desktop/water/damage_send.png'); /// File path: assets/images/elements/desktop/water/victory_charge_back.png AssetGenImage get victoryChargeBack => const AssetGenImage( 'assets/images/elements/desktop/water/victory_charge_back.png'); /// File path: assets/images/elements/desktop/water/victory_charge_front.png AssetGenImage get victoryChargeFront => const AssetGenImage( 'assets/images/elements/desktop/water/victory_charge_front.png'); /// List of all assets List<AssetGenImage> get values => [ chargeBack, chargeFront, damageReceive, damageSend, victoryChargeBack, victoryChargeFront ]; } class $AssetsImagesElementsMobileAirGen { const $AssetsImagesElementsMobileAirGen(); /// File path: assets/images/elements/mobile/air/charge_back.png AssetGenImage get chargeBack => const AssetGenImage('assets/images/elements/mobile/air/charge_back.png'); /// File path: assets/images/elements/mobile/air/charge_front.png AssetGenImage get chargeFront => const AssetGenImage('assets/images/elements/mobile/air/charge_front.png'); /// File path: assets/images/elements/mobile/air/damage_receive.png AssetGenImage get damageReceive => const AssetGenImage( 'assets/images/elements/mobile/air/damage_receive.png'); /// File path: assets/images/elements/mobile/air/damage_send.png AssetGenImage get damageSend => const AssetGenImage('assets/images/elements/mobile/air/damage_send.png'); /// File path: assets/images/elements/mobile/air/victory_charge_back.png AssetGenImage get victoryChargeBack => const AssetGenImage( 'assets/images/elements/mobile/air/victory_charge_back.png'); /// File path: assets/images/elements/mobile/air/victory_charge_front.png AssetGenImage get victoryChargeFront => const AssetGenImage( 'assets/images/elements/mobile/air/victory_charge_front.png'); /// List of all assets List<AssetGenImage> get values => [ chargeBack, chargeFront, damageReceive, damageSend, victoryChargeBack, victoryChargeFront ]; } class $AssetsImagesElementsMobileEarthGen { const $AssetsImagesElementsMobileEarthGen(); /// File path: assets/images/elements/mobile/earth/charge_back.png AssetGenImage get chargeBack => const AssetGenImage( 'assets/images/elements/mobile/earth/charge_back.png'); /// File path: assets/images/elements/mobile/earth/charge_front.png AssetGenImage get chargeFront => const AssetGenImage( 'assets/images/elements/mobile/earth/charge_front.png'); /// File path: assets/images/elements/mobile/earth/damage_receive.png AssetGenImage get damageReceive => const AssetGenImage( 'assets/images/elements/mobile/earth/damage_receive.png'); /// File path: assets/images/elements/mobile/earth/damage_send.png AssetGenImage get damageSend => const AssetGenImage( 'assets/images/elements/mobile/earth/damage_send.png'); /// File path: assets/images/elements/mobile/earth/victory_charge_back.png AssetGenImage get victoryChargeBack => const AssetGenImage( 'assets/images/elements/mobile/earth/victory_charge_back.png'); /// File path: assets/images/elements/mobile/earth/victory_charge_front.png AssetGenImage get victoryChargeFront => const AssetGenImage( 'assets/images/elements/mobile/earth/victory_charge_front.png'); /// List of all assets List<AssetGenImage> get values => [ chargeBack, chargeFront, damageReceive, damageSend, victoryChargeBack, victoryChargeFront ]; } class $AssetsImagesElementsMobileFireGen { const $AssetsImagesElementsMobileFireGen(); /// File path: assets/images/elements/mobile/fire/charge_back.png AssetGenImage get chargeBack => const AssetGenImage('assets/images/elements/mobile/fire/charge_back.png'); /// File path: assets/images/elements/mobile/fire/charge_front.png AssetGenImage get chargeFront => const AssetGenImage( 'assets/images/elements/mobile/fire/charge_front.png'); /// File path: assets/images/elements/mobile/fire/damage_receive.png AssetGenImage get damageReceive => const AssetGenImage( 'assets/images/elements/mobile/fire/damage_receive.png'); /// File path: assets/images/elements/mobile/fire/damage_send.png AssetGenImage get damageSend => const AssetGenImage('assets/images/elements/mobile/fire/damage_send.png'); /// File path: assets/images/elements/mobile/fire/victory_charge_back.png AssetGenImage get victoryChargeBack => const AssetGenImage( 'assets/images/elements/mobile/fire/victory_charge_back.png'); /// File path: assets/images/elements/mobile/fire/victory_charge_front.png AssetGenImage get victoryChargeFront => const AssetGenImage( 'assets/images/elements/mobile/fire/victory_charge_front.png'); /// List of all assets List<AssetGenImage> get values => [ chargeBack, chargeFront, damageReceive, damageSend, victoryChargeBack, victoryChargeFront ]; } class $AssetsImagesElementsMobileMetalGen { const $AssetsImagesElementsMobileMetalGen(); /// File path: assets/images/elements/mobile/metal/charge_back.png AssetGenImage get chargeBack => const AssetGenImage( 'assets/images/elements/mobile/metal/charge_back.png'); /// File path: assets/images/elements/mobile/metal/charge_front.png AssetGenImage get chargeFront => const AssetGenImage( 'assets/images/elements/mobile/metal/charge_front.png'); /// File path: assets/images/elements/mobile/metal/damage_receive.png AssetGenImage get damageReceive => const AssetGenImage( 'assets/images/elements/mobile/metal/damage_receive.png'); /// File path: assets/images/elements/mobile/metal/damage_send.png AssetGenImage get damageSend => const AssetGenImage( 'assets/images/elements/mobile/metal/damage_send.png'); /// File path: assets/images/elements/mobile/metal/victory_charge_back.png AssetGenImage get victoryChargeBack => const AssetGenImage( 'assets/images/elements/mobile/metal/victory_charge_back.png'); /// File path: assets/images/elements/mobile/metal/victory_charge_front.png AssetGenImage get victoryChargeFront => const AssetGenImage( 'assets/images/elements/mobile/metal/victory_charge_front.png'); /// List of all assets List<AssetGenImage> get values => [ chargeBack, chargeFront, damageReceive, damageSend, victoryChargeBack, victoryChargeFront ]; } class $AssetsImagesElementsMobileWaterGen { const $AssetsImagesElementsMobileWaterGen(); /// File path: assets/images/elements/mobile/water/charge_back.png AssetGenImage get chargeBack => const AssetGenImage( 'assets/images/elements/mobile/water/charge_back.png'); /// File path: assets/images/elements/mobile/water/charge_front.png AssetGenImage get chargeFront => const AssetGenImage( 'assets/images/elements/mobile/water/charge_front.png'); /// File path: assets/images/elements/mobile/water/damage_receive.png AssetGenImage get damageReceive => const AssetGenImage( 'assets/images/elements/mobile/water/damage_receive.png'); /// File path: assets/images/elements/mobile/water/damage_send.png AssetGenImage get damageSend => const AssetGenImage( 'assets/images/elements/mobile/water/damage_send.png'); /// File path: assets/images/elements/mobile/water/victory_charge_back.png AssetGenImage get victoryChargeBack => const AssetGenImage( 'assets/images/elements/mobile/water/victory_charge_back.png'); /// File path: assets/images/elements/mobile/water/victory_charge_front.png AssetGenImage get victoryChargeFront => const AssetGenImage( 'assets/images/elements/mobile/water/victory_charge_front.png'); /// List of all assets List<AssetGenImage> get values => [ chargeBack, chargeFront, damageReceive, damageSend, victoryChargeBack, victoryChargeFront ]; } class Assets { Assets._(); static const $AssetsImagesGen images = $AssetsImagesGen(); } class AssetGenImage { const AssetGenImage(this._assetName); final String _assetName; Image image({ Key? key, AssetBundle? bundle, ImageFrameBuilder? frameBuilder, ImageErrorWidgetBuilder? errorBuilder, String? semanticLabel, bool excludeFromSemantics = false, double? scale, double? width, double? height, Color? color, Animation<double>? opacity, BlendMode? colorBlendMode, BoxFit? fit, AlignmentGeometry alignment = Alignment.center, ImageRepeat repeat = ImageRepeat.noRepeat, Rect? centerSlice, bool matchTextDirection = false, bool gaplessPlayback = false, bool isAntiAlias = false, String? package = 'io_flip_ui', FilterQuality filterQuality = FilterQuality.low, int? cacheWidth, int? cacheHeight, }) { return Image.asset( _assetName, key: key, bundle: bundle, frameBuilder: frameBuilder, errorBuilder: errorBuilder, semanticLabel: semanticLabel, excludeFromSemantics: excludeFromSemantics, scale: scale, width: width, height: height, color: color, opacity: opacity, colorBlendMode: colorBlendMode, fit: fit, alignment: alignment, repeat: repeat, centerSlice: centerSlice, matchTextDirection: matchTextDirection, gaplessPlayback: gaplessPlayback, isAntiAlias: isAntiAlias, package: package, filterQuality: filterQuality, cacheWidth: cacheWidth, cacheHeight: cacheHeight, ); } ImageProvider provider({ AssetBundle? bundle, String? package = 'io_flip_ui', }) { return AssetImage( _assetName, bundle: bundle, package: package, ); } String get path => _assetName; String get keyName => 'packages/io_flip_ui/$_assetName'; } class SvgGenImage { const SvgGenImage(this._assetName); final String _assetName; SvgPicture svg({ Key? key, bool matchTextDirection = false, AssetBundle? bundle, String? package = 'io_flip_ui', double? width, double? height, BoxFit fit = BoxFit.contain, AlignmentGeometry alignment = Alignment.center, bool allowDrawingOutsideViewBox = false, WidgetBuilder? placeholderBuilder, String? semanticsLabel, bool excludeFromSemantics = false, SvgTheme theme = const SvgTheme(), ColorFilter? colorFilter, Clip clipBehavior = Clip.hardEdge, @deprecated Color? color, @deprecated BlendMode colorBlendMode = BlendMode.srcIn, @deprecated bool cacheColorFilter = false, }) { return SvgPicture.asset( _assetName, key: key, matchTextDirection: matchTextDirection, bundle: bundle, package: package, width: width, height: height, fit: fit, alignment: alignment, allowDrawingOutsideViewBox: allowDrawingOutsideViewBox, placeholderBuilder: placeholderBuilder, semanticsLabel: semanticsLabel, excludeFromSemantics: excludeFromSemantics, theme: theme, colorFilter: colorFilter, color: color, colorBlendMode: colorBlendMode, clipBehavior: clipBehavior, cacheColorFilter: cacheColorFilter, ); } String get path => _assetName; String get keyName => 'packages/io_flip_ui/$_assetName'; }
io_flip/packages/io_flip_ui/lib/gen/assets.gen.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/lib/gen/assets.gen.dart", "repo_id": "io_flip", "token_count": 9546 }
928
import 'package:flutter/animation.dart'; /// {@template there_and_back_again} /// A [Tween] that runs the given tween forward and then backward. /// /// Also, A Hobbit's Tale. /// {@endtemplate} class ThereAndBackAgain<T> extends Tween<T> { /// {@macro there_and_back_again} ThereAndBackAgain(this._tween); final Tween<T> _tween; @override T? get begin => _tween.begin; @override T? get end => _tween.begin; @override T lerp(double t) { if (t < 0.5) { return _tween.lerp(t * 2); } else { return _tween.lerp(2 - t * 2); } } }
io_flip/packages/io_flip_ui/lib/src/animations/there_and_back_again.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/lib/src/animations/there_and_back_again.dart", "repo_id": "io_flip", "token_count": 239 }
929
import 'package:flame/cache.dart'; import 'package:flame/extensions.dart'; import 'package:flame/widgets.dart'; import 'package:flutter/material.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; import 'package:provider/provider.dart'; /// {@template charge_back} /// A widget that renders a [SpriteAnimation] for the charge effect in front /// of the card. /// {@endtemplate} class ChargeBack extends StatelessWidget { /// {@macro charge_back} const ChargeBack( this.path, { required this.size, required this.assetSize, required this.animationColor, super.key, this.onComplete, }); /// The size of the card. final GameCardSize size; /// Optional callback to be called when the animation is complete. final VoidCallback? onComplete; /// Path of the asset containing the sprite sheet. final String path; /// Size of the assets to use, large or small final AssetSize assetSize; /// The color of the animation, used on mobile animation. final Color animationColor; @override Widget build(BuildContext context) { final images = context.read<Images>(); final width = 1.64 * size.width; final height = 1.53 * size.height; if (assetSize == AssetSize.large) { final textureSize = Vector2(658, 860); return SizedBox( width: width, height: height, child: FittedBox( fit: BoxFit.fill, child: SizedBox( width: textureSize.x, height: textureSize.y, child: SpriteAnimationWidget.asset( path: path, images: images, anchor: Anchor.center, onComplete: onComplete, data: SpriteAnimationData.sequenced( amount: 20, amountPerRow: 5, textureSize: textureSize, stepTime: 0.04, loop: false, ), ), ), ), ); } else { return _MobileAnimation( onComplete: onComplete, animationColor: animationColor, cardSize: size, width: width, height: height, ); } } } class _MobileAnimation extends StatefulWidget { const _MobileAnimation({ required this.onComplete, required this.animationColor, required this.cardSize, required this.width, required this.height, }); final VoidCallback? onComplete; final Color animationColor; final GameCardSize cardSize; final double width; final double height; @override State<_MobileAnimation> createState() => _MobileAnimationState(); } class _MobileAnimationState extends State<_MobileAnimation> { var _scale = 0.0; var _step = 0; @override void initState() { super.initState(); WidgetsBinding.instance.addPostFrameCallback((_) { setState(() { _scale = 1.2; }); }); } void _onComplete() { if (_step == 0) { setState(() { _scale = 1; _step = 1; }); } else if (_step == 1) { setState(() { _scale = 0; _step = 2; }); } else { widget.onComplete?.call(); } } @override Widget build(BuildContext context) { return Align( alignment: const Alignment(0, -.5), child: AnimatedContainer( curve: Curves.easeOutQuad, duration: const Duration(milliseconds: 400), width: widget.cardSize.width * _scale, height: widget.cardSize.height * _scale, decoration: BoxDecoration( color: widget.animationColor, borderRadius: BorderRadius.circular(widget.cardSize.width / 2), boxShadow: [ BoxShadow( color: widget.animationColor, blurRadius: 22 * _scale, spreadRadius: 22 * _scale, ), ], ), onEnd: _onComplete, ), ); } }
io_flip/packages/io_flip_ui/lib/src/widgets/damages/charge_back.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/lib/src/widgets/damages/charge_back.dart", "repo_id": "io_flip", "token_count": 1660 }
930
import 'package:flutter/widgets.dart'; import 'package:io_flip_ui/gen/assets.gen.dart'; /// {@template io_flip_logo} /// IO Flip main logo. /// {@endtemplate} class IoFlipLogo extends StatelessWidget { /// {@macro io_flip_logo} IoFlipLogo({ this.width, this.height, super.key, }) : _svg = Assets.images.ioFlipLogo; /// White version of the IO Flip logo. IoFlipLogo.white({ this.width, this.height, super.key, }) : _svg = Assets.images.ioFlipLogo03; /// The width to use for the logo. final double? width; /// The height to use for the logo. final double? height; final SvgGenImage _svg; @override Widget build(BuildContext context) { return _svg.svg( width: width, height: height, ); } }
io_flip/packages/io_flip_ui/lib/src/widgets/io_flip_logo.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/lib/src/widgets/io_flip_logo.dart", "repo_id": "io_flip", "token_count": 309 }
931
// ignore_for_file: prefer_const_constructors import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; import 'package:mocktail/mocktail.dart'; class _MockDeviceInfoPlugin extends Mock implements DeviceInfoPlugin {} class _MockWebBrowserInfo extends Mock implements WebBrowserInfo {} void main() { group('platformAwareAsset', () { test('returns desktop by default', () { final result = platformAwareAsset( desktop: 'desktop', mobile: 'mobile', isWeb: false, ); expect(result, equals('desktop')); }); test('returns mobile when web and is iOS', () { final result = platformAwareAsset( desktop: 'desktop', mobile: 'mobile', isWeb: true, overrideDefaultTargetPlatform: TargetPlatform.iOS, ); expect(result, 'mobile'); }); test('returns mobile when web and is Android', () { final result = platformAwareAsset( desktop: 'desktop', mobile: 'mobile', isWeb: true, overrideDefaultTargetPlatform: TargetPlatform.android, ); expect(result, 'mobile'); }); }); group('deviceInfoAwareAsset', () { late DeviceInfoPlugin deviceInfoPlugin; late WebBrowserInfo webBrowserInfo; const safariUA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1'; const androidSamsungUA = 'Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36'; const androidPixelUA = 'Mozilla/5.0 (Linux; Android 13; Pixel 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Mobile Safari/537.36'; setUp(() { deviceInfoPlugin = _MockDeviceInfoPlugin(); webBrowserInfo = _MockWebBrowserInfo(); when(() => deviceInfoPlugin.webBrowserInfo) .thenAnswer((_) async => webBrowserInfo); when(() => webBrowserInfo.userAgent).thenReturn(androidSamsungUA); }); test('return the asset when the predicate is true', () async { final result = await deviceInfoAwareAsset( predicate: (_) => true, asset: () => 'A', orElse: () => 'B', overrideDeviceInfoPlugin: deviceInfoPlugin, overrideDefaultTargetPlatform: TargetPlatform.android, ); expect(result, equals('A')); }); test( 'return the asset when the predicate is true and platform default', () async { final result = await deviceInfoAwareAsset( predicate: (_) => true, asset: () => 'A', orElse: () => 'B', overrideDeviceInfoPlugin: deviceInfoPlugin, ); expect(result, equals('A')); }, ); test( 'return orElse when the predicate is true and platform default', () async { final result = await deviceInfoAwareAsset( predicate: (_) => true, asset: () => 'A', orElse: () => 'B', overrideDefaultTargetPlatform: TargetPlatform.macOS, ); expect(result, equals('B')); }, ); test('return the orElse when the predicate is false', () async { final result = await deviceInfoAwareAsset( predicate: (_) => false, asset: () => 'A', orElse: () => 'B', overrideDeviceInfoPlugin: deviceInfoPlugin, overrideDefaultTargetPlatform: TargetPlatform.android, ); expect(result, equals('B')); }); test('return the orElse when the parsing of the UA fails', () async { when(() => webBrowserInfo.userAgent).thenReturn('invalid'); final result = await deviceInfoAwareAsset( predicate: (_) => true, asset: () => 'A', orElse: () => 'B', overrideDeviceInfoPlugin: deviceInfoPlugin, overrideDefaultTargetPlatform: TargetPlatform.android, ); expect(result, equals('B')); }); test('return the orElse when is not mobile', () async { final result = await deviceInfoAwareAsset( predicate: (_) => true, asset: () => 'A', orElse: () => 'B', overrideDeviceInfoPlugin: deviceInfoPlugin, overrideDefaultTargetPlatform: TargetPlatform.linux, ); expect(result, equals('B')); }); test('parses a samsung android UA', () async { final result = await deviceInfoAwareAsset( predicate: (info) => info.osVersion == 12, asset: () => 'A', orElse: () => 'B', overrideDeviceInfoPlugin: deviceInfoPlugin, overrideDefaultTargetPlatform: TargetPlatform.android, ); expect(result, equals('A')); }); test('parses a pixel android UA', () async { when(() => webBrowserInfo.userAgent).thenReturn(androidPixelUA); final result = await deviceInfoAwareAsset( predicate: (info) => info.osVersion == 13, asset: () => 'A', orElse: () => 'B', overrideDeviceInfoPlugin: deviceInfoPlugin, overrideDefaultTargetPlatform: TargetPlatform.android, ); expect(result, equals('A')); }); test('parses an android UA', () async { when(() => webBrowserInfo.userAgent).thenReturn(safariUA); final result = await deviceInfoAwareAsset( predicate: (info) => info.osVersion == 13, asset: () => 'A', orElse: () => 'B', overrideDeviceInfoPlugin: deviceInfoPlugin, overrideDefaultTargetPlatform: TargetPlatform.iOS, ); expect(result, equals('A')); }); group('DeviceInfo', () { test('can be instantiated', () { expect( DeviceInfo(osVersion: 1, platform: TargetPlatform.android), isNotNull, ); }); test('supports equality', () { expect( DeviceInfo(osVersion: 1, platform: TargetPlatform.android), equals( DeviceInfo(osVersion: 1, platform: TargetPlatform.android), ), ); expect( DeviceInfo(osVersion: 1, platform: TargetPlatform.android), isNot( equals( DeviceInfo(osVersion: 2, platform: TargetPlatform.android), ), ), ); expect( DeviceInfo(osVersion: 1, platform: TargetPlatform.android), isNot( equals( DeviceInfo(osVersion: 1, platform: TargetPlatform.iOS), ), ), ); }); }); group('isOlderAndroid', () { test('isTrue when version is lower than 11', () { expect( isOlderAndroid( DeviceInfo(osVersion: 10, platform: TargetPlatform.android), ), isTrue, ); }); test('isTrue when version is 11', () { expect( isOlderAndroid( DeviceInfo(osVersion: 11, platform: TargetPlatform.android), ), isTrue, ); }); test('isFalse when version is bigger than 11', () { expect( isOlderAndroid( DeviceInfo(osVersion: 12, platform: TargetPlatform.android), ), isFalse, ); }); test('isFalse when version is not android', () { expect( isOlderAndroid( DeviceInfo(osVersion: 11, platform: TargetPlatform.iOS), ), isFalse, ); }); }); group('isAndroid', () { test('isTrue when is android', () { expect( isAndroid( DeviceInfo(osVersion: 10, platform: TargetPlatform.android), ), isTrue, ); }); test('isFalse when version is not android', () { expect( isAndroid( DeviceInfo(osVersion: 11, platform: TargetPlatform.iOS), ), isFalse, ); }); }); }); }
io_flip/packages/io_flip_ui/test/src/utils_test.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/test/src/utils_test.dart", "repo_id": "io_flip", "token_count": 3416 }
932
// ignore_for_file: prefer_const_constructors import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; import 'package:mocktail_image_network/mocktail_image_network.dart'; import '../../helpers/mock_failed_network_image.dart'; void main() { group('GameCard', () { for (final suitName in ['fire', 'air', 'earth', 'water', 'metal']) { group('when is a $suitName card', () { testWidgets('renders correctly', (tester) async { await tester.pumpWidget( mockNetworkImages( () => Directionality( textDirection: TextDirection.ltr, child: GameCard( image: 'image', name: 'name', description: 'description', suitName: suitName, power: 1, isRare: false, ), ), ), ); expect( find.text('name'), findsOneWidget, ); expect( find.byWidgetPredicate( (widget) { if (widget is Image && widget.image is AssetImage) { final assetImage = widget.image as AssetImage; return assetImage.assetName == 'packages/io_flip_ui/assets/images/card_frames/card_$suitName.png'; } return false; }, ), findsOneWidget, ); expect( find.text('1'), findsNWidgets(2), // Two texts are stacked to draw the border. ); }); }); } for (final suitName in ['fire', 'air', 'earth', 'water', 'metal']) { group('when is a $suitName rare card', () { testWidgets('renders holo correctly', (tester) async { await tester.pumpWidget( mockNetworkImages( () => Directionality( textDirection: TextDirection.ltr, child: GameCard( package: null, image: 'image', name: 'name', description: 'description', suitName: suitName, power: 1, isRare: true, ), ), ), ); expect( find.text('name'), findsOneWidget, ); expect( find.byWidgetPredicate( (widget) { if (widget is Image && widget.image is AssetImage) { final assetImage = widget.image as AssetImage; return assetImage.assetName == 'packages/io_flip_ui/assets/images/card_frames/holos/card_$suitName.png'; } return false; }, ), findsOneWidget, ); expect( find.text('1'), findsNWidgets(2), // Two texts are stacked to draw the border. ); }); }); } testWidgets( 'renders IO flip game as a placeholder when loading fails', (tester) async { await tester.pumpWidget( mockFailedNetworkImages( () => Directionality( textDirection: TextDirection.ltr, child: GameCard( image: 'image', name: 'name', description: 'description', suitName: 'air', power: 1, isRare: false, ), ), ), ); await tester.pump(); expect(find.byType(IoFlipLogo), findsOneWidget); }, ); testWidgets('breaks when rendering an unknown suit', (tester) async { await tester.pumpWidget( mockNetworkImages( () => const Directionality( textDirection: TextDirection.ltr, child: GameCard( image: 'image', name: 'name', description: 'description', suitName: '', power: 1, isRare: false, ), ), ), ); expect(tester.takeException(), isArgumentError); }); testWidgets('renders an overlay', (tester) async { await tester.pumpWidget( mockNetworkImages( () => const Directionality( textDirection: TextDirection.ltr, child: GameCard( image: 'image', name: 'name', description: 'description', suitName: 'air', power: 1, overlay: CardOverlayType.win, isRare: false, ), ), ), ); expect(find.byType(CardOverlay), findsOneWidget); }); testWidgets('renders FoilShader when card is rare', (tester) async { await tester.pumpWidget( mockNetworkImages( () => const Directionality( textDirection: TextDirection.ltr, child: GameCard( package: null, image: 'image', name: 'name', description: 'description', suitName: 'earth', power: 1, isRare: true, ), ), ), ); expect(find.byType(FoilShader), findsOneWidget); }); testWidgets( "don't render shader if on mobile even if " 'is rare', (tester) async { await tester.pumpWidget( mockNetworkImages( () => Directionality( textDirection: TextDirection.ltr, child: GameCard( package: null, image: 'image', name: 'name', description: 'description', suitName: 'earth', power: 1, isRare: true, overridePlatformAwareAsset: ({ required bool desktop, required bool mobile, bool isWeb = true, TargetPlatform? overrideDefaultTargetPlatform, }) => mobile, ), ), ), ); expect(find.byType(FoilShader), findsNothing); }); }); group('GameCardSize', () { test('can be instantiated', () { expect(GameCardSize.xxs(), isNotNull); expect(GameCardSize.xs(), isNotNull); expect(GameCardSize.sm(), isNotNull); expect(GameCardSize.md(), isNotNull); expect(GameCardSize.lg(), isNotNull); expect(GameCardSize.xl(), isNotNull); expect(GameCardSize.xxl(), isNotNull); }); group('lerp', () { const a = GameCardSize.xs(); const b = GameCardSize.lg(); test('with t = 0', () { final result = GameCardSize.lerp(a, b, 0); expect(result, a); }); test('with t = 1', () { final result = GameCardSize.lerp(a, b, 1); expect(result, b); }); for (var i = 1; i < 10; i += 1) { final t = i / 10; test('with t = $t', () { final result = GameCardSize.lerp(a, b, t)!; expect(result.size, equals(Size.lerp(a.size, b.size, t))); expect( result.imageInset, equals(RelativeRect.lerp(a.imageInset, b.imageInset, t)), ); expect( result.badgeSize, equals(Size.lerp(a.badgeSize, b.badgeSize, t)), ); expect( result.titleTextStyle, equals( TextStyle.lerp( a.titleTextStyle, b.titleTextStyle, t, ), ), ); expect( result.descriptionTextStyle, equals( TextStyle.lerp( a.descriptionTextStyle, b.descriptionTextStyle, t, ), ), ); expect( result.powerTextStyle, equals( TextStyle.lerp( a.powerTextStyle, b.powerTextStyle, t, ), ), ); expect( result.powerTextStrokeWidth, equals( lerpDouble(a.powerTextStrokeWidth, b.powerTextStrokeWidth, t), ), ); }); } }); }); }
io_flip/packages/io_flip_ui/test/src/widgets/game_card_test.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/test/src/widgets/game_card_test.dart", "repo_id": "io_flip", "token_count": 4674 }
933
/// Repository for match making. library match_maker_repository; export 'src/match_maker_repository.dart'; export 'src/models/models.dart';
io_flip/packages/match_maker_repository/lib/match_maker_repository.dart/0
{ "file_path": "io_flip/packages/match_maker_repository/lib/match_maker_repository.dart", "repo_id": "io_flip", "token_count": 47 }
934
// ignore_for_file: prefer_const_constructors import 'package:api_client/api_client.dart'; import 'package:authentication_repository/authentication_repository.dart'; import 'package:bloc_test/bloc_test.dart'; import 'package:config_repository/config_repository.dart'; import 'package:connection_repository/connection_repository.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:game_domain/game_domain.dart'; import 'package:game_script_machine/game_script_machine.dart'; import 'package:io_flip/app/app.dart'; import 'package:io_flip/audio/audio_controller.dart'; import 'package:io_flip/connection/connection.dart'; import 'package:io_flip/gen/assets.gen.dart'; import 'package:io_flip/how_to_play/how_to_play.dart'; import 'package:io_flip/info/info.dart'; import 'package:io_flip/main_menu/main_menu_screen.dart'; import 'package:io_flip/prompt/prompt.dart'; import 'package:io_flip/settings/persistence/persistence.dart'; import 'package:io_flip/settings/settings.dart'; import 'package:io_flip/style/snack_bar.dart'; import 'package:io_flip/terms_of_use/terms_of_use.dart'; import 'package:match_maker_repository/match_maker_repository.dart'; import 'package:mocktail/mocktail.dart'; import '../../helpers/helpers.dart'; class _MockBuildContext extends Mock implements BuildContext {} class _MockAudioController extends Mock implements AudioController {} class _MockSettingsController extends Mock implements SettingsController {} class _MockLifecycleNotifier extends Mock implements ValueNotifier<AppLifecycleState> {} class _MockApiClient extends Mock implements ApiClient {} class _MockGameResource extends Mock implements GameResource {} class _MockShareResource extends Mock implements ShareResource {} class _MockScriptsResource extends Mock implements ScriptsResource {} class _MockPromptResource extends Mock implements PromptResource {} class _MockLeaderboardResource extends Mock implements LeaderboardResource {} class _MockMatchMakerRepository extends Mock implements MatchMakerRepository {} class _MockConfigRepository extends Mock implements ConfigRepository {} class _MockConnectionRepository extends Mock implements ConnectionRepository { _MockConnectionRepository() { when(connect).thenAnswer((_) async {}); when(() => messages).thenAnswer((_) => const Stream.empty()); } } class _MockTermsOfUseCubit extends MockCubit<bool> implements TermsOfUseCubit {} class _MockMatchSolver extends Mock implements MatchSolver {} class _MockGameScriptEngine extends Mock implements GameScriptMachine {} class _MockUser extends Mock implements User {} void main() { TestWidgetsFlutterBinding.ensureInitialized(); setUpAll(() { registerFallbackValue(PromptTermType.characterClass); }); group('App', () { late ApiClient apiClient; setUp(() { apiClient = _MockApiClient(); when(() => apiClient.gameResource).thenReturn(_MockGameResource()); when(() => apiClient.shareResource).thenReturn(_MockShareResource()); final promptResource = _MockPromptResource(); when(() => promptResource.getPromptTerms(any())) .thenAnswer((_) async => Future.value([''])); when(() => apiClient.promptResource).thenReturn(promptResource); when(() => apiClient.scriptsResource).thenReturn(_MockScriptsResource()); when(() => apiClient.leaderboardResource) .thenReturn(_MockLeaderboardResource()); }); testWidgets('can show a snackbar', (tester) async { await tester.pumpWidget( App( settingsPersistence: MemoryOnlySettingsPersistence(), apiClient: apiClient, matchMakerRepository: _MockMatchMakerRepository(), configRepository: _MockConfigRepository(), connectionRepository: _MockConnectionRepository(), matchSolver: _MockMatchSolver(), gameScriptMachine: _MockGameScriptEngine(), user: _MockUser(), isScriptsEnabled: true, ), ); showSnackBar('SnackBar'); await tester.pumpAndSettle(); expect(find.text('SnackBar'), findsOneWidget); }); testWidgets('wraps everything in a ConnectionOverlay', (tester) async { await tester.pumpWidget( App( settingsPersistence: MemoryOnlySettingsPersistence(), apiClient: apiClient, matchMakerRepository: _MockMatchMakerRepository(), configRepository: _MockConfigRepository(), connectionRepository: _MockConnectionRepository(), matchSolver: _MockMatchSolver(), gameScriptMachine: _MockGameScriptEngine(), user: _MockUser(), isScriptsEnabled: true, ), ); expect(find.byType(ConnectionOverlay), findsOneWidget); }); group('updateAudioController', () { setUpAll(() { registerFallbackValue(_MockSettingsController()); registerFallbackValue(_MockLifecycleNotifier()); }); test('initializes, attach to setting and lifecycle', () { final buildContext = _MockBuildContext(); final settingsController = _MockSettingsController(); final lifecycle = _MockLifecycleNotifier(); final audioController = _MockAudioController(); when(audioController.initialize).thenAnswer((_) async {}); when(() => audioController.attachSettings(any())).thenAnswer((_) {}); when(() => audioController.attachLifecycleNotifier(any())) .thenAnswer((_) {}); final result = updateAudioController( buildContext, settingsController, lifecycle, audioController, ); verify(() => audioController.attachSettings(any())).called(1); verify(() => audioController.attachLifecycleNotifier(any())).called(1); expect(result, audioController); }); test('returns a new instance when audio controller is null', () { final buildContext = _MockBuildContext(); final audioController = _MockAudioController(); when(audioController.initialize).thenAnswer((_) async {}); when(() => audioController.attachSettings(any())).thenAnswer((_) {}); when(() => audioController.attachLifecycleNotifier(any())) .thenAnswer((_) {}); final result = updateAudioController( buildContext, SettingsController(persistence: MemoryOnlySettingsPersistence()), ValueNotifier(AppLifecycleState.paused), null, createAudioController: () => audioController, ); verify(() => audioController.attachSettings(any())).called(1); verify(() => audioController.attachLifecycleNotifier(any())).called(1); expect(result, audioController); }); }); testWidgets('renders the app', (tester) async { tester.setLandscapeDisplaySize(); await tester.pumpWidget( App( settingsPersistence: MemoryOnlySettingsPersistence(), apiClient: apiClient, matchMakerRepository: _MockMatchMakerRepository(), configRepository: _MockConfigRepository(), connectionRepository: _MockConnectionRepository(), matchSolver: _MockMatchSolver(), gameScriptMachine: _MockGameScriptEngine(), user: _MockUser(), isScriptsEnabled: true, ), ); expect(find.byType(MainMenuScreen), findsOneWidget); }); testWidgets( 'shows terms of use dialog when terms have not been accepted', (tester) async { final mockCubit = _MockTermsOfUseCubit(); when(() => mockCubit.state).thenReturn(false); await tester.pumpWidget( App( settingsPersistence: MemoryOnlySettingsPersistence(), apiClient: apiClient, matchMakerRepository: _MockMatchMakerRepository(), configRepository: _MockConfigRepository(), connectionRepository: _MockConnectionRepository(), matchSolver: _MockMatchSolver(), gameScriptMachine: _MockGameScriptEngine(), user: _MockUser(), termsOfUseCubit: mockCubit, isScriptsEnabled: true, ), ); await tester.tap(find.text(tester.l10n.play)); await tester.pumpAndSettle(); expect(find.byType(TermsOfUseView), findsOneWidget); }, ); testWidgets( 'navigates to the prompt page when TermsOfUseCubit state changes ' 'from false to true', (tester) async { final mockCubit = _MockTermsOfUseCubit(); whenListen( mockCubit, Stream.fromIterable([false, true]), initialState: false, ); await tester.pumpWidget( App( settingsPersistence: MemoryOnlySettingsPersistence(), apiClient: apiClient, matchMakerRepository: _MockMatchMakerRepository(), configRepository: _MockConfigRepository(), connectionRepository: _MockConnectionRepository(), matchSolver: _MockMatchSolver(), gameScriptMachine: _MockGameScriptEngine(), user: _MockUser(), termsOfUseCubit: mockCubit, isScriptsEnabled: true, ), ); await tester.pumpAndSettle(); expect(find.byType(PromptPage), findsOneWidget); }, ); testWidgets( 'navigates to the prompt page when terms are accepted', (tester) async { final mockCubit = _MockTermsOfUseCubit(); when(() => mockCubit.state).thenReturn(true); await tester.pumpWidget( App( settingsPersistence: MemoryOnlySettingsPersistence(), apiClient: apiClient, matchMakerRepository: _MockMatchMakerRepository(), configRepository: _MockConfigRepository(), connectionRepository: _MockConnectionRepository(), matchSolver: _MockMatchSolver(), gameScriptMachine: _MockGameScriptEngine(), user: _MockUser(), termsOfUseCubit: mockCubit, isScriptsEnabled: true, ), ); await tester.tap(find.text(tester.l10n.play)); await tester.pumpAndSettle(); expect(find.byType(PromptPage), findsOneWidget); }, ); testWidgets('renders info button', (tester) async { await tester.pumpWidget( App( settingsPersistence: MemoryOnlySettingsPersistence(), apiClient: apiClient, matchMakerRepository: _MockMatchMakerRepository(), configRepository: _MockConfigRepository(), connectionRepository: _MockConnectionRepository(), matchSolver: _MockMatchSolver(), gameScriptMachine: _MockGameScriptEngine(), user: _MockUser(), isScriptsEnabled: true, ), ); expect(find.byType(InfoButton), findsOneWidget); }); testWidgets('can navigate to the how to play page', (tester) async { await tester.pumpWidget( App( settingsPersistence: MemoryOnlySettingsPersistence(), apiClient: apiClient, matchMakerRepository: _MockMatchMakerRepository(), configRepository: _MockConfigRepository(), connectionRepository: _MockConnectionRepository(), matchSolver: _MockMatchSolver(), gameScriptMachine: _MockGameScriptEngine(), user: _MockUser(), isScriptsEnabled: true, ), ); await tester.tap(find.byIcon(Icons.question_mark_rounded)); await tester.pumpAndSettle(); expect(find.byType(HowToPlayDialog), findsOneWidget); }); testWidgets('plays a button click when a button is played', (tester) async { final audioController = _MockAudioController(); when(audioController.initialize).thenAnswer((_) async {}); when(() => audioController.playSfx(any())).thenAnswer((_) async {}); await tester.pumpWidget( App( settingsPersistence: MemoryOnlySettingsPersistence(), apiClient: apiClient, matchMakerRepository: _MockMatchMakerRepository(), configRepository: _MockConfigRepository(), connectionRepository: _MockConnectionRepository(), matchSolver: _MockMatchSolver(), gameScriptMachine: _MockGameScriptEngine(), audioController: audioController, user: _MockUser(), isScriptsEnabled: true, ), ); await tester.tap(find.text(tester.l10n.play)); await tester.pumpAndSettle(); verify(() => audioController.playSfx(Assets.sfx.click)).called(1); }); testWidgets('shows info popup', (tester) async { final audioController = _MockAudioController(); when(audioController.initialize).thenAnswer((_) async {}); when(() => audioController.playSfx(any())).thenAnswer((_) async {}); await tester.pumpWidget( App( settingsPersistence: MemoryOnlySettingsPersistence(), apiClient: apiClient, matchMakerRepository: _MockMatchMakerRepository(), configRepository: _MockConfigRepository(), connectionRepository: _MockConnectionRepository(), matchSolver: _MockMatchSolver(), gameScriptMachine: _MockGameScriptEngine(), audioController: audioController, user: _MockUser(), isScriptsEnabled: true, ), ); await tester.tap(find.byKey(Key('info_button'))); await tester.pumpAndSettle(); verify(() => audioController.playSfx(Assets.sfx.click)).called(1); expect(find.byType(InfoView), findsOneWidget); }); }); }
io_flip/test/app/view/app_test.dart/0
{ "file_path": "io_flip/test/app/view/app_test.dart", "repo_id": "io_flip", "token_count": 5423 }
935
// ignore_for_file: prefer_const_constructors import 'package:flutter_test/flutter_test.dart'; import 'package:game_domain/game_domain.dart'; import 'package:io_flip/game/game.dart'; void main() { const deck = Deck(id: 'id', userId: 'userId', cards: []); group('MatchLoadingState', () { test('can be instantiated', () { expect(MatchLoadingState(), isNotNull); }); test('supports equality', () { expect( MatchLoadingState(), equals(MatchLoadingState()), ); }); }); group('MatchLoadFailedState', () { test('can be instantiated', () { expect(MatchLoadFailedState(deck: deck), isNotNull); }); test('supports equality', () { expect( MatchLoadFailedState(deck: deck), equals(MatchLoadFailedState(deck: deck)), ); expect( MatchLoadFailedState(deck: deck), isNot( equals( MatchLoadFailedState( deck: Deck(id: '', userId: '', cards: const []), ), ), ), ); }); }); group('MatchLoadedState', () { final match1 = Match( id: 'match1', hostDeck: Deck(id: '', userId: '', cards: const []), guestDeck: Deck(id: '', userId: '', cards: const []), ); final match2 = Match( id: 'match2', hostDeck: Deck(id: '', userId: '', cards: const []), guestDeck: Deck(id: '', userId: '', cards: const []), ); final matchState1 = MatchState( id: 'matchState1', matchId: match1.id, hostPlayedCards: const [], guestPlayedCards: const [], ); final matchState2 = MatchState( id: 'matchState2', matchId: match2.id, hostPlayedCards: const [], guestPlayedCards: const [], ); test('can be instantiated', () { expect( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: false, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ), isNotNull, ); }); test('supports equality', () { expect( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: false, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ), equals( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: false, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ), ), ); expect( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: false, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ), isNot( equals( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match2, matchState: matchState1, rounds: const [], turnAnimationsFinished: false, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ), ), ), ); expect( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: false, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ), isNot( equals( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState2, rounds: const [], turnAnimationsFinished: false, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ), ), ), ); expect( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: false, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ), isNot( equals( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [ MatchRound( opponentCardId: '', playerCardId: '', ), ], turnAnimationsFinished: false, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ), ), ), ); expect( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: false, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ), isNot( equals( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: true, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ), ), ), ); expect( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: false, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ), isNot( equals( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: false, turnTimeRemaining: 9, isClashScene: false, showCardLanding: false, ), ), ), ); }); test('copyWith returns a new instance with the copied values', () { expect( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: true, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ).copyWith(match: match2), equals( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match2, matchState: matchState1, rounds: const [], turnAnimationsFinished: true, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ), ), ); expect( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: true, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ).copyWith(matchState: matchState2), equals( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState2, rounds: const [], turnAnimationsFinished: true, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ), ), ); expect( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: true, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ).copyWith(rounds: [MatchRound(playerCardId: '', opponentCardId: '')]), equals( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [MatchRound(playerCardId: '', opponentCardId: '')], turnAnimationsFinished: true, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ), ), ); expect( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: true, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ).copyWith(turnAnimationsFinished: false), equals( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: false, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ), ), ); expect( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: true, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ).copyWith(turnTimeRemaining: 9), equals( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: true, turnTimeRemaining: 9, isClashScene: false, showCardLanding: false, ), ), ); expect( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: true, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ).copyWith(isClashScene: true), equals( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: true, turnTimeRemaining: 10, isClashScene: true, showCardLanding: false, ), ), ); expect( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: true, turnTimeRemaining: 10, isClashScene: false, showCardLanding: false, ).copyWith(showCardLanding: true), equals( MatchLoadedState( playerScoreCard: ScoreCard(id: 'scoreCardId'), match: match1, matchState: matchState1, rounds: const [], turnAnimationsFinished: true, turnTimeRemaining: 10, isClashScene: false, showCardLanding: true, ), ), ); }); }); group('MatchRound', () { test('can be instantiated', () { expect( MatchRound(playerCardId: null, opponentCardId: null), isNotNull, ); }); test('supports equality', () { expect( MatchRound(playerCardId: null, opponentCardId: null), equals(MatchRound(playerCardId: null, opponentCardId: null)), ); expect( MatchRound(playerCardId: null, opponentCardId: null), equals( isNot( MatchRound(playerCardId: '1', opponentCardId: null), ), ), ); expect( MatchRound(playerCardId: null, opponentCardId: null), equals( isNot( MatchRound(playerCardId: null, opponentCardId: '1'), ), ), ); }); test('copyWith returns a new instance with the copied values', () { expect( MatchRound( playerCardId: 'player', opponentCardId: 'opponent', ).copyWith(), equals( MatchRound( playerCardId: 'player', opponentCardId: 'opponent', ), ), ); expect( MatchRound( playerCardId: 'player', opponentCardId: 'opponent', ).copyWith(playerCardId: ''), equals( MatchRound( playerCardId: '', opponentCardId: 'opponent', ), ), ); expect( MatchRound( playerCardId: 'player', opponentCardId: 'opponent', ).copyWith(opponentCardId: ''), equals( MatchRound( playerCardId: 'player', opponentCardId: '', ), ), ); expect( MatchRound( playerCardId: 'player', opponentCardId: 'opponent', ).copyWith(showCardsOverlay: true), equals( MatchRound( playerCardId: 'player', opponentCardId: 'opponent', showCardsOverlay: true, ), ), ); }); }); group('LeaderboardEntryState', () { test('can be instantiated', () { expect( LeaderboardEntryState('scoreCardId'), isNotNull, ); }); test('supports equality', () { expect( LeaderboardEntryState('scoreCardId'), equals(LeaderboardEntryState('scoreCardId')), ); expect( LeaderboardEntryState('scoreCardId'), equals( isNot( LeaderboardEntryState('scoreCardId2'), ), ), ); }); }); group('OpponentAbsentState', () { test('can be instantiated', () { expect(OpponentAbsentState(deck: deck), isNotNull); }); test('supports equality', () { expect( OpponentAbsentState(deck: deck), equals(OpponentAbsentState(deck: deck)), ); expect( OpponentAbsentState(deck: deck), isNot( equals( OpponentAbsentState( deck: Deck(id: '', userId: '', cards: const []), ), ), ), ); }); }); group('CheckOpponentPresenceFailedState', () { test('can be instantiated', () { expect(ManagePlayerPresenceFailedState(), isNotNull); }); test('supports equality', () { expect( ManagePlayerPresenceFailedState(), equals(ManagePlayerPresenceFailedState()), ); }); }); }
io_flip/test/game/bloc/game_state_test.dart/0
{ "file_path": "io_flip/test/game/bloc/game_state_test.dart", "repo_id": "io_flip", "token_count": 8056 }
936
// ignore_for_file: prefer_const_constructors import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:io_flip/how_to_play/how_to_play.dart'; import '../../helpers/pump_app.dart'; void main() { group('HowToPlayDialog', () { testWidgets('renders a HowToPlayView', (tester) async { await tester.pumpApp(Scaffold(body: HowToPlayDialog())); expect(find.byType(HowToPlayView), findsOneWidget); }); }); }
io_flip/test/how_to_play/view/how_to_play_dialog_test.dart/0
{ "file_path": "io_flip/test/how_to_play/view/how_to_play_dialog_test.dart", "repo_id": "io_flip", "token_count": 186 }
937
// ignore_for_file: prefer_const_constructors import 'package:flutter_test/flutter_test.dart'; import 'package:io_flip/match_making/match_making.dart'; import 'package:match_maker_repository/match_maker_repository.dart'; void main() { group('MatchMakingState', () { test('can be instantiated', () { expect( MatchMakingState( status: MatchMakingStatus.initial, match: DraftMatch( id: '', host: '', ), ), isNotNull, ); }); test('has the correct initial value', () { expect( MatchMakingState.initial(), equals( MatchMakingState( status: MatchMakingStatus.initial, ), ), ); }); test('supports equality', () { expect( MatchMakingState( status: MatchMakingStatus.initial, match: DraftMatch( id: '', host: '', ), ), equals( MatchMakingState( status: MatchMakingStatus.initial, match: DraftMatch( id: '', host: '', ), ), ), ); expect( MatchMakingState( status: MatchMakingStatus.failed, match: DraftMatch( id: '', host: '', ), ), isNot( equals( MatchMakingState( status: MatchMakingStatus.initial, match: DraftMatch( id: '', host: '', ), ), ), ), ); expect( MatchMakingState( status: MatchMakingStatus.initial, match: DraftMatch( id: '1', host: '', ), ), isNot( equals( MatchMakingState( status: MatchMakingStatus.initial, match: DraftMatch( id: '', host: '', ), ), ), ), ); }); test('copyWith returns new instance with the new value', () { expect( MatchMakingState( status: MatchMakingStatus.initial, match: DraftMatch( id: '', host: '', ), ).copyWith(status: MatchMakingStatus.failed), equals( MatchMakingState( status: MatchMakingStatus.failed, match: DraftMatch( id: '', host: '', ), ), ), ); expect( MatchMakingState( status: MatchMakingStatus.initial, match: DraftMatch( id: '', host: '', ), ).copyWith( match: DraftMatch( id: '1', host: '', ), ), equals( MatchMakingState( status: MatchMakingStatus.initial, match: DraftMatch( id: '1', host: '', ), ), ), ); }); }); }
io_flip/test/match_making/bloc/match_making_state_test.dart/0
{ "file_path": "io_flip/test/match_making/bloc/match_making_state_test.dart", "repo_id": "io_flip", "token_count": 1763 }
938