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
adb8b607
Unverified
Commit
adb8b607
authored
May 03, 2022
by
Taha Tesser
Committed by
GitHub
May 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix `CupertinoTimerPicker` dark mode text color (#100311)
parent
a3c6395c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
date_picker.dart
packages/flutter/lib/src/cupertino/date_picker.dart
+1
-0
date_picker_test.dart
packages/flutter/test/cupertino/date_picker_test.dart
+27
-0
No files found.
packages/flutter/lib/src/cupertino/date_picker.dart
View file @
adb8b607
...
...
@@ -1974,6 +1974,7 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
TextStyle
_textStyleFrom
(
BuildContext
context
,
[
double
magnification
=
1.0
])
{
final
TextStyle
textStyle
=
CupertinoTheme
.
of
(
context
).
textTheme
.
pickerTextStyle
;
return
textStyle
.
copyWith
(
color:
CupertinoDynamicColor
.
maybeResolve
(
textStyle
.
color
,
context
),
fontSize:
textStyle
.
fontSize
!
*
magnification
,
);
}
...
...
packages/flutter/test/cupertino/date_picker_test.dart
View file @
adb8b607
...
...
@@ -1543,6 +1543,33 @@ void main() {
// Text style should not return unresolved color.
expect
(
paragraph
.
text
.
style
!.
color
.
toString
().
contains
(
'UNRESOLVED'
),
isFalse
);
});
testWidgets
(
'TimerPicker adapts to MaterialApp dark mode'
,
(
WidgetTester
tester
)
async
{
Widget
_buildTimerPicker
(
Brightness
brightness
)
{
return
MaterialApp
(
theme:
ThemeData
(
brightness:
brightness
),
home:
CupertinoTimerPicker
(
mode:
CupertinoTimerPickerMode
.
hm
,
onTimerDurationChanged:
(
Duration
newDuration
)
{},
initialTimerDuration:
const
Duration
(
hours:
12
,
minutes:
30
,
seconds:
59
),
),
);
}
// CupertinoTimerPicker with light theme.
await
tester
.
pumpWidget
(
_buildTimerPicker
(
Brightness
.
light
));
RenderParagraph
paragraph
=
tester
.
renderObject
(
find
.
text
(
'hours'
));
expect
(
paragraph
.
text
.
style
!.
color
,
CupertinoColors
.
label
);
// Text style should not return unresolved color.
expect
(
paragraph
.
text
.
style
!.
color
.
toString
().
contains
(
'UNRESOLVED'
),
isFalse
);
// CupertinoTimerPicker with light theme.
await
tester
.
pumpWidget
(
_buildTimerPicker
(
Brightness
.
dark
));
paragraph
=
tester
.
renderObject
(
find
.
text
(
'hours'
));
expect
(
paragraph
.
text
.
style
!.
color
,
CupertinoColors
.
label
);
// Text style should not return unresolved color.
expect
(
paragraph
.
text
.
style
!.
color
.
toString
().
contains
(
'UNRESOLVED'
),
isFalse
);
});
}
Widget
_buildPicker
(
{
...
...
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