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
1371b8dc
Unverified
Commit
1371b8dc
authored
Jul 18, 2022
by
Christopher Fujino
Committed by
GitHub
Jul 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Fix null check errors in attach command (#107864)
parent
8dfad230
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
197 additions
and
87 deletions
+197
-87
attach.dart
packages/flutter_tools/lib/src/commands/attach.dart
+12
-8
mdns_discovery.dart
packages/flutter_tools/lib/src/mdns_discovery.dart
+1
-1
attach_test.dart
...utter_tools/test/commands.shard/hermetic/attach_test.dart
+184
-78
No files found.
packages/flutter_tools/lib/src/commands/attach.dart
View file @
1371b8dc
...
...
@@ -215,7 +215,11 @@ known, it can be explicitly provided to attach via the command-line, e.g.
Future
<
FlutterCommandResult
>
runCommand
()
async
{
await
_validateArguments
();
final
Device
device
=
await
(
findTargetDevice
()
as
FutureOr
<
Device
>);
final
Device
?
device
=
await
findTargetDevice
();
if
(
device
==
null
)
{
throwToolExit
(
'Did not find any valid target devices.'
);
}
final
Artifacts
?
overrideArtifacts
=
device
.
artifactOverrides
??
globals
.
artifacts
;
await
context
.
run
<
void
>(
...
...
@@ -272,7 +276,7 @@ known, it can be explicitly provided to attach via the command-line, e.g.
}
else
if
((
device
is
IOSDevice
)
||
(
device
is
IOSSimulator
)
||
(
device
is
MacOSDesignedForIPadDevice
))
{
final
Uri
?
uriFromMdns
=
await
MDnsObservatoryDiscovery
.
instance
!.
getObservatoryUri
(
appId
!
,
appId
,
device
,
usesIpv6:
usesIpv6
,
deviceVmservicePort:
deviceVmservicePort
,
...
...
@@ -317,12 +321,12 @@ known, it can be explicitly provided to attach via the command-line, e.g.
try
{
int
?
result
;
if
(
daemon
!=
null
)
{
final
ResidentRunner
runner
=
await
(
createResidentRunner
(
final
ResidentRunner
runner
=
await
createResidentRunner
(
observatoryUris:
observatoryUri
,
device:
device
,
flutterProject:
flutterProject
,
usesIpv6:
usesIpv6
,
)
as
FutureOr
<
ResidentRunner
>)
;
);
late
AppInstance
app
;
try
{
app
=
await
daemon
.
appDomain
.
launch
(
...
...
@@ -351,12 +355,12 @@ known, it can be explicitly provided to attach via the command-line, e.g.
return
;
}
while
(
true
)
{
final
ResidentRunner
runner
=
await
(
createResidentRunner
(
final
ResidentRunner
runner
=
await
createResidentRunner
(
observatoryUris:
observatoryUri
,
device:
device
,
flutterProject:
flutterProject
,
usesIpv6:
usesIpv6
,
)
as
FutureOr
<
ResidentRunner
>)
;
);
final
Completer
<
void
>
onAppStart
=
Completer
<
void
>.
sync
();
TerminalHandler
?
terminalHandler
;
unawaited
(
onAppStart
.
future
.
whenComplete
(()
{
...
...
@@ -400,7 +404,7 @@ known, it can be explicitly provided to attach via the command-line, e.g.
}
}
Future
<
ResidentRunner
?
>
createResidentRunner
({
Future
<
ResidentRunner
>
createResidentRunner
({
required
Stream
<
Uri
>
observatoryUris
,
required
Device
device
,
required
FlutterProject
flutterProject
,
...
...
@@ -452,7 +456,7 @@ known, it can be explicitly provided to attach via the command-line, e.g.
}
class
HotRunnerFactory
{
HotRunner
?
build
(
HotRunner
build
(
List
<
FlutterDevice
>
devices
,
{
required
String
target
,
required
DebuggingOptions
debuggingOptions
,
...
...
packages/flutter_tools/lib/src/mdns_discovery.dart
View file @
1371b8dc
...
...
@@ -145,7 +145,7 @@ class MDnsObservatoryDiscovery {
}
}
Future
<
Uri
?>
getObservatoryUri
(
String
applicationId
,
Device
device
,
{
Future
<
Uri
?>
getObservatoryUri
(
String
?
applicationId
,
Device
device
,
{
bool
usesIpv6
=
false
,
int
?
hostVmservicePort
,
int
?
deviceVmservicePort
,
...
...
packages/flutter_tools/test/commands.shard/hermetic/attach_test.dart
View file @
1371b8dc
This diff is collapsed.
Click to expand it.
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