text
stringlengths
6
13.6M
id
stringlengths
13
176
metadata
dict
__index_level_0__
int64
0
1.69k
This directory contains templates for `flutter create`. The `*_shared` subdirectories provide files for multiple templates. * `app_shared` for `app` and `skeleton`. * `plugin_shared` for (method channel) `plugin` and `plugin_ffi`. For example, there are two app templates: `app` (the counter app) and `skeleton` (the more advanced list view/detail view app). ```plain ┌────────────┐ │ app_shared │ └──┬──────┬──┘ │ │ │ │ ▼ ▼ ┌─────┐ ┌──────────┐ │ app │ │ skeleton │ └─────┘ └──────────┘ ``` Thanks to `app_shared`, the templates for `app` and `skeleton` can contain only the files that are specific to them alone, and the rest is automatically kept in sync.
flutter/packages/flutter_tools/templates/README.md/0
{ "file_path": "flutter/packages/flutter_tools/templates/README.md", "repo_id": "flutter", "token_count": 264 }
751
// Generated file. Do not edit. buildscript { ext.kotlin_version = "{{kotlinVersion}}" repositories { google() mavenCentral() } dependencies { classpath("com.android.tools.build:gradle:{{agpVersionForModule}}") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") } } allprojects { repositories { google() mavenCentral() } } apply plugin: "com.android.library" apply plugin: "kotlin-android" android { // Conditional for compatibility with AGP <4.2. if (project.android.hasProperty("namespace")) { namespace = "{{androidIdentifier}}" } compileSdk = {{compileSdkVersion}} defaultConfig { minSdk = {{minSdkVersion}} } } dependencies { implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version") }
flutter/packages/flutter_tools/templates/module/android/gradle/build.gradle.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/module/android/gradle/build.gradle.tmpl", "repo_id": "flutter", "token_count": 359 }
752
// Generated file. Do not edit. rootProject.name = 'android_generated' setBinding(new Binding([gradle: this])) evaluate(new File(settingsDir, 'include_flutter.groovy'))
flutter/packages/flutter_tools/templates/module/android/library_new_embedding/settings.gradle.copy.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/module/android/library_new_embedding/settings.gradle.copy.tmpl", "repo_id": "flutter", "token_count": 55 }
753
// ignore_for_file: always_specify_types // ignore_for_file: camel_case_types // ignore_for_file: non_constant_identifier_names // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. import 'dart:ffi' as ffi; /// A very short-lived native function. /// /// For very short-lived functions, it is fine to call them on the main isolate. /// They will block the Dart execution while running the native function, so /// only do this for native functions which are guaranteed to be short-lived. @ffi.Native<ffi.IntPtr Function(ffi.IntPtr, ffi.IntPtr)>() external int sum( int a, int b, ); /// A longer lived native function, which occupies the thread calling it. /// /// Do not call these kind of native functions in the main isolate. They will /// block Dart execution. This will cause dropped frames in Flutter applications. /// Instead, call these native functions on a separate isolate. @ffi.Native<ffi.IntPtr Function(ffi.IntPtr, ffi.IntPtr)>() external int sum_long_running( int a, int b, );
flutter/packages/flutter_tools/templates/package_ffi/lib/projectName_bindings_generated.dart.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/package_ffi/lib/projectName_bindings_generated.dart.tmpl", "repo_id": "flutter", "token_count": 307 }
754
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="{{androidIdentifier}}"> </manifest>
flutter/packages/flutter_tools/templates/plugin/android.tmpl/src/main/AndroidManifest.xml.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/plugin/android.tmpl/src/main/AndroidManifest.xml.tmpl", "repo_id": "flutter", "token_count": 41 }
755
#include <flutter_linux/flutter_linux.h> #include <gmock/gmock.h> #include <gtest/gtest.h> #include "include/{{projectName}}/{{pluginClassSnakeCase}}.h" #include "{{pluginClassSnakeCase}}_private.h" // This demonstrates a simple unit test of the C portion of this plugin's // implementation. // // Once you have built the plugin's example app, you can run these tests // from the command line. For instance, for a plugin called my_plugin // built for x64 debug, run: // $ build/linux/x64/debug/plugins/my_plugin/my_plugin_test namespace {{projectName}} { namespace test { TEST({{pluginClass}}, GetPlatformVersion) { g_autoptr(FlMethodResponse) response = get_platform_version(); ASSERT_NE(response, nullptr); ASSERT_TRUE(FL_IS_METHOD_SUCCESS_RESPONSE(response)); FlValue* result = fl_method_success_response_get_result( FL_METHOD_SUCCESS_RESPONSE(response)); ASSERT_EQ(fl_value_get_type(result), FL_VALUE_TYPE_STRING); // The full string varies, so just validate that it has the right format. EXPECT_THAT(fl_value_get_string(result), testing::StartsWith("Linux ")); } } // namespace test } // namespace {{projectName}}
flutter/packages/flutter_tools/templates/plugin/linux.tmpl/test/pluginClassSnakeCase_test.cc.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/plugin/linux.tmpl/test/pluginClassSnakeCase_test.cc.tmpl", "repo_id": "flutter", "token_count": 382 }
756
# # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. # Run `pod lib lint {{projectName}}.podspec` to validate before publishing. # Pod::Spec.new do |s| s.name = '{{projectName}}' s.version = '0.0.1' s.summary = '{{description}}' s.description = <<-DESC {{description}} DESC s.homepage = 'http://example.com' s.license = { :file => '../LICENSE' } s.author = { 'Your Company' => '[email protected]' } {{#withFfiPluginHook}} # This will ensure the source files in Classes/ are included in the native # builds of apps using this FFI plugin. Podspec does not support relative # paths, so Classes contains a forwarder C file that relatively imports # `../src/*` so that the C sources can be shared among all target platforms. {{/withFfiPluginHook}} s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'FlutterMacOS' s.platform = :osx, '10.11' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.swift_version = '5.0' end
flutter/packages/flutter_tools/templates/plugin_shared/macos.tmpl/projectName.podspec.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/plugin_shared/macos.tmpl/projectName.podspec.tmpl", "repo_id": "flutter", "token_count": 457 }
757
import 'package:flutter/material.dart'; /// A service that stores and retrieves user settings. /// /// By default, this class does not persist user settings. If you'd like to /// persist the user settings locally, use the shared_preferences package. If /// you'd like to store settings on a web server, use the http package. class SettingsService { /// Loads the User's preferred ThemeMode from local or remote storage. Future<ThemeMode> themeMode() async => ThemeMode.system; /// Persists the user's preferred ThemeMode to local or remote storage. Future<void> updateThemeMode(ThemeMode theme) async { // Use the shared_preferences package to persist settings locally or the // http package to persist settings over the network. } }
flutter/packages/flutter_tools/templates/skeleton/lib/src/settings/settings_service.dart.tmpl/0
{ "file_path": "flutter/packages/flutter_tools/templates/skeleton/lib/src/settings/settings_service.dart.tmpl", "repo_id": "flutter", "token_count": 192 }
758
# Android preview integration tests This directory contains integration tests which would otherwise live in `integration.shard`, but require a dependency on a CIPD-hosted preview version of Android (and therefore their own test shard). For additional information see the README in the `../integration.shard` directory.
flutter/packages/flutter_tools/test/android_preview_integration.shard/README.md/0
{ "file_path": "flutter/packages/flutter_tools/test/android_preview_integration.shard/README.md", "repo_id": "flutter", "token_count": 70 }
759
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:args/command_runner.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/artifacts.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/process.dart'; import 'package:flutter_tools/src/build_system/build_system.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/commands/build.dart'; import 'package:flutter_tools/src/runner/flutter_command.dart'; import '../../src/common.dart'; import '../../src/context.dart'; import '../../src/fakes.dart'; import '../../src/test_build_system.dart'; import '../../src/test_flutter_command_runner.dart'; void main() { testUsingContext('obfuscate requires split-debug-info', () { final FakeBuildInfoCommand command = FakeBuildInfoCommand(); final CommandRunner<void> commandRunner = createTestCommandRunner(command); expect(() => commandRunner.run(<String>[ 'fake', '--obfuscate', ]), throwsToolExit(message: '"--${FlutterOptions.kDartObfuscationOption}" can only be used in ' 'combination with "--${FlutterOptions.kSplitDebugInfoOption}"')); }); group('Fatal Logs', () { late FakeBuildCommand command; late MemoryFileSystem fs; late BufferLogger logger; late ProcessManager processManager; late ProcessUtils processUtils; late Artifacts artifacts; setUp(() { fs = MemoryFileSystem.test(); artifacts = Artifacts.test(fileSystem: fs); fs.file('/package/pubspec.yaml').createSync(recursive: true); fs.currentDirectory = '/package'; Cache.disableLocking(); logger = BufferLogger.test(); processManager = FakeProcessManager.empty(); processUtils = ProcessUtils( logger: logger, processManager: processManager, ); }); testUsingContext("doesn't fail if --fatal-warnings specified and no warnings occur", () async { command = FakeBuildCommand( artifacts: artifacts, androidSdk: FakeAndroidSdk(), buildSystem: TestBuildSystem.all(BuildResult(success: true)), fileSystem: fs, logger: logger, processUtils: processUtils, osUtils: FakeOperatingSystemUtils(), ); try { await createTestCommandRunner(command).run(<String>[ 'build', 'test', '--${FlutterOptions.kFatalWarnings}', ]); } on Exception { fail('Unexpected exception thrown'); } }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => processManager, }); testUsingContext("doesn't fail if --fatal-warnings not specified", () async { command = FakeBuildCommand( artifacts: artifacts, androidSdk: FakeAndroidSdk(), buildSystem: TestBuildSystem.all(BuildResult(success: true)), fileSystem: fs, logger: logger, processUtils: processUtils, osUtils: FakeOperatingSystemUtils(), ); testLogger.printWarning('Warning: Mild annoyance Will Robinson!'); try { await createTestCommandRunner(command).run(<String>[ 'build', 'test', ]); } on Exception { fail('Unexpected exception thrown'); } }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => processManager, }); testUsingContext('fails if --fatal-warnings specified and warnings emitted', () async { command = FakeBuildCommand( artifacts: artifacts, androidSdk: FakeAndroidSdk(), buildSystem: TestBuildSystem.all(BuildResult(success: true)), fileSystem: fs, logger: logger, processUtils: processUtils, osUtils: FakeOperatingSystemUtils(), ); testLogger.printWarning('Warning: Mild annoyance Will Robinson!'); await expectLater(createTestCommandRunner(command).run(<String>[ 'build', 'test', '--${FlutterOptions.kFatalWarnings}', ]), throwsToolExit(message: 'Logger received warning output during the run, and "--${FlutterOptions.kFatalWarnings}" is enabled.')); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => processManager, }); testUsingContext('fails if --fatal-warnings specified and errors emitted', () async { command = FakeBuildCommand( artifacts: artifacts, androidSdk: FakeAndroidSdk(), buildSystem: TestBuildSystem.all(BuildResult(success: true)), fileSystem: fs, logger: logger, processUtils: processUtils, osUtils: FakeOperatingSystemUtils(), ); testLogger.printError('Error: Danger Will Robinson!'); await expectLater(createTestCommandRunner(command).run(<String>[ 'build', 'test', '--${FlutterOptions.kFatalWarnings}', ]), throwsToolExit(message: 'Logger received error output during the run, and "--${FlutterOptions.kFatalWarnings}" is enabled.')); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => processManager, }); }); } class FakeBuildInfoCommand extends FlutterCommand { FakeBuildInfoCommand() : super() { addSplitDebugInfoOption(); addDartObfuscationOption(); } @override String get description => ''; @override String get name => 'fake'; @override Future<FlutterCommandResult> runCommand() async { await getBuildInfo(); return FlutterCommandResult.success(); } } class FakeBuildCommand extends BuildCommand { FakeBuildCommand({ required super.fileSystem, required super.buildSystem, required super.osUtils, required Logger logger, required super.androidSdk, required super.processUtils, required super.artifacts, bool verboseHelp = false, }) : super(logger: logger) { addSubcommand(FakeBuildSubcommand(logger: logger, verboseHelp: verboseHelp)); } @override String get description => ''; @override String get name => 'build'; @override Future<FlutterCommandResult> runCommand() async { return FlutterCommandResult.success(); } } class FakeBuildSubcommand extends BuildSubCommand { FakeBuildSubcommand({required super.logger, required super.verboseHelp}); @override String get description => ''; @override String get name => 'test'; @override Future<FlutterCommandResult> runCommand() async { return FlutterCommandResult.success(); } }
flutter/packages/flutter_tools/test/commands.shard/hermetic/build_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/commands.shard/hermetic/build_test.dart", "repo_id": "flutter", "token_count": 2444 }
760
// 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_device.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/build_info.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/commands/install.dart'; import 'package:flutter_tools/src/ios/application_package.dart'; import 'package:flutter_tools/src/ios/devices.dart'; import 'package:test/fake.dart'; import '../../src/common.dart'; import '../../src/context.dart'; import '../../src/test_flutter_command_runner.dart'; void main() { group('install', () { setUpAll(() { Cache.disableLocking(); }); late FileSystem fileSystem; setUp(() { fileSystem = MemoryFileSystem.test(); fileSystem.file('pubspec.yaml').createSync(recursive: true); }); testUsingContext('returns 0 when Android is connected and ready for an install', () async { final InstallCommand command = InstallCommand(verboseHelp: false); command.applicationPackages = FakeApplicationPackageFactory(FakeAndroidApk()); final FakeAndroidDevice device = FakeAndroidDevice(); testDeviceManager.addAttachedDevice(device); await createTestCommandRunner(command).run(<String>['install']); }, overrides: <Type, Generator>{ Cache: () => Cache.test(processManager: FakeProcessManager.any()), FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('returns 1 when targeted device is not Android with --device-user', () async { final InstallCommand command = InstallCommand(verboseHelp: false); command.applicationPackages = FakeApplicationPackageFactory(FakeAndroidApk()); final FakeIOSDevice device = FakeIOSDevice(); testDeviceManager.addAttachedDevice(device); expect(() async => createTestCommandRunner(command).run(<String>['install', '--device-user', '10']), throwsToolExit(message: '--device-user is only supported for Android')); }, overrides: <Type, Generator>{ Cache: () => Cache.test(processManager: FakeProcessManager.any()), FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('returns 0 when iOS is connected and ready for an install', () async { final InstallCommand command = InstallCommand(verboseHelp: false); command.applicationPackages = FakeApplicationPackageFactory(FakeIOSApp()); final FakeIOSDevice device = FakeIOSDevice(); testDeviceManager.addAttachedDevice(device); await createTestCommandRunner(command).run(<String>['install']); }, overrides: <Type, Generator>{ Cache: () => Cache.test(processManager: FakeProcessManager.any()), FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('fails when prebuilt binary not found', () async { final InstallCommand command = InstallCommand(verboseHelp: false); command.applicationPackages = FakeApplicationPackageFactory(FakeAndroidApk()); final FakeAndroidDevice device = FakeAndroidDevice(); testDeviceManager.addAttachedDevice(device); expect(() async => createTestCommandRunner(command).run(<String>['install', '--use-application-binary', 'bogus']), throwsToolExit(message: 'Prebuilt binary bogus does not exist')); }, overrides: <Type, Generator>{ Cache: () => Cache.test(processManager: FakeProcessManager.any()), FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('succeeds using prebuilt binary', () async { final InstallCommand command = InstallCommand(verboseHelp: false); command.applicationPackages = FakeApplicationPackageFactory(FakeAndroidApk()); final FakeAndroidDevice device = FakeAndroidDevice(); testDeviceManager.addAttachedDevice(device); fileSystem.file('binary').createSync(recursive: true); await createTestCommandRunner(command).run(<String>['install', '--use-application-binary', 'binary']); }, overrides: <Type, Generator>{ Cache: () => Cache.test(processManager: FakeProcessManager.any()), FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('Passes flavor to application package.', () async { const String flavor = 'free'; final InstallCommand command = InstallCommand(verboseHelp: false); final FakeApplicationPackageFactory fakeAppFactory = FakeApplicationPackageFactory(FakeIOSApp()); command.applicationPackages = fakeAppFactory; final FakeIOSDevice device = FakeIOSDevice(); testDeviceManager.addAttachedDevice(device); await createTestCommandRunner(command).run(<String>['install', '--flavor', flavor]); expect(fakeAppFactory.buildInfo, isNotNull); expect(fakeAppFactory.buildInfo!.flavor, flavor); }, overrides: <Type, Generator>{ Cache: () => Cache.test(processManager: FakeProcessManager.any()), FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), }); }); } class FakeApplicationPackageFactory extends Fake implements ApplicationPackageFactory { FakeApplicationPackageFactory(this.app); final ApplicationPackage app; BuildInfo? buildInfo; @override Future<ApplicationPackage> getPackageForPlatform(TargetPlatform platform, {BuildInfo? buildInfo, File? applicationBinary}) async { this.buildInfo = buildInfo; return app; } } class FakeIOSApp extends Fake implements IOSApp { } class FakeAndroidApk extends Fake implements AndroidApk { } class FakeIOSDevice extends Fake implements IOSDevice { @override Future<TargetPlatform> get targetPlatform async => TargetPlatform.ios; @override Future<bool> isAppInstalled( ApplicationPackage app, { String? userIdentifier, }) async => false; @override Future<bool> installApp( IOSApp app, { String? userIdentifier, }) async => true; @override String get name => 'iOS'; } class FakeAndroidDevice extends Fake implements AndroidDevice { @override Future<TargetPlatform> get targetPlatform async => TargetPlatform.android_arm; @override Future<bool> isAppInstalled( ApplicationPackage app, { String? userIdentifier, }) async => false; @override Future<bool> installApp( AndroidApk app, { String? userIdentifier, }) async => true; @override String get name => 'Android'; @override bool get ephemeral => true; }
flutter/packages/flutter_tools/test/commands.shard/hermetic/install_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/commands.shard/hermetic/install_test.dart", "repo_id": "flutter", "token_count": 2185 }
761
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:args/command_runner.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/android/android_builder.dart'; import 'package:flutter_tools/src/android/android_sdk.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/commands/build_appbundle.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/project.dart'; import 'package:flutter_tools/src/reporting/reporting.dart'; import 'package:test/fake.dart'; import 'package:unified_analytics/unified_analytics.dart'; import '../../src/android_common.dart'; import '../../src/common.dart'; import '../../src/context.dart'; import '../../src/fakes.dart' show FakeFlutterVersion; import '../../src/test_flutter_command_runner.dart'; void main() { Cache.disableLocking(); group('Usage', () { late Directory tempDir; late TestUsage testUsage; late FakeAnalytics fakeAnalytics; setUp(() { tempDir = globals.fs.systemTempDirectory.createTempSync('flutter_tools_packages_test.'); testUsage = TestUsage(); fakeAnalytics = getInitializedFakeAnalyticsInstance( fs: MemoryFileSystem.test(), fakeFlutterVersion: FakeFlutterVersion(), ); }); tearDown(() { tryToDelete(tempDir); }); testUsingContext('indicate the default target platforms', () async { final String projectPath = await createProject(tempDir, arguments: <String>['--no-pub', '--template=app']); final BuildAppBundleCommand command = await runBuildAppBundleCommand(projectPath); expect((await command.usageValues).commandBuildAppBundleTargetPlatform, 'android-arm,android-arm64,android-x64'); expect( fakeAnalytics.sentEvents, contains(Event.commandUsageValues( workflow: 'appbundle', commandHasTerminal: false, buildAppBundleTargetPlatform: 'android-arm,android-arm64,android-x64', buildAppBundleBuildMode: 'release', )), ); }, overrides: <Type, Generator>{ AndroidBuilder: () => FakeAndroidBuilder(), Analytics: () => fakeAnalytics, }); testUsingContext('alias aab', () async { final BuildAppBundleCommand command = BuildAppBundleCommand(logger: BufferLogger.test()); expect(command.aliases, contains('aab')); }); testUsingContext('build type', () async { final String projectPath = await createProject(tempDir, arguments: <String>['--no-pub', '--template=app']); final BuildAppBundleCommand commandDefault = await runBuildAppBundleCommand(projectPath); expect((await commandDefault.usageValues).commandBuildAppBundleBuildMode, 'release'); final BuildAppBundleCommand commandInRelease = await runBuildAppBundleCommand(projectPath, arguments: <String>['--release']); expect((await commandInRelease.usageValues).commandBuildAppBundleBuildMode, 'release'); final BuildAppBundleCommand commandInDebug = await runBuildAppBundleCommand(projectPath, arguments: <String>['--debug']); expect((await commandInDebug.usageValues).commandBuildAppBundleBuildMode, 'debug'); final BuildAppBundleCommand commandInProfile = await runBuildAppBundleCommand(projectPath, arguments: <String>['--profile']); expect((await commandInProfile.usageValues).commandBuildAppBundleBuildMode, 'profile'); }, overrides: <Type, Generator>{ AndroidBuilder: () => FakeAndroidBuilder(), }); testUsingContext('logs success', () async { final String projectPath = await createProject(tempDir, arguments: <String>['--no-pub', '--template=app']); await runBuildAppBundleCommand(projectPath); expect(testUsage.events, contains( const TestUsageEvent('tool-command-result', 'appbundle', label: 'success'), )); }, overrides: <Type, Generator>{ AndroidBuilder: () => FakeAndroidBuilder(), Usage: () => testUsage, }); }); group('Gradle', () { late Directory tempDir; late FakeProcessManager processManager; late FakeAndroidSdk fakeAndroidSdk; late TestUsage testUsage; setUp(() { testUsage = TestUsage(); tempDir = globals.fs.systemTempDirectory.createTempSync('flutter_tools_packages_test.'); processManager = FakeProcessManager.any(); fakeAndroidSdk = FakeAndroidSdk(globals.fs.directory('irrelevant')); }); tearDown(() { tryToDelete(tempDir); }); group('AndroidSdk', () { testUsingContext('throws throwsToolExit if AndroidSdk is null', () async { final String projectPath = await createProject(tempDir, arguments: <String>['--no-pub', '--template=app']); await expectLater(() async { await runBuildAppBundleCommand( projectPath, arguments: <String>['--no-pub'], ); }, throwsToolExit( message: 'No Android SDK found. Try setting the ANDROID_HOME environment variable', )); }, overrides: <Type, Generator>{ AndroidSdk: () => null, FlutterProjectFactory: () => FakeFlutterProjectFactory(tempDir), ProcessManager: () => processManager, }); }); testUsingContext("reports when the app isn't using AndroidX", () async { final String projectPath = await createProject(tempDir, arguments: <String>['--no-pub', '--template=app']); // Simulate a non-androidx project. tempDir .childDirectory('flutter_project') .childDirectory('android') .childFile('gradle.properties') .writeAsStringSync('android.useAndroidX=false'); // The command throws a [ToolExit] because it expects an AAB in the file system. await expectLater(() async { await runBuildAppBundleCommand( projectPath, ); }, throwsToolExit()); expect( testLogger.statusText, containsIgnoringWhitespace("Your app isn't using AndroidX"), ); expect( testLogger.statusText, containsIgnoringWhitespace( 'To avoid potential build failures, you can quickly migrate your app by ' 'following the steps on https://goo.gl/CP92wY' ), ); expect(testUsage.events, contains( const TestUsageEvent( 'build', 'gradle', label: 'app-not-using-android-x', parameters: CustomDimensions(), ), )); }, overrides: <Type, Generator>{ AndroidSdk: () => fakeAndroidSdk, FlutterProjectFactory: () => FakeFlutterProjectFactory(tempDir), ProcessManager: () => processManager, Usage: () => testUsage, }); testUsingContext('reports when the app is using AndroidX', () async { final String projectPath = await createProject(tempDir, arguments: <String>['--no-pub', '--template=app']); // The command throws a [ToolExit] because it expects an AAB in the file system. await expectLater(() async { await runBuildAppBundleCommand( projectPath, ); }, throwsToolExit()); expect( testLogger.statusText, isNot(containsIgnoringWhitespace("Your app isn't using AndroidX")), ); expect( testLogger.statusText, isNot( containsIgnoringWhitespace( 'To avoid potential build failures, you can quickly migrate your app by ' 'following the steps on https://goo.gl/CP92wY'), ) ); expect(testUsage.events, contains( const TestUsageEvent( 'build', 'gradle', label: 'app-using-android-x', parameters: CustomDimensions(), ), )); }, overrides: <Type, Generator>{ AndroidSdk: () => fakeAndroidSdk, FlutterProjectFactory: () => FakeFlutterProjectFactory(tempDir), ProcessManager: () => processManager, Usage: () => testUsage, }); }); } Future<BuildAppBundleCommand> runBuildAppBundleCommand( String target, { List<String>? arguments, }) async { final BuildAppBundleCommand command = BuildAppBundleCommand(logger: BufferLogger.test()); final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>[ 'appbundle', ...?arguments, '--no-pub', globals.fs.path.join(target, 'lib', 'main.dart'), ]); return command; } class FakeAndroidSdk extends Fake implements AndroidSdk { FakeAndroidSdk(this.directory); @override final Directory directory; }
flutter/packages/flutter_tools/test/commands.shard/permeable/build_appbundle_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/commands.shard/permeable/build_appbundle_test.dart", "repo_id": "flutter", "token_count": 3328 }
762
// 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:flutter_tools/src/build_info.dart'; import 'package:flutter_tools/src/device.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 kStartServer = FakeCommand( command: <String>['adb', 'start-server'], ); const FakeCommand kShaCommand = FakeCommand( command: <String>[ 'adb', '-s', '1234', 'shell', 'echo', '-n', '', '>', '/data/local/tmp/sky.FlutterApp.sha1', ], ); void main() { late FileSystem fileSystem; late FakeProcessManager processManager; late AndroidSdk androidSdk; setUp(() { processManager = FakeProcessManager.empty(); fileSystem = MemoryFileSystem.test(); androidSdk = FakeAndroidSdk(); }); for (final TargetPlatform targetPlatform in <TargetPlatform>[ TargetPlatform.android_arm, TargetPlatform.android_arm64, TargetPlatform.android_x64, ]) { testWithoutContext('AndroidDevice.startApp allows release builds on $targetPlatform', () async { final String arch = getAndroidArchForName(getNameForTargetPlatform(targetPlatform)).archName; final AndroidDevice device = AndroidDevice('1234', modelID: 'TestModel', fileSystem: fileSystem, processManager: processManager, logger: BufferLogger.test(), platform: FakePlatform(), androidSdk: androidSdk, ); final File apkFile = fileSystem.file('app-debug.apk')..createSync(); final AndroidApk apk = AndroidApk( id: 'FlutterApp', applicationPackage: apkFile, launchActivity: 'FlutterActivity', versionCode: 1, ); processManager.addCommand(kAdbVersionCommand); processManager.addCommand(kStartServer); // This configures the target platform of the device. processManager.addCommand(FakeCommand( command: const <String>['adb', '-s', '1234', 'shell', 'getprop'], stdout: '[ro.product.cpu.abi]: [$arch]', )); processManager.addCommand(const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'am', 'force-stop', 'FlutterApp'], )); processManager.addCommand(const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'pm', 'list', 'packages', 'FlutterApp'], )); processManager.addCommand(const FakeCommand( command: <String>['adb', '-s', '1234', 'install', '-t', '-r', 'app-debug.apk'], )); processManager.addCommand(kShaCommand); processManager.addCommand(const FakeCommand( command: <String>[ 'adb', '-s', '1234', 'shell', 'am', 'start', '-a', 'android.intent.action.MAIN', '-c', 'android.intent.category.LAUNCHER', '-f', '0x20000000', '--ez', 'enable-dart-profiling', 'true', 'FlutterActivity', ], )); final LaunchResult launchResult = await device.startApp( apk, prebuiltApplication: true, debuggingOptions: DebuggingOptions.disabled( BuildInfo.release, ), platformArgs: <String, dynamic>{}, ); expect(launchResult.started, true); expect(processManager, hasNoRemainingExpectations); }); } testWithoutContext('AndroidDevice.startApp does not allow release builds on x86', () async { final AndroidDevice device = AndroidDevice('1234', modelID: 'TestModel', fileSystem: fileSystem, processManager: processManager, logger: BufferLogger.test(), platform: FakePlatform(), androidSdk: androidSdk, ); final File apkFile = fileSystem.file('app-debug.apk')..createSync(); final AndroidApk apk = AndroidApk( id: 'FlutterApp', applicationPackage: apkFile, launchActivity: 'FlutterActivity', versionCode: 1, ); processManager.addCommand(kAdbVersionCommand); processManager.addCommand(kStartServer); // This configures the target platform of the device. processManager.addCommand(const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'getprop'], stdout: '[ro.product.cpu.abi]: [x86]', )); final LaunchResult launchResult = await device.startApp( apk, prebuiltApplication: true, debuggingOptions: DebuggingOptions.disabled( BuildInfo.release, ), platformArgs: <String, dynamic>{}, ); expect(launchResult.started, false); expect(processManager, hasNoRemainingExpectations); }); testWithoutContext('AndroidDevice.startApp forwards all supported debugging options', () async { final AndroidDevice device = AndroidDevice('1234', modelID: 'TestModel', fileSystem: fileSystem, processManager: processManager, logger: BufferLogger.test(), platform: FakePlatform(), androidSdk: androidSdk, ); final File apkFile = fileSystem.file('app-debug.apk')..createSync(); final AndroidApk apk = AndroidApk( id: 'FlutterApp', applicationPackage: apkFile, launchActivity: 'FlutterActivity', versionCode: 1, ); // These commands are required to install and start the app processManager.addCommand(kAdbVersionCommand); processManager.addCommand(kStartServer); processManager.addCommand(const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'getprop'], )); processManager.addCommand(const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'am', 'force-stop', '--user', '10', 'FlutterApp'], )); processManager.addCommand(const FakeCommand( command: <String>['adb', '-s', '1234', 'shell', 'pm', 'list', 'packages', '--user', '10', 'FlutterApp'], )); processManager.addCommand(const FakeCommand( command: <String>[ 'adb', '-s', '1234', 'install', '-t', '-r', '--user', '10', 'app-debug.apk', ], stdout: '\n\nThe Dart VM service is listening on http://127.0.0.1:456\n\n', )); processManager.addCommand(kShaCommand); processManager.addCommand(const FakeCommand( command: <String>[ 'adb', '-s', '1234', 'shell', '-x', 'logcat', '-v', 'time', ], )); // This command contains all launch arguments. processManager.addCommand(const FakeCommand( command: <String>[ 'adb', '-s', '1234', 'shell', 'am', 'start', '-a', 'android.intent.action.MAIN', '-c', 'android.intent.category.LAUNCHER', '-f', '0x20000000', // The DebuggingOptions arguments go here. '--ez', 'enable-dart-profiling', 'true', '--ez', 'enable-software-rendering', 'true', '--ez', 'skia-deterministic-rendering', 'true', '--ez', 'trace-skia', 'true', '--es', 'trace-allowlist', 'bar,baz', '--es', 'trace-skia-allowlist', 'skia.a,skia.b', '--ez', 'trace-systrace', 'true', '--es', 'trace-to-file', 'path/to/trace.binpb', '--ez', 'endless-trace-buffer', 'true', '--ez', 'dump-skp-on-shader-compilation', 'true', '--ez', 'cache-sksl', 'true', '--ez', 'purge-persistent-cache', 'true', '--ez', 'enable-impeller', 'true', '--ez', 'enable-checked-mode', 'true', '--ez', 'verify-entry-points', 'true', '--ez', 'start-paused', 'true', '--ez', 'disable-service-auth-codes', 'true', '--es', 'dart-flags', 'foo,--null_assertions', '--ez', 'use-test-fonts', 'true', '--ez', 'verbose-logging', 'true', '--user', '10', 'FlutterActivity', ], )); final LaunchResult launchResult = await device.startApp( apk, prebuiltApplication: true, debuggingOptions: DebuggingOptions.enabled( BuildInfo.debug, startPaused: true, disableServiceAuthCodes: true, dartFlags: 'foo', enableSoftwareRendering: true, skiaDeterministicRendering: true, traceSkia: true, traceAllowlist: 'bar,baz', traceSkiaAllowlist: 'skia.a,skia.b', traceSystrace: true, traceToFile: 'path/to/trace.binpb', endlessTraceBuffer: true, dumpSkpOnShaderCompilation: true, cacheSkSL: true, purgePersistentCache: true, useTestFonts: true, verboseSystemLogs: true, enableImpeller: ImpellerStatus.enabled, nullAssertions: true, ), platformArgs: <String, dynamic>{}, userIdentifier: '10', ); // This fails to start due to VM Service discovery issues. expect(launchResult.started, false); expect(processManager, hasNoRemainingExpectations); }); } class FakeAndroidSdk extends Fake implements AndroidSdk { @override String get adbPath => 'adb'; @override bool get licensesAvailable => false; }
flutter/packages/flutter_tools/test/general.shard/android/android_device_start_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/android/android_device_start_test.dart", "repo_id": "flutter", "token_count": 4062 }
763
// 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/gradle_utils.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/platform.dart'; import 'package:flutter_tools/src/base/version_range.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/project.dart'; import '../../src/common.dart'; import '../../src/fake_process_manager.dart'; import '../../src/fakes.dart'; void main() { group('injectGradleWrapperIfNeeded', () { late FileSystem fileSystem; late Directory gradleWrapperDirectory; late GradleUtils gradleUtils; setUp(() { fileSystem = MemoryFileSystem.test(); gradleWrapperDirectory = fileSystem.directory('cache/bin/cache/artifacts/gradle_wrapper'); gradleWrapperDirectory.createSync(recursive: true); gradleWrapperDirectory .childFile('gradlew') .writeAsStringSync('irrelevant'); gradleWrapperDirectory .childDirectory('gradle') .childDirectory('wrapper') .createSync(recursive: true); gradleWrapperDirectory .childDirectory('gradle') .childDirectory('wrapper') .childFile('gradle-wrapper.jar') .writeAsStringSync('irrelevant'); gradleUtils = GradleUtils( cache: Cache.test( processManager: FakeProcessManager.any(), fileSystem: fileSystem), platform: FakePlatform(environment: <String, String>{}), logger: BufferLogger.test(), operatingSystemUtils: FakeOperatingSystemUtils(), ); }); testWithoutContext('injects the wrapper when all files are missing', () { final Directory sampleAppAndroid = fileSystem.directory('/sample-app/android'); sampleAppAndroid.createSync(recursive: true); gradleUtils.injectGradleWrapperIfNeeded(sampleAppAndroid); expect(sampleAppAndroid.childFile('gradlew').existsSync(), isTrue); expect( sampleAppAndroid .childDirectory('gradle') .childDirectory('wrapper') .childFile('gradle-wrapper.jar') .existsSync(), isTrue); expect( sampleAppAndroid .childDirectory('gradle') .childDirectory('wrapper') .childFile('gradle-wrapper.properties') .existsSync(), isTrue); expect( sampleAppAndroid .childDirectory('gradle') .childDirectory('wrapper') .childFile('gradle-wrapper.properties') .readAsStringSync(), 'distributionBase=GRADLE_USER_HOME\n' 'distributionPath=wrapper/dists\n' 'zipStoreBase=GRADLE_USER_HOME\n' 'zipStorePath=wrapper/dists\n' 'distributionUrl=https\\://services.gradle.org/distributions/gradle-7.6.3-all.zip\n'); }); testWithoutContext('injects the wrapper when some files are missing', () { final Directory sampleAppAndroid = fileSystem.directory('/sample-app/android'); sampleAppAndroid.createSync(recursive: true); // There's an existing gradlew sampleAppAndroid .childFile('gradlew') .writeAsStringSync('existing gradlew'); gradleUtils.injectGradleWrapperIfNeeded(sampleAppAndroid); expect(sampleAppAndroid.childFile('gradlew').existsSync(), isTrue); expect(sampleAppAndroid.childFile('gradlew').readAsStringSync(), equals('existing gradlew')); expect( sampleAppAndroid .childDirectory('gradle') .childDirectory('wrapper') .childFile('gradle-wrapper.jar') .existsSync(), isTrue); expect( sampleAppAndroid .childDirectory('gradle') .childDirectory('wrapper') .childFile('gradle-wrapper.properties') .existsSync(), isTrue); expect( sampleAppAndroid .childDirectory('gradle') .childDirectory('wrapper') .childFile('gradle-wrapper.properties') .readAsStringSync(), 'distributionBase=GRADLE_USER_HOME\n' 'distributionPath=wrapper/dists\n' 'zipStoreBase=GRADLE_USER_HOME\n' 'zipStorePath=wrapper/dists\n' 'distributionUrl=https\\://services.gradle.org/distributions/gradle-7.6.3-all.zip\n'); }); testWithoutContext( 'injects the wrapper and the Gradle version is derived from the AGP version', () { const Map<String, String> testCases = <String, String>{ // AGP version : Gradle version '1.0.0': '2.3', '3.3.1': '4.10.2', '3.0.0': '4.1', '3.0.5': '4.1', '3.0.9': '4.1', '3.1.0': '4.4', '3.2.0': '4.6', '3.3.0': '4.10.2', '3.4.0': '5.6.2', '3.5.0': '5.6.2', '4.0.0': '6.7', '4.0.5': '6.7', '4.1.0': '6.7', }; for (final MapEntry<String, String> entry in testCases.entries) { final Directory sampleAppAndroid = fileSystem.systemTempDirectory.createTempSync('flutter_android.'); sampleAppAndroid.childFile('build.gradle').writeAsStringSync(''' buildscript { dependencies { classpath 'com.android.tools.build:gradle:${entry.key}' } } '''); gradleUtils.injectGradleWrapperIfNeeded(sampleAppAndroid); expect(sampleAppAndroid.childFile('gradlew').existsSync(), isTrue); expect( sampleAppAndroid .childDirectory('gradle') .childDirectory('wrapper') .childFile('gradle-wrapper.jar') .existsSync(), isTrue); expect( sampleAppAndroid .childDirectory('gradle') .childDirectory('wrapper') .childFile('gradle-wrapper.properties') .existsSync(), isTrue); expect( sampleAppAndroid .childDirectory('gradle') .childDirectory('wrapper') .childFile('gradle-wrapper.properties') .readAsStringSync(), 'distributionBase=GRADLE_USER_HOME\n' 'distributionPath=wrapper/dists\n' 'zipStoreBase=GRADLE_USER_HOME\n' 'zipStorePath=wrapper/dists\n' 'distributionUrl=https\\://services.gradle.org/distributions/gradle-${entry.value}-all.zip\n'); } }); testWithoutContext('returns the gradlew path', () { final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); androidDirectory.childFile('gradlew').createSync(); androidDirectory.childFile('gradlew.bat').createSync(); androidDirectory.childFile('gradle.properties').createSync(); final FlutterProject flutterProject = FlutterProjectFactory( logger: BufferLogger.test(), fileSystem: fileSystem, ).fromDirectory(fileSystem.currentDirectory); expect( gradleUtils.getExecutable(flutterProject), androidDirectory.childFile('gradlew').path, ); }); testWithoutContext('getGradleFileName for notWindows', () { expect(getGradlewFileName(notWindowsPlatform), 'gradlew'); }); testWithoutContext('getGradleFileName for windows', () { expect(getGradlewFileName(windowsPlatform), 'gradlew.bat'); }); testWithoutContext('returns the gradle properties file', () async { final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); final Directory wrapperDirectory = androidDirectory .childDirectory(gradleDirectoryName) .childDirectory(gradleWrapperDirectoryName) ..createSync(recursive: true); final File expectedFile = await wrapperDirectory .childFile(gradleWrapperPropertiesFilename) .create(); final File gradleWrapperFile = getGradleWrapperFile(androidDirectory); expect(gradleWrapperFile.path, expectedFile.path); }); testWithoutContext('returns the gradle wrapper version', () async { const String expectedVersion = '7.4.2'; final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); final Directory wrapperDirectory = androidDirectory .childDirectory('gradle') .childDirectory('wrapper') ..createSync(recursive: true); wrapperDirectory .childFile('gradle-wrapper.properties') .writeAsStringSync(''' distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\\://services.gradle.org/distributions/gradle-$expectedVersion-all.zip '''); expect( await getGradleVersion( androidDirectory, BufferLogger.test(), FakeProcessManager.empty()), expectedVersion, ); }); testWithoutContext('ignores gradle comments', () async { const String expectedVersion = '7.4.2'; final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); final Directory wrapperDirectory = androidDirectory .childDirectory('gradle') .childDirectory('wrapper') ..createSync(recursive: true); wrapperDirectory .childFile('gradle-wrapper.properties') .writeAsStringSync(''' distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists # distributionUrl=https\\://services.gradle.org/distributions/gradle-8.0.2-all.zip distributionUrl=https\\://services.gradle.org/distributions/gradle-$expectedVersion-all.zip # distributionUrl=https\\://services.gradle.org/distributions/gradle-8.0.2-all.zip '''); expect( await getGradleVersion( androidDirectory, BufferLogger.test(), FakeProcessManager.empty()), expectedVersion, ); }); testWithoutContext('returns gradlew version, whitespace, location', () async { const String expectedVersion = '7.4.2'; final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); final Directory wrapperDirectory = androidDirectory .childDirectory('gradle') .childDirectory('wrapper') ..createSync(recursive: true); // Distribution url is not the last line. // Whitespace around distribution url. wrapperDirectory .childFile('gradle-wrapper.properties') .writeAsStringSync(''' distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl = https\\://services.gradle.org/distributions/gradle-$expectedVersion-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists '''); expect( await getGradleVersion( androidDirectory, BufferLogger.test(), FakeProcessManager.empty()), expectedVersion, ); }); testWithoutContext('does not crash on hypothetical new format', () async { final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); final Directory wrapperDirectory = androidDirectory .childDirectory('gradle') .childDirectory('wrapper') ..createSync(recursive: true); // Distribution url is not the last line. // Whitespace around distribution url. wrapperDirectory .childFile('gradle-wrapper.properties') .writeAsStringSync(r'distributionUrl=https\://services.gradle.org/distributions/gradle_7.4.2_all.zip'); // FakeProcessManager.any is used here and not in other getGradleVersion // tests because this test does not care about process fallback logic. expect( await getGradleVersion( androidDirectory, BufferLogger.test(), FakeProcessManager.any()), isNull, ); }); testWithoutContext('returns the installed gradle version', () async { const String expectedVersion = '7.4.2'; const String gradleOutput = ''' ------------------------------------------------------------ Gradle $expectedVersion ------------------------------------------------------------ Build time: 2022-03-31 15:25:29 UTC Revision: 540473b8118064efcc264694cbcaa4b677f61041 Kotlin: 1.5.31 Groovy: 3.0.9 Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021 JVM: 11.0.18 (Azul Systems, Inc. 11.0.18+10-LTS) OS: Mac OS X 13.2.1 aarch64 '''; final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); final ProcessManager processManager = FakeProcessManager.empty() ..addCommand(const FakeCommand( command: <String>['gradle', gradleVersionFlag], stdout: gradleOutput)); expect( await getGradleVersion( androidDirectory, BufferLogger.test(), processManager, ), expectedVersion, ); }); testWithoutContext('returns the installed gradle with whitespace formatting', () async { const String expectedVersion = '7.4.2'; const String gradleOutput = 'Gradle $expectedVersion'; final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); final ProcessManager processManager = FakeProcessManager.empty() ..addCommand(const FakeCommand( command: <String>['gradle', gradleVersionFlag], stdout: gradleOutput)); expect( await getGradleVersion( androidDirectory, BufferLogger.test(), processManager, ), expectedVersion, ); }); testWithoutContext( 'returns the AGP version when set in Groovy build file as classpath with single quotes and commented line', () async { const String expectedVersion = '7.3.0'; final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); androidDirectory.childFile('build.gradle').writeAsStringSync(''' buildscript { repositories { google() mavenCentral() } dependencies { // Decoy value to ensure we ignore commented out lines. // classpath 'com.android.application' version '6.1.0' apply false classpath 'com.android.tools.build:gradle:$expectedVersion' } } allprojects { repositories { google() mavenCentral() } } '''); expect( getAgpVersion(androidDirectory, BufferLogger.test()), expectedVersion, ); }); testWithoutContext( 'returns the AGP version when set in Kotlin build file as classpath', () async { const String expectedVersion = '7.3.0'; final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); androidDirectory.childFile('build.gradle.kts').writeAsStringSync(''' buildscript { repositories { google() mavenCentral() } dependencies { classpath("com.android.tools.build:gradle:$expectedVersion") } } allprojects { repositories { google() mavenCentral() } } '''); expect( getAgpVersion(androidDirectory, BufferLogger.test()), expectedVersion, ); }); testWithoutContext( 'returns the AGP version when set in Groovy build file as compileOnly with double quotes', () async { const String expectedVersion = '7.1.0'; final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); androidDirectory.childFile('build.gradle.kts').writeAsStringSync(''' dependencies { compileOnly "com.android.tools.build:gradle:$expectedVersion" } '''); expect( getAgpVersion(androidDirectory, BufferLogger.test()), expectedVersion, ); }); testWithoutContext( 'returns the AGP version when set in Kotlin build file as compileOnly', () async { const String expectedVersion = '7.1.0'; final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); androidDirectory.childFile('build.gradle.kts').writeAsStringSync(''' dependencies { compileOnly("com.android.tools.build:gradle:$expectedVersion") } '''); expect( getAgpVersion(androidDirectory, BufferLogger.test()), expectedVersion, ); }); testWithoutContext( 'returns the AGP version when set in Groovy build file as plugin', () async { const String expectedVersion = '6.8'; final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); androidDirectory.childFile('build.gradle').writeAsStringSync(''' plugins { id 'com.android.application' version '$expectedVersion' apply false } '''); expect( getAgpVersion(androidDirectory, BufferLogger.test()), expectedVersion, ); }); testWithoutContext( 'returns the AGP version when set in Kotlin build file as plugin', () async { const String expectedVersion = '7.2.0'; final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); androidDirectory.childFile('build.gradle.kts').writeAsStringSync(''' plugins { id("com.android.application") version "$expectedVersion" apply false } '''); expect( getAgpVersion(androidDirectory, BufferLogger.test()), expectedVersion, ); }); testWithoutContext( 'prefers the AGP version when set in Groovy, ignores Kotlin', () async { const String versionInGroovy = '7.3.0'; const String versionInKotlin = '7.4.2'; final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); androidDirectory.childFile('build.gradle').writeAsStringSync(''' buildscript { repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:$versionInGroovy' } } allprojects { repositories { google() mavenCentral() } } '''); androidDirectory.childFile('build.gradle.kts').writeAsStringSync(''' buildscript { repositories { google() mavenCentral() } dependencies { classpath("com.android.tools.build:gradle:$versionInKotlin") } } allprojects { repositories { google() mavenCentral() } } '''); expect( getAgpVersion(androidDirectory, BufferLogger.test()), versionInGroovy, ); }); testWithoutContext('returns null when AGP version not set', () async { final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); androidDirectory.childFile('build.gradle').writeAsStringSync(''' buildscript { repositories { google() mavenCentral() } dependencies { } } allprojects { repositories { google() mavenCentral() } } '''); expect( getAgpVersion(androidDirectory, BufferLogger.test()), null, ); }); testWithoutContext('returns the AGP version when beta', () async { final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); androidDirectory.childFile('build.gradle').writeAsStringSync(r''' buildscript { repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:7.3.0-beta03' } } allprojects { repositories { google() mavenCentral() } } '''); expect( getAgpVersion(androidDirectory, BufferLogger.test()), '7.3.0', ); }); testWithoutContext('returns the AGP version when in Groovy settings as plugin', () async { final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); // File must exist and can not have agp defined. androidDirectory.childFile('build.gradle').writeAsStringSync(r''); androidDirectory.childFile('settings.gradle').writeAsStringSync(r''' pluginManagement { plugins { id 'dev.flutter.flutter-gradle-plugin' version '1.0.0' apply false id 'dev.flutter.flutter-plugin-loader' version '1.0.0' // Decoy value to ensure we ignore commented out lines. // id 'com.android.application' version '6.1.0' apply false id 'com.android.application' version '8.1.0' apply false } } '''); expect( getAgpVersion(androidDirectory, BufferLogger.test()), '8.1.0', ); }); testWithoutContext( 'returns the AGP version when in Kotlin settings as plugin', () async { final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); // File must exist and cannot have agp defined. androidDirectory.childFile('build.gradle.kts').writeAsStringSync(r''); androidDirectory.childFile('settings.gradle.kts').writeAsStringSync(r''' pluginManagement { plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" // Decoy value to ensure we ignore commented out lines. // id("com.android.application") version "6.1.0" apply false id("com.android.application") version "7.5.0" apply false } } '''); expect( getAgpVersion(androidDirectory, BufferLogger.test()), '7.5.0', ); }); testWithoutContext( 'returns null when agp version is misconfigured', () async { final Directory androidDirectory = fileSystem.directory('/android') ..createSync(); androidDirectory.childFile('build.gradle.kts').writeAsStringSync(''' plugins { `java-gradle-plugin` `groovy` } dependencies { // intentional typo compileOnl("com.android.tools.build:gradle:7.3.0") } '''); expect( getAgpVersion(androidDirectory, BufferLogger.test()), null, ); }); group('validates gradle/agp versions', () { final List<GradleAgpTestData> testData = <GradleAgpTestData>[ // Values too new *these need to be updated* when // max known gradle and max known agp versions are updated: // Newer tools version supports max gradle version. GradleAgpTestData(true, agpVersion: '8.2', gradleVersion: '8.0'), // Newer tools version does not even meet current gradle version requirements. GradleAgpTestData(false, agpVersion: '8.2', gradleVersion: '7.3'), // Newer tools version requires newer gradle version. GradleAgpTestData(true, agpVersion: '8.3', gradleVersion: '8.1'), // Template versions of Gradle/AGP. GradleAgpTestData(true, agpVersion: templateAndroidGradlePluginVersion, gradleVersion: templateDefaultGradleVersion), GradleAgpTestData(true, agpVersion: templateAndroidGradlePluginVersionForModule, gradleVersion: templateDefaultGradleVersion), // Minimums as defined in // https://developer.android.com/studio/releases/gradle-plugin#updating-gradle GradleAgpTestData(true, agpVersion: '8.1', gradleVersion: '8.0'), GradleAgpTestData(true, agpVersion: '8.0', gradleVersion: '8.0'), GradleAgpTestData(true, agpVersion: '7.4', gradleVersion: '7.5'), GradleAgpTestData(true, agpVersion: '7.3', gradleVersion: '7.4'), GradleAgpTestData(true, agpVersion: '7.2', gradleVersion: '7.3.3'), GradleAgpTestData(true, agpVersion: '7.1', gradleVersion: '7.2'), GradleAgpTestData(true, agpVersion: '7.0', gradleVersion: '7.0'), GradleAgpTestData(true, agpVersion: '4.2.0', gradleVersion: '6.7.1'), GradleAgpTestData(true, agpVersion: '4.1.0', gradleVersion: '6.5'), GradleAgpTestData(true, agpVersion: '4.0.0', gradleVersion: '6.1.1'), GradleAgpTestData(true, agpVersion: '3.6.0', gradleVersion: '5.6.4'), GradleAgpTestData(true, agpVersion: '3.5.0', gradleVersion: '5.4.1'), GradleAgpTestData(true, agpVersion: '3.4.0', gradleVersion: '5.1.1'), GradleAgpTestData(true, agpVersion: '3.3.0', gradleVersion: '4.10.1'), // Values too old: GradleAgpTestData(false, agpVersion: '3.3.0', gradleVersion: '4.9'), GradleAgpTestData(false, agpVersion: '7.3', gradleVersion: '7.2'), GradleAgpTestData(false, agpVersion: '3.0.0', gradleVersion: '7.2'), // Null values: // ignore: avoid_redundant_argument_values GradleAgpTestData(false, agpVersion: null, gradleVersion: '7.2'), // ignore: avoid_redundant_argument_values GradleAgpTestData(false, agpVersion: '3.0.0', gradleVersion: null), // ignore: avoid_redundant_argument_values GradleAgpTestData(false, agpVersion: null, gradleVersion: null), // Middle AGP cases: GradleAgpTestData(true, agpVersion: '8.0.1', gradleVersion: '8.0'), GradleAgpTestData(true, agpVersion: '7.4.1', gradleVersion: '7.5'), GradleAgpTestData(true, agpVersion: '7.3.1', gradleVersion: '7.4'), GradleAgpTestData(true, agpVersion: '7.2.1', gradleVersion: '7.3.3'), GradleAgpTestData(true, agpVersion: '7.1.1', gradleVersion: '7.2'), GradleAgpTestData(true, agpVersion: '7.0.1', gradleVersion: '7.0'), GradleAgpTestData(true, agpVersion: '4.2.1', gradleVersion: '6.7.1'), GradleAgpTestData(true, agpVersion: '4.1.1', gradleVersion: '6.5'), GradleAgpTestData(true, agpVersion: '4.0.1', gradleVersion: '6.1.1'), GradleAgpTestData(true, agpVersion: '3.6.1', gradleVersion: '5.6.4'), GradleAgpTestData(true, agpVersion: '3.5.1', gradleVersion: '5.4.1'), GradleAgpTestData(true, agpVersion: '3.4.1', gradleVersion: '5.1.1'), GradleAgpTestData(true, agpVersion: '3.3.1', gradleVersion: '4.10.1'), // Higher gradle cases: GradleAgpTestData(true, agpVersion: '7.4', gradleVersion: '8.0'), GradleAgpTestData(true, agpVersion: '7.3', gradleVersion: '7.5'), GradleAgpTestData(true, agpVersion: '7.2', gradleVersion: '7.4'), GradleAgpTestData(true, agpVersion: '7.1', gradleVersion: '7.3.3'), GradleAgpTestData(true, agpVersion: '7.0', gradleVersion: '7.2'), GradleAgpTestData(true, agpVersion: '4.2.0', gradleVersion: '7.0'), GradleAgpTestData(true, agpVersion: '4.1.0', gradleVersion: '6.7.1'), GradleAgpTestData(true, agpVersion: '4.0.0', gradleVersion: '6.5'), GradleAgpTestData(true, agpVersion: '3.6.0', gradleVersion: '6.1.1'), GradleAgpTestData(true, agpVersion: '3.5.0', gradleVersion: '5.6.4'), GradleAgpTestData(true, agpVersion: '3.4.0', gradleVersion: '5.4.1'), GradleAgpTestData(true, agpVersion: '3.3.0', gradleVersion: '5.1.1'), ]; for (final GradleAgpTestData data in testData) { test('(gradle, agp): (${data.gradleVersion}, ${data.agpVersion})', () { expect( validateGradleAndAgp( BufferLogger.test(), gradleV: data.gradleVersion, agpV: data.agpVersion, ), data.validPair ? isTrue : isFalse, reason: 'G: ${data.gradleVersion}, AGP: ${data.agpVersion}'); }); } }); group('Parse gradle version from distribution url', () { testWithoutContext('null distribution url returns null version', () { expect(parseGradleVersionFromDistributionUrl(null), null); }); testWithoutContext('unparseable format returns null', () { const String distributionUrl = 'aString'; expect(parseGradleVersionFromDistributionUrl(distributionUrl), null); }); testWithoutContext("recognizable 'all' format returns correct version", () { const String distributionUrl = r'distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip'; expect(parseGradleVersionFromDistributionUrl(distributionUrl), '6.7'); }); testWithoutContext("recognizable 'bin' format returns correct version", () { const String distributionUrl = r'distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip'; expect(parseGradleVersionFromDistributionUrl(distributionUrl), '6.7'); }); testWithoutContext("recognizable 'rc' format returns correct version", () { const String distributionUrl = r'distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-rc-3-all.zip'; expect(parseGradleVersionFromDistributionUrl(distributionUrl), '8.1'); }); }); group('validates java/gradle versions', () { final List<JavaGradleTestData> testData = <JavaGradleTestData>[ // Values too new *these need to be updated* when // max supported java and max known gradle versions are updated: // Newer tools version does not even meet current gradle version requirements. JavaGradleTestData(false, javaVersion: '20', gradleVersion: '7.5'), // Newer tools version requires newer gradle version. JavaGradleTestData(true, javaVersion: '20', gradleVersion: '8.1'), // Max known unsupported Java version. JavaGradleTestData(true, javaVersion: '24', gradleVersion: maxKnownAndSupportedGradleVersion), // Minimums as defined in // https://docs.gradle.org/current/userguide/compatibility.html#java JavaGradleTestData(true, javaVersion: '19', gradleVersion: '7.6'), JavaGradleTestData(true, javaVersion: '18', gradleVersion: '7.5'), JavaGradleTestData(true, javaVersion: '17', gradleVersion: '7.3'), JavaGradleTestData(true, javaVersion: '16', gradleVersion: '7.0'), JavaGradleTestData(true, javaVersion: '15', gradleVersion: '6.7'), JavaGradleTestData(true, javaVersion: '14', gradleVersion: '6.3'), JavaGradleTestData(true, javaVersion: '13', gradleVersion: '6.0'), JavaGradleTestData(true, javaVersion: '12', gradleVersion: '5.4'), JavaGradleTestData(true, javaVersion: '11', gradleVersion: '5.0'), JavaGradleTestData(true, javaVersion: '1.10', gradleVersion: '4.7'), JavaGradleTestData(true, javaVersion: '1.9', gradleVersion: '4.3'), JavaGradleTestData(true, javaVersion: '1.8', gradleVersion: '2.0'), // Gradle too old for Java version. JavaGradleTestData(false, javaVersion: '19', gradleVersion: '6.7'), JavaGradleTestData(false, javaVersion: '11', gradleVersion: '4.10.1'), JavaGradleTestData(false, javaVersion: '1.9', gradleVersion: '4.1'), // Null values: // ignore: avoid_redundant_argument_values JavaGradleTestData(false, javaVersion: null, gradleVersion: '7.2'), // ignore: avoid_redundant_argument_values JavaGradleTestData(false, javaVersion: '11', gradleVersion: null), // ignore: avoid_redundant_argument_values JavaGradleTestData(false, javaVersion: null, gradleVersion: null), // Middle Java cases: // https://www.java.com/releases/ JavaGradleTestData(true, javaVersion: '19.0.2', gradleVersion: '8.0.2'), JavaGradleTestData(true, javaVersion: '19.0.2', gradleVersion: '8.0.0'), JavaGradleTestData(true, javaVersion: '18.0.2', gradleVersion: '8.0.2'), JavaGradleTestData(true, javaVersion: '17.0.3', gradleVersion: '7.5'), JavaGradleTestData(true, javaVersion: '16.0.1', gradleVersion: '7.3'), JavaGradleTestData(true, javaVersion: '15.0.2', gradleVersion: '7.3'), JavaGradleTestData(true, javaVersion: '14.0.1', gradleVersion: '7.0'), JavaGradleTestData(true, javaVersion: '13.0.2', gradleVersion: '6.7'), JavaGradleTestData(true, javaVersion: '12.0.2', gradleVersion: '6.3'), JavaGradleTestData(true, javaVersion: '11.0.18', gradleVersion: '6.0'), // Higher gradle cases: JavaGradleTestData(true, javaVersion: '19', gradleVersion: '8.0'), JavaGradleTestData(true, javaVersion: '18', gradleVersion: '8.0'), JavaGradleTestData(true, javaVersion: '17', gradleVersion: '7.5'), JavaGradleTestData(true, javaVersion: '16', gradleVersion: '7.3'), JavaGradleTestData(true, javaVersion: '15', gradleVersion: '7.3'), JavaGradleTestData(true, javaVersion: '14', gradleVersion: '7.0'), JavaGradleTestData(true, javaVersion: '13', gradleVersion: '6.7'), JavaGradleTestData(true, javaVersion: '12', gradleVersion: '6.3'), JavaGradleTestData(true, javaVersion: '11', gradleVersion: '6.0'), JavaGradleTestData(true, javaVersion: '1.10', gradleVersion: '5.4'), JavaGradleTestData(true, javaVersion: '1.9', gradleVersion: '5.0'), JavaGradleTestData(true, javaVersion: '1.8', gradleVersion: '4.3'), ]; for (final JavaGradleTestData data in testData) { testWithoutContext( '(Java, gradle): (${data.javaVersion}, ${data.gradleVersion})', () { expect( validateJavaAndGradle( BufferLogger.test(), javaV: data.javaVersion, gradleV: data.gradleVersion, ), data.validPair ? isTrue : isFalse, reason: 'J: ${data.javaVersion}, G: ${data.gradleVersion}'); }); } }); }); group('getGradleVersionForAndroidPlugin', () { late FileSystem fileSystem; late Logger testLogger; setUp(() { fileSystem = MemoryFileSystem.test(); testLogger = BufferLogger.test(); }); testWithoutContext('prefers build.gradle over build.gradle.kts', () async { const String versionInGroovy = '4.0.0'; const String versionInKotlin = '7.4.2'; final Directory androidDirectory = fileSystem.directory('/android')..createSync(); androidDirectory.childFile('build.gradle').writeAsStringSync(''' buildscript { repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:$versionInGroovy' } } allprojects { repositories { google() mavenCentral() } } '''); androidDirectory.childFile('build.gradle.kts').writeAsStringSync(''' buildscript { repositories { google() mavenCentral() } dependencies { classpath("com.android.tools.build:gradle:$versionInKotlin") } } allprojects { repositories { google() mavenCentral() } } '''); expect( getGradleVersionForAndroidPlugin(androidDirectory, testLogger), '6.7', // as per compatibility matrix in gradle_utils.dart ); }); }); group('validates java/AGP versions', () { final List<JavaAgpTestData> testData = <JavaAgpTestData>[ // Strictly too old Java versions for known AGP versions. JavaAgpTestData(false, javaVersion: '1.6', agpVersion: maxKnownAgpVersion), JavaAgpTestData(false, javaVersion: '1.6', agpVersion: maxKnownAndSupportedAgpVersion), JavaAgpTestData(false, javaVersion: '1.6', agpVersion: '4.2'), // Strictly too old AGP versions. JavaAgpTestData(false, javaVersion: '1.8', agpVersion: '1.0'), JavaAgpTestData(false, javaVersion: '1.8', agpVersion: '4.1'), JavaAgpTestData(false, javaVersion: '1.8', agpVersion: '2.3'), // Strictly too new Java versions for defined AGP versions. JavaAgpTestData(true, javaVersion: '18', agpVersion: '8.1'), JavaAgpTestData(true, javaVersion: '18', agpVersion: '7.4'), JavaAgpTestData(true, javaVersion: '18', agpVersion: '4.2'), // Strictly too new AGP versions. // *The tests that follow need to be updated* when max supported AGP versions are updated: JavaAgpTestData(false, javaVersion: '24', agpVersion: '8.3'), JavaAgpTestData(false, javaVersion: '20', agpVersion: '8.3'), JavaAgpTestData(false, javaVersion: '17', agpVersion: '8.3'), // Java 17 & patch versions compatibility cases // *The tests that follow need to be updated* when maxKnownAndSupportedAgpVersion is // updated: JavaAgpTestData(false, javaVersion: '17', agpVersion: '8.2'), JavaAgpTestData(true, javaVersion: '17', agpVersion: maxKnownAndSupportedAgpVersion), JavaAgpTestData(true, javaVersion: '17', agpVersion: '8.1'), JavaAgpTestData(true, javaVersion: '17', agpVersion: '8.0'), JavaAgpTestData(true, javaVersion: '17', agpVersion: '7.4'), JavaAgpTestData(false, javaVersion: '17.0.3', agpVersion: '8.2'), JavaAgpTestData(true, javaVersion: '17.0.3', agpVersion: maxKnownAndSupportedAgpVersion), JavaAgpTestData(true, javaVersion: '17.0.3', agpVersion: '8.1'), JavaAgpTestData(true, javaVersion: '17.0.3', agpVersion: '8.0'), JavaAgpTestData(true, javaVersion: '17.0.3', agpVersion: '7.4'), // Java 11 & patch versions compatibility cases JavaAgpTestData(false, javaVersion: '11', agpVersion: '8.0'), JavaAgpTestData(true, javaVersion: '11', agpVersion: '7.4'), JavaAgpTestData(true, javaVersion: '11', agpVersion: '7.2'), JavaAgpTestData(true, javaVersion: '11', agpVersion: '7.0'), JavaAgpTestData(true, javaVersion: '11', agpVersion: '4.2'), JavaAgpTestData(false, javaVersion: '11.0.18', agpVersion: '8.0'), JavaAgpTestData(true, javaVersion: '11.0.18', agpVersion: '7.4'), JavaAgpTestData(true, javaVersion: '11.0.18', agpVersion: '7.2'), JavaAgpTestData(true, javaVersion: '11.0.18', agpVersion: '7.0'), JavaAgpTestData(true, javaVersion: '11.0.18', agpVersion: '4.2'), // Java 8 compatibility cases JavaAgpTestData(false, javaVersion: '1.8', agpVersion: '7.0'), JavaAgpTestData(true, javaVersion: '1.8', agpVersion: oldestDocumentedJavaAgpCompatibilityVersion), // agpVersion = 4.2 JavaAgpTestData(false, javaVersion: '1.8', agpVersion: '4.1'), // Null value cases // ignore: avoid_redundant_argument_values JavaAgpTestData(false, javaVersion: null, agpVersion: '4.2'), // ignore: avoid_redundant_argument_values JavaAgpTestData(false, javaVersion: '1.8', agpVersion: null), // ignore: avoid_redundant_argument_values JavaAgpTestData(false, javaVersion: null, agpVersion: null), ]; for (final JavaAgpTestData data in testData) { testWithoutContext( '(Java, agp): (${data.javaVersion}, ${data.agpVersion})', () { expect( validateJavaAndAgp( BufferLogger.test(), javaV: data.javaVersion, agpV: data.agpVersion, ), data.validPair ? isTrue : isFalse, reason: 'J: ${data.javaVersion}, G: ${data.agpVersion}'); }); } }); group('detecting valid Gradle/AGP versions for given Java version and vice versa', () { testWithoutContext('getValidGradleVersionRangeForJavaVersion returns valid Gradle version range for Java version', () { final Logger testLogger = BufferLogger.test(); // Java version too high. expect(getValidGradleVersionRangeForJavaVersion(testLogger, javaV: oneMajorVersionHigherJavaVersion), isNull); // Maximum known Java version. // *The test case that follows needs to be updated* when higher versions of Java are supported: expect( getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '20'), allOf( equals(getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '20.0.2')), isNull)); // Known supported Java versions. expect( getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '19'), allOf( equals(getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '19.0.2')), equals( const JavaGradleCompat( javaMin: '19', javaMax: '20', gradleMin: '7.6', gradleMax: maxKnownAndSupportedGradleVersion)))); expect( getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '18'), allOf( equals(getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '18.0.2')), equals( const JavaGradleCompat( javaMin: '18', javaMax: '19', gradleMin: '7.5', gradleMax: maxKnownAndSupportedGradleVersion)))); expect( getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '17'), allOf( equals(getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '17.0.2')), equals( const JavaGradleCompat( javaMin: '17', javaMax: '18', gradleMin: '7.3', gradleMax: maxKnownAndSupportedGradleVersion)))); expect( getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '16'), allOf( equals(getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '16.0.2')), equals( const JavaGradleCompat( javaMin: '16', javaMax: '17', gradleMin: '7.0', gradleMax: maxKnownAndSupportedGradleVersion)))); expect( getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '15'), allOf( equals(getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '15.0.2')), equals( const JavaGradleCompat( javaMin: '15', javaMax: '16', gradleMin: '6.7', gradleMax: maxKnownAndSupportedGradleVersion)))); expect( getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '14'), allOf( equals(getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '14.0.2')), equals( const JavaGradleCompat( javaMin: '14', javaMax: '15', gradleMin: '6.3', gradleMax: maxKnownAndSupportedGradleVersion)))); expect( getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '13'), allOf( equals(getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '13.0.2')), equals( const JavaGradleCompat( javaMin: '13', javaMax: '14', gradleMin: '6.0', gradleMax: maxKnownAndSupportedGradleVersion)))); expect( getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '12'), allOf( equals(getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '12.0.2')), equals( const JavaGradleCompat( javaMin: '12', javaMax: '13', gradleMin: '5.4', gradleMax: maxKnownAndSupportedGradleVersion)))); expect( getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '11'), allOf( equals(getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '11.0.2')), equals( const JavaGradleCompat( javaMin: '11', javaMax: '12', gradleMin: '5.0', gradleMax: maxKnownAndSupportedGradleVersion)))); expect( getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '1.10'), allOf( equals(getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '1.10.2')), equals( const JavaGradleCompat( javaMin: '1.10', javaMax: '1.11', gradleMin: '4.7', gradleMax: maxKnownAndSupportedGradleVersion)))); expect( getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '1.9'), allOf( equals(getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '1.9.2')), equals( const JavaGradleCompat( javaMin: '1.9', javaMax: '1.10', gradleMin: '4.3', gradleMax: maxKnownAndSupportedGradleVersion)))); // Java 1.8 -- return oldest documented compatibility info expect( getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '1.8'), allOf( equals(getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '1.8.2')), equals( const JavaGradleCompat( javaMin: '1.8', javaMax: '1.9', gradleMin: '2.0', gradleMax: maxKnownAndSupportedGradleVersion)))); // Java version too low. expect( getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '1.7'), allOf( equals(getValidGradleVersionRangeForJavaVersion(testLogger, javaV: '1.7.2')), isNull)); }); testWithoutContext('getMinimumAgpVersionForJavaVersion returns minimum AGP version for Java version', () { final Logger testLogger = BufferLogger.test(); // Maximum known Java version. // *The test case that follows needs to be updated* as higher versions of AGP are supported: expect( getMinimumAgpVersionForJavaVersion(testLogger, javaV: oneMajorVersionHigherJavaVersion), equals( const JavaAgpCompat( javaMin: '17', javaDefault: '17', agpMin: '8.0', agpMax: '8.1'))); // Known Java versions. expect( getMinimumAgpVersionForJavaVersion(testLogger, javaV: '17'), allOf( equals(getMinimumAgpVersionForJavaVersion(testLogger, javaV: '17.0.2')), equals( const JavaAgpCompat( javaMin: '17', javaDefault: '17', agpMin: '8.0', agpMax: '8.1')))); expect( getMinimumAgpVersionForJavaVersion(testLogger, javaV: '15'), allOf( equals(getMinimumAgpVersionForJavaVersion(testLogger, javaV: '15.0.2')), equals( const JavaAgpCompat( javaMin: '11', javaDefault: '11', agpMin: '7.0', agpMax: '7.4')))); expect( getMinimumAgpVersionForJavaVersion(testLogger, javaV: '11'), allOf( equals(getMinimumAgpVersionForJavaVersion(testLogger, javaV: '11.0.2')), equals( const JavaAgpCompat( javaMin: '11', javaDefault: '11', agpMin: '7.0', agpMax: '7.4')))); expect( getMinimumAgpVersionForJavaVersion(testLogger, javaV: '1.9'), allOf( equals(getMinimumAgpVersionForJavaVersion(testLogger, javaV: '1.9.2')), equals( const JavaAgpCompat( javaMin: '1.8', javaDefault: '1.8', agpMin: '4.2', agpMax: '4.2')))); expect( getMinimumAgpVersionForJavaVersion(testLogger, javaV: '1.8'), allOf( equals(getMinimumAgpVersionForJavaVersion(testLogger, javaV: '1.8.2')), equals( const JavaAgpCompat( javaMin: '1.8', javaDefault: '1.8', agpMin: '4.2', agpMax: '4.2')))); // Java version too low. expect( getMinimumAgpVersionForJavaVersion(testLogger, javaV: '1.7'), allOf( equals(getMinimumAgpVersionForJavaVersion(testLogger, javaV: '1.7.2')), isNull)); }); testWithoutContext('getJavaVersionFor returns expected Java version range', () { // Strictly too old Gradle and AGP versions. expect(getJavaVersionFor(gradleV: '1.9', agpV: '4.1'), equals(const VersionRange(null, null))); // Strictly too old Gradle or AGP version. expect(getJavaVersionFor(gradleV: '1.9', agpV: '4.2'), equals(const VersionRange('1.8', null))); expect(getJavaVersionFor(gradleV: '2.0', agpV: '4.1'), equals(const VersionRange(null, '1.9'))); // Strictly too new Gradle and AGP versions. expect(getJavaVersionFor(gradleV: '8.1', agpV: '8.2'), equals(const VersionRange(null, null))); // Strictly too new Gradle version and maximum version of AGP. //*This test case will need its expected Java range updated when a new version of AGP is supported.* expect(getJavaVersionFor(gradleV: '8.1', agpV: maxKnownAndSupportedAgpVersion), equals(const VersionRange('17', null))); // Strictly too new AGP version and maximum version of Gradle. //*This test case will need its expected Java range updated when a new version of Gradle is supported.* expect(getJavaVersionFor(gradleV: maxKnownAndSupportedGradleVersion, agpV: '8.2'), equals(const VersionRange(null, '20'))); // Tests with a known compatible Gradle/AGP version pair. expect(getJavaVersionFor(gradleV: '7.0', agpV: '7.2'), equals(const VersionRange('11', '17'))); expect(getJavaVersionFor(gradleV: '7.1', agpV: '7.2'), equals(const VersionRange('11', '17'))); expect(getJavaVersionFor(gradleV: '7.2.2', agpV: '7.2'), equals(const VersionRange('11', '17'))); expect(getJavaVersionFor(gradleV: '7.1', agpV: '7.0'), equals(const VersionRange('11', '17'))); expect(getJavaVersionFor(gradleV: '7.1', agpV: '7.2'), equals(const VersionRange('11', '17'))); expect(getJavaVersionFor(gradleV: '7.1', agpV: '7.4'), equals(const VersionRange('11', '17'))); }); }); } class GradleAgpTestData { GradleAgpTestData(this.validPair, {this.gradleVersion, this.agpVersion}); final String? gradleVersion; final String? agpVersion; final bool validPair; } class JavaGradleTestData { JavaGradleTestData(this.validPair, {this.javaVersion, this.gradleVersion}); final String? gradleVersion; final String? javaVersion; final bool validPair; } class JavaAgpTestData { JavaAgpTestData(this.validPair, {this.javaVersion, this.agpVersion}); final String? agpVersion; final String? javaVersion; final bool validPair; } final Platform windowsPlatform = FakePlatform( operatingSystem: 'windows', environment: <String, String>{ 'PROGRAMFILES(X86)': r'C:\Program Files (x86)\', 'FLUTTER_ROOT': r'C:\flutter', 'USERPROFILE': '/', } ); final Platform notWindowsPlatform = FakePlatform( environment: <String, String>{ 'FLUTTER_ROOT': r'/users/someuser/flutter', } );
flutter/packages/flutter_tools/test/general.shard/android/gradle_utils_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/android/gradle_utils_test.dart", "repo_id": "flutter", "token_count": 21503 }
764
// 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/bot_detector.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/persistent_tool_state.dart'; import '../../src/common.dart'; import '../../src/fake_http_client.dart'; import '../../src/fakes.dart'; final Uri azureUrl = Uri.parse('http://169.254.169.254/metadata/instance'); void main() { group('BotDetector', () { late FakePlatform fakePlatform; late FakeStdio fakeStdio; late PersistentToolState persistentToolState; setUp(() { fakePlatform = FakePlatform()..environment = <String, String>{}; fakeStdio = FakeStdio(); persistentToolState = PersistentToolState.test( directory: MemoryFileSystem.test().currentDirectory, logger: BufferLogger.test(), ); }); group('isRunningOnBot', () { testWithoutContext('returns false unconditionally if BOT=false is set', () async { fakePlatform.environment['BOT'] = 'false'; fakePlatform.environment['TRAVIS'] = 'true'; final BotDetector botDetector = BotDetector( platform: fakePlatform, httpClientFactory: () => FakeHttpClient.any(), persistentToolState: persistentToolState, ); expect(await botDetector.isRunningOnBot, isFalse); expect(persistentToolState.isRunningOnBot, isFalse); }); testWithoutContext('does not cache BOT environment variable', () async { fakePlatform.environment['BOT'] = 'true'; final BotDetector botDetector = BotDetector( platform: fakePlatform, httpClientFactory: () => FakeHttpClient.any(), persistentToolState: persistentToolState, ); expect(await botDetector.isRunningOnBot, isTrue); expect(persistentToolState.isRunningOnBot, isTrue); fakePlatform.environment['BOT'] = 'false'; expect(await botDetector.isRunningOnBot, isFalse); expect(persistentToolState.isRunningOnBot, isFalse); }); testWithoutContext('returns false unconditionally if FLUTTER_HOST is set', () async { fakePlatform.environment['FLUTTER_HOST'] = 'foo'; fakePlatform.environment['TRAVIS'] = 'true'; final BotDetector botDetector = BotDetector( platform: fakePlatform, httpClientFactory: () => FakeHttpClient.any(), persistentToolState: persistentToolState, ); expect(await botDetector.isRunningOnBot, isFalse); expect(persistentToolState.isRunningOnBot, isFalse); }); testWithoutContext('returns false with and without a terminal attached', () async { final BotDetector botDetector = BotDetector( platform: fakePlatform, httpClientFactory: () => FakeHttpClient.list(<FakeRequest>[ FakeRequest(azureUrl, responseError: const SocketException('HTTP connection timed out')), ]), persistentToolState: persistentToolState, ); fakeStdio.stdout.hasTerminal = true; expect(await botDetector.isRunningOnBot, isFalse); fakeStdio.stdout.hasTerminal = false; expect(await botDetector.isRunningOnBot, isFalse); expect(persistentToolState.isRunningOnBot, isFalse); }); testWithoutContext('can test analytics outputs on bots when outputting to a file', () async { fakePlatform.environment['TRAVIS'] = 'true'; fakePlatform.environment['FLUTTER_ANALYTICS_LOG_FILE'] = '/some/file'; final BotDetector botDetector = BotDetector( platform: fakePlatform, httpClientFactory: () => FakeHttpClient.any(), persistentToolState: persistentToolState, ); expect(await botDetector.isRunningOnBot, isFalse); expect(persistentToolState.isRunningOnBot, isFalse); }); testWithoutContext('returns true when azure metadata is reachable', () async { final BotDetector botDetector = BotDetector( platform: fakePlatform, httpClientFactory: () => FakeHttpClient.any(), persistentToolState: persistentToolState, ); expect(await botDetector.isRunningOnBot, isTrue); expect(persistentToolState.isRunningOnBot, isTrue); }); testWithoutContext('caches azure bot detection results across instances', () async { final BotDetector botDetector = BotDetector( platform: fakePlatform, httpClientFactory: () => FakeHttpClient.any(), persistentToolState: persistentToolState, ); expect(await botDetector.isRunningOnBot, isTrue); expect(await BotDetector( platform: fakePlatform, httpClientFactory: () => FakeHttpClient.list(<FakeRequest>[]), persistentToolState: persistentToolState, ).isRunningOnBot, isTrue); }); testWithoutContext('returns true when running on borg', () async { fakePlatform.environment['BORG_ALLOC_DIR'] = 'true'; final BotDetector botDetector = BotDetector( platform: fakePlatform, httpClientFactory: () => FakeHttpClient.any(), persistentToolState: persistentToolState, ); expect(await botDetector.isRunningOnBot, isTrue); expect(persistentToolState.isRunningOnBot, isTrue); }); }); }); group('AzureDetector', () { testWithoutContext('isRunningOnAzure returns false when connection times out', () async { final AzureDetector azureDetector = AzureDetector( httpClientFactory: () => FakeHttpClient.list(<FakeRequest>[ FakeRequest(azureUrl, responseError: const SocketException('HTTP connection timed out')), ], )); expect(await azureDetector.isRunningOnAzure, isFalse); }); testWithoutContext('isRunningOnAzure returns false when OsError is thrown', () async { final AzureDetector azureDetector = AzureDetector( httpClientFactory: () => FakeHttpClient.list(<FakeRequest>[ FakeRequest(azureUrl, responseError: const OSError('Connection Refused', 111)), ], )); expect(await azureDetector.isRunningOnAzure, isFalse); }); testWithoutContext('isRunningOnAzure returns true when azure metadata is reachable', () async { final AzureDetector azureDetector = AzureDetector( httpClientFactory: () => FakeHttpClient.list(<FakeRequest>[ FakeRequest(azureUrl), ], )); expect(await azureDetector.isRunningOnAzure, isTrue); }); }); }
flutter/packages/flutter_tools/test/general.shard/base/bot_detector_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/base/bot_detector_test.dart", "repo_id": "flutter", "token_count": 2578 }
765
// 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/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/terminal.dart'; import '../../src/common.dart'; import '../../src/fake_process_manager.dart'; import '../../src/fakes.dart'; void main() { group('process exceptions', () { late FakeProcessManager fakeProcessManager; late ProcessUtils processUtils; setUp(() { fakeProcessManager = FakeProcessManager.empty(); processUtils = ProcessUtils( processManager: fakeProcessManager, logger: BufferLogger.test(), ); }); testWithoutContext('runAsync throwOnError: exceptions should be ProcessException objects', () async { fakeProcessManager.addCommand(const FakeCommand( command: <String>[ 'false', ], exitCode: 1, )); expect( () async => processUtils.run(<String>['false'], throwOnError: true), throwsProcessException(message: 'Process exited abnormally with exit code 1'), ); }); }); group('shutdownHooks', () { testWithoutContext('runInExpectedOrder', () async { int i = 1; int? cleanup; final ShutdownHooks shutdownHooks = ShutdownHooks(); shutdownHooks.addShutdownHook(() async { cleanup = i++; }); await shutdownHooks.runShutdownHooks(BufferLogger.test()); expect(cleanup, 1); }); }); group('output formatting', () { late FakeProcessManager processManager; late ProcessUtils processUtils; late BufferLogger logger; setUp(() { processManager = FakeProcessManager.empty(); logger = BufferLogger.test(); processUtils = ProcessUtils( processManager: processManager, logger: logger, ); }); testWithoutContext('Command output is not wrapped.', () async { final List<String> testString = <String>['0123456789' * 10]; processManager.addCommand(FakeCommand( command: const <String>['command'], stdout: testString.join(), stderr: testString.join(), )); await processUtils.stream(<String>['command']); expect(logger.statusText, equals('${testString[0]}\n')); expect(logger.errorText, equals('${testString[0]}\n')); }); testWithoutContext('Command output is filtered by mapFunction', () async { processManager.addCommand(const FakeCommand( command: <String>['command'], stdout: 'match\nno match', stderr: 'match\nno match', )); await processUtils.stream(<String>['command'], mapFunction: (String line) { if (line == 'match') { return line; } return null; }); expect(logger.statusText, equals('match\n')); expect(logger.errorText, equals('match\n')); }); }); group('run', () { late FakeProcessManager fakeProcessManager; late ProcessUtils processUtils; setUp(() { fakeProcessManager = FakeProcessManager.empty(); processUtils = ProcessUtils( processManager: fakeProcessManager, logger: BufferLogger.test(), ); }); testWithoutContext(' succeeds on success', () async { fakeProcessManager.addCommand(const FakeCommand( command: <String>[ 'whoohoo', ], )); expect((await processUtils.run(<String>['whoohoo'])).exitCode, 0); }); testWithoutContext(' fails on failure', () async { fakeProcessManager.addCommand(const FakeCommand( command: <String>[ 'boohoo', ], exitCode: 1, )); expect((await processUtils.run(<String>['boohoo'])).exitCode, 1); }); testWithoutContext(' throws on failure with throwOnError', () async { fakeProcessManager.addCommand(const FakeCommand( command: <String>[ 'kaboom', ], exitCode: 1, )); expect(() => processUtils.run(<String>['kaboom'], throwOnError: true), throwsProcessException()); }); testWithoutContext(' does not throw on allowed Failures', () async { fakeProcessManager.addCommand(const FakeCommand( command: <String>[ 'kaboom', ], exitCode: 1, )); expect( (await processUtils.run( <String>['kaboom'], throwOnError: true, allowedFailures: (int c) => c == 1, )).exitCode, 1, ); }); testWithoutContext(' throws on disallowed failure', () async { fakeProcessManager.addCommand(const FakeCommand( command: <String>[ 'kaboom', ], exitCode: 2, )); expect( () => processUtils.run( <String>['kaboom'], throwOnError: true, allowedFailures: (int c) => c == 1, ), throwsProcessException(), ); }); }); group('runSync', () { late FakeProcessManager fakeProcessManager; late ProcessUtils processUtils; late BufferLogger testLogger; setUp(() { fakeProcessManager = FakeProcessManager.empty(); testLogger = BufferLogger( terminal: AnsiTerminal( stdio: FakeStdio(), platform: FakePlatform(), ), outputPreferences: OutputPreferences(wrapText: true, wrapColumn: 40), ); processUtils = ProcessUtils( processManager: fakeProcessManager, logger: testLogger, ); }); testWithoutContext(' succeeds on success', () async { fakeProcessManager.addCommand(const FakeCommand( command: <String>[ 'whoohoo', ], )); expect(processUtils.runSync(<String>['whoohoo']).exitCode, 0); }); testWithoutContext(' fails on failure', () async { fakeProcessManager.addCommand(const FakeCommand( command: <String>[ 'boohoo', ], exitCode: 1, )); expect(processUtils.runSync(<String>['boohoo']).exitCode, 1); }); testWithoutContext('throws on failure with throwOnError', () async { const String stderr = 'Something went wrong.'; fakeProcessManager.addCommand(const FakeCommand( command: <String>[ 'kaboom', ], exitCode: 1, stderr: stderr, )); expect( () => processUtils.runSync(<String>['kaboom'], throwOnError: true), throwsA(isA<ProcessException>().having( (ProcessException error) => error.message, 'message', isNot(contains(stderr)), )), ); }); testWithoutContext('throws with stderr in exception on failure with verboseExceptions', () async { const String stderr = 'Something went wrong.'; fakeProcessManager.addCommand(const FakeCommand( command: <String>[ 'verybad', ], exitCode: 1, stderr: stderr, )); expect( () => processUtils.runSync( <String>['verybad'], throwOnError: true, verboseExceptions: true, ), throwsProcessException(message: stderr), ); }); testWithoutContext(' does not throw on allowed Failures', () async { fakeProcessManager.addCommand(const FakeCommand( command: <String>[ 'kaboom', ], exitCode: 1, )); expect( processUtils.runSync( <String>['kaboom'], throwOnError: true, allowedFailures: (int c) => c == 1, ).exitCode, 1); }); testWithoutContext(' throws on disallowed failure', () async { fakeProcessManager.addCommand(const FakeCommand( command: <String>[ 'kaboom', ], exitCode: 2, )); expect( () => processUtils.runSync( <String>['kaboom'], throwOnError: true, allowedFailures: (int c) => c == 1, ), throwsProcessException(), ); }); testWithoutContext(' prints stdout and stderr to trace on success', () async { fakeProcessManager.addCommand(const FakeCommand( command: <String>[ 'whoohoo', ], stdout: 'stdout', stderr: 'stderr', )); expect(processUtils.runSync(<String>['whoohoo']).exitCode, 0); expect(testLogger.traceText, contains('stdout')); expect(testLogger.traceText, contains('stderr')); }); testWithoutContext(' prints stdout to status and stderr to error on failure with throwOnError', () async { fakeProcessManager.addCommand(const FakeCommand( command: <String>[ 'kaboom', ], exitCode: 1, stdout: 'stdout', stderr: 'stderr', )); expect(() => processUtils.runSync(<String>['kaboom'], throwOnError: true), throwsProcessException()); expect(testLogger.statusText, contains('stdout')); expect(testLogger.errorText, contains('stderr')); }); testWithoutContext(' does not print stdout with hideStdout', () async { fakeProcessManager.addCommand(const FakeCommand( command: <String>[ 'whoohoo', ], stdout: 'stdout', stderr: 'stderr', )); expect(processUtils.runSync(<String>['whoohoo'], hideStdout: true).exitCode, 0); expect(testLogger.traceText.contains('stdout'), isFalse); expect(testLogger.traceText, contains('stderr')); }); }); group('exitsHappySync', () { late FakeProcessManager processManager; late ProcessUtils processUtils; setUp(() { processManager = FakeProcessManager.empty(); processUtils = ProcessUtils( processManager: processManager, logger: BufferLogger.test(), ); }); testWithoutContext('succeeds on success', () async { processManager.addCommand(const FakeCommand( command: <String>['whoohoo'], )); expect(processUtils.exitsHappySync(<String>['whoohoo']), isTrue); }); testWithoutContext('fails on failure', () async { processManager.addCommand(const FakeCommand( command: <String>['boohoo'], exitCode: 1, )); expect(processUtils.exitsHappySync(<String>['boohoo']), isFalse); }); testWithoutContext('catches Exception and returns false', () { processManager.addCommand(const FakeCommand( command: <String>['boohoo'], exception: ProcessException('Process failed', <String>[]), )); expect(processUtils.exitsHappySync(<String>['boohoo']), isFalse); }); testWithoutContext('does not throw Exception and returns false if binary cannot run', () { processManager.excludedExecutables.add('nonesuch'); expect(processUtils.exitsHappySync(<String>['nonesuch']), isFalse); }); testWithoutContext('does not catch ArgumentError', () async { processManager.addCommand(FakeCommand( command: const <String>['invalid'], exception: ArgumentError('Bad input'), )); expect( () => processUtils.exitsHappySync(<String>['invalid']), throwsArgumentError, ); }); }); group('exitsHappy', () { late FakeProcessManager processManager; late ProcessUtils processUtils; setUp(() { processManager = FakeProcessManager.empty(); processUtils = ProcessUtils( processManager: processManager, logger: BufferLogger.test(), ); }); testWithoutContext('succeeds on success', () async { processManager.addCommand(const FakeCommand( command: <String>['whoohoo'] )); expect(await processUtils.exitsHappy(<String>['whoohoo']), isTrue); }); testWithoutContext('fails on failure', () async { processManager.addCommand(const FakeCommand( command: <String>['boohoo'], exitCode: 1, )); expect(await processUtils.exitsHappy(<String>['boohoo']), isFalse); }); testWithoutContext('catches Exception and returns false', () async { processManager.addCommand(const FakeCommand( command: <String>['boohoo'], exception: ProcessException('Process failed', <String>[]) )); expect(await processUtils.exitsHappy(<String>['boohoo']), isFalse); }); testWithoutContext('does not throw Exception and returns false if binary cannot run', () async { processManager.excludedExecutables.add('nonesuch'); expect(await processUtils.exitsHappy(<String>['nonesuch']), isFalse); }); testWithoutContext('does not catch ArgumentError', () async { processManager.addCommand(FakeCommand( command: const <String>['invalid'], exception: ArgumentError('Bad input') )); expect( () async => processUtils.exitsHappy(<String>['invalid']), throwsArgumentError, ); }); }); }
flutter/packages/flutter_tools/test/general.shard/base/process_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/base/process_test.dart", "repo_id": "flutter", "token_count": 5371 }
766
// 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:collection/collection.dart' show IterableExtension; import 'package:file/memory.dart'; import 'package:file_testing/file_testing.dart'; import 'package:flutter_tools/src/artifacts.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/platform.dart'; import 'package:flutter_tools/src/base/user_messages.dart'; import 'package:flutter_tools/src/build_info.dart'; import 'package:flutter_tools/src/build_system/build_system.dart'; import 'package:flutter_tools/src/build_system/depfile.dart'; import 'package:flutter_tools/src/build_system/targets/assets.dart'; import 'package:flutter_tools/src/cache.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 '../../../src/common.dart'; import '../../../src/context.dart'; import '../../../src/fake_process_manager.dart'; void main() { late Environment environment; late FileSystem fileSystem; late BufferLogger logger; setUp(() { fileSystem = MemoryFileSystem.test(); environment = Environment.test( fileSystem.currentDirectory, processManager: FakeProcessManager.any(), artifacts: Artifacts.test(), fileSystem: fileSystem, logger: BufferLogger.test(), platform: FakePlatform(), defines: <String, String>{}, ); fileSystem.file(environment.buildDir.childFile('app.dill')).createSync(recursive: true); fileSystem.file('packages/flutter_tools/lib/src/build_system/targets/assets.dart') .createSync(recursive: true); fileSystem.file('assets/foo/bar.png') .createSync(recursive: true); fileSystem.file('assets/wildcard/#bar.png') .createSync(recursive: true); fileSystem.file('.packages') .createSync(); fileSystem.file('pubspec.yaml') ..createSync() ..writeAsStringSync(''' name: example flutter: assets: - assets/foo/bar.png - assets/wildcard/ '''); logger = BufferLogger.test(); }); testUsingContext('includes LICENSE file inputs in dependencies', () async { fileSystem.file('.packages') .writeAsStringSync('foo:file:///bar/lib'); fileSystem.file('bar/LICENSE') ..createSync(recursive: true) ..writeAsStringSync('THIS IS A LICENSE'); await const CopyAssets().build(environment); final File depfile = environment.buildDir.childFile('flutter_assets.d'); expect(depfile, exists); final Depfile dependencies = environment.depFileService.parse(depfile); expect( dependencies.inputs.firstWhereOrNull((File file) => file.path == '/bar/LICENSE'), isNotNull, ); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('Copies files to correct asset directory', () async { await const CopyAssets().build(environment); expect(fileSystem.file('${environment.buildDir.path}/flutter_assets/AssetManifest.json'), exists); expect(fileSystem.file('${environment.buildDir.path}/flutter_assets/FontManifest.json'), exists); expect(fileSystem.file('${environment.buildDir.path}/flutter_assets/NOTICES.Z'), exists); // See https://github.com/flutter/flutter/issues/35293 expect(fileSystem.file('${environment.buildDir.path}/flutter_assets/assets/foo/bar.png'), exists); // See https://github.com/flutter/flutter/issues/46163 expect(fileSystem.file('${environment.buildDir.path}/flutter_assets/assets/wildcard/%23bar.png'), exists); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), }); group("Only copies assets with a flavor if the assets' flavor matches the flavor in the environment", () { testUsingContext('When the environment does not have a flavor defined', () async { fileSystem.file('pubspec.yaml') ..createSync() ..writeAsStringSync(''' name: example flutter: assets: - assets/common/ - path: assets/vanilla/ flavors: - vanilla - path: assets/strawberry/ flavors: - strawberry '''); fileSystem.file('assets/common/image.png').createSync(recursive: true); fileSystem.file('assets/vanilla/ice-cream.png').createSync(recursive: true); fileSystem.file('assets/strawberry/ice-cream.png').createSync(recursive: true); await const CopyAssets().build(environment); expect(fileSystem.file('${environment.buildDir.path}/flutter_assets/assets/common/image.png'), exists); expect(fileSystem.file('${environment.buildDir.path}/flutter_assets/assets/vanilla/ice-cream.png'), isNot(exists)); expect(fileSystem.file('${environment.buildDir.path}/flutter_assets/assets/strawberry/ice-cream.png'), isNot(exists)); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('When the environment has a flavor defined', () async { environment.defines[kFlavor] = 'strawberry'; fileSystem.file('pubspec.yaml') ..createSync() ..writeAsStringSync(''' name: example flutter: assets: - assets/common/ - path: assets/vanilla/ flavors: - vanilla - path: assets/strawberry/ flavors: - strawberry '''); fileSystem.file('assets/common/image.png').createSync(recursive: true); fileSystem.file('assets/vanilla/ice-cream.png').createSync(recursive: true); fileSystem.file('assets/strawberry/ice-cream.png').createSync(recursive: true); await const CopyAssets().build(environment); expect(fileSystem.file('${environment.buildDir.path}/flutter_assets/assets/common/image.png'), exists); expect(fileSystem.file('${environment.buildDir.path}/flutter_assets/assets/vanilla/ice-cream.png'), isNot(exists)); expect(fileSystem.file('${environment.buildDir.path}/flutter_assets/assets/strawberry/ice-cream.png'), exists); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), }); }); testUsingContext('transforms assets declared with transformers', () async { Cache.flutterRoot = Cache.defaultFlutterRoot( platform: globals.platform, fileSystem: fileSystem, userMessages: UserMessages(), ); final Environment environment = Environment.test( fileSystem.currentDirectory, processManager: globals.processManager, artifacts: Artifacts.test(), fileSystem: fileSystem, logger: logger, platform: globals.platform, defines: <String, String>{}, ); await fileSystem.file('.packages').create(); fileSystem.file('pubspec.yaml') ..createSync() ..writeAsStringSync(''' name: example flutter: assets: - path: input.txt transformers: - package: my_capitalizer_transformer args: ["-a", "-b", "--color", "green"] '''); fileSystem.file('input.txt') ..createSync(recursive: true) ..writeAsStringSync('abc'); await const CopyAssets().build(environment); expect(logger.errorText, isEmpty); expect(globals.processManager, hasNoRemainingExpectations); expect(fileSystem.file('${environment.buildDir.path}/flutter_assets/input.txt'), exists); }, overrides: <Type, Generator> { Logger: () => logger, FileSystem: () => fileSystem, Platform: () => FakePlatform(), ProcessManager: () => FakeProcessManager.list( <FakeCommand>[ FakeCommand( command: <Pattern>[ Artifacts.test().getArtifactPath(Artifact.engineDartBinary), 'run', 'my_capitalizer_transformer', RegExp('--input=.*'), RegExp('--output=.*'), '-a', '-b', '--color', 'green', ], onRun: (List<String> args) { final ArgResults parsedArgs = (ArgParser() ..addOption('input') ..addOption('output') ..addOption('color') ..addFlag('aaa', abbr: 'a') ..addFlag('bbb', abbr: 'b')) .parse(args); expect(parsedArgs['aaa'], true); expect(parsedArgs['bbb'], true); expect(parsedArgs['color'], 'green'); final File input = fileSystem.file(parsedArgs['input'] as String); expect(input, exists); final String inputContents = input.readAsStringSync(); expect(inputContents, 'abc'); fileSystem.file(parsedArgs['output']) ..createSync() ..writeAsStringSync(inputContents.toUpperCase()); }, ), ], ), }); testUsingContext('exits tool if an asset transformation fails', () async { Cache.flutterRoot = Cache.defaultFlutterRoot( platform: globals.platform, fileSystem: fileSystem, userMessages: UserMessages(), ); final Environment environment = Environment.test( fileSystem.currentDirectory, processManager: globals.processManager, artifacts: Artifacts.test(), fileSystem: fileSystem, logger: logger, platform: globals.platform, defines: <String, String>{}, ); await fileSystem.file('.packages').create(); fileSystem.file('pubspec.yaml') ..createSync() ..writeAsStringSync(''' name: example flutter: assets: - path: input.txt transformers: - package: my_transformer args: ["-a", "-b", "--color", "green"] '''); await fileSystem.file('input.txt').create(recursive: true); await expectToolExitLater( const CopyAssets().build(environment), startsWith('User-defined transformation of asset "/input.txt" failed.\n'), ); expect(globals.processManager, hasNoRemainingExpectations); }, overrides: <Type, Generator> { Logger: () => logger, FileSystem: () => fileSystem, Platform: () => FakePlatform(), ProcessManager: () => FakeProcessManager.list( <FakeCommand>[ FakeCommand( command: <Pattern>[ Artifacts.test().getArtifactPath(Artifact.engineDartBinary), 'run', 'my_transformer', RegExp('--input=.*'), RegExp('--output=.*'), '-a', '-b', '--color', 'green', ], exitCode: 1, ), ], ), }); testUsingContext('Throws exception if pubspec contains missing files', () async { fileSystem.file('pubspec.yaml') ..createSync() ..writeAsStringSync(''' name: example flutter: assets: - assets/foo/bar2.png '''); expect(() async => const CopyAssets().build(environment), throwsException); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), }); testWithoutContext('processSkSLBundle returns null if there is no path ' 'to the bundle', () { expect(processSkSLBundle( null, targetPlatform: TargetPlatform.android, fileSystem: MemoryFileSystem.test(), logger: logger, ), isNull); }); testWithoutContext('processSkSLBundle throws exception if bundle file is ' 'missing', () { expect(() => processSkSLBundle( 'does_not_exist.sksl', targetPlatform: TargetPlatform.android, fileSystem: MemoryFileSystem.test(), logger: logger, ), throwsException); }); testWithoutContext('processSkSLBundle throws exception if the bundle is not ' 'valid JSON', () { final FileSystem fileSystem = MemoryFileSystem.test(); final BufferLogger logger = BufferLogger.test(); fileSystem.file('bundle.sksl').writeAsStringSync('{'); expect(() => processSkSLBundle( 'bundle.sksl', targetPlatform: TargetPlatform.android, fileSystem: fileSystem, logger: logger, ), throwsException); expect(logger.errorText, contains('was not a JSON object')); }); testWithoutContext('processSkSLBundle throws exception if the bundle is not ' 'a JSON object', () { final FileSystem fileSystem = MemoryFileSystem.test(); final BufferLogger logger = BufferLogger.test(); fileSystem.file('bundle.sksl').writeAsStringSync('[]'); expect(() => processSkSLBundle( 'bundle.sksl', targetPlatform: TargetPlatform.android, fileSystem: fileSystem, logger: logger, ), throwsException); expect(logger.errorText, contains('was not a JSON object')); }); testWithoutContext('processSkSLBundle throws an exception if the engine ' 'revision is different', () { final FileSystem fileSystem = MemoryFileSystem.test(); final BufferLogger logger = BufferLogger.test(); fileSystem.file('bundle.sksl').writeAsStringSync(json.encode( <String, String>{ 'engineRevision': '1', }, )); expect(() => processSkSLBundle( 'bundle.sksl', targetPlatform: TargetPlatform.android, fileSystem: fileSystem, logger: logger, engineVersion: '2', ), throwsException); expect(logger.errorText, contains('Expected Flutter 1, but found 2')); }); testWithoutContext('processSkSLBundle warns if the bundle target platform is ' 'different from the current target', () async { final FileSystem fileSystem = MemoryFileSystem.test(); final BufferLogger logger = BufferLogger.test(); fileSystem.file('bundle.sksl').writeAsStringSync(json.encode( <String, Object>{ 'engineRevision': '2', 'platform': 'fuchsia-arm64', 'data': <String, Object>{}, } )); final DevFSContent content = processSkSLBundle( 'bundle.sksl', targetPlatform: TargetPlatform.android, fileSystem: fileSystem, logger: logger, engineVersion: '2', )!; expect(await content.contentsAsBytes(), utf8.encode('{"data":{}}')); expect(logger.errorText, contains('This may lead to less efficient shader caching')); }); testWithoutContext('processSkSLBundle does not warn and produces bundle', () async { final FileSystem fileSystem = MemoryFileSystem.test(); final BufferLogger logger = BufferLogger.test(); fileSystem.file('bundle.sksl').writeAsStringSync(json.encode( <String, Object>{ 'engineRevision': '2', 'platform': 'android', 'data': <String, Object>{}, }, )); final DevFSContent content = processSkSLBundle( 'bundle.sksl', targetPlatform: TargetPlatform.android, fileSystem: fileSystem, logger: logger, engineVersion: '2', )!; expect(await content.contentsAsBytes(), utf8.encode('{"data":{}}')); expect(logger.errorText, isEmpty); }); }
flutter/packages/flutter_tools/test/general.shard/build_system/targets/assets_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/build_system/targets/assets_test.dart", "repo_id": "flutter", "token_count": 5772 }
767
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:args/command_runner.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/commands/channel.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/version.dart'; import '../src/common.dart'; import '../src/context.dart'; import '../src/fake_process_manager.dart'; import '../src/fakes.dart' show FakeFlutterVersion; import '../src/test_flutter_command_runner.dart'; void main() { group('channel', () { late FakeProcessManager fakeProcessManager; setUp(() { fakeProcessManager = FakeProcessManager.empty(); }); setUpAll(() { Cache.disableLocking(); }); Future<void> simpleChannelTest(List<String> args) async { fakeProcessManager.addCommands(const <FakeCommand>[ FakeCommand( command: <String>['git', 'branch', '-r'], stdout: ' origin/branch-1\n' ' origin/branch-2\n' ' origin/master\n' ' origin/main\n' ' origin/stable\n' ' origin/beta', ), ]); final ChannelCommand command = ChannelCommand(); final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(args); expect(testLogger.errorText, hasLength(0)); // The bots may return an empty list of channels (network hiccup?) // and when run locally the list of branches might be different // so we check for the header text rather than any specific channel name. expect( testLogger.statusText, containsIgnoringWhitespace('Flutter channels:'), ); } testUsingContext('list', () async { await simpleChannelTest(<String>['channel']); }, overrides: <Type, Generator>{ ProcessManager: () => fakeProcessManager, FileSystem: () => MemoryFileSystem.test(), }); testUsingContext('verbose list', () async { await simpleChannelTest(<String>['channel', '-v']); }, overrides: <Type, Generator>{ ProcessManager: () => fakeProcessManager, FileSystem: () => MemoryFileSystem.test(), }); testUsingContext('sorted by stability', () async { final ChannelCommand command = ChannelCommand(); final CommandRunner<void> runner = createTestCommandRunner(command); fakeProcessManager.addCommand( const FakeCommand( command: <String>['git', 'branch', '-r'], stdout: 'origin/beta\n' 'origin/master\n' 'origin/main\n' 'origin/stable\n', ), ); await runner.run(<String>['channel']); expect(fakeProcessManager, hasNoRemainingExpectations); expect(testLogger.errorText, hasLength(0)); expect(testLogger.statusText, 'Flutter channels:\n' '* master (latest development branch, for contributors)\n' ' main (latest development branch, follows master channel)\n' ' beta (updated monthly, recommended for experienced users)\n' ' stable (updated quarterly, for new users and for production app releases)\n', ); // clear buffer for next process testLogger.clear(); // Extra branches. fakeProcessManager.addCommand( const FakeCommand( command: <String>['git', 'branch', '-r'], stdout: 'origin/beta\n' 'origin/master\n' 'origin/dependabot/bundler\n' 'origin/main\n' 'origin/v1.4.5-hotfixes\n' 'origin/stable\n', ), ); await runner.run(<String>['channel']); expect(fakeProcessManager, hasNoRemainingExpectations); expect(testLogger.errorText, hasLength(0)); expect(testLogger.statusText, 'Flutter channels:\n' '* master (latest development branch, for contributors)\n' ' main (latest development branch, follows master channel)\n' ' beta (updated monthly, recommended for experienced users)\n' ' stable (updated quarterly, for new users and for production app releases)\n', ); // clear buffer for next process testLogger.clear(); // Missing branches. fakeProcessManager.addCommand( const FakeCommand( command: <String>['git', 'branch', '-r'], stdout: 'origin/master\n' 'origin/dependabot/bundler\n' 'origin/v1.4.5-hotfixes\n' 'origin/stable\n' 'origin/beta\n', ), ); await runner.run(<String>['channel']); expect(fakeProcessManager, hasNoRemainingExpectations); expect(testLogger.errorText, hasLength(0)); // check if available official channels are in order of stability int prev = -1; int next = -1; for (final String branch in kOfficialChannels) { next = testLogger.statusText.indexOf(branch); if (next != -1) { expect(prev < next, isTrue); prev = next; } } }, overrides: <Type, Generator>{ ProcessManager: () => fakeProcessManager, FileSystem: () => MemoryFileSystem.test(), }); testUsingContext('ignores lines with unexpected output', () async { fakeProcessManager.addCommand( const FakeCommand( command: <String>['git', 'branch', '-r'], stdout: 'origin/beta\n' 'origin/stable\n' 'upstream/beta\n' 'upstream/stable\n' 'foo', ), ); final ChannelCommand command = ChannelCommand(); final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['channel']); expect(fakeProcessManager, hasNoRemainingExpectations); expect(testLogger.errorText, hasLength(0)); expect(testLogger.statusText, 'Flutter channels:\n' '* beta (updated monthly, recommended for experienced users)\n' ' stable (updated quarterly, for new users and for production app releases)\n' ); }, overrides: <Type, Generator>{ ProcessManager: () => fakeProcessManager, FileSystem: () => MemoryFileSystem.test(), FlutterVersion: () => FakeFlutterVersion(branch: 'beta'), }); testUsingContext('handles custom branches', () async { fakeProcessManager.addCommand( const FakeCommand( command: <String>['git', 'branch', '-r'], stdout: 'origin/beta\n' 'origin/stable\n' 'origin/foo', ), ); final ChannelCommand command = ChannelCommand(); final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['channel']); expect(fakeProcessManager, hasNoRemainingExpectations); expect(testLogger.errorText, hasLength(0)); expect(testLogger.statusText, 'Flutter channels:\n' ' beta (updated monthly, recommended for experienced users)\n' ' stable (updated quarterly, for new users and for production app releases)\n' '* foo\n' '\n' 'Currently not on an official channel.\n', ); }, overrides: <Type, Generator>{ ProcessManager: () => fakeProcessManager, FileSystem: () => MemoryFileSystem.test(), FlutterVersion: () => FakeFlutterVersion(branch: 'foo'), }); testUsingContext('removes duplicates', () async { fakeProcessManager.addCommand( const FakeCommand( command: <String>['git', 'branch', '-r'], stdout: 'origin/beta\n' 'origin/stable\n' 'upstream/beta\n' 'upstream/stable\n', ), ); final ChannelCommand command = ChannelCommand(); final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['channel']); expect(fakeProcessManager, hasNoRemainingExpectations); expect(testLogger.errorText, hasLength(0)); expect(testLogger.statusText, 'Flutter channels:\n' '* beta (updated monthly, recommended for experienced users)\n' ' stable (updated quarterly, for new users and for production app releases)\n' ); }, overrides: <Type, Generator>{ ProcessManager: () => fakeProcessManager, FileSystem: () => MemoryFileSystem.test(), FlutterVersion: () => FakeFlutterVersion(branch: 'beta'), }); testUsingContext('can switch channels', () async { fakeProcessManager.addCommands(const <FakeCommand>[ FakeCommand( command: <String>['git', 'fetch'], ), FakeCommand( command: <String>['git', 'show-ref', '--verify', '--quiet', 'refs/heads/beta'], ), FakeCommand( command: <String>['git', 'checkout', 'beta', '--'] ), FakeCommand( command: <String>['bin/flutter', '--no-color', '--no-version-check', 'precache'], ), ]); final ChannelCommand command = ChannelCommand(); final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['channel', 'beta']); expect(fakeProcessManager, hasNoRemainingExpectations); expect( testLogger.statusText, containsIgnoringWhitespace("Switching to flutter channel 'beta'..."), ); expect(testLogger.errorText, hasLength(0)); fakeProcessManager.addCommands(const <FakeCommand>[ FakeCommand( command: <String>['git', 'fetch'], ), FakeCommand( command: <String>['git', 'show-ref', '--verify', '--quiet', 'refs/heads/stable'], ), FakeCommand( command: <String>['git', 'checkout', 'stable', '--'], ), FakeCommand( command: <String>['bin/flutter', '--no-color', '--no-version-check', 'precache'], ), ]); await runner.run(<String>['channel', 'stable']); expect(fakeProcessManager, hasNoRemainingExpectations); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => fakeProcessManager, }); testUsingContext('switching channels prompts to run flutter upgrade', () async { fakeProcessManager.addCommands(const <FakeCommand>[ FakeCommand( command: <String>['git', 'fetch'], ), FakeCommand( command: <String>['git', 'show-ref', '--verify', '--quiet', 'refs/heads/beta'], ), FakeCommand( command: <String>['git', 'checkout', 'beta', '--'] ), FakeCommand( command: <String>['bin/flutter', '--no-color', '--no-version-check', 'precache'], ), ]); final ChannelCommand command = ChannelCommand(); final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['channel', 'beta']); expect( testLogger.statusText, containsIgnoringWhitespace("Successfully switched to flutter channel 'beta'."), ); expect( testLogger.statusText, containsIgnoringWhitespace( "To ensure that you're on the latest build " "from this channel, run 'flutter upgrade'"), ); expect(testLogger.errorText, hasLength(0)); expect(fakeProcessManager, hasNoRemainingExpectations); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => fakeProcessManager, }); // This verifies that bug https://github.com/flutter/flutter/issues/21134 // doesn't return. testUsingContext('removes version stamp file when switching channels', () async { fakeProcessManager.addCommands(const <FakeCommand>[ FakeCommand( command: <String>['git', 'fetch'], ), FakeCommand( command: <String>['git', 'show-ref', '--verify', '--quiet', 'refs/heads/beta'], ), FakeCommand( command: <String>['git', 'checkout', 'beta', '--'] ), FakeCommand( command: <String>['bin/flutter', '--no-color', '--no-version-check', 'precache'], ), ]); final File versionCheckFile = globals.cache.getStampFileFor( VersionCheckStamp.flutterVersionCheckStampFile, ); /// Create a bogus "leftover" version check file to make sure it gets /// removed when the channel changes. The content doesn't matter. versionCheckFile.createSync(recursive: true); versionCheckFile.writeAsStringSync(''' { "lastTimeVersionWasChecked": "2151-08-29 10:17:30.763802", "lastKnownRemoteVersion": "2151-09-26 15:56:19.000Z" } '''); final ChannelCommand command = ChannelCommand(); final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['channel', 'beta']); expect(testLogger.statusText, isNot(contains('A new version of Flutter'))); expect(testLogger.errorText, hasLength(0)); expect(versionCheckFile.existsSync(), isFalse); expect(fakeProcessManager, hasNoRemainingExpectations); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => fakeProcessManager, }); }); }
flutter/packages/flutter_tools/test/general.shard/channel_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/channel_test.dart", "repo_id": "flutter", "token_count": 5508 }
768
// 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/commands/create_base.dart'; import '../src/common.dart'; void main() { test('Validates Pub package name', () { expect(isValidPackageName('is'), false); expect(isValidPackageName('92'), false); expect(isValidPackageName('a-b-c'), false); expect(isValidPackageName('foo_bar'), true); expect(isValidPackageName('_foo_bar'), true); expect(isValidPackageName('fizz93'), true); expect(isValidPackageName('Foo_bar'), false); }); test('Suggests a valid Pub package name', () { expect(potentialValidPackageName('92'), '_92'); expect(potentialValidPackageName('a-b-c'), 'a_b_c'); expect(potentialValidPackageName('Foo_bar'), 'foo_bar'); expect(potentialValidPackageName('foo-_bar'), 'foo__bar'); expect(potentialValidPackageName('잘못된 이름'), isNull, reason: 'It should return null if it cannot find a valid name.'); }); test('kWindowsDrivePattern', () { expect(CreateBase.kWindowsDrivePattern.hasMatch(r'D:\'), isFalse); expect(CreateBase.kWindowsDrivePattern.hasMatch(r'z:\'), isFalse); expect(CreateBase.kWindowsDrivePattern.hasMatch(r'\d:'), isFalse); expect(CreateBase.kWindowsDrivePattern.hasMatch(r'ef:'), isFalse); expect(CreateBase.kWindowsDrivePattern.hasMatch(r'D:'), isTrue); expect(CreateBase.kWindowsDrivePattern.hasMatch(r'c:'), isTrue); }); }
flutter/packages/flutter_tools/test/general.shard/create_config_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/create_config_test.dart", "repo_id": "flutter", "token_count": 535 }
769
// 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/io.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/devtools_launcher.dart'; import 'package:flutter_tools/src/resident_runner.dart'; import '../src/common.dart'; import '../src/fake_process_manager.dart'; import '../src/fakes.dart'; void main() { late BufferLogger logger; Cache.flutterRoot = ''; setUp(() { logger = BufferLogger.test(); }); testWithoutContext('DevtoolsLauncher launches DevTools from the SDK and saves the URI', () async { final Completer<void> completer = Completer<void>(); final DevtoolsLauncher launcher = DevtoolsServerLauncher( dartExecutable: 'dart', logger: logger, botDetector: const FakeBotDetector(false), processManager: FakeProcessManager.list(<FakeCommand>[ FakeCommand( command: const <String>[ 'dart', 'devtools', '--no-launch-browser', ], stdout: 'Serving DevTools at http://127.0.0.1:9100\n', completer: completer, ), ]), ); final DevToolsServerAddress? address = await launcher.serve(); expect(address?.host, '127.0.0.1'); expect(address?.port, 9100); }); testWithoutContext('DevtoolsLauncher does not launch a new DevTools instance if one is already active', () async { final Completer<void> completer = Completer<void>(); final DevtoolsLauncher launcher = DevtoolsServerLauncher( dartExecutable: 'dart', logger: logger, botDetector: const FakeBotDetector(false), processManager: FakeProcessManager.list(<FakeCommand>[ FakeCommand( command: const <String>[ 'dart', 'devtools', '--no-launch-browser', ], stdout: 'Serving DevTools at http://127.0.0.1:9100\n', completer: completer, ), ]), ); DevToolsServerAddress? address = await launcher.serve(); expect(address?.host, '127.0.0.1'); expect(address?.port, 9100); // Call `serve` again and verify that the already running server is returned. address = await launcher.serve(); expect(address?.host, '127.0.0.1'); expect(address?.port, 9100); }); testWithoutContext('DevtoolsLauncher can launch devtools with a memory profile', () async { final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ const FakeCommand( command: <String>[ 'dart', 'devtools', '--no-launch-browser', '--vm-uri=localhost:8181/abcdefg', '--profile-memory=foo', ], stdout: 'Serving DevTools at http://127.0.0.1:9100\n', ), ]); final DevtoolsLauncher launcher = DevtoolsServerLauncher( dartExecutable: 'dart', logger: logger, botDetector: const FakeBotDetector(false), processManager: processManager, ); await launcher.launch(Uri.parse('localhost:8181/abcdefg'), additionalArguments: <String>['--profile-memory=foo']); expect(launcher.processStart, completes); expect(processManager, hasNoRemainingExpectations); }); testWithoutContext('DevtoolsLauncher prints error if exception is thrown during launch', () async { final DevtoolsLauncher launcher = DevtoolsServerLauncher( dartExecutable: 'dart', logger: logger, botDetector: const FakeBotDetector(false), processManager: FakeProcessManager.list(<FakeCommand>[ const FakeCommand( command: <String>[ 'dart', 'devtools', '--no-launch-browser', '--vm-uri=http://127.0.0.1:1234/abcdefg', ], exception: ProcessException('pub', <String>[]), ), ]), ); await launcher.launch(Uri.parse('http://127.0.0.1:1234/abcdefg')); expect(logger.errorText, contains('Failed to launch DevTools: ProcessException')); }); testWithoutContext('DevtoolsLauncher handles failure of DevTools process on a bot', () async { final Completer<void> completer = Completer<void>(); final DevtoolsServerLauncher launcher = DevtoolsServerLauncher( dartExecutable: 'dart', logger: logger, botDetector: const FakeBotDetector(true), processManager: FakeProcessManager.list(<FakeCommand>[ FakeCommand( command: const <String>[ 'dart', 'devtools', '--no-launch-browser', ], stdout: 'Serving DevTools at http://127.0.0.1:9100\n', completer: completer, exitCode: 255, ), ]), ); await launcher.launch(null); completer.complete(); expect(launcher.devToolsProcessExit, throwsToolExit()); }); }
flutter/packages/flutter_tools/test/general.shard/devtools_launcher_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/devtools_launcher_test.dart", "repo_id": "flutter", "token_count": 2012 }
770
// 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/fuchsia/fuchsia_kernel_compiler.dart'; import '../../src/common.dart'; void main() { group('Fuchsia Kernel Compiler', () { test('provide correct flags for release mode', () { expect( FuchsiaKernelCompiler.getBuildInfoFlags( buildInfo: BuildInfo.release, manifestPath: '', ), allOf(<Matcher>[ contains('-Ddart.vm.profile=false'), contains('-Ddart.vm.product=true'), ])); }); test('provide correct flags for profile mode', () { expect( FuchsiaKernelCompiler.getBuildInfoFlags( buildInfo: BuildInfo.profile, manifestPath: '', ), allOf(<Matcher>[ contains('-Ddart.vm.profile=true'), contains('-Ddart.vm.product=false'), ]), ); }); test('provide correct flags for custom dart define', () { expect( FuchsiaKernelCompiler.getBuildInfoFlags( buildInfo: const BuildInfo( BuildMode.debug, null, treeShakeIcons: true, dartDefines: <String>['abc=efg'], ), manifestPath: ''), allOf(<Matcher>[ contains('-Dabc=efg'), ])); }); }); }
flutter/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_kernel_compiler_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_kernel_compiler_test.dart", "repo_id": "flutter", "token_count": 680 }
771
// 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/logger.dart'; import 'package:flutter_tools/src/ios/devices.dart'; import '../../src/common.dart'; import '../../src/fake_process_manager.dart'; import '../../src/fakes.dart'; const Map<String, String> kDyLdLibEntry = <String, String>{ 'DYLD_LIBRARY_PATH': '/path/to/libs', }; void main() { // By default, the .forward() method will try every port between 1024 // and 65535; this test verifies we are killing iproxy processes when // we timeout on a port testWithoutContext('IOSDevicePortForwarder.forward will kill iproxy processes before invoking a second', () async { final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ // iproxy does not exit with 0 when it cannot forward; // the FakeCommands below expect an exitCode of 0. const FakeCommand( command: <String>['iproxy', '12345:456', '--udid', '1234'], environment: kDyLdLibEntry, // Empty stdout indicates failure. ), const FakeCommand( command: <String>['iproxy', '12346:456', '--udid', '1234'], stdout: 'not empty', environment: kDyLdLibEntry, ), ]); final FakeOperatingSystemUtils operatingSystemUtils = FakeOperatingSystemUtils(); final IOSDevicePortForwarder portForwarder = IOSDevicePortForwarder.test( processManager: processManager, logger: BufferLogger.test(), operatingSystemUtils: operatingSystemUtils, ); final int hostPort = await portForwarder.forward(456); // First port tried (12345) should fail, then succeed on the next expect(hostPort, 12345 + 1); expect(processManager, hasNoRemainingExpectations); }); }
flutter/packages/flutter_tools/test/general.shard/ios/ios_device_port_forwarder_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/ios/ios_device_port_forwarder_test.dart", "repo_id": "flutter", "token_count": 646 }
772
// 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:file_testing/file_testing.dart'; import 'package:flutter_tools/src/artifacts.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/platform.dart'; import 'package:flutter_tools/src/build_info.dart'; import 'package:flutter_tools/src/build_system/build_system.dart'; import 'package:flutter_tools/src/features.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/isolated/native_assets/ios/native_assets.dart'; import 'package:native_assets_cli/native_assets_cli_internal.dart' hide BuildMode, Target; import 'package:native_assets_cli/native_assets_cli_internal.dart' as native_assets_cli; import 'package:package_config/package_config_types.dart'; import '../../../src/common.dart'; import '../../../src/context.dart'; import '../../../src/fakes.dart'; import '../fake_native_assets_build_runner.dart'; void main() { late FakeProcessManager processManager; late Environment environment; late Artifacts artifacts; late FileSystem fileSystem; late BufferLogger logger; late Uri projectUri; setUp(() { processManager = FakeProcessManager.empty(); logger = BufferLogger.test(); artifacts = Artifacts.test(); fileSystem = MemoryFileSystem.test(); environment = Environment.test( fileSystem.currentDirectory, inputs: <String, String>{}, artifacts: artifacts, processManager: processManager, fileSystem: fileSystem, logger: logger, ); environment.buildDir.createSync(recursive: true); projectUri = environment.projectDir.uri; }); testUsingContext('dry run with no package config', overrides: <Type, Generator>{ ProcessManager: () => FakeProcessManager.empty(), }, () async { expect( await dryRunNativeAssetsIOS( projectUri: projectUri, fileSystem: fileSystem, buildRunner: FakeNativeAssetsBuildRunner( hasPackageConfigResult: false, ), ), null, ); expect( (globals.logger as BufferLogger).traceText, contains('No package config found. Skipping native assets compilation.'), ); }); testUsingContext('build with no package config', overrides: <Type, Generator>{ ProcessManager: () => FakeProcessManager.empty(), }, () async { await buildNativeAssetsIOS( darwinArchs: <DarwinArch>[DarwinArch.arm64], environmentType: EnvironmentType.simulator, projectUri: projectUri, buildMode: BuildMode.debug, fileSystem: fileSystem, yamlParentDirectory: environment.buildDir.uri, buildRunner: FakeNativeAssetsBuildRunner( hasPackageConfigResult: false, ), ); expect( (globals.logger as BufferLogger).traceText, contains('No package config found. Skipping native assets compilation.'), ); }); testUsingContext('dry run with assets but not enabled', overrides: <Type, Generator>{ ProcessManager: () => FakeProcessManager.empty(), }, () async { final File packageConfig = environment.projectDir.childFile('.dart_tool/package_config.json'); await packageConfig.parent.create(); await packageConfig.create(); expect( () => dryRunNativeAssetsIOS( projectUri: projectUri, fileSystem: fileSystem, buildRunner: FakeNativeAssetsBuildRunner( packagesWithNativeAssetsResult: <Package>[ Package('bar', projectUri), ], ), ), throwsToolExit( message: 'Package(s) bar require the native assets feature to be enabled. ' 'Enable using `flutter config --enable-native-assets`.', ), ); }); testUsingContext('dry run with assets', overrides: <Type, Generator>{ FeatureFlags: () => TestFeatureFlags(isNativeAssetsEnabled: true), ProcessManager: () => FakeProcessManager.empty(), }, () async { final File packageConfig = environment.projectDir.childFile('.dart_tool/package_config.json'); await packageConfig.parent.create(); await packageConfig.create(); final Uri? nativeAssetsYaml = await dryRunNativeAssetsIOS( projectUri: projectUri, fileSystem: fileSystem, buildRunner: FakeNativeAssetsBuildRunner( packagesWithNativeAssetsResult: <Package>[ Package('bar', projectUri), ], dryRunResult: FakeNativeAssetsBuilderResult( assets: <Asset>[ Asset( id: 'package:bar/bar.dart', linkMode: LinkMode.dynamic, target: native_assets_cli.Target.macOSArm64, path: AssetAbsolutePath(Uri.file('libbar.dylib')), ), Asset( id: 'package:bar/bar.dart', linkMode: LinkMode.dynamic, target: native_assets_cli.Target.macOSX64, path: AssetAbsolutePath(Uri.file('libbar.dylib')), ), ], ), ), ); expect( (globals.logger as BufferLogger).traceText, stringContainsInOrder(<String>[ 'Dry running native assets for ios.', 'Dry running native assets for ios done.', ]), ); expect( nativeAssetsYaml, projectUri.resolve('build/native_assets/ios/native_assets.yaml'), ); expect( await fileSystem.file(nativeAssetsYaml).readAsString(), contains('package:bar/bar.dart'), ); }); testUsingContext('build with assets but not enabled', () async { final File packageConfig = environment.projectDir.childFile('.dart_tool/package_config.json'); await packageConfig.parent.create(); await packageConfig.create(); expect( () => buildNativeAssetsIOS( darwinArchs: <DarwinArch>[DarwinArch.arm64], environmentType: EnvironmentType.simulator, projectUri: projectUri, buildMode: BuildMode.debug, fileSystem: fileSystem, yamlParentDirectory: environment.buildDir.uri, buildRunner: FakeNativeAssetsBuildRunner( packagesWithNativeAssetsResult: <Package>[ Package('bar', projectUri), ], ), ), throwsToolExit( message: 'Package(s) bar require the native assets feature to be enabled. ' 'Enable using `flutter config --enable-native-assets`.', ), ); }); testUsingContext('build no assets', overrides: <Type, Generator>{ FeatureFlags: () => TestFeatureFlags(isNativeAssetsEnabled: true), ProcessManager: () => FakeProcessManager.empty(), }, () async { final File packageConfig = environment.projectDir.childFile('.dart_tool/package_config.json'); await packageConfig.parent.create(); await packageConfig.create(); await buildNativeAssetsIOS( darwinArchs: <DarwinArch>[DarwinArch.arm64], environmentType: EnvironmentType.simulator, projectUri: projectUri, buildMode: BuildMode.debug, fileSystem: fileSystem, yamlParentDirectory: environment.buildDir.uri, buildRunner: FakeNativeAssetsBuildRunner( packagesWithNativeAssetsResult: <Package>[ Package('bar', projectUri), ], ), ); expect( environment.buildDir.childFile('native_assets.yaml'), exists, ); }); testUsingContext('build with assets', overrides: <Type, Generator>{ FeatureFlags: () => TestFeatureFlags(isNativeAssetsEnabled: true), ProcessManager: () => FakeProcessManager.list( <FakeCommand>[ const FakeCommand( command: <Pattern>[ 'lipo', '-create', '-output', '/build/native_assets/ios/bar.framework/bar', 'arm64/libbar.dylib', 'x64/libbar.dylib', ], ), const FakeCommand( command: <Pattern>[ 'install_name_tool', '-id', '@rpath/bar.framework/bar', '/build/native_assets/ios/bar.framework/bar' ], ), const FakeCommand( command: <Pattern>[ 'codesign', '--force', '--sign', '-', '--timestamp=none', '/build/native_assets/ios/bar.framework', ], ), ], ), }, () async { if (const LocalPlatform().isWindows) { return; // Backslashes in commands, but we will never run these commands on Windows. } final File packageConfig = environment.projectDir.childFile('.dart_tool/package_config.json'); await packageConfig.parent.create(); await packageConfig.create(); await buildNativeAssetsIOS( darwinArchs: <DarwinArch>[DarwinArch.arm64, DarwinArch.x86_64], environmentType: EnvironmentType.simulator, projectUri: projectUri, buildMode: BuildMode.debug, fileSystem: fileSystem, yamlParentDirectory: environment.buildDir.uri, buildRunner: FakeNativeAssetsBuildRunner( packagesWithNativeAssetsResult: <Package>[ Package('bar', projectUri), ], onBuild: (native_assets_cli.Target target) => FakeNativeAssetsBuilderResult( assets: <Asset>[ Asset( id: 'package:bar/bar.dart', linkMode: LinkMode.dynamic, target: target, path: AssetAbsolutePath(Uri.file('${target.architecture}/libbar.dylib')), ), ], ), ), ); expect( (globals.logger as BufferLogger).traceText, stringContainsInOrder(<String>[ 'Building native assets for [ios_arm64, ios_x64] debug.', 'Building native assets for [ios_arm64, ios_x64] done.', ]), ); expect( environment.buildDir.childFile('native_assets.yaml'), exists, ); }); testUsingContext('Native assets dry run error', overrides: <Type, Generator>{ FeatureFlags: () => TestFeatureFlags(isNativeAssetsEnabled: true), ProcessManager: () => FakeProcessManager.empty(), }, () async { final File packageConfig = environment.projectDir.childFile('.dart_tool/package_config.json'); await packageConfig.parent.create(); await packageConfig.create(); expect( () => dryRunNativeAssetsIOS( projectUri: projectUri, fileSystem: fileSystem, buildRunner: FakeNativeAssetsBuildRunner( packagesWithNativeAssetsResult: <Package>[ Package('bar', projectUri), ], dryRunResult: const FakeNativeAssetsBuilderResult( success: false, ), ), ), throwsToolExit( message: 'Building native assets failed. See the logs for more details.', ), ); }); testUsingContext('Native assets build error', overrides: <Type, Generator>{ FeatureFlags: () => TestFeatureFlags(isNativeAssetsEnabled: true), ProcessManager: () => FakeProcessManager.empty(), }, () async { final File packageConfig = environment.projectDir.childFile('.dart_tool/package_config.json'); await packageConfig.parent.create(); await packageConfig.create(); expect( () => buildNativeAssetsIOS( darwinArchs: <DarwinArch>[DarwinArch.arm64], environmentType: EnvironmentType.simulator, projectUri: projectUri, buildMode: BuildMode.debug, fileSystem: fileSystem, yamlParentDirectory: environment.buildDir.uri, buildRunner: FakeNativeAssetsBuildRunner( packagesWithNativeAssetsResult: <Package>[ Package('bar', projectUri), ], buildResult: const FakeNativeAssetsBuilderResult( success: false, ), ), ), throwsToolExit( message: 'Building native assets failed. See the logs for more details.', ), ); }); }
flutter/packages/flutter_tools/test/general.shard/isolated/ios/native_assets_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/isolated/ios/native_assets_test.dart", "repo_id": "flutter", "token_count": 4857 }
773
// 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/macos/macos_workflow.dart'; import '../../src/common.dart'; import '../../src/fakes.dart'; final FakePlatform macOS = FakePlatform( operatingSystem: 'macos', ); final FakePlatform linux = FakePlatform(); void main() { testWithoutContext('Applies to macOS platform', () { final MacOSWorkflow macOSWorkflow = MacOSWorkflow( platform: macOS, featureFlags: TestFeatureFlags(isMacOSEnabled: true), ); expect(macOSWorkflow.appliesToHostPlatform, true); expect(macOSWorkflow.canListDevices, true); expect(macOSWorkflow.canLaunchDevices, true); expect(macOSWorkflow.canListEmulators, false); }); testWithoutContext('Does not apply to non-macOS platform', () { final MacOSWorkflow macOSWorkflow = MacOSWorkflow( platform: linux, featureFlags: TestFeatureFlags(isMacOSEnabled: true), ); expect(macOSWorkflow.appliesToHostPlatform, false); expect(macOSWorkflow.canListDevices, false); expect(macOSWorkflow.canLaunchDevices, false); expect(macOSWorkflow.canListEmulators, false); }); testWithoutContext('Does not apply when feature is disabled', () { final MacOSWorkflow macOSWorkflow = MacOSWorkflow( platform: macOS, featureFlags: TestFeatureFlags(), ); expect(macOSWorkflow.appliesToHostPlatform, false); expect(macOSWorkflow.canListDevices, false); expect(macOSWorkflow.canLaunchDevices, false); expect(macOSWorkflow.canListEmulators, false); }); }
flutter/packages/flutter_tools/test/general.shard/macos/macos_workflow_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/macos/macos_workflow_test.dart", "repo_id": "flutter", "token_count": 578 }
774
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'dart:io'; import 'dart:typed_data'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/application_package.dart'; import 'package:flutter_tools/src/base/dds.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/utils.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/proxied_devices/file_transfer.dart'; import 'package:test/fake.dart'; import '../../src/common.dart'; import '../../src/fake_devices.dart'; void main() { late BufferLogger bufferLogger; late DaemonConnection serverDaemonConnection; late DaemonConnection clientDaemonConnection; setUp(() { bufferLogger = BufferLogger.test(); 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); }); tearDown(() async { await serverDaemonConnection.dispose(); await clientDaemonConnection.dispose(); }); group('ProxiedPortForwarder', () { testWithoutContext('works correctly without device id', () async { final FakeServerSocket fakeServerSocket = FakeServerSocket(200); final ProxiedPortForwarder portForwarder = ProxiedPortForwarder( clientDaemonConnection, logger: bufferLogger, createSocketServer: (Logger logger, int? hostPort, bool? ipv6) async => fakeServerSocket, ); final int result = await portForwarder.forward(100); expect(result, 200); final FakeSocket fakeSocket = FakeSocket(); fakeServerSocket.controller.add(fakeSocket); final Stream<DaemonMessage> broadcastOutput = serverDaemonConnection.incomingCommands.asBroadcastStream(); DaemonMessage message = await broadcastOutput.first; expect(message.data['id'], isNotNull); expect(message.data['method'], 'proxy.connect'); expect(message.data['params'], <String, Object?>{'port': 100}); const String id = 'random_id'; serverDaemonConnection.sendResponse(message.data['id']!, id); // Forwards the data received from socket to daemon. fakeSocket.controller.add(Uint8List.fromList(<int>[1, 2, 3])); message = await broadcastOutput.first; expect(message.data['method'], 'proxy.write'); expect(message.data['params'], <String, Object?>{'id': id}); expect(message.binary, isNotNull); final List<List<int>> binary = await message.binary!.toList(); expect(binary, <List<int>>[<int>[1, 2, 3]]); // Forwards data received as event to socket. expect(fakeSocket.addedData.isEmpty, true); serverDaemonConnection.sendEvent('proxy.data.$id', null, <int>[4, 5, 6]); await pumpEventQueue(); expect(fakeSocket.addedData.isNotEmpty, true); expect(fakeSocket.addedData[0], <int>[4, 5, 6]); // Closes the socket after the remote end disconnects expect(fakeSocket.closeCalled, false); serverDaemonConnection.sendEvent('proxy.disconnected.$id'); await pumpEventQueue(); expect(fakeSocket.closeCalled, true); }); testWithoutContext('handles errors', () async { final FakeServerSocket fakeServerSocket = FakeServerSocket(200); final ProxiedPortForwarder portForwarder = ProxiedPortForwarder( FakeDaemonConnection( handledRequests: <String, Object?>{ 'proxy.connect': '1', // id }, ), logger: bufferLogger, createSocketServer: (Logger logger, int? hostPort, bool? ipv6) async => fakeServerSocket, ); final int result = await portForwarder.forward(100); expect(result, 200); final FakeSocket fakeSocket = FakeSocket(); fakeServerSocket.controller.add(fakeSocket); fakeSocket.controller.add(Uint8List.fromList(<int>[1, 2, 3])); await pumpEventQueue(); }); testWithoutContext('forwards the port from the remote end with device id', () async { final FakeServerSocket fakeServerSocket = FakeServerSocket(400); final ProxiedPortForwarder portForwarder = ProxiedPortForwarder( clientDaemonConnection, deviceId: 'device_id', logger: bufferLogger, createSocketServer: (Logger logger, int? hostPort, bool? ipv6) async => fakeServerSocket, ); final Stream<DaemonMessage> broadcastOutput = serverDaemonConnection.incomingCommands.asBroadcastStream(); final Future<int> result = portForwarder.forward(300); DaemonMessage message = await broadcastOutput.first; expect(message.data['id'], isNotNull); expect(message.data['method'], 'device.forward'); expect(message.data['params'], <String, Object?>{'deviceId': 'device_id', 'devicePort': 300}); serverDaemonConnection.sendResponse(message.data['id']!, <String, Object?>{'hostPort': 350}); expect(await result, 400); final FakeSocket fakeSocket = FakeSocket(); fakeServerSocket.controller.add(fakeSocket); message = await broadcastOutput.first; expect(message.data['id'], isNotNull); expect(message.data['method'], 'proxy.connect'); expect(message.data['params'], <String, Object?>{'port': 350}); const String id = 'random_id'; serverDaemonConnection.sendResponse(message.data['id']!, id); // Unforward will try to disconnect the remote port. portForwarder.forwardedPorts.single.dispose(); expect(fakeServerSocket.closeCalled, true); message = await broadcastOutput.first; expect(message.data['id'], isNotNull); expect(message.data['method'], 'device.unforward'); expect(message.data['params'], <String, Object?>{ 'deviceId': 'device_id', 'devicePort': 300, 'hostPort': 350, }); }); group('socket done', () { late Stream<DaemonMessage> broadcastOutput; late FakeSocket fakeSocket; const String id = 'random_id'; setUp(() async { final FakeServerSocket fakeServerSocket = FakeServerSocket(400); final ProxiedPortForwarder portForwarder = ProxiedPortForwarder( clientDaemonConnection, deviceId: 'device_id', logger: bufferLogger, createSocketServer: (Logger logger, int? hostPort, bool? ipv6) async => fakeServerSocket, ); broadcastOutput = serverDaemonConnection.incomingCommands.asBroadcastStream(); unawaited(portForwarder.forward(300)); // Consumes the message. DaemonMessage message = await broadcastOutput.first; serverDaemonConnection.sendResponse(message.data['id']!, <String, Object?>{'hostPort': 350}); fakeSocket = FakeSocket(); fakeServerSocket.controller.add(fakeSocket); // Consumes the message. message = await broadcastOutput.first; serverDaemonConnection.sendResponse(message.data['id']!, id); // Pump the event queue so that the socket future error handler has a // chance to be listened to. await pumpEventQueue(); }); testWithoutContext('without error, should calls proxy.disconnect', () async { // It will try to disconnect the remote port when socket is done. fakeSocket.doneCompleter.complete(true); final DaemonMessage message = await broadcastOutput.first; expect(message.data['id'], isNotNull); expect(message.data['method'], 'proxy.disconnect'); expect(message.data['params'], <String, Object?>{ 'id': 'random_id', }); }); testWithoutContext('with error, should also calls proxy.disconnect', () async { fakeSocket.doneCompleter.complete(true); final DaemonMessage message = await broadcastOutput.first; expect(message.data['id'], isNotNull); expect(message.data['method'], 'proxy.disconnect'); expect(message.data['params'], <String, Object?>{ 'id': 'random_id', }); // Send an error response and make sure that it won't crash the client. serverDaemonConnection.sendErrorResponse(message.data['id']!, 'some error', StackTrace.current); // Wait the event queue and make sure that it doesn't crash. await pumpEventQueue(); }); }); testWithoutContext('disposes multiple sockets correctly', () async { final FakeServerSocket fakeServerSocket = FakeServerSocket(200); final ProxiedPortForwarder portForwarder = ProxiedPortForwarder( clientDaemonConnection, logger: bufferLogger, createSocketServer: (Logger logger, int? hostPort, bool? ipv6) async => fakeServerSocket, ); final int result = await portForwarder.forward(100); expect(result, 200); final FakeSocket fakeSocket1 = FakeSocket(); final FakeSocket fakeSocket2 = FakeSocket(); fakeServerSocket.controller.add(fakeSocket1); fakeServerSocket.controller.add(fakeSocket2); final Stream<DaemonMessage> broadcastOutput = serverDaemonConnection.incomingCommands.asBroadcastStream(); final DaemonMessage message1 = await broadcastOutput.first; expect(message1.data['id'], isNotNull); expect(message1.data['method'], 'proxy.connect'); expect(message1.data['params'], <String, Object?>{'port': 100}); const String id1 = 'random_id1'; serverDaemonConnection.sendResponse(message1.data['id']!, id1); final DaemonMessage message2 = await broadcastOutput.first; expect(message2.data['id'], isNotNull); expect(message2.data['id'], isNot(message1.data['id'])); expect(message2.data['method'], 'proxy.connect'); expect(message2.data['params'], <String, Object?>{'port': 100}); const String id2 = 'random_id2'; serverDaemonConnection.sendResponse(message2.data['id']!, id2); await pumpEventQueue(); // Closes the socket after port forwarder dispose. expect(fakeSocket1.closeCalled, false); expect(fakeSocket2.closeCalled, false); await portForwarder.dispose(); expect(fakeSocket1.closeCalled, true); expect(fakeSocket2.closeCalled, true); }); }); final Map<String, Object> fakeDevice = <String, Object>{ 'name': 'device-name', 'id': 'device-id', 'category': 'mobile', 'platformType': 'android', 'platform': 'android-arm', 'emulator': true, 'ephemeral': false, 'sdk': 'Test SDK (1.2.3)', 'capabilities': <String, Object>{ 'hotReload': true, 'hotRestart': true, 'screenshot': false, 'fastStart': false, 'flutterExit': true, 'hardwareRendering': true, 'startPaused': true, }, }; final Map<String, Object> fakeDevice2 = <String, Object>{ 'name': 'device-name2', 'id': 'device-id2', 'category': 'mobile', 'platformType': 'android', 'platform': 'android-arm', 'emulator': true, 'ephemeral': false, 'sdk': 'Test SDK (1.2.3)', 'capabilities': <String, Object>{ 'hotReload': true, 'hotRestart': true, 'screenshot': false, 'fastStart': false, 'flutterExit': true, 'hardwareRendering': true, 'startPaused': true, }, }; group('ProxiedDevice', () { testWithoutContext('calls stopApp without application package if not passed', () async { bufferLogger = BufferLogger.test(); final ProxiedDevices proxiedDevices = ProxiedDevices( clientDaemonConnection, logger: bufferLogger, ); final ProxiedDevice device = proxiedDevices.deviceFromDaemonResult(fakeDevice); unawaited(device.stopApp(null, userIdentifier: 'user-id')); final DaemonMessage message = await serverDaemonConnection.incomingCommands.first; expect(message.data['id'], isNotNull); expect(message.data['method'], 'device.stopApp'); expect(message.data['params'], <String, Object?>{'deviceId': 'device-id', 'userIdentifier': 'user-id'}); }); group('when launching an app with PrebuiltApplicationPackage', () { late MemoryFileSystem fileSystem; late FakePrebuiltApplicationPackage applicationPackage; const List<int> fileContent = <int>[100, 120, 140]; setUp(() { fileSystem = MemoryFileSystem.test() ..directory('dir').createSync() ..file('dir/foo').writeAsBytesSync(fileContent); applicationPackage = FakePrebuiltApplicationPackage(fileSystem.file('dir/foo')); }); testWithoutContext('transfers file to the daemon', () async { bufferLogger = BufferLogger.test(); final ProxiedDevices proxiedDevices = ProxiedDevices( clientDaemonConnection, logger: bufferLogger, deltaFileTransfer: false, ); final ProxiedDevice device = proxiedDevices.deviceFromDaemonResult(fakeDevice); final Stream<DaemonMessage> broadcastOutput = serverDaemonConnection.incomingCommands.asBroadcastStream(); final Future<String> resultFuture = device.applicationPackageId(applicationPackage); // Send proxy.writeTempFile. final DaemonMessage writeTempFileMessage = await broadcastOutput.first; expect(writeTempFileMessage.data['id'], isNotNull); expect(writeTempFileMessage.data['method'], 'proxy.writeTempFile'); expect(writeTempFileMessage.data['params'], <String, Object?>{ 'path': 'foo', }); expect(await writeTempFileMessage.binary?.first, fileContent); serverDaemonConnection.sendResponse(writeTempFileMessage.data['id']!); // Send device.uploadApplicationPackage. final DaemonMessage uploadApplicationPackageMessage = await broadcastOutput.first; expect(uploadApplicationPackageMessage.data['id'], isNotNull); expect(uploadApplicationPackageMessage.data['method'], 'device.uploadApplicationPackage'); expect(uploadApplicationPackageMessage.data['params'], <String, Object?>{ 'targetPlatform': 'android-arm', 'applicationBinary': 'foo', }); serverDaemonConnection.sendResponse(uploadApplicationPackageMessage.data['id']!, 'test_id'); expect(await resultFuture, 'test_id'); }); testWithoutContext('transfers file to the daemon with delta turned on, file not exist on remote', () async { bufferLogger = BufferLogger.test(); final FakeFileTransfer fileTransfer = FakeFileTransfer(); final ProxiedDevices proxiedDevices = ProxiedDevices( clientDaemonConnection, logger: bufferLogger, fileTransfer: fileTransfer, ); final ProxiedDevice device = proxiedDevices.deviceFromDaemonResult(fakeDevice); final Stream<DaemonMessage> broadcastOutput = serverDaemonConnection.incomingCommands.asBroadcastStream(); final Future<String> resultFuture = device.applicationPackageId(applicationPackage); // Send proxy.calculateFileHashes. final DaemonMessage calculateFileHashesMessage = await broadcastOutput.first; expect(calculateFileHashesMessage.data['id'], isNotNull); expect(calculateFileHashesMessage.data['method'], 'proxy.calculateFileHashes'); expect(calculateFileHashesMessage.data['params'], <String, Object?>{ 'path': 'foo', }); serverDaemonConnection.sendResponse(calculateFileHashesMessage.data['id']!); // Send proxy.writeTempFile. final DaemonMessage writeTempFileMessage = await broadcastOutput.first; expect(writeTempFileMessage.data['id'], isNotNull); expect(writeTempFileMessage.data['method'], 'proxy.writeTempFile'); expect(writeTempFileMessage.data['params'], <String, Object?>{ 'path': 'foo', }); expect(await writeTempFileMessage.binary?.first, fileContent); serverDaemonConnection.sendResponse(writeTempFileMessage.data['id']!); // Send device.uploadApplicationPackage. final DaemonMessage uploadApplicationPackageMessage = await broadcastOutput.first; expect(uploadApplicationPackageMessage.data['id'], isNotNull); expect(uploadApplicationPackageMessage.data['method'], 'device.uploadApplicationPackage'); expect(uploadApplicationPackageMessage.data['params'], <String, Object?>{ 'targetPlatform': 'android-arm', 'applicationBinary': 'foo', }); serverDaemonConnection.sendResponse(uploadApplicationPackageMessage.data['id']!, 'test_id'); expect(await resultFuture, 'test_id'); }); testWithoutContext('transfers file to the daemon with delta turned on, file exists on remote', () async { bufferLogger = BufferLogger.test(); final FakeFileTransfer fileTransfer = FakeFileTransfer(); const BlockHashes blockHashes = BlockHashes( blockSize: 10, totalSize: 30, adler32: <int>[1, 2, 3], md5: <String>['a', 'b', 'c'], fileMd5: 'abc', ); const List<FileDeltaBlock> deltaBlocks = <FileDeltaBlock>[ FileDeltaBlock.fromSource(start: 10, size: 10), FileDeltaBlock.fromDestination(start: 30, size: 40), ]; fileTransfer.binary = Uint8List.fromList(<int>[11, 12, 13]); fileTransfer.delta = deltaBlocks; final ProxiedDevices proxiedDevices = ProxiedDevices( clientDaemonConnection, logger: bufferLogger, fileTransfer: fileTransfer, ); final ProxiedDevice device = proxiedDevices.deviceFromDaemonResult(fakeDevice); final Stream<DaemonMessage> broadcastOutput = serverDaemonConnection.incomingCommands.asBroadcastStream(); final Future<String> resultFuture = device.applicationPackageId(applicationPackage); // Send proxy.calculateFileHashes. final DaemonMessage calculateFileHashesMessage = await broadcastOutput.first; expect(calculateFileHashesMessage.data['id'], isNotNull); expect(calculateFileHashesMessage.data['method'], 'proxy.calculateFileHashes'); expect(calculateFileHashesMessage.data['params'], <String, Object?>{ 'path': 'foo', }); serverDaemonConnection.sendResponse(calculateFileHashesMessage.data['id']!, blockHashes.toJson()); // Send proxy.updateFile. final DaemonMessage updateFileMessage = await broadcastOutput.first; expect(updateFileMessage.data['id'], isNotNull); expect(updateFileMessage.data['method'], 'proxy.updateFile'); expect(updateFileMessage.data['params'], <String, Object?>{ 'path': 'foo', 'delta': <Map<String, Object>>[ <String, Object>{'size': 10}, <String, Object>{'start': 30, 'size': 40}, ], }); expect(await updateFileMessage.binary?.first, <int>[11, 12, 13]); serverDaemonConnection.sendResponse(updateFileMessage.data['id']!); // Send device.uploadApplicationPackage. final DaemonMessage uploadApplicationPackageMessage = await broadcastOutput.first; expect(uploadApplicationPackageMessage.data['id'], isNotNull); expect(uploadApplicationPackageMessage.data['method'], 'device.uploadApplicationPackage'); expect(uploadApplicationPackageMessage.data['params'], <String, Object?>{ 'targetPlatform': 'android-arm', 'applicationBinary': 'foo', }); serverDaemonConnection.sendResponse(uploadApplicationPackageMessage.data['id']!, 'test_id'); expect(await resultFuture, 'test_id'); }); }); }); group('ProxiedDevices', () { testWithoutContext('devices respects the filter passed in', () async { bufferLogger = BufferLogger.test(); final ProxiedDevices proxiedDevices = ProxiedDevices( clientDaemonConnection, logger: bufferLogger, ); final FakeDeviceDiscoveryFilter fakeFilter = FakeDeviceDiscoveryFilter(); final FakeDevice supportedDevice = FakeDevice('Device', 'supported'); fakeFilter.filteredDevices = <Device>[ supportedDevice, ]; final Future<List<Device>> resultFuture = proxiedDevices.devices(filter: fakeFilter); final DaemonMessage message = await serverDaemonConnection.incomingCommands.first; expect(message.data['id'], isNotNull); expect(message.data['method'], 'device.discoverDevices'); serverDaemonConnection.sendResponse(message.data['id']!, <Map<String, Object?>>[ fakeDevice, fakeDevice2, ]); final List<Device> result = await resultFuture; expect(result.length, 1); expect(result.first.id, supportedDevice.id); expect(fakeFilter.devices!.length, 2); expect(fakeFilter.devices![0].id, fakeDevice['id']); expect(fakeFilter.devices![1].id, fakeDevice2['id']); }); testWithoutContext('publishes the devices on deviceNotifier after startPolling', () async { bufferLogger = BufferLogger.test(); final ProxiedDevices proxiedDevices = ProxiedDevices( clientDaemonConnection, logger: bufferLogger, ); proxiedDevices.startPolling(); final ItemListNotifier<Device>? deviceNotifier = proxiedDevices.deviceNotifier; expect(deviceNotifier, isNotNull); final List<Device> devicesAdded = <Device>[]; deviceNotifier!.onAdded.listen((Device device) { devicesAdded.add(device); }); final DaemonMessage message = await serverDaemonConnection.incomingCommands.first; expect(message.data['id'], isNotNull); expect(message.data['method'], 'device.discoverDevices'); serverDaemonConnection.sendResponse(message.data['id']!, <Map<String, Object?>>[ fakeDevice, fakeDevice2, ]); await pumpEventQueue(); expect(devicesAdded.length, 2); expect(devicesAdded[0].id, fakeDevice['id']); expect(devicesAdded[1].id, fakeDevice2['id']); }); testWithoutContext('handles getDiagnostics', () async { bufferLogger = BufferLogger.test(); final ProxiedDevices proxiedDevices = ProxiedDevices( clientDaemonConnection, logger: bufferLogger, ); final Future<List<String>> resultFuture = proxiedDevices.getDiagnostics(); final DaemonMessage message = await serverDaemonConnection.incomingCommands.first; expect(message.data['id'], isNotNull); expect(message.data['method'], 'device.getDiagnostics'); serverDaemonConnection.sendResponse(message.data['id']!, <String>['1', '2']); final List<String> result = await resultFuture; expect(result, <String>['1', '2']); }); testWithoutContext('returns empty result when daemon does not understand getDiagnostics', () async { bufferLogger = BufferLogger.test(); final ProxiedDevices proxiedDevices = ProxiedDevices( clientDaemonConnection, logger: bufferLogger, ); final Future<List<String>> resultFuture = proxiedDevices.getDiagnostics(); final DaemonMessage message = await serverDaemonConnection.incomingCommands.first; expect(message.data['id'], isNotNull); expect(message.data['method'], 'device.getDiagnostics'); serverDaemonConnection.sendErrorResponse(message.data['id']!, 'command not understood: device.getDiagnostics', StackTrace.current); final List<String> result = await resultFuture; expect(result, isEmpty); }); }); group('ProxiedDartDevelopmentService', () { testWithoutContext('forwards start and shutdown to remote', () async { final FakeProxiedPortForwarder portForwarder = FakeProxiedPortForwarder(); portForwarder.originalRemotePortReturnValue = 200; portForwarder.forwardReturnValue = 400; final FakeProxiedPortForwarder devicePortForwarder = FakeProxiedPortForwarder(); final ProxiedDartDevelopmentService dds = ProxiedDartDevelopmentService( clientDaemonConnection, 'test_id', logger: bufferLogger, proxiedPortForwarder: portForwarder, devicePortForwarder: devicePortForwarder, ); final Stream<DaemonMessage> broadcastOutput = serverDaemonConnection.incomingCommands.asBroadcastStream(); final Future<void> startFuture = dds.startDartDevelopmentService( Uri.parse('http://127.0.0.1:100/fake'), disableServiceAuthCodes: true, hostPort: 150, ipv6: false, logger: bufferLogger, ); final DaemonMessage startMessage = await broadcastOutput.first; expect(startMessage.data['id'], isNotNull); expect(startMessage.data['method'], 'device.startDartDevelopmentService'); expect(startMessage.data['params'], <String, Object?>{ 'deviceId': 'test_id', 'vmServiceUri': 'http://127.0.0.1:200/fake', 'disableServiceAuthCodes': true, }); serverDaemonConnection.sendResponse(startMessage.data['id']!, 'http://127.0.0.1:300/remote'); await startFuture; expect(portForwarder.receivedLocalForwardedPort, 100); expect(portForwarder.forwardedDevicePort, 300); expect(portForwarder.forwardedHostPort, 150); expect(portForwarder.forwardedIpv6, false); expect(dds.uri, Uri.parse('http://127.0.0.1:400/remote')); expect( bufferLogger.eventText.trim(), '{"name":"device.proxied_dds_forwarded","args":{"deviceId":"test_id","remoteUri":"http://127.0.0.1:300/remote","localUri":"http://127.0.0.1:400/remote"}}', ); unawaited(dds.shutdown()); final DaemonMessage shutdownMessage = await broadcastOutput.first; expect(shutdownMessage.data['id'], isNotNull); expect(shutdownMessage.data['method'], 'device.shutdownDartDevelopmentService'); expect(shutdownMessage.data['params'], <String, Object?>{ 'deviceId': 'test_id', }); }); testWithoutContext('forwards start and shutdown to remote if port was forwarded by the device port forwarder', () async { final FakeProxiedPortForwarder portForwarder = FakeProxiedPortForwarder(); portForwarder.forwardReturnValue = 400; final FakeProxiedPortForwarder devicePortForwarder = FakeProxiedPortForwarder(); devicePortForwarder.originalRemotePortReturnValue = 200; final ProxiedDartDevelopmentService dds = ProxiedDartDevelopmentService( clientDaemonConnection, 'test_id', logger: bufferLogger, proxiedPortForwarder: portForwarder, devicePortForwarder: devicePortForwarder, ); final Stream<DaemonMessage> broadcastOutput = serverDaemonConnection.incomingCommands.asBroadcastStream(); final Future<void> startFuture = dds.startDartDevelopmentService( Uri.parse('http://127.0.0.1:100/fake'), disableServiceAuthCodes: true, hostPort: 150, ipv6: false, logger: bufferLogger, ); final DaemonMessage startMessage = await broadcastOutput.first; expect(startMessage.data['id'], isNotNull); expect(startMessage.data['method'], 'device.startDartDevelopmentService'); expect(startMessage.data['params'], <String, Object?>{ 'deviceId': 'test_id', 'vmServiceUri': 'http://127.0.0.1:200/fake', 'disableServiceAuthCodes': true, }); serverDaemonConnection.sendResponse(startMessage.data['id']!, 'http://127.0.0.1:300/remote'); await startFuture; expect(portForwarder.receivedLocalForwardedPort, 100); expect(portForwarder.forwardedDevicePort, 300); expect(portForwarder.forwardedHostPort, 150); expect(portForwarder.forwardedIpv6, false); expect(dds.uri, Uri.parse('http://127.0.0.1:400/remote')); expect( bufferLogger.eventText.trim(), '{"name":"device.proxied_dds_forwarded","args":{"deviceId":"test_id","remoteUri":"http://127.0.0.1:300/remote","localUri":"http://127.0.0.1:400/remote"}}', ); unawaited(dds.shutdown()); final DaemonMessage shutdownMessage = await broadcastOutput.first; expect(shutdownMessage.data['id'], isNotNull); expect(shutdownMessage.data['method'], 'device.shutdownDartDevelopmentService'); expect(shutdownMessage.data['params'], <String, Object?>{ 'deviceId': 'test_id', }); }); testWithoutContext('starts a local dds if the VM service port is not a forwarded port', () async { final FakeProxiedPortForwarder portForwarder = FakeProxiedPortForwarder(); final FakeProxiedPortForwarder devicePortForwarder = FakeProxiedPortForwarder(); final FakeDartDevelopmentService localDds = FakeDartDevelopmentService(); localDds.uri = Uri.parse('http://127.0.0.1:450/local'); final ProxiedDartDevelopmentService dds = ProxiedDartDevelopmentService( clientDaemonConnection, 'test_id', logger: bufferLogger, proxiedPortForwarder: portForwarder, devicePortForwarder: devicePortForwarder, localDds: localDds, ); expect(localDds.startCalled, false); await dds.startDartDevelopmentService( Uri.parse('http://127.0.0.1:100/fake'), disableServiceAuthCodes: true, hostPort: 150, ipv6: false, logger: bufferLogger, ); expect(localDds.startCalled, true); expect(portForwarder.receivedLocalForwardedPort, 100); expect(portForwarder.forwardedDevicePort, null); expect(dds.uri, Uri.parse('http://127.0.0.1:450/local')); expect(localDds.shutdownCalled, false); await dds.shutdown(); expect(localDds.shutdownCalled, true); await serverDaemonConnection.dispose(); expect(await serverDaemonConnection.incomingCommands.isEmpty, true); }); testWithoutContext('starts a local dds if the remote VM does not support starting DDS', () async { final FakeProxiedPortForwarder portForwarder = FakeProxiedPortForwarder(); portForwarder.originalRemotePortReturnValue = 200; final FakeProxiedPortForwarder devicePortForwarder = FakeProxiedPortForwarder(); final FakeDartDevelopmentService localDds = FakeDartDevelopmentService(); localDds.uri = Uri.parse('http://127.0.0.1:450/local'); final ProxiedDartDevelopmentService dds = ProxiedDartDevelopmentService( clientDaemonConnection, 'test_id', logger: bufferLogger, proxiedPortForwarder: portForwarder, devicePortForwarder: devicePortForwarder, localDds: localDds, ); final Stream<DaemonMessage> broadcastOutput = serverDaemonConnection.incomingCommands.asBroadcastStream(); final Future<void> startFuture = dds.startDartDevelopmentService( Uri.parse('http://127.0.0.1:100/fake'), disableServiceAuthCodes: true, hostPort: 150, ipv6: false, logger: bufferLogger, ); expect(localDds.startCalled, false); final DaemonMessage startMessage = await broadcastOutput.first; expect(startMessage.data['id'], isNotNull); expect(startMessage.data['method'], 'device.startDartDevelopmentService'); expect(startMessage.data['params'], <String, Object?>{ 'deviceId': 'test_id', 'vmServiceUri': 'http://127.0.0.1:200/fake', 'disableServiceAuthCodes': true, }); serverDaemonConnection.sendErrorResponse(startMessage.data['id']!, 'command not understood: device.startDartDevelopmentService', StackTrace.current); await startFuture; expect(localDds.startCalled, true); expect(portForwarder.receivedLocalForwardedPort, 100); expect(portForwarder.forwardedDevicePort, null); expect(dds.uri, Uri.parse('http://127.0.0.1:450/local')); expect(localDds.shutdownCalled, false); await dds.shutdown(); expect(localDds.shutdownCalled, true); }); }); } 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 FakeServerSocket extends Fake implements ServerSocket { FakeServerSocket(this.port); @override final int port; bool closeCalled = false; final StreamController<Socket> controller = StreamController<Socket>(); @override StreamSubscription<Socket> listen( void Function(Socket event)? onData, { Function? onError, void Function()? onDone, bool? cancelOnError, }) { return controller.stream.listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError); } @override Future<ServerSocket> close() async { closeCalled = true; return this; } } class FakeSocket extends Fake implements Socket { bool closeCalled = false; final StreamController<Uint8List> controller = StreamController<Uint8List>(); final List<List<int>> addedData = <List<int>>[]; final Completer<bool> doneCompleter = Completer<bool>(); @override StreamSubscription<Uint8List> listen( void Function(Uint8List event)? onData, { Function? onError, void Function()? onDone, bool? cancelOnError, }) { return controller.stream.listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError); } @override void add(List<int> data) { addedData.add(data); } @override Future<void> close() async { closeCalled = true; doneCompleter.complete(true); } @override Future<bool> get done => doneCompleter.future; @override void destroy() {} } class FakeDaemonConnection extends Fake implements DaemonConnection { FakeDaemonConnection({ this.handledRequests = const <String, Object?>{}, this.daemonEventStreams = const <String, List<DaemonEventData>>{}, }); /// Mapping of method name to returned object from the [sendRequest] method. final Map<String, Object?> handledRequests; final Map<String, List<DaemonEventData>> daemonEventStreams; @override Stream<DaemonEventData> listenToEvent(String eventToListen) { final List<DaemonEventData>? iterable = daemonEventStreams[eventToListen]; if (iterable != null) { return Stream<DaemonEventData>.fromIterable(iterable); } return const Stream<DaemonEventData>.empty(); } @override Future<Object?> sendRequest(String method, [Object? params, List<int>? binary]) async { final Object? response = handledRequests[method]; if (response != null) { return response; } throw Exception('"$method" request failed'); } } class FakeDeviceDiscoveryFilter extends Fake implements DeviceDiscoveryFilter { List<Device>? filteredDevices; List<Device>? devices; @override Future<List<Device>> filterDevices(List<Device> devices) async { this.devices = devices; return filteredDevices!; } } class FakeProxiedPortForwarder extends Fake implements ProxiedPortForwarder { int? originalRemotePortReturnValue; int? receivedLocalForwardedPort; int? forwardReturnValue; int? forwardedDevicePort; int? forwardedHostPort; bool? forwardedIpv6; @override int? originalRemotePort(int localForwardedPort) { receivedLocalForwardedPort = localForwardedPort; return originalRemotePortReturnValue; } @override Future<int> forward(int devicePort, {int? hostPort, bool? ipv6}) async { forwardedDevicePort = devicePort; forwardedHostPort = hostPort; forwardedIpv6 = ipv6; return forwardReturnValue!; } } class FakeDartDevelopmentService extends Fake implements DartDevelopmentService { bool startCalled = false; Uri? startUri; bool shutdownCalled = false; @override Future<void> get done => _completer.future; final Completer<void> _completer = Completer<void>(); @override Uri? uri; @override Future<void> startDartDevelopmentService( Uri vmServiceUri, { required Logger logger, int? hostPort, bool? ipv6, bool? disableServiceAuthCodes, bool cacheStartupProfile = false, }) async { startCalled = true; startUri = vmServiceUri; } @override Future<void> shutdown() async => shutdownCalled = true; } class FakePrebuiltApplicationPackage extends Fake implements PrebuiltApplicationPackage { FakePrebuiltApplicationPackage(this.applicationPackage); @override final FileSystemEntity applicationPackage; } class FakeFileTransfer extends Fake implements FileTransfer { List<FileDeltaBlock>? delta; Uint8List? binary; @override Future<List<FileDeltaBlock>> computeDelta(File file, BlockHashes hashes) async => delta!; @override Future<Uint8List> binaryForRebuilding(File file, List<FileDeltaBlock> delta) async => binary!; }
flutter/packages/flutter_tools/test/general.shard/proxied_devices/proxied_devices_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/proxied_devices/proxied_devices_test.dart", "repo_id": "flutter", "token_count": 13820 }
775
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:typed_data'; import 'package:file/memory.dart'; import 'package:file_testing/file_testing.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/template.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/template.dart'; import '../src/common.dart'; import '../src/context.dart'; void main() { testWithoutContext('Template constructor throws ToolExit when source directory is missing', () { final FileExceptionHandler handler = FileExceptionHandler(); final MemoryFileSystem fileSystem = MemoryFileSystem.test(opHandle: handler.opHandle); expect(() => Template( fileSystem.directory('doesNotExist'), fileSystem.currentDirectory, fileSystem: fileSystem, logger: BufferLogger.test(), templateRenderer: FakeTemplateRenderer(), ), throwsToolExit()); }); testWithoutContext('Template.render throws ToolExit when FileSystem exception is raised', () { final FileExceptionHandler handler = FileExceptionHandler(); final MemoryFileSystem fileSystem = MemoryFileSystem.test(opHandle: handler.opHandle); final Template template = Template( fileSystem.directory('examples')..createSync(recursive: true), fileSystem.currentDirectory, fileSystem: fileSystem, logger: BufferLogger.test(), templateRenderer: FakeTemplateRenderer(), ); final Directory directory = fileSystem.directory('foo'); handler.addError(directory, FileSystemOp.create, const FileSystemException()); expect(() => template.render(directory, <String, Object>{}), throwsToolExit()); }); group('template image directory', () { final Map<Type, Generator> overrides = <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), }; const TemplatePathProvider templatePathProvider = TemplatePathProvider(); testUsingContext('templatePathProvider.imageDirectory returns parent template directory if passed null name', () async { final String packageConfigPath = globals.fs.path.join( Cache.flutterRoot!, 'packages', 'flutter_tools', '.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" } ] } '''); expect( (await templatePathProvider.imageDirectory(null, globals.fs, globals.logger)).path, globals.fs.path.absolute( 'flutter_template_images', 'templates', ), ); }, overrides: overrides); testUsingContext('templatePathProvider.imageDirectory returns the directory containing the `name` template directory', () async { final String packageConfigPath = globals.fs.path.join( Cache.flutterRoot!, 'packages', 'flutter_tools', '.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" } ] } '''); expect( (await templatePathProvider.imageDirectory('app_shared', globals.fs, globals.logger)).path, globals.fs.path.absolute( 'flutter_template_images', 'templates', 'app_shared', ), ); }, overrides: overrides); }); group('renders template', () { late Directory destination; const String imageName = 'some_image.png'; late File sourceImage; late BufferLogger logger; late Template template; setUp(() { final MemoryFileSystem fileSystem = MemoryFileSystem.test(); final Directory templateDir = fileSystem.directory('templates'); final Directory imageSourceDir = fileSystem.directory('template_images'); destination = fileSystem.directory('target'); templateDir.childFile('$imageName.img.tmpl').createSync(recursive: true); sourceImage = imageSourceDir.childFile(imageName); sourceImage.createSync(recursive: true); sourceImage.writeAsStringSync("Ceci n'est pas une pipe"); logger = BufferLogger.test(); template = Template( templateDir, imageSourceDir, fileSystem: fileSystem, logger: logger, templateRenderer: FakeTemplateRenderer(), ); }); testWithoutContext('overwrites .img.tmpl files with files from the image source', () { expect(template.render(destination, <String, Object>{}), 1); final File destinationImage = destination.childFile(imageName); final Uint8List sourceImageBytes = sourceImage.readAsBytesSync(); expect(destinationImage, exists); expect(destinationImage.readAsBytesSync(), equals(sourceImageBytes)); expect(logger.errorText, isEmpty); expect(logger.statusText, contains('${destinationImage.path} (created)')); logger.clear(); // Run it again to overwrite (returns 1 file updated). expect(template.render(destination, <String, Object>{}), 1); expect(destinationImage.readAsBytesSync(), equals(sourceImageBytes)); expect(logger.errorText, isEmpty); expect(logger.statusText, contains('${destinationImage.path} (overwritten)')); }); testWithoutContext('does not overwrite .img.tmpl files with files from the image source', () { expect(template.render(destination, <String, Object>{}), 1); final File destinationImage = destination.childFile(imageName); expect(destinationImage, exists); expect(logger.errorText, isEmpty); expect(logger.statusText, contains('${destinationImage.path} (created)')); logger.clear(); // Run it again, do not overwrite (returns 0 files updated). expect(template.render(destination, <String, Object>{}, overwriteExisting: false), 0); expect(destinationImage, exists); expect(logger.errorText, isEmpty); expect(logger.statusText, isEmpty); }); testWithoutContext('can suppress file printing', () { template.render(destination, <String, Object>{}, printStatusWhenWriting: false); final File destinationImage = destination.childFile(imageName); expect(destinationImage, exists); expect(logger.errorText, isEmpty); expect(logger.statusText, isEmpty); }); }); testWithoutContext('escapeYamlString', () { expect(escapeYamlString(''), r'""'); expect(escapeYamlString('\x00\n\r\t\b'), r'"\0\n\r\t\x08"'); expect(escapeYamlString('test'), r'"test"'); expect(escapeYamlString('test\n test'), r'"test\n test"'); expect(escapeYamlString('\x00\x01\x02\x0c\x19\xab'), r'"\0\x01\x02\x0c\x19«"'); expect(escapeYamlString('"'), r'"\""'); expect(escapeYamlString(r'\'), r'"\\"'); expect(escapeYamlString('[user branch]'), r'"[user branch]"'); expect(escapeYamlString('main'), r'"main"'); expect(escapeYamlString('TEST_BRANCH'), r'"TEST_BRANCH"'); expect(escapeYamlString(' '), r'" "'); expect(escapeYamlString(' \n '), r'" \n "'); expect(escapeYamlString('""'), r'"\"\""'); expect(escapeYamlString('"\x01\u{0263A}\u{1F642}'), r'"\"\x01☺🙂"'); }); } class FakeTemplateRenderer extends TemplateRenderer { @override String renderString(String template, dynamic context, {bool htmlEscapeValues = false}) { return ''; } }
flutter/packages/flutter_tools/test/general.shard/template_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/template_test.dart", "repo_id": "flutter", "token_count": 2922 }
776
// 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/platform.dart'; import 'package:flutter_tools/src/base/user_messages.dart'; import 'package:flutter_tools/src/base/version.dart'; import 'package:flutter_tools/src/doctor_validator.dart'; import 'package:flutter_tools/src/vscode/vscode.dart'; import 'package:flutter_tools/src/vscode/vscode_validator.dart'; import 'package:test/fake.dart'; import '../../src/common.dart'; import '../../src/context.dart'; void main() { testWithoutContext('VsCode search locations on windows supports an empty environment', () { final FileSystem fileSystem = MemoryFileSystem.test(style: FileSystemStyle.windows); final Platform platform = FakePlatform( operatingSystem: 'windows', environment: <String, String>{}, ); expect(VsCode.allInstalled(fileSystem, platform, FakeProcessManager.any()), isEmpty); }); group(VsCodeValidator, () { testUsingContext('Warns if VS Code version could not be found', () async { final VsCodeValidator validator = VsCodeValidator(_FakeVsCode()); final ValidationResult result = await validator.validate(); expect(result.messages, contains(const ValidationMessage.error('Unable to determine VS Code version.'))); expect(result.statusInfo, 'version unknown'); }, overrides: <Type, Generator>{ UserMessages: () => UserMessages(), }); }); } class _FakeVsCode extends Fake implements VsCode { @override Iterable<ValidationMessage> get validationMessages => <ValidationMessage>[]; @override String get productName => 'VS Code'; @override Version? get version => null; }
flutter/packages/flutter_tools/test/general.shard/vscode/vscode_validator_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/vscode/vscode_validator_test.dart", "repo_id": "flutter", "token_count": 599 }
777
// 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/terminal.dart'; import 'package:flutter_tools/src/cmake_project.dart'; import 'package:flutter_tools/src/windows/migrations/build_architecture_migration.dart'; import 'package:test/fake.dart'; import '../../../src/common.dart'; void main () { group('Windows Flutter build architecture migration', () { late MemoryFileSystem memoryFileSystem; late BufferLogger testLogger; late FakeWindowsProject mockProject; late File cmakeFile; late Directory buildDirectory; setUp(() { memoryFileSystem = MemoryFileSystem.test(); cmakeFile = memoryFileSystem.file('CMakeLists.txt'); buildDirectory = memoryFileSystem.directory('x64'); testLogger = BufferLogger( terminal: Terminal.test(), outputPreferences: OutputPreferences.test(), ); mockProject = FakeWindowsProject(cmakeFile); }); testWithoutContext('delete old runner directory', () { buildDirectory.createSync(); final Directory oldRunnerDirectory = buildDirectory .parent .childDirectory('runner'); oldRunnerDirectory.createSync(); final File executable = oldRunnerDirectory.childFile('program.exe'); executable.createSync(); expect(oldRunnerDirectory.existsSync(), isTrue); final BuildArchitectureMigration migration = BuildArchitectureMigration( mockProject, buildDirectory, testLogger, ); migration.migrate(); expect(oldRunnerDirectory.existsSync(), isFalse); expect(testLogger.traceText, contains( 'Deleting previous build folder ./runner.\n' 'New binaries can be found in x64/runner.\n' ) ); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if CMake file is missing', () { final BuildArchitectureMigration migration = BuildArchitectureMigration( mockProject, buildDirectory, testLogger, ); migration.migrate(); expect(cmakeFile.existsSync(), isFalse); expect(testLogger.traceText, contains('windows/flutter/CMakeLists.txt file not found, skipping build architecture migration')); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if nothing to migrate', () { const String cmakeFileContents = 'Nothing to migrate'; cmakeFile.writeAsStringSync(cmakeFileContents); final DateTime cmakeUpdatedAt = cmakeFile.lastModifiedSync(); final BuildArchitectureMigration buildArchitectureMigration = BuildArchitectureMigration( mockProject, buildDirectory, testLogger, ); buildArchitectureMigration.migrate(); expect(cmakeFile.lastModifiedSync(), cmakeUpdatedAt); expect(cmakeFile.readAsStringSync(), cmakeFileContents); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if already migrated', () { const String cmakeFileContents = '# TODO: Move the rest of this into files in ephemeral. See\n' '# https://github.com/flutter/flutter/issues/57146.\n' 'set(WRAPPER_ROOT "\${EPHEMERAL_DIR}/cpp_client_wrapper")\n' '\n' '# Set fallback configurations for older versions of the flutter tool.\n' 'if (NOT DEFINED FLUTTER_TARGET_PLATFORM)\n' ' set(FLUTTER_TARGET_PLATFORM "windows-x64")\n' 'endif()\n' '\n' '# === Flutter Library ===\n' '...\n' 'add_custom_command(\n' ' OUTPUT \${FLUTTER_LIBRARY} \${FLUTTER_LIBRARY_HEADERS}\n' ' \${CPP_WRAPPER_SOURCES_CORE} \${CPP_WRAPPER_SOURCES_PLUGIN}\n' ' \${CPP_WRAPPER_SOURCES_APP}\n' ' \${PHONY_OUTPUT}\n' ' COMMAND \${CMAKE_COMMAND} -E env\n' ' \${FLUTTER_TOOL_ENVIRONMENT}\n' ' "\${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"\n' ' \${FLUTTER_TARGET_PLATFORM} \$<CONFIG>\n' ' VERBATIM\n' ')\n'; cmakeFile.writeAsStringSync(cmakeFileContents); final DateTime cmakeUpdatedAt = cmakeFile.lastModifiedSync(); final BuildArchitectureMigration buildArchitectureMigration = BuildArchitectureMigration( mockProject, buildDirectory, testLogger, ); buildArchitectureMigration.migrate(); expect(cmakeFile.lastModifiedSync(), cmakeUpdatedAt); expect(cmakeFile.readAsStringSync(), cmakeFileContents); expect(testLogger.statusText, isEmpty); }); testWithoutContext('skipped if already migrated (CRLF)', () { const String cmakeFileContents = '# TODO: Move the rest of this into files in ephemeral. See\r\n' '# https://github.com/flutter/flutter/issues/57146.\r\n' 'set(WRAPPER_ROOT "\${EPHEMERAL_DIR}/cpp_client_wrapper")\r\n' '\r\n' '# Set fallback configurations for older versions of the flutter tool.\r\n' 'if (NOT DEFINED FLUTTER_TARGET_PLATFORM)\r\n' ' set(FLUTTER_TARGET_PLATFORM "windows-x64")\r\n' 'endif()\r\n' '\r\n' '# === Flutter Library ===\r\n' '...\r\n' 'add_custom_command(\r\n' ' OUTPUT \${FLUTTER_LIBRARY} \${FLUTTER_LIBRARY_HEADERS}\r\n' ' \${CPP_WRAPPER_SOURCES_CORE} \${CPP_WRAPPER_SOURCES_PLUGIN}\r\n' ' \${CPP_WRAPPER_SOURCES_APP}\r\n' ' \${PHONY_OUTPUT}\r\n' ' COMMAND \${CMAKE_COMMAND} -E env\r\n' ' \${FLUTTER_TOOL_ENVIRONMENT}\r\n' ' "\${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"\r\n' ' \${FLUTTER_TARGET_PLATFORM} \$<CONFIG>\r\n' ' VERBATIM\r\n' ')\r\n'; cmakeFile.writeAsStringSync(cmakeFileContents); final DateTime cmakeUpdatedAt = cmakeFile.lastModifiedSync(); final BuildArchitectureMigration buildArchitectureMigration = BuildArchitectureMigration( mockProject, buildDirectory, testLogger, ); buildArchitectureMigration.migrate(); expect(cmakeFile.lastModifiedSync(), cmakeUpdatedAt); expect(cmakeFile.readAsStringSync(), cmakeFileContents); expect(testLogger.statusText, isEmpty); }); testWithoutContext('migrates project to set the target platform', () { cmakeFile.writeAsStringSync( '# TODO: Move the rest of this into files in ephemeral. See\n' '# https://github.com/flutter/flutter/issues/57146.\n' 'set(WRAPPER_ROOT "\${EPHEMERAL_DIR}/cpp_client_wrapper")\n' '\n' '# === Flutter Library ===\n' '...\n' 'add_custom_command(\n' ' OUTPUT \${FLUTTER_LIBRARY} \${FLUTTER_LIBRARY_HEADERS}\n' ' \${CPP_WRAPPER_SOURCES_CORE} \${CPP_WRAPPER_SOURCES_PLUGIN}\n' ' \${CPP_WRAPPER_SOURCES_APP}\n' ' \${PHONY_OUTPUT}\n' ' COMMAND \${CMAKE_COMMAND} -E env\n' ' \${FLUTTER_TOOL_ENVIRONMENT}\n' ' "\${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"\n' ' windows-x64 \$<CONFIG>\n' ' VERBATIM\n' ')\n' ); final BuildArchitectureMigration buildArchitectureMigration = BuildArchitectureMigration( mockProject, buildDirectory, testLogger, ); buildArchitectureMigration.migrate(); expect(cmakeFile.readAsStringSync(), '# TODO: Move the rest of this into files in ephemeral. See\n' '# https://github.com/flutter/flutter/issues/57146.\n' 'set(WRAPPER_ROOT "\${EPHEMERAL_DIR}/cpp_client_wrapper")\n' '\n' '# Set fallback configurations for older versions of the flutter tool.\n' 'if (NOT DEFINED FLUTTER_TARGET_PLATFORM)\n' ' set(FLUTTER_TARGET_PLATFORM "windows-x64")\n' 'endif()\n' '\n' '# === Flutter Library ===\n' '...\n' 'add_custom_command(\n' ' OUTPUT \${FLUTTER_LIBRARY} \${FLUTTER_LIBRARY_HEADERS}\n' ' \${CPP_WRAPPER_SOURCES_CORE} \${CPP_WRAPPER_SOURCES_PLUGIN}\n' ' \${CPP_WRAPPER_SOURCES_APP}\n' ' \${PHONY_OUTPUT}\n' ' COMMAND \${CMAKE_COMMAND} -E env\n' ' \${FLUTTER_TOOL_ENVIRONMENT}\n' ' "\${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"\n' ' \${FLUTTER_TARGET_PLATFORM} \$<CONFIG>\n' ' VERBATIM\n' ')\n' ); expect(testLogger.statusText, contains('windows/flutter/CMakeLists.txt does not use FLUTTER_TARGET_PLATFORM, updating.')); }); testWithoutContext('migrates project to set the target platform (CRLF)', () { cmakeFile.writeAsStringSync( '# TODO: Move the rest of this into files in ephemeral. See\r\n' '# https://github.com/flutter/flutter/issues/57146.\r\n' 'set(WRAPPER_ROOT "\${EPHEMERAL_DIR}/cpp_client_wrapper")\r\n' '\r\n' '# === Flutter Library ===\r\n' '...\r\n' 'add_custom_command(\r\n' ' OUTPUT \${FLUTTER_LIBRARY} \${FLUTTER_LIBRARY_HEADERS}\r\n' ' \${CPP_WRAPPER_SOURCES_CORE} \${CPP_WRAPPER_SOURCES_PLUGIN}\r\n' ' \${CPP_WRAPPER_SOURCES_APP}\r\n' ' \${PHONY_OUTPUT}\r\n' ' COMMAND \${CMAKE_COMMAND} -E env\r\n' ' \${FLUTTER_TOOL_ENVIRONMENT}\r\n' ' "\${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"\r\n' ' windows-x64 \$<CONFIG>\r\n' ' VERBATIM\r\n' ')\r\n' ); final BuildArchitectureMigration buildArchitectureMigration = BuildArchitectureMigration( mockProject, buildDirectory, testLogger, ); buildArchitectureMigration.migrate(); expect(cmakeFile.readAsStringSync(), '# TODO: Move the rest of this into files in ephemeral. See\r\n' '# https://github.com/flutter/flutter/issues/57146.\r\n' 'set(WRAPPER_ROOT "\${EPHEMERAL_DIR}/cpp_client_wrapper")\r\n' '\r\n' '# Set fallback configurations for older versions of the flutter tool.\r\n' 'if (NOT DEFINED FLUTTER_TARGET_PLATFORM)\r\n' ' set(FLUTTER_TARGET_PLATFORM "windows-x64")\r\n' 'endif()\r\n' '\r\n' '# === Flutter Library ===\r\n' '...\r\n' 'add_custom_command(\r\n' ' OUTPUT \${FLUTTER_LIBRARY} \${FLUTTER_LIBRARY_HEADERS}\r\n' ' \${CPP_WRAPPER_SOURCES_CORE} \${CPP_WRAPPER_SOURCES_PLUGIN}\r\n' ' \${CPP_WRAPPER_SOURCES_APP}\r\n' ' \${PHONY_OUTPUT}\r\n' ' COMMAND \${CMAKE_COMMAND} -E env\r\n' ' \${FLUTTER_TOOL_ENVIRONMENT}\r\n' ' "\${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"\r\n' ' \${FLUTTER_TARGET_PLATFORM} \$<CONFIG>\r\n' ' VERBATIM\r\n' ')\r\n' ); expect(testLogger.statusText, contains('windows/flutter/CMakeLists.txt does not use FLUTTER_TARGET_PLATFORM, updating.')); }); }); } class FakeWindowsProject extends Fake implements WindowsProject { FakeWindowsProject(this.managedCmakeFile); @override final File managedCmakeFile; }
flutter/packages/flutter_tools/test/general.shard/windows/migrations/build_architecture_migration_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/windows/migrations/build_architecture_migration_test.dart", "repo_id": "flutter", "token_count": 5334 }
778
// 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_testing/file_testing.dart'; import 'package:flutter_tools/src/base/io.dart'; import '../src/common.dart'; import 'test_utils.dart'; // This test file does not use [getLocalEngineArguments] because it requires // multiple specific artifact output types. const String apkDebugMessage = 'A summary of your APK analysis can be found at: '; const String iosDebugMessage = 'A summary of your iOS bundle analysis can be found at: '; const String macOSDebugMessage = 'A summary of your macOS bundle analysis can be found at: '; const String runDevToolsMessage = 'dart devtools '; void main() { testWithoutContext('--analyze-size flag produces expected output on hello_world for Android', () async { final String workingDirectory = fileSystem.path.join(getFlutterRoot(), 'examples', 'hello_world'); final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter'); final ProcessResult result = await processManager.run(<String>[ flutterBin, 'build', 'apk', '--verbose', '--analyze-size', '--target-platform=android-arm64', ], workingDirectory: workingDirectory); expect( result, const ProcessResultMatcher(stdoutPattern: 'app-release.apk (total compressed)'), ); final String line = result.stdout.toString() .split('\n') .firstWhere((String line) => line.contains(apkDebugMessage)); final String outputFilePath = line.split(apkDebugMessage).last.trim(); expect(fileSystem.file(fileSystem.path.join(workingDirectory, outputFilePath)), exists); expect(outputFilePath, contains('.flutter-devtools')); final String devToolsCommand = result.stdout.toString() .split('\n') .firstWhere((String line) => line.contains(runDevToolsMessage)); final String commandArguments = devToolsCommand.split(runDevToolsMessage).last.trim(); final String relativeAppSizePath = outputFilePath.split('.flutter-devtools/').last.trim(); expect(commandArguments.contains('--appSizeBase=$relativeAppSizePath'), isTrue); }); testWithoutContext('--analyze-size flag produces expected output on hello_world for iOS', () async { final String workingDirectory = fileSystem.path.join(getFlutterRoot(), 'examples', 'hello_world'); final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter'); final Directory tempDir = fileSystem.systemTempDirectory.createTempSync('flutter_size_test.'); final Directory codeSizeDir = tempDir.childDirectory('code size dir')..createSync(); final ProcessResult result = await processManager.run(<String>[ flutterBin, 'build', 'ios', '--verbose', '--analyze-size', '--code-size-directory=${codeSizeDir.path}', '--no-codesign', ], workingDirectory: workingDirectory); expect( result, const ProcessResultMatcher(stdoutPattern: 'Dart AOT symbols accounted decompressed size'), ); final String line = result.stdout.toString() .split('\n') .firstWhere((String line) => line.contains(iosDebugMessage)); final String outputFilePath = line.split(iosDebugMessage).last.trim(); expect(fileSystem.file(fileSystem.path.join(workingDirectory, outputFilePath)), exists); final String devToolsCommand = result.stdout.toString() .split('\n') .firstWhere((String line) => line.contains(runDevToolsMessage)); final String commandArguments = devToolsCommand.split(runDevToolsMessage).last.trim(); final String relativeAppSizePath = outputFilePath.split('.flutter-devtools/').last.trim(); expect(commandArguments.contains('--appSizeBase=$relativeAppSizePath'), isTrue); expect(codeSizeDir.existsSync(), true); tempDir.deleteSync(recursive: true); }, skip: !platform.isMacOS); // [intended] iOS can only be built on macos. testWithoutContext('--analyze-size flag produces expected output on hello_world for macOS', () async { final String workingDirectory = fileSystem.path.join(getFlutterRoot(), 'examples', 'hello_world'); final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter'); final Directory tempDir = fileSystem.systemTempDirectory.createTempSync('flutter_size_test.'); final Directory codeSizeDir = tempDir.childDirectory('code size dir')..createSync(); final ProcessResult configResult = await processManager.run(<String>[ flutterBin, 'config', '--verbose', '--enable-macos-desktop', ], workingDirectory: workingDirectory); expect( configResult, const ProcessResultMatcher(), ); printOnFailure('Output of flutter config:'); printOnFailure(configResult.stdout.toString()); printOnFailure(configResult.stderr.toString()); final ProcessResult result = await processManager.run(<String>[ flutterBin, 'build', 'macos', '--analyze-size', '--code-size-directory=${codeSizeDir.path}', ], workingDirectory: workingDirectory); expect( result, const ProcessResultMatcher(stdoutPattern: 'Dart AOT symbols accounted decompressed size'), ); final String line = result.stdout.toString() .split('\n') .firstWhere((String line) => line.contains(macOSDebugMessage)); final String outputFilePath = line.split(macOSDebugMessage).last.trim(); expect(fileSystem.file(fileSystem.path.join(workingDirectory, outputFilePath)), exists); final String devToolsCommand = result.stdout.toString() .split('\n') .firstWhere((String line) => line.contains(runDevToolsMessage)); final String commandArguments = devToolsCommand.split(runDevToolsMessage).last.trim(); final String relativeAppSizePath = outputFilePath.split('.flutter-devtools/').last.trim(); expect(commandArguments.contains('--appSizeBase=$relativeAppSizePath'), isTrue); expect(codeSizeDir.existsSync(), true); tempDir.deleteSync(recursive: true); }, skip: !platform.isMacOS); // [intended] this is a macos only test. testWithoutContext('--analyze-size is only supported in release mode', () async { final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter'); final ProcessResult result = await processManager.run(<String>[ flutterBin, 'build', 'apk', '--verbose', '--analyze-size', '--target-platform=android-arm64', '--debug', ], workingDirectory: fileSystem.path.join(getFlutterRoot(), 'examples', 'hello_world')); expect( result, const ProcessResultMatcher( exitCode: 1, stderrPattern: '"--analyze-size" can only be used on release builds', ), ); }); testWithoutContext('--analyze-size is not supported in combination with --split-debug-info', () async { final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter'); final List<String> command = <String>[ flutterBin, 'build', 'apk', '--verbose', '--analyze-size', '--target-platform=android-arm64', '--split-debug-info=infos', ]; final String workingDirectory = fileSystem.path.join(getFlutterRoot(), 'examples', 'hello_world'); final ProcessResult result = await processManager.run(command, workingDirectory: workingDirectory); expect( result, const ProcessResultMatcher( exitCode: 1, stderrPattern: '"--analyze-size" cannot be combined with "--split-debug-info"', ), ); }); testWithoutContext('--analyze-size allows overriding the directory for code size files', () async { final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter'); final Directory tempDir = fileSystem.systemTempDirectory.createTempSync('flutter_size_test.'); final List<String> command = <String>[ flutterBin, 'build', 'apk', '--verbose', '--analyze-size', '--code-size-directory=${tempDir.path}', '--target-platform=android-arm64', '--release', ]; final String workingDirectory = fileSystem.path.join( getFlutterRoot(), 'examples', 'hello_world', ); final ProcessResult result = await processManager.run( command, workingDirectory: workingDirectory, ); expect( result, const ProcessResultMatcher(), ); expect(tempDir, exists); expect(tempDir.childFile('snapshot.arm64-v8a.json'), exists); expect(tempDir.childFile('trace.arm64-v8a.json'), exists); tempDir.deleteSync(recursive: true); }); }
flutter/packages/flutter_tools/test/integration.shard/analyze_size_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/analyze_size_test.dart", "repo_id": "flutter", "token_count": 3050 }
779
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'dart:convert'; import 'package:file/file.dart'; import 'package:flutter_tools/src/base/io.dart'; import '../src/common.dart'; import 'test_utils.dart'; final String flutterRootPath = getFlutterRoot(); final Directory flutterRoot = fileSystem.directory(flutterRootPath); Future<void> main() async { // Regression test for https://github.com/flutter/flutter/issues/132592 test('flutter/bin/dart updates the Dart SDK without hanging', () async { // Run the Dart entrypoint once to ensure the Dart SDK is downloaded. await runDartBatch(); expect(dartSdkStamp.existsSync(), true); // Remove the Dart SDK stamp and run the Dart entrypoint again to trigger // the Dart SDK update. dartSdkStamp.deleteSync(); final Future<String> runFuture = runDartBatch(); final Timer timer = Timer(const Duration(minutes: 5), () { // This print is useful for people debugging this test. Normally we would // avoid printing in a test but this is an exception because it's useful // ambient information. // ignore: avoid_print print( 'The Dart batch entrypoint did not complete after 5 minutes. ' 'Historically this is a sign that 7-Zip zip extraction is waiting for ' 'the user to confirm they would like to overwrite files. ' "This likely means the test isn't a flake and will fail. " 'See: https://github.com/flutter/flutter/issues/132592' ); }); final String output = await runFuture; timer.cancel(); // Check the Dart SDK was re-downloaded and extracted. // If 7-Zip is installed, unexpected overwrites causes this to hang. // If 7-Zip is not installed, unexpected overwrites results in error messages. // See: https://github.com/flutter/flutter/issues/132592 expect(dartSdkStamp.existsSync(), true); expect(output, contains('Downloading Dart SDK from Flutter engine ...')); // Do not assert on the exact unzipping method, as this could change on CI expect(output, contains(RegExp(r'Expanding downloaded archive with (.*)...'))); expect(output, isNot(contains('Use the -Force parameter' /* Luke */))); }, skip: !platform.isWindows); // [intended] Only Windows uses the batch entrypoint } Future<String> runDartBatch() async { String output = ''; final Process process = await processManager.start( <String>[ dartBatch.path ], ); final Future<Object?> stdoutFuture = process.stdout .transform<String>(utf8.decoder) .forEach((String str) { output += str; }); final Future<Object?> stderrFuture = process.stderr .transform<String>(utf8.decoder) .forEach((String str) { output += str; }); // Wait for the output to complete await Future.wait(<Future<Object?>>[stdoutFuture, stderrFuture]); // Ensure child exited successfully expect( await process.exitCode, 0, reason: 'child process exited with code ${await process.exitCode}, and ' 'output:\n$output', ); // Check the Dart tool prints the expected output. expect(output, contains('A command-line utility for Dart development.')); expect(output, contains('Usage: dart <command|dart-file> [arguments]')); return output; } // The executable batch entrypoint for the Dart binary. File get dartBatch { return flutterRoot .childDirectory('bin') .childFile('dart.bat') .absolute; } // The Dart SDK's stamp file. File get dartSdkStamp { return flutterRoot .childDirectory('bin') .childDirectory('cache') .childFile('engine-dart-sdk.stamp') .absolute; }
flutter/packages/flutter_tools/test/integration.shard/batch_entrypoint_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/batch_entrypoint_test.dart", "repo_id": "flutter", "token_count": 1243 }
780
// 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_testing/file_testing.dart'; import 'package:flutter_tools/src/base/io.dart'; import '../src/common.dart'; import 'test_utils.dart'; /// Tests that apps can be built using the deprecated `android/settings.gradle` file. /// This test should be removed once apps have been migrated to this new file. // TODO(egarciad): Migrate existing files, https://github.com/flutter/flutter/issues/54566 void main() { test('android project using deprecated settings.gradle will still build', () async { final String workingDirectory = fileSystem.path.join(getFlutterRoot(), 'dev', 'integration_tests', 'gradle_deprecated_settings'); final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter'); final File settingsDotGradleFile = fileSystem.file( fileSystem.path.join(workingDirectory, 'android', 'settings.gradle')); const String expectedSettingsDotGradle = r""" // Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This is the `settings.gradle` file that apps were created with until Flutter // v1.22.0. This file has changed, so it must be migrated in existing projects. include ':app' def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() def localPropertiesFile = new File(rootProject.projectDir, "local.properties") def properties = new Properties() def plugins = new Properties() def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') if (pluginsFile.exists()) { pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } } plugins.each { name, path -> def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() include ":$name" project(":$name").projectDir = pluginDirectory } """; expect( settingsDotGradleFile.readAsStringSync().trim().replaceAll('\r', ''), equals(expectedSettingsDotGradle.trim()), ); final ProcessResult result = await processManager.run(<String>[ flutterBin, 'build', 'apk', '--debug', '--target-platform', 'android-arm', '--verbose', ], workingDirectory: workingDirectory); expect(result, const ProcessResultMatcher()); final String apkPath = fileSystem.path.join( workingDirectory, 'build', 'app', 'outputs', 'flutter-apk', 'app-debug.apk'); expect(fileSystem.file(apkPath), exists); }); }
flutter/packages/flutter_tools/test/integration.shard/deprecated_gradle_settings_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/deprecated_gradle_settings_test.dart", "repo_id": "flutter", "token_count": 850 }
781
// 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/gen_l10n_project.dart'; import 'test_driver.dart'; import 'test_utils.dart'; final GenL10nProject project = GenL10nProject( useNamedParameters: false, ); final GenL10nProject projectWithNamedParameter = GenL10nProject( useNamedParameters: true, ); // Verify that the code generated by gen_l10n executes correctly. // It can fail if gen_l10n produces a lib/l10n/app_localizations.dart that // does not analyze cleanly. void main() { late Directory tempDir; late FlutterRunTestDriver flutter; setUp(() async { tempDir = createResolvedTempDirectorySync('gen_l10n_test.'); }); tearDown(() async { await flutter.stop(); tryToDelete(tempDir); }); Future<StringBuffer> runApp() async { // Run the app defined in GenL10nProject.main and wait for it to // send '#l10n END' to its stdout. final Completer<void> l10nEnd = Completer<void>(); final StringBuffer stdout = StringBuffer(); final StreamSubscription<String> subscription = flutter.stdout.listen((String line) { if (line.contains('#l10n')) { stdout.writeln(line.substring(line.indexOf('#l10n'))); } if (line.contains('#l10n END')) { l10nEnd.complete(); } }); await flutter.run(); await l10nEnd.future; await subscription.cancel(); return stdout; } void expectOutput(StringBuffer stdout) { expect(stdout.toString(), '#l10n 0 (--- supportedLocales tests ---)\n' '#l10n 1 (supportedLocales[0]: languageCode: en, countryCode: null, scriptCode: null)\n' '#l10n 2 (supportedLocales[1]: languageCode: en, countryCode: CA, scriptCode: null)\n' '#l10n 3 (supportedLocales[2]: languageCode: en, countryCode: GB, scriptCode: null)\n' '#l10n 4 (supportedLocales[3]: languageCode: es, countryCode: null, scriptCode: null)\n' '#l10n 5 (supportedLocales[4]: languageCode: es, countryCode: 419, scriptCode: null)\n' '#l10n 6 (supportedLocales[5]: languageCode: zh, countryCode: null, scriptCode: null)\n' '#l10n 7 (supportedLocales[6]: languageCode: zh, countryCode: null, scriptCode: Hans)\n' '#l10n 8 (supportedLocales[7]: languageCode: zh, countryCode: null, scriptCode: Hant)\n' '#l10n 9 (supportedLocales[8]: languageCode: zh, countryCode: TW, scriptCode: Hant)\n' '#l10n 10 (--- countryCode (en_CA) tests ---)\n' '#l10n 11 (CA Hello World)\n' '#l10n 12 (Hello CA fallback World)\n' '#l10n 13 (--- countryCode (en_GB) tests ---)\n' '#l10n 14 (GB Hello World)\n' '#l10n 15 (Hello GB fallback World)\n' '#l10n 16 (--- zh ---)\n' '#l10n 17 (你好世界)\n' '#l10n 18 (你好)\n' '#l10n 19 (你好世界)\n' '#l10n 20 (你好2个其他世界)\n' '#l10n 21 (Hello 世界)\n' '#l10n 22 (zh - Hello for 价钱 CNY123.00)\n' '#l10n 23 (--- scriptCode: zh_Hans ---)\n' '#l10n 24 (简体你好世界)\n' '#l10n 25 (--- scriptCode - zh_Hant ---)\n' '#l10n 26 (繁體你好世界)\n' '#l10n 27 (--- scriptCode - zh_Hant_TW ---)\n' '#l10n 28 (台灣繁體你好世界)\n' '#l10n 29 (--- General formatting tests ---)\n' '#l10n 30 (Hello World)\n' '#l10n 31 (Hello _NEWLINE_ World)\n' '#l10n 32 (Hello \$ World)\n' '#l10n 33 (Hello World)\n' '#l10n 34 (Hello World)\n' '#l10n 35 (Hello World on Friday, January 1, 1960)\n' '#l10n 36 (Hello world argument on 1/1/1960 at 00:00)\n' '#l10n 37 (Hello World from 1960 to 2020)\n' '#l10n 38 (Hello for 123)\n' '#l10n 39 (Hello for price USD123.00)\n' '#l10n 40 (Hello for price BTC0.50 (with optional param))\n' "#l10n 41 (Hello for price BTC'0.50 (with special character))\n" '#l10n 42 (Hello for price BTC"0.50 (with special character))\n' '#l10n 43 (Hello for price BTC"\'0.50 (with special character))\n' '#l10n 44 (Hello for Decimal Pattern 1,200,000)\n' '#l10n 45 (Hello for Percent Pattern 120,000,000%)\n' '#l10n 46 (Hello for Scientific Pattern 1E6)\n' '#l10n 47 (Hello)\n' '#l10n 48 (Hello World)\n' '#l10n 49 (Hello two worlds)\n' '#l10n 50 (Hello)\n' '#l10n 51 (Hello new World)\n' '#l10n 52 (Hello two new worlds)\n' '#l10n 53 (Hello on Friday, January 1, 1960)\n' '#l10n 54 (Hello World, on Friday, January 1, 1960)\n' '#l10n 55 (Hello two worlds, on Friday, January 1, 1960)\n' '#l10n 56 (Hello other 0 worlds, with a total of 100 citizens)\n' '#l10n 57 (Hello World of 101 citizens)\n' '#l10n 58 (Hello two worlds with 102 total citizens)\n' '#l10n 59 ([Hello] -World- #123#)\n' '#l10n 60 (\$!)\n' '#l10n 61 (One \$)\n' "#l10n 62 (Flutter's amazing!)\n" "#l10n 63 (Flutter's amazing, times 2!)\n" '#l10n 64 (Flutter is "amazing"!)\n' '#l10n 65 (Flutter is "amazing", times 2!)\n' '#l10n 66 (16 wheel truck)\n' "#l10n 67 (Sedan's elegance)\n" '#l10n 68 (Cabriolet has "acceleration")\n' '#l10n 69 (Oh, she found 1 item!)\n' '#l10n 70 (Indeed, they like Flutter!)\n' '#l10n 71 (Indeed, he likes ice cream!)\n' '#l10n 72 (Indeed, she likes chocolate!)\n' '#l10n 73 (he)\n' '#l10n 74 (they)\n' '#l10n 75 (she)\n' '#l10n 76 (6/26/2023)\n' '#l10n 77 (5:23:00 AM)\n' '#l10n 78 (--- es ---)\n' '#l10n 79 (ES - Hello world)\n' '#l10n 80 (ES - Hello _NEWLINE_ World)\n' '#l10n 81 (ES - Hola \$ Mundo)\n' '#l10n 82 (ES - Hello Mundo)\n' '#l10n 83 (ES - Hola Mundo)\n' '#l10n 84 (ES - Hello World on viernes, 1 de enero de 1960)\n' '#l10n 85 (ES - Hello world argument on 1/1/1960 at 0:00)\n' '#l10n 86 (ES - Hello World from 1960 to 2020)\n' '#l10n 87 (ES - Hello for 123)\n' '#l10n 88 (ES - Hello)\n' '#l10n 89 (ES - Hello World)\n' '#l10n 90 (ES - Hello two worlds)\n' '#l10n 91 (ES - Hello)\n' '#l10n 92 (ES - Hello nuevo World)\n' '#l10n 93 (ES - Hello two nuevo worlds)\n' '#l10n 94 (ES - Hello on viernes, 1 de enero de 1960)\n' '#l10n 95 (ES - Hello World, on viernes, 1 de enero de 1960)\n' '#l10n 96 (ES - Hello two worlds, on viernes, 1 de enero de 1960)\n' '#l10n 97 (ES - Hello other 0 worlds, with a total of 100 citizens)\n' '#l10n 98 (ES - Hello World of 101 citizens)\n' '#l10n 99 (ES - Hello two worlds with 102 total citizens)\n' '#l10n 100 (ES - [Hola] -Mundo- #123#)\n' '#l10n 101 (ES - \$!)\n' '#l10n 102 (ES - One \$)\n' "#l10n 103 (ES - Flutter's amazing!)\n" "#l10n 104 (ES - Flutter's amazing, times 2!)\n" '#l10n 105 (ES - Flutter is "amazing"!)\n' '#l10n 106 (ES - Flutter is "amazing", times 2!)\n' '#l10n 107 (ES - 16 wheel truck)\n' "#l10n 108 (ES - Sedan's elegance)\n" '#l10n 109 (ES - Cabriolet has "acceleration")\n' '#l10n 110 (ES - Oh, she found ES - 1 itemES - !)\n' '#l10n 111 (ES - Indeed, ES - they like ES - Flutter!)\n' '#l10n 112 (--- es_419 ---)\n' '#l10n 113 (ES 419 - Hello World)\n' '#l10n 114 (ES 419 - Hello)\n' '#l10n 115 (ES 419 - Hello World)\n' '#l10n 116 (ES 419 - Hello two worlds)\n' '#l10n END\n' ); } // TODO(jsimmons): need a localization test that uses deferred loading // (see https://github.com/flutter/flutter/issues/61911) testWithoutContext('generated l10n classes produce expected localized strings', () async { await project.setUpIn(tempDir); flutter = FlutterRunTestDriver(tempDir); final StringBuffer stdout = await runApp(); expectOutput(stdout); }); testWithoutContext('generated l10n classes produce expected localized strings when named parameter is used', () async { await projectWithNamedParameter.setUpIn(tempDir); flutter = FlutterRunTestDriver(tempDir); final StringBuffer stdout = await runApp(); expectOutput(stdout); }); }
flutter/packages/flutter_tools/test/integration.shard/gen_l10n_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/gen_l10n_test.dart", "repo_id": "flutter", "token_count": 3684 }
782
// 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 '../test_utils.dart'; abstract class DeferredComponentsConfig { String get deferredLibrary; String? get deferredComponentsGolden; String get androidSettings; String get androidBuild; String get androidLocalProperties; String get androidGradleProperties; String get androidKeyProperties; List<int> get androidKey; String get appBuild; String get appManifest; String get appStrings; String get appStyles; String get appLaunchBackground; String get asset1; String get asset2; List<DeferredComponentModule> get deferredComponents; void setUpIn(Directory dir) { writeFile(fileSystem.path.join(dir.path, 'lib', 'deferred_library.dart'), deferredLibrary); final String? golden = deferredComponentsGolden; if (golden != null) { writeFile(fileSystem.path.join(dir.path, 'deferred_components_loading_units.yaml'), golden); } writeFile(fileSystem.path.join(dir.path, 'android', 'settings.gradle'), androidSettings); writeFile(fileSystem.path.join(dir.path, 'android', 'build.gradle'), androidBuild); writeFile(fileSystem.path.join(dir.path, 'android', 'local.properties'), androidLocalProperties); writeFile(fileSystem.path.join(dir.path, 'android', 'gradle.properties'), androidGradleProperties); writeFile(fileSystem.path.join(dir.path, 'android', 'key.properties'), androidKeyProperties); writeBytesFile(fileSystem.path.join(dir.path, 'android', 'app', 'key.jks'), androidKey); writeFile(fileSystem.path.join(dir.path, 'android', 'app', 'build.gradle'), appBuild); writeFile(fileSystem.path.join(dir.path, 'android', 'app', 'src', 'main', 'AndroidManifest.xml'), appManifest); writeFile(fileSystem.path.join(dir.path, 'android', 'app', 'src', 'main', 'res', 'values', 'strings.xml'), appStrings); writeFile(fileSystem.path.join(dir.path, 'android', 'app', 'src', 'main', 'res', 'values', 'styles.xml'), appStyles); writeFile(fileSystem.path.join(dir.path, 'android', 'app', 'src', 'main', 'res', 'drawable', 'launch_background.xml'), appLaunchBackground); writeFile(fileSystem.path.join(dir.path, 'test_assets/asset1.txt'), asset1); writeFile(fileSystem.path.join(dir.path, 'test_assets/asset2.txt'), asset2); for (final DeferredComponentModule component in deferredComponents) { component.setUpIn(dir); } } } class DeferredComponentModule { DeferredComponentModule(this.name); String name; void setUpIn(Directory dir) { writeFile(fileSystem.path.join(dir.path, 'android', name, 'build.gradle'), r''' def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' } def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' } apply plugin: "com.android.dynamic-feature" android { compileSdk 34 sourceSets { applicationVariants.all { variant -> main.assets.srcDirs += "${project.buildDir}/intermediates/flutter/${variant.name}/deferred_assets" main.jniLibs.srcDirs += "${project.buildDir}/intermediates/flutter/${variant.name}/deferred_libs" } } defaultConfig { minSdkVersion 21 targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } compileOptions { sourceCompatibility 1.8 targetCompatibility 1.8 } } dependencies { implementation project(":app") } '''); writeFile(fileSystem.path.join(dir.path, 'android', name, 'src', 'main', 'AndroidManifest.xml'), ''' <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:dist="http://schemas.android.com/apk/distribution" package="com.example.$name"> <dist:module dist:instant="false" dist:title="@string/component1Name"> <dist:delivery> <dist:on-demand /> </dist:delivery> <dist:fusing dist:include="true" /> </dist:module> </manifest> '''); } }
flutter/packages/flutter_tools/test/integration.shard/test_data/deferred_components_config.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/test_data/deferred_components_config.dart", "repo_id": "flutter", "token_count": 1783 }
783
// 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 'project.dart'; class TestProject extends Project { @override final String pubspec = ''' name: test environment: sdk: '>=3.2.0-0 <4.0.0' dependencies: flutter: sdk: flutter dev_dependencies: flutter_test: sdk: flutter '''; @override final String main = r''' int foo(int bar) { return bar + 2; } '''; @override final String test = r''' import 'package:flutter_test/flutter_test.dart'; import 'package:test/main.dart'; void main() { testWidgets('it can test', (WidgetTester tester) async { expect(foo(2), 4); }); } '''; }
flutter/packages/flutter_tools/test/integration.shard/test_data/test_project.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/test_data/test_project.dart", "repo_id": "flutter", "token_count": 294 }
784
// 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/android/android_workflow.dart'; import 'package:flutter_tools/src/base/bot_detector.dart'; import 'package:flutter_tools/src/base/config.dart'; import 'package:flutter_tools/src/base/context.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/os.dart'; import 'package:flutter_tools/src/base/process.dart'; import 'package:flutter_tools/src/base/signals.dart'; import 'package:flutter_tools/src/base/template.dart'; import 'package:flutter_tools/src/base/terminal.dart'; import 'package:flutter_tools/src/base/time.dart'; import 'package:flutter_tools/src/base/version.dart'; import 'package:flutter_tools/src/build_system/build_targets.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/context_runner.dart'; import 'package:flutter_tools/src/dart/pub.dart'; import 'package:flutter_tools/src/device.dart'; import 'package:flutter_tools/src/doctor.dart'; import 'package:flutter_tools/src/doctor_validator.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/ios/plist_parser.dart'; import 'package:flutter_tools/src/ios/simulators.dart'; import 'package:flutter_tools/src/ios/xcodeproj.dart'; import 'package:flutter_tools/src/isolated/build_targets.dart'; import 'package:flutter_tools/src/isolated/mustache_template.dart'; import 'package:flutter_tools/src/persistent_tool_state.dart'; import 'package:flutter_tools/src/project.dart'; import 'package:flutter_tools/src/reporting/crash_reporting.dart'; import 'package:flutter_tools/src/reporting/reporting.dart'; import 'package:flutter_tools/src/version.dart'; import 'package:meta/meta.dart'; import 'package:test/fake.dart'; import 'package:unified_analytics/unified_analytics.dart'; import 'common.dart'; import 'fake_http_client.dart'; import 'fake_process_manager.dart'; import 'fakes.dart'; import 'throwing_pub.dart'; export 'package:flutter_tools/src/base/context.dart' show Generator; export 'fake_process_manager.dart' show FakeCommand, FakeProcessManager, ProcessManager; /// Return the test logger. This assumes that the current Logger is a BufferLogger. BufferLogger get testLogger => context.get<Logger>()! as BufferLogger; FakeDeviceManager get testDeviceManager => context.get<DeviceManager>()! as FakeDeviceManager; @isTest void testUsingContext( String description, dynamic Function() testMethod, { Map<Type, Generator> overrides = const <Type, Generator>{}, bool initializeFlutterRoot = true, String? testOn, bool? skip, // should default to `false`, but https://github.com/dart-lang/test/issues/545 doesn't allow this }) { if (overrides[FileSystem] != null && overrides[ProcessManager] == null) { throw StateError( 'If you override the FileSystem context you must also provide a ProcessManager, ' 'otherwise the processes you launch will not be dealing with the same file system ' 'that you are dealing with in your test.' ); } if (overrides.containsKey(ProcessUtils)) { throw StateError('Do not inject ProcessUtils for testing, use ProcessManager instead.'); } // Ensure we don't rely on the default [Config] constructor which will // leak a sticky $HOME/.flutter_settings behind! Directory? configDir; tearDown(() { if (configDir != null) { tryToDelete(configDir!); configDir = null; } }); Config buildConfig(FileSystem fs) { configDir ??= globals.fs.systemTempDirectory.createTempSync('flutter_config_dir_test.'); return Config.test( name: Config.kFlutterSettings, directory: configDir, logger: globals.logger, ); } PersistentToolState buildPersistentToolState(FileSystem fs) { configDir ??= globals.fs.systemTempDirectory.createTempSync('flutter_config_dir_test.'); return PersistentToolState.test( directory: configDir!, logger: globals.logger, ); } test(description, () async { await runInContext<dynamic>(() { return context.run<dynamic>( name: 'mocks', overrides: <Type, Generator>{ AnsiTerminal: () => AnsiTerminal(platform: globals.platform, stdio: globals.stdio), Config: () => buildConfig(globals.fs), DeviceManager: () => FakeDeviceManager(), Doctor: () => FakeDoctor(globals.logger), FlutterVersion: () => FakeFlutterVersion(), HttpClient: () => FakeHttpClient.any(), IOSSimulatorUtils: () => const NoopIOSSimulatorUtils(), OutputPreferences: () => OutputPreferences.test(), Logger: () => BufferLogger.test(), OperatingSystemUtils: () => FakeOperatingSystemUtils(), PersistentToolState: () => buildPersistentToolState(globals.fs), Usage: () => TestUsage(), XcodeProjectInterpreter: () => FakeXcodeProjectInterpreter(), FileSystem: () => LocalFileSystemBlockingSetCurrentDirectory(), PlistParser: () => FakePlistParser(), Signals: () => FakeSignals(), Pub: () => ThrowingPub(), // prevent accidentally using pub. CrashReporter: () => const NoopCrashReporter(), TemplateRenderer: () => const MustacheTemplateRenderer(), BuildTargets: () => const BuildTargetsImpl(), Analytics: () => const NoOpAnalytics(), }, body: () { // To catch all errors thrown by the test, even uncaught async errors, we use a zone. // // Zones introduce their own event loop, so we do not await futures created inside // the zone from outside the zone. Instead, we create a Completer outside the zone, // and have the test complete it when the test ends (in success or failure), and we // await that. final Completer<void> completer = Completer<void>(); runZonedGuarded<Future<dynamic>>(() async { try { return await context.run<dynamic>( // Apply the overrides to the test context in the zone since their // instantiation may reference items already stored on the context. overrides: overrides, name: 'test-specific overrides', body: () async { if (initializeFlutterRoot) { // Provide a sane default for the flutterRoot directory. Individual // tests can override this either in the test or during setup. Cache.flutterRoot ??= getFlutterRoot(); } return await testMethod(); }, ); } finally { // We do not need a catch { ... } block because the error zone // will catch all errors and send them to the completer below. // // See https://github.com/flutter/flutter/pull/141821/files#r1462288131. if (!completer.isCompleted) { completer.complete(); } } }, (Object error, StackTrace stackTrace) { // When things fail, it's ok to print to the console! print(error); // ignore: avoid_print print(stackTrace); // ignore: avoid_print _printBufferedErrors(context); if (!completer.isCompleted) { completer.completeError(error, stackTrace); } throw error; //ignore: only_throw_errors }); return completer.future; }, ); }, overrides: <Type, Generator>{ // This has to go here so that runInContext will pick it up when it tries // to do bot detection before running the closure. This is important // because the test may be giving us a fake HttpClientFactory, which may // throw in unexpected/abnormal ways. // If a test needs a BotDetector that does not always return true, it // can provide the AlwaysFalseBotDetector in the overrides, or its own // BotDetector implementation in the overrides. BotDetector: overrides[BotDetector] ?? () => const FakeBotDetector(true), }); }, testOn: testOn, skip: skip); // We don't support "timeout"; see ../../dart_test.yaml which // configures all tests to have a 15 minute timeout which should // definitely be enough. } void _printBufferedErrors(AppContext testContext) { if (testContext.get<Logger>() is BufferLogger) { final BufferLogger bufferLogger = testContext.get<Logger>()! as BufferLogger; if (bufferLogger.errorText.isNotEmpty) { // This is where the logger outputting errors is implemented, so it has // to use `print`. print(bufferLogger.errorText); // ignore: avoid_print } bufferLogger.clear(); } } class FakeDeviceManager implements DeviceManager { List<Device> attachedDevices = <Device>[]; List<Device> wirelessDevices = <Device>[]; String? _specifiedDeviceId; @override String? get specifiedDeviceId { if (_specifiedDeviceId == null || _specifiedDeviceId == 'all') { return null; } return _specifiedDeviceId; } @override set specifiedDeviceId(String? id) { _specifiedDeviceId = id; } @override bool get hasSpecifiedDeviceId => specifiedDeviceId != null; @override bool get hasSpecifiedAllDevices { return _specifiedDeviceId != null && _specifiedDeviceId == 'all'; } @override Future<List<Device>> getAllDevices({ DeviceDiscoveryFilter? filter, }) async => filteredDevices(filter); @override Future<List<Device>> refreshAllDevices({ Duration? timeout, DeviceDiscoveryFilter? filter, }) async => filteredDevices(filter); @override Future<List<Device>> refreshExtendedWirelessDeviceDiscoverers({ Duration? timeout, DeviceDiscoveryFilter? filter, }) async => filteredDevices(filter); @override Future<List<Device>> getDevicesById( String deviceId, { DeviceDiscoveryFilter? filter, bool waitForDeviceToConnect = false, }) async { return filteredDevices(filter).where((Device device) { return device.id == deviceId || device.id.startsWith(deviceId); }).toList(); } @override Future<List<Device>> getDevices({ DeviceDiscoveryFilter? filter, bool waitForDeviceToConnect = false, }) { return hasSpecifiedDeviceId ? getDevicesById(specifiedDeviceId!, filter: filter) : getAllDevices(filter: filter); } void addAttachedDevice(Device device) => attachedDevices.add(device); void addWirelessDevice(Device device) => wirelessDevices.add(device); @override bool get canListAnything => true; @override Future<List<String>> getDeviceDiagnostics() async => <String>[]; @override List<DeviceDiscovery> get deviceDiscoverers => <DeviceDiscovery>[]; @override DeviceDiscoverySupportFilter deviceSupportFilter({ bool includeDevicesUnsupportedByProject = false, FlutterProject? flutterProject, }) { return TestDeviceDiscoverySupportFilter(); } @override Device? getSingleEphemeralDevice(List<Device> devices) => null; List<Device> filteredDevices(DeviceDiscoveryFilter? filter) { if (filter?.deviceConnectionInterface == DeviceConnectionInterface.attached) { return attachedDevices; } if (filter?.deviceConnectionInterface == DeviceConnectionInterface.wireless) { return wirelessDevices; } return attachedDevices + wirelessDevices; } } class TestDeviceDiscoverySupportFilter extends Fake implements DeviceDiscoverySupportFilter { TestDeviceDiscoverySupportFilter(); } class FakeAndroidLicenseValidator extends Fake implements AndroidLicenseValidator { @override Future<LicensesAccepted> get licensesAccepted async => LicensesAccepted.all; } class FakeDoctor extends Doctor { FakeDoctor(Logger logger, {super.clock = const SystemClock()}) : super(logger: logger); // True for testing. @override bool get canListAnything => true; // True for testing. @override bool get canLaunchAnything => true; @override /// Replaces the android workflow with a version that overrides licensesAccepted, /// to prevent individual tests from having to mock out the process for /// the Doctor. List<DoctorValidator> get validators { final List<DoctorValidator> superValidators = super.validators; return superValidators.map<DoctorValidator>((DoctorValidator v) { if (v is AndroidLicenseValidator) { return FakeAndroidLicenseValidator(); } return v; }).toList(); } } class NoopIOSSimulatorUtils implements IOSSimulatorUtils { const NoopIOSSimulatorUtils(); @override Future<List<IOSSimulator>> getAttachedDevices() async => <IOSSimulator>[]; @override Future<List<IOSSimulatorRuntime>> getAvailableIOSRuntimes() async => <IOSSimulatorRuntime>[]; } class FakeXcodeProjectInterpreter implements XcodeProjectInterpreter { @override bool get isInstalled => true; @override String get versionText => 'Xcode 14'; @override Version get version => Version(14, null, null); @override String get build => '14A309'; @override Future<Map<String, String>> getBuildSettings( String projectPath, { XcodeProjectBuildContext? buildContext, Duration timeout = const Duration(minutes: 1), }) async { return <String, String>{}; } @override Future<String> pluginsBuildSettingsOutput( Directory podXcodeProject, { Duration timeout = const Duration(minutes: 1), }) async { return ''; } @override Future<void> cleanWorkspace(String workspacePath, String scheme, { bool verbose = false }) async { } @override Future<XcodeProjectInfo> getInfo(String projectPath, {String? projectFilename}) async { return XcodeProjectInfo( <String>['Runner'], <String>['Debug', 'Release'], <String>['Runner'], BufferLogger.test(), ); } @override List<String> xcrunCommand() => <String>['xcrun']; } /// Prevent test crashes from being reported to the crash backend. class NoopCrashReporter implements CrashReporter { const NoopCrashReporter(); @override Future<void> informUser(CrashDetails details, File crashFile) async { } } class LocalFileSystemBlockingSetCurrentDirectory extends LocalFileSystem { // Use [FakeSignals] so developers running the test suite can kill the test // runner. LocalFileSystemBlockingSetCurrentDirectory() : super.test(signals: FakeSignals()); @override set currentDirectory(dynamic value) { throw Exception('globals.fs.currentDirectory should not be set on the local file system during ' 'tests as this can cause race conditions with concurrent tests. ' 'Consider using a MemoryFileSystem for testing if possible or refactor ' 'code to not require setting globals.fs.currentDirectory.'); } } class FakeSignals implements Signals { @override Object addHandler(ProcessSignal signal, SignalHandler handler) { return const Object(); } @override Future<bool> removeHandler(ProcessSignal signal, Object token) async { return true; } @override Stream<Object> get errors => const Stream<Object>.empty(); }
flutter/packages/flutter_tools/test/src/context.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/src/context.dart", "repo_id": "flutter", "token_count": 5423 }
785
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'dart:io' as io; import 'package:fake_async/fake_async.dart'; import 'package:file/memory.dart'; import 'package:file_testing/file_testing.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/os.dart'; import 'package:flutter_tools/src/base/platform.dart'; import 'package:flutter_tools/src/web/chrome.dart'; import 'package:test/fake.dart'; import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'; import '../src/common.dart'; import '../src/fake_process_manager.dart'; import '../src/fakes.dart' hide FakeProcess; const List<String> kChromeArgs = <String>[ '--disable-background-timer-throttling', '--disable-extensions', '--disable-popup-blocking', '--bwsi', '--no-first-run', '--no-default-browser-check', '--disable-default-apps', '--disable-translate', ]; const List<String> kCodeCache = <String>[ 'Cache', 'Code Cache', 'GPUCache', ]; const String kDevtoolsStderr = '\n\nDevTools listening\n\n'; void main() { late FileExceptionHandler exceptionHandler; late ChromiumLauncher chromeLauncher; late FileSystem fileSystem; late Platform platform; late FakeProcessManager processManager; late OperatingSystemUtils operatingSystemUtils; late BufferLogger testLogger; setUp(() { exceptionHandler = FileExceptionHandler(); operatingSystemUtils = FakeOperatingSystemUtils(); platform = FakePlatform(operatingSystem: 'macos', environment: <String, String>{ kChromeEnvironment: 'example_chrome', }); fileSystem = MemoryFileSystem.test(opHandle: exceptionHandler.opHandle); processManager = FakeProcessManager.empty(); chromeLauncher = ChromiumLauncher( fileSystem: fileSystem, platform: platform, processManager: processManager, operatingSystemUtils: operatingSystemUtils, browserFinder: findChromeExecutable, logger: testLogger = BufferLogger.test(), ); }); Future<Chromium> testLaunchChrome(String userDataDir, FakeProcessManager processManager, ChromiumLauncher chromeLauncher) { if (testLogger.isVerbose) { processManager.addCommand(const FakeCommand( command: <String>[ 'example_chrome', '--version', ], stdout: 'Chromium 115', )); } processManager.addCommand(FakeCommand( command: <String>[ 'example_chrome', '--user-data-dir=$userDataDir', '--remote-debugging-port=12345', ...kChromeArgs, 'example_url', ], stderr: kDevtoolsStderr, )); return chromeLauncher.launch( 'example_url', skipCheck: true, ); } testWithoutContext('can launch chrome and connect to the devtools', () async { await expectReturnsNormallyLater( testLaunchChrome( '/.tmp_rand0/flutter_tools_chrome_device.rand0', processManager, chromeLauncher, ) ); }); testWithoutContext('can launch chrome in verbose mode', () async { chromeLauncher = ChromiumLauncher( fileSystem: fileSystem, platform: platform, processManager: processManager, operatingSystemUtils: operatingSystemUtils, browserFinder: findChromeExecutable, logger: testLogger = BufferLogger.test(verbose: true), ); await expectReturnsNormallyLater( testLaunchChrome( '/.tmp_rand0/flutter_tools_chrome_device.rand0', processManager, chromeLauncher, ) ); expect( testLogger.traceText.trim(), 'Launching Chromium (url = example_url, headless = false, skipCheck = true, debugPort = null)\n' 'Will use Chromium executable at example_chrome\n' 'Using Chromium 115\n' '[CHROME]: \n' '[CHROME]: \n' '[CHROME]: DevTools listening', ); }); testWithoutContext('cannot have two concurrent instances of chrome', () async { await testLaunchChrome( '/.tmp_rand0/flutter_tools_chrome_device.rand0', processManager, chromeLauncher, ); await expectToolExitLater( testLaunchChrome( '/.tmp_rand0/flutter_tools_chrome_device.rand1', processManager, chromeLauncher, ), contains('Only one instance of chrome can be started'), ); }); testWithoutContext('can launch new chrome after stopping a previous chrome', () async { final Chromium chrome = await testLaunchChrome( '/.tmp_rand0/flutter_tools_chrome_device.rand0', processManager, chromeLauncher, ); await chrome.close(); await expectReturnsNormallyLater( testLaunchChrome( '/.tmp_rand0/flutter_tools_chrome_device.rand1', processManager, chromeLauncher, ) ); }); testWithoutContext('exits normally using SIGTERM', () async { final BufferLogger logger = BufferLogger.test(); final FakeAsync fakeAsync = FakeAsync(); fakeAsync.run((_) { () async { final FakeChromeConnection chromeConnection = FakeChromeConnection(maxRetries: 4); final ChromiumLauncher chromiumLauncher = ChromiumLauncher( fileSystem: fileSystem, platform: platform, processManager: processManager, operatingSystemUtils: operatingSystemUtils, browserFinder: findChromeExecutable, logger: logger, ); final FakeProcess process = FakeProcess( duration: const Duration(seconds: 3), ); final Chromium chrome = Chromium(0, chromeConnection, chromiumLauncher: chromiumLauncher, process: process, logger: logger); final Future<void> closeFuture = chrome.close(); fakeAsync.elapse(const Duration(seconds: 4)); await closeFuture; expect(process.signals, <io.ProcessSignal>[io.ProcessSignal.sigterm]); }(); }); fakeAsync.flushTimers(); expect(logger.warningText, isEmpty); }); testWithoutContext('falls back to SIGKILL if SIGTERM did not work', () async { final BufferLogger logger = BufferLogger.test(); final FakeAsync fakeAsync = FakeAsync(); fakeAsync.run((_) { () async { final FakeChromeConnection chromeConnection = FakeChromeConnection(maxRetries: 4); final ChromiumLauncher chromiumLauncher = ChromiumLauncher( fileSystem: fileSystem, platform: platform, processManager: processManager, operatingSystemUtils: operatingSystemUtils, browserFinder: findChromeExecutable, logger: logger, ); final FakeProcess process = FakeProcess( duration: const Duration(seconds: 6), ); final Chromium chrome = Chromium(0, chromeConnection, chromiumLauncher: chromiumLauncher, process: process, logger: logger); final Future<void> closeFuture = chrome.close(); fakeAsync.elapse(const Duration(seconds: 7)); await closeFuture; expect(process.signals, <io.ProcessSignal>[io.ProcessSignal.sigterm, io.ProcessSignal.sigkill]); }(); }); fakeAsync.flushTimers(); expect( logger.warningText, 'Failed to exit Chromium (pid: 1234) using SIGTERM. Will try sending SIGKILL instead.\n', ); }); testWithoutContext('falls back to a warning if SIGKILL did not work', () async { final BufferLogger logger = BufferLogger.test(); final FakeAsync fakeAsync = FakeAsync(); fakeAsync.run((_) { () async { final FakeChromeConnection chromeConnection = FakeChromeConnection(maxRetries: 4); final ChromiumLauncher chromiumLauncher = ChromiumLauncher( fileSystem: fileSystem, platform: platform, processManager: processManager, operatingSystemUtils: operatingSystemUtils, browserFinder: findChromeExecutable, logger: logger, ); final FakeProcess process = FakeProcess( duration: const Duration(seconds: 20), ); final Chromium chrome = Chromium(0, chromeConnection, chromiumLauncher: chromiumLauncher, process: process, logger: logger); final Future<void> closeFuture = chrome.close(); fakeAsync.elapse(const Duration(seconds: 30)); await closeFuture; expect(process.signals, <io.ProcessSignal>[io.ProcessSignal.sigterm, io.ProcessSignal.sigkill]); }(); }); fakeAsync.flushTimers(); expect( logger.warningText, 'Failed to exit Chromium (pid: 1234) using SIGTERM. Will try sending SIGKILL instead.\n' 'Failed to exit Chromium (pid: 1234) using SIGKILL. Giving up. Will continue, assuming ' 'Chromium has exited successfully, but it is possible that this left a dangling Chromium ' 'process running on the system.\n', ); }); testWithoutContext('does not crash if saving profile information fails due to a file system exception.', () async { final BufferLogger logger = BufferLogger.test(); chromeLauncher = ChromiumLauncher( fileSystem: fileSystem, platform: platform, processManager: processManager, operatingSystemUtils: operatingSystemUtils, browserFinder: findChromeExecutable, logger: logger, ); processManager.addCommand(const FakeCommand( command: <String>[ 'example_chrome', '--user-data-dir=/.tmp_rand0/flutter_tools_chrome_device.rand0', '--remote-debugging-port=12345', ...kChromeArgs, 'example_url', ], stderr: kDevtoolsStderr, )); final Chromium chrome = await chromeLauncher.launch( 'example_url', skipCheck: true, cacheDir: fileSystem.currentDirectory, ); // Create cache dir that the Chrome launcher will attempt to persist, and a file // that will thrown an exception when it is read. const String directoryPrefix = '/.tmp_rand0/flutter_tools_chrome_device.rand0/Default'; fileSystem.directory('$directoryPrefix/Local Storage') .createSync(recursive: true); final File file = fileSystem.file('$directoryPrefix/Local Storage/foo') ..createSync(recursive: true); exceptionHandler.addError( file, FileSystemOp.read, const FileSystemException(), ); await chrome.close(); // does not exit with error. expect(logger.errorText, contains('Failed to save Chrome preferences')); }); testWithoutContext('does not crash if restoring profile information fails due to a file system exception.', () async { final BufferLogger logger = BufferLogger.test(); final File file = fileSystem.file('/Default/foo') ..createSync(recursive: true); exceptionHandler.addError( file, FileSystemOp.read, const FileSystemException(), ); chromeLauncher = ChromiumLauncher( fileSystem: fileSystem, platform: platform, processManager: processManager, operatingSystemUtils: operatingSystemUtils, browserFinder: findChromeExecutable, logger: logger, ); processManager.addCommand(const FakeCommand( command: <String>[ 'example_chrome', '--user-data-dir=/.tmp_rand0/flutter_tools_chrome_device.rand0', '--remote-debugging-port=12345', ...kChromeArgs, 'example_url', ], stderr: kDevtoolsStderr, )); fileSystem.currentDirectory.childDirectory('Default').createSync(); final Chromium chrome = await chromeLauncher.launch( 'example_url', skipCheck: true, cacheDir: fileSystem.currentDirectory, ); // Create cache dir that the Chrome launcher will attempt to persist. fileSystem.directory('/.tmp_rand0/flutter_tools_chrome_device.rand0/Default/Local Storage') .createSync(recursive: true); await chrome.close(); // does not exit with error. expect(logger.errorText, contains('Failed to restore Chrome preferences')); }); testWithoutContext('can launch Chrome on x86_64 macOS', () async { final OperatingSystemUtils macOSUtils = FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_x64); final ChromiumLauncher chromiumLauncher = ChromiumLauncher( fileSystem: fileSystem, platform: platform, processManager: processManager, operatingSystemUtils: macOSUtils, browserFinder: findChromeExecutable, logger: BufferLogger.test(), ); processManager.addCommands(<FakeCommand>[ const FakeCommand( command: <String>[ 'example_chrome', '--user-data-dir=/.tmp_rand0/flutter_tools_chrome_device.rand0', '--remote-debugging-port=12345', ...kChromeArgs, 'example_url', ], stderr: kDevtoolsStderr, ), ]); await expectReturnsNormallyLater( chromiumLauncher.launch( 'example_url', skipCheck: true, ) ); }); testWithoutContext('can launch x86_64 Chrome on ARM macOS', () async { final OperatingSystemUtils macOSUtils = FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm64); final ChromiumLauncher chromiumLauncher = ChromiumLauncher( fileSystem: fileSystem, platform: platform, processManager: processManager, operatingSystemUtils: macOSUtils, browserFinder: findChromeExecutable, logger: BufferLogger.test(), ); processManager.addCommands(<FakeCommand>[ const FakeCommand( command: <String>[ 'file', 'example_chrome', ], stdout: 'Mach-O 64-bit executable x86_64', ), const FakeCommand( command: <String>[ 'example_chrome', '--user-data-dir=/.tmp_rand0/flutter_tools_chrome_device.rand0', '--remote-debugging-port=12345', ...kChromeArgs, 'example_url', ], stderr: kDevtoolsStderr, ), ]); await expectReturnsNormallyLater( chromiumLauncher.launch( 'example_url', skipCheck: true, ) ); }); testWithoutContext('can launch ARM Chrome natively on ARM macOS when installed', () async { final OperatingSystemUtils macOSUtils = FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm64); final ChromiumLauncher chromiumLauncher = ChromiumLauncher( fileSystem: fileSystem, platform: platform, processManager: processManager, operatingSystemUtils: macOSUtils, browserFinder: findChromeExecutable, logger: BufferLogger.test(), ); processManager.addCommands(<FakeCommand>[ const FakeCommand( command: <String>[ 'file', 'example_chrome', ], stdout: 'Mach-O 64-bit executable arm64', ), const FakeCommand( command: <String>[ '/usr/bin/arch', '-arm64', 'example_chrome', '--user-data-dir=/.tmp_rand0/flutter_tools_chrome_device.rand0', '--remote-debugging-port=12345', ...kChromeArgs, 'example_url', ], stderr: kDevtoolsStderr, ), ]); await expectReturnsNormallyLater( chromiumLauncher.launch( 'example_url', skipCheck: true, ) ); }); testWithoutContext('can launch chrome with a custom debug port', () async { processManager.addCommand(const FakeCommand( command: <String>[ 'example_chrome', '--user-data-dir=/.tmp_rand0/flutter_tools_chrome_device.rand0', '--remote-debugging-port=10000', ...kChromeArgs, 'example_url', ], stderr: kDevtoolsStderr, )); await expectReturnsNormallyLater( chromeLauncher.launch( 'example_url', skipCheck: true, debugPort: 10000, ) ); }); testWithoutContext('can launch chrome with arbitrary flags', () async { processManager.addCommand(const FakeCommand( command: <String>[ 'example_chrome', '--user-data-dir=/.tmp_rand0/flutter_tools_chrome_device.rand0', '--remote-debugging-port=12345', ...kChromeArgs, '--autoplay-policy=no-user-gesture-required', '--incognito', '--auto-select-desktop-capture-source="Entire screen"', 'example_url', ], stderr: kDevtoolsStderr, )); await expectReturnsNormallyLater(chromeLauncher.launch( 'example_url', skipCheck: true, webBrowserFlags: <String>[ '--autoplay-policy=no-user-gesture-required', '--incognito', '--auto-select-desktop-capture-source="Entire screen"', ], )); }); testWithoutContext('can launch chrome headless', () async { processManager.addCommand(const FakeCommand( command: <String>[ 'example_chrome', '--user-data-dir=/.tmp_rand0/flutter_tools_chrome_device.rand0', '--remote-debugging-port=12345', ...kChromeArgs, '--headless', '--disable-gpu', '--no-sandbox', '--window-size=2400,1800', 'example_url', ], stderr: kDevtoolsStderr, )); await expectReturnsNormallyLater( chromeLauncher.launch( 'example_url', skipCheck: true, headless: true, ) ); }); testWithoutContext('can seed chrome temp directory with existing session data, excluding Cache folder', () async { final Completer<void> exitCompleter = Completer<void>.sync(); final Directory dataDir = fileSystem.directory('chrome-stuff'); final File preferencesFile = dataDir .childDirectory('Default') .childFile('preferences'); preferencesFile ..createSync(recursive: true) ..writeAsStringSync('"exit_type":"Crashed"'); final Directory defaultContentDirectory = dataDir .childDirectory('Default') .childDirectory('Foo'); defaultContentDirectory.createSync(recursive: true); // Create Cache directories that should be skipped for (final String cache in kCodeCache) { dataDir .childDirectory('Default') .childDirectory(cache) .createSync(recursive: true); } processManager.addCommand(FakeCommand( command: const <String>[ 'example_chrome', '--user-data-dir=/.tmp_rand0/flutter_tools_chrome_device.rand0', '--remote-debugging-port=12345', ...kChromeArgs, 'example_url', ], completer: exitCompleter, stderr: kDevtoolsStderr, )); await chromeLauncher.launch( 'example_url', skipCheck: true, cacheDir: dataDir, ); // validate any Default content is copied final Directory defaultContentDir = fileSystem .directory('.tmp_rand0/flutter_tools_chrome_device.rand0') .childDirectory('Default') .childDirectory('Foo'); expect(defaultContentDir, exists); exitCompleter.complete(); await Future<void>.delayed(const Duration(milliseconds: 1)); // writes non-crash back to dart_tool expect(preferencesFile.readAsStringSync(), '"exit_type":"Normal"'); // Validate cache dirs are not copied. for (final String cache in kCodeCache) { expect(fileSystem .directory('.tmp_rand0/flutter_tools_chrome_device.rand0') .childDirectory('Default') .childDirectory(cache), isNot(exists)); } // validate defaultContentDir is deleted after exit, data is in cache expect(defaultContentDir, isNot(exists)); }); testWithoutContext('can retry launch when glibc bug happens', () async { const List<String> args = <String>[ 'example_chrome', '--user-data-dir=/.tmp_rand0/flutter_tools_chrome_device.rand0', '--remote-debugging-port=12345', ...kChromeArgs, '--headless', '--disable-gpu', '--no-sandbox', '--window-size=2400,1800', 'example_url', ]; // Pretend to hit glibc bug 3 times. for (int i = 0; i < 3; i++) { processManager.addCommand(const FakeCommand( command: args, stderr: 'Inconsistency detected by ld.so: ../elf/dl-tls.c: 493: ' '_dl_allocate_tls_init: Assertion `listp->slotinfo[cnt].gen ' "<= GL(dl_tls_generation)' failed!", )); } // Succeed on the 4th try. processManager.addCommand(const FakeCommand( command: args, stderr: kDevtoolsStderr, )); await expectReturnsNormallyLater( chromeLauncher.launch( 'example_url', skipCheck: true, headless: true, ) ); }); testWithoutContext('can retry launch when chrome fails to start', () async { const List<String> args = <String>[ 'example_chrome', '--user-data-dir=/.tmp_rand0/flutter_tools_chrome_device.rand0', '--remote-debugging-port=12345', ...kChromeArgs, '--headless', '--disable-gpu', '--no-sandbox', '--window-size=2400,1800', 'example_url', ]; // Pretend to random error 3 times. for (int i = 0; i < 3; i++) { processManager.addCommand(const FakeCommand( command: args, stderr: 'BLAH BLAH', )); } // Succeed on the 4th try. processManager.addCommand(const FakeCommand( command: args, stderr: kDevtoolsStderr, )); await expectReturnsNormallyLater( chromeLauncher.launch( 'example_url', skipCheck: true, headless: true, ) ); }); testWithoutContext('gives up retrying when an error happens more than 3 times', () async { final BufferLogger logger = BufferLogger.test(); final ChromiumLauncher chromiumLauncher = ChromiumLauncher( fileSystem: fileSystem, platform: platform, processManager: processManager, operatingSystemUtils: operatingSystemUtils, browserFinder: findChromeExecutable, logger: logger, ); for (int i = 0; i < 4; i++) { processManager.addCommand(const FakeCommand( command: <String>[ 'example_chrome', '--user-data-dir=/.tmp_rand0/flutter_tools_chrome_device.rand0', '--remote-debugging-port=12345', ...kChromeArgs, '--headless', '--disable-gpu', '--no-sandbox', '--window-size=2400,1800', 'example_url', ], stderr: 'nothing in the std error indicating glibc error', )); } await expectToolExitLater( chromiumLauncher.launch( 'example_url', skipCheck: true, headless: true, ), contains('Failed to launch browser.'), ); expect(logger.errorText, contains('nothing in the std error indicating glibc error')); }); testWithoutContext('Logs an error and exits if connection check fails.', () async { final BufferLogger logger = BufferLogger.test(); final ChromiumLauncher chromiumLauncher = ChromiumLauncher( fileSystem: fileSystem, platform: platform, processManager: processManager, operatingSystemUtils: operatingSystemUtils, browserFinder: findChromeExecutable, logger: logger, ); processManager.addCommand(const FakeCommand( command: <String>[ 'example_chrome', '--user-data-dir=/.tmp_rand0/flutter_tools_chrome_device.rand0', '--remote-debugging-port=12345', ...kChromeArgs, 'example_url', ], stderr: kDevtoolsStderr, )); await expectToolExitLater( chromiumLauncher.launch( 'example_url', ), contains('Unable to connect to Chrome debug port:'), ); expect(logger.errorText, contains('SocketException')); }); test('can recover if getTabs throws a connection exception', () async { final BufferLogger logger = BufferLogger.test(); final FakeChromeConnection chromeConnection = FakeChromeConnection(maxRetries: 4); final ChromiumLauncher chromiumLauncher = ChromiumLauncher( fileSystem: fileSystem, platform: platform, processManager: processManager, operatingSystemUtils: operatingSystemUtils, browserFinder: findChromeExecutable, logger: logger, ); final FakeProcess process = FakeProcess(); final Chromium chrome = Chromium(0, chromeConnection, chromiumLauncher: chromiumLauncher, process: process, logger: logger); expect(await chromiumLauncher.connect(chrome, false), equals(chrome)); expect(logger.errorText, isEmpty); }); test('exits if getTabs throws a connection exception consistently', () async { final BufferLogger logger = BufferLogger.test(); final FakeChromeConnection chromeConnection = FakeChromeConnection(); final ChromiumLauncher chromiumLauncher = ChromiumLauncher( fileSystem: fileSystem, platform: platform, processManager: processManager, operatingSystemUtils: operatingSystemUtils, browserFinder: findChromeExecutable, logger: logger, ); final FakeProcess process = FakeProcess(); final Chromium chrome = Chromium(0, chromeConnection, chromiumLauncher: chromiumLauncher, process: process, logger: logger); await expectToolExitLater( chromiumLauncher.connect(chrome, false), allOf( contains('Unable to connect to Chrome debug port'), contains('incorrect format'), )); expect(logger.errorText, allOf( contains('incorrect format'), contains('OK'), contains('<html> ...'), )); }); } /// Fake chrome connection that fails to get tabs a few times. class FakeChromeConnection extends Fake implements ChromeConnection { /// Create a connection that throws a connection exception on first /// [maxRetries] calls to [getTabs]. /// If [maxRetries] is `null`, [getTabs] calls never succeed. FakeChromeConnection({this.maxRetries}): _retries = 0; final List<ChromeTab> tabs = <ChromeTab>[]; final int? maxRetries; int _retries; @override Future<ChromeTab?> getTab(bool Function(ChromeTab tab) accept, {Duration? retryFor}) async { return tabs.firstWhere(accept); } @override Future<List<ChromeTab>> getTabs({Duration? retryFor}) async { _retries ++; if (maxRetries == null || _retries < maxRetries!) { throw ConnectionException( formatException: const FormatException('incorrect format'), responseStatus: 'OK,', responseBody: '<html> ...'); } return tabs; } @override void close() {} }
flutter/packages/flutter_tools/test/web.shard/chrome_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/web.shard/chrome_test.dart", "repo_id": "flutter", "token_count": 10313 }
786
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'url_strategy.dart'; /// Function type that handles pop state events. typedef EventListener = dynamic Function(Object event); /// Encapsulates all calls to DOM apis, which allows the [UrlStrategy] classes /// to be platform agnostic and testable. /// /// For convenience, the [PlatformLocation] class can be used by implementations /// of [UrlStrategy] to interact with DOM apis like pushState, popState, etc. abstract interface class PlatformLocation { /// Registers an event listener for the `popstate` event. /// /// See: https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate void addPopStateListener(EventListener fn); /// Unregisters the given listener (added by [addPopStateListener]) from the /// `popstate` event. /// /// See: https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate void removePopStateListener(EventListener fn); /// The `pathname` part of the URL in the browser address bar. /// /// See: https://developer.mozilla.org/en-US/docs/Web/API/Location/pathname String get pathname; /// The `query` part of the URL in the browser address bar. /// /// See: https://developer.mozilla.org/en-US/docs/Web/API/Location/search String get search; /// The `hash` part of the URL in the browser address bar. /// /// See: https://developer.mozilla.org/en-US/docs/Web/API/Location/hash String get hash; /// The `state` in the current history entry. /// /// See: https://developer.mozilla.org/en-US/docs/Web/API/History/state Object? get state; /// Adds a new entry to the browser history stack. /// /// See: https://developer.mozilla.org/en-US/docs/Web/API/History/pushState void pushState(Object? state, String title, String url); /// Replaces the current entry in the browser history stack. /// /// See: https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState void replaceState(Object? state, String title, String url); /// Moves forwards or backwards through the history stack. /// /// A negative [count] value causes a backward move in the history stack. And /// a positive [count] value causes a forward move. /// /// Examples: /// /// * `go(-2)` moves back 2 steps in history. /// * `go(3)` moves forward 3 steps in history. /// /// See: https://developer.mozilla.org/en-US/docs/Web/API/History/go void go(int count); /// The base href where the Flutter app is being served. /// /// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base String? getBaseHref(); } /// Delegates to real browser APIs to provide platform location functionality. class BrowserPlatformLocation implements PlatformLocation { @override void addPopStateListener(EventListener fn) { // No-op. } @override void removePopStateListener(EventListener fn) { // No-op. } @override String get pathname => ''; @override String get search => ''; @override String get hash => ''; @override Object? get state => null; @override void pushState(Object? state, String title, String url) { // No-op. } @override void replaceState(Object? state, String title, String url) { // No-op. } @override void go(int count) { // No-op. } @override String? getBaseHref() => null; }
flutter/packages/flutter_web_plugins/lib/src/navigation_non_web/platform_location.dart/0
{ "file_path": "flutter/packages/flutter_web_plugins/lib/src/navigation_non_web/platform_location.dart", "repo_id": "flutter", "token_count": 1079 }
787
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'dart:io'; import 'package:vm_service/vm_service.dart' as vms; import '../common/logging.dart'; const Duration _kConnectTimeout = Duration(seconds: 3); final Logger _log = Logger('DartVm'); /// Signature of an asynchronous function for establishing a [vms.VmService] /// connection to a [Uri]. typedef RpcPeerConnectionFunction = Future<vms.VmService> Function( Uri uri, { required Duration timeout, }); /// [DartVm] uses this function to connect to the Dart VM on Fuchsia. /// /// This function can be assigned to a different one in the event that a /// custom connection function is needed. RpcPeerConnectionFunction fuchsiaVmServiceConnectionFunction = _waitAndConnect; /// Attempts to connect to a Dart VM service. /// /// Gives up after `timeout` has elapsed. Future<vms.VmService> _waitAndConnect( Uri uri, { Duration timeout = _kConnectTimeout, }) async { int attempts = 0; late WebSocket socket; while (true) { try { socket = await WebSocket.connect(uri.toString()); final StreamController<dynamic> controller = StreamController<dynamic>(); final Completer<void> streamClosedCompleter = Completer<void>(); socket.listen( (dynamic data) => controller.add(data), onDone: () => streamClosedCompleter.complete(), ); final vms.VmService service = vms.VmService( controller.stream, socket.add, disposeHandler: () => socket.close(), streamClosed: streamClosedCompleter.future ); // This call is to ensure we are able to establish a connection instead of // keeping on trucking and failing farther down the process. await service.getVersion(); return service; } catch (e) { // We should not be catching all errors arbitrarily here, this might hide real errors. // TODO(ianh): Determine which exceptions to catch here. await socket.close(); if (attempts > 5) { _log.warning('It is taking an unusually long time to connect to the VM...'); } attempts += 1; await Future<void>.delayed(timeout); } } } /// Restores the VM service connection function to the default implementation. void restoreVmServiceConnectionFunction() { fuchsiaVmServiceConnectionFunction = _waitAndConnect; } /// An error raised when a malformed RPC response is received from the Dart VM. /// /// A more detailed description of the error is found within the [message] /// field. class RpcFormatError extends Error { /// Basic constructor outlining the reason for the format error. RpcFormatError(this.message); /// The reason for format error. final String message; @override String toString() { return '$RpcFormatError: $message\n${super.stackTrace}'; } } /// Handles JSON RPC-2 communication with a Dart VM service. /// /// Either wraps existing RPC calls to the Dart VM service, or runs raw RPC /// function calls via [invokeRpc]. class DartVm { DartVm._(this._vmService, this.uri); final vms.VmService _vmService; /// The URL through which this DartVM instance is connected. final Uri uri; /// Attempts to connect to the given [Uri]. /// /// Throws an error if unable to connect. static Future<DartVm> connect( Uri uri, { Duration timeout = _kConnectTimeout, }) async { if (uri.scheme == 'http') { uri = uri.replace(scheme: 'ws', path: '/ws'); } final vms.VmService service = await fuchsiaVmServiceConnectionFunction(uri, timeout: timeout); return DartVm._(service, uri); } /// Returns a [List] of [IsolateRef] objects whose name matches `pattern`. /// /// This is not limited to Isolates running Flutter, but to any Isolate on the /// VM. Therefore, the [pattern] argument should be written to exclude /// matching unintended isolates. Future<List<IsolateRef>> getMainIsolatesByPattern(Pattern pattern) async { final vms.VM vmRef = await _vmService.getVM(); final List<IsolateRef> result = <IsolateRef>[]; for (final vms.IsolateRef isolateRef in vmRef.isolates!) { if (pattern.matchAsPrefix(isolateRef.name!) != null) { _log.fine('Found Isolate matching "$pattern": "${isolateRef.name}"'); result.add(IsolateRef._fromJson(isolateRef.json!, this)); } } return result; } /// Returns a list of [FlutterView] objects running across all Dart VM's. /// /// If there is no associated isolate with the flutter view (used to determine /// the flutter view's name), then the flutter view's ID will be added /// instead. If none of these things can be found (isolate has no name or the /// flutter view has no ID), then the result will not be added to the list. Future<List<FlutterView>> getAllFlutterViews() async { final List<FlutterView> views = <FlutterView>[]; final vms.Response rpcResponse = await _vmService.callMethod('_flutter.listViews'); for (final Map<String, dynamic> jsonView in (rpcResponse.json!['views'] as List<dynamic>).cast<Map<String, dynamic>>()) { views.add(FlutterView._fromJson(jsonView)); } return views; } /// Tests that the connection to the [vms.VmService] is valid. Future<void> ping() async { final vms.Version version = await _vmService.getVersion(); _log.fine('DartVM($uri) version check result: $version'); } /// Disconnects from the Dart VM Service. /// /// After this function completes this object is no longer usable. Future<void> stop() async { await _vmService.dispose(); await _vmService.onDone; } } /// Represents an instance of a Flutter view running on a Fuchsia device. class FlutterView { FlutterView._(this._name, this._id); /// Attempts to construct a [FlutterView] from a json representation. /// /// If there is no isolate and no ID for the view, throws an [RpcFormatError]. /// If there is an associated isolate, and there is no name for said isolate, /// also throws an [RpcFormatError]. /// /// All other cases return a [FlutterView] instance. The name of the /// view may be null, but the id will always be set. factory FlutterView._fromJson(Map<String, dynamic> json) { final Map<String, dynamic>? isolate = json['isolate'] as Map<String, dynamic>?; final String? id = json['id'] as String?; String? name; if (id == null) { throw RpcFormatError( 'Unable to find view name for the following JSON structure "$json"'); } if (isolate != null) { name = isolate['name'] as String?; if (name == null) { throw RpcFormatError('Unable to find name for isolate "$isolate"'); } } return FlutterView._(name, id); } /// Determines the name of the isolate associated with this view. If there is /// no associated isolate, this will be set to the view's ID. final String? _name; /// The ID of the Flutter view. final String _id; /// The ID of the [FlutterView]. String get id => _id; /// Returns the name of the [FlutterView]. /// /// May be null if there is no associated isolate. String? get name => _name; } /// This is a wrapper class for the `@Isolate` RPC object. /// /// See: /// https://github.com/dart-lang/sdk/blob/main/runtime/vm/service/service.md#isolate /// /// This class contains information about the Isolate like its name and ID, as /// well as a reference to the parent DartVM on which it is running. class IsolateRef { IsolateRef._(this.name, this.number, this.dartVm); factory IsolateRef._fromJson(Map<String, dynamic> json, DartVm dartVm) { final String? number = json['number'] as String?; final String? name = json['name'] as String?; final String? type = json['type'] as String?; if (type == null) { throw RpcFormatError('Unable to find type within JSON "$json"'); } if (type != '@Isolate') { throw RpcFormatError('Type "$type" does not match for IsolateRef'); } if (number == null) { throw RpcFormatError( 'Unable to find number for isolate ref within JSON "$json"'); } if (name == null) { throw RpcFormatError( 'Unable to find name for isolate ref within JSON "$json"'); } return IsolateRef._(name, int.parse(number), dartVm); } /// The full name of this Isolate (not guaranteed to be unique). final String name; /// The unique number ID of this isolate. final int number; /// The parent [DartVm] on which this Isolate lives. final DartVm dartVm; }
flutter/packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart/0
{ "file_path": "flutter/packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart", "repo_id": "flutter", "token_count": 2844 }
788
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter_driver/flutter_driver.dart'; import 'package:integration_test/common.dart' as common; import 'package:test/test.dart'; /// This file is only used for testing of `package:integration_test` – do not /// follow the conventions here if you are a user of `package:integration_test`. Future<void> main() async { test('fails gracefully', () async { final FlutterDriver driver = await FlutterDriver.connect(); final String jsonResult = await driver.requestData(null, timeout: const Duration(minutes: 1)); final common.Response response = common.Response.fromJson(jsonResult); await driver.close(); expect(response.allTestsPassed, isFalse); expect(response.failureDetails, hasLength(2)); expect(response.failureDetails![0].methodName, 'failure 1'); expect(response.failureDetails![1].methodName, 'failure 2'); }, timeout: Timeout.none); }
flutter/packages/integration_test/example/test_driver/failure_test.dart/0
{ "file_path": "flutter/packages/integration_test/example/test_driver/failure_test.dart", "repo_id": "flutter", "token_count": 328 }
789
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #import "FLTIntegrationTestRunner.h" #import "IntegrationTestPlugin.h" @import ObjectiveC.runtime; @import UIKit; @interface FLTIntegrationTestRunner () @property IntegrationTestPlugin *integrationTestPlugin; @end @implementation FLTIntegrationTestRunner - (instancetype)init { self = [super init]; _integrationTestPlugin = [IntegrationTestPlugin instance]; return self; } - (void)testIntegrationTestWithResults:(NS_NOESCAPE FLTIntegrationTestResults)testResult { IntegrationTestPlugin *integrationTestPlugin = self.integrationTestPlugin; // Spin the runloop. while (!integrationTestPlugin.testResults) { [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; } NSMutableSet<NSString *> *testCaseNames = [[NSMutableSet alloc] init]; [integrationTestPlugin.testResults enumerateKeysAndObjectsUsingBlock:^(NSString *test, NSString *result, BOOL *stop) { NSString *testSelectorName = [[self class] testCaseNameFromDartTestName:test]; // Validate Objective-C test names are unique after sanitization. if ([testCaseNames containsObject:testSelectorName]) { NSString *reason = [NSString stringWithFormat:@"Cannot test \"%@\", duplicate XCTestCase tests named %@", test, testSelectorName]; testResult(NSSelectorFromString(@"testDuplicateTestNames"), NO, reason); *stop = YES; return; } [testCaseNames addObject:testSelectorName]; SEL testSelector = NSSelectorFromString(testSelectorName); if ([result isEqualToString:@"success"]) { testResult(testSelector, YES, nil); } else { testResult(testSelector, NO, result); } }]; } - (NSDictionary<NSString *,UIImage *> *)capturedScreenshotsByName { return self.integrationTestPlugin.capturedScreenshotsByName; } + (NSString *)testCaseNameFromDartTestName:(NSString *)dartTestName { NSString *capitalizedString = dartTestName.localizedCapitalizedString; // Objective-C method names must be alphanumeric. NSCharacterSet *disallowedCharacters = NSCharacterSet.alphanumericCharacterSet.invertedSet; // Remove disallowed characters. NSString *upperCamelTestName = [[capitalizedString componentsSeparatedByCharactersInSet:disallowedCharacters] componentsJoinedByString:@""]; return [NSString stringWithFormat:@"test%@", upperCamelTestName]; } @end
flutter/packages/integration_test/ios/Classes/FLTIntegrationTestRunner.m/0
{ "file_path": "flutter/packages/integration_test/ios/Classes/FLTIntegrationTestRunner.m", "repo_id": "flutter", "token_count": 791 }
790
// 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:html' as html; import 'dart:js'; import 'dart:js_util' as js_util; /// The web implementation of [registerWebServiceExtension]. /// /// Adds a hidden `window.$flutterDriver` JavaScript function that's called by /// `FlutterWebDriver` to fulfill FlutterDriver commands. /// /// See also: /// /// * `_extension_io.dart`, which has the dart:io implementation void registerWebServiceExtension(Future<Map<String, dynamic>> Function(Map<String, String>) callback) { // Define the result variable because packages/flutter_driver/lib/src/driver/web_driver.dart // checks for this value to become non-null when waiting for the result. If this value is // undefined at the time of the check, WebDriver throws an exception. context[r'$flutterDriverResult'] = null; js_util.setProperty(html.window, r'$flutterDriver', allowInterop((dynamic message) async { try { final Map<String, dynamic> messageJson = jsonDecode(message as String) as Map<String, dynamic>; final Map<String, String> params = messageJson.cast<String, String>(); final Map<String, dynamic> result = await callback(params); context[r'$flutterDriverResult'] = json.encode(result); } catch (error, stackTrace) { // Encode the error in the same format the FlutterDriver extension uses. // See //packages/flutter_driver/lib/src/extension/extension.dart context[r'$flutterDriverResult'] = json.encode(<String, dynamic>{ 'isError': true, 'response': '$error\n$stackTrace', }); } })); }
flutter/packages/integration_test/lib/src/_extension_web.dart/0
{ "file_path": "flutter/packages/integration_test/lib/src/_extension_web.dart", "repo_id": "flutter", "token_count": 566 }
791
# This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # # This file should be version controlled. version: revision: f6b9c4da23f88394ae33a1915da47274a2d705d7 channel: main project_type: app # Tracks metadata for the flutter migrate command migration: platforms: - platform: root create_revision: f6b9c4da23f88394ae33a1915da47274a2d705d7 base_revision: f6b9c4da23f88394ae33a1915da47274a2d705d7 - platform: android create_revision: f6b9c4da23f88394ae33a1915da47274a2d705d7 base_revision: f6b9c4da23f88394ae33a1915da47274a2d705d7 - platform: ios create_revision: f6b9c4da23f88394ae33a1915da47274a2d705d7 base_revision: f6b9c4da23f88394ae33a1915da47274a2d705d7 - platform: linux create_revision: f6b9c4da23f88394ae33a1915da47274a2d705d7 base_revision: f6b9c4da23f88394ae33a1915da47274a2d705d7 - platform: macos create_revision: f6b9c4da23f88394ae33a1915da47274a2d705d7 base_revision: f6b9c4da23f88394ae33a1915da47274a2d705d7 - platform: web create_revision: f6b9c4da23f88394ae33a1915da47274a2d705d7 base_revision: f6b9c4da23f88394ae33a1915da47274a2d705d7 - platform: windows create_revision: f6b9c4da23f88394ae33a1915da47274a2d705d7 base_revision: f6b9c4da23f88394ae33a1915da47274a2d705d7 # User provided section # List of Local paths (relative to this file) that should be # ignored by the migrate tool. # # Files that are not part of the templates will be ignored by default. unmanaged_files: - 'lib/main.dart' - 'ios/Runner.xcodeproj/project.pbxproj'
gallery/.metadata/0
{ "file_path": "gallery/.metadata", "repo_id": "gallery", "token_count": 758 }
792
<?xml version="1.0" encoding="utf-8"?> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <background android:drawable="@mipmap/ic_launcher_background"/> <foreground android:drawable="@mipmap/ic_launcher_foreground"/> </adaptive-icon>
gallery/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml/0
{ "file_path": "gallery/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml", "repo_id": "gallery", "token_count": 98 }
793
// 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 'package:flutter/material.dart'; typedef LibraryLoader = Future<void> Function(); typedef DeferredWidgetBuilder = Widget Function(); /// Wraps the child inside a deferred module loader. /// /// The child is created and a single instance of the Widget is maintained in /// state as long as closure to create widget stays the same. /// class DeferredWidget extends StatefulWidget { DeferredWidget( this.libraryLoader, this.createWidget, { super.key, Widget? placeholder, }) : placeholder = placeholder ?? Container(); final LibraryLoader libraryLoader; final DeferredWidgetBuilder createWidget; final Widget placeholder; static final Map<LibraryLoader, Future<void>> _moduleLoaders = {}; static final Set<LibraryLoader> _loadedModules = {}; static Future<void> preload(LibraryLoader loader) { if (!_moduleLoaders.containsKey(loader)) { _moduleLoaders[loader] = loader().then((dynamic _) { _loadedModules.add(loader); }); } return _moduleLoaders[loader]!; } @override State<DeferredWidget> createState() => _DeferredWidgetState(); } class _DeferredWidgetState extends State<DeferredWidget> { _DeferredWidgetState(); Widget? _loadedChild; DeferredWidgetBuilder? _loadedCreator; @override void initState() { /// If module was already loaded immediately create widget instead of /// waiting for future or zone turn. if (DeferredWidget._loadedModules.contains(widget.libraryLoader)) { _onLibraryLoaded(); } else { DeferredWidget.preload(widget.libraryLoader) .then((dynamic _) => _onLibraryLoaded()); } super.initState(); } void _onLibraryLoaded() { setState(() { _loadedCreator = widget.createWidget; _loadedChild = _loadedCreator!(); }); } @override Widget build(BuildContext context) { /// If closure to create widget changed, create new instance, otherwise /// treat as const Widget. if (_loadedCreator != widget.createWidget && _loadedCreator != null) { _loadedCreator = widget.createWidget; _loadedChild = _loadedCreator!(); } return _loadedChild ?? widget.placeholder; } } /// Displays a progress indicator and text description explaining that /// the widget is a deferred component and is currently being installed. class DeferredLoadingPlaceholder extends StatelessWidget { const DeferredLoadingPlaceholder({ super.key, this.name = 'This widget', }); final String name; @override Widget build(BuildContext context) { return Center( child: Container( decoration: BoxDecoration( color: Colors.grey[700], border: Border.all( width: 20, color: Colors.grey[700]!, ), borderRadius: const BorderRadius.all(Radius.circular(10))), width: 250, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text('$name is installing.', style: Theme.of(context).textTheme.headlineMedium), Container(height: 10), Text( '$name is a deferred component which are downloaded and installed at runtime.', style: Theme.of(context).textTheme.bodyLarge), Container(height: 20), const Center(child: CircularProgressIndicator()), ], ), ), ); } }
gallery/lib/deferred_widget.dart/0
{ "file_path": "gallery/lib/deferred_widget.dart", "repo_id": "gallery", "token_count": 1313 }
794
// Copyright 2019 The Flutter team. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/gallery_localizations.dart'; // BEGIN appbarDemo class AppBarDemo extends StatelessWidget { const AppBarDemo({super.key}); @override Widget build(BuildContext context) { var localization = GalleryLocalizations.of(context)!; return Scaffold( appBar: AppBar( leading: IconButton( tooltip: MaterialLocalizations.of(context).openAppDrawerTooltip, icon: const Icon(Icons.menu), onPressed: () {}, ), title: Text( localization.demoAppBarTitle, ), actions: [ IconButton( tooltip: localization.starterAppTooltipFavorite, icon: const Icon( Icons.favorite, ), onPressed: () {}, ), IconButton( tooltip: localization.starterAppTooltipSearch, icon: const Icon( Icons.search, ), onPressed: () {}, ), PopupMenuButton<Text>( itemBuilder: (context) { return [ PopupMenuItem( child: Text( localization.demoNavigationRailFirst, ), ), PopupMenuItem( child: Text( localization.demoNavigationRailSecond, ), ), PopupMenuItem( child: Text( localization.demoNavigationRailThird, ), ), ]; }, ) ], ), body: Center( child: Text( localization.cupertinoTabBarHomeTab, ), ), ); } } // END
gallery/lib/demos/material/app_bar_demo.dart/0
{ "file_path": "gallery/lib/demos/material/app_bar_demo.dart", "repo_id": "gallery", "token_count": 1032 }
795
// Copyright 2019 The Flutter team. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/gallery_localizations.dart'; // BEGIN navDrawerDemo // Press the Navigation Drawer button to the left of AppBar to show // a simple Drawer with two items. class NavDrawerDemo extends StatelessWidget { const NavDrawerDemo({super.key}); @override Widget build(BuildContext context) { var localization = GalleryLocalizations.of(context)!; final drawerHeader = UserAccountsDrawerHeader( accountName: Text( localization.demoNavigationDrawerUserName, ), accountEmail: Text( localization.demoNavigationDrawerUserEmail, ), currentAccountPicture: const CircleAvatar( child: FlutterLogo(size: 42.0), ), ); final drawerItems = ListView( children: [ drawerHeader, ListTile( title: Text( localization.demoNavigationDrawerToPageOne, ), leading: const Icon(Icons.favorite), onTap: () { Navigator.pop(context); }, ), ListTile( title: Text( localization.demoNavigationDrawerToPageTwo, ), leading: const Icon(Icons.comment), onTap: () { Navigator.pop(context); }, ), ], ); return Scaffold( appBar: AppBar( title: Text( localization.demoNavigationDrawerTitle, ), ), body: Semantics( container: true, child: Center( child: Padding( padding: const EdgeInsets.all(50.0), child: Text( localization.demoNavigationDrawerText, ), ), ), ), drawer: Drawer( child: drawerItems, ), ); } } // END
gallery/lib/demos/material/navigation_drawer.dart/0
{ "file_path": "gallery/lib/demos/material/navigation_drawer.dart", "repo_id": "gallery", "token_count": 890 }
796
import 'package:animations/animations.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/gallery_localizations.dart'; // BEGIN sharedZAxisTransitionDemo class SharedZAxisTransitionDemo extends StatelessWidget { const SharedZAxisTransitionDemo({super.key}); @override Widget build(BuildContext context) { return Navigator( onGenerateRoute: (settings) { return _createHomeRoute(); }, ); } Route _createHomeRoute() { return PageRouteBuilder<void>( pageBuilder: (context, animation, secondaryAnimation) { final localizations = GalleryLocalizations.of(context)!; return Scaffold( appBar: AppBar( automaticallyImplyLeading: false, title: Column( children: [ Text(localizations.demoSharedZAxisTitle), Text( '(${localizations.demoSharedZAxisDemoInstructions})', style: Theme.of(context) .textTheme .titleSmall! .copyWith(color: Colors.white), ), ], ), actions: [ IconButton( icon: const Icon(Icons.settings), onPressed: () { Navigator.of(context).push<void>(_createSettingsRoute()); }, ), ], ), body: const _RecipePage(), ); }, transitionsBuilder: (context, animation, secondaryAnimation, child) { return SharedAxisTransition( fillColor: Colors.transparent, transitionType: SharedAxisTransitionType.scaled, animation: animation, secondaryAnimation: secondaryAnimation, child: child, ); }, ); } Route _createSettingsRoute() { return PageRouteBuilder<void>( pageBuilder: (context, animation, secondaryAnimation) => const _SettingsPage(), transitionsBuilder: (context, animation, secondaryAnimation, child) { return SharedAxisTransition( fillColor: Colors.transparent, transitionType: SharedAxisTransitionType.scaled, animation: animation, secondaryAnimation: secondaryAnimation, child: child, ); }, ); } } class _SettingsPage extends StatelessWidget { const _SettingsPage(); @override Widget build(BuildContext context) { final localizations = GalleryLocalizations.of(context)!; final settingsList = <_SettingsInfo>[ _SettingsInfo( Icons.person, localizations.demoSharedZAxisProfileSettingLabel, ), _SettingsInfo( Icons.notifications, localizations.demoSharedZAxisNotificationSettingLabel, ), _SettingsInfo( Icons.security, localizations.demoSharedZAxisPrivacySettingLabel, ), _SettingsInfo( Icons.help, localizations.demoSharedZAxisHelpSettingLabel, ), ]; return Scaffold( appBar: AppBar( title: Text( localizations.demoSharedZAxisSettingsPageTitle, ), ), body: ListView( children: [ for (var setting in settingsList) _SettingsTile(setting), ], ), ); } } class _SettingsTile extends StatelessWidget { const _SettingsTile(this.settingData); final _SettingsInfo settingData; @override Widget build(BuildContext context) { return Column( children: [ ListTile( leading: Icon(settingData.settingIcon), title: Text(settingData.settingsLabel), ), const Divider(thickness: 2), ], ); } } class _SettingsInfo { const _SettingsInfo(this.settingIcon, this.settingsLabel); final IconData settingIcon; final String settingsLabel; } class _RecipePage extends StatelessWidget { const _RecipePage(); @override Widget build(BuildContext context) { final localizations = GalleryLocalizations.of(context)!; final savedRecipes = <_RecipeInfo>[ _RecipeInfo( localizations.demoSharedZAxisBurgerRecipeTitle, localizations.demoSharedZAxisBurgerRecipeDescription, 'crane/destinations/eat_2.jpg', ), _RecipeInfo( localizations.demoSharedZAxisSandwichRecipeTitle, localizations.demoSharedZAxisSandwichRecipeDescription, 'crane/destinations/eat_3.jpg', ), _RecipeInfo( localizations.demoSharedZAxisDessertRecipeTitle, localizations.demoSharedZAxisDessertRecipeDescription, 'crane/destinations/eat_4.jpg', ), _RecipeInfo( localizations.demoSharedZAxisShrimpPlateRecipeTitle, localizations.demoSharedZAxisShrimpPlateRecipeDescription, 'crane/destinations/eat_6.jpg', ), _RecipeInfo( localizations.demoSharedZAxisCrabPlateRecipeTitle, localizations.demoSharedZAxisCrabPlateRecipeDescription, 'crane/destinations/eat_8.jpg', ), _RecipeInfo( localizations.demoSharedZAxisBeefSandwichRecipeTitle, localizations.demoSharedZAxisBeefSandwichRecipeDescription, 'crane/destinations/eat_10.jpg', ), ]; return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ const SizedBox(height: 8), Padding( padding: const EdgeInsetsDirectional.only(start: 8.0), child: Text(localizations.demoSharedZAxisSavedRecipesListTitle), ), const SizedBox(height: 4), Expanded( child: ListView( padding: const EdgeInsets.all(8), children: [ for (var recipe in savedRecipes) _RecipeTile(recipe, savedRecipes.indexOf(recipe)) ], ), ), ], ); } } class _RecipeInfo { const _RecipeInfo(this.recipeName, this.recipeDescription, this.recipeImage); final String recipeName; final String recipeDescription; final String recipeImage; } class _RecipeTile extends StatelessWidget { const _RecipeTile(this._recipe, this._index); final _RecipeInfo _recipe; final int _index; @override Widget build(BuildContext context) { return Row( children: [ SizedBox( height: 70, width: 100, child: ClipRRect( borderRadius: const BorderRadius.all(Radius.circular(4)), child: Image.asset( _recipe.recipeImage, package: 'flutter_gallery_assets', fit: BoxFit.fill, ), ), ), const SizedBox(width: 24), Expanded( child: Column( children: [ ListTile( title: Text(_recipe.recipeName), subtitle: Text(_recipe.recipeDescription), trailing: Text('0${_index + 1}'), ), const Divider(thickness: 2), ], ), ), ], ); } } // END sharedZAxisTransitionDemo
gallery/lib/demos/reference/motion_demo_shared_z_axis_transition.dart/0
{ "file_path": "gallery/lib/demos/reference/motion_demo_shared_z_axis_transition.dart", "repo_id": "gallery", "token_count": 3213 }
797
{ "loading": "Kargatzen", "deselect": "Desautatu", "select": "Hautatu", "selectable": "Hauta daiteke (luze sakatuta)", "selected": "Hautatuta", "demo": "Demo-bertsioa", "bottomAppBar": "Aplikazioaren behealdeko barra", "notSelected": "Hautatu gabe", "demoCupertinoSearchTextFieldTitle": "Testua bilatzeko eremua", "demoCupertinoPicker": "Hautatzailea", "demoCupertinoSearchTextFieldSubtitle": "Testua bilatzeko eremua (iOS estilokoa)", "demoCupertinoSearchTextFieldDescription": "Testua idatzita erabiltzaileari bilatzen uzten dion eremu; iradokizunak eskaini eta iragaz ditzake ere.", "demoCupertinoSearchTextFieldPlaceholder": "Idatzi testu bat", "demoCupertinoScrollbarTitle": "Korritze-barra", "demoCupertinoScrollbarSubtitle": "iOS estiloko korritze-barra", "demoCupertinoScrollbarDescription": "Haurra biltzen duen korritze-barra", "demoTwoPaneItem": "Elementua: {value}", "demoTwoPaneList": "Zerrenda", "demoTwoPaneFoldableLabel": "Gailu tolesgarria", "demoTwoPaneSmallScreenLabel": "Pantaila txikiko gailua", "demoTwoPaneSmallScreenDescription": "Hau da TwoPane-ren portaera pantaila txikiko gailu batean.", "demoTwoPaneTabletLabel": "Tableta / Mahaigaineko ordenagailua", "demoTwoPaneTabletDescription": "Hau da TwoPane-ren portaera pantaila handiago batean (adibidez, tableta edo mahaigaineko ordenagailu batean)", "demoTwoPaneTitle": "TwoPane", "demoTwoPaneSubtitle": "Diseinu moldagarriak gailu tolesgarrietan, eta pantaila handiko eta txikiko gailuetan", "splashSelectDemo": "Hautatu demo-bertsio bat", "demoTwoPaneFoldableDescription": "Hau da TwoPane-ren portaera gailu tolesgarri batean.", "demoTwoPaneDetails": "Xehetasunak", "demoTwoPaneSelectItem": "Hautatu elementu bat", "demoTwoPaneItemDetails": "{value} elementuaren xehetasunak", "demoCupertinoContextMenuActionText": "Laster-menua ikusteko, eduki sakatuta Flutter-en logotipoa.", "demoCupertinoContextMenuDescription": "Pantaila osoa hartzen duen iOS estiloko laster-menu bat, elementu bat luze sakatzean agertzen dena.", "demoAppBarTitle": "Aplikazioaren barra", "demoAppBarDescription": "Une horretan ikusten den pantailarekin erlazionatutako edukia eta ekintzak bistaratzen dira aplikazioaren barran. Branding-erako, pantailen izenetarako, nabigatzeko eta ekintzetarako erabiltzen da.", "demoDividerTitle": "Bereizlea", "demoDividerSubtitle": "Edukia zerrendetan eta diseinuetan taldekatzen duten lerro meheak dira bereizleak.", "demoDividerDescription": "Bereizleak zerrendetan, panel lerrakorretan eta bestelakoetan erabil daitezke edukia banatzeko.", "demoVerticalDividerTitle": "Bereizle bertikala", "demoCupertinoContextMenuTitle": "Laster-menua", "demoCupertinoContextMenuSubtitle": "iOS estiloko laster-menua", "demoAppBarSubtitle": "Bertan, une horretan ikusten den pantailarekin erlazionatutako informazioa eta ekintzak bistaratzen dira", "demoCupertinoContextMenuActionOne": "Lehen ekintza", "demoCupertinoContextMenuActionTwo": "Bigarren ekintza", "demoDateRangePickerDescription": "Material diseinuko data tarteen hautatzailea duen leiho bat dago ikusgai.", "demoDateRangePickerTitle": "Data tarteen hautatzailea", "demoNavigationDrawerUserName": "Erabiltzaile-izena", "demoNavigationDrawerUserEmail": "[email protected]", "demoNavigationDrawerText": "Pasatu hatza ertzetik edo sakatu goian ezkerrean dagoen ikonoa panel lerrakorra ikusteko", "demoNavigationRailTitle": "Nabigazio-erraila", "demoNavigationRailSubtitle": "Nabigazio-errail bat bistaratzen du aplikazioaren barruan", "demoNavigationRailDescription": "Aplikazio baten ezkerrean edo eskuinean bistaratuko den Material diseinudun widgeta, ikuspegi gutxi batzuen artean (hiru eta bost artean, normalean) nabigatzeko.", "demoNavigationRailFirst": "Lehena", "demoNavigationDrawerTitle": "Nabigazio-panel lerrakorra", "demoNavigationRailThird": "Hirugarrena", "replyStarredLabel": "Izardunak", "demoTextButtonDescription": "Botoi lauak kolorez aldatzen dira sakatzean, baina ez dira altxatzen. Erabili botoi lauak tresna-barretan, leihoetan eta betegarriak txertatzean.", "demoElevatedButtonTitle": "Botoi goratuak", "demoElevatedButtonDescription": "Botoi goratuek dimentsioa ematen diete nagusiki lauak diren diseinuei. Funtzioak nabarmentzen dituzte espazio bete edo zabaletan.", "demoOutlinedButtonTitle": "Botoi ingeradadunak", "demoOutlinedButtonDescription": "Botoi ingeradadunak opaku bihurtu eta goratu egiten dira sakatzean. Botoi goratuekin batera agertu ohi dira, ekintza alternatibo edo sekundario bat dagoela adierazteko.", "demoContainerTransformDemoInstructions": "Txartelak, zerrendak eta EBG", "demoNavigationDrawerSubtitle": "Panel lerrakor bat bistaratzen du aplikazio-barraren barruan", "replyDescription": "Posta-aplikazio eraginkor eta ardaztua", "demoNavigationDrawerDescription": "Aplikazio bateko nabigazio-estekak bistaratzeko pantailaren ertzetik horizontalean lerratzen den Material diseinudun panela.", "replyDraftsLabel": "Zirriborroak", "demoNavigationDrawerToPageOne": "Lehenengo elementua", "replyInboxLabel": "Sarrera-ontzia", "demoSharedXAxisDemoInstructions": "Hurrengoa eta Atzera botoiak", "replySpamLabel": "Spama", "replyTrashLabel": "Zaborrontzia", "replySentLabel": "Bidalitakoak", "demoNavigationRailSecond": "Bigarrena", "demoNavigationDrawerToPageTwo": "Bigarren elementua", "demoFadeScaleDemoInstructions": "Leiho gainerakorra eta EBG", "demoFadeThroughDemoInstructions": "Beheko nabigazioa", "demoSharedZAxisDemoInstructions": "Ezarpenen ikonoaren botoia", "demoSharedYAxisDemoInstructions": "Ordenatu \"Erreproduzitutako azkenak\" irizpidearen arabera", "demoTextButtonTitle": "Botoi lauak", "demoSharedZAxisBeefSandwichRecipeTitle": "Behiki-ogitartekoa", "demoSharedZAxisDessertRecipeDescription": "Postre baten errezeta", "demoSharedYAxisAlbumTileSubtitle": "Artista", "demoSharedYAxisAlbumTileTitle": "Albuma", "demoSharedYAxisRecentSortTitle": "Erreproduzitutako azkenak", "demoSharedYAxisAlphabeticalSortTitle": "A-Z", "demoSharedYAxisAlbumCount": "268 album", "demoSharedYAxisTitle": "Partekatutako Y ardatza", "demoSharedXAxisCreateAccountButtonText": "SORTU KONTU BAT", "demoFadeScaleAlertDialogDiscardButton": "BAZTERTU", "demoSharedXAxisSignInTextFieldLabel": "Helbide elektronikoa edo telefono-zenbakia", "demoSharedXAxisSignInSubtitleText": "Hasi saioa kontuarekin", "demoSharedXAxisSignInWelcomeText": "Kaixo, David Park", "demoSharedXAxisIndividualCourseSubtitle": "Banaka erakutsiko dira", "demoSharedXAxisBundledCourseSubtitle": "Multzokatuta", "demoFadeThroughAlbumsDestination": "Albumak", "demoSharedXAxisDesignCourseTitle": "Diseinua", "demoSharedXAxisIllustrationCourseTitle": "Ilustrazioa", "demoSharedXAxisBusinessCourseTitle": "Enpresa", "demoSharedXAxisArtsAndCraftsCourseTitle": "Eskulanak", "demoMotionPlaceholderSubtitle": "Bigarren lerroko testua", "demoFadeScaleAlertDialogCancelButton": "UTZI", "demoFadeScaleAlertDialogHeader": "Alerta-leihoa", "demoFadeScaleHideFabButton": "EZKUTATU EKINTZA-BOTOI GAINERAKORRA", "demoFadeScaleShowFabButton": "ERAKUTSI EKINTZA-BOTOI GAINERAKORRA", "demoFadeScaleShowAlertDialogButton": "ERAKUTSI LEIHO GAINERAKORRA", "demoFadeScaleDescription": "Pantailaren ertzean sartzen edo ertzetik ateratzen diren erabiltzaile-interfazeko elementuetarako erabiltzen da apurka desagertzearen eredua; adibidez, pantailaren erdialdean apurka desagertzen den leiho bat.", "demoFadeScaleTitle": "Apurka desagertzea", "demoFadeThroughTextPlaceholder": "123 argazki", "demoFadeThroughSearchDestination": "Bilatu", "demoFadeThroughPhotosDestination": "Argazkiak", "demoSharedXAxisCoursePageSubtitle": "Multzokatutako kategoriak talde gisa agertzen dira jarioan. Gero alda dezakezu hori.", "demoFadeThroughDescription": "Beren artean harreman handirik ez daukaten erabiltzaile-interfazeko elementuen arteko trantsizioetarako erabiltzen da agertzea eta desagertzearen eredua.", "demoFadeThroughTitle": "Agertzea eta desagertzea", "demoSharedZAxisHelpSettingLabel": "Laguntza", "demoMotionSubtitle": "Aurrez zehaztutako trantsizio-eredu guztiak", "demoSharedZAxisNotificationSettingLabel": "Jakinarazpenak", "demoSharedZAxisProfileSettingLabel": "Profila", "demoSharedZAxisSavedRecipesListTitle": "Gordetako errezetak", "demoSharedZAxisBeefSandwichRecipeDescription": "Behiki-ogitarteko baten errezeta", "demoSharedZAxisCrabPlateRecipeDescription": "Karramarro-plater baten errezeta", "demoSharedXAxisCoursePageTitle": "Sinplifikatu ikastaroen zerrendak", "demoSharedZAxisCrabPlateRecipeTitle": "Karramarroa", "demoSharedZAxisShrimpPlateRecipeDescription": "Izkira-plater baten errezeta", "demoSharedZAxisShrimpPlateRecipeTitle": "Izkira", "demoContainerTransformTypeFadeThrough": "AGERTZEA ETA DESAGERTZEA", "demoSharedZAxisDessertRecipeTitle": "Postrea", "demoSharedZAxisSandwichRecipeDescription": "Ogitarteko baten errezeta", "demoSharedZAxisSandwichRecipeTitle": "Ogitartekoa", "demoSharedZAxisBurgerRecipeDescription": "Hanburgesa baten errezeta", "demoSharedZAxisBurgerRecipeTitle": "Hanburgesa", "demoSharedZAxisSettingsPageTitle": "Ezarpenak", "demoSharedZAxisTitle": "Partekatutako Z ardatza", "demoSharedZAxisPrivacySettingLabel": "Pribatutasuna", "demoMotionTitle": "Mugimendua", "demoContainerTransformTitle": "Edukiontzien itxuraldaketa", "demoContainerTransformDescription": "Edukiontzi bat daukaten erabiltzaile-interfazeen arteko trantsizioetarako diseinatuta dago edukiontzien itxuraldaketaren eredua. Ereduak ikusizko konexio bat sortzen du erabiltzaile-interfazeko bi elementuren artean.", "demoContainerTransformModalBottomSheetTitle": "Apurka desagertzearen modua", "demoContainerTransformTypeFade": "APURKA DESAGERTZEA", "demoSharedYAxisAlbumTileDurationUnit": "min", "demoMotionPlaceholderTitle": "Izena", "demoSharedXAxisForgotEmailButtonText": "HELBIDE ELEKTRONIKOA AHAZTU DUZU?", "demoMotionSmallPlaceholderSubtitle": "Bigarrena", "demoMotionDetailsPageTitle": "Xehetasunen orria", "demoMotionListTileTitle": "Zerrendako elementua", "demoSharedAxisDescription": "Harreman espaziala edo nabigazionala daukaten erabiltzaile-interfazeko elementuen arteko trantsizioetarako erabiltzen da partekatutako ardatzaren eredua. Eredu horrek X, Y edo Z ardatzaren itxuraldaketa partekatua erabiltzen du elementuen arteko harremana sendotzeko.", "demoSharedXAxisTitle": "Partekatutako X ardatza", "demoSharedXAxisBackButtonText": "ATZERA", "demoSharedXAxisNextButtonText": "HURRENGOA", "demoSharedXAxisCulinaryCourseTitle": "Sukaldaritza", "githubRepo": "{repoName} GitHub biltegia", "fortnightlyMenuUS": "Ameriketako Estatu Batuak", "fortnightlyMenuBusiness": "Negozioak", "fortnightlyMenuScience": "Zientzia", "fortnightlyMenuSports": "Kirolak", "fortnightlyMenuTravel": "Bidaiak", "fortnightlyMenuCulture": "Kultura", "fortnightlyTrendingTechDesign": "DiseinuTeknologikoa", "rallyBudgetDetailAmountLeft": "Gelditzen dena", "fortnightlyHeadlineArmy": "Armada Berdea barrualdetik eraldatzea", "fortnightlyDescription": "Edukian oinarritutako albiste-aplikazioa", "rallyBillDetailAmountDue": "Zor duzuna", "rallyBudgetDetailTotalCap": "Muga, guztira", "rallyBudgetDetailAmountUsed": "Erabilitakoa", "fortnightlyTrendingHealthcareRevolution": "OsasunZerbitzuenIraultza", "fortnightlyMenuFrontPage": "Orri nagusia", "fortnightlyMenuWorld": "Mundua", "rallyBillDetailAmountPaid": "Ordaindutakoa", "fortnightlyMenuPolitics": "Politika", "fortnightlyHeadlineBees": "Soroetako erleak desagertzen ari dira", "fortnightlyHeadlineGasoline": "Gasolinaren etorkizuna", "fortnightlyTrendingGreenArmy": "ArmadaBerdea", "fortnightlyHeadlineFeminists": "Feministak alderdi baten alde jarri dira", "fortnightlyHeadlineFabrics": "Diseinatzaileek teknologia erabiltzen dute ehun futuristak sortzeko", "fortnightlyHeadlineStocks": "Akzioak igotzen ez direnez, dibisak dituzte askok ikusmiran", "fortnightlyTrendingReform": "Eraldaketa", "fortnightlyMenuTech": "Teknologia", "fortnightlyHeadlineWar": "Estatubatuarren bizitza zatituak gerran zehar", "fortnightlyHeadlineHealthcare": "Osasun-zerbitzuen iraultza isil eta boteretsua", "fortnightlyLatestUpdates": "Informazio eguneratuena", "fortnightlyTrendingStocks": "Akzioak", "rallyBillDetailTotalAmount": "Zenbatekoa, guztira", "demoCupertinoPickerDateTime": "Data eta ordua", "signIn": "HASI SAIOA", "dataTableRowWithSugar": "{value} azukrearekin", "dataTableRowApplePie": "Sagar-tarta", "dataTableRowDonut": "Donuta", "dataTableRowHoneycomb": "Abaraska", "dataTableRowLollipop": "Txupatxusa", "dataTableRowJellyBean": "Gominola", "dataTableRowGingerbread": "Jengibre-gaileta", "dataTableRowCupcake": "Cupcake-a", "dataTableRowEclair": "Éclair-a", "dataTableRowIceCreamSandwich": "Izozki-sandwicha", "dataTableRowFrozenYogurt": "Jogurt izoztua", "dataTableColumnIron": "Burdina (%)", "dataTableColumnCalcium": "Kaltzioa (%)", "dataTableColumnSodium": "Sodioa (mg)", "demoTimePickerTitle": "Ordu-hautatzailea", "demo2dTransformationsResetTooltip": "Berrezarri bihurketak", "dataTableColumnFat": "Koipea (g)", "dataTableColumnCalories": "Kaloriak", "dataTableColumnDessert": "Postrea (errazio bat)", "cardsDemoTravelDestinationLocation1": "Thanjavur, Tamil Nadu", "demoTimePickerDescription": "Material diseinuko ordu-hautatzailea duen leiho bat dago ikusgai.", "demoPickersShowPicker": "ERAKUTSI HAUTATZAILEA", "demoTabsScrollingTitle": "Korritzen dena", "demoTabsNonScrollingTitle": "Korritzen ez dena", "craneHours": "{hours,plural,=1{1 h}other{{hours} h}}", "craneMinutes": "{minutes,plural,=1{1 min}other{{minutes} min}}", "craneFlightDuration": "{hoursShortForm} eta {minutesShortForm}", "dataTableHeader": "Elikadura", "demoDatePickerTitle": "Data-hautatzailea", "demoPickersSubtitle": "Data eta orduaren hautapena", "demoPickersTitle": "Hautatzaileak", "demo2dTransformationsEditTooltip": "Editatu lauza", "demoDataTableDescription": "Datu-taulek errenkada eta zutabetan bistaratzen dute informazioa, sareta gisa. Erraz bilatzeko moduan dago antolatuta informazioa, erabiltzaileek ereduak eta estatistikak bila ditzaten.", "demo2dTransformationsDescription": "Sakatu hau lauzak editatzeko eta erabili keinuak eszenaren barruan mugitzeko. Arrastatu mugitzeko, atximurkatu zooma aplikatzeko eta erabili bi hatz biratzeko. Hasierako orientaziora itzultzeko, sakatu berrezartzeko botoia.", "demo2dTransformationsSubtitle": "Mugitu, aplikatu zooma eta biratu", "demo2dTransformationsTitle": "2D bihurketak", "demoCupertinoTextFieldPIN": "PINa", "demoCupertinoTextFieldDescription": "Teklatu fisikoarekin edo pantailakoarekin testua idazteko eremua.", "demoCupertinoTextFieldSubtitle": "iOS estiloko testu-eremuak", "demoCupertinoTextFieldTitle": "Testu-eremuak", "demoDatePickerDescription": "Material diseinuko data-hautatzailea duen leiho bat dago ikusgai.", "demoCupertinoPickerTime": "Ordua", "demoCupertinoPickerDate": "Data", "demoCupertinoPickerTimer": "Tenporizadorea", "demoCupertinoPickerDescription": "iOS estiloko hautatzailearen widgeta, kateak, datak, orduak, edo datak eta orduak hautatzeko.", "demoCupertinoPickerSubtitle": "iOS estiloko hautatzailea", "demoCupertinoPickerTitle": "Hautatzaileak", "dataTableRowWithHoney": "{value} eztiarekin", "cardsDemoTravelDestinationCity2": "Chettinad", "bannerDemoResetText": "Berrezarri banda", "bannerDemoMultipleText": "Ekintza bat baino gehiago", "bannerDemoLeadingText": "Aurreko ikonoa", "dismiss": "BAZTERTU", "cardsDemoTappable": "Sakatu egin daiteke", "cardsDemoSelectable": "Hautatu egin daiteke (luze sakatuta)", "cardsDemoExplore": "Arakatu", "cardsDemoExploreSemantics": "Arakatu {destinationName}", "cardsDemoShareSemantics": "Partekatu {destinationName}", "cardsDemoTravelDestinationTitle1": "Tamil Nadun bisitatu beharreko hamar hiri nagusiak", "cardsDemoTravelDestinationDescription1": "10.", "cardsDemoTravelDestinationCity1": "Thanjavur", "dataTableColumnProtein": "Proteinak (g)", "cardsDemoTravelDestinationTitle2": "Indiaren hegoaldeko artisauak", "cardsDemoTravelDestinationDescription2": "Zeta-iruleak", "bannerDemoText": "Beste gailuan eguneratu da pasahitza. Hasi saioa berriro.", "cardsDemoTravelDestinationLocation2": "Sivaganga, Tamil Nadu", "cardsDemoTravelDestinationTitle3": "Brihadisvara tenplua", "cardsDemoTravelDestinationDescription3": "Tenpluak", "demoBannerTitle": "Banda", "demoBannerSubtitle": "Zerrenda batean banda bat bistaratzea", "demoBannerDescription": "Bandek mezu garrantzitsu eta laburrak bistaratzen dituzte, eta erabiltzaileek gauzatu beharreko ekintzak adierazten. Bandak baztertu egin daitezke; baina ez beren kabuz, erabiltzaileek hala adierazita baizik.", "demoCardTitle": "Txartelak", "demoCardSubtitle": "Oinarrizko txartelak, ertz biribilduekin", "demoCardDescription": "Material diseinuko orri bat da txartela. Haren bidez, erlazionatutako informazioa ematen da; adibidez, album bat, kokapen geografiko bat, janari bat, harremanetarako xehetasunak, etab.", "demoDataTableTitle": "Datu-taulak", "demoDataTableSubtitle": "Informazioa duten errenkadak eta zutabeak", "dataTableColumnCarbs": "Karbohidratoak (g)", "placeTanjore": "Tanjore", "demoGridListsTitle": "Sareta itxurako zerrendak", "placeFlowerMarket": "Lore-azoka", "placeBronzeWorks": "Brontze-meategiak", "placeMarket": "Merkatua", "placeThanjavurTemple": "Thanjavur tenplua", "placeSaltFarm": "Gatzaga", "placeScooters": "Scooterrak", "placeSilkMaker": "Zetagilea", "placeLunchPrep": "Bazkaria prestatzen", "placeBeach": "Hondartza", "placeFisherman": "Arrantzalea", "demoMenuSelected": "Hautatuta: {value}", "demoMenuRemove": "Kendu", "demoMenuGetLink": "Eskuratu esteka", "demoMenuShare": "Partekatu", "demoBottomAppBarSubtitle": "Nabigazio-aukerak eta erabilgarri dauden ekintzak bistaratzen ditu behealdean", "demoMenuAnItemWithASectionedMenu": "Menu sekziodun bat duen aukera bat", "demoMenuADisabledMenuItem": "Menuko desgaitutako aukera", "demoLinearProgressIndicatorTitle": "Garapen-adierazle lineala", "demoMenuContextMenuItemOne": "Laster-menuko lehen aukera", "demoMenuAnItemWithASimpleMenu": "Menu sinple bat duen aukera bat", "demoCustomSlidersTitle": "Graduatzaile pertsonalizatuak", "demoMenuAnItemWithAChecklistMenu": "Egiaztapen-zerrendaren menu bat duen aukera bat", "demoCupertinoActivityIndicatorTitle": "Jardueren adierazlea", "demoCupertinoActivityIndicatorSubtitle": "iOS estiloko jardueren adierazleak", "demoCupertinoActivityIndicatorDescription": "iOS estiloko jardueren adierazle bat, eskuinetara bira egiten duena.", "demoCupertinoNavigationBarTitle": "Nabigazio-barra", "demoCupertinoNavigationBarSubtitle": "iOS estiloko nabigazio-barra", "demoCupertinoNavigationBarDescription": "iOS estiloko nabigazio-barra bat. Nabigazio-barra tresna-barra bat da, tresna-barraren erdian orriaren izena daukana, besterik gabe.", "demoCupertinoPullToRefreshTitle": "Tiratu freskatzeko", "demoCupertinoPullToRefreshSubtitle": "Edukia kontrolatzeko iOS estiloko \"Tiratu freskatzeko\" motako aukera", "demoCupertinoPullToRefreshDescription": "Edukia kontrolatzeko iOS estiloko \"Tiratu freskatzeko\" motako aukera inplementatzeko widget bat.", "demoProgressIndicatorTitle": "Garapen-adierazleak", "demoProgressIndicatorSubtitle": "Lineala, zirkularra, zehaztugabea", "demoCircularProgressIndicatorTitle": "Garapen-adierazle zirkularra", "demoCircularProgressIndicatorDescription": "Material diseinuaren garapen-adierazle zirkular bat, zeinak bira egiten baitu aplikazioa okupatuta dagoela adierazteko.", "demoMenuFour": "Lau", "demoLinearProgressIndicatorDescription": "Material diseinuaren garapen-adierazle lineal bat; garapen-barra ere baderitzo.", "demoTooltipTitle": "Aholkuak", "demoTooltipSubtitle": "Luze sakatzean edo gainetik pasatzean erakusten den mezu laburra", "demoTooltipDescription": "Aholkuak testu-etiketak dira, zeinek botoi baten edo erabiltzaile-interfazeko ekintza baten funtzioa azaltzen baitute. Aholkuek testu informatibo bat bistaratzen dute erabiltzaileak aukera baten gainetik pasatzen direnean, aukera baten gainean fokua jartzen dutenean edo aukera bat luze sakatzen dutenean.", "demoTooltipInstructions": "Aholkua bistaratzeko, sakatu luze edo pasatu gainetik.", "placeChennai": "Chennai", "demoMenuChecked": "Markatuta: {value}", "placeChettinad": "Chettinad", "demoMenuPreview": "Aurreikusi", "demoBottomAppBarTitle": "Aplikazioaren behealdeko barra", "demoBottomAppBarDescription": "Aplikazioaren behealdeko barrak nabigazio-panel lerrakor bat erakusten du, bai eta erabilgarri dauden ekintzak ere (gehienez, lau). Barra horretan agertzen da ekintza-botoi gainerakorra ere.", "bottomAppBarNotch": "Koska", "bottomAppBarPosition": "Ekintza-botoi gainerakorraren kokapena", "bottomAppBarPositionDockedEnd": "Ainguratuta - Amaieran", "bottomAppBarPositionDockedCenter": "Ainguratuta - Erdian", "bottomAppBarPositionFloatingEnd": "Gainerakorra - Amaieran", "bottomAppBarPositionFloatingCenter": "Gainerakorra - Erdian", "demoSlidersEditableNumericalValue": "Zenbakizko balio editagarria", "demoGridListsSubtitle": "Errenkaden eta zutabeen diseinua", "demoGridListsDescription": "Sareta itxurako zerrendak oso egokiak dira datu homogeneoak aurkezteko, batez ere irudiak. Sareta itxurako zerrendetan, lauza esaten zaio elementu bakoitzari.", "demoGridListsImageOnlyTitle": "Irudia soilik", "demoGridListsHeaderTitle": "Goiburuarekin", "demoGridListsFooterTitle": "Oinarekin", "demoSlidersTitle": "Graduatzaileak", "demoSlidersSubtitle": "Hatza pasatuta balio bat hautatzeko balio duten widgetak", "demoSlidersDescription": "Graduatzaileek balioen barruti bat islatzen dute barra batean, eta erabiltzaileek barruti horretako balio bakarra hauta dezakete bertan. Oso erabilgarriak dira irudiei iragazkiak aplikatzeko edo, orokorrean, ezarpenak doitzeko; esaterako, distira edo bolumena.", "demoRangeSlidersTitle": "Barruti zehatzeko graduatzaileak", "demoRangeSlidersDescription": "Graduatzaileek balio barruti bat islatzen dute, barra batean. Ikono bana izan dezakete bi muturretan, balioen barrutia zein den erakusteko. Oso erabilgarriak dira irudiei iragazkiak aplikatzeko edo, orokorrean, ezarpenak doitzeko; esaterako, distira edo bolumena.", "demoMenuAnItemWithAContextMenuButton": "Laster-menu bat duen aukera bat", "demoCustomSlidersDescription": "Graduatzaileek balioen barruti bat islatzen dute barra batean, eta erabiltzaileek barruti horretako balio bakarra edo azpi-barruti bat hauta dezakete bertan. Graduatzaileei gaiak ezar dakizkieke eta pertsonalizatu egin daitezke.", "demoSlidersContinuousWithEditableNumericalValue": "Etengabea, zenbakizko balio editagarriarekin", "demoSlidersDiscrete": "Erabiltzaileak zehaztutako balioak dituen graduatzailea", "demoSlidersDiscreteSliderWithCustomTheme": "Erabiltzaileak zehaztutako balioak dituen graduatzailea gai pertsonalizatuarekin", "demoSlidersContinuousRangeSliderWithCustomTheme": "Barruti zehatzeko graduatzaile etengabea gai pertsonalizatuarekin", "demoSlidersContinuous": "Etengabea", "placePondicherry": "Pondicherry", "demoMenuTitle": "Menua", "demoContextMenuTitle": "Laster-menua", "demoSectionedMenuTitle": "Menu sekzioduna", "demoSimpleMenuTitle": "Menu sinplea", "demoChecklistMenuTitle": "Egiaztapen-zerrendaren menua", "demoMenuSubtitle": "Menuko botoiak eta menu sinpleak", "demoMenuDescription": "Menuek aukera-zerrenda bat erakusten dute aldi batez. Erabiltzaileek botoi, ekintza edo bestelako kontrol-aukera batekin interakzioan jarduten dutenean agertzen dira menuak.", "demoMenuItemValueOne": "Menuko lehen aukera", "demoMenuItemValueTwo": "Menuko bigarren aukera", "demoMenuItemValueThree": "Menuko hirugarren aukera", "demoMenuOne": "Bat", "demoMenuTwo": "Bi", "demoMenuThree": "Hiru", "demoMenuContextMenuItemThree": "Laster-menuko hirugarren aukera", "demoCupertinoSwitchSubtitle": "iOS estiloko etengailua", "demoSnackbarsText": "Hona hemen snackbar bat.", "demoCupertinoSliderSubtitle": "iOS estiloko graduatzailea", "demoCupertinoSliderDescription": "Balio sorta jarraitu edo zehatz batetik hautatzeko balio du graduatzaileak.", "demoCupertinoSliderContinuous": "Jarraitua: {value}", "demoCupertinoSliderDiscrete": "Zehatza: {value}", "demoSnackbarsAction": "Snackbar-aren ekintza sakatu duzu.", "backToGallery": "Itzuli galeriara", "demoCupertinoTabBarTitle": "Fitxa-barra", "demoCupertinoSwitchDescription": "Ezarpen bat aktibatu eta desaktibatzeko balio du etengailuak.", "demoSnackbarsActionButtonLabel": "EKINTZA", "cupertinoTabBarProfileTab": "Profila", "demoSnackbarsButtonLabel": "ERAKUTSI SNACKBAR BAT", "demoSnackbarsDescription": "Aplikazio batek egin duen edo egingo duen prozesu baten berri ematen diete snackbar-ek erabiltzaileei. Tarte batez agertzen dira pantailaren behealdean. Ez dute etengo aplikazioa erabiltzeko modua eta ezer egin gabe desagertuko dira.", "demoSnackbarsSubtitle": "Pantailaren beheko aldean mezuak erakusten dituzte snackbar-ek", "demoSnackbarsTitle": "Snackbar-ak", "demoCupertinoSliderTitle": "Graduatzailea", "cupertinoTabBarChatTab": "Txata", "cupertinoTabBarHomeTab": "Orri nagusia", "demoCupertinoTabBarDescription": "iOS estiloko beheko nabigazioko fitxa-barra bat. Hainbat fitxa bistaratzen ditu eta fitxa horietako bat (modu lehenetsian lehena) aktibatuta dago.", "demoCupertinoTabBarSubtitle": "iOS estiloko beheko fitxa-barra", "demoOptionsFeatureTitle": "Ikusi aukerak", "demoOptionsFeatureDescription": "Sakatu hau demoaren aukerak ikusteko.", "demoCodeViewerCopyAll": "KOPIATU DENA", "shrineScreenReaderRemoveProductButton": "Kendu {product}", "shrineScreenReaderProductAddToCart": "Gehitu saskian", "shrineScreenReaderCart": "{quantity,plural,=0{Erosketa-saskia. Hutsik dago.}=1{Erosketa-saskia. Produktu bat dauka.}other{Erosketa-saskia. {quantity} produktu dauzka.}}", "demoCodeViewerFailedToCopyToClipboardMessage": "Ezin izan da kopiatu arbelean: {error}", "demoCodeViewerCopiedToClipboardMessage": "Kopiatu da arbelean.", "craneSleep8SemanticLabel": "Maiar hondarrak itsaslabar baten ertzean", "craneSleep4SemanticLabel": "Mendialdeko hotel bat, laku baten ertzean", "craneSleep2SemanticLabel": "Machu Picchuko hiria", "craneSleep1SemanticLabel": "Txalet bat zuhaitz hostoiraunkorreko paisaia elurtuan", "craneSleep0SemanticLabel": "Itsasoko bungalow-ak", "craneFly13SemanticLabel": "Igerileku bat itsasertzean, palmondoekin", "craneFly12SemanticLabel": "Igerileku bat palmondoekin", "craneFly11SemanticLabel": "Adreiluzko itsasargia", "craneFly10SemanticLabel": "Al-Azhar meskitaren dorreak ilunabarrean", "craneFly9SemanticLabel": "Gizon bat antzinako auto urdin baten aurrean makurtuta", "craneFly8SemanticLabel": "Supertree Grove", "craneEat9SemanticLabel": "Kafetegi bateko salmahaia, gozoekin", "craneEat2SemanticLabel": "Hanburgesa bat", "craneFly5SemanticLabel": "Mendialdeko hotel bat, laku baten ertzean", "demoSelectionControlsSubtitle": "Koadroak, aukera-botoiak eta etengailuak", "craneEat10SemanticLabel": "Emakume bat pastrami-sandwich bat eskuan duela", "craneFly4SemanticLabel": "Itsasoko bungalow-ak", "craneEat7SemanticLabel": "Okindegiko sarrera", "craneEat6SemanticLabel": "Izkira-platera", "craneEat5SemanticLabel": "Jatetxe moderno bateko mahaiak", "craneEat4SemanticLabel": "Txokolatezko postrea", "craneEat3SemanticLabel": "Tako korear bat", "craneFly3SemanticLabel": "Machu Picchuko hiria", "craneEat1SemanticLabel": "Amerikar estiloko taberna bat hutsik", "craneEat0SemanticLabel": "Pizza bat egurrezko labe batean", "craneSleep11SemanticLabel": "Taipei 101 etxe-orratza", "craneSleep10SemanticLabel": "Al-Azhar meskitaren dorreak ilunabarrean", "craneSleep9SemanticLabel": "Adreiluzko itsasargia", "craneEat8SemanticLabel": "Otarrain-platera", "craneSleep7SemanticLabel": "Eraikin koloretsuak Ribeira plazan", "craneSleep6SemanticLabel": "Igerileku bat palmondoekin", "craneSleep5SemanticLabel": "Denda bat zelai batean", "settingsButtonCloseLabel": "Itxi ezarpenak", "demoSelectionControlsCheckboxDescription": "Koadroei esker, multzo bereko aukera bat baino gehiago hauta ditzake erabiltzaileak. Koadroek Egia eta Gezurra balioak izan ohi dituzte. Hiru aukerakoak badira, aldiz, balio nulua izan ohi dute bi horiez gain.", "settingsButtonLabel": "Ezarpenak", "demoListsTitle": "Zerrendak", "demoListsSubtitle": "Zerrenda lerrakorren diseinuak", "demoListsDescription": "Altuera finkoko lerro bakarra; testua eta haren atzean edo aurrean ikono bat izan ohi ditu.", "demoOneLineListsTitle": "Lerro bat", "demoTwoLineListsTitle": "Bi lerro", "demoListsSecondary": "Bigarren lerroko testua", "demoSelectionControlsTitle": "Hautapena kontrolatzeko aukerak", "craneFly7SemanticLabel": "Rushmore mendia", "demoSelectionControlsCheckboxTitle": "Koadroa", "craneSleep3SemanticLabel": "Gizon bat antzinako auto urdin baten aurrean makurtuta", "demoSelectionControlsRadioTitle": "Aukera-botoia", "demoSelectionControlsRadioDescription": "Aukera-botoiei esker, multzo bateko aukera bakarra hauta dezakete erabiltzaileek. Erabili aukera-botoiak erabiltzaileei aukera guztiak ondoz ondo erakutsi nahi badizkiezu, ondoren haietako bat hauta dezaten.", "demoSelectionControlsSwitchTitle": "Etengailua", "demoSelectionControlsSwitchDescription": "Aktibatu eta desaktibatzeko etengailuek ezarpen-aukera bakar baten egoera aldatzen dute. Etiketa txertatuek argi adierazi behar dute etengailuak zein aukera kontrolatzen duen eta hura zein egoeratan dagoen.", "craneFly0SemanticLabel": "Txalet bat zuhaitz hostoiraunkorreko paisaia elurtuan", "craneFly1SemanticLabel": "Denda bat zelai batean", "craneFly2SemanticLabel": "Tibetar banderatxoak mendi elurtuen parean", "craneFly6SemanticLabel": "Arte Ederren jauregiaren aireko ikuspegia", "rallySeeAllAccounts": "Ikusi kontu guztiak", "rallyBillAmount": "{billName} faktura ({amount}) data honetan ordaindu behar da: {date}.", "shrineTooltipCloseCart": "Itxi saskia", "shrineTooltipCloseMenu": "Itxi menua", "shrineTooltipOpenMenu": "Ireki menua", "shrineTooltipSettings": "Ezarpenak", "shrineTooltipSearch": "Bilatu", "demoTabsDescription": "Fitxei esker, edukia antolatuta dago pantailetan, datu multzoetan eta bestelako elkarrekintza sortetan.", "demoTabsSubtitle": "Independenteki gora eta behera mugi daitezkeen fitxak", "demoTabsTitle": "Fitxak", "rallyBudgetAmount": "\"{budgetName}\" izeneko aurrekontua: {amountUsed}/{amountTotal} erabilita; {amountLeft} gelditzen da", "shrineTooltipRemoveItem": "Kendu produktua", "rallyAccountAmount": "{accountName} bankuko {accountNumber} kontua ({amount}).", "rallySeeAllBudgets": "Ikusi aurrekontu guztiak", "rallySeeAllBills": "Ikusi faktura guztiak", "craneFormDate": "Hautatu data", "craneFormOrigin": "Aukeratu abiapuntua", "craneFly2": "Khumbu bailara (Nepal)", "craneFly3": "Machu Picchu (Peru)", "craneFly4": "Malé (Maldivak)", "craneFly5": "Vitznau (Suitza)", "craneFly6": "Mexiko Hiria (Mexiko)", "craneFly7": "Rushmore mendia (Ameriketako Estatu Batuak)", "settingsTextDirectionLocaleBased": "Lurraldeko ezarpenetan oinarrituta", "craneFly9": "Habana (Kuba)", "craneFly10": "Kairo (Egipto)", "craneFly11": "Lisboa (Portugal)", "craneFly12": "Napa (Ameriketako Estatu Batuak)", "craneFly13": "Bali (Indonesia)", "craneSleep0": "Malé (Maldivak)", "craneSleep1": "Aspen (Ameriketako Estatu Batuak)", "craneSleep2": "Machu Picchu (Peru)", "demoCupertinoSegmentedControlTitle": "Segmentatutako kontrola", "craneSleep4": "Vitznau (Suitza)", "craneSleep5": "Big Sur (Ameriketako Estatu Batuak)", "craneSleep6": "Napa (Ameriketako Estatu Batuak)", "craneSleep7": "Porto (Portugal)", "craneSleep8": "Tulum (Mexiko)", "craneEat5": "Seul (Hego Korea)", "demoChipTitle": "Pilulak", "demoChipSubtitle": "Sarrera, atributu edo ekintza bat adierazten duten elementu trinkoak", "demoActionChipTitle": "Ekintza-pilula", "demoActionChipDescription": "Ekintza-pilulak eduki nagusiarekin erlazionatutako ekintza bat abiarazten duten aukeren multzoa dira. Dinamikoki eta testuinguru egokian agertu behar dute.", "demoChoiceChipTitle": "Aukera-pilula", "demoChoiceChipDescription": "Aukera-pilulek multzo bateko aukera bakarra erakusten dute. Erlazionatutako testu deskribatzailea edo kategoriak ere badauzkate.", "demoFilterChipTitle": "Iragazteko pilula", "demoFilterChipDescription": "Iragazteko pilulek etiketak edo hitz deskribatzaileak erabiltzen dituzte edukia iragazteko.", "demoInputChipTitle": "Sarrera-pilula", "demoInputChipDescription": "Sarrera-pilulek informazio konplexua ematen dute modu trinkoan; adibidez, entitate bat (pertsona, toki edo gauza bat) edo elkarrizketa bateko testua.", "craneSleep9": "Lisboa (Portugal)", "craneEat10": "Lisboa (Portugal)", "demoCupertinoSegmentedControlDescription": "Bata bestearen baztergarri diren zenbait aukeraren artean hautatzeko erabiltzen da. Segmentatutako kontroleko aukera bat hautatzen denean, segmentatutako kontroleko gainerako aukerak desautatu egiten dira.", "chipTurnOnLights": "Piztu argiak", "chipSmall": "Txikia", "chipMedium": "Ertaina", "chipLarge": "Handia", "chipElevator": "Igogailua", "chipWasher": "Garbigailua", "chipFireplace": "Tximinia", "chipBiking": "Bizikletan", "craneFormDiners": "Mahaikideak", "rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{Zerga-kenkari potentzial handiagoa! Esleitu kategoriak esleitu gabeko transakzio bati.}other{Zerga-kenkari potentzial handiagoa! Esleitu kategoriak esleitu gabeko {count} transakziori.}}", "craneFormTime": "Hautatu ordua", "craneFormLocation": "Hautatu kokapena", "craneFormTravelers": "Bidaiariak", "craneEat8": "Atlanta (Ameriketako Estatu Batuak)", "craneFormDestination": "Aukeratu helmuga", "craneFormDates": "Hautatu datak", "craneFly": "HEGALDIAK", "craneSleep": "Lotarako tokia", "craneEat": "JATEKOAK", "craneFlySubhead": "Arakatu hegaldiak helmugaren arabera", "craneSleepSubhead": "Arakatu jabetzak helmugaren arabera", "craneEatSubhead": "Arakatu jatetxeak helmugaren arabera", "craneFlyStops": "{numberOfStops,plural,=0{Geldialdirik gabekoa}=1{1 geldialdi}other{{numberOfStops} geldialdi}}", "craneSleepProperties": "{totalProperties,plural,=0{Ez dauka jabetzarik erabilgarri}=1{1 jabetza erabilgarri}other{{totalProperties} jabetza erabilgarri}}", "craneEatRestaurants": "{totalRestaurants,plural,=0{Ez dauka jatetxerik}=1{1 jatetxe}other{{totalRestaurants} jatetxe}}", "craneFly0": "Aspen (Ameriketako Estatu Batuak)", "demoCupertinoSegmentedControlSubtitle": "iOS estiloarekin segmentatutako kontrola", "craneSleep10": "Kairo (Egipto)", "craneEat9": "Madril (Espainia)", "craneFly1": "Big Sur (Ameriketako Estatu Batuak)", "craneEat7": "Nashville (Ameriketako Estatu Batuak)", "craneEat6": "Seattle (Ameriketako Estatu Batuak)", "craneFly8": "Singapur", "craneEat4": "Paris (Frantzia)", "craneEat3": "Portland (Ameriketako Estatu Batuak)", "craneEat2": "Córdoba (Argentina)", "craneEat1": "Dallas (Ameriketako Estatu Batuak)", "craneEat0": "Napoles (Italia)", "craneSleep11": "Taipei (Taiwan)", "craneSleep3": "Habana (Kuba)", "shrineLogoutButtonCaption": "AMAITU SAIOA", "rallyTitleBills": "FAKTURAK", "rallyTitleAccounts": "KONTUAK", "shrineProductVagabondSack": "Vagabond bizkar-zorroa", "rallyAccountDetailDataInterestYtd": "Urte-hasieratik gaurdainoko interesak", "shrineProductWhitneyBelt": "Whitney gerrikoa", "shrineProductGardenStrand": "Alez egindako lepokoa", "shrineProductStrutEarrings": "Strut belarritakoak", "shrineProductVarsitySocks": "Unibertsitateko taldeko galtzerdiak", "shrineProductWeaveKeyring": "Giltzatako txirikordatua", "shrineProductGatsbyHat": "Gatsby kapela", "shrineProductShrugBag": "Eskuko poltsa", "shrineProductGiltDeskTrio": "Urre-koloreko idazmahai-trioa", "shrineProductCopperWireRack": "Kobrezko apalategia", "shrineProductSootheCeramicSet": "Zeramikazko sorta", "shrineProductHurrahsTeaSet": "Tea zerbitzatzeko Hurrahs sorta", "shrineProductBlueStoneMug": "Harrizko pitxer urdina", "shrineProductRainwaterTray": "Euri-uretarako erretilua", "shrineProductChambrayNapkins": "Chambray estiloko ezpainzapiak", "shrineProductSucculentPlanters": "Landare zukutsuetarako loreontziak", "shrineProductQuartetTable": "Laurentzako mahaia", "shrineProductKitchenQuattro": "Sukaldeko tresnak", "shrineProductClaySweater": "Buztin-koloreko jertsea", "shrineProductSeaTunic": "Tunika urdin argia", "shrineProductPlasterTunic": "Igeltsu-koloreko tunika", "rallyBudgetCategoryRestaurants": "Jatetxeak", "shrineProductChambrayShirt": "Chambray estiloko alkandora", "shrineProductSeabreezeSweater": "Jertse fina", "shrineProductGentryJacket": "Gentry jaka", "shrineProductNavyTrousers": "Galtza urdin ilunak", "shrineProductWalterHenleyWhite": "Walter Henley (zuria)", "shrineProductSurfAndPerfShirt": "Surf-estiloko alkandora", "shrineProductGingerScarf": "Bufanda gorrixka", "shrineProductRamonaCrossover": "Ramona poltsa gurutzatua", "shrineProductClassicWhiteCollar": "Alkandora zuri klasikoa", "shrineProductSunshirtDress": "Udako soinekoa", "rallyAccountDetailDataInterestRate": "Interes-tasa", "rallyAccountDetailDataAnnualPercentageYield": "Urtean ordaindutako interesaren ehunekoa", "rallyAccountDataVacation": "Oporrak", "shrineProductFineLinesTee": "Marra finak dituen elastikoa", "rallyAccountDataHomeSavings": "Etxerako aurrezkiak", "rallyAccountDataChecking": "Egiaztatzen", "rallyAccountDetailDataInterestPaidLastYear": "Joan den urtean ordaindutako interesa", "rallyAccountDetailDataNextStatement": "Hurrengo kontu-laburpena", "rallyAccountDetailDataAccountOwner": "Kontuaren jabea", "rallyBudgetCategoryCoffeeShops": "Kafetegiak", "rallyBudgetCategoryGroceries": "Jan-edanak", "shrineProductCeriseScallopTee": "Gerezi-koloreko elastikoa", "rallyBudgetCategoryClothing": "Arropa", "rallySettingsManageAccounts": "Kudeatu kontuak", "rallyAccountDataCarSavings": "Autorako aurrezkiak", "rallySettingsTaxDocuments": "Zerga-dokumentuak", "rallySettingsPasscodeAndTouchId": "Pasakodea eta Touch ID", "rallySettingsNotifications": "Jakinarazpenak", "rallySettingsPersonalInformation": "Informazio pertsonala", "rallySettingsPaperlessSettings": "Paperik gabeko ezarpenak", "rallySettingsFindAtms": "Aurkitu kutxazain automatikoak", "rallySettingsHelp": "Laguntza", "rallySettingsSignOut": "Amaitu saioa", "rallyAccountTotal": "Guztira", "rallyBillsDue": "Epemuga:", "rallyBudgetLeft": "Geratzen dena", "rallyAccounts": "Kontuak", "rallyBills": "Fakturak", "rallyBudgets": "Aurrekontuak", "rallyAlerts": "Alertak", "rallySeeAll": "IKUSI GUZTIAK", "rallyFinanceLeft": "ERABILTZEKE", "rallyTitleOverview": "INFORMAZIO OROKORRA", "shrineProductShoulderRollsTee": "Sorbalda estaltzen ez duen elastikoa", "shrineNextButtonCaption": "HURRENGOA", "rallyTitleBudgets": "AURREKONTUAK", "rallyTitleSettings": "EZARPENAK", "rallyLoginLoginToRally": "Hasi saioa Rally-n", "rallyLoginNoAccount": "Ez duzu konturik?", "rallyLoginSignUp": "ERREGISTRATU", "rallyLoginUsername": "Erabiltzaile-izena", "rallyLoginPassword": "Pasahitza", "rallyLoginLabelLogin": "Hasi saioa", "rallyLoginRememberMe": "Gogora nazazu", "rallyLoginButtonLogin": "HASI SAIOA", "rallyAlertsMessageHeadsUpShopping": "Egon adi: hilabete honetako erosketa-aurrekontuaren {percent} erabili duzu.", "rallyAlertsMessageSpentOnRestaurants": "Aste honetan {amount} gastatu dituzu jatetxeetan.", "rallyAlertsMessageATMFees": "Hilabete honetan {amount} gastatu dituzu kutxazain automatikoetako komisioetan", "rallyAlertsMessageCheckingAccount": "Primeran. Joan den hilean baino {percent} diru gehiago duzu kontu korrontean.", "shrineMenuCaption": "MENUA", "shrineCategoryNameAll": "GUZTIAK", "shrineCategoryNameAccessories": "OSAGARRIAK", "shrineCategoryNameClothing": "ARROPA", "shrineCategoryNameHome": "ETXEA", "shrineLoginUsernameLabel": "Erabiltzaile-izena", "shrineLoginPasswordLabel": "Pasahitza", "shrineCancelButtonCaption": "UTZI", "shrineCartTaxCaption": "Zerga:", "shrineCartPageCaption": "SASKIA", "shrineProductQuantity": "Zenbatekoa: {quantity}", "shrineProductPrice": "× {price}", "shrineCartItemCount": "{quantity,plural,=0{EZ DAGO PRODUKTURIK}=1{1 PRODUKTU}other{{quantity} PRODUKTU}}", "shrineCartClearButtonCaption": "GARBITU SASKIA", "shrineCartTotalCaption": "GUZTIRA", "shrineCartSubtotalCaption": "Guztizko partziala:", "shrineCartShippingCaption": "Bidalketa:", "shrineProductGreySlouchTank": "Mahukarik gabeko elastiko gris zabala", "shrineProductStellaSunglasses": "Stella eguzkitako betaurrekoak", "shrineProductWhitePinstripeShirt": "Marra fineko alkandora zuria", "demoTextFieldWhereCanWeReachYou": "Non aurki zaitzakegu?", "settingsTextDirectionLTR": "Ezkerretik eskuinera", "settingsTextScalingLarge": "Handia", "demoBottomSheetHeader": "Goiburua", "demoBottomSheetItem": "Elementua: {value}", "demoBottomTextFieldsTitle": "Testu-eremuak", "demoTextFieldTitle": "Testu-eremuak", "demoTextFieldSubtitle": "Testu eta zenbakien lerro editagarri bakarra", "demoTextFieldDescription": "Testu-eremuen bidez, erabiltzaileek testua idatz dezakete erabiltzaile-interfaze batean. Inprimaki eta leiho gisa agertu ohi dira.", "demoTextFieldShowPasswordLabel": "Erakutsi pasahitza", "demoTextFieldHidePasswordLabel": "Ezkutatu pasahitza", "demoTextFieldFormErrors": "Bidali baino lehen, konpondu gorriz ageri diren erroreak.", "demoTextFieldNameRequired": "Izena behar da.", "demoTextFieldOnlyAlphabeticalChars": "Idatzi alfabetoko karaktereak soilik.", "demoTextFieldEnterUSPhoneNumber": "(###) ###-#### - Idatzi AEBko telefono-zenbaki bat.", "demoTextFieldEnterPassword": "Idatzi pasahitza.", "demoTextFieldPasswordsDoNotMatch": "Pasahitzak ez datoz bat", "demoTextFieldWhatDoPeopleCallYou": "Nola deitzen dizute?", "demoTextFieldNameField": "Izena*", "demoBottomSheetButtonText": "ERAKUTSI BEHEKO ORRIA", "demoTextFieldPhoneNumber": "Telefono-zenbakia*", "demoBottomSheetTitle": "Beheko orria", "demoTextFieldEmail": "Helbide elektronikoa", "demoTextFieldTellUsAboutYourself": "Esan zerbait zuri buruz (adibidez, zertan egiten duzun lan edo zer zaletasun dituzun)", "demoTextFieldKeepItShort": "Ez luzatu; demo bat baino ez da.", "starterAppGenericButton": "BOTOIA", "demoTextFieldLifeStory": "Biografia", "demoTextFieldSalary": "Soldata", "demoTextFieldUSD": "USD", "demoTextFieldNoMoreThan": "Zortzi karaktere gehienez.", "demoTextFieldPassword": "Pasahitza*", "demoTextFieldRetypePassword": "Idatzi pasahitza berriro*", "demoTextFieldSubmit": "BIDALI", "demoBottomNavigationSubtitle": "Modu gurutzatuan lausotzen diren ikuspegiak dituen beheko nabigazioa", "demoBottomSheetAddLabel": "Gehitu", "demoBottomSheetModalDescription": "Menu edo leiho baten ordez erabil daiteke beheko orri modala; horren bidez, erabiltzaileak ezingo ditu erabili aplikazioaren gainerako elementuak.", "demoBottomSheetModalTitle": "Beheko orri modala", "demoBottomSheetPersistentDescription": "Aplikazioko eduki nagusia osatzea helburu duen informazioa erakusten du beheko orri finkoak. Beheko orri finkoa ikusgai dago beti, baita erabiltzailea aplikazioko beste elementu batzuk erabiltzen ari denean ere.", "demoBottomSheetPersistentTitle": "Beheko orri finkoa", "demoBottomSheetSubtitle": "Beheko orri finko eta modalak", "demoTextFieldNameHasPhoneNumber": "{name} erabiltzailearen telefono-zenbakia {phoneNumber} da", "buttonText": "BOTOIA", "demoTypographyDescription": "Material diseinuko estilo tipografikoen definizioak.", "demoTypographySubtitle": "Testu-estilo lehenetsi guztiak", "demoTypographyTitle": "Tipografia", "demoFullscreenDialogDescription": "Sarrerako orria pantaila osoko leiho bat den zehazten du fullscreenDialog propietateak", "demoFlatButtonDescription": "Botoi lauak kolorez aldatzen dira sakatzen dituztenean, baina ez dira altxatzen. Erabili botoi lauak tresna-barretan, leihoetan eta betegarriak txertatzean.", "demoBottomNavigationDescription": "Beheko nabigazioak hiru eta bost helmuga artean bistaratzen ditu pantailaren beheko aldean. Ikono eta aukerako testu-etiketa bana ageri dira helmuga bakoitzeko. Beheko nabigazioko ikono bat sakatzean, ikono horri loturiko nabigazio-helmuga nagusira eramango da erabiltzailea.", "demoBottomNavigationSelectedLabel": "Hautatutako etiketa", "demoBottomNavigationPersistentLabels": "Etiketa finkoak", "starterAppDrawerItem": "Elementua: {value}", "demoTextFieldRequiredField": "* ikurrak derrigorrezko eremua dela adierazten du", "demoBottomNavigationTitle": "Beheko nabigazioa", "settingsLightTheme": "Argia", "settingsTheme": "Gaia", "settingsPlatformIOS": "iOS", "settingsPlatformAndroid": "Android", "settingsTextDirectionRTL": "Eskuinetik ezkerrera", "settingsTextScalingHuge": "Erraldoia", "cupertinoButton": "Botoia", "settingsTextScalingNormal": "Normala", "settingsTextScalingSmall": "Txikia", "settingsSystemDefault": "Sistema", "settingsTitle": "Ezarpenak", "rallyDescription": "Finantza-aplikazio pertsonala", "aboutDialogDescription": "Aplikazio honen iturburu-kodea ikusteko, joan hona: {repoLink}.", "bottomNavigationCommentsTab": "Iruzkinak", "starterAppGenericBody": "Gorputza", "starterAppGenericHeadline": "Goiburua", "starterAppGenericSubtitle": "Azpititulua", "starterAppGenericTitle": "Izena", "starterAppTooltipSearch": "Bilatu", "starterAppTooltipShare": "Partekatu", "starterAppTooltipFavorite": "Gogokoa", "starterAppTooltipAdd": "Gehitu", "bottomNavigationCalendarTab": "Egutegia", "starterAppDescription": "Hasierako diseinu sentikorra", "starterAppTitle": "Hasiberrientzako aplikazioa", "aboutFlutterSamplesRepo": "GitHub irudi-biltegiko Flutter laginak", "bottomNavigationContentPlaceholder": "{title} fitxaren leku-marka", "bottomNavigationCameraTab": "Kamera", "bottomNavigationAlarmTab": "Alarma", "bottomNavigationAccountTab": "Kontua", "demoTextFieldYourEmailAddress": "Zure helbide elektronikoa", "demoToggleButtonDescription": "Erlazionatutako aukerak taldekatzeko erabil daitezke etengailuak. Erlazionatutako etengailuen talde bat nabarmentzeko, taldeak edukiontzi bera partekatu beharko luke.", "colorsGrey": "GRISA", "colorsBrown": "MARROIA", "colorsDeepOrange": "LARANJA BIZIA", "colorsOrange": "LARANJA", "colorsAmber": "HORIXKA", "colorsYellow": "HORIA", "colorsLime": "LIMA-KOLOREA", "colorsLightGreen": "BERDE ARGIA", "colorsGreen": "BERDEA", "homeHeaderGallery": "Galeria", "homeHeaderCategories": "Kategoriak", "shrineDescription": "Moda-modako salmenta-aplikazioa", "craneDescription": "Bidaia-aplikazio pertsonalizatua", "homeCategoryReference": "ESTILOAK ETA BESTE", "demoInvalidURL": "Ezin izan da bistaratu URLa:", "demoOptionsTooltip": "Aukerak", "demoInfoTooltip": "Informazioa", "demoCodeTooltip": "Demo-kodea", "demoDocumentationTooltip": "APIaren dokumentazioa", "demoFullscreenTooltip": "Pantaila osoa", "settingsTextScaling": "Testuaren tamaina", "settingsTextDirection": "Testuaren noranzkoa", "settingsLocale": "Lurraldeko ezarpenak", "settingsPlatformMechanics": "Plataformaren mekanika", "settingsDarkTheme": "Iluna", "settingsSlowMotion": "Kamera geldoa", "settingsAbout": "Flutter Gallery-ri buruz", "settingsFeedback": "Bidali oharrak", "settingsAttribution": "Londreseko TOASTER enpresak diseinatua", "demoButtonTitle": "Botoiak", "demoButtonSubtitle": "Lauak, goratuak, ingeradadunak eta gehiago", "demoFlatButtonTitle": "Botoi laua", "demoRaisedButtonDescription": "Botoi goratuek dimentsioa ematen diete nagusiki lauak diren diseinuei. Funtzioak nabarmentzen dituzte espazio bete edo zabaletan.", "demoRaisedButtonTitle": "Botoi goratua", "demoOutlineButtonTitle": "Botoi ingeradaduna", "demoOutlineButtonDescription": "Botoi ingeradadunak opaku bihurtu eta goratu egiten dira sakatzean. Botoi goratuekin batera agertu ohi dira, ekintza alternatibo edo sekundario bat dagoela adierazteko.", "demoToggleButtonTitle": "Etengailuak", "colorsTeal": "ANILA", "demoFloatingButtonTitle": "Ekintza-botoi gainerakorra", "demoFloatingButtonDescription": "Aplikazioko edukiaren gainean ekintza nagusia sustatzeko agertzen diren botoi-itxurako ikono biribilak dira ekintza-botoi gainerakorrak.", "demoDialogTitle": "Leihoak", "demoDialogSubtitle": "Arrunta, alerta eta pantaila osoa", "demoAlertDialogTitle": "Alerta", "demoAlertDialogDescription": "Kontuan hartu beharreko egoeren berri ematen diote alerta-leihoek erabiltzaileari. Aukeran, izenburua eta ekintza-zerrendak izan ditzakete alerta-leihoek.", "demoAlertTitleDialogTitle": "Alerta izenburuduna", "demoSimpleDialogTitle": "Arrunta", "demoSimpleDialogDescription": "Leiho arruntek hainbat aukera eskaintzen dizkiote erabiltzaileari, nahi duena aukera dezan. Aukeren gainean bistaratzen den izenburu bat izan dezakete leiho arruntek.", "demoFullscreenDialogTitle": "Pantaila osoa", "demoCupertinoButtonsTitle": "Botoiak", "demoCupertinoButtonsSubtitle": "iOS estiloko botoiak", "demoCupertinoButtonsDescription": "iOS estiloko botoia. Ukitzean lausotzen eta berriro agertzen den testua eta/edo ikono bat dauka barruan. Atzeko plano bat ere izan dezake.", "demoCupertinoAlertsTitle": "Alertak", "demoCupertinoAlertsSubtitle": "iOS estiloko alerta-leihoak", "demoCupertinoAlertTitle": "Alerta", "demoCupertinoAlertDescription": "Kontuan hartu beharreko egoeren berri ematen diote alerta-leihoek erabiltzaileari. Aukeran, izenburua, edukia eta ekintza-zerrendak izan ditzakete alerta-leihoek. Izenburua edukiaren gainean bistaratuko da; ekintzak, berriz, edukiaren azpian.", "demoCupertinoAlertWithTitleTitle": "Alerta izenburuduna", "demoCupertinoAlertButtonsTitle": "Alerta botoiduna", "demoCupertinoAlertButtonsOnlyTitle": "Alerta-botoiak bakarrik", "demoCupertinoActionSheetTitle": "Ekintza-orria", "demoCupertinoActionSheetDescription": "Ekintza-orria alerta-estilo bat da, eta bi aukera edo gehiago ematen dizkio erabiltzaileari oraingo testuingurua kontuan hartuta. Ekintza-orriek izenburu bat, mezu gehigarri bat eta ekintza-zerrenda bat izan ditzakete.", "demoColorsTitle": "Koloreak", "demoColorsSubtitle": "Kolore lehenetsi guztiak", "demoColorsDescription": "Material izeneko diseinuaren kolore-paleta irudikatzen duten koloreen eta kolore-aldaketen konstanteak.", "buttonTextEnabled": "ENABLED", "buttonTextDisabled": "DISABLED", "buttonTextCreate": "Sortu", "dialogSelectedOption": "Hau hautatu duzu: \"{value}\"", "dialogDiscardTitle": "Zirriborroa baztertu nahi duzu?", "dialogLocationTitle": "Google-ren kokapen-zerbitzua erabili nahi duzu?", "dialogLocationDescription": "Utzi Google-ri aplikazioei kokapena zehazten laguntzen. Horretarako, kokapen-datu anonimoak bidaliko zaizkio Google-ri, baita aplikazioak martxan ez daudenean ere.", "dialogCancel": "UTZI", "dialogDiscard": "BAZTERTU", "dialogDisagree": "EZ ONARTU", "dialogAgree": "ONARTU", "dialogSetBackup": "Ezarri babeskopiak egiteko kontua", "colorsBlueGrey": "URDIN GRISAXKA", "dialogShow": "ERAKUTSI LEIHOA", "dialogFullscreenTitle": "Pantaila osoko leihoa", "dialogFullscreenSave": "GORDE", "dialogFullscreenDescription": "Pantaila osoko leiho baten demoa", "cupertinoButtonEnabled": "Enabled", "cupertinoButtonDisabled": "Disabled", "cupertinoButtonWithBackground": "Atzeko planoarekin", "cupertinoAlertCancel": "Utzi", "cupertinoAlertDiscard": "Baztertu", "cupertinoAlertLocationTitle": "Aplikazioa erabili bitartean kokapena erabiltzeko baimena eman nahi diozu Maps-i?", "cupertinoAlertLocationDescription": "Oraingo kokapena mapan bistaratuko da, eta jarraibideak, inguruko bilaketa-emaitzak eta bidaien estimatutako iraupena emango dira.", "cupertinoAlertAllow": "Baimendu", "cupertinoAlertDontAllow": "Ez baimendu", "cupertinoAlertFavoriteDessert": "Aukeratu gogoko postrea", "cupertinoAlertDessertDescription": "Beheko zerrendan, aukeratu gehien gustatzen zaizun postrea. Inguruko jatetxeen iradokizunak pertsonalizatzeko erabiliko da hautapen hori.", "cupertinoAlertCheesecake": "Gazta-tarta", "cupertinoAlertTiramisu": "Tiramisua", "cupertinoAlertApplePie": "Sagar-tarta", "cupertinoAlertChocolateBrownie": "Txokolatezko brownie-a", "cupertinoShowAlert": "Erakutsi alerta", "colorsRed": "GORRIA", "colorsPink": "ARROSA", "colorsPurple": "MOREA", "colorsDeepPurple": "MORE BIZIA", "colorsIndigo": "ANILA", "colorsBlue": "URDINA", "colorsLightBlue": "URDIN ARGIA", "colorsCyan": "ZIANA", "dialogAddAccount": "Gehitu kontu bat", "Gallery": "Galeria", "Categories": "Kategoriak", "SHRINE": "SANTUTEGIA", "Basic shopping app": "Erosketak egiteko oinarrizko aplikazioa", "RALLY": "RALLYA", "CRANE": "LERTSUNA", "Travel app": "Bidaia-aplikazioa", "MATERIAL": "MATERIALA", "CUPERTINO": "CUPERTINO", "REFERENCE STYLES & MEDIA": "ERREFERENTZIAZKO ESTILOAK ETA MULTIMEDIA-EDUKIA" }
gallery/lib/l10n/intl_eu.arb/0
{ "file_path": "gallery/lib/l10n/intl_eu.arb", "repo_id": "gallery", "token_count": 21177 }
798
{ "loading": "Hleður", "deselect": "Afvelja", "select": "Velja", "selectable": "Hægt að velja (haldið inni)", "selected": "Valið", "demo": "Prufuútgáfa", "bottomAppBar": "Forritastika neðst", "notSelected": "Ekki valið", "demoCupertinoSearchTextFieldTitle": "Textareitur fyrir leit", "demoCupertinoPicker": "Val", "demoCupertinoSearchTextFieldSubtitle": "Textareitur fyrir leit iOS-stíla", "demoCupertinoSearchTextFieldDescription": "Textareitur fyrir leit sem gerir notanda kleift að leita með því að slá inn texta og sem getur komið með og síað tillögur.", "demoCupertinoSearchTextFieldPlaceholder": "Sláðu inn texta", "demoCupertinoScrollbarTitle": "Flettistika", "demoCupertinoScrollbarSubtitle": "Flettistika iOS-stíla", "demoCupertinoScrollbarDescription": "Flettistika sem umlykur undireininguna", "demoTwoPaneItem": "Atriði {value}", "demoTwoPaneList": "Listi", "demoTwoPaneFoldableLabel": "Samanbrjótanlegt", "demoTwoPaneSmallScreenLabel": "Lítill skjár", "demoTwoPaneSmallScreenDescription": "Svona virkar TwoPane í tæki með litlum skjá.", "demoTwoPaneTabletLabel": "Spjaldtölva/tölva", "demoTwoPaneTabletDescription": "Svona virkar TwoPane á stærri skjá eins og í spjaldtölvu eða tölvu.", "demoTwoPaneTitle": "TwoPane", "demoTwoPaneSubtitle": "Aðlögunarhæfar uppsetningar á samanbrjótanlegum, stórum og litlum skjáum", "splashSelectDemo": "Velja prufuútgáfu", "demoTwoPaneFoldableDescription": "Svona virkar TwoPane í samanbrjótanlegu tæki.", "demoTwoPaneDetails": "Nánar", "demoTwoPaneSelectItem": "Velja atriði", "demoTwoPaneItemDetails": "Upplýsingar um {value} atriði", "demoCupertinoContextMenuActionText": "Haltu Flutter-lógóinu inni til að sjá efnisvalmyndina.", "demoCupertinoContextMenuDescription": "Efnisvalmynd með iOS-stíl á öllum skjánum sem birtist þegar einingu er haldið inni.", "demoAppBarTitle": "Forritastika", "demoAppBarDescription": "Forritastikan veitir efni og aðgerðir sem tengjast núverandi skjá. Hún er notuð fyrir vörumerki, skjátitla, flettingu og aðgerðir", "demoDividerTitle": "Skipting", "demoDividerSubtitle": "Skipting er mjó lína sem skiptir upp efni á listum og uppsetningum.", "demoDividerDescription": "Skiptingu má nota í listum, skúffum og hvar sem er til að skipta upp efni.", "demoVerticalDividerTitle": "Lóðrétt skipting", "demoCupertinoContextMenuTitle": "Efnisvalmynd", "demoCupertinoContextMenuSubtitle": "Efnisvalmynd með iOS-stíl", "demoAppBarSubtitle": "Birtir upplýsingar og aðgerðir sem tengjast núverandi skjá", "demoCupertinoContextMenuActionOne": "Aðgerð eitt", "demoCupertinoContextMenuActionTwo": "Aðgerð tvö", "demoDateRangePickerDescription": "Sýnir glugga sem inniheldur tímabilsval nýju útlitshönnunarinnar.", "demoDateRangePickerTitle": "Tímabilsval", "demoNavigationDrawerUserName": "Notandanafn", "demoNavigationDrawerUserEmail": "[email protected]", "demoNavigationDrawerText": "Strjúktu frá brúninni eða ýttu á táknið efst til vinstri til að sjá skúffuna", "demoNavigationRailTitle": "Yfirlitsstika", "demoNavigationRailSubtitle": "Birtir yfirlitsstiku í forriti", "demoNavigationRailDescription": "Útlitshönnunargræjan sem á að birtast hægra eða vinstra megin við forrit til að fá yfirlit yfir fá atriði, yfirleitt þrjú til fimm.", "demoNavigationRailFirst": "Fyrsta", "demoNavigationDrawerTitle": "Yfirlitsskúffa", "demoNavigationRailThird": "Þriðja", "replyStarredLabel": "Stjörnumerkt", "demoTextButtonDescription": "Textahnappur birtir blekslettu þegar ýtt er á hann en lyftist ekki. Notaðu textahnappa í tækjastikum, gluggum og í línum með fyllingu", "demoElevatedButtonTitle": "Upphleyptur hnappur", "demoElevatedButtonDescription": "Upphleyptir hnappar gefa flatri uppsetningu aukna vídd. Þeir undirstrika aðgerðir á stórum svæðum eða þar sem mikið er um að vera.", "demoOutlinedButtonTitle": "Hnappur með útlínu", "demoOutlinedButtonDescription": "Hnappar með útlínum verða ógagnsæir og lyftast upp þegar ýtt er á þá. Þeir fylgja oft upphleyptum hnöppum til að gefa til kynna aukaaðgerð.", "demoContainerTransformDemoInstructions": "Spjöld, listar og fljótandi aðgerðahnappar", "demoNavigationDrawerSubtitle": "Birtir skúffu á forritastiku", "replyDescription": "Afkastamikið og skilvirkt tölvupóstforrit", "demoNavigationDrawerDescription": "Svæði nýju útlitshönnunarinnar sem rennur lárétt frá brún skjásins til að birta yfirlitstengla í forriti.", "replyDraftsLabel": "Drög", "demoNavigationDrawerToPageOne": "Atriði eitt", "replyInboxLabel": "Pósthólf", "demoSharedXAxisDemoInstructions": "Hnappar til að fara áfram og til baka", "replySpamLabel": "Ruslefni", "replyTrashLabel": "Rusl", "replySentLabel": "Sent", "demoNavigationRailSecond": "Annað", "demoNavigationDrawerToPageTwo": "Atriði tvö", "demoFadeScaleDemoInstructions": "Gluggar og fljótandi aðgerðahnappar", "demoFadeThroughDemoInstructions": "Yfirlit neðst", "demoSharedZAxisDemoInstructions": "Stillingatáknshnappur", "demoSharedYAxisDemoInstructions": "Flokka eftir „Nýlega spilað“", "demoTextButtonTitle": "Textahnappur", "demoSharedZAxisBeefSandwichRecipeTitle": "Kjötsamloka", "demoSharedZAxisDessertRecipeDescription": "Eftirréttaruppskrift", "demoSharedYAxisAlbumTileSubtitle": "Flytjandi", "demoSharedYAxisAlbumTileTitle": "Plata", "demoSharedYAxisRecentSortTitle": "Nýlega spilað", "demoSharedYAxisAlphabeticalSortTitle": "A–Ö", "demoSharedYAxisAlbumCount": "268 plötur", "demoSharedYAxisTitle": "Deildur y-ás", "demoSharedXAxisCreateAccountButtonText": "STOFNA REIKNING", "demoFadeScaleAlertDialogDiscardButton": "FLEYGJA", "demoSharedXAxisSignInTextFieldLabel": "Netfang eða símanúmer", "demoSharedXAxisSignInSubtitleText": "Skráðu þig inn með reikningnum þínum", "demoSharedXAxisSignInWelcomeText": "Hæ David Park", "demoSharedXAxisIndividualCourseSubtitle": "Birtast sér", "demoSharedXAxisBundledCourseSubtitle": "Í pakka", "demoFadeThroughAlbumsDestination": "Plötur", "demoSharedXAxisDesignCourseTitle": "Hönnun", "demoSharedXAxisIllustrationCourseTitle": "Teikning", "demoSharedXAxisBusinessCourseTitle": "Fyrirtæki", "demoSharedXAxisArtsAndCraftsCourseTitle": "List og handverk", "demoMotionPlaceholderSubtitle": "Aukatexti", "demoFadeScaleAlertDialogCancelButton": "HÆTTA VIÐ", "demoFadeScaleAlertDialogHeader": "Viðvörunargluggi", "demoFadeScaleHideFabButton": "FELA FLJÓTANDI AÐGERÐAHNAPPA", "demoFadeScaleShowFabButton": "SÝNA FLJÓTANDI AÐGERÐAHNAPPA", "demoFadeScaleShowAlertDialogButton": "SÝNA VIÐVÖRUNARGLUGGA", "demoFadeScaleDescription": "Dofnunarmynstur er notað fyrir notandaviðmótseiningar sem opnast eða lokast innan skjásins, t.d. gluggi sem dofnar á miðju skjásins.", "demoFadeScaleTitle": "Dofna", "demoFadeThroughTextPlaceholder": "123 myndir", "demoFadeThroughSearchDestination": "Leit", "demoFadeThroughPhotosDestination": "Myndir", "demoSharedXAxisCoursePageSubtitle": "Flokkar í pakka birtast sem hópar í straumnum þínum. Þú getur alltaf breytt þessu síðar.", "demoFadeThroughDescription": "Mynstur með dofnun í gegn er notað fyrir umbreytingu milli notendaviðmótseininga sem hafa ekki sterk tengsl hvor við aðra.", "demoFadeThroughTitle": "Dofnun í gegn", "demoSharedZAxisHelpSettingLabel": "Hjálp", "demoMotionSubtitle": "Öll forstillt umbreytingarmynstur", "demoSharedZAxisNotificationSettingLabel": "Tilkynningar", "demoSharedZAxisProfileSettingLabel": "Prófíll", "demoSharedZAxisSavedRecipesListTitle": "Vistaðar uppskriftir", "demoSharedZAxisBeefSandwichRecipeDescription": "Kjötsamlokuuppskrift", "demoSharedZAxisCrabPlateRecipeDescription": "Uppskrift að krabbarétti", "demoSharedXAxisCoursePageTitle": "Straumlínulagaðu námskeiðin þín", "demoSharedZAxisCrabPlateRecipeTitle": "Krabbi", "demoSharedZAxisShrimpPlateRecipeDescription": "Uppskrift að rækjurétti", "demoSharedZAxisShrimpPlateRecipeTitle": "Rækja", "demoContainerTransformTypeFadeThrough": "DOFNUN Í GEGN", "demoSharedZAxisDessertRecipeTitle": "Eftirréttur", "demoSharedZAxisSandwichRecipeDescription": "Samlokuuppskrift", "demoSharedZAxisSandwichRecipeTitle": "Samloka", "demoSharedZAxisBurgerRecipeDescription": "Hamborgarauppskrift", "demoSharedZAxisBurgerRecipeTitle": "Hamborgari", "demoSharedZAxisSettingsPageTitle": "Stillingar", "demoSharedZAxisTitle": "Deildur z-ás", "demoSharedZAxisPrivacySettingLabel": "Persónuvernd", "demoMotionTitle": "Hreyfing", "demoContainerTransformTitle": "Rammaumbreyting", "demoContainerTransformDescription": "Rammaumbreytingarmynstur er hannað fyrir umbreytingu notendaviðmótseininga sem innihalda ramma. Þetta mynstur býr til sýnilega tengingu milli tveggja notendaviðmótseininga", "demoContainerTransformModalBottomSheetTitle": "Dofnunarstilling", "demoContainerTransformTypeFade": "DOFNA", "demoSharedYAxisAlbumTileDurationUnit": "mín.", "demoMotionPlaceholderTitle": "Titill", "demoSharedXAxisForgotEmailButtonText": "GLEYMT NETFANG?", "demoMotionSmallPlaceholderSubtitle": "Auka", "demoMotionDetailsPageTitle": "Upplýsingasíða", "demoMotionListTileTitle": "Listaatriði", "demoSharedAxisDescription": "Sameiginlegt mynstur um ás er notað fyrir umbreytingu milli notendaviðmótseininga sem eru með rúmfræðileg tengsl eða flettingartengsl. Þetta mynstur notar sameiginlega umbreytingu á x, y eða z ás til að styrkja tengslin milli eininga.", "demoSharedXAxisTitle": "Deildur x-ás", "demoSharedXAxisBackButtonText": "TIL BAKA", "demoSharedXAxisNextButtonText": "ÁFRAM", "demoSharedXAxisCulinaryCourseTitle": "Matreiðsla", "githubRepo": "{repoName} GitHub geymsla", "fortnightlyMenuUS": "Bandaríkin", "fortnightlyMenuBusiness": "Viðskipti", "fortnightlyMenuScience": "Vísindi", "fortnightlyMenuSports": "Íþróttir", "fortnightlyMenuTravel": "Ferðalög", "fortnightlyMenuCulture": "Menning", "fortnightlyTrendingTechDesign": "TechDesign", "rallyBudgetDetailAmountLeft": "Upphæð eftir", "fortnightlyHeadlineArmy": "Endurhæfing grænu byltingarinnar innan frá", "fortnightlyDescription": "Efnismiðað fréttaforrit", "rallyBillDetailAmountDue": "Upphæð á gjalddaga", "rallyBudgetDetailTotalCap": "Hámark", "rallyBudgetDetailAmountUsed": "Notuð upphæð", "fortnightlyTrendingHealthcareRevolution": "HealthcareRevolution", "fortnightlyMenuFrontPage": "Forsíða", "fortnightlyMenuWorld": "Heimurinn", "rallyBillDetailAmountPaid": "Greidd upphæð", "fortnightlyMenuPolitics": "Pólitík", "fortnightlyHeadlineBees": "Býflugur vantar í býflugnarækt", "fortnightlyHeadlineGasoline": "Framtíð eldsneytis", "fortnightlyTrendingGreenArmy": "GreenArmy", "fortnightlyHeadlineFeminists": "Femínistar á móti flokkshollustu", "fortnightlyHeadlineFabrics": "Hönnuðir nýta sér tæknina til framleiðslu á nýmóðins efni", "fortnightlyHeadlineStocks": "Margir líta til gjaldmiðla nú þegar hlutabréfamarkaðurinn hreyfist lítið", "fortnightlyTrendingReform": "Reform", "fortnightlyMenuTech": "Tækni", "fortnightlyHeadlineWar": "Aðskildi bandaríkjamenn meðan stríðið stóð", "fortnightlyHeadlineHealthcare": "Hljóð en öflug endurskoðun heilbrigðiskerfisins", "fortnightlyLatestUpdates": "Nýjustu uppfærslur", "fortnightlyTrendingStocks": "Stocks", "rallyBillDetailTotalAmount": "Heildarupphæð", "demoCupertinoPickerDateTime": "Dagsetning og tími", "signIn": "SKRÁ INN", "dataTableRowWithSugar": "{value} með sykri", "dataTableRowApplePie": "Eplabaka", "dataTableRowDonut": "Kleinuhringur", "dataTableRowHoneycomb": "Vaxkaka", "dataTableRowLollipop": "Sleikipinni", "dataTableRowJellyBean": "Hlaupbaunir", "dataTableRowGingerbread": "Piparkökur", "dataTableRowCupcake": "Formkaka", "dataTableRowEclair": "Súkkulaðikaramella", "dataTableRowIceCreamSandwich": "Íssamloka", "dataTableRowFrozenYogurt": "Frosin jógúrt", "dataTableColumnIron": "Járn (%)", "dataTableColumnCalcium": "Kalk (%)", "dataTableColumnSodium": "Natríum (mg)", "demoTimePickerTitle": "Tímaval", "demo2dTransformationsResetTooltip": "Endurstilla umbreytingar", "dataTableColumnFat": "Fita (g)", "dataTableColumnCalories": "Hitaeiningar", "dataTableColumnDessert": "Eftirréttur (1 skammtur)", "cardsDemoTravelDestinationLocation1": "Thanjavur, Tamil Nadu", "demoTimePickerDescription": "Sýnir svarglugga sem inniheldur tímaval með nýrri útlitshönnun.", "demoPickersShowPicker": "SÝNA VAL", "demoTabsScrollingTitle": "Flettir", "demoTabsNonScrollingTitle": "Flettir ekki", "craneHours": "{hours,plural,=1{1 klst.}other{{hours} klst.}}", "craneMinutes": "{minutes,plural,=1{1 mín.}other{{minutes} mín.}}", "craneFlightDuration": "{hoursShortForm} {minutesShortForm}", "dataTableHeader": "Næring", "demoDatePickerTitle": "Dagsetningarval", "demoPickersSubtitle": "Val dags- og tíma", "demoPickersTitle": "Val", "demo2dTransformationsEditTooltip": "Breyta flís", "demoDataTableDescription": "Gagnatöflur birta upplýsingar í línum og dálkum á sniði sem líkist hnitaneti. Þær skipuleggja upplýsingar þannig að auðvelt sé finna þær og notendur sjái auðveldlega mynstur upplýsinganna.", "demo2dTransformationsDescription": "Ýttu til að breyta flísum og notaðu bendingar til að færa þig til í umhverfinu. Dragðu til að skima, færðu fingur saman til að nota aðdrátt og snúðu með tveimur fingrum. Ýttu á endurstillingarhnappinn til að fara aftur í upphaflega stefnu.", "demo2dTransformationsSubtitle": "Hliðrun, aðdráttur, snúningur", "demo2dTransformationsTitle": "Umbreytingar í tvívídd", "demoCupertinoTextFieldPIN": "PIN", "demoCupertinoTextFieldDescription": "Textareitir gera notendum kleift að slá inn texta, annaðhvort með tengdu lyklaborði eða skjályklaborði.", "demoCupertinoTextFieldSubtitle": "Textareitir með iOS-stíl", "demoCupertinoTextFieldTitle": "Textareitir", "demoDatePickerDescription": "Sýnir svarglugga sem inniheldur dagsval með nýrri útlitshönnun.", "demoCupertinoPickerTime": "Tími", "demoCupertinoPickerDate": "Dagsetning", "demoCupertinoPickerTimer": "Teljari", "demoCupertinoPickerDescription": "Valgræja með iOS-stíl sem hægt er að nota til að velja strengi, dagsetningu, tíma eða bæði dagsetningu og tíma.", "demoCupertinoPickerSubtitle": "iOS-stílaval", "demoCupertinoPickerTitle": "Val", "dataTableRowWithHoney": "{value} með hunangi", "cardsDemoTravelDestinationCity2": "Chettinad", "bannerDemoResetText": "Endurstilla borða", "bannerDemoMultipleText": "Margar aðgerðir", "bannerDemoLeadingText": "Upphafstákn", "dismiss": "HUNSA", "cardsDemoTappable": "Hægt að ýta", "cardsDemoSelectable": "Hægt að velja (haldið inni)", "cardsDemoExplore": "Kanna", "cardsDemoExploreSemantics": "Kanna {destinationName}", "cardsDemoShareSemantics": "Deila {destinationName}", "cardsDemoTravelDestinationTitle1": "10 vinsælustu borgirnar í Tamil Nadu", "cardsDemoTravelDestinationDescription1": "Númer 10", "cardsDemoTravelDestinationCity1": "Thanjavur", "dataTableColumnProtein": "Prótín (g)", "cardsDemoTravelDestinationTitle2": "Handverksfólk Suður-Indlands", "cardsDemoTravelDestinationDescription2": "Köngulær", "bannerDemoText": "Aðgangsorðið þitt var uppfært í hinu tækinu. Skráðu þig inn aftur.", "cardsDemoTravelDestinationLocation2": "Sivaganga, Tamil Nadu", "cardsDemoTravelDestinationTitle3": "Brihadisvara-hof", "cardsDemoTravelDestinationDescription3": "Hof", "demoBannerTitle": "Borði", "demoBannerSubtitle": "Birtir borða innan lista", "demoBannerDescription": "Borðar sýna mikilvæg og hnitmiðuð skilaboð og sýna notendum aðgerðir sem þeir geta valið (eða að hunsa borðann). Notandi þarf að velja að hunsa hann.", "demoCardTitle": "Kort", "demoCardSubtitle": "Grunnlínukort með ávölum hornum", "demoCardDescription": "Kort er efnissvæði þar sem tengdar upplýsingar birtast. Þær upplýsingar geta t.d. verið plata, staðsetning, máltíð, samskiptaupplýsingar o.s.frv.", "demoDataTableTitle": "Gagnatöflur", "demoDataTableSubtitle": "Línur og dálkar með upplýsingum", "dataTableColumnCarbs": "Kolvetni (g)", "placeTanjore": "Tanjore", "demoGridListsTitle": "Töfluyfirlit", "placeFlowerMarket": "Blómamarkaður", "placeBronzeWorks": "Bronze Works", "placeMarket": "Markaður", "placeThanjavurTemple": "Thanjavur-hof", "placeSaltFarm": "Saltvinnsla", "placeScooters": "Létt bifhjól", "placeSilkMaker": "Silk Maker", "placeLunchPrep": "Hádegisverður undirbúinn", "placeBeach": "Strönd", "placeFisherman": "Fiskimaður", "demoMenuSelected": "Valið: {value}", "demoMenuRemove": "Fjarlægja", "demoMenuGetLink": "Fá tengil", "demoMenuShare": "Deila", "demoBottomAppBarSubtitle": "Birtir yfirlit og aðgerðir neðst á skjánum", "demoMenuAnItemWithASectionedMenu": "Atriði með skiptri valmynd", "demoMenuADisabledMenuItem": "Óvirkt valmyndaratriði", "demoLinearProgressIndicatorTitle": "Línulegur stöðuvísir", "demoMenuContextMenuItemOne": "Fyrsta atriði efnisvalmyndar", "demoMenuAnItemWithASimpleMenu": "Atriði með einfaldri valmynd", "demoCustomSlidersTitle": "Sérsniðnir sleðar", "demoMenuAnItemWithAChecklistMenu": "Atriði með gátlistavalmynd", "demoCupertinoActivityIndicatorTitle": "Virknivísir", "demoCupertinoActivityIndicatorSubtitle": "Virknivísar með iOS-stíl", "demoCupertinoActivityIndicatorDescription": "Virknivísir með iOS-stíl sem snýst réttsælis.", "demoCupertinoNavigationBarTitle": "Yfirlitsstika", "demoCupertinoNavigationBarSubtitle": "Yfirlitsstika með iOS-stíl", "demoCupertinoNavigationBarDescription": "Yfirlitsstika í iOS-stíl. Yfirlitsstikan er tækjastika sem samanstendur að lágmarki af síðutitli í miðju tækjastikunnar.", "demoCupertinoPullToRefreshTitle": "Dragðu til að endurnýja", "demoCupertinoPullToRefreshSubtitle": "Stýring með iOS-stíl fyrir valkostinn að draga til að endurnýja", "demoCupertinoPullToRefreshDescription": "Græja sem veitir stýringu með iOS-stíl fyrir valkostinn að draga til að endurnýja efni.", "demoProgressIndicatorTitle": "Stöðuvísar", "demoProgressIndicatorSubtitle": "Línulegir, hringlaga, óákveðið", "demoCircularProgressIndicatorTitle": "Hringlaga stöðuvísir", "demoCircularProgressIndicatorDescription": "Hringlaga stöðuvísir, sem snýst til að tákna að forritið sé upptekið.", "demoMenuFour": "Fjögur", "demoLinearProgressIndicatorDescription": "Línulegur stöðuvísir, einnig þekktur sem framvindustika.", "demoTooltipTitle": "Ábendingar", "demoTooltipSubtitle": "Stutt skilaboð sem birtast þegar takka er haldið inni eða bendli yfir", "demoTooltipDescription": "Ábendingar veita textamerki sem hjálpa til við að útskýra virkni hnapps eða annarrar aðgerðar í viðmóti. Ábendingar birta upplýsingatexta þegar notendur halda bendli yfir einingu, velja hana eða halda inni.", "demoTooltipInstructions": "Halda inni eða halda bendli yfir til að birta ábendingu.", "placeChennai": "Chennai", "demoMenuChecked": "Merkt: {value}", "placeChettinad": "Chettinad", "demoMenuPreview": "Forskoða", "demoBottomAppBarTitle": "Forritastika neðst", "demoBottomAppBarDescription": "Forritastika neðst veitir aðgang að yfirlitsskúffu neðst ásamt allt að fjórum aðgerðum, þ.m.t. fljótandi aðgerðahnappi.", "bottomAppBarNotch": "Hak", "bottomAppBarPosition": "Staðsetning fljótandi aðgerðahnapps", "bottomAppBarPositionDockedEnd": "Festur - lok", "bottomAppBarPositionDockedCenter": "Festur - miðja", "bottomAppBarPositionFloatingEnd": "Fljótandi - lok", "bottomAppBarPositionFloatingCenter": "Fljótandi - miðja", "demoSlidersEditableNumericalValue": "Breytilegt tölugildi", "demoGridListsSubtitle": "Útlit lína og dálka", "demoGridListsDescription": "Töfluyfirlit henta best fyrir einsleit gögn, yfirleitt myndir. Hvert atriði í töfluyfirlitinu kallast reitur.", "demoGridListsImageOnlyTitle": "Aðeins myndir", "demoGridListsHeaderTitle": "Með haus", "demoGridListsFooterTitle": "Með síðufæti", "demoSlidersTitle": "Sleðar", "demoSlidersSubtitle": "Græjur til að velja gildi með stroku", "demoSlidersDescription": "Sleðar endurspegla gildissvið á stiku þar sem notendur geta valið eitt gildi. Þeir eru hentugir til að breyta stillingum á borð við hljóðstyrk eða birtu eða til að nota myndasíur.", "demoRangeSlidersTitle": "Sviðssleðar", "demoRangeSlidersDescription": "Sleðar endurspegla svið gilda á stiku. Þeir kunna að hafa tákn á sitt hvorum endanum sem gefa til kynna gildissvið. Þeir eru hentugir til að breyta stillingum á borð við hljóðstyrk eða birtu eða til að nota myndasíur.", "demoMenuAnItemWithAContextMenuButton": "Atriði með efnisvalmynd", "demoCustomSlidersDescription": "Sleðar endurspegla gildissvið á stiku þar sem notendur geta valið eitt gildi eða gildissvið. Hægt er að breyta og sérstilla sleðana.", "demoSlidersContinuousWithEditableNumericalValue": "Samfelldur með breytanlegu númeragildi", "demoSlidersDiscrete": "Stakrænn", "demoSlidersDiscreteSliderWithCustomTheme": "Stakrænn sleði með sérstilltu þema", "demoSlidersContinuousRangeSliderWithCustomTheme": "Samfelldur gildissleði með sérstilltu þema", "demoSlidersContinuous": "Samfelldur", "placePondicherry": "Pondicherry", "demoMenuTitle": "Valmynd", "demoContextMenuTitle": "Efnisvalmynd", "demoSectionedMenuTitle": "Hlutavalmynd", "demoSimpleMenuTitle": "Einföld valmynd", "demoChecklistMenuTitle": "Gátlistavalmynd", "demoMenuSubtitle": "Valmyndarhnappar og einfaldar valmyndir", "demoMenuDescription": "Valmynd birtir vallista á yfirborði sem svo hverfur. Listar hverfa þegar notandi velur hnapp, aðgerð eða aðrar stýringar.", "demoMenuItemValueOne": "Valmyndaratriði eitt", "demoMenuItemValueTwo": "Valmyndaratriði tvö", "demoMenuItemValueThree": "Valmyndaratriði þrjú", "demoMenuOne": "Eitt", "demoMenuTwo": "Tvö", "demoMenuThree": "Þrjú", "demoMenuContextMenuItemThree": "Þriðja atriði efnisvalmyndar", "demoCupertinoSwitchSubtitle": "Rofi með iOS-stíl", "demoSnackbarsText": "Þetta er snarlbar.", "demoCupertinoSliderSubtitle": "Sleði með iOS-stíl", "demoCupertinoSliderDescription": "Hægt er að nota sleða til að velja úr samfelldum gildum eða samsettum gildum.", "demoCupertinoSliderContinuous": "Samfelld: {value}", "demoCupertinoSliderDiscrete": "Samsettur: {value}", "demoSnackbarsAction": "Þú ýttir á aðgerð snarlbars.", "backToGallery": "Til baka í gallerí", "demoCupertinoTabBarTitle": "Flipastika", "demoCupertinoSwitchDescription": "Rofi er notaður til að skipta á milli þess að slökkt sé á einni stillingu eða kveikt sé á henni.", "demoSnackbarsActionButtonLabel": "HASAR", "cupertinoTabBarProfileTab": "Prófíll", "demoSnackbarsButtonLabel": "SÝNA SNARLBAR", "demoSnackbarsDescription": "Snarlbarir veita notendum upplýsingar um aðgerðir sem eru í gangi í forriti eða sem munu fara í gang. Þeir birtast tímabundið neðarlega á skjánum. Þeir ættu ekki að hafa áhrif á upplifun notandans og hann þarf ekki að bregðast við þeim til að þeir hverfi.", "demoSnackbarsSubtitle": "Snarlbarir sýna skilaboð neðst á skjánum", "demoSnackbarsTitle": "Snarlbarir", "demoCupertinoSliderTitle": "Sleði", "cupertinoTabBarChatTab": "Spjall", "cupertinoTabBarHomeTab": "Heim", "demoCupertinoTabBarDescription": "Neðri flettiflipastika með OS-stíl. Sýnir marga flipa þar sem einn er virkur, sem er sjálfkrafa fyrsti flipinn.", "demoCupertinoTabBarSubtitle": "Neðri flipastika með OS-stíl", "demoOptionsFeatureTitle": "Skoða valkosti", "demoOptionsFeatureDescription": "Ýttu hér til að sjá valkosti í boði fyrir þessa kynningu.", "demoCodeViewerCopyAll": "AFRITA ALLT", "shrineScreenReaderRemoveProductButton": "Fjarlægja {product}", "shrineScreenReaderProductAddToCart": "Setja í körfu", "shrineScreenReaderCart": "{quantity,plural,=0{Karfa, engir hlutir}=1{Karfa, 1 hlutur}other{Karfa, {quantity} hlutir}}", "demoCodeViewerFailedToCopyToClipboardMessage": "Ekki tókst að afrita á klippiborð: {error}", "demoCodeViewerCopiedToClipboardMessage": "Afritað á klippiborð.", "craneSleep8SemanticLabel": "Maya-rústir á klettavegg fyrir ofan strönd", "craneSleep4SemanticLabel": "Hótel við vatn með fjallasýn", "craneSleep2SemanticLabel": "Machu Picchu rústirnar", "craneSleep1SemanticLabel": "Kofi þakinn snjó í landslagi með sígrænum trjám", "craneSleep0SemanticLabel": "Bústaðir yfir vatni", "craneFly13SemanticLabel": "Sundlaug við sjóinn og pálmatré", "craneFly12SemanticLabel": "Sundlaug og pálmatré", "craneFly11SemanticLabel": "Múrsteinsviti við sjó", "craneFly10SemanticLabel": "Turnar Al-Azhar moskunnar við sólarlag", "craneFly9SemanticLabel": "Maður sem hallar sér upp að bláum antíkbíl", "craneFly8SemanticLabel": "Supertree Grove", "craneEat9SemanticLabel": "Kökur á kaffihúsi", "craneEat2SemanticLabel": "Hamborgari", "craneFly5SemanticLabel": "Hótel við vatn með fjallasýn", "demoSelectionControlsSubtitle": "Gátreitir, valreitir og rofar", "craneEat10SemanticLabel": "Kona sem heldur á stórri nautakjötssamloku", "craneFly4SemanticLabel": "Bústaðir yfir vatni", "craneEat7SemanticLabel": "Inngangur bakarís", "craneEat6SemanticLabel": "Rækjudiskur", "craneEat5SemanticLabel": "Sæti á listrænum veitingastað", "craneEat4SemanticLabel": "Súkkulaðieftirréttur", "craneEat3SemanticLabel": "Kóreskt taco", "craneFly3SemanticLabel": "Machu Picchu rústirnar", "craneEat1SemanticLabel": "Tómur bar með auðum upphækkuðum stólum", "craneEat0SemanticLabel": "Viðarelduð pítsa í ofni", "craneSleep11SemanticLabel": "Taipei 101 skýjakljúfur", "craneSleep10SemanticLabel": "Turnar Al-Azhar moskunnar við sólarlag", "craneSleep9SemanticLabel": "Múrsteinsviti við sjó", "craneEat8SemanticLabel": "Diskur með vatnakröbbum", "craneSleep7SemanticLabel": "Litrík hús við Ribeira-torgið", "craneSleep6SemanticLabel": "Sundlaug og pálmatré", "craneSleep5SemanticLabel": "Tjald á akri", "settingsButtonCloseLabel": "Loka stillingum", "demoSelectionControlsCheckboxDescription": "Gátreitir gera notanda kleift að velja marga valkosti úr mengi. Gildi venjulegs gátreits er rétt eða rangt og eitt af gildum gátreits með þrjú gildi getur einnig verið núll.", "settingsButtonLabel": "Stillingar", "demoListsTitle": "Listar", "demoListsSubtitle": "Útlit lista sem flettist", "demoListsDescription": "Ein lína í fastri hæð sem yfirleitt inniheldur texta og tákn á undan eða á eftir.", "demoOneLineListsTitle": "Ein lína", "demoTwoLineListsTitle": "Tvær línur", "demoListsSecondary": "Aukatexti", "demoSelectionControlsTitle": "Valstýringar", "craneFly7SemanticLabel": "Rushmore-fjall", "demoSelectionControlsCheckboxTitle": "Gátreitur", "craneSleep3SemanticLabel": "Maður sem hallar sér upp að bláum antíkbíl", "demoSelectionControlsRadioTitle": "Val", "demoSelectionControlsRadioDescription": "Valhnappar sem gera notandanum kleift að velja einn valkost af nokkrum. Nota ætti valhnappa fyrir einkvæmt val ef þörf er talin á að notandinn þurfi að sjá alla valkosti í einu.", "demoSelectionControlsSwitchTitle": "Rofi", "demoSelectionControlsSwitchDescription": "Rofar til að kveikja/slökkva skipta á milli tveggja stillinga. Gera ætti valkostinn sem rofinn stjórnar, sem og stöðu hans, skýran í samsvarandi innskotsmerki.", "craneFly0SemanticLabel": "Kofi þakinn snjó í landslagi með sígrænum trjám", "craneFly1SemanticLabel": "Tjald á akri", "craneFly2SemanticLabel": "Litflögg við snæviþakið fjall", "craneFly6SemanticLabel": "Loftmynd af Palacio de Bellas Artes", "rallySeeAllAccounts": "Sjá alla reikninga", "rallyBillAmount": "{billName}, gjalddagi {date}, að upphæð {amount}.", "shrineTooltipCloseCart": "Loka körfu", "shrineTooltipCloseMenu": "Loka valmynd", "shrineTooltipOpenMenu": "Opna valmynd", "shrineTooltipSettings": "Stillingar", "shrineTooltipSearch": "Leita", "demoTabsDescription": "Flipar raða efni á mismunandi skjái, mismunandi gagnasöfn og önnur samskipti.", "demoTabsSubtitle": "Flipar með sjálfstæðu yfirliti sem hægt er að fletta um", "demoTabsTitle": "Flipar", "rallyBudgetAmount": "{budgetName} kostnaðarhámark þar sem {amountUsed} er notað af {amountTotal} og {amountLeft} er eftir", "shrineTooltipRemoveItem": "Fjarlægja atriði", "rallyAccountAmount": "{accountName}, reikningur {accountNumber}, að upphæð {amount}.", "rallySeeAllBudgets": "Sjá allt kostnaðarhámark", "rallySeeAllBills": "Sjá alla reikninga", "craneFormDate": "Veldu dagsetningu", "craneFormOrigin": "Velja brottfararstað", "craneFly2": "Khumbu-dalur, Nepal", "craneFly3": "Machu Picchu, Perú", "craneFly4": "Malé, Maldíveyjum", "craneFly5": "Vitznau, Sviss", "craneFly6": "Mexíkóborg, Mexíkó", "craneFly7": "Mount Rushmore, Bandaríkjunum", "settingsTextDirectionLocaleBased": "Byggt á staðsetningu", "craneFly9": "Havana, Kúbu", "craneFly10": "Kaíró, Egyptalandi", "craneFly11": "Lissabon, Portúgal", "craneFly12": "Napa, Bandaríkjunum", "craneFly13": "Balí, Indónesíu", "craneSleep0": "Malé, Maldíveyjum", "craneSleep1": "Aspen, Bandaríkjunum", "craneSleep2": "Machu Picchu, Perú", "demoCupertinoSegmentedControlTitle": "Hlutaval", "craneSleep4": "Vitznau, Sviss", "craneSleep5": "Big Sur, Bandaríkjunum", "craneSleep6": "Napa, Bandaríkjunum", "craneSleep7": "Portó, Portúgal", "craneSleep8": "Tulum, Mexíkó", "craneEat5": "Seúl, Suður-Kóreu", "demoChipTitle": "Kubbar", "demoChipSubtitle": "Þjappaðar einingar sem tákna inntak, eigind eða aðgerð", "demoActionChipTitle": "Aðgerðarkubbur", "demoActionChipDescription": "Aðgerðarkubbar eru hópur valkosta sem ræsa aðgerð sem tengist upprunaefni. Birting aðgerðarkubba ætti að vera kvik og í samhengi í notandaviðmóti.", "demoChoiceChipTitle": "Valkubbur", "demoChoiceChipDescription": "Valkubbar tákna eitt val úr mengi. Valkubbar innihalda tengdan lýsandi texta eða flokka.", "demoFilterChipTitle": "Síuflaga", "demoFilterChipDescription": "Síukubbar nota merki eða lýsandi orð til að sía efni.", "demoInputChipTitle": "Innsláttarkubbur", "demoInputChipDescription": "Innsláttarkubbar tákna flóknar upplýsingar á borð við einingar (einstakling, stað eða hlut) eða samtalstexta á þjöppuðu sniði.", "craneSleep9": "Lissabon, Portúgal", "craneEat10": "Lissabon, Portúgal", "demoCupertinoSegmentedControlDescription": "Notað til að velja á milli valkosta sem útiloka hvern annan. Þegar einn valkostur í hlutavali er valinn er ekki lengur hægt að velja hina valkostina.", "chipTurnOnLights": "Kveikja á ljósum", "chipSmall": "Lítill", "chipMedium": "Miðlungs", "chipLarge": "Stór", "chipElevator": "Lyfta", "chipWasher": "Þvottavél", "chipFireplace": "Arinn", "chipBiking": "Hjólandi", "craneFormDiners": "Matsölur", "rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{Auktu hugsanlegan frádrátt frá skatti! Úthluta flokkum á 1 óúthlutaða færslu.}other{Auktu hugsanlegan frádrátt frá skatti! Úthluta flokkum á {count} óúthlutaðar færslur.}}", "craneFormTime": "Veldu tíma", "craneFormLocation": "Velja staðsetningu", "craneFormTravelers": "Farþegar", "craneEat8": "Atlanta, Bandaríkjunum", "craneFormDestination": "Veldu áfangastað", "craneFormDates": "Veldu dagsetningar", "craneFly": "FLUG", "craneSleep": "SVEFN", "craneEat": "MATUR", "craneFlySubhead": "Skoða flug eftir áfangastað", "craneSleepSubhead": "Skoða eignir eftir áfangastað", "craneEatSubhead": "Skoða veitingastaði eftir áfangastað", "craneFlyStops": "{numberOfStops,plural,=0{Engar millilendingar}=1{Ein millilending}other{{numberOfStops} millilendingar}}", "craneSleepProperties": "{totalProperties,plural,=0{Engar tiltækar eignir}=1{1 tiltæk eign}other{{totalProperties} tiltækar eignir}}", "craneEatRestaurants": "{totalRestaurants,plural,=0{Engir veitingastaðir}=1{1 veitingastaður}other{{totalRestaurants} veitingastaðir}}", "craneFly0": "Aspen, Bandaríkjunum", "demoCupertinoSegmentedControlSubtitle": "Hlutaval með iOS-stíl", "craneSleep10": "Kaíró, Egyptalandi", "craneEat9": "Madríd, Spáni", "craneFly1": "Big Sur, Bandaríkjunum", "craneEat7": "Nashville, Bandaríkjunum", "craneEat6": "Seattle, Bandaríkjunum", "craneFly8": "Singapúr", "craneEat4": "París, Frakklandi", "craneEat3": "Portland, Bandaríkjunum", "craneEat2": "Córdoba, Argentínu", "craneEat1": "Dallas, Bandaríkjunum", "craneEat0": "Napólí, Ítalíu", "craneSleep11": "Taipei, Taívan", "craneSleep3": "Havana, Kúbu", "shrineLogoutButtonCaption": "SKRÁ ÚT", "rallyTitleBills": "REIKNINGAR", "rallyTitleAccounts": "REIKNINGAR", "shrineProductVagabondSack": "Vagabond-taska", "rallyAccountDetailDataInterestYtd": "Vextir á árinu", "shrineProductWhitneyBelt": "Whitney belti", "shrineProductGardenStrand": "Hálsmen", "shrineProductStrutEarrings": "Strut-eyrnalokkar", "shrineProductVarsitySocks": "Sokkar með röndum", "shrineProductWeaveKeyring": "Ofin lyklakippa", "shrineProductGatsbyHat": "Gatsby-hattur", "shrineProductShrugBag": "Axlarpoki", "shrineProductGiltDeskTrio": "Þrjú hliðarborð", "shrineProductCopperWireRack": "Koparvírarekkki", "shrineProductSootheCeramicSet": "Soothe-keramiksett", "shrineProductHurrahsTeaSet": "Hurrahs-tesett", "shrineProductBlueStoneMug": "Blár steinbolli", "shrineProductRainwaterTray": "Regnbakki", "shrineProductChambrayNapkins": "Chambray-munnþurrkur", "shrineProductSucculentPlanters": "Blómapottar fyrir þykkblöðunga", "shrineProductQuartetTable": "Ferhyrnt borð", "shrineProductKitchenQuattro": "Kitchen quattro", "shrineProductClaySweater": "Clay-peysa", "shrineProductSeaTunic": "Strandskokkur", "shrineProductPlasterTunic": "Ljós skokkur", "rallyBudgetCategoryRestaurants": "Veitingastaðir", "shrineProductChambrayShirt": "Chambray-skyrta", "shrineProductSeabreezeSweater": "Þunn prjónapeysa", "shrineProductGentryJacket": "Herrajakki", "shrineProductNavyTrousers": "Dökkbláar buxur", "shrineProductWalterHenleyWhite": "Walter Henley (hvítur)", "shrineProductSurfAndPerfShirt": "Surf and perf-skyrta", "shrineProductGingerScarf": "Rauðbrúnn trefill", "shrineProductRamonaCrossover": "Ramona-axlarpoki", "shrineProductClassicWhiteCollar": "Klassísk hvít skyrta", "shrineProductSunshirtDress": "Sunshirt-kjóll", "rallyAccountDetailDataInterestRate": "Vextir", "rallyAccountDetailDataAnnualPercentageYield": "Ársávöxtun í prósentum", "rallyAccountDataVacation": "Frí", "shrineProductFineLinesTee": "Smáröndóttur bolur", "rallyAccountDataHomeSavings": "Heimilissparnaður", "rallyAccountDataChecking": "Athugar", "rallyAccountDetailDataInterestPaidLastYear": "Greiddir vextir á síðasta ári", "rallyAccountDetailDataNextStatement": "Næsta yfirlit", "rallyAccountDetailDataAccountOwner": "Reikningseigandi", "rallyBudgetCategoryCoffeeShops": "Kaffihús", "rallyBudgetCategoryGroceries": "Matvörur", "shrineProductCeriseScallopTee": "Rauðbleikur bolur með ávölum faldi", "rallyBudgetCategoryClothing": "Klæðnaður", "rallySettingsManageAccounts": "Stjórna reikningum", "rallyAccountDataCarSavings": "Bílasparnaður", "rallySettingsTaxDocuments": "Skattaskjöl", "rallySettingsPasscodeAndTouchId": "Aðgangskóði og snertiauðkenni", "rallySettingsNotifications": "Tilkynningar", "rallySettingsPersonalInformation": "Persónuupplýsingar", "rallySettingsPaperlessSettings": "Stillingar Paperless", "rallySettingsFindAtms": "Finna hraðbanka", "rallySettingsHelp": "Hjálp", "rallySettingsSignOut": "Skrá út", "rallyAccountTotal": "Samtals", "rallyBillsDue": "Til greiðslu", "rallyBudgetLeft": "Eftir", "rallyAccounts": "Reikningar", "rallyBills": "Reikningar", "rallyBudgets": "Kostnaðarmörk", "rallyAlerts": "Tilkynningar", "rallySeeAll": "SJÁ ALLT", "rallyFinanceLeft": "EFTIR", "rallyTitleOverview": "YFIRLIT", "shrineProductShoulderRollsTee": "Bolur með uppbrettum ermum", "shrineNextButtonCaption": "ÁFRAM", "rallyTitleBudgets": "KOSTNAÐARMÖRK", "rallyTitleSettings": "STILLINGAR", "rallyLoginLoginToRally": "Skrá inn í Rally", "rallyLoginNoAccount": "Ertu ekki með reikning?", "rallyLoginSignUp": "SKRÁ MIG", "rallyLoginUsername": "Notandanafn", "rallyLoginPassword": "Aðgangsorð", "rallyLoginLabelLogin": "Skrá inn", "rallyLoginRememberMe": "Muna eftir mér", "rallyLoginButtonLogin": "SKRÁ INN", "rallyAlertsMessageHeadsUpShopping": "Athugaðu að þú ert búin(n) með {percent} af kostnaðarhámarki mánaðarins.", "rallyAlertsMessageSpentOnRestaurants": "Þú hefur eytt {amount} á veitingastöðum í vikunni.", "rallyAlertsMessageATMFees": "Þú hefur eytt {amount} í hraðbankagjöld í mánuðinum", "rallyAlertsMessageCheckingAccount": "Vel gert! Þú átt {percent} meira inni á veltureikningnum þínum en í síðasta mánuði.", "shrineMenuCaption": "VALMYND", "shrineCategoryNameAll": "ALLT", "shrineCategoryNameAccessories": "AUKABÚNAÐUR", "shrineCategoryNameClothing": "FÖT", "shrineCategoryNameHome": "HEIMA", "shrineLoginUsernameLabel": "Notandanafn", "shrineLoginPasswordLabel": "Aðgangsorð", "shrineCancelButtonCaption": "HÆTTA VIÐ", "shrineCartTaxCaption": "Skattur:", "shrineCartPageCaption": "KARFA", "shrineProductQuantity": "Magn: {quantity}", "shrineProductPrice": "x {price}", "shrineCartItemCount": "{quantity,plural,=0{ENGIN ATRIÐI}=1{1 ATRIÐI}other{{quantity} ATRIÐI}}", "shrineCartClearButtonCaption": "HREINSA KÖRFU", "shrineCartTotalCaption": "SAMTALS", "shrineCartSubtotalCaption": "Millisamtala:", "shrineCartShippingCaption": "Sending:", "shrineProductGreySlouchTank": "Grár, víður hlýrabolur", "shrineProductStellaSunglasses": "Stella-sólgleraugu", "shrineProductWhitePinstripeShirt": "Hvít teinótt skyrta", "demoTextFieldWhereCanWeReachYou": "Hvar getum við náð í þig?", "settingsTextDirectionLTR": "Vinstri til hægri", "settingsTextScalingLarge": "Stórt", "demoBottomSheetHeader": "Haus", "demoBottomSheetItem": "Vara {value}", "demoBottomTextFieldsTitle": "Textareitir", "demoTextFieldTitle": "Textareitir", "demoTextFieldSubtitle": "Ein lína með texta og tölum sem hægt er að breyta", "demoTextFieldDescription": "Textareitir gera notendum kleift að slá texta inn í notendaviðmót. Þeir eru yfirleitt á eyðublöðum og í gluggum.", "demoTextFieldShowPasswordLabel": "Sýna aðgangsorð", "demoTextFieldHidePasswordLabel": "Fela aðgangsorð", "demoTextFieldFormErrors": "Lagaðu rauðar villur með áður en þú sendir.", "demoTextFieldNameRequired": "Nafn er áskilið.", "demoTextFieldOnlyAlphabeticalChars": "Sláðu aðeins inn bókstafi.", "demoTextFieldEnterUSPhoneNumber": "(###) ###-#### – sláðu inn bandarískt símanúmer.", "demoTextFieldEnterPassword": "Sláðu inn aðgangsorð.", "demoTextFieldPasswordsDoNotMatch": "Aðgangsorðin passa ekki saman", "demoTextFieldWhatDoPeopleCallYou": "Hvað kallar fólk þig?", "demoTextFieldNameField": "Heiti*", "demoBottomSheetButtonText": "SÝNA BLAÐ NEÐST", "demoTextFieldPhoneNumber": "Símanúmer*", "demoBottomSheetTitle": "Blað neðst", "demoTextFieldEmail": "Netfang", "demoTextFieldTellUsAboutYourself": "Segðu okkur frá þér (skrifaðu til dæmis hvað þú vinnur við eða hver áhugmál þín eru)", "demoTextFieldKeepItShort": "Hafðu þetta stutt, þetta er einungis sýniútgáfa.", "starterAppGenericButton": "HNAPPUR", "demoTextFieldLifeStory": "Æviskeið", "demoTextFieldSalary": "Laun", "demoTextFieldUSD": "USD", "demoTextFieldNoMoreThan": "Ekki fleiri en 8 stafir.", "demoTextFieldPassword": "Aðgangsorð*", "demoTextFieldRetypePassword": "Sláðu aðgangsorðið aftur inn*", "demoTextFieldSubmit": "SENDA", "demoBottomNavigationSubtitle": "Yfirlitssvæði neðst með víxldofnandi yfirliti", "demoBottomSheetAddLabel": "Bæta við", "demoBottomSheetModalDescription": "Gluggablað neðst kemur í stað valmyndar eða glugga og kemur í veg fyrir að notandinn noti aðra hluta forritsins.", "demoBottomSheetModalTitle": "Gluggablað neðst", "demoBottomSheetPersistentDescription": "Fast blað neðst birtir upplýsingar til viðbótar við aðalefni forritsins. Fast blað neðst er sýnilegt þótt notandinn noti aðra hluta forritsins.", "demoBottomSheetPersistentTitle": "Fast blað neðst", "demoBottomSheetSubtitle": "Föst blöð og gluggablöð neðst", "demoTextFieldNameHasPhoneNumber": "Símanúmer {name} er {phoneNumber}", "buttonText": "HNAPPUR", "demoTypographyDescription": "Skilgreiningar mismunandi leturstíla sem finna má í nýju útlitshönnuninni.", "demoTypographySubtitle": "Allir fyrirframskilgreindir textastílar", "demoTypographyTitle": "Leturgerð", "demoFullscreenDialogDescription": "Eiginleikinn fullscreenDialog tilgreinir hvort móttekin síða er gluggi sem birtist á öllum skjánum", "demoFlatButtonDescription": "Sléttur hnappur birtir blekslettu þegar ýtt er á hann en lyftist ekki. Notið slétta hnappa í tækjastikum, gluggum og í línum með fyllingu", "demoBottomNavigationDescription": "Yfirlitsstikur neðst birta þrjá til fimm áfangastaði neðst á skjánum. Hver áfangastaður er auðkenndur með tákni og valfrjálsu textamerki. Þegar ýtt er á yfirlitstákn neðst fer notandinn á efstu staðsetninguna sem tengist tákninu.", "demoBottomNavigationSelectedLabel": "Valið merki", "demoBottomNavigationPersistentLabels": "Föst merki", "starterAppDrawerItem": "Vara {value}", "demoTextFieldRequiredField": "* gefur til kynna áskilinn reit", "demoBottomNavigationTitle": "Yfirlit neðst", "settingsLightTheme": "Ljóst", "settingsTheme": "Þema", "settingsPlatformIOS": "iOS", "settingsPlatformAndroid": "Android", "settingsTextDirectionRTL": "Hægri til vinstri", "settingsTextScalingHuge": "Risastórt", "cupertinoButton": "Hnappur", "settingsTextScalingNormal": "Venjulegt", "settingsTextScalingSmall": "Lítið", "settingsSystemDefault": "Kerfi", "settingsTitle": "Stillingar", "rallyDescription": "Forrit fyrir fjármál einstaklinga", "aboutDialogDescription": "Farðu á {repoLink} til að sjá upprunakóða þessa forrits.", "bottomNavigationCommentsTab": "Ummæli", "starterAppGenericBody": "Meginmál", "starterAppGenericHeadline": "Fyrirsögn", "starterAppGenericSubtitle": "Undirtitill", "starterAppGenericTitle": "Titill", "starterAppTooltipSearch": "Leita", "starterAppTooltipShare": "Deila", "starterAppTooltipFavorite": "Eftirlæti", "starterAppTooltipAdd": "Bæta við", "bottomNavigationCalendarTab": "Dagatal", "starterAppDescription": "Hraðvirkt upphafsútlit", "starterAppTitle": "Ræsiforrit", "aboutFlutterSamplesRepo": "Flutter-sýnishorn í GitHub-geymslu", "bottomNavigationContentPlaceholder": "Staðgengill fyrir flipann {title}", "bottomNavigationCameraTab": "Myndavél", "bottomNavigationAlarmTab": "Vekjari", "bottomNavigationAccountTab": "Reikningur", "demoTextFieldYourEmailAddress": "Netfangið þitt", "demoToggleButtonDescription": "Hægt er að nota hnappa til að slökkva og kveikja á flokkun tengdra valkosta. Til að leggja áherslu á flokka tengdra hnappa til að slökkva og kveikja ætti flokkur að vera með sameiginlegan geymi", "colorsGrey": "GRÁR", "colorsBrown": "BRÚNN", "colorsDeepOrange": "DJÚPAPPELSÍNUGULUR", "colorsOrange": "APPELSÍNUGULUR", "colorsAmber": "RAFGULUR", "colorsYellow": "GULUR", "colorsLime": "LJÓSGRÆNN", "colorsLightGreen": "LJÓSGRÆNN", "colorsGreen": "GRÆNN", "homeHeaderGallery": "Myndasafn", "homeHeaderCategories": "Flokkar", "shrineDescription": "Tískulegt verslunarforrit", "craneDescription": "Sérsniðið ferðaforrit", "homeCategoryReference": "STÍLAR OG ANNAÐ", "demoInvalidURL": "Ekki var hægt að birta vefslóð:", "demoOptionsTooltip": "Valkostir", "demoInfoTooltip": "Upplýsingar", "demoCodeTooltip": "Kynningarkóði", "demoDocumentationTooltip": "Upplýsingaskjöl um forritaskil", "demoFullscreenTooltip": "Allur skjárinn", "settingsTextScaling": "Textastærð", "settingsTextDirection": "Textastefna", "settingsLocale": "Tungumálskóði", "settingsPlatformMechanics": "Uppbygging kerfis", "settingsDarkTheme": "Dökkt", "settingsSlowMotion": "Hægspilun", "settingsAbout": "Um Flutter Gallery", "settingsFeedback": "Senda ábendingu", "settingsAttribution": "Hannað af TOASTER í London", "demoButtonTitle": "Hnappar", "demoButtonSubtitle": "Texta-, upphleyptir-, útlínu- og fleiri", "demoFlatButtonTitle": "Sléttur hnappur", "demoRaisedButtonDescription": "Upphleyptir hnappar gefa flatri uppsetningu aukna vídd. Þeir undirstrika virkni á stórum svæðum eða þar sem mikið er um að vera.", "demoRaisedButtonTitle": "Upphleyptur hnappur", "demoOutlineButtonTitle": "Hnappur með útlínum", "demoOutlineButtonDescription": "Hnappar með útlínum verða ógagnsæir og lyftast upp þegar ýtt er á þá. Þeir fylgja oft upphleyptum hnöppum til að gefa til kynna aukaaðgerð.", "demoToggleButtonTitle": "Hnappar til að slökkva og kveikja", "colorsTeal": "GRÆNBLÁR", "demoFloatingButtonTitle": "Fljótandi aðgerðahnappur", "demoFloatingButtonDescription": "Fljótandi aðgerðahnappur er hringlaga táknhnappur sem birtist yfir efni til að kynna aðalaðgerð forritsins.", "demoDialogTitle": "Gluggar", "demoDialogSubtitle": "Einfaldur, tilkynning og allur skjárinn", "demoAlertDialogTitle": "Viðvörun", "demoAlertDialogDescription": "Viðvörunargluggi upplýsir notanda um aðstæður sem krefjast staðfestingar. Viðvörunargluggi getur haft titil og lista yfir aðgerðir.", "demoAlertTitleDialogTitle": "Viðvörun með titli", "demoSimpleDialogTitle": "Einfalt", "demoSimpleDialogDescription": "Einfaldur gluggi býður notanda að velja á milli nokkurra valkosta. Einfaldur gluggi getur haft titil sem birtist fyrir ofan valkostina.", "demoFullscreenDialogTitle": "Allur skjárinn", "demoCupertinoButtonsTitle": "Hnappar", "demoCupertinoButtonsSubtitle": "Hnappar með iOS-stíl", "demoCupertinoButtonsDescription": "Hnappur í iOS-stíl. Hann tekur með sér texta og/eða tákn sem dofnar og verður sterkara þegar hnappurinn er snertur. Getur verið með bakgrunn.", "demoCupertinoAlertsTitle": "Viðvaranir", "demoCupertinoAlertsSubtitle": "Viðvörunargluggar í iOS-stíl", "demoCupertinoAlertTitle": "Tilkynning", "demoCupertinoAlertDescription": "Viðvörunargluggi upplýsir notanda um aðstæður sem krefjast staðfestingar. Viðvörunargluggi getur haft titil, efni og lista yfir aðgerðir. Titillinn birtist fyrir ofan efnið og aðgerðirnar birtast fyrir neðan efnið.", "demoCupertinoAlertWithTitleTitle": "Tilkynning með titli", "demoCupertinoAlertButtonsTitle": "Viðvörun með hnöppum", "demoCupertinoAlertButtonsOnlyTitle": "Aðeins viðvörunarhnappar", "demoCupertinoActionSheetTitle": "Aðgerðablað", "demoCupertinoActionSheetDescription": "Aðgerðablað er sérstök gerð af viðvörun sem býður notandanum upp á tvo eða fleiri valkosti sem tengjast núverandi samhengi. Aðgerðablað getur haft titil, viðbótarskilaboð og lista yfir aðgerðir.", "demoColorsTitle": "Litir", "demoColorsSubtitle": "Allir fyrirfram skilgreindu litirnir", "demoColorsDescription": "Fastar fyrir liti og litaprufur sem standa fyrir litaspjald nýju útlitshönnunarinnar.", "buttonTextEnabled": "ENABLED", "buttonTextDisabled": "DISABLED", "buttonTextCreate": "Búa til", "dialogSelectedOption": "Þú valdir: „{value}“", "dialogDiscardTitle": "Viltu fleygja drögunum?", "dialogLocationTitle": "Nota staðsetningarþjónustu Google?", "dialogLocationDescription": "Leyfðu Google að hjálpa forritum að ákvarða staðsetningu. Í þessu felst að senda nafnlaus staðsetningargögn til Google, jafnvel þótt engin forrit séu í gangi.", "dialogCancel": "HÆTTA VIÐ", "dialogDiscard": "FLEYGJA", "dialogDisagree": "HAFNA", "dialogAgree": "SAMÞYKKJA", "dialogSetBackup": "Velja afritunarreikning", "colorsBlueGrey": "BLÁGRÁR", "dialogShow": "SÝNA GLUGGA", "dialogFullscreenTitle": "Gluggi á öllum skjánum", "dialogFullscreenSave": "VISTA", "dialogFullscreenDescription": "Kynningargluggi á öllum skjánum", "cupertinoButtonEnabled": "Enabled", "cupertinoButtonDisabled": "Disabled", "cupertinoButtonWithBackground": "Með bakgrunni", "cupertinoAlertCancel": "Hætta við", "cupertinoAlertDiscard": "Fleygja", "cupertinoAlertLocationTitle": "Viltu leyfa „Kort“ að fá aðgang að staðsetningu þinni á meðan þú notar forritið?", "cupertinoAlertLocationDescription": "Núverandi staðsetning þín verður birt á kortinu og notuð fyrir leiðarlýsingu, leitarniðurstöður fyrir nágrennið og áætlaðan ferðatíma.", "cupertinoAlertAllow": "Leyfa", "cupertinoAlertDontAllow": "Ekki leyfa", "cupertinoAlertFavoriteDessert": "Velja uppáhaldseftirrétt", "cupertinoAlertDessertDescription": "Veldu uppáhaldseftirréttinn þinn af listanum hér að neðan. Það sem þú velur verður notað til að sérsníða tillögulista fyrir matsölustaði á þínu svæði.", "cupertinoAlertCheesecake": "Ostakaka", "cupertinoAlertTiramisu": "Tiramisu", "cupertinoAlertApplePie": "Eplabaka", "cupertinoAlertChocolateBrownie": "Skúffukaka", "cupertinoShowAlert": "Sýna viðvörun", "colorsRed": "RAUÐUR", "colorsPink": "BLEIKUR", "colorsPurple": "FJÓLUBLÁR", "colorsDeepPurple": "DJÚPFJÓLUBLÁR", "colorsIndigo": "DIMMFJÓLUBLÁR", "colorsBlue": "BLÁR", "colorsLightBlue": "LJÓSBLÁR", "colorsCyan": "BLÁGRÆNN", "dialogAddAccount": "Bæta reikningi við", "Gallery": "Myndasafn", "Categories": "Flokkar", "SHRINE": "SHRINE", "Basic shopping app": "Einfalt kaupforrit", "RALLY": "RALLY", "CRANE": "CRANE", "Travel app": "Ferðaforrit", "MATERIAL": "EFNI", "CUPERTINO": "CUPERTINO", "REFERENCE STYLES & MEDIA": "TILVÍSUNARSTÍLAR OG EFNI" }
gallery/lib/l10n/intl_is.arb/0
{ "file_path": "gallery/lib/l10n/intl_is.arb", "repo_id": "gallery", "token_count": 21188 }
799
{ "loading": "Memuatkan", "deselect": "Nyahpilih", "select": "Pilih", "selectable": "Boleh pilih (tekan lama)", "selected": "Dipilih", "demo": "Demo", "bottomAppBar": "Bar apl sebelah bawah", "notSelected": "Tidak dipilih", "demoCupertinoSearchTextFieldTitle": "Medan teks carian", "demoCupertinoPicker": "Pemilih", "demoCupertinoSearchTextFieldSubtitle": "Medan teks carian gaya iOS", "demoCupertinoSearchTextFieldDescription": "Medan teks carian yang membolehkan pengguna membuat carian dengan memasukkan teks dan yang boleh menawarkan dan menapis cadangan.", "demoCupertinoSearchTextFieldPlaceholder": "Masukkan teks", "demoCupertinoScrollbarTitle": "Bar tatal", "demoCupertinoScrollbarSubtitle": "Bar tatal gaya iOS", "demoCupertinoScrollbarDescription": "Bar tatal yang membalut anak tertentu", "demoTwoPaneItem": "Item {value}", "demoTwoPaneList": "Senarai", "demoTwoPaneFoldableLabel": "Boleh lipat", "demoTwoPaneSmallScreenLabel": "Skrin Kecil", "demoTwoPaneSmallScreenDescription": "Inilah gelagat TwoPane pada peranti skrin kecil.", "demoTwoPaneTabletLabel": "Tablet / Desktop", "demoTwoPaneTabletDescription": "Inilah gelagat TwoPane pada skrin yang lebih besar, seperti tablet atau desktop.", "demoTwoPaneTitle": "TwoPane", "demoTwoPaneSubtitle": "Reka letak responsif pada peranti boleh lipat, skrin besar dan skrin kecil", "splashSelectDemo": "Pilih demo", "demoTwoPaneFoldableDescription": "Inilah gelagat TwoPane pada peranti boleh lipat.", "demoTwoPaneDetails": "Butiran", "demoTwoPaneSelectItem": "Pilih item", "demoTwoPaneItemDetails": "Butiran item {value}", "demoCupertinoContextMenuActionText": "Ketik dan tahan logo Flutter bagi melihat menu konteks.", "demoCupertinoContextMenuDescription": "Menu konteks skrin penuh bergaya iOS yang muncul apabila sesuatu elemen ditekan lama.", "demoAppBarTitle": "Bar apl", "demoAppBarDescription": "Bar Apl menyediakan kandungan dan tindakan yang berkaitan dengan skrin semasa. Bar Apl ini digunakan untuk penjenamaan, tajuk skrin, navigasi dan tindakan", "demoDividerTitle": "Pembahagi", "demoDividerSubtitle": "Pembahagi ialah garisan nipis yang mengumpulkan kandungan dalam senarai dan reka letak.", "demoDividerDescription": "Pembahagi boleh digunakan dalam senarai, laci dan di tempat lain bagi memisahkan kandungan.", "demoVerticalDividerTitle": "Pembahagi Menegak", "demoCupertinoContextMenuTitle": "Menu Konteks", "demoCupertinoContextMenuSubtitle": "Menu konteks bergaya iOS", "demoAppBarSubtitle": "Memaparkan maklumat dan tindakan berkaitan dengan skrin semasa", "demoCupertinoContextMenuActionOne": "Tindakan satu", "demoCupertinoContextMenuActionTwo": "Tindakan dua", "demoDateRangePickerDescription": "Menunjukkan dialog yang mengandungi pemilih julat tarikh Reka Bentuk Bahan.", "demoDateRangePickerTitle": "Pemilih Julat Tarikh", "demoNavigationDrawerUserName": "Nama Pengguna", "demoNavigationDrawerUserEmail": "[email protected]", "demoNavigationDrawerText": "Leret dari tepi atau ketik ikon kiri sebelah atas untuk melihat laci", "demoNavigationRailTitle": "Laluan Navigasi", "demoNavigationRailSubtitle": "Memaparkan Laluan Navigasi dalam apl", "demoNavigationRailDescription": "Widget bahan yang dimaksudkan untuk dipaparkan di kiri atau kanan apl untuk menavigasi antara sebilangan kecil paparan, biasanya antara tiga hingga lima.", "demoNavigationRailFirst": "Pertama", "demoNavigationDrawerTitle": "Laci Navigasi", "demoNavigationRailThird": "Ketiga", "replyStarredLabel": "Berbintang", "demoTextButtonDescription": "Butang teks memaparkan percikan dakwat apabila ditekan namun tidak timbul. Gunakan butang teks pada bar alat, dalam dialog dan sebaris dengan pelapik", "demoElevatedButtonTitle": "Butang Terangkat", "demoElevatedButtonDescription": "Butang terangkat menambahkan dimensi pada reka letak yang kebanyakannya rata. Butang ini menekankan fungsi pada ruang sibuk atau luas.", "demoOutlinedButtonTitle": "Butang Garis Kasar", "demoOutlinedButtonDescription": "Butang garis kasar menjadi legap dan terangkat apabila ditekan. Butang ini sering digandingkan dengan butang timbul untuk menunjukkan tindakan sekunder alternatif.", "demoContainerTransformDemoInstructions": "Kad, Senarai & FAB", "demoNavigationDrawerSubtitle": "Memaparkan laci dalam bar apl", "replyDescription": "Apl e-mel yang cekap dan fokus", "demoNavigationDrawerDescription": "Panel Reka Bentuk Bahan yang diluncurkan secara mendatar dari tepi skrin untuk menunjukkan pautan navigasi dalam aplikasi.", "replyDraftsLabel": "Draf", "demoNavigationDrawerToPageOne": "Item Satu", "replyInboxLabel": "Peti masuk", "demoSharedXAxisDemoInstructions": "Butang Seterusnya dan Kembali", "replySpamLabel": "Spam", "replyTrashLabel": "Sampah", "replySentLabel": "Dihantar", "demoNavigationRailSecond": "Kedua", "demoNavigationDrawerToPageTwo": "Item Dua", "demoFadeScaleDemoInstructions": "Mod dan FAB", "demoFadeThroughDemoInstructions": "Navigasi bawah", "demoSharedZAxisDemoInstructions": "Butang ikon tetapan", "demoSharedYAxisDemoInstructions": "Isih mengikut \"Dimainkan Baru-baru Ini\"", "demoTextButtonTitle": "Butang Teks", "demoSharedZAxisBeefSandwichRecipeTitle": "Sandwic Daging", "demoSharedZAxisDessertRecipeDescription": "Resipi pencuci mulut", "demoSharedYAxisAlbumTileSubtitle": "Artis", "demoSharedYAxisAlbumTileTitle": "Album", "demoSharedYAxisRecentSortTitle": "Dimainkan baru-baru ini", "demoSharedYAxisAlphabeticalSortTitle": "A-Z", "demoSharedYAxisAlbumCount": "268 album", "demoSharedYAxisTitle": "Paksi y dikongsi", "demoSharedXAxisCreateAccountButtonText": "BUAT AKAUN", "demoFadeScaleAlertDialogDiscardButton": "BUANG", "demoSharedXAxisSignInTextFieldLabel": "E-mel atau nombor telefon", "demoSharedXAxisSignInSubtitleText": "Log masuk dengan akaun anda", "demoSharedXAxisSignInWelcomeText": "Hai, David Park", "demoSharedXAxisIndividualCourseSubtitle": "Ditunjukkan Secara Berasingan", "demoSharedXAxisBundledCourseSubtitle": "Dihimpunkan", "demoFadeThroughAlbumsDestination": "Album", "demoSharedXAxisDesignCourseTitle": "Reka bentuk", "demoSharedXAxisIllustrationCourseTitle": "Ilustrasi", "demoSharedXAxisBusinessCourseTitle": "Perniagaan", "demoSharedXAxisArtsAndCraftsCourseTitle": "Seni & Pertukangan", "demoMotionPlaceholderSubtitle": "Teks sekunder", "demoFadeScaleAlertDialogCancelButton": "BATAL", "demoFadeScaleAlertDialogHeader": "Dialog Makluman", "demoFadeScaleHideFabButton": "SEMBUNYIKAN FAB", "demoFadeScaleShowFabButton": "TUNJUKKAN FAB", "demoFadeScaleShowAlertDialogButton": "TUNJUKKAN MODAL", "demoFadeScaleDescription": "Corak lenyap digunakan untuk elemen UI yang masuk atau keluar dalam sempadan skrin, seperti dialog yang lenyap di tengah-tengah skrin.", "demoFadeScaleTitle": "Lenyap", "demoFadeThroughTextPlaceholder": "123 foto", "demoFadeThroughSearchDestination": "Cari", "demoFadeThroughPhotosDestination": "Foto", "demoSharedXAxisCoursePageSubtitle": "Kategori yang dihimpun dipaparkan sebagai kumpulan dalam suapan anda. Anda boleh menukar tetapan ini pada bila-bila masa kemudian.", "demoFadeThroughDescription": "Corak lenyap digunakan untuk peralihan antara unsur UI yang tidak mempunyai perhubungan yang kukuh antara satu sama lain.", "demoFadeThroughTitle": "Lenyap", "demoSharedZAxisHelpSettingLabel": "Bantuan", "demoMotionSubtitle": "Semua corak peralihan yang dipratentukan", "demoSharedZAxisNotificationSettingLabel": "Pemberitahuan", "demoSharedZAxisProfileSettingLabel": "Profil", "demoSharedZAxisSavedRecipesListTitle": "Resipi yang Disimpan", "demoSharedZAxisBeefSandwichRecipeDescription": "Resipi Sandwic Daging", "demoSharedZAxisCrabPlateRecipeDescription": "Resipi sepiring ketam", "demoSharedXAxisCoursePageTitle": "Selaraskan kursus anda", "demoSharedZAxisCrabPlateRecipeTitle": "Ketam", "demoSharedZAxisShrimpPlateRecipeDescription": "Resipi sepiring udang", "demoSharedZAxisShrimpPlateRecipeTitle": "Udang", "demoContainerTransformTypeFadeThrough": "LENYAP", "demoSharedZAxisDessertRecipeTitle": "Pencuci mulut", "demoSharedZAxisSandwichRecipeDescription": "Resipi sandwic", "demoSharedZAxisSandwichRecipeTitle": "Sandwic", "demoSharedZAxisBurgerRecipeDescription": "Resipi burger", "demoSharedZAxisBurgerRecipeTitle": "Burger", "demoSharedZAxisSettingsPageTitle": "Tetapan", "demoSharedZAxisTitle": "Paksi z dikongsi", "demoSharedZAxisPrivacySettingLabel": "Privasi", "demoMotionTitle": "Gerakan", "demoContainerTransformTitle": "Pengubahan Bekas", "demoContainerTransformDescription": "Corak pengubahan bekas direka bentuk untuk peralihan antara unsur UI yang merangkumi bekas. Corak ini mewujudkan hubungan yang boleh dilihat antara dua unsur UI", "demoContainerTransformModalBottomSheetTitle": "Mod lenyap", "demoContainerTransformTypeFade": "LENYAP", "demoSharedYAxisAlbumTileDurationUnit": "min", "demoMotionPlaceholderTitle": "Tajuk", "demoSharedXAxisForgotEmailButtonText": "TERLUPA E-MEL?", "demoMotionSmallPlaceholderSubtitle": "Sekunder", "demoMotionDetailsPageTitle": "Halaman Butiran", "demoMotionListTileTitle": "Item senarai", "demoSharedAxisDescription": "Corak paksi dikongsi digunakan untuk peralihan antara unsur UI yang mempunyai perhubungan ruang atau navigasi. Corak ini menggunakan pengubahan dikongsi pada paksi x, y atau z untuk mengukuhkan perhubungan antara unsur.", "demoSharedXAxisTitle": "Paksi x dikongsi", "demoSharedXAxisBackButtonText": "KEMBALI", "demoSharedXAxisNextButtonText": "SETERUSNYA", "demoSharedXAxisCulinaryCourseTitle": "Kulinari", "githubRepo": "{repoName} repositori GitHub", "fortnightlyMenuUS": "AS", "fortnightlyMenuBusiness": "Perniagaan", "fortnightlyMenuScience": "Sains", "fortnightlyMenuSports": "Sukan", "fortnightlyMenuTravel": "Pelancongan", "fortnightlyMenuCulture": "Budaya", "fortnightlyTrendingTechDesign": "TechDesign", "rallyBudgetDetailAmountLeft": "Jumlah Baki", "fortnightlyHeadlineArmy": "Reforming The Green Army From Within", "fortnightlyDescription": "Apl berita berfokuskan kandungan", "rallyBillDetailAmountDue": "Jumlah Perlu Dibayar", "rallyBudgetDetailTotalCap": "Jumlah Had", "rallyBudgetDetailAmountUsed": "Jumlah Digunakan", "fortnightlyTrendingHealthcareRevolution": "HealthcareRevolution", "fortnightlyMenuFrontPage": "Halaman Depan", "fortnightlyMenuWorld": "Dunia", "rallyBillDetailAmountPaid": "Jumlah Dibayar", "fortnightlyMenuPolitics": "Politik", "fortnightlyHeadlineBees": "Farmland Bees In Short Supply", "fortnightlyHeadlineGasoline": "The Future of Gasoline", "fortnightlyTrendingGreenArmy": "GreenArmy", "fortnightlyHeadlineFeminists": "Feminists Take On Partisanship", "fortnightlyHeadlineFabrics": "Designers Use Tech To Make Futuristic Fabrics", "fortnightlyHeadlineStocks": "As Stocks Stagnate, Many Look To Currency", "fortnightlyTrendingReform": "Reform", "fortnightlyMenuTech": "Teknologi", "fortnightlyHeadlineWar": "Divided American Lives During War", "fortnightlyHeadlineHealthcare": "The Quiet, Yet Powerful Healthcare Revolution", "fortnightlyLatestUpdates": "Kemas Kini Terkini", "fortnightlyTrendingStocks": "Stocks", "rallyBillDetailTotalAmount": "Jumlah Keseluruhan", "demoCupertinoPickerDateTime": "Tarikh dan Masa", "signIn": "LOG MASUK", "dataTableRowWithSugar": "{value} bergula", "dataTableRowApplePie": "Pai epal", "dataTableRowDonut": "Donut", "dataTableRowHoneycomb": "Honeycomb", "dataTableRowLollipop": "Lollipop", "dataTableRowJellyBean": "Jelly bean", "dataTableRowGingerbread": "Gingerbread", "dataTableRowCupcake": "Cupcake", "dataTableRowEclair": "Eclair", "dataTableRowIceCreamSandwich": "Ice cream sandwich", "dataTableRowFrozenYogurt": "Yogurt beku", "dataTableColumnIron": "Besi (%)", "dataTableColumnCalcium": "Kalsium (%)", "dataTableColumnSodium": "Sodium (mg)", "demoTimePickerTitle": "Pemilih Masa", "demo2dTransformationsResetTooltip": "Tetapkan semula transformasi", "dataTableColumnFat": "Lemak (g)", "dataTableColumnCalories": "Kalori", "dataTableColumnDessert": "Pencuci mulut (1 sajian)", "cardsDemoTravelDestinationLocation1": "Thanjavur, Tamil Nadu", "demoTimePickerDescription": "Menunjukkan dialog yang mengandungi pemilih masa Reka Bentuk Bahan.", "demoPickersShowPicker": "TUNJUKKAN PEMILIH", "demoTabsScrollingTitle": "Menatal", "demoTabsNonScrollingTitle": "Bukan menatal", "craneHours": "{hours,plural,=1{1j}other{{hours}j}}", "craneMinutes": "{minutes,plural,=1{1m}other{{minutes}m}}", "craneFlightDuration": "{hoursShortForm} {minutesShortForm}", "dataTableHeader": "Pemakanan", "demoDatePickerTitle": "Pemilih Tarikh", "demoPickersSubtitle": "Pilihan tarikh dan masa", "demoPickersTitle": "Pemilih", "demo2dTransformationsEditTooltip": "Edit jubin", "demoDataTableDescription": "Jadual data memaparkan maklumat dalam format seperti grid yang mengandungi baris dan lajur. Jadual ini menyusun maklumat dengan cara yang mudah untuk diimbas, supaya pengguna dapat mencari corak dan cerapan.", "demo2dTransformationsDescription": "Ketik untuk mengedit jubin dan gunakan gerak isyarat untuk bergerak di sekitar latar. Seret untuk menyorot, cubit untuk mengezum, putar menggunakan dua jari. Tekan butang tetapkan semula untuk kembali ke orientasi permulaan.", "demo2dTransformationsSubtitle": "Sorot, zum, putar", "demo2dTransformationsTitle": "Transformasi 2D", "demoCupertinoTextFieldPIN": "PIN", "demoCupertinoTextFieldDescription": "Medan teks membolehkan pengguna memasukkan teks menggunakan papan kekunci perkakasan atau papan kekunci pada skrin.", "demoCupertinoTextFieldSubtitle": "Medan teks gaya iOS", "demoCupertinoTextFieldTitle": "Medan teks", "demoDatePickerDescription": "Menunjukkan dialog yang mengandungi pemilih tarikh Reka Bentuk Bahan.", "demoCupertinoPickerTime": "Masa", "demoCupertinoPickerDate": "Tarikh", "demoCupertinoPickerTimer": "Pemasa", "demoCupertinoPickerDescription": "Widget pemilih gaya iOS yang boleh digunakan untuk memilih rentetan, tarikh, masa atau kedua-dua tarikh dan masa.", "demoCupertinoPickerSubtitle": "Pemilih gaya iOS", "demoCupertinoPickerTitle": "Pemilih", "dataTableRowWithHoney": "{value} bermadu", "cardsDemoTravelDestinationCity2": "Chettinad", "bannerDemoResetText": "Tetapkan semula sepanduk", "bannerDemoMultipleText": "Pelbagai tindakan", "bannerDemoLeadingText": "Ikon Mendahulu", "dismiss": "KETEPIKAN", "cardsDemoTappable": "Boleh ketik", "cardsDemoSelectable": "Boleh pilih (tekan lama)", "cardsDemoExplore": "Teroka", "cardsDemoExploreSemantics": "Teroka {destinationName}", "cardsDemoShareSemantics": "Kongsi {destinationName}", "cardsDemoTravelDestinationTitle1": "10 Bandar Paling Popular untuk Dilawati di Tamil Nadu", "cardsDemoTravelDestinationDescription1": "Nombor 10", "cardsDemoTravelDestinationCity1": "Thanjavur", "dataTableColumnProtein": "Protein (g)", "cardsDemoTravelDestinationTitle2": "Tenaga Mahir dari India Selatan", "cardsDemoTravelDestinationDescription2": "Pemintal Sutera", "bannerDemoText": "Kata laluan anda telah dikemas kini pada peranti anda yang lain. Sila log masuk sekali lagi.", "cardsDemoTravelDestinationLocation2": "Sivaganga, Tamil Nadu", "cardsDemoTravelDestinationTitle3": "Kuil Brihadisvara", "cardsDemoTravelDestinationDescription3": "Kuil", "demoBannerTitle": "Sepanduk", "demoBannerSubtitle": "Memaparkan sepanduk dalam senarai", "demoBannerDescription": "Sepanduk memaparkan mesej yang penting, ringkas dan menyediakan tindakan untuk ditangani pengguna (atau mengetepikan sepanduk). Tindakan pengguna diperlukan untuk mengetepikan sepanduk.", "demoCardTitle": "Kad", "demoCardSubtitle": "Kad garis dasar dengan penjuru bulat", "demoCardDescription": "Kad merupakan helaian Bahan yang digunakan untuk mewakili beberapa maklumat berkaitan, contohnya album, lokasi geografi, hidangan, butiran hubungan dan lain-lain.", "demoDataTableTitle": "Jadual Data", "demoDataTableSubtitle": "Baris dan lajur maklumat", "dataTableColumnCarbs": "Karbohidrat (g)", "placeTanjore": "Tanjore", "demoGridListsTitle": "Senarai Grid", "placeFlowerMarket": "Flower Market", "placeBronzeWorks": "Bronze Works", "placeMarket": "Market", "placeThanjavurTemple": "Thanjavur Temple", "placeSaltFarm": "Salt Farm", "placeScooters": "Skuter", "placeSilkMaker": "Pembuat Sutera", "placeLunchPrep": "Penyediaan Makan Tengahari", "placeBeach": "Pantai", "placeFisherman": "Nelayan", "demoMenuSelected": "Dipilih: {value}", "demoMenuRemove": "Alih keluar", "demoMenuGetLink": "Dapatkan pautan", "demoMenuShare": "Kongsi", "demoBottomAppBarSubtitle": "Memaparkan navigasi dan tindakan di bahagian bawah", "demoMenuAnItemWithASectionedMenu": "Item dengan menu berbahagian", "demoMenuADisabledMenuItem": "Item menu dilumpuhkan", "demoLinearProgressIndicatorTitle": "Penunjuk Kemajuan Linear", "demoMenuContextMenuItemOne": "Item menu konteks pertama", "demoMenuAnItemWithASimpleMenu": "Item dengan menu ringkas", "demoCustomSlidersTitle": "Peluncur Tersuai", "demoMenuAnItemWithAChecklistMenu": "Item dengan menu senarai semak", "demoCupertinoActivityIndicatorTitle": "Penunjuk aktiviti", "demoCupertinoActivityIndicatorSubtitle": "Penunjuk aktiviti gaya iOS", "demoCupertinoActivityIndicatorDescription": "Penunjuk aktiviti gaya iOS yang berputar mengikut arah jam.", "demoCupertinoNavigationBarTitle": "Bar navigasi", "demoCupertinoNavigationBarSubtitle": "Bar navigasi gaya iOS", "demoCupertinoNavigationBarDescription": "Bar navigasi bergaya iOS Bar navigasi ialah bar alat yang secara minimumnya mengandungi tajuk halaman di tengah-tengah bar alat.", "demoCupertinoPullToRefreshTitle": "Tarik untuk memuat semula", "demoCupertinoPullToRefreshSubtitle": "Kawalan tarik untuk muat semula gaya iOS", "demoCupertinoPullToRefreshDescription": "Widget yang melaksanakan kawalan kandungan tarik untuk muat semula gaya iOS.", "demoProgressIndicatorTitle": "Penunjuk kemajuan", "demoProgressIndicatorSubtitle": "Linear, bulat, tidak tentu", "demoCircularProgressIndicatorTitle": "Penunjuk Kemajuan Bulat", "demoCircularProgressIndicatorDescription": "Penunjuk kemajuan bulat bagi Reka Bentuk Bahan, yang berputar untuk menunjukkan bahawa aplikasi sedang sibuk.", "demoMenuFour": "Empat", "demoLinearProgressIndicatorDescription": "Penunjuk kemajuan linear Reka Bentuk Bahan, juga dikenali sebagai bar kemajuan.", "demoTooltipTitle": "Tip alat", "demoTooltipSubtitle": "Mesej ringkas dipaparkan apabila tekan lama atau tuding", "demoTooltipDescription": "Tip alat menyediakan label teks yang membantu menjelaskan fungsi butang atau tindakan antara muka pengguna yang lain. Tip alat memaparkan teks bermaklumat apabila pengguna menuding, menumpukan atau tekan lama pada satu unsur.", "demoTooltipInstructions": "Tekan lama atau tuding untuk memaparkan tip alat.", "placeChennai": "Chennai", "demoMenuChecked": "Ditandai: {value}", "placeChettinad": "Chettinad", "demoMenuPreview": "Pratonton", "demoBottomAppBarTitle": "Bar apl sebelah bawah", "demoBottomAppBarDescription": "Bar apl sebelah bawah menyediakan akses kepada laci navigasi bawah dan sehingga empat tindakan, termasuk butang tindakan terapung.", "bottomAppBarNotch": "Takuk", "bottomAppBarPosition": "Kedudukan Butang Tindakan Terapung", "bottomAppBarPositionDockedEnd": "Dok - Hujung", "bottomAppBarPositionDockedCenter": "Dok - Tengah", "bottomAppBarPositionFloatingEnd": "Terapung - Hujung", "bottomAppBarPositionFloatingCenter": "Terapung - Tengah", "demoSlidersEditableNumericalValue": "Nilai berangka boleh edit", "demoGridListsSubtitle": "Reka letak baris dan lajur", "demoGridListsDescription": "Senarai Grid adalah paling sesuai untuk pembentangan data homogen, biasanya imej. Setiap item dalam senarai grid dipanggil jubin.", "demoGridListsImageOnlyTitle": "Imej sahaja", "demoGridListsHeaderTitle": "Dengan pengepala", "demoGridListsFooterTitle": "Dengan pengaki", "demoSlidersTitle": "Peluncur", "demoSlidersSubtitle": "Widget untuk memilih nilai dengan meleret", "demoSlidersDescription": "Peluncur menggambarkan satu julat nilai di sepanjang bar dan pengguna boleh memilih satu daripada nilai itu. Peluncur ini sesuai untuk melaraskan tetapan seperti kelantangan, kecerahan atau penggunaan penapis imej.", "demoRangeSlidersTitle": "Peluncur Julat", "demoRangeSlidersDescription": "Peluncur menggambarkan satu julat nilai di sepanjang bar. Peluncur boleh mempunyai ikon di kedua-dua hujung bar yang menggambarkan satu julat nilai. Peluncur ini sesuai untuk melaraskan tetapan seperti kelantangan, kecerahan atau penggunaan penapis imej.", "demoMenuAnItemWithAContextMenuButton": "Item dengan menu konteks", "demoCustomSlidersDescription": "Peluncur menggambarkan satu julat nilai di sepanjang bar dan pengguna boleh memilih satu atau beberapa nilai itu. Peluncur boleh bertema atau disesuaikan.", "demoSlidersContinuousWithEditableNumericalValue": "Berterusan dengan Nilai Berangka Boleh Edit", "demoSlidersDiscrete": "Diskret", "demoSlidersDiscreteSliderWithCustomTheme": "Peluncur Diskret dengan Tema Tersuai", "demoSlidersContinuousRangeSliderWithCustomTheme": "Peluncur Julat Berterusan dengan Tema Tersuai", "demoSlidersContinuous": "Berterusan", "placePondicherry": "Pondicherry", "demoMenuTitle": "Menu", "demoContextMenuTitle": "Menu konteks", "demoSectionedMenuTitle": "Menu berbahagian", "demoSimpleMenuTitle": "Menu ringkas", "demoChecklistMenuTitle": "Menu senarai semak", "demoMenuSubtitle": "Butang menu dan menu ringkas", "demoMenuDescription": "Menu memaparkan senarai pilihan pada permukaan sementara. Menu ini muncul apabila pengguna berinteraksi dengan butang, tindakan atau kawalan lain.", "demoMenuItemValueOne": "Item menu pertama", "demoMenuItemValueTwo": "Item menu kedua", "demoMenuItemValueThree": "Item menu ketiga", "demoMenuOne": "Satu", "demoMenuTwo": "Dua", "demoMenuThree": "Tiga", "demoMenuContextMenuItemThree": "Item menu konteks ketiga", "demoCupertinoSwitchSubtitle": "Suis gaya iOS", "demoSnackbarsText": "Ini ialah Bar Snek.", "demoCupertinoSliderSubtitle": "Peluncur gaya iOS", "demoCupertinoSliderDescription": "Peluncur boleh digunakan untuk memilih daripada set nilai berterusan atau diskret.", "demoCupertinoSliderContinuous": "Berterusan: {value}", "demoCupertinoSliderDiscrete": "Diskret: {value}", "demoSnackbarsAction": "Anda menekan tindakan bar snek.", "backToGallery": "Kembali ke Gallery", "demoCupertinoTabBarTitle": "Bar tab", "demoCupertinoSwitchDescription": "Suis digunakan untuk menogol keadaan hidup/mati tetapan tunggal.", "demoSnackbarsActionButtonLabel": "TINDAKAN", "cupertinoTabBarProfileTab": "Profil", "demoSnackbarsButtonLabel": "TUNJUKKAN BAR SNEK", "demoSnackbarsDescription": "Bar snek memberitahu pengguna tentang proses yang telah dilakukan atau yang akan dilakukan oleh apl. Bar snek ini dipaparkan di bahagian bawah skrin secara sementara. Bar snek tidak seharusnya mengganggu pengalaman pengguna dan tidak memerlukan input pengguna untuk hilang.", "demoSnackbarsSubtitle": "Bar snek menunjukkan mesej di bahagian bawah skrin", "demoSnackbarsTitle": "Bar snek", "demoCupertinoSliderTitle": "Peluncur", "cupertinoTabBarChatTab": "Chat", "cupertinoTabBarHomeTab": "Laman Utama", "demoCupertinoTabBarDescription": "Bar tab navigasi bawah gaya iOS. Memaparkan berbilang tab dengan satu tab sedang aktif, tab pertama secara lalai.", "demoCupertinoTabBarSubtitle": "Bar tab bawah gaya iOS", "demoOptionsFeatureTitle": "Lihat pilihan", "demoOptionsFeatureDescription": "Ketik di sini untuk melihat pilihan yang tersedia untuk tunjuk cara ini.", "demoCodeViewerCopyAll": "SALIN SEMUA", "shrineScreenReaderRemoveProductButton": "Alih keluar {product}", "shrineScreenReaderProductAddToCart": "Tambahkan ke troli", "shrineScreenReaderCart": "{quantity,plural,=0{Troli Beli-belah, tiada item}=1{Troli Beli-belah, 1 item}other{Troli Beli-belah, {quantity} item}}", "demoCodeViewerFailedToCopyToClipboardMessage": "Gagal menyalin ke papan keratan: {error}", "demoCodeViewerCopiedToClipboardMessage": "Disalin ke papan keratan.", "craneSleep8SemanticLabel": "Runtuhan maya pada cenuram di atas pantai", "craneSleep4SemanticLabel": "Hotel tepi tasik berhadapan gunung", "craneSleep2SemanticLabel": "Kubu kota Machu Picchu", "craneSleep1SemanticLabel": "Chalet dalam lanskap bersalji dengan pokok malar hijau", "craneSleep0SemanticLabel": "Banglo terapung", "craneFly13SemanticLabel": "Kolam renang tepi laut dengan pokok palma", "craneFly12SemanticLabel": "Kolam renang dengan pokok palma", "craneFly11SemanticLabel": "Rumah api bata di laut", "craneFly10SemanticLabel": "Menara Masjid Al-Azhar semasa matahari terbenam", "craneFly9SemanticLabel": "Lelaki bersandar pada kereta biru antik", "craneFly8SemanticLabel": "Supertree Grove", "craneEat9SemanticLabel": "Kaunter kafe dengan pastri", "craneEat2SemanticLabel": "Burger", "craneFly5SemanticLabel": "Hotel tepi tasik berhadapan gunung", "demoSelectionControlsSubtitle": "Kotak pilihan, butang radio dan suis", "craneEat10SemanticLabel": "Wanita memegang sandwic pastrami yang sangat besar", "craneFly4SemanticLabel": "Banglo terapung", "craneEat7SemanticLabel": "Pintu masuk bakeri", "craneEat6SemanticLabel": "Masakan udang", "craneEat5SemanticLabel": "Kawasan tempat duduk restoran Artsy", "craneEat4SemanticLabel": "Pencuci mulut coklat", "craneEat3SemanticLabel": "Taco Korea", "craneFly3SemanticLabel": "Kubu kota Machu Picchu", "craneEat1SemanticLabel": "Bar kosong dengan bangku gaya makan malam", "craneEat0SemanticLabel": "Pizza dalam ketuhar menggunakan kayu", "craneSleep11SemanticLabel": "Pencakar langit Taipei 101", "craneSleep10SemanticLabel": "Menara Masjid Al-Azhar semasa matahari terbenam", "craneSleep9SemanticLabel": "Rumah api bata di laut", "craneEat8SemanticLabel": "Sepinggan udang krai", "craneSleep7SemanticLabel": "Pangsapuri berwarna-warni di Ribeira Square", "craneSleep6SemanticLabel": "Kolam renang dengan pokok palma", "craneSleep5SemanticLabel": "Khemah di padang", "settingsButtonCloseLabel": "Tutup tetapan", "demoSelectionControlsCheckboxDescription": "Kotak pilihan membenarkan pengguna memilih beberapa pilihan daripada satu set. Nilai kotak pilihan biasa adalah benar atau salah dan nilai kotak pilihan tiga keadaan juga boleh menjadi sifar.", "settingsButtonLabel": "Tetapan", "demoListsTitle": "Senarai", "demoListsSubtitle": "Reka letak senarai penatalan", "demoListsDescription": "Baris tunggal ketinggian tetap yang biasanya mengandungi beberapa teks serta ikon mendulu atau mengekor.", "demoOneLineListsTitle": "Satu Baris", "demoTwoLineListsTitle": "Dua Baris", "demoListsSecondary": "Teks peringkat kedua", "demoSelectionControlsTitle": "Kawalan pilihan", "craneFly7SemanticLabel": "Gunung Rushmore", "demoSelectionControlsCheckboxTitle": "Kotak pilihan", "craneSleep3SemanticLabel": "Lelaki bersandar pada kereta biru antik", "demoSelectionControlsRadioTitle": "Radio", "demoSelectionControlsRadioDescription": "Butang radio membenarkan pengguna memilih satu pilihan daripada satu set. Gunakan butang radio untuk pemilihan eksklusif jika anda berpendapat bahawa pengguna perlu melihat semua pilihan yang tersedia secara bersebelahan.", "demoSelectionControlsSwitchTitle": "Tukar", "demoSelectionControlsSwitchDescription": "Suis hidup/mati menogol keadaan pilihan tetapan tunggal. Pilihan yang dikawal oleh suis, serta keadaan pilihan itu, hendaklah jelas daripada label sebaris yang sepadan.", "craneFly0SemanticLabel": "Chalet dalam lanskap bersalji dengan pokok malar hijau", "craneFly1SemanticLabel": "Khemah di padang", "craneFly2SemanticLabel": "Bendera doa di hadapan gunung bersalji", "craneFly6SemanticLabel": "Pemandangan udara Palacio de Bellas Artes", "rallySeeAllAccounts": "Lihat semua akaun", "rallyBillAmount": "Bil {billName} perlu dijelaskan pada {date} sebanyak {amount}.", "shrineTooltipCloseCart": "Tutup troli", "shrineTooltipCloseMenu": "Tutup menu", "shrineTooltipOpenMenu": "Buka menu", "shrineTooltipSettings": "Tetapan", "shrineTooltipSearch": "Cari", "demoTabsDescription": "Tab menyusun kandungan untuk semua skrin, set data dan interaksi lain yang berbeza-beza.", "demoTabsSubtitle": "Tab dengan paparan boleh ditatal secara bebas", "demoTabsTitle": "Tab", "rallyBudgetAmount": "Belanjawan {budgetName} dengan {amountUsed} digunakan daripada {amountTotal}, baki {amountLeft}", "shrineTooltipRemoveItem": "Alih keluar item", "rallyAccountAmount": "Akaun {accountName} bagi {accountNumber} sebanyak {amount}.", "rallySeeAllBudgets": "Lihat semua belanjawan", "rallySeeAllBills": "Lihat semua bil", "craneFormDate": "Pilih Tarikh", "craneFormOrigin": "Pilih Tempat Berlepas", "craneFly2": "Khumbu Valley, Nepal", "craneFly3": "Machu Picchu, Peru", "craneFly4": "Malé, Maldives", "craneFly5": "Vitznau, Switzerland", "craneFly6": "Mexico City, Mexico", "craneFly7": "Mount Rushmore, Amerika Syarikat", "settingsTextDirectionLocaleBased": "Berdasarkan tempat peristiwa", "craneFly9": "Havana, Cuba", "craneFly10": "Kaherah, Mesir", "craneFly11": "Lisbon, Portugal", "craneFly12": "Napa, Amerika Syarikat", "craneFly13": "Bali, Indonesia", "craneSleep0": "Malé, Maldives", "craneSleep1": "Aspen, Amerika Syarikat", "craneSleep2": "Machu Picchu, Peru", "demoCupertinoSegmentedControlTitle": "Kawalan disegmenkan", "craneSleep4": "Vitznau, Switzerland", "craneSleep5": "Big Sur, Amerika Syarikat", "craneSleep6": "Napa, Amerika Syarikat", "craneSleep7": "Porto, Portugal", "craneSleep8": "Tulum, Mexico", "craneEat5": "Seoul, Korea Selatan", "demoChipTitle": "Cip", "demoChipSubtitle": "Unsur sarat yang mewakili input, atribut atau tindakan", "demoActionChipTitle": "Cip Tindakan", "demoActionChipDescription": "Cip tindakan ialah satu set pilihan yang mencetuskan tindakan yang berkaitan dengan kandungan utama. Cip tindakan seharusnya dipaparkan secara dinamik dan kontekstual dalam UI.", "demoChoiceChipTitle": "Cip Pilihan", "demoChoiceChipDescription": "Cip pilihan mewakili satu pilihan daripada satu set. Cip pilihan mengandungi teks atau kategori deskriptif yang berkaitan.", "demoFilterChipTitle": "Cip Penapis", "demoFilterChipDescription": "Cip penapis menggunakan teg atau perkataan deskriptif sebagai cara untuk menapis kandungan.", "demoInputChipTitle": "Cip Input", "demoInputChipDescription": "Cip input mewakili bahagian maklumat yang kompleks, seperti entiti (orang, tempat atau benda) atau teks perbualan dalam bentuk padat.", "craneSleep9": "Lisbon, Portugal", "craneEat10": "Lisbon, Portugal", "demoCupertinoSegmentedControlDescription": "Digunakan untuk memilih antara beberapa pilihan eksklusif bersama. Apabila satu pilihan dalam kawalan yang disegmenkan dipilih, pilihan lain dalam kawalan disegmenkan itu dihentikan sebagai pilihan.", "chipTurnOnLights": "Hidupkan lampu", "chipSmall": "Kecil", "chipMedium": "Sederhana", "chipLarge": "Besar", "chipElevator": "Lif", "chipWasher": "Mesin basuh", "chipFireplace": "Pendiang", "chipBiking": "Berbasikal", "craneFormDiners": "Kedai makan", "rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{Tingkatkan potongan cukai berpotensi anda! Tetapkan kategori kepada 1 transaksi yang tidak ditentukan.}other{Tingkatkan potongan cukai berpotensi anda! Tetapkan kategori kepada {count} transaksi yang tidak ditentukan.}}", "craneFormTime": "Pilih Masa", "craneFormLocation": "Pilih Lokasi", "craneFormTravelers": "Pengembara", "craneEat8": "Atlanta, Amerika Syarikat", "craneFormDestination": "Pilih Destinasi", "craneFormDates": "Pilih Tarikh", "craneFly": "TERBANG", "craneSleep": "TIDUR", "craneEat": "MAKAN", "craneFlySubhead": "Terokai Penerbangan mengikut Destinasi", "craneSleepSubhead": "Terokai Hartanah mengikut Destinasi", "craneEatSubhead": "Terokai Restoran mengikut Destinasi", "craneFlyStops": "{numberOfStops,plural,=0{Penerbangan terus}=1{1 persinggahan}other{{numberOfStops} persinggahan}}", "craneSleepProperties": "{totalProperties,plural,=0{Tiada Hartanah Tersedia}=1{1 Hartanah Tersedia}other{{totalProperties} Hartanah Tersedia}}", "craneEatRestaurants": "{totalRestaurants,plural,=0{Tiada Restoran}=1{1 Restoran}other{{totalRestaurants} Restoran}}", "craneFly0": "Aspen, Amerika Syarikat", "demoCupertinoSegmentedControlSubtitle": "Kawalan disegmenkan gaya iOS", "craneSleep10": "Kaherah, Mesir", "craneEat9": "Madrid, Sepanyol", "craneFly1": "Big Sur, Amerika Syarikat", "craneEat7": "Nashville, Amerika Syarikat", "craneEat6": "Seattle, Amerika Syarikat", "craneFly8": "Singapura", "craneEat4": "Paris, Perancis", "craneEat3": "Portland, Amerika Syarikat", "craneEat2": "Córdoba, Argentina", "craneEat1": "Dallas, Amerika Syarikat", "craneEat0": "Naples, Itali", "craneSleep11": "Taipei, Taiwan", "craneSleep3": "Havana, Cuba", "shrineLogoutButtonCaption": "LOG KELUAR", "rallyTitleBills": "BIL", "rallyTitleAccounts": "AKAUN", "shrineProductVagabondSack": "Vagabond sack", "rallyAccountDetailDataInterestYtd": "Faedah YTD", "shrineProductWhitneyBelt": "Whitney belt", "shrineProductGardenStrand": "Garden strand", "shrineProductStrutEarrings": "Strut earrings", "shrineProductVarsitySocks": "Varsity socks", "shrineProductWeaveKeyring": "Weave keyring", "shrineProductGatsbyHat": "Gatsby hat", "shrineProductShrugBag": "Shrug bag", "shrineProductGiltDeskTrio": "Gilt desk trio", "shrineProductCopperWireRack": "Copper wire rack", "shrineProductSootheCeramicSet": "Soothe ceramic set", "shrineProductHurrahsTeaSet": "Hurrahs tea set", "shrineProductBlueStoneMug": "Blue stone mug", "shrineProductRainwaterTray": "Rainwater tray", "shrineProductChambrayNapkins": "Chambray napkins", "shrineProductSucculentPlanters": "Succulent planters", "shrineProductQuartetTable": "Quartet table", "shrineProductKitchenQuattro": "Kitchen quattro", "shrineProductClaySweater": "Clay sweater", "shrineProductSeaTunic": "Sea tunic", "shrineProductPlasterTunic": "Plaster tunic", "rallyBudgetCategoryRestaurants": "Restoran", "shrineProductChambrayShirt": "Chambray shirt", "shrineProductSeabreezeSweater": "Seabreeze sweater", "shrineProductGentryJacket": "Gentry jacket", "shrineProductNavyTrousers": "Navy trousers", "shrineProductWalterHenleyWhite": "Walter henley (white)", "shrineProductSurfAndPerfShirt": "Surf and perf shirt", "shrineProductGingerScarf": "Ginger scarf", "shrineProductRamonaCrossover": "Ramona crossover", "shrineProductClassicWhiteCollar": "Classic white collar", "shrineProductSunshirtDress": "Sunshirt dress", "rallyAccountDetailDataInterestRate": "Kadar Faedah", "rallyAccountDetailDataAnnualPercentageYield": "Peratus Hasil Tahunan", "rallyAccountDataVacation": "Percutian", "shrineProductFineLinesTee": "Fine lines tee", "rallyAccountDataHomeSavings": "Simpanan Perumahan", "rallyAccountDataChecking": "Semasa", "rallyAccountDetailDataInterestPaidLastYear": "Faedah Dibayar Pada Tahun Lalu", "rallyAccountDetailDataNextStatement": "Penyata seterusnya", "rallyAccountDetailDataAccountOwner": "Pemilik Akaun", "rallyBudgetCategoryCoffeeShops": "Kedai Kopi", "rallyBudgetCategoryGroceries": "Barangan runcit", "shrineProductCeriseScallopTee": "Cerise scallop tee", "rallyBudgetCategoryClothing": "Pakaian", "rallySettingsManageAccounts": "Urus Akaun", "rallyAccountDataCarSavings": "Simpanan Kereta", "rallySettingsTaxDocuments": "Dokumen Cukai", "rallySettingsPasscodeAndTouchId": "Kod laluan dan Touch ID", "rallySettingsNotifications": "Pemberitahuan", "rallySettingsPersonalInformation": "Maklumat Peribadi", "rallySettingsPaperlessSettings": "Tetapan Tanpa Kertas", "rallySettingsFindAtms": "Cari ATM", "rallySettingsHelp": "Bantuan", "rallySettingsSignOut": "Log keluar", "rallyAccountTotal": "Jumlah", "rallyBillsDue": "Tarikh Akhir", "rallyBudgetLeft": "Kiri", "rallyAccounts": "Akaun", "rallyBills": "Bil", "rallyBudgets": "Belanjawan", "rallyAlerts": "Makluman", "rallySeeAll": "LIHAT SEMUA", "rallyFinanceLeft": "KIRI", "rallyTitleOverview": "IKHTISAR", "shrineProductShoulderRollsTee": "Shoulder rolls tee", "shrineNextButtonCaption": "SETERUSNYA", "rallyTitleBudgets": "BELANJAWAN", "rallyTitleSettings": "TETAPAN", "rallyLoginLoginToRally": "Log masuk ke Rally", "rallyLoginNoAccount": "Tiada akaun?", "rallyLoginSignUp": "DAFTAR", "rallyLoginUsername": "Nama Pengguna", "rallyLoginPassword": "Kata laluan", "rallyLoginLabelLogin": "Log masuk", "rallyLoginRememberMe": "Ingat saya", "rallyLoginButtonLogin": "LOG MASUK", "rallyAlertsMessageHeadsUpShopping": "Makluman, anda telah menggunakan {percent} daripada belanjawan Beli-belah anda untuk bulan ini.", "rallyAlertsMessageSpentOnRestaurants": "Anda sudah membelanjakan {amount} pada Restoran minggu ini.", "rallyAlertsMessageATMFees": "Anda sudah membelanjakan {amount} untuk yuran ATM pada bulan ini", "rallyAlertsMessageCheckingAccount": "Syabas! Akaun semasa anda adalah {percent} lebih tinggi daripada bulan lalu.", "shrineMenuCaption": "MENU", "shrineCategoryNameAll": "SEMUA", "shrineCategoryNameAccessories": "AKSESORI", "shrineCategoryNameClothing": "PAKAIAN", "shrineCategoryNameHome": "RUMAH", "shrineLoginUsernameLabel": "Nama Pengguna", "shrineLoginPasswordLabel": "Kata laluan", "shrineCancelButtonCaption": "BATAL", "shrineCartTaxCaption": "Cukai:", "shrineCartPageCaption": "TROLI", "shrineProductQuantity": "Kuantiti: {quantity}", "shrineProductPrice": "x {price}", "shrineCartItemCount": "{quantity,plural,=0{TIADA ITEM}=1{1 ITEM}other{{quantity} ITEM}}", "shrineCartClearButtonCaption": "KOSONGKAN TROLI", "shrineCartTotalCaption": "JUMLAH", "shrineCartSubtotalCaption": "Subjumlah:", "shrineCartShippingCaption": "Penghantaran:", "shrineProductGreySlouchTank": "Grey slouch tank", "shrineProductStellaSunglasses": "Stella sunglasses", "shrineProductWhitePinstripeShirt": "White pinstripe shirt", "demoTextFieldWhereCanWeReachYou": "Bagaimanakah cara menghubungi anda?", "settingsTextDirectionLTR": "LTR", "settingsTextScalingLarge": "Besar", "demoBottomSheetHeader": "Pengepala", "demoBottomSheetItem": "Item {value}", "demoBottomTextFieldsTitle": "Medan teks", "demoTextFieldTitle": "Medan teks", "demoTextFieldSubtitle": "Teks dan nombor boleh edit bagi garisan tunggal", "demoTextFieldDescription": "Medan teks membolehkan pengguna memasukkan teks ke dalam UI. Medan teks ini biasanya dipaparkan dalam borang dan dialog.", "demoTextFieldShowPasswordLabel": "Tunjukkan kata laluan", "demoTextFieldHidePasswordLabel": "Sembunyikan kata laluan", "demoTextFieldFormErrors": "Sila betulkan ralat yang berwarna merah sebelum serahan.", "demoTextFieldNameRequired": "Nama diperlukan.", "demoTextFieldOnlyAlphabeticalChars": "Sila masukkan aksara mengikut abjad sahaja.", "demoTextFieldEnterUSPhoneNumber": "(###) ###-#### - Masukkan nombor telefon AS.", "demoTextFieldEnterPassword": "Sila masukkan kata laluan.", "demoTextFieldPasswordsDoNotMatch": "Kata laluan tidak sepadan", "demoTextFieldWhatDoPeopleCallYou": "Apakah nama panggilan anda?", "demoTextFieldNameField": "Nama*", "demoBottomSheetButtonText": "TUNJUKKAN HELAIAN BAWAH", "demoTextFieldPhoneNumber": "Nombor telefon*", "demoBottomSheetTitle": "Helaian bawah", "demoTextFieldEmail": "E-mel", "demoTextFieldTellUsAboutYourself": "Beritahu kami tentang diri anda. (misalnya, tulis perkara yang anda lakukan atau hobi anda)", "demoTextFieldKeepItShort": "Ringkaskan, teks ini hanya demo.", "starterAppGenericButton": "BUTANG", "demoTextFieldLifeStory": "Kisah hidup", "demoTextFieldSalary": "Gaji", "demoTextFieldUSD": "USD", "demoTextFieldNoMoreThan": "Tidak melebihi 8 aksara.", "demoTextFieldPassword": "Kata laluan*", "demoTextFieldRetypePassword": "Taip semula kata laluan*", "demoTextFieldSubmit": "SERAH", "demoBottomNavigationSubtitle": "Navigasi bawah dengan paparan memudar silang", "demoBottomSheetAddLabel": "Tambah", "demoBottomSheetModalDescription": "Helaian bawah mod adalah sebagai alternatif kepada menu atau dialog dan menghalang pengguna daripada berinteraksi dengan apl yang lain.", "demoBottomSheetModalTitle": "Helaian bawah mod", "demoBottomSheetPersistentDescription": "Helaian bawah berterusan menunjukkan maklumat yang menambah kandungan utama apl. Helaian bawah berterusan tetap kelihatan walaupun semasa pengguna berinteraksi dengan bahagian lain apl.", "demoBottomSheetPersistentTitle": "Helaian bawah berterusan", "demoBottomSheetSubtitle": "Helaian bawah mod dan berterusan", "demoTextFieldNameHasPhoneNumber": "Nombor telefon {name} ialah {phoneNumber}", "buttonText": "BUTANG", "demoTypographyDescription": "Definisi bagi pelbagai gaya tipografi yang ditemui dalam Reka Bentuk Bahan.", "demoTypographySubtitle": "Semua gaya teks yang dipratentukan", "demoTypographyTitle": "Tipografi", "demoFullscreenDialogDescription": "Sifat Dialogskrinpenuh menentukan sama ada halaman masuk ialah dialog mod skrin penuh", "demoFlatButtonDescription": "Butang rata memaparkan percikan dakwat apabila ditekan namun tidak timbul. Gunakan butang rata pada bar alat, dalam dialog dan sebaris dengan pelapik", "demoBottomNavigationDescription": "Bar navigasi bawah menunjukkan tiga hingga lima destinasi di bahagian bawah skrin. Setiap destinasi diwakili oleh ikon dan label teks pilihan. Apabila ikon navigasi bawah diketik, pengguna dibawa ke destinasi navigasi tahap tinggi yang dikaitkan dengan ikon tersebut.", "demoBottomNavigationSelectedLabel": "Label yang dipilih", "demoBottomNavigationPersistentLabels": "Label berterusan", "starterAppDrawerItem": "Item {value}", "demoTextFieldRequiredField": "* menandakan medan yang diperlukan", "demoBottomNavigationTitle": "Navigasi bawah", "settingsLightTheme": "Cerah", "settingsTheme": "Tema", "settingsPlatformIOS": "iOS", "settingsPlatformAndroid": "Android", "settingsTextDirectionRTL": "RTL", "settingsTextScalingHuge": "Sangat Besar", "cupertinoButton": "Butang", "settingsTextScalingNormal": "Biasa", "settingsTextScalingSmall": "Kecil", "settingsSystemDefault": "Sistem", "settingsTitle": "Tetapan", "rallyDescription": "Apl kewangan peribadi", "aboutDialogDescription": "Untuk melihat kod sumber apl ini, sila lawati {repoLink}.", "bottomNavigationCommentsTab": "Ulasan", "starterAppGenericBody": "Kandungan", "starterAppGenericHeadline": "Tajuk", "starterAppGenericSubtitle": "Tajuk kecil", "starterAppGenericTitle": "Tajuk", "starterAppTooltipSearch": "Carian", "starterAppTooltipShare": "Kongsi", "starterAppTooltipFavorite": "Kegemaran", "starterAppTooltipAdd": "Tambah", "bottomNavigationCalendarTab": "Kalendar", "starterAppDescription": "Reka letak permulaan yang responsif", "starterAppTitle": "Apl permulaan", "aboutFlutterSamplesRepo": "Repositori GitHub sampel Flutter", "bottomNavigationContentPlaceholder": "Pemegang tempat untuk tab {title}", "bottomNavigationCameraTab": "Kamera", "bottomNavigationAlarmTab": "Penggera", "bottomNavigationAccountTab": "Akaun", "demoTextFieldYourEmailAddress": "Alamat e-mel anda", "demoToggleButtonDescription": "Butang togol boleh digunakan untuk mengumpulkan pilihan yang berkaitan. Untuk menekankan kumpulan butang togol yang berkaitan, kumpulan harus berkongsi bekas yang sama", "colorsGrey": "KELABU", "colorsBrown": "COKLAT", "colorsDeepOrange": "JINGGA TUA", "colorsOrange": "JINGGA", "colorsAmber": "KUNING JINGGA", "colorsYellow": "KUNING", "colorsLime": "HIJAU LIMAU NIPIS", "colorsLightGreen": "HIJAU CERAH", "colorsGreen": "HIJAU", "homeHeaderGallery": "Galeri", "homeHeaderCategories": "Kategori", "shrineDescription": "Apl runcit yang mengikut perkembangan", "craneDescription": "Apl perjalanan yang diperibadikan", "homeCategoryReference": "GAYA & LAIN-LAIN", "demoInvalidURL": "Tidak dapat memaparkan URL:", "demoOptionsTooltip": "Pilihan", "demoInfoTooltip": "Maklumat", "demoCodeTooltip": "Kod Tunjuk Cara", "demoDocumentationTooltip": "Dokumentasi API", "demoFullscreenTooltip": "Skrin Penuh", "settingsTextScaling": "Penskalaan teks", "settingsTextDirection": "Arah teks", "settingsLocale": "Tempat peristiwa", "settingsPlatformMechanics": "Mekanik platform", "settingsDarkTheme": "Gelap", "settingsSlowMotion": "Gerak perlahan", "settingsAbout": "Perihal Galeri Flutter", "settingsFeedback": "Hantar maklum balas", "settingsAttribution": "Direka bentuk oleh TOASTER di London", "demoButtonTitle": "Butang", "demoButtonSubtitle": "Teks, terangkat, bergaris dan banyak lagi", "demoFlatButtonTitle": "Butang Rata", "demoRaisedButtonDescription": "Butang timbul menambahkan dimensi pada reka letak yang kebanyakannya rata. Butang ini menekankan fungsi pada ruang sibuk atau luas.", "demoRaisedButtonTitle": "Butang Timbul", "demoOutlineButtonTitle": "Butang Garis Bentuk", "demoOutlineButtonDescription": "Butang garis bentuk menjadi legap dan terangkat apabila ditekan. Butang ini sering digandingkan dengan butang timbul untuk menunjukkan tindakan sekunder alternatif.", "demoToggleButtonTitle": "Butang Togol", "colorsTeal": "HIJAU KEBIRUAN", "demoFloatingButtonTitle": "Butang Tindakan Terapung", "demoFloatingButtonDescription": "Butang tindakan terapung ialah butang ikon bulat yang menuding pada kandungan untuk mempromosikan tindakan utama dalam aplikasi.", "demoDialogTitle": "Dialog", "demoDialogSubtitle": "Ringkas, makluman dan skrin penuh", "demoAlertDialogTitle": "Makluman", "demoAlertDialogDescription": "Dialog makluman memberitahu pengguna tentang situasi yang memerlukan perakuan. Dialog makluman mempunyai tajuk pilihan dan senarai tindakan pilihan.", "demoAlertTitleDialogTitle": "Makluman Bertajuk", "demoSimpleDialogTitle": "Ringkas", "demoSimpleDialogDescription": "Dialog ringkas menawarkan pengguna satu pilihan antara beberapa pilihan. Dialog ringkas mempunyai tajuk pilihan yang dipaparkan di bahagian atas pilihan itu.", "demoFullscreenDialogTitle": "Skrin penuh", "demoCupertinoButtonsTitle": "Butang", "demoCupertinoButtonsSubtitle": "Butang gaya iOS", "demoCupertinoButtonsDescription": "Butang gaya iOS. Butang menggunakan teks dan/atau ikon yang melenyap keluar dan muncul apabila disentuh. Boleh mempunyai latar belakang secara pilihan.", "demoCupertinoAlertsTitle": "Makluman", "demoCupertinoAlertsSubtitle": "Dialog makluman gaya iOS", "demoCupertinoAlertTitle": "Makluman", "demoCupertinoAlertDescription": "Dialog makluman memberitahu pengguna tentang situasi yang memerlukan perakuan. Dialog makluman mempunyai tajuk pilihan, kandungan pilihan dan senarai tindakan pilihan. Tajuk dipaparkan di bahagian atas kandungan manakala tindakan dipaparkan di bahagian bawah kandungan.", "demoCupertinoAlertWithTitleTitle": "Makluman Bertajuk", "demoCupertinoAlertButtonsTitle": "Makluman Dengan Butang", "demoCupertinoAlertButtonsOnlyTitle": "Butang Makluman Sahaja", "demoCupertinoActionSheetTitle": "Helaian Tindakan", "demoCupertinoActionSheetDescription": "Helaian tindakan ialah gaya makluman tertentu yang mengemukakan kepada pengguna set dua atau lebih pilihan yang berkaitan dengan konteks semasa. Helaian tindakan boleh mempunyai tajuk, mesej tambahan dan senarai tindakan.", "demoColorsTitle": "Warna", "demoColorsSubtitle": "Semua warna yang dipratakrif", "demoColorsDescription": "Warna dan malar reja warna yang mewakili palet warna Reka Bentuk Bahan.", "buttonTextEnabled": "ENABLED", "buttonTextDisabled": "DISABLED", "buttonTextCreate": "Buat", "dialogSelectedOption": "Anda memilih: \"{value}\"", "dialogDiscardTitle": "Buang draf?", "dialogLocationTitle": "Gunakan perkhidmatan lokasi Google?", "dialogLocationDescription": "Benarkan Google membantu apl menentukan lokasi. Ini bermakna menghantar data lokasi awanama kepada Google, walaupun semasa tiada apl yang berjalan.", "dialogCancel": "BATAL", "dialogDiscard": "BUANG", "dialogDisagree": "TIDAK SETUJU", "dialogAgree": "SETUJU", "dialogSetBackup": "Tetapkan akaun sandaran", "colorsBlueGrey": "KELABU KEBIRUAN", "dialogShow": "TUNJUKKAN DIALOG", "dialogFullscreenTitle": "Dialog Skrin Penuh", "dialogFullscreenSave": "SIMPAN", "dialogFullscreenDescription": "Demo dialog skrin penuh", "cupertinoButtonEnabled": "Enabled", "cupertinoButtonDisabled": "Disabled", "cupertinoButtonWithBackground": "Dengan Latar Belakang", "cupertinoAlertCancel": "Batal", "cupertinoAlertDiscard": "Buang", "cupertinoAlertLocationTitle": "Benarkan \"Peta\" mengakses lokasi anda semasa anda menggunakan apl?", "cupertinoAlertLocationDescription": "Lokasi semasa anda akan dipaparkan pada peta dan digunakan untuk menunjuk arah, hasil carian tempat berdekatan dan anggaran waktu perjalanan.", "cupertinoAlertAllow": "Benarkan", "cupertinoAlertDontAllow": "Jangan Benarkan", "cupertinoAlertFavoriteDessert": "Pilih Pencuci Mulut Kegemaran", "cupertinoAlertDessertDescription": "Sila pilih jenis pencuci mulut kegemaran anda daripada senarai di bawah. Pemilihan anda akan digunakan untuk menyesuaikan senarai kedai makan yang dicadangkan di kawasan anda.", "cupertinoAlertCheesecake": "Kek keju", "cupertinoAlertTiramisu": "Tiramisu", "cupertinoAlertApplePie": "Pai Epal", "cupertinoAlertChocolateBrownie": "Brownie Coklat", "cupertinoShowAlert": "Tunjukkan Makluman", "colorsRed": "MERAH", "colorsPink": "MERAH JAMBU", "colorsPurple": "UNGU", "colorsDeepPurple": "UNGU TUA", "colorsIndigo": "BIRU NILA", "colorsBlue": "BIRU", "colorsLightBlue": "BIRU MUDA", "colorsCyan": "BIRU KEHIJAUAN", "dialogAddAccount": "Tambah akaun", "Gallery": "Galeri", "Categories": "Kategori", "SHRINE": "KUIL", "Basic shopping app": "Apl asas beli-belah", "RALLY": "RALI", "CRANE": "KREN", "Travel app": "Apl perjalanan", "MATERIAL": "BAHAN", "CUPERTINO": "CUPERTINO", "REFERENCE STYLES & MEDIA": "GAYA & MEDIA RUJUKAN" }
gallery/lib/l10n/intl_ms.arb/0
{ "file_path": "gallery/lib/l10n/intl_ms.arb", "repo_id": "gallery", "token_count": 19056 }
800
{ "loading": "Po ngarkohet", "deselect": "Hiq përzgjedhjen", "select": "Zgjidh", "selectable": "Mund të zgjidhet (shtypje e gjatë)", "selected": "Zgjedhur", "demo": "Demonstrim", "bottomAppBar": "Shiriti i aplikacioneve në fund", "notSelected": "Nuk është zgjedhur", "demoCupertinoSearchTextFieldTitle": "Fusha e kërkimit të tekstit", "demoCupertinoPicker": "Zgjedhësi", "demoCupertinoSearchTextFieldSubtitle": "Fusha e kërkimit të tekstit në stilin e iOS", "demoCupertinoSearchTextFieldDescription": "Një fushë kërkimi teksti që e lejon përdoruesin të kërkojë duke futur tekstin dhe që mund të ofrojë dhe të filtrojë sugjerimet.", "demoCupertinoSearchTextFieldPlaceholder": "Fut një tekst", "demoCupertinoScrollbarTitle": "Shiriti i lëvizjes", "demoCupertinoScrollbarSubtitle": "Shiriti i lëvizjes në stilin e iOS", "demoCupertinoScrollbarDescription": "Një shirit lëvizjeje që mbështjell elementin e dhënë në varësi", "demoTwoPaneItem": "Artikulli {value}", "demoTwoPaneList": "Lista", "demoTwoPaneFoldableLabel": "E palosshme", "demoTwoPaneSmallScreenLabel": "Ekran i vogël", "demoTwoPaneSmallScreenDescription": "Ja si sillet TwoPane në një pajisje me ekran të vogël.", "demoTwoPaneTabletLabel": "Tablet/desktop", "demoTwoPaneTabletDescription": "Ja si sillet TwoPane në një ekran më të madh, si p.sh. një tablet ose një dektop.", "demoTwoPaneTitle": "TwoPane", "demoTwoPaneSubtitle": "Struktura reaguese në pajisje të palosshme, të mëdha dhe të vogla", "splashSelectDemo": "Zgjidh një demonstrim", "demoTwoPaneFoldableDescription": "Ja si sillet TwoPane në një pajisje të palosshme.", "demoTwoPaneDetails": "Detajet", "demoTwoPaneSelectItem": "Zgjidh një artikull", "demoTwoPaneItemDetails": "Detajet e artikullit {value}", "demoCupertinoContextMenuActionText": "Trokit dhe mbaj shtypur logon e Flutter për të parë menynë kontekstuale.", "demoCupertinoContextMenuDescription": "Një meny kontekstuale në stilin për iOS në ekran të plotë që shfaqet kur një element mbahet shtypur gjatë.", "demoAppBarTitle": "Shiriti i aplikacionit", "demoAppBarDescription": "Shiriti i aplikacionit ofron përmbajtje dhe veprime që lidhen me ekranin aktual. Ai përdoret për markat, titujt e ekraneve, navigimin dhe veprimet", "demoDividerTitle": "Ndarësi", "demoDividerSubtitle": "Ndarësi është një vijë e hollë që grupon përmbajtjet në lista dhe struktura.", "demoDividerDescription": "Ndarësit mund të përdoren në lista, sirtarë dhe kudo për të ndarë përmbajtje.", "demoVerticalDividerTitle": "Ndarësi vertikal", "demoCupertinoContextMenuTitle": "Menyja konstekstuale", "demoCupertinoContextMenuSubtitle": "Menyja kontekstuale në stilin për iOS", "demoAppBarSubtitle": "Shfaq informacione dhe veprime në lidhje me ekranin aktual", "demoCupertinoContextMenuActionOne": "Veprimi një", "demoCupertinoContextMenuActionTwo": "Veprimi dy", "demoDateRangePickerDescription": "Shfaq një dialog që përfshin një zgjedhës të diapazonit të datave me dizajnin e materialit.", "demoDateRangePickerTitle": "Zgjedhësi i diapazonit të datave", "demoNavigationDrawerUserName": "Emri i përdoruesit", "demoNavigationDrawerUserEmail": "[email protected]", "demoNavigationDrawerText": "Rrëshqit nga skaji ose trokit ikonën e majtë lart për të parë sirtarin", "demoNavigationRailTitle": "Shina e shfletimit", "demoNavigationRailSubtitle": "Shfaqja e shinës së shfletimit brenda një aplikacioni", "demoNavigationRailDescription": "Një miniaplikacion material që synohet për shfaqje majtas apo djathtas një aplikacioni për të shfletuar mes një numri të vogël, rëndom mes tri e pesë, pamjesh.", "demoNavigationRailFirst": "E para", "demoNavigationDrawerTitle": "Sirtari i navigimit", "demoNavigationRailThird": "E treta", "replyStarredLabel": "Me yll", "demoTextButtonDescription": "Një buton teksti shfaq një spërkatje me bojë pas shtypjes, por nuk ngrihet. Përdor butonat e tekstit në shiritat e veglave, dialogët dhe brenda faqes me skemë padding", "demoElevatedButtonTitle": "Buton i ngritur", "demoElevatedButtonDescription": "Butonat e ngritur u shtojnë dimension strukturave kryesisht të rrafshëta. Ata theksojnë funksionet në hapësirat e gjera ose me trafik.", "demoOutlinedButtonTitle": "Buton me kontur", "demoOutlinedButtonDescription": "Butonat me kontur bëhen të patejdukshëm dhe ngrihen kur shtypen. Shpesh ata çiftohen me butonat e ngritur për të treguar një veprim alternativ dytësor.", "demoContainerTransformDemoInstructions": "Kartat, listat dhe FAB", "demoNavigationDrawerSubtitle": "Shfaqja e një sirtari brenda rreshtit të aplikacioneve", "replyDescription": "Një aplikacion efikas dhe i fokusuar email-i", "demoNavigationDrawerDescription": "Një panel me \"Dizajn material\" që hyn me rrëshqitje horizontale nga skaji i ekranit për të shfaqur lidhjet e shfletimit në një aplikacion.", "replyDraftsLabel": "Draftet", "demoNavigationDrawerToPageOne": "Artikulli një", "replyInboxLabel": "Kutia hyrëse", "demoSharedXAxisDemoInstructions": "Butonat \"Vijo\" dhe \"Pas\"", "replySpamLabel": "Postë e bezdisshme", "replyTrashLabel": "Koshi", "replySentLabel": "Dërguar", "demoNavigationRailSecond": "E dyta", "demoNavigationDrawerToPageTwo": "Artikulli dy", "demoFadeScaleDemoInstructions": "Modal dhe FAB", "demoFadeThroughDemoInstructions": "Shfletimi poshtë", "demoSharedZAxisDemoInstructions": "Butoni i ikonës së \"Cilësimeve\"", "demoSharedYAxisDemoInstructions": "Rendit sipas \"Të luajturave së fundi\"", "demoTextButtonTitle": "Butoni i tekstit", "demoSharedZAxisBeefSandwichRecipeTitle": "Sandviç me mish viçi", "demoSharedZAxisDessertRecipeDescription": "Recetë për ëmbëlsirë", "demoSharedYAxisAlbumTileSubtitle": "Artisti", "demoSharedYAxisAlbumTileTitle": "Albumi", "demoSharedYAxisRecentSortTitle": "Të luajtura së fundi", "demoSharedYAxisAlphabeticalSortTitle": "A-Z", "demoSharedYAxisAlbumCount": "268 albume", "demoSharedYAxisTitle": "Boshti y i ndarë", "demoSharedXAxisCreateAccountButtonText": "KRIJO LLOGARI", "demoFadeScaleAlertDialogDiscardButton": "HIQ", "demoSharedXAxisSignInTextFieldLabel": "Email-i ose numri i telefonit", "demoSharedXAxisSignInSubtitleText": "Identifikohu me llogarinë tënde", "demoSharedXAxisSignInWelcomeText": "Përshëndetje, David Park", "demoSharedXAxisIndividualCourseSubtitle": "Shfaqet individualisht", "demoSharedXAxisBundledCourseSubtitle": "Pjesë e paketës", "demoFadeThroughAlbumsDestination": "Albumet", "demoSharedXAxisDesignCourseTitle": "Dizajnim", "demoSharedXAxisIllustrationCourseTitle": "Ilustrim", "demoSharedXAxisBusinessCourseTitle": "Biznes", "demoSharedXAxisArtsAndCraftsCourseTitle": "Vepra arti dhe artizanati", "demoMotionPlaceholderSubtitle": "Teksti dytësor", "demoFadeScaleAlertDialogCancelButton": "ANULO", "demoFadeScaleAlertDialogHeader": "Dialogu i alarmit", "demoFadeScaleHideFabButton": "FSHIH FAB", "demoFadeScaleShowFabButton": "SHFAQ FAB", "demoFadeScaleShowAlertDialogButton": "SHFAQ MODAL", "demoFadeScaleDescription": "Motivi i zbehjes përdoret për elementet e ndërfaqes së përdoruesit që hyjnë ose dalin brenda kufijve të ekranit, si p.sh. një dialog që zbehet në qendër të ekranit.", "demoFadeScaleTitle": "Zbehje", "demoFadeThroughTextPlaceholder": "123 fotografi", "demoFadeThroughSearchDestination": "Kërko", "demoFadeThroughPhotosDestination": "Fotografitë", "demoSharedXAxisCoursePageSubtitle": "Kategoritë pjesë e paketës shfaqen si grupe në burimin tënd. Mund ta ndryshosh gjithmonë këtë më vonë.", "demoFadeThroughDescription": "Motivi i zbehjes graduale përdoret për kalimet mes elementeve të ndërfaqes së përdoruesit që nuk kanë marrëdhënie të fortë me njëri-tjetrin.", "demoFadeThroughTitle": "Zbehje graduale", "demoSharedZAxisHelpSettingLabel": "Ndihma", "demoMotionSubtitle": "Të gjitha motivet e paracaktuara të kalimit", "demoSharedZAxisNotificationSettingLabel": "Njoftimet", "demoSharedZAxisProfileSettingLabel": "Profili", "demoSharedZAxisSavedRecipesListTitle": "Recetat e ruajtura", "demoSharedZAxisBeefSandwichRecipeDescription": "Recetë për sandviç me mish viçi", "demoSharedZAxisCrabPlateRecipeDescription": "Recetë për gatim me gaforre", "demoSharedXAxisCoursePageTitle": "Përmirëso kurset e tua", "demoSharedZAxisCrabPlateRecipeTitle": "Gaforre", "demoSharedZAxisShrimpPlateRecipeDescription": "Recetë për gatim me karkaleca deti", "demoSharedZAxisShrimpPlateRecipeTitle": "Karkaleca deti", "demoContainerTransformTypeFadeThrough": "ZBEHJE GRADUALE", "demoSharedZAxisDessertRecipeTitle": "Ëmbëlsirë", "demoSharedZAxisSandwichRecipeDescription": "Recetë për sandviç", "demoSharedZAxisSandwichRecipeTitle": "Sandviç", "demoSharedZAxisBurgerRecipeDescription": "Recetë për hamburger", "demoSharedZAxisBurgerRecipeTitle": "Hamburger", "demoSharedZAxisSettingsPageTitle": "Cilësimet", "demoSharedZAxisTitle": "Boshti z i ndarë", "demoSharedZAxisPrivacySettingLabel": "Privatësia", "demoMotionTitle": "Lëvizja", "demoContainerTransformTitle": "Transformimi i kontejnerit", "demoContainerTransformDescription": "Motivi i transformimit të kontejnerit është projektuar për kalime mes elementeve të ndërfaqes së përdoruesit që përfshijnë një kontejner. Ky motiv krijon një lidhje të dukshme mes dy elementeve të ndërfaqes së përdoruesit", "demoContainerTransformModalBottomSheetTitle": "Modaliteti i zbehjes", "demoContainerTransformTypeFade": "ZBEHJE", "demoSharedYAxisAlbumTileDurationUnit": "min.", "demoMotionPlaceholderTitle": "Titulli", "demoSharedXAxisForgotEmailButtonText": "HARROVE ADRESËN E EMAIL-IT?", "demoMotionSmallPlaceholderSubtitle": "Dytësor", "demoMotionDetailsPageTitle": "Faqja e detajeve", "demoMotionListTileTitle": "Artikulli i listës", "demoSharedAxisDescription": "Motivi i boshtit të ndarë përdoret për kalimet mes elementeve të ndërfaqes së përdoruesit që kanë marrëdhënie hapësinore ose navigacionale. Ky motiv përdor një transformim të ndarë në boshtin x, y ose z për të përforcuar marrëdhënien mes elementeve.", "demoSharedXAxisTitle": "Boshti x i ndarë", "demoSharedXAxisBackButtonText": "PRAPA", "demoSharedXAxisNextButtonText": "PARA", "demoSharedXAxisCulinaryCourseTitle": "Gatim", "githubRepo": "Depoja {repoName} e GitHub", "fortnightlyMenuUS": "Shtetet e Bashkuara", "fortnightlyMenuBusiness": "Biznes", "fortnightlyMenuScience": "Shkencë", "fortnightlyMenuSports": "Sport", "fortnightlyMenuTravel": "Udhëtim", "fortnightlyMenuCulture": "Kulturë", "fortnightlyTrendingTechDesign": "TechDesign", "rallyBudgetDetailAmountLeft": "Shuma e mbetur", "fortnightlyHeadlineArmy": "Reformimi i ushtrisë së gjelbër nga brenda saj", "fortnightlyDescription": "Një aplikacion lajmesh i fokusuar te përmbajtja", "rallyBillDetailAmountDue": "Shuma për t'u paguar", "rallyBudgetDetailTotalCap": "Kufiri total", "rallyBudgetDetailAmountUsed": "Shuma e përdorur", "fortnightlyTrendingHealthcareRevolution": "HealthcareRevolution", "fortnightlyMenuFrontPage": "Faqja kryesore", "fortnightlyMenuWorld": "Bota", "rallyBillDetailAmountPaid": "Shuma e paguar", "fortnightlyMenuPolitics": "Politikë", "fortnightlyHeadlineBees": "Bletët braktisin tokat bujqësore", "fortnightlyHeadlineGasoline": "E ardhmja e benzinës", "fortnightlyTrendingGreenArmy": "GreenArmy", "fortnightlyHeadlineFeminists": "Feministët kundër kampeve partiake", "fortnightlyHeadlineFabrics": "Stilistët përdorin teknologjinë për të krijuar pëlhura futuriste", "fortnightlyHeadlineStocks": "Me ngadalësimin e aksioneve, shumë u drejtohen valutave", "fortnightlyTrendingReform": "Reformë", "fortnightlyMenuTech": "Teknologji", "fortnightlyHeadlineWar": "Jetët amerikane të ndara gjatë luftës", "fortnightlyHeadlineHealthcare": "Revolucioni i qetë, por i fuqishëm në kujdesin shëndetësor", "fortnightlyLatestUpdates": "Përditësimet më të fundit", "fortnightlyTrendingStocks": "Aksione", "rallyBillDetailTotalAmount": "Shuma totale", "demoCupertinoPickerDateTime": "Data dhe ora", "signIn": "IDENTIFIKOHU", "dataTableRowWithSugar": "{value} me sheqer", "dataTableRowApplePie": "Ëmbëlsirë me mollë", "dataTableRowDonut": "Petull", "dataTableRowHoneycomb": "Hoje blete", "dataTableRowLollipop": "Lëpirëse", "dataTableRowJellyBean": "Karamele me xhelatinë", "dataTableRowGingerbread": "Biskota me xhenxhefil", "dataTableRowCupcake": "Kek", "dataTableRowEclair": "Pastashutë", "dataTableRowIceCreamSandwich": "Sanduiç me akullore", "dataTableRowFrozenYogurt": "Kos i ngrirë", "dataTableColumnIron": "Hekur (%)", "dataTableColumnCalcium": "Kalcium (%)", "dataTableColumnSodium": "Natrium (mg)", "demoTimePickerTitle": "Zgjedhësi i orës", "demo2dTransformationsResetTooltip": "Rivendos transformimet", "dataTableColumnFat": "Yndyrnat (g)", "dataTableColumnCalories": "Kaloritë", "dataTableColumnDessert": "Ëmbëlsirë (1 racion)", "cardsDemoTravelDestinationLocation1": "Thanjavur, Tamil Nadu", "demoTimePickerDescription": "Shfaq një dialog që përfshin një zgjedhës ore me dizajnin e materialit.", "demoPickersShowPicker": "SHFAQ ZGJEDHËSIN", "demoTabsScrollingTitle": "Me lëvizje", "demoTabsNonScrollingTitle": "Pa lëvizje", "craneHours": "{hours,plural,=1{1 orë}other{{hours} orë}}", "craneMinutes": "{minutes,plural,=1{1 min.}other{{minutes} min.}}", "craneFlightDuration": "{hoursShortForm} {minutesShortForm}", "dataTableHeader": "Të ushqyerit", "demoDatePickerTitle": "Zgjedhësi i datës", "demoPickersSubtitle": "Zgjedhja e datës dhe orës", "demoPickersTitle": "Zgjedhësit", "demo2dTransformationsEditTooltip": "Modifiko pllakëzën", "demoDataTableDescription": "Tabelat e të dhënave shfaqin informacione në një format me rreshta dhe kolona si në rrjetë. Ato i organizojnë informacionet në një mënyrë që është e lehtë për t'i skanuar, në mënyrë që përdoruesit të mund të shikojnë për motive dhe statistika.", "demo2dTransformationsDescription": "Trokit për të modifikuar pllakëzat dhe përdor gjestet për të lëvizur në skenë. Zvarrit për ta zgjeruar, afro gishtat për ta zmadhuar, rrotulloje me dy gishta. Shtyp butonin \"Rivendos\" për t'u kthyer tek orientimi fillestar.", "demo2dTransformationsSubtitle": "Zgjero, zmadho, rrotullo", "demo2dTransformationsTitle": "Transformimet 2D", "demoCupertinoTextFieldPIN": "PIN", "demoCupertinoTextFieldDescription": "Një fushë teksti lejon që përdoruesi të futë tekstin me një tastierë fizike ose me një tastierë në ekran.", "demoCupertinoTextFieldSubtitle": "Fushat e tekstit në stilin e iOS", "demoCupertinoTextFieldTitle": "Fushat me tekst", "demoDatePickerDescription": "Shfaq një dialog që përfshin një zgjedhës date me dizajnin e materialit.", "demoCupertinoPickerTime": "Ora", "demoCupertinoPickerDate": "Data", "demoCupertinoPickerTimer": "Kohëmatësi", "demoCupertinoPickerDescription": "Një miniaplikacion zgjedhësi në stilin e iOS që mund të përdoret për të zgjedhur vargjet, datat, orët ose datën bashkë me orën.", "demoCupertinoPickerSubtitle": "Zgjedhësit i stilit të iOS", "demoCupertinoPickerTitle": "Zgjedhësit", "dataTableRowWithHoney": "{value} me mjaltë", "cardsDemoTravelDestinationCity2": "Çetinad", "bannerDemoResetText": "Rivendos banderolën", "bannerDemoMultipleText": "Shumë veprime", "bannerDemoLeadingText": "Ikona kryesore", "dismiss": "HIQ", "cardsDemoTappable": "Mund të trokitet", "cardsDemoSelectable": "Mund të zgjidhet (shtypje e gjatë)", "cardsDemoExplore": "Eksploro", "cardsDemoExploreSemantics": "Eksploro {destinationName}", "cardsDemoShareSemantics": "Ndaj {destinationName}", "cardsDemoTravelDestinationTitle1": "10 qytetet kryesore për të vizituar në Tamil Nadu", "cardsDemoTravelDestinationDescription1": "Numri 10", "cardsDemoTravelDestinationCity1": "Thanjavur", "dataTableColumnProtein": "Proteina (g)", "cardsDemoTravelDestinationTitle2": "Artizanë në Indinë Jugore", "cardsDemoTravelDestinationDescription2": "Prodhues mëndafshi", "bannerDemoText": "Fjalëkalimi yt është përditësuar në pajisjen tënde tjetër. Identifikohu përsëri.", "cardsDemoTravelDestinationLocation2": "Sivaganga, Tamil Nadu", "cardsDemoTravelDestinationTitle3": "Tempulli Brihadisvara", "cardsDemoTravelDestinationDescription3": "Tempuj", "demoBannerTitle": "Banderola", "demoBannerSubtitle": "Shfaqja e një banderole brenda një liste", "demoBannerDescription": "Një banderolë shfaq një mesazh të përmbledhur të rëndësishëm dhe ofron veprime për përdoruesit për menaxhimin (ose heqjen) e banderolës. Kërkohet një veprim nga përdoruesi për heqjen e saj.", "demoCardTitle": "Kartat", "demoCardSubtitle": "Kartat bazë me kënde të rrumbullakosura", "demoCardDescription": "Një kartë është një fletë e materialit të përdorur për të paraqitur disa informacione përkatëse, p.sh. një album, një vendndodhje gjeografike, një vakt, detajet e kontaktit etj.", "demoDataTableTitle": "Tabelat e të dhënave", "demoDataTableSubtitle": "Rreshtat dhe kolonat e informacioneve", "dataTableColumnCarbs": "Karbohidratet (g)", "placeTanjore": "Tanjore", "demoGridListsTitle": "Listat në formë rrjete", "placeFlowerMarket": "Treg lulesh", "placeBronzeWorks": "Vepra prej bronzi", "placeMarket": "Tregu", "placeThanjavurTemple": "Tempull në Thanjavur", "placeSaltFarm": "Kripore", "placeScooters": "Motoçikleta", "placeSilkMaker": "Prodhues mëndafshi", "placeLunchPrep": "Përgatitja e drekës", "placeBeach": "Plazh", "placeFisherman": "Peshkatar", "demoMenuSelected": "Zgjedhur: {value}", "demoMenuRemove": "Hiq", "demoMenuGetLink": "Merr lidhjen", "demoMenuShare": "Ndaj", "demoBottomAppBarSubtitle": "Shfaq navigimin dhe veprimet në fund", "demoMenuAnItemWithASectionedMenu": "Një artikull me një meny me seksione", "demoMenuADisabledMenuItem": "Artikulli i çaktivizuar i menysë", "demoLinearProgressIndicatorTitle": "Treguesi linear i progresit", "demoMenuContextMenuItemOne": "Artikulli i parë i menysë kontekstuale", "demoMenuAnItemWithASimpleMenu": "Një artikull me një meny të thjeshtë", "demoCustomSlidersTitle": "Rrëshqitësit e personalizuar", "demoMenuAnItemWithAChecklistMenu": "Një artikulli me një meny me listë me zgjedhje", "demoCupertinoActivityIndicatorTitle": "Treguesi i aktivitetit", "demoCupertinoActivityIndicatorSubtitle": "Treguesit e aktivitetit në stilin e iOS", "demoCupertinoActivityIndicatorDescription": "Një tregues aktiviteti në stilin e iOS që rrotullohet në drejtimin orar.", "demoCupertinoNavigationBarTitle": "Shiriti i navigimit", "demoCupertinoNavigationBarSubtitle": "Shiriti i navigimit në stilin e iOS", "demoCupertinoNavigationBarDescription": "Një shirit navigimi në stilin e iOS. Shiriti i navigimit është një shirit veglash që përfshin minimumi një titull të faqes, në mes të shiritit të veglave.", "demoCupertinoPullToRefreshTitle": "Tërhiq për të rifreskuar", "demoCupertinoPullToRefreshSubtitle": "Kontrolli me tërheqjen për të rifreskuar në stilin e iOS", "demoCupertinoPullToRefreshDescription": "Një miniaplikacion që zbaton një kontroll të përmbajtjes me tërheqjen për të rifreskuar në stilin e iOS.", "demoProgressIndicatorTitle": "Treguesit e progresit", "demoProgressIndicatorSubtitle": "Linear, rrethor, i papërcaktuar", "demoCircularProgressIndicatorTitle": "Treguesi rrethor i progresit", "demoCircularProgressIndicatorDescription": "Një tregues rrethor i progresit i dizajnit të materialit, i cili rrotullohet për të treguar që aplikacioni është i zënë.", "demoMenuFour": "Katër", "demoLinearProgressIndicatorDescription": "Një tregues linear i progresit i dizajnit të materialit, i njohur edhe si një shirit progresi.", "demoTooltipTitle": "Këshillat për veglat", "demoTooltipSubtitle": "Mesazh i shkurtër që shfaqet pas një shtypjeje të gjatë ose një qëndrimi pezull", "demoTooltipDescription": "Këshillat për veglat ofrojnë etiketa teksti që ndihmojnë për të shpjeguar funksionin e një butoni ose të një veprimi tjetër të ndërfaqes së përdoruesit. Këshillat për veglat shfaqin një tekst informues kur përdoruesit qëndrojnë pezull mbi to, kur i fokusojnë ose kur kryejnë një shtypje të gjatë mbi një element.", "demoTooltipInstructions": "Kryej një shtypje të gjatë ose qëndrim pezull për të shfaqur këshillën për veglën.", "placeChennai": "Çenai", "demoMenuChecked": "Shënuar: {value}", "placeChettinad": "Çetinad", "demoMenuPreview": "Shiko paraprakisht", "demoBottomAppBarTitle": "Shiriti i aplikacioneve në fund", "demoBottomAppBarDescription": "Shiritat e aplikacioneve në fund ofrojnë qasje te një sirtar navigimi në fund dhe deri në katër veprime, duke përfshirë butonin pluskues të veprimit.", "bottomAppBarNotch": "E prera", "bottomAppBarPosition": "Pozicioni i butonit pluskues të veprimit", "bottomAppBarPositionDockedEnd": "Lidhur me stacionin - në fund", "bottomAppBarPositionDockedCenter": "Lidhur me stacionin - në qendër", "bottomAppBarPositionFloatingEnd": "Pluskues - në fund", "bottomAppBarPositionFloatingCenter": "Pluskues - në qendër", "demoSlidersEditableNumericalValue": "Vlera numerike e modifikueshme", "demoGridListsSubtitle": "Struktura e rreshtit dhe kolonës", "demoGridListsDescription": "Listat në formë rrjete janë më të përshtatshme për paraqitjen e të dhënave homogjene, zakonisht të imazheve. Çdo artikull në një listë në formë rrjete quhet një pllakëz.", "demoGridListsImageOnlyTitle": "Vetëm imazhe", "demoGridListsHeaderTitle": "Me kokën e faqes", "demoGridListsFooterTitle": "Me fundin e faqes", "demoSlidersTitle": "Rrëshqitësit", "demoSlidersSubtitle": "Miniaplikacione për zgjedhjen e një vlere me rrëshqitje", "demoSlidersDescription": "Rrëshqitësit pasqyrojnë një gamë vlerash përgjatë një shiriti, nga të cilat përdoruesit mund të zgjedhin një vlerë të vetme. Ata janë idealë për rregullimin e cilësimeve si p.sh. volumi, ndriçimi ose zbatimi i filtrave të imazheve.", "demoRangeSlidersTitle": "Rrëshqitësit me gamë vlerash", "demoRangeSlidersDescription": "Rrëshqitësit pasqyrojnë një gamë vlerash përgjatë një shiriti. Ata mund të kenë ikona në të dyja skajet e shiritit, të cilat pasqyrojnë një gamë vlerash. Ata janë idealë për rregullimin e cilësimeve si p.sh. volumi, ndriçimi ose zbatimi i filtrave të imazheve.", "demoMenuAnItemWithAContextMenuButton": "Një artikulli me një meny kontekstuale", "demoCustomSlidersDescription": "Rrëshqitësit pasqyrojnë një gamë vlerash përgjatë një shiriti, nga të cilat përdoruesit mund të zgjedhin një vlerë të vetme ose një gamë vlerash. Rrëshqitësit mund të personalizohen dhe t'u ndryshohet tema.", "demoSlidersContinuousWithEditableNumericalValue": "I vazhdueshëm me vlerë numerike të modifikueshme", "demoSlidersDiscrete": "Jo i vazhdueshëm", "demoSlidersDiscreteSliderWithCustomTheme": "Rrëshqitësi jo i vazhdueshëm me temë të personalizuar", "demoSlidersContinuousRangeSliderWithCustomTheme": "Rrëshqitësi i vazhdueshëm me gamë vlerash me temë të personalizuar", "demoSlidersContinuous": "I vazhdueshëm", "placePondicherry": "Pondiçeri", "demoMenuTitle": "Menyja", "demoContextMenuTitle": "Menyja kontekstuale", "demoSectionedMenuTitle": "Menyja me seksione", "demoSimpleMenuTitle": "Menyja e thjeshtë", "demoChecklistMenuTitle": "Menyja me listë me zgjedhje", "demoMenuSubtitle": "Butonat e menysë dhe menytë e thjeshta", "demoMenuDescription": "Një meny shfaq një listë zgjedhjesh në një sipërfaqe të përkohshme. Ato shfaqen kur përdoruesit ndërveprojnë me një buton, veprim ose një kontroll tjetër.", "demoMenuItemValueOne": "Artikulli i parë i menysë", "demoMenuItemValueTwo": "Artikulli i dytë i menysë", "demoMenuItemValueThree": "Artikulli i tretë i menysë", "demoMenuOne": "Një", "demoMenuTwo": "Dy", "demoMenuThree": "Tre", "demoMenuContextMenuItemThree": "Artikulli i tretë i menysë kontekstuale", "demoCupertinoSwitchSubtitle": "Çelësi i stilit të iOS", "demoSnackbarsText": "Ky është një shiriti njoftimesh.", "demoCupertinoSliderSubtitle": "Rrëshqitësi i stilit të iOS", "demoCupertinoSliderDescription": "Një rrëshqitës mund të përdoret për të zgjedhur nga një grup i vazhdueshëm ose jo i vazhdueshëm vlerash.", "demoCupertinoSliderContinuous": "I vazhdueshëm: {value}", "demoCupertinoSliderDiscrete": "Jo i vazhdueshëm: {value}", "demoSnackbarsAction": "Shtype veprimin e shiritit të njoftimeve.", "backToGallery": "Kthehu te \"Galeria\"", "demoCupertinoTabBarTitle": "Shiriti i skedës", "demoCupertinoSwitchDescription": "Çelësi përdoret për të ndërruar gjendjen e një cilësimi të vetëm në aktive/joaktive.", "demoSnackbarsActionButtonLabel": "VEPRIMI", "cupertinoTabBarProfileTab": "Profili", "demoSnackbarsButtonLabel": "SHFAQ NJË SHIRIT NJOFTIMESH", "demoSnackbarsDescription": "Shiritat e njoftimeve i informojnë përdoruesit për një proces që ka kryer ose do të kryejë një aplikacion. Ata shfaqen përkohësisht, në drejtim të fundit të ekranit. Ata nuk duhet ta ndërpresin eksperiencën e përdoruesit dhe nuk kërkojnë ndërveprimin nga përdoruesi për t'u zhdukur.", "demoSnackbarsSubtitle": "Shiritat e njoftimeve shfaqin mesazhe në fund të ekranit", "demoSnackbarsTitle": "Shiritat e njoftimeve", "demoCupertinoSliderTitle": "Rrëshqitësi", "cupertinoTabBarChatTab": "Biseda", "cupertinoTabBarHomeTab": "Skeda bazë", "demoCupertinoTabBarDescription": "Një shiriti i skedës së poshtme të navigimit me stilin e iOS. Shfaq shumë skeda ku një skedë është aktive, skeda e parë si parazgjedhje.", "demoCupertinoTabBarSubtitle": "Shiriti i skedës në fund i stilit të iOS", "demoOptionsFeatureTitle": "Shiko opsionet", "demoOptionsFeatureDescription": "Trokit këtu për të parë opsionet që ofrohen për këtë demonstrim.", "demoCodeViewerCopyAll": "KOPJO TË GJITHA", "shrineScreenReaderRemoveProductButton": "Hiq {product}", "shrineScreenReaderProductAddToCart": "Shto në karrocë", "shrineScreenReaderCart": "{quantity,plural,=0{Karroca e blerjeve, asnjë artikull}=1{Karroca e blerjeve, 1 artikull}other{Karroca e blerjeve, {quantity} artikuj}}", "demoCodeViewerFailedToCopyToClipboardMessage": "Kopjimi në kujtesën e fragmenteve dështoi: {error}", "demoCodeViewerCopiedToClipboardMessage": "U kopjua në kujtesën e fragmenteve", "craneSleep8SemanticLabel": "Rrënojat e fiseve maja në një shkëmb mbi një plazh", "craneSleep4SemanticLabel": "Hotel buzë liqenit përballë maleve", "craneSleep2SemanticLabel": "Qyteti i Maçu Piçut", "craneSleep1SemanticLabel": "Shtëpi alpine në një peizazh me borë me pemë të gjelbëruara", "craneSleep0SemanticLabel": "Shtëpi mbi ujë", "craneFly13SemanticLabel": "Pishinë buzë detit me palma", "craneFly12SemanticLabel": "Pishinë me palma", "craneFly11SemanticLabel": "Far prej tulle buzë detit", "craneFly10SemanticLabel": "Minaret e Xhamisë së Al-Azharit në perëndim të diellit", "craneFly9SemanticLabel": "Burrë i mbështetur te një makinë antike blu", "craneFly8SemanticLabel": "Supertree Grove", "craneEat9SemanticLabel": "Banak kafeneje me ëmbëlsira", "craneEat2SemanticLabel": "Hamburger", "craneFly5SemanticLabel": "Hotel buzë liqenit përballë maleve", "demoSelectionControlsSubtitle": "Kutitë e zgjedhjes, butonat e radios dhe çelësat", "craneEat10SemanticLabel": "Grua që mban një sandviç të madh me pastërma", "craneFly4SemanticLabel": "Shtëpi mbi ujë", "craneEat7SemanticLabel": "Hyrje pastiçerie", "craneEat6SemanticLabel": "Pjatë me karkaleca deti", "craneEat5SemanticLabel": "Zonë uljeje në restorant me art", "craneEat4SemanticLabel": "Ëmbëlsirë me çokollatë", "craneEat3SemanticLabel": "Tako koreane", "craneFly3SemanticLabel": "Qyteti i Maçu Piçut", "craneEat1SemanticLabel": "Bar i zbrazur me stola në stil restoranti", "craneEat0SemanticLabel": "Pica në furrë druri", "craneSleep11SemanticLabel": "Qiellgërvishtësi Taipei 101", "craneSleep10SemanticLabel": "Minaret e Xhamisë së Al-Azharit në perëndim të diellit", "craneSleep9SemanticLabel": "Far prej tulle buzë detit", "craneEat8SemanticLabel": "Pjatë me karavidhe", "craneSleep7SemanticLabel": "Apartamente shumëngjyrëshe në Sheshin Ribeira", "craneSleep6SemanticLabel": "Pishinë me palma", "craneSleep5SemanticLabel": "Tendë në fushë", "settingsButtonCloseLabel": "Mbyll \"Cilësimet\"", "demoSelectionControlsCheckboxDescription": "Kutitë e kontrollit e lejojnë përdoruesin të zgjedhë shumë opsione nga një grup. Vlera e një kutie normale kontrolli është \"E vërtetë\" ose \"E gabuar\" dhe vlera e një kutie zgjedhjeje me tre gjendje mund të jetë edhe \"Zero\".", "settingsButtonLabel": "Cilësimet", "demoListsTitle": "Listat", "demoListsSubtitle": "Lëvizja e strukturave të listës", "demoListsDescription": "Një rresht i njëfishtë me lartësi fikse që përmban normalisht tekst si edhe një ikonë pararendëse ose vijuese.", "demoOneLineListsTitle": "Një rresht", "demoTwoLineListsTitle": "Dy rreshta", "demoListsSecondary": "Teksti dytësor", "demoSelectionControlsTitle": "Kontrollet e përzgjedhjes", "craneFly7SemanticLabel": "Mali Rushmore", "demoSelectionControlsCheckboxTitle": "Kutia e zgjedhjes", "craneSleep3SemanticLabel": "Burrë i mbështetur te një makinë antike blu", "demoSelectionControlsRadioTitle": "Radio", "demoSelectionControlsRadioDescription": "Butonat e radios e lejojnë përdoruesin të zgjedhë një opsion nga një grup. Përdor butonat e radios për përzgjedhje ekskluzive nëse mendon se përdoruesi ka nevojë të shikojë të gjitha opsionet e disponueshme përkrah njëri-tjetrit.", "demoSelectionControlsSwitchTitle": "Çelës", "demoSelectionControlsSwitchDescription": "Çelësat e ndezjes/fikjes aktivizojnë/çaktivizojnë gjendjen e një opsioni të vetëm cilësimesh. Opsioni që kontrollon çelësi, si edhe gjendja në të cilën është, duhet të bëhet e qartë nga etiketa korresponduese brenda faqes.", "craneFly0SemanticLabel": "Shtëpi alpine në një peizazh me borë me pemë të gjelbëruara", "craneFly1SemanticLabel": "Tendë në fushë", "craneFly2SemanticLabel": "Flamuj lutjesh përpara një mali me borë", "craneFly6SemanticLabel": "Pamje nga ajri e Palacio de Bellas Artes", "rallySeeAllAccounts": "Shiko të gjitha llogaritë", "rallyBillAmount": "Fatura {billName} me afat {date} për {amount}.", "shrineTooltipCloseCart": "Mbyll karrocën", "shrineTooltipCloseMenu": "Mbyll menynë", "shrineTooltipOpenMenu": "Hap menynë", "shrineTooltipSettings": "Cilësimet", "shrineTooltipSearch": "Kërko", "demoTabsDescription": "Skedat i organizojnë përmbajtjet në ekrane të ndryshme, grupime të dhënash dhe ndërveprime të tjera.", "demoTabsSubtitle": "Skedat me pamje që mund të lëvizen në mënyrë të pavarur", "demoTabsTitle": "Skedat", "rallyBudgetAmount": "Buxheti {budgetName} me {amountUsed} të përdorura nga {amountTotal}, {amountLeft} të mbetura", "shrineTooltipRemoveItem": "Hiq artikullin", "rallyAccountAmount": "Llogaria {accountName} {accountNumber} me {amount}.", "rallySeeAllBudgets": "Shiko të gjitha buxhetet", "rallySeeAllBills": "Shiko të gjitha faturat", "craneFormDate": "Zgjidh datën", "craneFormOrigin": "Zgjidh origjinën", "craneFly2": "Lugina Khumbu, Nepal", "craneFly3": "Maçu Piçu, Peru", "craneFly4": "Malé, Maldives", "craneFly5": "Vitznau, Zvicër", "craneFly6": "Meksiko, Meksikë", "craneFly7": "Mali Rushmore, Shtetet e Bashkuara", "settingsTextDirectionLocaleBased": "Bazuar në cilësimet lokale", "craneFly9": "Havanë, Kubë", "craneFly10": "Kajro, Egjipt", "craneFly11": "Lisbonë, Portugali", "craneFly12": "Napa, Shtetet e Bashkuara", "craneFly13": "Bali, Indonezi", "craneSleep0": "Malé, Maldives", "craneSleep1": "Aspen, United States", "craneSleep2": "Maçu Piçu, Peru", "demoCupertinoSegmentedControlTitle": "Kontrolli i segmentuar", "craneSleep4": "Vitznau, Zvicër", "craneSleep5": "Big Sur, Shtetet e Bashkuara", "craneSleep6": "Napa, Shtetet e Bashkuara", "craneSleep7": "Porto, Portugali", "craneSleep8": "Tulum, Meksikë", "craneEat5": "Seul, Koreja e Jugut", "demoChipTitle": "Çipet", "demoChipSubtitle": "Elemente kompakte që paraqesin një hyrje, atribut ose veprim", "demoActionChipTitle": "Çipi i veprimit", "demoActionChipDescription": "Çipet e veprimit janë një grupim opsionesh që aktivizojnë një veprim që lidhet me përmbajtjen kryesore. Çipet e veprimit duhet të shfaqen në mënyrë dinamike dhe kontekstuale në një ndërfaqe përdoruesi.", "demoChoiceChipTitle": "Çipi i zgjedhjes", "demoChoiceChipDescription": "Çipet e zgjedhjes paraqesin një zgjedhje të vetme nga një grupim. Çipet e zgjedhjes përmbajnë tekst ose kategori të lidhura përshkruese.", "demoFilterChipTitle": "Çipi i filtrit", "demoFilterChipDescription": "Çipet e filtrit përdorin etiketime ose fjalë përshkruese si mënyrë për të filtruar përmbajtjen.", "demoInputChipTitle": "Çipi i hyrjes", "demoInputChipDescription": "Çipet e hyrjes përfaqësojnë një pjesë komplekse informacioni, si p.sh. një entitet (person, vend ose send) ose tekst bisedor, në formë kompakte.", "craneSleep9": "Lisbonë, Portugali", "craneEat10": "Lisbonë, Portugali", "demoCupertinoSegmentedControlDescription": "Përdoret për të zgjedhur nga një numër opsionesh ekskluzive në mënyrë reciproke. Kur zgjidhet një opsion në kontrollin e segmentuar, zgjedhja e opsioneve të tjera në kontrollin e segmentuar ndalon.", "chipTurnOnLights": "Ndiz dritat", "chipSmall": "I vogël", "chipMedium": "Mesatar", "chipLarge": "I madh", "chipElevator": "Ashensor", "chipWasher": "Lavatriçe", "chipFireplace": "Oxhak", "chipBiking": "Me biçikletë", "craneFormDiners": "Restorante", "rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{Rrit nivelin e mundshëm të zbritjes nga taksat! Cakto kategoritë për 1 transaksion të pacaktuar.}other{Rrit nivelin e mundshëm të zbritjes nga taksat! Cakto kategoritë për {count} transaksione të pacaktuara.}}", "craneFormTime": "Zgjidh orën", "craneFormLocation": "Zgjidh vendndodhjen", "craneFormTravelers": "Udhëtarët", "craneEat8": "Atlanta, Shtetet e Bashkuara", "craneFormDestination": "Zgjidh destinacionin", "craneFormDates": "Zgjidh datat", "craneFly": "FLUTURIM", "craneSleep": "GJUMI", "craneEat": "NGRËNIE", "craneFlySubhead": "Eksploro fluturimet sipas destinacionit", "craneSleepSubhead": "Eksploro pronat sipas destinacionit", "craneEatSubhead": "Eksploro restorantet sipas destinacionit", "craneFlyStops": "{numberOfStops,plural,=0{Pa ndalesa}=1{1 ndalesë}other{{numberOfStops} ndalesa}}", "craneSleepProperties": "{totalProperties,plural,=0{Nuk ka prona të disponueshme}=1{1 pronë e disponueshme}other{{totalProperties} prona të disponueshme}}", "craneEatRestaurants": "{totalRestaurants,plural,=0{Asnjë restorant}=1{1 restorant}other{{totalRestaurants} restorante}}", "craneFly0": "Aspen, United States", "demoCupertinoSegmentedControlSubtitle": "Kontrolli i segmentuar në stilin e iOS", "craneSleep10": "Kajro, Egjipt", "craneEat9": "Madrid, Spanjë", "craneFly1": "Big Sur, Shtetet e Bashkuara", "craneEat7": "Nashvill, Shtetet e Bashkuara", "craneEat6": "Siatëll, Shtetet e Bashkuara", "craneFly8": "Singapor", "craneEat4": "Paris, Francë", "craneEat3": "Portland, Shtetet e Bashkuara", "craneEat2": "Kordoba, Argjentinë", "craneEat1": "Dallas, Shtetet e Bashkuara", "craneEat0": "Napoli, Itali", "craneSleep11": "Taipei, Tajvan", "craneSleep3": "Havanë, Kubë", "shrineLogoutButtonCaption": "DIL", "rallyTitleBills": "FATURAT", "rallyTitleAccounts": "LLOGARITË", "shrineProductVagabondSack": "Çantë model \"vagabond\"", "rallyAccountDetailDataInterestYtd": "Interesi vjetor deri më sot", "shrineProductWhitneyBelt": "Rrip Whitney", "shrineProductGardenStrand": "Gardh kopshti", "shrineProductStrutEarrings": "Vathë Strut", "shrineProductVarsitySocks": "Çorape sportive", "shrineProductWeaveKeyring": "Mbajtëse çelësash e thurur", "shrineProductGatsbyHat": "Kapelë Gatsby", "shrineProductShrugBag": "Çantë pazari", "shrineProductGiltDeskTrio": "Set me tri tavolina", "shrineProductCopperWireRack": "Rafti prej bakri", "shrineProductSootheCeramicSet": "Set qeramike për zbutje", "shrineProductHurrahsTeaSet": "Set çaji Hurrahs", "shrineProductBlueStoneMug": "Filxhan blu prej guri", "shrineProductRainwaterTray": "Tabaka për ujin e shiut", "shrineProductChambrayNapkins": "Shami Chambray", "shrineProductSucculentPlanters": "Bimë mishtore", "shrineProductQuartetTable": "Set me katër tavolina", "shrineProductKitchenQuattro": "Kuzhinë quattro", "shrineProductClaySweater": "Triko ngjyrë balte", "shrineProductSeaTunic": "Tunikë plazhi", "shrineProductPlasterTunic": "Tunikë allçie", "rallyBudgetCategoryRestaurants": "Restorantet", "shrineProductChambrayShirt": "Këmishë Chambray", "shrineProductSeabreezeSweater": "Triko e hollë", "shrineProductGentryJacket": "Xhaketë serioze", "shrineProductNavyTrousers": "Pantallona blu", "shrineProductWalterHenleyWhite": "Walter Henley (e bardhë)", "shrineProductSurfAndPerfShirt": "Këmishë sërfi", "shrineProductGingerScarf": "Shall ngjyrë xhenxhefili", "shrineProductRamonaCrossover": "Crossover-i i Ramona-s", "shrineProductClassicWhiteCollar": "Jakë e bardhë klasike", "shrineProductSunshirtDress": "Fustan veror", "rallyAccountDetailDataInterestRate": "Norma e interesit", "rallyAccountDetailDataAnnualPercentageYield": "Rendimenti vjetor në përqindje", "rallyAccountDataVacation": "Pushime", "shrineProductFineLinesTee": "Bluzë me vija të holla", "rallyAccountDataHomeSavings": "Kursimet për shtëpinë", "rallyAccountDataChecking": "Rrjedhëse", "rallyAccountDetailDataInterestPaidLastYear": "Interesi i paguar vitin e kaluar", "rallyAccountDetailDataNextStatement": "Pasqyra e ardhshme", "rallyAccountDetailDataAccountOwner": "Zotëruesi i llogarisë", "rallyBudgetCategoryCoffeeShops": "Bar-kafe", "rallyBudgetCategoryGroceries": "Ushqimore", "shrineProductCeriseScallopTee": "Bluzë e kuqe e errët me fund të harkuar", "rallyBudgetCategoryClothing": "Veshje", "rallySettingsManageAccounts": "Menaxho llogaritë", "rallyAccountDataCarSavings": "Kursimet për makinë", "rallySettingsTaxDocuments": "Dokumentet e taksave", "rallySettingsPasscodeAndTouchId": "Kodi i kalimit dhe Touch ID", "rallySettingsNotifications": "Njoftimet", "rallySettingsPersonalInformation": "Të dhënat personale", "rallySettingsPaperlessSettings": "Cilësimet e faturës elektronike", "rallySettingsFindAtms": "Gjej bankomate", "rallySettingsHelp": "Ndihma", "rallySettingsSignOut": "Dil", "rallyAccountTotal": "Totali", "rallyBillsDue": "Afati", "rallyBudgetLeft": "Të mbetura", "rallyAccounts": "Llogaritë", "rallyBills": "Faturat", "rallyBudgets": "Buxhetet", "rallyAlerts": "Sinjalizime", "rallySeeAll": "SHIKOJI TË GJITHË", "rallyFinanceLeft": "TË MBETURA", "rallyTitleOverview": "PËRMBLEDHJE", "shrineProductShoulderRollsTee": "Bluzë me mëngë të përveshura", "shrineNextButtonCaption": "PËRPARA", "rallyTitleBudgets": "BUXHETET", "rallyTitleSettings": "CILËSIMET", "rallyLoginLoginToRally": "Identifikohu në Rally", "rallyLoginNoAccount": "Nuk ke llogari?", "rallyLoginSignUp": "REGJISTROHU", "rallyLoginUsername": "Emri i përdoruesit", "rallyLoginPassword": "Fjalëkalimi", "rallyLoginLabelLogin": "Identifikohu", "rallyLoginRememberMe": "Kujto të dhënat e mia", "rallyLoginButtonLogin": "IDENTIFIKOHU", "rallyAlertsMessageHeadsUpShopping": "Kujdes, ke përdorur {percent} të buxhetit të \"Blerjeve\" për këtë muaj.", "rallyAlertsMessageSpentOnRestaurants": "Ke shpenzuar {amount} në restorante këtë javë.", "rallyAlertsMessageATMFees": "Ke shpenzuar {amount} në tarifa bankomati këtë muaj", "rallyAlertsMessageCheckingAccount": "Të lumtë! Llogaria jote rrjedhëse është {percent} më e lartë se muajin e kaluar.", "shrineMenuCaption": "MENYJA", "shrineCategoryNameAll": "TË GJITHA", "shrineCategoryNameAccessories": "AKSESORË", "shrineCategoryNameClothing": "VESHJE", "shrineCategoryNameHome": "SHTËPIA", "shrineLoginUsernameLabel": "Emri i përdoruesit", "shrineLoginPasswordLabel": "Fjalëkalimi", "shrineCancelButtonCaption": "ANULO", "shrineCartTaxCaption": "Taksa:", "shrineCartPageCaption": "KARROCA", "shrineProductQuantity": "Sasia: {quantity}", "shrineProductPrice": "x {price}", "shrineCartItemCount": "{quantity,plural,=0{ASNJË ARTIKULL}=1{1 ARTIKULL}other{{quantity} ARTIKUJ}}", "shrineCartClearButtonCaption": "PASTRO KARROCËN", "shrineCartTotalCaption": "TOTALI", "shrineCartSubtotalCaption": "Nëntotali:", "shrineCartShippingCaption": "Transporti:", "shrineProductGreySlouchTank": "Kanotiere gri e varur", "shrineProductStellaSunglasses": "Syze Stella", "shrineProductWhitePinstripeShirt": "Këmishë me vija të bardha", "demoTextFieldWhereCanWeReachYou": "Ku mund të të kontaktojmë?", "settingsTextDirectionLTR": "LTR", "settingsTextScalingLarge": "E madhe", "demoBottomSheetHeader": "Koka e faqes", "demoBottomSheetItem": "Artikulli {value}", "demoBottomTextFieldsTitle": "Fushat me tekst", "demoTextFieldTitle": "Fushat me tekst", "demoTextFieldSubtitle": "Një rresht me tekst dhe numra të redaktueshëm", "demoTextFieldDescription": "Fushat me tekst i lejojnë përdoruesit të fusin tekst në një ndërfaqe përdoruesi. Ato normalisht shfaqen në formularë dhe dialogë.", "demoTextFieldShowPasswordLabel": "Shfaq fjalëkalimin", "demoTextFieldHidePasswordLabel": "Fshih fjalëkalimin", "demoTextFieldFormErrors": "Rregullo gabimet me të kuqe përpara se ta dërgosh.", "demoTextFieldNameRequired": "Emri është i nevojshëm.", "demoTextFieldOnlyAlphabeticalChars": "Fut vetëm karaktere alfabetikë.", "demoTextFieldEnterUSPhoneNumber": "(###) ###-#### - Fut një numër telefoni amerikan.", "demoTextFieldEnterPassword": "Fut një fjalëkalim.", "demoTextFieldPasswordsDoNotMatch": "Fjalëkalimet nuk përputhen", "demoTextFieldWhatDoPeopleCallYou": "Si të quajnë?", "demoTextFieldNameField": "Emri*", "demoBottomSheetButtonText": "SHFAQ FLETËN E POSHTME", "demoTextFieldPhoneNumber": "Numri i telefonit*", "demoBottomSheetTitle": "Fleta e poshtme", "demoTextFieldEmail": "Email-i", "demoTextFieldTellUsAboutYourself": "Na trego rreth vetes (p.sh. shkruaj se çfarë bën ose çfarë hobish ke)", "demoTextFieldKeepItShort": "Mbaje të shkurtër, është thjesht demonstrim.", "starterAppGenericButton": "BUTONI", "demoTextFieldLifeStory": "Historia e jetës", "demoTextFieldSalary": "Paga", "demoTextFieldUSD": "USD", "demoTextFieldNoMoreThan": "Jo më shumë se 8 karaktere.", "demoTextFieldPassword": "Fjalëkalimi*", "demoTextFieldRetypePassword": "Shkruaj përsëri fjalëkalimin*", "demoTextFieldSubmit": "DËRGO", "demoBottomNavigationSubtitle": "Navigimi i poshtëm me pamje që shuhen gradualisht", "demoBottomSheetAddLabel": "Shto", "demoBottomSheetModalDescription": "Një fletë e poshtme modale është një alternativë ndaj menysë apo dialogut dhe parandalon që përdoruesi të bashkëveprojë me pjesën tjetër të aplikacionit.", "demoBottomSheetModalTitle": "Fleta e poshtme modale", "demoBottomSheetPersistentDescription": "Një fletë e poshtme e përhershme shfaq informacione që plotësojnë përmbajtjen parësore të aplikacionit. Një fletë e poshtme e përhershme mbetet e dukshme edhe kur përdoruesi bashkëvepron me pjesët e tjera të aplikacionit.", "demoBottomSheetPersistentTitle": "Fletë e poshtme e përhershme", "demoBottomSheetSubtitle": "Fletët e përkohshme dhe modale të poshtme", "demoTextFieldNameHasPhoneNumber": "Numri i telefonit të {name} është {phoneNumber}", "buttonText": "BUTONI", "demoTypographyDescription": "Përkufizimet e stileve të ndryshme tipografike të gjendura në dizajnin e materialit", "demoTypographySubtitle": "Të gjitha stilet e paracaktuara të tekstit", "demoTypographyTitle": "Tipografia", "demoFullscreenDialogDescription": "Karakteristika e fullscreenDialog specifikon nëse faqja hyrëse është dialog modal në ekran të plotë", "demoFlatButtonDescription": "Një buton i rrafshët shfaq një spërkatje me bojë pas shtypjes, por nuk ngrihet. Përdor butonat e rrafshët në shiritat e veglave, dialogët dhe brenda faqes me skemë padding", "demoBottomNavigationDescription": "Shiritat e poshtëm të navigimit shfaqin tre deri në pesë destinacione në fund të një ekrani. Secili destinacion paraqitet nga një ikonë dhe një etiketë opsionale me tekst. Kur trokitet mbi një ikonë navigimi poshtë, përdoruesi dërgohet te destinacioni i navigimit të nivelit të lartë i shoqëruar me atë ikonë.", "demoBottomNavigationSelectedLabel": "Etiketa e zgjedhur", "demoBottomNavigationPersistentLabels": "Etiketat e vazhdueshme", "starterAppDrawerItem": "Artikulli {value}", "demoTextFieldRequiredField": "* tregon fushën e kërkuar", "demoBottomNavigationTitle": "Navigimi poshtë", "settingsLightTheme": "E ndriçuar", "settingsTheme": "Tema", "settingsPlatformIOS": "iOS", "settingsPlatformAndroid": "Android", "settingsTextDirectionRTL": "RTL", "settingsTextScalingHuge": "Shumë i madh", "cupertinoButton": "Butoni", "settingsTextScalingNormal": "Normale", "settingsTextScalingSmall": "I vogël", "settingsSystemDefault": "Sistemi", "settingsTitle": "Cilësimet", "rallyDescription": "Një aplikacion për financat personale", "aboutDialogDescription": "Për të parë kodin burimor për këtë aplikacion, vizito {repoLink}.", "bottomNavigationCommentsTab": "Komente", "starterAppGenericBody": "Trupi", "starterAppGenericHeadline": "Titulli", "starterAppGenericSubtitle": "Nënemërtim", "starterAppGenericTitle": "Titulli", "starterAppTooltipSearch": "Kërko", "starterAppTooltipShare": "Ndaj", "starterAppTooltipFavorite": "Të preferuara", "starterAppTooltipAdd": "Shto", "bottomNavigationCalendarTab": "Kalendari", "starterAppDescription": "Strukturë reaguese për aplikacionin nisës", "starterAppTitle": "Aplikacion nisës", "aboutFlutterSamplesRepo": "Depozita GitHub e kampioneve të Flutter", "bottomNavigationContentPlaceholder": "Vendmbajtësi për skedën {title}", "bottomNavigationCameraTab": "Kamera", "bottomNavigationAlarmTab": "Alarmi", "bottomNavigationAccountTab": "Llogaria", "demoTextFieldYourEmailAddress": "Adresa jote e email-it", "demoToggleButtonDescription": "Butonat e ndërrimit mund të përdoren për të grupuar opsionet e përafërta. Për të theksuar grupet e butonave të përafërt të ndërrimit, një grup duhet të ndajë një mbajtës të përbashkët", "colorsGrey": "GRI", "colorsBrown": "KAFE", "colorsDeepOrange": "PORTOKALLI E THELLË", "colorsOrange": "PORTOKALLI", "colorsAmber": "E VERDHË PORTOKALLI", "colorsYellow": "E VERDHË", "colorsLime": "LIMONI", "colorsLightGreen": "E GJELBËR E ÇELUR", "colorsGreen": "E GJELBËR", "homeHeaderGallery": "Galeria", "homeHeaderCategories": "Kategoritë", "shrineDescription": "Një aplikacion blerjesh në modë", "craneDescription": "Një aplikacion i personalizuar për udhëtimin", "homeCategoryReference": "STILET DHE TË TJERA", "demoInvalidURL": "URL-ja nuk mund të shfaqej:", "demoOptionsTooltip": "Opsionet", "demoInfoTooltip": "Informacione", "demoCodeTooltip": "Kodi i demonstrimit", "demoDocumentationTooltip": "Dokumentacioni i API-t", "demoFullscreenTooltip": "Ekran i plotë", "settingsTextScaling": "Shkallëzimi i tekstit", "settingsTextDirection": "Drejtimi i tekstit", "settingsLocale": "Gjuha e përdorimit", "settingsPlatformMechanics": "Mekanika e platformës", "settingsDarkTheme": "E errët", "settingsSlowMotion": "Lëvizje e ngadaltë", "settingsAbout": "Rreth galerisë së Flutter", "settingsFeedback": "Dërgo koment", "settingsAttribution": "Projektuar nga TOASTER në Londër", "demoButtonTitle": "Butonat", "demoButtonSubtitle": "Tekst, i ngritur, me kontur etj.", "demoFlatButtonTitle": "Butoni i rrafshët", "demoRaisedButtonDescription": "Butonat e ngritur u shtojnë dimension kryesisht strukturave të rrafshëta. Ata theksojnë funksionet në hapësirat e gjera ose me trafik.", "demoRaisedButtonTitle": "Butoni i ngritur", "demoOutlineButtonTitle": "Buton me kontur", "demoOutlineButtonDescription": "Butonat me kontur bëhen gjysmë të tejdukshëm dhe ngrihen kur shtypen. Shpesh ata çiftohen me butonat e ngritur për të treguar një veprim alternativ dytësor.", "demoToggleButtonTitle": "Butonat e ndërrimit", "colorsTeal": "GURKALI", "demoFloatingButtonTitle": "Butoni pluskues i veprimit", "demoFloatingButtonDescription": "Një buton pluskues veprimi është një buton me ikonë rrethore që lëviz mbi përmbajtjen për të promovuar një veprim parësor në aplikacion.", "demoDialogTitle": "Dialogët", "demoDialogSubtitle": "I thjeshtë, sinjalizim dhe ekran i plotë", "demoAlertDialogTitle": "Sinjalizim", "demoAlertDialogDescription": "Një dialog sinjalizues informon përdoruesin rreth situatave që kërkojnë konfirmim. Një dialog sinjalizues ka një titull opsional dhe një listë opsionale veprimesh.", "demoAlertTitleDialogTitle": "Sinjalizo me titullin", "demoSimpleDialogTitle": "I thjeshtë", "demoSimpleDialogDescription": "Një dialog i thjeshtë i ofron përdoruesit një zgjedhje mes disa opsionesh. Një dialog i thjeshtë ka një titull opsional që afishohet mbi zgjedhjet.", "demoFullscreenDialogTitle": "Ekrani i plotë", "demoCupertinoButtonsTitle": "Butonat", "demoCupertinoButtonsSubtitle": "Butonat në stilin e iOS", "demoCupertinoButtonsDescription": "Një buton në stilin e iOS. Përfshin tekstin dhe/ose një ikonë që zhduket dhe shfaqet gradualisht kur e prek. Si opsion mund të ketë sfond.", "demoCupertinoAlertsTitle": "Sinjalizime", "demoCupertinoAlertsSubtitle": "Dialogë sinjalizimi në stilin e iOS", "demoCupertinoAlertTitle": "Sinjalizim", "demoCupertinoAlertDescription": "Një dialog sinjalizues informon përdoruesin rreth situatave që kërkojnë konfirmim. Një dialog sinjalizimi ka një titull opsional, përmbajtje opsionale dhe një listë opsionale veprimesh. Titulli shfaqet mbi përmbajtje dhe veprimet shfaqen poshtë përmbajtjes.", "demoCupertinoAlertWithTitleTitle": "Sinjalizo me titullin", "demoCupertinoAlertButtonsTitle": "Sinjalizimi me butonat", "demoCupertinoAlertButtonsOnlyTitle": "Vetëm butonat e sinjalizimit", "demoCupertinoActionSheetTitle": "Fleta e veprimit", "demoCupertinoActionSheetDescription": "Një fletë veprimesh është një stil specifik sinjalizimi që e përball përdoruesin me një set prej dy ose më shumë zgjedhjesh që lidhen me kontekstin aktual. Një fletë veprimesh mund të ketë një titull, një mesazh shtesë dhe një listë veprimesh.", "demoColorsTitle": "Ngjyrat", "demoColorsSubtitle": "Të gjitha ngjyrat e paracaktuara", "demoColorsDescription": "Konstantet e ngjyrave dhe demonstrimeve të ngjyrave që paraqesin paletën e ngjyrave të dizajnit të materialit.", "buttonTextEnabled": "ENABLED", "buttonTextDisabled": "DISABLED", "buttonTextCreate": "Krijo", "dialogSelectedOption": "Zgjodhe: \"{value}\"", "dialogDiscardTitle": "Të hidhet poshtë drafti?", "dialogLocationTitle": "Të përdoret shërbimi \"Vendndodhjet Google\"?", "dialogLocationDescription": "Lejo Google të ndihmojë aplikacionet që të përcaktojnë vendndodhjen. Kjo do të thotë të dërgosh të dhëna te Google edhe kur nuk ka aplikacione në punë.", "dialogCancel": "ANULO", "dialogDiscard": "HIDH POSHTË", "dialogDisagree": "NUK PRANOJ", "dialogAgree": "PRANOJ", "dialogSetBackup": "Cakto llogarinë e rezervimit", "colorsBlueGrey": "GRI NË BLU", "dialogShow": "SHFAQ DIALOGUN", "dialogFullscreenTitle": "Dialogu në ekran të plotë", "dialogFullscreenSave": "RUAJ", "dialogFullscreenDescription": "Një demonstrim dialogu me ekran të plotë", "cupertinoButtonEnabled": "Enabled", "cupertinoButtonDisabled": "Disabled", "cupertinoButtonWithBackground": "Me sfond", "cupertinoAlertCancel": "Anulo", "cupertinoAlertDiscard": "Hidh poshtë", "cupertinoAlertLocationTitle": "Dëshiron të lejosh që \"Maps\" të ketë qasje te vendndodhja jote ndërkohë që je duke përdorur aplikacionin?", "cupertinoAlertLocationDescription": "Vendndodhja jote aktuale do të shfaqet në hartë dhe do të përdoret për udhëzime, rezultate të kërkimeve në afërsi dhe kohën e përafërt të udhëtimit.", "cupertinoAlertAllow": "Lejo", "cupertinoAlertDontAllow": "Mos lejo", "cupertinoAlertFavoriteDessert": "Zgjidh ëmbëlsirën e preferuar", "cupertinoAlertDessertDescription": "Zgjidh llojin tënd të preferuar të ëmbëlsirës nga lista më poshtë. Zgjedhja jote do të përdoret për të personalizuar listën e sugjeruar të restoranteve në zonën tënde.", "cupertinoAlertCheesecake": "Kek bulmeti", "cupertinoAlertTiramisu": "Tiramisu", "cupertinoAlertApplePie": "Ëmbëlsirë me mollë", "cupertinoAlertChocolateBrownie": "Ëmbëlsirë me çokollatë", "cupertinoShowAlert": "Shfaq sinjalizimin", "colorsRed": "I KUQ", "colorsPink": "ROZË", "colorsPurple": "VJOLLCË", "colorsDeepPurple": "E PURPURT E THELLË", "colorsIndigo": "INDIGO", "colorsBlue": "BLU", "colorsLightBlue": "BLU E ÇELUR", "colorsCyan": "I KALTËR", "dialogAddAccount": "Shto llogari", "Gallery": "Galeria", "Categories": "Kategoritë", "SHRINE": "SHRINE", "Basic shopping app": "Aplikacion bazë për blerje", "RALLY": "RALLY", "CRANE": "CRANE", "Travel app": "Aplikacion udhëtimi", "MATERIAL": "MATERIAL", "CUPERTINO": "CUPERTINO", "REFERENCE STYLES & MEDIA": "STILE REFERENCE DHE MEDIA" }
gallery/lib/l10n/intl_sq.arb/0
{ "file_path": "gallery/lib/l10n/intl_sq.arb", "repo_id": "gallery", "token_count": 22804 }
801
{ "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": "A-Z", "demoSharedYAxisAlbumCount": "268 張專輯", "demoSharedYAxisTitle": "共用 Y 軸", "demoSharedXAxisCreateAccountButtonText": "建立帳戶", "demoFadeScaleAlertDialogDiscardButton": "捨棄", "demoSharedXAxisSignInTextFieldLabel": "電郵地址或電話號碼", "demoSharedXAxisSignInSubtitleText": "使用您的帳戶登入", "demoSharedXAxisSignInWelcomeText": "David Park,您好", "demoSharedXAxisIndividualCourseSubtitle": "分別顯示", "demoSharedXAxisBundledCourseSubtitle": "組合", "demoFadeThroughAlbumsDestination": "專輯", "demoSharedXAxisDesignCourseTitle": "設計", "demoSharedXAxisIllustrationCourseTitle": "插圖", "demoSharedXAxisBusinessCourseTitle": "商業", "demoSharedXAxisArtsAndCraftsCourseTitle": "藝術與手工藝", "demoMotionPlaceholderSubtitle": "次行文字", "demoFadeScaleAlertDialogCancelButton": "取消", "demoFadeScaleAlertDialogHeader": "警示對話框", "demoFadeScaleHideFabButton": "隱藏懸浮動作", "demoFadeScaleShowFabButton": "顯示懸浮動作", "demoFadeScaleShowAlertDialogButton": "顯示模態框", "demoFadeScaleDescription": "淡出模式用於進入或離開螢幕範圍的使用者介面元素,如在螢幕正中淡入的對話框。", "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": "Stocks", "rallyBillDetailTotalAmount": "總金額", "demoCupertinoPickerDateTime": "日期和時間", "signIn": "登入", "dataTableRowWithSugar": "{value} 伴糖", "dataTableRowApplePie": "蘋果批", "dataTableRowDonut": "冬甩", "dataTableRowHoneycomb": "蜂窩糖", "dataTableRowLollipop": "波板糖", "dataTableRowJellyBean": "啫喱豆", "dataTableRowGingerbread": "薑餅", "dataTableRowCupcake": "杯子蛋糕", "dataTableRowEclair": "法式泡芙", "dataTableRowIceCreamSandwich": "雪糕三文治", "dataTableRowFrozenYogurt": "乳酪雪糕", "dataTableColumnIron": "鐵 (%)", "dataTableColumnCalcium": "鈣 (%)", "dataTableColumnSodium": "鈉 (毫克)", "demoTimePickerTitle": "時間點選器", "demo2dTransformationsResetTooltip": "重設變形", "dataTableColumnFat": "脂肪 (克)", "dataTableColumnCalories": "卡路里", "dataTableColumnDessert": "甜品 (1 人份量)", "cardsDemoTravelDestinationLocation1": "泰米爾納德邦坦賈武爾", "demoTimePickerDescription": "顯示載有 Material Design 時間點選器的對話框。", "demoPickersShowPicker": "顯示點選器", "demoTabsScrollingTitle": "可捲動", "demoTabsNonScrollingTitle": "不可捲動", "craneHours": "{hours,plural,=1{1h}other{{hours}h}}", "craneMinutes": "{minutes,plural,=1{1m}other{{minutes}m}}", "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": "在底部應用程式列中,您可存取底部導覽列和最多 4 個動作,包括懸浮動作按鈕。", "bottomAppBarNotch": "凹口", "bottomAppBarPosition": "懸浮動作按鈕位置", "bottomAppBarPositionDockedEnd": "已固定 - 末端", "bottomAppBarPositionDockedCenter": "已固定 - 中間", "bottomAppBarPositionFloatingEnd": "懸浮 - 末端", "bottomAppBarPositionFloatingCenter": "懸浮 - 中間", "demoSlidersEditableNumericalValue": "可編輯的數值", "demoGridListsSubtitle": "列和欄的版面配置", "demoGridListsDescription": "格狀清單最適合用於展示同類資料,通常為圖片。格狀清單中的每個項目稱為圖塊。", "demoGridListsImageOnlyTitle": "只限圖片", "demoGridListsHeaderTitle": "設有頁首", "demoGridListsFooterTitle": "設有頁尾", "demoSlidersTitle": "滑桿", "demoSlidersSubtitle": "滑動來選擇值的小工具", "demoSlidersDescription": "滑桿上列有特定範圍內的值,使用者可選擇其中一個值。滑桿最適合用來調整設定,例如調校音量或光暗,以及套用圖片濾鏡。", "demoRangeSlidersTitle": "範圍滑桿", "demoRangeSlidersDescription": "滑桿上列有特定範圍內的值,兩端可用圖示來代表不同的值。滑桿最適合用來調整設定,例如調校音量或光暗,以及套用圖片濾鏡。", "demoMenuAnItemWithAContextMenuButton": "設有內容選單的項目", "demoCustomSlidersDescription": "滑桿上列有特定範圍內的值,使用者可選擇其中一個值或某範圍的值。您可選擇滑桿的設計主題,亦可加以自訂。", "demoSlidersContinuousWithEditableNumericalValue": "可編輯的連續數值", "demoSlidersDiscrete": "不連續", "demoSlidersDiscreteSliderWithCustomTheme": "自訂主題的不連續滑桿", "demoSlidersContinuousRangeSliderWithCustomTheme": "自訂主題的連續範圍滑桿", "demoSlidersContinuous": "連續", "placePondicherry": "本地治里", "demoMenuTitle": "選單", "demoContextMenuTitle": "內容選單", "demoSectionedMenuTitle": "分類選單", "demoSimpleMenuTitle": "簡單選單", "demoChecklistMenuTitle": "檢查清單選單", "demoMenuSubtitle": "選單按鈕和簡單選單", "demoMenuDescription": "選單會在臨時界面中顯示選項清單,並會在使用者與按鈕、操作或其他控制項互動時出現。", "demoMenuItemValueOne": "第一個選單項目", "demoMenuItemValueTwo": "第二個選單項目", "demoMenuItemValueThree": "第三個選單項目", "demoMenuOne": "一", "demoMenuTwo": "二", "demoMenuThree": "三", "demoMenuContextMenuItemThree": "第三個內容選單項目", "demoCupertinoSwitchSubtitle": "iOS 樣式開關", "demoSnackbarsText": "這是資訊列。", "demoCupertinoSliderSubtitle": "iOS 樣式滑桿", "demoCupertinoSliderDescription": "滑桿可以用來選擇連續或間續數值。", "demoCupertinoSliderContinuous": "連續:{value}", "demoCupertinoSliderDiscrete": "間續:{value}", "demoSnackbarsAction": "您已按下資訊列動作。", "backToGallery": "返回圖片庫", "demoCupertinoTabBarTitle": "標籤列", "demoCupertinoSwitchDescription": "開關可以用來切換個別設定的開關狀態。", "demoSnackbarsActionButtonLabel": "動作", "cupertinoTabBarProfileTab": "個人檔案", "demoSnackbarsButtonLabel": "顯示資訊列", "demoSnackbarsDescription": "資訊列會通知使用者有關應用程式已執行或將會執行的程序。它們會在螢幕底部短暫出現,並不會干擾使用者體驗,同時無需使用者輸入任何指令便會消失。", "demoSnackbarsSubtitle": "資訊列會在螢幕底部顯示訊息", "demoSnackbarsTitle": "資訊列", "demoCupertinoSliderTitle": "滑桿", "cupertinoTabBarChatTab": "即時通訊", "cupertinoTabBarHomeTab": "首頁", "demoCupertinoTabBarDescription": "iOS 樣式底部導覽分頁列。顯示多個分頁,其中一個為使用中 (預設為第一個分頁)。", "demoCupertinoTabBarSubtitle": "iOS 樣式底部分頁列", "demoOptionsFeatureTitle": "查看選項", "demoOptionsFeatureDescription": "輕按這裡即可查看此示範的可用選項。", "demoCodeViewerCopyAll": "全部複製", "shrineScreenReaderRemoveProductButton": "移除{product}", "shrineScreenReaderProductAddToCart": "加入購物車", "shrineScreenReaderCart": "{quantity,plural,=0{購物車,冇產品}=1{購物車,1 件產品}other{購物車,{quantity} 件產品}}", "demoCodeViewerFailedToCopyToClipboardMessage": "無法複製到剪貼簿:{error}", "demoCodeViewerCopiedToClipboardMessage": "已複製到剪貼簿。", "craneSleep8SemanticLabel": "座落在懸崖上遙望海灘的馬雅遺跡", "craneSleep4SemanticLabel": "背山而建的湖邊酒店", "craneSleep2SemanticLabel": "古城馬丘比丘", "craneSleep1SemanticLabel": "雪地中的小木屋和長青樹", "craneSleep0SemanticLabel": "水上小屋", "craneFly13SemanticLabel": "樹影婆娑的海邊泳池", "craneFly12SemanticLabel": "樹影婆娑的泳池", "craneFly11SemanticLabel": "海上的磚燈塔", "craneFly10SemanticLabel": "夕陽下的愛資哈爾清真寺", "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}帳單於 {date} 到期,金額為 {amount}。", "shrineTooltipCloseCart": "閂埋購物車", "shrineTooltipCloseMenu": "閂埋選單", "shrineTooltipOpenMenu": "打開選單", "shrineTooltipSettings": "設定", "shrineTooltipSearch": "搜尋", "demoTabsDescription": "分頁可整理不同畫面、資料集及其他互動的內容。", "demoTabsSubtitle": "可獨立捲動檢視的分頁", "demoTabsTitle": "分頁", "rallyBudgetAmount": "{budgetName}財務預算已使用 {amountTotal} 中的 {amountUsed},尚餘 {amountLeft}", "shrineTooltipRemoveItem": "移除項目", "rallyAccountAmount": "{accountName}帳戶 ({accountNumber}) 存入 {amount}。", "rallySeeAllBudgets": "查看所有財務預算", "rallySeeAllBills": "查看所有帳單", "craneFormDate": "選取日期", "craneFormOrigin": "選取出發點", "craneFly2": "尼泊爾坤布山谷", "craneFly3": "秘魯馬丘比丘", "craneFly4": "馬爾代夫馬累", "craneFly5": "瑞士維茨瑙", "craneFly6": "墨西哥墨西哥城", "craneFly7": "美國拉什莫爾山", "settingsTextDirectionLocaleBased": "根據語言代碼設定", "craneFly9": "古巴哈瓦那", "craneFly10": "埃及開羅", "craneFly11": "葡萄牙里斯本", "craneFly12": "美國納帕", "craneFly13": "印尼峇里", "craneSleep0": "馬爾代夫馬累", "craneSleep1": "美國阿斯彭", "craneSleep2": "秘魯馬丘比丘", "demoCupertinoSegmentedControlTitle": "劃分控制", "craneSleep4": "瑞士維茨瑙", "craneSleep5": "美國大蘇爾", "craneSleep6": "美國納帕", "craneSleep7": "葡萄牙波多", "craneSleep8": "墨西哥圖盧姆", "craneEat5": "南韓首爾", "demoChipTitle": "方塊", "demoChipSubtitle": "顯示輸入內容、屬性或動作的精簡元素", "demoActionChipTitle": "動作方塊", "demoActionChipDescription": "動作方塊列出一組選項,可觸發與主要內容相關的動作。動作方塊應在使用者介面上以動態和與內容相關的方式顯示。", "demoChoiceChipTitle": "選擇方塊", "demoChoiceChipDescription": "選擇方塊從一組選項中顯示單一選項。選擇方塊載有相關的說明文字或類別。", "demoFilterChipTitle": "篩選器方塊", "demoFilterChipDescription": "篩選器方塊使用標籤或說明文字篩選內容。", "demoInputChipTitle": "輸入方塊", "demoInputChipDescription": "輸入方塊以精簡的形式顯示複雜的資訊,如實體 (人物、地點或事物) 或對話文字。", "craneSleep9": "葡萄牙里斯本", "craneEat10": "葡萄牙里斯本", "demoCupertinoSegmentedControlDescription": "用以在多個互相排斥的選項之間進行選擇。選擇了劃分控制的其中一個選項後,便將無法選擇其他劃分控制選項。", "chipTurnOnLights": "開燈", "chipSmall": "小", "chipMedium": "中", "chipLarge": "大", "chipElevator": "電梯", "chipWasher": "洗衣機", "chipFireplace": "壁爐", "chipBiking": "踏單車", "craneFormDiners": "用餐人數", "rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{增加您可能獲得的稅務減免!為 1 個未指定的交易指定類別。}other{增加您可能獲得的稅務減免!為 {count} 個未指定的交易指定類別。}}", "craneFormTime": "選取時間", "craneFormLocation": "選取位置", "craneFormTravelers": "旅客人數", "craneEat8": "美國亞特蘭大", "craneFormDestination": "選取目的地", "craneFormDates": "選取日期", "craneFly": "航班", "craneSleep": "過夜", "craneEat": "食肆", "craneFlySubhead": "根據目的地探索航班", "craneSleepSubhead": "根據目的地探索住宿", "craneEatSubhead": "根據目的地探尋餐廳", "craneFlyStops": "{numberOfStops,plural,=0{直航}=1{1 個中轉站}other{{numberOfStops} 個中轉站}}", "craneSleepProperties": "{totalProperties,plural,=0{沒有住宿}=1{1 個可短租的住宿}other{{totalProperties} 個可短租的住宿}}", "craneEatRestaurants": "{totalRestaurants,plural,=0{沒有餐廳}=1{1 間餐廳}other{{totalRestaurants} 間餐廳}}", "craneFly0": "美國阿斯彭", "demoCupertinoSegmentedControlSubtitle": "iOS 樣式的劃分控制", "craneSleep10": "埃及開羅", "craneEat9": "西班牙馬德里", "craneFly1": "美國大蘇爾", "craneEat7": "美國納什維爾", "craneEat6": "美國西雅圖", "craneFly8": "新加坡", "craneEat4": "法國巴黎", "craneEat3": "美國波特蘭", "craneEat2": "阿根廷科爾多瓦", "craneEat1": "美國達拉斯", "craneEat0": "意大利那不勒斯", "craneSleep11": "台灣台北", "craneSleep3": "古巴哈瓦那", "shrineLogoutButtonCaption": "登出", "rallyTitleBills": "帳單", "rallyTitleAccounts": "帳戶", "shrineProductVagabondSack": "Vagabond 背囊", "rallyAccountDetailDataInterestYtd": "年初至今利息", "shrineProductWhitneyBelt": "Whitney 腰帶", "shrineProductGardenStrand": "園藝繩索", "shrineProductStrutEarrings": "Strut 耳環", "shrineProductVarsitySocks": "校園風襪子", "shrineProductWeaveKeyring": "編織鑰匙扣", "shrineProductGatsbyHat": "報童帽", "shrineProductShrugBag": "單肩袋", "shrineProductGiltDeskTrio": "鍍金書桌 3 件裝", "shrineProductCopperWireRack": "銅製儲物架", "shrineProductSootheCeramicSet": "Soothe 瓷器套裝", "shrineProductHurrahsTeaSet": "Hurrahs 茶具套裝", "shrineProductBlueStoneMug": "藍色石製咖啡杯", "shrineProductRainwaterTray": "雨水盤", "shrineProductChambrayNapkins": "水手布餐巾", "shrineProductSucculentPlanters": "多肉植物盆栽", "shrineProductQuartetTable": "4 座位桌子", "shrineProductKitchenQuattro": "廚房用品 4 件裝", "shrineProductClaySweater": "淺啡色毛衣", "shrineProductSeaTunic": "海藍色長袍", "shrineProductPlasterTunic": "灰色長袍", "rallyBudgetCategoryRestaurants": "餐廳", "shrineProductChambrayShirt": "水手布恤衫", "shrineProductSeabreezeSweater": "海藍色毛衣", "shrineProductGentryJacket": "紳士風格外套", "shrineProductNavyTrousers": "軍藍色長褲", "shrineProductWalterHenleyWhite": "Walter 亨利衫 (白色)", "shrineProductSurfAndPerfShirt": "Surf and perf 恤衫", "shrineProductGingerScarf": "橙褐色圍巾", "shrineProductRamonaCrossover": "與 Ramona 跨界合作", "shrineProductClassicWhiteCollar": "經典白領上衣", "shrineProductSunshirtDress": "防曬長裙", "rallyAccountDetailDataInterestRate": "利率", "rallyAccountDetailDataAnnualPercentageYield": "每年收益率", "rallyAccountDataVacation": "度假", "shrineProductFineLinesTee": "幼紋 T 恤", "rallyAccountDataHomeSavings": "家庭儲蓄", "rallyAccountDataChecking": "支票戶口", "rallyAccountDetailDataInterestPaidLastYear": "去年已付利息", "rallyAccountDetailDataNextStatement": "下一張結單", "rallyAccountDetailDataAccountOwner": "帳戶擁有者", "rallyBudgetCategoryCoffeeShops": "咖啡店", "rallyBudgetCategoryGroceries": "雜貨", "shrineProductCeriseScallopTee": "櫻桃色圓擺 T 恤", "rallyBudgetCategoryClothing": "服飾", "rallySettingsManageAccounts": "管理帳戶", "rallyAccountDataCarSavings": "買車儲蓄", "rallySettingsTaxDocuments": "稅務文件", "rallySettingsPasscodeAndTouchId": "密碼及 Touch ID", "rallySettingsNotifications": "通知", "rallySettingsPersonalInformation": "個人資料", "rallySettingsPaperlessSettings": "無紙化設定", "rallySettingsFindAtms": "尋找自動櫃員機", "rallySettingsHelp": "說明", "rallySettingsSignOut": "登出", "rallyAccountTotal": "總計", "rallyBillsDue": "到期", "rallyBudgetLeft": "(餘額)", "rallyAccounts": "帳戶", "rallyBills": "帳單", "rallyBudgets": "預算", "rallyAlerts": "通知", "rallySeeAll": "查看全部", "rallyFinanceLeft": "(餘額)", "rallyTitleOverview": "概覽", "shrineProductShoulderRollsTee": "露膊 T 恤", "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": "在質感設計所定義的不同排版樣式。", "demoTypographySubtitle": "所有預先定義的文字樣式", "demoTypographyTitle": "排版", "demoFullscreenDialogDescription": "您可以利用 fullscreenDialog 屬性指定接下來顯示的頁面是否顯示為全螢幕強制回應對話框", "demoFlatButtonDescription": "平面式按鈕,按下後會出現墨水擴散特效,但不會有升起效果。這類按鈕用於工具列、對話框和設有邊框間距的內嵌元素", "demoBottomNavigationDescription": "底部的導覽列會在螢幕底部顯示 3 至 5 個目的地。每個目的地均以圖示和選擇性的文字標籤標示。當使用者輕按底部導覽列的圖示時,畫面將會顯示與圖示相關的頂層導覽目的地。", "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": "無法顯示網址:", "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": "要允許「Google 地圖」在您使用時存取位置資訊嗎?", "cupertinoAlertLocationDescription": "您的目前位置會在地圖上顯示,並用於路線、附近搜尋結果和預計的行程時間。", "cupertinoAlertAllow": "允許", "cupertinoAlertDontAllow": "不允許", "cupertinoAlertFavoriteDessert": "選取喜愛的甜品", "cupertinoAlertDessertDescription": "請從下方清單中選取您喜愛的甜點類型。系統會根據您的選擇和所在地區,提供個人化的餐廳建議清單。", "cupertinoAlertCheesecake": "芝士蛋糕", "cupertinoAlertTiramisu": "提拉米蘇", "cupertinoAlertApplePie": "蘋果批", "cupertinoAlertChocolateBrownie": "朱古力布朗尼", "cupertinoShowAlert": "顯示通知", "colorsRed": "紅色", "colorsPink": "粉紅色", "colorsPurple": "紫色", "colorsDeepPurple": "深紫色", "colorsIndigo": "靛藍色", "colorsBlue": "藍色", "colorsLightBlue": "淺藍色", "colorsCyan": "青藍色", "dialogAddAccount": "新增帳戶", "Gallery": "相片集", "Categories": "類別", "SHRINE": "神壇", "Basic shopping app": "基本購物應用程式", "RALLY": "拉力賽車", "CRANE": "鶴", "Travel app": "旅遊應用程式", "MATERIAL": "物料", "CUPERTINO": "庫比蒂諾", "REFERENCE STYLES & MEDIA": "參考樣式和媒體" }
gallery/lib/l10n/intl_zh_HK.arb/0
{ "file_path": "gallery/lib/l10n/intl_zh_HK.arb", "repo_id": "gallery", "token_count": 25373 }
802
// Copyright 2019 The Flutter team. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:math'; import 'package:flutter/material.dart'; // Color gradients. const pinkLeft = Color(0xFFFF5983); const pinkRight = Color(0xFFFF8383); const tealLeft = Color(0xFF1CDDC8); const tealRight = Color(0xFF00A5B3); // Dimensions. const unitHeight = 1; const unitWidth = 1; const stickLength = 5 / 9; const stickWidth = 5 / 36; const stickRadius = stickWidth / 2; const knobDiameter = 5 / 54; const knobRadius = knobDiameter / 2; const stickGap = 5 / 54; // Locations. const knobDistanceFromCenter = stickGap / 2 + stickWidth / 2; const lowerKnobCenter = Offset(0, knobDistanceFromCenter); const upperKnobCenter = Offset(0, -knobDistanceFromCenter); const knobDeviation = stickLength / 2 - stickRadius; // Key moments in animation. const _colorKnobContractionBegins = 1 / 23; const _monoKnobExpansionEnds = 11 / 23; const _colorKnobContractionEnds = 14 / 23; // Stages. bool isTransitionPhase(double time) => time < _colorKnobContractionEnds; // Curve easing. const _curve = Curves.easeInOutCubic; double _progress( double time, { required double begin, required double end, }) => _curve.transform(((time - begin) / (end - begin)).clamp(0, 1).toDouble()); double _monoKnobProgress(double time) => _progress( time, begin: 0, end: _monoKnobExpansionEnds, ); double _colorKnobProgress(double time) => _progress( time, begin: _colorKnobContractionBegins, end: _colorKnobContractionEnds, ); double _rotationProgress(double time) => _progress( time, begin: _colorKnobContractionEnds, end: 1, ); // Changing lengths: mono. double monoLength(double time) => _monoKnobProgress(time) * (stickLength - knobDiameter) + knobDiameter; double _monoLengthLeft(double time) => min(monoLength(time) - knobRadius, stickRadius); double _monoLengthRight(double time) => monoLength(time) - _monoLengthLeft(time); double _monoHorizontalOffset(double time) => (_monoLengthRight(time) - _monoLengthLeft(time)) / 2 - knobDeviation; Offset upperMonoOffset(double time) => upperKnobCenter + Offset(_monoHorizontalOffset(time), 0); Offset lowerMonoOffset(double time) => lowerKnobCenter + Offset(-_monoHorizontalOffset(time), 0); // Changing lengths: color. double colorLength(double time) => (1 - _colorKnobProgress(time)) * stickLength; Offset upperColorOffset(double time) => upperKnobCenter + Offset(stickLength / 2 - colorLength(time) / 2, 0); Offset lowerColorOffset(double time) => lowerKnobCenter + Offset(-stickLength / 2 + colorLength(time) / 2, 0); // Moving objects. double knobRotation(double time) => _rotationProgress(time) * pi / 4; Offset knobCenter(double time) { final progress = _rotationProgress(time); if (progress == 0) { return lowerKnobCenter; } else if (progress == 1) { return upperKnobCenter; } else { // Calculates the current location. final center = Offset(knobDistanceFromCenter / tan(pi / 8), 0); final radius = (lowerKnobCenter - center).distance; final angle = pi + (progress - 1 / 2) * pi / 4; return center + Offset.fromDirection(angle, radius); } }
gallery/lib/pages/settings_icon/metrics.dart/0
{ "file_path": "gallery/lib/pages/settings_icon/metrics.dart", "repo_id": "gallery", "token_count": 1143 }
803
// 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/foundation.dart'; import 'package:flutter/material.dart'; class MaterialDemoThemeData { static final themeData = ThemeData( colorScheme: _colorScheme.copyWith( background: Colors.white, ), canvasColor: _colorScheme.background, highlightColor: Colors.transparent, indicatorColor: _colorScheme.onPrimary, scaffoldBackgroundColor: _colorScheme.background, secondaryHeaderColor: _colorScheme.background, typography: Typography.material2018( platform: defaultTargetPlatform, ), visualDensity: VisualDensity.standard, // Component themes appBarTheme: AppBarTheme( color: _colorScheme.primary, iconTheme: IconThemeData(color: _colorScheme.onPrimary), ), bottomAppBarTheme: BottomAppBarTheme( color: _colorScheme.primary, ), checkboxTheme: CheckboxThemeData( fillColor: MaterialStateProperty.resolveWith<Color?>((states) { if (states.contains(MaterialState.disabled)) { return null; } return states.contains(MaterialState.selected) ? _colorScheme.primary : null; }), ), radioTheme: RadioThemeData( fillColor: MaterialStateProperty.resolveWith<Color?>((states) { if (states.contains(MaterialState.disabled)) { return null; } return states.contains(MaterialState.selected) ? _colorScheme.primary : null; }), ), snackBarTheme: const SnackBarThemeData( behavior: SnackBarBehavior.floating, ), switchTheme: SwitchThemeData( thumbColor: MaterialStateProperty.resolveWith<Color?>((states) { if (states.contains(MaterialState.disabled)) { return null; } return states.contains(MaterialState.selected) ? _colorScheme.primary : null; }), trackColor: MaterialStateProperty.resolveWith<Color?>((states) { if (states.contains(MaterialState.disabled)) { return null; } return states.contains(MaterialState.selected) ? _colorScheme.primary.withAlpha(0x80) : null; }), )); static const _colorScheme = ColorScheme( primary: Color(0xFF6200EE), primaryContainer: Color(0xFF6200EE), secondary: Color(0xFFFF5722), secondaryContainer: Color(0xFFFF5722), background: Colors.white, surface: Color(0xFFF2F2F2), onBackground: Colors.black, onSurface: Colors.black, error: Colors.red, onError: Colors.white, onPrimary: Colors.white, onSecondary: Colors.white, brightness: Brightness.light, ); }
gallery/lib/themes/material_demo_theme_data.dart/0
{ "file_path": "gallery/lib/themes/material_demo_theme_data.dart", "repo_id": "gallery", "token_count": 1245 }
804
import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:gallery/data/demos.dart'; import 'package:gallery/main.dart'; import 'package:gallery/pages/demo.dart'; import 'package:gallery/pages/home.dart'; import 'package:gallery/studies/reply/app.dart'; import 'package:gallery/studies/reply/search_page.dart'; void main() { testWidgets( 'State restoration test - Home Page', (tester) async { await tester.pumpWidget(const GalleryApp()); // Let the splash page animations complete. await tester.pump(const Duration(seconds: 1)); expect(find.byType(HomePage), findsOneWidget); // Test state restoration for carousel cards. expect(find.byKey(const ValueKey('reply@study')), findsOneWidget); // Move two carousel cards over. await tester.fling( find.byKey(const ValueKey('reply@study')), const Offset(-200, 0), 1000, ); await tester.pumpAndSettle(); await tester.fling( find.byKey(const ValueKey('shrine@study')), const Offset(-200, 0), 1000, ); await tester.pumpAndSettle(); expect(find.byKey(const ValueKey('rally@study')), findsOneWidget); await tester.restartAndRestore(); await tester.pump(const Duration(seconds: 1)); expect(find.byKey(const ValueKey('rally@study')), findsOneWidget); // Test state restoration for category list. expect(find.byKey(const ValueKey('app-bar@material')), findsNothing); // Open material samples list view. await tester.tap(find.byKey( const PageStorageKey<GalleryDemoCategory>(GalleryDemoCategory.material), )); await tester.pumpAndSettle(); expect(find.byKey(const ValueKey('app-bar@material')), findsOneWidget); await tester.restartAndRestore(); await tester.pump(const Duration(seconds: 1)); expect(find.byKey(const ValueKey('app-bar@material')), findsOneWidget); }, variant: const TargetPlatformVariant( <TargetPlatform>{TargetPlatform.android}, ), ); testWidgets( 'State restoration test - Gallery Demo', (tester) async { await tester.pumpWidget(const GalleryApp()); // Let the splash page animations complete. await tester.pump(const Duration(seconds: 1)); expect(find.byType(HomePage), findsOneWidget); // Open material samples list view. await tester.tap(find.byKey( const PageStorageKey<GalleryDemoCategory>(GalleryDemoCategory.material), )); await tester.pumpAndSettle(); await tester.tap(find.byKey(const ValueKey('banner@material'))); await tester.pumpAndSettle(); // Should be on Material Banner demo page. expect(find.byType(GalleryDemoPage), findsOneWidget); await tester.restartAndRestore(); await tester.pump(const Duration(seconds: 1)); expect(find.byType(GalleryDemoPage), findsOneWidget); const bannerDescriptionText = 'A banner displays an important, succinct ' 'message, and provides actions for users to address (or dismiss the ' 'banner). A user action is required for it to be dismissed.'; expect(find.text(bannerDescriptionText), findsNothing); await tester.tap(find.byIcon(Icons.info)); await tester.pumpAndSettle(); expect(find.text(bannerDescriptionText), findsOneWidget); await tester.restartAndRestore(); await tester.pump(const Duration(seconds: 1)); expect(find.text(bannerDescriptionText), findsOneWidget); }, variant: const TargetPlatformVariant( <TargetPlatform>{TargetPlatform.android}, ), ); testWidgets( 'State restoration test - Reply Study', (tester) async { await tester.pumpWidget(const GalleryApp()); // Let the splash page animations complete. await tester.pump(const Duration(seconds: 1)); expect(find.byType(HomePage), findsOneWidget); await tester.tap(find.byKey(const ValueKey('reply@study'))); await tester.pumpAndSettle(); // Should be on the reply study. expect(find.byType(ReplyApp), findsOneWidget); await tester.restartAndRestore(); await tester.pump(const Duration(seconds: 1)); // Should still be on the reply study after restoring state. expect(find.byType(ReplyApp), findsOneWidget); // Should be on the inbox page. expect(find.text('Package shipped!'), findsOneWidget); // Navigate to the spam page. await tester.tap(find.text('Inbox')); await tester.pumpAndSettle(); await tester.tap(find.text('Spam')); await tester.pumpAndSettle(); // Should be on the spam page. expect(find.text('Free money'), findsOneWidget); await tester.restartAndRestore(); await tester.pump(const Duration(seconds: 1)); // Should still be on the spam page after restoring state. expect(find.text('Free money'), findsOneWidget); await tester.tap(find.text('Free money')); await tester.pumpAndSettle(); // Star an item await tester.tap(find.byKey(const ValueKey('star_email_button'))); // Navigate to starred mailbox await tester.tap(find.byKey(const ValueKey('navigation_button'))); await tester.pumpAndSettle(); await tester.tap(find.text('Starred')); await tester.pumpAndSettle(); // Recently starred email should be found. expect(find.text('Free money'), findsOneWidget); await tester.restartAndRestore(); await tester.pump(const Duration(seconds: 1)); // Should still by on the starred email page. expect(find.text('Free money'), findsOneWidget); await tester.tap(find.byKey(const ValueKey('ReplySearch'))); await tester.pumpAndSettle(); // Open search page. expect(find.byType(SearchPage), findsOneWidget); await tester.restartAndRestore(); await tester.pump(const Duration(seconds: 1)); // Should still by on the search page. expect(find.byType(SearchPage), findsOneWidget); await tester.tap(find.byKey(const ValueKey('ReplyExit'))); await tester.pumpAndSettle(); // Should be on the starred email page instead of any other. expect(find.text('Free money'), findsOneWidget); }, variant: const TargetPlatformVariant( <TargetPlatform>{TargetPlatform.android}, ), skip: true, // TODO(x): State restoration test is failing at Inbox tap is failing, but works in App, https://github.com/flutter/gallery/issues/570. ); }
gallery/test/restoration_test.dart/0
{ "file_path": "gallery/test/restoration_test.dart", "repo_id": "gallery", "token_count": 2429 }
805
# Golden tests Golden tests, also called screenshot tests, let's you write tests to easily find UI regressions. It compares the UI to saved golden screenshots, and if there is a pixel difference the tests will fail. It gives us confidence that code changes does not cause UI regressions. ## Updating goldens An expected change to the UI will also cause the golden tests to fail. If this is unintended, you will need to change your code to prevent the UI change. If it was intended, you will then need to update the goldens by running the following command on your macOS machine: ```bash flutter test --update-goldens test_goldens ``` Due to slight [differences](https://github.com/flutter/flutter/issues/36667#issuecomment-521335243) in rendering across platforms, mostly around text, the tests will only be run on a macOS machine on Github Actions. This means that if you update the tests on a Linux or Windows machine the golden tests will not pass on Github Actions. Instead you are recommended to download the goldens directly from the failed Github Actions job, and use those inside of your branch. You can find the goldens from a given test run (e.g. https://github.com/flutter/gallery/actions/runs/6070588209) at the bottom of the Summary page, under "Artifacts". The `goldens` folder includes the golden image, your test image and the difference. ![Where to download the golden artifacts](https://github.com/flutter/gallery/assets/6655696/f53cab57-7b43-4f62-9594-5df5343a6cac)> ## Loading fonts in golden tests In Flutter widget tests the font used is the ['Ahem'](https://www.w3.org/Style/CSS/Test/Fonts/Ahem/README)-font. It was built to help test writers develop predictable tests, by most glyphs being a square box. To be able to test the rendering of our icons and fonts, the actual fonts are loaded before the test suites run. See [font_loader.dart](testing/font_loader.dart). ## Shadows in golden tests In the golden tests the shadows are opaqued, to [reduce the likelihood of golden file tests being flaky](https://api.flutter.dev/flutter/flutter_test/LiveTestWidgetsFlutterBinding/disableShadows.html). A side effect of this is that we are not testing the exact rendering of shadows inside of the goldens.
gallery/test_goldens/README.md/0
{ "file_path": "gallery/test_goldens/README.md", "repo_id": "gallery", "token_count": 604 }
806
// 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:string_scanner/string_scanner.dart'; abstract class SyntaxPrehighlighter { List<CodeSpan> format(String src); } class DartSyntaxPrehighlighter extends SyntaxPrehighlighter { DartSyntaxPrehighlighter() { _spans = <_HighlightSpan>[]; } static const List<String> _keywords = <String>[ 'abstract', 'as', 'assert', 'async', 'await', 'break', 'case', 'catch', 'class', 'const', 'continue', 'default', 'deferred', 'do', 'dynamic', 'else', 'enum', 'export', 'external', 'extends', 'factory', 'false', 'final', 'finally', 'for', 'get', 'if', 'implements', 'import', 'in', 'is', 'library', 'new', 'null', 'operator', 'part', 'rethrow', 'return', 'set', 'static', 'super', 'switch', 'sync', 'this', 'throw', 'true', 'try', 'typedef', 'var', 'void', 'while', 'with', 'yield', ]; static const List<String> _builtInTypes = <String>[ 'int', 'double', 'num', 'bool', ]; late String _src; late StringScanner _scanner; late List<_HighlightSpan> _spans; @override List<CodeSpan> format(String src) { _src = src; _scanner = StringScanner(_src); if (_generateSpans()) { // Successfully parsed the code final formattedText = <CodeSpan>[]; var currentPosition = 0; for (final span in _spans) { if (currentPosition != span.start) { formattedText .add(CodeSpan(text: _src.substring(currentPosition, span.start))); } formattedText .add(CodeSpan(type: span.type, text: span.textForSpan(_src))); currentPosition = span.end; } if (currentPosition != _src.length) { formattedText .add(CodeSpan(text: _src.substring(currentPosition, _src.length))); } return formattedText; } else { // Parsing failed, return with only basic formatting return [CodeSpan(type: HighlightType.base, text: src)]; } } bool _generateSpans() { var lastLoopPosition = _scanner.position; while (!_scanner.isDone) { // Skip White space _scanner.scan(RegExp(r'\s+')); // Block comments if (_scanner.scan(RegExp(r'/\*(.|\n)*\*/'))) { _spans.add(_HighlightSpan( HighlightType.comment, _scanner.lastMatch!.start, _scanner.lastMatch!.end, )); continue; } // Line comments if (_scanner.scan('//')) { final startComment = _scanner.lastMatch!.start; var eof = false; int endComment; if (_scanner.scan(RegExp(r'.*\n'))) { endComment = _scanner.lastMatch!.end - 1; } else { eof = true; endComment = _src.length; } _spans.add(_HighlightSpan( HighlightType.comment, startComment, endComment, )); if (eof) { break; } continue; } // Raw r"String" if (_scanner.scan(RegExp(r'r".*"'))) { _spans.add(_HighlightSpan( HighlightType.string, _scanner.lastMatch!.start, _scanner.lastMatch!.end, )); continue; } // Raw r'String' if (_scanner.scan(RegExp(r"r'.*'"))) { _spans.add(_HighlightSpan( HighlightType.string, _scanner.lastMatch!.start, _scanner.lastMatch!.end, )); continue; } // Multiline """String""" if (_scanner.scan(RegExp(r'"""(?:[^"\\]|\\(.|\n))*"""'))) { _spans.add(_HighlightSpan( HighlightType.string, _scanner.lastMatch!.start, _scanner.lastMatch!.end, )); continue; } // Multiline '''String''' if (_scanner.scan(RegExp(r"'''(?:[^'\\]|\\(.|\n))*'''"))) { _spans.add(_HighlightSpan( HighlightType.string, _scanner.lastMatch!.start, _scanner.lastMatch!.end, )); continue; } // "String" if (_scanner.scan(RegExp(r'"(?:[^"\\]|\\.)*"'))) { _spans.add(_HighlightSpan( HighlightType.string, _scanner.lastMatch!.start, _scanner.lastMatch!.end, )); continue; } // 'String' if (_scanner.scan(RegExp(r"'(?:[^'\\]|\\.)*'"))) { _spans.add(_HighlightSpan( HighlightType.string, _scanner.lastMatch!.start, _scanner.lastMatch!.end, )); continue; } // Double if (_scanner.scan(RegExp(r'\d+\.\d+'))) { _spans.add(_HighlightSpan( HighlightType.number, _scanner.lastMatch!.start, _scanner.lastMatch!.end, )); continue; } // Integer if (_scanner.scan(RegExp(r'\d+'))) { _spans.add(_HighlightSpan(HighlightType.number, _scanner.lastMatch!.start, _scanner.lastMatch!.end)); continue; } // Punctuation if (_scanner.scan(RegExp(r'[\[\]{}().!=<>&\|\?\+\-\*/%\^~;:,]'))) { _spans.add(_HighlightSpan( HighlightType.punctuation, _scanner.lastMatch!.start, _scanner.lastMatch!.end, )); continue; } // Meta data if (_scanner.scan(RegExp(r'@\w+'))) { _spans.add(_HighlightSpan( HighlightType.keyword, _scanner.lastMatch!.start, _scanner.lastMatch!.end, )); continue; } // Words if (_scanner.scan(RegExp(r'\w+'))) { HighlightType? type; var word = _scanner.lastMatch![0]!; if (word.startsWith('_')) { word = word.substring(1); } if (_keywords.contains(word)) { type = HighlightType.keyword; } else if (_builtInTypes.contains(word)) { type = HighlightType.keyword; } else if (_firstLetterIsUpperCase(word)) { type = HighlightType.klass; } else if (word.length >= 2 && word.startsWith('k') && _firstLetterIsUpperCase(word.substring(1))) { type = HighlightType.constant; } if (type != null) { _spans.add(_HighlightSpan( type, _scanner.lastMatch!.start, _scanner.lastMatch!.end, )); } } // Check if this loop did anything if (lastLoopPosition == _scanner.position) { // Failed to parse this file, abort gracefully return false; } lastLoopPosition = _scanner.position; } _simplify(); return true; } void _simplify() { for (var i = _spans.length - 2; i >= 0; i -= 1) { if (_spans[i].type == _spans[i + 1].type && _spans[i].end == _spans[i + 1].start) { _spans[i] = _HighlightSpan( _spans[i].type, _spans[i].start, _spans[i + 1].end, ); _spans.removeAt(i + 1); } } } bool _firstLetterIsUpperCase(String str) { if (str.isNotEmpty) { final first = str.substring(0, 1); return first == first.toUpperCase(); } return false; } } enum HighlightType { number, comment, keyword, string, punctuation, klass, constant, base, } class _HighlightSpan { _HighlightSpan(this.type, this.start, this.end); final HighlightType type; final int start; final int end; String textForSpan(String src) { return src.substring(start, end); } } class CodeSpan { CodeSpan({ this.type = HighlightType.base, required this.text, }); final HighlightType type; final String text; @override String toString() { return 'TextSpan(' 'style: codeStyle.${_styleNameOf(type)}, ' "text: '${_escape(text)}'" ')'; } } String _styleNameOf(HighlightType type) { switch (type) { case HighlightType.number: return 'numberStyle'; case HighlightType.comment: return 'commentStyle'; case HighlightType.keyword: return 'keywordStyle'; case HighlightType.string: return 'stringStyle'; case HighlightType.punctuation: return 'punctuationStyle'; case HighlightType.klass: return 'classStyle'; case HighlightType.constant: return 'constantStyle'; case HighlightType.base: return 'baseStyle'; } } String _escape(String text) { final escapedText = StringBuffer(); for (final char in text.runes) { if (char < 0x20 || char >= 0x7F || char == 0x22 || char == 0x24 || char == 0x27 || char == 0x5C) { if (char <= 0xffff) { escapedText.write('\\u${_encodeAndPad(char)}'); } else { escapedText.write('\\u{${_encode(char)}}'); } } else { escapedText.write(String.fromCharCode(char)); } } return escapedText.toString(); } String _encode(int charCode) { return charCode.toRadixString(16); } String _encodeAndPad(int charCode) { final encoded = _encode(charCode); return '0' * (4 - encoded.length) + encoded; }
gallery/tool/codeviewer_cli/prehighlighter.dart/0
{ "file_path": "gallery/tool/codeviewer_cli/prehighlighter.dart", "repo_id": "gallery", "token_count": 4536 }
807
// GENERATED CODE - DO NOT MODIFY BY HAND part of 'template_metadata.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** TemplateMetadata _$TemplateMetadataFromJson(Map<String, dynamic> json) => TemplateMetadata( title: json['title'] as String, description: json['description'] as String, shareUrl: json['shareUrl'] as String, favIconUrl: json['favIconUrl'] as String, ga: json['ga'] as String, gameUrl: json['gameUrl'] as String, image: json['image'] as String, ); Map<String, dynamic> _$TemplateMetadataToJson(TemplateMetadata instance) => <String, dynamic>{ 'title': instance.title, 'description': instance.description, 'shareUrl': instance.shareUrl, 'favIconUrl': instance.favIconUrl, 'ga': instance.ga, 'gameUrl': instance.gameUrl, 'image': instance.image, };
io_flip/api/lib/templates/template_metadata.g.dart/0
{ "file_path": "io_flip/api/lib/templates/template_metadata.g.dart", "repo_id": "io_flip", "token_count": 337 }
808
import 'dart:math' as math; import 'package:image/image.dart'; /// Applies a rainbow filter to the image. Image rainbowFilter(Image image) { const saturation = 0.95; for (final frame in image.frames) { for (final p in frame) { var hue = p.xNormalized / 1.75; hue = hue.remainder(1); final srcColor = rgbToHsl(p.r, p.g, p.b); final lightness = 0.5 + 0.1 * srcColor[2]; final color = hslToRgb(hue, saturation, lightness); final strength = 0.4 * math.cos((p.yNormalized - 0.25) * math.pi); p ..r = p.r * (1 - strength) + color[0] * strength ..g = p.g * (1 - strength) + color[1] * strength ..b = p.b * (1 - strength) + color[2] * strength; } } return image; }
io_flip/api/packages/card_renderer/lib/src/rainbow_filter.dart/0
{ "file_path": "io_flip/api/packages/card_renderer/lib/src/rainbow_filter.dart", "repo_id": "io_flip", "token_count": 322 }
809
/// Repository with access to dynamic project configurations library config_repository; export 'src/config_repository.dart';
io_flip/api/packages/config_repository/lib/config_repository.dart/0
{ "file_path": "io_flip/api/packages/config_repository/lib/config_repository.dart", "repo_id": "io_flip", "token_count": 33 }
810
/// A dart_frog middleware for encrypting responses. library encryption_middleware; export 'src/encryption_middleware.dart';
io_flip/api/packages/encryption_middleware/lib/encryption_middleware.dart/0
{ "file_path": "io_flip/api/packages/encryption_middleware/lib/encryption_middleware.dart", "repo_id": "io_flip", "token_count": 35 }
811
import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; part 'card.g.dart'; /// Represents the suit or family of card. enum Suit { /// Represents the suit of fire. fire, /// Represents the suit of air. air, /// Represents the suit of earth. earth, /// Represents the suit of metal. metal, /// Represents the suit of water. water, } /// {@template card} /// Model representing a card. /// {@endtemplate} @JsonSerializable(ignoreUnannotated: true) class Card extends Equatable { /// {@macro card} const Card({ required this.id, required this.name, required this.description, required this.image, required this.power, required this.rarity, required this.suit, this.shareImage, }); /// {@macro card} factory Card.fromJson(Map<String, dynamic> json) => _$CardFromJson(json); /// Id @JsonKey() final String id; /// Name @JsonKey() final String name; /// Description @JsonKey() final String description; /// Image @JsonKey() final String image; /// Product @JsonKey() final int power; /// Rarity @JsonKey() final bool rarity; /// Suit @JsonKey() final Suit suit; /// The share image @JsonKey() final String? shareImage; /// Returns a copy of this instance with the new [shareImage]. Card copyWithShareImage(String? shareImage) { return Card( id: id, name: name, description: description, image: image, power: power, rarity: rarity, suit: suit, shareImage: shareImage, ); } /// Returns a json representation from this instance. Map<String, dynamic> toJson() => _$CardToJson(this); @override List<Object?> get props => [ id, name, description, image, power, rarity, suit, shareImage, ]; }
io_flip/api/packages/game_domain/lib/src/models/card.dart/0
{ "file_path": "io_flip/api/packages/game_domain/lib/src/models/card.dart", "repo_id": "io_flip", "token_count": 706 }
812
// GENERATED CODE - DO NOT MODIFY BY HAND part of 'prompt_term.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** PromptTerm _$PromptTermFromJson(Map<String, dynamic> json) => PromptTerm( term: json['term'] as String, type: $enumDecode(_$PromptTermTypeEnumMap, json['type']), shortenedTerm: json['shortenedTerm'] as String?, id: json['id'] as String?, ); Map<String, dynamic> _$PromptTermToJson(PromptTerm instance) => <String, dynamic>{ 'id': instance.id, 'term': instance.term, 'shortenedTerm': instance.shortenedTerm, 'type': _$PromptTermTypeEnumMap[instance.type]!, }; const _$PromptTermTypeEnumMap = { PromptTermType.character: 'character', PromptTermType.characterClass: 'characterClass', PromptTermType.power: 'power', PromptTermType.location: 'location', };
io_flip/api/packages/game_domain/lib/src/models/prompt_term.g.dart/0
{ "file_path": "io_flip/api/packages/game_domain/lib/src/models/prompt_term.g.dart", "repo_id": "io_flip", "token_count": 322 }
813
// ignore_for_file: prefer_const_constructors import 'package:game_domain/game_domain.dart'; import 'package:test/test.dart'; void main() { group('ScoreCard', () { test('can be instantiated', () { expect( ScoreCard( id: '', ), isNotNull, ); }); final scoreCard = ScoreCard( id: 'id', wins: 1, longestStreak: 1, currentStreak: 1, latestStreak: 1, longestStreakDeck: 'longestId', currentDeck: 'deckId', latestDeck: 'latestId', initials: 'initials', ); test('toJson returns the instance as json', () { expect( scoreCard.toJson(), equals({ 'id': 'id', 'wins': 1, 'longestStreak': 1, 'currentStreak': 1, 'latestStreak': 1, 'longestStreakDeck': 'longestId', 'currentDeck': 'deckId', 'latestDeck': 'latestId', 'initials': 'initials', }), ); }); test('fromJson returns the correct instance', () { expect( ScoreCard.fromJson(const { 'id': 'id', 'wins': 1, 'longestStreak': 1, 'currentStreak': 1, 'latestStreak': 1, 'longestStreakDeck': 'longestId', 'currentDeck': 'deckId', 'latestDeck': 'latestId', 'initials': 'initials', }), equals(scoreCard), ); }); test('supports equality', () { expect( ScoreCard(id: ''), equals(ScoreCard(id: '')), ); // different id expect( ScoreCard( id: '', wins: 1, longestStreak: 1, currentStreak: 1, latestStreak: 1, longestStreakDeck: 'longestId', currentDeck: 'deckId', latestDeck: 'latestId', initials: 'initials', ), isNot( equals(scoreCard), ), ); // different wins expect( ScoreCard( id: 'id', wins: 2, longestStreak: 1, currentStreak: 1, latestStreak: 1, longestStreakDeck: 'longestId', currentDeck: 'deckId', latestDeck: 'latestId', initials: 'initials', ), isNot( equals(scoreCard), ), ); // different longestStreak expect( ScoreCard( id: 'id', wins: 1, longestStreak: 2, currentStreak: 1, latestStreak: 1, longestStreakDeck: 'longestId', currentDeck: 'deckId', latestDeck: 'latestId', initials: 'initials', ), isNot( equals(scoreCard), ), ); // different currentStreak expect( ScoreCard( id: 'id', wins: 1, longestStreak: 1, currentStreak: 2, latestStreak: 1, longestStreakDeck: 'longestId', currentDeck: 'deckId', latestDeck: 'latestId', initials: 'initials', ), isNot( equals(scoreCard), ), ); // different latestStreak expect( ScoreCard( id: 'id', wins: 1, longestStreak: 1, currentStreak: 1, latestStreak: 2, longestStreakDeck: 'longestId', currentDeck: 'deckId', latestDeck: 'latestId', initials: 'initials', ), isNot( equals(scoreCard), ), ); // different longestStreakDeck expect( ScoreCard( id: 'id', wins: 1, longestStreak: 1, currentStreak: 1, latestStreak: 1, longestStreakDeck: '-', currentDeck: 'deckId', latestDeck: 'latestId', initials: 'initials', ), isNot( equals(scoreCard), ), ); // different currentDeck expect( ScoreCard( id: 'id', wins: 1, longestStreak: 1, currentStreak: 1, latestStreak: 1, longestStreakDeck: 'longestId', currentDeck: '-', latestDeck: 'latestId', initials: 'initials', ), isNot( equals(scoreCard), ), ); // different latestDeck expect( ScoreCard( id: 'id', wins: 1, longestStreak: 1, currentStreak: 1, latestStreak: 1, longestStreakDeck: 'longestId', currentDeck: 'deckId', latestDeck: '-', initials: 'initials', ), isNot( equals(scoreCard), ), ); // different initials expect( ScoreCard( id: 'id', wins: 1, longestStreak: 1, currentStreak: 1, latestStreak: 1, longestStreakDeck: 'longestId', currentDeck: 'deckId', latestDeck: 'latestId', initials: '-', ), isNot( equals(scoreCard), ), ); }); }); }
io_flip/api/packages/game_domain/test/src/models/score_card_test.dart/0
{ "file_path": "io_flip/api/packages/game_domain/test/src/models/score_card_test.dart", "repo_id": "io_flip", "token_count": 2879 }
814
/// Repository providing access image model services library image_model_repository; export 'src/image_model_repository.dart';
io_flip/api/packages/image_model_repository/lib/image_model_repository.dart/0
{ "file_path": "io_flip/api/packages/image_model_repository/lib/image_model_repository.dart", "repo_id": "io_flip", "token_count": 36 }
815
include: package:very_good_analysis/analysis_options.4.0.0.yaml
io_flip/api/packages/scripts_repository/analysis_options.yaml/0
{ "file_path": "io_flip/api/packages/scripts_repository/analysis_options.yaml", "repo_id": "io_flip", "token_count": 23 }
816
import 'dart:async'; import 'dart:io'; import 'package:dart_frog/dart_frog.dart'; import 'package:leaderboard_repository/leaderboard_repository.dart'; FutureOr<Response> onRequest(RequestContext context) async { if (context.request.method == HttpMethod.post) { final json = await context.request.json() as Map<String, dynamic>; final scoreCardId = json['scoreCardId']; final initials = json['initials']; if (scoreCardId is! String || initials is! String || initials.length != 3) { return Response(statusCode: HttpStatus.badRequest); } final leaderboardRepository = context.read<LeaderboardRepository>(); final blacklist = await leaderboardRepository.getInitialsBlacklist(); if (blacklist.contains(initials.toUpperCase())) { return Response(statusCode: HttpStatus.badRequest); } await leaderboardRepository.addInitialsToScoreCard( scoreCardId: scoreCardId, initials: initials, ); return Response(statusCode: HttpStatus.noContent); } return Response(statusCode: HttpStatus.methodNotAllowed); }
io_flip/api/routes/game/leaderboard/initials/index.dart/0
{ "file_path": "io_flip/api/routes/game/leaderboard/initials/index.dart", "repo_id": "io_flip", "token_count": 361 }
817
import 'dart:io'; import 'package:config_repository/config_repository.dart'; import 'package:dart_frog/dart_frog.dart'; import 'package:mocktail/mocktail.dart'; import 'package:test/test.dart'; import '../../../../routes/game/configs/index.dart' as route; class _MockRequestContext extends Mock implements RequestContext {} class _MockConfigRepository extends Mock implements ConfigRepository {} class _MockRequest extends Mock implements Request {} void main() { group('GET /game/configs', () { late ConfigRepository configRepository; late Request request; late RequestContext context; setUp(() { configRepository = _MockConfigRepository(); when(configRepository.getPrivateMatchTimeLimit).thenAnswer( (_) async => 120, ); request = _MockRequest(); when(() => request.method).thenReturn(HttpMethod.get); context = _MockRequestContext(); when(() => context.request).thenReturn(request); when(() => context.request).thenReturn(request); when(() => context.read<ConfigRepository>()).thenReturn(configRepository); }); test('responds with a 200', () async { final response = await route.onRequest(context); expect(response.statusCode, equals(HttpStatus.ok)); }); test('responds with a json of the configs', () async { final response = await route.onRequest(context); final json = await response.json(); expect( json, equals( { 'privateMatchTimeLimit': 120, }, ), ); }); test('allows only get methods', () async { when(() => request.method).thenReturn(HttpMethod.post); final response = await route.onRequest(context); expect(response.statusCode, equals(HttpStatus.methodNotAllowed)); }); }); }
io_flip/api/test/routes/game/configs/configs_test.dart/0
{ "file_path": "io_flip/api/test/routes/game/configs/configs_test.dart", "repo_id": "io_flip", "token_count": 661 }
818
import 'dart:io'; import 'package:api/game_url.dart'; import 'package:cards_repository/cards_repository.dart'; import 'package:dart_frog/dart_frog.dart'; import 'package:game_domain/game_domain.dart'; import 'package:leaderboard_repository/leaderboard_repository.dart'; import 'package:logging/logging.dart'; import 'package:mocktail/mocktail.dart'; import 'package:test/test.dart'; import '../../../routes/public/share.dart' as route; class _MockRequestContext extends Mock implements RequestContext {} class _MockRequest extends Mock implements Request {} class _MockCardRepository extends Mock implements CardsRepository {} class _MockLeaderboardRepository extends Mock implements LeaderboardRepository {} class _MockLogger extends Mock implements Logger {} void main() { group('GET /public/share?cardId=cardId', () { late Request request; late RequestContext context; late CardsRepository cardsRepository; late Logger logger; const gameUrl = GameUrl('https://example.com'); const card = Card( id: 'cardId', name: 'cardName', description: 'cardDescription', image: 'cardImageUrl', suit: Suit.fire, rarity: false, power: 10, ); setUp(() { request = _MockRequest(); when(() => request.method).thenReturn(HttpMethod.get); when(() => request.uri).thenReturn( Uri.parse('http://gameapi.com/public/share?cardId=${card.id}'), ); logger = _MockLogger(); cardsRepository = _MockCardRepository(); when(() => cardsRepository.getCard(card.id)).thenAnswer( (_) async => card, ); context = _MockRequestContext(); when(() => context.request).thenReturn(request); when(() => context.read<Logger>()).thenReturn(logger); when(() => context.read<GameUrl>()).thenReturn(gameUrl); when(() => context.read<CardsRepository>()).thenReturn(cardsRepository); }); test('responds with a 200', () async { final response = await route.onRequest(context); expect(response.statusCode, equals(HttpStatus.ok)); }); test('redirects when the card is not found', () async { when(() => cardsRepository.getCard(card.id)).thenAnswer( (_) async => null, ); final response = await route.onRequest(context); expect(response.statusCode, equals(HttpStatus.movedPermanently)); expect( response.headers[HttpHeaders.locationHeader], equals('https://example.com'), ); }); test('redirects when no cardId is in the request', () async { when(() => request.uri).thenReturn( Uri.parse('/public/share'), ); final response = await route.onRequest(context); expect(response.statusCode, equals(HttpStatus.movedPermanently)); expect( response.headers[HttpHeaders.locationHeader], equals('https://example.com'), ); }); }); group('GET /public/share?deckId=deckId', () { late Request request; late RequestContext context; late LeaderboardRepository leaderboardRepository; late CardsRepository cardsRepository; late Logger logger; const gameUrl = GameUrl('https://example.com'); const deckId = 'deckId'; const scoreCard = ScoreCard( id: '', wins: 4, longestStreak: 4, longestStreakDeck: deckId, currentStreak: 4, currentDeck: deckId, ); setUp(() { request = _MockRequest(); when(() => request.method).thenReturn(HttpMethod.get); when(() => request.uri).thenReturn( Uri.parse('/public/share?deckId=$deckId'), ); logger = _MockLogger(); leaderboardRepository = _MockLeaderboardRepository(); when(() => leaderboardRepository.findScoreCardByLongestStreakDeck(deckId)) .thenAnswer( (_) async => scoreCard, ); cardsRepository = _MockCardRepository(); when(() => cardsRepository.getDeck(deckId)).thenAnswer( (_) async => const Deck(id: deckId, userId: 'userId', cards: []), ); context = _MockRequestContext(); when(() => context.request).thenReturn(request); when(() => context.read<Logger>()).thenReturn(logger); when(() => context.read<GameUrl>()).thenReturn(gameUrl); when(() => context.read<LeaderboardRepository>()) .thenReturn(leaderboardRepository); when(() => context.read<CardsRepository>()).thenReturn(cardsRepository); }); test('responds with a 200', () async { final response = await route.onRequest(context); expect(response.statusCode, equals(HttpStatus.ok)); }); test('responds with redirect when the deck is not found', () async { when(() => cardsRepository.getDeck(deckId)).thenAnswer( (_) async => null, ); final response = await route.onRequest(context); expect(response.statusCode, equals(HttpStatus.movedPermanently)); expect( response.headers[HttpHeaders.locationHeader], equals('https://example.com'), ); }); test('responds with redirect when no deckId is in the request', () async { when(() => request.uri).thenReturn( Uri.parse('/public/share'), ); final response = await route.onRequest(context); expect(response.statusCode, equals(HttpStatus.movedPermanently)); expect( response.headers[HttpHeaders.locationHeader], equals('https://example.com'), ); }); }); }
io_flip/api/test/routes/public/share_test.dart/0
{ "file_path": "io_flip/api/test/routes/public/share_test.dart", "repo_id": "io_flip", "token_count": 2076 }
819
name: data_loader description: Dart tool that feed data into the Database version: 0.1.0+1 publish_to: none environment: sdk: ">=2.18.0 <3.0.0" executables: data_loader: dependencies: csv: ^5.0.2 db_client: path: ../../packages/db_client game_domain: path: ../../packages/game_domain path: ^1.8.3 prompt_repository: path: ../../packages/prompt_repository dev_dependencies: mocktail: ^0.3.0 test: ^1.19.2 very_good_analysis: ^3.1.0
io_flip/api/tools/data_loader/pubspec.yaml/0
{ "file_path": "io_flip/api/tools/data_loader/pubspec.yaml", "repo_id": "io_flip", "token_count": 203 }
820
import 'mocha'; import * as functionsTest from 'firebase-functions-test'; import * as sinon from 'sinon'; import * as admin from 'firebase-admin'; import {expect} from 'chai'; describe('deleteUserData', () => { let adminInitStub: sinon.SinonStub; let firestoreStub: sinon.SinonStub; let collectionStub: sinon.SinonStub; let storageStub: sinon.SinonStub; let bucketStub: sinon.SinonStub; let whereStub: sinon.SinonStub; let docStub: sinon.SinonStub; let deleteStub: sinon.SinonStub; let oldFirestore: typeof admin.firestore; let oldStorage: typeof admin.storage; const tester = functionsTest(); const uid = 'UID-1234'; before(async () => { oldFirestore = admin.firestore; oldStorage = admin.storage; adminInitStub = sinon.stub(admin, 'initializeApp'); firestoreStub = sinon.stub(); collectionStub = sinon.stub(); storageStub = sinon.stub(); bucketStub = sinon.stub(); whereStub = sinon.stub(); docStub = sinon.stub(); deleteStub = sinon.stub(); Object.defineProperty(admin, 'firestore', {value: firestoreStub, writable: true}); Object.defineProperty(admin, 'storage', {value: storageStub, writable: true}); firestoreStub.returns({collection: collectionStub}); storageStub.returns({bucket: bucketStub}); }); after(() => { adminInitStub.restore(); tester.cleanup(); Object.defineProperty(admin, 'firestore', {value: oldFirestore}); Object.defineProperty(admin, 'storage', {value: oldStorage}); }); function stubQuerySnapshot(ids: string[]): sinon.SinonStub { const docs = ids.map((id) => ({id: id, ref: {delete: deleteStub}})); const stub = sinon.stub(); stub.returns(Promise.resolve({docs: docs})); return stub; } it(`should delete cards, decks, matches, match states, scorecards, leaderboard, and connection states`, async () => { docStub.returns({delete: deleteStub}); collectionStub.withArgs('cards').returns({doc: docStub}); collectionStub.withArgs('decks').returns({where: whereStub}); collectionStub.withArgs('matches').returns({where: whereStub}); collectionStub.withArgs('match_states').returns({where: whereStub}); collectionStub.withArgs('connection_states').returns({doc: docStub}); collectionStub.withArgs('score_cards').returns({doc: docStub}); collectionStub.withArgs('leaderboard').returns({doc: docStub}); const cardIds = ['card1', 'card2', 'card3']; const decksStub = sinon.stub(); decksStub.returns( Promise.resolve({ docs: [ { id: 'deck1', ref: {delete: deleteStub}, data: () => ({cards: cardIds}), }, ], } )); const cpuDecksStub = sinon.stub(); cpuDecksStub.returns( Promise.resolve({ docs: [ { id: 'cpuDeck1', ref: {delete: deleteStub}, data: () => ({cards: cardIds}), }, ], })); whereStub.withArgs('userId', '==', uid).returns({get: decksStub}); whereStub.withArgs('userId', '==', `CPU_${uid}`).returns({get: cpuDecksStub}); const hostMatchStub = stubQuerySnapshot(['match1', 'match2']); const guestMatchStub = stubQuerySnapshot(['match3', 'match4']); whereStub.withArgs('host', 'in', ['deck1', 'cpuDeck1']).returns({get: hostMatchStub}); whereStub.withArgs('guest', 'in', ['deck1', 'cpuDeck1']).returns({get: guestMatchStub}); const matchStateStub = stubQuerySnapshot([ 'matchState1', 'matchState2', 'matchState3', 'matchState4']); whereStub.withArgs('matchId', 'in', ['match1', 'match2', 'match3', 'match4']) .returns({get: matchStateStub}); const fileStub = sinon.stub(); const deleteFileStub = sinon.stub().returns(Promise.resolve()); fileStub.returns({delete: deleteFileStub}); bucketStub.returns({file: fileStub}); const userRecord = sinon.stub().returns({uid}); const wrapped = tester.wrap((await import('../src/deleteUserData')).deleteUserData); await wrapped(userRecord()); expect(collectionStub.calledWith('cards')).to.be.true; expect(collectionStub.calledWith('decks')).to.be.true; expect(collectionStub.calledWith('matches')).to.be.true; expect(collectionStub.calledWith('match_states')).to.be.true; expect(collectionStub.calledWith('connection_states')).to.be.true; expect(collectionStub.calledWith('score_cards')).to.be.true; expect(collectionStub.calledWith('leaderboard')).to.be.true; expect(whereStub.calledWith('userId', '==', uid)).to.be.true; expect(whereStub.calledWith('userId', '==', `CPU_${uid}`)).to.be.true; expect(whereStub.calledWith('host', 'in', ['deck1', 'cpuDeck1'])).to.be.true; expect(whereStub.calledWith('guest', 'in', ['deck1', 'cpuDeck1'])).to.be.true; expect( whereStub.calledWith('matchId', 'in', ['match1', 'match2', 'match3', 'match4'])).to.be.true; expect(docStub.calledWith('card1')).to.be.true; expect(docStub.calledWith('card2')).to.be.true; expect(docStub.calledWith('card3')).to.be.true; expect(docStub.withArgs(uid).calledThrice).to.be.true; for (let i = 0; i < cardIds.length; i++) { expect(fileStub.calledWith(`share/${cardIds[i]}.png`)).to.be.true; } expect(fileStub.calledWith('share/deck1.png')).to.be.true; expect(fileStub.calledWith('share/cpuDeck1.png')).to.be.true; expect(deleteStub.callCount).to.equal(17); expect(deleteFileStub.callCount).to.equal(cardIds.length + 2); } ); });
io_flip/functions/test/deleteUserData.test.ts/0
{ "file_path": "io_flip/functions/test/deleteUserData.test.ts", "repo_id": "io_flip", "token_count": 2228 }
821
part of 'connection_bloc.dart'; abstract class ConnectionState extends Equatable { const ConnectionState(); @override List<Object> get props => []; } class ConnectionInitial extends ConnectionState { const ConnectionInitial(); } class ConnectionInProgress extends ConnectionState { const ConnectionInProgress(); } class ConnectionSuccess extends ConnectionState { const ConnectionSuccess(); } class ConnectionFailure extends ConnectionState { const ConnectionFailure(this.error); final WebSocketErrorCode error; @override List<Object> get props => [error]; }
io_flip/lib/connection/bloc/connection_state.dart/0
{ "file_path": "io_flip/lib/connection/bloc/connection_state.dart", "repo_id": "io_flip", "token_count": 146 }
822
import 'dart:async'; import 'dart:math' as math; 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_bloc/flutter_bloc.dart'; import 'package:game_domain/game_domain.dart'; import 'package:io_flip/audio/audio_controller.dart'; import 'package:io_flip/gen/assets.gen.dart'; import 'package:io_flip/share/share.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; import 'package:match_maker_repository/match_maker_repository.dart'; part 'game_event.dart'; part 'game_state.dart'; class GameBloc extends Bloc<GameEvent, GameState> { GameBloc({ required GameResource gameResource, required MatchMakerRepository matchMakerRepository, required AudioController audioController, required MatchSolver matchSolver, required User user, required this.isHost, required ConnectionRepository connectionRepository, }) : _gameResource = gameResource, _matchMakerRepository = matchMakerRepository, _connectionRepository = connectionRepository, _audioController = audioController, _matchSolver = matchSolver, _user = user, super(const MatchLoadingState()) { on<MatchRequested>(_onMatchRequested); on<PlayerPlayed>(_onPlayerPlayed); on<MatchStateUpdated>(_onMatchStateUpdated); on<ScoreCardUpdated>(_onScoreCardUpdated); on<LeaderboardEntryRequested>(_onLeaderboardEntryRequested); on<ManagePlayerPresence>(_onManagePlayerPresence); on<TurnTimerStarted>(_onTurnTimerStarted); on<TurnTimerTicked>(_onTurnTimerTicked); on<TurnAnimationsFinished>(_onTurnAnimationsFinished); on<ClashSceneStarted>(_onClashSceneStarted); on<ClashSceneCompleted>(_onClashSceneCompleted); on<CardLandingStarted>(_onCardLandingStarted); on<CardLandingCompleted>(_onCardLandingCompleted); } final GameResource _gameResource; final MatchMakerRepository _matchMakerRepository; final MatchSolver _matchSolver; final User _user; final bool isHost; final AudioController _audioController; final ConnectionRepository _connectionRepository; final List<String> playedCardsInOrder = []; Timer? _turnTimer; // Added to easily toggle timer functionality for testing purposes. static const _turnTimerEnabled = true; static const _timerWarningSfx = 3; static const _turnMaxTime = 10; StreamSubscription<MatchState>? _stateSubscription; StreamSubscription<DraftMatch>? _opponentDisconnectSubscription; StreamSubscription<ScoreCard>? _scoreSubscription; Future<void> _onMatchRequested( MatchRequested event, Emitter<GameState> emit, ) async { try { emit(const MatchLoadingState()); final values = await Future.wait([ _gameResource.getMatch(event.matchId), _gameResource.getMatchState(event.matchId), _matchMakerRepository.getScoreCard(_user.id), ]); final match = values.first as Match?; final matchState = values[1] as MatchState?; final scoreCard = values.last as ScoreCard?; if (match == null || matchState == null || scoreCard == null) { emit(MatchLoadFailedState(deck: event.deck)); } else { _audioController.playSfx(Assets.sfx.startGame); final String? initialOpponentCard; if (isHost && matchState.guestPlayedCards.isNotEmpty) { initialOpponentCard = matchState.guestPlayedCards.first; } else if (!isHost && matchState.hostPlayedCards.isNotEmpty) { initialOpponentCard = matchState.hostPlayedCards.first; } else { initialOpponentCard = null; } if (initialOpponentCard != null) { playedCardsInOrder.add(initialOpponentCard); } emit( MatchLoadedState( match: match, matchState: matchState, rounds: [ if (initialOpponentCard != null) MatchRound( playerCardId: null, opponentCardId: isHost ? matchState.guestPlayedCards.first : matchState.hostPlayedCards.first, ), ], lastPlayedCardId: initialOpponentCard, playerScoreCard: scoreCard, turnTimeRemaining: _turnMaxTime, turnAnimationsFinished: true, isClashScene: false, showCardLanding: false, ), ); final stateStream = _matchMakerRepository.watchMatchState(matchState.id); _stateSubscription = stateStream.listen((state) { add(MatchStateUpdated(state)); }); final scoreStream = _matchMakerRepository.watchScoreCard(scoreCard.id); _scoreSubscription = scoreStream.listen((state) { add(ScoreCardUpdated(state)); }); add(ManagePlayerPresence(event.matchId, event.deck)); } } catch (e, s) { addError(e, s); emit(MatchLoadFailedState(deck: event.deck)); } } Future<void> _onMatchStateUpdated( MatchStateUpdated event, Emitter<GameState> emit, ) async { if (state is MatchLoadedState) { final matchLoadedState = state as MatchLoadedState; final matchStatePlayerMoves = isHost ? event.updatedState.hostPlayedCards : event.updatedState.guestPlayedCards; final matchStateOpponentMoves = isHost ? event.updatedState.guestPlayedCards : event.updatedState.hostPlayedCards; final currentMatchStatePlayerMoves = isHost ? matchLoadedState.matchState.hostPlayedCards : matchLoadedState.matchState.guestPlayedCards; final currentMatchStateOpponentMoves = isHost ? matchLoadedState.matchState.guestPlayedCards : matchLoadedState.matchState.hostPlayedCards; // If the current state already have all the moves from the updated state, // then we don't need to update the state. if (matchLoadedState.matchState.result == event.updatedState.result && currentMatchStatePlayerMoves.isNotEmpty && currentMatchStateOpponentMoves.isNotEmpty && currentMatchStatePlayerMoves.toSet().containsAll( matchStatePlayerMoves.toSet(), ) && currentMatchStateOpponentMoves.toSet().containsAll( matchStateOpponentMoves.toSet(), )) { return; } String? lastPlayedCard; for (final cardId in [ ...matchStatePlayerMoves, ...matchStateOpponentMoves ]) { if (!playedCardsInOrder.contains(cardId)) { playedCardsInOrder.add(cardId); lastPlayedCard = cardId; } } final moveLength = math.max( matchStatePlayerMoves.length, matchStateOpponentMoves.length, ); final rounds = [ for (var i = 0; i < moveLength; i++) MatchRound( playerCardId: i < matchStatePlayerMoves.length ? matchStatePlayerMoves[i] : null, opponentCardId: i < matchStateOpponentMoves.length ? matchStateOpponentMoves[i] : null, showCardsOverlay: i < matchLoadedState.rounds.length && matchLoadedState.rounds[i].showCardsOverlay, turnTimerStarted: i < matchLoadedState.rounds.length && matchLoadedState.rounds[i].turnTimerStarted, ), ]; if (event.updatedState.result == null && event.updatedState.hostPlayedCards.length == 3 && event.updatedState.hostPlayedCards.length == event.updatedState.guestPlayedCards.length) { await _gameResource.calculateResult( matchId: matchLoadedState.match.id, ); } if (lastPlayedCard != null) { _audioController.playSfx(Assets.sfx.playCard); } emit( matchLoadedState.copyWith( matchState: event.updatedState, rounds: rounds, lastPlayedCardId: lastPlayedCard, ), ); if (_turnTimerEnabled && matchLoadedState.turnAnimationsFinished) { add(const TurnTimerStarted()); } } } Future<void> _onScoreCardUpdated( ScoreCardUpdated event, Emitter<GameState> emit, ) async { if (state is MatchLoadedState) { final matchLoadedState = state as MatchLoadedState; emit( matchLoadedState.copyWith(playerScoreCard: event.updatedScore), ); } } Future<void> _onPlayerPlayed( PlayerPlayed event, Emitter<GameState> emit, ) async { if (state is MatchLoadedState) { final matchState = state as MatchLoadedState; emit( matchState.copyWith( turnAnimationsFinished: false, ), ); final deckId = isHost ? matchState.match.hostDeck.id : matchState.match.guestDeck.id; await _gameResource.playCard( matchId: matchState.match.id, cardId: event.cardId, deckId: deckId, ); } } Future<void> _onManagePlayerPresence( ManagePlayerPresence event, Emitter<GameState> emit, ) async { try { final completer = Completer<void>(); final opponentDisconnectStream = _matchMakerRepository.watchMatch(event.matchId).where( (match) => isHost ? match.guestConnected == false : match.hostConnected == false, ); _opponentDisconnectSubscription = opponentDisconnectStream.listen((match) async { final matchState = await _gameResource.getMatchState(match.id); final matchOver = matchState?.isOver(); if (matchOver != true) { emit(OpponentAbsentState(deck: event.deck)); } completer.complete(); }); return completer.future; } catch (e, s) { addError(e, s); emit(const ManagePlayerPresenceFailedState()); } } void _onLeaderboardEntryRequested( LeaderboardEntryRequested event, Emitter<GameState> emit, ) { if (state is MatchLoadedState) { final matchLoadedState = state as MatchLoadedState; emit( LeaderboardEntryState( matchLoadedState.playerScoreCard.id, shareHandPageData: event.shareHandPageData, ), ); } } void _onTurnTimerStarted( TurnTimerStarted event, Emitter<GameState> emit, ) { if (state is MatchLoadedState) { final matchLoadedState = state as MatchLoadedState; final incompleteRounds = matchLoadedState.rounds.where((round) => !round.isComplete()); if (isPlayerAllowedToPlay && !matchLoadedState.matchState.isOver() && (incompleteRounds.isEmpty || !incompleteRounds.last.turnTimerStarted)) { final List<MatchRound> rounds; if (incompleteRounds.isNotEmpty) { final roundIndex = matchLoadedState.rounds.indexOf(incompleteRounds.last); rounds = [...matchLoadedState.rounds]; final round = rounds.removeAt(roundIndex); rounds.insert(roundIndex, round.copyWith(turnTimerStarted: true)); } else { rounds = [ ...matchLoadedState.rounds, const MatchRound( playerCardId: null, opponentCardId: null, turnTimerStarted: true, ), ]; } emit( matchLoadedState.copyWith( turnTimeRemaining: _turnMaxTime, rounds: rounds, ), ); _turnTimer?.cancel(); _turnTimer = Timer.periodic( const Duration(seconds: 1), (timer) { if (!isClosed) { add(TurnTimerTicked(timer)); } }, ); } } } void _onTurnTimerEnds() { if (state is MatchLoadedState) { final matchState = state as MatchLoadedState; _turnTimer?.cancel(); final playedCards = isHost ? matchState.matchState.hostPlayedCards : matchState.matchState.guestPlayedCards; final cards = isHost ? matchState.match.hostDeck.cards.map((e) => e.id).toList() : matchState.match.guestDeck.cards.map((e) => e.id).toList() ..removeWhere(playedCards.contains); if (cards.isNotEmpty && isPlayerAllowedToPlay) { add(PlayerPlayed(cards.first)); } } } void _onTurnTimerTicked( TurnTimerTicked event, Emitter<GameState> emit, ) { if (state is MatchLoadedState) { final matchLoadedState = state as MatchLoadedState; final timeRemaining = matchLoadedState.turnTimeRemaining - 1; if (timeRemaining == _timerWarningSfx) { _audioController.playSfx(Assets.sfx.clockRunning); } if (timeRemaining == 0) { event.timer.cancel(); _onTurnTimerEnds(); } else { emit( matchLoadedState.copyWith( turnTimeRemaining: timeRemaining, ), ); } } } void _onTurnAnimationsFinished( TurnAnimationsFinished event, Emitter<GameState> emit, ) { if (state is MatchLoadedState) { final matchLoadedState = state as MatchLoadedState; emit( matchLoadedState.copyWith( turnAnimationsFinished: true, isClashScene: false, ), ); } } void _onClashSceneStarted( ClashSceneStarted event, Emitter<GameState> emit, ) { if (state is MatchLoadedState) { _turnTimer?.cancel(); final matchLoadedState = state as MatchLoadedState; if (matchLoadedState.rounds.isNotEmpty) { final lastRoundIndex = matchLoadedState.rounds.lastIndexWhere( (round) => round.isComplete(), ); final rounds = [...matchLoadedState.rounds] ..removeAt(lastRoundIndex) ..insert( lastRoundIndex, matchLoadedState.rounds[lastRoundIndex].copyWith( showCardsOverlay: true, ), ); emit( matchLoadedState.copyWith( rounds: rounds, isClashScene: true, ), ); } } } void _onClashSceneCompleted( ClashSceneCompleted event, Emitter<GameState> emit, ) { if (state is MatchLoadedState) { final matchLoadedState = state as MatchLoadedState; emit(matchLoadedState.copyWith(isClashScene: false)); } } void _onCardLandingStarted( CardLandingStarted event, Emitter<GameState> emit, ) { if (state is MatchLoadedState) { final matchLoadedState = state as MatchLoadedState; emit(matchLoadedState.copyWith(showCardLanding: true)); } } void _onCardLandingCompleted( CardLandingCompleted event, Emitter<GameState> emit, ) { if (state is MatchLoadedState) { final matchLoadedState = state as MatchLoadedState; emit(matchLoadedState.copyWith(showCardLanding: false)); } } CardOverlayType? isWinningCard(Card card, {required bool isPlayer}) { if (state is MatchLoadedState) { final matchLoadedState = state as MatchLoadedState; final matchState = matchLoadedState.matchState; final playerCards = isHost ? matchState.hostPlayedCards : matchState.guestPlayedCards; final opponentCards = isHost ? matchState.guestPlayedCards : matchState.hostPlayedCards; final round = (isPlayer ? playerCards : opponentCards) .indexWhere((id) => id == card.id); if (round >= 0) { final turn = matchLoadedState.rounds[round]; if (turn.isComplete() && turn.showCardsOverlay) { final result = _matchSolver.calculateRoundResult( matchLoadedState.match, matchLoadedState.matchState, round, ); if (result == MatchResult.draw) { return CardOverlayType.draw; } final playerWins = isHost ? MatchResult.host : MatchResult.guest; final opponentWins = isHost ? MatchResult.guest : MatchResult.host; final cardWins = isPlayer ? result == playerWins : result == opponentWins; return cardWins ? CardOverlayType.win : CardOverlayType.lose; } } } return null; } GameResult _gameResult(MatchState matchState) { if ((isHost && matchState.result == MatchResult.host) || (!isHost && matchState.result == MatchResult.guest)) { return GameResult.win; } else if ((isHost && matchState.result == MatchResult.guest) || (!isHost && matchState.result == MatchResult.host)) { return GameResult.lose; } else { return GameResult.draw; } } GameResult? gameResult() { if (state is MatchLoadedState) { return _gameResult((state as MatchLoadedState).matchState); } return null; } bool get isPlayerAllowedToPlay { if (state is MatchLoadedState) { final matchLoadedState = state as MatchLoadedState; return _matchSolver.isPlayerAllowedToPlay( matchLoadedState.matchState, isHost: isHost, ); } return false; } bool canPlayerPlay(String cardId) { if (state is MatchLoadedState) { final matchLoadedState = state as MatchLoadedState; return _matchSolver.canPlayCard( matchLoadedState.matchState, cardId, isHost: isHost, ); } return false; } Deck get playerDeck { final matchLoadedState = state as MatchLoadedState; return isHost ? matchLoadedState.match.hostDeck : matchLoadedState.match.guestDeck; } List<Card> get playerCards { if (state is MatchLoadedState) { final matchLoadedState = state as MatchLoadedState; return isHost ? matchLoadedState.match.hostDeck.cards : matchLoadedState.match.guestDeck.cards; } return []; } Card get clashScenePlayerCard { final matchLoadedState = state as MatchLoadedState; final cardId = matchLoadedState.rounds .lastWhere((round) => round.isComplete()) .playerCardId; return playerCards.firstWhere((card) => card.id == cardId); } Card get clashSceneOpponentCard { final matchLoadedState = state as MatchLoadedState; final cardId = matchLoadedState.rounds .lastWhere((round) => round.isComplete()) .opponentCardId; return opponentCards.firstWhere((card) => card.id == cardId); } List<Card> get opponentCards { if (state is MatchLoadedState) { final matchLoadedState = state as MatchLoadedState; return isHost ? matchLoadedState.match.guestDeck.cards : matchLoadedState.match.hostDeck.cards; } return []; } void sendMatchLeft() { _connectionRepository.send(const WebSocketMessage.matchLeft()); } bool matchCompleted(GameState state) => (state is MatchLoadedState) && (state.matchState.result != null) && state.turnAnimationsFinished; @override Future<void> close() { _stateSubscription?.cancel(); _opponentDisconnectSubscription?.cancel(); _scoreSubscription?.cancel(); _turnTimer?.cancel(); if (!matchCompleted(state)) sendMatchLeft(); return super.close(); } } extension MatchTurnX on MatchRound { bool isComplete() { return playerCardId != null && opponentCardId != null; } } extension MatchLoadedStateX on MatchLoadedState { bool isCardTurnComplete(Card card) { for (final turn in rounds) { if (card.id == turn.playerCardId || card.id == turn.opponentCardId) { return turn.isComplete(); } } return false; } } enum GameResult { win, lose, draw, }
io_flip/lib/game/bloc/game_bloc.dart/0
{ "file_path": "io_flip/lib/game/bloc/game_bloc.dart", "repo_id": "io_flip", "token_count": 8424 }
823
export 'bloc/how_to_play_bloc.dart'; export 'view/how_to_play_dialog.dart'; export 'view/how_to_play_view.dart'; export 'widgets/widgets.dart';
io_flip/lib/how_to_play/how_to_play.dart/0
{ "file_path": "io_flip/lib/how_to_play/how_to_play.dart", "repo_id": "io_flip", "token_count": 63 }
824
part of 'leaderboard_bloc.dart'; abstract class LeaderboardEvent extends Equatable { const LeaderboardEvent(); } class LeaderboardRequested extends LeaderboardEvent { const LeaderboardRequested(); @override List<Object> get props => []; }
io_flip/lib/leaderboard/bloc/leaderboard_event.dart/0
{ "file_path": "io_flip/lib/leaderboard/bloc/leaderboard_event.dart", "repo_id": "io_flip", "token_count": 71 }
825
import 'package:api_client/api_client.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.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/l10n/l10n.dart'; import 'package:io_flip/leaderboard/leaderboard.dart'; import 'package:io_flip/terms_of_use/terms_of_use.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; class MainMenuScreen extends StatelessWidget { const MainMenuScreen({super.key}); factory MainMenuScreen.routeBuilder(_, __) { return const MainMenuScreen( key: Key('main menu'), ); } @override Widget build(BuildContext context) { final l10n = context.l10n; return BlocProvider<LeaderboardBloc>( create: (context) { final leaderboardResource = context.read<LeaderboardResource>(); return LeaderboardBloc( leaderboardResource: leaderboardResource, )..add(const LeaderboardRequested()); }, child: IoFlipScaffold( body: const Align( child: _MainMenuScreenView(key: Key('main menu view')), ), bottomBar: IoFlipBottomBar( leading: const InfoButton(), middle: BlocConsumer<TermsOfUseCubit, bool>( listener: (context, termsAccepted) { if (termsAccepted) { GoRouter.of(context).go('/prompt'); } }, builder: (context, termsAccepted) { return RoundedButton.text( l10n.play, onPressed: () { if (termsAccepted) { GoRouter.of(context).go('/prompt'); } else { IoFlipDialog.show( context, child: const TermsOfUseView(), showCloseButton: false, ); } }, ); }, ), trailing: RoundedButton.icon( Icons.question_mark_rounded, onPressed: () => IoFlipDialog.show( context, child: const HowToPlayDialog(), ), ), ), ), ); } } class _MainMenuScreenView extends StatelessWidget { const _MainMenuScreenView({super.key}); @override Widget build(BuildContext context) { return SingleChildScrollView( child: Column( children: [ Image.asset( platformAwareAsset( desktop: Assets.images.desktop.main.path, mobile: Assets.images.mobile.main.path, ), height: 312, fit: BoxFit.fitHeight, ), const LeaderboardView(), const SizedBox(height: IoFlipSpacing.xxlg), ], ), ); } }
io_flip/lib/main_menu/main_menu_screen.dart/0
{ "file_path": "io_flip/lib/main_menu/main_menu_screen.dart", "repo_id": "io_flip", "token_count": 1451 }
826
import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:game_domain/game_domain.dart'; import 'package:io_flip/audio/audio.dart'; import 'package:io_flip/l10n/l10n.dart'; import 'package:io_flip/prompt/prompt.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; class PromptFormView extends StatefulWidget { const PromptFormView({ required this.title, required this.itemsList, required this.initialItem, this.isLastOfFlow = false, super.key, }); final String title; final List<String> itemsList; final int initialItem; final bool isLastOfFlow; static const itemExtent = 48.0; @override State<PromptFormView> createState() => _PromptFormViewState(); } class _PromptFormViewState extends State<PromptFormView> { late int selectedIndex; late final scrollController = FixedExtentScrollController( initialItem: widget.initialItem, ); static const _gap = SizedBox(height: IoFlipSpacing.xxxlg); static const itemPadding = EdgeInsets.symmetric( horizontal: 20, vertical: 6, ); @override void initState() { super.initState(); selectedIndex = widget.initialItem; } @override Widget build(BuildContext context) { final l10n = context.l10n; final backgroundColor = Theme.of(context).scaffoldBackgroundColor; return Column( mainAxisAlignment: MainAxisAlignment.center, children: [ const SizedBox(height: IoFlipSpacing.xxlg), Padding( padding: const EdgeInsets.symmetric(horizontal: IoFlipSpacing.lg), child: Text( widget.title, style: IoFlipTextStyles.headlineH4Light, textAlign: TextAlign.center, ), ), _gap, Expanded( child: Stack( children: [ Center( child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(PromptFormView.itemExtent), border: Border.all(color: IoFlipColors.seedYellow, width: 2), ), padding: itemPadding, child: Text( selectedText, style: IoFlipTextStyles.mobileH3.copyWith( color: Colors.transparent, ), ), ), ), Positioned.fill( child: Container( foregroundDecoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ backgroundColor, backgroundColor.withOpacity(0), backgroundColor.withOpacity(0), backgroundColor, ], stops: const [0, .05, .95, 1], ), ), child: ListWheelScrollView.useDelegate( controller: scrollController, diameterRatio: 500, // flat list in practice scrollBehavior: ScrollConfiguration.of(context).copyWith( dragDevices: { PointerDeviceKind.touch, PointerDeviceKind.mouse, }, ), itemExtent: PromptFormView.itemExtent, physics: const SnapItemScrollPhysics( itemExtent: PromptFormView.itemExtent, ), onSelectedItemChanged: (index) { setState(() => selectedIndex = index); }, childDelegate: ListWheelChildBuilderDelegate( builder: (_, index) { return Center( child: MouseRegion( cursor: SystemMouseCursors.click, child: GestureDetector( onTap: () { scrollController.animateToItem( index, duration: const Duration(milliseconds: 300), curve: Curves.easeOutCubic, ); }, child: Container( padding: itemPadding, decoration: BoxDecoration( borderRadius: BorderRadius.circular( PromptFormView.itemExtent, ), ), child: Text( widget.itemsList[index], style: IoFlipTextStyles.mobileH3.copyWith( color: index == selectedIndex ? IoFlipColors.seedYellow : IoFlipColors.seedGrey70, ), ), ), ), ), ); }, childCount: widget.itemsList.length, ), ), ), ), ], ), ), _gap, IoFlipBottomBar( leading: const AudioToggleButton(), middle: RoundedButton.text( l10n.select.toUpperCase(), onPressed: () => _onSubmit(selectedText), ), ), ], ); } String get selectedText => widget.itemsList[selectedIndex]; void _onSubmit(String field) { widget.isLastOfFlow ? context.completeFlow<Prompt>( (data) => data.copyWithNewAttribute(selectedText), ) : context.updateFlow<Prompt>( (data) => data.copyWithNewAttribute(selectedText), ); } }
io_flip/lib/prompt/view/prompt_form_view.dart/0
{ "file_path": "io_flip/lib/prompt/view/prompt_form_view.dart", "repo_id": "io_flip", "token_count": 3601 }
827
export 'local_storage_settings_persistence.dart'; export 'memory_settings_persistence.dart'; export 'settings_persistence.dart';
io_flip/lib/settings/persistence/persistence.dart/0
{ "file_path": "io_flip/lib/settings/persistence/persistence.dart", "repo_id": "io_flip", "token_count": 39 }
828
// ignore_for_file: avoid_print import 'package:api_client/api_client.dart'; import 'package:game_domain/game_domain.dart'; void main() async { final client = ApiClient( baseUrl: 'https://top-dash-dev-api-synvj3dcmq-uc.a.run.app', idTokenStream: const Stream.empty(), refreshIdToken: () async => null, appCheckTokenStream: const Stream.empty(), ); final cards = await client.gameResource.generateCards(const Prompt()); print(cards); }
io_flip/packages/api_client/example/main.dart/0
{ "file_path": "io_flip/packages/api_client/example/main.dart", "repo_id": "io_flip", "token_count": 164 }
829
import 'dart:developer'; import 'package:cloud_firestore/cloud_firestore.dart'; /// {@template config_repository} /// Repository for remote configs. /// {@endtemplate} class ConfigRepository { /// {@macro config_repository} ConfigRepository({ required this.db, }) { configCollection = db.collection('config'); } /// The wait time for private matches. final int defaultPrivateTimeLimit = 120; /// The wait time for a match before a CPU joins. final int defaultMatchWaitTimeLimit = 4; /// The percentage of users that will be auto matched against a CPU. final double defaultCPUAutoMatchPercentage = 1; /// The [FirebaseFirestore] instance. final FirebaseFirestore db; /// The [CollectionReference] for the config. late final CollectionReference<Map<String, dynamic>> configCollection; /// Return the private match wait time limit. Future<int> getPrivateMatchTimeLimit() async { try { final results = await configCollection .where('type', isEqualTo: 'private_match_time_limit') .get(); final data = results.docs.first.data(); return data['value'] as int; } catch (error, stackStrace) { log( 'Error fetching private match time limit from db, return the default ' 'value', error: error, stackTrace: stackStrace, ); } return defaultPrivateTimeLimit; } /// Return the match wait time limit before CPU joins. Future<int> getMatchWaitTimeLimit() async { try { final results = await configCollection .where('type', isEqualTo: 'match_wait_time_limit') .get(); final data = results.docs.first.data(); return data['value'] as int; } catch (error, stackStrace) { log( 'Error match time limit from db, return the default ' 'value', error: error, stackTrace: stackStrace, ); } return defaultMatchWaitTimeLimit; } /// Return the percentage of matches that should be matched with CPU. Future<double> getCPUAutoMatchPercentage() async { try { final results = await configCollection .where('type', isEqualTo: 'cpu_auto_match_percentage') .get(); final data = results.docs.first.data(); return (data['value'] as double).clamp(0.0, 1.0); } catch (error, stackStrace) { log( 'Error match time limit from db, return the default ' 'value', error: error, stackTrace: stackStrace, ); } return defaultCPUAutoMatchPercentage; } }
io_flip/packages/config_repository/lib/src/config_repository.dart/0
{ "file_path": "io_flip/packages/config_repository/lib/src/config_repository.dart", "repo_id": "io_flip", "token_count": 929 }
830
import 'package:flame/cache.dart'; import 'package:flutter/material.dart' hide Element; import 'package:gallery/story_scaffold.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; import 'package:provider/provider.dart'; class ElementalDamageStory extends StatefulWidget { const ElementalDamageStory(this.element, {super.key}); final Element element; @override State<ElementalDamageStory> createState() => _ElementalDamageStoryState(); } class _ElementalDamageStoryState extends State<ElementalDamageStory> { @override Widget build(BuildContext context) { return Provider( create: (_) => Images(prefix: ''), child: StoryScaffold( title: 'Elemental Damage Story', body: Center( child: Row( children: [ SizedBox( width: 300, height: 500, child: Stack( children: [ Positioned( top: 0, left: 0, child: GameCard( image: 'https://firebasestorage.googleapis.com/v0/b/top-dash-dev.appspot.com/o/public%2FDash_pirate_trumpets_field.png?alt=media', name: 'Dash the Great', description: 'The best Dash in all the Dashland', suitName: widget.element.name, power: 57, size: const GameCardSize.md(), isRare: false, ), ), const Positioned( bottom: 0, right: 0, child: GameCard( image: 'https://firebasestorage.googleapis.com/v0/b/top-dash-dev.appspot.com/o/public%2FDash_pirate_trumpets_field.png?alt=media', name: 'Dash the Great', description: 'The best Dash in all the Dashland', suitName: 'earth', power: 57, size: GameCardSize.md(), isRare: false, ), ), Positioned( child: ElementalDamageAnimation( widget.element, direction: DamageDirection.topToBottom, size: const GameCardSize.md(), initialState: DamageAnimationState.charging, assetSize: AssetSize.small, onComplete: () {}, ), ), ], ), ), SizedBox( width: 300, height: 500, child: Stack( children: [ const Positioned( top: 0, left: 0, child: GameCard( image: 'https://firebasestorage.googleapis.com/v0/b/top-dash-dev.appspot.com/o/public%2FDash_pirate_trumpets_field.png?alt=media', name: 'Dash the Great', description: 'The best Dash in all the Dashland', suitName: 'earth', power: 57, size: GameCardSize.md(), isRare: false, ), ), Positioned( bottom: 0, right: 0, child: GameCard( image: 'https://firebasestorage.googleapis.com/v0/b/top-dash-dev.appspot.com/o/public%2FDash_pirate_trumpets_field.png?alt=media', name: 'Dash the Great', description: 'The best Dash in all the Dashland', suitName: widget.element.name, power: 57, size: const GameCardSize.md(), isRare: false, ), ), Positioned( child: ElementalDamageAnimation( widget.element, direction: DamageDirection.bottomToTop, size: const GameCardSize.md(), initialState: DamageAnimationState.charging, assetSize: AssetSize.small, onComplete: () {}, ), ), ], ), ), ], ), ), ), ); } }
io_flip/packages/io_flip_ui/gallery/lib/widgets/elemental_damage_story.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/gallery/lib/widgets/elemental_damage_story.dart", "repo_id": "io_flip", "token_count": 2950 }
831
import 'package:io_flip_ui/gen/assets.gen.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; /// {@template metal_damage} // ignore: comment_references /// A widget that renders several [SpriteAnimation]s for the damages /// of a card on another. /// {@endtemplate} class MetalDamage extends ElementalDamage { /// {@macro metal_damage} MetalDamage({required super.size}) : super( chargeBackPath: Assets.images.elements.desktop.metal.chargeBack.keyName, chargeFrontPath: Assets.images.elements.desktop.metal.chargeFront.keyName, damageReceivePath: Assets.images.elements.desktop.metal.damageReceive.keyName, damageSendPath: Assets.images.elements.desktop.metal.damageSend.keyName, victoryChargeBackPath: Assets.images.elements.desktop.metal.victoryChargeBack.keyName, victoryChargeFrontPath: Assets.images.elements.desktop.metal.victoryChargeFront.keyName, badgePath: Assets.images.suits.card.metal.keyName, animationColor: IoFlipColors.seedGreen, ); }
io_flip/packages/io_flip_ui/lib/src/animations/damages/metal_damage.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/lib/src/animations/damages/metal_damage.dart", "repo_id": "io_flip", "token_count": 467 }
832
export 'platform_aware_asset.dart';
io_flip/packages/io_flip_ui/lib/src/utils/utils.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/lib/src/utils/utils.dart", "repo_id": "io_flip", "token_count": 13 }
833
import 'dart:math' as math; import 'dart:ui'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart' hide Card; import 'package:flutter_svg/flutter_svg.dart'; import 'package:io_flip_ui/gen/assets.gen.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; /// {@template game_card_size} /// A class that holds information about card dimensions. /// {@endtemplate} class GameCardSize extends Equatable { /// {@macro game_card_size} const GameCardSize({ required this.size, required this.badgeSize, required this.titleTextStyle, required this.descriptionTextStyle, required this.powerTextStyle, required this.powerTextStrokeWidth, required this.imageInset, }); /// XXS size. const GameCardSize.xxs() : this( size: IoFlipCardSizes.xxs, titleTextStyle: IoFlipTextStyles.cardTitleXXS, descriptionTextStyle: IoFlipTextStyles.cardDescriptionXXS, badgeSize: const Size.square(22), powerTextStyle: IoFlipTextStyles.cardNumberXXS, powerTextStrokeWidth: 2, imageInset: const RelativeRect.fromLTRB(4, 3, 4, 24), ); /// XS size. const GameCardSize.xs() : this( size: IoFlipCardSizes.xs, badgeSize: const Size.square(41), titleTextStyle: IoFlipTextStyles.cardTitleXS, descriptionTextStyle: IoFlipTextStyles.cardDescriptionXS, powerTextStyle: IoFlipTextStyles.cardNumberXS, powerTextStrokeWidth: 2, imageInset: const RelativeRect.fromLTRB(8, 6, 8, 44), ); /// SM size. const GameCardSize.sm() : this( size: IoFlipCardSizes.sm, badgeSize: const Size.square(55), titleTextStyle: IoFlipTextStyles.cardTitleSM, descriptionTextStyle: IoFlipTextStyles.cardDescriptionSM, powerTextStyle: IoFlipTextStyles.cardNumberSM, powerTextStrokeWidth: 2, imageInset: const RelativeRect.fromLTRB(12, 10, 12, 60), ); /// MD size. const GameCardSize.md() : this( size: IoFlipCardSizes.md, badgeSize: const Size.square(70), titleTextStyle: IoFlipTextStyles.cardTitleMD, descriptionTextStyle: IoFlipTextStyles.cardDescriptionMD, powerTextStyle: IoFlipTextStyles.cardNumberMD, powerTextStrokeWidth: 3, imageInset: const RelativeRect.fromLTRB(14, 12, 14, 74), ); /// LG size. const GameCardSize.lg() : this( size: IoFlipCardSizes.lg, badgeSize: const Size.square(89), titleTextStyle: IoFlipTextStyles.cardTitleLG, descriptionTextStyle: IoFlipTextStyles.cardDescriptionLG, powerTextStyle: IoFlipTextStyles.cardNumberLG, powerTextStrokeWidth: 4, imageInset: const RelativeRect.fromLTRB(18, 14, 18, 96), ); /// XL size. const GameCardSize.xl() : this( size: IoFlipCardSizes.xl, badgeSize: const Size.square(110), titleTextStyle: IoFlipTextStyles.cardTitleXL, descriptionTextStyle: IoFlipTextStyles.cardDescriptionXL, powerTextStyle: IoFlipTextStyles.cardNumberXL, powerTextStrokeWidth: 4, imageInset: const RelativeRect.fromLTRB(20, 16, 20, 116), ); /// XXL size. const GameCardSize.xxl() : this( size: IoFlipCardSizes.xxl, badgeSize: const Size.square(130), titleTextStyle: IoFlipTextStyles.cardTitleXXL, descriptionTextStyle: IoFlipTextStyles.cardDescriptionXXL, powerTextStyle: IoFlipTextStyles.cardNumberXXL, powerTextStrokeWidth: 4, imageInset: const RelativeRect.fromLTRB(24, 20, 24, 136), ); /// The size of the card. final Size size; /// The size of the badge. final Size badgeSize; /// Name text style final TextStyle titleTextStyle; /// Description text style final TextStyle descriptionTextStyle; /// Power text style final TextStyle powerTextStyle; /// Power text stroke width final double powerTextStrokeWidth; /// The inset of the image. final RelativeRect imageInset; /// Get the width of the card. double get width => size.width; /// Get the height of the card. double get height => size.height; /// Interpolates between two [GameCardSize]s, linearly by a factor of [t]. static GameCardSize? lerp(GameCardSize? a, GameCardSize? b, double t) { final titleTextStyle = TextStyle.lerp( a?.titleTextStyle, b?.titleTextStyle, t, ); final descriptionTextStyle = TextStyle.lerp( a?.descriptionTextStyle, b?.descriptionTextStyle, t, ); final powerTextStyle = TextStyle.lerp( a?.powerTextStyle, b?.powerTextStyle, t, ); final powerTextStrokeWidth = lerpDouble( a?.powerTextStrokeWidth, b?.powerTextStrokeWidth, t, ); final imageInset = RelativeRect.lerp( a?.imageInset, b?.imageInset, t, ); final size = Size.lerp(a?.size, b?.size, t); final badgeSize = Size.lerp( a?.badgeSize, b?.badgeSize, t, ); if (titleTextStyle == null || descriptionTextStyle == null || powerTextStyle == null || powerTextStrokeWidth == null || size == null || badgeSize == null || imageInset == null) { return null; } return GameCardSize( imageInset: imageInset, size: size, badgeSize: badgeSize, titleTextStyle: titleTextStyle, descriptionTextStyle: descriptionTextStyle, powerTextStyle: powerTextStyle, powerTextStrokeWidth: powerTextStrokeWidth, ); } @override List<Object?> get props => [ size, descriptionTextStyle, titleTextStyle, powerTextStyle, powerTextStrokeWidth, imageInset, ]; } /// {@template game_card} /// I/O FLIP Game Card. /// {@endtemplate} class GameCard extends StatelessWidget { /// {@macro game_card} const GameCard({ required this.image, required this.name, required this.suitName, required this.power, required this.description, required this.isRare, this.size = const GameCardSize.lg(), this.overlay, this.isDimmed = false, this.tilt = Offset.zero, @visibleForTesting this.package = 'io_flip_ui', super.key, @visibleForTesting this.overridePlatformAwareAsset, }); /// [CardOverlayType] type of overlay or null if no overlay final CardOverlayType? overlay; /// The size of the card. final GameCardSize size; /// Image final String image; /// Name final String name; /// Description final String description; /// Suit name final String suitName; ///Power final int power; /// Is a rare card final bool isRare; /// Whether the card should be dimmed or not. final bool isDimmed; /// An offset with x and y values between -1 and 1, representing how much the /// card should be tilted. final Offset tilt; /// Used to override the default asset resolution based on the platform. final PlatformAwareAsset<bool>? overridePlatformAwareAsset; /// The name of the package from which this widget is included. /// /// This is used to lookup the shader asset. @visibleForTesting final String? package; (String, SvgPicture) _mapSuitNameToAssets() { switch (suitName) { case 'fire': if (isRare) { return ( Assets.images.cardFrames.holos.cardFire.keyName, Assets.images.suits.card.fire.svg(), ); } return ( Assets.images.cardFrames.cardFire.keyName, Assets.images.suits.card.fire.svg(), ); case 'water': if (isRare) { return ( Assets.images.cardFrames.holos.cardWater.keyName, Assets.images.suits.card.water.svg(), ); } return ( Assets.images.cardFrames.cardWater.keyName, Assets.images.suits.card.water.svg(), ); case 'earth': if (isRare) { return ( Assets.images.cardFrames.holos.cardEarth.keyName, Assets.images.suits.card.earth.svg(), ); } return ( Assets.images.cardFrames.cardEarth.keyName, Assets.images.suits.card.earth.svg(), ); case 'air': if (isRare) { return ( Assets.images.cardFrames.holos.cardAir.keyName, Assets.images.suits.card.air.svg(), ); } return ( Assets.images.cardFrames.cardAir.keyName, Assets.images.suits.card.air.svg(), ); case 'metal': if (isRare) { return ( Assets.images.cardFrames.holos.cardMetal.keyName, Assets.images.suits.card.metal.svg(), ); } return ( Assets.images.cardFrames.cardMetal.keyName, Assets.images.suits.card.metal.svg(), ); default: throw ArgumentError('Invalid suit name'); } } @override Widget build(BuildContext context) { final (cardFrame, suitSvg) = _mapSuitNameToAssets(); final shaderChild = Stack( children: [ Positioned.fromRelativeRect( rect: size.imageInset, child: Image.network( image, errorBuilder: (_, __, ___) { return Container( foregroundDecoration: const BoxDecoration( color: IoFlipColors.seedGrey50, backgroundBlendMode: BlendMode.saturation, ), decoration: const BoxDecoration( color: IoFlipColors.seedBlack, ), child: IoFlipLogo(), ); }, ), ), Positioned.fill( child: Image.asset(cardFrame), ), ], ); final borderRadius = BorderRadius.circular(size.width * 0.08); final isShaderAvailable = (overridePlatformAwareAsset ?? platformAwareAsset)( desktop: true, mobile: false, ); return Stack( clipBehavior: Clip.none, children: [ SizedBox( width: size.width, height: size.height, child: Transform( alignment: Alignment.center, transform: CardTransform( rotateY: -tilt.dx * math.pi / 8, rotateX: tilt.dy * math.pi / 8, ), child: Stack( children: [ if (isRare && isShaderAvailable) ClipRRect( borderRadius: borderRadius, child: FoilShader( package: package, dx: tilt.dx, dy: tilt.dy, child: shaderChild, ), ) else shaderChild, Align( alignment: Alignment.topRight, child: SizedBox( width: size.badgeSize.width, height: size.badgeSize.height, child: Stack( children: [ Positioned.fill(child: suitSvg), Align( alignment: const Alignment(.15, .4), child: Stack( clipBehavior: Clip.none, children: [ Text( power.toString(), style: size.powerTextStyle.copyWith( shadows: [ Shadow( offset: Offset( size.size.width * 0.014, size.size.height * 0.013, ), color: IoFlipColors.seedBlack, ), ], foreground: Paint() ..style = PaintingStyle.stroke ..strokeWidth = size.powerTextStrokeWidth ..color = IoFlipColors.seedBlack, ), ), Text( power.toString(), style: size.powerTextStyle, ), ], ), ), ], ), ), ), Align( alignment: const Alignment(0, .5), child: Text( name, textAlign: TextAlign.center, style: size.titleTextStyle.copyWith( color: IoFlipColors.seedBlack, ), ), ), Align( alignment: const Alignment(0, .95), child: SizedBox( width: size.width * 0.8, height: size.height * 0.2, child: Align( alignment: Alignment.topCenter, child: Text( description, textAlign: TextAlign.center, style: size.descriptionTextStyle.copyWith( color: IoFlipColors.seedBlack, ), ), ), ), ), ], ), ), ), if (overlay != null) Positioned( top: -1, bottom: -1, left: -1, right: -1, child: CardOverlay.ofType( overlay!, borderRadius: borderRadius, isDimmed: isDimmed, ), ) ], ); } }
io_flip/packages/io_flip_ui/lib/src/widgets/game_card.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/lib/src/widgets/game_card.dart", "repo_id": "io_flip", "token_count": 7348 }
834
import 'package:flutter_test/flutter_test.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; void main() { group('GameCardRect', () { test('rect returns the correct value', () { const gameCardSize = GameCardSize.xs(); const offset = Offset(20, 50); const gameCardRect = GameCardRect( gameCardSize: gameCardSize, offset: offset, ); expect(gameCardRect.rect, offset & gameCardSize.size); }); }); group('GameCardRectTween', () { const begin = GameCardRect( gameCardSize: GameCardSize.xs(), offset: Offset(20, 50), ); const end = GameCardRect( gameCardSize: GameCardSize.lg(), offset: Offset(100, 200), ); final tween = GameCardRectTween(begin: begin, end: end); group('lerp', () { test('with t = 0', () { final result = tween.lerp(0); expect(result, begin); }); test('with t = 1', () { final result = tween.lerp(1); expect(result, end); }); for (var i = 1; i < 10; i += 1) { final t = i / 10; test('with t = $t', () { final result = tween.lerp(t)!; expect( result.offset, equals(Offset.lerp(begin.offset, end.offset, t)), ); expect( result.gameCardSize, equals(GameCardSize.lerp(begin.gameCardSize, end.gameCardSize, t)), ); }); } }); }); }
io_flip/packages/io_flip_ui/test/src/animations/game_card_rect_tween_test.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/test/src/animations/game_card_rect_tween_test.dart", "repo_id": "io_flip", "token_count": 680 }
835
import 'package:flame/cache.dart'; import 'package:flame/widgets.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; import 'package:mocktail/mocktail.dart'; import 'package:provider/provider.dart'; class _MockImages extends Mock implements Images {} void main() { group('FlipCountdown', () { late Images images; setUp(() { images = _MockImages(); }); testWidgets('renders SpriteAnimationWidget on desktop', (tester) async { await tester.pumpWidget( Theme( data: IoFlipTheme.themeData.copyWith(platform: TargetPlatform.macOS), child: Directionality( textDirection: TextDirection.ltr, child: Provider.value( value: images, child: const FlipCountdown(), ), ), ), ); expect(find.byType(SpriteAnimationWidget), findsOneWidget); }); testWidgets('renders other animation on mobile', (tester) async { var complete = false; await tester.pumpWidget( Theme( data: IoFlipTheme.themeData.copyWith(platform: TargetPlatform.iOS), child: Directionality( textDirection: TextDirection.ltr, child: Provider.value( value: images, child: FlipCountdown( onComplete: () { complete = true; }, ), ), ), ), ); expect(find.byType(SpriteAnimationWidget), findsNothing); expect(find.byKey(const Key('flipCountdown_mobile')), findsOneWidget); await tester.pumpAndSettle(); expect(complete, isTrue); }); }); }
io_flip/packages/io_flip_ui/test/src/widgets/flip_countdown_test.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/test/src/widgets/flip_countdown_test.dart", "repo_id": "io_flip", "token_count": 796 }
836
// ignore_for_file: prefer_const_constructors, one_member_abstracts import 'package:api_client/api_client.dart'; import 'package:bloc_test/bloc_test.dart'; import 'package:flame/cache.dart'; import 'package:flutter/material.dart' hide Card; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:game_domain/game_domain.dart'; import 'package:go_router/go_router.dart'; import 'package:io_flip/audio/audio_controller.dart'; import 'package:io_flip/draft/draft.dart'; import 'package:io_flip/gen/assets.gen.dart'; import 'package:io_flip/how_to_play/how_to_play.dart'; import 'package:io_flip/l10n/l10n.dart'; import 'package:io_flip/match_making/match_making.dart'; import 'package:io_flip/settings/settings.dart'; import 'package:io_flip/share/share.dart'; import 'package:io_flip/utils/utils.dart'; import 'package:mocktail/mocktail.dart'; import 'package:mocktail_image_network/mocktail_image_network.dart'; import '../../helpers/helpers.dart'; class _MockDraftBloc extends Mock implements DraftBloc {} class _MockSettingsController extends Mock implements SettingsController {} class _MockRouter extends Mock implements NeglectRouter {} class _MockBuildContext extends Mock implements BuildContext {} class _MockAudioController extends Mock implements AudioController {} class _MockShareResource extends Mock implements ShareResource {} void main() { group('DraftView', () { late DraftBloc draftBloc; late NeglectRouter router; const card1 = Card( id: '1', name: 'card1', description: '', rarity: false, image: '', power: 1, suit: Suit.air, ); const card2 = Card( id: '2', name: 'card2', description: '', rarity: true, image: '', power: 1, suit: Suit.air, ); const card3 = Card( id: '3', name: 'card3', description: '', rarity: true, image: '', power: 1, suit: Suit.air, ); void mockState(List<DraftState> states) { whenListen( draftBloc, Stream.fromIterable(states), initialState: states.first, ); } setUpAll(() { registerFallbackValue(_MockBuildContext()); }); setUp(() { draftBloc = _MockDraftBloc(); const state = DraftState.initial(); mockState([state]); router = _MockRouter(); when(() => router.neglect(any(), any())).thenAnswer((_) { final callback = _.positionalArguments[1] as VoidCallback; callback(); }); }); testWidgets('renders correctly', (tester) async { mockState( [ DraftState( cards: const [card1, card2], selectedCards: const [], status: DraftStateStatus.deckLoaded, firstCardOpacity: 1, ) ], ); await tester.pumpSubject(draftBloc: draftBloc); expect(find.byType(DraftView), findsOneWidget); }); testWidgets('renders the loaded cards', (tester) async { mockState( [ DraftState( cards: const [card1, card2], selectedCards: const [], status: DraftStateStatus.deckLoaded, firstCardOpacity: 1, ) ], ); await tester.pumpSubject(draftBloc: draftBloc); expect(find.text('card1'), findsOneWidget); expect(find.text('card2'), findsOneWidget); }); testWidgets('precaches all images', (tester) async { final images = <ImageProvider<Object>>[]; mockState( [ DraftState( cards: const [card1, card2], selectedCards: const [], status: DraftStateStatus.deckLoaded, firstCardOpacity: 1, ) ], ); await tester.pumpSubject( draftBloc: draftBloc, cacheImage: (provider, __) async { images.add(provider); }, ); expect( images, containsAll([NetworkImage(card1.image), NetworkImage(card2.image)]), ); }); testWidgets('selects the top card', (tester) async { mockState( [ DraftState( cards: const [card1, card2], selectedCards: const [], status: DraftStateStatus.deckLoaded, firstCardOpacity: 1, ) ], ); await tester.pumpSubject(draftBloc: draftBloc); await tester.pumpAndSettle(); await tester.tap(find.byKey(ValueKey('SelectedCard0'))); await tester.pumpAndSettle(); verify(() => draftBloc.add(SelectCard(0))).called(1); }); testWidgets('can go to the next card by swiping', (tester) async { mockState( [ DraftState( cards: const [card1, card2], selectedCards: const [], status: DraftStateStatus.deckLoaded, firstCardOpacity: 1, ) ], ); await tester.pumpSubject(draftBloc: draftBloc); await tester.drag( find.byKey(ValueKey(card1.id)), Offset(double.maxFinite, 0), ); await tester.pumpAndSettle(); verify(() => draftBloc.add(CardSwiped())).called(1); }); testWidgets('can go to the next card by tapping icon', (tester) async { mockState( [ DraftState( cards: const [card1, card2], selectedCards: const [], status: DraftStateStatus.deckLoaded, firstCardOpacity: 1, ) ], ); await tester.pumpSubject(draftBloc: draftBloc); await tester.tap(find.byIcon(Icons.arrow_forward_ios)); await tester.pumpAndSettle(); verify(() => draftBloc.add(NextCard())).called(1); }); testWidgets('can go to the previous card by tapping icon', (tester) async { mockState( [ DraftState( cards: const [card1, card2], selectedCards: const [], status: DraftStateStatus.deckLoaded, firstCardOpacity: 1, ) ], ); await tester.pumpSubject(draftBloc: draftBloc); await tester.tap(find.byIcon(Icons.arrow_back_ios_new)); await tester.pumpAndSettle(); verify(() => draftBloc.add(PreviousCard())).called(1); }); testWidgets( 'opens share dialog card by tapping share icon', (tester) async { mockState( [ DraftState( cards: const [card1, card2], selectedCards: const [], status: DraftStateStatus.deckLoaded, firstCardOpacity: 1, ) ], ); await tester.pumpSubject(draftBloc: draftBloc); await tester.tap(find.byIcon(Icons.share_outlined)); await tester.pumpAndSettle(); expect(find.byType(ShareCardDialog), findsOneWidget); }, ); testWidgets('renders an error message when loading failed', (tester) async { mockState( [ DraftState( cards: const [card1, card2], selectedCards: const [], status: DraftStateStatus.deckFailed, firstCardOpacity: 1, ) ], ); await tester.pumpSubject(draftBloc: draftBloc); expect( find.text('Error generating cards, please try again in a few moments'), findsOneWidget, ); }); testWidgets( 'render the play button once deck is complete', (tester) async { mockState( [ DraftState( cards: const [card1, card2, card3], selectedCards: const [card1, card2, card3], status: DraftStateStatus.deckSelected, firstCardOpacity: 1, ) ], ); await tester.pumpSubject(draftBloc: draftBloc); final l10n = tester.element(find.byType(DraftView)).l10n; expect(find.text(l10n.joinMatch.toUpperCase()), findsOneWidget); }, ); testWidgets( 'requests player deck creation when clicking on play', (tester) async { final goRouter = MockGoRouter(); mockState( [ DraftState( cards: const [card1, card2, card3], selectedCards: const [card1, card2, card3], status: DraftStateStatus.deckSelected, firstCardOpacity: 1, ) ], ); await tester.pumpSubject( draftBloc: draftBloc, goRouter: goRouter, routerNeglectCall: router.neglect, ); final l10n = tester.element(find.byType(DraftView)).l10n; await tester.tap(find.text(l10n.joinMatch.toUpperCase())); verify( () => draftBloc.add( PlayerDeckRequested([card1.id, card2.id, card3.id]), ), ).called(1); }, ); testWidgets( 'requests player deck creation when clicking on create private match', (tester) async { final goRouter = MockGoRouter(); mockState( [ DraftState( cards: const [card1, card2, card3], selectedCards: const [card1, card2, card3], status: DraftStateStatus.deckSelected, firstCardOpacity: 1, ) ], ); await tester.pumpSubject( draftBloc: draftBloc, goRouter: goRouter, routerNeglectCall: router.neglect, ); await tester.longPress(find.text(tester.l10n.joinMatch.toUpperCase())); await tester.pumpAndSettle(); await tester.tap(find.text('Create private match')); verify( () => draftBloc.add( PlayerDeckRequested( [card1.id, card2.id, card3.id], createPrivateMatch: true, ), ), ).called(1); }, ); testWidgets( 'navigates to matchmaking when player deck is created', (tester) async { final goRouter = MockGoRouter(); final deck = Deck( id: 'deckId', userId: 'userId', cards: const [card1, card2, card3], ); final baseState = DraftState( cards: const [card1, card2, card3], selectedCards: const [card1, card2, card3], status: DraftStateStatus.deckSelected, firstCardOpacity: 1, ); whenListen( draftBloc, Stream.fromIterable([ baseState, baseState.copyWith( status: DraftStateStatus.playerDeckCreated, deck: deck, ), ]), initialState: baseState, ); await tester.pumpSubject( draftBloc: draftBloc, goRouter: goRouter, routerNeglectCall: router.neglect, ); verify( () => goRouter.goNamed( 'match_making', extra: MatchMakingPageData(deck: deck), ), ).called(1); }, ); testWidgets( 'navigates to private matchmaking when player deck is created with ' 'private match options', (tester) async { final goRouter = MockGoRouter(); final deck = Deck( id: 'deckId', userId: 'userId', cards: const [card1, card2, card3], ); final baseState = DraftState( cards: const [card1, card2, card3], selectedCards: const [card1, card2, card3], status: DraftStateStatus.deckSelected, firstCardOpacity: 1, ); whenListen( draftBloc, Stream.fromIterable([ baseState, baseState.copyWith( status: DraftStateStatus.playerDeckCreated, createPrivateMatch: true, privateMatchInviteCode: 'code', deck: deck, ), ]), initialState: baseState, ); await tester.pumpSubject( draftBloc: draftBloc, goRouter: goRouter, routerNeglectCall: router.neglect, ); verify( () => goRouter.goNamed( 'match_making', extra: MatchMakingPageData( deck: deck, createPrivateMatch: true, inviteCode: 'code', ), ), ).called(1); }, ); testWidgets( 'requests player deck creation with an invite code when clicking on ' 'join private match and has input an invite code', (tester) async { final goRouter = MockGoRouter(); mockState( [ DraftState( cards: const [card1, card2, card3], selectedCards: const [card1, card2, card3], status: DraftStateStatus.deckSelected, firstCardOpacity: 1, ) ], ); await tester.pumpSubject( draftBloc: draftBloc, goRouter: goRouter, routerNeglectCall: router.neglect, ); await tester.longPress(find.text(tester.l10n.joinMatch.toUpperCase())); await tester.pumpAndSettle(); await tester.enterText(find.byType(TextField), 'invite-code'); await tester.tap(find.text('Join')); await tester.pumpAndSettle(); verify( () => draftBloc.add( PlayerDeckRequested( [card1.id, card2.id, card3.id], privateMatchInviteCode: 'invite-code', ), ), ).called(1); }, ); testWidgets( 'does not navigates to the private match lobby when clicking on create ' 'private match and private matches are disabled.', (tester) async { final goRouter = MockGoRouter(); mockState( [ DraftState( cards: const [card1, card2, card3], selectedCards: const [card1, card2, card3], status: DraftStateStatus.deckSelected, firstCardOpacity: 1, ) ], ); await tester.pumpSubject( draftBloc: draftBloc, goRouter: goRouter, routerNeglectCall: router.neglect, allowPrivateMatch: 'false', ); await tester.longPress(find.text(tester.l10n.joinMatch.toUpperCase())); await tester.pumpAndSettle(); expect(find.text('Create private match'), findsNothing); }, ); testWidgets( 'stay in the page when cancelling the input of the invite code', (tester) async { final goRouter = MockGoRouter(); mockState( [ DraftState( cards: const [card1, card2, card3], selectedCards: const [card1, card2, card3], status: DraftStateStatus.deckSelected, firstCardOpacity: 1, ) ], ); await tester.pumpSubject( draftBloc: draftBloc, goRouter: goRouter, ); await tester.longPress(find.text(tester.l10n.joinMatch.toUpperCase())); await tester.pumpAndSettle(); await tester.enterText(find.byType(TextField), 'invite-code'); await tester.tap(find.text('Cancel')); await tester.pumpAndSettle(); verifyNever( () => goRouter.goNamed( 'match_making', queryParams: { 'cardId': [card1, card2, card3].map((card) => card.id).toList(), 'inviteCode': 'invite-code', }, ), ); }, ); testWidgets( 'navigates to the how to play page', (tester) async { mockState( [ DraftState( cards: const [card1, card2, card3], selectedCards: const [card1, card2, card3], status: DraftStateStatus.deckSelected, firstCardOpacity: 1, ) ], ); await tester.pumpSubject( draftBloc: draftBloc, ); await tester.tap(find.byIcon(Icons.question_mark_rounded)); await tester.pumpAndSettle(); expect(find.byType(HowToPlayDialog), findsOneWidget); }, ); testWidgets( 'contains deck pack animation', (tester) async { mockState( [ DraftState( cards: const [card1, card2], selectedCards: const [], status: DraftStateStatus.deckLoaded, firstCardOpacity: 1, ) ], ); final audioController = _MockAudioController(); await tester.pumpSubject( draftBloc: draftBloc, audioController: audioController, ); expect(find.byType(DeckPack), findsOneWidget); }, ); testWidgets( 'plays card movement sfx correctly', (tester) async { mockState( [ DraftState( cards: const [card1, card2], selectedCards: const [], status: DraftStateStatus.deckLoaded, firstCardOpacity: 1, ) ], ); final audioController = _MockAudioController(); await tester.pumpSubject( draftBloc: draftBloc, audioController: audioController, ); final buttonFinder = find.byIcon(Icons.arrow_back_ios_new); expect(buttonFinder, findsOneWidget); await tester.tap(buttonFinder); verify( () => audioController.playSfx(Assets.sfx.cardMovement), ).called(1); }, ); }); } extension DraftViewTest on WidgetTester { Future<void> pumpSubject({ required DraftBloc draftBloc, GoRouter? goRouter, RouterNeglectCall routerNeglectCall = Router.neglect, String allowPrivateMatch = 'true', AudioController? audioController, CacheImageFunction? cacheImage, }) async { final SettingsController settingsController = _MockSettingsController(); when(() => settingsController.muted).thenReturn(ValueNotifier(true)); final ShareResource shareResource = _MockShareResource(); when(() => shareResource.twitterShareCardUrl(any())).thenReturn(''); when(() => shareResource.facebookShareCardUrl(any())).thenReturn(''); await mockNetworkImages(() async { await pumpApp( BlocProvider.value( value: draftBloc, child: DraftView( routerNeglectCall: routerNeglectCall, allowPrivateMatch: allowPrivateMatch, cacheImage: cacheImage ?? (_, __) async {}, ), ), images: Images(prefix: ''), router: goRouter, settingsController: settingsController, audioController: audioController, shareResource: shareResource, ); await pump(); final deckPackStates = stateList<DeckPackState>(find.byType(DeckPack)); if (deckPackStates.isNotEmpty) { final deckPackState = deckPackStates.first; // Complete animation await pumpAndSettle(); deckPackState.onComplete(); await pump(); } }); } }
io_flip/test/draft/views/draft_view_test.dart/0
{ "file_path": "io_flip/test/draft/views/draft_view_test.dart", "repo_id": "io_flip", "token_count": 9274 }
837
import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:io_flip/l10n/l10n.dart'; extension TesterL10n on WidgetTester { AppLocalizations get l10n { final app = widget<MaterialApp>(find.byType(MaterialApp)); final locale = app.locale ?? app.supportedLocales.first; return lookupAppLocalizations(locale); } }
io_flip/test/helpers/tester_l10n.dart/0
{ "file_path": "io_flip/test/helpers/tester_l10n.dart", "repo_id": "io_flip", "token_count": 135 }
838
import 'package:bloc_test/bloc_test.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:game_domain/game_domain.dart' as gd; import 'package:io_flip/leaderboard/leaderboard.dart'; import 'package:mocktail/mocktail.dart'; import '../../helpers/helpers.dart'; class _MockLeaderboardBloc extends MockBloc<LeaderboardEvent, LeaderboardState> implements LeaderboardBloc {} void main() { const playerOne = gd.LeaderboardPlayer( id: 'id', longestStreak: 1, initials: 'AAA', ); const playerTwo = gd.LeaderboardPlayer( id: 'id2', longestStreak: 2, initials: 'BBB', ); const leaderboardPlayers = [playerOne, playerTwo]; group('LeaderboardView', () { late LeaderboardBloc leaderboardBloc; setUp(() { leaderboardBloc = _MockLeaderboardBloc(); when(() => leaderboardBloc.state).thenReturn( const LeaderboardState.initial(), ); }); testWidgets( 'renders CircularProgressIndicator when status is initial', (tester) async { await tester.pumpSubject(leaderboardBloc: leaderboardBloc); expect(find.byType(CircularProgressIndicator), findsOneWidget); }, ); testWidgets( 'renders CircularProgressIndicator when status is loading', (tester) async { when(() => leaderboardBloc.state).thenReturn( const LeaderboardState( status: LeaderboardStateStatus.loading, leaderboard: [], ), ); await tester.pumpSubject(leaderboardBloc: leaderboardBloc); expect(find.byType(CircularProgressIndicator), findsOneWidget); }, ); testWidgets( 'renders leaderboard failure text when loading fails', (tester) async { when(() => leaderboardBloc.state).thenReturn( const LeaderboardState( status: LeaderboardStateStatus.failed, leaderboard: [], ), ); await tester.pumpSubject(leaderboardBloc: leaderboardBloc); expect(find.text(tester.l10n.leaderboardFailedToLoad), findsOneWidget); }, ); testWidgets('renders correct label', (tester) async { when(() => leaderboardBloc.state).thenReturn( const LeaderboardState( status: LeaderboardStateStatus.loaded, leaderboard: leaderboardPlayers, ), ); await tester.pumpSubject(leaderboardBloc: leaderboardBloc); final l10n = tester.l10n; expect(find.text(l10n.leaderboardLongestStreak), findsOneWidget); }); testWidgets( 'renders LeaderboardPlayers for longest streak', (tester) async { when(() => leaderboardBloc.state).thenReturn( const LeaderboardState( status: LeaderboardStateStatus.loaded, leaderboard: leaderboardPlayers, ), ); await tester.pumpSubject(leaderboardBloc: leaderboardBloc); expect(find.byType(LeaderboardPlayers), findsOneWidget); expect(find.text(playerOne.initials), findsOneWidget); expect(find.text(playerOne.longestStreak.toString()), findsOneWidget); expect(find.text(playerTwo.initials), findsOneWidget); expect(find.text(playerTwo.longestStreak.toString()), findsOneWidget); }, ); }); } extension DraftViewTest on WidgetTester { Future<void> pumpSubject({ required LeaderboardBloc leaderboardBloc, }) async { await pumpApp( Scaffold( body: BlocProvider.value( value: leaderboardBloc, child: const LeaderboardView(), ), ), ); } }
io_flip/test/leaderboard/views/leaderboard_view_test.dart/0
{ "file_path": "io_flip/test/leaderboard/views/leaderboard_view_test.dart", "repo_id": "io_flip", "token_count": 1507 }
839
import 'package:bloc_test/bloc_test.dart'; import 'package:flutter/material.dart' hide Card; import 'package:flutter_test/flutter_test.dart'; import 'package:game_domain/game_domain.dart'; import 'package:go_router/go_router.dart'; import 'package:io_flip/draft/draft.dart'; import 'package:io_flip/game/game.dart'; import 'package:io_flip/main_menu/main_menu_screen.dart'; import 'package:io_flip/match_making/match_making.dart'; import 'package:io_flip/prompt/prompt.dart'; import 'package:io_flip/router/router.dart'; import 'package:io_flip/settings/settings.dart'; import 'package:io_flip/share/share.dart'; import 'package:io_flip/terms_of_use/terms_of_use.dart'; import 'package:mocktail/mocktail.dart'; import '../helpers/helpers.dart'; class _MockTermsOfUseCubit extends MockCubit<bool> implements TermsOfUseCubit {} class _MockMatchMakingPageData extends Mock implements MatchMakingPageData { @override Deck get deck => const Deck(id: 'id', userId: 'userId', cards: []); } class _MockShareHandPageData extends Mock implements ShareHandPageData { static const card = Card( id: 'id', name: 'name', description: 'description', image: 'image', power: 1, rarity: false, suit: Suit.air, ); @override Deck get deck => const Deck( id: 'id', userId: 'userId', cards: [card, card, card], shareImage: '', ); @override String get initials => 'AAA'; @override int get wins => 1; } class _MockSettingsController extends Mock implements SettingsController {} void main() { group('createRouter', () { test('adds the script page when isScriptsEnabled is true', () { try { createRouter(isScriptsEnabled: true).goNamed( '_super_secret_scripts_page', ); } catch (_) { fail('Should not throw an exception'); } }); test("doesn't adds the scripts page when isScriptsEnabled is false", () { expect( () => createRouter(isScriptsEnabled: false) .goNamed('_super_secret_scripts_page'), throwsAssertionError, ); }); group('Router', () { late TermsOfUseCubit cubit; late GoRouter router; setUp(() { router = createRouter(isScriptsEnabled: false); cubit = _MockTermsOfUseCubit(); when(() => cubit.state).thenReturn(true); }); testWidgets( 'default route is MainMenuScreen', (tester) async { await tester.pumpAppWithRouter(router, termsOfUseCubit: cubit); expect(find.byType(MainMenuScreen), findsOneWidget); }, ); testWidgets( 'navigating to /draft should build DraftPage', (tester) async { await tester.pumpAppWithRouter(router, termsOfUseCubit: cubit); router.go('/draft'); await tester.pumpAndSettle(); expect(find.byType(DraftPage), findsOneWidget); }, ); testWidgets( 'navigating to /prompt should build PromptPage', (tester) async { await tester.pumpAppWithRouter(router, termsOfUseCubit: cubit); router.go('/prompt'); await tester.pumpAndSettle(); expect(find.byType(PromptPage), findsOneWidget); }, ); testWidgets( 'navigating to /match_making should build MatchMakingPage', (tester) async { final SettingsController settingsController = _MockSettingsController(); when(() => settingsController.muted).thenReturn(ValueNotifier(true)); await tester.pumpAppWithRouter( router, termsOfUseCubit: cubit, settingsController: settingsController, ); router.go('/match_making', extra: _MockMatchMakingPageData()); await tester.pumpAndSettle(); expect(find.byType(MatchMakingPage), findsOneWidget); }, ); testWidgets( 'navigating to /game should build GamePage', (tester) async { await tester.pumpAppWithRouter(router, termsOfUseCubit: cubit); router.go('/game'); await tester.pumpAndSettle(); expect(find.byType(GamePage), findsOneWidget); }, ); testWidgets( 'navigating to /share_hand should build ShareHandPage', (tester) async { final SettingsController settingsController = _MockSettingsController(); when(() => settingsController.muted).thenReturn(ValueNotifier(true)); await tester.pumpAppWithRouter( router, termsOfUseCubit: cubit, settingsController: settingsController, ); router.go('/share_hand', extra: _MockShareHandPageData()); await tester.pumpAndSettle(); expect(find.byType(ShareHandPage), findsOneWidget); }, ); }); group('RedirectToHomeObserver', () { testWidgets( 'redirects to root when the first route is not the root route', (tester) async { final router = GoRouter( routes: [ GoRoute( path: '/', pageBuilder: (context, state) => MaterialPage( child: _MainWidget(), ), ), GoRoute( path: '/other-page', pageBuilder: (context, state) => MaterialPage( child: _OtherWidget(), ), ), ], observers: [RedirectToHomeObserver()], ); final app = MaterialApp.router( routerDelegate: router.routerDelegate, routeInformationParser: router.routeInformationParser, ); await tester.pumpWidget(app); router.go('/other-page'); await tester.pumpAndSettle(); expect(find.byType(_MainWidget), findsOneWidget); expect(find.byType(_OtherWidget), findsNothing); }, ); }); }); } class _MainWidget extends StatelessWidget { @override Widget build(BuildContext context) { return const SizedBox.shrink(); } } class _OtherWidget extends StatelessWidget { @override Widget build(BuildContext context) { return const SizedBox.shrink(); } }
io_flip/test/router/router_test.dart/0
{ "file_path": "io_flip/test/router/router_test.dart", "repo_id": "io_flip", "token_count": 2783 }
840
import 'package:bloc_test/bloc_test.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:io_flip/terms_of_use/terms_of_use.dart'; void main() { group('TermsOfUseCubit', () { late TermsOfUseCubit cubit; setUp(() => cubit = TermsOfUseCubit()); test('initial state is false', () { expect(cubit.state, isFalse); }); blocTest<TermsOfUseCubit, bool>( 'emits [true] when acceptTermsOfUse is called', build: () => cubit, act: (cubit) => cubit.acceptTermsOfUse(), expect: () => [true], ); }); }
io_flip/test/terms_of_use/cubit/terms_of_use_cubit_test.dart/0
{ "file_path": "io_flip/test/terms_of_use/cubit/terms_of_use_cubit_test.dart", "repo_id": "io_flip", "token_count": 242 }
841
--- sidebar_position: 9 description: Learn how to configure in-app purchases in your Flutter news application. --- # In-app purchases This project supports in-app purchasing for Flutter using the [in_app_purchase](https://pub.dev/packages/in_app_purchase) package. The generated template application provides a mocked version of the`in_app_purchase` package called [`purchase_client`](https://github.com/flutter/news_toolkit/tree/main/flutter_news_example/packages/purchase_client). The [`PurchaseClient` class](https://github.com/flutter/news_toolkit/blob/main/flutter_news_example/packages/purchase_client/lib/src/purchase_client.dart#L36) implements `InAppPurchase` from the [in_app_purchase](https://pub.dev/packages/in_app_purchase) package and uses the same mechanism to expose the `purchaseStream`: ```dart @override Stream<List<PurchaseDetails>> get purchaseStream => _purchaseStream.stream; ``` The [products.dart](https://github.com/flutter/news_toolkit/blob/main/flutter_news_example/packages/purchase_client/lib/src/products.dart) file contains mocked products. The Dart Frog backend serves a list of available subscription data featuring copy text and price information. To edit the subscription data, change the `getSubscriptions()` method in your custom news data source. Make sure that the product IDs are the same for both your iOS and Android purchase project, as this information is passed to the platform-agnostic `in_app_purchase` package. To use the [in_app_purchase](https://pub.dev/packages/in_app_purchase) package, substitute `PurchaseClient` in [`main_development.dart`](https://github.com/flutter/news_toolkit/blob/main/flutter_news_example/lib/main/main_development.dart#L87) and [`main_production.dart`](https://github.com/flutter/news_toolkit/blob/main/flutter_news_example/lib/main/main_production.dart#L87) with the `in_app_purchase` package implementation. Then, follow the [Getting started](https://pub.dev/packages/in_app_purchase#getting-started) section in the `in_app_purchase` package docs.
news_toolkit/docs/docs/flutter_development/in_app_purchases.md/0
{ "file_path": "news_toolkit/docs/docs/flutter_development/in_app_purchases.md", "repo_id": "news_toolkit", "token_count": 602 }
842
--- sidebar_position: 3 description: Learn how to configure social login with Facebook and Twitter. --- # Authentication setup The Flutter News Toolkit comes pre-configured to support authentication using passwordless email, Google login, Apple ID, and social authentication using Facebook and Twitter login. To set this up for your news app, use the following instructions for each Firebase project and app. ## Email The news toolkit supports passwordless login. This means a deep link is sent to the user's email address, that when clicked will open your app and log the user in. ### Firebase configuration In your Firebase Console, go to **Firebase -> Authentication -> Sign-in-method -> Add new provider -> Email/Password** to set up your email authentication method. The toolkit currently supports a passwordless login flow, **so be sure to enable this setting as well**. :::note Passwordless authentication with an email link requires additional configuration steps. Please follow the steps for [authentication on Apple platforms](https://firebase.google.com/docs/auth/ios/email-link-auth?authuser=0) and [authentication on Android](https://firebase.google.com/docs/auth/android/email-link-auth?authuser=0) configurations. ::: Once the email authentication method is set up, go to **Firebase -> Engage -> Dynamic links**. Set up a new dynamic link URL prefix (for example, yourApplicationName.page.link) with a dynamic link URL of "/email_login". Once the dynamic link is set up, replace the placeholder value for **FLAVOR_DEEP_LINK_DOMAIN** inside the `launch.json` file with the **dynamic link URL prefix** you just created. This enviroment variable will be used inside `firebase_authentication_client.dart` to generate the dynamic link URL that will be sent to the user. In addition, replace the placeholder value for every **FLAVOR_DEEP_LINK_DOMAIN** key within your `project.pbxproj` file with the dynamic link URL prefix you just created. ## Google ### Firebase configuration In your Firebase Console, go to **Firebase -> Authentication -> Sign-in-method -> Add new provider -> Google** to set up your Google authentication method. Add your (Google) web ID and web client secret under the **Web SDK Configuration** dropdown menu. You can find your web client ID for existing projects by selecting your project and OAuth 2.0 entry on the [Google API Console](https://console.cloud.google.com/apis/credentials). ## Apple ### Firebase configuration In your Firebase Console, go to **Firebase -> Authentication -> Sign-in-method -> Add new provider -> Apple** to set up your Apple authentication method. Enable this in your app by following the additional configuration steps for [Apple authentication](https://firebase.google.com/docs/auth/ios/apple?authuser=0) and [Apple authentication on Android](https://firebase.google.com/docs/auth/android/apple?authuser=0). ### Complete the setup To complete setup, add this authorization callback URL to your app configuration in the Apple Developer Console. Additional steps might be needed to verify ownership of this web domain to Apple. To learn more, check out the [Firebase authentication](https://firebase.google.com/docs/auth/?authuser=0) page. ## Facebook ### Create an app Log in or create an account in the [Facebook Developer Portal](https://developers.facebook.com/apps/) to get started. Once logged in, create a new app to support your development project. In the same portal, enable the Facebook Login product (**Products -> Facebook Login**). Next, go to **Roles -> Roles** and add your developer team so the team can customize the app configuration for Android and iOS. Finally, go to **Settings -> Advanced** and enable **App authentication, native or desktop app?** ### Firebase configuration After setting up your [Firebase project](https://flutter.github.io/news_toolkit/project_configuration/firebase), go to **Firebase -> Authentication -> Sign-in-method -> Add new provider -> Facebook** to set up your Facebook authentication method. Fill in the app ID and secret from the created Facebook app. ### Complete the setup To complete your setup, add the OAuth redirect URI listed in your **Firebase Authentication Sign-in Method** to your Facebook app configuration. In addition, replace the placeholder value for every **FACEBOOK_APP_ID** , **FACEBOOK_CLIENT_TOKEN** and **FACEBOOK_DISPLAY_NAME** keys within your `project.pbxproj` file with their corresponding values. For additional details, check out the [Firebase authentication](https://firebase.google.com/docs/auth/?authuser=0) page. ## Twitter ### Create an app Log in or create an account in the [Twitter Developer Portal](https://developer.twitter.com/). Once logged in, create both a project and an app to enable Twitter authentication in your news app. Enable OAuth 2.0 authentication by setting "yourapp://" as the callback URI and "Native app" as the type of the app. If possible, add your full team as developers of the Twitter app, so everyone has access to the app's ID and secret. ### Enable elevated access Within [Twitter products](https://developer.twitter.com/en/portal/products), be sure to enable Twitter API v2 with "Elevated" access. Twitter needs this for authentication to work. :::note You might need to fill out a form to apply for "Elevated" access. ::: ### Firebase configuration After setting up your [Firebase project](https://flutter.github.io/news_toolkit/project_configuration/firebase), go to **Firebase -> Authentication -> Sign-in-method -> Add new provider -> Twitter** to set up your Twitter authentication method. Fill in the app ID and secret from the created Twitter app. ### Complete the setup To complete your setup, add the OAuth redirect URI listed in your **Firebase Authentication Sign-in Method** to your Twitter app configuration. In addition, replace the placeholder values for **TWITTER_API_KEY** and **TWITTER_API_SECRET** inside the `launch.json` file. You must also replace the placeholder value for every **TWITTER_REDIRECT_URI_SCHEME** key within your `project.pbxproj` file with their corresponding values. For more information, check out the [Firebase authentication](https://firebase.google.com/docs/auth/?authuser=0) page.
news_toolkit/docs/docs/project_configuration/social_authentication.md/0
{ "file_path": "news_toolkit/docs/docs/project_configuration/social_authentication.md", "repo_id": "news_toolkit", "token_count": 1536 }
843
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Launch Development", "request": "launch", "type": "dart", "program": "lib/main/main_development.dart", "args": [ "--flavor", "development", "--target", "lib/main/main_development.dart", "--dart-define", "FLAVOR_DEEP_LINK_DOMAIN=flutternewsexampledev.page.link", "--dart-define", "FLAVOR_DEEP_LINK_PATH=email_login", "--dart-define", "TWITTER_API_KEY=jxG8uZsNuHxn6oeUZm8wfWFcH", "--dart-define", "TWITTER_API_SECRET=eQMm0mdvraBIxh418IVGsujj6XnHwTEICLoIex7X7wMcJvEytI", "--dart-define", "TWITTER_REDIRECT_URI=flutter-news-example://" ], "presentation": { "group": "1_frontend", "order": 1 } }, { "name": "Launch Production", "request": "launch", "type": "dart", "program": "lib/main/main_production.dart", "args": [ "--flavor", "production", "--target", "lib/main/main_production.dart" ], "presentation": { "group": "1_frontend", "order": 2 } }, { "name": "Launch UI Gallery", "request": "launch", "type": "dart", "program": "packages/app_ui/gallery/lib/main.dart", "presentation": { "group": "2_gallery", "order": 1 } } ] }
news_toolkit/flutter_news_example/.vscode/launch.json/0
{ "file_path": "news_toolkit/flutter_news_example/.vscode/launch.json", "repo_id": "news_toolkit", "token_count": 947 }
844
// GENERATED CODE - DO NOT MODIFY BY HAND part of 'related_articles.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** RelatedArticles _$RelatedArticlesFromJson(Map<String, dynamic> json) => RelatedArticles( blocks: const NewsBlocksConverter().fromJson(json['blocks'] as List), totalBlocks: json['totalBlocks'] as int, ); Map<String, dynamic> _$RelatedArticlesToJson(RelatedArticles instance) => <String, dynamic>{ 'blocks': const NewsBlocksConverter().toJson(instance.blocks), 'totalBlocks': instance.totalBlocks, };
news_toolkit/flutter_news_example/api/lib/src/data/models/related_articles.g.dart/0
{ "file_path": "news_toolkit/flutter_news_example/api/lib/src/data/models/related_articles.g.dart", "repo_id": "news_toolkit", "token_count": 204 }
845
import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; import 'package:news_blocks/news_blocks.dart'; part 'feed_response.g.dart'; /// {@template feed_response} /// A news feed response object which contains news feed metadata. /// {@endtemplate} @JsonSerializable() class FeedResponse extends Equatable { /// {@macro feed_response} const FeedResponse({required this.feed, required this.totalCount}); /// Converts a `Map<String, dynamic>` into a [FeedResponse] instance. factory FeedResponse.fromJson(Map<String, dynamic> json) => _$FeedResponseFromJson(json); /// The associated feed (composition of blocks). @NewsBlocksConverter() final List<NewsBlock> feed; /// The total number of available blocks. final int totalCount; /// Converts the current instance to a `Map<String, dynamic>`. Map<String, dynamic> toJson() => _$FeedResponseToJson(this); @override List<Object> get props => [feed, totalCount]; }
news_toolkit/flutter_news_example/api/lib/src/models/feed_response/feed_response.dart/0
{ "file_path": "news_toolkit/flutter_news_example/api/lib/src/models/feed_response/feed_response.dart", "repo_id": "news_toolkit", "token_count": 302 }
846
import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; import 'package:news_blocks/news_blocks.dart'; part 'article_introduction_block.g.dart'; /// {@template article_introduction_block} /// A block which represents an article introduction. /// https://www.figma.com/file/RajSN6YbRqTuqvdKYtij3b/Google-News-Template-App-v3?node-id=1394%3A51730 /// {@endtemplate} @JsonSerializable() class ArticleIntroductionBlock with EquatableMixin implements NewsBlock { /// {@macro article_introduction_block} const ArticleIntroductionBlock({ required this.category, required this.author, required this.publishedAt, required this.title, this.type = ArticleIntroductionBlock.identifier, this.imageUrl, this.isPremium = false, }); /// Converts a `Map<String, dynamic>` /// into a [ArticleIntroductionBlock] instance. factory ArticleIntroductionBlock.fromJson(Map<String, dynamic> json) => _$ArticleIntroductionBlockFromJson(json); /// The article introduction block type identifier. static const identifier = '__article_introduction__'; /// The category of the associated article. final PostCategory category; /// The author of the associated article. final String author; /// The date when the associated article was published. final DateTime publishedAt; /// The image URL of the associated article. final String? imageUrl; /// The title of the associated article. final String title; /// Whether the associated article requires a premium subscription to access. /// /// Defaults to false. final bool isPremium; @override Map<String, dynamic> toJson() => _$ArticleIntroductionBlockToJson(this); @override final String type; @override List<Object?> get props => [ type, category, author, publishedAt, imageUrl, title, isPremium, ]; }
news_toolkit/flutter_news_example/api/packages/news_blocks/lib/src/article_introduction_block.dart/0
{ "file_path": "news_toolkit/flutter_news_example/api/packages/news_blocks/lib/src/article_introduction_block.dart", "repo_id": "news_toolkit", "token_count": 608 }
847
import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; import 'package:news_blocks/news_blocks.dart'; part 'newsletter_block.g.dart'; /// {@template newsletter_block} /// A block which represents a newsletter. /// https://www.figma.com/file/RajSN6YbRqTuqvdKYtij3b/Google-News-Template-App-v3?node-id=1701%3A24352 /// {@endtemplate} @JsonSerializable() class NewsletterBlock with EquatableMixin implements NewsBlock { /// {@macro newsletter_block} const NewsletterBlock({ this.type = NewsletterBlock.identifier, }); /// Converts a `Map<String, dynamic>` into /// a [NewsletterBlock] instance. factory NewsletterBlock.fromJson(Map<String, dynamic> json) => _$NewsletterBlockFromJson(json); /// The newsletter block type identifier. static const identifier = '__newsletter__'; @override final String type; @override Map<String, dynamic> toJson() => _$NewsletterBlockToJson(this); @override List<Object?> get props => [type]; }
news_toolkit/flutter_news_example/api/packages/news_blocks/lib/src/newsletter_block.dart/0
{ "file_path": "news_toolkit/flutter_news_example/api/packages/news_blocks/lib/src/newsletter_block.dart", "repo_id": "news_toolkit", "token_count": 334 }
848
import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; import 'package:news_blocks/news_blocks.dart'; part 'slide_block.g.dart'; /// {@template slide_block} /// A block which represents a slide in a slideshow. /// {@endtemplate} @JsonSerializable() class SlideBlock with EquatableMixin implements NewsBlock { /// {@macro slide_block} const SlideBlock({ required this.caption, required this.description, required this.photoCredit, required this.imageUrl, this.type = SlideBlock.identifier, }); /// Converts a `Map<String, dynamic>` into a [SlideBlock] instance. factory SlideBlock.fromJson(Map<String, dynamic> json) => _$SlideBlockFromJson(json); /// The caption of the slide image. final String caption; /// The description of the slide. final String description; /// The photo credit for the slide image. final String photoCredit; /// The URL of the slide image. final String imageUrl; /// The slide block type identifier. static const identifier = '__slide_block__'; @override Map<String, dynamic> toJson() => _$SlideBlockToJson(this); @override final String type; @override List<Object> get props => [ type, caption, description, photoCredit, imageUrl, ]; }
news_toolkit/flutter_news_example/api/packages/news_blocks/lib/src/slide_block.dart/0
{ "file_path": "news_toolkit/flutter_news_example/api/packages/news_blocks/lib/src/slide_block.dart", "repo_id": "news_toolkit", "token_count": 448 }
849
import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; import 'package:news_blocks/news_blocks.dart'; part 'trending_story_block.g.dart'; /// {@template trending_story_block} /// A block which represents a trending story. /// https://www.figma.com/file/RajSN6YbRqTuqvdKYtij3b/Google-News-Template-App-v3?node-id=13%3A3140 /// {@endtemplate} @JsonSerializable() class TrendingStoryBlock with EquatableMixin implements NewsBlock { /// {@macro trending_story_block} const TrendingStoryBlock({ required this.content, this.type = TrendingStoryBlock.identifier, }); /// Converts a `Map<String, dynamic>` into a [TrendingStoryBlock] instance. factory TrendingStoryBlock.fromJson(Map<String, dynamic> json) => _$TrendingStoryBlockFromJson(json); /// The trending story block type identifier. static const identifier = '__trending_story__'; /// The content of the trending story. final PostSmallBlock content; @override final String type; @override Map<String, dynamic> toJson() => _$TrendingStoryBlockToJson(this); @override List<Object> get props => [content, type]; }
news_toolkit/flutter_news_example/api/packages/news_blocks/lib/src/trending_story_block.dart/0
{ "file_path": "news_toolkit/flutter_news_example/api/packages/news_blocks/lib/src/trending_story_block.dart", "repo_id": "news_toolkit", "token_count": 384 }
850