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
d561fe72
Unverified
Commit
d561fe72
authored
Dec 23, 2021
by
Jenn Magder
Committed by
GitHub
Dec 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate flutter_device_manager to null safety (#95657)
parent
64ff96c2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
28 additions
and
35 deletions
+28
-35
context_runner.dart
packages/flutter_tools/lib/src/context_runner.dart
+1
-0
flutter_device_manager.dart
packages/flutter_tools/lib/src/flutter_device_manager.dart
+21
-23
fuchsia_build.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_build.dart
+2
-3
fuchsia_device.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
+1
-1
fuchsia_pm.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_pm.dart
+2
-4
fuchsia_sdk.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_sdk.dart
+0
-4
globals.dart
packages/flutter_tools/lib/src/globals.dart
+1
-0
globals_null_migrated.dart
packages/flutter_tools/lib/src/globals_null_migrated.dart
+0
-0
No files found.
packages/flutter_tools/lib/src/context_runner.dart
View file @
d561fe72
...
...
@@ -204,6 +204,7 @@ Future<T> runInContext<T>(
platform:
globals
.
platform
,
featureFlags:
featureFlags
,
),
fuchsiaSdk:
globals
.
fuchsiaSdk
,
operatingSystemUtils:
globals
.
os
,
terminal:
globals
.
terminal
,
customDevicesConfig:
globals
.
customDevicesConfig
,
...
...
packages/flutter_tools/lib/src/flutter_device_manager.dart
View file @
d561fe72
...
...
@@ -2,9 +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
'package:process/process.dart'
;
import
'android/android_device_discovery.dart'
;
...
...
@@ -42,26 +39,27 @@ import 'windows/windows_workflow.dart';
/// A provider for all of the device discovery instances.
class
FlutterDeviceManager
extends
DeviceManager
{
FlutterDeviceManager
({
@required
Logger
logger
,
@required
Platform
platform
,
@required
ProcessManager
processManager
,
@required
FileSystem
fileSystem
,
@required
AndroidSdk
androidSdk
,
@required
FeatureFlags
featureFlags
,
@required
IOSSimulatorUtils
iosSimulatorUtils
,
@required
XCDevice
xcDevice
,
@required
AndroidWorkflow
androidWorkflow
,
@required
IOSWorkflow
iosWorkflow
,
@required
FuchsiaWorkflow
fuchsiaWorkflow
,
@required
FlutterVersion
flutterVersion
,
@required
Artifacts
artifacts
,
@required
MacOSWorkflow
macOSWorkflow
,
@required
UserMessages
userMessages
,
@required
OperatingSystemUtils
operatingSystemUtils
,
@required
WindowsWorkflow
windowsWorkflow
,
@required
Terminal
terminal
,
@required
CustomDevicesConfig
customDevicesConfig
,
@required
UwpTool
uwptool
,
required
Logger
logger
,
required
Platform
platform
,
required
ProcessManager
processManager
,
required
FileSystem
fileSystem
,
required
AndroidSdk
androidSdk
,
required
FeatureFlags
featureFlags
,
required
IOSSimulatorUtils
iosSimulatorUtils
,
required
XCDevice
xcDevice
,
required
AndroidWorkflow
androidWorkflow
,
required
IOSWorkflow
iosWorkflow
,
required
FuchsiaWorkflow
fuchsiaWorkflow
,
required
FlutterVersion
flutterVersion
,
required
Artifacts
artifacts
,
required
MacOSWorkflow
macOSWorkflow
,
required
FuchsiaSdk
fuchsiaSdk
,
required
UserMessages
userMessages
,
required
OperatingSystemUtils
operatingSystemUtils
,
required
WindowsWorkflow
windowsWorkflow
,
required
Terminal
terminal
,
required
CustomDevicesConfig
customDevicesConfig
,
required
UwpTool
uwptool
,
})
:
deviceDiscoverers
=
<
DeviceDiscovery
>[
AndroidDevices
(
logger:
logger
,
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_build.dart
View file @
d561fe72
...
...
@@ -16,7 +16,6 @@ import '../globals.dart' as globals;
import
'../project.dart'
;
import
'fuchsia_pm.dart'
;
import
'fuchsia_sdk.dart'
;
Future
<
void
>
_timedBuildStep
(
String
name
,
Future
<
void
>
Function
()
action
)
async
{
final
Stopwatch
sw
=
Stopwatch
()..
start
();
...
...
@@ -55,7 +54,7 @@ Future<void> buildFuchsia({
}
await
_timedBuildStep
(
'fuchsia-kernel-compile'
,
()
=>
fuchsiaSdk
!.
fuchsiaKernelCompiler
.
build
(
()
=>
globals
.
fuchsiaSdk
!.
fuchsiaKernelCompiler
.
build
(
fuchsiaProject:
fuchsiaProject
,
target:
targetPath
,
buildInfo:
buildInfo
));
if
(
buildInfo
.
usesAot
)
{
...
...
@@ -214,7 +213,7 @@ Future<void> _buildPackage(
manifestFile
.
writeAsStringSync
(
'meta/package=
$pkgDir
/meta/package
\n
'
,
mode:
FileMode
.
append
);
final
FuchsiaPM
?
fuchsiaPM
=
fuchsiaSdk
?.
fuchsiaPM
;
final
FuchsiaPM
?
fuchsiaPM
=
globals
.
fuchsiaSdk
?.
fuchsiaPM
;
if
(
fuchsiaPM
==
null
)
{
return
;
}
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
View file @
d561fe72
...
...
@@ -83,7 +83,7 @@ class _FuchsiaLogReader extends DeviceLogReader {
Stream
<
String
>?
_logLines
;
@override
Stream
<
String
>
get
logLines
{
final
Stream
<
String
>?
logStream
=
fuchsiaSdk
?.
syslogs
(
_device
.
id
);
final
Stream
<
String
>?
logStream
=
globals
.
fuchsiaSdk
?.
syslogs
(
_device
.
id
);
_logLines
??=
_processLogs
(
logStream
);
return
_logLines
??
const
Stream
<
String
>.
empty
();
}
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_pm.dart
View file @
d561fe72
...
...
@@ -10,8 +10,6 @@ import '../base/process.dart';
import
'../convert.dart'
;
import
'../globals.dart'
as
globals
;
import
'fuchsia_sdk.dart'
;
/// This is a basic wrapper class for the Fuchsia SDK's `pm` tool.
class
FuchsiaPM
{
/// Initializes the staging area at [buildPath] for creating the Fuchsia
...
...
@@ -199,7 +197,7 @@ class FuchsiaPackageServer {
return
false
;
}
// initialize a new repo.
final
FuchsiaPM
?
fuchsiaPM
=
fuchsiaSdk
?.
fuchsiaPM
;
final
FuchsiaPM
?
fuchsiaPM
=
globals
.
fuchsiaSdk
?.
fuchsiaPM
;
if
(
fuchsiaPM
==
null
||
!
await
fuchsiaPM
.
newrepo
(
_repo
))
{
globals
.
printError
(
'Failed to create a new package server repo'
);
return
false
;
...
...
@@ -232,7 +230,7 @@ class FuchsiaPackageServer {
if
(
_process
==
null
)
{
return
false
;
}
return
(
await
fuchsiaSdk
?.
fuchsiaPM
.
publish
(
_repo
,
package
.
path
))
==
true
;
return
(
await
globals
.
fuchsiaSdk
?.
fuchsiaPM
.
publish
(
_repo
,
package
.
path
))
==
true
;
}
@override
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_sdk.dart
View file @
d561fe72
...
...
@@ -4,7 +4,6 @@
import
'dart:async'
;
import
'../base/context.dart'
;
import
'../base/file_system.dart'
;
import
'../base/io.dart'
;
import
'../base/platform.dart'
;
...
...
@@ -15,9 +14,6 @@ import 'fuchsia_ffx.dart';
import
'fuchsia_kernel_compiler.dart'
;
import
'fuchsia_pm.dart'
;
/// The [FuchsiaSdk] instance.
FuchsiaSdk
?
get
fuchsiaSdk
=>
context
.
get
<
FuchsiaSdk
>();
/// Returns [true] if the current platform supports Fuchsia targets.
bool
isFuchsiaSupportedPlatform
(
Platform
platform
)
{
return
platform
.
isLinux
||
platform
.
isMacOS
;
...
...
packages/flutter_tools/lib/src/globals.dart
View file @
d561fe72
...
...
@@ -66,6 +66,7 @@ AndroidStudio? get androidStudio => context.get<AndroidStudio>();
AndroidSdk
?
get
androidSdk
=>
context
.
get
<
AndroidSdk
>();
FlutterVersion
get
flutterVersion
=>
context
.
get
<
FlutterVersion
>()!;
FuchsiaArtifacts
?
get
fuchsiaArtifacts
=>
context
.
get
<
FuchsiaArtifacts
>();
FuchsiaSdk
?
get
fuchsiaSdk
=>
context
.
get
<
FuchsiaSdk
>();
Usage
get
flutterUsage
=>
context
.
get
<
Usage
>()!;
XcodeProjectInterpreter
?
get
xcodeProjectInterpreter
=>
context
.
get
<
XcodeProjectInterpreter
>();
XCDevice
?
get
xcdevice
=>
context
.
get
<
XCDevice
>();
...
...
packages/flutter_tools/lib/src/globals_null_migrated.dart
deleted
100644 → 0
View file @
64ff96c2
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