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
9f4e132f
Unverified
Commit
9f4e132f
authored
4 years ago
by
Haruka Ma
Committed by
GitHub
4 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CupertinoTextField incorrect background color when disabled (#78058)
parent
c3d0f604
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
1 deletion
+79
-1
text_field.dart
packages/flutter/lib/src/cupertino/text_field.dart
+1
-1
text_field_test.dart
packages/flutter/test/cupertino/text_field_test.dart
+78
-0
No files found.
packages/flutter/lib/src/cupertino/text_field.dart
View file @
9f4e132f
...
...
@@ -1137,7 +1137,7 @@ class _CupertinoTextFieldState extends State<CupertinoTextField> with Restoratio
final
BoxDecoration
?
effectiveDecoration
=
widget
.
decoration
?.
copyWith
(
border:
resolvedBorder
,
color:
enabled
?
decorationColor
:
(
decorationColor
??
disabledColor
)
,
color:
enabled
?
decorationColor
:
disabledColor
,
);
final
Color
selectionColor
=
CupertinoTheme
.
of
(
context
).
primaryColor
.
withOpacity
(
0.2
);
...
...
This diff is collapsed.
Click to expand it.
packages/flutter/test/cupertino/text_field_test.dart
View file @
9f4e132f
...
...
@@ -4617,4 +4617,82 @@ void main() {
expect
(
state
.
currentTextEditingValue
.
composing
,
TextRange
.
empty
);
});
});
testWidgets
(
'disabled widget changes background color'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
CupertinoApp
(
home:
Center
(
child:
CupertinoTextField
(
enabled:
false
,
),
),
),
);
BoxDecoration
decoration
=
tester
.
widget
<
DecoratedBox
>(
find
.
descendant
(
of:
find
.
byType
(
CupertinoTextField
),
matching:
find
.
byType
(
DecoratedBox
),
),
)
.
decoration
as
BoxDecoration
;
expect
(
decoration
.
color
!.
value
,
0xFFFAFAFA
,
);
await
tester
.
pumpWidget
(
const
CupertinoApp
(
home:
Center
(
child:
CupertinoTextField
(
enabled:
true
,
),
),
),
);
decoration
=
tester
.
widget
<
DecoratedBox
>(
find
.
descendant
(
of:
find
.
byType
(
CupertinoTextField
),
matching:
find
.
byType
(
DecoratedBox
),
),
)
.
decoration
as
BoxDecoration
;
expect
(
decoration
.
color
!.
value
,
CupertinoColors
.
white
.
value
,
);
await
tester
.
pumpWidget
(
const
CupertinoApp
(
theme:
CupertinoThemeData
(
brightness:
Brightness
.
dark
,
),
home:
Center
(
child:
CupertinoTextField
(
enabled:
false
,
),
),
),
);
decoration
=
tester
.
widget
<
DecoratedBox
>(
find
.
descendant
(
of:
find
.
byType
(
CupertinoTextField
),
matching:
find
.
byType
(
DecoratedBox
),
),
)
.
decoration
as
BoxDecoration
;
expect
(
decoration
.
color
!.
value
,
0xFF050505
,
);
});
}
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