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
8469896c
Unverified
Commit
8469896c
authored
Oct 28, 2022
by
xubaolin
Committed by
GitHub
Oct 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix DDS do not support Curves.easeInOutBack curve (#114222)
parent
cdbb1e60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
10 deletions
+34
-10
draggable_scrollable_sheet.dart
...s/flutter/lib/src/widgets/draggable_scrollable_sheet.dart
+10
-7
draggable_scrollable_sheet_test.dart
...flutter/test/widgets/draggable_scrollable_sheet_test.dart
+24
-3
No files found.
packages/flutter/lib/src/widgets/draggable_scrollable_sheet.dart
View file @
8469896c
...
...
@@ -136,13 +136,12 @@ class DraggableScrollableController extends ChangeNotifier {
animationController
.
value
,
_attachedController
!.
position
.
context
.
notificationContext
!,
);
if
(
animationController
.
value
>
_attachedController
!.
extent
.
maxSize
||
animationController
.
value
<
_attachedController
!.
extent
.
minSize
)
{
// Animation hit the max or min size, stop animating.
animationController
.
stop
(
canceled:
false
);
}
});
await
animationController
.
animateTo
(
size
,
duration:
duration
,
curve:
curve
);
await
animationController
.
animateTo
(
clampDouble
(
size
,
_attachedController
!.
extent
.
minSize
,
_attachedController
!.
extent
.
maxSize
),
duration:
duration
,
curve:
curve
,
);
}
/// Jumps the attached sheet from its current size to the given [size], a
...
...
@@ -579,7 +578,11 @@ class _DraggableSheetExtent {
/// or a user drag.
void
updateSize
(
double
newSize
,
BuildContext
context
)
{
assert
(
newSize
!=
null
);
_currentSize
.
value
=
clampDouble
(
newSize
,
minSize
,
maxSize
);
final
double
clampedSize
=
clampDouble
(
newSize
,
minSize
,
maxSize
);
if
(
_currentSize
.
value
==
clampedSize
)
{
return
;
}
_currentSize
.
value
=
clampedSize
;
DraggableScrollableNotification
(
minExtent:
minSize
,
maxExtent:
maxSize
,
...
...
packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart
View file @
8469896c
...
...
@@ -950,9 +950,7 @@ void main() {
goTo
(.
5
);
await
tester
.
pumpAndSettle
();
goTo
(
0
);
// The animation was cut short by half, there should have been on less pumps
final
int
truncatedPumpCount
=
shouldAnimate
?
expectedPumpCount
-
1
:
expectedPumpCount
;
expect
(
await
tester
.
pumpAndSettle
(),
truncatedPumpCount
);
expect
(
await
tester
.
pumpAndSettle
(),
expectedPumpCount
);
expect
(
tester
.
getSize
(
find
.
byKey
(
containerKey
)).
height
/
screenHeight
,
closeTo
(.
25
,
precisionErrorTolerance
),
...
...
@@ -1007,6 +1005,29 @@ void main() {
);
});
testWidgets
(
'Can animateTo with a Curves.easeInOutBack curve begin min-size'
,
(
WidgetTester
tester
)
async
{
const
Key
stackKey
=
ValueKey
<
String
>(
'stack'
);
const
Key
containerKey
=
ValueKey
<
String
>(
'container'
);
final
DraggableScrollableController
controller
=
DraggableScrollableController
();
await
tester
.
pumpWidget
(
boilerplateWidget
(
null
,
initialChildSize:
0.25
,
controller:
controller
,
stackKey:
stackKey
,
containerKey:
containerKey
,
));
await
tester
.
pumpAndSettle
();
final
double
screenHeight
=
tester
.
getSize
(
find
.
byKey
(
stackKey
)).
height
;
controller
.
animateTo
(.
6
,
curve:
Curves
.
easeInOutBack
,
duration:
const
Duration
(
milliseconds:
500
));
await
tester
.
pumpAndSettle
();
expect
(
tester
.
getSize
(
find
.
byKey
(
containerKey
)).
height
/
screenHeight
,
closeTo
(.
6
,
precisionErrorTolerance
),
);
});
testWidgets
(
'Can reuse a controller after the old controller is disposed'
,
(
WidgetTester
tester
)
async
{
const
Key
stackKey
=
ValueKey
<
String
>(
'stack'
);
const
Key
containerKey
=
ValueKey
<
String
>(
'container'
);
...
...
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