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 'package:meta/meta.dart';
import 'package:process/process.dart';
import 'package:unified_analytics/unified_analytics.dart';
import '../artifacts.dart';
import '../base/file_system.dart';
import '../base/io.dart';
import '../base/logger.dart';
import '../base/platform.dart';
import '../base/process.dart';
import '../base/version.dart';
import '../build_info.dart';
import '../cache.dart';
import '../convert.dart';
import '../device.dart';
import '../globals.dart' as globals;
import '../ios/core_devices.dart';
import '../ios/devices.dart';
import '../ios/ios_deploy.dart';
import '../ios/iproxy.dart';
import '../ios/mac.dart';
import '../ios/xcode_debug.dart';
import '../reporting/reporting.dart';
import 'xcode.dart';
class XCDeviceEventNotification {
XCDeviceEventNotification(
this.eventType,
this.eventInterface,
this.deviceIdentifier,
);
final XCDeviceEvent eventType;
final XCDeviceEventInterface eventInterface;
final String deviceIdentifier;
}
enum XCDeviceEvent {
attach,
detach,
}
enum XCDeviceEventInterface {
usb(name: 'usb', connectionInterface: DeviceConnectionInterface.attached),
wifi(name: 'wifi', connectionInterface: DeviceConnectionInterface.wireless);
const XCDeviceEventInterface({
required this.name,
required this.connectionInterface,
});
final String name;
final DeviceConnectionInterface connectionInterface;
}
/// A utility class for interacting with Xcode xcdevice command line tools.
class XCDevice {
XCDevice({
required Artifacts artifacts,
required Cache cache,
required ProcessManager processManager,
required Logger logger,
required Xcode xcode,
required Platform platform,
required IProxy iproxy,
required FileSystem fileSystem,
required Analytics analytics,
@visibleForTesting
IOSCoreDeviceControl? coreDeviceControl,
XcodeDebug? xcodeDebug,
}) : _processUtils = ProcessUtils(logger: logger, processManager: processManager),
_logger = logger,
_iMobileDevice = IMobileDevice(
artifacts: artifacts,
cache: cache,
logger: logger,
processManager: processManager,
),
_iosDeploy = IOSDeploy(
artifacts: artifacts,
cache: cache,
logger: logger,
platform: platform,
processManager: processManager,
),
_coreDeviceControl = coreDeviceControl ?? IOSCoreDeviceControl(
logger: logger,
processManager: processManager,
xcode: xcode,
fileSystem: fileSystem,
),
_xcodeDebug = xcodeDebug ?? XcodeDebug(
logger: logger,
processManager: processManager,
xcode: xcode,
fileSystem: fileSystem,
),
_iProxy = iproxy,
_xcode = xcode,
_analytics = analytics {
_setupDeviceIdentifierByEventStream();
}
void dispose() {
_usbDeviceObserveProcess?.kill();
_wifiDeviceObserveProcess?.kill();
_usbDeviceWaitProcess?.kill();
_wifiDeviceWaitProcess?.kill();
}
final ProcessUtils _processUtils;
final Logger _logger;
final IMobileDevice _iMobileDevice;
final IOSDeploy _iosDeploy;
final Xcode _xcode;
final IProxy _iProxy;
final IOSCoreDeviceControl _coreDeviceControl;
final XcodeDebug _xcodeDebug;
final Analytics _analytics;
List<Object>? _cachedListResults;
Process? _usbDeviceObserveProcess;
Process? _wifiDeviceObserveProcess;
StreamController<XCDeviceEventNotification>? _observeStreamController;
@visibleForTesting
StreamController<XCDeviceEventNotification>? waitStreamController;
Process? _usbDeviceWaitProcess;
Process? _wifiDeviceWaitProcess;
void _setupDeviceIdentifierByEventStream() {
// _observeStreamController Should always be available for listeners
// in case polling needs to be stopped and restarted.
_observeStreamController = StreamController<XCDeviceEventNotification>.broadcast(
onListen: _startObservingTetheredIOSDevices,
onCancel: _stopObservingTetheredIOSDevices,
);
}
bool get isInstalled => _xcode.isInstalledAndMeetsVersionCheck;
Future<List<Object>?> _getAllDevices({
bool useCache = false,
required Duration timeout,
}) async {
if (!isInstalled) {
_logger.printTrace("Xcode not found. Run 'flutter doctor' for more information.");
return null;
}
if (useCache && _cachedListResults != null) {
return _cachedListResults;
}
try {
// USB-tethered devices should be found quickly. 1 second timeout is faster than the default.
final RunResult result = await _processUtils.run(
<String>[
..._xcode.xcrunCommand(),
'xcdevice',
'list',
'--timeout',
timeout.inSeconds.toString(),
],
throwOnError: true,
);
if (result.exitCode == 0) {
final String listOutput = result.stdout;
try {
final List<Object> listResults = (json.decode(result.stdout) as List<Object?>).whereType<Object>().toList();
_cachedListResults = listResults;
return listResults;
} on FormatException {
// xcdevice logs errors and crashes to stdout.
_logger.printError('xcdevice returned non-JSON response: $listOutput');
return null;
}
}
_logger.printTrace('xcdevice returned an error:\n${result.stderr}');
} on ProcessException catch (exception) {
_logger.printTrace('Process exception running xcdevice list:\n$exception');
} on ArgumentError catch (exception) {
_logger.printTrace('Argument exception running xcdevice list:\n$exception');
}
return null;
}
/// Observe identifiers (UDIDs) of devices as they attach and detach.
///
/// Each attach and detach event contains information on the event type,
/// the event interface, and the device identifier.
Stream<XCDeviceEventNotification>? observedDeviceEvents() {
if (!isInstalled) {
_logger.printTrace("Xcode not found. Run 'flutter doctor' for more information.");
return null;
}
return _observeStreamController?.stream;
}
// Attach: d83d5bc53967baa0ee18626ba87b6254b2ab5418
// Attach: 00008027-00192736010F802E
// Detach: d83d5bc53967baa0ee18626ba87b6254b2ab5418
final RegExp _observationIdentifierPattern = RegExp(r'^(\w*): ([\w-]*)$');
Future<void> _startObservingTetheredIOSDevices() async {
try {
if (_usbDeviceObserveProcess != null || _wifiDeviceObserveProcess != null) {
throw Exception('xcdevice observe restart failed');
}
_usbDeviceObserveProcess = await _startObserveProcess(
XCDeviceEventInterface.usb,
);
_wifiDeviceObserveProcess = await _startObserveProcess(
XCDeviceEventInterface.wifi,
);
final Future<void> usbProcessExited = _usbDeviceObserveProcess!.exitCode.then((int status) {
_logger.printTrace('xcdevice observe --usb exited with code $exitCode');
// Kill other process in case only one was killed.
_wifiDeviceObserveProcess?.kill();
});
final Future<void> wifiProcessExited = _wifiDeviceObserveProcess!.exitCode.then((int status) {
_logger.printTrace('xcdevice observe --wifi exited with code $exitCode');
// Kill other process in case only one was killed.
_usbDeviceObserveProcess?.kill();
});
unawaited(Future.wait(<Future<void>>[
usbProcessExited,
wifiProcessExited,
]).whenComplete(() async {
if (_observeStreamController?.hasListener ?? false) {
// Tell listeners the process died.
await _observeStreamController?.close();
}
_usbDeviceObserveProcess = null;
_wifiDeviceObserveProcess = null;
// Reopen it so new listeners can resume polling.
_setupDeviceIdentifierByEventStream();
}));
} on ProcessException catch (exception, stackTrace) {
_observeStreamController?.addError(exception, stackTrace);
} on ArgumentError catch (exception, stackTrace) {
_observeStreamController?.addError(exception, stackTrace);
}
}
Future<Process> _startObserveProcess(XCDeviceEventInterface eventInterface) {
// Run in interactive mode (via script) to convince
// xcdevice it has a terminal attached in order to redirect stdout.
return _streamXCDeviceEventCommand(
<String>[
'script',
'-t',
'0',
'/dev/null',
..._xcode.xcrunCommand(),
'xcdevice',
'observe',
'--${eventInterface.name}',
],
prefix: 'xcdevice observe --${eventInterface.name}: ',
mapFunction: (String line) {
final XCDeviceEventNotification? event = _processXCDeviceStdOut(
line,
eventInterface,
);
if (event != null) {
_observeStreamController?.add(event);
}
return line;
},
);
}
/// Starts the command and streams stdout/stderr from the child process to
/// this process' stdout/stderr.
///
/// If [mapFunction] is present, all lines are forwarded to [mapFunction] for
/// further processing.
Future<Process> _streamXCDeviceEventCommand(
List<String> cmd, {
String prefix = '',
StringConverter? mapFunction,
}) async {
final Process process = await _processUtils.start(cmd);
final StreamSubscription<String> stdoutSubscription = process.stdout
.transform<String>(utf8.decoder)
.transform<String>(const LineSplitter())
.listen((String line) {
String? mappedLine = line;
if (mapFunction != null) {
mappedLine = mapFunction(line);
}
if (mappedLine != null) {
final String message = '$prefix$mappedLine';
_logger.printTrace(message);
}
});
final StreamSubscription<String> stderrSubscription = process.stderr
.transform<String>(utf8.decoder)
.transform<String>(const LineSplitter())
.listen((String line) {
String? mappedLine = line;
if (mapFunction != null) {
mappedLine = mapFunction(line);
}
if (mappedLine != null) {
_logger.printError('$prefix$mappedLine', wrap: false);
}
});
unawaited(process.exitCode.whenComplete(() {
stdoutSubscription.cancel();
stderrSubscription.cancel();
}));
return process;
}
void _stopObservingTetheredIOSDevices() {
_usbDeviceObserveProcess?.kill();
_wifiDeviceObserveProcess?.kill();
}
XCDeviceEventNotification? _processXCDeviceStdOut(
String line,
XCDeviceEventInterface eventInterface,
) {
// xcdevice observe example output of UDIDs:
//
// Listening for all devices, on both interfaces.
// Attach: d83d5bc53967baa0ee18626ba87b6254b2ab5418
// Attach: 00008027-00192736010F802E
// Detach: d83d5bc53967baa0ee18626ba87b6254b2ab5418
// Attach: d83d5bc53967baa0ee18626ba87b6254b2ab5418
final RegExpMatch? match = _observationIdentifierPattern.firstMatch(line);
if (match != null && match.groupCount == 2) {
final String verb = match.group(1)!.toLowerCase();
final String identifier = match.group(2)!;
if (verb.startsWith('attach')) {
return XCDeviceEventNotification(
XCDeviceEvent.attach,
eventInterface,
identifier,
);
} else if (verb.startsWith('detach')) {
return XCDeviceEventNotification(
XCDeviceEvent.detach,
eventInterface,
identifier,
);
}
}
return null;
}
/// Wait for a connect event for a specific device. Must use device's exact UDID.
///
/// To cancel this process, call [cancelWaitForDeviceToConnect].
Future<XCDeviceEventNotification?> waitForDeviceToConnect(
String deviceId,
) async {
try {
if (_usbDeviceWaitProcess != null || _wifiDeviceWaitProcess != null) {
throw Exception('xcdevice wait restart failed');
}
waitStreamController = StreamController<XCDeviceEventNotification>();
_usbDeviceWaitProcess = await _startWaitProcess(
deviceId,
XCDeviceEventInterface.usb,
);
_wifiDeviceWaitProcess = await _startWaitProcess(
deviceId,
XCDeviceEventInterface.wifi,
);
final Future<void> usbProcessExited = _usbDeviceWaitProcess!.exitCode.then((int status) {
_logger.printTrace('xcdevice wait --usb exited with code $exitCode');
// Kill other process in case only one was killed.
_wifiDeviceWaitProcess?.kill();
});
final Future<void> wifiProcessExited = _wifiDeviceWaitProcess!.exitCode.then((int status) {
_logger.printTrace('xcdevice wait --wifi exited with code $exitCode');
// Kill other process in case only one was killed.
_usbDeviceWaitProcess?.kill();
});
final Future<void> allProcessesExited = Future.wait(
<Future<void>>[
usbProcessExited,
wifiProcessExited,
]).whenComplete(() async {
_usbDeviceWaitProcess = null;
_wifiDeviceWaitProcess = null;
await waitStreamController?.close();
});
return await Future.any(
<Future<XCDeviceEventNotification?>>[
allProcessesExited.then((_) => null),
waitStreamController!.stream.first.whenComplete(() async {
cancelWaitForDeviceToConnect();
}),
],
);
} on ProcessException catch (exception, stackTrace) {
_logger.printTrace('Process exception running xcdevice wait:\n$exception\n$stackTrace');
} on ArgumentError catch (exception, stackTrace) {
_logger.printTrace('Process exception running xcdevice wait:\n$exception\n$stackTrace');
} on StateError {
_logger.printTrace('Stream broke before first was found');
return null;
}
return null;
}
Future<Process> _startWaitProcess(String deviceId, XCDeviceEventInterface eventInterface) {
// Run in interactive mode (via script) to convince
// xcdevice it has a terminal attached in order to redirect stdout.
return _streamXCDeviceEventCommand(
<String>[
'script',
'-t',
'0',
'/dev/null',
..._xcode.xcrunCommand(),
'xcdevice',
'wait',
'--${eventInterface.name}',
deviceId,
],
prefix: 'xcdevice wait --${eventInterface.name}: ',
mapFunction: (String line) {
final XCDeviceEventNotification? event = _processXCDeviceStdOut(
line,
eventInterface,
);
if (event != null && event.eventType == XCDeviceEvent.attach) {
waitStreamController?.add(event);
}
return line;
},
);
}
void cancelWaitForDeviceToConnect() {
_usbDeviceWaitProcess?.kill();
_wifiDeviceWaitProcess?.kill();
}
/// A list of [IOSDevice]s. This list includes connected devices and
/// disconnected wireless devices.
///
/// Sometimes devices may have incorrect connection information
/// (`isConnected`, `connectionInterface`) if it timed out before it could get the
/// information. Wireless devices can take longer to get the correct
/// information.
///
/// [timeout] defaults to 2 seconds.
Future<List<IOSDevice>> getAvailableIOSDevices({ Duration? timeout }) async {
final List<Object>? allAvailableDevices = await _getAllDevices(timeout: timeout ?? const Duration(seconds: 2));
if (allAvailableDevices == null) {
return const <IOSDevice>[];
}
final Map<String, IOSCoreDevice> coreDeviceMap = <String, IOSCoreDevice>{};
if (_xcode.isDevicectlInstalled) {
final List<IOSCoreDevice> coreDevices = await _coreDeviceControl.getCoreDevices();
for (final IOSCoreDevice device in coreDevices) {
if (device.udid == null) {
continue;
}
coreDeviceMap[device.udid!] = device;
}
}
// [
// {
// "simulator" : true,
// "operatingSystemVersion" : "13.3 (17K446)",
// "available" : true,
// "platform" : "com.apple.platform.appletvsimulator",
// "modelCode" : "AppleTV5,3",
// "identifier" : "CBB5E1ED-2172-446E-B4E7-F2B5823DBBA6",
// "architecture" : "x86_64",
// "modelName" : "Apple TV",
// "name" : "Apple TV"
// },
// {
// "simulator" : false,
// "operatingSystemVersion" : "13.3 (17C54)",
// "interface" : "usb",
// "available" : true,
// "platform" : "com.apple.platform.iphoneos",
// "modelCode" : "iPhone8,1",
// "identifier" : "d83d5bc53967baa0ee18626ba87b6254b2ab5418",
// "architecture" : "arm64",
// "modelName" : "iPhone 6s",
// "name" : "iPhone"
// },
// {
// "simulator" : true,
// "operatingSystemVersion" : "6.1.1 (17S445)",
// "available" : true,
// "platform" : "com.apple.platform.watchsimulator",
// "modelCode" : "Watch5,4",
// "identifier" : "2D74FB11-88A0-44D0-B81E-C0C142B1C94A",
// "architecture" : "i386",
// "modelName" : "Apple Watch Series 5 - 44mm",
// "name" : "Apple Watch Series 5 - 44mm"
// },
// ...
final Map<String, IOSDevice> deviceMap = <String, IOSDevice>{};
for (final Object device in allAvailableDevices) {
if (device is Map<String, Object?>) {
// Only include iPhone, iPad, iPod, or other iOS devices.
if (!_isIPhoneOSDevice(device)) {
continue;
}
final String? identifier = device['identifier'] as String?;
final String? name = device['name'] as String?;
if (identifier == null || name == null) {
continue;
}
bool devModeEnabled = true;
bool isConnected = true;
bool isPaired = true;
final Map<String, Object?>? errorProperties = _errorProperties(device);
if (errorProperties != null) {
final String? errorMessage = _parseErrorMessage(errorProperties);
if (errorMessage != null) {
if (errorMessage.contains('not paired')) {
UsageEvent('device', 'ios-trust-failure', flutterUsage: globals.flutterUsage).send();
_analytics.send(Event.appleUsageEvent(workflow: 'device', parameter: 'ios-trust-failure'));
}
_logger.printTrace(errorMessage);
}
final int? code = _errorCode(errorProperties);
// Temporary error -10: iPhone is busy: Preparing debugger support for iPhone.
// Sometimes the app launch will fail on these devices until Xcode is done setting up the device.
// Other times this is a false positive and the app will successfully launch despite the error.
if (code != -10) {
isConnected = false;
}
// Error: iPhone is not paired with your computer. To use iPhone with Xcode, unlock it and choose to trust this computer when prompted. (code -9)
if (code == -9) {
isPaired = false;
}
if (code == 6) {
devModeEnabled = false;
}
}
String? sdkVersionString = _sdkVersion(device);
if (sdkVersionString != null) {
final String? buildVersion = _buildVersion(device);
if (buildVersion != null) {
sdkVersionString = '$sdkVersionString $buildVersion';
}
}
// Duplicate entries started appearing in Xcode 15, possibly due to
// Xcode's new device connectivity stack.
// If a duplicate entry is found in `xcdevice list`, don't overwrite
// existing entry when the existing entry indicates the device is
// connected and the current entry indicates the device is not connected.
// Don't overwrite if current entry's sdkVersion is null.
// Don't overwrite if both entries indicate the device is not
// connected and the existing entry has a higher sdkVersion.
if (deviceMap.containsKey(identifier)) {
final IOSDevice deviceInMap = deviceMap[identifier]!;
if ((deviceInMap.isConnected && !isConnected) || sdkVersionString == null) {
continue;
}
final Version? sdkVersion = Version.parse(sdkVersionString);
if (!deviceInMap.isConnected &&
!isConnected &&
sdkVersion != null &&
deviceInMap.sdkVersion != null &&
deviceInMap.sdkVersion!.compareTo(sdkVersion) > 0) {
continue;
}
}
DeviceConnectionInterface connectionInterface = _interfaceType(device);
// CoreDevices (devices with iOS 17 and greater) no longer reflect the
// correct connection interface or developer mode status in `xcdevice`.
// Use `devicectl` to get that information for CoreDevices.
final IOSCoreDevice? coreDevice = coreDeviceMap[identifier];
if (coreDevice != null) {
if (coreDevice.connectionInterface != null) {
connectionInterface = coreDevice.connectionInterface!;
}
if (coreDevice.deviceProperties?.developerModeStatus != 'enabled') {
devModeEnabled = false;
}
}
deviceMap[identifier] = IOSDevice(
identifier,
name: name,
cpuArchitecture: _cpuArchitecture(device),
connectionInterface: connectionInterface,
isConnected: isConnected,
sdkVersion: sdkVersionString,
iProxy: _iProxy,
fileSystem: globals.fs,
logger: _logger,
iosDeploy: _iosDeploy,
iMobileDevice: _iMobileDevice,
coreDeviceControl: _coreDeviceControl,
xcodeDebug: _xcodeDebug,
platform: globals.platform,
devModeEnabled: devModeEnabled,
isPaired: isPaired,
isCoreDevice: coreDevice != null,
);
}
}
return deviceMap.values.toList();
}
/// Despite the name, com.apple.platform.iphoneos includes iPhone, iPads, and all iOS devices.
/// Excludes simulators.
static bool _isIPhoneOSDevice(Map<String, Object?> deviceProperties) {
final Object? platform = deviceProperties['platform'];
if (platform is String) {
return platform == 'com.apple.platform.iphoneos';
}
return false;
}
static Map<String, Object?>? _errorProperties(Map<String, Object?> deviceProperties) {
final Object? error = deviceProperties['error'];
return error is Map<String, Object?> ? error : null;
}
static int? _errorCode(Map<String, Object?>? errorProperties) {
if (errorProperties == null) {
return null;
}
final Object? code = errorProperties['code'];
return code is int ? code : null;
}
static DeviceConnectionInterface _interfaceType(Map<String, Object?> deviceProperties) {
// Interface can be "usb" or "network". It can also be missing
// (e.g. simulators do not have an interface property).
// If the interface is "network", use `DeviceConnectionInterface.wireless`,
// otherwise use `DeviceConnectionInterface.attached.
final Object? interface = deviceProperties['interface'];
if (interface is String && interface.toLowerCase() == 'network') {
return DeviceConnectionInterface.wireless;
}
return DeviceConnectionInterface.attached;
}
static String? _sdkVersion(Map<String, Object?> deviceProperties) {
final Object? operatingSystemVersion = deviceProperties['operatingSystemVersion'];
if (operatingSystemVersion is String) {
// Parse out the OS version, ignore the build number in parentheses.
// "13.3 (17C54)"
final RegExp operatingSystemRegex = RegExp(r'(.*) \(.*\)$');
if (operatingSystemRegex.hasMatch(operatingSystemVersion.trim())) {
return operatingSystemRegex.firstMatch(operatingSystemVersion.trim())?.group(1);
}
return operatingSystemVersion;
}
return null;
}
static String? _buildVersion(Map<String, Object?> deviceProperties) {
final Object? operatingSystemVersion = deviceProperties['operatingSystemVersion'];
if (operatingSystemVersion is String) {
// Parse out the build version, for example 17C54 from "13.3 (17C54)".
final RegExp buildVersionRegex = RegExp(r'\(.*\)$');
return buildVersionRegex.firstMatch(operatingSystemVersion)?.group(0)?.replaceAll(RegExp('[()]'), '');
}
return null;
}
DarwinArch _cpuArchitecture(Map<String, Object?> deviceProperties) {
DarwinArch? cpuArchitecture;
final Object? architecture = deviceProperties['architecture'];
if (architecture is String) {
try {
cpuArchitecture = getIOSArchForName(architecture);
} on Exception {
// Fallback to default iOS architecture. Future-proof against a
// theoretical version of Xcode that changes this string to something
// slightly different like "ARM64", or armv7 variations like
// armv7s and armv7f.
if (architecture.startsWith('armv7')) {
cpuArchitecture = DarwinArch.armv7;
} else {
cpuArchitecture = DarwinArch.arm64;
}
_logger.printWarning(
'Unknown architecture $architecture, defaulting to '
'${cpuArchitecture.name}',
);
}
}
return cpuArchitecture ?? DarwinArch.arm64;
}
/// Error message parsed from xcdevice. null if no error.
static String? _parseErrorMessage(Map<String, Object?>? errorProperties) {
// {
// "simulator" : false,
// "operatingSystemVersion" : "13.3 (17C54)",
// "interface" : "usb",
// "available" : false,
// "platform" : "com.apple.platform.iphoneos",
// "modelCode" : "iPhone8,1",
// "identifier" : "98206e7a4afd4aedaff06e687594e089dede3c44",
// "architecture" : "arm64",
// "modelName" : "iPhone 6s",
// "name" : "iPhone",
// "error" : {
// "code" : -9,
// "failureReason" : "",
// "underlyingErrors" : [
// {
// "code" : 5,
// "failureReason" : "allowsSecureServices: 1. isConnected: 0. Platform: <DVTPlatform:0x7f804ce32880:'com.apple.platform.iphoneos':<DVTFilePath:0x7f804ce32800:'\/Users\/magder\/Applications\/Xcode_11-3-1.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform'>>. DTDKDeviceIdentifierIsIDID: 0",
// "description" : "📱<DVTiOSDevice (0x7f801f190450), iPhone, iPhone, 13.3 (17C54), d83d5bc53967baa0ee18626ba87b6254b2ab5418> -- Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.",
// "recoverySuggestion" : "",
// "domain" : "com.apple.platform.iphoneos"
// }
// ],
// "description" : "iPhone is not paired with your computer.",
// "recoverySuggestion" : "To use iPhone with Xcode, unlock it and choose to trust this computer when prompted.",
// "domain" : "com.apple.platform.iphoneos"
// }
// },
// {
// "simulator" : false,
// "operatingSystemVersion" : "13.3 (17C54)",
// "interface" : "usb",
// "available" : false,
// "platform" : "com.apple.platform.iphoneos",
// "modelCode" : "iPhone8,1",
// "identifier" : "d83d5bc53967baa0ee18626ba87b6254b2ab5418",
// "architecture" : "arm64",
// "modelName" : "iPhone 6s",
// "name" : "iPhone",
// "error" : {
// "code" : -9,
// "failureReason" : "",
// "description" : "iPhone is not paired with your computer.",
// "domain" : "com.apple.platform.iphoneos"
// }
// }
// ...
if (errorProperties == null) {
return null;
}
final StringBuffer errorMessage = StringBuffer('Error: ');
final Object? description = errorProperties['description'];
if (description is String) {
errorMessage.write(description);
if (!description.endsWith('.')) {
errorMessage.write('.');
}
} else {
errorMessage.write('Xcode pairing error.');
}
final Object? recoverySuggestion = errorProperties['recoverySuggestion'];
if (recoverySuggestion is String) {
errorMessage.write(' $recoverySuggestion');
}
final int? code = _errorCode(errorProperties);
if (code != null) {
errorMessage.write(' (code $code)');
}
return errorMessage.toString();
}
/// List of all devices reporting errors.
Future<List<String>> getDiagnostics() async {
final List<Object>? allAvailableDevices = await _getAllDevices(
useCache: true,
timeout: const Duration(seconds: 2)
);
if (allAvailableDevices == null) {
return const <String>[];
}
final List<String> diagnostics = <String>[];
for (final Object deviceProperties in allAvailableDevices) {
if (deviceProperties is! Map<String, Object?>) {
continue;
}
final Map<String, Object?>? errorProperties = _errorProperties(deviceProperties);
final String? errorMessage = _parseErrorMessage(errorProperties);
if (errorMessage != null) {
final int? code = _errorCode(errorProperties);
// Error -13: iPhone is not connected. Xcode will continue when iPhone is connected.
// This error is confusing since the device is not connected and maybe has not been connected
// for a long time. Avoid showing it.
if (code == -13 && errorMessage.contains('not connected')) {
continue;
}
diagnostics.add(errorMessage);
}
}
return diagnostics;
}
}
| flutter/packages/flutter_tools/lib/src/macos/xcdevice.dart/0 | {
"file_path": "flutter/packages/flutter_tools/lib/src/macos/xcdevice.dart",
"repo_id": "flutter",
"token_count": 11753
} | 754 |
// 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:meta/meta.dart';
import 'package:process/process.dart';
import 'application_package.dart';
import 'artifacts.dart';
import 'base/file_system.dart';
import 'base/io.dart';
import 'base/logger.dart';
import 'base/platform.dart';
import 'build_info.dart';
import 'bundle_builder.dart';
import 'desktop_device.dart';
import 'devfs.dart';
import 'device.dart';
import 'device_port_forwarder.dart';
import 'features.dart';
import 'project.dart';
import 'protocol_discovery.dart';
typedef BundleBuilderFactory = BundleBuilder Function();
BundleBuilder _defaultBundleBuilder() {
return BundleBuilder();
}
class PreviewDeviceDiscovery extends PollingDeviceDiscovery {
PreviewDeviceDiscovery({
required Platform platform,
required Artifacts artifacts,
required FileSystem fileSystem,
required Logger logger,
required ProcessManager processManager,
required FeatureFlags featureFlags,
}) : _artifacts = artifacts,
_logger = logger,
_processManager = processManager,
_fileSystem = fileSystem,
_platform = platform,
_features = featureFlags,
super('Flutter preview device');
final Platform _platform;
final Artifacts _artifacts;
final Logger _logger;
final ProcessManager _processManager;
final FileSystem _fileSystem;
final FeatureFlags _features;
@override
bool get canListAnything => _platform.isWindows;
@override
bool get supportsPlatform => _platform.isWindows;
@override
List<String> get wellKnownIds => <String>['preview'];
@override
Future<List<Device>> pollingGetDevices({
Duration? timeout,
}) async {
final File previewBinary = _fileSystem.file(_artifacts.getArtifactPath(Artifact.flutterPreviewDevice));
if (!previewBinary.existsSync()) {
return const <Device>[];
}
final PreviewDevice device = PreviewDevice(
artifacts: _artifacts,
fileSystem: _fileSystem,
logger: _logger,
processManager: _processManager,
previewBinary: previewBinary,
);
return <Device>[
if (_features.isPreviewDeviceEnabled)
device,
];
}
@override
Future<List<Device>> discoverDevices({
Duration? timeout,
DeviceDiscoveryFilter? filter,
}) {
return devices();
}
}
/// A device type that runs a prebuilt desktop binary alongside a locally compiled kernel file.
class PreviewDevice extends Device {
PreviewDevice({
required ProcessManager processManager,
required Logger logger,
required FileSystem fileSystem,
required Artifacts artifacts,
required File previewBinary,
@visibleForTesting BundleBuilderFactory builderFactory = _defaultBundleBuilder,
}) : _previewBinary = previewBinary,
_processManager = processManager,
_logger = logger,
_fileSystem = fileSystem,
_bundleBuilderFactory = builderFactory,
_artifacts = artifacts,
super('preview', ephemeral: false, category: Category.desktop, platformType: PlatformType.windowsPreview);
final ProcessManager _processManager;
final Logger _logger;
final FileSystem _fileSystem;
final BundleBuilderFactory _bundleBuilderFactory;
final Artifacts _artifacts;
final File _previewBinary;
/// The set of plugins that are allowed to be used by Preview users.
///
/// Currently no plugins are supported.
static const List<String> supportedPubPlugins = <String>[];
@override
void clearLogs() { }
@override
Future<void> dispose() async { }
@override
Future<String?> get emulatorId async => null;
final DesktopLogReader _logReader = DesktopLogReader();
@override
FutureOr<DeviceLogReader> getLogReader({ApplicationPackage? app, bool includePastLogs = false}) => _logReader;
@override
Future<bool> installApp(ApplicationPackage? app, {String? userIdentifier}) async => true;
@override
Future<bool> isAppInstalled(ApplicationPackage app, {String? userIdentifier}) async => false;
@override
Future<bool> isLatestBuildInstalled(ApplicationPackage app) async => false;
@override
Future<bool> get isLocalEmulator async => false;
@override
bool isSupported() => true;
@override
bool isSupportedForProject(FlutterProject flutterProject) => true;
@override
String get name => 'Preview';
@override
DevicePortForwarder get portForwarder => const NoOpDevicePortForwarder();
@override
Future<String> get sdkNameAndVersion async => 'preview';
Process? _process;
@override
Future<LaunchResult> startApp(ApplicationPackage? package, {
String? mainPath,
String? route,
required DebuggingOptions debuggingOptions,
Map<String, dynamic> platformArgs = const <String, dynamic>{},
bool prebuiltApplication = false,
bool ipv6 = false,
String? userIdentifier,
}) async {
final Directory assetDirectory = _fileSystem.systemTempDirectory
.createTempSync('flutter_preview.');
// Build assets and perform initial compilation.
Status? status;
try {
status = _logger.startProgress('Compiling application for preview...');
await _bundleBuilderFactory().build(
buildInfo: debuggingOptions.buildInfo,
mainPath: mainPath,
platform: TargetPlatform.windows_x64,
assetDirPath: getAssetBuildDirectory(),
);
copyDirectory(_fileSystem.directory(
getAssetBuildDirectory()),
assetDirectory.childDirectory('data').childDirectory('flutter_assets'),
);
} finally {
status?.stop();
}
// Merge with precompiled executable.
final String copiedPreviewBinaryPath = assetDirectory.childFile(_previewBinary.basename).path;
_previewBinary.copySync(copiedPreviewBinaryPath);
final String windowsPath = _artifacts
.getArtifactPath(Artifact.windowsDesktopPath, platform: TargetPlatform.windows_x64, mode: BuildMode.debug);
final File windowsDll = _fileSystem.file(_fileSystem.path.join(windowsPath, 'flutter_windows.dll'));
final File icu = _fileSystem.file(_fileSystem.path.join(windowsPath, 'icudtl.dat'));
windowsDll.copySync(assetDirectory.childFile('flutter_windows.dll').path);
icu.copySync(assetDirectory.childDirectory('data').childFile('icudtl.dat').path);
final Process process = await _processManager.start(
<String>[copiedPreviewBinaryPath],
);
_process = process;
_logReader.initializeProcess(process);
final ProtocolDiscovery vmServiceDiscovery = ProtocolDiscovery.vmService(_logReader,
devicePort: debuggingOptions.deviceVmServicePort,
hostPort: debuggingOptions.hostVmServicePort,
ipv6: ipv6,
logger: _logger,
);
try {
final Uri? vmServiceUri = await vmServiceDiscovery.uri;
if (vmServiceUri != null) {
return LaunchResult.succeeded(vmServiceUri: vmServiceUri);
}
_logger.printError(
'Error waiting for a debug connection: '
'The log reader stopped unexpectedly.',
);
} on Exception catch (error) {
_logger.printError('Error waiting for a debug connection: $error');
} finally {
await vmServiceDiscovery.cancel();
}
return LaunchResult.failed();
}
@override
Future<bool> stopApp(ApplicationPackage? app, {String? userIdentifier}) async {
return _process?.kill() ?? false;
}
@override
Future<TargetPlatform> get targetPlatform async {
return TargetPlatform.windows_x64;
}
@override
Future<bool> uninstallApp(ApplicationPackage app, {String? userIdentifier}) async {
return true;
}
@override
DevFSWriter createDevFSWriter(ApplicationPackage? app, String? userIdentifier) {
return LocalDevFSWriter(fileSystem: _fileSystem);
}
}
| flutter/packages/flutter_tools/lib/src/preview_device.dart/0 | {
"file_path": "flutter/packages/flutter_tools/lib/src/preview_device.dart",
"repo_id": "flutter",
"token_count": 2545
} | 755 |
// 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.
library reporting;
import 'dart:async';
import 'package:file/file.dart';
import 'package:meta/meta.dart';
import 'package:package_config/package_config.dart';
import 'package:usage/usage_io.dart';
import '../base/error_handling_io.dart';
import '../base/file_system.dart';
import '../base/time.dart';
import '../build_info.dart';
import '../dart/language_version.dart';
import '../doctor_validator.dart';
import '../features.dart';
import '../globals.dart' as globals;
import '../version.dart';
import 'first_run.dart';
part 'disabled_usage.dart';
part 'events.dart';
part 'usage.dart';
part 'custom_dimensions.dart';
| flutter/packages/flutter_tools/lib/src/reporting/reporting.dart/0 | {
"file_path": "flutter/packages/flutter_tools/lib/src/reporting/reporting.dart",
"repo_id": "flutter",
"token_count": 270
} | 756 |
// 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; // flutter_ignore: dart_io_import;
import 'package:dds/dds.dart';
import 'package:meta/meta.dart';
import 'package:process/process.dart';
import 'package:stream_channel/stream_channel.dart';
import 'package:vm_service/vm_service.dart' as vm_service;
import '../base/file_system.dart';
import '../base/io.dart';
import '../base/logger.dart';
import '../base/platform.dart';
import '../convert.dart';
import '../device.dart';
import '../globals.dart' as globals;
import '../project.dart';
import '../resident_runner.dart';
import '../vmservice.dart';
import 'font_config_manager.dart';
import 'test_device.dart';
/// Implementation of [TestDevice] with the Flutter Tester over a [Process].
class FlutterTesterTestDevice extends TestDevice {
FlutterTesterTestDevice({
required this.id,
required this.platform,
required this.fileSystem,
required this.processManager,
required this.logger,
required this.shellPath,
required this.debuggingOptions,
required this.enableVmService,
required this.machine,
required this.host,
required this.testAssetDirectory,
required this.flutterProject,
required this.icudtlPath,
required this.compileExpression,
required this.fontConfigManager,
required this.uriConverter,
}) : assert(!debuggingOptions.startPaused || enableVmService),
_gotProcessVmServiceUri = enableVmService
? Completer<Uri?>() : (Completer<Uri?>()..complete());
/// Used for logging to identify the test that is currently being executed.
final int id;
final Platform platform;
final FileSystem fileSystem;
final ProcessManager processManager;
final Logger logger;
final String shellPath;
final DebuggingOptions debuggingOptions;
final bool enableVmService;
final bool? machine;
final InternetAddress? host;
final String? testAssetDirectory;
final FlutterProject? flutterProject;
final String? icudtlPath;
final CompileExpression? compileExpression;
final FontConfigManager fontConfigManager;
final UriConverter? uriConverter;
final Completer<Uri?> _gotProcessVmServiceUri;
final Completer<int> _exitCode = Completer<int>();
Process? _process;
HttpServer? _server;
DevtoolsLauncher? _devToolsLauncher;
/// Starts the device.
///
/// [entrypointPath] is the path to the entrypoint file which must be compiled
/// as a dill.
@override
Future<StreamChannel<String>> start(String entrypointPath) async {
assert(!_exitCode.isCompleted);
assert(_process == null);
assert(_server == null);
// Prepare our WebSocket server to talk to the engine subprocess.
// Let the server choose an unused port.
_server = await bind(host, /*port*/ 0);
logger.printTrace('test $id: test harness socket server is running at port:${_server!.port}');
final List<String> command = <String>[
shellPath,
if (enableVmService) ...<String>[
// Some systems drive the _FlutterPlatform class in an unusual way, where
// only one test file is processed at a time, and the operating
// environment hands out specific ports ahead of time in a cooperative
// manner, where we're only allowed to open ports that were given to us in
// advance like this. For those esoteric systems, we have this feature
// whereby you can create _FlutterPlatform with a pair of ports.
//
// I mention this only so that you won't be tempted, as I was, to apply
// the obvious simplification to this code and remove this entire feature.
'--vm-service-port=${debuggingOptions.enableDds ? 0 : debuggingOptions.hostVmServicePort }',
if (debuggingOptions.startPaused) '--start-paused',
if (debuggingOptions.disableServiceAuthCodes) '--disable-service-auth-codes',
]
else
'--disable-vm-service',
if (host!.type == InternetAddressType.IPv6) '--ipv6',
if (icudtlPath != null) '--icu-data-file-path=$icudtlPath',
'--enable-checked-mode',
'--verify-entry-points',
if (debuggingOptions.enableImpeller == ImpellerStatus.enabled)
'--enable-impeller'
else
...<String>[
'--enable-software-rendering',
'--skia-deterministic-rendering',
],
if (debuggingOptions.enableDartProfiling)
'--enable-dart-profiling',
'--non-interactive',
'--use-test-fonts',
'--disable-asset-fonts',
'--packages=${debuggingOptions.buildInfo.packagesPath}',
if (testAssetDirectory != null)
'--flutter-assets-dir=$testAssetDirectory',
if (debuggingOptions.nullAssertions)
'--dart-flags=--null_assertions',
...debuggingOptions.dartEntrypointArgs,
entrypointPath,
];
// If the FLUTTER_TEST environment variable has been set, then pass it on
// for package:flutter_test to handle the value.
//
// If FLUTTER_TEST has not been set, assume from this context that this
// call was invoked by the command 'flutter test'.
final String flutterTest = platform.environment.containsKey('FLUTTER_TEST')
? platform.environment['FLUTTER_TEST']!
: 'true';
final Map<String, String> environment = <String, String>{
'FLUTTER_TEST': flutterTest,
'FONTCONFIG_FILE': fontConfigManager.fontConfigFile.path,
'SERVER_PORT': _server!.port.toString(),
'APP_NAME': flutterProject?.manifest.appName ?? '',
if (debuggingOptions.enableImpeller == ImpellerStatus.enabled)
'FLUTTER_TEST_IMPELLER': 'true',
if (testAssetDirectory != null)
'UNIT_TEST_ASSETS': testAssetDirectory!,
};
logger.printTrace('test $id: Starting flutter_tester process with command=$command, environment=$environment');
_process = await processManager.start(command, environment: environment);
// Unawaited to update state.
unawaited(_process!.exitCode.then((int exitCode) {
logger.printTrace('test $id: flutter_tester process at pid ${_process!.pid} exited with code=$exitCode');
_exitCode.complete(exitCode);
}));
logger.printTrace('test $id: Started flutter_tester process at pid ${_process!.pid}');
// Pipe stdout and stderr from the subprocess to our printStatus console.
// We also keep track of what VM Service port the engine used, if any.
_pipeStandardStreamsToConsole(
process: _process!,
reportVmServiceUri: (Uri detectedUri) async {
assert(!_gotProcessVmServiceUri.isCompleted);
assert(debuggingOptions.hostVmServicePort == null ||
debuggingOptions.hostVmServicePort == detectedUri.port);
Uri? forwardingUri;
DartDevelopmentService? dds;
if (debuggingOptions.enableDds) {
logger.printTrace('test $id: Starting Dart Development Service');
dds = await startDds(
detectedUri,
uriConverter: uriConverter,
);
forwardingUri = dds.uri;
logger.printTrace('test $id: Dart Development Service started at ${dds.uri}, forwarding to VM service at ${dds.remoteVmServiceUri}.');
} else {
forwardingUri = detectedUri;
}
logger.printTrace('Connecting to service protocol: $forwardingUri');
final FlutterVmService vmService = await connectToVmServiceImpl(
forwardingUri!,
compileExpression: compileExpression,
logger: logger,
);
logger.printTrace('test $id: Successfully connected to service protocol: $forwardingUri');
if (debuggingOptions.serveObservatory) {
try {
await vmService.callMethodWrapper('_serveObservatory');
} on vm_service.RPCError {
logger.printWarning('Unable to enable Observatory');
}
}
if (debuggingOptions.startPaused && !machine!) {
logger.printStatus('The Dart VM service is listening on $forwardingUri');
await _startDevTools(forwardingUri, dds);
logger.printStatus('');
logger.printStatus('The test process has been started. Set any relevant breakpoints and then resume the test in the debugger.');
}
_gotProcessVmServiceUri.complete(forwardingUri);
},
);
return remoteChannel;
}
@override
Future<Uri?> get vmServiceUri {
return _gotProcessVmServiceUri.future;
}
@override
Future<void> kill() async {
logger.printTrace('test $id: Terminating flutter_tester process');
_process?.kill(io.ProcessSignal.sigkill);
logger.printTrace('test $id: Shutting down DevTools server');
await _devToolsLauncher?.close();
logger.printTrace('test $id: Shutting down test harness socket server');
await _server?.close(force: true);
await finished;
}
@override
Future<void> get finished async {
final int exitCode = await _exitCode.future;
// On Windows, the [exitCode] and the terminating signal have no correlation.
if (platform.isWindows) {
return;
}
// ProcessSignal.SIGKILL. Negative because signals are returned as negative
// exit codes.
if (exitCode == -9) {
// We expect SIGKILL (9) because we could have tried to [kill] it.
return;
}
throw TestDeviceException(_getExitCodeMessage(exitCode), StackTrace.current);
}
Uri get _ddsServiceUri {
return Uri(
scheme: 'http',
host: (host!.type == InternetAddressType.IPv6 ?
InternetAddress.loopbackIPv6 :
InternetAddress.loopbackIPv4
).host,
port: debuggingOptions.hostVmServicePort ?? 0,
);
}
@visibleForTesting
@protected
Future<DartDevelopmentService> startDds(Uri uri, {UriConverter? uriConverter}) {
return DartDevelopmentService.startDartDevelopmentService(
uri,
serviceUri: _ddsServiceUri,
enableAuthCodes: !debuggingOptions.disableServiceAuthCodes,
ipv6: host!.type == InternetAddressType.IPv6,
uriConverter: uriConverter,
);
}
@visibleForTesting
@protected
Future<FlutterVmService> connectToVmServiceImpl(
Uri httpUri, {
CompileExpression? compileExpression,
required Logger logger,
}) {
return connectToVmService(
httpUri,
compileExpression: compileExpression,
logger: logger,
);
}
Future<void> _startDevTools(Uri forwardingUri, DartDevelopmentService? dds) async {
_devToolsLauncher = DevtoolsLauncher.instance;
logger.printTrace('test $id: Serving DevTools...');
final DevToolsServerAddress? devToolsServerAddress = await _devToolsLauncher?.serve();
if (devToolsServerAddress == null) {
logger.printTrace('test $id: Failed to start DevTools');
return;
}
await _devToolsLauncher?.ready;
logger.printTrace('test $id: DevTools is being served at ${devToolsServerAddress.uri}');
// Notify the DDS instance that there's a DevTools instance available so it can correctly
// redirect DevTools related requests.
dds?.setExternalDevToolsUri(devToolsServerAddress.uri!);
final Uri devToolsUri = devToolsServerAddress.uri!.replace(
// Use query instead of queryParameters to avoid unnecessary encoding.
query: 'uri=$forwardingUri',
);
logger.printStatus('The Flutter DevTools debugger and profiler is available at: $devToolsUri');
}
/// Binds an [HttpServer] serving from `host` on `port`.
///
/// Only intended to be overridden in tests.
@protected
@visibleForTesting
Future<HttpServer> bind(InternetAddress? host, int port) => HttpServer.bind(host, port);
@protected
@visibleForTesting
Future<StreamChannel<String>> get remoteChannel async {
assert(_server != null);
try {
final HttpRequest firstRequest = await _server!.first;
final WebSocket webSocket = await WebSocketTransformer.upgrade(firstRequest);
return _webSocketToStreamChannel(webSocket);
} on Exception catch (error, stackTrace) {
throw TestDeviceException('Unable to connect to flutter_tester process: $error', stackTrace);
}
}
@override
String toString() {
final String status = _process != null
? 'pid: ${_process!.pid}, ${_exitCode.isCompleted ? 'exited' : 'running'}'
: 'not started';
return 'Flutter Tester ($status) for test $id';
}
void _pipeStandardStreamsToConsole({
required Process process,
required Future<void> Function(Uri uri) reportVmServiceUri,
}) {
for (final Stream<List<int>> stream in <Stream<List<int>>>[
process.stderr,
process.stdout,
]) {
stream
.transform<String>(utf8.decoder)
.transform<String>(const LineSplitter())
.listen(
(String line) async {
logger.printTrace('test $id: Shell: $line');
final Match? match = globals.kVMServiceMessageRegExp.firstMatch(line);
if (match != null) {
try {
final Uri uri = Uri.parse(match[1]!);
await reportVmServiceUri(uri);
} on Exception catch (error) {
logger.printError('Could not parse shell VM Service port message: $error');
}
} else {
logger.printStatus('Shell: $line');
}
},
onError: (dynamic error) {
logger.printError('shell console stream for process pid ${process.pid} experienced an unexpected error: $error');
},
cancelOnError: true,
);
}
}
}
String _getExitCodeMessage(int exitCode) {
switch (exitCode) {
case 1:
return 'Shell subprocess cleanly reported an error. Check the logs above for an error message.';
case 0:
return 'Shell subprocess ended cleanly. Did main() call exit()?';
case -0x0f: // ProcessSignal.SIGTERM
return 'Shell subprocess crashed with SIGTERM ($exitCode).';
case -0x0b: // ProcessSignal.SIGSEGV
return 'Shell subprocess crashed with segmentation fault.';
case -0x06: // ProcessSignal.SIGABRT
return 'Shell subprocess crashed with SIGABRT ($exitCode).';
case -0x02: // ProcessSignal.SIGINT
return 'Shell subprocess terminated by ^C (SIGINT, $exitCode).';
default:
return 'Shell subprocess crashed with unexpected exit code $exitCode.';
}
}
StreamChannel<String> _webSocketToStreamChannel(WebSocket webSocket) {
final StreamChannelController<String> controller = StreamChannelController<String>();
controller.local.stream
.map<dynamic>((String message) => message as dynamic)
.pipe(webSocket);
webSocket
// We're only communicating with string encoded JSON.
.map<String>((dynamic message) => message as String)
.pipe(controller.local.sink);
return controller.foreign;
}
| flutter/packages/flutter_tools/lib/src/test/flutter_tester_device.dart/0 | {
"file_path": "flutter/packages/flutter_tools/lib/src/test/flutter_tester_device.dart",
"repo_id": "flutter",
"token_count": 5433
} | 757 |
// 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:meta/meta.dart';
import 'base/common.dart';
import 'base/file_system.dart';
import 'base/io.dart';
import 'base/logger.dart';
import 'base/platform.dart';
import 'base/process.dart';
import 'base/time.dart';
import 'cache.dart';
import 'convert.dart';
import 'globals.dart' as globals;
const String _unknownFrameworkVersion = '0.0.0-unknown';
/// A git shortcut for the branch that is being tracked by the current one.
///
/// See `man gitrevisions` for more information.
const String kGitTrackingUpstream = '@{upstream}';
/// Replacement name when the branch is user-specific.
const String kUserBranch = '[user-branch]';
/// This maps old branch names to the names of branches that replaced them.
///
/// For example, in 2021 we deprecated the "dev" channel and transitioned "dev"
/// users to the "beta" channel.
const Map<String, String> kObsoleteBranches = <String, String>{
'dev': 'beta',
};
/// The names of each channel/branch in order of increasing stability.
enum Channel {
master,
main,
beta,
stable,
}
// Beware: Keep order in accordance with stability
const Set<String> kOfficialChannels = <String>{
'master',
'main',
'beta',
'stable',
};
const Map<String, String> kChannelDescriptions = <String, String>{
'master': 'latest development branch, for contributors',
'main': 'latest development branch, follows master channel',
'beta': 'updated monthly, recommended for experienced users',
'stable': 'updated quarterly, for new users and for production app releases',
};
const Set<String> kDevelopmentChannels = <String>{
'master',
'main',
};
/// Retrieve a human-readable name for a given [channel].
///
/// Requires [kOfficialChannels] to be correctly ordered.
String getNameForChannel(Channel channel) {
return kOfficialChannels.elementAt(channel.index);
}
/// Retrieve the [Channel] representation for a string [name].
///
/// Returns `null` if [name] is not in the list of official channels, according
/// to [kOfficialChannels].
Channel? getChannelForName(String name) {
if (kOfficialChannels.contains(name)) {
return Channel.values[kOfficialChannels.toList().indexOf(name)];
}
return null;
}
abstract class FlutterVersion {
/// Parses the Flutter version from currently available tags in the local
/// repo.
factory FlutterVersion({
SystemClock clock = const SystemClock(),
required FileSystem fs,
required String flutterRoot,
@protected
bool fetchTags = false,
}) {
final File versionFile = getVersionFile(fs, flutterRoot);
if (!fetchTags && versionFile.existsSync()) {
final _FlutterVersionFromFile? version = _FlutterVersionFromFile.tryParseFromFile(
versionFile,
flutterRoot: flutterRoot,
);
if (version != null) {
return version;
}
}
// if we are fetching tags, ignore cached versionFile
if (fetchTags && versionFile.existsSync()) {
versionFile.deleteSync();
final File legacyVersionFile = fs.file(fs.path.join(flutterRoot, 'version'));
if (legacyVersionFile.existsSync()) {
legacyVersionFile.deleteSync();
}
}
final String frameworkRevision = _runGit(
gitLog(<String>['-n', '1', '--pretty=format:%H']).join(' '),
globals.processUtils,
flutterRoot,
);
return FlutterVersion.fromRevision(
clock: clock,
frameworkRevision: frameworkRevision,
fs: fs,
flutterRoot: flutterRoot,
fetchTags: fetchTags,
);
}
FlutterVersion._({
required SystemClock clock,
required this.flutterRoot,
required this.fs,
}) : _clock = clock;
factory FlutterVersion.fromRevision({
SystemClock clock = const SystemClock(),
required String flutterRoot,
required String frameworkRevision,
required FileSystem fs,
bool fetchTags = false,
}) {
final GitTagVersion gitTagVersion = GitTagVersion.determine(
globals.processUtils,
globals.platform,
gitRef: frameworkRevision,
workingDirectory: flutterRoot,
fetchTags: fetchTags,
);
final String frameworkVersion = gitTagVersion.frameworkVersionFor(frameworkRevision);
return _FlutterVersionGit._(
clock: clock,
flutterRoot: flutterRoot,
frameworkRevision: frameworkRevision,
frameworkVersion: frameworkVersion,
gitTagVersion: gitTagVersion,
fs: fs,
);
}
/// Ensure the latest git tags are fetched and recalculate [FlutterVersion].
///
/// This is only required when not on beta or stable and we need to calculate
/// the current version relative to upstream tags.
///
/// This is a method and not a factory constructor so that test classes can
/// override it.
FlutterVersion fetchTagsAndGetVersion({
SystemClock clock = const SystemClock(),
}) {
// We don't need to fetch tags on beta and stable to calculate the version,
// we should already exactly be on a tag that was pushed when this release
// was published.
if (channel != 'master' && channel != 'main') {
return this;
}
return FlutterVersion(
clock: clock,
flutterRoot: flutterRoot,
fs: fs,
fetchTags: true,
);
}
final FileSystem fs;
final SystemClock _clock;
String? get repositoryUrl;
GitTagVersion get gitTagVersion;
/// The channel is the upstream branch.
///
/// `master`, `dev`, `beta`, `stable`; or old ones, like `alpha`, `hackathon`, ...
String get channel;
String get frameworkRevision;
String get frameworkRevisionShort => _shortGitRevision(frameworkRevision);
String get frameworkVersion;
String get devToolsVersion;
String get dartSdkVersion;
String get engineRevision;
String get engineRevisionShort => _shortGitRevision(engineRevision);
// This is static as it is called from a constructor.
static File getVersionFile(FileSystem fs, String flutterRoot) {
return fs.file(fs.path.join(flutterRoot, 'bin', 'cache', 'flutter.version.json'));
}
final String flutterRoot;
String? _frameworkAge;
// TODO(fujino): calculate this relative to frameworkCommitDate for
// _FlutterVersionFromFile so we don't need a git call.
String get frameworkAge {
return _frameworkAge ??= _runGit(
FlutterVersion.gitLog(<String>['-n', '1', '--pretty=format:%ar']).join(' '),
globals.processUtils,
flutterRoot,
);
}
void ensureVersionFile();
@override
String toString() {
final String versionText = frameworkVersion == _unknownFrameworkVersion ? '' : ' $frameworkVersion';
final String flutterText = 'Flutter$versionText • channel $channel • ${repositoryUrl ?? 'unknown source'}';
final String frameworkText = 'Framework • revision $frameworkRevisionShort ($frameworkAge) • $frameworkCommitDate';
final String engineText = 'Engine • revision $engineRevisionShort';
final String toolsText = 'Tools • Dart $dartSdkVersion • DevTools $devToolsVersion';
// Flutter 1.10.2-pre.69 • channel master • https://github.com/flutter/flutter.git
// Framework • revision 340c158f32 (85 minutes ago) • 2018-10-26 11:27:22 -0400
// Engine • revision 9c46333e14
// Tools • Dart 2.1.0 (build 2.1.0-dev.8.0 bf26f760b1)
return '$flutterText\n$frameworkText\n$engineText\n$toolsText';
}
Map<String, Object> toJson() => <String, Object>{
'frameworkVersion': frameworkVersion,
'channel': channel,
'repositoryUrl': repositoryUrl ?? 'unknown source',
'frameworkRevision': frameworkRevision,
'frameworkCommitDate': frameworkCommitDate,
'engineRevision': engineRevision,
'dartSdkVersion': dartSdkVersion,
'devToolsVersion': devToolsVersion,
'flutterVersion': frameworkVersion,
};
/// A date String describing the last framework commit.
///
/// If a git command fails, this will return a placeholder date.
String get frameworkCommitDate;
/// Checks if the currently installed version of Flutter is up-to-date, and
/// warns the user if it isn't.
///
/// This function must run while [Cache.lock] is acquired because it reads and
/// writes shared cache files.
Future<void> checkFlutterVersionFreshness() async {
// Don't perform update checks if we're not on an official channel.
if (!kOfficialChannels.contains(channel)) {
return;
}
// Don't perform the update check if the tracking remote is not standard.
if (VersionUpstreamValidator(version: this, platform: globals.platform).run() != null) {
return;
}
DateTime localFrameworkCommitDate;
try {
// Don't perform the update check if fetching the latest local commit failed.
localFrameworkCommitDate = DateTime.parse(_gitCommitDate(workingDirectory: flutterRoot));
} on VersionCheckError {
return;
} on FormatException {
return;
}
final DateTime? latestFlutterCommitDate = await _getLatestAvailableFlutterDate();
return VersionFreshnessValidator(
version: this,
clock: _clock,
localFrameworkCommitDate: localFrameworkCommitDate,
latestFlutterCommitDate: latestFlutterCommitDate,
logger: globals.logger,
cache: globals.cache,
pauseTime: VersionFreshnessValidator.timeToPauseToLetUserReadTheMessage,
).run();
}
/// Gets the release date of the latest available Flutter version.
///
/// This method sends a server request if it's been more than
/// [checkAgeConsideredUpToDate] since the last version check.
///
/// Returns null if the cached version is out-of-date or missing, and we are
/// unable to reach the server to get the latest version.
Future<DateTime?> _getLatestAvailableFlutterDate() async {
globals.cache.checkLockAcquired();
final VersionCheckStamp versionCheckStamp = await VersionCheckStamp.load(globals.cache, globals.logger);
final DateTime now = _clock.now();
if (versionCheckStamp.lastTimeVersionWasChecked != null) {
final Duration timeSinceLastCheck = now.difference(
versionCheckStamp.lastTimeVersionWasChecked!,
);
// Don't ping the server too often. Return cached value if it's fresh.
if (timeSinceLastCheck < VersionFreshnessValidator.checkAgeConsideredUpToDate) {
return versionCheckStamp.lastKnownRemoteVersion;
}
}
// Cache is empty or it's been a while since the last server ping. Ping the server.
try {
final DateTime remoteFrameworkCommitDate = DateTime.parse(
await fetchRemoteFrameworkCommitDate(),
);
await versionCheckStamp.store(
newTimeVersionWasChecked: now,
newKnownRemoteVersion: remoteFrameworkCommitDate,
);
return remoteFrameworkCommitDate;
} on VersionCheckError catch (error) {
// This happens when any of the git commands fails, which can happen when
// there's no Internet connectivity. Remote version check is best effort
// only. We do not prevent the command from running when it fails.
globals.printTrace('Failed to check Flutter version in the remote repository: $error');
// Still update the timestamp to avoid us hitting the server on every single
// command if for some reason we cannot connect (eg. we may be offline).
await versionCheckStamp.store(
newTimeVersionWasChecked: now,
);
return null;
}
}
/// The date of the latest framework commit in the remote repository.
///
/// Throws [VersionCheckError] if a git command fails, for example, when the
/// remote git repository is not reachable due to a network issue.
static Future<String> fetchRemoteFrameworkCommitDate() async {
try {
// Fetch upstream branch's commit and tags
await _run(<String>['git', 'fetch', '--tags']);
return _gitCommitDate(gitRef: kGitTrackingUpstream, workingDirectory: Cache.flutterRoot);
} on VersionCheckError catch (error) {
globals.printError(error.message);
rethrow;
}
}
/// Return a short string for the version (e.g. `master/0.0.59-pre.92`, `scroll_refactor/a76bc8e22b`).
String getVersionString({ bool redactUnknownBranches = false }) {
if (frameworkVersion != _unknownFrameworkVersion) {
return '${getBranchName(redactUnknownBranches: redactUnknownBranches)}/$frameworkVersion';
}
return '${getBranchName(redactUnknownBranches: redactUnknownBranches)}/$frameworkRevisionShort';
}
/// The name of the local branch.
///
/// Use getBranchName() to read this.
String? _branch;
/// Return the branch name.
///
/// If [redactUnknownBranches] is true and the branch is unknown,
/// the branch name will be returned as `'[user-branch]'` ([kUserBranch]).
String getBranchName({ bool redactUnknownBranches = false }) {
_branch ??= () {
final String branch = _runGit('git symbolic-ref --short HEAD', globals.processUtils, flutterRoot);
return branch == 'HEAD' ? '' : branch;
}();
if (redactUnknownBranches || _branch!.isEmpty) {
// Only return the branch names we know about; arbitrary branch names might contain PII.
if (!kOfficialChannels.contains(_branch) && !kObsoleteBranches.containsKey(_branch)) {
return kUserBranch;
}
}
return _branch!;
}
/// Reset the version freshness information by removing the stamp file.
///
/// New version freshness information will be regenerated when
/// [checkFlutterVersionFreshness] is called after this. This is typically
/// used when switching channels so that stale information from another
/// channel doesn't linger.
static Future<void> resetFlutterVersionFreshnessCheck() async {
try {
await globals.cache.getStampFileFor(
VersionCheckStamp.flutterVersionCheckStampFile,
).delete();
} on FileSystemException {
// Ignore, since we don't mind if the file didn't exist in the first place.
}
}
/// log.showSignature=false is a user setting and it will break things,
/// so we want to disable it for every git log call. This is a convenience
/// wrapper that does that.
@visibleForTesting
static List<String> gitLog(List<String> args) {
return <String>['git', '-c', 'log.showSignature=false', 'log'] + args;
}
}
// The date of the given commit hash as [gitRef]. If no hash is specified,
// then it is the HEAD of the current local branch.
//
// If lenient is true, and the git command fails, a placeholder date is
// returned. Otherwise, the VersionCheckError exception is propagated.
String _gitCommitDate({
String gitRef = 'HEAD',
bool lenient = false,
required String? workingDirectory,
}) {
final List<String> args = FlutterVersion.gitLog(<String>[
gitRef,
'-n',
'1',
'--pretty=format:%ad',
'--date=iso',
]);
try {
// Don't plumb 'lenient' through directly so that we can print an error
// if something goes wrong.
return _runSync(
args,
lenient: false,
workingDirectory: workingDirectory,
);
} on VersionCheckError catch (e) {
if (lenient) {
final DateTime dummyDate = DateTime.fromMillisecondsSinceEpoch(0);
globals.printError('Failed to find the latest git commit date: $e\n'
'Returning $dummyDate instead.');
// Return something that DateTime.parse() can parse.
return dummyDate.toString();
} else {
rethrow;
}
}
}
class _FlutterVersionFromFile extends FlutterVersion {
_FlutterVersionFromFile._({
required super.clock,
required this.frameworkVersion,
required this.channel,
required this.repositoryUrl,
required this.frameworkRevision,
required this.frameworkCommitDate,
required this.engineRevision,
required this.dartSdkVersion,
required this.devToolsVersion,
required this.gitTagVersion,
required super.flutterRoot,
required super.fs,
}) : super._();
static _FlutterVersionFromFile? tryParseFromFile(
File jsonFile, {
required String flutterRoot,
SystemClock clock = const SystemClock(),
}) {
try {
final String jsonContents = jsonFile.readAsStringSync();
final Map<String, Object?> manifest = jsonDecode(jsonContents) as Map<String, Object?>;
return _FlutterVersionFromFile._(
clock: clock,
frameworkVersion: manifest['frameworkVersion']! as String,
channel: manifest['channel']! as String,
repositoryUrl: manifest['repositoryUrl']! as String,
frameworkRevision: manifest['frameworkRevision']! as String,
frameworkCommitDate: manifest['frameworkCommitDate']! as String,
engineRevision: manifest['engineRevision']! as String,
dartSdkVersion: manifest['dartSdkVersion']! as String,
devToolsVersion: manifest['devToolsVersion']! as String,
gitTagVersion: GitTagVersion.parse(manifest['flutterVersion']! as String),
flutterRoot: flutterRoot,
fs: jsonFile.fileSystem,
);
// ignore: avoid_catches_without_on_clauses
} catch (err) {
globals.printTrace('Failed to parse ${jsonFile.path} with $err');
try {
jsonFile.deleteSync();
} on FileSystemException {
globals.printTrace('Failed to delete ${jsonFile.path}');
}
// Returning null means fallback to git implementation.
return null;
}
}
@override
final GitTagVersion gitTagVersion;
@override
final String frameworkVersion;
@override
final String channel;
@override
String getBranchName({bool redactUnknownBranches = false}) => channel;
@override
final String repositoryUrl;
@override
final String frameworkRevision;
@override
final String frameworkCommitDate;
@override
final String engineRevision;
@override
final String dartSdkVersion;
@override
final String devToolsVersion;
@override
void ensureVersionFile() {
_ensureLegacyVersionFile(
fs: fs,
flutterRoot: flutterRoot,
frameworkVersion: frameworkVersion,
);
}
}
class _FlutterVersionGit extends FlutterVersion {
_FlutterVersionGit._({
required super.clock,
required super.flutterRoot,
required this.frameworkRevision,
required this.frameworkVersion,
required this.gitTagVersion,
required super.fs,
}) : super._();
@override
final GitTagVersion gitTagVersion;
@override
final String frameworkRevision;
@override
String get frameworkCommitDate => _gitCommitDate(lenient: true, workingDirectory: flutterRoot);
String? _repositoryUrl;
@override
String? get repositoryUrl {
if (_repositoryUrl == null) {
final String gitChannel = _runGit(
'git rev-parse --abbrev-ref --symbolic $kGitTrackingUpstream',
globals.processUtils,
flutterRoot,
);
final int slash = gitChannel.indexOf('/');
if (slash != -1) {
final String remote = gitChannel.substring(0, slash);
_repositoryUrl = _runGit(
'git ls-remote --get-url $remote',
globals.processUtils,
flutterRoot,
);
}
}
return _repositoryUrl;
}
@override
String get devToolsVersion => globals.cache.devToolsVersion;
@override
String get dartSdkVersion => globals.cache.dartSdkVersion;
@override
String get engineRevision => globals.cache.engineRevision;
@override
final String frameworkVersion;
/// The channel is the current branch if we recognize it, or "[user-branch]" (kUserBranch).
/// `master`, `beta`, `stable`; or old ones, like `alpha`, `hackathon`, `dev`, ...
@override
String get channel {
final String channel = getBranchName(redactUnknownBranches: true);
assert(kOfficialChannels.contains(channel) || kObsoleteBranches.containsKey(channel) || channel == kUserBranch, 'Potential PII leak in channel name: "$channel"');
return channel;
}
@override
void ensureVersionFile() {
_ensureLegacyVersionFile(
fs: fs,
flutterRoot: flutterRoot,
frameworkVersion: frameworkVersion,
);
const JsonEncoder encoder = JsonEncoder.withIndent(' ');
final File newVersionFile = FlutterVersion.getVersionFile(fs, flutterRoot);
if (!newVersionFile.existsSync()) {
newVersionFile.writeAsStringSync(encoder.convert(toJson()));
}
}
}
void _ensureLegacyVersionFile({
required FileSystem fs,
required String flutterRoot,
required String frameworkVersion,
}) {
final File legacyVersionFile = fs.file(fs.path.join(flutterRoot, 'version'));
if (!legacyVersionFile.existsSync()) {
legacyVersionFile.writeAsStringSync(frameworkVersion);
}
}
/// Checks if the provided [version] is tracking a standard remote.
///
/// A "standard remote" is one having the same url as(in order of precedence):
/// * The value of `FLUTTER_GIT_URL` environment variable.
/// * The HTTPS or SSH url of the Flutter repository as provided by GitHub.
///
/// To initiate the validation check, call [run].
///
/// This prevents the tool to check for version freshness from the standard
/// remote but fetch updates from the upstream of current branch/channel, both
/// of which can be different.
///
/// This also prevents unnecessary freshness check from a forked repo unless the
/// user explicitly configures the environment to do so.
class VersionUpstreamValidator {
VersionUpstreamValidator({
required this.version,
required this.platform,
});
final Platform platform;
final FlutterVersion version;
/// Performs the validation against the tracking remote of the [version].
///
/// Returns [VersionCheckError] if the tracking remote is not standard.
VersionCheckError? run(){
final String? flutterGit = platform.environment['FLUTTER_GIT_URL'];
final String? repositoryUrl = version.repositoryUrl;
if (repositoryUrl == null) {
return VersionCheckError(
'The tool could not determine the remote upstream which is being '
'tracked by the SDK.'
);
}
// Strip `.git` suffix before comparing the remotes
final List<String> sanitizedStandardRemotes = <String>[
// If `FLUTTER_GIT_URL` is set, use that as standard remote.
if (flutterGit != null) flutterGit
// Else use the predefined standard remotes.
else ..._standardRemotes,
].map((String remote) => stripDotGit(remote)).toList();
final String sanitizedRepositoryUrl = stripDotGit(repositoryUrl);
if (!sanitizedStandardRemotes.contains(sanitizedRepositoryUrl)) {
if (flutterGit != null) {
// If `FLUTTER_GIT_URL` is set, inform to either remove the
// `FLUTTER_GIT_URL` environment variable or set it to the current
// tracking remote.
return VersionCheckError(
'The Flutter SDK is tracking "$repositoryUrl" but "FLUTTER_GIT_URL" '
'is set to "$flutterGit".\n'
'Either remove "FLUTTER_GIT_URL" from the environment or set it to '
'"$repositoryUrl". '
'If this is intentional, it is recommended to use "git" directly to '
'manage the SDK.'
);
}
// If `FLUTTER_GIT_URL` is unset, inform to set the environment variable.
return VersionCheckError(
'The Flutter SDK is tracking a non-standard remote "$repositoryUrl".\n'
'Set the environment variable "FLUTTER_GIT_URL" to '
'"$repositoryUrl". '
'If this is intentional, it is recommended to use "git" directly to '
'manage the SDK.'
);
}
return null;
}
// The predefined list of remotes that are considered to be standard.
static final List<String> _standardRemotes = <String>[
'https://github.com/flutter/flutter.git',
'[email protected]:flutter/flutter.git',
'ssh://[email protected]/flutter/flutter.git',
];
// Strips ".git" suffix from a given string, preferably an url.
// For example, changes 'https://github.com/flutter/flutter.git' to 'https://github.com/flutter/flutter'.
// URLs without ".git" suffix will remain unaffected.
static final RegExp _patternUrlDotGit = RegExp(r'(.*)(\.git)$');
static String stripDotGit(String url) {
return _patternUrlDotGit.firstMatch(url)?.group(1)! ?? url;
}
}
/// Contains data and load/save logic pertaining to Flutter version checks.
@visibleForTesting
class VersionCheckStamp {
const VersionCheckStamp({
this.lastTimeVersionWasChecked,
this.lastKnownRemoteVersion,
this.lastTimeWarningWasPrinted,
});
final DateTime? lastTimeVersionWasChecked;
final DateTime? lastKnownRemoteVersion;
final DateTime? lastTimeWarningWasPrinted;
/// The prefix of the stamp file where we cache Flutter version check data.
@visibleForTesting
static const String flutterVersionCheckStampFile = 'flutter_version_check';
static Future<VersionCheckStamp> load(Cache cache, Logger logger) async {
final String? versionCheckStamp = cache.getStampFor(flutterVersionCheckStampFile);
if (versionCheckStamp != null) {
// Attempt to parse stamp JSON.
try {
final dynamic jsonObject = json.decode(versionCheckStamp);
if (jsonObject is Map<String, dynamic>) {
return fromJson(jsonObject);
} else {
logger.printTrace('Warning: expected version stamp to be a Map but found: $jsonObject');
}
} on Exception catch (error, stackTrace) {
// Do not crash if JSON is malformed.
logger.printTrace('${error.runtimeType}: $error\n$stackTrace');
}
}
// Stamp is missing or is malformed.
return const VersionCheckStamp();
}
static VersionCheckStamp fromJson(Map<String, dynamic> jsonObject) {
DateTime? readDateTime(String property) {
return jsonObject.containsKey(property)
? DateTime.parse(jsonObject[property] as String)
: null;
}
return VersionCheckStamp(
lastTimeVersionWasChecked: readDateTime('lastTimeVersionWasChecked'),
lastKnownRemoteVersion: readDateTime('lastKnownRemoteVersion'),
lastTimeWarningWasPrinted: readDateTime('lastTimeWarningWasPrinted'),
);
}
Future<void> store({
DateTime? newTimeVersionWasChecked,
DateTime? newKnownRemoteVersion,
DateTime? newTimeWarningWasPrinted,
Cache? cache,
}) async {
final Map<String, String> jsonData = toJson();
if (newTimeVersionWasChecked != null) {
jsonData['lastTimeVersionWasChecked'] = '$newTimeVersionWasChecked';
}
if (newKnownRemoteVersion != null) {
jsonData['lastKnownRemoteVersion'] = '$newKnownRemoteVersion';
}
if (newTimeWarningWasPrinted != null) {
jsonData['lastTimeWarningWasPrinted'] = '$newTimeWarningWasPrinted';
}
const JsonEncoder prettyJsonEncoder = JsonEncoder.withIndent(' ');
(cache ?? globals.cache).setStampFor(flutterVersionCheckStampFile, prettyJsonEncoder.convert(jsonData));
}
Map<String, String> toJson({
DateTime? updateTimeVersionWasChecked,
DateTime? updateKnownRemoteVersion,
DateTime? updateTimeWarningWasPrinted,
}) {
updateTimeVersionWasChecked = updateTimeVersionWasChecked ?? lastTimeVersionWasChecked;
updateKnownRemoteVersion = updateKnownRemoteVersion ?? lastKnownRemoteVersion;
updateTimeWarningWasPrinted = updateTimeWarningWasPrinted ?? lastTimeWarningWasPrinted;
final Map<String, String> jsonData = <String, String>{};
if (updateTimeVersionWasChecked != null) {
jsonData['lastTimeVersionWasChecked'] = '$updateTimeVersionWasChecked';
}
if (updateKnownRemoteVersion != null) {
jsonData['lastKnownRemoteVersion'] = '$updateKnownRemoteVersion';
}
if (updateTimeWarningWasPrinted != null) {
jsonData['lastTimeWarningWasPrinted'] = '$updateTimeWarningWasPrinted';
}
return jsonData;
}
}
/// Thrown when we fail to check Flutter version.
///
/// This can happen when we attempt to `git fetch` but there is no network, or
/// when the installation is not git-based (e.g. a user clones the repo but
/// then removes .git).
class VersionCheckError implements Exception {
VersionCheckError(this.message);
final String message;
@override
String toString() => '$VersionCheckError: $message';
}
/// Runs [command] and returns the standard output as a string.
///
/// If [lenient] is true and the command fails, returns an empty string.
/// Otherwise, throws a [ToolExit] exception.
String _runSync(
List<String> command, {
bool lenient = true,
required String? workingDirectory,
}) {
final ProcessResult results = globals.processManager.runSync(
command,
workingDirectory: workingDirectory,
);
if (results.exitCode == 0) {
return (results.stdout as String).trim();
}
if (!lenient) {
throw VersionCheckError(
'Command exited with code ${results.exitCode}: ${command.join(' ')}\n'
'Standard out: ${results.stdout}\n'
'Standard error: ${results.stderr}'
);
}
return '';
}
String _runGit(String command, ProcessUtils processUtils, String? workingDirectory) {
return processUtils.runSync(
command.split(' '),
workingDirectory: workingDirectory,
).stdout.trim();
}
/// Runs [command] in the root of the Flutter installation and returns the
/// standard output as a string.
///
/// If the command fails, throws a [ToolExit] exception.
Future<String> _run(List<String> command) async {
final ProcessResult results = await globals.processManager.run(command, workingDirectory: Cache.flutterRoot);
if (results.exitCode == 0) {
return (results.stdout as String).trim();
}
throw VersionCheckError(
'Command exited with code ${results.exitCode}: ${command.join(' ')}\n'
'Standard error: ${results.stderr}'
);
}
String _shortGitRevision(String? revision) {
if (revision == null) {
return '';
}
return revision.length > 10 ? revision.substring(0, 10) : revision;
}
/// Version of Flutter SDK parsed from Git.
class GitTagVersion {
const GitTagVersion({
this.x,
this.y,
this.z,
this.hotfix,
this.devVersion,
this.devPatch,
this.commits,
this.hash,
this.gitTag,
});
const GitTagVersion.unknown()
: x = null,
y = null,
z = null,
hotfix = null,
commits = 0,
devVersion = null,
devPatch = null,
hash = '',
gitTag = '';
/// The X in vX.Y.Z.
final int? x;
/// The Y in vX.Y.Z.
final int? y;
/// The Z in vX.Y.Z.
final int? z;
/// the F in vX.Y.Z+hotfix.F.
final int? hotfix;
/// Number of commits since the vX.Y.Z tag.
final int? commits;
/// The git hash (or an abbreviation thereof) for this commit.
final String? hash;
/// The N in X.Y.Z-dev.N.M.
final int? devVersion;
/// The M in X.Y.Z-dev.N.M.
final int? devPatch;
/// The git tag that is this version's closest ancestor.
final String? gitTag;
static GitTagVersion determine(
ProcessUtils processUtils,
Platform platform, {
String? workingDirectory,
bool fetchTags = false,
String gitRef = 'HEAD'
}) {
if (fetchTags) {
final String channel = _runGit('git symbolic-ref --short HEAD', processUtils, workingDirectory);
if (!kDevelopmentChannels.contains(channel) && kOfficialChannels.contains(channel)) {
globals.printTrace('Skipping request to fetchTags - on well known channel $channel.');
} else {
final String flutterGit = platform.environment['FLUTTER_GIT_URL'] ?? 'https://github.com/flutter/flutter.git';
_runGit('git fetch $flutterGit --tags -f', processUtils, workingDirectory);
}
}
// find all tags attached to the given [gitRef]
final List<String> tags = _runGit(
'git tag --points-at $gitRef', processUtils, workingDirectory).trim().split('\n');
// Check first for a stable tag
final RegExp stableTagPattern = RegExp(r'^\d+\.\d+\.\d+$');
for (final String tag in tags) {
if (stableTagPattern.hasMatch(tag.trim())) {
return parse(tag);
}
}
// Next check for a dev tag
final RegExp devTagPattern = RegExp(r'^\d+\.\d+\.\d+-\d+\.\d+\.pre$');
for (final String tag in tags) {
if (devTagPattern.hasMatch(tag.trim())) {
return parse(tag);
}
}
// If we're not currently on a tag, use git describe to find the most
// recent tag and number of commits past.
return parse(
_runGit(
'git describe --match *.*.* --long --tags $gitRef',
processUtils,
workingDirectory,
)
);
}
/// Parse a version string.
///
/// The version string can either be an exact release tag (e.g. '1.2.3' for
/// stable or 1.2.3-4.5.pre for a dev) or the output of `git describe` (e.g.
/// for commit abc123 that is 6 commits after tag 1.2.3-4.5.pre, git would
/// return '1.2.3-4.5.pre-6-gabc123').
static GitTagVersion parseVersion(String version) {
final RegExp versionPattern = RegExp(
r'^(\d+)\.(\d+)\.(\d+)(-\d+\.\d+\.pre)?(?:-(\d+)-g([a-f0-9]+))?$');
final Match? match = versionPattern.firstMatch(version.trim());
if (match == null) {
return const GitTagVersion.unknown();
}
final List<String?> matchGroups = match.groups(<int>[1, 2, 3, 4, 5, 6]);
final int? x = matchGroups[0] == null ? null : int.tryParse(matchGroups[0]!);
final int? y = matchGroups[1] == null ? null : int.tryParse(matchGroups[1]!);
final int? z = matchGroups[2] == null ? null : int.tryParse(matchGroups[2]!);
final String? devString = matchGroups[3];
int? devVersion, devPatch;
if (devString != null) {
final Match? devMatch = RegExp(r'^-(\d+)\.(\d+)\.pre$')
.firstMatch(devString);
final List<String?>? devGroups = devMatch?.groups(<int>[1, 2]);
devVersion = devGroups?[0] == null ? null : int.tryParse(devGroups![0]!);
devPatch = devGroups?[1] == null ? null : int.tryParse(devGroups![1]!);
}
// count of commits past last tagged version
final int? commits = matchGroups[4] == null ? 0 : int.tryParse(matchGroups[4]!);
final String hash = matchGroups[5] ?? '';
return GitTagVersion(
x: x,
y: y,
z: z,
devVersion: devVersion,
devPatch: devPatch,
commits: commits,
hash: hash,
gitTag: '$x.$y.$z${devString ?? ''}', // e.g. 1.2.3-4.5.pre
);
}
static GitTagVersion parse(String version) {
GitTagVersion gitTagVersion;
gitTagVersion = parseVersion(version);
if (gitTagVersion != const GitTagVersion.unknown()) {
return gitTagVersion;
}
globals.printTrace('Could not interpret results of "git describe": $version');
return const GitTagVersion.unknown();
}
String frameworkVersionFor(String revision) {
if (x == null || y == null || z == null || (hash != null && !revision.startsWith(hash!))) {
return _unknownFrameworkVersion;
}
if (commits == 0 && gitTag != null) {
return gitTag!;
}
if (hotfix != null) {
// This is an unexpected state where untagged commits exist past a hotfix
return '$x.$y.$z+hotfix.${hotfix! + 1}.pre.$commits';
}
if (devPatch != null && devVersion != null) {
// The next tag that will contain this commit will be the next candidate
// branch, which will increment the devVersion.
return '$x.$y.0-${devVersion! + 1}.0.pre.$commits';
}
return '$x.$y.${z! + 1}-0.0.pre.$commits';
}
}
enum VersionCheckResult {
/// Unable to check whether a new version is available, possibly due to
/// a connectivity issue.
unknown,
/// The current version is up to date.
versionIsCurrent,
/// A newer version is available.
newVersionAvailable,
}
/// Determine whether or not the provided [version] is "fresh" and notify the user if appropriate.
///
/// To initiate the validation check, call [run].
///
/// We do not want to check with the upstream git remote for newer commits on
/// every tool invocation, as this would significantly slow down running tool
/// commands. Thus, the tool writes to the [VersionCheckStamp] every time that
/// it actually has fetched commits from upstream, and this validator only
/// checks again if it has been more than [checkAgeConsideredUpToDate] since the
/// last fetch.
///
/// We do not want to notify users with "reasonably" fresh versions about new
/// releases. The method [versionAgeConsideredUpToDate] defines a different
/// duration of freshness for each channel. If [localFrameworkCommitDate] is
/// newer than this duration, then we do not show the warning.
///
/// We do not want to annoy users who intentionally disregard the warning and
/// choose not to upgrade. Thus, we only show the message if it has been more
/// than [maxTimeSinceLastWarning] since the last time the user saw the warning.
class VersionFreshnessValidator {
VersionFreshnessValidator({
required this.version,
required this.localFrameworkCommitDate,
required this.clock,
required this.cache,
required this.logger,
this.latestFlutterCommitDate,
this.pauseTime = Duration.zero,
});
final FlutterVersion version;
final DateTime localFrameworkCommitDate;
final SystemClock clock;
final Cache cache;
final Logger logger;
final Duration pauseTime;
final DateTime? latestFlutterCommitDate;
late final DateTime now = clock.now();
late final Duration frameworkAge = now.difference(localFrameworkCommitDate);
/// The amount of time we wait before pinging the server to check for the
/// availability of a newer version of Flutter.
@visibleForTesting
static const Duration checkAgeConsideredUpToDate = Duration(days: 3);
/// The amount of time we wait between issuing a warning.
///
/// This is to avoid annoying users who are unable to upgrade right away.
@visibleForTesting
static const Duration maxTimeSinceLastWarning = Duration(days: 1);
/// The amount of time we pause for to let the user read the message about
/// outdated Flutter installation.
///
/// This can be customized in tests to speed them up.
@visibleForTesting
static Duration timeToPauseToLetUserReadTheMessage = const Duration(seconds: 2);
// We show a warning if either we know there is a new remote version, or we
// couldn't tell but the local version is outdated.
@visibleForTesting
bool canShowWarning(VersionCheckResult remoteVersionStatus) {
final bool installationSeemsOutdated = frameworkAge > versionAgeConsideredUpToDate(version.channel);
if (remoteVersionStatus == VersionCheckResult.newVersionAvailable) {
return true;
}
if (!installationSeemsOutdated) {
return false;
}
return remoteVersionStatus == VersionCheckResult.unknown;
}
/// We warn the user if the age of their Flutter installation is greater than
/// this duration. The durations are slightly longer than the expected release
/// cadence for each channel, to give the user a grace period before they get
/// notified.
///
/// For example, for the beta channel, this is set to eight weeks because
/// beta releases happen approximately every month.
@visibleForTesting
static Duration versionAgeConsideredUpToDate(String channel) {
switch (channel) {
case 'stable':
return const Duration(days: 365 ~/ 2); // Six months
case 'beta':
return const Duration(days: 7 * 8); // Eight weeks
default:
return const Duration(days: 7 * 3); // Three weeks
}
}
/// Execute validations and print warning to [logger] if necessary.
Future<void> run() async {
// Get whether there's a newer version on the remote. This only goes
// to the server if we haven't checked recently so won't happen on every
// command.
final VersionCheckResult remoteVersionStatus;
if (latestFlutterCommitDate == null) {
remoteVersionStatus = VersionCheckResult.unknown;
} else {
if (latestFlutterCommitDate!.isAfter(localFrameworkCommitDate)) {
remoteVersionStatus = VersionCheckResult.newVersionAvailable;
} else {
remoteVersionStatus = VersionCheckResult.versionIsCurrent;
}
}
// Do not load the stamp before the above server check as it may modify the stamp file.
final VersionCheckStamp stamp = await VersionCheckStamp.load(cache, logger);
final DateTime lastTimeWarningWasPrinted = stamp.lastTimeWarningWasPrinted ?? clock.ago(maxTimeSinceLastWarning * 2);
final bool beenAWhileSinceWarningWasPrinted = now.difference(lastTimeWarningWasPrinted) > maxTimeSinceLastWarning;
if (!beenAWhileSinceWarningWasPrinted) {
return;
}
final bool canShowWarningResult = canShowWarning(remoteVersionStatus);
if (!canShowWarningResult) {
return;
}
// By this point, we should show the update message
final String updateMessage;
switch (remoteVersionStatus) {
case VersionCheckResult.newVersionAvailable:
updateMessage = _newVersionAvailableMessage;
case VersionCheckResult.versionIsCurrent:
case VersionCheckResult.unknown:
updateMessage = versionOutOfDateMessage(frameworkAge);
}
logger.printBox(updateMessage);
await Future.wait<void>(<Future<void>>[
stamp.store(
newTimeWarningWasPrinted: now,
cache: cache,
),
Future<void>.delayed(pauseTime),
]);
}
}
@visibleForTesting
String versionOutOfDateMessage(Duration frameworkAge) {
return '''
WARNING: your installation of Flutter is ${frameworkAge.inDays} days old.
To update to the latest version, run "flutter upgrade".''';
}
const String _newVersionAvailableMessage = '''
A new version of Flutter is available!
To update to the latest version, run "flutter upgrade".''';
| flutter/packages/flutter_tools/lib/src/version.dart/0 | {
"file_path": "flutter/packages/flutter_tools/lib/src/version.dart",
"repo_id": "flutter",
"token_count": 14005
} | 758 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import '../base/platform.dart';
import '../doctor_validator.dart';
import 'chrome.dart';
/// A validator for Chromium-based browsers.
abstract class ChromiumValidator extends DoctorValidator {
const ChromiumValidator(super.title);
Platform get _platform;
ChromiumLauncher get _chromiumLauncher;
String get _name;
@override
Future<ValidationResult> validate() async {
final bool canRunChromium = _chromiumLauncher.canFindExecutable();
final String chromiumSearchLocation = _chromiumLauncher.findExecutable();
final List<ValidationMessage> messages = <ValidationMessage>[
if (_platform.environment.containsKey(kChromeEnvironment))
if (!canRunChromium)
ValidationMessage.hint('$chromiumSearchLocation is not executable.')
else
ValidationMessage('$kChromeEnvironment = $chromiumSearchLocation')
else
if (!canRunChromium)
ValidationMessage.hint('Cannot find $_name. Try setting '
'$kChromeEnvironment to a $_name executable.')
else
ValidationMessage('$_name at $chromiumSearchLocation'),
];
if (!canRunChromium) {
return ValidationResult(
ValidationType.missing,
messages,
statusInfo: 'Cannot find $_name executable at $chromiumSearchLocation',
);
}
return ValidationResult(
ValidationType.success,
messages,
);
}
}
/// A validator that checks whether Chrome is installed and can run.
class ChromeValidator extends ChromiumValidator {
const ChromeValidator({
required Platform platform,
required ChromiumLauncher chromiumLauncher,
}) : _platform = platform,
_chromiumLauncher = chromiumLauncher,
super('Chrome - develop for the web');
@override
final Platform _platform;
@override
final ChromiumLauncher _chromiumLauncher;
@override
String get _name => 'Chrome';
}
/// A validator that checks whether Edge is installed and can run.
class EdgeValidator extends ChromiumValidator {
const EdgeValidator({
required Platform platform,
required ChromiumLauncher chromiumLauncher,
}) : _platform = platform,
_chromiumLauncher = chromiumLauncher,
super('Edge - develop for the web');
@override
final Platform _platform;
@override
final ChromiumLauncher _chromiumLauncher;
@override
String get _name => 'Edge';
}
| flutter/packages/flutter_tools/lib/src/web/web_validator.dart/0 | {
"file_path": "flutter/packages/flutter_tools/lib/src/web/web_validator.dart",
"repo_id": "flutter",
"token_count": 846
} | 759 |
package {{androidIdentifier}};
import io.flutter.embedding.android.FlutterActivity;
public class MainActivity extends FlutterActivity {
}
| flutter/packages/flutter_tools/templates/app_shared/android-java.tmpl/app/src/main/java/androidIdentifier/MainActivity.java.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/app_shared/android-java.tmpl/app/src/main/java/androidIdentifier/MainActivity.java.tmpl",
"repo_id": "flutter",
"token_count": 38
} | 760 |
#import "GeneratedPluginRegistrant.h"
| flutter/packages/flutter_tools/templates/app_shared/ios-swift.tmpl/Runner/Runner-Bridging-Header.h/0 | {
"file_path": "flutter/packages/flutter_tools/templates/app_shared/ios-swift.tmpl/Runner/Runner-Bridging-Header.h",
"repo_id": "flutter",
"token_count": 13
} | 761 |
# Templates for Flutter Module
## common
Written to root of Flutter application.
Adds Dart project files including `pubspec.yaml`.
## android
#### library
Written to the `.android/` hidden folder.
Contents wraps Flutter/Dart code as a Gradle project that defines an
Android library.
Executing `./gradlew flutter:assembleDebug` in that folder produces
a `.aar` archive.
Android host apps can set up a dependency to this project to consume
Flutter views.
#### gradle
Written to `.android/` or `android/`.
Mixin for adding Gradle boilerplate to Android projects.
#### host_app_common
Written to either `.android/` or `android/`.
Contents define a single-Activity, single-View Android host app
with a dependency on the `.android/Flutter` library.
Executing `./gradlew app:assembleDebug` in the target folder produces
an `.apk` archive.
Used with either `android_host_ephemeral` or `android_host_editable`.
#### host_app_ephemeral
Written to `.android/` on top of `android_host_common`.
Combined contents define an *ephemeral* (hidden, auto-generated,
under Flutter tooling control) Android host app with a dependency on the
`.android/Flutter` library.
#### host_app_editable
Written to `android/` on top of `android_host_common`.
Combined contents define an *editable* (visible, one-time generated,
under app author control) Android host app with a dependency on the
`.android/Flutter` library.
## ios
#### library
Written to the `.ios/Flutter` hidden folder.
Contents wraps Flutter/Dart code for consumption by an Xcode project.
iOS host apps can set up a dependency to this contents to consume
Flutter views.
#### host_app_ephemeral
Written to `.ios/` outside the `Flutter/` sub-folder.
Combined contents define an *ephemeral* (hidden, auto-generated,
under Flutter tooling control) iOS host app with a dependency on the
`.ios/Flutter` folder contents.
The host app does not make use of CocoaPods, and is therefore
suitable only when the Flutter part declares no plugin dependencies.
#### host_app_ephemeral_cocoapods
Written to `.ios/` on top of `host_app_ephemeral`.
Adds CocoaPods support.
Combined contents define an ephemeral host app suitable for when the
Flutter part declares plugin dependencies.
| flutter/packages/flutter_tools/templates/module/README.md/0 | {
"file_path": "flutter/packages/flutter_tools/templates/module/README.md",
"repo_id": "flutter",
"token_count": 646
} | 762 |
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":flutter" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/../../.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":flutter" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes" />
<output-test url="file://$MODULE_DIR$/build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Android API 28 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module> | flutter/packages/flutter_tools/templates/module/android/library_new_embedding/Flutter.tmpl/flutter.iml.copy.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/module/android/library_new_embedding/Flutter.tmpl/flutter.iml.copy.tmpl",
"repo_id": "flutter",
"token_count": 523
} | 763 |
#include "Flutter.xcconfig"
| flutter/packages/flutter_tools/templates/module/ios/host_app_ephemeral/Config.tmpl/Debug.xcconfig/0 | {
"file_path": "flutter/packages/flutter_tools/templates/module/ios/host_app_ephemeral/Config.tmpl/Debug.xcconfig",
"repo_id": "flutter",
"token_count": 12
} | 764 |
import 'package:native_toolchain_c/native_toolchain_c.dart';
import 'package:logging/logging.dart';
import 'package:native_assets_cli/native_assets_cli.dart';
const packageName = '{{projectName}}';
void main(List<String> args) async {
final buildConfig = await BuildConfig.fromArgs(args);
final buildOutput = BuildOutput();
final cbuilder = CBuilder.library(
name: packageName,
assetId:
'package:$packageName/${packageName}_bindings_generated.dart',
sources: [
'src/$packageName.c',
],
);
await cbuilder.run(
buildConfig: buildConfig,
buildOutput: buildOutput,
logger: Logger('')..onRecord.listen((record) => print(record.message)),
);
await buildOutput.writeToFile(outDir: buildConfig.outDir);
}
| flutter/packages/flutter_tools/templates/package_ffi/build.dart.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/package_ffi/build.dart.tmpl",
"repo_id": "flutter",
"token_count": 269
} | 765 |
package {{androidIdentifier}}
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import kotlin.test.Test
import org.mockito.Mockito
/*
* This demonstrates a simple unit test of the Kotlin portion of this plugin's implementation.
*
* Once you have built the plugin's example app, you can run these tests from the command
* line by running `./gradlew testDebugUnitTest` in the `example/android/` directory, or
* you can run them directly from IDEs that support JUnit such as Android Studio.
*/
internal class {{pluginClass}}Test {
@Test
fun onMethodCall_getPlatformVersion_returnsExpectedValue() {
val plugin = {{pluginClass}}()
val call = MethodCall("getPlatformVersion", null)
val mockResult: MethodChannel.Result = Mockito.mock(MethodChannel.Result::class.java)
plugin.onMethodCall(call, mockResult)
Mockito.verify(mockResult).success("Android " + android.os.Build.VERSION.RELEASE)
}
}
| flutter/packages/flutter_tools/templates/plugin/android-kotlin.tmpl/src/test/kotlin/androidIdentifier/pluginClassTest.kt.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/plugin/android-kotlin.tmpl/src/test/kotlin/androidIdentifier/pluginClassTest.kt.tmpl",
"repo_id": "flutter",
"token_count": 283
} | 766 |
#ifndef FLUTTER_PLUGIN_{{pluginClassCapitalSnakeCase}}_H_
#define FLUTTER_PLUGIN_{{pluginClassCapitalSnakeCase}}_H_
#include <flutter_linux/flutter_linux.h>
G_BEGIN_DECLS
#ifdef FLUTTER_PLUGIN_IMPL
#define FLUTTER_PLUGIN_EXPORT __attribute__((visibility("default")))
#else
#define FLUTTER_PLUGIN_EXPORT
#endif
typedef struct _{{pluginClass}} {{pluginClass}};
typedef struct {
GObjectClass parent_class;
} {{pluginClass}}Class;
FLUTTER_PLUGIN_EXPORT GType {{pluginClassSnakeCase}}_get_type();
FLUTTER_PLUGIN_EXPORT void {{pluginClassSnakeCase}}_register_with_registrar(
FlPluginRegistrar* registrar);
G_END_DECLS
#endif // FLUTTER_PLUGIN_{{pluginClassCapitalSnakeCase}}_H_
| flutter/packages/flutter_tools/templates/plugin/linux.tmpl/include/projectName.tmpl/pluginClassSnakeCase.h.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/plugin/linux.tmpl/include/projectName.tmpl/pluginClassSnakeCase.h.tmpl",
"repo_id": "flutter",
"token_count": 264
} | 767 |
# Run with `dart run ffigen --config ffigen.yaml`.
name: {{pluginDartClass}}Bindings
description: |
Bindings for `src/{{projectName}}.h`.
Regenerate bindings with `dart run ffigen --config ffigen.yaml`.
output: 'lib/{{projectName}}_bindings_generated.dart'
headers:
entry-points:
- 'src/{{projectName}}.h'
include-directives:
- 'src/{{projectName}}.h'
preamble: |
// ignore_for_file: always_specify_types
// ignore_for_file: camel_case_types
// ignore_for_file: non_constant_identifier_names
comments:
style: any
length: full
| flutter/packages/flutter_tools/templates/plugin_ffi/ffigen.yaml.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/plugin_ffi/ffigen.yaml.tmpl",
"repo_id": "flutter",
"token_count": 203
} | 768 |
import 'package:flutter/material.dart';
/// Displays detailed information about a SampleItem.
class SampleItemDetailsView extends StatelessWidget {
const SampleItemDetailsView({super.key});
static const routeName = '/sample_item';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Item Details'),
),
body: const Center(
child: Text('More Information Here'),
),
);
}
}
| flutter/packages/flutter_tools/templates/skeleton/lib/src/sample_feature/sample_item_details_view.dart.tmpl/0 | {
"file_path": "flutter/packages/flutter_tools/templates/skeleton/lib/src/sample_feature/sample_item_details_view.dart.tmpl",
"repo_id": "flutter",
"token_count": 164
} | 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:typed_data';
import 'package:args/command_runner.dart';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/process.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/build.dart';
import 'package:flutter_tools/src/commands/build_ios.dart';
import 'package:flutter_tools/src/ios/plist_parser.dart';
import 'package:flutter_tools/src/ios/xcodeproj.dart';
import 'package:flutter_tools/src/reporting/reporting.dart';
import 'package:test/fake.dart';
import 'package:unified_analytics/unified_analytics.dart';
import '../../general.shard/ios/xcresult_test_data.dart';
import '../../src/common.dart';
import '../../src/context.dart';
import '../../src/fake_process_manager.dart';
import '../../src/fakes.dart';
import '../../src/test_build_system.dart';
import '../../src/test_flutter_command_runner.dart';
class FakeXcodeProjectInterpreterWithBuildSettings extends FakeXcodeProjectInterpreter {
FakeXcodeProjectInterpreterWithBuildSettings({ this.overrides = const <String, String>{} });
final Map<String, String> overrides;
@override
Future<Map<String, String>> getBuildSettings(
String projectPath, {
XcodeProjectBuildContext? buildContext,
Duration timeout = const Duration(minutes: 1),
}) async {
return <String, String>{
...overrides,
'PRODUCT_BUNDLE_IDENTIFIER': 'io.flutter.someProject',
'DEVELOPMENT_TEAM': 'abc',
};
}
}
final Platform macosPlatform = FakePlatform(
operatingSystem: 'macos',
environment: <String, String>{
'FLUTTER_ROOT': '/',
'HOME': '/',
}
);
final Platform notMacosPlatform = FakePlatform(
environment: <String, String>{
'FLUTTER_ROOT': '/',
}
);
class FakePlistUtils extends Fake implements PlistParser {
final Map<String, Map<String, Object>> fileContents = <String, Map<String, Object>>{};
@override
T? getValueFromFile<T>(String plistFilePath, String key) {
final Map<String, Object>? plistFile = fileContents[plistFilePath];
return plistFile == null ? null : plistFile[key] as T?;
}
}
void main() {
late FileSystem fileSystem;
late TestUsage usage;
late FakeProcessManager fakeProcessManager;
late ProcessUtils processUtils;
late FakePlistUtils plistUtils;
late BufferLogger logger;
late Artifacts artifacts;
late FakeAnalytics fakeAnalytics;
setUpAll(() {
Cache.disableLocking();
});
setUp(() {
fileSystem = MemoryFileSystem.test();
artifacts = Artifacts.test(fileSystem: fileSystem);
usage = TestUsage();
fakeProcessManager = FakeProcessManager.empty();
logger = BufferLogger.test();
processUtils = ProcessUtils(
logger: logger,
processManager: fakeProcessManager,
);
plistUtils = FakePlistUtils();
fakeAnalytics = getInitializedFakeAnalyticsInstance(
fs: fileSystem,
fakeFlutterVersion: FakeFlutterVersion(),
);
});
// Sets up the minimal mock project files necessary to look like a Flutter project.
void createCoreMockProjectFiles() {
fileSystem.file('pubspec.yaml').createSync();
fileSystem.file('.packages').createSync();
fileSystem.file(fileSystem.path.join('lib', 'main.dart')).createSync(recursive: true);
}
// Sets up the minimal mock project files necessary for iOS builds to succeed.
void createMinimalMockProjectFiles() {
fileSystem.directory(fileSystem.path.join('ios', 'Runner.xcodeproj')).createSync(recursive: true);
fileSystem.directory(fileSystem.path.join('ios', 'Runner.xcworkspace')).createSync(recursive: true);
fileSystem.file(fileSystem.path.join('ios', 'Runner.xcodeproj', 'project.pbxproj')).createSync();
final String packageConfigPath = '${Cache.flutterRoot!}/packages/flutter_tools/.dart_tool/package_config.json';
fileSystem.file(packageConfigPath)
..createSync(recursive: true)
..writeAsStringSync('''
{
"configVersion": 2,
"packages": [
{
"name": "flutter_template_images",
"rootUri": "/flutter_template_images",
"packageUri": "lib/",
"languageVersion": "2.12"
}
]
}
''');
createCoreMockProjectFiles();
}
const FakeCommand xattrCommand = FakeCommand(command: <String>[
'xattr', '-r', '-d', 'com.apple.FinderInfo', '/',
]);
FakeCommand setUpXCResultCommand({String stdout = '', void Function(List<String> command)? onRun}) {
return FakeCommand(
command: const <String>[
'xcrun',
'xcresulttool',
'get',
'--path',
_xcBundleFilePath,
'--format',
'json',
],
stdout: stdout,
onRun: onRun,
);
}
// Creates a FakeCommand for the xcodebuild call to build the app
// in the given configuration.
FakeCommand setUpFakeXcodeBuildHandler({
bool verbose = false,
int exitCode = 0,
void Function(List<String> args)? onRun,
}) {
return FakeCommand(
command: <String>[
'xcrun',
'xcodebuild',
'-configuration', 'Release',
if (verbose)
'VERBOSE_SCRIPT_LOGGING=YES'
else
'-quiet',
'-workspace', 'Runner.xcworkspace',
'-scheme', 'Runner',
'-sdk', 'iphoneos',
'-destination',
'generic/platform=iOS',
'-resultBundlePath', '/.tmp_rand0/flutter_ios_build_temp_dirrand0/temporary_xcresult_bundle',
'-resultBundleVersion', '3',
'FLUTTER_SUPPRESS_ANALYTICS=true',
'COMPILER_INDEX_STORE_ENABLE=NO',
'-archivePath', '/build/ios/archive/Runner',
'archive',
],
stdout: 'STDOUT STUFF',
exitCode: exitCode,
onRun: onRun,
);
}
FakeCommand exportArchiveCommand({
String exportOptionsPlist = '/ExportOptions.plist',
File? cachePlist,
bool deleteExportOptionsPlist = false,
}) {
return FakeCommand(
command: <String>[
'xcrun',
'xcodebuild',
'-exportArchive',
'-allowProvisioningDeviceRegistration',
'-allowProvisioningUpdates',
'-archivePath',
'/build/ios/archive/Runner.xcarchive',
'-exportPath',
'/build/ios/ipa',
'-exportOptionsPlist',
exportOptionsPlist,
],
onRun: (_) {
// exportOptionsPlist will be cleaned up within the command.
// Save it somewhere else so test expectations can be run on it.
if (cachePlist != null) {
cachePlist.writeAsStringSync(fileSystem.file(_exportOptionsPlist).readAsStringSync());
}
if (deleteExportOptionsPlist) {
fileSystem.file(_exportOptionsPlist).deleteSync();
}
}
);
}
testUsingContext('ipa build fails when there is no ios project', () async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
createCoreMockProjectFiles();
expect(createTestCommandRunner(command).run(
const <String>['build', 'ipa', '--no-pub']
), throwsToolExit(message: 'Application not configured for iOS'));
}, overrides: <Type, Generator>{
Platform: () => macosPlatform,
FileSystem: () => fileSystem,
ProcessManager: () => fakeProcessManager,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('ipa build fails in debug with code analysis', () async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
createCoreMockProjectFiles();
expect(createTestCommandRunner(command).run(
const <String>['build', 'ipa', '--no-pub', '--debug', '--analyze-size']
), throwsToolExit(message: '--analyze-size" can only be used on release builds'));
}, overrides: <Type, Generator>{
Platform: () => macosPlatform,
FileSystem: () => fileSystem,
ProcessManager: () => fakeProcessManager,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('ipa build fails on non-macOS platform', () async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
fileSystem.file('pubspec.yaml').createSync();
fileSystem.file('.packages').createSync();
fileSystem.file(fileSystem.path.join('lib', 'main.dart'))
.createSync(recursive: true);
final bool supported = BuildIOSArchiveCommand(logger: BufferLogger.test(), verboseHelp: false).supported;
expect(createTestCommandRunner(command).run(
const <String>['build', 'ipa', '--no-pub']
), supported ? throwsToolExit() : throwsA(isA<UsageException>()));
}, overrides: <Type, Generator>{
Platform: () => notMacosPlatform,
Logger: () => logger,
FileSystem: () => fileSystem,
ProcessManager: () => fakeProcessManager,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('ipa build fails when export plist does not exist',
() async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
await expectToolExitLater(
createTestCommandRunner(command).run(<String>[
'build',
'ipa',
'--export-options-plist',
'bogus.plist',
'--no-pub',
]),
contains('property list does not exist'),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () =>
FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('ipa build fails when export plist is not a file', () async {
final Directory bogus = fileSystem.directory('bogus')..createSync();
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
await expectToolExitLater(
createTestCommandRunner(command).run(<String>[
'build',
'ipa',
'--export-options-plist',
bogus.path,
'--no-pub',
]),
contains('is not a file.'),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('ipa build fails when --export-options-plist and --export-method are used together', () async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
await expectToolExitLater(
createTestCommandRunner(command).run(<String>[
'build',
'ipa',
'--export-options-plist',
'ExportOptions.plist',
'--export-method',
'app-store',
'--no-pub',
]),
contains('"--export-options-plist" is not compatible with "--export-method"'),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('ipa build reports method from --export-method when used', () async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
await createTestCommandRunner(command).run(
const <String>['build', 'ipa','--export-method', 'ad-hoc', '--no-pub']
);
expect(logger.statusText, contains('build/ios/archive/Runner.xcarchive'));
expect(logger.statusText, contains('Building ad-hoc IPA'));
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('ipa build reports method from --export-options-plist when used', () async {
final File exportOptions = fileSystem.file('/ExportOptions.plist')
..createSync();
createMinimalMockProjectFiles();
plistUtils.fileContents[exportOptions.path] = <String,String>{
'CFBundleIdentifier': 'io.flutter.someProject',
'method': 'enterprise'
};
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(),
exportArchiveCommand(exportOptionsPlist: exportOptions.path),
]);
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
<String>['build', 'ipa', '--export-options-plist', exportOptions.path, '--no-pub']
);
expect(logger.statusText, contains('build/ios/archive/Runner.xcarchive'));
expect(logger.statusText, contains('Building enterprise IPA'));
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
PlistParser: () => plistUtils,
});
testUsingContext('ipa build reports when IPA fails', () async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(),
const FakeCommand(
command: <String>[
'xcrun',
'xcodebuild',
'-exportArchive',
'-allowProvisioningDeviceRegistration',
'-allowProvisioningUpdates',
'-archivePath',
'/build/ios/archive/Runner.xcarchive',
'-exportPath',
'/build/ios/ipa',
'-exportOptionsPlist',
_exportOptionsPlist,
],
exitCode: 1,
stderr: 'error: exportArchive: "Runner.app" requires a provisioning profile.',
),
]);
createMinimalMockProjectFiles();
await createTestCommandRunner(command).run(
const <String>['build', 'ipa', '--no-pub']
);
expect(logger.statusText, contains('build/ios/archive/Runner.xcarchive'));
expect(logger.statusText, contains('Building App Store IPA'));
expect(logger.errorText, contains('Encountered error while creating the IPA:'));
expect(logger.errorText, contains('error: exportArchive: "Runner.app" requires a provisioning profile.'));
expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('ipa build ignores deletion failure if generatedExportPlist does not exist', () async {
final File cachedExportOptionsPlist = fileSystem.file('/CachedExportOptions.plist');
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(),
exportArchiveCommand(
exportOptionsPlist: _exportOptionsPlist,
cachePlist: cachedExportOptionsPlist,
deleteExportOptionsPlist: true,
),
]);
createMinimalMockProjectFiles();
await createTestCommandRunner(command).run(
const <String>['build', 'ipa', '--no-pub']
);
expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('ipa build invokes xcodebuild and archives for app store', () async {
final File cachedExportOptionsPlist = fileSystem.file('/CachedExportOptions.plist');
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist, cachePlist: cachedExportOptionsPlist),
]);
createMinimalMockProjectFiles();
await createTestCommandRunner(command).run(
const <String>['build', 'ipa', '--no-pub']
);
const String expectedIpaPlistContents = '''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>app-store</string>
<key>uploadBitcode</key>
<false/>
</dict>
</plist>
''';
final String actualIpaPlistContents = fileSystem.file(cachedExportOptionsPlist).readAsStringSync();
expect(actualIpaPlistContents, expectedIpaPlistContents);
expect(logger.statusText, contains('build/ios/archive/Runner.xcarchive'));
expect(logger.statusText, contains('Building App Store IPA'));
expect(logger.statusText, contains('Built IPA to /build/ios/ipa'));
expect(logger.statusText, contains('To upload to the App Store'));
expect(logger.statusText, contains('Apple Transporter macOS app'));
expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('ipa build invokes xcodebuild and archives for ad-hoc distribution', () async {
final File cachedExportOptionsPlist = fileSystem.file('/CachedExportOptions.plist');
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist, cachePlist: cachedExportOptionsPlist),
]);
createMinimalMockProjectFiles();
await createTestCommandRunner(command).run(
const <String>['build', 'ipa', '--no-pub', '--export-method', 'ad-hoc']
);
const String expectedIpaPlistContents = '''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>ad-hoc</string>
<key>uploadBitcode</key>
<false/>
</dict>
</plist>
''';
final String actualIpaPlistContents = fileSystem.file(cachedExportOptionsPlist).readAsStringSync();
expect(actualIpaPlistContents, expectedIpaPlistContents);
expect(logger.statusText, contains('build/ios/archive/Runner.xcarchive'));
expect(logger.statusText, contains('Building ad-hoc IPA'));
expect(logger.statusText, contains('Built IPA to /build/ios/ipa'));
// Don'ltruct how to upload to the App Store.
expect(logger.statusText, isNot(contains('To upload')));
expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('ipa build invokes xcodebuild and archives for enterprise distribution', () async {
final File cachedExportOptionsPlist = fileSystem.file('/CachedExportOptions.plist');
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist, cachePlist: cachedExportOptionsPlist),
]);
createMinimalMockProjectFiles();
await createTestCommandRunner(command).run(
const <String>['build', 'ipa', '--no-pub', '--export-method', 'enterprise']
);
const String expectedIpaPlistContents = '''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>enterprise</string>
<key>uploadBitcode</key>
<false/>
</dict>
</plist>
''';
final String actualIpaPlistContents = fileSystem.file(cachedExportOptionsPlist).readAsStringSync();
expect(actualIpaPlistContents, expectedIpaPlistContents);
expect(logger.statusText, contains('build/ios/archive/Runner.xcarchive'));
expect(logger.statusText, contains('Building enterprise IPA'));
expect(logger.statusText, contains('Built IPA to /build/ios/ipa'));
// Don'ltruct how to upload to the App Store.
expect(logger.statusText, isNot(contains('To upload')));
expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('ipa build invokes xcode build with verbosity', () async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(verbose: true),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
await createTestCommandRunner(command).run(
const <String>['build', 'ipa', '--no-pub', '-v']
);
expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('ipa build invokes xcode build without disablePortPublication', () async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
await createTestCommandRunner(command).run(
const <String>['build', 'ipa', '--no-pub', '--ci']
);
expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('ipa build --no-codesign skips codesigning and IPA creation', () async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
const FakeCommand(
command: <String>[
'xcrun',
'xcodebuild',
'-configuration', 'Release',
'-quiet',
'-workspace', 'Runner.xcworkspace',
'-scheme', 'Runner',
'-sdk', 'iphoneos',
'-destination',
'generic/platform=iOS',
'CODE_SIGNING_ALLOWED=NO',
'CODE_SIGNING_REQUIRED=NO',
'CODE_SIGNING_IDENTITY=""',
'-resultBundlePath',
'/.tmp_rand0/flutter_ios_build_temp_dirrand0/temporary_xcresult_bundle',
'-resultBundleVersion', '3',
'FLUTTER_SUPPRESS_ANALYTICS=true',
'COMPILER_INDEX_STORE_ENABLE=NO',
'-archivePath',
'/build/ios/archive/Runner',
'archive',
],
),
]);
createMinimalMockProjectFiles();
await createTestCommandRunner(command).run(
const <String>['build', 'ipa', '--no-pub', '--no-codesign']
);
expect(fakeProcessManager, hasNoRemainingExpectations);
expect(logger.statusText, contains('Codesigning disabled with --no-codesign, skipping IPA'));
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('code size analysis fails when app not found', () async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
fakeProcessManager.addCommand(setUpFakeXcodeBuildHandler());
await expectToolExitLater(
createTestCommandRunner(command).run(
const <String>['build', 'ipa', '--no-pub', '--analyze-size']
),
contains('Could not find app to analyze code size'),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('Performs code size analysis and sends analytics', () async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
fileSystem.file('build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Frameworks/App.framework/App')
..createSync(recursive: true)
..writeAsBytesSync(List<int>.generate(10000, (int index) => 0));
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(onRun: (_) {
fileSystem.file('build/flutter_size_01/snapshot.arm64.json')
..createSync(recursive: true)
..writeAsStringSync('''
[
{
"l": "dart:_internal",
"c": "SubListIterable",
"n": "[Optimized] skip",
"s": 2400
}
]''');
fileSystem.file('build/flutter_size_01/trace.arm64.json')
..createSync(recursive: true)
..writeAsStringSync('{}');
}),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
await createTestCommandRunner(command).run(
const <String>['build', 'ipa', '--no-pub', '--analyze-size']
);
expect(logger.statusText, contains('A summary of your iOS bundle analysis can be found at'));
expect(logger.statusText, contains('dart devtools --appSizeBase='));
expect(usage.events, contains(
const TestUsageEvent('code-size-analysis', 'ios'),
));
expect(fakeProcessManager, hasNoRemainingExpectations);
expect(fakeAnalytics.sentEvents, contains(
Event.codeSizeAnalysis(platform: 'ios')
));
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
FileSystemUtils: () => FileSystemUtils(fileSystem: fileSystem, platform: macosPlatform),
Usage: () => usage,
Analytics: () => fakeAnalytics,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('ipa build invokes xcode build export archive when passed plist', () async {
final String outputPath =
fileSystem.path.absolute(fileSystem.path.join('build', 'ios', 'ipa'));
final File exportOptions = fileSystem.file('ExportOptions.plist')
..createSync();
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(),
exportArchiveCommand(),
]);
createMinimalMockProjectFiles();
await createTestCommandRunner(command).run(
<String>[
'build',
'ipa',
'--no-pub',
'--export-options-plist',
exportOptions.path,
],
);
expect(logger.statusText, contains('Built IPA to $outputPath.'));
expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('Trace error if xcresult is empty.', () async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: (_) {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
}),
setUpXCResultCommand(),
]);
createMinimalMockProjectFiles();
await expectLater(
createTestCommandRunner(command).run(const <String>['build', 'ipa', '--no-pub']),
throwsToolExit(),
);
expect(logger.traceText, contains('xcresult parser: Unrecognized top level json format.'));
expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('Display xcresult issues on console if parsed.', () async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: (_) {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
}),
setUpXCResultCommand(stdout: kSampleResultJsonWithIssues),
]);
createMinimalMockProjectFiles();
await expectLater(
createTestCommandRunner(command).run(const <String>['build', 'ipa', '--no-pub']),
throwsToolExit(),
);
expect(logger.errorText, contains("Use of undeclared identifier 'asdas'"));
expect(logger.errorText, contains('/Users/m/Projects/test_create/ios/Runner/AppDelegate.m:7:56'));
expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('Do not display xcresult issues that needs to be discarded.', () async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: (_) {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
}),
setUpXCResultCommand(stdout: kSampleResultJsonWithIssuesToBeDiscarded),
]);
createMinimalMockProjectFiles();
await expectLater(
createTestCommandRunner(command).run(const <String>['build', 'ipa', '--no-pub']),
throwsToolExit(),
);
expect(logger.errorText, contains("Use of undeclared identifier 'asdas'"));
expect(logger.errorText, contains('/Users/m/Projects/test_create/ios/Runner/AppDelegate.m:7:56'));
expect(logger.errorText, isNot(contains('Command PhaseScriptExecution failed with a nonzero exit code')));
expect(logger.warningText, isNot(contains('but the range of supported deployment target versions')));
expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('Trace if xcresult bundle does not exist.', () async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(exitCode: 1),
]);
createMinimalMockProjectFiles();
await expectLater(
createTestCommandRunner(command).run(const <String>['build', 'ipa', '--no-pub']),
throwsToolExit(),
);
expect(logger.traceText, contains('The xcresult bundle are not generated. Displaying xcresult is disabled.'));
expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('Extra error message for provision profile issue in xcresulb bundle.', () async {
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: (_) {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
}),
setUpXCResultCommand(stdout: kSampleResultJsonWithProvisionIssue),
]);
createMinimalMockProjectFiles();
await expectLater(
createTestCommandRunner(command).run(const <String>['build', 'ipa', '--no-pub']),
throwsToolExit(),
);
expect(logger.errorText, contains('Some Provisioning profile issue.'));
expect(logger.errorText, contains('It appears that there was a problem signing your application prior to installation on the device.'));
expect(logger.errorText, contains('Verify that the Bundle Identifier in your project is your signing id in Xcode'));
expect(logger.errorText, contains('open ios/Runner.xcworkspace'));
expect(logger.errorText, contains("Also try selecting 'Product > Build' to fix the problem."));
expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext(
'Validate basic Xcode settings with missing settings', () async {
const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist';
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(onRun: (_) {
fileSystem.file(plistPath).createSync(recursive: true);
}),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
plistUtils.fileContents[plistPath] = <String,String>{
'CFBundleIdentifier': 'io.flutter.someProject',
};
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
<String>['build', 'ipa', '--no-pub']);
expect(
logger.statusText,
contains(
'[!] App Settings Validation\n'
' ! Version Number: Missing\n'
' ! Build Number: Missing\n'
' ! Display Name: Missing\n'
' ! Deployment Target: Missing\n'
' • Bundle Identifier: io.flutter.someProject\n'
' ! You must set up the missing app settings.\n'
));
expect(
logger.statusText,
contains('To update the settings, please refer to https://docs.flutter.dev/deployment/ios')
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
PlistParser: () => plistUtils,
});
testUsingContext(
'Validate basic Xcode settings with full settings', () async {
const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist';
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(onRun: (_) {
fileSystem.file(plistPath).createSync(recursive: true);
}),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
plistUtils.fileContents[plistPath] = <String,String>{
'CFBundleIdentifier': 'io.flutter.someProject',
'CFBundleDisplayName': 'Awesome Gallery',
// Will not use CFBundleName since CFBundleDisplayName is present.
'CFBundleName': 'Awesome Gallery 2',
'MinimumOSVersion': '17.0',
'CFBundleVersion': '666',
'CFBundleShortVersionString': '12.34.56',
};
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
<String>['build', 'ipa', '--no-pub']);
expect(
logger.statusText,
contains(
'[✓] App Settings Validation\n'
' • Version Number: 12.34.56\n'
' • Build Number: 666\n'
' • Display Name: Awesome Gallery\n'
' • Deployment Target: 17.0\n'
' • Bundle Identifier: io.flutter.someProject\n'
)
);
expect(
logger.statusText,
contains('To update the settings, please refer to https://docs.flutter.dev/deployment/ios')
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
PlistParser: () => plistUtils,
});
testUsingContext(
'Validate basic Xcode settings with CFBundleDisplayName fallback to CFBundleName', () async {
const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist';
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(onRun: (_) {
fileSystem.file(plistPath).createSync(recursive: true);
}),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
plistUtils.fileContents[plistPath] = <String,String>{
'CFBundleIdentifier': 'io.flutter.someProject',
// Will use CFBundleName since CFBundleDisplayName is absent.
'CFBundleName': 'Awesome Gallery',
'MinimumOSVersion': '17.0',
'CFBundleVersion': '666',
'CFBundleShortVersionString': '12.34.56',
};
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
<String>['build', 'ipa', '--no-pub']);
expect(
logger.statusText,
contains(
'[✓] App Settings Validation\n'
' • Version Number: 12.34.56\n'
' • Build Number: 666\n'
' • Display Name: Awesome Gallery\n'
' • Deployment Target: 17.0\n'
' • Bundle Identifier: io.flutter.someProject\n'
),
);
expect(
logger.statusText,
contains('To update the settings, please refer to https://docs.flutter.dev/deployment/ios'),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
PlistParser: () => plistUtils,
});
testUsingContext(
'Validate basic Xcode settings with default bundle identifier prefix', () async {
const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist';
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(onRun: (_) {
fileSystem.file(plistPath).createSync(recursive: true);
}),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
plistUtils.fileContents[plistPath] = <String,String>{
'CFBundleIdentifier': 'com.example.my_app',
};
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
<String>['build', 'ipa', '--no-pub'],
);
expect(
logger.statusText,
contains(' ! Your application still contains the default "com.example" bundle identifier.'),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
PlistParser: () => plistUtils,
});
testUsingContext(
'Validate basic Xcode settings with custom bundle identifier prefix', () async {
const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist';
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(onRun: (_) {
fileSystem.file(plistPath).createSync(recursive: true);
}),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
plistUtils.fileContents[plistPath] = <String,String>{
'CFBundleIdentifier': 'com.my_company.my_app',
};
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
<String>['build', 'ipa', '--no-pub']);
expect(
logger.statusText,
isNot(contains(' ! Your application still contains the default "com.example" bundle identifier.'))
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
PlistParser: () => plistUtils,
});
testUsingContext('Validate template app icons with conflicts', () async {
const String projectIconContentsJsonPath = 'ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json';
const String projectIconImagePath = 'ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]';
final String templateIconContentsJsonPath = '${Cache.flutterRoot!}/packages/flutter_tools/templates/app_shared/ios.tmpl/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json';
const String templateIconImagePath = '/flutter_template_images/templates/app_shared/ios.tmpl/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]';
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(onRun: (_) {
fileSystem.file(templateIconContentsJsonPath)
..createSync(recursive: true)
..writeAsStringSync('''
{
"images": [
{
"size": "20x20",
"idiom": "iphone",
"filename": "[email protected]",
"scale": "2x"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}
''');
fileSystem.file(templateIconImagePath)
..createSync(recursive: true)
..writeAsBytes(<int>[1, 2, 3]);
fileSystem.file(projectIconContentsJsonPath)
..createSync(recursive: true)
..writeAsStringSync('''
{
"images": [
{
"size": "20x20",
"idiom": "iphone",
"filename": "[email protected]",
"scale": "2x"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}
''');
fileSystem.file(projectIconImagePath)
..createSync(recursive: true)
..writeAsBytes(<int>[1, 2, 3]);
}),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
<String>['build', 'ipa', '--no-pub']);
expect(
logger.statusText,
contains(' ! App icon is set to the default placeholder icon. Replace with unique icons.'),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('Validate template app icons without conflicts', () async {
const String projectIconContentsJsonPath = 'ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json';
const String projectIconImagePath = 'ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]';
final String templateIconContentsJsonPath = '${Cache.flutterRoot!}/packages/flutter_tools/templates/app_shared/ios.tmpl/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json';
const String templateIconImagePath = '/flutter_template_images/templates/app_shared/ios.tmpl/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]';
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(onRun: (_) {
fileSystem.file(templateIconContentsJsonPath)
..createSync(recursive: true)
..writeAsStringSync('''
{
"images": [
{
"size": "20x20",
"idiom": "iphone",
"filename": "[email protected]",
"scale": "2x"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}
''');
fileSystem.file(templateIconImagePath)
..createSync(recursive: true)
..writeAsBytes(<int>[1, 2, 3]);
fileSystem.file(projectIconContentsJsonPath)
..createSync(recursive: true)
..writeAsStringSync('''
{
"images": [
{
"size": "20x20",
"idiom": "iphone",
"filename": "[email protected]",
"scale": "2x"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}
''');
fileSystem.file(projectIconImagePath)
..createSync(recursive: true)
..writeAsBytes(<int>[4, 5, 6]);
}),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
<String>['build', 'ipa', '--no-pub']);
expect(
logger.statusText,
isNot(contains('! App icon is set to the default placeholder icon. Replace with unique icons.')),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('Validate app icon using the wrong width', () async {
const String projectIconContentsJsonPath = 'ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json';
const String projectIconImagePath = 'ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]';
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(onRun: (_) {
fileSystem.file(projectIconContentsJsonPath)
..createSync(recursive: true)
..writeAsStringSync('''
{
"images": [
{
"size": "20x20",
"idiom": "iphone",
"filename": "[email protected]",
"scale": "2x"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}
''');
fileSystem.file(projectIconImagePath)
..createSync(recursive: true)
..writeAsBytes(Uint8List(16))
// set width to 1 pixel
..writeAsBytes(Uint8List(4)..buffer.asByteData().setInt32(0, 1), mode: FileMode.append)
// set height to 40 pixels
..writeAsBytes(Uint8List(4)..buffer.asByteData().setInt32(0, 40), mode: FileMode.append);
}),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
<String>['build', 'ipa', '--no-pub']);
expect(
logger.statusText,
contains(' ! App icon is using the incorrect size (e.g. [email protected]).')
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('Validate app icon using the wrong height', () async {
const String projectIconContentsJsonPath = 'ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json';
const String projectIconImagePath = 'ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]';
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(onRun: (_) {
fileSystem.file(projectIconContentsJsonPath)
..createSync(recursive: true)
..writeAsStringSync('''
{
"images": [
{
"size": "20x20",
"idiom": "iphone",
"filename": "[email protected]",
"scale": "2x"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}
''');
fileSystem.file(projectIconImagePath)
..createSync(recursive: true)
..writeAsBytes(Uint8List(16))
// set width to 40 pixels
..writeAsBytes(Uint8List(4)..buffer.asByteData().setInt32(0, 40), mode: FileMode.append)
// set height to 1 pixel
..writeAsBytes(Uint8List(4)..buffer.asByteData().setInt32(0, 1), mode: FileMode.append);
}),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
<String>['build', 'ipa', '--no-pub'],
);
expect(
logger.statusText,
contains(' ! App icon is using the incorrect size (e.g. [email protected]).'),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('Validate app icon using the correct width and height', () async {
const String projectIconContentsJsonPath = 'ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json';
const String projectIconImagePath = 'ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]';
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(onRun: (_) {
fileSystem.file(projectIconContentsJsonPath)
..createSync(recursive: true)
..writeAsStringSync('''
{
"images": [
{
"size": "20x20",
"idiom": "iphone",
"filename": "[email protected]",
"scale": "2x"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}
''');
fileSystem.file(projectIconImagePath)
..createSync(recursive: true)
..writeAsBytes(Uint8List(16))
// set width to 40 pixels
..writeAsBytes(Uint8List(4)..buffer.asByteData().setInt32(0, 40), mode: FileMode.append)
// set height to 40 pixel
..writeAsBytes(Uint8List(4)..buffer.asByteData().setInt32(0, 40), mode: FileMode.append);
}),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
<String>['build', 'ipa', '--no-pub']);
expect(
logger.statusText,
isNot(contains(' ! App icon is using the incorrect size (e.g. [email protected]).')),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('Validate app icon should skip validation for unknown format version', () async {
const String projectIconContentsJsonPath = 'ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json';
const String projectIconImagePath = 'ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]';
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(onRun: (_) {
// Uses unknown format version 123.
fileSystem.file(projectIconContentsJsonPath)
..createSync(recursive: true)
..writeAsStringSync('''
{
"images": [
{
"size": "20x20",
"idiom": "iphone",
"filename": "[email protected]",
"scale": "2x"
}
],
"info": {
"version": 123,
"author": "xcode"
}
}
''');
fileSystem.file(projectIconImagePath)
..createSync(recursive: true)
..writeAsBytes(Uint8List(16))
// set width to 1 pixel
..writeAsBytes(Uint8List(4)..buffer.asByteData().setInt32(0, 1), mode: FileMode.append)
// set height to 1 pixel
..writeAsBytes(Uint8List(4)..buffer.asByteData().setInt32(0, 1), mode: FileMode.append);
}),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
<String>['build', 'ipa', '--no-pub'],
);
// The validation should be skipped, even when the icon size is incorrect.
expect(
logger.statusText,
isNot(contains(' ! App icon is using the incorrect size (e.g. [email protected]).')),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('Validate app icon should skip validation of an icon image if invalid format', () async {
const String projectIconContentsJsonPath = 'ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json';
final List<String> imageFileNames = <String>[
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
];
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(onRun: (_) {
// The following json contains examples of:
// - invalid size
// - invalid scale
// - missing size
// - missing idiom
// - missing filename
// - missing scale
fileSystem.file(projectIconContentsJsonPath)
..createSync(recursive: true)
..writeAsStringSync('''
{
"images": [
{
"size": "20*20",
"idiom": "iphone",
"filename": "[email protected]",
"scale": "1x"
},
{
"size": "20x20",
"idiom": "iphone",
"filename": "[email protected]",
"scale": "2@"
},
{
"idiom": "iphone",
"filename": "[email protected]",
"scale": "3x"
},
{
"size": "29x29",
"filename": "[email protected]",
"scale": "1x"
},
{
"size": "29x29",
"idiom": "iphone",
"scale": "2x"
},
{
"size": "29x29",
"idiom": "iphone",
"filename": "[email protected]"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}
''');
// Resize all related images to 1x1.
for (final String imageFileName in imageFileNames) {
fileSystem.file('ios/Runner/Assets.xcassets/AppIcon.appiconset/$imageFileName')
..createSync(recursive: true)
..writeAsBytes(Uint8List(16))
// set width to 1 pixel
..writeAsBytes(Uint8List(4)..buffer.asByteData().setInt32(0, 1), mode: FileMode.append)
// set height to 1 pixel
..writeAsBytes(Uint8List(4)..buffer.asByteData().setInt32(0, 1), mode: FileMode.append);
}
}),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
<String>['build', 'ipa', '--no-pub'],
);
// The validation should be skipped, even when the image size is incorrect.
for (final String imageFileName in imageFileNames) {
expect(
logger.statusText,
isNot(contains(' ! App icon is using the incorrect size (e.g. $imageFileName).')),
);
}
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('Validate template launch images with conflicts', () async {
const String projectLaunchImageContentsJsonPath = 'ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json';
const String projectLaunchImagePath = 'ios/Runner/Assets.xcassets/LaunchImage.imageset/[email protected]';
final String templateLaunchImageContentsJsonPath = '${Cache.flutterRoot!}/packages/flutter_tools/templates/app_shared/ios.tmpl/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json';
const String templateLaunchImagePath = '/flutter_template_images/templates/app_shared/ios.tmpl/Runner/Assets.xcassets/LaunchImage.imageset/[email protected]';
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(onRun: (_) {
fileSystem.file(templateLaunchImageContentsJsonPath)
..createSync(recursive: true)
..writeAsStringSync('''
{
"images": [
{
"idiom": "iphone",
"filename": "[email protected]",
"scale": "2x"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}
''');
fileSystem.file(templateLaunchImagePath)
..createSync(recursive: true)
..writeAsBytes(<int>[1, 2, 3]);
fileSystem.file(projectLaunchImageContentsJsonPath)
..createSync(recursive: true)
..writeAsStringSync('''
{
"images": [
{
"idiom": "iphone",
"filename": "[email protected]",
"scale": "2x"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}
''');
fileSystem.file(projectLaunchImagePath)
..createSync(recursive: true)
..writeAsBytes(<int>[1, 2, 3]);
}),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
<String>['build', 'ipa', '--no-pub']);
expect(
logger.statusText,
contains(' ! Launch image is set to the default placeholder icon. Replace with unique launch image.'),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
testUsingContext('Validate template launch images without conflicts', () async {
const String projectLaunchImageContentsJsonPath = 'ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json';
const String projectLaunchImagePath = 'ios/Runner/Assets.xcassets/LaunchImage.imageset/[email protected]';
final String templateLaunchImageContentsJsonPath = '${Cache.flutterRoot!}/packages/flutter_tools/templates/app_shared/ios.tmpl/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json';
const String templateLaunchImagePath = '/flutter_template_images/templates/app_shared/ios.tmpl/Runner/Assets.xcassets/LaunchImage.imageset/[email protected]';
fakeProcessManager.addCommands(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(onRun: (_) {
fileSystem.file(templateLaunchImageContentsJsonPath)
..createSync(recursive: true)
..writeAsStringSync('''
{
"images": [
{
"idiom": "iphone",
"filename": "[email protected]",
"scale": "2x"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}
''');
fileSystem.file(templateLaunchImagePath)
..createSync(recursive: true)
..writeAsBytes(<int>[1, 2, 3]);
fileSystem.file(projectLaunchImageContentsJsonPath)
..createSync(recursive: true)
..writeAsStringSync('''
{
"images": [
{
"idiom": "iphone",
"filename": "[email protected]",
"scale": "2x"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}
''');
fileSystem.file(projectLaunchImagePath)
..createSync(recursive: true)
..writeAsBytes(<int>[4, 5, 6]);
}),
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
]);
createMinimalMockProjectFiles();
final BuildCommand command = BuildCommand(
artifacts: artifacts,
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
logger: logger,
fileSystem: fileSystem,
processUtils: processUtils,
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
<String>['build', 'ipa', '--no-pub']);
expect(
logger.statusText,
isNot(contains(' ! Launch image is set to the default placeholder icon. Replace with unique launch image.')),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
Logger: () => logger,
ProcessManager: () => fakeProcessManager,
Platform: () => macosPlatform,
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
});
}
const String _xcBundleFilePath = '/.tmp_rand0/flutter_ios_build_temp_dirrand0/temporary_xcresult_bundle';
const String _exportOptionsPlist = '/.tmp_rand0/flutter_build_ios.rand0/ExportOptions.plist';
| flutter/packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart",
"repo_id": "flutter",
"token_count": 27482
} | 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/artifacts.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/build_system/targets/localizations.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/generate_localizations.dart';
import 'package:flutter_tools/src/localizations/gen_l10n_types.dart';
import '../../integration.shard/test_data/basic_project.dart';
import '../../src/common.dart';
import '../../src/context.dart';
import '../../src/fake_process_manager.dart';
import '../../src/test_flutter_command_runner.dart';
void main() {
late FileSystem fileSystem;
late BufferLogger logger;
late Artifacts artifacts;
late FakeProcessManager processManager;
setUpAll(() {
Cache.disableLocking();
});
setUp(() {
fileSystem = MemoryFileSystem.test();
logger = BufferLogger.test();
artifacts = Artifacts.test();
processManager = FakeProcessManager.empty();
});
testUsingContext('default l10n settings', () async {
final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb'))
..createSync(recursive: true);
arbFile.writeAsStringSync('''
{
"helloWorld": "Hello, World!",
"@helloWorld": {
"description": "Sample description"
}
}''');
final File pubspecFile = fileSystem.file('pubspec.yaml')..createSync();
pubspecFile.writeAsStringSync(BasicProjectWithFlutterGen().pubspec);
final GenerateLocalizationsCommand command = GenerateLocalizationsCommand(
fileSystem: fileSystem,
logger: logger,
artifacts: artifacts,
processManager: processManager,
);
await createTestCommandRunner(command).run(<String>['gen-l10n']);
final Directory outputDirectory = fileSystem.directory(fileSystem.path.join('.dart_tool', 'flutter_gen', 'gen_l10n'));
expect(outputDirectory.existsSync(), true);
expect(outputDirectory.childFile('app_localizations_en.dart').existsSync(), true);
expect(outputDirectory.childFile('app_localizations.dart').existsSync(), true);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('not using synthetic packages', () async {
final Directory l10nDirectory = fileSystem.directory(
fileSystem.path.join('lib', 'l10n'),
);
final File arbFile = l10nDirectory.childFile(
'app_en.arb',
)..createSync(recursive: true);
arbFile.writeAsStringSync('''
{
"helloWorld": "Hello, World!",
"@helloWorld": {
"description": "Sample description"
}
}''');
fileSystem
.file('pubspec.yaml')
.writeAsStringSync('''
flutter:
generate: true''');
final GenerateLocalizationsCommand command = GenerateLocalizationsCommand(
fileSystem: fileSystem,
logger: logger,
artifacts: artifacts,
processManager: processManager,
);
await createTestCommandRunner(command).run(<String>[
'gen-l10n',
'--no-synthetic-package',
]);
expect(l10nDirectory.existsSync(), true);
expect(l10nDirectory.childFile('app_localizations_en.dart').existsSync(), true);
expect(l10nDirectory.childFile('app_localizations.dart').existsSync(), true);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('throws error when arguments are invalid', () async {
final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb'))
..createSync(recursive: true);
arbFile.writeAsStringSync('''
{
"helloWorld": "Hello, World!",
"@helloWorld": {
"description": "Sample description"
}
}''');
fileSystem.file('header.txt').writeAsStringSync('a header file');
fileSystem
.file('pubspec.yaml')
.writeAsStringSync('''
flutter:
generate: true''');
final GenerateLocalizationsCommand command = GenerateLocalizationsCommand(
fileSystem: fileSystem,
logger: logger,
artifacts: artifacts,
processManager: processManager,
);
expect(
() => createTestCommandRunner(command).run(<String>[
'gen-l10n',
'--header="some header',
'--header-file="header.txt"',
]),
throwsToolExit(),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('l10n yaml file takes precedence over command line arguments', () async {
final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb'))
..createSync(recursive: true);
arbFile.writeAsStringSync('''
{
"helloWorld": "Hello, World!",
"@helloWorld": {
"description": "Sample description"
}
}''');
fileSystem.file('l10n.yaml').createSync();
final File pubspecFile = fileSystem.file('pubspec.yaml')..createSync();
pubspecFile.writeAsStringSync(BasicProjectWithFlutterGen().pubspec);
final GenerateLocalizationsCommand command = GenerateLocalizationsCommand(
fileSystem: fileSystem,
logger: logger,
artifacts: artifacts,
processManager: processManager,
);
await createTestCommandRunner(command).run(<String>['gen-l10n']);
expect(logger.statusText, contains('Because l10n.yaml exists, the options defined there will be used instead.'));
final Directory outputDirectory = fileSystem.directory(fileSystem.path.join('.dart_tool', 'flutter_gen', 'gen_l10n'));
expect(outputDirectory.existsSync(), true);
expect(outputDirectory.childFile('app_localizations_en.dart').existsSync(), true);
expect(outputDirectory.childFile('app_localizations.dart').existsSync(), true);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('nullable-getter help message is expected string', () async {
final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb'))
..createSync(recursive: true);
arbFile.writeAsStringSync('''
{
"helloWorld": "Hello, World!",
"@helloWorld": {
"description": "Sample description"
}
}''');
fileSystem.file('l10n.yaml').createSync();
final File pubspecFile = fileSystem.file('pubspec.yaml')..createSync();
pubspecFile.writeAsStringSync(BasicProjectWithFlutterGen().pubspec);
final GenerateLocalizationsCommand command = GenerateLocalizationsCommand(
fileSystem: fileSystem,
logger: logger,
artifacts: artifacts,
processManager: processManager,
);
await createTestCommandRunner(command).run(<String>['gen-l10n']);
expect(command.usage, contains(' If this value is set to false, then '));
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('dart format is run when --format is passed', () async {
final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb'))
..createSync(recursive: true);
arbFile.writeAsStringSync('''
{
"helloWorld": "Hello, World!",
"@helloWorld": {
"description": "Sample description"
}
}''');
final File pubspecFile = fileSystem.file('pubspec.yaml')..createSync();
pubspecFile.writeAsStringSync(BasicProjectWithFlutterGen().pubspec);
processManager.addCommand(
const FakeCommand(
command: <String>[
'Artifact.engineDartBinary',
'format',
'/.dart_tool/flutter_gen/gen_l10n/app_localizations_en.dart',
'/.dart_tool/flutter_gen/gen_l10n/app_localizations.dart',
]
)
);
final GenerateLocalizationsCommand command = GenerateLocalizationsCommand(
fileSystem: fileSystem,
logger: logger,
artifacts: artifacts,
processManager: processManager,
);
await createTestCommandRunner(command).run(<String>['gen-l10n', '--format']);
final Directory outputDirectory = fileSystem.directory(fileSystem.path.join('.dart_tool', 'flutter_gen', 'gen_l10n'));
expect(outputDirectory.existsSync(), true);
expect(outputDirectory.childFile('app_localizations_en.dart').existsSync(), true);
expect(outputDirectory.childFile('app_localizations.dart').existsSync(), true);
expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('dart format is run when format: true is passed into l10n.yaml', () async {
final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb'))
..createSync(recursive: true);
arbFile.writeAsStringSync('''
{
"helloWorld": "Hello, World!",
"@helloWorld": {
"description": "Sample description"
}
}''');
final File configFile = fileSystem.file('l10n.yaml')..createSync();
configFile.writeAsStringSync('''
format: true
''');
final File pubspecFile = fileSystem.file('pubspec.yaml')..createSync();
pubspecFile.writeAsStringSync(BasicProjectWithFlutterGen().pubspec);
processManager.addCommand(
const FakeCommand(
command: <String>[
'Artifact.engineDartBinary',
'format',
'/.dart_tool/flutter_gen/gen_l10n/app_localizations_en.dart',
'/.dart_tool/flutter_gen/gen_l10n/app_localizations.dart',
]
)
);
final GenerateLocalizationsCommand command = GenerateLocalizationsCommand(
fileSystem: fileSystem,
logger: logger,
artifacts: artifacts,
processManager: processManager,
);
await createTestCommandRunner(command).run(<String>['gen-l10n']);
final Directory outputDirectory = fileSystem.directory(fileSystem.path.join('.dart_tool', 'flutter_gen', 'gen_l10n'));
expect(outputDirectory.existsSync(), true);
expect(outputDirectory.childFile('app_localizations_en.dart').existsSync(), true);
expect(outputDirectory.childFile('app_localizations.dart').existsSync(), true);
expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
// Regression test for https://github.com/flutter/flutter/issues/119594
testUsingContext('dart format is working when the untranslated messages file is produced', () async {
final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb'))
..createSync(recursive: true);
arbFile.writeAsStringSync('''
{
"helloWorld": "Hello, World!",
"untranslated": "Test untranslated message."
}''');
fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_es.arb'))
..createSync(recursive: true)
..writeAsStringSync('''
{
"helloWorld": "Hello, World!"
}''');
final File configFile = fileSystem.file('l10n.yaml')..createSync();
configFile.writeAsStringSync('''
format: true
untranslated-messages-file: lib/l10n/untranslated.json
''');
final File pubspecFile = fileSystem.file('pubspec.yaml')..createSync();
pubspecFile.writeAsStringSync(BasicProjectWithFlutterGen().pubspec);
processManager.addCommand(
const FakeCommand(
command: <String>[
'Artifact.engineDartBinary',
'format',
'/.dart_tool/flutter_gen/gen_l10n/app_localizations_en.dart',
'/.dart_tool/flutter_gen/gen_l10n/app_localizations_es.dart',
'/.dart_tool/flutter_gen/gen_l10n/app_localizations.dart',
]
)
);
final GenerateLocalizationsCommand command = GenerateLocalizationsCommand(
fileSystem: fileSystem,
logger: logger,
artifacts: artifacts,
processManager: processManager,
);
await createTestCommandRunner(command).run(<String>['gen-l10n']);
final Directory outputDirectory = fileSystem.directory(fileSystem.path.join('.dart_tool', 'flutter_gen', 'gen_l10n'));
expect(outputDirectory.existsSync(), true);
expect(outputDirectory.childFile('app_localizations_en.dart').existsSync(), true);
expect(outputDirectory.childFile('app_localizations_es.dart').existsSync(), true);
expect(outputDirectory.childFile('app_localizations.dart').existsSync(), true);
final File untranslatedMessagesFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'untranslated.json'));
expect(untranslatedMessagesFile.existsSync(), true);
expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
// Regression test for https://github.com/flutter/flutter/issues/120530.
testWithoutContext('dart format is run when generateLocalizations is called through build target', () async {
final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb'))
..createSync(recursive: true);
arbFile.writeAsStringSync('''
{
"helloWorld": "Hello, World!",
"@helloWorld": {
"description": "Sample description"
}
}''');
final File configFile = fileSystem.file('l10n.yaml')..createSync();
configFile.writeAsStringSync('''
format: true
''');
const Target buildTarget = GenerateLocalizationsTarget();
final File pubspecFile = fileSystem.file('pubspec.yaml')..createSync();
pubspecFile.writeAsStringSync(BasicProjectWithFlutterGen().pubspec);
processManager.addCommand(
const FakeCommand(
command: <String>[
'Artifact.engineDartBinary',
'format',
'/.dart_tool/flutter_gen/gen_l10n/app_localizations_en.dart',
'/.dart_tool/flutter_gen/gen_l10n/app_localizations.dart',
]
)
);
final Environment environment = Environment.test(
fileSystem.currentDirectory,
artifacts: artifacts,
processManager: processManager,
fileSystem: fileSystem,
logger: BufferLogger.test(),
);
await buildTarget.build(environment);
final Directory outputDirectory = fileSystem.directory(fileSystem.path.join('.dart_tool', 'flutter_gen', 'gen_l10n'));
expect(outputDirectory.existsSync(), true);
expect(outputDirectory.childFile('app_localizations_en.dart').existsSync(), true);
expect(outputDirectory.childFile('app_localizations.dart').existsSync(), true);
expect(processManager, hasNoRemainingExpectations);
});
testUsingContext('nullable-getter defaults to true', () async {
final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb'))
..createSync(recursive: true);
arbFile.writeAsStringSync('''
{
"helloWorld": "Hello, World!",
"@helloWorld": {
"description": "Sample description"
}
}''');
final File pubspecFile = fileSystem.file('pubspec.yaml')..createSync();
pubspecFile.writeAsStringSync(BasicProjectWithFlutterGen().pubspec);
final GenerateLocalizationsCommand command = GenerateLocalizationsCommand(
fileSystem: fileSystem,
logger: logger,
artifacts: artifacts,
processManager: processManager,
);
await createTestCommandRunner(command).run(<String>['gen-l10n']);
final Directory outputDirectory = fileSystem.directory(fileSystem.path.join('.dart_tool', 'flutter_gen', 'gen_l10n'));
expect(outputDirectory.existsSync(), isTrue);
expect(outputDirectory.childFile('app_localizations.dart').existsSync(), isTrue);
expect(
outputDirectory.childFile('app_localizations.dart').readAsStringSync(),
contains('static AppLocalizations? of(BuildContext context)'),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('throw when generate: false and uses synthetic package when run with l10n.yaml', () async {
final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb'))
..createSync(recursive: true);
arbFile.writeAsStringSync('''
{
"helloWorld": "Hello, World!",
"@helloWorld": {
"description": "Sample description"
}
}''');
fileSystem.file('l10n.yaml').createSync();
final File pubspecFile = fileSystem.file('pubspec.yaml')..createSync();
pubspecFile.writeAsStringSync('''
name: test
environment:
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
sdk: flutter
flutter:
generate: false
''');
final GenerateLocalizationsCommand command = GenerateLocalizationsCommand(
fileSystem: fileSystem,
logger: logger,
artifacts: artifacts,
processManager: processManager,
);
expect(
() async => createTestCommandRunner(command).run(<String>['gen-l10n']),
throwsToolExit(message: 'Attempted to generate localizations code without having the flutter: generate flag turned on.')
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('throw when generate: false and uses synthetic package when run via commandline options', () async {
final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb'))
..createSync(recursive: true);
arbFile.writeAsStringSync('''
{
"helloWorld": "Hello, World!",
"@helloWorld": {
"description": "Sample description"
}
}''');
final File pubspecFile = fileSystem.file('pubspec.yaml')..createSync();
pubspecFile.writeAsStringSync('''
name: test
environment:
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
sdk: flutter
flutter:
generate: false
''');
final GenerateLocalizationsCommand command = GenerateLocalizationsCommand(
fileSystem: fileSystem,
logger: logger,
artifacts: artifacts,
processManager: processManager,
);
expect(
() async => createTestCommandRunner(command).run(<String>['gen-l10n', '--synthetic-package']),
throwsToolExit(message: 'Attempted to generate localizations code without having the flutter: generate flag turned on.')
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('throws error when unexpected positional argument is provided', () {
final GenerateLocalizationsCommand command = GenerateLocalizationsCommand(
fileSystem: fileSystem,
logger: logger,
artifacts: artifacts,
processManager: processManager,
);
expect(
() async => createTestCommandRunner(command).run(<String>['gen-l10n', '--synthetic-package', 'false']),
throwsToolExit(message: 'Unexpected positional argument "false".')
);
});
group(AppResourceBundle, () {
testWithoutContext("can be parsed without FormatException when it's content is empty", () {
final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb'))
..createSync(recursive: true);
expect(AppResourceBundle(arbFile), isA<AppResourceBundle>());
});
testUsingContext("would not fail the gen-l10n command when it's content is empty", () async {
fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb')).createSync(recursive: true);
final File pubspecFile = fileSystem.file('pubspec.yaml')..createSync();
pubspecFile.writeAsStringSync(BasicProjectWithFlutterGen().pubspec);
final GenerateLocalizationsCommand command = GenerateLocalizationsCommand(
fileSystem: fileSystem,
logger: logger,
artifacts: artifacts,
processManager: processManager,
);
await createTestCommandRunner(command).run(<String>['gen-l10n']);
final Directory outputDirectory = fileSystem.directory(fileSystem.path.join('.dart_tool', 'flutter_gen', 'gen_l10n'));
expect(outputDirectory.existsSync(), true);
expect(outputDirectory.childFile('app_localizations_en.dart').existsSync(), true);
expect(outputDirectory.childFile('app_localizations.dart').existsSync(), true);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
});
}
| flutter/packages/flutter_tools/test/commands.shard/hermetic/generate_localizations_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/commands.shard/hermetic/generate_localizations_test.dart",
"repo_id": "flutter",
"token_count": 7268
} | 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:async';
import 'package:args/command_runner.dart';
import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/upgrade.dart';
import 'package:flutter_tools/src/version.dart';
import '../../src/context.dart';
import '../../src/fake_process_manager.dart';
import '../../src/fakes.dart' show FakeFlutterVersion;
import '../../src/test_flutter_command_runner.dart';
void main() {
late FileSystem fileSystem;
late BufferLogger logger;
late FakeProcessManager processManager;
UpgradeCommand command;
late CommandRunner<void> runner;
const String flutterRoot = '/path/to/flutter';
setUpAll(() {
Cache.disableLocking();
Cache.flutterRoot = flutterRoot;
});
setUp(() {
fileSystem = MemoryFileSystem.test();
logger = BufferLogger.test();
processManager = FakeProcessManager.empty();
command = UpgradeCommand(
verboseHelp: false,
);
runner = createTestCommandRunner(command);
});
testUsingContext('can auto-migrate a user from dev to beta', () async {
const String startingTag = '3.0.0-1.2.pre';
const String latestUpstreamTag = '3.0.0-1.3.pre';
const String upstreamHeadRevision = 'deadbeef';
final Completer<void> reEntryCompleter = Completer<void>();
Future<void> reEnterTool(List<String> command) async {
await runner.run(<String>['upgrade', '--continue', '--no-version-check']);
reEntryCompleter.complete();
}
processManager.addCommands(<FakeCommand>[
const FakeCommand(
command: <String>['git', 'tag', '--points-at', 'HEAD'],
stdout: startingTag,
),
// Ensure we have upstream tags present locally
const FakeCommand(
command: <String>['git', 'fetch', '--tags'],
),
const FakeCommand(
command: <String>['git', 'rev-parse', '--verify', '@{upstream}'],
stdout: upstreamHeadRevision,
),
const FakeCommand(
command: <String>['git', 'tag', '--points-at', upstreamHeadRevision],
stdout: latestUpstreamTag,
),
// check for uncommitted changes; empty stdout means clean checkout
const FakeCommand(
command: <String>['git', 'status', '-s'],
),
// here the tool is upgrading the branch from dev -> beta
const FakeCommand(
command: <String>['git', 'fetch'],
),
// test if there already exists a local beta branch; 0 exit code means yes
const FakeCommand(
command: <String>['git', 'show-ref', '--verify', '--quiet', 'refs/heads/beta'],
),
const FakeCommand(
command: <String>['git', 'checkout', 'beta', '--'],
),
// reset instead of pull since cherrypicks from one release branch will
// not be present on a newer one
const FakeCommand(
command: <String>['git', 'reset', '--hard', upstreamHeadRevision],
),
// re-enter flutter command with the newer version, so that `doctor`
// checks will be up to date
FakeCommand(
command: const <String>['bin/flutter', 'upgrade', '--continue', '--no-version-check'],
onRun: reEnterTool,
completer: reEntryCompleter,
),
// commands following this are from the re-entrant `flutter upgrade --continue` call
const FakeCommand(
command: <String>['git', 'tag', '--points-at', 'HEAD'],
stdout: latestUpstreamTag,
),
const FakeCommand(
command: <String>['bin/flutter', '--no-color', '--no-version-check', 'precache'],
),
const FakeCommand(
command: <String>['bin/flutter', '--no-version-check', 'doctor'],
),
]);
await runner.run(<String>['upgrade']);
expect(processManager, hasNoRemainingExpectations);
expect(logger.statusText, contains("Transitioning from 'dev' to 'beta'..."));
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
FlutterVersion: () => FakeFlutterVersion(branch: 'dev'),
Logger: () => logger,
ProcessManager: () => processManager,
});
const String startingTag = '3.0.0';
const String latestUpstreamTag = '3.1.0';
const String upstreamHeadRevision = '5765737420536964652053746f7279';
testUsingContext('can push people from master to beta', () async {
final Completer<void> reEntryCompleter = Completer<void>();
Future<void> reEnterTool(List<String> args) async {
await runner.run(<String>['upgrade', '--continue', '--no-version-check']);
reEntryCompleter.complete();
}
processManager.addCommands(<FakeCommand>[
const FakeCommand(
command: <String>['git', 'tag', '--points-at', 'HEAD'],
stdout: startingTag,
),
const FakeCommand(
command: <String>['git', 'fetch', '--tags'],
),
const FakeCommand(
command: <String>['git', 'rev-parse', '--verify', '@{upstream}'],
stdout: upstreamHeadRevision,
),
const FakeCommand(
command: <String>['git', 'tag', '--points-at', upstreamHeadRevision],
stdout: latestUpstreamTag,
),
const FakeCommand(
command: <String>['git', 'status', '-s'],
),
const FakeCommand(
command: <String>['git', 'reset', '--hard', upstreamHeadRevision],
),
FakeCommand(
command: const <String>['bin/flutter', 'upgrade', '--continue', '--no-version-check'],
onRun: reEnterTool,
completer: reEntryCompleter,
),
// commands following this are from the re-entrant `flutter upgrade --continue` call
const FakeCommand(
command: <String>['git', 'tag', '--points-at', 'HEAD'],
stdout: latestUpstreamTag,
),
const FakeCommand(
command: <String>['bin/flutter', '--no-color', '--no-version-check', 'precache'],
),
const FakeCommand(
command: <String>['bin/flutter', '--no-version-check', 'doctor'],
),
]);
await runner.run(<String>['upgrade']);
expect(processManager, hasNoRemainingExpectations);
expect(logger.statusText,
'Upgrading Flutter to 3.1.0 from 3.0.0 in ${Cache.flutterRoot}...\n'
'\n'
'Upgrading engine...\n'
'\n'
"Instance of 'FakeFlutterVersion'\n" // the real FlutterVersion has a better toString, heh
'\n'
'Running flutter doctor...\n'
'\n'
'This channel is intended for Flutter contributors. This channel is not as thoroughly '
'tested as the "beta" and "stable" channels. We do not recommend using this channel '
'for normal use as it more likely to contain serious regressions.\n'
'\n'
'For information on contributing to Flutter, see our contributing guide:\n'
' https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md\n'
'\n'
'For the most up to date stable version of flutter, consider using the "beta" channel '
'instead. The Flutter "beta" channel enjoys all the same automated testing as the '
'"stable" channel, but is updated roughly once a month instead of once a quarter.\n'
'To change channel, run the "flutter channel beta" command.\n'
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
FlutterVersion: () => FakeFlutterVersion(frameworkVersion: startingTag, engineRevision: 'engine'),
Logger: () => logger,
ProcessManager: () => processManager,
});
testUsingContext('do not push people from beta to anything else', () async {
final Completer<void> reEntryCompleter = Completer<void>();
Future<void> reEnterTool(List<String> command) async {
await runner.run(<String>['upgrade', '--continue', '--no-version-check']);
reEntryCompleter.complete();
}
processManager.addCommands(<FakeCommand>[
const FakeCommand(
command: <String>['git', 'tag', '--points-at', 'HEAD'],
stdout: startingTag,
workingDirectory: flutterRoot,
),
const FakeCommand(
command: <String>['git', 'fetch', '--tags'],
workingDirectory: flutterRoot,
),
const FakeCommand(
command: <String>['git', 'rev-parse', '--verify', '@{upstream}'],
stdout: upstreamHeadRevision,
workingDirectory: flutterRoot,
),
const FakeCommand(
command: <String>['git', 'tag', '--points-at', upstreamHeadRevision],
stdout: latestUpstreamTag,
workingDirectory: flutterRoot,
),
const FakeCommand(
command: <String>['git', 'status', '-s'],
workingDirectory: flutterRoot,
),
const FakeCommand(
command: <String>['git', 'reset', '--hard', upstreamHeadRevision],
workingDirectory: flutterRoot,
),
FakeCommand(
command: const <String>['bin/flutter', 'upgrade', '--continue', '--no-version-check'],
onRun: reEnterTool,
completer: reEntryCompleter,
workingDirectory: flutterRoot,
),
// commands following this are from the re-entrant `flutter upgrade --continue` call
const FakeCommand(
command: <String>['git', 'tag', '--points-at', 'HEAD'],
stdout: latestUpstreamTag,
workingDirectory: flutterRoot,
),
const FakeCommand(
command: <String>['bin/flutter', '--no-color', '--no-version-check', 'precache'],
workingDirectory: flutterRoot,
),
const FakeCommand(
command: <String>['bin/flutter', '--no-version-check', 'doctor'],
workingDirectory: flutterRoot,
),
]);
await runner.run(<String>['upgrade']);
expect(processManager, hasNoRemainingExpectations);
expect(logger.statusText,
'Upgrading Flutter to 3.1.0 from 3.0.0 in ${Cache.flutterRoot}...\n'
'\n'
'Upgrading engine...\n'
'\n'
"Instance of 'FakeFlutterVersion'\n" // the real FlutterVersion has a better toString, heh
'\n'
'Running flutter doctor...\n'
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
FlutterVersion: () => FakeFlutterVersion(branch: 'beta', frameworkVersion: startingTag, engineRevision: 'engine'),
Logger: () => logger,
ProcessManager: () => processManager,
});
}
| flutter/packages/flutter_tools/test/commands.shard/hermetic/upgrade_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/commands.shard/hermetic/upgrade_test.dart",
"repo_id": "flutter",
"token_count": 4061
} | 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:async';
import 'package:flutter_tools/src/android/android_device.dart';
import 'package:test/fake.dart';
import '../../src/common.dart';
import '../../src/fake_process_manager.dart';
const int kLollipopVersionCode = 21;
const String kLastLogcatTimestamp = '11-27 15:39:04.506';
/// By default the android log reader accepts lines that match no patterns
/// if the previous line was a match. Include an intentionally non-matching
/// line as the first input to disable this behavior.
const String kDummyLine = 'Contents are not important\n';
void main() {
testWithoutContext('AdbLogReader ignores spam from SurfaceSyncer', () async {
const int appPid = 1;
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>[
'adb',
'-s',
'1234',
'shell',
'-x',
'logcat',
'-v',
'time',
],
completer: Completer<void>.sync(),
stdout:
'$kDummyLine'
'05-11 12:54:46.665 W/flutter($appPid): Hello there!\n'
'05-11 12:54:46.665 E/SurfaceSyncer($appPid): Failed to find sync for id=9\n'
'05-11 12:54:46.665 E/SurfaceSyncer($appPid): Failed to find sync for id=10\n'
),
]);
final AdbLogReader logReader = await AdbLogReader.createLogReader(
createFakeDevice(null),
processManager,
)..appPid = appPid;
final Completer<void> onDone = Completer<void>.sync();
final List<String> emittedLines = <String>[];
logReader.logLines.listen((String line) {
emittedLines.add(line);
}, onDone: onDone.complete);
await null;
logReader.dispose();
await onDone.future;
expect(emittedLines, const <String>['W/flutter($appPid): Hello there!']);
});
testWithoutContext('AdbLogReader calls adb logcat with expected flags apiVersion 21', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>[
'adb',
'-s',
'1234',
'shell',
'-x',
'logcat',
'-v',
'time',
'-T',
"'$kLastLogcatTimestamp'",
],
),
]);
await AdbLogReader.createLogReader(
createFakeDevice(kLollipopVersionCode),
processManager,
);
expect(processManager, hasNoRemainingExpectations);
});
testWithoutContext('AdbLogReader calls adb logcat with expected flags apiVersion < 21', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>[
'adb',
'-s',
'1234',
'shell',
'-x',
'logcat',
'-v',
'time',
],
),
]);
await AdbLogReader.createLogReader(
createFakeDevice(kLollipopVersionCode - 1),
processManager,
);
expect(processManager, hasNoRemainingExpectations);
});
testWithoutContext('AdbLogReader calls adb logcat with expected flags null apiVersion', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>[
'adb',
'-s',
'1234',
'shell',
'-x',
'logcat',
'-v',
'time',
],
),
]);
await AdbLogReader.createLogReader(
createFakeDevice(null),
processManager,
);
expect(processManager, hasNoRemainingExpectations);
});
testWithoutContext('AdbLogReader calls adb logcat with expected flags when requesting past logs', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>[
'adb',
'-s',
'1234',
'shell',
'-x',
'logcat',
'-v',
'time',
'-s',
'flutter',
],
),
]);
await AdbLogReader.createLogReader(
createFakeDevice(null),
processManager,
includePastLogs: true,
);
expect(processManager, hasNoRemainingExpectations);
});
testWithoutContext('AdbLogReader handles process early exit', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>[
'adb',
'-s',
'1234',
'shell',
'-x',
'logcat',
'-v',
'time',
],
completer: Completer<void>.sync(),
stdout: 'Hello There\n',
),
]);
final AdbLogReader logReader = await AdbLogReader.createLogReader(
createFakeDevice(null),
processManager,
);
final Completer<void> onDone = Completer<void>.sync();
logReader.logLines.listen((String _) { }, onDone: onDone.complete);
logReader.dispose();
await onDone.future;
});
testWithoutContext('AdbLogReader does not filter output from AndroidRuntime crashes', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>[
'adb',
'-s',
'1234',
'shell',
'-x',
'logcat',
'-v',
'time',
],
completer: Completer<void>.sync(),
// Example stack trace from an incorrectly named application:name in the AndroidManifest.xml
stdout:
'$kDummyLine'
'05-11 12:54:46.665 E/AndroidRuntime(11787): FATAL EXCEPTION: main\n'
'05-11 12:54:46.665 E/AndroidRuntime(11787): Process: com.example.foobar, PID: 11787\n'
'05-11 12:54:46.665 java.lang.RuntimeException: Unable to instantiate application '
'io.flutter.app.FlutterApplication2: java.lang.ClassNotFoundException:\n',
),
]);
final AdbLogReader logReader = await AdbLogReader.createLogReader(
createFakeDevice(null),
processManager,
);
await expectLater(logReader.logLines, emitsInOrder(<String>[
'E/AndroidRuntime(11787): FATAL EXCEPTION: main',
'E/AndroidRuntime(11787): Process: com.example.foobar, PID: 11787',
'java.lang.RuntimeException: Unable to instantiate application io.flutter.app.FlutterApplication2: java.lang.ClassNotFoundException:',
]));
logReader.dispose();
});
}
AndroidDevice createFakeDevice(int? sdkLevel) {
return FakeAndroidDevice(
sdkLevel.toString(),
kLastLogcatTimestamp,
);
}
class FakeAndroidDevice extends Fake implements AndroidDevice {
FakeAndroidDevice(this._apiVersion, this._lastLogcatTimestamp);
final String _lastLogcatTimestamp;
final String _apiVersion;
@override
String get name => 'test-device';
@override
Future<String> get apiVersion => Future<String>.value(_apiVersion);
@override
Future<String> lastLogcatTimestamp() async => _lastLogcatTimestamp;
@override
List<String> adbCommandForDevice(List<String> command) {
return <String>[
'adb', '-s', '1234', ...command,
];
}
}
| flutter/packages/flutter_tools/test/general.shard/android/adb_log_reader_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/android/adb_log_reader_test.dart",
"repo_id": "flutter",
"token_count": 3112
} | 773 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:file/memory.dart';
import 'package:file_testing/file_testing.dart';
import 'package:flutter_tools/src/android/gradle_errors.dart';
import 'package:flutter_tools/src/android/gradle_utils.dart';
import 'package:flutter_tools/src/android/java.dart';
import 'package:flutter_tools/src/base/bot_detector.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/terminal.dart';
import 'package:flutter_tools/src/project.dart';
import 'package:test/fake.dart';
import '../../src/common.dart';
import '../../src/context.dart';
import '../../src/fake_process_manager.dart';
import '../../src/fakes.dart';
void main() {
late FileSystem fileSystem;
late FakeProcessManager processManager;
setUp(() {
fileSystem = MemoryFileSystem.test();
processManager = FakeProcessManager.empty();
});
group('gradleErrors', () {
testWithoutContext('list of errors', () {
// If you added a new Gradle error, please update this test.
expect(gradleErrors,
equals(<GradleHandledError>[
licenseNotAcceptedHandler,
networkErrorHandler,
permissionDeniedErrorHandler,
flavorUndefinedHandler,
r8FailureHandler,
minSdkVersionHandler,
transformInputIssueHandler,
lockFileDepMissingHandler,
incompatibleKotlinVersionHandler,
minCompileSdkVersionHandler,
jvm11RequiredHandler,
outdatedGradleHandler,
sslExceptionHandler,
zipExceptionHandler,
incompatibleJavaAndGradleVersionsHandler,
remoteTerminatedHandshakeHandler,
couldNotOpenCacheDirectoryHandler,
])
);
});
});
group('network errors', () {
testUsingContext('retries if gradle fails while downloading', () async {
const String errorMessage = r'''
Exception in thread "main" java.io.FileNotFoundException: https://downloads.gradle.org/distributions/gradle-4.1.1-all.zip
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1872)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
expect(formatTestErrorMessage(errorMessage, networkErrorHandler), isTrue);
expect(await networkErrorHandler.handler(
line: '',
project: FakeFlutterProject(),
usesAndroidX: true,
), equals(GradleBuildStatus.retry));
expect(testLogger.errorText,
contains(
'Gradle threw an error while downloading artifacts from the network.'
)
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('retries if remote host terminated ssl handshake', () async {
const String errorMessage = r'''
Exception in thread "main" javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
at java.base/sun.security.ssl.SSLSocketImpl.handleEOF(SSLSocketImpl.java:1696)
at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1514)
at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1416)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:456)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:427)
at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:572)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:197)
at java.base/sun.net.www.protocol.http.HttpURLConnection.followRedirect0(HttpURLConnection.java:2783)
at java.base/sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:2695)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1854)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:483)
at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:472)
at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:160)
at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:111)
at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1506)''';
expect(formatTestErrorMessage(errorMessage, remoteTerminatedHandshakeHandler), isTrue);
expect(await remoteTerminatedHandshakeHandler.handler(
line: '',
project: FakeFlutterProject(),
usesAndroidX: true,
), equals(GradleBuildStatus.retry));
expect(testLogger.errorText,
contains(
'Gradle threw an error while downloading artifacts from the network.'
)
);
});
testUsingContext('retries if gradle fails downloading with proxy error', () async {
const String errorMessage = r'''
Exception in thread "main" java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 400 Bad Request"
at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2124)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1546)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
expect(formatTestErrorMessage(errorMessage, networkErrorHandler), isTrue);
expect(await networkErrorHandler.handler(
line: '',
project: FakeFlutterProject(),
usesAndroidX: true,
), equals(GradleBuildStatus.retry));
expect(testLogger.errorText,
contains(
'Gradle threw an error while downloading artifacts from the network.'
)
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('retries if gradle fails downloading with bad gateway error', () async {
const String errorMessage = r'''
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 502 for URL: https://objects.githubusercontent.com/github-production-release-asset-2e65be/696192900/1e77bbfb-4cde-4376-92ea-fc4ff57b8362?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=FFFF%2F20231220%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231220T160553Z&X-Amz-Expires=300&X-Amz-Signature=ffff&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=696192900&response-content-disposition=attachment%3B%20filename%3Dgradle-8.2.1-all.zip&response-content-type=application%2Foctet-stream
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1997)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
expect(formatTestErrorMessage(errorMessage, networkErrorHandler), isTrue);
expect(await networkErrorHandler.handler(
line: '',
project: FakeFlutterProject(),
usesAndroidX: true,
), equals(GradleBuildStatus.retry));
expect(testLogger.errorText,
contains(
'Gradle threw an error while downloading artifacts from the network.'
)
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('retries if gradle times out waiting for exclusive access to zip', () async {
const String errorMessage = '''
Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: /User/documents/gradle-5.6.2-all.zip
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:61)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
expect(formatTestErrorMessage(errorMessage, networkErrorHandler), isTrue);
expect(await networkErrorHandler.handler(
line: '',
project: FakeFlutterProject(),
usesAndroidX: true,
), equals(GradleBuildStatus.retry));
expect(testLogger.errorText,
contains(
'Gradle threw an error while downloading artifacts from the network.'
)
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('retries if remote host closes connection', () async {
const String errorMessage = r'''
Downloading https://services.gradle.org/distributions/gradle-5.6.2-all.zip
Exception in thread "main" javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:994)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.followRedirect0(HttpURLConnection.java:2729)
at sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:2641)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1824)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
expect(formatTestErrorMessage(errorMessage, networkErrorHandler), isTrue);
expect(await networkErrorHandler.handler(
line: '',
project: FakeFlutterProject(),
usesAndroidX: true,
), equals(GradleBuildStatus.retry));
expect(testLogger.errorText,
contains(
'Gradle threw an error while downloading artifacts from the network.'
)
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('retries if file opening fails', () async {
const String errorMessage = r'''
Downloading https://services.gradle.org/distributions/gradle-3.5.0-all.zip
Exception in thread "main" java.io.FileNotFoundException: https://downloads.gradle-dn.com/distributions/gradle-3.5.0-all.zip
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1890)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
expect(formatTestErrorMessage(errorMessage, networkErrorHandler), isTrue);
expect(await networkErrorHandler.handler(
line: '',
project: FakeFlutterProject(),
usesAndroidX: true,
), equals(GradleBuildStatus.retry));
expect(testLogger.errorText,
contains(
'Gradle threw an error while downloading artifacts from the network.'
)
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('retries if the connection is reset', () async {
const String errorMessage = r'''
Downloading https://services.gradle.org/distributions/gradle-5.6.2-all.zip
Exception in thread "main" java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:593)
at sun.security.ssl.InputRecord.read(InputRecord.java:532)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:975)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
expect(formatTestErrorMessage(errorMessage, networkErrorHandler), isTrue);
expect(await networkErrorHandler.handler(
line: '',
project: FakeFlutterProject(),
usesAndroidX: true,
), equals(GradleBuildStatus.retry));
expect(testLogger.errorText,
contains(
'Gradle threw an error while downloading artifacts from the network.'
)
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('retries if Gradle could not get a resource', () async {
const String errorMessage = '''
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve net.sf.proguard:proguard-gradle:6.0.3.
Required by:
project : > com.android.tools.build:gradle:3.3.0
> Could not resolve net.sf.proguard:proguard-gradle:6.0.3.
> Could not parse POM https://jcenter.bintray.com/net/sf/proguard/proguard-gradle/6.0.3/proguard-gradle-6.0.3.pom
> Could not resolve net.sf.proguard:proguard-parent:6.0.3.
> Could not resolve net.sf.proguard:proguard-parent:6.0.3.
> Could not get resource 'https://jcenter.bintray.com/net/sf/proguard/proguard-parent/6.0.3/proguard-parent-6.0.3.pom'.
> Could not GET 'https://jcenter.bintray.com/net/sf/proguard/proguard-parent/6.0.3/proguard-parent-6.0.3.pom'. Received status code 504 from server: Gateway Time-out''';
expect(formatTestErrorMessage(errorMessage, networkErrorHandler), isTrue);
expect(await networkErrorHandler.handler(
line: '',
project: FakeFlutterProject(),
usesAndroidX: true,
), equals(GradleBuildStatus.retry));
expect(testLogger.errorText,
contains(
'Gradle threw an error while downloading artifacts from the network.'
)
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('retries if Gradle could not get a resource (non-Gateway)', () async {
const String errorMessage = '''
* Error running Gradle:
Exit code 1 from: /home/travis/build/flutter/flutter sdk/examples/flutter_gallery/android/gradlew app:properties:
Starting a Gradle Daemon (subsequent builds will be faster)
Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.1.2.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.1.2.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.2/gradle-3.1.2.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.2/gradle-3.1.2.pom'.
> Remote host closed connection during handshake''';
expect(formatTestErrorMessage(errorMessage, networkErrorHandler), isTrue);
expect(await networkErrorHandler.handler(
line: '',
project: FakeFlutterProject(),
usesAndroidX: true,
), equals(GradleBuildStatus.retry));
expect(testLogger.errorText,
contains(
'Gradle threw an error while downloading artifacts from the network.'
)
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('retries if connection times out', () async {
const String errorMessage = r'''
Exception in thread "main" java.net.ConnectException: Connection timed out
java.base/sun.nio.ch.Net.connect0(Native Method)
at java.base/sun.nio.ch.Net.connect(Net.java:579)
at java.base/sun.nio.ch.Net.connect(Net.java:568)
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
at java.base/java.net.Socket.connect(Socket.java:633)
at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:299)
at java.base/sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:174)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:498)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603)
at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:380)''';
expect(formatTestErrorMessage(errorMessage, networkErrorHandler), isTrue);
expect(await networkErrorHandler.handler(
line: '',
project: FakeFlutterProject(),
usesAndroidX: true,
), equals(GradleBuildStatus.retry));
expect(testLogger.errorText,
contains(
'Gradle threw an error while downloading artifacts from the network.'
)
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
});
group('permission errors', () {
testUsingContext('throws toolExit if gradle is missing execute permissions', () async {
const String errorMessage = '''
Permission denied
Command: /home/android/gradlew assembleRelease
''';
expect(formatTestErrorMessage(errorMessage, permissionDeniedErrorHandler), isTrue);
expect(await permissionDeniedErrorHandler.handler(
usesAndroidX: true,
line: '',
project: FakeFlutterProject(),
), equals(GradleBuildStatus.exit));
expect(
testLogger.statusText,
contains('Gradle does not have execution permission.'),
);
expect(
testLogger.statusText,
contains(
'\n'
'┌─ Flutter Fix ───────────────────────────────────────────────────────────────────────────────────┐\n'
'│ [!] Gradle does not have execution permission. │\n'
'│ You should change the ownership of the project directory to your user, or move the project to a │\n'
'│ directory with execute permissions. │\n'
'└─────────────────────────────────────────────────────────────────────────────────────────────────┘\n'
)
);
});
testUsingContext('pattern', () async {
const String errorMessage = '''
Permission denied
Command: /home/android/gradlew assembleRelease
''';
expect(formatTestErrorMessage(errorMessage, permissionDeniedErrorHandler), isTrue);
});
testUsingContext('handler', () async {
expect(await permissionDeniedErrorHandler.handler(
usesAndroidX: true,
line: '',
project: FakeFlutterProject(),
), equals(GradleBuildStatus.exit));
expect(
testLogger.statusText,
contains('Gradle does not have execution permission.'),
);
expect(
testLogger.statusText,
contains(
'\n'
'┌─ Flutter Fix ───────────────────────────────────────────────────────────────────────────────────┐\n'
'│ [!] Gradle does not have execution permission. │\n'
'│ You should change the ownership of the project directory to your user, or move the project to a │\n'
'│ directory with execute permissions. │\n'
'└─────────────────────────────────────────────────────────────────────────────────────────────────┘\n'
)
);
});
});
group('license not accepted', () {
testWithoutContext('pattern', () {
expect(
licenseNotAcceptedHandler.test(
'You have not accepted the license agreements of the following SDK components'
),
isTrue,
);
});
testUsingContext('handler', () async {
await licenseNotAcceptedHandler.handler(
line: 'You have not accepted the license agreements of the following SDK components: [foo, bar]',
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
usesAndroidX: true,
);
expect(
testLogger.statusText,
contains(
'\n'
'┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────┐\n'
'│ [!] Unable to download needed Android SDK components, as the following licenses have not been │\n'
'│ accepted: foo, bar │\n'
'│ │\n'
'│ To resolve this, please run the following command in a Terminal: │\n'
'│ flutter doctor --android-licenses │\n'
'└───────────────────────────────────────────────────────────────────────────────────────────────┘\n'
)
);
});
});
group('flavor undefined', () {
testWithoutContext('pattern', () {
expect(
flavorUndefinedHandler.test(
'Task assembleFooRelease not found in root project.'
),
isTrue,
);
expect(
flavorUndefinedHandler.test(
'Task assembleBarRelease not found in root project.'
),
isTrue,
);
expect(
flavorUndefinedHandler.test(
'Task assembleBar not found in root project.'
),
isTrue,
);
expect(
flavorUndefinedHandler.test(
'Task assembleBar_foo not found in root project.'
),
isTrue,
);
});
testUsingContext('handler - with flavor', () async {
processManager.addCommand(const FakeCommand(
command: <String>[
'gradlew',
'app:tasks' ,
'--all',
'--console=auto',
],
stdout: '''
assembleRelease
assembleFlavor1
assembleFlavor1Release
assembleFlavor_2
assembleFlavor_2Release
assembleDebug
assembleProfile
assembles
assembleFooTest
''',
));
await flavorUndefinedHandler.handler(
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
usesAndroidX: true,
line: '',
);
expect(
testLogger.statusText,
contains(
'Gradle project does not define a task suitable '
'for the requested build.'
)
);
expect(
testLogger.statusText,
contains(
'\n'
'┌─ Flutter Fix ───────────────────────────────────────────────────────────────────────────────────┐\n'
'│ [!] Gradle project does not define a task suitable for the requested build. │\n'
'│ │\n'
'│ The /android/app/build.gradle file defines product flavors: flavor1, flavor_2. You must specify │\n'
'│ a --flavor option to select one of them. │\n'
'└─────────────────────────────────────────────────────────────────────────────────────────────────┘\n'
)
);
expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
Java: () => FakeJava(),
GradleUtils: () => FakeGradleUtils(),
Platform: () => fakePlatform('android'),
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('handler - without flavor', () async {
processManager.addCommand(const FakeCommand(
command: <String>[
'gradlew',
'app:tasks' ,
'--all',
'--console=auto',
],
stdout: '''
assembleRelease
assembleDebug
assembleProfile
''',
));
await flavorUndefinedHandler.handler(
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
usesAndroidX: true,
line: '',
);
expect(
testLogger.statusText,
contains(
'\n'
'┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────┐\n'
'│ [!] Gradle project does not define a task suitable for the requested build. │\n'
'│ │\n'
'│ The /android/app/build.gradle file does not define any custom product flavors. You cannot use │\n'
'│ the --flavor option. │\n'
'└───────────────────────────────────────────────────────────────────────────────────────────────┘\n'
)
);
expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
Java: () => FakeJava(),
GradleUtils: () => FakeGradleUtils(),
Platform: () => fakePlatform('android'),
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
});
group('higher minSdkVersion', () {
const String stdoutLine = 'uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [:webview_flutter] /tmp/cirrus-ci-build/all_plugins/build/webview_flutter/intermediates/library_manifest/release/AndroidManifest.xml as the library might be using APIs not available in 21';
testWithoutContext('pattern', () {
expect(
minSdkVersionHandler.test(stdoutLine),
isTrue,
);
});
testUsingContext('suggestion', () async {
await minSdkVersionHandler.handler(
line: stdoutLine,
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
usesAndroidX: true,
);
expect(
testLogger.statusText,
contains(
'\n'
'┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────┐\n'
'│ The plugin webview_flutter requires a higher Android SDK version. │\n'
'│ Fix this issue by adding the following to the file /android/app/build.gradle: │\n'
'│ android { │\n'
'│ defaultConfig { │\n'
'│ minSdkVersion 21 │\n'
'│ } │\n'
'│ } │\n'
'│ │\n'
'│ Following this change, your app will not be available to users running Android SDKs below 21. │\n'
'│ Consider searching for a version of this plugin that supports these lower versions of the │\n'
'│ Android SDK instead. │\n'
'│ For more information, see: │\n'
'│ https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration │\n'
'└───────────────────────────────────────────────────────────────────────────────────────────────┘\n'
)
);
}, overrides: <Type, Generator>{
GradleUtils: () => FakeGradleUtils(),
Platform: () => fakePlatform('android'),
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
});
// https://issuetracker.google.com/issues/141126614
group('transform input issue', () {
testWithoutContext('pattern', () {
expect(
transformInputIssueHandler.test(
'https://issuetracker.google.com/issues/158753935'
),
isTrue,
);
});
testUsingContext('suggestion', () async {
await transformInputIssueHandler.handler(
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
usesAndroidX: true,
line: '',
);
expect(
testLogger.statusText,
contains(
'\n'
'┌─ Flutter Fix ─────────────────────────────────────────────────────────────────┐\n'
'│ This issue appears to be https://github.com/flutter/flutter/issues/58247. │\n'
'│ Fix this issue by adding the following to the file /android/app/build.gradle: │\n'
'│ android { │\n'
'│ lintOptions { │\n'
'│ checkReleaseBuilds false │\n'
'│ } │\n'
'│ } │\n'
'└───────────────────────────────────────────────────────────────────────────────┘\n'
)
);
}, overrides: <Type, Generator>{
GradleUtils: () => FakeGradleUtils(),
Platform: () => fakePlatform('android'),
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
});
group('Dependency mismatch', () {
testWithoutContext('pattern', () {
expect(
lockFileDepMissingHandler.test('''
* What went wrong:
Execution failed for task ':app:generateDebugFeatureTransitiveDeps'.
> Could not resolve all artifacts for configuration ':app:debugRuntimeClasspath'.
> Resolved 'androidx.lifecycle:lifecycle-common:2.2.0' which is not part of the dependency lock state
> Resolved 'androidx.customview:customview:1.0.0' which is not part of the dependency lock state'''
),
isTrue,
);
});
testUsingContext('suggestion', () async {
await lockFileDepMissingHandler.handler(
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
usesAndroidX: true,
line: '',
);
expect(
testLogger.statusText,
contains(
'\n'
'┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────┐\n'
'│ You need to update the lockfile, or disable Gradle dependency locking. │\n'
'│ To regenerate the lockfiles run: `./gradlew :generateLockfiles` in /android/build.gradle │\n'
'│ To remove dependency locking, remove the `dependencyLocking` from /android/build.gradle │\n'
'└──────────────────────────────────────────────────────────────────────────────────────────┘\n'
)
);
}, overrides: <Type, Generator>{
GradleUtils: () => FakeGradleUtils(),
Platform: () => fakePlatform('android'),
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
});
group('Incompatible Kotlin version', () {
testWithoutContext('pattern', () {
expect(
incompatibleKotlinVersionHandler.test('Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.'),
isTrue,
);
expect(
incompatibleKotlinVersionHandler.test("class 'kotlin.Unit' was compiled with an incompatible version of Kotlin."),
isTrue,
);
});
testUsingContext('suggestion', () async {
await incompatibleKotlinVersionHandler.handler(
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
usesAndroidX: true,
line: '',
);
expect(
testLogger.statusText,
contains(
'\n'
'┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────┐\n'
'│ [!] Your project requires a newer version of the Kotlin Gradle plugin. │\n'
'│ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then │\n'
'│ update /android/build.gradle: │\n'
"│ ext.kotlin_version = '<latest-version>' │\n"
'└────────────────────────────────────────────────────────────────────────────────────────────┘\n'
)
);
}, overrides: <Type, Generator>{
GradleUtils: () => FakeGradleUtils(),
Platform: () => fakePlatform('android'),
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
});
group('Bump Gradle', () {
const String errorMessage = '''
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'kotlin-android']
> The current Gradle version 4.10.2 is not compatible with the Kotlin Gradle plugin. Please use Gradle 6.1.1 or newer, or the previous version of the Kotlin plugin.
''';
testWithoutContext('pattern', () {
expect(
outdatedGradleHandler.test(errorMessage),
isTrue,
);
});
testUsingContext('suggestion', () async {
await outdatedGradleHandler.handler(
line: errorMessage,
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
usesAndroidX: true,
);
expect(
testLogger.statusText,
contains(
'\n'
'┌─ Flutter Fix ────────────────────────────────────────────────────────────────────┐\n'
'│ [!] Your project needs to upgrade Gradle and the Android Gradle plugin. │\n'
'│ │\n'
'│ To fix this issue, replace the following content: │\n'
'│ /android/build.gradle: │\n'
"│ - classpath 'com.android.tools.build:gradle:<current-version>' │\n"
"│ + classpath 'com.android.tools.build:gradle:7.3.0' │\n"
'│ /android/gradle/wrapper/gradle-wrapper.properties: │\n'
'│ - https://services.gradle.org/distributions/gradle-<current-version>-all.zip │\n'
'│ + https://services.gradle.org/distributions/gradle-7.6.3-all.zip │\n'
'└──────────────────────────────────────────────────────────────────────────────────┘\n'
)
);
}, overrides: <Type, Generator>{
GradleUtils: () => FakeGradleUtils(),
Platform: () => fakePlatform('android'),
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
});
group('Required compileSdkVersion', () {
const String errorMessage = '''
Execution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
> One or more issues found when checking AAR metadata values:
The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.window:window-java:1.0.0-beta04.
AAR metadata file: ~/.gradle/caches/transforms-3/2adc32c5b3f24bed763d33fbfb203338/transformed/jetified-window-java-1.0.0-beta04/META-INF/com/android/build/gradle/aar-metadata.properties.
The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.window:window:1.0.0-beta04.
AAR metadata file: ~/.gradle/caches/transforms-3/88f7e476ef68cecca729426edff955b5/transformed/jetified-window-1.0.0-beta04/META-INF/com/android/build/gradle/aar-metadata.properties.
''';
testWithoutContext('pattern', () {
expect(
minCompileSdkVersionHandler.test(errorMessage),
isTrue,
);
});
testUsingContext('suggestion', () async {
await minCompileSdkVersionHandler.handler(
line: errorMessage,
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
usesAndroidX: true,
);
expect(
testLogger.statusText,
contains(
'\n'
'┌─ Flutter Fix ──────────────────────────────────────────────────────────────────┐\n'
'│ [!] Your project requires a higher compileSdk version. │\n'
'│ Fix this issue by bumping the compileSdk version in /android/app/build.gradle: │\n'
'│ android { │\n'
'│ compileSdk 31 │\n'
'│ } │\n'
'└────────────────────────────────────────────────────────────────────────────────┘\n'
)
);
}, overrides: <Type, Generator>{
GradleUtils: () => FakeGradleUtils(),
Platform: () => fakePlatform('android'),
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
});
group('Java 11 requirement', () {
testWithoutContext('pattern', () {
expect(
jvm11RequiredHandler.test('''
* What went wrong:
A problem occurred evaluating project ':flutter'.
> Failed to apply plugin 'com.android.internal.library'.
> Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing `org.gradle.java.home` in `gradle.properties`.'''
),
isTrue,
);
});
testUsingContext('suggestion', () async {
await jvm11RequiredHandler.handler(
project: FakeFlutterProject(),
usesAndroidX: true,
line: '',
);
expect(
testLogger.statusText,
contains(
'\n'
'┌─ Flutter Fix ─────────────────────────────────────────────────────────────────┐\n'
'│ [!] You need Java 11 or higher to build your app with this version of Gradle. │\n'
'│ │\n'
'│ To get Java 11, update to the latest version of Android Studio on │\n'
'│ https://developer.android.com/studio/install. │\n'
'│ │\n'
'│ To check the Java version used by Flutter, run `flutter doctor -v`. │\n'
'└───────────────────────────────────────────────────────────────────────────────┘\n'
)
);
}, overrides: <Type, Generator>{
GradleUtils: () => FakeGradleUtils(),
Platform: () => fakePlatform('android'),
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
});
group('SSLException', () {
testWithoutContext('pattern', () {
expect(
sslExceptionHandler.test(r'''
Exception in thread "main" javax.net.ssl.SSLException: Tag mismatch!
at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:129)
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:321)
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:264)
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:259)
at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:129)
at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1155)
at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1125)
at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:823)
at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:290)
at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:351)
at java.base/sun.net.www.MeteredStream.read(MeteredStream.java:134)
at java.base/java.io.FilterInputStream.read(FilterInputStream.java:133)
at java.base/sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3444)
at java.base/sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3437)
at org.gradle.wrapper.Download.downloadInternal(Download.java:62)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)'''
),
isTrue,
);
expect(
sslExceptionHandler.test(r'''
Caused by: javax.crypto.AEADBadTagException: Tag mismatch!
at java.base/com.sun.crypto.provider.GaloisCounterMode.decryptFinal(GaloisCounterMode.java:580)
at java.base/com.sun.crypto.provider.CipherCore.finalNoPadding(CipherCore.java:1049)
at java.base/com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:985)
at java.base/com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:491)
at java.base/javax.crypto.CipherSpi.bufferCrypt(CipherSpi.java:779)
at java.base/javax.crypto.CipherSpi.engineDoFinal(CipherSpi.java:730)
at java.base/javax.crypto.Cipher.doFinal(Cipher.java:2497)
at java.base/sun.security.ssl.SSLCipher$T12GcmReadCipherGenerator$GcmReadCipher.decrypt(SSLCipher.java:1613)
at java.base/sun.security.ssl.SSLSocketInputRecord.decodeInputRecord(SSLSocketInputRecord.java:262)
at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:190)
at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:108)'''
),
isTrue,
);
});
testUsingContext('suggestion', () async {
final GradleBuildStatus status = await sslExceptionHandler.handler(
project: FakeFlutterProject(),
usesAndroidX: true,
line: '',
);
expect(status, GradleBuildStatus.retry);
expect(testLogger.errorText,
contains(
'Gradle threw an error while downloading artifacts from the network.'
)
);
}, overrides: <Type, Generator>{
GradleUtils: () => FakeGradleUtils(),
Platform: () => fakePlatform('android'),
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
});
group('Zip exception', () {
testWithoutContext('pattern', () {
expect(
zipExceptionHandler.test(r'''
Exception in thread "main" java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:225)
at java.util.zip.ZipFile.(ZipFile.java:155)
at java.util.zip.ZipFile.(ZipFile.java:169)
at org.gradle.wrapper.Install.unzip(Install.java:214)
at org.gradle.wrapper.Install.access$600(Install.java:27)
at org.gradle.wrapper.Install$1.call(Install.java:74)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)'''
),
isTrue,
);
});
testUsingContext('suggestion', () async {
fileSystem.file('foo/.gradle/fizz.zip').createSync(recursive: true);
final GradleBuildStatus result = await zipExceptionHandler.handler(
project: FakeFlutterProject(),
usesAndroidX: true,
line: '',
);
expect(result, equals(GradleBuildStatus.retry));
expect(fileSystem.file('foo/.gradle/fizz.zip'), exists);
expect(
testLogger.errorText,
contains(
'[!] Your .gradle directory under the home directory might be corrupted.\n'
)
);
expect(testLogger.statusText, '');
}, overrides: <Type, Generator>{
Platform: () => FakePlatform(environment: <String, String>{'HOME': 'foo/'}),
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
BotDetector: () => const FakeBotDetector(false),
});
testUsingContext('suggestion if running as bot', () async {
fileSystem.file('foo/.gradle/fizz.zip').createSync(recursive: true);
final GradleBuildStatus result = await zipExceptionHandler.handler(
project: FakeFlutterProject(),
usesAndroidX: true,
line: '',
);
expect(result, equals(GradleBuildStatus.retry));
expect(fileSystem.file('foo/.gradle/fizz.zip'), isNot(exists));
expect(
testLogger.errorText,
contains(
'[!] Your .gradle directory under the home directory might be corrupted.\n'
)
);
expect(
testLogger.statusText,
contains('Deleting foo/.gradle\n'),
);
}, overrides: <Type, Generator>{
Platform: () => FakePlatform(environment: <String, String>{'HOME': 'foo/'}),
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
BotDetector: () => const FakeBotDetector(true),
});
testUsingContext('suggestion if stdin has terminal and user entered y', () async {
fileSystem.file('foo/.gradle/fizz.zip').createSync(recursive: true);
final GradleBuildStatus result = await zipExceptionHandler.handler(
line: '',
usesAndroidX: true,
project: FakeFlutterProject(),
);
expect(result, equals(GradleBuildStatus.retry));
expect(fileSystem.file('foo/.gradle/fizz.zip'), isNot(exists));
expect(
testLogger.errorText,
contains(
'[!] Your .gradle directory under the home directory might be corrupted.\n'
)
);
expect(
testLogger.statusText,
contains('Deleting foo/.gradle\n'),
);
}, overrides: <Type, Generator>{
Platform: () => FakePlatform(environment: <String, String>{'HOME': 'foo/'}),
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
AnsiTerminal: () => _TestPromptTerminal('y'),
BotDetector: () => const FakeBotDetector(false),
});
testUsingContext('suggestion if stdin has terminal and user entered n', () async {
fileSystem.file('foo/.gradle/fizz.zip').createSync(recursive: true);
final GradleBuildStatus result = await zipExceptionHandler.handler(
line: '',
usesAndroidX: true,
project: FakeFlutterProject(),
);
expect(result, equals(GradleBuildStatus.retry));
expect(fileSystem.file('foo/.gradle/fizz.zip'), exists);
expect(
testLogger.errorText,
contains(
'[!] Your .gradle directory under the home directory might be corrupted.\n'
)
);
expect(testLogger.statusText, '');
}, overrides: <Type, Generator>{
Platform: () => FakePlatform(environment: <String, String>{'HOME': 'foo/'}),
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
AnsiTerminal: () => _TestPromptTerminal('n'),
BotDetector: () => const FakeBotDetector(false),
});
});
group('incompatible java and gradle versions error', () {
const String errorMessage = '''
Could not compile build file '…/example/android/build.gradle'.
> startup failed:
General error during conversion: Unsupported class file major version 61
java.lang.IllegalArgumentException: Unsupported class file major version 61
''';
testWithoutContext('pattern', () {
expect(
incompatibleJavaAndGradleVersionsHandler.test(errorMessage),
isTrue,
);
});
testUsingContext('suggestion', () async {
await incompatibleJavaAndGradleVersionsHandler.handler(
line: errorMessage,
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
usesAndroidX: true,
);
// Ensure the error notes the incompatible Gradle/AGP/Java versions, links to related resources,
// and a portion of the path to where to change their gradle version.
expect(testLogger.statusText, contains('Gradle version is incompatible with the Java version'));
expect(testLogger.statusText, contains('docs.flutter.dev/go/android-java-gradle-error'));
expect(testLogger.statusText, contains('gradle-wrapper.properties'));
expect(testLogger.statusText, contains('https://docs.gradle.org/current/userguide/compatibility.html#java'));
}, overrides: <Type, Generator>{
GradleUtils: () => FakeGradleUtils(),
Platform: () => fakePlatform('android'),
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
});
testUsingContext('couldNotOpenCacheDirectoryHandler', () async {
final GradleBuildStatus status = await couldNotOpenCacheDirectoryHandler.handler(
line: '''
FAILURE: Build failed with an exception.
* Where:
Script '/Volumes/Work/s/w/ir/x/w/flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy' line: 276
* What went wrong:
A problem occurred evaluating script.
> Failed to apply plugin class 'FlutterPlugin'.
> Could not open cache directory 41rl0ui7kgmsyfwn97o2jypl6 (/Volumes/Work/s/w/ir/cache/gradle/caches/6.7/gradle-kotlin-dsl/41rl0ui7kgmsyfwn97o2jypl6).
> Failed to create Jar file /Volumes/Work/s/w/ir/cache/gradle/caches/6.7/generated-gradle-jars/gradle-api-6.7.jar.''',
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
usesAndroidX: true,
);
expect(testLogger.errorText, contains('Gradle threw an error while resolving dependencies'));
expect(status, GradleBuildStatus.retry);
}, overrides: <Type, Generator>{
GradleUtils: () => FakeGradleUtils(),
Platform: () => fakePlatform('android'),
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
}
bool formatTestErrorMessage(String errorMessage, GradleHandledError error) {
return errorMessage
.split('\n')
.any((String line) => error.test(line));
}
Platform fakePlatform(String name) {
return FakePlatform(
environment: <String, String>{
'HOME': '/',
},
operatingSystem: name,
);
}
class FakeGradleUtils extends Fake implements GradleUtils {
@override
String getExecutable(FlutterProject project) {
return 'gradlew';
}
}
/// Simple terminal that returns the specified string when
/// promptForCharInput is called.
class _TestPromptTerminal extends Fake implements AnsiTerminal {
_TestPromptTerminal(this.promptResult);
final String promptResult;
@override
bool get stdinHasTerminal => true;
@override
Future<String> promptForCharInput(
List<String> acceptedCharacters, {
required Logger logger,
String? prompt,
int? defaultChoiceIndex,
bool displayAcceptedCharacters = true,
}) {
return Future<String>.value(promptResult);
}
}
class FakeFlutterProject extends Fake implements FlutterProject {}
| flutter/packages/flutter_tools/test/general.shard/android/gradle_errors_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/android/gradle_errors_test.dart",
"repo_id": "flutter",
"token_count": 23432
} | 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:file/memory.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/cache.dart';
import 'package:flutter_tools/src/project.dart';
// We aren't using this to construct paths—only to expose a type.
import 'package:path/path.dart' show Style; // flutter_ignore: package_path_import
import '../src/common.dart';
void main() {
final Style posix = Style.posix;
final Style windows = Style.windows;
final List<Style> styles = <Style>[posix, windows];
for (final Style style in styles) {
group('Assets (${style.name} file system)', () {
late FileSystem fileSystem;
late BufferLogger logger;
late Platform platform;
late String flutterRoot;
setUp(() {
fileSystem = MemoryFileSystem(
style: style == Style.posix ? FileSystemStyle.posix : FileSystemStyle.windows,
);
logger = BufferLogger.test();
platform = FakePlatform(
operatingSystem: style == Style.posix ? 'linux' : 'windows');
flutterRoot = Cache.defaultFlutterRoot(
platform: platform,
fileSystem: fileSystem,
userMessages: UserMessages(),
);
});
testWithoutContext('app font uses local font file', () async {
final String packagesPath = fileSystem.path.join('main', '.packages');
final String manifestPath =
fileSystem.path.join('main', 'pubspec.yaml');
final ManifestAssetBundle assetBundle = ManifestAssetBundle(
logger: logger,
fileSystem: fileSystem,
platform: platform,
splitDeferredAssets: true,
flutterRoot: flutterRoot,
);
fileSystem.file(fileSystem.path.join('font', 'pubspec.yaml'))
..createSync(recursive: true)
..writeAsStringSync(r'''
name: font
description: A test project that contains a font.
environment:
sdk: '>=3.2.0-0 <4.0.0'
flutter:
uses-material-design: true
fonts:
- family: test_font
fonts:
- asset: test_font_file
''');
fileSystem.file(fileSystem.path.join('font', 'test_font_file'))
..createSync(recursive: true)
..writeAsStringSync('This is a fake font.');
fileSystem.file(
fileSystem.path.join('main', '.dart_tool', 'package_config.json'))
..createSync(recursive: true)
..writeAsStringSync(r'''
{
"configVersion": 2,
"packages": [
{
"name": "font",
"rootUri": "../../font",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "main",
"rootUri": "../",
"packageUri": "lib/",
"languageVersion": "3.2"
}
],
"generated": "2024-01-08T19:39:02.396620Z",
"generator": "pub",
"generatorVersion": "3.3.0-276.0.dev"
}
''');
fileSystem.file(manifestPath)
..createSync(recursive: true)
..writeAsStringSync(r'''
name: main
description: A test project that has a package with a font as a dependency.
environment:
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
font:
path: ../font
''');
await assetBundle.build(
packagesPath: packagesPath,
manifestPath: manifestPath,
flutterProject: FlutterProject.fromDirectoryTest(fileSystem.directory('main')),
);
expect(assetBundle.entries, contains('FontManifest.json'));
expect(
await _getValueAsString('FontManifest.json', assetBundle),
'[{"family":"packages/font/test_font","fonts":[{"asset":"packages/font/test_font_file"}]}]',
);
expect(assetBundle.wasBuiltOnce(), true);
expect(
assetBundle.inputFiles.map((File f) => f.path),
equals(<String>[
packagesPath,
fileSystem.path.join(fileSystem.currentDirectory.path, 'font', 'pubspec.yaml'),
fileSystem.path.join(fileSystem.currentDirectory.path, manifestPath),
fileSystem.path.join(fileSystem.currentDirectory.path,'font', 'test_font_file'),
]),
);
});
testWithoutContext('handles empty pubspec with .packages', () async {
final String packagesPath = fileSystem.path.join('fuchsia_test', 'main', '.packages');
final String manifestPath =
fileSystem.path.join('fuchsia_test', 'main', 'pubspec.yaml');
fileSystem.directory(fileSystem.file(manifestPath)).parent.createSync(recursive: true);
fileSystem.directory(fileSystem.file(packagesPath)).parent.createSync(recursive: true);
final ManifestAssetBundle assetBundle = ManifestAssetBundle(
logger: logger,
fileSystem: fileSystem,
platform: platform,
splitDeferredAssets: true,
flutterRoot: flutterRoot,
);
await assetBundle.build(
manifestPath: manifestPath, // file doesn't exist
packagesPath: packagesPath,
flutterProject: FlutterProject.fromDirectoryTest(fileSystem.file(manifestPath).parent),
);
expect(assetBundle.wasBuiltOnce(), true);
expect(
assetBundle.inputFiles.map((File f) => f.path),
<String>[],
);
});
testWithoutContext('bundles material shaders on non-web platforms',
() async {
final String shaderPath = fileSystem.path.join(
flutterRoot,
'packages',
'flutter',
'lib',
'src',
'material',
'shaders',
'ink_sparkle.frag',
);
fileSystem.file(shaderPath).createSync(recursive: true);
fileSystem.file(fileSystem.path.join('.dart_tool', 'package_config.json'))
..createSync(recursive: true)
..writeAsStringSync(r'''
{
"configVersion": 2,
"packages":[
{
"name": "my_package",
"rootUri": "file:///",
"packageUri": "lib/",
"languageVersion": "2.17"
}
]
}
''');
fileSystem.file('pubspec.yaml').writeAsStringSync('name: my_package');
final ManifestAssetBundle assetBundle = ManifestAssetBundle(
logger: logger,
fileSystem: fileSystem,
platform: platform,
flutterRoot: flutterRoot,
);
await assetBundle.build(
packagesPath: '.packages',
targetPlatform: TargetPlatform.android_arm,
flutterProject: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
);
expect(assetBundle.entries.keys, contains('shaders/ink_sparkle.frag'));
});
testWithoutContext('bundles material shaders on web platforms',
() async {
final String shaderPath = fileSystem.path.join(
flutterRoot,
'packages',
'flutter',
'lib',
'src',
'material',
'shaders',
'ink_sparkle.frag',
);
fileSystem.file(shaderPath).createSync(recursive: true);
fileSystem.file(fileSystem.path.join('.dart_tool', 'package_config.json'))
..createSync(recursive: true)
..writeAsStringSync(r'''
{
"configVersion": 2,
"packages":[
{
"name": "my_package",
"rootUri": "file:///",
"packageUri": "lib/",
"languageVersion": "2.17"
}
]
}
''');
fileSystem.file('pubspec.yaml').writeAsStringSync('name: my_package');
final ManifestAssetBundle assetBundle = ManifestAssetBundle(
logger: logger,
fileSystem: fileSystem,
platform: platform,
flutterRoot: flutterRoot,
);
await assetBundle.build(
packagesPath: '.packages',
targetPlatform: TargetPlatform.web_javascript,
flutterProject: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
);
expect(assetBundle.entries.keys, contains('shaders/ink_sparkle.frag'));
});
});
}
}
Future<String> _getValueAsString(String key, AssetBundle asset) async {
return String.fromCharCodes(await asset.entries[key]!.contentsAsBytes());
}
| flutter/packages/flutter_tools/test/general.shard/asset_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/asset_test.dart",
"repo_id": "flutter",
"token_count": 3617
} | 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:archive/archive.dart';
import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:file_testing/file_testing.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/os.dart';
import 'package:flutter_tools/src/base/platform.dart';
import '../../src/common.dart';
import '../../src/fake_process_manager.dart';
const String kExecutable = 'foo';
const String kPath1 = '/bar/bin/$kExecutable';
const String kPath2 = '/another/bin/$kExecutable';
void main() {
late FakeProcessManager fakeProcessManager;
setUp(() {
fakeProcessManager = FakeProcessManager.empty();
});
OperatingSystemUtils createOSUtils(Platform platform) {
return OperatingSystemUtils(
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
platform: platform,
processManager: fakeProcessManager,
);
}
group('which on POSIX', () {
testWithoutContext('returns null when executable does not exist', () async {
fakeProcessManager.addCommand(
const FakeCommand(
command: <String>[
'which',
kExecutable,
],
exitCode: 1,
),
);
final OperatingSystemUtils utils = createOSUtils(FakePlatform());
expect(utils.which(kExecutable), isNull);
});
testWithoutContext('returns exactly one result', () async {
fakeProcessManager.addCommand(
const FakeCommand(
command: <String>[
'which',
'foo',
],
stdout: kPath1,
),
);
final OperatingSystemUtils utils = createOSUtils(FakePlatform());
expect(utils.which(kExecutable)!.path, kPath1);
});
testWithoutContext('returns all results for whichAll', () async {
fakeProcessManager.addCommand(
const FakeCommand(
command: <String>[
'which',
'-a',
kExecutable,
],
stdout: '$kPath1\n$kPath2',
),
);
final OperatingSystemUtils utils = createOSUtils(FakePlatform());
final List<File> result = utils.whichAll(kExecutable);
expect(result, hasLength(2));
expect(result[0].path, kPath1);
expect(result[1].path, kPath2);
});
});
group('which on Windows', () {
testWithoutContext('throws tool exit if where.exe cannot be run', () async {
fakeProcessManager.excludedExecutables.add('where');
final OperatingSystemUtils utils = OperatingSystemUtils(
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
platform: FakePlatform(operatingSystem: 'windows'),
processManager: fakeProcessManager,
);
expect(() => utils.which(kExecutable), throwsToolExit());
});
testWithoutContext('returns null when executable does not exist', () async {
fakeProcessManager.addCommand(
const FakeCommand(
command: <String>[
'where',
kExecutable,
],
exitCode: 1,
),
);
final OperatingSystemUtils utils = createOSUtils(FakePlatform(operatingSystem: 'windows'));
expect(utils.which(kExecutable), isNull);
});
testWithoutContext('returns exactly one result', () async {
fakeProcessManager.addCommand(
const FakeCommand(
command: <String>[
'where',
'foo',
],
stdout: '$kPath1\n$kPath2',
),
);
final OperatingSystemUtils utils = createOSUtils(FakePlatform(operatingSystem: 'windows'));
expect(utils.which(kExecutable)!.path, kPath1);
});
testWithoutContext('returns all results for whichAll', () async {
fakeProcessManager.addCommand(
const FakeCommand(
command: <String>[
'where',
kExecutable,
],
stdout: '$kPath1\n$kPath2',
),
);
final OperatingSystemUtils utils = createOSUtils(FakePlatform(operatingSystem: 'windows'));
final List<File> result = utils.whichAll(kExecutable);
expect(result, hasLength(2));
expect(result[0].path, kPath1);
expect(result[1].path, kPath2);
});
});
group('host platform', () {
testWithoutContext('unknown defaults to Linux', () async {
fakeProcessManager.addCommand(
const FakeCommand(
command: <String>[
'uname',
'-m',
],
stdout: 'x86_64',
),
);
final OperatingSystemUtils utils =
createOSUtils(FakePlatform(operatingSystem: 'fuchsia'));
expect(utils.hostPlatform, HostPlatform.linux_x64);
});
testWithoutContext('Windows default', () async {
final OperatingSystemUtils utils =
createOSUtils(FakePlatform(operatingSystem: 'windows'));
expect(utils.hostPlatform, HostPlatform.windows_x64);
});
testWithoutContext('Linux x64', () async {
fakeProcessManager.addCommand(
const FakeCommand(
command: <String>[
'uname',
'-m',
],
stdout: 'x86_64',
),
);
final OperatingSystemUtils utils =
createOSUtils(FakePlatform());
expect(utils.hostPlatform, HostPlatform.linux_x64);
});
testWithoutContext('Linux ARM', () async {
fakeProcessManager.addCommand(
const FakeCommand(
command: <String>[
'uname',
'-m',
],
stdout: 'aarch64',
),
);
final OperatingSystemUtils utils =
createOSUtils(FakePlatform());
expect(utils.hostPlatform, HostPlatform.linux_arm64);
});
testWithoutContext('macOS ARM', () async {
fakeProcessManager.addCommands(
<FakeCommand>[
const FakeCommand(
command: <String>[
'which',
'sysctl',
],
),
const FakeCommand(
command: <String>[
'sysctl',
'hw.optional.arm64',
],
stdout: 'hw.optional.arm64: 1',
),
],
);
final OperatingSystemUtils utils =
createOSUtils(FakePlatform(operatingSystem: 'macos'));
expect(utils.hostPlatform, HostPlatform.darwin_arm64);
});
testWithoutContext('macOS 11 x86', () async {
fakeProcessManager.addCommands(
<FakeCommand>[
const FakeCommand(
command: <String>[
'which',
'sysctl',
],
),
const FakeCommand(
command: <String>[
'sysctl',
'hw.optional.arm64',
],
stdout: 'hw.optional.arm64: 0',
),
],
);
final OperatingSystemUtils utils =
createOSUtils(FakePlatform(operatingSystem: 'macos'));
expect(utils.hostPlatform, HostPlatform.darwin_x64);
});
testWithoutContext('sysctl not found', () async {
fakeProcessManager.addCommands(
<FakeCommand>[
const FakeCommand(
command: <String>[
'which',
'sysctl',
],
exitCode: 1,
),
],
);
final OperatingSystemUtils utils =
createOSUtils(FakePlatform(operatingSystem: 'macos'));
expect(() => utils.hostPlatform, throwsToolExit(message: 'sysctl'));
});
testWithoutContext('macOS 10 x86', () async {
fakeProcessManager.addCommands(
<FakeCommand>[
const FakeCommand(
command: <String>[
'which',
'sysctl',
],
),
const FakeCommand(
command: <String>[
'sysctl',
'hw.optional.arm64',
],
exitCode: 1,
),
],
);
final OperatingSystemUtils utils =
createOSUtils(FakePlatform(operatingSystem: 'macos'));
expect(utils.hostPlatform, HostPlatform.darwin_x64);
});
testWithoutContext('macOS ARM name', () async {
fakeProcessManager.addCommands(<FakeCommand>[
const FakeCommand(
command: <String>[
'sw_vers',
'-productName',
],
stdout: 'product',
),
const FakeCommand(
command: <String>[
'sw_vers',
'-productVersion',
],
stdout: 'version',
),
const FakeCommand(
command: <String>[
'sw_vers',
'-buildVersion',
],
stdout: 'build',
),
const FakeCommand(
command: <String>[
'uname',
'-m',
],
stdout: 'arm64',
),
const FakeCommand(
command: <String>[
'which',
'sysctl',
],
),
const FakeCommand(
command: <String>[
'sysctl',
'hw.optional.arm64',
],
stdout: 'hw.optional.arm64: 1',
),
]);
final OperatingSystemUtils utils =
createOSUtils(FakePlatform(operatingSystem: 'macos'));
expect(utils.name, 'product version build darwin-arm64');
});
testWithoutContext('macOS ARM on Rosetta name', () async {
fakeProcessManager.addCommands(<FakeCommand>[
const FakeCommand(
command: <String>[
'sw_vers',
'-productName',
],
stdout: 'product',
),
const FakeCommand(
command: <String>[
'sw_vers',
'-productVersion',
],
stdout: 'version',
),
const FakeCommand(
command: <String>[
'sw_vers',
'-buildVersion',
],
stdout: 'build',
),
const FakeCommand(
command: <String>[
'uname',
'-m',
],
stdout: 'x86_64', // Running on Rosetta
),
const FakeCommand(
command: <String>[
'which',
'sysctl',
],
),
const FakeCommand(
command: <String>[
'sysctl',
'hw.optional.arm64',
],
stdout: 'hw.optional.arm64: 1',
),
]);
final OperatingSystemUtils utils =
createOSUtils(FakePlatform(operatingSystem: 'macos'));
expect(utils.name, 'product version build darwin-arm64 (Rosetta)');
});
testWithoutContext('macOS x86 name', () async {
fakeProcessManager.addCommands(<FakeCommand>[
const FakeCommand(
command: <String>[
'sw_vers',
'-productName',
],
stdout: 'product',
),
const FakeCommand(
command: <String>[
'sw_vers',
'-productVersion',
],
stdout: 'version',
),
const FakeCommand(
command: <String>[
'sw_vers',
'-buildVersion',
],
stdout: 'build',
),
const FakeCommand(
command: <String>[
'uname',
'-m',
],
stdout: 'x86_64',
),
const FakeCommand(
command: <String>[
'which',
'sysctl',
],
),
const FakeCommand(
command: <String>[
'sysctl',
'hw.optional.arm64',
],
exitCode: 1,
),
]);
final OperatingSystemUtils utils =
createOSUtils(FakePlatform(operatingSystem: 'macos'));
expect(utils.name, 'product version build darwin-x64');
});
testWithoutContext('Windows name', () async {
fakeProcessManager.addCommands(<FakeCommand>[
const FakeCommand(
command: <String>[
'ver',
],
stdout: 'version',
),
]);
final OperatingSystemUtils utils =
createOSUtils(FakePlatform(operatingSystem: 'windows'));
expect(utils.name, 'version');
});
testWithoutContext('Linux name', () async {
const String fakeOsRelease = '''
NAME="Name"
ID=id
ID_LIKE=id_like
BUILD_ID=build_id
PRETTY_NAME="Pretty Name"
ANSI_COLOR="ansi color"
HOME_URL="https://home.url/"
DOCUMENTATION_URL="https://documentation.url/"
SUPPORT_URL="https://support.url/"
BUG_REPORT_URL="https://bug.report.url/"
LOGO=logo
''';
final FileSystem fileSystem = MemoryFileSystem.test();
fileSystem.directory('/etc').createSync();
fileSystem.file('/etc/os-release').writeAsStringSync(fakeOsRelease);
final OperatingSystemUtils utils = OperatingSystemUtils(
fileSystem: fileSystem,
logger: BufferLogger.test(),
platform: FakePlatform(
operatingSystemVersion: 'Linux 1.2.3-abcd #1 SMP PREEMPT Sat Jan 1 00:00:00 UTC 2000',
),
processManager: fakeProcessManager,
);
expect(utils.name, 'Pretty Name 1.2.3-abcd');
});
testWithoutContext('Linux name reads from "/usr/lib/os-release" if "/etc/os-release" is missing', () async {
const String fakeOsRelease = '''
NAME="Name"
ID=id
ID_LIKE=id_like
BUILD_ID=build_id
PRETTY_NAME="Pretty Name"
ANSI_COLOR="ansi color"
HOME_URL="https://home.url/"
DOCUMENTATION_URL="https://documentation.url/"
SUPPORT_URL="https://support.url/"
BUG_REPORT_URL="https://bug.report.url/"
LOGO=logo
''';
final FileSystem fileSystem = MemoryFileSystem.test();
fileSystem.directory('/usr/lib').createSync(recursive: true);
fileSystem.file('/usr/lib/os-release').writeAsStringSync(fakeOsRelease);
expect(fileSystem.file('/etc/os-release').existsSync(), false);
final OperatingSystemUtils utils = OperatingSystemUtils(
fileSystem: fileSystem,
logger: BufferLogger.test(),
platform: FakePlatform(
operatingSystemVersion: 'Linux 1.2.3-abcd #1 SMP PREEMPT Sat Jan 1 00:00:00 UTC 2000',
),
processManager: fakeProcessManager,
);
expect(utils.name, 'Pretty Name 1.2.3-abcd');
});
testWithoutContext('Linux name when reading "/etc/os-release" fails', () async {
final FileExceptionHandler handler = FileExceptionHandler();
final FileSystem fileSystem = MemoryFileSystem.test(opHandle: handler.opHandle);
fileSystem.directory('/etc').createSync();
final File osRelease = fileSystem.file('/etc/os-release');
handler.addError(osRelease, FileSystemOp.read, const FileSystemException());
final OperatingSystemUtils utils = OperatingSystemUtils(
fileSystem: fileSystem,
logger: BufferLogger.test(),
platform: FakePlatform(
operatingSystemVersion: 'Linux 1.2.3-abcd #1 SMP PREEMPT Sat Jan 1 00:00:00 UTC 2000',
),
processManager: fakeProcessManager,
);
expect(utils.name, 'Linux 1.2.3-abcd');
});
testWithoutContext('Linux name omits kernel release if undefined', () async {
const String fakeOsRelease = '''
NAME="Name"
ID=id
ID_LIKE=id_like
BUILD_ID=build_id
PRETTY_NAME="Pretty Name"
ANSI_COLOR="ansi color"
HOME_URL="https://home.url/"
DOCUMENTATION_URL="https://documentation.url/"
SUPPORT_URL="https://support.url/"
BUG_REPORT_URL="https://bug.report.url/"
LOGO=logo
''';
final FileSystem fileSystem = MemoryFileSystem.test();
fileSystem.directory('/etc').createSync();
fileSystem.file('/etc/os-release').writeAsStringSync(fakeOsRelease);
final OperatingSystemUtils utils = OperatingSystemUtils(
fileSystem: fileSystem,
logger: BufferLogger.test(),
platform: FakePlatform(
operatingSystemVersion: 'undefinedOperatingSystemVersion',
),
processManager: fakeProcessManager,
);
expect(utils.name, 'Pretty Name');
});
// See https://snyk.io/research/zip-slip-vulnerability for more context
testWithoutContext('Windows validates paths when unzipping', () {
// on POSIX systems we use the `unzip` binary, which will fail to extract
// files with paths outside the target directory
final OperatingSystemUtils utils = createOSUtils(FakePlatform(operatingSystem: 'windows'));
final MemoryFileSystem fs = MemoryFileSystem.test();
final File fakeZipFile = fs.file('archive.zip');
final Directory targetDirectory = fs.directory('output')..createSync(recursive: true);
const String content = 'hello, world!';
final Archive archive = Archive()..addFile(
// This file would be extracted outside of the target extraction dir
ArchiveFile(r'..\..\..\Target File.txt', content.length, content.codeUnits),
);
final List<int> zipData = ZipEncoder().encode(archive)!;
fakeZipFile.writeAsBytesSync(zipData);
expect(
() => utils.unzip(fakeZipFile, targetDirectory),
throwsA(
isA<StateError>().having(
(StateError error) => error.message,
'correct error message',
contains('Tried to extract the file '),
),
),
);
});
});
testWithoutContext('If unzip fails, include stderr in exception text', () {
const String exceptionMessage = 'Something really bad happened.';
final FileExceptionHandler handler = FileExceptionHandler();
final FileSystem fileSystem = MemoryFileSystem.test(opHandle: handler.opHandle);
fakeProcessManager.addCommand(
const FakeCommand(command: <String>[
'unzip',
'-o',
'-q',
'bar.zip',
'-d',
'foo',
], exitCode: 1, stderr: exceptionMessage),
);
final Directory foo = fileSystem.directory('foo')
..createSync();
final File bar = fileSystem.file('bar.zip')
..createSync();
handler.addError(bar, FileSystemOp.read, const FileSystemException(exceptionMessage));
final OperatingSystemUtils osUtils = OperatingSystemUtils(
fileSystem: fileSystem,
logger: BufferLogger.test(),
platform: FakePlatform(),
processManager: fakeProcessManager,
);
expect(
() => osUtils.unzip(bar, foo),
throwsProcessException(message: exceptionMessage),
);
});
group('unzip on macOS', () {
testWithoutContext('falls back to unzip when rsync cannot run', () {
final FileSystem fileSystem = MemoryFileSystem.test();
fakeProcessManager.excludedExecutables.add('rsync');
final BufferLogger logger = BufferLogger.test();
final OperatingSystemUtils macOSUtils = OperatingSystemUtils(
fileSystem: fileSystem,
logger: logger,
platform: FakePlatform(operatingSystem: 'macos'),
processManager: fakeProcessManager,
);
final Directory targetDirectory = fileSystem.currentDirectory;
fakeProcessManager.addCommand(FakeCommand(
command: <String>['unzip', '-o', '-q', 'foo.zip', '-d', targetDirectory.path],
));
macOSUtils.unzip(fileSystem.file('foo.zip'), targetDirectory);
expect(fakeProcessManager, hasNoRemainingExpectations);
expect(logger.traceText, contains('Unable to find rsync'));
});
testWithoutContext('unzip and rsyncs', () {
final FileSystem fileSystem = MemoryFileSystem.test();
final OperatingSystemUtils macOSUtils = OperatingSystemUtils(
fileSystem: fileSystem,
logger: BufferLogger.test(),
platform: FakePlatform(operatingSystem: 'macos'),
processManager: fakeProcessManager,
);
final Directory targetDirectory = fileSystem.currentDirectory;
final Directory tempDirectory = fileSystem.systemTempDirectory.childDirectory('flutter_foo.zip.rand0');
fakeProcessManager.addCommands(<FakeCommand>[
FakeCommand(
command: <String>[
'unzip',
'-o',
'-q',
'foo.zip',
'-d',
tempDirectory.path,
],
onRun: (_) {
expect(tempDirectory, exists);
tempDirectory.childDirectory('dirA').childFile('fileA').createSync(recursive: true);
tempDirectory.childDirectory('dirB').childFile('fileB').createSync(recursive: true);
},
),
FakeCommand(command: <String>[
'rsync',
'-8',
'-av',
'--delete',
tempDirectory.childDirectory('dirA').path,
targetDirectory.path,
]),
FakeCommand(command: <String>[
'rsync',
'-8',
'-av',
'--delete',
tempDirectory.childDirectory('dirB').path,
targetDirectory.path,
]),
]);
macOSUtils.unzip(fileSystem.file('foo.zip'), fileSystem.currentDirectory);
expect(fakeProcessManager, hasNoRemainingExpectations);
expect(tempDirectory, isNot(exists));
});
});
group('display an install message when unzip cannot be run', () {
testWithoutContext('Linux', () {
final FileSystem fileSystem = MemoryFileSystem.test();
fakeProcessManager.excludedExecutables.add('unzip');
final OperatingSystemUtils linuxOsUtils = OperatingSystemUtils(
fileSystem: fileSystem,
logger: BufferLogger.test(),
platform: FakePlatform(),
processManager: fakeProcessManager,
);
expect(
() => linuxOsUtils.unzip(fileSystem.file('foo.zip'), fileSystem.currentDirectory),
throwsToolExit(
message: 'Missing "unzip" tool. Unable to extract foo.zip.\n'
'Consider running "sudo apt-get install unzip".'),
);
});
testWithoutContext('macOS', () {
final FileSystem fileSystem = MemoryFileSystem.test();
fakeProcessManager.excludedExecutables.add('unzip');
final OperatingSystemUtils macOSUtils = OperatingSystemUtils(
fileSystem: fileSystem,
logger: BufferLogger.test(),
platform: FakePlatform(operatingSystem: 'macos'),
processManager: fakeProcessManager,
);
expect(
() => macOSUtils.unzip(fileSystem.file('foo.zip'), fileSystem.currentDirectory),
throwsToolExit
(message: 'Missing "unzip" tool. Unable to extract foo.zip.\n'
'Consider running "brew install unzip".'),
);
});
testWithoutContext('unknown OS', () {
final FileSystem fileSystem = MemoryFileSystem.test();
fakeProcessManager.excludedExecutables.add('unzip');
final OperatingSystemUtils unknownOsUtils = OperatingSystemUtils(
fileSystem: fileSystem,
logger: BufferLogger.test(),
platform: FakePlatform(operatingSystem: 'fuchsia'),
processManager: fakeProcessManager,
);
expect(
() => unknownOsUtils.unzip(fileSystem.file('foo.zip'), fileSystem.currentDirectory),
throwsToolExit
(message: 'Missing "unzip" tool. Unable to extract foo.zip.\n'
'Please install unzip.'),
);
});
});
testWithoutContext('stream compression level', () {
expect(OperatingSystemUtils.gzipLevel1.level, equals(1));
});
}
| flutter/packages/flutter_tools/test/general.shard/base/os_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/base/os_test.dart",
"repo_id": "flutter",
"token_count": 10332
} | 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:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/build_system/exceptions.dart';
import 'package:flutter_tools/src/globals.dart' as globals;
import '../../src/common.dart';
import '../../src/fake_process_manager.dart';
import '../../src/testbed.dart';
final Platform windowsPlatform = FakePlatform(
operatingSystem: 'windows',
);
void main() {
late Testbed testbed;
late SourceVisitor visitor;
late Environment environment;
setUp(() {
testbed = Testbed(setup: () {
globals.fs.directory('cache').createSync();
final Directory outputs = globals.fs.directory('outputs')
..createSync();
environment = Environment.test(
globals.fs.currentDirectory,
outputDir: outputs,
artifacts: globals.artifacts!, // using real artifacts
processManager: FakeProcessManager.any(),
fileSystem: globals.fs,
// engineVersion being null simulates a local engine.
logger: globals.logger,
);
visitor = SourceVisitor(environment);
environment.buildDir.createSync(recursive: true);
});
});
test('configures implicit vs explicit correctly', () => testbed.run(() {
expect(const Source.pattern('{PROJECT_DIR}/foo').implicit, false);
expect(const Source.pattern('{PROJECT_DIR}/*foo').implicit, true);
}));
test('can substitute {PROJECT_DIR}/foo', () => testbed.run(() {
globals.fs.file('foo').createSync();
const Source fooSource = Source.pattern('{PROJECT_DIR}/foo');
fooSource.accept(visitor);
expect(visitor.sources.single.path, globals.fs.path.absolute('foo'));
}));
test('can substitute {OUTPUT_DIR}/foo', () => testbed.run(() {
globals.fs.file('foo').createSync();
const Source fooSource = Source.pattern('{OUTPUT_DIR}/foo');
fooSource.accept(visitor);
expect(visitor.sources.single.path, globals.fs.path.absolute(globals.fs.path.join('outputs', 'foo')));
}));
test('can substitute {BUILD_DIR}/bar', () => testbed.run(() {
final String path = globals.fs.path.join(environment.buildDir.path, 'bar');
globals.fs.file(path).createSync();
const Source barSource = Source.pattern('{BUILD_DIR}/bar');
barSource.accept(visitor);
expect(visitor.sources.single.path, globals.fs.path.absolute(path));
}));
test('can substitute {FLUTTER_ROOT}/foo', () => testbed.run(() {
final String path = globals.fs.path.join(environment.flutterRootDir.path, 'foo');
globals.fs.file(path).createSync();
const Source barSource = Source.pattern('{FLUTTER_ROOT}/foo');
barSource.accept(visitor);
expect(visitor.sources.single.path, globals.fs.path.absolute(path));
}));
test('can substitute Artifact', () => testbed.run(() {
final String path = globals.fs.path.join(
globals.cache.getArtifactDirectory('engine').path,
'windows-x64',
'foo',
);
globals.fs.file(path).createSync(recursive: true);
const Source fizzSource = Source.artifact(Artifact.windowsDesktopPath, platform: TargetPlatform.windows_x64);
fizzSource.accept(visitor);
expect(visitor.sources.single.resolveSymbolicLinksSync(), globals.fs.path.absolute(path));
}));
test('can substitute {PROJECT_DIR}/*.fizz', () => testbed.run(() {
const Source fizzSource = Source.pattern('{PROJECT_DIR}/*.fizz');
fizzSource.accept(visitor);
expect(visitor.sources, isEmpty);
globals.fs.file('foo.fizz').createSync();
globals.fs.file('foofizz').createSync();
fizzSource.accept(visitor);
expect(visitor.sources.single.path, globals.fs.path.absolute('foo.fizz'));
}));
test('can substitute {PROJECT_DIR}/fizz.*', () => testbed.run(() {
const Source fizzSource = Source.pattern('{PROJECT_DIR}/fizz.*');
fizzSource.accept(visitor);
expect(visitor.sources, isEmpty);
globals.fs.file('fizz.foo').createSync();
globals.fs.file('fizz').createSync();
fizzSource.accept(visitor);
expect(visitor.sources.single.path, globals.fs.path.absolute('fizz.foo'));
}));
test('can substitute {PROJECT_DIR}/a*bc', () => testbed.run(() {
const Source fizzSource = Source.pattern('{PROJECT_DIR}/bc*bc');
fizzSource.accept(visitor);
expect(visitor.sources, isEmpty);
globals.fs.file('bcbc').createSync();
globals.fs.file('bc').createSync();
fizzSource.accept(visitor);
expect(visitor.sources.single.path, globals.fs.path.absolute('bcbc'));
}));
test('crashes on bad substitute of two **', () => testbed.run(() {
const Source fizzSource = Source.pattern('{PROJECT_DIR}/*.*bar');
globals.fs.file('abcd.bar').createSync();
expect(() => fizzSource.accept(visitor), throwsA(isA<InvalidPatternException>()));
}));
test("can't substitute foo", () => testbed.run(() {
const Source invalidBase = Source.pattern('foo');
expect(() => invalidBase.accept(visitor), throwsA(isA<InvalidPatternException>()));
}));
test('can substitute optional files', () => testbed.run(() {
const Source missingSource = Source.pattern('{PROJECT_DIR}/foo', optional: true);
expect(globals.fs.file('foo').existsSync(), false);
missingSource.accept(visitor);
expect(visitor.sources, isEmpty);
}));
test('can resolve a missing depfile', () => testbed.run(() {
visitor.visitDepfile('foo.d');
expect(visitor.sources, isEmpty);
expect(visitor.containsNewDepfile, true);
}));
test('can resolve a populated depfile', () => testbed.run(() {
environment.buildDir.childFile('foo.d')
.writeAsStringSync('a.dart : c.dart');
visitor.visitDepfile('foo.d');
expect(visitor.sources.single.path, 'c.dart');
expect(visitor.containsNewDepfile, false);
final SourceVisitor outputVisitor = SourceVisitor(environment, false);
outputVisitor.visitDepfile('foo.d');
expect(outputVisitor.sources.single.path, 'a.dart');
expect(outputVisitor.containsNewDepfile, false);
}));
test('does not crash on completely invalid depfile', () => testbed.run(() {
environment.buildDir.childFile('foo.d')
.writeAsStringSync('hello, world');
visitor.visitDepfile('foo.d');
expect(visitor.sources, isEmpty);
expect(visitor.containsNewDepfile, false);
}));
test('can parse depfile with windows paths', () => testbed.run(() {
environment.buildDir.childFile('foo.d')
.writeAsStringSync(r'a.dart: C:\\foo\\bar.txt');
visitor.visitDepfile('foo.d');
expect(visitor.sources.single.path, r'C:\foo\bar.txt');
expect(visitor.containsNewDepfile, false);
}, overrides: <Type, Generator>{
Platform: () => windowsPlatform,
}));
test('can parse depfile with spaces in paths', () => testbed.run(() {
environment.buildDir.childFile('foo.d')
.writeAsStringSync(r'a.dart: foo\ bar.txt');
visitor.visitDepfile('foo.d');
expect(visitor.sources.single.path, r'foo bar.txt');
expect(visitor.containsNewDepfile, false);
}));
test('Non-local engine builds use the engine.version file as an Artifact dependency', () => testbed.run(() {
final Artifacts artifacts = Artifacts.test();
final Environment environment = Environment.test(
globals.fs.currentDirectory,
artifacts: artifacts,
processManager: FakeProcessManager.any(),
fileSystem: globals.fs,
logger: globals.logger,
engineVersion: 'abcdefghijklmon' // Use a versioned engine.
);
visitor = SourceVisitor(environment);
const Source fizzSource = Source.artifact(Artifact.windowsDesktopPath, platform: TargetPlatform.windows_x64);
fizzSource.accept(visitor);
expect(visitor.sources.single.path, contains('engine.version'));
}));
}
| flutter/packages/flutter_tools/test/general.shard/build_system/source_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/build_system/source_test.dart",
"repo_id": "flutter",
"token_count": 2916
} | 777 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:file/memory.dart';
import 'package:file_testing/file_testing.dart';
import 'package:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/build_system/targets/common.dart';
import 'package:flutter_tools/src/build_system/targets/windows.dart';
import 'package:flutter_tools/src/convert.dart';
import '../../../src/common.dart';
import '../../../src/context.dart';
void main() {
testWithoutContext('UnpackWindows copies files to the correct windows/ cache directory', () async {
final Artifacts artifacts = Artifacts.test();
final FileSystem fileSystem = MemoryFileSystem.test(style: FileSystemStyle.windows);
final Environment environment = Environment.test(
fileSystem.currentDirectory,
artifacts: artifacts,
processManager: FakeProcessManager.any(),
fileSystem: fileSystem,
logger: BufferLogger.test(),
defines: <String, String>{
kBuildMode: 'debug',
},
);
environment.buildDir.createSync(recursive: true);
final String windowsDesktopPath = artifacts.getArtifactPath(Artifact.windowsDesktopPath, platform: TargetPlatform.windows_x64, mode: BuildMode.debug);
final String windowsCppClientWrapper = artifacts.getArtifactPath(Artifact.windowsCppClientWrapper, platform: TargetPlatform.windows_x64, mode: BuildMode.debug);
final String icuData = artifacts.getArtifactPath(Artifact.icuData, platform: TargetPlatform.windows_x64);
final List<String> requiredFiles = <String>[
'$windowsDesktopPath\\flutter_export.h',
'$windowsDesktopPath\\flutter_messenger.h',
'$windowsDesktopPath\\flutter_windows.dll',
'$windowsDesktopPath\\flutter_windows.dll.exp',
'$windowsDesktopPath\\flutter_windows.dll.lib',
'$windowsDesktopPath\\flutter_windows.dll.pdb',
'$windowsDesktopPath\\flutter_plugin_registrar.h',
'$windowsDesktopPath\\flutter_texture_registrar.h',
'$windowsDesktopPath\\flutter_windows.h',
icuData,
'$windowsCppClientWrapper\\foo',
r'C:\packages\flutter_tools\lib\src\build_system\targets\windows.dart',
];
for (final String path in requiredFiles) {
fileSystem.file(path).createSync(recursive: true);
}
fileSystem.directory('windows').createSync();
await const UnpackWindows(TargetPlatform.windows_x64).build(environment);
// Output files are copied correctly.
expect(fileSystem.file(r'C:\windows\flutter\ephemeral\flutter_export.h'), exists);
expect(fileSystem.file(r'C:\windows\flutter\ephemeral\flutter_messenger.h'), exists);
expect(fileSystem.file(r'C:\windows\flutter\ephemeral\flutter_windows.dll'), exists);
expect(fileSystem.file(r'C:\windows\flutter\ephemeral\flutter_windows.dll.exp'), exists);
expect(fileSystem.file(r'C:\windows\flutter\ephemeral\flutter_windows.dll.lib'), exists);
expect(fileSystem.file(r'C:\windows\flutter\ephemeral\flutter_windows.dll.pdb'), exists);
expect(fileSystem.file(r'C:\windows\flutter\ephemeral\flutter_export.h'), exists);
expect(fileSystem.file(r'C:\windows\flutter\ephemeral\flutter_messenger.h'), exists);
expect(fileSystem.file(r'C:\windows\flutter\ephemeral\flutter_plugin_registrar.h'), exists);
expect(fileSystem.file(r'C:\windows\flutter\ephemeral\flutter_texture_registrar.h'), exists);
expect(fileSystem.file(r'C:\windows\flutter\ephemeral\flutter_windows.h'), exists);
expect(fileSystem.file('C:\\windows\\flutter\\ephemeral\\$icuData'), exists);
expect(fileSystem.file('C:\\windows\\flutter\\ephemeral\\$windowsCppClientWrapper\\foo'), exists);
final File outputDepfile = environment.buildDir
.childFile('windows_engine_sources.d');
// Depfile is created correctly.
expect(outputDepfile, exists);
final List<String> inputPaths = environment.depFileService.parse(outputDepfile)
.inputs.map((File file) => file.path).toList();
final List<String> outputPaths = environment.depFileService.parse(outputDepfile)
.outputs.map((File file) => file.path).toList();
// Depfile has expected sources.
expect(inputPaths, unorderedEquals(<String>[
'$windowsDesktopPath\\flutter_export.h',
'$windowsDesktopPath\\flutter_messenger.h',
'$windowsDesktopPath\\flutter_windows.dll',
'$windowsDesktopPath\\flutter_windows.dll.exp',
'$windowsDesktopPath\\flutter_windows.dll.lib',
'$windowsDesktopPath\\flutter_windows.dll.pdb',
'$windowsDesktopPath\\flutter_plugin_registrar.h',
'$windowsDesktopPath\\flutter_texture_registrar.h',
'$windowsDesktopPath\\flutter_windows.h',
icuData,
'$windowsCppClientWrapper\\foo',
]));
expect(outputPaths, unorderedEquals(<String>[
r'C:\windows\flutter\ephemeral\flutter_export.h',
r'C:\windows\flutter\ephemeral\flutter_messenger.h',
r'C:\windows\flutter\ephemeral\flutter_windows.dll',
r'C:\windows\flutter\ephemeral\flutter_windows.dll.exp',
r'C:\windows\flutter\ephemeral\flutter_windows.dll.lib',
r'C:\windows\flutter\ephemeral\flutter_windows.dll.pdb',
r'C:\windows\flutter\ephemeral\flutter_plugin_registrar.h',
r'C:\windows\flutter\ephemeral\flutter_texture_registrar.h',
r'C:\windows\flutter\ephemeral\flutter_windows.h',
'C:\\windows\\flutter\\ephemeral\\$icuData',
'C:\\windows\\flutter\\ephemeral\\$windowsCppClientWrapper\\foo',
]));
});
// AssetBundleFactory still uses context injection
late FileSystem fileSystem;
setUp(() {
fileSystem = MemoryFileSystem.test(style: FileSystemStyle.windows);
});
testUsingContext('DebugBundleWindowsAssets creates correct bundle structure', () async {
final Environment environment = Environment.test(
fileSystem.currentDirectory,
artifacts: Artifacts.test(),
processManager: FakeProcessManager.any(),
fileSystem: fileSystem,
logger: BufferLogger.test(),
defines: <String, String>{
kBuildMode: 'debug',
},
inputs: <String, String>{
kBundleSkSLPath: 'bundle.sksl',
},
engineVersion: '2',
);
environment.buildDir.childFile('app.dill').createSync(recursive: true);
// sksl bundle
fileSystem.file('bundle.sksl').writeAsStringSync(json.encode(
<String, Object>{
'engineRevision': '2',
'platform': 'ios',
'data': <String, Object>{
'A': 'B',
},
},
));
await const DebugBundleWindowsAssets(TargetPlatform.windows_x64).build(environment);
// Depfile is created and dill is copied.
expect(environment.buildDir.childFile('flutter_assets.d'), exists);
expect(fileSystem.file(r'C:\flutter_assets\kernel_blob.bin'), exists);
expect(fileSystem.file(r'C:\flutter_assets\AssetManifest.json'), exists);
expect(fileSystem.file(r'C:\flutter_assets\io.flutter.shaders.json'), exists);
expect(fileSystem.file(r'C:\flutter_assets\io.flutter.shaders.json').readAsStringSync(), '{"data":{"A":"B"}}');
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('ProfileBundleWindowsAssets creates correct bundle structure', () async {
final Environment environment = Environment.test(
fileSystem.currentDirectory,
artifacts: Artifacts.test(),
processManager: FakeProcessManager.any(),
fileSystem: fileSystem,
logger: BufferLogger.test(),
defines: <String, String>{
kBuildMode: 'profile',
}
);
environment.buildDir.childFile('app.so').createSync(recursive: true);
await const WindowsAotBundle(AotElfProfile(TargetPlatform.windows_x64)).build(environment);
await const ProfileBundleWindowsAssets(TargetPlatform.windows_x64).build(environment);
// Depfile is created and so is copied.
expect(environment.buildDir.childFile('flutter_assets.d'), exists);
expect(fileSystem.file(r'C:\windows\app.so'), exists);
expect(fileSystem.file(r'C:\flutter_assets\kernel_blob.bin').existsSync(), false);
expect(fileSystem.file(r'C:\flutter_assets\AssetManifest.json'), exists);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('ReleaseBundleWindowsAssets creates correct bundle structure', () async {
final Environment environment = Environment.test(
fileSystem.currentDirectory,
artifacts: Artifacts.test(),
processManager: FakeProcessManager.any(),
fileSystem: fileSystem,
logger: BufferLogger.test(),
defines: <String, String>{
kBuildMode: 'release',
}
);
environment.buildDir.childFile('app.so').createSync(recursive: true);
await const WindowsAotBundle(AotElfRelease(TargetPlatform.windows_x64)).build(environment);
await const ReleaseBundleWindowsAssets(TargetPlatform.windows_x64).build(environment);
// Depfile is created and so is copied.
expect(environment.buildDir.childFile('flutter_assets.d'), exists);
expect(fileSystem.file(r'C:\windows\app.so'), exists);
expect(fileSystem.file(r'C:\flutter_assets\kernel_blob.bin').existsSync(), false);
expect(fileSystem.file(r'C:\flutter_assets\AssetManifest.json'), exists);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
});
}
| flutter/packages/flutter_tools/test/general.shard/build_system/targets/windows_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/build_system/targets/windows_test.dart",
"repo_id": "flutter",
"token_count": 3519
} | 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:flutter_tools/src/base/common.dart';
import 'package:flutter_tools/src/convert.dart';
import '../src/common.dart';
void main() {
late String passedString;
late String nonpassString;
const Utf8Decoder decoder = Utf8Decoder();
setUp(() {
passedString = 'normal string';
nonpassString = 'malformed string => �';
});
testWithoutContext('Decode a normal string', () async {
expect(decoder.convert(passedString.codeUnits), passedString);
});
testWithoutContext('Decode a malformed string', () async {
expect(
() => decoder.convert(nonpassString.codeUnits),
throwsA(
isA<ToolExit>().having(
(ToolExit error) => error.message,
'message',
contains('(U+FFFD; REPLACEMENT CHARACTER)'), // Added paragraph
),
),
);
});
}
| flutter/packages/flutter_tools/test/general.shard/convert_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/convert_test.dart",
"repo_id": "flutter",
"token_count": 364
} | 779 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:convert';
import 'dart:io' as io show Process, ProcessSignal;
import 'dart:typed_data';
import 'package:args/args.dart';
import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:file_testing/file_testing.dart';
import 'package:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/asset.dart';
import 'package:flutter_tools/src/base/config.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/os.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/build_system/tools/shader_compiler.dart';
import 'package:flutter_tools/src/compile.dart';
import 'package:flutter_tools/src/devfs.dart';
import 'package:flutter_tools/src/flutter_manifest.dart';
import 'package:flutter_tools/src/vmservice.dart';
import 'package:package_config/package_config.dart';
import 'package:test/fake.dart';
import '../src/common.dart';
import '../src/context.dart';
import '../src/fake_http_client.dart';
import '../src/fake_process_manager.dart';
import '../src/fake_vm_services.dart';
import '../src/fakes.dart';
import '../src/logging_logger.dart';
final FakeVmServiceRequest createDevFSRequest = FakeVmServiceRequest(
method: '_createDevFS',
args: <String, Object>{
'fsName': 'test',
},
jsonResponse: <String, Object>{
'uri': Uri.parse('test').toString(),
}
);
const FakeVmServiceRequest failingCreateDevFSRequest = FakeVmServiceRequest(
method: '_createDevFS',
args: <String, Object>{
'fsName': 'test',
},
error: FakeRPCError(code: RPCErrorCodes.kServiceDisappeared),
);
const FakeVmServiceRequest failingDeleteDevFSRequest = FakeVmServiceRequest(
method: '_deleteDevFS',
args: <String, dynamic>{'fsName': 'test'},
error: FakeRPCError(code: RPCErrorCodes.kServiceDisappeared),
);
void main() {
testWithoutContext('DevFSByteContent', () {
final DevFSByteContent content = DevFSByteContent(<int>[4, 5, 6]);
expect(content.bytes, orderedEquals(<int>[4, 5, 6]));
expect(content.isModified, isTrue);
expect(content.isModified, isFalse);
});
testWithoutContext('DevFSStringContent', () {
final DevFSStringContent content = DevFSStringContent('some string');
expect(content.string, 'some string');
expect(content.bytes, orderedEquals(utf8.encode('some string')));
expect(content.isModified, isTrue);
expect(content.isModified, isFalse);
});
testWithoutContext('DevFSFileContent', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final File file = fileSystem.file('foo.txt');
final DevFSFileContent content = DevFSFileContent(file);
expect(content.isModified, isFalse);
expect(content.isModified, isFalse);
file.parent.createSync(recursive: true);
file.writeAsBytesSync(<int>[1, 2, 3], flush: true);
final DateTime fiveSecondsAgo = file.statSync().modified.subtract(const Duration(seconds: 5));
expect(content.isModifiedAfter(fiveSecondsAgo), isTrue);
expect(content.isModifiedAfter(fiveSecondsAgo), isTrue);
file.writeAsBytesSync(<int>[2, 3, 4], flush: true);
expect(content.isModified, isTrue);
expect(content.isModified, isFalse);
expect(await content.contentsAsBytes(), <int>[2, 3, 4]);
expect(content.isModified, isFalse);
expect(content.isModified, isFalse);
file.deleteSync();
expect(content.isModified, isTrue);
expect(content.isModified, isFalse);
expect(content.isModified, isFalse);
});
testWithoutContext('DevFSStringCompressingBytesContent', () {
final DevFSStringCompressingBytesContent content =
DevFSStringCompressingBytesContent('uncompressed string');
expect(content.equals('uncompressed string'), isTrue);
expect(content.bytes, isNotNull);
expect(content.isModified, isTrue);
expect(content.isModified, isFalse);
});
testWithoutContext('DevFS create throws a DevFSException when vmservice disconnects unexpectedly', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final OperatingSystemUtils osUtils = FakeOperatingSystemUtils();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(
requests: <VmServiceExpectation>[failingCreateDevFSRequest],
httpAddress: Uri.parse('http://localhost'),
);
final DevFS devFS = DevFS(
fakeVmServiceHost.vmService,
'test',
fileSystem.currentDirectory,
osUtils: osUtils,
fileSystem: fileSystem,
logger: BufferLogger.test(),
httpClient: FakeHttpClient.any(),
processManager: FakeProcessManager.empty(),
artifacts: Artifacts.test(),
);
expect(() async => devFS.create(), throwsA(isA<DevFSException>()));
});
testWithoutContext('DevFS destroy is resilient to vmservice disconnection', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final OperatingSystemUtils osUtils = FakeOperatingSystemUtils();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(
requests: <VmServiceExpectation>[
createDevFSRequest,
failingDeleteDevFSRequest,
],
httpAddress: Uri.parse('http://localhost'),
);
final DevFS devFS = DevFS(
fakeVmServiceHost.vmService,
'test',
fileSystem.currentDirectory,
osUtils: osUtils,
fileSystem: fileSystem,
logger: BufferLogger.test(),
httpClient: FakeHttpClient.any(),
processManager: FakeProcessManager.empty(),
artifacts: Artifacts.test(),
);
expect(await devFS.create(), isNotNull);
await devFS.destroy(); // Testing that this does not throw.
});
testWithoutContext('DevFS retries uploads when connection reset by peer', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final OperatingSystemUtils osUtils = OperatingSystemUtils(
fileSystem: fileSystem,
platform: FakePlatform(),
logger: BufferLogger.test(),
processManager: FakeProcessManager.any(),
);
final FakeResidentCompiler residentCompiler = FakeResidentCompiler();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(
requests: <VmServiceExpectation>[createDevFSRequest],
httpAddress: Uri.parse('http://localhost'),
);
residentCompiler.onRecompile = (Uri mainUri, List<Uri>? invalidatedFiles) async {
fileSystem.file('lib/foo.dill')
..createSync(recursive: true)
..writeAsBytesSync(<int>[1, 2, 3, 4, 5]);
return const CompilerOutput('lib/foo.dill', 0, <Uri>[]);
};
/// This output can change based on the host platform.
final List<List<int>> expectedEncoded = await osUtils.gzipLevel1Stream(
Stream<List<int>>.value(<int>[1, 2, 3, 4, 5]),
).toList();
final DevFS devFS = DevFS(
fakeVmServiceHost.vmService,
'test',
fileSystem.currentDirectory,
osUtils: osUtils,
fileSystem: fileSystem,
logger: BufferLogger.test(),
httpClient: FakeHttpClient.list(<FakeRequest>[
FakeRequest(Uri.parse('http://localhost'), method: HttpMethod.put, responseError: const OSError('Connection Reset by peer')),
FakeRequest(Uri.parse('http://localhost'), method: HttpMethod.put, responseError: const OSError('Connection Reset by peer')),
FakeRequest(Uri.parse('http://localhost'), method: HttpMethod.put, responseError: const OSError('Connection Reset by peer')),
FakeRequest(Uri.parse('http://localhost'), method: HttpMethod.put, responseError: const OSError('Connection Reset by peer')),
FakeRequest(Uri.parse('http://localhost'), method: HttpMethod.put, responseError: const OSError('Connection Reset by peer')),
// This is the value of `<int>[1, 2, 3, 4, 5]` run through `osUtils.gzipLevel1Stream`.
FakeRequest(Uri.parse('http://localhost'), method: HttpMethod.put, body: <int>[for (final List<int> chunk in expectedEncoded) ...chunk]),
]),
uploadRetryThrottle: Duration.zero,
processManager: FakeProcessManager.empty(),
artifacts: Artifacts.test(),
);
await devFS.create();
final UpdateFSReport report = await devFS.update(
mainUri: Uri.parse('lib/foo.txt'),
dillOutputPath: 'lib/foo.dill',
generator: residentCompiler,
pathToReload: 'lib/foo.txt.dill',
trackWidgetCreation: false,
invalidatedFiles: <Uri>[],
packageConfig: PackageConfig.empty,
shaderCompiler: const FakeShaderCompiler(),
);
expect(report.syncedBytes, 5);
expect(report.success, isTrue);
});
testWithoutContext('DevFS reports unsuccessful compile when errors are returned', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(
requests: <VmServiceExpectation>[createDevFSRequest],
httpAddress: Uri.parse('http://localhost'),
);
final DevFS devFS = DevFS(
fakeVmServiceHost.vmService,
'test',
fileSystem.currentDirectory,
fileSystem: fileSystem,
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
httpClient: FakeHttpClient.any(),
processManager: FakeProcessManager.empty(),
artifacts: Artifacts.test(),
);
await devFS.create();
final DateTime? previousCompile = devFS.lastCompiled;
final FakeResidentCompiler residentCompiler = FakeResidentCompiler();
residentCompiler.onRecompile = (Uri mainUri, List<Uri>? invalidatedFiles) async {
return const CompilerOutput('lib/foo.dill', 2, <Uri>[]);
};
final UpdateFSReport report = await devFS.update(
mainUri: Uri.parse('lib/foo.txt'),
generator: residentCompiler,
dillOutputPath: 'lib/foo.dill',
pathToReload: 'lib/foo.txt.dill',
trackWidgetCreation: false,
invalidatedFiles: <Uri>[],
packageConfig: PackageConfig.empty,
shaderCompiler: const FakeShaderCompiler(),
);
expect(report.success, false);
expect(devFS.lastCompiled, previousCompile);
});
testWithoutContext('DevFS correctly updates last compiled time when compilation does not fail', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(
requests: <VmServiceExpectation>[createDevFSRequest],
httpAddress: Uri.parse('http://localhost'),
);
final DevFS devFS = DevFS(
fakeVmServiceHost.vmService,
'test',
fileSystem.currentDirectory,
fileSystem: fileSystem,
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
httpClient: FakeHttpClient.any(),
processManager: FakeProcessManager.empty(),
artifacts: Artifacts.test(),
);
await devFS.create();
final DateTime? previousCompile = devFS.lastCompiled;
final FakeResidentCompiler residentCompiler = FakeResidentCompiler();
residentCompiler.onRecompile = (Uri mainUri, List<Uri>? invalidatedFiles) async {
fileSystem.file('lib/foo.txt.dill').createSync(recursive: true);
return const CompilerOutput('lib/foo.txt.dill', 0, <Uri>[]);
};
final UpdateFSReport report = await devFS.update(
mainUri: Uri.parse('lib/main.dart'),
generator: residentCompiler,
dillOutputPath: 'lib/foo.dill',
pathToReload: 'lib/foo.txt.dill',
trackWidgetCreation: false,
invalidatedFiles: <Uri>[],
packageConfig: PackageConfig.empty,
shaderCompiler: const FakeShaderCompiler(),
);
expect(report.success, true);
expect(devFS.lastCompiled, isNot(previousCompile));
});
testWithoutContext('DevFS can reset compilation time', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(
requests: <VmServiceExpectation>[createDevFSRequest],
);
final LocalDevFSWriter localDevFSWriter = LocalDevFSWriter(fileSystem: fileSystem);
fileSystem.directory('test').createSync();
final DevFS devFS = DevFS(
fakeVmServiceHost.vmService,
'test',
fileSystem.currentDirectory,
fileSystem: fileSystem,
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
httpClient: HttpClient(),
processManager: FakeProcessManager.empty(),
artifacts: Artifacts.test(),
);
await devFS.create();
final DateTime? previousCompile = devFS.lastCompiled;
final FakeResidentCompiler residentCompiler = FakeResidentCompiler();
residentCompiler.onRecompile = (Uri mainUri, List<Uri>? invalidatedFiles) async {
fileSystem.file('lib/foo.txt.dill').createSync(recursive: true);
return const CompilerOutput('lib/foo.txt.dill', 0, <Uri>[]);
};
final UpdateFSReport report = await devFS.update(
mainUri: Uri.parse('lib/main.dart'),
generator: residentCompiler,
dillOutputPath: 'lib/foo.dill',
pathToReload: 'lib/foo.txt.dill',
trackWidgetCreation: false,
invalidatedFiles: <Uri>[],
packageConfig: PackageConfig.empty,
devFSWriter: localDevFSWriter,
shaderCompiler: const FakeShaderCompiler(),
);
expect(report.success, true);
expect(devFS.lastCompiled, isNot(previousCompile));
devFS.resetLastCompiled();
expect(devFS.lastCompiled, previousCompile);
// Does not reset to report compile time.
devFS.resetLastCompiled();
expect(devFS.lastCompiled, previousCompile);
});
testWithoutContext('DevFS uses provided DevFSWriter instead of default HTTP writer', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final FakeDevFSWriter writer = FakeDevFSWriter();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(
requests: <VmServiceExpectation>[createDevFSRequest],
);
final DevFS devFS = DevFS(
fakeVmServiceHost.vmService,
'test',
fileSystem.currentDirectory,
fileSystem: fileSystem,
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
httpClient: FakeHttpClient.any(),
processManager: FakeProcessManager.empty(),
artifacts: Artifacts.test(),
);
await devFS.create();
final FakeResidentCompiler residentCompiler = FakeResidentCompiler();
residentCompiler.onRecompile = (Uri mainUri, List<Uri>? invalidatedFiles) async {
fileSystem.file('example').createSync();
return const CompilerOutput('lib/foo.txt.dill', 0, <Uri>[]);
};
expect(writer.written, false);
final UpdateFSReport report = await devFS.update(
mainUri: Uri.parse('lib/main.dart'),
generator: residentCompiler,
dillOutputPath: 'lib/foo.dill',
pathToReload: 'lib/foo.txt.dill',
trackWidgetCreation: false,
invalidatedFiles: <Uri>[],
packageConfig: PackageConfig.empty,
devFSWriter: writer,
shaderCompiler: const FakeShaderCompiler(),
);
expect(report.success, true);
expect(writer.written, true);
});
testWithoutContext('Local DevFSWriter can copy and write files', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final File file = fileSystem.file('foo_bar')
..writeAsStringSync('goodbye');
final LocalDevFSWriter writer = LocalDevFSWriter(fileSystem: fileSystem);
await writer.write(<Uri, DevFSContent>{
Uri.parse('hello'): DevFSStringContent('hello'),
Uri.parse('goodbye'): DevFSFileContent(file),
}, Uri.parse('/foo/bar/devfs/'));
expect(fileSystem.file('/foo/bar/devfs/hello'), exists);
expect(fileSystem.file('/foo/bar/devfs/hello').readAsStringSync(), 'hello');
expect(fileSystem.file('/foo/bar/devfs/goodbye'), exists);
expect(fileSystem.file('/foo/bar/devfs/goodbye').readAsStringSync(), 'goodbye');
});
testWithoutContext('Local DevFSWriter turns FileSystemException into DevFSException', () async {
final FileExceptionHandler handler = FileExceptionHandler();
final FileSystem fileSystem = MemoryFileSystem.test(opHandle: handler.opHandle);
final LocalDevFSWriter writer = LocalDevFSWriter(fileSystem: fileSystem);
final File file = fileSystem.file('foo');
handler.addError(file, FileSystemOp.read, const FileSystemException('foo'));
await expectLater(() async => writer.write(<Uri, DevFSContent>{
Uri.parse('goodbye'): DevFSFileContent(file),
}, Uri.parse('/foo/bar/devfs/')), throwsA(isA<DevFSException>()));
});
testWithoutContext('DevFS correctly records the elapsed time', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
// final FakeDevFSWriter writer = FakeDevFSWriter();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(
requests: <VmServiceExpectation>[createDevFSRequest],
httpAddress: Uri.parse('http://localhost'),
);
final DevFS devFS = DevFS(
fakeVmServiceHost.vmService,
'test',
fileSystem.currentDirectory,
fileSystem: fileSystem,
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
httpClient: FakeHttpClient.any(),
stopwatchFactory: FakeStopwatchFactory(stopwatches: <String, Stopwatch>{
'compile': FakeStopwatch()..elapsed = const Duration(seconds: 3),
'transfer': FakeStopwatch()..elapsed = const Duration(seconds: 5),
}),
processManager: FakeProcessManager.empty(),
artifacts: Artifacts.test(),
);
await devFS.create();
final FakeResidentCompiler residentCompiler = FakeResidentCompiler();
residentCompiler.onRecompile = (Uri mainUri, List<Uri>? invalidatedFiles) async {
fileSystem.file('lib/foo.txt.dill').createSync(recursive: true);
return const CompilerOutput('lib/foo.txt.dill', 0, <Uri>[]);
};
final UpdateFSReport report = await devFS.update(
mainUri: Uri.parse('lib/main.dart'),
generator: residentCompiler,
dillOutputPath: 'lib/foo.dill',
pathToReload: 'lib/foo.txt.dill',
trackWidgetCreation: false,
invalidatedFiles: <Uri>[],
packageConfig: PackageConfig.empty,
shaderCompiler: const FakeShaderCompiler(),
);
expect(report.success, true);
expect(report.compileDuration, const Duration(seconds: 3));
expect(report.transferDuration, const Duration(seconds: 5));
});
testUsingContext('DevFS actually starts compile before processing bundle', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(
requests: <VmServiceExpectation>[createDevFSRequest],
httpAddress: Uri.parse('http://localhost'),
);
final LoggingLogger logger = LoggingLogger();
final DevFS devFS = DevFS(
fakeVmServiceHost.vmService,
'test',
fileSystem.currentDirectory,
fileSystem: fileSystem,
logger: logger,
osUtils: FakeOperatingSystemUtils(),
httpClient: FakeHttpClient.any(),
processManager: FakeProcessManager.empty(),
artifacts: Artifacts.test(),
);
await devFS.create();
final MemoryIOSink frontendServerStdIn = MemoryIOSink();
Stream<List<int>> frontendServerStdOut() async* {
int processed = 0;
while (true) {
while (frontendServerStdIn.writes.length == processed) {
await Future<dynamic>.delayed(const Duration(milliseconds: 5));
}
String? boundaryKey;
while (processed < frontendServerStdIn.writes.length) {
final List<int> data = frontendServerStdIn.writes[processed];
final String stringData = utf8.decode(data);
if (stringData.startsWith('compile ')) {
yield utf8.encode('result abc1\nline1\nline2\nabc1\nabc1 lib/foo.txt.dill 0\n');
} else if (stringData.startsWith('recompile ')) {
final String line = stringData.split('\n').first;
final int spaceDelim = line.lastIndexOf(' ');
boundaryKey = line.substring(spaceDelim + 1);
} else if (boundaryKey != null && stringData.startsWith(boundaryKey)) {
yield utf8.encode('result abc2\nline1\nline2\nabc2\nabc2 lib/foo.txt.dill 0\n');
} else {
throw Exception('Saw $data ($stringData)');
}
processed++;
}
}
}
Stream<List<int>> frontendServerStdErr() async* {
// Output nothing on stderr.
}
final AnsweringFakeProcessManager fakeProcessManager = AnsweringFakeProcessManager(frontendServerStdOut(), frontendServerStdErr(), frontendServerStdIn);
final StdoutHandler generatorStdoutHandler = StdoutHandler(logger: testLogger, fileSystem: fileSystem);
final DefaultResidentCompiler residentCompiler = DefaultResidentCompiler(
'sdkroot',
buildMode: BuildMode.debug,
logger: logger,
processManager: fakeProcessManager,
artifacts: Artifacts.test(),
platform: FakePlatform(),
fileSystem: fileSystem,
stdoutHandler: generatorStdoutHandler,
);
fileSystem.file('lib/foo.txt.dill').createSync(recursive: true);
final UpdateFSReport report1 = await devFS.update(
mainUri: Uri.parse('lib/main.dart'),
generator: residentCompiler,
dillOutputPath: 'lib/foo.dill',
pathToReload: 'lib/foo.txt.dill',
trackWidgetCreation: false,
invalidatedFiles: <Uri>[],
packageConfig: PackageConfig.empty,
bundle: FakeBundle(),
shaderCompiler: const FakeShaderCompiler(),
);
expect(report1.success, true);
logger.messages.clear();
final UpdateFSReport report2 = await devFS.update(
mainUri: Uri.parse('lib/main.dart'),
generator: residentCompiler,
dillOutputPath: 'lib/foo.dill',
pathToReload: 'lib/foo.txt.dill',
trackWidgetCreation: false,
invalidatedFiles: <Uri>[],
packageConfig: PackageConfig.empty,
bundle: FakeBundle(),
shaderCompiler: const FakeShaderCompiler(),
);
expect(report2.success, true);
final int processingBundleIndex = logger.messages.indexOf('Processing bundle.');
final int bundleProcessingDoneIndex = logger.messages.indexOf('Bundle processing done.');
final int compileLibMainIndex = logger.messages.indexWhere((String element) => element.startsWith('<- recompile lib/main.dart '));
expect(processingBundleIndex, greaterThanOrEqualTo(0));
expect(bundleProcessingDoneIndex, greaterThanOrEqualTo(0));
expect(compileLibMainIndex, greaterThanOrEqualTo(0));
expect(bundleProcessingDoneIndex, greaterThan(compileLibMainIndex));
});
group('Shader compilation', () {
testWithoutContext('DevFS recompiles shaders', () async {
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(
requests: <VmServiceExpectation>[createDevFSRequest],
httpAddress: Uri.parse('http://localhost'),
);
final BufferLogger logger = BufferLogger.test();
final DevFS devFS = DevFS(
fakeVmServiceHost.vmService,
'test',
fileSystem.currentDirectory,
fileSystem: fileSystem,
logger: logger,
osUtils: FakeOperatingSystemUtils(),
httpClient: FakeHttpClient.any(),
config: Config.test(),
processManager: FakeProcessManager.empty(),
artifacts: Artifacts.test(),
);
await devFS.create();
final FakeResidentCompiler residentCompiler = FakeResidentCompiler()
..onRecompile = (Uri mainUri, List<Uri>? invalidatedFiles) async {
fileSystem.file('lib/foo.dill')
..createSync(recursive: true)
..writeAsBytesSync(<int>[1, 2, 3, 4, 5]);
return const CompilerOutput('lib/foo.dill', 0, <Uri>[]);
};
final FakeBundle bundle = FakeBundle()
..entries['foo.frag'] = AssetBundleEntry(
DevFSByteContent(<int>[1, 2, 3, 4]),
kind: AssetKind.shader,
transformers: const <AssetTransformerEntry>[],
)
..entries['not.frag'] = AssetBundleEntry(
DevFSByteContent(<int>[1, 2, 3, 4]),
kind: AssetKind.regular,
transformers: const <AssetTransformerEntry>[],
);
final UpdateFSReport report = await devFS.update(
mainUri: Uri.parse('lib/main.dart'),
generator: residentCompiler,
dillOutputPath: 'lib/foo.dill',
pathToReload: 'lib/foo.txt.dill',
trackWidgetCreation: false,
invalidatedFiles: <Uri>[],
packageConfig: PackageConfig.empty,
shaderCompiler: const FakeShaderCompiler(),
bundle: bundle,
);
expect(report.success, true);
expect(devFS.shaderPathsToEvict, <String>{'foo.frag'});
expect(devFS.assetPathsToEvict, <String>{'not.frag'});
});
testWithoutContext('DevFS tracks when FontManifest is updated', () async {
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(
requests: <VmServiceExpectation>[createDevFSRequest],
httpAddress: Uri.parse('http://localhost'),
);
final BufferLogger logger = BufferLogger.test();
final DevFS devFS = DevFS(
fakeVmServiceHost.vmService,
'test',
fileSystem.currentDirectory,
fileSystem: fileSystem,
logger: logger,
osUtils: FakeOperatingSystemUtils(),
httpClient: FakeHttpClient.any(),
config: Config.test(),
processManager: FakeProcessManager.empty(),
artifacts: Artifacts.test(),
);
await devFS.create();
expect(devFS.didUpdateFontManifest, false);
final FakeResidentCompiler residentCompiler = FakeResidentCompiler()
..onRecompile = (Uri mainUri, List<Uri>? invalidatedFiles) async {
fileSystem.file('lib/foo.dill')
..createSync(recursive: true)
..writeAsBytesSync(<int>[1, 2, 3, 4, 5]);
return const CompilerOutput('lib/foo.dill', 0, <Uri>[]);
};
final FakeBundle bundle = FakeBundle()
..entries['FontManifest.json'] = AssetBundleEntry(
DevFSByteContent(<int>[1, 2, 3, 4]),
kind: AssetKind.regular,
transformers: const <AssetTransformerEntry>[],
);
final UpdateFSReport report = await devFS.update(
mainUri: Uri.parse('lib/main.dart'),
generator: residentCompiler,
dillOutputPath: 'lib/foo.dill',
pathToReload: 'lib/foo.txt.dill',
trackWidgetCreation: false,
invalidatedFiles: <Uri>[],
packageConfig: PackageConfig.empty,
shaderCompiler: const FakeShaderCompiler(),
bundle: bundle,
);
expect(report.success, true);
expect(devFS.shaderPathsToEvict, <String>{});
expect(devFS.assetPathsToEvict, <String>{'FontManifest.json'});
expect(devFS.didUpdateFontManifest, true);
});
});
group('Asset transformation', () {
testWithoutContext('DevFS re-transforms assets with transformers during update', () async {
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
final Artifacts artifacts = Artifacts.test();
final FakeDevFSWriter devFSWriter = FakeDevFSWriter();
final FakeProcessManager processManager = FakeProcessManager.list(
<FakeCommand>[
FakeCommand(
command: <Pattern>[
artifacts.getArtifactPath(Artifact.engineDartBinary),
'run',
'increment',
'--input=/.tmp_rand0/retransformerInput-asset.txt-transformOutput0.txt',
'--output=/.tmp_rand0/retransformerInput-asset.txt-transformOutput1.txt',
],
onRun: (List<String> command) {
final ArgResults argParseResults = (ArgParser()
..addOption('input', mandatory: true)
..addOption('output', mandatory: true))
.parse(command);
final File inputFile = fileSystem.file(argParseResults['input']);
final File outputFile = fileSystem.file(argParseResults['output']);
expect(inputFile, exists);
outputFile
..createSync()
..writeAsBytesSync(
Uint8List.fromList(
inputFile.readAsBytesSync().map((int b) => b + 1).toList(),
),
);
},
),
],
);
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(
requests: <VmServiceExpectation>[createDevFSRequest],
httpAddress: Uri.parse('http://localhost'),
);
final BufferLogger logger = BufferLogger.test();
final DevFS devFS = DevFS(
fakeVmServiceHost.vmService,
'test',
fileSystem.currentDirectory,
fileSystem: fileSystem,
logger: logger,
osUtils: FakeOperatingSystemUtils(),
httpClient: FakeHttpClient.any(),
config: Config.test(),
processManager: processManager,
artifacts: artifacts,
);
await devFS.create();
final FakeResidentCompiler residentCompiler = FakeResidentCompiler()
..onRecompile = (Uri mainUri, List<Uri>? invalidatedFiles) async {
fileSystem.file('lib/foo.dill')
..createSync(recursive: true)
..writeAsBytesSync(<int>[1, 2, 3, 4, 5]);
return const CompilerOutput('lib/foo.dill', 0, <Uri>[]);
};
final FakeBundle bundle = FakeBundle()
..entries['asset.txt'] = AssetBundleEntry(
DevFSByteContent(<int>[1, 2, 3, 4]),
kind: AssetKind.regular,
transformers: const <AssetTransformerEntry>[
AssetTransformerEntry(package: 'increment', args: <String>[]),
],
);
final UpdateFSReport report = await devFS.update(
mainUri: Uri.parse('lib/main.dart'),
generator: residentCompiler,
dillOutputPath: 'lib/foo.dill',
pathToReload: 'lib/foo.txt.dill',
trackWidgetCreation: false,
invalidatedFiles: <Uri>[],
packageConfig: PackageConfig.empty,
devFSWriter: devFSWriter,
shaderCompiler: const FakeShaderCompiler(),
bundle: bundle,
);
expect(processManager, hasNoRemainingExpectations);
expect(report.success, true);
expect(devFSWriter.entries, isNotNull);
final Uri assetUri = Uri(path: 'build/flutter_assets/asset.txt');
expect(devFSWriter.entries, contains(assetUri));
expect(
await devFSWriter.entries![assetUri]!.contentsAsBytes(),
containsAllInOrder(<int>[2, 3, 4, 5]),
);
});
testWithoutContext('DevFS reports failure when asset transformation fails', () async {
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
final Artifacts artifacts = Artifacts.test();
final FakeDevFSWriter devFSWriter = FakeDevFSWriter();
final FakeProcessManager processManager = FakeProcessManager.list(
<FakeCommand>[
FakeCommand(
command: <Pattern>[
artifacts.getArtifactPath(Artifact.engineDartBinary),
'run',
'increment',
'--input=/.tmp_rand0/retransformerInput-asset.txt-transformOutput0.txt',
'--output=/.tmp_rand0/retransformerInput-asset.txt-transformOutput1.txt',
],
exitCode: 1,
),
],
);
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(
requests: <VmServiceExpectation>[createDevFSRequest],
httpAddress: Uri.parse('http://localhost'),
);
final BufferLogger logger = BufferLogger.test();
final DevFS devFS = DevFS(
fakeVmServiceHost.vmService,
'test',
fileSystem.currentDirectory,
fileSystem: fileSystem,
logger: logger,
osUtils: FakeOperatingSystemUtils(),
httpClient: FakeHttpClient.any(),
config: Config.test(),
processManager: processManager,
artifacts: artifacts,
);
await devFS.create();
final FakeResidentCompiler residentCompiler = FakeResidentCompiler()
..onRecompile = (Uri mainUri, List<Uri>? invalidatedFiles) async {
fileSystem.file('lib/foo.dill')
..createSync(recursive: true)
..writeAsBytesSync(<int>[1, 2, 3, 4, 5]);
return const CompilerOutput('lib/foo.dill', 0, <Uri>[]);
};
final FakeBundle bundle = FakeBundle()
..entries['asset.txt'] = AssetBundleEntry(
DevFSByteContent(<int>[1, 2, 3, 4]),
kind: AssetKind.regular,
transformers: const <AssetTransformerEntry>[
AssetTransformerEntry(package: 'increment', args: <String>[]),
],
);
final UpdateFSReport report = await devFS.update(
mainUri: Uri.parse('lib/main.dart'),
generator: residentCompiler,
dillOutputPath: 'lib/foo.dill',
pathToReload: 'lib/foo.txt.dill',
trackWidgetCreation: false,
invalidatedFiles: <Uri>[],
packageConfig: PackageConfig.empty,
devFSWriter: devFSWriter,
shaderCompiler: const FakeShaderCompiler(),
bundle: bundle,
);
expect(processManager, hasNoRemainingExpectations);
expect(report.success, false, reason: 'DevFS update should fail since asset transformation failed.');
expect(devFSWriter.entries, isNull, reason: 'DevFS should not have written anything since the update failed.');
expect(
logger.errorText,
'User-defined transformation of asset "/.tmp_rand0/retransformerInput-asset.txt" failed.\n'
'Transformer process terminated with non-zero exit code: 1\n'
'Transformer package: increment\n'
'Full command: Artifact.engineDartBinary run increment --input=/.tmp_rand0/retransformerInput-asset.txt-transformOutput0.txt --output=/.tmp_rand0/retransformerInput-asset.txt-transformOutput1.txt\n'
'stdout:\n'
'\n'
'stderr:\n'
'\n',
);
});
});
}
class FakeResidentCompiler extends Fake implements ResidentCompiler {
Future<CompilerOutput> Function(Uri mainUri, List<Uri>? invalidatedFiles)? onRecompile;
@override
Future<CompilerOutput> recompile(
Uri mainUri,
List<Uri>? invalidatedFiles, {
String? outputPath,
PackageConfig? packageConfig,
String? projectRootPath,
FileSystem? fs,
bool suppressErrors = false,
bool checkDartPluginRegistry = false,
File? dartPluginRegistrant,
Uri? nativeAssetsYaml,
}) {
return onRecompile?.call(mainUri, invalidatedFiles)
?? Future<CompilerOutput>.value(const CompilerOutput('', 1, <Uri>[]));
}
}
class FakeDevFSWriter implements DevFSWriter {
bool written = false;
Map<Uri, DevFSContent>? entries;
@override
Future<void> write(Map<Uri, DevFSContent> entries, Uri baseUri, DevFSWriter parent) async {
written = true;
this.entries = entries;
}
}
class FakeBundle extends AssetBundle {
@override
List<File> get additionalDependencies => <File>[];
@override
Future<int> build({
String manifestPath = defaultManifestPath,
String? assetDirPath,
String? packagesPath,
bool deferredComponentsEnabled = false,
TargetPlatform? targetPlatform,
String? flavor,
}) async {
return 0;
}
@override
Map<String, Map<String, AssetBundleEntry>> get deferredComponentsEntries => <String, Map<String, AssetBundleEntry>>{};
@override
final Map<String, AssetBundleEntry> entries = <String, AssetBundleEntry>{};
@override
List<File> get inputFiles => <File>[];
@override
bool needsBuild({String manifestPath = defaultManifestPath}) {
return true;
}
@override
bool wasBuiltOnce() {
return false;
}
}
class AnsweringFakeProcessManager implements ProcessManager {
AnsweringFakeProcessManager(this.stdout, this.stderr, this.stdin);
final Stream<List<int>> stdout;
final Stream<List<int>> stderr;
final IOSink stdin;
@override
bool canRun(dynamic executable, {String? workingDirectory}) {
return true;
}
@override
bool killPid(int pid, [io.ProcessSignal signal = io.ProcessSignal.sigterm]) {
return true;
}
@override
Future<ProcessResult> run(List<Object> command, {String? workingDirectory, Map<String, String>? environment, bool includeParentEnvironment = true, bool runInShell = false, Encoding? stdoutEncoding = systemEncoding, Encoding? stderrEncoding = systemEncoding}) async {
throw UnimplementedError();
}
@override
ProcessResult runSync(List<Object> command, {String? workingDirectory, Map<String, String>? environment, bool includeParentEnvironment = true, bool runInShell = false, Encoding? stdoutEncoding = systemEncoding, Encoding? stderrEncoding = systemEncoding}) {
throw UnimplementedError();
}
@override
Future<Process> start(List<Object> command, {String? workingDirectory, Map<String, String>? environment, bool includeParentEnvironment = true, bool runInShell = false, ProcessStartMode mode = ProcessStartMode.normal}) async {
return AnsweringFakeProcess(stdout, stderr, stdin);
}
}
class AnsweringFakeProcess implements io.Process {
AnsweringFakeProcess(this.stdout,this.stderr, this.stdin);
@override
final Stream<List<int>> stdout;
@override
final Stream<List<int>> stderr;
@override
final IOSink stdin;
@override
Future<int> get exitCode async => 0;
@override
bool kill([io.ProcessSignal signal = io.ProcessSignal.sigterm]) {
return true;
}
@override
int get pid => 42;
}
class FakeShaderCompiler implements DevelopmentShaderCompiler {
const FakeShaderCompiler();
@override
void configureCompiler(TargetPlatform? platform) { }
@override
Future<DevFSContent> recompileShader(DevFSContent inputShader) async {
return DevFSByteContent(await inputShader.contentsAsBytes());
}
}
| flutter/packages/flutter_tools/test/general.shard/devfs_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/devfs_test.dart",
"repo_id": "flutter",
"token_count": 14559
} | 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 'dart:async';
import 'dart:convert';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/os.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/fuchsia/application_package.dart';
import 'package:flutter_tools/src/fuchsia/fuchsia_device.dart';
import 'package:flutter_tools/src/fuchsia/fuchsia_ffx.dart';
import 'package:flutter_tools/src/fuchsia/fuchsia_kernel_compiler.dart';
import 'package:flutter_tools/src/fuchsia/fuchsia_pm.dart';
import 'package:flutter_tools/src/fuchsia/fuchsia_sdk.dart';
import 'package:flutter_tools/src/fuchsia/pkgctl.dart';
import 'package:flutter_tools/src/globals.dart' as globals;
import 'package:flutter_tools/src/project.dart';
import 'package:test/fake.dart';
import '../../src/common.dart';
import '../../src/context.dart';
import '../../src/fakes.dart';
void main() {
group('Fuchsia app start and stop: ', () {
late MemoryFileSystem memoryFileSystem;
late FakeOperatingSystemUtils osUtils;
late FakeFuchsiaDeviceTools fuchsiaDeviceTools;
late FakeFuchsiaSdk fuchsiaSdk;
late Artifacts artifacts;
late FakeProcessManager fakeSuccessfulProcessManager;
late FakeProcessManager fakeFailedProcessManagerForHostAddress;
late File sshConfig;
setUp(() {
memoryFileSystem = MemoryFileSystem.test();
osUtils = FakeOperatingSystemUtils();
fuchsiaDeviceTools = FakeFuchsiaDeviceTools();
fuchsiaSdk = FakeFuchsiaSdk();
sshConfig = MemoryFileSystem.test().file('ssh_config')
..writeAsStringSync('\n');
artifacts = Artifacts.test();
for (final BuildMode mode in <BuildMode>[
BuildMode.debug,
BuildMode.release
]) {
memoryFileSystem
.file(
artifacts.getArtifactPath(Artifact.fuchsiaKernelCompiler,
platform: TargetPlatform.fuchsia_arm64, mode: mode),
)
.createSync();
memoryFileSystem
.file(
artifacts.getArtifactPath(Artifact.platformKernelDill,
platform: TargetPlatform.fuchsia_arm64, mode: mode),
)
.createSync();
memoryFileSystem
.file(
artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath,
platform: TargetPlatform.fuchsia_arm64, mode: mode),
)
.createSync();
memoryFileSystem
.file(
artifacts.getArtifactPath(Artifact.fuchsiaFlutterRunner,
platform: TargetPlatform.fuchsia_arm64, mode: mode),
)
.createSync();
}
fakeSuccessfulProcessManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: <String>[
'ssh',
'-F',
sshConfig.absolute.path,
'123',
r'echo $SSH_CONNECTION'
],
stdout:
'fe80::8c6c:2fff:fe3d:c5e1%ethp0003 50666 fe80::5054:ff:fe63:5e7a%ethp0003 22',
),
]);
fakeFailedProcessManagerForHostAddress =
FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: <String>[
'ssh',
'-F',
sshConfig.absolute.path,
'123',
r'echo $SSH_CONNECTION'
],
stdout:
'fe80::8c6c:2fff:fe3d:c5e1%ethp0003 50666 fe80::5054:ff:fe63:5e7a%ethp0003 22',
exitCode: 1,
),
]);
});
Future<LaunchResult> setupAndStartApp({
required bool prebuilt,
required BuildMode mode,
}) async {
const String appName = 'app_name';
final FuchsiaDevice device = FuchsiaDeviceWithFakeDiscovery('123');
globals.fs.directory('fuchsia').createSync(recursive: true);
final File pubspecFile = globals.fs.file('pubspec.yaml')..createSync();
pubspecFile.writeAsStringSync('name: $appName');
FuchsiaApp? app;
if (prebuilt) {
final File far = globals.fs.file('app_name-0.far')..createSync();
app = FuchsiaApp.fromPrebuiltApp(far);
} else {
globals.fs.file(globals.fs.path.join('fuchsia', 'meta', '$appName.cm'))
..createSync(recursive: true)
..writeAsStringSync('{}');
globals.fs.file('.packages').createSync();
globals.fs
.file(globals.fs.path.join('lib', 'main.dart'))
.createSync(recursive: true);
app = BuildableFuchsiaApp(
project:
FlutterProject.fromDirectoryTest(globals.fs.currentDirectory)
.fuchsia);
}
final DebuggingOptions debuggingOptions = DebuggingOptions.disabled(
BuildInfo(mode, null, treeShakeIcons: false));
return device.startApp(
app!,
prebuiltApplication: prebuilt,
debuggingOptions: debuggingOptions,
);
}
testUsingContext(
'start prebuilt in release mode fails without session',
() async {
final LaunchResult launchResult =
await setupAndStartApp(prebuilt: true, mode: BuildMode.release);
expect(launchResult.started, isFalse);
expect(launchResult.hasVmService, isFalse);
}, overrides: <Type, Generator>{
Artifacts: () => artifacts,
FileSystem: () => memoryFileSystem,
ProcessManager: () => fakeSuccessfulProcessManager,
FuchsiaDeviceTools: () => fuchsiaDeviceTools,
FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig),
FuchsiaSdk: () => fuchsiaSdk,
OperatingSystemUtils: () => osUtils,
});
testUsingContext('start prebuilt in release mode with session', () async {
final LaunchResult launchResult =
await setupAndStartApp(prebuilt: true, mode: BuildMode.release);
expect(launchResult.started, isTrue);
expect(launchResult.hasVmService, isFalse);
}, overrides: <Type, Generator>{
Artifacts: () => artifacts,
FileSystem: () => memoryFileSystem,
ProcessManager: () => fakeSuccessfulProcessManager,
FuchsiaDeviceTools: () => fuchsiaDeviceTools,
FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig),
FuchsiaSdk: () => FakeFuchsiaSdk(ffx: FakeFuchsiaFfxWithSession()),
OperatingSystemUtils: () => osUtils,
});
testUsingContext(
'start and stop prebuilt in release mode fails without session',
() async {
const String appName = 'app_name';
final FuchsiaDevice device = FuchsiaDeviceWithFakeDiscovery('123');
globals.fs.directory('fuchsia').createSync(recursive: true);
final File pubspecFile = globals.fs.file('pubspec.yaml')..createSync();
pubspecFile.writeAsStringSync('name: $appName');
final File far = globals.fs.file('app_name-0.far')..createSync();
final FuchsiaApp app = FuchsiaApp.fromPrebuiltApp(far)!;
final DebuggingOptions debuggingOptions = DebuggingOptions.disabled(
const BuildInfo(BuildMode.release, null, treeShakeIcons: false));
final LaunchResult launchResult = await device.startApp(app,
prebuiltApplication: true, debuggingOptions: debuggingOptions);
expect(launchResult.started, isFalse);
expect(launchResult.hasVmService, isFalse);
}, overrides: <Type, Generator>{
Artifacts: () => artifacts,
FileSystem: () => memoryFileSystem,
ProcessManager: () => fakeSuccessfulProcessManager,
FuchsiaDeviceTools: () => fuchsiaDeviceTools,
FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig),
FuchsiaSdk: () => fuchsiaSdk,
OperatingSystemUtils: () => osUtils,
});
testUsingContext('start and stop prebuilt in release mode with session',
() async {
const String appName = 'app_name';
final FuchsiaDevice device = FuchsiaDeviceWithFakeDiscovery('123');
globals.fs.directory('fuchsia').createSync(recursive: true);
final File pubspecFile = globals.fs.file('pubspec.yaml')..createSync();
pubspecFile.writeAsStringSync('name: $appName');
final File far = globals.fs.file('app_name-0.far')..createSync();
final FuchsiaApp app = FuchsiaApp.fromPrebuiltApp(far)!;
final DebuggingOptions debuggingOptions = DebuggingOptions.disabled(
const BuildInfo(BuildMode.release, null, treeShakeIcons: false));
final LaunchResult launchResult = await device.startApp(app,
prebuiltApplication: true, debuggingOptions: debuggingOptions);
expect(launchResult.started, isTrue);
expect(launchResult.hasVmService, isFalse);
expect(await device.stopApp(app), isTrue);
}, overrides: <Type, Generator>{
Artifacts: () => artifacts,
FileSystem: () => memoryFileSystem,
ProcessManager: () => fakeSuccessfulProcessManager,
FuchsiaDeviceTools: () => fuchsiaDeviceTools,
FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig),
FuchsiaSdk: () => FakeFuchsiaSdk(ffx: FakeFuchsiaFfxWithSession()),
OperatingSystemUtils: () => osUtils,
});
testUsingContext(
'start prebuilt in debug mode fails without session',
() async {
final LaunchResult launchResult =
await setupAndStartApp(prebuilt: true, mode: BuildMode.debug);
expect(launchResult.started, isFalse);
}, overrides: <Type, Generator>{
Artifacts: () => artifacts,
FileSystem: () => memoryFileSystem,
ProcessManager: () => fakeSuccessfulProcessManager,
FuchsiaDeviceTools: () => fuchsiaDeviceTools,
FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig),
FuchsiaSdk: () => fuchsiaSdk,
OperatingSystemUtils: () => osUtils,
});
testUsingContext('start prebuilt in debug mode with session', () async {
final LaunchResult launchResult =
await setupAndStartApp(prebuilt: true, mode: BuildMode.debug);
expect(launchResult.started, isTrue);
expect(launchResult.hasVmService, isTrue);
}, overrides: <Type, Generator>{
Artifacts: () => artifacts,
FileSystem: () => memoryFileSystem,
ProcessManager: () => fakeSuccessfulProcessManager,
FuchsiaDeviceTools: () => fuchsiaDeviceTools,
FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig),
FuchsiaSdk: () => FakeFuchsiaSdk(ffx: FakeFuchsiaFfxWithSession()),
OperatingSystemUtils: () => osUtils,
});
testUsingContext(
'start buildable in release mode fails without session',
() async {
expect(
() async => setupAndStartApp(prebuilt: false, mode: BuildMode.release),
throwsToolExit(
message: 'This tool does not currently build apps for fuchsia.\n'
'Build the app using a supported Fuchsia workflow.\n'
'Then use the --use-application-binary flag.'));
}, overrides: <Type, Generator>{
Artifacts: () => artifacts,
FileSystem: () => memoryFileSystem,
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>[
'Artifact.genSnapshot.TargetPlatform.fuchsia_arm64.release',
'--deterministic',
'--snapshot_kind=app-aot-elf',
'--elf=build/fuchsia/elf.aotsnapshot',
'build/fuchsia/app_name.dil',
],
),
FakeCommand(
command: <String>[
'ssh',
'-F',
sshConfig.absolute.path,
'123',
r'echo $SSH_CONNECTION'
],
stdout:
'fe80::8c6c:2fff:fe3d:c5e1%ethp0003 50666 fe80::5054:ff:fe63:5e7a%ethp0003 22',
),
]),
FuchsiaDeviceTools: () => fuchsiaDeviceTools,
FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig),
FuchsiaSdk: () => fuchsiaSdk,
OperatingSystemUtils: () => osUtils,
});
testUsingContext(
'start buildable in release mode with session fails, does not build apps yet',
() async {
expect(
() async => setupAndStartApp(prebuilt: false, mode: BuildMode.release),
throwsToolExit(
message: 'This tool does not currently build apps for fuchsia.\n'
'Build the app using a supported Fuchsia workflow.\n'
'Then use the --use-application-binary flag.'));
}, overrides: <Type, Generator>{
Artifacts: () => artifacts,
FileSystem: () => memoryFileSystem,
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>[
'Artifact.genSnapshot.TargetPlatform.fuchsia_arm64.release',
'--deterministic',
'--snapshot_kind=app-aot-elf',
'--elf=build/fuchsia/elf.aotsnapshot',
'build/fuchsia/app_name.dil',
],
),
FakeCommand(
command: <String>[
'ssh',
'-F',
sshConfig.absolute.path,
'123',
r'echo $SSH_CONNECTION'
],
stdout:
'fe80::8c6c:2fff:fe3d:c5e1%ethp0003 50666 fe80::5054:ff:fe63:5e7a%ethp0003 22',
),
]),
FuchsiaDeviceTools: () => fuchsiaDeviceTools,
FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig),
FuchsiaSdk: () => FakeFuchsiaSdk(ffx: FakeFuchsiaFfxWithSession()),
OperatingSystemUtils: () => osUtils,
});
testUsingContext(
'start buildable in debug mode fails without session',
() async {
expect(
() async => setupAndStartApp(prebuilt: false, mode: BuildMode.debug),
throwsToolExit(
message: 'This tool does not currently build apps for fuchsia.\n'
'Build the app using a supported Fuchsia workflow.\n'
'Then use the --use-application-binary flag.'));
}, overrides: <Type, Generator>{
Artifacts: () => artifacts,
FileSystem: () => memoryFileSystem,
ProcessManager: () => fakeSuccessfulProcessManager,
FuchsiaDeviceTools: () => fuchsiaDeviceTools,
FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig),
FuchsiaSdk: () => fuchsiaSdk,
OperatingSystemUtils: () => osUtils,
});
testUsingContext(
'start buildable in debug mode with session fails, does not build apps yet',
() async {
expect(
() async => setupAndStartApp(prebuilt: false, mode: BuildMode.debug),
throwsToolExit(
message: 'This tool does not currently build apps for fuchsia.\n'
'Build the app using a supported Fuchsia workflow.\n'
'Then use the --use-application-binary flag.'));
}, overrides: <Type, Generator>{
Artifacts: () => artifacts,
FileSystem: () => memoryFileSystem,
ProcessManager: () => fakeSuccessfulProcessManager,
FuchsiaDeviceTools: () => fuchsiaDeviceTools,
FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig),
FuchsiaSdk: () => FakeFuchsiaSdk(ffx: FakeFuchsiaFfxWithSession()),
OperatingSystemUtils: () => osUtils,
});
testUsingContext('fail when cant get ssh config', () async {
expect(
() async => setupAndStartApp(prebuilt: true, mode: BuildMode.release),
throwsToolExit(
message: 'Cannot interact with device. No ssh config.\n'
'Try setting FUCHSIA_SSH_CONFIG or FUCHSIA_BUILD_DIR.'));
}, overrides: <Type, Generator>{
Artifacts: () => artifacts,
FileSystem: () => memoryFileSystem,
ProcessManager: () => FakeProcessManager.any(),
FuchsiaArtifacts: () => FuchsiaArtifacts(),
FuchsiaSdk: () => FakeFuchsiaSdk(ffx: FakeFuchsiaFfxWithSession()),
OperatingSystemUtils: () => osUtils,
});
testUsingContext('fail when cant get host address', () async {
expect(() async => FuchsiaDeviceWithFakeDiscovery('123').hostAddress,
throwsToolExit(message: 'Failed to get local address, aborting.'));
}, overrides: <Type, Generator>{
Artifacts: () => artifacts,
FileSystem: () => memoryFileSystem,
ProcessManager: () => fakeFailedProcessManagerForHostAddress,
FuchsiaDeviceTools: () => fuchsiaDeviceTools,
FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig),
OperatingSystemUtils: () => osUtils,
Platform: () => FakePlatform(),
});
testUsingContext('fail with correct LaunchResult when pm fails', () async {
final LaunchResult launchResult =
await setupAndStartApp(prebuilt: true, mode: BuildMode.release);
expect(launchResult.started, isFalse);
expect(launchResult.hasVmService, isFalse);
}, overrides: <Type, Generator>{
Artifacts: () => artifacts,
FileSystem: () => memoryFileSystem,
ProcessManager: () => fakeSuccessfulProcessManager,
FuchsiaDeviceTools: () => fuchsiaDeviceTools,
FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig),
FuchsiaSdk: () => FakeFuchsiaSdk(pm: FailingPM()),
OperatingSystemUtils: () => osUtils,
});
testUsingContext('fail with correct LaunchResult when pkgctl fails',
() async {
final LaunchResult launchResult =
await setupAndStartApp(prebuilt: true, mode: BuildMode.release);
expect(launchResult.started, isFalse);
expect(launchResult.hasVmService, isFalse);
}, overrides: <Type, Generator>{
Artifacts: () => artifacts,
FileSystem: () => memoryFileSystem,
ProcessManager: () => fakeSuccessfulProcessManager,
FuchsiaDeviceTools: () => FakeFuchsiaDeviceTools(pkgctl: FailingPkgctl()),
FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig),
FuchsiaSdk: () => fuchsiaSdk,
OperatingSystemUtils: () => osUtils,
});
});
}
Process _createFakeProcess({
int exitCode = 0,
String stdout = '',
String stderr = '',
bool persistent = false,
}) {
final Stream<List<int>> stdoutStream =
Stream<List<int>>.fromIterable(<List<int>>[
utf8.encode(stdout),
]);
final Stream<List<int>> stderrStream =
Stream<List<int>>.fromIterable(<List<int>>[
utf8.encode(stderr),
]);
final Completer<int> exitCodeCompleter = Completer<int>();
final Process process = FakeProcess(
stdout: stdoutStream,
stderr: stderrStream,
exitCode:
persistent ? exitCodeCompleter.future : Future<int>.value(exitCode),
);
return process;
}
class FuchsiaDeviceWithFakeDiscovery extends FuchsiaDevice {
FuchsiaDeviceWithFakeDiscovery(super.id, {super.name = ''});
@override
FuchsiaIsolateDiscoveryProtocol getIsolateDiscoveryProtocol(
String isolateName) {
return FakeFuchsiaIsolateDiscoveryProtocol();
}
@override
Future<TargetPlatform> get targetPlatform async =>
TargetPlatform.fuchsia_arm64;
}
class FakeFuchsiaIsolateDiscoveryProtocol
implements FuchsiaIsolateDiscoveryProtocol {
@override
FutureOr<Uri> get uri => Uri.parse('http://[::1]:37');
@override
void dispose() {}
}
class FakeFuchsiaPkgctl implements FuchsiaPkgctl {
@override
Future<bool> addRepo(
FuchsiaDevice device, FuchsiaPackageServer server) async {
return true;
}
@override
Future<bool> resolve(
FuchsiaDevice device, String serverName, String packageName) async {
return true;
}
@override
Future<bool> rmRepo(FuchsiaDevice device, FuchsiaPackageServer server) async {
return true;
}
}
class FailingPkgctl implements FuchsiaPkgctl {
@override
Future<bool> addRepo(
FuchsiaDevice device, FuchsiaPackageServer server) async {
return false;
}
@override
Future<bool> resolve(
FuchsiaDevice device, String serverName, String packageName) async {
return false;
}
@override
Future<bool> rmRepo(FuchsiaDevice device, FuchsiaPackageServer server) async {
return false;
}
}
class FakeFuchsiaDeviceTools implements FuchsiaDeviceTools {
FakeFuchsiaDeviceTools({
FuchsiaPkgctl? pkgctl,
FuchsiaFfx? ffx,
}) : pkgctl = pkgctl ?? FakeFuchsiaPkgctl(),
ffx = ffx ?? FakeFuchsiaFfx();
@override
final FuchsiaPkgctl pkgctl;
@override
final FuchsiaFfx ffx;
}
class FakeFuchsiaPM implements FuchsiaPM {
String? _appName;
@override
Future<bool> init(String buildPath, String appName) async {
if (!globals.fs.directory(buildPath).existsSync()) {
return false;
}
globals.fs
.file(globals.fs.path.join(buildPath, 'meta', 'package'))
.createSync(recursive: true);
_appName = appName;
return true;
}
@override
Future<bool> build(String buildPath, String manifestPath) async {
if (!globals.fs
.file(globals.fs.path.join(buildPath, 'meta', 'package'))
.existsSync() ||
!globals.fs.file(manifestPath).existsSync()) {
return false;
}
globals.fs
.file(globals.fs.path.join(buildPath, 'meta.far'))
.createSync(recursive: true);
return true;
}
@override
Future<bool> archive(String buildPath, String manifestPath) async {
if (!globals.fs
.file(globals.fs.path.join(buildPath, 'meta', 'package'))
.existsSync() ||
!globals.fs.file(manifestPath).existsSync()) {
return false;
}
if (_appName == null) {
return false;
}
globals.fs
.file(globals.fs.path.join(buildPath, '$_appName-0.far'))
.createSync(recursive: true);
return true;
}
@override
Future<bool> newrepo(String repoPath) async {
if (!globals.fs.directory(repoPath).existsSync()) {
return false;
}
return true;
}
@override
Future<Process> serve(String repoPath, String host, int port) async {
return _createFakeProcess(persistent: true);
}
@override
Future<bool> publish(String repoPath, String packagePath) async {
if (!globals.fs.directory(repoPath).existsSync()) {
return false;
}
if (!globals.fs.file(packagePath).existsSync()) {
return false;
}
return true;
}
}
class FailingPM implements FuchsiaPM {
@override
Future<bool> init(String buildPath, String appName) async {
return false;
}
@override
Future<bool> build(String buildPath, String manifestPath) async {
return false;
}
@override
Future<bool> archive(String buildPath, String manifestPath) async {
return false;
}
@override
Future<bool> newrepo(String repoPath) async {
return false;
}
@override
Future<Process> serve(String repoPath, String host, int port) async {
return _createFakeProcess(exitCode: 6);
}
@override
Future<bool> publish(String repoPath, String packagePath) async {
return false;
}
}
class FakeFuchsiaKernelCompiler implements FuchsiaKernelCompiler {
@override
Future<void> build({
required FuchsiaProject fuchsiaProject,
required String target, // E.g., lib/main.dart
BuildInfo buildInfo = BuildInfo.debug,
}) async {
final String outDir = getFuchsiaBuildDirectory();
final String appName = fuchsiaProject.project.manifest.appName;
final String manifestPath =
globals.fs.path.join(outDir, '$appName.dilpmanifest');
globals.fs.file(manifestPath).createSync(recursive: true);
}
}
class FakeFuchsiaFfx implements FuchsiaFfx {
@override
Future<List<String>> list({Duration? timeout}) async {
return <String>['192.168.42.172 scare-cable-skip-ffx'];
}
@override
Future<String> resolve(String deviceName) async {
return '192.168.42.10';
}
@override
Future<String?> sessionShow() async {
return null;
}
@override
Future<bool> sessionAdd(String url) async {
return false;
}
}
class FakeFuchsiaFfxWithSession implements FuchsiaFfx {
@override
Future<List<String>> list({Duration? timeout}) async {
return <String>['192.168.42.172 scare-cable-skip-ffx'];
}
@override
Future<String> resolve(String deviceName) async {
return '192.168.42.10';
}
@override
Future<String> sessionShow() async {
return 'session info';
}
@override
Future<bool> sessionAdd(String url) async {
return true;
}
}
class FakeFuchsiaSdk extends Fake implements FuchsiaSdk {
FakeFuchsiaSdk({
FuchsiaPM? pm,
FuchsiaKernelCompiler? compiler,
FuchsiaFfx? ffx,
}) : fuchsiaPM = pm ?? FakeFuchsiaPM(),
fuchsiaKernelCompiler = compiler ?? FakeFuchsiaKernelCompiler(),
fuchsiaFfx = ffx ?? FakeFuchsiaFfx();
@override
final FuchsiaPM fuchsiaPM;
@override
final FuchsiaKernelCompiler fuchsiaKernelCompiler;
@override
final FuchsiaFfx fuchsiaFfx;
}
| flutter/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_start_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_start_test.dart",
"repo_id": "flutter",
"token_count": 10355
} | 781 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:convert';
import 'package:file/memory.dart';
import 'package:file_testing/file_testing.dart';
import 'package:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/process.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/device.dart';
import 'package:flutter_tools/src/ios/ios_deploy.dart';
import 'package:test/fake.dart';
import '../../src/common.dart';
import '../../src/fake_process_manager.dart';
import '../../src/fakes.dart';
void main () {
late Artifacts artifacts;
late String iosDeployPath;
late FileSystem fileSystem;
setUp(() {
artifacts = Artifacts.test();
iosDeployPath = artifacts.getHostArtifact(HostArtifact.iosDeploy).path;
fileSystem = MemoryFileSystem.test();
});
testWithoutContext('IOSDeploy.iosDeployEnv returns path with /usr/bin first', () {
final IOSDeploy iosDeploy = setUpIOSDeploy(FakeProcessManager.any());
final Map<String, String> environment = iosDeploy.iosDeployEnv;
expect(environment['PATH'], startsWith('/usr/bin'));
});
group('IOSDeploy.prepareDebuggerForLaunch', () {
testWithoutContext('calls ios-deploy with correct arguments and returns when debugger attaches', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: <String>[
'script',
'-t',
'0',
'/dev/null',
iosDeployPath,
'--id',
'123',
'--bundle',
'/',
'--app_deltas',
'app-delta',
'--uninstall',
'--debug',
'--args',
<String>[
'--enable-dart-profiling',
].join(' '),
], environment: const <String, String>{
'PATH': '/usr/bin:/usr/local/bin:/usr/bin',
'DYLD_LIBRARY_PATH': '/path/to/libraries',
},
stdout: '(lldb) run\nsuccess\nDid finish launching.',
),
]);
final Directory appDeltaDirectory = fileSystem.directory('app-delta');
final IOSDeploy iosDeploy = setUpIOSDeploy(processManager, artifacts: artifacts);
final IOSDeployDebugger iosDeployDebugger = iosDeploy.prepareDebuggerForLaunch(
deviceId: '123',
bundlePath: '/',
appDeltaDirectory: appDeltaDirectory,
launchArguments: <String>['--enable-dart-profiling'],
interfaceType: DeviceConnectionInterface.wireless,
uninstallFirst: true,
);
expect(iosDeployDebugger.logLines, emits('Did finish launching.'));
expect(await iosDeployDebugger.launchAndAttach(), isTrue);
await iosDeployDebugger.logLines.drain<Object?>();
expect(processManager, hasNoRemainingExpectations);
expect(appDeltaDirectory, exists);
});
});
group('IOSDeployDebugger', () {
group('launch', () {
late BufferLogger logger;
setUp(() {
logger = BufferLogger.test();
});
testWithoutContext('custom lldb prompt', () async {
final StreamController<List<int>> stdin = StreamController<List<int>>();
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>['ios-deploy'],
stdout: "(mylldb) platform select remote-'ios' --sysroot\r\n(mylldb) run\r\nsuccess\r\n",
stdin: IOSink(stdin.sink),
),
]);
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
expect(await iosDeployDebugger.launchAndAttach(), isTrue);
});
testWithoutContext('debugger attached and stopped', () async {
final StreamController<List<int>> stdin = StreamController<List<int>>();
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>['ios-deploy'],
stdout: "(lldb) run\r\nsuccess\r\nsuccess\r\nLog on attach1\r\n\r\nLog on attach2\r\n\r\n\r\n\r\nPROCESS_STOPPED\r\nLog after process stop\r\nthread backtrace all\r\n* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP",
stdin: IOSink(stdin.sink),
),
]);
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
final List<String> receivedLogLines = <String>[];
final Stream<String> logLines = iosDeployDebugger.logLines
..listen(receivedLogLines.add);
expect(iosDeployDebugger.logLines, emitsInOrder(<String>[
'success', // ignore first "success" from lldb, but log subsequent ones from real logging.
'Log on attach1',
'Log on attach2',
'',
'',
'Log after process stop',
]));
expect(stdin.stream.transform<String>(const Utf8Decoder()), emitsInOrder(<String>[
'thread backtrace all',
'\n',
'process detach',
]));
expect(await iosDeployDebugger.launchAndAttach(), isTrue);
await logLines.drain<Object?>();
expect(logger.traceText, contains('PROCESS_STOPPED'));
expect(logger.traceText, contains('thread backtrace all'));
expect(logger.traceText, contains('* thread #1'));
});
testWithoutContext('debugger attached and stop failed', () async {
final StreamController<List<int>> stdin = StreamController<List<int>>();
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>['ios-deploy'],
stdout: '(lldb) run\r\nsuccess\r\nsuccess\r\nprocess signal SIGSTOP\r\n\r\nerror: Failed to send signal 17: failed to send signal 17',
stdin: IOSink(stdin.sink),
),
]);
final IOSDeployDebuggerWaitForExit iosDeployDebugger = IOSDeployDebuggerWaitForExit.test(
processManager: processManager,
logger: logger,
);
expect(iosDeployDebugger.logLines, emitsInOrder(<String>[
'success',
]));
expect(await iosDeployDebugger.launchAndAttach(), isTrue);
await iosDeployDebugger.exitCompleter.future;
});
testWithoutContext('handle processing logging after process exit', () async {
final StreamController<List<int>> stdin = StreamController<List<int>>();
// Make sure we don't hit a race where logging processed after the process exits
// causes listeners to receive logging on the closed logLines stream.
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>['ios-deploy'],
stdout: 'stdout: "(lldb) run\r\nsuccess\r\n',
stdin: IOSink(stdin.sink),
outputFollowsExit: true,
),
]);
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
expect(iosDeployDebugger.logLines, emitsDone);
expect(await iosDeployDebugger.launchAndAttach(), isFalse);
await iosDeployDebugger.logLines.drain<Object?>();
});
testWithoutContext('app exit', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['ios-deploy'],
stdout: '(lldb) run\r\nsuccess\r\nLog on attach\r\nProcess 100 exited with status = 0\r\nLog after process exit',
),
]);
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
expect(iosDeployDebugger.logLines, emitsInOrder(<String>[
'Log on attach',
'Log after process exit',
]));
expect(await iosDeployDebugger.launchAndAttach(), isTrue);
await iosDeployDebugger.logLines.drain<Object?>();
});
testWithoutContext('app crash', () async {
final StreamController<List<int>> stdin = StreamController<List<int>>();
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>['ios-deploy'],
stdout:
'(lldb) run\r\nsuccess\r\nLog on attach\r\n(lldb) Process 6156 stopped\r\n* thread #1, stop reason = Assertion failed:\r\nthread backtrace all\r\n* thread #1, stop reason = Assertion failed:',
stdin: IOSink(stdin.sink),
),
]);
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
expect(iosDeployDebugger.logLines, emitsInOrder(<String>[
'Log on attach',
'* thread #1, stop reason = Assertion failed:',
]));
expect(stdin.stream.transform<String>(const Utf8Decoder()), emitsInOrder(<String>[
'thread backtrace all',
'\n',
'process detach',
]));
expect(await iosDeployDebugger.launchAndAttach(), isTrue);
await iosDeployDebugger.logLines.drain<Object?>();
expect(logger.traceText, contains('Process 6156 stopped'));
expect(logger.traceText, contains('thread backtrace all'));
expect(logger.traceText, contains('* thread #1'));
});
testWithoutContext('attach failed', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['ios-deploy'],
// A success after an error should never happen, but test that we're handling random "successes" anyway.
stdout: '(lldb) run\r\nerror: process launch failed\r\nsuccess\r\nLog on attach1',
),
]);
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
// Debugger lines are double spaced, separated by an extra \r\n. Skip the extra lines.
// Still include empty lines other than the extra added newlines.
expect(iosDeployDebugger.logLines, emitsDone);
expect(await iosDeployDebugger.launchAndAttach(), isFalse);
await iosDeployDebugger.logLines.drain<Object?>();
});
testWithoutContext('no provisioning profile 1, stdout', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['ios-deploy'],
stdout: 'Error 0xe8008015',
),
]);
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
await iosDeployDebugger.launchAndAttach();
expect(logger.errorText, contains('No Provisioning Profile was found'));
});
testWithoutContext('no provisioning profile 2, stderr', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['ios-deploy'],
stderr: 'Error 0xe8000067',
),
]);
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
await iosDeployDebugger.launchAndAttach();
expect(logger.errorText, contains('No Provisioning Profile was found'));
});
testWithoutContext('device locked code', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['ios-deploy'],
stdout: 'e80000e2',
),
]);
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
await iosDeployDebugger.launchAndAttach();
expect(logger.errorText, contains('Your device is locked.'));
});
testWithoutContext('device locked message', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['ios-deploy'],
stdout: '[ +95 ms] error: The operation couldn’t be completed. Unable to launch io.flutter.examples.gallery because the device was not, or could not be, unlocked.',
),
]);
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
await iosDeployDebugger.launchAndAttach();
expect(logger.errorText, contains('Your device is locked.'));
});
testWithoutContext('unknown app launch error', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['ios-deploy'],
stdout: 'Error 0xe8000022',
),
]);
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
await iosDeployDebugger.launchAndAttach();
expect(logger.errorText, contains('Try launching from within Xcode'));
});
testWithoutContext('debugger attached and received logs', () async {
final StreamController<List<int>> stdin = StreamController<List<int>>();
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>['ios-deploy'],
stdout: '(lldb) run\r\nsuccess\r\nLog on attach1\r\n\r\nLog on attach2\r\n',
stdin: IOSink(stdin.sink),
),
]);
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
final List<String> receivedLogLines = <String>[];
final Stream<String> logLines = iosDeployDebugger.logLines
..listen(receivedLogLines.add);
expect(iosDeployDebugger.logLines, emitsInOrder(<String>[
'Log on attach1',
'Log on attach2',
]));
expect(await iosDeployDebugger.launchAndAttach(), isTrue);
await logLines.drain<Object?>();
expect(LineSplitter.split(logger.traceText), containsOnce('Received logs from ios-deploy.'));
});
});
testWithoutContext('detach', () async {
final StreamController<List<int>> stdin = StreamController<List<int>>();
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>[
'ios-deploy',
],
stdout: '(lldb) run\nsuccess',
stdin: IOSink(stdin.sink),
),
]);
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
);
expect(stdin.stream.transform<String>(const Utf8Decoder()), emits('process detach'));
await iosDeployDebugger.launchAndAttach();
await iosDeployDebugger.detach();
});
testWithoutContext('detach handles broken pipe', () async {
final StreamSink<List<int>> stdinSink = _ClosedStdinController();
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>['ios-deploy'],
stdout: '(lldb) run\nsuccess',
stdin: IOSink(stdinSink),
),
]);
final BufferLogger logger = BufferLogger.test();
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
await iosDeployDebugger.launchAndAttach();
await iosDeployDebugger.detach();
expect(logger.traceText, contains('Could not detach from debugger'));
});
testWithoutContext('stop with backtrace', () async {
final StreamController<List<int>> stdin = StreamController<List<int>>();
final Stream<String> stdinStream = stdin.stream.transform<String>(const Utf8Decoder());
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>[
'ios-deploy',
],
stdout:
'(lldb) run\nsuccess\nLog on attach\n(lldb) Process 6156 stopped\n* thread #1, stop reason = Assertion failed:\n(lldb) Process 6156 detached',
stdin: IOSink(stdin),
),
]);
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
);
await iosDeployDebugger.launchAndAttach();
List<String>? stdinLines;
// These two futures will deadlock if await-ed sequentially
await Future.wait(<Future<void>>[
iosDeployDebugger.stopAndDumpBacktrace(),
stdinStream.take(5).toList().then<void>(
(List<String> lines) => stdinLines = lines,
),
]);
expect(stdinLines, const <String>[
'thread backtrace all',
'\n',
'process detach',
'\n',
'process signal SIGSTOP',
]);
});
testWithoutContext('pause with backtrace', () async {
final StreamController<List<int>> stdin = StreamController<List<int>>();
final Stream<String> stdinStream = stdin.stream.transform<String>(const Utf8Decoder());
const String stdout = '''
(lldb) run
success
Log on attach
(lldb) Process 6156 stopped
* thread #1, stop reason = Assertion failed:
thread backtrace all
process continue
* thread #1, stop reason = signal SIGSTOP
* frame #0: 0x0000000102eaee80 dyld`dyld3::MachOFile::read_uleb128(Diagnostics&, unsigned char const*&, unsigned char const*) + 36
frame #1: 0x0000000102eabbd4 dyld`dyld3::MachOLoaded::trieWalk(Diagnostics&, unsigned char const*, unsigned char const*, char const*) + 332
frame #2: 0x0000000102eaa078 dyld`DyldSharedCache::hasImagePath(char const*, unsigned int&) const + 144
frame #3: 0x0000000102eaa13c dyld`DyldSharedCache::hasNonOverridablePath(char const*) const + 44
frame #4: 0x0000000102ebc404 dyld`dyld3::closure::ClosureBuilder::findImage(char const*, dyld3::closure::ClosureBuilder::LoadedImageChain const&, dyld3::closure::ClosureBuilder::BuilderLoadedImage*&, dyld3::closure::ClosureBuilder::LinkageType, unsigned int, bool) +
frame #5: 0x0000000102ebd974 dyld`invocation function for block in dyld3::closure::ClosureBuilder::recursiveLoadDependents(dyld3::closure::ClosureBuilder::LoadedImageChain&, bool) + 136
frame #6: 0x0000000102eae1b0 dyld`invocation function for block in dyld3::MachOFile::forEachDependentDylib(void (char const*, bool, bool, bool, unsigned int, unsigned int, bool&) block_pointer) const + 136
frame #7: 0x0000000102eadc38 dyld`dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 168
frame #8: 0x0000000102eae108 dyld`dyld3::MachOFile::forEachDependentDylib(void (char const*, bool, bool, bool, unsigned int, unsigned int, bool&) block_pointer) const + 116
frame #9: 0x0000000102ebd80c dyld`dyld3::closure::ClosureBuilder::recursiveLoadDependents(dyld3::closure::ClosureBuilder::LoadedImageChain&, bool) + 164
frame #10: 0x0000000102ebd8a8 dyld`dyld3::closure::ClosureBuilder::recursiveLoadDependents(dyld3::closure::ClosureBuilder::LoadedImageChain&, bool) + 320
frame #11: 0x0000000102ebd8a8 dyld`dyld3::closure::ClosureBuilder::recursiveLoadDependents(dyld3::closure::ClosureBuilder::LoadedImageChain&, bool) + 320
frame #12: 0x0000000102ebd8a8 dyld`dyld3::closure::ClosureBuilder::recursiveLoadDependents(dyld3::closure::ClosureBuilder::LoadedImageChain&, bool) + 320
frame #13: 0x0000000102ebd8a8 dyld`dyld3::closure::ClosureBuilder::recursiveLoadDependents(dyld3::closure::ClosureBuilder::LoadedImageChain&, bool) + 320
frame #14: 0x0000000102ebd8a8 dyld`dyld3::closure::ClosureBuilder::recursiveLoadDependents(dyld3::closure::ClosureBuilder::LoadedImageChain&, bool) + 320
frame #15: 0x0000000102ebd8a8 dyld`dyld3::closure::ClosureBuilder::recursiveLoadDependents(dyld3::closure::ClosureBuilder::LoadedImageChain&, bool) + 320
frame #16: 0x0000000102ec7638 dyld`dyld3::closure::ClosureBuilder::makeLaunchClosure(dyld3::closure::LoadedFileInfo const&, bool) + 752
frame #17: 0x0000000102e8fcf0 dyld`dyld::buildLaunchClosure(unsigned char const*, dyld3::closure::LoadedFileInfo const&, char const**) + 344
frame #18: 0x0000000102e8e938 dyld`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 2876
frame #19: 0x0000000102e8922c dyld`dyldbootstrap::start(dyld3::MachOLoaded const*, int, char const**, dyld3::MachOLoaded const*, unsigned long*) + 432
frame #20: 0x0000000102e89038 dyld`_dyld_start + 56
''';
final BufferLogger logger = BufferLogger.test();
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>[
'ios-deploy',
],
stdout: stdout,
stdin: IOSink(stdin.sink),
),
]);
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
await iosDeployDebugger.launchAndAttach();
await iosDeployDebugger.pauseDumpBacktraceResume();
// verify stacktrace was logged to trace
expect(
logger.traceText,
contains(
'frame #0: 0x0000000102eaee80 dyld`dyld3::MachOFile::read_uleb128(Diagnostics&, unsigned char const*&, unsigned char const*) + 36',
),
);
expect(await stdinStream.take(3).toList(), <String>[
'thread backtrace all',
'\n',
'process detach',
]);
});
group('Check for symbols', () {
late String symbolsDirectoryPath;
setUp(() {
fileSystem = MemoryFileSystem.test();
symbolsDirectoryPath = '/Users/swarming/Library/Developer/Xcode/iOS DeviceSupport/16.2 (20C65) arm64e/Symbols';
});
testWithoutContext('and no path provided', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>[
'ios-deploy',
],
stdout:
'(lldb) Process 6156 stopped',
),
]);
final BufferLogger logger = BufferLogger.test();
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
await iosDeployDebugger.launchAndAttach();
await iosDeployDebugger.checkForSymbolsFiles(fileSystem);
expect(iosDeployDebugger.symbolsDirectoryPath, isNull);
expect(logger.traceText, contains('No path provided for Symbols directory.'));
});
testWithoutContext('and unable to find directory', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>[
'ios-deploy',
],
stdout:
'[ 95%] Developer disk image mounted successfully\n'
'Symbol Path: $symbolsDirectoryPath\n'
'[100%] Connecting to remote debug server',
),
]);
final BufferLogger logger = BufferLogger.test();
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
await iosDeployDebugger.launchAndAttach();
await iosDeployDebugger.checkForSymbolsFiles(fileSystem);
expect(iosDeployDebugger.symbolsDirectoryPath, symbolsDirectoryPath);
expect(logger.traceText, contains('Unable to find Symbols directory'));
});
testWithoutContext('and find status', () async {
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>[
'ios-deploy',
],
stdout:
'[ 95%] Developer disk image mounted successfully\n'
'Symbol Path: $symbolsDirectoryPath\n'
'[100%] Connecting to remote debug server',
),
]);
final BufferLogger logger = BufferLogger.test();
final IOSDeployDebugger iosDeployDebugger = IOSDeployDebugger.test(
processManager: processManager,
logger: logger,
);
final Directory symbolsDirectory = fileSystem.directory(symbolsDirectoryPath);
symbolsDirectory.createSync(recursive: true);
final File copyingStatusFile = symbolsDirectory.parent.childFile('.copying_lock');
copyingStatusFile.createSync();
final File processingStatusFile = symbolsDirectory.parent.childFile('.processing_lock');
processingStatusFile.createSync();
await iosDeployDebugger.launchAndAttach();
await iosDeployDebugger.checkForSymbolsFiles(fileSystem);
expect(iosDeployDebugger.symbolsDirectoryPath, symbolsDirectoryPath);
expect(logger.traceText, contains('Symbol files:'));
expect(logger.traceText, contains('.copying_lock'));
expect(logger.traceText, contains('.processing_lock'));
});
});
});
group('IOSDeploy.uninstallApp', () {
testWithoutContext('calls ios-deploy with correct arguments and returns 0 on success', () async {
const String deviceId = '123';
const String bundleId = 'com.example.app';
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: <String>[
iosDeployPath,
'--id',
deviceId,
'--uninstall_only',
'--bundle_id',
bundleId,
]),
]);
final IOSDeploy iosDeploy = setUpIOSDeploy(processManager, artifacts: artifacts);
final int exitCode = await iosDeploy.uninstallApp(
deviceId: deviceId,
bundleId: bundleId,
);
expect(exitCode, 0);
expect(processManager, hasNoRemainingExpectations);
});
testWithoutContext('returns non-zero exit code when ios-deploy does the same', () async {
const String deviceId = '123';
const String bundleId = 'com.example.app';
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: <String>[
iosDeployPath,
'--id',
deviceId,
'--uninstall_only',
'--bundle_id',
bundleId,
], exitCode: 1),
]);
final IOSDeploy iosDeploy = setUpIOSDeploy(processManager, artifacts: artifacts);
final int exitCode = await iosDeploy.uninstallApp(
deviceId: deviceId,
bundleId: bundleId,
);
expect(exitCode, 1);
expect(processManager, hasNoRemainingExpectations);
});
});
}
class _ClosedStdinController extends Fake implements StreamSink<List<int>> {
@override
Future<Object?> addStream(Stream<List<int>> stream) async => throw const SocketException('Bad pipe');
}
IOSDeploy setUpIOSDeploy(ProcessManager processManager, {
Artifacts? artifacts,
}) {
final FakePlatform macPlatform = FakePlatform(
operatingSystem: 'macos',
environment: <String, String>{
'PATH': '/usr/local/bin:/usr/bin',
}
);
final Cache cache = Cache.test(
platform: macPlatform,
artifacts: <ArtifactSet>[
FakeDyldEnvironmentArtifact(),
],
processManager: FakeProcessManager.any(),
);
return IOSDeploy(
logger: BufferLogger.test(),
platform: macPlatform,
processManager: processManager,
artifacts: artifacts ?? Artifacts.test(),
cache: cache,
);
}
class IOSDeployDebuggerWaitForExit extends IOSDeployDebugger {
IOSDeployDebuggerWaitForExit({
required super.logger,
required super.processUtils,
required super.launchCommand,
required super.iosDeployEnv
});
/// Create a [IOSDeployDebugger] for testing.
///
/// Sets the command to "ios-deploy" and environment to an empty map.
factory IOSDeployDebuggerWaitForExit.test({
required ProcessManager processManager,
Logger? logger,
}) {
final Logger debugLogger = logger ?? BufferLogger.test();
return IOSDeployDebuggerWaitForExit(
logger: debugLogger,
processUtils: ProcessUtils(logger: debugLogger, processManager: processManager),
launchCommand: <String>['ios-deploy'],
iosDeployEnv: <String, String>{},
);
}
final Completer<void> exitCompleter = Completer<void>();
@override
bool exit() {
final bool status = super.exit();
exitCompleter.complete();
return status;
}
}
| flutter/packages/flutter_tools/test/general.shard/ios/ios_deploy_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/ios/ios_deploy_test.dart",
"repo_id": "flutter",
"token_count": 12002
} | 782 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:file/memory.dart';
import 'package:file_testing/file_testing.dart';
import 'package:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/build_system/exceptions.dart';
import 'package:flutter_tools/src/build_system/targets/native_assets.dart';
import 'package:flutter_tools/src/features.dart';
import 'package:flutter_tools/src/isolated/native_assets/native_assets.dart';
import 'package:native_assets_cli/native_assets_cli_internal.dart'
as native_assets_cli;
import 'package:package_config/package_config.dart' show Package;
import '../../../../src/common.dart';
import '../../../../src/context.dart';
import '../../../../src/fakes.dart';
import '../../fake_native_assets_build_runner.dart';
void main() {
late FakeProcessManager processManager;
late Environment iosEnvironment;
late Environment androidEnvironment;
late Artifacts artifacts;
late FileSystem fileSystem;
late Logger logger;
setUp(() {
processManager = FakeProcessManager.empty();
logger = BufferLogger.test();
artifacts = Artifacts.test();
fileSystem = MemoryFileSystem.test();
iosEnvironment = Environment.test(
fileSystem.currentDirectory,
defines: <String, String>{
kBuildMode: BuildMode.profile.cliName,
kTargetPlatform: getNameForTargetPlatform(TargetPlatform.ios),
kIosArchs: 'arm64',
kSdkRoot: 'path/to/iPhoneOS.sdk',
},
inputs: <String, String>{},
artifacts: artifacts,
processManager: processManager,
fileSystem: fileSystem,
logger: logger,
);
androidEnvironment = Environment.test(
fileSystem.currentDirectory,
defines: <String, String>{
kBuildMode: BuildMode.profile.cliName,
kTargetPlatform: getNameForTargetPlatform(TargetPlatform.android),
kAndroidArchs: AndroidArch.arm64_v8a.platformName,
},
inputs: <String, String>{},
artifacts: artifacts,
processManager: processManager,
fileSystem: fileSystem,
logger: logger,
);
iosEnvironment.buildDir.createSync(recursive: true);
androidEnvironment.buildDir.createSync(recursive: true);
});
testWithoutContext('NativeAssets throws error if missing target platform', () async {
iosEnvironment.defines.remove(kTargetPlatform);
expect(const NativeAssets().build(iosEnvironment), throwsA(isA<MissingDefineException>()));
});
testUsingContext('NativeAssets defaults to ios archs if missing', () async {
await createPackageConfig(iosEnvironment);
iosEnvironment.defines.remove(kIosArchs);
final NativeAssetsBuildRunner buildRunner = FakeNativeAssetsBuildRunner();
await NativeAssets(buildRunner: buildRunner).build(iosEnvironment);
final File nativeAssetsYaml =
iosEnvironment.buildDir.childFile('native_assets.yaml');
final File depsFile = iosEnvironment.buildDir.childFile('native_assets.d');
expect(depsFile, exists);
expect(nativeAssetsYaml, exists);
});
testUsingContext('NativeAssets throws error if missing sdk root', () async {
await createPackageConfig(iosEnvironment);
iosEnvironment.defines.remove(kSdkRoot);
expect(const NativeAssets().build(iosEnvironment), throwsA(isA<MissingDefineException>()));
});
// The NativeAssets Target should _always_ be creating a yaml an d file.
// The caching logic depends on this.
for (final bool isNativeAssetsEnabled in <bool>[true, false]) {
final String postFix = isNativeAssetsEnabled ? 'enabled' : 'disabled';
testUsingContext(
'Successful native_assets.yaml and native_assets.d creation with feature $postFix',
overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
FeatureFlags: () => TestFeatureFlags(
isNativeAssetsEnabled: isNativeAssetsEnabled,
),
},
() async {
await createPackageConfig(iosEnvironment);
final NativeAssetsBuildRunner buildRunner = FakeNativeAssetsBuildRunner();
await NativeAssets(buildRunner: buildRunner).build(iosEnvironment);
expect(iosEnvironment.buildDir.childFile('native_assets.d'), exists);
expect(iosEnvironment.buildDir.childFile('native_assets.yaml'), exists);
},
);
}
testUsingContext(
'NativeAssets with an asset',
overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
FeatureFlags: () => TestFeatureFlags(isNativeAssetsEnabled: true),
},
() async {
await createPackageConfig(iosEnvironment);
final NativeAssetsBuildRunner buildRunner = FakeNativeAssetsBuildRunner(
packagesWithNativeAssetsResult: <Package>[Package('foo', iosEnvironment.buildDir.uri)],
buildResult: FakeNativeAssetsBuilderResult(assets: <native_assets_cli.Asset>[
native_assets_cli.Asset(
id: 'package:foo/foo.dart',
linkMode: native_assets_cli.LinkMode.dynamic,
target: native_assets_cli.Target.iOSArm64,
path: native_assets_cli.AssetAbsolutePath(
Uri.file('foo.framework/foo'),
),
)
], dependencies: <Uri>[
Uri.file('src/foo.c'),
]),
);
await NativeAssets(buildRunner: buildRunner).build(iosEnvironment);
final File nativeAssetsYaml = iosEnvironment.buildDir.childFile('native_assets.yaml');
final File depsFile = iosEnvironment.buildDir.childFile('native_assets.d');
expect(depsFile, exists);
// We don't care about the specific format, but it should contain the
// yaml as the file depending on the source files that went in to the
// build.
expect(
depsFile.readAsStringSync(),
stringContainsInOrder(<String>[
nativeAssetsYaml.path,
':',
'src/foo.c',
]),
);
expect(nativeAssetsYaml, exists);
// We don't care about the specific format, but it should contain the
// asset id and the path to the dylib.
expect(
nativeAssetsYaml.readAsStringSync(),
stringContainsInOrder(<String>[
'package:foo/foo.dart',
'foo.framework',
]),
);
},
);
for (final bool hasAssets in <bool>[true, false]) {
final String withOrWithout = hasAssets ? 'with' : 'without';
testUsingContext(
'flutter build $withOrWithout native assets',
overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
FeatureFlags: () => TestFeatureFlags(
isNativeAssetsEnabled: true,
),
},
() async {
await createPackageConfig(androidEnvironment);
await fileSystem.file('libfoo.so').create();
final FakeNativeAssetsBuildRunner buildRunner = FakeNativeAssetsBuildRunner(
packagesWithNativeAssetsResult: <Package>[
Package('foo', androidEnvironment.buildDir.uri)
],
buildResult:
FakeNativeAssetsBuilderResult(assets: <native_assets_cli.Asset>[
if (hasAssets)
native_assets_cli.Asset(
id: 'package:foo/foo.dart',
linkMode: native_assets_cli.LinkMode.dynamic,
target: native_assets_cli.Target.androidArm64,
path: native_assets_cli.AssetAbsolutePath(
Uri.file('libfoo.so'),
),
)
], dependencies: <Uri>[
Uri.file('src/foo.c'),
]),
);
await NativeAssets(buildRunner: buildRunner).build(androidEnvironment);
expect(buildRunner.lastBuildMode, native_assets_cli.BuildMode.release);
},
);
}
}
Future<void> createPackageConfig(Environment iosEnvironment) async {
final File packageConfig = iosEnvironment.projectDir
.childDirectory('.dart_tool')
.childFile('package_config.json');
await packageConfig.parent.create();
await packageConfig.create();
}
| flutter/packages/flutter_tools/test/general.shard/isolated/build_system/targets/native_assets_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/isolated/build_system/targets/native_assets_test.dart",
"repo_id": "flutter",
"token_count": 3179
} | 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 'dart:async';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/os.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/macos/application_package.dart';
import 'package:flutter_tools/src/macos/macos_device.dart';
import 'package:flutter_tools/src/macos/macos_workflow.dart';
import 'package:flutter_tools/src/project.dart';
import 'package:test/fake.dart';
import '../../src/common.dart';
import '../../src/fake_process_manager.dart';
import '../../src/fakes.dart';
final FakePlatform macOS = FakePlatform(
operatingSystem: 'macos',
);
final FakePlatform linux = FakePlatform();
void main() {
testWithoutContext('default configuration', () async {
final MacOSDevice device = MacOSDevice(
processManager: FakeProcessManager.any(),
logger: BufferLogger.test(),
fileSystem: MemoryFileSystem.test(),
operatingSystemUtils: FakeOperatingSystemUtils(),
);
final FakeMacOSApp package = FakeMacOSApp();
expect(await device.targetPlatform, TargetPlatform.darwin);
expect(device.name, 'macOS');
expect(await device.installApp(package), true);
expect(await device.uninstallApp(package), true);
expect(await device.isLatestBuildInstalled(package), true);
expect(await device.isAppInstalled(package), true);
expect(device.category, Category.desktop);
expect(device.supportsRuntimeMode(BuildMode.debug), true);
expect(device.supportsRuntimeMode(BuildMode.profile), true);
expect(device.supportsRuntimeMode(BuildMode.release), true);
expect(device.supportsRuntimeMode(BuildMode.jitRelease), false);
});
testWithoutContext('Attaches to log reader when running in release mode', () async {
final Completer<void> completer = Completer<void>();
final MacOSDevice device = MacOSDevice(
fileSystem: MemoryFileSystem.test(),
processManager: FakeProcessManager.list(<FakeCommand>[
FakeCommand(
command: const <String>['release/executable'],
stdout: 'Hello World\n',
stderr: 'Goodnight, Moon\n',
completer: completer,
),
]),
logger: BufferLogger.test(),
operatingSystemUtils: FakeOperatingSystemUtils(),
);
final FakeMacOSApp package = FakeMacOSApp();
final LaunchResult result = await device.startApp(
package,
debuggingOptions: DebuggingOptions.disabled(BuildInfo.release),
prebuiltApplication: true,
);
expect(result.started, true);
final DeviceLogReader logReader = device.getLogReader(app: package);
expect(logReader.logLines, emitsInAnyOrder(<String>['Hello World', 'Goodnight, Moon']));
completer.complete();
});
testWithoutContext('No devices listed if platform is unsupported', () async {
expect(await MacOSDevices(
fileSystem: MemoryFileSystem.test(),
processManager: FakeProcessManager.any(),
logger: BufferLogger.test(),
platform: linux,
operatingSystemUtils: FakeOperatingSystemUtils(),
macOSWorkflow: MacOSWorkflow(
featureFlags: TestFeatureFlags(isMacOSEnabled: true),
platform: linux,
),
).devices(), isEmpty);
});
testWithoutContext('No devices listed if platform is supported and feature is disabled', () async {
final MacOSDevices macOSDevices = MacOSDevices(
fileSystem: MemoryFileSystem.test(),
processManager: FakeProcessManager.any(),
logger: BufferLogger.test(),
platform: macOS,
operatingSystemUtils: FakeOperatingSystemUtils(),
macOSWorkflow: MacOSWorkflow(
featureFlags: TestFeatureFlags(),
platform: macOS,
),
);
expect(await macOSDevices.devices(), isEmpty);
});
testWithoutContext('devices listed if platform is supported and feature is enabled', () async {
final MacOSDevices macOSDevices = MacOSDevices(
fileSystem: MemoryFileSystem.test(),
processManager: FakeProcessManager.any(),
logger: BufferLogger.test(),
platform: macOS,
operatingSystemUtils: FakeOperatingSystemUtils(),
macOSWorkflow: MacOSWorkflow(
featureFlags: TestFeatureFlags(isMacOSEnabled: true),
platform: macOS,
),
);
expect(await macOSDevices.devices(), hasLength(1));
});
testWithoutContext('has a well known device id macos', () async {
final MacOSDevices macOSDevices = MacOSDevices(
fileSystem: MemoryFileSystem.test(),
processManager: FakeProcessManager.any(),
logger: BufferLogger.test(),
platform: macOS,
operatingSystemUtils: FakeOperatingSystemUtils(),
macOSWorkflow: MacOSWorkflow(
featureFlags: TestFeatureFlags(isMacOSEnabled: true),
platform: macOS,
),
);
expect(macOSDevices.wellKnownIds, <String>['macos']);
});
testWithoutContext('can discover devices with a provided timeout', () async {
final MacOSDevices macOSDevices = MacOSDevices(
fileSystem: MemoryFileSystem.test(),
processManager: FakeProcessManager.any(),
logger: BufferLogger.test(),
platform: macOS,
operatingSystemUtils: FakeOperatingSystemUtils(),
macOSWorkflow: MacOSWorkflow(
featureFlags: TestFeatureFlags(isMacOSEnabled: true),
platform: macOS,
),
);
// Timeout ignored.
final List<Device> devices = await macOSDevices.discoverDevices(timeout: const Duration(seconds: 10));
expect(devices, hasLength(1));
});
testWithoutContext('isSupportedForProject is true with editable host app', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final MacOSDevice device = MacOSDevice(
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
processManager: FakeProcessManager.any(),
operatingSystemUtils: FakeOperatingSystemUtils(),
);
fileSystem.file('pubspec.yaml').createSync();
fileSystem.file('.packages').createSync();
fileSystem.directory('macos').createSync();
final FlutterProject flutterProject = setUpFlutterProject(fileSystem.currentDirectory);
expect(device.isSupportedForProject(flutterProject), true);
});
testWithoutContext('target platform display name on x86_64', () async {
final FakeOperatingSystemUtils fakeOperatingSystemUtils =
FakeOperatingSystemUtils();
fakeOperatingSystemUtils.hostPlatform = HostPlatform.darwin_x64;
final MacOSDevice device = MacOSDevice(
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
processManager: FakeProcessManager.any(),
operatingSystemUtils: fakeOperatingSystemUtils,
);
expect(await device.targetPlatformDisplayName, 'darwin-x64');
});
testWithoutContext('target platform display name on ARM', () async {
final FakeOperatingSystemUtils fakeOperatingSystemUtils =
FakeOperatingSystemUtils();
fakeOperatingSystemUtils.hostPlatform = HostPlatform.darwin_arm64;
final MacOSDevice device = MacOSDevice(
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
processManager: FakeProcessManager.any(),
operatingSystemUtils: fakeOperatingSystemUtils,
);
expect(await device.targetPlatformDisplayName, 'darwin-arm64');
});
testWithoutContext('isSupportedForProject is false with no host app', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final MacOSDevice device = MacOSDevice(
fileSystem: fileSystem,
logger: BufferLogger.test(),
processManager: FakeProcessManager.any(),
operatingSystemUtils: FakeOperatingSystemUtils(),
);
fileSystem.file('pubspec.yaml').createSync();
fileSystem.file('.packages').createSync();
final FlutterProject flutterProject = setUpFlutterProject(fileSystem.currentDirectory);
expect(device.isSupportedForProject(flutterProject), false);
});
testWithoutContext('executablePathForDevice uses the correct package executable', () async {
final FakeMacOSApp package = FakeMacOSApp();
final MacOSDevice device = MacOSDevice(
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
processManager: FakeProcessManager.any(),
operatingSystemUtils: FakeOperatingSystemUtils(),
);
const String debugPath = 'debug/executable';
const String profilePath = 'profile/executable';
const String releasePath = 'release/executable';
expect(device.executablePathForDevice(package, BuildInfo.debug), debugPath);
expect(device.executablePathForDevice(package, BuildInfo.profile), profilePath);
expect(device.executablePathForDevice(package, BuildInfo.release), releasePath);
});
}
FlutterProject setUpFlutterProject(Directory directory) {
final FlutterProjectFactory flutterProjectFactory = FlutterProjectFactory(
fileSystem: directory.fileSystem,
logger: BufferLogger.test(),
);
return flutterProjectFactory.fromDirectory(directory);
}
class FakeMacOSApp extends Fake implements MacOSApp {
@override
String executable(BuildInfo buildInfo) {
return switch (buildInfo) {
BuildInfo.debug => 'debug/executable',
BuildInfo.profile => 'profile/executable',
BuildInfo.release => 'release/executable',
_ => throw StateError('')
};
}
}
| flutter/packages/flutter_tools/test/general.shard/macos/macos_device_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/macos/macos_device_test.dart",
"repo_id": "flutter",
"token_count": 3219
} | 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:fake_async/fake_async.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/device_port_forwarder.dart';
import 'package:flutter_tools/src/protocol_discovery.dart';
import '../src/common.dart';
import '../src/fake_devices.dart';
void main() {
group('service_protocol discovery', () {
late FakeDeviceLogReader logReader;
late ProtocolDiscovery discoverer;
setUp(() {
logReader = FakeDeviceLogReader();
discoverer = ProtocolDiscovery.vmService(
logReader,
ipv6: false,
throttleDuration: const Duration(milliseconds: 5),
logger: BufferLogger.test(),
);
});
testWithoutContext('returns non-null uri future', () async {
expect(discoverer.uri, isNotNull);
});
group('no port forwarding', () {
tearDown(() {
discoverer.cancel();
logReader.dispose();
});
testWithoutContext('discovers uri if logs already produced output', () async {
logReader.addLine('HELLO WORLD');
logReader.addLine('The Dart VM service is listening on http://127.0.0.1:9999');
final Uri uri = (await discoverer.uri)!;
expect(uri.port, 9999);
expect('$uri', 'http://127.0.0.1:9999');
});
testWithoutContext('does not discover uri with no host', () async {
final Future<Uri?> pendingUri = discoverer.uri;
logReader.addLine('The Dart VM service is listening on http12asdasdsd9999');
await Future<void>.delayed(const Duration(milliseconds: 10));
logReader.addLine('The Dart VM service is listening on http://127.0.0.1:9999');
await Future<void>.delayed(Duration.zero);
final Uri uri = (await pendingUri)!;
expect(uri, isNotNull);
expect(uri.port, 9999);
expect('$uri', 'http://127.0.0.1:9999');
});
testWithoutContext('discovers uri if logs already produced output and no listener is attached', () async {
logReader.addLine('HELLO WORLD');
logReader.addLine('The Dart VM service is listening on http://127.0.0.1:9999');
await Future<void>.delayed(Duration.zero);
final Uri uri = (await discoverer.uri)!;
expect(uri, isNotNull);
expect(uri.port, 9999);
expect('$uri', 'http://127.0.0.1:9999');
});
testWithoutContext('uri throws if logs produce bad line and no listener is attached', () async {
logReader.addLine('The Dart VM service is listening on http://127.0.0.1:apple');
await Future<void>.delayed(Duration.zero);
expect(discoverer.uri, throwsA(isFormatException));
});
testWithoutContext('discovers uri if logs not yet produced output', () async {
final Future<Uri?> uriFuture = discoverer.uri;
logReader.addLine('The Dart VM service is listening on http://127.0.0.1:3333');
final Uri uri = (await uriFuture)!;
expect(uri.port, 3333);
expect('$uri', 'http://127.0.0.1:3333');
});
testWithoutContext('discovers uri with Ascii Esc code', () async {
logReader.addLine('The Dart VM service is listening on http://127.0.0.1:3333\x1b[');
final Uri uri = (await discoverer.uri)!;
expect(uri.port, 3333);
expect('$uri', 'http://127.0.0.1:3333');
});
testWithoutContext('uri throws if logs produce bad line', () async {
logReader.addLine('The Dart VM service is listening on http://127.0.0.1:apple');
expect(discoverer.uri, throwsA(isFormatException));
});
testWithoutContext('uri is null when the log reader closes early', () async {
final Future<Uri?> uriFuture = discoverer.uri;
await logReader.dispose();
expect(await uriFuture, isNull);
});
testWithoutContext('uri waits for correct log line', () async {
final Future<Uri?> uriFuture = discoverer.uri;
logReader.addLine('VM Service not listening...');
final Uri timeoutUri = Uri.parse('http://timeout');
final Uri? actualUri = await uriFuture.timeout(
const Duration(milliseconds: 100),
onTimeout: () => timeoutUri,
);
expect(actualUri, timeoutUri);
});
testWithoutContext('discovers uri if log line contains Android prefix', () async {
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:52584');
final Uri uri = (await discoverer.uri)!;
expect(uri.port, 52584);
expect('$uri', 'http://127.0.0.1:52584');
});
testWithoutContext('discovers uri if log line contains auth key', () async {
final Future<Uri?> uriFuture = discoverer.uri;
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:54804/PTwjm8Ii8qg=/');
final Uri uri = (await uriFuture)!;
expect(uri.port, 54804);
expect('$uri', 'http://127.0.0.1:54804/PTwjm8Ii8qg=/');
});
testWithoutContext('discovers uri if log line contains non-localhost', () async {
final Future<Uri?> uriFuture = discoverer.uri;
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:54804/PTwjm8Ii8qg=/');
final Uri uri = (await uriFuture)!;
expect(uri.port, 54804);
expect('$uri', 'http://127.0.0.1:54804/PTwjm8Ii8qg=/');
});
testWithoutContext('skips uri if port does not match the requested vmservice - requested last', () async {
discoverer = ProtocolDiscovery.vmService(
logReader,
ipv6: false,
devicePort: 12346,
throttleDuration: const Duration(milliseconds: 200),
logger: BufferLogger.test(),
);
final Future<Uri?> uriFuture = discoverer.uri;
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12345/PTwjm8Ii8qg=/');
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12346/PTwjm8Ii8qg=/');
final Uri uri = (await uriFuture)!;
expect(uri.port, 12346);
expect('$uri', 'http://127.0.0.1:12346/PTwjm8Ii8qg=/');
});
testWithoutContext('skips uri if port does not match the requested vmservice - requested first', () async {
discoverer = ProtocolDiscovery.vmService(
logReader,
ipv6: false,
devicePort: 12346,
throttleDuration: const Duration(milliseconds: 200),
logger: BufferLogger.test(),
);
final Future<Uri?> uriFuture = discoverer.uri;
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12346/PTwjm8Ii8qg=/');
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12345/PTwjm8Ii8qg=/');
final Uri uri = (await uriFuture)!;
expect(uri.port, 12346);
expect('$uri', 'http://127.0.0.1:12346/PTwjm8Ii8qg=/');
});
testWithoutContext('first uri in the stream is the last one from the log', () async {
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12346/PTwjm8Ii8qg=/');
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12345/PTwjm8Ii8qg=/');
final Uri uri = await discoverer.uris.first;
expect(uri.port, 12345);
expect('$uri', 'http://127.0.0.1:12345/PTwjm8Ii8qg=/');
});
testWithoutContext('first uri in the stream is the last one from the log that matches the port', () async {
discoverer = ProtocolDiscovery.vmService(
logReader,
ipv6: false,
devicePort: 12345,
throttleDuration: const Duration(milliseconds: 200),
logger: BufferLogger.test(),
);
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12346/PTwjm8Ii8qg=/');
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12345/PTwjm8Ii8qg=/');
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12344/PTwjm8Ii8qg=/');
final Uri uri = await discoverer.uris.first;
expect(uri.port, 12345);
expect('$uri', 'http://127.0.0.1:12345/PTwjm8Ii8qg=/');
});
testWithoutContext('protocol discovery does not crash if the log reader is closed while delaying', () async {
discoverer = ProtocolDiscovery.vmService(
logReader,
ipv6: false,
devicePort: 12346,
throttleDuration: const Duration(milliseconds: 10),
logger: BufferLogger.test(),
);
final Future<List<Uri>> results = discoverer.uris.toList();
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12346/PTwjm8Ii8qg=/');
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12346/PTwjm8Ii8qg=/');
await logReader.dispose();
// Give time for throttle to finish.
await Future<void>.delayed(const Duration(milliseconds: 11));
expect(await results, isEmpty);
});
testWithoutContext('uris in the stream are throttled', () async {
const Duration kThrottleDuration = Duration(milliseconds: 10);
FakeAsync().run((FakeAsync time) {
discoverer = ProtocolDiscovery.vmService(
logReader,
ipv6: false,
throttleDuration: kThrottleDuration,
logger: BufferLogger.test(),
);
final List<Uri> discoveredUris = <Uri>[];
discoverer.uris.listen((Uri uri) {
discoveredUris.add(uri);
});
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12346/PTwjm8Ii8qg=/');
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12345/PTwjm8Ii8qg=/');
time.elapse(kThrottleDuration);
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12344/PTwjm8Ii8qg=/');
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12343/PTwjm8Ii8qg=/');
time.elapse(kThrottleDuration);
expect(discoveredUris.length, 2);
expect(discoveredUris[0].port, 12345);
expect('${discoveredUris[0]}', 'http://127.0.0.1:12345/PTwjm8Ii8qg=/');
expect(discoveredUris[1].port, 12343);
expect('${discoveredUris[1]}', 'http://127.0.0.1:12343/PTwjm8Ii8qg=/');
});
});
testWithoutContext('uris in the stream are throttled when they match the port', () async {
const Duration kThrottleTimeInMilliseconds = Duration(milliseconds: 10);
FakeAsync().run((FakeAsync time) {
discoverer = ProtocolDiscovery.vmService(
logReader,
ipv6: false,
devicePort: 12345,
throttleDuration: kThrottleTimeInMilliseconds,
logger: BufferLogger.test(),
);
final List<Uri> discoveredUris = <Uri>[];
discoverer.uris.listen((Uri uri) {
discoveredUris.add(uri);
});
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12346/PTwjm8Ii8qg=/');
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12345/PTwjm8Ii8qg=/');
time.elapse(kThrottleTimeInMilliseconds);
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12345/PTwjm8Ii8qc=/');
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:12344/PTwjm8Ii8qf=/');
time.elapse(kThrottleTimeInMilliseconds);
expect(discoveredUris.length, 2);
expect(discoveredUris[0].port, 12345);
expect('${discoveredUris[0]}', 'http://127.0.0.1:12345/PTwjm8Ii8qg=/');
expect(discoveredUris[1].port, 12345);
expect('${discoveredUris[1]}', 'http://127.0.0.1:12345/PTwjm8Ii8qc=/');
});
});
});
group('port forwarding', () {
testWithoutContext('default port', () async {
final FakeDeviceLogReader logReader = FakeDeviceLogReader();
final ProtocolDiscovery discoverer = ProtocolDiscovery.vmService(
logReader,
portForwarder: MockPortForwarder(99),
ipv6: false,
logger: BufferLogger.test(),
);
// Get next port future.
final Future<Uri?> nextUri = discoverer.uri;
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:54804/PTwjm8Ii8qg=/');
final Uri uri = (await nextUri)!;
expect(uri.port, 99);
expect('$uri', 'http://127.0.0.1:99/PTwjm8Ii8qg=/');
await discoverer.cancel();
await logReader.dispose();
});
testWithoutContext('specified port', () async {
final FakeDeviceLogReader logReader = FakeDeviceLogReader();
final ProtocolDiscovery discoverer = ProtocolDiscovery.vmService(
logReader,
portForwarder: MockPortForwarder(99),
hostPort: 1243,
ipv6: false,
logger: BufferLogger.test(),
);
// Get next port future.
final Future<Uri?> nextUri = discoverer.uri;
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:54804/PTwjm8Ii8qg=/');
final Uri uri = (await nextUri)!;
expect(uri.port, 1243);
expect('$uri', 'http://127.0.0.1:1243/PTwjm8Ii8qg=/');
await discoverer.cancel();
await logReader.dispose();
});
testWithoutContext('specified port zero', () async {
final FakeDeviceLogReader logReader = FakeDeviceLogReader();
final ProtocolDiscovery discoverer = ProtocolDiscovery.vmService(
logReader,
portForwarder: MockPortForwarder(99),
hostPort: 0,
ipv6: false,
logger: BufferLogger.test(),
);
// Get next port future.
final Future<Uri?> nextUri = discoverer.uri;
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:54804/PTwjm8Ii8qg=/');
final Uri uri = (await nextUri)!;
expect(uri.port, 99);
expect('$uri', 'http://127.0.0.1:99/PTwjm8Ii8qg=/');
await discoverer.cancel();
await logReader.dispose();
});
testWithoutContext('ipv6', () async {
final FakeDeviceLogReader logReader = FakeDeviceLogReader();
final ProtocolDiscovery discoverer = ProtocolDiscovery.vmService(
logReader,
portForwarder: MockPortForwarder(99),
hostPort: 54777,
ipv6: true,
logger: BufferLogger.test(),
);
// Get next port future.
final Future<Uri?> nextUri = discoverer.uri;
logReader.addLine('I/flutter : The Dart VM service is listening on http://127.0.0.1:54804/PTwjm8Ii8qg=/');
final Uri uri = (await nextUri)!;
expect(uri.port, 54777);
expect('$uri', 'http://[::1]:54777/PTwjm8Ii8qg=/');
await discoverer.cancel();
await logReader.dispose();
});
testWithoutContext('ipv6 with Ascii Escape code', () async {
final FakeDeviceLogReader logReader = FakeDeviceLogReader();
final ProtocolDiscovery discoverer = ProtocolDiscovery.vmService(
logReader,
portForwarder: MockPortForwarder(99),
hostPort: 54777,
ipv6: true,
logger: BufferLogger.test(),
);
// Get next port future.
final Future<Uri?> nextUri = discoverer.uri;
logReader.addLine('I/flutter : The Dart VM service is listening on http://[::1]:54777/PTwjm8Ii8qg=/\x1b[');
final Uri uri = (await nextUri)!;
expect(uri.port, 54777);
expect('$uri', 'http://[::1]:54777/PTwjm8Ii8qg=/');
await discoverer.cancel();
await logReader.dispose();
});
});
});
}
class MockPortForwarder extends DevicePortForwarder {
MockPortForwarder([this.availablePort]);
final int? availablePort;
@override
Future<int> forward(int devicePort, { int? hostPort }) async {
hostPort ??= 0;
if (hostPort == 0) {
return availablePort!;
}
return hostPort;
}
@override
List<ForwardedPort> get forwardedPorts => throw UnimplementedError();
@override
Future<void> unforward(ForwardedPort forwardedPort) {
throw UnimplementedError();
}
@override
Future<void> dispose() async {}
}
| flutter/packages/flutter_tools/test/general.shard/protocol_discovery_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/protocol_discovery_test.dart",
"repo_id": "flutter",
"token_count": 7306
} | 785 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:file/memory.dart';
import 'package:flutter_tools/runner.dart' as runner;
import 'package:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/base/bot_detector.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart' as io;
import 'package:flutter_tools/src/base/net.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/process.dart';
import 'package:flutter_tools/src/base/user_messages.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/globals.dart' as globals;
import 'package:flutter_tools/src/reporting/crash_reporting.dart';
import 'package:flutter_tools/src/reporting/reporting.dart';
import 'package:flutter_tools/src/runner/flutter_command.dart';
import 'package:unified_analytics/unified_analytics.dart';
import '../../src/common.dart';
import '../../src/context.dart';
import '../../src/fake_http_client.dart';
import '../../src/fakes.dart';
const String kCustomBugInstructions = 'These are instructions to report with a custom bug tracker.';
void main() {
int? firstExitCode;
late MemoryFileSystem fileSystem;
group('runner', () {
late FakeAnalytics fakeAnalytics;
late TestUsage testUsage;
setUp(() {
// Instead of exiting with dart:io exit(), this causes an exception to
// be thrown, which we catch with the onError callback in the zone below.
//
// Tests might trigger exit() multiple times. In real life, exit() would
// cause the VM to terminate immediately, so only the first one matters.
firstExitCode = null;
io.setExitFunctionForTests((int exitCode) {
firstExitCode ??= exitCode;
// TODO(jamesderlin): Ideally only the first call to exit() would be
// honored and subsequent calls would be no-ops, but existing tests
// rely on all calls to throw.
throw Exception('test exit');
});
Cache.disableLocking();
fileSystem = MemoryFileSystem.test();
fakeAnalytics = getInitializedFakeAnalyticsInstance(
fs: fileSystem,
fakeFlutterVersion: FakeFlutterVersion(),
);
testUsage = TestUsage();
});
tearDown(() {
io.restoreExitFunction();
Cache.enableLocking();
});
testUsingContext('error handling crash report (synchronous crash)', () async {
final Completer<void> completer = Completer<void>();
// runner.run() asynchronously calls the exit function set above, so we
// catch it in a zone.
unawaited(runZoned<Future<void>?>(
() {
unawaited(runner.run(
<String>['crash'],
() => <FlutterCommand>[
CrashingFlutterCommand(),
],
// This flutterVersion disables crash reporting.
flutterVersion: '[user-branch]/',
reportCrashes: true,
shutdownHooks: ShutdownHooks(),
));
return null;
},
onError: (Object error, StackTrace stack) {
expect(firstExitCode, isNotNull);
expect(firstExitCode, isNot(0));
expect(error.toString(), 'Exception: test exit');
completer.complete();
},
));
await completer.future;
// This is the main check of this test.
//
// We are checking that, even though crash reporting failed with an
// exception on the first attempt, the second attempt tries to report the
// *original* crash, and not the crash from the first crash report
// attempt.
final CrashingUsage crashingUsage = globals.flutterUsage as CrashingUsage;
expect(crashingUsage.sentException.toString(), 'Exception: an exception % --');
expect(fakeAnalytics.sentEvents, contains(Event.exception(exception: '_Exception')));
}, overrides: <Type, Generator>{
Platform: () => FakePlatform(environment: <String, String>{
'FLUTTER_ANALYTICS_LOG_FILE': 'test',
'FLUTTER_ROOT': '/',
}),
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
Usage: () => CrashingUsage(),
Artifacts: () => Artifacts.test(),
HttpClientFactory: () => () => FakeHttpClient.any(),
Analytics: () => fakeAnalytics,
});
// This Completer completes when CrashingFlutterCommand.runCommand
// completes, but ideally we'd want it to complete when execution resumes
// runner.run. Currently the distinction does not matter, but if it ever
// does, this test might fail to catch a regression of
// https://github.com/flutter/flutter/issues/56406.
final Completer<void> commandCompleter = Completer<void>();
testUsingContext('error handling crash report (asynchronous crash)', () async {
final Completer<void> completer = Completer<void>();
// runner.run() asynchronously calls the exit function set above, so we
// catch it in a zone.
unawaited(runZoned<Future<void>?>(
() {
unawaited(runner.run(
<String>['crash'],
() => <FlutterCommand>[
CrashingFlutterCommand(asyncCrash: true, completer: commandCompleter),
],
// This flutterVersion disables crash reporting.
flutterVersion: '[user-branch]/',
reportCrashes: true,
shutdownHooks: ShutdownHooks(),
));
return null;
},
onError: (Object error, StackTrace stack) {
expect(firstExitCode, isNotNull);
expect(firstExitCode, isNot(0));
expect(error.toString(), 'Exception: test exit');
completer.complete();
},
));
await completer.future;
}, overrides: <Type, Generator>{
Platform: () => FakePlatform(environment: <String, String>{
'FLUTTER_ANALYTICS_LOG_FILE': 'test',
'FLUTTER_ROOT': '/',
}),
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
CrashReporter: () => WaitingCrashReporter(commandCompleter.future),
Artifacts: () => Artifacts.test(),
HttpClientFactory: () => () => FakeHttpClient.any(),
});
testUsingContext('create local report', () async {
// Since crash reporting calls the doctor, which checks for the devtools
// version file in the cache, write a version file to the memory fs.
Cache.flutterRoot = '/path/to/flutter';
final Directory devtoolsDir = globals.fs.directory(
'${Cache.flutterRoot}/bin/cache/dart-sdk/bin/resources/devtools',
)..createSync(recursive: true);
devtoolsDir.childFile('version.json').writeAsStringSync(
'{"version": "1.2.3"}',
);
final Completer<void> completer = Completer<void>();
// runner.run() asynchronously calls the exit function set above, so we
// catch it in a zone.
unawaited(runZoned<Future<void>?>(
() {
unawaited(runner.run(
<String>['crash'],
() => <FlutterCommand>[
CrashingFlutterCommand(),
],
// This flutterVersion disables crash reporting.
flutterVersion: '[user-branch]/',
reportCrashes: true,
shutdownHooks: ShutdownHooks(),
));
return null;
},
onError: (Object error, StackTrace stack) {
expect(firstExitCode, isNotNull);
expect(firstExitCode, isNot(0));
expect(error.toString(), 'Exception: test exit');
completer.complete();
},
));
await completer.future;
final String errorText = testLogger.errorText;
expect(
errorText,
containsIgnoringWhitespace('Oops; flutter has exited unexpectedly: "Exception: an exception % --".\n'),
);
final File log = globals.fs.file('/flutter_01.log');
final String logContents = log.readAsStringSync();
expect(logContents, contains(kCustomBugInstructions));
expect(logContents, contains('flutter crash'));
expect(logContents, contains('Exception: an exception % --'));
expect(logContents, contains('CrashingFlutterCommand.runCommand'));
expect(logContents, contains('[!] Flutter'));
final CrashDetails sentDetails = (globals.crashReporter! as WaitingCrashReporter)._details;
expect(sentDetails.command, 'flutter crash');
expect(sentDetails.error.toString(), 'Exception: an exception % --');
expect(sentDetails.stackTrace.toString(), contains('CrashingFlutterCommand.runCommand'));
expect(await sentDetails.doctorText.text, contains('[!] Flutter'));
}, overrides: <Type, Generator>{
Platform: () => FakePlatform(
environment: <String, String>{
'FLUTTER_ANALYTICS_LOG_FILE': 'test',
'FLUTTER_ROOT': '/',
}
),
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
UserMessages: () => CustomBugInstructions(),
Artifacts: () => Artifacts.test(),
CrashReporter: () => WaitingCrashReporter(Future<void>.value()),
HttpClientFactory: () => () => FakeHttpClient.any(),
});
group('in directory without permission', () {
setUp(() {
bool inTestSetup = true;
fileSystem = MemoryFileSystem(opHandle: (String context, FileSystemOp operation) {
if (inTestSetup) {
// Allow all operations during test setup.
return;
}
const Set<FileSystemOp> disallowedOperations = <FileSystemOp>{
FileSystemOp.create,
FileSystemOp.delete,
FileSystemOp.copy,
FileSystemOp.write,
};
// Make current_directory not writable.
if (context.startsWith('/current_directory') && disallowedOperations.contains(operation)) {
throw FileSystemException('No permission, context = $context, operation = $operation');
}
});
final Directory currentDirectory = fileSystem.directory('/current_directory');
currentDirectory.createSync();
fileSystem.currentDirectory = currentDirectory;
inTestSetup = false;
});
testUsingContext('create local report in temporary directory', () async {
// Since crash reporting calls the doctor, which checks for the devtools
// version file in the cache, write a version file to the memory fs.
Cache.flutterRoot = '/path/to/flutter';
final Directory devtoolsDir = globals.fs.directory(
'${Cache.flutterRoot}/bin/cache/dart-sdk/bin/resources/devtools',
)..createSync(recursive: true);
devtoolsDir.childFile('version.json').writeAsStringSync(
'{"version": "1.2.3"}',
);
final Completer<void> completer = Completer<void>();
// runner.run() asynchronously calls the exit function set above, so we
// catch it in a zone.
unawaited(runZoned<Future<void>?>(
() {
unawaited(runner.run(
<String>['crash'],
() => <FlutterCommand>[
CrashingFlutterCommand(),
],
// This flutterVersion disables crash reporting.
flutterVersion: '[user-branch]/',
reportCrashes: true,
shutdownHooks: ShutdownHooks(),
));
return null;
},
onError: (Object error, StackTrace stack) {
expect(firstExitCode, isNotNull);
expect(firstExitCode, isNot(0));
expect(error.toString(), 'Exception: test exit');
completer.complete();
},
));
await completer.future;
final String errorText = testLogger.errorText;
expect(
errorText,
containsIgnoringWhitespace('Oops; flutter has exited unexpectedly: "Exception: an exception % --".\n'),
);
final File log = globals.fs.systemTempDirectory.childFile('flutter_01.log');
final String logContents = log.readAsStringSync();
expect(logContents, contains(kCustomBugInstructions));
expect(logContents, contains('flutter crash'));
expect(logContents, contains('Exception: an exception % --'));
expect(logContents, contains('CrashingFlutterCommand.runCommand'));
expect(logContents, contains('[!] Flutter'));
final CrashDetails sentDetails = (globals.crashReporter! as WaitingCrashReporter)._details;
expect(sentDetails.command, 'flutter crash');
expect(sentDetails.error.toString(), 'Exception: an exception % --');
expect(sentDetails.stackTrace.toString(), contains('CrashingFlutterCommand.runCommand'));
expect(await sentDetails.doctorText.text, contains('[!] Flutter'));
}, overrides: <Type, Generator>{
Platform: () => FakePlatform(
environment: <String, String>{
'FLUTTER_ANALYTICS_LOG_FILE': 'test',
'FLUTTER_ROOT': '/',
}
),
FileSystem: () => fileSystem,
ProcessManager: () => FakeProcessManager.any(),
UserMessages: () => CustomBugInstructions(),
Artifacts: () => Artifacts.test(),
CrashReporter: () => WaitingCrashReporter(Future<void>.value()),
HttpClientFactory: () => () => FakeHttpClient.any(),
});
});
testUsingContext('do not print welcome on bots', () async {
io.setExitFunctionForTests((int exitCode) {});
await runner.run(
<String>['--version', '--machine'],
() => <FlutterCommand>[],
// This flutterVersion disables crash reporting.
flutterVersion: '[user-branch]/',
shutdownHooks: ShutdownHooks(),
);
expect(testUsage.printedWelcome, false);
},
overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => FakeProcessManager.any(),
BotDetector: () => const FakeBotDetector(true),
Usage: () => testUsage,
},
);
});
group('unified_analytics', () {
late FakeAnalytics fakeAnalytics;
late MemoryFileSystem fs;
setUp(() {
fs = MemoryFileSystem.test();
fakeAnalytics = getInitializedFakeAnalyticsInstance(
fs: fs,
fakeFlutterVersion: FakeFlutterVersion(),
);
});
testUsingContext(
'runner disable telemetry with flag',
() async {
io.setExitFunctionForTests((int exitCode) {});
expect(globals.analytics.telemetryEnabled, true);
await runner.run(
<String>['--disable-analytics'],
() => <FlutterCommand>[],
// This flutterVersion disables crash reporting.
flutterVersion: '[user-branch]/',
shutdownHooks: ShutdownHooks(),
);
expect(globals.analytics.telemetryEnabled, false);
},
overrides: <Type, Generator>{
Analytics: () => fakeAnalytics,
FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => FakeProcessManager.any(),
},
);
testUsingContext(
'runner enabling analytics with flag',
() async {
io.setExitFunctionForTests((int exitCode) {});
expect(globals.analytics.telemetryEnabled, true);
await runner.run(
<String>['--disable-analytics'],
() => <FlutterCommand>[],
// This flutterVersion disables crash reporting.
flutterVersion: '[user-branch]/',
shutdownHooks: ShutdownHooks(),
);
expect(globals.analytics.telemetryEnabled, false);
await runner.run(
<String>['--enable-analytics'],
() => <FlutterCommand>[],
// This flutterVersion disables crash reporting.
flutterVersion: '[user-branch]/',
shutdownHooks: ShutdownHooks(),
);
expect(globals.analytics.telemetryEnabled, true);
},
overrides: <Type, Generator>{
Analytics: () => fakeAnalytics,
FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => FakeProcessManager.any(),
},
);
testUsingContext(
'throw error when both flags passed',
() async {
io.setExitFunctionForTests((int exitCode) {});
expect(globals.analytics.telemetryEnabled, true);
final int exitCode = await runner.run(
<String>[
'--disable-analytics',
'--enable-analytics',
],
() => <FlutterCommand>[],
// This flutterVersion disables crash reporting.
flutterVersion: '[user-branch]/',
shutdownHooks: ShutdownHooks(),
);
expect(exitCode, 1,
reason: 'Should return 1 due to conflicting options for telemetry');
expect(globals.analytics.telemetryEnabled, true,
reason: 'Should not have changed from initialization');
},
overrides: <Type, Generator>{
Analytics: () => fakeAnalytics,
FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => FakeProcessManager.any(),
},
);
});
}
class CrashingFlutterCommand extends FlutterCommand {
CrashingFlutterCommand({
bool asyncCrash = false,
Completer<void>? completer,
}) : _asyncCrash = asyncCrash,
_completer = completer;
final bool _asyncCrash;
final Completer<void>? _completer;
@override
String get description => '';
@override
String get name => 'crash';
@override
Future<FlutterCommandResult> runCommand() async {
final Exception error = Exception('an exception % --'); // Test URL encoding.
if (!_asyncCrash) {
throw error;
}
final Completer<void> completer = Completer<void>();
Timer.run(() {
completer.complete();
throw error;
});
await completer.future;
_completer!.complete();
return FlutterCommandResult.success();
}
}
class CrashingUsage implements Usage {
CrashingUsage() : _impl = Usage(
versionOverride: '[user-branch]',
runningOnBot: true,
);
final Usage _impl;
dynamic get sentException => _sentException;
dynamic _sentException;
bool _firstAttempt = true;
// Crash while crashing.
@override
void sendException(dynamic exception) {
if (_firstAttempt) {
_firstAttempt = false;
throw Exception('CrashingUsage.sendException');
}
_sentException = exception;
}
@override
bool get suppressAnalytics => _impl.suppressAnalytics;
@override
set suppressAnalytics(bool value) {
_impl.suppressAnalytics = value;
}
@override
bool get enabled => _impl.enabled;
@override
set enabled(bool value) {
_impl.enabled = value;
}
@override
String get clientId => _impl.clientId;
@override
void sendCommand(String command, {CustomDimensions? parameters}) =>
_impl.sendCommand(command, parameters: parameters);
@override
void sendEvent(
String category,
String parameter, {
String? label,
int? value,
CustomDimensions? parameters,
}) => _impl.sendEvent(
category,
parameter,
label: label,
value: value,
parameters: parameters,
);
@override
void sendTiming(
String category,
String variableName,
Duration duration, {
String? label,
}) => _impl.sendTiming(category, variableName, duration, label: label);
@override
Stream<Map<String, dynamic>> get onSend => _impl.onSend;
@override
Future<void> ensureAnalyticsSent() => _impl.ensureAnalyticsSent();
@override
void printWelcome() => _impl.printWelcome();
}
class CustomBugInstructions extends UserMessages {
@override
String get flutterToolBugInstructions => kCustomBugInstructions;
}
/// A fake [CrashReporter] that waits for a [Future] to complete.
///
/// Used to exacerbate a race between the success and failure paths of
/// [runner.run]. See https://github.com/flutter/flutter/issues/56406.
class WaitingCrashReporter implements CrashReporter {
WaitingCrashReporter(Future<void> future) : _future = future;
final Future<void> _future;
late CrashDetails _details;
@override
Future<void> informUser(CrashDetails details, File crashFile) {
_details = details;
return _future;
}
}
| flutter/packages/flutter_tools/test/general.shard/runner/runner_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/runner/runner_test.dart",
"repo_id": "flutter",
"token_count": 7999
} | 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 'dart:convert';
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/process.dart';
import 'package:flutter_tools/src/base/time.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/version.dart';
import 'package:test/fake.dart';
import '../src/common.dart';
import '../src/context.dart';
import '../src/fake_process_manager.dart';
import '../src/fakes.dart' show FakeFlutterVersion;
final SystemClock _testClock = SystemClock.fixed(DateTime.utc(2015));
final DateTime _stampUpToDate = _testClock.ago(VersionFreshnessValidator.checkAgeConsideredUpToDate ~/ 2);
final DateTime _stampOutOfDate = _testClock.ago(VersionFreshnessValidator.checkAgeConsideredUpToDate * 2);
void main() {
late FakeCache cache;
late FakeProcessManager processManager;
setUp(() {
processManager = FakeProcessManager.empty();
cache = FakeCache();
});
testUsingContext('Channel enum and string transform to each other', () {
for (final Channel channel in Channel.values) {
expect(getNameForChannel(channel), kOfficialChannels.toList()[channel.index]);
}
expect(kOfficialChannels.toList().map((String str) => getChannelForName(str)).toList(),
Channel.values);
});
for (final String channel in kOfficialChannels) {
DateTime getChannelUpToDateVersion() {
return _testClock.ago(VersionFreshnessValidator.versionAgeConsideredUpToDate(channel) ~/ 2);
}
DateTime getChannelOutOfDateVersion() {
return _testClock.ago(VersionFreshnessValidator.versionAgeConsideredUpToDate(channel) * 2);
}
group('$FlutterVersion for $channel', () {
late FileSystem fs;
const String flutterRoot = '/path/to/flutter';
setUpAll(() {
fs = MemoryFileSystem.test();
Cache.disableLocking();
VersionFreshnessValidator.timeToPauseToLetUserReadTheMessage = Duration.zero;
});
testUsingContext('prints nothing when Flutter installation looks fresh', () async {
const String flutterUpstreamUrl = 'https://github.com/flutter/flutter.git';
processManager.addCommands(<FakeCommand>[
const FakeCommand(
command: <String>['git', '-c', 'log.showSignature=false', 'log', '-n', '1', '--pretty=format:%H'],
stdout: '1234abcd',
),
const FakeCommand(
command: <String>['git', 'tag', '--points-at', '1234abcd'],
),
const FakeCommand(
command: <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags', '1234abcd'],
stdout: '0.1.2-3-1234abcd',
),
FakeCommand(
command: const <String>['git', 'symbolic-ref', '--short', 'HEAD'],
stdout: channel,
),
FakeCommand(
command: const <String>['git', 'rev-parse', '--abbrev-ref', '--symbolic', '@{upstream}'],
stdout: 'origin/$channel',
),
const FakeCommand(
command: <String>['git', 'ls-remote', '--get-url', 'origin'],
stdout: flutterUpstreamUrl,
),
FakeCommand(
command: const <String>['git', '-c', 'log.showSignature=false', 'log', 'HEAD', '-n', '1', '--pretty=format:%ad', '--date=iso'],
stdout: getChannelUpToDateVersion().toString(),
),
const FakeCommand(
command: <String>['git', 'fetch', '--tags'],
),
FakeCommand(
command: const <String>['git', '-c', 'log.showSignature=false', 'log', '@{upstream}', '-n', '1', '--pretty=format:%ad', '--date=iso'],
stdout: getChannelOutOfDateVersion().toString(),
),
const FakeCommand(
command: <String>['git', '-c', 'log.showSignature=false', 'log', '-n', '1', '--pretty=format:%ar'],
stdout: '1 second ago',
),
FakeCommand(
command: const <String>['git', '-c', 'log.showSignature=false', 'log', 'HEAD', '-n', '1', '--pretty=format:%ad', '--date=iso'],
stdout: getChannelUpToDateVersion().toString(),
),
]);
final FlutterVersion flutterVersion = FlutterVersion(clock: _testClock, fs: fs, flutterRoot: flutterRoot);
await flutterVersion.checkFlutterVersionFreshness();
expect(flutterVersion.channel, channel);
expect(flutterVersion.repositoryUrl, flutterUpstreamUrl);
expect(flutterVersion.frameworkRevision, '1234abcd');
expect(flutterVersion.frameworkRevisionShort, '1234abcd');
expect(flutterVersion.frameworkVersion, '0.0.0-unknown');
expect(
flutterVersion.toString(),
'Flutter • channel $channel • $flutterUpstreamUrl\n'
'Framework • revision 1234abcd (1 second ago) • ${getChannelUpToDateVersion()}\n'
'Engine • revision abcdefg\n'
'Tools • Dart 2.12.0 • DevTools 2.8.0',
);
expect(flutterVersion.frameworkAge, '1 second ago');
expect(flutterVersion.getVersionString(), '$channel/1234abcd');
expect(flutterVersion.getBranchName(), channel);
expect(flutterVersion.getVersionString(redactUnknownBranches: true), '$channel/1234abcd');
expect(flutterVersion.getBranchName(redactUnknownBranches: true), channel);
expect(testLogger.statusText, isEmpty);
expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
ProcessManager: () => processManager,
Cache: () => cache,
});
testUsingContext('does not crash when git log outputs malformed output', () async {
const String flutterUpstreamUrl = 'https://github.com/flutter/flutter.git';
final String malformedGitLogOutput = '${getChannelUpToDateVersion()}[0x7FF9E2A75000] ANOMALY: meaningless REX prefix used';
processManager.addCommands(<FakeCommand>[
const FakeCommand(
command: <String>['git', '-c', 'log.showSignature=false', 'log', '-n', '1', '--pretty=format:%H'],
stdout: '1234abcd',
),
const FakeCommand(
command: <String>['git', 'tag', '--points-at', '1234abcd'],
),
const FakeCommand(
command: <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags', '1234abcd'],
stdout: '0.1.2-3-1234abcd',
),
FakeCommand(
command: const <String>['git', 'symbolic-ref', '--short', 'HEAD'],
stdout: channel,
),
FakeCommand(
command: const <String>['git', 'rev-parse', '--abbrev-ref', '--symbolic', '@{upstream}'],
stdout: 'origin/$channel',
),
const FakeCommand(
command: <String>['git', 'ls-remote', '--get-url', 'origin'],
stdout: flutterUpstreamUrl,
),
FakeCommand(
command: const <String>['git', '-c', 'log.showSignature=false', 'log', 'HEAD', '-n', '1', '--pretty=format:%ad', '--date=iso'],
stdout: malformedGitLogOutput,
),
]);
final FlutterVersion flutterVersion = FlutterVersion(clock: _testClock, fs: fs, flutterRoot: flutterRoot);
await flutterVersion.checkFlutterVersionFreshness();
expect(testLogger.statusText, isEmpty);
expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
ProcessManager: () => processManager,
Cache: () => cache,
});
testWithoutContext('prints nothing when Flutter installation looks out-of-date but is actually up-to-date', () async {
final FakeFlutterVersion flutterVersion = FakeFlutterVersion(branch: channel);
final BufferLogger logger = BufferLogger.test();
final VersionCheckStamp stamp = VersionCheckStamp(
lastTimeVersionWasChecked: _stampOutOfDate,
lastKnownRemoteVersion: getChannelOutOfDateVersion(),
);
cache.versionStamp = json.encode(stamp);
await VersionFreshnessValidator(
version: flutterVersion,
cache: cache,
clock: _testClock,
logger: logger,
localFrameworkCommitDate: getChannelOutOfDateVersion(),
latestFlutterCommitDate: getChannelOutOfDateVersion(),
).run();
expect(logger.statusText, isEmpty);
});
testWithoutContext('does not ping server when version stamp is up-to-date', () async {
final FakeFlutterVersion flutterVersion = FakeFlutterVersion(branch: channel);
final BufferLogger logger = BufferLogger.test();
final VersionCheckStamp stamp = VersionCheckStamp(
lastTimeVersionWasChecked: _stampUpToDate,
lastKnownRemoteVersion: getChannelUpToDateVersion(),
);
cache.versionStamp = json.encode(stamp);
await VersionFreshnessValidator(
version: flutterVersion,
cache: cache,
clock: _testClock,
logger: logger,
localFrameworkCommitDate: getChannelOutOfDateVersion(),
latestFlutterCommitDate: getChannelUpToDateVersion(),
).run();
expect(logger.statusText, contains('A new version of Flutter is available!'));
expect(cache.setVersionStamp, true);
});
testWithoutContext('does not print warning if printed recently', () async {
final FakeFlutterVersion flutterVersion = FakeFlutterVersion(branch: channel);
final BufferLogger logger = BufferLogger.test();
final VersionCheckStamp stamp = VersionCheckStamp(
lastTimeVersionWasChecked: _stampUpToDate,
lastKnownRemoteVersion: getChannelUpToDateVersion(),
lastTimeWarningWasPrinted: _testClock.now(),
);
cache.versionStamp = json.encode(stamp);
await VersionFreshnessValidator(
version: flutterVersion,
cache: cache,
clock: _testClock,
logger: logger,
localFrameworkCommitDate: getChannelOutOfDateVersion(),
latestFlutterCommitDate: getChannelUpToDateVersion(),
).run();
expect(logger.statusText, isEmpty);
});
testWithoutContext('pings server when version stamp is missing', () async {
final FakeFlutterVersion flutterVersion = FakeFlutterVersion(branch: channel);
final BufferLogger logger = BufferLogger.test();
cache.versionStamp = '{}';
await VersionFreshnessValidator(
version: flutterVersion,
cache: cache,
clock: _testClock,
logger: logger,
localFrameworkCommitDate: getChannelOutOfDateVersion(),
latestFlutterCommitDate: getChannelUpToDateVersion(),
).run();
expect(logger.statusText, contains('A new version of Flutter is available!'));
expect(cache.setVersionStamp, true);
});
testWithoutContext('pings server when version stamp is out-of-date', () async {
final FakeFlutterVersion flutterVersion = FakeFlutterVersion(branch: channel);
final BufferLogger logger = BufferLogger.test();
final VersionCheckStamp stamp = VersionCheckStamp(
lastTimeVersionWasChecked: _stampOutOfDate,
lastKnownRemoteVersion: _testClock.ago(const Duration(days: 2)),
);
cache.versionStamp = json.encode(stamp);
await VersionFreshnessValidator(
version: flutterVersion,
cache: cache,
clock: _testClock,
logger: logger,
localFrameworkCommitDate: getChannelOutOfDateVersion(),
latestFlutterCommitDate: getChannelUpToDateVersion(),
).run();
expect(logger.statusText, contains('A new version of Flutter is available!'));
});
testWithoutContext('does not print warning when unable to connect to server if not out of date', () async {
final FakeFlutterVersion flutterVersion = FakeFlutterVersion(branch: channel);
final BufferLogger logger = BufferLogger.test();
cache.versionStamp = '{}';
await VersionFreshnessValidator(
version: flutterVersion,
cache: cache,
clock: _testClock,
logger: logger,
localFrameworkCommitDate: getChannelUpToDateVersion(),
// latestFlutterCommitDate defaults to null because we failed to get remote version
).run();
expect(logger.statusText, isEmpty);
});
testWithoutContext('prints warning when unable to connect to server if really out of date', () async {
final FakeFlutterVersion flutterVersion = FakeFlutterVersion(branch: channel);
final BufferLogger logger = BufferLogger.test();
final VersionCheckStamp stamp = VersionCheckStamp(
lastTimeVersionWasChecked: _stampOutOfDate,
lastKnownRemoteVersion: _testClock.ago(const Duration(days: 2)),
);
cache.versionStamp = json.encode(stamp);
await VersionFreshnessValidator(
version: flutterVersion,
cache: cache,
clock: _testClock,
logger: logger,
localFrameworkCommitDate: getChannelOutOfDateVersion(),
// latestFlutterCommitDate defaults to null because we failed to get remote version
).run();
final Duration frameworkAge = _testClock.now().difference(getChannelOutOfDateVersion());
expect(logger.statusText, contains('WARNING: your installation of Flutter is ${frameworkAge.inDays} days old.'));
});
group('$VersionCheckStamp for $channel', () {
void expectDefault(VersionCheckStamp stamp) {
expect(stamp.lastKnownRemoteVersion, isNull);
expect(stamp.lastTimeVersionWasChecked, isNull);
expect(stamp.lastTimeWarningWasPrinted, isNull);
}
testWithoutContext('loads blank when stamp file missing', () async {
cache.versionStamp = null;
expectDefault(await VersionCheckStamp.load(cache, BufferLogger.test()));
});
testWithoutContext('loads blank when stamp file is malformed JSON', () async {
cache.versionStamp = '<';
expectDefault(await VersionCheckStamp.load(cache, BufferLogger.test()));
});
testWithoutContext('loads blank when stamp file is well-formed but invalid JSON', () async {
cache.versionStamp = '[]';
expectDefault(await VersionCheckStamp.load(cache, BufferLogger.test()));
});
testWithoutContext('loads valid JSON', () async {
final String value = '''
{
"lastKnownRemoteVersion": "${_testClock.ago(const Duration(days: 1))}",
"lastTimeVersionWasChecked": "${_testClock.ago(const Duration(days: 2))}",
"lastTimeWarningWasPrinted": "${_testClock.now()}"
}
''';
cache.versionStamp = value;
final VersionCheckStamp stamp = await VersionCheckStamp.load(cache, BufferLogger.test());
expect(stamp.lastKnownRemoteVersion, _testClock.ago(const Duration(days: 1)));
expect(stamp.lastTimeVersionWasChecked, _testClock.ago(const Duration(days: 2)));
expect(stamp.lastTimeWarningWasPrinted, _testClock.now());
});
});
});
}
group('VersionUpstreamValidator', () {
const String flutterStandardUrlDotGit = 'https://github.com/flutter/flutter.git';
const String flutterNonStandardUrlDotGit = 'https://githubmirror.com/flutter/flutter.git';
const String flutterStandardSshUrlDotGit = '[email protected]:flutter/flutter.git';
const String flutterFullSshUrlDotGit = 'ssh://[email protected]/flutter/flutter.git';
VersionCheckError? runUpstreamValidator({
String? versionUpstreamUrl,
String? flutterGitUrl,
}){
final Platform testPlatform = FakePlatform(environment: <String, String> {
if (flutterGitUrl != null) 'FLUTTER_GIT_URL': flutterGitUrl,
});
return VersionUpstreamValidator(
version: FakeFlutterVersion(repositoryUrl: versionUpstreamUrl),
platform: testPlatform,
).run();
}
testWithoutContext('returns error if repository url is null', () {
final VersionCheckError error = runUpstreamValidator(
// repositoryUrl is null by default
)!;
expect(error, isNotNull);
expect(
error.message,
contains('The tool could not determine the remote upstream which is being tracked by the SDK.'),
);
});
testWithoutContext('does not return error at standard remote url with FLUTTER_GIT_URL unset', () {
expect(runUpstreamValidator(versionUpstreamUrl: flutterStandardUrlDotGit), isNull);
});
testWithoutContext('returns error at non-standard remote url with FLUTTER_GIT_URL unset', () {
final VersionCheckError error = runUpstreamValidator(versionUpstreamUrl: flutterNonStandardUrlDotGit)!;
expect(error, isNotNull);
expect(
error.message,
contains(
'The Flutter SDK is tracking a non-standard remote "$flutterNonStandardUrlDotGit".\n'
'Set the environment variable "FLUTTER_GIT_URL" to "$flutterNonStandardUrlDotGit". '
'If this is intentional, it is recommended to use "git" directly to manage the SDK.'
),
);
});
testWithoutContext('does not return error at non-standard remote url with FLUTTER_GIT_URL set', () {
expect(runUpstreamValidator(
versionUpstreamUrl: flutterNonStandardUrlDotGit,
flutterGitUrl: flutterNonStandardUrlDotGit,
), isNull);
});
testWithoutContext('respects FLUTTER_GIT_URL even if upstream remote url is standard', () {
final VersionCheckError error = runUpstreamValidator(
versionUpstreamUrl: flutterStandardUrlDotGit,
flutterGitUrl: flutterNonStandardUrlDotGit,
)!;
expect(error, isNotNull);
expect(
error.message,
contains(
'The Flutter SDK is tracking "$flutterStandardUrlDotGit" but "FLUTTER_GIT_URL" is set to "$flutterNonStandardUrlDotGit".\n'
'Either remove "FLUTTER_GIT_URL" from the environment or set it to "$flutterStandardUrlDotGit". '
'If this is intentional, it is recommended to use "git" directly to manage the SDK.'
),
);
});
testWithoutContext('does not return error at standard ssh url with FLUTTER_GIT_URL unset', () {
expect(runUpstreamValidator(versionUpstreamUrl: flutterStandardSshUrlDotGit), isNull);
});
testWithoutContext('does not return error at full ssh url with FLUTTER_GIT_URL unset', () {
expect(runUpstreamValidator(versionUpstreamUrl: flutterFullSshUrlDotGit), isNull);
});
testWithoutContext('stripDotGit removes ".git" suffix if any', () {
expect(VersionUpstreamValidator.stripDotGit('https://github.com/flutter/flutter.git'), 'https://github.com/flutter/flutter');
expect(VersionUpstreamValidator.stripDotGit('https://github.com/flutter/flutter'), 'https://github.com/flutter/flutter');
expect(VersionUpstreamValidator.stripDotGit('[email protected]:flutter/flutter.git'), '[email protected]:flutter/flutter');
expect(VersionUpstreamValidator.stripDotGit('[email protected]:flutter/flutter'), '[email protected]:flutter/flutter');
expect(VersionUpstreamValidator.stripDotGit('https://githubmirror.com/flutter/flutter.git.git'), 'https://githubmirror.com/flutter/flutter.git');
expect(VersionUpstreamValidator.stripDotGit('https://githubmirror.com/flutter/flutter.gitgit'), 'https://githubmirror.com/flutter/flutter.gitgit');
});
});
testUsingContext('version handles unknown branch', () async {
processManager.addCommands(<FakeCommand>[
const FakeCommand(
command: <String>['git', '-c', 'log.showSignature=false', 'log', '-n', '1', '--pretty=format:%H'],
stdout: '1234abcd',
),
const FakeCommand(
command: <String>['git', 'tag', '--points-at', '1234abcd'],
),
const FakeCommand(
command: <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags', '1234abcd'],
stdout: '0.1.2-3-1234abcd',
),
const FakeCommand(
command: <String>['git', 'symbolic-ref', '--short', 'HEAD'],
stdout: 'feature-branch',
),
]);
final MemoryFileSystem fs = MemoryFileSystem.test();
final FlutterVersion flutterVersion = FlutterVersion(
clock: _testClock,
fs: fs,
flutterRoot: '/path/to/flutter',
);
expect(flutterVersion.channel, '[user-branch]');
expect(flutterVersion.getVersionString(), 'feature-branch/1234abcd');
expect(flutterVersion.getBranchName(), 'feature-branch');
expect(flutterVersion.getVersionString(redactUnknownBranches: true), '[user-branch]/1234abcd');
expect(flutterVersion.getBranchName(redactUnknownBranches: true), '[user-branch]');
expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
ProcessManager: () => processManager,
Cache: () => cache,
});
testUsingContext('ensureVersionFile() writes version information to disk', () async {
processManager.addCommands(<FakeCommand>[
const FakeCommand(
command: <String>['git', '-c', 'log.showSignature=false', 'log', '-n', '1', '--pretty=format:%H'],
stdout: '1234abcd',
),
const FakeCommand(
command: <String>['git', 'tag', '--points-at', '1234abcd'],
),
const FakeCommand(
command: <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags', '1234abcd'],
stdout: '0.1.2-3-1234abcd',
),
const FakeCommand(
command: <String>['git', 'symbolic-ref', '--short', 'HEAD'],
stdout: 'feature-branch',
),
const FakeCommand(
command: <String>['git', 'rev-parse', '--abbrev-ref', '--symbolic', '@{upstream}'],
),
FakeCommand(
command: const <String>[
'git',
'-c',
'log.showSignature=false',
'log',
'HEAD',
'-n',
'1',
'--pretty=format:%ad',
'--date=iso',
],
stdout: _testClock.ago(VersionFreshnessValidator.versionAgeConsideredUpToDate('stable') ~/ 2).toString(),
),
]);
final MemoryFileSystem fs = MemoryFileSystem.test();
final Directory flutterRoot = fs.directory('/path/to/flutter');
flutterRoot.childDirectory('bin').childDirectory('cache').createSync(recursive: true);
final FlutterVersion flutterVersion = FlutterVersion(
clock: _testClock,
fs: fs,
flutterRoot: flutterRoot.path,
);
final File versionFile = fs.file('/path/to/flutter/bin/cache/flutter.version.json');
expect(versionFile.existsSync(), isFalse);
flutterVersion.ensureVersionFile();
expect(versionFile.existsSync(), isTrue);
expect(versionFile.readAsStringSync(), '''
{
"frameworkVersion": "0.0.0-unknown",
"channel": "[user-branch]",
"repositoryUrl": "unknown source",
"frameworkRevision": "1234abcd",
"frameworkCommitDate": "2014-10-02 00:00:00.000Z",
"engineRevision": "abcdefg",
"dartSdkVersion": "2.12.0",
"devToolsVersion": "2.8.0",
"flutterVersion": "0.0.0-unknown"
}''');
expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
ProcessManager: () => processManager,
Cache: () => cache,
});
testUsingContext('version does not call git if a .version.json file exists', () async {
final MemoryFileSystem fs = MemoryFileSystem.test();
final Directory flutterRoot = fs.directory('/path/to/flutter');
final Directory cacheDir = flutterRoot
.childDirectory('bin')
.childDirectory('cache')
..createSync(recursive: true);
const String devToolsVersion = '0000000';
const Map<String, Object> versionJson = <String, Object>{
'channel': 'stable',
'frameworkVersion': '1.2.3',
'repositoryUrl': 'https://github.com/flutter/flutter.git',
'frameworkRevision': '1234abcd',
'frameworkCommitDate': '2023-04-28 12:34:56 -0400',
'engineRevision': 'deadbeef',
'dartSdkVersion': 'deadbeef2',
'devToolsVersion': devToolsVersion,
'flutterVersion': 'foo',
};
cacheDir.childFile('flutter.version.json').writeAsStringSync(
jsonEncode(versionJson),
);
final FlutterVersion flutterVersion = FlutterVersion(
clock: _testClock,
fs: fs,
flutterRoot: flutterRoot.path,
);
expect(flutterVersion.channel, 'stable');
expect(flutterVersion.getVersionString(), 'stable/1.2.3');
expect(flutterVersion.getBranchName(), 'stable');
expect(flutterVersion.dartSdkVersion, 'deadbeef2');
expect(flutterVersion.devToolsVersion, devToolsVersion);
expect(flutterVersion.engineRevision, 'deadbeef');
expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
ProcessManager: () => processManager,
Cache: () => cache,
});
testUsingContext('_FlutterVersionFromFile.ensureVersionFile ensures legacy version file exists', () async {
final MemoryFileSystem fs = MemoryFileSystem.test();
final Directory flutterRoot = fs.directory('/path/to/flutter');
final Directory cacheDir = flutterRoot
.childDirectory('bin')
.childDirectory('cache')
..createSync(recursive: true);
const String devToolsVersion = '0000000';
final File legacyVersionFile = flutterRoot.childFile('version');
const Map<String, Object> versionJson = <String, Object>{
'channel': 'stable',
'frameworkVersion': '1.2.3',
'repositoryUrl': 'https://github.com/flutter/flutter.git',
'frameworkRevision': '1234abcd',
'frameworkCommitDate': '2023-04-28 12:34:56 -0400',
'engineRevision': 'deadbeef',
'dartSdkVersion': 'deadbeef2',
'devToolsVersion': devToolsVersion,
'flutterVersion': 'foo',
};
cacheDir.childFile('flutter.version.json').writeAsStringSync(
jsonEncode(versionJson),
);
expect(legacyVersionFile.existsSync(), isFalse);
final FlutterVersion flutterVersion = FlutterVersion(
clock: _testClock,
fs: fs,
flutterRoot: flutterRoot.path,
);
flutterVersion.ensureVersionFile();
expect(legacyVersionFile.existsSync(), isTrue);
expect(legacyVersionFile.readAsStringSync(), '1.2.3');
}, overrides: <Type, Generator>{
ProcessManager: () => processManager,
Cache: () => cache,
});
testUsingContext('FlutterVersion() falls back to git if .version.json is malformed', () async {
final MemoryFileSystem fs = MemoryFileSystem.test();
final Directory flutterRoot = fs.directory(fs.path.join('path', 'to', 'flutter'));
final Directory cacheDir = flutterRoot
.childDirectory('bin')
.childDirectory('cache')
..createSync(recursive: true);
final File legacyVersionFile = flutterRoot.childFile('version');
final File versionFile = cacheDir.childFile('flutter.version.json')..writeAsStringSync(
'{',
);
processManager.addCommands(<FakeCommand>[
const FakeCommand(
command: <String>['git', '-c', 'log.showSignature=false', 'log', '-n', '1', '--pretty=format:%H'],
stdout: '1234abcd',
),
const FakeCommand(
command: <String>['git', 'tag', '--points-at', '1234abcd'],
),
const FakeCommand(
command: <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags', '1234abcd'],
stdout: '0.1.2-3-1234abcd',
),
const FakeCommand(
command: <String>['git', 'symbolic-ref', '--short', 'HEAD'],
stdout: 'feature-branch',
),
const FakeCommand(
command: <String>['git', 'rev-parse', '--abbrev-ref', '--symbolic', '@{upstream}'],
stdout: 'feature-branch',
),
FakeCommand(
command: const <String>[
'git',
'-c',
'log.showSignature=false',
'log',
'HEAD',
'-n',
'1',
'--pretty=format:%ad',
'--date=iso',
],
stdout: _testClock.ago(VersionFreshnessValidator.versionAgeConsideredUpToDate('stable') ~/ 2).toString(),
),
]);
// version file exists in a malformed state
expect(versionFile.existsSync(), isTrue);
final FlutterVersion flutterVersion = FlutterVersion(
clock: _testClock,
fs: fs,
flutterRoot: flutterRoot.path,
);
// version file was deleted because it couldn't be parsed
expect(versionFile.existsSync(), isFalse);
expect(legacyVersionFile.existsSync(), isFalse);
// version file was written to disk
flutterVersion.ensureVersionFile();
expect(processManager, hasNoRemainingExpectations);
expect(versionFile.existsSync(), isTrue);
expect(legacyVersionFile.existsSync(), isTrue);
}, overrides: <Type, Generator>{
ProcessManager: () => processManager,
Cache: () => cache,
});
testUsingContext('GitTagVersion', () {
const String hash = 'abcdef';
GitTagVersion gitTagVersion;
// Master channel
gitTagVersion = GitTagVersion.parse('1.2.0-4.5.pre-13-g$hash');
expect(gitTagVersion.frameworkVersionFor(hash), '1.2.0-5.0.pre.13');
expect(gitTagVersion.gitTag, '1.2.0-4.5.pre');
expect(gitTagVersion.devVersion, 4);
expect(gitTagVersion.devPatch, 5);
// Stable channel
gitTagVersion = GitTagVersion.parse('1.2.3');
expect(gitTagVersion.frameworkVersionFor(hash), '1.2.3');
expect(gitTagVersion.x, 1);
expect(gitTagVersion.y, 2);
expect(gitTagVersion.z, 3);
expect(gitTagVersion.devVersion, null);
expect(gitTagVersion.devPatch, null);
// Beta channel
gitTagVersion = GitTagVersion.parse('1.2.3-4.5.pre');
expect(gitTagVersion.frameworkVersionFor(hash), '1.2.3-4.5.pre');
expect(gitTagVersion.gitTag, '1.2.3-4.5.pre');
expect(gitTagVersion.devVersion, 4);
expect(gitTagVersion.devPatch, 5);
gitTagVersion = GitTagVersion.parse('1.2.3-13-g$hash');
expect(gitTagVersion.frameworkVersionFor(hash), '1.2.4-0.0.pre.13');
expect(gitTagVersion.gitTag, '1.2.3');
expect(gitTagVersion.devVersion, null);
expect(gitTagVersion.devPatch, null);
// new tag release format, beta channel
gitTagVersion = GitTagVersion.parse('1.2.3-4.5.pre-0-g$hash');
expect(gitTagVersion.frameworkVersionFor(hash), '1.2.3-4.5.pre');
expect(gitTagVersion.gitTag, '1.2.3-4.5.pre');
expect(gitTagVersion.devVersion, 4);
expect(gitTagVersion.devPatch, 5);
// new tag release format, stable channel
gitTagVersion = GitTagVersion.parse('1.2.3-13-g$hash');
expect(gitTagVersion.frameworkVersionFor(hash), '1.2.4-0.0.pre.13');
expect(gitTagVersion.gitTag, '1.2.3');
expect(gitTagVersion.devVersion, null);
expect(gitTagVersion.devPatch, null);
expect(GitTagVersion.parse('98.76.54-32-g$hash').frameworkVersionFor(hash), '98.76.55-0.0.pre.32');
expect(GitTagVersion.parse('10.20.30-0-g$hash').frameworkVersionFor(hash), '10.20.30');
expect(testLogger.traceText, '');
expect(GitTagVersion.parse('v1.2.3+hotfix.1-4-g$hash').frameworkVersionFor(hash), '0.0.0-unknown');
expect(GitTagVersion.parse('x1.2.3-4-g$hash').frameworkVersionFor(hash), '0.0.0-unknown');
expect(GitTagVersion.parse('1.0.0-unknown-0-g$hash').frameworkVersionFor(hash), '0.0.0-unknown');
expect(GitTagVersion.parse('beta-1-g$hash').frameworkVersionFor(hash), '0.0.0-unknown');
expect(GitTagVersion.parse('1.2.3-4-gx$hash').frameworkVersionFor(hash), '0.0.0-unknown');
expect(testLogger.statusText, '');
expect(testLogger.errorText, '');
expect(
testLogger.traceText,
'Could not interpret results of "git describe": v1.2.3+hotfix.1-4-gabcdef\n'
'Could not interpret results of "git describe": x1.2.3-4-gabcdef\n'
'Could not interpret results of "git describe": 1.0.0-unknown-0-gabcdef\n'
'Could not interpret results of "git describe": beta-1-gabcdef\n'
'Could not interpret results of "git describe": 1.2.3-4-gxabcdef\n',
);
});
testUsingContext('determine reports correct stable version if HEAD is at a tag', () {
const String stableTag = '1.2.3';
final FakeProcessManager fakeProcessManager = FakeProcessManager.list(
<FakeCommand>[
const FakeCommand(
command: <String>['git', 'tag', '--points-at', 'HEAD'],
stdout: stableTag,
),
],
);
final ProcessUtils processUtils = ProcessUtils(
processManager: fakeProcessManager,
logger: BufferLogger.test(),
);
final FakePlatform platform = FakePlatform();
final GitTagVersion gitTagVersion = GitTagVersion.determine(processUtils, platform, workingDirectory: '.');
expect(gitTagVersion.frameworkVersionFor('abcd1234'), stableTag);
});
testUsingContext('determine favors stable tag over beta tag if both identify HEAD', () {
const String stableTag = '1.2.3';
final FakeProcessManager fakeProcessManager = FakeProcessManager.list(
<FakeCommand>[
const FakeCommand(
command: <String>['git', 'tag', '--points-at', 'HEAD'],
// This tests the unlikely edge case where a beta release made it to stable without any cherry picks
stdout: '1.2.3-6.0.pre\n$stableTag',
),
],
);
final ProcessUtils processUtils = ProcessUtils(
processManager: fakeProcessManager,
logger: BufferLogger.test(),
);
final FakePlatform platform = FakePlatform();
final GitTagVersion gitTagVersion = GitTagVersion.determine(processUtils, platform, workingDirectory: '.');
expect(gitTagVersion.frameworkVersionFor('abcd1234'), stableTag);
});
testUsingContext('determine reports correct git describe version if HEAD is not at a tag', () {
const String devTag = '1.2.0-2.0.pre';
const String headRevision = 'abcd1234';
const String commitsAhead = '12';
final FakeProcessManager fakeProcessManager = FakeProcessManager.list(
<FakeCommand>[
const FakeCommand(
command: <String>['git', 'tag', '--points-at', 'HEAD'],
// no output, since there's no tag
),
const FakeCommand(
command: <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags', 'HEAD'],
stdout: '$devTag-$commitsAhead-g$headRevision',
),
],
);
final ProcessUtils processUtils = ProcessUtils(
processManager: fakeProcessManager,
logger: BufferLogger.test(),
);
final FakePlatform platform = FakePlatform();
final GitTagVersion gitTagVersion = GitTagVersion.determine(processUtils, platform, workingDirectory: '.');
// reported version should increment the m
expect(gitTagVersion.frameworkVersionFor(headRevision), '1.2.0-3.0.pre.12');
});
testUsingContext('determine does not call fetch --tags', () {
final FakeProcessManager fakeProcessManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['git', 'tag', '--points-at', 'HEAD'],
),
const FakeCommand(
command: <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags', 'HEAD'],
stdout: 'v0.1.2-3-1234abcd',
),
]);
final ProcessUtils processUtils = ProcessUtils(
processManager: fakeProcessManager,
logger: BufferLogger.test(),
);
final FakePlatform platform = FakePlatform();
GitTagVersion.determine(processUtils, platform, workingDirectory: '.');
expect(fakeProcessManager, hasNoRemainingExpectations);
});
testUsingContext('determine does not fetch tags on beta', () {
final FakeProcessManager fakeProcessManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['git', 'symbolic-ref', '--short', 'HEAD'],
stdout: 'beta',
),
const FakeCommand(
command: <String>['git', 'tag', '--points-at', 'HEAD'],
),
const FakeCommand(
command: <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags', 'HEAD'],
stdout: 'v0.1.2-3-1234abcd',
),
]);
final ProcessUtils processUtils = ProcessUtils(
processManager: fakeProcessManager,
logger: BufferLogger.test(),
);
final FakePlatform platform = FakePlatform();
GitTagVersion.determine(processUtils, platform, workingDirectory: '.', fetchTags: true);
expect(fakeProcessManager, hasNoRemainingExpectations);
});
testUsingContext('determine calls fetch --tags on master', () {
final FakeProcessManager fakeProcessManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['git', 'symbolic-ref', '--short', 'HEAD'],
stdout: 'master',
),
const FakeCommand(
command: <String>['git', 'fetch', 'https://github.com/flutter/flutter.git', '--tags', '-f'],
),
const FakeCommand(
command: <String>['git', 'tag', '--points-at', 'HEAD'],
),
const FakeCommand(
command: <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags', 'HEAD'],
stdout: 'v0.1.2-3-1234abcd',
),
]);
final ProcessUtils processUtils = ProcessUtils(
processManager: fakeProcessManager,
logger: BufferLogger.test(),
);
final FakePlatform platform = FakePlatform();
GitTagVersion.determine(processUtils, platform, workingDirectory: '.', fetchTags: true);
expect(fakeProcessManager, hasNoRemainingExpectations);
});
testUsingContext('determine uses overridden git url', () {
final FakeProcessManager fakeProcessManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['git', 'symbolic-ref', '--short', 'HEAD'],
stdout: 'master',
),
const FakeCommand(
command: <String>['git', 'fetch', 'https://githubmirror.com/flutter.git', '--tags', '-f'],
),
const FakeCommand(
command: <String>['git', 'tag', '--points-at', 'HEAD'],
),
const FakeCommand(
command: <String>['git', 'describe', '--match', '*.*.*', '--long', '--tags', 'HEAD'],
stdout: 'v0.1.2-3-1234abcd',
),
]);
final ProcessUtils processUtils = ProcessUtils(
processManager: fakeProcessManager,
logger: BufferLogger.test(),
);
final FakePlatform platform = FakePlatform(
environment: <String, String> {'FLUTTER_GIT_URL': 'https://githubmirror.com/flutter.git'},
);
GitTagVersion.determine(processUtils, platform, workingDirectory: '.', fetchTags: true);
expect(fakeProcessManager, hasNoRemainingExpectations);
});
}
class FakeCache extends Fake implements Cache {
String? versionStamp;
bool setVersionStamp = false;
@override
String get engineRevision => 'abcdefg';
@override
String get devToolsVersion => '2.8.0';
@override
String get dartSdkVersion => '2.12.0';
@override
void checkLockAcquired() { }
@override
String? getStampFor(String artifactName) {
if (artifactName == VersionCheckStamp.flutterVersionCheckStampFile) {
return versionStamp;
}
return null;
}
@override
void setStampFor(String artifactName, String version) {
if (artifactName == VersionCheckStamp.flutterVersionCheckStampFile) {
setVersionStamp = true;
}
}
}
| flutter/packages/flutter_tools/test/general.shard/version_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/version_test.dart",
"repo_id": "flutter",
"token_count": 15828
} | 787 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/web/workflow.dart';
import '../../src/common.dart';
import '../../src/fakes.dart';
void main() {
testWithoutContext('WebWorkflow applies on Linux', () {
final WebWorkflow workflow = WebWorkflow(
platform: FakePlatform(),
featureFlags: TestFeatureFlags(isWebEnabled: true),
);
expect(workflow.appliesToHostPlatform, true);
expect(workflow.canLaunchDevices, true);
expect(workflow.canListDevices, true);
expect(workflow.canListEmulators, false);
});
testWithoutContext('WebWorkflow applies on macOS', () {
final WebWorkflow workflow = WebWorkflow(
platform: FakePlatform(operatingSystem: 'macos'),
featureFlags: TestFeatureFlags(isWebEnabled: true),
);
expect(workflow.appliesToHostPlatform, true);
expect(workflow.canLaunchDevices, true);
expect(workflow.canListDevices, true);
expect(workflow.canListEmulators, false);
});
testWithoutContext('WebWorkflow applies on Windows', () {
final WebWorkflow workflow = WebWorkflow(
platform: FakePlatform(operatingSystem: 'windows'),
featureFlags: TestFeatureFlags(isWebEnabled: true),
);
expect(workflow.appliesToHostPlatform, true);
expect(workflow.canLaunchDevices, true);
expect(workflow.canListDevices, true);
expect(workflow.canListEmulators, false);
});
testWithoutContext('WebWorkflow does not apply on other platforms', () {
final WebWorkflow workflow = WebWorkflow(
platform: FakePlatform(operatingSystem: 'fuchsia'),
featureFlags: TestFeatureFlags(isWebEnabled: true),
);
expect(workflow.appliesToHostPlatform, false);
});
testWithoutContext('WebWorkflow does not apply if feature flag is disabled', () {
final WebWorkflow workflow = WebWorkflow(
platform: FakePlatform(),
featureFlags: TestFeatureFlags(),
);
expect(workflow.appliesToHostPlatform, false);
expect(workflow.canLaunchDevices, false);
expect(workflow.canListDevices, false);
expect(workflow.canListEmulators, false);
});
}
| flutter/packages/flutter_tools/test/general.shard/web/workflow_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/general.shard/web/workflow_test.dart",
"repo_id": "flutter",
"token_count": 753
} | 788 |
# Integration tests
These tests are not hermetic, and use the actual Flutter SDK. While
they don't require actual devices, they run `flutter_tester` to test
Dart VM and Flutter integration.
Use this command to run (from the `flutter_tools` directory):
```shell
../../bin/cache/dart-sdk/bin/dart run test test/integration.shard
```
You need to have downloaded the Dart SDK in your Flutter clone for this
to work. Running `../../bin/flutter` will automatically download it.
## Coverage exclusion
These tests are expensive to run and do not give meaningful coverage
information for the `flutter` tool (since they are black-box tests that
run the tool as a subprocess, rather than being unit tests). For this
reason, they are in a separate shard when running on continuous
integration and are not run when calculating coverage.
## Adding new test files
When adding a new test file make sure that it ends with `_test.dart`, or else it will not be run.
| flutter/packages/flutter_tools/test/integration.shard/README.md/0 | {
"file_path": "flutter/packages/flutter_tools/test/integration.shard/README.md",
"repo_id": "flutter",
"token_count": 252
} | 789 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package: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_data/plugin_each_settings_gradle_project.dart';
import 'test_data/plugin_project.dart';
import 'test_data/project.dart';
import 'test_utils.dart';
void main() {
late Directory tempDir;
setUp(() {
Cache.flutterRoot = getFlutterRoot();
tempDir = createResolvedTempDirectorySync('flutter_plugin_test.');
});
tearDown(() async {
tryToDelete(tempDir);
});
// Regression test for https://github.com/flutter/flutter/issues/97729 (#137115).
/// Creates a project which uses a plugin, which is not supported on Android.
/// This means it has no entry in pubspec.yaml for:
/// flutter -> plugin -> platforms -> android
///
/// [createAndroidPluginFolder] indicates that the plugin can additionally
/// have a functioning `android` folder.
Future<ProcessResult> testUnsupportedPlugin({
required Project project,
required bool createAndroidPluginFolder,
}) async {
final String flutterBin = fileSystem.path.join(
getFlutterRoot(),
'bin',
'flutter',
);
// Create dummy plugin that supports iOS and optionally Android.
processManager.runSync(<String>[
flutterBin,
...getLocalEngineArguments(),
'create',
'--template=plugin',
'--platforms=ios${createAndroidPluginFolder ? ',android' : ''}',
'test_plugin',
], workingDirectory: tempDir.path);
final Directory pluginAppDir = tempDir.childDirectory('test_plugin');
final File pubspecFile = pluginAppDir.childFile('pubspec.yaml');
String pubspecYamlSrc =
pubspecFile.readAsStringSync().replaceAll('\r\n', '\n');
if (createAndroidPluginFolder) {
// Override pubspec to drop support for the Android implementation.
pubspecYamlSrc = pubspecYamlSrc
.replaceFirst(
RegExp(r'name:.*\n'),
'name: test_plugin\n',
)
.replaceFirst('''
android:
package: com.example.test_plugin
pluginClass: TestPlugin
''', '''
# android:
# package: com.example.test_plugin
# pluginClass: TestPlugin
''');
pubspecFile.writeAsStringSync(pubspecYamlSrc);
// Check the android directory and the build.gradle file within.
final File pluginGradleFile =
pluginAppDir.childDirectory('android').childFile('build.gradle');
expect(pluginGradleFile, exists);
} else {
expect(pubspecYamlSrc, isNot(contains('android:')));
}
// Create a project which includes the plugin to test against
final Directory pluginExampleAppDir =
pluginAppDir.childDirectory('example');
await project.setUpIn(pluginExampleAppDir);
// Run flutter build apk to build plugin example project.
return processManager.runSync(<String>[
flutterBin,
...getLocalEngineArguments(),
'build',
'apk',
'--debug',
], workingDirectory: pluginExampleAppDir.path);
}
test('skip plugin if it does not support the Android platform', () async {
final Project project = PluginWithPathAndroidProject();
final ProcessResult buildApkResult = await testUnsupportedPlugin(
project: project, createAndroidPluginFolder: false);
expect(buildApkResult.stderr.toString(),
isNot(contains('Please fix your settings.gradle')));
expect(buildApkResult, const ProcessResultMatcher());
});
test(
'skip plugin with android folder if it does not support the Android platform',
() async {
final Project project = PluginWithPathAndroidProject();
final ProcessResult buildApkResult = await testUnsupportedPlugin(
project: project, createAndroidPluginFolder: true);
expect(buildApkResult.stderr.toString(),
isNot(contains('Please fix your settings.gradle')));
expect(buildApkResult, const ProcessResultMatcher());
});
// TODO(54566): Remove test when issue is resolved.
/// Test project with a `settings.gradle` (PluginEach) that apps were created
/// with until Flutter v1.22.0.
/// It uses the `.flutter-plugins` file to load EACH plugin.
test(
'skip plugin if it does not support the Android platform with a _plugin.each_ settings.gradle',
() async {
final Project project = PluginEachWithPathAndroidProject();
final ProcessResult buildApkResult = await testUnsupportedPlugin(
project: project, createAndroidPluginFolder: false);
expect(buildApkResult.stderr.toString(),
isNot(contains('Please fix your settings.gradle')));
expect(buildApkResult, const ProcessResultMatcher());
});
// TODO(54566): Remove test when issue is resolved.
/// Test project with a `settings.gradle` (PluginEach) that apps were created
/// with until Flutter v1.22.0.
/// It uses the `.flutter-plugins` file to load EACH plugin.
/// The plugin includes a functional 'android' folder.
test(
'skip plugin with android folder if it does not support the Android platform with a _plugin.each_ settings.gradle',
() async {
final Project project = PluginEachWithPathAndroidProject();
final ProcessResult buildApkResult = await testUnsupportedPlugin(
project: project, createAndroidPluginFolder: true);
expect(buildApkResult.stderr.toString(),
isNot(contains('Please fix your settings.gradle')));
expect(buildApkResult, const ProcessResultMatcher());
});
// TODO(54566): Remove test when issue is resolved.
/// Test project with a `settings.gradle` (PluginEach) that apps were created
/// with until Flutter v1.22.0.
/// It is compromised by removing the 'include' statement of the plugins.
/// As the "'.flutter-plugins'" keyword is still present, the framework
/// assumes that all plugins are included, which is not the case.
/// Therefore it should throw an error.
test(
'skip plugin if it does not support the Android platform with a compromised _plugin.each_ settings.gradle',
() async {
final Project project = PluginCompromisedEachWithPathAndroidProject();
final ProcessResult buildApkResult = await testUnsupportedPlugin(
project: project, createAndroidPluginFolder: true);
expect(
buildApkResult,
const ProcessResultMatcher(
stderrPattern: 'Please fix your settings.gradle'),
);
});
}
const String pubspecWithPluginPath = r'''
name: test
environment:
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
sdk: flutter
test_plugin:
path: ../
''';
/// Project that load's a plugin from the specified path.
class PluginWithPathAndroidProject extends PluginProject {
@override
String get pubspec => pubspecWithPluginPath;
}
// TODO(54566): Remove class when issue is resolved.
/// [PluginEachSettingsGradleProject] that load's a plugin from the specified
/// path.
class PluginEachWithPathAndroidProject extends PluginEachSettingsGradleProject {
@override
String get pubspec => pubspecWithPluginPath;
}
// TODO(54566): Remove class when issue is resolved.
/// [PluginCompromisedEachSettingsGradleProject] that load's a plugin from the
/// specified path.
class PluginCompromisedEachWithPathAndroidProject
extends PluginCompromisedEachSettingsGradleProject {
@override
String get pubspec => pubspecWithPluginPath;
}
| flutter/packages/flutter_tools/test/integration.shard/android_plugin_skip_unsupported_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/integration.shard/android_plugin_skip_unsupported_test.dart",
"repo_id": "flutter",
"token_count": 2475
} | 790 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:io';
import 'package:dds/dap.dart';
import 'package:file/file.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/convert.dart';
import 'package:flutter_tools/src/globals.dart' as globals;
import 'package:test/test.dart';
import 'test_client.dart';
import 'test_server.dart';
/// Whether to run the DAP server in-process with the tests, or externally in
/// another process.
///
/// By default tests will run the DAP server out-of-process to match the real
/// use from editors, but this complicates debugging the adapter. Set this env
/// variables to run the server in-process for easier debugging (this can be
/// simplified in VS Code by using a launch config with custom CodeLens links).
final bool useInProcessDap = Platform.environment['DAP_TEST_INTERNAL'] == 'true';
/// Whether to print all protocol traffic to stdout while running tests.
///
/// This is useful for debugging locally or on the bots and will include both
/// DAP traffic (between the test DAP client and the DAP server) and the VM
/// Service traffic (wrapped in a custom 'dart.log' event).
final bool verboseLogging = Platform.environment['DAP_TEST_VERBOSE'] == 'true';
const String endOfErrorOutputMarker = '════════════════════════════════════════════════════════════════════════════════';
/// Expects the lines in [actual] to match the relevant matcher in [expected],
/// ignoring differences in line endings and trailing whitespace.
void expectLines(
String actual,
List<Object> expected, {
bool allowExtras = false,
}) {
if (allowExtras) {
expect(
actual.replaceAll('\r\n', '\n').trim().split('\n'),
containsAllInOrder(expected),
);
} else {
expect(
actual.replaceAll('\r\n', '\n').trim().split('\n'),
equals(expected),
);
}
}
/// Manages running a simple Flutter app to be used in tests that need to attach
/// to an existing process.
class SimpleFlutterRunner {
SimpleFlutterRunner(this.process) {
process.stdout.transform(ByteToLineTransformer()).listen(_handleStdout);
process.stderr.transform(utf8.decoder).listen(_handleStderr);
unawaited(process.exitCode.then(_handleExitCode));
}
final StreamController<String> _output = StreamController<String>.broadcast();
/// A broadcast stream of any non-JSON output from the process.
Stream<String> get output => _output.stream;
void _handleExitCode(int code) {
if (!_vmServiceUriCompleter.isCompleted) {
_vmServiceUriCompleter.completeError('Flutter process ended without producing a VM Service URI');
}
}
void _handleStderr(String err) {
if (!_vmServiceUriCompleter.isCompleted) {
_vmServiceUriCompleter.completeError(err);
}
}
void _handleStdout(String outputLine) {
try {
final Object? json = jsonDecode(outputLine);
// Flutter --machine output is wrapped in [brackets] so will deserialize
// as a list with one item.
if (json is List && json.length == 1) {
final Object? message = json.single;
// Parse the add.debugPort event which contains our VM Service URI.
if (message is Map<String, Object?> && message['event'] == 'app.debugPort') {
final String vmServiceUri = (message['params']! as Map<String, Object?>)['wsUri']! as String;
if (!_vmServiceUriCompleter.isCompleted) {
_vmServiceUriCompleter.complete(Uri.parse(vmServiceUri));
}
}
}
} on FormatException {
// `flutter run` writes a lot of text to stdout that isn't daemon messages
// (not valid JSON), so just pass that one for tests that may want it.
_output.add(outputLine);
}
}
final Process process;
final Completer<Uri> _vmServiceUriCompleter = Completer<Uri>();
Future<Uri> get vmServiceUri => _vmServiceUriCompleter.future;
static Future<SimpleFlutterRunner> start(Directory projectDirectory) async {
final String flutterToolPath = globals.fs.path.join(Cache.flutterRoot!, 'bin', globals.platform.isWindows ? 'flutter.bat' : 'flutter');
final List<String> args = <String>[
'run',
'--machine',
'-d',
'flutter-tester',
];
final Process process = await Process.start(
flutterToolPath,
args,
workingDirectory: projectDirectory.path,
);
return SimpleFlutterRunner(process);
}
}
/// A helper class containing the DAP server/client for DAP integration tests.
class DapTestSession {
DapTestSession._(this.server, this.client);
DapTestServer server;
DapTestClient client;
Future<void> tearDown() async {
await client.stop();
await server.stop();
}
static Future<DapTestSession> setUp({List<String>? additionalArgs}) async {
final DapTestServer server = await _startServer(additionalArgs: additionalArgs);
final DapTestClient client = await DapTestClient.connect(
server,
captureVmServiceTraffic: verboseLogging,
logger: verboseLogging ? print : null,
);
return DapTestSession._(server, client);
}
/// Starts a DAP server that can be shared across tests.
static Future<DapTestServer> _startServer({
Logger? logger,
List<String>? additionalArgs,
}) async {
return useInProcessDap
? await InProcessDapTestServer.create(
logger: logger,
additionalArgs: additionalArgs,
)
: await OutOfProcessDapTestServer.create(
logger: logger,
additionalArgs: additionalArgs,
);
}
}
| flutter/packages/flutter_tools/test/integration.shard/debug_adapter/test_support.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/integration.shard/debug_adapter/test_support.dart",
"repo_id": "flutter",
"token_count": 1989
} | 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/io.dart';
import 'package:process/process.dart';
import '../src/common.dart';
import 'test_data/basic_project.dart';
import 'test_driver.dart';
import 'test_utils.dart';
void main() {
late Directory tempDir;
final BasicProject project = BasicProject();
late FlutterRunTestDriver flutter;
setUp(() async {
tempDir = createResolvedTempDirectorySync('run_test.');
await project.setUpIn(tempDir);
flutter = FlutterRunTestDriver(tempDir);
});
tearDown(() async {
await flutter.stop();
tryToDelete(tempDir);
});
testWithoutContext('flutter run reports an error if an invalid device is supplied', () async {
// This test forces flutter to check for all possible devices to catch issues
// like https://github.com/flutter/flutter/issues/21418 which were skipped
// over because other integration tests run using flutter-tester which short-cuts
// some of the checks for devices.
final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter');
const ProcessManager processManager = LocalProcessManager();
final ProcessResult proc = await processManager.run(
<String>[flutterBin, 'run', '-d', 'invalid-device-id'],
workingDirectory: tempDir.path,
);
expect(proc.stdout, isNot(contains('flutter has exited unexpectedly')));
expect(proc.stderr, isNot(contains('flutter has exited unexpectedly')));
if (!proc.stderr.toString().contains('Unable to locate a development')
&& !proc.stdout.toString().contains('No supported devices found with name or id matching')) {
fail("'flutter run -d invalid-device-id' did not produce the expected error");
}
});
testWithoutContext('sets activeDevToolsServerAddress extension', () async {
await flutter.run(
startPaused: true,
withDebugger: true,
additionalCommandArgs: <String>['--devtools-server-address', 'http://127.0.0.1:9110'],
);
await flutter.resume();
await pollForServiceExtensionValue<String>(
testDriver: flutter,
extension: 'ext.flutter.activeDevToolsServerAddress',
continuePollingValue: '',
matches: equals('http://127.0.0.1:9110'),
);
await pollForServiceExtensionValue<String>(
testDriver: flutter,
extension: 'ext.flutter.connectedVmServiceUri',
continuePollingValue: '',
matches: isNotEmpty,
);
});
testWithoutContext('reports deviceId and mode in app.start event', () async {
await flutter.run();
expect(flutter.currentRunningDeviceId, 'flutter-tester');
expect(flutter.currentRunningMode, 'debug');
});
}
| flutter/packages/flutter_tools/test/integration.shard/flutter_run_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/integration.shard/flutter_run_test.dart",
"repo_id": "flutter",
"token_count": 951
} | 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 '../test_utils.dart';
import 'project.dart';
/// Spawns a background isolate that prints a debug message.
class BackgroundProject extends Project {
@override
final String pubspec = '''
name: test
environment:
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
sdk: flutter
''';
@override
final String main = r'''
import 'dart:async';
import 'dart:isolate';
import 'package:flutter/widgets.dart';
import 'package:flutter/material.dart';
void main() {
Isolate.spawn<void>(background, null, debugName: 'background');
TestMain();
}
void background(void message) {
TestIsolate();
}
class TestMain {
TestMain() {
debugPrint('Main thread');
}
}
class TestIsolate {
TestIsolate() {
debugPrint('Isolate thread');
}
}
''';
void updateTestIsolatePhrase(String message) {
final String newMainContents = main.replaceFirst('Isolate thread', message);
writeFile(fileSystem.path.join(dir.path, 'lib', 'main.dart'), newMainContents,
writeFutureModifiedDate: true);
}
}
// Spawns a background isolate that repeats a message.
class RepeatingBackgroundProject extends Project {
@override
final String pubspec = '''
name: test
environment:
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
sdk: flutter
''';
@override
final String main = r'''
import 'dart:async';
import 'dart:isolate';
import 'package:flutter/widgets.dart';
import 'package:flutter/material.dart';
void main() {
Isolate.spawn<void>(background, null, debugName: 'background');
TestMain();
}
void background(void message) {
Timer.periodic(const Duration(milliseconds: 500), (Timer timer) => TestIsolate());
}
class TestMain {
TestMain() {
debugPrint('Main thread');
}
}
class TestIsolate {
TestIsolate() {
debugPrint('Isolate thread');
}
}
''';
void updateTestIsolatePhrase(String message) {
final String newMainContents = main.replaceFirst('Isolate thread', message);
writeFile(
fileSystem.path.join(dir.path, 'lib', 'main.dart'),
newMainContents,
writeFutureModifiedDate: true,
);
}
}
| flutter/packages/flutter_tools/test/integration.shard/test_data/background_project.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/integration.shard/test_data/background_project.dart",
"repo_id": "flutter",
"token_count": 849
} | 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 'project.dart';
class ProjectWithEarlyError extends Project {
@override
final String pubspec = '''
name: test
environment:
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
sdk: flutter
''';
@override
final String main = r'''
import 'dart:async';
import 'package:flutter/material.dart';
Future<void> main() async {
while (true) {
runApp(MyApp());
await Future.delayed(const Duration(milliseconds: 50));
}
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
throw FormatException();
}
}
''';
}
| flutter/packages/flutter_tools/test/integration.shard/test_data/project_with_early_error.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/integration.shard/test_data/project_with_early_error.dart",
"repo_id": "flutter",
"token_count": 286
} | 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.
import 'dart:io' as io;
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/globals.dart' as globals;
import '../src/common.dart';
import 'test_utils.dart';
const String xcodeBackendPath = 'bin/xcode_backend.sh';
const String xcodeBackendErrorHeader = '========================================================================';
// Acceptable $CONFIGURATION/$FLUTTER_BUILD_MODE values should be debug, profile, or release
const Map<String, String> unknownConfiguration = <String, String>{
'CONFIGURATION': 'Custom',
};
// $FLUTTER_BUILD_MODE will override $CONFIGURATION
const Map<String, String> unknownFlutterBuildMode = <String, String>{
'FLUTTER_BUILD_MODE': 'Custom',
'CONFIGURATION': 'Debug',
};
void main() {
Future<void> expectXcodeBackendFails(Map<String, String> environment) async {
final ProcessResult result = await Process.run(
xcodeBackendPath,
<String>['build'],
environment: environment,
);
expect(result.stderr, startsWith(xcodeBackendErrorHeader));
expect(result.exitCode, isNot(0));
}
test('Xcode backend fails with no arguments', () async {
final ProcessResult result = await Process.run(
xcodeBackendPath,
<String>[],
environment: <String, String>{
'SOURCE_ROOT': '../examples/hello_world',
'FLUTTER_ROOT': '../..',
},
);
expect(result.stderr, startsWith('error: Your Xcode project is incompatible with this version of Flutter.'));
expect(result.exitCode, isNot(0));
}, skip: !io.Platform.isMacOS); // [intended] requires macos toolchain.
test('Xcode backend fails for on unsupported configuration combinations', () async {
await expectXcodeBackendFails(unknownConfiguration);
await expectXcodeBackendFails(unknownFlutterBuildMode);
}, skip: !io.Platform.isMacOS); // [intended] requires macos toolchain.
test('Xcode backend warns archiving a non-release build.', () async {
final ProcessResult result = await Process.run(
xcodeBackendPath,
<String>['build'],
environment: <String, String>{
'CONFIGURATION': 'Debug',
'ACTION': 'install',
},
);
expect(result.stdout, contains('warning: Flutter archive not built in Release mode.'));
expect(result.exitCode, isNot(0));
}, skip: !io.Platform.isMacOS); // [intended] requires macos toolchain.
group('vmService Bonjour service keys', () {
late Directory buildDirectory;
late File infoPlist;
setUp(() {
buildDirectory = globals.fs.systemTempDirectory.createTempSync('flutter_tools_xcode_backend_test.');
infoPlist = buildDirectory.childFile('Info.plist');
});
test('handles when the Info.plist is missing', () async {
final ProcessResult result = await Process.run(
xcodeBackendPath,
<String>['test_vm_service_bonjour_service'],
environment: <String, String>{
'CONFIGURATION': 'Debug',
'BUILT_PRODUCTS_DIR': buildDirectory.path,
'INFOPLIST_PATH': 'Info.plist',
},
);
expect(result, const ProcessResultMatcher(stdoutPattern: 'Info.plist does not exist.'));
});
const String emptyPlist = '''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>''';
test('does not add keys in Release', () async {
infoPlist.writeAsStringSync(emptyPlist);
final ProcessResult result = await Process.run(
xcodeBackendPath,
<String>['test_vm_service_bonjour_service'],
environment: <String, String>{
'CONFIGURATION': 'Release',
'BUILT_PRODUCTS_DIR': buildDirectory.path,
'INFOPLIST_PATH': 'Info.plist',
},
);
final String actualInfoPlist = infoPlist.readAsStringSync();
expect(actualInfoPlist, isNot(contains('NSBonjourServices')));
expect(actualInfoPlist, isNot(contains('dartVmService')));
expect(actualInfoPlist, isNot(contains('NSLocalNetworkUsageDescription')));
expect(result, const ProcessResultMatcher());
});
for (final String buildConfiguration in <String>['Debug', 'Profile']) {
test('add keys in $buildConfiguration', () async {
infoPlist.writeAsStringSync(emptyPlist);
final ProcessResult result = await Process.run(
xcodeBackendPath,
<String>['test_vm_service_bonjour_service'],
environment: <String, String>{
'CONFIGURATION': buildConfiguration,
'BUILT_PRODUCTS_DIR': buildDirectory.path,
'INFOPLIST_PATH': 'Info.plist',
},
);
final String actualInfoPlist = infoPlist.readAsStringSync();
expect(actualInfoPlist, contains('NSBonjourServices'));
expect(actualInfoPlist, contains('dartVmService'));
expect(actualInfoPlist, contains('NSLocalNetworkUsageDescription'));
expect(result, const ProcessResultMatcher());
});
}
test('adds to existing Bonjour services, does not override network usage description', () async {
infoPlist.writeAsStringSync('''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSBonjourServices</key>
<array>
<string>_bogus._tcp</string>
</array>
<key>NSLocalNetworkUsageDescription</key>
<string>Don't override this</string>
</dict>
</plist>''');
final ProcessResult result = await Process.run(
xcodeBackendPath,
<String>['test_vm_service_bonjour_service'],
environment: <String, String>{
'CONFIGURATION': 'Debug',
'BUILT_PRODUCTS_DIR': buildDirectory.path,
'INFOPLIST_PATH': 'Info.plist',
},
);
expect(infoPlist.readAsStringSync(), '''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSBonjourServices</key>
<array>
<string>_dartVmService._tcp</string>
<string>_bogus._tcp</string>
</array>
<key>NSLocalNetworkUsageDescription</key>
<string>Don't override this</string>
</dict>
</plist>
''');
expect(result, const ProcessResultMatcher());
});
test('does not add bonjour settings when port publication is disabled', () async {
infoPlist.writeAsStringSync('''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>''');
final ProcessResult result = await Process.run(
xcodeBackendPath,
<String>['test_vm_service_bonjour_service'],
environment: <String, String>{
'CONFIGURATION': 'Debug',
'BUILT_PRODUCTS_DIR': buildDirectory.path,
'INFOPLIST_PATH': 'Info.plist',
'DISABLE_PORT_PUBLICATION': 'YES',
},
);
expect(infoPlist.readAsStringSync().contains('NSBonjourServices'), isFalse);
expect(infoPlist.readAsStringSync().contains('NSLocalNetworkUsageDescription'), isFalse);
expect(result, const ProcessResultMatcher());
});
}, skip: !io.Platform.isMacOS); // [intended] requires macos toolchain.
}
| flutter/packages/flutter_tools/test/integration.shard/xcode_backend_test.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/integration.shard/xcode_backend_test.dart",
"repo_id": "flutter",
"token_count": 2939
} | 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.
import 'dart:async';
import 'dart:io';
import 'package:file/memory.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/os.dart';
import 'package:flutter_tools/src/base/process.dart';
import 'package:flutter_tools/src/base/signals.dart';
import 'package:flutter_tools/src/base/terminal.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/context_runner.dart';
import 'package:flutter_tools/src/dart/pub.dart';
import 'package:flutter_tools/src/globals.dart' as globals;
import 'package:flutter_tools/src/reporting/reporting.dart';
import 'package:flutter_tools/src/version.dart';
import 'context.dart';
import 'fake_http_client.dart';
import 'fakes.dart';
import 'throwing_pub.dart';
export 'package:flutter_tools/src/base/context.dart' show Generator;
// A default value should be provided if the vast majority of tests should use
// this provider. For example, [BufferLogger], [MemoryFileSystem].
final Map<Type, Generator> _testbedDefaults = <Type, Generator>{
// Keeps tests fast by avoiding the actual file system.
FileSystem: () => MemoryFileSystem(style: globals.platform.isWindows ? FileSystemStyle.windows : FileSystemStyle.posix),
ProcessManager: () => FakeProcessManager.any(),
Logger: () => BufferLogger(
terminal: AnsiTerminal(stdio: globals.stdio, platform: globals.platform), // Danger, using real stdio.
outputPreferences: OutputPreferences.test(),
), // Allows reading logs and prevents stdout.
OperatingSystemUtils: () => FakeOperatingSystemUtils(),
OutputPreferences: () => OutputPreferences.test(), // configures BufferLogger to avoid color codes.
Usage: () => TestUsage(), // prevent addition of analytics from burdening test mocks
FlutterVersion: () => FakeFlutterVersion(), // prevent requirement to mock git for test runner.
Signals: () => FakeSignals(), // prevent registering actual signal handlers.
Pub: () => ThrowingPub(), // prevent accidental invocations of pub.
};
/// Manages interaction with the tool injection and runner system.
///
/// The Testbed automatically injects reasonable defaults through the context
/// DI system such as a [BufferLogger] and a [MemoryFileSystem].
///
/// Example:
///
/// Testing that a filesystem operation works as expected:
///
/// void main() {
/// group('Example', () {
/// Testbed testbed;
///
/// setUp(() {
/// testbed = Testbed(setUp: () {
/// globals.fs.file('foo').createSync()
/// });
/// })
///
/// test('Can delete a file', () => testbed.run(() {
/// expect(globals.fs.file('foo').existsSync(), true);
/// globals.fs.file('foo').deleteSync();
/// expect(globals.fs.file('foo').existsSync(), false);
/// }));
/// });
/// }
///
/// For a more detailed example, see the code in test_compiler_test.dart.
class Testbed {
/// Creates a new [TestBed]
///
/// `overrides` provides more overrides in addition to the test defaults.
/// `setup` may be provided to apply mocks within the tool managed zone,
/// including any specified overrides.
Testbed({FutureOr<void> Function()? setup, Map<Type, Generator>? overrides})
: _setup = setup,
_overrides = overrides;
final FutureOr<void> Function()? _setup;
final Map<Type, Generator>? _overrides;
/// Runs `test` within a tool zone.
///
/// `overrides` may be used to provide new context values for the single test
/// case or override any context values from the setup.
Future<T?> run<T>(FutureOr<T> Function() test, {Map<Type, Generator>? overrides}) {
final Map<Type, Generator> testOverrides = <Type, Generator>{
..._testbedDefaults,
// Add the initial setUp overrides
...?_overrides,
// Add the test-specific overrides
...?overrides,
};
if (testOverrides.containsKey(ProcessUtils)) {
throw StateError('Do not inject ProcessUtils for testing, use ProcessManager instead.');
}
// Cache the original flutter root to restore after the test case.
final String? originalFlutterRoot = Cache.flutterRoot;
// Track pending timers to verify that they were correctly cleaned up.
final Map<Timer, StackTrace> timers = <Timer, StackTrace>{};
return HttpOverrides.runZoned(() {
return runInContext<T?>(() {
return context.run<T?>(
name: 'testbed',
overrides: testOverrides,
zoneSpecification: ZoneSpecification(
createTimer: (Zone self, ZoneDelegate parent, Zone zone, Duration duration, void Function() timer) {
final Timer result = parent.createTimer(zone, duration, timer);
timers[result] = StackTrace.current;
return result;
},
createPeriodicTimer: (Zone self, ZoneDelegate parent, Zone zone, Duration period, void Function(Timer) timer) {
final Timer result = parent.createPeriodicTimer(zone, period, timer);
timers[result] = StackTrace.current;
return result;
},
),
body: () async {
Cache.flutterRoot = '';
if (_setup != null) {
await _setup.call();
}
await test();
Cache.flutterRoot = originalFlutterRoot;
for (final MapEntry<Timer, StackTrace> entry in timers.entries) {
if (entry.key.isActive) {
throw StateError('A Timer was active at the end of a test: ${entry.value}');
}
}
return null;
});
});
}, createHttpClient: (SecurityContext? c) => FakeHttpClient.any());
}
}
| flutter/packages/flutter_tools/test/src/testbed.dart/0 | {
"file_path": "flutter/packages/flutter_tools/test/src/testbed.dart",
"repo_id": "flutter",
"token_count": 2179
} | 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.
/// The platform channels and plugin registry implementations for
/// the web implementations of Flutter plugins.
///
/// This library provides the [Registrar] class, which is used in the
/// `registerWith` method that is itself called by the code generated
/// by the `flutter` tool for web applications.
///
/// See also:
///
/// * [How to Write a Flutter Web Plugin](https://medium.com/flutter/how-to-write-a-flutter-web-plugin-5e26c689ea1), a Medium article
/// describing how the `url_launcher` package was created using [flutter_web_plugins].
library flutter_web_plugins;
export 'src/navigation/url_strategy.dart';
export 'src/navigation/utils.dart';
export 'src/plugin_event_channel.dart';
export 'src/plugin_registry.dart';
| flutter/packages/flutter_web_plugins/lib/flutter_web_plugins.dart/0 | {
"file_path": "flutter/packages/flutter_web_plugins/lib/flutter_web_plugins.dart",
"repo_id": "flutter",
"token_count": 260
} | 797 |
// 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.
/// Library for logging the remote debug protocol internals.
///
/// Useful for determining connection issues and the like. This is included as a
/// separate library so that it can be imported under a separate namespace in
/// the event that you are using a logging package with similar class names.
library logging;
export 'src/common/logging.dart';
| flutter/packages/fuchsia_remote_debug_protocol/lib/logging.dart/0 | {
"file_path": "flutter/packages/fuchsia_remote_debug_protocol/lib/logging.dart",
"repo_id": "flutter",
"token_count": 121
} | 798 |
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
| flutter/packages/integration_test/android/gradle.properties/0 | {
"file_path": "flutter/packages/integration_test/android/gradle.properties",
"repo_id": "flutter",
"token_count": 38
} | 799 |
<!-- 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. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.integration_test_example">
<!-- ${applicationName} is used by the Flutter tool to select the Application
class to use. For most apps, this is the default Android application.
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
Application and put your custom class here. -->
<application
android:name="${applicationName}"
android:label="integration_test_example"
android:icon="@mipmap/ic_launcher">
<activity
android:name="io.flutter.embedding.android.FlutterActivity"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:exported="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/integration_test/example/android/app/src/main/AndroidManifest.xml/0 | {
"file_path": "flutter/packages/integration_test/example/android/app/src/main/AndroidManifest.xml",
"repo_id": "flutter",
"token_count": 578
} | 800 |
// 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 'dart:ui';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import '../common.dart';
import 'channel.dart';
/// The dart:io implementation of [CallbackManager].
///
/// See also:
///
/// * `_callback_web.dart`, which has the dart:html implementation
CallbackManager get callbackManager => _singletonCallbackManager;
/// IOCallbackManager singleton.
final _IOCallbackManager _singletonCallbackManager = _IOCallbackManager();
/// Manages communication between `integration_tests` and the `driver_tests`.
///
/// This is the dart:io implementation.
class _IOCallbackManager implements CallbackManager {
@override
Future<Map<String, dynamic>> callback(
Map<String, String> params, IntegrationTestResults testRunner) async {
final String command = params['command']!;
Map<String, String> response;
switch (command) {
case 'request_data':
final bool allTestsPassed = await testRunner.allTestsPassed.future;
response = <String, String>{
'message': allTestsPassed
? Response.allTestsPassed(data: testRunner.reportData).toJson()
: Response.someTestsFailed(
testRunner.failureMethodsDetails,
data: testRunner.reportData,
).toJson(),
};
case 'get_health':
response = <String, String>{'status': 'ok'};
default:
throw UnimplementedError('$command is not implemented');
}
return <String, dynamic>{
'isError': false,
'response': response,
};
}
@override
void cleanup() {
// no-op.
// Add any IO platform specific Completer/Future cleanups to here if any
// comes up in the future. For example: `WebCallbackManager.cleanup`.
}
// [convertFlutterSurfaceToImage] has been called and [takeScreenshot] is ready to capture the surface (Android only).
bool _isSurfaceRendered = false;
@override
Future<void> convertFlutterSurfaceToImage() async {
if (!Platform.isAndroid) {
// No-op on other platforms.
return;
}
assert(!_isSurfaceRendered, 'Surface already converted to an image');
await integrationTestChannel.invokeMethod<void>(
'convertFlutterSurfaceToImage',
);
_isSurfaceRendered = true;
addTearDown(() async {
assert(_isSurfaceRendered, 'Surface is not an image');
await integrationTestChannel.invokeMethod<void>(
'revertFlutterImage',
);
_isSurfaceRendered = false;
});
}
@override
Future<Map<String, dynamic>> takeScreenshot(String screenshot, [Map<String, Object?>? args]) async {
assert(args == null, '[args] handling has not been implemented for this platform');
if (Platform.isAndroid && !_isSurfaceRendered) {
throw StateError('Call convertFlutterSurfaceToImage() before taking a screenshot');
}
integrationTestChannel.setMethodCallHandler(_onMethodChannelCall);
final List<int>? rawBytes = await integrationTestChannel.invokeMethod<List<int>>(
'captureScreenshot',
<String, dynamic>{'name': screenshot},
);
if (rawBytes == null) {
throw StateError('Expected a list of bytes, but instead captureScreenshot returned null');
}
return <String, dynamic>{
'screenshotName': screenshot,
'bytes': rawBytes,
};
}
Future<dynamic> _onMethodChannelCall(MethodCall call) async {
switch (call.method) {
case 'scheduleFrame':
PlatformDispatcher.instance.scheduleFrame();
}
return null;
}
}
| flutter/packages/integration_test/lib/src/_callback_io.dart/0 | {
"file_path": "flutter/packages/integration_test/lib/src/_callback_io.dart",
"repo_id": "flutter",
"token_count": 1321
} | 801 |
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:io';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
class SocketExceptionHttpClient extends Fake implements HttpClient {
@override
Future<HttpClientRequest> openUrl(String method, Uri url) {
throw const SocketException('always throw');
}
}
Future<void> main() async {
final IntegrationTestWidgetsFlutterBinding binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
test('Prints an appropriate message on socket exception', () async {
bool gotStateError = false;
try {
await binding.enableTimeline(httpClient: SocketExceptionHttpClient());
} on StateError catch (e) {
gotStateError = true;
expect(e.toString(), contains('This may happen if DDS is enabled'));
} on SocketException catch (_) {
fail('Did not expect a socket exception.');
}
expect(gotStateError, true);
});
}
| flutter/packages/integration_test/test/socket_fail_test.dart/0 | {
"file_path": "flutter/packages/integration_test/test/socket_fail_test.dart",
"repo_id": "flutter",
"token_count": 333
} | 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:math' as math;
import 'package:flutter/material.dart';
import 'hand.dart';
/// A clock hand that is drawn with [CustomPainter]
///
/// The hand's length scales based on the clock's size.
/// This hand is used to build the second and minute hands, and demonstrates
/// building a custom hand.
class DrawnHand extends Hand {
/// Create a const clock [Hand].
///
/// All of the parameters are required and must not be null.
const DrawnHand({
@required Color color,
@required this.thickness,
@required double size,
@required double angleRadians,
}) : assert(color != null),
assert(thickness != null),
assert(size != null),
assert(angleRadians != null),
super(
color: color,
size: size,
angleRadians: angleRadians,
);
/// How thick the hand should be drawn, in logical pixels.
final double thickness;
@override
Widget build(BuildContext context) {
return Center(
child: SizedBox.expand(
child: CustomPaint(
painter: _HandPainter(
handSize: size,
lineWidth: thickness,
angleRadians: angleRadians,
color: color,
),
),
),
);
}
}
/// [CustomPainter] that draws a clock hand.
class _HandPainter extends CustomPainter {
_HandPainter({
@required this.handSize,
@required this.lineWidth,
@required this.angleRadians,
@required this.color,
}) : assert(handSize != null),
assert(lineWidth != null),
assert(angleRadians != null),
assert(color != null),
assert(handSize >= 0.0),
assert(handSize <= 1.0);
double handSize;
double lineWidth;
double angleRadians;
Color color;
@override
void paint(Canvas canvas, Size size) {
final center = (Offset.zero & size).center;
// We want to start at the top, not at the x-axis, so add pi/2.
final angle = angleRadians - math.pi / 2.0;
final length = size.shortestSide * 0.5 * handSize;
final position = center + Offset(math.cos(angle), math.sin(angle)) * length;
final linePaint = Paint()
..color = color
..strokeWidth = lineWidth
..strokeCap = StrokeCap.square;
canvas.drawLine(center, position, linePaint);
}
@override
bool shouldRepaint(_HandPainter oldDelegate) {
return oldDelegate.handSize != handSize ||
oldDelegate.lineWidth != lineWidth ||
oldDelegate.angleRadians != angleRadians ||
oldDelegate.color != color;
}
}
| flutter_clock/analog_clock/lib/drawn_hand.dart/0 | {
"file_path": "flutter_clock/analog_clock/lib/drawn_hand.dart",
"repo_id": "flutter_clock",
"token_count": 1011
} | 803 |
package io.flutter.demo.gallery
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
| gallery/android/app/src/main/kotlin/io/flutter/demo/gallery/MainActivity.kt/0 | {
"file_path": "gallery/android/app/src/main/kotlin/io/flutter/demo/gallery/MainActivity.kt",
"repo_id": "gallery",
"token_count": 40
} | 804 |
package_name("io.flutter.demo.gallery")
| gallery/android/fastlane/Appfile/0 | {
"file_path": "gallery/android/fastlane/Appfile",
"repo_id": "gallery",
"token_count": 15
} | 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 'dart:collection';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations_en.dart'
show GalleryLocalizationsEn;
import 'package:gallery/codeviewer/code_displayer.dart';
import 'package:gallery/codeviewer/code_segments.dart';
import 'package:gallery/data/icons.dart';
import 'package:gallery/deferred_widget.dart';
import 'package:gallery/demos/cupertino/cupertino_demos.dart'
deferred as cupertino_demos;
import 'package:gallery/demos/cupertino/demo_types.dart';
import 'package:gallery/demos/material/material_demo_types.dart';
import 'package:gallery/demos/material/material_demos.dart'
deferred as material_demos;
import 'package:gallery/demos/reference/colors_demo.dart'
deferred as colors_demo;
import 'package:gallery/demos/reference/motion_demo_container_transition.dart'
deferred as motion_demo_container;
import 'package:gallery/demos/reference/motion_demo_fade_scale_transition.dart';
import 'package:gallery/demos/reference/motion_demo_fade_through_transition.dart';
import 'package:gallery/demos/reference/motion_demo_shared_x_axis_transition.dart';
import 'package:gallery/demos/reference/motion_demo_shared_y_axis_transition.dart';
import 'package:gallery/demos/reference/motion_demo_shared_z_axis_transition.dart';
import 'package:gallery/demos/reference/transformations_demo.dart'
deferred as transformations_demo;
import 'package:gallery/demos/reference/two_pane_demo.dart'
deferred as twopane_demo;
import 'package:gallery/demos/reference/typography_demo.dart'
deferred as typography;
const _docsBaseUrl = 'https://api.flutter.dev/flutter';
const _docsAnimationsUrl =
'https://pub.dev/documentation/animations/latest/animations';
enum GalleryDemoCategory {
study,
material,
cupertino,
other;
@override
String toString() {
return name.toUpperCase();
}
String? displayTitle(GalleryLocalizations localizations) {
switch (this) {
case GalleryDemoCategory.other:
return localizations.homeCategoryReference;
case GalleryDemoCategory.material:
case GalleryDemoCategory.cupertino:
return toString();
case GalleryDemoCategory.study:
}
return null;
}
}
class GalleryDemo {
const GalleryDemo({
required this.title,
required this.category,
required this.subtitle,
// This parameter is required for studies.
this.studyId,
// Parameters below are required for non-study demos.
this.slug,
this.icon,
this.configurations = const [],
}) : assert(category == GalleryDemoCategory.study ||
(slug != null && icon != null)),
assert(slug != null || studyId != null);
final String title;
final GalleryDemoCategory category;
final String subtitle;
final String? studyId;
final String? slug;
final IconData? icon;
final List<GalleryDemoConfiguration> configurations;
String get describe => '${slug ?? studyId}@${category.name}';
}
class GalleryDemoConfiguration {
const GalleryDemoConfiguration({
required this.title,
required this.description,
required this.documentationUrl,
required this.buildRoute,
required this.code,
});
final String title;
final String description;
final String documentationUrl;
final WidgetBuilder buildRoute;
final CodeDisplayer code;
}
/// Awaits all deferred libraries for tests.
Future<void> pumpDeferredLibraries() {
final futures = <Future<void>>[
DeferredWidget.preload(cupertino_demos.loadLibrary),
DeferredWidget.preload(material_demos.loadLibrary),
DeferredWidget.preload(motion_demo_container.loadLibrary),
DeferredWidget.preload(colors_demo.loadLibrary),
DeferredWidget.preload(transformations_demo.loadLibrary),
DeferredWidget.preload(typography.loadLibrary),
];
return Future.wait(futures);
}
class Demos {
static Map<String?, GalleryDemo> asSlugToDemoMap(BuildContext context) {
final localizations = GalleryLocalizations.of(context)!;
return LinkedHashMap<String?, GalleryDemo>.fromIterable(
all(localizations),
key: (dynamic demo) => demo.slug as String?,
);
}
static List<GalleryDemo> all(GalleryLocalizations localizations) =>
studies(localizations).values.toList() +
materialDemos(localizations) +
cupertinoDemos(localizations) +
otherDemos(localizations);
static List<String> allDescriptions() =>
all(GalleryLocalizationsEn()).map((demo) => demo.describe).toList();
static Map<String, GalleryDemo> studies(GalleryLocalizations localizations) {
return <String, GalleryDemo>{
'shrine': GalleryDemo(
title: 'Shrine',
subtitle: localizations.shrineDescription,
category: GalleryDemoCategory.study,
studyId: 'shrine',
),
'rally': GalleryDemo(
title: 'Rally',
subtitle: localizations.rallyDescription,
category: GalleryDemoCategory.study,
studyId: 'rally',
),
'crane': GalleryDemo(
title: 'Crane',
subtitle: localizations.craneDescription,
category: GalleryDemoCategory.study,
studyId: 'crane',
),
'fortnightly': GalleryDemo(
title: 'Fortnightly',
subtitle: localizations.fortnightlyDescription,
category: GalleryDemoCategory.study,
studyId: 'fortnightly',
),
'reply': GalleryDemo(
title: 'Reply',
subtitle: localizations.replyDescription,
category: GalleryDemoCategory.study,
studyId: 'reply',
),
'starterApp': GalleryDemo(
title: localizations.starterAppTitle,
subtitle: localizations.starterAppDescription,
category: GalleryDemoCategory.study,
studyId: 'starter',
),
};
}
static List<GalleryDemo> materialDemos(GalleryLocalizations localizations) {
LibraryLoader materialDemosLibrary = material_demos.loadLibrary;
return [
GalleryDemo(
title: localizations.demoAppBarTitle,
icon: GalleryIcons.appbar,
slug: 'app-bar',
subtitle: localizations.demoAppBarSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoAppBarTitle,
description: localizations.demoAppBarDescription,
documentationUrl: '$_docsBaseUrl/material/AppBar-class.html',
buildRoute: (_) => DeferredWidget(
materialDemosLibrary,
() => material_demos.AppBarDemo(),
),
code: CodeSegments.appbarDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoBannerTitle,
icon: GalleryIcons.listsLeaveBehind,
slug: 'banner',
subtitle: localizations.demoBannerSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoBannerTitle,
description: localizations.demoBannerDescription,
documentationUrl:
'$_docsBaseUrl/material/MaterialBanner-class.html',
buildRoute: (_) => DeferredWidget(
materialDemosLibrary,
() => material_demos.BannerDemo(),
),
code: CodeSegments.bannerDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoBottomAppBarTitle,
icon: GalleryIcons.bottomAppBar,
slug: 'bottom-app-bar',
subtitle: localizations.demoBottomAppBarSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoBottomAppBarTitle,
description: localizations.demoBottomAppBarDescription,
documentationUrl: '$_docsBaseUrl/material/BottomAppBar-class.html',
buildRoute: (_) => DeferredWidget(
materialDemosLibrary,
() => material_demos.BottomAppBarDemo(),
),
code: CodeSegments.bottomAppBarDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoBottomNavigationTitle,
icon: GalleryIcons.bottomNavigation,
slug: 'bottom-navigation',
subtitle: localizations.demoBottomNavigationSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoBottomNavigationPersistentLabels,
description: localizations.demoBottomNavigationDescription,
documentationUrl:
'$_docsBaseUrl/material/BottomNavigationBar-class.html',
buildRoute: (_) => DeferredWidget(
materialDemosLibrary,
() => material_demos.BottomNavigationDemo(
type: BottomNavigationDemoType.withLabels,
restorationId: 'bottom_navigation_labels_demo',
)),
code: CodeSegments.bottomNavigationDemo,
),
GalleryDemoConfiguration(
title: localizations.demoBottomNavigationSelectedLabel,
description: localizations.demoBottomNavigationDescription,
documentationUrl:
'$_docsBaseUrl/material/BottomNavigationBar-class.html',
buildRoute: (_) => DeferredWidget(
materialDemosLibrary,
() => material_demos.BottomNavigationDemo(
type: BottomNavigationDemoType.withoutLabels,
restorationId: 'bottom_navigation_without_labels_demo',
)),
code: CodeSegments.bottomNavigationDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoBottomSheetTitle,
icon: GalleryIcons.bottomSheets,
slug: 'bottom-sheet',
subtitle: localizations.demoBottomSheetSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoBottomSheetPersistentTitle,
description: localizations.demoBottomSheetPersistentDescription,
documentationUrl: '$_docsBaseUrl/material/BottomSheet-class.html',
buildRoute: (_) => DeferredWidget(
materialDemosLibrary,
() => material_demos.BottomSheetDemo(
type: BottomSheetDemoType.persistent,
)),
code: CodeSegments.bottomSheetDemoPersistent,
),
GalleryDemoConfiguration(
title: localizations.demoBottomSheetModalTitle,
description: localizations.demoBottomSheetModalDescription,
documentationUrl: '$_docsBaseUrl/material/BottomSheet-class.html',
buildRoute: (_) => DeferredWidget(
materialDemosLibrary,
() => material_demos.BottomSheetDemo(
type: BottomSheetDemoType.modal,
)),
code: CodeSegments.bottomSheetDemoModal,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoButtonTitle,
icon: GalleryIcons.genericButtons,
slug: 'button',
subtitle: localizations.demoButtonSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoTextButtonTitle,
description: localizations.demoTextButtonDescription,
documentationUrl: '$_docsBaseUrl/material/TextButton-class.html',
buildRoute: (_) => DeferredWidget(materialDemosLibrary,
() => material_demos.ButtonDemo(type: ButtonDemoType.text)),
code: CodeSegments.buttonDemoText,
),
GalleryDemoConfiguration(
title: localizations.demoElevatedButtonTitle,
description: localizations.demoElevatedButtonDescription,
documentationUrl:
'$_docsBaseUrl/material/ElevatedButton-class.html',
buildRoute: (_) => DeferredWidget(materialDemosLibrary,
() => material_demos.ButtonDemo(type: ButtonDemoType.elevated)),
code: CodeSegments.buttonDemoElevated,
),
GalleryDemoConfiguration(
title: localizations.demoOutlinedButtonTitle,
description: localizations.demoOutlinedButtonDescription,
documentationUrl:
'$_docsBaseUrl/material/OutlinedButton-class.html',
buildRoute: (_) => DeferredWidget(materialDemosLibrary,
() => material_demos.ButtonDemo(type: ButtonDemoType.outlined)),
code: CodeSegments.buttonDemoOutlined,
),
GalleryDemoConfiguration(
title: localizations.demoToggleButtonTitle,
description: localizations.demoToggleButtonDescription,
documentationUrl: '$_docsBaseUrl/material/ToggleButtons-class.html',
buildRoute: (_) => DeferredWidget(materialDemosLibrary,
() => material_demos.ButtonDemo(type: ButtonDemoType.toggle)),
code: CodeSegments.buttonDemoToggle,
),
GalleryDemoConfiguration(
title: localizations.demoFloatingButtonTitle,
description: localizations.demoFloatingButtonDescription,
documentationUrl:
'$_docsBaseUrl/material/FloatingActionButton-class.html',
buildRoute: (_) => DeferredWidget(materialDemosLibrary,
() => material_demos.ButtonDemo(type: ButtonDemoType.floating)),
code: CodeSegments.buttonDemoFloating,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoCardTitle,
icon: GalleryIcons.cards,
slug: 'card',
subtitle: localizations.demoCardSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoCardTitle,
description: localizations.demoCardDescription,
documentationUrl: '$_docsBaseUrl/material/Card-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.CardsDemo(),
),
code: CodeSegments.cardsDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoChipTitle,
icon: GalleryIcons.chips,
slug: 'chip',
subtitle: localizations.demoChipSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoActionChipTitle,
description: localizations.demoActionChipDescription,
documentationUrl: '$_docsBaseUrl/material/ActionChip-class.html',
buildRoute: (context) => DeferredWidget(materialDemosLibrary,
() => material_demos.ChipDemo(type: ChipDemoType.action)),
code: CodeSegments.chipDemoAction,
),
GalleryDemoConfiguration(
title: localizations.demoChoiceChipTitle,
description: localizations.demoChoiceChipDescription,
documentationUrl: '$_docsBaseUrl/material/ChoiceChip-class.html',
buildRoute: (context) => DeferredWidget(materialDemosLibrary,
() => material_demos.ChipDemo(type: ChipDemoType.choice)),
code: CodeSegments.chipDemoChoice,
),
GalleryDemoConfiguration(
title: localizations.demoFilterChipTitle,
description: localizations.demoFilterChipDescription,
documentationUrl: '$_docsBaseUrl/material/FilterChip-class.html',
buildRoute: (context) => DeferredWidget(materialDemosLibrary,
() => material_demos.ChipDemo(type: ChipDemoType.filter)),
code: CodeSegments.chipDemoFilter,
),
GalleryDemoConfiguration(
title: localizations.demoInputChipTitle,
description: localizations.demoInputChipDescription,
documentationUrl: '$_docsBaseUrl/material/InputChip-class.html',
buildRoute: (context) => DeferredWidget(materialDemosLibrary,
() => material_demos.ChipDemo(type: ChipDemoType.input)),
code: CodeSegments.chipDemoInput,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoDataTableTitle,
icon: GalleryIcons.dataTable,
slug: 'data-table',
subtitle: localizations.demoDataTableSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoDataTableTitle,
description: localizations.demoDataTableDescription,
documentationUrl: '$_docsBaseUrl/material/DataTable-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.DataTableDemo(),
),
code: CodeSegments.dataTableDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoDialogTitle,
icon: GalleryIcons.dialogs,
slug: 'dialog',
subtitle: localizations.demoDialogSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoAlertDialogTitle,
description: localizations.demoAlertDialogDescription,
documentationUrl: '$_docsBaseUrl/material/AlertDialog-class.html',
buildRoute: (context) => DeferredWidget(materialDemosLibrary,
() => material_demos.DialogDemo(type: DialogDemoType.alert)),
code: CodeSegments.dialogDemo,
),
GalleryDemoConfiguration(
title: localizations.demoAlertTitleDialogTitle,
description: localizations.demoAlertDialogDescription,
documentationUrl: '$_docsBaseUrl/material/AlertDialog-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() =>
material_demos.DialogDemo(type: DialogDemoType.alertTitle)),
code: CodeSegments.dialogDemo,
),
GalleryDemoConfiguration(
title: localizations.demoSimpleDialogTitle,
description: localizations.demoSimpleDialogDescription,
documentationUrl: '$_docsBaseUrl/material/SimpleDialog-class.html',
buildRoute: (context) => DeferredWidget(materialDemosLibrary,
() => material_demos.DialogDemo(type: DialogDemoType.simple)),
code: CodeSegments.dialogDemo,
),
GalleryDemoConfiguration(
title: localizations.demoFullscreenDialogTitle,
description: localizations.demoFullscreenDialogDescription,
documentationUrl:
'$_docsBaseUrl/widgets/PageRoute/fullscreenDialog.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() =>
material_demos.DialogDemo(type: DialogDemoType.fullscreen)),
code: CodeSegments.dialogDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoDividerTitle,
icon: GalleryIcons.divider,
slug: 'divider',
subtitle: localizations.demoDividerSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoDividerTitle,
description: localizations.demoDividerDescription,
documentationUrl: '$_docsBaseUrl/material/Divider-class.html',
buildRoute: (_) => DeferredWidget(
materialDemosLibrary,
() => material_demos.DividerDemo(
type: DividerDemoType.horizontal)),
code: CodeSegments.dividerDemo,
),
GalleryDemoConfiguration(
title: localizations.demoVerticalDividerTitle,
description: localizations.demoDividerDescription,
documentationUrl:
'$_docsBaseUrl/material/VerticalDivider-class.html',
buildRoute: (_) => DeferredWidget(
materialDemosLibrary,
() =>
material_demos.DividerDemo(type: DividerDemoType.vertical)),
code: CodeSegments.verticalDividerDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoGridListsTitle,
icon: GalleryIcons.gridOn,
slug: 'grid-lists',
subtitle: localizations.demoGridListsSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoGridListsImageOnlyTitle,
description: localizations.demoGridListsDescription,
documentationUrl: '$_docsBaseUrl/widgets/GridView-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.GridListDemo(
type: GridListDemoType.imageOnly)),
code: CodeSegments.gridListsDemo,
),
GalleryDemoConfiguration(
title: localizations.demoGridListsHeaderTitle,
description: localizations.demoGridListsDescription,
documentationUrl: '$_docsBaseUrl/widgets/GridView-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() =>
material_demos.GridListDemo(type: GridListDemoType.header)),
code: CodeSegments.gridListsDemo,
),
GalleryDemoConfiguration(
title: localizations.demoGridListsFooterTitle,
description: localizations.demoGridListsDescription,
documentationUrl: '$_docsBaseUrl/widgets/GridView-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() =>
material_demos.GridListDemo(type: GridListDemoType.footer)),
code: CodeSegments.gridListsDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoListsTitle,
icon: GalleryIcons.listAlt,
slug: 'lists',
subtitle: localizations.demoListsSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoOneLineListsTitle,
description: localizations.demoListsDescription,
documentationUrl: '$_docsBaseUrl/material/ListTile-class.html',
buildRoute: (context) => DeferredWidget(materialDemosLibrary,
() => material_demos.ListDemo(type: ListDemoType.oneLine)),
code: CodeSegments.listDemo,
),
GalleryDemoConfiguration(
title: localizations.demoTwoLineListsTitle,
description: localizations.demoListsDescription,
documentationUrl: '$_docsBaseUrl/material/ListTile-class.html',
buildRoute: (context) => DeferredWidget(materialDemosLibrary,
() => material_demos.ListDemo(type: ListDemoType.twoLine)),
code: CodeSegments.listDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoMenuTitle,
icon: GalleryIcons.moreVert,
slug: 'menu',
subtitle: localizations.demoMenuSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoContextMenuTitle,
description: localizations.demoMenuDescription,
documentationUrl: '$_docsBaseUrl/material/PopupMenuItem-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.MenuDemo(type: MenuDemoType.contextMenu),
),
code: CodeSegments.menuDemoContext,
),
GalleryDemoConfiguration(
title: localizations.demoSectionedMenuTitle,
description: localizations.demoMenuDescription,
documentationUrl: '$_docsBaseUrl/material/PopupMenuItem-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.MenuDemo(type: MenuDemoType.sectionedMenu),
),
code: CodeSegments.menuDemoSectioned,
),
GalleryDemoConfiguration(
title: localizations.demoChecklistMenuTitle,
description: localizations.demoMenuDescription,
documentationUrl:
'$_docsBaseUrl/material/CheckedPopupMenuItem-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.MenuDemo(type: MenuDemoType.checklistMenu),
),
code: CodeSegments.menuDemoChecklist,
),
GalleryDemoConfiguration(
title: localizations.demoSimpleMenuTitle,
description: localizations.demoMenuDescription,
documentationUrl: '$_docsBaseUrl/material/PopupMenuItem-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.MenuDemo(type: MenuDemoType.simpleMenu),
),
code: CodeSegments.menuDemoSimple,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoNavigationDrawerTitle,
icon: GalleryIcons.menu,
slug: 'nav_drawer',
subtitle: localizations.demoNavigationDrawerSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoNavigationDrawerTitle,
description: localizations.demoNavigationDrawerDescription,
documentationUrl: '$_docsBaseUrl/material/Drawer-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.NavDrawerDemo(),
),
code: CodeSegments.navDrawerDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoNavigationRailTitle,
icon: GalleryIcons.navigationRail,
slug: 'nav_rail',
subtitle: localizations.demoNavigationRailSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoNavigationRailTitle,
description: localizations.demoNavigationRailDescription,
documentationUrl:
'$_docsBaseUrl/material/NavigationRail-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.NavRailDemo(),
),
code: CodeSegments.navRailDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoPickersTitle,
icon: GalleryIcons.event,
slug: 'pickers',
subtitle: localizations.demoPickersSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoDatePickerTitle,
description: localizations.demoDatePickerDescription,
documentationUrl: '$_docsBaseUrl/material/showDatePicker.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.PickerDemo(type: PickerDemoType.date),
),
code: CodeSegments.pickerDemo,
),
GalleryDemoConfiguration(
title: localizations.demoTimePickerTitle,
description: localizations.demoTimePickerDescription,
documentationUrl: '$_docsBaseUrl/material/showTimePicker.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.PickerDemo(type: PickerDemoType.time),
),
code: CodeSegments.pickerDemo,
),
GalleryDemoConfiguration(
title: localizations.demoDateRangePickerTitle,
description: localizations.demoDateRangePickerDescription,
documentationUrl: '$_docsBaseUrl/material/showDateRangePicker.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.PickerDemo(type: PickerDemoType.range),
),
code: CodeSegments.pickerDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoProgressIndicatorTitle,
icon: GalleryIcons.progressActivity,
slug: 'progress-indicator',
subtitle: localizations.demoProgressIndicatorSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoCircularProgressIndicatorTitle,
description: localizations.demoCircularProgressIndicatorDescription,
documentationUrl:
'$_docsBaseUrl/material/CircularProgressIndicator-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.ProgressIndicatorDemo(
type: ProgressIndicatorDemoType.circular,
),
),
code: CodeSegments.progressIndicatorsDemo,
),
GalleryDemoConfiguration(
title: localizations.demoLinearProgressIndicatorTitle,
description: localizations.demoLinearProgressIndicatorDescription,
documentationUrl:
'$_docsBaseUrl/material/LinearProgressIndicator-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.ProgressIndicatorDemo(
type: ProgressIndicatorDemoType.linear,
),
),
code: CodeSegments.progressIndicatorsDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoSelectionControlsTitle,
icon: GalleryIcons.checkBox,
slug: 'selection-controls',
subtitle: localizations.demoSelectionControlsSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoSelectionControlsCheckboxTitle,
description: localizations.demoSelectionControlsCheckboxDescription,
documentationUrl: '$_docsBaseUrl/material/Checkbox-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.SelectionControlsDemo(
type: SelectionControlsDemoType.checkbox,
),
),
code: CodeSegments.selectionControlsDemoCheckbox,
),
GalleryDemoConfiguration(
title: localizations.demoSelectionControlsRadioTitle,
description: localizations.demoSelectionControlsRadioDescription,
documentationUrl: '$_docsBaseUrl/material/Radio-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.SelectionControlsDemo(
type: SelectionControlsDemoType.radio,
),
),
code: CodeSegments.selectionControlsDemoRadio,
),
GalleryDemoConfiguration(
title: localizations.demoSelectionControlsSwitchTitle,
description: localizations.demoSelectionControlsSwitchDescription,
documentationUrl: '$_docsBaseUrl/material/Switch-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.SelectionControlsDemo(
type: SelectionControlsDemoType.switches,
),
),
code: CodeSegments.selectionControlsDemoSwitches,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoSlidersTitle,
icon: GalleryIcons.sliders,
slug: 'sliders',
subtitle: localizations.demoSlidersSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoSlidersTitle,
description: localizations.demoSlidersDescription,
documentationUrl: '$_docsBaseUrl/material/Slider-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.SlidersDemo(type: SlidersDemoType.sliders),
),
code: CodeSegments.slidersDemo,
),
GalleryDemoConfiguration(
title: localizations.demoRangeSlidersTitle,
description: localizations.demoRangeSlidersDescription,
documentationUrl: '$_docsBaseUrl/material/RangeSlider-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.SlidersDemo(
type: SlidersDemoType.rangeSliders),
),
code: CodeSegments.rangeSlidersDemo,
),
GalleryDemoConfiguration(
title: localizations.demoCustomSlidersTitle,
description: localizations.demoCustomSlidersDescription,
documentationUrl: '$_docsBaseUrl/material/SliderTheme-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.SlidersDemo(
type: SlidersDemoType.customSliders),
),
code: CodeSegments.customSlidersDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoSnackbarsTitle,
icon: GalleryIcons.snackbar,
slug: 'snackbars',
subtitle: localizations.demoSnackbarsSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoSnackbarsTitle,
description: localizations.demoSnackbarsDescription,
documentationUrl: '$_docsBaseUrl/material/SnackBar-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.SnackbarsDemo(),
),
code: CodeSegments.snackbarsDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoTabsTitle,
icon: GalleryIcons.tabs,
slug: 'tabs',
subtitle: localizations.demoTabsSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoTabsScrollingTitle,
description: localizations.demoTabsDescription,
documentationUrl: '$_docsBaseUrl/material/TabBar-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.TabsDemo(type: TabsDemoType.scrollable),
),
code: CodeSegments.tabsScrollableDemo,
),
GalleryDemoConfiguration(
title: localizations.demoTabsNonScrollingTitle,
description: localizations.demoTabsDescription,
documentationUrl: '$_docsBaseUrl/material/TabBar-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.TabsDemo(type: TabsDemoType.nonScrollable),
),
code: CodeSegments.tabsNonScrollableDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoTextFieldTitle,
icon: GalleryIcons.textFieldsAlt,
slug: 'text-field',
subtitle: localizations.demoTextFieldSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoTextFieldTitle,
description: localizations.demoTextFieldDescription,
documentationUrl: '$_docsBaseUrl/material/TextField-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.TextFieldDemo(),
),
code: CodeSegments.textFieldDemo,
),
],
category: GalleryDemoCategory.material,
),
GalleryDemo(
title: localizations.demoTooltipTitle,
icon: GalleryIcons.tooltip,
slug: 'tooltip',
subtitle: localizations.demoTooltipSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoTooltipTitle,
description: localizations.demoTooltipDescription,
documentationUrl: '$_docsBaseUrl/material/Tooltip-class.html',
buildRoute: (context) => DeferredWidget(
materialDemosLibrary,
() => material_demos.TooltipDemo(),
),
code: CodeSegments.tooltipDemo,
),
],
category: GalleryDemoCategory.material,
),
];
}
static List<GalleryDemo> cupertinoDemos(GalleryLocalizations localizations) {
LibraryLoader cupertinoLoader = cupertino_demos.loadLibrary;
return [
GalleryDemo(
title: localizations.demoCupertinoActivityIndicatorTitle,
icon: GalleryIcons.cupertinoProgress,
slug: 'cupertino-activity-indicator',
subtitle: localizations.demoCupertinoActivityIndicatorSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoCupertinoActivityIndicatorTitle,
description:
localizations.demoCupertinoActivityIndicatorDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoActivityIndicator-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
() => cupertino_demos.CupertinoProgressIndicatorDemo(),
),
code: CodeSegments.cupertinoActivityIndicatorDemo,
),
],
category: GalleryDemoCategory.cupertino,
),
GalleryDemo(
title: localizations.demoCupertinoAlertsTitle,
icon: GalleryIcons.dialogs,
slug: 'cupertino-alerts',
subtitle: localizations.demoCupertinoAlertsSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoCupertinoAlertTitle,
description: localizations.demoCupertinoAlertDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoAlertDialog-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
() => cupertino_demos.CupertinoAlertDemo(
type: AlertDemoType.alert)),
code: CodeSegments.cupertinoAlertDemo,
),
GalleryDemoConfiguration(
title: localizations.demoCupertinoAlertWithTitleTitle,
description: localizations.demoCupertinoAlertDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoAlertDialog-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
() => cupertino_demos.CupertinoAlertDemo(
type: AlertDemoType.alertTitle)),
code: CodeSegments.cupertinoAlertDemo,
),
GalleryDemoConfiguration(
title: localizations.demoCupertinoAlertButtonsTitle,
description: localizations.demoCupertinoAlertDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoAlertDialog-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
() => cupertino_demos.CupertinoAlertDemo(
type: AlertDemoType.alertButtons)),
code: CodeSegments.cupertinoAlertDemo,
),
GalleryDemoConfiguration(
title: localizations.demoCupertinoAlertButtonsOnlyTitle,
description: localizations.demoCupertinoAlertDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoAlertDialog-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
() => cupertino_demos.CupertinoAlertDemo(
type: AlertDemoType.alertButtonsOnly)),
code: CodeSegments.cupertinoAlertDemo,
),
GalleryDemoConfiguration(
title: localizations.demoCupertinoActionSheetTitle,
description: localizations.demoCupertinoActionSheetDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoActionSheet-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
() => cupertino_demos.CupertinoAlertDemo(
type: AlertDemoType.actionSheet)),
code: CodeSegments.cupertinoAlertDemo,
),
],
category: GalleryDemoCategory.cupertino,
),
GalleryDemo(
title: localizations.demoCupertinoButtonsTitle,
icon: GalleryIcons.genericButtons,
slug: 'cupertino-buttons',
subtitle: localizations.demoCupertinoButtonsSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoCupertinoButtonsTitle,
description: localizations.demoCupertinoButtonsDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoButton-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
() => cupertino_demos.CupertinoButtonDemo(),
),
code: CodeSegments.cupertinoButtonDemo,
),
],
category: GalleryDemoCategory.cupertino,
),
GalleryDemo(
title: localizations.demoCupertinoContextMenuTitle,
icon: GalleryIcons.moreVert,
slug: 'cupertino-context-menu',
subtitle: localizations.demoCupertinoContextMenuSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoCupertinoContextMenuTitle,
description: localizations.demoCupertinoContextMenuDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoContextMenu-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
() => cupertino_demos.CupertinoContextMenuDemo(),
),
code: CodeSegments.cupertinoContextMenuDemo,
),
],
category: GalleryDemoCategory.cupertino,
),
GalleryDemo(
title: localizations.demoCupertinoNavigationBarTitle,
icon: GalleryIcons.bottomSheetPersistent,
slug: 'cupertino-navigation-bar',
subtitle: localizations.demoCupertinoNavigationBarSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoCupertinoNavigationBarTitle,
description: localizations.demoCupertinoNavigationBarDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoNavigationBar-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
() => cupertino_demos.CupertinoNavigationBarDemo(),
),
code: CodeSegments.cupertinoNavigationBarDemo,
),
],
category: GalleryDemoCategory.cupertino,
),
GalleryDemo(
title: localizations.demoCupertinoPickerTitle,
icon: GalleryIcons.listAlt,
slug: 'cupertino-picker',
subtitle: localizations.demoCupertinoPickerSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoCupertinoPickerTitle,
description: localizations.demoCupertinoPickerDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoDatePicker-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
// ignore: prefer_const_constructors
() => cupertino_demos.CupertinoPickerDemo()),
code: CodeSegments.cupertinoPickersDemo,
),
],
category: GalleryDemoCategory.cupertino,
),
GalleryDemo(
title: localizations.demoCupertinoScrollbarTitle,
icon: GalleryIcons.listAlt,
slug: 'cupertino-scrollbar',
subtitle: localizations.demoCupertinoScrollbarSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoCupertinoScrollbarTitle,
description: localizations.demoCupertinoScrollbarDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoScrollbar-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
// ignore: prefer_const_constructors
() => cupertino_demos.CupertinoScrollbarDemo()),
code: CodeSegments.cupertinoScrollbarDemo,
),
],
category: GalleryDemoCategory.cupertino,
),
GalleryDemo(
title: localizations.demoCupertinoSegmentedControlTitle,
icon: GalleryIcons.tabs,
slug: 'cupertino-segmented-control',
subtitle: localizations.demoCupertinoSegmentedControlSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoCupertinoSegmentedControlTitle,
description: localizations.demoCupertinoSegmentedControlDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoSegmentedControl-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
() => cupertino_demos.CupertinoSegmentedControlDemo(),
),
code: CodeSegments.cupertinoSegmentedControlDemo,
),
],
category: GalleryDemoCategory.cupertino,
),
GalleryDemo(
title: localizations.demoCupertinoSliderTitle,
icon: GalleryIcons.sliders,
slug: 'cupertino-slider',
subtitle: localizations.demoCupertinoSliderSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoCupertinoSliderTitle,
description: localizations.demoCupertinoSliderDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoSlider-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
() => cupertino_demos.CupertinoSliderDemo(),
),
code: CodeSegments.cupertinoSliderDemo,
),
],
category: GalleryDemoCategory.cupertino,
),
GalleryDemo(
title: localizations.demoSelectionControlsSwitchTitle,
icon: GalleryIcons.cupertinoSwitch,
slug: 'cupertino-switch',
subtitle: localizations.demoCupertinoSwitchSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoSelectionControlsSwitchTitle,
description: localizations.demoCupertinoSwitchDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoSwitch-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
() => cupertino_demos.CupertinoSwitchDemo(),
),
code: CodeSegments.cupertinoSwitchDemo,
),
],
category: GalleryDemoCategory.cupertino,
),
GalleryDemo(
title: localizations.demoCupertinoTabBarTitle,
icon: GalleryIcons.bottomNavigation,
slug: 'cupertino-tab-bar',
subtitle: localizations.demoCupertinoTabBarSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoCupertinoTabBarTitle,
description: localizations.demoCupertinoTabBarDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoTabBar-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
() => cupertino_demos.CupertinoTabBarDemo(),
),
code: CodeSegments.cupertinoNavigationDemo,
),
],
category: GalleryDemoCategory.cupertino,
),
GalleryDemo(
title: localizations.demoCupertinoTextFieldTitle,
icon: GalleryIcons.textFieldsAlt,
slug: 'cupertino-text-field',
subtitle: localizations.demoCupertinoTextFieldSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoCupertinoTextFieldTitle,
description: localizations.demoCupertinoTextFieldDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoTextField-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
() => cupertino_demos.CupertinoTextFieldDemo(),
),
code: CodeSegments.cupertinoTextFieldDemo,
),
],
category: GalleryDemoCategory.cupertino,
),
GalleryDemo(
title: localizations.demoCupertinoSearchTextFieldTitle,
icon: GalleryIcons.search,
slug: 'cupertino-search-text-field',
subtitle: localizations.demoCupertinoSearchTextFieldSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoCupertinoSearchTextFieldTitle,
description: localizations.demoCupertinoSearchTextFieldDescription,
documentationUrl:
'$_docsBaseUrl/cupertino/CupertinoSearchTextField-class.html',
buildRoute: (_) => DeferredWidget(
cupertinoLoader,
() => cupertino_demos.CupertinoSearchTextFieldDemo(),
),
code: CodeSegments.cupertinoTextFieldDemo,
),
],
category: GalleryDemoCategory.cupertino,
),
];
}
static List<GalleryDemo> otherDemos(GalleryLocalizations localizations) {
return [
GalleryDemo(
title: localizations.demoTwoPaneTitle,
icon: GalleryIcons.bottomSheetPersistent,
slug: 'two-pane',
subtitle: localizations.demoTwoPaneSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoTwoPaneFoldableLabel,
description: localizations.demoTwoPaneFoldableDescription,
documentationUrl:
'https://pub.dev/documentation/dual_screen/latest/dual_screen/TwoPane-class.html',
buildRoute: (_) => DeferredWidget(
twopane_demo.loadLibrary,
() => twopane_demo.TwoPaneDemo(
type: twopane_demo.TwoPaneDemoType.foldable,
restorationId: 'two_pane_foldable',
),
),
code: CodeSegments.twoPaneDemo,
),
GalleryDemoConfiguration(
title: localizations.demoTwoPaneTabletLabel,
description: localizations.demoTwoPaneTabletDescription,
documentationUrl:
'https://pub.dev/documentation/dual_screen/latest/dual_screen/TwoPane-class.html',
buildRoute: (_) => DeferredWidget(
twopane_demo.loadLibrary,
() => twopane_demo.TwoPaneDemo(
type: twopane_demo.TwoPaneDemoType.tablet,
restorationId: 'two_pane_tablet',
),
),
code: CodeSegments.twoPaneDemo,
),
GalleryDemoConfiguration(
title: localizations.demoTwoPaneSmallScreenLabel,
description: localizations.demoTwoPaneSmallScreenDescription,
documentationUrl:
'https://pub.dev/documentation/dual_screen/latest/dual_screen/TwoPane-class.html',
buildRoute: (_) => DeferredWidget(
twopane_demo.loadLibrary,
() => twopane_demo.TwoPaneDemo(
type: twopane_demo.TwoPaneDemoType.smallScreen,
restorationId: 'two_pane_single',
),
),
code: CodeSegments.twoPaneDemo,
),
],
category: GalleryDemoCategory.other,
),
GalleryDemo(
title: localizations.demoMotionTitle,
icon: GalleryIcons.animation,
slug: 'motion',
subtitle: localizations.demoMotionSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoContainerTransformTitle,
description: localizations.demoContainerTransformDescription,
documentationUrl: '$_docsAnimationsUrl/OpenContainer-class.html',
buildRoute: (_) => DeferredWidget(
motion_demo_container.loadLibrary,
() => motion_demo_container.OpenContainerTransformDemo(),
),
code: CodeSegments.openContainerTransformDemo,
),
GalleryDemoConfiguration(
title: localizations.demoSharedXAxisTitle,
description: localizations.demoSharedAxisDescription,
documentationUrl:
'$_docsAnimationsUrl/SharedAxisTransition-class.html',
buildRoute: (_) => const SharedXAxisTransitionDemo(),
code: CodeSegments.sharedXAxisTransitionDemo,
),
GalleryDemoConfiguration(
title: localizations.demoSharedYAxisTitle,
description: localizations.demoSharedAxisDescription,
documentationUrl:
'$_docsAnimationsUrl/SharedAxisTransition-class.html',
buildRoute: (_) => const SharedYAxisTransitionDemo(),
code: CodeSegments.sharedYAxisTransitionDemo,
),
GalleryDemoConfiguration(
title: localizations.demoSharedZAxisTitle,
description: localizations.demoSharedAxisDescription,
documentationUrl:
'$_docsAnimationsUrl/SharedAxisTransition-class.html',
buildRoute: (_) => const SharedZAxisTransitionDemo(),
code: CodeSegments.sharedZAxisTransitionDemo,
),
GalleryDemoConfiguration(
title: localizations.demoFadeThroughTitle,
description: localizations.demoFadeThroughDescription,
documentationUrl:
'$_docsAnimationsUrl/FadeThroughTransition-class.html',
buildRoute: (_) => const FadeThroughTransitionDemo(),
code: CodeSegments.fadeThroughTransitionDemo,
),
GalleryDemoConfiguration(
title: localizations.demoFadeScaleTitle,
description: localizations.demoFadeScaleDescription,
documentationUrl:
'$_docsAnimationsUrl/FadeScaleTransition-class.html',
buildRoute: (_) => const FadeScaleTransitionDemo(),
code: CodeSegments.fadeScaleTransitionDemo,
),
],
category: GalleryDemoCategory.other,
),
GalleryDemo(
title: localizations.demoColorsTitle,
icon: GalleryIcons.colors,
slug: 'colors',
subtitle: localizations.demoColorsSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoColorsTitle,
description: localizations.demoColorsDescription,
documentationUrl: '$_docsBaseUrl/material/MaterialColor-class.html',
buildRoute: (_) => DeferredWidget(
colors_demo.loadLibrary,
() => colors_demo.ColorsDemo(),
),
code: CodeSegments.colorsDemo,
),
],
category: GalleryDemoCategory.other,
),
GalleryDemo(
title: localizations.demoTypographyTitle,
icon: GalleryIcons.customTypography,
slug: 'typography',
subtitle: localizations.demoTypographySubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demoTypographyTitle,
description: localizations.demoTypographyDescription,
documentationUrl: '$_docsBaseUrl/material/TextTheme-class.html',
buildRoute: (_) => DeferredWidget(
typography.loadLibrary,
() => typography.TypographyDemo(),
),
code: CodeSegments.typographyDemo,
),
],
category: GalleryDemoCategory.other,
),
GalleryDemo(
title: localizations.demo2dTransformationsTitle,
icon: GalleryIcons.gridOn,
slug: '2d-transformations',
subtitle: localizations.demo2dTransformationsSubtitle,
configurations: [
GalleryDemoConfiguration(
title: localizations.demo2dTransformationsTitle,
description: localizations.demo2dTransformationsDescription,
documentationUrl:
'$_docsBaseUrl/widgets/GestureDetector-class.html',
buildRoute: (_) => DeferredWidget(
transformations_demo.loadLibrary,
() => transformations_demo.TransformationsDemo(),
),
code: CodeSegments.transformationsDemo,
),
],
category: GalleryDemoCategory.other,
),
];
}
}
| gallery/lib/data/demos.dart/0 | {
"file_path": "gallery/lib/data/demos.dart",
"repo_id": "gallery",
"token_count": 26252
} | 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 cupertinoNavigationDemo
class _TabInfo {
const _TabInfo(this.title, this.icon);
final String title;
final IconData icon;
}
class CupertinoTabBarDemo extends StatelessWidget {
const CupertinoTabBarDemo({super.key});
@override
Widget build(BuildContext context) {
final localizations = GalleryLocalizations.of(context)!;
final tabInfo = [
_TabInfo(
localizations.cupertinoTabBarHomeTab,
CupertinoIcons.home,
),
_TabInfo(
localizations.cupertinoTabBarChatTab,
CupertinoIcons.conversation_bubble,
),
_TabInfo(
localizations.cupertinoTabBarProfileTab,
CupertinoIcons.profile_circled,
),
];
return DefaultTextStyle(
style: CupertinoTheme.of(context).textTheme.textStyle,
child: CupertinoTabScaffold(
restorationId: 'cupertino_tab_scaffold',
tabBar: CupertinoTabBar(
items: [
for (final tabInfo in tabInfo)
BottomNavigationBarItem(
label: tabInfo.title,
icon: Icon(tabInfo.icon),
),
],
),
tabBuilder: (context, index) {
return CupertinoTabView(
restorationScopeId: 'cupertino_tab_view_$index',
builder: (context) => _CupertinoDemoTab(
title: tabInfo[index].title,
icon: tabInfo[index].icon,
),
defaultTitle: tabInfo[index].title,
);
},
),
);
}
}
class _CupertinoDemoTab extends StatelessWidget {
const _CupertinoDemoTab({
required this.title,
required this.icon,
});
final String title;
final IconData icon;
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(),
backgroundColor: CupertinoColors.systemBackground,
child: Center(
child: Icon(
icon,
semanticLabel: title,
size: 100,
),
),
);
}
}
// END
| gallery/lib/demos/cupertino/cupertino_tab_bar_demo.dart/0 | {
"file_path": "gallery/lib/demos/cupertino/cupertino_tab_bar_demo.dart",
"repo_id": "gallery",
"token_count": 1020
} | 807 |
enum BottomNavigationDemoType {
withLabels,
withoutLabels,
}
enum BottomSheetDemoType {
persistent,
modal,
}
enum ButtonDemoType {
text,
elevated,
outlined,
toggle,
floating,
}
enum ChipDemoType {
action,
choice,
filter,
input,
}
enum DialogDemoType {
alert,
alertTitle,
simple,
fullscreen,
}
enum GridListDemoType {
imageOnly,
header,
footer,
}
enum ListDemoType {
oneLine,
twoLine,
}
enum MenuDemoType {
contextMenu,
sectionedMenu,
simpleMenu,
checklistMenu,
}
enum PickerDemoType {
date,
time,
range,
}
enum ProgressIndicatorDemoType {
circular,
linear,
}
enum SelectionControlsDemoType {
checkbox,
radio,
switches,
}
enum SlidersDemoType {
sliders,
rangeSliders,
customSliders,
}
enum TabsDemoType {
scrollable,
nonScrollable,
}
enum DividerDemoType {
horizontal,
vertical,
}
| gallery/lib/demos/material/material_demo_types.dart/0 | {
"file_path": "gallery/lib/demos/material/material_demo_types.dart",
"repo_id": "gallery",
"token_count": 342
} | 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 fadeThroughTransitionDemo
class FadeThroughTransitionDemo extends StatefulWidget {
const FadeThroughTransitionDemo({super.key});
@override
State<FadeThroughTransitionDemo> createState() =>
_FadeThroughTransitionDemoState();
}
class _FadeThroughTransitionDemoState extends State<FadeThroughTransitionDemo> {
int _pageIndex = 0;
final _pageList = <Widget>[
_AlbumsPage(),
_PhotosPage(),
_SearchPage(),
];
@override
Widget build(BuildContext context) {
final localizations = GalleryLocalizations.of(context)!;
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
title: Column(
children: [
Text(localizations.demoFadeThroughTitle),
Text(
'(${localizations.demoFadeThroughDemoInstructions})',
style: Theme.of(context)
.textTheme
.titleSmall!
.copyWith(color: Colors.white),
),
],
),
),
body: PageTransitionSwitcher(
transitionBuilder: (
child,
animation,
secondaryAnimation,
) {
return FadeThroughTransition(
animation: animation,
secondaryAnimation: secondaryAnimation,
child: child,
);
},
child: _pageList[_pageIndex],
),
bottomNavigationBar: BottomNavigationBar(
currentIndex: _pageIndex,
onTap: (selectedIndex) {
setState(() {
_pageIndex = selectedIndex;
});
},
items: [
BottomNavigationBarItem(
icon: const Icon(Icons.photo_library),
label: localizations.demoFadeThroughAlbumsDestination,
),
BottomNavigationBarItem(
icon: const Icon(Icons.photo),
label: localizations.demoFadeThroughPhotosDestination,
),
BottomNavigationBarItem(
icon: const Icon(Icons.search),
label: localizations.demoFadeThroughSearchDestination,
),
],
),
);
}
}
class _ExampleCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
final localizations = GalleryLocalizations.of(context)!;
final textTheme = Theme.of(context).textTheme;
return Expanded(
child: Card(
child: Stack(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(
child: Container(
color: Colors.black26,
child: Padding(
padding: const EdgeInsets.all(30),
child: Ink.image(
image: const AssetImage(
'placeholders/placeholder_image.png',
package: 'flutter_gallery_assets',
),
),
),
),
),
Padding(
padding: const EdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
localizations.demoFadeThroughTextPlaceholder,
style: textTheme.bodyLarge,
),
Text(
localizations.demoFadeThroughTextPlaceholder,
style: textTheme.bodySmall,
),
],
),
),
],
),
InkWell(
splashColor: Colors.black38,
onTap: () {},
),
],
),
),
);
}
}
class _AlbumsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
children: [
...List.generate(
3,
(index) => Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
_ExampleCard(),
_ExampleCard(),
],
),
),
),
],
);
}
}
class _PhotosPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
children: [
_ExampleCard(),
_ExampleCard(),
],
);
}
}
class _SearchPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final localizations = GalleryLocalizations.of(context);
return ListView.builder(
itemBuilder: (context, index) {
return ListTile(
leading: Image.asset(
'placeholders/avatar_logo.png',
package: 'flutter_gallery_assets',
width: 40,
),
title: Text('${localizations!.demoMotionListTileTitle} ${index + 1}'),
subtitle: Text(localizations.demoMotionPlaceholderSubtitle),
);
},
itemCount: 10,
);
}
}
// END fadeThroughTransitionDemo
| gallery/lib/demos/reference/motion_demo_fade_through_transition.dart/0 | {
"file_path": "gallery/lib/demos/reference/motion_demo_fade_through_transition.dart",
"repo_id": "gallery",
"token_count": 2780
} | 809 |
{
"loading": "جارٍ التحميل",
"deselect": "إلغاء الاختيار",
"select": "اختيار",
"selectable": "قابل للاختيار (بالضغط مع الاستمرار)",
"selected": "محدَّد",
"demo": "إصدار تجريبي",
"bottomAppBar": "شريط التطبيق السفلي",
"notSelected": "غير محدَّد",
"demoCupertinoSearchTextFieldTitle": "الحقل النصي للبحث",
"demoCupertinoPicker": "أداة الاختيار",
"demoCupertinoSearchTextFieldSubtitle": "الحقل النصي للبحث بنمط iOS",
"demoCupertinoSearchTextFieldDescription": "حقل نصي للبحث يتيح للمستخدم البحث عبر إدخال نص، ويمكن أن يوفّر للمستخدم اقتراحات ويعمل على فلترتها.",
"demoCupertinoSearchTextFieldPlaceholder": "يُرجى إدخال نص.",
"demoCupertinoScrollbarTitle": "شريط التمرير",
"demoCupertinoScrollbarSubtitle": "شريط تمرير بنمط iOS",
"demoCupertinoScrollbarDescription": "شريط تمرير يشمل العنصر الثانوي المتوفّر.",
"demoTwoPaneItem": "العنصر {value}",
"demoTwoPaneList": "القائمة",
"demoTwoPaneFoldableLabel": "قابل للطي",
"demoTwoPaneSmallScreenLabel": "الشاشة الصغيرة",
"demoTwoPaneSmallScreenDescription": "هذه هي الطريقة التي يتصرف بها TwoPane على جهاز مزوَّد بشاشة صغيرة.",
"demoTwoPaneTabletLabel": "الأجهزة اللوحية / أجهزة الكمبيوتر المكتبية",
"demoTwoPaneTabletDescription": "هذه هي الطريقة التي يتصرف بها TwoPane على جهاز مزوَّد بشاشة كبيرة، مثل الجهاز اللوحي أو جهاز الكمبيوتر المكتبي.",
"demoTwoPaneTitle": "TwoPane",
"demoTwoPaneSubtitle": "التصميمات المتجاوبة مع مختلف الأجهزة على الشاشات القابلة للطي والكبيرة والصغيرة",
"splashSelectDemo": "اختيار إصدار تجريبي",
"demoTwoPaneFoldableDescription": "هذه هي الطريقة التي يتصرف بها TwoPane على جهاز قابل للطي.",
"demoTwoPaneDetails": "التفاصيل",
"demoTwoPaneSelectItem": "اختيار عنصر",
"demoTwoPaneItemDetails": "تفاصيل العنصر {value}",
"demoCupertinoContextMenuActionText": "اضغط مع الاستمرار على شعار Flutter لعرض قائمة السياقات.",
"demoCupertinoContextMenuDescription": "قائمة سياقات بنمط iOS تظهر بوضع ملء الشاشة عند الضغط مع الاستمرار على أحد العناصر",
"demoAppBarTitle": "شريط التطبيق",
"demoAppBarDescription": "يعرض شريط التطبيق المحتوى والإجراءات المتعلّقة بالشاشة الحالية، ويُستخدَم لعرض العلامات التجارية وعناوين الشاشة والإجراءات والتنقّل بين الأقسام.",
"demoDividerTitle": "أداة تقسيم الشاشة",
"demoDividerSubtitle": "أداة تقسيم الشاشة هي خط رفيع يُجمِّع المحتوى في قوائم وتنسيقات.",
"demoDividerDescription": "يمكن استخدام أدوات تقسيم الشاشة في القوائم والأدراج وغيرها لوضع فواصل بين المحتوى.",
"demoVerticalDividerTitle": "أداة تقسيم الشاشة عموديًا",
"demoCupertinoContextMenuTitle": "قائمة السياقات",
"demoCupertinoContextMenuSubtitle": "قائمة سياقات بنمط iOS",
"demoAppBarSubtitle": "يعرض الشريط معلومات وإجراءات متعلقة بالشاشة الحالية.",
"demoCupertinoContextMenuActionOne": "الإجراء الأول",
"demoCupertinoContextMenuActionTwo": "الإجراء الثاني",
"demoDateRangePickerDescription": "تعرض هذه الأداة مربّع حوار يحتوي على أداة بتصميم متعدد الأبعاد لاختيار المرحلة الزمنية.",
"demoDateRangePickerTitle": "أداة اختيار المرحلة الزمنية",
"demoNavigationDrawerUserName": "اسم المستخدم",
"demoNavigationDrawerUserEmail": "[email protected]",
"demoNavigationDrawerText": "مرِّر سريعًا من الحافة أو انقر على الرمز في أعلى يمين الصفحة لعرض لائحة التنقّل.",
"demoNavigationRailTitle": "شريط التنقّل",
"demoNavigationRailSubtitle": "عرض شريط تنقّل داخل تطبيق",
"demoNavigationRailDescription": "أداة أساسية تظهر في يمين أو يسار التطبيق للتنقّل بين عدد صغير من الأقسام داخل التطبيق، غالبًا ما بين 3 إلى 5 أقسام.",
"demoNavigationRailFirst": "الأول",
"demoNavigationDrawerTitle": "لائحة التنقّل",
"demoNavigationRailThird": "الثالث",
"replyStarredLabel": "الرسائل المميّزة بنجمة",
"demoTextButtonDescription": "يتلوّن الزر النصي عند الضغط عليه ولكن لا يرتفع. ينصح باستخدام الأزرار النصية على أشرطة الأدوات وفي مربّعات الحوار وداخل المساحات المتروكة",
"demoElevatedButtonTitle": "زر بارز",
"demoElevatedButtonDescription": "تضفي الأزرار البارزة مزيدًا من الحركة إلى التصميمات الأحادية البعد. فهي تبرِز الوظائف المعروضة في المساحات العريضة أو المكدَّسة.",
"demoOutlinedButtonTitle": "زر محدَّد الجوانب",
"demoOutlinedButtonDescription": "تصبح الأزرار المحدَّدة الجوانب غير شفافة وترتفع عند الضغط عليها. وغالبًا ما يتم إقرانها مع الأزرار البارزة للإشارة إلى إجراء ثانوي بديل.",
"demoContainerTransformDemoInstructions": "البطاقات والقوائم وأزرار الإجراءات الرئيسية (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": "أ-ي",
"demoSharedYAxisAlbumCount": "268 ألبومًا",
"demoSharedYAxisTitle": "محور \"ص\" المشترك",
"demoSharedXAxisCreateAccountButtonText": "إنشاء حساب",
"demoFadeScaleAlertDialogDiscardButton": "تجاهل",
"demoSharedXAxisSignInTextFieldLabel": "البريد الإلكتروني أو رقم الهاتف",
"demoSharedXAxisSignInSubtitleText": "تسجيل الدخول باستخدام حسابك",
"demoSharedXAxisSignInWelcomeText": "مرحبًا David Park",
"demoSharedXAxisIndividualCourseSubtitle": "تظهر بشكل فردي",
"demoSharedXAxisBundledCourseSubtitle": "مجمّع",
"demoFadeThroughAlbumsDestination": "ألبومات",
"demoSharedXAxisDesignCourseTitle": "تصميمات",
"demoSharedXAxisIllustrationCourseTitle": "صور توضيحية",
"demoSharedXAxisBusinessCourseTitle": "أنشطة تجارية",
"demoSharedXAxisArtsAndCraftsCourseTitle": "فنون وأعمال حِرَفية",
"demoMotionPlaceholderSubtitle": "نص ثانوي",
"demoFadeScaleAlertDialogCancelButton": "إلغاء",
"demoFadeScaleAlertDialogHeader": "مربّع حوار تنبيه",
"demoFadeScaleHideFabButton": "إخفاء زر الإجراء الرئيسي (FAB)",
"demoFadeScaleShowFabButton": "إظهار زر الإجراء الرئيسي (FAB)",
"demoFadeScaleShowAlertDialogButton": "إظهار مربّع حوار مشروط",
"demoFadeScaleDescription": "يتم استخدام نمط التلاشي مع عناصر واجهة المستخدم التي تدخل في حدود الشاشة أو تخرج منها، مثلاً مربّع حوار يتلاشى في مركز الشاشة.",
"demoFadeScaleTitle": "التلاشي",
"demoFadeThroughTextPlaceholder": "123 صورة",
"demoFadeThroughSearchDestination": "بحث",
"demoFadeThroughPhotosDestination": "صور",
"demoSharedXAxisCoursePageSubtitle": "تظهر الفئات المجمّعة كمجموعات في الخلاصة. يمكنك دائمًا تغيير هذا لاحقًا.",
"demoFadeThroughDescription": "يتم استخدام نمط التلاشي التدريجي لتأثيرات الانتقال بين عناصر واجهة المستخدم التي لا تربطها علاقة قوية ببعضها.",
"demoFadeThroughTitle": "التلاشي التدريجي",
"demoSharedZAxisHelpSettingLabel": "مساعدة",
"demoMotionSubtitle": "كل أنماط الانتقال المُعرَّفة مسبقًا",
"demoSharedZAxisNotificationSettingLabel": "الإشعارات",
"demoSharedZAxisProfileSettingLabel": "الملف الشخصي",
"demoSharedZAxisSavedRecipesListTitle": "الوصفات المحفوظة",
"demoSharedZAxisBeefSandwichRecipeDescription": "وصفة شطيرة اللحم البقري",
"demoSharedZAxisCrabPlateRecipeDescription": "وصفة طبق السلطعون",
"demoSharedXAxisCoursePageTitle": "تقديم دوراتك بسلاسة",
"demoSharedZAxisCrabPlateRecipeTitle": "سلطعون",
"demoSharedZAxisShrimpPlateRecipeDescription": "وصفة طبق الروبيان",
"demoSharedZAxisShrimpPlateRecipeTitle": "روبيان",
"demoContainerTransformTypeFadeThrough": "التلاشي التدريجي",
"demoSharedZAxisDessertRecipeTitle": "حلويات",
"demoSharedZAxisSandwichRecipeDescription": "وصفة الشطيرة",
"demoSharedZAxisSandwichRecipeTitle": "شطيرة",
"demoSharedZAxisBurgerRecipeDescription": "وصفة البرغر",
"demoSharedZAxisBurgerRecipeTitle": "برغر",
"demoSharedZAxisSettingsPageTitle": "الإعدادات",
"demoSharedZAxisTitle": "محور \"ع\" المشترك",
"demoSharedZAxisPrivacySettingLabel": "الخصوصية",
"demoMotionTitle": "الحركة",
"demoContainerTransformTitle": "تحويل الحاوية",
"demoContainerTransformDescription": "تم تصميم نمط تحويل الحاوية لتأثيرات الانتقال بين العناصر في واجهة المستخدم التي تتضمّن حاوية. ينشئ هذا النمط تأثير ربط مرئي بين عنصرين في واجهة المستخدم.",
"demoContainerTransformModalBottomSheetTitle": "وضع التلاشي",
"demoContainerTransformTypeFade": "التلاشي",
"demoSharedYAxisAlbumTileDurationUnit": "دقيقة",
"demoMotionPlaceholderTitle": "عنوان",
"demoSharedXAxisForgotEmailButtonText": "هل نسيت البريد الإلكتروني؟",
"demoMotionSmallPlaceholderSubtitle": "ثانوي",
"demoMotionDetailsPageTitle": "صفحة تفاصيل",
"demoMotionListTileTitle": "عنصر قائمة",
"demoSharedAxisDescription": "يتم استخدام نمط المحور المشترك لتأثيرات الانتقال بين العناصر في واجهة المستخدم التي تربطها علاقة انتقال أو علاقة مكانية. يستخدم هذا النمط التحويل المشترك على محور \"س\" أو \"ص\" أو \"ع\" لتعزيز العلاقة بين العناصر.",
"demoSharedXAxisTitle": "محور \"س\" المشترك",
"demoSharedXAxisBackButtonText": "رجوع",
"demoSharedXAxisNextButtonText": "التالي",
"demoSharedXAxisCulinaryCourseTitle": "طهي",
"githubRepo": "مستودع GitHub {repoName}",
"fortnightlyMenuUS": "الولايات المتحدة",
"fortnightlyMenuBusiness": "أعمال",
"fortnightlyMenuScience": "علوم",
"fortnightlyMenuSports": "رياضة",
"fortnightlyMenuTravel": "سفر",
"fortnightlyMenuCulture": "ثقافة",
"fortnightlyTrendingTechDesign": "تصميم_تكنولوجي",
"rallyBudgetDetailAmountLeft": "المبلغ المتبقي",
"fortnightlyHeadlineArmy": "إصلاح الجيش الأخضر من الداخل",
"fortnightlyDescription": "تطبيق أخبار يركّز على المحتوى",
"rallyBillDetailAmountDue": "المبلغ المستحق",
"rallyBudgetDetailTotalCap": "الحد الأقصى الإجمالي",
"rallyBudgetDetailAmountUsed": "المبلغ المستخدم",
"fortnightlyTrendingHealthcareRevolution": "ثورة_الرعاية_الصحية",
"fortnightlyMenuFrontPage": "الصفحة الأمامية",
"fortnightlyMenuWorld": "العالم",
"rallyBillDetailAmountPaid": "المبلغ المدفوع",
"fortnightlyMenuPolitics": "سياسة",
"fortnightlyHeadlineBees": "نقص نحل الأراضي الزراعية",
"fortnightlyHeadlineGasoline": "مستقبل البنزين",
"fortnightlyTrendingGreenArmy": "الجيش_الأخضر",
"fortnightlyHeadlineFeminists": "مدافعون عن حقوق المرأة يجابهون التحزب",
"fortnightlyHeadlineFabrics": "مصمِّمون يستخدمون التكنولوجيا لصنع ملابس تستلهم المستقبل",
"fortnightlyHeadlineStocks": "مع ركود الأسهم، يتجه الكثيرون إلى العملة",
"fortnightlyTrendingReform": "إصلاح",
"fortnightlyMenuTech": "تكنولوجيا",
"fortnightlyHeadlineWar": "الأمريكيون المنقسمون أثناء الحرب",
"fortnightlyHeadlineHealthcare": "ثورة الرعاية الصحية الهادئة والفعالة في الوقت نفسه",
"fortnightlyLatestUpdates": "آخر المستجدّات",
"fortnightlyTrendingStocks": "الأسهم",
"rallyBillDetailTotalAmount": "المبلغ الإجمالي",
"demoCupertinoPickerDateTime": "التاريخ والوقت",
"signIn": "تسجيل الدخول",
"dataTableRowWithSugar": "{value} بالسكر",
"dataTableRowApplePie": "فطيرة التفاح",
"dataTableRowDonut": "Donut",
"dataTableRowHoneycomb": "Honeycomb",
"dataTableRowLollipop": "Lollipop",
"dataTableRowJellyBean": "Jelly bean",
"dataTableRowGingerbread": "Gingerbread",
"dataTableRowCupcake": "Cupcake",
"dataTableRowEclair": "Eclair",
"dataTableRowIceCreamSandwich": "Ice Cream Sandwich",
"dataTableRowFrozenYogurt": "زبادي مجمّد",
"dataTableColumnIron": "الحديد (النسبة المئوية)",
"dataTableColumnCalcium": "الكالسيوم (النسبة المئوية)",
"dataTableColumnSodium": "الصوديوم (بالغرام)",
"demoTimePickerTitle": "أداة اختيار الوقت",
"demo2dTransformationsResetTooltip": "إعادة ضبط التحويلات",
"dataTableColumnFat": "الدهون (بالغرام)",
"dataTableColumnCalories": "السُعرات الحرارية",
"dataTableColumnDessert": "الحلوى (تقدّم مرة واحدة)",
"cardsDemoTravelDestinationLocation1": "ثنجفور، تاميل نادو",
"demoTimePickerDescription": "تعرض مربّع حوار يحتوي على أداة اختيار وقت ذات تصميم متعدد الأبعاد.",
"demoPickersShowPicker": "إظهار أداة الاختيار",
"demoTabsScrollingTitle": "التمرير",
"demoTabsNonScrollingTitle": "عدم التمرير",
"craneHours": "{hours,plural,=1{1 س}zero{{hours} س}two{{hours} س}few{{hours} س}many{{hours} س}other{{hours} س}}",
"craneMinutes": "{minutes,plural,=1{1 د}zero{{minutes} د}two{{minutes} د}few{{minutes} د}many{{minutes} د}other{{minutes} د}}",
"craneFlightDuration": "{hoursShortForm} {minutesShortForm}",
"dataTableHeader": "التغذية",
"demoDatePickerTitle": "أداة اختيار التاريخ",
"demoPickersSubtitle": "اختيار التاريخ والوقت",
"demoPickersTitle": "أدوات اختيار الوقت",
"demo2dTransformationsEditTooltip": "تعديل المربّع",
"demoDataTableDescription": "تعرض جداول البيانات معلومات على هيئة شبكة من الصفوف والأعمدة، حيث يتم تنظيم المعلومات بطريقة يَسهُل فحصها كي يتمكّن المستخدمون من البحث عن الأنماط والإحصاءات.",
"demo2dTransformationsDescription": "انقر لتعديل المربّعات واستخدام الإيماءات للتنقل خلال المشهد. اسحب لتنفيذ العرض الشامل وحرّك إصبعيك للتكبير/التصغير ويمكنك التدوير بإصبعين. اضغط على زر إعادة الضبط للرجوع إلى الاتجاه الأصلي.",
"demo2dTransformationsSubtitle": "عرض شامل، تكبير/تصغير، تدوير",
"demo2dTransformationsTitle": "التحويلات الثنائية الأبعاد",
"demoCupertinoTextFieldPIN": "رقم التعريف الشخصي",
"demoCupertinoTextFieldDescription": "يسمح حقل النص للمستخدم بإدخال نص إما باستخدام لوحة مفاتيح حقيقية أو لوحة مفاتيح تظهر على الشاشة.",
"demoCupertinoTextFieldSubtitle": "حقول نصل بنمط iOS",
"demoCupertinoTextFieldTitle": "حقول النص",
"demoDatePickerDescription": "تعرض مربّع حوار يحتوي على أداة اختيار تاريخ ذات تصميم متعدد الأبعاد.",
"demoCupertinoPickerTime": "الوقت",
"demoCupertinoPickerDate": "التاريخ",
"demoCupertinoPickerTimer": "الموقِّت",
"demoCupertinoPickerDescription": "تطبيق مصغّر لأدوات اختيار بنمط iOS يمكن استخدامه لاختيار السلاسل النصية أو التواريخ أو الأوقات أو لاختيار التاريخ والوقت معًا.",
"demoCupertinoPickerSubtitle": "أدوات الاختيار بنمط iOS",
"demoCupertinoPickerTitle": "أدوات اختيار الوقت",
"dataTableRowWithHoney": "{value} بالعسل",
"cardsDemoTravelDestinationCity2": "تشيتيناد",
"bannerDemoResetText": "إعادة ضبط البانر",
"bannerDemoMultipleText": "إعدادات متعددة",
"bannerDemoLeadingText": "رمز سابق",
"dismiss": "رفض",
"cardsDemoTappable": "قابل للنقر عليه",
"cardsDemoSelectable": "قابل لتحديده (بالضغط مع الاستمرار)",
"cardsDemoExplore": "معرفة المزيد",
"cardsDemoExploreSemantics": "معرفة المزيد عن {destinationName}",
"cardsDemoShareSemantics": "مشاركة {destinationName}",
"cardsDemoTravelDestinationTitle1": "أهم 10 مدن يمكن زيارتها في تاميل نادو",
"cardsDemoTravelDestinationDescription1": "رقم 10",
"cardsDemoTravelDestinationCity1": "ثنجفور",
"dataTableColumnProtein": "البروتينات (بالغرام)",
"cardsDemoTravelDestinationTitle2": "حرفيون من جنوب الهند",
"cardsDemoTravelDestinationDescription2": "عمال غزل الحرير",
"bannerDemoText": "تم تعديل كلمة المرور على جهاز آخر. يُرجى تسجيل الدخول مرة أخرى.",
"cardsDemoTravelDestinationLocation2": "سيفاغنغا، تاميل نادو",
"cardsDemoTravelDestinationTitle3": "معبد بريهاديسفارا",
"cardsDemoTravelDestinationDescription3": "المعابد",
"demoBannerTitle": "البانر",
"demoBannerSubtitle": "عرض بانر داخل قائمة",
"demoBannerDescription": "يعرض البانر رسالة مهمة ومختصرة، كما يقدّم إجراءات يمكن للمستخدمين اتخاذها (أو تجاهل البانر). يجب أن يتخذ المستخدم إجراء ليتم تجاهل البانر.",
"demoCardTitle": "البطاقات",
"demoCardSubtitle": "بطاقات المراجع ذات الحواف الدائرية",
"demoCardDescription": "البطاقة هي ورقة مواد تُستخدَم لتمثيل بعض المعلومات ذات الصلة، مثلاً ألبوم أو موقع جغرافي أو وجبة أو تفاصيل جهة اتصال أو ما إلى ذلك.",
"demoDataTableTitle": "جداول البيانات",
"demoDataTableSubtitle": "صفوف وأعمدة من المعلومات",
"dataTableColumnCarbs": "الكربوهيدرات (بالغرام)",
"placeTanjore": "تانجور",
"demoGridListsTitle": "قوائم الشبكات",
"placeFlowerMarket": "سوق الزهور",
"placeBronzeWorks": "الأعمال البرونزية",
"placeMarket": "السوق",
"placeThanjavurTemple": "معبد ثنجفور",
"placeSaltFarm": "ملّاحة",
"placeScooters": "دراجات سكوتر",
"placeSilkMaker": "صانع الحرير",
"placeLunchPrep": "إعداد الغداء",
"placeBeach": "شاطئ",
"placeFisherman": "صياد سمك",
"demoMenuSelected": "القيمة التي تم اختيارها: {value}",
"demoMenuRemove": "إزالة",
"demoMenuGetLink": "الحصول على الرابط",
"demoMenuShare": "مشاركة",
"demoBottomAppBarSubtitle": "يعرض لائحة التنقل والإجراءات في أسفل التطبيق",
"demoMenuAnItemWithASectionedMenu": "عنصر يفتح قائمة ذات أقسام",
"demoMenuADisabledMenuItem": "عنصر قائمة غير مفعّل",
"demoLinearProgressIndicatorTitle": "مؤشر تقدم خطي",
"demoMenuContextMenuItemOne": "أول عنصر في قائمة السياقات",
"demoMenuAnItemWithASimpleMenu": "عنصر يفتح قائمة بسيطة",
"demoCustomSlidersTitle": "شرائط التمرير المخصَّصة",
"demoMenuAnItemWithAChecklistMenu": "عنصر يفتح قائمة تحقّق",
"demoCupertinoActivityIndicatorTitle": "مؤشر النشاط",
"demoCupertinoActivityIndicatorSubtitle": "مؤشرات نشاط بنمط iOS",
"demoCupertinoActivityIndicatorDescription": "مؤشر نشاط بنمط iOS ويدور في اتجاه عقارب الساعة",
"demoCupertinoNavigationBarTitle": "شريط التنقل",
"demoCupertinoNavigationBarSubtitle": "شريط تنقل بنمط iOS",
"demoCupertinoNavigationBarDescription": "شريط تنقل بنمط iOS شريط التنقل هو شريط أدوات يتكون على الأقل من عنوان صفحة في وسط شريط الأدوات.",
"demoCupertinoPullToRefreshTitle": "سحب لإعادة التحميل",
"demoCupertinoPullToRefreshSubtitle": "عنصر تحكم السحب لإعادة التحميل بنمط iOS",
"demoCupertinoPullToRefreshDescription": "أداة تنفّذ إعدادات التحكم في المحتوى للسحب لأعادة التحميل بنمط iOS",
"demoProgressIndicatorTitle": "مؤشرات التقدم",
"demoProgressIndicatorSubtitle": "خطي، دائري، غير نهائي",
"demoCircularProgressIndicatorTitle": "مؤشر تقدم دائري",
"demoCircularProgressIndicatorDescription": "مؤشر تقدم دائري بتصميم متعدد الأبعاد (Material Design) ويدور ليدل على أن التطبيق مشغول",
"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{سلة التسوق، عنصر واحد}two{سلة التسوق، عنصران ({quantity})}few{سلة التسوق، {quantity} عناصر}many{سلة التسوق، {quantity} عنصرًا}other{سلة التسوق، {quantity} عنصر}}",
"demoCodeViewerFailedToCopyToClipboardMessage": "تعذّر نسخ النص إلى الحافظة: {error}",
"demoCodeViewerCopiedToClipboardMessage": "تم نسخ النص إلى الحافظة.",
"craneSleep8SemanticLabel": "أطلال \"المايا\" على جُرْف يطِلّ على الشاطئ",
"craneSleep4SemanticLabel": "فندق يطِلّ على بحيرة قُبالة سلسلة من الجبال",
"craneSleep2SemanticLabel": "قلعة ماتشو بيتشو",
"craneSleep1SemanticLabel": "شاليه في مساحة طبيعية من الثلوج وبها أشجار دائمة الخضرة",
"craneSleep0SemanticLabel": "أكواخ فوق الماء",
"craneFly13SemanticLabel": "بركة بجانب البحر حولها نخيل",
"craneFly12SemanticLabel": "بركة ونخيل",
"craneFly11SemanticLabel": "منارة من الطوب على شاطئ البحر",
"craneFly10SemanticLabel": "مآذن الجامع الأزهر أثناء الغروب",
"craneFly9SemanticLabel": "رجل متّكِئ على سيارة زرقاء عتيقة",
"craneFly8SemanticLabel": "سوبر تري غروف",
"craneEat9SemanticLabel": "طاولة مقهى لتقديم المعجنات",
"craneEat2SemanticLabel": "برغر",
"craneFly5SemanticLabel": "فندق يطِلّ على بحيرة قُبالة سلسلة من الجبال",
"demoSelectionControlsSubtitle": "مربّعات الاختيار وأزرار الاختيار ومفاتيح التبديل",
"craneEat10SemanticLabel": "امرأة تمسك بشطيرة بسطرمة كبيرة",
"craneFly4SemanticLabel": "أكواخ فوق الماء",
"craneEat7SemanticLabel": "مَدخل مخبز",
"craneEat6SemanticLabel": "طبق روبيان",
"craneEat5SemanticLabel": "منطقة الجلوس في مطعم ذي ذوق فني",
"craneEat4SemanticLabel": "حلوى الشوكولاته",
"craneEat3SemanticLabel": "وجبة التاكو الكورية",
"craneFly3SemanticLabel": "قلعة ماتشو بيتشو",
"craneEat1SemanticLabel": "بار فارغ وكراسي مرتفعة للزبائن",
"craneEat0SemanticLabel": "بيتزا في فرن يُشعَل بالأخشاب",
"craneSleep11SemanticLabel": "مركز تايبيه المالي 101",
"craneSleep10SemanticLabel": "مآذن الجامع الأزهر أثناء الغروب",
"craneSleep9SemanticLabel": "منارة من الطوب على شاطئ البحر",
"craneEat8SemanticLabel": "طبق جراد البحر",
"craneSleep7SemanticLabel": "شُقق ملونة في ميدان ريبيارا",
"craneSleep6SemanticLabel": "بركة ونخيل",
"craneSleep5SemanticLabel": "خيمة في حقل",
"settingsButtonCloseLabel": "إغلاق الإعدادات",
"demoSelectionControlsCheckboxDescription": "تسمح مربّعات الاختيار للمستخدمين باختيار عدة خيارات من مجموعة من الخيارات. القيمة المعتادة لمربّع الاختيار هي \"صحيح\" أو \"غير صحيح\" ويمكن أيضًا إضافة حالة ثالثة وهي \"خالية\".",
"settingsButtonLabel": "الإعدادات",
"demoListsTitle": "القوائم",
"demoListsSubtitle": "التمرير خلال تنسيقات القوائم",
"demoListsDescription": "صف بارتفاع واحد ثابت يحتوي عادةً على نص ورمز سابق أو لاحق.",
"demoOneLineListsTitle": "سطر واحد",
"demoTwoLineListsTitle": "سطران",
"demoListsSecondary": "نص ثانوي",
"demoSelectionControlsTitle": "عناصر التحكّم في الاختيار",
"craneFly7SemanticLabel": "جبل راشمور",
"demoSelectionControlsCheckboxTitle": "مربع اختيار",
"craneSleep3SemanticLabel": "رجل متّكِئ على سيارة زرقاء عتيقة",
"demoSelectionControlsRadioTitle": "زر اختيار",
"demoSelectionControlsRadioDescription": "تسمح أزرار الاختيار للقارئ بتحديد خيار واحد من مجموعة من الخيارات. يمكنك استخدام أزرار الاختيار لتحديد اختيارات حصرية إذا كنت تعتقد أنه يجب أن تظهر للمستخدم كل الخيارات المتاحة جنبًا إلى جنب.",
"demoSelectionControlsSwitchTitle": "مفاتيح التبديل",
"demoSelectionControlsSwitchDescription": "تؤدي مفاتيح التشغيل/الإيقاف إلى تبديل حالة خيار واحد في الإعدادات. ويجب توضيح الخيار الذي يتحكّم فيه المفتاح وكذلك حالته، وذلك من خلال التسمية المضمَّنة المتاحة.",
"craneFly0SemanticLabel": "شاليه في مساحة طبيعية من الثلوج وبها أشجار دائمة الخضرة",
"craneFly1SemanticLabel": "خيمة في حقل",
"craneFly2SemanticLabel": "رايات صلاة أمام جبل ثلجي",
"craneFly6SemanticLabel": "عرض \"قصر الفنون الجميلة\" من الجوّ",
"rallySeeAllAccounts": "عرض جميع الحسابات",
"rallyBillAmount": "تاريخ استحقاق الفاتورة {billName} التي تبلغ {amount} هو {date}.",
"shrineTooltipCloseCart": "إغلاق سلة التسوق",
"shrineTooltipCloseMenu": "إغلاق القائمة",
"shrineTooltipOpenMenu": "فتح القائمة",
"shrineTooltipSettings": "الإعدادات",
"shrineTooltipSearch": "بحث",
"demoTabsDescription": "تساعد علامات التبويب على تنظيم المحتوى في الشاشات المختلفة ومجموعات البيانات والتفاعلات الأخرى.",
"demoTabsSubtitle": "علامات تبويب تحتوي على عروض يمكن التنقّل خلالها بشكل مستقل",
"demoTabsTitle": "علامات التبويب",
"rallyBudgetAmount": "ميزانية {budgetName} مع استخدام {amountUsed} من إجمالي {amountTotal}، المبلغ المتبقي {amountLeft}",
"shrineTooltipRemoveItem": "إزالة العنصر",
"rallyAccountAmount": "الحساب {accountName} رقم {accountNumber} بمبلغ {amount}.",
"rallySeeAllBudgets": "عرض جميع الميزانيات",
"rallySeeAllBills": "عرض كل الفواتير",
"craneFormDate": "اختيار التاريخ",
"craneFormOrigin": "اختيار نقطة انطلاق الرحلة",
"craneFly2": "وادي خومبو، نيبال",
"craneFly3": "ماتشو بيتشو، بيرو",
"craneFly4": "ماليه، جزر المالديف",
"craneFly5": "فيتزناو، سويسرا",
"craneFly6": "مكسيكو سيتي، المكسيك",
"craneFly7": "جبل راشمور، الولايات المتحدة",
"settingsTextDirectionLocaleBased": "بناءً على اللغة",
"craneFly9": "هافانا، كوبا",
"craneFly10": "القاهرة، مصر",
"craneFly11": "لشبونة، البرتغال",
"craneFly12": "نابا، الولايات المتحدة",
"craneFly13": "بالي، إندونيسيا",
"craneSleep0": "ماليه، جزر المالديف",
"craneSleep1": "أسبن، الولايات المتحدة",
"craneSleep2": "ماتشو بيتشو، بيرو",
"demoCupertinoSegmentedControlTitle": "عنصر تحكّم شريحة",
"craneSleep4": "فيتزناو، سويسرا",
"craneSleep5": "بيغ سور، الولايات المتحدة",
"craneSleep6": "نابا، الولايات المتحدة",
"craneSleep7": "بورتو، البرتغال",
"craneSleep8": "تولوم، المكسيك",
"craneEat5": "سول، كوريا الجنوبية",
"demoChipTitle": "الشرائح",
"demoChipSubtitle": "العناصر المضغوطة التي تمثل إدخال أو سمة أو إجراء",
"demoActionChipTitle": "شريحة الإجراءات",
"demoActionChipDescription": "شرائح الإجراءات هي مجموعة من الخيارات التي تشغّل إجراءً ذا صلة بالمحتوى الأساسي. ينبغي أن يكون ظهور شرائح الإجراءات في واجهة المستخدم ديناميكيًا ومناسبًا للسياق.",
"demoChoiceChipTitle": "شريحة الخيارات",
"demoChoiceChipDescription": "تمثل شرائح الخيارات خيارًا واحدًا من بين مجموعة. تتضمن شرائح الخيارات النصوص الوصفية ذات الصلة أو الفئات.",
"demoFilterChipTitle": "شريحة الفلتر",
"demoFilterChipDescription": "تستخدم شرائح الفلتر العلامات أو الكلمات الوصفية باعتبارها طريقة لفلترة المحتوى.",
"demoInputChipTitle": "شريحة الإدخال",
"demoInputChipDescription": "تمثل شرائح الإدخالات معلومة معقدة، مثل كيان (شخص، مكان، أو شئ) أو نص محادثة، في نمط مضغوط.",
"craneSleep9": "لشبونة، البرتغال",
"craneEat10": "لشبونة، البرتغال",
"demoCupertinoSegmentedControlDescription": "يُستخدَم للاختيار بين عدد من الخيارات يستبعد أحدها الآخر. عند تحديد خيار في عنصر تحكّم الشريحة، يتم إلغاء اختيار العنصر الآخر في عنصر تحكّم الشريحة.",
"chipTurnOnLights": "تشغيل الأضواء",
"chipSmall": "صغير",
"chipMedium": "متوسط",
"chipLarge": "كبير",
"chipElevator": "مصعَد",
"chipWasher": "غسّالة",
"chipFireplace": "موقد",
"chipBiking": "ركوب الدراجة",
"craneFormDiners": "مطاعم صغيرة",
"rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{يمكنك زيادة خصم الضرائب المحتملة. ضبط الفئات على معاملة واحدة لم يتم ضبطها.}zero{يمكنك زيادة خصم الضرائب المحتملة. ضبط الفئات على {count} معاملة لم يتم ضبطها.}two{يمكنك زيادة خصم الضرائب المحتملة. ضبط الفئات على معاملتين ({count}) لم يتم ضبطهما.}few{يمكنك زيادة خصم الضرائب المحتملة. ضبط الفئات على {count} معاملات لم يتم ضبطها.}many{يمكنك زيادة خصم الضرائب المحتملة. ضبط الفئات على {count} معاملة لم يتم ضبطها.}other{يمكنك زيادة خصم الضرائب المحتملة. ضبط الفئات على {count} معاملة لم يتم ضبطها.}}",
"craneFormTime": "اختيار الوقت",
"craneFormLocation": "اختيار الموقع جغرافي",
"craneFormTravelers": "المسافرون",
"craneEat8": "أتلانتا، الولايات المتحدة",
"craneFormDestination": "اختيار الوجهة",
"craneFormDates": "اختيار تواريخ",
"craneFly": "الطيران",
"craneSleep": "السكون",
"craneEat": "المأكولات",
"craneFlySubhead": "استكشاف الرحلات حسب الوجهة",
"craneSleepSubhead": "استكشاف العقارات حسب الوجهة",
"craneEatSubhead": "استكشاف المطاعم حسب الوجهة",
"craneFlyStops": "{numberOfStops,plural,=0{بدون توقف}=1{محطة واحدة}two{محطتان ({numberOfStops})}few{{numberOfStops} محطات}many{{numberOfStops} محطة}other{{numberOfStops} محطة}}",
"craneSleepProperties": "{totalProperties,plural,=0{ليس هناك مواقع متاحة.}=1{هناك موقع واحد متاح.}two{هناك موقعان ({totalProperties}) متاحان.}few{هناك {totalProperties} مواقع متاحة.}many{هناك {totalProperties} موقعًا متاحًا.}other{هناك {totalProperties} موقع متاح.}}",
"craneEatRestaurants": "{totalRestaurants,plural,=0{ما مِن مطاعم.}=1{مطعم واحد}two{مطعمان ({totalRestaurants})}few{{totalRestaurants} مطاعم}many{{totalRestaurants} مطعمًا}other{{totalRestaurants} مطعم}}",
"craneFly0": "أسبن، الولايات المتحدة",
"demoCupertinoSegmentedControlSubtitle": "عنصر تحكّم شريحة بنمط iOS",
"craneSleep10": "القاهرة، مصر",
"craneEat9": "مدريد، إسبانيا",
"craneFly1": "بيغ سور، الولايات المتحدة",
"craneEat7": "ناشفيل، الولايات المتحدة",
"craneEat6": "سياتل، الولايات المتحدة",
"craneFly8": "سنغافورة",
"craneEat4": "باريس، فرنسا",
"craneEat3": "بورتلاند، الولايات المتحدة",
"craneEat2": "قرطبة، الأرجنتين",
"craneEat1": "دالاس، الولايات المتحدة",
"craneEat0": "نابولي، إيطاليا",
"craneSleep11": "تايبيه، تايوان",
"craneSleep3": "هافانا، كوبا",
"shrineLogoutButtonCaption": "تسجيل الخروج",
"rallyTitleBills": "الفواتير",
"rallyTitleAccounts": "الحسابات",
"shrineProductVagabondSack": "حقيبة من ماركة Vagabond",
"rallyAccountDetailDataInterestYtd": "الفائدة منذ بداية العام حتى اليوم",
"shrineProductWhitneyBelt": "حزام \"ويتني\"",
"shrineProductGardenStrand": "خيوط زينة للحدائق",
"shrineProductStrutEarrings": "أقراط فاخرة",
"shrineProductVarsitySocks": "جوارب من نوع \"فارسيتي\"",
"shrineProductWeaveKeyring": "سلسلة مفاتيح Weave",
"shrineProductGatsbyHat": "قبعة \"غاتسبي\"",
"shrineProductShrugBag": "حقيبة كتف",
"shrineProductGiltDeskTrio": "طقم أدوات مكتبية ذهبية اللون من 3 قطع",
"shrineProductCopperWireRack": "رف سلكي نحاسي",
"shrineProductSootheCeramicSet": "طقم سيراميك باللون الأبيض الراقي",
"shrineProductHurrahsTeaSet": "طقم شاي مميّز",
"shrineProductBlueStoneMug": "قدح حجري أزرق",
"shrineProductRainwaterTray": "صينية عميقة",
"shrineProductChambrayNapkins": "مناديل \"شامبراي\"",
"shrineProductSucculentPlanters": "أحواض عصرية للنباتات",
"shrineProductQuartetTable": "طاولة رباعية الأرجل",
"shrineProductKitchenQuattro": "طقم أدوات للمطبخ من أربع قطع",
"shrineProductClaySweater": "بلوزة بلون الطين",
"shrineProductSeaTunic": "بلوزة بلون أزرق فاتح",
"shrineProductPlasterTunic": "بلوزة من نوع \"بلاستر\"",
"rallyBudgetCategoryRestaurants": "المطاعم",
"shrineProductChambrayShirt": "قميص من نوع \"شامبراي\"",
"shrineProductSeabreezeSweater": "سترة بلون أزرق بحري",
"shrineProductGentryJacket": "سترة رجالية باللون الأخضر الداكن",
"shrineProductNavyTrousers": "سروال بلون أزرق داكن",
"shrineProductWalterHenleyWhite": "والتر هينلي (أبيض)",
"shrineProductSurfAndPerfShirt": "قميص سيرف آند بيرف",
"shrineProductGingerScarf": "وشاح بألوان الزنجبيل",
"shrineProductRamonaCrossover": "قميص \"رامونا\" على شكل الحرف X",
"shrineProductClassicWhiteCollar": "ياقة بيضاء كلاسيكية",
"shrineProductSunshirtDress": "فستان يعكس أشعة الشمس",
"rallyAccountDetailDataInterestRate": "سعر الفائدة",
"rallyAccountDetailDataAnnualPercentageYield": "النسبة المئوية للعائد السنوي",
"rallyAccountDataVacation": "عطلة",
"shrineProductFineLinesTee": "قميص بخطوط رفيعة",
"rallyAccountDataHomeSavings": "المدخرات المنزلية",
"rallyAccountDataChecking": "الحساب الجاري",
"rallyAccountDetailDataInterestPaidLastYear": "الفائدة المدفوعة في العام الماضي",
"rallyAccountDetailDataNextStatement": "كشف الحساب التالي",
"rallyAccountDetailDataAccountOwner": "صاحب الحساب",
"rallyBudgetCategoryCoffeeShops": "المقاهي",
"rallyBudgetCategoryGroceries": "متاجر البقالة",
"shrineProductCeriseScallopTee": "قميص قصير الأكمام باللون الكرزي الفاتح",
"rallyBudgetCategoryClothing": "الملابس",
"rallySettingsManageAccounts": "إدارة الحسابات",
"rallyAccountDataCarSavings": "المدّخرات المخصّصة للسيارة",
"rallySettingsTaxDocuments": "المستندات الضريبية",
"rallySettingsPasscodeAndTouchId": "رمز المرور وTouch ID",
"rallySettingsNotifications": "إشعارات",
"rallySettingsPersonalInformation": "المعلومات الشخصية",
"rallySettingsPaperlessSettings": "إعدادات إنجاز الأعمال بدون ورق",
"rallySettingsFindAtms": "العثور على مواقع أجهزة الصراف الآلي",
"rallySettingsHelp": "المساعدة",
"rallySettingsSignOut": "تسجيل الخروج",
"rallyAccountTotal": "الإجمالي",
"rallyBillsDue": "الفواتير المستحقة",
"rallyBudgetLeft": "الميزانية المتبقية",
"rallyAccounts": "الحسابات",
"rallyBills": "الفواتير",
"rallyBudgets": "الميزانيات",
"rallyAlerts": "التنبيهات",
"rallySeeAll": "عرض الكل",
"rallyFinanceLeft": "المتبقي",
"rallyTitleOverview": "نظرة عامة",
"shrineProductShoulderRollsTee": "قميص واسعة بأكمام قصيرة",
"shrineNextButtonCaption": "التالي",
"rallyTitleBudgets": "الميزانيات",
"rallyTitleSettings": "الإعدادات",
"rallyLoginLoginToRally": "تسجيل الدخول إلى Rally",
"rallyLoginNoAccount": "أليس لديك حساب؟",
"rallyLoginSignUp": "الاشتراك",
"rallyLoginUsername": "اسم المستخدم",
"rallyLoginPassword": "كلمة المرور",
"rallyLoginLabelLogin": "تسجيل الدخول",
"rallyLoginRememberMe": "تذكُّر بيانات تسجيل الدخول إلى حسابي",
"rallyLoginButtonLogin": "تسجيل الدخول",
"rallyAlertsMessageHeadsUpShopping": "تنبيه: لقد استهلكت {percent} من ميزانية التسوّق لهذا الشهر.",
"rallyAlertsMessageSpentOnRestaurants": "لقد أنفقْت هذا الشهر مبلغ {amount} على تناول الطعام في المطاعم.",
"rallyAlertsMessageATMFees": "لقد أنفقْت هذا الشهر مبلغ {amount} كرسوم لأجهزة الصراف الآلي.",
"rallyAlertsMessageCheckingAccount": "عمل رائع! الرصيد الحالي في حسابك الجاري أعلى بنسبة {percent} من الشهر الماضي.",
"shrineMenuCaption": "القائمة",
"shrineCategoryNameAll": "الكل",
"shrineCategoryNameAccessories": "الإكسسوارات",
"shrineCategoryNameClothing": "الملابس",
"shrineCategoryNameHome": "المنزل",
"shrineLoginUsernameLabel": "اسم المستخدم",
"shrineLoginPasswordLabel": "كلمة المرور",
"shrineCancelButtonCaption": "إلغاء",
"shrineCartTaxCaption": "الضريبة:",
"shrineCartPageCaption": "سلة التسوّق",
"shrineProductQuantity": "الكمية: {quantity}",
"shrineProductPrice": "x {price}",
"shrineCartItemCount": "{quantity,plural,=0{ما مِن عناصر.}=1{عنصر واحد}two{عنصران ({quantity})}few{{quantity} عناصر}many{{quantity} عنصرًا}other{{quantity} عنصر}}",
"shrineCartClearButtonCaption": "محو سلة التسوق",
"shrineCartTotalCaption": "الإجمالي",
"shrineCartSubtotalCaption": "الإجمالي الفرعي:",
"shrineCartShippingCaption": "الشحن:",
"shrineProductGreySlouchTank": "قميص رمادي اللون",
"shrineProductStellaSunglasses": "نظارات شمس من نوع \"ستيلا\"",
"shrineProductWhitePinstripeShirt": "قميص ذو خطوط بيضاء",
"demoTextFieldWhereCanWeReachYou": "على أي رقم يمكننا التواصل معك؟",
"settingsTextDirectionLTR": "من اليسار إلى اليمين",
"settingsTextScalingLarge": "كبير",
"demoBottomSheetHeader": "العنوان",
"demoBottomSheetItem": "السلعة {value}",
"demoBottomTextFieldsTitle": "حقول النص",
"demoTextFieldTitle": "حقول النص",
"demoTextFieldSubtitle": "سطر واحد من النص والأرقام القابلة للتعديل",
"demoTextFieldDescription": "تسمح حقول النص للمستخدمين بإدخال نص في واجهة مستخدم. وتظهر عادةً في النماذج ومربّعات الحوار.",
"demoTextFieldShowPasswordLabel": "عرض كلمة المرور",
"demoTextFieldHidePasswordLabel": "إخفاء كلمة المرور",
"demoTextFieldFormErrors": "يُرجى تصحيح الأخطاء باللون الأحمر قبل الإرسال.",
"demoTextFieldNameRequired": "الاسم مطلوب.",
"demoTextFieldOnlyAlphabeticalChars": "يُرجى إدخال حروف أبجدية فقط.",
"demoTextFieldEnterUSPhoneNumber": "(###) ###-#### - يُرجى إدخال رقم هاتف صالح في الولايات المتحدة.",
"demoTextFieldEnterPassword": "يرجى إدخال كلمة مرور.",
"demoTextFieldPasswordsDoNotMatch": "كلمتا المرور غير متطابقتين.",
"demoTextFieldWhatDoPeopleCallYou": "بأي اسم يناديك الآخرون؟",
"demoTextFieldNameField": "الاسم*",
"demoBottomSheetButtonText": "عرض البطاقة السفلية",
"demoTextFieldPhoneNumber": "رقم الهاتف*",
"demoBottomSheetTitle": "البطاقة السفلية",
"demoTextFieldEmail": "رسالة إلكترونية",
"demoTextFieldTellUsAboutYourself": "أخبِرنا عن نفسك (مثلاً ما هي هواياتك المفضّلة أو ما هو مجال عملك؟)",
"demoTextFieldKeepItShort": "يُرجى الاختصار، هذا مجرد عرض توضيحي.",
"starterAppGenericButton": "زر",
"demoTextFieldLifeStory": "قصة حياة",
"demoTextFieldSalary": "الراتب",
"demoTextFieldUSD": "دولار أمريكي",
"demoTextFieldNoMoreThan": "يجب ألا تزيد عن 8 أحرف.",
"demoTextFieldPassword": "كلمة المرور*",
"demoTextFieldRetypePassword": "أعِد كتابة كلمة المرور*",
"demoTextFieldSubmit": "إرسال",
"demoBottomNavigationSubtitle": "شريط تنقّل سفلي شبه مرئي",
"demoBottomSheetAddLabel": "إضافة",
"demoBottomSheetModalDescription": "تعتبر البطاقة السفلية المقيِّدة بديلاً لقائمة أو مربّع حوار ولا تسمح للمستخدم بالتفاعل مع المحتوى الآخر على الشاشة.",
"demoBottomSheetModalTitle": "البطاقة السفلية المقيِّدة",
"demoBottomSheetPersistentDescription": "تعرض البطاقة السفلية العادية معلومات تكميلية للمحتوى الأساسي للتطبيق. ولا تختفي هذه البطاقة عندما يتفاعل المستخدم مع المحتوى الآخر على الشاشة.",
"demoBottomSheetPersistentTitle": "البطاقة السفلية العادية",
"demoBottomSheetSubtitle": "البطاقات السفلية المقيِّدة والعادية",
"demoTextFieldNameHasPhoneNumber": "رقم هاتف {name} هو {phoneNumber}.",
"buttonText": "زر",
"demoTypographyDescription": "تعريف أساليب الخط المختلفة في التصميم المتعدد الأبعاد",
"demoTypographySubtitle": "جميع أنماط النص المحدّدة مسبقًا",
"demoTypographyTitle": "أسلوب الخط",
"demoFullscreenDialogDescription": "تحدِّد خاصية fullscreenDialog ما إذا كانت الصفحة الواردة هي مربع حوار نمطي بملء الشاشة.",
"demoFlatButtonDescription": "يتلوّن الزر المنبسط عند الضغط عليه ولكن لا يرتفع. ينصح باستخدام الأزرار المنبسطة على أشرطة الأدوات وفي مربعات الحوار وداخل المساحة المتروكة",
"demoBottomNavigationDescription": "تعرض أشرطة التنقل السفلية بين ثلاث وخمس وجهات في الجزء السفلي من الشاشة. ويتم تمثيل كل وجهة برمز ووسم نصي اختياري. عند النقر على رمز التنقل السفلي، يتم نقل المستخدم إلى وجهة التنقل ذات المستوى الأعلى المرتبطة بذلك الرمز.",
"demoBottomNavigationSelectedLabel": "الملصق المُختار",
"demoBottomNavigationPersistentLabels": "التصنيفات المستمرة",
"starterAppDrawerItem": "السلعة {value}",
"demoTextFieldRequiredField": "تشير علامة * إلى حقل مطلوب.",
"demoBottomNavigationTitle": "شريط التنقل السفلي",
"settingsLightTheme": "فاتح",
"settingsTheme": "التصميم",
"settingsPlatformIOS": "iOS",
"settingsPlatformAndroid": "Android",
"settingsTextDirectionRTL": "من اليمين إلى اليسار",
"settingsTextScalingHuge": "ضخم",
"cupertinoButton": "زر",
"settingsTextScalingNormal": "عادي",
"settingsTextScalingSmall": "صغير",
"settingsSystemDefault": "النظام",
"settingsTitle": "الإعدادات",
"rallyDescription": "تطبيق للتمويل الشخصي",
"aboutDialogDescription": "للاطّلاع على رمز المصدر لهذا التطبيق، يُرجى زيارة {repoLink}.",
"bottomNavigationCommentsTab": "التعليقات",
"starterAppGenericBody": "النص",
"starterAppGenericHeadline": "العنوان",
"starterAppGenericSubtitle": "العنوان الفرعي",
"starterAppGenericTitle": "العنوان",
"starterAppTooltipSearch": "البحث",
"starterAppTooltipShare": "مشاركة",
"starterAppTooltipFavorite": "الإضافة إلى السلع المفضّلة",
"starterAppTooltipAdd": "إضافة",
"bottomNavigationCalendarTab": "التقويم",
"starterAppDescription": "تطبيق نموذجي يتضمّن تنسيقًا تفاعليًا",
"starterAppTitle": "تطبيق نموذجي",
"aboutFlutterSamplesRepo": "عينات Flutter في مستودع GitHub",
"bottomNavigationContentPlaceholder": "عنصر نائب لعلامة تبويب {title}",
"bottomNavigationCameraTab": "الكاميرا",
"bottomNavigationAlarmTab": "المنبّه",
"bottomNavigationAccountTab": "الحساب",
"demoTextFieldYourEmailAddress": "عنوان بريدك الإلكتروني",
"demoToggleButtonDescription": "يمكن استخدام أزرار التبديل لتجميع الخيارات المرتبطة. لتأكيد مجموعات أزرار التبديل المرتبطة، يجب أن تشترك إحدى المجموعات في حاوية مشتركة.",
"colorsGrey": "رمادي",
"colorsBrown": "بني",
"colorsDeepOrange": "برتقالي داكن",
"colorsOrange": "برتقالي",
"colorsAmber": "كهرماني",
"colorsYellow": "أصفر",
"colorsLime": "ليموني",
"colorsLightGreen": "أخضر فاتح",
"colorsGreen": "أخضر",
"homeHeaderGallery": "معرض الصور",
"homeHeaderCategories": "الفئات",
"shrineDescription": "تطبيق عصري للبيع بالتجزئة",
"craneDescription": "تطبيق سفر مُخصَّص",
"homeCategoryReference": "الأنماط وغيرها من العروض التوضيحية",
"demoInvalidURL": "تعذّر عرض عنوان URL:",
"demoOptionsTooltip": "الخيارات",
"demoInfoTooltip": "معلومات",
"demoCodeTooltip": "رمز تجريبي",
"demoDocumentationTooltip": "وثائق واجهة برمجة التطبيقات",
"demoFullscreenTooltip": "ملء الشاشة",
"settingsTextScaling": "تغيير حجم النص",
"settingsTextDirection": "اتجاه النص",
"settingsLocale": "اللغة",
"settingsPlatformMechanics": "آليات الأنظمة الأساسية",
"settingsDarkTheme": "داكن",
"settingsSlowMotion": "التصوير البطيء",
"settingsAbout": "لمحة عن معرض Flutter",
"settingsFeedback": "إرسال التعليقات",
"settingsAttribution": "من تصميم TOASTER في لندن",
"demoButtonTitle": "الأزرار",
"demoButtonSubtitle": "أزرار نصية أو بارزة أو محدَّدة الجوانب، والمزيد",
"demoFlatButtonTitle": "الزر المنبسط",
"demoRaisedButtonDescription": "تضيف الأزرار البارزة بُعدًا إلى التخطيطات المنبسطة عادةً. وتبرِز الوظائف المتوفرة في المساحات العريضة أو المكدَّسة.",
"demoRaisedButtonTitle": "الزر البارز",
"demoOutlineButtonTitle": "Outline Button",
"demoOutlineButtonDescription": "تصبح الأزرار المخطَّطة غير شفافة وترتفع عند الضغط عليها. وغالبًا ما يتم إقرانها مع الأزرار البارزة للإشارة إلى إجراء ثانوي بديل.",
"demoToggleButtonTitle": "أزرار التبديل",
"colorsTeal": "أزرق مخضرّ",
"demoFloatingButtonTitle": "زر الإجراء العائم",
"demoFloatingButtonDescription": "زر الإجراء العائم هو زر على شكل رمز دائري يتم تمريره فوق المحتوى للترويج لاتخاذ إجراء أساسي في التطبيق.",
"demoDialogTitle": "مربعات الحوار",
"demoDialogSubtitle": "مربعات حوار بسيطة ومخصّصة للتنبيهات وبملء الشاشة",
"demoAlertDialogTitle": "التنبيه",
"demoAlertDialogDescription": "يخبر مربع حوار التنبيهات المستخدم بالحالات التي تتطلب تأكيد الاستلام. ويشتمل مربع حوار التنبيهات على عنوان اختياري وقائمة إجراءات اختيارية.",
"demoAlertTitleDialogTitle": "تنبيه مزوّد بعنوان",
"demoSimpleDialogTitle": "بسيط",
"demoSimpleDialogDescription": "يتيح مربع الحوار البسيط للمستخدم إمكانية الاختيار من بين عدة خيارات. ويشتمل مربع الحوار البسيط على عنوان اختياري يتم عرضه أعلى هذه الخيارات.",
"demoFullscreenDialogTitle": "ملء الشاشة",
"demoCupertinoButtonsTitle": "الأزرار",
"demoCupertinoButtonsSubtitle": "أزرار مستوحاة من نظام التشغيل iOS",
"demoCupertinoButtonsDescription": "زر مستوحى من نظام التشغيل iOS. يتم عرض هذا الزر على شكل نص و/أو رمز يتلاشى ويظهر بالتدريج عند اللمس. وقد يكون مزوّدًا بخلفية اختياريًا.",
"demoCupertinoAlertsTitle": "التنبيهات",
"demoCupertinoAlertsSubtitle": "مربعات حوار التنبيهات المستوحاة من نظام التشغيل iOS",
"demoCupertinoAlertTitle": "تنبيه",
"demoCupertinoAlertDescription": "يخبر مربع حوار التنبيهات المستخدم بالحالات التي تتطلب تأكيد الاستلام. ويشتمل مربع حوار التنبيهات على عنوان اختياري ومحتوى اختياري وقائمة إجراءات اختيارية. ويتم عرض العنوان أعلى المحتوى بينما تُعرض الإجراءات أسفل المحتوى.",
"demoCupertinoAlertWithTitleTitle": "تنبيه يتضمّن عنوانًا",
"demoCupertinoAlertButtonsTitle": "تنبيه مزوّد بأزرار",
"demoCupertinoAlertButtonsOnlyTitle": "أزرار التنبيه فقط",
"demoCupertinoActionSheetTitle": "ورقة الإجراءات",
"demoCupertinoActionSheetDescription": "ورقة الإجراءات هي ورقة أنماط معيّنة للتنبيهات تقدّم للمستخدم مجموعة مكوّنة من خيارين أو أكثر مرتبطة بالسياق الحالي. ويمكن أن تتضمّن ورقة الإجراءات عنوانًا ورسالة إضافية وقائمة إجراءات.",
"demoColorsTitle": "الألوان",
"demoColorsSubtitle": "جميع الألوان المحدّدة مسبقًا",
"demoColorsDescription": "ثوابت اللون وعينات الألوان التي تُمثل لوحة ألوان التصميم المتعدد الأبعاد",
"buttonTextEnabled": "ENABLED",
"buttonTextDisabled": "DISABLED",
"buttonTextCreate": "إنشاء",
"dialogSelectedOption": "لقد اخترت القيمة التالية: \"{value}\"",
"dialogDiscardTitle": "هل تريد تجاهل المسودة؟",
"dialogLocationTitle": "هل تريد استخدام خدمة الموقع الجغرافي من Google؟",
"dialogLocationDescription": "يمكنك السماح لشركة Google بمساعدة التطبيقات في تحديد الموقع الجغرافي. ويعني هذا أنه سيتم إرسال بيانات مجهولة المصدر عن الموقع الجغرافي إلى Google، حتى عند عدم تشغيل أي تطبيقات.",
"dialogCancel": "إلغاء",
"dialogDiscard": "تجاهل",
"dialogDisagree": "لا أوافق",
"dialogAgree": "موافق",
"dialogSetBackup": "اختيار الحساب الاحتياطي",
"colorsBlueGrey": "أزرق رمادي",
"dialogShow": "عرض مربع الحوار",
"dialogFullscreenTitle": "مربع حوار بملء الشاشة",
"dialogFullscreenSave": "حفظ",
"dialogFullscreenDescription": "عرض توضيحي لمربع حوار بملء الشاشة",
"cupertinoButtonEnabled": "Enabled",
"cupertinoButtonDisabled": "Disabled",
"cupertinoButtonWithBackground": "زر مزوّد بخلفية",
"cupertinoAlertCancel": "إلغاء",
"cupertinoAlertDiscard": "تجاهل",
"cupertinoAlertLocationTitle": "هل تريد السماح لخدمة \"خرائط Google\" بالدخول إلى موقعك الجغرافي أثناء استخدام التطبيق؟",
"cupertinoAlertLocationDescription": "سيتم عرض الموقع الجغرافي الحالي على الخريطة واستخدامه لتوفير الاتجاهات ونتائج البحث عن الأماكن المجاورة وأوقات التنقّل المقدرة.",
"cupertinoAlertAllow": "السماح",
"cupertinoAlertDontAllow": "عدم السماح",
"cupertinoAlertFavoriteDessert": "Select Favorite Dessert",
"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_ar.arb/0 | {
"file_path": "gallery/lib/l10n/intl_ar.arb",
"repo_id": "gallery",
"token_count": 33197
} | 810 |
{
"loading": "Betöltés…",
"deselect": "Kiválasztás megszüntetése",
"select": "Kiválasztás",
"selectable": "Kiválasztható (hosszú megnyomással)",
"selected": "Kiválasztva",
"demo": "Demó",
"bottomAppBar": "Alsó alkalmazássáv",
"notSelected": "Nincs kiválasztva",
"demoCupertinoSearchTextFieldTitle": "Keresési szövegmező",
"demoCupertinoPicker": "Választó",
"demoCupertinoSearchTextFieldSubtitle": "iOS-stílusú keresési szövegmező",
"demoCupertinoSearchTextFieldDescription": "Keresési szövegmező, amely lehetővé teszi a felhasználók számára a szöveg megadásával történő keresést, valamint javaslatokat ajánlat és szűrhet.",
"demoCupertinoSearchTextFieldPlaceholder": "Írjon be szöveget",
"demoCupertinoScrollbarTitle": "Görgetősáv",
"demoCupertinoScrollbarSubtitle": "iOS-stílusú görgetősáv",
"demoCupertinoScrollbarDescription": "Az adott alárendelt elemet körülvevő görgetősáv",
"demoTwoPaneItem": "{value} elem",
"demoTwoPaneList": "Lista",
"demoTwoPaneFoldableLabel": "Összehajtható",
"demoTwoPaneSmallScreenLabel": "Kis képernyő",
"demoTwoPaneSmallScreenDescription": "Így működik a TwoPane kis képernyős eszközön.",
"demoTwoPaneTabletLabel": "Táblagép / számítógép",
"demoTwoPaneTabletDescription": "Így működik a TwoPane nagy képernyőn (pl. táblagépen vagy számítógépen).",
"demoTwoPaneTitle": "TwoPane",
"demoTwoPaneSubtitle": "Reszponzív elrendezések összehajtható, nagy és kis képernyőn",
"splashSelectDemo": "Bemutató kiválasztása",
"demoTwoPaneFoldableDescription": "Így működik összehajtható eszközön a TwoPane.",
"demoTwoPaneDetails": "Részletek",
"demoTwoPaneSelectItem": "Elem kijelölése",
"demoTwoPaneItemDetails": "{value} elem részletei",
"demoCupertinoContextMenuActionText": "Tartsa lenyomva a Flutter-logót a helyi menü megtekintéséhez.",
"demoCupertinoContextMenuDescription": "iOS-stílusú teljes képernyős helyi menü, amely megjelenik, ha az egyik elemet hosszan megnyomja.",
"demoAppBarTitle": "Alkalmazássáv",
"demoAppBarDescription": "Az alkalmazássáv az aktuális képernyőt érintő információkat és műveleteket biztosít. Márkaépítésre, képernyő-megnevezésre, navigálásra és műveletekre szolgál.",
"demoDividerTitle": "Elválasztó",
"demoDividerSubtitle": "Az elválasztó egy vékony vonal, amely listákba és elrendezésekbe csoportosítja a tartalmakat.",
"demoDividerDescription": "Az elválasztókat tartalom elkülönítésére használhatja listákban, fiókokban és egyéb helyeken.",
"demoVerticalDividerTitle": "Függőleges elválasztó",
"demoCupertinoContextMenuTitle": "Helyi menü",
"demoCupertinoContextMenuSubtitle": "iOS-stílusú helyi menü",
"demoAppBarSubtitle": "Megjeleníti az aktuális képernyőt érintő információkat és műveleteket",
"demoCupertinoContextMenuActionOne": "Első művelet",
"demoCupertinoContextMenuActionTwo": "Második művelet",
"demoDateRangePickerDescription": "Anyagszerű megjelenéssel rendelkező dátumtartomány-választót tartalmazó párbeszédpanelt jelenít meg.",
"demoDateRangePickerTitle": "Dátumtartomány-választó",
"demoNavigationDrawerUserName": "Felhasználói név",
"demoNavigationDrawerUserEmail": "[email protected]",
"demoNavigationDrawerText": "A fiók megjelenítéséhez csúsztasson a szélétől, vagy koppintson a bal felső sarokban található ikonra",
"demoNavigationRailTitle": "Navigációs sáv",
"demoNavigationRailSubtitle": "Navigációs sáv megjelenítése az adott alkalmazáson belül",
"demoNavigationRailDescription": "Anyagi modul, amely az adott alkalmazás bal vagy jobb oldalán jelenik meg, és néhány (jellemzően három és öt) nézet közötti navigálásra szolgál.",
"demoNavigationRailFirst": "Első",
"demoNavigationDrawerTitle": "Navigációs fiók",
"demoNavigationRailThird": "Harmadik",
"replyStarredLabel": "Csillagozva",
"demoTextButtonDescription": "Valamelyik szöveg gomb megnyomásakor tintafolt jelenik meg rajta, de nem emelkedik fel. Szöveg gombokat használhat eszköztárakban, párbeszédpaneleken és kitöltéssel szövegen belül is",
"demoElevatedButtonTitle": "Kiemelkedő gomb",
"demoElevatedButtonDescription": "A kiemelkedő gombok térbeli kiterjedést adnak az általában lapos külsejű gomboknak. Alkalmasak a funkciók kiemelésére zsúfolt vagy nagy területeken.",
"demoOutlinedButtonTitle": "Körülrajzolt gomb",
"demoOutlinedButtonDescription": "A körülrajzolt gombok átlátszatlanok és kiemelkedők lesznek, ha megnyomják őket. Gyakran kapcsolódnak kiemelkedő gombokhoz, hogy alternatív, másodlagos műveletet jelezzenek.",
"demoContainerTransformDemoInstructions": "Kártyák, listák és lebegő műveletgomb",
"demoNavigationDrawerSubtitle": "Fiók megjelenítése az alkalmazássávon belül",
"replyDescription": "Hatékony, célzott e-mail-alkalmazás",
"demoNavigationDrawerDescription": "Material Design panel, amely vízszintesen húzódik befelé a képernyő szélétől, és navigációs linkeket jelenít meg az adott alkalmazásban.",
"replyDraftsLabel": "Piszkozatok",
"demoNavigationDrawerToPageOne": "Első elem",
"replyInboxLabel": "Beérkezett üzenetek",
"demoSharedXAxisDemoInstructions": "Következő és Vissza gomb",
"replySpamLabel": "Spam",
"replyTrashLabel": "Kuka",
"replySentLabel": "Elküldve",
"demoNavigationRailSecond": "Második",
"demoNavigationDrawerToPageTwo": "Második elem",
"demoFadeScaleDemoInstructions": "Modális ablak és lebegő műveletgomb",
"demoFadeThroughDemoInstructions": "Alsó navigáció",
"demoSharedZAxisDemoInstructions": "Beállítások ikon gombja",
"demoSharedYAxisDemoInstructions": "Rendezés a „Nemrég lejátszott” lehetőség szerint",
"demoTextButtonTitle": "Szöveg gomb",
"demoSharedZAxisBeefSandwichRecipeTitle": "Marhahúsos szendvics",
"demoSharedZAxisDessertRecipeDescription": "Desszertrecept",
"demoSharedYAxisAlbumTileSubtitle": "Előadó",
"demoSharedYAxisAlbumTileTitle": "Album",
"demoSharedYAxisRecentSortTitle": "Nemrég lejátszott",
"demoSharedYAxisAlphabeticalSortTitle": "A–Z",
"demoSharedYAxisAlbumCount": "268 album",
"demoSharedYAxisTitle": "Megosztott y tengely",
"demoSharedXAxisCreateAccountButtonText": "FIÓK LÉTREHOZÁSA",
"demoFadeScaleAlertDialogDiscardButton": "ELVETÉS",
"demoSharedXAxisSignInTextFieldLabel": "E-mail-cím vagy telefonszám",
"demoSharedXAxisSignInSubtitleText": "Jelentkezzen be fiókjával",
"demoSharedXAxisSignInWelcomeText": "Üdv, David Park!",
"demoSharedXAxisIndividualCourseSubtitle": "Egyénileg megjelenítve",
"demoSharedXAxisBundledCourseSubtitle": "Kategorizált",
"demoFadeThroughAlbumsDestination": "Albumok",
"demoSharedXAxisDesignCourseTitle": "Dizájn",
"demoSharedXAxisIllustrationCourseTitle": "Illusztráció",
"demoSharedXAxisBusinessCourseTitle": "Üzlet",
"demoSharedXAxisArtsAndCraftsCourseTitle": "Kézművesség",
"demoMotionPlaceholderSubtitle": "Másodlagos szöveg",
"demoFadeScaleAlertDialogCancelButton": "MÉGSE",
"demoFadeScaleAlertDialogHeader": "Értesítés párbeszédpanele",
"demoFadeScaleHideFabButton": "LEBEGŐ MŰVELETGOMB ELREJTÉSE",
"demoFadeScaleShowFabButton": "LEBEGŐ MŰVELETGOMB MEGJELENÍTÉSE",
"demoFadeScaleShowAlertDialogButton": "MODÁLIS ABLAK MEGJELENÍTÉSE",
"demoFadeScaleDescription": "A halványítás mintát olyan UI-elemek esetén használja a rendszer, amelyek a képernyő határain belül lépnek be vagy ki (például a képernyő közepén elhalványuló párbeszédablak esetén).",
"demoFadeScaleTitle": "Halványítás",
"demoFadeThroughTextPlaceholder": "123 fotó",
"demoFadeThroughSearchDestination": "Keresés",
"demoFadeThroughPhotosDestination": "Fotók",
"demoSharedXAxisCoursePageSubtitle": "A csomagolt kategóriák csoportokként jelennek meg a hírcsatornában. Ezt később bármikor megváltoztathatja.",
"demoFadeThroughDescription": "Az áttűnés mintát olyan UI-elemek közötti átmenetekhez használja a rendszer, amelyek között nincs szoros kapcsolat.",
"demoFadeThroughTitle": "Áttűnés",
"demoSharedZAxisHelpSettingLabel": "Súgó",
"demoMotionSubtitle": "Az előre meghatározott áttűnési minták mindegyike",
"demoSharedZAxisNotificationSettingLabel": "Értesítések",
"demoSharedZAxisProfileSettingLabel": "Profil",
"demoSharedZAxisSavedRecipesListTitle": "Mentett receptek",
"demoSharedZAxisBeefSandwichRecipeDescription": "Marhahúsos szendvics receptje",
"demoSharedZAxisCrabPlateRecipeDescription": "Ráktál receptje",
"demoSharedXAxisCoursePageTitle": "A kurzusok észszerűsítése",
"demoSharedZAxisCrabPlateRecipeTitle": "Rák",
"demoSharedZAxisShrimpPlateRecipeDescription": "Garnélatál receptje",
"demoSharedZAxisShrimpPlateRecipeTitle": "Garnélarák",
"demoContainerTransformTypeFadeThrough": "ÁTTŰNÉS",
"demoSharedZAxisDessertRecipeTitle": "Desszert",
"demoSharedZAxisSandwichRecipeDescription": "Szendvicsrecept",
"demoSharedZAxisSandwichRecipeTitle": "Szendvics",
"demoSharedZAxisBurgerRecipeDescription": "Hamburgerrecept",
"demoSharedZAxisBurgerRecipeTitle": "Hamburger",
"demoSharedZAxisSettingsPageTitle": "Beállítás",
"demoSharedZAxisTitle": "Megosztott z tengely",
"demoSharedZAxisPrivacySettingLabel": "Adatvédelem",
"demoMotionTitle": "Mozgás",
"demoContainerTransformTitle": "Tároló átalakulása",
"demoContainerTransformDescription": "A tároló átalakulása minta a tárolót tartalmazó UI-elemek közötti áttűnések megvalósítására szolgál. Ez a minta látható kapcsolatot hoz létre két UI-elem között",
"demoContainerTransformModalBottomSheetTitle": "Halványítás mód",
"demoContainerTransformTypeFade": "HALVÁNYÍTÁS",
"demoSharedYAxisAlbumTileDurationUnit": "p",
"demoMotionPlaceholderTitle": "Cím",
"demoSharedXAxisForgotEmailButtonText": "ELFELEJTETTE AZ E-MAIL-CÍMÉT?",
"demoMotionSmallPlaceholderSubtitle": "Másodlagos",
"demoMotionDetailsPageTitle": "Részletek oldal",
"demoMotionListTileTitle": "Listaelem",
"demoSharedAxisDescription": "A megosztott tengely mintát a térbeli vagy navigációs kapcsolattal rendelkező UI-elemek közötti átmenetekhez használja a rendszer. Ez a minta megosztott átalakítást használ az x, az y vagy a z tengelyen az elemek közötti kapcsolat megerősítéséhez.",
"demoSharedXAxisTitle": "Megosztott x tengely",
"demoSharedXAxisBackButtonText": "VISSZA",
"demoSharedXAxisNextButtonText": "TOVÁBB",
"demoSharedXAxisCulinaryCourseTitle": "Konyhaművészet",
"githubRepo": "{repoName} GitHub-tárhely",
"fortnightlyMenuUS": "USA",
"fortnightlyMenuBusiness": "Üzlet",
"fortnightlyMenuScience": "Tudomány",
"fortnightlyMenuSports": "Sport",
"fortnightlyMenuTravel": "Utazás",
"fortnightlyMenuCulture": "Kultúra",
"fortnightlyTrendingTechDesign": "TechDesign",
"rallyBudgetDetailAmountLeft": "Fennmaradó összeg",
"fortnightlyHeadlineArmy": "A Zöld sereg belső reformja",
"fortnightlyDescription": "Tartalomközpontú hírszolgáltató alkalmazás",
"rallyBillDetailAmountDue": "Fizetendő összeg",
"rallyBudgetDetailTotalCap": "Össztőke",
"rallyBudgetDetailAmountUsed": "Felhasznált összeg",
"fortnightlyTrendingHealthcareRevolution": "HealthcareRevolution",
"fortnightlyMenuFrontPage": "Címlap",
"fortnightlyMenuWorld": "Világ",
"rallyBillDetailAmountPaid": "Kifizetett összeg",
"fortnightlyMenuPolitics": "Politika",
"fortnightlyHeadlineBees": "Kevés a méh a gazdaságokban",
"fortnightlyHeadlineGasoline": "A benzin jövője",
"fortnightlyTrendingGreenArmy": "GreenArmy",
"fortnightlyHeadlineFeminists": "A feministák pártot választanak",
"fortnightlyHeadlineFabrics": "A tervezők a technológiát hívják segítségül futurisztikus anyagok megalkotásához",
"fortnightlyHeadlineStocks": "A tőzsde stagnálásával minden szempár a valutára szegeződik",
"fortnightlyTrendingReform": "Reform",
"fortnightlyMenuTech": "Technológia",
"fortnightlyHeadlineWar": "Háború során szétválasztott amerikai életek",
"fortnightlyHeadlineHealthcare": "A csendes, mégis erőteljes egészségügyi forradalom",
"fortnightlyLatestUpdates": "Legújabb frissítések",
"fortnightlyTrendingStocks": "Stocks",
"rallyBillDetailTotalAmount": "Teljes összeg",
"demoCupertinoPickerDateTime": "Dátum és idő",
"signIn": "BEJELENTKEZÉS",
"dataTableRowWithSugar": "{value} cukorral",
"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": "Vas (%)",
"dataTableColumnCalcium": "Kalcium (%)",
"dataTableColumnSodium": "Nátrium (mg)",
"demoTimePickerTitle": "Időpontválasztó",
"demo2dTransformationsResetTooltip": "Átalakítások visszaállítása",
"dataTableColumnFat": "Zsír (g)",
"dataTableColumnCalories": "Kalória",
"dataTableColumnDessert": "Desszert (1 adag)",
"cardsDemoTravelDestinationLocation1": "Tandzsávúr, Tamilnádu",
"demoTimePickerDescription": "Anyagszerű megjelenéssel rendelkező időpontválasztót tartalmazó párbeszédpanelt jelenít meg.",
"demoPickersShowPicker": "VÁLASZTÓ MEGJELENÍTÉSE",
"demoTabsScrollingTitle": "Görgethető",
"demoTabsNonScrollingTitle": "Nem görgethető",
"craneHours": "{hours,plural,=1{1 ó}other{{hours} ó}}",
"craneMinutes": "{minutes,plural,=1{1 p}other{{minutes} p}}",
"craneFlightDuration": "{hoursShortForm} {minutesShortForm}",
"dataTableHeader": "Táplálkozás",
"demoDatePickerTitle": "Dátumválasztó",
"demoPickersSubtitle": "Dátum és idő kiválasztása",
"demoPickersTitle": "Választók",
"demo2dTransformationsEditTooltip": "Mozaik szerkesztése",
"demoDataTableDescription": "Az adattáblák oszlopok és sorok rácsszerű formájában jelenítik meg az információkat. Olyan módon rendszerezik őket, hogy könnyen áttekinthetők legyenek, így a felhasználók felfedezhetik a mintázatokat és az egyéb fontos adatokat.",
"demo2dTransformationsDescription": "A mozaikok szerkesztéséhez koppintson, a jelenetben való mozgáshoz pedig használjon kézmozdulatokat. Húzza ujját a pásztázáshoz, húzza össze ujjait a nagyításhoz/kicsinyítéshez, és használja két ujját a forgatáshoz. Nyomja meg a visszaállítás gombot a kezdő tájoláshoz való visszatéréshez.",
"demo2dTransformationsSubtitle": "Pásztázás, nagyítás/kicsinyítés, forgatás",
"demo2dTransformationsTitle": "2D-s átalakítások",
"demoCupertinoTextFieldPIN": "PIN-kód",
"demoCupertinoTextFieldDescription": "A szövegmezőbe a felhasználók beírhatnak szöveget hardveres vagy képernyő-billentyűzettel.",
"demoCupertinoTextFieldSubtitle": "iOS-stílusú szövegmezők",
"demoCupertinoTextFieldTitle": "Szövegmezők",
"demoDatePickerDescription": "Anyagszerű megjelenéssel rendelkező dátumválasztót tartalmazó párbeszédpanelt jelenít meg.",
"demoCupertinoPickerTime": "Idő",
"demoCupertinoPickerDate": "Dátum",
"demoCupertinoPickerTimer": "Időzítő",
"demoCupertinoPickerDescription": "iOS-stílusú választómodul, amelyet karakterláncok, dátumok, időpontok, illetve dátumok és időpontok egyidejű kiválasztására lehet használni.",
"demoCupertinoPickerSubtitle": "iOS-stílusú választók",
"demoCupertinoPickerTitle": "Választók",
"dataTableRowWithHoney": "{value} mézzel",
"cardsDemoTravelDestinationCity2": "Chettinad",
"bannerDemoResetText": "Üzenetszalag visszaállítása",
"bannerDemoMultipleText": "Több művelet",
"bannerDemoLeadingText": "Bevezető ikon",
"dismiss": "ELVETÉS",
"cardsDemoTappable": "Rá lehet koppintani",
"cardsDemoSelectable": "Kiválasztható (hosszú megnyomással)",
"cardsDemoExplore": "Felfedezés",
"cardsDemoExploreSemantics": "{destinationName} felfedezése",
"cardsDemoShareSemantics": "{destinationName} megosztása",
"cardsDemoTravelDestinationTitle1": "Tíz város, amelyet érdemes felkeresni Tamilnáduban",
"cardsDemoTravelDestinationDescription1": "Tízes szám",
"cardsDemoTravelDestinationCity1": "Tandzsávúr",
"dataTableColumnProtein": "Fehérje (g)",
"cardsDemoTravelDestinationTitle2": "Kézművesek Dél-Indiából",
"cardsDemoTravelDestinationDescription2": "Selyemkészítők",
"bannerDemoText": "Jelszava frissítve lett a másik eszközén. Kérjük, jelentkezzen be újra.",
"cardsDemoTravelDestinationLocation2": "Sivaganga, Tamilnádu",
"cardsDemoTravelDestinationTitle3": "Brihadesvara-templom",
"cardsDemoTravelDestinationDescription3": "Szentélyek",
"demoBannerTitle": "Üzenetszalag",
"demoBannerSubtitle": "Üzenetszalag megjelenítése listában",
"demoBannerDescription": "Az üzenetszalagon rövid, ugyanakkor fontos üzenetek jelennek meg, amelyekkel a kapcsolatban a felhasználók valamilyen műveletet végezhetnek el (vagy elvethetik az üzenetszalagot). Az elvetéséhez is felhasználói beavatkozásra van szükség.",
"demoCardTitle": "Kártyák",
"demoCardSubtitle": "Alapkártyák lekerekített sarokkal",
"demoCardDescription": "A kártya olyan Material-lap, amelyen kapcsolódó információ szerepel (pl. album, földrajzi hely, étkezés, kapcsolatfelvételi adatok stb.).",
"demoDataTableTitle": "Adattáblák",
"demoDataTableSubtitle": "Információkat tartalmazó sorok és oszlopok",
"dataTableColumnCarbs": "Szénhidrát (g)",
"placeTanjore": "Tandzsávúr",
"demoGridListsTitle": "Rácsos listák",
"placeFlowerMarket": "Virágpiac",
"placeBronzeWorks": "Bronzműves",
"placeMarket": "Piac",
"placeThanjavurTemple": "Tandzsávúr temploma",
"placeSaltFarm": "Sófarm",
"placeScooters": "Robogók",
"placeSilkMaker": "Selyemkészítő",
"placeLunchPrep": "Ebéd elkészítése",
"placeBeach": "Tengerpart",
"placeFisherman": "Horgász",
"demoMenuSelected": "Kiválasztva: {value}",
"demoMenuRemove": "Eltávolítás",
"demoMenuGetLink": "Link lekérése",
"demoMenuShare": "Megosztás",
"demoBottomAppBarSubtitle": "A képernyő alján jeleníti meg a navigációs fiókot és a műveleteket",
"demoMenuAnItemWithASectionedMenu": "Elem tagolt menüvel",
"demoMenuADisabledMenuItem": "Letiltott menüelem",
"demoLinearProgressIndicatorTitle": "Lineáris folyamatjelző",
"demoMenuContextMenuItemOne": "Helyi menü első eleme",
"demoMenuAnItemWithASimpleMenu": "Elem egyszerű menüvel",
"demoCustomSlidersTitle": "Egyéni csúszkák",
"demoMenuAnItemWithAChecklistMenu": "Elem ellenőrző listás menüvel",
"demoCupertinoActivityIndicatorTitle": "Tevékenységjelző",
"demoCupertinoActivityIndicatorSubtitle": "iOS-stílusú tevékenységjelzők",
"demoCupertinoActivityIndicatorDescription": "iOS-stílusú tevékenységjelző, amely az óramutató járásával megegyezően forog.",
"demoCupertinoNavigationBarTitle": "Navigációs sáv",
"demoCupertinoNavigationBarSubtitle": "iOS-stílusú navigációs sáv",
"demoCupertinoNavigationBarDescription": "iOS-stílusú navigációs sáv. A navigációs sáv olyan eszköztár, amely legalább az oldal címét tartalmazza az eszköztár közepén.",
"demoCupertinoPullToRefreshTitle": "Húzza le a frissítéshez",
"demoCupertinoPullToRefreshSubtitle": "iOS-stílusú vezérlő a lehúzással való frissítéshez",
"demoCupertinoPullToRefreshDescription": "A lehúzással való frissítéshez tartozó iOS-stílusú vezérlőt megvalósító modul.",
"demoProgressIndicatorTitle": "Folyamatjelzők",
"demoProgressIndicatorSubtitle": "Lineáris, körkörös, meghatározatlan ideig tartó",
"demoCircularProgressIndicatorTitle": "Körkörös folyamatjelző",
"demoCircularProgressIndicatorDescription": "Körkörös Material Design-folyamatjelző, amely forgással jelzi, hogy az alkalmazás dolgozik.",
"demoMenuFour": "Négy",
"demoLinearProgressIndicatorDescription": "Lineáris Material Design-folyamatjelző, amely folyamatjelző sávként is ismert.",
"demoTooltipTitle": "Elemleírások",
"demoTooltipSubtitle": "Rövid üzenet, amely a kapcsolódó elem hosszú megnyomásakor vagy az egérrel való rámutatáskor jelenik meg",
"demoTooltipDescription": "Az elemleírások szöveges címkéket tartalmaznak, amelyek segítik az adott gomb vagy más kezelőfelületi művelet funkciójának a megértését. Az elemleírások informatív szöveget jelenítenek meg, amikor a felhasználók az adott elem fölé viszik az egeret, az adott elemre fókuszálnak, vagy hosszan nyomják az adott elemet.",
"demoTooltipInstructions": "Az elemleírás megjelenítéséhez nyomja hosszan a kapcsolódó elemet, vagy vigye rá az egeret.",
"placeChennai": "Csennai",
"demoMenuChecked": "Bejelölve: {value}",
"placeChettinad": "Chettinad",
"demoMenuPreview": "Előnézet",
"demoBottomAppBarTitle": "Alsó alkalmazássáv",
"demoBottomAppBarDescription": "Az alsó alkalmazássávok hozzáférést biztosítanak az alsó navigációs fiókhoz és akár négy művelethez (a lebegő műveletgombot is beleértve).",
"bottomAppBarNotch": "Képernyőkivágás",
"bottomAppBarPosition": "Lebegő műveletgomb pozíciója",
"bottomAppBarPositionDockedEnd": "Dokkolva – a sáv végén",
"bottomAppBarPositionDockedCenter": "Dokkolva – a sáv közepén",
"bottomAppBarPositionFloatingEnd": "Lebeg – a sáv végén",
"bottomAppBarPositionFloatingCenter": "Lebeg – a sáv közepén",
"demoSlidersEditableNumericalValue": "Szerkeszthető számérték",
"demoGridListsSubtitle": "Soros és oszlopos elrendezés",
"demoGridListsDescription": "A rácsos listák homogén adatok (általában képek) megjelenítésére a legalkalmasabbak. A rácsos lista egyes elemeit csempéknek nevezzük.",
"demoGridListsImageOnlyTitle": "Csak kép",
"demoGridListsHeaderTitle": "Fejléccel",
"demoGridListsFooterTitle": "Lábléccel",
"demoSlidersTitle": "Csúszkák",
"demoSlidersSubtitle": "Modulok, amelyek csúsztatásával kiválaszthatja a kívánt értéket",
"demoSlidersDescription": "A csúszkák értéktartományt jelenítenek meg egy sáv mentén, és a felhasználók ebből a tartományból választhatják ki a kívánt értéket. A csúszkák ideális összetevők olyan beállítások módosításához, mint például a hangerő és a fényerő, valamint képszűrők alkalmazásához.",
"demoRangeSlidersTitle": "Tartománycsúszkák",
"demoRangeSlidersDescription": "A csúszkák értéktartományt jelenítenek meg egy sáv mentén. A csúszkáknál a sáv mindkét végén ikonok jelezhetik az értéktartományt. A csúszkák ideális összetevők olyan beállítások módosításához, mint például a hangerő és a fényerő, valamint képszűrők alkalmazásához.",
"demoMenuAnItemWithAContextMenuButton": "Elem helyi menüvel",
"demoCustomSlidersDescription": "A csúszkák értéktartományt jelenítenek meg egy sáv mentén, és a felhasználók ebből a tartományból választhatják ki a kívánt értéket vagy értéktartományt. A csúszkák személyre szabhatók, és témájuk módosítható.",
"demoSlidersContinuousWithEditableNumericalValue": "Folyamatos csúszka szerkeszthető számértékkel",
"demoSlidersDiscrete": "Tagolt",
"demoSlidersDiscreteSliderWithCustomTheme": "Tagolt csúszka egyéni témával",
"demoSlidersContinuousRangeSliderWithCustomTheme": "Folyamatos tartománycsúszka egyéni témával",
"demoSlidersContinuous": "Folyamatos",
"placePondicherry": "Puduccseri",
"demoMenuTitle": "Menü",
"demoContextMenuTitle": "Helyi menü",
"demoSectionedMenuTitle": "Tagolt menü",
"demoSimpleMenuTitle": "Egyszerű menü",
"demoChecklistMenuTitle": "Ellenőrző listás menü",
"demoMenuSubtitle": "Menügombok és egyszerű menük",
"demoMenuDescription": "Egy menü válaszlehetőségek listáját jeleníti meg egy ideiglenes felületen. Akkor jelenik meg, amikor a felhasználó valamilyen gombot, műveletet vagy másféle vezérlőelemet használ.",
"demoMenuItemValueOne": "Első menüelem",
"demoMenuItemValueTwo": "Második menüelem",
"demoMenuItemValueThree": "Harmadik menüelem",
"demoMenuOne": "Egy",
"demoMenuTwo": "Kettő",
"demoMenuThree": "Három",
"demoMenuContextMenuItemThree": "Helyi menü harmadik eleme",
"demoCupertinoSwitchSubtitle": "iOS-stílusú kapcsoló",
"demoSnackbarsText": "Ez egy információs sáv.",
"demoCupertinoSliderSubtitle": "iOS-stílusú csúszka",
"demoCupertinoSliderDescription": "A csúszkával folyamatos vagy diszkrét értékkészletből lehet választani.",
"demoCupertinoSliderContinuous": "Folyamatos: {value}",
"demoCupertinoSliderDiscrete": "Diszkrét: {value}",
"demoSnackbarsAction": "Megnyomta az információs sávról elvégezhető művelet gombját.",
"backToGallery": "Vissza a Galériához",
"demoCupertinoTabBarTitle": "Fülsáv",
"demoCupertinoSwitchDescription": "A kapcsolóval egy adott beállítás be- vagy kikapcsolt állapotát lehet állítani.",
"demoSnackbarsActionButtonLabel": "MŰVELET",
"cupertinoTabBarProfileTab": "Profil",
"demoSnackbarsButtonLabel": "PÉLDA AZ INFORMÁCIÓS SÁVRA",
"demoSnackbarsDescription": "Az információs sávok arról tájékoztatják a felhasználókat, hogy valamelyik alkalmazás melyik folyamatot végezte el vagy fogja elvégezni. A képernyő alján, rövid időre jelennek meg. Nem zavarhatják meg a felhasználói élményt, és nem követelhetnek meg felhasználói beavatkozást ahhoz, hogy eltűnjenek.",
"demoSnackbarsSubtitle": "Az információs sávok üzeneteket jelenítenek meg a képernyő alján",
"demoSnackbarsTitle": "Információs sávok",
"demoCupertinoSliderTitle": "Csúszka",
"cupertinoTabBarChatTab": "Csevegés",
"cupertinoTabBarHomeTab": "Kezdőlap",
"demoCupertinoTabBarDescription": "iOS-stílusú, alsó navigációs lapfülsáv. Több lapfület jelenít meg, amelyek közül az egyik aktív (alapértelmezés szerint az első).",
"demoCupertinoTabBarSubtitle": "iOS-stílusú fülsáv",
"demoOptionsFeatureTitle": "Lehetőségek megtekintése",
"demoOptionsFeatureDescription": "Koppintson ide a bemutatóhoz tartozó, rendelkezésre álló lehetőségek megtekintéséhez.",
"demoCodeViewerCopyAll": "ÖSSZES MÁSOLÁSA",
"shrineScreenReaderRemoveProductButton": "{product} eltávolítása",
"shrineScreenReaderProductAddToCart": "Hozzáadás a kosárhoz",
"shrineScreenReaderCart": "{quantity,plural,=0{Kosár, üres}=1{Kosár, 1 tétel}other{Kosár, {quantity} tétel}}",
"demoCodeViewerFailedToCopyToClipboardMessage": "Nem sikerült a vágólapra másolni: {error}",
"demoCodeViewerCopiedToClipboardMessage": "A vágólapra másolva.",
"craneSleep8SemanticLabel": "Maja romok egy tengerparti sziklán",
"craneSleep4SemanticLabel": "Hegyek előtt, tó partján álló szálloda",
"craneSleep2SemanticLabel": "A Machu Picchu fellegvára",
"craneSleep1SemanticLabel": "Faház havas tájon, örökzöld fák között",
"craneSleep0SemanticLabel": "Vízen álló nyaralóházak",
"craneFly13SemanticLabel": "Tengerparti medence pálmafákkal",
"craneFly12SemanticLabel": "Medence pálmafákkal",
"craneFly11SemanticLabel": "Téglaépítésű világítótorony a tengeren",
"craneFly10SemanticLabel": "Az Al-Azhar mecset tornyai a lemenő nap fényében",
"craneFly9SemanticLabel": "Régi kék autóra támaszkodó férfi",
"craneFly8SemanticLabel": "Supertree Grove",
"craneEat9SemanticLabel": "Kávézó pultja péksüteményekkel",
"craneEat2SemanticLabel": "Hamburger",
"craneFly5SemanticLabel": "Hegyek előtt, tó partján álló szálloda",
"demoSelectionControlsSubtitle": "Jelölőnégyzetek, választógombok és kapcsolók",
"craneEat10SemanticLabel": "Óriási pastramis szendvicset tartó nő",
"craneFly4SemanticLabel": "Vízen álló nyaralóházak",
"craneEat7SemanticLabel": "Pékség bejárata",
"craneEat6SemanticLabel": "Rákból készült étel",
"craneEat5SemanticLabel": "Művészi tematikájú étterem belső tere",
"craneEat4SemanticLabel": "Csokoládés desszert",
"craneEat3SemanticLabel": "Koreai taco",
"craneFly3SemanticLabel": "A Machu Picchu fellegvára",
"craneEat1SemanticLabel": "Üres bár vendéglőkben használatos bárszékekkel",
"craneEat0SemanticLabel": "Pizza egy fatüzelésű sütőben",
"craneSleep11SemanticLabel": "A Taipei 101 felhőkarcoló",
"craneSleep10SemanticLabel": "Az Al-Azhar mecset tornyai a lemenő nap fényében",
"craneSleep9SemanticLabel": "Téglaépítésű világítótorony a tengeren",
"craneEat8SemanticLabel": "Languszták egy tányéron",
"craneSleep7SemanticLabel": "Színes lakóházak a Ribeira-téren",
"craneSleep6SemanticLabel": "Medence pálmafákkal",
"craneSleep5SemanticLabel": "Sátor egy mezőn",
"settingsButtonCloseLabel": "Beállítások bezárása",
"demoSelectionControlsCheckboxDescription": "A jelölőnégyzetek lehetővé teszik a felhasználó számára, hogy egy adott csoportból több lehetőséget is kiválasszon. A normál jelölőnégyzetek értéke igaz vagy hamis lehet, míg a háromállapotú jelölőnégyzetek a null értéket is felvehetik.",
"settingsButtonLabel": "Beállítások",
"demoListsTitle": "Listák",
"demoListsSubtitle": "Görgethető lista elrendezései",
"demoListsDescription": "Egyetlen, fix magasságú sor, amely általában szöveget tartalmaz, és az elején vagy végén ikon található.",
"demoOneLineListsTitle": "Egysoros",
"demoTwoLineListsTitle": "Kétsoros",
"demoListsSecondary": "Másodlagos szöveg",
"demoSelectionControlsTitle": "Kiválasztásvezérlők",
"craneFly7SemanticLabel": "Rushmore-hegy",
"demoSelectionControlsCheckboxTitle": "Jelölőnégyzet",
"craneSleep3SemanticLabel": "Régi kék autóra támaszkodó férfi",
"demoSelectionControlsRadioTitle": "Választógomb",
"demoSelectionControlsRadioDescription": "A választógombok lehetővé teszik, hogy a felhasználó kiválassza a csoportban lévő valamelyik lehetőséget. A választógombok használata kizárólagos kiválasztást eredményez, amelyet akkor érdemes használnia, ha úgy gondolja, hogy a felhasználónak egyszerre kell látnia az összes választható lehetőséget.",
"demoSelectionControlsSwitchTitle": "Kapcsoló",
"demoSelectionControlsSwitchDescription": "A be- és kikapcsolásra szolgáló gomb egyetlen beállítás állapotát módosítja. Annak a beállításnak, amelyet a kapcsoló vezérel, valamint annak, hogy éppen be- vagy kikapcsolt állapotban van-e a kapcsoló, egyértelműnek kell lennie a megfelelő szövegközi címkéből.",
"craneFly0SemanticLabel": "Faház havas tájon, örökzöld fák között",
"craneFly1SemanticLabel": "Sátor egy mezőn",
"craneFly2SemanticLabel": "Imazászlók egy havas hegy előtt",
"craneFly6SemanticLabel": "Légi felvétel a Szépművészeti Palotáról",
"rallySeeAllAccounts": "Összes bankszámla megtekintése",
"rallyBillAmount": "{amount} összegű {billName} számla esedékességi dátuma: {date}.",
"shrineTooltipCloseCart": "Kosár bezárása",
"shrineTooltipCloseMenu": "Menü bezárása",
"shrineTooltipOpenMenu": "Menü megnyitása",
"shrineTooltipSettings": "Beállítások",
"shrineTooltipSearch": "Keresés",
"demoTabsDescription": "A lapok rendszerezik a tartalmakat különböző képernyőkön, adathalmazokban és egyéb interakciók során.",
"demoTabsSubtitle": "Lapok egymástól függetlenül görgethető nézettel",
"demoTabsTitle": "Lapok",
"rallyBudgetAmount": "{amountTotal} összegű {budgetName} költségkeret, amelyből felhasználásra került {amountUsed}, és maradt {amountLeft}",
"shrineTooltipRemoveItem": "Tétel eltávolítása",
"rallyAccountAmount": "{accountName} bankszámla ({accountNumber}) {amount} összeggel.",
"rallySeeAllBudgets": "Összes költségkeret megtekintése",
"rallySeeAllBills": "Összes számla megtekintése",
"craneFormDate": "Dátum kiválasztása",
"craneFormOrigin": "Kiindulási pont kiválasztása",
"craneFly2": "Khumbu-völgy, Nepál",
"craneFly3": "Machu Picchu, Peru",
"craneFly4": "Malé, Maldív-szigetek",
"craneFly5": "Vitznau, Svájc",
"craneFly6": "Mexikóváros, Mexikó",
"craneFly7": "Rushmore-hegy, Amerikai Egyesült Államok",
"settingsTextDirectionLocaleBased": "A nyelv- és országbeállítás alapján",
"craneFly9": "Havanna, Kuba",
"craneFly10": "Kairó, Egyiptom",
"craneFly11": "Lisszabon, Portugália",
"craneFly12": "Napa, Amerikai Egyesült Államok",
"craneFly13": "Bali, Indonézia",
"craneSleep0": "Malé, Maldív-szigetek",
"craneSleep1": "Aspen, Amerikai Egyesült Államok",
"craneSleep2": "Machu Picchu, Peru",
"demoCupertinoSegmentedControlTitle": "Szegmentált vezérlés",
"craneSleep4": "Vitznau, Svájc",
"craneSleep5": "Big Sur, Amerikai Egyesült Államok",
"craneSleep6": "Napa, Amerikai Egyesült Államok",
"craneSleep7": "Porto, Portugália",
"craneSleep8": "Tulum, Mexikó",
"craneEat5": "Szöul, Dél-Korea",
"demoChipTitle": "Szelvények",
"demoChipSubtitle": "Kompakt elemek, amelyek bevitelt, tulajdonságot vagy műveletet jelölnek",
"demoActionChipTitle": "Műveletszelvény",
"demoActionChipDescription": "A műveletszelvények olyan beállításcsoportokat jelentenek, amelyek aktiválnak valamilyen műveletet az elsődleges tartalommal kapcsolatban. A műveletszelvényeknek dinamikusan, a kontextusnak megfelelően kell megjelenniük a kezelőfelületen.",
"demoChoiceChipTitle": "Választószelvény",
"demoChoiceChipDescription": "A választószelvények egy konkrét választást jelölnek egy csoportból. A választószelvények kapcsolódó leíró szöveget vagy kategóriákat is tartalmaznak.",
"demoFilterChipTitle": "Szűrőszelvény",
"demoFilterChipDescription": "A szűrőszelvények címkék vagy leíró jellegű szavak segítségével szűrik a tartalmat.",
"demoInputChipTitle": "Beviteli szelvény",
"demoInputChipDescription": "A beviteli szelvények összetett információt jelentenek kompakt formában például egy adott entitásról (személyről, helyről vagy dologról) vagy egy adott beszélgetés szövegéről.",
"craneSleep9": "Lisszabon, Portugália",
"craneEat10": "Lisszabon, Portugália",
"demoCupertinoSegmentedControlDescription": "Több, egymást kölcsönösen kizáró lehetőség közüli választásra szolgál. Amikor a felhasználó kiválasztja valamelyik lehetőséget a szegmentált vezérlésben, a többi lehetőség nem lesz választható.",
"chipTurnOnLights": "Világítás bekapcsolása",
"chipSmall": "Kicsi",
"chipMedium": "Közepes",
"chipLarge": "Nagy",
"chipElevator": "Lift",
"chipWasher": "Mosógép",
"chipFireplace": "Kandalló",
"chipBiking": "Kerékpározás",
"craneFormDiners": "Falatozók",
"rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{Növelje a lehetséges adókedvezményt! Rendeljen kategóriát 1 hozzárendelés nélküli tranzakcióhoz.}other{Növelje a lehetséges adókedvezményt! Rendeljen kategóriákat {count} hozzárendelés nélküli tranzakcióhoz.}}",
"craneFormTime": "Időpont kiválasztása",
"craneFormLocation": "Hely kiválasztása",
"craneFormTravelers": "Utasok száma",
"craneEat8": "Atlanta, Amerikai Egyesült Államok",
"craneFormDestination": "Válasszon úti célt",
"craneFormDates": "Válassza ki a dátumtartományt",
"craneFly": "REPÜLÉS",
"craneSleep": "ALVÁS",
"craneEat": "ÉTKEZÉS",
"craneFlySubhead": "Fedezzen fel repülőjáratokat úti cél szerint",
"craneSleepSubhead": "Fedezzen fel ingatlanokat úti cél szerint",
"craneEatSubhead": "Fedezzen fel éttermeket úti cél szerint",
"craneFlyStops": "{numberOfStops,plural,=0{Közvetlen járat}=1{1 megálló}other{{numberOfStops} megálló}}",
"craneSleepProperties": "{totalProperties,plural,=0{Nincs rendelkezésre álló ingatlan}=1{1 rendelkezésre álló ingatlan van}other{{totalProperties} rendelkezésre álló ingatlan van}}",
"craneEatRestaurants": "{totalRestaurants,plural,=0{Nincs étterem}=1{1 étterem}other{{totalRestaurants} étterem}}",
"craneFly0": "Aspen, Amerikai Egyesült Államok",
"demoCupertinoSegmentedControlSubtitle": "iOS-stílusú szegmentált vezérlés",
"craneSleep10": "Kairó, Egyiptom",
"craneEat9": "Madrid, Spanyolország",
"craneFly1": "Big Sur, Amerikai Egyesült Államok",
"craneEat7": "Nashville, Amerikai Egyesült Államok",
"craneEat6": "Seattle, Amerikai Egyesült Államok",
"craneFly8": "Szingapúr",
"craneEat4": "Párizs, Franciaország",
"craneEat3": "Portland, Amerikai Egyesült Államok",
"craneEat2": "Córdoba, Argentína",
"craneEat1": "Dallas, Amerikai Egyesült Államok",
"craneEat0": "Nápoly, Olaszország",
"craneSleep11": "Tajpej, Tajvan",
"craneSleep3": "Havanna, Kuba",
"shrineLogoutButtonCaption": "KIJELENTKEZÉS",
"rallyTitleBills": "SZÁMLÁK",
"rallyTitleAccounts": "FIÓKOK",
"shrineProductVagabondSack": "„Vagabond” zsák",
"rallyAccountDetailDataInterestYtd": "Kamat eddig az évben",
"shrineProductWhitneyBelt": "„Whitney” öv",
"shrineProductGardenStrand": "Kerti sodrott kötél",
"shrineProductStrutEarrings": "„Strut” fülbevalók",
"shrineProductVarsitySocks": "„Varsity” zokni",
"shrineProductWeaveKeyring": "Kulcstartó",
"shrineProductGatsbyHat": "Gatsby sapka",
"shrineProductShrugBag": "Táska",
"shrineProductGiltDeskTrio": "Gilt íróasztal trió",
"shrineProductCopperWireRack": "Rézből készült tároló",
"shrineProductSootheCeramicSet": "Kerámiakészlet",
"shrineProductHurrahsTeaSet": "„Hurrahs” teáskészlet",
"shrineProductBlueStoneMug": "„Blue Stone” bögre",
"shrineProductRainwaterTray": "Esővíztálca",
"shrineProductChambrayNapkins": "Chambray anyagú szalvéta",
"shrineProductSucculentPlanters": "Cserép pozsgásokhoz",
"shrineProductQuartetTable": "Négyzet alakú asztal",
"shrineProductKitchenQuattro": "„Kitchen quattro”",
"shrineProductClaySweater": "„Clay” pulóver",
"shrineProductSeaTunic": "„Sea” tunika",
"shrineProductPlasterTunic": "„Plaster” tunika",
"rallyBudgetCategoryRestaurants": "Éttermek",
"shrineProductChambrayShirt": "Chambray anyagú ing",
"shrineProductSeabreezeSweater": "„Seabreeze” pulóver",
"shrineProductGentryJacket": "„Gentry” dzseki",
"shrineProductNavyTrousers": "Matrózkék nadrág",
"shrineProductWalterHenleyWhite": "„Walter” henley stílusú póló (fehér)",
"shrineProductSurfAndPerfShirt": "„Surf and perf” póló",
"shrineProductGingerScarf": "Vörös sál",
"shrineProductRamonaCrossover": "Ramona crossover",
"shrineProductClassicWhiteCollar": "Klasszikus fehér gallér",
"shrineProductSunshirtDress": "„Sunshirt” ruha",
"rallyAccountDetailDataInterestRate": "Kamatláb",
"rallyAccountDetailDataAnnualPercentageYield": "Éves százalékos hozam",
"rallyAccountDataVacation": "Szabadság",
"shrineProductFineLinesTee": "Finom csíkozású póló",
"rallyAccountDataHomeSavings": "Otthonnal kapcsolatos megtakarítások",
"rallyAccountDataChecking": "Folyószámla",
"rallyAccountDetailDataInterestPaidLastYear": "Tavaly kifizetett kamatok",
"rallyAccountDetailDataNextStatement": "Következő kimutatás",
"rallyAccountDetailDataAccountOwner": "Fióktulajdonos",
"rallyBudgetCategoryCoffeeShops": "Kávézók",
"rallyBudgetCategoryGroceries": "Bevásárlás",
"shrineProductCeriseScallopTee": "„Cerise” lekerekített alsó szegélyű póló",
"rallyBudgetCategoryClothing": "Ruházat",
"rallySettingsManageAccounts": "Fiókok kezelése",
"rallyAccountDataCarSavings": "Autóval kapcsolatos megtakarítások",
"rallySettingsTaxDocuments": "Adódokumentumok",
"rallySettingsPasscodeAndTouchId": "Biztonsági kód és Touch ID",
"rallySettingsNotifications": "Értesítések",
"rallySettingsPersonalInformation": "Személyes adatok",
"rallySettingsPaperlessSettings": "Papír nélküli beállítások",
"rallySettingsFindAtms": "ATM-ek keresése",
"rallySettingsHelp": "Súgó",
"rallySettingsSignOut": "Kijelentkezés",
"rallyAccountTotal": "Összesen",
"rallyBillsDue": "Esedékes",
"rallyBudgetLeft": "maradt",
"rallyAccounts": "Fiókok",
"rallyBills": "Számlák",
"rallyBudgets": "Költségkeretek",
"rallyAlerts": "Értesítések",
"rallySeeAll": "ÖSSZES MEGTEKINTÉSE",
"rallyFinanceLeft": "MARADT",
"rallyTitleOverview": "ÁTTEKINTÉS",
"shrineProductShoulderRollsTee": "Váll néküli felső",
"shrineNextButtonCaption": "TOVÁBB",
"rallyTitleBudgets": "KÖLTSÉGKERETEK",
"rallyTitleSettings": "BEÁLLÍTÁSOK",
"rallyLoginLoginToRally": "Bejelentkezés a Rally szolgáltatásba",
"rallyLoginNoAccount": "Nincs fiókja?",
"rallyLoginSignUp": "REGISZTRÁCIÓ",
"rallyLoginUsername": "Felhasználónév",
"rallyLoginPassword": "Jelszó",
"rallyLoginLabelLogin": "Bejelentkezés",
"rallyLoginRememberMe": "Jelszó megjegyzése",
"rallyLoginButtonLogin": "BEJELENTKEZÉS",
"rallyAlertsMessageHeadsUpShopping": "Előrejelzés: Az e havi Shopping-költségkeret {percent}-át használta fel.",
"rallyAlertsMessageSpentOnRestaurants": "{amount} összeget költött el éttermekben ezen a héten.",
"rallyAlertsMessageATMFees": "{amount} összeget költött ATM-díjakra ebben a hónapban",
"rallyAlertsMessageCheckingAccount": "Nagyszerű! Folyószámlája {percent}-kal magasabb, mint múlt hónapban.",
"shrineMenuCaption": "MENÜ",
"shrineCategoryNameAll": "ÖSSZES",
"shrineCategoryNameAccessories": "KIEGÉSZÍTŐK",
"shrineCategoryNameClothing": "RUHÁZAT",
"shrineCategoryNameHome": "OTTHON",
"shrineLoginUsernameLabel": "Felhasználónév",
"shrineLoginPasswordLabel": "Jelszó",
"shrineCancelButtonCaption": "MÉGSE",
"shrineCartTaxCaption": "Adó:",
"shrineCartPageCaption": "KOSÁR",
"shrineProductQuantity": "Mennyiség: {quantity}",
"shrineProductPrice": "× {price}",
"shrineCartItemCount": "{quantity,plural,=0{NINCSENEK TÉTELEK}=1{1 TÉTEL}other{{quantity} TÉTEL}}",
"shrineCartClearButtonCaption": "KOSÁR TÖRLÉSE",
"shrineCartTotalCaption": "ÖSSZES",
"shrineCartSubtotalCaption": "Részösszeg:",
"shrineCartShippingCaption": "Szállítás:",
"shrineProductGreySlouchTank": "Szürke ujjatlan póló",
"shrineProductStellaSunglasses": "„Stella” napszemüveg",
"shrineProductWhitePinstripeShirt": "Fehér csíkos ing",
"demoTextFieldWhereCanWeReachYou": "Hol tudjuk elérni Önt?",
"settingsTextDirectionLTR": "Balról jobbra",
"settingsTextScalingLarge": "Nagy",
"demoBottomSheetHeader": "Fejléc",
"demoBottomSheetItem": "{value} elem",
"demoBottomTextFieldsTitle": "Szövegmezők",
"demoTextFieldTitle": "Szövegmezők",
"demoTextFieldSubtitle": "Egy sornyi szerkeszthető szöveg és számok",
"demoTextFieldDescription": "A szöveges mezők segítségével a felhasználók szöveget adhatnak meg egy kezelőfelületen. Jellemzően az űrlapokon és párbeszédpanelekben jelennek meg.",
"demoTextFieldShowPasswordLabel": "Jelszó megjelenítése",
"demoTextFieldHidePasswordLabel": "Jelszó elrejtése",
"demoTextFieldFormErrors": "Kérjük, javítsa ki a piros színű hibákat a beküldés előtt.",
"demoTextFieldNameRequired": "A név megadása kötelező.",
"demoTextFieldOnlyAlphabeticalChars": "Kérjük, csak az ábécé karaktereit használja.",
"demoTextFieldEnterUSPhoneNumber": "(###) ###-#### – Adjon meg egy USA-beli telefonszámot.",
"demoTextFieldEnterPassword": "Írjon be egy jelszót.",
"demoTextFieldPasswordsDoNotMatch": "A jelszavak nem egyeznek meg",
"demoTextFieldWhatDoPeopleCallYou": "Hogyan hívhatják Önt?",
"demoTextFieldNameField": "Név*",
"demoBottomSheetButtonText": "ALSÓ LAP MEGJELENÍTÉSE",
"demoTextFieldPhoneNumber": "Telefonszám*",
"demoBottomSheetTitle": "Alsó lap",
"demoTextFieldEmail": "E-mail-cím",
"demoTextFieldTellUsAboutYourself": "Beszéljen magáról (pl. írja le, hogy mivel foglalkozik vagy mik a hobbijai)",
"demoTextFieldKeepItShort": "Legyen rövid, ez csak egy demó.",
"starterAppGenericButton": "GOMB",
"demoTextFieldLifeStory": "Élettörténet",
"demoTextFieldSalary": "Fizetés",
"demoTextFieldUSD": "USD",
"demoTextFieldNoMoreThan": "Nem lehet több 8 karakternél.",
"demoTextFieldPassword": "Jelszó*",
"demoTextFieldRetypePassword": "Írja be újra a jelszót*",
"demoTextFieldSubmit": "KÜLDÉS",
"demoBottomNavigationSubtitle": "Alsó navigáció halványuló nézetekkel",
"demoBottomSheetAddLabel": "Hozzáadás",
"demoBottomSheetModalDescription": "A modális alsó lap a menü és a párbeszédpanel alternatívája, és segítségével megakadályozható, hogy a felhasználó az alkalmazás többi részét használja.",
"demoBottomSheetModalTitle": "Modális alsó lap",
"demoBottomSheetPersistentDescription": "Az állandó alsó lap olyan információkat jelenít meg, amelyek kiegészítik az alkalmazás elsődleges tartalmát. Az állandó alsó lap még akkor is látható marad, amikor a felhasználó az alkalmazás más részeit használja.",
"demoBottomSheetPersistentTitle": "Állandó alsó lap",
"demoBottomSheetSubtitle": "Állandó és modális alsó lapok",
"demoTextFieldNameHasPhoneNumber": "{name} telefonszáma: {phoneNumber}",
"buttonText": "GOMB",
"demoTypographyDescription": "Az anyagszerű megjelenésben található különböző tipográfiai stílusok meghatározásai.",
"demoTypographySubtitle": "Az előre meghatározott szövegstílusok mindegyike",
"demoTypographyTitle": "Tipográfia",
"demoFullscreenDialogDescription": "A fullscreenDialog tulajdonság határozza meg, hogy az érkezési oldal teljes képernyős moduláris párbeszédpanel-e",
"demoFlatButtonDescription": "Egy lapos gomb megnyomásakor megjelenik rajta egy tintafolt, de nem emelkedik fel. Lapos gombokat használhat eszköztárakban, párbeszédpaneleken és kitöltéssel szövegen belül is",
"demoBottomNavigationDescription": "Az alsó navigációs sávon három-öt célhely jelenik meg a képernyő alján. Minden egyes célhelyet egy ikon és egy nem kötelező szöveges címke jelöl. Amikor rákoppint egy alsó navigációs ikonra, a felhasználó az adott ikonhoz kapcsolódó legfelső szintű navigációs célhelyre kerül.",
"demoBottomNavigationSelectedLabel": "Kiválasztott címke",
"demoBottomNavigationPersistentLabels": "Állandó címkék",
"starterAppDrawerItem": "{value} elem",
"demoTextFieldRequiredField": "* kötelező mezőt jelöl",
"demoBottomNavigationTitle": "Alsó navigáció",
"settingsLightTheme": "Világos",
"settingsTheme": "Téma",
"settingsPlatformIOS": "iOS",
"settingsPlatformAndroid": "Android",
"settingsTextDirectionRTL": "Jobbról balra",
"settingsTextScalingHuge": "Óriási",
"cupertinoButton": "Gomb",
"settingsTextScalingNormal": "Normál",
"settingsTextScalingSmall": "Kicsi",
"settingsSystemDefault": "Rendszer",
"settingsTitle": "Beállítások",
"rallyDescription": "Személyes pénzügyi alkalmazás",
"aboutDialogDescription": "Az alkalmazás forráskódjának megtekintéséhez keresse fel a következőt: {repoLink}.",
"bottomNavigationCommentsTab": "Megjegyzések",
"starterAppGenericBody": "Szövegtörzs",
"starterAppGenericHeadline": "Címsor",
"starterAppGenericSubtitle": "Alcím",
"starterAppGenericTitle": "Cím",
"starterAppTooltipSearch": "Keresés",
"starterAppTooltipShare": "Megosztás",
"starterAppTooltipFavorite": "Hozzáadás a Kedvencekhez",
"starterAppTooltipAdd": "Hozzáadás",
"bottomNavigationCalendarTab": "Naptár",
"starterAppDescription": "Interaktív kezdő elrendezés",
"starterAppTitle": "Kezdőalkalmazás",
"aboutFlutterSamplesRepo": "Flutter-minták GitHub-adattára",
"bottomNavigationContentPlaceholder": "Helyőrző a(z) {title} lapnak",
"bottomNavigationCameraTab": "Kamera",
"bottomNavigationAlarmTab": "Ébresztés",
"bottomNavigationAccountTab": "Fiók",
"demoTextFieldYourEmailAddress": "Az Ön e-mail-címe",
"demoToggleButtonDescription": "A váltógombok kapcsolódó lehetőségek csoportosításához használhatók. A kapcsolódó váltógombok csoportjának kiemeléséhez a csoportnak közös tárolón kell osztoznia",
"colorsGrey": "SZÜRKE",
"colorsBrown": "BARNA",
"colorsDeepOrange": "MÉLYNARANCSSÁRGA",
"colorsOrange": "NARANCSSÁRGA",
"colorsAmber": "BOROSTYÁNSÁRGA",
"colorsYellow": "SÁRGA",
"colorsLime": "CITROMZÖLD",
"colorsLightGreen": "VILÁGOSZÖLD",
"colorsGreen": "ZÖLD",
"homeHeaderGallery": "Galéria",
"homeHeaderCategories": "Kategóriák",
"shrineDescription": "Divatos kiskereskedelmi alkalmazás",
"craneDescription": "Személyre szabott utazási alkalmazás",
"homeCategoryReference": "STÍLUSOK ÉS EGYÉB",
"demoInvalidURL": "Nem sikerült a következő URL megjelenítése:",
"demoOptionsTooltip": "Lehetőségek",
"demoInfoTooltip": "Információ",
"demoCodeTooltip": "Demókód",
"demoDocumentationTooltip": "API-dokumentáció",
"demoFullscreenTooltip": "Teljes képernyő",
"settingsTextScaling": "Szöveg nagyítása",
"settingsTextDirection": "Szövegirány",
"settingsLocale": "Nyelv- és országkód",
"settingsPlatformMechanics": "Platformmechanika",
"settingsDarkTheme": "Sötét",
"settingsSlowMotion": "Lassított felvétel",
"settingsAbout": "A Flutter galériáról",
"settingsFeedback": "Visszajelzés küldése",
"settingsAttribution": "Tervezte: TOASTER, London",
"demoButtonTitle": "Gombok",
"demoButtonSubtitle": "Szöveg, kiemelkedő, körülrajzolt és egyebek",
"demoFlatButtonTitle": "Lapos gomb",
"demoRaisedButtonDescription": "A kiemelkedő gombok térbeli kiterjedést adnak az általában lapos külsejű gomboknak. Alkalmasak a funkciók kiemelésére zsúfolt vagy nagy területeken.",
"demoRaisedButtonTitle": "Kiemelkedő gomb",
"demoOutlineButtonTitle": "Körülrajzolt gomb",
"demoOutlineButtonDescription": "A körülrajzolt gombok átlátszatlanok és kiemelkedők lesznek, ha megnyomják őket. Gyakran kapcsolódnak kiemelkedő gombokhoz, hogy alternatív, másodlagos műveletet jelezzenek.",
"demoToggleButtonTitle": "Váltógombok",
"colorsTeal": "PÁVAKÉK",
"demoFloatingButtonTitle": "Lebegő műveletgomb",
"demoFloatingButtonDescription": "A lebegő műveletgomb egy olyan kerek ikongomb, amely a tartalom fölött előugorva bemutat egy elsődleges műveletet az alkalmazásban.",
"demoDialogTitle": "Párbeszédpanelek",
"demoDialogSubtitle": "Egyszerű, értesítő és teljes képernyős",
"demoAlertDialogTitle": "Értesítés",
"demoAlertDialogDescription": "Egy párbeszédpanel tájékoztatja a felhasználót a figyelmét igénylő helyzetekről. Az értesítési párbeszédpanel nem kötelező címmel és nem kötelező műveletlistával rendelkezik.",
"demoAlertTitleDialogTitle": "Értesítés címmel",
"demoSimpleDialogTitle": "Egyszerű",
"demoSimpleDialogDescription": "Egy egyszerű párbeszédpanel választást kínál a felhasználónak több lehetőség közül. Az egyszerű párbeszédpanel nem kötelező címmel rendelkezik, amely a választási lehetőségek felett jelenik meg.",
"demoFullscreenDialogTitle": "Teljes képernyő",
"demoCupertinoButtonsTitle": "Gombok",
"demoCupertinoButtonsSubtitle": "iOS-stílusú gombok",
"demoCupertinoButtonsDescription": "iOS-stílusú gomb. Érintésre megjelenő és eltűnő szöveget és/vagy ikont foglal magában. Tetszés szerint rendelkezhet háttérrel is.",
"demoCupertinoAlertsTitle": "Értesítések",
"demoCupertinoAlertsSubtitle": "iOS-stílusú értesítési párbeszédpanelek",
"demoCupertinoAlertTitle": "Figyelmeztetés",
"demoCupertinoAlertDescription": "Egy párbeszédpanel tájékoztatja a felhasználót a figyelmét igénylő helyzetekről. Az értesítési párbeszédpanel nem kötelező címmel, nem kötelező tartalommal és nem kötelező műveletlistával rendelkezik. A cím a tartalom felett, a műveletek pedig a tartalom alatt jelennek meg.",
"demoCupertinoAlertWithTitleTitle": "Értesítés címmel",
"demoCupertinoAlertButtonsTitle": "Értesítés gombokkal",
"demoCupertinoAlertButtonsOnlyTitle": "Csak értesítőgombok",
"demoCupertinoActionSheetTitle": "Műveleti munkalap",
"demoCupertinoActionSheetDescription": "A műveleti lapok olyan speciális stílusú értesítések, amelyek két vagy több választást biztosítanak a felhasználónak az adott kontextusban. A műveleti lapnak lehet címe, további üzenete és műveleti listája.",
"demoColorsTitle": "Színek",
"demoColorsSubtitle": "Az összes előre definiált szín",
"demoColorsDescription": "Színek és állandó színkorongok, amelyek az anyagszerű megjelenés színpalettáját képviselik.",
"buttonTextEnabled": "ENABLED",
"buttonTextDisabled": "DISABLED",
"buttonTextCreate": "Létrehozás",
"dialogSelectedOption": "Az Ön által választott érték: „{value}”",
"dialogDiscardTitle": "Elveti a piszkozatot?",
"dialogLocationTitle": "Használni kívánja a Google Helyszolgáltatásokat?",
"dialogLocationDescription": "Hagyja, hogy a Google segítsen az alkalmazásoknak a helymeghatározásban. Ez névtelen helyadatok küldését jelenti a Google-nak, még akkor is, ha egyetlen alkalmazás sem fut.",
"dialogCancel": "MÉGSE",
"dialogDiscard": "ELVETÉS",
"dialogDisagree": "ELUTASÍTOM",
"dialogAgree": "ELFOGADOM",
"dialogSetBackup": "Helyreállítási fiók beállítása",
"colorsBlueGrey": "KÉKESSZÜRKE",
"dialogShow": "PÁRBESZÉDPANEL MEGJELENÍTÉSE",
"dialogFullscreenTitle": "Teljes képernyős párbeszédpanel",
"dialogFullscreenSave": "MENTÉS",
"dialogFullscreenDescription": "Teljes képernyős párbeszédpanel demója",
"cupertinoButtonEnabled": "Enabled",
"cupertinoButtonDisabled": "Disabled",
"cupertinoButtonWithBackground": "Háttérrel",
"cupertinoAlertCancel": "Mégse",
"cupertinoAlertDiscard": "Elvetés",
"cupertinoAlertLocationTitle": "Engedélyezi a „Térkép” számára a hozzáférést tartózkodási helyéhez, amíg az alkalmazást használja?",
"cupertinoAlertLocationDescription": "Aktuális tartózkodási helye megjelenik a térképen, és a rendszer felhasználja az útvonaltervekhez, a közelben lévő keresési eredményekhez és a becsült utazási időkhöz.",
"cupertinoAlertAllow": "Engedélyezés",
"cupertinoAlertDontAllow": "Tiltás",
"cupertinoAlertFavoriteDessert": "Kedvenc desszert kiválasztása",
"cupertinoAlertDessertDescription": "Válaszd ki kedvenc desszertfajtádat az alábbi listából. A kiválasztott ételek alapján a rendszer személyre szabja a közeli étkezési lehetőségek javasolt listáját.",
"cupertinoAlertCheesecake": "Sajttorta",
"cupertinoAlertTiramisu": "Tiramisu",
"cupertinoAlertApplePie": "Almás pite",
"cupertinoAlertChocolateBrownie": "Csokoládés brownie",
"cupertinoShowAlert": "Értesítés megjelenítése",
"colorsRed": "PIROS",
"colorsPink": "RÓZSASZÍN",
"colorsPurple": "LILA",
"colorsDeepPurple": "MÉLYLILA",
"colorsIndigo": "INDIGÓKÉK",
"colorsBlue": "KÉK",
"colorsLightBlue": "VILÁGOSKÉK",
"colorsCyan": "ZÖLDESKÉK",
"dialogAddAccount": "Fiók hozzáadása",
"Gallery": "Galéria",
"Categories": "Kategóriák",
"SHRINE": "SHRINE",
"Basic shopping app": "Alap vásárlási alkalmazás",
"RALLY": "RALLY",
"CRANE": "CRANE",
"Travel app": "Utazási alkalmazás",
"MATERIAL": "MATERIAL",
"CUPERTINO": "CUPERTINO",
"REFERENCE STYLES & MEDIA": "REFERENCIASTÍLUSOK ÉS MÉDIA"
}
| gallery/lib/l10n/intl_hu.arb/0 | {
"file_path": "gallery/lib/l10n/intl_hu.arb",
"repo_id": "gallery",
"token_count": 24316
} | 811 |
{
"notSelected": "തിരഞ്ഞെടുത്തില്ല",
"deselect": "തിരഞ്ഞെടുത്തത് മാറ്റുക",
"select": "തിരഞ്ഞെടുക്കുക",
"selectable": "തിരഞ്ഞെടുക്കാവുന്നത് (ദീർഘനേരം അമർത്തുക)",
"selected": "തിരഞ്ഞെടുത്തു",
"demo": "ഡെമോ",
"bottomAppBar": "ചുവടെയുള്ള ആപ്പ് ബാർ",
"loading": "ലോഡ് ചെയ്യുന്നു",
"demoCupertinoScrollbarDescription": "നൽകിയിരിക്കുന്ന ചൈൽഡിനെ റാപ്പ് ചെയ്യുന്ന സ്ക്രോൾ ബാർ",
"demoCupertinoPicker": "പിക്കർ",
"demoCupertinoSearchTextFieldSubtitle": "iOS-സ്റ്റൈൽ തിരയൽ ടെക്സ്റ്റ് ഫീൽഡ്",
"demoCupertinoSearchTextFieldDescription": "ടെക്സ്റ്റ് നൽകി തിരയാൻ ഉപയോക്താക്കളെ അനുവദിക്കുന്ന, ഫിൽട്ടർ ചെയ്യുകയും നിർദ്ദേശങ്ങൾ നൽകുകയും ചെയ്യുന്ന തിരയൽ ടെക്സ്റ്റ് ഫീൽഡ്.",
"demoCupertinoSearchTextFieldPlaceholder": "കുറച്ച് ടെക്സ്റ്റ് നൽകുക",
"demoCupertinoScrollbarTitle": "സ്ക്രോൾ ബാർ",
"demoCupertinoScrollbarSubtitle": "iOS-സ്റ്റൈൽ സ്ക്രോൾ ബാർ",
"demoCupertinoSearchTextFieldTitle": "തിരയൽ ടെക്സ്റ്റ് ഫീൽഡ്",
"demoTwoPaneItemDetails": "ഇനത്തിന്റെ {value} വിശദാംശങ്ങൾ",
"demoTwoPaneList": "ലിസ്റ്റ്",
"demoTwoPaneFoldableLabel": "ഫോൾഡ് ചെയ്യാവുന്നത്",
"demoTwoPaneSmallScreenLabel": "ചെറിയ സ്ക്രീൻ",
"demoTwoPaneSmallScreenDescription": "ചെറിയ സ്ക്രീനുള്ള ഉപകരണത്തിൽ ഇപ്രകാരമാണ് TwoPane പ്രവർത്തിക്കുന്നത്.",
"demoTwoPaneTabletLabel": "ടാബ്ലെറ്റ് / ഡെസ്ക്ടോപ്പ്",
"demoTwoPaneTabletDescription": "ടാബ്ലെറ്റിലോ ഡെസ്ക്ടോപ്പിലോ ഇപ്രകാരമാണ് TwoPane പ്രവർത്തിക്കുന്നത്.",
"demoTwoPaneTitle": "TwoPane",
"demoTwoPaneSubtitle": "ഫോൾഡ് ചെയ്യാവുന്നതും വലുപ്പം കൂടിയതും കുറഞ്ഞതുമായ സ്ക്രീനുകളിലെ റെസ്പോൺസീവ് ലേയൗട്ടുകൾ",
"splashSelectDemo": "ഒരു ഡെമോ തിരഞ്ഞെടുക്കുക",
"demoTwoPaneFoldableDescription": "ഫോൾഡ് ചെയ്യാവുന്ന ഉപകരണത്തിൽ ഇപ്രകാരമാണ് TwoPane പ്രവർത്തിക്കുന്നത്.",
"demoTwoPaneDetails": "വിശദാംശങ്ങൾ",
"demoTwoPaneSelectItem": "ഒരു ഇനം തിരഞ്ഞെടുക്കുക",
"demoTwoPaneItem": "ഇനം {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": "ഡെസെർട്ട് റെസിപ്പി",
"demoSharedYAxisAlbumTileDurationUnit": "മിനിറ്റ്",
"demoSharedYAxisAlbumTileSubtitle": "ആർട്ടിസ്റ്റ്",
"demoSharedYAxisAlbumTileTitle": "ആൽബം",
"demoSharedYAxisRecentSortTitle": "അടുത്തിടെ പ്ലേ ചെയ്തത്",
"demoSharedYAxisAlphabeticalSortTitle": "A-Z",
"demoSharedYAxisAlbumCount": "268 ആൽബങ്ങൾ",
"demoSharedYAxisTitle": "y-അക്ഷം പങ്കിട്ടു",
"demoSharedXAxisCreateAccountButtonText": "അക്കൗണ്ട് സൃഷ്ടിക്കുക",
"demoFadeScaleAlertDialogDiscardButton": "ഉപേക്ഷിക്കുക",
"demoSharedXAxisSignInTextFieldLabel": "ഇമെയിൽ അല്ലെങ്കിൽ ഫോൺ നമ്പർ",
"demoSharedXAxisSignInSubtitleText": "നിങ്ങളുടെ അക്കൗണ്ട് ഉപയോഗിച്ച് സൈൻ ഇൻ ചെയ്യുക",
"demoSharedXAxisSignInWelcomeText": "ഹായ് David Park",
"demoSharedXAxisIndividualCourseSubtitle": "വ്യക്തിഗതമായി കാണിച്ചിരിക്കുന്നു",
"demoFadeThroughAlbumsDestination": "ആൽബങ്ങൾ",
"demoSharedXAxisCulinaryCourseTitle": "പാചകസംബന്ധമായത്",
"demoSharedXAxisDesignCourseTitle": "ഡിസൈൻ",
"demoSharedXAxisIllustrationCourseTitle": "ചിത്രീകരണം",
"demoSharedXAxisBusinessCourseTitle": "ബിസിനസ്",
"demoMotionPlaceholderSubtitle": "ദ്വിതീയ ടെക്സ്റ്റ്",
"demoFadeScaleAlertDialogCancelButton": "റദ്ദാക്കുക",
"demoFadeScaleAlertDialogHeader": "മുന്നറിയിപ്പ് ഡയലോഗ്",
"demoFadeScaleHideFabButton": "FAB മറയ്ക്കുക",
"demoFadeScaleShowFabButton": "FAB കാണിക്കുക",
"demoFadeScaleShowAlertDialogButton": "മോഡൽ കാണിക്കുക",
"demoFadeScaleDescription": "സ്ക്രീനിന്റെ മധ്യത്തിൽ വന്ന് ക്രമേണ മങ്ങിപ്പോകുന്ന ഡയലോഗ് ബോക്സ് പോലെ, സ്ക്രീൻ പരിധിക്കുള്ളിൽ ചേരുകയും പുറത്ത് പോകുകയും ചെയ്യുന്ന UI ഘടകങ്ങൾക്കായാണ് ഫേഡ് പാറ്റേൺ ഉപയോഗിക്കുന്നത്.",
"demoFadeScaleTitle": "ഫേഡ്",
"demoFadeThroughTextPlaceholder": "123 ഫോട്ടോകൾ",
"demoFadeThroughSearchDestination": "Search",
"demoFadeThroughPhotosDestination": "Photos",
"demoSharedXAxisArtsAndCraftsCourseTitle": "കരകൗശല വിദ്യകൾ",
"demoFadeThroughDescription": "പരസ്പരം ദൃഢമായ ബന്ധമില്ലാത്ത UI ഘടകങ്ങൾ തമ്മിലുള്ള പരിവർത്തനത്തിനായാണ് ഫേഡ് ത്രൂ പാറ്റേൺ ഉപയോഗിക്കുന്നത്.",
"demoFadeThroughTitle": "ഫേഡ് ത്രൂ",
"demoSharedZAxisHelpSettingLabel": "സഹായം",
"demoSharedZAxisPrivacySettingLabel": "സ്വകാര്യത",
"demoMotionSubtitle": "മൂൻകൂട്ടി നിശ്ചയിച്ച എല്ലാ ട്രാൻസിഷൻ പാറ്റേണുകളും",
"demoSharedZAxisProfileSettingLabel": "പ്രൊഫൈൽ",
"demoSharedZAxisSavedRecipesListTitle": "സംരക്ഷിച്ച റെസിപ്പികൾ",
"demoSharedZAxisBeefSandwichRecipeDescription": "ബീഫ് സാൻഡ്വിച്ച് റെസിപ്പി",
"demoSharedXAxisCoursePageSubtitle": "ബണ്ടിൽ ചെയ്ത വിഭാഗങ്ങൾ നിങ്ങളുടെ ഫീഡിൽ ഗ്രൂപ്പുകളായി ദൃശ്യമാകുന്നു. നിങ്ങൾക്കിത് പിന്നീട് എപ്പോൾ വേണമെങ്കിലും മാറ്റാം.",
"demoSharedZAxisCrabPlateRecipeDescription": "ഞണ്ട് കറി റെസിപ്പി",
"demoSharedZAxisCrabPlateRecipeTitle": "ഞണ്ട്",
"demoSharedZAxisShrimpPlateRecipeDescription": "ചെമ്മീൻ കറി റെസിപ്പി",
"demoSharedZAxisShrimpPlateRecipeTitle": "ചെമ്മീൻ",
"demoMotionPlaceholderTitle": "പേര്",
"demoSharedZAxisDessertRecipeTitle": "ഡെസെർട്ട്",
"demoSharedZAxisSandwichRecipeDescription": "സാൻഡ്വിച്ച് റെസിപ്പി",
"demoSharedZAxisSandwichRecipeTitle": "സാൻഡ്വിച്ച്",
"demoSharedZAxisBurgerRecipeDescription": "ബർഗർ റെസിപ്പി",
"demoSharedZAxisBurgerRecipeTitle": "ബർഗർ",
"demoSharedZAxisSettingsPageTitle": "ക്രമീകരണം",
"demoSharedZAxisNotificationSettingLabel": "അറിയിപ്പുകൾ",
"demoMotionTitle": "ചലനാത്മകത",
"demoContainerTransformTitle": "കണ്ടെയ്നർ ട്രാൻസ്ഫോം",
"demoContainerTransformDescription": "കണ്ടെയ്നർ ഉൾപ്പെടുന്ന UI ഘടകങ്ങൾ തമ്മിലുള്ള പരിവർത്തനത്തിനായാണ് കണ്ടെയ്നർ ട്രാൻസ്ഫോം പാറ്റേൺ രൂപകൽപ്പന ചെയ്തിരിക്കുന്നത്. രണ്ട് UI ഘടകങ്ങൾക്കിടയിൽ കാണാനാകുന്ന തരത്തിലുള്ള ഒരു കണക്ഷൻ ഈ പാറ്റേൺ സൃഷ്ടിക്കുന്നു",
"demoContainerTransformModalBottomSheetTitle": "ഫേഡ് മോഡ്",
"demoContainerTransformTypeFade": "ഫേഡ്",
"demoContainerTransformTypeFadeThrough": "ഫേഡ് ത്രൂ",
"demoSharedZAxisTitle": "z-അക്ഷം പങ്കിട്ടു",
"demoSharedXAxisForgotEmailButtonText": "ഇമെയിൽ മറന്നോ?",
"demoMotionSmallPlaceholderSubtitle": "ദ്വിതീയം",
"demoMotionDetailsPageTitle": "വിശദാംശങ്ങൾ പേജ്",
"demoMotionListTileTitle": "ലിസ്റ്റ് ഇനം",
"demoSharedAxisDescription": "സ്ഥല സംബന്ധമായോ നവിഗേഷൻ സംബന്ധമായോ ബന്ധമുള്ള UI ഘടകങ്ങൾ തമ്മിലുള്ള പരിവർത്തനത്തിനായാണ് പങ്കിട്ട ആക്സിസ് പാറ്റേൺ ഉപയോഗിക്കുന്നത്. ഘടകങ്ങൾ തമ്മിലുള്ള ബന്ധം പുനഃസ്ഥാപിക്കുന്നതിന് ഈ പാറ്റേൺ, x, y, z അക്ഷത്തിൽ ഒരു പങ്കിടൽ പരിവർത്തന രീതി ഉപയോഗിക്കുന്നു.",
"demoSharedXAxisTitle": "പങ്കിട്ട x-അക്ഷം",
"demoSharedXAxisBackButtonText": "മടങ്ങുക",
"demoSharedXAxisNextButtonText": "അടുത്തത്",
"demoSharedXAxisCoursePageTitle": "നിങ്ങളുടെ മുന്നോട്ട് പോകലിന് രൂപം നൽകൂ",
"demoSharedXAxisBundledCourseSubtitle": "ബണ്ടിൽ ചെയ്തു",
"githubRepo": "{repoName} GitHub കലവറ",
"fortnightlyMenuUS": "യുഎസ്",
"fortnightlyMenuBusiness": "ബിസിനസ്",
"fortnightlyMenuScience": "ശാസ്ത്രം",
"fortnightlyMenuSports": "സ്പോർട്സ്",
"fortnightlyMenuTravel": "യാത്ര",
"fortnightlyMenuCulture": "സംസ്കാരം",
"fortnightlyTrendingTechDesign": "TechDesign",
"rallyBudgetDetailAmountLeft": "ശേഷിക്കുന്ന തുക",
"fortnightlyHeadlineArmy": "ഗ്രീൻ ആർമിയെ അകത്തുനിന്നും പരിഷ്ക്കരിക്കൽ",
"rallyBillDetailTotalAmount": "മൊത്തം തുക",
"fortnightlyDescription": "ഉള്ളടക്കം കേന്ദ്രീകരിച്ചുള്ള വാർത്താ ആപ്പ്",
"rallyBudgetDetailTotalCap": "മൊത്തം തുകയുടെ പരിധി",
"rallyBudgetDetailAmountUsed": "ഉപയോഗിച്ച തുക",
"fortnightlyTrendingHealthcareRevolution": "HealthcareRevolution",
"fortnightlyMenuFrontPage": "മുൻ പേജ്",
"fortnightlyMenuWorld": "ലോകം",
"rallyBillDetailAmountDue": "അടയ്ക്കേണ്ട തുക",
"fortnightlyMenuPolitics": "രാഷ്ട്രീയം",
"fortnightlyHeadlineBees": "ഫാംലാൻഡ് തേനീച്ചകൾ കിട്ടാനില്ല",
"fortnightlyHeadlineGasoline": "പെട്രോളിന്റെ ഭാവി",
"fortnightlyTrendingGreenArmy": "GreenArmy",
"fortnightlyHeadlineFeminists": "കക്ഷിപക്ഷപാതത്തെക്കുറിച്ച് ഫെമിനിസ്റ്റുകളുടെ അഭിപ്രായം",
"fortnightlyHeadlineFabrics": "അത്യാധുനിക ഫാബ്രിക്കുകൾ നിർമ്മിക്കാൻ സാങ്കേതികവിദ്യകൾ ഉപയോഗിച്ച് ഡിസെെനർമാർ",
"fortnightlyHeadlineStocks": "ഓഹരികളുടെ സ്തംഭനം, എല്ലാവരുടെയും കണ്ണ് കറൻസിയിൽ",
"fortnightlyTrendingReform": "Reform",
"fortnightlyMenuTech": "സാങ്കേതികവിദ്യ",
"fortnightlyHeadlineWar": "യുദ്ധകാലത്ത് വിഭജിക്കപ്പെട്ട അമേരിക്കൻ ജീവിതങ്ങൾ",
"fortnightlyHeadlineHealthcare": "ശാന്തവും എന്നാൽ ശക്തവുമായ ആരോഗ്യ പരിപാലന വിപ്ലവം",
"fortnightlyLatestUpdates": "ഏറ്റവും പുതിയ അപ്ഡേറ്റുകൾ",
"fortnightlyTrendingStocks": "ഓഹരികൾ",
"rallyBillDetailAmountPaid": "അടച്ച തുക",
"demoCupertinoPickerDateTime": "തീയതിയും സമയവും",
"bannerDemoResetText": "ബാനർ റീസെറ്റ് ചെയ്യുക",
"dataTableRowWithHoney": "{value} തേൻ ചേർത്തത്",
"bannerDemoText": "നിങ്ങളുടെ പാസ്വേഡ് നിങ്ങളുടെ മറ്റ് ഉപകരണത്തിൽ അപ്ഡേറ്റ് ചെയ്തു. ദയവായി വീണ്ടും സൈൻ ഇൻ ചെയ്യുക.",
"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": "കാൽസ്യം (%)",
"demoDatePickerTitle": "തീയതി പിക്കർ",
"demo2dTransformationsResetTooltip": "പരിവർത്തനങ്ങൾ റീസെറ്റ് ചെയ്യുക",
"dataTableColumnCarbs": "കാർബോഹൈഡ്രേറ്റുകൾ (ഗ്രാം)",
"dataTableColumnFat": "കൊഴുപ്പ് (ഗ്രാം)",
"dataTableColumnCalories": "കലോറികൾ",
"cardsDemoTravelDestinationTitle2": "തെക്കൻ ഇന്ത്യയിൽ നിന്നുള്ള കരകൗശല വിദഗ്ദ്ധർ",
"demoDatePickerDescription": "മെറ്റീരിയൽ രൂപകൽപ്പനാ തീയതി പിക്കർ അടങ്ങിയ ഡയലോഗ് കാണിക്കുന്നു.",
"demoTimePickerTitle": "സമയ പിക്കർ",
"demoTimePickerDescription": "മെറ്റീരിയൽ രൂപകൽപ്പനാ സമയ പിക്കർ അടങ്ങിയ ഡയലോഗ് കാണിക്കുന്നു.",
"demoPickersShowPicker": "പിക്കർ കാണിക്കുക",
"demoTabsScrollingTitle": "സ്ക്രോൾ ചെയ്യാവുന്നത്",
"demoTabsNonScrollingTitle": "സ്ക്രോൾ ചെയ്യാനാവാത്തത്",
"craneHours": "{hours,plural,=1{ഒരു മണിക്കൂർ}other{{hours}മണിക്കൂർ}}",
"craneMinutes": "{minutes,plural,=1{ഒരു മിനിറ്റ്}other{{minutes}മിനിറ്റ്}}",
"craneFlightDuration": "{hoursShortForm} {minutesShortForm}",
"dataTableColumnDessert": "ഡിസേർട്ട് (ഒരെണ്ണം നൽകുന്നു)",
"demoPickersTitle": "പിക്കറുകൾ",
"demo2dTransformationsEditTooltip": "ടൈൽ എഡിറ്റ് ചെയ്യുക",
"dataTableHeader": "പോഷകാഹാരം",
"demo2dTransformationsDescription": "ടൈലുകൾ എഡിറ്റ് ചെയ്യാൻ ടാപ്പ് ചെയ്യുക, ഒപ്പം സീനിന് ചുറ്റും നീക്കുന്നതിന് വിരൽചലനങ്ങൾ ഉപയോഗിക്കുക. പാൻ ചെയ്യാൻ വലിച്ചിടുക, സൂം ചെയ്യാൻ പിഞ്ച് ചെയ്യുക, രണ്ട് വിരലുകൾ ഉപയോഗിച്ച് റൊട്ടേറ്റ് ചെയ്യുക. ആരംഭ ഓറിയന്റേഷനിലേക്ക് മടങ്ങാൻ റീസെറ്റ് ബട്ടൺ അമർത്തുക.",
"demo2dTransformationsSubtitle": "പാൻ ചെയ്യുക, സൂം ചെയ്യുക, റൊട്ടേറ്റ് ചെയ്യുക",
"demo2dTransformationsTitle": "2D പരിവർത്തനം",
"demoCupertinoTextFieldPIN": "പിൻ",
"demoCupertinoTextFieldDescription": "ഒന്നുകിൽ ഹാർഡ്വെയർ കീബോർഡ് ഉപയോഗിച്ച് അല്ലെങ്കിൽ ഓൺ സ്ക്രീൻ കീബോർഡ് ഉപയോഗിച്ച് ടെക്സ്റ്റ് നൽകാൻ ടെക്സ്റ്റ് ഫീൽഡ് ഉപയോക്താവിനെ അനുവദിക്കുന്നു.",
"demoCupertinoTextFieldSubtitle": "iOS-സ്റ്റെെലിലുള്ള ടെക്സ്റ്റ് ഫീൽഡുകൾ",
"demoCupertinoTextFieldTitle": "ടെക്സ്റ്റ് ഫീൽഡുകൾ",
"demoPickersSubtitle": "തീയതിയും സമയവും തിരഞ്ഞെടുക്കൽ",
"demoCupertinoPickerTime": "സമയം",
"demoCupertinoPickerDate": "തീയതി",
"demoCupertinoPickerTimer": "ടൈമർ",
"demoCupertinoPickerDescription": "സ്ട്രിംഗുകൾ, തീയതി, സമയം, അല്ലെങ്കിൽ അവ രണ്ടും തിരഞ്ഞെടുക്കാൻ ഉപയോഗിക്കാവുന്ന iOS-സ്റ്റെെലിലുള്ള പിക്കർ വിജറ്റ്.",
"demoCupertinoPickerSubtitle": "iOS-സ്റ്റൈൽ പിക്കറുകൾ",
"dataTableRowWithSugar": "{value} പഞ്ചസാര ചേർത്തത്",
"signIn": "സൈൻ ഇൻ ചെയ്യുക",
"cardsDemoTravelDestinationLocation2": "ശിവഗംഗ, തമിഴ്നാട്",
"bannerDemoMultipleText": "ഒന്നിലധികം നടപടികൾ",
"bannerDemoLeadingText": "മുൻനിര ഐക്കൺ",
"dismiss": "ഡിസ്മിസ് ചെയ്യുക",
"cardsDemoTappable": "ടാപ്പ് ചെയ്യാവുന്നത്",
"cardsDemoSelectable": "തിരഞ്ഞെടുക്കാവുന്നത് (ദീർഘനേരം അമർത്തുക)",
"cardsDemoExplore": "അടുത്തറിയുക",
"cardsDemoExploreSemantics": "{destinationName} അടുത്തറിയുക",
"cardsDemoShareSemantics": "{destinationName} പങ്കിടുക",
"cardsDemoTravelDestinationTitle1": "തമിഴ്നാട്ടിൽ സന്ദർശിക്കേണ്ട മികച്ച 10 നഗരങ്ങൾ",
"cardsDemoTravelDestinationDescription1": "നമ്പർ 10",
"cardsDemoTravelDestinationCity1": "തഞ്ചാവൂർ",
"cardsDemoTravelDestinationLocation1": "തഞ്ചാവൂർ, തമിഴ്നാട്",
"dataTableColumnSodium": "സോഡിയം (മില്ലിഗ്രാം)",
"cardsDemoTravelDestinationDescription2": "പട്ട് നൂൽക്കുന്നവർ",
"cardsDemoTravelDestinationCity2": "ചെട്ടിനാട്",
"demoCupertinoPickerTitle": "പിക്കറുകൾ",
"cardsDemoTravelDestinationTitle3": "ബൃഹദീശ്വര ക്ഷേത്രം",
"cardsDemoTravelDestinationDescription3": "ക്ഷേത്രങ്ങൾ",
"demoBannerTitle": "ബാനർ",
"demoBannerSubtitle": "ലിസ്റ്റിനുള്ളിലെ ബാനർ പ്രദർശിപ്പിക്കുന്നു",
"demoBannerDescription": "പ്രധാനപ്പെട്ടതും സംക്ഷിപ്തവുമായ സന്ദേശം ബാനർ പ്രദർശിപ്പിക്കുന്നു ഒപ്പം ഉപയോക്താക്കൾക്ക് ബാനർ അഭിമുഖീകരിക്കാൻ (അല്ലെങ്കിൽ ബാനർ ഡിസ്മിസ് ചെയ്യാൻ) നടപടികൾ നൽകുന്നു. അത് ഡിസ്മിസ് ചെയ്യാൻ ഉപയോക്തൃ നടപടി ആവശ്യമാണ്.",
"demoCardTitle": "കാർഡുകൾ",
"demoCardSubtitle": "വൃത്താകൃതിയിലുള്ള മൂലകളോട് കൂടിയ ബെയ്സ്ലെെൻ കാർഡുകൾ",
"demoCardDescription": "ആൽബം, ഭൂമിശാസ്ത്ര ലൊക്കേഷൻ, ഭക്ഷണം, കോൺടാക്റ്റ് വിശദാംശങ്ങൾ മുതലായവ പോലുള്ള അനുബന്ധ വിവരങ്ങളെ പ്രതിനിധീകരിക്കാൻ ഉപയോഗിക്കുന്ന മെറ്റീരിയലിന്റെ ഷീറ്റാണ് ഒരു കാർഡ്.",
"demoDataTableTitle": "ഡാറ്റാ പട്ടികകൾ",
"demoDataTableSubtitle": "വിവരങ്ങളുടെ വരികളും കോളങ്ങളും",
"demoDataTableDescription": "ഡാറ്റാ പട്ടികകൾ, വരികളും കോളങ്ങളും അടങ്ങിയ ഗ്രിഡ് ഫോർമാറ്റിൽ വിവരങ്ങൾ കാണിക്കുന്നു. അവ എളുപ്പം സ്കാൻ ചെയ്യാനാകുന്ന വിധം വിവരങ്ങൾ ക്രമീകരിക്കുന്നതിനാൽ ഉപയോക്താക്കൾക്ക് അതിലെ ക്രമങ്ങളും ഉൾക്കാഴ്ചകളും തിരയാനാകും.",
"dataTableColumnProtein": "പ്രോട്ടീൻ (ഗ്രാം)",
"placeChennai": "ചെന്നൈ",
"demoGridListsSubtitle": "വരിയുടെയും കോളത്തിന്റെയും ലേഔട്ട്",
"placeChettinad": "ചെട്ടിനാട്",
"placePondicherry": "പോണ്ടിച്ചേരി",
"placeFlowerMarket": "പൂ മാർക്കറ്റ്",
"placeBronzeWorks": "ബ്രോൺസ് വർക്ക്സ്",
"placeMarket": "മാർക്കറ്റ്",
"placeThanjavurTemple": "തഞ്ചാവൂർ ക്ഷേത്രം",
"placeSaltFarm": "സോൾട്ട് ഫാം",
"placeScooters": "സ്കൂട്ടറുകൾ",
"placeSilkMaker": "സിൽക്ക് മേക്കർ",
"placeLunchPrep": "ഉച്ച ഭക്ഷണത്തിനുള്ള തയ്യാറെടുപ്പ്",
"placeBeach": "കടൽത്തീരം",
"placeFisherman": "മുക്കുവൻ",
"demoMenuRemove": "നീക്കം ചെയ്യുക",
"demoMenuGetLink": "ലിങ്ക് നേടുക",
"demoMenuShare": "പങ്കിടുക",
"demoMenuPreview": "പ്രിവ്യു",
"demoMenuContextMenuItemThree": "സന്ദർഭ മെനു ഇനം മൂന്ന്",
"demoCircularProgressIndicatorDescription": "ആപ്പ് തിരക്കിലാണെന്ന് സൂചിപ്പിക്കാൻ കറങ്ങുന്ന, മെറ്റീരിയൽ രൂപകൽപ്പനയായ വൃത്താകൃതിയിലുള്ള പ്രോഗ്രസ് ഇൻഡിക്കേറ്റർ.",
"demoMenuADisabledMenuItem": "പ്രവർത്തനരഹിതമാക്കിയ മെനു ഇനം",
"demoMenuChecked": "ചെക്ക് ചെയ്തു: {value}",
"demoCustomSlidersDescription": "സ്ലെെഡറുകൾ ഒരു ബാറിലുടനീളം മൂല്യങ്ങളുടെ ഒരു ശ്രേണിയെ പ്രതിഫലിപ്പിക്കുന്നു. ആ മൂല്യങ്ങളിൽ നിന്ന് ഒന്നോ മൂല്യങ്ങളുടെ ഒരു ശ്രേണിയോ ഉപയോക്താക്കൾക്ക് തിരഞ്ഞെടുക്കാം. സ്ലെെഡറുകൾക്ക് തീം നൽകാനും അവ ഇഷ്ടാനുസൃതമാക്കാനും കഴിയും.",
"demoMenuAnItemWithASimpleMenu": "സിമ്പിൾ മെനു ഉള്ള ഒരിനം",
"demoMenuAnItemWithAChecklistMenu": "ചെക്ക്ലിസ്റ്റ് മെനു ഉള്ള ഒരിനം",
"demoCupertinoActivityIndicatorTitle": "ആക്റ്റിവിറ്റി ഇൻഡിക്കേറ്റർ",
"demoCupertinoActivityIndicatorSubtitle": "iOS-ശെെലിയിലുള്ള ആക്റ്റിവിറ്റി ഇൻഡിക്കേറ്ററുകൾ",
"demoCupertinoActivityIndicatorDescription": "ഘടികാര ദിശയിൽ കറങ്ങുന്ന, iOS-ശെെലിയിലുള്ള ഒരു ആക്റ്റിവിറ്റി ഇൻഡിക്കേറ്ററുകൾ.",
"demoCupertinoNavigationBarTitle": "നാവിഗേഷൻ ബാർ",
"demoCupertinoNavigationBarSubtitle": "iOS-സ്റ്റൈൽ നാവിഗേഷൻ ബാർ",
"demoCupertinoNavigationBarDescription": "iOS-ശെെലിയിലുള്ള നാവിഗേഷൻ ബാർ. കുറഞ്ഞ തോതിലുള്ള ഒരു പേജ് തലക്കെട്ട് ഉൾപ്പെടുന്ന ടൂൾബാർ ആണ് നാവിഗേഷൻ ബാർ.",
"demoCupertinoPullToRefreshTitle": "പുതുക്കിയെടുക്കാൻ വലിക്കുക",
"demoCupertinoPullToRefreshSubtitle": "നിയന്ത്രണം പുതുക്കിയെടുക്കാനുള്ള OS-സ്റ്റൈലിലുള്ള വലിക്കൽ",
"demoCupertinoPullToRefreshDescription": "നിയന്ത്രണം പുതുക്കിയെടുക്കാനുള്ള OS-സ്റ്റൈലിലുള്ള വലിക്കൽ നടപ്പാക്കുന്ന വിജറ്റ്.",
"demoProgressIndicatorTitle": "പ്രോഗ്രസ് ഇൻഡിക്കേറ്ററുകൾ",
"demoProgressIndicatorSubtitle": "ലീനിയർ, വൃത്താകൃതിയിലുള്ളത്, അനിശ്ചിതമായത്",
"demoCircularProgressIndicatorTitle": "വൃത്താകൃതിയിലുള്ള പ്രോഗ്രസ് ഇൻഡിക്കേറ്റർ",
"demoMenuAnItemWithAContextMenuButton": "സന്ദർഭ മെനു ഉള്ള ഒരിനം",
"demoLinearProgressIndicatorTitle": "ലീനിയർ പ്രോഗ്രസ് ഇൻഡിക്കേറ്റർ",
"demoLinearProgressIndicatorDescription": "മെറ്റീരിയൽ രൂപകൽപ്പനയായ ലീനിയർ പ്രോഗ്രസ് ഇൻഡിക്കേറ്റർ, പ്രോഗ്രസ് ബാർ എന്നും ഇതിന് പേരുണ്ട്.",
"demoTooltipTitle": "ടൂൾടിപ്പുകൾ",
"demoTooltipSubtitle": "'ദീർഘനേരം അമർത്തുക' അല്ലെങ്കിൽ 'ഹോവർ ചെയ്യുക' എന്നിവയുടെ മുകളിൽ പ്രദർശിപ്പിക്കുന്ന ചെറിയ സന്ദേശം",
"demoTooltipDescription": "ബട്ടന്റെയോ മറ്റ് ഉപയോക്തൃ ഇന്റർഫേസ് നടപടിയുടെയോ ഫംഗ്ഷൻ വിവരിക്കാൻ സഹായിക്കുന്ന ടെക്സ്റ്റ് ലേബലുകൾ ടൂൾടിപ്പുകൾ നൽകുന്നു. ഉപയോക്താക്കൾ ഹോവർ ചെയ്യുമ്പോഴോ ഫോക്കസ് ചെയ്യുമ്പോഴോ ഒരു എലിമെന്റിൽ ദീർഘനേരം അമർത്തുമ്പോഴോ ടൂൾടിപ്പുകൾ, അറിവ് നൽകുന്ന ടെക്സ്റ്റ് പ്രദർശിപ്പിക്കും.",
"demoTooltipInstructions": "ടൂൾടിപ്പ് പ്രദർശിപ്പിക്കാൻ ദീർഘനേരം അമർത്തുക അല്ലെങ്കിൽ ഹോവർ ചെയ്യുക.",
"demoMenuSelected": "തിരഞ്ഞെടുത്തു: {value}",
"demoMenuAnItemWithASectionedMenu": "വിഭാഗീകരിച്ച മെനു ഉള്ള ഒരിനം",
"demoBottomAppBarTitle": "ചുവടെയുള്ള ആപ്പ് ബാർ",
"demoBottomAppBarDescription": "ചുവടെയുള്ള ഒരു നാവിഗേഷൻ ഡ്രോയറിലേക്കും ഫ്ലോട്ടിംഗ് പ്രവർത്തന ബട്ടൺ ഉൾപ്പെടെ നാല് പ്രവർത്തനങ്ങളിലേക്കും വരെയുള്ള ആക്സസ് ചുവടെയുള്ള ആപ്പ് ബാറുകൾ നൽകുന്നു.",
"bottomAppBarNotch": "നോച്ച്",
"bottomAppBarPosition": "ഫ്ലോട്ടിംഗ് പ്രവർത്തന ബട്ടണിന്റെ സ്ഥാനം",
"bottomAppBarPositionDockedEnd": "ഡോക്ക് ചെയ്തിരിക്കുന്നു - അവസാനം",
"bottomAppBarPositionDockedCenter": "ഡോക്ക് ചെയ്തിരിക്കുന്നു - മധ്യം",
"bottomAppBarPositionFloatingEnd": "ഫ്ലോട്ടിംഗ് - അവസാനം",
"bottomAppBarPositionFloatingCenter": "ഫ്ലോട്ടിംഗ് - മധ്യം",
"demoGridListsTitle": "Grid ലിസ്റ്റുകൾ",
"demoMenuTitle": "മെനു",
"demoGridListsDescription": "ഒരേ സ്വഭാവമുള്ള ഡാറ്റ (സാധാരണ ചിത്രങ്ങൾ) ദൃശ്യമാക്കുന്നതിന് ഏറ്റവും അനുയോജ്യമാണ് Grid ലിസ്റ്റുകൾ. GRid ലിസ്റ്റിലെ ഓരോ ഇനത്തെയും ടൈൽ എന്ന് വിളിക്കുന്നു.",
"demoGridListsImageOnlyTitle": "ചിത്രം മാത്രം",
"demoGridListsHeaderTitle": "തലക്കെട്ടിനൊപ്പം",
"demoGridListsFooterTitle": "അടിക്കുറിപ്പിനൊപ്പം",
"demoSlidersTitle": "സ്ലൈഡറുകൾ",
"demoSlidersSubtitle": "സ്വെെപ്പ് ചെയ്ത് മൂല്യം തിരഞ്ഞെടുക്കുന്നതിനുള്ള വിജറ്റുകൾ",
"demoSlidersDescription": "സ്ലെെഡറുകൾ ഒരു ബാറിലുടനീളം മൂല്യങ്ങളുടെ ഒരു ശ്രേണിയെ പ്രതിഫലിപ്പിക്കുന്നു, ആ മൂല്യങ്ങളിൽ നിന്ന് ഒന്ന് ഉപയോക്താക്കൾക്ക് തിരഞ്ഞെടുക്കാം. ശബ്ദം, തെളിച്ചം അല്ലെങ്കിൽ ചിത്ര ഫിൽട്ടറുകൾ പ്രയോഗിക്കൽ പോലുള്ള ക്രമീകരണങ്ങൾ ക്രമീകരിക്കുന്നതിന് ഏറ്റവും അനുയോജ്യമാണവ.",
"demoRangeSlidersTitle": "ശ്രേണി സ്ലൈഡറുകൾ",
"demoRangeSlidersDescription": "സ്ലെെഡറുകൾ ഒരു ബാറിലുടനീളം മൂല്യങ്ങളുടെ ഒരു ശ്രേണിയെ പ്രതിഫലിപ്പിക്കുന്നു. അവയിൽ, മൂല്യങ്ങളുടെ ശ്രേണിയെ പ്രതിഫലിപ്പിക്കുന്ന ബാറിന്റെ രണ്ട് അറ്റങ്ങളിലും ഐക്കണുകൾ ഉണ്ടാകാം. ശബ്ദം, തെളിച്ചം അല്ലെങ്കിൽ ചിത്ര ഫിൽട്ടറുകൾ പ്രയോഗിക്കൽ പോലുള്ള ക്രമീകരണങ്ങൾ ക്രമീകരിക്കുന്നതിന് ഏറ്റവും അനുയോജ്യമാണവ.",
"demoCustomSlidersTitle": "ഇഷ്ടാനുസൃതം സ്ലെെഡറുകൾ",
"demoMenuContextMenuItemOne": "സന്ദർഭ മെനു ഇനം ഒന്ന്",
"demoSlidersContinuousWithEditableNumericalValue": "തിരുത്താവുന്ന സംഖ്യാപരമായ മൂല്യത്തോടൊപ്പം തുടർച്ചയായത്",
"demoSlidersDiscrete": "ഇടവിട്ടുള്ളത്",
"demoSlidersDiscreteSliderWithCustomTheme": "ഇഷ്ടാനുസൃത തീമിനൊപ്പമുള്ള ഇടവിട്ടുള്ള സ്ലെെഡർ",
"demoSlidersContinuousRangeSliderWithCustomTheme": "ഇഷ്ടാനുസൃത തീമിനൊപ്പമുള്ള തുടർച്ചയായ ശ്രേണി സ്ലെെഡർ",
"demoSlidersContinuous": "തുടർച്ചയായ",
"demoSlidersEditableNumericalValue": "തിരുത്താവുന്ന സംഖ്യാപരമായ മൂല്യം",
"placeTanjore": "തഞ്ചാവൂർ",
"demoContextMenuTitle": "സന്ദർഭ മെനു",
"demoSectionedMenuTitle": "വിഭാഗീകരിച്ച മെനു",
"demoSimpleMenuTitle": "സിമ്പിൾ മെനു",
"demoChecklistMenuTitle": "ചെക്ക്ലിസ്റ്റ് മെനു",
"demoMenuSubtitle": "മെനു ബട്ടണുകളും സിമ്പിൾ മെനുകളും",
"demoMenuDescription": "മെനു, ഒരു താൽക്കാലിക പ്രതലത്തിൽ ചോയ്സുകളുടെ ഒരു ലിസ്റ്റ് പ്രദർശിപ്പിക്കും. ബട്ടൺ, നടപടി, അല്ലെങ്കിൽ മറ്റ് നിയന്ത്രണവുമായി ഉപയോക്താക്കൾ ബന്ധപ്പെടുമ്പോൾ അവ പ്രത്യക്ഷപ്പെടും.",
"demoMenuItemValueOne": "മെനു ഇനം ഒന്ന്",
"demoMenuItemValueTwo": "മെനു ഇനം രണ്ട്",
"demoMenuItemValueThree": "മെനു ഇനം മൂന്ന്",
"demoMenuOne": "ഒന്ന്",
"demoMenuTwo": "രണ്ട്",
"demoMenuThree": "മൂന്ന്",
"demoMenuFour": "നാല്",
"demoBottomAppBarSubtitle": "നാവിഗേഷനും പ്രവർത്തനങ്ങളും ചുവടെ പ്രദർശിപ്പിക്കുന്നു",
"demoCupertinoSwitchSubtitle": "iOS-സ്റ്റൈലിലുള്ള സ്വിച്ച്",
"demoSnackbarsText": "ഇതൊരു സ്നാക്ബാറാണ്.",
"demoCupertinoSliderSubtitle": "iOS-സ്റ്റൈലിലുള്ള സ്ലൈഡർ",
"demoCupertinoSliderDescription": "തുടർച്ചയായ അല്ലെങ്കിൽ ഇടവിട്ടുള്ള മൂല്യങ്ങളുടെ ഗണത്തിൽ നിന്ന് മൂല്യങ്ങൾ തിരഞ്ഞെടുക്കാൻ സ്ലൈഡർ ഉപയോഗിക്കാം.",
"demoCupertinoSliderContinuous": "തുടർച്ചയായത്: {value}",
"demoCupertinoSliderDiscrete": "ഇടവിട്ടുള്ളത്: {value}",
"demoSnackbarsAction": "നിങ്ങൾ സ്നാക്ബാർ പ്രവർത്തനം അമർത്തിയിരിക്കുന്നു.",
"backToGallery": "ഗാലറിയിലേക്ക് മടങ്ങുക",
"demoCupertinoTabBarTitle": "ടാബ് ബാർ",
"demoCupertinoSwitchDescription": "ഒരൊറ്റ ക്രമീകരണത്തിന്റെ ഓൺ/ഓഫ് നിലകൾ മാറ്റാൻ ഒരു സ്വിച്ച് ഉപയോഗിക്കുന്നു.",
"demoSnackbarsActionButtonLabel": "പ്രവർത്തനം",
"cupertinoTabBarProfileTab": "പ്രൊഫൈൽ",
"demoSnackbarsButtonLabel": "ഒരു സ്നാക്ബാർ കാണിക്കുക",
"demoSnackbarsDescription": "ഒരു ആപ്പ് നിറവേറ്റിയതോ നിറവേറ്റാൻ പോകുന്നതോ ആയ പ്രോസസിനെ കുറിച്ച് സ്നാക്ബാറുകൾ ഉപയോക്താക്കളെ അറിയിക്കുന്നു. അവ സ്ക്രീനിന്റെ ചുവടെ താൽക്കാലികമായി ദൃശ്യമാകുന്നു. അവ ഉപയോക്തൃ അനുഭവത്തെ തടസ്സപ്പെടുത്തരുത്, മാത്രമല്ല അവ അപ്രത്യക്ഷമാകാൻ ഉപയോക്താവിന്റെ ഇൻപുട്ട് ആവശ്യമായി വരരുത്.",
"demoSnackbarsSubtitle": "സ്നാക്ബാറുകൾ സ്ക്രീനിന്റെ ചുവട്ടിൽ സന്ദേശങ്ങൾ കാണിക്കുന്നു",
"demoSnackbarsTitle": "സ്നാക്ബാറുകൾ",
"demoCupertinoSliderTitle": "സ്ലൈഡർ",
"cupertinoTabBarChatTab": "Chat",
"cupertinoTabBarHomeTab": "ഹോം",
"demoCupertinoTabBarDescription": "iOS-സ്റ്റൈലിലുള്ള ചുവട്ടിലെ നാവിഗേഷൻ ടാബ് ബാർ. ഒന്നിലധികം ടാബുകൾ പ്രദർശിപ്പിക്കുന്നു, ആദ്യത്തെ ടാബ് ഡിഫോൾട്ടായി സജീവമാണ്.",
"demoCupertinoTabBarSubtitle": "iOS-സ്റ്റൈലിലുള്ള ചുവട്ടിലെ ടാബ് ബാർ",
"demoOptionsFeatureTitle": "ഓപ്ഷനുകൾ കാണുക",
"demoOptionsFeatureDescription": "ഈ ഡെമോയ്ക്ക് ലഭ്യമായ ഓപ്ഷനുകൾ കാണുന്നതിന് ഇവിടെ ടാപ്പ് ചെയ്യുക.",
"demoCodeViewerCopyAll": "എല്ലാം പകർത്തുക",
"shrineScreenReaderRemoveProductButton": "{product} നീക്കുക",
"shrineScreenReaderProductAddToCart": "കാർട്ടിലേക്ക് ചേർക്കുക",
"shrineScreenReaderCart": "{quantity,plural,=0{ഷോപ്പിംഗ് കാർട്ട്, ഇനങ്ങളൊന്നുമില്ല}=1{ഷോപ്പിംഗ് കാർട്ട്, ഒരു ഇനം}other{ഷോപ്പിംഗ് കാർട്ട്, {quantity} ഇനങ്ങൾ}}",
"demoCodeViewerFailedToCopyToClipboardMessage": "ക്ലിപ്പ്ബോർഡിലേക്ക് പകർത്താനായില്ല: {error}",
"demoCodeViewerCopiedToClipboardMessage": "ക്ലിപ്പ്ബോർഡിലേക്ക് പകർത്തി.",
"craneSleep8SemanticLabel": "കടൽത്തീരത്തുള്ള മലഞ്ചെരുവിൽ മായൻ അവശിഷ്ടങ്ങൾ",
"craneSleep4SemanticLabel": "മലനിരകൾക്ക് മുന്നിലുള്ള തടാകതീരത്തെ ഹോട്ടൽ",
"craneSleep2SemanticLabel": "മാച്ചു പിച്ചു സിറ്റാഡെൽ",
"craneSleep1SemanticLabel": "മഞ്ഞ് പെയ്യുന്ന നിത്യഹരിത മരങ്ങളുള്ള പ്രദേശത്തെ ഉല്ലാസ കേന്ദ്രം",
"craneSleep0SemanticLabel": "വെള്ളത്തിന് പുറത്ത് നിർമ്മിച്ചിരിക്കുന്ന ബംഗ്ലാവുകൾ",
"craneFly13SemanticLabel": "ഈന്തപ്പനകളോടുകൂടിയ സമുദ്രതീരത്തെ പൂളുകൾ",
"craneFly12SemanticLabel": "ഈന്തപ്പനകളോടുകൂടിയ പൂൾ",
"craneFly11SemanticLabel": "ഇഷ്ടിക കൊണ്ട് ഉണ്ടാക്കിയ കടലിലെ ലൈറ്റ്ഹൗസ്",
"craneFly10SemanticLabel": "സൂര്യാസ്തമയ സമയത്ത് അൽ-അസ്ഹർ പള്ളിയുടെ മിനാരങ്ങൾ",
"craneFly9SemanticLabel": "നീല നിറത്തിലുള്ള പുരാതന കാറിൽ ചാരിയിരിക്കുന്ന മനുഷ്യൻ",
"craneFly8SemanticLabel": "Supertree Grove",
"craneEat7SemanticLabel": "ബേക്കറിയുടെ പ്രവേശനകവാടം",
"craneEat2SemanticLabel": "ബർഗർ",
"craneFly5SemanticLabel": "മലനിരകൾക്ക് മുന്നിലുള്ള തടാകതീരത്തെ ഹോട്ടൽ",
"demoSelectionControlsSubtitle": "ചെക്ക് ബോക്സുകൾ, റേഡിയോ ബട്ടണുകൾ, സ്വിച്ചുകൾ എന്നിവ",
"craneEat8SemanticLabel": "ഒരു പ്ലേറ്റ് ക്രോഫിഷ്",
"craneEat9SemanticLabel": "പേസ്ട്രികൾ ലഭ്യമാക്കുന്ന കഫേയിലെ കൗണ്ടർ",
"craneEat10SemanticLabel": "വലിയ പേസ്ട്രാമി സാൻഡ്വിച്ച് കൈയ്യിൽ പിടിച്ച് നിൽകുന്ന സ്ത്രീ",
"craneFly4SemanticLabel": "വെള്ളത്തിന് പുറത്ത് നിർമ്മിച്ചിരിക്കുന്ന ബംഗ്ലാവുകൾ",
"craneEat5SemanticLabel": "ആർട്സി റെസ്റ്റോറന്റിലെ ഇരിപ്പിട സൗകര്യം",
"craneEat4SemanticLabel": "ചോക്ലേറ്റ് ഡിസേർട്ട്",
"craneEat3SemanticLabel": "കൊറിയൻ ടാക്കോ",
"craneFly3SemanticLabel": "മാച്ചു പിച്ചു സിറ്റാഡെൽ",
"craneEat1SemanticLabel": "ഡിന്നർ സ്റ്റൈൽ സ്റ്റൂളുകളുള്ള ആളൊഴിഞ്ഞ ബാർ",
"craneEat0SemanticLabel": "വിറക് ഉപയോഗിക്കുന്ന അടുപ്പിലുണ്ടാക്കുന്ന പിസ",
"craneSleep11SemanticLabel": "തായ്പേയ് 101 സ്കൈസ്ക്രാപ്പർ",
"craneSleep10SemanticLabel": "സൂര്യാസ്തമയ സമയത്ത് അൽ-അസ്ഹർ പള്ളിയുടെ മിനാരങ്ങൾ",
"craneSleep9SemanticLabel": "ഇഷ്ടിക കൊണ്ട് ഉണ്ടാക്കിയ കടലിലെ ലൈറ്റ്ഹൗസ്",
"craneEat6SemanticLabel": "ചെമ്മീന് കൊണ്ടുള്ള വിഭവം",
"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": "അവസാന തീയതി {date} ആയ {amount} വരുന്ന {billName} ബിൽ.",
"shrineTooltipCloseCart": "കാർട്ട് അടയ്ക്കുക",
"shrineTooltipCloseMenu": "മെനു അടയ്ക്കുക",
"shrineTooltipOpenMenu": "മെനു തുറക്കുക",
"shrineTooltipSettings": "ക്രമീകരണം",
"shrineTooltipSearch": "Search",
"demoTabsDescription": "വ്യത്യസ്ത സ്ക്രീനുകൾ, ഡാറ്റാ സെറ്റുകൾ, മറ്റ് ആശയവിനിമയങ്ങൾ എന്നിവയിലുടനീളം ഉള്ളടക്കം ടാബുകൾ ഓർഗനെെസ് ചെയ്യുന്നു.",
"demoTabsSubtitle": "സ്വതന്ത്രമായി സ്ക്രോൾ ചെയ്യാവുന്ന കാഴ്ചകളുള്ള ടാബുകൾ",
"demoTabsTitle": "ടാബുകൾ",
"rallyBudgetAmount": "മൊത്തം {amountTotal} തുകയിൽ {amountUsed} നിരക്ക് ഉപയോഗിച്ച {budgetName} ബജറ്റ്, {amountLeft} ശേഷിക്കുന്നു",
"shrineTooltipRemoveItem": "ഇനം നീക്കം ചെയ്യുക",
"rallyAccountAmount": "{amount} നിരക്കുള്ള, {accountNumber} എന്ന അക്കൗണ്ട് നമ്പറോട് കൂടിയ {accountName} അക്കൗണ്ട്.",
"rallySeeAllBudgets": "എല്ലാ ബജറ്റുകളും കാണുക",
"rallySeeAllBills": "എല്ലാ ബില്ലുകളും കാണുക",
"craneFormDate": "തീയതി തിരഞ്ഞെടുക്കുക",
"craneFormOrigin": "പുറപ്പെടുന്ന സ്ഥലം തിരഞ്ഞെടുക്കുക",
"craneFly1": "ബിഗ് സുർ, യുണൈറ്റഡ് സ്റ്റേറ്റ്സ്",
"craneFly2": "കുംബു വാലി, നേപ്പാൾ",
"craneFly3": "മാച്ചു പിച്ചു, പെറു",
"craneFly4": "മാലി, മാലദ്വീപുകൾ",
"craneFly5": "വിറ്റ്സ്നോ, സ്വിറ്റ്സർലൻഡ്",
"craneFly6": "മെക്സിക്കോ സിറ്റി, മെക്സിക്കോ",
"settingsTextDirectionLocaleBased": "ഭാഷാടിസ്ഥാനത്തിൽ",
"craneFly8": "സിംഗപ്പൂർ",
"craneFly9": "ഹവാന, ക്യൂബ",
"craneFly10": "കെയ്റോ, ഈജിപ്ത്",
"craneFly11": "ലിസ്ബൺ, പോർച്ചുഗൽ",
"craneFly12": "നാപ്പ, യുണൈറ്റഡ് സ്റ്റേറ്റ്സ്",
"craneFly13": "ബാലി, ഇന്തോനേഷ്യ",
"craneSleep0": "മാലി, മാലദ്വീപുകൾ",
"craneSleep1": "ആസ്പെൻ, യുണൈറ്റഡ് സ്റ്റേറ്റ്സ്",
"demoCupertinoSegmentedControlTitle": "വിഭാഗീകരിച്ച നിയന്ത്രണം",
"craneSleep3": "ഹവാന, ക്യൂബ",
"craneSleep4": "വിറ്റ്സ്നോ, സ്വിറ്റ്സർലൻഡ്",
"craneSleep5": "ബിഗ് സുർ, യുണൈറ്റഡ് സ്റ്റേറ്റ്സ്",
"craneSleep6": "നാപ്പ, യുണൈറ്റഡ് സ്റ്റേറ്റ്സ്",
"craneSleep7": "പോർട്ടോ, പോർച്ചുഗൽ",
"craneEat4": "പാരീസ്, ഫ്രാൻസ്",
"demoChipTitle": "ചിപ്സ്",
"demoChipSubtitle": "ഇൻപുട്ട്, ആട്രിബ്യൂട്ട് അല്ലെങ്കിൽ ആക്ഷൻ എന്നതിനെ പ്രതിനിധീകരിക്കുന്ന കോംപാക്റ്റ് മൂലകങ്ങൾ",
"demoActionChipTitle": "ആക്ഷൻ ചിപ്പ്",
"demoActionChipDescription": "പ്രാഥമിക ഉള്ളടക്കവുമായി ബന്ധപ്പെട്ട ഒരു ആക്ഷനെ ട്രിഗർ ചെയ്യുന്ന ഒരു സെറ്റ് ഓപ്ഷനുകളാണ് ആക്ഷൻ ചിപ്പുകൾ. ആക്ഷൻ ചിപ്പുകൾ UI-യിൽ ചലനാത്മകമായും സന്ദർഭോചിതമായും ദൃശ്യമാകും.",
"demoChoiceChipTitle": "ചോയ്സ് ചിപ്പ്",
"demoChoiceChipDescription": "ചോയ്സ് ചിപ്പുകൾ, ഒരു സെറ്റിൽ നിന്നുള്ള ഒരൊറ്റ ചോയ്സിനെ പ്രതിനിധീകരിക്കുന്നു. ചോയ്സ് ചിപ്പുകളിൽ ബന്ധപ്പെട്ട വിവരണാത്മക ടെക്സ്റ്റോ വിഭാഗങ്ങളോ അടങ്ങിയിരിക്കുന്നു.",
"demoFilterChipTitle": "ഫിൽട്ടർ ചിപ്പ്",
"demoFilterChipDescription": "ഫിൽട്ടർ ചിപ്പുകൾ ഉള്ളടക്കം ഫിൽട്ടർ ചെയ്യാൻ ടാഗുകളോ വിവരണാത്മക വാക്കുകളോ ഉപയോഗിക്കുന്നു.",
"demoInputChipTitle": "ഇൻപുട്ട് ചിപ്പ്",
"demoInputChipDescription": "ഇൻപുട്ട് ചിപ്പുകൾ കോംപാക്റ്റ് രൂപത്തിലുള്ള ഒരു എന്റിറ്റി (വ്യക്തി, സ്ഥലം, അല്ലെങ്കിൽ കാര്യം) അല്ലെങ്കിൽ സംഭാഷണ വാചകം പോലുള്ള സങ്കീർണ്ണമായ വിവരങ്ങളെ പ്രതിനിധീകരിക്കുന്നു.",
"craneSleep8": "ടുലും, മെക്സിക്കോ",
"demoCupertinoSegmentedControlSubtitle": "iOS-സ്റ്റെെലിലുള്ള വിഭാഗീകരിച്ച നിയന്ത്രണം",
"craneEat10": "ലിസ്ബൺ, പോർച്ചുഗൽ",
"chipTurnOnLights": "ലൈറ്റുകൾ ഓണാക്കുക",
"chipSmall": "ചെറുത്",
"chipMedium": "ഇടത്തരം",
"chipLarge": "വലുത്",
"chipElevator": "എലിവേറ്റർ",
"chipWasher": "വാഷർ",
"chipFireplace": "നെരിപ്പോട്",
"chipBiking": "ബൈക്കിംഗ്",
"craneFormDiners": "ഡൈനറുകൾ",
"rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{നികുതിയായി നിങ്ങളിൽ നിന്നും പിടിക്കാൻ സാധ്യതയുള്ള തുക കുറയ്ക്കൂ! വിഭാഗങ്ങൾ നിശ്ചയിച്ചിട്ടില്ലാത്ത ഒരു ഇടപാടിന് വിഭാഗങ്ങൾ നൽകുക.}other{നികുതിയായി നിങ്ങളിൽ നിന്നും പിടിക്കാൻ സാധ്യതയുള്ള തുക കുറയ്ക്കൂ! വിഭാഗങ്ങൾ നിശ്ചയിച്ചിട്ടില്ലാത്ത {count} ഇടപാടുകൾക്ക് വിഭാഗങ്ങൾ നൽകുക.}}",
"craneFormTime": "സമയം തിരഞ്ഞെടുക്കുക",
"craneFormLocation": "ലൊക്കേഷൻ തിരഞ്ഞെടുക്കുക",
"craneFormTravelers": "സഞ്ചാരികൾ",
"craneEat7": "നാഷ്വിൽ, യുണൈറ്റഡ് സ്റ്റേറ്റ്സ്",
"craneFormDestination": "ലക്ഷ്യസ്ഥാനം തിരഞ്ഞെടുക്കുക",
"craneFormDates": "തീയതികൾ തിരഞ്ഞെടുക്കുക",
"craneFly": "FLY",
"craneSleep": "ഉറക്കം",
"craneEat": "കഴിക്കുക",
"craneFlySubhead": "ലക്ഷ്യസ്ഥാനം അനുസരിച്ച് ഫ്ലൈറ്റുകൾ അടുത്തറിയുക",
"craneSleepSubhead": "ലക്ഷ്യസ്ഥാനം അനുസരിച്ച് പ്രോപ്പർട്ടികൾ അടുത്തറിയുക",
"craneEatSubhead": "ലക്ഷ്യസ്ഥാനം അനുസരിച്ച് റെസ്റ്റോറന്റുകൾ അടുത്തറിയുക",
"craneFlyStops": "{numberOfStops,plural,=0{സ്റ്റോപ്പില്ലാത്തവ}=1{ഒരു സ്റ്റോപ്പ്}other{{numberOfStops} സ്റ്റോപ്പുകൾ}}",
"craneSleepProperties": "{totalProperties,plural,=0{പ്രോപ്പർട്ടികളൊന്നും ലഭ്യമല്ല}=1{1 പ്രോപ്പർട്ടികൾ ലഭ്യമാണ്}other{{totalProperties} പ്രോപ്പർട്ടികൾ ലഭ്യമാണ്}}",
"craneEatRestaurants": "{totalRestaurants,plural,=0{റെസ്റ്റോറന്റുകളൊന്നുമില്ല}=1{ഒരു റെസ്റ്റോറന്റ്}other{{totalRestaurants} റെസ്റ്റോറന്റുകൾ}}",
"demoCupertinoSegmentedControlDescription": "തനതായ നിരവധി ഓപ്ഷനുകൾക്കിടയിൽ നിന്ന് തിരഞ്ഞെടുക്കാൻ ഉപയോഗിക്കുന്നു. വിഭാഗീകരിച്ച നിയന്ത്രണത്തിലെ ഒരു ഓപ്ഷൻ തിരഞ്ഞെടുക്കുമ്പോൾ, വിഭാഗീകരിച്ച നിയന്ത്രണത്തിലെ മറ്റ് ഓപ്ഷനുകൾ തിരഞ്ഞെടുക്കപ്പെടുന്നതിൽ നിന്ന് തടയുന്നു.",
"craneSleep9": "ലിസ്ബൺ, പോർച്ചുഗൽ",
"craneEat9": "മാഡ്രിഡ്, സ്പെയിൻ",
"craneEat8": "അറ്റ്ലാന്റ, യുണൈറ്റഡ് സ്റ്റേറ്റ്സ്",
"craneFly0": "ആസ്പെൻ, യുണൈറ്റഡ് സ്റ്റേറ്റ്സ്",
"craneEat6": "സീറ്റിൽ, യുണൈറ്റഡ് സ്റ്റേറ്റ്സ്",
"craneEat5": "സോൾ, ദക്ഷിണ കൊറിയ",
"craneFly7": "മൗണ്ട് റഷ്മോർ, യുണൈറ്റഡ് സ്റ്റേറ്റ്സ്",
"craneEat3": "പോർട്ട്ലൻഡ്, യുണൈറ്റഡ് സ്റ്റേറ്റ്സ്",
"craneEat2": "കോദോബ, അർജന്റീന",
"craneEat1": "ഡാലസ്, യുണൈറ്റഡ് സ്റ്റേറ്റ്സ്",
"craneEat0": "നേപ്പിൾസ്, ഇറ്റലി",
"craneSleep11": "തായ്പേയ്, തായ്വാൻ",
"craneSleep10": "കെയ്റോ, ഈജിപ്ത്",
"craneSleep2": "മാച്ചു പിച്ചു, പെറു",
"shrineLoginUsernameLabel": "ഉപയോക്തൃനാമം",
"rallyTitleAccounts": "അക്കൗണ്ടുകൾ",
"rallyTitleBudgets": "ബജറ്റുകൾ",
"shrineCartSubtotalCaption": "ആകെത്തുക:",
"shrineCartShippingCaption": "ഷിപ്പിംഗ്:",
"shrineCartTaxCaption": "നികുതി:",
"rallyBudgetCategoryRestaurants": "റെസ്റ്റോറന്റുകൾ",
"shrineProductStellaSunglasses": "സ്റ്റെല്ല സൺഗ്ലാസസ്",
"shrineProductWhitneyBelt": "വിറ്റ്നി ബെൽറ്റ്",
"shrineProductGardenStrand": "ഗാർഡൻ സ്ട്രാൻഡ്",
"shrineProductStrutEarrings": "സ്റ്റ്രട്ട് ഇയർറിംഗ്സ്",
"shrineProductVarsitySocks": "വാഴ്സിറ്റി സോക്സ്",
"shrineProductWeaveKeyring": "വീവ് കീറിംഗ്",
"shrineProductGatsbyHat": "ഗാറ്റ്സ്ബി തൊപ്പി",
"shrineProductShrugBag": "തോൾ സഞ്ചി",
"shrineProductGiltDeskTrio": "ഗിൽറ്റ് ഡെസ്ക് ട്രൈയോ",
"shrineProductCopperWireRack": "കോപ്പർ വയർ റാക്ക്",
"shrineProductSootheCeramicSet": "സൂത്ത് സെറാമിൽ സെറ്റ്",
"shrineProductHurrahsTeaSet": "ഹുറാസ് ടീ സെറ്റ്",
"shrineProductBlueStoneMug": "ബ്ലൂ സ്റ്റോൺ മഗ്",
"shrineProductRainwaterTray": "റെയ്ൻവാട്ടർ ട്രേ",
"shrineProductChambrayNapkins": "ഷാംബ്രേ നാപ്കിൻസ്",
"shrineProductSucculentPlanters": "സക്കുലന്റ് പ്ലാന്റേഴ്സ്",
"shrineProductQuartetTable": "ക്വാർട്ടറ്റ് പട്ടിക",
"rallySettingsManageAccounts": "അക്കൗണ്ടുകൾ മാനേജ് ചെയ്യുക",
"shrineProductClaySweater": "ക്ലേ സ്വെറ്റർ",
"shrineProductSeaTunic": "സീ ട്യൂണിക്",
"shrineProductPlasterTunic": "പ്ലാസ്റ്റർ ട്യൂണിക്",
"shrineProductWhitePinstripeShirt": "വൈറ്റ് പിൻസ്ട്രൈപ്പ് ഷർട്ട്",
"shrineProductChambrayShirt": "ചേമ്പ്രേ ഷർട്ട്",
"shrineProductSeabreezeSweater": "സീബ്രീസ് സ്വറ്റർ",
"shrineProductGentryJacket": "ജന്റ്രി ജാക്കറ്റ്",
"shrineProductNavyTrousers": "നേവി ട്രൗസേഴ്സ്",
"shrineProductWalterHenleyWhite": "വാൾട്ടർ ഹെൻലി (വൈറ്റ്)",
"shrineProductShoulderRollsTee": "ഷോൾഡർ റോൾസ് ടീ",
"rallyBudgetCategoryGroceries": "പലചരക്ക് സാധനങ്ങൾ",
"rallyBudgetCategoryCoffeeShops": "കോഫി ഷോപ്പുകൾ",
"rallyAccountDetailDataAccountOwner": "അക്കൗണ്ട് ഉടമ",
"rallyAccountDetailDataNextStatement": "അടുത്ത പ്രസ്താവന",
"rallyAccountDetailDataInterestPaidLastYear": "കഴിഞ്ഞ വർഷം അടച്ച പലിശ",
"shrineProductFineLinesTee": "ഫൈൻ ലൈൻസ് ടീ",
"rallyAccountDetailDataInterestRate": "പലിശനിരക്ക്",
"rallyAccountDetailDataAnnualPercentageYield": "വാർഷിക വരുമാന ശതമാനം",
"rallyAccountDataVacation": "അവധിക്കാലം",
"rallyAccountDataCarSavings": "കാർ സേവിംഗ്സ്",
"rallyAccountDataHomeSavings": "ഹോം സേവിംഗ്സ്",
"rallyAccountDataChecking": "പരിശോധിക്കുന്നു",
"rallyBudgetCategoryClothing": "വസ്ത്രങ്ങൾ",
"shrineProductSurfAndPerfShirt": "സർഫ് ആന്റ് പെർഫ് ഷർട്ട്",
"rallyAccountDetailDataInterestYtd": "പലിശ YTD",
"rallySettingsTaxDocuments": "നികുതി രേഖകൾ",
"rallySettingsPasscodeAndTouchId": "പാസ്കോഡും ടച്ച് ഐഡിയും",
"rallySettingsNotifications": "അറിയിപ്പുകൾ",
"rallySettingsPersonalInformation": "വ്യക്തിപരമായ വിവരങ്ങൾ",
"rallySettingsPaperlessSettings": "കടലാസില്ലാതെയുള്ള ക്രമീകരണം",
"rallySettingsFindAtms": "ATM-കൾ കണ്ടെത്തുക",
"rallySettingsHelp": "സഹായം",
"rallySettingsSignOut": "സൈൻ ഔട്ട് ചെയ്യുക",
"rallyAccountTotal": "മൊത്തം",
"rallyBillsDue": "അവസാന തീയതി",
"rallyBudgetLeft": "ഇടത്",
"rallyAccounts": "അക്കൗണ്ടുകൾ",
"rallyBills": "ബില്ലുകൾ",
"rallyBudgets": "ബജറ്റുകൾ",
"rallyAlerts": "മുന്നറിയിപ്പുകൾ",
"rallySeeAll": "എല്ലാം കാണുക",
"rallyFinanceLeft": "ഇടത്",
"rallyTitleOverview": "അവലോകനം",
"shrineProductGingerScarf": "ജിൻജർ സ്കാഫ്",
"rallyTitleBills": "ബില്ലുകൾ",
"shrineNextButtonCaption": "അടുത്തത്",
"rallyTitleSettings": "ക്രമീകരണം",
"rallyLoginLoginToRally": "Rally-ലേക്ക് ലോഗിൻ ചെയ്യുക",
"rallyLoginNoAccount": "ഒരു അക്കൗണ്ട് ഇല്ലേ?",
"rallyLoginSignUp": "സൈൻ അപ്പ് ചെയ്യുക",
"rallyLoginUsername": "ഉപയോക്തൃനാമം",
"rallyLoginPassword": "പാസ്വേഡ്",
"rallyLoginLabelLogin": "ലോഗിൻ ചെയ്യുക",
"rallyLoginRememberMe": "എന്നെ ഓർക്കൂ",
"rallyLoginButtonLogin": "ലോഗിൻ ചെയ്യുക",
"rallyAlertsMessageHeadsUpShopping": "ശ്രദ്ധിക്കുക, നിങ്ങൾ ഈ മാസത്തെ ഷോപ്പിംഗ് ബജറ്റിന്റെ {percent} ചെലവഴിച്ചു.",
"rallyAlertsMessageSpentOnRestaurants": "നിങ്ങൾ ഈ ആഴ്ച {amount} റെസ്റ്റോറന്റുകളിൽ ചെലവഴിച്ചു.",
"rallyAlertsMessageATMFees": "നിങ്ങൾ ഈ മാസം {amount} ATM ഫീസ് അടച്ചു",
"rallyAlertsMessageCheckingAccount": "തകർപ്പൻ പ്രകടനം! നിങ്ങളുടെ ചെക്കിംഗ് അക്കൗണ്ട് കഴിഞ്ഞ മാസത്തേക്കാൾ {percent} കൂടുതലാണ്.",
"shrineMenuCaption": "മെനു",
"shrineCategoryNameAll": "എല്ലാം",
"shrineCategoryNameAccessories": "ആക്സസറികൾ",
"shrineCategoryNameClothing": "വസ്ത്രങ്ങൾ",
"shrineCategoryNameHome": "ഹോം",
"shrineLogoutButtonCaption": "ലോഗൗട്ട് ചെയ്യുക",
"shrineLoginPasswordLabel": "പാസ്വേഡ്",
"shrineCancelButtonCaption": "റദ്ദാക്കുക",
"shrineCartTotalCaption": "മൊത്തം",
"shrineCartPageCaption": "കാർട്ട്",
"shrineProductQuantity": "അളവ്: {quantity}",
"shrineProductPrice": "x {price}",
"shrineCartItemCount": "{quantity,plural,=0{ഇനങ്ങളൊന്നുമില്ല}=1{ഒരിനം}other{{quantity} ഇനങ്ങൾ}}",
"shrineCartClearButtonCaption": "കാർട്ട് മായ്ക്കുക",
"shrineProductRamonaCrossover": "റമോണാ ക്രോസോവർ",
"shrineProductSunshirtDress": "സൺഷർട്ട് ഡ്രസ്",
"shrineProductGreySlouchTank": "ഗ്രേ സ്ലൗച്ച് ടാങ്ക്",
"shrineProductVagabondSack": "വാഗബോണ്ട് സാക്ക്",
"shrineProductCeriseScallopTee": "സറീസ് സ്കാലപ്പ് ടീ",
"shrineProductClassicWhiteCollar": "ക്ലാസിക് വൈറ്റ് കോളർ",
"shrineProductKitchenQuattro": "കിച്ചൻ ക്വാത്രോ",
"demoTextFieldYourEmailAddress": "നിങ്ങളുടെ ഇമെയിൽ വിലാസം",
"demoBottomNavigationSubtitle": "ക്രോസ്-ഫേഡിംഗ് കാഴ്ചകളുള്ള ബോട്ടം നാവിഗേഷൻ",
"settingsPlatformAndroid": "Android",
"aboutDialogDescription": "ഈ ആപ്പിനുള്ള സോഴ്സ് കോഡ് കാണാൻ {repoLink} സന്ദർശിക്കുക.",
"aboutFlutterSamplesRepo": "ഫ്ലട്ടർ സാമ്പിൾസ് ഗിറ്റ്ഹബ് റിപ്പോ",
"demoTextFieldHidePasswordLabel": "പാസ്വേഡ് മറയ്ക്കുക",
"demoTextFieldFormErrors": "സമർപ്പിക്കുന്നതിന് മുമ്പ് ചുവപ്പ് നിറത്തിൽ അടയാളപ്പെടുത്തിയ പിശകുകൾ പരിഹരിക്കുക.",
"demoTextFieldNameRequired": "പേര് ആവശ്യമാണ്.",
"demoTextFieldOnlyAlphabeticalChars": "അക്ഷരങ്ങൾ മാത്രം നൽകുക.",
"demoTextFieldEnterUSPhoneNumber": "(###) ###-#### - ഒരു US ഫോൺ നമ്പർ നൽകുക.",
"demoTextFieldEnterPassword": "പാസ്വേഡ് നൽകുക.",
"demoTextFieldPasswordsDoNotMatch": "പാസ്വേഡുകൾ പൊരുത്തപ്പെടുന്നില്ല",
"demoTextFieldWhatDoPeopleCallYou": "എന്താണ് ആളുകൾ നിങ്ങളെ വിളിക്കുന്നത്?",
"demoTextFieldShowPasswordLabel": "പാസ്വേഡ് കാണിക്കുക",
"demoTextFieldWhereCanWeReachYou": "നിങ്ങളെ എവിടെയാണ് ഞങ്ങൾക്ക് ബന്ധപ്പെടാനാവുക?",
"demoTextFieldPhoneNumber": "ഫോൺ നമ്പർ*",
"settingsTitle": "ക്രമീകരണം",
"demoTextFieldEmail": "ഇമെയിൽ",
"demoTextFieldTellUsAboutYourself": "നിങ്ങളെക്കുറിച്ച് ഞങ്ങളോട് പറയുക (ഉദാ. നിങ്ങൾ എന്താണ് ചെയ്യുന്നത്, ഹോബികൾ എന്തൊക്കെ തുടങ്ങിയവ എഴുതുക)",
"demoBottomSheetPersistentTitle": "സ്ഥിരമായ ബോട്ടം ഷീറ്റ്",
"demoTextFieldLifeStory": "ജീവിത കഥ",
"demoTextFieldSalary": "ശമ്പളം",
"demoTextFieldUSD": "USD",
"demoTextFieldNoMoreThan": "8 പ്രതീകങ്ങളിൽ കൂടരുത്.",
"demoTextFieldPassword": "പാസ്വേഡ്*",
"starterAppDescription": "റെസ്പോൺസിവ് സ്റ്റാർട്ടർ ലേഔട്ട്",
"demoTextFieldDescription": "UI-ലേക്ക് ടെക്സ്റ്റ് ചേർക്കാൻ ടെക്സ്റ്റ് ഫീൽഡുകൾ ഉപയോക്താക്കളെ അനുവദിക്കുന്നു. അവ സാധാരണയായി ഫോമുകളിലും ഡയലോഗുകളിലും പ്രത്യക്ഷപ്പെടുന്നു.",
"demoTextFieldSubtitle": "എഡിറ്റ് ചെയ്യാവുന്ന ടെക്സ്റ്റിന്റെയും അക്കങ്ങളുടെയും ഒറ്റ വരി",
"demoTextFieldTitle": "ടെക്സ്റ്റ് ഫീൽഡുകൾ",
"demoBottomTextFieldsTitle": "ടെക്സ്റ്റ് ഫീൽഡുകൾ",
"demoBottomSheetItem": "ഇനം {value}",
"demoBottomNavigationDescription": "സ്ക്രീനിന്റെ ചുവടെ മൂന്ന് മുതൽ അഞ്ച് വരെ ലക്ഷ്യസ്ഥാനങ്ങൾ ബോട്ടം നാവിഗേഷൻ ബാറുകൾ പ്രദർശിപ്പിക്കുന്നു. ഓരോ ലക്ഷ്യസ്ഥാനവും ഐക്കൺ, ഓപ്ഷണൽ ടെക്സ്റ്റ് ലേബൽ എന്നിവയിലൂടെ പ്രതിനിധീകരിക്കപ്പെടുന്നു. ബോട്ടം നാവിഗേഷൻ ഐക്കൺ ടാപ്പ് ചെയ്യുമ്പോൾ, ഉപയോക്താവിനെ ആ ഐക്കണുമായി ബന്ധപ്പെട്ട ഉയർന്ന ലെവൽ നാവിഗേഷൻ ലക്ഷ്യസ്ഥാനത്തേക്ക് കൊണ്ടുപോകും.",
"demoBottomSheetHeader": "തലക്കെട്ട്",
"demoBottomSheetButtonText": "ബോട്ടം ഷീറ്റ് കാണിക്കുക",
"demoBottomSheetAddLabel": "ചേർക്കുക",
"demoBottomSheetModalDescription": "മോഡൽ ബോട്ടം ഷീറ്റ് മെനുവിനോ ഡയലോഗിനോ ഉള്ള ബദലാണ്, ഇത് ബാക്കി ആപ്പുമായി ഇടപഴകുന്നതിൽ നിന്ന് ഉപയോക്താവിനെ തടയുന്നു.",
"demoBottomSheetModalTitle": "മോഡൽ ബോട്ടം ഷീറ്റ്",
"demoBottomSheetPersistentDescription": "ആപ്പിന്റെ പ്രാഥമിക ഉള്ളടക്കത്തിന് അനുബന്ധമായ വിവരങ്ങൾ സ്ഥിരമായ ബോട്ടം ഷീറ്റ് കാണിക്കുന്നു. ഉപയോക്താവ് ആപ്പിന്റെ മറ്റ് ഭാഗങ്ങളുമായി സംവദിക്കുമ്പോഴും സ്ഥിരമായ ഒരു ബോട്ടം ഷീറ്റ് ദൃശ്യമാകും.",
"demoTextFieldRetypePassword": "പാസ്വേഡ് വീണ്ടും ടൈപ്പ് ചെയ്യുക*",
"demoBottomSheetSubtitle": "സ്ഥിരമായ, മോഡൽ ബോട്ടം ഷീറ്റുകൾ",
"demoBottomSheetTitle": "ബോട്ടം ഷീറ്റ്",
"buttonText": "ബട്ടൺ",
"demoTypographyDescription": "മെറ്റീരിയൽ രൂപകൽപ്പനയിൽ കാണുന്ന വിവിധ ടൈപ്പോഗ്രാഫിക്കൽ ശൈലികൾക്കുള്ള നിർവ്വചനങ്ങൾ.",
"demoTypographySubtitle": "മുൻകൂട്ടി നിശ്ചയിച്ച എല്ലാ ടെക്സ്റ്റ് ശൈലികളും",
"demoTypographyTitle": "ടൈപ്പോഗ്രാഫി",
"demoFullscreenDialogDescription": "ഇൻകമിംഗ് പേജ് ഒരു പൂർണ്ണസ്ക്രീൻ മോഡൽ ഡയലോഗാണോയെന്ന് പൂർണ്ണസ്ക്രീൻ ഡയലോഗ് പ്രോപ്പർട്ടി വ്യക്തമാക്കുന്നു",
"demoFlatButtonDescription": "ഒരു ഫ്ലാറ്റ് ബട്ടൺ അമർത്തുമ്പോൾ ഒരു ഇങ്ക് സ്പ്ലാഷ് പോലെ പ്രദർശിപ്പിക്കുമെങ്കിലും ബട്ടൺ ഉയർത്തുന്നില്ല. ടൂൾബാറുകളിലും ഡയലോഗുകളിലും പാഡിംഗ് ഉപയോഗിക്കുന്ന ഇൻലൈനിലും ഫ്ലാറ്റ് ബട്ടണുകൾ ഉപയോഗിക്കുക",
"starterAppDrawerItem": "ഇനം {value}",
"demoBottomNavigationSelectedLabel": "തിരഞ്ഞെടുത്ത ലേബൽ",
"demoTextFieldSubmit": "സമർപ്പിക്കുക",
"demoBottomNavigationPersistentLabels": "സ്ഥിരമായ ലേബലുകൾ",
"demoBottomNavigationTitle": "ബോട്ടം നാവിഗേഷൻ",
"settingsLightTheme": "പ്രകാശം",
"settingsTheme": "തീം",
"settingsPlatformIOS": "iOS",
"starterAppGenericButton": "ബട്ടൺ",
"settingsTextDirectionRTL": "RTL",
"settingsTextDirectionLTR": "LTR",
"settingsTextScalingHuge": "വളരെ വലുത്",
"settingsTextScalingLarge": "വലുത്",
"settingsTextScalingNormal": "സാധാരണം",
"settingsTextScalingSmall": "ചെറുത്",
"settingsSystemDefault": "സിസ്റ്റം",
"demoTextFieldNameHasPhoneNumber": "{name} എന്ന വ്യക്തിയുടെ ഫോൺ നമ്പർ {phoneNumber} ആണ്",
"starterAppGenericBody": "ബോഡി",
"starterAppGenericHeadline": "തലക്കെട്ട്",
"starterAppGenericSubtitle": "സബ്ടൈറ്റിൽ",
"starterAppGenericTitle": "പേര്",
"starterAppTooltipSearch": "Search",
"starterAppTooltipShare": "പങ്കിടുക",
"starterAppTooltipFavorite": "പ്രിയപ്പെട്ടത്",
"starterAppTooltipAdd": "ചേർക്കുക",
"rallyDescription": "വ്യക്തിഗത ഫിനാൻസ് ആപ്പ്",
"demoTextFieldNameField": "പേര്*",
"starterAppTitle": "സ്റ്റാർട്ടർ ആപ്പ്",
"cupertinoButton": "ബട്ടൺ",
"bottomNavigationContentPlaceholder": "{title} ടാബിനുള്ള പ്ലെയ്സ്ഹോൾഡർ",
"bottomNavigationCameraTab": "ക്യാമറ",
"bottomNavigationAlarmTab": "അലാറം",
"bottomNavigationAccountTab": "അക്കൗണ്ട്",
"bottomNavigationCalendarTab": "Calendar",
"bottomNavigationCommentsTab": "കമന്റുകൾ",
"demoTextFieldRequiredField": "* ചിഹ്നം ഈ ഭാഗം പൂരിപ്പിക്കേണ്ടതുണ്ട് എന്ന് സൂചിപ്പിക്കുന്നു",
"demoTextFieldKeepItShort": "ചെറുതാക്കി വയ്ക്കൂ, ഇത് കേവലം ഒരു ഡെമോ മാത്രമാണ്.",
"homeHeaderGallery": "ഗാലറി",
"homeHeaderCategories": "വിഭാഗങ്ങൾ",
"shrineDescription": "ആകർഷകമായ ചില്ലറവ്യാപാര ആപ്പ്",
"craneDescription": "വ്യക്തിപരമാക്കിയ യാത്രാ ആപ്പ്",
"homeCategoryReference": "സ്റ്റൈലുകളും മറ്റുള്ളവയും",
"demoInvalidURL": "URL പ്രദർശിപ്പിക്കാൻ ആയില്ല:",
"demoOptionsTooltip": "ഓപ്ഷനുകൾ",
"demoInfoTooltip": "വിവരം",
"demoCodeTooltip": "ഡെമോ കോഡ്",
"demoDocumentationTooltip": "API ഡോക്യുമെന്റേഷൻ",
"demoFullscreenTooltip": "പൂർണ്ണസ്ക്രീൻ",
"settingsTextScaling": "ടെക്സ്റ്റ് സ്കെയിലിംഗ്",
"settingsTextDirection": "ടെക്സ്റ്റ് ദിശ",
"settingsLocale": "പ്രാദേശിക ഭാഷ",
"settingsPlatformMechanics": "പ്ലാറ്റ്ഫോം മെക്കാനിക്സ്",
"settingsDarkTheme": "ഇരുണ്ട",
"settingsSlowMotion": "സ്ലോ മോഷൻ",
"settingsAbout": "ഫ്ലട്ടർ ഗ്യാലറിയെ കുറിച്ച്",
"settingsFeedback": "ഫീഡ്ബാക്ക് അയയ്ക്കുക",
"settingsAttribution": "ലണ്ടനിലെ TOASTER രൂപകൽപ്പന ചെയ്തത്",
"demoButtonTitle": "ബട്ടണുകൾ",
"demoButtonSubtitle": "ടെക്സ്റ്റ് ബട്ടൺ, എലവേറ്റഡ് ബട്ടൺ, ഔട്ട്ലൈൻഡ് ബട്ടൺ തുടങ്ങിയവ",
"demoFlatButtonTitle": "ഫ്ലാറ്റ് ബട്ടൺ",
"demoRaisedButtonTitle": "റെയ്സ്ഡ് ബട്ടൺ",
"demoRaisedButtonDescription": "റെയ്സ്ഡ് ബട്ടണുകൾ മിക്കവാറും ഫ്ലാറ്റ് ലേഔട്ടുകൾക്ക് മാനം നൽകുന്നു. തിരക്കേറിയതോ വിശാലമായതോ ആയ ഇടങ്ങളിൽ അവ ഫംഗ്ഷനുകൾക്ക് പ്രാധാന്യം നൽകുന്നു.",
"demoOutlineButtonTitle": "ഔട്ട്ലൈൻ ബട്ടൺ",
"demoOutlineButtonDescription": "ഔട്ട്ലൈൻ ബട്ടണുകൾ അതാര്യമാവുകയും അമർത്തുമ്പോൾ ഉയരുകയും ചെയ്യും. ഒരു ഇതര, ദ്വിതീയ പ്രവർത്തനം സൂചിപ്പിക്കുന്നതിന് അവ പലപ്പോഴും റെയ്സ്ഡ് ബട്ടണുകളുമായി ജോടിയാക്കുന്നു.",
"demoToggleButtonTitle": "ടോഗിൾ ബട്ടണുകൾ",
"demoToggleButtonDescription": "സമാനമായ ഓപ്ഷനുകൾ ഗ്രൂപ്പ് ചെയ്യാൻ ടോഗിൾ ബട്ടണുകൾ ഉപയോഗിക്കാം. സമാനമായ ടോഗിൾ ബട്ടണുകളുടെ ഗ്രൂപ്പുകൾക്ക് പ്രാധാന്യം നൽകുന്നതിന്, ഒരു ഗ്രൂപ്പ് ഒരു പൊതു കണ്ടെയിനർ പങ്കിടണം",
"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": "ബാക്കപ്പ് അക്കൗണ്ട് സജ്ജീകരിക്കൂ",
"dialogAddAccount": "അക്കൗണ്ട് ചേർക്കുക",
"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": "സിയാൻ",
"colorsTeal": "ടീൽ",
"colorsGreen": "പച്ച",
"colorsLightGreen": "ഇളം പച്ച",
"colorsLime": "മഞ്ഞകലർന്ന പച്ച",
"colorsYellow": "മഞ്ഞ",
"colorsAmber": "മഞ്ഞ കലർന്ന ഓറഞ്ച് വർണ്ണം",
"colorsOrange": "ഓറഞ്ച്",
"colorsDeepOrange": "ഇരുണ്ട ഓറഞ്ച് നിറം",
"colorsBrown": "ബ്രൗൺ",
"colorsGrey": "ചാരനിറം",
"colorsBlueGrey": "നീല കലർന്ന ചാരനിറം"
}
| gallery/lib/l10n/intl_ml.arb/0 | {
"file_path": "gallery/lib/l10n/intl_ml.arb",
"repo_id": "gallery",
"token_count": 83135
} | 812 |
{
"loading": "පූරණය වේ",
"deselect": "නොතෝරන්න",
"select": "තෝරන්න",
"selectable": "තේරිය හැකි (දිගු එබීම)",
"selected": "තෝරන ලදි",
"demo": "ආදර්ශනය",
"bottomAppBar": "පහළ යෙදුම් තීරුව",
"notSelected": "තෝරා නැත",
"demoCupertinoSearchTextFieldTitle": "පෙළ ක්ෂේත්රය සොයන්න",
"demoCupertinoPicker": "තෝරකය",
"demoCupertinoSearchTextFieldSubtitle": "iOS-විලාසයේ සෙවීම් පෙළ ක්ෂේත්රය",
"demoCupertinoSearchTextFieldDescription": "පරිශීලකයාට පෙළ ඇතුළු කිරීමෙන් සෙවීමට ඉඩ දෙන, සහ යෝජනා ඉදිරිපත් කිරීමට සහ පෙරීමට හැකි සෙවීම් පෙළ ක්ෂේත්රයක්.",
"demoCupertinoSearchTextFieldPlaceholder": "පෙළ කිහිපයක් ඇතුළු කරන්න",
"demoCupertinoScrollbarTitle": "අනුචලන තීරුව",
"demoCupertinoScrollbarSubtitle": "iOS-විලාසයේ අනුචලන තීරුව",
"demoCupertinoScrollbarDescription": "දී ඇති දාරකයා දවටන අනුචලන තීරුවක්",
"demoTwoPaneItem": "අයිතමය {value}",
"demoTwoPaneList": "ලැයිස්තුව",
"demoTwoPaneFoldableLabel": "නැවිය හැකි",
"demoTwoPaneSmallScreenLabel": "කුඩා තිරය",
"demoTwoPaneSmallScreenDescription": "කුඩා තිර උපාංගයක TwoPane හැසිරෙන්නේ මේ ආකාරයටයි.",
"demoTwoPaneTabletLabel": "ටැබ්ලට් / ඩෙස්ක්ටොප්",
"demoTwoPaneTabletDescription": "ටැබ්ලටයක් හෝ ඩෙස්ක්ටොප් එකක් වැනි විශාල තිරයක් මත TwoPane හැසිරෙන්නේ මේ ආකාරයටයි.",
"demoTwoPaneTitle": "TwoPane",
"demoTwoPaneSubtitle": "නැවිය හැකි, විශාල සහ කුඩා තිර මත ප්රතිචාරාත්මක පිරිසැලසුම්",
"splashSelectDemo": "ආදර්ශනයක් තෝරන්න",
"demoTwoPaneFoldableDescription": "නැවිය හැකි උපාංගයක් මත TwoPane හැසිරෙන්නේ මේ ආකාරයටයි.",
"demoTwoPaneDetails": "විස්තර",
"demoTwoPaneSelectItem": "අයිතමයක් තෝරන්න",
"demoTwoPaneItemDetails": "අයිතම {value} විස්තර",
"demoCupertinoContextMenuActionText": "ප්රකරණ මෙනුව බැලීමට Flutter ලාංඡනය තට්ටු කර අල්ලාගෙන සිටින්න.",
"demoCupertinoContextMenuDescription": "මූලාංගයක් දිගු වේලාවක් එබූ විට දිස්වන iOS-විලාසයේ පූර්ණ තිර ප්රකරණ මෙනුවකි.",
"demoAppBarTitle": "යෙදුම් තීරුව",
"demoAppBarDescription": "යෙදුම් තීරුව වත්මන් තිරයට අදාළ අන්තර්ගතය සහ ක්රියා සපයයි. එය සන්නම්කරණය, තිර මාතෘකා, සංචාලනය සහ ක්රියා සඳහා භාවිත වේ",
"demoDividerTitle": "වෙන්කරණය",
"demoDividerSubtitle": "වෙන්කරණයක් යනු ලැයිස්තුවල සහ පිරිසැලසුම්වල අන්තර්ගතය සමූහ කරන තුනී රේඛාවකි.",
"demoDividerDescription": "අන්තර්ගතය වෙන් කිරීම සඳහා ලැයිස්තු, ලාච්චු සහ වෙනත් තැන්වල වෙන්කරණ භාවිත කළ හැකිය.",
"demoVerticalDividerTitle": "සිරස් වෙන්කරණය",
"demoCupertinoContextMenuTitle": "ප්රකරණ මෙනුව",
"demoCupertinoContextMenuSubtitle": "iOS-විලාසයේ ප්රකරණ මෙනුව",
"demoAppBarSubtitle": "වත්මන් තිරයට අදාළ තොරතුරු සහ ක්රියා පෙන්වයි",
"demoCupertinoContextMenuActionOne": "ක්රියාව එක",
"demoCupertinoContextMenuActionTwo": "ක්රියාව දෙක",
"demoDateRangePickerDescription": "ද්රව්යමය සැලසුම් දින තෝරකය අඩංගු වන සංවාදයක් පෙන්වයි.",
"demoDateRangePickerTitle": "දින පරාස තෝරකය",
"demoNavigationDrawerUserName": "පරිශීලක නම:",
"demoNavigationDrawerUserEmail": "[email protected]",
"demoNavigationDrawerText": "ලාච්චුව බැලීමට දාරයේ සිට ස්වයිප් කරන්න හෝ ඉහළ වම් නිරූපකය තට්ටු කරන්න",
"demoNavigationRailTitle": "සංචාලන පීල්ල",
"demoNavigationRailSubtitle": "යෙදුමක් තුළ සංචාලන පීල්ලක් සංදර්ශනය කිරීම",
"demoNavigationRailDescription": "සාමාන්යයෙන් කුඩා දසුන් තුනක් සහ පහක් අතර සංචාලනය කිරීම සඳහා යෙදුමක වමේ හෝ දකුණේ සංදර්ශනය කිරීමට අදහස් කරන ද්රව්යමය විජට්.",
"demoNavigationRailFirst": "පළමු",
"demoNavigationDrawerTitle": "සංචාලන ලාච්චුව",
"demoNavigationRailThird": "තුන්වන",
"replyStarredLabel": "තරු ලකුණු යෙදූ",
"demoTextButtonDescription": "පෙළ බොත්තමක් එබීමේදී තීන්ත ඉසිරිමක් සංදර්ශනය කරන නමුත් නොඔසවයි. මෙවලම් තීරුවල, සංවාදවල සහ පිරවීම සමග පේළිගතව පෙළ බොත්තම් භාවිත කරන්න",
"demoElevatedButtonTitle": "එසවූ බොත්තම",
"demoElevatedButtonDescription": "එසවූ බොත්තම් බොහෝ විට පැතලි පිරිසැලසුම්වලට මානය එක් කරයි. ඒවා කාර්ය බහුල හෝ පුළුල් ඉඩවල ශ්රිත අවධාරණය කරයි.",
"demoOutlinedButtonTitle": "වැටිසන යෙදූ බොත්තම",
"demoOutlinedButtonDescription": "වැටිසන යෙදූ බොත්තම් එබූ විට අපැහැදිලි වන අතර එසවේ. ඒවා නිතර විකල්ප, ද්විතීයික ක්රියාවක් දැක්වීමට එසවූ බොත්තම් සමග යුගල වේ.",
"demoContainerTransformDemoInstructions": "කාඩ්පත්, ලැයිස්තු සහ FAB",
"demoNavigationDrawerSubtitle": "යෙදුම් තීරුව ඇතුළත ලාච්චුවක් සංදර්ශනය කිරීම",
"replyDescription": "කාර්යක්ෂම, අවධානිත ඉ-තැපැල් යෙදුමක්",
"demoNavigationDrawerDescription": "යෙදුමක සංචාලන සබැඳි පෙන්වීම සඳහා තිරයේ දාරයේ සිට තිරස් අතට ලිස්සා යන Material Design පැනලය.",
"replyDraftsLabel": "කෙටුම්පත්",
"demoNavigationDrawerToPageOne": "පළමු අයිතමය",
"replyInboxLabel": "එන ලිපි",
"demoSharedXAxisDemoInstructions": "ඊළඟ සහ ආපසු බොත්තම්",
"replySpamLabel": "අයාචිත",
"replyTrashLabel": "කුණු කූඩය",
"replySentLabel": "යවන ලද",
"demoNavigationRailSecond": "තත්පරය",
"demoNavigationDrawerToPageTwo": "දෙවැනි අයිතමය",
"demoFadeScaleDemoInstructions": "Modal සහ FAB",
"demoFadeThroughDemoInstructions": "පහළ සංචාලනය",
"demoSharedZAxisDemoInstructions": "සැකසීම් නිරූපක බොත්තම",
"demoSharedYAxisDemoInstructions": "\"මෑතකදී වාදනය කළ\" අනුව අනුපිළිවෙළට සකසන්න",
"demoTextButtonTitle": "පෙළ බොත්තම",
"demoSharedZAxisBeefSandwichRecipeTitle": "බීෆ් සැන්ඩ්විච්",
"demoSharedZAxisDessertRecipeDescription": "අතුරුපස වට්ටෝරුව",
"demoSharedYAxisAlbumTileSubtitle": "කලාකරු",
"demoSharedYAxisAlbumTileTitle": "ඇල්බමය",
"demoSharedYAxisRecentSortTitle": "මෑතක දී ධාවනය කළ",
"demoSharedYAxisAlphabeticalSortTitle": "A-Z",
"demoSharedYAxisAlbumCount": "ඇල්බම 268",
"demoSharedYAxisTitle": "බෙදා ගත් y-අක්ෂය",
"demoSharedXAxisCreateAccountButtonText": "ගිණුමක් සාදන්න",
"demoFadeScaleAlertDialogDiscardButton": "ඉවත ලන්න",
"demoSharedXAxisSignInTextFieldLabel": "ඉ-තැපෑල හෝ දුරකථන අංකය",
"demoSharedXAxisSignInSubtitleText": "ඔබේ ගිණුම සමගින් පුරන්න",
"demoSharedXAxisSignInWelcomeText": "ආයුබෝවන් David Park",
"demoSharedXAxisIndividualCourseSubtitle": "තනි තනිව පෙන්වන",
"demoSharedXAxisBundledCourseSubtitle": "පොදි කළ",
"demoFadeThroughAlbumsDestination": "ඇල්බම",
"demoSharedXAxisDesignCourseTitle": "සැලසුම",
"demoSharedXAxisIllustrationCourseTitle": "රූප සටහන",
"demoSharedXAxisBusinessCourseTitle": "ව්යාපාරය",
"demoSharedXAxisArtsAndCraftsCourseTitle": "කලා ශිල්ප",
"demoMotionPlaceholderSubtitle": "ද්විතියික පෙළ",
"demoFadeScaleAlertDialogCancelButton": "අවලංගු කරන්න",
"demoFadeScaleAlertDialogHeader": "ඇඟවීමේ සංවාදය",
"demoFadeScaleHideFabButton": "FAB සඟවන්න",
"demoFadeScaleShowFabButton": "FAB පෙන්වන්න",
"demoFadeScaleShowAlertDialogButton": "MODAL පෙන්වන්න",
"demoFadeScaleDescription": "මැකී යාමේ රටාව භාවිතා කරනුයේ තිරයේ මායිම් තුළට ඇතුළු වන හෝ පිටවන UI මූලාංග සඳහාය, එනම් තිරය මධ්යයේ මැකී යන සංවාදයක් වැනි ඒවාය.",
"demoFadeScaleTitle": "මැකී යාම",
"demoFadeThroughTextPlaceholder": "ඡායාරූප 123",
"demoFadeThroughSearchDestination": "සෙවීම",
"demoFadeThroughPhotosDestination": "ඡායාරූප",
"demoSharedXAxisCoursePageSubtitle": "පොදි කළ ප්රවර්ග ඔබේ සංග්රහයේ සමූහ ලෙස දිස් වේ. ඔබට මෙය සැම විට පසුව වෙනස් කළ හැකිය.",
"demoFadeThroughDescription": "එකිනෙක සමඟ ශක්තිමත් සම්බන්ධතාවයක් නොමැති UI මූලාංග අතර සංක්රාන්තිය සඳහා මැකී යාමේ රටාව භාවිතා වේ.",
"demoFadeThroughTitle": "මැකී යාම",
"demoSharedZAxisHelpSettingLabel": "උදවු",
"demoMotionSubtitle": "සියලු පූර්ව නිර්ණිත සංක්රාන්ති රටා",
"demoSharedZAxisNotificationSettingLabel": "දැනුම්දීම්",
"demoSharedZAxisProfileSettingLabel": "පැතිකඩ",
"demoSharedZAxisSavedRecipesListTitle": "සුරැකි වට්ටෝරු",
"demoSharedZAxisBeefSandwichRecipeDescription": "බීෆ් සැන්ඩ්විච් වට්ටෝරුව",
"demoSharedZAxisCrabPlateRecipeDescription": "කකුළුවන් වට්ටෝරුව",
"demoSharedXAxisCoursePageTitle": "ඔබේ පාඨමාලා ක්රමවත් කරන්න",
"demoSharedZAxisCrabPlateRecipeTitle": "කකුළුවා",
"demoSharedZAxisShrimpPlateRecipeDescription": "කූනිස්සන් වට්ටෝරුව",
"demoSharedZAxisShrimpPlateRecipeTitle": "කූනිස්සා",
"demoContainerTransformTypeFadeThrough": "මැකී යාම",
"demoSharedZAxisDessertRecipeTitle": "අතුරුපස",
"demoSharedZAxisSandwichRecipeDescription": "සැන්ඩ්විච් වට්ටෝරුව",
"demoSharedZAxisSandwichRecipeTitle": "සැන්ඩ්විච්",
"demoSharedZAxisBurgerRecipeDescription": "බර්ගර් වට්ටෝරුව",
"demoSharedZAxisBurgerRecipeTitle": "බර්ගර්",
"demoSharedZAxisSettingsPageTitle": "සැකසීම්",
"demoSharedZAxisTitle": "බෙදා ගත් z-අක්ෂය",
"demoSharedZAxisPrivacySettingLabel": "රහස්යතාව",
"demoMotionTitle": "චලනය",
"demoContainerTransformTitle": "බහාලුම් පරිණාමනය",
"demoContainerTransformDescription": "බහාලුම් පරිණාමන රටාව නිර්මාණය කර ඇත්තේ බහාලුමක් ඇතුළත් UI මූලාංග අතර සංක්රාන්ති සඳහාය. මෙම රටාව UI මූලාංග දෙකක් අතර දෘශ්ය සම්බන්ධතාවක් නිර්මාණය කරයි",
"demoContainerTransformModalBottomSheetTitle": "මැකී යන ප්රකාරය",
"demoContainerTransformTypeFade": "මැකී යාම",
"demoSharedYAxisAlbumTileDurationUnit": "මිනි",
"demoMotionPlaceholderTitle": "මාතෘකාව",
"demoSharedXAxisForgotEmailButtonText": "ඉ-තැපෑල අමතක වුණාද?",
"demoMotionSmallPlaceholderSubtitle": "ද්විතීයික",
"demoMotionDetailsPageTitle": "විස්තර පිටුව",
"demoMotionListTileTitle": "ලැයිස්තු අයිතමය",
"demoSharedAxisDescription": "අවකාශීය හෝ සංචාලන සම්බන්ධතාවයක් ඇති UI මූලාංග අතර සංක්රාන්තිය සඳහා බෙදා ගත් අක්ෂ රටාව භාවිත කරයි. මෙම රටාව මූලාංග අතර සම්බන්ධතාවය ශක්තිමත් කිරීම සඳහා x, y, හෝ z අක්ෂයේ බෙදා ගත් පරිණාමනයක් භාවිත කරයි.",
"demoSharedXAxisTitle": "බෙදා ගත් x-අක්ෂය",
"demoSharedXAxisBackButtonText": "ආපසු",
"demoSharedXAxisNextButtonText": "ඊළඟ",
"demoSharedXAxisCulinaryCourseTitle": "සූපවේදී",
"githubRepo": "{repoName} GitHub ගබඩාව",
"fortnightlyMenuUS": "එක්සත් ජනපදය",
"fortnightlyMenuBusiness": "ව්යාපාරය",
"fortnightlyMenuScience": "විද්යාව",
"fortnightlyMenuSports": "ක්රීඩා",
"fortnightlyMenuTravel": "සංචාර",
"fortnightlyMenuCulture": "සංස්කෘතිය",
"fortnightlyTrendingTechDesign": "TechDesign",
"rallyBudgetDetailAmountLeft": "ඉතිරි මුදල",
"fortnightlyHeadlineArmy": "ඇතුළතින් කොළ හමුදාව ප්රතිසංස්කරණය කරමින්",
"fortnightlyDescription": "අන්තර්ගතයට යොමු වූ පුවත් යෙදුමකි",
"rallyBillDetailAmountDue": "ගෙවිය යුතු මුදල",
"rallyBudgetDetailTotalCap": "මුළු ප්රාග්ධනය",
"rallyBudgetDetailAmountUsed": "භාවිත කළ මුදල",
"fortnightlyTrendingHealthcareRevolution": "HealthcareRevolution",
"fortnightlyMenuFrontPage": "මුල් පිටුව",
"fortnightlyMenuWorld": "ලෝකය",
"rallyBillDetailAmountPaid": "ගෙවූ මුදල",
"fortnightlyMenuPolitics": "දේශපාලනය",
"fortnightlyHeadlineBees": "ගොවිපළ ඉඩම් මී මැස්සන් හිඟයි",
"fortnightlyHeadlineGasoline": "ගැසොලින්වල අනාගතය",
"fortnightlyTrendingGreenArmy": "GreenArmy",
"fortnightlyHeadlineFeminists": "කාන්තාවාදීන් පැත්ත ගනී",
"fortnightlyHeadlineFabrics": "සැලසුම්කරුවන් අනාගතයට ගැළපෙන රෙදිපිළි සෑදීමට තාක්ෂණය භාවිත කරයි",
"fortnightlyHeadlineStocks": "කොටස් එක තැන තිබෙන නිසා, බොහෝ අය ව්යවහාර මුදල් දෙස බලයි",
"fortnightlyTrendingReform": "ප්රතිසංස්කරණය",
"fortnightlyMenuTech": "තාක්ෂණ",
"fortnightlyHeadlineWar": "යුද්ධය අතරතුර ඇමෙරිකානු ජීවිත වෙන් කරන ලදී",
"fortnightlyHeadlineHealthcare": "නිහඬ එහෙත් ප්රබල සෞඛ්ය ආරක්ෂණ විප්ලවය",
"fortnightlyLatestUpdates": "නවතම යාවත්කාලීන",
"fortnightlyTrendingStocks": "කොටස්",
"rallyBillDetailTotalAmount": "මුළු මුදල",
"demoCupertinoPickerDateTime": "දිනය සහ වේලාව",
"signIn": "පුරන්න",
"dataTableRowWithSugar": "සීනි සහිත {value}",
"dataTableRowApplePie": "ඇපල් පයි",
"dataTableRowDonut": "ඩෝනට්",
"dataTableRowHoneycomb": "පැණි වද",
"dataTableRowLollipop": "ලොලිපොප්",
"dataTableRowJellyBean": "ජෙලි බීන්",
"dataTableRowGingerbread": "ඉඟුරු පාන්",
"dataTableRowCupcake": "කප්කේක්",
"dataTableRowEclair": "ඉක්ලෙයාර්",
"dataTableRowIceCreamSandwich": "අයිස් ක්රීම් සැන්ඩ්විච්",
"dataTableRowFrozenYogurt": "මුදවන ලද යෝගට්",
"dataTableColumnIron": "යකඩ (%)",
"dataTableColumnCalcium": "කැල්සියම් (%)",
"dataTableColumnSodium": "සෝඩියම් (මිලි ග්රෑම්)",
"demoTimePickerTitle": "වේලා තෝරකය",
"demo2dTransformationsResetTooltip": "පරිණාමනය කිරීම් යළි සකසන්න",
"dataTableColumnFat": "මේදය (ග්රෑම්)",
"dataTableColumnCalories": "කැලරි",
"dataTableColumnDessert": "අතුරුපස (බෙදීම් 1)",
"cardsDemoTravelDestinationLocation1": "තන්ජාවූර්, තමිල්නාඩු",
"demoTimePickerDescription": "ද්රව්ය සැලසුම් වේලා තෝරක අඩංගුවන සංවාදයක් පෙන්වයි.",
"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": "Palacio de Bellas Artes හි ගුවන් දසුන",
"rallySeeAllAccounts": "සියලු ගිණුම් බලන්න",
"rallyBillAmount": "{billName} බිල්පත {date} දිනට {amount}කි.",
"shrineTooltipCloseCart": "බහලුම වසන්න",
"shrineTooltipCloseMenu": "මෙනුව වසන්න",
"shrineTooltipOpenMenu": "මෙනුව විවෘත කරන්න",
"shrineTooltipSettings": "සැකසීම්",
"shrineTooltipSearch": "සෙවීම",
"demoTabsDescription": "ටැබ විවිධ තිර, දත්ත කට්ටල සහ වෙනත් අන්තර්ක්රියා හරහා අන්තර්ගතය සංවිධානය කරයි.",
"demoTabsSubtitle": "ස්වාධීනව අනුචලනය කළ හැකි දසුන් සහිත ටැබ",
"demoTabsTitle": "ටැබ",
"rallyBudgetAmount": "{amountTotal} කින් {amountUsed}ක් භාවිත කළ {budgetName} අයවැය, ඉතිරි {amountLeft}",
"shrineTooltipRemoveItem": "අයිතමය ඉවත් කරන්න",
"rallyAccountAmount": "{accountName} ගිණුම {accountNumber} {amount}කි.",
"rallySeeAllBudgets": "සියලු අයවැය බලන්න",
"rallySeeAllBills": "සියලු බිල්පත් බලන්න",
"craneFormDate": "දිනය තෝරන්න",
"craneFormOrigin": "ආරම්භය තෝරන්න",
"craneFly2": "කුම්බු නිම්නය, නේපාලය",
"craneFly3": "මාචු පික්කූ, පේරු",
"craneFly4": "මාලේ, මාලදිවයින",
"craneFly5": "විට්ස්නෝ, ස්විට්සර්ලන්තය",
"craneFly6": "මෙක්සිකෝ නගරය, මෙක්සිකෝව",
"craneFly7": "මවුන්ට් රෂ්මෝර්, එක්සත් ජනපදය",
"settingsTextDirectionLocaleBased": "පෙදෙසිය මත පදනම්",
"craneFly9": "හවානා, කියුබාව",
"craneFly10": "කයිරෝ, ඊජිප්තුව",
"craneFly11": "ලිස්බන්, පෘතුගාලය",
"craneFly12": "නාපා, එක්සත් ජනපදය",
"craneFly13": "බාලි, ඉන්දුනීසියාව",
"craneSleep0": "මාලේ, මාලදිවයින",
"craneSleep1": "ඇස්පෙන්, එක්සත් ජනපදය",
"craneSleep2": "මාචු පික්කූ, පේරු",
"demoCupertinoSegmentedControlTitle": "කොටස් කළ පාලනය",
"craneSleep4": "විට්ස්නෝ, ස්විට්සර්ලන්තය",
"craneSleep5": "බිග් සර්, එක්සත් ජනපදය",
"craneSleep6": "නාපා, එක්සත් ජනපදය",
"craneSleep7": "පෝටෝ, පෘතුගාලය",
"craneSleep8": "ටුලුම්, මෙක්සිකෝව",
"craneEat5": "සෝල්, දකුණු කොරියාව",
"demoChipTitle": "චිප",
"demoChipSubtitle": "ආදානය, ආරෝපණය හෝ ක්රියාව නියෝජනය කරන සංගත අංගයකි",
"demoActionChipTitle": "ක්රියා චිපය",
"demoActionChipDescription": "ක්රියා චිප යනු ප්රාථමික අන්තර්ගතයට අදාළ ක්රියාවක් ක්රියාරම්භ කරන විකල්ප සමූහයකි. ක්රියා චිප ගතිකව සහ සංදර්භානුගතය UI එකක දිස් විය යුතුය.",
"demoChoiceChipTitle": "චිපය තේරීම",
"demoChoiceChipDescription": "තේරීම් චිප කට්ටලයකින් තනි තේරීමක් නියෝජනය කරයි. තේරීම් චිප අදාළ විස්තරාත්මක පෙළ හෝ කාණ්ඩ අඩංගු වේ.",
"demoFilterChipTitle": "පෙරහන් චිපය",
"demoFilterChipDescription": "පෙරහන් චිප අන්තර්ගතය පෙරීමට ක්රමයක් ලෙස ටැග හෝ විස්තරාත්මක වචන භාවිත කරයි.",
"demoInputChipTitle": "ආදාන චිපය",
"demoInputChipDescription": "ආදාන චිප (පුද්ගලයෙක්, ස්ථානයක් හෝ දෙයක්) වැනි සංකීර්ණ තොරතුරු කොටසක් හෝ සංයුක්ත ආකෘතියක සංවාදාත්මක පෙළක් නියෝජනය කරයි.",
"craneSleep9": "ලිස්බන්, පෘතුගාලය",
"craneEat10": "ලිස්බන්, පෘතුගාලය",
"demoCupertinoSegmentedControlDescription": "අන්යෝන්ය වශයෙන් බහිෂ්කාර විකල්ප ගණනාවක් අතර තෝරා ගැනීමට භාවිත කරයි. කොටස් කළ පාලනයේ එක් විකල්පයක් තෝරා ගත් විට, කොටස් කළ පාලනයේ අනෙක් විකල්ප තෝරා ගැනීම නතර වේ.",
"chipTurnOnLights": "ආලෝකය ක්රියාත්මක කරන්න",
"chipSmall": "කුඩා",
"chipMedium": "මධ්යම",
"chipLarge": "විශාල",
"chipElevator": "විදුලි සෝපානය",
"chipWasher": "රෙදි සෝදන යන්ත්රය",
"chipFireplace": "ගිනි උඳුන",
"chipBiking": "බයිසිකල් පැදීම",
"craneFormDiners": "ආහාර ගන්නන්",
"rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{ඔබේ විය හැකි බදු අඩු කිරීම වැඩි කරන්න! නොපවරන ලද ගනුදෙනු 1කට වර්ගීකරණ පවරන්න.}other{ඔබේ විය හැකි බදු අඩු කිරීම වැඩි කරන්න! නොපවරන ලද ගනුදෙනු {count}කට වර්ගීකරණ පවරන්න.}}",
"craneFormTime": "වේලාව තෝරන්න",
"craneFormLocation": "ස්ථානය තෝරන්න",
"craneFormTravelers": "සංචාරකයන්",
"craneEat8": "ඇට්ලන්ටා, එක්සත් ජනපදය",
"craneFormDestination": "ගමනාන්තය තෝරන්න",
"craneFormDates": "දින තෝරන්න",
"craneFly": "FLY",
"craneSleep": "නිද්රාව",
"craneEat": "EAT",
"craneFlySubhead": "ගමනාන්තය අනුව ගුවන් ගමන් ගවේෂණය කරන්න",
"craneSleepSubhead": "ගමනාන්තය අනුව කුලී නිවාස ගවේෂණය කරන්න",
"craneEatSubhead": "ගමනාන්තය අනුව අවන්හල් ගවේෂණය කරන්න",
"craneFlyStops": "{numberOfStops,plural,=0{අඛණ්ඩ}=1{නැවතුම් 1}other{නැවතුම් {numberOfStops}ක්}}",
"craneSleepProperties": "{totalProperties,plural,=0{ලබා ගත හැකි කුලී නිවාස නැත}=1{ලබා ගත හැකි කුලී නිවාස 1}other{ලබා ගත හැකි කුලී නිවාස {totalProperties}}}",
"craneEatRestaurants": "{totalRestaurants,plural,=0{අවන්හල් නැත}=1{අවන්හල් 1}other{අවන්හල් {totalRestaurants}}}",
"craneFly0": "ඇස්පෙන්, එක්සත් ජනපදය",
"demoCupertinoSegmentedControlSubtitle": "iOS-විලාස කොටස් කළ පාලනය",
"craneSleep10": "කයිරෝ, ඊජිප්තුව",
"craneEat9": "මැඩ්රිඩ්, ස්පාඤ්ඤය",
"craneFly1": "බිග් සර්, එක්සත් ජනපදය",
"craneEat7": "නෑෂ්විල්, එක්සත් ජනපදය",
"craneEat6": "සියැටල්, එක්සත් ජනපදය",
"craneFly8": "සිංගප්පූරුව",
"craneEat4": "පැරීසිය, ප්රංශය",
"craneEat3": "පෝට්ලන්ඩ්, එක්සත් ජනපදය",
"craneEat2": "කෝඩොබා, ආජන්ටීනාව",
"craneEat1": "ඩලාස්, එක්සත් ජනපදය",
"craneEat0": "නේපල්ස්, ඉතාලිය",
"craneSleep11": "තායිපේ, තායිවානය",
"craneSleep3": "හවානා, කියුබාව",
"shrineLogoutButtonCaption": "ඉවත් වන්න",
"rallyTitleBills": "බිල්පත්",
"rallyTitleAccounts": "ගිණුම්",
"shrineProductVagabondSack": "Vagabond sack",
"rallyAccountDetailDataInterestYtd": "පොලී YTD",
"shrineProductWhitneyBelt": "Whitney belt",
"shrineProductGardenStrand": "Garden strand",
"shrineProductStrutEarrings": "Strut earrings",
"shrineProductVarsitySocks": "Varsity socks",
"shrineProductWeaveKeyring": "Weave keyring",
"shrineProductGatsbyHat": "Gatsby hat",
"shrineProductShrugBag": "උරහිස් සෙලවීමේ බෑගය",
"shrineProductGiltDeskTrio": "Gilt desk trio",
"shrineProductCopperWireRack": "Copper wire rack",
"shrineProductSootheCeramicSet": "Soothe ceramic set",
"shrineProductHurrahsTeaSet": "Hurrahs tea set",
"shrineProductBlueStoneMug": "නිල් ගල් ජෝගුව",
"shrineProductRainwaterTray": "වැසි වතුර තැටිය",
"shrineProductChambrayNapkins": "Chambray napkins",
"shrineProductSucculentPlanters": "Succulent planters",
"shrineProductQuartetTable": "Quartet table",
"shrineProductKitchenQuattro": "Kitchen quattro",
"shrineProductClaySweater": "මැටි ස්වීටරය",
"shrineProductSeaTunic": "Sea tunic",
"shrineProductPlasterTunic": "Plaster tunic",
"rallyBudgetCategoryRestaurants": "අවන්හල්",
"shrineProductChambrayShirt": "Chambray shirt",
"shrineProductSeabreezeSweater": "Seabreeze sweater",
"shrineProductGentryJacket": "Gentry jacket",
"shrineProductNavyTrousers": "Navy trousers",
"shrineProductWalterHenleyWhite": "Walter henley (සුදු)",
"shrineProductSurfAndPerfShirt": "Surf and perf shirt",
"shrineProductGingerScarf": "Ginger scarf",
"shrineProductRamonaCrossover": "Ramona crossover",
"shrineProductClassicWhiteCollar": "Classic white collar",
"shrineProductSunshirtDress": "Sunshirt dress",
"rallyAccountDetailDataInterestRate": "පොලී අනුපාතය",
"rallyAccountDetailDataAnnualPercentageYield": "වාර්ෂික ප්රතිශත අස්වැන්න",
"rallyAccountDataVacation": "නිවාඩුව",
"shrineProductFineLinesTee": "Fine lines tee",
"rallyAccountDataHomeSavings": "ගෘහ ඉතිරි කිරීම්",
"rallyAccountDataChecking": "චෙක්පත්",
"rallyAccountDetailDataInterestPaidLastYear": "පසුගිය වර්ෂයේ ගෙවූ පොලී",
"rallyAccountDetailDataNextStatement": "ඊළඟ ප්රකාශය",
"rallyAccountDetailDataAccountOwner": "ගිණුමේ හිමිකරු",
"rallyBudgetCategoryCoffeeShops": "කෝපි වෙළඳසැල්",
"rallyBudgetCategoryGroceries": "සිල්ලර භාණ්ඩ",
"shrineProductCeriseScallopTee": "Cerise scallop tee",
"rallyBudgetCategoryClothing": "ඇඳුම්",
"rallySettingsManageAccounts": "ගිණුම් කළමනාකරණය කරන්න",
"rallyAccountDataCarSavings": "මෝටර් රථ සුරැකුම්",
"rallySettingsTaxDocuments": "බදු ලේඛන",
"rallySettingsPasscodeAndTouchId": "මුරකේතය සහ ස්පර්ශ ID",
"rallySettingsNotifications": "දැනුම් දීම්",
"rallySettingsPersonalInformation": "පෞද්ගලික තොරතුරු",
"rallySettingsPaperlessSettings": "කඩදාසි රහිත සැකසීම්",
"rallySettingsFindAtms": "ATMs සොයන්න",
"rallySettingsHelp": "උදව්",
"rallySettingsSignOut": "වරන්න",
"rallyAccountTotal": "එකතුව",
"rallyBillsDue": "නියමිත",
"rallyBudgetLeft": "වම",
"rallyAccounts": "ගිණුම්",
"rallyBills": "බිල්පත්",
"rallyBudgets": "අයවැය",
"rallyAlerts": "ඇඟවීම්",
"rallySeeAll": "සියල්ල බලන්න",
"rallyFinanceLeft": "වම",
"rallyTitleOverview": "දළ විශ්ලේෂණය",
"shrineProductShoulderRollsTee": "Shoulder rolls tee",
"shrineNextButtonCaption": "ඊළඟ",
"rallyTitleBudgets": "අයවැය",
"rallyTitleSettings": "සැකසීම්",
"rallyLoginLoginToRally": "Rally වෙත ඇතුළු වන්න",
"rallyLoginNoAccount": "ගිණුමක් නොමැතිද?",
"rallyLoginSignUp": "ලියාපදිංචි වන්න",
"rallyLoginUsername": "පරිශීලක නම",
"rallyLoginPassword": "මුරපදය",
"rallyLoginLabelLogin": "පුරන්න",
"rallyLoginRememberMe": "මාව මතක තබා ගන්න",
"rallyLoginButtonLogin": "පුරන්න",
"rallyAlertsMessageHeadsUpShopping": "දැනුම්දීමයි, ඔබ මේ මාසය සඳහා ඔබගේ සාප්පු සවාරි අයවැයෙන් {percent} භාවිත කර ඇත.",
"rallyAlertsMessageSpentOnRestaurants": "ඔබ මේ සතියේ අවන්හල් සඳහා {amount} වියදම් කර ඇත",
"rallyAlertsMessageATMFees": "ඔබ මේ මාසයේ ATM ගාස්තු සඳහා {amount} වියදම් කර ඇත",
"rallyAlertsMessageCheckingAccount": "හොඳ වැඩක්! ඔබගේ ගෙවීම් ගිණුම පසුගිය මාසයට වඩා {percent} වැඩිය.",
"shrineMenuCaption": "මෙනුව",
"shrineCategoryNameAll": "සියල්ල",
"shrineCategoryNameAccessories": "ආයිත්තම්",
"shrineCategoryNameClothing": "ඇඳුම්",
"shrineCategoryNameHome": "ගෘහ",
"shrineLoginUsernameLabel": "පරිශීලක නම",
"shrineLoginPasswordLabel": "මුරපදය",
"shrineCancelButtonCaption": "අවලංගු කරන්න",
"shrineCartTaxCaption": "බදු:",
"shrineCartPageCaption": "බහලුම",
"shrineProductQuantity": "ප්රමාණය: {quantity}",
"shrineProductPrice": "x {price}\n",
"shrineCartItemCount": "{quantity,plural,=0{අයිතම නැත}=1{අයිතම 1}other{අයිතම {quantity}}}",
"shrineCartClearButtonCaption": "කරත්තය හිස් කරන්න",
"shrineCartTotalCaption": "එකතුව",
"shrineCartSubtotalCaption": "උප එකතුව:",
"shrineCartShippingCaption": "නැව්ගත කිරීම:",
"shrineProductGreySlouchTank": "Grey slouch tank",
"shrineProductStellaSunglasses": "ස්ටෙලා අව් කණ්ණාඩි",
"shrineProductWhitePinstripeShirt": "White pinstripe shirt",
"demoTextFieldWhereCanWeReachYou": "අපට ඔබ වෙත ළඟා විය හැක්කේ කොතැනින්ද?",
"settingsTextDirectionLTR": "LTR",
"settingsTextScalingLarge": "විශාල",
"demoBottomSheetHeader": "ශීර්ෂකය",
"demoBottomSheetItem": "අයිතමය {value}",
"demoBottomTextFieldsTitle": "පෙළ ක්ෂේත්ර",
"demoTextFieldTitle": "පෙළ ක්ෂේත්ර",
"demoTextFieldSubtitle": "සංස්කරණය කළ හැකි පෙළ සහ අංකවල තනි පේළිය",
"demoTextFieldDescription": "පෙළ ක්ෂේත්ර පරිශීලකයන්ට පෙළ UI එකකට ඇතුළු කිරීමට ඉඩ දෙයි. ඒවා සාමාන්යයෙන් ආකෘති සහ සංවාදවල දිස් වේ.",
"demoTextFieldShowPasswordLabel": "මුරපදය පෙන්වන්න",
"demoTextFieldHidePasswordLabel": "මුරපදය සඟවන්න",
"demoTextFieldFormErrors": "ඉදිරිපත් කිරීමට පෙර කරුණාකර දෝෂ රතු පැහැයෙන් නිවැරදි කරන්න.",
"demoTextFieldNameRequired": "නම අවශ්යයි.",
"demoTextFieldOnlyAlphabeticalChars": "කරුණාකර අකාරාදී අනුලකුණු පමණක් ඇතුළු කරන්න.",
"demoTextFieldEnterUSPhoneNumber": "(###) ###-#### - එක්සත් ජනපද දුරකථන අංකයක් ඇතුළත් කරන්න.",
"demoTextFieldEnterPassword": "කරුණාකර මුරපදයක් ඇතුළත් කරන්න.",
"demoTextFieldPasswordsDoNotMatch": "මුරපද නොගැළපේ.",
"demoTextFieldWhatDoPeopleCallYou": "පුද්ගලයන් ඔබට කථා කළේ කුමක්ද?",
"demoTextFieldNameField": "නම*",
"demoBottomSheetButtonText": "පහළ පත්රය පෙන්වන්න",
"demoTextFieldPhoneNumber": "දුරකථන අංකය*",
"demoBottomSheetTitle": "පහළ පත්රය",
"demoTextFieldEmail": "ඉ-තැපෑල",
"demoTextFieldTellUsAboutYourself": "ඔබ ගැන අපට පවසන්න (උදා, ඔබ කරන දේ හෝ ඔබට තිබෙන විනෝදාංශ මොනවාද යන්න ලියා ගන්න)",
"demoTextFieldKeepItShort": "එය කෙටියෙන් සිදු කරන්න, මෙය හුදෙක් අනතුරු ආදර්ශනයකි.",
"starterAppGenericButton": "බොත්තම",
"demoTextFieldLifeStory": "ජීවිත කථාව",
"demoTextFieldSalary": "වැටුප",
"demoTextFieldUSD": "USD",
"demoTextFieldNoMoreThan": "අනුලකුණු 8කට වඩා නැත.",
"demoTextFieldPassword": "මුරපදය*",
"demoTextFieldRetypePassword": "මුරපදය නැවත ටයිප් කරන්න*",
"demoTextFieldSubmit": "ඉදිරිපත් කරන්න",
"demoBottomNavigationSubtitle": "හරස් වියැකී යන දසුන් සහිත පහළ සංචාලනය",
"demoBottomSheetAddLabel": "එක් කරන්න",
"demoBottomSheetModalDescription": "මාදිලි පහළ පත්රයක් යනු මෙනුවකට හෝ සංවාදයකට විකල්පයක් වන අතර පරිශීලකව යෙදුමේ ඉතිරි කොටස සමග අන්තර්ක්රියා කීරිමෙන් වළක්වයි.",
"demoBottomSheetModalTitle": "මොඩල් පහළ පත්රය",
"demoBottomSheetPersistentDescription": "දිගටම පවතින පහළ පත්රයක් යෙදුමේ මූලික අන්තර්ගතය සපයන තොරතුරු පෙන්වයි.පරිශීලක යෙදුමේ අනෙක් කොටස් සමග අන්තර්ක්රියා කරන විට දිගටම පවතින පහළ පත්රයක් දෘශ්යමානව පවතී.",
"demoBottomSheetPersistentTitle": "දිගටම පවතින පහළ පත්රය",
"demoBottomSheetSubtitle": "දිගටම පවතින සහ ආදර්ශ පහළ පත්ර",
"demoTextFieldNameHasPhoneNumber": "{name} දුරකථන අංකය {phoneNumber}",
"buttonText": "බොත්තම",
"demoTypographyDescription": "Material Design හි දක්නට ලැබෙන විවිධ මුද්රණ විලාස සඳහා අර්ථ දැක්වීම්.",
"demoTypographySubtitle": "සියලු පූර්ව නිර්ණිත විලාස",
"demoTypographyTitle": "මුද්රණ ශිල්පය",
"demoFullscreenDialogDescription": "පූර්ණ තිර සංවාදය එන පිටුව පූර්ණ තිර ආකෘති සංවාදයක්ද යන්න නිශ්චිතව දක්වයි",
"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": "Flutter නිදර්ශන GitHub ගබඩාව",
"bottomNavigationContentPlaceholder": "{title} ටැබය සඳහා තැන් දරණුව",
"bottomNavigationCameraTab": "කැමරාව",
"bottomNavigationAlarmTab": "එලාමය",
"bottomNavigationAccountTab": "ගිණුම",
"demoTextFieldYourEmailAddress": "ඔබගේ ඉ-තැපැල් ලිපිනය",
"demoToggleButtonDescription": "සම්බන්ධිත විකල්ප සමූහගත කිරීමට ටොගල බොත්තම් භාවිත කළ හැකිය. සම්බන්ධිත ටොගල බොත්තම සමූහ අවධාරණය කිරීමට, සමූහයක් පොදු බහාලුමක් බෙදා ගත යුතුය",
"colorsGrey": "අළු",
"colorsBrown": "දුඹුරු",
"colorsDeepOrange": "ගැඹුරු තැඹිලි",
"colorsOrange": "තැඹිලි",
"colorsAmber": "ඇම්බර්",
"colorsYellow": "කහ",
"colorsLime": "දෙහි",
"colorsLightGreen": "ලා කොළ",
"colorsGreen": "කොළ",
"homeHeaderGallery": "ගැලරිය",
"homeHeaderCategories": "ප්රවර්ග",
"shrineDescription": "විලාසිතාමය සිල්ලර යෙදුමකි",
"craneDescription": "පෞද්ගලීකකරණය කළ සංචාරක යෙදුමක්",
"homeCategoryReference": "විලාස සහ වෙනත්",
"demoInvalidURL": "URL සංදර්ශනය කළ නොහැකි විය:",
"demoOptionsTooltip": "විකල්ප",
"demoInfoTooltip": "තතු",
"demoCodeTooltip": "ආදර්ශ කේතය",
"demoDocumentationTooltip": "API ප්රලේඛනය",
"demoFullscreenTooltip": "පූර්ණ තිරය",
"settingsTextScaling": "පෙළ පරිමාණ කිරීම",
"settingsTextDirection": "පෙළ දිශාව",
"settingsLocale": "පෙදෙසිය",
"settingsPlatformMechanics": "වේදිකා උපක්රම",
"settingsDarkTheme": "අඳුරු",
"settingsSlowMotion": "මන්දගාමී චලනය",
"settingsAbout": "Flutter Gallery ගැන",
"settingsFeedback": "ප්රතිපෝෂණ යවන්න",
"settingsAttribution": "ලන්ඩනයේ TOASTER විසින් නිර්මාණය කරන ලදි",
"demoButtonTitle": "බොත්තම්",
"demoButtonSubtitle": "පෙළ, එසවූ, වැටිසන යෙදූ සහ තවත්",
"demoFlatButtonTitle": "පැතලි බොත්තම",
"demoRaisedButtonDescription": "එසවූ බොත්තම් බොහෝ විට පැතලි පිරිසැලසුම් වෙත පිරිවිතර එක් කරයි. ඒවා කාර්ය බහුල හෝ පුළුල් ඉඩවල ශ්රිත අවධාරණය කරයි.",
"demoRaisedButtonTitle": "එසවූ බොත්තම",
"demoOutlineButtonTitle": "සරාංශ බොත්තම",
"demoOutlineButtonDescription": "වැටිසන බොත්තම් එබූ විට අපැහැදිලි වන අතර ඉස්සේ. ඒවා නිතර විකල්ප, ද්විතීයික ක්රියාවක් දැක්වීමට එසවූ බොත්තම් සමග යුගළ වේ.",
"demoToggleButtonTitle": "ටොගල බොත්තම්",
"colorsTeal": "තද හරිත නීල",
"demoFloatingButtonTitle": "පාවෙන ක්රියා බොත්තම",
"demoFloatingButtonDescription": "පාවෙන ක්රියා බොත්තමක් යනු යෙදුමෙහි මූලික ක්රියාවක් ප්රවර්ධනය කිරීමට අන්තර්ගතය උඩින් තබා ගන්නා බොත්තමකි.",
"demoDialogTitle": "සංවාද",
"demoDialogSubtitle": "සරල, ඇඟවීම සහ පූර්ණ තිරය",
"demoAlertDialogTitle": "ඇඟවීම",
"demoAlertDialogDescription": "ඇඟවීම් සංවාදයක් පිළිගැනීම අවශ්ය තත්ත්වයන් පිළිබඳ පරිශීලකට දැනුම් දෙයි. ඇඟවීම් සංවාදයකට විකල්ප මාතෘකාවක් සහ විකල්ප ක්රියා ලැයිස්තුවක් තිබේ.",
"demoAlertTitleDialogTitle": "මාතෘකාව සමග ඇඟවීම",
"demoSimpleDialogTitle": "සරල",
"demoSimpleDialogDescription": "සරල සංවාදයක් විකල්ප කීපයක් අතර තෝරා ගැනීමක් පිරිනමයි. සරල සංවාදයක තෝරා ගැනීම් ඉහළ සංදර්ශනය වන විකල්ප මාතෘකාවක් ඇත.",
"demoFullscreenDialogTitle": "පූර්ණ තිරය",
"demoCupertinoButtonsTitle": "බොත්තම්",
"demoCupertinoButtonsSubtitle": "iOS-විලාස බොත්තම්",
"demoCupertinoButtonsDescription": "iOS-විලාසයේ බොත්තමකි. එළිය වන සහ ස්පර්ශයේදී පෙළ සහ/හෝ අයිකනයක් ගනී. විකල්පව පසුබිමක් තිබිය හැකිය.",
"demoCupertinoAlertsTitle": "ඇඟවීම්",
"demoCupertinoAlertsSubtitle": "iOS-විලාස ඇඟවීම් සංවාද",
"demoCupertinoAlertTitle": "ඇඟවීම",
"demoCupertinoAlertDescription": "ඇඟවීම් සංවාදයක් පිළිගැනීම අවශ්ය තත්ත්වයන් පිළිබඳ පරිශීලකට දැනුම් දෙයි. ඇඟවීම් සංවාදයකට විකල්ප මාතෘකාවක්, විකල්ප අන්තර්ගතයක් සහ විකල්ප ක්රියා ලැයිස්තුවක් තිබේ. මාතෘකාව අන්තර්ගතය ඉහළින් සංදර්ශනය වන අතර ක්රියා අන්තර්ගතයට පහළින් සංදර්ශනය වේ.",
"demoCupertinoAlertWithTitleTitle": "මාතෘකාව සමග ඇඟවීම",
"demoCupertinoAlertButtonsTitle": "බොත්තම් සමග ඇඟවීම",
"demoCupertinoAlertButtonsOnlyTitle": "ඇඟවීම් බොත්තම් පමණයි",
"demoCupertinoActionSheetTitle": "ක්රියා පත්රය",
"demoCupertinoActionSheetDescription": "ක්රියා පත්රයක් යනු වත්මන් සංදර්භයට සම්බන්ධිත තෝරා ගැනීම් දෙකක හෝ වැඩි ගණනක කුලකයක් සහිත පරිශීලකට ඉදිරිපත් කරන විශේෂිත ඇඟවීමේ විලාසයකි. ක්රියා පත්රයක මාතෘකාවක්, අමතර පණිවිඩයක් සහ ක්රියා ලැයිස්තුවක් තිබිය හැකිය.",
"demoColorsTitle": "වර්ණ",
"demoColorsSubtitle": "පූර්ව නිශ්චිත වර්ණ සියල්ල",
"demoColorsDescription": "ද්රව්ය සැලසුමෙහි වර්ණ තැටිය නියෝජනය කරන වර්ණය සහ වර්ණ සාම්පල නියත.",
"buttonTextEnabled": "ENABLED",
"buttonTextDisabled": "DISABLED",
"buttonTextCreate": "තනන්න",
"dialogSelectedOption": "ඔබ මෙය තෝරා ඇත: \"{value}\"",
"dialogDiscardTitle": "කෙටුම්පත ඉවත ලන්නද?",
"dialogLocationTitle": "Google හි පිහිටීම් සේවාව භාවිත කරන්නද?",
"dialogLocationDescription": "යෙදුම්වලට ස්ථානය තීරණය කිරීම සඳහා සහාය වීමට Google හට ඉඩ දෙන්න. මෙයින් අදහස් කරන්නේ කිසිදු යෙදුමක් හෝ ධාවනය නොවන විට පවා Google වෙත නිර්නාමික ස්ථාන දත්ත යැවීමයි.",
"dialogCancel": "අවලංගු කරන්න",
"dialogDiscard": "ඉවත ලන්න",
"dialogDisagree": "එකඟ නොවේ",
"dialogAgree": "එකඟයි",
"dialogSetBackup": "උපස්ථ ගිණුම සකසන්න",
"colorsBlueGrey": "නීල අළු",
"dialogShow": "සංවාදය පෙන්වන්න",
"dialogFullscreenTitle": "පූර්ණ තිර සංවාදය",
"dialogFullscreenSave": "සුරකින්න",
"dialogFullscreenDescription": "සම්පූර්ණ තිර සංවාද ආදර්ශනයකි",
"cupertinoButtonEnabled": "Enabled",
"cupertinoButtonDisabled": "Disabled",
"cupertinoButtonWithBackground": "පසුබිම සමග",
"cupertinoAlertCancel": "අවලංගු කරන්න",
"cupertinoAlertDiscard": "ඉවත ලන්න",
"cupertinoAlertLocationTitle": "ඔබ යෙදුම භාවිත කරමින් සිටින අතරතුර \"සිතියම්\" හට ඔබේ ස්ථානයට ප්රවේශ වීමට ඉඩ දෙන්නද?",
"cupertinoAlertLocationDescription": "ඔබේ වත්මන් ස්ථානය සිතියමේ සංදර්ශනය වී දිශාවන්, අවට සෙවීම් ප්රතිඵල සහ ඇස්තමේන්තුගත සංචාර වේලාවන් සඳහා භාවිත කරනු ඇත.",
"cupertinoAlertAllow": "ඉඩ දෙන්න",
"cupertinoAlertDontAllow": "අවසර නොදෙන්න",
"cupertinoAlertFavoriteDessert": "ප්රියතම අතුරුපස තෝරන්න",
"cupertinoAlertDessertDescription": "කරුණාකර පහත ලැයිස්තුවෙන් ඔබේ ප්රියතම අතුරුපස වර්ගය තෝරන්න. ඔබේ තේරීම ඔබේ ප්රදේශයෙහි යෝජිත අවන්හල් ලැයිස්තුව අභිරුචිකරණය කිරීමට භාවිත කරනු ඇත.",
"cupertinoAlertCheesecake": "චීස් කේක්",
"cupertinoAlertTiramisu": "ටිරාමිසු",
"cupertinoAlertApplePie": "ඇපල් පයි",
"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_si.arb/0 | {
"file_path": "gallery/lib/l10n/intl_si.arb",
"repo_id": "gallery",
"token_count": 64900
} | 813 |
{
"loading": "Đang tải",
"deselect": "Bỏ chọn",
"select": "Chọn",
"selectable": "Chọn được (nhấn và giữ)",
"selected": "Đã chọn",
"demo": "Bản minh hoạ",
"bottomAppBar": "Thanh ứng dụng ở dưới cùng",
"notSelected": "Chưa chọn",
"demoCupertinoSearchTextFieldTitle": "Trường văn bản tìm kiếm",
"demoCupertinoPicker": "Bộ chọn",
"demoCupertinoSearchTextFieldSubtitle": "Trường văn bản tìm kiếm kiểu iOS",
"demoCupertinoSearchTextFieldDescription": "Một trường văn bản tìm kiếm cho phép người dùng tìm kiếm bằng cách nhập văn bản, ngoài ra còn có thể đưa ra và lọc các đề xuất.",
"demoCupertinoSearchTextFieldPlaceholder": "Nhập nội dung văn bản",
"demoCupertinoScrollbarTitle": "Thanh cuộn",
"demoCupertinoScrollbarSubtitle": "Thanh cuộn kiểu iOS",
"demoCupertinoScrollbarDescription": "Một thanh cuộn bao bọc phần tử con đã cho",
"demoTwoPaneItem": "Mục {value}",
"demoTwoPaneList": "Danh sách",
"demoTwoPaneFoldableLabel": "Thiết bị có thể gập lại",
"demoTwoPaneSmallScreenLabel": "Thiết bị có màn hình nhỏ",
"demoTwoPaneSmallScreenDescription": "Bản minh hoạ cách TwoPane hoạt động trên thiết bị có màn hình nhỏ.",
"demoTwoPaneTabletLabel": "Máy tính bảng/Máy tính để bàn",
"demoTwoPaneTabletDescription": "Bản minh hoạ cách TwoPane hoạt động trên thiết bị có màn hình lớn hơn như máy tính bảng hoặc máy tính.",
"demoTwoPaneTitle": "TwoPane",
"demoTwoPaneSubtitle": "Bố cục thích ứng trên màn hình của thiết bị có thể gập lại, màn hình lớn và màn hình nhỏ",
"splashSelectDemo": "Hãy chọn một bản minh hoạ",
"demoTwoPaneFoldableDescription": "Bản minh hoạ cách TwoPane hoạt động trên thiết bị có thể gập lại.",
"demoTwoPaneDetails": "Thông tin chi tiết",
"demoTwoPaneSelectItem": "Hãy chọn một mục",
"demoTwoPaneItemDetails": "Thông tin chi tiết về mục {value}",
"demoCupertinoContextMenuActionText": "Chạm và giữ biểu tượng Flutter để xem trình đơn theo bối cảnh.",
"demoCupertinoContextMenuDescription": "Một trình đơn theo bối cảnh toàn màn hình mang phong cách iOS xuất hiện khi người dùng nhấn và giữ một thành phần.",
"demoAppBarTitle": "Thanh ứng dụng",
"demoAppBarDescription": "Thanh ứng dụng cung cấp nội dung và thao tác liên quan đến màn hình hiện tại. Bạn có thể dùng thanh này cho hoạt động xây dựng thương hiệu, tiêu đề màn hình, thông tin điều hướng và thao tác",
"demoDividerTitle": "Đường phân chia",
"demoDividerSubtitle": "Đường phân chia là một đường thẳng mỏng giúp nhóm nội dung thành các danh sách và bố cục.",
"demoDividerDescription": "Đường phân chia có thể được sử dụng trong danh sách, ngăn hoặc nơi khác để phân cách nội dung.",
"demoVerticalDividerTitle": "Đường phân chia dọc",
"demoCupertinoContextMenuTitle": "Trình đơn theo bối cảnh",
"demoCupertinoContextMenuSubtitle": "Trình đơn theo bối cảnh phong cách iOS",
"demoAppBarSubtitle": "Hiện thông tin và thao tác liên quan đến màn hình hiện tại",
"demoCupertinoContextMenuActionOne": "Thao tác 1",
"demoCupertinoContextMenuActionTwo": "Thao tác 2",
"demoDateRangePickerDescription": "Hiện hộp thoại chứa bộ chọn phạm vi ngày Material Design.",
"demoDateRangePickerTitle": "Bộ chọn phạm vi ngày",
"demoNavigationDrawerUserName": "Tên người dùng",
"demoNavigationDrawerUserEmail": "[email protected]",
"demoNavigationDrawerText": "Vuốt từ cạnh màn hình hoặc nhấn vào biểu tượng ở phía trên bên trái để xem ngăn",
"demoNavigationRailTitle": "Dải điều hướng",
"demoNavigationRailSubtitle": "Hiển thị dải điều hướng trong một ứng dụng",
"demoNavigationRailDescription": "Tiện ích của Material Design được hiển thị ở bên trái hoặc bên phải của một ứng dụng để di chuyển giữa một số ít lượt xem, thông thường là từ 3 đến 5 lượt.",
"demoNavigationRailFirst": "Thứ nhất",
"demoNavigationDrawerTitle": "Ngăn điều hướng",
"demoNavigationRailThird": "Thứ ba",
"replyStarredLabel": "Có gắn dấu sao",
"demoTextButtonDescription": "Nút văn bản hiển thị hình ảnh giọt mực bắn tung tóe khi nhấn giữ. Dùng nút văn bản trên thanh công cụ, hộp thoại và cùng dòng với khoảng đệm",
"demoElevatedButtonTitle": "Nút lồi",
"demoElevatedButtonDescription": "Các nút lồi sẽ làm gia tăng kích thước đối với hầu hết các bố cục phẳng. Các nút này làm nổi bật những chức năng trên không gian rộng hoặc có mật độ dày đặc.",
"demoOutlinedButtonTitle": "Nút có đường viền",
"demoOutlinedButtonDescription": "Các nút có đường viền sẽ mờ đi rồi hiện rõ lên khi nhấn. Các nút này thường xuất hiện cùng các nút lồi để biểu thị hành động phụ, thay thế.",
"demoContainerTransformDemoInstructions": "Thẻ, danh sách và FAB",
"demoNavigationDrawerSubtitle": "Hiển thị một ngăn trong thanh ứng dụng",
"replyDescription": "Ứng dụng email tập trung và hiệu quả",
"demoNavigationDrawerDescription": "Bảng điều khiển Material Design trượt theo chiều ngang từ cạnh màn hình để hiển thị đường liên kết điều hướng trong một ứng dụng.",
"replyDraftsLabel": "Thư nháp",
"demoNavigationDrawerToPageOne": "Mục một",
"replyInboxLabel": "Hộp thư đến",
"demoSharedXAxisDemoInstructions": "Nút Tiếp theo và nút Quay lại",
"replySpamLabel": "Thư rác",
"replyTrashLabel": "Thùng rác",
"replySentLabel": "Đã gửi",
"demoNavigationRailSecond": "Thứ hai",
"demoNavigationDrawerToPageTwo": "Mục hai",
"demoFadeScaleDemoInstructions": "Hộp thoại và FAB",
"demoFadeThroughDemoInstructions": "Thanh điều hướng dưới cùng",
"demoSharedZAxisDemoInstructions": "Nút biểu tượng Cài đặt",
"demoSharedYAxisDemoInstructions": "Lọc theo mục \"Phát gần đây\"",
"demoTextButtonTitle": "Nút văn bản",
"demoSharedZAxisBeefSandwichRecipeTitle": "Bánh sandwich bò",
"demoSharedZAxisDessertRecipeDescription": "Công thức làm món tráng miệng",
"demoSharedYAxisAlbumTileSubtitle": "Nghệ sĩ",
"demoSharedYAxisAlbumTileTitle": "Album",
"demoSharedYAxisRecentSortTitle": "Phát gần đây",
"demoSharedYAxisAlphabeticalSortTitle": "A-Z",
"demoSharedYAxisAlbumCount": "268 album",
"demoSharedYAxisTitle": "Trục y chung",
"demoSharedXAxisCreateAccountButtonText": "TẠO TÀI KHOẢN",
"demoFadeScaleAlertDialogDiscardButton": "HỦY",
"demoSharedXAxisSignInTextFieldLabel": "Email hoặc số điện thoại",
"demoSharedXAxisSignInSubtitleText": "Đăng nhập bằng tài khoản của bạn",
"demoSharedXAxisSignInWelcomeText": "Xin chào David Park",
"demoSharedXAxisIndividualCourseSubtitle": "Hiển thị riêng lẻ",
"demoSharedXAxisBundledCourseSubtitle": "Theo gói",
"demoFadeThroughAlbumsDestination": "Album",
"demoSharedXAxisDesignCourseTitle": "Thiết kế",
"demoSharedXAxisIllustrationCourseTitle": "Minh họa",
"demoSharedXAxisBusinessCourseTitle": "Kinh doanh",
"demoSharedXAxisArtsAndCraftsCourseTitle": "Thủ công và mỹ nghệ",
"demoMotionPlaceholderSubtitle": "Văn bản thứ cấp",
"demoFadeScaleAlertDialogCancelButton": "HỦY",
"demoFadeScaleAlertDialogHeader": "Hộp thoại thông báo",
"demoFadeScaleHideFabButton": "ẨN NÚT HÀNH ĐỘNG NỔI",
"demoFadeScaleShowFabButton": "HIỆN NÚT HÀNH ĐỘNG NỔI",
"demoFadeScaleShowAlertDialogButton": "HIỆN HỘP THOẠI",
"demoFadeScaleDescription": "Mẫu làm mờ được dùng cho các thành phần giao diện người dùng đi vào hoặc thoát ra trong phạm vi màn hình, chẳng hạn như một hộp thoại mờ dần ở giữa màn hình.",
"demoFadeScaleTitle": "Làm mờ",
"demoFadeThroughTextPlaceholder": "123 ảnh",
"demoFadeThroughSearchDestination": "Tìm kiếm",
"demoFadeThroughPhotosDestination": "Ảnh",
"demoSharedXAxisCoursePageSubtitle": "Các danh mục theo gói sẽ xuất hiện ở dạng nhóm trong nguồn cấp dữ liệu của bạn. Bạn luôn có thể thay đổi tùy chọn này vào lúc khác.",
"demoFadeThroughDescription": "Mẫu chuyển mờ được dùng cho quá trình chuyển đổi giữa các thành phần giao diện người dùng không có mối quan hệ chặt chẽ với nhau.",
"demoFadeThroughTitle": "Chuyển mờ",
"demoSharedZAxisHelpSettingLabel": "Trợ giúp",
"demoMotionSubtitle": "Tất cả mẫu chuyển đổi định sẵn",
"demoSharedZAxisNotificationSettingLabel": "Thông báo",
"demoSharedZAxisProfileSettingLabel": "Hồ sơ",
"demoSharedZAxisSavedRecipesListTitle": "Công thức nấu ăn đã lưu",
"demoSharedZAxisBeefSandwichRecipeDescription": "Công thức làm bánh sandwich bò",
"demoSharedZAxisCrabPlateRecipeDescription": "Công thức làm món cua",
"demoSharedXAxisCoursePageTitle": "Tinh giản các khóa học",
"demoSharedZAxisCrabPlateRecipeTitle": "Cua",
"demoSharedZAxisShrimpPlateRecipeDescription": "Công thức làm món tôm",
"demoSharedZAxisShrimpPlateRecipeTitle": "Tôm",
"demoContainerTransformTypeFadeThrough": "CHUYỂN MỜ",
"demoSharedZAxisDessertRecipeTitle": "Món tráng miệng",
"demoSharedZAxisSandwichRecipeDescription": "Công thức làm bánh sandwich",
"demoSharedZAxisSandwichRecipeTitle": "Bánh sandwich",
"demoSharedZAxisBurgerRecipeDescription": "Công thức làm bánh mì kẹp",
"demoSharedZAxisBurgerRecipeTitle": "Bánh mì kẹp",
"demoSharedZAxisSettingsPageTitle": "Cài đặt",
"demoSharedZAxisTitle": "Trục z chung",
"demoSharedZAxisPrivacySettingLabel": "Quyền riêng tư",
"demoMotionTitle": "Chuyển động",
"demoContainerTransformTitle": "Biến đổi vùng chứa",
"demoContainerTransformDescription": "Mẫu biến đổi vùng chứa được thiết kế cho quá trình chuyển đổi giữa các thành phần giao diện người dùng có vùng chứa. Mẫu này tạo ra sự kết nối dễ thấy giữa 2 thành phần giao diện người dùng",
"demoContainerTransformModalBottomSheetTitle": "Chế độ làm mờ",
"demoContainerTransformTypeFade": "LÀM MỜ",
"demoSharedYAxisAlbumTileDurationUnit": "phút",
"demoMotionPlaceholderTitle": "Tiêu đề",
"demoSharedXAxisForgotEmailButtonText": "BẠN QUÊN EMAIL?",
"demoMotionSmallPlaceholderSubtitle": "Thứ cấp",
"demoMotionDetailsPageTitle": "Trang chi tiết",
"demoMotionListTileTitle": "Mục danh sách",
"demoSharedAxisDescription": "Mẫu trục chung được dùng cho quá trình chuyển đổi giữa các thành phần giao diện người dùng có mối quan hệ về hướng hoặc không gian. Mẫu này dùng sự biến đổi chung trên trục x, y hoặc z để củng cố mối quan hệ giữa các thành phần.",
"demoSharedXAxisTitle": "Trục x chung",
"demoSharedXAxisBackButtonText": "QUAY LẠI",
"demoSharedXAxisNextButtonText": "TIẾP THEO",
"demoSharedXAxisCulinaryCourseTitle": "Ẩm thực",
"githubRepo": "Kho lưu trữ {repoName} trên GitHub",
"fortnightlyMenuUS": "Hoa Kỳ",
"fortnightlyMenuBusiness": "Kinh doanh",
"fortnightlyMenuScience": "Khoa học",
"fortnightlyMenuSports": "Thể thao",
"fortnightlyMenuTravel": "Du lịch",
"fortnightlyMenuCulture": "Văn hóa",
"fortnightlyTrendingTechDesign": "TechDesign",
"rallyBudgetDetailAmountLeft": "Số tiền còn lại",
"fortnightlyHeadlineArmy": "Cải cách Green Army từ bên trong",
"fortnightlyDescription": "Ứng dụng tin tức dành cho những nội dung đặc sắc",
"rallyBillDetailAmountDue": "Số tiền phải thanh toán",
"rallyBudgetDetailTotalCap": "Tổng số tiền",
"rallyBudgetDetailAmountUsed": "Số tiền đã dùng",
"fortnightlyTrendingHealthcareRevolution": "HealthcareRevolution",
"fortnightlyMenuFrontPage": "Trang đầu",
"fortnightlyMenuWorld": "Thế giới",
"rallyBillDetailAmountPaid": "Số tiền đã thanh toán",
"fortnightlyMenuPolitics": "Chính trị",
"fortnightlyHeadlineBees": "Thiếu hụt nguồn cung ong nuôi",
"fortnightlyHeadlineGasoline": "Tương lai của xăng dầu",
"fortnightlyTrendingGreenArmy": "GreenArmy",
"fortnightlyHeadlineFeminists": "Chủ nghĩa nữ quyền thách thức các đảng chính trị",
"fortnightlyHeadlineFabrics": "Nhiều nhà thiết kế dùng công nghệ để tạo ra loại vải thế hệ mới",
"fortnightlyHeadlineStocks": "Khi cổ phiếu chứng khoán đình trệ, nhiều người chuyển sang dự trữ tiền tệ",
"fortnightlyTrendingReform": "Reform",
"fortnightlyMenuTech": "Công nghệ",
"fortnightlyHeadlineWar": "Những người Mỹ phải chia ly trong thời chiến",
"fortnightlyHeadlineHealthcare": "Cuộc cải cách y tế âm thầm mà bền bỉ",
"fortnightlyLatestUpdates": "Thông tin cập nhật mới nhất",
"fortnightlyTrendingStocks": "Stocks",
"rallyBillDetailTotalAmount": "Tổng số tiền",
"demoCupertinoPickerDateTime": "Ngày và giờ",
"signIn": "ĐĂNG NHẬP",
"dataTableRowWithSugar": "{value} phủ đường",
"dataTableRowApplePie": "Bánh táo",
"dataTableRowDonut": "Donut",
"dataTableRowHoneycomb": "Honeycomb",
"dataTableRowLollipop": "Lollipop",
"dataTableRowJellyBean": "Jelly bean",
"dataTableRowGingerbread": "Gingerbread",
"dataTableRowCupcake": "Cupcake",
"dataTableRowEclair": "Eclair",
"dataTableRowIceCreamSandwich": "Ice Cream Sandwich",
"dataTableRowFrozenYogurt": "Sữa chua đông lạnh",
"dataTableColumnIron": "Sắt (%)",
"dataTableColumnCalcium": "Canxi (%)",
"dataTableColumnSodium": "Natri (mg)",
"demoTimePickerTitle": "Bộ chọn giờ",
"demo2dTransformationsResetTooltip": "Đặt lại phép biến đổi",
"dataTableColumnFat": "Chất béo (g)",
"dataTableColumnCalories": "Calo",
"dataTableColumnDessert": "Đồ tráng miệng (1 suất)",
"cardsDemoTravelDestinationLocation1": "Thanjavur, Tamil Nadu",
"demoTimePickerDescription": "Hiển thị hộp thoại chứa bộ chọn giờ Material Design.",
"demoPickersShowPicker": "HIỂN THỊ BỘ CHỌN",
"demoTabsScrollingTitle": "Cuộn",
"demoTabsNonScrollingTitle": "Không cuộn",
"craneHours": "{hours,plural,=1{1 giờ}other{{hours} giờ}}",
"craneMinutes": "{minutes,plural,=1{1 phút}other{{minutes} phút}}",
"craneFlightDuration": "{hoursShortForm} {minutesShortForm}",
"dataTableHeader": "Dinh dưỡng",
"demoDatePickerTitle": "Bộ chọn ngày",
"demoPickersSubtitle": "Chọn ngày và giờ",
"demoPickersTitle": "Bộ chọn",
"demo2dTransformationsEditTooltip": "Chỉnh sửa thẻ thông tin",
"demoDataTableDescription": "Bảng dữ liệu trình bày thông tin ở định dạng lưới gồm hàng và cột. Những bảng này sắp xếp thông tin theo cách rõ ràng, dễ tra cứu để người dùng có thể tìm mẫu và thông tin chi tiết.",
"demo2dTransformationsDescription": "Nhấn để chỉnh sửa thẻ thông tin rồi dùng cử chỉ để di chuyển xung quanh cảnh. Kéo để di chuyển, chụm để thu phóng, xoay bằng 2 ngón tay. Nhấn nút đặt lại để trở về hướng bắt đầu.",
"demo2dTransformationsSubtitle": "Dịch chuyển, thu phóng, xoay",
"demo2dTransformationsTitle": "Phép biến đổi 2D",
"demoCupertinoTextFieldPIN": "Mã PIN",
"demoCupertinoTextFieldDescription": "Trường văn bản để người dùng nhập văn bản bằng bàn phím thực hoặc bàn phím ảo.",
"demoCupertinoTextFieldSubtitle": "Trường văn bản kiểu iOS",
"demoCupertinoTextFieldTitle": "Trường văn bản",
"demoDatePickerDescription": "Hiển thị hộp thoại chứa bộ chọn ngày Material Design.",
"demoCupertinoPickerTime": "Giờ",
"demoCupertinoPickerDate": "Ngày",
"demoCupertinoPickerTimer": "Hẹn giờ",
"demoCupertinoPickerDescription": "Một tiện ích bộ chọn kiểu iOS có thể dùng để chọn chuỗi, ngày, giờ hoặc cả ngày và giờ.",
"demoCupertinoPickerSubtitle": "Bộ chọn kiểu iOS",
"demoCupertinoPickerTitle": "Bộ chọn",
"dataTableRowWithHoney": "{value} phủ mật ong",
"cardsDemoTravelDestinationCity2": "Chettinad",
"bannerDemoResetText": "Đặt lại biểu ngữ",
"bannerDemoMultipleText": "Nhiều hành động",
"bannerDemoLeadingText": "Biểu tượng hàng đầu",
"dismiss": "BỎ QUA",
"cardsDemoTappable": "Có thể nhấn",
"cardsDemoSelectable": "Có thể chọn (nhấn và giữ)",
"cardsDemoExplore": "Khám phá",
"cardsDemoExploreSemantics": "Khám phá {destinationName}",
"cardsDemoShareSemantics": "Chia sẻ {destinationName}",
"cardsDemoTravelDestinationTitle1": "10 thành phố hàng đầu phải ghé thăm ở Tamil Nadu",
"cardsDemoTravelDestinationDescription1": "Số 10",
"cardsDemoTravelDestinationCity1": "Thanjavur",
"dataTableColumnProtein": "Chất đạm (g)",
"cardsDemoTravelDestinationTitle2": "Thợ thủ công ở Nam Ấn Độ",
"cardsDemoTravelDestinationDescription2": "Xa quay tơ",
"bannerDemoText": "Mật khẩu của bạn đã được cập nhật trên thiết bị kia. Vui lòng đăng nhập lại.",
"cardsDemoTravelDestinationLocation2": "Sivaganga, Tamil Nadu",
"cardsDemoTravelDestinationTitle3": "Đền Brihadisvara",
"cardsDemoTravelDestinationDescription3": "Đền",
"demoBannerTitle": "Biểu ngữ",
"demoBannerSubtitle": "Hiển thị một biểu ngữ trong danh sách",
"demoBannerDescription": "Một biểu ngữ hiển thị thông điệp quan trọng, súc tích và đưa ra các hành động để người dùng xử lý (hoặc bỏ qua biểu ngữ). Cần có hành động của người dùng để bỏ qua biểu ngữ.",
"demoCardTitle": "Thẻ",
"demoCardSubtitle": "Thẻ đường cơ sở có góc tròn",
"demoCardDescription": "Thẻ là một tờ Vật liệu dùng để trình bày một số thông tin có liên quan, ví dụ như album, vị trí địa lý, một bữa ăn, chi tiết liên hệ, v.v.",
"demoDataTableTitle": "Bảng dữ liệu",
"demoDataTableSubtitle": "Hàng và cột thông tin",
"dataTableColumnCarbs": "Carb (g)",
"placeTanjore": "Tanjore",
"demoGridListsTitle": "Danh sách dạng lưới",
"placeFlowerMarket": "Chợ hoa",
"placeBronzeWorks": "Xưởng đúc đồng",
"placeMarket": "Chợ",
"placeThanjavurTemple": "Đền Thanjavur",
"placeSaltFarm": "Cánh đồng muối",
"placeScooters": "Xe Scooter",
"placeSilkMaker": "Máy làm lụa",
"placeLunchPrep": "Chuẩn bị bữa trưa",
"placeBeach": "Bãi biển",
"placeFisherman": "Người đánh cá",
"demoMenuSelected": "Đã chọn: {value}",
"demoMenuRemove": "Xóa",
"demoMenuGetLink": "Nhận đường liên kết",
"demoMenuShare": "Chia sẻ",
"demoBottomAppBarSubtitle": "Hiển thị ngăn điều hướng và các hành động ở dưới cùng",
"demoMenuAnItemWithASectionedMenu": "Mục có trình đơn theo phần",
"demoMenuADisabledMenuItem": "Mục có trình đơn ở trạng thái vô hiệu hóa",
"demoLinearProgressIndicatorTitle": "Chỉ báo tiến trình tuyến tính",
"demoMenuContextMenuItemOne": "Mục đầu tiên trong trình đơn ngữ cảnh",
"demoMenuAnItemWithASimpleMenu": "Mục có trình đơn đơn giản",
"demoCustomSlidersTitle": "Thanh trượt tùy chỉnh",
"demoMenuAnItemWithAChecklistMenu": "Mục có trình đơn danh sách kiểm tra",
"demoCupertinoActivityIndicatorTitle": "Chỉ báo hoạt động",
"demoCupertinoActivityIndicatorSubtitle": "Chỉ báo hoạt động theo kiểu iOS",
"demoCupertinoActivityIndicatorDescription": "Chỉ báo hoạt động theo kiểu iOS quay theo chiều kim đồng hồ.",
"demoCupertinoNavigationBarTitle": "Thanh điều hướng",
"demoCupertinoNavigationBarSubtitle": "Thanh điều hướng theo kiểu iOS",
"demoCupertinoNavigationBarDescription": "Một thanh điều hướng theo kiểu iOS. Thanh điều hướng là thanh công cụ có tối thiểu một tiêu đề trang ở giữa.",
"demoCupertinoPullToRefreshTitle": "Kéo để làm mới",
"demoCupertinoPullToRefreshSubtitle": "Tùy chọn kiểm soát kéo để làm mới theo kiểu iOS",
"demoCupertinoPullToRefreshDescription": "Một tiện ích giúp kiểm soát thao tác kéo để làm mới nội dung theo kiểu iOS.",
"demoProgressIndicatorTitle": "Chỉ báo tiến trình",
"demoProgressIndicatorSubtitle": "Tuyến tính, vòng tròn, không xác định",
"demoCircularProgressIndicatorTitle": "Chỉ báo tiến trình vòng tròn",
"demoCircularProgressIndicatorDescription": "Chỉ báo tiến trình vòng tròn trong Material Design, quay vòng để chỉ ra rằng ứng dụng đang bận.",
"demoMenuFour": "Bốn",
"demoLinearProgressIndicatorDescription": "Chỉ báo tiến trình tuyến tính trong Material Design, còn được gọi là thanh tiến trình.",
"demoTooltipTitle": "Chú giải công cụ",
"demoTooltipSubtitle": "Hiện thông báo ngắn khi nhấn và giữ hoặc di chuột",
"demoTooltipDescription": "Chú giải công cụ cung cấp nhãn văn bản làm rõ chức năng của nút hoặc hành động khác trong giao diện người dùng. Chú giải công cụ hiển thị văn bản cung cấp thông tin khi người dùng di chuột qua, trỏ vào hoặc nhấn và giữ một phần tử.",
"demoTooltipInstructions": "Nhấn và giữ hoặc di chuột để hiển thị chú giải công cụ.",
"placeChennai": "Chennai",
"demoMenuChecked": "Đã kiểm tra: {value}",
"placeChettinad": "Chettinad",
"demoMenuPreview": "Xem trước",
"demoBottomAppBarTitle": "Thanh ứng dụng ở dưới cùng",
"demoBottomAppBarDescription": "Với thanh ứng dụng ở dưới cùng, bạn có thể truy cập vào ngăn điều hướng ở dưới cùng và tối đa 4 hành động, bao gồm cả nút hành động nổi.",
"bottomAppBarNotch": "Vết cắt",
"bottomAppBarPosition": "Vị trí của nút hành động nổi",
"bottomAppBarPositionDockedEnd": "Cố định – Ở cuối",
"bottomAppBarPositionDockedCenter": "Cố định – Ở giữa",
"bottomAppBarPositionFloatingEnd": "Nổi – Ở cuối",
"bottomAppBarPositionFloatingCenter": "Nổi – Ở giữa",
"demoSlidersEditableNumericalValue": "Giá trị số có thể chỉnh sửa",
"demoGridListsSubtitle": "Bố cục hàng và cột",
"demoGridListsDescription": "Danh sách dạng lưới là hình thức phù hợp nhất để trình bày dữ liệu có tính chất đồng nhất, cụ thể là hình ảnh. Mỗi mục trong danh sách dạng lưới được gọi là một ô.",
"demoGridListsImageOnlyTitle": "Chỉ hình ảnh",
"demoGridListsHeaderTitle": "Có phần đầu trang",
"demoGridListsFooterTitle": "Có phần chân trang",
"demoSlidersTitle": "Thanh trượt",
"demoSlidersSubtitle": "Tiện ích để chọn giá trị bằng cách vuốt",
"demoSlidersDescription": "Thanh trượt biểu thị khoảng giá trị dọc theo một thanh mà người dùng có thể chọn một giá trị từ đó. Thanh trượt là lựa chọn lý tưởng để điều chỉnh các tùy chọn cài đặt như âm lượng, độ sáng hoặc áp dụng bộ lọc hình ảnh.",
"demoRangeSlidersTitle": "Thanh trượt khoảng",
"demoRangeSlidersDescription": "Thanh trượt biểu thị khoảng giá trị dọc theo một thanh. Thanh trượt có thể có các biểu tượng ở cả hai đầu thanh biểu thị khoảng giá trị. Thanh trượt là lựa chọn lý tưởng để điều chỉnh các tùy chọn cài đặt như âm lượng, độ sáng hoặc áp dụng bộ lọc hình ảnh.",
"demoMenuAnItemWithAContextMenuButton": "Mục có trình đơn ngữ cảnh",
"demoCustomSlidersDescription": "Thanh trượt biểu thị khoảng giá trị dọc theo một thanh mà người dùng có thể chọn một giá trị hoặc khoảng giá trị từ đó. Bạn có thể tùy chỉnh và tạo giao diện cho thanh trượt.",
"demoSlidersContinuousWithEditableNumericalValue": "Liên tục với giá trị số có thể chỉnh sửa",
"demoSlidersDiscrete": "Rời rạc",
"demoSlidersDiscreteSliderWithCustomTheme": "Thanh trượt rời rạc có chủ đề tùy chỉnh",
"demoSlidersContinuousRangeSliderWithCustomTheme": "Thanh trượt khoảng liên tục có chủ đề tùy chỉnh",
"demoSlidersContinuous": "Liên tục",
"placePondicherry": "Pondicherry",
"demoMenuTitle": "Trình đơn",
"demoContextMenuTitle": "Trình đơn ngữ cảnh",
"demoSectionedMenuTitle": "Trình đơn theo phần",
"demoSimpleMenuTitle": "Trình đơn đơn giản",
"demoChecklistMenuTitle": "Trình đơn danh sách kiểm tra",
"demoMenuSubtitle": "Nút trình đơn và trình đơn đơn giản",
"demoMenuDescription": "Trình đơn sẽ hiển thị một danh sách các lựa chọn trên giao diện tạm thời. Các lựa chọn sẽ xuất hiện khi người dùng tương tác với một nút, hành động hoặc tùy chọn kiểm soát khác.",
"demoMenuItemValueOne": "Mục đầu tiên trong trình đơn",
"demoMenuItemValueTwo": "Mục thứ hai trong trình đơn",
"demoMenuItemValueThree": "Mục thứ ba trong trình đơn",
"demoMenuOne": "Một",
"demoMenuTwo": "Hai",
"demoMenuThree": "Ba",
"demoMenuContextMenuItemThree": "Mục thứ ba trong trình đơn ngữ cảnh",
"demoCupertinoSwitchSubtitle": "Nút chuyển theo kiểu iOS",
"demoSnackbarsText": "Đây là thanh thông báo nhanh.",
"demoCupertinoSliderSubtitle": "Thanh trượt theo kiểu iOS",
"demoCupertinoSliderDescription": "Bạn có thể dùng thanh trượt để chọn trong một tập hợp các giá trị liên tục hoặc rời rạc.",
"demoCupertinoSliderContinuous": "Liên tục: {value}",
"demoCupertinoSliderDiscrete": "Rời rạc: {value}",
"demoSnackbarsAction": "Bạn đã nhấn vào một hành động trên thanh thông báo nhanh.",
"backToGallery": "Quay lại Thư viện",
"demoCupertinoTabBarTitle": "Thanh thẻ",
"demoCupertinoSwitchDescription": "Bạn có thể dùng nút chuyển để chuyển đổi trạng thái bật/tắt của một tùy chọn cài đặt.",
"demoSnackbarsActionButtonLabel": "HÀNH ĐỘNG",
"cupertinoTabBarProfileTab": "Hồ sơ",
"demoSnackbarsButtonLabel": "HIỂN THỊ THANH THÔNG BÁO NHANH",
"demoSnackbarsDescription": "Thanh thông báo nhanh cho người dùng biết về quá trình mà một ứng dụng đã hoặc sẽ thực hiện. Những thanh thông báo này xuất hiện một cách tạm thời về phía cuối màn hình. Chúng không làm gián đoạn trải nghiệm người dùng cũng như không yêu cầu ẩn hoạt động đầu vào của người dùng.",
"demoSnackbarsSubtitle": "Thanh thông báo nhanh hiển thị các thông báo ở cuối màn hình",
"demoSnackbarsTitle": "Thanh thông báo nhanh",
"demoCupertinoSliderTitle": "Thanh trượt",
"cupertinoTabBarChatTab": "Trò chuyện",
"cupertinoTabBarHomeTab": "Trang chủ",
"demoCupertinoTabBarDescription": "Thanh tab điều hướng dưới cùng theo kiểu iOS. Hiển thị nhiều tab khi đang mở một tab, tab đầu tiên hiển thị theo mặc định.",
"demoCupertinoTabBarSubtitle": "Thanh tab dưới cùng theo kiểu iOS",
"demoOptionsFeatureTitle": "Xem các tùy chọn",
"demoOptionsFeatureDescription": "Nhấn vào đây để xem các tùy chọn có sẵn cho bản minh họa này.",
"demoCodeViewerCopyAll": "SAO CHÉP TOÀN BỘ",
"shrineScreenReaderRemoveProductButton": "Xóa {product}",
"shrineScreenReaderProductAddToCart": "Thêm vào giỏ hàng",
"shrineScreenReaderCart": "{quantity,plural,=0{Giỏ hàng, không có mặt hàng nào}=1{Giỏ hàng, có 1 mặt hàng}other{Giỏ hàng, có {quantity} mặt hàng}}",
"demoCodeViewerFailedToCopyToClipboardMessage": "Không sao chép được vào bảng nhớ tạm: {error}",
"demoCodeViewerCopiedToClipboardMessage": "Đã sao chép vào bảng nhớ tạm.",
"craneSleep8SemanticLabel": "Những vết tích của nền văn minh Maya ở một vách đá phía trên bãi biển",
"craneSleep4SemanticLabel": "Khách sạn bên hồ phía trước những ngọn núi",
"craneSleep2SemanticLabel": "Thành cổ Machu Picchu",
"craneSleep1SemanticLabel": "Căn nhà gỗ trong khung cảnh đầy tuyết với cây thường xanh xung quanh",
"craneSleep0SemanticLabel": "Nhà gỗ một tầng trên mặt nước",
"craneFly13SemanticLabel": "Bể bơi ven biển xung quanh là những cây cọ",
"craneFly12SemanticLabel": "Bể bơi xung quanh là những cây cọ",
"craneFly11SemanticLabel": "Ngọn hải đăng xây bằng gạch trên biển",
"craneFly10SemanticLabel": "Tháp Al-Azhar Mosque lúc hoàng hôn",
"craneFly9SemanticLabel": "Người đàn ông tựa vào chiếc xe ô tô cổ màu xanh dương",
"craneFly8SemanticLabel": "Supertree Grove",
"craneEat9SemanticLabel": "Quầy cà phê bày những chiếc bánh ngọt",
"craneEat2SemanticLabel": "Bánh mì kẹp",
"craneFly5SemanticLabel": "Khách sạn bên hồ phía trước những ngọn núi",
"demoSelectionControlsSubtitle": "Các hộp kiểm, nút radio và công tắc",
"craneEat10SemanticLabel": "Người phụ nữ cầm chiếc bánh sandwich kẹp thịt bò hun khói siêu to",
"craneFly4SemanticLabel": "Nhà gỗ một tầng trên mặt nước",
"craneEat7SemanticLabel": "Lối vào tiệm bánh",
"craneEat6SemanticLabel": "Món ăn làm từ tôm",
"craneEat5SemanticLabel": "Khu vực ghế ngồi đậm chất nghệ thuật tại nhà hàng",
"craneEat4SemanticLabel": "Món tráng miệng làm từ sô-cô-la",
"craneEat3SemanticLabel": "Món taco của Hàn Quốc",
"craneFly3SemanticLabel": "Thành cổ Machu Picchu",
"craneEat1SemanticLabel": "Quầy bar không người với những chiếc ghế đẩu chuyên dùng trong bar",
"craneEat0SemanticLabel": "Bánh pizza trong một lò nướng bằng củi",
"craneSleep11SemanticLabel": "Tòa nhà chọc trời Đài Bắc 101",
"craneSleep10SemanticLabel": "Tháp Al-Azhar Mosque lúc hoàng hôn",
"craneSleep9SemanticLabel": "Ngọn hải đăng xây bằng gạch trên biển",
"craneEat8SemanticLabel": "Đĩa tôm hùm đất",
"craneSleep7SemanticLabel": "Những ngôi nhà rực rỡ sắc màu tại Quảng trường Riberia",
"craneSleep6SemanticLabel": "Bể bơi xung quanh là những cây cọ",
"craneSleep5SemanticLabel": "Chiếc lều giữa cánh đồng",
"settingsButtonCloseLabel": "Đóng phần cài đặt",
"demoSelectionControlsCheckboxDescription": "Các hộp kiểm cho phép người dùng chọn nhiều tùy chọn trong một tập hợp. Giá trị thông thường của hộp kiểm là true hoặc false và giá trị 3 trạng thái của hộp kiểm cũng có thể là null.",
"settingsButtonLabel": "Phần cài đặt",
"demoListsTitle": "Danh sách",
"demoListsSubtitle": "Bố cục của danh sách cuộn",
"demoListsDescription": "Một hàng có chiều cao cố định thường chứa một số văn bản cũng như biểu tượng ở đầu hoặc ở cuối.",
"demoOneLineListsTitle": "1 dòng",
"demoTwoLineListsTitle": "2 dòng",
"demoListsSecondary": "Văn bản thứ cấp",
"demoSelectionControlsTitle": "Các chức năng điều khiển lựa chọn",
"craneFly7SemanticLabel": "Núi Rushmore",
"demoSelectionControlsCheckboxTitle": "Hộp kiểm",
"craneSleep3SemanticLabel": "Người đàn ông tựa vào chiếc xe ô tô cổ màu xanh dương",
"demoSelectionControlsRadioTitle": "Nút radio",
"demoSelectionControlsRadioDescription": "Các nút radio cho phép người dùng chọn một tùy chọn trong một tập hợp. Hãy dùng nút radio để lựa chọn riêng nếu bạn cho rằng người dùng cần xem song song tất cả các tùy chọn có sẵn.",
"demoSelectionControlsSwitchTitle": "Công tắc",
"demoSelectionControlsSwitchDescription": "Nút chuyển bật/tắt chuyển đổi trạng thái của một tuỳ chọn cài đặt. Tuỳ chọn mà bảng điều khiển nút chuyển, cũng như trạng thái của tuỳ chọn đó, phải thể hiện rõ ràng bằng nhãn nội tuyến tương ứng.",
"craneFly0SemanticLabel": "Căn nhà gỗ trong khung cảnh đầy tuyết với cây thường xanh xung quanh",
"craneFly1SemanticLabel": "Chiếc lều giữa cánh đồng",
"craneFly2SemanticLabel": "Những lá cờ cầu nguyện phía trước ngọn núi đầy tuyết",
"craneFly6SemanticLabel": "Quang cảnh Palacio de Bellas Artes nhìn từ trên không",
"rallySeeAllAccounts": "Xem tất cả các tài khoản",
"rallyBillAmount": "Hóa đơn {billName} {amount} đến hạn vào {date}.",
"shrineTooltipCloseCart": "Đóng giỏ hàng",
"shrineTooltipCloseMenu": "Đóng trình đơn",
"shrineTooltipOpenMenu": "Mở trình đơn",
"shrineTooltipSettings": "Cài đặt",
"shrineTooltipSearch": "Tìm kiếm",
"demoTabsDescription": "Các tab sắp xếp nội dung trên nhiều màn hình, tập dữ liệu và hoạt động tương tác khác.",
"demoTabsSubtitle": "Các tab có chế độ xem có thể di chuyển độc lập",
"demoTabsTitle": "Tab",
"rallyBudgetAmount": "Đã dùng hết {amountUsed}/{amountTotal} ngân sách {budgetName}, số tiền còn lại là {amountLeft}",
"shrineTooltipRemoveItem": "Xóa mặt hàng",
"rallyAccountAmount": "Số dư tài khoản {accountName} {accountNumber} là {amount}.",
"rallySeeAllBudgets": "Xem tất cả ngân sách",
"rallySeeAllBills": "Xem tất cả các hóa đơn",
"craneFormDate": "Chọn ngày",
"craneFormOrigin": "Chọn điểm khởi hành",
"craneFly2": "Thung lũng Khumbu, Nepal",
"craneFly3": "Machu Picchu, Peru",
"craneFly4": "Malé, Maldives",
"craneFly5": "Vitznau, Thụy Sĩ",
"craneFly6": "Thành phố Mexico, Mexico",
"craneFly7": "Núi Rushmore, Hoa Kỳ",
"settingsTextDirectionLocaleBased": "Dựa trên vị trí",
"craneFly9": "Havana, Cuba",
"craneFly10": "Cairo, Ai Cập",
"craneFly11": "Lisbon, Bồ Đào Nha",
"craneFly12": "Napa, Hoa Kỳ",
"craneFly13": "Bali, Indonesia",
"craneSleep0": "Malé, Maldives",
"craneSleep1": "Aspen, Hoa Kỳ",
"craneSleep2": "Machu Picchu, Peru",
"demoCupertinoSegmentedControlTitle": "Chế độ kiểm soát được phân đoạn",
"craneSleep4": "Vitznau, Thụy Sĩ",
"craneSleep5": "Big Sur, Hoa Kỳ",
"craneSleep6": "Napa, Hoa Kỳ",
"craneSleep7": "Porto, Bồ Đào Nha",
"craneSleep8": "Tulum, Mexico",
"craneEat5": "Seoul, Hàn Quốc",
"demoChipTitle": "Thẻ",
"demoChipSubtitle": "Các thành phần rút gọn biểu thị thông tin đầu vào, thuộc tính hoặc hành động",
"demoActionChipTitle": "Thẻ hành động",
"demoActionChipDescription": "Thẻ hành động là một tập hợp các tùy chọn kích hoạt hành động liên quan đến nội dung chính. Thẻ này sẽ hiển thị linh hoạt và theo ngữ cảnh trong giao diện người dùng.",
"demoChoiceChipTitle": "Khối lựa chọn",
"demoChoiceChipDescription": "Thẻ lựa chọn biểu thị một lựa chọn trong nhóm. Thẻ này chứa văn bản mô tả hoặc danh mục có liên quan.",
"demoFilterChipTitle": "Thẻ bộ lọc",
"demoFilterChipDescription": "Thẻ bộ lọc sử dụng thẻ hoặc từ ngữ mô tả để lọc nội dung.",
"demoInputChipTitle": "Thẻ thông tin đầu vào",
"demoInputChipDescription": "Thẻ thông tin đầu vào biểu thị một phần thông tin phức tạp dưới dạng rút gọn, chẳng hạn như thực thể (người, đồ vật hoặc địa điểm) hoặc nội dung hội thoại.",
"craneSleep9": "Lisbon, Bồ Đào Nha",
"craneEat10": "Lisbon, Bồ Đào Nha",
"demoCupertinoSegmentedControlDescription": "Dùng để chọn trong một số các tùy chọn loại trừ tương hỗ. Khi chọn 1 tùy chọn trong chế độ kiểm soát được phân đoạn, bạn sẽ không thể chọn các tùy chọn khác trong chế độ đó.",
"chipTurnOnLights": "Bật đèn",
"chipSmall": "Nhỏ",
"chipMedium": "Trung bình",
"chipLarge": "Lớn",
"chipElevator": "Thang máy",
"chipWasher": "Máy giặt",
"chipFireplace": "Lò sưởi",
"chipBiking": "Đạp xe",
"craneFormDiners": "Số thực khách",
"rallyAlertsMessageUnassignedTransactions": "{count,plural,=1{Tăng khoản khấu trừ thuế bạn có thể được hưởng! Gán danh mục cho 1 giao dịch chưa chỉ định.}other{Tăng khoản khấu trừ thuế bạn có thể được hưởng! Gán danh mục cho {count} giao dịch chưa chỉ định.}}",
"craneFormTime": "Chọn thời gian",
"craneFormLocation": "Chọn vị trí",
"craneFormTravelers": "Số du khách",
"craneEat8": "Atlanta, Hoa Kỳ",
"craneFormDestination": "Chọn điểm đến",
"craneFormDates": "Chọn ngày",
"craneFly": "CHUYẾN BAY",
"craneSleep": "CHỖ NGỦ",
"craneEat": "CHỖ ĂN",
"craneFlySubhead": "Khám phá chuyến bay theo điểm đến",
"craneSleepSubhead": "Khám phá khách sạn theo điểm đến",
"craneEatSubhead": "Khám phá nhà hàng theo điểm đến",
"craneFlyStops": "{numberOfStops,plural,=0{Bay thẳng}=1{1 điểm dừng}other{{numberOfStops} điểm dừng}}",
"craneSleepProperties": "{totalProperties,plural,=0{Không có khách sạn nào}=1{Có 1 khách sạn}other{Có {totalProperties} khách sạn}}",
"craneEatRestaurants": "{totalRestaurants,plural,=0{Không có nhà hàng nào}=1{1 nhà hàng}other{{totalRestaurants} nhà hàng}}",
"craneFly0": "Aspen, Hoa Kỳ",
"demoCupertinoSegmentedControlSubtitle": "Chế độ kiểm soát được phân đoạn theo kiểu iOS",
"craneSleep10": "Cairo, Ai Cập",
"craneEat9": "Madrid, Tây Ban Nha",
"craneFly1": "Big Sur, Hoa Kỳ",
"craneEat7": "Nashville, Hoa Kỳ",
"craneEat6": "Seattle, Hoa Kỳ",
"craneFly8": "Singapore",
"craneEat4": "Paris, Pháp",
"craneEat3": "Portland, Hoa Kỳ",
"craneEat2": "Córdoba, Argentina",
"craneEat1": "Dallas, Hoa Kỳ",
"craneEat0": "Naples, Ý",
"craneSleep11": "Đài Bắc, Đài Loan",
"craneSleep3": "Havana, Cuba",
"shrineLogoutButtonCaption": "ĐĂNG XUẤT",
"rallyTitleBills": "HÓA ĐƠN",
"rallyTitleAccounts": "TÀI KHOẢN",
"shrineProductVagabondSack": "Túi vải bố Vagabond",
"rallyAccountDetailDataInterestYtd": "Lãi suất từ đầu năm đến nay",
"shrineProductWhitneyBelt": "Thắt lưng Whitney",
"shrineProductGardenStrand": "Dây làm vườn",
"shrineProductStrutEarrings": "Hoa tai Strut",
"shrineProductVarsitySocks": "Tất học sinh",
"shrineProductWeaveKeyring": "Móc khóa kiểu tết dây",
"shrineProductGatsbyHat": "Mũ bê rê nam",
"shrineProductShrugBag": "Túi xách Shrug",
"shrineProductGiltDeskTrio": "Bộ ba dụng cụ mạ vàng để bàn",
"shrineProductCopperWireRack": "Giá bằng dây đồng",
"shrineProductSootheCeramicSet": "Bộ đồ gốm tao nhã",
"shrineProductHurrahsTeaSet": "Bộ ấm chén trà Hurrahs",
"shrineProductBlueStoneMug": "Cốc đá xanh lam",
"shrineProductRainwaterTray": "Khay hứng nước mưa",
"shrineProductChambrayNapkins": "Khăn ăn bằng vải chambray",
"shrineProductSucculentPlanters": "Chậu cây xương rồng",
"shrineProductQuartetTable": "Bàn bốn người",
"shrineProductKitchenQuattro": "Bộ bốn đồ dùng nhà bếp",
"shrineProductClaySweater": "Áo len dài tay màu nâu đất sét",
"shrineProductSeaTunic": "Áo dài qua hông màu xanh biển",
"shrineProductPlasterTunic": "Áo dài qua hông màu thạch cao",
"rallyBudgetCategoryRestaurants": "Nhà hàng",
"shrineProductChambrayShirt": "Áo sơ mi vải chambray",
"shrineProductSeabreezeSweater": "Áo len dài tay màu xanh lơ",
"shrineProductGentryJacket": "Áo khoác gentry",
"shrineProductNavyTrousers": "Quần màu xanh tím than",
"shrineProductWalterHenleyWhite": "Áo Walter henley (màu trắng)",
"shrineProductSurfAndPerfShirt": "Áo Surf and perf",
"shrineProductGingerScarf": "Khăn quàng màu nâu cam",
"shrineProductRamonaCrossover": "Áo đắp chéo Ramona",
"shrineProductClassicWhiteCollar": "Áo sơ mi cổ trắng cổ điển",
"shrineProductSunshirtDress": "Áo váy đi biển",
"rallyAccountDetailDataInterestRate": "Lãi suất",
"rallyAccountDetailDataAnnualPercentageYield": "Phần trăm lợi nhuận hằng năm",
"rallyAccountDataVacation": "Kỳ nghỉ",
"shrineProductFineLinesTee": "Áo thun sọc mảnh",
"rallyAccountDataHomeSavings": "Tài khoản tiết kiệm mua nhà",
"rallyAccountDataChecking": "Tài khoản giao dịch",
"rallyAccountDetailDataInterestPaidLastYear": "Lãi suất đã thanh toán năm ngoái",
"rallyAccountDetailDataNextStatement": "Bảng kê khai tiếp theo",
"rallyAccountDetailDataAccountOwner": "Chủ sở hữu tài khoản",
"rallyBudgetCategoryCoffeeShops": "Quán cà phê",
"rallyBudgetCategoryGroceries": "Cửa hàng tạp hóa",
"shrineProductCeriseScallopTee": "Áo thun viền cổ dạng vỏ sò màu đỏ hồng",
"rallyBudgetCategoryClothing": "Quần áo",
"rallySettingsManageAccounts": "Quản lý tài khoản",
"rallyAccountDataCarSavings": "Tài khoản tiết kiệm mua ô tô",
"rallySettingsTaxDocuments": "Chứng từ thuế",
"rallySettingsPasscodeAndTouchId": "Mật mã và Touch ID",
"rallySettingsNotifications": "Thông báo",
"rallySettingsPersonalInformation": "Thông tin cá nhân",
"rallySettingsPaperlessSettings": "Cài đặt không dùng bản cứng",
"rallySettingsFindAtms": "Tìm máy rút tiền tự động (ATM)",
"rallySettingsHelp": "Trợ giúp",
"rallySettingsSignOut": "Đăng xuất",
"rallyAccountTotal": "Tổng",
"rallyBillsDue": "Khoản tiền đến hạn trả",
"rallyBudgetLeft": "Còn lại",
"rallyAccounts": "Tài khoản",
"rallyBills": "Hóa đơn",
"rallyBudgets": "Ngân sách",
"rallyAlerts": "Cảnh báo",
"rallySeeAll": "XEM TẤT CẢ",
"rallyFinanceLeft": "CÒN LẠI",
"rallyTitleOverview": "TỔNG QUAN",
"shrineProductShoulderRollsTee": "Áo thun xắn tay",
"shrineNextButtonCaption": "TIẾP THEO",
"rallyTitleBudgets": "NGÂN SÁCH",
"rallyTitleSettings": "CÀI ĐẶT",
"rallyLoginLoginToRally": "Đăng nhập vào Rally",
"rallyLoginNoAccount": "Không có tài khoản?",
"rallyLoginSignUp": "ĐĂNG KÝ",
"rallyLoginUsername": "Tên người dùng",
"rallyLoginPassword": "Mật khẩu",
"rallyLoginLabelLogin": "Đăng nhập",
"rallyLoginRememberMe": "Ghi nhớ thông tin đăng nhập của tôi",
"rallyLoginButtonLogin": "ĐĂNG NHẬP",
"rallyAlertsMessageHeadsUpShopping": "Xin lưu ý rằng bạn đã dùng hết {percent} ngân sách Mua sắm của mình trong tháng này.",
"rallyAlertsMessageSpentOnRestaurants": "Bạn đã chi tiêu {amount} cho Nhà hàng trong tuần này.",
"rallyAlertsMessageATMFees": "Bạn đã chi tiêu {amount} cho phí sử dụng ATM trong tháng này",
"rallyAlertsMessageCheckingAccount": "Chúc mừng bạn! Số dư trong tài khoản giao dịch của bạn cao hơn {percent} so với tháng trước.",
"shrineMenuCaption": "TRÌNH ĐƠN",
"shrineCategoryNameAll": "TẤT CẢ",
"shrineCategoryNameAccessories": "PHỤ KIỆN",
"shrineCategoryNameClothing": "HÀNG MAY MẶC",
"shrineCategoryNameHome": "ĐỒ GIA DỤNG",
"shrineLoginUsernameLabel": "Tên người dùng",
"shrineLoginPasswordLabel": "Mật khẩu",
"shrineCancelButtonCaption": "HỦY",
"shrineCartTaxCaption": "Thuế:",
"shrineCartPageCaption": "GIỎ HÀNG",
"shrineProductQuantity": "Số lượng: {quantity}",
"shrineProductPrice": "x {price}",
"shrineCartItemCount": "{quantity,plural,=0{KHÔNG CÓ MẶT HÀNG NÀO}=1{1 MẶT HÀNG}other{{quantity} MẶT HÀNG}}",
"shrineCartClearButtonCaption": "XÓA GIỎ HÀNG",
"shrineCartTotalCaption": "TỔNG",
"shrineCartSubtotalCaption": "Tổng phụ:",
"shrineCartShippingCaption": "Giao hàng:",
"shrineProductGreySlouchTank": "Áo ba lỗ dáng rộng màu xám",
"shrineProductStellaSunglasses": "Kính râm Stella",
"shrineProductWhitePinstripeShirt": "Áo sơ mi trắng sọc nhỏ",
"demoTextFieldWhereCanWeReachYou": "Số điện thoại liên hệ của bạn?",
"settingsTextDirectionLTR": "TRÁI SANG PHẢI",
"settingsTextScalingLarge": "Lớn",
"demoBottomSheetHeader": "Tiêu đề",
"demoBottomSheetItem": "Mặt hàng số {value}",
"demoBottomTextFieldsTitle": "Trường văn bản",
"demoTextFieldTitle": "Trường văn bản",
"demoTextFieldSubtitle": "Một dòng gồm chữ và số chỉnh sửa được",
"demoTextFieldDescription": "Các trường văn bản cho phép người dùng nhập văn bản vào giao diện người dùng. Những trường này thường xuất hiện trong các biểu mẫu và hộp thoại.",
"demoTextFieldShowPasswordLabel": "Hiện mật khẩu",
"demoTextFieldHidePasswordLabel": "Ẩn mật khẩu",
"demoTextFieldFormErrors": "Vui lòng sửa các trường hiển thị lỗi màu đỏ trước khi gửi.",
"demoTextFieldNameRequired": "Bạn phải nhập tên.",
"demoTextFieldOnlyAlphabeticalChars": "Vui lòng chỉ nhập chữ cái.",
"demoTextFieldEnterUSPhoneNumber": "(###) ###-#### – Nhập một số điện thoại của Hoa Kỳ.",
"demoTextFieldEnterPassword": "Hãy nhập mật khẩu.",
"demoTextFieldPasswordsDoNotMatch": "Các mật khẩu không trùng khớp",
"demoTextFieldWhatDoPeopleCallYou": "Bạn tên là gì?",
"demoTextFieldNameField": "Tên*",
"demoBottomSheetButtonText": "HIỂN THỊ BẢNG DƯỚI CÙNG",
"demoTextFieldPhoneNumber": "Số điện thoại*",
"demoBottomSheetTitle": "Bảng dưới cùng",
"demoTextFieldEmail": "Email",
"demoTextFieldTellUsAboutYourself": "Giới thiệu về bản thân (ví dụ: ghi rõ nghề nghiệp hoặc sở thích của bạn)",
"demoTextFieldKeepItShort": "Hãy nhập nội dung thật ngắn gọn, đây chỉ là phiên bản dùng thử.",
"starterAppGenericButton": "NÚT",
"demoTextFieldLifeStory": "Tiểu sử",
"demoTextFieldSalary": "Lương",
"demoTextFieldUSD": "USD",
"demoTextFieldNoMoreThan": "Nhiều nhất là 8 ký tự.",
"demoTextFieldPassword": "Mật khẩu*",
"demoTextFieldRetypePassword": "Nhập lại mật khẩu*",
"demoTextFieldSubmit": "GỬI",
"demoBottomNavigationSubtitle": "Thanh điều hướng dưới cùng có chế độ xem mờ chéo",
"demoBottomSheetAddLabel": "Thêm",
"demoBottomSheetModalDescription": "Bảng cách điệu dưới cùng là một dạng thay thế cho trình đơn hoặc hộp thoại để ngăn người dùng tương tác với phần còn lại của ứng dụng.",
"demoBottomSheetModalTitle": "Bảng dưới cùng cách điệu",
"demoBottomSheetPersistentDescription": "Bảng cố định dưới cùng hiển thị thông tin bổ sung cho nội dung chính của ứng dụng. Ngay cả khi người dùng tương tác với các phần khác của ứng dụng thì bảng cố định dưới cùng sẽ vẫn hiển thị.",
"demoBottomSheetPersistentTitle": "Bảng cố định dưới cùng",
"demoBottomSheetSubtitle": "Bảng cách điệu và bảng cố định dưới cùng",
"demoTextFieldNameHasPhoneNumber": "Số điện thoại của {name} là {phoneNumber}",
"buttonText": "NÚT",
"demoTypographyDescription": "Định nghĩa của nhiều kiểu nghệ thuật chữ có trong Material Design.",
"demoTypographySubtitle": "Tất cả các kiểu chữ định sẵn",
"demoTypographyTitle": "Nghệ thuật chữ",
"demoFullscreenDialogDescription": "Thuộc tính fullscreenDialog cho biết liệu trang sắp tới có phải là một hộp thoại ở chế độ toàn màn hình hay không",
"demoFlatButtonDescription": "Nút dẹt hiển thị hình ảnh giọt mực bắn tung tóe khi nhấn giữ. Use flat buttons on toolbars, in dialogs and inline with padding",
"demoBottomNavigationDescription": "Thanh điều hướng dưới cùng hiển thị từ 3 đến 5 điểm đến ở cuối màn hình. Mỗi điểm đến được biểu thị bằng một biểu tượng và nhãn văn bản tùy chọn. Khi nhấn vào biểu tượng trên thanh điều hướng dưới cùng, người dùng sẽ được chuyển tới điểm đến phần điều hướng cấp cao nhất liên kết với biểu tượng đó.",
"demoBottomNavigationSelectedLabel": "Nhãn đã chọn",
"demoBottomNavigationPersistentLabels": "Nhãn cố định",
"starterAppDrawerItem": "Mặt hàng số {value}",
"demoTextFieldRequiredField": "* biểu thị trường bắt buộc",
"demoBottomNavigationTitle": "Thanh điều hướng dưới cùng",
"settingsLightTheme": "Sáng",
"settingsTheme": "Giao diện",
"settingsPlatformIOS": "iOS",
"settingsPlatformAndroid": "Android",
"settingsTextDirectionRTL": "Phải qua trái",
"settingsTextScalingHuge": "Rất lớn",
"cupertinoButton": "Nút",
"settingsTextScalingNormal": "Thường",
"settingsTextScalingSmall": "Nhỏ",
"settingsSystemDefault": "Hệ thống",
"settingsTitle": "Cài đặt",
"rallyDescription": "Một ứng dụng tài chính cá nhân",
"aboutDialogDescription": "Để xem mã nguồn của ứng dụng này, vui lòng truy cập vào {repoLink}.",
"bottomNavigationCommentsTab": "Bình luận",
"starterAppGenericBody": "Nội dung",
"starterAppGenericHeadline": "Tiêu đề",
"starterAppGenericSubtitle": "Phụ đề",
"starterAppGenericTitle": "Tiêu đề",
"starterAppTooltipSearch": "Tìm kiếm",
"starterAppTooltipShare": "Chia sẻ",
"starterAppTooltipFavorite": "Mục yêu thích",
"starterAppTooltipAdd": "Thêm",
"bottomNavigationCalendarTab": "Lịch",
"starterAppDescription": "Bố cục thích ứng cho ứng dụng cơ bản",
"starterAppTitle": "Ứng dụng cơ bản",
"aboutFlutterSamplesRepo": "Kho lưu trữ GitHub cho các mẫu Flutter",
"bottomNavigationContentPlaceholder": "Phần giữ chỗ cho tab {title}",
"bottomNavigationCameraTab": "Máy ảnh",
"bottomNavigationAlarmTab": "Đồng hồ báo thức",
"bottomNavigationAccountTab": "Tài khoản",
"demoTextFieldYourEmailAddress": "Địa chỉ email của bạn",
"demoToggleButtonDescription": "Bạn có thể dùng các nút chuyển đổi để nhóm những tùy chọn có liên quan lại với nhau. To emphasize groups of related toggle buttons, a group should share a common container",
"colorsGrey": "MÀU XÁM",
"colorsBrown": "MÀU NÂU",
"colorsDeepOrange": "MÀU CAM ĐẬM",
"colorsOrange": "MÀU CAM",
"colorsAmber": "MÀU HỔ PHÁCH",
"colorsYellow": "MÀU VÀNG",
"colorsLime": "MÀU VÀNG CHANH",
"colorsLightGreen": "MÀU XANH LỤC NHẠT",
"colorsGreen": "MÀU XANH LỤC",
"homeHeaderGallery": "Thư viện",
"homeHeaderCategories": "Danh mục",
"shrineDescription": "Ứng dụng bán lẻ thời thượng",
"craneDescription": "Một ứng dụng du lịch cá nhân",
"homeCategoryReference": "BẢN MINH HỌA KIỂU VÀ CÁC BẢN MINH HỌA KHÁC",
"demoInvalidURL": "Không thể hiển thị URL:",
"demoOptionsTooltip": "Tùy chọn",
"demoInfoTooltip": "Thông tin",
"demoCodeTooltip": "Mã minh họa",
"demoDocumentationTooltip": "Tài liệu API",
"demoFullscreenTooltip": "Toàn màn hình",
"settingsTextScaling": "Chuyển tỉ lệ chữ",
"settingsTextDirection": "Hướng chữ",
"settingsLocale": "Ngôn ngữ",
"settingsPlatformMechanics": "Cơ chế nền tảng",
"settingsDarkTheme": "Tối",
"settingsSlowMotion": "Chuyển động chậm",
"settingsAbout": "Giới thiệu về Flutter Gallery",
"settingsFeedback": "Gửi ý kiến phản hồi",
"settingsAttribution": "Thiết kế của TOASTER tại London",
"demoButtonTitle": "Nút",
"demoButtonSubtitle": "Nút văn bản, nút lồi, nút có đường viền và nhiều nút khác",
"demoFlatButtonTitle": "Nút dẹt",
"demoRaisedButtonDescription": "Các nút lồi sẽ làm gia tăng kích thước đối với hầu hết các bố cục phẳng. Các nút này làm nổi bật những chức năng trên không gian rộng hoặc có mật độ dày đặc.",
"demoRaisedButtonTitle": "Nút lồi",
"demoOutlineButtonTitle": "Nút có đường viền",
"demoOutlineButtonDescription": "Các nút có đường viền sẽ mờ đi rồi hiện rõ lên khi nhấn. Các nút này thường xuất hiện cùng các nút lồi để biểu thị hành động phụ, thay thế.",
"demoToggleButtonTitle": "Nút chuyển đổi",
"colorsTeal": "MÀU MÒNG KÉT",
"demoFloatingButtonTitle": "Nút hành động nổi",
"demoFloatingButtonDescription": "A floating action button is a circular icon button that hovers over content to promote a primary action in the application.",
"demoDialogTitle": "Hộp thoại",
"demoDialogSubtitle": "Hộp thoại đơn giản, cảnh báo và toàn màn hình",
"demoAlertDialogTitle": "Cảnh báo",
"demoAlertDialogDescription": "Hộp thoại cảnh báo thông báo cho người dùng về các tình huống cần xác nhận. Hộp thoại cảnh báo không nhất thiết phải có tiêu đề cũng như danh sách các hành động.",
"demoAlertTitleDialogTitle": "Cảnh báo có tiêu đề",
"demoSimpleDialogTitle": "Hộp thoại đơn giản",
"demoSimpleDialogDescription": "Hộp thoại đơn giản đưa ra cho người dùng một lựa chọn trong số nhiều tùy chọn. Hộp thoại đơn giản không nhất thiết phải có tiêu đề ở phía trên các lựa chọn.",
"demoFullscreenDialogTitle": "Toàn màn hình",
"demoCupertinoButtonsTitle": "Nút",
"demoCupertinoButtonsSubtitle": "Nút theo kiểu iOS",
"demoCupertinoButtonsDescription": "Đây là một nút theo kiểu iOS. Nút này có chứa văn bản và/hoặc một biểu tượng mờ đi rồi rõ dần lên khi chạm vào. Ngoài ra, nút cũng có thể có nền (không bắt buộc).",
"demoCupertinoAlertsTitle": "Cảnh báo",
"demoCupertinoAlertsSubtitle": "Hộp thoại cảnh báo theo kiểu iOS",
"demoCupertinoAlertTitle": "Cảnh báo",
"demoCupertinoAlertDescription": "Hộp thoại cảnh báo thông báo cho người dùng về các tình huống cần xác nhận. Hộp thoại cảnh báo không nhất thiết phải có tiêu đề, nội dung cũng như danh sách các hành động. Bạn sẽ thấy tiêu đề ở phía trên nội dung còn các hành động thì ở phía dưới.",
"demoCupertinoAlertWithTitleTitle": "Cảnh báo có tiêu đề",
"demoCupertinoAlertButtonsTitle": "Cảnh báo đi kèm các nút",
"demoCupertinoAlertButtonsOnlyTitle": "Chỉ nút cảnh báo",
"demoCupertinoActionSheetTitle": "Trang tính hành động",
"demoCupertinoActionSheetDescription": "Trang tính hành động là một kiểu cảnh báo cụ thể cung cấp cho người dùng 2 hoặc nhiều lựa chọn liên quan đến ngữ cảnh hiện tại. Trang tính hành động có thể có một tiêu đề, thông báo bổ sung và danh sách các hành động.",
"demoColorsTitle": "Màu",
"demoColorsSubtitle": "Tất cả các màu xác định trước",
"demoColorsDescription": "Color and color swatch constants which represent Material design's color palette.",
"buttonTextEnabled": "ENABLED",
"buttonTextDisabled": "DISABLED",
"buttonTextCreate": "Tạo",
"dialogSelectedOption": "Bạn đã chọn: \"{value}\"",
"dialogDiscardTitle": "Hủy bản nháp?",
"dialogLocationTitle": "Sử dụng dịch vụ vị trí của Google?",
"dialogLocationDescription": "Cho phép Google giúp ứng dụng xác định vị trí. Điều này có nghĩa là gửi dữ liệu vị trí ẩn danh cho Google, ngay cả khi không chạy ứng dụng nào.",
"dialogCancel": "HỦY",
"dialogDiscard": "HỦY",
"dialogDisagree": "KHÔNG ĐỒNG Ý",
"dialogAgree": "ĐỒNG Ý",
"dialogSetBackup": "Thiết lập tài khoản sao lưu",
"colorsBlueGrey": "MÀU XANH XÁM",
"dialogShow": "HIỂN THỊ HỘP THOẠI",
"dialogFullscreenTitle": "Hộp thoại toàn màn hình",
"dialogFullscreenSave": "LƯU",
"dialogFullscreenDescription": "Minh họa hộp thoại toàn màn hình",
"cupertinoButtonEnabled": "Enabled",
"cupertinoButtonDisabled": "Disabled",
"cupertinoButtonWithBackground": "Có nền",
"cupertinoAlertCancel": "Hủy",
"cupertinoAlertDiscard": "Hủy",
"cupertinoAlertLocationTitle": "Cho phép \"Maps\" sử dụng thông tin vị trí của bạn khi bạn đang dùng ứng dụng?",
"cupertinoAlertLocationDescription": "Vị trí hiện tại của bạn sẽ hiển thị trên bản đồ và dùng để xác định đường đi, kết quả tìm kiếm ở gần và thời gian đi lại ước đoán.",
"cupertinoAlertAllow": "Cho phép",
"cupertinoAlertDontAllow": "Không cho phép",
"cupertinoAlertFavoriteDessert": "Chọn món tráng miệng yêu thích",
"cupertinoAlertDessertDescription": "Vui lòng chọn món tráng miệng yêu thích từ danh sách bên dưới. Món tráng miệng bạn chọn sẽ dùng để tùy chỉnh danh sách các quán ăn đề xuất trong khu vực của bạn.",
"cupertinoAlertCheesecake": "Bánh phô mai",
"cupertinoAlertTiramisu": "Tiramisu",
"cupertinoAlertApplePie": "Bánh táo",
"cupertinoAlertChocolateBrownie": "Bánh brownie sô-cô-la",
"cupertinoShowAlert": "Hiển thị cảnh báo",
"colorsRed": "MÀU ĐỎ",
"colorsPink": "MÀU HỒNG",
"colorsPurple": "MÀU TÍM",
"colorsDeepPurple": "MÀU TÍM ĐẬM",
"colorsIndigo": "MÀU CHÀM",
"colorsBlue": "MÀU XANH LAM",
"colorsLightBlue": "MÀU XANH LAM NHẠT",
"colorsCyan": "MÀU XANH LƠ",
"dialogAddAccount": "Thêm tài khoản",
"Gallery": "Thư viện",
"Categories": "Danh mục",
"SHRINE": "SHRINE",
"Basic shopping app": "Ứng dụng mua sắm cơ bản",
"RALLY": "RALLY",
"CRANE": "CRANE",
"Travel app": "Ứng dụng du lịch",
"MATERIAL": "TÀI LIỆU",
"CUPERTINO": "CUPERTINO",
"REFERENCE STYLES & MEDIA": "KIỂU DÁNG VÀ NỘI DUNG NGHE NHÌN THAM KHẢO"
}
| gallery/lib/l10n/intl_vi.arb/0 | {
"file_path": "gallery/lib/l10n/intl_vi.arb",
"repo_id": "gallery",
"token_count": 31910
} | 814 |
// Copyright 2019 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
import 'package:gallery/constants.dart';
import 'package:gallery/data/demos.dart';
import 'package:gallery/data/gallery_options.dart';
import 'package:gallery/layout/adaptive.dart';
import 'package:gallery/pages/category_list_item.dart';
import 'package:gallery/pages/settings.dart';
import 'package:gallery/pages/splash.dart';
import 'package:gallery/studies/crane/colors.dart';
import 'package:gallery/studies/crane/routes.dart' as crane_routes;
import 'package:gallery/studies/fortnightly/routes.dart' as fortnightly_routes;
import 'package:gallery/studies/rally/colors.dart';
import 'package:gallery/studies/rally/routes.dart' as rally_routes;
import 'package:gallery/studies/reply/routes.dart' as reply_routes;
import 'package:gallery/studies/shrine/colors.dart';
import 'package:gallery/studies/shrine/routes.dart' as shrine_routes;
import 'package:gallery/studies/starter/routes.dart' as starter_app_routes;
import 'package:url_launcher/url_launcher.dart';
const _horizontalPadding = 32.0;
const _horizontalDesktopPadding = 81.0;
const _carouselHeightMin = 240.0;
const _carouselItemDesktopMargin = 8.0;
const _carouselItemMobileMargin = 4.0;
const _carouselItemWidth = 296.0;
class ToggleSplashNotification extends Notification {}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
final isDesktop = isDisplayDesktop(context);
final localizations = GalleryLocalizations.of(context)!;
final studyDemos = Demos.studies(localizations);
final carouselCards = <Widget>[
_CarouselCard(
demo: studyDemos['reply'],
asset: const AssetImage(
'assets/studies/reply_card.png',
package: 'flutter_gallery_assets',
),
assetColor: const Color(0xFF344955),
assetDark: const AssetImage(
'assets/studies/reply_card_dark.png',
package: 'flutter_gallery_assets',
),
assetDarkColor: const Color(0xFF1D2327),
textColor: Colors.white,
studyRoute: reply_routes.homeRoute,
),
_CarouselCard(
demo: studyDemos['shrine'],
asset: const AssetImage(
'assets/studies/shrine_card.png',
package: 'flutter_gallery_assets',
),
assetColor: const Color(0xFFFEDBD0),
assetDark: const AssetImage(
'assets/studies/shrine_card_dark.png',
package: 'flutter_gallery_assets',
),
assetDarkColor: const Color(0xFF543B3C),
textColor: shrineBrown900,
studyRoute: shrine_routes.loginRoute,
),
_CarouselCard(
demo: studyDemos['rally'],
textColor: RallyColors.accountColors[0],
asset: const AssetImage(
'assets/studies/rally_card.png',
package: 'flutter_gallery_assets',
),
assetColor: const Color(0xFFD1F2E6),
assetDark: const AssetImage(
'assets/studies/rally_card_dark.png',
package: 'flutter_gallery_assets',
),
assetDarkColor: const Color(0xFF253538),
studyRoute: rally_routes.loginRoute,
),
_CarouselCard(
demo: studyDemos['crane'],
asset: const AssetImage(
'assets/studies/crane_card.png',
package: 'flutter_gallery_assets',
),
assetColor: const Color(0xFFFBF6F8),
assetDark: const AssetImage(
'assets/studies/crane_card_dark.png',
package: 'flutter_gallery_assets',
),
assetDarkColor: const Color(0xFF591946),
textColor: cranePurple700,
studyRoute: crane_routes.defaultRoute,
),
_CarouselCard(
demo: studyDemos['fortnightly'],
asset: const AssetImage(
'assets/studies/fortnightly_card.png',
package: 'flutter_gallery_assets',
),
assetColor: Colors.white,
assetDark: const AssetImage(
'assets/studies/fortnightly_card_dark.png',
package: 'flutter_gallery_assets',
),
assetDarkColor: const Color(0xFF1F1F1F),
studyRoute: fortnightly_routes.defaultRoute,
),
_CarouselCard(
demo: studyDemos['starterApp'],
asset: const AssetImage(
'assets/studies/starter_card.png',
package: 'flutter_gallery_assets',
),
assetColor: const Color(0xFFFAF6FE),
assetDark: const AssetImage(
'assets/studies/starter_card_dark.png',
package: 'flutter_gallery_assets',
),
assetDarkColor: const Color(0xFF3F3D45),
textColor: Colors.black,
studyRoute: starter_app_routes.defaultRoute,
),
];
if (isDesktop) {
// Desktop layout
final desktopCategoryItems = <_DesktopCategoryItem>[
_DesktopCategoryItem(
category: GalleryDemoCategory.material,
asset: const AssetImage(
'assets/icons/material/material.png',
package: 'flutter_gallery_assets',
),
demos: Demos.materialDemos(localizations),
),
_DesktopCategoryItem(
category: GalleryDemoCategory.cupertino,
asset: const AssetImage(
'assets/icons/cupertino/cupertino.png',
package: 'flutter_gallery_assets',
),
demos: Demos.cupertinoDemos(localizations),
),
_DesktopCategoryItem(
category: GalleryDemoCategory.other,
asset: const AssetImage(
'assets/icons/reference/reference.png',
package: 'flutter_gallery_assets',
),
demos: Demos.otherDemos(localizations),
),
];
return Scaffold(
body: ListView(
// Makes integration tests possible.
key: const ValueKey('HomeListView'),
primary: true,
padding: const EdgeInsetsDirectional.only(
top: firstHeaderDesktopTopPadding,
),
children: [
_DesktopHomeItem(child: _GalleryHeader()),
_DesktopCarousel(
height: _carouselHeight(0.7, context),
children: carouselCards,
),
_DesktopHomeItem(child: _CategoriesHeader()),
SizedBox(
height: 585,
child: _DesktopHomeItem(
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: spaceBetween(28, desktopCategoryItems),
),
),
),
const SizedBox(height: 81),
_DesktopHomeItem(
child: Row(
children: [
MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () async {
final url = Uri.parse('https://flutter.dev');
if (await canLaunchUrl(url)) {
await launchUrl(url);
}
},
excludeFromSemantics: true,
child: FadeInImage(
image: Theme.of(context).colorScheme.brightness ==
Brightness.dark
? const AssetImage(
'assets/logo/flutter_logo.png',
package: 'flutter_gallery_assets',
)
: const AssetImage(
'assets/logo/flutter_logo_color.png',
package: 'flutter_gallery_assets',
),
placeholder: MemoryImage(kTransparentImage),
fadeInDuration: entranceAnimationDuration,
),
),
),
const Expanded(
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
alignment: WrapAlignment.end,
children: [
SettingsAbout(),
SettingsFeedback(),
SettingsAttribution(),
],
),
),
],
),
),
const SizedBox(height: 109),
],
),
);
} else {
// Mobile layout
return Scaffold(
body: _AnimatedHomePage(
restorationId: 'animated_page',
isSplashPageAnimationFinished:
SplashPageAnimation.of(context)!.isFinished,
carouselCards: carouselCards,
),
);
}
}
List<Widget> spaceBetween(double paddingBetween, List<Widget> children) {
return [
for (int index = 0; index < children.length; index++) ...[
Flexible(
child: children[index],
),
if (index < children.length - 1) SizedBox(width: paddingBetween),
],
];
}
}
class _GalleryHeader extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Header(
color: Theme.of(context).colorScheme.primaryContainer,
text: GalleryLocalizations.of(context)!.homeHeaderGallery,
);
}
}
class _CategoriesHeader extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Header(
color: Theme.of(context).colorScheme.primary,
text: GalleryLocalizations.of(context)!.homeHeaderCategories,
);
}
}
class Header extends StatelessWidget {
const Header({super.key, required this.color, required this.text});
final Color color;
final String text;
@override
Widget build(BuildContext context) {
return Align(
alignment: AlignmentDirectional.centerStart,
child: Padding(
padding: EdgeInsets.only(
top: isDisplayDesktop(context) ? 63 : 15,
bottom: isDisplayDesktop(context) ? 21 : 11,
),
child: SelectableText(
text,
style: Theme.of(context).textTheme.headlineMedium!.apply(
color: color,
fontSizeDelta:
isDisplayDesktop(context) ? desktopDisplay1FontDelta : 0,
),
),
),
);
}
}
class _AnimatedHomePage extends StatefulWidget {
const _AnimatedHomePage({
required this.restorationId,
required this.carouselCards,
required this.isSplashPageAnimationFinished,
});
final String restorationId;
final List<Widget> carouselCards;
final bool isSplashPageAnimationFinished;
@override
_AnimatedHomePageState createState() => _AnimatedHomePageState();
}
class _AnimatedHomePageState extends State<_AnimatedHomePage>
with RestorationMixin, SingleTickerProviderStateMixin {
late AnimationController _animationController;
Timer? _launchTimer;
final RestorableBool _isMaterialListExpanded = RestorableBool(false);
final RestorableBool _isCupertinoListExpanded = RestorableBool(false);
final RestorableBool _isOtherListExpanded = RestorableBool(false);
@override
String get restorationId => widget.restorationId;
@override
void restoreState(RestorationBucket? oldBucket, bool initialRestore) {
registerForRestoration(_isMaterialListExpanded, 'material_list');
registerForRestoration(_isCupertinoListExpanded, 'cupertino_list');
registerForRestoration(_isOtherListExpanded, 'other_list');
}
@override
void initState() {
super.initState();
_animationController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 800),
);
if (widget.isSplashPageAnimationFinished) {
// To avoid the animation from running when changing the window size from
// desktop to mobile, we do not animate our widget if the
// splash page animation is finished on initState.
_animationController.value = 1.0;
} else {
// Start our animation halfway through the splash page animation.
_launchTimer = Timer(
halfSplashPageAnimationDuration,
() {
_animationController.forward();
},
);
}
}
@override
void dispose() {
_animationController.dispose();
_launchTimer?.cancel();
_launchTimer = null;
_isMaterialListExpanded.dispose();
_isCupertinoListExpanded.dispose();
_isOtherListExpanded.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final localizations = GalleryLocalizations.of(context)!;
final isTestMode = GalleryOptions.of(context).isTestMode;
return Stack(
children: [
ListView(
// Makes integration tests possible.
key: const ValueKey('HomeListView'),
primary: true,
restorationId: 'home_list_view',
children: [
const SizedBox(height: 8),
Container(
margin:
const EdgeInsets.symmetric(horizontal: _horizontalPadding),
child: _GalleryHeader(),
),
_MobileCarousel(
animationController: _animationController,
restorationId: 'home_carousel',
children: widget.carouselCards,
),
Container(
margin:
const EdgeInsets.symmetric(horizontal: _horizontalPadding),
child: _CategoriesHeader(),
),
_AnimatedCategoryItem(
startDelayFraction: 0.00,
controller: _animationController,
child: CategoryListItem(
key: const PageStorageKey<GalleryDemoCategory>(
GalleryDemoCategory.material,
),
restorationId: 'home_material_category_list',
category: GalleryDemoCategory.material,
imageString: 'assets/icons/material/material.png',
demos: Demos.materialDemos(localizations),
initiallyExpanded:
_isMaterialListExpanded.value || isTestMode,
onTap: (shouldOpenList) {
_isMaterialListExpanded.value = shouldOpenList;
}),
),
_AnimatedCategoryItem(
startDelayFraction: 0.05,
controller: _animationController,
child: CategoryListItem(
key: const PageStorageKey<GalleryDemoCategory>(
GalleryDemoCategory.cupertino,
),
restorationId: 'home_cupertino_category_list',
category: GalleryDemoCategory.cupertino,
imageString: 'assets/icons/cupertino/cupertino.png',
demos: Demos.cupertinoDemos(localizations),
initiallyExpanded:
_isCupertinoListExpanded.value || isTestMode,
onTap: (shouldOpenList) {
_isCupertinoListExpanded.value = shouldOpenList;
}),
),
_AnimatedCategoryItem(
startDelayFraction: 0.10,
controller: _animationController,
child: CategoryListItem(
key: const PageStorageKey<GalleryDemoCategory>(
GalleryDemoCategory.other,
),
restorationId: 'home_other_category_list',
category: GalleryDemoCategory.other,
imageString: 'assets/icons/reference/reference.png',
demos: Demos.otherDemos(localizations),
initiallyExpanded: _isOtherListExpanded.value || isTestMode,
onTap: (shouldOpenList) {
_isOtherListExpanded.value = shouldOpenList;
}),
),
],
),
Align(
alignment: Alignment.topCenter,
child: GestureDetector(
onVerticalDragEnd: (details) {
if (details.velocity.pixelsPerSecond.dy > 200) {
ToggleSplashNotification().dispatch(context);
}
},
child: SafeArea(
child: Container(
height: 40,
// If we don't set the color, gestures are not detected.
color: Colors.transparent,
),
),
),
),
],
);
}
}
class _DesktopHomeItem extends StatelessWidget {
const _DesktopHomeItem({required this.child});
final Widget child;
@override
Widget build(BuildContext context) {
return Align(
alignment: Alignment.center,
child: Container(
constraints: const BoxConstraints(maxWidth: maxHomeItemWidth),
padding: const EdgeInsets.symmetric(
horizontal: _horizontalDesktopPadding,
),
child: child,
),
);
}
}
class _DesktopCategoryItem extends StatelessWidget {
const _DesktopCategoryItem({
required this.category,
required this.asset,
required this.demos,
});
final GalleryDemoCategory category;
final ImageProvider asset;
final List<GalleryDemo> demos;
@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
return Material(
borderRadius: BorderRadius.circular(10),
clipBehavior: Clip.antiAlias,
color: colorScheme.surface,
child: Semantics(
container: true,
child: FocusTraversalGroup(
policy: WidgetOrderTraversalPolicy(),
child: Column(
children: [
_DesktopCategoryHeader(
category: category,
asset: asset,
),
Divider(
height: 2,
thickness: 2,
color: colorScheme.background,
),
Flexible(
child: ListView.builder(
// Makes integration tests possible.
key: ValueKey('${category.name}DemoList'),
primary: false,
itemBuilder: (context, index) =>
CategoryDemoItem(demo: demos[index]),
itemCount: demos.length,
),
),
],
),
),
),
);
}
}
class _DesktopCategoryHeader extends StatelessWidget {
const _DesktopCategoryHeader({
required this.category,
required this.asset,
});
final GalleryDemoCategory category;
final ImageProvider asset;
@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
return Material(
// Makes integration tests possible.
key: ValueKey('${category.name}CategoryHeader'),
color: colorScheme.onBackground,
child: Row(
children: [
Padding(
padding: const EdgeInsets.all(10),
child: FadeInImage(
image: asset,
placeholder: MemoryImage(kTransparentImage),
fadeInDuration: entranceAnimationDuration,
width: 64,
height: 64,
excludeFromSemantics: true,
),
),
Flexible(
child: Padding(
padding: const EdgeInsetsDirectional.only(start: 8),
child: Semantics(
header: true,
child: SelectableText(
category.displayTitle(GalleryLocalizations.of(context)!)!,
style: Theme.of(context).textTheme.headlineSmall!.apply(
color: colorScheme.onSurface,
),
),
),
),
),
],
),
);
}
}
/// Animates the category item to stagger in. The [_AnimatedCategoryItem.startDelayFraction]
/// gives a delay in the unit of a fraction of the whole animation duration,
/// which is defined in [_AnimatedHomePageState].
class _AnimatedCategoryItem extends StatelessWidget {
_AnimatedCategoryItem({
required double startDelayFraction,
required this.controller,
required this.child,
}) : topPaddingAnimation = Tween(
begin: 60.0,
end: 0.0,
).animate(
CurvedAnimation(
parent: controller,
curve: Interval(
0.000 + startDelayFraction,
0.400 + startDelayFraction,
curve: Curves.ease,
),
),
);
final Widget child;
final AnimationController controller;
final Animation<double> topPaddingAnimation;
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: controller,
builder: (context, child) {
return Padding(
padding: EdgeInsets.only(top: topPaddingAnimation.value),
child: child,
);
},
child: child,
);
}
}
/// Animates the carousel to come in from the right.
class _AnimatedCarousel extends StatelessWidget {
_AnimatedCarousel({
required this.child,
required this.controller,
}) : startPositionAnimation = Tween(
begin: 1.0,
end: 0.0,
).animate(
CurvedAnimation(
parent: controller,
curve: const Interval(
0.200,
0.800,
curve: Curves.ease,
),
),
);
final Widget child;
final AnimationController controller;
final Animation<double> startPositionAnimation;
@override
Widget build(BuildContext context) {
return LayoutBuilder(builder: (context, constraints) {
return Stack(
children: [
SizedBox(height: _carouselHeight(.4, context)),
AnimatedBuilder(
animation: controller,
builder: (context, child) {
return PositionedDirectional(
start: constraints.maxWidth * startPositionAnimation.value,
child: child!,
);
},
child: SizedBox(
height: _carouselHeight(.4, context),
width: constraints.maxWidth,
child: child,
),
),
],
);
});
}
}
/// Animates a carousel card to come in from the right.
class _AnimatedCarouselCard extends StatelessWidget {
_AnimatedCarouselCard({
required this.child,
required this.controller,
}) : startPaddingAnimation = Tween(
begin: _horizontalPadding,
end: 0.0,
).animate(
CurvedAnimation(
parent: controller,
curve: const Interval(
0.900,
1.000,
curve: Curves.ease,
),
),
);
final Widget child;
final AnimationController controller;
final Animation<double> startPaddingAnimation;
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: controller,
builder: (context, child) {
return Padding(
padding: EdgeInsetsDirectional.only(
start: startPaddingAnimation.value,
),
child: child,
);
},
child: child,
);
}
}
class _MobileCarousel extends StatefulWidget {
const _MobileCarousel({
required this.animationController,
this.restorationId,
required this.children,
});
final AnimationController animationController;
final String? restorationId;
final List<Widget> children;
@override
_MobileCarouselState createState() => _MobileCarouselState();
}
class _MobileCarouselState extends State<_MobileCarousel>
with RestorationMixin, SingleTickerProviderStateMixin {
late PageController _controller;
final RestorableInt _currentPage = RestorableInt(0);
@override
String? get restorationId => widget.restorationId;
@override
void restoreState(RestorationBucket? oldBucket, bool initialRestore) {
registerForRestoration(_currentPage, 'carousel_page');
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
// The viewPortFraction is calculated as the width of the device minus the
// padding.
final width = MediaQuery.of(context).size.width;
const padding = (_carouselItemMobileMargin * 2);
_controller = PageController(
initialPage: _currentPage.value,
viewportFraction: (_carouselItemWidth + padding) / width,
);
}
@override
void dispose() {
_controller.dispose();
_currentPage.dispose();
super.dispose();
}
Widget builder(int index) {
final carouselCard = AnimatedBuilder(
animation: _controller,
builder: (context, child) {
double value;
if (_controller.position.haveDimensions) {
value = _controller.page! - index;
} else {
// If haveDimensions is false, use _currentPage to calculate value.
value = (_currentPage.value - index).toDouble();
}
// .3 is an approximation of the curve used in the design.
value = (1 - (value.abs() * .3)).clamp(0, 1).toDouble();
value = Curves.easeOut.transform(value);
return Transform.scale(
scale: value,
alignment: Alignment.center,
child: child,
);
},
child: widget.children[index],
);
// We only want the second card to be animated.
if (index == 1) {
return _AnimatedCarouselCard(
controller: widget.animationController,
child: carouselCard,
);
} else {
return carouselCard;
}
}
@override
Widget build(BuildContext context) {
return _AnimatedCarousel(
controller: widget.animationController,
child: PageView.builder(
// Makes integration tests possible.
key: const ValueKey('studyDemoList'),
onPageChanged: (value) {
setState(() {
_currentPage.value = value;
});
},
controller: _controller,
pageSnapping: false,
itemCount: widget.children.length,
itemBuilder: (context, index) => builder(index),
allowImplicitScrolling: true,
),
);
}
}
/// This creates a horizontally scrolling [ListView] of items.
///
/// This class uses a [ListView] with a custom [ScrollPhysics] to enable
/// snapping behavior. A [PageView] was considered but does not allow for
/// multiple pages visible without centering the first page.
class _DesktopCarousel extends StatefulWidget {
const _DesktopCarousel({required this.height, required this.children});
final double height;
final List<Widget> children;
@override
_DesktopCarouselState createState() => _DesktopCarouselState();
}
class _DesktopCarouselState extends State<_DesktopCarousel> {
late ScrollController _controller;
@override
void initState() {
super.initState();
_controller = ScrollController();
_controller.addListener(() {
setState(() {});
});
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
var showPreviousButton = false;
var showNextButton = true;
// Only check this after the _controller has been attached to the ListView.
if (_controller.hasClients) {
showPreviousButton = _controller.offset > 0;
showNextButton =
_controller.offset < _controller.position.maxScrollExtent;
}
final isDesktop = isDisplayDesktop(context);
return Align(
alignment: Alignment.center,
child: Container(
height: widget.height,
constraints: const BoxConstraints(maxWidth: maxHomeItemWidth),
child: Stack(
children: [
ListView.builder(
padding: EdgeInsets.symmetric(
horizontal: isDesktop
? _horizontalDesktopPadding - _carouselItemDesktopMargin
: _horizontalPadding - _carouselItemMobileMargin,
),
scrollDirection: Axis.horizontal,
primary: false,
physics: const _SnappingScrollPhysics(),
controller: _controller,
itemExtent: _carouselItemWidth,
itemCount: widget.children.length,
itemBuilder: (context, index) => Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: widget.children[index],
),
),
if (showPreviousButton)
_DesktopPageButton(
onTap: () {
_controller.animateTo(
_controller.offset - _carouselItemWidth,
duration: const Duration(milliseconds: 200),
curve: Curves.easeInOut,
);
},
),
if (showNextButton)
_DesktopPageButton(
isEnd: true,
onTap: () {
_controller.animateTo(
_controller.offset + _carouselItemWidth,
duration: const Duration(milliseconds: 200),
curve: Curves.easeInOut,
);
},
),
],
),
),
);
}
}
/// Scrolling physics that snaps to the new item in the [_DesktopCarousel].
class _SnappingScrollPhysics extends ScrollPhysics {
const _SnappingScrollPhysics({super.parent});
@override
_SnappingScrollPhysics applyTo(ScrollPhysics? ancestor) {
return _SnappingScrollPhysics(parent: buildParent(ancestor));
}
double _getTargetPixels(
ScrollMetrics position,
Tolerance tolerance,
double velocity,
) {
final itemWidth = position.viewportDimension / 4;
var item = position.pixels / itemWidth;
if (velocity < -tolerance.velocity) {
item -= 0.5;
} else if (velocity > tolerance.velocity) {
item += 0.5;
}
return math.min(
item.roundToDouble() * itemWidth,
position.maxScrollExtent,
);
}
@override
Simulation? createBallisticSimulation(
ScrollMetrics position,
double velocity,
) {
if ((velocity <= 0.0 && position.pixels <= position.minScrollExtent) ||
(velocity >= 0.0 && position.pixels >= position.maxScrollExtent)) {
return super.createBallisticSimulation(position, velocity);
}
final tolerance = toleranceFor(position);
final target = _getTargetPixels(position, tolerance, velocity);
if (target != position.pixels) {
return ScrollSpringSimulation(
spring,
position.pixels,
target,
velocity,
tolerance: tolerance,
);
}
return null;
}
@override
bool get allowImplicitScrolling => true;
}
class _DesktopPageButton extends StatelessWidget {
const _DesktopPageButton({
this.isEnd = false,
this.onTap,
});
final bool isEnd;
final GestureTapCallback? onTap;
@override
Widget build(BuildContext context) {
const buttonSize = 58.0;
const padding = _horizontalDesktopPadding - buttonSize / 2;
return ExcludeSemantics(
child: Align(
alignment: isEnd
? AlignmentDirectional.centerEnd
: AlignmentDirectional.centerStart,
child: Container(
width: buttonSize,
height: buttonSize,
margin: EdgeInsetsDirectional.only(
start: isEnd ? 0 : padding,
end: isEnd ? padding : 0,
),
child: Tooltip(
message: isEnd
? MaterialLocalizations.of(context).nextPageTooltip
: MaterialLocalizations.of(context).previousPageTooltip,
child: Material(
color: Colors.black.withOpacity(0.5),
shape: const CircleBorder(),
clipBehavior: Clip.antiAlias,
child: InkWell(
onTap: onTap,
child: Icon(
isEnd ? Icons.arrow_forward_ios : Icons.arrow_back_ios,
color: Colors.white,
),
),
),
),
),
),
);
}
}
class _CarouselCard extends StatelessWidget {
const _CarouselCard({
required this.demo,
this.asset,
this.assetDark,
this.assetColor,
this.assetDarkColor,
this.textColor,
required this.studyRoute,
});
final GalleryDemo? demo;
final ImageProvider? asset;
final ImageProvider? assetDark;
final Color? assetColor;
final Color? assetDarkColor;
final Color? textColor;
final String studyRoute;
@override
Widget build(BuildContext context) {
final textTheme = Theme.of(context).textTheme;
final isDark = Theme.of(context).colorScheme.brightness == Brightness.dark;
final asset = isDark ? assetDark : this.asset;
final assetColor = isDark ? assetDarkColor : this.assetColor;
final textColor = isDark ? Colors.white.withOpacity(0.87) : this.textColor;
final isDesktop = isDisplayDesktop(context);
return Container(
padding: EdgeInsets.symmetric(
horizontal: isDesktop
? _carouselItemDesktopMargin
: _carouselItemMobileMargin),
margin: const EdgeInsets.symmetric(vertical: 16.0),
height: _carouselHeight(0.7, context),
width: _carouselItemWidth,
child: Material(
// Makes integration tests possible.
key: ValueKey(demo!.describe),
color: assetColor,
elevation: 4,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
clipBehavior: Clip.antiAlias,
child: Stack(
fit: StackFit.expand,
children: [
if (asset != null)
FadeInImage(
image: asset,
placeholder: MemoryImage(kTransparentImage),
fit: BoxFit.cover,
height: _carouselHeightMin,
fadeInDuration: entranceAnimationDuration,
),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16, 0, 16, 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
demo!.title,
style: textTheme.bodySmall!.apply(color: textColor),
maxLines: 3,
overflow: TextOverflow.visible,
),
Text(
demo!.subtitle,
style: textTheme.labelSmall!.apply(color: textColor),
maxLines: 5,
overflow: TextOverflow.visible,
),
],
),
),
Positioned.fill(
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: () {
Navigator.of(context)
.popUntil((route) => route.settings.name == '/');
Navigator.of(context).restorablePushNamed(studyRoute);
},
),
),
),
],
),
),
);
}
}
double _carouselHeight(double scaleFactor, BuildContext context) => math.max(
_carouselHeightMin *
GalleryOptions.of(context).textScaleFactor(context) *
scaleFactor,
_carouselHeightMin);
/// Wrap the studies with this to display a back button and allow the user to
/// exit them at any time.
class StudyWrapper extends StatefulWidget {
const StudyWrapper({
super.key,
required this.study,
this.alignment = AlignmentDirectional.bottomStart,
this.hasBottomNavBar = false,
});
final Widget study;
final bool hasBottomNavBar;
final AlignmentDirectional alignment;
@override
State<StudyWrapper> createState() => _StudyWrapperState();
}
class _StudyWrapperState extends State<StudyWrapper> {
@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
final textTheme = Theme.of(context).textTheme;
return ApplyTextOptions(
child: Stack(
children: [
Semantics(
sortKey: const OrdinalSortKey(1),
child: RestorationScope(
restorationId: 'study_wrapper',
child: widget.study,
),
),
if (!isDisplayFoldable(context))
SafeArea(
child: Align(
alignment: widget.alignment,
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.0,
vertical: widget.hasBottomNavBar
? kBottomNavigationBarHeight + 16.0
: 16.0),
child: Semantics(
sortKey: const OrdinalSortKey(0),
label: GalleryLocalizations.of(context)!.backToGallery,
button: true,
enabled: true,
excludeSemantics: true,
child: FloatingActionButton.extended(
heroTag: _BackButtonHeroTag(),
key: const ValueKey('Back'),
onPressed: () {
Navigator.of(context)
.popUntil((route) => route.settings.name == '/');
},
icon: IconTheme(
data: IconThemeData(color: colorScheme.onPrimary),
child: const BackButtonIcon(),
),
label: Text(
MaterialLocalizations.of(context).backButtonTooltip,
style: textTheme.labelLarge!
.apply(color: colorScheme.onPrimary),
),
),
),
),
),
),
],
),
);
}
}
class _BackButtonHeroTag {}
| gallery/lib/pages/home.dart/0 | {
"file_path": "gallery/lib/pages/home.dart",
"repo_id": "gallery",
"token_count": 17833
} | 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';
class Category {
const Category({
required this.name,
});
// A function taking a BuildContext as input and
// returns the internationalized name of the category.
final String Function(BuildContext) name;
}
Category categoryAll = Category(
name: (context) => GalleryLocalizations.of(context)!.shrineCategoryNameAll,
);
Category categoryAccessories = Category(
name: (context) =>
GalleryLocalizations.of(context)!.shrineCategoryNameAccessories,
);
Category categoryClothing = Category(
name: (context) =>
GalleryLocalizations.of(context)!.shrineCategoryNameClothing,
);
Category categoryHome = Category(
name: (context) => GalleryLocalizations.of(context)!.shrineCategoryNameHome,
);
List<Category> categories = [
categoryAll,
categoryAccessories,
categoryClothing,
categoryHome,
];
class Product {
const Product({
required this.category,
required this.id,
required this.isFeatured,
required this.name,
required this.price,
this.assetAspectRatio = 1,
});
final Category category;
final int id;
final bool isFeatured;
final double assetAspectRatio;
// A function taking a BuildContext as input and
// returns the internationalized name of the product.
final String Function(BuildContext) name;
final int price;
String get assetName => '$id-0.jpg';
String get assetPackage => 'shrine_images';
}
| gallery/lib/studies/shrine/model/product.dart/0 | {
"file_path": "gallery/lib/studies/shrine/model/product.dart",
"repo_id": "gallery",
"token_count": 494
} | 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:flutter_gen/gen_l10n/gallery_localizations.dart';
import 'package:gallery/layout/adaptive.dart';
const appBarDesktopHeight = 128.0;
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
final textTheme = Theme.of(context).textTheme;
final colorScheme = Theme.of(context).colorScheme;
final isDesktop = isDisplayDesktop(context);
final localizations = GalleryLocalizations.of(context)!;
final body = SafeArea(
child: Padding(
padding: isDesktop
? const EdgeInsets.symmetric(horizontal: 72, vertical: 48)
: const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SelectableText(
localizations.starterAppGenericHeadline,
style: textTheme.displaySmall!.copyWith(
color: colorScheme.onSecondary,
),
),
const SizedBox(height: 10),
SelectableText(
localizations.starterAppGenericSubtitle,
style: textTheme.titleMedium,
),
const SizedBox(height: 48),
SelectableText(
localizations.starterAppGenericBody,
style: textTheme.bodyLarge,
),
],
),
),
);
if (isDesktop) {
return Row(
children: [
const ListDrawer(),
const VerticalDivider(width: 1),
Expanded(
child: Scaffold(
appBar: const AdaptiveAppBar(
isDesktop: true,
),
body: body,
floatingActionButton: FloatingActionButton.extended(
heroTag: 'Extended Add',
onPressed: () {},
label: Text(
localizations.starterAppGenericButton,
style: TextStyle(color: colorScheme.onSecondary),
),
icon: Icon(Icons.add, color: colorScheme.onSecondary),
tooltip: localizations.starterAppTooltipAdd,
),
),
),
],
);
} else {
return Scaffold(
appBar: const AdaptiveAppBar(),
body: body,
drawer: const ListDrawer(),
floatingActionButton: FloatingActionButton(
heroTag: 'Add',
onPressed: () {},
tooltip: localizations.starterAppTooltipAdd,
child: Icon(
Icons.add,
color: Theme.of(context).colorScheme.onSecondary,
),
),
);
}
}
}
class AdaptiveAppBar extends StatelessWidget implements PreferredSizeWidget {
const AdaptiveAppBar({
super.key,
this.isDesktop = false,
});
final bool isDesktop;
@override
Size get preferredSize => isDesktop
? const Size.fromHeight(appBarDesktopHeight)
: const Size.fromHeight(kToolbarHeight);
@override
Widget build(BuildContext context) {
final themeData = Theme.of(context);
final localizations = GalleryLocalizations.of(context)!;
return AppBar(
automaticallyImplyLeading: !isDesktop,
title: isDesktop
? null
: SelectableText(localizations.starterAppGenericTitle),
bottom: isDesktop
? PreferredSize(
preferredSize: const Size.fromHeight(26),
child: Container(
alignment: AlignmentDirectional.centerStart,
margin: const EdgeInsetsDirectional.fromSTEB(72, 0, 0, 22),
child: SelectableText(
localizations.starterAppGenericTitle,
style: themeData.textTheme.titleLarge!.copyWith(
color: themeData.colorScheme.onPrimary,
),
),
),
)
: null,
actions: [
IconButton(
icon: const Icon(Icons.share),
tooltip: localizations.starterAppTooltipShare,
onPressed: () {},
),
IconButton(
icon: const Icon(Icons.favorite),
tooltip: localizations.starterAppTooltipFavorite,
onPressed: () {},
),
IconButton(
icon: const Icon(Icons.search),
tooltip: localizations.starterAppTooltipSearch,
onPressed: () {},
),
],
);
}
}
class ListDrawer extends StatefulWidget {
const ListDrawer({super.key});
@override
State<ListDrawer> createState() => _ListDrawerState();
}
class _ListDrawerState extends State<ListDrawer> {
static const numItems = 9;
int selectedItem = 0;
@override
Widget build(BuildContext context) {
final textTheme = Theme.of(context).textTheme;
final localizations = GalleryLocalizations.of(context)!;
return Drawer(
child: SafeArea(
child: ListView(
children: [
ListTile(
title: SelectableText(
localizations.starterAppTitle,
style: textTheme.titleLarge,
),
subtitle: SelectableText(
localizations.starterAppGenericSubtitle,
style: textTheme.bodyMedium,
),
),
const Divider(),
...Iterable<int>.generate(numItems).toList().map((i) {
return ListTile(
enabled: true,
selected: i == selectedItem,
leading: const Icon(Icons.favorite),
title: Text(
localizations.starterAppDrawerItem(i + 1),
),
onTap: () {
setState(() {
selectedItem = i;
});
},
);
}),
],
),
),
);
}
}
| gallery/lib/studies/starter/home.dart/0 | {
"file_path": "gallery/lib/studies/starter/home.dart",
"repo_id": "gallery",
"token_count": 2921
} | 817 |
// Copyright 2020 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:collection/collection.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations_en.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:gallery/data/demos.dart';
bool _isUnique(List<String> list) {
final covered = <String>{};
for (final element in list) {
if (covered.contains(element)) {
return false;
} else {
covered.add(element);
}
}
return true;
}
const _stringListEquality = ListEquality<String>();
void main() {
test('_isUnique works correctly', () {
expect(_isUnique(['a', 'b', 'c']), true);
expect(_isUnique(['a', 'c', 'a', 'b']), false);
expect(_isUnique(['a']), true);
expect(_isUnique([]), true);
});
test('Demo descriptions are unique and correct', () {
final allDemos = Demos.all(GalleryLocalizationsEn());
final allDemoDescriptions = allDemos.map((d) => d.describe).toList();
expect(_isUnique(allDemoDescriptions), true);
expect(
_stringListEquality.equals(
allDemoDescriptions,
Demos.allDescriptions(),
),
true,
);
});
test('Special demo descriptions are correct', () {
final allDemos = Demos.allDescriptions();
final specialDemos = <String>[
'shrine@study',
'rally@study',
'crane@study',
'fortnightly@study',
'bottom-navigation@material',
'button@material',
'card@material',
'chip@material',
'dialog@material',
'pickers@material',
'cupertino-alerts@cupertino',
'colors@other',
'progress-indicator@material',
'cupertino-activity-indicator@cupertino',
'colors@other',
];
for (final specialDemo in specialDemos) {
expect(allDemos.contains(specialDemo), true);
}
});
}
| gallery/test/demo_descriptions_test.dart/0 | {
"file_path": "gallery/test/demo_descriptions_test.dart",
"repo_id": "gallery",
"token_count": 758
} | 818 |
// Copyright 2020 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:io';
import 'package:path/path.dart' as path;
import 'package:test/test.dart';
// Benchmark size in kB.
const int bundleSizeBenchmark = 5000;
const int gzipBundleSizeBenchmark = 1200;
void main() {
group('Web Compile', () {
test('bundle size', () async {
final js = path.join(
Directory.current.path,
'build',
'web',
'main.dart.js',
);
await _runProcess('flutter', [
'build',
'web',
]);
await _runProcess('gzip', ['-k', js]);
final bundleSize = await _measureSize(js);
final gzipBundleSize = await _measureSize('$js.gz');
if (bundleSize > bundleSizeBenchmark) {
fail(
'The size the compiled web build "$js" was $bundleSize kB. This is '
'larger than the benchmark that was set at $bundleSizeBenchmark kB.'
'\n\n'
'The build size should be as minimal as possible to reduce the web '
'app’s initial startup time. If this change is intentional, and'
' expected, please increase the constant "bundleSizeBenchmark".');
} else if (gzipBundleSize > gzipBundleSizeBenchmark) {
fail('The size the compiled and gzipped web build "$js" was'
' $gzipBundleSize kB. This is larger than the benchmark that was '
'set at $gzipBundleSizeBenchmark kB.\n\n'
'The build size should be as minimal as possible to reduce the '
'web app’s initial startup time. If this change is intentional, and'
' expected, please increase the constant "gzipBundleSizeBenchmark".');
}
}, timeout: const Timeout(Duration(minutes: 5)));
});
}
Future<int> _measureSize(String file) async {
final result = await _runProcess('du', ['-k', file]);
return int.parse(
(result.stdout as String).split(RegExp(r'\s+')).first.trim());
}
Future<ProcessResult> _runProcess(
String executable, List<String> arguments) async {
final result = await Process.run(executable, arguments);
stdout.write(result.stdout);
stderr.write(result.stderr);
return result;
}
| gallery/test_benchmarks/web_bundle_size_test.dart/0 | {
"file_path": "gallery/test_benchmarks/web_bundle_size_test.dart",
"repo_id": "gallery",
"token_count": 888
} | 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/cupertino.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:gallery/main.dart';
import 'testing/precache_images.dart';
import 'testing/util.dart';
void main() {
group('mobile', () {
testWidgets('home page matches golden screenshot', (tester) async {
await setUpBinding(tester);
await pumpWidgetWithImages(
tester,
const GalleryApp(),
homeAssets,
);
await tester.pumpAndSettle();
await expectLater(
find.byType(GalleryApp),
matchesGoldenFile('goldens/home_page_mobile_light.png'),
);
});
testWidgets('dark home page matches golden screenshot', (tester) async {
await setUpBinding(tester, brightness: Brightness.dark);
await pumpWidgetWithImages(
tester,
const GalleryApp(),
homeAssets,
);
await tester.pumpAndSettle();
await expectLater(
find.byType(GalleryApp),
matchesGoldenFile('goldens/home_page_mobile_dark.png'),
);
});
});
group('desktop', () {
testWidgets('home page matches golden screenshot', (tester) async {
await setUpBinding(tester, size: desktopSize);
await pumpWidgetWithImages(
tester,
const GalleryApp(),
homeAssets,
);
await tester.pumpAndSettle();
await expectLater(
find.byType(GalleryApp),
matchesGoldenFile('goldens/home_page_desktop_light.png'),
);
});
testWidgets('dark home page matches golden screenshot', (tester) async {
await setUpBinding(
tester,
size: desktopSize,
brightness: Brightness.dark,
);
await pumpWidgetWithImages(
tester,
const GalleryApp(),
homeAssets,
);
await tester.pumpAndSettle();
await expectLater(
find.byType(GalleryApp),
matchesGoldenFile('goldens/home_page_desktop_dark.png'),
);
});
});
}
| gallery/test_goldens/home_test.dart/0 | {
"file_path": "gallery/test_goldens/home_test.dart",
"repo_id": "gallery",
"token_count": 875
} | 820 |
// 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_test/flutter_test.dart';
const mobileSize = Size(540, 960);
const desktopSize = Size(1280, 850);
const homeAssets = [
AssetImage(
'assets/icons/cupertino/cupertino.png',
package: 'flutter_gallery_assets',
),
AssetImage(
'assets/icons/material/material.png',
package: 'flutter_gallery_assets',
),
AssetImage(
'assets/icons/reference/reference.png',
package: 'flutter_gallery_assets',
),
AssetImage(
'assets/logo/flutter_logo.png',
package: 'flutter_gallery_assets',
),
AssetImage(
'assets/studies/reply_card.png',
package: 'flutter_gallery_assets',
),
AssetImage(
'assets/studies/reply_card_dark.png',
package: 'flutter_gallery_assets',
),
AssetImage(
'assets/studies/crane_card.png',
package: 'flutter_gallery_assets',
),
AssetImage(
'assets/studies/crane_card_dark.png',
package: 'flutter_gallery_assets',
),
AssetImage(
'assets/studies/rally_card.png',
package: 'flutter_gallery_assets',
),
AssetImage(
'assets/studies/rally_card_dark.png',
package: 'flutter_gallery_assets',
),
AssetImage(
'assets/studies/shrine_card.png',
package: 'flutter_gallery_assets',
),
AssetImage(
'assets/studies/shrine_card_dark.png',
package: 'flutter_gallery_assets',
),
AssetImage(
'assets/studies/fortnightly_card.png',
package: 'flutter_gallery_assets',
),
AssetImage(
'assets/studies/fortnightly_card_dark.png',
package: 'flutter_gallery_assets',
),
];
const shrineAssets = [
AssetImage('0-0.jpg', package: 'shrine_images'),
AssetImage('1-0.jpg', package: 'shrine_images'),
AssetImage('2-0.jpg', package: 'shrine_images'),
AssetImage('3-0.jpg', package: 'shrine_images'),
AssetImage('4-0.jpg', package: 'shrine_images'),
AssetImage('5-0.jpg', package: 'shrine_images'),
AssetImage('6-0.jpg', package: 'shrine_images'),
AssetImage('7-0.jpg', package: 'shrine_images'),
AssetImage('8-0.jpg', package: 'shrine_images'),
AssetImage('9-0.jpg', package: 'shrine_images'),
AssetImage('10-0.jpg', package: 'shrine_images'),
AssetImage('11-0.jpg', package: 'shrine_images'),
AssetImage('12-0.jpg', package: 'shrine_images'),
AssetImage('13-0.jpg', package: 'shrine_images'),
AssetImage('14-0.jpg', package: 'shrine_images'),
AssetImage('15-0.jpg', package: 'shrine_images'),
AssetImage('16-0.jpg', package: 'shrine_images'),
AssetImage('17-0.jpg', package: 'shrine_images'),
AssetImage('18-0.jpg', package: 'shrine_images'),
AssetImage('19-0.jpg', package: 'shrine_images'),
AssetImage('20-0.jpg', package: 'shrine_images'),
AssetImage('21-0.jpg', package: 'shrine_images'),
AssetImage('22-0.jpg', package: 'shrine_images'),
AssetImage('23-0.jpg', package: 'shrine_images'),
AssetImage('24-0.jpg', package: 'shrine_images'),
AssetImage('25-0.jpg', package: 'shrine_images'),
AssetImage('26-0.jpg', package: 'shrine_images'),
AssetImage('27-0.jpg', package: 'shrine_images'),
AssetImage('28-0.jpg', package: 'shrine_images'),
AssetImage('29-0.jpg', package: 'shrine_images'),
AssetImage('30-0.jpg', package: 'shrine_images'),
AssetImage('31-0.jpg', package: 'shrine_images'),
AssetImage('32-0.jpg', package: 'shrine_images'),
AssetImage('33-0.jpg', package: 'shrine_images'),
AssetImage('34-0.jpg', package: 'shrine_images'),
AssetImage('35-0.jpg', package: 'shrine_images'),
AssetImage('36-0.jpg', package: 'shrine_images'),
AssetImage('37-0.jpg', package: 'shrine_images'),
AssetImage('diamond.png', package: 'shrine_images'),
AssetImage('slanted_menu.png', package: 'shrine_images'),
];
Future<void> setUpBinding(
WidgetTester tester, {
Size size = mobileSize,
Brightness brightness = Brightness.light,
}) async {
tester.view.physicalSize = size;
tester.view.devicePixelRatio = 1.0;
tester.platformDispatcher.textScaleFactorTestValue = 1.0;
tester.platformDispatcher.platformBrightnessTestValue = brightness;
addTearDown(tester.view.reset);
addTearDown(tester.platformDispatcher.clearAllTestValues);
}
| gallery/test_goldens/testing/util.dart/0 | {
"file_path": "gallery/test_goldens/testing/util.dart",
"repo_id": "gallery",
"token_count": 1577
} | 821 |
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch development",
"request": "launch",
"type": "dart",
"program": "lib/main_development.dart",
"args": [
"--flavor",
"development",
"--target",
"lib/main_development.dart",
"--dart-define",
"ENCRYPTION_KEY=$ENCRYPTION_KEY",
"--dart-define",
"ENCRYPTION_IV=$ENCRYPTION_IV",
"--dart-define",
"RECAPTCHA_KEY=$RECAPTCHA_KEY",
"--dart-define",
"APPCHECK_DEBUG_TOKEN=$APPCHECK_DEBUG_TOKEN",
"--dart-define",
"ALLOW_PRIVATE_MATCHES=true"
]
},
{
"name": "Launch server",
"request": "attach",
"type": "dart",
"preLaunchTask": "api:start",
"postDebugTask": "api:stop",
"cwd": "${workspaceFolder}/api"
},
{
"name": "Launch local",
"request": "launch",
"type": "dart",
"program": "lib/main_local.dart",
"args": [
"--flavor",
"development",
"--target",
"lib/main_local.dart",
"--dart-define",
"ENCRYPTION_KEY=X9YTchZdcnyZTNBSBgzj29p7RMBAIubD",
"--dart-define",
"ENCRYPTION_IV=FxC21ctRg9SgiXuZ",
"--dart-define",
"RECAPTCHA_KEY=6LeafHolAAAAAH-kou5bR2y4gtEOmFXdd6pM4cJz",
"--dart-define",
"APPCHECK_DEBUG_TOKEN=1E88A2CC-8D94-4ADC-A156-A63DBA49627D",
"--dart-define",
"ALLOW_PRIVATE_MATCHES=true"
]
},
{
"name": "Launch production",
"request": "launch",
"type": "dart",
"program": "lib/main_production.dart",
"args": [
"--flavor",
"production",
"--target",
"lib/main_production.dart"
]
},
{
"name": "Launch UI gallery",
"request": "launch",
"type": "dart",
"program": "packages/io_flip_ui/gallery/lib/main.dart"
}
]
}
| io_flip/.vscode/launch.json/0 | {
"file_path": "io_flip/.vscode/launch.json",
"repo_id": "io_flip",
"token_count": 1115
} | 822 |
import 'package:mustache_template/mustache_template.dart';
const _template = '''
<img
src="{{{handImage}}}"
/>
<div class="hand-section">
{{#initials}}
<h3 class="initials">{{initials}}</h3>
{{/initials}}
{{#streak}}
<h4 class="streak">{{streak}} win streak!</h4>
{{/streak}}
</div>
''';
/// Builds the HTML page for the share card link.
String buildHandContent({
required String handImage,
required String? initials,
required String? streak,
}) {
return Template(_template).renderString({
'handImage': handImage,
'initials': initials,
'streak': streak,
});
}
| io_flip/api/lib/templates/share_deck_template.dart/0 | {
"file_path": "io_flip/api/lib/templates/share_deck_template.dart",
"repo_id": "io_flip",
"token_count": 276
} | 823 |
# Encryption Middleware
[![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link]
[](https://github.com/felangel/mason)
[![License: MIT][license_badge]][license_link]
A dart_frog middleware for encrypting responses.
## Installation 💻
**❗ In order to start using Encryption Middleware you must have the [Dart SDK][dart_install_link] installed on your machine.**
Add `encryption_middleware` to your `pubspec.yaml`:
```yaml
dependencies:
encryption_middleware:
```
Install it:
```sh
dart pub get
```
---
## Continuous Integration 🤖
Encryption Middleware comes with a built-in [GitHub Actions workflow][github_actions_link] powered by [Very Good Workflows][very_good_workflows_link] but you can also add your preferred CI/CD solution.
Out of the box, on each pull request and push, the CI `formats`, `lints`, and `tests` the code. This ensures the code remains consistent and behaves correctly as you add functionality or make changes. The project uses [Very Good Analysis][very_good_analysis_link] for a strict set of analysis options used by our team. Code coverage is enforced using the [Very Good Workflows][very_good_coverage_link].
---
## Running Tests 🧪
To run all unit tests:
```sh
dart pub global activate coverage 1.2.0
dart test --coverage=coverage
dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info
```
To view the generated coverage report you can use [lcov](https://github.com/linux-test-project/lcov).
```sh
# Generate Coverage Report
genhtml coverage/lcov.info -o coverage/
# Open Coverage Report
open coverage/index.html
```
[dart_install_link]: https://dart.dev/get-dart
[github_actions_link]: https://docs.github.com/en/actions/learn-github-actions
[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg
[license_link]: https://opensource.org/licenses/MIT
[logo_black]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_black.png#gh-light-mode-only
[logo_white]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_white.png#gh-dark-mode-only
[mason_link]: https://github.com/felangel/mason
[very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg
[very_good_analysis_link]: https://pub.dev/packages/very_good_analysis
[very_good_coverage_link]: https://github.com/marketplace/actions/very-good-coverage
[very_good_ventures_link]: https://verygood.ventures
[very_good_ventures_link_light]: https://verygood.ventures#gh-light-mode-only
[very_good_ventures_link_dark]: https://verygood.ventures#gh-dark-mode-only
[very_good_workflows_link]: https://github.com/VeryGoodOpenSource/very_good_workflows
| io_flip/api/packages/encryption_middleware/README.md/0 | {
"file_path": "io_flip/api/packages/encryption_middleware/README.md",
"repo_id": "io_flip",
"token_count": 934
} | 824 |
include: package:very_good_analysis/analysis_options.4.0.0.yaml
analyzer:
exclude:
- "**/*.g.dart" | io_flip/api/packages/game_domain/analysis_options.yaml/0 | {
"file_path": "io_flip/api/packages/game_domain/analysis_options.yaml",
"repo_id": "io_flip",
"token_count": 44
} | 825 |
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
part 'prompt.g.dart';
/// {@template prompt}
/// A model that contains the 3 prompt attributes required to generate a deck.
/// {@endtemplate}
@JsonSerializable(ignoreUnannotated: true, explicitToJson: true)
class Prompt extends Equatable {
/// {@macro prompt}
const Prompt({
this.isIntroSeen,
this.characterClass,
this.power,
});
/// {@macro prompt}
factory Prompt.fromJson(Map<String, dynamic> json) => _$PromptFromJson(json);
/// Whether the prompt building intro has been seen.
final bool? isIntroSeen;
/// Character class.
@JsonKey()
final String? characterClass;
/// Primary power.
@JsonKey()
final String? power;
/// Returns a copy of the instance setting the [isIntroSeen] to true.
Prompt setIntroSeen() {
return Prompt(
isIntroSeen: true,
characterClass: characterClass,
power: power,
);
}
/// Returns a copy of the instance and
/// sets the new [attribute] to the first null in this order:
/// [characterClass], [power]
Prompt copyWithNewAttribute(String attribute) {
return Prompt(
isIntroSeen: isIntroSeen,
characterClass: characterClass ?? attribute,
power: characterClass != null ? power ?? attribute : null,
);
}
/// Returns a json representation from this instance.
Map<String, dynamic> toJson() => _$PromptToJson(this);
@override
List<Object?> get props => [
isIntroSeen,
characterClass,
power,
];
}
| io_flip/api/packages/game_domain/lib/src/models/prompt.dart/0 | {
"file_path": "io_flip/api/packages/game_domain/lib/src/models/prompt.dart",
"repo_id": "io_flip",
"token_count": 541
} | 826 |
// ignore_for_file: prefer_const_constructors
import 'package:game_domain/game_domain.dart';
import 'package:test/test.dart';
void main() {
group('Match', () {
const card1 = Card(
id: 'card1',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.air,
);
const card2 = Card(
id: 'card2',
name: '',
description: '',
image: '',
rarity: false,
power: 1,
suit: Suit.fire,
);
const hostDeck = Deck(
id: 'hostDeck',
userId: 'hostUserId',
cards: [card1],
);
const guestDeck = Deck(
id: 'guestDeck',
userId: 'guestUserId',
cards: [card2],
);
test('can be instantiated', () {
expect(
Match(
id: 'matchId',
hostDeck: hostDeck,
guestDeck: guestDeck,
),
isNotNull,
);
});
test('toJson returns the instance as json', () {
expect(
Match(
id: 'matchId',
hostDeck: hostDeck,
guestDeck: guestDeck,
).toJson(),
equals({
'id': 'matchId',
'hostDeck': {
'id': 'hostDeck',
'userId': 'hostUserId',
'cards': [
{
'id': 'card1',
'name': '',
'description': '',
'image': '',
'rarity': false,
'power': 1,
'suit': 'air',
'shareImage': null,
},
],
'shareImage': null,
},
'guestDeck': {
'id': 'guestDeck',
'userId': 'guestUserId',
'cards': [
{
'id': 'card2',
'name': '',
'description': '',
'image': '',
'rarity': false,
'power': 1,
'suit': 'fire',
'shareImage': null,
},
],
'shareImage': null,
},
'hostConnected': false,
'guestConnected': false
}),
);
});
test('fromJson returns the correct instance', () {
expect(
Match.fromJson(const {
'id': 'matchId',
'hostDeck': {
'id': 'hostDeck',
'userId': 'hostUserId',
'cards': [
{
'id': 'card1',
'name': '',
'description': '',
'image': '',
'rarity': false,
'power': 1,
'suit': 'air',
},
],
},
'guestDeck': {
'id': 'guestDeck',
'userId': 'guestUserId',
'cards': [
{
'id': 'card2',
'name': '',
'description': '',
'image': '',
'rarity': false,
'power': 1,
'suit': 'fire',
},
],
}
}),
equals(
Match(
id: 'matchId',
hostDeck: hostDeck,
guestDeck: guestDeck,
),
),
);
});
test('supports equality', () {
expect(
Match(
id: 'matchId',
hostDeck: hostDeck,
guestDeck: guestDeck,
),
equals(
Match(
id: 'matchId',
hostDeck: hostDeck,
guestDeck: guestDeck,
),
),
);
expect(
Match(
id: 'matchId',
hostDeck: hostDeck,
guestDeck: guestDeck,
),
isNot(
equals(
Match(
id: 'matchId2',
hostDeck: hostDeck,
guestDeck: guestDeck,
),
),
),
);
expect(
Match(
id: 'matchId',
hostDeck: hostDeck,
guestDeck: guestDeck,
),
isNot(
equals(
Match(
id: 'matchId',
hostDeck: guestDeck,
guestDeck: hostDeck,
),
),
),
);
});
});
}
| io_flip/api/packages/game_domain/test/src/models/match_test.dart/0 | {
"file_path": "io_flip/api/packages/game_domain/test/src/models/match_test.dart",
"repo_id": "io_flip",
"token_count": 2672
} | 827 |
// ignore_for_file: prefer_const_constructors
import 'package:jwt_middleware/src/authenticated_user.dart';
import 'package:test/test.dart';
void main() {
group('AuthenticatedUser', () {
test('uses value equality', () {
final a = AuthenticatedUser('id');
final b = AuthenticatedUser('id');
final c = AuthenticatedUser('other');
expect(a, b);
expect(a, isNot(c));
});
});
}
| io_flip/api/packages/jwt_middleware/test/src/authenticated_user_test.dart/0 | {
"file_path": "io_flip/api/packages/jwt_middleware/test/src/authenticated_user_test.dart",
"repo_id": "io_flip",
"token_count": 158
} | 828 |
name: leaderboard_repository
description: Access to Leaderboard datasource.
version: 0.1.0+1
publish_to: none
environment:
sdk: ">=3.0.0 <4.0.0"
dependencies:
db_client:
path: ../db_client
game_domain:
path: ../game_domain
dev_dependencies:
mocktail: ^0.3.0
test: ^1.19.2
very_good_analysis: ^3.1.0
| io_flip/api/packages/leaderboard_repository/pubspec.yaml/0 | {
"file_path": "io_flip/api/packages/leaderboard_repository/pubspec.yaml",
"repo_id": "io_flip",
"token_count": 141
} | 829 |
// ignore_for_file: prefer_const_constructors
import 'package:db_client/db_client.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';
class _MockDbClient extends Mock implements DbClient {}
void main() {
group('PromptRepository', () {
late DbClient dbClient;
late PromptRepository promptRepository;
setUp(() {
dbClient = _MockDbClient();
promptRepository = PromptRepository(
dbClient: dbClient,
);
});
test('can be instantiated', () {
expect(
PromptRepository(
dbClient: dbClient,
),
isNotNull,
);
});
group('getPromptTermsByType', () {
test('returns a list of terms with location type', () async {
when(
() => dbClient.findBy(
'prompt_terms',
'type',
PromptTermType.location.name,
),
).thenAnswer(
(_) async => [
DbEntityRecord(
id: 'id1',
data: const {
'type': 'location',
'term': 'AAA',
},
),
DbEntityRecord(
id: 'id2',
data: const {
'type': 'location',
'term': 'BBB',
},
),
DbEntityRecord(
id: 'id3',
data: const {
'type': 'location',
'term': 'CCC',
},
),
],
);
final response = await promptRepository.getPromptTermsByType(
PromptTermType.location,
);
expect(
response,
equals(
[
PromptTerm(
id: 'id1',
type: PromptTermType.location,
term: 'AAA',
),
PromptTerm(
id: 'id2',
type: PromptTermType.location,
term: 'BBB',
),
PromptTerm(
id: 'id3',
type: PromptTermType.location,
term: 'CCC',
),
],
),
);
});
});
group('getByTerm', () {
test('returns a PromptTerm when there is one', () async {
when(
() => dbClient.findBy(
'prompt_terms',
'term',
'Super Smell',
),
).thenAnswer(
(_) async => [
DbEntityRecord(
id: 'id1',
data: const {
'type': 'power',
'term': 'Super Smell',
},
),
],
);
final response = await promptRepository.getByTerm(
'Super Smell',
);
expect(
response,
equals(
PromptTerm(
id: 'id1',
type: PromptTermType.power,
term: 'Super Smell',
),
),
);
});
test("returns null when there isn't one", () async {
when(
() => dbClient.findBy(
'prompt_terms',
'term',
'Super Smell',
),
).thenAnswer(
(_) async => [],
);
final response = await promptRepository.getByTerm(
'Super Smell',
);
expect(response, isNull);
});
});
group('isValidPrompt', () {
const prompt = Prompt(
power: 'AAA',
characterClass: 'CCC',
);
setUp(() {
when(
() => dbClient.findBy(
'prompt_terms',
'term',
prompt.power,
),
).thenAnswer(
(_) async => [
DbEntityRecord(
id: 'id1',
data: const {
'type': 'power',
'term': 'AAA',
},
),
],
);
when(
() => dbClient.findBy(
'prompt_terms',
'term',
prompt.characterClass,
),
).thenAnswer(
(_) async => [
DbEntityRecord(
id: 'id3',
data: const {
'type': 'characterClass',
'term': 'CCC',
},
),
],
);
});
test('isValidPrompt returns true', () async {
final isValid = await promptRepository.isValidPrompt(prompt);
expect(isValid, isTrue);
});
test('isValidPrompt returns false when power is invalid', () async {
when(
() => dbClient.findBy(
'prompt_terms',
'term',
prompt.power,
),
).thenAnswer(
(_) async => [],
);
final isValid = await promptRepository.isValidPrompt(prompt);
expect(isValid, isFalse);
});
test('isValidPrompt returns false when characterClass is invalid',
() async {
when(
() => dbClient.findBy(
'prompt_terms',
'term',
prompt.characterClass,
),
).thenAnswer(
(_) async => [],
);
final isValid = await promptRepository.isValidPrompt(prompt);
expect(isValid, isFalse);
});
test('isValidPrompt returns false when power is of wrong type', () async {
when(
() => dbClient.findBy(
'prompt_terms',
'term',
prompt.power,
),
).thenAnswer(
(_) async => [
DbEntityRecord(
id: 'id2',
data: const {
'type': 'characterClass',
'term': 'BBB',
},
),
],
);
final isValid = await promptRepository.isValidPrompt(prompt);
expect(isValid, isFalse);
});
test('isValidPrompt returns false when characterClass is of wrong type',
() async {
when(
() => dbClient.findBy(
'prompt_terms',
'term',
prompt.characterClass,
),
).thenAnswer(
(_) async => [
DbEntityRecord(
id: 'id2',
data: const {
'type': 'power',
'term': 'BBB',
},
),
],
);
final isValid = await promptRepository.isValidPrompt(prompt);
expect(isValid, isFalse);
});
});
group('createPromptTerm', () {
test('adds a new prompt term', () async {
when(
() => dbClient.add(
'prompt_terms',
{
'type': 'location',
'term': 'AAA',
'shortenedTerm': null,
},
),
).thenAnswer((_) async => 'id');
await promptRepository.createPromptTerm(
PromptTerm(
type: PromptTermType.location,
term: 'AAA',
),
);
verify(
() => dbClient.add(
'prompt_terms',
{
'type': 'location',
'term': 'AAA',
'shortenedTerm': null,
},
),
).called(1);
});
});
group('ensurePromptImage', () {
test(
'returns the same url when there is no table for the combo',
() async {
when(
() => dbClient.findBy(
'image_lookup_table',
'prompt',
'dash_mage_volcano',
),
).thenAnswer(
(_) async => [],
);
final result = await promptRepository.ensurePromptImage(
promptCombination: 'dash_mage_volcano',
imageUrl: 'dash_mage_volcano_1.png',
);
expect(result, equals('dash_mage_volcano_1.png'));
},
);
test(
'returns the same url when there is a table for the combo '
'and the image url is present',
() async {
when(
() => dbClient.findBy(
'image_lookup_table',
'prompt',
'dash_mage_volcano',
),
).thenAnswer(
(_) async => [
DbEntityRecord(
id: '',
data: const {
'available_images': <dynamic>[
'dash_mage_volcano_1.png',
],
},
),
],
);
final result = await promptRepository.ensurePromptImage(
promptCombination: 'dash_mage_volcano',
imageUrl: 'dash_mage_volcano_1.png',
);
expect(result, equals('dash_mage_volcano_1.png'));
},
);
test(
'returns a random url when there is a table for the combo '
'and the image url is not present',
() async {
when(
() => dbClient.findBy(
'image_lookup_table',
'prompt',
'dash_mage_volcano',
),
).thenAnswer(
(_) async => [
DbEntityRecord(
id: '',
data: const {
'available_images': [
'dash_mage_volcano_1.png',
'dash_mage_volcano_2.png',
],
},
),
],
);
final result = await promptRepository.ensurePromptImage(
promptCombination: 'dash_mage_volcano',
imageUrl: 'dash_mage_volcano_3.png',
);
final isOneOfTheOptions = [
'dash_mage_volcano_1.png',
'dash_mage_volcano_2.png',
].contains(result);
expect(isOneOfTheOptions, isTrue);
},
);
test(
'returns the same url when there is no entries in the table',
() async {
when(
() => dbClient.findBy(
'image_lookup_table',
'prompt',
'dash_mage_volcano',
),
).thenAnswer(
(_) async => [
DbEntityRecord(
id: '',
data: const {
'available_images': <String>[],
},
),
],
);
final result = await promptRepository.ensurePromptImage(
promptCombination: 'dash_mage_volcano',
imageUrl: 'dash_mage_volcano_1.png',
);
expect(result, equals('dash_mage_volcano_1.png'));
},
);
});
});
}
| io_flip/api/packages/prompt_repository/test/src/prompt_repository_test.dart/0 | {
"file_path": "io_flip/api/packages/prompt_repository/test/src/prompt_repository_test.dart",
"repo_id": "io_flip",
"token_count": 6153
} | 830 |
import 'dart:async';
import 'dart:io';
import 'package:config_repository/config_repository.dart';
import 'package:dart_frog/dart_frog.dart';
FutureOr<Response> onRequest(RequestContext context) {
if (context.request.method == HttpMethod.get) {
return _getConfigs(context);
}
return Response(statusCode: HttpStatus.methodNotAllowed);
}
FutureOr<Response> _getConfigs(RequestContext context) async {
final configRepository = context.read<ConfigRepository>();
final privateMatchTimeLimit =
await configRepository.getPrivateMatchTimeLimit();
return Response.json(
body: {
'privateMatchTimeLimit': privateMatchTimeLimit,
},
);
}
| io_flip/api/routes/game/configs/index.dart/0 | {
"file_path": "io_flip/api/routes/game/configs/index.dart",
"repo_id": "io_flip",
"token_count": 222
} | 831 |
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 deckId) {
if (context.request.method == HttpMethod.get) {
return _getDeckImage(context, deckId);
}
return Response(statusCode: HttpStatus.methodNotAllowed);
}
FutureOr<Response> _getDeckImage(RequestContext context, String deckId) async {
final cardsRepository = context.read<CardsRepository>();
final deck = await cardsRepository.getDeck(deckId);
if (deck == null) {
return Response(statusCode: HttpStatus.notFound);
}
if (deck.shareImage != null) {
return Response(
statusCode: HttpStatus.movedPermanently,
headers: {
HttpHeaders.locationHeader: deck.shareImage!,
},
);
}
final image = await context.read<CardRenderer>().renderDeck(deck.cards);
final firebaseCloudStorage = context.read<FirebaseCloudStorage>();
final url = await firebaseCloudStorage.uploadFile(
image,
'share/$deckId.png',
);
final newDeck = deck.copyWithShareImage(url);
// Intentionally not waiting for this update to complete so this
// doesn't block the response.
unawaited(cardsRepository.updateDeck(newDeck));
return Response.bytes(
body: image,
headers: {
HttpHeaders.contentTypeHeader: 'image/png',
},
);
}
| io_flip/api/routes/public/decks/[deckId].dart/0 | {
"file_path": "io_flip/api/routes/public/decks/[deckId].dart",
"repo_id": "io_flip",
"token_count": 525
} | 832 |
import 'dart:io';
import 'dart:typed_data';
import 'package:api/game_url.dart';
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';
import 'package:game_domain/game_domain.dart';
import 'package:logging/logging.dart';
import 'package:mocktail/mocktail.dart';
import 'package:test/test.dart';
import '../../../../routes/public/cards/[cardId].dart' as route;
class _MockRequestContext extends Mock implements RequestContext {}
class _MockRequest extends Mock implements Request {}
class _MockCardRepository extends Mock implements CardsRepository {}
class _MockCardRenderer extends Mock implements CardRenderer {}
class _MockFirebaseCloudStorage extends Mock implements FirebaseCloudStorage {}
class _MockLogger extends Mock implements Logger {}
void main() {
group('GET /public/cards/[cardId]', () {
late Request request;
late RequestContext context;
late CardsRepository cardsRepository;
late CardRenderer cardRenderer;
late FirebaseCloudStorage firebaseCloudStorage;
late Logger logger;
const gameUrl = GameUrl('https://example.com');
const card = Card(
id: 'cardId',
name: 'cardName',
description: 'cardDescription',
image: 'cardImageUrl',
suit: Suit.fire,
rarity: false,
power: 10,
);
setUpAll(() {
registerFallbackValue(Uint8List(0));
registerFallbackValue(card);
});
setUp(() {
request = _MockRequest();
when(() => request.method).thenReturn(HttpMethod.get);
when(() => request.uri).thenReturn(
Uri.parse('/public/cards/${card.id}'),
);
logger = _MockLogger();
cardsRepository = _MockCardRepository();
when(() => cardsRepository.getCard(card.id)).thenAnswer(
(_) async => card,
);
when(() => cardsRepository.updateCard(any())).thenAnswer(
(_) async {},
);
cardRenderer = _MockCardRenderer();
when(() => cardRenderer.renderCard(card)).thenAnswer(
(_) async => Uint8List(0),
);
context = _MockRequestContext();
when(() => context.request).thenReturn(request);
when(() => context.read<Logger>()).thenReturn(logger);
when(() => context.read<GameUrl>()).thenReturn(gameUrl);
when(() => context.read<CardsRepository>()).thenReturn(cardsRepository);
when(() => context.read<CardRenderer>()).thenReturn(cardRenderer);
firebaseCloudStorage = _MockFirebaseCloudStorage();
when(() => firebaseCloudStorage.uploadFile(any(), any()))
.thenAnswer((_) async => 'https://example.com/share.png');
when(() => context.read<FirebaseCloudStorage>())
.thenReturn(firebaseCloudStorage);
});
test('responds with a 200', () async {
final response = await route.onRequest(context, card.id);
expect(response.statusCode, equals(HttpStatus.ok));
});
test('updates the card with the share image', () async {
await route.onRequest(context, card.id);
verify(
() => cardsRepository.updateCard(
card.copyWithShareImage('https://example.com/share.png'),
),
).called(1);
});
test('redirects with the cached image if present', () async {
when(() => cardsRepository.getCard(card.id)).thenAnswer(
(_) async => card.copyWithShareImage('https://example.com/share.png'),
);
final response = await route.onRequest(context, card.id);
expect(
response.statusCode,
equals(HttpStatus.movedPermanently),
);
expect(
response.headers['location'],
equals('https://example.com/share.png'),
);
});
test('responds with a 404 if the card is not found', () async {
when(() => cardsRepository.getCard(card.id)).thenAnswer(
(_) async => null,
);
final response = await route.onRequest(context, card.id);
expect(response.statusCode, equals(HttpStatus.notFound));
});
test('only allows get methods', () async {
when(() => request.method).thenReturn(HttpMethod.post);
final response = await route.onRequest(context, card.id);
expect(response.statusCode, equals(HttpStatus.methodNotAllowed));
});
});
}
| io_flip/api/test/routes/public/cards/[cardId]_test.dart/0 | {
"file_path": "io_flip/api/test/routes/public/cards/[cardId]_test.dart",
"repo_id": "io_flip",
"token_count": 1647
} | 833 |
import 'dart:io';
import 'package:data_loader/src/prompt_mapper.dart';
import 'package:game_domain/game_domain.dart';
import 'package:path/path.dart' as path;
/// {@template data_loader}
/// Dart tool that feed data into the Database
/// {@endtemplate}
class ImageLoader {
/// {@macro data_loader}
const ImageLoader({
required File csv,
required File image,
required String dest,
required int variations,
}) : _csv = csv,
_image = image,
_dest = dest,
_variations = variations;
final File _csv;
final File _image;
final String _dest;
final int _variations;
/// Creates placeholder images for prompts stored in csv file.
/// [onProgress] is called everytime there is progress,
/// it takes in the current inserted and the total to insert.
Future<void> loadImages(void Function(int, int) onProgress) async {
final lines = await _csv.readAsLines();
final map = mapCsvToPrompts(lines);
final fileNames = <String>[];
var progress = 0;
for (final character in map[PromptTermType.character]!) {
for (final characterClass in map[PromptTermType.characterClass]!) {
for (final location in map[PromptTermType.location]!) {
for (var i = 0; i < _variations; i++) {
fileNames.add(
path
.join(
_dest,
'public',
'illustrations',
[
character,
characterClass,
location,
'$i.png',
].join('_').replaceAll(' ', '_'),
)
.toLowerCase(),
);
}
}
}
}
final totalFiles = fileNames.length;
while (fileNames.isNotEmpty) {
final batch = <String>[];
while (batch.length < 10 && fileNames.isNotEmpty) {
batch.add(fileNames.removeLast());
}
await Future.wait(
batch.map((filePath) async {
await File(filePath).create(recursive: true);
await _image.copy(filePath).then((_) {
onProgress(progress, totalFiles);
progress++;
});
}),
);
}
}
}
| io_flip/api/tools/data_loader/lib/src/image_loader.dart/0 | {
"file_path": "io_flip/api/tools/data_loader/lib/src/image_loader.dart",
"repo_id": "io_flip",
"token_count": 1035
} | 834 |
# Flop
![coverage][coverage_badge]
[![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link]
[![License: MIT][license_badge]][license_link]
Generated by the [Very Good CLI][very_good_cli_link] 🤖
Flop is a bot made to automatic play test the I/O Flip game. Which will be
used to do scaling testing of the game infrastructure.

[coverage_badge]: coverage_badge.svg
[flutter_localizations_link]: https://api.flutter.dev/flutter/flutter_localizations/flutter_localizations-library.html
[internationalization_link]: https://flutter.dev/docs/development/accessibility-and-localization/internationalization
[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg
[license_link]: https://opensource.org/licenses/MIT
[very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg
[very_good_analysis_link]: https://pub.dev/packages/very_good_analysis
[very_good_cli_link]: https://github.com/VeryGoodOpenSource/very_good_cli
| io_flip/flop/README.md/0 | {
"file_path": "io_flip/flop/README.md",
"repo_id": "io_flip",
"token_count": 343
} | 835 |
import 'package:flop/flop/bloc/flop_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class FlopView extends StatelessWidget {
const FlopView({super.key});
String _stepText(FlopStep step) {
switch (step) {
case FlopStep.initial:
return 'Initializing';
case FlopStep.authentication:
return 'Authenticating';
case FlopStep.deckDraft:
return 'Drafting deck';
case FlopStep.matchmaking:
return 'Finding match';
case FlopStep.joinedMatch:
return 'Joined match';
case FlopStep.playing:
return 'Playing';
}
}
String _flopStatusImage(FlopStatus status) {
switch (status) {
case FlopStatus.running:
return 'assets/flop_working.gif';
case FlopStatus.success:
return 'assets/flop_success.gif';
case FlopStatus.error:
return 'assets/flop_error.gif';
}
}
@override
Widget build(BuildContext context) {
return BlocConsumer<FlopBloc, FlopState>(
listenWhen: (previous, current) => previous.steps != current.steps,
listener: (context, state) {
context.read<FlopBloc>().add(const NextStepRequested());
},
builder: (context, state) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
_flopStatusImage(state.status),
width: 50,
height: 50,
),
Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
border: Border.all(),
),
width: 500,
height: 400,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
children: [
for (final step in FlopStep.values)
Row(
children: [
Text(
state.steps.contains(step) ? '✅' : '⏱',
),
const SizedBox(width: 16),
Text(_stepText(step)),
],
),
],
),
),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
for (final message in state.messages)
Text(message),
],
),
),
),
],
),
),
],
),
),
);
},
);
}
}
| io_flip/flop/lib/flop/view/flop_view.dart/0 | {
"file_path": "io_flip/flop/lib/flop/view/flop_view.dart",
"repo_id": "io_flip",
"token_count": 1951
} | 836 |
import * as admin from 'firebase-admin';
import * as functions from 'firebase-functions';
const firestore = admin.firestore();
const storage = admin.storage();
function chunk<T>(arr: T[], size: number): T[][] {
const acc = <T[][]>[];
for (let i = 0; i < arr.length; i += size) {
acc.push(arr.slice(i, i + size));
}
return acc;
}
async function chunkedQuery(
collection: admin.firestore.CollectionReference,
field: string, filter: admin.firestore.WhereFilterOp,
values: string[],
): Promise<admin.firestore.QueryDocumentSnapshot<admin.firestore.DocumentData>[]> {
const results = await Promise.all(
chunk(values, 10).map(
(chunk) => collection.where(field, filter, chunk).get()
)
);
return results.flatMap((result) => result.docs);
}
export const deleteUserData = functions.auth.user().onDelete(async (event) => {
functions.logger.log('Deleting user data');
const uid = event.uid;
const userDecks = await firestore.collection('decks').where('userId', '==', uid).get();
const cpuDecks = await firestore.collection('decks').where('userId', '==', `CPU_${uid}`).get();
const decks = userDecks.docs.concat(cpuDecks.docs);
const deckIds = decks.map((doc) => doc.id);
const cardIds: string[] = [...new Set(decks.flatMap((doc) => doc.data()['cards']))];
const cardDocs = cardIds.flatMap((id) => firestore.collection('cards').doc(id));
const hostMatches = await chunkedQuery(firestore.collection('matches'), 'host', 'in', deckIds);
const guestMatches = await chunkedQuery(firestore.collection('matches'), 'guest', 'in', deckIds);
const matchIds = hostMatches.map((doc) => doc.id).concat(guestMatches.map((doc) => doc.id));
const matchStates = await chunkedQuery(
firestore.collection('match_states'),
'matchId',
'in',
matchIds
);
const connectionDoc = firestore.collection('connection_states').doc(uid);
const leaderboardDoc = firestore.collection('leaderboard').doc(uid);
const scoreCardDoc = firestore.collection('score_cards').doc(uid);
const cpuScoreCardDoc = firestore.collection('score_cards').doc(`CPU_${uid}`);
const bucket = storage.bucket();
const fileNames = cardIds.concat(deckIds).map((id) => `share/${id}.png`);
await Promise.all(fileNames.map((f) => bucket.file(f).delete({ignoreNotFound: true})));
await Promise.all(cardDocs.map((doc) => doc.delete()));
await Promise.all(decks.map((doc) => doc.ref.delete()));
await Promise.all(hostMatches.map((doc) => doc.ref.delete()));
await Promise.all(guestMatches.map((doc) => doc.ref.delete()));
await Promise.all(matchStates.map((doc) => doc.ref.delete()));
await connectionDoc.delete();
await leaderboardDoc.delete();
await scoreCardDoc.delete();
await cpuScoreCardDoc.delete();
functions.logger.log('Done with delete');
return null;
});
| io_flip/functions/src/deleteUserData.ts/0 | {
"file_path": "io_flip/functions/src/deleteUserData.ts",
"repo_id": "io_flip",
"token_count": 948
} | 837 |
import 'dart:async';
import 'dart:developer';
import 'package:bloc/bloc.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_app_check/firebase_app_check.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:logging/logging.dart';
class AppBlocObserver extends BlocObserver {
const AppBlocObserver();
@override
void onChange(BlocBase<dynamic> bloc, Change<dynamic> change) {
super.onChange(bloc, change);
log('onChange(${bloc.runtimeType}, $change)');
}
@override
void onError(BlocBase<dynamic> bloc, Object error, StackTrace stackTrace) {
log('onError(${bloc.runtimeType}, $error, $stackTrace)');
super.onError(bloc, error, stackTrace);
}
}
typedef BootstrapBuilder = FutureOr<Widget> Function(
FirebaseFirestore firestore,
FirebaseAuth firebaseAuth,
FirebaseAppCheck appCheck,
);
Future<void> bootstrap(BootstrapBuilder builder) async {
WidgetsFlutterBinding.ensureInitialized();
FlutterError.onError = (details) {
log(details.exceptionAsString(), stackTrace: details.stack);
};
Bloc.observer = const AppBlocObserver();
await runZonedGuarded(
() async {
if (kReleaseMode) {
// Don't log anything below warnings in production.
Logger.root.level = Level.WARNING;
}
Logger.root.onRecord.listen((record) {
debugPrint('${record.level.name}: ${record.time}: '
'${record.loggerName}: '
'${record.message}');
});
runApp(
await builder(
FirebaseFirestore.instance,
FirebaseAuth.instance,
FirebaseAppCheck.instance,
),
);
},
(error, stackTrace) => log(error.toString(), stackTrace: stackTrace),
);
}
| io_flip/lib/bootstrap.dart/0 | {
"file_path": "io_flip/lib/bootstrap.dart",
"repo_id": "io_flip",
"token_count": 712
} | 838 |
export 'deck_pack.dart';
| io_flip/lib/draft/widgets/widgets.dart/0 | {
"file_path": "io_flip/lib/draft/widgets/widgets.dart",
"repo_id": "io_flip",
"token_count": 10
} | 839 |
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/widgets.dart';
import 'package:game_domain/game_domain.dart';
import 'package:io_flip/how_to_play/how_to_play.dart';
part 'how_to_play_event.dart';
part 'how_to_play_state.dart';
class HowToPlayBloc extends Bloc<HowToPlayEvent, HowToPlayState> {
HowToPlayBloc() : super(const HowToPlayState()) {
on<NextPageRequested>(_onNextPageRequested);
on<PreviousPageRequested>(_onPreviousPageRequested);
}
void _onNextPageRequested(
NextPageRequested event,
Emitter<HowToPlayState> emit,
) {
var wheelSuits = state.wheelSuits;
final suitsWheelPositionEnd =
HowToPlayState.steps.length + wheelSuits.length - 1;
if ((state.position >= HowToPlayState.steps.length) &&
(state.position < suitsWheelPositionEnd)) {
wheelSuits = nextSuitsPositions();
}
final position = state.position + 1;
emit(
state.copyWith(
position: position,
wheelSuits: wheelSuits,
),
);
}
void _onPreviousPageRequested(
PreviousPageRequested event,
Emitter<HowToPlayState> emit,
) {
var wheelSuits = state.wheelSuits;
if ((state.position > HowToPlayState.steps.length) &&
(state.position < HowToPlayState.steps.length + wheelSuits.length)) {
wheelSuits = previousSuitsPositions();
}
final position = state.position - 1;
emit(
state.copyWith(
position: position,
wheelSuits: wheelSuits,
),
);
}
List<Suit> nextSuitsPositions() {
final orderedSuits = [...state.wheelSuits];
orderedSuits.add(orderedSuits.removeAt(0));
return orderedSuits;
}
List<Suit> previousSuitsPositions() {
final orderedSuits = [...state.wheelSuits];
orderedSuits.insert(0, orderedSuits.removeLast());
return orderedSuits;
}
}
| io_flip/lib/how_to_play/bloc/how_to_play_bloc.dart/0 | {
"file_path": "io_flip/lib/how_to_play/bloc/how_to_play_bloc.dart",
"repo_id": "io_flip",
"token_count": 735
} | 840 |
{
"@@locale": "en",
"play": "PLAY NOW",
"@play": {
"description": "Label play"
},
"playAgain": "PLAY AGAIN",
"@playAgain": {
"description": "Label play again"
},
"ioFlip": "I/O FLIP",
"@ioFlip": {
"description": "I/O FLIP - Name of the game"
},
"generatingCards": "Generating {count} of {total}",
"@generatingCards": {
"description": "Label shown on the draft page.",
"placeholders": {
"count": {
"type": "int"
},
"total": {
"type": "int"
}
}
},
"gameResultError": "Error getting game result",
"@gameResultError": {
"description": "Displayed when error while getting game result"
},
"letsGetStarted": "LET'S GET STARTED",
"@letsGetStarted": {
"description": "label let's get started"
},
"select": "Next",
"@select": {
"description": "label select"
},
"niceToMeetYou": "Nice to meet you!",
"@niceToMeetYou": {
"description": "label nice to meet you"
},
"introTextPromptPage": "With just a few prompts, I can build you an AI-designed pack of cards featuring some of our favorite Google characters: Dash, Sparky, Android, and Dino, imbued with special powers.",
"@introTextPromptPage": {
"description": "Text for the intro when selecting the prompt to build the deck"
},
"characterClassPromptPageTitle": "First, what's your team's class?",
"@characterClassPromptPageTitle": {
"description": "Title of the prompt page for character class"
},
"powerPromptPageTitle": "What special powers do they have?",
"@powerPromptPageTitle": {
"description": "Title of the prompt page for power"
},
"leaderboardLongestStreak": "HIGHEST WIN STREAK",
"@leaderboardLongestStreak": {
"description": "Label shown on the leaderboard for the longest streak category tab"
},
"leaderboardMostWins": "HIGHEST TOTAL WINS",
"@leaderboardMostWins": {
"description": "Label shown on the leaderboard for the most wins category tab"
},
"leaderboardPlayerWins": "{total} wins",
"@leaderboardPlayerWins": {
"description": "Label shown on the leaderboard to show the total wins of a player",
"placeholders": {
"total": {
"type": "int"
}
}
},
"leaderboardFailedToLoad": "Failed to load leaderboard",
"@leaderboardFailedToLoad": {
"description": "Label shown on the leaderboard when it fails to load"
},
"cardGenerationError": "Error generating cards, please try again in a few moments",
"@cardGenerationError": {
"description": "Label show when there is an error generating a deck"
},
"nextCard": "Next card",
"@nextCard": {
"description": "Label show on the draft page to show the next card"
},
"gameWonTitle": "You won!",
"@gameWonTitle": {
"description": "Game summary title when player won"
},
"gameLostTitle": "You lost!",
"@gameLostTitle": {
"description": "Game summary title when player lost"
},
"gameTiedTitle": "It's a draw!",
"@gameTiedTitle": {
"description": "Game summary title when game tied"
},
"gameSummaryStreak": "{total} win streak!",
"@gameSummaryStreak": {
"description": "Label shown on the summary to show the current win streak of a player",
"placeholders": {
"total": {
"type": "int"
}
}
},
"cardInspectorText": "Tap cards to inspect and share",
"@cardInspectorText": {
"description": "Text shown on game summary to allow the user that can inspect cards"
},
"nextMatch": "NEXT MATCH",
"@nextMatch": {
"description": "Label show on the summary page to start the next match"
},
"quit": "QUIT",
"@quit": {
"description": "Label showing to quit game"
},
"cancel": "CANCEL",
"@cancel": {
"description": "Label showing to cancel an action"
},
"continueLabel": "CONTINUE",
"@continueLabel": {
"description": "Label showing to continue an action"
},
"enter": "ENTER",
"@enter": {
"description": "Label showing to enter"
},
"submitScore": "SUBMIT SCORE",
"@submitScore": {
"description": "Label showing to submit score"
},
"useCard": "Use card",
"@useCard": {
"description": "Label show on the draft page to use the card"
},
"enterYourInitials": "Enter your initials for the leaderboard",
"@enterYourInitials": {
"description": "Subtitle on the leaderboard entry page to prompt users to enter their initials"
},
"continueButton": "Continue",
"@continueButton": {
"description": "Continue button label"
},
"enterInitialsError": "Please enter three initials",
"@enterInitialsError": {
"description": "Leaderboard initials textfield validation error text"
},
"blacklistedInitialsError": "Keep it PG, use different initials",
"@blacklistedInitialsError": {
"description": "Leaderboard initials textfield validation error text when the initials are blacklisted"
},
"sharePageTitle": "Share your hand!",
"@sharePageTitle": {
"description": "Title shown on the share page"
},
"sharePageShareButton": "Share",
"@sharePageShareButton": {
"description": "Button text for the share button on the share page",
"type": "text",
"placeholders": {}
},
"sharePageMainMenuButton": "Main Menu",
"@sharePageMainMenuButton": {
"description": "Button text for the main menu button on the share page",
"type": "text",
"placeholders": {}
},
"settingsPageTitle": "Settings",
"@settingsPageTitle": {
"description": "Title shown on the settings page",
"type": "text",
"placeholders": {}
},
"mutedItem": "Muted",
"@mutedItem": {
"description": "Title of the muted item in settings",
"type": "text",
"placeholders": {}
},
"settingsSoundEffectsItem": "Sound Effects",
"@settingsSoundEffectsItem": {
"description": "Title of the sound effects item in settings",
"type": "text",
"placeholders": {}
},
"settingsMusicItem": "Music",
"@settingsMusicItem": {
"description": "Title of the music item in settings",
"type": "text",
"placeholders": {}
},
"settingsCreditsItem": "Credits, Legal, Links...",
"@settingsCreditsItem": {
"description": "Title of the credits item in settings",
"type": "text",
"placeholders": {}
},
"joinMatch": "Join a match",
"@joinMatch": {
"description": "Label join a match"
},
"deckBuildingTitle": "Pick your team",
"@deckBuildingTitle": {
"description": "Title of the deck building page"
},
"deckBuildingSubtitle": "Swipe to see the rest of your pack",
"@deckBuildingSubtitle": {
"description": "Subtitle of the deck building page"
},
"findingMatch": "Finding match...",
"@findingMatch": {
"description": "Title displayed while waiting to find match"
},
"searchingForOpponents": "Searching for opponents",
"@searchingForOpponents": {
"description": "Subtitle displayed while waiting to find match"
},
"copyInviteCode": "Copy invite code",
"@copyInviteCode": {
"description": "Label on button to copy match invite code"
},
"matchmaking": "MATCHMAKING...",
"@matchmaking": {
"description": "Label of the match making page button"
},
"getReadyToFlip": "Get ready to FLIP!",
"@getReadyToFlip": {
"description": "Title displayed when match is found, before entering the game"
},
"aiGameByGoogle": "An AI-designed card game powered by Google",
"@aiGameByGoogle": {
"description": "Subtitle displayed when match is found, before entering the game"
},
"quitGameDialogTitle": "Are you sure?",
"@quitGameDialogTitle": {
"description": "Title of the quit game dialog"
},
"quitGameDialogDescription": "You will lose your current team and end your winning streak.",
"@quitGameDialogDescription": {
"description": "Description of the quit game dialog"
},
"playerAlreadyConnectedError": "I/O FLIP is already open on another tab",
"@playerAlreadyConnectedError": {
"description": "Error message shown when user connects in multiple tabs"
},
"playerAlreadyConnectedErrorBody": "You can only play on one tab at a time.",
"@playerAlreadyConnectedErrorBody": {
"description": "Error message shown when user connects in multiple tabs"
},
"unknownConnectionError": "Unable to connect",
"@unknownConnectionError": {
"description": "Error message shown when an unknown error occurs while connecting"
},
"unknownConnectionErrorBody": "Please try again in a few moments.",
"@unknownConnectionErrorBody": {
"description": "Error message shown when an unknown error occurs while connecting"
},
"unknownConnectionErrorButton": "RETRY",
"@unknownConnectionErrorButton": {
"description": "Button shown when an unknown error occurs while connecting"
},
"devButtonLabel": "DEVELOPER PROFILE",
"@devButtonLabel": {
"description": "Label for the developer profile button"
},
"twitterButtonLabel": "TWITTER",
"@twitterButtonLabel": {
"description": "Label for the share to twitter button"
},
"facebookButtonLabel": "FACEBOOK",
"@facebookButtonLabel": {
"description": "Label for the share to facebook button"
},
"howToPlayIntroTitle": "Grab a pack and create your team from millions of AI-designed cards.",
"@howToPlayIntroTitle": {
"description": "Text shown in the first page of the how to play flow"
},
"howToPlayDeckTitle": "FLIP your way to the top of the leaderboard with the longest winning streak.",
"@howToPlayDeckTitle": {
"description": "Text shown in the deck page of the how to play flow"
},
"howToPlayElementsTitle": "FLIP your way to victory! Elemental powers apply extra damage in a match.",
"@howToPlayElementsTitle": {
"description": "Text shown in the elements page of the how to play flow"
},
"howToPlayElementsFireTitle": "<yellow>Fire</yellow> scorches <lightblue>air</lightblue> and\nmelts <green>metal</green>.",
"@howToPlayElementsFireTitle": {
"description": "Text shown in the fire element page of the how to play flow"
},
"howToPlayElementsAirTitle": "<lightblue>Air</lightblue> blasts <blue>water</blue> and\nblows away <red>earth</red>.",
"@howToPlayElementsAirTitle": {
"description": "Text shown in the air element page of the how to play flow"
},
"howToPlayElementsMetalTitle": "<green>Metal</green> traps <lightblue>air</lightblue> and\ndiverts <blue>water</blue>.",
"@howToPlayElementsMetalTitle": {
"description": "Text shown in the metal element page of the how to play flow"
},
"howToPlayElementsEarthTitle": "<red>Earth</red> crushes <green>metal</green> and\nsnuffs out <yellow>fire</yellow>.",
"@howToPlayElementsEarthTitle": {
"description": "Text shown in the earth element page of the how to play flow"
},
"howToPlayElementsWaterTitle": "<blue>Water</blue> puts out <yellow>fire</yellow> and\nerodes <red>earth</red>.",
"@howToPlayElementsWaterTitle": {
"description": "Text shown in the water element page of the how to play flow"
},
"shareTeamTitle": "Share your team!",
"@shareTeamTitle": {
"description": "Title shown in the share hand page"
},
"winStreakLabel": "win streak!",
"@winStreakLabel": {
"description": "Label for how many wins the user has"
},
"shareButtonLabel": "SHARE",
"@shareButtonLabel": {
"description": "Text shown on the share button"
},
"mainMenuButtonLabel": "MAIN MENU",
"@mainMenuButtonLabel": {
"description": "Text shown on the main menu button"
},
"infoDialogTitle": "About I/O FLIP",
"@infoAboutGameTitle": {
"description": "Title shown in the info dialog"
},
"infoDialogDescriptionPrefix": "Learn",
"@infoDialogDescription": {
"description": "Description prefix text shown in the info dialog"
},
"infoDialogDescriptionInfixOne": "how I/O FLIP was made",
"@infoDialogDescriptionInfixOne": {
"description": "First description infix text shown in the info dialog"
},
"infoDialogDescriptionInfixTwo": "and\ngrab the",
"@infoDialogDescriptionInfixTwo": {
"description": "Second description infix text shown in the info dialog"
},
"infoDialogDescriptionSuffix": "open source code.",
"@infoDialogDescriptionSuffix": {
"description": "Description suffix text shown in the info dialog"
},
"infoDialogOtherLinks": "Other Links",
"@infoDialogOtherLinks": {
"description": "Other links text shown in the info dialog"
},
"ioLinkLabel": "Google I/O",
"@ioLinkLabel": {
"description": "Text shown on the Google I/O link"
},
"privacyPolicyLinkLabel": "Privacy Policy",
"@privacyPolicyLinkLabel": {
"description": "Text shown on the Privacy Policy link"
},
"termsOfServiceLinkLabel": "Terms of Service",
"@termsOfServiceLinkLabel": {
"description": "Text shown on the Terms of Service link"
},
"faqLinkLabel": "FAQ",
"@faqLinkLabel": {
"description": "Text shown on the FAQ link"
},
"howItsMadeLinkLabel": "How it's made",
"@howItsMadeLinkLabel": {
"description": "Text shown on the How it's made link"
},
"shareCardDisclaimer": "If you choose to share, your card will be made available at a unique URL for 30 days and then automatically deleted.",
"@shareCardDisclaimer": {
"description": "Disclaimer shown on the share card dialog"
},
"shareCardDialogDescription": "Share your AI-designed creation then head into a match.",
"@shareCardDialogDescription": {
"description": "Text shown on the share card dialog"
},
"shareTeamDisclaimer": "If you choose to share, your initials, cards and score will be made available at a unique URL for 30 days and then automatically deleted.",
"@shareTeamDisclaimer": {
"description": "Disclaimer shown on the share team dialog"
},
"shareTeamDialogDescription": "Share your team from I/O FLIP and challenge your friends to beat your streak!",
"@shareTeamDialogDescription": {
"description": "Text shown on the share team dialog"
},
"termsOfUseTitle": "I/O FLIP Terms of Use",
"@termsOfUseTitle": {
"description": "Title shown on the terms of use page"
},
"termsOfUseDescriptionPrefix": "By continuing, I accept the",
"@termsOfUseDescriptionPrefix": {
"description": "Description prefix text shown on the terms of use page"
},
"termsOfUseDescriptionInfixOne": "Terms of Service",
"@termsOfUseDescriptionInfixOne": {
"description": "First description infix text shown on the terms of use page"
},
"termsOfUseDescriptionInfixTwo": "and acknowledge that information Google collects about me in connection with I/O FLIP will be processed in accordance with the Google",
"@termsOfUseDescriptionInfixTwo": {
"description": "Second description infix text shown on the terms of use page"
},
"termsOfUseDescriptionSuffix": "Privacy Policy.",
"@termsOfUseDescriptionSuffix": {
"description": "Description suffix text shown on the terms of use page"
},
"termsOfUseAcceptLabel": "ACCEPT",
"@termsOfUseAcceptLabel": {
"description": "Text shown on the accept button on the terms of use page"
},
"termsOfUseDeclineLabel": "DECLINE",
"@termsOfUseDeclineLabel": {
"description": "Text shown on the decline button on the terms of use page"
},
"saveButtonLabel": "SAVE",
"@saveButtonLabel": {
"description": "Label shown on the save button on share dialog"
},
"downloadingButtonLabel": "DOWNLOADING",
"@downloadingButtonLabel": {
"description": "Label shown on the downloading button on share dialog"
},
"downloadCompleteButtonLabel": "DOWNLOADED",
"@downloadCompleteButtonLabel": {
"description": "Label shown on the download button on complete"
},
"downloadCompleteLabel": "Download complete",
"@downloadCompleteLabel": {
"description": "Text shown on the download notification on success"
},
"downloadFailedLabel": "Something went wrong, try again",
"@downloadFailedLabel": {
"description": "Text shown on the download notification on failure"
},
"blacklistedErrorMessage": "Let’s keep it PG, use different initials",
"@blacklistedErrorMessage": {
"description": "Text shown on the initials form on blacklisted state"
},
"termsOfUseContinueLabel": "CONTINUE",
"@termsOfUseContinueLabel": {
"description": "Text shown on the continue button on the terms of use page"
}
} | io_flip/lib/l10n/arb/app_en.arb/0 | {
"file_path": "io_flip/lib/l10n/arb/app_en.arb",
"repo_id": "io_flip",
"token_count": 5021
} | 841 |
export 'leaderboard_players.dart';
| io_flip/lib/leaderboard/widgets/widgets.dart/0 | {
"file_path": "io_flip/lib/leaderboard/widgets/widgets.dart",
"repo_id": "io_flip",
"token_count": 11
} | 842 |
export 'bloc/prompt_form_bloc.dart';
export 'view/view.dart';
export 'widgets/widgets.dart';
| io_flip/lib/prompt/prompt.dart/0 | {
"file_path": "io_flip/lib/prompt/prompt.dart",
"repo_id": "io_flip",
"token_count": 39
} | 843 |
export 'scripts_page.dart';
export 'scripts_view.dart';
| io_flip/lib/scripts/views/views.dart/0 | {
"file_path": "io_flip/lib/scripts/views/views.dart",
"repo_id": "io_flip",
"token_count": 20
} | 844 |
import 'dart:math' as math;
import 'package:flutter/material.dart' hide Card;
import 'package:game_domain/game_domain.dart';
import 'package:io_flip_ui/io_flip_ui.dart';
class CardFan extends StatelessWidget {
const CardFan({
required this.cards,
super.key,
});
final List<Card> cards;
@override
Widget build(BuildContext context) {
const container = 360.0;
const size = GameCardSize.sm();
final offset = size.width / 1.4;
final center = (container - size.width) / 2;
final gameCards = cards
.map(
(card) => GameCard(
size: size,
description: card.description,
image: card.image,
name: card.name,
suitName: card.suit.name,
power: card.power,
isRare: card.rarity,
),
)
.toList();
return SizedBox(
height: 215,
width: container,
child: Stack(
children: [
Positioned(
top: 12,
left: center - offset,
child: Transform.rotate(
angle: -math.pi / 16.0,
child: gameCards[0],
),
),
Positioned(
top: 0,
left: center,
child: gameCards[1],
),
Positioned(
top: 12,
left: center + offset,
child: Transform.rotate(
angle: math.pi / 16.0,
child: gameCards[2],
),
),
],
),
);
}
}
| io_flip/lib/share/widgets/card_fan.dart/0 | {
"file_path": "io_flip/lib/share/widgets/card_fan.dart",
"repo_id": "io_flip",
"token_count": 807
} | 845 |
include: package:very_good_analysis/analysis_options.4.0.0.yaml
| io_flip/packages/api_client/analysis_options.yaml/0 | {
"file_path": "io_flip/packages/api_client/analysis_options.yaml",
"repo_id": "io_flip",
"token_count": 23
} | 846 |
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('PromptResource', () {
late ApiClient apiClient;
late http.Response response;
late PromptResource resource;
setUp(() {
apiClient = _MockApiClient();
response = _MockResponse();
resource = PromptResource(apiClient: apiClient);
});
group('getPromptTerms', () {
setUp(() {
when(
() => apiClient.get(
any(),
queryParameters: any(named: 'queryParameters'),
),
).thenAnswer((_) async => response);
});
test('gets correct list', () async {
const powersList = ['Scientist'];
when(() => response.statusCode).thenReturn(HttpStatus.ok);
when(() => response.body).thenReturn(jsonEncode({'list': powersList}));
final result = await resource.getPromptTerms(PromptTermType.power);
expect(result, equals(powersList));
});
test('gets empty list if endpoint not found', () async {
const emptyList = <String>[];
when(() => response.statusCode).thenReturn(HttpStatus.notFound);
final result = await resource.getPromptTerms(PromptTermType.power);
expect(result, equals(emptyList));
});
test('throws ApiClientError when request fails', () async {
when(() => response.statusCode)
.thenReturn(HttpStatus.internalServerError);
when(() => response.body).thenReturn('Oops');
await expectLater(
resource.getPromptTerms(PromptTermType.power),
throwsA(
isA<ApiClientError>().having(
(e) => e.cause,
'cause',
equals(
'GET /prompt/terms returned status 500 with the following response: "Oops"',
),
),
),
);
});
test('throws ApiClientError when request response is invalid', () async {
when(() => response.statusCode).thenReturn(HttpStatus.ok);
when(() => response.body).thenReturn('Oops');
await expectLater(
resource.getPromptTerms(PromptTermType.power),
throwsA(
isA<ApiClientError>().having(
(e) => e.cause,
'cause',
equals(
'GET /prompt/terms returned invalid response "Oops"',
),
),
),
);
});
});
});
}
| io_flip/packages/api_client/test/src/resources/prompt_resource_test.dart/0 | {
"file_path": "io_flip/packages/api_client/test/src/resources/prompt_resource_test.dart",
"repo_id": "io_flip",
"token_count": 1200
} | 847 |
include: package:very_good_analysis/analysis_options.4.0.0.yaml
| io_flip/packages/config_repository/analysis_options.yaml/0 | {
"file_path": "io_flip/packages/config_repository/analysis_options.yaml",
"repo_id": "io_flip",
"token_count": 23
} | 848 |
include: package:very_good_analysis/analysis_options.4.0.0.yaml
| io_flip/packages/io_flip_ui/analysis_options.yaml/0 | {
"file_path": "io_flip/packages/io_flip_ui/analysis_options.yaml",
"repo_id": "io_flip",
"token_count": 23
} | 849 |
<svg width="67" height="67" viewBox="0 0 67 67" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M40.5774 18.1975L60.6711 60.1712H53.6272H11.8153H6.34863L31.7742 6.32056L38.0294 21.7902L40.5774 18.1975Z" fill="#FF5145" stroke="#202124" stroke-width="1.5" stroke-linejoin="round"/>
</svg>
| io_flip/packages/io_flip_ui/assets/images/suits/onboarding/earth.svg/0 | {
"file_path": "io_flip/packages/io_flip_ui/assets/images/suits/onboarding/earth.svg",
"repo_id": "io_flip",
"token_count": 138
} | 850 |
import 'package:flutter/material.dart';
import 'package:gallery/story_scaffold.dart';
import 'package:io_flip_ui/io_flip_ui.dart';
class AnimatedCardStory extends StatelessWidget {
const AnimatedCardStory({super.key, required this.controller});
final AnimatedCardController controller;
@override
Widget build(BuildContext context) {
return StoryScaffold(
backgroundColor: Colors.black,
title: 'Animated Card',
body: Center(
child: AnimatedCard(
controller: controller,
front: const GameCard(
image:
'https://firebasestorage.googleapis.com/v0/b/top-dash-dev.appspot.com/o/public%2FDash_pirate_trumpets_field.png?alt=media',
name: 'Dash the Great',
description: 'The best Dash in all the Dashland',
suitName: 'earth',
power: 57,
size: GameCardSize.md(),
isRare: false,
),
back: const FlippedGameCard(),
),
),
);
}
}
| io_flip/packages/io_flip_ui/gallery/lib/widgets/animated_card_story.dart/0 | {
"file_path": "io_flip/packages/io_flip_ui/gallery/lib/widgets/animated_card_story.dart",
"repo_id": "io_flip",
"token_count": 442
} | 851 |
import 'package:flame/widgets.dart';
import 'package:flutter/material.dart';
import 'package:io_flip_ui/io_flip_ui.dart';
/// {@template elemental_damage}
/// A widget that renders several [SpriteAnimation]s for the damages
/// of a card on another.
/// {@endtemplate}
abstract class ElementalDamage {
/// {@macro elemental_damage}
ElementalDamage({
required String chargeBackPath,
required String chargeFrontPath,
required String damageReceivePath,
required String damageSendPath,
required String victoryChargeBackPath,
required String victoryChargeFrontPath,
required String badgePath,
required Color animationColor,
required this.size,
}) : _chargeBackPath = chargeBackPath,
_chargeFrontPath = chargeFrontPath,
_damageReceivePath = damageReceivePath,
_damageSendPath = damageSendPath,
_victoryChargeFrontPath = victoryChargeBackPath,
_victoryChargeBackPath = victoryChargeFrontPath,
_badgePath = badgePath,
_animationColor = animationColor;
/// Size of the card.
final GameCardSize size;
/// String containing the [ChargeBack] animation path.
final String _chargeBackPath;
/// String containing the [ChargeFront] animation path.
final String _chargeFrontPath;
/// String containing the [DamageReceive] animation path.
final String _damageReceivePath;
/// String containing the [DamageSend] animation path.
final String _damageSendPath;
/// String containing the [VictoryChargeBack] animation path.
final String _victoryChargeBackPath;
/// String containing the [VictoryChargeFront] animation path.
final String _victoryChargeFrontPath;
/// String containing the badg animation path, used in mobile only.
final String _badgePath;
/// Base color of the animation, used in mobile only.
final Color _animationColor;
/// Widget builder returning the [ChargeBack] animation.
ChargeBack chargeBackBuilder(
VoidCallback? onComplete,
AssetSize assetSize,
) {
return ChargeBack(
_chargeBackPath,
size: size,
assetSize: assetSize,
animationColor: _animationColor,
onComplete: onComplete,
);
}
/// Widget builder returning the [ChargeFront] animation.
ChargeFront chargeFrontBuilder(
VoidCallback? onComplete,
AssetSize assetSize,
) {
return ChargeFront(
_chargeFrontPath,
size: size,
assetSize: assetSize,
animationColor: _animationColor,
onComplete: onComplete,
);
}
/// Widget builder returning the [DamageReceive] animation.
DamageReceive damageReceiveBuilder(
VoidCallback? onComplete,
AssetSize assetSize,
) {
return DamageReceive(
_damageReceivePath,
size: size,
assetSize: assetSize,
onComplete: onComplete,
animationColor: _animationColor,
);
}
/// Widget builder returning the [DamageSend] animation.
DamageSend damageSendBuilder(
VoidCallback? onComplete,
AssetSize assetSize,
) {
return DamageSend(
_damageSendPath,
size: size,
assetSize: assetSize,
badgePath: _badgePath,
onComplete: onComplete,
);
}
/// Widget builder returning the [VictoryChargeBack] animation.
VictoryChargeBack victoryChargeBackBuilder(
VoidCallback? onComplete,
AssetSize assetSize,
) {
return VictoryChargeBack(
_victoryChargeBackPath,
size: size,
assetSize: assetSize,
animationColor: _animationColor,
onComplete: onComplete,
);
}
/// Widget builder returning the [VictoryChargeFront] animation.
VictoryChargeFront victoryChargeFrontBuilder(
VoidCallback? onComplete,
AssetSize assetSize,
) {
return VictoryChargeFront(
_victoryChargeFrontPath,
size: size,
assetSize: assetSize,
animationColor: _animationColor,
onComplete: onComplete,
);
}
}
| io_flip/packages/io_flip_ui/lib/src/animations/damages/elemental_damage.dart/0 | {
"file_path": "io_flip/packages/io_flip_ui/lib/src/animations/damages/elemental_damage.dart",
"repo_id": "io_flip",
"token_count": 1288
} | 852 |
export 'io_flip_card_sizes.dart';
export 'io_flip_colors.dart';
export 'io_flip_spacing.dart';
export 'io_flip_text_styles.dart';
export 'io_flip_theme.dart';
| io_flip/packages/io_flip_ui/lib/src/theme/theme.dart/0 | {
"file_path": "io_flip/packages/io_flip_ui/lib/src/theme/theme.dart",
"repo_id": "io_flip",
"token_count": 72
} | 853 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.