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
859aec59
Unverified
Commit
859aec59
authored
Feb 09, 2021
by
Chinmoy
Committed by
GitHub
Feb 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added scrollController property to TextFormField (#75169)
parent
438f44c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
text_form_field.dart
packages/flutter/lib/src/material/text_form_field.dart
+2
-0
text_form_field_test.dart
packages/flutter/test/material/text_form_field_test.dart
+22
-0
No files found.
packages/flutter/lib/src/material/text_form_field.dart
View file @
859aec59
...
...
@@ -193,6 +193,7 @@ class TextFormField extends FormField<String> {
ScrollPhysics
?
scrollPhysics
,
Iterable
<
String
>?
autofillHints
,
AutovalidateMode
?
autovalidateMode
,
ScrollController
?
scrollController
,
})
:
assert
(
initialValue
==
null
||
controller
==
null
),
assert
(
textAlign
!=
null
),
assert
(
autofocus
!=
null
),
...
...
@@ -291,6 +292,7 @@ class TextFormField extends FormField<String> {
selectionControls:
selectionControls
,
buildCounter:
buildCounter
,
autofillHints:
autofillHints
,
scrollController:
scrollController
,
);
},
);
...
...
packages/flutter/test/material/text_form_field_test.dart
View file @
859aec59
...
...
@@ -727,4 +727,26 @@ void main() {
final
TextDirection
textDirection
=
Directionality
.
of
(
context
);
expect
(
textDirection
,
TextDirection
.
rtl
);
});
testWidgets
(
'Passes scrollController to underlying TextField'
,
(
WidgetTester
tester
)
async
{
final
ScrollController
scrollController
=
ScrollController
();
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Material
(
child:
Center
(
child:
TextFormField
(
scrollController:
scrollController
,
),
),
),
),
);
final
Finder
textFieldFinder
=
find
.
byType
(
TextField
);
expect
(
textFieldFinder
,
findsOneWidget
);
final
TextField
textFieldWidget
=
tester
.
widget
(
textFieldFinder
);
expect
(
textFieldWidget
.
scrollController
,
scrollController
);
});
}
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