Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
88652122
Unverified
Commit
88652122
authored
Nov 01, 2021
by
Jenn Magder
Committed by
GitHub
Nov 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate doctor to null safety (#92131)
parent
c3242a16
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
95 additions
and
107 deletions
+95
-107
runner.dart
packages/flutter_tools/lib/runner.dart
+1
-1
deferred_components_prebuild_validator.dart
...b/src/android/deferred_components_prebuild_validator.dart
+0
-1
devices.dart
packages/flutter_tools/lib/src/commands/devices.dart
+1
-1
doctor.dart
packages/flutter_tools/lib/src/commands/doctor.dart
+1
-1
emulators.dart
packages/flutter_tools/lib/src/commands/emulators.dart
+1
-1
ide_config.dart
packages/flutter_tools/lib/src/commands/ide_config.dart
+0
-1
device.dart
packages/flutter_tools/lib/src/device.dart
+2
-2
doctor.dart
packages/flutter_tools/lib/src/doctor.dart
+53
-53
globals.dart
packages/flutter_tools/lib/src/globals.dart
+1
-6
globals_null_migrated.dart
packages/flutter_tools/lib/src/globals_null_migrated.dart
+2
-0
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+1
-1
template.dart
packages/flutter_tools/lib/src/template.dart
+1
-1
flutter_tester.dart
packages/flutter_tools/lib/src/tester/flutter_tester.dart
+31
-34
template_test.dart
...utter_tools/test/general.shard/android/template_test.dart
+0
-1
template_test.dart
packages/flutter_tools/test/general.shard/template_test.dart
+0
-3
No files found.
packages/flutter_tools/lib/runner.dart
View file @
88652122
...
...
@@ -19,7 +19,7 @@ import 'src/base/logger.dart';
import
'src/base/process.dart'
;
import
'src/context_runner.dart'
;
import
'src/doctor.dart'
;
import
'src/globals.dart'
as
globals
;
import
'src/globals
_null_migrated
.dart'
as
globals
;
import
'src/reporting/crash_reporting.dart'
;
import
'src/runner/flutter_command.dart'
;
import
'src/runner/flutter_command_runner.dart'
;
...
...
packages/flutter_tools/lib/src/android/deferred_components_prebuild_validator.dart
View file @
88652122
...
...
@@ -256,7 +256,6 @@ class _DeferredComponentAndroidFiles {
final
Directory
templateComponentDir
=
templatesDir
.
childDirectory
(
'module
${globals.fs.path.separator}
android
${globals.fs.path.separator}
deferred_component'
);
template
=
Template
(
templateComponentDir
,
templateComponentDir
,
fileSystem:
globals
.
fs
,
templateManifest:
null
,
logger:
logger
,
templateRenderer:
globals
.
templateRenderer
,
);
...
...
packages/flutter_tools/lib/src/commands/devices.dart
View file @
88652122
...
...
@@ -8,7 +8,7 @@ import '../base/common.dart';
import
'../base/utils.dart'
;
import
'../convert.dart'
;
import
'../device.dart'
;
import
'../globals.dart'
as
globals
;
import
'../globals
_null_migrated
.dart'
as
globals
;
import
'../runner/flutter_command.dart'
;
class
DevicesCommand
extends
FlutterCommand
{
...
...
packages/flutter_tools/lib/src/commands/doctor.dart
View file @
88652122
...
...
@@ -6,7 +6,7 @@
import
'../android/android_workflow.dart'
;
import
'../base/common.dart'
;
import
'../globals.dart'
as
globals
;
import
'../globals
_null_migrated
.dart'
as
globals
;
import
'../runner/flutter_command.dart'
;
class
DoctorCommand
extends
FlutterCommand
{
...
...
packages/flutter_tools/lib/src/commands/emulators.dart
View file @
88652122
...
...
@@ -8,7 +8,7 @@ import '../base/common.dart';
import
'../base/utils.dart'
;
import
'../doctor_validator.dart'
;
import
'../emulator.dart'
;
import
'../globals.dart'
as
globals
;
import
'../globals
_null_migrated
.dart'
as
globals
;
import
'../runner/flutter_command.dart'
;
class
EmulatorsCommand
extends
FlutterCommand
{
...
...
packages/flutter_tools/lib/src/commands/ide_config.dart
View file @
88652122
...
...
@@ -252,7 +252,6 @@ class IdeConfigCommand extends FlutterCommand {
_templateDirectory
,
null
,
fileSystem:
globals
.
fs
,
templateManifest:
<
Uri
>{},
logger:
globals
.
logger
,
templateRenderer:
globals
.
templateRenderer
,
);
...
...
packages/flutter_tools/lib/src/device.dart
View file @
88652122
...
...
@@ -444,10 +444,10 @@ abstract class Device {
final
String
id
;
/// The [Category] for this device type.
final
Category
category
;
final
Category
?
category
;
/// The [PlatformType] for this device.
final
PlatformType
platformType
;
final
PlatformType
?
platformType
;
/// Whether this is an ephemeral device.
final
bool
ephemeral
;
...
...
packages/flutter_tools/lib/src/doctor.dart
View file @
88652122
This diff is collapsed.
Click to expand it.
packages/flutter_tools/lib/src/globals.dart
View file @
88652122
...
...
@@ -2,11 +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
'base/context.dart'
;
import
'doctor.dart'
;
// TODO(jmagman): Remove globals_null_migrated.dart, move into globals.dart.
export
'globals_null_migrated.dart'
;
Doctor
get
doctor
=>
context
.
get
<
Doctor
>();
packages/flutter_tools/lib/src/globals_null_migrated.dart
View file @
88652122
...
...
@@ -28,6 +28,7 @@ import 'build_system/build_system.dart';
import
'cache.dart'
;
import
'custom_devices/custom_devices_config.dart'
;
import
'device.dart'
;
import
'doctor.dart'
;
import
'fuchsia/fuchsia_sdk.dart'
;
import
'ios/ios_workflow.dart'
;
import
'ios/plist_parser.dart'
;
...
...
@@ -54,6 +55,7 @@ CocoaPodsValidator? get cocoapodsValidator => context.get<CocoaPodsValidator>();
Config
get
config
=>
context
.
get
<
Config
>()!;
CrashReporter
?
get
crashReporter
=>
context
.
get
<
CrashReporter
>();
DeviceManager
?
get
deviceManager
=>
context
.
get
<
DeviceManager
>();
Doctor
?
get
doctor
=>
context
.
get
<
Doctor
>();
HttpClientFactory
?
get
httpClientFactory
=>
context
.
get
<
HttpClientFactory
>();
IOSSimulatorUtils
?
get
iosSimulatorUtils
=>
context
.
get
<
IOSSimulatorUtils
>();
Logger
get
logger
=>
context
.
get
<
Logger
>()!;
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
88652122
...
...
@@ -26,7 +26,7 @@ import '../dart/package_map.dart';
import
'../dart/pub.dart'
;
import
'../device.dart'
;
import
'../features.dart'
;
import
'../globals.dart'
as
globals
;
import
'../globals
_null_migrated
.dart'
as
globals
;
import
'../project.dart'
;
import
'../reporting/reporting.dart'
;
import
'flutter_command_runner.dart'
;
...
...
packages/flutter_tools/lib/src/template.dart
View file @
88652122
...
...
@@ -42,7 +42,7 @@ class Template {
required
FileSystem
fileSystem
,
required
Logger
logger
,
required
TemplateRenderer
templateRenderer
,
required
Set
<
Uri
>?
templateManifest
,
Set
<
Uri
>?
templateManifest
,
})
{
return
Template
.
_
(
<
Directory
>[
templateSource
],
...
...
packages/flutter_tools/lib/src/tester/flutter_tester.dart
View file @
88652122
...
...
@@ -2,11 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import
'dart:async'
;
import
'package:meta/meta.dart'
;
import
'package:process/process.dart'
;
import
'../application_package.dart'
;
...
...
@@ -51,12 +48,12 @@ class FlutterTesterApp extends ApplicationPackage {
/// to the flutter command.
class
FlutterTesterDevice
extends
Device
{
FlutterTesterDevice
(
String
deviceId
,
{
@
required
ProcessManager
processManager
,
@
required
FlutterVersion
flutterVersion
,
@
required
Logger
logger
,
@
required
FileSystem
fileSystem
,
@
required
Artifacts
artifacts
,
@
required
OperatingSystemUtils
operatingSystemUtils
,
required
ProcessManager
processManager
,
required
FlutterVersion
flutterVersion
,
required
Logger
logger
,
required
FileSystem
fileSystem
,
required
Artifacts
artifacts
,
required
OperatingSystemUtils
operatingSystemUtils
,
})
:
_processManager
=
processManager
,
_flutterVersion
=
flutterVersion
,
_logger
=
logger
,
...
...
@@ -77,14 +74,14 @@ class FlutterTesterDevice extends Device {
final
Artifacts
_artifacts
;
final
OperatingSystemUtils
_operatingSystemUtils
;
Process
_process
;
Process
?
_process
;
final
DevicePortForwarder
_portForwarder
=
const
NoOpDevicePortForwarder
();
@override
Future
<
bool
>
get
isLocalEmulator
async
=>
false
;
@override
Future
<
String
>
get
emulatorId
async
=>
null
;
Future
<
String
?
>
get
emulatorId
async
=>
null
;
@override
String
get
name
=>
'Flutter test device'
;
...
...
@@ -111,7 +108,7 @@ class FlutterTesterDevice extends Device {
@override
DeviceLogReader
getLogReader
({
ApplicationPackage
app
,
ApplicationPackage
?
app
,
bool
includePastLogs
=
false
,
})
{
return
_logReader
;
...
...
@@ -120,13 +117,13 @@ class FlutterTesterDevice extends Device {
@override
Future
<
bool
>
installApp
(
ApplicationPackage
app
,
{
String
userIdentifier
,
String
?
userIdentifier
,
})
async
=>
true
;
@override
Future
<
bool
>
isAppInstalled
(
ApplicationPackage
app
,
{
String
userIdentifier
,
String
?
userIdentifier
,
})
async
=>
false
;
@override
...
...
@@ -138,13 +135,13 @@ class FlutterTesterDevice extends Device {
@override
Future
<
LaunchResult
>
startApp
(
ApplicationPackage
package
,
{
@required
String
mainPath
,
String
route
,
DebuggingOptions
debuggingOptions
,
Map
<
String
,
dynamic
>
platformArgs
,
String
?
mainPath
,
String
?
route
,
required
DebuggingOptions
debuggingOptions
,
Map
<
String
,
Object
?>
platformArgs
=
const
<
String
,
Object
>{}
,
bool
prebuiltApplication
=
false
,
bool
ipv6
=
false
,
String
userIdentifier
,
String
?
userIdentifier
,
})
async
{
final
BuildInfo
buildInfo
=
debuggingOptions
.
buildInfo
;
if
(!
buildInfo
.
isDebug
)
{
...
...
@@ -184,7 +181,7 @@ class FlutterTesterDevice extends Device {
applicationKernelFilePath
];
ProtocolDiscovery
observatoryDiscovery
;
ProtocolDiscovery
?
observatoryDiscovery
;
try
{
_logger
.
printTrace
(
command
.
join
(
' '
));
_process
=
await
_processManager
.
start
(
command
,
...
...
@@ -203,9 +200,9 @@ class FlutterTesterDevice extends Device {
ipv6:
ipv6
,
logger:
_logger
,
);
_logReader
.
initializeProcess
(
_process
);
_logReader
.
initializeProcess
(
_process
!
);
final
Uri
observatoryUri
=
await
observatoryDiscovery
.
uri
;
final
Uri
?
observatoryUri
=
await
observatoryDiscovery
.
uri
;
if
(
observatoryUri
!=
null
)
{
return
LaunchResult
.
succeeded
(
observatoryUri:
observatoryUri
);
}
...
...
@@ -224,7 +221,7 @@ class FlutterTesterDevice extends Device {
@override
Future
<
bool
>
stopApp
(
ApplicationPackage
app
,
{
String
userIdentifier
,
String
?
userIdentifier
,
})
async
{
_process
?.
kill
();
_process
=
null
;
...
...
@@ -234,7 +231,7 @@ class FlutterTesterDevice extends Device {
@override
Future
<
bool
>
uninstallApp
(
ApplicationPackage
app
,
{
String
userIdentifier
,
String
?
userIdentifier
,
})
async
=>
true
;
@override
...
...
@@ -243,7 +240,7 @@ class FlutterTesterDevice extends Device {
@override
DevFSWriter
createDevFSWriter
(
covariant
ApplicationPackage
app
,
String
userIdentifier
,
String
?
userIdentifier
,
)
{
return
LocalDevFSWriter
(
fileSystem:
_fileSystem
,
...
...
@@ -252,19 +249,19 @@ class FlutterTesterDevice extends Device {
@override
Future
<
void
>
dispose
()
async
{
_logReader
?
.
dispose
();
await
_portForwarder
?
.
dispose
();
_logReader
.
dispose
();
await
_portForwarder
.
dispose
();
}
}
class
FlutterTesterDevices
extends
PollingDeviceDiscovery
{
FlutterTesterDevices
({
@
required
FileSystem
fileSystem
,
@
required
Artifacts
artifacts
,
@
required
ProcessManager
processManager
,
@
required
Logger
logger
,
@
required
FlutterVersion
flutterVersion
,
@
required
OperatingSystemUtils
operatingSystemUtils
,
required
FileSystem
fileSystem
,
required
Artifacts
artifacts
,
required
ProcessManager
processManager
,
required
Logger
logger
,
required
FlutterVersion
flutterVersion
,
required
OperatingSystemUtils
operatingSystemUtils
,
})
:
_testerDevice
=
FlutterTesterDevice
(
kTesterDeviceId
,
fileSystem:
fileSystem
,
...
...
@@ -289,7 +286,7 @@ class FlutterTesterDevices extends PollingDeviceDiscovery {
bool
get
supportsPlatform
=>
true
;
@override
Future
<
List
<
Device
>>
pollingGetDevices
({
Duration
timeout
})
async
{
Future
<
List
<
Device
>>
pollingGetDevices
({
Duration
?
timeout
})
async
{
return
showFlutterTesterDevice
?
<
Device
>[
_testerDevice
]
:
<
Device
>[];
}
...
...
packages/flutter_tools/test/general.shard/android/template_test.dart
View file @
88652122
...
...
@@ -33,7 +33,6 @@ void main() {
fileSystem:
fileSystem
,
logger:
logger
,
templateRenderer:
const
MustacheTemplateRenderer
(),
templateManifest:
null
);
final
Map
<
String
,
Object
>
context
=
<
String
,
Object
>{
...
...
packages/flutter_tools/test/general.shard/template_test.dart
View file @
88652122
...
...
@@ -21,7 +21,6 @@ void main() {
fileSystem:
fileSystem
,
logger:
BufferLogger
.
test
(),
templateRenderer:
FakeTemplateRenderer
(),
templateManifest:
null
,
),
throwsToolExit
());
});
...
...
@@ -34,7 +33,6 @@ void main() {
fileSystem:
fileSystem
,
logger:
BufferLogger
.
test
(),
templateRenderer:
FakeTemplateRenderer
(),
templateManifest:
null
,
);
final
Directory
directory
=
fileSystem
.
directory
(
'foo'
);
handler
.
addError
(
directory
,
FileSystemOp
.
create
,
const
FileSystemException
());
...
...
@@ -58,7 +56,6 @@ void main() {
templateDir
,
imageSourceDir
,
fileSystem:
fileSystem
,
templateManifest:
null
,
logger:
BufferLogger
.
test
(),
templateRenderer:
FakeTemplateRenderer
(),
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment