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
dd3dc5ef
Unverified
Commit
dd3dc5ef
authored
Mar 29, 2023
by
Justin McCandless
Committed by
GitHub
Mar 29, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TextFormField.spellCheckConfiguration (#123295)
TextFormField.spellCheckConfiguration
parent
142dd602
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
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
+31
-1
No files found.
packages/flutter/lib/src/material/text_form_field.dart
View file @
dd3dc5ef
...
@@ -154,6 +154,7 @@ class TextFormField extends FormField<String> {
...
@@ -154,6 +154,7 @@ class TextFormField extends FormField<String> {
bool
enableIMEPersonalizedLearning
=
true
,
bool
enableIMEPersonalizedLearning
=
true
,
MouseCursor
?
mouseCursor
,
MouseCursor
?
mouseCursor
,
EditableTextContextMenuBuilder
?
contextMenuBuilder
=
_defaultContextMenuBuilder
,
EditableTextContextMenuBuilder
?
contextMenuBuilder
=
_defaultContextMenuBuilder
,
SpellCheckConfiguration
?
spellCheckConfiguration
,
TextMagnifierConfiguration
?
magnifierConfiguration
,
TextMagnifierConfiguration
?
magnifierConfiguration
,
})
:
assert
(
initialValue
==
null
||
controller
==
null
),
})
:
assert
(
initialValue
==
null
||
controller
==
null
),
assert
(
obscuringCharacter
.
length
==
1
),
assert
(
obscuringCharacter
.
length
==
1
),
...
@@ -235,6 +236,7 @@ class TextFormField extends FormField<String> {
...
@@ -235,6 +236,7 @@ class TextFormField extends FormField<String> {
enableIMEPersonalizedLearning:
enableIMEPersonalizedLearning
,
enableIMEPersonalizedLearning:
enableIMEPersonalizedLearning
,
mouseCursor:
mouseCursor
,
mouseCursor:
mouseCursor
,
contextMenuBuilder:
contextMenuBuilder
,
contextMenuBuilder:
contextMenuBuilder
,
spellCheckConfiguration:
spellCheckConfiguration
,
magnifierConfiguration:
magnifierConfiguration
,
magnifierConfiguration:
magnifierConfiguration
,
),
),
);
);
...
...
packages/flutter/test/material/text_form_field_test.dart
View file @
dd3dc5ef
...
@@ -1145,6 +1145,36 @@ void main() {
...
@@ -1145,6 +1145,36 @@ void main() {
skip:
kIsWeb
,
// [intended] we don't supply the cut/copy/paste buttons on the web.
skip:
kIsWeb
,
// [intended] we don't supply the cut/copy/paste buttons on the web.
);
);
testWidgets
(
'spellCheckConfiguration passes through to EditableText'
,
(
WidgetTester
tester
)
async
{
final
SpellCheckConfiguration
mySpellCheckConfiguration
=
SpellCheckConfiguration
(
spellCheckService:
DefaultSpellCheckService
(),
misspelledTextStyle:
TextField
.
materialMisspelledTextStyle
,
);
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
body:
TextFormField
(
spellCheckConfiguration:
mySpellCheckConfiguration
,
),
),
));
expect
(
find
.
byType
(
EditableText
),
findsOneWidget
);
final
EditableText
editableText
=
tester
.
widget
(
find
.
byType
(
EditableText
));
// Can't do equality comparison on spellCheckConfiguration itself because it
// will have been copied.
expect
(
editableText
.
spellCheckConfiguration
?.
spellCheckService
,
equals
(
mySpellCheckConfiguration
.
spellCheckService
),
);
expect
(
editableText
.
spellCheckConfiguration
?.
misspelledTextStyle
,
equals
(
mySpellCheckConfiguration
.
misspelledTextStyle
),
);
});
testWidgets
(
'magnifierConfiguration passes through to EditableText'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'magnifierConfiguration passes through to EditableText'
,
(
WidgetTester
tester
)
async
{
final
TextMagnifierConfiguration
myTextMagnifierConfiguration
=
TextMagnifierConfiguration
(
final
TextMagnifierConfiguration
myTextMagnifierConfiguration
=
TextMagnifierConfiguration
(
magnifierBuilder:
(
BuildContext
context
,
MagnifierController
controller
,
ValueNotifier
<
MagnifierInfo
>
notifier
)
{
magnifierBuilder:
(
BuildContext
context
,
MagnifierController
controller
,
ValueNotifier
<
MagnifierInfo
>
notifier
)
{
...
@@ -1154,7 +1184,7 @@ void main() {
...
@@ -1154,7 +1184,7 @@ void main() {
await
tester
.
pumpWidget
(
MaterialApp
(
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
home:
Scaffold
(
body:
TextField
(
body:
TextF
ormF
ield
(
magnifierConfiguration:
myTextMagnifierConfiguration
,
magnifierConfiguration:
myTextMagnifierConfiguration
,
),
),
),
),
...
...
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