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
73124dcd
Unverified
Commit
73124dcd
authored
Feb 01, 2023
by
Taha Tesser
Committed by
GitHub
Feb 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix `ListTileThemeData.copyWith` doesn't override correct properties (#119738)
parent
484d881f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
2 deletions
+61
-2
list_tile_theme.dart
packages/flutter/lib/src/material/list_tile_theme.dart
+2
-2
list_tile_theme_test.dart
packages/flutter/test/material/list_tile_theme_test.dart
+59
-0
No files found.
packages/flutter/lib/src/material/list_tile_theme.dart
View file @
73124dcd
...
...
@@ -150,8 +150,8 @@ class ListTileThemeData with Diagnosticable {
iconColor:
iconColor
??
this
.
iconColor
,
textColor:
textColor
??
this
.
textColor
,
titleTextStyle:
titleTextStyle
??
this
.
titleTextStyle
,
subtitleTextStyle:
titleTextStyle
??
this
.
subtitleTextStyle
,
leadingAndTrailingTextStyle:
title
TextStyle
??
this
.
leadingAndTrailingTextStyle
,
subtitleTextStyle:
sub
titleTextStyle
??
this
.
subtitleTextStyle
,
leadingAndTrailingTextStyle:
leadingAndTrailing
TextStyle
??
this
.
leadingAndTrailingTextStyle
,
contentPadding:
contentPadding
??
this
.
contentPadding
,
tileColor:
tileColor
??
this
.
tileColor
,
selectedTileColor:
selectedTileColor
??
this
.
selectedTileColor
,
...
...
packages/flutter/test/material/list_tile_theme_test.dart
View file @
73124dcd
...
...
@@ -700,6 +700,65 @@ void main() {
await
tester
.
pumpAndSettle
();
expect
(
iconColor
(
leadingKey
),
selectedColor
);
});
testWidgets
(
'ListTileThemeData copyWith overrides all properties'
,
(
WidgetTester
tester
)
async
{
// This is a regression test for https://github.com/flutter/flutter/issues/119734
const
ListTileThemeData
original
=
ListTileThemeData
(
dense:
true
,
shape:
StadiumBorder
(),
style:
ListTileStyle
.
drawer
,
selectedColor:
Color
(
0x00000001
),
iconColor:
Color
(
0x00000002
),
textColor:
Color
(
0x00000003
),
titleTextStyle:
TextStyle
(
color:
Color
(
0x00000004
)),
subtitleTextStyle:
TextStyle
(
color:
Color
(
0x00000005
)),
leadingAndTrailingTextStyle:
TextStyle
(
color:
Color
(
0x00000006
)),
contentPadding:
EdgeInsets
.
all
(
100
),
tileColor:
Color
(
0x00000007
),
selectedTileColor:
Color
(
0x00000008
),
horizontalTitleGap:
200
,
minVerticalPadding:
300
,
minLeadingWidth:
400
,
enableFeedback:
true
,
);
final
ListTileThemeData
copy
=
original
.
copyWith
(
dense:
false
,
shape:
const
RoundedRectangleBorder
(),
style:
ListTileStyle
.
list
,
selectedColor:
const
Color
(
0x00000009
),
iconColor:
const
Color
(
0x0000000A
),
textColor:
const
Color
(
0x0000000B
),
titleTextStyle:
const
TextStyle
(
color:
Color
(
0x0000000C
)),
subtitleTextStyle:
const
TextStyle
(
color:
Color
(
0x0000000D
)),
leadingAndTrailingTextStyle:
const
TextStyle
(
color:
Color
(
0x0000000E
)),
contentPadding:
const
EdgeInsets
.
all
(
500
),
tileColor:
const
Color
(
0x0000000F
),
selectedTileColor:
const
Color
(
0x00000010
),
horizontalTitleGap:
600
,
minVerticalPadding:
700
,
minLeadingWidth:
800
,
enableFeedback:
false
,
);
expect
(
copy
.
dense
,
false
);
expect
(
copy
.
shape
,
const
RoundedRectangleBorder
());
expect
(
copy
.
style
,
ListTileStyle
.
list
);
expect
(
copy
.
selectedColor
,
const
Color
(
0x00000009
));
expect
(
copy
.
iconColor
,
const
Color
(
0x0000000A
));
expect
(
copy
.
textColor
,
const
Color
(
0x0000000B
));
expect
(
copy
.
titleTextStyle
,
const
TextStyle
(
color:
Color
(
0x0000000C
)));
expect
(
copy
.
subtitleTextStyle
,
const
TextStyle
(
color:
Color
(
0x0000000D
)));
expect
(
copy
.
leadingAndTrailingTextStyle
,
const
TextStyle
(
color:
Color
(
0x0000000E
)));
expect
(
copy
.
contentPadding
,
const
EdgeInsets
.
all
(
500
));
expect
(
copy
.
tileColor
,
const
Color
(
0x0000000F
));
expect
(
copy
.
selectedTileColor
,
const
Color
(
0x00000010
));
expect
(
copy
.
horizontalTitleGap
,
600
);
expect
(
copy
.
minVerticalPadding
,
700
);
expect
(
copy
.
minLeadingWidth
,
800
);
expect
(
copy
.
enableFeedback
,
false
);
});
}
RenderParagraph
_getTextRenderObject
(
WidgetTester
tester
,
String
text
)
{
...
...
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