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
30784895
Commit
30784895
authored
Feb 20, 2019
by
Ali EP
Committed by
Michael Goderbauer
Feb 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes crossAxisSpacing overflow in RTL (#27945)
parent
d1136e31
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
sliver_grid.dart
packages/flutter/lib/src/rendering/sliver_grid.dart
+1
-1
grid_view_test.dart
packages/flutter/test/widgets/grid_view_test.dart
+28
-0
No files found.
packages/flutter/lib/src/rendering/sliver_grid.dart
View file @
30784895
...
@@ -207,7 +207,7 @@ class SliverGridRegularTileLayout extends SliverGridLayout {
...
@@ -207,7 +207,7 @@ class SliverGridRegularTileLayout extends SliverGridLayout {
double
_getOffsetFromStartInCrossAxis
(
double
crossAxisStart
)
{
double
_getOffsetFromStartInCrossAxis
(
double
crossAxisStart
)
{
if
(
reverseCrossAxis
)
if
(
reverseCrossAxis
)
return
crossAxisCount
*
crossAxisStride
-
crossAxisStart
-
childCrossAxisExtent
;
return
crossAxisCount
*
crossAxisStride
-
crossAxisStart
-
childCrossAxisExtent
-
(
crossAxisStride
-
childCrossAxisExtent
)
;
return
crossAxisStart
;
return
crossAxisStart
;
}
}
...
...
packages/flutter/test/widgets/grid_view_test.dart
View file @
30784895
...
@@ -536,4 +536,32 @@ void main() {
...
@@ -536,4 +536,32 @@ void main() {
expect
(
tester
.
getTopLeft
(
find
.
byKey
(
target
)),
const
Offset
(
600.0
,
0.0
));
expect
(
tester
.
getTopLeft
(
find
.
byKey
(
target
)),
const
Offset
(
600.0
,
0.0
));
expect
(
tester
.
getBottomRight
(
find
.
byKey
(
target
)),
const
Offset
(
800.0
,
200.0
));
expect
(
tester
.
getBottomRight
(
find
.
byKey
(
target
)),
const
Offset
(
800.0
,
200.0
));
});
});
testWidgets
(
'GridView crossAxisSpacing'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/27151.
final
Key
target
=
UniqueKey
();
Widget
build
(
TextDirection
textDirection
)
{
return
Directionality
(
textDirection:
textDirection
,
child:
GridView
.
count
(
crossAxisCount:
4
,
crossAxisSpacing:
8.0
,
children:
<
Widget
>[
Container
(
key:
target
),
],
),
);
}
await
tester
.
pumpWidget
(
build
(
TextDirection
.
ltr
));
expect
(
tester
.
getTopLeft
(
find
.
byKey
(
target
)),
Offset
.
zero
);
expect
(
tester
.
getBottomRight
(
find
.
byKey
(
target
)),
const
Offset
(
194.0
,
194.0
));
await
tester
.
pumpWidget
(
build
(
TextDirection
.
rtl
));
expect
(
tester
.
getTopLeft
(
find
.
byKey
(
target
)),
const
Offset
(
606.0
,
0.0
));
expect
(
tester
.
getBottomRight
(
find
.
byKey
(
target
)),
const
Offset
(
800.0
,
194.0
));
});
}
}
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