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
6b581c43
Unverified
Commit
6b581c43
authored
3 years ago
by
Hans Muller
Committed by
GitHub
3 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redo Removed accentColor dependency from ExpansionTile (#79829)
parent
bb7b4907
stable
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
expansion_tile.dart
packages/flutter/lib/src/material/expansion_tile.dart
+4
-2
expansion_tile_test.dart
packages/flutter/test/material/expansion_tile_test.dart
+6
-6
No files found.
packages/flutter/lib/src/material/expansion_tile.dart
View file @
6b581c43
...
...
@@ -4,6 +4,7 @@
import
'package:flutter/widgets.dart'
;
import
'color_scheme.dart'
;
import
'colors.dart'
;
import
'icons.dart'
;
import
'list_tile.dart'
;
...
...
@@ -288,13 +289,14 @@ class _ExpansionTileState extends State<ExpansionTile> with SingleTickerProvider
@override
void
didChangeDependencies
()
{
final
ThemeData
theme
=
Theme
.
of
(
context
);
final
ColorScheme
colorScheme
=
theme
.
colorScheme
;
_borderColorTween
.
end
=
theme
.
dividerColor
;
_headerColorTween
..
begin
=
widget
.
collapsedTextColor
??
theme
.
textTheme
.
subtitle1
!.
color
..
end
=
widget
.
textColor
??
theme
.
accentColor
;
..
end
=
widget
.
textColor
??
colorScheme
.
secondary
;
_iconColorTween
..
begin
=
widget
.
collapsedIconColor
??
theme
.
unselectedWidgetColor
..
end
=
widget
.
iconColor
??
theme
.
accentColor
;
..
end
=
widget
.
iconColor
??
colorScheme
.
secondary
;
_backgroundColorTween
..
begin
=
widget
.
collapsedBackgroundColor
..
end
=
widget
.
backgroundColor
;
...
...
This diff is collapsed.
Click to expand it.
packages/flutter/test/material/expansion_tile_test.dart
View file @
6b581c43
...
...
@@ -43,7 +43,7 @@ class TestTextState extends State<TestText> {
void
main
(
)
{
const
Color
_dividerColor
=
Color
(
0x1f333333
);
const
Color
_
accent
Color
=
Colors
.
blueAccent
;
const
Color
_
foreground
Color
=
Colors
.
blueAccent
;
const
Color
_unselectedWidgetColor
=
Colors
.
black54
;
const
Color
_headerColor
=
Colors
.
black45
;
...
...
@@ -163,7 +163,7 @@ void main() {
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
accentColor:
_accentColor
,
colorScheme:
ColorScheme
.
fromSwatch
().
copyWith
(
secondary:
_foregroundColor
)
,
unselectedWidgetColor:
_unselectedWidgetColor
,
textTheme:
const
TextTheme
(
subtitle1:
TextStyle
(
color:
_headerColor
)),
),
...
...
@@ -195,9 +195,9 @@ void main() {
Color
iconColor
(
Key
key
)
=>
tester
.
state
<
TestIconState
>(
find
.
byKey
(
key
)).
iconTheme
.
color
!;
Color
textColor
(
Key
key
)
=>
tester
.
state
<
TestTextState
>(
find
.
byKey
(
key
)).
textStyle
.
color
!;
expect
(
textColor
(
expandedTitleKey
),
_
accent
Color
);
expect
(
textColor
(
expandedTitleKey
),
_
foreground
Color
);
expect
(
textColor
(
collapsedTitleKey
),
_headerColor
);
expect
(
iconColor
(
expandedIconKey
),
_
accent
Color
);
expect
(
iconColor
(
expandedIconKey
),
_
foreground
Color
);
expect
(
iconColor
(
collapsedIconKey
),
_unselectedWidgetColor
);
// Tap both tiles to change their state: collapse and extend respectively
...
...
@@ -208,9 +208,9 @@ void main() {
await
tester
.
pump
(
const
Duration
(
seconds:
1
));
expect
(
textColor
(
expandedTitleKey
),
_headerColor
);
expect
(
textColor
(
collapsedTitleKey
),
_
accent
Color
);
expect
(
textColor
(
collapsedTitleKey
),
_
foreground
Color
);
expect
(
iconColor
(
expandedIconKey
),
_unselectedWidgetColor
);
expect
(
iconColor
(
collapsedIconKey
),
_
accent
Color
);
expect
(
iconColor
(
collapsedIconKey
),
_
foreground
Color
);
},
variant:
const
TargetPlatformVariant
(<
TargetPlatform
>{
TargetPlatform
.
iOS
,
TargetPlatform
.
macOS
}));
testWidgets
(
'ExpansionTile subtitle'
,
(
WidgetTester
tester
)
async
{
...
...
This diff is collapsed.
Click to expand it.
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