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
a0b560f4
Unverified
Commit
a0b560f4
authored
Aug 31, 2021
by
LongCatIsLooong
Committed by
GitHub
Aug 31, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround rounding erros in cupertino nav bar transition (#88935)
parent
a3a77ac9
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
187 additions
and
68 deletions
+187
-68
nav_bar.dart
packages/flutter/lib/src/cupertino/nav_bar.dart
+141
-66
stack.dart
packages/flutter/lib/src/rendering/stack.dart
+2
-2
nav_bar_transition_test.dart
packages/flutter/test/cupertino/nav_bar_transition_test.dart
+44
-0
No files found.
packages/flutter/lib/src/cupertino/nav_bar.dart
View file @
a0b560f4
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/rendering/stack.dart
View file @
a0b560f4
...
...
@@ -496,7 +496,7 @@ class RenderStack extends RenderBox
child
.
layout
(
childConstraints
,
parentUsesSize:
true
);
late
final
double
x
;
final
double
x
;
if
(
childParentData
.
left
!=
null
)
{
x
=
childParentData
.
left
!;
}
else
if
(
childParentData
.
right
!=
null
)
{
...
...
@@ -508,7 +508,7 @@ class RenderStack extends RenderBox
if
(
x
<
0.0
||
x
+
child
.
size
.
width
>
size
.
width
)
hasVisualOverflow
=
true
;
late
final
double
y
;
final
double
y
;
if
(
childParentData
.
top
!=
null
)
{
y
=
childParentData
.
top
!;
}
else
if
(
childParentData
.
bottom
!=
null
)
{
...
...
packages/flutter/test/cupertino/nav_bar_transition_test.dart
View file @
a0b560f4
...
...
@@ -171,6 +171,27 @@ void main() {
);
});
testWidgets
(
'Bottom middle never changes size during the animation'
,
(
WidgetTester
tester
)
async
{
await
tester
.
binding
.
setSurfaceSize
(
const
Size
(
1080.0
/
2.75
,
600
));
addTearDown
(()
async
{
await
tester
.
binding
.
setSurfaceSize
(
const
Size
(
800.0
,
600.0
));
});
await
startTransitionBetween
(
tester
,
fromTitle:
'Page 1'
,
);
final
Size
size
=
tester
.
getSize
(
find
.
text
(
'Page 1'
));
for
(
int
i
=
0
;
i
<
150
;
i
++)
{
await
tester
.
pump
(
const
Duration
(
milliseconds:
1
));
expect
(
flying
(
tester
,
find
.
text
(
'Page 1'
)),
findsNWidgets
(
2
));
expect
(
tester
.
getSize
(
flying
(
tester
,
find
.
text
(
'Page 1'
)).
first
),
size
);
expect
(
tester
.
getSize
(
flying
(
tester
,
find
.
text
(
'Page 1'
)).
last
),
size
);
}
});
testWidgets
(
'Bottom middle and top back label transitions their font'
,
(
WidgetTester
tester
)
async
{
await
startTransitionBetween
(
tester
,
fromTitle:
'Page 1'
);
...
...
@@ -978,6 +999,29 @@ void main() {
);
});
testWidgets
(
'Top middle never changes size during the animation'
,
(
WidgetTester
tester
)
async
{
await
tester
.
binding
.
setSurfaceSize
(
const
Size
(
1080.0
/
2.75
,
600
));
addTearDown
(()
async
{
await
tester
.
binding
.
setSurfaceSize
(
const
Size
(
800.0
,
600.0
));
});
await
startTransitionBetween
(
tester
,
toTitle:
'Page 2'
,
);
Size
?
previousSize
;
for
(
int
i
=
0
;
i
<
150
;
i
++)
{
await
tester
.
pump
(
const
Duration
(
milliseconds:
1
));
expect
(
flying
(
tester
,
find
.
text
(
'Page 2'
)),
findsOneWidget
);
final
Size
size
=
tester
.
getSize
(
flying
(
tester
,
find
.
text
(
'Page 2'
)));
if
(
previousSize
!=
null
)
expect
(
size
,
previousSize
);
previousSize
=
size
;
}
});
testWidgets
(
'Top middle fades in and slides in from the left in RTL'
,
(
WidgetTester
tester
)
async
{
await
startTransitionBetween
(
tester
,
...
...
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