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
514fb2c7
Unverified
Commit
514fb2c7
authored
Apr 30, 2019
by
Jonah Williams
Committed by
GitHub
Apr 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "fix edge swiping and dropping back at starting point (#31623)" (#31876)
parent
4bc35fc8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
72 deletions
+0
-72
route.dart
packages/flutter/lib/src/cupertino/route.dart
+0
-3
route_test.dart
packages/flutter/test/cupertino/route_test.dart
+0
-69
No files found.
packages/flutter/lib/src/cupertino/route.dart
View file @
514fb2c7
...
...
@@ -621,7 +621,6 @@ class _CupertinoBackGestureController<T> {
animateForward
=
velocity
>
0
?
false
:
true
;
else
animateForward
=
controller
.
value
>
0.5
?
true
:
false
;
if
(
animateForward
)
{
// The closer the panel is to dismissing, the shorter the animation is.
// We want to cap the animation time, but we want to use a linear curve
...
...
@@ -653,8 +652,6 @@ class _CupertinoBackGestureController<T> {
controller
.
removeStatusListener
(
animationStatusCallback
);
};
controller
.
addStatusListener
(
animationStatusCallback
);
}
else
{
navigator
.
didStopUserGesture
();
}
}
}
...
...
packages/flutter/test/cupertino/route_test.dart
View file @
514fb2c7
...
...
@@ -351,10 +351,6 @@ void main() {
await
tester
.
pumpAndSettle
();
expect
(
find
.
text
(
'route'
),
findsOneWidget
);
expect
(
find
.
text
(
'push'
),
findsNothing
);
expect
(
tester
.
state
<
NavigatorState
>(
find
.
byType
(
Navigator
)).
userGestureInProgress
,
false
,
);
});
testWidgets
(
'Fullscreen route animates correct transform values over time'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -540,10 +536,6 @@ void main() {
await
tester
.
pump
();
expect
(
tester
.
getTopLeft
(
find
.
text
(
'1'
)).
dx
,
moreOrLessEquals
(-
233
,
epsilon:
1
));
expect
(
tester
.
getTopLeft
(
find
.
text
(
'2'
)).
dx
,
moreOrLessEquals
(
100
));
expect
(
tester
.
state
<
NavigatorState
>(
find
.
byType
(
Navigator
)).
userGestureInProgress
,
true
,
);
await
swipeGesture
.
moveBy
(
const
Offset
(
100
,
0
));
await
tester
.
pump
();
...
...
@@ -584,10 +576,6 @@ void main() {
await
tester
.
pump
();
expect
(
tester
.
getTopLeft
(
find
.
text
(
'1'
)).
dx
,
moreOrLessEquals
(-
100
));
expect
(
tester
.
getTopLeft
(
find
.
text
(
'2'
)).
dx
,
moreOrLessEquals
(
500
));
expect
(
tester
.
state
<
NavigatorState
>(
find
.
byType
(
Navigator
)).
userGestureInProgress
,
true
,
);
await
tester
.
pump
(
const
Duration
(
milliseconds:
50
));
expect
(
tester
.
getTopLeft
(
find
.
text
(
'1'
)).
dx
,
moreOrLessEquals
(-
19
,
epsilon:
1
));
...
...
@@ -597,12 +585,6 @@ void main() {
// Rate of change is slowing down.
expect
(
tester
.
getTopLeft
(
find
.
text
(
'1'
)).
dx
,
moreOrLessEquals
(-
4
,
epsilon:
1
));
expect
(
tester
.
getTopLeft
(
find
.
text
(
'2'
)).
dx
,
moreOrLessEquals
(
787
,
epsilon:
1
));
await
tester
.
pumpAndSettle
();
expect
(
tester
.
state
<
NavigatorState
>(
find
.
byType
(
Navigator
)).
userGestureInProgress
,
false
,
);
});
testWidgets
(
'Snapped drags forwards and backwards should signal didStart/StopUserGesture'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -685,63 +667,12 @@ void main() {
final
TestGesture
gesture
=
await
tester
.
startGesture
(
const
Offset
(
5
,
200
));
// The width of the page.
await
gesture
.
moveBy
(
const
Offset
(
800
,
0
));
verify
(
navigatorObserver
.
didStartUserGesture
(
any
,
any
)).
called
(
1
);
await
gesture
.
up
();
await
tester
.
pump
();
expect
(
find
.
text
(
'Page 1'
),
isOnstage
);
expect
(
find
.
text
(
'Page 2'
),
findsNothing
);
verify
(
navigatorObserver
.
didPop
(
any
,
any
)).
called
(
1
);
verify
(
navigatorObserver
.
didStopUserGesture
()).
called
(
1
);
});
testWidgets
(
'test edge swipe then drop back at starting point works'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
CupertinoApp
(
navigatorObservers:
<
NavigatorObserver
>[
navigatorObserver
],
onGenerateRoute:
(
RouteSettings
settings
)
{
return
CupertinoPageRoute
<
void
>(
settings:
settings
,
builder:
(
BuildContext
context
)
{
final
String
pageNumber
=
settings
.
name
==
'/'
?
'1'
:
'2'
;
return
Center
(
child:
Text
(
'Page
$pageNumber
'
));
},
);
},
),
);
tester
.
state
<
NavigatorState
>(
find
.
byType
(
Navigator
)).
pushNamed
(
'/next'
);
await
tester
.
pump
();
await
tester
.
pump
(
const
Duration
(
seconds:
1
));
expect
(
find
.
text
(
'Page 1'
),
findsNothing
);
expect
(
find
.
text
(
'Page 2'
),
isOnstage
);
final
TestGesture
gesture
=
await
tester
.
startGesture
(
const
Offset
(
5
,
200
));
// Move right a bit
await
gesture
.
moveBy
(
const
Offset
(
300
,
0
));
verify
(
navigatorObserver
.
didStartUserGesture
(
any
,
any
)).
called
(
1
);
expect
(
tester
.
state
<
NavigatorState
>(
find
.
byType
(
Navigator
)).
userGestureInProgress
,
true
,
);
await
tester
.
pump
();
// Move back to where we started.
await
gesture
.
moveBy
(
const
Offset
(-
300
,
0
));
await
gesture
.
up
();
await
tester
.
pump
();
expect
(
find
.
text
(
'Page 1'
),
findsNothing
);
expect
(
find
.
text
(
'Page 2'
),
isOnstage
);
verifyNever
(
navigatorObserver
.
didPop
(
any
,
any
));
verify
(
navigatorObserver
.
didStopUserGesture
()).
called
(
1
);
expect
(
tester
.
state
<
NavigatorState
>(
find
.
byType
(
Navigator
)).
userGestureInProgress
,
false
,
);
});
}
...
...
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