Unverified Commit 240825a5 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Enable private field promotion for flutter_tools (#134474)

New feature in upcoming Dart 3.2. See https://github.com/dart-lang/language/issues/2020. Feature is enabled by bumping the min SDK version to 3.2.

Part of https://github.com/flutter/flutter/issues/134476.
parent 05733402
......@@ -105,8 +105,8 @@ class AndroidDevices extends PollingDeviceDiscovery {
bool _doesNotHaveAdb() {
return _androidSdk == null ||
_androidSdk?.adbPath == null ||
!_processManager.canRun(_androidSdk!.adbPath);
_androidSdk.adbPath == null ||
!_processManager.canRun(_androidSdk.adbPath);
}
// 015d172c98400a03 device usb:340787200X product:nakasi model:Nexus_7 device:grouper
......
......@@ -141,7 +141,7 @@ class AndroidEmulator extends Emulator {
@override
PlatformType get platformType => PlatformType.android;
String? _prop(String name) => _properties != null ? _properties![name] : null;
String? _prop(String name) => _properties != null ? _properties[name] : null;
@override
Future<void> launch({@visibleForTesting Duration? startupDuration, bool coldBoot = false}) async {
......
......@@ -53,12 +53,12 @@ class AndroidWorkflow implements Workflow {
@override
bool get canListDevices => appliesToHostPlatform && _androidSdk != null
&& _androidSdk?.adbPath != null;
&& _androidSdk.adbPath != null;
@override
bool get canLaunchDevices => appliesToHostPlatform && _androidSdk != null
&& _androidSdk?.adbPath != null
&& (_androidSdk?.validateSdkWellFormed().isEmpty ?? false);
&& _androidSdk.adbPath != null
&& _androidSdk.validateSdkWellFormed().isEmpty;
@override
bool get canListEmulators => canListDevices && _androidSdk?.emulatorPath != null;
......@@ -105,13 +105,13 @@ class AndroidValidator extends DoctorValidator {
return false;
}
messages.add(ValidationMessage(_userMessages.androidJdkLocation(_java!.binaryPath)));
if (!_java!.canRun()) {
messages.add(ValidationMessage.error(_userMessages.androidCantRunJavaBinary(_java!.binaryPath)));
if (!_java.canRun()) {
messages.add(ValidationMessage.error(_userMessages.androidCantRunJavaBinary(_java.binaryPath)));
return false;
}
Version? javaVersion;
try {
javaVersion = _java!.version;
javaVersion = _java.version;
} on Exception catch (error) {
_logger.printTrace(error.toString());
}
......@@ -253,13 +253,13 @@ class AndroidLicenseValidator extends DoctorValidator {
final List<ValidationMessage> messages = <ValidationMessage>[];
// Match pre-existing early termination behavior
if (_androidSdk == null || _androidSdk?.latestVersion == null ||
_androidSdk!.validateSdkWellFormed().isNotEmpty ||
if (_androidSdk == null || _androidSdk.latestVersion == null ||
_androidSdk.validateSdkWellFormed().isNotEmpty ||
! await _checkJavaVersionNoOutput()) {
return ValidationResult(ValidationType.missing, messages);
}
final String sdkVersionText = _userMessages.androidStatusInfo(_androidSdk!.latestVersion!.buildToolsVersionName);
final String sdkVersionText = _userMessages.androidStatusInfo(_androidSdk.latestVersion!.buildToolsVersionName);
// Check for licenses.
switch (await licensesAccepted) {
......@@ -371,7 +371,7 @@ class AndroidLicenseValidator extends DoctorValidator {
try {
final Process process = await _processManager.start(
<String>[_androidSdk!.sdkManagerPath!, '--licenses'],
<String>[_androidSdk.sdkManagerPath!, '--licenses'],
environment: _java?.environment,
);
......@@ -404,7 +404,7 @@ class AndroidLicenseValidator extends DoctorValidator {
final int exitCode = await process.exitCode;
if (exitCode != 0) {
throwToolExit(_userMessages.androidCannotRunSdkManager(
_androidSdk?.sdkManagerPath ?? '',
_androidSdk.sdkManagerPath ?? '',
'exited code $exitCode',
_platform,
));
......@@ -412,7 +412,7 @@ class AndroidLicenseValidator extends DoctorValidator {
return true;
} on ProcessException catch (e) {
throwToolExit(_userMessages.androidCannotRunSdkManager(
_androidSdk?.sdkManagerPath ?? '',
_androidSdk.sdkManagerPath ?? '',
e.toString(),
_platform,
));
......
......@@ -91,10 +91,10 @@ class AndroidStudioJavaGradleConflictMigration extends ProjectMigrator {
return;
}
if (_androidStudio == null || _androidStudio!.version == null) {
if (_androidStudio == null || _androidStudio.version == null) {
logger.printTrace(androidStudioNotFound);
return;
} else if (_androidStudio!.version!.major < androidStudioFlamingo.major) {
} else if (_androidStudio.version!.major < androidStudioFlamingo.major) {
logger.printTrace(androidStudioVersionBelowFlamingo);
return;
}
......
......@@ -116,7 +116,7 @@ class AppContext {
T? get<T>() {
dynamic value = _generateIfNecessary(T, _overrides);
if (value == null && _parent != null) {
value = _parent!.get<T>();
value = _parent.get<T>();
}
return _unboxNull(value ?? _generateIfNecessary(T, _fallbacks)) as T?;
}
......
......@@ -558,7 +558,7 @@ class Cache {
/// Return the top-level directory in the cache; this is `bin/cache`.
Directory getRoot() {
if (_rootOverride != null) {
return _fileSystem.directory(_fileSystem.path.join(_rootOverride!.path, 'bin', 'cache'));
return _fileSystem.directory(_fileSystem.path.join(_rootOverride.path, 'bin', 'cache'));
} else {
return _fileSystem.directory(_fileSystem.path.join(flutterRoot!, 'bin', 'cache'));
}
......
......@@ -277,7 +277,7 @@ known, it can be explicitly provided to attach via the command-line, e.g.
logger: _logger,
),
notifyingLogger: (_logger is NotifyingLogger)
? _logger as NotifyingLogger
? _logger
: NotifyingLogger(verbose: _logger.isVerbose, parent: _logger),
logToStdout: true,
)
......
......@@ -1753,7 +1753,7 @@ Directory createTemporaryFlutterSdk(
// Fill in SDK dependency constraint.
output.write('''
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
''');
output.writeln('dependencies:');
......@@ -1785,7 +1785,7 @@ description: Dart SDK extensions for dart:ui
homepage: http://flutter.io
# sky_engine requires sdk_ext support in the analyzer which was added in 1.11.x
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
''');
return directory;
......
......@@ -393,7 +393,7 @@ class DeviceDiscoverySupportFilter {
if (_flutterProject == null) {
return true;
}
return device.isSupportedForProject(_flutterProject!);
return device.isSupportedForProject(_flutterProject);
}
}
......
......@@ -141,7 +141,7 @@ class BuildableIOSApp extends IOSApp {
// not a top-level output directory.
// Specifying `build/ios/archive/Runner` will result in `build/ios/archive/Runner.xcarchive`.
String get archiveBundlePath => globals.fs.path.join(getIosBuildDirectory(), 'archive',
_hostAppBundleName == null ? 'Runner' : globals.fs.path.withoutExtension(_hostAppBundleName!));
_hostAppBundleName == null ? 'Runner' : globals.fs.path.withoutExtension(_hostAppBundleName));
// The output xcarchive bundle path `build/ios/archive/Runner.xcarchive`.
String get archiveBundleOutputPath =>
......@@ -150,7 +150,7 @@ class BuildableIOSApp extends IOSApp {
String get builtInfoPlistPathAfterArchive => globals.fs.path.join(archiveBundleOutputPath,
'Products',
'Applications',
_hostAppBundleName == null ? 'Runner.app' : _hostAppBundleName!,
_hostAppBundleName ?? 'Runner.app',
'Info.plist');
String get projectAppIconDirName => _projectImageAssetDirName(_appIconAsset);
......
......@@ -79,19 +79,19 @@ class FlutterResidentDevtoolsHandler implements ResidentDevtoolsHandler {
return;
}
if (devToolsServerAddress != null) {
_devToolsLauncher!.devToolsUrl = devToolsServerAddress;
_devToolsLauncher.devToolsUrl = devToolsServerAddress;
} else {
await _devToolsLauncher!.serve();
await _devToolsLauncher.serve();
_served = true;
}
await _devToolsLauncher!.ready;
await _devToolsLauncher.ready;
// Do not attempt to print debugger list if the connection has failed or if we're shutting down.
if (_devToolsLauncher!.activeDevToolsServer == null || _shutdown) {
if (_devToolsLauncher.activeDevToolsServer == null || _shutdown) {
assert(!_readyToAnnounce);
return;
}
final Uri? devToolsUrl = _devToolsLauncher!.devToolsUrl;
final Uri? devToolsUrl = _devToolsLauncher.devToolsUrl;
if (devToolsUrl != null) {
for (final FlutterDevice? device in flutterDevices) {
if (device == null) {
......@@ -130,7 +130,7 @@ class FlutterResidentDevtoolsHandler implements ResidentDevtoolsHandler {
}
_readyToAnnounce = true;
assert(_devToolsLauncher!.activeDevToolsServer != null);
assert(_devToolsLauncher.activeDevToolsServer != null);
if (_residentRunner.reportedDebuggers) {
// Since the DevTools only just became available, we haven't had a chance to
// report their URLs yet. Do so now.
......@@ -148,9 +148,9 @@ class FlutterResidentDevtoolsHandler implements ResidentDevtoolsHandler {
if (!_residentRunner.supportsServiceProtocol || _devToolsLauncher == null) {
return false;
}
if (_devToolsLauncher!.devToolsUrl == null) {
if (_devToolsLauncher.devToolsUrl == null) {
_logger.startProgress('Waiting for Flutter DevTools to be served...');
unawaited(_devToolsLauncher!.ready.then((_) {
unawaited(_devToolsLauncher.ready.then((_) {
_launchDevToolsForDevices(flutterDevices);
}));
} else {
......@@ -294,7 +294,7 @@ class FlutterResidentDevtoolsHandler implements ResidentDevtoolsHandler {
}
_shutdown = true;
_readyToAnnounce = false;
await _devToolsLauncher!.close();
await _devToolsLauncher.close();
}
}
......
......@@ -1690,7 +1690,7 @@ class TerminalHandler {
_addSignalHandler(io.ProcessSignal.sigusr2, _handleSignal);
if (_pidFile != null) {
_logger.printTrace('Writing pid to: $_pidFile');
_actualPidFile = _processInfo.writePidFile(_pidFile!);
_actualPidFile = _processInfo.writePidFile(_pidFile);
}
}
}
......
......@@ -81,7 +81,7 @@ class VisualStudio {
if (_bestVisualStudioDetails == null) {
return false;
}
return _bestVisualStudioDetails!.isComplete ?? true;
return _bestVisualStudioDetails.isComplete ?? true;
}
/// True if Visual Studio is launchable.
......@@ -91,7 +91,7 @@ class VisualStudio {
if (_bestVisualStudioDetails == null) {
return false;
}
return _bestVisualStudioDetails!.isLaunchable ?? true;
return _bestVisualStudioDetails.isLaunchable ?? true;
}
/// True if the Visual Studio installation is a pre-release version.
......
......@@ -3,7 +3,7 @@ description: Tools for building Flutter applications
homepage: https://flutter.dev
environment:
sdk: '>=3.0.0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
# To update these, use "flutter update-packages --force-upgrade".
......
......@@ -60,7 +60,7 @@ void main() {
pubspecFile.writeAsStringSync('''
name: foo_project
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
''');
final File dartFile = fileSystem.file(fileSystem.path.join(directory.path, 'lib', 'main.dart'));
......
......@@ -427,7 +427,7 @@ format: true
pubspecFile.writeAsStringSync('''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......@@ -466,7 +466,7 @@ format: true
pubspecFile.writeAsStringSync('''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -23,7 +23,7 @@ description: A framework for writing Flutter applications
homepage: http://flutter.dev
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
# To update these, use "flutter update-packages --force-upgrade".
......@@ -60,7 +60,7 @@ homepage: http://flutter.dev
version: 1.0.0
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
flutter: ">=2.5.0-6.0.pre.30 <3.0.0"
dependencies:
......
......@@ -2,7 +2,7 @@ name: font
description: A test project that contains a font.
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
flutter:
uses-material-design: true
......
......@@ -2,7 +2,7 @@ name: main
description: A test project that has a package with a font as a dependency.
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
font:
......
......@@ -701,7 +701,7 @@ class TestTarget extends Target {
@override
bool canSkip(Environment environment) {
if (_canSkip != null) {
return _canSkip!(environment);
return _canSkip(environment);
}
return super.canSkip(environment);
}
......
......@@ -86,7 +86,7 @@ flutter:
pluginClass: none
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
flutter: ">=1.20.0"
''';
......
......@@ -166,7 +166,7 @@ flutter:
linux:
dartPluginClass: APlugin
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
flutter: ">=2.5.0"
''');
......
......@@ -17,7 +17,7 @@ description: A framework for writing Flutter applications
homepage: http://flutter.dev
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
# To update these, use "flutter update-packages --force-upgrade".
......@@ -51,7 +51,7 @@ description: A dummy pubspec with no dependencies
homepage: http://flutter.dev
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
''';
const String kInvalidGitPubspec = '''
......@@ -60,7 +60,7 @@ description: A framework for writing Flutter applications
homepage: http://flutter.dev
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
# To update these, use "flutter update-packages --force-upgrade".
......
......@@ -481,7 +481,7 @@ class _MyHomePageState extends State<MyHomePage> {
const String pubspecYamlSrc = r'''
name: flutter_project
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -637,7 +637,7 @@ class TestProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -12,7 +12,7 @@ class BackgroundProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......@@ -63,7 +63,7 @@ class RepeatingBackgroundProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -10,7 +10,7 @@ class BasicProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......@@ -63,7 +63,7 @@ class BasicProjectThatThrows extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......@@ -120,7 +120,7 @@ class BasicProjectWithTimelineTraces extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......@@ -169,7 +169,7 @@ class BasicProjectWithFlutterGen extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......@@ -194,7 +194,7 @@ class BasicProjectWithUnaryMain extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
sdk: flutter
......
......@@ -10,7 +10,7 @@ class CompileErrorProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -13,7 +13,7 @@ class DeferredComponentsProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -34,7 +34,7 @@ class GenL10nProject extends Project {
final String pubspec = '''
name: test_l10n_project
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -10,7 +10,7 @@ class HotReloadConstProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -12,7 +12,7 @@ class HotReloadProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -10,7 +10,7 @@ class HotReloadWithAssetProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -14,7 +14,7 @@ class IntegrationTestsProject extends Project implements TestsProject {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -175,7 +175,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -38,7 +38,7 @@ class MultidexProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -10,7 +10,7 @@ class ProjectWithEarlyError extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -10,7 +10,7 @@ class HotReloadProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -9,7 +9,7 @@ class SteppingProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
sdk: flutter
......@@ -65,7 +65,7 @@ class WebSteppingProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
sdk: flutter
......
......@@ -10,7 +10,7 @@ class TestProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -13,7 +13,7 @@ class TestsProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=3.0.0-0 <4.0.0'
sdk: '>=3.2.0-0 <4.0.0'
dependencies:
flutter:
......
......@@ -341,7 +341,7 @@ class _FakeHttpClientRequest implements HttpClientRequest {
});
await completer.future;
if (_responseError != null) {
return Future<HttpClientResponse>.error(_responseError!);
return Future<HttpClientResponse>.error(_responseError);
}
return _FakeHttpClientResponse(_response);
}
......
......@@ -401,7 +401,7 @@ abstract class FakeProcessManager implements ProcessManager {
return false;
}
if (fakeProcess._completer != null) {
fakeProcess._completer!.complete();
fakeProcess._completer.complete();
}
return true;
}
......
......@@ -27,7 +27,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if (_fileSystemDelegate == null) {
return super.createDirectory(path);
}
return _fileSystemDelegate!.directory(path);
return _fileSystemDelegate.directory(path);
}
@override
......@@ -35,7 +35,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if (_fileSystemDelegate == null) {
return super.createFile(path);
}
return _fileSystemDelegate!.file(path);
return _fileSystemDelegate.file(path);
}
@override
......@@ -43,7 +43,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if (_fileSystemDelegate == null) {
return super.createLink(path);
}
return _fileSystemDelegate!.link(path);
return _fileSystemDelegate.link(path);
}
@override
......@@ -51,7 +51,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if (_fileSystemDelegate == null) {
return super.fsWatch(path, events, recursive);
}
return _fileSystemDelegate!.file(path).watch(events: events, recursive: recursive);
return _fileSystemDelegate.file(path).watch(events: events, recursive: recursive);
}
@override
......@@ -59,7 +59,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if (_fileSystemDelegate == null) {
return super.fsWatchIsSupported();
}
return _fileSystemDelegate!.isWatchSupported;
return _fileSystemDelegate.isWatchSupported;
}
@override
......@@ -67,7 +67,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if (_fileSystemDelegate == null) {
return super.fseGetType(path, followLinks);
}
return _fileSystemDelegate!.type(path, followLinks: followLinks);
return _fileSystemDelegate.type(path, followLinks: followLinks);
}
@override
......@@ -75,7 +75,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if (_fileSystemDelegate == null) {
return super.fseGetTypeSync(path, followLinks);
}
return _fileSystemDelegate!.typeSync(path, followLinks: followLinks);
return _fileSystemDelegate.typeSync(path, followLinks: followLinks);
}
@override
......@@ -83,7 +83,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if (_fileSystemDelegate == null) {
return super.fseIdentical(path1, path2);
}
return _fileSystemDelegate!.identical(path1, path2);
return _fileSystemDelegate.identical(path1, path2);
}
@override
......@@ -91,7 +91,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if (_fileSystemDelegate == null) {
return super.fseIdenticalSync(path1, path2);
}
return _fileSystemDelegate!.identicalSync(path1, path2);
return _fileSystemDelegate.identicalSync(path1, path2);
}
@override
......@@ -99,7 +99,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if (_fileSystemDelegate == null) {
return super.getCurrentDirectory();
}
return _fileSystemDelegate!.currentDirectory;
return _fileSystemDelegate.currentDirectory;
}
@override
......@@ -107,7 +107,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if (_fileSystemDelegate == null) {
return super.getSystemTempDirectory();
}
return _fileSystemDelegate!.systemTempDirectory;
return _fileSystemDelegate.systemTempDirectory;
}
@override
......@@ -115,7 +115,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if (_fileSystemDelegate == null) {
return super.setCurrentDirectory(path);
}
_fileSystemDelegate!.currentDirectory = path;
_fileSystemDelegate.currentDirectory = path;
}
@override
......@@ -123,7 +123,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if (_fileSystemDelegate == null) {
return super.stat(path);
}
return _fileSystemDelegate!.stat(path);
return _fileSystemDelegate.stat(path);
}
@override
......@@ -131,6 +131,6 @@ class FlutterIOOverrides extends io.IOOverrides {
if (_fileSystemDelegate == null) {
return super.statSync(path);
}
return _fileSystemDelegate!.statSync(path);
return _fileSystemDelegate.statSync(path);
}
}
......@@ -34,13 +34,13 @@ class TestBuildSystem implements BuildSystem {
@override
Future<BuildResult> build(Target target, Environment environment, {BuildSystemConfig buildSystemConfig = const BuildSystemConfig()}) async {
if (_onRun != null) {
_onRun?.call(target, environment);
_onRun.call(target, environment);
}
if (_exception != null) {
throw _exception!;
throw _exception;
}
if (_singleResult != null) {
return _singleResult!;
return _singleResult;
}
if (_nextResult >= _results.length) {
throw StateError('Unexpected build request of ${target.name}');
......@@ -51,13 +51,13 @@ class TestBuildSystem implements BuildSystem {
@override
Future<BuildResult> buildIncremental(Target target, Environment environment, BuildResult? previousBuild) async {
if (_onRun != null) {
_onRun?.call(target, environment);
_onRun.call(target, environment);
}
if (_exception != null) {
throw _exception!;
throw _exception;
}
if (_singleResult != null) {
return _singleResult!;
return _singleResult;
}
if (_nextResult >= _results.length) {
throw StateError('Unexpected buildIncremental request of ${target.name}');
......
......@@ -126,7 +126,7 @@ class Testbed {
body: () async {
Cache.flutterRoot = '';
if (_setup != null) {
await _setup?.call();
await _setup.call();
}
await test();
Cache.flutterRoot = originalFlutterRoot;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment