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
9423a012
Unverified
Commit
9423a012
authored
Oct 14, 2019
by
chunhtai
Committed by
GitHub
Oct 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix flutter error report correct local widget (#41224)
parent
532a8fed
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
6 deletions
+68
-6
print_correct_local_widget_expectation.txt
...s/flutter_test/print_correct_local_widget_expectation.txt
+10
-0
print_correct_local_widget_test.dart
...d_tests/flutter_test/print_correct_local_widget_test.dart
+44
-0
print_user_created_ancestor_expectation.txt
.../flutter_test/print_user_created_ancestor_expectation.txt
+1
-1
widget_inspector.dart
packages/flutter/lib/src/widgets/widget_inspector.dart
+7
-5
test_test.dart
...lutter_tools/test/commands.shard/permeable/test_test.dart
+6
-0
No files found.
dev/automated_tests/flutter_test/print_correct_local_widget_expectation.txt
0 → 100644
View file @
9423a012
<<skip until matching line>>
══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
The following assertion was thrown during layout:
A RenderFlex overflowed by 2844 pixels on the right\.
The relevant error-causing widget was:
Row
file:\/\/\/.+print_correct_local_widget_test\.dart:[0-9]+:[0-9]+
The overflowing RenderFlex has an orientation of Axis.horizontal\.
dev/automated_tests/flutter_test/print_correct_local_widget_test.dart
0 → 100644
View file @
9423a012
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/widgets.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
testWidgets
(
'Rendering Error'
,
(
WidgetTester
tester
)
async
{
// This should fail with user created widget = Row.
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'RenderFlex OverFlow'
),
),
body:
Container
(
width:
400.0
,
child:
Row
(
children:
<
Widget
>[
Icon
(
Icons
.
message
),
Column
(
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
const
<
Widget
>[
Text
(
'Title'
),
Text
(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed'
'do eiusmod tempor incididunt ut labore et dolore magna '
'aliqua. Ut enim ad minim veniam, quis nostrud '
'exercitation ullamco laboris nisi ut aliquip ex ea '
'commodo consequat.'
),
],
),
],
),
),
),
)
);
});
}
dev/automated_tests/flutter_test/print_user_created_ancestor_expectation.txt
View file @
9423a012
...
...
@@ -9,7 +9,7 @@ more information in this error message to help you determine and fix the underly
In either case, please report this assertion by filing a bug on GitHub:
https:\/\/github\.com\/flutter\/flutter\/issues\/new\?template=BUG\.md
User-created ancestor of the
error-causing widget was:
The relevant
error-causing widget was:
CustomScrollView
file:\/\/\/.+print_user_created_ancestor_test\.dart:[0-9]+:7
...
...
packages/flutter/lib/src/widgets/widget_inspector.dart
View file @
9423a012
...
...
@@ -2806,15 +2806,15 @@ Iterable<DiagnosticsNode> _describeRelevantUserCode(Element element) {
];
}
final
List
<
DiagnosticsNode
>
nodes
=
<
DiagnosticsNode
>[];
element
.
visitAncestorElements
((
Element
ancestor
)
{
bool
processElement
(
Element
target
)
{
// TODO(chunhtai): should print out all the widgets that are about to cross
// package boundaries.
if
(
_isLocalCreationLocation
(
ancestor
))
{
if
(
_isLocalCreationLocation
(
target
))
{
nodes
.
add
(
DiagnosticsBlock
(
name:
'
User-created ancestor of the
error-causing widget was'
,
name:
'
The relevant
error-causing widget was'
,
children:
<
DiagnosticsNode
>[
ErrorDescription
(
'
${
ancestor.widget.toStringShort()}
${_describeCreationLocation(ancestor
)}
'
),
ErrorDescription
(
'
${
target.widget.toStringShort()}
${_describeCreationLocation(target
)}
'
),
],
),
);
...
...
@@ -2822,7 +2822,9 @@ Iterable<DiagnosticsNode> _describeRelevantUserCode(Element element) {
return
false
;
}
return
true
;
});
}
if
(
processElement
(
element
))
element
.
visitAncestorElements
(
processElement
);
return
nodes
;
}
...
...
packages/flutter_tools/test/commands.shard/permeable/test_test.dart
View file @
9423a012
...
...
@@ -65,6 +65,12 @@ void main() {
return
_testFile
(
'print_user_created_ancestor_no_flag'
,
automatedTestsDirectory
,
flutterTestDirectory
);
},
skip:
io
.
Platform
.
isWindows
);
// TODO(chunhtai): Dart on Windows has trouble with unicode characters in output (#35425).
testUsingContext
(
'report correct created widget caused the error'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
return
_testFile
(
'print_correct_local_widget'
,
automatedTestsDirectory
,
flutterTestDirectory
,
extraArguments:
const
<
String
>[
'--track-widget-creation'
]);
},
skip:
io
.
Platform
.
isWindows
);
// TODO(chunhtai): Dart on Windows has trouble with unicode characters in output (#35425).
testUsingContext
(
'can load assets within its own package'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
return
_testFile
(
'package_assets'
,
automatedTestsDirectory
,
flutterTestDirectory
,
exitCode:
isZero
);
...
...
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