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
683238e8
Commit
683238e8
authored
Jun 03, 2019
by
SimonIT
Committed by
LongCatIsLooong
Jun 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix disabled CupertinoTextField style (#32974)
parent
2767d37c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
11 deletions
+60
-11
goldens.version
bin/internal/goldens.version
+1
-1
text_field.dart
packages/flutter/lib/src/cupertino/text_field.dart
+9
-10
box_decoration.dart
packages/flutter/lib/src/painting/box_decoration.dart
+24
-0
text_field_test.dart
packages/flutter/test/cupertino/text_field_test.dart
+26
-0
No files found.
bin/internal/goldens.version
View file @
683238e8
d79941e3d9c6e761189ac8aefa3a40c7fb98413e
2eea0c710c4fca4c6655b4efc15b68d4b44cd404
packages/flutter/lib/src/cupertino/text_field.dart
View file @
683238e8
...
...
@@ -785,6 +785,13 @@ class _CupertinoTextFieldState extends State<CupertinoTextField> with AutomaticK
final
TextStyle
placeholderStyle
=
textStyle
.
merge
(
widget
.
placeholderStyle
);
final
Brightness
keyboardAppearance
=
widget
.
keyboardAppearance
??
themeData
.
brightness
;
final
Color
cursorColor
=
widget
.
cursorColor
??
themeData
.
primaryColor
;
final
Color
disabledColor
=
CupertinoTheme
.
of
(
context
).
brightness
==
Brightness
.
light
?
_kDisabledBackground
:
CupertinoColors
.
darkBackgroundGray
;
final
BoxDecoration
effectiveDecoration
=
enabled
?
widget
.
decoration
:
widget
.
decoration
?.
copyWith
(
color:
widget
.
decoration
?.
color
??
disabledColor
);
final
Widget
paddedEditable
=
TextSelectionGestureDetector
(
onTapDown:
_handleTapDown
,
...
...
@@ -855,16 +862,8 @@ class _CupertinoTextFieldState extends State<CupertinoTextField> with AutomaticK
child:
IgnorePointer
(
ignoring:
!
enabled
,
child:
Container
(
decoration:
widget
.
decoration
,
// The main decoration and the disabled scrim exists separately.
child:
Container
(
color:
enabled
?
null
:
CupertinoTheme
.
of
(
context
).
brightness
==
Brightness
.
light
?
_kDisabledBackground
:
CupertinoColors
.
darkBackgroundGray
,
child:
_addTextDependentAttachments
(
paddedEditable
,
textStyle
,
placeholderStyle
),
),
decoration:
effectiveDecoration
,
child:
_addTextDependentAttachments
(
paddedEditable
,
textStyle
,
placeholderStyle
),
),
),
);
...
...
packages/flutter/lib/src/painting/box_decoration.dart
View file @
683238e8
...
...
@@ -97,6 +97,30 @@ class BoxDecoration extends Decoration {
'gradient, but no color or gradient was provided.'
);
/// Creates a copy of this object but with the given fields replaced with the
/// new values.
BoxDecoration
copyWith
({
Color
color
,
DecorationImage
image
,
BoxBorder
border
,
BorderRadiusGeometry
borderRadius
,
List
<
BoxShadow
>
boxShadow
,
Gradient
gradient
,
BlendMode
backgroundBlendMode
,
BoxShape
shape
,
})
{
return
BoxDecoration
(
color:
color
??
this
.
color
,
image:
image
??
this
.
image
,
border:
border
??
this
.
border
,
borderRadius:
borderRadius
??
this
.
borderRadius
,
boxShadow:
boxShadow
??
this
.
boxShadow
,
gradient:
gradient
??
this
.
gradient
,
backgroundBlendMode:
backgroundBlendMode
??
this
.
backgroundBlendMode
,
shape:
shape
??
this
.
shape
,
);
}
@override
bool
debugAssertIsValid
()
{
assert
(
shape
!=
BoxShape
.
circle
||
...
...
packages/flutter/test/cupertino/text_field_test.dart
View file @
683238e8
...
...
@@ -2590,4 +2590,30 @@ void main() {
debugDefaultTargetPlatformOverride
=
null
;
});
testWidgets
(
'disabled state golden'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
CupertinoApp
(
home:
DecoratedBox
(
decoration:
const
BoxDecoration
(
color:
Color
(
0xFFFFFFFF
)),
child:
Center
(
child:
SizedBox
(
width:
200
,
height:
200
,
child:
CupertinoTextField
(
controller:
TextEditingController
(
text:
'lorem'
),
enabled:
false
,
),
)
)
)
)
);
await
expectLater
(
find
.
byType
(
CupertinoTextField
),
matchesGoldenFile
(
'text_field_test.disabled.0.png'
),
skip:
!
Platform
.
isLinux
,
);
});
}
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