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
42d3464d
Unverified
Commit
42d3464d
authored
Apr 11, 2019
by
Dan Field
Committed by
GitHub
Apr 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let `sliver.dart` `_createErrorWidget` work with other Widgets (#30880)
Credit to @ymback
parent
2736c8c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
sliver.dart
packages/flutter/lib/src/widgets/sliver.dart
+2
-2
slivers_test.dart
packages/flutter/test/widgets/slivers_test.dart
+15
-0
No files found.
packages/flutter/lib/src/widgets/sliver.dart
View file @
42d3464d
...
...
@@ -1291,8 +1291,8 @@ class KeepAlive extends ParentDataWidget<SliverWithKeepAliveWidget> {
}
}
// Return a
n Error
Widget for the given Exception
Error
Widget
_createErrorWidget
(
dynamic
exception
,
StackTrace
stackTrace
)
{
// Return a
Widget for the given Exception
Widget
_createErrorWidget
(
dynamic
exception
,
StackTrace
stackTrace
)
{
final
FlutterErrorDetails
details
=
FlutterErrorDetails
(
exception:
exception
,
stack:
stackTrace
,
...
...
packages/flutter/test/widgets/slivers_test.dart
View file @
42d3464d
...
...
@@ -195,4 +195,19 @@ void main() {
expect
(
find
.
text
(
'B'
),
findsNothing
);
expect
(
find
.
text
(
'BOTTOM'
),
findsOneWidget
);
});
testWidgets
(
'Can override ErrorWidget.build'
,
(
WidgetTester
tester
)
async
{
const
Text
errorText
=
Text
(
'error'
);
final
ErrorWidgetBuilder
oldBuilder
=
ErrorWidget
.
builder
;
ErrorWidget
.
builder
=
(
FlutterErrorDetails
details
)
=>
errorText
;
final
SliverChildBuilderDelegate
builderThrowsDelegate
=
SliverChildBuilderDelegate
(
(
_
,
__
)
=>
throw
'builder'
,
addAutomaticKeepAlives:
false
,
addRepaintBoundaries:
false
,
addSemanticIndexes:
false
,
);
expect
(
builderThrowsDelegate
.
build
(
null
,
0
),
errorText
);
expect
(
tester
.
takeException
(),
'builder'
);
ErrorWidget
.
builder
=
oldBuilder
;
});
}
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