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
ff5258a5
Unverified
Commit
ff5258a5
authored
Jun 24, 2021
by
Jonah Williams
Committed by
GitHub
Jun 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] convert devtools URL to a better format (#85170)
parent
ad540e4f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
resident_devtools_handler.dart
...ages/flutter_tools/lib/src/resident_devtools_handler.dart
+10
-0
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+1
-1
resident_devtools_handler_test.dart
...ls/test/general.shard/resident_devtools_handler_test.dart
+7
-0
No files found.
packages/flutter_tools/lib/src/resident_devtools_handler.dart
View file @
ff5258a5
...
...
@@ -288,3 +288,13 @@ class NoOpDevtoolsHandler implements ResidentDevtoolsHandler {
return
;
}
}
/// Convert a [URI] with query parameters into a display format instead
/// of the default URI encoding.
String
urlToDisplayString
(
Uri
uri
)
{
final
StringBuffer
base
=
StringBuffer
(
uri
.
replace
(
queryParameters:
<
String
,
String
>{},
).
toString
());
base
.
write
(
uri
.
queryParameters
.
keys
.
map
((
String
key
)
=>
'
$key
=
${uri.queryParameters[key]}
'
).
join
(
'&'
));
return
base
.
toString
();
}
packages/flutter_tools/lib/src/resident_runner.dart
View file @
ff5258a5
...
...
@@ -1409,7 +1409,7 @@ abstract class ResidentRunner extends ResidentHandlers {
if
(
uri
!=
null
)
{
globals
.
printStatus
(
'The Flutter DevTools debugger and profiler '
'on
${device.device.name}
is available at:
$
uri
'
,
'on
${device.device.name}
is available at:
$
{urlToDisplayString(uri)}
'
,
);
}
}
...
...
packages/flutter_tools/test/general.shard/resident_devtools_handler_test.dart
View file @
ff5258a5
...
...
@@ -427,6 +427,13 @@ void main() {
expect
(
handler
.
launchDevToolsInBrowser
(
flutterDevices:
<
FlutterDevice
>[]),
isTrue
);
expect
(
handler
.
launchedInBrowser
,
isTrue
);
});
testWithoutContext
(
'Converts a VmService URI with a query parameter to a pretty display string'
,
()
{
const
String
value
=
'http://127.0.0.1:9100?uri=http%3A%2F%2F127.0.0.1%3A57922%2F_MXpzytpH20%3D%2F'
;
final
Uri
uri
=
Uri
.
parse
(
value
);
expect
(
urlToDisplayString
(
uri
),
'http://127.0.0.1:9100?uri=http://127.0.0.1:57922/_MXpzytpH20=/'
);
});
}
class
FakeDevtoolsLauncher
extends
Fake
implements
DevtoolsLauncher
{
...
...
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