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
9f898ffe
Unverified
Commit
9f898ffe
authored
May 03, 2021
by
Chinmoy
Committed by
GitHub
May 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added arrowHeadColor property to PaginatedDataTable (#81393)
parent
d4d28554
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
4 deletions
+36
-4
paginated_data_table.dart
packages/flutter/lib/src/material/paginated_data_table.dart
+8
-4
paginated_data_table_test.dart
...ages/flutter/test/material/paginated_data_table_test.dart
+28
-0
No files found.
packages/flutter/lib/src/material/paginated_data_table.dart
View file @
9f898ffe
...
...
@@ -84,6 +84,7 @@ class PaginatedDataTable extends StatefulWidget {
this
.
availableRowsPerPage
=
const
<
int
>[
defaultRowsPerPage
,
defaultRowsPerPage
*
2
,
defaultRowsPerPage
*
5
,
defaultRowsPerPage
*
10
],
this
.
onRowsPerPageChanged
,
this
.
dragStartBehavior
=
DragStartBehavior
.
start
,
this
.
arrowHeadColor
,
required
this
.
source
,
this
.
checkboxHorizontalMargin
,
})
:
assert
(
actions
==
null
||
(
actions
!=
null
&&
header
!=
null
)),
...
...
@@ -235,6 +236,9 @@ class PaginatedDataTable extends StatefulWidget {
/// and the content in the first data column. This value defaults to 24.0.
final
double
?
checkboxHorizontalMargin
;
/// Defines the color of the arrow heads in the footer.
final
Color
?
arrowHeadColor
;
@override
PaginatedDataTableState
createState
()
=>
PaginatedDataTableState
();
}
...
...
@@ -442,27 +446,27 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
Container
(
width:
32.0
),
if
(
widget
.
showFirstLastButtons
)
IconButton
(
icon:
const
Icon
(
Icons
.
skip_previous
),
icon:
Icon
(
Icons
.
skip_previous
,
color:
widget
.
arrowHeadColor
),
padding:
EdgeInsets
.
zero
,
tooltip:
localizations
.
firstPageTooltip
,
onPressed:
_firstRowIndex
<=
0
?
null
:
_handleFirst
,
),
IconButton
(
icon:
const
Icon
(
Icons
.
chevron_left
),
icon:
Icon
(
Icons
.
chevron_left
,
color:
widget
.
arrowHeadColor
),
padding:
EdgeInsets
.
zero
,
tooltip:
localizations
.
previousPageTooltip
,
onPressed:
_firstRowIndex
<=
0
?
null
:
_handlePrevious
,
),
Container
(
width:
24.0
),
IconButton
(
icon:
const
Icon
(
Icons
.
chevron_right
),
icon:
Icon
(
Icons
.
chevron_right
,
color:
widget
.
arrowHeadColor
),
padding:
EdgeInsets
.
zero
,
tooltip:
localizations
.
nextPageTooltip
,
onPressed:
_isNextPageUnavailable
()
?
null
:
_handleNext
,
),
if
(
widget
.
showFirstLastButtons
)
IconButton
(
icon:
const
Icon
(
Icons
.
skip_next
),
icon:
Icon
(
Icons
.
skip_next
,
color:
widget
.
arrowHeadColor
),
padding:
EdgeInsets
.
zero
,
tooltip:
localizations
.
lastPageTooltip
,
onPressed:
_isNextPageUnavailable
()
...
...
packages/flutter/test/material/paginated_data_table_test.dart
View file @
9f898ffe
...
...
@@ -974,4 +974,32 @@ void main() {
await
binding
.
setSurfaceSize
(
null
);
});
testWidgets
(
'PaginatedDataTable arrowHeadColor set properly'
,
(
WidgetTester
tester
)
async
{
await
binding
.
setSurfaceSize
(
const
Size
(
800
,
800
));
const
Color
arrowHeadColor
=
Color
(
0xFFE53935
);
await
tester
.
pumpWidget
(
MaterialApp
(
home:
PaginatedDataTable
(
arrowHeadColor:
arrowHeadColor
,
showFirstLastButtons:
true
,
header:
const
Text
(
'Test table'
),
source
:
TestDataSource
(),
columns:
const
<
DataColumn
>[
DataColumn
(
label:
Text
(
'Name'
)),
DataColumn
(
label:
Text
(
'Calories'
),
numeric:
true
),
DataColumn
(
label:
Text
(
'Generation'
)),
],
),
)
);
final
Iterable
<
Icon
>
icons
=
tester
.
widgetList
(
find
.
byType
(
Icon
));
expect
(
icons
.
elementAt
(
0
).
color
,
arrowHeadColor
);
expect
(
icons
.
elementAt
(
1
).
color
,
arrowHeadColor
);
expect
(
icons
.
elementAt
(
2
).
color
,
arrowHeadColor
);
expect
(
icons
.
elementAt
(
3
).
color
,
arrowHeadColor
);
});
}
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