text
stringlengths
6
13.6M
id
stringlengths
13
176
metadata
dict
__index_level_0__
int64
0
1.69k
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'dart:io' as io; import 'package:fake_async/fake_async.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/application_package.dart'; import 'package:flutter_tools/src/base/async_guard.dart'; import 'package:flutter_tools/src/base/common.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/io.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/platform.dart'; import 'package:flutter_tools/src/base/signals.dart'; import 'package:flutter_tools/src/build_info.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/commands/drive.dart'; import 'package:flutter_tools/src/dart/pub.dart'; import 'package:flutter_tools/src/device.dart'; import 'package:flutter_tools/src/drive/drive_service.dart'; import 'package:flutter_tools/src/ios/devices.dart'; import 'package:flutter_tools/src/project.dart'; import 'package:package_config/package_config.dart'; import 'package:test/fake.dart'; import '../../src/common.dart'; import '../../src/context.dart'; import '../../src/test_flutter_command_runner.dart'; void main() { late FileSystem fileSystem; late BufferLogger logger; late Platform platform; late FakeDeviceManager fakeDeviceManager; late FakeSignals signals; setUp(() { fileSystem = MemoryFileSystem.test(); logger = BufferLogger.test(); platform = FakePlatform(); fakeDeviceManager = FakeDeviceManager(); signals = FakeSignals(); }); setUpAll(() { Cache.disableLocking(); }); tearDownAll(() { Cache.enableLocking(); }); testUsingContext('warns if screenshot is not supported but continues test', () async { final DriveCommand command = DriveCommand( fileSystem: fileSystem, logger: logger, platform: platform, signals: signals, ); fileSystem.file('lib/main.dart').createSync(recursive: true); fileSystem.file('test_driver/main_test.dart').createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.directory('drive_screenshots').createSync(); final Device screenshotDevice = ThrowingScreenshotDevice() ..supportsScreenshot = false; fakeDeviceManager.attachedDevices = <Device>[screenshotDevice]; await expectLater(() => createTestCommandRunner(command).run( <String>[ 'drive', '--no-pub', '-d', screenshotDevice.id, '--screenshot', 'drive_screenshots', ]), throwsToolExit(message: 'cannot start app'), ); expect(logger.errorText, contains('Screenshot not supported for FakeDevice')); expect(logger.statusText, isEmpty); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), Pub: () => FakePub(), DeviceManager: () => fakeDeviceManager, }); testUsingContext('does not register screenshot signal handler if --screenshot not provided', () async { final DriveCommand command = DriveCommand( fileSystem: fileSystem, logger: logger, platform: platform, signals: signals, flutterDriverFactory: FailingFakeFlutterDriverFactory(), ); fileSystem.file('lib/main.dart').createSync(recursive: true); fileSystem.file('test_driver/main_test.dart').createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.directory('drive_screenshots').createSync(); final Device screenshotDevice = ScreenshotDevice(); fakeDeviceManager.attachedDevices = <Device>[screenshotDevice]; await expectLater(() => createTestCommandRunner(command).run( <String>[ 'drive', '--no-pub', '-d', screenshotDevice.id, '--use-existing-app', 'http://localhost:8181', '--keep-app-running', ]), throwsToolExit(), ); expect(logger.statusText, isNot(contains('Screenshot written to '))); expect(signals.addedHandlers, isEmpty); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), Pub: () => FakePub(), DeviceManager: () => fakeDeviceManager, }); testUsingContext('takes screenshot and rethrows on drive exception', () async { final DriveCommand command = DriveCommand( fileSystem: fileSystem, logger: logger, platform: platform, signals: signals, ); fileSystem.file('lib/main.dart').createSync(recursive: true); fileSystem.file('test_driver/main_test.dart').createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.directory('drive_screenshots').createSync(); final Device screenshotDevice = ThrowingScreenshotDevice(); fakeDeviceManager.attachedDevices = <Device>[screenshotDevice]; await expectLater(() => createTestCommandRunner(command).run( <String>[ 'drive', '--no-pub', '-d', screenshotDevice.id, '--screenshot', 'drive_screenshots', ]), throwsToolExit(message: 'cannot start app'), ); expect(logger.statusText, contains('Screenshot written to drive_screenshots/drive_01.png')); expect(logger.statusText, isNot(contains('drive_02.png'))); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), Pub: () => FakePub(), DeviceManager: () => fakeDeviceManager, }); testUsingContext('takes screenshot on drive test failure', () async { final DriveCommand command = DriveCommand( fileSystem: fileSystem, logger: logger, platform: platform, signals: signals, flutterDriverFactory: FailingFakeFlutterDriverFactory(), ); fileSystem.file('lib/main.dart').createSync(recursive: true); fileSystem.file('test_driver/main_test.dart').createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.directory('drive_screenshots').createSync(); final Device screenshotDevice = ScreenshotDevice(); fakeDeviceManager.attachedDevices = <Device>[screenshotDevice]; await expectLater(() => createTestCommandRunner(command).run( <String>[ 'drive', '--no-pub', '-d', screenshotDevice.id, '--use-existing-app', 'http://localhost:8181', '--keep-app-running', '--screenshot', 'drive_screenshots', ]), throwsToolExit(), ); // Takes the screenshot before the application would be killed (if --keep-app-running not passed). expect(logger.statusText, contains('Screenshot written to drive_screenshots/drive_01.png\n' 'Leaving the application running.')); expect(logger.statusText, isNot(contains('drive_02.png'))); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), Pub: () => FakePub(), DeviceManager: () => fakeDeviceManager, }); testUsingContext('drive --screenshot errors but does not fail if screenshot fails', () async { final DriveCommand command = DriveCommand( fileSystem: fileSystem, logger: logger, platform: platform, signals: signals, ); fileSystem.file('lib/main.dart').createSync(recursive: true); fileSystem.file('test_driver/main_test.dart').createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('drive_screenshots').createSync(); final Device screenshotDevice = ThrowingScreenshotDevice(); fakeDeviceManager.attachedDevices = <Device>[screenshotDevice]; await expectLater(() => createTestCommandRunner(command).run( <String>[ 'drive', '--no-pub', '-d', screenshotDevice.id, '--screenshot', 'drive_screenshots', ]), throwsToolExit(message: 'cannot start app'), ); expect(logger.statusText, isEmpty); expect(logger.errorText, contains('Error taking screenshot: FileSystemException: Not a directory')); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), Pub: () => FakePub(), DeviceManager: () => fakeDeviceManager, }); testUsingContext('drive --timeout takes screenshot and tool exits after timeout', () async { final DriveCommand command = DriveCommand( fileSystem: fileSystem, logger: logger, platform: platform, signals: Signals.test(), flutterDriverFactory: NeverEndingFlutterDriverFactory(() {}), ); fileSystem.file('lib/main.dart').createSync(recursive: true); fileSystem.file('test_driver/main_test.dart').createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.directory('drive_screenshots').createSync(); final ScreenshotDevice screenshotDevice = ScreenshotDevice(); fakeDeviceManager.attachedDevices = <Device>[screenshotDevice]; expect(screenshotDevice.screenshots, isEmpty); bool caughtToolExit = false; FakeAsync().run<void>((FakeAsync time) { // Because the tool exit will be thrown asynchronously by a [Timer], // use [asyncGuard] to catch it asyncGuard<void>( () => createTestCommandRunner(command).run( <String>[ 'drive', '--no-pub', '-d', screenshotDevice.id, '--use-existing-app', 'http://localhost:8181', '--screenshot', 'drive_screenshots', '--timeout', '300', // 5 minutes ], ), onError: (Object error) { expect(error, isA<ToolExit>()); expect( (error as ToolExit).message, contains('Timed out after 300 seconds'), ); caughtToolExit = true; } ); time.elapse(const Duration(seconds: 299)); expect(screenshotDevice.screenshots, isEmpty); time.elapse(const Duration(seconds: 2)); expect( screenshotDevice.screenshots, contains(isA<File>().having( (File file) => file.path, 'path', 'drive_screenshots/drive_01.png', )), ); }); expect(caughtToolExit, isTrue); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), Pub: () => FakePub(), DeviceManager: () => fakeDeviceManager, }); testUsingContext('drive --screenshot takes screenshot if sent a registered signal', () async { final FakeProcessSignal signal = FakeProcessSignal(); final ProcessSignal signalUnderTest = ProcessSignal(signal); final DriveCommand command = DriveCommand( fileSystem: fileSystem, logger: logger, platform: platform, signals: Signals.test(), flutterDriverFactory: NeverEndingFlutterDriverFactory(() { signal.controller.add(signal); }), signalsToHandle: <ProcessSignal>{signalUnderTest}, ); fileSystem.file('lib/main.dart').createSync(recursive: true); fileSystem.file('test_driver/main_test.dart').createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.directory('drive_screenshots').createSync(); final ScreenshotDevice screenshotDevice = ScreenshotDevice(); fakeDeviceManager.attachedDevices = <Device>[screenshotDevice]; expect(screenshotDevice.screenshots, isEmpty); // This command will never complete. In reality, a real signal would have // shut down the Dart process. unawaited( createTestCommandRunner(command).run( <String>[ 'drive', '--no-pub', '-d', screenshotDevice.id, '--use-existing-app', 'http://localhost:8181', '--screenshot', 'drive_screenshots', ], ), ); await screenshotDevice.firstScreenshot; expect( screenshotDevice.screenshots, contains(isA<File>().having( (File file) => file.path, 'path', 'drive_screenshots/drive_01.png', )), ); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), Pub: () => FakePub(), DeviceManager: () => fakeDeviceManager, }); testUsingContext('shouldRunPub is true unless user specifies --no-pub', () async { final DriveCommand command = DriveCommand( fileSystem: fileSystem, logger: logger, platform: platform, signals: signals, ); fileSystem.file('lib/main.dart').createSync(recursive: true); fileSystem.file('test_driver/main_test.dart').createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); try { await createTestCommandRunner(command).run(const <String>['drive', '--no-pub']); } on Exception { // Expected to throw } expect(command.shouldRunPub, false); try { await createTestCommandRunner(command).run(const <String>['drive']); } on Exception { // Expected to throw } expect(command.shouldRunPub, true); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), Pub: () => FakePub(), }); testUsingContext('flags propagate to debugging options', () async { final DriveCommand command = DriveCommand( fileSystem: fileSystem, logger: logger, platform: platform, signals: signals, ); fileSystem.file('lib/main.dart').createSync(recursive: true); fileSystem.file('test_driver/main_test.dart').createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); await expectLater(() => createTestCommandRunner(command).run(<String>[ 'drive', '--start-paused', '--disable-service-auth-codes', '--trace-skia', '--trace-systrace', '--trace-to-file=path/to/trace.binpb', '--verbose-system-logs', '--null-assertions', '--native-null-assertions', '--enable-impeller', '--trace-systrace', '--enable-software-rendering', '--skia-deterministic-rendering', '--enable-embedder-api', '--ci', '--debug-logs-dir=path/to/logs' ]), throwsToolExit()); final DebuggingOptions options = await command.createDebuggingOptions(false); expect(options.startPaused, true); expect(options.disableServiceAuthCodes, true); expect(options.traceSkia, true); expect(options.traceSystrace, true); expect(options.traceToFile, 'path/to/trace.binpb'); expect(options.verboseSystemLogs, true); expect(options.nullAssertions, true); expect(options.nativeNullAssertions, true); expect(options.enableImpeller, ImpellerStatus.enabled); expect(options.traceSystrace, true); expect(options.enableSoftwareRendering, true); expect(options.skiaDeterministicRendering, true); expect(options.usingCISystem, true); expect(options.debugLogsDirectoryPath, 'path/to/logs'); }, overrides: <Type, Generator>{ Cache: () => Cache.test(processManager: FakeProcessManager.any()), FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('Port publication not disabled for wireless device', () async { final DriveCommand command = DriveCommand( fileSystem: fileSystem, logger: logger, platform: platform, signals: signals, ); fileSystem.file('lib/main.dart').createSync(recursive: true); fileSystem.file('test_driver/main_test.dart').createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); final Device wirelessDevice = FakeIosDevice() ..connectionInterface = DeviceConnectionInterface.wireless; fakeDeviceManager.wirelessDevices = <Device>[wirelessDevice]; await expectLater(() => createTestCommandRunner(command).run(<String>[ 'drive', ]), throwsToolExit()); final DebuggingOptions options = await command.createDebuggingOptions(false); expect(options.disablePortPublication, false); }, overrides: <Type, Generator>{ Cache: () => Cache.test(processManager: FakeProcessManager.any()), FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => fakeDeviceManager, }); testUsingContext('Port publication is disabled for wired device', () async { final DriveCommand command = DriveCommand( fileSystem: fileSystem, logger: logger, platform: platform, signals: signals, ); fileSystem.file('lib/main.dart').createSync(recursive: true); fileSystem.file('test_driver/main_test.dart').createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); await expectLater(() => createTestCommandRunner(command).run(<String>[ 'drive', ]), throwsToolExit()); final Device usbDevice = FakeIosDevice() ..connectionInterface = DeviceConnectionInterface.attached; fakeDeviceManager.attachedDevices = <Device>[usbDevice]; final DebuggingOptions options = await command.createDebuggingOptions(false); expect(options.disablePortPublication, true); }, overrides: <Type, Generator>{ Cache: () => Cache.test(processManager: FakeProcessManager.any()), FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => fakeDeviceManager, }); testUsingContext('Port publication does not default to enabled for wireless device if flag manually added', () async { final DriveCommand command = DriveCommand( fileSystem: fileSystem, logger: logger, platform: platform, signals: signals, ); fileSystem.file('lib/main.dart').createSync(recursive: true); fileSystem.file('test_driver/main_test.dart').createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); final Device wirelessDevice = FakeIosDevice() ..connectionInterface = DeviceConnectionInterface.wireless; fakeDeviceManager.wirelessDevices = <Device>[wirelessDevice]; await expectLater(() => createTestCommandRunner(command).run(<String>[ 'drive', '--no-publish-port' ]), throwsToolExit()); final DebuggingOptions options = await command.createDebuggingOptions(false); expect(options.disablePortPublication, true); }, overrides: <Type, Generator>{ Cache: () => Cache.test(processManager: FakeProcessManager.any()), FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => fakeDeviceManager, }); } class ThrowingScreenshotDevice extends ScreenshotDevice { @override Future<LaunchResult> startApp( ApplicationPackage? package, { String? mainPath, String? route, DebuggingOptions? debuggingOptions, Map<String, dynamic>? platformArgs, bool prebuiltApplication = false, bool usesTerminalUi = true, bool ipv6 = false, String? userIdentifier, }) async { throwToolExit('cannot start app'); } } class ScreenshotDevice extends Fake implements Device { final List<File> screenshots = <File>[]; final Completer<void> _firstScreenshotCompleter = Completer<void>(); /// A Future that completes when [takeScreenshot] is called the first time. Future<void> get firstScreenshot => _firstScreenshotCompleter.future; @override final String name = 'FakeDevice'; @override final Category category = Category.mobile; @override final String id = 'fake_device'; @override Future<TargetPlatform> get targetPlatform async => TargetPlatform.android; @override bool supportsScreenshot = true; @override bool get isConnected => true; @override Future<LaunchResult> startApp( ApplicationPackage? package, { String? mainPath, String? route, DebuggingOptions? debuggingOptions, Map<String, dynamic>? platformArgs, bool prebuiltApplication = false, bool usesTerminalUi = true, bool ipv6 = false, String? userIdentifier, }) async => LaunchResult.succeeded(); @override Future<void> takeScreenshot(File outputFile) async { if (!_firstScreenshotCompleter.isCompleted) { _firstScreenshotCompleter.complete(); } screenshots.add(outputFile); } } class FakePub extends Fake implements Pub { @override Future<void> get({ PubContext? context, required FlutterProject project, bool upgrade = false, bool offline = false, bool generateSyntheticPackage = false, String? flutterRootOverride, bool checkUpToDate = false, bool shouldSkipThirdPartyGenerator = true, PubOutputMode outputMode = PubOutputMode.all, }) async { } } /// A [FlutterDriverFactory] that creates a [NeverEndingDriverService]. class NeverEndingFlutterDriverFactory extends Fake implements FlutterDriverFactory { NeverEndingFlutterDriverFactory(this.callback); final void Function() callback; @override DriverService createDriverService(bool web) => NeverEndingDriverService(callback); } /// A [DriverService] that will return a Future from [startTest] that will never complete. /// /// This is to simulate when the test will take a long time, but a signal is /// expected to interrupt the process. class NeverEndingDriverService extends Fake implements DriverService { NeverEndingDriverService(this.callback); final void Function() callback; @override Future<void> reuseApplication(Uri vmServiceUri, Device device, DebuggingOptions debuggingOptions, bool ipv6) async { } @override Future<int> startTest( String testFile, List<String> arguments, Map<String, String> environment, PackageConfig packageConfig, { bool? headless, String? chromeBinary, String? browserName, bool? androidEmulator, int? driverPort, List<String>? webBrowserFlags, List<String>? browserDimension, String? profileMemory, }) async { callback(); // return a Future that will never complete. return Completer<int>().future; } } class FailingFakeFlutterDriverFactory extends Fake implements FlutterDriverFactory { @override DriverService createDriverService(bool web) => FailingFakeDriverService(); } class FailingFakeDriverService extends Fake implements DriverService { @override Future<void> reuseApplication(Uri vmServiceUri, Device device, DebuggingOptions debuggingOptions, bool ipv6) async { } @override Future<int> startTest( String testFile, List<String> arguments, Map<String, String> environment, PackageConfig packageConfig, { bool? headless, String? chromeBinary, String? browserName, bool? androidEmulator, int? driverPort, List<String>? webBrowserFlags, List<String>? browserDimension, String? profileMemory, }) async => 1; } class FakeProcessSignal extends Fake implements io.ProcessSignal { final StreamController<io.ProcessSignal> controller = StreamController<io.ProcessSignal>(); @override Stream<io.ProcessSignal> watch() => controller.stream; } class FakeIosDevice extends Fake implements IOSDevice { @override DeviceConnectionInterface connectionInterface = DeviceConnectionInterface.attached; @override bool get isWirelesslyConnected => connectionInterface == DeviceConnectionInterface.wireless; @override Future<TargetPlatform> get targetPlatform async => TargetPlatform.ios; } class FakeSignals extends Fake implements Signals { List<SignalHandler> addedHandlers = <SignalHandler>[]; @override Object addHandler(ProcessSignal signal, SignalHandler handler) { addedHandlers.add(handler); return const Object(); } @override Future<bool> removeHandler(ProcessSignal signal, Object token) async => true; }
flutter/packages/flutter_tools/test/commands.shard/hermetic/drive_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/commands.shard/hermetic/drive_test.dart", "repo_id": "flutter", "token_count": 8431 }
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 'dart:convert'; import 'package:args/command_runner.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/base/async_guard.dart'; import 'package:flutter_tools/src/base/common.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/terminal.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/commands/test.dart'; import 'package:flutter_tools/src/device.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/native_assets.dart'; import 'package:flutter_tools/src/project.dart'; import 'package:flutter_tools/src/runner/flutter_command.dart'; import 'package:flutter_tools/src/test/coverage_collector.dart'; import 'package:flutter_tools/src/test/runner.dart'; import 'package:flutter_tools/src/test/test_device.dart'; import 'package:flutter_tools/src/test/test_time_recorder.dart'; import 'package:flutter_tools/src/test/test_wrapper.dart'; import 'package:flutter_tools/src/test/watcher.dart'; import 'package:flutter_tools/src/web/compile.dart'; import 'package:stream_channel/stream_channel.dart'; import 'package:test/fake.dart'; import 'package:vm_service/vm_service.dart'; import '../../src/common.dart'; import '../../src/context.dart'; import '../../src/fake_devices.dart'; import '../../src/fake_vm_services.dart'; import '../../src/logging_logger.dart'; import '../../src/test_flutter_command_runner.dart'; final String _flutterToolsPackageConfigContents = json.encode(<String, Object>{ 'configVersion': 2, 'packages': <Map<String, Object>>[ <String, String>{ 'name': 'ffi', 'rootUri': 'file:///path/to/pubcache/.pub-cache/hosted/pub.dev/ffi-2.1.2', 'packageUri': 'lib/', 'languageVersion': '3.3', }, <String, String>{ 'name': 'test', 'rootUri': 'file:///path/to/pubcache/.pub-cache/hosted/pub.dev/test-1.24.9', 'packageUri': 'lib/', 'languageVersion': '3.0' }, <String, String>{ 'name': 'test_api', 'rootUri': 'file:///path/to/pubcache/.pub-cache/hosted/pub.dev/test_api-0.6.1', 'packageUri': 'lib/', 'languageVersion': '3.0' }, <String, String>{ 'name': 'test_core', 'rootUri': 'file:///path/to/pubcache/.pub-cache/hosted/pub.dev/test_core-0.5.9', 'packageUri': 'lib/', 'languageVersion': '3.0' }, ], 'generated': '2021-02-24T07:55:20.084834Z', 'generator': 'pub', 'generatorVersion': '2.13.0-68.0.dev', }); const String _pubspecContents = ''' dev_dependencies: flutter_test: sdk: flutter integration_test: sdk: flutter'''; final String _packageConfigContents = json.encode(<String, Object>{ 'configVersion': 2, 'packages': <Map<String, Object>>[ <String, String>{ 'name': 'test_api', 'rootUri': 'file:///path/to/pubcache/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.19', 'packageUri': 'lib/', 'languageVersion': '2.12', }, <String, String>{ 'name': 'integration_test', 'rootUri': 'file:///path/to/flutter/packages/integration_test', 'packageUri': 'lib/', 'languageVersion': '2.12', }, ], 'generated': '2021-02-24T07:55:20.084834Z', 'generator': 'pub', 'generatorVersion': '2.13.0-68.0.dev', }); void main() { Cache.disableLocking(); late MemoryFileSystem fs; late LoggingLogger logger; setUp(() { fs = MemoryFileSystem.test(style: globals.platform.isWindows ? FileSystemStyle.windows : FileSystemStyle.posix); final Directory package = fs.directory('package'); package.childFile('pubspec.yaml').createSync(recursive: true); package.childFile('pubspec.yaml').writeAsStringSync(_pubspecContents); (package.childDirectory('.dart_tool') .childFile('package_config.json') ..createSync(recursive: true)) .writeAsString(_packageConfigContents); package.childDirectory('test').childFile('some_test.dart').createSync(recursive: true); package.childDirectory('integration_test').childFile('some_integration_test.dart').createSync(recursive: true); final File flutterToolsPackageConfigFile = fs.directory( fs.path.join( getFlutterRoot(), 'packages', 'flutter_tools' ), ).childDirectory('.dart_tool').childFile('package_config.json'); flutterToolsPackageConfigFile.createSync(recursive: true); flutterToolsPackageConfigFile.writeAsStringSync( _flutterToolsPackageConfigContents, ); fs.currentDirectory = package.path; logger = LoggingLogger(); }); testUsingContext('Missing dependencies in pubspec', () async { // Clear the dependencies already added in [setUp]. fs.file('pubspec.yaml').writeAsStringSync(''); fs.directory('.dart_tool').childFile('package_config.json').writeAsStringSync(''); final FakePackageTest fakePackageTest = FakePackageTest(); final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); expect(() => commandRunner.run(const <String>[ 'test', '--no-pub', ]), throwsToolExit()); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), Logger: () => logger, }); testUsingContext('Missing dependencies in pubspec for integration tests', () async { // Only use the flutter_test dependency, integration_test is deliberately // absent. fs.file('pubspec.yaml').writeAsStringSync(''' dev_dependencies: flutter_test: sdk: flutter '''); fs.directory('.dart_tool').childFile('package_config.json').writeAsStringSync(json.encode(<String, Object>{ 'configVersion': 2, 'packages': <Map<String, Object>>[ <String, String>{ 'name': 'test_api', 'rootUri': 'file:///path/to/pubcache/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.19', 'packageUri': 'lib/', 'languageVersion': '2.12', }, ], 'generated': '2021-02-24T07:55:20.084834Z', 'generator': 'pub', 'generatorVersion': '2.13.0-68.0.dev', })); final FakePackageTest fakePackageTest = FakePackageTest(); final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); expect(() => commandRunner.run(const <String>[ 'test', '--no-pub', 'integration_test', ]), throwsToolExit()); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('Pipes test-randomize-ordering-seed to package:test', () async { final FakePackageTest fakePackageTest = FakePackageTest(); final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--test-randomize-ordering-seed=random', '--no-pub', ]); expect( fakePackageTest.lastArgs, contains('--test-randomize-ordering-seed=random'), ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), Cache: () => Cache.test(processManager: FakeProcessManager.any()), }); testUsingContext( 'Confirmation that the reporter, timeout, and concurrency args are not set by default', () async { final FakePackageTest fakePackageTest = FakePackageTest(); final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', ]); expect(fakePackageTest.lastArgs, isNot(contains('-r'))); expect(fakePackageTest.lastArgs, isNot(contains('compact'))); expect(fakePackageTest.lastArgs, isNot(contains('--timeout'))); expect(fakePackageTest.lastArgs, isNot(contains('30s'))); expect(fakePackageTest.lastArgs, isNot(contains('--concurrency'))); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), Cache: () => Cache.test(processManager: FakeProcessManager.any()), }); group('shard-index and total-shards', () { testUsingContext('with the params they are Piped to package:test', () async { final FakePackageTest fakePackageTest = FakePackageTest(); final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--total-shards=1', '--shard-index=2', '--no-pub', ]); expect(fakePackageTest.lastArgs, contains('--total-shards=1')); expect(fakePackageTest.lastArgs, contains('--shard-index=2')); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), Cache: () => Cache.test(processManager: FakeProcessManager.any()), }); testUsingContext('without the params they not Piped to package:test', () async { final FakePackageTest fakePackageTest = FakePackageTest(); final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', ]); expect(fakePackageTest.lastArgs, isNot(contains('--total-shards'))); expect(fakePackageTest.lastArgs, isNot(contains('--shard-index'))); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), Cache: () => Cache.test(processManager: FakeProcessManager.any()), }); }); testUsingContext('Supports coverage and machine', () async { final FakePackageTest fakePackageTest = FakePackageTest(); final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); expect(() => commandRunner.run(const <String>[ 'test', '--no-pub', '--machine', '--coverage', '--', 'test/fake_test.dart', ]), throwsA(isA<ToolExit>().having((ToolExit toolExit) => toolExit.message, 'message', isNull))); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), Cache: () => Cache.test(processManager: FakeProcessManager.any()), }); testUsingContext('Coverage provides current library name to Coverage Collector by default', () async { const String currentPackageName = ''; final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost( requests: <VmServiceExpectation>[ FakeVmServiceRequest( method: 'getVM', jsonResponse: (VM.parse(<String, Object>{})! ..isolates = <IsolateRef>[ IsolateRef.parse(<String, Object>{ 'id': '1', })!, ] ).toJson(), ), FakeVmServiceRequest( method: 'getVersion', jsonResponse: Version(major: 3, minor: 57).toJson(), ), FakeVmServiceRequest( method: 'getSourceReport', args: <String, Object>{ 'isolateId': '1', 'reports': <Object>['Coverage'], 'forceCompile': true, 'reportLines': true, 'libraryFilters': <String>['package:$currentPackageName/'], }, jsonResponse: SourceReport( ranges: <SourceReportRange>[], ).toJson(), ), ], ); final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0, null, fakeVmServiceHost); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '--coverage', '--', 'test/some_test.dart', ]); expect(fakeVmServiceHost.hasRemainingExpectations, false); expect( (testRunner.lastTestWatcher! as CoverageCollector).libraryNames, <String>{currentPackageName}, ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), Cache: () => Cache.test(processManager: FakeProcessManager.any()), }); testUsingContext('Coverage provides library names matching regexps to Coverage Collector', () async { final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost( requests: <VmServiceExpectation>[ FakeVmServiceRequest( method: 'getVM', jsonResponse: (VM.parse(<String, Object>{})! ..isolates = <IsolateRef>[ IsolateRef.parse(<String, Object>{ 'id': '1', })!, ] ).toJson(), ), FakeVmServiceRequest( method: 'getVersion', jsonResponse: Version(major: 3, minor: 57).toJson(), ), FakeVmServiceRequest( method: 'getSourceReport', args: <String, Object>{ 'isolateId': '1', 'reports': <Object>['Coverage'], 'forceCompile': true, 'reportLines': true, 'libraryFilters': <String>['package:test_api/'], }, jsonResponse: SourceReport( ranges: <SourceReportRange>[], ).toJson(), ), ], ); final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0, null, fakeVmServiceHost); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '--coverage', '--coverage-package=^test', '--', 'test/some_test.dart', ]); expect(fakeVmServiceHost.hasRemainingExpectations, false); expect( (testRunner.lastTestWatcher! as CoverageCollector).libraryNames, <String>{'test_api'}, ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), Cache: () => Cache.test(processManager: FakeProcessManager.any()), }); testUsingContext('Coverage provides error message if regular expression syntax is invalid', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); expect(() => commandRunner.run(const <String>[ 'test', '--no-pub', '--coverage', r'--coverage-package="$+"', '--', 'test/some_test.dart', ]), throwsToolExit(message: RegExp(r'Regular expression syntax is invalid. FormatException: Nothing to repeat[ \t]*"\$\+"'))); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('Pipes start-paused to package:test', () async { final FakePackageTest fakePackageTest = FakePackageTest(); final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '--start-paused', '--', 'test/fake_test.dart', ]); expect( fakePackageTest.lastArgs, contains('--pause-after-load'), ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), Cache: () => Cache.test(processManager: FakeProcessManager.any()), }); testUsingContext('Pipes run-skipped to package:test', () async { final FakePackageTest fakePackageTest = FakePackageTest(); final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '--run-skipped', '--', 'test/fake_test.dart', ]); expect( fakePackageTest.lastArgs, contains('--run-skipped'), ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), Cache: () => Cache.test(processManager: FakeProcessManager.any()), }); testUsingContext('Pipes enable-vmService', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '--enable-vmservice', '--', 'test/fake_test.dart', ]); expect( testRunner.lastEnableVmServiceValue, true, ); await commandRunner.run(const <String>[ 'test', '--no-pub', '--start-paused', '--no-enable-vmservice', '--', 'test/fake_test.dart', ]); expect( testRunner.lastEnableVmServiceValue, true, ); await commandRunner.run(const <String>[ 'test', '--no-pub', '--', 'test/fake_test.dart', ]); expect( testRunner.lastEnableVmServiceValue, false, ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), Cache: () => Cache.test(processManager: FakeProcessManager.any()), }); testUsingContext('Generates a satisfactory test runner package_config.json when --experimental-faster-testing is set', () async { final TestCommand testCommand = TestCommand(); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); bool caughtToolExit = false; await asyncGuard<void>( () => commandRunner.run(const <String>[ 'test', '--no-pub', '--experimental-faster-testing', '--', 'test/fake_test.dart', 'test/fake_test_2.dart', ]), onError: (Object error) async { expect(error, isA<ToolExit>()); // We expect this message because we are using a fake ProcessManager. expect( (error as ToolExit).message, contains('the Dart compiler exited unexpectedly.'), ); caughtToolExit = true; final File isolateSpawningTesterPackageConfigFile = fs.directory( fs.path.join( 'build', 'isolate_spawning_tester', ), ).childDirectory('.dart_tool').childFile('package_config.json'); expect(isolateSpawningTesterPackageConfigFile.existsSync(), true); // We expect [isolateSpawningTesterPackageConfigFile] to contain the // union of the packages in [_packageConfigContents] and // [_flutterToolsPackageConfigContents]. expect( isolateSpawningTesterPackageConfigFile.readAsStringSync().contains('"name": "integration_test"'), true, ); expect( isolateSpawningTesterPackageConfigFile.readAsStringSync().contains('"name": "ffi"'), true, ); expect( isolateSpawningTesterPackageConfigFile.readAsStringSync().contains('"name": "test"'), true, ); expect( isolateSpawningTesterPackageConfigFile.readAsStringSync().contains('"name": "test_api"'), true, ); expect( isolateSpawningTesterPackageConfigFile.readAsStringSync().contains('"name": "test_core"'), true, ); } ); expect(caughtToolExit, true); }, overrides: <Type, Generator>{ AnsiTerminal: () => _FakeTerminal(), FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[]), }); testUsingContext('Pipes specified arguments to package:test when --experimental-faster-testing is set', () async { final TestCommand testCommand = TestCommand(); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); bool caughtToolExit = false; await asyncGuard<void>( () => commandRunner.run(const <String>[ 'test', '--no-pub', '--experimental-faster-testing', '--reporter=compact', '--file-reporter=json:reports/tests.json', '--timeout=100', '--concurrency=3', '--name=name1', '--plain-name=name2', '--test-randomize-ordering-seed=random', '--tags=tag1', '--exclude-tags=tag2', '--run-skipped', '--total-shards=1', '--shard-index=1', '--', 'test/fake_test.dart', 'test/fake_test_2.dart', ]), onError: (Object error) async { expect(error, isA<ToolExit>()); // We expect this message because we are using a fake ProcessManager. expect( (error as ToolExit).message, contains('the Dart compiler exited unexpectedly.'), ); caughtToolExit = true; final File childTestIsolateSpawnerSourceFile = fs.directory( fs.path.join( 'build', 'isolate_spawning_tester', ), ).childFile('child_test_isolate_spawner.dart'); expect(childTestIsolateSpawnerSourceFile.existsSync(), true); expect(childTestIsolateSpawnerSourceFile.readAsStringSync().contains(''' const List<String> packageTestArgs = <String>[ '--no-color', '-r', 'compact', '--file-reporter=json:reports/tests.json', '--timeout', '100', '--concurrency=3', '--name', 'name1', '--plain-name', 'name2', '--test-randomize-ordering-seed=random', '--tags', 'tag1', '--exclude-tags', 'tag2', '--run-skipped', '--total-shards=1', '--shard-index=1', '--chain-stack-traces', ]; '''), true); } ); expect(caughtToolExit, true); }, overrides: <Type, Generator>{ AnsiTerminal: () => _FakeTerminal(), FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[]), }); testUsingContext('Only passes --no-color and --chain-stack-traces to package:test by default when --experimental-faster-testing is set', () async { final TestCommand testCommand = TestCommand(); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); bool caughtToolExit = false; await asyncGuard<void>( () => commandRunner.run(const <String>[ 'test', '--no-pub', '--experimental-faster-testing', '--', 'test/fake_test.dart', 'test/fake_test_2.dart', ]), onError: (Object error) async { expect(error, isA<ToolExit>()); // We expect this message because we are using a fake ProcessManager. expect( (error as ToolExit).message, contains('the Dart compiler exited unexpectedly.'), ); caughtToolExit = true; final File childTestIsolateSpawnerSourceFile = fs.directory( fs.path.join( 'build', 'isolate_spawning_tester', ), ).childFile('child_test_isolate_spawner.dart'); expect(childTestIsolateSpawnerSourceFile.existsSync(), true); expect(childTestIsolateSpawnerSourceFile.readAsStringSync().contains(''' const List<String> packageTestArgs = <String>[ '--no-color', '--chain-stack-traces', ]; '''), true); } ); expect(caughtToolExit, true); }, overrides: <Type, Generator>{ AnsiTerminal: () => _FakeTerminal(), FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[]), }); testUsingContext('Verbose prints phase timings', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0, const Duration(milliseconds: 1)); final TestCommand testCommand = TestCommand(testRunner: testRunner, verbose: true); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '--', 'test/fake_test.dart', ]); // Expect one message for each phase. final List<String> logPhaseMessages = logger.messages.where((String m) => m.startsWith('Runtime for phase ')).toList(); expect(logPhaseMessages, hasLength(TestTimePhases.values.length)); // As we force the `runTests` command to take at least 1 ms expect at least // one phase to take a non-zero amount of time. final List<String> logPhaseMessagesNonZero = logPhaseMessages.where((String m) => !m.contains(Duration.zero.toString())).toList(); expect(logPhaseMessagesNonZero, isNotEmpty); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), Cache: () => Cache.test(processManager: FakeProcessManager.any()), Logger: () => logger, }); testUsingContext('Non-verbose does not prints phase timings', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0, const Duration(milliseconds: 1)); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '--', 'test/fake_test.dart', ]); final List<String> logPhaseMessages = logger.messages.where((String m) => m.startsWith('Runtime for phase ')).toList(); expect(logPhaseMessages, isEmpty); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), Cache: () => Cache.test(processManager: FakeProcessManager.any()), Logger: () => logger, }); testUsingContext('Pipes different args when running Integration Tests', () async { final FakePackageTest fakePackageTest = FakePackageTest(); final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', 'integration_test', ]); expect(fakePackageTest.lastArgs, contains('--concurrency=1')); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[ FakeDevice('ephemeral', 'ephemeral', type: PlatformType.android), ]), }); testUsingContext('Overrides concurrency when running Integration Tests', () async { final FakePackageTest fakePackageTest = FakePackageTest(); final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '--concurrency=100', 'integration_test', ]); expect(fakePackageTest.lastArgs, contains('--concurrency=1')); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[ FakeDevice('ephemeral', 'ephemeral', type: PlatformType.android), ]), }); group('Detecting Integration Tests', () { testUsingContext('when integration_test is not passed', () async { final FakePackageTest fakePackageTest = FakePackageTest(); final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', ]); expect(testCommand.isIntegrationTest, false); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[ FakeDevice('ephemeral', 'ephemeral', type: PlatformType.android), ]), }); testUsingContext('when integration_test is passed', () async { final FakePackageTest fakePackageTest = FakePackageTest(); final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', 'integration_test', ]); expect(testCommand.isIntegrationTest, true); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[ FakeDevice('ephemeral', 'ephemeral', type: PlatformType.android), ]), }); testUsingContext('when relative path to integration test is passed', () async { final FakePackageTest fakePackageTest = FakePackageTest(); final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', 'integration_test/some_integration_test.dart', ]); expect(testCommand.isIntegrationTest, true); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[ FakeDevice('ephemeral', 'ephemeral', type: PlatformType.android), ]), }); testUsingContext('when absolute path to integration test is passed', () async { final FakePackageTest fakePackageTest = FakePackageTest(); final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '/package/integration_test/some_integration_test.dart', ]); expect(testCommand.isIntegrationTest, true); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[ FakeDevice('ephemeral', 'ephemeral', type: PlatformType.android), ]), }); testUsingContext('when absolute unnormalized path to integration test is passed', () async { final FakePackageTest fakePackageTest = FakePackageTest(); final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '/package/../package/integration_test/some_integration_test.dart', ]); expect(testCommand.isIntegrationTest, true); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[ FakeDevice('ephemeral', 'ephemeral', type: PlatformType.android), ]), }); testUsingContext('when both test and integration test are passed', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); expect(() => commandRunner.run(const <String>[ 'test', '--no-pub', 'test/some_test.dart', 'integration_test/some_integration_test.dart', ]), throwsToolExit()); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); }); group('Required artifacts', () { testUsingContext('for default invocation', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', ]); expect(await testCommand.requiredArtifacts, isEmpty); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('when platform is chrome', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '--platform=chrome', ]); expect(await testCommand.requiredArtifacts, <DevelopmentArtifact>[DevelopmentArtifact.web]); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('Overrides concurrency when running web tests', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '--concurrency=100', '--platform=chrome', ]); expect(testRunner.lastConcurrency, 1); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('when running integration tests', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', 'integration_test', ]); expect(await testCommand.requiredArtifacts, <DevelopmentArtifact>[ DevelopmentArtifact.universal, DevelopmentArtifact.androidGenSnapshot, ]); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[ FakeDevice('ephemeral', 'ephemeral', type: PlatformType.android), ]), }); }); testUsingContext('Integration tests when no devices are connected', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); expect(() => commandRunner.run(const <String>[ 'test', '--no-pub', 'integration_test', ]), throwsToolExit()); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[]), }); // TODO(jiahaog): Remove this when web is supported. https://github.com/flutter/flutter/issues/66264 testUsingContext('Integration tests when only web devices are connected', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); expect(() => commandRunner.run(const <String>[ 'test', '--no-pub', 'integration_test', ]), throwsToolExit()); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[ FakeDevice('ephemeral', 'ephemeral'), ]), }); testUsingContext('Integration tests set the correct dart-defines', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', 'integration_test', ]); expect( testRunner.lastDebuggingOptionsValue.buildInfo.dartDefines, contains('INTEGRATION_TEST_SHOULD_REPORT_RESULTS_TO_NATIVE=false'), ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[ FakeDevice('ephemeral', 'ephemeral', type: PlatformType.android), ]), }); testUsingContext('Integration tests given flavor', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '--flavor', 'dev', 'integration_test', ]); expect( testRunner.lastDebuggingOptionsValue.buildInfo.flavor, contains('dev'), ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[ FakeDevice( 'ephemeral', 'ephemeral', type: PlatformType.android, supportsFlavors: true, ), ]), }); testUsingContext('Builds the asset manifest by default', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', ]); final bool fileExists = await fs.isFile(globals.fs.path.join('build', 'unit_test_assets', 'AssetManifest.bin')); expect(fileExists, true); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[]), }); testUsingContext('builds asset bundle using --flavor', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); fs.file('vanilla.txt').writeAsStringSync('vanilla'); fs.file('orange.txt').writeAsStringSync('orange'); fs.file('pubspec.yaml').writeAsStringSync(''' flutter: assets: - path: vanilla.txt flavors: - vanilla - path: orange.txt flavors: - orange dev_dependencies: flutter_test: sdk: flutter integration_test: sdk: flutter'''); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '--flavor', 'vanilla', ]); final bool vanillaExists = await fs.isFile(globals.fs.path.join('build', 'unit_test_assets', 'vanilla.txt')); expect(vanillaExists, true, reason: 'vanilla.txt should be bundled'); final bool orangeExists = await fs.isFile(globals.fs.path.join('build', 'unit_test_assets', 'orange.txt')); expect(orangeExists, false, reason: 'orange.txt should not be bundled'); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[]), }); testUsingContext("Don't build the asset manifest if --no-test-assets if informed", () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '--no-test-assets', ]); final bool fileExists = await fs.isFile(globals.fs.path.join('build', 'unit_test_assets', 'AssetManifest.bin')); expect(fileExists, false); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager(<Device>[]), }); testUsingContext('Rebuild the asset bundle if an asset file has changed since previous build', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); fs.file('asset.txt').writeAsStringSync('1'); fs.file('pubspec.yaml').writeAsStringSync(''' flutter: assets: - asset.txt dev_dependencies: flutter_test: sdk: flutter integration_test: sdk: flutter'''); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', ]); fs.file('asset.txt').writeAsStringSync('2'); await commandRunner.run(const <String>[ 'test', '--no-pub', ]); final String fileContent = fs.file(globals.fs.path.join('build', 'unit_test_assets', 'asset.txt')).readAsStringSync(); expect(fileContent, '2'); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.empty(), DeviceManager: () => _FakeDeviceManager(<Device>[]), }); group('Fatal Logs', () { testUsingContext("doesn't fail when --fatal-warnings is set and no warning output", () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); try { await commandRunner.run(const <String>[ 'test', '--no-pub', '--${FlutterOptions.kFatalWarnings}', ]); } on Exception { fail('Unexpected exception thrown'); } }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('fails if --fatal-warnings specified and warnings emitted', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); testLogger.printWarning('Warning: Mild annoyance, Will Robinson!'); expect(commandRunner.run(const <String>[ 'test', '--no-pub', '--${FlutterOptions.kFatalWarnings}', ]), throwsToolExit(message: 'Logger received warning output during the run, and "--${FlutterOptions.kFatalWarnings}" is enabled.')); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('fails when --fatal-warnings is set and only errors emitted', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); testLogger.printError('Error: Danger Will Robinson!'); expect(commandRunner.run(const <String>[ 'test', '--no-pub', '--${FlutterOptions.kFatalWarnings}', ]), throwsToolExit(message: 'Logger received error output during the run, and "--${FlutterOptions.kFatalWarnings}" is enabled.')); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); }); group('File Reporter', () { testUsingContext('defaults to unset null value', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', ]); expect(testRunner.lastFileReporterValue, null); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('when set --file-reporter value is passed on', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '--file-reporter=json:out.jsonl' ]); expect(testRunner.lastFileReporterValue, 'json:out.jsonl'); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('Enables Impeller', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '--enable-impeller', ]); expect(testRunner.lastDebuggingOptionsValue.enableImpeller, ImpellerStatus.enabled); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('Passes web renderer into debugging options', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand); await commandRunner.run(const <String>[ 'test', '--no-pub', '--platform=chrome', '--web-renderer=canvaskit', ]); expect(testRunner.lastDebuggingOptionsValue.webRenderer, WebRendererMode.canvaskit); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); }); } class FakeFlutterTestRunner implements FlutterTestRunner { FakeFlutterTestRunner(this.exitCode, [this.leastRunTime, this.fakeVmServiceHost]); int exitCode; Duration? leastRunTime; bool? lastEnableVmServiceValue; late DebuggingOptions lastDebuggingOptionsValue; String? lastFileReporterValue; String? lastReporterOption; int? lastConcurrency; TestWatcher? lastTestWatcher; FakeVmServiceHost? fakeVmServiceHost; @override Future<int> runTests( TestWrapper testWrapper, List<Uri> testFiles, { required DebuggingOptions debuggingOptions, List<String> names = const <String>[], List<String> plainNames = const <String>[], String? tags, String? excludeTags, bool enableVmService = false, bool ipv6 = false, bool machine = false, String? precompiledDillPath, Map<String, String>? precompiledDillFiles, bool updateGoldens = false, TestWatcher? watcher, required int? concurrency, String? testAssetDirectory, FlutterProject? flutterProject, String? icudtlPath, Directory? coverageDirectory, bool web = false, String? randomSeed, String? reporter, String? fileReporter, String? timeout, bool runSkipped = false, int? shardIndex, int? totalShards, Device? integrationTestDevice, String? integrationTestUserIdentifier, TestTimeRecorder? testTimeRecorder, TestCompilerNativeAssetsBuilder? nativeAssetsBuilder, }) async { lastEnableVmServiceValue = enableVmService; lastDebuggingOptionsValue = debuggingOptions; lastFileReporterValue = fileReporter; lastReporterOption = reporter; lastConcurrency = concurrency; lastTestWatcher = watcher; if (leastRunTime != null) { await Future<void>.delayed(leastRunTime!); } if (watcher is CoverageCollector) { await watcher.collectCoverage( TestTestDevice(), serviceOverride: fakeVmServiceHost?.vmService, ); } return exitCode; } @override Never runTestsBySpawningLightweightEngines( List<Uri> testFiles, { required DebuggingOptions debuggingOptions, List<String> names = const <String>[], List<String> plainNames = const <String>[], String? tags, String? excludeTags, bool machine = false, bool updateGoldens = false, required int? concurrency, String? testAssetDirectory, FlutterProject? flutterProject, String? icudtlPath, String? randomSeed, String? reporter, String? fileReporter, String? timeout, bool runSkipped = false, int? shardIndex, int? totalShards, TestTimeRecorder? testTimeRecorder, TestCompilerNativeAssetsBuilder? nativeAssetsBuilder, }) { throw UnimplementedError(); } } class TestTestDevice extends TestDevice { @override Future<void> get finished => Future<void>.delayed(const Duration(seconds: 1)); @override Future<void> kill() => Future<void>.value(); @override Future<Uri?> get vmServiceUri => Future<Uri?>.value(Uri()); @override Future<StreamChannel<String>> start(String entrypointPath) { throw UnimplementedError(); } } class FakePackageTest implements TestWrapper { List<String>? lastArgs; @override Future<void> main(List<String> args) async { lastArgs = args; } @override void registerPlatformPlugin( Iterable<Runtime> runtimes, FutureOr<PlatformPlugin> Function() platforms, ) {} } class _FakeTerminal extends Fake implements AnsiTerminal { @override final bool supportsColor = false; @override bool get isCliAnimationEnabled => supportsColor; } class _FakeDeviceManager extends DeviceManager { _FakeDeviceManager(this._connectedDevices) : super(logger: testLogger); final List<Device> _connectedDevices; @override Future<List<Device>> getAllDevices({ DeviceDiscoveryFilter? filter, }) async => filteredDevices(filter); @override List<DeviceDiscovery> get deviceDiscoverers => <DeviceDiscovery>[]; List<Device> filteredDevices(DeviceDiscoveryFilter? filter) { if (filter?.deviceConnectionInterface == DeviceConnectionInterface.wireless) { return <Device>[]; } return _connectedDevices; } }
flutter/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart", "repo_id": "flutter", "token_count": 19204 }
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:file/memory.dart'; import 'package:flutter_tools/src/android/deferred_components_gen_snapshot_validator.dart'; import 'package:flutter_tools/src/android/deferred_components_validator.dart'; import 'package:flutter_tools/src/artifacts.dart'; import 'package:flutter_tools/src/base/deferred_component.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/build_info.dart'; import 'package:flutter_tools/src/build_system/build_system.dart'; import '../../src/common.dart'; import '../../src/fake_process_manager.dart'; void main() { late FileSystem fileSystem; late BufferLogger logger; late Environment env; Environment createEnvironment() { final Map<String, String> defines = <String, String>{ kDeferredComponents: 'true' }; final Environment result = Environment.test( fileSystem.directory('/project'), defines: defines, artifacts: Artifacts.test(), fileSystem: fileSystem, logger: logger, processManager: FakeProcessManager.any(), ); return result; } setUp(() { fileSystem = MemoryFileSystem.test(); logger = BufferLogger.test(); env = createEnvironment(); }); testWithoutContext('No checks passes', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, 'test check passed.\n'); }); testWithoutContext('writeCache passes', () async { final File cacheFile = env.projectDir.childFile(DeferredComponentsValidator.kLoadingUnitsCacheFileName); if (cacheFile.existsSync()) { cacheFile.deleteSync(); } final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); validator.writeLoadingUnitsCache( <LoadingUnit>[ LoadingUnit(id: 2, libraries: <String>['lib1']), LoadingUnit(id: 3, libraries: <String>['lib2', 'lib3']), ], ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, 'test check passed.\n'); final File expectedFile = env.projectDir.childFile('deferred_components_loading_units.yaml'); expect(expectedFile.existsSync(), true); const String expectedContents = ''' loading-units: - id: 2 libraries: - lib1 - id: 3 libraries: - lib2 - lib3 '''; expect(expectedFile.readAsStringSync(), contains(expectedContents)); }); testWithoutContext('loadingUnitCache identical passes', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); final File cacheFile = env.projectDir.childFile(DeferredComponentsValidator.kLoadingUnitsCacheFileName); cacheFile.createSync(recursive: true); cacheFile.writeAsStringSync(''' loading-units: - id: 2 libraries: - lib1 - id: 3 libraries: - lib2 - lib3 '''); validator.checkAgainstLoadingUnitsCache( <LoadingUnit>[ LoadingUnit(id: 2, libraries: <String>['lib1']), LoadingUnit(id: 3, libraries: <String>['lib2', 'lib3']), ] ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, 'test check passed.\n'); }); testWithoutContext('loadingUnitCache finds new loading units', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); final File cacheFile = env.projectDir.childFile(DeferredComponentsValidator.kLoadingUnitsCacheFileName); cacheFile.createSync(recursive: true); cacheFile.writeAsStringSync(''' loading-units: - id: 3 libraries: - lib2 - lib3 '''); validator.checkAgainstLoadingUnitsCache( <LoadingUnit>[ LoadingUnit(id: 2, libraries: <String>['lib1']), LoadingUnit(id: 3, libraries: <String>['lib2', 'lib3']), ], ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, contains('New loading units were found:\n\n LoadingUnit 2\n Libraries:\n - lib1\n')); }); testWithoutContext('loadingUnitCache finds missing loading units', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); final File cacheFile = env.projectDir.childFile(DeferredComponentsValidator.kLoadingUnitsCacheFileName); cacheFile.createSync(recursive: true); cacheFile.writeAsStringSync(''' loading-units: - id: 2 libraries: - lib1 - id: 3 libraries: - lib2 - lib3 '''); validator.checkAgainstLoadingUnitsCache( <LoadingUnit>[ LoadingUnit(id: 3, libraries: <String>['lib2', 'lib3']), ], ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, contains('Previously existing loading units no longer exist:\n\n LoadingUnit 2\n Libraries:\n - lib1\n')); }); testWithoutContext('missing cache file counts as all new loading units', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); validator.checkAgainstLoadingUnitsCache( <LoadingUnit>[ LoadingUnit(id: 2, libraries: <String>['lib1']), ], ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, contains('New loading units were found:\n\n LoadingUnit 2\n Libraries:\n - lib1\n')); }); testWithoutContext('loadingUnitCache validator detects malformed file: missing main entry', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); final File cacheFile = env.projectDir.childFile(DeferredComponentsValidator.kLoadingUnitsCacheFileName); cacheFile.createSync(recursive: true); cacheFile.writeAsStringSync(''' loading-units-spelled-wrong: - id: 2 libraries: - lib1 - id: 3 libraries: - lib2 - lib3 '''); validator.checkAgainstLoadingUnitsCache( <LoadingUnit>[ LoadingUnit(id: 3, libraries: <String>['lib2', 'lib3']), ], ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, contains('Errors checking the following files:')); expect(logger.statusText, contains("Invalid loading units yaml file, 'loading-units' entry did not exist.")); expect(logger.statusText.contains('Previously existing loading units no longer exist:\n\n LoadingUnit 2\n Libraries:\n - lib1\n'), false); }); testWithoutContext('loadingUnitCache validator detects malformed file: not a list', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); final File cacheFile = env.projectDir.childFile(DeferredComponentsValidator.kLoadingUnitsCacheFileName); cacheFile.createSync(recursive: true); cacheFile.writeAsStringSync(''' loading-units: hello '''); validator.checkAgainstLoadingUnitsCache( <LoadingUnit>[ LoadingUnit(id: 3, libraries: <String>['lib2', 'lib3']), ], ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, contains('Errors checking the following files:')); expect(logger.statusText, contains("Invalid loading units yaml file, 'loading-units' is not a list.")); }); testWithoutContext('loadingUnitCache validator detects malformed file: not a list', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); final File cacheFile = env.projectDir.childFile(DeferredComponentsValidator.kLoadingUnitsCacheFileName); cacheFile.createSync(recursive: true); cacheFile.writeAsStringSync(''' loading-units: - 2 - 3 '''); validator.checkAgainstLoadingUnitsCache( <LoadingUnit>[ LoadingUnit(id: 3, libraries: <String>['lib2', 'lib3']), ], ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, contains('Errors checking the following files:')); expect(logger.statusText, contains("Invalid loading units yaml file, 'loading-units' is not a list of maps.")); }); testWithoutContext('loadingUnitCache validator detects malformed file: missing id', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); final File cacheFile = env.projectDir.childFile(DeferredComponentsValidator.kLoadingUnitsCacheFileName); cacheFile.createSync(recursive: true); cacheFile.writeAsStringSync(''' loading-units: - id: 2 libraries: - lib1 - libraries: - lib2 - lib3 '''); validator.checkAgainstLoadingUnitsCache( <LoadingUnit>[ LoadingUnit(id: 3, libraries: <String>['lib2', 'lib3']), ], ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, contains('Errors checking the following files:')); expect(logger.statusText, contains("Invalid loading units yaml file, all loading units must have an 'id'")); }); testWithoutContext('loadingUnitCache validator detects malformed file: libraries is list', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); final File cacheFile = env.projectDir.childFile(DeferredComponentsValidator.kLoadingUnitsCacheFileName); cacheFile.createSync(recursive: true); cacheFile.writeAsStringSync(''' loading-units: - id: 2 libraries: - lib1 - id: 3 libraries: hello '''); validator.checkAgainstLoadingUnitsCache( <LoadingUnit>[ LoadingUnit(id: 3, libraries: <String>['lib2', 'lib3']), ], ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, contains('Errors checking the following files:')); expect(logger.statusText, contains("Invalid loading units yaml file, 'libraries' is not a list.")); }); testWithoutContext('loadingUnitCache validator detects malformed file: libraries is list of strings', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); final File cacheFile = env.projectDir.childFile(DeferredComponentsValidator.kLoadingUnitsCacheFileName); cacheFile.createSync(recursive: true); cacheFile.writeAsStringSync(''' loading-units: - id: 2 libraries: - lib1 - id: 3 libraries: - blah: hello blah2: hello2 '''); validator.checkAgainstLoadingUnitsCache( <LoadingUnit>[ LoadingUnit(id: 3, libraries: <String>['lib2', 'lib3']), ], ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, contains('Errors checking the following files:')); expect(logger.statusText, contains("Invalid loading units yaml file, 'libraries' is not a list of strings.")); }); testWithoutContext('loadingUnitCache validator detects malformed file: empty libraries allowed', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); final File cacheFile = env.projectDir.childFile(DeferredComponentsValidator.kLoadingUnitsCacheFileName); cacheFile.createSync(recursive: true); cacheFile.writeAsStringSync(''' loading-units: - id: 2 libraries: - lib1 - id: 3 libraries: '''); validator.checkAgainstLoadingUnitsCache( <LoadingUnit>[ LoadingUnit(id: 3, libraries: <String>['lib2', 'lib3']), ], ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText.contains('Errors checking the following files:'), false); }); testWithoutContext('androidStringMapping modifies strings file', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); final Directory baseModuleDir = env.projectDir.childDirectory('android').childDirectory('app'); final File manifest = baseModuleDir.childDirectory('src').childDirectory('main').childFile('AndroidManifest.xml'); if (manifest.existsSync()) { manifest.deleteSync(); } manifest.createSync(recursive: true); manifest.writeAsStringSync(''' <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.splitaot"> <application android:name="io.flutter.app.FlutterPlayStoreSplitApplication" android:label="splitaot" android:extractNativeLibs="false"> <activity android:name=".MainActivity" android:launchMode="singleTop" android:windowSoftInputMode="adjustResize"> </activity> <!-- Don't delete the meta-data below. This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> <meta-data android:name="flutterEmbedding" android:value="2" /> <meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="invalidmapping" /> </application> </manifest> '''); validator.checkAppAndroidManifestComponentLoadingUnitMapping( <DeferredComponent>[ DeferredComponent(name: 'component1', libraries: <String>['lib2']), DeferredComponent(name: 'component2', libraries: <String>['lib1', 'lib4']), ], <LoadingUnit>[ LoadingUnit(id: 2, libraries: <String>['lib1']), LoadingUnit(id: 3, libraries: <String>['lib2', 'lib3']), LoadingUnit(id: 4, libraries: <String>['lib4', 'lib5']), ], ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, contains('Modified android files:\n')); expect(logger.statusText, contains('build/${DeferredComponentsValidator.kDeferredComponentsTempDirectory}/app/src/main/AndroidManifest.xml\n')); final File manifestOutput = env.projectDir .childDirectory('build') .childDirectory(DeferredComponentsValidator.kDeferredComponentsTempDirectory) .childDirectory('app') .childDirectory('src') .childDirectory('main') .childFile('AndroidManifest.xml'); expect(manifestOutput.existsSync(), true); expect(manifestOutput.readAsStringSync().contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/>'), true); expect(manifestOutput.readAsStringSync().contains('android:value="invalidmapping"'), false); expect(manifestOutput.readAsStringSync().contains("<!-- Don't delete the meta-data below."), true); }); testWithoutContext('androidStringMapping adds mapping when no existing mapping', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); final Directory baseModuleDir = env.projectDir.childDirectory('android').childDirectory('app'); final File manifest = baseModuleDir.childDirectory('src').childDirectory('main').childFile('AndroidManifest.xml'); manifest.createSync(recursive: true); manifest.writeAsStringSync(''' <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.splitaot"> <application android:name="io.flutter.app.FlutterPlayStoreSplitApplication" android:label="splitaot" android:extractNativeLibs="false"> <activity android:name=".MainActivity" android:launchMode="singleTop" android:windowSoftInputMode="adjustResize"> </activity> <!-- Don't delete the meta-data below. This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> <meta-data android:name="flutterEmbedding" android:value="2" /> </application> </manifest> '''); validator.checkAppAndroidManifestComponentLoadingUnitMapping( <DeferredComponent>[ DeferredComponent(name: 'component1', libraries: <String>['lib2']), DeferredComponent(name: 'component2', libraries: <String>['lib1', 'lib4']), ], <LoadingUnit>[ LoadingUnit(id: 2, libraries: <String>['lib1']), LoadingUnit(id: 3, libraries: <String>['lib2', 'lib3']), LoadingUnit(id: 4, libraries: <String>['lib4', 'lib5']), ], ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, contains('Modified android files:\n')); expect(logger.statusText, contains('build/${DeferredComponentsValidator.kDeferredComponentsTempDirectory}/app/src/main/AndroidManifest.xml\n')); final File manifestOutput = env.projectDir .childDirectory('build') .childDirectory(DeferredComponentsValidator.kDeferredComponentsTempDirectory) .childDirectory('app') .childDirectory('src') .childDirectory('main') .childFile('AndroidManifest.xml'); expect(manifestOutput.existsSync(), true); expect(manifestOutput.readAsStringSync(), contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/>')); expect(manifestOutput.readAsStringSync(), contains("<!-- Don't delete the meta-data below.")); }); // The mapping is incorrectly placed in the activity instead of application. testWithoutContext('androidStringMapping detects improperly placed metadata mapping', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); final Directory baseModuleDir = env.projectDir.childDirectory('android').childDirectory('app'); final File manifest = baseModuleDir.childDirectory('src').childDirectory('main').childFile('AndroidManifest.xml'); manifest.createSync(recursive: true); manifest.writeAsStringSync(''' <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.splitaot"> <application android:name="io.flutter.app.FlutterPlayStoreSplitApplication" android:label="splitaot" android:extractNativeLibs="false"> <activity android:name=".MainActivity" android:launchMode="singleTop" android:windowSoftInputMode="adjustResize"> <meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/> </activity> <!-- Don't delete the meta-data below. This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> <meta-data android:name="flutterEmbedding" android:value="2" /> </application> </manifest> '''); validator.checkAppAndroidManifestComponentLoadingUnitMapping( <DeferredComponent>[ DeferredComponent(name: 'component1', libraries: <String>['lib2']), DeferredComponent(name: 'component2', libraries: <String>['lib1', 'lib4']), ], <LoadingUnit>[ LoadingUnit(id: 2, libraries: <String>['lib1']), LoadingUnit(id: 3, libraries: <String>['lib2', 'lib3']), LoadingUnit(id: 4, libraries: <String>['lib4', 'lib5']), ], ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, contains('Modified android files:\n')); expect(logger.statusText, contains('build/${DeferredComponentsValidator.kDeferredComponentsTempDirectory}/app/src/main/AndroidManifest.xml\n')); final File manifestOutput = env.projectDir .childDirectory('build') .childDirectory(DeferredComponentsValidator.kDeferredComponentsTempDirectory) .childDirectory('app') .childDirectory('src') .childDirectory('main') .childFile('AndroidManifest.xml'); expect(manifestOutput.existsSync(), true); expect(manifestOutput.readAsStringSync(), contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/>')); expect(manifestOutput.readAsStringSync(), contains("<!-- Don't delete the meta-data below.")); }); testWithoutContext('androidStringMapping generates base module loading unit mapping', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); final Directory baseModuleDir = env.projectDir.childDirectory('android').childDirectory('app'); final File manifest = baseModuleDir.childDirectory('src').childDirectory('main').childFile('AndroidManifest.xml'); manifest.createSync(recursive: true); manifest.writeAsStringSync(''' <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.splitaot"> <application android:name="io.flutter.app.FlutterPlayStoreSplitApplication" android:label="splitaot" android:extractNativeLibs="false"> <activity android:name=".MainActivity" android:launchMode="singleTop" android:windowSoftInputMode="adjustResize"> </activity> <!-- Don't delete the meta-data below. This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> <meta-data android:name="flutterEmbedding" android:value="2" /> </application> </manifest> '''); validator.checkAppAndroidManifestComponentLoadingUnitMapping( <DeferredComponent>[ DeferredComponent(name: 'component1', libraries: <String>['lib2']), DeferredComponent(name: 'component2', libraries: <String>['lib1', 'lib4']), ], <LoadingUnit>[ LoadingUnit(id: 2, libraries: <String>['lib1']), LoadingUnit(id: 3, libraries: <String>['lib2', 'lib3']), LoadingUnit(id: 4, libraries: <String>['lib4', 'lib5']), // Loading units 6 and 7 are in base module LoadingUnit(id: 5, libraries: <String>['lib6', 'lib7']), LoadingUnit(id: 6, libraries: <String>['lib8', 'lib9']), ], ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, contains('Modified android files:\n')); expect(logger.statusText, contains('build/${DeferredComponentsValidator.kDeferredComponentsTempDirectory}/app/src/main/AndroidManifest.xml\n')); final File manifestOutput = env.projectDir .childDirectory('build') .childDirectory(DeferredComponentsValidator.kDeferredComponentsTempDirectory) .childDirectory('app') .childDirectory('src') .childDirectory('main') .childFile('AndroidManifest.xml'); expect(manifestOutput.existsSync(), true); expect(manifestOutput.readAsStringSync(), contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2,5:,6:"/>')); expect(manifestOutput.readAsStringSync(), contains("<!-- Don't delete the meta-data below.")); }); // Tests if all of the regexp whitespace detection is working. testWithoutContext('androidStringMapping handles whitespace within entry', () async { final DeferredComponentsGenSnapshotValidator validator = DeferredComponentsGenSnapshotValidator( env, exitOnFail: false, title: 'test check', ); final Directory baseModuleDir = env.projectDir.childDirectory('android').childDirectory('app'); final File manifest = baseModuleDir.childDirectory('src').childDirectory('main').childFile('AndroidManifest.xml'); manifest.createSync(recursive: true); manifest.writeAsStringSync(''' <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.splitaot"> <application android:name="io.flutter.app.FlutterPlayStoreSplitApplication" android:label="splitaot" android:extractNativeLibs="false"> <activity android:name=".MainActivity" android:launchMode="singleTop" android:windowSoftInputMode="adjustResize"> </activity> <!-- Don't delete the meta-data below. This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> <meta-data android:name="flutterEmbedding" android:value="2" /> <meta-data android:name = "io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value = "invalidmapping" /> </application> </manifest> '''); validator.checkAppAndroidManifestComponentLoadingUnitMapping( <DeferredComponent>[ DeferredComponent(name: 'component1', libraries: <String>['lib2']), DeferredComponent(name: 'component2', libraries: <String>['lib1', 'lib4']), ], <LoadingUnit>[ LoadingUnit(id: 2, libraries: <String>['lib1']), LoadingUnit(id: 3, libraries: <String>['lib2', 'lib3']), LoadingUnit(id: 4, libraries: <String>['lib4', 'lib5']), ], ); validator.displayResults(); validator.attemptToolExit(); expect(logger.statusText, contains('Modified android files:\n')); expect(logger.statusText, contains('build/${DeferredComponentsValidator.kDeferredComponentsTempDirectory}/app/src/main/AndroidManifest.xml\n')); final File manifestOutput = env.projectDir .childDirectory('build') .childDirectory(DeferredComponentsValidator.kDeferredComponentsTempDirectory) .childDirectory('app') .childDirectory('src') .childDirectory('main') .childFile('AndroidManifest.xml'); expect(manifestOutput.existsSync(), true); expect(manifestOutput.readAsStringSync().contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/>'), true); expect(manifestOutput.readAsStringSync().contains(RegExp(r'android:value[\s\n]*=[\s\n]*"invalidmapping"')), false); expect(manifestOutput.readAsStringSync().contains("<!-- Don't delete the meta-data below."), true); }); }
flutter/packages/flutter_tools/test/general.shard/android/deferred_components_gen_snapshot_validator_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/android/deferred_components_gen_snapshot_validator_test.dart", "repo_id": "flutter", "token_count": 10033 }
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 'dart:convert'; import 'dart:typed_data'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/artifacts.dart'; import 'package:flutter_tools/src/asset.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/bundle_builder.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/devfs.dart'; import 'package:flutter_tools/src/device.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/project.dart'; import 'package:standard_message_codec/standard_message_codec.dart'; import '../src/common.dart'; import '../src/context.dart'; void main() { const String shaderLibDir = '/./shader_lib'; group('AssetBundle.build (using context)', () { late FileSystem testFileSystem; late Platform platform; setUp(() async { testFileSystem = MemoryFileSystem(); testFileSystem.currentDirectory = testFileSystem.systemTempDirectory.createTempSync('flutter_asset_bundle_test.'); platform = FakePlatform(); }); testUsingContext('nonempty', () async { final AssetBundle ab = AssetBundleFactory.instance.createBundle(); expect(await ab.build(packagesPath: '.packages'), 0); expect(ab.entries.length, greaterThan(0)); }, overrides: <Type, Generator>{ FileSystem: () => testFileSystem, Platform: () => platform, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('empty pubspec', () async { globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(''); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); await bundle.build(packagesPath: '.packages'); expect(bundle.entries.keys, unorderedEquals(<String>['AssetManifest.json', 'AssetManifest.bin']) ); const String expectedJsonAssetManifest = '{}'; const Map<Object, Object> expectedBinAssetManifest = <Object, Object>{}; expect( utf8.decode(await bundle.entries['AssetManifest.json']!.contentsAsBytes()), expectedJsonAssetManifest, ); expect( const StandardMessageCodec().decodeMessage(ByteData.sublistView(Uint8List.fromList(await bundle.entries['AssetManifest.bin']!.contentsAsBytes()))), expectedBinAssetManifest ); }, overrides: <Type, Generator>{ FileSystem: () => testFileSystem, Platform: () => platform, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('wildcard directories do not include subdirectories', () async { globals.fs.file('.packages').createSync(); globals.fs.file('pubspec.yaml').writeAsStringSync( ''' name: test dependencies: flutter: sdk: flutter flutter: assets: - assets/foo/ - assets/bar/lizard.png ''' ); final List<String> assets = <String>[ 'assets/foo/dog.png', 'assets/foo/sub/cat.png', 'assets/bar/lizard.png', 'assets/bar/sheep.png' ]; for (final String asset in assets) { final File assetFile = globals.fs.file( globals.fs.path.joinAll(asset.split('/')) ); assetFile.createSync(recursive: true); } final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); await bundle.build(packagesPath: '.packages'); expect(bundle.entries.keys, unorderedEquals(<String>[ 'AssetManifest.json', 'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/dog.png', 'assets/bar/lizard.png' ])); }, overrides: <Type, Generator>{ FileSystem: () => testFileSystem, Platform: () => platform, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('wildcard directories are updated when filesystem changes', () async { final File packageFile = globals.fs.file('.packages')..createSync(); globals.fs.file(globals.fs.path.join('assets', 'foo', 'bar.txt')).createSync(recursive: true); globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: assets: - assets/foo/ '''); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); await bundle.build(packagesPath: '.packages'); expect(bundle.entries.keys, unorderedEquals(<String>['AssetManifest.json', 'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt'])); // Simulate modifying the files by updating the filestat time manually. globals.fs.file(globals.fs.path.join('assets', 'foo', 'fizz.txt')) ..createSync(recursive: true) ..setLastModifiedSync(packageFile.lastModifiedSync().add(const Duration(hours: 1))); expect(bundle.needsBuild(), true); await bundle.build(packagesPath: '.packages'); expect(bundle.entries.keys, unorderedEquals(<String>['AssetManifest.json', 'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt', 'assets/foo/fizz.txt'])); }, overrides: <Type, Generator>{ FileSystem: () => testFileSystem, Platform: () => platform, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('handle removal of wildcard directories', () async { globals.fs.file(globals.fs.path.join('assets', 'foo', 'bar.txt')).createSync(recursive: true); final File pubspec = globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: assets: - assets/foo/ '''); globals.fs.file('.packages').createSync(); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); await bundle.build(packagesPath: '.packages'); expect(bundle.entries.keys, unorderedEquals(<String>['AssetManifest.json', 'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt'])); expect(bundle.needsBuild(), false); // Delete the wildcard directory and update pubspec file. final DateTime modifiedTime = pubspec.lastModifiedSync().add(const Duration(hours: 1)); globals.fs.directory(globals.fs.path.join('assets', 'foo')).deleteSync(recursive: true); globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example''') ..setLastModifiedSync(modifiedTime); // touch .packages to make sure its change time is after pubspec.yaml's globals.fs.file('.packages') .setLastModifiedSync(modifiedTime); // Even though the previous file was removed, it is left in the // asset manifest and not updated. This is due to the devfs not // supporting file deletion. expect(bundle.needsBuild(), true); await bundle.build(packagesPath: '.packages'); expect(bundle.entries.keys, unorderedEquals(<String>['AssetManifest.json', 'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt'])); }, overrides: <Type, Generator>{ FileSystem: () => testFileSystem, Platform: () => platform, ProcessManager: () => FakeProcessManager.any(), }); // https://github.com/flutter/flutter/issues/42723 testUsingContext('Test regression for mistyped file', () async { globals.fs.file(globals.fs.path.join('assets', 'foo', 'bar.txt')).createSync(recursive: true); // Create a directory in the same path to test that we're only looking at File // objects. globals.fs.directory(globals.fs.path.join('assets', 'foo', 'bar')).createSync(); globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: assets: - assets/foo/ '''); globals.fs.file('.packages').createSync(); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); await bundle.build(packagesPath: '.packages'); expect(bundle.entries.keys, unorderedEquals(<String>['AssetManifest.json', 'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt'])); expect(bundle.needsBuild(), false); }, overrides: <Type, Generator>{ FileSystem: () => testFileSystem, Platform: () => platform, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('deferred assets are parsed', () async { globals.fs.file('.packages').createSync(); globals.fs.file(globals.fs.path.join('assets', 'foo', 'bar.txt')).createSync(recursive: true); globals.fs.file(globals.fs.path.join('assets', 'bar', 'barbie.txt')).createSync(recursive: true); globals.fs.file(globals.fs.path.join('assets', 'wild', 'dash.txt')).createSync(recursive: true); globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: assets: - assets/foo/ deferred-components: - name: component1 assets: - assets/bar/barbie.txt - assets/wild/ '''); final AssetBundle bundle = AssetBundleFactory.defaultInstance( logger: globals.logger, fileSystem: globals.fs, platform: globals.platform, splitDeferredAssets: true, ).createBundle(); await bundle.build(packagesPath: '.packages', deferredComponentsEnabled: true); expect(bundle.entries.keys, unorderedEquals(<String>['AssetManifest.json', 'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z', 'assets/foo/bar.txt'])); expect(bundle.deferredComponentsEntries.length, 1); expect(bundle.deferredComponentsEntries['component1']!.length, 2); expect(bundle.needsBuild(), false); }, overrides: <Type, Generator>{ FileSystem: () => testFileSystem, Platform: () => platform, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('deferred assets are parsed regularly when splitDeferredAssets Disabled', () async { globals.fs.file('.packages').createSync(); globals.fs.file(globals.fs.path.join('assets', 'foo', 'bar.txt')).createSync(recursive: true); globals.fs.file(globals.fs.path.join('assets', 'bar', 'barbie.txt')).createSync(recursive: true); globals.fs.file(globals.fs.path.join('assets', 'wild', 'dash.txt')).createSync(recursive: true); globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: assets: - assets/foo/ deferred-components: - name: component1 assets: - assets/bar/barbie.txt - assets/wild/ '''); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); await bundle.build(packagesPath: '.packages'); expect(bundle.entries.keys, unorderedEquals(<String>['assets/foo/bar.txt', 'assets/bar/barbie.txt', 'assets/wild/dash.txt', 'AssetManifest.json', 'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z'])); expect(bundle.deferredComponentsEntries.isEmpty, true); expect(bundle.needsBuild(), false); }, overrides: <Type, Generator>{ FileSystem: () => testFileSystem, Platform: () => platform, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('deferred assets wildcard parsed', () async { final File packageFile = globals.fs.file('.packages')..createSync(); globals.fs.file(globals.fs.path.join('assets', 'foo', 'bar.txt')).createSync(recursive: true); globals.fs.file(globals.fs.path.join('assets', 'bar', 'barbie.txt')).createSync(recursive: true); globals.fs.file(globals.fs.path.join('assets', 'wild', 'dash.txt')).createSync(recursive: true); globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: assets: - assets/foo/ deferred-components: - name: component1 assets: - assets/bar/barbie.txt - assets/wild/ '''); final AssetBundle bundle = AssetBundleFactory.defaultInstance( logger: globals.logger, fileSystem: globals.fs, platform: globals.platform, splitDeferredAssets: true, ).createBundle(); await bundle.build(packagesPath: '.packages', deferredComponentsEnabled: true); expect(bundle.entries.keys, unorderedEquals(<String>['assets/foo/bar.txt', 'AssetManifest.json', 'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z'])); expect(bundle.deferredComponentsEntries.length, 1); expect(bundle.deferredComponentsEntries['component1']!.length, 2); expect(bundle.needsBuild(), false); // Simulate modifying the files by updating the filestat time manually. globals.fs.file(globals.fs.path.join('assets', 'wild', 'fizz.txt')) ..createSync(recursive: true) ..setLastModifiedSync(packageFile.lastModifiedSync().add(const Duration(hours: 1))); expect(bundle.needsBuild(), true); await bundle.build(packagesPath: '.packages', deferredComponentsEnabled: true); expect(bundle.entries.keys, unorderedEquals(<String>['assets/foo/bar.txt', 'AssetManifest.json', 'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z'])); expect(bundle.deferredComponentsEntries.length, 1); expect(bundle.deferredComponentsEntries['component1']!.length, 3); }, overrides: <Type, Generator>{ FileSystem: () => testFileSystem, Platform: () => platform, ProcessManager: () => FakeProcessManager.any(), }); }); group('AssetBundle.build', () { testWithoutContext('throws ToolExit when directory entry contains invalid characters (Windows only)', () async { final MemoryFileSystem fileSystem = MemoryFileSystem(style: FileSystemStyle.windows); final BufferLogger logger = BufferLogger.test(); final FakePlatform platform = FakePlatform(operatingSystem: 'windows'); final String flutterRoot = Cache.defaultFlutterRoot( platform: platform, fileSystem: fileSystem, userMessages: UserMessages(), ); fileSystem.file('.packages').createSync(); fileSystem.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: assets: - https://mywebsite.com/images/ '''); final ManifestAssetBundle bundle = ManifestAssetBundle( logger: logger, fileSystem: fileSystem, platform: platform, flutterRoot: flutterRoot, ); expect( () => bundle.build( packagesPath: '.packages', flutterProject: FlutterProject.fromDirectoryTest( fileSystem.currentDirectory, ), ), throwsToolExit( message: 'Unable to search for asset files in directory path "https%3A//mywebsite.com/images/". ' 'Please ensure that this entry in pubspec.yaml is a valid file path.\n' 'Error details:\n' 'Unsupported operation: Illegal character in path: https:', ), ); }); testWithoutContext('throws ToolExit when file entry contains invalid characters (Windows only)', () async { final FileSystem fileSystem = MemoryFileSystem( style: FileSystemStyle.windows, opHandle: (String context, FileSystemOp operation) { if (operation == FileSystemOp.exists && context == r'C:\http:\\website.com') { throw const FileSystemException( r"FileSystemException: Exists failed, path = 'C:\http:\\website.com' " '(OS Error: The filename, directory name, or volume label syntax is ' 'incorrect., errno = 123)', ); } }, ); final BufferLogger logger = BufferLogger.test(); final FakePlatform platform = FakePlatform(operatingSystem: 'windows'); final String flutterRoot = Cache.defaultFlutterRoot( platform: platform, fileSystem: fileSystem, userMessages: UserMessages(), ); fileSystem.file('.packages').createSync(); fileSystem.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: assets: - http://website.com/hi.png '''); final ManifestAssetBundle bundle = ManifestAssetBundle( logger: logger, fileSystem: fileSystem, platform: platform, flutterRoot: flutterRoot, ); expect( () => bundle.build( packagesPath: '.packages', flutterProject: FlutterProject.fromDirectoryTest( fileSystem.currentDirectory, ), ), throwsToolExit( message: 'Unable to check the existence of asset file ', ), ); }); }); group('AssetBundle.build (web builds)', () { late FileSystem testFileSystem; late Platform testPlatform; setUp(() async { testFileSystem = MemoryFileSystem(); testFileSystem.currentDirectory = testFileSystem.systemTempDirectory.createTempSync('flutter_asset_bundle_test.'); testPlatform = FakePlatform(); }); testUsingContext('empty pubspec', () async { globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(''); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); await bundle.build(packagesPath: '.packages', targetPlatform: TargetPlatform.web_javascript); expect(bundle.entries.keys, unorderedEquals(<String>[ 'AssetManifest.json', 'AssetManifest.bin', 'AssetManifest.bin.json', ]) ); expect( utf8.decode(await bundle.entries['AssetManifest.json']!.contentsAsBytes()), '{}', ); expect( utf8.decode(await bundle.entries['AssetManifest.bin.json']!.contentsAsBytes()), '""', ); }, overrides: <Type, Generator>{ FileSystem: () => testFileSystem, Platform: () => testPlatform, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('pubspec contains an asset', () async { globals.fs.file('.packages').createSync(); globals.fs.file('pubspec.yaml').writeAsStringSync(r''' name: test dependencies: flutter: sdk: flutter flutter: assets: - assets/bar/lizard.png '''); globals.fs.file( globals.fs.path.joinAll(<String>['assets', 'bar', 'lizard.png']) ).createSync(recursive: true); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); await bundle.build(packagesPath: '.packages', targetPlatform: TargetPlatform.web_javascript); expect(bundle.entries.keys, unorderedEquals(<String>[ 'AssetManifest.json', 'AssetManifest.bin', 'AssetManifest.bin.json', 'FontManifest.json', 'NOTICES', // not .Z 'assets/bar/lizard.png', ]) ); final Map<Object?, Object?> manifestJson = json.decode( utf8.decode( await bundle.entries['AssetManifest.json']!.contentsAsBytes() ) ) as Map<Object?, Object?>; expect(manifestJson, isNotEmpty); expect(manifestJson['assets/bar/lizard.png'], isNotNull); final Uint8List manifestBinJsonBytes = base64.decode( json.decode( utf8.decode( await bundle.entries['AssetManifest.bin.json']!.contentsAsBytes() ) ) as String ); final Uint8List manifestBinBytes = Uint8List.fromList( await bundle.entries['AssetManifest.bin']!.contentsAsBytes() ); expect(manifestBinJsonBytes, equals(manifestBinBytes), reason: 'JSON-encoded binary content should be identical to BIN file.'); }, overrides: <Type, Generator>{ FileSystem: () => testFileSystem, Platform: () => testPlatform, ProcessManager: () => FakeProcessManager.any(), }); }); testUsingContext('Failed directory delete shows message', () async { final FileExceptionHandler handler = FileExceptionHandler(); final FileSystem fileSystem = MemoryFileSystem.test(opHandle: handler.opHandle); final Directory directory = fileSystem.directory('foo') ..createSync(); handler.addError(directory, FileSystemOp.delete, const FileSystemException('Expected Error Text')); await writeBundle( directory, const <String, AssetBundleEntry>{}, targetPlatform: TargetPlatform.android, impellerStatus: ImpellerStatus.disabled, processManager: globals.processManager, fileSystem: globals.fs, artifacts: globals.artifacts!, logger: testLogger, projectDir: globals.fs.currentDirectory ); expect(testLogger.warningText, contains('Expected Error Text')); }); testUsingContext('does not unnecessarily recreate asset manifest, font manifest, license', () async { globals.fs.file('.packages').createSync(); globals.fs.file(globals.fs.path.join('assets', 'foo', 'bar.txt')).createSync(recursive: true); globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: assets: - assets/foo/bar.txt '''); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); await bundle.build(packagesPath: '.packages'); final AssetBundleEntry? assetManifest = bundle.entries['AssetManifest.json']; final AssetBundleEntry? fontManifest = bundle.entries['FontManifest.json']; final AssetBundleEntry? license = bundle.entries['NOTICES']; await bundle.build(packagesPath: '.packages'); expect(assetManifest, bundle.entries['AssetManifest.json']); expect(fontManifest, bundle.entries['FontManifest.json']); expect(license, bundle.entries['NOTICES']); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), Platform: () => FakePlatform(), ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('inserts dummy file into additionalDependencies when ' 'wildcards are used', () async { globals.fs.file('.packages').createSync(); globals.fs.file(globals.fs.path.join('assets', 'bar.txt')).createSync(recursive: true); globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: assets: - assets/ '''); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); expect(await bundle.build(packagesPath: '.packages'), 0); expect(bundle.additionalDependencies.single.path, contains('DOES_NOT_EXIST_RERUN_FOR_WILDCARD')); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), Platform: () => FakePlatform(), ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('Does not insert dummy file into additionalDependencies ' 'when wildcards are not used', () async { globals.fs.file('.packages').createSync(); globals.fs.file(globals.fs.path.join('assets', 'bar.txt')).createSync(recursive: true); globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: assets: - assets/bar.txt '''); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); expect(await bundle.build(packagesPath: '.packages'), 0); expect(bundle.additionalDependencies, isEmpty); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), Platform: () => FakePlatform(), ProcessManager: () => FakeProcessManager.any(), }); group('Shaders: ', () { late MemoryFileSystem fileSystem; late Artifacts artifacts; late String impellerc; late Directory output; late String assetsPath; late String shaderPath; late String outputPath; setUp(() { artifacts = Artifacts.test(); fileSystem = MemoryFileSystem.test(); impellerc = artifacts.getHostArtifact(HostArtifact.impellerc).path; fileSystem.file(impellerc).createSync(recursive: true); output = fileSystem.directory('asset_output')..createSync(recursive: true); assetsPath = 'assets'; shaderPath = fileSystem.path.join(assetsPath, 'shader.frag'); outputPath = fileSystem.path.join(output.path, assetsPath, 'shader.frag'); fileSystem.file(shaderPath).createSync(recursive: true); }); testUsingContext('Including a shader triggers the shader compiler', () async { fileSystem.file('.packages').createSync(); fileSystem.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: shaders: - assets/shader.frag '''); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); expect(await bundle.build(packagesPath: '.packages'), 0); await writeBundle( output, bundle.entries, targetPlatform: TargetPlatform.android, impellerStatus: ImpellerStatus.disabled, processManager: globals.processManager, fileSystem: globals.fs, artifacts: globals.artifacts!, logger: testLogger, projectDir: globals.fs.currentDirectory, ); }, overrides: <Type, Generator>{ Artifacts: () => artifacts, FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list(<FakeCommand>[ FakeCommand( command: <String>[ impellerc, '--sksl', '--runtime-stage-gles', '--runtime-stage-vulkan', '--iplr', '--sl=$outputPath', '--spirv=$outputPath.spirv', '--input=/$shaderPath', '--input-type=frag', '--include=/$assetsPath', '--include=$shaderLibDir', ], onRun: (_) { fileSystem.file(outputPath).createSync(recursive: true); fileSystem.file('$outputPath.spirv').createSync(recursive: true); }, ), ]), }); testUsingContext('Included shaders are compiled for the web', () async { fileSystem.file('.packages').createSync(); fileSystem.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: shaders: - assets/shader.frag '''); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); expect(await bundle.build(packagesPath: '.packages', targetPlatform: TargetPlatform.web_javascript), 0); await writeBundle( output, bundle.entries, targetPlatform: TargetPlatform.web_javascript, impellerStatus: ImpellerStatus.disabled, processManager: globals.processManager, fileSystem: globals.fs, artifacts: globals.artifacts!, logger: testLogger, projectDir: globals.fs.currentDirectory, ); }, overrides: <Type, Generator>{ Artifacts: () => artifacts, FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list(<FakeCommand>[ FakeCommand( command: <String>[ impellerc, '--sksl', '--iplr', '--json', '--sl=$outputPath', '--spirv=$outputPath.spirv', '--input=/$shaderPath', '--input-type=frag', '--include=/$assetsPath', '--include=$shaderLibDir', ], onRun: (_) { fileSystem.file(outputPath).createSync(recursive: true); fileSystem.file('$outputPath.spirv').createSync(recursive: true); }, ), ]), }); testUsingContext('Material shaders are compiled for the web', () async { fileSystem.file('.packages').createSync(); final String materialIconsPath = fileSystem.path.join( getFlutterRoot(), 'bin', 'cache', 'artifacts', 'material_fonts', 'MaterialIcons-Regular.otf', ); fileSystem.file(materialIconsPath).createSync(recursive: true); final String materialPath = fileSystem.path.join( getFlutterRoot(), 'packages', 'flutter', 'lib', 'src', 'material', ); final Directory materialDir = fileSystem.directory(materialPath)..createSync(recursive: true); for (final String shader in kMaterialShaders) { materialDir.childFile(shader).createSync(recursive: true); } (globals.processManager as FakeProcessManager) .addCommand(FakeCommand( command: <String>[ impellerc, '--sksl', '--iplr', '--json', '--sl=${fileSystem.path.join(output.path, 'shaders', 'ink_sparkle.frag')}', '--spirv=${fileSystem.path.join(output.path, 'shaders', 'ink_sparkle.frag.spirv')}', '--input=${fileSystem.path.join(materialDir.path, 'shaders', 'ink_sparkle.frag')}', '--input-type=frag', '--include=${fileSystem.path.join(materialDir.path, 'shaders')}', '--include=$shaderLibDir', ], onRun: (_) { fileSystem.file(outputPath).createSync(recursive: true); fileSystem.file('$outputPath.spirv').createSync(recursive: true); }, )); fileSystem.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: uses-material-design: true '''); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); expect(await bundle.build(packagesPath: '.packages', targetPlatform: TargetPlatform.web_javascript), 0); await writeBundle( output, bundle.entries, targetPlatform: TargetPlatform.web_javascript, impellerStatus: ImpellerStatus.disabled, processManager: globals.processManager, fileSystem: globals.fs, artifacts: globals.artifacts!, logger: testLogger, projectDir: globals.fs.currentDirectory, ); expect((globals.processManager as FakeProcessManager).hasRemainingExpectations, false); }, overrides: <Type, Generator>{ Artifacts: () => artifacts, FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list(<FakeCommand>[]), }); }); testUsingContext('Does not insert dummy file into additionalDependencies ' 'when wildcards are used by dependencies', () async { globals.fs.file('.packages').writeAsStringSync(r''' example:lib/ foo:foo/lib/ '''); globals.fs.file(globals.fs.path.join('assets', 'foo', 'bar.txt')) .createSync(recursive: true); globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example dependencies: foo: any '''); globals.fs.file('foo/pubspec.yaml') ..createSync(recursive: true) ..writeAsStringSync(r''' name: foo flutter: assets: - bar/ '''); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); globals.fs.file('foo/bar/fizz.txt').createSync(recursive: true); expect(await bundle.build(packagesPath: '.packages'), 0); expect(bundle.additionalDependencies, isEmpty); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), Platform: () => FakePlatform(), }); testUsingContext('does not track wildcard directories from dependencies', () async { globals.fs.file('.packages').writeAsStringSync(r''' example:lib/ foo:foo/lib/ '''); globals.fs.file(globals.fs.path.join('assets', 'foo', 'bar.txt')) .createSync(recursive: true); globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example dependencies: foo: any '''); globals.fs.file('foo/pubspec.yaml') ..createSync(recursive: true) ..writeAsStringSync(r''' name: foo flutter: assets: - bar/ '''); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); globals.fs.file('foo/bar/fizz.txt').createSync(recursive: true); await bundle.build(packagesPath: '.packages'); expect(bundle.entries.keys, unorderedEquals(<String>['packages/foo/bar/fizz.txt', 'AssetManifest.json', 'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z'])); expect(bundle.needsBuild(), false); // Does not track dependency's wildcard directories. globals.fs.file(globals.fs.path.join('assets', 'foo', 'bar.txt')) .deleteSync(); expect(bundle.needsBuild(), false); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), Platform: () => FakePlatform(), }); testUsingContext('reports package that causes asset bundle error when it is ' 'a dependency', () async { globals.fs.file('.packages').writeAsStringSync(r''' example:lib/ foo:foo/lib/ '''); globals.fs.file(globals.fs.path.join('assets', 'foo', 'bar.txt')) .createSync(recursive: true); globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example dependencies: foo: any '''); globals.fs.file('foo/pubspec.yaml') ..createSync(recursive: true) ..writeAsStringSync(r''' name: foo flutter: assets: - bar.txt '''); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); expect(await bundle.build(packagesPath: '.packages'), 1); expect(testLogger.errorText, contains('This asset was included from package foo')); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), Platform: () => FakePlatform(), }); testUsingContext('does not report package that causes asset bundle error ' 'when it is from own pubspec', () async { globals.fs.file('.packages').writeAsStringSync(r''' example:lib/ '''); globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: assets: - bar.txt '''); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); expect(await bundle.build(packagesPath: '.packages'), 1); expect(testLogger.errorText, isNot(contains('This asset was included from'))); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), Platform: () => FakePlatform(), }); testUsingContext('does not include Material Design assets if uses-material-design: true is ' 'specified only by a dependency', () async { globals.fs.file('.packages').writeAsStringSync(r''' example:lib/ foo:foo/lib/ '''); globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example dependencies: foo: any flutter: uses-material-design: false '''); globals.fs.file('foo/pubspec.yaml') ..createSync(recursive: true) ..writeAsStringSync(r''' name: foo flutter: uses-material-design: true '''); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); expect(await bundle.build(packagesPath: '.packages'), 0); expect((bundle.entries['FontManifest.json']!.content as DevFSStringContent).string, '[]'); expect((bundle.entries['AssetManifest.json']!.content as DevFSStringContent).string, '{}'); expect(testLogger.errorText, contains( 'package:foo has `uses-material-design: true` set' )); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), Platform: () => FakePlatform(), }); testUsingContext('does not include assets in project directories as asset variants', () async { globals.fs.file('.packages').writeAsStringSync(r''' example:lib/ '''); globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: assets: - assets/foo.txt '''); globals.fs.file('assets/foo.txt').createSync(recursive: true); // Potential build artifacts outside of build directory. globals.fs.file('linux/flutter/foo.txt').createSync(recursive: true); globals.fs.file('windows/flutter/foo.txt').createSync(recursive: true); globals.fs.file('windows/CMakeLists.txt').createSync(); globals.fs.file('macos/Flutter/foo.txt').createSync(recursive: true); globals.fs.file('ios/foo.txt').createSync(recursive: true); globals.fs.file('build/foo.txt').createSync(recursive: true); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); expect(await bundle.build(packagesPath: '.packages'), 0); expect(bundle.entries.keys, unorderedEquals(<String>['assets/foo.txt', 'AssetManifest.json', 'AssetManifest.bin', 'FontManifest.json', 'NOTICES.Z'])); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), Platform: () => FakePlatform(), }); testUsingContext('deferred and regular assets are included in manifest alphabetically', () async { globals.fs.file('.packages').writeAsStringSync(r''' example:lib/ '''); globals.fs.file('pubspec.yaml') ..createSync() ..writeAsStringSync(r''' name: example flutter: assets: - assets/zebra.jpg - assets/foo.jpg deferred-components: - name: component1 assets: - assets/bar.jpg - assets/apple.jpg '''); globals.fs.file('assets/foo.jpg').createSync(recursive: true); globals.fs.file('assets/bar.jpg').createSync(); globals.fs.file('assets/apple.jpg').createSync(); globals.fs.file('assets/zebra.jpg').createSync(); final AssetBundle bundle = AssetBundleFactory.instance.createBundle(); expect(await bundle.build(packagesPath: '.packages'), 0); expect((bundle.entries['FontManifest.json']!.content as DevFSStringContent).string, '[]'); // The assets from deferred components and regular assets // are both included in alphabetical order expect((bundle.entries['AssetManifest.json']!.content as DevFSStringContent).string, '{"assets/apple.jpg":["assets/apple.jpg"],"assets/bar.jpg":["assets/bar.jpg"],"assets/foo.jpg":["assets/foo.jpg"],"assets/zebra.jpg":["assets/zebra.jpg"]}'); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), Platform: () => FakePlatform(), }); }
flutter/packages/flutter_tools/test/general.shard/asset_bundle_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/asset_bundle_test.dart", "repo_id": "flutter", "token_count": 14932 }
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 'dart:io' as io; import 'package:file/file.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/multi_root_file_system.dart'; import '../../src/common.dart'; void setupFileSystem({ required MemoryFileSystem fs, required List<String> directories, required List<String> files, }) { for (final String directory in directories) { fs.directory(directory).createSync(recursive: true); } for (final String file in files) { fs.file(file).writeAsStringSync('Content: $file'); } } void main() { group('Posix style', () { runTest(FileSystemStyle.posix); }); group('Windows style', () { runTest(FileSystemStyle.windows); }); } void runTest(FileSystemStyle style) { final String sep = style == FileSystemStyle.windows ? r'\' : '/'; final String root = style == FileSystemStyle.windows ? r'C:\' : '/'; final String rootUri = style == FileSystemStyle.windows ? 'C:/' : ''; late MultiRootFileSystem fs; setUp(() { final MemoryFileSystem memory = MemoryFileSystem(style: style); setupFileSystem( fs: memory, directories: <String>[ '${root}foo${sep}subdir', '${root}bar', '${root}bar${sep}bar_subdir', '${root}other${sep}directory', ], files: <String>[ '${root}foo${sep}only_in_foo', '${root}foo${sep}in_both', '${root}foo${sep}subdir${sep}in_subdir', '${root}bar${sep}only_in_bar', '${root}bar${sep}in_both', '${root}bar${sep}bar_subdir${sep}in_subdir', '${root}other${sep}directory${sep}file', ], ); fs = MultiRootFileSystem( delegate: memory, scheme: 'scheme', roots: <String>[ '${root}foo$sep', '${root}bar', ], ); }); testWithoutContext('file inside root', () { final File file = fs.file('${root}foo${sep}only_in_foo'); expect(file.readAsStringSync(), 'Content: ${root}foo${sep}only_in_foo'); expect(file.path, '${root}foo${sep}only_in_foo'); expect(file.uri, Uri.parse('scheme:///only_in_foo')); }); testWithoutContext('file inside second root', () { final File file = fs.file('${root}bar${sep}only_in_bar'); expect(file.readAsStringSync(), 'Content: ${root}bar${sep}only_in_bar'); expect(file.path, '${root}bar${sep}only_in_bar'); expect(file.uri, Uri.parse('scheme:///only_in_bar')); }); testWithoutContext('file outside root', () { final File file = fs.file('${root}other${sep}directory${sep}file'); expect(file.readAsStringSync(), 'Content: ${root}other${sep}directory${sep}file'); expect(file.path, '${root}other${sep}directory${sep}file'); expect(file.uri, Uri.parse('file:///${rootUri}other/directory/file')); }); testWithoutContext('file with file system scheme', () { final File file = fs.file('scheme:///only_in_foo'); expect(file.readAsStringSync(), 'Content: ${root}foo${sep}only_in_foo'); expect(file.path, '${root}foo${sep}only_in_foo'); expect(file.uri, Uri.parse('scheme:///only_in_foo')); }); testWithoutContext('file with file system scheme URI', () { final File file = fs.file(Uri.parse('scheme:///only_in_foo')); expect(file.readAsStringSync(), 'Content: ${root}foo${sep}only_in_foo'); expect(file.path, '${root}foo${sep}only_in_foo'); expect(file.uri, Uri.parse('scheme:///only_in_foo')); }); testWithoutContext('file in second root with file system scheme', () { final File file = fs.file('scheme:///only_in_bar'); expect(file.readAsStringSync(), 'Content: ${root}bar${sep}only_in_bar'); expect(file.path, '${root}bar${sep}only_in_bar'); expect(file.uri, Uri.parse('scheme:///only_in_bar')); }); testWithoutContext('file in second root with file system scheme URI', () { final File file = fs.file(Uri.parse('scheme:///only_in_bar')); expect(file.readAsStringSync(), 'Content: ${root}bar${sep}only_in_bar'); expect(file.path, '${root}bar${sep}only_in_bar'); expect(file.uri, Uri.parse('scheme:///only_in_bar')); }); testWithoutContext('file in both roots', () { final File file = fs.file(Uri.parse('scheme:///in_both')); expect(file.readAsStringSync(), 'Content: ${root}foo${sep}in_both'); expect(file.path, '${root}foo${sep}in_both'); expect(file.uri, Uri.parse('scheme:///in_both')); }); testWithoutContext('file with scheme in subdirectory', () { final File file = fs.file(Uri.parse('scheme:///subdir/in_subdir')); expect(file.readAsStringSync(), 'Content: ${root}foo${sep}subdir${sep}in_subdir'); expect(file.path, '${root}foo${sep}subdir${sep}in_subdir'); expect(file.uri, Uri.parse('scheme:///subdir/in_subdir')); }); testWithoutContext('file in second root with scheme in subdirectory', () { final File file = fs.file(Uri.parse('scheme:///bar_subdir/in_subdir')); expect(file.readAsStringSync(), 'Content: ${root}bar${sep}bar_subdir${sep}in_subdir'); expect(file.path, '${root}bar${sep}bar_subdir${sep}in_subdir'); expect(file.uri, Uri.parse('scheme:///bar_subdir/in_subdir')); }); testWithoutContext('non-existent file with scheme', () { final File file = fs.file(Uri.parse('scheme:///not_exist')); expect(file.uri, Uri.parse('scheme:///not_exist')); expect(file.path, '${root}foo${sep}not_exist'); }); testWithoutContext('stat', () async { expect((await fs.stat('${root}foo${sep}only_in_foo')).type, io.FileSystemEntityType.file); expect((await fs.stat('scheme:///only_in_foo')).type, io.FileSystemEntityType.file); expect(fs.statSync('${root}foo${sep}only_in_foo').type, io.FileSystemEntityType.file); expect(fs.statSync('scheme:///only_in_foo').type, io.FileSystemEntityType.file); }); testWithoutContext('type', () async { expect(await fs.type('${root}foo${sep}only_in_foo'), io.FileSystemEntityType.file); expect(await fs.type('scheme:///only_in_foo'), io.FileSystemEntityType.file); expect(await fs.type('${root}foo${sep}subdir'), io.FileSystemEntityType.directory); expect(await fs.type('scheme:///subdir'), io.FileSystemEntityType.directory); expect(await fs.type('${root}foo${sep}not_found'), io.FileSystemEntityType.notFound); expect(await fs.type('scheme:///not_found'), io.FileSystemEntityType.notFound); expect(fs.typeSync('${root}foo${sep}only_in_foo'), io.FileSystemEntityType.file); expect(fs.typeSync('scheme:///only_in_foo'), io.FileSystemEntityType.file); expect(fs.typeSync('${root}foo${sep}subdir'), io.FileSystemEntityType.directory); expect(fs.typeSync('scheme:///subdir'), io.FileSystemEntityType.directory); expect(fs.typeSync('${root}foo${sep}not_found'), io.FileSystemEntityType.notFound); expect(fs.typeSync('scheme:///not_found'), io.FileSystemEntityType.notFound); }); testWithoutContext('identical', () async { expect(await fs.identical('${root}foo${sep}in_both', '${root}foo${sep}in_both'), true); expect(await fs.identical('${root}foo${sep}in_both', 'scheme:///in_both'), true); expect(await fs.identical('${root}foo${sep}in_both', 'scheme:///in_both'), true); expect(await fs.identical('${root}bar${sep}in_both', 'scheme:///in_both'), false); expect(fs.identicalSync('${root}foo${sep}in_both', '${root}foo${sep}in_both'), true); expect(fs.identicalSync('${root}foo${sep}in_both', 'scheme:///in_both'), true); expect(fs.identicalSync('${root}foo${sep}in_both', 'scheme:///in_both'), true); expect(fs.identicalSync('${root}bar${sep}in_both', 'scheme:///in_both'), false); }); }
flutter/packages/flutter_tools/test/general.shard/base/multi_root_file_system_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/base/multi_root_file_system_test.dart", "repo_id": "flutter", "token_count": 3045 }
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 'dart:convert'; import 'dart:typed_data'; import 'package:convert/convert.dart'; import 'package:flutter_tools/src/build_system/hash.dart'; import '../../src/common.dart'; void main() { // Examples taken from https://en.wikipedia.org/wiki/MD5 testWithoutContext('md5 control test zero length string', () { final Md5Hash hash = Md5Hash(); expect(hex.encode(hash.finalize().buffer.asUint8List()), 'd41d8cd98f00b204e9800998ecf8427e'); }); testWithoutContext('md5 control test fox test', () { final Md5Hash hash = Md5Hash(); hash.addChunk(ascii.encode('The quick brown fox jumps over the lazy dog')); expect(hex.encode(hash.finalize().buffer.asUint8List()), '9e107d9d372bb6826bd81d3542a419d6'); }); testWithoutContext('md5 control test fox test with period', () { final Md5Hash hash = Md5Hash(); hash.addChunk(ascii.encode('The quick brown fox jumps over the lazy dog.')); expect(hex.encode(hash.finalize().buffer.asUint8List()), 'e4d909c290d0fb1ca068ffaddf22cbd0'); }); testWithoutContext('Can hash bytes less than 64 length', () { final Uint8List bytes = Uint8List.fromList(<int>[1, 2, 3, 4, 5, 6]); final Md5Hash hashA = Md5Hash(); hashA.addChunk(bytes); expect(hashA.finalize(), <int>[1810219370, 268668871, 3900423769, 1277973076]); final Md5Hash hashB = Md5Hash(); hashB.addChunk(bytes); expect(hashB.finalize(), <int>[1810219370, 268668871, 3900423769, 1277973076]); }); testWithoutContext('Can hash bytes exactly 64 length', () { final Uint8List bytes = Uint8List.fromList(List<int>.filled(64, 2)); final Md5Hash hashA = Md5Hash(); hashA.addChunk(bytes); expect(hashA.finalize(), <int>[260592333, 2557619848, 2729912077, 812879060]); final Md5Hash hashB = Md5Hash(); hashB.addChunk(bytes); expect(hashB.finalize(), <int>[260592333, 2557619848, 2729912077, 812879060]); }); testWithoutContext('Can hash bytes more than 64 length', () { final Uint8List bytes = Uint8List.fromList(List<int>.filled(514, 2)); final Md5Hash hashA = Md5Hash(); hashA.addChunk(bytes); expect(hashA.finalize(), <int>[387658779, 2003142991, 243395797, 1487291259]); final Md5Hash hashB = Md5Hash(); hashB.addChunk(bytes); expect(hashB.finalize(), <int>[387658779, 2003142991, 243395797, 1487291259]); }); }
flutter/packages/flutter_tools/test/general.shard/build_system/hash_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/build_system/hash_test.dart", "repo_id": "flutter", "token_count": 963 }
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 'package:flutter_tools/src/web/compile.dart'; import 'package:test/test.dart'; void main() { group('dart-defines and web-renderer options', () { late List<String> dartDefines; setUp(() { dartDefines = <String>[]; }); test('auto web-renderer with no dart-defines', () { dartDefines = WebRendererMode.auto.updateDartDefines(dartDefines); expect(dartDefines, <String>['FLUTTER_WEB_AUTO_DETECT=true']); }); test('canvaskit web-renderer with no dart-defines', () { dartDefines = WebRendererMode.canvaskit.updateDartDefines(dartDefines); expect(dartDefines, <String>['FLUTTER_WEB_AUTO_DETECT=false','FLUTTER_WEB_USE_SKIA=true']); }); test('html web-renderer with no dart-defines', () { dartDefines = WebRendererMode.html.updateDartDefines(dartDefines); expect(dartDefines, <String>['FLUTTER_WEB_AUTO_DETECT=false','FLUTTER_WEB_USE_SKIA=false']); }); test('auto web-renderer with existing dart-defines', () { dartDefines = <String>['FLUTTER_WEB_USE_SKIA=false']; dartDefines = WebRendererMode.auto.updateDartDefines(dartDefines); expect(dartDefines, <String>['FLUTTER_WEB_AUTO_DETECT=true']); }); test('canvaskit web-renderer with no dart-defines', () { dartDefines = <String>['FLUTTER_WEB_USE_SKIA=false']; dartDefines = WebRendererMode.canvaskit.updateDartDefines(dartDefines); expect(dartDefines, <String>['FLUTTER_WEB_AUTO_DETECT=false','FLUTTER_WEB_USE_SKIA=true']); }); test('html web-renderer with no dart-defines', () { dartDefines = <String>['FLUTTER_WEB_USE_SKIA=true']; dartDefines = WebRendererMode.html.updateDartDefines(dartDefines); expect(dartDefines, <String>['FLUTTER_WEB_AUTO_DETECT=false','FLUTTER_WEB_USE_SKIA=false']); }); }); }
flutter/packages/flutter_tools/test/general.shard/build_system/targets/web_defines_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/build_system/targets/web_defines_test.dart", "repo_id": "flutter", "token_count": 827 }
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 'package:file/file.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/build_info.dart'; import 'package:flutter_tools/src/compile.dart'; import '../src/common.dart'; void main() { testWithoutContext('StdoutHandler can produce output message', () async { final StdoutHandler stdoutHandler = StdoutHandler(logger: BufferLogger.test(), fileSystem: MemoryFileSystem.test()); stdoutHandler.handler('result 12345'); expect(stdoutHandler.boundaryKey, '12345'); stdoutHandler.handler('12345'); stdoutHandler.handler('12345 message 0'); final CompilerOutput? output = await stdoutHandler.compilerOutput?.future; expect(output?.errorCount, 0); expect(output?.outputFilename, 'message'); expect(output?.expressionData, null); }); testWithoutContext('StdoutHandler can read output bytes', () async { final FileSystem fileSystem = MemoryFileSystem.test(); final StdoutHandler stdoutHandler = StdoutHandler(logger: BufferLogger.test(), fileSystem: fileSystem); fileSystem.file('message').writeAsBytesSync(<int>[1, 2, 3 ,4]); stdoutHandler.reset(readFile: true); stdoutHandler.handler('result 12345'); expect(stdoutHandler.boundaryKey, '12345'); stdoutHandler.handler('12345'); stdoutHandler.handler('12345 message 0'); final CompilerOutput? output = await stdoutHandler.compilerOutput?.future; expect(output?.errorCount, 0); expect(output?.outputFilename, 'message'); expect(output?.expressionData, <int>[1, 2, 3, 4]); }); testWithoutContext('StdoutHandler reads output bytes if errorCount > 0', () async { final FileSystem fileSystem = MemoryFileSystem.test(); final StdoutHandler stdoutHandler = StdoutHandler(logger: BufferLogger.test(), fileSystem: fileSystem); fileSystem.file('message').writeAsBytesSync(<int>[1, 2, 3 ,4]); stdoutHandler.reset(readFile: true); stdoutHandler.handler('result 12345'); expect(stdoutHandler.boundaryKey, '12345'); stdoutHandler.handler('12345'); stdoutHandler.handler('12345 message 1'); final CompilerOutput? output = await stdoutHandler.compilerOutput?.future; expect(output?.errorCount, 1); expect(output?.outputFilename, 'message'); expect(output?.expressionData, <int>[1, 2, 3, 4]); }); testWithoutContext('TargetModel values', () { expect(TargetModel('vm'), TargetModel.vm); expect(TargetModel.vm.toString(), 'vm'); expect(TargetModel('flutter'), TargetModel.flutter); expect(TargetModel.flutter.toString(), 'flutter'); expect(TargetModel('flutter_runner'), TargetModel.flutterRunner); expect(TargetModel.flutterRunner.toString(), 'flutter_runner'); expect(TargetModel('dartdevc'), TargetModel.dartdevc); expect(TargetModel.dartdevc.toString(), 'dartdevc'); expect(() => TargetModel('foobar'), throwsException); }); testWithoutContext('toMultiRootPath maps different URIs', () async { expect(toMultiRootPath(Uri.parse('file:///a/b/c'), 'scheme', <String>['/a/b'], false), 'scheme:///c'); expect(toMultiRootPath(Uri.parse('file:///d/b/c'), 'scheme', <String>['/a/b'], false), 'file:///d/b/c'); expect(toMultiRootPath(Uri.parse('file:///a/b/c'), 'scheme', <String>['/d/b', '/a/b'], false), 'scheme:///c'); expect(toMultiRootPath(Uri.parse('file:///a/b/c'), null, <String>[], false), 'file:///a/b/c'); expect(toMultiRootPath(Uri.parse('org-dartlang-app:///a/b/c'), null, <String>[], false), 'org-dartlang-app:///a/b/c'); expect(toMultiRootPath(Uri.parse('org-dartlang-app:///a/b/c'), 'scheme', <String>['/d/b'], false), 'org-dartlang-app:///a/b/c'); }); testWithoutContext('buildModeOptions removes matching product define', () { expect(buildModeOptions(BuildMode.debug, <String>['dart.vm.product=true']), <String>[ '-Ddart.vm.profile=false', '--enable-asserts', ]); }); testWithoutContext('buildModeOptions removes matching profile define in debug mode', () { expect(buildModeOptions(BuildMode.debug, <String>['dart.vm.profile=true']), <String>[ '-Ddart.vm.product=false', '--enable-asserts', ]); }); testWithoutContext('buildModeOptions removes both matching profile and release define in debug mode', () { expect(buildModeOptions(BuildMode.debug, <String>['dart.vm.profile=true', 'dart.vm.product=true']), <String>[ '--enable-asserts', ]); }); testWithoutContext('buildModeOptions removes matching profile define in profile mode', () { expect(buildModeOptions(BuildMode.profile, <String>['dart.vm.profile=true']), <String>[ '-Ddart.vm.product=false', '--delete-tostring-package-uri=dart:ui', '--delete-tostring-package-uri=package:flutter', ]); }); testWithoutContext('buildModeOptions removes both matching profile and release define in profile mode', () { expect(buildModeOptions(BuildMode.profile, <String>['dart.vm.profile=false', 'dart.vm.product=true']), <String>[ '--delete-tostring-package-uri=dart:ui', '--delete-tostring-package-uri=package:flutter', ]); }); }
flutter/packages/flutter_tools/test/general.shard/compile_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/compile_test.dart", "repo_id": "flutter", "token_count": 1856 }
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/file.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/dart/package_map.dart'; import 'package:flutter_tools/src/flutter_manifest.dart'; import 'package:flutter_tools/src/flutter_plugins.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/plugins.dart'; import 'package:flutter_tools/src/project.dart'; import 'package:package_config/package_config.dart'; import 'package:pub_semver/pub_semver.dart'; import 'package:test/fake.dart'; import 'package:yaml/yaml.dart'; import '../src/common.dart'; import '../src/context.dart'; void main() { group('Dart plugin registrant', () { late FileSystem fs; late FakeFlutterProject flutterProject; late FakeFlutterManifest flutterManifest; setUp(() async { fs = MemoryFileSystem.test(); final Directory directory = fs.currentDirectory.childDirectory('app'); flutterManifest = FakeFlutterManifest(); flutterProject = FakeFlutterProject() ..manifest = flutterManifest ..directory = directory ..flutterPluginsFile = directory.childFile('.flutter-plugins') ..flutterPluginsDependenciesFile = directory.childFile('.flutter-plugins-dependencies') ..dartPluginRegistrant = directory.childFile('dart_plugin_registrant.dart'); flutterProject.directory.childFile('.packages').createSync(recursive: true); }); group('resolvePlatformImplementation', () { testWithoutContext('selects uncontested implementation from direct dependency', () async { final Set<String> directDependencies = <String>{ 'url_launcher_linux', 'url_launcher_macos', }; final List<PluginInterfaceResolution> resolutions = resolvePlatformImplementation(<Plugin>[ Plugin.fromYaml( 'url_launcher_linux', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginLinux', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), Plugin.fromYaml( 'url_launcher_macos', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'macos': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginMacOS', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), ]); expect(resolutions.length, equals(2)); expect(resolutions[0].toMap(), equals( <String, String>{ 'pluginName': 'url_launcher_linux', 'dartClass': 'UrlLauncherPluginLinux', 'platform': 'linux', }) ); expect(resolutions[1].toMap(), equals( <String, String>{ 'pluginName': 'url_launcher_macos', 'dartClass': 'UrlLauncherPluginMacOS', 'platform': 'macos', }) ); }); testWithoutContext( 'selects uncontested implementation from direct dependency with additional native implementation', () async { final Set<String> directDependencies = <String>{ 'url_launcher_linux', 'url_launcher_macos', }; final List<PluginInterfaceResolution> resolutions = resolvePlatformImplementation( <Plugin>[ // Following plugin is native only and is not resolved as a dart plugin: Plugin.fromYaml( 'url_launcher_linux', '', YamlMap.wrap(<String, dynamic>{ 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'package': 'com.example.url_launcher', 'pluginClass': 'UrlLauncherPluginLinux', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), Plugin.fromYaml( 'url_launcher_macos', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'macos': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginMacOS', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), ], ); expect(resolutions.length, equals(1)); expect( resolutions[0].toMap(), equals(<String, String>{ 'pluginName': 'url_launcher_macos', 'dartClass': 'UrlLauncherPluginMacOS', 'platform': 'macos', })); }); testWithoutContext('selects uncontested implementation from transitive dependency', () async { final Set<String> directDependencies = <String>{ 'url_launcher_macos', }; final List<PluginInterfaceResolution> resolutions = resolvePlatformImplementation(<Plugin>[ Plugin.fromYaml( 'url_launcher_macos', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'macos': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginMacOS', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), Plugin.fromYaml( 'transitive_dependency_plugin', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'windows': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginWindows', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), ]); expect(resolutions.length, equals(2)); expect(resolutions[0].toMap(), equals( <String, String>{ 'pluginName': 'url_launcher_macos', 'dartClass': 'UrlLauncherPluginMacOS', 'platform': 'macos', }) ); expect(resolutions[1].toMap(), equals( <String, String>{ 'pluginName': 'transitive_dependency_plugin', 'dartClass': 'UrlLauncherPluginWindows', 'platform': 'windows', }) ); }); testWithoutContext('selects inline implementation on mobile', () async { final Set<String> directDependencies = <String>{}; final List<PluginInterfaceResolution> resolutions = resolvePlatformImplementation(<Plugin>[ Plugin.fromYaml( 'url_launcher', '', YamlMap.wrap(<String, dynamic>{ 'platforms': <String, dynamic>{ 'android': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherAndroid', }, 'ios': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherIos', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), ]); expect(resolutions.length, equals(2)); expect(resolutions[0].toMap(), equals( <String, String>{ 'pluginName': 'url_launcher', 'dartClass': 'UrlLauncherAndroid', 'platform': 'android', }) ); expect(resolutions[1].toMap(), equals( <String, String>{ 'pluginName': 'url_launcher', 'dartClass': 'UrlLauncherIos', 'platform': 'ios', }) ); }); // See https://github.com/flutter/flutter/issues/87862 for details. testWithoutContext('does not select inline implementation on desktop for ' 'missing min Flutter SDK constraint', () async { final Set<String> directDependencies = <String>{}; final List<PluginInterfaceResolution> resolutions = resolvePlatformImplementation(<Plugin>[ Plugin.fromYaml( 'url_launcher', '', YamlMap.wrap(<String, dynamic>{ 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherLinux', }, 'macos': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherMacOS', }, 'windows': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherWindows', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), ]); expect(resolutions.length, equals(0)); }); // See https://github.com/flutter/flutter/issues/87862 for details. testWithoutContext('does not select inline implementation on desktop for ' 'min Flutter SDK constraint < 2.11', () async { final Set<String> directDependencies = <String>{}; final List<PluginInterfaceResolution> resolutions = resolvePlatformImplementation(<Plugin>[ Plugin.fromYaml( 'url_launcher', '', YamlMap.wrap(<String, dynamic>{ 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherLinux', }, 'macos': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherMacOS', }, 'windows': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherWindows', }, }, }), VersionConstraint.parse('>=2.10.0'), <String>[], fileSystem: fs, appDependencies: directDependencies, ), ]); expect(resolutions.length, equals(0)); }); testWithoutContext('selects inline implementation on desktop for ' 'min Flutter SDK requirement of at least 2.11', () async { final Set<String> directDependencies = <String>{}; final List<PluginInterfaceResolution> resolutions = resolvePlatformImplementation(<Plugin>[ Plugin.fromYaml( 'url_launcher', '', YamlMap.wrap(<String, dynamic>{ 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherLinux', }, 'macos': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherMacOS', }, 'windows': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherWindows', }, }, }), VersionConstraint.parse('>=2.11.0'), <String>[], fileSystem: fs, appDependencies: directDependencies, ), ]); expect(resolutions.length, equals(3)); expect( resolutions.map((PluginInterfaceResolution resolution) => resolution.toMap()), containsAll(<Map<String, String>>[ <String, String>{ 'pluginName': 'url_launcher', 'dartClass': 'UrlLauncherLinux', 'platform': 'linux', }, <String, String>{ 'pluginName': 'url_launcher', 'dartClass': 'UrlLauncherMacOS', 'platform': 'macos', }, <String, String>{ 'pluginName': 'url_launcher', 'dartClass': 'UrlLauncherWindows', 'platform': 'windows', }, ]) ); }); testWithoutContext('selects default implementation', () async { final Set<String> directDependencies = <String>{}; final List<PluginInterfaceResolution> resolutions = resolvePlatformImplementation(<Plugin>[ Plugin.fromYaml( 'url_launcher', '', YamlMap.wrap(<String, dynamic>{ 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'default_package': 'url_launcher_linux', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), // Include three possible implementations, one before and one after // to ensure that the selection is working as intended, not just by // coincidence of order. Plugin.fromYaml( 'another_url_launcher_linux', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'dartPluginClass': 'UnofficialUrlLauncherPluginLinux', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), Plugin.fromYaml( 'url_launcher_linux', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginLinux', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), Plugin.fromYaml( 'yet_another_url_launcher_linux', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'dartPluginClass': 'UnofficialUrlLauncherPluginLinux2', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), ]); expect(resolutions.length, equals(1)); expect(resolutions[0].toMap(), equals( <String, String>{ 'pluginName': 'url_launcher_linux', 'dartClass': 'UrlLauncherPluginLinux', 'platform': 'linux', }) ); }); testWithoutContext('selects default implementation if interface is direct dependency', () async { final Set<String> directDependencies = <String>{'url_launcher'}; final List<PluginInterfaceResolution> resolutions = resolvePlatformImplementation(<Plugin>[ Plugin.fromYaml( 'url_launcher', '', YamlMap.wrap(<String, dynamic>{ 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'default_package': 'url_launcher_linux', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), Plugin.fromYaml( 'url_launcher_linux', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginLinux', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), ]); expect(resolutions.length, equals(1)); expect(resolutions[0].toMap(), equals( <String, String>{ 'pluginName': 'url_launcher_linux', 'dartClass': 'UrlLauncherPluginLinux', 'platform': 'linux', }) ); }); testWithoutContext('selects user selected implementation despite default implementation', () async { final Set<String> directDependencies = <String>{ 'user_selected_url_launcher_implementation', 'url_launcher', }; final List<PluginInterfaceResolution> resolutions = resolvePlatformImplementation(<Plugin>[ Plugin.fromYaml( 'url_launcher', '', YamlMap.wrap(<String, dynamic>{ 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'default_package': 'url_launcher_linux', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), Plugin.fromYaml( 'url_launcher_linux', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginLinux', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), Plugin.fromYaml( 'user_selected_url_launcher_implementation', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginLinux', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), ]); expect(resolutions.length, equals(1)); expect(resolutions[0].toMap(), equals( <String, String>{ 'pluginName': 'user_selected_url_launcher_implementation', 'dartClass': 'UrlLauncherPluginLinux', 'platform': 'linux', }) ); }); testUsingContext('provides error when user selected multiple implementations', () async { final Set<String> directDependencies = <String>{ 'url_launcher_linux_1', 'url_launcher_linux_2', }; expect(() { resolvePlatformImplementation(<Plugin>[ Plugin.fromYaml( 'url_launcher_linux_1', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginLinux', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), Plugin.fromYaml( 'url_launcher_linux_2', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginLinux', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), ]); }, throwsToolExit( message: 'Please resolve the plugin implementation selection errors', )); expect( testLogger.errorText, 'Plugin url_launcher:linux has conflicting direct dependency implementations:\n' ' url_launcher_linux_1\n' ' url_launcher_linux_2\n' 'To fix this issue, remove all but one of these dependencies from pubspec.yaml.' '\n\n' ); }); testUsingContext('provides all errors when user selected multiple implementations', () async { final Set<String> directDependencies = <String>{ 'url_launcher_linux_1', 'url_launcher_linux_2', 'url_launcher_windows_1', 'url_launcher_windows_2', }; expect(() { resolvePlatformImplementation(<Plugin>[ Plugin.fromYaml( 'url_launcher_linux_1', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginLinux', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), Plugin.fromYaml( 'url_launcher_linux_2', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginLinux', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), Plugin.fromYaml( 'url_launcher_windows_1', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'windows': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginWindows1', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), Plugin.fromYaml( 'url_launcher_windows_2', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'windows': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginWindows2', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), ]); }, throwsToolExit( message: 'Please resolve the plugin implementation selection errors', )); expect( testLogger.errorText, 'Plugin url_launcher:linux has conflicting direct dependency implementations:\n' ' url_launcher_linux_1\n' ' url_launcher_linux_2\n' 'To fix this issue, remove all but one of these dependencies from pubspec.yaml.' '\n\n' 'Plugin url_launcher:windows has conflicting direct dependency implementations:\n' ' url_launcher_windows_1\n' ' url_launcher_windows_2\n' 'To fix this issue, remove all but one of these dependencies from pubspec.yaml.' '\n\n' ); }); testUsingContext('provides error when user needs to select among multiple implementations', () async { final Set<String> directDependencies = <String>{}; expect(() { resolvePlatformImplementation(<Plugin>[ Plugin.fromYaml( 'url_launcher_linux_1', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginLinux1', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), Plugin.fromYaml( 'url_launcher_linux_2', '', YamlMap.wrap(<String, dynamic>{ 'implements': 'url_launcher', 'platforms': <String, dynamic>{ 'linux': <String, dynamic>{ 'dartPluginClass': 'UrlLauncherPluginLinux2', }, }, }), null, <String>[], fileSystem: fs, appDependencies: directDependencies, ), ]); }, throwsToolExit( message: 'Please resolve the plugin implementation selection errors', )); expect( testLogger.errorText, 'Plugin url_launcher:linux has multiple possible implementations:\n' ' url_launcher_linux_1\n' ' url_launcher_linux_2\n' 'To fix this issue, add one of these dependencies to pubspec.yaml.' '\n\n' ); }); }); group('generateMainDartWithPluginRegistrant', () { testUsingContext('Generates new entrypoint', () async { flutterProject.isModule = true; createFakeDartPlugins( flutterProject, flutterManifest, fs, <String, String>{ 'url_launcher_android': ''' flutter: plugin: implements: url_launcher platforms: android: dartPluginClass: AndroidPlugin ''', 'url_launcher_ios': ''' flutter: plugin: implements: url_launcher platforms: ios: dartPluginClass: IosPlugin ''', 'url_launcher_macos': ''' flutter: plugin: implements: url_launcher platforms: macos: dartPluginClass: MacOSPlugin ''', 'url_launcher_linux': ''' flutter: plugin: implements: url_launcher platforms: linux: dartPluginClass: LinuxPlugin ''', 'url_launcher_windows': ''' flutter: plugin: implements: url_launcher platforms: windows: dartPluginClass: WindowsPlugin ''', 'awesome_macos': ''' flutter: plugin: implements: awesome platforms: macos: dartPluginClass: AwesomeMacOS ''', }); final Directory libDir = flutterProject.directory.childDirectory('lib'); libDir.createSync(recursive: true); final File mainFile = libDir.childFile('main.dart'); mainFile.writeAsStringSync(''' // @dart = 2.8 void main() { } '''); final PackageConfig packageConfig = await loadPackageConfigWithLogging( flutterProject.directory.childDirectory('.dart_tool').childFile('package_config.json'), logger: globals.logger, throwOnError: false, ); await generateMainDartWithPluginRegistrant( flutterProject, packageConfig, 'package:app/main.dart', mainFile, ); expect(flutterProject.dartPluginRegistrant.readAsStringSync(), '//\n' '// Generated file. Do not edit.\n' '// This file is generated from template in file `flutter_tools/lib/src/flutter_plugins.dart`.\n' '//\n' '\n' '// @dart = 2.8\n' '\n' "import 'dart:io'; // flutter_ignore: dart_io_import.\n" "import 'package:url_launcher_android/url_launcher_android.dart';\n" "import 'package:url_launcher_ios/url_launcher_ios.dart';\n" "import 'package:url_launcher_linux/url_launcher_linux.dart';\n" "import 'package:awesome_macos/awesome_macos.dart';\n" "import 'package:url_launcher_macos/url_launcher_macos.dart';\n" "import 'package:url_launcher_windows/url_launcher_windows.dart';\n" '\n' "@pragma('vm:entry-point')\n" 'class _PluginRegistrant {\n' '\n' " @pragma('vm:entry-point')\n" ' static void register() {\n' ' if (Platform.isAndroid) {\n' ' try {\n' ' AndroidPlugin.registerWith();\n' ' } catch (err) {\n' ' print(\n' " '`url_launcher_android` threw an error: \$err. '\n" " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n" ' );\n' ' }\n' '\n' ' } else if (Platform.isIOS) {\n' ' try {\n' ' IosPlugin.registerWith();\n' ' } catch (err) {\n' ' print(\n' " '`url_launcher_ios` threw an error: \$err. '\n" " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n" ' );\n' ' }\n' '\n' ' } else if (Platform.isLinux) {\n' ' try {\n' ' LinuxPlugin.registerWith();\n' ' } catch (err) {\n' ' print(\n' " '`url_launcher_linux` threw an error: \$err. '\n" " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n" ' );\n' ' }\n' '\n' ' } else if (Platform.isMacOS) {\n' ' try {\n' ' AwesomeMacOS.registerWith();\n' ' } catch (err) {\n' ' print(\n' " '`awesome_macos` threw an error: \$err. '\n" " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n" ' );\n' ' }\n' '\n' ' try {\n' ' MacOSPlugin.registerWith();\n' ' } catch (err) {\n' ' print(\n' " '`url_launcher_macos` threw an error: \$err. '\n" " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n" ' );\n' ' }\n' '\n' ' } else if (Platform.isWindows) {\n' ' try {\n' ' WindowsPlugin.registerWith();\n' ' } catch (err) {\n' ' print(\n' " '`url_launcher_windows` threw an error: \$err. '\n" " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n" ' );\n' ' }\n' '\n' ' }\n' ' }\n' '}\n' ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('Plugin without platform support throws tool exit', () async { flutterProject.isModule = false; createFakeDartPlugins( flutterProject, flutterManifest, fs, <String, String>{ 'url_launcher_macos': ''' flutter: plugin: implements: url_launcher platforms: macos: invalid: ''', }); final Directory libDir = flutterProject.directory.childDirectory('lib'); libDir.createSync(recursive: true); final File mainFile = libDir.childFile('main.dart')..writeAsStringSync(''); final PackageConfig packageConfig = await loadPackageConfigWithLogging( flutterProject.directory.childDirectory('.dart_tool').childFile('package_config.json'), logger: globals.logger, throwOnError: false, ); await expectLater( generateMainDartWithPluginRegistrant( flutterProject, packageConfig, 'package:app/main.dart', mainFile, ), throwsToolExit(message: 'Invalid plugin specification url_launcher_macos.\n' 'Invalid "macos" plugin specification.' ), ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('Plugin with platform support without dart plugin class throws tool exit', () async { flutterProject.isModule = false; createFakeDartPlugins( flutterProject, flutterManifest, fs, <String, String>{ 'url_launcher_macos': ''' flutter: plugin: implements: url_launcher ''', }); final Directory libDir = flutterProject.directory.childDirectory('lib'); libDir.createSync(recursive: true); final File mainFile = libDir.childFile('main.dart')..writeAsStringSync(''); final PackageConfig packageConfig = await loadPackageConfigWithLogging( flutterProject.directory.childDirectory('.dart_tool').childFile('package_config.json'), logger: globals.logger, throwOnError: false, ); await expectLater( generateMainDartWithPluginRegistrant( flutterProject, packageConfig, 'package:app/main.dart', mainFile, ), throwsToolExit(message: 'Invalid plugin specification url_launcher_macos.\n' 'Cannot find the `flutter.plugin.platforms` key in the `pubspec.yaml` file. ' 'An instruction to format the `pubspec.yaml` can be found here: ' 'https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin-platforms' ), ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('Does not create new entrypoint if there are no platform resolutions', () async { flutterProject.isModule = false; final Directory libDir = flutterProject.directory.childDirectory('lib'); libDir.createSync(recursive: true); final File mainFile = libDir.childFile('main.dart')..writeAsStringSync(''); final PackageConfig packageConfig = await loadPackageConfigWithLogging( flutterProject.directory.childDirectory('.dart_tool').childFile('package_config.json'), logger: globals.logger, throwOnError: false, ); await generateMainDartWithPluginRegistrant( flutterProject, packageConfig, 'package:app/main.dart', mainFile, ); expect(flutterProject.dartPluginRegistrant.existsSync(), isFalse); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('Deletes new entrypoint if there are no platform resolutions', () async { flutterProject.isModule = false; createFakeDartPlugins( flutterProject, flutterManifest, fs, <String, String>{ 'url_launcher_macos': ''' flutter: plugin: implements: url_launcher platforms: macos: dartPluginClass: MacOSPlugin ''', }); final Directory libDir = flutterProject.directory.childDirectory('lib'); libDir.createSync(recursive: true); final File mainFile = libDir.childFile('main.dart')..writeAsStringSync(''); final PackageConfig packageConfig = await loadPackageConfigWithLogging( flutterProject.directory.childDirectory('.dart_tool').childFile('package_config.json'), logger: globals.logger, throwOnError: false, ); await generateMainDartWithPluginRegistrant( flutterProject, packageConfig, 'package:app/main.dart', mainFile, ); expect(flutterProject.dartPluginRegistrant.existsSync(), isTrue); // No plugins. createFakeDartPlugins( flutterProject, flutterManifest, fs, <String, String>{}); await generateMainDartWithPluginRegistrant( flutterProject, packageConfig, 'package:app/main.dart', mainFile, ); expect(flutterProject.dartPluginRegistrant.existsSync(), isFalse); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); }); }); } void createFakeDartPlugins( FakeFlutterProject flutterProject, FakeFlutterManifest flutterManifest, FileSystem fs, Map<String, String> plugins, ) { final Directory fakePubCache = fs.systemTempDirectory.childDirectory('cache'); final File packagesFile = flutterProject.directory .childFile('.packages'); if (packagesFile.existsSync()) { packagesFile.deleteSync(); } packagesFile.createSync(recursive: true); for (final MapEntry<String, String> entry in plugins.entries) { final String name = fs.path.basename(entry.key); final Directory pluginDirectory = fakePubCache.childDirectory(name); packagesFile.writeAsStringSync( '$name:file://${pluginDirectory.childFile('lib').uri}\n', mode: FileMode.writeOnlyAppend, ); pluginDirectory.childFile('pubspec.yaml') ..createSync(recursive: true) ..writeAsStringSync(entry.value); } flutterManifest.dependencies = plugins.keys.toSet(); } class FakeFlutterManifest extends Fake implements FlutterManifest { @override Set<String> dependencies = <String>{}; } class FakeFlutterProject extends Fake implements FlutterProject { @override bool isModule = false; @override late FlutterManifest manifest; @override late Directory directory; @override late File flutterPluginsFile; @override late File flutterPluginsDependenciesFile; @override late File dartPluginRegistrant; @override late IosProject ios; @override late AndroidProject android; @override late WebProject web; @override late MacOSProject macos; @override late LinuxProject linux; @override late WindowsProject windows; }
flutter/packages/flutter_tools/test/general.shard/dart_plugin_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/dart_plugin_test.dart", "repo_id": "flutter", "token_count": 19847 }
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 'dart:async'; import 'package:dds/dds.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/io.dart'; import 'package:flutter_tools/src/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:flutter_tools/src/test/flutter_tester_device.dart'; import 'package:flutter_tools/src/test/font_config_manager.dart'; import 'package:flutter_tools/src/vmservice.dart'; import 'package:stream_channel/stream_channel.dart'; import 'package:test/fake.dart'; import '../src/context.dart'; import '../src/fake_process_manager.dart'; import '../src/fake_vm_services.dart'; void main() { late FakePlatform platform; late FileSystem fileSystem; late FakeProcessManager processManager; late FlutterTesterTestDevice device; setUp(() { fileSystem = MemoryFileSystem.test(); // Not Windows. platform = FakePlatform( environment: <String, String>{}, ); processManager = FakeProcessManager.any(); }); FlutterTesterTestDevice createDevice({ List<String> dartEntrypointArgs = const <String>[], bool enableVmService = false, bool enableImpeller = false, }) => TestFlutterTesterDevice( platform: platform, fileSystem: fileSystem, processManager: processManager, enableVmService: enableVmService, dartEntrypointArgs: dartEntrypointArgs, uriConverter: (String input) => '$input/converted', enableImpeller: enableImpeller, ); testUsingContext('Missing dir error caught for FontConfigManger.dispose', () async { final FontConfigManager fontConfigManager = FontConfigManager(); final Directory fontsDirectory = fileSystem.file(fontConfigManager.fontConfigFile).parent; fontsDirectory.deleteSync(recursive: true); await fontConfigManager.dispose(); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('Flutter tester passes through impeller config and environment variables.', () async { processManager = FakeProcessManager.list(<FakeCommand>[]); device = createDevice(enableImpeller: true); processManager.addCommand(FakeCommand(command: const <String>[ '/', '--disable-vm-service', '--ipv6', '--enable-checked-mode', '--verify-entry-points', '--enable-impeller', '--enable-dart-profiling', '--non-interactive', '--use-test-fonts', '--disable-asset-fonts', '--packages=.dart_tool/package_config.json', 'example.dill', ], environment: <String, String>{ 'FLUTTER_TEST': 'true', 'FONTCONFIG_FILE': device.fontConfigManager.fontConfigFile.path, 'SERVER_PORT': '0', 'APP_NAME': '', 'FLUTTER_TEST_IMPELLER': 'true', })); await device.start('example.dill'); expect(processManager, hasNoRemainingExpectations); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); group('The FLUTTER_TEST environment variable is passed to the test process', () { setUp(() { processManager = FakeProcessManager.list(<FakeCommand>[]); device = createDevice(); fileSystem .file('.dart_tool/package_config.json') ..createSync(recursive: true) ..writeAsStringSync('{"configVersion":2,"packages":[]}'); }); FakeCommand flutterTestCommand(String expectedFlutterTestValue) { return FakeCommand(command: const <String>[ '/', '--disable-vm-service', '--ipv6', '--enable-checked-mode', '--verify-entry-points', '--enable-software-rendering', '--skia-deterministic-rendering', '--enable-dart-profiling', '--non-interactive', '--use-test-fonts', '--disable-asset-fonts', '--packages=.dart_tool/package_config.json', 'example.dill', ], environment: <String, String>{ 'FLUTTER_TEST': expectedFlutterTestValue, 'FONTCONFIG_FILE': device.fontConfigManager.fontConfigFile.path, 'SERVER_PORT': '0', 'APP_NAME': '', }); } testUsingContext('as true when not originally set', () async { processManager.addCommand(flutterTestCommand('true')); await device.start('example.dill'); expect(processManager, hasNoRemainingExpectations); }); testUsingContext('as true when set to true', () async { platform.environment = <String, String>{'FLUTTER_TEST': 'true'}; processManager.addCommand(flutterTestCommand('true')); await device.start('example.dill'); expect(processManager, hasNoRemainingExpectations); }); testUsingContext('as false when set to false', () async { platform.environment = <String, String>{'FLUTTER_TEST': 'false'}; processManager.addCommand(flutterTestCommand('false')); await device.start('example.dill'); expect(processManager, hasNoRemainingExpectations); }); testUsingContext('unchanged when set', () async { platform.environment = <String, String>{'FLUTTER_TEST': 'neither true nor false'}; processManager.addCommand(flutterTestCommand('neither true nor false')); await device.start('example.dill'); expect(processManager, hasNoRemainingExpectations); }); }); group('Dart Entrypoint Args', () { setUp(() { processManager = FakeProcessManager.list(<FakeCommand>[ const FakeCommand( command: <String>[ '/', '--disable-vm-service', '--ipv6', '--enable-checked-mode', '--verify-entry-points', '--enable-software-rendering', '--skia-deterministic-rendering', '--enable-dart-profiling', '--non-interactive', '--use-test-fonts', '--disable-asset-fonts', '--packages=.dart_tool/package_config.json', '--foo', '--bar', 'example.dill', ], stdout: 'success', stderr: 'failure', ), ]); device = createDevice(dartEntrypointArgs: <String>['--foo', '--bar']); }); testUsingContext('Can pass additional arguments to tester binary', () async { await device.start('example.dill'); expect(processManager, hasNoRemainingExpectations); }); }); group('DDS', () { setUp(() { processManager = FakeProcessManager.list(<FakeCommand>[ const FakeCommand( command: <String>[ '/', '--vm-service-port=0', '--ipv6', '--enable-checked-mode', '--verify-entry-points', '--enable-software-rendering', '--skia-deterministic-rendering', '--enable-dart-profiling', '--non-interactive', '--use-test-fonts', '--disable-asset-fonts', '--packages=.dart_tool/package_config.json', 'example.dill', ], stdout: 'The Dart VM service is listening on http://localhost:1234', stderr: 'failure', ), ]); device = createDevice(enableVmService: true); }); testUsingContext('skips setting VM Service port and uses the input port for DDS instead', () async { await device.start('example.dill'); await device.vmServiceUri; final Uri uri = await (device as TestFlutterTesterDevice).ddsServiceUriFuture(); expect(uri.port, 1234); }); testUsingContext('sets up UriConverter from context', () async { await device.start('example.dill'); await device.vmServiceUri; final FakeDartDevelopmentService dds = (device as TestFlutterTesterDevice).dds as FakeDartDevelopmentService; final String? result = dds .uriConverter ?.call('test'); expect(result, 'test/converted'); }); }); } /// A Flutter Tester device. /// /// Uses a mock HttpServer. We don't want to bind random ports in our CI hosts. class TestFlutterTesterDevice extends FlutterTesterTestDevice { TestFlutterTesterDevice({ required super.platform, required super.fileSystem, required super.processManager, required super.enableVmService, required List<String> dartEntrypointArgs, required UriConverter uriConverter, required bool enableImpeller, }) : super( id: 999, shellPath: '/', logger: BufferLogger.test(), debuggingOptions: DebuggingOptions.enabled( const BuildInfo( BuildMode.debug, '', treeShakeIcons: false, ), hostVmServicePort: 1234, dartEntrypointArgs: dartEntrypointArgs, enableImpeller: enableImpeller ? ImpellerStatus.enabled : ImpellerStatus.platformDefault, ), machine: false, host: InternetAddress.loopbackIPv6, testAssetDirectory: null, flutterProject: null, icudtlPath: null, compileExpression: null, fontConfigManager: FontConfigManager(), uriConverter: uriConverter, ); late DartDevelopmentService dds; final Completer<Uri> _ddsServiceUriCompleter = Completer<Uri>(); Future<Uri> ddsServiceUriFuture() => _ddsServiceUriCompleter.future; @override Future<DartDevelopmentService> startDds( Uri uri, { UriConverter? uriConverter, }) async { _ddsServiceUriCompleter.complete(uri); dds = FakeDartDevelopmentService( Uri.parse('http://localhost:${debuggingOptions.hostVmServicePort}'), Uri.parse('http://localhost:8080'), uriConverter: uriConverter, ); return dds; } @override Future<FlutterVmService> connectToVmServiceImpl( Uri httpUri, { CompileExpression? compileExpression, required Logger logger, }) async { return FakeVmServiceHost(requests: <VmServiceExpectation>[ const FakeVmServiceRequest(method: '_serveObservatory'), ]).vmService; } @override Future<HttpServer> bind(InternetAddress? host, int port) async => FakeHttpServer(); @override Future<StreamChannel<String>> get remoteChannel async => StreamChannelController<String>().foreign; } class FakeDartDevelopmentService extends Fake implements DartDevelopmentService { FakeDartDevelopmentService(this.uri, this.original, {this.uriConverter}); final Uri original; final UriConverter? uriConverter; @override final Uri uri; @override Uri get remoteVmServiceUri => original; } class FakeHttpServer extends Fake implements HttpServer { @override int get port => 0; }
flutter/packages/flutter_tools/test/general.shard/flutter_tester_device_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/flutter_tester_device_test.dart", "repo_id": "flutter", "token_count": 4263 }
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/memory.dart'; import 'package:file_testing/file_testing.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/io.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/version.dart'; import 'package:flutter_tools/src/ios/core_devices.dart'; import 'package:flutter_tools/src/ios/xcodeproj.dart'; import 'package:flutter_tools/src/macos/xcode.dart'; import '../../src/common.dart'; import '../../src/fake_process_manager.dart'; void main() { late MemoryFileSystem fileSystem; setUp(() { fileSystem = MemoryFileSystem.test(); }); group('Xcode prior to Core Device Control/Xcode 15', () { late BufferLogger logger; late FakeProcessManager fakeProcessManager; late Xcode xcode; late IOSCoreDeviceControl deviceControl; setUp(() { logger = BufferLogger.test(); fakeProcessManager = FakeProcessManager.empty(); final XcodeProjectInterpreter xcodeProjectInterpreter = XcodeProjectInterpreter.test( processManager: fakeProcessManager, version: Version(14, 0, 0), ); xcode = Xcode.test( processManager: fakeProcessManager, xcodeProjectInterpreter: xcodeProjectInterpreter, ); deviceControl = IOSCoreDeviceControl( logger: logger, processManager: fakeProcessManager, xcode: xcode, fileSystem: fileSystem, ); }); group('devicectl is not installed', () { testWithoutContext('fails to get device list', () async { final List<IOSCoreDevice> devices = await deviceControl.getCoreDevices(); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('devicectl is not installed.')); expect(devices.isEmpty, isTrue); }); testWithoutContext('fails to install app', () async { final bool status = await deviceControl.installApp(deviceId: 'device-id', bundlePath: '/path/to/bundle'); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('devicectl is not installed.')); expect(status, isFalse); }); testWithoutContext('fails to launch app', () async { final bool status = await deviceControl.launchApp(deviceId: 'device-id', bundleId: 'com.example.flutterApp'); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('devicectl is not installed.')); expect(status, isFalse); }); testWithoutContext('fails to check if app is installed', () async { final bool status = await deviceControl.isAppInstalled(deviceId: 'device-id', bundleId: 'com.example.flutterApp'); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('devicectl is not installed.')); expect(status, isFalse); }); }); }); group('Core Device Control', () { late BufferLogger logger; late FakeProcessManager fakeProcessManager; late Xcode xcode; late IOSCoreDeviceControl deviceControl; setUp(() { logger = BufferLogger.test(); fakeProcessManager = FakeProcessManager.empty(); // TODO(fujino): re-use fakeProcessManager xcode = Xcode.test(processManager: FakeProcessManager.any()); deviceControl = IOSCoreDeviceControl( logger: logger, processManager: fakeProcessManager, xcode: xcode, fileSystem: fileSystem, ); }); group('install app', () { const String deviceId = 'device-id'; const String bundlePath = '/path/to/com.example.flutterApp'; testWithoutContext('Successful install', () async { const String deviceControlOutput = ''' { "info" : { "arguments" : [ "devicectl", "device", "install", "app", "--device", "00001234-0001234A3C03401E", "build/ios/iphoneos/Runner.app", "--json-output", "/var/folders/wq/randompath/T/flutter_tools.rand0/core_devices.rand0/install_results.json" ], "commandType" : "devicectl.device.install.app", "environment" : { }, "outcome" : "success", "version" : "341" }, "result" : { "deviceIdentifier" : "123456BB5-AEDE-7A22-B890-1234567890DD", "installedApplications" : [ { "bundleID" : "com.example.bundle", "databaseSequenceNumber" : 1230, "databaseUUID" : "1234A567-D890-1B23-BCF4-D5D67A8D901E", "installationURL" : "file:///private/var/containers/Bundle/Application/12345E6A-7F89-0C12-345E-F6A7E890CFF1/Runner.app/", "launchServicesIdentifier" : "unknown", "options" : { } } ] } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('install_results.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'install', 'app', '--device', deviceId, bundlePath, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final bool status = await deviceControl.installApp( deviceId: deviceId, bundlePath: bundlePath, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, isEmpty); expect(tempFile, isNot(exists)); expect(status, true); }); testWithoutContext('devicectl fails install', () async { const String deviceControlOutput = ''' { "error" : { "code" : 1005, "domain" : "com.apple.dt.CoreDeviceError", "userInfo" : { "NSLocalizedDescription" : { "string" : "Could not obtain access to one or more requested file system resources because CoreDevice was unable to create bookmark data." }, "NSUnderlyingError" : { "error" : { "code" : 260, "domain" : "NSCocoaErrorDomain", "userInfo" : { } } } } }, "info" : { "arguments" : [ "devicectl", "device", "install", "app", "--device", "00001234-0001234A3C03401E", "/path/to/app", "--json-output", "/var/folders/wq/randompath/T/flutter_tools.rand0/core_devices.rand0/install_results.json" ], "commandType" : "devicectl.device.install.app", "environment" : { "TERM" : "xterm-256color" }, "outcome" : "failed", "version" : "341" } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('install_results.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'install', 'app', '--device', deviceId, bundlePath, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, exitCode: 1, stderr: ''' ERROR: Could not obtain access to one or more requested file system resources because CoreDevice was unable to create bookmark data. (com.apple.dt.CoreDeviceError error 1005.) NSURL = file:///path/to/app -------------------------------------------------------------------------------- ERROR: The file couldn’t be opened because it doesn’t exist. (NSCocoaErrorDomain error 260.) ''' )); final bool status = await deviceControl.installApp( deviceId: deviceId, bundlePath: bundlePath, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('ERROR: Could not obtain access to one or more requested file system')); expect(tempFile, isNot(exists)); expect(status, false); }); testWithoutContext('fails install because of unexpected JSON', () async { const String deviceControlOutput = ''' { "valid_unexpected_json": true } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('install_results.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'install', 'app', '--device', deviceId, bundlePath, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final bool status = await deviceControl.installApp( deviceId: deviceId, bundlePath: bundlePath, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('devicectl returned unexpected JSON response')); expect(tempFile, isNot(exists)); expect(status, false); }); testWithoutContext('fails install because of invalid JSON', () async { const String deviceControlOutput = ''' invalid JSON '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('install_results.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'install', 'app', '--device', deviceId, bundlePath, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final bool status = await deviceControl.installApp( deviceId: deviceId, bundlePath: bundlePath, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('devicectl returned non-JSON response')); expect(tempFile, isNot(exists)); expect(status, false); }); }); group('uninstall app', () { const String deviceId = 'device-id'; const String bundleId = 'com.example.flutterApp'; testWithoutContext('Successful uninstall', () async { const String deviceControlOutput = ''' { "info" : { "arguments" : [ "devicectl", "device", "uninstall", "app", "--device", "00001234-0001234A3C03401E", "build/ios/iphoneos/Runner.app", "--json-output", "/var/folders/wq/randompath/T/flutter_tools.rand0/core_devices.rand0/uninstall_results.json" ], "commandType" : "devicectl.device.uninstall.app", "environment" : { }, "outcome" : "success", "version" : "341" }, "result" : { "deviceIdentifier" : "123456BB5-AEDE-7A22-B890-1234567890DD", "uninstalledApplications" : [ { "bundleID" : "com.example.bundle" } ] } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('uninstall_results.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'uninstall', 'app', '--device', deviceId, bundleId, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final bool status = await deviceControl.uninstallApp( deviceId: deviceId, bundleId: bundleId, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, isEmpty); expect(tempFile, isNot(exists)); expect(status, true); }); testWithoutContext('devicectl fails uninstall', () async { const String deviceControlOutput = ''' { "error" : { "code" : 1005, "domain" : "com.apple.dt.CoreDeviceError", "userInfo" : { "NSLocalizedDescription" : { "string" : "Could not obtain access to one or more requested file system resources because CoreDevice was unable to create bookmark data." }, "NSUnderlyingError" : { "error" : { "code" : 260, "domain" : "NSCocoaErrorDomain", "userInfo" : { } } } } }, "info" : { "arguments" : [ "devicectl", "device", "uninstall", "app", "--device", "00001234-0001234A3C03401E", "com.example.flutterApp", "--json-output", "/var/folders/wq/randompath/T/flutter_tools.rand0/core_devices.rand0/uninstall_results.json" ], "commandType" : "devicectl.device.uninstall.app", "environment" : { "TERM" : "xterm-256color" }, "outcome" : "failed", "version" : "341" } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('uninstall_results.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'uninstall', 'app', '--device', deviceId, bundleId, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, exitCode: 1, stderr: ''' ERROR: Could not obtain access to one or more requested file system resources because CoreDevice was unable to create bookmark data. (com.apple.dt.CoreDeviceError error 1005.) NSURL = file:///path/to/app -------------------------------------------------------------------------------- ERROR: The file couldn’t be opened because it doesn’t exist. (NSCocoaErrorDomain error 260.) ''' )); final bool status = await deviceControl.uninstallApp( deviceId: deviceId, bundleId: bundleId, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('ERROR: Could not obtain access to one or more requested file system')); expect(tempFile, isNot(exists)); expect(status, false); }); testWithoutContext('fails uninstall because of unexpected JSON', () async { const String deviceControlOutput = ''' { "valid_unexpected_json": true } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('uninstall_results.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'uninstall', 'app', '--device', deviceId, bundleId, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final bool status = await deviceControl.uninstallApp( deviceId: deviceId, bundleId: bundleId, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('devicectl returned unexpected JSON response')); expect(tempFile, isNot(exists)); expect(status, false); }); testWithoutContext('fails uninstall because of invalid JSON', () async { const String deviceControlOutput = ''' invalid JSON '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('uninstall_results.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'uninstall', 'app', '--device', deviceId, bundleId, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final bool status = await deviceControl.uninstallApp( deviceId: deviceId, bundleId: bundleId, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('devicectl returned non-JSON response')); expect(tempFile, isNot(exists)); expect(status, false); }); }); group('launch app', () { const String deviceId = 'device-id'; const String bundleId = 'com.example.flutterApp'; testWithoutContext('Successful launch without launch args', () async { const String deviceControlOutput = ''' { "info" : { "arguments" : [ "devicectl", "device", "process", "launch", "--device", "00001234-0001234A3C03401E", "com.example.flutterApp", "--json-output", "/var/folders/wq/randompath/T/flutter_tools.rand0/core_devices.rand0/install_results.json" ], "commandType" : "devicectl.device.process.launch", "environment" : { }, "outcome" : "success", "version" : "341" }, "result" : { "deviceIdentifier" : "123456BB5-AEDE-7A22-B890-1234567890DD", "launchOptions" : { "activatedWhenStarted" : true, "arguments" : [ ], "environmentVariables" : { "TERM" : "vt100" }, "platformSpecificOptions" : { }, "startStopped" : false, "terminateExistingInstances" : false, "user" : { "active" : true } }, "process" : { "auditToken" : [ 12345, 678 ], "executable" : "file:///private/var/containers/Bundle/Application/12345E6A-7F89-0C12-345E-F6A7E890CFF1/Runner.app/Runner", "processIdentifier" : 1234 } } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('launch_results.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'process', 'launch', '--device', deviceId, bundleId, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final bool status = await deviceControl.launchApp( deviceId: deviceId, bundleId: bundleId, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, isEmpty); expect(tempFile, isNot(exists)); expect(status, true); }); testWithoutContext('Successful launch with launch args', () async { const String deviceControlOutput = ''' { "info" : { "arguments" : [ "devicectl", "device", "process", "launch", "--device", "00001234-0001234A3C03401E", "com.example.flutterApp", "--arg1", "--arg2", "--json-output", "/var/folders/wq/randompath/T/flutter_tools.rand0/core_devices.rand0/install_results.json" ], "commandType" : "devicectl.device.process.launch", "environment" : { }, "outcome" : "success", "version" : "341" }, "result" : { "deviceIdentifier" : "123456BB5-AEDE-7A22-B890-1234567890DD", "launchOptions" : { "activatedWhenStarted" : true, "arguments" : [ ], "environmentVariables" : { "TERM" : "vt100" }, "platformSpecificOptions" : { }, "startStopped" : false, "terminateExistingInstances" : false, "user" : { "active" : true } }, "process" : { "auditToken" : [ 12345, 678 ], "executable" : "file:///private/var/containers/Bundle/Application/12345E6A-7F89-0C12-345E-F6A7E890CFF1/Runner.app/Runner", "processIdentifier" : 1234 } } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('launch_results.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'process', 'launch', '--device', deviceId, bundleId, '--arg1', '--arg2', '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final bool status = await deviceControl.launchApp( deviceId: deviceId, bundleId: bundleId, launchArguments: <String>['--arg1', '--arg2'], ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, isEmpty); expect(tempFile, isNot(exists)); expect(status, true); }); testWithoutContext('devicectl fails install', () async { const String deviceControlOutput = ''' { "error" : { "code" : -10814, "domain" : "NSOSStatusErrorDomain", "userInfo" : { "_LSFunction" : { "string" : "runEvaluator" }, "_LSLine" : { "int" : 1608 } } }, "info" : { "arguments" : [ "devicectl", "device", "process", "launch", "--device", "00001234-0001234A3C03401E", "com.example.flutterApp", "--json-output", "/var/folders/wq/randompath/T/flutter_tools.rand0/core_devices.rand0/install_results.json" ], "commandType" : "devicectl.device.process.launch", "environment" : { }, "outcome" : "failed", "version" : "341" } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('launch_results.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'process', 'launch', '--device', deviceId, bundleId, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, exitCode: 1, stderr: ''' ERROR: The operation couldn?t be completed. (OSStatus error -10814.) (NSOSStatusErrorDomain error -10814.) _LSFunction = runEvaluator _LSLine = 1608 ''' )); final bool status = await deviceControl.launchApp( deviceId: deviceId, bundleId: bundleId, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('ERROR: The operation couldn?t be completed.')); expect(tempFile, isNot(exists)); expect(status, false); }); testWithoutContext('fails launch because of unexpected JSON', () async { const String deviceControlOutput = ''' { "valid_unexpected_json": true } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('launch_results.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'process', 'launch', '--device', deviceId, bundleId, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final bool status = await deviceControl.launchApp( deviceId: deviceId, bundleId: bundleId, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('devicectl returned unexpected JSON response')); expect(tempFile, isNot(exists)); expect(status, false); }); testWithoutContext('fails launch because of invalid JSON', () async { const String deviceControlOutput = ''' invalid JSON '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('launch_results.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'process', 'launch', '--device', deviceId, bundleId, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final bool status = await deviceControl.launchApp( deviceId: deviceId, bundleId: bundleId, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('devicectl returned non-JSON response')); expect(tempFile, isNot(exists)); expect(status, false); }); }); group('list apps', () { const String deviceId = 'device-id'; const String bundleId = 'com.example.flutterApp'; testWithoutContext('Successfully parses apps', () async { const String deviceControlOutput = ''' { "info" : { "arguments" : [ "devicectl", "device", "info", "apps", "--device", "00001234-0001234A3C03401E", "--bundle-id", "com.example.flutterApp", "--json-output", "apps.txt" ], "commandType" : "devicectl.device.info.apps", "environment" : { "TERM" : "xterm-256color" }, "outcome" : "success", "version" : "341" }, "result" : { "apps" : [ { "appClip" : false, "builtByDeveloper" : true, "bundleIdentifier" : "com.example.flutterApp", "bundleVersion" : "1", "defaultApp" : false, "hidden" : false, "internalApp" : false, "name" : "Bundle", "removable" : true, "url" : "file:///private/var/containers/Bundle/Application/12345E6A-7F89-0C12-345E-F6A7E890CFF1/Runner.app/", "version" : "1.0.0" }, { "appClip" : true, "builtByDeveloper" : false, "bundleIdentifier" : "com.example.flutterApp2", "bundleVersion" : "2", "defaultApp" : true, "hidden" : true, "internalApp" : true, "name" : "Bundle 2", "removable" : false, "url" : "file:///private/var/containers/Bundle/Application/12345E6A-7F89-0C12-345E-F6A7E890CFF1/Runner.app/", "version" : "1.0.0" } ], "defaultAppsIncluded" : false, "deviceIdentifier" : "123456BB5-AEDE-7A22-B890-1234567890DD", "hiddenAppsIncluded" : false, "internalAppsIncluded" : false, "matchingBundleIdentifier" : "com.example.flutterApp", "removableAppsIncluded" : true } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('core_device_app_list.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'info', 'apps', '--device', deviceId, '--bundle-id', bundleId, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final List<IOSCoreDeviceInstalledApp> apps = await deviceControl.getInstalledApps( deviceId: deviceId, bundleId: bundleId, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, isEmpty); expect(tempFile, isNot(exists)); expect(apps.length, 2); expect(apps[0].appClip, isFalse); expect(apps[0].builtByDeveloper, isTrue); expect(apps[0].bundleIdentifier, 'com.example.flutterApp'); expect(apps[0].bundleVersion, '1'); expect(apps[0].defaultApp, isFalse); expect(apps[0].hidden, isFalse); expect(apps[0].internalApp, isFalse); expect(apps[0].name, 'Bundle'); expect(apps[0].removable, isTrue); expect(apps[0].url, 'file:///private/var/containers/Bundle/Application/12345E6A-7F89-0C12-345E-F6A7E890CFF1/Runner.app/'); expect(apps[0].version, '1.0.0'); expect(apps[1].appClip, isTrue); expect(apps[1].builtByDeveloper, isFalse); expect(apps[1].bundleIdentifier, 'com.example.flutterApp2'); expect(apps[1].bundleVersion, '2'); expect(apps[1].defaultApp, isTrue); expect(apps[1].hidden, isTrue); expect(apps[1].internalApp, isTrue); expect(apps[1].name, 'Bundle 2'); expect(apps[1].removable, isFalse); expect(apps[1].url, 'file:///private/var/containers/Bundle/Application/12345E6A-7F89-0C12-345E-F6A7E890CFF1/Runner.app/'); expect(apps[1].version, '1.0.0'); }); testWithoutContext('Successfully find installed app', () async { const String deviceControlOutput = ''' { "info" : { "arguments" : [ "devicectl", "device", "info", "apps", "--device", "00001234-0001234A3C03401E", "--bundle-id", "com.example.flutterApp", "--json-output", "apps.txt" ], "commandType" : "devicectl.device.info.apps", "environment" : { "TERM" : "xterm-256color" }, "outcome" : "success", "version" : "341" }, "result" : { "apps" : [ { "appClip" : false, "builtByDeveloper" : true, "bundleIdentifier" : "com.example.flutterApp", "bundleVersion" : "1", "defaultApp" : false, "hidden" : false, "internalApp" : false, "name" : "Bundle", "removable" : true, "url" : "file:///private/var/containers/Bundle/Application/12345E6A-7F89-0C12-345E-F6A7E890CFF1/Runner.app/", "version" : "1.0.0" } ], "defaultAppsIncluded" : false, "deviceIdentifier" : "123456BB5-AEDE-7A22-B890-1234567890DD", "hiddenAppsIncluded" : false, "internalAppsIncluded" : false, "matchingBundleIdentifier" : "com.example.flutterApp", "removableAppsIncluded" : true } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('core_device_app_list.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'info', 'apps', '--device', deviceId, '--bundle-id', bundleId, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final bool status = await deviceControl.isAppInstalled( deviceId: deviceId, bundleId: bundleId, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, isEmpty); expect(tempFile, isNot(exists)); expect(status, true); }); testWithoutContext('Succeeds but does not find app', () async { const String deviceControlOutput = ''' { "info" : { "arguments" : [ "devicectl", "device", "info", "apps", "--device", "00001234-0001234A3C03401E", "--bundle-id", "com.example.flutterApp", "--json-output", "apps.txt" ], "commandType" : "devicectl.device.info.apps", "environment" : { "TERM" : "xterm-256color" }, "outcome" : "success", "version" : "341" }, "result" : { "apps" : [ ], "defaultAppsIncluded" : false, "deviceIdentifier" : "123456BB5-AEDE-7A22-B890-1234567890DD", "hiddenAppsIncluded" : false, "internalAppsIncluded" : false, "matchingBundleIdentifier" : "com.example.flutterApp", "removableAppsIncluded" : true } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('core_device_app_list.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'info', 'apps', '--device', deviceId, '--bundle-id', bundleId, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final bool status = await deviceControl.isAppInstalled( deviceId: deviceId, bundleId: bundleId, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, isEmpty); expect(tempFile, isNot(exists)); expect(status, false); }); testWithoutContext('devicectl fails to get apps', () async { const String deviceControlOutput = ''' { "error" : { "code" : 1000, "domain" : "com.apple.dt.CoreDeviceError", "userInfo" : { "NSLocalizedDescription" : { "string" : "The specified device was not found." } } }, "info" : { "arguments" : [ "devicectl", "device", "info", "apps", "--device", "00001234-0001234A3C03401E", "--bundle-id", "com.example.flutterApp", "--json-output", "apps.txt" ], "commandType" : "devicectl.device.info.apps", "environment" : { "TERM" : "xterm-256color" }, "outcome" : "failed", "version" : "341" } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('core_device_app_list.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'info', 'apps', '--device', deviceId, '--bundle-id', bundleId, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, exitCode: 1, stderr: ''' ERROR: The specified device was not found. (com.apple.dt.CoreDeviceError error 1000.) ''' )); final bool status = await deviceControl.isAppInstalled( deviceId: deviceId, bundleId: bundleId, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('ERROR: The specified device was not found.')); expect(tempFile, isNot(exists)); expect(status, false); }); testWithoutContext('fails launch because of unexpected JSON', () async { const String deviceControlOutput = ''' { "valid_unexpected_json": true } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('core_device_app_list.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'info', 'apps', '--device', deviceId, '--bundle-id', bundleId, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final bool status = await deviceControl.isAppInstalled( deviceId: deviceId, bundleId: bundleId, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('devicectl returned unexpected JSON response')); expect(tempFile, isNot(exists)); expect(status, false); }); testWithoutContext('fails launch because of invalid JSON', () async { const String deviceControlOutput = ''' invalid JSON '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('core_device_app_list.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'device', 'info', 'apps', '--device', deviceId, '--bundle-id', bundleId, '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final bool status = await deviceControl.isAppInstalled( deviceId: deviceId, bundleId: bundleId, ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('devicectl returned non-JSON response')); expect(tempFile, isNot(exists)); expect(status, false); }); }); group('list devices', () { testWithoutContext('Handles FileSystemException deleting temp directory', () async { final Directory tempDir = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0'); final File tempFile = tempDir.childFile('core_device_list.json'); final List<String> args = <String>[ 'xcrun', 'devicectl', 'list', 'devices', '--timeout', '5', '--json-output', tempFile.path, ]; fakeProcessManager.addCommand(FakeCommand( command: args, onRun: (_) { // Simulate that this command threw and simultaneously the OS // deleted the temp directory expect(tempFile, exists); tempDir.deleteSync(recursive: true); expect(tempFile, isNot(exists)); throw ProcessException(args.first, args.sublist(1)); }, )); await deviceControl.getCoreDevices(); expect(logger.errorText, contains('Error executing devicectl: ProcessException')); expect(fakeProcessManager, hasNoRemainingExpectations); }); testWithoutContext('Handles json file mysteriously disappearing', () async { final Directory tempDir = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0'); final File tempFile = tempDir.childFile('core_device_list.json'); final List<String> args = <String>[ 'xcrun', 'devicectl', 'list', 'devices', '--timeout', '5', '--json-output', tempFile.path, ]; fakeProcessManager.addCommand(FakeCommand( command: args, onRun: (_) { // Simulate that this command deleted tempFile, did not create a // new one, and exited successfully expect(tempFile, exists); tempFile.deleteSync(); expect(tempFile, isNot(exists)); }, )); await expectLater( () => deviceControl.getCoreDevices(), throwsA( isA<StateError>().having( (StateError e) => e.message, 'message', contains('Expected the file ${tempFile.path} to exist but it did not'), ), ), ); expect( logger.errorText, contains('After running the command xcrun devicectl list devices ' '--timeout 5 --json-output ${tempFile.path} the file\n' '${tempFile.path} was expected to exist, but it did not', ), ); expect(fakeProcessManager, hasNoRemainingExpectations); }); testWithoutContext('No devices', () async { const String deviceControlOutput = ''' { "info" : { "arguments" : [ "devicectl", "list", "devices", "--json-output", "core_device_list.json" ], "commandType" : "devicectl.list.devices", "environment" : { "TERM" : "xterm-256color" }, "outcome" : "success", "version" : "325.3" }, "result" : { "devices" : [ ] } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('core_device_list.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'list', 'devices', '--timeout', '5', '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final List<IOSCoreDevice> devices = await deviceControl.getCoreDevices(); expect(fakeProcessManager, hasNoRemainingExpectations); expect(devices.isEmpty, isTrue); }); testWithoutContext('All sections parsed', () async { const String deviceControlOutput = ''' { "info" : { "arguments" : [ "devicectl", "list", "devices", "--json-output", "core_device_list.json" ], "commandType" : "devicectl.list.devices", "environment" : { "TERM" : "xterm-256color" }, "outcome" : "success", "version" : "325.3" }, "result" : { "devices" : [ { "capabilities" : [ ], "connectionProperties" : { }, "deviceProperties" : { }, "hardwareProperties" : { }, "identifier" : "123456BB5-AEDE-7A22-B890-1234567890DD", "visibilityClass" : "default" } ] } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('core_device_list.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'list', 'devices', '--timeout', '5', '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final List<IOSCoreDevice> devices = await deviceControl.getCoreDevices(); expect(devices.length, 1); expect(devices[0].capabilities, isNotNull); expect(devices[0].connectionProperties, isNotNull); expect(devices[0].deviceProperties, isNotNull); expect(devices[0].hardwareProperties, isNotNull); expect(devices[0].coreDeviceIdentifier, '123456BB5-AEDE-7A22-B890-1234567890DD'); expect(devices[0].visibilityClass, 'default'); expect(fakeProcessManager, hasNoRemainingExpectations); expect(tempFile, isNot(exists)); }); testWithoutContext('All sections parsed, device missing sections', () async { const String deviceControlOutput = ''' { "info" : { "arguments" : [ "devicectl", "list", "devices", "--json-output", "core_device_list.json" ], "commandType" : "devicectl.list.devices", "environment" : { "TERM" : "xterm-256color" }, "outcome" : "success", "version" : "325.3" }, "result" : { "devices" : [ { "identifier" : "123456BB5-AEDE-7A22-B890-1234567890DD", "visibilityClass" : "default" } ] } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('core_device_list.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'list', 'devices', '--timeout', '5', '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final List<IOSCoreDevice> devices = await deviceControl.getCoreDevices(); expect(devices.length, 1); expect(devices[0].capabilities, isEmpty); expect(devices[0].connectionProperties, isNull); expect(devices[0].deviceProperties, isNull); expect(devices[0].hardwareProperties, isNull); expect(devices[0].coreDeviceIdentifier, '123456BB5-AEDE-7A22-B890-1234567890DD'); expect(devices[0].visibilityClass, 'default'); expect(fakeProcessManager, hasNoRemainingExpectations); expect(tempFile, isNot(exists)); }); testWithoutContext('capabilities parsed', () async { const String deviceControlOutput = ''' { "result" : { "devices" : [ { "capabilities" : [ { "featureIdentifier" : "com.apple.coredevice.feature.spawnexecutable", "name" : "Spawn Executable" }, { "featureIdentifier" : "com.apple.coredevice.feature.launchapplication", "name" : "Launch Application" } ] } ] } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('core_device_list.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'list', 'devices', '--timeout', '5', '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final List<IOSCoreDevice> devices = await deviceControl.getCoreDevices(); expect(devices.length, 1); expect(devices[0].capabilities.length, 2); expect(devices[0].capabilities[0].featureIdentifier, 'com.apple.coredevice.feature.spawnexecutable'); expect(devices[0].capabilities[0].name, 'Spawn Executable'); expect(devices[0].capabilities[1].featureIdentifier, 'com.apple.coredevice.feature.launchapplication'); expect(devices[0].capabilities[1].name, 'Launch Application'); expect(fakeProcessManager, hasNoRemainingExpectations); expect(tempFile, isNot(exists)); }); testWithoutContext('connectionProperties parsed', () async { const String deviceControlOutput = ''' { "result" : { "devices" : [ { "connectionProperties" : { "authenticationType" : "manualPairing", "isMobileDeviceOnly" : false, "lastConnectionDate" : "2023-06-15T15:29:00.082Z", "localHostnames" : [ "Victorias-iPad.coredevice.local", "00001234-0001234A3C03401E.coredevice.local", "123456BB5-AEDE-7A22-B890-1234567890DD.coredevice.local" ], "pairingState" : "paired", "potentialHostnames" : [ "00001234-0001234A3C03401E.coredevice.local", "123456BB5-AEDE-7A22-B890-1234567890DD.coredevice.local" ], "transportType" : "wired", "tunnelIPAddress" : "fdf1:23c4:cd56::1", "tunnelState" : "connected", "tunnelTransportProtocol" : "tcp" } } ] } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('core_device_list.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'list', 'devices', '--timeout', '5', '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final List<IOSCoreDevice> devices = await deviceControl.getCoreDevices(); expect(devices.length, 1); expect(devices[0].connectionProperties?.authenticationType, 'manualPairing'); expect(devices[0].connectionProperties?.isMobileDeviceOnly, false); expect(devices[0].connectionProperties?.lastConnectionDate, '2023-06-15T15:29:00.082Z'); expect( devices[0].connectionProperties?.localHostnames, <String>[ 'Victorias-iPad.coredevice.local', '00001234-0001234A3C03401E.coredevice.local', '123456BB5-AEDE-7A22-B890-1234567890DD.coredevice.local', ], ); expect(devices[0].connectionProperties?.pairingState, 'paired'); expect(devices[0].connectionProperties?.potentialHostnames, <String>[ '00001234-0001234A3C03401E.coredevice.local', '123456BB5-AEDE-7A22-B890-1234567890DD.coredevice.local', ]); expect(devices[0].connectionProperties?.transportType, 'wired'); expect(devices[0].connectionProperties?.tunnelIPAddress, 'fdf1:23c4:cd56::1'); expect(devices[0].connectionProperties?.tunnelState, 'connected'); expect(devices[0].connectionProperties?.tunnelTransportProtocol, 'tcp'); expect(fakeProcessManager, hasNoRemainingExpectations); expect(tempFile, isNot(exists)); }); testWithoutContext('deviceProperties parsed', () async { const String deviceControlOutput = ''' { "result" : { "devices" : [ { "deviceProperties" : { "bootedFromSnapshot" : true, "bootedSnapshotName" : "com.apple.os.update-123456", "bootState" : "booted", "ddiServicesAvailable" : true, "developerModeStatus" : "enabled", "hasInternalOSBuild" : false, "name" : "iPadName", "osBuildUpdate" : "21A5248v", "osVersionNumber" : "17.0", "rootFileSystemIsWritable" : false, "screenViewingURL" : "coredevice-devices:/viewDeviceByUUID?uuid=123456BB5-AEDE-7A22-B890-1234567890DD" } } ] } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('core_device_list.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'list', 'devices', '--timeout', '5', '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final List<IOSCoreDevice> devices = await deviceControl.getCoreDevices(); expect(devices.length, 1); expect(devices[0].deviceProperties?.bootedFromSnapshot, true); expect(devices[0].deviceProperties?.bootedSnapshotName, 'com.apple.os.update-123456'); expect(devices[0].deviceProperties?.bootState, 'booted'); expect(devices[0].deviceProperties?.ddiServicesAvailable, true); expect(devices[0].deviceProperties?.developerModeStatus, 'enabled'); expect(devices[0].deviceProperties?.hasInternalOSBuild, false); expect(devices[0].deviceProperties?.name, 'iPadName'); expect(devices[0].deviceProperties?.osBuildUpdate, '21A5248v'); expect(devices[0].deviceProperties?.osVersionNumber, '17.0'); expect(devices[0].deviceProperties?.rootFileSystemIsWritable, false); expect(devices[0].deviceProperties?.screenViewingURL, 'coredevice-devices:/viewDeviceByUUID?uuid=123456BB5-AEDE-7A22-B890-1234567890DD'); expect(fakeProcessManager, hasNoRemainingExpectations); expect(tempFile, isNot(exists)); }); testWithoutContext('hardwareProperties parsed', () async { const String deviceControlOutput = r''' { "result" : { "devices" : [ { "hardwareProperties" : { "cpuType" : { "name" : "arm64e", "subType" : 2, "type" : 16777228 }, "deviceType" : "iPad", "ecid" : 12345678903408542, "hardwareModel" : "J617AP", "internalStorageCapacity" : 128000000000, "marketingName" : "iPad Pro (11-inch) (4th generation)\"", "platform" : "iOS", "productType" : "iPad14,3", "serialNumber" : "HC123DHCQV", "supportedCPUTypes" : [ { "name" : "arm64e", "subType" : 2, "type" : 16777228 }, { "name" : "arm64", "subType" : 0, "type" : 16777228 } ], "supportedDeviceFamilies" : [ 1, 2 ], "thinningProductType" : "iPad14,3-A", "udid" : "00001234-0001234A3C03401E" } } ] } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('core_device_list.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'list', 'devices', '--timeout', '5', '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final List<IOSCoreDevice> devices = await deviceControl.getCoreDevices(); expect(devices.length, 1); expect(devices[0].hardwareProperties?.cpuType, isNotNull); expect(devices[0].hardwareProperties?.cpuType?.name, 'arm64e'); expect(devices[0].hardwareProperties?.cpuType?.subType, 2); expect(devices[0].hardwareProperties?.cpuType?.cpuType, 16777228); expect(devices[0].hardwareProperties?.deviceType, 'iPad'); expect(devices[0].hardwareProperties?.ecid, 12345678903408542); expect(devices[0].hardwareProperties?.hardwareModel, 'J617AP'); expect(devices[0].hardwareProperties?.internalStorageCapacity, 128000000000); expect(devices[0].hardwareProperties?.marketingName, 'iPad Pro (11-inch) (4th generation)"'); expect(devices[0].hardwareProperties?.platform, 'iOS'); expect(devices[0].hardwareProperties?.productType, 'iPad14,3'); expect(devices[0].hardwareProperties?.serialNumber, 'HC123DHCQV'); expect(devices[0].hardwareProperties?.supportedCPUTypes, isNotNull); expect(devices[0].hardwareProperties?.supportedCPUTypes?[0].name, 'arm64e'); expect(devices[0].hardwareProperties?.supportedCPUTypes?[0].subType, 2); expect(devices[0].hardwareProperties?.supportedCPUTypes?[0].cpuType, 16777228); expect(devices[0].hardwareProperties?.supportedCPUTypes?[1].name, 'arm64'); expect(devices[0].hardwareProperties?.supportedCPUTypes?[1].subType, 0); expect(devices[0].hardwareProperties?.supportedCPUTypes?[1].cpuType, 16777228); expect(devices[0].hardwareProperties?.supportedDeviceFamilies, <int>[1, 2]); expect(devices[0].hardwareProperties?.thinningProductType, 'iPad14,3-A'); expect(devices[0].hardwareProperties?.udid, '00001234-0001234A3C03401E'); expect(fakeProcessManager, hasNoRemainingExpectations); expect(tempFile, isNot(exists)); }); group('Handles errors', () { testWithoutContext('invalid json', () async { const String deviceControlOutput = '''Invalid JSON'''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('core_device_list.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'list', 'devices', '--timeout', '5', '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final List<IOSCoreDevice> devices = await deviceControl.getCoreDevices(); expect(devices.isEmpty, isTrue); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('devicectl returned non-JSON response: Invalid JSON')); }); testWithoutContext('unexpected json', () async { const String deviceControlOutput = ''' { "info" : { "arguments" : [ "devicectl", "list", "devices", "--json-output", "device_list.json" ], "commandType" : "devicectl.list.devices", "environment" : { "TERM" : "xterm-256color" }, "outcome" : "success", "version" : "325.3" }, "result" : [ ] } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('core_device_list.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'list', 'devices', '--timeout', '5', '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final List<IOSCoreDevice> devices = await deviceControl.getCoreDevices(); expect(devices.isEmpty, isTrue); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.errorText, contains('devicectl returned unexpected JSON response:')); }); testWithoutContext('When timeout is below minimum, default to minimum', () async { const String deviceControlOutput = ''' { "info" : { "arguments" : [ "devicectl", "list", "devices", "--json-output", "core_device_list.json" ], "commandType" : "devicectl.list.devices", "environment" : { "TERM" : "xterm-256color" }, "outcome" : "success", "version" : "325.3" }, "result" : { "devices" : [ { "identifier" : "123456BB5-AEDE-7A22-B890-1234567890DD", "visibilityClass" : "default" } ] } } '''; final File tempFile = fileSystem.systemTempDirectory .childDirectory('core_devices.rand0') .childFile('core_device_list.json'); fakeProcessManager.addCommand(FakeCommand( command: <String>[ 'xcrun', 'devicectl', 'list', 'devices', '--timeout', '5', '--json-output', tempFile.path, ], onRun: (_) { expect(tempFile, exists); tempFile.writeAsStringSync(deviceControlOutput); }, )); final List<IOSCoreDevice> devices = await deviceControl.getCoreDevices( timeout: const Duration(seconds: 2), ); expect(devices.isNotEmpty, isTrue); expect(fakeProcessManager, hasNoRemainingExpectations); expect( logger.errorText, contains('Timeout of 2 seconds is below the minimum timeout value ' 'for devicectl. Changing the timeout to the minimum value of 5.'), ); }); }); }); }); }
flutter/packages/flutter_tools/test/general.shard/ios/core_devices_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/ios/core_devices_test.dart", "repo_id": "flutter", "token_count": 29294 }
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. /// An example xcresult bundle json with invalid issues map. const String kSampleResultJsonInvalidIssuesMap = r''' { "_type" : { "_name" : "ActionsInvocationRecord" }, "issues": [] } '''; /// An example xcresult bundle json that contains warnings and errors that needs to be discarded per https://github.com/flutter/flutter/issues/95354. const String kSampleResultJsonWithIssuesToBeDiscarded = r''' { "issues" : { "_type" : { "_name" : "ResultIssueSummaries" }, "errorSummaries" : { "_type" : { "_name" : "Array" }, "_values" : [ { "_type" : { "_name" : "IssueSummary" }, "documentLocationInCreatingWorkspace" : { "_type" : { "_name" : "DocumentLocation" }, "concreteTypeName" : { "_type" : { "_name" : "String" }, "_value" : "DVTTextDocumentLocation" }, "url" : { "_type" : { "_name" : "String" }, "_value" : "file:\/\/\/Users\/m\/Projects\/test_create\/ios\/Runner\/AppDelegate.m#CharacterRangeLen=0&CharacterRangeLoc=263&EndingColumnNumber=56&EndingLineNumber=7&LocationEncoding=1&StartingColumnNumber=56&StartingLineNumber=7" } }, "issueType" : { "_type" : { "_name" : "String" }, "_value" : "Semantic Issue" }, "message" : { "_type" : { "_name" : "String" }, "_value" : "Use of undeclared identifier 'asdas'" } }, { "_type" : { "_name" : "IssueSummary" }, "issueType" : { "_type" : { "_name" : "String" }, "_value" : "Uncategorized" }, "message" : { "_type" : { "_name" : "String" }, "_value" : "Command PhaseScriptExecution failed with a nonzero exit code" } } ] }, "warningSummaries" : { "_type" : { "_name" : "Array" }, "_values" : [ { "_type" : { "_name" : "IssueSummary" }, "issueType" : { "_type" : { "_name" : "String" }, "_value" : "Warning" }, "message" : { "_type" : { "_name" : "String" }, "_value" : "The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99." } } ] } } } '''; /// An example xcresult bundle json that contains some warning and some errors. const String kSampleResultJsonWithIssues = r''' { "issues" : { "_type" : { "_name" : "ResultIssueSummaries" }, "errorSummaries" : { "_type" : { "_name" : "Array" }, "_values" : [ { "_type" : { "_name" : "IssueSummary" }, "documentLocationInCreatingWorkspace" : { "_type" : { "_name" : "DocumentLocation" }, "concreteTypeName" : { "_type" : { "_name" : "String" }, "_value" : "DVTTextDocumentLocation" }, "url" : { "_type" : { "_name" : "String" }, "_value" : "file:\/\/\/Users\/m\/Projects\/test_create\/ios\/Runner\/AppDelegate.m#CharacterRangeLen=0&CharacterRangeLoc=263&EndingColumnNumber=56&EndingLineNumber=7&LocationEncoding=1&StartingColumnNumber=56&StartingLineNumber=7" } }, "issueType" : { "_type" : { "_name" : "String" }, "_value" : "Semantic Issue" }, "message" : { "_type" : { "_name" : "String" }, "_value" : "Use of undeclared identifier 'asdas'" } } ] }, "warningSummaries" : { "_type" : { "_name" : "Array" }, "_values" : [ { "_type" : { "_name" : "IssueSummary" }, "issueType" : { "_type" : { "_name" : "String" }, "_value" : "Warning" }, "message" : { "_type" : { "_name" : "String" }, "_value" : "The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99." } } ] } } } '''; /// An example xcresult bundle json that contains some warning and some errors. const String kSampleResultJsonWithNoProvisioningProfileIssue = r''' { "issues" : { "_type" : { "_name" : "ResultIssueSummaries" }, "errorSummaries" : { "_type" : { "_name" : "Array" }, "_values" : [ { "_type" : { "_name" : "IssueSummary" }, "documentLocationInCreatingWorkspace" : { "_type" : { "_name" : "DocumentLocation" }, "concreteTypeName" : { "_type" : { "_name" : "String" }, "_value" : "DVTTextDocumentLocation" }, "url" : { "_type" : { "_name" : "String" }, "_value" : "file:\/\/\/Users\/m\/Projects\/test_create\/ios\/Runner\/AppDelegate.m#CharacterRangeLen=0&CharacterRangeLoc=263&EndingColumnNumber=56&EndingLineNumber=7&LocationEncoding=1&StartingColumnNumber=56&StartingLineNumber=7" } }, "issueType" : { "_type" : { "_name" : "String" }, "_value" : "Error" }, "message" : { "_type" : { "_name" : "String" }, "_value" : "Runner requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor" } } ] }, "warningSummaries" : { "_type" : { "_name" : "Array" }, "_values" : [ { "_type" : { "_name" : "IssueSummary" }, "issueType" : { "_type" : { "_name" : "String" }, "_value" : "Warning" }, "message" : { "_type" : { "_name" : "String" }, "_value" : "The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99." } } ] } } } '''; /// An example xcresult bundle json that contains some warning and some errors. const String kSampleResultJsonWithIssuesAndInvalidUrl = r''' { "issues" : { "_type" : { "_name" : "ResultIssueSummaries" }, "errorSummaries" : { "_type" : { "_name" : "Array" }, "_values" : [ { "_type" : { "_name" : "IssueSummary" }, "documentLocationInCreatingWorkspace" : { "_type" : { "_name" : "DocumentLocation" }, "concreteTypeName" : { "_type" : { "_name" : "String" }, "_value" : "DVTTextDocumentLocation" }, "url" : { "_type" : { "_name" : "String" }, "_value" : "3:00" } }, "issueType" : { "_type" : { "_name" : "String" }, "_value" : "Semantic Issue" }, "message" : { "_type" : { "_name" : "String" }, "_value" : "Use of undeclared identifier 'asdas'" } } ] }, "warningSummaries" : { "_type" : { "_name" : "Array" }, "_values" : [ { "_type" : { "_name" : "IssueSummary" }, "issueType" : { "_type" : { "_name" : "String" }, "_value" : "Warning" }, "message" : { "_type" : { "_name" : "String" }, "_value" : "The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99." } } ] } } } '''; /// An example xcresult bundle json that contains no issues. const String kSampleResultJsonNoIssues = r''' { "issues" : { "_type" : { "_name" : "ResultIssueSummaries" } } } '''; /// An example xcresult bundle json with some provision profile issue. const String kSampleResultJsonWithProvisionIssue = r''' { "issues" : { "_type" : { "_name" : "ResultIssueSummaries" }, "errorSummaries" : { "_type" : { "_name" : "Array" }, "_values" : [ { "_type" : { "_name" : "IssueSummary" }, "issueType" : { "_type" : { "_name" : "String" }, "_value" : "Semantic Issue" }, "message" : { "_type" : { "_name" : "String" }, "_value" : "Some Provisioning profile issue." } } ] } } } '''; /// An example xcresult bundle json that contains action issues. const String kSampleResultJsonWithActionIssues = r''' { "_type" : { "_name" : "ActionsInvocationRecord" }, "actions" : { "_type" : { "_name" : "Array" }, "_values" : [ { "_type" : { "_name" : "ActionRecord" }, "actionResult" : { "_type" : { "_name" : "ActionResult" }, "coverage" : { "_type" : { "_name" : "CodeCoverageInfo" } }, "issues" : { "_type" : { "_name" : "ResultIssueSummaries" }, "testFailureSummaries" : { "_type" : { "_name" : "Array" }, "_values" : [ { "_type" : { "_name" : "TestFailureIssueSummary", "_supertype" : { "_name" : "IssueSummary" } }, "issueType" : { "_type" : { "_name" : "String" }, "_value" : "Uncategorized" }, "message" : { "_type" : { "_name" : "String" }, "_value" : "Unable to find a destination matching the provided destination specifier:\n\t\t{ id:1234D567-890C-1DA2-34E5-F6789A0123C4 }\n\n\tIneligible destinations for the \"Runner\" scheme:\n\t\t{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device, error:iOS 17.0 is not installed. To use with Xcode, first download and install the platform }" } } ] } }, "logRef" : { "_type" : { "_name" : "Reference" }, "id" : { "_type" : { "_name" : "String" }, "_value" : "0~5X-qvql8_ppq0bj9taBMeZd4L2lXQagy1twsFRWwc06r42obpBZfP87uKnGO98mp5CUz1Ppr1knHiTMH9tOuwQ==" }, "targetType" : { "_type" : { "_name" : "TypeDefinition" }, "name" : { "_type" : { "_name" : "String" }, "_value" : "ActivityLogSection" } } }, "metrics" : { "_type" : { "_name" : "ResultMetrics" } }, "resultName" : { "_type" : { "_name" : "String" }, "_value" : "All Tests" }, "status" : { "_type" : { "_name" : "String" }, "_value" : "failedToStart" }, "testsRef" : { "_type" : { "_name" : "Reference" }, "id" : { "_type" : { "_name" : "String" }, "_value" : "0~Dmuz8-g6YRb8HPVbTUXJD21oy3r5jxIGi-njd2Lc43yR5JlJf7D78HtNn2BsrF5iw1uYMnsuJ9xFDV7ZAmwhGg==" }, "targetType" : { "_type" : { "_name" : "TypeDefinition" }, "name" : { "_type" : { "_name" : "String" }, "_value" : "ActionTestPlanRunSummaries" } } } }, "buildResult" : { "_type" : { "_name" : "ActionResult" }, "coverage" : { "_type" : { "_name" : "CodeCoverageInfo" } }, "issues" : { "_type" : { "_name" : "ResultIssueSummaries" } }, "metrics" : { "_type" : { "_name" : "ResultMetrics" } }, "resultName" : { "_type" : { "_name" : "String" }, "_value" : "Build Succeeded" }, "status" : { "_type" : { "_name" : "String" }, "_value" : "succeeded" } }, "endedTime" : { "_type" : { "_name" : "Date" }, "_value" : "2023-07-10T12:52:22.592-0500" }, "runDestination" : { "_type" : { "_name" : "ActionRunDestinationRecord" }, "localComputerRecord" : { "_type" : { "_name" : "ActionDeviceRecord" }, "platformRecord" : { "_type" : { "_name" : "ActionPlatformRecord" } } }, "targetDeviceRecord" : { "_type" : { "_name" : "ActionDeviceRecord" }, "platformRecord" : { "_type" : { "_name" : "ActionPlatformRecord" } } }, "targetSDKRecord" : { "_type" : { "_name" : "ActionSDKRecord" } } }, "schemeCommandName" : { "_type" : { "_name" : "String" }, "_value" : "Test" }, "schemeTaskName" : { "_type" : { "_name" : "String" }, "_value" : "BuildAndAction" }, "startedTime" : { "_type" : { "_name" : "Date" }, "_value" : "2023-07-10T12:52:22.592-0500" }, "title" : { "_type" : { "_name" : "String" }, "_value" : "RunnerTests.xctest" } } ] }, "issues" : { "_type" : { "_name" : "ResultIssueSummaries" } }, "metadataRef" : { "_type" : { "_name" : "Reference" }, "id" : { "_type" : { "_name" : "String" }, "_value" : "0~pY0GqmiVE6Q3qlWdLJDp_PnrsUKsJ7KKM1zKGnvEZOWGdBeGNArjjU62kgF2UBFdQLdRmf5SGpImQfJB6e7vDQ==" }, "targetType" : { "_type" : { "_name" : "TypeDefinition" }, "name" : { "_type" : { "_name" : "String" }, "_value" : "ActionsInvocationMetadata" } } }, "metrics" : { "_type" : { "_name" : "ResultMetrics" } } } ''';
flutter/packages/flutter_tools/test/general.shard/ios/xcresult_test_data.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/ios/xcresult_test_data.dart", "repo_id": "flutter", "token_count": 9650 }
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/memory.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/platform.dart'; import 'package:flutter_tools/src/base/version.dart'; import 'package:flutter_tools/src/build_info.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/flutter_plugins.dart'; import 'package:flutter_tools/src/ios/xcodeproj.dart'; import 'package:flutter_tools/src/macos/cocoapods.dart'; 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/common.dart'; import '../../src/context.dart'; import '../../src/fake_process_manager.dart'; import '../../src/fakes.dart'; enum _StdioStream { stdout, stderr, } void main() { late FileSystem fileSystem; late FakeProcessManager fakeProcessManager; late CocoaPods cocoaPodsUnderTest; late BufferLogger logger; late TestUsage usage; late FakeAnalytics fakeAnalytics; void pretendPodVersionFails() { fakeProcessManager.addCommand( const FakeCommand( command: <String>['pod', '--version'], exitCode: 1, ), ); } void pretendPodVersionIs(String versionText) { fakeProcessManager.addCommand( FakeCommand( command: const <String>['pod', '--version'], stdout: versionText, ), ); } void podsIsInHomeDir() { fileSystem.directory(fileSystem.path.join( '.cocoapods', 'repos', 'master', )).createSync(recursive: true); } FlutterProject setupProjectUnderTest() { // This needs to be run within testWithoutContext and not setUp since FlutterProject uses context. final FlutterProject projectUnderTest = FlutterProject.fromDirectory(fileSystem.directory('project')); projectUnderTest.ios.xcodeProject.createSync(recursive: true); projectUnderTest.macos.xcodeProject.createSync(recursive: true); return projectUnderTest; } setUp(() async { Cache.flutterRoot = 'flutter'; fileSystem = MemoryFileSystem.test(); fakeProcessManager = FakeProcessManager.empty(); logger = BufferLogger.test(); usage = TestUsage(); fakeAnalytics = getInitializedFakeAnalyticsInstance( fs: fileSystem, fakeFlutterVersion: FakeFlutterVersion(), ); cocoaPodsUnderTest = CocoaPods( fileSystem: fileSystem, processManager: fakeProcessManager, logger: logger, platform: FakePlatform(operatingSystem: 'macos'), xcodeProjectInterpreter: FakeXcodeProjectInterpreter(), usage: usage, analytics: fakeAnalytics, ); fileSystem.file(fileSystem.path.join( Cache.flutterRoot!, 'packages', 'flutter_tools', 'templates', 'cocoapods', 'Podfile-ios-objc', )) ..createSync(recursive: true) ..writeAsStringSync('Objective-C iOS podfile template'); fileSystem.file(fileSystem.path.join( Cache.flutterRoot!, 'packages', 'flutter_tools', 'templates', 'cocoapods', 'Podfile-ios-swift', )) ..createSync(recursive: true) ..writeAsStringSync('Swift iOS podfile template'); fileSystem.file(fileSystem.path.join( Cache.flutterRoot!, 'packages', 'flutter_tools', 'templates', 'cocoapods', 'Podfile-macos', )) ..createSync(recursive: true) ..writeAsStringSync('macOS podfile template'); }); void pretendPodIsNotInstalled() { fakeProcessManager.addCommand( const FakeCommand( command: <String>['which', 'pod'], exitCode: 1, ), ); } void pretendPodIsBroken() { fakeProcessManager.addCommands(<FakeCommand>[ // it is present const FakeCommand( command: <String>['which', 'pod'], ), // but is not working const FakeCommand( command: <String>['pod', '--version'], exitCode: 1, ), ]); } void pretendPodIsInstalled() { fakeProcessManager.addCommands(<FakeCommand>[ const FakeCommand( command: <String>['which', 'pod'], ), ]); } group('Evaluate installation', () { testWithoutContext('detects not installed, if pod exec does not exist', () async { pretendPodIsNotInstalled(); expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.notInstalled); }); testWithoutContext('detects not installed, if pod is installed but version fails', () async { pretendPodIsInstalled(); pretendPodVersionFails(); expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.brokenInstall); }); testWithoutContext('detects installed', () async { pretendPodIsInstalled(); pretendPodVersionIs('0.0.1'); expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, isNot(CocoaPodsStatus.notInstalled)); }); testWithoutContext('detects unknown version', () async { pretendPodIsInstalled(); pretendPodVersionIs('Plugin loaded.\n1.5.3'); expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.unknownVersion); }); testWithoutContext('detects below minimum version', () async { pretendPodIsInstalled(); pretendPodVersionIs('1.9.0'); expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.belowMinimumVersion); }); testWithoutContext('detects below recommended version', () async { pretendPodIsInstalled(); pretendPodVersionIs('1.12.5'); expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.belowRecommendedVersion); }); testWithoutContext('detects at recommended version', () async { pretendPodIsInstalled(); pretendPodVersionIs('1.13.0'); expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.recommended); }); testWithoutContext('detects above recommended version', () async { pretendPodIsInstalled(); pretendPodVersionIs('1.13.1'); expect(await cocoaPodsUnderTest.evaluateCocoaPodsInstallation, CocoaPodsStatus.recommended); }); }); group('Setup Podfile', () { testUsingContext('creates objective-c Podfile when not present', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); await cocoaPodsUnderTest.setupPodfile(projectUnderTest.ios); expect(projectUnderTest.ios.podfile.readAsStringSync(), 'Objective-C iOS podfile template'); }); testUsingContext('creates swift Podfile if swift', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); final FakeXcodeProjectInterpreter fakeXcodeProjectInterpreter = FakeXcodeProjectInterpreter(buildSettings: <String, String>{ 'SWIFT_VERSION': '5.0', }); final CocoaPods cocoaPodsUnderTest = CocoaPods( fileSystem: fileSystem, processManager: fakeProcessManager, logger: logger, platform: FakePlatform(operatingSystem: 'macos'), xcodeProjectInterpreter: fakeXcodeProjectInterpreter, usage: usage, analytics: fakeAnalytics, ); final FlutterProject project = FlutterProject.fromDirectoryTest(fileSystem.directory('project')); await cocoaPodsUnderTest.setupPodfile(project.ios); expect(projectUnderTest.ios.podfile.readAsStringSync(), 'Swift iOS podfile template'); }); testUsingContext('creates macOS Podfile when not present', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); projectUnderTest.macos.xcodeProject.createSync(recursive: true); await cocoaPodsUnderTest.setupPodfile(projectUnderTest.macos); expect(projectUnderTest.macos.podfile.readAsStringSync(), 'macOS podfile template'); }); testUsingContext('does not recreate Podfile when already present', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); projectUnderTest.ios.podfile..createSync()..writeAsStringSync('Existing Podfile'); final FlutterProject project = FlutterProject.fromDirectoryTest(fileSystem.directory('project')); await cocoaPodsUnderTest.setupPodfile(project.ios); expect(projectUnderTest.ios.podfile.readAsStringSync(), 'Existing Podfile'); }); testUsingContext('does not create Podfile when we cannot interpret Xcode projects', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); final CocoaPods cocoaPodsUnderTest = CocoaPods( fileSystem: fileSystem, processManager: fakeProcessManager, logger: logger, platform: FakePlatform(operatingSystem: 'macos'), xcodeProjectInterpreter: FakeXcodeProjectInterpreter(isInstalled: false), usage: usage, analytics: fakeAnalytics, ); final FlutterProject project = FlutterProject.fromDirectoryTest(fileSystem.directory('project')); await cocoaPodsUnderTest.setupPodfile(project.ios); expect(projectUnderTest.ios.podfile.existsSync(), false); }); testUsingContext('includes Pod config in xcconfig files, if not present', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); projectUnderTest.ios.podfile..createSync()..writeAsStringSync('Existing Podfile'); projectUnderTest.ios.xcodeConfigFor('Debug') ..createSync(recursive: true) ..writeAsStringSync('Existing debug config'); projectUnderTest.ios.xcodeConfigFor('Release') ..createSync(recursive: true) ..writeAsStringSync('Existing release config'); final FlutterProject project = FlutterProject.fromDirectoryTest(fileSystem.directory('project')); await cocoaPodsUnderTest.setupPodfile(project.ios); final String debugContents = projectUnderTest.ios.xcodeConfigFor('Debug').readAsStringSync(); expect(debugContents, contains( '#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"\n')); expect(debugContents, contains('Existing debug config')); final String releaseContents = projectUnderTest.ios.xcodeConfigFor('Release').readAsStringSync(); expect(releaseContents, contains( '#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"\n')); expect(releaseContents, contains('Existing release config')); }); testUsingContext('does not include Pod config in xcconfig files, if legacy non-option include present', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); projectUnderTest.ios.podfile..createSync()..writeAsStringSync('Existing Podfile'); const String legacyDebugInclude = '#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig'; projectUnderTest.ios.xcodeConfigFor('Debug') ..createSync(recursive: true) ..writeAsStringSync(legacyDebugInclude); const String legacyReleaseInclude = '#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig'; projectUnderTest.ios.xcodeConfigFor('Release') ..createSync(recursive: true) ..writeAsStringSync(legacyReleaseInclude); final FlutterProject project = FlutterProject.fromDirectoryTest(fileSystem.directory('project')); await cocoaPodsUnderTest.setupPodfile(project.ios); final String debugContents = projectUnderTest.ios.xcodeConfigFor('Debug').readAsStringSync(); // Redundant contains check, but this documents what we're testing--that the optional // #include? doesn't get written in addition to the previous style #include. expect(debugContents, isNot(contains('#include?'))); expect(debugContents, equals(legacyDebugInclude)); final String releaseContents = projectUnderTest.ios.xcodeConfigFor('Release').readAsStringSync(); expect(releaseContents, isNot(contains('#include?'))); expect(releaseContents, equals(legacyReleaseInclude)); }); testUsingContext('does not include Pod config in xcconfig files, if flavor include present', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); projectUnderTest.ios.podfile..createSync()..writeAsStringSync('Existing Podfile'); const String flavorDebugInclude = '#include? "Pods/Target Support Files/Pods-Free App/Pods-Free App.debug free.xcconfig"'; projectUnderTest.ios.xcodeConfigFor('Debug') ..createSync(recursive: true) ..writeAsStringSync(flavorDebugInclude); const String flavorReleaseInclude = '#include? "Pods/Target Support Files/Pods-Free App/Pods-Free App.release free.xcconfig"'; projectUnderTest.ios.xcodeConfigFor('Release') ..createSync(recursive: true) ..writeAsStringSync(flavorReleaseInclude); final FlutterProject project = FlutterProject.fromDirectoryTest(fileSystem.directory('project')); await cocoaPodsUnderTest.setupPodfile(project.ios); final String debugContents = projectUnderTest.ios.xcodeConfigFor('Debug').readAsStringSync(); // Redundant contains check, but this documents what we're testing--that the optional // #include? doesn't get written in addition to the previous style #include. expect(debugContents, isNot(contains('Pods-Runner/Pods-Runner.debug'))); expect(debugContents, equals(flavorDebugInclude)); final String releaseContents = projectUnderTest.ios.xcodeConfigFor('Release').readAsStringSync(); expect(releaseContents, isNot(contains('Pods-Runner/Pods-Runner.release'))); expect(releaseContents, equals(flavorReleaseInclude)); }); }); group('Update xcconfig', () { testUsingContext('includes Pod config in xcconfig files, if the user manually added Pod dependencies without using Flutter plugins', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); fileSystem.file(fileSystem.path.join('project', 'foo', '.packages')) ..createSync(recursive: true) ..writeAsStringSync('\n'); projectUnderTest.ios.podfile..createSync()..writeAsStringSync('Custom Podfile'); projectUnderTest.ios.podfileLock..createSync()..writeAsStringSync('Podfile.lock from user executed `pod install`'); projectUnderTest.packagesFile..createSync()..writeAsStringSync(''); projectUnderTest.ios.xcodeConfigFor('Debug') ..createSync(recursive: true) ..writeAsStringSync('Existing debug config'); projectUnderTest.ios.xcodeConfigFor('Release') ..createSync(recursive: true) ..writeAsStringSync('Existing release config'); final FlutterProject project = FlutterProject.fromDirectoryTest(fileSystem.directory('project')); await injectPlugins(project, iosPlatform: true); final String debugContents = projectUnderTest.ios.xcodeConfigFor('Debug').readAsStringSync(); expect(debugContents, contains( '#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"\n')); expect(debugContents, contains('Existing debug config')); final String releaseContents = projectUnderTest.ios.xcodeConfigFor('Release').readAsStringSync(); expect(releaseContents, contains( '#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"\n')); expect(releaseContents, contains('Existing release config')); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), }); }); group('Process pods', () { setUp(() { podsIsInHomeDir(); }); testUsingContext('throwsToolExit if CocoaPods is not installed', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsNotInstalled(); projectUnderTest.ios.podfile.createSync(); await expectLater(cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, ), throwsToolExit(message: 'CocoaPods not installed or not in valid state')); expect(fakeProcessManager, hasNoRemainingExpectations); expect(fakeProcessManager, hasNoRemainingExpectations); }); testUsingContext('throwsToolExit if CocoaPods install is broken', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsBroken(); projectUnderTest.ios.podfile.createSync(); await expectLater(cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, ), throwsToolExit(message: 'CocoaPods not installed or not in valid state')); expect(fakeProcessManager, hasNoRemainingExpectations); expect(fakeProcessManager, hasNoRemainingExpectations); }); testUsingContext('exits if Podfile creates the Flutter engine symlink', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); fileSystem.file(fileSystem.path.join('project', 'ios', 'Podfile')) ..createSync() ..writeAsStringSync('Existing Podfile'); final Directory symlinks = projectUnderTest.ios.symlinks ..createSync(recursive: true); symlinks.childLink('flutter').createSync('cache'); await expectLater(cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, ), throwsToolExit(message: 'Podfile is out of date')); expect(fakeProcessManager, hasNoRemainingExpectations); }); testUsingContext('exits if iOS Podfile parses .flutter-plugins', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); fileSystem.file(fileSystem.path.join('project', 'ios', 'Podfile')) ..createSync() ..writeAsStringSync("plugin_pods = parse_KV_file('../.flutter-plugins')"); await expectLater(cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, ), throwsToolExit(message: 'Podfile is out of date')); expect(fakeProcessManager, hasNoRemainingExpectations); }); testUsingContext('prints warning if macOS Podfile parses .flutter-plugins', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); fakeProcessManager.addCommands(const <FakeCommand>[ FakeCommand( command: <String>['pod', 'install', '--verbose'], ), FakeCommand( command: <String>['touch', 'project/macos/Podfile.lock'], ), ]); projectUnderTest.macos.podfile ..createSync() ..writeAsStringSync("plugin_pods = parse_KV_file('../.flutter-plugins')"); projectUnderTest.macos.podfileLock ..createSync() ..writeAsStringSync('Existing lock file.'); await cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.macos, buildMode: BuildMode.debug, ); expect(logger.warningText, contains('Warning: Podfile is out of date')); expect(logger.warningText, contains('rm macos/Podfile')); expect(fakeProcessManager, hasNoRemainingExpectations); }); testUsingContext('throws, if Podfile is missing.', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); await expectLater(cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, ), throwsToolExit(message: 'Podfile missing')); expect(fakeProcessManager, hasNoRemainingExpectations); }); testUsingContext('throws, if specs repo is outdated.', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); fileSystem.file(fileSystem.path.join('project', 'ios', 'Podfile')) ..createSync() ..writeAsStringSync('Existing Podfile'); fakeProcessManager.addCommand( const FakeCommand( command: <String>['pod', 'install', '--verbose'], workingDirectory: 'project/ios', environment: <String, String>{ 'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8', }, exitCode: 1, // This output is the output that a real CocoaPods install would generate. stdout: ''' [!] Unable to satisfy the following requirements: - `Firebase/Auth` required by `Podfile` - `Firebase/Auth (= 4.0.0)` required by `Podfile.lock` None of your spec sources contain a spec satisfying the dependencies: `Firebase/Auth, Firebase/Auth (= 4.0.0)`. You have either: * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`. * mistyped the name or version. * not added the source repo that hosts the Podspec to your Podfile. Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.''', ), ); await expectLater(cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, ), throwsToolExit()); expect( logger.errorText, contains("CocoaPods's specs repository is too out-of-date to satisfy dependencies"), ); }); testUsingContext('throws if plugin requires higher minimum iOS version using "platform"', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); fileSystem.file(fileSystem.path.join('project', 'ios', 'Podfile')) ..createSync() ..writeAsStringSync('Existing Podfile'); const String fakePluginName = 'some_plugin'; final File podspec = projectUnderTest.ios.symlinks .childDirectory('plugins') .childDirectory(fakePluginName) .childDirectory('ios') .childFile('$fakePluginName.podspec'); podspec.createSync(recursive: true); podspec.writeAsStringSync(''' Pod::Spec.new do |s| s.name = '$fakePluginName' s.version = '0.0.1' s.summary = 'A plugin' s.source_files = 'Classes/**/*.{h,m}' s.dependency 'Flutter' s.static_framework = true s.platform = :ios, '15.0' end'''); fakeProcessManager.addCommand( FakeCommand( command: const <String>['pod', 'install', '--verbose'], workingDirectory: 'project/ios', environment: const <String, String>{ 'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8', }, exitCode: 1, stdout: _fakeHigherMinimumIOSVersionPodInstallOutput(fakePluginName), ), ); await expectLater(cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, ), throwsToolExit()); expect( logger.errorText, contains( 'The plugin "$fakePluginName" requires a higher minimum iOS ' 'deployment version than your application is targeting.' ), ); // The error should contain specific instructions for fixing the build // based on parsing the plugin's podspec. expect( logger.errorText, contains( "To build, increase your application's deployment target to at least " '15.0 as described at https://docs.flutter.dev/deployment/ios' ), ); }); testUsingContext('throws if plugin requires higher minimum iOS version using "deployment_target"', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); fileSystem.file(fileSystem.path.join('project', 'ios', 'Podfile')) ..createSync() ..writeAsStringSync('Existing Podfile'); const String fakePluginName = 'some_plugin'; final File podspec = projectUnderTest.ios.symlinks .childDirectory('plugins') .childDirectory(fakePluginName) .childDirectory('ios') .childFile('$fakePluginName.podspec'); podspec.createSync(recursive: true); podspec.writeAsStringSync(''' Pod::Spec.new do |s| s.name = '$fakePluginName' s.version = '0.0.1' s.summary = 'A plugin' s.source_files = 'Classes/**/*.{h,m}' s.dependency 'Flutter' s.static_framework = true s.ios.deployment_target = '15.0' end'''); fakeProcessManager.addCommand( FakeCommand( command: const <String>['pod', 'install', '--verbose'], workingDirectory: 'project/ios', environment: const <String, String>{ 'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8', }, exitCode: 1, stdout: _fakeHigherMinimumIOSVersionPodInstallOutput(fakePluginName), ), ); await expectLater(cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, ), throwsToolExit()); expect( logger.errorText, contains( 'The plugin "$fakePluginName" requires a higher minimum iOS ' 'deployment version than your application is targeting.' ), ); // The error should contain specific instructions for fixing the build // based on parsing the plugin's podspec. expect( logger.errorText, contains( "To build, increase your application's deployment target to at least " '15.0 as described at https://docs.flutter.dev/deployment/ios' ), ); }); testUsingContext('throws if plugin requires higher minimum iOS version with darwin layout', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); fileSystem.file(fileSystem.path.join('project', 'ios', 'Podfile')) ..createSync() ..writeAsStringSync('Existing Podfile'); const String fakePluginName = 'some_plugin'; final File podspec = projectUnderTest.ios.symlinks .childDirectory('plugins') .childDirectory(fakePluginName) .childDirectory('darwin') .childFile('$fakePluginName.podspec'); podspec.createSync(recursive: true); podspec.writeAsStringSync(''' Pod::Spec.new do |s| s.name = '$fakePluginName' s.version = '0.0.1' s.summary = 'A plugin' s.source_files = 'Classes/**/*.{h,m}' s.dependency 'Flutter' s.static_framework = true s.osx.deployment_target = '10.15' s.ios.deployment_target = '15.0' end'''); fakeProcessManager.addCommand( FakeCommand( command: const <String>['pod', 'install', '--verbose'], workingDirectory: 'project/ios', environment: const <String, String>{ 'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8', }, exitCode: 1, stdout: _fakeHigherMinimumIOSVersionPodInstallOutput(fakePluginName, subdir: 'darwin'), ), ); await expectLater(cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, ), throwsToolExit()); expect( logger.errorText, contains( 'The plugin "$fakePluginName" requires a higher minimum iOS ' 'deployment version than your application is targeting.' ), ); // The error should contain specific instructions for fixing the build // based on parsing the plugin's podspec. expect( logger.errorText, contains( "To build, increase your application's deployment target to at least " '15.0 as described at https://docs.flutter.dev/deployment/ios' ), ); }); testUsingContext('throws if plugin requires unknown higher minimum iOS version', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); fileSystem.file(fileSystem.path.join('project', 'ios', 'Podfile')) ..createSync() ..writeAsStringSync('Existing Podfile'); const String fakePluginName = 'some_plugin'; final File podspec = projectUnderTest.ios.symlinks .childDirectory('plugins') .childDirectory(fakePluginName) .childDirectory('ios') .childFile('$fakePluginName.podspec'); podspec.createSync(recursive: true); // It's very unlikely that someone would actually ever do anything like // this, but arbitrary code is possible, so test that if it's not what // the error handler parsing expects, a fallback is used. podspec.writeAsStringSync(''' Pod::Spec.new do |s| s.name = '$fakePluginName' s.version = '0.0.1' s.summary = 'A plugin' s.source_files = 'Classes/**/*.{h,m}' s.dependency 'Flutter' s.static_framework = true version_var = '15.0' s.platform = :ios, version_var end'''); fakeProcessManager.addCommand( FakeCommand( command: const <String>['pod', 'install', '--verbose'], workingDirectory: 'project/ios', environment: const <String, String>{ 'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8', }, exitCode: 1, stdout: _fakeHigherMinimumIOSVersionPodInstallOutput(fakePluginName), ), ); await expectLater(cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, ), throwsToolExit()); expect( logger.errorText, contains( 'The plugin "$fakePluginName" requires a higher minimum iOS ' 'deployment version than your application is targeting.' ), ); // The error should contain non-specific instructions for fixing the build // and note that the minimum version could not be determined. expect( logger.errorText, contains( "To build, increase your application's deployment target as " 'described at https://docs.flutter.dev/deployment/ios', ), ); expect( logger.errorText, contains( 'The minimum required version for "$fakePluginName" could not be ' 'determined', ), ); }); testUsingContext('throws if plugin has a dependency that requires a higher minimum iOS version', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); fileSystem.file(fileSystem.path.join('project', 'ios', 'Podfile')) ..createSync() ..writeAsStringSync('Existing Podfile'); fakeProcessManager.addCommand( const FakeCommand( command: <String>['pod', 'install', '--verbose'], workingDirectory: 'project/ios', environment: <String, String>{ 'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8', }, exitCode: 1, // This is the (very slightly abridged) output from updating the // minimum version of the GoogleMaps dependency in // google_maps_flutter_ios without updating the minimum iOS version to // match, as an example of a misconfigured plugin. stdout: ''' Analyzing dependencies Inspecting targets to integrate Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``) Using `ARCHS` setting to build architectures of target `Pods-RunnerTests`: (``) Fetching external sources -> Fetching podspec for `Flutter` from `Flutter` -> Fetching podspec for `google_maps_flutter_ios` from `.symlinks/plugins/google_maps_flutter_ios/ios` Resolving dependencies of `Podfile` CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: Specs/a/d/d/GoogleMaps/8.0.0/GoogleMaps.podspec.json exists! Returning local because checking is only performed in repo update [!] CocoaPods could not find compatible versions for pod "GoogleMaps": In Podfile: google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`) was resolved to 0.0.1, which depends on GoogleMaps (~> 8.0) Specs satisfying the `GoogleMaps (~> 8.0)` dependency were found, but they required a higher minimum deployment target.''', ), ); await expectLater(cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, ), throwsToolExit()); expect( logger.errorText, contains( 'The pod "GoogleMaps" required by the plugin "google_maps_flutter_ios" ' "requires a higher minimum iOS deployment version than the plugin's " 'reported minimum version.' ), ); // The error should tell the user to contact the plugin author, as this // case is hard for us to give exact advice on, and should only be // possible if there's a mistake in the plugin's podspec. expect( logger.errorText, contains( 'To build, remove the plugin "google_maps_flutter_ios", or contact ' "the plugin's developers for assistance.", ), ); }); testUsingContext('throws if plugin requires higher minimum macOS version using "platform"', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); fileSystem.file(fileSystem.path.join('project', 'macos', 'Podfile')) ..createSync() ..writeAsStringSync('Existing Podfile'); const String fakePluginName = 'some_plugin'; final File podspec = projectUnderTest.macos.ephemeralDirectory .childDirectory('.symlinks') .childDirectory('plugins') .childDirectory(fakePluginName) .childDirectory('macos') .childFile('$fakePluginName.podspec'); podspec.createSync(recursive: true); podspec.writeAsStringSync(''' Pod::Spec.new do |spec| spec.name = '$fakePluginName' spec.version = '0.0.1' spec.summary = 'A plugin' spec.source_files = 'Classes/**/*.swift' spec.dependency 'FlutterMacOS' spec.static_framework = true spec.platform = :osx, "12.7" end'''); fakeProcessManager.addCommand( FakeCommand( command: const <String>['pod', 'install', '--verbose'], workingDirectory: 'project/macos', environment: const <String, String>{ 'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8', }, exitCode: 1, stdout: _fakeHigherMinimumMacOSVersionPodInstallOutput(fakePluginName), ), ); await expectLater(cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.macos, buildMode: BuildMode.debug, ), throwsToolExit()); expect( logger.errorText, contains( 'The plugin "$fakePluginName" requires a higher minimum macOS ' 'deployment version than your application is targeting.' ), ); // The error should contain specific instructions for fixing the build // based on parsing the plugin's podspec. expect( logger.errorText, contains( "To build, increase your application's deployment target to at least " '12.7 as described at https://docs.flutter.dev/deployment/macos' ), ); }); testUsingContext('throws if plugin requires higher minimum macOS version using "deployment_target"', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); fileSystem.file(fileSystem.path.join('project', 'macos', 'Podfile')) ..createSync() ..writeAsStringSync('Existing Podfile'); const String fakePluginName = 'some_plugin'; final File podspec = projectUnderTest.macos.ephemeralDirectory .childDirectory('.symlinks') .childDirectory('plugins') .childDirectory(fakePluginName) .childDirectory('macos') .childFile('$fakePluginName.podspec'); podspec.createSync(recursive: true); podspec.writeAsStringSync(''' Pod::Spec.new do |spec| spec.name = '$fakePluginName' spec.version = '0.0.1' spec.summary = 'A plugin' spec.source_files = 'Classes/**/*.{h,m}' spec.dependency 'Flutter' spec.static_framework = true spec.osx.deployment_target = '12.7' end'''); fakeProcessManager.addCommand( FakeCommand( command: const <String>['pod', 'install', '--verbose'], workingDirectory: 'project/macos', environment: const <String, String>{ 'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8', }, exitCode: 1, stdout: _fakeHigherMinimumMacOSVersionPodInstallOutput(fakePluginName), ), ); await expectLater(cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.macos, buildMode: BuildMode.debug, ), throwsToolExit()); expect( logger.errorText, contains( 'The plugin "$fakePluginName" requires a higher minimum macOS ' 'deployment version than your application is targeting.' ), ); // The error should contain specific instructions for fixing the build // based on parsing the plugin's podspec. expect( logger.errorText, contains( "To build, increase your application's deployment target to at least " '12.7 as described at https://docs.flutter.dev/deployment/macos' ), ); }); final Map<String, String> possibleErrors = <String, String>{ 'symbol not found': 'LoadError - dlsym(0x7fbbeb6837d0, Init_ffi_c): symbol not found - /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle', 'incompatible architecture': "LoadError - (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/ffi_c.bundle' (no such file) - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle", 'bus error': '/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi/library.rb:275: [BUG] Bus Error at 0x000000010072c000', }; possibleErrors.forEach((String errorName, String cocoaPodsError) { void testToolExitsWithCocoapodsMessage(_StdioStream outputStream) { final String streamName = outputStream == _StdioStream.stdout ? 'stdout' : 'stderr'; testUsingContext('ffi $errorName failure to $streamName on ARM macOS prompts gem install', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); fileSystem.file(fileSystem.path.join('project', 'ios', 'Podfile')) ..createSync() ..writeAsStringSync('Existing Podfile'); fakeProcessManager.addCommands(<FakeCommand>[ FakeCommand( command: const <String>['pod', 'install', '--verbose'], workingDirectory: 'project/ios', environment: const <String, String>{ 'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8', }, exitCode: 1, stdout: outputStream == _StdioStream.stdout ? cocoaPodsError : '', stderr: outputStream == _StdioStream.stderr ? cocoaPodsError : '', ), const FakeCommand( command: <String>['which', 'sysctl'], ), const FakeCommand( command: <String>['sysctl', 'hw.optional.arm64'], stdout: 'hw.optional.arm64: 1', ), ]); await expectToolExitLater( cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, ), equals('Error running pod install'), ); expect( logger.errorText, contains('set up CocoaPods for ARM macOS'), ); expect( logger.errorText, contains('enable-libffi-alloc'), ); expect(usage.events, contains(const TestUsageEvent('pod-install-failure', 'arm-ffi'))); expect(fakeAnalytics.sentEvents, contains(Event.appleUsageEvent(workflow: 'pod-install-failure', parameter: 'arm-ffi'))); }); } testToolExitsWithCocoapodsMessage(_StdioStream.stdout); testToolExitsWithCocoapodsMessage(_StdioStream.stderr); }); testUsingContext('ffi failure on x86 macOS does not prompt gem install', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); fileSystem.file(fileSystem.path.join('project', 'ios', 'Podfile')) ..createSync() ..writeAsStringSync('Existing Podfile'); fakeProcessManager.addCommands(<FakeCommand>[ const FakeCommand( command: <String>['pod', 'install', '--verbose'], workingDirectory: 'project/ios', environment: <String, String>{ 'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8', }, exitCode: 1, stderr: 'LoadError - dlsym(0x7fbbeb6837d0, Init_ffi_c): symbol not found - /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle', ), const FakeCommand( command: <String>['which', 'sysctl'], ), const FakeCommand( command: <String>['sysctl', 'hw.optional.arm64'], exitCode: 1, ), ]); // Capture Usage.test() events. final StringBuffer buffer = await capturedConsolePrint(() => expectToolExitLater( cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, ), equals('Error running pod install'), )); expect( logger.errorText, isNot(contains('ARM macOS')), ); expect(buffer.isEmpty, true); }); testUsingContext('run pod install, if Podfile.lock is missing', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); projectUnderTest.ios.podfile ..createSync() ..writeAsStringSync('Existing Podfile'); projectUnderTest.ios.podManifestLock ..createSync(recursive: true) ..writeAsStringSync('Existing lock file.'); fakeProcessManager.addCommands(const <FakeCommand>[ FakeCommand( command: <String>['pod', 'install', '--verbose'], workingDirectory: 'project/ios', environment: <String, String>{'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8'}, ), ]); final bool didInstall = await cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, dependenciesChanged: false, ); expect(didInstall, isTrue); expect(fakeProcessManager, hasNoRemainingExpectations); }); testUsingContext('runs iOS pod install, if Manifest.lock is missing', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); projectUnderTest.ios.podfile ..createSync() ..writeAsStringSync('Existing Podfile'); projectUnderTest.ios.podfileLock ..createSync() ..writeAsStringSync('Existing lock file.'); fakeProcessManager.addCommands(const <FakeCommand>[ FakeCommand( command: <String>['pod', 'install', '--verbose'], workingDirectory: 'project/ios', environment: <String, String>{'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8'}, ), FakeCommand( command: <String>['touch', 'project/ios/Podfile.lock'], ), ]); final bool didInstall = await cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, dependenciesChanged: false, ); expect(didInstall, isTrue); expect(fakeProcessManager, hasNoRemainingExpectations); }); testUsingContext('runs macOS pod install, if Manifest.lock is missing', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); projectUnderTest.macos.podfile ..createSync() ..writeAsStringSync('Existing Podfile'); projectUnderTest.macos.podfileLock ..createSync() ..writeAsStringSync('Existing lock file.'); fakeProcessManager.addCommands(const <FakeCommand>[ FakeCommand( command: <String>['pod', 'install', '--verbose'], workingDirectory: 'project/macos', environment: <String, String>{'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8'}, ), FakeCommand( command: <String>['touch', 'project/macos/Podfile.lock'], ), ]); final bool didInstall = await cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.macos, buildMode: BuildMode.debug, dependenciesChanged: false, ); expect(didInstall, isTrue); expect(fakeProcessManager, hasNoRemainingExpectations); }); testUsingContext('runs pod install, if Manifest.lock different from Podspec.lock', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); projectUnderTest.ios.podfile ..createSync() ..writeAsStringSync('Existing Podfile'); projectUnderTest.ios.podfileLock ..createSync() ..writeAsStringSync('Existing lock file.'); projectUnderTest.ios.podManifestLock ..createSync(recursive: true) ..writeAsStringSync('Different lock file.'); fakeProcessManager.addCommands(const <FakeCommand>[ FakeCommand( command: <String>['pod', 'install', '--verbose'], workingDirectory: 'project/ios', environment: <String, String>{'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8'}, ), FakeCommand( command: <String>['touch', 'project/ios/Podfile.lock'], ), ]); final bool didInstall = await cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, dependenciesChanged: false, ); expect(didInstall, isTrue); expect(fakeProcessManager, hasNoRemainingExpectations); }); testUsingContext('runs pod install, if flutter framework changed', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); projectUnderTest.ios.podfile ..createSync() ..writeAsStringSync('Existing Podfile'); projectUnderTest.ios.podfileLock ..createSync() ..writeAsStringSync('Existing lock file.'); projectUnderTest.ios.podManifestLock ..createSync(recursive: true) ..writeAsStringSync('Existing lock file.'); fakeProcessManager.addCommands(const <FakeCommand>[ FakeCommand( command: <String>['pod', 'install', '--verbose'], workingDirectory: 'project/ios', environment: <String, String>{'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8'}, ), FakeCommand( command: <String>['touch', 'project/ios/Podfile.lock'], ), ]); final bool didInstall = await cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, ); expect(didInstall, isTrue); expect(fakeProcessManager, hasNoRemainingExpectations); expect(logger.traceText, contains('CocoaPods Pods-Runner-frameworks.sh script not found')); }); testUsingContext('runs CocoaPods Pod runner script migrator', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); projectUnderTest.ios.podfile ..createSync() ..writeAsStringSync('Existing Podfile'); projectUnderTest.ios.podfileLock ..createSync() ..writeAsStringSync('Existing lock file.'); projectUnderTest.ios.podManifestLock ..createSync(recursive: true) ..writeAsStringSync('Existing lock file.'); projectUnderTest.ios.podRunnerFrameworksScript ..createSync(recursive: true) ..writeAsStringSync(r'source="$(readlink "${source}")"'); fakeProcessManager.addCommands(const <FakeCommand>[ FakeCommand( command: <String>['pod', 'install', '--verbose'], workingDirectory: 'project/ios', environment: <String, String>{'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8'}, ), FakeCommand( command: <String>['touch', 'project/ios/Podfile.lock'], ), ]); final CocoaPods cocoaPodsUnderTestXcode143 = CocoaPods( fileSystem: fileSystem, processManager: fakeProcessManager, logger: logger, platform: FakePlatform(operatingSystem: 'macos'), xcodeProjectInterpreter: XcodeProjectInterpreter.test(processManager: fakeProcessManager, version: Version(14, 3, 0)), usage: usage, analytics: fakeAnalytics, ); final bool didInstall = await cocoaPodsUnderTestXcode143.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, ); expect(didInstall, isTrue); expect(fakeProcessManager, hasNoRemainingExpectations); // Now has readlink -f flag. expect(projectUnderTest.ios.podRunnerFrameworksScript.readAsStringSync(), contains(r'source="$(readlink -f "${source}")"')); expect(logger.statusText, contains('Upgrading Pods-Runner-frameworks.sh')); }); testUsingContext('runs pod install, if Podfile.lock is older than Podfile', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); projectUnderTest.ios.podfile ..createSync() ..writeAsStringSync('Existing Podfile'); projectUnderTest.ios.podfileLock ..createSync() ..writeAsStringSync('Existing lock file.'); projectUnderTest.ios.podManifestLock ..createSync(recursive: true) ..writeAsStringSync('Existing lock file.'); await Future<void>.delayed(const Duration(milliseconds: 10)); projectUnderTest.ios.podfile .writeAsStringSync('Updated Podfile'); fakeProcessManager.addCommands(const <FakeCommand>[ FakeCommand( command: <String>['pod', 'install', '--verbose'], workingDirectory: 'project/ios', environment: <String, String>{'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8'}, ), FakeCommand( command: <String>['touch', 'project/ios/Podfile.lock'], ), ]); await cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, dependenciesChanged: false, ); expect(fakeProcessManager, hasNoRemainingExpectations); }); testUsingContext('skips pod install, if nothing changed', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); projectUnderTest.ios.podfile ..createSync() ..writeAsStringSync('Existing Podfile'); projectUnderTest.ios.podfileLock ..createSync() ..writeAsStringSync('Existing lock file.'); projectUnderTest.ios.podManifestLock ..createSync(recursive: true) ..writeAsStringSync('Existing lock file.'); final bool didInstall = await cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, dependenciesChanged: false, ); expect(didInstall, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations); }); testUsingContext('a failed pod install deletes Pods/Manifest.lock', () async { final FlutterProject projectUnderTest = setupProjectUnderTest(); pretendPodIsInstalled(); pretendPodVersionIs('100.0.0'); projectUnderTest.ios.podfile ..createSync() ..writeAsStringSync('Existing Podfile'); projectUnderTest.ios.podfileLock ..createSync() ..writeAsStringSync('Existing lock file.'); projectUnderTest.ios.podManifestLock ..createSync(recursive: true) ..writeAsStringSync('Existing lock file.'); fakeProcessManager.addCommand( const FakeCommand( command: <String>['pod', 'install', '--verbose'], workingDirectory: 'project/ios', environment: <String, String>{'COCOAPODS_DISABLE_STATS': 'true', 'LANG': 'en_US.UTF-8'}, exitCode: 1, ), ); await expectLater(cocoaPodsUnderTest.processPods( xcodeProject: projectUnderTest.ios, buildMode: BuildMode.debug, ), throwsToolExit(message: 'Error running pod install')); expect(projectUnderTest.ios.podManifestLock.existsSync(), isFalse); }); }); } String _fakeHigherMinimumIOSVersionPodInstallOutput(String fakePluginName, {String subdir = 'ios'}) { return ''' Preparing Analyzing dependencies Inspecting targets to integrate Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``) Using `ARCHS` setting to build architectures of target `Pods-RunnerTests`: (``) Fetching external sources -> Fetching podspec for `Flutter` from `Flutter` -> Fetching podspec for `$fakePluginName` from `.symlinks/plugins/$fakePluginName/$subdir` -> Fetching podspec for `another_plugin` from `.symlinks/plugins/another_plugin/ios` Resolving dependencies of `Podfile` CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update [!] CocoaPods could not find compatible versions for pod "$fakePluginName": In Podfile: $fakePluginName (from `.symlinks/plugins/$fakePluginName/$subdir`) Specs satisfying the `$fakePluginName (from `.symlinks/plugins/$fakePluginName/subdir`)` dependency were found, but they required a higher minimum deployment target.'''; } String _fakeHigherMinimumMacOSVersionPodInstallOutput(String fakePluginName, {String subdir = 'macos'}) { return ''' Preparing Analyzing dependencies Inspecting targets to integrate Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``) Using `ARCHS` setting to build architectures of target `Pods-RunnerTests`: (``) Fetching external sources -> Fetching podspec for `FlutterMacOS` from `Flutter/ephemeral` -> Fetching podspec for `$fakePluginName` from `Flutter/ephemeral/.symlinks/plugins/$fakePluginName/$subdir` -> Fetching podspec for `another_plugin` from `Flutter/ephemeral/.symlinks/plugins/another_plugin/macos` Resolving dependencies of `Podfile` CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update [!] CocoaPods could not find compatible versions for pod "$fakePluginName": In Podfile: $fakePluginName (from `Flutter/ephemeral/.symlinks/plugins/$fakePluginName/$subdir`) Specs satisfying the `$fakePluginName (from `Flutter/ephemeral/.symlinks/plugins/$fakePluginName/$subdir`)` dependency were found, but they required a higher minimum deployment target.'''; } class FakeXcodeProjectInterpreter extends Fake implements XcodeProjectInterpreter { FakeXcodeProjectInterpreter({this.isInstalled = true, this.buildSettings = const <String, String>{}}); @override final bool isInstalled; @override Future<Map<String, String>> getBuildSettings( String projectPath, { XcodeProjectBuildContext? buildContext, Duration timeout = const Duration(minutes: 1), }) async => buildSettings; final Map<String, String> buildSettings; }
flutter/packages/flutter_tools/test/general.shard/macos/cocoapods_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/macos/cocoapods_test.dart", "repo_id": "flutter", "token_count": 21906 }
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 'package:file/file.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/android/android_sdk.dart'; import 'package:flutter_tools/src/android/android_studio.dart'; import 'package:flutter_tools/src/android/gradle_utils.dart' as gradle_utils; import 'package:flutter_tools/src/android/java.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/version.dart'; import 'package:flutter_tools/src/build_info.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/convert.dart'; import 'package:flutter_tools/src/features.dart'; import 'package:flutter_tools/src/flutter_manifest.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/xcodeproj.dart'; import 'package:flutter_tools/src/project.dart'; import 'package:meta/meta.dart'; import 'package:test/fake.dart'; import '../src/common.dart'; import '../src/context.dart'; import '../src/fakes.dart'; void main() { // TODO(zanderso): remove once FlutterProject is fully refactored. // this is safe since no tests have expectations on the test logger. final BufferLogger logger = BufferLogger.test(); group('Project', () { group('construction', () { testWithoutContext('invalid utf8 throws a tool exit', () { final FileSystem fileSystem = MemoryFileSystem.test(); final FlutterProjectFactory projectFactory = FlutterProjectFactory( fileSystem: fileSystem, logger: BufferLogger.test(), ); fileSystem.file('pubspec.yaml').writeAsBytesSync(<int>[0xFFFE]); /// Technically this should throw a FileSystemException but this is /// currently a bug in package:file. expect( () => projectFactory.fromDirectory(fileSystem.currentDirectory), throwsToolExit(), ); }); _testInMemory('fails on invalid pubspec.yaml', () async { final Directory directory = globals.fs.directory('myproject'); directory.childFile('pubspec.yaml') ..createSync(recursive: true) ..writeAsStringSync(invalidPubspec); expect( () => FlutterProject.fromDirectory(directory), throwsToolExit(), ); }); _testInMemory('fails on pubspec.yaml parse failure', () async { final Directory directory = globals.fs.directory('myproject'); directory.childFile('pubspec.yaml') ..createSync(recursive: true) ..writeAsStringSync(parseErrorPubspec); expect( () => FlutterProject.fromDirectory(directory), throwsToolExit(), ); }); _testInMemory('fails on invalid example/pubspec.yaml', () async { final Directory directory = globals.fs.directory('myproject'); directory.childDirectory('example').childFile('pubspec.yaml') ..createSync(recursive: true) ..writeAsStringSync(invalidPubspec); expect( () => FlutterProject.fromDirectory(directory), throwsToolExit(), ); }); _testInMemory('treats missing pubspec.yaml as empty', () async { final Directory directory = globals.fs.directory('myproject') ..createSync(recursive: true); expect(FlutterProject.fromDirectory(directory).manifest.isEmpty, true, ); }); _testInMemory('reads valid pubspec.yaml', () async { final Directory directory = globals.fs.directory('myproject'); directory.childFile('pubspec.yaml') ..createSync(recursive: true) ..writeAsStringSync(validPubspec); expect( FlutterProject.fromDirectory(directory).manifest.appName, 'hello', ); }); _testInMemory('reads dependencies from pubspec.yaml', () async { final Directory directory = globals.fs.directory('myproject'); directory.childFile('pubspec.yaml') ..createSync(recursive: true) ..writeAsStringSync(validPubspecWithDependencies); expect( FlutterProject.fromDirectory(directory).manifest.dependencies, <String>{'plugin_a', 'plugin_b'}, ); }); _testInMemory('sets up location', () async { final Directory directory = globals.fs.directory('myproject'); expect( FlutterProject.fromDirectory(directory).directory.absolute.path, directory.absolute.path, ); expect( FlutterProject.fromDirectoryTest(directory).directory.absolute.path, directory.absolute.path, ); expect( FlutterProject.current().directory.absolute.path, globals.fs.currentDirectory.absolute.path, ); }); }); group('ensure ready for platform-specific tooling', () { _testInMemory('does nothing, if project is not created', () async { final FlutterProject project = FlutterProject( globals.fs.directory('not_created'), FlutterManifest.empty(logger: logger), FlutterManifest.empty(logger: logger), ); await project.regeneratePlatformSpecificTooling(); expectNotExists(project.directory); }); _testInMemory('does nothing in plugin or package root project', () async { final FlutterProject project = await aPluginProject(); await project.regeneratePlatformSpecificTooling(); expectNotExists(project.ios.hostAppRoot.childDirectory('Runner').childFile('GeneratedPluginRegistrant.h')); expectNotExists(androidPluginRegistrant(project.android.hostAppGradleRoot.childDirectory('app'))); expectNotExists(project.ios.hostAppRoot.childDirectory('Flutter').childFile('Generated.xcconfig')); expectNotExists(project.android.hostAppGradleRoot.childFile('local.properties')); }); _testInMemory('works if there is an "example" folder', () async { final FlutterProject project = await someProject(); // The presence of an "example" folder used to be used as an indicator // that a project was a plugin, but shouldn't be as this creates false // positives. project.directory.childDirectory('example').createSync(); await project.regeneratePlatformSpecificTooling(); expectExists(project.ios.hostAppRoot.childDirectory('Runner').childFile('GeneratedPluginRegistrant.h')); expectExists(androidPluginRegistrant(project.android.hostAppGradleRoot.childDirectory('app'))); expectExists(project.ios.hostAppRoot.childDirectory('Flutter').childFile('Generated.xcconfig')); expectExists(project.android.hostAppGradleRoot.childFile('local.properties')); }); _testInMemory('injects plugins for iOS', () async { final FlutterProject project = await someProject(); await project.regeneratePlatformSpecificTooling(); expectExists(project.ios.hostAppRoot.childDirectory('Runner').childFile('GeneratedPluginRegistrant.h')); }); _testInMemory('generates Xcode configuration for iOS', () async { final FlutterProject project = await someProject(); await project.regeneratePlatformSpecificTooling(); expectExists(project.ios.hostAppRoot.childDirectory('Flutter').childFile('Generated.xcconfig')); }); _testInMemory('injects plugins for Android', () async { final FlutterProject project = await someProject(); await project.regeneratePlatformSpecificTooling(); expectExists(androidPluginRegistrant(project.android.hostAppGradleRoot.childDirectory('app'))); }); _testInMemory('updates local properties for Android', () async { final FlutterProject project = await someProject(); await project.regeneratePlatformSpecificTooling(); expectExists(project.android.hostAppGradleRoot.childFile('local.properties')); }); _testInMemory('checkForDeprecation fails on invalid android app manifest file', () async { // This is not a valid Xml document const String invalidManifest = '<manifest></application>'; final FlutterProject project = await someProject(androidManifestOverride: invalidManifest, includePubspec: true); expect( () => project.checkForDeprecation(deprecationBehavior: DeprecationBehavior.ignore), throwsToolExit(message: 'Please ensure that the android manifest is a valid XML document and try again.'), ); }); _testInMemory('Project not on v2 embedding does not warn if deprecation status is irrelevant', () async { final FlutterProject project = await someProject(includePubspec: true); // The default someProject with an empty <manifest> already indicates // v1 embedding, as opposed to having <meta-data // android:name="flutterEmbedding" android:value="2" />. // Default is "DeprecationBehavior.none" project.checkForDeprecation(); expect(testLogger.statusText, isEmpty); }); _testInMemory('Android project no pubspec continues', () async { final FlutterProject project = await someProject(); // The default someProject with an empty <manifest> already indicates // v1 embedding, as opposed to having <meta-data // android:name="flutterEmbedding" android:value="2" />. project.checkForDeprecation(deprecationBehavior: DeprecationBehavior.ignore); expect(testLogger.statusText, isNot(contains('https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects'))); }); _testInMemory('Android plugin project does not throw v1 embedding deprecation warning', () async { final FlutterProject project = await aPluginProject(); project.checkForDeprecation(deprecationBehavior: DeprecationBehavior.exit); expect(testLogger.statusText, isNot(contains('https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects'))); expect(testLogger.statusText, isNot(contains('No `<meta-data android:name="flutterEmbedding" android:value="2"/>` in '))); }); _testInMemory('Android plugin without example app does not show a warning', () async { final FlutterProject project = await aPluginProject(); project.example.directory.deleteSync(); await project.regeneratePlatformSpecificTooling(); expect(testLogger.statusText, isNot(contains('https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects'))); }); _testInMemory('updates local properties for Android', () async { final FlutterProject project = await someProject(); await project.regeneratePlatformSpecificTooling(); expectExists(project.android.hostAppGradleRoot.childFile('local.properties')); }); testUsingContext('injects plugins for macOS', () async { final FlutterProject project = await someProject(); project.macos.managedDirectory.createSync(recursive: true); await project.regeneratePlatformSpecificTooling(); expectExists(project.macos.pluginRegistrantImplementation); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: true), FlutterProjectFactory: () => FlutterProjectFactory( logger: logger, fileSystem: globals.fs, ), }); testUsingContext('generates Xcode configuration for macOS', () async { final FlutterProject project = await someProject(); project.macos.managedDirectory.createSync(recursive: true); await project.regeneratePlatformSpecificTooling(); expectExists(project.macos.generatedXcodePropertiesFile); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: true), FlutterProjectFactory: () => FlutterProjectFactory( logger: logger, fileSystem: globals.fs, ), }); testUsingContext('injects plugins for Linux', () async { final FlutterProject project = await someProject(); project.linux.cmakeFile.createSync(recursive: true); await project.regeneratePlatformSpecificTooling(); expectExists(project.linux.managedDirectory.childFile('generated_plugin_registrant.h')); expectExists(project.linux.managedDirectory.childFile('generated_plugin_registrant.cc')); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), FeatureFlags: () => TestFeatureFlags(isLinuxEnabled: true), FlutterProjectFactory: () => FlutterProjectFactory( logger: logger, fileSystem: globals.fs, ), }); testUsingContext('injects plugins for Windows', () async { final FlutterProject project = await someProject(); project.windows.cmakeFile.createSync(recursive: true); await project.regeneratePlatformSpecificTooling(); expectExists(project.windows.managedDirectory.childFile('generated_plugin_registrant.h')); expectExists(project.windows.managedDirectory.childFile('generated_plugin_registrant.cc')); }, overrides: <Type, Generator>{ FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), FeatureFlags: () => TestFeatureFlags(isWindowsEnabled: true), FlutterProjectFactory: () => FlutterProjectFactory( logger: logger, fileSystem: globals.fs, ), }); _testInMemory('creates Android library in module', () async { final FlutterProject project = await aModuleProject(); await project.regeneratePlatformSpecificTooling(); expectExists(project.android.hostAppGradleRoot.childFile('settings.gradle')); expectExists(project.android.hostAppGradleRoot.childFile('local.properties')); expectExists(androidPluginRegistrant(project.android.hostAppGradleRoot.childDirectory('Flutter'))); }); _testInMemory('creates iOS pod in module', () async { final FlutterProject project = await aModuleProject(); await project.regeneratePlatformSpecificTooling(); final Directory flutter = project.ios.hostAppRoot.childDirectory('Flutter'); expectExists(flutter.childFile('podhelper.rb')); expectExists(flutter.childFile('flutter_export_environment.sh')); expectExists(flutter.childFile('Generated.xcconfig')); final Directory pluginRegistrantClasses = flutter .childDirectory('FlutterPluginRegistrant') .childDirectory('Classes'); expectExists(pluginRegistrantClasses.childFile('GeneratedPluginRegistrant.h')); expectExists(pluginRegistrantClasses.childFile('GeneratedPluginRegistrant.m')); }); testUsingContext('Version.json info is correct', () { final MemoryFileSystem fileSystem = MemoryFileSystem.test(); final FlutterManifest manifest = FlutterManifest.createFromString(''' name: test version: 1.0.0+3 ''', logger: BufferLogger.test())!; final FlutterProject project = FlutterProject(fileSystem.systemTempDirectory, manifest, manifest); final Map<String, dynamic> versionInfo = jsonDecode(project.getVersionInfo()) as Map<String, dynamic>; expect(versionInfo['app_name'],'test'); expect(versionInfo['version'],'1.0.0'); expect(versionInfo['build_number'],'3'); expect(versionInfo['package_name'],'test'); }); _testInMemory('gets xcworkspace directory', () async { final FlutterProject project = await someProject(); project.ios.xcodeProject.createSync(); project.ios.hostAppRoot.childFile('._Runner.xcworkspace').createSync(recursive: true); project.ios.hostAppRoot.childFile('Runner.xcworkspace').createSync(recursive: true); expect(project.ios.xcodeWorkspace?.basename, 'Runner.xcworkspace'); }); _testInMemory('no xcworkspace directory found', () async { final FlutterProject project = await someProject(); project.ios.xcodeProject.createSync(); expect(project.ios.xcodeWorkspace?.basename, null); }); }); group('module status', () { _testInMemory('is known for module', () async { final FlutterProject project = await aModuleProject(); expect(project.isModule, isTrue); expect(project.android.isModule, isTrue); expect(project.ios.isModule, isTrue); expect(project.android.hostAppGradleRoot.basename, '.android'); expect(project.ios.hostAppRoot.basename, '.ios'); }); _testInMemory('is known for non-module', () async { final FlutterProject project = await someProject(); expect(project.isModule, isFalse); expect(project.android.isModule, isFalse); expect(project.ios.isModule, isFalse); expect(project.android.hostAppGradleRoot.basename, 'android'); expect(project.ios.hostAppRoot.basename, 'ios'); }); }); group('example', () { _testInMemory('exists for plugin in legacy format', () async { final FlutterProject project = await aPluginProject(); expect(project.isPlugin, isTrue); expect(project.hasExampleApp, isTrue); }); _testInMemory('exists for plugin in multi-platform format', () async { final FlutterProject project = await aPluginProject(legacy: false); expect(project.hasExampleApp, isTrue); }); _testInMemory('does not exist for non-plugin', () async { final FlutterProject project = await someProject(); expect(project.isPlugin, isFalse); expect(project.hasExampleApp, isFalse); }); }); group('java gradle agp compatibility', () { Future<FlutterProject?> configureGradleAgpForTest({ required String gradleV, required String agpV, }) async { final FlutterProject project = await someProject(); addRootGradleFile(project.directory, gradleFileContent: () { return ''' dependencies { classpath 'com.android.tools.build:gradle:$agpV' } '''; }); addGradleWrapperFile(project.directory, gradleV); return project; } // Tests in this group that use overrides and _testInMemory should // be placed in their own group to avoid test pollution. This is // especially important for filesystem. group('_', () { final FakeProcessManager processManager; final Java java; final AndroidStudio androidStudio; final FakeAndroidSdkWithDir androidSdk; final FileSystem fileSystem = getFileSystemForPlatform(); java = FakeJava(version: Version(17, 0, 2)); processManager = FakeProcessManager.empty(); androidStudio = FakeAndroidStudio(); androidSdk = FakeAndroidSdkWithDir(fileSystem.currentDirectory); fileSystem.currentDirectory .childDirectory(androidStudio.javaPath!) .createSync(); _testInMemory( 'flamingo values are compatible', () async { final FlutterProject? project = await configureGradleAgpForTest( gradleV: '8.0', agpV: '7.4.2', ); final CompatibilityResult value = await project!.android.hasValidJavaGradleAgpVersions(); expect(value.success, isTrue); }, java: java, androidStudio: androidStudio, processManager: processManager, androidSdk: androidSdk, ); }); group('_', () { final FakeProcessManager processManager; final Java java; final AndroidStudio androidStudio; final FakeAndroidSdkWithDir androidSdk; final FileSystem fileSystem = getFileSystemForPlatform(); java = FakeJava(version: const Version.withText(1, 8, 0, '1.8.0_242')); processManager = FakeProcessManager.empty(); androidStudio = FakeAndroidStudio(); androidSdk = FakeAndroidSdkWithDir(fileSystem.currentDirectory); fileSystem.currentDirectory .childDirectory(androidStudio.javaPath!) .createSync(); _testInMemory( 'java 8 era values are compatible', () async { final FlutterProject? project = await configureGradleAgpForTest( gradleV: '6.7.1', agpV: '4.2.0', ); final CompatibilityResult value = await project!.android.hasValidJavaGradleAgpVersions(); expect(value.success, isTrue); }, java: java, androidStudio: androidStudio, processManager: processManager, androidSdk: androidSdk, ); }); group('_', () { final FakeProcessManager processManager; final Java java; final AndroidStudio androidStudio; final FakeAndroidSdkWithDir androidSdk; final FileSystem fileSystem = getFileSystemForPlatform(); processManager = FakeProcessManager.empty(); java = FakeJava(version: Version(11, 0, 14)); androidStudio = FakeAndroidStudio(); androidSdk = FakeAndroidSdkWithDir(fileSystem.currentDirectory); fileSystem.currentDirectory .childDirectory(androidStudio.javaPath!) .createSync(); _testInMemory( 'electric eel era values are compatible', () async { final FlutterProject? project = await configureGradleAgpForTest( gradleV: '7.3.3', agpV: '7.2.0', ); final CompatibilityResult value = await project!.android.hasValidJavaGradleAgpVersions(); expect(value.success, isTrue); }, java: java, androidStudio: androidStudio, processManager: processManager, androidSdk: androidSdk, ); }); group('_', () { const String javaV = '17.0.2'; const String gradleV = '6.7.3'; const String agpV = '7.2.0'; final FakeProcessManager processManager; final Java java; final AndroidStudio androidStudio; final FakeAndroidSdkWithDir androidSdk; final FileSystem fileSystem = getFileSystemForPlatform(); processManager = FakeProcessManager.empty(); java = FakeJava(version: Version.parse(javaV)); androidStudio = FakeAndroidStudio(); androidSdk = FakeAndroidSdkWithDir(fileSystem.currentDirectory); fileSystem.currentDirectory .childDirectory(androidStudio.javaPath!) .createSync(); _testInMemory( 'incompatible everything', () async { final FlutterProject? project = await configureGradleAgpForTest( gradleV: gradleV, agpV: agpV, ); final CompatibilityResult value = await project!.android.hasValidJavaGradleAgpVersions(); expect(value.success, isFalse); // Should not have the valid string expect( value.description, isNot( contains(RegExp(AndroidProject.validJavaGradleAgpString)))); // On gradle/agp error print help url and gradle and agp versions. expect(value.description, contains(RegExp(AndroidProject.gradleAgpCompatUrl))); expect(value.description, contains(RegExp(gradleV))); expect(value.description, contains(RegExp(agpV))); // On gradle/agp error print help url and java and gradle versions. expect(value.description, contains(RegExp(AndroidProject.javaGradleCompatUrl))); expect(value.description, contains(RegExp(javaV))); expect(value.description, contains(RegExp(gradleV))); }, java: java, androidStudio: androidStudio, processManager: processManager, androidSdk: androidSdk, ); }); group('_', () { const String javaV = '17.0.2'; const String gradleV = '6.7.3'; const String agpV = '4.2.0'; final FakeProcessManager processManager; final Java java; final AndroidStudio androidStudio; final FakeAndroidSdkWithDir androidSdk; final FileSystem fileSystem = getFileSystemForPlatform(); processManager = FakeProcessManager.empty(); java = FakeJava(version: Version(17, 0, 2)); androidStudio = FakeAndroidStudio(); androidSdk = FakeAndroidSdkWithDir(fileSystem.currentDirectory); fileSystem.currentDirectory .childDirectory(androidStudio.javaPath!) .createSync(); _testInMemory( 'incompatible java/gradle only', () async { final FlutterProject? project = await configureGradleAgpForTest( gradleV: gradleV, agpV: agpV, ); final CompatibilityResult value = await project!.android.hasValidJavaGradleAgpVersions(); expect(value.success, isFalse); // Should not have the valid string. expect( value.description, isNot( contains(RegExp(AndroidProject.validJavaGradleAgpString)))); // On gradle/agp error print help url and java and gradle versions. expect(value.description, contains(RegExp(AndroidProject.javaGradleCompatUrl))); expect(value.description, contains(RegExp(javaV))); expect(value.description, contains(RegExp(gradleV))); }, java: java, androidStudio: androidStudio, processManager: processManager, androidSdk: androidSdk, ); }); group('_', () { final FakeProcessManager processManager; final Java java; final AndroidStudio androidStudio; final FakeAndroidSdkWithDir androidSdk; final FileSystem fileSystem = getFileSystemForPlatform(); java = FakeJava(version: Version(11, 0, 2)); processManager = FakeProcessManager.empty(); androidStudio = FakeAndroidStudio(); androidSdk = FakeAndroidSdkWithDir(fileSystem.currentDirectory); fileSystem.currentDirectory .childDirectory(androidStudio.javaPath!) .createSync(); _testInMemory( 'incompatible gradle/agp only', () async { const String gradleV = '7.0.3'; const String agpV = '7.1.0'; final FlutterProject? project = await configureGradleAgpForTest( gradleV: gradleV, agpV: agpV, ); final CompatibilityResult value = await project!.android.hasValidJavaGradleAgpVersions(); expect(value.success, isFalse); // Should not have the valid string. expect( value.description, isNot( contains(RegExp(AndroidProject.validJavaGradleAgpString)))); // On gradle/agp error print help url and gradle and agp versions. expect(value.description, contains(RegExp(AndroidProject.gradleAgpCompatUrl))); expect(value.description, contains(RegExp(gradleV))); expect(value.description, contains(RegExp(agpV))); }, java: java, androidStudio: androidStudio, processManager: processManager, androidSdk: androidSdk, ); }); group('_', () { final FakeProcessManager processManager; final Java java; final AndroidStudio androidStudio; final FakeAndroidSdkWithDir androidSdk; final FileSystem fileSystem = getFileSystemForPlatform(); java = FakeJava(version: Version(11, 0, 2)); processManager = FakeProcessManager.empty(); androidStudio = FakeAndroidStudio(); androidSdk = FakeAndroidSdkWithDir(fileSystem.currentDirectory); fileSystem.currentDirectory .childDirectory(androidStudio.javaPath!) .createSync(); _testInMemory( 'null agp only', () async { const String gradleV = '7.0.3'; final FlutterProject? project = await configureGradleAgpForTest( gradleV: gradleV, agpV: '', ); final CompatibilityResult value = await project!.android.hasValidJavaGradleAgpVersions(); expect(value.success, isFalse); // Should not have the valid string. expect( value.description, isNot( contains(RegExp(AndroidProject.validJavaGradleAgpString)))); // On gradle/agp error print help url null value for agp. expect(value.description, contains(RegExp(AndroidProject.gradleAgpCompatUrl))); expect(value.description, contains(RegExp(gradleV))); expect(value.description, contains(RegExp('null'))); }, java: java, androidStudio: androidStudio, processManager: processManager, androidSdk: androidSdk, ); }); }); group('language', () { late XcodeProjectInterpreter xcodeProjectInterpreter; late MemoryFileSystem fs; late FlutterProjectFactory flutterProjectFactory; setUp(() { fs = MemoryFileSystem.test(); xcodeProjectInterpreter = XcodeProjectInterpreter.test(processManager: FakeProcessManager.any()); flutterProjectFactory = FlutterProjectFactory( logger: logger, fileSystem: fs, ); }); _testInMemory('default host app language', () async { final FlutterProject project = await someProject(); expect(project.android.isKotlin, isFalse); }); testUsingContext('kotlin host app language', () async { final FlutterProject project = await someProject(); addAndroidGradleFile(project.directory, gradleFileContent: () { return ''' apply plugin: 'com.android.application' apply plugin: 'kotlin-android' '''; }); expect(project.android.isKotlin, isTrue); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), XcodeProjectInterpreter: () => xcodeProjectInterpreter, FlutterProjectFactory: () => flutterProjectFactory, }); testUsingContext('kotlin host app language with Gradle Kotlin DSL', () async { final FlutterProject project = await someProject(); addAndroidGradleFile(project.directory, kotlinDsl: true, gradleFileContent: () { return ''' plugins { id "com.android.application" id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" } '''; }); expect(project.android.isKotlin, isTrue); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), XcodeProjectInterpreter: () => xcodeProjectInterpreter, FlutterProjectFactory: () => flutterProjectFactory, }); testUsingContext('Gradle Groovy files are preferred to Gradle Kotlin files', () async { final FlutterProject project = await someProject(); addAndroidGradleFile(project.directory, gradleFileContent: () { return ''' plugins { id "com.android.application" id "dev.flutter.flutter-gradle-plugin" } '''; }); addAndroidGradleFile(project.directory, kotlinDsl: true, gradleFileContent: () { return ''' plugins { id("com.android.application") id("kotlin-android") id("dev.flutter.flutter-gradle-plugin") } '''; }); expect(project.android.isKotlin, isFalse); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), XcodeProjectInterpreter: () => xcodeProjectInterpreter, FlutterProjectFactory: () => flutterProjectFactory, }); }); group('With mocked context', () { late MemoryFileSystem fs; late FakePlistParser testPlistUtils; late FakeXcodeProjectInterpreter xcodeProjectInterpreter; late FlutterProjectFactory flutterProjectFactory; setUp(() { fs = MemoryFileSystem.test(); testPlistUtils = FakePlistParser(); xcodeProjectInterpreter = FakeXcodeProjectInterpreter(); flutterProjectFactory = FlutterProjectFactory( fileSystem: fs, logger: logger, ); }); void testWithMocks(String description, Future<void> Function() testMethod) { testUsingContext(description, testMethod, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), PlistParser: () => testPlistUtils, XcodeProjectInterpreter: () => xcodeProjectInterpreter, FlutterProjectFactory: () => flutterProjectFactory, }); } group('universal link', () { testWithMocks('build with flavor', () async { final FlutterProject project = await someProject(); project.ios.xcodeProject.createSync(); project.ios.defaultHostInfoPlist.createSync(recursive: true); const String entitlementFilePath = 'myEntitlement.Entitlement'; project.ios.hostAppRoot.childFile(entitlementFilePath).createSync(recursive: true); const XcodeProjectBuildContext buildContext = XcodeProjectBuildContext( target: 'Runner', configuration: 'config', ); xcodeProjectInterpreter.buildSettingsByBuildContext[buildContext] = <String, String>{ IosProject.kProductBundleIdKey: 'io.flutter.someProject', IosProject.kTeamIdKey: 'ABC', IosProject.kEntitlementFilePathKey: entitlementFilePath, 'SUFFIX': 'suffix', }; xcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>[], <String>[], <String>['Runner'], logger); testPlistUtils.setProperty(PlistParser.kCFBundleIdentifierKey, r'$(PRODUCT_BUNDLE_IDENTIFIER).$(SUFFIX)'); testPlistUtils.setProperty( PlistParser.kAssociatedDomainsKey, <String>[ 'applinks:example.com', 'applinks:example2.com', ], ); final String outputFilePath = await project.ios.outputsUniversalLinkSettings( target: 'Runner', configuration: 'config', ); final File outputFile = fs.file(outputFilePath); final Map<String, Object?> json = jsonDecode(outputFile.readAsStringSync()) as Map<String, Object?>; expect( json['associatedDomains'], unorderedEquals( <String>[ 'example.com', 'example2.com', ], ), ); expect(json['teamIdentifier'], 'ABC'); expect(json['bundleIdentifier'], 'io.flutter.someProject.suffix'); }); testWithMocks('can handle entitlement file in nested directory structure.', () async { final FlutterProject project = await someProject(); project.ios.xcodeProject.createSync(); project.ios.defaultHostInfoPlist.createSync(recursive: true); const String entitlementFilePath = 'nested/somewhere/myEntitlement.Entitlement'; project.ios.hostAppRoot.childFile(entitlementFilePath).createSync(recursive: true); const XcodeProjectBuildContext buildContext = XcodeProjectBuildContext( target: 'Runner', configuration: 'config', ); xcodeProjectInterpreter.buildSettingsByBuildContext[buildContext] = <String, String>{ IosProject.kProductBundleIdKey: 'io.flutter.someProject', IosProject.kTeamIdKey: 'ABC', IosProject.kEntitlementFilePathKey: entitlementFilePath, 'SUFFIX': 'suffix', }; xcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>[], <String>[], <String>['Runner'], logger); testPlistUtils.setProperty(PlistParser.kCFBundleIdentifierKey, r'$(PRODUCT_BUNDLE_IDENTIFIER).$(SUFFIX)'); testPlistUtils.setProperty( PlistParser.kAssociatedDomainsKey, <String>[ 'applinks:example.com', 'applinks:example2.com', ], ); final String outputFilePath = await project.ios.outputsUniversalLinkSettings( target: 'Runner', configuration: 'config', ); final File outputFile = fs.file(outputFilePath); final Map<String, Object?> json = jsonDecode(outputFile.readAsStringSync()) as Map<String, Object?>; expect( json['associatedDomains'], unorderedEquals( <String>[ 'example.com', 'example2.com', ], ), ); expect(json['teamIdentifier'], 'ABC'); expect(json['bundleIdentifier'], 'io.flutter.someProject.suffix'); }); testWithMocks('return empty when no entitlement', () async { final FlutterProject project = await someProject(); project.ios.xcodeProject.createSync(); project.ios.defaultHostInfoPlist.createSync(recursive: true); const XcodeProjectBuildContext buildContext = XcodeProjectBuildContext( target: 'Runner', configuration: 'config', ); xcodeProjectInterpreter.buildSettingsByBuildContext[buildContext] = <String, String>{ IosProject.kProductBundleIdKey: 'io.flutter.someProject', IosProject.kTeamIdKey: 'ABC', }; xcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>[], <String>[], <String>['Runner'], logger); testPlistUtils.setProperty(PlistParser.kCFBundleIdentifierKey, r'$(PRODUCT_BUNDLE_IDENTIFIER)'); final String outputFilePath = await project.ios.outputsUniversalLinkSettings( target: 'Runner', configuration: 'config', ); final File outputFile = fs.file(outputFilePath); final Map<String, Object?> json = jsonDecode(outputFile.readAsStringSync()) as Map<String, Object?>; expect(json['teamIdentifier'], 'ABC'); expect(json['bundleIdentifier'], 'io.flutter.someProject'); expect(json['associatedDomains'], unorderedEquals(<String>[])); }); }); group('product bundle identifier', () { testWithMocks('null, if no build settings or plist entries', () async { final FlutterProject project = await someProject(); expect(await project.ios.productBundleIdentifier(null), isNull); }); testWithMocks('from build settings, if no plist', () async { final FlutterProject project = await someProject(); project.ios.xcodeProject.createSync(); const XcodeProjectBuildContext buildContext = XcodeProjectBuildContext(scheme: 'Runner'); xcodeProjectInterpreter.buildSettingsByBuildContext[buildContext] = <String, String>{ IosProject.kProductBundleIdKey: 'io.flutter.someProject', }; xcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>[], <String>[], <String>['Runner'], logger); expect(await project.ios.productBundleIdentifier(null), 'io.flutter.someProject'); }); testWithMocks('from project file, if no plist or build settings', () async { final FlutterProject project = await someProject(); xcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>[], <String>[], <String>['Runner'], logger); addIosProjectFile(project.directory, projectFileContent: () { return projectFileWithBundleId('io.flutter.someProject'); }); expect(await project.ios.productBundleIdentifier(null), 'io.flutter.someProject'); }); testWithMocks('from plist, if no variables', () async { final FlutterProject project = await someProject(); project.ios.defaultHostInfoPlist.createSync(recursive: true); testPlistUtils.setProperty('CFBundleIdentifier', 'io.flutter.someProject'); expect(await project.ios.productBundleIdentifier(null), 'io.flutter.someProject'); }); testWithMocks('from build settings and plist, if default variable', () async { final FlutterProject project = await someProject(); project.ios.xcodeProject.createSync(); const XcodeProjectBuildContext buildContext = XcodeProjectBuildContext(scheme: 'Runner'); xcodeProjectInterpreter.buildSettingsByBuildContext[buildContext] = <String, String>{ IosProject.kProductBundleIdKey: 'io.flutter.someProject', }; xcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>[], <String>[], <String>['Runner'], logger); testPlistUtils.setProperty('CFBundleIdentifier', r'$(PRODUCT_BUNDLE_IDENTIFIER)'); expect(await project.ios.productBundleIdentifier(null), 'io.flutter.someProject'); }); testWithMocks('from build settings and plist, by substitution', () async { final FlutterProject project = await someProject(); project.ios.xcodeProject.createSync(); project.ios.defaultHostInfoPlist.createSync(recursive: true); const XcodeProjectBuildContext buildContext = XcodeProjectBuildContext(scheme: 'Runner'); xcodeProjectInterpreter.buildSettingsByBuildContext[buildContext] = <String, String>{ IosProject.kProductBundleIdKey: 'io.flutter.someProject', 'SUFFIX': 'suffix', }; xcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>[], <String>[], <String>['Runner'], logger); testPlistUtils.setProperty('CFBundleIdentifier', r'$(PRODUCT_BUNDLE_IDENTIFIER).$(SUFFIX)'); expect(await project.ios.productBundleIdentifier(null), 'io.flutter.someProject.suffix'); }); testWithMocks('Always pass parsing org on ios project with flavors', () async { final FlutterProject project = await someProject(); addIosProjectFile(project.directory, projectFileContent: () { return projectFileWithBundleId('io.flutter.someProject', qualifier: "'"); }); project.ios.xcodeProject.createSync(); xcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>[], <String>[], <String>['free', 'paid'], logger); expect(await project.organizationNames, <String>[]); }); testWithMocks('fails with no flavor and defined schemes', () async { final FlutterProject project = await someProject(); project.ios.xcodeProject.createSync(); xcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>[], <String>[], <String>['free', 'paid'], logger); await expectToolExitLater( project.ios.productBundleIdentifier(null), contains('You must specify a --flavor option to select one of the available schemes.'), ); }); testWithMocks('handles case insensitive flavor', () async { final FlutterProject project = await someProject(); project.ios.xcodeProject.createSync(); const XcodeProjectBuildContext buildContext = XcodeProjectBuildContext(scheme: 'Free'); xcodeProjectInterpreter.buildSettingsByBuildContext[buildContext] = <String, String>{ IosProject.kProductBundleIdKey: 'io.flutter.someProject', }; xcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>[], <String>[], <String>['Free'], logger); const BuildInfo buildInfo = BuildInfo(BuildMode.debug, 'free', treeShakeIcons: false); expect(await project.ios.productBundleIdentifier(buildInfo), 'io.flutter.someProject'); }); testWithMocks('fails with flavor and default schemes', () async { final FlutterProject project = await someProject(); project.ios.xcodeProject.createSync(); xcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>[], <String>[], <String>['Runner'], logger); const BuildInfo buildInfo = BuildInfo(BuildMode.debug, 'free', treeShakeIcons: false); await expectToolExitLater( project.ios.productBundleIdentifier(buildInfo), contains('The Xcode project does not define custom schemes. You cannot use the --flavor option.'), ); }); testWithMocks('empty surrounded by quotes', () async { final FlutterProject project = await someProject(); xcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>[], <String>[], <String>['Runner'], logger); addIosProjectFile(project.directory, projectFileContent: () { return projectFileWithBundleId('', qualifier: '"'); }); expect(await project.ios.productBundleIdentifier(null), ''); }); testWithMocks('surrounded by double quotes', () async { final FlutterProject project = await someProject(); xcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>[], <String>[], <String>['Runner'], logger); addIosProjectFile(project.directory, projectFileContent: () { return projectFileWithBundleId('io.flutter.someProject', qualifier: '"'); }); expect(await project.ios.productBundleIdentifier(null), 'io.flutter.someProject'); }); testWithMocks('surrounded by single quotes', () async { final FlutterProject project = await someProject(); xcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>[], <String>[], <String>['Runner'], logger); addIosProjectFile(project.directory, projectFileContent: () { return projectFileWithBundleId('io.flutter.someProject', qualifier: "'"); }); expect(await project.ios.productBundleIdentifier(null), 'io.flutter.someProject'); }); }); }); group('application bundle name', () { late MemoryFileSystem fs; late FakeXcodeProjectInterpreter mockXcodeProjectInterpreter; setUp(() { fs = MemoryFileSystem.test(); mockXcodeProjectInterpreter = FakeXcodeProjectInterpreter(); }); testUsingContext('app product name defaults to Runner.app', () async { final FlutterProject project = await someProject(); expect(await project.ios.hostAppBundleName(null), 'Runner.app'); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), XcodeProjectInterpreter: () => mockXcodeProjectInterpreter, }); testUsingContext('app product name xcodebuild settings', () async { final FlutterProject project = await someProject(); project.ios.xcodeProject.createSync(); const XcodeProjectBuildContext buildContext = XcodeProjectBuildContext(scheme: 'Runner'); mockXcodeProjectInterpreter.buildSettingsByBuildContext[buildContext] = <String, String>{ 'FULL_PRODUCT_NAME': 'My App.app', }; mockXcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>[], <String>[], <String>['Runner'], logger); expect(await project.ios.hostAppBundleName(null), 'My App.app'); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), XcodeProjectInterpreter: () => mockXcodeProjectInterpreter, }); }); group('organization names set', () { _testInMemory('is empty, if project not created', () async { final FlutterProject project = await someProject(); expect(await project.organizationNames, isEmpty); }); _testInMemory('is empty, if no platform folders exist', () async { final FlutterProject project = await someProject(); project.directory.createSync(); expect(await project.organizationNames, isEmpty); }); _testInMemory('is populated from iOS bundle identifier', () async { final FlutterProject project = await someProject(); addIosProjectFile(project.directory, projectFileContent: () { return projectFileWithBundleId('io.flutter.someProject', qualifier: "'"); }); expect(await project.organizationNames, <String>['io.flutter']); }); _testInMemory('is populated from Android application ID', () async { final FlutterProject project = await someProject(); addAndroidGradleFile(project.directory, gradleFileContent: () { return gradleFileWithApplicationId('io.flutter.someproject'); }); expect(await project.organizationNames, <String>['io.flutter']); }); _testInMemory('is populated from iOS bundle identifier in plugin example', () async { final FlutterProject project = await someProject(); addIosProjectFile(project.example.directory, projectFileContent: () { return projectFileWithBundleId('io.flutter.someProject', qualifier: "'"); }); expect(await project.organizationNames, <String>['io.flutter']); }); _testInMemory('is populated from Android application ID in plugin example', () async { final FlutterProject project = await someProject(); addAndroidGradleFile(project.example.directory, gradleFileContent: () { return gradleFileWithApplicationId('io.flutter.someproject'); }); expect(await project.organizationNames, <String>['io.flutter']); }); _testInMemory('is populated from Android group in plugin', () async { final FlutterProject project = await someProject(); addAndroidWithGroup(project.directory, 'io.flutter.someproject'); expect(await project.organizationNames, <String>['io.flutter']); }); _testInMemory('is singleton, if sources agree', () async { final FlutterProject project = await someProject(); addIosProjectFile(project.directory, projectFileContent: () { return projectFileWithBundleId('io.flutter.someProject'); }); addAndroidGradleFile(project.directory, gradleFileContent: () { return gradleFileWithApplicationId('io.flutter.someproject'); }); expect(await project.organizationNames, <String>['io.flutter']); }); _testInMemory('is non-singleton, if sources disagree', () async { final FlutterProject project = await someProject(); addIosProjectFile(project.directory, projectFileContent: () { return projectFileWithBundleId('io.flutter.someProject'); }); addAndroidGradleFile(project.directory, gradleFileContent: () { return gradleFileWithApplicationId('io.clutter.someproject'); }); expect( await project.organizationNames, <String>['io.flutter', 'io.clutter'], ); }); }); }); group('watch companion', () { late MemoryFileSystem fs; late FakePlistParser testPlistParser; late FakeXcodeProjectInterpreter mockXcodeProjectInterpreter; late FlutterProjectFactory flutterProjectFactory; setUp(() { fs = MemoryFileSystem.test(); testPlistParser = FakePlistParser(); mockXcodeProjectInterpreter = FakeXcodeProjectInterpreter(); flutterProjectFactory = FlutterProjectFactory( fileSystem: fs, logger: logger, ); }); testUsingContext('cannot find bundle identifier', () async { final FlutterProject project = await someProject(); final XcodeProjectInfo projectInfo = XcodeProjectInfo(<String>['WatchTarget'], <String>[], <String>[], logger); expect( await project.ios.containsWatchCompanion( projectInfo: projectInfo, buildInfo: BuildInfo.debug, deviceId: '123', ), isFalse, ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), PlistParser: () => testPlistParser, XcodeProjectInterpreter: () => mockXcodeProjectInterpreter, FlutterProjectFactory: () => flutterProjectFactory, }); group('with bundle identifier', () { setUp(() { const XcodeProjectBuildContext buildContext = XcodeProjectBuildContext(scheme: 'Runner'); mockXcodeProjectInterpreter.buildSettingsByBuildContext[buildContext] = <String, String>{ IosProject.kProductBundleIdKey: 'io.flutter.someProject', }; mockXcodeProjectInterpreter.xcodeProjectInfo = XcodeProjectInfo(<String>['Runner', 'WatchTarget'], <String>[], <String>['Runner', 'WatchScheme'], logger); }); testUsingContext('no Info.plist in target', () async { final FlutterProject project = await someProject(); expect( await project.ios.containsWatchCompanion( projectInfo: mockXcodeProjectInterpreter.xcodeProjectInfo, buildInfo: BuildInfo.debug, deviceId: '123', ), isFalse, ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), PlistParser: () => testPlistParser, XcodeProjectInterpreter: () => mockXcodeProjectInterpreter, FlutterProjectFactory: () => flutterProjectFactory, }); testUsingContext('Info.plist in target does not contain WKCompanionAppBundleIdentifier', () async { final FlutterProject project = await someProject(); project.ios.hostAppRoot.childDirectory('WatchTarget').childFile('Info.plist').createSync(recursive: true); expect( await project.ios.containsWatchCompanion( projectInfo: mockXcodeProjectInterpreter.xcodeProjectInfo, buildInfo: BuildInfo.debug, deviceId: '123', ), isFalse, ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), PlistParser: () => testPlistParser, XcodeProjectInterpreter: () => mockXcodeProjectInterpreter, FlutterProjectFactory: () => flutterProjectFactory, }); testUsingContext('target WKCompanionAppBundleIdentifier is not project bundle identifier', () async { final FlutterProject project = await someProject(); project.ios.hostAppRoot.childDirectory('WatchTarget').childFile('Info.plist').createSync(recursive: true); testPlistParser.setProperty('WKCompanionAppBundleIdentifier', 'io.flutter.someOTHERproject'); expect( await project.ios.containsWatchCompanion( projectInfo: mockXcodeProjectInterpreter.xcodeProjectInfo, buildInfo: BuildInfo.debug, deviceId: '123', ), isFalse, ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), PlistParser: () => testPlistParser, XcodeProjectInterpreter: () => mockXcodeProjectInterpreter, FlutterProjectFactory: () => flutterProjectFactory, }); testUsingContext('has watch companion in plist', () async { final FlutterProject project = await someProject(); project.ios.xcodeProject.createSync(); project.ios.hostAppRoot.childDirectory('WatchTarget').childFile('Info.plist').createSync(recursive: true); testPlistParser.setProperty('WKCompanionAppBundleIdentifier', 'io.flutter.someProject'); expect( await project.ios.containsWatchCompanion( projectInfo: mockXcodeProjectInterpreter.xcodeProjectInfo, buildInfo: BuildInfo.debug, deviceId: '123', ), isTrue, ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), PlistParser: () => testPlistParser, XcodeProjectInterpreter: () => mockXcodeProjectInterpreter, FlutterProjectFactory: () => flutterProjectFactory, }); testUsingContext('has watch companion in plist with xcode variable', () async { final FlutterProject project = await someProject(); project.ios.xcodeProject.createSync(); const XcodeProjectBuildContext buildContext = XcodeProjectBuildContext( scheme: 'Runner', deviceId: '123', ); mockXcodeProjectInterpreter.buildSettingsByBuildContext[buildContext] = <String, String>{ IosProject.kProductBundleIdKey: 'io.flutter.someProject', }; project.ios.hostAppRoot.childDirectory('WatchTarget').childFile('Info.plist').createSync(recursive: true); testPlistParser.setProperty('WKCompanionAppBundleIdentifier', r'$(PRODUCT_BUNDLE_IDENTIFIER)'); expect( await project.ios.containsWatchCompanion( projectInfo: mockXcodeProjectInterpreter.xcodeProjectInfo, buildInfo: BuildInfo.debug, deviceId: '123', ), isTrue, ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), PlistParser: () => testPlistParser, XcodeProjectInterpreter: () => mockXcodeProjectInterpreter, FlutterProjectFactory: () => flutterProjectFactory, }); testUsingContext('has watch companion in other scheme build settings', () async { final FlutterProject project = await someProject(); project.ios.xcodeProject.createSync(); project.ios.xcodeProjectInfoFile.writeAsStringSync(''' Build settings for action build and target "WatchTarget": INFOPLIST_KEY_WKCompanionAppBundleIdentifier = io.flutter.someProject '''); const XcodeProjectBuildContext buildContext = XcodeProjectBuildContext( scheme: 'Runner', deviceId: '123', ); mockXcodeProjectInterpreter.buildSettingsByBuildContext[buildContext] = <String, String>{ IosProject.kProductBundleIdKey: 'io.flutter.someProject', }; const XcodeProjectBuildContext watchBuildContext = XcodeProjectBuildContext( scheme: 'WatchScheme', deviceId: '123', isWatch: true, ); mockXcodeProjectInterpreter.buildSettingsByBuildContext[watchBuildContext] = <String, String>{ 'INFOPLIST_KEY_WKCompanionAppBundleIdentifier': 'io.flutter.someProject', }; expect( await project.ios.containsWatchCompanion( projectInfo: mockXcodeProjectInterpreter.xcodeProjectInfo, buildInfo: BuildInfo.debug, deviceId: '123', ), isTrue, ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), PlistParser: () => testPlistParser, XcodeProjectInterpreter: () => mockXcodeProjectInterpreter, FlutterProjectFactory: () => flutterProjectFactory, }); testUsingContext('has watch companion in other scheme build settings with xcode variable', () async { final FlutterProject project = await someProject(); project.ios.xcodeProject.createSync(); project.ios.xcodeProjectInfoFile.writeAsStringSync(r''' Build settings for action build and target "WatchTarget": INFOPLIST_KEY_WKCompanionAppBundleIdentifier = $(PRODUCT_BUNDLE_IDENTIFIER) '''); const XcodeProjectBuildContext buildContext = XcodeProjectBuildContext( scheme: 'Runner', deviceId: '123' ); mockXcodeProjectInterpreter.buildSettingsByBuildContext[buildContext] = <String, String>{ IosProject.kProductBundleIdKey: 'io.flutter.someProject', }; const XcodeProjectBuildContext watchBuildContext = XcodeProjectBuildContext( scheme: 'WatchScheme', deviceId: '123', isWatch: true, ); mockXcodeProjectInterpreter.buildSettingsByBuildContext[watchBuildContext] = <String, String>{ IosProject.kProductBundleIdKey: 'io.flutter.someProject', 'INFOPLIST_KEY_WKCompanionAppBundleIdentifier': r'$(PRODUCT_BUNDLE_IDENTIFIER)', }; expect( await project.ios.containsWatchCompanion( projectInfo: mockXcodeProjectInterpreter.xcodeProjectInfo, buildInfo: BuildInfo.debug, deviceId: '123', ), isTrue, ); }, overrides: <Type, Generator>{ FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), PlistParser: () => testPlistParser, XcodeProjectInterpreter: () => mockXcodeProjectInterpreter, FlutterProjectFactory: () => flutterProjectFactory, }); }); }); } Future<FlutterProject> someProject({ String? androidManifestOverride, bool includePubspec = false, }) async { final Directory directory = globals.fs.directory('some_project'); directory.childDirectory('.dart_tool') .childFile('package_config.json') ..createSync(recursive: true) ..writeAsStringSync('{"configVersion":2,"packages":[]}'); if (includePubspec) { directory.childFile('pubspec.yaml') ..createSync(recursive: true) ..writeAsStringSync(validPubspec); } directory.childDirectory('ios').createSync(recursive: true); final Directory androidDirectory = directory .childDirectory('android') ..createSync(recursive: true); androidDirectory .childFile('AndroidManifest.xml') .writeAsStringSync(androidManifestOverride ?? '<manifest></manifest>'); return FlutterProject.fromDirectory(directory); } Future<FlutterProject> aPluginProject({bool legacy = true}) async { final Directory directory = globals.fs.directory('plugin_project'); directory.childDirectory('ios').createSync(recursive: true); directory.childDirectory('android').createSync(recursive: true); directory.childDirectory('example').createSync(recursive: true); String pluginPubSpec; if (legacy) { pluginPubSpec = ''' name: my_plugin flutter: plugin: androidPackage: com.example pluginClass: MyPlugin iosPrefix: FLT '''; } else { pluginPubSpec = ''' name: my_plugin flutter: plugin: platforms: android: package: com.example pluginClass: MyPlugin ios: pluginClass: MyPlugin linux: pluginClass: MyPlugin macos: pluginClass: MyPlugin windows: pluginClass: MyPlugin '''; } directory.childFile('pubspec.yaml').writeAsStringSync(pluginPubSpec); return FlutterProject.fromDirectory(directory); } Future<FlutterProject> aModuleProject() async { final Directory directory = globals.fs.directory('module_project'); directory .childDirectory('.dart_tool') .childFile('package_config.json') ..createSync(recursive: true) ..writeAsStringSync('{"configVersion":2,"packages":[]}'); directory.childFile('pubspec.yaml').writeAsStringSync(''' name: my_module flutter: module: androidPackage: com.example '''); return FlutterProject.fromDirectory(directory); } /// Executes the [testMethod] in a context where the file system /// is in memory. @isTest void _testInMemory( String description, Future<void> Function() testMethod, { FileSystem? fileSystem, Java? java, AndroidStudio? androidStudio, ProcessManager? processManager, AndroidSdk? androidSdk, }) { Cache.flutterRoot = getFlutterRoot(); final FileSystem testFileSystem = fileSystem ?? getFileSystemForPlatform(); testFileSystem.directory('.dart_tool').childFile('package_config.json') ..createSync(recursive: true) ..writeAsStringSync('{"configVersion":2,"packages":[]}'); // Transfer needed parts of the Flutter installation folder // to the in-memory file system used during testing. final Logger logger = BufferLogger.test(); transfer( Cache( fileSystem: globals.fs, logger: logger, artifacts: <ArtifactSet>[], osUtils: OperatingSystemUtils( fileSystem: globals.fs, logger: logger, platform: globals.platform, processManager: globals.processManager, ), platform: globals.platform, ).getArtifactDirectory('gradle_wrapper'), testFileSystem); transfer( globals.fs .directory(Cache.flutterRoot) .childDirectory('packages') .childDirectory('flutter_tools') .childDirectory('templates'), testFileSystem); // Set up enough of the packages to satisfy the templating code. final File packagesFile = testFileSystem .directory(Cache.flutterRoot) .childDirectory('packages') .childDirectory('flutter_tools') .childDirectory('.dart_tool') .childFile('package_config.json'); final Directory dummyTemplateImagesDirectory = testFileSystem.directory(Cache.flutterRoot).parent; dummyTemplateImagesDirectory.createSync(recursive: true); packagesFile.createSync(recursive: true); packagesFile.writeAsStringSync(json.encode(<String, Object>{ 'configVersion': 2, 'packages': <Object>[ <String, Object>{ 'name': 'flutter_template_images', 'rootUri': dummyTemplateImagesDirectory.uri.toString(), 'packageUri': 'lib/', 'languageVersion': '2.6', }, ], })); testUsingContext( description, testMethod, overrides: <Type, Generator>{ FileSystem: () => testFileSystem, ProcessManager: () => processManager ?? FakeProcessManager.any(), Java : () => java, AndroidStudio: () => androidStudio ?? FakeAndroidStudio(), // Intentionally null if not set. Some ios tests fail if this is a fake. AndroidSdk: () => androidSdk, Cache: () => Cache( logger: globals.logger, fileSystem: testFileSystem, osUtils: globals.os, platform: globals.platform, artifacts: <ArtifactSet>[], ), FlutterProjectFactory: () => FlutterProjectFactory( fileSystem: testFileSystem, logger: globals.logger, ), }, ); } /// Transfers files and folders from the local file system's Flutter /// installation to an (in-memory) file system used for testing. void transfer(FileSystemEntity entity, FileSystem target) { if (entity is Directory) { target.directory(entity.absolute.path).createSync(recursive: true); for (final FileSystemEntity child in entity.listSync()) { transfer(child, target); } } else if (entity is File) { target.file(entity.absolute.path).writeAsBytesSync(entity.readAsBytesSync(), flush: true); } else { throw Exception('Unsupported FileSystemEntity ${entity.runtimeType}'); } } void expectExists(FileSystemEntity entity) { expect(entity.existsSync(), isTrue); } void expectNotExists(FileSystemEntity entity) { expect(entity.existsSync(), isFalse); } void addIosProjectFile(Directory directory, {required String Function() projectFileContent}) { directory .childDirectory('ios') .childDirectory('Runner.xcodeproj') .childFile('project.pbxproj') ..createSync(recursive: true) ..writeAsStringSync(projectFileContent()); } /// Adds app-level Gradle Groovy build file (build.gradle) to [directory]. /// /// If [kotlinDsl] is true, then build.gradle.kts is created instead of /// build.gradle. It's the caller's responsibility to make sure that /// [gradleFileContent] is consistent with the value of the [kotlinDsl] flag. void addAndroidGradleFile(Directory directory, { required String Function() gradleFileContent, bool kotlinDsl = false, }) { directory .childDirectory('android') .childDirectory('app') .childFile(kotlinDsl ? 'build.gradle.kts' : 'build.gradle') ..createSync(recursive: true) ..writeAsStringSync(gradleFileContent()); } void addRootGradleFile(Directory directory, {required String Function() gradleFileContent}) { directory.childDirectory('android').childFile('build.gradle') ..createSync(recursive: true) ..writeAsStringSync(gradleFileContent()); } void addGradleWrapperFile(Directory directory, String gradleVersion) { directory .childDirectory('android') .childDirectory(gradle_utils.gradleDirectoryName) .childDirectory(gradle_utils.gradleWrapperDirectoryName) .childFile(gradle_utils.gradleWrapperPropertiesFilename) ..createSync(recursive: true) ..writeAsStringSync(''' distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip '''); } FileSystem getFileSystemForPlatform() { return MemoryFileSystem( style: globals.platform.isWindows ? FileSystemStyle.windows : FileSystemStyle.posix, ); } void addAndroidWithGroup(Directory directory, String id, {bool kotlinDsl = false}) { directory.childDirectory('android').childFile(kotlinDsl ? 'build.gradle.kts' : 'build.gradle') ..createSync(recursive: true) ..writeAsStringSync(gradleFileWithGroupId(id)); } String get validPubspec => ''' name: hello flutter: '''; String get validPubspecWithDependencies => ''' name: hello flutter: dependencies: plugin_a: plugin_b: '''; String get invalidPubspec => ''' name: hello flutter: invalid: '''; String get parseErrorPubspec => ''' name: hello # Whitespace is important. flutter: something: something_else: '''; String projectFileWithBundleId(String id, {String? qualifier}) { return ''' 97C147061CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { PRODUCT_BUNDLE_IDENTIFIER = ${qualifier ?? ''}$id${qualifier ?? ''}; PRODUCT_NAME = "\$(TARGET_NAME)"; }; name = Debug; }; '''; } String gradleFileWithApplicationId(String id) { return ''' apply plugin: 'com.android.application' android { compileSdk 34 defaultConfig { applicationId '$id' } } '''; } String gradleFileWithGroupId(String id) { return ''' group '$id' version '1.0-SNAPSHOT' apply plugin: 'com.android.library' android { compileSdk 34 } '''; } File androidPluginRegistrant(Directory parent) { return parent.childDirectory('src') .childDirectory('main') .childDirectory('java') .childDirectory('io') .childDirectory('flutter') .childDirectory('plugins') .childFile('GeneratedPluginRegistrant.java'); } class FakeXcodeProjectInterpreter extends Fake implements XcodeProjectInterpreter { final Map<XcodeProjectBuildContext, Map<String, String>> buildSettingsByBuildContext = <XcodeProjectBuildContext, Map<String, String>>{}; late XcodeProjectInfo xcodeProjectInfo; @override Future<Map<String, String>> getBuildSettings(String projectPath, { XcodeProjectBuildContext? buildContext, Duration timeout = const Duration(minutes: 1), }) async { if (buildSettingsByBuildContext[buildContext] == null) { return <String, String>{}; } return buildSettingsByBuildContext[buildContext]!; } @override Future<XcodeProjectInfo> getInfo(String projectPath, {String? projectFilename}) async { return xcodeProjectInfo; } @override bool get isInstalled => true; } class FakeAndroidSdkWithDir extends Fake implements AndroidSdk { FakeAndroidSdkWithDir(this._directory); final Directory _directory; @override Directory get directory => _directory; }
flutter/packages/flutter_tools/test/general.shard/project_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/project_test.dart", "repo_id": "flutter", "token_count": 28580 }
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 'dart:async'; import 'dart:io' as io; import 'package:args/command_runner.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/base/common.dart'; import 'package:flutter_tools/src/base/error_handling_io.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/io.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/platform.dart'; import 'package:flutter_tools/src/base/signals.dart'; import 'package:flutter_tools/src/base/time.dart'; import 'package:flutter_tools/src/base/user_messages.dart'; import 'package:flutter_tools/src/build_info.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/commands/run.dart'; import 'package:flutter_tools/src/dart/pub.dart'; import 'package:flutter_tools/src/device.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/pre_run_validator.dart'; import 'package:flutter_tools/src/project.dart'; import 'package:flutter_tools/src/reporting/reporting.dart'; import 'package:flutter_tools/src/runner/flutter_command.dart'; import 'package:test/fake.dart'; import 'package:unified_analytics/testing.dart'; import 'package:unified_analytics/unified_analytics.dart'; import '../../src/common.dart'; import '../../src/context.dart'; import '../../src/fake_devices.dart'; import '../../src/fakes.dart'; import '../../src/test_flutter_command_runner.dart'; import 'utils.dart'; void main() { group('Flutter Command', () { late FakeCache cache; late TestUsage usage; late FakeAnalytics fakeAnalytics; late FakeClock clock; late FakeProcessInfo processInfo; late MemoryFileSystem fileSystem; late Platform platform; late FileSystemUtils fileSystemUtils; late Logger logger; late FakeProcessManager processManager; late PreRunValidator preRunValidator; setUpAll(() { Cache.flutterRoot = '/path/to/sdk/flutter'; }); setUp(() { Cache.disableLocking(); cache = FakeCache(); usage = TestUsage(); clock = FakeClock(); processInfo = FakeProcessInfo(); processInfo.maxRss = 10; fileSystem = MemoryFileSystem.test(); platform = FakePlatform(); fileSystemUtils = FileSystemUtils(fileSystem: fileSystem, platform: platform); logger = BufferLogger.test(); processManager = FakeProcessManager.empty(); preRunValidator = PreRunValidator(fileSystem: fileSystem); fakeAnalytics = getInitializedFakeAnalyticsInstance( fs: fileSystem, fakeFlutterVersion: FakeFlutterVersion(), ); }); tearDown(() { Cache.enableLocking(); }); testUsingContext('help text contains global options', () { final FakeDeprecatedCommand fake = FakeDeprecatedCommand(); createTestCommandRunner(fake); expect(fake.usage, contains('Global options:\n')); }); testUsingContext('honors shouldUpdateCache false', () async { final DummyFlutterCommand flutterCommand = DummyFlutterCommand(); await flutterCommand.run(); expect(cache.artifacts, isEmpty); expect(flutterCommand.deprecated, isFalse); expect(flutterCommand.hidden, isFalse); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, Cache: () => cache, }); testUsingContext('honors shouldUpdateCache true', () async { final DummyFlutterCommand flutterCommand = DummyFlutterCommand(shouldUpdateCache: true); await flutterCommand.run(); // First call for universal, second for the rest expect( cache.artifacts, <Set<DevelopmentArtifact>>[ <DevelopmentArtifact>{DevelopmentArtifact.universal}, <DevelopmentArtifact>{}, ], ); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, Cache: () => cache, }); testUsingContext("throws toolExit if flutter_tools source dir doesn't exist", () async { final DummyFlutterCommand flutterCommand = DummyFlutterCommand(); await expectToolExitLater( flutterCommand.run(), contains('Flutter SDK installation appears corrupted'), ); }, overrides: <Type, Generator>{ Cache: () => cache, FileSystem: () => fileSystem, PreRunValidator: () => preRunValidator, ProcessManager: () => processManager, }); testUsingContext('deprecated command should warn', () async { final FakeDeprecatedCommand flutterCommand = FakeDeprecatedCommand(); final CommandRunner<void> runner = createTestCommandRunner(flutterCommand); await runner.run(<String>['deprecated']); expect(testLogger.warningText, contains('The "deprecated" command is deprecated and will be removed in ' 'a future version of Flutter.')); expect(flutterCommand.usage, contains('Deprecated. This command will be removed in a future version ' 'of Flutter.')); expect(flutterCommand.deprecated, isTrue); expect(flutterCommand.hidden, isTrue); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('uses the error handling file system', () async { final DummyFlutterCommand flutterCommand = DummyFlutterCommand( commandFunction: () async { expect(globals.fs, isA<ErrorHandlingFileSystem>()); return const FlutterCommandResult(ExitStatus.success); } ); await flutterCommand.run(); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('finds the target file with default values', () async { globals.fs.file('lib/main.dart').createSync(recursive: true); final FakeTargetCommand fakeTargetCommand = FakeTargetCommand(); final CommandRunner<void> runner = createTestCommandRunner(fakeTargetCommand); await runner.run(<String>['test']); expect(fakeTargetCommand.cachedTargetFile, 'lib/main.dart'); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('finds the target file with specified value', () async { globals.fs.file('lib/foo.dart').createSync(recursive: true); final FakeTargetCommand fakeTargetCommand = FakeTargetCommand(); final CommandRunner<void> runner = createTestCommandRunner(fakeTargetCommand); await runner.run(<String>['test', '-t', 'lib/foo.dart']); expect(fakeTargetCommand.cachedTargetFile, 'lib/foo.dart'); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('throws tool exit if specified file does not exist', () async { final FakeTargetCommand fakeTargetCommand = FakeTargetCommand(); final CommandRunner<void> runner = createTestCommandRunner(fakeTargetCommand); expect(() async => runner.run(<String>['test', '-t', 'lib/foo.dart']), throwsToolExit()); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); void testUsingCommandContext(String testName, dynamic Function() testBody) { testUsingContext(testName, testBody, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessInfo: () => processInfo, ProcessManager: () => processManager, SystemClock: () => clock, Usage: () => usage, Analytics: () => fakeAnalytics, }); } testUsingCommandContext('reports command that results in success', () async { // Crash if called a third time which is unexpected. clock.times = <int>[1000, 2000]; final DummyFlutterCommand flutterCommand = DummyFlutterCommand( commandFunction: () async { return const FlutterCommandResult(ExitStatus.success); } ); await flutterCommand.run(); expect(usage.events, <TestUsageEvent>[ const TestUsageEvent( 'tool-command-result', 'dummy', label: 'success', ), const TestUsageEvent( 'tool-command-max-rss', 'dummy', label: 'success', value: 10, ), ]); expect(fakeAnalytics.sentEvents, contains( Event.flutterCommandResult( commandPath: 'dummy', result: 'success', maxRss: 10, commandHasTerminal: false, ), )); }); testUsingCommandContext('reports command that results in warning', () async { // Crash if called a third time which is unexpected. clock.times = <int>[1000, 2000]; final DummyFlutterCommand flutterCommand = DummyFlutterCommand( commandFunction: () async { return const FlutterCommandResult(ExitStatus.warning); } ); await flutterCommand.run(); expect(usage.events, <TestUsageEvent>[ const TestUsageEvent( 'tool-command-result', 'dummy', label: 'warning', ), const TestUsageEvent( 'tool-command-max-rss', 'dummy', label: 'warning', value: 10, ), ]); expect(fakeAnalytics.sentEvents, contains( Event.flutterCommandResult( commandPath: 'dummy', result: 'warning', maxRss: 10, commandHasTerminal: false, ), )); }); testUsingCommandContext('reports command that results in error', () async { // Crash if called a third time which is unexpected. clock.times = <int>[1000, 2000]; final DummyFlutterCommand flutterCommand = DummyFlutterCommand( commandFunction: () async { throwToolExit('fail'); }, ); await expectLater( () => flutterCommand.run(), throwsToolExit(), ); expect(usage.events, <TestUsageEvent>[ const TestUsageEvent( 'tool-command-result', 'dummy', label: 'fail', ), const TestUsageEvent( 'tool-command-max-rss', 'dummy', label: 'fail', value: 10, ), ]); expect(fakeAnalytics.sentEvents, contains( Event.flutterCommandResult( commandPath: 'dummy', result: 'fail', maxRss: 10, commandHasTerminal: false, ), )); }); test('FlutterCommandResult.success()', () async { expect(FlutterCommandResult.success().exitStatus, ExitStatus.success); }); test('FlutterCommandResult.warning()', () async { expect(FlutterCommandResult.warning().exitStatus, ExitStatus.warning); }); testUsingContext('devToolsServerAddress returns parsed uri', () async { final DummyFlutterCommand command = DummyFlutterCommand()..addDevToolsOptions(verboseHelp: false); await createTestCommandRunner(command).run(<String>[ 'dummy', '--${FlutterCommand.kDevToolsServerAddress}', 'http://127.0.0.1:9105', ]); expect(command.devToolsServerAddress.toString(), equals('http://127.0.0.1:9105')); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('devToolsServerAddress returns null for bad input', () async { final DummyFlutterCommand command = DummyFlutterCommand()..addDevToolsOptions(verboseHelp: false); final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>[ 'dummy', '--${FlutterCommand.kDevToolsServerAddress}', 'hello-world', ]); expect(command.devToolsServerAddress, isNull); await runner.run(<String>[ 'dummy', '--${FlutterCommand.kDevToolsServerAddress}', '', ]); expect(command.devToolsServerAddress, isNull); await runner.run(<String>[ 'dummy', '--${FlutterCommand.kDevToolsServerAddress}', '9101', ]); expect(command.devToolsServerAddress, isNull); await runner.run(<String>[ 'dummy', '--${FlutterCommand.kDevToolsServerAddress}', '127.0.0.1:9101', ]); expect(command.devToolsServerAddress, isNull); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); group('signals tests', () { late FakeIoProcessSignal mockSignal; late ProcessSignal signalUnderTest; late StreamController<io.ProcessSignal> signalController; setUp(() { mockSignal = FakeIoProcessSignal(); signalUnderTest = ProcessSignal(mockSignal); signalController = StreamController<io.ProcessSignal>(); mockSignal.stream = signalController.stream; }); testUsingContext('reports command that is killed', () async { // Crash if called a third time which is unexpected. clock.times = <int>[1000, 2000]; final Completer<void> completer = Completer<void>(); setExitFunctionForTests((int exitCode) { expect(exitCode, 0); restoreExitFunction(); completer.complete(); }); final DummyFlutterCommand flutterCommand = DummyFlutterCommand( commandFunction: () async { final Completer<void> c = Completer<void>(); await c.future; throw UnsupportedError('Unreachable'); } ); unawaited(flutterCommand.run()); signalController.add(mockSignal); await completer.future; expect(usage.events, <TestUsageEvent>[ const TestUsageEvent( 'tool-command-result', 'dummy', label: 'killed', ), const TestUsageEvent( 'tool-command-max-rss', 'dummy', label: 'killed', value: 10, ), ]); expect(fakeAnalytics.sentEvents, contains( Event.flutterCommandResult( commandPath: 'dummy', result: 'killed', maxRss: 10, commandHasTerminal: false, ), )); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, ProcessInfo: () => processInfo, Signals: () => FakeSignals( subForSigTerm: signalUnderTest, exitSignals: <ProcessSignal>[signalUnderTest], ), SystemClock: () => clock, Usage: () => usage, Analytics: () => fakeAnalytics, }); testUsingContext('command release lock on kill signal', () async { clock.times = <int>[1000, 2000]; final Completer<void> completer = Completer<void>(); setExitFunctionForTests((int exitCode) { expect(exitCode, 0); restoreExitFunction(); completer.complete(); }); final Completer<void> checkLockCompleter = Completer<void>(); final DummyFlutterCommand flutterCommand = DummyFlutterCommand(commandFunction: () async { await globals.cache.lock(); checkLockCompleter.complete(); final Completer<void> c = Completer<void>(); await c.future; throw UnsupportedError('Unreachable'); }); unawaited(flutterCommand.run()); await checkLockCompleter.future; globals.cache.checkLockAcquired(); signalController.add(mockSignal); await completer.future; }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, ProcessInfo: () => processInfo, Signals: () => FakeSignals( subForSigTerm: signalUnderTest, exitSignals: <ProcessSignal>[signalUnderTest], ), Usage: () => usage, }); }); testUsingCommandContext('report execution timing by default', () async { // Crash if called a third time which is unexpected. clock.times = <int>[1000, 2000]; final DummyFlutterCommand flutterCommand = DummyFlutterCommand(); await flutterCommand.run(); expect(usage.timings, contains( const TestTimingEvent( 'flutter', 'dummy', Duration(milliseconds: 1000), label: 'fail', ))); expect(fakeAnalytics.sentEvents, contains( Event.timing( workflow: 'flutter', variableName: 'dummy', elapsedMilliseconds: 1000, label: 'fail', ) )); }); testUsingCommandContext('no timing report without usagePath', () async { // Crash if called a third time which is unexpected. clock.times = <int>[1000, 2000]; final DummyFlutterCommand flutterCommand = DummyFlutterCommand(noUsagePath: true); await flutterCommand.run(); expect(usage.timings, isEmpty); // Iterate through and count all the [Event.timing] instances int timingEventCounts = 0; for (final Event e in fakeAnalytics.sentEvents) { if (e.eventName == DashEvent.timing) { timingEventCounts += 1; } } expect( timingEventCounts, 0, reason: 'There should not be any timing events sent, there may ' 'be other non-timing events', ); }); testUsingCommandContext('report additional FlutterCommandResult data', () async { // Crash if called a third time which is unexpected. clock.times = <int>[1000, 2000]; final FlutterCommandResult commandResult = FlutterCommandResult( ExitStatus.success, // nulls should be cleaned up. timingLabelParts: <String?> ['blah1', 'blah2', null, 'blah3'], endTimeOverride: DateTime.fromMillisecondsSinceEpoch(1500), ); final DummyFlutterCommand flutterCommand = DummyFlutterCommand( commandFunction: () async => commandResult ); await flutterCommand.run(); expect(usage.timings, contains( const TestTimingEvent( 'flutter', 'dummy', Duration(milliseconds: 500), label: 'success-blah1-blah2-blah3', ))); expect(fakeAnalytics.sentEvents, contains( Event.timing( workflow: 'flutter', variableName: 'dummy', elapsedMilliseconds: 500, label: 'success-blah1-blah2-blah3', ), )); }); testUsingCommandContext('report failed execution timing too', () async { // Crash if called a third time which is unexpected. clock.times = <int>[1000, 2000]; final DummyFlutterCommand flutterCommand = DummyFlutterCommand( commandFunction: () async { throwToolExit('fail'); }, ); await expectLater( () => flutterCommand.run(), throwsToolExit(), ); expect(usage.timings, contains( const TestTimingEvent( 'flutter', 'dummy', Duration(milliseconds: 1000), label: 'fail', ), )); expect(fakeAnalytics.sentEvents, contains( Event.timing( workflow: 'flutter', variableName: 'dummy', elapsedMilliseconds: 1000, label: 'fail', ), )); }); testUsingContext('reports null safety analytics when reportNullSafety is true', () async { globals.fs.file('lib/main.dart') ..createSync(recursive: true) ..writeAsStringSync('// @dart=2.12'); globals.fs.file('pubspec.yaml') .writeAsStringSync('name: example\n'); globals.fs.file('.dart_tool/package_config.json') ..createSync(recursive: true) ..writeAsStringSync(r''' { "configVersion": 2, "packages": [ { "name": "example", "rootUri": "../", "packageUri": "lib/", "languageVersion": "2.12" } ], "generated": "2020-12-02T19:30:53.862346Z", "generator": "pub", "generatorVersion": "2.12.0-76.0.dev" } '''); final FakeReportingNullSafetyCommand command = FakeReportingNullSafetyCommand(); final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['test']); expect(usage.events, containsAll(<TestUsageEvent>[ const TestUsageEvent( NullSafetyAnalysisEvent.kNullSafetyCategory, 'runtime-mode', label: 'NullSafetyMode.sound', ), TestUsageEvent( NullSafetyAnalysisEvent.kNullSafetyCategory, 'stats', parameters: CustomDimensions.fromMap(<String, String>{ 'cd49': '1', 'cd50': '1', }), ), const TestUsageEvent( NullSafetyAnalysisEvent.kNullSafetyCategory, 'language-version', label: '2.12', ), ])); }, overrides: <Type, Generator>{ Pub: () => FakePub(), Usage: () => usage, FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('use packagesPath to generate BuildInfo', () async { final DummyFlutterCommand flutterCommand = DummyFlutterCommand(packagesPath: 'foo'); final BuildInfo buildInfo = await flutterCommand.getBuildInfo(forcedBuildMode: BuildMode.debug); expect(buildInfo.packagesPath, 'foo'); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('use fileSystemScheme to generate BuildInfo', () async { final DummyFlutterCommand flutterCommand = DummyFlutterCommand(fileSystemScheme: 'foo'); final BuildInfo buildInfo = await flutterCommand.getBuildInfo(forcedBuildMode: BuildMode.debug); expect(buildInfo.fileSystemScheme, 'foo'); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('use fileSystemRoots to generate BuildInfo', () async { final DummyFlutterCommand flutterCommand = DummyFlutterCommand(fileSystemRoots: <String>['foo', 'bar']); final BuildInfo buildInfo = await flutterCommand.getBuildInfo(forcedBuildMode: BuildMode.debug); expect(buildInfo.fileSystemRoots, <String>['foo', 'bar']); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('includes initializeFromDill in BuildInfo', () async { final DummyFlutterCommand flutterCommand = DummyFlutterCommand()..usesInitializeFromDillOption(hide: false); final CommandRunner<void> runner = createTestCommandRunner(flutterCommand); await runner.run(<String>['dummy', '--initialize-from-dill=/foo/bar.dill']); final BuildInfo buildInfo = await flutterCommand.getBuildInfo(forcedBuildMode: BuildMode.debug); expect(buildInfo.initializeFromDill, '/foo/bar.dill'); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('includes assumeInitializeFromDillUpToDate in BuildInfo', () async { final DummyFlutterCommand flutterCommand = DummyFlutterCommand()..usesInitializeFromDillOption(hide: false); final CommandRunner<void> runner = createTestCommandRunner(flutterCommand); await runner.run(<String>['dummy', '--assume-initialize-from-dill-up-to-date']); final BuildInfo buildInfo = await flutterCommand.getBuildInfo(forcedBuildMode: BuildMode.debug); expect(buildInfo.assumeInitializeFromDillUpToDate, isTrue); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('unsets assumeInitializeFromDillUpToDate in BuildInfo when disabled', () async { final DummyFlutterCommand flutterCommand = DummyFlutterCommand()..usesInitializeFromDillOption(hide: false); final CommandRunner<void> runner = createTestCommandRunner(flutterCommand); await runner.run(<String>['dummy', '--no-assume-initialize-from-dill-up-to-date']); final BuildInfo buildInfo = await flutterCommand.getBuildInfo(forcedBuildMode: BuildMode.debug); expect(buildInfo.assumeInitializeFromDillUpToDate, isFalse); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('dds options', () async { final FakeDdsCommand ddsCommand = FakeDdsCommand(); final CommandRunner<void> runner = createTestCommandRunner(ddsCommand); await runner.run(<String>['test', '--dds-port=1']); expect(ddsCommand.enableDds, isTrue); expect(ddsCommand.ddsPort, 1); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('dds options --dds', () async { final FakeDdsCommand ddsCommand = FakeDdsCommand(); final CommandRunner<void> runner = createTestCommandRunner(ddsCommand); await runner.run(<String>['test', '--dds']); expect(ddsCommand.enableDds, isTrue); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('dds options --no-dds', () async { final FakeDdsCommand ddsCommand = FakeDdsCommand(); final CommandRunner<void> runner = createTestCommandRunner(ddsCommand); await runner.run(<String>['test', '--no-dds']); expect(ddsCommand.enableDds, isFalse); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('dds options --disable-dds', () async { final FakeDdsCommand ddsCommand = FakeDdsCommand(); final CommandRunner<void> runner = createTestCommandRunner(ddsCommand); await runner.run(<String>['test', '--disable-dds']); expect(ddsCommand.enableDds, isFalse); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('dds options --no-disable-dds', () async { final FakeDdsCommand ddsCommand = FakeDdsCommand(); final CommandRunner<void> runner = createTestCommandRunner(ddsCommand); await runner.run(<String>['test', '--no-disable-dds']); expect(ddsCommand.enableDds, isTrue); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); testUsingContext('dds options --dds --disable-dds', () async { final FakeDdsCommand ddsCommand = FakeDdsCommand(); final CommandRunner<void> runner = createTestCommandRunner(ddsCommand); await runner.run(<String>['test', '--dds', '--disable-dds']); expect(() => ddsCommand.enableDds, throwsToolExit()); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, ProcessManager: () => processManager, }); group('findTargetDevice', () { final FakeDevice device1 = FakeDevice('device1', 'device1'); final FakeDevice device2 = FakeDevice('device2', 'device2'); testUsingContext('no device found', () async { final DummyFlutterCommand flutterCommand = DummyFlutterCommand(); final Device? device = await flutterCommand.findTargetDevice(); expect(device, isNull); }); testUsingContext('finds single device', () async { testDeviceManager.addAttachedDevice(device1); final DummyFlutterCommand flutterCommand = DummyFlutterCommand(); final Device? device = await flutterCommand.findTargetDevice(); expect(device, device1); }); testUsingContext('finds multiple devices', () async { testDeviceManager.addAttachedDevice(device1); testDeviceManager.addAttachedDevice(device2); testDeviceManager.specifiedDeviceId = 'all'; final DummyFlutterCommand flutterCommand = DummyFlutterCommand(); final Device? device = await flutterCommand.findTargetDevice(); expect(device, isNull); expect(testLogger.statusText, contains(UserMessages().flutterSpecifyDevice)); }); }); group('--dart-define-from-file', () { late FlutterCommand dummyCommand; late CommandRunner<void> dummyCommandRunner; setUp(() { dummyCommand = DummyFlutterCommand()..usesDartDefineOption(); dummyCommandRunner = createTestCommandRunner(dummyCommand); }); testUsingContext('parses values from JSON files and includes them in defines list', () async { fileSystem.file(fileSystem.path.join('lib', 'main.dart')).createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('.packages').createSync(); await fileSystem.file('config1.json').writeAsString( ''' { "kInt": 1, "kDouble": 1.1, "name": "denghaizhu", "title": "this is title from config json file", "nullValue": null, "containEqual": "sfadsfv=432f" } ''' ); await fileSystem.file('config2.json').writeAsString( ''' { "body": "this is body from config json file" } ''' ); await dummyCommandRunner.run(<String>[ 'dummy', '--dart-define-from-file=config1.json', '--dart-define-from-file=config2.json', ]); final BuildInfo buildInfo = await dummyCommand.getBuildInfo(forcedBuildMode: BuildMode.debug); expect(buildInfo.dartDefines, containsAll(const <String>[ 'kInt=1', 'kDouble=1.1', 'name=denghaizhu', 'title=this is title from config json file', 'nullValue=null', 'containEqual=sfadsfv=432f', 'body=this is body from config json file', ])); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, Logger: () => logger, FileSystemUtils: () => fileSystemUtils, Platform: () => platform, ProcessManager: () => processManager, }); testUsingContext('has values with identical keys from --dart-define take precedence', () async { fileSystem .file(fileSystem.path.join('lib', 'main.dart')) .createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('.packages').createSync(); fileSystem.file('.env').writeAsStringSync(''' MY_VALUE=VALUE_FROM_ENV_FILE '''); await dummyCommandRunner.run(<String>[ 'dummy', '--dart-define=MY_VALUE=VALUE_FROM_COMMAND', '--dart-define-from-file=.env', ]); final BuildInfo buildInfo = await dummyCommand.getBuildInfo(forcedBuildMode: BuildMode.debug); expect(buildInfo.dartDefines, containsAll(const <String>[ 'MY_VALUE=VALUE_FROM_ENV_FILE', 'MY_VALUE=VALUE_FROM_COMMAND', ])); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, Logger: () => logger, FileSystemUtils: () => fileSystemUtils, Platform: () => platform, ProcessManager: () => processManager, }); testUsingContext('correctly parses a valid env file', () async { fileSystem .file(fileSystem.path.join('lib', 'main.dart')) .createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('.packages').createSync(); await fileSystem.file('.env').writeAsString(''' # comment kInt=1 kDouble=1.1 # should be double name=piotrfleury title=this is title from config env file empty= doubleQuotes="double quotes 'value'#=" # double quotes singleQuotes='single quotes "value"#=' # single quotes backQuotes=`back quotes "value" '#=` # back quotes hashString="some-#-hash-string-value" # Play around with spaces around the equals sign. spaceBeforeEqual =value spaceAroundEqual = value spaceAfterEqual= value '''); await fileSystem.file('.env2').writeAsString(''' # second comment body=this is body from config env file '''); await dummyCommandRunner.run(<String>[ 'dummy', '--dart-define-from-file=.env', '--dart-define-from-file=.env2', ]); final BuildInfo buildInfo = await dummyCommand.getBuildInfo(forcedBuildMode: BuildMode.debug); expect(buildInfo.dartDefines, containsAll(const <String>[ 'kInt=1', 'kDouble=1.1', 'name=piotrfleury', 'title=this is title from config env file', 'empty=', "doubleQuotes=double quotes 'value'#=", 'singleQuotes=single quotes "value"#=', 'backQuotes=back quotes "value" \'#=', 'hashString=some-#-hash-string-value', 'spaceBeforeEqual=value', 'spaceAroundEqual=value', 'spaceAfterEqual=value', 'body=this is body from config env file' ])); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, Logger: () => logger, FileSystemUtils: () => fileSystemUtils, Platform: () => platform, ProcessManager: () => processManager, }); testUsingContext('throws a ToolExit when the provided .env file is malformed', () async { fileSystem .file(fileSystem.path.join('lib', 'main.dart')) .createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('.packages').createSync(); await fileSystem.file('.env').writeAsString('what is this'); await dummyCommandRunner.run(<String>[ 'dummy', '--dart-define-from-file=.env', ]); expect(dummyCommand.getBuildInfo(forcedBuildMode: BuildMode.debug), throwsToolExit(message: 'Unable to parse file provided for ' '--${FlutterOptions.kDartDefineFromFileOption}.\n' 'Invalid property line: what is this')); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, Logger: () => logger, FileSystemUtils: () => fileSystemUtils, Platform: () => platform, ProcessManager: () => processManager, }); testUsingContext('throws a ToolExit when .env file contains a multiline value', () async { fileSystem .file(fileSystem.path.join('lib', 'main.dart')) .createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('.packages').createSync(); await fileSystem.file('.env').writeAsString(''' # single line value name=piotrfleury # multi-line value multiline = """ Welcome to .env demo a simple counter app with .env file support for more info, check out the README.md file Thanks! """ # This is the welcome message that will be displayed on the counter app '''); await dummyCommandRunner.run(<String>[ 'dummy', '--dart-define-from-file=.env', ]); expect(dummyCommand.getBuildInfo(forcedBuildMode: BuildMode.debug), throwsToolExit(message: 'Multi-line value is not supported: multiline = """ Welcome to .env demo')); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, Logger: () => logger, FileSystemUtils: () => fileSystemUtils, Platform: () => platform, ProcessManager: () => processManager, }); testUsingContext('works with mixed file formats', () async { fileSystem .file(fileSystem.path.join('lib', 'main.dart')) .createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('.packages').createSync(); await fileSystem.file('.env').writeAsString(''' kInt=1 kDouble=1.1 name=piotrfleury title=this is title from config env file '''); await fileSystem.file('config.json').writeAsString(''' { "body": "this is body from config json file" } '''); await dummyCommandRunner.run(<String>[ 'dummy', '--dart-define-from-file=.env', '--dart-define-from-file=config.json', ]); final BuildInfo buildInfo = await dummyCommand.getBuildInfo(forcedBuildMode: BuildMode.debug); expect(buildInfo.dartDefines, containsAll(const <String>[ 'kInt=1', 'kDouble=1.1', 'name=piotrfleury', 'title=this is title from config env file', 'body=this is body from config json file', ])); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, Logger: () => logger, FileSystemUtils: () => fileSystemUtils, Platform: () => platform, ProcessManager: () => processManager, }); testUsingContext('when files contain entries with duplicate keys, uses the value from the lattermost file', () async { fileSystem.file(fileSystem.path.join('lib', 'main.dart')).createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('.packages').createSync(); await fileSystem.file('config1.json').writeAsString( ''' { "kInt": 1, "kDouble": 1.1, "name": "denghaizhu", "title": "this is title from config json file" } ''' ); await fileSystem.file('config2.json').writeAsString( ''' { "kInt": "2" } ''' ); await dummyCommandRunner.run(<String>[ 'dummy', '--dart-define-from-file=config1.json', '--dart-define-from-file=config2.json', ]); final BuildInfo buildInfo = await dummyCommand.getBuildInfo(forcedBuildMode: BuildMode.debug); expect(buildInfo.dartDefines, containsAll(const <String>[ 'kInt=2', 'kDouble=1.1', 'name=denghaizhu', 'title=this is title from config json file' ])); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, Logger: () => logger, FileSystemUtils: () => fileSystemUtils, Platform: () => platform, ProcessManager: () => processManager, }); testUsingContext('throws a ToolExit when the argued path points to a directory', () async { fileSystem.file(fileSystem.path.join('lib', 'main.dart')).createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('.packages').createSync(); fileSystem.directory('config').createSync(); await dummyCommandRunner.run(<String>[ 'dummy', '--dart-define-from-file=config', ]); expect(dummyCommand.getBuildInfo(forcedBuildMode: BuildMode.debug), throwsToolExit(message: 'Did not find the file passed to "--dart-define-from-file". Path: config')); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, Logger: () => logger, FileSystemUtils: () => fileSystemUtils, Platform: () => platform, ProcessManager: () => processManager, }); testUsingContext('throws a ToolExit when the given JSON file is malformed', () async { fileSystem.file(fileSystem.path.join('lib', 'main.dart')).createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('.packages').createSync(); await fileSystem.file('config.json').writeAsString( ''' { "kInt": 1Error json format "kDouble": 1.1, "name": "denghaizhu", "title": "this is title from config json file" } ''' ); await dummyCommandRunner.run(<String>[ 'dummy', '--dart-define-from-file=config.json', ]); expect(dummyCommand.getBuildInfo(forcedBuildMode: BuildMode.debug), throwsToolExit(message: 'Unable to parse the file at path "config.json" due to ' 'a formatting error. Ensure that the file contains valid JSON.\n' 'Error details: FormatException: Missing expected digit (at line 2, character 25)')); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, Logger: () => logger, FileSystemUtils: () => fileSystemUtils, Platform: () => platform, ProcessManager: () => processManager, }); testUsingContext('throws a ToolExit when the provided file does not exist', () async { fileSystem.directory('config').createSync(); await dummyCommandRunner.run(<String>[ 'dummy', '--dart-define=k=v', '--dart-define-from-file=config']); expect(dummyCommand.getBuildInfo(forcedBuildMode: BuildMode.debug), throwsToolExit(message: 'Did not find the file passed to "--dart-define-from-file". Path: config')); }, overrides: <Type, Generator>{ FileSystem: () => fileSystem, Logger: () => logger, FileSystemUtils: () => fileSystemUtils, Platform: () => platform, ProcessManager: () => processManager, }); }); group('--flavor', () { late _TestDeviceManager testDeviceManager; late Logger logger; late FileSystem fileSystem; setUp(() { logger = BufferLogger.test(); testDeviceManager = _TestDeviceManager(logger: logger); fileSystem = MemoryFileSystem.test(); }); testUsingContext("tool exits when FLUTTER_APP_FLAVOR is already set in user's environment", () async { fileSystem.file('lib/main.dart').createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('.packages').createSync(); final FakeDevice device = FakeDevice( 'name', 'id', type: PlatformType.android, supportsFlavors: true, ); testDeviceManager.devices = <Device>[device]; final _TestRunCommandThatOnlyValidates command = _TestRunCommandThatOnlyValidates(); final CommandRunner<void> runner = createTestCommandRunner(command); expect(runner.run(<String>['run', '--no-pub', '--no-hot', '--flavor=strawberry']), throwsToolExit(message: 'FLUTTER_APP_FLAVOR is used by the framework and cannot be set in the environment.')); }, overrides: <Type, Generator>{ DeviceManager: () => testDeviceManager, Platform: () => FakePlatform( environment: <String, String>{ 'FLUTTER_APP_FLAVOR': 'I was already set' } ), Cache: () => Cache.test(processManager: FakeProcessManager.any()), FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), }); testUsingContext('tool exits when FLUTTER_APP_FLAVOR is set in --dart-define or --dart-define-from-file', () async { fileSystem.file('lib/main.dart').createSync(recursive: true); fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('.packages').createSync(); fileSystem.file('config.json')..createSync()..writeAsStringSync('{"FLUTTER_APP_FLAVOR": "strawberry"}'); final FakeDevice device = FakeDevice( 'name', 'id', type: PlatformType.android, supportsFlavors: true, ); testDeviceManager.devices = <Device>[device]; final _TestRunCommandThatOnlyValidates command = _TestRunCommandThatOnlyValidates(); final CommandRunner<void> runner = createTestCommandRunner(command); expect(runner.run(<String>['run', '--dart-define=FLUTTER_APP_FLAVOR=strawberry', '--no-pub', '--no-hot', '--flavor=strawberry']), throwsToolExit(message: 'FLUTTER_APP_FLAVOR is used by the framework and cannot be set using --dart-define or --dart-define-from-file')); expect(runner.run(<String>['run', '--dart-define-from-file=config.json', '--no-pub', '--no-hot', '--flavor=strawberry']), throwsToolExit(message: 'FLUTTER_APP_FLAVOR is used by the framework and cannot be set using --dart-define or --dart-define-from-file')); }, overrides: <Type, Generator>{ DeviceManager: () => testDeviceManager, Platform: () => FakePlatform(), Cache: () => Cache.test(processManager: FakeProcessManager.any()), FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), }); }); }); } class FakeDeprecatedCommand extends FlutterCommand { @override String get description => 'A fake command'; @override String get name => 'deprecated'; @override bool get deprecated => true; @override Future<FlutterCommandResult> runCommand() async { return FlutterCommandResult.success(); } } class FakeTargetCommand extends FlutterCommand { FakeTargetCommand() { usesTargetOption(); } @override Future<FlutterCommandResult> runCommand() async { cachedTargetFile = targetFile; return FlutterCommandResult.success(); } String? cachedTargetFile; @override String get description => ''; @override String get name => 'test'; } class FakeReportingNullSafetyCommand extends FlutterCommand { FakeReportingNullSafetyCommand() { argParser.addFlag('debug'); argParser.addFlag('release'); argParser.addFlag('jit-release'); argParser.addFlag('profile'); } @override String get description => 'test'; @override String get name => 'test'; @override bool get shouldRunPub => true; @override bool get reportNullSafety => true; @override Future<FlutterCommandResult> runCommand() async { return FlutterCommandResult.success(); } } class FakeDdsCommand extends FlutterCommand { FakeDdsCommand() { addDdsOptions(verboseHelp: false); } @override String get description => 'test'; @override String get name => 'test'; @override Future<FlutterCommandResult> runCommand() async { return FlutterCommandResult.success(); } } class FakeProcessInfo extends Fake implements ProcessInfo { @override int maxRss = 0; } class FakeIoProcessSignal extends Fake implements io.ProcessSignal { late Stream<io.ProcessSignal> stream; @override Stream<io.ProcessSignal> watch() => stream; } class FakeCache extends Fake implements Cache { List<Set<DevelopmentArtifact>> artifacts = <Set<DevelopmentArtifact>>[]; @override Future<void> updateAll(Set<DevelopmentArtifact> requiredArtifacts, {bool offline = false}) async { artifacts.add(requiredArtifacts.toSet()); } @override void releaseLock() { } } class FakeSignals implements Signals { FakeSignals({ required this.subForSigTerm, required List<ProcessSignal> exitSignals, }) : delegate = Signals.test(exitSignals: exitSignals); final ProcessSignal subForSigTerm; final Signals delegate; @override Object addHandler(ProcessSignal signal, SignalHandler handler) { if (signal == ProcessSignal.sigterm) { return delegate.addHandler(subForSigTerm, handler); } return delegate.addHandler(signal, handler); } @override Future<bool> removeHandler(ProcessSignal signal, Object token) => delegate.removeHandler(signal, token); @override Stream<Object> get errors => delegate.errors; } class FakeClock extends Fake implements SystemClock { List<int> times = <int>[]; @override DateTime now() { return DateTime.fromMillisecondsSinceEpoch(times.removeAt(0)); } } class FakePub extends Fake implements Pub { @override Future<void> get({ required PubContext context, required FlutterProject project, bool upgrade = false, bool offline = false, String? flutterRootOverride, bool checkUpToDate = false, bool shouldSkipThirdPartyGenerator = true, PubOutputMode outputMode = PubOutputMode.all, }) async { } } class _TestDeviceManager extends DeviceManager { _TestDeviceManager({required super.logger}); List<Device> devices = <Device>[]; @override List<DeviceDiscovery> get deviceDiscoverers { final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery(); devices.forEach(discoverer.addDevice); return <DeviceDiscovery>[discoverer]; } } class _TestRunCommandThatOnlyValidates extends RunCommand { @override Future<FlutterCommandResult> runCommand() async { return FlutterCommandResult.success(); } }
flutter/packages/flutter_tools/test/general.shard/runner/flutter_command_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/runner/flutter_command_test.dart", "repo_id": "flutter", "token_count": 19801 }
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 '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/commands/update_packages.dart'; import 'package:flutter_tools/src/update_packages_pins.dart'; import '../src/common.dart'; // An example pubspec.yaml from flutter, not necessary for it to be up to date. const String kFlutterPubspecYaml = r''' name: flutter description: A framework for writing Flutter applications homepage: http://flutter.dev environment: sdk: '>=3.2.0-0 <4.0.0' dependencies: # To update these, use "flutter update-packages --force-upgrade". collection: 1.14.11 meta: 1.1.8 typed_data: 1.1.6 vector_math: 2.0.8 sky_engine: sdk: flutter gallery: git: url: https://github.com/flutter/gallery.git ref: d00362e6bdd0f9b30bba337c358b9e4a6e4ca950 dev_dependencies: flutter_test: sdk: flutter flutter_goldens: sdk: flutter archive: 2.0.11 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" # PUBSPEC CHECKSUM: 1437 '''; const String kExtraPubspecYaml = r''' name: nodeps description: A dummy pubspec with no dependencies homepage: http://flutter.dev environment: sdk: '>=3.2.0-0 <4.0.0' '''; const String kInvalidGitPubspec = ''' name: flutter description: A framework for writing Flutter applications homepage: http://flutter.dev environment: sdk: '>=3.2.0-0 <4.0.0' dependencies: # To update these, use "flutter update-packages --force-upgrade". collection: 1.14.11 meta: 1.1.8 typed_data: 1.1.6 vector_math: 2.0.8 sky_engine: sdk: flutter gallery: git: '''; const String kVersionJson = ''' { "frameworkVersion": "1.2.3", "channel": "[user-branch]", "repositoryUrl": "[email protected]:flutter/flutter.git", "frameworkRevision": "1234567812345678123456781234567812345678", "frameworkCommitDate": "2024-02-06 22:26:52 +0100", "engineRevision": "abcdef01abcdef01abcdef01abcdef01abcdef01", "dartSdkVersion": "1.2.3", "devToolsVersion": "1.2.3", "flutterVersion": "1.2.3" } '''; void main() { late FileSystem fileSystem; late Directory flutterSdk; late Directory flutter; setUp(() { fileSystem = MemoryFileSystem.test(); // Setup simplified Flutter SDK. flutterSdk = fileSystem.directory('flutter')..createSync(); // Create version file flutterSdk.childFile('version').writeAsStringSync('1.2.3'); // Create version JSON file flutterSdk.childDirectory('bin').childDirectory('cache').childFile('flutter.version.json') ..createSync(recursive: true) ..writeAsStringSync(kVersionJson); // Create a pubspec file flutter = flutterSdk.childDirectory('packages').childDirectory('flutter') ..createSync(recursive: true); flutter.childFile('pubspec.yaml').writeAsStringSync(kFlutterPubspecYaml); }); testWithoutContext('kManuallyPinnedDependencies pins are actually pins', () { expect( kManuallyPinnedDependencies.values, isNot(contains(anyOf('any', startsWith('^'), startsWith('>'), startsWith('<')))), reason: 'Version pins in kManuallyPinnedDependencies must be specific pins, not ranges.', ); }); testWithoutContext( 'createTemporaryFlutterSdk creates an unpinned flutter SDK', () { // A stray extra package should not cause a crash. final Directory extra = flutterSdk .childDirectory('packages') .childDirectory('extra') ..createSync(recursive: true); extra.childFile('pubspec.yaml').writeAsStringSync(kExtraPubspecYaml); // Create already parsed pubspecs. final PubspecYaml flutterPubspec = PubspecYaml(flutter); final PubspecDependency gitDependency = flutterPubspec.dependencies .firstWhere((PubspecDependency dep) => dep.kind == DependencyKind.git); expect( gitDependency.lockLine, ''' git: url: https://github.com/flutter/gallery.git ref: d00362e6bdd0f9b30bba337c358b9e4a6e4ca950 ''', ); final BufferLogger bufferLogger = BufferLogger.test(); final Directory result = createTemporaryFlutterSdk( bufferLogger, fileSystem, flutterSdk, <PubspecYaml>[flutterPubspec], fileSystem.systemTempDirectory, ); expect(result, exists); // We get a warning about the unexpected package. expect( bufferLogger.warningText, contains("Unexpected package 'extra' found in packages directory"), ); // The version file exists. expect(result.childFile('version'), exists); expect(result.childFile('version').readAsStringSync(), '1.2.3'); expect(fileSystem.file(fileSystem.path.join(result.path, 'bin', 'cache', 'flutter.version.json')), exists); // The sky_engine package exists expect(fileSystem.directory('${result.path}/bin/cache/pkg/sky_engine'), exists); // The flutter pubspec exists final File pubspecFile = fileSystem.file('${result.path}/packages/flutter/pubspec.yaml'); expect(pubspecFile, exists); // The flutter pubspec contains `any` dependencies. final PubspecYaml outputPubspec = PubspecYaml(pubspecFile.parent); expect(outputPubspec.name, 'flutter'); expect(outputPubspec.dependencies.first.name, 'collection'); expect(outputPubspec.dependencies.first.version, 'any'); }); testWithoutContext('Throws a StateError on a malformed git: reference', () { // Create an invalid pubspec file. flutter.childFile('pubspec.yaml').writeAsStringSync(kInvalidGitPubspec); expect( () => PubspecYaml(flutter), throwsStateError, ); }); testWithoutContext('PubspecYaml Loads dependencies', () async { final PubspecYaml pubspecYaml = PubspecYaml(flutter); expect( pubspecYaml.allDependencies .map<String>((PubspecDependency dependency) => '${dependency.name}: ${dependency.version}') .toSet(), equals(<String>{ 'collection: 1.14.11', 'meta: 1.1.8', 'typed_data: 1.1.6', 'vector_math: 2.0.8', 'sky_engine: ', 'gallery: ', 'flutter_test: ', 'flutter_goldens: ', 'archive: 2.0.11', })); expect( pubspecYaml.allExplicitDependencies .map<String>((PubspecDependency dependency) => '${dependency.name}: ${dependency.version}') .toSet(), equals(<String>{ 'collection: 1.14.11', 'meta: 1.1.8', 'typed_data: 1.1.6', 'vector_math: 2.0.8', 'sky_engine: ', 'gallery: ', 'flutter_test: ', 'flutter_goldens: ', })); expect( pubspecYaml.dependencies .map<String>((PubspecDependency dependency) => '${dependency.name}: ${dependency.version}') .toSet(), equals(<String>{ 'collection: 1.14.11', 'meta: 1.1.8', 'typed_data: 1.1.6', 'vector_math: 2.0.8', 'sky_engine: ', 'gallery: ', })); }); }
flutter/packages/flutter_tools/test/general.shard/update_packages_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/update_packages_test.dart", "repo_id": "flutter", "token_count": 2912 }
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 'package:dwds/dwds.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/compile.dart'; import 'package:flutter_tools/src/isolated/devfs_web.dart'; import 'package:test/fake.dart'; import '../../src/common.dart'; void main() { late FileSystem fileSystem; setUp(() { fileSystem = MemoryFileSystem.test(); }); testWithoutContext('WebExpressionCompiler handles successful expression compilation', () async { fileSystem.file('compilerOutput').writeAsStringSync('a'); final ResidentCompiler residentCompiler = FakeResidentCompiler(const CompilerOutput('compilerOutput', 0, <Uri>[])); final ExpressionCompiler expressionCompiler = WebExpressionCompiler(residentCompiler, fileSystem: fileSystem); final ExpressionCompilationResult result = await expressionCompiler.compileExpressionToJs( '', '', 1, 1, <String, String>{}, <String, String>{}, '', ''); expectResult(result, false, 'a'); }); testWithoutContext('WebExpressionCompiler handles compilation error', () async { fileSystem.file('compilerOutput').writeAsStringSync('Error: a'); final ResidentCompiler residentCompiler = FakeResidentCompiler(const CompilerOutput('compilerOutput', 1, <Uri>[])); final ExpressionCompiler expressionCompiler = WebExpressionCompiler(residentCompiler, fileSystem: fileSystem); final ExpressionCompilationResult result = await expressionCompiler.compileExpressionToJs( '', '', 1, 1, <String, String>{}, <String, String>{}, '', ''); expectResult(result, true, 'Error: a'); }); testWithoutContext('WebExpressionCompiler handles internal error', () async { final ResidentCompiler residentCompiler = FakeResidentCompiler(null); final ExpressionCompiler expressionCompiler = WebExpressionCompiler(residentCompiler, fileSystem: fileSystem); final ExpressionCompilationResult result = await expressionCompiler.compileExpressionToJs( '', '', 1, 1, <String, String>{}, <String, String>{}, '', 'a'); expectResult(result, true, "InternalError: frontend server failed to compile 'a'"); }); } void expectResult(ExpressionCompilationResult result, bool isError, String value) { expect(result, const TypeMatcher<ExpressionCompilationResult>() .having((ExpressionCompilationResult instance) => instance.isError, 'isError', isError) .having((ExpressionCompilationResult instance) => instance.result, 'result', value)); } class FakeResidentCompiler extends Fake implements ResidentCompiler { FakeResidentCompiler(this.output); final CompilerOutput? output; @override Future<CompilerOutput?> compileExpressionToJs( String libraryUri, int line, int column, Map<String, String> jsModules, Map<String, String> jsFrameValues, String moduleName, String expression, ) async { return output; } }
flutter/packages/flutter_tools/test/general.shard/web/web_expression_compiler_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/general.shard/web/web_expression_compiler_test.dart", "repo_id": "flutter", "token_count": 960 }
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 'package:file_testing/file_testing.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/io.dart'; import 'package:flutter_tools/src/base/utils.dart'; import 'package:flutter_tools/src/build_info.dart'; import '../integration.shard/test_utils.dart'; import '../src/common.dart'; void main() { group('iOS app validation', () { late String flutterRoot; late Directory pluginRoot; late String projectRoot; late String flutterBin; late Directory tempDir; late File hiddenFile; setUpAll(() { flutterRoot = getFlutterRoot(); tempDir = createResolvedTempDirectorySync('ios_content_validation.'); flutterBin = fileSystem.path.join( flutterRoot, 'bin', 'flutter', ); final Directory xcframeworkArtifact = fileSystem.directory( fileSystem.path.join( flutterRoot, 'bin', 'cache', 'artifacts', 'engine', 'ios', 'Flutter.xcframework', ), ); // Pre-cache iOS engine Flutter.xcframework artifacts. ProcessResult result = processManager.runSync( <String>[ flutterBin, ...getLocalEngineArguments(), 'precache', '--ios', ], workingDirectory: tempDir.path, ); expect(result, const ProcessResultMatcher()); // Pretend the SDK was on an external drive with stray "._" files in the xcframework hiddenFile = xcframeworkArtifact.childFile('._Info.plist')..createSync(); // Test a plugin example app to allow plugins validation. result = processManager.runSync(<String>[ flutterBin, ...getLocalEngineArguments(), 'create', '--verbose', '--platforms=ios', '-t', 'plugin', 'hello', ], workingDirectory: tempDir.path); expect(result, const ProcessResultMatcher()); pluginRoot = tempDir.childDirectory('hello'); projectRoot = pluginRoot.childDirectory('example').path; }); tearDownAll(() { tryToDelete(hiddenFile); tryToDelete(tempDir); }); for (final BuildMode buildMode in <BuildMode>[BuildMode.debug, BuildMode.release]) { group('build in ${buildMode.cliName} mode', () { late Directory outputPath; late Directory outputApp; late Directory frameworkDirectory; late Directory outputFlutterFramework; late File outputFlutterFrameworkBinary; late Directory outputAppFramework; late File outputAppFrameworkBinary; late File outputPluginFrameworkBinary; late Directory buildPath; late Directory buildAppFrameworkDsym; late File buildAppFrameworkDsymBinary; late ProcessResult buildResult; setUpAll(() { buildResult = processManager.runSync(<String>[ flutterBin, ...getLocalEngineArguments(), 'build', 'ios', '--verbose', '--no-codesign', '--${buildMode.cliName}', '--obfuscate', '--split-debug-info=foo debug info/', ], workingDirectory: projectRoot); outputPath = fileSystem.directory(fileSystem.path.join( projectRoot, 'build', 'ios', 'iphoneos', )); outputApp = outputPath.childDirectory('Runner.app'); frameworkDirectory = outputApp.childDirectory('Frameworks'); outputFlutterFramework = frameworkDirectory.childDirectory('Flutter.framework'); outputFlutterFrameworkBinary = outputFlutterFramework.childFile('Flutter'); outputAppFramework = frameworkDirectory.childDirectory('App.framework'); outputAppFrameworkBinary = outputAppFramework.childFile('App'); outputPluginFrameworkBinary = frameworkDirectory.childDirectory('hello.framework').childFile('hello'); buildPath = fileSystem.directory(fileSystem.path.join( projectRoot, 'build', 'ios', '${sentenceCase(buildMode.cliName)}-iphoneos', )); buildAppFrameworkDsym = buildPath.childDirectory('App.framework.dSYM'); buildAppFrameworkDsymBinary = buildAppFrameworkDsym.childFile('Contents/Resources/DWARF/App'); }); testWithoutContext('flutter build ios builds a valid app', () { printOnFailure('Output of flutter build ios:'); printOnFailure(buildResult.stdout.toString()); printOnFailure(buildResult.stderr.toString()); expect(buildResult.exitCode, 0); expect(outputPluginFrameworkBinary, exists); expect(outputAppFrameworkBinary, exists); expect(outputAppFramework.childFile('Info.plist'), exists); expect(buildAppFrameworkDsymBinary.existsSync(), buildMode != BuildMode.debug); final File vmSnapshot = fileSystem.file(fileSystem.path.join( outputAppFramework.path, 'flutter_assets', 'vm_snapshot_data', )); expect(vmSnapshot.existsSync(), buildMode == BuildMode.debug); }); testWithoutContext('Info.plist dart VM Service Bonjour service', () { final String infoPlistPath = fileSystem.path.join( outputApp.path, 'Info.plist', ); final ProcessResult bonjourServices = processManager.runSync( <String>[ 'plutil', '-extract', 'NSBonjourServices', 'xml1', '-o', '-', infoPlistPath, ], ); final bool bonjourServicesFound = (bonjourServices.stdout as String).contains('_dartVmService._tcp'); expect(bonjourServicesFound, buildMode == BuildMode.debug); final ProcessResult localNetworkUsage = processManager.runSync( <String>[ 'plutil', '-extract', 'NSLocalNetworkUsageDescription', 'xml1', '-o', '-', infoPlistPath, ], ); final bool localNetworkUsageFound = localNetworkUsage.exitCode == 0; expect(localNetworkUsageFound, buildMode == BuildMode.debug); }); testWithoutContext('check symbols', () { final List<String> symbols = AppleTestUtils.getExportedSymbols(outputAppFrameworkBinary.path); if (buildMode == BuildMode.debug) { expect(symbols, isEmpty); } else { expect(symbols, equals(AppleTestUtils.requiredSymbols)); } }); testWithoutContext('check symbols in dSYM', () { if (buildMode == BuildMode.debug) { // dSYM is not created for a debug build. expect(buildAppFrameworkDsymBinary.existsSync(), isFalse); } else { final List<String> symbols = AppleTestUtils.getExportedSymbols(buildAppFrameworkDsymBinary.path); expect(symbols, containsAll(AppleTestUtils.requiredSymbols)); // The actual number of symbols is going to vary but there should // be "many" in the dSYM. At the time of writing, it was 7656. expect(symbols.length, greaterThanOrEqualTo(5000)); } }); testWithoutContext('xcode_backend embed_and_thin', () { outputFlutterFramework.deleteSync(recursive: true); outputAppFramework.deleteSync(recursive: true); expect(outputFlutterFrameworkBinary.existsSync(), isFalse); expect(outputAppFrameworkBinary.existsSync(), isFalse); final String xcodeBackendPath = fileSystem.path.join( flutterRoot, 'packages', 'flutter_tools', 'bin', 'xcode_backend.sh', ); // Simulate a common Xcode build setting misconfiguration // where FLUTTER_APPLICATION_PATH is missing final ProcessResult xcodeBackendResult = processManager.runSync( <String>[ xcodeBackendPath, 'embed_and_thin', ], environment: <String, String>{ 'SOURCE_ROOT': fileSystem.path.join(projectRoot, 'ios'), 'BUILT_PRODUCTS_DIR': fileSystem.path.join( projectRoot, 'build', 'ios', 'Release-iphoneos', ), 'TARGET_BUILD_DIR': outputPath.path, 'FRAMEWORKS_FOLDER_PATH': 'Runner.app/Frameworks', 'VERBOSE_SCRIPT_LOGGING': '1', 'FLUTTER_BUILD_MODE': 'release', 'ACTION': 'install', 'FLUTTER_BUILD_DIR': 'build', // Skip bitcode stripping since we just checked that above. }, ); printOnFailure('Output of xcode_backend.sh:'); printOnFailure(xcodeBackendResult.stdout.toString()); printOnFailure(xcodeBackendResult.stderr.toString()); expect(xcodeBackendResult.exitCode, 0); expect(outputFlutterFrameworkBinary.existsSync(), isTrue); expect(outputAppFrameworkBinary.existsSync(), isTrue); }, skip: !platform.isMacOS || buildMode != BuildMode.release); // [intended] only makes sense on macos. testWithoutContext('validate obfuscation', () { // HelloPlugin class is present in project. ProcessResult grepResult = processManager.runSync(<String>[ 'grep', '-r', 'HelloPlugin', pluginRoot.path, ]); // Matches exits 0. expect(grepResult.exitCode, 0); // Not present in binary. grepResult = processManager.runSync(<String>[ 'grep', 'HelloPlugin', outputAppFrameworkBinary.path, ]); // Does not match exits 1. expect(grepResult.exitCode, 1); }); }); } testWithoutContext('builds all plugin architectures for simulator', () { final ProcessResult buildSimulator = processManager.runSync( <String>[ flutterBin, ...getLocalEngineArguments(), 'build', 'ios', '--simulator', '--verbose', '--no-codesign', ], workingDirectory: projectRoot, ); expect(buildSimulator.exitCode, 0); final File pluginFrameworkBinary = fileSystem.file(fileSystem.path.join( projectRoot, 'build', 'ios', 'iphonesimulator', 'Runner.app', 'Frameworks', 'hello.framework', 'hello', )); expect(pluginFrameworkBinary, exists); final ProcessResult archs = processManager.runSync( <String>['file', pluginFrameworkBinary.path], ); expect(archs.stdout, contains('Mach-O 64-bit dynamically linked shared library x86_64')); expect(archs.stdout, contains('Mach-O 64-bit dynamically linked shared library arm64')); }); testWithoutContext('build for simulator with all available architectures', () { final ProcessResult buildSimulator = processManager.runSync( <String>[ flutterBin, ...getLocalEngineArguments(), 'build', 'ios', '--simulator', '--verbose', '--no-codesign', ], workingDirectory: projectRoot, environment: <String, String>{ 'FLUTTER_XCODE_ONLY_ACTIVE_ARCH': 'NO', }, ); // This test case would fail if arm64 or x86_64 simulators could not build. expect(buildSimulator.exitCode, 0); final File simulatorAppFrameworkBinary = fileSystem.file(fileSystem.path.join( projectRoot, 'build', 'ios', 'iphonesimulator', 'Runner.app', 'Frameworks', 'App.framework', 'App', )); expect(simulatorAppFrameworkBinary, exists); final ProcessResult archs = processManager.runSync( <String>['file', simulatorAppFrameworkBinary.path], ); expect(archs.stdout, contains('Mach-O 64-bit dynamically linked shared library x86_64')); expect(archs.stdout, contains('Mach-O 64-bit dynamically linked shared library arm64')); }); testWithoutContext('archive', () { final File appIconFile = fileSystem.file(fileSystem.path.join( projectRoot, 'ios', 'Runner', 'Assets.xcassets', 'AppIcon.appiconset', '[email protected]', )); // Resizes app icon to 123x456 (it is supposed to be 20x20). appIconFile.writeAsBytesSync(appIconFile.readAsBytesSync() ..buffer.asByteData().setInt32(16, 123) ..buffer.asByteData().setInt32(20, 456)); final ProcessResult output = processManager.runSync( <String>[ flutterBin, ...getLocalEngineArguments(), 'build', 'xcarchive', '--verbose', ], workingDirectory: projectRoot, ); // Note this isBot so usage won't actually be sent, // this log line is printed whenever the app is archived. expect(output.stdout, contains('Sending archive event if usage enabled')); // The output contains extra time related prefix, so cannot use a single string. const List<String> expectedValidationMessages = <String>[ '[!] App Settings Validation\n', ' • Version Number: 1.0.0\n', ' • Build Number: 1\n', ' • Display Name: Hello\n', ' • Deployment Target: 12.0\n', ' • Bundle Identifier: com.example.hello\n', ' ! Your application still contains the default "com.example" bundle identifier.\n', '[!] App Icon and Launch Image Assets Validation\n', ' ! App icon is set to the default placeholder icon. Replace with unique icons.\n', ' ! App icon is using the incorrect size (e.g. [email protected]).\n', ' ! Launch image is set to the default placeholder icon. Replace with unique launch image.\n', 'To update the settings, please refer to https://docs.flutter.dev/deployment/ios\n', ]; expect(expectedValidationMessages, unorderedEquals(expectedValidationMessages)); final Directory archivePath = fileSystem.directory(fileSystem.path.join( projectRoot, 'build', 'ios', 'archive', 'Runner.xcarchive', )); final Directory products = archivePath.childDirectory('Products'); expect(products, exists); final Directory dSYM = archivePath.childDirectory('dSYMs').childDirectory('Runner.app.dSYM'); expect(dSYM, exists); final Directory applications = products.childDirectory('Applications'); final Directory appBundle = applications .listSync() .whereType<Directory>() .singleWhere((Directory directory) => fileSystem.path.extension(directory.path) == '.app'); final String flutterFramework = fileSystem.path.join( appBundle.path, 'Frameworks', 'Flutter.framework', 'Flutter', ); // Exits 0 only if codesigned. final ProcessResult flutterCodesign = processManager.runSync( <String>[ 'xcrun', 'codesign', '--verify', flutterFramework, ], ); expect(flutterCodesign, const ProcessResultMatcher()); final String appFramework = fileSystem.path.join( appBundle.path, 'Frameworks', 'App.framework', 'App', ); final ProcessResult appCodesign = processManager.runSync( <String>[ 'xcrun', 'codesign', '--verify', appFramework, ], ); expect(appCodesign, const ProcessResultMatcher()); }); }, skip: !platform.isMacOS, // [intended] only makes sense for macos platform. timeout: const Timeout(Duration(minutes: 10)) ); }
flutter/packages/flutter_tools/test/host_cross_arch.shard/ios_content_validation_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/host_cross_arch.shard/ios_content_validation_test.dart", "repo_id": "flutter", "token_count": 7169 }
786
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:file_testing/file_testing.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/io.dart'; import 'package:flutter_tools/src/cache.dart'; import '../src/common.dart'; import 'test_utils.dart'; void main() { late Directory tempDir; setUp(() { Cache.flutterRoot = getFlutterRoot(); tempDir = createResolvedTempDirectorySync('flutter_plugin_test.'); }); tearDown(() async { tryToDelete(tempDir); }); test('error logged when plugin Android ndkVersion higher than project', () async { final String flutterBin = fileSystem.path.join( getFlutterRoot(), 'bin', 'flutter', ); // Create dummy plugin processManager.runSync(<String>[ flutterBin, ...getLocalEngineArguments(), 'create', '--template=plugin_ffi', '--platforms=android', 'test_plugin', ], workingDirectory: tempDir.path); final Directory pluginAppDir = tempDir.childDirectory('test_plugin'); final File pluginGradleFile = pluginAppDir.childDirectory('android').childFile('build.gradle'); expect(pluginGradleFile, exists); final String pluginBuildGradle = pluginGradleFile.readAsStringSync(); // Bump up plugin ndkVersion to 21.4.7075529. final RegExp androidNdkVersionRegExp = RegExp(r'ndkVersion = (\"[0-9\.]+\"|flutter.ndkVersion|android.ndkVersion)'); final String newPluginGradleFile = pluginBuildGradle.replaceAll(androidNdkVersionRegExp, 'ndkVersion = "21.4.7075529"'); expect(newPluginGradleFile, contains('21.4.7075529')); pluginGradleFile.writeAsStringSync(newPluginGradleFile); final Directory pluginExampleAppDir = pluginAppDir.childDirectory('example'); final File projectGradleFile = pluginExampleAppDir.childDirectory('android').childDirectory('app').childFile('build.gradle'); expect(projectGradleFile, exists); final String projectBuildGradle = projectGradleFile.readAsStringSync(); // Bump down plugin example app ndkVersion to 21.1.6352462. final String newProjectGradleFile = projectBuildGradle.replaceAll(androidNdkVersionRegExp, 'ndkVersion = "21.1.6352462"'); expect(newProjectGradleFile, contains('21.1.6352462')); projectGradleFile.writeAsStringSync(newProjectGradleFile); // Run flutter build apk to build plugin example project final ProcessResult result = processManager.runSync(<String>[ flutterBin, ...getLocalEngineArguments(), 'build', 'apk', '--target-platform=android-arm', ], workingDirectory: pluginExampleAppDir.path); // Check that an error message is thrown. expect(result.stderr, contains(''' One or more plugins require a higher Android NDK version. Fix this issue by adding the following to ${projectGradleFile.path}: android { ndkVersion "21.4.7075529" ... } ''')); }); }
flutter/packages/flutter_tools/test/integration.shard/android_plugin_ndkversion_mismatch_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/android_plugin_ndkversion_mismatch_test.dart", "repo_id": "flutter", "token_count": 1028 }
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 'package:dds/dap.dart'; import 'package:flutter_tools/src/debug_adapters/flutter_adapter_args.dart'; import 'test_server.dart'; /// A helper class to simplify acting as a client for interacting with the /// [DapTestServer] in tests. /// /// Methods on this class should map directly to protocol methods. Additional /// helpers are available in [DapTestClientExtension]. class DapTestClient { DapTestClient._( this._channel, this._logger, { this.captureVmServiceTraffic = false, }) { // Set up a future that will complete when the 'dart.debuggerUris' event is // emitted by the debug adapter so tests have easy access to it. vmServiceUri = event('dart.debuggerUris').then<Uri?>((Event event) { final Map<String, Object?> body = event.body! as Map<String, Object?>; return Uri.parse(body['vmServiceUri']! as String); }).then( (Uri? uri) => uri, onError: (Object? e) => null, ); _subscription = _channel.listen( _handleMessage, onDone: () { if (_pendingRequests.isNotEmpty) { _logger?.call( 'Application terminated without a response to ${_pendingRequests.length} requests'); } _pendingRequests.forEach((int id, _OutgoingRequest request) => request.completer.completeError( 'Application terminated without a response to request $id (${request.name})')); _pendingRequests.clear(); }, ); } final ByteStreamServerChannel _channel; late final StreamSubscription<String> _subscription; final Logger? _logger; final bool captureVmServiceTraffic; final Map<int, _OutgoingRequest> _pendingRequests = <int, _OutgoingRequest>{}; final StreamController<Event> _eventController = StreamController<Event>.broadcast(); int _seq = 1; late final Future<Uri?> vmServiceUri; /// Returns a stream of [OutputEventBody] events. Stream<OutputEventBody> get outputEvents => events('output') .map((Event e) => OutputEventBody.fromJson(e.body! as Map<String, Object?>)); /// Returns a stream of [StoppedEventBody] events. Stream<StoppedEventBody> get stoppedEvents => events('stopped') .map((Event e) => StoppedEventBody.fromJson(e.body! as Map<String, Object?>)); /// Returns a stream of the string output from [OutputEventBody] events. Stream<String> get output => outputEvents.map((OutputEventBody output) => output.output); /// Returns a stream of the string output from [OutputEventBody] events with the category 'stdout'. Stream<String> get stdoutOutput => outputEvents .where((OutputEventBody output) => output.category == 'stdout') .map((OutputEventBody output) => output.output); /// Sends a custom request to the server and waits for a response. Future<Response> custom(String name, [Object? args]) async { return sendRequest(args, overrideCommand: name); } /// Returns a Future that completes with the next [event] event. Future<Event> event(String event) => _eventController.stream.firstWhere( (Event e) => e.event == event, orElse: () => throw Exception('Did not receive $event event before stream closed')); /// Returns a stream for [event] events. Stream<Event> events(String event) { return _eventController.stream.where((Event e) => e.event == event); } /// Returns a stream of progress events. Stream<Event> progressEvents() { const Set<String> progressEvents = <String>{'progressStart', 'progressUpdate', 'progressEnd'}; return _eventController.stream.where((Event e) => progressEvents.contains(e.event)); } /// Returns a stream of custom 'dart.serviceExtensionAdded' events. Stream<Map<String, Object?>> get serviceExtensionAddedEvents => events('dart.serviceExtensionAdded') .map((Event e) => e.body! as Map<String, Object?>); /// Returns a stream of custom 'flutter.serviceExtensionStateChanged' events. Stream<Map<String, Object?>> get serviceExtensionStateChangedEvents => events('flutter.serviceExtensionStateChanged') .map((Event e) => e.body! as Map<String, Object?>); /// Returns a stream of 'dart.testNotification' custom events from the /// package:test JSON reporter. Stream<Map<String, Object?>> get testNotificationEvents => events('dart.testNotification') .map((Event e) => e.body! as Map<String, Object?>); /// Sends a custom request to the debug adapter to trigger a Hot Reload. Future<Response> hotReload() { return custom('hotReload'); } /// Sends a custom request with custom syntax convention to the debug adapter to trigger a Hot Reload. Future<Response> customSyntaxHotReload() { return custom(r'$/hotReload'); } /// Sends a custom request to the debug adapter to trigger a Hot Restart. Future<Response> hotRestart() { return custom('hotRestart'); } /// Send an initialize request to the server. /// /// This occurs before the request to start running/debugging a script and is /// used to exchange capabilities and send breakpoints and other settings. Future<Response> initialize({ String exceptionPauseMode = 'None', bool? supportsRunInTerminalRequest, bool? supportsProgressReporting, }) async { final List<ProtocolMessage> responses = await Future.wait(<Future<ProtocolMessage>>[ event('initialized'), sendRequest(InitializeRequestArguments( adapterID: 'test', supportsRunInTerminalRequest: supportsRunInTerminalRequest, supportsProgressReporting: supportsProgressReporting, )), sendRequest( SetExceptionBreakpointsArguments( filters: <String>[exceptionPauseMode], ), ), ]); await sendRequest(ConfigurationDoneArguments()); return responses[1] as Response; // Return the initialize response. } /// Send a launchRequest to the server, asking it to start a Flutter app. Future<Response> launch({ String? program, List<String>? args, List<String>? toolArgs, String? cwd, bool? noDebug, List<String>? additionalProjectPaths, bool? allowAnsiColorOutput, bool? debugSdkLibraries, bool? debugExternalPackageLibraries, bool? evaluateGettersInDebugViews, bool? evaluateToStringInDebugViews, bool sendLogsToClient = false, }) { return sendRequest( FlutterLaunchRequestArguments( noDebug: noDebug, program: program, cwd: cwd, args: args, toolArgs: toolArgs, additionalProjectPaths: additionalProjectPaths, allowAnsiColorOutput: allowAnsiColorOutput, debugSdkLibraries: debugSdkLibraries, debugExternalPackageLibraries: debugExternalPackageLibraries, evaluateGettersInDebugViews: evaluateGettersInDebugViews, evaluateToStringInDebugViews: evaluateToStringInDebugViews, // When running out of process, VM Service traffic won't be available // to the client-side logger, so force logging regardless of // `sendLogsToClient` which sends VM Service traffic in a custom event. sendLogsToClient: sendLogsToClient || captureVmServiceTraffic, ), // We can't automatically pick the command when using a custom type // (FlutterLaunchRequestArguments). overrideCommand: 'launch', ); } /// Send an attachRequest to the server, asking it to attach to an already-running Flutter app. Future<Response> attach({ List<String>? toolArgs, String? vmServiceUri, String? cwd, List<String>? additionalProjectPaths, bool? debugSdkLibraries, bool? debugExternalPackageLibraries, bool? evaluateGettersInDebugViews, bool? evaluateToStringInDebugViews, }) { return sendRequest( FlutterAttachRequestArguments( cwd: cwd, toolArgs: toolArgs, vmServiceUri: vmServiceUri, additionalProjectPaths: additionalProjectPaths, debugSdkLibraries: debugSdkLibraries, debugExternalPackageLibraries: debugExternalPackageLibraries, evaluateGettersInDebugViews: evaluateGettersInDebugViews, evaluateToStringInDebugViews: evaluateToStringInDebugViews, // When running out of process, VM Service traffic won't be available // to the client-side logger, so force logging on which sends VM Service // traffic in a custom event. sendLogsToClient: captureVmServiceTraffic, ), // We can't automatically pick the command when using a custom type // (FlutterAttachRequestArguments). overrideCommand: 'attach', ); } /// Sends an arbitrary request to the server. /// /// Returns a Future that completes when the server returns a corresponding /// response. Future<Response> sendRequest(Object? arguments, {bool allowFailure = false, String? overrideCommand}) { final String command = overrideCommand ?? commandTypes[arguments.runtimeType]!; final Request request = Request(seq: _seq++, command: command, arguments: arguments); final Completer<Response> completer = Completer<Response>(); _pendingRequests[request.seq] = _OutgoingRequest(completer, command, allowFailure); _channel.sendRequest(request); return completer.future; } /// Returns a Future that completes with the next serviceExtensionAdded /// event for [extension]. Future<Map<String, Object?>> serviceExtensionAdded(String extension) => serviceExtensionAddedEvents.firstWhere( (Map<String, Object?> body) => body['extensionRPC'] == extension, orElse: () => throw Exception('Did not receive $extension extension added event before stream closed')); /// Returns a Future that completes with the next serviceExtensionStateChanged /// event for [extension]. Future<Map<String, Object?>> serviceExtensionStateChanged(String extension) => serviceExtensionStateChangedEvents.firstWhere( (Map<String, Object?> body) => body['extension'] == extension, orElse: () => throw Exception('Did not receive $extension extension state changed event before stream closed')); /// Initializes the debug adapter and launches [program]/[cwd] or calls the /// custom [launch] method. Future<void> start({ String? program, String? cwd, String exceptionPauseMode = 'None', Future<Object?> Function()? launch, }) { return Future.wait(<Future<Object?>>[ initialize(exceptionPauseMode: exceptionPauseMode), launch?.call() ?? this.launch(program: program, cwd: cwd), ], eagerError: true); } Future<void> stop() async { _channel.close(); await _subscription.cancel(); } Future<Response> terminate() => sendRequest(TerminateArguments()); /// Handles an incoming message from the server, completing the relevant request /// of raising the appropriate event. Future<void> _handleMessage(Object? message) async { if (message is Response) { final _OutgoingRequest? pendingRequest = _pendingRequests.remove(message.requestSeq); if (pendingRequest == null) { return; } final Completer<Response> completer = pendingRequest.completer; if (message.success || pendingRequest.allowFailure) { completer.complete(message); } else { completer.completeError(message); } } else if (message is Event && !_eventController.isClosed) { _eventController.add(message); // When we see a terminated event, close the event stream so if any // tests are waiting on something that will never come, they fail at // a useful location. if (message.event == 'terminated') { unawaited(_eventController.close()); } } } /// Creates a [DapTestClient] that connects the server listening on /// [host]:[port]. static Future<DapTestClient> connect( DapTestServer server, { bool captureVmServiceTraffic = false, Logger? logger, }) async { final ByteStreamServerChannel channel = ByteStreamServerChannel(server.stream, server.sink, logger); return DapTestClient._(channel, logger, captureVmServiceTraffic: captureVmServiceTraffic); } } /// Useful events produced by the debug adapter during a debug session. class TestEvents { TestEvents({ required this.output, required this.testNotifications, }); final List<OutputEventBody> output; final List<Map<String, Object?>> testNotifications; } class _OutgoingRequest { _OutgoingRequest(this.completer, this.name, this.allowFailure); final Completer<Response> completer; final String name; final bool allowFailure; } /// Additional helper method for tests to simplify interaction with [DapTestClient]. /// /// Unlike the methods on [DapTestClient] these methods might not map directly /// onto protocol methods. They may call multiple protocol methods and/or /// simplify assertion specific conditions/results. extension DapTestClientExtension on DapTestClient { /// Collects all output events until the program terminates. /// /// These results include all events in the order they are received, including /// console, stdout and stderr. /// /// Only one of [start] or [launch] may be provided. Use [start] to customise /// the whole start of the session (including initialize) or [launch] to only /// customise the [launchRequest]. Future<List<OutputEventBody>> collectAllOutput({ String? program, String? cwd, Future<void> Function()? start, Future<Response> Function()? launch, bool skipInitialPubGetOutput = true }) async { assert( start == null || launch == null, 'Only one of "start" or "launch" may be provided', ); final Future<List<OutputEventBody>> outputEventsFuture = outputEvents.toList(); // Don't await these, in case they don't complete (eg. an error prevents // the app from starting). if (start != null) { unawaited(start()); } else { unawaited(this.start(program: program, cwd: cwd, launch: launch)); } final List<OutputEventBody> output = await outputEventsFuture; // Integration tests may trigger "flutter pub get" at the start based of // `pubspec/yaml` and `.dart_tool/package_config.json`. // See // https://github.com/flutter/flutter/pull/91300 // https://github.com/flutter/flutter/issues/120015 return skipInitialPubGetOutput ? output .skipWhile((OutputEventBody output) => output.output.startsWith('Running "flutter pub get"') || output.output.startsWith('Resolving dependencies') || output.output.startsWith('Got dependencies')) .toList() : output; } /// Collects all output and test events until the program terminates. /// /// These results include all events in the order they are received, including /// console, stdout, stderr and test notifications from the test JSON reporter. /// /// Only one of [start] or [launch] may be provided. Use [start] to customise /// the whole start of the session (including initialise) or [launch] to only /// customise the [launchRequest]. Future<TestEvents> collectTestOutput({ String? program, String? cwd, Future<Response> Function()? start, Future<Object?> Function()? launch, }) async { assert( start == null || launch == null, 'Only one of "start" or "launch" may be provided', ); final Future<List<OutputEventBody>> outputEventsFuture = outputEvents.toList(); final Future<List<Map<String, Object?>>> testNotificationEventsFuture = testNotificationEvents.toList(); if (start != null) { await start(); } else { await this.start(program: program, cwd: cwd, launch: launch); } return TestEvents( output: await outputEventsFuture, testNotifications: await testNotificationEventsFuture, ); } /// Sets a breakpoint at [line] in [file]. Future<void> setBreakpoint(String filePath, int line) async { await sendRequest( SetBreakpointsArguments( source: Source(path: filePath), breakpoints: <SourceBreakpoint>[ SourceBreakpoint(line: line), ], ), ); } /// Sends a continue request for the given thread. /// /// Returns a Future that completes when the server returns a corresponding /// response. Future<Response> continue_(int threadId) => sendRequest(ContinueArguments(threadId: threadId)); /// Clears breakpoints in [file]. Future<void> clearBreakpoints(String filePath) async { await sendRequest( SetBreakpointsArguments( source: Source(path: filePath), breakpoints: <SourceBreakpoint>[], ), ); } }
flutter/packages/flutter_tools/test/integration.shard/debug_adapter/test_client.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/debug_adapter/test_client.dart", "repo_id": "flutter", "token_count": 5531 }
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:file/file.dart'; import 'package:flutter_tools/src/base/io.dart'; import '../src/common.dart'; import 'test_utils.dart'; void main() { late Directory tempDir; late Directory projectRoot; late String flutterBin; final List<String> targetPlatforms = <String>[ 'apk', 'web', if (platform.isWindows) 'windows', if (platform.isMacOS) ...<String>['macos', 'ios'], ]; setUpAll(() { tempDir = createResolvedTempDirectorySync('build_compilation_error_test.'); flutterBin = fileSystem.path.join( getFlutterRoot(), 'bin', 'flutter', ); processManager.runSync(<String>[flutterBin, 'config', '--enable-macos-desktop', '--enable-windows-desktop', '--enable-web', ]); processManager.runSync(<String>[ flutterBin, ...getLocalEngineArguments(), 'create', 'hello', ], workingDirectory: tempDir.path); projectRoot = tempDir.childDirectory('hello'); writeFile(fileSystem.path.join(projectRoot.path, 'lib', 'main.dart'), ''' int x = 'String'; '''); }); tearDownAll(() { tryToDelete(tempDir); }); for (final String targetPlatform in targetPlatforms) { testWithoutContext('flutter build $targetPlatform shows dart compilation error in non-verbose', () { final ProcessResult result = processManager.runSync(<String>[ flutterBin, ...getLocalEngineArguments(), 'build', targetPlatform, '--no-pub', if (targetPlatform == 'ios') '--no-codesign', ], workingDirectory: projectRoot.path); expect( result, const ProcessResultMatcher( exitCode: 1, stderrPattern: "A value of type 'String' can't be assigned to a variable of type 'int'.", ), ); expect(result.stderr, isNot(contains("Warning: The 'dart2js' entrypoint script is deprecated"))); }); } }
flutter/packages/flutter_tools/test/integration.shard/flutter_build_with_compilation_error_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/flutter_build_with_compilation_error_test.dart", "repo_id": "flutter", "token_count": 822 }
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 'dart:async'; import 'package:file/file.dart'; import '../src/common.dart'; import 'test_data/stateless_stateful_project.dart'; import 'test_driver.dart'; import 'test_utils.dart'; // This test verifies that we can hot reload a stateless widget into a // stateful one and back. void main() { late Directory tempDir; final HotReloadProject project = HotReloadProject(); late FlutterRunTestDriver flutter; setUp(() async { tempDir = createResolvedTempDirectorySync('hot_reload_test.'); await project.setUpIn(tempDir); flutter = FlutterRunTestDriver(tempDir); }); tearDown(() async { await flutter.stop(); tryToDelete(tempDir); }); testWithoutContext('Can switch from stateless to stateful', () async { await flutter.run(); await flutter.hotReload(); final StringBuffer stdout = StringBuffer(); final StreamSubscription<String> subscription = flutter.stdout.listen(stdout.writeln); // switch to stateful. project.toggleState(); await flutter.hotReload(); final String logs = stdout.toString(); expect(logs, contains('STATEFUL')); await subscription.cancel(); }); }
flutter/packages/flutter_tools/test/integration.shard/stateless_stateful_hot_reload_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/stateless_stateful_hot_reload_test.dart", "repo_id": "flutter", "token_count": 428 }
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 'basic_project.dart'; import 'deferred_components_config.dart'; import 'deferred_components_project.dart'; /// Project which can load native plugins class PluginProject extends BasicProject { @override final DeferredComponentsConfig? deferredComponents = PluginDeferredComponentsConfig(); } class PluginDeferredComponentsConfig extends BasicDeferredComponentsConfig { @override String get androidBuild => r''' buildscript { ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } configurations.classpath { resolutionStrategy.activateDependencyLocking() } } allprojects { repositories { google() mavenCentral() } } rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { project.evaluationDependsOn(':app') dependencyLocking { ignoredDependencies.add('io.flutter:*') lockFile = file("${rootProject.projectDir}/project-${project.name}.lockfile") if (!project.hasProperty('local-engine-repo')) { lockAllConfigurations() } } } tasks.register("clean", Delete) { delete rootProject.buildDir } '''; @override String get androidSettings => r''' include ':app' def localPropertiesFile = new File(rootProject.projectDir, "local.properties") def properties = new Properties() assert localPropertiesFile.exists() localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" '''; @override String get appManifest => r''' <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.yourcompany.flavors"> <uses-permission android:name="android.permission.INTERNET"/> <application android:name="${applicationName}" android:label="flavors"> <activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <meta-data android:name="flutterEmbedding" android:value="2" /> </application> </manifest> '''; }
flutter/packages/flutter_tools/test/integration.shard/test_data/plugin_project.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/test_data/plugin_project.dart", "repo_id": "flutter", "token_count": 1185 }
791
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:file/file.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:vm_service/vm_service.dart'; import 'package:vm_service/vm_service_io.dart'; import '../src/common.dart'; import 'test_data/basic_project.dart'; import 'test_driver.dart'; import 'test_utils.dart'; void main() { group('Flutter Tool VMService method', () { late Directory tempDir; late FlutterRunTestDriver flutter; late VmService vmService; setUp(() async { tempDir = createResolvedTempDirectorySync('vmservice_integration_test.'); final BasicProject project = BasicProject(); await project.setUpIn(tempDir); flutter = FlutterRunTestDriver(tempDir); await flutter.run(withDebugger: true); final int? port = flutter.vmServicePort; expect(port != null, true); vmService = await vmServiceConnectUri('ws://localhost:$port/ws'); }); tearDown(() async { await flutter.stop(); tryToDelete(tempDir); }); testWithoutContext('getSupportedProtocols includes DDS', () async { final ProtocolList protocolList = await vmService.getSupportedProtocols(); expect(protocolList.protocols, hasLength(2)); for (final Protocol protocol in protocolList.protocols!) { expect(protocol.protocolName, anyOf('VM Service', 'DDS')); } }); testWithoutContext('flutterVersion can be called', () async { final Response response = await vmService.callServiceExtension('s0.flutterVersion'); expect(response.type, 'Success'); expect(response.json, containsPair('frameworkRevisionShort', isNotNull)); expect(response.json, containsPair('engineRevisionShort', isNotNull)); }); testWithoutContext('flutterMemoryInfo can be called', () async { final Response response = await vmService.callServiceExtension('s0.flutterMemoryInfo'); expect(response.type, 'Success'); }); testWithoutContext('reloadSources can be called', () async { final VM vm = await vmService.getVM(); final IsolateRef? isolateRef = vm.isolates?.first; expect(isolateRef != null, true); final Response response = await vmService.callMethod('s0.reloadSources', isolateId: isolateRef!.id); expect(response.type, 'Success'); }); testWithoutContext('reloadSources fails on bad params', () async { final Future<Response> response = vmService.callMethod('s0.reloadSources', isolateId: ''); expect(response, throwsA(const TypeMatcher<RPCError>())); }); testWithoutContext('hotRestart can be called', () async { final VM vm = await vmService.getVM(); final IsolateRef? isolateRef = vm.isolates?.first; expect(isolateRef != null, true); final Response response = await vmService.callMethod('s0.hotRestart', isolateId: isolateRef!.id); expect(response.type, 'Success'); }); testWithoutContext('hotRestart fails on bad params', () async { final Future<Response> response = vmService.callMethod('s0.hotRestart', args: <String, dynamic>{'pause': 'not_a_bool'}); expect(response, throwsA(const TypeMatcher<RPCError>())); }); testWithoutContext('flutterGetSkSL can be called', () async { final Response response = await vmService.callMethod('s0.flutterGetSkSL'); expect(response.type, 'Success'); }); testWithoutContext('ext.flutter.brightnessOverride can toggle window brightness', () async { final Isolate isolate = await waitForExtension(vmService, 'ext.flutter.brightnessOverride'); final Response response = await vmService.callServiceExtension( 'ext.flutter.brightnessOverride', isolateId: isolate.id, ); expect(response.json?['value'], 'Brightness.light'); final Response updateResponse = await vmService.callServiceExtension( 'ext.flutter.brightnessOverride', isolateId: isolate.id, args: <String, String>{ 'value': 'Brightness.dark', } ); expect(updateResponse.json?['value'], 'Brightness.dark'); // Change the brightness back to light final Response verifyResponse = await vmService.callServiceExtension( 'ext.flutter.brightnessOverride', isolateId: isolate.id, args: <String, String>{ 'value': 'Brightness.light', } ); expect(verifyResponse.json?['value'], 'Brightness.light'); // Change with a bogus value final Response bogusResponse = await vmService.callServiceExtension( 'ext.flutter.brightnessOverride', isolateId: isolate.id, args: <String, String>{ 'value': 'dark', // Intentionally invalid value. } ); expect(bogusResponse.json?['value'], 'Brightness.light'); }); testWithoutContext('ext.flutter.debugPaint can toggle debug painting', () async { final Isolate isolate = await waitForExtension(vmService, 'ext.flutter.debugPaint'); final Response response = await vmService.callServiceExtension( 'ext.flutter.debugPaint', isolateId: isolate.id, ); expect(response.json?['enabled'], 'false'); final Response updateResponse = await vmService.callServiceExtension( 'ext.flutter.debugPaint', isolateId: isolate.id, args: <String, String>{ 'enabled': 'true', } ); expect(updateResponse.json?['enabled'], 'true'); }); }); }
flutter/packages/flutter_tools/test/integration.shard/vmservice_integration_test.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/integration.shard/vmservice_integration_test.dart", "repo_id": "flutter", "token_count": 2089 }
792
// 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:args/args.dart'; import 'package:args/command_runner.dart'; import 'package:flutter_tools/src/base/context.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/user_messages.dart'; import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/commands/create.dart'; import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/runner/flutter_command.dart'; import 'package:flutter_tools/src/runner/flutter_command_runner.dart'; export 'package:test/test.dart' hide isInstanceOf, test; CommandRunner<void> createTestCommandRunner([ FlutterCommand? command ]) { final FlutterCommandRunner runner = TestFlutterCommandRunner(); if (command != null) { runner.addCommand(command); } return runner; } /// Creates a flutter project in the [temp] directory using the /// [arguments] list if specified, or `--no-pub` if not. /// Returns the path to the flutter project. Future<String> createProject(Directory temp, { List<String>? arguments }) async { arguments ??= <String>['--no-pub']; final String projectPath = globals.fs.path.join(temp.path, 'flutter_project'); final CreateCommand command = CreateCommand(); final CommandRunner<void> runner = createTestCommandRunner(command); await runner.run(<String>['create', ...arguments, projectPath]); // Create `.packages` since it's not created when the flag `--no-pub` is passed. globals.fs.file(globals.fs.path.join(projectPath, '.packages')).createSync(); return projectPath; } class TestFlutterCommandRunner extends FlutterCommandRunner { @override Future<void> runCommand(ArgResults topLevelResults) async { final Logger topLevelLogger = globals.logger; final Map<Type, dynamic> contextOverrides = <Type, dynamic>{ if (topLevelResults['verbose'] as bool) Logger: VerboseLogger(topLevelLogger), }; return context.run<void>( overrides: contextOverrides.map<Type, Generator>((Type type, dynamic value) { return MapEntry<Type, Generator>(type, () => value); }), body: () { Cache.flutterRoot ??= Cache.defaultFlutterRoot( platform: globals.platform, fileSystem: globals.fs, userMessages: UserMessages(), ); // For compatibility with tests that set this to a relative path. Cache.flutterRoot = globals.fs.path.normalize(globals.fs.path.absolute(Cache.flutterRoot!)); return super.runCommand(topLevelResults); } ); } }
flutter/packages/flutter_tools/test/src/test_flutter_command_runner.dart/0
{ "file_path": "flutter/packages/flutter_tools/test/src/test_flutter_command_runner.dart", "repo_id": "flutter", "token_count": 949 }
793
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:io'; import 'package:path/path.dart' as path; /// Count the number of libraries that import globals.dart in lib and test. /// /// This must be run from the flutter_tools project root directory. void main() { final Directory sources = Directory(path.join(Directory.current.path, 'lib')); final Directory tests = Directory(path.join(Directory.current.path, 'test')); final int sourceGlobals = countGlobalImports(sources); final int testGlobals = countGlobalImports(tests); print('lib/ contains $sourceGlobals libraries with global usage'); print('test/ contains $testGlobals libraries with global usage'); } final RegExp globalImport = RegExp("import.*globals.dart' as globals;"); int countGlobalImports(Directory directory) { int count = 0; for (final FileSystemEntity file in directory.listSync(recursive: true)) { if (!file.path.endsWith('.dart') || file is! File) { continue; } final bool hasImport = file.readAsLinesSync().any((String line) { return globalImport.hasMatch(line); }); if (hasImport) { count += 1; } } return count; }
flutter/packages/flutter_tools/tool/global_count.dart/0
{ "file_path": "flutter/packages/flutter_tools/tool/global_count.dart", "repo_id": "flutter", "token_count": 401 }
794
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @TestOn('chrome') // Uses web-only Flutter SDK library; import 'dart:ui_web' as ui_web; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_web_plugins/flutter_web_plugins.dart'; class TestPlugin { static void registerWith(Registrar registrar) { final MethodChannel channel = MethodChannel( 'test_plugin', const StandardMethodCodec(), registrar.messenger, ); final TestPlugin testPlugin = TestPlugin(); channel.setMethodCallHandler(testPlugin.handleMethodCall); } static final List<String> calledMethods = <String>[]; Future<void> handleMethodCall(MethodCall call) async { calledMethods.add(call.method); } } void main() { // Disabling tester emulation because this test relies on real message channel communication. ui_web.debugEmulateFlutterTesterEnvironment = false; group('Plugin Registry', () { setUp(() { TestWidgetsFlutterBinding.ensureInitialized(); webPluginRegistry.registerMessageHandler(); final Registrar registrar = webPluginRegistry.registrarFor(TestPlugin); TestPlugin.registerWith(registrar); }); test('can register a plugin', () { TestPlugin.calledMethods.clear(); const MethodChannel frameworkChannel = MethodChannel('test_plugin'); frameworkChannel.invokeMethod<void>('test1'); expect(TestPlugin.calledMethods, equals(<String>['test1'])); }); test('can send a message from the plugin to the framework', () async { const StandardMessageCodec codec = StandardMessageCodec(); final List<String> loggedMessages = <String>[]; ServicesBinding.instance.defaultBinaryMessenger .setMessageHandler('test_send', (ByteData? data) { loggedMessages.add(codec.decodeMessage(data)! as String); return Future<ByteData?>.value(); }); await pluginBinaryMessenger.send( 'test_send', codec.encodeMessage('hello')); expect(loggedMessages, equals(<String>['hello'])); await pluginBinaryMessenger.send( 'test_send', codec.encodeMessage('world')); expect(loggedMessages, equals(<String>['hello', 'world'])); ServicesBinding.instance.defaultBinaryMessenger .setMessageHandler('test_send', null); }); }); }
flutter/packages/flutter_web_plugins/test/plugin_registry_test.dart/0
{ "file_path": "flutter/packages/flutter_web_plugins/test/plugin_registry_test.dart", "repo_id": "flutter", "token_count": 854 }
795
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package com.example.integration_test_example; import android.Manifest.permission; import androidx.test.rule.ActivityTestRule; import androidx.test.rule.GrantPermissionRule; import dev.flutter.plugins.integration_test.FlutterTestRunner; import io.flutter.embedding.android.FlutterActivity; import org.junit.Rule; import org.junit.runner.RunWith; /** * Demonstrates how an integration test on Android can be run with permissions already granted. This * is helpful if developers want to test native App behavior that depends on certain system service * results which are guarded with permissions. */ @RunWith(FlutterTestRunner.class) public class FlutterActivityWithPermissionTest { @Rule public GrantPermissionRule permissionRule = GrantPermissionRule.grant(permission.ACCESS_COARSE_LOCATION); @Rule public ActivityTestRule<FlutterActivity> rule = new ActivityTestRule<>(FlutterActivity.class, true, false); }
flutter/packages/integration_test/example/android/app/src/androidTest/java/com/example/integration_test_example/FlutterActivityWithPermissionTest.java/0
{ "file_path": "flutter/packages/integration_test/example/android/app/src/androidTest/java/com/example/integration_test_example/FlutterActivityWithPermissionTest.java", "repo_id": "flutter", "token_count": 306 }
796
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:io' show Platform; import 'package:flutter/material.dart'; // ignore_for_file: public_member_api_docs void startApp() => runApp(const MyApp()); class MyApp extends StatefulWidget { const MyApp({super.key}); @override State<MyApp> createState() => _MyAppState(); } class _MyAppState extends State<MyApp> { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( title: const Text('Plugin example app'), ), body: Center( child: Text('Platform: ${Platform.operatingSystem}\n'), ), ), ); } }
flutter/packages/integration_test/example/lib/my_app.dart/0
{ "file_path": "flutter/packages/integration_test/example/lib/my_app.dart", "repo_id": "flutter", "token_count": 294 }
797
# # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'integration_test_macos' s.version = '0.0.1' s.summary = 'Adapter for integration tests.' s.description = <<-DESC Runs tests that use the flutter_test API as integration tests on macOS. DESC s.homepage = 'https://github.com/flutter/flutter/tree/master/packages/integration_test/integration_test_macos' s.license = { :type => 'BSD', :text => <<-LICENSE Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. LICENSE } s.author = { 'Flutter Team' => '[email protected]' } s.source = { :http => 'https://github.com/flutter/flutter/tree/master/packages/integration_test/integration_test_macos' } s.source_files = 'Classes/**/*' s.dependency 'FlutterMacOS' s.platform = :osx, '10.11' s.swift_version = '5.0' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } end
flutter/packages/integration_test/integration_test_macos/macos/integration_test_macos.podspec/0
{ "file_path": "flutter/packages/integration_test/integration_test_macos/macos/integration_test_macos.podspec", "repo_id": "flutter", "token_count": 455 }
798
// 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 a CLI library; we use prints as part of the interface. // ignore_for_file: avoid_print import 'dart:async'; import 'dart:convert'; import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; import 'package:path/path.dart' as path; import 'common.dart'; /// Flutter Driver test output directory. /// /// Tests should write any output files to this directory. Defaults to the path /// set in the FLUTTER_TEST_OUTPUTS_DIR environment variable, or `build` if /// unset. String testOutputsDirectory = Platform.environment['FLUTTER_TEST_OUTPUTS_DIR'] ?? 'build'; /// The callback type to handle [Response.data] after the test /// succeeds. typedef ResponseDataCallback = FutureOr<void> Function(Map<String, dynamic>?); /// Writes a json-serializable data to /// [testOutputsDirectory]/`testOutputFilename.json`. /// /// This is the default `responseDataCallback` in [integrationDriver]. Future<void> writeResponseData( Map<String, dynamic>? data, { String testOutputFilename = 'integration_response_data', String? destinationDirectory, }) async { destinationDirectory ??= testOutputsDirectory; await fs.directory(destinationDirectory).create(recursive: true); final File file = fs.file(path.join( destinationDirectory, '$testOutputFilename.json', )); final String resultString = _encodeJson(data, true); await file.writeAsString(resultString); } /// Adaptor to run an integration test using `flutter drive`. /// /// To run an integration test `<test_name>.dart` using `flutter drive`, put a file named /// `<test_name>_test.dart` in the app's `test_driver` directory: /// /// ```dart /// import 'dart:async'; /// /// import 'package:integration_test/integration_test_driver.dart'; /// /// Future<void> main() async => integrationDriver(); /// /// ``` /// /// ## Parameters: /// /// `timeout` controls the longest time waited before the test ends. /// It is not necessarily the execution time for the test app: the test may /// finish sooner than the `timeout`. /// /// `responseDataCallback` is the handler for processing [Response.data]. /// The default value is `writeResponseData`. /// /// `writeResponseOnFailure` determines whether the `responseDataCallback` /// function will be called to process the [Response.data] when a test fails. /// The default value is `false`. Future<void> integrationDriver({ Duration timeout = const Duration(minutes: 20), ResponseDataCallback? responseDataCallback = writeResponseData, bool writeResponseOnFailure = false, }) async { final FlutterDriver driver = await FlutterDriver.connect(); final String jsonResult = await driver.requestData(null, timeout: timeout); final Response response = Response.fromJson(jsonResult); await driver.close(); if (response.allTestsPassed) { print('All tests passed.'); if (responseDataCallback != null) { await responseDataCallback(response.data); } exit(0); } else { print('Failure Details:\n${response.formattedFailureDetails}'); if (responseDataCallback != null && writeResponseOnFailure) { await responseDataCallback(response.data); } exit(1); } } const JsonEncoder _prettyEncoder = JsonEncoder.withIndent(' '); String _encodeJson(Map<String, dynamic>? jsonObject, bool pretty) { return pretty ? _prettyEncoder.convert(jsonObject) : json.encode(jsonObject); }
flutter/packages/integration_test/lib/integration_test_driver.dart/0
{ "file_path": "flutter/packages/integration_test/lib/integration_test_driver.dart", "repo_id": "flutter", "token_count": 1042 }
799
#include "Generated.xcconfig"
flutter_clock/analog_clock/ios/Flutter/Debug.xcconfig/0
{ "file_path": "flutter_clock/analog_clock/ios/Flutter/Debug.xcconfig", "repo_id": "flutter_clock", "token_count": 12 }
800
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'package:flutter_clock_helper/model.dart'; import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; import 'package:intl/intl.dart'; import 'package:vector_math/vector_math_64.dart' show radians; import 'container_hand.dart'; import 'drawn_hand.dart'; /// Total distance traveled by a second or a minute hand, each second or minute, /// respectively. final radiansPerTick = radians(360 / 60); /// Total distance traveled by an hour hand, each hour, in radians. final radiansPerHour = radians(360 / 12); /// A basic analog clock. /// /// You can do better than this! class AnalogClock extends StatefulWidget { const AnalogClock(this.model); final ClockModel model; @override _AnalogClockState createState() => _AnalogClockState(); } class _AnalogClockState extends State<AnalogClock> { var _now = DateTime.now(); var _temperature = ''; var _temperatureRange = ''; var _condition = ''; var _location = ''; Timer _timer; @override void initState() { super.initState(); widget.model.addListener(_updateModel); // Set the initial values. _updateTime(); _updateModel(); } @override void didUpdateWidget(AnalogClock oldWidget) { super.didUpdateWidget(oldWidget); if (widget.model != oldWidget.model) { oldWidget.model.removeListener(_updateModel); widget.model.addListener(_updateModel); } } @override void dispose() { _timer?.cancel(); widget.model.removeListener(_updateModel); super.dispose(); } void _updateModel() { setState(() { _temperature = widget.model.temperatureString; _temperatureRange = '(${widget.model.low} - ${widget.model.highString})'; _condition = widget.model.weatherString; _location = widget.model.location; }); } void _updateTime() { setState(() { _now = DateTime.now(); // Update once per second. Make sure to do it at the beginning of each // new second, so that the clock is accurate. _timer = Timer( Duration(seconds: 1) - Duration(milliseconds: _now.millisecond), _updateTime, ); }); } @override Widget build(BuildContext context) { // There are many ways to apply themes to your clock. Some are: // - Inherit the parent Theme (see ClockCustomizer in the // flutter_clock_helper package). // - Override the Theme.of(context).colorScheme. // - Create your own [ThemeData], demonstrated in [AnalogClock]. // - Create a map of [Color]s to custom keys, demonstrated in // [DigitalClock]. final customTheme = Theme.of(context).brightness == Brightness.light ? Theme.of(context).copyWith( // Hour hand. primaryColor: Color(0xFF4285F4), // Minute hand. highlightColor: Color(0xFF8AB4F8), // Second hand. accentColor: Color(0xFF669DF6), backgroundColor: Color(0xFFD2E3FC), ) : Theme.of(context).copyWith( primaryColor: Color(0xFFD2E3FC), highlightColor: Color(0xFF4285F4), accentColor: Color(0xFF8AB4F8), backgroundColor: Color(0xFF3C4043), ); final time = DateFormat.Hms().format(DateTime.now()); final weatherInfo = DefaultTextStyle( style: TextStyle(color: customTheme.primaryColor), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text(_temperature), Text(_temperatureRange), Text(_condition), Text(_location), ], ), ); return Semantics.fromProperties( properties: SemanticsProperties( label: 'Analog clock with time $time', value: time, ), child: Container( color: customTheme.backgroundColor, child: Stack( children: [ // Example of a hand drawn with [CustomPainter]. DrawnHand( color: customTheme.accentColor, thickness: 4, size: 1, angleRadians: _now.second * radiansPerTick, ), DrawnHand( color: customTheme.highlightColor, thickness: 16, size: 0.9, angleRadians: _now.minute * radiansPerTick, ), // Example of a hand drawn with [Container]. ContainerHand( color: Colors.transparent, size: 0.5, angleRadians: _now.hour * radiansPerHour + (_now.minute / 60) * radiansPerHour, child: Transform.translate( offset: Offset(0.0, -60.0), child: Container( width: 32, height: 150, decoration: BoxDecoration( color: customTheme.primaryColor, ), ), ), ), Positioned( left: 0, bottom: 0, child: Padding( padding: const EdgeInsets.all(8), child: weatherInfo, ), ), ], ), ), ); } }
flutter_clock/analog_clock/lib/analog_clock.dart/0
{ "file_path": "flutter_clock/analog_clock/lib/analog_clock.dart", "repo_id": "flutter_clock", "token_count": 2376 }
801
#include "Generated.xcconfig"
flutter_clock/digital_clock/ios/Flutter/Debug.xcconfig/0
{ "file_path": "flutter_clock/digital_clock/ios/Flutter/Debug.xcconfig", "repo_id": "flutter_clock", "token_count": 12 }
802
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'package:flutter_clock_helper/model.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; enum _Element { background, text, shadow, } final _lightTheme = { _Element.background: Color(0xFF81B3FE), _Element.text: Colors.white, _Element.shadow: Colors.black, }; final _darkTheme = { _Element.background: Colors.black, _Element.text: Colors.white, _Element.shadow: Color(0xFF174EA6), }; /// A basic digital clock. /// /// You can do better than this! class DigitalClock extends StatefulWidget { const DigitalClock(this.model); final ClockModel model; @override _DigitalClockState createState() => _DigitalClockState(); } class _DigitalClockState extends State<DigitalClock> { DateTime _dateTime = DateTime.now(); Timer _timer; @override void initState() { super.initState(); widget.model.addListener(_updateModel); _updateTime(); _updateModel(); } @override void didUpdateWidget(DigitalClock oldWidget) { super.didUpdateWidget(oldWidget); if (widget.model != oldWidget.model) { oldWidget.model.removeListener(_updateModel); widget.model.addListener(_updateModel); } } @override void dispose() { _timer?.cancel(); widget.model.removeListener(_updateModel); widget.model.dispose(); super.dispose(); } void _updateModel() { setState(() { // Cause the clock to rebuild when the model changes. }); } void _updateTime() { setState(() { _dateTime = DateTime.now(); // Update once per minute. If you want to update every second, use the // following code. _timer = Timer( Duration(minutes: 1) - Duration(seconds: _dateTime.second) - Duration(milliseconds: _dateTime.millisecond), _updateTime, ); // Update once per second, but make sure to do it at the beginning of each // new second, so that the clock is accurate. // _timer = Timer( // Duration(seconds: 1) - Duration(milliseconds: _dateTime.millisecond), // _updateTime, // ); }); } @override Widget build(BuildContext context) { final colors = Theme.of(context).brightness == Brightness.light ? _lightTheme : _darkTheme; final hour = DateFormat(widget.model.is24HourFormat ? 'HH' : 'hh').format(_dateTime); final minute = DateFormat('mm').format(_dateTime); final fontSize = MediaQuery.of(context).size.width / 3.5; final offset = -fontSize / 7; final defaultStyle = TextStyle( color: colors[_Element.text], fontFamily: 'PressStart2P', fontSize: fontSize, shadows: [ Shadow( blurRadius: 0, color: colors[_Element.shadow], offset: Offset(10, 0), ), ], ); return Container( color: colors[_Element.background], child: Center( child: DefaultTextStyle( style: defaultStyle, child: Stack( children: <Widget>[ Positioned(left: offset, top: 0, child: Text(hour)), Positioned(right: offset, bottom: offset, child: Text(minute)), ], ), ), ), ); } }
flutter_clock/digital_clock/lib/digital_clock.dart/0
{ "file_path": "flutter_clock/digital_clock/lib/digital_clock.dart", "repo_id": "flutter_clock", "token_count": 1331 }
803
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <!-- io.flutter.app.FlutterApplication is an android.app.Application that calls FlutterMain.startInitialization(this); in its onCreate method. In most cases you can leave this as-is, but you if you want to provide additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> <application android:name="io.flutter.embedding.android.FlutterPlayStoreSplitApplication" android:icon="@mipmap/ic_launcher" android:label="Flutter Gallery"> <activity android:name=".MainActivity" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:exported="true" android:hardwareAccelerated="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:windowSoftInputMode="adjustResize"> <!-- Specifies an Android theme to apply to this Activity as soon as the Android process has started. This theme is visible to the user while the Flutter UI initializes. After that, this theme continues to determine the Window background behind the Flutter UI. --> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <!-- Displays an Android View that continues showing the launch screen Drawable until Flutter paints its first frame, then this splash screen fades out. A splash screen is useful to avoid any visual gap between the end of Android's launch screen and the painting of Flutter's first frame. --> <meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" /> <!-- Don't delete the meta-data below. This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> <meta-data android:name="flutterEmbedding" android:value="2" /> </activity> <meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="78:crane,2:,3:,4:,5:,6:,7:,8:,9:,10:,11:,12:,13:,14:,15:,16:,17:,18:,19:,20:,21:,22:,23:,24:,25:,26:,27:,28:,29:,30:,31:,32:,33:,34:,35:,36:,37:,38:,39:,40:,41:,42:,43:,44:,45:,46:,47:,48:,49:,50:,51:,52:,53:,54:,55:,56:,57:,58:,59:,60:,61:,62:,63:,64:,65:,66:,67:,68:,69:,70:,71:,72:,73:,74:,75:,76:,77:,79:,80:,81:,82:,83:,84:,85:,86:,87:,88:" /> </application> <queries> <intent> <action android:name="android.intent.action.VIEW" /> <data android:scheme="https" /> </intent> </queries> </manifest>
gallery/android/app/src/main/AndroidManifest.xml/0
{ "file_path": "gallery/android/app/src/main/AndroidManifest.xml", "repo_id": "gallery", "token_count": 1141 }
804
plugins { id "com.android.dynamic-feature" id "kotlin-android" id "com.google.firebase.crashlytics" } def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file('key.properties') if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } android { namespace "io.flutter.demo.gallery.crane" compileSdkVersion 31 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } 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 } } dependencies { implementation project(":app") }
gallery/android/crane/build.gradle/0
{ "file_path": "gallery/android/crane/build.gradle", "repo_id": "gallery", "token_count": 408 }
805
// Copyright 2019 The Flutter team. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; class CodeStyle extends InheritedWidget { const CodeStyle({ super.key, this.baseStyle, this.numberStyle, this.commentStyle, this.keywordStyle, this.stringStyle, this.punctuationStyle, this.classStyle, this.constantStyle, required super.child, }); final TextStyle? baseStyle; final TextStyle? numberStyle; final TextStyle? commentStyle; final TextStyle? keywordStyle; final TextStyle? stringStyle; final TextStyle? punctuationStyle; final TextStyle? classStyle; final TextStyle? constantStyle; static CodeStyle of(BuildContext context) { return context.dependOnInheritedWidgetOfExactType<CodeStyle>()!; } @override bool updateShouldNotify(CodeStyle oldWidget) => oldWidget.baseStyle != baseStyle || oldWidget.numberStyle != numberStyle || oldWidget.commentStyle != commentStyle || oldWidget.keywordStyle != keywordStyle || oldWidget.stringStyle != stringStyle || oldWidget.punctuationStyle != punctuationStyle || oldWidget.classStyle != classStyle || oldWidget.constantStyle != constantStyle; }
gallery/lib/codeviewer/code_style.dart/0
{ "file_path": "gallery/lib/codeviewer/code_style.dart", "repo_id": "gallery", "token_count": 425 }
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:flutter/cupertino.dart'; import 'package:flutter_gen/gen_l10n/gallery_localizations.dart'; // BEGIN cupertinoSliderDemo class CupertinoSliderDemo extends StatefulWidget { const CupertinoSliderDemo({super.key}); @override State<CupertinoSliderDemo> createState() => _CupertinoSliderDemoState(); } class _CupertinoSliderDemoState extends State<CupertinoSliderDemo> with RestorationMixin { final RestorableDouble _value = RestorableDouble(25.0); final RestorableDouble _discreteValue = RestorableDouble(20.0); @override String get restorationId => 'cupertino_slider_demo'; @override void restoreState(RestorationBucket? oldBucket, bool initialRestore) { registerForRestoration(_value, 'value'); registerForRestoration(_discreteValue, 'discrete_value'); } @override Widget build(BuildContext context) { final localizations = GalleryLocalizations.of(context)!; return CupertinoPageScaffold( navigationBar: CupertinoNavigationBar( automaticallyImplyLeading: false, middle: Text(localizations.demoCupertinoSliderTitle), ), child: DefaultTextStyle( style: CupertinoTheme.of(context).textTheme.textStyle, child: Center( child: Wrap( children: [ Column( mainAxisAlignment: MainAxisAlignment.center, children: [ const SizedBox(height: 32), CupertinoSlider( value: _value.value, min: 0.0, max: 100.0, onChanged: (value) { setState(() { _value.value = value; }); }, ), CupertinoSlider( value: _value.value, min: 0.0, max: 100.0, onChanged: null, ), MergeSemantics( child: Text( localizations.demoCupertinoSliderContinuous( _value.value.toStringAsFixed(1), ), ), ), ], ), // Disabled sliders // TODO(guidezpl): See https://github.com/flutter/flutter/issues/106691 Column( mainAxisAlignment: MainAxisAlignment.center, children: [ const SizedBox(height: 32), CupertinoSlider( value: _discreteValue.value, min: 0.0, max: 100.0, divisions: 5, onChanged: (value) { setState(() { _discreteValue.value = value; }); }, ), CupertinoSlider( value: _discreteValue.value, min: 0.0, max: 100.0, divisions: 5, onChanged: null, ), MergeSemantics( child: Text( localizations.demoCupertinoSliderDiscrete( _discreteValue.value.toStringAsFixed(1), ), ), ), ], ), ], ), ), ), ); } } // END
gallery/lib/demos/cupertino/cupertino_slider_demo.dart/0
{ "file_path": "gallery/lib/demos/cupertino/cupertino_slider_demo.dart", "repo_id": "gallery", "token_count": 2068 }
807
// Copyright 2019 The Flutter team. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/gallery_localizations.dart'; import 'package:gallery/demos/material/material_demo_types.dart'; // BEGIN gridListsDemo class GridListDemo extends StatelessWidget { const GridListDemo({super.key, required this.type}); final GridListDemoType type; List<_Photo> _photos(BuildContext context) { final localizations = GalleryLocalizations.of(context)!; return [ _Photo( assetName: 'places/india_chennai_flower_market.png', title: localizations.placeChennai, subtitle: localizations.placeFlowerMarket, ), _Photo( assetName: 'places/india_tanjore_bronze_works.png', title: localizations.placeTanjore, subtitle: localizations.placeBronzeWorks, ), _Photo( assetName: 'places/india_tanjore_market_merchant.png', title: localizations.placeTanjore, subtitle: localizations.placeMarket, ), _Photo( assetName: 'places/india_tanjore_thanjavur_temple.png', title: localizations.placeTanjore, subtitle: localizations.placeThanjavurTemple, ), _Photo( assetName: 'places/india_tanjore_thanjavur_temple_carvings.png', title: localizations.placeTanjore, subtitle: localizations.placeThanjavurTemple, ), _Photo( assetName: 'places/india_pondicherry_salt_farm.png', title: localizations.placePondicherry, subtitle: localizations.placeSaltFarm, ), _Photo( assetName: 'places/india_chennai_highway.png', title: localizations.placeChennai, subtitle: localizations.placeScooters, ), _Photo( assetName: 'places/india_chettinad_silk_maker.png', title: localizations.placeChettinad, subtitle: localizations.placeSilkMaker, ), _Photo( assetName: 'places/india_chettinad_produce.png', title: localizations.placeChettinad, subtitle: localizations.placeLunchPrep, ), _Photo( assetName: 'places/india_tanjore_market_technology.png', title: localizations.placeTanjore, subtitle: localizations.placeMarket, ), _Photo( assetName: 'places/india_pondicherry_beach.png', title: localizations.placePondicherry, subtitle: localizations.placeBeach, ), _Photo( assetName: 'places/india_pondicherry_fisherman.png', title: localizations.placePondicherry, subtitle: localizations.placeFisherman, ), ]; } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( automaticallyImplyLeading: false, title: Text(GalleryLocalizations.of(context)!.demoGridListsTitle), ), body: GridView.count( restorationId: 'grid_view_demo_grid_offset', crossAxisCount: 2, mainAxisSpacing: 8, crossAxisSpacing: 8, padding: const EdgeInsets.all(8), childAspectRatio: 1, children: _photos(context).map<Widget>((photo) { return _GridDemoPhotoItem( photo: photo, tileStyle: type, ); }).toList(), ), ); } } class _Photo { _Photo({ required this.assetName, required this.title, required this.subtitle, }); final String assetName; final String title; final String subtitle; } /// Allow the text size to shrink to fit in the space class _GridTitleText extends StatelessWidget { const _GridTitleText(this.text); final String text; @override Widget build(BuildContext context) { return FittedBox( fit: BoxFit.scaleDown, alignment: AlignmentDirectional.centerStart, child: Text(text), ); } } class _GridDemoPhotoItem extends StatelessWidget { const _GridDemoPhotoItem({ required this.photo, required this.tileStyle, }); final _Photo photo; final GridListDemoType tileStyle; @override Widget build(BuildContext context) { final Widget image = Semantics( label: '${photo.title} ${photo.subtitle}', child: Material( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)), clipBehavior: Clip.antiAlias, child: Image.asset( photo.assetName, package: 'flutter_gallery_assets', fit: BoxFit.cover, ), ), ); switch (tileStyle) { case GridListDemoType.imageOnly: return image; case GridListDemoType.header: return GridTile( header: Material( color: Colors.transparent, shape: const RoundedRectangleBorder( borderRadius: BorderRadius.vertical(top: Radius.circular(4)), ), clipBehavior: Clip.antiAlias, child: GridTileBar( title: _GridTitleText(photo.title), backgroundColor: Colors.black45, ), ), child: image, ); case GridListDemoType.footer: return GridTile( footer: Material( color: Colors.transparent, shape: const RoundedRectangleBorder( borderRadius: BorderRadius.vertical(bottom: Radius.circular(4)), ), clipBehavior: Clip.antiAlias, child: GridTileBar( backgroundColor: Colors.black45, title: _GridTitleText(photo.title), subtitle: _GridTitleText(photo.subtitle), ), ), child: image, ); } } } // END
gallery/lib/demos/material/grid_list_demo.dart/0
{ "file_path": "gallery/lib/demos/material/grid_list_demo.dart", "repo_id": "gallery", "token_count": 2533 }
808
// Copyright 2019 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:animations/animations.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/gallery_localizations.dart'; // BEGIN openContainerTransformDemo const String _loremIpsumParagraph = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod ' 'tempor incididunt ut labore et dolore magna aliqua. Vulputate dignissim ' 'suspendisse in est. Ut ornare lectus sit amet. Eget nunc lobortis mattis ' 'aliquam faucibus purus in. Hendrerit gravida rutrum quisque non tellus ' 'orci ac auctor. Mattis aliquam faucibus purus in massa. Tellus rutrum ' 'tellus pellentesque eu tincidunt tortor. Nunc eget lorem dolor sed. Nulla ' 'at volutpat diam ut venenatis tellus in metus. Tellus cras adipiscing enim ' 'eu turpis. Pretium fusce id velit ut tortor. Adipiscing enim eu turpis ' 'egestas pretium. Quis varius quam quisque id. Blandit aliquam etiam erat ' 'velit scelerisque. In nisl nisi scelerisque eu. Semper risus in hendrerit ' 'gravida rutrum quisque. Suspendisse in est ante in nibh mauris cursus ' 'mattis molestie. Adipiscing elit duis tristique sollicitudin nibh sit ' 'amet commodo nulla. Pretium viverra suspendisse potenti nullam ac tortor ' 'vitae.\n' '\n' 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod ' 'tempor incididunt ut labore et dolore magna aliqua. Vulputate dignissim ' 'suspendisse in est. Ut ornare lectus sit amet. Eget nunc lobortis mattis ' 'aliquam faucibus purus in. Hendrerit gravida rutrum quisque non tellus ' 'orci ac auctor. Mattis aliquam faucibus purus in massa. Tellus rutrum ' 'tellus pellentesque eu tincidunt tortor. Nunc eget lorem dolor sed. Nulla ' 'at volutpat diam ut venenatis tellus in metus. Tellus cras adipiscing enim ' 'eu turpis. Pretium fusce id velit ut tortor. Adipiscing enim eu turpis ' 'egestas pretium. Quis varius quam quisque id. Blandit aliquam etiam erat ' 'velit scelerisque. In nisl nisi scelerisque eu. Semper risus in hendrerit ' 'gravida rutrum quisque. Suspendisse in est ante in nibh mauris cursus ' 'mattis molestie. Adipiscing elit duis tristique sollicitudin nibh sit ' 'amet commodo nulla. Pretium viverra suspendisse potenti nullam ac tortor ' 'vitae'; const double _fabDimension = 56; class OpenContainerTransformDemo extends StatefulWidget { const OpenContainerTransformDemo({super.key}); @override State<OpenContainerTransformDemo> createState() => _OpenContainerTransformDemoState(); } class _OpenContainerTransformDemoState extends State<OpenContainerTransformDemo> { final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>(); ContainerTransitionType _transitionType = ContainerTransitionType.fade; void _showSettingsBottomModalSheet(BuildContext context) { final localizations = GalleryLocalizations.of(context); showModalBottomSheet<void>( context: context, builder: (context) { return StatefulBuilder( builder: (context, setModalState) { return Container( height: 125, padding: const EdgeInsets.all(15), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( localizations!.demoContainerTransformModalBottomSheetTitle, style: Theme.of(context).textTheme.bodySmall, ), const SizedBox( height: 12, ), ToggleButtons( borderRadius: BorderRadius.circular(2), selectedBorderColor: Theme.of(context).colorScheme.primary, onPressed: (index) { setModalState(() { setState(() { _transitionType = index == 0 ? ContainerTransitionType.fade : ContainerTransitionType.fadeThrough; }); }); }, isSelected: <bool>[ _transitionType == ContainerTransitionType.fade, _transitionType == ContainerTransitionType.fadeThrough, ], children: [ Text( localizations.demoContainerTransformTypeFade, ), Padding( padding: const EdgeInsets.symmetric( horizontal: 10, ), child: Text( localizations.demoContainerTransformTypeFadeThrough, ), ), ], ), ], ), ); }, ); }, ); } @override Widget build(BuildContext context) { final localizations = GalleryLocalizations.of(context); final colorScheme = Theme.of(context).colorScheme; return Navigator( // Adding [ValueKey] to make sure that the widget gets rebuilt when // changing type. key: ValueKey(_transitionType), onGenerateRoute: (settings) { return MaterialPageRoute<void>( builder: (context) => Scaffold( key: _scaffoldKey, appBar: AppBar( automaticallyImplyLeading: false, title: Column( children: [ Text( localizations!.demoContainerTransformTitle, ), Text( '(${localizations.demoContainerTransformDemoInstructions})', style: Theme.of(context) .textTheme .titleSmall! .copyWith(color: Colors.white), ), ], ), actions: [ IconButton( icon: const Icon( Icons.settings, ), onPressed: () { _showSettingsBottomModalSheet(context); }, ), ], ), body: ListView( padding: const EdgeInsets.all(8), children: [ _OpenContainerWrapper( transitionType: _transitionType, closedBuilder: (context, openContainer) { return _DetailsCard(openContainer: openContainer); }, ), const SizedBox(height: 16), _OpenContainerWrapper( transitionType: _transitionType, closedBuilder: (context, openContainer) { return _DetailsListTile(openContainer: openContainer); }, ), const SizedBox( height: 16, ), Row( children: [ Expanded( child: _OpenContainerWrapper( transitionType: _transitionType, closedBuilder: (context, openContainer) { return _SmallDetailsCard( openContainer: openContainer, subtitle: localizations.demoMotionPlaceholderSubtitle, ); }, ), ), const SizedBox( width: 8, ), Expanded( child: _OpenContainerWrapper( transitionType: _transitionType, closedBuilder: (context, openContainer) { return _SmallDetailsCard( openContainer: openContainer, subtitle: localizations.demoMotionPlaceholderSubtitle, ); }, ), ), ], ), const SizedBox( height: 16, ), Row( children: [ Expanded( child: _OpenContainerWrapper( transitionType: _transitionType, closedBuilder: (context, openContainer) { return _SmallDetailsCard( openContainer: openContainer, subtitle: localizations .demoMotionSmallPlaceholderSubtitle, ); }, ), ), const SizedBox( width: 8, ), Expanded( child: _OpenContainerWrapper( transitionType: _transitionType, closedBuilder: (context, openContainer) { return _SmallDetailsCard( openContainer: openContainer, subtitle: localizations .demoMotionSmallPlaceholderSubtitle, ); }, ), ), const SizedBox( width: 8, ), Expanded( child: _OpenContainerWrapper( transitionType: _transitionType, closedBuilder: (context, openContainer) { return _SmallDetailsCard( openContainer: openContainer, subtitle: localizations .demoMotionSmallPlaceholderSubtitle, ); }, ), ), ], ), const SizedBox( height: 16, ), ...List.generate(10, (index) { return OpenContainer<bool>( transitionType: _transitionType, openBuilder: (context, openContainer) => const _DetailsPage(), tappable: false, closedShape: const RoundedRectangleBorder(), closedElevation: 0, closedBuilder: (context, openContainer) { return ListTile( leading: Image.asset( 'placeholders/avatar_logo.png', package: 'flutter_gallery_assets', width: 40, ), onTap: openContainer, title: Text( '${localizations.demoMotionListTileTitle} ${index + 1}', ), subtitle: Text( localizations.demoMotionPlaceholderSubtitle, ), ); }, ); }), ], ), floatingActionButton: OpenContainer( transitionType: _transitionType, openBuilder: (context, openContainer) => const _DetailsPage(), closedElevation: 6, closedShape: const RoundedRectangleBorder( borderRadius: BorderRadius.all( Radius.circular(_fabDimension / 2), ), ), closedColor: colorScheme.secondary, closedBuilder: (context, openContainer) { return SizedBox( height: _fabDimension, width: _fabDimension, child: Center( child: Icon( Icons.add, color: colorScheme.onSecondary, ), ), ); }, ), ), ); }, ); } } class _OpenContainerWrapper extends StatelessWidget { const _OpenContainerWrapper({ required this.closedBuilder, required this.transitionType, }); final CloseContainerBuilder closedBuilder; final ContainerTransitionType transitionType; @override Widget build(BuildContext context) { return OpenContainer<bool>( transitionType: transitionType, openBuilder: (context, openContainer) => const _DetailsPage(), tappable: false, closedBuilder: closedBuilder, ); } } class _DetailsCard extends StatelessWidget { const _DetailsCard({required this.openContainer}); final VoidCallback openContainer; @override Widget build(BuildContext context) { final localizations = GalleryLocalizations.of(context)!; return _InkWellOverlay( openContainer: openContainer, height: 300, child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Expanded( child: Container( color: Colors.black38, child: Center( child: Image.asset( 'placeholders/placeholder_image.png', package: 'flutter_gallery_assets', width: 100, ), ), ), ), ListTile( title: Text( localizations.demoMotionPlaceholderTitle, ), subtitle: Text( localizations.demoMotionPlaceholderSubtitle, ), ), Padding( padding: const EdgeInsets.only( left: 16, right: 16, bottom: 16, ), child: Text( 'Lorem ipsum dolor sit amet, consectetur ' 'adipiscing elit, sed do eiusmod tempor.', style: Theme.of(context).textTheme.bodyMedium!.copyWith( color: Colors.black54, inherit: false, ), ), ), ], ), ); } } class _SmallDetailsCard extends StatelessWidget { const _SmallDetailsCard({ required this.openContainer, required this.subtitle, }); final VoidCallback openContainer; final String subtitle; @override Widget build(BuildContext context) { final textTheme = Theme.of(context).textTheme; return _InkWellOverlay( openContainer: openContainer, height: 225, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( color: Colors.black38, height: 150, child: Center( child: Image.asset( 'placeholders/placeholder_image.png', package: 'flutter_gallery_assets', width: 80, ), ), ), Expanded( child: Padding( padding: const EdgeInsets.all(10), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( GalleryLocalizations.of(context)! .demoMotionPlaceholderTitle, style: textTheme.titleLarge, ), const SizedBox( height: 4, ), Text( subtitle, style: textTheme.bodySmall, ), ], ), ), ), ], ), ); } } class _DetailsListTile extends StatelessWidget { const _DetailsListTile({required this.openContainer}); final VoidCallback openContainer; @override Widget build(BuildContext context) { final textTheme = Theme.of(context).textTheme; const height = 120.0; return _InkWellOverlay( openContainer: openContainer, height: height, child: Row( children: [ Container( color: Colors.black38, height: height, width: height, child: Center( child: Image.asset( 'placeholders/placeholder_image.png', package: 'flutter_gallery_assets', width: 60, ), ), ), Expanded( child: Padding( padding: const EdgeInsets.all(20), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( GalleryLocalizations.of(context)! .demoMotionPlaceholderTitle, style: textTheme.titleMedium, ), const SizedBox( height: 8, ), Text( 'Lorem ipsum dolor sit amet, consectetur ' 'adipiscing elit,', style: textTheme.bodySmall, ), ], ), ), ), ], ), ); } } class _InkWellOverlay extends StatelessWidget { const _InkWellOverlay({ required this.openContainer, required this.height, required this.child, }); final VoidCallback openContainer; final double height; final Widget child; @override Widget build(BuildContext context) { return SizedBox( height: height, child: InkWell( onTap: openContainer, child: child, ), ); } } class _DetailsPage extends StatelessWidget { const _DetailsPage(); @override Widget build(BuildContext context) { final localizations = GalleryLocalizations.of(context)!; final textTheme = Theme.of(context).textTheme; return Scaffold( appBar: AppBar( title: Text( localizations.demoMotionDetailsPageTitle, ), ), body: ListView( children: [ Container( color: Colors.black38, height: 250, child: Padding( padding: const EdgeInsets.all(70), child: Image.asset( 'placeholders/placeholder_image.png', package: 'flutter_gallery_assets', ), ), ), Padding( padding: const EdgeInsets.all(20), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( localizations.demoMotionPlaceholderTitle, style: textTheme.headlineSmall!.copyWith( color: Colors.black54, fontSize: 30, ), ), const SizedBox( height: 10, ), Text( _loremIpsumParagraph, style: textTheme.bodyMedium!.copyWith( color: Colors.black54, height: 1.5, fontSize: 16, ), ), ], ), ), ], ), ); } } // END openContainerTransformDemo
gallery/lib/demos/reference/motion_demo_container_transition.dart/0
{ "file_path": "gallery/lib/demos/reference/motion_demo_container_transition.dart", "repo_id": "gallery", "token_count": 11044 }
809
{ "loading": "Laai tans", "deselect": "Ontkies", "select": "Kies", "selectable": "Kiesbaar (langdruk)", "selected": "Gekies", "demo": "Demonstrasie", "bottomAppBar": "Onderste appbalk", "notSelected": "Nie gekies nie", "demoCupertinoSearchTextFieldTitle": "Soekteksveld", "demoCupertinoPicker": "Kieser", "demoCupertinoSearchTextFieldSubtitle": "Soekteksveld in iOS-styl", "demoCupertinoSearchTextFieldDescription": "’n Soekteksveld waarmee die gebruiker kan soek deur teks in te voer, en wat voorstelle kan gee en filtreer.", "demoCupertinoSearchTextFieldPlaceholder": "Voer ’n bietjie teks in", "demoCupertinoScrollbarTitle": "Rolbalk", "demoCupertinoScrollbarSubtitle": "Rolbalk in iOS-styl", "demoCupertinoScrollbarDescription": "’n Rolbalk wat die bepaalde kind toemaak", "demoTwoPaneItem": "Item {value}", "demoTwoPaneList": "Lys", "demoTwoPaneFoldableLabel": "Opvoubaar", "demoTwoPaneSmallScreenLabel": "Klein skerm", "demoTwoPaneSmallScreenDescription": "Dit is hoe TwoPane op ’n kleinskermtoestel werk.", "demoTwoPaneTabletLabel": "Tablet/rekenaar", "demoTwoPaneTabletDescription": "Dit is hoe TwoPane op ’n groter skerm, soos ’n tablet of rekenaar, werk.", "demoTwoPaneTitle": "TwoPane", "demoTwoPaneSubtitle": "Reagerende uitlegte op opvoubare, groot en klein skerms", "splashSelectDemo": "Kies ’n demonstrasie", "demoTwoPaneFoldableDescription": "Dit is hoe TwoPane op ’n opvoubare toestel werk.", "demoTwoPaneDetails": "Besonderhede", "demoTwoPaneSelectItem": "Kies ’n item", "demoTwoPaneItemDetails": "Item {value} se besonderhede", "demoCupertinoContextMenuActionText": "Tik en hou die Flutter-logo om die kontekskieslys te sien.", "demoCupertinoContextMenuDescription": "’n Kontekstuele volskermkieslys in die iOS-styl wat verskyn wanneer ’n element gelangdruk word.", "demoAppBarTitle": "Appbalk", "demoAppBarDescription": "Die programbalk verskaf inhoud en handelinge wat met die huidige skerm verband hou. Dit word vir handelsmerke, skermtitels, navigasie en handelinge gebruik", "demoDividerTitle": "Verdeler", "demoDividerSubtitle": "’n Verdeler is ’n dun lyn wat inhoud op lyste en uitlegte groepeer.", "demoDividerDescription": "Verdelers kan in lyste, laaie en elders gebruik word om inhoud te skei.", "demoVerticalDividerTitle": "Vertikale verdeler", "demoCupertinoContextMenuTitle": "Kontekskieslys", "demoCupertinoContextMenuSubtitle": "iOS-stylkontekskieslys", "demoAppBarSubtitle": "Wys inligting en handelinge wat met die huidige skerm verband hou", "demoCupertinoContextMenuActionOne": "Handeling een", "demoCupertinoContextMenuActionTwo": "Handeling twee", "demoDateRangePickerDescription": "Wys ’n dialoog met ’n Materiaalontwerp-datumreekskieser.", "demoDateRangePickerTitle": "Datumreekskieser", "demoNavigationDrawerUserName": "Gebruikernaam", "demoNavigationDrawerUserEmail": "[email protected]", "demoNavigationDrawerText": "Swiep van die rand af of tik op die ikoon links bo om die laai te sien", "demoNavigationRailTitle": "Navigasiespoor", "demoNavigationRailSubtitle": "Wys 'n navigasiespoor binne 'n program", "demoNavigationRailDescription": "'n Materiaallegstuk wat bedoel is om links of regs van 'n program gewys te word om te navigeer tussen 'n klein aantal aansigte, gewoonlik tussen drie en vyf.", "demoNavigationRailFirst": "Eerste", "demoNavigationDrawerTitle": "Navigasielaai", "demoNavigationRailThird": "Derde", "replyStarredLabel": "Gester", "demoTextButtonDescription": "'n Teksknoppie wys 'n inkspatsel wanneer dit gedruk word maar word nie gelig nie. Gebruik teksknoppies op nutsbalke, in dialoë en inlyn met opvulling", "demoElevatedButtonTitle": "Verhewe knoppie", "demoElevatedButtonDescription": "Verhewe knoppies voeg dimensie by vir uitlegte wat meestal plat is. Hulle beklemtoon funksies in besige of wye ruimtes.", "demoOutlinedButtonTitle": "Buitelynknoppie", "demoOutlinedButtonDescription": "Buitelynknoppies word ondeursigtig en verhewe wanneer hulle gedruk word. Hulle word dikwels met verhewe knoppies saamgebind om 'n alternatiewe, sekondêre handeling aan te dui.", "demoContainerTransformDemoInstructions": "Kaarte, lyste en sweefhandelingknoppie", "demoNavigationDrawerSubtitle": "Wys 'n laai binne programbalk", "replyDescription": "'n Doeltreffende, gefokusde e-posprogram", "demoNavigationDrawerDescription": "'n Materiaalontwerppaneel wat horisontaal van die rand van die skerm af gly om navigasieskakels in 'n program te wys.", "replyDraftsLabel": "Konsepte", "demoNavigationDrawerToPageOne": "Item een", "replyInboxLabel": "Inkassie", "demoSharedXAxisDemoInstructions": "Volgende- en Terugknoppie", "replySpamLabel": "Strooipos", "replyTrashLabel": "Asblik", "replySentLabel": "Gestuur", "demoNavigationRailSecond": "Tweede", "demoNavigationDrawerToPageTwo": "Item twee", "demoFadeScaleDemoInstructions": "Modaal en FAB", "demoFadeThroughDemoInstructions": "Navigasie onder", "demoSharedZAxisDemoInstructions": "Instellingsikoonknoppie", "demoSharedYAxisDemoInstructions": "Rangskik volgens \"Onlangs gespeel\"", "demoTextButtonTitle": "Teksknoppie", "demoSharedZAxisBeefSandwichRecipeTitle": "Beesvleistoebroodjie", "demoSharedZAxisDessertRecipeDescription": "Nageregresep", "demoSharedYAxisAlbumTileSubtitle": "Kunstenaar", "demoSharedYAxisAlbumTileTitle": "Album", "demoSharedYAxisRecentSortTitle": "Onlangs gespeel", "demoSharedYAxisAlphabeticalSortTitle": "A-Z", "demoSharedYAxisAlbumCount": "268 albums", "demoSharedYAxisTitle": "Gedeelde y-as", "demoSharedXAxisCreateAccountButtonText": "SKEP REKENING", "demoFadeScaleAlertDialogDiscardButton": "GOOI WEG", "demoSharedXAxisSignInTextFieldLabel": "E-posadres of foonnommer", "demoSharedXAxisSignInSubtitleText": "Meld aan by jou rekening.", "demoSharedXAxisSignInWelcomeText": "Hallo David Park", "demoSharedXAxisIndividualCourseSubtitle": "Word individueel gewys", "demoSharedXAxisBundledCourseSubtitle": "Gebondel", "demoFadeThroughAlbumsDestination": "Albums", "demoSharedXAxisDesignCourseTitle": "Ontwerp", "demoSharedXAxisIllustrationCourseTitle": "Illustrasie", "demoSharedXAxisBusinessCourseTitle": "Besigheid", "demoSharedXAxisArtsAndCraftsCourseTitle": "Kuns en kunsvlyt", "demoMotionPlaceholderSubtitle": "Sekondêre teks", "demoFadeScaleAlertDialogCancelButton": "KANSELLEER", "demoFadeScaleAlertDialogHeader": "Waarskuwingdialoog", "demoFadeScaleHideFabButton": "VERSTEEK FAB", "demoFadeScaleShowFabButton": "WYS FAB", "demoFadeScaleShowAlertDialogButton": "WYS MODAAL", "demoFadeScaleDescription": "Die doofpatroon word gebruik vir UI-elemente wat binne die grense van die skerm inkom of uitgaan, soos 'n dialoog wat in die middel van die skerm verdof.", "demoFadeScaleTitle": "Doof", "demoFadeThroughTextPlaceholder": "123 foto's", "demoFadeThroughSearchDestination": "Soek", "demoFadeThroughPhotosDestination": "Foto's", "demoSharedXAxisCoursePageSubtitle": "Gebondelde kategorieë verskyn as groepe in jou stroom. Jy kan dit altyd later verander.", "demoFadeThroughDescription": "Die deurdoofpatroon word gebruik vir oorgang tussen UI-elemente wat nie 'n sterk vehouding met mekaar het nie.", "demoFadeThroughTitle": "Deurdoof", "demoSharedZAxisHelpSettingLabel": "Hulp", "demoMotionSubtitle": "Al die voorafgedefinieerde oorgangspatrone", "demoSharedZAxisNotificationSettingLabel": "Kennisgewings", "demoSharedZAxisProfileSettingLabel": "Profiel", "demoSharedZAxisSavedRecipesListTitle": "Gestoorde resepte", "demoSharedZAxisBeefSandwichRecipeDescription": "Beesvleistoebroodjieresep", "demoSharedZAxisCrabPlateRecipeDescription": "Krapbordresep", "demoSharedXAxisCoursePageTitle": "Stroomlyn jou kursusse", "demoSharedZAxisCrabPlateRecipeTitle": "Krap", "demoSharedZAxisShrimpPlateRecipeDescription": "Garnaalbordresep", "demoSharedZAxisShrimpPlateRecipeTitle": "Garnaal", "demoContainerTransformTypeFadeThrough": "DEURDOOF", "demoSharedZAxisDessertRecipeTitle": "Nagereg", "demoSharedZAxisSandwichRecipeDescription": "Toebroodjieresep", "demoSharedZAxisSandwichRecipeTitle": "Toebroodjie", "demoSharedZAxisBurgerRecipeDescription": "Burgerresep", "demoSharedZAxisBurgerRecipeTitle": "Burger", "demoSharedZAxisSettingsPageTitle": "Instellings", "demoSharedZAxisTitle": "Gedeelde z-as", "demoSharedZAxisPrivacySettingLabel": "Privaatheid", "demoMotionTitle": "Beweging", "demoContainerTransformTitle": "Houeromskepping", "demoContainerTransformDescription": "Die houeromskeppingpatroon is ontwerp vir oorgang tussen UI-elemente wat 'n houer insluit. Die patroon skep 'n sigbare verbinding tussen twee UI-elemente", "demoContainerTransformModalBottomSheetTitle": "Doofmodus", "demoContainerTransformTypeFade": "DOOF", "demoSharedYAxisAlbumTileDurationUnit": "min.", "demoMotionPlaceholderTitle": "Titel", "demoSharedXAxisForgotEmailButtonText": "E-POSADRES VERGEET?", "demoMotionSmallPlaceholderSubtitle": "Sekondêr", "demoMotionDetailsPageTitle": "Besonderhedebladsy", "demoMotionListTileTitle": "Lysitem", "demoSharedAxisDescription": "Die gedeelde-aspatroon word gebruik vir oorgang tussen die UI-elemente wat 'n ruimtelike of navigasieverhouding het. Die patroon gebruik 'n gedeelde omskepping op die x-, y- of z-as om die verhouding tussen elemente te versterk.", "demoSharedXAxisTitle": "Gedeelde x-as", "demoSharedXAxisBackButtonText": "TERUG", "demoSharedXAxisNextButtonText": "VOLGENDE", "demoSharedXAxisCulinaryCourseTitle": "Kookkuns", "githubRepo": "GitHub-bewaarplek {repoName}", "fortnightlyMenuUS": "VSA", "fortnightlyMenuBusiness": "Besigheid", "fortnightlyMenuScience": "Wetenskap", "fortnightlyMenuSports": "Sport", "fortnightlyMenuTravel": "Reis", "fortnightlyMenuCulture": "Kultuur", "fortnightlyTrendingTechDesign": "Tegnologieontwerp", "rallyBudgetDetailAmountLeft": "Bedrag oor", "fortnightlyHeadlineArmy": "Hervorm die groenweermag van binne af", "fortnightlyDescription": "'n Inhoudgefokusde nuusprogram", "rallyBillDetailAmountDue": "Bedrag verskuldig", "rallyBudgetDetailTotalCap": "Totaallimiet", "rallyBudgetDetailAmountUsed": "Bedrag gebruik", "fortnightlyTrendingHealthcareRevolution": "Gesondheidsorgrevolusie", "fortnightlyMenuFrontPage": "Voorblad", "fortnightlyMenuWorld": "Wêreld", "rallyBillDetailAmountPaid": "Bedrag betaal", "fortnightlyMenuPolitics": "Politiek", "fortnightlyHeadlineBees": "Terkort aan landboubye", "fortnightlyHeadlineGasoline": "Die toekoms van petrol", "fortnightlyTrendingGreenArmy": "Groenweermag", "fortnightlyHeadlineFeminists": "Feministe takel partydigheid", "fortnightlyHeadlineFabrics": "Ontwerpers gebruik tegnologie om futuristiese materiale te maak", "fortnightlyHeadlineStocks": "Terwyl aandele stagneer, bekyk baie mense valuta", "fortnightlyTrendingReform": "Hervorming", "fortnightlyMenuTech": "Tegnologie", "fortnightlyHeadlineWar": "Verdeelde Amerikaanse lewens tydens oorlog", "fortnightlyHeadlineHealthcare": "Die stil dog kragtige gesondheidsorgrevolusie", "fortnightlyLatestUpdates": "Jongste opdaterings", "fortnightlyTrendingStocks": "Aandele", "rallyBillDetailTotalAmount": "Totale bedrag", "demoCupertinoPickerDateTime": "Datum en tyd", "signIn": "MELD AAN", "dataTableRowWithSugar": "{value} met suiker", "dataTableRowApplePie": "Appeltert", "dataTableRowDonut": "Oliebol", "dataTableRowHoneycomb": "Heuningkoek", "dataTableRowLollipop": "Stokkielekker", "dataTableRowJellyBean": "Jellieboontjie", "dataTableRowGingerbread": "Gemmerbrood", "dataTableRowCupcake": "Kolwyntjie", "dataTableRowEclair": "Eclair", "dataTableRowIceCreamSandwich": "Roomystoebroodjie", "dataTableRowFrozenYogurt": "Bevrore jogurt", "dataTableColumnIron": "Yster (%)", "dataTableColumnCalcium": "Kalsium (%)", "dataTableColumnSodium": "Sodium (mg)", "demoTimePickerTitle": "Tydkieser", "demo2dTransformationsResetTooltip": "Stel transformasies terug", "dataTableColumnFat": "Vet (g)", "dataTableColumnCalories": "Kalorieë", "dataTableColumnDessert": "Nagereg (1 porsie)", "cardsDemoTravelDestinationLocation1": "Thanjavur, Tamil Nadu", "demoTimePickerDescription": "Wys 'n dialoog met 'n materiaalontwerp-tydkieser.", "demoPickersShowPicker": "WYS KIESER", "demoTabsScrollingTitle": "Rollees", "demoTabsNonScrollingTitle": "Nie-rollees", "craneHours": "{hours,plural,=1{1 u.}other{{hours} u.}}", "craneMinutes": "{minutes,plural,=1{1 m.}other{{minutes} m.}}", "craneFlightDuration": "{hoursShortForm} {minutesShortForm}", "dataTableHeader": "Voeding", "demoDatePickerTitle": "Datumkieser", "demoPickersSubtitle": "Keuse van datum en tyd", "demoPickersTitle": "Kiesers", "demo2dTransformationsEditTooltip": "Wysig teël", "demoDataTableDescription": "Datatabelle wys inligting in ’n roosterformaat met rye en kolomme. Dit organiseer inligting op ’n manier wat maklik is om noukeurig te bestudeer sodat gebruikers patrone en insigte kan kry.", "demo2dTransformationsDescription": "Tik om teëls te wysig en gebruik gebare om op die toneel rond te beweeg. Sleep om te beeldrol, knyp om te zoem, gebruik twee vingers om te draai. Druk die terugstellingknoppie om na die aanvanklike oriëntasie terug te keer.", "demo2dTransformationsSubtitle": "Beeldrol, zoem en draai", "demo2dTransformationsTitle": "2D-transformasies", "demoCupertinoTextFieldPIN": "PIN", "demoCupertinoTextFieldDescription": "'n Teksveld stel die gebruiker in staat om teks in te voer, hetsy met 'n hardewaresleutelbord of 'n sleutelbord op die skerm.", "demoCupertinoTextFieldSubtitle": "Teksvelde in iOS-styl", "demoCupertinoTextFieldTitle": "Teksvelde", "demoDatePickerDescription": "Wys 'n dialoog met 'n materiaalontwerp-datumkieser.", "demoCupertinoPickerTime": "Tyd", "demoCupertinoPickerDate": "Datum", "demoCupertinoPickerTimer": "Afteller", "demoCupertinoPickerDescription": "’n Kieserlegstuk in iOS-styl wat gebruik kan word om stringe, datums, tye of sowel datum as tyd te kies.", "demoCupertinoPickerSubtitle": "Kiesers in iOS-styl", "demoCupertinoPickerTitle": "Kiesers", "dataTableRowWithHoney": "{value} met heuning", "cardsDemoTravelDestinationCity2": "Chettinad", "bannerDemoResetText": "Stel die banier terug", "bannerDemoMultipleText": "Veelvuldige handelinge", "bannerDemoLeadingText": "Eerste ikoon", "dismiss": "MAAK TOE", "cardsDemoTappable": "Tikbaar", "cardsDemoSelectable": "Kiesbaar (langdruk)", "cardsDemoExplore": "Verken", "cardsDemoExploreSemantics": "Verken {destinationName}", "cardsDemoShareSemantics": "Deel {destinationName}", "cardsDemoTravelDestinationTitle1": "Top-10-stede om te besoek in Tamil Nadu", "cardsDemoTravelDestinationDescription1": "Nommer 10", "cardsDemoTravelDestinationCity1": "Thanjavur", "dataTableColumnProtein": "Proteïen (g)", "cardsDemoTravelDestinationTitle2": "Ambagslui van Suid-Indië", "cardsDemoTravelDestinationDescription2": "Syspinners", "bannerDemoText": "Jou wagwoord is op jou ander toestel opgedateer. Meld asseblief weer aan.", "cardsDemoTravelDestinationLocation2": "Sivaganga, Tamil Nadu", "cardsDemoTravelDestinationTitle3": "Brihadisvara-tempel", "cardsDemoTravelDestinationDescription3": "Tempels", "demoBannerTitle": "Banier", "demoBannerSubtitle": "Wys 'n banier binne 'n lys", "demoBannerDescription": "'n Banier vertoon 'n belangrike, bondige boodskap en verskaf handelinge waaraan gebruikers moet aandag gee (of hulle moet die banier toemaak). 'n Gebruikerhandeling word vereis om dit toe te maak.", "demoCardTitle": "Kaarte", "demoCardSubtitle": "Basislynkaarte met geronde hoeke", "demoCardDescription": "'n Kaart is 'n sigblad met materiaal wat gebruik word om verwante inligting te verteenwoordig, soos byvoorbeeld 'n album, 'n geografiese ligging, 'n maaltyd, kontakbesonderhede, ens.", "demoDataTableTitle": "Datatabelle", "demoDataTableSubtitle": "Rye en kolomme inligting", "dataTableColumnCarbs": "Koolhidrate (g)", "placeTanjore": "Tanjore", "demoGridListsTitle": "Roosterlyste", "placeFlowerMarket": "Blommemark", "placeBronzeWorks": "Bronswerke", "placeMarket": "Mark", "placeThanjavurTemple": "Thanjavur-tempel", "placeSaltFarm": "Soutplaas", "placeScooters": "Bromponies", "placeSilkMaker": "Symaker", "placeLunchPrep": "Middagetevoorbereiding", "placeBeach": "Strand", "placeFisherman": "Visser", "demoMenuSelected": "Gekies: {value}", "demoMenuRemove": "Verwyder", "demoMenuGetLink": "Kry skakel", "demoMenuShare": "Deel", "demoBottomAppBarSubtitle": "Wys navigasie en handelinge aan die onderkant", "demoMenuAnItemWithASectionedMenu": "'n Item met 'n verdeelde kieslys", "demoMenuADisabledMenuItem": "Gedeaktiveerde kieslysitem", "demoLinearProgressIndicatorTitle": "Lineêre vorderingaanwyser", "demoMenuContextMenuItemOne": "Kontekskieslysitem een", "demoMenuAnItemWithASimpleMenu": "'n Item met 'n eenvoudige kieslys", "demoCustomSlidersTitle": "Gepasmaakte glyers", "demoMenuAnItemWithAChecklistMenu": "'n Item met 'n kontrolelyskieslys", "demoCupertinoActivityIndicatorTitle": "Aktiwiteitverklikker", "demoCupertinoActivityIndicatorSubtitle": "iOS-stylaktiwiteitaanwysers", "demoCupertinoActivityIndicatorDescription": "'n iOS-stylaktiwiteitaanwyser wat kloksgewys draai.", "demoCupertinoNavigationBarTitle": "Navigasiebalk", "demoCupertinoNavigationBarSubtitle": "Navigasiebalk in iOS-styl", "demoCupertinoNavigationBarDescription": "'n Navigasiebalk in iOS-styl. Die navigasiebalk is 'n nutsbalk wat bestaan uit minstens 'n bladsytitel in die middel van die nutsbalk.", "demoCupertinoPullToRefreshTitle": "Trek om te herlaai", "demoCupertinoPullToRefreshSubtitle": "Trek-om-te-herlaai-kontrole in iOS-styl", "demoCupertinoPullToRefreshDescription": "'n Legstuk wat die trek-om-te-herlaai-inhoudkontrole in iOS-styl instel.", "demoProgressIndicatorTitle": "Vorderingaanwysers", "demoProgressIndicatorSubtitle": "Lineêr, sirkelvormig, onbepaald", "demoCircularProgressIndicatorTitle": "Sirkelvormige vorderingaanwyser", "demoCircularProgressIndicatorDescription": "'n Sirkelvormige materiaalontwerp-vorderingaanwyser wat draai om aan te dui dat die toepassing besig is.", "demoMenuFour": "Vier", "demoLinearProgressIndicatorDescription": "'n Lineêre materiaalontwerp-vorderingaanwyser, ook bekend as 'n vorderingsbalk.", "demoTooltipTitle": "Nutswenke", "demoTooltipSubtitle": "Kort boodskap wat gewys word wanneer daar lank gedruk of gehou word", "demoTooltipDescription": "Nutswenke verskaf teksetikette wat help om die funksie van 'n knoppie of ander gebruikerkoppelvlakhandeling te verduidelik. Nutswenke wys insiggewende teks wanneer gebruikers oor 'n element hou, op een fokus, of lank op een druk.", "demoTooltipInstructions": "Druk lank of hou om die nutswenk te wys.", "placeChennai": "Chennai", "demoMenuChecked": "Gemerk: {value}", "placeChettinad": "Chettinad", "demoMenuPreview": "Voorskou", "demoBottomAppBarTitle": "Onderste programbalk", "demoBottomAppBarDescription": "Onderste programbalke bied toegang tot 'n onderste navigasielaai en tot vier handelinge, insluitend die swewende handelingknoppie.", "bottomAppBarNotch": "Keep", "bottomAppBarPosition": "Posisie van swewende handelingknoppie", "bottomAppBarPositionDockedEnd": "Gedok – einde", "bottomAppBarPositionDockedCenter": "Gedok – middel", "bottomAppBarPositionFloatingEnd": "Swewend – einde", "bottomAppBarPositionFloatingCenter": "Swewend – middel", "demoSlidersEditableNumericalValue": "Wysigbare numeriese waarde", "demoGridListsSubtitle": "Ry- en kolomuitleg", "demoGridListsDescription": "Roosterlyste is die geskikste vir die aanbieding van gelyksoortige data, tipies prente. Elke item op 'n roosterlys word 'n teël genoem.", "demoGridListsImageOnlyTitle": "Net prent", "demoGridListsHeaderTitle": "Met opskrif", "demoGridListsFooterTitle": "Met voetskrif", "demoSlidersTitle": "Glyers", "demoSlidersSubtitle": "Legstukke om 'n waarde te kies deur te swiep", "demoSlidersDescription": "Glyers weerspieël 'n reeks waardes langs 'n balk, waarop gebruikers 'n enkelwaarde kan kies. Hulle is ideaal daarvoor om instellings soos volume of helderheid te verstel, of om prentfilters toe te pas.", "demoRangeSlidersTitle": "Reeksglyers", "demoRangeSlidersDescription": "Glyers weerspieël 'n reeks waardes langs 'n balk. Hulle kan ikone op albei punte van die balk hê wat 'n reeks waardes weerspieël. Hulle is ideaal daarvoor om instellings soos volume of helderheid te verstel, of om prentfilters toe te pas.", "demoMenuAnItemWithAContextMenuButton": "'n Item met 'n kontekskieslys", "demoCustomSlidersDescription": "Glyers weerspieël 'n reeks waardes langs 'n balk, waarop gebruikers 'n enkelwaarde of 'n reeks waardes kan kies. Die glyers kan temas hê en gepasmaak word.", "demoSlidersContinuousWithEditableNumericalValue": "Aaneenlopend met wysigbare numeriese waarde", "demoSlidersDiscrete": "Diskreet", "demoSlidersDiscreteSliderWithCustomTheme": "Diskrete glyer met gepasmaakte tema", "demoSlidersContinuousRangeSliderWithCustomTheme": "Aaneenlopende reeksglyer met gepasmaakte tema", "demoSlidersContinuous": "Aaneenlopend", "placePondicherry": "Pondicherry", "demoMenuTitle": "Kieslys", "demoContextMenuTitle": "Kontekskieslys", "demoSectionedMenuTitle": "Verdeelde kieslys", "demoSimpleMenuTitle": "Eenvoudige kieslys", "demoChecklistMenuTitle": "Kontrolelyskieslys", "demoMenuSubtitle": "Kielysknoppies en eenvoudige kieslyste", "demoMenuDescription": "'n Kieslys wys 'n lys keuses op 'n tydelike oppervlakte. Hulle verskyn wanneer 'n gebruiker interaksie met 'n knoppie, handeling of ander kontrole het.", "demoMenuItemValueOne": "Kieslysitem een", "demoMenuItemValueTwo": "Kieslysitem twee", "demoMenuItemValueThree": "Kieslysitem drie", "demoMenuOne": "Een", "demoMenuTwo": "Twee", "demoMenuThree": "Drie", "demoMenuContextMenuItemThree": "Kontekskieslysitem drie", "demoCupertinoSwitchSubtitle": "Skakelaar in iOS-styl", "demoSnackbarsText": "Dit is 'n teksbalk.", "demoCupertinoSliderSubtitle": "Glyer in iOS-styl", "demoCupertinoSliderDescription": "'n Glyer kan gebruik word om uit óf 'n aaneenlopende óf 'n diskrete stel waardes te kies.", "demoCupertinoSliderContinuous": "Aaneenlopend: {value}", "demoCupertinoSliderDiscrete": "Diskreet: {value}", "demoSnackbarsAction": "Jy het die teksbalkhandeling gedruk.", "backToGallery": "Terug na galery", "demoCupertinoTabBarTitle": "Oortjiebalk", "demoCupertinoSwitchDescription": "'n Skakelaar word gebruik om 'n enkele instelling aan of af te skakel.", "demoSnackbarsActionButtonLabel": "HANDELING", "cupertinoTabBarProfileTab": "Profiel", "demoSnackbarsButtonLabel": "WYS 'N TEKSBALK", "demoSnackbarsDescription": "Teksbalke lig gebruikers in oor ’n proses wat ’n program uitgevoer het of gaan uitvoer. Hulle verskyn tydelik naby die onderkant van die skerm. Hulle behoort nie die gebruikerervaring te onderbreek nie en geen gebruikerhandeling is nodig om hulle te laat verdwyn nie.", "demoSnackbarsSubtitle": "Teksbalke wys boodskappe aan die onderkant van die skerm", "demoSnackbarsTitle": "Teksbalke", "demoCupertinoSliderTitle": "Glyer", "cupertinoTabBarChatTab": "Klets", "cupertinoTabBarHomeTab": "Tuis", "demoCupertinoTabBarDescription": "'n Onderste navigasie-oortjiebalk in iOS-styl. Wys veelvuldige oortjies met een aktiewe oortjie; dit is by verstek die eerste oortjie.", "demoCupertinoTabBarSubtitle": "Onderste oortjiebalk in iOS-styl", "demoOptionsFeatureTitle": "Sien opsies", "demoOptionsFeatureDescription": "Tik hier om beskikbare opsies vir hierdie demonstrasie te bekyk.", "demoCodeViewerCopyAll": "KOPIEER ALLES", "shrineScreenReaderRemoveProductButton": "Verwyder {product}", "shrineScreenReaderProductAddToCart": "Voeg by mandjie", "shrineScreenReaderCart": "{quantity,plural,=0{Inkopiemandjie, geen items nie}=1{Inkopiemandjie, 1 item}other{Inkopiemandjie, {quantity} items}}", "demoCodeViewerFailedToCopyToClipboardMessage": "Kon nie na knipbord kopieer nie: {error}", "demoCodeViewerCopiedToClipboardMessage": "Gekopieer na knipbord.", "craneSleep8SemanticLabel": "Maja-ruïnes op 'n krans bo 'n strand", "craneSleep4SemanticLabel": "Hotel aan die oewer van 'n meer voor berge", "craneSleep2SemanticLabel": "Machu Picchu-sitadel", "craneSleep1SemanticLabel": "Chalet in 'n sneeulandskap met immergroen bome", "craneSleep0SemanticLabel": "Hutte bo die water", "craneFly13SemanticLabel": "Strandswembad met palmbome", "craneFly12SemanticLabel": "Swembad met palmbome", "craneFly11SemanticLabel": "Baksteenvuurtoring by die see", "craneFly10SemanticLabel": "Al-Azhar-moskeetorings tydens sonsondergang", "craneFly9SemanticLabel": "Man wat teen 'n antieke blou motor leun", "craneFly8SemanticLabel": "Supertree Grove", "craneEat9SemanticLabel": "Kafeetoonbank met fyngebak", "craneEat2SemanticLabel": "Burger", "craneFly5SemanticLabel": "Hotel aan die oewer van 'n meer voor berge", "demoSelectionControlsSubtitle": "Merkblokkies, klinkknoppies en skakelaars", "craneEat10SemanticLabel": "Vrou wat 'n yslike pastramitoebroodjie vashou", "craneFly4SemanticLabel": "Hutte bo die water", "craneEat7SemanticLabel": "Bakkeryingang", "craneEat6SemanticLabel": "Garnaalgereg", "craneEat5SemanticLabel": "Artistieke restaurant se sitgebied", "craneEat4SemanticLabel": "Sjokoladepoeding", "craneEat3SemanticLabel": "Koreaanse taco", "craneFly3SemanticLabel": "Machu Picchu-sitadel", "craneEat1SemanticLabel": "Leë kroeg met padkafeetipe stoele", "craneEat0SemanticLabel": "Pizza in 'n houtoond", "craneSleep11SemanticLabel": "Taipei 101-wolkekrabber", "craneSleep10SemanticLabel": "Al-Azhar-moskeetorings tydens sonsondergang", "craneSleep9SemanticLabel": "Baksteenvuurtoring by die see", "craneEat8SemanticLabel": "Bord met varswaterkreef", "craneSleep7SemanticLabel": "Kleurryke woonstelle by Riberia Square", "craneSleep6SemanticLabel": "Swembad met palmbome", "craneSleep5SemanticLabel": "Tent in 'n veld", "settingsButtonCloseLabel": "Maak instellings toe", "demoSelectionControlsCheckboxDescription": "Merkblokkies maak dit vir die gebruiker moontlik om veelvuldige opsies uit 'n stel te kies. 'n Normale merkblokkie se waarde is waar of vals, en 'n driestaatmerkblokkie se waarde kan ook nul wees.", "settingsButtonLabel": "Instellings", "demoListsTitle": "Lyste", "demoListsSubtitle": "Rollysuitlegte", "demoListsDescription": "'n Enkele ry met vaste hoogte wat gewoonlik 'n bietjie teks bevat, asook 'n ikoon vooraan of agteraan.", "demoOneLineListsTitle": "Een reël", "demoTwoLineListsTitle": "Twee reëls", "demoListsSecondary": "Sekondêre teks", "demoSelectionControlsTitle": "Seleksiekontroles", "craneFly7SemanticLabel": "Rushmoreberg", "demoSelectionControlsCheckboxTitle": "Merkblokkie", "craneSleep3SemanticLabel": "Man wat teen 'n antieke blou motor leun", "demoSelectionControlsRadioTitle": "Radio", "demoSelectionControlsRadioDescription": "Klinkknoppies maak dit vir die gebruiker moontlik om een opsie uit 'n stel te kies. Gebruik klinkknoppies vir 'n uitsluitende keuse as jy dink dat die gebruiker alle beskikbare opsies langs mekaar moet sien.", "demoSelectionControlsSwitchTitle": "Wissel", "demoSelectionControlsSwitchDescription": "Aan/af-skakelaars wissel die staat van ’n enkele instellingsopsie. Die opsie wat die skakelaar beheer, asook die staat waarin dit is, moet uit die ooreenstemmende inlynetiket duidelik wees.", "craneFly0SemanticLabel": "Chalet in 'n sneeulandskap met immergroen bome", "craneFly1SemanticLabel": "Tent in 'n veld", "craneFly2SemanticLabel": "Gebedsvlae voor 'n sneeubedekte berg", "craneFly6SemanticLabel": "Lugaansig van Palacio de Bellas Artes", "rallySeeAllAccounts": "Sien alle rekeninge", "rallyBillAmount": "{billName}-rekening van {amount} is betaalbaar op {date}.", "shrineTooltipCloseCart": "Maak mandjie toe", "shrineTooltipCloseMenu": "Maak kieslys toe", "shrineTooltipOpenMenu": "Maak kieslys oop", "shrineTooltipSettings": "Instellings", "shrineTooltipSearch": "Soek", "demoTabsDescription": "Oortjies organiseer inhoud oor verskillende skerms, datastelle, en ander interaksies heen.", "demoTabsSubtitle": "Oortjies met aansigte waardeur jy onafhanklik kan rollees", "demoTabsTitle": "Oortjies", "rallyBudgetAmount": "{budgetName}-begroting met {amountUsed} gebruik van {amountTotal}; {amountLeft} oor", "shrineTooltipRemoveItem": "Verwyder item", "rallyAccountAmount": "{accountName}-rekening {accountNumber} met {amount}.", "rallySeeAllBudgets": "Sien alle begrotings", "rallySeeAllBills": "Sien alle rekeninge", "craneFormDate": "Kies datum", "craneFormOrigin": "Kies oorsprong", "craneFly2": "Khumbu-vallei, Nepal", "craneFly3": "Machu Picchu, Peru", "craneFly4": "Malé, Maledive", "craneFly5": "Vitznau, Switserland", "craneFly6": "Meksikostad, Meksiko", "craneFly7": "Mount Rushmore, Verenigde State", "settingsTextDirectionLocaleBased": "Gegrond op locale", "craneFly9": "Havana, Kuba", "craneFly10": "Kaïro, Egipte", "craneFly11": "Lissabon, Portugal", "craneFly12": "Napa, Verenigde State", "craneFly13": "Bali, Indonesië", "craneSleep0": "Malé, Maledive", "craneSleep1": "Aspen, Verenigde State", "craneSleep2": "Machu Picchu, Peru", "demoCupertinoSegmentedControlTitle": "Gesegmenteerde kontrole", "craneSleep4": "Vitznau, Switserland", "craneSleep5": "Big Sur, Verenigde State", "craneSleep6": "Napa, Verenigde State", "craneSleep7": "Porto, Portugal", "craneSleep8": "Tulum, Meksiko", "craneEat5": "Seoel 06236 Suid-Korea", "demoChipTitle": "Skyfies", "demoChipSubtitle": "Kompakte elemente wat 'n invoer, kenmerk of handeling verteenwoordig", "demoActionChipTitle": "Handelingskyfie", "demoActionChipDescription": "Handelingskyfies is 'n stel opsies wat 'n handeling wat met primêre inhoud verband hou, veroorsaak. Handelingskyfies behoort dinamies en kontekstueel in 'n UI te verskyn.", "demoChoiceChipTitle": "Keuseskyfie", "demoChoiceChipDescription": "Keuseskyfies verteenwoordig 'n enkele keuse van 'n stel af. Keuseskyfies bevat beskrywende teks of kategorieë.", "demoFilterChipTitle": "Filterskyfie", "demoFilterChipDescription": "Filterskyfies gebruik merkers of beskrywende woorde om inhoud te filtreer.", "demoInputChipTitle": "Invoerskyfie", "demoInputChipDescription": "Invoerskyfies verteenwoordig 'n komplekse stuk inligting, soos 'n entiteit (persoon, plek of ding) of gespreksteks, in 'n kompakte vorm.", "craneSleep9": "Lissabon, Portugal", "craneEat10": "Lissabon, Portugal", "demoCupertinoSegmentedControlDescription": "Word gebruik om tussen 'n aantal wedersyds eksklusiewe opsies te kies. As een opsie in die gesegmenteerde kontrole gekies is, sal die ander opsies in die gesegmenteerde kontrole nie meer gekies wees nie.", "chipTurnOnLights": "Skakel ligte aan", "chipSmall": "Klein", "chipMedium": "Middelgroot", "chipLarge": "Groot", "chipElevator": "Hysbak", "chipWasher": "Wasmasjien", "chipFireplace": "Kaggel", "chipBiking": "Fietsry", "craneFormDiners": "Eetplekke", "rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{Verhoog jou potensiële belastingaftrekking! Wys kategorieë toe aan 1 ontoegewysde transaksie.}other{Verhoog jou potensiële belastingaftrekking! Wys kategorieë toe aan {count} ontoegewysde transaksies.}}", "craneFormTime": "Kies tyd", "craneFormLocation": "Kies ligging", "craneFormTravelers": "Reisigers", "craneEat8": "Atlanta, Verenigde State", "craneFormDestination": "Kies bestemming", "craneFormDates": "Kies datums", "craneFly": "VLIEG", "craneSleep": "SLAAP", "craneEat": "EET", "craneFlySubhead": "Verken vlugte volgens bestemming", "craneSleepSubhead": "Verken eiendomme volgens bestemming", "craneEatSubhead": "Verken restaurante volgens bestemming", "craneFlyStops": "{numberOfStops,plural,=0{Stopvry}=1{1 stop}other{{numberOfStops} stoppe}}", "craneSleepProperties": "{totalProperties,plural,=0{Geen beskikbare eiendomme nie}=1{1 beskikbare eiendom}other{{totalProperties} beskikbare eiendomme}}", "craneEatRestaurants": "{totalRestaurants,plural,=0{Geen restaurante nie}=1{1 restaurant}other{{totalRestaurants} restaurante}}", "craneFly0": "Aspen, Verenigde State", "demoCupertinoSegmentedControlSubtitle": "Gesegmenteerde kontrole in iOS-styl", "craneSleep10": "Kaïro, Egipte", "craneEat9": "Madrid, Spanje", "craneFly1": "Big Sur, Verenigde State", "craneEat7": "Nashville, Verenigde State", "craneEat6": "Seattle, Verenigde State", "craneFly8": "Singapoer", "craneEat4": "Parys, Frankryk", "craneEat3": "Portland, Verenigde State", "craneEat2": "Córdoba, Argentinië", "craneEat1": "Dallas, Verenigde State", "craneEat0": "Napels, Italië", "craneSleep11": "Taipei, Taiwan", "craneSleep3": "Havana, Kuba", "shrineLogoutButtonCaption": "MELD AF", "rallyTitleBills": "REKENINGE", "rallyTitleAccounts": "REKENINGE", "shrineProductVagabondSack": "Vagabond-sak", "rallyAccountDetailDataInterestYtd": "Rente in jaar tot nou", "shrineProductWhitneyBelt": "Whitney-belt", "shrineProductGardenStrand": "Tuindraad", "shrineProductStrutEarrings": "Strut-oorbelle", "shrineProductVarsitySocks": "Universiteitskouse", "shrineProductWeaveKeyring": "Geweefde sleutelhouer", "shrineProductGatsbyHat": "Gatsby-hoed", "shrineProductShrugBag": "Shrug-sak", "shrineProductGiltDeskTrio": "Drietal vergulde tafels", "shrineProductCopperWireRack": "Koperdraadrak", "shrineProductSootheCeramicSet": "Soothe-keramiekstel", "shrineProductHurrahsTeaSet": "Hurrahs-teestel", "shrineProductBlueStoneMug": "Blou erdebeker", "shrineProductRainwaterTray": "Reënwaterlaai", "shrineProductChambrayNapkins": "Chambray-servette", "shrineProductSucculentPlanters": "Vetplantplanter", "shrineProductQuartetTable": "Kwartettafel", "shrineProductKitchenQuattro": "Kombuiskwartet", "shrineProductClaySweater": "Clay-oortrektrui", "shrineProductSeaTunic": "Seetuniek", "shrineProductPlasterTunic": "Gipstuniek", "rallyBudgetCategoryRestaurants": "Restaurante", "shrineProductChambrayShirt": "Chambray-hemp", "shrineProductSeabreezeSweater": "Sea Breeze-trui", "shrineProductGentryJacket": "Herebaadjie", "shrineProductNavyTrousers": "Vlootblou broek", "shrineProductWalterHenleyWhite": "Walter henley (wit)", "shrineProductSurfAndPerfShirt": "\"Surf and perf\"-t-hemp", "shrineProductGingerScarf": "Gemmerkleurige serp", "shrineProductRamonaCrossover": "Ramona-oorkruissak", "shrineProductClassicWhiteCollar": "Klassieke wit kraag", "shrineProductSunshirtDress": "Sunshirt-rok", "rallyAccountDetailDataInterestRate": "Rentekoers", "rallyAccountDetailDataAnnualPercentageYield": "Jaarpersentasie-opbrengs", "rallyAccountDataVacation": "Vakansie", "shrineProductFineLinesTee": "T-hemp met dun strepies", "rallyAccountDataHomeSavings": "Spaarrekening vir huis", "rallyAccountDataChecking": "Tjek", "rallyAccountDetailDataInterestPaidLastYear": "Rente wat verlede jaar betaal is", "rallyAccountDetailDataNextStatement": "Volgende staat", "rallyAccountDetailDataAccountOwner": "Rekeningeienaar", "rallyBudgetCategoryCoffeeShops": "Koffiewinkels", "rallyBudgetCategoryGroceries": "Kruideniersware", "shrineProductCeriseScallopTee": "Kersierooi skulprand-t-hemp", "rallyBudgetCategoryClothing": "Klere", "rallySettingsManageAccounts": "Bestuur rekeninge", "rallyAccountDataCarSavings": "Spaarrekening vir motor", "rallySettingsTaxDocuments": "Belastingdokumente", "rallySettingsPasscodeAndTouchId": "Wagkode en raak-ID", "rallySettingsNotifications": "Kennisgewings", "rallySettingsPersonalInformation": "Persoonlike inligting", "rallySettingsPaperlessSettings": "Paperless-instellings", "rallySettingsFindAtms": "Soek OTM'e", "rallySettingsHelp": "Hulp", "rallySettingsSignOut": "Meld af", "rallyAccountTotal": "Totaal", "rallyBillsDue": "Betaalbaar", "rallyBudgetLeft": "Oor", "rallyAccounts": "Rekeninge", "rallyBills": "Rekeninge", "rallyBudgets": "Begrotings", "rallyAlerts": "Waarskuwings", "rallySeeAll": "SIEN ALLES", "rallyFinanceLeft": "OOR", "rallyTitleOverview": "OORSIG", "shrineProductShoulderRollsTee": "Skouerrol-t-hemp", "shrineNextButtonCaption": "VOLGENDE", "rallyTitleBudgets": "BEGROTINGS", "rallyTitleSettings": "INSTELLINGS", "rallyLoginLoginToRally": "Meld by Rally aan", "rallyLoginNoAccount": "Het jy nie 'n rekening nie?", "rallyLoginSignUp": "SLUIT AAN", "rallyLoginUsername": "Gebruikernaam", "rallyLoginPassword": "Wagwoord", "rallyLoginLabelLogin": "Meld aan", "rallyLoginRememberMe": "Onthou my", "rallyLoginButtonLogin": "MELD AAN", "rallyAlertsMessageHeadsUpShopping": "Pasop. Jy het al {percent} van jou inkopiebegroting vir hierdie maand gebruik.", "rallyAlertsMessageSpentOnRestaurants": "Jy het hierdie week {amount} by restaurante bestee.", "rallyAlertsMessageATMFees": "Jy het hierdie maand kitsbankfooie van {amount} betaal", "rallyAlertsMessageCheckingAccount": "Mooi so! Jou tjekrekening is {percent} hoër as verlede maand.", "shrineMenuCaption": "KIESLYS", "shrineCategoryNameAll": "ALLES", "shrineCategoryNameAccessories": "BYKOMSTIGHEDE", "shrineCategoryNameClothing": "KLERE", "shrineCategoryNameHome": "TUIS", "shrineLoginUsernameLabel": "Gebruikernaam", "shrineLoginPasswordLabel": "Wagwoord", "shrineCancelButtonCaption": "KANSELLEER", "shrineCartTaxCaption": "Belasting:", "shrineCartPageCaption": "MANDJIE", "shrineProductQuantity": "Hoeveelheid: {quantity}", "shrineProductPrice": "x {price}", "shrineCartItemCount": "{quantity,plural,=0{GEEN ITEMS NIE}=1{1 ITEM}other{{quantity} ITEMS}}", "shrineCartClearButtonCaption": "MAAK MANDJIE LEEG", "shrineCartTotalCaption": "TOTAAL", "shrineCartSubtotalCaption": "Subtotaal:", "shrineCartShippingCaption": "Versending:", "shrineProductGreySlouchTank": "Grys slenterhemp", "shrineProductStellaSunglasses": "Stella-sonbrille", "shrineProductWhitePinstripeShirt": "Wit strepieshemp", "demoTextFieldWhereCanWeReachYou": "Waar kan ons jou bereik?", "settingsTextDirectionLTR": "L.N.R.", "settingsTextScalingLarge": "Groot", "demoBottomSheetHeader": "Loopkop", "demoBottomSheetItem": "Item {value}", "demoBottomTextFieldsTitle": "Teksvelde", "demoTextFieldTitle": "Teksvelde", "demoTextFieldSubtitle": "Een reël met redigeerbare teks en syfers", "demoTextFieldDescription": "Teksvelde laat gebruikers toe om teks by UI te voeg. Dit verskyn gewoonlik in vorms en dialoë.", "demoTextFieldShowPasswordLabel": "Wys wagwoord", "demoTextFieldHidePasswordLabel": "Versteek wagwoord", "demoTextFieldFormErrors": "Maak asseblief die foute in rooi reg voordat jy indien.", "demoTextFieldNameRequired": "Naam word vereis.", "demoTextFieldOnlyAlphabeticalChars": "Voer asseblief net alfabetkarakters in.", "demoTextFieldEnterUSPhoneNumber": "(###) ###-#### – Voer 'n Amerikaanse foonnommer in.", "demoTextFieldEnterPassword": "Voer asseblief 'n wagwoord in.", "demoTextFieldPasswordsDoNotMatch": "Die wagwoorde stem nie ooreen nie", "demoTextFieldWhatDoPeopleCallYou": "Wat noem mense jou?", "demoTextFieldNameField": "Naam*", "demoBottomSheetButtonText": "WYS BLAD ONDER", "demoTextFieldPhoneNumber": "Foonnommer*", "demoBottomSheetTitle": "Blad onder", "demoTextFieldEmail": "E-pos", "demoTextFieldTellUsAboutYourself": "Vertel ons meer oor jouself (bv., skryf neer wat jy doen of wat jou stokperdjies is)", "demoTextFieldKeepItShort": "Hou dit kort; dis net 'n demonstrasie.", "starterAppGenericButton": "KNOPPIE", "demoTextFieldLifeStory": "Lewensverhaal", "demoTextFieldSalary": "Salaris", "demoTextFieldUSD": "USD", "demoTextFieldNoMoreThan": "Nie meer as 8 karakters nie.", "demoTextFieldPassword": "Wagwoord*", "demoTextFieldRetypePassword": "Tik jou wagwoord weer in*", "demoTextFieldSubmit": "DIEN IN", "demoBottomNavigationSubtitle": "Navigasie aan die onderkant met kruisverdowwingaansigte", "demoBottomSheetAddLabel": "Voeg by", "demoBottomSheetModalDescription": "'n Modale blad aan die onderkant van die skerm is 'n alternatief vir 'n kieslys of dialoog. Dit verhoed dat die gebruiker met die res van die program interaksie kan hê.", "demoBottomSheetModalTitle": "Modale blad aan die onderkant", "demoBottomSheetPersistentDescription": "'n Blywende blad aan die onderkant van die skerm wys inligting wat die primêre inhoud van die program aanvul. Dit bly sigbaar, selfs wanneer die gebruiker met ander dele van die program interaksie het.", "demoBottomSheetPersistentTitle": "Blywende blad onder", "demoBottomSheetSubtitle": "Blywende en modale blaaie onder", "demoTextFieldNameHasPhoneNumber": "{name} se foonnommer is {phoneNumber}", "buttonText": "KNOPPIE", "demoTypographyDescription": "Definisies vir die verskillende tipografiese style wat in Materiaalontwerp gevind word.", "demoTypographySubtitle": "Al die voorafgedefinieerde teksstyle", "demoTypographyTitle": "Tipografie", "demoFullscreenDialogDescription": "Die volskermdialoog-eienskap spesifiseer of die inkomende bladsy 'n volskerm- modale dialoog is", "demoFlatButtonDescription": "'n Plat knoppie wys 'n inkspatsel wanneer dit gedruk word maar word nie gelig nie. Gebruik plat knoppies op nutsbalke, in dialoë en inlyn met opvulling", "demoBottomNavigationDescription": "Navigasiebalke aan die onderkant van die skerm wys drie tot vyf bestemmings. Elke bestemming word deur 'n ikoon en 'n opsionele teksetiket verteenwoordig. Wanneer 'n gebruiker op 'n onderste navigasie-ikoon tik, word hulle geneem na die topvlak-navigasiebestemming wat met daardie ikoon geassosieer word.", "demoBottomNavigationSelectedLabel": "Gekose etiket", "demoBottomNavigationPersistentLabels": "Blywende etikette", "starterAppDrawerItem": "Item {value}", "demoTextFieldRequiredField": "* dui vereiste veld aan", "demoBottomNavigationTitle": "Navigasie onder", "settingsLightTheme": "Lig", "settingsTheme": "Tema", "settingsPlatformIOS": "iOS", "settingsPlatformAndroid": "Android", "settingsTextDirectionRTL": "R.N.L.", "settingsTextScalingHuge": "Baie groot", "cupertinoButton": "Knoppie", "settingsTextScalingNormal": "Normaal", "settingsTextScalingSmall": "Klein", "settingsSystemDefault": "Stelsel", "settingsTitle": "Instellings", "rallyDescription": "'n Program vir jou persoonlike geldsake", "aboutDialogDescription": "Besoek die {repoLink} om hierdie program se bronkode te sien.", "bottomNavigationCommentsTab": "Opmerkings", "starterAppGenericBody": "Liggaam", "starterAppGenericHeadline": "Hoofopskrif", "starterAppGenericSubtitle": "Subtitel", "starterAppGenericTitle": "Titel", "starterAppTooltipSearch": "Soek", "starterAppTooltipShare": "Deel", "starterAppTooltipFavorite": "Merk as gunsteling", "starterAppTooltipAdd": "Voeg by", "bottomNavigationCalendarTab": "Kalender", "starterAppDescription": "'n Beginneruitleg wat goed reageer", "starterAppTitle": "Beginnerprogram", "aboutFlutterSamplesRepo": "Flutter toets GitHub-bewaarplek", "bottomNavigationContentPlaceholder": "Plekhouer vir {title}-oortjie", "bottomNavigationCameraTab": "Kamera", "bottomNavigationAlarmTab": "Wekker", "bottomNavigationAccountTab": "Rekening", "demoTextFieldYourEmailAddress": "Jou e-posadres", "demoToggleButtonDescription": "Wisselknoppies kan gebruik word om verwante opsies te groepeer. Om 'n groep verwante wisselknoppies te beklemtoon, moet 'n groep 'n gemeenskaplike houer deel", "colorsGrey": "GRYS", "colorsBrown": "BRUIN", "colorsDeepOrange": "DIEPORANJE", "colorsOrange": "ORANJE", "colorsAmber": "GEELBRUIN", "colorsYellow": "GEEL", "colorsLime": "LEMMETJIEGROEN", "colorsLightGreen": "LIGGROEN", "colorsGreen": "GROEN", "homeHeaderGallery": "Galery", "homeHeaderCategories": "Kategorieë", "shrineDescription": "'n Modieuse kleinhandelprogram", "craneDescription": "'n Gepersonaliseerde reisprogram", "homeCategoryReference": "STYLE EN ANDER", "demoInvalidURL": "Kon nie URL wys nie:", "demoOptionsTooltip": "Opsies", "demoInfoTooltip": "Inligting", "demoCodeTooltip": "Demonstrasiekode", "demoDocumentationTooltip": "API-dokumentasie", "demoFullscreenTooltip": "Volskerm", "settingsTextScaling": "Teksskalering", "settingsTextDirection": "Teksrigting", "settingsLocale": "Locale", "settingsPlatformMechanics": "Platformmeganika", "settingsDarkTheme": "Donker", "settingsSlowMotion": "Stadige aksie", "settingsAbout": "Meer oor Flutter Gallery", "settingsFeedback": "Stuur terugvoer", "settingsAttribution": "Ontwerp deur TOASTER in Londen", "demoButtonTitle": "Knoppies", "demoButtonSubtitle": "Teks, verhewe, buitelyn en meer", "demoFlatButtonTitle": "Plat knoppie", "demoRaisedButtonDescription": "Verhewe knoppies voeg dimensie by vir uitlegte wat meestal plat is. Hulle beklemtoon funksies in besige of breë ruimtes.", "demoRaisedButtonTitle": "Verhewe knoppie", "demoOutlineButtonTitle": "Buitelynknoppie", "demoOutlineButtonDescription": "Buitelynknoppies word ondeursigtig en verhewe wanneer dit gedruk word. Hulle word dikwels met verhewe knoppies saamgebind om 'n alternatiewe, sekondêre handeling aan te dui.", "demoToggleButtonTitle": "Wisselknoppies", "colorsTeal": "BLOUGROEN", "demoFloatingButtonTitle": "Swewende handelingknoppie", "demoFloatingButtonDescription": "'n Swewende handelingknoppie is 'n ronde ikoonknoppie wat oor inhoud hang om 'n primêre handeling in die program te bevorder.", "demoDialogTitle": "Dialoë", "demoDialogSubtitle": "Eenvoudig, opletberig, en volskerm", "demoAlertDialogTitle": "Opletberig", "demoAlertDialogDescription": "'n Opletberigdialoog lig die gebruiker in oor situasies wat erkenning nodig het. 'n Opletberigdialoog het 'n opsionele titel en 'n opsionele lys handelinge.", "demoAlertTitleDialogTitle": "Opletberig met titel", "demoSimpleDialogTitle": "Eenvoudig", "demoSimpleDialogDescription": "'n Eenvoudige dialoog bied die gebruiker 'n keuse tussen verskeie opsies. 'n Eenvoudige dialoog het 'n opsionele titel wat bo die keuses gewys word.", "demoFullscreenDialogTitle": "Volskerm", "demoCupertinoButtonsTitle": "Knoppies", "demoCupertinoButtonsSubtitle": "Knoppies in iOS-styl", "demoCupertinoButtonsDescription": "'n Knoppie in iOS-styl. Dit bring teks en/of 'n ikoon in wat verdof of duideliker word met aanraking. Het die opsie om 'n agtergrond te hê.", "demoCupertinoAlertsTitle": "Opletberigte", "demoCupertinoAlertsSubtitle": "Opletberigdialoë in iOS-styl", "demoCupertinoAlertTitle": "Opletberig", "demoCupertinoAlertDescription": "'n Opletberigdialoog lig die gebruiker in oor situasies wat erkenning nodig het. 'n Opletberigdialoog het 'n opsionele titel, opsionele inhoud en 'n opsionele lys handelinge. Die titel word bo die inhoud vertoon en die handelinge word onder die inhoud vertoon.", "demoCupertinoAlertWithTitleTitle": "Opletberig met titel", "demoCupertinoAlertButtonsTitle": "Opletberig met knoppies", "demoCupertinoAlertButtonsOnlyTitle": "Net opletberigknoppies", "demoCupertinoActionSheetTitle": "Handelingelys", "demoCupertinoActionSheetDescription": "'n Handelingelys is 'n spesifieke styl opletberig wat 'n stel van twee of meer keuses wat met die huidige konteks verband hou, aan die gebruiker bied. 'n Handelingelys kan 'n titel, 'n bykomende boodskap en 'n lys handelinge hê.", "demoColorsTitle": "Kleure", "demoColorsSubtitle": "Al die vooraf gedefinieerde kleure", "demoColorsDescription": "Kleur en kleurmonsterkonstantes wat Materiaalontwerp se kleurpalet verteenwoordig.", "buttonTextEnabled": "ENABLED", "buttonTextDisabled": "DISABLED", "buttonTextCreate": "Skep", "dialogSelectedOption": "Jy het gekies: \"{value}\"", "dialogDiscardTitle": "Gooi konsep weg?", "dialogLocationTitle": "Gebruik Google se liggingdiens?", "dialogLocationDescription": "Laat Google programme help om ligging te bepaal. Dit beteken dat anonieme liggingdata na Google toe gestuur word, selfs wanneer geen programme laat loop word nie.", "dialogCancel": "KANSELLEER", "dialogDiscard": "GOOI WEG", "dialogDisagree": "STEM NIE SAAM NIE", "dialogAgree": "STEM IN", "dialogSetBackup": "Stel rugsteunrekening", "colorsBlueGrey": "BLOUGRYS", "dialogShow": "WYS DIALOOG", "dialogFullscreenTitle": "Volskermdialoog", "dialogFullscreenSave": "STOOR", "dialogFullscreenDescription": "'n Volskermdialoogdemonstrasie", "cupertinoButtonEnabled": "Enabled", "cupertinoButtonDisabled": "Disabled", "cupertinoButtonWithBackground": "Met agtergrond", "cupertinoAlertCancel": "Kanselleer", "cupertinoAlertDiscard": "Gooi weg", "cupertinoAlertLocationTitle": "Laat \"Maps\" toe om toegang tot jou ligging te kry terwyl jy die program gebruik?", "cupertinoAlertLocationDescription": "Jou huidige ligging sal op die kaart gewys word en gebruik word vir aanwysings, soekresultate in die omtrek, en geskatte reistye.", "cupertinoAlertAllow": "Laat toe", "cupertinoAlertDontAllow": "Moenie toelaat nie", "cupertinoAlertFavoriteDessert": "Kies gunstelingnagereg", "cupertinoAlertDessertDescription": "Kies asseblief jou gunstelingsoort nagereg op die lys hieronder. Jou keuse sal gebruik word om die voorgestelde lys eetplekke in jou omgewing te pasmaak.", "cupertinoAlertCheesecake": "Kaaskoek", "cupertinoAlertTiramisu": "Tiramisu", "cupertinoAlertApplePie": "Appeltert", "cupertinoAlertChocolateBrownie": "Sjokoladebruintjie", "cupertinoShowAlert": "Wys opletberig", "colorsRed": "ROOI", "colorsPink": "PIENK", "colorsPurple": "PERS", "colorsDeepPurple": "DIEPPERS", "colorsIndigo": "INDIGO", "colorsBlue": "BLOU", "colorsLightBlue": "LIGBLOU", "colorsCyan": "GROENBLOU", "dialogAddAccount": "Voeg rekening by", "Gallery": "Galery", "Categories": "Kategorieë", "SHRINE": "SHRINE", "Basic shopping app": "Basiese inkopieprogram", "RALLY": "RALLY", "CRANE": "CRANE", "Travel app": "Reisprogram", "MATERIAL": "MATERIAAL", "CUPERTINO": "CUPERTINO", "REFERENCE STYLES & MEDIA": "VERWYSINGSTYLE EN -MEDIA" }
gallery/lib/l10n/intl_af.arb/0
{ "file_path": "gallery/lib/l10n/intl_af.arb", "repo_id": "gallery", "token_count": 19365 }
810
{ "loading": "Indlæser", "deselect": "Fravælg", "select": "Vælg", "selectable": "Kan vælges (langt tryk)", "selected": "Valgt", "demo": "Demo", "bottomAppBar": "Appbjælke nederst på skærmen", "notSelected": "Ikke valgt", "demoCupertinoSearchTextFieldTitle": "Tekstfelt til søgning", "demoCupertinoPicker": "Vælger", "demoCupertinoSearchTextFieldSubtitle": "Tekstfelt til søgning i iOS-format", "demoCupertinoSearchTextFieldDescription": "Et tekstfelt til søgning, der giver brugeren mulighed for at søge ved at angive tekst, og som kan give og filtrere forslag.", "demoCupertinoSearchTextFieldPlaceholder": "Angiv tekst", "demoCupertinoScrollbarTitle": "Rullepanel", "demoCupertinoScrollbarSubtitle": "Rullepanel i iOS-format", "demoCupertinoScrollbarDescription": "Et rullepanel, der omgiver det givne underordnede element", "demoTwoPaneItem": "Element {value}", "demoTwoPaneList": "Liste", "demoTwoPaneFoldableLabel": "Foldbar", "demoTwoPaneSmallScreenLabel": "Lille skærm", "demoTwoPaneSmallScreenDescription": "Sådan fungerer TwoPane på en enhed med en lille skærm.", "demoTwoPaneTabletLabel": "Tablet/computer", "demoTwoPaneTabletDescription": "Sådan fungerer TwoPane på en større skærm som f.eks. en tablet eller en computer.", "demoTwoPaneTitle": "TwoPane", "demoTwoPaneSubtitle": "Et responsivt layout på foldbare, store og små skærme", "splashSelectDemo": "Vælg en demo", "demoTwoPaneFoldableDescription": "Sådan fungerer TwoPane på en foldbar enhed.", "demoTwoPaneDetails": "Oplysninger", "demoTwoPaneSelectItem": "Vælg et element", "demoTwoPaneItemDetails": "Oplysninger om elementet {value}", "demoCupertinoContextMenuActionText": "Hold fingeren på Flutter-logoet for at se genvejsmenuen.", "demoCupertinoContextMenuDescription": "En genvejsmenu i fuld skærm til iOS, som vises, når et element holdes nede i nogle sekunder.", "demoAppBarTitle": "Appbjælke", "demoAppBarDescription": "Appbjælken viser indhold og handlinger, der er knyttet til den aktuelle skærm. Den bruges til branding, skærmtitler, navigation og handlinger.", "demoDividerTitle": "Skillelinje", "demoDividerSubtitle": "En skillelinje er en tynd linje, der grupperer indhold i lister og inddeler opsætningen.", "demoDividerDescription": "Skillelinjer kan bruges i lister, skuffer og andre steder til at adskille indhold.", "demoVerticalDividerTitle": "Lodret skillelinje", "demoCupertinoContextMenuTitle": "Genvejsmenu", "demoCupertinoContextMenuSubtitle": "Genvejsmenu til iOS", "demoAppBarSubtitle": "Viser oplysninger og handlinger, der er knyttet til den aktuelle skærm", "demoCupertinoContextMenuActionOne": "Første handling", "demoCupertinoContextMenuActionTwo": "Anden handling", "demoDateRangePickerDescription": "Viser en dialogboks med en Material Design-datointervalvælger.", "demoDateRangePickerTitle": "Datointervalvælger", "demoNavigationDrawerUserName": "Brugernavn", "demoNavigationDrawerUserEmail": "[email protected]", "demoNavigationDrawerText": "Stryg fra kanten af skærmen, eller tryk på ikonet øverst til venstre for at se skuffen", "demoNavigationRailTitle": "Navigationsbjælke", "demoNavigationRailSubtitle": "Viser en navigationsbjælke i en app", "demoNavigationRailDescription": "En Material Design-widget, der er beregnet til at blive vise til venstre eller højre for en app i forbindelse med navigation mellem nogle få visninger, typisk mellem tre og fem.", "demoNavigationRailFirst": "Første", "demoNavigationDrawerTitle": "Sidemenu", "demoNavigationRailThird": "Tredje", "replyStarredLabel": "Stjernemarkeret", "demoTextButtonDescription": "En tekstknap viser en blækklat, når der trykkes på den, men den hæves ikke. Brug tekstknapper på værktøjslinjer, i dialogbokse og indlejret i den indre margen", "demoElevatedButtonTitle": "Hævet knap", "demoElevatedButtonDescription": "Hævede knapper giver layouts, der primært er flade, en 3D-effekt. De fremhæver funktioner i tætpakkede eller åbne områder.", "demoOutlinedButtonTitle": "Konturknap", "demoOutlinedButtonDescription": "Konturknapper bliver uigennemsigtige og hæves, når der trykkes på dem. De kombineres ofte med hævede knapper for at angive en alternativ, sekundær handling.", "demoContainerTransformDemoInstructions": "Kort, lister og svævende handlingsknap", "demoNavigationDrawerSubtitle": "Viser en skuffe i en appbjælke", "replyDescription": "En effektiv og smart mailapp", "demoNavigationDrawerDescription": "Et Material Design-panel, der kan skubbes ind horisontalt fra kanten af skærmen for at vise navigationslinks i en app.", "replyDraftsLabel": "Kladder", "demoNavigationDrawerToPageOne": "Element ét", "replyInboxLabel": "Indbakke", "demoSharedXAxisDemoInstructions": "Knapperne Næste og Tilbage", "replySpamLabel": "Spam", "replyTrashLabel": "Papirkurv", "replySentLabel": "Sendt", "demoNavigationRailSecond": "Anden", "demoNavigationDrawerToPageTwo": "Element to", "demoFadeScaleDemoInstructions": "Modal og svævende handlingsknap", "demoFadeThroughDemoInstructions": "Navigation i bunden", "demoSharedZAxisDemoInstructions": "Knap med ikon for Indstillinger", "demoSharedYAxisDemoInstructions": "Sortér efter \"Hørt for nylig\"", "demoTextButtonTitle": "Tekstknap", "demoSharedZAxisBeefSandwichRecipeTitle": "Oksekødssandwich", "demoSharedZAxisDessertRecipeDescription": "Opskrift på dessert", "demoSharedYAxisAlbumTileSubtitle": "Kunstner", "demoSharedYAxisAlbumTileTitle": "Album", "demoSharedYAxisRecentSortTitle": "Hørt for nylig", "demoSharedYAxisAlphabeticalSortTitle": "A-Å", "demoSharedYAxisAlbumCount": "268 album", "demoSharedYAxisTitle": "Delt y-akse", "demoSharedXAxisCreateAccountButtonText": "OPRET KONTO", "demoFadeScaleAlertDialogDiscardButton": "KASSÉR", "demoSharedXAxisSignInTextFieldLabel": "Mail eller telefonnummer", "demoSharedXAxisSignInSubtitleText": "Log ind med din konto", "demoSharedXAxisSignInWelcomeText": "Hej David Park", "demoSharedXAxisIndividualCourseSubtitle": "Vist enkeltvist", "demoSharedXAxisBundledCourseSubtitle": "Grupperet", "demoFadeThroughAlbumsDestination": "Album", "demoSharedXAxisDesignCourseTitle": "Design", "demoSharedXAxisIllustrationCourseTitle": "Illustration", "demoSharedXAxisBusinessCourseTitle": "Erhverv", "demoSharedXAxisArtsAndCraftsCourseTitle": "Kunsthåndværk", "demoMotionPlaceholderSubtitle": "Sekundær tekst", "demoFadeScaleAlertDialogCancelButton": "ANNULLER", "demoFadeScaleAlertDialogHeader": "Underretningsdialogboks", "demoFadeScaleHideFabButton": "SKJUL FAB", "demoFadeScaleShowFabButton": "VIS FAB", "demoFadeScaleShowAlertDialogButton": "VIS MODAL", "demoFadeScaleDescription": "Mønsteret for fortoning anvendes til brugerfladeelementer, der åbner eller lukker inden for skærmen, f.eks. en dialogboks der fortones midt på skærmen.", "demoFadeScaleTitle": "Fortoning", "demoFadeThroughTextPlaceholder": "123 billeder", "demoFadeThroughSearchDestination": "Søg", "demoFadeThroughPhotosDestination": "Billeder", "demoSharedXAxisCoursePageSubtitle": "Grupperede kategorier vises som grupper i dit feed. Du kan altid ændre dette senere.", "demoFadeThroughDescription": "Mønsteret for fortoning anvendes til overgange mellem brugerfladeelementer, der ikke har et stærkt forhold til hinanden.", "demoFadeThroughTitle": "Fortoning", "demoSharedZAxisHelpSettingLabel": "Hjælp", "demoMotionSubtitle": "Alle de foruddefinerede overgangsmønstre", "demoSharedZAxisNotificationSettingLabel": "Notifikationer", "demoSharedZAxisProfileSettingLabel": "Profil", "demoSharedZAxisSavedRecipesListTitle": "Gemte opskrifter", "demoSharedZAxisBeefSandwichRecipeDescription": "Opskrift på oksekødssandwich", "demoSharedZAxisCrabPlateRecipeDescription": "Opskrift på ret med krabbe", "demoSharedXAxisCoursePageTitle": "Strømlining af dine kurser", "demoSharedZAxisCrabPlateRecipeTitle": "Krabbe", "demoSharedZAxisShrimpPlateRecipeDescription": "Opskrift på ret med rejer", "demoSharedZAxisShrimpPlateRecipeTitle": "Rejer", "demoContainerTransformTypeFadeThrough": "FORTONING", "demoSharedZAxisDessertRecipeTitle": "Dessert", "demoSharedZAxisSandwichRecipeDescription": "Opskrift på sandwich", "demoSharedZAxisSandwichRecipeTitle": "Sandwich", "demoSharedZAxisBurgerRecipeDescription": "Opskrift på burger", "demoSharedZAxisBurgerRecipeTitle": "Burger", "demoSharedZAxisSettingsPageTitle": "Indstillinger", "demoSharedZAxisTitle": "Delt z-akse", "demoSharedZAxisPrivacySettingLabel": "Privatliv", "demoMotionTitle": "Bevægelse", "demoContainerTransformTitle": "Containeromdannelse", "demoContainerTransformDescription": "Mønsteret til containeromdannelse er udviklet til overgange mellem brugerfladeelementer, der indeholder en container. Dette mønster opretter en synlig forbindelse mellem to brugerfladeelementer", "demoContainerTransformModalBottomSheetTitle": "Fortoningstilstand", "demoContainerTransformTypeFade": "FORTONING", "demoSharedYAxisAlbumTileDurationUnit": "min.", "demoMotionPlaceholderTitle": "Titel", "demoSharedXAxisForgotEmailButtonText": "HAR DU GLEMT MAILADRESSEN?", "demoMotionSmallPlaceholderSubtitle": "Sekundær", "demoMotionDetailsPageTitle": "Infoside", "demoMotionListTileTitle": "Listepunkt", "demoSharedAxisDescription": "Mønsteret for delt akse anvendes til overgange mellem brugerfladeelementer, der har et rumligt eller navigationsrelateret forhold. Dette mønster anvender en delt omdannelse på x-, y- eller z-aksen for at forstærke forholdet mellem elementer.", "demoSharedXAxisTitle": "Delt x-akse", "demoSharedXAxisBackButtonText": "TILBAGE", "demoSharedXAxisNextButtonText": "NÆSTE", "demoSharedXAxisCulinaryCourseTitle": "Madlavning", "githubRepo": "{repoName} GitHub-lager", "fortnightlyMenuUS": "USA", "fortnightlyMenuBusiness": "Erhverv", "fortnightlyMenuScience": "Videnskab", "fortnightlyMenuSports": "Sport", "fortnightlyMenuTravel": "Rejser", "fortnightlyMenuCulture": "Kultur", "fortnightlyTrendingTechDesign": "TechDesign", "rallyBudgetDetailAmountLeft": "Resterende beløb", "fortnightlyHeadlineArmy": "\"Den grønne hær\" reformeres indefra", "fortnightlyDescription": "En nyhedsapp med fokus på indhold", "rallyBillDetailAmountDue": "Til betaling", "rallyBudgetDetailTotalCap": "Samlet budgetloft", "rallyBudgetDetailAmountUsed": "Brugt beløb", "fortnightlyTrendingHealthcareRevolution": "HealthcareRevolution", "fortnightlyMenuFrontPage": "Forside", "fortnightlyMenuWorld": "Verden", "rallyBillDetailAmountPaid": "Betalt beløb", "fortnightlyMenuPolitics": "Politik", "fortnightlyHeadlineBees": "Landbruget mangler bier", "fortnightlyHeadlineGasoline": "Benzinens fremtid", "fortnightlyTrendingGreenArmy": "GreenArmy", "fortnightlyHeadlineFeminists": "Feminister gør op med partilinjen", "fortnightlyHeadlineFabrics": "Designere fremstiller futuristisk stof ved hjælp af teknologi", "fortnightlyHeadlineStocks": "Matte aktier får mange til at vende sig mod valuta", "fortnightlyTrendingReform": "Reform", "fortnightlyMenuTech": "Teknologi", "fortnightlyHeadlineWar": "Adskilte amerikanske liv i krigstid", "fortnightlyHeadlineHealthcare": "Den stille revolution, der ryster sundhedssektoren", "fortnightlyLatestUpdates": "Seneste opdateringer", "fortnightlyTrendingStocks": "Stocks", "rallyBillDetailTotalAmount": "Samlet beløb", "demoCupertinoPickerDateTime": "Dato og tid", "signIn": "LOG IND", "dataTableRowWithSugar": "{value} med sukker", "dataTableRowApplePie": "Æbletærte", "dataTableRowDonut": "Donut", "dataTableRowHoneycomb": "Honningkaramel", "dataTableRowLollipop": "Slikkepind", "dataTableRowJellyBean": "Jelly bean", "dataTableRowGingerbread": "Ingefærssmåkager", "dataTableRowCupcake": "Cupcake", "dataTableRowEclair": "Eclair", "dataTableRowIceCreamSandwich": "Issandwich", "dataTableRowFrozenYogurt": "Yoghurtis", "dataTableColumnIron": "Jern (%)", "dataTableColumnCalcium": "Calcium (%)", "dataTableColumnSodium": "Salt (mg)", "demoTimePickerTitle": "Tidsvælger", "demo2dTransformationsResetTooltip": "Nulstil transformationer", "dataTableColumnFat": "Fedt (g)", "dataTableColumnCalories": "Kalorier", "dataTableColumnDessert": "Dessert (1 portion)", "cardsDemoTravelDestinationLocation1": "Thanjavur, Tamil Nadu", "demoTimePickerDescription": "Viser en dialogboks med en Material Design-tidsvælger.", "demoPickersShowPicker": "VIS VÆLGER", "demoTabsScrollingTitle": "Kan rulle", "demoTabsNonScrollingTitle": "Kan ikke rulle", "craneHours": "{hours,plural,=1{1 time}other{{hours} timer}}", "craneMinutes": "{minutes,plural,=1{1 min.}other{{minutes} min.}}", "craneFlightDuration": "{hoursShortForm} {minutesShortForm}", "dataTableHeader": "Ernæring", "demoDatePickerTitle": "Datovælger", "demoPickersSubtitle": "Valg af dato og tids", "demoPickersTitle": "Vælgere", "demo2dTransformationsEditTooltip": "Rediger felt", "demoDataTableDescription": "Datatabeller viser oplysninger i et gitterlignende format med rækker og kolonner. Oplysningerne organiseres på en måde, der gør dem nemme at gennemgå, så brugerne kan finde mønstre og få indsigt.", "demo2dTransformationsDescription": "Tryk for at redigere felter, og brug bevægelser til at navigere rundt i motivet. Træk for at panorere, knib fingrene sammen for at zoome, og roter ved hjælp af to fingre Tryk på knappen til nulstilling for at gå tilbage til den oprindelige retning.", "demo2dTransformationsSubtitle": "Panorer, zoom og roter", "demo2dTransformationsTitle": "2D-transformationer", "demoCupertinoTextFieldPIN": "Pinkode", "demoCupertinoTextFieldDescription": "Et tekstfelt giver brugeren mulighed for at angive tekst via enten et hardwaretastatur eller et skærmtastatur.", "demoCupertinoTextFieldSubtitle": "iOS-lignende tekstfelter", "demoCupertinoTextFieldTitle": "Tekstfelter", "demoDatePickerDescription": "Viser en dialogboks med en Material Design-datovælger.", "demoCupertinoPickerTime": "Tid", "demoCupertinoPickerDate": "Dato", "demoCupertinoPickerTimer": "Timer", "demoCupertinoPickerDescription": "En vælgerwidget i iOS-format, der kan bruges til at vælge strenge, datoer, tidspunkter eller både dato og tid.", "demoCupertinoPickerSubtitle": "Vælgere i iOS-format", "demoCupertinoPickerTitle": "Vælgere", "dataTableRowWithHoney": "{value} med honning", "cardsDemoTravelDestinationCity2": "Chettinad", "bannerDemoResetText": "Nulstil banneret", "bannerDemoMultipleText": "Flere handlinger", "bannerDemoLeadingText": "Indledende ikon", "dismiss": "LUK", "cardsDemoTappable": "Kan trykkes på", "cardsDemoSelectable": "Kan vælges (langt tryk)", "cardsDemoExplore": "Udforsk", "cardsDemoExploreSemantics": "Udforsk {destinationName}", "cardsDemoShareSemantics": "Del {destinationName}", "cardsDemoTravelDestinationTitle1": "De ti bedste byer at besøge i Tamil Nadu", "cardsDemoTravelDestinationDescription1": "Nummer 10", "cardsDemoTravelDestinationCity1": "Thanjavur", "dataTableColumnProtein": "Protein (g)", "cardsDemoTravelDestinationTitle2": "Kunsthåndværkere fra det sydlige Indien", "cardsDemoTravelDestinationDescription2": "Silkespindere", "bannerDemoText": "Din adgangskode blev opdateret på din anden enhed. Log ind igen.", "cardsDemoTravelDestinationLocation2": "Sivaganga, Tamil Nadu", "cardsDemoTravelDestinationTitle3": "Brihadisvaratempel", "cardsDemoTravelDestinationDescription3": "Templer", "demoBannerTitle": "Banner", "demoBannerSubtitle": "Viser et banner på en liste", "demoBannerDescription": "Et banner viser en vigtig og kortfattet meddelelse og viser de handlinger, som brugerne skal foretage (eller de kan lukke banneret). Der skal foretages en brugerhandling for at lukke banneret.", "demoCardTitle": "Kort", "demoCardSubtitle": "Standardkort med afrundede hjørner", "demoCardDescription": "Et kort er et ark fra Material Design, der bruges til at repræsentere nogle relaterede oplysninger som f.eks. et album, en geografisk lokation, et måltid, kontaktoplysninger osv.", "demoDataTableTitle": "Datatabeller", "demoDataTableSubtitle": "Rækker og kolonner med oplysninger", "dataTableColumnCarbs": "Kulhydrat (g)", "placeTanjore": "Thanjavur", "demoGridListsTitle": "Gitterlister", "placeFlowerMarket": "Blomstermarked", "placeBronzeWorks": "Bronzestøberi", "placeMarket": "Marked", "placeThanjavurTemple": "Tempel i Thanjavur", "placeSaltFarm": "Saltfarm", "placeScooters": "Scootere", "placeSilkMaker": "Silkeproducent", "placeLunchPrep": "Gøre frokost klar", "placeBeach": "Strand", "placeFisherman": "Fisker", "demoMenuSelected": "Valgt: {value}", "demoMenuRemove": "Fjern", "demoMenuGetLink": "Hent link", "demoMenuShare": "Del", "demoBottomAppBarSubtitle": "Viser navigation og handlinger nederst på skærmen", "demoMenuAnItemWithASectionedMenu": "Et element med en menu med sektioner", "demoMenuADisabledMenuItem": "Deaktiveret menupunkt", "demoLinearProgressIndicatorTitle": "Lineær statusindikator", "demoMenuContextMenuItemOne": "Genvejsmenupunkt ét", "demoMenuAnItemWithASimpleMenu": "Et element med en enkel menu", "demoCustomSlidersTitle": "Tilpassede skydere", "demoMenuAnItemWithAChecklistMenu": "Et element med en tjeklistemenu", "demoCupertinoActivityIndicatorTitle": "Aktivitetsindikator", "demoCupertinoActivityIndicatorSubtitle": "Aktivitetsindikator i iOS-format", "demoCupertinoActivityIndicatorDescription": "En aktivitetsindikator i iOS-format, der drejer med uret.", "demoCupertinoNavigationBarTitle": "Navigationslinje", "demoCupertinoNavigationBarSubtitle": "iOS-lignende navigationslinje", "demoCupertinoNavigationBarDescription": "En iOS-lignende navigationslinje. Navigationslinjen er en værktøjslinje, der som minimum består af en sidetitel, midt i værktøjslinjen.", "demoCupertinoPullToRefreshTitle": "Træk for at opdatere", "demoCupertinoPullToRefreshSubtitle": "iOS-lignende funktion til at trække for at opdatere", "demoCupertinoPullToRefreshDescription": "En widget, der implementerer den iOS-lignende funktion til at trække for at opdatere.", "demoProgressIndicatorTitle": "Statusindikatorer", "demoProgressIndicatorSubtitle": "Lineær, cirkulær, ubestemt", "demoCircularProgressIndicatorTitle": "Cirkulær statusindikator", "demoCircularProgressIndicatorDescription": "En cirkulær statusindikator fra Material Design, som drejer for at indikere, at appen arbejder.", "demoMenuFour": "Fire", "demoLinearProgressIndicatorDescription": "En lineær statusindikator fra Material Design, også kaldet en statuslinje.", "demoTooltipTitle": "Værktøjstips", "demoTooltipSubtitle": "Kort meddelelse, der vises ved langt tryk, eller når markøren holdes over et element", "demoTooltipDescription": "Værktøjstips leverer tekstetiketter, der hjælper med at forklare en knaps funktion eller andre brugerfladehandlinger. Værktøjstips viser tekst med oplysninger, når brugerne holder markøren over et element eller trykker på elementet i lang tid.", "demoTooltipInstructions": "Lav et langt tryk eller hold markøren over et element for at se værktøjstippet.", "placeChennai": "Chennai", "demoMenuChecked": "Markeret: {value}", "placeChettinad": "Chettinad", "demoMenuPreview": "Se forhåndsvisning", "demoBottomAppBarTitle": "Appbjælke nederst på skærmen", "demoBottomAppBarDescription": "Appbjælker nederst på skærmen giver adgang til en sidemenu i bunden af skærmen og op til fire handlinger, bl.a. den svævende handlingsknap.", "bottomAppBarNotch": "Skærmhak", "bottomAppBarPosition": "Placering af svævende handlingsknap", "bottomAppBarPositionDockedEnd": "Fastgjort – Til sidst", "bottomAppBarPositionDockedCenter": "Fastgjort – I midten", "bottomAppBarPositionFloatingEnd": "Svævende – Til sidst", "bottomAppBarPositionFloatingCenter": "Svævende – I midten", "demoSlidersEditableNumericalValue": "Redigerbar numerisk værdi", "demoGridListsSubtitle": "Række- og kolonnelayout", "demoGridListsDescription": "Gitterlister egner sig bedst til at præsentere homogene data, typisk billeder. Hvert element i en gitterliste kaldes et felt.", "demoGridListsImageOnlyTitle": "Kun billeder", "demoGridListsHeaderTitle": "Med sidehoved", "demoGridListsFooterTitle": "Med sidefod", "demoSlidersTitle": "Skydere", "demoSlidersSubtitle": "Widgets til valg af en værdi ved at stryge", "demoSlidersDescription": "Skydere viser en række værdier langs en bjælke, og brugerne kan vælge en enkelt værdi. De er ideelle til justering af indstillinger som f.eks. lydstyrke eller lysstyrke samt til valg af billedfiltre.", "demoRangeSlidersTitle": "Områdeskydere", "demoRangeSlidersDescription": "Skydere viser en række værdier langs en bjælke. De kan have ikoner i begge ender af bjælken, som afspejler en række værdier. De er ideelle til justering af indstillinger som f.eks. lydstyrke eller lysstyrke samt til valg af billedfiltre.", "demoMenuAnItemWithAContextMenuButton": "Et element med en genvejsmenu", "demoCustomSlidersDescription": "Skydere viser en række værdier langs en bjælke, og brugerne kan vælge en enkelt eller flere værdier. Skyderne kan tilpasses og anvende et tema.", "demoSlidersContinuousWithEditableNumericalValue": "Kontinuerlig med redigerbar numerisk værdi", "demoSlidersDiscrete": "Individuel", "demoSlidersDiscreteSliderWithCustomTheme": "Individuel skyder med tilpasset tema", "demoSlidersContinuousRangeSliderWithCustomTheme": "Kontinuerlig områdeskyder med tilpasset tema", "demoSlidersContinuous": "Kontinuerlig", "placePondicherry": "Pondicherry", "demoMenuTitle": "Menu", "demoContextMenuTitle": "Genvejsmenu", "demoSectionedMenuTitle": "Menu med sektioner", "demoSimpleMenuTitle": "Enkel menu", "demoChecklistMenuTitle": "Tjeklistemenu", "demoMenuSubtitle": "Menuknapper og enkle menuer", "demoMenuDescription": "En menu viser en liste over valgmuligheder i en midlertidig rude. De vises, når brugerne interagerer med en knap, en handling eller en anden funktion.", "demoMenuItemValueOne": "Menupunkt ét", "demoMenuItemValueTwo": "Menupunkt to", "demoMenuItemValueThree": "Menupunkt tre", "demoMenuOne": "Ét", "demoMenuTwo": "To", "demoMenuThree": "Tre", "demoMenuContextMenuItemThree": "Genvejsmenupunkt tre", "demoCupertinoSwitchSubtitle": "Kontakt i iOS-format", "demoSnackbarsText": "Dette er en handlingsbekræftelse.", "demoCupertinoSliderSubtitle": "Skyder i iOS-format", "demoCupertinoSliderDescription": "En skyder kan bruges til at vælge enten et permanent eller individuelt værdisæt.", "demoCupertinoSliderContinuous": "Permanent: {value}", "demoCupertinoSliderDiscrete": "Individuelt: {value}", "demoSnackbarsAction": "Du trykkede på handlingsbekræftelsen.", "backToGallery": "Tilbage til galleriet", "demoCupertinoTabBarTitle": "Fanelinje", "demoCupertinoSwitchDescription": "En kontakt bruges til at skifte tilstand for en bestemt indstilling.", "demoSnackbarsActionButtonLabel": "HANDLING", "cupertinoTabBarProfileTab": "Profil", "demoSnackbarsButtonLabel": "VIS EN HANDLINGSBEKRÆFTELSE", "demoSnackbarsDescription": "Handlingsbekræftelser informerer brugerne om en proces, som en app enten har fuldført eller vil gennemgå senere. De vises midlertidigt nederst på skærmen. De bør ikke forstyrre brugeroplevelsen, og de forsvinder af sig selv.", "demoSnackbarsSubtitle": "Handlingsbekræftelser viser meddelelser nederst på skærmen.", "demoSnackbarsTitle": "Handlingsbekræftelser", "demoCupertinoSliderTitle": "Skyder", "cupertinoTabBarChatTab": "Chat", "cupertinoTabBarHomeTab": "Start", "demoCupertinoTabBarDescription": "En fanelinje til navigation i iOS-format i bunden. Viser flere faner med én aktiv fane. Den første fane er som standard aktiv.", "demoCupertinoTabBarSubtitle": "Fanelinje i iOS-format i bunden", "demoOptionsFeatureTitle": "Se valgmuligheder", "demoOptionsFeatureDescription": "Tryk her for at se de tilgængelige muligheder for denne demo.", "demoCodeViewerCopyAll": "KOPIER ALT", "shrineScreenReaderRemoveProductButton": "Fjern {product}", "shrineScreenReaderProductAddToCart": "Læg i kurven", "shrineScreenReaderCart": "{quantity,plural,=0{Indkøbskurv, ingen varer}=1{Indkøbskurv, 1 vare}other{Indkøbskurv, {quantity} varer}}", "demoCodeViewerFailedToCopyToClipboardMessage": "Kunne ikke kopieres til udklipsholderen: {error}", "demoCodeViewerCopiedToClipboardMessage": "Kopieret til udklipsholderen.", "craneSleep8SemanticLabel": "Mayaruiner på en klippeskrænt ved en strand", "craneSleep4SemanticLabel": "Hotel ved søen foran bjerge", "craneSleep2SemanticLabel": "Machu Picchu-citadel", "craneSleep1SemanticLabel": "Hytte i et snelandskab med stedsegrønne træer", "craneSleep0SemanticLabel": "Bungalows over vandet", "craneFly13SemanticLabel": "Swimmingpool ved havet med palmer", "craneFly12SemanticLabel": "Swimmingpool med palmetræer", "craneFly11SemanticLabel": "Murstensfyrtårn ved havet", "craneFly10SemanticLabel": "Al-Azhar-moskéens tårne ved solnedgang", "craneFly9SemanticLabel": "Mand, der læner sig op ad en blå retro bil", "craneFly8SemanticLabel": "Supertree Grove", "craneEat9SemanticLabel": "Cafédisk med kager", "craneEat2SemanticLabel": "Burger", "craneFly5SemanticLabel": "Hotel ved søen foran bjerge", "demoSelectionControlsSubtitle": "Afkrydsningsfelter, alternativknapper og kontakter", "craneEat10SemanticLabel": "Kvinde med en kæmpe pastramisandwich", "craneFly4SemanticLabel": "Bungalows over vandet", "craneEat7SemanticLabel": "Indgang til bager", "craneEat6SemanticLabel": "Ret med rejer", "craneEat5SemanticLabel": "Siddepladser på en fin restaurant", "craneEat4SemanticLabel": "Dessert med chokolade", "craneEat3SemanticLabel": "Koreansk taco", "craneFly3SemanticLabel": "Machu Picchu-citadel", "craneEat1SemanticLabel": "Tom bar med dinerstole", "craneEat0SemanticLabel": "En pizza i en træfyret ovn", "craneSleep11SemanticLabel": "Taipei 101-skyskraber", "craneSleep10SemanticLabel": "Al-Azhar-moskéens tårne ved solnedgang", "craneSleep9SemanticLabel": "Murstensfyrtårn ved havet", "craneEat8SemanticLabel": "Tallerken med krebs", "craneSleep7SemanticLabel": "Farverige lejligheder på Ribeira Square", "craneSleep6SemanticLabel": "Swimmingpool med palmetræer", "craneSleep5SemanticLabel": "Telt på en mark", "settingsButtonCloseLabel": "Luk indstillinger", "demoSelectionControlsCheckboxDescription": "Afkrydsningsfelter giver brugerne mulighed for at vælge flere valgmuligheder fra et sæt. Et normalt afkrydsningsfelt kan angives til værdierne sand eller falsk, og et afkrydsningsfelt med tre værdier kan også angives til nul.", "settingsButtonLabel": "Indstillinger", "demoListsTitle": "Lister", "demoListsSubtitle": "Layout for rullelister", "demoListsDescription": "En enkelt række med fast højde, som typisk indeholder tekst samt et foranstillet eller efterstillet ikon.", "demoOneLineListsTitle": "Én linje", "demoTwoLineListsTitle": "To linjer", "demoListsSecondary": "Sekundær tekst", "demoSelectionControlsTitle": "Kontrolelementer til markering", "craneFly7SemanticLabel": "Mount Rushmore", "demoSelectionControlsCheckboxTitle": "Afkrydsningsfelt", "craneSleep3SemanticLabel": "Mand, der læner sig op ad en blå retro bil", "demoSelectionControlsRadioTitle": "Alternativknap", "demoSelectionControlsRadioDescription": "Alternativknapper giver brugeren mulighed for at vælge en valgmulighed fra et sæt. Brug alternativknapper til eksklusivt valg, hvis du mener, at brugeren har brug for at se alle tilgængelige valgmuligheder side om side.", "demoSelectionControlsSwitchTitle": "Kontakt", "demoSelectionControlsSwitchDescription": "Til/fra-kontakter skifter en indstillings status. Den indstilling, som kontakten styrer, og dens status, bør tydeliggøres i den tilsvarende indlejrede etiket.", "craneFly0SemanticLabel": "Hytte i et snelandskab med stedsegrønne træer", "craneFly1SemanticLabel": "Telt på en mark", "craneFly2SemanticLabel": "Bedeflag foran snebeklædt bjerg", "craneFly6SemanticLabel": "Palacio de Bellas Artes set fra luften", "rallySeeAllAccounts": "Se alle konti", "rallyBillAmount": "Regningen {billName} på {amount}, som skal betales {date}.", "shrineTooltipCloseCart": "Luk kurven", "shrineTooltipCloseMenu": "Luk menuen", "shrineTooltipOpenMenu": "Åbn menuen", "shrineTooltipSettings": "Indstillinger", "shrineTooltipSearch": "Søg", "demoTabsDescription": "Med faner kan indhold fra forskellige skærme, datasæt og andre interaktioner organiseres.", "demoTabsSubtitle": "Faner med visninger, der kan rulle uafhængigt af hinanden", "demoTabsTitle": "Faner", "rallyBudgetAmount": "Budgettet {budgetName}, hvor {amountUsed} ud af {amountTotal} er brugt, og der er {amountLeft} tilbage", "shrineTooltipRemoveItem": "Fjern varen", "rallyAccountAmount": "Kontoen \"{accountName}\" {accountNumber} med saldoen {amount}.", "rallySeeAllBudgets": "Se alle budgetter", "rallySeeAllBills": "Se alle regninger", "craneFormDate": "Vælg dato", "craneFormOrigin": "Vælg afrejsested", "craneFly2": "Khumbu Valley, Nepal", "craneFly3": "Machu Picchu, Peru", "craneFly4": "Malé, Maldiverne", "craneFly5": "Vitznau, Schweiz", "craneFly6": "Mexico City, Mexico", "craneFly7": "Mount Rushmore, USA", "settingsTextDirectionLocaleBased": "Baseret på landestandard", "craneFly9": "Havana, Cuba", "craneFly10": "Cairo, Egypten", "craneFly11": "Lissabon, Portugal", "craneFly12": "Napa, USA", "craneFly13": "Bali, Indonesien", "craneSleep0": "Malé, Maldiverne", "craneSleep1": "Aspen, USA", "craneSleep2": "Machu Picchu, Peru", "demoCupertinoSegmentedControlTitle": "Segmenteret styring", "craneSleep4": "Vitznau, Schweiz", "craneSleep5": "Big Sur, USA", "craneSleep6": "Napa, USA", "craneSleep7": "Porto, Portugal", "craneSleep8": "Tulum, Mexico", "craneEat5": "Seoul, Sydkorea", "demoChipTitle": "Tips", "demoChipSubtitle": "Kompakte elementer, der repræsenterer et input, en attribut eller en handling", "demoActionChipTitle": "Handlingstip", "demoActionChipDescription": "Handlingstips er en række muligheder, som udløser en handling relateret til det primære indhold. Handlingstips bør vises på en dynamisk og kontekstafhængig måde på en brugerflade.", "demoChoiceChipTitle": "Valgtip", "demoChoiceChipDescription": "Valgtips repræsenterer et enkelt valg fra et sæt. Valgtips indeholder relateret beskrivende tekst eller relaterede kategorier.", "demoFilterChipTitle": "Filtertip", "demoFilterChipDescription": "Filtertips bruger tags eller beskrivende ord til at filtrere indhold.", "demoInputChipTitle": "Inputtip", "demoInputChipDescription": "Inputtips repræsenterer en kompleks oplysning, f.eks. en enhed (person, sted eller ting) eller en samtaletekst, i kompakt form.", "craneSleep9": "Lissabon, Portugal", "craneEat10": "Lissabon, Portugal", "demoCupertinoSegmentedControlDescription": "Bruges til at vælge mellem et antal muligheder, som gensidigt udelukker hinanden. Når én af mulighederne i den segmenterede styring er valgt, er de øvrige muligheder i den segmenterede styring ikke valgt.", "chipTurnOnLights": "Tænd lyset", "chipSmall": "Lille", "chipMedium": "Mellem", "chipLarge": "Stor", "chipElevator": "Elevator", "chipWasher": "Vaskemaskine", "chipFireplace": "Pejs", "chipBiking": "Cykling", "craneFormDiners": "Spisende", "rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{Hæv dit potentielle skattefradrag. Tildel kategorier til 1 transaktion, som ingen har.}other{Hæv dit potentielle skattefradrag. Tildel kategorier til {count} transaktioner, som ingen har.}}", "craneFormTime": "Vælg tidspunkt", "craneFormLocation": "Vælg placering", "craneFormTravelers": "Rejsende", "craneEat8": "Atlanta, USA", "craneFormDestination": "Vælg destination", "craneFormDates": "Vælg datoer", "craneFly": "FLYV", "craneSleep": "OVERNAT", "craneEat": "SPIS", "craneFlySubhead": "Find fly efter destination", "craneSleepSubhead": "Find ejendomme efter placering", "craneEatSubhead": "Find restauranter efter destination", "craneFlyStops": "{numberOfStops,plural,=0{Direkte}=1{1 mellemlanding}other{{numberOfStops} mellemlandinger}}", "craneSleepProperties": "{totalProperties,plural,=0{Ingen ledige ejendomme}=1{1 ledig ejendom}other{{totalProperties} ledige ejendomme}}", "craneEatRestaurants": "{totalRestaurants,plural,=0{Ingen restauranter}=1{1 restaurant}other{{totalRestaurants} restauranter}}", "craneFly0": "Aspen, USA", "demoCupertinoSegmentedControlSubtitle": "Segmenteret styring i iOS-stil", "craneSleep10": "Cairo, Egypten", "craneEat9": "Madrid, Spanien", "craneFly1": "Big Sur, USA", "craneEat7": "Nashville, USA", "craneEat6": "Seattle, USA", "craneFly8": "Singapore", "craneEat4": "Paris, Frankrig", "craneEat3": "Portland, USA", "craneEat2": "Córdoba, Argentina", "craneEat1": "Dallas, USA", "craneEat0": "Napoli, Italien", "craneSleep11": "Taipei, Taiwan", "craneSleep3": "Havana, Cuba", "shrineLogoutButtonCaption": "LOG UD", "rallyTitleBills": "FAKTURAER", "rallyTitleAccounts": "KONTI", "shrineProductVagabondSack": "Vagabond-rygsæk", "rallyAccountDetailDataInterestYtd": "Renter ÅTD", "shrineProductWhitneyBelt": "Whitney-bælte", "shrineProductGardenStrand": "Garden strand", "shrineProductStrutEarrings": "Strut-øreringe", "shrineProductVarsitySocks": "Varsity-sokker", "shrineProductWeaveKeyring": "Weave-nøglering", "shrineProductGatsbyHat": "Gatsby-hat", "shrineProductShrugBag": "Shrug-taske", "shrineProductGiltDeskTrio": "Tre-i-et-skrivebord fra Gilt", "shrineProductCopperWireRack": "Hylde med kobbergitter", "shrineProductSootheCeramicSet": "Soothe-keramiksæt", "shrineProductHurrahsTeaSet": "Hurrahs-testel", "shrineProductBlueStoneMug": "Blue Stone-krus", "shrineProductRainwaterTray": "Rende til regnvand", "shrineProductChambrayNapkins": "Chambrayservietter", "shrineProductSucculentPlanters": "Sukkulente planter", "shrineProductQuartetTable": "Bord med fire stole", "shrineProductKitchenQuattro": "Kitchen quattro", "shrineProductClaySweater": "Clay-sweater", "shrineProductSeaTunic": "Havblå tunika", "shrineProductPlasterTunic": "Beige tunika", "rallyBudgetCategoryRestaurants": "Restauranter", "shrineProductChambrayShirt": "Chambrayskjorte", "shrineProductSeabreezeSweater": "Seabreeze-sweater", "shrineProductGentryJacket": "Gentry-jakke", "shrineProductNavyTrousers": "Marineblå bukser", "shrineProductWalterHenleyWhite": "Walter-henley (hvid)", "shrineProductSurfAndPerfShirt": "Surfertrøje", "shrineProductGingerScarf": "Rødt halstørklæde", "shrineProductRamonaCrossover": "Ramona-samarbejde", "shrineProductClassicWhiteCollar": "Klassisk hvid krave", "shrineProductSunshirtDress": "Kjole, der beskytter mod solen", "rallyAccountDetailDataInterestRate": "Rentesats", "rallyAccountDetailDataAnnualPercentageYield": "Årligt afkast i procent", "rallyAccountDataVacation": "Ferie", "shrineProductFineLinesTee": "T-shirt med tynde striber", "rallyAccountDataHomeSavings": "Opsparing til hjemmet", "rallyAccountDataChecking": "Bankkonto", "rallyAccountDetailDataInterestPaidLastYear": "Betalte renter sidste år", "rallyAccountDetailDataNextStatement": "Næste kontoudtog", "rallyAccountDetailDataAccountOwner": "Kontoejer", "rallyBudgetCategoryCoffeeShops": "Kaffebarer", "rallyBudgetCategoryGroceries": "Dagligvarer", "shrineProductCeriseScallopTee": "Lyserød Cerise-t-shirt", "rallyBudgetCategoryClothing": "Tøj", "rallySettingsManageAccounts": "Administrer konti", "rallyAccountDataCarSavings": "Opsparing til bil", "rallySettingsTaxDocuments": "Skattedokumenter", "rallySettingsPasscodeAndTouchId": "Adgangskode og Touch ID", "rallySettingsNotifications": "Notifikationer", "rallySettingsPersonalInformation": "Personlige oplysninger", "rallySettingsPaperlessSettings": "Indstillinger for Paperless", "rallySettingsFindAtms": "Find hæveautomater", "rallySettingsHelp": "Hjælp", "rallySettingsSignOut": "Log ud", "rallyAccountTotal": "I alt", "rallyBillsDue": "Betalingsdato", "rallyBudgetLeft": "Tilbage", "rallyAccounts": "Konti", "rallyBills": "Fakturaer", "rallyBudgets": "Budgetter", "rallyAlerts": "Underretninger", "rallySeeAll": "SE ALLE", "rallyFinanceLeft": "TILBAGE", "rallyTitleOverview": "OVERSIGT", "shrineProductShoulderRollsTee": "T-shirt med åbning til skuldrene", "shrineNextButtonCaption": "NÆSTE", "rallyTitleBudgets": "BUDGETTER", "rallyTitleSettings": "INDSTILLINGER", "rallyLoginLoginToRally": "Log ind for at bruge Rally", "rallyLoginNoAccount": "Har du ikke en konto?", "rallyLoginSignUp": "TILMELD DIG", "rallyLoginUsername": "Brugernavn", "rallyLoginPassword": "Adgangskode", "rallyLoginLabelLogin": "Log ind", "rallyLoginRememberMe": "Husk mig", "rallyLoginButtonLogin": "LOG IND", "rallyAlertsMessageHeadsUpShopping": "Vær opmærksom på, at du har brugt {percent} af denne måneds shoppingbudget.", "rallyAlertsMessageSpentOnRestaurants": "Du har brugt {amount} på restaurantbesøg i denne uge.", "rallyAlertsMessageATMFees": "Du har brugt {amount} på hæveautomatgebyrer i denne måned", "rallyAlertsMessageCheckingAccount": "Flot! Din bankkonto er steget med {percent} i forhold til sidste måned.", "shrineMenuCaption": "MENU", "shrineCategoryNameAll": "ALLE", "shrineCategoryNameAccessories": "TILBEHØR", "shrineCategoryNameClothing": "TØJ", "shrineCategoryNameHome": "STARTSIDE", "shrineLoginUsernameLabel": "Brugernavn", "shrineLoginPasswordLabel": "Adgangskode", "shrineCancelButtonCaption": "ANNULLER", "shrineCartTaxCaption": "Afgifter:", "shrineCartPageCaption": "KURV", "shrineProductQuantity": "Antal: {quantity}", "shrineProductPrice": "x {price}", "shrineCartItemCount": "{quantity,plural,=0{INGEN VARER}=1{1 VARE}other{{quantity} VARER}}", "shrineCartClearButtonCaption": "RYD KURV", "shrineCartTotalCaption": "I ALT", "shrineCartSubtotalCaption": "Subtotal:", "shrineCartShippingCaption": "Forsendelse:", "shrineProductGreySlouchTank": "Grå løstsiddende tanktop", "shrineProductStellaSunglasses": "Stella-solbriller", "shrineProductWhitePinstripeShirt": "Nålestribet skjorte i hvid", "demoTextFieldWhereCanWeReachYou": "Hvordan kan vi kontakte dig?", "settingsTextDirectionLTR": "VTH", "settingsTextScalingLarge": "Stor", "demoBottomSheetHeader": "Overskrift", "demoBottomSheetItem": "Vare {value}", "demoBottomTextFieldsTitle": "Tekstfelter", "demoTextFieldTitle": "Tekstfelter", "demoTextFieldSubtitle": "En enkelt linje med tekst og tal, der kan redigeres", "demoTextFieldDescription": "Tekstfelterne giver brugerne mulighed for at angive tekst i en brugerflade. De vises normalt i formularer og dialogbokse.", "demoTextFieldShowPasswordLabel": "Vis adgangskode", "demoTextFieldHidePasswordLabel": "Skjul adgangskode", "demoTextFieldFormErrors": "Ret de fejl, der er angivet med rød farve, før du sender.", "demoTextFieldNameRequired": "Du skal angive et navn.", "demoTextFieldOnlyAlphabeticalChars": "Angiv kun alfabetiske tegn.", "demoTextFieldEnterUSPhoneNumber": "(###) ###-#### – angiv et amerikansk telefonnummer.", "demoTextFieldEnterPassword": "Angiv en adgangskode.", "demoTextFieldPasswordsDoNotMatch": "Adgangskoderne matcher ikke", "demoTextFieldWhatDoPeopleCallYou": "Hvad kalder andre dig?", "demoTextFieldNameField": "Navn*", "demoBottomSheetButtonText": "VIS FELTET I BUNDEN", "demoTextFieldPhoneNumber": "Telefonnummer*", "demoBottomSheetTitle": "Felt i bunden", "demoTextFieldEmail": "Mail", "demoTextFieldTellUsAboutYourself": "Fortæl os, hvem du er (du kan f.eks. skrive, hvad du laver, eller hvilke fritidsinteresser du har)", "demoTextFieldKeepItShort": "Vær kortfattet; det her er kun en demo.", "starterAppGenericButton": "KNAP", "demoTextFieldLifeStory": "Livshistorie", "demoTextFieldSalary": "Løn", "demoTextFieldUSD": "USD", "demoTextFieldNoMoreThan": "Du må højst angive otte tegn.", "demoTextFieldPassword": "Adgangskode*", "demoTextFieldRetypePassword": "Angiv adgangskoden igen*", "demoTextFieldSubmit": "SEND", "demoBottomNavigationSubtitle": "Navigation i bunden med tværudtoning", "demoBottomSheetAddLabel": "Tilføj", "demoBottomSheetModalDescription": "Et modalt felt i bunden er et alternativ til en menu eller dialogboks og forhindrer, at brugeren interagerer med resten af appen.", "demoBottomSheetModalTitle": "Modalt felt i bunden", "demoBottomSheetPersistentDescription": "Et fast felt i bunden viser oplysninger, der supplerer det primære indhold i appen. Et fast felt i bunden forbliver synligt, selvom brugeren interagerer med andre elementer i appen.", "demoBottomSheetPersistentTitle": "Fast felt i bunden", "demoBottomSheetSubtitle": "Faste og modale felter i bunden", "demoTextFieldNameHasPhoneNumber": "Telefonnummeret til {name} er {phoneNumber}", "buttonText": "KNAP", "demoTypographyDescription": "Definitioner for de forskellige typografier, der blev fundet i Material Design.", "demoTypographySubtitle": "Alle de foruddefinerede typografier", "demoTypographyTitle": "Typografi", "demoFullscreenDialogDescription": "Egenskaben fullscreenDialog angiver, om den delte side er en modal dialogboks i fuld skærm.", "demoFlatButtonDescription": "En flad knap viser en blækklat, når den trykkes ned, men den hæves ikke. Brug flade knapper på værktøjslinjer, i dialogbokse og indlejret i den indre margen.", "demoBottomNavigationDescription": "Navigationslinjer i bunden viser tre til fem destinationer nederst på en skærm. Hver destination er angivet med et ikon og en valgfri tekstetiket. Når der trykkes på et navigationsikon nederst på en skærm, føres brugeren til den overordnede navigationsdestination, der er knyttet til det pågældende ikon.", "demoBottomNavigationSelectedLabel": "Valgt etiket", "demoBottomNavigationPersistentLabels": "Faste etiketter", "starterAppDrawerItem": "Vare {value}", "demoTextFieldRequiredField": "* angiver et obligatorisk felt", "demoBottomNavigationTitle": "Navigation i bunden", "settingsLightTheme": "Lyst", "settingsTheme": "Tema", "settingsPlatformIOS": "iOS", "settingsPlatformAndroid": "Android", "settingsTextDirectionRTL": "HTV", "settingsTextScalingHuge": "Meget stor", "cupertinoButton": "Knap", "settingsTextScalingNormal": "Normal", "settingsTextScalingSmall": "Lille", "settingsSystemDefault": "System", "settingsTitle": "Indstillinger", "rallyDescription": "En personlig økonomiapp", "aboutDialogDescription": "Gå til {repoLink}. for at se kildekoden for denne app.", "bottomNavigationCommentsTab": "Kommentarer", "starterAppGenericBody": "Brødtekst", "starterAppGenericHeadline": "Overskrift", "starterAppGenericSubtitle": "Undertekst", "starterAppGenericTitle": "Titel", "starterAppTooltipSearch": "Søg", "starterAppTooltipShare": "Del", "starterAppTooltipFavorite": "Angiv som favorit", "starterAppTooltipAdd": "Tilføj", "bottomNavigationCalendarTab": "Kalender", "starterAppDescription": "Et responsivt opstartslayout", "starterAppTitle": "Begynderapp", "aboutFlutterSamplesRepo": "Flutter samples GitHub repo", "bottomNavigationContentPlaceholder": "Pladsholder for fanen {title}", "bottomNavigationCameraTab": "Kamera", "bottomNavigationAlarmTab": "Alarm", "bottomNavigationAccountTab": "Konto", "demoTextFieldYourEmailAddress": "Din mailadresse", "demoToggleButtonDescription": "Til/fra-knapper kan bruges til at gruppere relaterede indstillinger. For at fremhæve grupper af relaterede til/fra-knapper bør grupperne dele en fælles container.", "colorsGrey": "GRÅ", "colorsBrown": "BRUN", "colorsDeepOrange": "DYB ORANGE", "colorsOrange": "ORANGE", "colorsAmber": "ORANGEGUL", "colorsYellow": "GUL", "colorsLime": "LIMEGRØN", "colorsLightGreen": "LYSEGRØN", "colorsGreen": "GRØN", "homeHeaderGallery": "Galleri", "homeHeaderCategories": "Kategorier", "shrineDescription": "En modebevidst forhandlerapp", "craneDescription": "En personligt tilpasset rejseapp", "homeCategoryReference": "STIL OG ANDET", "demoInvalidURL": "Kunne ikke vise webadressen:", "demoOptionsTooltip": "Valgmuligheder", "demoInfoTooltip": "Oplysninger", "demoCodeTooltip": "Demokode", "demoDocumentationTooltip": "API-dokumentation", "demoFullscreenTooltip": "Fuld skærm", "settingsTextScaling": "Skalering af tekst", "settingsTextDirection": "Tekstretning", "settingsLocale": "Landestandard", "settingsPlatformMechanics": "Platformmekanik", "settingsDarkTheme": "Mørkt", "settingsSlowMotion": "Slowmotion", "settingsAbout": "Om Flutter Gallery", "settingsFeedback": "Send feedback", "settingsAttribution": "Designet af TOASTER i London", "demoButtonTitle": "Knapper", "demoButtonSubtitle": "Tekst, hævet, kontur og meget mere", "demoFlatButtonTitle": "Flad knap", "demoRaisedButtonDescription": "Hævede knapper giver en tredje dimension til layouts, der primært er flade. De fremhæver funktioner i tætpakkede eller åbne områder.", "demoRaisedButtonTitle": "Hævet knap", "demoOutlineButtonTitle": "Konturknap", "demoOutlineButtonDescription": "Konturknapper bliver uigennemsigtige og hæves, når der trykkes på dem. De kombineres ofte med hævede knapper for at angive en alternativ, sekundær handling.", "demoToggleButtonTitle": "Til/fra-knapper", "colorsTeal": "GRØNBLÅ", "demoFloatingButtonTitle": "Svævende handlingsknap", "demoFloatingButtonDescription": "En svævende handlingsknap er en rund ikonknap, der svæver over indholdet for at fremhæve en primær handling i appen.", "demoDialogTitle": "Dialogbokse", "demoDialogSubtitle": "Enkel, underretning og fuld skærm", "demoAlertDialogTitle": "Underretning", "demoAlertDialogDescription": "En underretningsdialogboks oplyser brugeren om situationer, der kræver handling. En underretningsdialogboks har en valgfri titel og en valgfri liste med handlinger.", "demoAlertTitleDialogTitle": "Underretning med titel", "demoSimpleDialogTitle": "Enkel", "demoSimpleDialogDescription": "En enkel dialogboks giver brugeren et valg mellem flere muligheder. En enkel dialogboks har en valgfri titel, der vises oven over valgmulighederne.", "demoFullscreenDialogTitle": "Fuld skærm", "demoCupertinoButtonsTitle": "Knapper", "demoCupertinoButtonsSubtitle": "Knapper i stil med iOS", "demoCupertinoButtonsDescription": "En knap i samme stil som iOS. Tydeligheden af teksten og/eller ikonet skifter, når knappen berøres. Der kan tilvælges en baggrund til knappen.", "demoCupertinoAlertsTitle": "Underretninger", "demoCupertinoAlertsSubtitle": "Dialogbokse til underretning i samme stil som iOS", "demoCupertinoAlertTitle": "Underretning", "demoCupertinoAlertDescription": "En underretningsdialogboks oplyser brugeren om situationer, der kræver handling. En underretningsdialogboks har en valgfri titel, valgfrit indhold og en valgfri liste med handlinger. Titlen vises oven over indholdet, og handlinger vises under indholdet.", "demoCupertinoAlertWithTitleTitle": "Underretning med titel", "demoCupertinoAlertButtonsTitle": "Underretning med knapper", "demoCupertinoAlertButtonsOnlyTitle": "Kun underretningsknapper", "demoCupertinoActionSheetTitle": "Handlingsark", "demoCupertinoActionSheetDescription": "Et handlingsark angiver, hvilken slags underretning der vises for brugeren med to eller flere valg, der er relevante i sammenhængen. Et handlingsark kan have en titel, en ekstra meddelelse og en liste med handlinger.", "demoColorsTitle": "Farver", "demoColorsSubtitle": "Alle de foruddefinerede farver", "demoColorsDescription": "Faste farver og farveskemaer, som repræsenterer farvepaletten for Material Design.", "buttonTextEnabled": "ENABLED", "buttonTextDisabled": "DISABLED", "buttonTextCreate": "Opret", "dialogSelectedOption": "Du valgte: \"{value}\"", "dialogDiscardTitle": "Vil du kassere kladden?", "dialogLocationTitle": "Vil du bruge Googles lokationstjeneste?", "dialogLocationDescription": "Lad Google gøre det nemmere for apps at fastlægge din lokation. Det betyder, at der sendes anonyme lokationsdata til Google, også når der ikke er nogen apps, der kører.", "dialogCancel": "ANNULLER", "dialogDiscard": "KASSÉR", "dialogDisagree": "ACCEPTÉR IKKE", "dialogAgree": "ACCEPTÉR", "dialogSetBackup": "Konfigurer konto til backup", "colorsBlueGrey": "BLÅGRÅ", "dialogShow": "VIS DIALOGBOKS", "dialogFullscreenTitle": "Dialogboks i fuld skærm", "dialogFullscreenSave": "GEM", "dialogFullscreenDescription": "Demonstration af en dialogboks i fuld skærm", "cupertinoButtonEnabled": "Enabled", "cupertinoButtonDisabled": "Disabled", "cupertinoButtonWithBackground": "Med baggrund", "cupertinoAlertCancel": "Annuller", "cupertinoAlertDiscard": "Kassér", "cupertinoAlertLocationTitle": "Vil du give \"Maps\" adgang til din lokation, når du bruger appen?", "cupertinoAlertLocationDescription": "Din aktuelle lokation vises på kortet og bruges til rutevejledning, søgeresultater i nærheden og til at beregne rejsetider.", "cupertinoAlertAllow": "Tillad", "cupertinoAlertDontAllow": "Tillad ikke", "cupertinoAlertFavoriteDessert": "Vælg en favoritdessert", "cupertinoAlertDessertDescription": "Vælg din yndlingsdessert på listen nedenfor. Dit valg bruges til at tilpasse den foreslåede liste over spisesteder i dit område.", "cupertinoAlertCheesecake": "Cheesecake", "cupertinoAlertTiramisu": "Tiramisu", "cupertinoAlertApplePie": "Æbletærte", "cupertinoAlertChocolateBrownie": "Chokoladebrownie", "cupertinoShowAlert": "Vis underretning", "colorsRed": "RØD", "colorsPink": "PINK", "colorsPurple": "LILLA", "colorsDeepPurple": "DYB LILLA", "colorsIndigo": "INDIGO", "colorsBlue": "BLÅ", "colorsLightBlue": "LYSEBLÅ", "colorsCyan": "CYAN", "dialogAddAccount": "Tilføj konto", "Gallery": "Galleri", "Categories": "Kategorier", "SHRINE": "SHRINE", "Basic shopping app": "Simpel app til shopping", "RALLY": "RALLY", "CRANE": "CRANE", "Travel app": "Rejseapp", "MATERIAL": "MATERIAL", "CUPERTINO": "CUPERTINO", "REFERENCE STYLES & MEDIA": "REFERENCESTILE OG MEDIER" }
gallery/lib/l10n/intl_da.arb/0
{ "file_path": "gallery/lib/l10n/intl_da.arb", "repo_id": "gallery", "token_count": 18935 }
811
{ "loading": "लोड हो रहा है", "deselect": "चुने हुए का निशान हटाएं", "select": "चुनें", "selectable": "चुना जा सकने वाला (देर तक दबाने पर)", "selected": "चुना गया", "demo": "डेमो", "bottomAppBar": "बॉटम ऐप्लिकेशन बार", "notSelected": "नहीं चुना गया", "demoCupertinoSearchTextFieldTitle": "सर्च टेक्स्ट फ़ील्ड", "demoCupertinoPicker": "पिकर", "demoCupertinoSearchTextFieldSubtitle": "iOS-स्टाइल का सर्च टेक्स्ट फ़ील्ड", "demoCupertinoSearchTextFieldDescription": "यह एक ऐसा सर्च टेक्स्ट फ़ील्ड है, जिसमें लोग टेक्स्ट डालकर खोज कर सकते हैं. इसमें, सुझावों के ऑफ़र मिलते हैं और फ़िल्टर लगाए जा सकते हैं.", "demoCupertinoSearchTextFieldPlaceholder": "कुछ टेक्स्ट डालें", "demoCupertinoScrollbarTitle": "स्क्रोलबार", "demoCupertinoScrollbarSubtitle": "iOS स्टाइल का स्क्रोलबार", "demoCupertinoScrollbarDescription": "दिए गए चाइल्ड को रैप करने वाला स्क्रोलबार", "demoTwoPaneItem": "आइटम {value}", "demoTwoPaneList": "सूची", "demoTwoPaneFoldableLabel": "फ़ोल्ड किया जा सकने वाला डिवाइस", "demoTwoPaneSmallScreenLabel": "छोटी स्क्रीन", "demoTwoPaneSmallScreenDescription": "छोटी स्क्रीन वाले डिवाइस पर TwoPane इस तरह काम करता है.", "demoTwoPaneTabletLabel": "टैबलेट / डेस्कटॉप", "demoTwoPaneTabletDescription": "बड़ी स्क्रीन वाले डिवाइस, जैसे कि टैबलेट या डेस्कटॉप पर TwoPane इस तरह काम करता है.", "demoTwoPaneTitle": "TwoPane", "demoTwoPaneSubtitle": "फ़ोल्ड किए जा सकने वाले डिवाइस, बड़ी स्क्रीन, और छोटी स्क्रीन के लिए रिस्पॉन्सिव लेआउट", "splashSelectDemo": "कोई डेमो चुनें", "demoTwoPaneFoldableDescription": "फ़ोल्ड किए जा सकने वाले डिवाइस पर TwoPane इस तरह काम करता है.", "demoTwoPaneDetails": "ब्यौरा", "demoTwoPaneSelectItem": "कोई आइटम चुनें", "demoTwoPaneItemDetails": "आइटम {value} का ब्यौरा", "demoCupertinoContextMenuActionText": "संदर्भ मेन्यू देखने के लिए, फ़्लटर लोगो को टैप करके रखें.", "demoCupertinoContextMenuDescription": "किसी एलिमेंट को दबाकर रखने पर, iOS-स्टाइल का फ़ुल स्क्रीन संदर्भ मेन्यू खुल जाता है.", "demoAppBarTitle": "ऐप्लिकेशन बार", "demoAppBarDescription": "ऐप्लिकेशन बार, मौजूदा स्क्रीन से जुड़ी कार्रवाइयां और कॉन्टेंट उपलब्ध कराता है. इसका इस्तेमाल ब्रैंडिंग, स्क्रीन के शीर्षकों, नेविगेट करने, और कार्रवाइयों के लिए होता है", "demoDividerTitle": "डिवाइडर", "demoDividerSubtitle": "डिवाइडर उस बारीक लाइन को कहते हैं जो कॉन्टेंट को सूचियों और लेआउट में बांटता है.", "demoDividerDescription": "डिवाइडर का इस्तेमाल सूचियों, ड्रॉर, और अन्य जगहों पर कॉन्टेंट को बांटने के लिए किया जा सकता है.", "demoVerticalDividerTitle": "वर्टिकल डिवाइडर", "demoCupertinoContextMenuTitle": "संदर्भ मेन्यू", "demoCupertinoContextMenuSubtitle": "iOS स्टाइल का संदर्भ मेन्यू", "demoAppBarSubtitle": "मौजूदा स्क्रीन से जुड़ी जानकारी और कार्रवाइयां दिखाता है", "demoCupertinoContextMenuActionOne": "पहली कार्रवाई", "demoCupertinoContextMenuActionTwo": "दूसरी कार्रवाई", "demoDateRangePickerDescription": "यह ऐसा डायलॉग दिखाता है जिसमें मटीरियल डिज़ाइन वाला टूल मौजूद होता है, जिससे तारीख की सीमा चुन सकते हैं.", "demoDateRangePickerTitle": "तारीख की सीमा चुनने की सुविधा", "demoNavigationDrawerUserName": "उपयोगकर्ता का नाम", "demoNavigationDrawerUserEmail": "[email protected]", "demoNavigationDrawerText": "नेविगेशन पैनल देखने के लिए, स्क्रीन के किनारे से स्वाइप करें या स्क्रीन के ऊपरी हिस्से पर बाईं ओर मौजूद आइकॉन पर टैप करें", "demoNavigationRailTitle": "नेविगेशन रेल", "demoNavigationRailSubtitle": "ऐप्लिकेशन के अंदर दिखती हुई नेविगेशन रेल", "demoNavigationRailDescription": "दिए गए कुछ व्यू के बीच नेविगेट करने के लिए, मटीरियल विजेट का इस्तेमाल किया जाता है. यह विजेट किसी ऐप्लिकेशन के बाईं या दाईं ओर दिखना चाहिए. अक्सर, कुल मिलाकर तीन से पांच व्यू होते हैं.", "demoNavigationRailFirst": "पहला", "demoNavigationDrawerTitle": "नेविगेशन पैनल", "demoNavigationRailThird": "तीसरा", "replyStarredLabel": "स्टार के निशान वाले", "demoTextButtonDescription": "टेक्स्ट बटन को दबाने पर वह फैली हुई स्याही जैसा दिखता है, लेकिन वह ऊपर की ओर उठा हुआ नहीं दिखता. टूलबार, डायलॉग, और पैडिंग वाले इनलाइन के साथ टेक्स्ट बटन का इस्तेमाल करें", "demoElevatedButtonTitle": "उभरे हुए बटन", "demoElevatedButtonDescription": "उभरे हुए बटन, फ़्लैट लेआउट को डाइमेंशन देकर, उन्हें बेहतर बनाने में मदद करते हैं. ये भरी हुई या चौड़ी जगहों पर किए जाने वाले कामों को बेहतर तरीके से दिखाते हैं.", "demoOutlinedButtonTitle": "आउटलाइन वाले बटन", "demoOutlinedButtonDescription": "आउटलाइन वाले बटन दबाने पर धुंधले हो जाते हैं और ऊपर की ओर उठ जाते हैं. इन्हें वैकल्पिक तौर पर, दूसरी कार्रवाई के रूप में अक्सर उभरे हुए बटन के साथ जोड़ा जाता है.", "demoContainerTransformDemoInstructions": "कार्ड, सूची, और फ़्लोट करने वाला कार्रवाई बटन (एफ़एबी)", "demoNavigationDrawerSubtitle": "ऐप्लिकेशन बार के अंदर दिखता हुआ पैनल", "replyDescription": "कारगर और उपयोगी ईमेल ऐप्लिकेशन", "demoNavigationDrawerDescription": "मटीरियल डिज़ाइन पैनल का इस्तेमाल किसी ऐप्लिकेशन में नेविगेशन वाले लिंक दिखाने के लिए किया जाता है. यह पैनल स्क्रीन के बाएं या दाएं किनारे से स्लाइड करने पर दिखता है.", "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": "शेयर्ड वाई-ऐक्सिस", "demoSharedXAxisCreateAccountButtonText": "खाता बनाएं", "demoFadeScaleAlertDialogDiscardButton": "खारिज करें", "demoSharedXAxisSignInTextFieldLabel": "ईमेल पता या फ़ोन नंबर", "demoSharedXAxisSignInSubtitleText": "अपने खाते से साइन इन करें", "demoSharedXAxisSignInWelcomeText": "नमस्ते, डेविड पार्क", "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": "शेयर्ड ज़ेड-ऐक्सिस", "demoSharedZAxisPrivacySettingLabel": "निजता", "demoMotionTitle": "मोशन", "demoContainerTransformTitle": "कंटेनर ट्रांसफ़ॉर्म", "demoContainerTransformDescription": "कंटेनर ट्रांसफ़ॉर्म वाला पैटर्न, उन यूज़र इंटरफ़ेस (यूआई) एलिमेंट के बीच ट्रांज़िशन के लिए डिज़ाइन किया जाता है जिनमें कंटेनर शामिल होता है. इस पैटर्न से दो यूआई एलिमेंट के बीच, दिखने वाला कनेक्शन बनाने में मदद मिलती है", "demoContainerTransformModalBottomSheetTitle": "फ़ेड मोड", "demoContainerTransformTypeFade": "फ़ेड", "demoSharedYAxisAlbumTileDurationUnit": "मिनट", "demoMotionPlaceholderTitle": "टाइटल", "demoSharedXAxisForgotEmailButtonText": "ईमेल पता भूल गए?", "demoMotionSmallPlaceholderSubtitle": "छोटा किया गया सबटाइटल टेक्स्ट", "demoMotionDetailsPageTitle": "ज़्यादा जानकारी वाला पेज", "demoMotionListTileTitle": "आइटम की सूची", "demoSharedAxisDescription": "शेयर्ड ऐक्सिस वाला पैटर्न, उन यूज़र इंटरफ़ेस (यूआई) एलिमेंट के बीच ट्रांज़िशन के लिए इस्तेमाल किया जाता है जो दूरी या नेविगेशन के संदर्भ में एक-दूसरे से जुड़े होते हैं. यह पैटर्न, एलिमेंट के बीच तालमेल को बेहतर बनाने के लिए, ऐक्स, वाई या ज़ेड ऐक्सिस के बीच शेयर होने वाले बदलाव के हिसाब से काम करता है.", "demoSharedXAxisTitle": "शेयर्ड ऐक्स-ऐक्सिस", "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": "Apple Pie", "dataTableRowDonut": "Donut", "dataTableRowHoneycomb": "Honeycomb", "dataTableRowLollipop": "Lollipop", "dataTableRowJellyBean": "Jelly bean", "dataTableRowGingerbread": "Gingerbread", "dataTableRowCupcake": "Cupcake", "dataTableRowEclair": "Eclair", "dataTableRowIceCreamSandwich": "Ice Cream Sandwich", "dataTableRowFrozenYogurt": "Frozen yogurt", "dataTableColumnIron": "आयरन (%)", "dataTableColumnCalcium": "कैल्शियम (%)", "dataTableColumnSodium": "सोडियम (मि.ग्रा.)", "demoTimePickerTitle": "समय चुनने वाला टूल", "demo2dTransformationsResetTooltip": "ट्रांसफ़र्मेशन को रीसेट करें", "dataTableColumnFat": "फ़ैट (ग्रा.)", "dataTableColumnCalories": "कैलोरी", "dataTableColumnDessert": "मीठा पकवान (1 प्लेट)", "cardsDemoTravelDestinationLocation1": "तंजावुर, तमिलनाडु", "demoTimePickerDescription": "यह ऐसा डायलॉग दिखाता है जिसमें Material Design वाला टूल मौजूद होता है, जिससे तारीख चुन सकते हैं.", "demoPickersShowPicker": "समय या तारीख चुनने वाला टूल दिखाएं", "demoTabsScrollingTitle": "टैब बार जिसे स्क्रोल किया जा सकता है", "demoTabsNonScrollingTitle": "टैब बार जिसे स्क्रोल नहीं किया जा सकता", "craneHours": "{hours,plural,=1{1 घं.}other{{hours} घं.}}", "craneMinutes": "{minutes,plural,=1{1 मि.}other{{minutes} मि.}}", "craneFlightDuration": "{hoursShortForm} {minutesShortForm}", "dataTableHeader": "पोषण", "demoDatePickerTitle": "तारीख चुनने वाला टूल", "demoPickersSubtitle": "तारीख और समय चुनना", "demoPickersTitle": "तारीख और समय चुनने वाले टूल", "demo2dTransformationsEditTooltip": "टाइल में बदलाव करें", "demoDataTableDescription": "डेटा टेबल, ग्रिड जैसे फ़ॉर्मैट में होती हैं. इनमें जानकारी को पंक्तियों और कॉलम में दिखाया जाता है. इनमें दी गई जानकारी को स्कैन करना आसान होता है. इससे उपयोगकर्ताओं को पैटर्न और अहम जानकारी खाेजने में मदद मिलती है.", "demo2dTransformationsDescription": "टाइल में बदलाव करने के लिए टैप करें. साथ ही, सीन पर इधर-उधर जाने के लिए हाथ के जेस्चर (हाव-भाव) का इस्तेमाल करें. पैन करने के लिए खींचकर छोड़ें और ज़ूम करने के लिए पिंच करें. साथ ही, दो उंगलियों की मदद से स्क्रीन घुमाएं. स्क्रीन को शुरुआती दिशा पर वापस लाने के लिए रीसेट बटन दबाएं.", "demo2dTransformationsSubtitle": "पैन करना, ज़ूम करना, और घुमाना", "demo2dTransformationsTitle": "2D ट्रांसफ़र्मेशन", "demoCupertinoTextFieldPIN": "पिन", "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": "कार्ड, Material Design की एक शीट होती है. इसका इस्तेमाल किसी खाेज से मिलती-जुलती जानकारी दिखाने के लिए किया जाता है. उदाहरण के लिए, कोई जगह, किसी तरह का खाना, संपर्क की जानकारी वगैरह.", "demoDataTableTitle": "डेटा टेबल", "demoDataTableSubtitle": "पंक्तियां और कॉलम, जिनमें जानकारी मौजूद होती है", "dataTableColumnCarbs": "कार्बोहाइड्रेट (ग्रा.)", "placeTanjore": "तंजोर", "demoGridListsTitle": "ग्रिड सूचियां", "placeFlowerMarket": "फूलों का बाज़ार", "placeBronzeWorks": "ब्रॉन्ज़ वर्क्स", "placeMarket": "बाज़ार", "placeThanjavurTemple": "तंजावुर मंदिर", "placeSaltFarm": "सॉल्ट फ़ार्म", "placeScooters": "स्कूटर चलाते लोग", "placeSilkMaker": "सिल्क बनाने वाला", "placeLunchPrep": "दोपहर के खाने की तैयारी", "placeBeach": "समुद्र तट", "placeFisherman": "मछली पकड़ने वाला", "demoMenuSelected": "इसे चुना गया: {value}", "demoMenuRemove": "हटाएं", "demoMenuGetLink": "लिंक पाएं", "demoMenuShare": "शेयर करें", "demoBottomAppBarSubtitle": "स्क्रीन पर सबसे नीचे मौजूद नेविगेशन और कार्रवाइयों को दिखाता है", "demoMenuAnItemWithASectionedMenu": "सेक्शन वाले मेन्यू से जुड़ा आइटम", "demoMenuADisabledMenuItem": "बंद किया गया मेन्यू आइटम", "demoLinearProgressIndicatorTitle": "गतिविधि की स्थिति लीनियर फ़ॉर्मैट में दिखाने वाला इंडिकेटर", "demoMenuContextMenuItemOne": "संदर्भ मेन्यू का पहला आइटम", "demoMenuAnItemWithASimpleMenu": "सरल मेन्यू वाला आइटम", "demoCustomSlidersTitle": "पसंद के मुताबिक बनाए गए स्लाइडर", "demoMenuAnItemWithAChecklistMenu": "चेकलिस्ट मेन्यू वाला आइटम", "demoCupertinoActivityIndicatorTitle": "गतिविधि दिखाने वाला संकेत", "demoCupertinoActivityIndicatorSubtitle": "iOS की शैली में गतिविधि दिखाने वाले इंडिकेटर", "demoCupertinoActivityIndicatorDescription": "iOS की शैली में गतिविधि दिखाने वाला इंडिकेटर जो घड़ी की दिशा में चलता है.", "demoCupertinoNavigationBarTitle": "नेविगेशन बार", "demoCupertinoNavigationBarSubtitle": "iOS स्टाइल वाला नेविगेशन बार", "demoCupertinoNavigationBarDescription": "iOS स्टाइल वाला नेविगेशन बार. नेविगेशन बार एक ऐसा टूलबार है जिसमें कम से कम एक पेज टाइटल होता है. यह टूलबार के बीच में होता है.", "demoCupertinoPullToRefreshTitle": "रीफ़्रेश करने के लिए स्क्रीन को नीचे खींचें", "demoCupertinoPullToRefreshSubtitle": "iOS स्टाइल वाला नियंत्रण जिसमें रीफ़्रेश करने के लिए स्क्रीन काे खींचा जाता है", "demoCupertinoPullToRefreshDescription": "iOS स्टाइल वाले सामग्री नियंत्रण काे लागू करने से जुड़ा विजेट. इसमें रीफ़्रेश करने के लिए स्क्रीन काे खींचा जाता है.", "demoProgressIndicatorTitle": "गतिविधि की स्थिति दिखाने वाले इंडिकेटर", "demoProgressIndicatorSubtitle": "लीनियर, सर्कुलर, इंडेटरमिनेट", "demoCircularProgressIndicatorTitle": "गतिविधि की स्थिति सर्कुलर फ़ॉर्मैट में दिखाने वाला इंडिकेटर", "demoCircularProgressIndicatorDescription": "मटीरियल डिज़ाइन सर्कुलर फ़ॉर्मैट में किसी गतिविधि की स्थिति दिखाने वाले इंडिकेटर से यह पता चलता है कि ऐप्लिकेशन पर कोई प्रोसेसिंग चल रही है.", "demoMenuFour": "चार", "demoLinearProgressIndicatorDescription": "मटीरियल डिज़ाइन लीनियर फ़ॉर्मैट में किसी गतिविधि की स्थिति दिखाने वाले इंडिकेटर को प्रगति बार भी कहते हैं.", "demoTooltipTitle": "टूलटिप", "demoTooltipSubtitle": "किसी आइटम पर माउस घुमाने या उसे दबाकर रखने पर एक छोटा मैसेज दिखता है", "demoTooltipDescription": "टूलटिप में टेक्स्ट लेबल दिखाई देता है, जो बताता है कि बटन का क्या काम है या यूज़र इंटरफ़ेस के दूसरे कामों की जानकारी देता है. जब उपयोगकर्ता किसी आइटम पर माउस घुमाते हैं, फ़ोकस करते हैं या उसे दबाकर रखते हैं, तो टूलटिप उससे जुड़ी जानकारी दिखाती है.", "demoTooltipInstructions": "टूलटिप देखने के लिए आइटम को दबाकर रखें या उस पर माउस घुमाएं.", "placeChennai": "चेन्नई", "demoMenuChecked": "सही का निशान लगाकर इसे चुना गया: {value}", "placeChettinad": "चेट्टीनाड", "demoMenuPreview": "झलक देखें", "demoBottomAppBarTitle": "बॉटम ऐप्लिकेशन बार", "demoBottomAppBarDescription": "स्क्रीन के सबसे नीचे मौजूद ऐप्लिकेशन बार (बॉटम ऐप्लिकेशन बार), नीचे की ओर खुलने वाले नेविगेशन पैनल (बॉटम नेविगेशन पैनल) और ज़्यादा से ज़्यादा चार कार्रवाइयों के लिए ऐक्सेस देते हैं. इन कार्रवाइयों में फ़्लोट करने वाला कार्रवाई बटन भी शामिल है.", "bottomAppBarNotch": "नॉच", "bottomAppBarPosition": "बॉटम ऐप्लिकेशन बार में, फ़्लोट करने वाले कार्रवाई बटन की जगह", "bottomAppBarPositionDockedEnd": "फ़्लोट करने वाले कार्रवाई बटन को नीचे दाईं तरफ़ डॉक किया गया", "bottomAppBarPositionDockedCenter": "फ़्लोट करने वाले कार्रवाई बटन को बीच में डॉक किया गया", "bottomAppBarPositionFloatingEnd": "फ़्लोट करने वाले कार्रवाई बटन को नीचे दाईं तरफ़ लगाया गया", "bottomAppBarPositionFloatingCenter": "फ़्लोट करने वाले कार्रवाई बटन को बीच में लगाया गया", "demoSlidersEditableNumericalValue": "ऐसा मान जिसमें बदलाव किया जा सकता है", "demoGridListsSubtitle": "पंक्ति और कॉलम का लेआउट", "demoGridListsDescription": "ग्रिड सूचियां, एक जैसा डेटा पेश करने का सबसे सही विकल्प हैं. जैसे कि इमेज दिखाने के लिए. ग्रिड सूची में मौजूद हर आइटम को टाइल कहा जाता है.", "demoGridListsImageOnlyTitle": "सिर्फ़ इमेज के लिए", "demoGridListsHeaderTitle": "हेडर के साथ", "demoGridListsFooterTitle": "फ़ुटर के साथ", "demoSlidersTitle": "स्लाइडर", "demoSlidersSubtitle": "स्वाइप करके मान चुनने के विजेट", "demoSlidersDescription": "स्लाइडर किसी बार पर मौजूद मानों की सीमा दिखाते हैं. इससे लोग किसी भी मान को चुन सकते हैं. ये सेटिंग में बदलाव करने के लिए बेहतर विकल्प हैं. इसमें आवाज़ कम या ज़्यादा करना, चमक घटाना-बढ़ाना या किसी इमेज में फ़िल्टर लगाने जैसे बदलाव शामिल हैं.", "demoRangeSlidersTitle": "मानों की सीमा दिखाने वाले स्लाइडर", "demoRangeSlidersDescription": "स्लाइडर किसी बार पर मौजूद मानों की सीमा दिखाते हैं. इनमें बार के दोनों तरफ़ आइकॉन मौजूद हो सकते हैं जिनमें मानों की सीमा दिखाई जाती है. ये सेटिंग में बदलाव करने के लिए बेहतर विकल्प हैं. इसमें आवाज़ कम या ज़्यादा करना, चमक घटाना-बढ़ाना या किसी इमेज में फ़िल्टर लगाने जैसे बदलाव शामिल हैं.", "demoMenuAnItemWithAContextMenuButton": "संदर्भ मेन्यू वाला आइटम", "demoCustomSlidersDescription": "ये स्लाइडर किसी बार पर मौजूद मानों की सीमा दिखाते हैं. इससे उपयोगकर्ता किसी एक मान या मानों की सीमा को चुन सकते हैं. स्लाइडर के लिए थीम चुनकर उन्हें पसंद के मुताबिक बनाया जा सकता है.", "demoSlidersContinuousWithEditableNumericalValue": "तय न की गई संख्या वाला स्लाइडर जिसके मानों में बदलाव किया जा सकता है", "demoSlidersDiscrete": "तय संख्या वाला स्लाइडर", "demoSlidersDiscreteSliderWithCustomTheme": "तय संख्या वाला स्लाइडर जिसमें पसंद के मुताबिक थीम चुनने की सुविधा मौजूद है", "demoSlidersContinuousRangeSliderWithCustomTheme": "तय न की गई संख्या वाला स्लाइडर जिसमें पसंद के मुताबिक थीम चुनने की सुविधा मौजूद है", "demoSlidersContinuous": "तय न की गई संख्या वाला स्लाइडर", "placePondicherry": "पॉन्डिचेरी", "demoMenuTitle": "मेन्यू", "demoContextMenuTitle": "संदर्भ मेन्यू", "demoSectionedMenuTitle": "सेक्शन वाला मेन्यू", "demoSimpleMenuTitle": "सरल मेन्यू", "demoChecklistMenuTitle": "चेकलिस्ट मेन्यू", "demoMenuSubtitle": "मेन्यू बटन और सरल मेन्यू", "demoMenuDescription": "मेन्यू एक अस्थायी सतह पर विकल्पों की सूची दिखाता है. ये विकल्प तब दिखते हैं, जब उपयोगकर्ता किसी बटन, कार्रवाई या दूसरे नियंत्रण का इस्तेमाल करते हैं.", "demoMenuItemValueOne": "मेन्यू का पहला आइटम", "demoMenuItemValueTwo": "मेन्यू का दूसरा आइटम", "demoMenuItemValueThree": "मेन्यू का तीसरा आइटम", "demoMenuOne": "एक", "demoMenuTwo": "दो", "demoMenuThree": "तीन", "demoMenuContextMenuItemThree": "संदर्भ मेन्यू का तीसरा आइटम", "demoCupertinoSwitchSubtitle": "iOS की शैली वाला स्विच", "demoSnackbarsText": "यह स्नैकबार है.", "demoCupertinoSliderSubtitle": "iOS की शैली वाला स्लाइडर", "demoCupertinoSliderDescription": "स्लाइडर का इस्तेमाल संख्याओं के सेट में से किसी भी संख्या या किसी तय संख्या को चुनने के लिए किया जा सकता है.", "demoCupertinoSliderContinuous": "कोई भी संख्या: {value}", "demoCupertinoSliderDiscrete": "कोई तय संख्या: {value}", "demoSnackbarsAction": "आपने स्नैकबार वाली कार्रवाई चुनी है.", "backToGallery": "Gallery पर वापस जाएं", "demoCupertinoTabBarTitle": "टैब बार", "demoCupertinoSwitchDescription": "स्विच का इस्तेमाल किसी सेटिंग को चालू/बंद करने के लिए किया जाता है.", "demoSnackbarsActionButtonLabel": "कार्रवाई", "cupertinoTabBarProfileTab": "प्रोफ़ाइल", "demoSnackbarsButtonLabel": "स्नैकबार देखें", "demoSnackbarsDescription": "स्नैकबार, उपयोगकर्ताओं को किसी ऐप्लिकेशन की ऐसी प्रोसेस के बारे में जानकारी देते हैं जो हो चुकी है या होने वाली है. ये स्क्रीन पर सबसे नीचे, कुछ समय के लिए दिखते हैं. स्नैकबार की वजह से उपयोगकर्ता अनुभव में कोई रुकावट नहीं आनी चाहिए. साथ ही, इन्हें स्क्रीन से हटाने के लिए उपयोगकर्ता के इनपुट की ज़रूरत नहीं होती है.", "demoSnackbarsSubtitle": "स्नैकबार, स्क्रीन के सबसे नीचे मैसेज दिखाते हैं", "demoSnackbarsTitle": "स्नैकबार", "demoCupertinoSliderTitle": "स्लाइडर", "cupertinoTabBarChatTab": "Chat", "cupertinoTabBarHomeTab": "होम", "demoCupertinoTabBarDescription": "सबसे नीचे मौजूद iOS की शैली वाला नेविगेशन टैब बार यह कई टैब दिखाता है जिनमें से सिर्फ़ एक चालू होता है. डिफ़ॉल्ट रूप से, सबसे पहले खुला हुआ टैब चालू होता है.", "demoCupertinoTabBarSubtitle": "सबसे नीचे मौजूद iOS की शैली वाला टैब बार", "demoOptionsFeatureTitle": "विकल्प देखें", "demoOptionsFeatureDescription": "इस डेमो के लिए उपलब्ध विकल्पों को देखने के लिए यहां टैप करें.", "demoCodeViewerCopyAll": "सभी को कॉपी करें", "shrineScreenReaderRemoveProductButton": "{product} हटाएं", "shrineScreenReaderProductAddToCart": "कार्ट में जोड़ें", "shrineScreenReaderCart": "{quantity,plural,=0{शॉपिंग कार्ट, इसमें कोई आइटम नहीं है}=1{शॉपिंग कार्ट, इसमें 1 आइटम है}other{शॉपिंग कार्ट, इसमें {quantity} आइटम हैं}}", "demoCodeViewerFailedToCopyToClipboardMessage": "क्लिपबोर्ड पर कॉपी नहीं हुआ: {error}", "demoCodeViewerCopiedToClipboardMessage": "क्लिपबोर्ड पर कॉपी हो गया.", "craneSleep8SemanticLabel": "समुद्र तट पर स्थित एक चट्टान पर माया सभ्यता के खंडहर", "craneSleep4SemanticLabel": "पहाड़ों के सामने, झील के किनारे बना होटल", "craneSleep2SemanticLabel": "माचू पिच्चू सिटडल", "craneSleep1SemanticLabel": "सदाबहार पेड़ों के बीच बर्फ़ीले लैंडस्केप में बना शैले", "craneSleep0SemanticLabel": "पानी पर बने बंगले", "craneFly13SemanticLabel": "समुद्र किनारे ताड़ के पेड़ों के साथ बना पूल", "craneFly12SemanticLabel": "ताड़ के पेड़ों के साथ पूल", "craneFly11SemanticLabel": "समुद्र तट पर ईंट से बना लाइटहाउस", "craneFly10SemanticLabel": "सूर्यास्त के दौरान अल-अज़हर मस्ज़िद के टावर", "craneFly9SemanticLabel": "नीले रंग की विटेंज कार से टेक लगाकर खड़ा व्यक्ति", "craneFly8SemanticLabel": "सुपरट्री ग्रोव", "craneEat9SemanticLabel": "पेस्ट्री रखी कैफ़े काउंटर", "craneEat2SemanticLabel": "बर्गर", "craneFly5SemanticLabel": "पहाड़ों के सामने, झील के किनारे बना होटल", "demoSelectionControlsSubtitle": "चेकबॉक्स, रेडियो बटन, और स्विच", "craneEat10SemanticLabel": "हाथ में बड़ा पस्ट्रामी सैंडविच पकड़े महिला", "craneFly4SemanticLabel": "पानी पर बने बंगले", "craneEat7SemanticLabel": "बेकरी में जाने का रास्ता", "craneEat6SemanticLabel": "झींगे से बना पकवान", "craneEat5SemanticLabel": "कलात्मक रूप से बने रेस्टोरेंट में बैठने की जगह", "craneEat4SemanticLabel": "चॉकलेट से बनी मिठाई", "craneEat3SemanticLabel": "कोरियन टाको", "craneFly3SemanticLabel": "माचू पिच्चू सिटडल", "craneEat1SemanticLabel": "डाइनर-स्टाइल स्टूल वाला खाली बार", "craneEat0SemanticLabel": "लकड़ी जलाने से गर्म होने वाले अवन में पिज़्ज़ा", "craneSleep11SemanticLabel": "ताइपेई 101 स्काइस्क्रेपर", "craneSleep10SemanticLabel": "सूर्यास्त के दौरान अल-अज़हर मस्ज़िद के टावर", "craneSleep9SemanticLabel": "समुद्र तट पर ईंट से बना लाइटहाउस", "craneEat8SemanticLabel": "प्लेट में रखी झींगा मछली", "craneSleep7SemanticLabel": "राईबेरिया स्क्वायर में रंगीन अपार्टमेंट", "craneSleep6SemanticLabel": "ताड़ के पेड़ों के साथ पूल", "craneSleep5SemanticLabel": "मैदान में टेंट", "settingsButtonCloseLabel": "सेटिंग बंद करें", "demoSelectionControlsCheckboxDescription": "चेकबॉक्स से उपयोगकर्ता किसी सेट के एक से ज़्यादा विकल्प चुन सकते हैं. सामान्य चेकबॉक्स का मान सही या गलत होता है. साथ ही, तीन स्थिति वाले चेकबॉक्स का मान खाली भी छोड़ा जा सकता है.", "settingsButtonLabel": "सेटिंग", "demoListsTitle": "सूचियां", "demoListsSubtitle": "ऐसी सूची के लेआउट जिसे स्क्रोल किया जा सकता है", "demoListsDescription": "एक ऐसी पंक्ति जिसकी लंबाई बदली नहीं जा सकती और जिसमें कुछ टेक्स्ट होता है. साथ ही, इसकी शुरुआत या आखिर में एक आइकॉन भी होता है.", "demoOneLineListsTitle": "एक लाइन", "demoTwoLineListsTitle": "दो लाइन", "demoListsSecondary": "सूची की दूसरी लाइन वाला टेक्स्ट", "demoSelectionControlsTitle": "चुनने के नियंत्रण", "craneFly7SemanticLabel": "माउंट रशमोर", "demoSelectionControlsCheckboxTitle": "चेकबॉक्स", "craneSleep3SemanticLabel": "नीले रंग की विटेंज कार से टेक लगाकर खड़ा व्यक्ति", "demoSelectionControlsRadioTitle": "रेडियो", "demoSelectionControlsRadioDescription": "रेडियो बटन, उपयोगकर्ता को किसी सेट में से एक विकल्प चुनने की सुविधा देता है. अगर आपको लगता है कि उपयोगकर्ता सभी विकल्पों को एक साथ देखना चाहते हैं, तो खास विकल्पों को चुनने के लिए रेडियो बटन का इस्तेमाल करें.", "demoSelectionControlsSwitchTitle": "बदलें", "demoSelectionControlsSwitchDescription": "चालू/बंद करने के स्विच को टॉगल करके, सेटिंग के किसी विकल्प की स्थिति बदली जा सकती है. स्विच की मदद से कंट्रोल किए जा रहे विकल्प और उसकी स्थिति, दोनों की पूरी जानकारी एक इनलाइन लेबल में दी जानी चाहिए.", "craneFly0SemanticLabel": "सदाबहार पेड़ों के बीच बर्फ़ीले लैंडस्केप में बना शैले", "craneFly1SemanticLabel": "मैदान में टेंट", "craneFly2SemanticLabel": "बर्फ़ीले पहाड़ के सामने लगे प्रार्थना के लिए इस्तेमाल होने वाले झंडे", "craneFly6SemanticLabel": "पैलासियो दे बेलास आर्तिस की ऊपर से ली गई इमेज", "rallySeeAllAccounts": "सभी खाते देखें", "rallyBillAmount": "{billName} के बिल के {amount} चुकाने की आखिरी तारीख {date} है.", "shrineTooltipCloseCart": "कार्ट बंद करें", "shrineTooltipCloseMenu": "मेन्यू बंद करें", "shrineTooltipOpenMenu": "मेन्यू खोलें", "shrineTooltipSettings": "सेटिंग", "shrineTooltipSearch": "खोजें", "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{किराये पर लेने के लिए एक जगह उपलब्ध है}other{किराये पर लेने के लिए {totalProperties} जगह उपलब्ध हैं}}", "craneEatRestaurants": "{totalRestaurants,plural,=0{कोई रेस्टोरेंट नहीं है}=1{1 रेस्टोरेंट}other{{totalRestaurants} रेस्टोरेंट}}", "craneFly0": "ऐस्पन, अमेरिका", "demoCupertinoSegmentedControlSubtitle": "iOS की शैली वाले सेगमेंट में दिया नियंत्रण", "craneSleep10": "काहिरा, मिस्र", "craneEat9": "मैड्रिड, स्पेन", "craneFly1": "बिग सर, अमेरिका", "craneEat7": "नैशविल, अमेरिका", "craneEat6": "सिएटल, अमेरिका", "craneFly8": "सिंगापुर", "craneEat4": "पेरिस, फ़्रांस", "craneEat3": "पोर्टलैंड, अमेरिका", "craneEat2": "कोर्डोबा, अर्जेंटीना", "craneEat1": "डलास, अमेरिका", "craneEat0": "नेपल्स, इटली", "craneSleep11": "ताइपेई, ताइवान", "craneSleep3": "हवाना, क्यूबा", "shrineLogoutButtonCaption": "लॉग आउट करें", "rallyTitleBills": "बिल", "rallyTitleAccounts": "खाते", "shrineProductVagabondSack": "झाेला", "rallyAccountDetailDataInterestYtd": "इस साल अब तक का ब्याज", "shrineProductWhitneyBelt": "व्हिटनी बेल्ट", "shrineProductGardenStrand": "गार्डन स्ट्रैंड", "shrineProductStrutEarrings": "स्ट्रट ईयर-रिंग्स", "shrineProductVarsitySocks": "वार्सिटी सॉक्स", "shrineProductWeaveKeyring": "वीव की-रिंग", "shrineProductGatsbyHat": "गैट्सबी हैट", "shrineProductShrugBag": "कंधे पर लटकाने वाले बैग", "shrineProductGiltDeskTrio": "गिल्ट डेस्क ट्रायो", "shrineProductCopperWireRack": "कॉपर वायर रैक", "shrineProductSootheCeramicSet": "सूद सिरामिक सेट", "shrineProductHurrahsTeaSet": "हुर्राह्स टी सेट", "shrineProductBlueStoneMug": "ब्लू स्टोन मग", "shrineProductRainwaterTray": "रेनवॉटर ट्रे", "shrineProductChambrayNapkins": "शैम्ब्रे नैपकिन", "shrineProductSucculentPlanters": "सक्युलेंट प्लांटर", "shrineProductQuartetTable": "क्वॉर्टेट टेबल", "shrineProductKitchenQuattro": "किचन क्वॉट्रो", "shrineProductClaySweater": "क्ले स्वेटर", "shrineProductSeaTunic": "सी ट्यूनिक", "shrineProductPlasterTunic": "प्लास्टर ट्यूनिक", "rallyBudgetCategoryRestaurants": "रेस्टोरेंट", "shrineProductChambrayShirt": "शैम्ब्रे शर्ट", "shrineProductSeabreezeSweater": "सीब्रीज़ स्वेटर", "shrineProductGentryJacket": "जेंट्री जैकेट", "shrineProductNavyTrousers": "नेवी ट्राउज़र", "shrineProductWalterHenleyWhite": "वॉल्टर हेनली (सफ़ेद)", "shrineProductSurfAndPerfShirt": "सर्फ़ ऐंड पर्फ़ शर्ट", "shrineProductGingerScarf": "जिंजर स्कार्फ़", "shrineProductRamonaCrossover": "रमोना क्रॉसओवर", "shrineProductClassicWhiteCollar": "क्लासिक सफ़ेद कॉलर", "shrineProductSunshirtDress": "सनशर्ट ड्रेस", "rallyAccountDetailDataInterestRate": "ब्याज दर", "rallyAccountDetailDataAnnualPercentageYield": "सालाना फ़ायदे का प्रतिशत", "rallyAccountDataVacation": "छुट्टियां", "shrineProductFineLinesTee": "फाइन लाइंस टी-शर्ट", "rallyAccountDataHomeSavings": "घर की बचत", "rallyAccountDataChecking": "चेकिंग", "rallyAccountDetailDataInterestPaidLastYear": "पिछले साल दिया गया ब्याज", "rallyAccountDetailDataNextStatement": "अगला स्टेटमेंट", "rallyAccountDetailDataAccountOwner": "खाते का मालिक", "rallyBudgetCategoryCoffeeShops": "कॉफ़ी शॉप", "rallyBudgetCategoryGroceries": "किराने का सामान", "shrineProductCeriseScallopTee": "गुलाबी कंगूरेदार टी-शर्ट", "rallyBudgetCategoryClothing": "कपड़े", "rallySettingsManageAccounts": "खाते मैनेज करें", "rallyAccountDataCarSavings": "कार के लिए बचत", "rallySettingsTaxDocuments": "कर से जुड़े दस्तावेज़", "rallySettingsPasscodeAndTouchId": "पासकोड और टच आईडी", "rallySettingsNotifications": "सूचनाएं", "rallySettingsPersonalInformation": "निजी जानकारी", "rallySettingsPaperlessSettings": "बिना कागज़ की सुविधा के लिए सेटिंग", "rallySettingsFindAtms": "एटीएम ढूंढें", "rallySettingsHelp": "सहायता", "rallySettingsSignOut": "साइन आउट करें", "rallyAccountTotal": "कुल", "rallyBillsDue": "बकाया बिल", "rallyBudgetLeft": "बाकी बजट", "rallyAccounts": "खाते", "rallyBills": "बिल", "rallyBudgets": "बजट", "rallyAlerts": "चेतावनियां", "rallySeeAll": "सभी देखें", "rallyFinanceLeft": "बाकी", "rallyTitleOverview": "खास जानकारी", "shrineProductShoulderRollsTee": "शोल्डर रोल्स टी-शर्ट", "shrineNextButtonCaption": "आगे बढ़ें", "rallyTitleBudgets": "बजट", "rallyTitleSettings": "सेटिंग", "rallyLoginLoginToRally": "Rally में लॉग इन करें", "rallyLoginNoAccount": "कोई खाता नहीं है?", "rallyLoginSignUp": "साइन अप करें", "rallyLoginUsername": "उपयोगकर्ता नाम", "rallyLoginPassword": "पासवर्ड", "rallyLoginLabelLogin": "लॉग इन करें", "rallyLoginRememberMe": "मेरी दी हुई जानकारी याद रखें", "rallyLoginButtonLogin": "लॉग इन करें", "rallyAlertsMessageHeadsUpShopping": "ध्यान दें, आपने इस महीने के खरीदारी बजट का {percent} इस्तेमाल कर लिया गया है.", "rallyAlertsMessageSpentOnRestaurants": "इस हफ़्ते रेस्टोरेंट में आपने {amount} खर्च किए.", "rallyAlertsMessageATMFees": "इस महीने आपने {amount} का एटीएम शुल्क दिया है", "rallyAlertsMessageCheckingAccount": "बहुत बढ़िया! आपके चेकिंग खाते की रकम पिछले महीने की तुलना में {percent} ज़्यादा है.", "shrineMenuCaption": "मेन्यू", "shrineCategoryNameAll": "सभी", "shrineCategoryNameAccessories": "एक्सेसरी", "shrineCategoryNameClothing": "कपड़े", "shrineCategoryNameHome": "होम पेज", "shrineLoginUsernameLabel": "उपयोगकर्ता नाम", "shrineLoginPasswordLabel": "पासवर्ड", "shrineCancelButtonCaption": "अभी नहीं", "shrineCartTaxCaption": "टैक्स:", "shrineCartPageCaption": "कार्ट", "shrineProductQuantity": "मात्रा: {quantity}", "shrineProductPrice": "x {price}", "shrineCartItemCount": "{quantity,plural,=0{कोई आइटम नहीं है}=1{1 आइटम}other{{quantity} आइटम}}", "shrineCartClearButtonCaption": "कार्ट में से आइटम हटाएं", "shrineCartTotalCaption": "कुल", "shrineCartSubtotalCaption": "कुल कीमत:", "shrineCartShippingCaption": "शिपिंग:", "shrineProductGreySlouchTank": "स्लेटी रंग का स्लाउच टैंक", "shrineProductStellaSunglasses": "Stella ब्रैंड के चश्मे", "shrineProductWhitePinstripeShirt": "सफ़ेद रंग की पिन्स्ट्राइप शर्ट", "demoTextFieldWhereCanWeReachYou": "हम आपसे किस नंबर पर संपर्क कर सकते हैं?", "settingsTextDirectionLTR": "बाएं से दाएं", "settingsTextScalingLarge": "बड़ा", "demoBottomSheetHeader": "हेडर", "demoBottomSheetItem": "आइटम {value}", "demoBottomTextFieldsTitle": "टेक्स्ट फ़ील्ड", "demoTextFieldTitle": "टेक्स्ट फ़ील्ड", "demoTextFieldSubtitle": "बदलाव किए जा सकने वाले टेक्स्ट और संख्याओं के लिए एक पंक्ति", "demoTextFieldDescription": "टेक्स्ट फ़ील्ड, उपयोगकर्ताओं को यूज़र इंटरफ़ेस (यूआई) में टेक्स्ट डालने की सुविधा देता है. ये फ़ॉर्म या डायलॉग की तरह दिखाई देते हैं.", "demoTextFieldShowPasswordLabel": "पासवर्ड दिखाएं", "demoTextFieldHidePasswordLabel": "पासवर्ड छिपाएं", "demoTextFieldFormErrors": "कृपया सबमिट करने से पहले लाल रंग में दिखाई गई गड़बड़ियों को ठीक करें.", "demoTextFieldNameRequired": "नाम डालना ज़रूरी है.", "demoTextFieldOnlyAlphabeticalChars": "कृपया वर्णमाला वाले वर्ण ही डालें.", "demoTextFieldEnterUSPhoneNumber": "(###) ###-#### - कृपया यूएस का फ़ोन नंबर डालें.", "demoTextFieldEnterPassword": "कृपया पासवर्ड डालें.", "demoTextFieldPasswordsDoNotMatch": "पासवर्ड आपके पहले दिए गए पासवर्ड से अलग है", "demoTextFieldWhatDoPeopleCallYou": "लोग आपको किस नाम से बुलाते हैं?", "demoTextFieldNameField": "नाम*", "demoBottomSheetButtonText": "बॉटम शीट दिखाएं", "demoTextFieldPhoneNumber": "फ़ोन नंबर*", "demoBottomSheetTitle": "बॉटम शीट", "demoTextFieldEmail": "ईमेल", "demoTextFieldTellUsAboutYourself": "हमें अपने बारे में कुछ बताएं (जैसे कि आप क्या करते हैं या आपके क्या शौक हैं)", "demoTextFieldKeepItShort": "इसे संक्षिप्त रखें, यह सिर्फ़ डेमो के लिए है.", "starterAppGenericButton": "बटन", "demoTextFieldLifeStory": "जीवनी", "demoTextFieldSalary": "वेतन", "demoTextFieldUSD": "अमेरिकी डॉलर", "demoTextFieldNoMoreThan": "आठ से ज़्यादा वर्ण नहीं होने चाहिए.", "demoTextFieldPassword": "पासवर्ड*", "demoTextFieldRetypePassword": "फिर से पासवर्ड टाइप करें*", "demoTextFieldSubmit": "सबमिट करें", "demoBottomNavigationSubtitle": "क्रॉस-फ़ेडिंग व्यू के साथ बॉटम नेविगेशन", "demoBottomSheetAddLabel": "जोड़ें", "demoBottomSheetModalDescription": "मॉडल बॉटम शीट, किसी मेन्यू या डायलॉग के एक विकल्प के तौर पर इस्तेमाल की जाती है. साथ ही, इसकी वजह से उपयोगकर्ता को बाकी दूसरे ऐप्लिकेशन से इंटरैक्ट करने की ज़रूरत नहीं हाेती.", "demoBottomSheetModalTitle": "मॉडल बॉटम शीट", "demoBottomSheetPersistentDescription": "हमेशा दिखने वाली बॉटम शीट, ऐप्लिकेशन की मुख्य सामग्री से जुड़ी दूसरी जानकारी दिखाती है. हमेशा दिखने वाली बॉटम शीट, स्क्रीन पर तब भी दिखाई देती है, जब उपयोगकर्ता ऐप्लिकेशन में दूसरी चीज़ें देख रहा होता है.", "demoBottomSheetPersistentTitle": "हमेशा दिखने वाली बॉटम शीट", "demoBottomSheetSubtitle": "हमेशा दिखने वाली और मॉडल बॉटम शीट", "demoTextFieldNameHasPhoneNumber": "{name} का फ़ोन नंबर {phoneNumber} है", "buttonText": "बटन", "demoTypographyDescription": "'मटीरियल डिज़ाइन' में टाइपाेग्राफ़ी के कई तरह के स्टाइल की जानकारी हाेती है.", "demoTypographySubtitle": "पहले से बताए गए सभी टेक्स्ट स्टाइल", "demoTypographyTitle": "टाइपाेग्राफ़ी", "demoFullscreenDialogDescription": "फ़ुल स्क्रीन डायलॉग से पता चलता है कि आने वाला पेज फ़ुल स्क्रीन मॉडल डायलॉग है या नहीं", "demoFlatButtonDescription": "सादे बटन को दबाने पर वह फैली हुई स्याही जैसा दिखता है, लेकिन वह ऊपर की ओर उठता नहीं दिखता. टूलबार, डायलॉग, और पैडिंग (जगह) में इनलाइन के साथ सादे बटन का इस्तेमाल करें", "demoBottomNavigationDescription": "बॉटम नेविगेशन बार, ऐप्लिकेशन की तीन से पांच सुविधाओं के लिए स्क्रीन के निचले हिस्से पर शॉर्टकट दिखाता है. हर सुविधा को एक आइकॉन से दिखाया जाता है. इसके साथ टेक्स्ट लेबल भी हो सकता है. बॉटम नेविगेशन आइकॉन पर टैप करने से, उपयोगकर्ता उस आइकॉन की टॉप-लेवल नेविगेशन सुविधा पर पहुंच जाता है.", "demoBottomNavigationSelectedLabel": "चुना गया लेबल", "demoBottomNavigationPersistentLabels": "हमेशा दिखने वाले लेबल", "starterAppDrawerItem": "आइटम {value}", "demoTextFieldRequiredField": "* बताता है कि इस फ़ील्ड को भरना ज़रूरी है", "demoBottomNavigationTitle": "बॉटम नेविगेशन", "settingsLightTheme": "हल्के रंग की थीम", "settingsTheme": "थीम", "settingsPlatformIOS": "iOS", "settingsPlatformAndroid": "Android", "settingsTextDirectionRTL": "दाएं से बाएं", "settingsTextScalingHuge": "बहुत बड़ा", "cupertinoButton": "बटन", "settingsTextScalingNormal": "सामान्य", "settingsTextScalingSmall": "छोटा", "settingsSystemDefault": "सिस्टम", "settingsTitle": "सेटिंग", "rallyDescription": "निजी तौर पर पैसाें से जुड़ी सुविधाएं देने वाला ऐप्लिकेशन", "aboutDialogDescription": "इस ऐप्लिकेशन का सोर्स कोड देखने के लिए, कृपया {repoLink} पर जाएं.", "bottomNavigationCommentsTab": "टिप्पणियां", "starterAppGenericBody": "मुख्य भाग", "starterAppGenericHeadline": "टाइटल", "starterAppGenericSubtitle": "सबटाइटल", "starterAppGenericTitle": "टाइटल", "starterAppTooltipSearch": "Search", "starterAppTooltipShare": "शेयर करें", "starterAppTooltipFavorite": "पसंदीदा", "starterAppTooltipAdd": "जोड़ें", "bottomNavigationCalendarTab": "Calendar", "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": "एपीआई दस्तावेज़", "demoFullscreenTooltip": "फ़ुल स्क्रीन", "settingsTextScaling": "टेक्स्ट स्केलिंग", "settingsTextDirection": "टेक्स्ट की दिशा", "settingsLocale": "स्थान-भाषा", "settingsPlatformMechanics": "प्लैटफ़ॉर्म मैकेनिक", "settingsDarkTheme": "गहरे रंग की थीम", "settingsSlowMotion": "स्लो मोशन", "settingsAbout": "Flutter Gallery के बारे में जानकारी", "settingsFeedback": "सुझाव भेजें", "settingsAttribution": "लंदन के TOASTER ने डिज़ाइन किया है", "demoButtonTitle": "बटन", "demoButtonSubtitle": "टेक्स्ट, उभरे हुए, आउटलाइन वाले, और ज़्यादा बटन", "demoFlatButtonTitle": "सादा बटन", "demoRaisedButtonDescription": "उभरे हुए बटन सादे लेआउट को बेहतर बनाने में मदद करते हैं. ये भरी हुई और बाएं से दाएं खाली जगहों पर किए जाने वाले कामों को बेहतर तरीके से दिखाते हैं.", "demoRaisedButtonTitle": "उभरा हुआ दिखाई देने वाला बटन", "demoOutlineButtonTitle": "आउटलाइन बटन", "demoOutlineButtonDescription": "आउटलाइन बटन दबाने पर धुंधले हो जाते हैं और ऊपर की ओर उठ जाते हैं. इन्हें विकल्प के तौर पर, दूसरी कार्रवाई के रुप में अक्सर उभरे हुए बटन के साथ जोड़ा जाता है.", "demoToggleButtonTitle": "टॉगल बटन", "colorsTeal": "नीला-हरा", "demoFloatingButtonTitle": "फ़्लोट करने वाला कार्रवाई बटन", "demoFloatingButtonDescription": "फ़्लोटिंग कार्रवाई बटन, गोल आकार वाला वह आइकॉन बटन होता है जो सामग्री के ऊपर माउस घुमाने पर ऐप्लिकेशन में प्राथमिक कार्रवाई करता है.", "demoDialogTitle": "डायलॉग", "demoDialogSubtitle": "सादा, सूचनाएं, और फ़ुल स्क्रीन", "demoAlertDialogTitle": "सूचना", "demoAlertDialogDescription": "सूचना वाला डायलॉग उपयोगकर्ताओं को ऐसी स्थितियों के बारे में जानकारी देता है जिनके लिए अनुमति की ज़रूरत होती है. सूचना वाले डायलॉग में दूसरा टाइटल और कार्रवाइयों की दूसरी सूची होती है.", "demoAlertTitleDialogTitle": "टाइटल की सुविधा वाली सूचना", "demoSimpleDialogTitle": "सरल", "demoSimpleDialogDescription": "एक सादा डायलॉग, उपयोगकर्ता को कई विकल्पों में से किसी एक को चुनने की सुविधा देता है. एक सादे डायलॉग में दूसरा टाइटल होता है जो दिए गए विकल्पों के ऊपर होता है.", "demoFullscreenDialogTitle": "फ़ुल-स्क्रीन", "demoCupertinoButtonsTitle": "बटन", "demoCupertinoButtonsSubtitle": "iOS की शैली वाला बटन", "demoCupertinoButtonsDescription": "iOS की शैली वाला बटन. इसमें टेक्स्ट और/या आइकॉन छूने पर फ़ेड होना शामिल है. इसमें विकल्प के तौर पर एक बैकग्राउंड की सुविधा हो सकती है.", "demoCupertinoAlertsTitle": "चेतावनियां", "demoCupertinoAlertsSubtitle": "iOS की शैली वाले सूचना डायलॉग", "demoCupertinoAlertTitle": "सूचना", "demoCupertinoAlertDescription": "सूचना वाला डायलॉग उपयोगकर्ताओं को ऐसी स्थितियों के बारे में जानकारी देता है जिनके लिए अनुमति की ज़रूरत होती है. किसी सूचना वाले डायलॉग में दूसरा टाइटल, सामग्री, और कार्रवाइयों की दूसरी सूची होती है. इसमें टाइटल, सामग्री के ऊपर की तरफ़ होता है. इसके अलावा, सामग्री के नीचे कार्रवाइयां दी गई होती हैं.", "demoCupertinoAlertWithTitleTitle": "टाइटल की सुविधा वाली सूचना", "demoCupertinoAlertButtonsTitle": "बटन की सुविधा वाली सूचना", "demoCupertinoAlertButtonsOnlyTitle": "सिर्फ़ सूचना देने वाले बटन", "demoCupertinoActionSheetTitle": "कार्रवाई शीट", "demoCupertinoActionSheetDescription": "कार्रवाई शीट, सूचनाओं की एक खास शैली है जिसमें उपयोगकर्ता को मौजूदा संदर्भ से जुड़े दो या उससे ज़्यादा विकल्पों वाले सेट की सुविधा मिलती है. किसी कार्रवाई शीट में एक टाइटल, अन्य मैसेज, और कार्रवाइयों की सूची हो सकती है.", "demoColorsTitle": "रंग", "demoColorsSubtitle": "पहले से तय किए गए सभी रंग", "demoColorsDescription": "रंग और एक जैसे बने रहने वाले मिलते-जुलते रंगों की छोटी टेबल जो 'मटीरियल डिज़ाइन' के रंग पटल को दिखाती है.", "buttonTextEnabled": "ENABLED", "buttonTextDisabled": "DISABLED", "buttonTextCreate": "बनाएं", "dialogSelectedOption": "आपने चुना है: \"{value}\"", "dialogDiscardTitle": "ड्राफ़्ट खारिज करें?", "dialogLocationTitle": "क्या आप Google की जगह की जानकारी देने वाली सेवा का इस्तेमाल करना चाहते हैं?", "dialogLocationDescription": "Google को ऐप्लिकेशन की मदद से जगह का पता लगाने में मदद करने दें. इसका मतलब है कि भले ही कोई ऐप्लिकेशन न चल रहा हो फिर भी Google को जगह की जानकारी का अनजान डेटा भेजा जाएगा.", "dialogCancel": "रद्द करें", "dialogDiscard": "खारिज करें", "dialogDisagree": "असहमत", "dialogAgree": "सहमत", "dialogSetBackup": "बैकअप खाता सेट करें", "colorsBlueGrey": "नीला-स्लेटी", "dialogShow": "डायलॉग दिखाएं", "dialogFullscreenTitle": "फ़ुल-स्क्रीन वाला डायलॉग", "dialogFullscreenSave": "सेव करें", "dialogFullscreenDescription": "फ़ुल-स्क्रीन वाला डायलॉग डेमो", "cupertinoButtonEnabled": "Enabled", "cupertinoButtonDisabled": "Disabled", "cupertinoButtonWithBackground": "बैकग्राउंड के साथ", "cupertinoAlertCancel": "रद्द करें", "cupertinoAlertDiscard": "खारिज करें", "cupertinoAlertLocationTitle": "क्या आप ऐप्लिकेशन का इस्तेमाल करते समय \"Maps\" को अपनी जगह की जानकारी ऐक्सेस करने की अनुमति देना चाहते हैं?", "cupertinoAlertLocationDescription": "मैप पर आपकी मौजूदा जगह की जानकारी दिखाई जाएगी. इसका इस्तेमाल रास्ते दिखाने, आस-पास खोज के नतीजे दिखाने, और किसी जगह जाने में लगने वाले कुल समय के लिए किया जाएगा.", "cupertinoAlertAllow": "अनुमति दें", "cupertinoAlertDontAllow": "अनुमति न दें", "cupertinoAlertFavoriteDessert": "पसंदीदा मिठाई चुनें", "cupertinoAlertDessertDescription": "कृपया नीचे दी गई सूची से अपनी पसंदीदा मिठाई चुनें. आपके चुने गए विकल्प का इस्तेमाल, आपके इलाके में मौजूद खाने की जगहों के सुझावों को पसंद के मुताबिक बनाने के लिए किया जाएगा.", "cupertinoAlertCheesecake": "चीज़केक", "cupertinoAlertTiramisu": "तीरामीसु", "cupertinoAlertApplePie": "एपल पाई", "cupertinoAlertChocolateBrownie": "चॉकलेट ब्राउनी", "cupertinoShowAlert": "सूचना दिखाएं", "colorsRed": "लाल", "colorsPink": "गुलाबी", "colorsPurple": "बैंगनी", "colorsDeepPurple": "गहरा बैंगनी", "colorsIndigo": "गहरा नीला", "colorsBlue": "नीला", "colorsLightBlue": "हल्का नीला", "colorsCyan": "सियान", "dialogAddAccount": "खाता जोड़ें", "Gallery": "गैलरी", "Categories": "श्रेणियां", "SHRINE": "तीर्थस्थल", "Basic shopping app": "खरीदारी करने के बुनियादी ऐप्लिकेशन", "RALLY": "रैली", "CRANE": "क्रेन", "Travel app": "यात्रा के लिए ऐप्लिकेशन", "MATERIAL": "मैटिरियल", "CUPERTINO": "कूपर्टीनो", "REFERENCE STYLES & MEDIA": "स्टाइल और मीडिया के बारे में जानकारी" }
gallery/lib/l10n/intl_hi.arb/0
{ "file_path": "gallery/lib/l10n/intl_hi.arb", "repo_id": "gallery", "token_count": 50316 }
812
{ "loading": "Notiek ielāde…", "deselect": "Noņemt atlasi", "select": "Atlasīt", "selectable": "Var atlasīt (nospiest un turēt)", "selected": "Atlasīts", "demo": "Demonstrācija", "bottomAppBar": "Apakšējā lietotņu josla", "notSelected": "Nav atlasīts", "demoCupertinoSearchTextFieldTitle": "Meklēšanas teksta lauks", "demoCupertinoPicker": "Atlasītājs", "demoCupertinoSearchTextFieldSubtitle": "iOS stila meklēšanas teksta lauks", "demoCupertinoSearchTextFieldDescription": "Meklēšanas teksta lauks, kurā lietotājs var ievadīt tekstu un kurā var tikt piedāvāti un filtrēti ieteikumi.", "demoCupertinoSearchTextFieldPlaceholder": "Ievadiet tekstu", "demoCupertinoScrollbarTitle": "Ritjosla", "demoCupertinoScrollbarSubtitle": "iOS stila ritjosla", "demoCupertinoScrollbarDescription": "Ritjosla, kas ietver konkrēto pakārtoto vienumu.", "demoTwoPaneItem": "Vienums {value}", "demoTwoPaneList": "Saraksts", "demoTwoPaneFoldableLabel": "Salokāma ierīce", "demoTwoPaneSmallScreenLabel": "Ierīce ar mazu ekrānu", "demoTwoPaneSmallScreenDescription": "Demonstrācija, kā TwoPane darbojas ierīcē ar mazu ekrānu.", "demoTwoPaneTabletLabel": "Planšetdatori/galddatori", "demoTwoPaneTabletDescription": "Demonstrācija, kā TwoPane darbojas ierīcē ar lielāku ekrānu, piemēram, planšetdatorā vai galddatorā.", "demoTwoPaneTitle": "TwoPane", "demoTwoPaneSubtitle": "Adaptīvi izkārtojumi salokāmās ierīcēs, kā arī ierīcēs ar lieliem un maziem ekrāniem", "splashSelectDemo": "Atlasiet demonstrāciju", "demoTwoPaneFoldableDescription": "Demonstrācija, kā TwoPane darbojas salokāmā ierīcē.", "demoTwoPaneDetails": "Detalizēta informācija", "demoTwoPaneSelectItem": "Atlasiet vienumu", "demoTwoPaneItemDetails": "Detalizēta informācija par vienumu {value}", "demoCupertinoContextMenuActionText": "Pieskarieties Flutter logotipam un turiet to, lai skatītu kontekstizvēlni.", "demoCupertinoContextMenuDescription": "iOS stila pilnekrāna kontekstizvēlne, kas tiek parādīta, nospiežot un turot kādu elementu.", "demoAppBarTitle": "Lietotņu josla", "demoAppBarDescription": "Lietotņu joslā tiek rādīts saturs un darbības, kas saistītas ar pašreizējo ekrānu. Tā tiek izmantota zīmoliem, ekrānu virsrakstiem, navigācijai un darbībām.", "demoDividerTitle": "Atdalītājs", "demoDividerSubtitle": "Atdalītājs ir šaura līnija, ar kuru saturs tiek grupēts sarakstos un izkārtojumos.", "demoDividerDescription": "Atdalītājus var izmantot sarakstos, atvilktnēs un citur, lai nodalītu saturu.", "demoVerticalDividerTitle": "Vertikāls atdalītājs", "demoCupertinoContextMenuTitle": "Kontekstizvēlne", "demoCupertinoContextMenuSubtitle": "iOS stila kontekstizvēlne.", "demoAppBarSubtitle": "Tiek rādīta informācija un darbības, kas saistītas ar pašreizējo ekrānu.", "demoCupertinoContextMenuActionOne": "Pirmā darbība", "demoCupertinoContextMenuActionTwo": "Otrā darbība", "demoDateRangePickerDescription": "Tiek rādīts dialoglodziņš ar materiāla dizaina datumu diapazona atlasītāju.", "demoDateRangePickerTitle": "Datumu diapazona atlasītājs", "demoNavigationDrawerUserName": "Lietotāja vārds", "demoNavigationDrawerUserEmail": "[email protected]", "demoNavigationDrawerText": "Lai skatītu atvilktni, velciet no malas vai pieskarieties augšējā kreisajā stūrī esošajai ikonai", "demoNavigationRailTitle": "Navigācijas josla", "demoNavigationRailSubtitle": "Navigācijas joslas rādīšana lietotnē", "demoNavigationRailDescription": "Šo materiāla dizaina logrīku ir paredzēts rādīt lietotnes kreisajā vai labajā malā, lai varētu pāriet starp nedaudziem skatiem — parasti no trim līdz pieciem.", "demoNavigationRailFirst": "Pirmais galamērķis", "demoNavigationDrawerTitle": "Navigācijas atvilktne", "demoNavigationRailThird": "Trešais galamērķis", "replyStarredLabel": "Ar zvaigznīti", "demoTextButtonDescription": "Teksta poga piespiežot attēlo tintes traipu, taču nepaceļas. Teksta pogas izmantojamas rīkjoslās, dialoglodziņos un iekļautas ar iekšējo atkāpi.", "demoElevatedButtonTitle": "Paaugstināta poga", "demoElevatedButtonDescription": "Paaugstinātas pogas piešķir plakaniem izkārtojumiem apjomu. Tās uzsver funkcijas pieblīvētās vai platās vietās.", "demoOutlinedButtonTitle": "Konturēta poga", "demoOutlinedButtonDescription": "Konturētas pogas nospiežot kļūst necaurspīdīgas un paceļas. Tās bieži tiek lietotas kopā ar paaugstinātām pogām, lai norādītu alternatīvu, sekundāru darbību.", "demoContainerTransformDemoInstructions": "Kartītes, saraksti un PDP", "demoNavigationDrawerSubtitle": "Atvilktnes rādīšana lietotņu joslā", "replyDescription": "Efektīva, koncentrēta e-pasta lietotne", "demoNavigationDrawerDescription": "Šis materiāla dizaina panelis horizontāli ieslīd no ekrāna malas, lai parādītu lietojumprogrammas navigācijas saites.", "replyDraftsLabel": "Melnraksti", "demoNavigationDrawerToPageOne": "Pirmais vienums", "replyInboxLabel": "Iesūtne", "demoSharedXAxisDemoInstructions": "Pogas “Nākamā” un “Atpakaļ”", "replySpamLabel": "Mēstules", "replyTrashLabel": "Atkritne", "replySentLabel": "Nosūtītie", "demoNavigationRailSecond": "Otrais galamērķis", "demoNavigationDrawerToPageTwo": "Otrais vienums", "demoFadeScaleDemoInstructions": "Modālais lodziņš un PDP", "demoFadeThroughDemoInstructions": "Apakšējās navigācijas vadīklas", "demoSharedZAxisDemoInstructions": "Iestatījumu ikonas poga", "demoSharedYAxisDemoInstructions": "Kārtot pēc tā, cik nesen atskaņots", "demoTextButtonTitle": "Teksta poga", "demoSharedZAxisBeefSandwichRecipeTitle": "Sviestmaize ar liellopu gaļu", "demoSharedZAxisDessertRecipeDescription": "Deserta recepte", "demoSharedYAxisAlbumTileSubtitle": "Izpildītājs", "demoSharedYAxisAlbumTileTitle": "Albums", "demoSharedYAxisRecentSortTitle": "Nesen atskaņots", "demoSharedYAxisAlphabeticalSortTitle": "A–Z", "demoSharedYAxisAlbumCount": "268 albumi", "demoSharedYAxisTitle": "Kopīga y ass", "demoSharedXAxisCreateAccountButtonText": "IZVEIDOT KONTU", "demoFadeScaleAlertDialogDiscardButton": "ATMEST", "demoSharedXAxisSignInTextFieldLabel": "E-pasta adrese vai tālruņa numurs", "demoSharedXAxisSignInSubtitleText": "Pierakstīties kontā", "demoSharedXAxisSignInWelcomeText": "Labdien, David Park!", "demoSharedXAxisIndividualCourseSubtitle": "Tiek rādīts atsevišķi", "demoSharedXAxisBundledCourseSubtitle": "Iekļauts komplektā", "demoFadeThroughAlbumsDestination": "Albumi", "demoSharedXAxisDesignCourseTitle": "Dizains", "demoSharedXAxisIllustrationCourseTitle": "Ilustrācija", "demoSharedXAxisBusinessCourseTitle": "Uzņēmējdarbība", "demoSharedXAxisArtsAndCraftsCourseTitle": "Māksla un amatniecība", "demoMotionPlaceholderSubtitle": "Sekundārais teksts", "demoFadeScaleAlertDialogCancelButton": "ATCELT", "demoFadeScaleAlertDialogHeader": "Brīdinājuma dialoglodziņš", "demoFadeScaleHideFabButton": "PASLĒPT PELDOŠO DARBĪBAS POGU", "demoFadeScaleShowFabButton": "RĀDĪT PELDOŠO DARBĪBAS POGU", "demoFadeScaleShowAlertDialogButton": "RĀDĪT MODĀLO LODZIŅU", "demoFadeScaleDescription": "Pakāpeniskas parādīšanās/izzušanas formu izmanto lietotāja saskarnes elementiem, kas parādās vai pazūd ekrāna robežās, piemēram, dialoglodziņam, kas pakāpeniski parādās ekrāna vidū.", "demoFadeScaleTitle": "Pakāpeniska parādīšanās/izzušana", "demoFadeThroughTextPlaceholder": "123 fotoattēli", "demoFadeThroughSearchDestination": "Meklēt", "demoFadeThroughPhotosDestination": "Fotoattēli", "demoSharedXAxisCoursePageSubtitle": "Kategorijas, kas iekļautas komplektos, plūsmā tiek rādītas pa grupām. To jebkurā laikā varēsiet mainīt.", "demoFadeThroughDescription": "Pakāpeniskas izzušanas un parādīšanās formu izmanto pārejām starp lietotāja saskarnes elementiem, kas nav cieši savstarpēji saistīti.", "demoFadeThroughTitle": "Pakāpeniska izzušana un parādīšanās", "demoSharedZAxisHelpSettingLabel": "Palīdzība", "demoMotionSubtitle": "Visas iepriekš definētās pārejas formas", "demoSharedZAxisNotificationSettingLabel": "Paziņojumi", "demoSharedZAxisProfileSettingLabel": "Profils", "demoSharedZAxisSavedRecipesListTitle": "Saglabātās receptes", "demoSharedZAxisBeefSandwichRecipeDescription": "Liellopu gaļas sviestmaizes recepte", "demoSharedZAxisCrabPlateRecipeDescription": "Krabju plates recepte", "demoSharedXAxisCoursePageTitle": "Kursu efektivitātes uzlabošana", "demoSharedZAxisCrabPlateRecipeTitle": "Krabji", "demoSharedZAxisShrimpPlateRecipeDescription": "Garneļu plates recepte", "demoSharedZAxisShrimpPlateRecipeTitle": "Garneles", "demoContainerTransformTypeFadeThrough": "PAKĀPENISKA IZZUŠANA UN PARĀDĪŠANĀS", "demoSharedZAxisDessertRecipeTitle": "Deserts", "demoSharedZAxisSandwichRecipeDescription": "Sviestmaizes recepte", "demoSharedZAxisSandwichRecipeTitle": "Sviestmaize", "demoSharedZAxisBurgerRecipeDescription": "Burgera recepte", "demoSharedZAxisBurgerRecipeTitle": "Burgers", "demoSharedZAxisSettingsPageTitle": "Iestatījumi", "demoSharedZAxisTitle": "Kopīga z ass", "demoSharedZAxisPrivacySettingLabel": "Konfidencialitāte", "demoMotionTitle": "Kustība", "demoContainerTransformTitle": "Konteinera pārveidošana", "demoContainerTransformDescription": "Konteinera pārveidošana ir forma, kas paredzēta pārejai starp lietotāja saskarnes elementiem, kuros ir ietverti konteineri. Izmantojot šo pārejas formu, tiek izveidota redzama saikne starp diviem lietotāja saskarnes elementiem.", "demoContainerTransformModalBottomSheetTitle": "Pakāpeniskas parādīšanās/izzušanas režīms", "demoContainerTransformTypeFade": "PAKĀPENISKA PARĀDĪŠANĀS/IZZUŠANA", "demoSharedYAxisAlbumTileDurationUnit": "min", "demoMotionPlaceholderTitle": "Virsraksts", "demoSharedXAxisForgotEmailButtonText": "VAI AIZMIRSĀT E-PASTA ADRESI?", "demoMotionSmallPlaceholderSubtitle": "Sekundārais", "demoMotionDetailsPageTitle": "Detalizētās informācijas lapa", "demoMotionListTileTitle": "Saraksta vienums", "demoSharedAxisDescription": "Kopīgās ass formu izmanto pārejām starp lietotāja saskarnes elementiem, kas ir savstarpēji saistīti telpiskās vai navigācijas attiecībās. Šai pārejas formai tiek izmantota kopīga pārveidošana pa x, y vai z asi, lai uzsvērtu attiecības starp elementiem.", "demoSharedXAxisTitle": "Kopīga x ass", "demoSharedXAxisBackButtonText": "ATPAKAĻ", "demoSharedXAxisNextButtonText": "TĀLĀK", "demoSharedXAxisCulinaryCourseTitle": "Kulinārija", "githubRepo": "{repoName} GitHub krātuve", "fortnightlyMenuUS": "ASV ziņas", "fortnightlyMenuBusiness": "Uzņēmējdarbība", "fortnightlyMenuScience": "Zinātne", "fortnightlyMenuSports": "Sports", "fortnightlyMenuTravel": "Ceļošana", "fortnightlyMenuCulture": "Kultūra", "fortnightlyTrendingTechDesign": "TechDesign", "rallyBudgetDetailAmountLeft": "Atlikusī summa", "fortnightlyHeadlineArmy": "Zaļās armijas reforma no iekšpuses", "fortnightlyDescription": "Uz saturu orientēta ziņu lietotne", "rallyBillDetailAmountDue": "Maksājamā summa", "rallyBudgetDetailTotalCap": "Kopējais budžets", "rallyBudgetDetailAmountUsed": "Izmantotā summa", "fortnightlyTrendingHealthcareRevolution": "HealthcareRevolution", "fortnightlyMenuFrontPage": "Sākumlapa", "fortnightlyMenuWorld": "Pasaules ziņas", "rallyBillDetailAmountPaid": "Samaksātā summa", "fortnightlyMenuPolitics": "Politika", "fortnightlyHeadlineBees": "Saimniecībās trūkst bišu", "fortnightlyHeadlineGasoline": "Benzīna nākotne", "fortnightlyTrendingGreenArmy": "GreenArmy", "fortnightlyHeadlineFeminists": "Feministes kļūst par partizānēm", "fortnightlyHeadlineFabrics": "Dizaineri izmanto tehnoloģijas, lai radītu futūristiskus audumus", "fortnightlyHeadlineStocks": "Akciju vērtības stagnācijas dēļ daudzi vēlas izmantot valūtu", "fortnightlyTrendingReform": "Reforma", "fortnightlyMenuTech": "Tehnoloģijas", "fortnightlyHeadlineWar": "Kara dēļ sadalītās amerikāņu dzīves", "fortnightlyHeadlineHealthcare": "Kluss, bet iespaidīgs apvērsums veselības aprūpes jomā", "fortnightlyLatestUpdates": "Pēdējie jaunumi", "fortnightlyTrendingStocks": "Akcijas", "rallyBillDetailTotalAmount": "Kopsumma", "demoCupertinoPickerDateTime": "Datums un laiks", "signIn": "PIERAKSTĪTIES", "dataTableRowWithSugar": "{value} ar cukuru", "dataTableRowApplePie": "Ābolu pīrāgs", "dataTableRowDonut": "Virtulis", "dataTableRowHoneycomb": "Medus kāre", "dataTableRowLollipop": "Konfekte uz kociņa", "dataTableRowJellyBean": "Želejas pupiņa", "dataTableRowGingerbread": "Piparkūka", "dataTableRowCupcake": "Kēksiņš", "dataTableRowEclair": "Eklērs", "dataTableRowIceCreamSandwich": "Saldējuma sendvičs", "dataTableRowFrozenYogurt": "Saldēts jogurts", "dataTableColumnIron": "Dzelzs (%)", "dataTableColumnCalcium": "Kalcijs (%)", "dataTableColumnSodium": "Nātrijs (mg)", "demoTimePickerTitle": "Laika atlasītājs", "demo2dTransformationsResetTooltip": "Atiestatīt pārveidošanu", "dataTableColumnFat": "Tauki (g)", "dataTableColumnCalories": "Kalorijas", "dataTableColumnDessert": "Deserts (1 porcija)", "cardsDemoTravelDestinationLocation1": "Thandžāvūra, Tamilnāda", "demoTimePickerDescription": "Tiek rādīts dialoglodziņš, kurā ir materiāla dizaina laika atlasītājs.", "demoPickersShowPicker": "RĀDĪT ATLASĪTĀJU", "demoTabsScrollingTitle": "Ritināšana", "demoTabsNonScrollingTitle": "Bez ritināšanas", "craneHours": "{hours,plural,=1{1 h}zero{{hours} h}other{{hours} h}}", "craneMinutes": "{minutes,plural,=1{1 min}zero{{minutes} min}other{{minutes} min}}", "craneFlightDuration": "{hoursShortForm} {minutesShortForm}", "dataTableHeader": "Uzturs", "demoDatePickerTitle": "Datuma atlasītājs", "demoPickersSubtitle": "Datuma un laika atlasīšana", "demoPickersTitle": "Atlasītāji", "demo2dTransformationsEditTooltip": "Rediģēt elementu", "demoDataTableDescription": "Datu tabulās režģa formātā ir attēlota rindu un kolonnu informācija. Informācija šajās tabulās ir attēlota ērti pārmeklējamā veidā, lai lietotāji varētu meklēt tendences un gūt ieskatus.", "demo2dTransformationsDescription": "Pieskarieties, lai rediģētu elementus, un izmantojiet žestus, lai pārvietotos. Velciet, lai izmantotu pārvietošanu; savelciet pirkstus, lai izmantotu tālummaiņu; veiciet pagriešanu ar diviem pirkstiem. Nospiediet atiestatīšanas pogu, lai atgrieztos pie sākotnējā virziena.", "demo2dTransformationsSubtitle": "Pārvietošana, tālummaiņa, pagriešana", "demo2dTransformationsTitle": "2D pārveidošana", "demoCupertinoTextFieldPIN": "PIN", "demoCupertinoTextFieldDescription": "Teksta lauks, kurā lietotājs var ievadīt tekstu, izmantojot aparatūras tastatūru vai ekrāna tastatūru.", "demoCupertinoTextFieldSubtitle": "iOS stila teksta lauki", "demoCupertinoTextFieldTitle": "Teksta lauki", "demoDatePickerDescription": "Tiek rādīts dialoglodziņš ar materiāla dizaina datuma atlasītāju.", "demoCupertinoPickerTime": "Laiks", "demoCupertinoPickerDate": "Datums", "demoCupertinoPickerTimer": "Taimeris", "demoCupertinoPickerDescription": "iOS stila atlasītāja logrīks, ko var izmantot virkņu, kā arī datuma un/vai laika atlasīšanai.", "demoCupertinoPickerSubtitle": "iOS stila atlasītāji", "demoCupertinoPickerTitle": "Atlasītāji", "dataTableRowWithHoney": "{value} ar medu", "cardsDemoTravelDestinationCity2": "Četinada", "bannerDemoResetText": "Atiestatīt joslu", "bannerDemoMultipleText": "Vairākas darbības", "bannerDemoLeadingText": "Sākuma ikona", "dismiss": "NERĀDĪT", "cardsDemoTappable": "Var pieskarties", "cardsDemoSelectable": "Var atlasīt (nospiest un turēt)", "cardsDemoExplore": "Izpētīt", "cardsDemoExploreSemantics": "Izpētīt: {destinationName}", "cardsDemoShareSemantics": "Kopīgot: {destinationName}", "cardsDemoTravelDestinationTitle1": "10 populārākās pilsētas, ko apmeklēt Tamilnādā", "cardsDemoTravelDestinationDescription1": "Nr. 10", "cardsDemoTravelDestinationCity1": "Thandžāvūra", "dataTableColumnProtein": "Olbaltumvielas (g)", "cardsDemoTravelDestinationTitle2": "Dienvidindijas amatnieki", "cardsDemoTravelDestinationDescription2": "Zīda tinēji", "bannerDemoText": "Jūsu parole tika atjaunināta citā jūsu ierīcē. Lūdzu, pierakstieties vēlreiz.", "cardsDemoTravelDestinationLocation2": "Sivaganga, Tamilnāda", "cardsDemoTravelDestinationTitle3": "Brihadisvaras templis", "cardsDemoTravelDestinationDescription3": "Tempļi", "demoBannerTitle": "Josla", "demoBannerSubtitle": "Joslas rādīšana sarakstā", "demoBannerDescription": "Joslā tiek rādīta īsa un svarīga informācija, kā arī sniegti norādījumi lietotājam (vai iespēja paslēpt joslu). Lai joslu varētu paslēpt, ir nepieciešama lietotāja darbība.", "demoCardTitle": "Kartītes", "demoCardSubtitle": "Pamata kartītes ar noapaļotiem stūriem", "demoCardDescription": "Kartīte ir lapas materiāls, kas tiek izmantots saistītas informācijas attēlošanai, piemēram, albumam, ģeogrāfiskajai atrašanās vietai, maltītei, kontaktinformācijai un citam saturam.", "demoDataTableTitle": "Datu tabulas", "demoDataTableSubtitle": "Informācijas rindas un kolonnas", "dataTableColumnCarbs": "Ogļhidrāti (g)", "placeTanjore": "Thandžāvūra", "demoGridListsTitle": "Režģa saraksti", "placeFlowerMarket": "Ziedu tirgus", "placeBronzeWorks": "Bronzas lietuve", "placeMarket": "Tirgus", "placeThanjavurTemple": "Thandžāvūras templis", "placeSaltFarm": "Sāls ieguves saimniecība", "placeScooters": "Motorolleri", "placeSilkMaker": "Zīda ražotne", "placeLunchPrep": "Pusdienu gatavošana", "placeBeach": "Pludmale", "placeFisherman": "Zvejnieks", "demoMenuSelected": "Atlasītā vērtība: {value}", "demoMenuRemove": "Noņemt", "demoMenuGetLink": "Iegūt saiti", "demoMenuShare": "Kopīgot", "demoBottomAppBarSubtitle": "Apakšdaļā tiek rādītas navigācijas iespējas un pieejamās darbības", "demoMenuAnItemWithASectionedMenu": "Vienums ar izvēlni, kurai ir sadaļas", "demoMenuADisabledMenuItem": "Atspējots izvēlnes vienums", "demoLinearProgressIndicatorTitle": "Lineārs norises indikators", "demoMenuContextMenuItemOne": "Kontekstizvēlnes pirmais vienums", "demoMenuAnItemWithASimpleMenu": "Vienums ar vienkāršu izvēlni", "demoCustomSlidersTitle": "Pielāgoti slīdņi", "demoMenuAnItemWithAChecklistMenu": "Vienums ar kontrolsaraksta izvēlni", "demoCupertinoActivityIndicatorTitle": "Aktivitātes indikators", "demoCupertinoActivityIndicatorSubtitle": "iOS stila aktivitātes indikators", "demoCupertinoActivityIndicatorDescription": "iOS stila aktivitātes indikators, kas griežas pulksteņrādītāja kustības virzienā.", "demoCupertinoNavigationBarTitle": "Navigācijas josla", "demoCupertinoNavigationBarSubtitle": "iOS stila navigācijas josla", "demoCupertinoNavigationBarDescription": "iOS stila navigācijas josla. Navigācijas josla ir rīkjosla, kas ietver vismaz lapas nosaukumu (rīkjoslas vidū).", "demoCupertinoPullToRefreshTitle": "Vilkšana, lai atsvaidzinātu", "demoCupertinoPullToRefreshSubtitle": "iOS stila vadīkla “Vilkt, lai atsvaidzinātu”", "demoCupertinoPullToRefreshDescription": "Logrīks iOS stila satura vadīklas “Vilkt, lai atsvaidzinātu” ievietošanai.", "demoProgressIndicatorTitle": "Norises indikatori", "demoProgressIndicatorSubtitle": "Lineārs, cirkulārs, nenoteikts", "demoCircularProgressIndicatorTitle": "Cirkulārs norises indikators", "demoCircularProgressIndicatorDescription": "Cirkulārs materiāla dizaina norises indikators, kas griežas, lai norādītu, ka lietojumprogramma ir aizņemta.", "demoMenuFour": "Četri", "demoLinearProgressIndicatorDescription": "Lineārs materiāla dizaina norises indikators, zināms arī kā norises josla.", "demoTooltipTitle": "Rīka padomi", "demoTooltipSubtitle": "Īss ziņojums, kas tiek parādīts, kad lietotājs nospiež elementu un to tur vai virza kursoru virs elementa.", "demoTooltipDescription": "Rīka padomi ietver teksta iezīmes, kas paskaidro pogas vai citas lietotāja saskarnes darbības funkciju. Rīka padomi attēlo informatīvu tekstu, kad lietotāji virs kāda elementa virza kursoru, izceļ elementu vai to nospiež un tur.", "demoTooltipInstructions": "Lai parādītu rīka padomu, nospiediet elementu un turiet to vai virziet virs tā kursoru.", "placeChennai": "Čennai", "demoMenuChecked": "Pārbaudītā vērtība: {value}", "placeChettinad": "Četinada", "demoMenuPreview": "Priekšskatīt", "demoBottomAppBarTitle": "Apakšējā lietotņu josla", "demoBottomAppBarDescription": "Apakšējās lietotņu joslas ļauj piekļūt apakšdaļā esošajai navigācijas atvilktnei un ne vairāk kā četrām darbībām, tostarp peldošajai darbības pogai.", "bottomAppBarNotch": "Izgriezums", "bottomAppBarPosition": "Peldošās darbības pogas pozīcija", "bottomAppBarPositionDockedEnd": "Dokota — beigās", "bottomAppBarPositionDockedCenter": "Dokota — centrā", "bottomAppBarPositionFloatingEnd": "Peldoša — beigās", "bottomAppBarPositionFloatingCenter": "Peldoša — centrā", "demoSlidersEditableNumericalValue": "Rediģējama skaitliskā vērtība", "demoGridListsSubtitle": "Rindu un kolonnu izkārtojums", "demoGridListsDescription": "Režģa saraksti ir piemērotāki homogēnu datu (parasti — attēlu) parādīšanai. Režģa saraksta vienumus dēvē par elementiem.", "demoGridListsImageOnlyTitle": "Tikai attēli", "demoGridListsHeaderTitle": "Ar galveni", "demoGridListsFooterTitle": "Ar kājeni", "demoSlidersTitle": "Slīdņi", "demoSlidersSubtitle": "Logrīki vērtības atlasīšanai velkot", "demoSlidersDescription": "Slīdņi atspoguļo vērtību diapazonu joslā, kurā lietotāji var atlasīt atsevišķu vērtību. Slīdņi ir lieliski piemēroti dažādu iestatījumu, piemēram, skaļuma vai spilgtuma, pielāgošanai vai attēlu filtru lietošanai.", "demoRangeSlidersTitle": "Diapazona slīdņi", "demoRangeSlidersDescription": "Slīdņi atspoguļo vērtību diapazonu joslā. Abos slīdņu joslas galos var būt ikonas, kas atspoguļo vērtību diapazonu. Slīdņi ir lieliski piemēroti dažādu iestatījumu, piemēram, skaļuma vai spilgtuma, pielāgošanai vai attēlu filtru lietošanai.", "demoMenuAnItemWithAContextMenuButton": "Vienums ar kontekstizvēlni", "demoCustomSlidersDescription": "Slīdņi atspoguļo vērtību diapazonu joslā, kurā lietotāji var atlasīt atsevišķu vērtību vai vērtību diapazonu. Slīdņiem var atlasīt tēmu, un tos var pielāgot.", "demoSlidersContinuousWithEditableNumericalValue": "Nepārtraukts slīdnis ar rediģējamu skaitlisko vērtību", "demoSlidersDiscrete": "Slīdnis ar atsevišķām vērtībām", "demoSlidersDiscreteSliderWithCustomTheme": "Slīdnis ar atsevišķām vērtībām un pielāgotu motīvu", "demoSlidersContinuousRangeSliderWithCustomTheme": "Slīdnis ar nepārtrauktu vērtību diapazonu un pielāgotu motīvu", "demoSlidersContinuous": "Nepārtraukts", "placePondicherry": "Pudučerri", "demoMenuTitle": "Izvēlne", "demoContextMenuTitle": "Kontekstizvēlne", "demoSectionedMenuTitle": "Izvēlne ar sadaļām", "demoSimpleMenuTitle": "Vienkārša izvēlne", "demoChecklistMenuTitle": "Kontrolsaraksta izvēlne", "demoMenuSubtitle": "Izvēlnes pogas un vienkāršas izvēlnes", "demoMenuDescription": "Izvēlne īslaicīgajā saskarnē attēlo pieejamo opciju sarakstu. Tās tiek parādītas, kad lietotājs mijiedarbojas ar pogu vai vadīklu vai veic darbību.", "demoMenuItemValueOne": "Pirmais izvēlnes vienums", "demoMenuItemValueTwo": "Otrais izvēlnes vienums", "demoMenuItemValueThree": "Trešais izvēlnes vienums", "demoMenuOne": "Viens", "demoMenuTwo": "Divi", "demoMenuThree": "Trīs", "demoMenuContextMenuItemThree": "Kontekstizvēlnes trešais vienums", "demoCupertinoSwitchSubtitle": "iOS stila slēdzis", "demoSnackbarsText": "Šī ir paziņojumu josla.", "demoCupertinoSliderSubtitle": "iOS stila slīdnis", "demoCupertinoSliderDescription": "Izmantojot slīdni, var atlasīt vērtību no nepārtraukta diapazona vai atsevišķu vērtību kopas.", "demoCupertinoSliderContinuous": "Nepārtraukts: {value}", "demoCupertinoSliderDiscrete": "Atsevišķas vērtības: {value}", "demoSnackbarsAction": "Jūs nospiedāt paziņojumu joslas darbības pogu.", "backToGallery": "Atpakaļ uz galeriju", "demoCupertinoTabBarTitle": "Ciļņu josla", "demoCupertinoSwitchDescription": "Izmantojot slēdzi, var pārslēgt vienu iestatījumu no ieslēgta stāvokļa uz izslēgtu vai otrādi.", "demoSnackbarsActionButtonLabel": "DARBĪBA", "cupertinoTabBarProfileTab": "Profils", "demoSnackbarsButtonLabel": "RĀDĪT PAZIŅOJUMU JOSLU", "demoSnackbarsDescription": "Paziņojumu joslās tiek rādīta informācija par procesiem, ko lietotnes ir veikušas vai drīz veiks. Paziņojumu joslas tiek īslaicīgi rādītas ekrāna apakšdaļā. Tās nedrīkst traucēt lietošanu, un nav nepieciešama lietotāja ievade, lai tās pazustu.", "demoSnackbarsSubtitle": "Paziņojumu joslās ekrāna apakšā tiek rādīti ziņojumi", "demoSnackbarsTitle": "Paziņojumu joslas", "demoCupertinoSliderTitle": "Slīdnis", "cupertinoTabBarChatTab": "Tērzēšana", "cupertinoTabBarHomeTab": "Sākums", "demoCupertinoTabBarDescription": "iOS stila apakšējā navigācijas ciļņu josla Šeit tiek rādītas vairākas cilnes, un viena no tām ir aktīva. Pēc noklusējuma aktīva ir pirmā cilne.", "demoCupertinoTabBarSubtitle": "iOS stila apakšējā ciļņu josla", "demoOptionsFeatureTitle": "Skatīšanas opcijas", "demoOptionsFeatureDescription": "Pieskarieties šeit, lai skatītu šai demonstrācijai pieejamās opcijas.", "demoCodeViewerCopyAll": "KOPĒT VISU", "shrineScreenReaderRemoveProductButton": "Noņemt produktu: {product}", "shrineScreenReaderProductAddToCart": "Pievienot grozam", "shrineScreenReaderCart": "{quantity,plural,=0{Iepirkumu grozs, nav preču}=1{Iepirkumu grozs, 1 prece}other{Iepirkumu grozs, {quantity} preces}}", "demoCodeViewerFailedToCopyToClipboardMessage": "Neizdevās kopēt starpliktuvē: {error}", "demoCodeViewerCopiedToClipboardMessage": "Kopēts starpliktuvē.", "craneSleep8SemanticLabel": "Maiju celtņu drupas uz klints virs pludmales", "craneSleep4SemanticLabel": "Viesnīca pie kalnu ezera", "craneSleep2SemanticLabel": "Maču Pikču citadele", "craneSleep1SemanticLabel": "Kotedža sniegotā ainavā ar mūžzaļiem kokiem", "craneSleep0SemanticLabel": "Bungalo virs ūdens", "craneFly13SemanticLabel": "Peldbaseins ar palmām pie jūras", "craneFly12SemanticLabel": "Peldbaseins ar palmām", "craneFly11SemanticLabel": "Ķieģeļu bāka jūrā", "craneFly10SemanticLabel": "Al-Azhara mošejas minareti saulrietā", "craneFly9SemanticLabel": "Vīrietis atspiedies pret senu, zilu automašīnu", "craneFly8SemanticLabel": "Supertree Grove", "craneEat9SemanticLabel": "Kafejnīcas lete ar konditorejas izstrādājumiem", "craneEat2SemanticLabel": "Burgers", "craneFly5SemanticLabel": "Viesnīca pie kalnu ezera", "demoSelectionControlsSubtitle": "Izvēles rūtiņas, pogas un slēdži", "craneEat10SemanticLabel": "Sieviete tur lielu pastrami sendviču", "craneFly4SemanticLabel": "Bungalo virs ūdens", "craneEat7SemanticLabel": "Ieeja maizes ceptuvē", "craneEat6SemanticLabel": "Garneļu ēdiens", "craneEat5SemanticLabel": "Sēdvietas mākslinieciskā restorānā", "craneEat4SemanticLabel": "Šokolādes deserts", "craneEat3SemanticLabel": "Korejas tako", "craneFly3SemanticLabel": "Maču Pikču citadele", "craneEat1SemanticLabel": "Tukšs bārs ar augstiem krēsliem", "craneEat0SemanticLabel": "Pica malkas krāsnī", "craneSleep11SemanticLabel": "Debesskrāpis Taipei 101", "craneSleep10SemanticLabel": "Al-Azhara mošejas minareti saulrietā", "craneSleep9SemanticLabel": "Ķieģeļu bāka jūrā", "craneEat8SemanticLabel": "Šķīvis ar vēžiem", "craneSleep7SemanticLabel": "Krāsainas mājas Ribeiras laukumā", "craneSleep6SemanticLabel": "Peldbaseins ar palmām", "craneSleep5SemanticLabel": "Telts laukā", "settingsButtonCloseLabel": "Aizvērt iestatījumus", "demoSelectionControlsCheckboxDescription": "Izmantojot izvēles rūtiņas, lietotājs var atlasīt vairākas opcijas grupā. Parastas izvēles rūtiņas vērtība ir “true” vai “false”. Triju statusu izvēles rūtiņas vērtība var būt arī “null”.", "settingsButtonLabel": "Iestatījumi", "demoListsTitle": "Saraksti", "demoListsSubtitle": "Ritināmo sarakstu izkārtojumi", "demoListsDescription": "Viena fiksēta augstuma rindiņa, kas parasti ietver tekstu, kā arī ikonu pirms vai pēc teksta.", "demoOneLineListsTitle": "Viena rindiņa", "demoTwoLineListsTitle": "Divas rindiņas", "demoListsSecondary": "Sekundārais teksts", "demoSelectionControlsTitle": "Atlasīšanas vadīklas", "craneFly7SemanticLabel": "Rašmora kalns", "demoSelectionControlsCheckboxTitle": "Izvēles rūtiņa", "craneSleep3SemanticLabel": "Vīrietis atspiedies pret senu, zilu automašīnu", "demoSelectionControlsRadioTitle": "Poga", "demoSelectionControlsRadioDescription": "Izmantojot pogas, lietotājs var atlasīt vienu opciju grupā. Izmantojiet pogas vienas opcijas atlasei, ja uzskatāt, ka lietotājam ir jāredz visas pieejamās opcijas līdzās.", "demoSelectionControlsSwitchTitle": "Slēdzis", "demoSelectionControlsSwitchDescription": "Izmantojot ieslēgšanas/izslēgšanas slēdzi, var mainīt vienas iestatījumu opcijas statusu. Atbilstošajā iekļautajā iezīmē ir jābūt skaidri norādītam, kuru opciju var pārslēgt, izmantojot slēdzi, un kāds statuss tai ir pašlaik.", "craneFly0SemanticLabel": "Kotedža sniegotā ainavā ar mūžzaļiem kokiem", "craneFly1SemanticLabel": "Telts laukā", "craneFly2SemanticLabel": "Lūgšanu karodziņi uz sniegota kalna fona", "craneFly6SemanticLabel": "Skats no putna lidojuma uz Dekoratīvās mākslas pili", "rallySeeAllAccounts": "Skatīt visus kontus", "rallyBillAmount": "Rēķins ({billName}) par summu {amount} ir jāapmaksā līdz šādam datumam: {date}.", "shrineTooltipCloseCart": "Aizvērt grozu", "shrineTooltipCloseMenu": "Aizvērt izvēlni", "shrineTooltipOpenMenu": "Atvērt izvēlni", "shrineTooltipSettings": "Iestatījumi", "shrineTooltipSearch": "Meklēt", "demoTabsDescription": "Cilnēs saturs ir sakārtots vairākos ekrānos, datu kopās un citos mijiedarbības veidos.", "demoTabsSubtitle": "Cilnes ar neatkarīgi ritināmiem skatiem", "demoTabsTitle": "Cilnes", "rallyBudgetAmount": "Budžets {budgetName} ar iztērētu summu {amountUsed} no {amountTotal}, atlikusī summa: {amountLeft}", "shrineTooltipRemoveItem": "Noņemt vienumu", "rallyAccountAmount": "Kontā ({accountName}; numurs: {accountNumber}) ir šāda summa: {amount}.", "rallySeeAllBudgets": "Skatīt visus budžetus", "rallySeeAllBills": "Skatīt visus rēķinus", "craneFormDate": "Atlasiet datumu", "craneFormOrigin": "Izvēlieties sākumpunktu", "craneFly2": "Khumbu ieleja, Nepāla", "craneFly3": "Maču Pikču, Peru", "craneFly4": "Male, Maldīvu salas", "craneFly5": "Vicnava, Šveice", "craneFly6": "Mehiko, Meksika", "craneFly7": "Rašmora kalns, ASV", "settingsTextDirectionLocaleBased": "Pamatojoties uz lokalizāciju", "craneFly9": "Havana, Kuba", "craneFly10": "Kaira, Ēģipte", "craneFly11": "Lisabona, Portugāle", "craneFly12": "Napa, ASV", "craneFly13": "Bali, Indonēzija", "craneSleep0": "Male, Maldīvu salas", "craneSleep1": "Espena, ASV", "craneSleep2": "Maču Pikču, Peru", "demoCupertinoSegmentedControlTitle": "Segmentēta pārvaldība", "craneSleep4": "Vicnava, Šveice", "craneSleep5": "Bigsura, ASV", "craneSleep6": "Napa, ASV", "craneSleep7": "Porto, Portugāle", "craneSleep8": "Tuluma, Meksika", "craneEat5": "Seula, Dienvidkoreja", "demoChipTitle": "Žetoni", "demoChipSubtitle": "Kompakti elementi, kas apzīmē ievadi, atribūtu vai darbību", "demoActionChipTitle": "Darbības žetons", "demoActionChipDescription": "Darbību žetoni ir tādu opciju kopa, kas aktivizē ar primāro saturu saistītu darbību. Darbību žetoniem lietotāja saskarnē jābūt redzamiem dinamiski un atbilstoši kontekstam.", "demoChoiceChipTitle": "Izvēles žetons", "demoChoiceChipDescription": "Izvēles žetons apzīmē vienu izvēli no kopas. Izvēles žetoni satur saistītu aprakstošo tekstu vai kategorijas.", "demoFilterChipTitle": "Filtra žetons", "demoFilterChipDescription": "Filtra žetoni satura filtrēšanai izmanto atzīmes vai aprakstošos vārdus.", "demoInputChipTitle": "Ievades žetons", "demoInputChipDescription": "Ievades žetons ir kompaktā veidā atveidota komplicēta informācijas daļa, piemēram, vienība (persona, vieta vai lieta) vai sarunas teksts.", "craneSleep9": "Lisabona, Portugāle", "craneEat10": "Lisabona, Portugāle", "demoCupertinoSegmentedControlDescription": "Izmanto, lai atlasītu kādu no savstarpēji izslēdzošām iespējām. Kad ir atlasīta iespēja segmentētajā pārvaldībā, citas iespējas tajā vairs netiek atlasītas.", "chipTurnOnLights": "Ieslēgt apgaismojumu", "chipSmall": "S izmērs", "chipMedium": "M izmērs", "chipLarge": "L izmērs", "chipElevator": "Lifts", "chipWasher": "Veļas mazgājamā mašīna", "chipFireplace": "Kamīns", "chipBiking": "Riteņbraukšana", "craneFormDiners": "Ēstuves", "rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{Palieliniet nodokļu atmaksas iespējas! Pievienojiet kategorijas 1 darījumam, kuram vēl nav pievienota kategorija.}zero{Palieliniet nodokļu atmaksas iespējas! Pievienojiet kategorijas {count} darījumiem, kuriem vēl nav pievienotas kategorijas.}other{Palieliniet nodokļu atmaksas iespējas! Pievienojiet kategorijas {count} darījumiem, kuriem vēl nav pievienotas kategorijas.}}", "craneFormTime": "Atlasiet laiku", "craneFormLocation": "Atlasiet atrašanās vietu", "craneFormTravelers": "Ceļotāji", "craneEat8": "Atlanta, ASV", "craneFormDestination": "Izvēlieties galamērķi", "craneFormDates": "Atlasiet datumus", "craneFly": "LIDOJUMI", "craneSleep": "NAKTSMĪTNES", "craneEat": "ĒDIENS", "craneFlySubhead": "Izpētiet lidojumus pēc galamērķa", "craneSleepSubhead": "Izpētiet īpašumus pēc galamērķa", "craneEatSubhead": "Izpētiet restorānus pēc galamērķa", "craneFlyStops": "{numberOfStops,plural,=0{Tiešais lidojums}=1{1 pārsēšanās}other{{numberOfStops} pārsēšanās}}", "craneSleepProperties": "{totalProperties,plural,=0{Nav pieejamu īpašumu}=1{1 pieejams īpašums}other{{totalProperties} pieejami īpašumi}}", "craneEatRestaurants": "{totalRestaurants,plural,=0{Nav restorānu}=1{1 restorāns}other{{totalRestaurants} restorāni}}", "craneFly0": "Espena, ASV", "demoCupertinoSegmentedControlSubtitle": "iOS stila segmentēta pārvaldība", "craneSleep10": "Kaira, Ēģipte", "craneEat9": "Madride, Spānija", "craneFly1": "Bigsura, ASV", "craneEat7": "Našvila, ASV", "craneEat6": "Sietla, ASV", "craneFly8": "Singapūra", "craneEat4": "Parīze, Francija", "craneEat3": "Portlenda, ASV", "craneEat2": "Kordova, Argentīna", "craneEat1": "Dalasa, ASV", "craneEat0": "Neapole, Itālija", "craneSleep11": "Taipeja, Taivāna", "craneSleep3": "Havana, Kuba", "shrineLogoutButtonCaption": "ATTEIKTIES", "rallyTitleBills": "RĒĶINI", "rallyTitleAccounts": "KONTI", "shrineProductVagabondSack": "Klaidoņa pauna", "rallyAccountDetailDataInterestYtd": "Procenti YTD", "shrineProductWhitneyBelt": "Whitney josta", "shrineProductGardenStrand": "Dārza mala", "shrineProductStrutEarrings": "Auskari", "shrineProductVarsitySocks": "Karsējmeiteņu zeķes", "shrineProductWeaveKeyring": "Austs atslēgu turētājs", "shrineProductGatsbyHat": "Gatsby stila cepure", "shrineProductShrugBag": "Plecu soma", "shrineProductGiltDeskTrio": "Darba galda komplekts", "shrineProductCopperWireRack": "Vara stiepļu statīvs", "shrineProductSootheCeramicSet": "Keramikas izstrādājumu komplekts", "shrineProductHurrahsTeaSet": "Hurrahs tējas komplekts", "shrineProductBlueStoneMug": "Zila akmens krūze", "shrineProductRainwaterTray": "Lietus ūdens trauks", "shrineProductChambrayNapkins": "Chambray salvetes", "shrineProductSucculentPlanters": "Sukulenti", "shrineProductQuartetTable": "Četrvietīgs galds", "shrineProductKitchenQuattro": "Virtuves komplekts", "shrineProductClaySweater": "Māla krāsas džemperis", "shrineProductSeaTunic": "Zila tunika", "shrineProductPlasterTunic": "Ģipša krāsas tunika", "rallyBudgetCategoryRestaurants": "Restorāni", "shrineProductChambrayShirt": "Auduma krekls", "shrineProductSeabreezeSweater": "Jūras krāsas džemperis", "shrineProductGentryJacket": "Gentry stila jaka", "shrineProductNavyTrousers": "Tumši zilas bikses", "shrineProductWalterHenleyWhite": "Walter stila tops (balts)", "shrineProductSurfAndPerfShirt": "Sērfošanas krekls", "shrineProductGingerScarf": "Ruda šalle", "shrineProductRamonaCrossover": "Ramona krosovers", "shrineProductClassicWhiteCollar": "Klasiska balta apkaklīte", "shrineProductSunshirtDress": "Krekla kleita", "rallyAccountDetailDataInterestRate": "Procentu likme", "rallyAccountDetailDataAnnualPercentageYield": "Gada peļņa procentos", "rallyAccountDataVacation": "Atvaļinājums", "shrineProductFineLinesTee": "T-krekls ar smalkām līnijām", "rallyAccountDataHomeSavings": "Mājas ietaupījumi", "rallyAccountDataChecking": "Norēķinu konts", "rallyAccountDetailDataInterestPaidLastYear": "Procenti, kas samaksāti pagājušajā gadā", "rallyAccountDetailDataNextStatement": "Nākamais izraksts", "rallyAccountDetailDataAccountOwner": "Konta īpašnieks", "rallyBudgetCategoryCoffeeShops": "Kafejnīcas", "rallyBudgetCategoryGroceries": "Pārtikas veikali", "shrineProductCeriseScallopTee": "Ķiršu krāsas T-krekls", "rallyBudgetCategoryClothing": "Apģērbs", "rallySettingsManageAccounts": "Pārvaldīt kontus", "rallyAccountDataCarSavings": "Ietaupījumi automašīnai", "rallySettingsTaxDocuments": "Nodokļu dokumenti", "rallySettingsPasscodeAndTouchId": "Piekļuves kods un Touch ID", "rallySettingsNotifications": "Paziņojumi", "rallySettingsPersonalInformation": "Personas informācija", "rallySettingsPaperlessSettings": "Datorizēti iestatījumi", "rallySettingsFindAtms": "Atrast bankomātus", "rallySettingsHelp": "Palīdzība", "rallySettingsSignOut": "Izrakstīties", "rallyAccountTotal": "Kopā", "rallyBillsDue": "Termiņš", "rallyBudgetLeft": "Atlikums", "rallyAccounts": "Konti", "rallyBills": "Rēķini", "rallyBudgets": "Budžeti", "rallyAlerts": "Brīdinājumi", "rallySeeAll": "SKATĪT VISUS", "rallyFinanceLeft": "ATLIKUMS", "rallyTitleOverview": "PĀRSKATS", "shrineProductShoulderRollsTee": "T-krekls ar apaļu plecu daļu", "shrineNextButtonCaption": "TĀLĀK", "rallyTitleBudgets": "BUDŽETI", "rallyTitleSettings": "IESTATĪJUMI", "rallyLoginLoginToRally": "Pieteikties lietotnē Rally", "rallyLoginNoAccount": "Vai jums vēl nav konta?", "rallyLoginSignUp": "REĢISTRĒTIES", "rallyLoginUsername": "Lietotājvārds", "rallyLoginPassword": "Parole", "rallyLoginLabelLogin": "Pieteikties", "rallyLoginRememberMe": "Atcerēties mani", "rallyLoginButtonLogin": "PIETEIKTIES", "rallyAlertsMessageHeadsUpShopping": "Uzmanību! Jūs esat izmantojis {percent} no sava iepirkšanās budžeta šim mēnesim.", "rallyAlertsMessageSpentOnRestaurants": "Šonedēļ esat iztērējis {amount} restorānos.", "rallyAlertsMessageATMFees": "Šomēnes esat iztērējis {amount} par maksu bankomātos.", "rallyAlertsMessageCheckingAccount": "Labs darbs! Jūsu norēķinu konts ir par {percent} augstāks nekā iepriekšējā mēnesī.", "shrineMenuCaption": "IZVĒLNE", "shrineCategoryNameAll": "VISAS", "shrineCategoryNameAccessories": "AKSESUĀRI", "shrineCategoryNameClothing": "APĢĒRBS", "shrineCategoryNameHome": "MĀJAI", "shrineLoginUsernameLabel": "Lietotājvārds", "shrineLoginPasswordLabel": "Parole", "shrineCancelButtonCaption": "ATCELT", "shrineCartTaxCaption": "Nodoklis:", "shrineCartPageCaption": "GROZS", "shrineProductQuantity": "Daudzums: {quantity}", "shrineProductPrice": "x {price}", "shrineCartItemCount": "{quantity,plural,=0{NAV VIENUMU}=1{1 VIENUMS}other{{quantity} VIENUMI}}", "shrineCartClearButtonCaption": "NOTĪRĪT GROZU", "shrineCartTotalCaption": "KOPĀ", "shrineCartSubtotalCaption": "Starpsumma:", "shrineCartShippingCaption": "Piegāde:", "shrineProductGreySlouchTank": "Pelēkas krāsas tops", "shrineProductStellaSunglasses": "Stella saulesbrilles", "shrineProductWhitePinstripeShirt": "Balts svītrains krekls", "demoTextFieldWhereCanWeReachYou": "Kā varam ar jums sazināties?", "settingsTextDirectionLTR": "LTR", "settingsTextScalingLarge": "Liels", "demoBottomSheetHeader": "Galvene", "demoBottomSheetItem": "Vienums {value}", "demoBottomTextFieldsTitle": "Teksta lauki", "demoTextFieldTitle": "Teksta lauki", "demoTextFieldSubtitle": "Viena rinda teksta un ciparu rediģēšanai", "demoTextFieldDescription": "Izmantojot teksta laukus, lietotāji var ievadīt lietotāja saskarnē tekstu. Parasti tie tiek rādīti veidlapās vai dialoglodziņos.", "demoTextFieldShowPasswordLabel": "Rādīt paroli", "demoTextFieldHidePasswordLabel": "Slēpt paroli", "demoTextFieldFormErrors": "Pirms iesniegšanas, lūdzu, labojiet kļūdas sarkanā krāsā.", "demoTextFieldNameRequired": "Ir jāievada vārds.", "demoTextFieldOnlyAlphabeticalChars": "Lūdzu, ievadiet tikai alfabēta rakstzīmes.", "demoTextFieldEnterUSPhoneNumber": "(###) ###-#### — ievadiet pareizu tālruņa numuru.", "demoTextFieldEnterPassword": "Lūdzu, ievadiet paroli.", "demoTextFieldPasswordsDoNotMatch": "Paroles nesakrīt", "demoTextFieldWhatDoPeopleCallYou": "Kā cilvēki jūs dēvē?", "demoTextFieldNameField": "Vārds*", "demoBottomSheetButtonText": "RĀDĪT EKRĀNA APAKŠDAĻAS IZKLĀJLAPU", "demoTextFieldPhoneNumber": "Tālruņa numurs*", "demoBottomSheetTitle": "Ekrāna apakšdaļas izklājlapa", "demoTextFieldEmail": "E-pasta adrese", "demoTextFieldTellUsAboutYourself": "Pastāstiet par sevi (piem., uzrakstiet, ar ko jūs nodarbojaties vai kādi ir jūsu vaļasprieki)", "demoTextFieldKeepItShort": "Veidojiet to īsu, šī ir tikai demonstrācijas versija.", "starterAppGenericButton": "POGA", "demoTextFieldLifeStory": "Biogrāfija", "demoTextFieldSalary": "Alga", "demoTextFieldUSD": "USD", "demoTextFieldNoMoreThan": "Ne vairāk kā 8 rakstzīmes.", "demoTextFieldPassword": "Parole*", "demoTextFieldRetypePassword": "Atkārtota paroles ierakstīšana*", "demoTextFieldSubmit": "IESNIEGT", "demoBottomNavigationSubtitle": "Navigācija apakšā ar vairākiem skatiem, kas kļūst neskaidri", "demoBottomSheetAddLabel": "Pievienot", "demoBottomSheetModalDescription": "Modālā ekrāna apakšdaļa ir izvēlnes vai dialoglodziņa alternatīva, kuru izmantojot, lietotājam nav nepieciešams mijiedarboties ar pārējo lietotni.", "demoBottomSheetModalTitle": "Modālā ekrāna apakšdaļa", "demoBottomSheetPersistentDescription": "Pastāvīgajā ekrāna apakšdaļā tiek rādīta informācija, kas papildina primāro lietotnes saturu. Pastāvīgā ekrāna apakšdaļa paliek redzama arī tad, kad lietotājs mijiedarbojas ar citām lietotnes daļām.", "demoBottomSheetPersistentTitle": "Pastāvīgā ekrāna apakšdaļas izklājlapa", "demoBottomSheetSubtitle": "Pastāvīgā un modālā ekrāna apakšdaļa", "demoTextFieldNameHasPhoneNumber": "{name} tālruņa numurs ir {phoneNumber}", "buttonText": "POGA", "demoTypographyDescription": "Definīcijas dažādiem tipogrāfijas stiliem, kas atrasti materiāla dizaina ceļvedī.", "demoTypographySubtitle": "Visi iepriekš definētie teksta stili", "demoTypographyTitle": "Tipogrāfija", "demoFullscreenDialogDescription": "Rekvizīts fullscreenDialog nosaka, vai ienākošā lapa ir pilnekrāna režīma modālais dialoglodziņš.", "demoFlatButtonDescription": "Plakana poga piespiežot attēlo tintes traipu, taču nepaceļas. Plakanas pogas izmantojamas rīkjoslās, dialoglodziņos un iekļautas ar iekšējo atkāpi.", "demoBottomNavigationDescription": "Apakšējās navigācijas joslās ekrāna apakšdaļā tiek rādīti 3–5 galamērķi. Katrs galamērķis ir attēlots ar ikonu un papildu teksta iezīmi. Pieskaroties apakšējai navigācijas ikonai, lietotājs tiek novirzīts uz augšējā līmeņa navigācijas galamērķi, kas ir saistīts ar attiecīgo ikonu.", "demoBottomNavigationSelectedLabel": "Atlasīta iezīme", "demoBottomNavigationPersistentLabels": "Pastāvīgas iezīmes", "starterAppDrawerItem": "Vienums {value}", "demoTextFieldRequiredField": "* norāda obligātu lauku", "demoBottomNavigationTitle": "Navigācija apakšā", "settingsLightTheme": "Gaišs", "settingsTheme": "Motīvs", "settingsPlatformIOS": "iOS", "settingsPlatformAndroid": "Android", "settingsTextDirectionRTL": "No labās puses uz kreiso pusi", "settingsTextScalingHuge": "Milzīgs", "cupertinoButton": "Poga", "settingsTextScalingNormal": "Parasts", "settingsTextScalingSmall": "Mazs", "settingsSystemDefault": "Sistēma", "settingsTitle": "Iestatījumi", "rallyDescription": "Personisko finanšu lietotne", "aboutDialogDescription": "Lai skatītu šīs lietotnes pirmkodu, lūdzu, apmeklējiet: {repoLink}.", "bottomNavigationCommentsTab": "Komentāri", "starterAppGenericBody": "Pamatteksts", "starterAppGenericHeadline": "Virsraksts", "starterAppGenericSubtitle": "Apakšvirsraksts", "starterAppGenericTitle": "Nosaukums", "starterAppTooltipSearch": "Meklēt", "starterAppTooltipShare": "Kopīgot", "starterAppTooltipFavorite": "Izlase", "starterAppTooltipAdd": "Pievienot", "bottomNavigationCalendarTab": "Kalendārs", "starterAppDescription": "Adaptīvs sākuma izkārtojums", "starterAppTitle": "Sākuma lietotne", "aboutFlutterSamplesRepo": "Skaņu paraugi GitHub krātuvē", "bottomNavigationContentPlaceholder": "Vietturis {title} cilnei", "bottomNavigationCameraTab": "Kamera", "bottomNavigationAlarmTab": "Signāls", "bottomNavigationAccountTab": "Konts", "demoTextFieldYourEmailAddress": "Jūsu e-pasta adrese", "demoToggleButtonDescription": "Pārslēgšanas pogas var izmantot saistītu opciju grupēšanai. Lai uzsvērtu saistītu pārslēgšanas pogu grupas, grupai ir jābūt kopīgam konteineram.", "colorsGrey": "PELĒKA", "colorsBrown": "BRŪNA", "colorsDeepOrange": "TUMŠI ORANŽA", "colorsOrange": "ORANŽA", "colorsAmber": "DZINTARKRĀSA", "colorsYellow": "DZELTENA", "colorsLime": "LAIMA ZAĻA", "colorsLightGreen": "GAIŠI ZAĻA", "colorsGreen": "ZAĻA", "homeHeaderGallery": "Galerija", "homeHeaderCategories": "Kategorijas", "shrineDescription": "Moderna mazumtirdzniecības lietotne", "craneDescription": "Personalizēta ceļojumu lietotne", "homeCategoryReference": "STILU UN CITAS DEMONSTRĀCIJAS", "demoInvalidURL": "Nevarēja attēlot URL:", "demoOptionsTooltip": "Opcijas", "demoInfoTooltip": "Informācija", "demoCodeTooltip": "Demonstrācijas versijas kods", "demoDocumentationTooltip": "API dokumentācija", "demoFullscreenTooltip": "Pilnekrāna režīms", "settingsTextScaling": "Teksta mērogošana", "settingsTextDirection": "Teksta virziens", "settingsLocale": "Lokalizācija", "settingsPlatformMechanics": "Platformas mehānika", "settingsDarkTheme": "Tumšs", "settingsSlowMotion": "Palēnināta kustība", "settingsAbout": "Par galeriju “Flutter”", "settingsFeedback": "Sūtīt atsauksmes", "settingsAttribution": "Radīja uzņēmums TOASTER Londonā", "demoButtonTitle": "Pogas", "demoButtonSubtitle": "Teksta pogas, paaugstinātas, konturētas un citādas pogas", "demoFlatButtonTitle": "Plakana poga", "demoRaisedButtonDescription": "Paceltas pogas piešķir plakaniem izkārtojumiem apjomu. Tās uzsver funkcijas aizņemtās vai plašās vietās.", "demoRaisedButtonTitle": "Pacelta poga", "demoOutlineButtonTitle": "Konturēta poga", "demoOutlineButtonDescription": "Konturētas pogas nospiežot paliek necaurspīdīgas un paceļas. Tās bieži izmanto kopā ar paceltām pogām, lai norādītu alternatīvu, sekundāru darbību.", "demoToggleButtonTitle": "Pārslēgšanas pogas", "colorsTeal": "ZILGANZAĻA", "demoFloatingButtonTitle": "Peldoša darbības poga", "demoFloatingButtonDescription": "Peldoša darbības poga ir apaļa ikonas poga, kas norāda uz saturu, lai veicinātu primāru darbību lietojumprogrammā.", "demoDialogTitle": "Dialoglodziņi", "demoDialogSubtitle": "Vienkārši, brīdinājuma un pilnekrāna režīma", "demoAlertDialogTitle": "Brīdinājums", "demoAlertDialogDescription": "Brīdinājumu dialoglodziņš informē lietotāju par situācijām, kam nepieciešams pievērst uzmanību. Brīdinājumu dialoglodziņam ir neobligāts nosaukums un neobligātu darbību saraksts.", "demoAlertTitleDialogTitle": "Brīdinājums ar nosaukumu", "demoSimpleDialogTitle": "Vienkāršs", "demoSimpleDialogDescription": "Vienkāršā dialoglodziņā lietotājam tiek piedāvāts izvēlēties starp vairākām opcijām. Vienkāršam dialoglodziņam ir neobligāts virsraksts, kas tiek attēlots virs izvēlēm.", "demoFullscreenDialogTitle": "Pilnekrāna režīms", "demoCupertinoButtonsTitle": "Pogas", "demoCupertinoButtonsSubtitle": "iOS stila pogas", "demoCupertinoButtonsDescription": "iOS stila poga. Pogā var ievietot tekstu un/vai ikonu, kas pieskaroties pakāpeniski parādās un izzūd. Pogai pēc izvēles var būt fons.", "demoCupertinoAlertsTitle": "Brīdinājumi", "demoCupertinoAlertsSubtitle": "iOS stila brīdinājuma dialoglodziņi", "demoCupertinoAlertTitle": "Brīdinājums", "demoCupertinoAlertDescription": "Brīdinājumu dialoglodziņš informē lietotāju par situācijām, kam nepieciešams pievērst uzmanību. Brīdinājumu dialoglodziņam ir neobligāts virsraksts, neobligāts saturs un neobligātu darbību saraksts. Virsraksts tiek parādīts virs satura, un darbības tiek parādītas zem satura.", "demoCupertinoAlertWithTitleTitle": "Brīdinājums ar nosaukumu", "demoCupertinoAlertButtonsTitle": "Brīdinājums ar pogām", "demoCupertinoAlertButtonsOnlyTitle": "Tikai brīdinājumu pogas", "demoCupertinoActionSheetTitle": "Darbību izklājlapa", "demoCupertinoActionSheetDescription": "Darbību izklājlapa ir konkrēta stila brīdinājums, kas parāda lietotājam ar konkrēto kontekstu saistītu divu vai vairāku izvēļu kopumu. Darbību izklājlapai var būt virsraksts, papildu ziņa, kā arī darbību saraksts.", "demoColorsTitle": "Krāsas", "demoColorsSubtitle": "Visas iepriekš definētās krāsas", "demoColorsDescription": "Krāsas un krāsas izvēles konstantes, kas atspoguļo materiālu dizaina krāsu paleti.", "buttonTextEnabled": "ENABLED", "buttonTextDisabled": "DISABLED", "buttonTextCreate": "Izveidot", "dialogSelectedOption": "Jūs atlasījāt: “{value}”", "dialogDiscardTitle": "Vai atmest melnrakstu?", "dialogLocationTitle": "Vai izmantot Google atrašanās vietas pakalpojumu?", "dialogLocationDescription": "Google varēs palīdzēt lietotnēm noteikt atrašanās vietu. Tas nozīmē, ka uzņēmumam Google tiks nosūtīti anonīmi atrašanās vietas dati, pat ja neviena lietotne nedarbosies.", "dialogCancel": "ATCELT", "dialogDiscard": "ATMEST", "dialogDisagree": "NEPIEKRĪTU", "dialogAgree": "PIEKRĪTU", "dialogSetBackup": "Dublējuma konta iestatīšana", "colorsBlueGrey": "ZILPELĒKA", "dialogShow": "PARĀDĪT DIALOGLODZIŅU", "dialogFullscreenTitle": "Pilnekrāna režīma dialoglodziņš", "dialogFullscreenSave": "SAGLABĀT", "dialogFullscreenDescription": "Pilnekrāna režīma dialoglodziņa demonstrācija", "cupertinoButtonEnabled": "Enabled", "cupertinoButtonDisabled": "Disabled", "cupertinoButtonWithBackground": "Ar fonu", "cupertinoAlertCancel": "Atcelt", "cupertinoAlertDiscard": "Atmest", "cupertinoAlertLocationTitle": "Vai ļaut lietotnei “Maps” piekļūt jūsu atrašanās vietai, kad izmantojat šo lietotni?", "cupertinoAlertLocationDescription": "Kartē tiks attēlota jūsu pašreizējā atrašanās vieta, un tā tiks izmantota, lai sniegtu norādes, parādītu tuvumā esošus meklēšanas rezultātus un noteiktu aptuvenu ceļā pavadāmo laiku.", "cupertinoAlertAllow": "Atļaut", "cupertinoAlertDontAllow": "Neatļaut", "cupertinoAlertFavoriteDessert": "Atlasiet iecienītāko desertu", "cupertinoAlertDessertDescription": "Lūdzu, tālāk redzamajā sarakstā atlasiet savu iecienītāko desertu. Jūsu atlase tiks izmantota, lai pielāgotu jūsu apgabalā ieteikto restorānu sarakstu.", "cupertinoAlertCheesecake": "Siera kūka", "cupertinoAlertTiramisu": "Tiramisu", "cupertinoAlertApplePie": "Ābolkūka", "cupertinoAlertChocolateBrownie": "Šokolādes braunijs", "cupertinoShowAlert": "Parādīt brīdinājumu", "colorsRed": "SARKANA", "colorsPink": "ROZĀ", "colorsPurple": "VIOLETA", "colorsDeepPurple": "TUMŠI VIOLETA", "colorsIndigo": "INDIGO", "colorsBlue": "ZILA", "colorsLightBlue": "GAIŠI ZILA", "colorsCyan": "CIĀNZILA", "dialogAddAccount": "Pievienot kontu", "Gallery": "Galerija", "Categories": "Kategorijas", "SHRINE": "SHRINE", "Basic shopping app": "Iepirkšanās pamatlietotne", "RALLY": "RALLY", "CRANE": "CRANE", "Travel app": "Ceļojumu lietotne", "MATERIAL": "MATERIĀLS", "CUPERTINO": "CUPERTINO", "REFERENCE STYLES & MEDIA": "ATSAUČU STILI UN MEDIJI" }
gallery/lib/l10n/intl_lv.arb/0
{ "file_path": "gallery/lib/l10n/intl_lv.arb", "repo_id": "gallery", "token_count": 23173 }
813
{ "loading": "Se încarcă", "deselect": "Debifați", "select": "Selectați", "selectable": "Se poate selecta (apăsare lungă)", "selected": "Selectat", "demo": "Versiune demonstrativă", "bottomAppBar": "Bara de aplicații din partea de jos", "notSelected": "Neselectat", "demoCupertinoSearchTextFieldTitle": "Câmp pentru căutarea textului", "demoCupertinoPicker": "Selector", "demoCupertinoSearchTextFieldSubtitle": "Câmp pentru textul de căutare în stil iOS", "demoCupertinoSearchTextFieldDescription": "Un câmp de text de căutare cu ajutorul căruia utilizatorul poate să caute prin introducerea de text și care poate oferi și filtra sugestii.", "demoCupertinoSearchTextFieldPlaceholder": "Introduceți text", "demoCupertinoScrollbarTitle": "Bara de derulare", "demoCupertinoScrollbarSubtitle": "Bara de derulare în stil iOS", "demoCupertinoScrollbarDescription": "O bară de derulare care include elementul subordonat", "demoTwoPaneItem": "Articol {value}", "demoTwoPaneList": "Listă", "demoTwoPaneFoldableLabel": "Dispozitiv pliabil", "demoTwoPaneSmallScreenLabel": "Ecran mic", "demoTwoPaneSmallScreenDescription": "Acesta este comportamentul TwoPane pe un dispozitiv cu ecran mic.", "demoTwoPaneTabletLabel": "Tabletă / computer", "demoTwoPaneTabletDescription": "Acesta este comportamentul TwoPane pe un ecran mai mare, cum ar fi cel de tabletă sau de computer.", "demoTwoPaneTitle": "TwoPane", "demoTwoPaneSubtitle": "Aspecte adaptabile pe ecrane pliabile, mari și mici", "splashSelectDemo": "Selectați o demonstrație", "demoTwoPaneFoldableDescription": "Acesta este comportamentul TwoPane pe un dispozitiv pliabil.", "demoTwoPaneDetails": "Detalii", "demoTwoPaneSelectItem": "Selectați un articol", "demoTwoPaneItemDetails": "Detalii despre articolul {value}", "demoCupertinoContextMenuActionText": "Atingeți lung sigla Flutter ca să vedeți meniul contextual", "demoCupertinoContextMenuDescription": "Un meniu contextual în stil iOS pe ecran complet care apare când se apasă lung pe un element.", "demoAppBarTitle": "Bara de aplicații", "demoAppBarDescription": "Bara de aplicații oferă conținut și acțiuni legate de ecranul actual. Se folosește pentru branding, titluri de ecran, navigare și acțiuni", "demoDividerTitle": "Separator", "demoDividerSubtitle": "Un separator este o linie subțire care grupează conținutul în liste și aspecte.", "demoDividerDescription": "Separatoarele se pot folosi în liste, panouri și alte locuri pentru a separa conținutul.", "demoVerticalDividerTitle": "Separator vertical", "demoCupertinoContextMenuTitle": "Meniu contextual", "demoCupertinoContextMenuSubtitle": "Meniu contextual în stil iOS", "demoAppBarSubtitle": "Afișează informații și acțiuni legate de ecranul actual", "demoCupertinoContextMenuActionOne": "Prima acțiune", "demoCupertinoContextMenuActionTwo": "A doua acțiune", "demoDateRangePickerDescription": "Afișează o casetă de dialog cu un selector al intervalului de date pentru Design material.", "demoDateRangePickerTitle": "Selector pentru intervalul de date", "demoNavigationDrawerUserName": "Nume de utilizator", "demoNavigationDrawerUserEmail": "[email protected]", "demoNavigationDrawerText": "Glisați dinspre margine sau atingeți pictograma din stânga sus ca să vedeți panoul", "demoNavigationRailTitle": "Bară de navigare", "demoNavigationRailSubtitle": "Afișarea unei bare de navigare într-o aplicație", "demoNavigationRailDescription": "Un widget pentru design material care se afișează în stânga sau în dreapta unei aplicații, pentru a putea naviga prin câteva vizualizări, de obicei între trei și cinci.", "demoNavigationRailFirst": "Prima", "demoNavigationDrawerTitle": "Panou de navigare", "demoNavigationRailThird": "A treia", "replyStarredLabel": "Cu stea", "demoTextButtonDescription": "Butonul text reacționează vizibil la apăsare, dar nu se ridică. Folosiți butoanele text în bare de instrumente, casete de dialog și în linie cu chenarul interior.", "demoElevatedButtonTitle": "Butonul în relief", "demoElevatedButtonDescription": "Butoanele în relief conferă dimensiune aspectelor în mare parte plate. Acestea evidențiază funcții în spații pline sau ample.", "demoOutlinedButtonTitle": "Butonul conturat", "demoOutlinedButtonDescription": "Butoanele conturate devin opace și se ridică la apăsare. Sunt de multe ori asociate cu butoane ridicate, pentru a indica o acțiune secundară alternativă.", "demoContainerTransformDemoInstructions": "Carduri, Liste și Butonul de acțiune flotant", "demoNavigationDrawerSubtitle": "Afișarea unui panou în bara de aplicații", "replyDescription": "O aplicație pentru e-mail eficientă și utilă", "demoNavigationDrawerDescription": "Un panou pentru design material care glisează pe orizontală dinspre marginea ecranului pentru a afișa linkuri de navigare într-o aplicație.", "replyDraftsLabel": "Mesaje nefinalizate", "demoNavigationDrawerToPageOne": "Primul element", "replyInboxLabel": "Mesaje primite", "demoSharedXAxisDemoInstructions": "Butoanele Înainte și Înapoi", "replySpamLabel": "Spam", "replyTrashLabel": "Coș de gunoi", "replySentLabel": "Trimise", "demoNavigationRailSecond": "A doua", "demoNavigationDrawerToPageTwo": "Al doilea element", "demoFadeScaleDemoInstructions": "Modal și Butonul de acțiune flotant", "demoFadeThroughDemoInstructions": "Navigarea în partea de jos", "demoSharedZAxisDemoInstructions": "Butonul cu pictograma Setări", "demoSharedYAxisDemoInstructions": "Sortați după „Redate recent”", "demoTextButtonTitle": "Butonul text", "demoSharedZAxisBeefSandwichRecipeTitle": "Sandviș cu vită", "demoSharedZAxisDessertRecipeDescription": "Rețetă de desert", "demoSharedYAxisAlbumTileSubtitle": "Artist", "demoSharedYAxisAlbumTileTitle": "Album", "demoSharedYAxisRecentSortTitle": "Redate recent", "demoSharedYAxisAlphabeticalSortTitle": "A – Z", "demoSharedYAxisAlbumCount": "268 de albume", "demoSharedYAxisTitle": "Axa y comună", "demoSharedXAxisCreateAccountButtonText": "CREAȚI UN CONT", "demoFadeScaleAlertDialogDiscardButton": "RENUNȚAȚI", "demoSharedXAxisSignInTextFieldLabel": "Adresa de e-mail sau numărul de telefon", "demoSharedXAxisSignInSubtitleText": "Conectați-vă cu contul dvs.", "demoSharedXAxisSignInWelcomeText": "Bună ziua, David Park!", "demoSharedXAxisIndividualCourseSubtitle": "Afișate individual", "demoSharedXAxisBundledCourseSubtitle": "În grup", "demoFadeThroughAlbumsDestination": "Albume", "demoSharedXAxisDesignCourseTitle": "Design", "demoSharedXAxisIllustrationCourseTitle": "Ilustrații", "demoSharedXAxisBusinessCourseTitle": "Afaceri", "demoSharedXAxisArtsAndCraftsCourseTitle": "Artă și artizanat", "demoMotionPlaceholderSubtitle": "Text secundar", "demoFadeScaleAlertDialogCancelButton": "ANULAȚI", "demoFadeScaleAlertDialogHeader": "Casetă de dialog de tip alertă", "demoFadeScaleHideFabButton": "ASCUNDEȚI FAB", "demoFadeScaleShowFabButton": "AFIȘAȚI FAB", "demoFadeScaleShowAlertDialogButton": "AFIȘAȚI MODALUL", "demoFadeScaleDescription": "Modelul de afișare gradată/estompare este folosit pentru elemente IU care se afișează sau dispar în limitele ecranului, de exemplu, o casetă de dialog care dispare treptat în centrul ecranului.", "demoFadeScaleTitle": "Afișare gradată/Estompare", "demoFadeThroughTextPlaceholder": "123 de fotografii", "demoFadeThroughSearchDestination": "Căutați", "demoFadeThroughPhotosDestination": "Fotografii", "demoSharedXAxisCoursePageSubtitle": "Categoriile apar ca grupuri în feed. Puteți modifica oricând această opțiune.", "demoFadeThroughDescription": "Modelul de înlocuire gradată este folosit pentru tranziții între elemente IU între care nu există o legătură strânsă.", "demoFadeThroughTitle": "Înlocuire gradată", "demoSharedZAxisHelpSettingLabel": "Ajutor", "demoMotionSubtitle": "Toate modelele de tranziție predefinite", "demoSharedZAxisNotificationSettingLabel": "Notificări", "demoSharedZAxisProfileSettingLabel": "Profil", "demoSharedZAxisSavedRecipesListTitle": "Rețete salvate", "demoSharedZAxisBeefSandwichRecipeDescription": "Rețetă de sandviș cu vită", "demoSharedZAxisCrabPlateRecipeDescription": "Rețetă cu crab", "demoSharedXAxisCoursePageTitle": "Optimizați traiectoriile", "demoSharedZAxisCrabPlateRecipeTitle": "Crab", "demoSharedZAxisShrimpPlateRecipeDescription": "Rețetă cu creveți", "demoSharedZAxisShrimpPlateRecipeTitle": "Creveți", "demoContainerTransformTypeFadeThrough": "ÎNLOCUIRE GRADATĂ", "demoSharedZAxisDessertRecipeTitle": "Desert", "demoSharedZAxisSandwichRecipeDescription": "Rețetă de sandviș", "demoSharedZAxisSandwichRecipeTitle": "Sandviș", "demoSharedZAxisBurgerRecipeDescription": "Rețetă de burger", "demoSharedZAxisBurgerRecipeTitle": "Burger", "demoSharedZAxisSettingsPageTitle": "Setări", "demoSharedZAxisTitle": "Axa z comună", "demoSharedZAxisPrivacySettingLabel": "Confidențialitate", "demoMotionTitle": "Animație", "demoContainerTransformTitle": "Transformarea containerului", "demoContainerTransformDescription": "Modelul cu transformarea containerului este creat pentru tranziții între elementele IU care includ un container. Acest model creează o legătură vizibilă între două elemente IU.", "demoContainerTransformModalBottomSheetTitle": "Modul Afișare gradată/Estompare", "demoContainerTransformTypeFade": "AFIȘARE GRADATĂ/ESTOMPARE", "demoSharedYAxisAlbumTileDurationUnit": "min.", "demoMotionPlaceholderTitle": "Titlu", "demoSharedXAxisForgotEmailButtonText": "AȚI UITAT ADRESA DE E-MAIL?", "demoMotionSmallPlaceholderSubtitle": "Secundar", "demoMotionDetailsPageTitle": "Pagina cu detalii", "demoMotionListTileTitle": "Articol din listă", "demoSharedAxisDescription": "Modelul cu axă comună este folosit pentru tranziții între elemente IU care au o relație spațială sau de navigare. Acest model folosește o transformare comună pe axa x, y, sau z pentru a evidenția legătura dintre elemente.", "demoSharedXAxisTitle": "Axa x comună", "demoSharedXAxisBackButtonText": "ÎNAPOI", "demoSharedXAxisNextButtonText": "ÎNAINTE", "demoSharedXAxisCulinaryCourseTitle": "Culinar", "githubRepo": "Directorul GitHub {repoName}", "fortnightlyMenuUS": "S.U.A.", "fortnightlyMenuBusiness": "Afaceri", "fortnightlyMenuScience": "Știință", "fortnightlyMenuSports": "Sport", "fortnightlyMenuTravel": "Călătorii", "fortnightlyMenuCulture": "Cultură", "fortnightlyTrendingTechDesign": "Design tehnologic", "rallyBudgetDetailAmountLeft": "Suma rămasă", "fortnightlyHeadlineArmy": "Reformarea armatei de mediu din interior", "fortnightlyDescription": "O aplicație de știri axată pe conținut", "rallyBillDetailAmountDue": "Suma datorată", "rallyBudgetDetailTotalCap": "Limita totală", "rallyBudgetDetailAmountUsed": "Suma cheltuită", "fortnightlyTrendingHealthcareRevolution": "Revoluția în sănătate", "fortnightlyMenuFrontPage": "Prima pagină", "fortnightlyMenuWorld": "În lume", "rallyBillDetailAmountPaid": "Suma plătită", "fortnightlyMenuPolitics": "Politică", "fortnightlyHeadlineBees": "Numărul albinelor este în scădere", "fortnightlyHeadlineGasoline": "Viitorul benzinei", "fortnightlyTrendingGreenArmy": "Armata de mediu", "fortnightlyHeadlineFeminists": "Feministele devin partizane", "fortnightlyHeadlineFabrics": "Designerii creează materiale futuriste cu ajutorul tehnologiei", "fortnightlyHeadlineStocks": "Întrucât cotațiile bursiere stagnează, mulți se orientează spre cursul valutar", "fortnightlyTrendingReform": "Reformă", "fortnightlyMenuTech": "Tehnologie", "fortnightlyHeadlineWar": "Poporul american divizat în timpul războiului", "fortnightlyHeadlineHealthcare": "Revoluția silențioasă, dar remarcabilă, din domeniul sănătății", "fortnightlyLatestUpdates": "Cele mai recente actualizări", "fortnightlyTrendingStocks": "Acțiuni", "rallyBillDetailTotalAmount": "Suma totală", "demoCupertinoPickerDateTime": "Data și ora", "signIn": "CONECTAȚI-VĂ", "dataTableRowWithSugar": "{value} cu zahăr", "dataTableRowApplePie": "Plăcintă cu mere", "dataTableRowDonut": "Gogoașă", "dataTableRowHoneycomb": "Fagure de miere", "dataTableRowLollipop": "Acadea", "dataTableRowJellyBean": "Jeleu", "dataTableRowGingerbread": "Turtă dulce", "dataTableRowCupcake": "Brioșă", "dataTableRowEclair": "Ecler", "dataTableRowIceCreamSandwich": "Sandviș cu înghețată", "dataTableRowFrozenYogurt": "Iaurt înghețat", "dataTableColumnIron": "Fier (%)", "dataTableColumnCalcium": "Calciu (%)", "dataTableColumnSodium": "Sodiu (mg)", "demoTimePickerTitle": "Selector de oră", "demo2dTransformationsResetTooltip": "Resetați transformările", "dataTableColumnFat": "Grăsimi (g)", "dataTableColumnCalories": "Calorii", "dataTableColumnDessert": "Desert (o porție)", "cardsDemoTravelDestinationLocation1": "Thanjavur, Tamil Nadu", "demoTimePickerDescription": "Afișează o casetă de dialog cu un selector de oră pentru design material.", "demoPickersShowPicker": "AFIȘAȚI SELECTORUL", "demoTabsScrollingTitle": "Derulantă", "demoTabsNonScrollingTitle": "Nederulantă", "craneHours": "{hours,plural,=1{1 h}few{{hours} h}other{{hours} de h}}", "craneMinutes": "{minutes,plural,=1{1 min.}few{{minutes} min.}other{{minutes} de min.}}", "craneFlightDuration": "{hoursShortForm} {minutesShortForm}", "dataTableHeader": "Nutriție", "demoDatePickerTitle": "Selector de dată", "demoPickersSubtitle": "Selecția pentru dată și oră", "demoPickersTitle": "Selectori", "demo2dTransformationsEditTooltip": "Editați fila", "demoDataTableDescription": "Tabelele de date afișează informații sub formă de grilă, cu rânduri și coloane. Acestea organizează informațiile astfel încât să fie ușor de consultat, pentru ca utilizatorii să poată căuta modele și statistici.", "demo2dTransformationsDescription": "Atingeți pentru a edita filele și folosiți gesturi pentru a deplasa cadrul. Trageți pentru a deplasa, ciupiți pentru a mări sau micșora, rotiți cu două degete. Apăsați butonul de resetare pentru a reveni la orientarea inițială.", "demo2dTransformationsSubtitle": "Deplasați, măriți/micșorați, rotiți", "demo2dTransformationsTitle": "Transformări 2D", "demoCupertinoTextFieldPIN": "PIN", "demoCupertinoTextFieldDescription": "Într-un câmp de text, utilizatorul poate să introducă text folosind o tastatură hardware sau o tastatură de pe ecran.", "demoCupertinoTextFieldSubtitle": "Câmpuri de text în stil iOS", "demoCupertinoTextFieldTitle": "Câmpuri de text", "demoDatePickerDescription": "Afișează o casetă de dialog cu un selector de dată pentru design material.", "demoCupertinoPickerTime": "Ora", "demoCupertinoPickerDate": "Data", "demoCupertinoPickerTimer": "Temporizator", "demoCupertinoPickerDescription": "Widget pentru selectorul în stil iOS care poate fi folosit pentru a selecta șirurile, datele, orele sau data și ora.", "demoCupertinoPickerSubtitle": "Selectoare de stil iOS", "demoCupertinoPickerTitle": "Selectori", "dataTableRowWithHoney": "{value} cu miere", "cardsDemoTravelDestinationCity2": "Chettinad", "bannerDemoResetText": "Resetați bannerul", "bannerDemoMultipleText": "Mai multe acțiuni", "bannerDemoLeadingText": "Pictograma Principal", "dismiss": "ÎNCHIDEȚI", "cardsDemoTappable": "Poate fi atins", "cardsDemoSelectable": "Poate fi selectat (apăsare lungă)", "cardsDemoExplore": "Explorați", "cardsDemoExploreSemantics": "Explorați {destinationName}", "cardsDemoShareSemantics": "Trimiteți {destinationName}", "cardsDemoTravelDestinationTitle1": "Top 10 orașe de vizitat în Tamil Nadu", "cardsDemoTravelDestinationDescription1": "Numărul 10", "cardsDemoTravelDestinationCity1": "Thanjavur", "dataTableColumnProtein": "Proteine (g)", "cardsDemoTravelDestinationTitle2": "Artizani din India de Sud", "cardsDemoTravelDestinationDescription2": "Țesători de mătase", "bannerDemoText": "Parola a fost actualizată pe celălalt dispozitiv. Conectați-vă din nou.", "cardsDemoTravelDestinationLocation2": "Sivaganga, Tamil Nadu", "cardsDemoTravelDestinationTitle3": "Templul Brihadisvara", "cardsDemoTravelDestinationDescription3": "Temple", "demoBannerTitle": "Banner", "demoBannerSubtitle": "Afișează un banner într-o listă", "demoBannerDescription": "Bannerul afișează un mesaj succint important și acțiuni pe care le pot face utilizatorii (inclusiv închiderea bannerului). Pentru închiderea acestuia este necesară o acțiune din partea utilizatorului.", "demoCardTitle": "Carduri", "demoCardSubtitle": "Carduri de bază cu colțuri rotunjite", "demoCardDescription": "Cardul este o bucată de material folosită pentru a prezenta informații conexe, de exemplu, un album, o locație geografică, o masă, date de contact etc.", "demoDataTableTitle": "Tabele de date", "demoDataTableSubtitle": "Rânduri și coloane cu informații", "dataTableColumnCarbs": "Carbohidrați (g)", "placeTanjore": "Tanjore", "demoGridListsTitle": "Liste grilă", "placeFlowerMarket": "Piață de flori", "placeBronzeWorks": "Obiecte din bronz", "placeMarket": "Piață", "placeThanjavurTemple": "Templul Thanjavur", "placeSaltFarm": "Fermă de sare", "placeScooters": "Scutere", "placeSilkMaker": "Producător de mătase", "placeLunchPrep": "Prepararea mesei de prânz", "placeBeach": "Plajă", "placeFisherman": "Pescar", "demoMenuSelected": "Selectat: {value}", "demoMenuRemove": "Eliminați", "demoMenuGetLink": "Obțineți linkul", "demoMenuShare": "Trimiteți", "demoBottomAppBarSubtitle": "Afișează navigarea și acțiunile în partea de jos", "demoMenuAnItemWithASectionedMenu": "Element cu meniu cu secțiuni", "demoMenuADisabledMenuItem": "Element de meniu dezactivat", "demoLinearProgressIndicatorTitle": "Indicator de progres liniar", "demoMenuContextMenuItemOne": "Elementul de meniu contextual unu", "demoMenuAnItemWithASimpleMenu": "Element cu meniu simplu", "demoCustomSlidersTitle": "Glisoare personalizate", "demoMenuAnItemWithAChecklistMenu": "Element cu meniu cu listă de verificare", "demoCupertinoActivityIndicatorTitle": "Indicator de activitate", "demoCupertinoActivityIndicatorSubtitle": "Indicatori de activitate în stil iOS", "demoCupertinoActivityIndicatorDescription": "Indicator de activitate în stil iOS care se rotește spre dreapta.", "demoCupertinoNavigationBarTitle": "Bară de navigare", "demoCupertinoNavigationBarSubtitle": "Bară de navigare în stil iOS", "demoCupertinoNavigationBarDescription": "Bară de navigare în stil iOS. Bara de navigare este o bară de instrumente formată cel puțin dintr-un titlu de pagină plasat în centru.", "demoCupertinoPullToRefreshTitle": "Trageți pentru a actualiza", "demoCupertinoPullToRefreshSubtitle": "Setarea Trageți pentru a actualiza în stil iOS", "demoCupertinoPullToRefreshDescription": "Widget care implementează setarea pentru conținut Trageți pentru a actualiza în stil iOS.", "demoProgressIndicatorTitle": "Indicatori de progres", "demoProgressIndicatorSubtitle": "Liniar, circular, nedeterminat", "demoCircularProgressIndicatorTitle": "Indicator de progres circular", "demoCircularProgressIndicatorDescription": "Indicator de progres circular pentru design material, care se rotește pentru a indica faptul că aplicația este ocupată.", "demoMenuFour": "Patru", "demoLinearProgressIndicatorDescription": "Indicator de progres liniar pentru design material, numit și bară de progres.", "demoTooltipTitle": "Baloane explicative", "demoTooltipSubtitle": "Scurt mesaj afișat la apăsarea lungă sau la plasarea cursorului", "demoTooltipDescription": "Baloanele explicative afișează etichete cu text care explică funcția unui buton sau altă acțiune din interfața de utilizare. Baloanele explicative afișează text informativ atunci când utilizatorii plasează cursorul pe, selectează sau apasă lung un element.", "demoTooltipInstructions": "Apăsați lung sau plasați cursorul pentru a afișa balonul explicativ.", "placeChennai": "Chennai", "demoMenuChecked": "Bifat: {value}", "placeChettinad": "Chettinad", "demoMenuPreview": "Previzualizați", "demoBottomAppBarTitle": "Bara de aplicații din partea de jos", "demoBottomAppBarDescription": "Barele de aplicații din partea de jos oferă acces la un panou de navigare din partea de jos și la maximum patru acțiuni, între care butonul flotant pentru acțiuni.", "bottomAppBarNotch": "Decupaj", "bottomAppBarPosition": "Poziția butonului flotant pentru acțiuni", "bottomAppBarPositionDockedEnd": "Andocat – Capătul din dreapta", "bottomAppBarPositionDockedCenter": "Andocat – Centru", "bottomAppBarPositionFloatingEnd": "Flotant – Capătul din dreapta", "bottomAppBarPositionFloatingCenter": "Flotant – Centru", "demoSlidersEditableNumericalValue": "Valoare numerică ce poate fi editată", "demoGridListsSubtitle": "Aspectul rândurilor și al coloanelor", "demoGridListsDescription": "Listele grilă sunt ideale pentru prezentarea datelor omogene, de obicei, a imaginilor. Fiecare element al unei liste grilă se numește secțiune.", "demoGridListsImageOnlyTitle": "Numai imagine", "demoGridListsHeaderTitle": "Cu antet", "demoGridListsFooterTitle": "Cu subsol", "demoSlidersTitle": "Glisoare", "demoSlidersSubtitle": "Widgeturi pentru selectarea unei valori prin glisare", "demoSlidersDescription": "Glisoarele reflectă un interval de valori de-a lungul unei bare, din care utilizatorii pot selecta o singură valoare. Acestea sunt ideale pentru reglarea setărilor, precum volumul, luminozitatea sau aplicarea filtrelor de imagine.", "demoRangeSlidersTitle": "Glisoare pentru interval", "demoRangeSlidersDescription": "Glisoarele reprezintă un interval de valori de-a lungul unei bare. Acestea pot avea pictograme la ambele capete ale barei, care reflectă un interval de valori. Sunt ideale pentru reglarea setărilor, precum volumul, luminozitatea sau aplicarea filtrelor de imagine.", "demoMenuAnItemWithAContextMenuButton": "Element cu meniu contextual", "demoCustomSlidersDescription": "Glisoarele reprezintă un interval de valori de-a lungul unei bare, din care utilizatorii pot selecta o singură valoare sau un interval de valori. Glisoarele pot să fie personalizate sau să aibă teme.", "demoSlidersContinuousWithEditableNumericalValue": "Continuu cu valoare numerică ce poate fi editată", "demoSlidersDiscrete": "Distinct", "demoSlidersDiscreteSliderWithCustomTheme": "Glisor distinct cu temă personalizată", "demoSlidersContinuousRangeSliderWithCustomTheme": "Glisor cu interval continuu și temă personalizată", "demoSlidersContinuous": "Continuu", "placePondicherry": "Pondicherry", "demoMenuTitle": "Meniu", "demoContextMenuTitle": "Meniu contextual", "demoSectionedMenuTitle": "Meniu cu secțiuni", "demoSimpleMenuTitle": "Meniu simplu", "demoChecklistMenuTitle": "Meniu cu listă de verificare", "demoMenuSubtitle": "Butoane de meniu și meniuri simple", "demoMenuDescription": "Meniul afișează o listă de opțiuni pe o suprafață temporară. Acestea apar atunci când utilizatorii interacționează cu un buton, o acțiune sau altă comandă.", "demoMenuItemValueOne": "Elementul de meniu unu", "demoMenuItemValueTwo": "Elementul de meniu doi", "demoMenuItemValueThree": "Elementul de meniu trei", "demoMenuOne": "Unu", "demoMenuTwo": "Doi", "demoMenuThree": "Trei", "demoMenuContextMenuItemThree": "Elementul de meniu contextual trei", "demoCupertinoSwitchSubtitle": "Comutator în stil iOS", "demoSnackbarsText": "Aceasta este o bară de notificare.", "demoCupertinoSliderSubtitle": "Glisor în stil iOS", "demoCupertinoSliderDescription": "Glisorul poate fi folosit pentru a selecta dintr-un set de valori continue sau distincte.", "demoCupertinoSliderContinuous": "Continuă: {value}", "demoCupertinoSliderDiscrete": "Distinctă: {value}", "demoSnackbarsAction": "Ați apăsat pe acțiunea din bara de notificare.", "backToGallery": "Înapoi la Galerie", "demoCupertinoTabBarTitle": "Bară cu file", "demoCupertinoSwitchDescription": "Comutatorul este folosit pentru a comuta între stările activat și dezactivat ale unei setări.", "demoSnackbarsActionButtonLabel": "ACȚIUNE", "cupertinoTabBarProfileTab": "Profil", "demoSnackbarsButtonLabel": "AFIȘEAZĂ O BARĂ DE NOTIFICARE", "demoSnackbarsDescription": "Barele de notificare informează utilizatorii cu privire la un proces care a fost sau va fi executat de o aplicație. Acestea se afișează temporar în partea de jos a ecranului. Ele nu ar trebui să întrerupă experiența utilizatorului și nu necesită date introduse de utilizator pentru a dispărea.", "demoSnackbarsSubtitle": "Barele de notificare afișează mesaje în partea de jos a ecranului", "demoSnackbarsTitle": "Bare de notificare", "demoCupertinoSliderTitle": "Glisor", "cupertinoTabBarChatTab": "Chat", "cupertinoTabBarHomeTab": "Acasă", "demoCupertinoTabBarDescription": "Bară cu file de navigare din partea de jos în stil iOS. Afișează mai multe file, dintre care una este activă, în mod prestabilit prima filă.", "demoCupertinoTabBarSubtitle": "Bară cu file din partea de jos în stil iOS", "demoOptionsFeatureTitle": "Afișați opțiunile", "demoOptionsFeatureDescription": "Atingeți aici pentru a vedea opțiunile disponibile pentru această demonstrație.", "demoCodeViewerCopyAll": "COPIAȚI TOT", "shrineScreenReaderRemoveProductButton": "Eliminați {product}", "shrineScreenReaderProductAddToCart": "Adăugați în coșul de cumpărături", "shrineScreenReaderCart": "{quantity,plural,=0{Coș de cumpărături, niciun articol}=1{Coș de cumpărături, un articol}few{Coș de cumpărături, {quantity} articole}other{Coș de cumpărături, {quantity} de articole}}", "demoCodeViewerFailedToCopyToClipboardMessage": "Nu s-a copiat în clipboard: {error}", "demoCodeViewerCopiedToClipboardMessage": "S-a copiat în clipboard.", "craneSleep8SemanticLabel": "Ruine mayașe pe o stâncă, deasupra unei plaje", "craneSleep4SemanticLabel": "Hotel pe malul unui lac, în fața munților", "craneSleep2SemanticLabel": "Cetatea Machu Picchu", "craneSleep1SemanticLabel": "Castel într-un peisaj de iarnă, cu conifere", "craneSleep0SemanticLabel": "Bungalouri pe malul apei", "craneFly13SemanticLabel": "Piscină pe malul mării, cu palmieri", "craneFly12SemanticLabel": "Piscină cu palmieri", "craneFly11SemanticLabel": "Far din cărămidă pe malul mării", "craneFly10SemanticLabel": "Turnurile moscheii Al-Azhar la apus", "craneFly9SemanticLabel": "Bărbat care se sprijină de o mașină albastră veche", "craneFly8SemanticLabel": "Supertree Grove", "craneEat9SemanticLabel": "Tejghea de cafenea cu dulciuri", "craneEat2SemanticLabel": "Burger", "craneFly5SemanticLabel": "Hotel pe malul unui lac, în fața munților", "demoSelectionControlsSubtitle": "Casete de selectare, butoane radio și comutatoare", "craneEat10SemanticLabel": "Femeie care ține un sandviș imens cu pastramă", "craneFly4SemanticLabel": "Bungalouri pe malul apei", "craneEat7SemanticLabel": "Intrare în brutărie", "craneEat6SemanticLabel": "Preparat cu creveți", "craneEat5SemanticLabel": "Locuri dintr-un restaurant artistic", "craneEat4SemanticLabel": "Desert cu ciocolată", "craneEat3SemanticLabel": "Taco coreean", "craneFly3SemanticLabel": "Cetatea Machu Picchu", "craneEat1SemanticLabel": "Bar gol cu scaune de tip bufet", "craneEat0SemanticLabel": "Pizza într-un cuptor pe lemne", "craneSleep11SemanticLabel": "Clădirea zgârie-nori Taipei 101", "craneSleep10SemanticLabel": "Turnurile moscheii Al-Azhar la apus", "craneSleep9SemanticLabel": "Far din cărămidă pe malul mării", "craneEat8SemanticLabel": "Platou cu languste", "craneSleep7SemanticLabel": "Apartamente colorate în Riberia Square", "craneSleep6SemanticLabel": "Piscină cu palmieri", "craneSleep5SemanticLabel": "Cort pe un câmp", "settingsButtonCloseLabel": "Închideți setările", "demoSelectionControlsCheckboxDescription": "Cu ajutorul casetelor de selectare, utilizatorii pot să aleagă mai multe opțiuni dintr-un set. Valoarea normală a unei casete este true sau false. O casetă cu trei stări poate avea și valoarea null.", "settingsButtonLabel": "Setări", "demoListsTitle": "Liste", "demoListsSubtitle": "Aspecte de liste derulante", "demoListsDescription": "Un singur rând cu înălțime fixă, care conține de obicei text și o pictogramă la început sau la sfârșit.", "demoOneLineListsTitle": "Un rând", "demoTwoLineListsTitle": "Două rânduri", "demoListsSecondary": "Text secundar", "demoSelectionControlsTitle": "Comenzi de selectare", "craneFly7SemanticLabel": "Muntele Rushmore", "demoSelectionControlsCheckboxTitle": "Casetă de selectare", "craneSleep3SemanticLabel": "Bărbat care se sprijină de o mașină albastră veche", "demoSelectionControlsRadioTitle": "Radio", "demoSelectionControlsRadioDescription": "Cu ajutorul butoanelor radio, utilizatorul poate să selecteze o singură opțiune dintr-un set. Folosiți-le pentru selectări exclusive dacă credeți că utilizatorul trebuie să vadă toate opțiunile disponibile alăturate.", "demoSelectionControlsSwitchTitle": "Comutatoare", "demoSelectionControlsSwitchDescription": "Comutatoarele activat / dezactivat schimbă starea unei opțiuni pentru setări. Opțiunea controlată de comutator și starea acesteia trebuie să fie indicate clar de eticheta inline corespunzătoare.", "craneFly0SemanticLabel": "Castel într-un peisaj de iarnă, cu conifere", "craneFly1SemanticLabel": "Cort pe un câmp", "craneFly2SemanticLabel": "Steaguri de rugăciune în fața unui munte înzăpezit", "craneFly6SemanticLabel": "Imagine aeriană cu Palacio de Bellas Artes", "rallySeeAllAccounts": "Vedeți toate conturile", "rallyBillAmount": "Factura {billName} în valoare de {amount} este scadentă pe {date}.", "shrineTooltipCloseCart": "Închideți coșul de cumpărături", "shrineTooltipCloseMenu": "Închideți meniul", "shrineTooltipOpenMenu": "Deschideți meniul", "shrineTooltipSettings": "Setări", "shrineTooltipSearch": "Căutați", "demoTabsDescription": "Filele organizează conținutul pe ecrane, în seturi de date diferite și în alte interacțiuni.", "demoTabsSubtitle": "File cu vizualizări care se derulează independent", "demoTabsTitle": "File", "rallyBudgetAmount": "Bugetul pentru {budgetName} cu {amountUsed} cheltuiți din {amountTotal}, {amountLeft} rămași", "shrineTooltipRemoveItem": "Eliminați articolul", "rallyAccountAmount": "Contul {accountName} {accountNumber} cu {amount}.", "rallySeeAllBudgets": "Vedeți toate bugetele", "rallySeeAllBills": "Vedeți toate facturile", "craneFormDate": "Selectați data", "craneFormOrigin": "Alegeți originea", "craneFly2": "Valea Khumbu, Nepal", "craneFly3": "Machu Picchu, Peru", "craneFly4": "Malé, Maldive", "craneFly5": "Vitznau, Elveția", "craneFly6": "Ciudad de Mexico, Mexic", "craneFly7": "Muntele Rushmore, Statele Unite", "settingsTextDirectionLocaleBased": "În funcție de codul local", "craneFly9": "Havana, Cuba", "craneFly10": "Cairo, Egipt", "craneFly11": "Lisabona, Portugalia", "craneFly12": "Napa, Statele Unite", "craneFly13": "Bali, Indonezia", "craneSleep0": "Malé, Maldive", "craneSleep1": "Aspen, Statele Unite", "craneSleep2": "Machu Picchu, Peru", "demoCupertinoSegmentedControlTitle": "Control segmentat", "craneSleep4": "Vitznau, Elveția", "craneSleep5": "Big Sur, Statele Unite", "craneSleep6": "Napa, Statele Unite", "craneSleep7": "Porto, Portugalia", "craneSleep8": "Tulum, Mexic", "craneEat5": "Seoul, Coreea de Sud", "demoChipTitle": "Cipuri", "demoChipSubtitle": "Elemente compacte care reprezintă o intrare, un atribut sau o acțiune", "demoActionChipTitle": "Cip de acțiune", "demoActionChipDescription": "Cipurile de acțiune sunt un set de opțiuni care declanșează o acțiune legată de conținutul principal. Ele trebuie să apară dinamic și contextual într-o IU.", "demoChoiceChipTitle": "Cip de opțiune", "demoChoiceChipDescription": "Cipurile de opțiune reprezintă o singură opțiune dintr-un set. Ele conțin categorii sau texte descriptive asociate.", "demoFilterChipTitle": "Cip de filtrare", "demoFilterChipDescription": "Cipurile de filtrare folosesc etichete sau termeni descriptivi pentru a filtra conținutul.", "demoInputChipTitle": "Cip de intrare", "demoInputChipDescription": "Cipurile de intrare reprezintă informații complexe, cum ar fi o entitate (o persoană, o locație sau un obiect) sau un text conversațional, în formă compactă.", "craneSleep9": "Lisabona, Portugalia", "craneEat10": "Lisabona, Portugalia", "demoCupertinoSegmentedControlDescription": "Folosit pentru a alege opțiuni care se exclud reciproc. Când selectați o opțiune din controlul segmentat, celelalte opțiuni sunt deselectate.", "chipTurnOnLights": "Porniți luminile", "chipSmall": "Mic", "chipMedium": "Mediu", "chipLarge": "Mare", "chipElevator": "Lift", "chipWasher": "Mașină de spălat", "chipFireplace": "Șemineu", "chipBiking": "Ciclism", "craneFormDiners": "Clienți", "rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{Creșteți-vă potențiala deducere fiscală! Atribuiți categorii unei tranzacții neatribuite.}few{Creșteți-vă potențiala deducere fiscală! Atribuiți categorii pentru {count} tranzacții neatribuite.}other{Creșteți-vă potențiala deducere fiscală! Atribuiți categorii pentru {count} de tranzacții neatribuite.}}", "craneFormTime": "Selectați ora", "craneFormLocation": "Selectați o locație", "craneFormTravelers": "Călători", "craneEat8": "Atlanta, Statele Unite", "craneFormDestination": "Alegeți destinația", "craneFormDates": "Selectați datele", "craneFly": "AVIOANE", "craneSleep": "SOMN", "craneEat": "MÂNCARE", "craneFlySubhead": "Explorați zborurile după destinație", "craneSleepSubhead": "Explorați proprietățile după destinație", "craneEatSubhead": "Explorați restaurantele după destinație", "craneFlyStops": "{numberOfStops,plural,=0{Fără escală}=1{O escală}few{{numberOfStops} escale}other{{numberOfStops} de escale}}", "craneSleepProperties": "{totalProperties,plural,=0{Nicio proprietate disponibilă}=1{O proprietate disponibilă}few{{totalProperties} proprietăți disponibile}other{{totalProperties} de proprietăți disponibile}}", "craneEatRestaurants": "{totalRestaurants,plural,=0{Niciun restaurant}=1{Un restaurant}few{{totalRestaurants} restaurante}other{{totalRestaurants} de restaurante}}", "craneFly0": "Aspen, Statele Unite", "demoCupertinoSegmentedControlSubtitle": "Control segmentat în stil iOS", "craneSleep10": "Cairo, Egipt", "craneEat9": "Madrid, Spania", "craneFly1": "Big Sur, Statele Unite", "craneEat7": "Nashville, Statele Unite", "craneEat6": "Seattle, Statele Unite", "craneFly8": "Singapore", "craneEat4": "Paris, Franța", "craneEat3": "Portland, Statele Unite", "craneEat2": "Córdoba, Argentina", "craneEat1": "Dallas, Statele Unite", "craneEat0": "Napoli, Italia", "craneSleep11": "Taipei, Taiwan", "craneSleep3": "Havana, Cuba", "shrineLogoutButtonCaption": "DECONECTAȚI-VĂ", "rallyTitleBills": "FACTURI", "rallyTitleAccounts": "CONTURI", "shrineProductVagabondSack": "Geantă Vagabond", "rallyAccountDetailDataInterestYtd": "Dobânda de la începutul anului până în prezent", "shrineProductWhitneyBelt": "Curea Whitney", "shrineProductGardenStrand": "Toron pentru grădină", "shrineProductStrutEarrings": "Cercei Strut", "shrineProductVarsitySocks": "Șosete Varsity", "shrineProductWeaveKeyring": "Breloc împletit", "shrineProductGatsbyHat": "Pălărie Gatsby", "shrineProductShrugBag": "Geantă Shrug", "shrineProductGiltDeskTrio": "Birou trio aurit", "shrineProductCopperWireRack": "Rastel din sârmă de cupru", "shrineProductSootheCeramicSet": "Set de ceramică Soothe", "shrineProductHurrahsTeaSet": "Set de ceai Hurrahs", "shrineProductBlueStoneMug": "Cană Blue Stone", "shrineProductRainwaterTray": "Colector pentru apă de ploaie", "shrineProductChambrayNapkins": "Șervete din Chambray", "shrineProductSucculentPlanters": "Ghivece pentru plante suculente", "shrineProductQuartetTable": "Masă Quartet", "shrineProductKitchenQuattro": "Bucătărie Quattro", "shrineProductClaySweater": "Pulover Clay", "shrineProductSeaTunic": "Tunică Sea", "shrineProductPlasterTunic": "Tunică Plaster", "rallyBudgetCategoryRestaurants": "Restaurante", "shrineProductChambrayShirt": "Cămașă din Chambray", "shrineProductSeabreezeSweater": "Pulover Seabreeze", "shrineProductGentryJacket": "Jachetă Gentry", "shrineProductNavyTrousers": "Pantaloni bleumarin", "shrineProductWalterHenleyWhite": "Walter Henley (alb)", "shrineProductSurfAndPerfShirt": "Bluză Surf and perf", "shrineProductGingerScarf": "Fular Ginger", "shrineProductRamonaCrossover": "Geantă crossover Ramona", "shrineProductClassicWhiteCollar": "Guler alb clasic", "shrineProductSunshirtDress": "Rochie Sunshirt", "rallyAccountDetailDataInterestRate": "Rata dobânzii", "rallyAccountDetailDataAnnualPercentageYield": "Randamentul anual procentual", "rallyAccountDataVacation": "Vacanță", "shrineProductFineLinesTee": "Tricou cu dungi subțiri", "rallyAccountDataHomeSavings": "Economii pentru casă", "rallyAccountDataChecking": "Curent", "rallyAccountDetailDataInterestPaidLastYear": "Dobânda plătită anul trecut", "rallyAccountDetailDataNextStatement": "Următorul extras", "rallyAccountDetailDataAccountOwner": "Proprietarul contului", "rallyBudgetCategoryCoffeeShops": "Cafenele", "rallyBudgetCategoryGroceries": "Produse alimentare", "shrineProductCeriseScallopTee": "Tricou cu guler rotund Cerise", "rallyBudgetCategoryClothing": "Îmbrăcăminte", "rallySettingsManageAccounts": "Gestionați conturi", "rallyAccountDataCarSavings": "Economii pentru mașină", "rallySettingsTaxDocuments": "Documente fiscale", "rallySettingsPasscodeAndTouchId": "Parolă și Touch ID", "rallySettingsNotifications": "Notificări", "rallySettingsPersonalInformation": "Informații cu caracter personal", "rallySettingsPaperlessSettings": "Setări fără hârtie", "rallySettingsFindAtms": "Găsiți bancomate", "rallySettingsHelp": "Ajutor", "rallySettingsSignOut": "Deconectați-vă", "rallyAccountTotal": "Total", "rallyBillsDue": "Data scadentă", "rallyBudgetLeft": "Stânga", "rallyAccounts": "Conturi", "rallyBills": "Facturi", "rallyBudgets": "Bugete", "rallyAlerts": "Alerte", "rallySeeAll": "VEDEȚI-LE PE TOATE", "rallyFinanceLeft": "STÂNGA", "rallyTitleOverview": "PREZENTARE GENERALĂ", "shrineProductShoulderRollsTee": "Tricou cu mâneci îndoite", "shrineNextButtonCaption": "ÎNAINTE", "rallyTitleBudgets": "BUGETE", "rallyTitleSettings": "SETĂRI", "rallyLoginLoginToRally": "Conectați-vă la Rally", "rallyLoginNoAccount": "Nu aveți un cont?", "rallyLoginSignUp": "ÎNSCRIEȚI-VĂ", "rallyLoginUsername": "Nume de utilizator", "rallyLoginPassword": "Parolă", "rallyLoginLabelLogin": "Conectați-vă", "rallyLoginRememberMe": "Ține-mă minte", "rallyLoginButtonLogin": "CONECTAȚI-VĂ", "rallyAlertsMessageHeadsUpShopping": "Atenție, ați folosit {percent} din bugetul de cumpărături pentru luna aceasta.", "rallyAlertsMessageSpentOnRestaurants": "Săptămâna aceasta ați cheltuit {amount} în restaurante.", "rallyAlertsMessageATMFees": "Luna aceasta ați cheltuit {amount} pentru comisioanele de la bancomat", "rallyAlertsMessageCheckingAccount": "Felicitări! Contul dvs. curent este cu {percent} mai bogat decât luna trecută.", "shrineMenuCaption": "MENIU", "shrineCategoryNameAll": "TOATE", "shrineCategoryNameAccessories": "ACCESORII", "shrineCategoryNameClothing": "ÎMBRĂCĂMINTE", "shrineCategoryNameHome": "CASĂ", "shrineLoginUsernameLabel": "Nume de utilizator", "shrineLoginPasswordLabel": "Parolă", "shrineCancelButtonCaption": "ANULAȚI", "shrineCartTaxCaption": "Taxe:", "shrineCartPageCaption": "COȘ DE CUMPĂRĂTURI", "shrineProductQuantity": "Cantitate: {quantity}", "shrineProductPrice": "x {price}", "shrineCartItemCount": "{quantity,plural,=0{NICIUN ARTICOL}=1{UN ARTICOL}few{{quantity} ARTICOLE}other{{quantity} ARTICOLE}}", "shrineCartClearButtonCaption": "GOLIȚI COȘUL", "shrineCartTotalCaption": "TOTAL", "shrineCartSubtotalCaption": "Subtotal:", "shrineCartShippingCaption": "Expediere:", "shrineProductGreySlouchTank": "Maiou lejer gri", "shrineProductStellaSunglasses": "Ochelari de soare Stella", "shrineProductWhitePinstripeShirt": "Cămașă cu dungi fine albe", "demoTextFieldWhereCanWeReachYou": "La ce număr de telefon vă putem contacta?", "settingsTextDirectionLTR": "De la stânga la dreapta", "settingsTextScalingLarge": "Mare", "demoBottomSheetHeader": "Antet", "demoBottomSheetItem": "Articol {value}", "demoBottomTextFieldsTitle": "Câmpuri de text", "demoTextFieldTitle": "Câmpuri de text", "demoTextFieldSubtitle": "Un singur rând de text și cifre editabile", "demoTextFieldDescription": "Câmpurile de text le dau utilizatorilor posibilitatea de a introduce text pe o interfață de utilizare. Acestea apar de obicei în forme și casete de dialog.", "demoTextFieldShowPasswordLabel": "Afișați parola", "demoTextFieldHidePasswordLabel": "Ascundeți parola", "demoTextFieldFormErrors": "Remediați erorile evidențiate cu roșu înainte de trimitere.", "demoTextFieldNameRequired": "Numele este obligatoriu.", "demoTextFieldOnlyAlphabeticalChars": "Introduceți numai caractere alfabetice.", "demoTextFieldEnterUSPhoneNumber": "(###) ###–#### – introduceți un număr de telefon din S.U.A.", "demoTextFieldEnterPassword": "Introduceți o parolă.", "demoTextFieldPasswordsDoNotMatch": "Parolele nu corespund", "demoTextFieldWhatDoPeopleCallYou": "Cum vă spun utilizatorii?", "demoTextFieldNameField": "Nume*", "demoBottomSheetButtonText": "AFIȘAȚI FOAIA DIN PARTEA DE JOS", "demoTextFieldPhoneNumber": "Număr de telefon*", "demoBottomSheetTitle": "Foaia din partea de jos", "demoTextFieldEmail": "E-mail", "demoTextFieldTellUsAboutYourself": "Povestiți-ne despre dvs. (de exemplu, scrieți cu ce vă ocupați sau ce pasiuni aveți)", "demoTextFieldKeepItShort": "Folosiți un text scurt, aceasta este o demonstrație.", "starterAppGenericButton": "BUTON", "demoTextFieldLifeStory": "Povestea vieții", "demoTextFieldSalary": "Salariu", "demoTextFieldUSD": "USD", "demoTextFieldNoMoreThan": "Nu mai mult de 8 caractere.", "demoTextFieldPassword": "Parolă*", "demoTextFieldRetypePassword": "Introduceți din nou parola*", "demoTextFieldSubmit": "TRIMITEȚI", "demoBottomNavigationSubtitle": "Navigarea în partea de jos cu vizualizări cu suprapunere atenuată", "demoBottomSheetAddLabel": "Adăugați", "demoBottomSheetModalDescription": "Foaia modală din partea de jos este o alternativă la un meniu sau la o casetă de dialog și împiedică interacțiunea utilizatorului cu restul aplicației.", "demoBottomSheetModalTitle": "Foaia modală din partea de jos", "demoBottomSheetPersistentDescription": "Foaia persistentă din partea de jos afișează informații care completează conținutul principal al aplicației. Foaia persistentă din partea de jos rămâne vizibilă chiar dacă utilizatorul interacționează cu alte părți alte aplicației.", "demoBottomSheetPersistentTitle": "Foaia persistentă din partea de jos", "demoBottomSheetSubtitle": "Foile persistente și modale din partea de jos", "demoTextFieldNameHasPhoneNumber": "Numărul de telefon al persoanei de contact {name} este {phoneNumber}", "buttonText": "BUTON", "demoTypographyDescription": "Definiții pentru stilurile tipografice diferite, care se găsesc în ghidul Design material.", "demoTypographySubtitle": "Toate stilurile de text predefinite", "demoTypographyTitle": "Tipografie", "demoFullscreenDialogDescription": "Proprietatea casetei de dialog pe ecran complet arată dacă pagina următoare este o casetă de dialog modală pe ecran complet", "demoFlatButtonDescription": "Butonul plat reacționează vizibil la apăsare, dar nu se ridică. Folosiți butoanele plate în bare de instrumente, casete de dialog și în linie cu chenarul interior.", "demoBottomNavigationDescription": "Barele de navigare din partea de jos afișează între trei și cinci destinații în partea de jos a ecranului. Fiecare destinație este reprezentată de o pictogramă și o etichetă cu text opțională. Când atinge o pictogramă de navigare din partea de jos, utilizatorul este direcționat la destinația de navigare principală asociată pictogramei respective.", "demoBottomNavigationSelectedLabel": "Etichetă selectată", "demoBottomNavigationPersistentLabels": "Etichete persistente", "starterAppDrawerItem": "Articol {value}", "demoTextFieldRequiredField": "* indică un câmp obligatoriu", "demoBottomNavigationTitle": "Navigarea în partea de jos", "settingsLightTheme": "Luminoasă", "settingsTheme": "Temă", "settingsPlatformIOS": "iOS", "settingsPlatformAndroid": "Android", "settingsTextDirectionRTL": "De la dreapta la stânga", "settingsTextScalingHuge": "Foarte mare", "cupertinoButton": "Buton", "settingsTextScalingNormal": "Normal", "settingsTextScalingSmall": "Mic", "settingsSystemDefault": "Sistem", "settingsTitle": "Setări", "rallyDescription": "O aplicație pentru finanțe personale", "aboutDialogDescription": "Ca să vedeți codul sursă al acestei aplicații, accesați {repoLink}.", "bottomNavigationCommentsTab": "Comentarii", "starterAppGenericBody": "Corp", "starterAppGenericHeadline": "Titlu", "starterAppGenericSubtitle": "Subtitlu", "starterAppGenericTitle": "Titlu", "starterAppTooltipSearch": "Căutați", "starterAppTooltipShare": "Trimiteți", "starterAppTooltipFavorite": "Preferat", "starterAppTooltipAdd": "Adăugați", "bottomNavigationCalendarTab": "Calendar", "starterAppDescription": "Un aspect adaptabil pentru Starter", "starterAppTitle": "Aplicația Starter", "aboutFlutterSamplesRepo": "Directorul GitHub cu exemple din Flutter", "bottomNavigationContentPlaceholder": "Substituent pentru fila {title}", "bottomNavigationCameraTab": "Cameră foto", "bottomNavigationAlarmTab": "Alarmă", "bottomNavigationAccountTab": "Cont", "demoTextFieldYourEmailAddress": "Adresa dvs. de e-mail", "demoToggleButtonDescription": "Butoanele de comutare pot fi folosite pentru a grupa opțiunile similare. Pentru a evidenția grupuri de butoane de comutare similare, este necesar ca un grup să aibă un container comun.", "colorsGrey": "GRI", "colorsBrown": "MARO", "colorsDeepOrange": "PORTOCALIU INTENS", "colorsOrange": "PORTOCALIU", "colorsAmber": "CHIHLIMBAR", "colorsYellow": "GALBEN", "colorsLime": "VERDE DESCHIS", "colorsLightGreen": "VERDE DESCHIS", "colorsGreen": "VERDE", "homeHeaderGallery": "Galerie", "homeHeaderCategories": "Categorii", "shrineDescription": "O aplicație de vânzare cu amănuntul la modă", "craneDescription": "O aplicație pentru călătorii personalizate", "homeCategoryReference": "STILURI ȘI ALTELE", "demoInvalidURL": "Nu s-a putut afișa adresa URL:", "demoOptionsTooltip": "Opțiuni", "demoInfoTooltip": "Informații", "demoCodeTooltip": "Cod demo", "demoDocumentationTooltip": "Documentație API", "demoFullscreenTooltip": "Ecran complet", "settingsTextScaling": "Scalarea textului", "settingsTextDirection": "Direcția textului", "settingsLocale": "Cod local", "settingsPlatformMechanics": "Mecanica platformei", "settingsDarkTheme": "Întunecată", "settingsSlowMotion": "Slow motion", "settingsAbout": "Despre galeria Flutter", "settingsFeedback": "Trimiteți feedback", "settingsAttribution": "Conceput de TOASTER în Londra", "demoButtonTitle": "Butoane", "demoButtonSubtitle": "Text, în relief, conturate și altele", "demoFlatButtonTitle": "Buton plat", "demoRaisedButtonDescription": "Butoanele ridicate conferă dimensiune aspectelor în mare parte plate. Acestea evidențiază funcții în spații pline sau ample.", "demoRaisedButtonTitle": "Buton ridicat", "demoOutlineButtonTitle": "Buton cu contur", "demoOutlineButtonDescription": "Butoanele cu contur devin opace și se ridică la apăsare. Sunt de multe ori asociate cu butoane ridicate, pentru a indica o acțiune secundară alternativă.", "demoToggleButtonTitle": "Butoane de comutare", "colorsTeal": "TURCOAZ", "demoFloatingButtonTitle": "Buton de acțiune flotant", "demoFloatingButtonDescription": "Butonul de acțiune flotant este un buton cu pictogramă circulară plasat deasupra conținutului, care promovează o acțiune principală în aplicație.", "demoDialogTitle": "Casete de dialog", "demoDialogSubtitle": "Simple, pentru alerte și pe ecran complet", "demoAlertDialogTitle": "Alertă", "demoAlertDialogDescription": "Caseta de dialog pentru alerte informează utilizatorul despre situații care necesită confirmare. Caseta de dialog pentru alerte are un titlu opțional și o listă de acțiuni opțională.", "demoAlertTitleDialogTitle": "Alertă cu titlu", "demoSimpleDialogTitle": "Simplă", "demoSimpleDialogDescription": "Caseta de dialog simplă îi oferă utilizatorului posibilitatea de a alege dintre mai multe opțiuni. Caseta de dialog simplă are un titlu opțional, afișat deasupra opțiunilor.", "demoFullscreenDialogTitle": "Ecran complet", "demoCupertinoButtonsTitle": "Butoane", "demoCupertinoButtonsSubtitle": "Butoane în stil iOS", "demoCupertinoButtonsDescription": "Buton în stil iOS. Preia text și/sau o pictogramă care se estompează sau se accentuează la atingere. Poate să aibă un fundal opțional.", "demoCupertinoAlertsTitle": "Alerte", "demoCupertinoAlertsSubtitle": "Casete de dialog pentru alerte în stil iOS", "demoCupertinoAlertTitle": "Alertă", "demoCupertinoAlertDescription": "Caseta de dialog pentru alerte informează utilizatorul despre situații care necesită confirmare. Caseta de dialog pentru alerte are un titlu opțional, conținut opțional și o listă de acțiuni opțională. Titlul este afișat deasupra conținutului, iar acțiunile sub conținut.", "demoCupertinoAlertWithTitleTitle": "Alertă cu titlu", "demoCupertinoAlertButtonsTitle": "Alertă cu butoane", "demoCupertinoAlertButtonsOnlyTitle": "Doar butoane pentru alerte", "demoCupertinoActionSheetTitle": "Foaie de acțiune", "demoCupertinoActionSheetDescription": "Foaia de acțiune este un tip de alertă care îi oferă utilizatorului două sau mai multe opțiuni asociate contextului actual. Foaia de acțiune poate să conțină un titlu, un mesaj suplimentar și o listă de acțiuni.", "demoColorsTitle": "Culori", "demoColorsSubtitle": "Toate culorile predefinite", "demoColorsDescription": "Constante pentru culori și mostre de culori care reprezintă paleta de culori pentru Design material.", "buttonTextEnabled": "ENABLED", "buttonTextDisabled": "DISABLED", "buttonTextCreate": "Creați", "dialogSelectedOption": "Ați selectat: „{value}”", "dialogDiscardTitle": "Ștergeți mesajul nefinalizat?", "dialogLocationTitle": "Folosiți serviciul de localizare Google?", "dialogLocationDescription": "Acceptați ajutor de la Google pentru ca aplicațiile să vă detecteze locația. Aceasta înseamnă că veți trimite la Google date anonime privind locațiile, chiar și când nu rulează nicio aplicație.", "dialogCancel": "ANULAȚI", "dialogDiscard": "RENUNȚAȚI", "dialogDisagree": "NU SUNT DE ACORD", "dialogAgree": "SUNT DE ACORD", "dialogSetBackup": "Setați contul pentru backup", "colorsBlueGrey": "GRI-ALBĂSTRUI", "dialogShow": "AFIȘEAZĂ CASETA DE DIALOG", "dialogFullscreenTitle": "Casetă de dialog pe ecran complet", "dialogFullscreenSave": "SALVAȚI", "dialogFullscreenDescription": "Exemplu de casetă de dialog pe ecran complet", "cupertinoButtonEnabled": "Enabled", "cupertinoButtonDisabled": "Disabled", "cupertinoButtonWithBackground": "Cu fundal", "cupertinoAlertCancel": "Anulați", "cupertinoAlertDiscard": "Renunțați", "cupertinoAlertLocationTitle": "Permiteți ca Maps să vă acceseze locația când folosiți aplicația?", "cupertinoAlertLocationDescription": "Locația dvs. actuală va fi afișată pe hartă și folosită pentru indicații de orientare, rezultate ale căutării din apropiere și duratele de călătorie estimate.", "cupertinoAlertAllow": "Permiteți", "cupertinoAlertDontAllow": "Nu permiteți", "cupertinoAlertFavoriteDessert": "Alegeți desertul preferat", "cupertinoAlertDessertDescription": "Alegeți desertul preferat din lista de mai jos. Opțiunea va fi folosită pentru a personaliza lista de restaurante sugerate din zona dvs.", "cupertinoAlertCheesecake": "Cheesecake", "cupertinoAlertTiramisu": "Tiramisu", "cupertinoAlertApplePie": "Plăcintă cu mere", "cupertinoAlertChocolateBrownie": "Negresă cu ciocolată", "cupertinoShowAlert": "Afișează alerta", "colorsRed": "ROȘU", "colorsPink": "ROZ", "colorsPurple": "MOV", "colorsDeepPurple": "MOV INTENS", "colorsIndigo": "INDIGO", "colorsBlue": "ALBASTRU", "colorsLightBlue": "ALBASTRU DESCHIS", "colorsCyan": "CYAN", "dialogAddAccount": "Adăugați un cont", "Gallery": "Galerie", "Categories": "Categorii", "SHRINE": "SHRINE", "Basic shopping app": "Aplicație de bază pentru cumpărături", "RALLY": "RALLY", "CRANE": "CRANE", "Travel app": "Aplicație pentru călătorii", "MATERIAL": "MATERIAL", "CUPERTINO": "CUPERTINO", "REFERENCE STYLES & MEDIA": "STILURI DE REFERINȚĂ ȘI MEDIA" }
gallery/lib/l10n/intl_ro.arb/0
{ "file_path": "gallery/lib/l10n/intl_ro.arb", "repo_id": "gallery", "token_count": 21472 }
814
{ "loading": "لوڈ ہو رہا ہے", "deselect": "غیر منتخب کریں", "select": "منتخب کریں", "selectable": "منتخب کرنے کے قابل (دیر تک دبائیں)", "selected": "منتخب کردہ", "demo": "ڈیمو", "bottomAppBar": "نیچے کا ایپ بار", "notSelected": "منتخب نہیں کیا گیا", "demoCupertinoSearchTextFieldTitle": "ٹیکسٹ تلاش کرنے کا فیلڈ", "demoCupertinoPicker": "منتخب کنندہ", "demoCupertinoSearchTextFieldSubtitle": "iOS طرز کا ٹیکسٹ تلاش کرنے کا فیلڈ", "demoCupertinoSearchTextFieldDescription": "ایک ٹیکسٹ تلاش کرنے کا فیلڈ جو صارف کو ٹیکسٹ درج کر کے تلاش کرنے کی اجازت دیتا ہے اور جو تجاویز پیش اور فلٹر کر سکتا ہے۔", "demoCupertinoSearchTextFieldPlaceholder": "کچھ ٹیکسٹ درج کریں", "demoCupertinoScrollbarTitle": "اسکرول بار", "demoCupertinoScrollbarSubtitle": "iOS طرز کا اسکرول بار", "demoCupertinoScrollbarDescription": "ہوم پیج میں دکھائی دینے والا اسکرول بار", "demoTwoPaneItem": "آئٹم {value}", "demoTwoPaneList": "فہرست", "demoTwoPaneFoldableLabel": "فولڈ ہونے والے", "demoTwoPaneSmallScreenLabel": "چھوٹی اسکرین", "demoTwoPaneSmallScreenDescription": "چھوٹی اسکرین والے آلے پر TwoPane اس طرح برتاؤ کرتا ہے۔", "demoTwoPaneTabletLabel": "ٹیبلیٹ / ڈیسک ٹاپ", "demoTwoPaneTabletDescription": "ٹیبلیٹ یا ڈیسک ٹاپ کی طرح بڑی اسکرین پر TwoPane اس طرح برتاؤ کرتا ہے۔", "demoTwoPaneTitle": "TwoPane", "demoTwoPaneSubtitle": "فولڈ ہونے والی، بڑی اور چھوٹی اسکرینز پر ریسپانسیو لے آؤٹس", "splashSelectDemo": "ڈیمو منتخب کریں", "demoTwoPaneFoldableDescription": "فولڈ ہونے والے آلے پر TwoPane اس طرح برتاؤ کرتا ہے۔", "demoTwoPaneDetails": "تفصیلات", "demoTwoPaneSelectItem": "ایک آئٹم منتخب کریں", "demoTwoPaneItemDetails": "آئٹم {value} تفصیلات", "demoCupertinoContextMenuActionText": "سیاق و سباق کا مینیو دیکھنے کے لیے فلوٹر لوگو کو تھپتھپائیں اور دبائے رکھیں۔", "demoCupertinoContextMenuDescription": "ایک iOS طرز کا فُل اسکرین سیاق و سباق کا مینیو جو اس وقت ظاہر ہوتا ہے جب کسی عنصر کو لانگ پریس کیا جاتا ہے۔", "demoAppBarTitle": "ایپ بار", "demoAppBarDescription": "ایپ بار موجودہ اسکرین سے متعلق مواد اور کارروائیاں فراہم کرتا ہے۔ یہ برانڈنگ، اسکرین کے عنوانات، نیویگیشن اور کارروائیوں کے لیے استعمال ہوتا ہے", "demoDividerTitle": "تقسیم کار", "demoDividerSubtitle": "تقسیم کار ایک پتلی لکیر ہے جو مواد کو فہرستوں اور لے آؤٹس میں گروپ بند کرتی ہے۔", "demoDividerDescription": "تقسیم کاران فہرستوں، درازوں اور کسی اور جگہ میں مواد کو الگ کرنے کے لیے استعمال کیے جا سکتے ہیں۔", "demoVerticalDividerTitle": "عمودی تقسیم کار", "demoCupertinoContextMenuTitle": "سیاق و سباق کا مینیو", "demoCupertinoContextMenuSubtitle": "iOS طرز کے سیاق و سباق کا مینیو", "demoAppBarSubtitle": "موجودہ اسکرین سے متعلق معلومات اور کارروائیاں ڈسپلے کرتا ہے", "demoCupertinoContextMenuActionOne": "کارروائی ایک", "demoCupertinoContextMenuActionTwo": "کارروائی دو", "demoDateRangePickerDescription": "مٹیریل ڈیزائن کی تاریخ کی حد منتخب کنندہ پر مشتمل ڈائیلاگ دکھاتا ہے۔", "demoDateRangePickerTitle": "تاریخ کی حد منتخب کنندہ", "demoNavigationDrawerUserName": "صارف کا نام", "demoNavigationDrawerUserEmail": "[email protected]", "demoNavigationDrawerText": "دراز دیکھنے کے لئے کونے سے سوائپ کریں یا اوپری بائیں آئیکن پر تھپتھپائیں", "demoNavigationRailTitle": "نیوی گیشن ریل", "demoNavigationRailSubtitle": "ایپ کے اندر موجود نیوی گیشن ریل کو ڈسپلے کیا جا رہا ہے", "demoNavigationRailDescription": "ملاحظات کی کم تعداد کے درمیان جو کہ عام طور پر تین اور پانچ کے بیچ ہوتے ہیں پر نیوی گیٹ کرنے کیلئے ایپ کے دائیں یا بائیں جانب قابل ڈسپلے مٹیریل ویجیٹ۔", "demoNavigationRailFirst": "پہلا", "demoNavigationDrawerTitle": "نیویگیشن دراز", "demoNavigationRailThird": "تیسرا", "replyStarredLabel": "ستارہ لگا ہوا", "demoTextButtonDescription": "ٹیکسٹ بٹن، جب دبایا جاتا ہے تو سیاہی کی چھلکیاں دکھاتا ہے، لیکن اوپر نہیں جاتا ہے۔ پیڈنگ کے ساتھ ان لائن اور ڈائیلاگز میں ٹیکسٹ بٹنز، ٹول بارز پر استعمال کریں", "demoElevatedButtonTitle": "ابھرا ہوا بٹن", "demoElevatedButtonDescription": "ابھرے ہوئے بٹنز زیادہ تر ہموار لے آؤٹس میں ڈائمینشن شامل کرتے ہیں۔ یہ مصروف یا وسیع جگہوں والے فنکشنز پر زور دیتے ہیں۔", "demoOutlinedButtonTitle": "آؤٹ لائن والا بٹن", "demoOutlinedButtonDescription": "آؤٹ لائن والے بٹنز کے دبائے جانے پر وہ دھندلے اور بلند ہو جاتے ہیں۔ یہ متبادل، ثانوی کاروائی کی نشاندہی کرنے کے لیے اکثر ابھرے ہوئے بٹنز کے ساتھ جوڑے جاتے ہیں۔", "demoContainerTransformDemoInstructions": "کارڈز، فہرستیں اور FAB", "demoNavigationDrawerSubtitle": "ایپ بار کے اندر موجود دراز کو ڈسپلے کیا جا رہا ہے", "replyDescription": "ایک موثر، مرتکز ای میل ایپ", "demoNavigationDrawerDescription": "مٹیریل ڈیزائن پینل جو ایپلیکیشن میں نیوی گیشن لنکس دکھانے کے لیے اسکرین کے کونے سے افقی طور پر سلائیڈ ہوتا ہے۔", "replyDraftsLabel": "مسودے", "demoNavigationDrawerToPageOne": "پہلا آئٹم", "replyInboxLabel": "ان باکس", "demoSharedXAxisDemoInstructions": "آگے اور پیچھے جانے کے بٹنز", "replySpamLabel": "اسپام", "replyTrashLabel": "کوڑے دان", "replySentLabel": "بھیج دیا گیا", "demoNavigationRailSecond": "دوسرا", "demoNavigationDrawerToPageTwo": "دوسرا آئٹم", "demoFadeScaleDemoInstructions": "ماڈل اور FAB", "demoFadeThroughDemoInstructions": "نیچے نیویگیشن", "demoSharedZAxisDemoInstructions": "ترتیبات کے آئیکن کا بٹن", "demoSharedYAxisDemoInstructions": "\"حال ہی میں چلائے گئے\" کے لحاظ سے ترتیب دیں", "demoTextButtonTitle": "ٹیکسٹ بٹن", "demoSharedZAxisBeefSandwichRecipeTitle": "بیف سینڈوچ", "demoSharedZAxisDessertRecipeDescription": "میٹھے کا نسخہ", "demoSharedYAxisAlbumTileSubtitle": "فنکار", "demoSharedYAxisAlbumTileTitle": "البم", "demoSharedYAxisRecentSortTitle": "حال ہی میں چلائے گئے", "demoSharedYAxisAlphabeticalSortTitle": "A-Z", "demoSharedYAxisAlbumCount": "268 البمز", "demoSharedYAxisTitle": "مشترکہ y-axis", "demoSharedXAxisCreateAccountButtonText": "اکاؤنٹ بنائیں", "demoFadeScaleAlertDialogDiscardButton": "مسترد کریں", "demoSharedXAxisSignInTextFieldLabel": "ای میل یا فون نمبر", "demoSharedXAxisSignInSubtitleText": "اپنے اکاؤنٹ کے ساتھ سائن ان کریں", "demoSharedXAxisSignInWelcomeText": "آداب David Park", "demoSharedXAxisIndividualCourseSubtitle": "انفرادی طور پر دکھائے گئے", "demoSharedXAxisBundledCourseSubtitle": "بنڈل کردہ", "demoFadeThroughAlbumsDestination": "البمز", "demoSharedXAxisDesignCourseTitle": "ڈیزائن", "demoSharedXAxisIllustrationCourseTitle": "خاکہ", "demoSharedXAxisBusinessCourseTitle": "کاروبار", "demoSharedXAxisArtsAndCraftsCourseTitle": "آرٹس اور کرافٹس", "demoMotionPlaceholderSubtitle": "ثانوی ٹیکسٹ", "demoFadeScaleAlertDialogCancelButton": "منسوخ کریں", "demoFadeScaleAlertDialogHeader": "الرٹ ڈائیلاگ", "demoFadeScaleHideFabButton": "FAB چھپائیں", "demoFadeScaleShowFabButton": "FAB دکھائیں", "demoFadeScaleShowAlertDialogButton": "ماڈل دکھائیں", "demoFadeScaleDescription": "فیڈ پیٹرن کا استعمال UI عناصر کے لیے کیا جاتا ہے جو اسکرین کی حدود کے اندر داخل یا خارج ہوتا ہے جیسے کہ ایک ڈائیلاگ جو اسکرین کے بیچ میں فیڈ ہو جاتا ہے۔", "demoFadeScaleTitle": "فیڈ", "demoFadeThroughTextPlaceholder": "123 تصاویر", "demoFadeThroughSearchDestination": "تلاش", "demoFadeThroughPhotosDestination": "تصاویر", "demoSharedXAxisCoursePageSubtitle": "بنڈل شدہ زمرے آپ کی فیڈ میں گروپس کے بطور ظاہر ہوتے ہیں۔ آپ بعد میں کبھی بھی اسے تبدیل کر سکتے ہیں۔", "demoFadeThroughDescription": "فیڈ تھرو پیٹرن کا استعمال UI عناصر کے درمیان ٹرانزیشن کے لیے کیا جاتا ہے جس کا ایک دوسرے کے ساتھ مضبوط تعلق نہیں ہوتا ہے۔", "demoFadeThroughTitle": "فیڈ تھرو", "demoSharedZAxisHelpSettingLabel": "مدد", "demoMotionSubtitle": "پہلے سے متعینہ ٹرانزٹ کے سبھی پیٹرنز", "demoSharedZAxisNotificationSettingLabel": "اطلاعات", "demoSharedZAxisProfileSettingLabel": "پروفائل", "demoSharedZAxisSavedRecipesListTitle": "محفوظ کردہ نسخے", "demoSharedZAxisBeefSandwichRecipeDescription": "بیف سینڈوچ کا نسخہ", "demoSharedZAxisCrabPlateRecipeDescription": "کیکڑا بنانے کا نسخہ", "demoSharedXAxisCoursePageTitle": "اپنے کورسز کو اسٹریم لائن کریں", "demoSharedZAxisCrabPlateRecipeTitle": "کیکڑا", "demoSharedZAxisShrimpPlateRecipeDescription": "جھینگا بنانے کا نسخہ", "demoSharedZAxisShrimpPlateRecipeTitle": "جھینگا", "demoContainerTransformTypeFadeThrough": "فیڈ تھرو", "demoSharedZAxisDessertRecipeTitle": "میٹھا", "demoSharedZAxisSandwichRecipeDescription": "سینڈوچ کا نسخہ", "demoSharedZAxisSandwichRecipeTitle": "سینڈوچ", "demoSharedZAxisBurgerRecipeDescription": "برگر کا نسخہ", "demoSharedZAxisBurgerRecipeTitle": "برگر", "demoSharedZAxisSettingsPageTitle": "ترتیبات", "demoSharedZAxisTitle": "مشترکہ z-axis", "demoSharedZAxisPrivacySettingLabel": "رازداری", "demoMotionTitle": "موشَن", "demoContainerTransformTitle": "کنٹینر ٹرانسفارم", "demoContainerTransformDescription": "کنٹینر ٹرانسفارم پیٹرن UI عناصر کے درمیان ٹرانزٹزیشن کے لیے ڈیزائن کیا گیا ہے جس میں کنٹینر شامل ہے۔ یہ پیٹرن دو UI عناصر کے درمیان نظر آنے والا کنکشن تخلیق کرتا ہے", "demoContainerTransformModalBottomSheetTitle": "فیڈ موڈ", "demoContainerTransformTypeFade": "فیڈ", "demoSharedYAxisAlbumTileDurationUnit": "منٹ", "demoMotionPlaceholderTitle": "عنوان", "demoSharedXAxisForgotEmailButtonText": "ای میل بھول گئے؟", "demoMotionSmallPlaceholderSubtitle": "ثانوی", "demoMotionDetailsPageTitle": "تفصیلات کا صفحہ", "demoMotionListTileTitle": "فہرست آئٹم", "demoSharedAxisDescription": "مشترکہ محور کے پیٹرن کا استعمال UI عناصر کے درمیان ٹرانزیشن کے لیے کیا جاتا ہے جس میں مکانی یا نیویگیشنل رشتہ ہوتا ہے۔ یہ پیٹرن عناصر کے درمیان تعلق کو دوبارہ تقویت دینے کے لیے x، ‫y یا z کے محور پر مشترکہ ٹرانسفارمیشن کا استعمال کرتا ہے۔", "demoSharedXAxisTitle": "مشترکہ x-axis", "demoSharedXAxisBackButtonText": "پیچھے", "demoSharedXAxisNextButtonText": "آگے", "demoSharedXAxisCulinaryCourseTitle": "فن طباخی", "githubRepo": "GitHub ذخیرہ {repoName}", "fortnightlyMenuUS": "US", "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": "اصلاح", "fortnightlyMenuTech": "ٹیکنالوجی", "fortnightlyHeadlineWar": "جنگ کے دوران منقسم امریکیوں کی زندگیاں", "fortnightlyHeadlineHealthcare": "صحت کی دیکھ ریکھ میں پرسکون لیکن طاقتور انقلاب", "fortnightlyLatestUpdates": "تازہ ترین اپ ڈیٹس", "fortnightlyTrendingStocks": "اسٹاکس", "rallyBillDetailTotalAmount": "کل تعداد", "demoCupertinoPickerDateTime": "تاریخ اور وقت", "signIn": "سائن ان کریں", "dataTableRowWithSugar": "شکر کے ساتھ {value}", "dataTableRowApplePie": "Apple pie", "dataTableRowDonut": "Donut", "dataTableRowHoneycomb": "Honeycomb", "dataTableRowLollipop": "Lollipop", "dataTableRowJellyBean": "Jelly bean", "dataTableRowGingerbread": "Gingerbread", "dataTableRowCupcake": "Cupcake", "dataTableRowEclair": "Eclair", "dataTableRowIceCreamSandwich": "آئس کریم سینڈویچ", "dataTableRowFrozenYogurt": "منجمد دہی", "dataTableColumnIron": "آئرن (%)", "dataTableColumnCalcium": "کیلشیم (%)", "dataTableColumnSodium": "سوڈیم (ملی گرام)", "demoTimePickerTitle": "وقت منتخب کنندہ", "demo2dTransformationsResetTooltip": "ٹرانسفارمیشنز ری سیٹ کریں", "dataTableColumnFat": "چربی ( گرام)", "dataTableColumnCalories": "کیلوریز", "dataTableColumnDessert": "میوہ شیرینی بعد طعام (1 شخص کے لیے)", "cardsDemoTravelDestinationLocation1": "تھنجاور، تمل ناڈو", "demoTimePickerDescription": "مٹیریل ڈیزائن کا وقت منتخب کنندہ پر مشتمل ڈائیلاگ دکھاتا ہے۔", "demoPickersShowPicker": "منتخب کنندہ دکھائیں", "demoTabsScrollingTitle": "اسکرولنگ", "demoTabsNonScrollingTitle": "غیر اسکرولنگ", "craneHours": "{hours,plural,=1{1گھنٹہ}other{{hours} گھنٹے}}", "craneMinutes": "{minutes,plural,=1{1منٹ}other{{minutes}منٹ}}", "craneFlightDuration": "{hoursShortForm} {minutesShortForm}", "dataTableHeader": "غذائیت", "demoDatePickerTitle": "تاریخ منتخب کنندہ", "demoPickersSubtitle": "تاریخ اور وقت کا انتخاب", "demoPickersTitle": "تاریخ اور وقت منتخب کرنے والے ٹولز", "demo2dTransformationsEditTooltip": "ٹائل میں ترمیم کریں", "demoDataTableDescription": "ڈیٹا ٹیبلز قطاروں اور کالمز کے گرڈ جیسے فارمیٹ میں معلومات دکھاتے ہیں۔ وہ معلومات کو اس طرح منظم کرتے ہیں کہ جس سے اسکین کرنا آسان ہو، تاکہ صارفین پیٹرنز اور بصیرتوں کو تلاش کر سکیں۔", "demo2dTransformationsDescription": "ٹائلز میں ترمیم کرنے کے ليے تھپتھپائیں اور منظر کے ارد گرد گھومنے کے ليے اشاروں کا استعمال کریں۔ پین کرنے کے ليے گھسیٹیں، زوم کرنے کے ليے پِنچ کریں، دو انگلیوں سے گھمائیں۔ شروعاتی سمت بندی پر واپس جانے کے لیے ری سیٹ بٹن دبائیں۔", "demo2dTransformationsSubtitle": "پین کریں، زوم کریں، گھمائیں", "demo2dTransformationsTitle": "2D ٹرانسفارمیشنز", "demoCupertinoTextFieldPIN": "PIN", "demoCupertinoTextFieldDescription": "ٹیکسٹ کا فیلڈ صارف کو ہارڈویئر کی بورڈ کے ساتھ یا اسکرین کی بورڈ کے ساتھ ٹیکسٹ داخل کرنے دیتا ہے۔", "demoCupertinoTextFieldSubtitle": "iOS کی طرز پر ٹیکسٹ کے فیلڈز", "demoCupertinoTextFieldTitle": "متن کی فیلڈز", "demoDatePickerDescription": "مٹیریل ڈیزائن کی تاریخ منتخب کنندہ پر مشتمل ڈائیلاگ دکھاتا ہے۔", "demoCupertinoPickerTime": "وقت", "demoCupertinoPickerDate": "تاریخ", "demoCupertinoPickerTimer": "ٹائمر", "demoCupertinoPickerDescription": "iOS کی طرز پر منتخب کرنے والا ویجیٹ جسے اسٹرنگز، تواریخ، اوقات یا تاریخ اور وقت دونوں کو منتخب کرنے کے لیے استعمال کیا جا سکتا ہے۔", "demoCupertinoPickerSubtitle": "iOS طرز کے منتخب کنندگان", "demoCupertinoPickerTitle": "تاریخ اور وقت منتخب کرنے والے ٹولز", "dataTableRowWithHoney": "شہد کے ساتھ {value}", "cardsDemoTravelDestinationCity2": "چیتیناد", "bannerDemoResetText": "بینر ری سیٹ کریں", "bannerDemoMultipleText": "متعدد کارروائیاں", "bannerDemoLeadingText": "اشاراتی آئیکن", "dismiss": "مسترد کریں", "cardsDemoTappable": "تھپتھپانے کے قابل بٹن", "cardsDemoSelectable": "منتخب کرنے کے قابل (دیر تک دبائیں)", "cardsDemoExplore": "دریافت کریں", "cardsDemoExploreSemantics": "دریافت کریں {destinationName}", "cardsDemoShareSemantics": "اشتراک کریں {destinationName}", "cardsDemoTravelDestinationTitle1": "تمل ناڈو میں گھومنے کے لیے سرفہرست 10 شہر", "cardsDemoTravelDestinationDescription1": "نمبر 10", "cardsDemoTravelDestinationCity1": "تھنجاور", "dataTableColumnProtein": "پروٹین (گرام)", "cardsDemoTravelDestinationTitle2": "جنوبی ہندوستان کے کاریگران", "cardsDemoTravelDestinationDescription2": "ریشم سپنّرز", "bannerDemoText": "آپ کا پاس ورڈ آپ کے دوسرے آلہ پر اپ ڈیٹ کیا گیا تھا۔ براہ کرم دوبارہ سائن ان کریں۔", "cardsDemoTravelDestinationLocation2": "سیوا گنگا، تمل ناڈو", "cardsDemoTravelDestinationTitle3": "بریہڈیسوارا مندر", "cardsDemoTravelDestinationDescription3": "مندرات", "demoBannerTitle": "بینر", "demoBannerSubtitle": "فہرست کے اندر بینر ڈسپلے کرنا", "demoBannerDescription": "بینر ایک اہم، جامع پیغام ڈسپلے کرتا ہے اور صارفین کو خطاب کرنے (یا بینر کو برخاست کرنے کے لیے کارروائیاں فراہم کرتا ہے)۔ اس کو مسترد کرنے کے لئے صارف کی کارروائی ضروری ہے۔", "demoCardTitle": "کارڈز", "demoCardSubtitle": "گول کونے والے بیس لائن کارڈز", "demoCardDescription": "کارڈ کچھ متعلقہ معلومات کی نمائندگی کے لئے استعمال ہونے والے مواد کی ایک شیٹ ہے، مثال کے طور پر ایک البم، جغرافیائی مقام، کھانے، رابطے کی تفصیلات وغیرہ۔", "demoDataTableTitle": "ڈیٹا کے ٹیبلز", "demoDataTableSubtitle": "معلومات کی قطاریں اور کالمز", "dataTableColumnCarbs": "کاربوہائیڈریٹس (گرام)", "placeTanjore": "تنجور", "demoGridListsTitle": "گرڈ کی فہرستیں", "placeFlowerMarket": "پھولوں کی مارکیٹ", "placeBronzeWorks": "کانسی کے کام", "placeMarket": "مارکیٹ", "placeThanjavurTemple": "تنجاور مندر", "placeSaltFarm": "نمک کا کھیت", "placeScooters": "اسکوٹرز", "placeSilkMaker": "ریشم بنانے والا", "placeLunchPrep": "لنچ کی تیاری", "placeBeach": "ساحل", "placeFisherman": "ماہی گیر", "demoMenuSelected": "منتخب کردہ: {value}", "demoMenuRemove": "ہٹائیں", "demoMenuGetLink": "لنک حاصل کریں", "demoMenuShare": "اشتراک کریں", "demoBottomAppBarSubtitle": "سب سے نیچے نیویگیشن اور کارروائیاں ڈسپلے کرتا ہے", "demoMenuAnItemWithASectionedMenu": "سیکشن کردہ مینیو والا ایک آئٹم", "demoMenuADisabledMenuItem": "مینیو آئٹم غیر فعال کر دیا گیا", "demoLinearProgressIndicatorTitle": "لینئیر پیش رفت کا انڈیکیٹر", "demoMenuContextMenuItemOne": "سیاق و سباق کے مینیو والا پہلا آئٹم", "demoMenuAnItemWithASimpleMenu": "آسان مینیو والا ایک آئٹم", "demoCustomSlidersTitle": "حسب ضرورت سلائیڈرز", "demoMenuAnItemWithAChecklistMenu": "چیک لسٹ مینیو والا ایک آئٹم", "demoCupertinoActivityIndicatorTitle": "سرگرمی انڈیکیٹر", "demoCupertinoActivityIndicatorSubtitle": "iOS طرز کے سرگرمی انڈیکیٹرز", "demoCupertinoActivityIndicatorDescription": "ایک iOS طرز کے سرگرمی انڈیکیٹرز جو گھڑی وار گھومتے ہیں۔", "demoCupertinoNavigationBarTitle": "نیویگیشن بار", "demoCupertinoNavigationBarSubtitle": "iOS طرز کا نیویگیشن بار", "demoCupertinoNavigationBarDescription": "ایک iOS طرز کا نیویگیشن بار۔ نیویگیشن بار ایک ٹول بار ہے جو ٹول بار کے وسط میں کم سے کم ایک صفحہ کے عنوان پر مشتمل ہوتا ہے۔", "demoCupertinoPullToRefreshTitle": "ریفریش کرنے کے لیے کھینچیں", "demoCupertinoPullToRefreshSubtitle": "iOS طرز والا کنٹرول کو ریفریش کرنے کے لیے کھینچیں", "demoCupertinoPullToRefreshDescription": "مواد کے کنٹرول کو ریفریش کرنے کے لیے ویجیٹ iOS طرز کو نافذ کر رہا ہے۔", "demoProgressIndicatorTitle": "پیش رفت کے انڈیکیٹرز", "demoProgressIndicatorSubtitle": "لینئیر، سرکلر، غیر متعین", "demoCircularProgressIndicatorTitle": "سرکلر پیش رفت کا انڈیکیٹر", "demoCircularProgressIndicatorDescription": "مٹیریل ڈیزائن سرکلر پیش رفت کا انڈیکیٹر، جو ایپلیکیشن کو مصروف بتانے کے لیے گھومتا ہے۔", "demoMenuFour": "چار", "demoLinearProgressIndicatorDescription": "مٹیریل ڈیزائن لینئیر پیش رفت کا انڈیکیٹر، جسے پیش رفت بار کے نام سے بھی جانا جاتا ہے۔", "demoTooltipTitle": "ٹول ٹپس", "demoTooltipSubtitle": "لانگ پریس یا کرسر گھمانے پر مختصر پیغام ڈسپلے کر دیا گیا", "demoTooltipDescription": "ٹول ٹپس ٹیکسٹ لیبلز فراہم کرتے ہیں جو بٹن کے فنکشن یا دوسرے صارف انٹرفیس کارروائی کی وضاحت کرنے میں مدد کرتے ہیں۔ جب صارف کسی عنصر کے اوپر کرسر گھماتے ہیں، اس پر فوکس کرتے ہیں یا لانگ پریس کرتے ہیں تب ٹول ٹپس معلوماتی متن کو ڈسپلے کرتی ہیں۔", "demoTooltipInstructions": "ٹول ٹپ کو ڈسپلے کرنے کے لیے لانگ پریس کریں یا اس پر کرسر گھمائیں۔", "placeChennai": "چنئی", "demoMenuChecked": "چیک کردہ: {value}", "placeChettinad": "چیتیناد", "demoMenuPreview": "پیش منظر", "demoBottomAppBarTitle": "نیچے کا ایپ بار", "demoBottomAppBarDescription": "نیچے کی ایپ بارز نیچے کے نیویگیشن دراز اور چار کارروائیوں تک رسائی فراہم کرتی ہیں، اس میں فلوٹنگ کارروائی کا بٹن شامل ہے۔", "bottomAppBarNotch": "نشان", "bottomAppBarPosition": "فلوٹنگ کارروائی کے بٹن کی پوزیشن", "bottomAppBarPositionDockedEnd": "ڈاک سے منسلک کیا گیا - اختتام", "bottomAppBarPositionDockedCenter": "ڈاک سے منسلک کیا گیا - مرکز", "bottomAppBarPositionFloatingEnd": "فلوٹنگ - اختتام", "bottomAppBarPositionFloatingCenter": "فلوٹنگ - مرکز", "demoSlidersEditableNumericalValue": "قابل ترمیم عددی قدر", "demoGridListsSubtitle": "قطار اور کالم کا لے آؤٹ", "demoGridListsDescription": "ایک جیسا ڈیٹا، عموماً تصاویر پیش کرنے کے لیے گرڈ لسٹ سب سے زیادہ مناسب ہیں۔ گرڈ کی فہرست میں موجود ہر آئٹم کو ٹائل کہا جاتا ہے۔", "demoGridListsImageOnlyTitle": "صرف تصویر", "demoGridListsHeaderTitle": "ہیڈر کے ساتھ", "demoGridListsFooterTitle": "فوٹر کے ساتھ", "demoSlidersTitle": "سلائیڈرز", "demoSlidersSubtitle": "سوائپ کر کے قدر منتخب کرنے کے لیے ویجیٹس", "demoSlidersDescription": "سلائیڈرز بار کے ساتھ اقدار کے رینج کی عکاسی کرتے ہیں، جہاں سے صارفین ایک ہی قدر منتخب کر سکتے ہیں۔ یہ والیوم، چمک، یا تصویر کے فلٹرز کا اطلاق کرنے جیسی ترتیبات کو ایڈجسٹ کرنے کے لیے مثالی ہیں۔", "demoRangeSlidersTitle": "رینج سلائیڈرز", "demoRangeSlidersDescription": "سلائیڈرز بار کے ساتھ اقدار کے رینج کی عکاسی کرتے ہیں۔ ان میں بار کے دونوں کناروں پر آئیکنز ہو سکتے ہیں جو اقدار کے رینج کی عکاسی کرتے ہیں۔ یہ والیوم، چمک، یا تصویر کے فلٹرز کا اطلاق کرنے جیسی ترتیبات کو ایڈجسٹ کرنے کے لیے مثالی ہیں۔", "demoMenuAnItemWithAContextMenuButton": "سیاق و سباق کے مینیو والا ایک آئٹم", "demoCustomSlidersDescription": "سلائیڈرز بار کے ساتھ اقدار کے رینج کی عکاسی کرتے ہیں، جہاں سے صارفین ایک ہی قدر یا اقدار کے رینج کو منتخب کر سکتے ہیں۔ ان سلائیڈرز کو تھیم شدہ اور حسب ضرورت بنایا جا سکتا ہے۔", "demoSlidersContinuousWithEditableNumericalValue": "قابل ترمیم عددی قدر کے ساتھ جاری رکھیں", "demoSlidersDiscrete": "علیحدہ", "demoSlidersDiscreteSliderWithCustomTheme": "حسب ضرورت تھیم کے ساتھ علیحدہ سلائیڈر", "demoSlidersContinuousRangeSliderWithCustomTheme": "حسب ضرورت تھیم کے ساتھ مسلسل رینج سلائیڈر", "demoSlidersContinuous": "مسلسل", "placePondicherry": "پانڈچیری", "demoMenuTitle": "مینیو", "demoContextMenuTitle": "سیاق و سباق کا مینیو", "demoSectionedMenuTitle": "سیکشن کردہ مینیو", "demoSimpleMenuTitle": "آسان مینیو", "demoChecklistMenuTitle": "چیک لسٹ مینیو", "demoMenuSubtitle": "مینیو کے بٹنز اور آسان مینیو", "demoMenuDescription": "مینیو عارضی سطح پر انتخابات کی ایک فہرست ڈسپلے کرتا ہے۔ یہ اس وقت ظاہر ہوتے ہیں جب صارفین بٹن، ایکشن یا دیگر کنٹرول کے ساتھ تعامل کرتے ہیں۔", "demoMenuItemValueOne": "پہلا مینیو آئٹم", "demoMenuItemValueTwo": "دوسرا مینیو آئٹم", "demoMenuItemValueThree": "تیسرا مینیو آئٹم", "demoMenuOne": "ایک", "demoMenuTwo": "دو", "demoMenuThree": "تین", "demoMenuContextMenuItemThree": "سیاق و سباق کے مینیو والا تیسرا آئٹم", "demoCupertinoSwitchSubtitle": "iOS طرز کا سوئچ", "demoSnackbarsText": "یہ ایک اسنیک بار ہے۔", "demoCupertinoSliderSubtitle": "iOS طرز کے سلائیڈر", "demoCupertinoSliderDescription": "ایک سلائیڈر مسلسل یا علیحدہ اقدار کے سیٹ سے منتخب کرنے کے ليے استعمال کیا جا سکتا ہے۔", "demoCupertinoSliderContinuous": "مسلسل: {value}", "demoCupertinoSliderDiscrete": "علیحدہ: {value}", "demoSnackbarsAction": "آپ نے اسنیک بار ایکشن دبایا۔", "backToGallery": "گیلری پر واپس جائیں", "demoCupertinoTabBarTitle": "ٹیب بار", "demoCupertinoSwitchDescription": "ایک سوئچ کا استعمال ایک واحد ترتیب میں آن / آف ٹوگل کرنے کے ليے کیا جاتا ہے۔", "demoSnackbarsActionButtonLabel": "ایکشن", "cupertinoTabBarProfileTab": "پروفائل", "demoSnackbarsButtonLabel": "ایک اسنیک بار دکھائیں", "demoSnackbarsDescription": "اسنیک بارز صارفین کو اس کارروائی سے متعلق بتاتے ہیں جو ایک ایپ نے انجام دیا ہے یا انجام دے گا۔ وہ اسکرین کے نچلے حصے کی طرف عارضی طور پر ظاہر ہوتے ہیں۔ انہیں صارف کے تجربے میں مداخلت نہیں کرنی چاہیے، اور انہیں غیر ظاہر کرنے کے ليے صارف کے ان پٹ کی ضرورت نہیں ہے۔", "demoSnackbarsSubtitle": "اسنیک بارز اسکرین کے نچلے حصے میں پیغامات دکھاتے ہیں", "demoSnackbarsTitle": "اسنیک بارز", "demoCupertinoSliderTitle": "سلائیڈر", "cupertinoTabBarChatTab": "چیٹ", "cupertinoTabBarHomeTab": "ہوم", "demoCupertinoTabBarDescription": "ایک iOS طرز کے نیچے والی نیویگیشن ٹیب بار۔ ایک ٹیب کے فعال ہونے کے ساتھ پہلا ٹیب بطور ڈیفالٹ متعدد ٹیبز ڈسپلے کرتا ہے۔", "demoCupertinoTabBarSubtitle": "iOS طرز کے نیچے والی ٹیب بار", "demoOptionsFeatureTitle": "اختیارات دیکھیں", "demoOptionsFeatureDescription": "اس ڈیمو کے ليے دستیاب اختیارات دیکھنے کے ليے یہاں تھپتھپائیں۔", "demoCodeViewerCopyAll": "سبھی کاپی کریں", "shrineScreenReaderRemoveProductButton": "{product} ہٹائیں", "shrineScreenReaderProductAddToCart": "کارٹ میں شامل کریں", "shrineScreenReaderCart": "{quantity,plural,=0{شاپنگ کارٹ، کوئی آئٹم نہیں}=1{شاپنگ کارٹ، 1 آئٹم}other{شاپنگ کارٹ، {quantity} آئٹمز}}", "demoCodeViewerFailedToCopyToClipboardMessage": "کلپ بورڈ پر کاپی کرنے میں ناکام: {error}", "demoCodeViewerCopiedToClipboardMessage": "کلپ بورڈ پر کاپی ہو گیا۔", "craneSleep8SemanticLabel": "بیچ کے اوپر پہاڑ پر مایا تہذیب کے کھنڈرات", "craneSleep4SemanticLabel": "پہاڑوں کے سامنے جھیل کے کنارے ہوٹل", "craneSleep2SemanticLabel": "ماچو پیچو کا قلعہ", "craneSleep1SemanticLabel": "سدا بہار پہاڑوں کے بیچ برفیلے لینڈ اسکیپ میں چالیٹ", "craneSleep0SemanticLabel": "پانی کے اوپر بنگلے", "craneFly13SemanticLabel": "سمندر کنارے کھجور کے درختوں کے ساتھ پول", "craneFly12SemanticLabel": "کھجور کے درختوں کے ساتھ پول", "craneFly11SemanticLabel": "سمندر کے کنارے برک لائٹ ہاؤس", "craneFly10SemanticLabel": "غروب آفتاب کے دوران ازہر مسجد کے ٹاورز", "craneFly9SemanticLabel": "نیلے رنگ کی کار سے ٹیک لگار کر کھڑا آدمی", "craneFly8SemanticLabel": "سپرٹری گرو", "craneEat9SemanticLabel": "پیسٹریز کے ساتھ کیفے کاؤنٹر", "craneEat2SemanticLabel": "برگر", "craneFly5SemanticLabel": "پہاڑوں کے سامنے جھیل کے کنارے ہوٹل", "demoSelectionControlsSubtitle": "چیک باکسز، ریڈیو بٹنز اور سوئچز", "craneEat10SemanticLabel": "پاسٹرامی سینڈوچ پکڑے ہوئے عورت", "craneFly4SemanticLabel": "پانی کے اوپر بنگلے", "craneEat7SemanticLabel": "بیکری کا دروازہ", "craneEat6SemanticLabel": "جھینگا مچھلی سے بنی ڈش", "craneEat5SemanticLabel": "آرٹس ریسٹورنٹ میں بیٹھنے کی جگہ", "craneEat4SemanticLabel": "چاکلیٹ سے بنی مٹھائی", "craneEat3SemanticLabel": "کوریائی ٹیکو", "craneFly3SemanticLabel": "ماچو پیچو کا قلعہ", "craneEat1SemanticLabel": "کھانے کے اسٹولز کے ساتھ خالی بار", "craneEat0SemanticLabel": "لکڑی سے جلنے والے اوون میں پزا", "craneSleep11SemanticLabel": "اسکائی اسکریپر 101 تائی پے", "craneSleep10SemanticLabel": "غروب آفتاب کے دوران ازہر مسجد کے ٹاورز", "craneSleep9SemanticLabel": "سمندر کے کنارے برک لائٹ ہاؤس", "craneEat8SemanticLabel": "پلیٹ میں رکھی جھینگا مچھلی", "craneSleep7SemanticLabel": "رائبیریا اسکوائر میں رنگین اپارٹمنٹس", "craneSleep6SemanticLabel": "کھجور کے درختوں کے ساتھ پول", "craneSleep5SemanticLabel": "میدان میں ٹینٹ", "settingsButtonCloseLabel": "ترتیبات بند کریں", "demoSelectionControlsCheckboxDescription": "چیک باکسز صارف کو سیٹ سے متعدد اختیارات کو منتخب کرنے کی اجازت دیتا ہے۔ عام چیک باکس کی قدر صحیح یا غلط ہوتی ہے اور تین حالتوں والے چیک باکس کو خالی بھی چھوڑا جا سکتا ہے۔", "settingsButtonLabel": "ترتیبات", "demoListsTitle": "فہرستیں", "demoListsSubtitle": "اسکرولنگ فہرست کا لے آؤٹس", "demoListsDescription": "ایک واحد مقررہ اونچائی والی قطار جس میں عام طور پر کچھ متن کے ساتھ ساتھ آگے یا پیچھے کرنے والا ایک آئیکن ہوتا ہے۔", "demoOneLineListsTitle": "ایک لائن", "demoTwoLineListsTitle": "دو لائنز", "demoListsSecondary": "ثانوی متن", "demoSelectionControlsTitle": "انتخاب کے کنٹرولز", "craneFly7SemanticLabel": "ماؤنٹ رشمور", "demoSelectionControlsCheckboxTitle": "چیک باکس", "craneSleep3SemanticLabel": "نیلے رنگ کی کار سے ٹیک لگار کر کھڑا آدمی", "demoSelectionControlsRadioTitle": "ریڈیو", "demoSelectionControlsRadioDescription": "ریڈیو بٹنز صارف کو سیٹ سے ایک اختیار منتخب کرنے کی اجازت دیتے ہیں۔ اگر آپ کو لگتا ہے کہ صارف کو سبھی دستیاب اختیارات کو پہلو بہ پہلو دیکھنے کی ضرورت ہے تو خاص انتخاب کے لیے ریڈیو بٹنز استعمال کریں۔", "demoSelectionControlsSwitchTitle": "سوئچ کریں", "demoSelectionControlsSwitchDescription": "آن/آف سوئچز ترتیبات کے واحد اختیار کو ٹوگل کرتے ہیں۔ اختیار جسے سوئچ کنٹرول کرتا ہے اور ساتھ ہی اس میں موجود حالت متعلقہ ان لائن لیبل سے واضح کیا جانا چاہیے۔", "craneFly0SemanticLabel": "سدا بہار پہاڑوں کے بیچ برفیلے لینڈ اسکیپ میں چالیٹ", "craneFly1SemanticLabel": "میدان میں ٹینٹ", "craneFly2SemanticLabel": "برفیلے پہاڑ کے سامنے دعا کے جھنڈے", "craneFly6SemanticLabel": "پلاسیو دا بلاس آرٹس کے محل کا فضائی نظارہ", "rallySeeAllAccounts": "سبھی اکاؤنٹس دیکھیں", "rallyBillAmount": "{amount} کے لیے {billName} بل کی آخری تاریخ {date}", "shrineTooltipCloseCart": "کارٹ بند کریں", "shrineTooltipCloseMenu": "مینیو بند کریں", "shrineTooltipOpenMenu": "مینیو کھولیں", "shrineTooltipSettings": "ترتیبات", "shrineTooltipSearch": "تلاش کریں", "demoTabsDescription": "ٹیبز مختلف اسکرینز، ڈیٹا سیٹس اور دیگر تعاملات پر مواد منظم کرتا ہے۔", "demoTabsSubtitle": "آزادانہ طور پر قابل اسکرول ملاحظات کے ٹیبس", "demoTabsTitle": "ٹیبز", "rallyBudgetAmount": "{budgetName} بجٹ جس کا {amountUsed} استعمال کیا گیا {amountTotal} ہے، {amountLeft} باقی ہے", "shrineTooltipRemoveItem": "آئٹم ہٹائیں", "rallyAccountAmount": "{amount} کے ساتھ {accountName} اکاؤنٹ {accountNumber}۔", "rallySeeAllBudgets": "سبھی بجٹس دیکھیں", "rallySeeAllBills": "سبھی بلس دیکھیں", "craneFormDate": "تاریخ منتخب کریں", "craneFormOrigin": "مقام روانگی منتخب کریں", "craneFly2": "خومبو ویلی، نیپال", "craneFly3": "ماچو پچو، پیرو", "craneFly4": "مالے، مالدیپ", "craneFly5": "وٹزناؤ، سوئٹزر لینڈ", "craneFly6": "میکسیکو سٹی، میکسیکو", "craneFly7": "ماؤنٹ رشمور، ریاستہائے متحدہ امریکہ", "settingsTextDirectionLocaleBased": "مقام کی بنیاد پر", "craneFly9": "ہوانا، کیوبا", "craneFly10": "قاہرہ، مصر", "craneFly11": "لسبن، پرتگال", "craneFly12": "ناپا، ریاستہائے متحدہ", "craneFly13": "بالی، انڈونیشیا", "craneSleep0": "مالے، مالدیپ", "craneSleep1": "اسپین، ریاستہائے متحدہ", "craneSleep2": "ماچو پچو، پیرو", "demoCupertinoSegmentedControlTitle": "سیگمینٹ کردہ کنٹرول", "craneSleep4": "وٹزناؤ، سوئٹزر لینڈ", "craneSleep5": "بگ سور، ریاستہائے متحدہ", "craneSleep6": "ناپا، ریاستہائے متحدہ", "craneSleep7": "پورٹو، پرتگال", "craneSleep8": "تولوم ، میکسیکو", "craneEat5": "سیول، جنوبی کوریا", "demoChipTitle": "چپس", "demoChipSubtitle": "مختصر عناصر وہ ہیں جو ان پٹ، انتساب، یا ایکشن کی نمائندگی کر تے ہیں", "demoActionChipTitle": "ایکشن چپ", "demoActionChipDescription": "ایکشن چپس اختیارات کا ایک سیٹ ہے جو بنیادی مواد سے متعلقہ کارروائی کو متحرک کرتا ہے۔ ایکشن چپس کو متحرک اور سیاق و سباق کے لحاظ سے کسی UI میں ظاہر ہونی چاہیے۔", "demoChoiceChipTitle": "چوائس چپس", "demoChoiceChipDescription": "چوائس چپس ایک ہی سیٹ کے واحد چوائس کی نمائندگی کرتا ہے۔ چوائس چپس میں متعلقہ وضاحتی ٹیکسٹ یا زمرے ہوتے ہیں۔", "demoFilterChipTitle": "فلٹر چِپ", "demoFilterChipDescription": "فلٹر چپس مواد فلٹر کرنے کے طریقے سے ٹیگز یا وضاحتی الفاظ کا استعمال کرتے ہیں۔", "demoInputChipTitle": "ان پٹ چپ", "demoInputChipDescription": "ان پٹ چپس مختصر شکل میں ہستی (شخص، جگہ، یا چیز) یا گفتگو والے ٹیکسٹ جیسی معلومات کے ایک اہم حصے کی نمائندگی کرتے ہیں۔", "craneSleep9": "لسبن، پرتگال", "craneEat10": "لسبن، پرتگال", "demoCupertinoSegmentedControlDescription": "باہمی خصوصی اختیارات کی ایک بڑی تعداد کے مابین منتخب کرنے کے لئے استعمال کیا جاتا ہے۔ جب سیگمینٹ کردہ کنٹرول کا کوئی آپشن منتخب کیا جاتا ہے، تو سیگمینٹ کردہ کنٹرول کے دیگر اختیارات کو منتخب کرنا بند کردیا جاتا ہے۔", "chipTurnOnLights": "لائٹس آن کریں", "chipSmall": "چھوٹا", "chipMedium": "متوسط", "chipLarge": "بڑا", "chipElevator": "مستول", "chipWasher": "کپڑے دھونے والی مشین", "chipFireplace": "آتش دان", "chipBiking": "بائیکنگ", "craneFormDiners": "ڈائنرز", "rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{اپنے امکانی ٹیکس کٹوتی کو بڑھائیں! زمرے کو 1 غیر تفویض کردہ ٹرانزیکشن میں تفویض کریں۔}other{اپنے امکانی ٹیکس کٹوتی کو بڑھائیں! زمرے کو {count} غیر تفویض کردہ ٹرانزیکشنز میں تفویض کریں۔}}", "craneFormTime": "وقت منتخب کریں", "craneFormLocation": "مقام منتخب کریں", "craneFormTravelers": "سیاح", "craneEat8": "اٹلانٹا، ریاستہائے متحدہ", "craneFormDestination": "منزل منتخب کریں", "craneFormDates": "تاریخیں منتخب کریں", "craneFly": "FLY", "craneSleep": "نیند", "craneEat": "کھائیں", "craneFlySubhead": "منزل کے لحاظ سے فلائیٹس دریافت کریں", "craneSleepSubhead": "منزل کے لحاظ سے پراپرٹیز دریافت کریں", "craneEatSubhead": "منزل کے لحاظ سے ریستوران دریافت کریں", "craneFlyStops": "{numberOfStops,plural,=0{نان اسٹاپ}=1{1 اسٹاپ}other{{numberOfStops} اسٹاپس}}", "craneSleepProperties": "{totalProperties,plural,=0{کوئی دستیاب پراپرٹیز نہیں}=1{1 دستیاب پراپرٹیز}other{{totalProperties} دستیاب پراپرٹیز ہیں}}", "craneEatRestaurants": "{totalRestaurants,plural,=0{کوئی ریسٹورنٹس نہیں ہے}=1{1 ریستورینٹ}other{{totalRestaurants} ریسٹورینٹس}}", "craneFly0": "اسپین، ریاستہائے متحدہ", "demoCupertinoSegmentedControlSubtitle": "iOS طرز کا سیگمنٹ کردہ کنٹرول", "craneSleep10": "قاہرہ، مصر", "craneEat9": "میڈرڈ، ہسپانیہ", "craneFly1": "بگ سور، ریاستہائے متحدہ", "craneEat7": "نیش ول، ریاستہائے متحدہ", "craneEat6": "سی‏ئٹل، ریاستہائے متحدہ", "craneFly8": "سنگاپور", "craneEat4": "پیرس، فرانس", "craneEat3": "پورٹلینڈ، ریاست ہائے متحدہ", "craneEat2": "قرطبہ، ارجنٹینا", "craneEat1": "ڈلاس، ریاستہائے متحدہ", "craneEat0": "نیپال، اٹلی", "craneSleep11": "تائی پے، تائیوان", "craneSleep3": "ہوانا، کیوبا", "shrineLogoutButtonCaption": "لاگ آؤٹ", "rallyTitleBills": "بلز", "rallyTitleAccounts": "اکاؤنٹس", "shrineProductVagabondSack": "واگابونڈ سیگ", "rallyAccountDetailDataInterestYtd": "YTD سود", "shrineProductWhitneyBelt": "وہائٹنے نیلٹ", "shrineProductGardenStrand": "گارڈن اسٹرینڈ", "shrineProductStrutEarrings": "کان کی زبردست بالیاں", "shrineProductVarsitySocks": "وارسٹی کی جرابیں", "shrineProductWeaveKeyring": "بنائی والی کی رنگ", "shrineProductGatsbyHat": "گیٹسوے ٹوپی", "shrineProductShrugBag": "شرگ بیک", "shrineProductGiltDeskTrio": "جلیٹ کا ٹرپل ٹیبل", "shrineProductCopperWireRack": "کاپر وائر رینک", "shrineProductSootheCeramicSet": "سوس سیرامک سیٹ", "shrineProductHurrahsTeaSet": "ہوراس ٹی سیٹ", "shrineProductBlueStoneMug": "نیلے پتھر کا پیالا", "shrineProductRainwaterTray": "رین واٹر ٹرے", "shrineProductChambrayNapkins": "چمبری نیپکنز", "shrineProductSucculentPlanters": "سکلینٹ پلانٹرز", "shrineProductQuartetTable": "کوآرٹیٹ ٹیبل", "shrineProductKitchenQuattro": "کچن کواترو", "shrineProductClaySweater": "مٹی کے رنگ کے سویٹر", "shrineProductSeaTunic": "سمندری سرنگ", "shrineProductPlasterTunic": "پلاسٹر ٹیونک", "rallyBudgetCategoryRestaurants": "ریستوراں", "shrineProductChambrayShirt": "چمبری شرٹ", "shrineProductSeabreezeSweater": "بحریہ کے نیلے رنگ کا سویٹر", "shrineProductGentryJacket": "جنٹری جیکٹ", "shrineProductNavyTrousers": "نیوی پتلونیں", "shrineProductWalterHenleyWhite": "والٹر ہینلے (سفید)", "shrineProductSurfAndPerfShirt": "سرف اور پرف شرٹ", "shrineProductGingerScarf": "ادرک اسٹائل کا اسکارف", "shrineProductRamonaCrossover": "رومانا کراس اوور", "shrineProductClassicWhiteCollar": "کلاسک سفید کالر", "shrineProductSunshirtDress": "سنشرٹ ڈریس", "rallyAccountDetailDataInterestRate": "سود کی شرح", "rallyAccountDetailDataAnnualPercentageYield": "سالانہ فی صد منافع", "rallyAccountDataVacation": "تعطیل", "shrineProductFineLinesTee": "فائن لائن ٹی شرٹس", "rallyAccountDataHomeSavings": "ہوم سیونگز", "rallyAccountDataChecking": "چیک کیا جا رہا ہے", "rallyAccountDetailDataInterestPaidLastYear": "پچھلے سال ادا کیا گیا سود", "rallyAccountDetailDataNextStatement": "اگلا بیان", "rallyAccountDetailDataAccountOwner": "اکاؤنٹ کا مالک", "rallyBudgetCategoryCoffeeShops": "کافی کی دکانیں", "rallyBudgetCategoryGroceries": "گروسریز", "shrineProductCeriseScallopTee": "لوئر ڈالبی کرس ٹی شرٹ", "rallyBudgetCategoryClothing": "لباس", "rallySettingsManageAccounts": "اکاؤنٹس کا نظم کریں", "rallyAccountDataCarSavings": "کار کی سیونگز", "rallySettingsTaxDocuments": "ٹیکس کے دستاویزات", "rallySettingsPasscodeAndTouchId": "پاس کوڈ اور ٹچ ID", "rallySettingsNotifications": "اطلاعات", "rallySettingsPersonalInformation": "ذاتی معلومات", "rallySettingsPaperlessSettings": "کاغذ کا استعمال ترک کرنے کی ترتیبات", "rallySettingsFindAtms": "ATMs تلاش کریں", "rallySettingsHelp": "مدد", "rallySettingsSignOut": "سائن آؤٹ کریں", "rallyAccountTotal": "کل", "rallyBillsDue": "آخری تاریخ", "rallyBudgetLeft": "بائیں", "rallyAccounts": "اکاؤنٹس", "rallyBills": "بلز", "rallyBudgets": "بجٹس", "rallyAlerts": "الرٹس", "rallySeeAll": "سبھی دیکھیں", "rallyFinanceLeft": "LEFT", "rallyTitleOverview": "مجموعی جائزہ", "shrineProductShoulderRollsTee": "پولرائزڈ بلاؤج", "shrineNextButtonCaption": "اگلا", "rallyTitleBudgets": "بجٹس", "rallyTitleSettings": "ترتیبات", "rallyLoginLoginToRally": "ریلی میں لاگ ان کریں", "rallyLoginNoAccount": "کیا آپ کے پاس اکاؤنٹ نہیں ہے؟", "rallyLoginSignUp": "سائن اپ کریں", "rallyLoginUsername": "صارف نام", "rallyLoginPassword": "پاس ورڈ", "rallyLoginLabelLogin": "لاگ ان کریں", "rallyLoginRememberMe": "مجھے یاد رکھیں", "rallyLoginButtonLogin": "لاگ ان کریں", "rallyAlertsMessageHeadsUpShopping": "آگاہ رہیں، آپ نے اس ماہ کے لیے اپنی خریداری کے بجٹ کا {percent} استعمال کر لیا ہے۔", "rallyAlertsMessageSpentOnRestaurants": "آپ نے اس ہفتے ریسٹورینٹس پر {amount} خرچ کیے ہیں۔", "rallyAlertsMessageATMFees": "آپ نے اس مہینے ATM فیس میں {amount} خرچ کیے ہیں", "rallyAlertsMessageCheckingAccount": "بہت خوب! آپ کا چیکنگ اکاؤنٹ پچھلے مہینے سے {percent} زیادہ ہے۔", "shrineMenuCaption": "مینیو", "shrineCategoryNameAll": "سبھی", "shrineCategoryNameAccessories": "لوازمات", "shrineCategoryNameClothing": "کپڑے", "shrineCategoryNameHome": "ہوم", "shrineLoginUsernameLabel": "صارف نام", "shrineLoginPasswordLabel": "پاس ورڈ", "shrineCancelButtonCaption": "منسوخ کریں", "shrineCartTaxCaption": "ٹیکس:", "shrineCartPageCaption": "کارٹ", "shrineProductQuantity": "مقدار: {quantity}", "shrineProductPrice": "x ‏{price}", "shrineCartItemCount": "{quantity,plural,=0{کوئی آئٹمز نہیں ہیں}=1{1 آئٹم}other{{quantity} آئٹمز}}", "shrineCartClearButtonCaption": "کارٹ کو صاف کریں", "shrineCartTotalCaption": "کل", "shrineCartSubtotalCaption": "سب ٹوٹل:", "shrineCartShippingCaption": "ترسیل:", "shrineProductGreySlouchTank": "گرے سلیوچ ٹینک", "shrineProductStellaSunglasses": "اسٹیلا دھوپ کے چشمے", "shrineProductWhitePinstripeShirt": "سفید پن اسٹراپ شرٹ", "demoTextFieldWhereCanWeReachYou": "ہم آپ سے کیسے رابطہ کر سکتے ہیں؟", "settingsTextDirectionLTR": "LTR", "settingsTextScalingLarge": "بڑا", "demoBottomSheetHeader": "ہیڈر", "demoBottomSheetItem": "آئٹم {value}", "demoBottomTextFieldsTitle": "متن کے فیلڈز", "demoTextFieldTitle": "متن کے فیلڈز", "demoTextFieldSubtitle": "قابل ترمیم متن اور نمبرز کے لیے واحد لائن", "demoTextFieldDescription": "متں کی فیلڈز صارفین کو متن کو UI میں درج کرنے کی اجازت دیتی ہیں۔ وہ عام طور پر فارمز اور ڈائیلاگز میں ظاہر ہوتے ہیں۔", "demoTextFieldShowPasswordLabel": "پاس ورڈ دکھائیں", "demoTextFieldHidePasswordLabel": "پاس ورڈ چھپائیں", "demoTextFieldFormErrors": "براہ کرم جمع کرانے سے پہلے سرخ رنگ کی خرابیوں کو درست کریں۔", "demoTextFieldNameRequired": "نام درکار ہے۔", "demoTextFieldOnlyAlphabeticalChars": "براہ کرم صرف حروف تہجی کے اعتبار سے حروف درک کریں۔", "demoTextFieldEnterUSPhoneNumber": "(###) ###-#### - ریاستہائے متحدہ امریکہ کا فون نمبر درج کریں۔", "demoTextFieldEnterPassword": "براہ کرم ایک پاس ورڈ درج کریں۔", "demoTextFieldPasswordsDoNotMatch": "پاسورڈز مماثل نہیں ہیں", "demoTextFieldWhatDoPeopleCallYou": "لوگ آپ کو کیا پکارتے ہیں؟", "demoTextFieldNameField": "نام*", "demoBottomSheetButtonText": "نیچے کی شیٹ دکھائیں", "demoTextFieldPhoneNumber": "فون نمبر*", "demoBottomSheetTitle": "نیچے کی شیٹ", "demoTextFieldEmail": "ای میل", "demoTextFieldTellUsAboutYourself": "اپنے بارے میں بتائیں (مثلاً، لکھیں کہ آپ کیا کرتے ہیں اور آپ کے مشغلے کیا ہیں)", "demoTextFieldKeepItShort": "اسے مختصر رکھیں ، یہ صرف ایک ڈیمو ہے۔", "starterAppGenericButton": "بٹن", "demoTextFieldLifeStory": "زندگی کی کہانی", "demoTextFieldSalary": "تنخواہ", "demoTextFieldUSD": "یو ایس ڈی", "demoTextFieldNoMoreThan": "8 حروف سے زیادہ نہیں۔", "demoTextFieldPassword": "پاس ورڈ*", "demoTextFieldRetypePassword": "پاس ورڈ* دوبارہ ٹائپ کریں", "demoTextFieldSubmit": "جمع کرائیں", "demoBottomNavigationSubtitle": "کراس فیڈنگ ملاحظات کے ساتھ نیچے میں نیویگیشن", "demoBottomSheetAddLabel": "شامل کریں", "demoBottomSheetModalDescription": "نیچے کی موڈل شیٹ مینیو یا ڈائیلاگ کا متبادل ہے اور صارف کو باقی ایپ کے ساتھ تعامل کرنے سے روکتی ہے۔", "demoBottomSheetModalTitle": "نیچے کی ماڈل شیٹ", "demoBottomSheetPersistentDescription": "نیچے کی مستقل شیٹ ایپ کے بنیادی مواد کی اضافی معلومات دکھاتی ہے۔ جب تک صارف ایپ کے دوسرے حصوں سے تعامل کرتا ہے تب بھی نیچے کی مستقل شیٹ نظر آتی ہے۔", "demoBottomSheetPersistentTitle": "نیچے کی مستقل شیٹ", "demoBottomSheetSubtitle": "نیچے کی مستقل اور موڈل شیٹس", "demoTextFieldNameHasPhoneNumber": "{name} کا فون نمبر {phoneNumber} ہے", "buttonText": "بٹن", "demoTypographyDescription": "مٹیریل ڈیزائن میں پائے جانے والے مختلف ٹائپوگرافیکل اسٹائل کی تعریفات۔", "demoTypographySubtitle": "پہلے سے متعینہ متن کی تمام طرزیں", "demoTypographyTitle": "ٹائپوگرافی", "demoFullscreenDialogDescription": "fullscreenDialog کی پراپرٹی اس بات کی وضاحت کرتی ہے کہ آنے والا صفحہ ایک پوری اسکرین کا ماڈل ڈائیلاگ ہے۔", "demoFlatButtonDescription": "ہموار بٹن، جب دبایا جاتا ہے تو سیاہی کی چھلکیاں دکھاتا ہے، لیکن اوپر نہیں جاتا ہے۔ پیڈنگ کے ساتھ آن لائن اور ڈائیلاگز میں ہموار بٹن، ٹول بارز پر استعمال کریں", "demoBottomNavigationDescription": "باٹم نیویگیشن بارز ایک اسکرین کے نیچے تین سے پانچ منازل کو ڈسپلے کرتا ہے۔ ہر منزل کی نمائندگی ایک آئیکن اور ایک اختیاری ٹیکسٹ لیبل کے ذریعے کی جاتی ہے۔ جب نیچے میں نیویگیشن آئیکن ٹیپ ہوجاتا ہے، تو صارف کو اس آئیکن سے وابستہ اعلی سطحی نیویگیشن منزل تک لے جایا جاتا ہے۔", "demoBottomNavigationSelectedLabel": "منتخب کردہ لیول", "demoBottomNavigationPersistentLabels": "مستقل لیبلز", "starterAppDrawerItem": "آئٹم {value}", "demoTextFieldRequiredField": "* مطلوبہ فیلڈ کی نشاندہی کرتا ہے", "demoBottomNavigationTitle": "نیچے نیویگیشن", "settingsLightTheme": "ہلکی", "settingsTheme": "تھیم", "settingsPlatformIOS": "iOS", "settingsPlatformAndroid": "Android", "settingsTextDirectionRTL": "RTL", "settingsTextScalingHuge": "بہت بڑا", "cupertinoButton": "بٹن", "settingsTextScalingNormal": "عام", "settingsTextScalingSmall": "چھوٹا", "settingsSystemDefault": "سسٹم", "settingsTitle": "ترتیبات", "rallyDescription": "ایک ذاتی اقتصادی ایپ", "aboutDialogDescription": "اس ایپ کے لیے ماخذ کوڈ دیکھنے کے لیے، براہ کرم {repoLink} کا ملاحظہ کریں۔", "bottomNavigationCommentsTab": "تبصرے", "starterAppGenericBody": "مضمون", "starterAppGenericHeadline": "سرخی", "starterAppGenericSubtitle": "سب ٹائٹل", "starterAppGenericTitle": "عنوان", "starterAppTooltipSearch": "تلاش", "starterAppTooltipShare": "اشتراک کریں", "starterAppTooltipFavorite": "پسندیدہ", "starterAppTooltipAdd": "شامل کریں", "bottomNavigationCalendarTab": "کیلنڈر", "starterAppDescription": "ایک ذمہ دار اسٹارٹر لے آؤٹ", "starterAppTitle": "اسٹارٹر ایپ", "aboutFlutterSamplesRepo": "فلوٹر نمونے جیٹ بک ریپوزٹری", "bottomNavigationContentPlaceholder": "{title} ٹیب کے لیے پلیس ہولڈر", "bottomNavigationCameraTab": "کیمرا", "bottomNavigationAlarmTab": "الارم", "bottomNavigationAccountTab": "اکاؤنٹ", "demoTextFieldYourEmailAddress": "آپ کا ای میل پتہ", "demoToggleButtonDescription": "گروپ سے متعلق اختیارات کے لیے ٹوگل بٹنز استعمال کئے جا سکتے ہیں۔ متعلقہ ٹوگل بٹنز کے گروپوں پر زور دینے کے لئے، ایک گروپ کو مشترکہ کنٹینر کا اشتراک کرنا ہوگا", "colorsGrey": "خاکستری", "colorsBrown": "بھورا", "colorsDeepOrange": "گہرا نارنجی", "colorsOrange": "نارنجی", "colorsAmber": "امبر", "colorsYellow": "زرد", "colorsLime": "لائم", "colorsLightGreen": "ہلکا سبز", "colorsGreen": "سبز", "homeHeaderGallery": "گیلری", "homeHeaderCategories": "زمرے", "shrineDescription": "فَيشَن پرَستی سے متعلق ریٹیل ایپ", "craneDescription": "ذاتی نوعیت کی بنائی گئی ایک سفری ایپ", "homeCategoryReference": "طرزیں اور دیگر", "demoInvalidURL": "URL نہیں دکھایا جا سکا:", "demoOptionsTooltip": "اختیارات", "demoInfoTooltip": "معلومات", "demoCodeTooltip": "ڈیمو کوڈ", "demoDocumentationTooltip": "API دستاویزات", "demoFullscreenTooltip": "پوری اسکرین", "settingsTextScaling": "ٹیکسٹ اسکیلنگ", "settingsTextDirection": "متن کی ڈائریکشن", "settingsLocale": "زبان", "settingsPlatformMechanics": "پلیٹ فارم میکانیات", "settingsDarkTheme": "گہری", "settingsSlowMotion": "سلو موشن", "settingsAbout": "چاپلوسی والی Gallery کے بارے میں", "settingsFeedback": "تاثرات بھیجیں", "settingsAttribution": "لندن میں ٹوسٹر کے ذریعے ڈیزائن کیا گیا", "demoButtonTitle": "بٹنز", "demoButtonSubtitle": "ٹیکسٹ، ابھرا ہوا، آؤٹ لائن کردہ اور بہت کچھ", "demoFlatButtonTitle": "ہموار بٹن", "demoRaisedButtonDescription": "ابھرے ہوئے بٹن اُن لے آؤٹس میں شامل کریں جو زیادہ تر ہموار ہیں۔ یہ مصروف یا وسیع خالی جگہوں والے افعال پر زور دیتے ہیں۔", "demoRaisedButtonTitle": "ابھرا ہوا بٹن", "demoOutlineButtonTitle": "آؤٹ لائن بٹن", "demoOutlineButtonDescription": "آؤٹ لائن بٹنز کے دبائیں جانے پر وہ دھندلے اور بلند ہوجاتے ہیں۔ یہ متبادل، ثانوی کارروائی کی نشاندہی کرنے کے لیے اکثر ابھرے ہوئے بٹنوں کے ساتھ جوڑے جاتے ہیں۔", "demoToggleButtonTitle": "ٹوگل بٹنز", "colorsTeal": "نیلگوں سبز", "demoFloatingButtonTitle": "فلوٹنگ کارروائی بٹن", "demoFloatingButtonDescription": "فلوٹنگ کارروائی کا بٹن ایک گردشی آئیکن بٹن ہوتا ہے جو ایپلیکیشن میں کسی بنیادی کارروائی کو فروغ دینے کے لیے مواد پر گھومتا ہے۔", "demoDialogTitle": "ڈائیلاگز", "demoDialogSubtitle": "سادہ الرٹ اور پوری اسکرین", "demoAlertDialogTitle": "الرٹ", "demoAlertDialogDescription": "الرٹ ڈائیلاگ صارف کو ایسی صورتحال سے آگاہ کرتا ہے جہاں اقرار درکار ہوتا ہے۔ الرٹ ڈائیلاگ میں اختیاری عنوان اور کارروائیوں کی اختیاری فہرست ہوتی ہے۔", "demoAlertTitleDialogTitle": "عنوان کے ساتھ الرٹ", "demoSimpleDialogTitle": "سادہ", "demoSimpleDialogDescription": "ایک سادہ ڈائیلاگ صارف کو کئی اختیارات کے درمیان انتخاب پیش کرتا ہے ایک سادہ ڈائیلاگ کا اختیاری عنوان ہوتا ہے جو انتخابات کے اوپر دکھایا جاتا ہے۔", "demoFullscreenDialogTitle": "پوری اسکرین", "demoCupertinoButtonsTitle": "بٹنز", "demoCupertinoButtonsSubtitle": "iOS طرز کے بٹن", "demoCupertinoButtonsDescription": "ایک iOS طرز کا بٹن۔ یہ بٹن ٹچ کرنے پر فیڈ آؤٹ اور فیڈ ان کرنے والے متن اور/یا آئیکن میں شامل ہو جاتا ہے۔ اختیاری طور پر اس کا پس منظر ہو سکتا ہے", "demoCupertinoAlertsTitle": "الرٹس", "demoCupertinoAlertsSubtitle": "iOS طرز الرٹ ڈائیلاگز", "demoCupertinoAlertTitle": "الرٹ", "demoCupertinoAlertDescription": "الرٹ ڈائیلاگ صارف کو ایسی صورتحال سے آگاہ کرتا ہے جہاں اقرار درکار ہوتا ہے۔ الرٹ ڈائیلاگ میں اختیاری عنوان، اختیاری مواد، اور کارروائیوں کی ایک اختیاری فہرست ہوتی ہے۔ عنوان کو مندرجات کے اوپر دکھایا جاتا ہے اور کارروائیوں کو مندرجات کے نیچے دکھایا جاتا ہے۔", "demoCupertinoAlertWithTitleTitle": "عنوان کے ساتھ الرٹ", "demoCupertinoAlertButtonsTitle": "بٹن کے ساتھ الرٹ", "demoCupertinoAlertButtonsOnlyTitle": "صرف الرٹ بٹنز", "demoCupertinoActionSheetTitle": "کارروائی شیٹ", "demoCupertinoActionSheetDescription": "کارروائی شیٹ الرٹ کا ایک مخصوص طرز ہے جو صارف کو موجودہ سیاق و سباق سے متعلق دو یا اس سے زائد انتخابات کا ایک مجموعہ پیش کرتا ہے۔ کارروائی شیٹ میں ایک عنوان، ایک اضافی پیغام اور کارروائیوں کی فہرست ہو سکتی ہے۔", "demoColorsTitle": "رنگ", "demoColorsSubtitle": "پیشگی متعین کردہ سبھی رنگ", "demoColorsDescription": "رنگ اور رنگ کے نمونے مستقل رہتے ہیں جو مٹیریل ڈیزائن کے رنگ کے پیلیٹ کی نمائندگی کرتے ہیں۔", "buttonTextEnabled": "ENABLED", "buttonTextDisabled": "DISABLED", "buttonTextCreate": "تخلیق کریں", "dialogSelectedOption": "آپ نے منتخب کیا: \"{value}\"", "dialogDiscardTitle": "مسودہ مسترد کریں؟", "dialogLocationTitle": "Google کی مقام کی سروس کا استعمال کریں؟", "dialogLocationDescription": "Google کو مقام کا تعین کرنے میں ایپس کی مدد کرنے دیں۔ اس کا مطلب یہ ہے کہ Google کو گمنام مقام کا ڈیٹا تب بھی بھیجا جائے گا، جب کوئی بھی ایپ نہیں چل رہی ہیں۔", "dialogCancel": "منسوخ کریں", "dialogDiscard": "رد کریں", "dialogDisagree": "غیر متفق ہوں", "dialogAgree": "متفق ہوں", "dialogSetBackup": "بیک اپ اکاؤنٹ ترتیب دیں", "colorsBlueGrey": "نیلا خاکستری", "dialogShow": "ڈائیلاگ باکس دکھائیں", "dialogFullscreenTitle": "پوری اسکرین ڈائیلاگ", "dialogFullscreenSave": "محفوظ کریں", "dialogFullscreenDescription": "ایک پوری اسکرین ڈائیلاگ ڈیمو", "cupertinoButtonEnabled": "Enabled", "cupertinoButtonDisabled": "Disabled", "cupertinoButtonWithBackground": "پس منظر کے ساتھ", "cupertinoAlertCancel": "منسوخ کریں", "cupertinoAlertDiscard": "رد کریں", "cupertinoAlertLocationTitle": "جب آپ ایپ استعمال کر رہے ہوں تو \"Maps\" کو اپنے مقام تک رسائی حاصل کرنے دیں؟", "cupertinoAlertLocationDescription": "آپ کا موجودہ مقام نقشے پر دکھایا جائے گا اور اس کا استعمال ڈائریکشنز، تلاش کے قریبی نتائج، اور سفر کے تخمینی اوقات کے لیے کیا جائے گا۔", "cupertinoAlertAllow": "اجازت دیں", "cupertinoAlertDontAllow": "اجازت نہ دیں", "cupertinoAlertFavoriteDessert": "پسندیدہ میٹھی ڈش منتخب کریں", "cupertinoAlertDessertDescription": "براہ کرم ذیل کی فہرست میں سے اپنی پسندیدہ میٹھی ڈش منتخب کریں۔ آپ کے انتخاب کا استعمال آپ کے علاقے میں آپ کی تجویز کردہ طعام خانوں کی فہرست کو حسب ضرورت بنانے کے لئے کیا جائے گا۔", "cupertinoAlertCheesecake": "چیز کیک", "cupertinoAlertTiramisu": "تیرامیسو", "cupertinoAlertApplePie": "ایپل پائی", "cupertinoAlertChocolateBrownie": "چاکلیٹ براؤنی", "cupertinoShowAlert": "الرٹ دکھائیں", "colorsRed": "سرخ", "colorsPink": "گلابی", "colorsPurple": "جامنی", "colorsDeepPurple": "گہرا جامنی", "colorsIndigo": "گہرا نیلا", "colorsBlue": "نیلا", "colorsLightBlue": "ہلکا نیلا", "colorsCyan": "ازرق", "dialogAddAccount": "اکاؤنٹ شامل کریں", "Gallery": "گیلری", "Categories": "زمرے", "SHRINE": "درگاہ", "Basic shopping app": "بنیادی خریداری ایپ", "RALLY": "ریلی", "CRANE": "کرین", "Travel app": "سفری ایپ", "MATERIAL": "مواد", "CUPERTINO": "CUPERTINO", "REFERENCE STYLES & MEDIA": "حوالہ کی طرزیں اور میڈیا" }
gallery/lib/l10n/intl_ur.arb/0
{ "file_path": "gallery/lib/l10n/intl_ur.arb", "repo_id": "gallery", "token_count": 39200 }
815
// Copyright 2019 The Flutter team. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/gallery_localizations.dart'; import 'package:gallery/constants.dart'; import 'package:gallery/data/demos.dart'; import 'package:gallery/layout/adaptive.dart'; import 'package:gallery/pages/demo.dart'; typedef CategoryHeaderTapCallback = Function(bool shouldOpenList); class CategoryListItem extends StatefulWidget { const CategoryListItem({ super.key, this.restorationId, required this.category, required this.imageString, this.demos = const [], this.initiallyExpanded = false, this.onTap, }); final GalleryDemoCategory category; final String? restorationId; final String imageString; final List<GalleryDemo> demos; final bool initiallyExpanded; final CategoryHeaderTapCallback? onTap; @override State<CategoryListItem> createState() => _CategoryListItemState(); } class _CategoryListItemState extends State<CategoryListItem> with SingleTickerProviderStateMixin { static final Animatable<double> _easeInTween = CurveTween(curve: Curves.easeIn); static const _expandDuration = Duration(milliseconds: 200); late AnimationController _controller; late Animation<double> _childrenHeightFactor; late Animation<double> _headerChevronOpacity; late Animation<double> _headerHeight; late Animation<EdgeInsetsGeometry> _headerMargin; late Animation<EdgeInsetsGeometry> _headerImagePadding; late Animation<EdgeInsetsGeometry> _childrenPadding; late Animation<BorderRadius?> _headerBorderRadius; @override void initState() { super.initState(); _controller = AnimationController(duration: _expandDuration, vsync: this); _controller.addStatusListener((status) { setState(() {}); }); _childrenHeightFactor = _controller.drive(_easeInTween); _headerChevronOpacity = _controller.drive(_easeInTween); _headerHeight = Tween<double>( begin: 80, end: 96, ).animate(_controller); _headerMargin = EdgeInsetsGeometryTween( begin: const EdgeInsets.fromLTRB(32, 8, 32, 8), end: EdgeInsets.zero, ).animate(_controller); _headerImagePadding = EdgeInsetsGeometryTween( begin: const EdgeInsets.all(8), end: const EdgeInsetsDirectional.fromSTEB(16, 8, 8, 8), ).animate(_controller); _childrenPadding = EdgeInsetsGeometryTween( begin: const EdgeInsets.symmetric(horizontal: 32), end: EdgeInsets.zero, ).animate(_controller); _headerBorderRadius = BorderRadiusTween( begin: BorderRadius.circular(10), end: BorderRadius.zero, ).animate(_controller); if (widget.initiallyExpanded) { _controller.value = 1.0; } } @override void dispose() { _controller.dispose(); super.dispose(); } bool _shouldOpenList() { switch (_controller.status) { case AnimationStatus.completed: case AnimationStatus.forward: case AnimationStatus.reverse: return false; case AnimationStatus.dismissed: return true; } } void _handleTap() { if (_shouldOpenList()) { _controller.forward(); if (widget.onTap != null) { widget.onTap!(true); } } else { _controller.reverse(); if (widget.onTap != null) { widget.onTap!(false); } } } Widget _buildHeaderWithChildren(BuildContext context, Widget? child) { return Column( mainAxisSize: MainAxisSize.min, children: [ _CategoryHeader( margin: _headerMargin.value, imagePadding: _headerImagePadding.value, borderRadius: _headerBorderRadius.value!, height: _headerHeight.value, chevronOpacity: _headerChevronOpacity.value, imageString: widget.imageString, category: widget.category, onTap: _handleTap, ), Padding( padding: _childrenPadding.value, child: ClipRect( child: Align( heightFactor: _childrenHeightFactor.value, child: child, ), ), ), ], ); } @override Widget build(BuildContext context) { return AnimatedBuilder( animation: _controller.view, builder: _buildHeaderWithChildren, child: _shouldOpenList() ? null : _ExpandedCategoryDemos( category: widget.category, demos: widget.demos, ), ); } } class _CategoryHeader extends StatelessWidget { const _CategoryHeader({ this.margin, required this.imagePadding, required this.borderRadius, this.height, required this.chevronOpacity, required this.imageString, required this.category, this.onTap, }); final EdgeInsetsGeometry? margin; final EdgeInsetsGeometry imagePadding; final double? height; final BorderRadiusGeometry borderRadius; final String imageString; final GalleryDemoCategory category; final double chevronOpacity; final GestureTapCallback? onTap; @override Widget build(BuildContext context) { final colorScheme = Theme.of(context).colorScheme; return Container( margin: margin, child: Material( shape: RoundedRectangleBorder(borderRadius: borderRadius), color: colorScheme.onBackground, clipBehavior: Clip.antiAlias, child: SizedBox( width: MediaQuery.of(context).size.width, child: InkWell( // Makes integration tests possible. key: ValueKey('${category.name}CategoryHeader'), onTap: onTap, child: Row( children: [ Expanded( child: Wrap( crossAxisAlignment: WrapCrossAlignment.center, children: [ Padding( padding: imagePadding, child: FadeInImage( image: AssetImage( imageString, package: 'flutter_gallery_assets', ), placeholder: MemoryImage(kTransparentImage), fadeInDuration: entranceAnimationDuration, width: 64, height: 64, excludeFromSemantics: true, ), ), Padding( padding: const EdgeInsetsDirectional.only(start: 8), child: Text( category.displayTitle( GalleryLocalizations.of(context)!, )!, style: Theme.of(context).textTheme.headlineSmall!.apply( color: colorScheme.onSurface, ), ), ), ], ), ), Opacity( opacity: chevronOpacity, child: chevronOpacity != 0 ? Padding( padding: const EdgeInsetsDirectional.only( start: 8, end: 32, ), child: Icon( Icons.keyboard_arrow_up, color: colorScheme.onSurface, ), ) : null, ), ], ), ), ), ), ); } } class _ExpandedCategoryDemos extends StatelessWidget { const _ExpandedCategoryDemos({ required this.category, required this.demos, }); final GalleryDemoCategory category; final List<GalleryDemo> demos; @override Widget build(BuildContext context) { return Column( // Makes integration tests possible. key: ValueKey('${category.name}DemoList'), children: [ for (final demo in demos) CategoryDemoItem( demo: demo, ), const SizedBox(height: 12), // Extra space below. ], ); } } class CategoryDemoItem extends StatelessWidget { const CategoryDemoItem({super.key, required this.demo}); final GalleryDemo demo; @override Widget build(BuildContext context) { final textTheme = Theme.of(context).textTheme; final colorScheme = Theme.of(context).colorScheme; return Material( // Makes integration tests possible. key: ValueKey(demo.describe), color: Theme.of(context).colorScheme.surface, child: MergeSemantics( child: InkWell( onTap: () { Navigator.of(context).restorablePushNamed( '${DemoPage.baseRoute}/${demo.slug}', ); }, child: Padding( padding: EdgeInsetsDirectional.only( start: 32, top: 20, end: isDisplayDesktop(context) ? 16 : 8, ), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Icon( demo.icon, color: colorScheme.primary, ), const SizedBox(width: 40), Flexible( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( demo.title, style: textTheme.titleMedium! .apply(color: colorScheme.onSurface), ), Text( demo.subtitle, style: textTheme.labelSmall!.apply( color: colorScheme.onSurface.withOpacity(0.5), ), ), const SizedBox(height: 20), Divider( thickness: 1, height: 1, color: Theme.of(context).colorScheme.background, ), ], ), ), ], ), ), ), ), ); } }
gallery/lib/pages/category_list_item.dart/0
{ "file_path": "gallery/lib/pages/category_list_item.dart", "repo_id": "gallery", "token_count": 5182 }
816
// Copyright 2019 The Flutter team. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:gallery/layout/adaptive.dart'; import 'package:gallery/studies/crane/colors.dart'; const textFieldHeight = 60.0; const appPaddingLarge = 120.0; const appPaddingSmall = 24.0; class HeaderFormField { final int index; final IconData iconData; final String title; final TextEditingController textController; const HeaderFormField({ required this.index, required this.iconData, required this.title, required this.textController, }); } class HeaderForm extends StatelessWidget { final List<HeaderFormField> fields; const HeaderForm({super.key, required this.fields}); @override Widget build(BuildContext context) { final isDesktop = isDisplayDesktop(context); final isSmallDesktop = isDisplaySmallDesktop(context); return Padding( padding: EdgeInsets.symmetric( horizontal: isDesktop && !isSmallDesktop ? appPaddingLarge : appPaddingSmall, ), child: isDesktop ? LayoutBuilder(builder: (context, constraints) { var crossAxisCount = isSmallDesktop ? 2 : 4; if (fields.length < crossAxisCount) { crossAxisCount = fields.length; } final itemWidth = constraints.maxWidth / crossAxisCount; return GridView.count( crossAxisCount: crossAxisCount, childAspectRatio: itemWidth / textFieldHeight, physics: const NeverScrollableScrollPhysics(), children: [ for (final field in fields) if ((field.index + 1) % crossAxisCount == 0) _HeaderTextField(field: field) else Padding( padding: const EdgeInsetsDirectional.only(end: 16), child: _HeaderTextField(field: field), ), ], ); }) : Column( mainAxisSize: MainAxisSize.min, children: [ for (final field in fields) Padding( padding: const EdgeInsets.only(bottom: 8), child: _HeaderTextField(field: field), ) ], ), ); } } class _HeaderTextField extends StatelessWidget { final HeaderFormField field; const _HeaderTextField({required this.field}); @override Widget build(BuildContext context) { return TextField( controller: field.textController, cursorColor: Theme.of(context).colorScheme.secondary, style: Theme.of(context).textTheme.bodyLarge!.copyWith(color: Colors.white), onTap: () {}, decoration: InputDecoration( border: OutlineInputBorder( borderRadius: BorderRadius.circular(4), borderSide: const BorderSide( width: 0, style: BorderStyle.none, ), ), contentPadding: const EdgeInsets.all(16), fillColor: cranePurple700, filled: true, hintText: field.title, floatingLabelBehavior: FloatingLabelBehavior.never, prefixIcon: Icon( field.iconData, size: 24, color: Theme.of(context).iconTheme.color, ), ), ); } }
gallery/lib/studies/crane/header_form.dart/0
{ "file_path": "gallery/lib/studies/crane/header_form.dart", "repo_id": "gallery", "token_count": 1577 }
817
import 'package:flutter/material.dart'; import 'package:gallery/studies/reply/model/email_store.dart'; import 'package:provider/provider.dart'; class ComposePage extends StatelessWidget { const ComposePage({super.key}); @override Widget build(BuildContext context) { var senderEmail = '[email protected]'; String subject = ''; String? recipient = 'Recipient'; String recipientAvatar = 'reply/avatars/avatar_0.jpg'; final emailStore = Provider.of<EmailStore>(context); if (emailStore.selectedEmailId >= 0) { final currentEmail = emailStore.currentEmail; subject = currentEmail.subject; recipient = currentEmail.sender; recipientAvatar = currentEmail.avatar; } return Scaffold( body: SafeArea( bottom: false, child: SizedBox( height: double.infinity, child: Material( color: Theme.of(context).cardColor, child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ _SubjectRow( subject: subject, ), const _SectionDivider(), _SenderAddressRow( senderEmail: senderEmail, ), const _SectionDivider(), _RecipientsRow( recipients: recipient, avatar: recipientAvatar, ), const _SectionDivider(), Padding( padding: const EdgeInsets.all(12), child: TextField( minLines: 6, maxLines: 20, decoration: const InputDecoration.collapsed( hintText: 'New Message...', ), autofocus: false, style: Theme.of(context).textTheme.bodyMedium, ), ), ], ), ), ), ), ), ); } } class _SubjectRow extends StatefulWidget { const _SubjectRow({required this.subject}); final String subject; @override _SubjectRowState createState() => _SubjectRowState(); } class _SubjectRowState extends State<_SubjectRow> { TextEditingController? _subjectController; @override void initState() { super.initState(); _subjectController = TextEditingController(text: widget.subject); } @override void dispose() { _subjectController!.dispose(); super.dispose(); } @override Widget build(BuildContext context) { final theme = Theme.of(context); final colorScheme = theme.colorScheme; return Padding( padding: const EdgeInsets.only(top: 8), child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ IconButton( key: const ValueKey('ReplyExit'), onPressed: () => Navigator.of(context).pop(), icon: Icon( Icons.close, color: colorScheme.onSurface, ), ), Expanded( child: TextField( controller: _subjectController, maxLines: 1, autofocus: false, style: theme.textTheme.titleLarge, decoration: InputDecoration.collapsed( hintText: 'Subject', hintStyle: theme.textTheme.titleLarge!.copyWith( color: theme.colorScheme.primary.withOpacity(0.5), ), ), ), ), IconButton( onPressed: () => Navigator.of(context).pop(), icon: IconButton( icon: ImageIcon( const AssetImage( 'reply/icons/twotone_send.png', package: 'flutter_gallery_assets', ), color: colorScheme.onSurface, ), onPressed: () => Navigator.of(context).pop(), ), ), ], ), ); } } class _SenderAddressRow extends StatefulWidget { const _SenderAddressRow({required this.senderEmail}); final String senderEmail; @override __SenderAddressRowState createState() => __SenderAddressRowState(); } class __SenderAddressRowState extends State<_SenderAddressRow> { late String senderEmail; @override void initState() { super.initState(); senderEmail = widget.senderEmail; } @override Widget build(BuildContext context) { final theme = Theme.of(context); final textTheme = theme.textTheme; final accounts = [ '[email protected]', '[email protected]', ]; return PopupMenuButton<String>( padding: EdgeInsets.zero, onSelected: (email) { setState(() { senderEmail = email; }); }, itemBuilder: (context) => <PopupMenuItem<String>>[ PopupMenuItem<String>( value: accounts[0], child: Text( accounts[0], style: textTheme.bodyMedium, ), ), PopupMenuItem<String>( value: accounts[1], child: Text( accounts[1], style: textTheme.bodyMedium, ), ), ], child: Padding( padding: const EdgeInsets.only( left: 12, top: 16, right: 10, bottom: 10, ), child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Text( senderEmail, style: textTheme.bodyMedium, ), ), Icon( Icons.arrow_drop_down, color: theme.colorScheme.onSurface, ), ], ), ), ); } } class _RecipientsRow extends StatelessWidget { const _RecipientsRow({ required this.recipients, required this.avatar, }); final String recipients; final String avatar; @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 12), child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Wrap( children: [ Chip( backgroundColor: Theme.of(context).chipTheme.secondarySelectedColor, padding: EdgeInsets.zero, avatar: CircleAvatar( backgroundImage: AssetImage( avatar, package: 'flutter_gallery_assets', ), ), label: Text( recipients, ), ), ], ), ), InkResponse( customBorder: const CircleBorder(), onTap: () {}, radius: 24, child: const Icon(Icons.add_circle_outline), ), ], ), ); } } class _SectionDivider extends StatelessWidget { const _SectionDivider(); @override Widget build(BuildContext context) { return const Divider( thickness: 1.1, indent: 10, endIndent: 10, ); } }
gallery/lib/studies/reply/compose_page.dart/0
{ "file_path": "gallery/lib/studies/reply/compose_page.dart", "repo_id": "gallery", "token_count": 3812 }
818
// Copyright 2019 The Flutter team. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/gallery_localizations.dart'; import 'package:gallery/data/gallery_options.dart'; import 'package:gallery/layout/adaptive.dart'; import 'package:gallery/layout/image_placeholder.dart'; import 'package:gallery/layout/letter_spacing.dart'; import 'package:gallery/layout/text_scale.dart'; import 'package:gallery/studies/shrine/app.dart'; import 'package:gallery/studies/shrine/theme.dart'; const _horizontalPadding = 24.0; double desktopLoginScreenMainAreaWidth({required BuildContext context}) { return min( 360 * reducedTextScale(context), MediaQuery.of(context).size.width - 2 * _horizontalPadding, ); } class LoginPage extends StatelessWidget { const LoginPage({super.key}); @override Widget build(BuildContext context) { final isDesktop = isDisplayDesktop(context); return ApplyTextOptions( child: isDesktop ? LayoutBuilder( builder: (context, constraints) => Scaffold( body: SafeArea( child: Center( child: SizedBox( width: desktopLoginScreenMainAreaWidth(context: context), child: const Column( mainAxisAlignment: MainAxisAlignment.center, children: [ _ShrineLogo(), SizedBox(height: 40), _UsernameTextField(), SizedBox(height: 16), _PasswordTextField(), SizedBox(height: 24), _CancelAndNextButtons(), SizedBox(height: 62), ], ), ), ), ), ), ) : Scaffold( body: SafeArea( child: ListView( restorationId: 'login_list_view', physics: const ClampingScrollPhysics(), padding: const EdgeInsets.symmetric( horizontal: _horizontalPadding, ), children: const [ SizedBox(height: 80), _ShrineLogo(), SizedBox(height: 120), _UsernameTextField(), SizedBox(height: 12), _PasswordTextField(), _CancelAndNextButtons(), ], ), ), ), ); } } class _ShrineLogo extends StatelessWidget { const _ShrineLogo(); @override Widget build(BuildContext context) { return ExcludeSemantics( child: Column( children: [ const FadeInImagePlaceholder( image: AssetImage('packages/shrine_images/diamond.png'), placeholder: SizedBox( width: 34, height: 34, ), ), const SizedBox(height: 16), Text( 'SHRINE', style: Theme.of(context).textTheme.headlineSmall, ), ], ), ); } } class _UsernameTextField extends StatelessWidget { const _UsernameTextField(); @override Widget build(BuildContext context) { final colorScheme = Theme.of(context).colorScheme; return TextField( textInputAction: TextInputAction.next, restorationId: 'username_text_field', cursorColor: colorScheme.onSurface, decoration: InputDecoration( labelText: GalleryLocalizations.of(context)!.shrineLoginUsernameLabel, labelStyle: TextStyle( letterSpacing: letterSpacingOrNone(mediumLetterSpacing), ), ), ); } } class _PasswordTextField extends StatelessWidget { const _PasswordTextField(); @override Widget build(BuildContext context) { final colorScheme = Theme.of(context).colorScheme; return TextField( restorationId: 'password_text_field', cursorColor: colorScheme.onSurface, obscureText: true, decoration: InputDecoration( labelText: GalleryLocalizations.of(context)!.shrineLoginPasswordLabel, labelStyle: TextStyle( letterSpacing: letterSpacingOrNone(mediumLetterSpacing), ), ), ); } } class _CancelAndNextButtons extends StatelessWidget { const _CancelAndNextButtons(); @override Widget build(BuildContext context) { final colorScheme = Theme.of(context).colorScheme; final isDesktop = isDisplayDesktop(context); final buttonTextPadding = isDesktop ? const EdgeInsets.symmetric(horizontal: 24, vertical: 16) : EdgeInsets.zero; return Padding( padding: isDesktop ? EdgeInsets.zero : const EdgeInsets.all(8), child: OverflowBar( spacing: isDesktop ? 0 : 8, alignment: MainAxisAlignment.end, children: [ TextButton( style: TextButton.styleFrom( shape: const BeveledRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(7)), ), ), onPressed: () { // The login screen is immediately displayed on top of // the Shrine home screen using onGenerateRoute and so // rootNavigator must be set to true in order to get out // of Shrine completely. Navigator.of(context, rootNavigator: true).pop(); }, child: Padding( padding: buttonTextPadding, child: Text( GalleryLocalizations.of(context)!.shrineCancelButtonCaption, style: TextStyle(color: colorScheme.onSurface), ), ), ), ElevatedButton( style: ElevatedButton.styleFrom( elevation: 8, shape: const BeveledRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(7)), ), ), onPressed: () { Navigator.of(context).restorablePushNamed(ShrineApp.homeRoute); }, child: Padding( padding: buttonTextPadding, child: Text( GalleryLocalizations.of(context)!.shrineNextButtonCaption, style: TextStyle( letterSpacing: letterSpacingOrNone(largeLetterSpacing)), ), ), ), ], ), ); } }
gallery/lib/studies/shrine/login.dart/0
{ "file_path": "gallery/lib/studies/shrine/login.dart", "repo_id": "gallery", "token_count": 3256 }
819
// Copyright 2019 The Flutter team. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:gallery/studies/shrine/colors.dart'; const List<Offset> _vertices = [ Offset(0, -14), Offset(-17, 14), Offset(17, 14), Offset(0, -14), Offset(0, -7.37), Offset(10.855, 10.48), Offset(-10.855, 10.48), Offset(0, -7.37), ]; class TriangleCategoryIndicator extends CustomPainter { const TriangleCategoryIndicator( this.triangleWidth, this.triangleHeight, ); final double triangleWidth; final double triangleHeight; @override void paint(Canvas canvas, Size size) { final myPath = Path() ..addPolygon( List.from(_vertices.map<Offset>((vertex) { return Offset(size.width, size.height) / 2 + Offset(vertex.dx * triangleWidth / 34, vertex.dy * triangleHeight / 28); })), true, ); final myPaint = Paint()..color = shrinePink400; canvas.drawPath(myPath, myPaint); } @override bool shouldRepaint(TriangleCategoryIndicator oldDelegate) => false; @override bool shouldRebuildSemantics(TriangleCategoryIndicator oldDelegate) => false; }
gallery/lib/studies/shrine/triangle_category_indicator.dart/0
{ "file_path": "gallery/lib/studies/shrine/triangle_category_indicator.dart", "repo_id": "gallery", "token_count": 492 }
820
// Copyright 2020 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; const Duration _animationCheckingInterval = Duration(milliseconds: 50); const Duration _scrollAnimationLength = Duration(milliseconds: 300); Offset _absoluteTopLeft(RenderObject renderObject) => (renderObject as RenderBox).localToGlobal(Offset.zero); Rect _absoluteRect(RenderObject renderObject) => _absoluteTopLeft(renderObject) & renderObject.paintBounds.size; Size _windowSize(BuildContext context) => MediaQuery.of(context).size; Rect _windowRect(BuildContext context) => Offset.zero & _windowSize(context); bool _isSuperset({required Rect large, required Rect small}) => large.top <= small.top && large.left <= small.left && large.bottom >= small.bottom && large.right >= small.right; const _minFreeRoomRequirement = 5.0; /// Whether [small] is a subset of [large] and has sufficient room /// inside [large], at the end of [large] specified by [axisDirection]. bool _hasSufficientFreeRoom({ required Rect large, required Rect small, required AxisDirection axisDirection, }) { if (!_isSuperset(large: large, small: small)) { return false; } else { bool result; switch (axisDirection) { case AxisDirection.down: result = large.bottom - small.bottom >= _minFreeRoomRequirement; break; case AxisDirection.right: result = large.right - small.right >= _minFreeRoomRequirement; break; case AxisDirection.left: result = small.left - large.left >= _minFreeRoomRequirement; break; case AxisDirection.up: result = small.top - large.top >= _minFreeRoomRequirement; break; } return result; } } Future<void> animationStops() async { if (!WidgetsBinding.instance.hasScheduledFrame) return; final Completer stopped = Completer<void>(); Timer.periodic(_animationCheckingInterval, (timer) { if (!WidgetsBinding.instance.hasScheduledFrame) { stopped.complete(); timer.cancel(); } }); await stopped.future; } Future<void> scrollUntilVisible({ required Element element, bool strict = false, bool animated = true, }) async { final elementRenderObject = element.renderObject!; final elementRect = _absoluteRect(elementRenderObject); final scrollable = Scrollable.of(element); final viewport = RenderAbstractViewport.of(elementRenderObject); final visibleWindow = _absoluteRect(viewport).intersect(_windowRect(element)); // If there is free room between this demo button and the end of // the scrollable, the next demo button is visible and can be tapped. if (!strict && _hasSufficientFreeRoom( large: visibleWindow, small: elementRect, axisDirection: scrollable.axisDirection, )) { return; } late double pixelsToBeMoved; switch (scrollable.axisDirection) { case AxisDirection.down: pixelsToBeMoved = elementRect.top - visibleWindow.top; break; case AxisDirection.right: pixelsToBeMoved = elementRect.left - visibleWindow.left; break; case AxisDirection.left: pixelsToBeMoved = visibleWindow.right - elementRect.right; break; case AxisDirection.up: pixelsToBeMoved = visibleWindow.bottom - elementRect.bottom; break; } final targetPixels = scrollable.position.pixels + pixelsToBeMoved; final restrictedTargetPixels = targetPixels .clamp( scrollable.position.minScrollExtent, scrollable.position.maxScrollExtent, ) .toDouble(); await scrollToPosition( scrollable: scrollable, pixels: restrictedTargetPixels, animated: animated, ); } Future<void> scrollToExtreme({ required ScrollableState? scrollable, bool toEnd = false, bool animated = true, }) async { final targetPixels = toEnd ? scrollable!.position.maxScrollExtent : scrollable!.position.minScrollExtent; await scrollToPosition( scrollable: scrollable, pixels: targetPixels, animated: animated, ); } Future<void> scrollToPosition({ required ScrollableState? scrollable, required double pixels, bool animated = true, }) async { if (animated) { await scrollable!.position.animateTo( pixels, duration: _scrollAnimationLength, curve: Curves.easeInOut, ); } else { scrollable!.position.jumpTo(pixels); } await animationStops(); }
gallery/test_benchmarks/benchmarks/scroll.dart/0
{ "file_path": "gallery/test_benchmarks/benchmarks/scroll.dart", "repo_id": "gallery", "token_count": 1589 }
821
/// {@template game_url} /// A URL to a game. /// {@endtemplate} class GameUrl { /// {@macro game_url} const GameUrl(this.url); /// The URL. final String url; }
io_flip/api/lib/game_url.dart/0
{ "file_path": "io_flip/api/lib/game_url.dart", "repo_id": "io_flip", "token_count": 64 }
822
// ignore_for_file: prefer_const_constructors import 'dart:math'; import 'package:cards_repository/cards_repository.dart'; import 'package:config_repository/config_repository.dart'; import 'package:db_client/db_client.dart'; import 'package:game_domain/game_domain.dart'; import 'package:game_script_machine/game_script_machine.dart'; import 'package:image_model_repository/image_model_repository.dart'; import 'package:language_model_repository/language_model_repository.dart'; import 'package:mocktail/mocktail.dart'; import 'package:test/test.dart'; class _MockImageModelRepository extends Mock implements ImageModelRepository {} class _MockLanguageModelRepository extends Mock implements LanguageModelRepository {} class _MockConfigRepository extends Mock implements ConfigRepository {} class _MockRandom extends Mock implements Random {} class _MockDbClient extends Mock implements DbClient {} class _MockGameScriptMachine extends Mock implements GameScriptMachine {} void main() { group('CardsRepository', () { late ImageModelRepository imageModelRepository; late LanguageModelRepository languageModelRepository; late CardsRepository cardsRepository; late ConfigRepository configRepository; late DbClient dbClient; late GameScriptMachine gameScriptMachine; late Random rng; setUpAll(() { registerFallbackValue( DbEntityRecord( id: 'id', ), ); }); setUp(() { dbClient = _MockDbClient(); rng = _MockRandom(); when(() => rng.nextInt(any())).thenReturn(0); gameScriptMachine = _MockGameScriptMachine(); when(gameScriptMachine.rollCardRarity).thenReturn(false); when( () => gameScriptMachine.rollCardPower( isRare: any(named: 'isRare'), ), ).thenReturn(10); imageModelRepository = _MockImageModelRepository(); languageModelRepository = _MockLanguageModelRepository(); configRepository = _MockConfigRepository(); when(configRepository.getCardVariations).thenAnswer((_) async => 8); cardsRepository = CardsRepository( imageModelRepository: imageModelRepository, languageModelRepository: languageModelRepository, configRepository: configRepository, dbClient: dbClient, gameScriptMachine: gameScriptMachine, rng: rng, ); }); test('can be instantiated', () { expect( CardsRepository( imageModelRepository: _MockImageModelRepository(), languageModelRepository: _MockLanguageModelRepository(), configRepository: _MockConfigRepository(), dbClient: dbClient, gameScriptMachine: gameScriptMachine, ), isNotNull, ); }); group('generateCard', () { setUp(() { when( () => imageModelRepository.generateImages( characterClass: any(named: 'characterClass'), variationsAvailable: any(named: 'variationsAvailable'), deckSize: any(named: 'deckSize'), ), ).thenAnswer( (_) async => [ ImageResult( character: 'dash', characterClass: 'mage', location: 'beach', url: 'https://image1.png', ), ImageResult( character: 'dash', characterClass: 'mage', location: 'beach', url: 'https://image2.png', ), ImageResult( character: 'dash', characterClass: 'mage', location: 'beach', url: 'https://image3.png', ), ], ); when( () => languageModelRepository.generateCardName( characterName: 'dash', characterClass: 'mage', characterPower: 'baggles', ), ).thenAnswer((_) async => 'Super Bird'); when( () => languageModelRepository.generateFlavorText( character: 'dash', characterPower: 'baggles', characterClass: 'mage', location: 'beach', ), ).thenAnswer((_) async => 'Super Bird Is Ready!'); when(() => dbClient.add('cards', any())).thenAnswer((_) async => 'abc'); }); test('uses the configuration for card variations', () async { await cardsRepository.generateCards( characterClass: 'mage', characterPower: 'baggles', ); verify(configRepository.getCardVariations).called(1); }); test('generates a common card', () async { final cards = await cardsRepository.generateCards( characterClass: 'mage', characterPower: 'baggles', ); expect( cards, equals( [ Card( id: 'abc', name: 'Super Bird', description: 'Super Bird Is Ready!', image: 'https://image1.png', rarity: false, power: 10, suit: Suit.fire, ), Card( id: 'abc', name: 'Super Bird', description: 'Super Bird Is Ready!', image: 'https://image2.png', rarity: false, power: 10, suit: Suit.fire, ), Card( id: 'abc', name: 'Super Bird', description: 'Super Bird Is Ready!', image: 'https://image3.png', rarity: false, power: 10, suit: Suit.fire, ), ], ), ); }); test('saves the card in the db', () async { await cardsRepository.generateCards( characterClass: 'mage', characterPower: 'baggles', ); verify( () => dbClient.add('cards', { 'name': 'Super Bird', 'description': 'Super Bird Is Ready!', 'image': 'https://image1.png', 'rarity': false, 'power': 10, 'suit': 'fire', }), ).called(1); verify( () => dbClient.add('cards', { 'name': 'Super Bird', 'description': 'Super Bird Is Ready!', 'image': 'https://image2.png', 'rarity': false, 'power': 10, 'suit': 'fire', }), ).called(1); verify( () => dbClient.add('cards', { 'name': 'Super Bird', 'description': 'Super Bird Is Ready!', 'image': 'https://image3.png', 'rarity': false, 'power': 10, 'suit': 'fire', }), ).called(1); }); test('generates a rare card', () async { when(gameScriptMachine.rollCardRarity).thenReturn(true); final cards = await cardsRepository.generateCards( characterClass: 'mage', characterPower: 'baggles', ); expect( cards, contains( Card( id: 'abc', name: 'Super Bird', description: 'Super Bird Is Ready!', image: 'https://image1.png', rarity: true, power: 10, suit: Suit.fire, ), ), ); verify(() => gameScriptMachine.rollCardPower(isRare: true)).called(3); }); for (var i = 0; i < Suit.values.length; i++) { test('generates a card from the ${Suit.values[i]} element', () async { when(() => rng.nextInt(Suit.values.length)).thenReturn(i); final cards = await cardsRepository.generateCards( characterClass: 'mage', characterPower: 'baggles', ); expect( cards, contains( Card( id: 'abc', name: 'Super Bird', description: 'Super Bird Is Ready!', image: 'https://image1.png', rarity: false, power: 10, suit: Suit.values[i], ), ), ); }); } }); group('createCpuDeck', () { late List<Card> cards; setUp(() { when(() => dbClient.add('decks', any())) .thenAnswer((_) async => 'deck'); cards = List.generate( 12, (index) => Card( id: '$index', name: '$index', description: '$index', image: '$index', power: index, rarity: false, suit: Suit.air, ), ); }); test('creates a deck from a list of cards with force 0.92', () async { when(rng.nextDouble).thenReturn(0.8); final deckId = await cardsRepository.createCpuDeck( cards: cards, userId: 'mock-userId', ); expect(deckId, equals('deck')); verify( () => dbClient.add('decks', { 'cards': ['8', '9', '10'], 'userId': 'CPU_mock-userId', }), ).called(1); }); test('creates a deck from a list of cards with minimum force: 0.6', () async { when(rng.nextDouble).thenReturn(0); final deckId = await cardsRepository.createCpuDeck( cards: cards, userId: 'mock-userId', ); expect(deckId, equals('deck')); verify( () => dbClient.add('decks', { 'cards': ['5', '6', '7'], 'userId': 'CPU_mock-userId', }), ).called(1); }); test('creates a deck from a list of cards with maximum force 1', () async { when(rng.nextDouble).thenReturn(1); final deckId = await cardsRepository.createCpuDeck( cards: cards, userId: 'mock-userId', ); expect(deckId, equals('deck')); verify( () => dbClient.add('decks', { 'cards': ['9', '10', '11'], 'userId': 'CPU_mock-userId', }), ).called(1); }); }); group('createDeck', () { setUp(() { when(() => dbClient.add('decks', any())) .thenAnswer((_) async => 'deck'); }); test('creates a deck from a list of card ids', () async { final deckId = await cardsRepository.createDeck( cardIds: ['a', 'b'], userId: 'mock-userId', ); expect(deckId, equals('deck')); }); }); group('getDeck', () { const deckId = 'deckId'; const userId = 'userId'; const cardId = 'card1'; setUp(() { when(() => dbClient.getById('decks', any())).thenAnswer( (_) async => DbEntityRecord( id: deckId, data: const { 'userId': userId, 'cards': [cardId], 'shareImage': 'https://share-image.png', }, ), ); when(() => dbClient.getById('cards', cardId)).thenAnswer( (_) async => DbEntityRecord( id: cardId, data: const { 'name': cardId, 'description': cardId, 'image': cardId, 'power': 10, 'rarity': false, 'suit': 'air', }, ), ); }); test('returns a deck', () async { final deck = await cardsRepository.getDeck(deckId); expect( deck, equals( Deck( id: deckId, userId: userId, shareImage: 'https://share-image.png', cards: const [ Card( id: cardId, name: cardId, description: cardId, image: cardId, power: 10, rarity: false, suit: Suit.air, ), ], ), ), ); }); test('returns null when there is no deck for that id', () async { when(() => dbClient.getById('decks', any())).thenAnswer( (_) async => null, ); final deck = await cardsRepository.getDeck(deckId); expect(deck, isNull); }); }); group('getCard', () { const cardId = 'cardId'; const card = Card( id: cardId, name: 'name', description: 'description', image: 'image', power: 10, rarity: true, suit: Suit.fire, ); test('returns the card', () async { when(() => dbClient.getById('cards', cardId)).thenAnswer( (_) async => DbEntityRecord( id: cardId, data: const { 'name': 'name', 'description': 'description', 'image': 'image', 'power': 10, 'rarity': true, 'suit': 'fire', }, ), ); final returnedCard = await cardsRepository.getCard(cardId); expect(returnedCard, equals(card)); }); test('returns null if card if not found', () async { when(() => dbClient.getById('cards', cardId)).thenAnswer( (_) async => null, ); final returnedCard = await cardsRepository.getCard(cardId); expect(returnedCard, isNull); }); }); group('updateCard', () { test('updates a card', () async { final card = Card( id: 'abc', name: 'Super Bird', description: 'Super Bird Is Ready!', image: 'https://image.png', rarity: false, power: 10, suit: Suit.fire, shareImage: 'https://share.png', ); when(() => dbClient.update('cards', any())).thenAnswer( (_) async {}, ); await cardsRepository.updateCard(card); verify( () => dbClient.update( 'cards', DbEntityRecord( id: card.id, data: const { 'name': 'Super Bird', 'description': 'Super Bird Is Ready!', 'image': 'https://image.png', 'rarity': false, 'power': 10, 'suit': 'fire', 'shareImage': 'https://share.png', }, ), ), ).called(1); }); }); group('updateDeck', () { test('updates a deck', () async { final deck = Deck( id: 'abc', userId: 'userId', shareImage: 'https://share.png', cards: const [ Card( id: 'card1', name: 'Super Bird', description: 'Super Bird Is Ready!', image: 'https://image.png', rarity: false, power: 10, suit: Suit.air, shareImage: 'https://share.png', ), ], ); when(() => dbClient.update('decks', any())).thenAnswer( (_) async {}, ); await cardsRepository.updateDeck(deck); verify( () => dbClient.update( 'decks', DbEntityRecord( id: deck.id, data: const { 'userId': 'userId', 'shareImage': 'https://share.png', 'cards': ['card1'], }, ), ), ).called(1); }); }); }); }
io_flip/api/packages/cards_repository/test/src/cards_repository_test.dart/0
{ "file_path": "io_flip/api/packages/cards_repository/test/src/cards_repository_test.dart", "repo_id": "io_flip", "token_count": 8071 }
823
// ignore_for_file: prefer_const_constructors import 'package:db_client/db_client.dart'; import 'package:firedart/firedart.dart'; import 'package:grpc/grpc.dart'; import 'package:mocktail/mocktail.dart'; import 'package:test/test.dart'; class _MockFirestore extends Mock implements Firestore {} class _MockCollectionReference extends Mock implements CollectionReference {} class _MockDocument extends Mock implements Document {} class _MockDocumentReference extends Mock implements DocumentReference {} class _MockQueryReference extends Mock implements QueryReference {} void main() { group('DbEntityRecord', () { test('supports equality', () { expect( DbEntityRecord(id: 'A', data: const {'name': 'dash'}), equals(DbEntityRecord(id: 'A', data: const {'name': 'dash'})), ); expect( DbEntityRecord(id: 'A', data: const {'name': 'dash'}), isNot(equals(DbEntityRecord(id: 'B', data: const {'name': 'dash'}))), ); expect( DbEntityRecord(id: 'A', data: const {'name': 'dash'}), isNot(equals(DbEntityRecord(id: 'A', data: const {'name': 'furn'}))), ); }); }); group('DbClient', () { test('can be instantiated', () { expect(DbClient(firestore: _MockFirestore()), isNotNull); }); test('can be initialized', () { expect(DbClient.initialize('A', useEmulator: true), isNotNull); }); test('returns instance anyway if firestore is already initialized', () { expect(DbClient.initialize('A', useEmulator: true), isNotNull); expect(DbClient.initialize('A', useEmulator: true), isNotNull); }); group('add', () { test('insert into firestore', () async { final firestore = _MockFirestore(); final collection = _MockCollectionReference(); when(() => firestore.collection('birds')).thenReturn(collection); final document = _MockDocument(); when(() => document.id).thenReturn('id'); when(() => collection.add(any())).thenAnswer((_) async => document); final client = DbClient(firestore: firestore); final id = await client.add('birds', {'name': 'Dash'}); expect(id, equals('id')); verify(() => collection.add({'name': 'Dash'})).called(1); }); test('tries 3 times when getting a GrpcError before giving up', () async { final firestore = _MockFirestore(); when(() => firestore.collection('birds')).thenThrow( GrpcError.invalidArgument(), ); final client = DbClient(firestore: firestore); await expectLater( () => client.add('birds', {'name': 'Dash'}), throwsA(isA<GrpcError>()), ); verify(() => firestore.collection('birds')).called(3); }); }); group('set', () { test('insert into firestore', () async { final firestore = _MockFirestore(); final collection = _MockCollectionReference(); final ref = _MockDocumentReference(); when(() => firestore.collection('birds')).thenReturn(collection); final document = _MockDocument(); when(() => collection.document(any())).thenAnswer((_) => ref); when(() => ref.set(any())).thenAnswer((_) async => document); final client = DbClient(firestore: firestore); await client.set( 'birds', DbEntityRecord(id: 'id', data: const {'name': 'Dash'}), ); verify(() => firestore.collection('birds')).called(1); verify(() => collection.document('id')).called(1); verify(() => ref.set({'name': 'Dash'})).called(1); }); test('tries 3 times when getting a GrpcError before giving up', () async { final firestore = _MockFirestore(); when(() => firestore.collection('birds')).thenThrow( GrpcError.invalidArgument(), ); final client = DbClient(firestore: firestore); await expectLater( () => client.set( 'birds', DbEntityRecord(id: 'id', data: const {'name': 'Dash'}), ), throwsA( isA<GrpcError>(), ), ); verify(() => firestore.collection('birds')).called(3); }); }); group('getById', () { test('gets an entity in firestore', () async { final firestore = _MockFirestore(); final collection = _MockCollectionReference(); when(() => firestore.collection('birds')).thenReturn(collection); final documentReference = _MockDocumentReference(); when(() => documentReference.exists).thenAnswer((_) async => true); final document = _MockDocument(); when(() => document.id).thenReturn('id'); when(() => document.map).thenReturn({'name': 'Dash'}); when(() => collection.document('id')).thenReturn(documentReference); when(documentReference.get).thenAnswer((_) async => document); final client = DbClient(firestore: firestore); final record = await client.getById('birds', 'id'); expect(record, isNotNull); expect(record!.id, equals('id')); expect(record.data['name'], equals('Dash')); }); test('tries 3 times when getting a GrpcError before giving up', () async { final firestore = _MockFirestore(); when(() => firestore.collection('birds')).thenThrow( GrpcError.invalidArgument(), ); final client = DbClient(firestore: firestore); await expectLater( () => client.getById('birds', 'id'), throwsA( isA<GrpcError>(), ), ); verify(() => firestore.collection('birds')).called(3); }); test("returns null when the entity doesn't exists", () async { final firestore = _MockFirestore(); final collection = _MockCollectionReference(); when(() => firestore.collection('birds')).thenReturn(collection); final documentReference = _MockDocumentReference(); when(() => documentReference.exists).thenAnswer((_) async => false); when(() => collection.document('id')).thenReturn(documentReference); final client = DbClient(firestore: firestore); final map = await client.getById('birds', 'id'); expect(map, isNull); }); }); group('update', () { test('updates and entity ad firestore', () async { final firestore = _MockFirestore(); final collection = _MockCollectionReference(); final reference = _MockDocumentReference(); when(() => reference.update(any())).thenAnswer((_) async {}); when(() => firestore.collection('birds')).thenReturn(collection); when(() => collection.document('1')).thenReturn(reference); final client = DbClient(firestore: firestore); await client.update( 'birds', DbEntityRecord( id: '1', data: const { 'name': 'Dash', }, ), ); verify(() => reference.update({'name': 'Dash'})).called(1); }); test('tries 3 times when getting a GrpcError before giving up', () async { final firestore = _MockFirestore(); when(() => firestore.collection('birds')).thenThrow( GrpcError.invalidArgument(), ); final client = DbClient(firestore: firestore); await expectLater( () => client.update( 'birds', DbEntityRecord( id: '1', data: const { 'name': 'Dash', }, ), ), throwsA( isA<GrpcError>(), ), ); verify(() => firestore.collection('birds')).called(3); }); }); group('findBy', () { test('returns the found records', () async { final firestore = _MockFirestore(); final collection = _MockCollectionReference(); when(() => firestore.collection('birds')).thenReturn(collection); final queryReference = _MockQueryReference(); when(() => collection.where('type', isEqualTo: 'big')) .thenReturn(queryReference); when(queryReference.get).thenAnswer((_) async { final record1 = _MockDocument(); when(() => record1.id).thenReturn('1'); when(() => record1.map).thenReturn({ 'name': 'dash', }); final record2 = _MockDocument(); when(() => record2.id).thenReturn('2'); when(() => record2.map).thenReturn({ 'name': 'furn', }); return [ record1, record2, ]; }); final client = DbClient(firestore: firestore); final result = await client.findBy('birds', 'type', 'big'); expect(result.first.id, equals('1')); expect(result.first.data, equals({'name': 'dash'})); expect(result.last.id, equals('2')); expect(result.last.data, equals({'name': 'furn'})); }); test('tries 3 times when getting a GrpcError before giving up', () async { final firestore = _MockFirestore(); when(() => firestore.collection('birds')).thenThrow( GrpcError.invalidArgument(), ); final client = DbClient(firestore: firestore); await expectLater( () => client.findBy('birds', 'type', 'big'), throwsA( isA<GrpcError>(), ), ); verify(() => firestore.collection('birds')).called(3); }); test('returns empty when no results are returned', () async { final firestore = _MockFirestore(); final collection = _MockCollectionReference(); when(() => firestore.collection('birds')).thenReturn(collection); final queryReference = _MockQueryReference(); when(() => collection.where('type', isEqualTo: 'big')) .thenReturn(queryReference); when(queryReference.get).thenAnswer((_) async => []); final client = DbClient(firestore: firestore); final result = await client.findBy('birds', 'type', 'big'); expect(result, isEmpty); }); }); group('find', () { test('returns the found records', () async { final firestore = _MockFirestore(); final collection = _MockCollectionReference(); when(() => firestore.collection('birds')).thenReturn(collection); final queryReference = _MockQueryReference(); when(() => collection.where('type', isEqualTo: 'big')) .thenReturn(queryReference); when(() => queryReference.where('age', isEqualTo: 'old')) .thenReturn(queryReference); when(queryReference.get).thenAnswer((_) async { final record1 = _MockDocument(); when(() => record1.id).thenReturn('1'); when(() => record1.map).thenReturn({ 'name': 'dash', }); final record2 = _MockDocument(); when(() => record2.id).thenReturn('2'); when(() => record2.map).thenReturn({ 'name': 'furn', }); return [ record1, record2, ]; }); final client = DbClient(firestore: firestore); final result = await client.find( 'birds', { 'type': 'big', 'age': 'old', }, ); expect(result.first.id, equals('1')); expect(result.first.data, equals({'name': 'dash'})); expect(result.last.id, equals('2')); expect(result.last.data, equals({'name': 'furn'})); }); test('tries 3 times when getting a GrpcError before giving up', () async { final firestore = _MockFirestore(); when(() => firestore.collection('birds')).thenThrow( GrpcError.invalidArgument(), ); final client = DbClient(firestore: firestore); await expectLater( () => client.find( 'birds', { 'type': 'big', 'age': 'old', }, ), throwsA( isA<GrpcError>(), ), ); verify(() => firestore.collection('birds')).called(3); }); test('returns empty when no results are returned', () async { final firestore = _MockFirestore(); final collection = _MockCollectionReference(); when(() => firestore.collection('birds')).thenReturn(collection); final queryReference = _MockQueryReference(); when(() => collection.where('type', isEqualTo: 'big')) .thenReturn(queryReference); when(() => queryReference.where('age', isEqualTo: 'old')) .thenReturn(queryReference); when(queryReference.get).thenAnswer((_) async => []); final client = DbClient(firestore: firestore); final result = await client.find( 'birds', { 'type': 'big', 'age': 'old', }, ); expect(result, isEmpty); }); }); group('orderBy', () { test('returns the found records', () async { final firestore = _MockFirestore(); final collection = _MockCollectionReference(); when(() => firestore.collection('birds')).thenReturn(collection); final queryReference = _MockQueryReference(); when(() => collection.orderBy('score', descending: true)) .thenReturn(queryReference); when(() => queryReference.limit(any())).thenReturn(queryReference); when(queryReference.get).thenAnswer((_) async { final record1 = _MockDocument(); when(() => record1.id).thenReturn('1'); when(() => record1.map).thenReturn({ 'score': 1, }); final record2 = _MockDocument(); when(() => record2.id).thenReturn('2'); when(() => record2.map).thenReturn({ 'score': 2, }); return [ record1, record2, ]; }); final client = DbClient(firestore: firestore); final result = await client.orderBy('birds', 'score'); expect(result.first.id, equals('1')); expect(result.first.data, equals({'score': 1})); expect(result.last.id, equals('2')); expect(result.last.data, equals({'score': 2})); }); test('tries 3 times when getting a GrpcError before giving up', () async { final firestore = _MockFirestore(); when(() => firestore.collection('birds')).thenThrow( GrpcError.invalidArgument(), ); final client = DbClient(firestore: firestore); await expectLater( () => client.orderBy('birds', 'score'), throwsA( isA<GrpcError>(), ), ); verify(() => firestore.collection('birds')).called(3); }); test('returns empty when no results are returned', () async { final firestore = _MockFirestore(); final collection = _MockCollectionReference(); when(() => firestore.collection('birds')).thenReturn(collection); final queryReference = _MockQueryReference(); when(() => collection.orderBy('score', descending: true)) .thenReturn(queryReference); when(() => queryReference.limit(any())).thenReturn(queryReference); when(queryReference.get).thenAnswer((_) async => []); final client = DbClient(firestore: firestore); final result = await client.orderBy('birds', 'score'); expect(result, isEmpty); }); }); }); }
io_flip/api/packages/db_client/test/src/db_client_test.dart/0
{ "file_path": "io_flip/api/packages/db_client/test/src/db_client_test.dart", "repo_id": "io_flip", "token_count": 6716 }
824
// ignore_for_file: prefer_const_constructors, one_member_abstracts import 'dart:typed_data'; import 'package:firebase_cloud_storage/firebase_cloud_storage.dart'; import 'package:grpc/grpc.dart' hide Response; import 'package:http/http.dart'; import 'package:mocktail/mocktail.dart'; import 'package:test/test.dart'; class _MockHttpBasedAuthenticator extends Mock implements HttpBasedAuthenticator { @override Future<void> authenticate(Map<String, String> metadata, String uri) async { metadata['mock_header'] = 'mock_value'; } } class _MockResponse extends Mock implements Response {} abstract class __HttpClient { Future<Response> post(Uri uri, {Map<String, String>? headers, dynamic body}); } class _MockHttpClient extends Mock implements __HttpClient {} void main() { group('FirebaseCloudStorage', () { late FirebaseCloudStorage firebaseCloudStorage; late HttpBasedAuthenticator authenticator; late Response response; late __HttpClient httpClient; setUpAll(() { registerFallbackValue(Uri()); }); setUp(() { authenticator = _MockHttpBasedAuthenticator(); response = _MockResponse(); when(() => response.statusCode).thenReturn(200); httpClient = _MockHttpClient(); when( () => httpClient.post( any(), headers: any(named: 'headers'), body: any<dynamic>(named: 'body'), ), ).thenAnswer((_) async => response); firebaseCloudStorage = FirebaseCloudStorage( bucketName: 'bucketName', authenticatorBuilder: (_) async => authenticator, postCall: httpClient.post, ); }); test('can be instantiated', () { expect( FirebaseCloudStorage(bucketName: ''), isNotNull, ); }); test('returns the uploaded object url', () async { final url = await firebaseCloudStorage.uploadFile( Uint8List(0), 'filename', ); expect( url, equals( 'https://firebasestorage.googleapis.com/v0/b/bucketName/o/filename?alt=media', ), ); }); test('correctly encode complex urls', () async { final url = await firebaseCloudStorage.uploadFile( Uint8List(0), 'share/filename', ); expect( url, equals( 'https://firebasestorage.googleapis.com/v0/b/bucketName/o/share%2Ffilename?alt=media', ), ); }); test('makes the correct request', () async { await firebaseCloudStorage.uploadFile( Uint8List(0), 'filename', ); verify( () => httpClient.post( Uri.parse( 'https://storage.googleapis.com/upload/storage/v1/b/bucketName/o?uploadType=media&name=filename', ), headers: { 'mock_header': 'mock_value', 'Content-Type': 'image/png', }, body: Uint8List(0), ), ); }); test( 'throws FirebaseCloudStorageUploadFailure when the request fails', () async { when(() => response.statusCode).thenReturn(500); when(() => response.body).thenReturn('Error'); await expectLater( () => firebaseCloudStorage.uploadFile( Uint8List(0), 'filename', ), throwsA( isA<FirebaseCloudStorageUploadFailure>().having( (e) => e.toString(), 'message', equals('Error'), ), ), ); }, ); }); }
io_flip/api/packages/firebase_cloud_storage/test/src/firebase_cloud_storage_test.dart/0
{ "file_path": "io_flip/api/packages/firebase_cloud_storage/test/src/firebase_cloud_storage_test.dart", "repo_id": "io_flip", "token_count": 1549 }
825
// GENERATED CODE - DO NOT MODIFY BY HAND part of 'match_state.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** MatchState _$MatchStateFromJson(Map<String, dynamic> json) => MatchState( id: json['id'] as String, matchId: json['matchId'] as String, hostPlayedCards: (json['hostPlayedCards'] as List<dynamic>) .map((e) => e as String) .toList(), guestPlayedCards: (json['guestPlayedCards'] as List<dynamic>) .map((e) => e as String) .toList(), result: $enumDecodeNullable(_$MatchResultEnumMap, json['result']), ); Map<String, dynamic> _$MatchStateToJson(MatchState instance) => <String, dynamic>{ 'id': instance.id, 'matchId': instance.matchId, 'hostPlayedCards': instance.hostPlayedCards, 'guestPlayedCards': instance.guestPlayedCards, 'result': _$MatchResultEnumMap[instance.result], }; const _$MatchResultEnumMap = { MatchResult.host: 'host', MatchResult.guest: 'guest', MatchResult.draw: 'draw', };
io_flip/api/packages/game_domain/lib/src/models/match_state.g.dart/0
{ "file_path": "io_flip/api/packages/game_domain/lib/src/models/match_state.g.dart", "repo_id": "io_flip", "token_count": 434 }
826
// ignore_for_file: prefer_const_constructors import 'package:game_domain/game_domain.dart'; import 'package:test/test.dart'; void main() { group('LeaderboardPlayer', () { test('can be instantiated', () { expect( LeaderboardPlayer( id: 'id', longestStreak: 1, initials: 'TST', ), isNotNull, ); }); final leaderboardPlayer = LeaderboardPlayer( id: 'id', longestStreak: 1, initials: 'TST', ); test('toJson returns the instance as json', () { expect( leaderboardPlayer.toJson(), equals({ 'id': 'id', 'longestStreak': 1, 'initials': 'TST', }), ); }); test('fromJson returns the correct instance', () { expect( LeaderboardPlayer.fromJson(const { 'id': 'id', 'longestStreak': 1, 'initials': 'TST', }), equals(leaderboardPlayer), ); }); test('supports equality', () { expect( LeaderboardPlayer(id: '', longestStreak: 1, initials: 'TST'), equals(LeaderboardPlayer(id: '', longestStreak: 1, initials: 'TST')), ); expect( LeaderboardPlayer( id: '', longestStreak: 1, initials: 'TST', ), isNot( equals(leaderboardPlayer), ), ); expect( LeaderboardPlayer( id: 'id', longestStreak: 2, initials: 'TST', ), isNot( equals(leaderboardPlayer), ), ); expect( LeaderboardPlayer( id: 'id', longestStreak: 1, initials: 'WOW', ), isNot( equals(leaderboardPlayer), ), ); }); }); }
io_flip/api/packages/game_domain/test/src/models/leaderboard_player_test.dart/0
{ "file_path": "io_flip/api/packages/game_domain/test/src/models/leaderboard_player_test.dart", "repo_id": "io_flip", "token_count": 932 }
827
// ignore_for_file: prefer_const_constructors import 'dart:math'; import 'package:game_domain/game_domain.dart'; import 'package:game_script_machine/game_script_machine.dart'; import 'package:mocktail/mocktail.dart'; import 'package:test/test.dart'; class _MockRandom extends Mock implements Random {} Card _makeCard(Suit suit, [int power = 0]) => Card( id: 'id', name: 'name', description: 'description', image: 'image', power: power, rarity: false, suit: suit, ); // All the possible pairs of suits, where the first item wins. const pairs = [ [Suit.fire, Suit.air], [Suit.fire, Suit.metal], [Suit.air, Suit.water], [Suit.air, Suit.earth], [Suit.metal, Suit.water], [Suit.metal, Suit.air], [Suit.earth, Suit.fire], [Suit.earth, Suit.metal], [Suit.water, Suit.fire], [Suit.water, Suit.earth], ]; void main() { group('GameScriptMachine', () { test('can be instantiated', () { expect(GameScriptMachine.initialize(defaultGameLogic), isNotNull); }); test('returns the currentScript', () { expect( GameScriptMachine.initialize(defaultGameLogic).currentScript, equals(defaultGameLogic), ); }); group('compare', () { test('correctly evaluates the result for different suits', () { final m = GameScriptMachine.initialize(defaultGameLogic); for (final pair in pairs) { final a = pair[0]; final b = pair[1]; expect(m.compareSuits(a, b), equals(1)); expect(m.compareSuits(b, a), equals(-1)); } }); test('correctly evaluates the result for the same suit and value', () { final m = GameScriptMachine.initialize(defaultGameLogic); for (final suit in Suit.values) { final a = _makeCard(suit); final b = _makeCard(suit); expect(m.compare(a, b), equals(0)); expect(m.compare(b, a), equals(0)); } }); test( 'correctly evaluates the result for the same suit and different values ' 'when winning suit has higher value', () { final m = GameScriptMachine.initialize(defaultGameLogic); for (final suit in Suit.values) { final a = _makeCard(suit, 10); final b = _makeCard(suit, 3); expect(m.compare(a, b), equals(1)); expect(m.compare(b, a), equals(-1)); } }, ); test( 'correctly evaluates the result for different suits and different ' 'values when winning suit has the lower value but modifier is not ' 'enough', () { final m = GameScriptMachine.initialize(defaultGameLogic); for (final pair in pairs) { final aSuit = pair[0]; final bSuit = pair[1]; final a = _makeCard(aSuit, 10); final b = _makeCard(bSuit, 22); expect(m.compare(a, b), equals(-1)); expect(m.compare(b, a), equals(1)); } }, ); test( 'correctly evaluates the result for different suits and different ' 'values when winning suit has the lower value and the notfier is ' 'enough', () { final m = GameScriptMachine.initialize(defaultGameLogic); for (final pair in pairs) { final aSuit = pair[0]; final bSuit = pair[1]; final a = _makeCard(aSuit, 19); final b = _makeCard(bSuit, 20); expect(m.compare(a, b), equals(1)); expect(m.compare(b, a), equals(-1)); } }, ); }); group('rollCardRarity', () { late GameScriptMachine machine; late Random rng; setUp(() { rng = _MockRandom(); machine = GameScriptMachine.initialize(defaultGameLogic, rng: rng); }); test('returns true if the double value is bigger than .95', () { when(() => rng.nextDouble()).thenReturn(.96); expect(machine.rollCardRarity(), isTrue); }); test('returns false if the double value is less than .95', () { when(() => rng.nextDouble()).thenReturn(.4); expect(machine.rollCardRarity(), isFalse); }); }); group('rollCardPower', () { late GameScriptMachine machine; late Random rng; setUp(() { rng = _MockRandom(); machine = GameScriptMachine.initialize(defaultGameLogic, rng: rng); }); test( 'returns a valid number if card is not rare and random is the lowest', () { when(() => rng.nextDouble()).thenReturn(0); expect(machine.rollCardPower(isRare: false), equals(10)); }, ); test( 'returns a valid number if card is not rare and random is the highest', () { when(() => rng.nextDouble()).thenReturn(1); expect(machine.rollCardPower(isRare: false), equals(99)); }, ); test('returns a valid number if card is not rare', () { when(() => rng.nextDouble()).thenReturn(.8); expect(machine.rollCardPower(isRare: false), equals(81)); }); test('returns a valid number if card is not rare and too weak', () { when(() => rng.nextDouble()).thenReturn(.05); expect(machine.rollCardPower(isRare: false), equals(14)); }); test('returns a valid number if card is rare', () { when(() => rng.nextDouble()).thenReturn(.8); expect(machine.rollCardPower(isRare: true), equals(100)); }); }); }); }
io_flip/api/packages/game_script_machine/test/src/game_script_machine_test.dart/0
{ "file_path": "io_flip/api/packages/game_script_machine/test/src/game_script_machine_test.dart", "repo_id": "io_flip", "token_count": 2439 }
828
import 'dart:convert'; import 'dart:io'; import 'package:clock/clock.dart'; import 'package:dart_frog/dart_frog.dart'; import 'package:http/http.dart' as http; import 'package:jose/jose.dart'; import 'package:jwt_middleware/src/authenticated_user.dart'; import 'package:jwt_middleware/src/jwt.dart'; import 'package:x509/x509.dart'; /// The header used to send the app check token. // ignore: constant_identifier_names const X_FIREBASE_APPCHECK = 'X-Firebase-AppCheck'; /// Definition of an HTTP GET call used by this client. typedef GetCall = Future<http.Response> Function(Uri uri); /// Definition of a function for parsing encoded JWTs. typedef JwtParser = JWT Function(String token); /// Definition of a function for parsing JWS. typedef JwsParser = JsonWebSignature Function(String); /// {@template jwt_middleware} /// A dart_frog middleware for checking JWT authorization. /// {@endtemplate} class JwtMiddleware { /// {@macro jwt_middleware} JwtMiddleware({ required String projectId, GetCall get = http.get, JwtParser parseJwt = JWT.from, JwsParser parseJws = JsonWebSignature.fromCompactSerialization, JsonWebKeyStore? jwks, bool isEmulator = false, }) : _get = get, _parseJwt = parseJwt, _parseJws = parseJws, _jwks = jwks ?? JsonWebKeyStore() ..addKeySetUrl(Uri.parse(_jwksUrl)), _projectId = projectId, _isEmulator = isEmulator, _keys = const {}; final GetCall _get; final JwtParser _parseJwt; final JwsParser _parseJws; final JsonWebKeyStore _jwks; final String _projectId; final bool _isEmulator; static const _keyUrl = 'https://www.googleapis.com/robot/v1/metadata/x509/[email protected]'; static const _jwksUrl = 'https://firebaseappcheck.googleapis.com/v1/jwks'; DateTime? _keyExpiration; Map<String, Verifier<PublicKey>> _keys; /// The middleware function used by dart_frog. Middleware get middleware => (handler) { return (context) async { final authorization = context.request.headers['Authorization']?.split(' '); if (authorization != null && authorization.length == 2 && authorization.first == 'Bearer') { final token = authorization.last; final userId = await verifyToken(token); if (userId != null && await verifyAppCheckToken(context)) { return handler(context.provide(() => AuthenticatedUser(userId))); } } return Response(statusCode: HttpStatus.unauthorized); }; }; /// Verifies the app check token in the given request context. Future<bool> verifyAppCheckToken(RequestContext context) async { final appCheckToken = context.request.headers[X_FIREBASE_APPCHECK]; if (appCheckToken == null || appCheckToken.isEmpty) return false; if (_isEmulator) return true; try { final jws = _parseJws(appCheckToken); return jws.verify(_jwks); } catch (e) { return false; } } /// Verifies the given token and returns the user id if valid. Future<String?> verifyToken(String token) async { final JWT jwt; try { jwt = _parseJwt(token); } catch (e) { return null; } if (_isEmulator) { return jwt.userId; } if (jwt.validate(_projectId)) { final keyId = jwt.keyId; if (keyId != null) { final verifier = await _getVerifier(keyId); if (verifier != null && jwt.verifyWith(verifier)) { return jwt.userId; } } } return null; } Future<Verifier<PublicKey>?> _getVerifier(String kid) async { if (_keyExpiration == null || _keyExpiration!.isBefore(clock.now())) { try { await _refreshKeys(); } catch (e) { return null; } } return _keys[kid]; } Future<void> _refreshKeys() async { final response = await _get(Uri.parse(_keyUrl)); if (response.statusCode == HttpStatus.ok) { final pems = Map<String, String>.from(jsonDecode(response.body) as Map); _keys = { for (final entry in pems.entries) entry.key: (parsePem(entry.value).first as X509Certificate) .publicKey .createVerifier(algorithms.signing.rsa.sha256), }; final maxAgeMatch = RegExp(r'max-age=(\d+)').firstMatch( response.headers['cache-control'] ?? '', ); final maxAge = int.tryParse(maxAgeMatch?.group(1) ?? '0'); _keyExpiration = clock.now().add(Duration(seconds: maxAge ?? 0)); } } }
io_flip/api/packages/jwt_middleware/lib/src/jwt_middleware.dart/0
{ "file_path": "io_flip/api/packages/jwt_middleware/lib/src/jwt_middleware.dart", "repo_id": "io_flip", "token_count": 1868 }
829
/// Access to Leaderboard datasource. library leaderboard_repository; export 'src/leaderboard_repository.dart';
io_flip/api/packages/leaderboard_repository/lib/leaderboard_repository.dart/0
{ "file_path": "io_flip/api/packages/leaderboard_repository/lib/leaderboard_repository.dart", "repo_id": "io_flip", "token_count": 34 }
830
import 'package:db_client/db_client.dart'; import 'package:game_domain/game_domain.dart'; /// {@template prompt_repository} /// Access to Prompt datasource. /// {@endtemplate} class PromptRepository { /// {@macro prompt_repository} const PromptRepository({ required DbClient dbClient, }) : _dbClient = dbClient; final DbClient _dbClient; /// Retrieves the prompt terms for the given [type]. Future<List<PromptTerm>> getPromptTermsByType(PromptTermType type) async { final terms = await _dbClient.findBy( 'prompt_terms', 'type', type.name, ); return terms .map( (entity) => PromptTerm.fromJson({ 'id': entity.id, ...entity.data, }), ) .toList(); } /// Retrieves a prompt term for the given [term]. Future<PromptTerm?> getByTerm(String term) async { final terms = await _dbClient.findBy( 'prompt_terms', 'term', term, ); if (terms.isNotEmpty) { return PromptTerm.fromJson({ 'id': terms.first.id, ...terms.first.data, }); } return null; } /// Creates a new prompt term. Future<void> createPromptTerm(PromptTerm promptTerm) async { await _dbClient.add( 'prompt_terms', promptTerm.toJson()..remove('id'), ); } /// Check if the attributes in a [Prompt] are valid Future<bool> isValidPrompt(Prompt prompt) async { final power = await _dbClient.findBy('prompt_terms', 'term', prompt.power); final characterClass = await _dbClient.findBy('prompt_terms', 'term', prompt.characterClass); final powerValid = power.isNotEmpty && power.first.data['type'] == 'power'; final characterClassValid = characterClass.isNotEmpty && characterClass.first.data['type'] == 'characterClass'; return powerValid && characterClassValid; } /// Takes a prompt combination and checks in the lookup tables /// if the given [imageUrl] exists. /// /// If it does, the [imageUrl] will be returned. /// /// If it doesn't exists, one of the variations present /// in the table will be returned instead. Future<String> ensurePromptImage({ required String promptCombination, required String imageUrl, }) async { final results = await _dbClient.findBy( 'image_lookup_table', 'prompt', promptCombination, ); // We assume that if a lookup table does not exists for the prompt // combination, that that combination has all the possible variations. if (results.isEmpty) { return imageUrl; } else { final images = (results.first.data['available_images'] as List).cast<String>(); if (images.contains(imageUrl)) { return imageUrl; } else { final list = ([...images]..shuffle()); if (list.isEmpty) { return imageUrl; } return list.first; } } } }
io_flip/api/packages/prompt_repository/lib/src/prompt_repository.dart/0
{ "file_path": "io_flip/api/packages/prompt_repository/lib/src/prompt_repository.dart", "repo_id": "io_flip", "token_count": 1123 }
831
import 'package:cards_repository/cards_repository.dart'; import 'package:config_repository/config_repository.dart'; import 'package:dart_frog/dart_frog.dart'; import 'package:game_script_machine/game_script_machine.dart'; import 'package:gcp/gcp.dart'; import 'package:leaderboard_repository/leaderboard_repository.dart'; import 'package:logging/logging.dart'; import 'package:match_repository/match_repository.dart'; import 'package:prompt_repository/prompt_repository.dart'; import 'package:scripts_repository/scripts_repository.dart'; import '../../headers/headers.dart'; import '../../main.dart'; Handler middleware(Handler handler) { return handler .use(requestLogger()) .use(provider<Logger>((_) => Logger.root)) .use(fromShelfMiddleware(cloudLoggingMiddleware(projectId))) .use(provider<CardsRepository>((_) => cardsRepository)) .use(provider<PromptRepository>((_) => promptRepository)) .use(provider<MatchRepository>((_) => matchRepository)) .use(provider<ScriptsRepository>((_) => scriptsRepository)) .use(provider<LeaderboardRepository>((_) => leaderboardRepository)) .use(provider<ConfigRepository>((_) => configRepository)) .use(provider<GameScriptMachine>((_) => gameScriptMachine)) .use(provider<ScriptsState>((_) => scriptsState)) .use(jwtMiddleware.middleware) .use(encryptionMiddleware.middleware) .use(corsHeaders()) .use(allowHeaders()) .use(contentTypeHeader()); }
io_flip/api/routes/game/_middleware.dart/0
{ "file_path": "io_flip/api/routes/game/_middleware.dart", "repo_id": "io_flip", "token_count": 560 }
832
import 'dart:async'; import 'dart:io'; import 'package:card_renderer/card_renderer.dart'; import 'package:cards_repository/cards_repository.dart'; import 'package:dart_frog/dart_frog.dart'; import 'package:firebase_cloud_storage/firebase_cloud_storage.dart'; FutureOr<Response> onRequest(RequestContext context, String cardId) { if (context.request.method == HttpMethod.get) { return _getCardImage(context, cardId); } return Response(statusCode: HttpStatus.methodNotAllowed); } FutureOr<Response> _getCardImage(RequestContext context, String cardId) async { final cardRepository = context.read<CardsRepository>(); final card = await cardRepository.getCard(cardId); if (card == null) { return Response(statusCode: HttpStatus.notFound); } if (card.shareImage != null) { return Response( statusCode: HttpStatus.movedPermanently, headers: { HttpHeaders.locationHeader: card.shareImage!, }, ); } final image = await context.read<CardRenderer>().renderCard(card); final firebaseCloudStorage = context.read<FirebaseCloudStorage>(); final url = await firebaseCloudStorage.uploadFile( image, 'share/$cardId.png', ); final newCard = card.copyWithShareImage(url); // Intentionally not waiting for this update to complete so this // doesn't block the response. unawaited(cardRepository.updateCard(newCard)); return Response.bytes( body: image, headers: { HttpHeaders.contentTypeHeader: 'image/png', }, ); }
io_flip/api/routes/public/cards/[cardId].dart/0
{ "file_path": "io_flip/api/routes/public/cards/[cardId].dart", "repo_id": "io_flip", "token_count": 516 }
833
import 'dart:io'; import 'package:dart_frog/dart_frog.dart'; import 'package:game_domain/game_domain.dart'; import 'package:mocktail/mocktail.dart'; import 'package:prompt_repository/prompt_repository.dart'; import 'package:test/test.dart'; import '../../../../../routes/game/prompt/terms/index.dart' as route; class _MockPromptRepository extends Mock implements PromptRepository {} class _MockRequest extends Mock implements Request {} class _MockRequestContext extends Mock implements RequestContext {} class _MockUri extends Mock implements Uri {} void main() { group('GET /', () { late PromptRepository promptRepository; late Request request; late RequestContext context; late Uri uri; const termsList = [ PromptTerm(id: 'AAA', term: 'AAA', type: PromptTermType.character), PromptTerm(id: 'BBB', term: 'BBB', type: PromptTermType.character), PromptTerm(id: 'CCC', term: 'CCC', type: PromptTermType.character), ]; setUp(() { promptRepository = _MockPromptRepository(); when( () => promptRepository.getPromptTermsByType(PromptTermType.character), ).thenAnswer((_) async => termsList); request = _MockRequest(); when(() => request.method).thenReturn(HttpMethod.get); uri = _MockUri(); when(() => uri.queryParameters).thenReturn({'type': 'character'}); when(() => request.uri).thenReturn(uri); context = _MockRequestContext(); when(() => context.request).thenReturn(request); when(() => context.read<PromptRepository>()).thenReturn(promptRepository); }); test('responds with a 200', () async { final response = await route.onRequest(context); expect(response.statusCode, equals(HttpStatus.ok)); }); test('only allows get methods', () async { when(() => request.method).thenReturn(HttpMethod.post); final response = await route.onRequest(context); expect(response.statusCode, equals(HttpStatus.methodNotAllowed)); }); test('responds with bad request when the type is invalid', () async { when(() => uri.queryParameters).thenReturn({'type': 'not_valid'}); final response = await route.onRequest(context); expect(response.statusCode, equals(HttpStatus.badRequest)); expect(await response.body(), equals('Invalid type')); }); test('responds with the terms list', () async { final response = await route.onRequest(context); final json = await response.json(); expect( json, equals({ 'list': ['AAA', 'BBB', 'CCC'], }), ); }); }); }
io_flip/api/test/routes/game/prompt/terms/index_test.dart/0
{ "file_path": "io_flip/api/test/routes/game/prompt/terms/index_test.dart", "repo_id": "io_flip", "token_count": 945 }
834
import 'dart:io'; import 'package:data_loader/src/prompt_mapper.dart'; import 'package:game_domain/game_domain.dart'; import 'package:prompt_repository/prompt_repository.dart'; /// {@template data_loader} /// Dart tool that feed data into the Database /// {@endtemplate} class DataLoader { /// {@macro data_loader} const DataLoader({ required PromptRepository promptRepository, required File csv, }) : _promptRepository = promptRepository, _csv = csv; final PromptRepository _promptRepository; final File _csv; /// Loads the data from the CSV file into the database /// [onProgress] is called everytime there is progress, /// it takes in the current inserted and the total to insert. Future<void> loadPromptTerms(void Function(int, int) onProgress) async { final prompts = <PromptTerm>[]; final lines = await _csv.readAsLines(); for (final line in lines.skip(1)) { final parts = line.split(','); for (var j = 0; j < promptColumnMap.length; j++) { final idx = promptColumnMap.keys.elementAt(j); final type = promptColumnMap.values.elementAt(j); if (parts[idx].isNotEmpty) { prompts.add( PromptTerm( term: parts[idx], shortenedTerm: type == PromptTermType.power ? parts[idx + 1] : null, type: type, ), ); } } } var progress = 0; onProgress(progress, prompts.length); for (final prompt in prompts) { await _promptRepository.createPromptTerm(prompt); progress++; /// So we don't hit rate limits. await Future<void>.delayed(const Duration(milliseconds: 50)); onProgress(progress, prompts.length); } } }
io_flip/api/tools/data_loader/lib/src/data_loader.dart/0
{ "file_path": "io_flip/api/tools/data_loader/lib/src/data_loader.dart", "repo_id": "io_flip", "token_count": 694 }
835
export 'bloc/flop_bloc.dart'; export 'view/view.dart';
io_flip/flop/lib/flop/flop.dart/0
{ "file_path": "io_flip/flop/lib/flop/flop.dart", "repo_id": "io_flip", "token_count": 25 }
836
import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:io_flip/settings/settings_controller.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; class AudioToggleButton extends StatelessWidget { const AudioToggleButton({super.key}); @override Widget build(BuildContext context) { final settings = context.watch<SettingsController>(); return ValueListenableBuilder<bool>( valueListenable: settings.muted, builder: (_, muted, __) { return RoundedButton.icon( muted ? Icons.volume_off : Icons.volume_up, onPressed: settings.toggleMuted, ); }, ); } }
io_flip/lib/audio/widgets/audio_button.dart/0
{ "file_path": "io_flip/lib/audio/widgets/audio_button.dart", "repo_id": "io_flip", "token_count": 258 }
837
export 'draft_page.dart'; export 'draft_view.dart';
io_flip/lib/draft/views/views.dart/0
{ "file_path": "io_flip/lib/draft/views/views.dart", "repo_id": "io_flip", "token_count": 20 }
838
export 'clash_scene.dart'; export 'match_result_splash.dart'; export 'quit_game_dialog.dart';
io_flip/lib/game/widgets/widgets.dart/0
{ "file_path": "io_flip/lib/game/widgets/widgets.dart", "repo_id": "io_flip", "token_count": 37 }
839
import 'package:flutter/widgets.dart'; import 'package:io_flip/gen/assets.gen.dart'; import 'package:io_flip/info/view/info_view.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; class InfoButton extends StatelessWidget { const InfoButton({super.key}); @override Widget build(BuildContext context) { return RoundedButton.svg( key: const Key('info_button'), Assets.icons.info.keyName, onPressed: () => IoFlipDialog.show( context, child: const InfoView(), ), ); } }
io_flip/lib/info/widgets/info_button.dart/0
{ "file_path": "io_flip/lib/info/widgets/info_button.dart", "repo_id": "io_flip", "token_count": 214 }
840
export 'leaderboard_entry_view.dart'; export 'leaderboard_view.dart';
io_flip/lib/leaderboard/views/views.dart/0
{ "file_path": "io_flip/lib/leaderboard/views/views.dart", "repo_id": "io_flip", "token_count": 24 }
841
part of 'prompt_form_bloc.dart'; abstract class PromptFormEvent extends Equatable { const PromptFormEvent(); } class PromptTermsRequested extends PromptFormEvent { const PromptTermsRequested(); @override List<Object?> get props => []; } class PromptSubmitted extends PromptFormEvent { const PromptSubmitted({required this.data}); final Prompt data; @override List<Object> get props => [data]; }
io_flip/lib/prompt/bloc/prompt_form_event.dart/0
{ "file_path": "io_flip/lib/prompt/bloc/prompt_form_event.dart", "repo_id": "io_flip", "token_count": 124 }
842
import 'package:api_client/api_client.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:game_script_machine/game_script_machine.dart'; import 'package:io_flip/scripts/scripts.dart'; class ScriptsPage extends StatelessWidget { const ScriptsPage({super.key}); factory ScriptsPage.routeBuilder(_, __) { return const ScriptsPage( key: Key('scripts_page'), ); } @override Widget build(BuildContext context) { return BlocProvider<ScriptsCubit>( create: (context) { final scriptsResource = context.read<ScriptsResource>(); final gameScriptMachine = context.read<GameScriptMachine>(); return ScriptsCubit( scriptsResource: scriptsResource, gameScriptMachine: gameScriptMachine, ); }, child: const ScriptsView(), ); } }
io_flip/lib/scripts/views/scripts_page.dart/0
{ "file_path": "io_flip/lib/scripts/views/scripts_page.dart", "repo_id": "io_flip", "token_count": 327 }
843
import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart' hide Card; import 'package:game_domain/game_domain.dart'; import 'package:go_router/go_router.dart'; import 'package:io_flip/audio/audio.dart'; import 'package:io_flip/gen/assets.gen.dart'; import 'package:io_flip/info/info.dart'; import 'package:io_flip/l10n/l10n.dart'; import 'package:io_flip/share/share.dart'; import 'package:io_flip/utils/utils.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; class ShareHandPage extends StatelessWidget { const ShareHandPage({ required this.initials, required this.wins, required this.deck, super.key, }); factory ShareHandPage.routeBuilder(_, GoRouterState state) { final data = state.extra as ShareHandPageData?; return ShareHandPage( key: const Key('share_hand_page'), initials: data?.initials ?? '', wins: data?.wins ?? 0, deck: data?.deck ?? const Deck(id: '', userId: '', cards: []), ); } final String initials; final int wins; final Deck deck; @override Widget build(BuildContext context) { final l10n = context.l10n; final isPhoneWidth = MediaQuery.sizeOf(context).width < 400; return IoFlipScaffold( body: Column( children: [ const SizedBox(height: IoFlipSpacing.xlg), IoFlipLogo(width: 96.96, height: 64), const Spacer(), Text( l10n.shareTeamTitle, style: IoFlipTextStyles.mobileH1, ), const SizedBox(height: IoFlipSpacing.xxlg), Align( alignment: Alignment.topCenter, child: CardFan(cards: deck.cards), ), Text( initials, style: IoFlipTextStyles.mobileH1, ), Row( mainAxisSize: MainAxisSize.min, children: [ Image.asset( Assets.images.tempPreferencesCustom.path, color: IoFlipColors.seedGreen, ), const SizedBox(width: IoFlipSpacing.sm), Text( '$wins ${l10n.winStreakLabel}', style: IoFlipTextStyles.mobileH6 .copyWith(color: IoFlipColors.seedGreen), ), ], ), const Spacer(), Padding( padding: const EdgeInsets.symmetric( horizontal: IoFlipSpacing.xlg, vertical: IoFlipSpacing.sm, ), child: Row( children: [ const AudioToggleButton(), const Spacer(), Flex( direction: isPhoneWidth ? Axis.vertical : Axis.horizontal, mainAxisSize: MainAxisSize.min, children: [ RoundedButton.text( l10n.shareButtonLabel, onPressed: () => IoFlipDialog.show( context, child: ShareHandDialog( deck: deck, initials: initials, wins: wins, ), ), ), const SizedBox( width: IoFlipSpacing.md, height: IoFlipSpacing.md, ), RoundedButton.text( l10n.mainMenuButtonLabel, backgroundColor: IoFlipColors.seedBlack, foregroundColor: IoFlipColors.seedWhite, borderColor: IoFlipColors.seedPaletteNeutral40, onPressed: () => GoRouter.of(context).go('/'), ), ], ), const Spacer(), RoundedButton.svg( key: const Key('share_page_info_button'), Assets.icons.info.keyName, onPressed: () => IoFlipDialog.show( context, child: const InfoView(), onClose: context.maybePop, ), ), ], ), ), const SizedBox(height: IoFlipSpacing.md), Row( mainAxisSize: MainAxisSize.min, children: [ GestureDetector( onTap: () => openLink(ExternalLinks.googleIO), child: Text( l10n.ioLinkLabel, style: IoFlipTextStyles.bodyMD.copyWith( color: IoFlipColors.seedGrey90, ), ), ), const SizedBox(width: IoFlipSpacing.md), GestureDetector( onTap: () => openLink(ExternalLinks.howItsMade), child: Text( l10n.howItsMadeLinkLabel, style: IoFlipTextStyles.bodyMD.copyWith( color: IoFlipColors.seedGrey90, ), ), ), ], ), const SizedBox(height: IoFlipSpacing.xlg), ], ), ); } } class ShareHandPageData extends Equatable { const ShareHandPageData({ required this.initials, required this.wins, required this.deck, }); final String initials; final int wins; final Deck deck; @override List<Object> get props => [wins, initials, deck]; }
io_flip/lib/share/views/share_hand_page.dart/0
{ "file_path": "io_flip/lib/share/views/share_hand_page.dart", "repo_id": "io_flip", "token_count": 3043 }
844
import 'dart:convert'; import 'dart:io'; import 'package:api_client/api_client.dart'; import 'package:game_domain/game_domain.dart'; import 'package:http/http.dart' as http; import 'package:mocktail/mocktail.dart'; import 'package:test/test.dart'; class _MockApiClient extends Mock implements ApiClient {} class _MockResponse extends Mock implements http.Response {} void main() { group('GameResource', () { late ApiClient apiClient; late http.Response response; late GameResource resource; setUp(() { apiClient = _MockApiClient(); response = _MockResponse(); when( () => apiClient.get( any(), queryParameters: any(named: 'queryParameters'), ), ).thenAnswer((_) async => response); when( () => apiClient.post( any(), queryParameters: any(named: 'queryParameters'), body: any(named: 'body'), ), ).thenAnswer((_) async => response); when( () => apiClient.put( any(), body: any(named: 'body'), ), ).thenAnswer((_) async => response); resource = GameResource( apiClient: apiClient, ); }); group('generateCard', () { setUp(() { when( () => apiClient.post(any()), ).thenAnswer((_) async => response); }); test('returns a Card', () async { final cards = List.generate( 10, (_) => const Card( id: '', name: 'Dash', description: 'Cute blue bird', image: 'image.png', rarity: true, power: 1, suit: Suit.air, ), ); when(() => response.statusCode).thenReturn(HttpStatus.ok); when(() => response.body).thenReturn( jsonEncode({'cards': cards.map((e) => e.toJson()).toList()}), ); final returnedCards = await resource.generateCards(const Prompt()); expect(returnedCards, equals(cards)); }); test('throws ApiClientError when request fails', () async { when(() => response.statusCode) .thenReturn(HttpStatus.internalServerError); when(() => response.body).thenReturn('Ops'); await expectLater( resource.generateCards(const Prompt()), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', equals( 'POST /cards returned status 500 with the following response: "Ops"', ), ), ), ); }); test('throws ApiClientError when request response is invalid', () async { when(() => response.statusCode).thenReturn(HttpStatus.ok); when(() => response.body).thenReturn('Ops'); await expectLater( resource.generateCards(const Prompt()), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', equals( 'POST /cards returned invalid response "Ops"', ), ), ), ); }); }); group('createDeck', () { setUp(() { when( () => apiClient.post(any(), body: any(named: 'body')), ).thenAnswer((_) async => response); }); test('returns the deck id', () async { when(() => response.statusCode).thenReturn(HttpStatus.ok); when(() => response.body).thenReturn(jsonEncode({'id': 'deck'})); final id = await resource.createDeck(['a', 'b', 'c']); expect(id, equals('deck')); }); test('throws ApiClientError when request fails', () async { when(() => response.statusCode) .thenReturn(HttpStatus.internalServerError); when(() => response.body).thenReturn('Ops'); final resource = GameResource( apiClient: apiClient, ); await expectLater( () => resource.createDeck(['a', 'b', 'c']), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', equals( 'POST /decks returned status 500 with the following response: "Ops"', ), ), ), ); }); test('throws ApiClientError when request response is invalid', () async { when(() => response.statusCode).thenReturn(HttpStatus.ok); when(() => response.body).thenReturn('Ops'); await expectLater( () => resource.createDeck(['a', 'b', 'c']), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', equals( 'POST /decks returned invalid response "Ops"', ), ), ), ); }); }); group('getDeck', () { setUp(() { when( () => apiClient.get(any()), ).thenAnswer((_) async => response); }); test('returns a deck', () async { const card = Card( id: '', name: 'Dash', description: 'Cute blue bird', image: 'image.png', rarity: true, power: 1, suit: Suit.air, ); const deck = Deck( id: 'deckId', userId: 'userId', cards: [card], ); when(() => response.statusCode).thenReturn(HttpStatus.ok); when(() => response.body).thenReturn(jsonEncode(deck.toJson())); final returnedDeck = await resource.getDeck('deckId'); expect(returnedDeck, equals(deck)); }); test('throws ApiClientError when request fails', () async { when(() => response.statusCode) .thenReturn(HttpStatus.internalServerError); when(() => response.body).thenReturn('Ops'); await expectLater( () => resource.getDeck('deckId'), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', equals( 'GET /decks/deckId returned status 500 with the following response: "Ops"', ), ), ), ); }); test('throws ApiClientError when request response is invalid', () async { when(() => response.statusCode).thenReturn(HttpStatus.ok); when(() => response.body).thenReturn('Ops'); await expectLater( () => resource.getDeck('deckId'), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', equals( 'GET /decks/deckId returned invalid response "Ops"', ), ), ), ); }); }); group('getMatch', () { setUp(() { when( () => apiClient.get(any()), ).thenAnswer((_) async => response); }); test('returns a match', () async { const card = Card( id: '', name: 'Dash', description: 'Cute blue bird', image: 'image.png', rarity: true, power: 1, suit: Suit.air, ); const hostDeck = Deck( id: 'hostDeckId', userId: 'hostUserId', cards: [card], ); const guestDeck = Deck( id: 'guestDeckId', userId: 'guestUserId', cards: [card], ); const match = Match( id: 'matchId', hostDeck: hostDeck, guestDeck: guestDeck, ); when(() => response.statusCode).thenReturn(HttpStatus.ok); when(() => response.body).thenReturn(jsonEncode(match.toJson())); final returnedMatch = await resource.getMatch('matchId'); expect(returnedMatch, equals(match)); }); test('throws ApiClientError when request fails', () async { when(() => response.statusCode) .thenReturn(HttpStatus.internalServerError); when(() => response.body).thenReturn('Ops'); await expectLater( () => resource.getMatch('matchId'), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', equals( 'GET /matches/matchId returned status 500 with the following response: "Ops"', ), ), ), ); }); test('throws ApiClientError when request response is invalid', () async { when(() => response.statusCode).thenReturn(HttpStatus.ok); when(() => response.body).thenReturn('Ops'); await expectLater( () => resource.getMatch('matchId'), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', equals( 'GET /matches/matchId returned invalid response "Ops"', ), ), ), ); }); }); group('getMatchState', () { setUp(() { when( () => apiClient.get(any()), ).thenAnswer((_) async => response); }); test('returns a match state', () async { const matchState = MatchState( id: 'matchStateId', matchId: 'matchId', guestPlayedCards: ['a'], hostPlayedCards: ['b'], ); when(() => response.statusCode).thenReturn(HttpStatus.ok); when(() => response.body).thenReturn(jsonEncode(matchState.toJson())); final returnedMatchState = await resource.getMatchState('matchId'); expect(returnedMatchState, equals(matchState)); }); test('returns null when is not found', () async { when(() => response.statusCode).thenReturn(HttpStatus.notFound); final returnedMatchState = await resource.getMatchState('matchId'); expect(returnedMatchState, isNull); }); test('throws ApiClientError when request fails', () async { when(() => response.statusCode) .thenReturn(HttpStatus.internalServerError); when(() => response.body).thenReturn('Ops'); await expectLater( () => resource.getMatchState('matchId'), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', equals( 'GET /matches/matchId/state returned status 500 with the following response: "Ops"', ), ), ), ); }); test('throws ApiClientError when request response is invalid', () async { when(() => response.statusCode).thenReturn(HttpStatus.ok); when(() => response.body).thenReturn('Ops'); await expectLater( () => resource.getMatchState('matchId'), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', equals( 'GET /matches/matchId/state returned invalid response "Ops"', ), ), ), ); }); }); group('playCard', () { setUp(() { when( () => apiClient.post(any()), ).thenAnswer((_) async => response); }); test('makes the correct call', () async { when(() => response.statusCode).thenReturn(HttpStatus.noContent); await resource.playCard( matchId: 'matchId', cardId: 'cardId', deckId: 'deckId', ); verify( () => apiClient.post( '/game/matches/matchId/decks/deckId/cards/cardId', ), ).called(1); }); test('throws an ApiClientError when the request fails', () async { when( () => apiClient.post( any(), body: any(named: 'body'), ), ).thenThrow(Exception('Ops')); await expectLater( () => resource.playCard( matchId: 'matchId', cardId: 'cardId', deckId: 'deckId', ), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', equals( 'POST /matches/matchId/decks/deckId/cards/cardId failed with the following message: "Exception: Ops"', ), ), ), ); }); test('throws ApiClientError when the returns error code', () async { when(() => response.statusCode).thenReturn( HttpStatus.internalServerError, ); when(() => response.body).thenReturn('Ops'); await expectLater( () => resource.playCard( matchId: 'matchId', cardId: 'cardId', deckId: 'deckId', ), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', equals( 'POST /matches/matchId/decks/deckId/cards/cardId returned status 500 with the following response: "Ops"', ), ), ), ); }); test('throws ApiClientError when the request breaks', () async { when( () => apiClient.post( any(), body: any(named: 'body'), ), ).thenThrow(Exception('Ops')); await expectLater( () => resource.playCard( matchId: 'matchId', cardId: 'cardId', deckId: 'deckId', ), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', equals( 'POST /matches/matchId/decks/deckId/cards/cardId failed with the following message: "Exception: Ops"', ), ), ), ); }); }); group('calculate result', () { const deck = Deck(id: 'id', userId: 'userId', cards: []); const match = Match(id: 'matchId', hostDeck: deck, guestDeck: deck); setUp(() { when( () => apiClient.patch( any(), ), ).thenAnswer((_) async => response); }); test('makes the correct call', () async { when(() => response.statusCode).thenReturn(HttpStatus.noContent); await resource.calculateResult( matchId: match.id, ); verify( () => apiClient.patch( '/game/matches/${match.id}/result', ), ).called(1); }); test('throws an ApiClientError when the request fails', () async { when( () => apiClient.patch(any()), ).thenThrow(Exception('Ops')); await expectLater( () => resource.calculateResult( matchId: match.id, ), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', equals( 'PATCH /matches/result failed with the following message: "Exception: Ops"', ), ), ), ); }); test('throws ApiClientError when the returns error code', () async { when(() => response.statusCode).thenReturn( HttpStatus.internalServerError, ); when(() => response.body).thenReturn('Ops'); await expectLater( () => resource.calculateResult( matchId: match.id, ), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', equals( 'PATCH /matches/result returned status 500 with the following response: "Ops"', ), ), ), ); }); test('throws ApiClientError when the request breaks', () async { when( () => apiClient.patch(any(), body: any(named: 'body')), ).thenThrow(Exception('Ops')); await expectLater( () => resource.calculateResult( matchId: match.id, ), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', equals( 'PATCH /matches/result failed with the following message: "Exception: Ops"', ), ), ), ); }); }); group('connectToCpuMatch', () { test('Makes the correct call', () { when( () => apiClient.post(any()), ).thenAnswer((_) async => response); const matchId = 'matchId'; when(() => response.statusCode).thenReturn(HttpStatus.noContent); resource.connectToCpuMatch(matchId: matchId); verify( () => apiClient.post( '/game/matches/$matchId/connect', queryParameters: any(named: 'queryParameters'), ), ).called(1); }); test('Answers with error', () async { when( () => apiClient.post(any()), ).thenAnswer((_) async => response); when(() => response.body).thenReturn('Ops'); when(() => response.statusCode).thenReturn(HttpStatus.methodNotAllowed); await expectLater( resource.connectToCpuMatch(matchId: ''), throwsA( isA<ApiClientError>().having( (e) => e.cause, 'cause', contains( 'POST game/matches/connect returned status ${HttpStatus.methodNotAllowed}', ), ), ), ); }); test('Catches error', () async { when( () => apiClient.post(any()), ).thenThrow(Exception('oops')); await expectLater( resource.connectToCpuMatch(matchId: ''), throwsA( isA<ApiClientError>(), ), ); }); }); }); }
io_flip/packages/api_client/test/src/resources/game_resource_test.dart/0
{ "file_path": "io_flip/packages/api_client/test/src/resources/game_resource_test.dart", "repo_id": "io_flip", "token_count": 8936 }
845
import 'package:flutter/material.dart'; import 'package:gallery/story_scaffold.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; class TypographyStory extends StatelessWidget { const TypographyStory({super.key}); @override Widget build(BuildContext context) { const textTheme = IoFlipTextStyles.mobile; final textStyleList = [ _TextItem(name: 'Display small', style: textTheme.displaySmall), _TextItem(name: 'Display medium', style: textTheme.displayMedium), _TextItem(name: 'Display large', style: textTheme.displayLarge), _TextItem(name: 'Headline small', style: textTheme.headlineSmall), _TextItem(name: 'Headline medium', style: textTheme.headlineMedium), _TextItem(name: 'Headline large', style: textTheme.headlineLarge), _TextItem(name: 'Title small', style: textTheme.titleSmall), _TextItem(name: 'Title medium', style: textTheme.titleMedium), _TextItem(name: 'Title large', style: textTheme.titleLarge), _TextItem(name: 'Body small', style: textTheme.bodySmall), _TextItem(name: 'Body medium', style: textTheme.bodyMedium), _TextItem(name: 'Body large', style: textTheme.bodyLarge), _TextItem(name: 'Label small', style: textTheme.labelSmall), _TextItem(name: 'Label medium', style: textTheme.labelMedium), _TextItem(name: 'Label large', style: textTheme.labelLarge), ]; return StoryScaffold( title: 'Typography', body: ListView(shrinkWrap: true, children: textStyleList), ); } } class _TextItem extends StatelessWidget { const _TextItem({required this.name, required this.style}); final String name; final TextStyle style; @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.symmetric( horizontal: IoFlipSpacing.sm, vertical: IoFlipSpacing.lg, ), child: Text(name, style: style), ); } }
io_flip/packages/io_flip_ui/gallery/lib/typography/typography_story.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/gallery/lib/typography/typography_story.dart", "repo_id": "io_flip", "token_count": 695 }
846
export 'all_elements_story.dart'; export 'animated_card_story.dart'; export 'card_landing_puff_story.dart'; export 'elemental_damage_story.dart'; export 'fading_dot_loader_story.dart'; export 'flip_countdown_story.dart'; export 'flipped_game_card_story.dart'; export 'foil_shader_story.dart'; export 'game_card_overlay_story.dart'; export 'game_card_story.dart'; export 'game_card_suits_story.dart'; export 'responsive_layout_story.dart'; export 'rounded_button_story.dart'; export 'simple_flow_story.dart';
io_flip/packages/io_flip_ui/gallery/lib/widgets/widgets.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/gallery/lib/widgets/widgets.dart", "repo_id": "io_flip", "token_count": 189 }
847
export 'elemental_damage.dart'; export 'elemental_damage_animation.dart'; export 'metal_damage.dart';
io_flip/packages/io_flip_ui/lib/src/animations/damages/damages.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/lib/src/animations/damages/damages.dart", "repo_id": "io_flip", "token_count": 35 }
848
import 'package:flutter/material.dart'; /// Text styles used in the IO FLIP UI. abstract class IoFlipTextStyles { const IoFlipTextStyles._(); /// Package name static const package = 'io_flip_ui'; /// Text styles for desktop devices. static const desktop = _TextStylesDesktop._(); /// Text styles for mobile devices. static const mobile = _TextStylesMobile._(); /// Creates a [TextTheme] from the text styles. TextTheme get textTheme => TextTheme( displayLarge: displayLarge, displayMedium: displayMedium, displaySmall: displaySmall, headlineLarge: headlineLarge, headlineMedium: headlineMedium, headlineSmall: headlineSmall, titleLarge: titleLarge, titleMedium: titleMedium, titleSmall: titleSmall, bodyLarge: bodyLarge, bodyMedium: bodyMedium, bodySmall: bodySmall, labelLarge: labelLarge, labelMedium: labelMedium, labelSmall: labelSmall, ); /// Display large text style. TextStyle get displayLarge; /// Display medium text style. TextStyle get displayMedium; /// Display small text style. TextStyle get displaySmall; /// Headline large text style. TextStyle get headlineLarge; /// Headline medium text style. TextStyle get headlineMedium; /// Headline small text style. TextStyle get headlineSmall; /// Title large text style. TextStyle get titleLarge; /// Title medium text style. TextStyle get titleMedium; /// Title small text style. TextStyle get titleSmall; /// Body large text style. TextStyle get bodyLarge; /// Body medium text style. TextStyle get bodyMedium; /// Body small text style. TextStyle get bodySmall; /// Label large text style. TextStyle get labelLarge; /// Label medium text style. TextStyle get labelMedium; /// Label small text style. TextStyle get labelSmall; /// logo static const TextStyle logo = TextStyle( fontFamily: 'Roboto Serif', fontWeight: FontWeight.bold, fontSize: 40, height: 1, letterSpacing: 0, package: package, ); /// headlineH1 static const TextStyle headlineH1 = TextStyle( fontFamily: 'Saira', fontWeight: FontWeight.bold, fontSize: 48, height: 1.17, letterSpacing: -2, package: package, ); /// headlineH2 static const TextStyle headlineH2 = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.w500, fontSize: 36, height: 1.33, letterSpacing: -1, package: package, ); /// headlineH3 static const TextStyle headlineH3 = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.w500, fontSize: 32, height: 1.25, letterSpacing: -0.5, package: package, ); /// headlineH4 static const TextStyle headlineH4 = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.w500, fontSize: 28, height: 1.14, letterSpacing: -0.5, package: package, ); /// headlineH4Light static const TextStyle headlineH4Light = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.normal, fontSize: 28, height: 1.29, letterSpacing: -0.5, package: package, ); /// headlineH5 static const TextStyle headlineH5 = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.w500, fontSize: 24, height: 1.17, letterSpacing: -0.25, package: package, ); /// headlineH5Light static const TextStyle headlineH5Light = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.normal, fontSize: 24, height: 1.17, letterSpacing: -0.25, package: package, ); /// headlineH6 static const TextStyle headlineH6 = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.w500, fontSize: 20, height: 1.4, letterSpacing: -0.25, package: package, ); /// headlineH6Light static const TextStyle headlineH6Light = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.normal, fontSize: 20, height: 1.4, letterSpacing: -0.25, package: package, ); /// mobileH1 static const TextStyle mobileH1 = TextStyle( fontFamily: 'Saira', fontWeight: FontWeight.bold, fontSize: 36, height: 1.33, letterSpacing: -2, package: package, ); /// mobileH2 static const TextStyle mobileH2 = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.w500, fontSize: 32, height: 1.25, letterSpacing: -1, package: package, ); /// mobileH3 static const TextStyle mobileH3 = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.w500, fontSize: 28, height: 1.29, letterSpacing: -0.5, package: package, ); /// mobileH4 static const TextStyle mobileH4 = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.w500, fontSize: 24, height: 1.33, letterSpacing: -0.5, package: package, ); /// mobileH4Light static const TextStyle mobileH4Light = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.normal, fontSize: 24, height: 1.33, letterSpacing: -0.5, package: package, ); /// mobileH5 static const TextStyle mobileH5 = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.w500, fontSize: 20, height: 1.4, letterSpacing: -0.25, package: package, ); /// mobileH5Light static const TextStyle mobileH5Light = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.normal, fontSize: 20, height: 1.4, letterSpacing: -0.25, package: package, ); /// mobileH6 static const TextStyle mobileH6 = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.w500, fontSize: 18, height: 1.33, letterSpacing: -0.25, package: package, ); /// mobileH6Light static const TextStyle mobileH6Light = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.normal, fontSize: 18, height: 1.33, letterSpacing: -0.25, package: package, ); /// bodyXL static const TextStyle bodyXL = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.normal, fontSize: 18, height: 1.56, letterSpacing: 0.15, package: package, ); /// bodyLG static const TextStyle bodyLG = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.normal, fontSize: 16, height: 1.5, letterSpacing: 0.15, package: package, ); /// bodyMD static const TextStyle bodyMD = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.normal, fontSize: 14, height: 1.43, letterSpacing: 0.5, package: package, ); /// bodySM static const TextStyle bodySM = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.normal, fontSize: 12, height: 1.5, letterSpacing: 0.25, package: package, ); /// bodyXS static const TextStyle bodyXS = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.normal, fontSize: 10, height: 1.6, letterSpacing: 0.5, package: package, ); /// bodyXSBold static const TextStyle bodyXSBold = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.normal, fontSize: 10, height: 1.6, letterSpacing: 0.5, package: package, ); /// buttonLG static const TextStyle buttonLG = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.w500, fontSize: 16, height: 1.5, letterSpacing: 0.25, package: package, ); /// buttonMD static const TextStyle buttonMD = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.w500, fontSize: 14, height: 1.43, letterSpacing: 0.25, package: package, ); /// buttonSM static const TextStyle buttonSM = TextStyle( fontFamily: 'Saira', fontWeight: FontWeight.bold, fontSize: 14, height: 1.29, letterSpacing: -0.25, package: package, ); /// linkXL static const TextStyle linkXL = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.normal, fontSize: 18, height: 1.56, letterSpacing: 0.15, decoration: TextDecoration.underline, package: package, ); /// linkLG static const TextStyle linkLG = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.normal, fontSize: 16, height: 1.5, letterSpacing: 0.15, decoration: TextDecoration.underline, package: package, ); /// linkMD static const TextStyle linkMD = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.normal, fontSize: 14, height: 1.43, letterSpacing: 0.5, decoration: TextDecoration.underline, package: package, ); /// linkSM static const TextStyle linkSM = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.normal, fontSize: 12, height: 1.5, letterSpacing: 0.25, decoration: TextDecoration.underline, package: package, ); /// linkXS static const TextStyle linkXS = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.normal, fontSize: 10, height: 1.6, letterSpacing: 0.5, decoration: TextDecoration.underline, package: package, ); /// cardNumberXXL static const TextStyle cardNumberXXL = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.bold, fontSize: 64, height: 1, letterSpacing: -1, package: package, ); /// cardNumberXL static const TextStyle cardNumberXL = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.bold, fontSize: 54, height: 1, letterSpacing: -1, package: package, ); /// cardNumberLG static const TextStyle cardNumberLG = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.bold, fontSize: 44, height: 1, letterSpacing: -0.5, package: package, ); /// cardNumberMD static const TextStyle cardNumberMD = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.bold, fontSize: 34, height: 1, letterSpacing: -0.5, package: package, ); /// cardNumberSM static const TextStyle cardNumberSM = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.bold, fontSize: 28, height: 1, letterSpacing: -0.25, package: package, ); /// cardNumberXS static const TextStyle cardNumberXS = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.bold, fontSize: 20, height: 1, letterSpacing: -0.25, package: package, ); /// cardNumberXXS static const TextStyle cardNumberXXS = TextStyle( fontFamily: 'Google Sans', fontWeight: FontWeight.bold, fontSize: 12, height: 1, letterSpacing: -0.25, package: package, ); /// cardTitleXXL static const TextStyle cardTitleXXL = TextStyle( fontFamily: 'Saira', fontWeight: FontWeight.bold, fontSize: 28, height: 1.14, letterSpacing: -0.5, package: package, ); /// cardTitleXL static const TextStyle cardTitleXL = TextStyle( fontFamily: 'Saira', fontWeight: FontWeight.bold, fontSize: 24, height: 1.17, letterSpacing: -0.5, package: package, ); /// cardTitleLG static const TextStyle cardTitleLG = TextStyle( fontFamily: 'Saira', fontWeight: FontWeight.bold, fontSize: 19, height: 1.16, letterSpacing: -0.25, package: package, ); /// cardTitleMD static const TextStyle cardTitleMD = TextStyle( fontFamily: 'Saira', fontWeight: FontWeight.bold, fontSize: 15, height: 1.13, letterSpacing: -0.25, package: package, ); /// cardTitleSM static const TextStyle cardTitleSM = TextStyle( fontFamily: 'Saira', fontWeight: FontWeight.bold, fontSize: 12, height: 1.17, letterSpacing: -0.25, package: package, ); /// cardTitleXS static const TextStyle cardTitleXS = TextStyle( fontFamily: 'Saira', fontWeight: FontWeight.bold, fontSize: 8.5, height: 1.18, letterSpacing: -0.25, package: package, ); /// cardTitleXXS static const TextStyle cardTitleXXS = TextStyle( fontFamily: 'Saira', fontWeight: FontWeight.bold, fontSize: 4.5, height: 1.33, letterSpacing: -0.25, package: package, ); /// cardDescriptionXXL static const TextStyle cardDescriptionXXL = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.w400, fontSize: 14, height: 1.29, letterSpacing: 0, package: package, ); /// cardDescriptionXL static const TextStyle cardDescriptionXL = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.w400, fontSize: 12, height: 1.25, letterSpacing: 0, package: package, ); /// cardDescriptionLG static const TextStyle cardDescriptionLG = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.w400, fontSize: 10, height: 1.2, letterSpacing: 0, package: package, ); /// cardDescriptionMD static const TextStyle cardDescriptionMD = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.w400, fontSize: 7.5, height: 1.27, letterSpacing: 0, package: package, ); /// cardDescriptionSM static const TextStyle cardDescriptionSM = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.w400, fontSize: 6, height: 1.25, letterSpacing: 0, package: package, ); /// cardDescriptionXS static const TextStyle cardDescriptionXS = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.w400, fontSize: 4.5, height: 1.22, letterSpacing: 0, package: package, ); /// cardDescriptionXXS static const TextStyle cardDescriptionXXS = TextStyle( fontFamily: 'Google Sans Text', fontWeight: FontWeight.w400, fontSize: 2.4000000953674316, height: 1.25, letterSpacing: 0, package: package, ); /// initialsInitial static const TextStyle initialsInitial = TextStyle( fontFamily: 'Saira', fontWeight: FontWeight.w600, fontSize: 48, height: 1.17, letterSpacing: 2, package: package, ); } class _TextStylesDesktop extends IoFlipTextStyles { const _TextStylesDesktop._() : super._(); @override TextStyle get displayLarge => IoFlipTextStyles.headlineH1; @override TextStyle get displayMedium => IoFlipTextStyles.headlineH2; @override TextStyle get displaySmall => IoFlipTextStyles.headlineH3; @override TextStyle get headlineLarge => IoFlipTextStyles.headlineH4; @override TextStyle get headlineMedium => IoFlipTextStyles.headlineH4Light; @override TextStyle get headlineSmall => IoFlipTextStyles.headlineH5; @override TextStyle get titleLarge => IoFlipTextStyles.cardTitleXL; @override TextStyle get titleMedium => IoFlipTextStyles.cardTitleLG; @override TextStyle get titleSmall => IoFlipTextStyles.cardTitleMD; @override TextStyle get bodyLarge => IoFlipTextStyles.bodyLG; @override TextStyle get bodyMedium => IoFlipTextStyles.bodyMD; @override TextStyle get bodySmall => IoFlipTextStyles.bodySM; @override TextStyle get labelLarge => IoFlipTextStyles.bodyLG; @override TextStyle get labelMedium => IoFlipTextStyles.bodySM; @override TextStyle get labelSmall => IoFlipTextStyles.bodyXS; } class _TextStylesMobile extends IoFlipTextStyles { const _TextStylesMobile._() : super._(); @override TextStyle get displayLarge => IoFlipTextStyles.mobileH1; @override TextStyle get displayMedium => IoFlipTextStyles.mobileH2; @override TextStyle get displaySmall => IoFlipTextStyles.mobileH3; @override TextStyle get headlineLarge => IoFlipTextStyles.mobileH4; @override TextStyle get headlineMedium => IoFlipTextStyles.mobileH4Light; @override TextStyle get headlineSmall => IoFlipTextStyles.mobileH5; @override TextStyle get titleLarge => IoFlipTextStyles.cardTitleXL; @override TextStyle get titleMedium => IoFlipTextStyles.cardTitleLG; @override TextStyle get titleSmall => IoFlipTextStyles.cardTitleMD; @override TextStyle get bodyLarge => IoFlipTextStyles.bodyLG; @override TextStyle get bodyMedium => IoFlipTextStyles.bodyMD; @override TextStyle get bodySmall => IoFlipTextStyles.bodySM; @override TextStyle get labelLarge => IoFlipTextStyles.bodyLG; @override TextStyle get labelMedium => IoFlipTextStyles.bodySM; @override TextStyle get labelSmall => IoFlipTextStyles.bodyXS; }
io_flip/packages/io_flip_ui/lib/src/theme/io_flip_text_styles.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/lib/src/theme/io_flip_text_styles.dart", "repo_id": "io_flip", "token_count": 6122 }
849
export 'animated_card.dart'; export 'card_landing_puff.dart'; export 'card_overlay.dart'; export 'damages/damages.dart'; export 'fading_dot_loader.dart'; export 'flip_countdown.dart'; export 'flipped_game_card.dart'; export 'foil_shader.dart'; export 'game_card.dart'; export 'io_flip_bottom_bar.dart'; export 'io_flip_dialog.dart'; export 'io_flip_error_view.dart'; export 'io_flip_logo.dart'; export 'io_flip_scaffold.dart'; export 'responsive_layout.dart'; export 'rounded_button.dart'; export 'simple_flow.dart'; export 'suit_icons.dart'; export 'tilt_builder.dart';
io_flip/packages/io_flip_ui/lib/src/widgets/widgets.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/lib/src/widgets/widgets.dart", "repo_id": "io_flip", "token_count": 231 }
850
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/gen/assets.gen.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('DamageSend', () { late Images images; setUp(() { images = _MockImages(); }); testWidgets('renders SpriteAnimationWidget', (tester) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: Provider.value( value: images, child: DamageSend( '', assetSize: AssetSize.large, size: const GameCardSize.md(), badgePath: Assets.images.suits.card.air.path, ), ), ), ); expect(find.byType(SpriteAnimationWidget), findsOneWidget); }); }); }
io_flip/packages/io_flip_ui/test/src/widgets/damages/damage_send_test.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/test/src/widgets/damages/damage_send_test.dart", "repo_id": "io_flip", "token_count": 469 }
851
import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:io_flip_ui/src/widgets/simple_flow.dart'; class _TestFlowData extends Equatable { const _TestFlowData( this.value1, this.value2, this.value3, ); // text field input for final int? value1; final int? value2; final int? value3; _TestFlowData copyWith({ int? value1, int? value2, int? value3, }) { return _TestFlowData( value1 ?? this.value1, value2 ?? this.value2, value3 ?? this.value3, ); } @override List<Object?> get props => [value1, value2, value3]; } void main() { group('SimpleFlow', () { group('Follows a normal flow', () { testWidgets('steps and complete a flow', (tester) async { late final _TestFlowData completedData; await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: SimpleFlow( initialData: () => const _TestFlowData(null, null, null), onComplete: (data) { completedData = data; }, stepBuilder: (context, data, _) { return Column( children: [ Text( 'v1:${data.value1};v2:${data.value2};v3:${data.value3}', ), ElevatedButton( onPressed: () { if (data.value1 == null) { return context.updateFlow<_TestFlowData>( (current) => current.copyWith(value1: 1), ); } if (data.value2 == null) { return context.updateFlow<_TestFlowData>( (current) => current.copyWith(value2: 2), ); } return context.completeFlow<_TestFlowData>( (current) => current.copyWith(value3: 3), ); }, child: const Text('Update'), ), ], ); }, ), ), ); expect(find.text('v1:null;v2:null;v3:null'), findsOneWidget); await tester.tap(find.byType(ElevatedButton)); await tester.pumpAndSettle(); expect(find.text('v1:1;v2:null;v3:null'), findsOneWidget); await tester.tap(find.byType(ElevatedButton)); await tester.pumpAndSettle(); expect(find.text('v1:1;v2:2;v3:null'), findsOneWidget); await tester.tap(find.byType(ElevatedButton)); await tester.pumpAndSettle(); expect(find.text('v1:1;v2:2;v3:3'), findsOneWidget); expect(completedData, const _TestFlowData(1, 2, 3)); }); testWidgets('forwards child widget', (widgetTester) async { await widgetTester.pumpWidget( Directionality( textDirection: TextDirection.ltr, child: SimpleFlow( initialData: () => const _TestFlowData(null, null, null), onComplete: (_) {}, stepBuilder: (_, __, child) => child!, child: const Text('Child'), ), ), ); expect(find.text('Child'), findsOneWidget); }); }); }); }
io_flip/packages/io_flip_ui/test/src/widgets/simple_flow_test.dart/0
{ "file_path": "io_flip/packages/io_flip_ui/test/src/widgets/simple_flow_test.dart", "repo_id": "io_flip", "token_count": 1853 }
852
name: io_flip description: Google I/O FLIP game version: 1.0.0+1 publish_to: none environment: sdk: ">=3.0.0 <4.0.0" flutter: ">=3.10.0" dependencies: api_client: path: packages/api_client audioplayers: ^3.0.1 authentication_repository: path: packages/authentication_repository bloc: ^8.1.1 cloud_firestore: ^4.5.0 code_text_field: ^1.1.0 collection: ^1.17.0 config_repository: path: packages/config_repository connection_repository: path: packages/connection_repository cross_file: ^0.3.3+4 device_info_plus: ^8.2.2 equatable: ^2.0.5 firebase_app_check: ^0.1.2 firebase_auth: ^4.4.0 firebase_core: ^2.5.0 firebase_crashlytics: ^3.1.0 firebase_storage: ^11.1.0 flame: git: url: https://github.com/willhlas/flame path: packages/flame ref: main flutter: sdk: flutter flutter_bloc: ^8.1.2 flutter_highlight: ^0.7.0 flutter_localizations: sdk: flutter flutter_svg: ^2.0.5 game_domain: path: api/packages/game_domain game_script_machine: path: api/packages/game_script_machine go_router: ^6.5.8 highlight: ^0.7.0 intl: ^0.18.0 io_flip_ui: path: packages/io_flip_ui logging: ^1.1.1 match_maker_repository: path: packages/match_maker_repository provider: ^6.0.5 share_plus: ^6.3.1 shared_preferences: ^2.1.0 styled_text: ^7.0.0 url_launcher: ^6.1.10 dev_dependencies: bloc_test: ^9.1.1 build_runner: ^2.3.3 fake_async: ^1.3.1 flutter_gen_runner: ^5.3.0 flutter_test: sdk: flutter mocktail: ^0.3.0 mocktail_image_network: ^0.3.1 plugin_platform_interface: ^2.1.4 url_launcher_platform_interface: ^2.1.2 very_good_analysis: ^4.0.0 dependency_overrides: intl: ^0.17.0 flutter: uses-material-design: true generate: true assets: - assets/icons/ - assets/images/ - assets/images/desktop/ - assets/images/mobile/ - assets/images/leaderboard/ - assets/music/ - assets/sfx/ flutter_gen: integrations: flutter_svg: true
io_flip/pubspec.yaml/0
{ "file_path": "io_flip/pubspec.yaml", "repo_id": "io_flip", "token_count": 927 }
853
import 'package:bloc_test/bloc_test.dart'; import 'package:flutter/material.dart' hide ConnectionState; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:game_domain/game_domain.dart'; import 'package:io_flip/connection/connection.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; import 'package:mocktail/mocktail.dart'; import '../../helpers/helpers.dart'; class _MockConnectionBloc extends MockBloc<ConnectionEvent, ConnectionState> implements ConnectionBloc {} void main() { group('ConnectionOverlay', () { const child = SizedBox(key: Key('child')); late ConnectionBloc connectionBloc; setUp(() { connectionBloc = _MockConnectionBloc(); }); Widget buildSubject() => BlocProvider.value( value: connectionBloc, child: const ConnectionOverlay(child: child), ); group('when state is not ConnectionFailure', () { setUp(() { when(() => connectionBloc.state).thenReturn(const ConnectionSuccess()); }); testWidgets('shows child', (tester) async { await tester.pumpApp(buildSubject()); expect(find.byWidget(child), findsOneWidget); }); }); group('when state is ConnectionFailure', () { setUp(() { when(() => connectionBloc.state).thenReturn( const ConnectionFailure( WebSocketErrorCode.unknown, ), ); }); testWidgets('shows child', (tester) async { await tester.pumpApp(buildSubject()); expect(find.byWidget(child), findsOneWidget); }); testWidgets('shows unknown error messages', (tester) async { await tester.pumpApp(buildSubject()); expect(find.text(tester.l10n.unknownConnectionError), findsOneWidget); expect( find.text(tester.l10n.unknownConnectionErrorBody), findsOneWidget, ); }); testWidgets('shows retry button for unknown error', (tester) async { await tester.pumpApp(buildSubject()); expect( find.widgetWithText( RoundedButton, tester.l10n.unknownConnectionErrorButton, ), findsOneWidget, ); }); testWidgets('tapping retry button adds event to bloc', (tester) async { await tester.pumpApp(buildSubject()); await tester.tap( find.widgetWithText( RoundedButton, tester.l10n.unknownConnectionErrorButton, ), ); verify(() => connectionBloc.add(const ConnectionRequested())).called(1); }); testWidgets( 'shows player already connected error messages', (tester) async { when(() => connectionBloc.state).thenReturn( const ConnectionFailure( WebSocketErrorCode.playerAlreadyConnected, ), ); await tester.pumpApp(buildSubject()); expect( find.text(tester.l10n.playerAlreadyConnectedError), findsOneWidget, ); expect( find.text(tester.l10n.playerAlreadyConnectedErrorBody), findsOneWidget, ); }, ); }); }); }
io_flip/test/connection/view/connection_overlay_test.dart/0
{ "file_path": "io_flip/test/connection/view/connection_overlay_test.dart", "repo_id": "io_flip", "token_count": 1401 }
854
import 'package:flutter/widgets.dart'; import 'package:go_router/go_router.dart'; import 'package:mocktail/mocktail.dart'; class MockGoRouter extends Mock implements GoRouter {} class NeglectRouter { void neglect(BuildContext context, VoidCallback callback) {} } class MockGoRouterProvider extends StatelessWidget { const MockGoRouterProvider({ required this.goRouter, required this.child, super.key, }); final GoRouter goRouter; final Widget child; @override Widget build(BuildContext context) => InheritedGoRouter( goRouter: goRouter, child: child, ); }
io_flip/test/helpers/go_router.dart/0
{ "file_path": "io_flip/test/helpers/go_router.dart", "repo_id": "io_flip", "token_count": 215 }
855
// ignore_for_file: prefer_const_constructors import 'package:api_client/api_client.dart'; import 'package:bloc_test/bloc_test.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:io_flip/leaderboard/initials_form/initials_form.dart'; import 'package:mocktail/mocktail.dart'; class _MockLeaderboardResource extends Mock implements LeaderboardResource {} void main() { group('InitialsFormBloc', () { late LeaderboardResource leaderboardResource; setUp(() { leaderboardResource = _MockLeaderboardResource(); when(() => leaderboardResource.getInitialsBlacklist()) .thenAnswer((_) async => ['WTF']); when( () => leaderboardResource.addInitialsToScoreCard( scoreCardId: any(named: 'scoreCardId'), initials: any(named: 'initials'), ), ).thenAnswer((_) async {}); }); blocTest<InitialsFormBloc, InitialsFormState>( 'emits state with updated initials when changing them', build: () => InitialsFormBloc( leaderboardResource: leaderboardResource, scoreCardId: 'scoreCardId', ), act: (bloc) => bloc.add(InitialsChanged(index: 0, initial: 'A')), expect: () => <InitialsFormState>[ InitialsFormState(initials: const ['A', '', '']), ], ); blocTest<InitialsFormBloc, InitialsFormState>( 'emits correct states when initials are valid and submitted', build: () => InitialsFormBloc( leaderboardResource: leaderboardResource, scoreCardId: 'scoreCardId', ), act: (bloc) { bloc ..add(InitialsChanged(index: 0, initial: 'A')) ..add(InitialsChanged(index: 1, initial: 'B')) ..add(InitialsChanged(index: 2, initial: 'C')) ..add(InitialsSubmitted()); }, expect: () => <InitialsFormState>[ InitialsFormState(initials: const ['A', '', '']), InitialsFormState(initials: const ['A', 'B', '']), InitialsFormState(initials: const ['A', 'B', 'C']), InitialsFormState( initials: const ['A', 'B', 'C'], status: InitialsFormStatus.valid, ), InitialsFormState( initials: const ['A', 'B', 'C'], status: InitialsFormStatus.success, ), ], ); blocTest<InitialsFormBloc, InitialsFormState>( 'emits state with invalid status when initials are not valid and ' 'submitted', build: () => InitialsFormBloc( leaderboardResource: leaderboardResource, scoreCardId: 'scoreCardId', ), act: (bloc) { bloc ..add(InitialsChanged(index: 0, initial: 'A')) ..add(InitialsSubmitted()); }, expect: () => <InitialsFormState>[ InitialsFormState(initials: const ['A', '', '']), InitialsFormState( initials: const ['A', '', ''], status: InitialsFormStatus.invalid, ), ], ); blocTest<InitialsFormBloc, InitialsFormState>( 'emits state with blacklisted status when initials are blacklisted and ' 'submitted', build: () => InitialsFormBloc( leaderboardResource: leaderboardResource, scoreCardId: 'scoreCardId', ), seed: () => InitialsFormState(initials: const ['W', 'T', 'F']), act: (bloc) { bloc.add(InitialsSubmitted()); }, expect: () => <InitialsFormState>[ InitialsFormState( initials: const ['W', 'T', 'F'], status: InitialsFormStatus.blacklisted, ), ], ); blocTest<InitialsFormBloc, InitialsFormState>( 'emits failure state if adding initials fails', setUp: () { when( () => leaderboardResource.addInitialsToScoreCard( scoreCardId: any(named: 'scoreCardId'), initials: any(named: 'initials'), ), ).thenThrow(Exception()); }, build: () => InitialsFormBloc( leaderboardResource: leaderboardResource, scoreCardId: 'scoreCardId', ), seed: () => InitialsFormState(initials: const ['A', 'B', 'C']), act: (bloc) { bloc.add(InitialsSubmitted()); }, expect: () => <InitialsFormState>[ InitialsFormState( initials: const ['A', 'B', 'C'], status: InitialsFormStatus.valid, ), InitialsFormState( initials: const ['A', 'B', 'C'], status: InitialsFormStatus.failure, ), ], ); }); }
io_flip/test/leaderboard/initials_form/bloc/initials_form_bloc_test.dart/0
{ "file_path": "io_flip/test/leaderboard/initials_form/bloc/initials_form_bloc_test.dart", "repo_id": "io_flip", "token_count": 1948 }
856
import 'dart:math' as math; 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'; import 'package:io_flip/prompt/prompt.dart'; import 'package:io_flip/settings/settings.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; import 'package:mocktail/mocktail.dart'; import '../../helpers/helpers.dart'; class _MockPromptFormBloc extends MockBloc<PromptFormEvent, PromptFormState> implements PromptFormBloc {} class _MockSettingsController extends Mock implements SettingsController {} class _MockRandom extends Mock implements math.Random {} void main() { late PromptFormBloc promptFormBloc; late math.Random randomGenerator; setUp(() { promptFormBloc = _MockPromptFormBloc(); randomGenerator = _MockRandom(); when(() => randomGenerator.nextInt(any())).thenReturn(0); }); void mockState(PromptFormState state) { whenListen( promptFormBloc, Stream.value(state), initialState: state, ); } const promptFormState = PromptFormState( status: PromptTermsStatus.loaded, prompts: Prompt(), characterClasses: ['Archer', 'Magician'], powers: ['Speed', 'Lazy'], ); group('PromptForm', () { testWidgets('renders prompt form intro correctly', (tester) async { await tester.pumpSubject(promptFormBloc); final l10n = tester.l10n; final expectedTexts = [ l10n.niceToMeetYou, l10n.introTextPromptPage, l10n.letsGetStarted, ]; expect(find.byType(SimpleFlow<Prompt>), findsOneWidget); expect(find.byType(PromptFormIntroView), findsOneWidget); expect(find.byType(CardMaster), findsOneWidget); for (final text in expectedTexts) { expect(find.text(text), findsOneWidget); } }); testWidgets('renders character class form correctly', (tester) async { mockState(promptFormState); await tester.pumpSubject(promptFormBloc); await tester.tap(find.text(tester.l10n.letsGetStarted.toUpperCase())); await tester.pumpAndSettle(); expect( find.text(tester.l10n.characterClassPromptPageTitle), findsOneWidget, ); expect(find.byType(ListWheelScrollView), findsOneWidget); expect( find.text(tester.l10n.select.toUpperCase()), findsOneWidget, ); }); testWidgets( 'renders power form correctly and completes flow', (tester) async { mockState(promptFormState); await tester.pumpSubject(promptFormBloc, rng: randomGenerator); await tester.tap(find.text(tester.l10n.letsGetStarted.toUpperCase())); await tester.pumpAndSettle(); await tester.tap(find.text(tester.l10n.select.toUpperCase())); await tester.pumpAndSettle(); expect(find.text(tester.l10n.powerPromptPageTitle), findsOneWidget); expect(find.byType(ListWheelScrollView), findsOneWidget); await tester.tap(find.text(tester.l10n.select.toUpperCase())); await tester.pumpAndSettle(); verify( () => promptFormBloc.add( const PromptSubmitted( data: Prompt( isIntroSeen: true, characterClass: 'Archer', power: 'Speed', ), ), ), ).called(1); }, ); }); } extension PromptFormTest on WidgetTester { Future<void> pumpSubject(PromptFormBloc bloc, {math.Random? rng}) { final SettingsController settingsController = _MockSettingsController(); when(() => settingsController.muted).thenReturn(ValueNotifier(true)); return pumpApp( Scaffold( body: BlocProvider.value( value: bloc, child: PromptForm( randomGenerator: rng, ), ), ), settingsController: settingsController, ); } }
io_flip/test/prompt/view/prompt_form_test.dart/0
{ "file_path": "io_flip/test/prompt/view/prompt_form_test.dart", "repo_id": "io_flip", "token_count": 1669 }
857
import 'package:api_client/api_client.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:game_domain/game_domain.dart'; import 'package:io_flip/share/share.dart'; import 'package:io_flip_ui/io_flip_ui.dart'; import 'package:mocktail/mocktail.dart'; import 'package:mocktail_image_network/mocktail_image_network.dart'; import '../../helpers/helpers.dart'; class _MockShareResource extends Mock implements ShareResource {} const shareUrl = 'https://example.com'; const card = Card( id: '', name: 'name', description: 'description', image: '', rarity: false, power: 1, suit: Suit.air, ); void main() { late ShareResource shareResource; setUp(() { shareResource = _MockShareResource(); when(() => shareResource.facebookShareCardUrl(any())).thenReturn(''); when(() => shareResource.twitterShareCardUrl(any())).thenReturn(''); }); group('ShareCardDialog', () { testWidgets('renders', (tester) async { await tester.pumpSubject(shareResource); expect(find.byType(ShareDialog), findsOneWidget); }); testWidgets('renders a CardShareDialog widget', (tester) async { await tester.pumpSubject(shareResource); expect(find.byType(ShareDialog), findsOneWidget); }); testWidgets('renders a GameCard widget', (tester) async { await tester.pumpSubject(shareResource); expect(find.byType(GameCard), findsOneWidget); }); testWidgets('renders the description', (tester) async { await tester.pumpSubject(shareResource); expect(find.text(tester.l10n.shareCardDialogDescription), findsOneWidget); }); testWidgets('gets the twitter and facebook share links', (tester) async { await tester.pumpSubject(shareResource); verify(() => shareResource.twitterShareCardUrl('')).called(1); verify(() => shareResource.facebookShareCardUrl('')).called(1); }); }); } extension ShareCardDialogTest on WidgetTester { Future<void> pumpSubject(ShareResource shareResource) async { await mockNetworkImages(() { when(() => shareResource.twitterShareCardUrl(any())).thenReturn(''); when(() => shareResource.facebookShareCardUrl(any())).thenReturn(''); return pumpApp( const SingleChildScrollView( child: ShareCardDialog( card: card, ), ), shareResource: shareResource, ); }); } }
io_flip/test/share/views/share_card_dialog_test.dart/0
{ "file_path": "io_flip/test/share/views/share_card_dialog_test.dart", "repo_id": "io_flip", "token_count": 891 }
858
{ "label": "Flutter Development", "position": 4, "link": { "title": "Flutter Development", "type": "generated-index", "description": "How to start development on your news Flutter application." } }
news_toolkit/docs/docs/flutter_development/_category_.json/0
{ "file_path": "news_toolkit/docs/docs/flutter_development/_category_.json", "repo_id": "news_toolkit", "token_count": 73 }
859
--- sidebar_position: 7 description: Learn how to setup continous deployments for your application. --- # App deployment setup ## Codemagic :::note Codemagic is not a required service for this project. You're welcome to use other automated CI/CD services for your apps, if desired. ::: Codemagic is an automated CI/CD service that streamlines deployments to the Google Play Store and App Store Connect. You can configure your CI/CD pipeline up front and trigger deployments automatically with each subsequent code change. To use this service, login or [create a Codemagic account](https://codemagic.io/signup?campaign=flutter-ci-header_sign_up_btn) and follow the [getting started guide](https://docs.codemagic.io/yaml-basic-configuration/yaml-getting-started/) guide to set up a `codemagic.yaml` build configuration file. Be sure to populate all 'TODO' fields in your `codemagic.yaml` file. For this project, specifically, be sure to create an [App Store API Key](https://docs.codemagic.io/yaml-code-signing/signing-ios/#creating-the-app-store-connect-api-key) and add this to your Codemagic account. In addition, [generate a keytore](https://docs.codemagic.io/yaml-code-signing/signing-android/#generating-a-keystore) for signing your release builds. A service account is required when publishing to Google Play. The service account JSON key file must be added to Codemagic to authenticate with these services. To set up a service account for authentication with Google Play and Firebase, use the instructions at [Google services authetication](https://docs.codemagic.io/knowledge-base/google-services-authentication/).
news_toolkit/docs/docs/project_configuration/app_deployment.md/0
{ "file_path": "news_toolkit/docs/docs/project_configuration/app_deployment.md", "repo_id": "news_toolkit", "token_count": 436 }
860
/** * Creating a sidebar enables you to: - create an ordered group of docs - render a sidebar for each doc of that group - provide next/previous navigation The sidebars can be generated from the filesystem, or explicitly defined here. Create as many sidebars as you want. */ // @ts-check /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { // By default, Docusaurus generates a sidebar from the docs folder structure tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }], // But you can create a sidebar manually /* tutorialSidebar: [ 'intro', 'hello', { type: 'category', label: 'Tutorial', items: ['tutorial-basics/create-a-document'], }, ], */ }; module.exports = sidebars;
news_toolkit/docs/sidebars.js/0
{ "file_path": "news_toolkit/docs/sidebars.js", "repo_id": "news_toolkit", "token_count": 252 }
861
package com.flutter.news.example import io.flutter.embedding.android.FlutterActivity class MainActivity: FlutterActivity() { }
news_toolkit/flutter_news_example/android/app/src/main/kotlin/ventures/verygood/start/very_good_project/MainActivity.kt/0
{ "file_path": "news_toolkit/flutter_news_example/android/app/src/main/kotlin/ventures/verygood/start/very_good_project/MainActivity.kt", "repo_id": "news_toolkit", "token_count": 39 }
862
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="ic_launcher_background">#30C7E7</color> </resources>
news_toolkit/flutter_news_example/android/app/src/main/res/values/ic_launcher_background.xml/0
{ "file_path": "news_toolkit/flutter_news_example/android/app/src/main/res/values/ic_launcher_background.xml", "repo_id": "news_toolkit", "token_count": 47 }
863
import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; import 'package:news_blocks/news_blocks.dart'; part 'feed.g.dart'; /// {@template feed} /// A news feed object which contains paginated news feed metadata. /// {@endtemplate} @JsonSerializable() class Feed extends Equatable { /// {@macro feed} const Feed({required this.blocks, required this.totalBlocks}); /// Converts a `Map<String, dynamic>` into a [Feed] instance. factory Feed.fromJson(Map<String, dynamic> json) => _$FeedFromJson(json); /// The list of news blocks for the associated feed (paginated). @NewsBlocksConverter() final List<NewsBlock> blocks; /// The total number of blocks for this feed. final int totalBlocks; /// Converts the current instance to a `Map<String, dynamic>`. Map<String, dynamic> toJson() => _$FeedToJson(this); @override List<Object> get props => [blocks, totalBlocks]; }
news_toolkit/flutter_news_example/api/lib/src/data/models/feed.dart/0
{ "file_path": "news_toolkit/flutter_news_example/api/lib/src/data/models/feed.dart", "repo_id": "news_toolkit", "token_count": 292 }
864
// GENERATED CODE - DO NOT MODIFY BY HAND part of 'article_response.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** ArticleResponse _$ArticleResponseFromJson(Map<String, dynamic> json) => ArticleResponse( title: json['title'] as String, content: const NewsBlocksConverter().fromJson(json['content'] as List), totalCount: json['totalCount'] as int, url: Uri.parse(json['url'] as String), isPremium: json['isPremium'] as bool, isPreview: json['isPreview'] as bool, ); Map<String, dynamic> _$ArticleResponseToJson(ArticleResponse instance) => <String, dynamic>{ 'title': instance.title, 'content': const NewsBlocksConverter().toJson(instance.content), 'totalCount': instance.totalCount, 'url': instance.url.toString(), 'isPremium': instance.isPremium, 'isPreview': instance.isPreview, };
news_toolkit/flutter_news_example/api/lib/src/models/article_response/article_response.g.dart/0
{ "file_path": "news_toolkit/flutter_news_example/api/lib/src/models/article_response/article_response.g.dart", "repo_id": "news_toolkit", "token_count": 326 }
865
// GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas part of 'html_block.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** HtmlBlock _$HtmlBlockFromJson(Map<String, dynamic> json) => $checkedCreate( 'HtmlBlock', json, ($checkedConvert) { final val = HtmlBlock( content: $checkedConvert('content', (v) => v as String), type: $checkedConvert( 'type', (v) => v as String? ?? HtmlBlock.identifier), ); return val; }, ); Map<String, dynamic> _$HtmlBlockToJson(HtmlBlock instance) => <String, dynamic>{ 'content': instance.content, 'type': instance.type, };
news_toolkit/flutter_news_example/api/packages/news_blocks/lib/src/html_block.g.dart/0
{ "file_path": "news_toolkit/flutter_news_example/api/packages/news_blocks/lib/src/html_block.g.dart", "repo_id": "news_toolkit", "token_count": 345 }
866
// GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas part of 'post_medium_block.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** PostMediumBlock _$PostMediumBlockFromJson(Map<String, dynamic> json) => $checkedCreate( 'PostMediumBlock', json, ($checkedConvert) { final val = PostMediumBlock( id: $checkedConvert('id', (v) => v as String), category: $checkedConvert( 'category', (v) => $enumDecode(_$PostCategoryEnumMap, v)), author: $checkedConvert('author', (v) => v as String), publishedAt: $checkedConvert( 'published_at', (v) => DateTime.parse(v as String)), imageUrl: $checkedConvert('image_url', (v) => v as String), title: $checkedConvert('title', (v) => v as String), description: $checkedConvert('description', (v) => v as String?), action: $checkedConvert('action', (v) => const BlockActionConverter().fromJson(v as Map?)), type: $checkedConvert( 'type', (v) => v as String? ?? PostMediumBlock.identifier), isPremium: $checkedConvert('is_premium', (v) => v as bool? ?? false), isContentOverlaid: $checkedConvert( 'is_content_overlaid', (v) => v as bool? ?? false), ); return val; }, fieldKeyMap: const { 'publishedAt': 'published_at', 'imageUrl': 'image_url', 'isPremium': 'is_premium', 'isContentOverlaid': 'is_content_overlaid' }, ); Map<String, dynamic> _$PostMediumBlockToJson(PostMediumBlock instance) { final val = <String, dynamic>{ 'id': instance.id, 'category': _$PostCategoryEnumMap[instance.category], 'author': instance.author, 'published_at': instance.publishedAt.toIso8601String(), }; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('image_url', instance.imageUrl); val['title'] = instance.title; writeNotNull('description', instance.description); writeNotNull('action', const BlockActionConverter().toJson(instance.action)); val['is_premium'] = instance.isPremium; val['is_content_overlaid'] = instance.isContentOverlaid; val['type'] = instance.type; return val; } const _$PostCategoryEnumMap = { PostCategory.business: 'business', PostCategory.entertainment: 'entertainment', PostCategory.health: 'health', PostCategory.science: 'science', PostCategory.sports: 'sports', PostCategory.technology: 'technology', };
news_toolkit/flutter_news_example/api/packages/news_blocks/lib/src/post_medium_block.g.dart/0
{ "file_path": "news_toolkit/flutter_news_example/api/packages/news_blocks/lib/src/post_medium_block.g.dart", "repo_id": "news_toolkit", "token_count": 1079 }
867
// GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas part of 'text_headline_block.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** TextHeadlineBlock _$TextHeadlineBlockFromJson(Map<String, dynamic> json) => $checkedCreate( 'TextHeadlineBlock', json, ($checkedConvert) { final val = TextHeadlineBlock( type: $checkedConvert( 'type', (v) => v as String? ?? TextHeadlineBlock.identifier), text: $checkedConvert('text', (v) => v as String), ); return val; }, ); Map<String, dynamic> _$TextHeadlineBlockToJson(TextHeadlineBlock instance) => <String, dynamic>{ 'text': instance.text, 'type': instance.type, };
news_toolkit/flutter_news_example/api/packages/news_blocks/lib/src/text_headline_block.g.dart/0
{ "file_path": "news_toolkit/flutter_news_example/api/packages/news_blocks/lib/src/text_headline_block.g.dart", "repo_id": "news_toolkit", "token_count": 363 }
868