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
d2f9c6c7
Unverified
Commit
d2f9c6c7
authored
Aug 11, 2021
by
嘟囔
Committed by
GitHub
Aug 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: migrate base/dds.dart to null-safety (#88015)
parent
4ef8088c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
dds.dart
packages/flutter_tools/lib/src/base/dds.dart
+7
-9
No files found.
packages/flutter_tools/lib/src/base/dds.dart
View file @
d2f9c6c7
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'dart:async'
;
import
'dart:async'
;
import
'package:dds/dds.dart'
as
dds
;
import
'package:dds/dds.dart'
as
dds
;
...
@@ -24,10 +22,10 @@ Future<dds.DartDevelopmentService> Function(
...
@@ -24,10 +22,10 @@ Future<dds.DartDevelopmentService> Function(
/// Helper class to launch a [dds.DartDevelopmentService]. Allows for us to
/// Helper class to launch a [dds.DartDevelopmentService]. Allows for us to
/// mock out this functionality for testing purposes.
/// mock out this functionality for testing purposes.
class
DartDevelopmentService
{
class
DartDevelopmentService
{
dds
.
DartDevelopmentService
_ddsInstance
;
dds
.
DartDevelopmentService
?
_ddsInstance
;
Uri
get
uri
=>
_ddsInstance
?.
uri
??
_existingDdsUri
;
Uri
?
get
uri
=>
_ddsInstance
?.
uri
??
_existingDdsUri
;
Uri
_existingDdsUri
;
Uri
?
_existingDdsUri
;
Future
<
void
>
get
done
=>
_completer
.
future
;
Future
<
void
>
get
done
=>
_completer
.
future
;
final
Completer
<
void
>
_completer
=
Completer
<
void
>();
final
Completer
<
void
>
_completer
=
Completer
<
void
>();
...
@@ -37,7 +35,7 @@ class DartDevelopmentService {
...
@@ -37,7 +35,7 @@ class DartDevelopmentService {
int
hostPort
,
int
hostPort
,
bool
ipv6
,
bool
ipv6
,
bool
disableServiceAuthCodes
,
{
bool
disableServiceAuthCodes
,
{
@
required
Logger
logger
,
required
Logger
logger
,
})
async
{
})
async
{
final
Uri
ddsUri
=
Uri
(
final
Uri
ddsUri
=
Uri
(
scheme:
'http'
,
scheme:
'http'
,
...
@@ -45,7 +43,7 @@ class DartDevelopmentService {
...
@@ -45,7 +43,7 @@ class DartDevelopmentService {
io
.
InternetAddress
.
loopbackIPv6
:
io
.
InternetAddress
.
loopbackIPv6
:
io
.
InternetAddress
.
loopbackIPv4
io
.
InternetAddress
.
loopbackIPv4
).
host
,
).
host
,
port:
hostPort
??
0
,
port:
hostPort
,
);
);
logger
.
printTrace
(
logger
.
printTrace
(
'Launching a Dart Developer Service (DDS) instance at
$ddsUri
, '
'Launching a Dart Developer Service (DDS) instance at
$ddsUri
, '
...
@@ -58,12 +56,12 @@ class DartDevelopmentService {
...
@@ -58,12 +56,12 @@ class DartDevelopmentService {
enableAuthCodes:
!
disableServiceAuthCodes
,
enableAuthCodes:
!
disableServiceAuthCodes
,
ipv6:
ipv6
,
ipv6:
ipv6
,
);
);
unawaited
(
_ddsInstance
.
done
.
whenComplete
(()
{
unawaited
(
_ddsInstance
?
.
done
.
whenComplete
(()
{
if
(!
_completer
.
isCompleted
)
{
if
(!
_completer
.
isCompleted
)
{
_completer
.
complete
();
_completer
.
complete
();
}
}
}));
}));
logger
.
printTrace
(
'DDS is listening at
${_ddsInstance.uri}
.'
);
logger
.
printTrace
(
'DDS is listening at
${_ddsInstance
?
.uri}
.'
);
}
on
dds
.
DartDevelopmentServiceException
catch
(
e
)
{
}
on
dds
.
DartDevelopmentServiceException
catch
(
e
)
{
logger
.
printTrace
(
'Warning: Failed to start DDS:
${e.message}
'
);
logger
.
printTrace
(
'Warning: Failed to start DDS:
${e.message}
'
);
if
(
e
.
errorCode
==
dds
.
DartDevelopmentServiceException
.
existingDdsInstanceError
)
{
if
(
e
.
errorCode
==
dds
.
DartDevelopmentServiceException
.
existingDdsInstanceError
)
{
...
...
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