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
fa2fd112
Commit
fa2fd112
authored
Mar 22, 2019
by
Luka Knezic
Committed by
xster
Mar 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update CupertinoTextField (#29008)
parent
475d93a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
text_field.dart
packages/flutter/lib/src/cupertino/text_field.dart
+2
-1
text_field_test.dart
packages/flutter/test/cupertino/text_field_test.dart
+16
-0
No files found.
packages/flutter/lib/src/cupertino/text_field.dart
View file @
fa2fd112
...
...
@@ -672,6 +672,7 @@ class _CupertinoTextFieldState extends State<CupertinoTextField> with AutomaticK
final
CupertinoThemeData
themeData
=
CupertinoTheme
.
of
(
context
);
final
TextStyle
textStyle
=
themeData
.
textTheme
.
textStyle
.
merge
(
widget
.
style
);
final
Brightness
keyboardAppearance
=
widget
.
keyboardAppearance
??
themeData
.
brightness
;
final
Color
cursorColor
=
widget
.
cursorColor
??
themeData
.
primaryColor
;
final
Widget
paddedEditable
=
Padding
(
padding:
widget
.
padding
,
...
...
@@ -702,7 +703,7 @@ class _CupertinoTextFieldState extends State<CupertinoTextField> with AutomaticK
rendererIgnoresPointer:
true
,
cursorWidth:
widget
.
cursorWidth
,
cursorRadius:
widget
.
cursorRadius
,
cursorColor:
themeData
.
primary
Color
,
cursorColor:
cursor
Color
,
cursorOpacityAnimates:
true
,
cursorOffset:
cursorOffset
,
paintCursorAboveText:
true
,
...
...
packages/flutter/test/cupertino/text_field_test.dart
View file @
fa2fd112
...
...
@@ -1918,4 +1918,20 @@ void main() {
await
tester
.
pump
();
expect
(
renderEditable
.
cursorColor
,
const
Color
(
0xFFF44336
));
});
testWidgets
(
'cursor can override color from theme'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
CupertinoApp
(
theme:
CupertinoThemeData
(),
home:
Center
(
child:
CupertinoTextField
(
cursorColor:
Color
(
0xFFF44336
),
),
),
),
);
final
EditableText
editableText
=
tester
.
firstWidget
(
find
.
byType
(
EditableText
));
expect
(
editableText
.
cursorColor
,
const
Color
(
0xFFF44336
));
});
}
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