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
a3bcaf22
Unverified
Commit
a3bcaf22
authored
May 01, 2021
by
Todd Volkert
Committed by
GitHub
May 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow widget inspector's _Location.file to be null (#81588)
Fixes
https://github.com/flutter/flutter/issues/81587
parent
0cc58fd0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
widget_inspector.dart
packages/flutter/lib/src/widgets/widget_inspector.dart
+12
-8
No files found.
packages/flutter/lib/src/widgets/widget_inspector.dart
View file @
a3bcaf22
...
...
@@ -1525,7 +1525,7 @@ mixin WidgetInspectorService {
if
(
location
==
null
||
location
.
file
==
null
)
{
return
false
;
}
final
String
file
=
Uri
.
parse
(
location
.
file
).
path
;
final
String
file
=
Uri
.
parse
(
location
.
file
!
).
path
;
// By default check whether the creation location was within package:flutter.
if
(
_pubRootDirectories
==
null
)
{
...
...
@@ -2122,12 +2122,14 @@ class _ElementLocationStatsTracker {
final
Map
<
String
,
List
<
int
>>
locationsJson
=
<
String
,
List
<
int
>>{};
for
(
final
_LocationCount
entry
in
newLocations
)
{
final
_Location
location
=
entry
.
location
;
if
(
location
.
file
!=
null
)
{
final
List
<
int
>
jsonForFile
=
locationsJson
.
putIfAbsent
(
location
.
file
,
location
.
file
!
,
()
=>
<
int
>[],
);
jsonForFile
..
add
(
entry
.
id
)..
add
(
location
.
line
)..
add
(
location
.
column
);
}
}
json
[
'newLocations'
]
=
locationsJson
;
}
resetCounts
();
...
...
@@ -2844,7 +2846,7 @@ class _Location {
});
/// File path of the location.
final
String
file
;
final
String
?
file
;
/// 1-based line number.
final
int
line
;
...
...
@@ -2880,7 +2882,9 @@ class _Location {
if
(
name
!=
null
)
{
parts
.
add
(
name
!);
}
parts
.
add
(
file
);
if
(
file
!=
null
)
{
parts
.
add
(
file
!);
}
parts
..
add
(
'
$line
'
)..
add
(
'
$column
'
);
return
parts
.
join
(
':'
);
}
...
...
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