Unverified Commit cf27be38 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Migrate web_validator to null safety (#80095)

parent 54e5f5cf
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:meta/meta.dart';
import '../base/config.dart';
......@@ -23,9 +21,9 @@ class CustomDevicesConfig {
/// when it's not valid JSON (which other configurations do) and will not
/// be implicitly created when it doesn't exist.
CustomDevicesConfig({
@required FileSystem fileSystem,
@required Logger logger,
@required Platform platform
required FileSystem fileSystem,
required Logger logger,
required Platform platform
}) : _fileSystem = fileSystem,
_config = Config(
_kCustomDevicesConfigName,
......@@ -40,9 +38,9 @@ class CustomDevicesConfig {
@visibleForTesting
CustomDevicesConfig.test({
@required FileSystem fileSystem,
Directory directory,
@required Logger logger
required FileSystem fileSystem,
Directory? directory,
required Logger logger
}) : _fileSystem = fileSystem,
_config = Config.test(
name: _kCustomDevicesConfigName,
......
......@@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:meta/meta.dart';
import 'base/config.dart';
import 'base/platform.dart';
import 'features.dart';
......@@ -13,9 +9,9 @@ import 'version.dart';
class FlutterFeatureFlags implements FeatureFlags {
FlutterFeatureFlags({
@required FlutterVersion flutterVersion,
@required Config config,
@required Platform platform,
required FlutterVersion flutterVersion,
required Config config,
required Platform platform,
}) : _flutterVersion = flutterVersion,
_config = config,
_platform = platform;
......@@ -66,7 +62,7 @@ class FlutterFeatureFlags implements FeatureFlags {
}
bool isEnabled = featureSetting.enabledByDefault;
if (feature.configSetting != null) {
final bool configOverride = _config.getValue(feature.configSetting) as bool;
final bool? configOverride = _config.getValue(feature.configSetting!) as bool?;
if (configOverride != null) {
isEnabled = configOverride;
}
......
......@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:process/process.dart';
import '../base/common.dart';
......
......@@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:meta/meta.dart';
import '../base/platform.dart';
import '../doctor_validator.dart';
import 'chrome.dart';
......@@ -52,8 +48,8 @@ abstract class ChromiumValidator extends DoctorValidator {
/// A validator that checks whether Chrome is installed and can run.
class ChromeValidator extends ChromiumValidator {
const ChromeValidator({
@required Platform platform,
@required ChromiumLauncher chromiumLauncher,
required Platform platform,
required ChromiumLauncher chromiumLauncher,
}) : _platform = platform,
_chromiumLauncher = chromiumLauncher,
super('Chrome - develop for the web');
......@@ -71,8 +67,8 @@ class ChromeValidator extends ChromiumValidator {
/// A validator that checks whether Edge is installed and can run.
class EdgeValidator extends ChromiumValidator {
const EdgeValidator({
@required Platform platform,
@required ChromiumLauncher chromiumLauncher,
required Platform platform,
required ChromiumLauncher chromiumLauncher,
}) : _platform = platform,
_chromiumLauncher = chromiumLauncher,
super('Edge - develop for the web');
......
......@@ -2,11 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
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/doctor_validator.dart';
import 'package:flutter_tools/src/web/chrome.dart';
......@@ -16,11 +15,11 @@ import '../../src/common.dart';
import '../../src/fake_process_manager.dart';
void main() {
Platform platform;
FakeProcessManager fakeProcessManager;
ChromiumLauncher chromeLauncher;
FileSystem fileSystem;
ChromiumValidator webValidator;
late Platform platform;
late FakeProcessManager fakeProcessManager;
late ChromiumLauncher chromeLauncher;
late FileSystem fileSystem;
late ChromiumValidator webValidator;
setUp(() {
fileSystem = MemoryFileSystem.test();
......@@ -33,7 +32,12 @@ void main() {
fileSystem: fileSystem,
platform: platform,
processManager: fakeProcessManager,
operatingSystemUtils: null,
operatingSystemUtils: OperatingSystemUtils(
fileSystem: fileSystem,
logger: BufferLogger.test(),
platform: platform,
processManager: fakeProcessManager,
),
browserFinder: findChromeExecutable,
logger: BufferLogger.test(),
);
......
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