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
c785efad
Unverified
Commit
c785efad
authored
Feb 18, 2021
by
Chinmoy
Committed by
GitHub
Feb 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed improper assertion of maxCrossAxisExtent (#75095)
parent
ba5cc2cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-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
+12
-0
No files found.
packages/flutter/lib/src/rendering/sliver_grid.dart
View file @
c785efad
...
...
@@ -447,7 +447,7 @@ class SliverGridDelegateWithMaxCrossAxisExtent extends SliverGridDelegate {
this
.
crossAxisSpacing
=
0.0
,
this
.
childAspectRatio
=
1.0
,
this
.
mainAxisExtent
,
})
:
assert
(
maxCrossAxisExtent
!=
null
&&
maxCrossAxisExtent
>
=
0
),
})
:
assert
(
maxCrossAxisExtent
!=
null
&&
maxCrossAxisExtent
>
0
),
assert
(
mainAxisSpacing
!=
null
&&
mainAxisSpacing
>=
0
),
assert
(
crossAxisSpacing
!=
null
&&
crossAxisSpacing
>=
0
),
assert
(
childAspectRatio
!=
null
&&
childAspectRatio
>
0
);
...
...
packages/flutter/test/widgets/grid_view_test.dart
View file @
c785efad
...
...
@@ -783,4 +783,16 @@ void main() {
expect
(
tester
.
getSize
(
find
.
text
(
'4'
)),
equals
(
const
Size
(
200.0
,
mainAxisExtent
)));
});
testWidgets
(
'SliverGridDelegateWithMaxCrossAxisExtent throws assertion error when maxCrossAxisExtent is 0'
,
(
WidgetTester
tester
)
async
{
const
double
maxCrossAxisExtent
=
0
;
expect
(()
=>
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
GridView
.
extent
(
maxCrossAxisExtent:
maxCrossAxisExtent
,
),
),
throwsA
(
isA
<
AssertionError
>()));
});
}
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