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
756a1f03
Unverified
Commit
756a1f03
authored
Apr 10, 2020
by
William Oprandi
Committed by
GitHub
Apr 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass showCheckboxColumn parameter to DataTable (#53655)
parent
bec1b734
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
paginated_data_table.dart
packages/flutter/lib/src/material/paginated_data_table.dart
+1
-0
paginated_data_table_test.dart
...ages/flutter/test/material/paginated_data_table_test.dart
+23
-0
No files found.
packages/flutter/lib/src/material/paginated_data_table.dart
View file @
756a1f03
...
@@ -474,6 +474,7 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
...
@@ -474,6 +474,7 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
headingRowHeight:
widget
.
headingRowHeight
,
headingRowHeight:
widget
.
headingRowHeight
,
horizontalMargin:
widget
.
horizontalMargin
,
horizontalMargin:
widget
.
horizontalMargin
,
columnSpacing:
widget
.
columnSpacing
,
columnSpacing:
widget
.
columnSpacing
,
showCheckboxColumn:
widget
.
showCheckboxColumn
,
rows:
_getRows
(
_firstRowIndex
,
widget
.
rowsPerPage
),
rows:
_getRows
(
_firstRowIndex
,
widget
.
rowsPerPage
),
),
),
),
),
...
...
packages/flutter/test/material/paginated_data_table_test.dart
View file @
756a1f03
...
@@ -726,4 +726,27 @@ void main() {
...
@@ -726,4 +726,27 @@ void main() {
// Reset the surface size.
// Reset the surface size.
await
binding
.
setSurfaceSize
(
originalSize
);
await
binding
.
setSurfaceSize
(
originalSize
);
});
});
testWidgets
(
'PaginatedDataTable with optional column checkbox'
,
(
WidgetTester
tester
)
async
{
await
binding
.
setSurfaceSize
(
const
Size
(
800
,
800
));
Widget
buildTable
(
bool
checkbox
)
=>
MaterialApp
(
home:
PaginatedDataTable
(
header:
const
Text
(
'Test table'
),
source
:
TestDataSource
(
onSelectChanged:
(
bool
value
)
{}),
showCheckboxColumn:
checkbox
,
columns:
const
<
DataColumn
>[
DataColumn
(
label:
Text
(
'Name'
)),
DataColumn
(
label:
Text
(
'Calories'
),
numeric:
true
),
DataColumn
(
label:
Text
(
'Generation'
)),
],
),
);
await
tester
.
pumpWidget
(
buildTable
(
true
));
expect
(
find
.
byType
(
Checkbox
),
findsNWidgets
(
11
));
await
tester
.
pumpWidget
(
buildTable
(
false
));
expect
(
find
.
byType
(
Checkbox
),
findsNothing
);
});
}
}
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