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
d1411a16
Unverified
Commit
d1411a16
authored
Jul 24, 2020
by
Kate Lovett
Committed by
GitHub
Jul 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused FlutterErrorDetails subclasses (#61579)
parent
c6dce231
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
88 deletions
+22
-88
pointer_router.dart
packages/flutter/lib/src/gestures/pointer_router.dart
+4
-50
debug_overflow_indicator.dart
...s/flutter/lib/src/rendering/debug_overflow_indicator.dart
+1
-2
object.dart
packages/flutter/lib/src/rendering/object.dart
+1
-31
pointer_router_test.dart
packages/flutter/test/gestures/pointer_router_test.dart
+11
-0
widget_inspector_init_with_structured_error_test.dart
...ets/widget_inspector_init_with_structured_error_test.dart
+1
-1
widget_inspector_structure_error_test.dart
...r/test/widgets/widget_inspector_structure_error_test.dart
+1
-1
widget_inspector_test.dart
packages/flutter/test/widgets/widget_inspector_test.dart
+3
-3
No files found.
packages/flutter/lib/src/gestures/pointer_router.dart
View file @
d1411a16
...
...
@@ -80,18 +80,17 @@ class PointerRouter {
InformationCollector
collector
;
assert
(()
{
collector
=
()
sync
*
{
yield
DiagnosticsProperty
<
PointerEvent
>(
'Event'
,
event
,
style:
DiagnosticsTreeStyle
.
errorProperty
);
yield
DiagnosticsProperty
<
PointerRouter
>(
'router'
,
this
,
level:
DiagnosticLevel
.
debug
);
yield
DiagnosticsProperty
<
PointerRoute
>(
'route'
,
route
,
level:
DiagnosticLevel
.
debug
);
yield
DiagnosticsProperty
<
PointerEvent
>(
'event'
,
event
,
level:
DiagnosticLevel
.
debug
);
};
return
true
;
}());
FlutterError
.
reportError
(
FlutterErrorDetails
ForPointerRouter
(
FlutterError
.
reportError
(
FlutterErrorDetails
(
exception:
exception
,
stack:
stack
,
library
:
'gesture library'
,
context:
ErrorDescription
(
'while routing a pointer event'
),
router:
this
,
route:
route
,
event:
event
,
informationCollector:
collector
));
}
...
...
@@ -126,48 +125,3 @@ class PointerRouter {
});
}
}
/// Variant of [FlutterErrorDetails] with extra fields for the gestures
/// library's pointer router ([PointerRouter]).
///
/// See also:
///
/// * [FlutterErrorDetailsForPointerEventDispatcher], which is also used
/// by the gestures library.
class
FlutterErrorDetailsForPointerRouter
extends
FlutterErrorDetails
{
/// Creates a [FlutterErrorDetailsForPointerRouter] object with the given
/// arguments setting the object's properties.
///
/// The gestures library calls this constructor when catching an exception
/// that will subsequently be reported using [FlutterError.onError].
const
FlutterErrorDetailsForPointerRouter
({
dynamic
exception
,
StackTrace
stack
,
String
library
,
DiagnosticsNode
context
,
this
.
router
,
this
.
route
,
this
.
event
,
InformationCollector
informationCollector
,
bool
silent
=
false
,
})
:
super
(
exception:
exception
,
stack:
stack
,
library
:
library
,
context:
context
,
informationCollector:
informationCollector
,
silent:
silent
,
);
/// The pointer router that caught the exception.
///
/// In a typical application, this is the value of [GestureBinding.pointerRouter] on
/// the binding ([GestureBinding.instance]).
final
PointerRouter
router
;
/// The callback that threw the exception.
final
PointerRoute
route
;
/// The pointer event that was being routed when the exception was raised.
final
PointerEvent
event
;
}
packages/flutter/lib/src/rendering/debug_overflow_indicator.dart
View file @
d1411a16
...
...
@@ -242,11 +242,10 @@ mixin DebugOverflowIndicatorMixin on RenderObject {
// TODO(jacobr): add the overflows in pixels as structured data so they can
// be visualized in debugging tools.
FlutterError
.
reportError
(
FlutterErrorDetails
ForRendering
(
FlutterErrorDetails
(
exception:
FlutterError
(
'A
$runtimeType
overflowed by
$overflowText
.'
),
library
:
'rendering library'
,
context:
ErrorDescription
(
'during layout'
),
renderObject:
this
,
informationCollector:
()
sync
*
{
if
(
debugCreator
!=
null
)
yield
DiagnosticsDebugCreator
(
debugCreator
);
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
d1411a16
...
...
@@ -1319,12 +1319,11 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
dynamic
debugCreator
;
void
_debugReportException
(
String
method
,
dynamic
exception
,
StackTrace
stack
)
{
FlutterError
.
reportError
(
FlutterErrorDetails
ForRendering
(
FlutterError
.
reportError
(
FlutterErrorDetails
(
exception:
exception
,
stack:
stack
,
library
:
'rendering library'
,
context:
ErrorDescription
(
'during
$method
()'
),
renderObject:
this
,
informationCollector:
()
sync
*
{
if
(
debugCreator
!=
null
)
yield
DiagnosticsDebugCreator
(
debugCreator
);
...
...
@@ -3384,35 +3383,6 @@ mixin RelayoutWhenSystemFontsChangeMixin on RenderObject {
}
}
/// Variant of [FlutterErrorDetails] with extra fields for the rendering
/// library.
class
FlutterErrorDetailsForRendering
extends
FlutterErrorDetails
{
/// Creates a [FlutterErrorDetailsForRendering] object with the given
/// arguments setting the object's properties.
///
/// The rendering library calls this constructor when catching an exception
/// that will subsequently be reported using [FlutterError.onError].
const
FlutterErrorDetailsForRendering
({
dynamic
exception
,
StackTrace
stack
,
String
library
,
DiagnosticsNode
context
,
this
.
renderObject
,
InformationCollector
informationCollector
,
bool
silent
=
false
,
})
:
super
(
exception:
exception
,
stack:
stack
,
library
:
library
,
context:
context
,
informationCollector:
informationCollector
,
silent:
silent
,
);
/// The RenderObject that was being processed when the exception was caught.
final
RenderObject
renderObject
;
}
/// Describes the semantics information a [RenderObject] wants to add to its
/// parent.
///
...
...
packages/flutter/test/gestures/pointer_router_test.dart
View file @
d1411a16
...
...
@@ -153,6 +153,17 @@ void main() {
FlutterError
.
onError
=
previousErrorHandler
;
});
test
(
'Exceptions include router, route & event'
,
()
{
try
{
final
PointerRouter
router
=
PointerRouter
();
router
.
addRoute
(
2
,
(
PointerEvent
event
)
=>
throw
'Pointer exception'
);
}
catch
(
e
)
{
expect
(
e
,
contains
(
'router: Instance of
\'
PointerRouter
\'
'
));
expect
(
e
,
contains
(
'route: Closure: (PointerEvent) => Null'
));
expect
(
e
,
contains
(
'event: PointerDownEvent#[a-zA-Z0-9]{5}(position: Offset(0.0, 0.0))'
));
}
});
test
(
'Should transform events'
,
()
{
final
List
<
PointerEvent
>
events
=
<
PointerEvent
>[];
final
List
<
PointerEvent
>
globalEvents
=
<
PointerEvent
>[];
...
...
packages/flutter/test/widgets/widget_inspector_init_with_structured_error_test.dart
View file @
d1411a16
...
...
@@ -47,7 +47,7 @@ class StructuredErrorTestService extends TestWidgetInspectorService {
expect
(
flutterErrorEvents
,
hasLength
(
0
));
// Create an error.
FlutterError
.
reportError
(
FlutterErrorDetails
ForRendering
(
FlutterError
.
reportError
(
FlutterErrorDetails
(
library
:
'rendering library'
,
context:
ErrorDescription
(
'during layout'
),
exception:
StackTrace
.
current
,
...
...
packages/flutter/test/widgets/widget_inspector_structure_error_test.dart
View file @
d1411a16
...
...
@@ -76,7 +76,7 @@ class StructureErrorTestWidgetInspectorService extends Object with WidgetInspect
equals
(
'true'
));
// Creates an error.
final
FlutterErrorDetails
expectedError
=
FlutterErrorDetails
ForRendering
(
final
FlutterErrorDetails
expectedError
=
FlutterErrorDetails
(
library
:
'rendering library'
,
context:
ErrorDescription
(
'during layout'
),
exception:
StackTrace
.
current
,
...
...
packages/flutter/test/widgets/widget_inspector_test.dart
View file @
d1411a16
...
...
@@ -2356,7 +2356,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
equals
(
'true'
));
// Create an error.
FlutterError
.
reportError
(
FlutterErrorDetails
ForRendering
(
FlutterError
.
reportError
(
FlutterErrorDetails
(
library
:
'rendering library'
,
context:
ErrorDescription
(
'during layout'
),
exception:
StackTrace
.
current
,
...
...
@@ -2379,7 +2379,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
'══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞════════════'
));
// Send a second error.
FlutterError
.
reportError
(
FlutterErrorDetails
ForRendering
(
FlutterError
.
reportError
(
FlutterErrorDetails
(
library
:
'rendering library'
,
context:
ErrorDescription
(
'also during layout'
),
exception:
StackTrace
.
current
,
...
...
@@ -2407,7 +2407,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
binding
.
postTest
();
// Send another error.
FlutterError
.
reportError
(
FlutterErrorDetails
ForRendering
(
FlutterError
.
reportError
(
FlutterErrorDetails
(
library
:
'rendering library'
,
context:
ErrorDescription
(
'during layout'
),
exception:
StackTrace
.
current
,
...
...
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