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
f32dee6e
Unverified
Commit
f32dee6e
authored
Dec 19, 2019
by
Lau Ching Jun
Committed by
GitHub
Dec 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fix sliver geometry assert (#47027)" (#47390)
This reverts commit
117dfaf2
.
parent
c2813693
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
61 deletions
+6
-61
sliver.dart
packages/flutter/lib/src/rendering/sliver.dart
+4
-4
sliver_persistent_header.dart
...s/flutter/lib/src/rendering/sliver_persistent_header.dart
+2
-3
refresh_test.dart
packages/flutter/test/cupertino/refresh_test.dart
+0
-54
No files found.
packages/flutter/lib/src/rendering/sliver.dart
View file @
f32dee6e
...
@@ -1211,17 +1211,17 @@ abstract class RenderSliver extends RenderObject {
...
@@ -1211,17 +1211,17 @@ abstract class RenderSliver extends RenderObject {
}
}
));
));
assert
(()
{
assert
(()
{
if
(
geometry
.
paint
Origin
+
geometry
.
paint
Extent
>
constraints
.
remainingPaintExtent
)
{
if
(
geometry
.
paintExtent
>
constraints
.
remainingPaintExtent
)
{
throw
FlutterError
.
fromParts
(<
DiagnosticsNode
>[
throw
FlutterError
.
fromParts
(<
DiagnosticsNode
>[
ErrorSummary
(
'SliverGeometry has a paintOffset that exceeds the remainingPaintExtent from the constraints.'
),
ErrorSummary
(
'SliverGeometry has a paintOffset that exceeds the remainingPaintExtent from the constraints.'
),
describeForError
(
'The render object whose geometry violates the constraints is the following'
),
describeForError
(
'The render object whose geometry violates the constraints is the following'
),
...
_debugCompareFloats
(
...
_debugCompareFloats
(
'remainingPaintExtent'
,
constraints
.
remainingPaintExtent
,
'remainingPaintExtent'
,
constraints
.
remainingPaintExtent
,
'paint
Origin + paintExtent'
,
geometry
.
paintOrigin
+
geometry
.
paintExtent
,
'paint
Extent'
,
geometry
.
paintExtent
,
),
),
ErrorDescription
(
ErrorDescription
(
'The paint
Origin and paintExtent must cause the child sliver to paint
'
'The paint
Extent must cause the child sliver to paint within the viewport, and so
'
'
within the viewport, and so
cannot exceed the remainingPaintExtent.'
,
'cannot exceed the remainingPaintExtent.'
,
),
),
]);
]);
}
}
...
...
packages/flutter/lib/src/rendering/sliver_persistent_header.dart
View file @
f32dee6e
...
@@ -373,15 +373,14 @@ abstract class RenderSliverPinnedPersistentHeader extends RenderSliverPersistent
...
@@ -373,15 +373,14 @@ abstract class RenderSliverPinnedPersistentHeader extends RenderSliverPersistent
final
bool
overlapsContent
=
constraints
.
overlap
>
0.0
;
final
bool
overlapsContent
=
constraints
.
overlap
>
0.0
;
excludeFromSemanticsScrolling
=
overlapsContent
||
(
constraints
.
scrollOffset
>
maxExtent
-
minExtent
);
excludeFromSemanticsScrolling
=
overlapsContent
||
(
constraints
.
scrollOffset
>
maxExtent
-
minExtent
);
layoutChild
(
constraints
.
scrollOffset
,
maxExtent
,
overlapsContent:
overlapsContent
);
layoutChild
(
constraints
.
scrollOffset
,
maxExtent
,
overlapsContent:
overlapsContent
);
final
double
effectiveRemainingPaintExtent
=
math
.
max
(
0
,
constraints
.
remainingPaintExtent
-
constraints
.
overlap
);
final
double
layoutExtent
=
(
maxExtent
-
constraints
.
scrollOffset
).
clamp
(
0.0
,
constraints
.
remainingPaintExtent
)
as
double
;
final
double
layoutExtent
=
(
maxExtent
-
constraints
.
scrollOffset
).
clamp
(
0.0
,
effectiveRemainingPaintExtent
)
as
double
;
final
double
stretchOffset
=
stretchConfiguration
!=
null
?
final
double
stretchOffset
=
stretchConfiguration
!=
null
?
constraints
.
overlap
.
abs
()
:
constraints
.
overlap
.
abs
()
:
0.0
;
0.0
;
geometry
=
SliverGeometry
(
geometry
=
SliverGeometry
(
scrollExtent:
maxExtent
,
scrollExtent:
maxExtent
,
paintOrigin:
constraints
.
overlap
,
paintOrigin:
constraints
.
overlap
,
paintExtent:
math
.
min
(
childExtent
,
effectiveR
emainingPaintExtent
),
paintExtent:
math
.
min
(
childExtent
,
constraints
.
r
emainingPaintExtent
),
layoutExtent:
layoutExtent
,
layoutExtent:
layoutExtent
,
maxPaintExtent:
maxExtent
+
stretchOffset
,
maxPaintExtent:
maxExtent
+
stretchOffset
,
maxScrollObstructionExtent:
minExtent
,
maxScrollObstructionExtent:
minExtent
,
...
...
packages/flutter/test/cupertino/refresh_test.dart
View file @
f32dee6e
...
@@ -1028,30 +1028,6 @@ void main() {
...
@@ -1028,30 +1028,6 @@ void main() {
debugDefaultTargetPlatformOverride
=
null
;
debugDefaultTargetPlatformOverride
=
null
;
},
},
);
);
testWidgets
(
'Should not crash when dragged'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
CustomScrollView
(
physics:
const
BouncingScrollPhysics
(),
slivers:
<
Widget
>[
CupertinoSliverRefreshControl
(
onRefresh:
()
async
=>
Future
<
void
>.
delayed
(
const
Duration
(
days:
2000
)),
),
],
),
),
);
await
tester
.
dragFrom
(
const
Offset
(
100
,
10
),
const
Offset
(
0.0
,
50.0
),
touchSlopY:
0
);
await
tester
.
pump
();
await
tester
.
dragFrom
(
const
Offset
(
100
,
10
),
const
Offset
(
0
,
500
),
touchSlopY:
0
);
await
tester
.
pump
();
expect
(
tester
.
takeException
(),
isNull
);
});
};
};
final
VoidCallback
stateMachineTestGroup
=
()
{
final
VoidCallback
stateMachineTestGroup
=
()
{
...
@@ -1489,36 +1465,6 @@ void main() {
...
@@ -1489,36 +1465,6 @@ void main() {
// Test the internal state machine directly to make sure the UI aren't just
// Test the internal state machine directly to make sure the UI aren't just
// correct by coincidence.
// correct by coincidence.
group
(
'state machine test short list'
,
stateMachineTestGroup
);
group
(
'state machine test short list'
,
stateMachineTestGroup
);
testWidgets
(
'Does not crash when paintExtent > remainingPaintExtent'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/46871.
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
CustomScrollView
(
physics:
const
BouncingScrollPhysics
(),
slivers:
<
Widget
>[
const
CupertinoSliverRefreshControl
(),
SliverList
(
delegate:
SliverChildBuilderDelegate
(
(
BuildContext
context
,
int
index
)
=>
const
SizedBox
(
height:
100
),
childCount:
20
,
),
),
],
),
),
);
// Drag the content down far enough so that
// geometry.paintExent > constraints.maxPaintExtent
await
tester
.
dragFrom
(
const
Offset
(
10
,
10
),
const
Offset
(
0
,
500
));
await
tester
.
pump
();
expect
(
tester
.
takeException
(),
isNull
);
});
}
}
class
MockHelper
extends
Mock
{
class
MockHelper
extends
Mock
{
...
...
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