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
a9b4c145
Unverified
Commit
a9b4c145
authored
Nov 20, 2020
by
Per Classon
Committed by
GitHub
Nov 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Material] Decoration for DataTable is not used inside PaginatedDataTable (#70603)
parent
de884f1a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
paginated_data_table.dart
packages/flutter/lib/src/material/paginated_data_table.dart
+7
-0
paginated_data_table_test.dart
...ages/flutter/test/material/paginated_data_table_test.dart
+32
-0
No files found.
packages/flutter/lib/src/material/paginated_data_table.dart
View file @
a9b4c145
...
@@ -61,6 +61,10 @@ class PaginatedDataTable extends StatefulWidget {
...
@@ -61,6 +61,10 @@ class PaginatedDataTable extends StatefulWidget {
///
///
/// The [rowsPerPage] and [availableRowsPerPage] must not be null (they
/// The [rowsPerPage] and [availableRowsPerPage] must not be null (they
/// both have defaults, though, so don't have to be specified).
/// both have defaults, though, so don't have to be specified).
///
/// Themed by [DataTableTheme]. [DataTableThemeData.decoration] is ignored.
/// To modify the border or background color of the [PaginatedDataTable], use
/// [CardTheme], since a [Card] wraps the inner [DataTable].
PaginatedDataTable
({
PaginatedDataTable
({
Key
?
key
,
Key
?
key
,
this
.
header
,
this
.
header
,
...
@@ -471,6 +475,9 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
...
@@ -471,6 +475,9 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
sortColumnIndex:
widget
.
sortColumnIndex
,
sortColumnIndex:
widget
.
sortColumnIndex
,
sortAscending:
widget
.
sortAscending
,
sortAscending:
widget
.
sortAscending
,
onSelectAll:
widget
.
onSelectAll
,
onSelectAll:
widget
.
onSelectAll
,
// Make sure no decoration is set on the DataTable
// from the theme, as its already wrapped in a Card.
decoration:
const
BoxDecoration
(),
dataRowHeight:
widget
.
dataRowHeight
,
dataRowHeight:
widget
.
dataRowHeight
,
headingRowHeight:
widget
.
headingRowHeight
,
headingRowHeight:
widget
.
headingRowHeight
,
horizontalMargin:
widget
.
horizontalMargin
,
horizontalMargin:
widget
.
horizontalMargin
,
...
...
packages/flutter/test/material/paginated_data_table_test.dart
View file @
a9b4c145
...
@@ -786,4 +786,36 @@ void main() {
...
@@ -786,4 +786,36 @@ void main() {
await
tester
.
pumpWidget
(
buildTable
(
false
));
await
tester
.
pumpWidget
(
buildTable
(
false
));
expect
(
find
.
byType
(
Checkbox
),
findsNothing
);
expect
(
find
.
byType
(
Checkbox
),
findsNothing
);
});
});
testWidgets
(
'Table should not use decoration from DataTableTheme'
,
(
WidgetTester
tester
)
async
{
final
Size
originalSize
=
binding
.
renderView
.
size
;
await
binding
.
setSurfaceSize
(
const
Size
(
800
,
800
));
Widget
buildTable
()
{
return
MaterialApp
(
theme:
ThemeData
.
light
().
copyWith
(
dataTableTheme:
const
DataTableThemeData
(
decoration:
BoxDecoration
(
color:
Colors
.
white
),
),
),
home:
PaginatedDataTable
(
header:
const
Text
(
'Test table'
),
source
:
TestDataSource
(
onSelectChanged:
(
bool
?
value
)
{}),
showCheckboxColumn:
true
,
columns:
const
<
DataColumn
>[
DataColumn
(
label:
Text
(
'Name'
)),
DataColumn
(
label:
Text
(
'Calories'
),
numeric:
true
),
DataColumn
(
label:
Text
(
'Generation'
)),
],
),
);
}
await
tester
.
pumpWidget
(
buildTable
());
final
Finder
tableContainerFinder
=
find
.
ancestor
(
of:
find
.
byType
(
Table
),
matching:
find
.
byType
(
Container
)).
first
;
expect
(
tester
.
widget
<
Container
>(
tableContainerFinder
).
decoration
,
const
BoxDecoration
());
// Reset the surface size.
await
binding
.
setSurfaceSize
(
originalSize
);
});
}
}
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