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
97dc7eee
Unverified
Commit
97dc7eee
authored
Jun 12, 2020
by
Kate Lovett
Committed by
GitHub
Jun 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Step 3 of 3: Remove opt-in for debugCheckHasMaterialLocalizations assertion on TextField (#58831)
parent
ff7538f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
22 deletions
+5
-22
debug.dart
packages/flutter/lib/src/material/debug.dart
+2
-2
text_field.dart
packages/flutter/lib/src/material/text_field.dart
+1
-18
debug_test.dart
packages/flutter/test/material/debug_test.dart
+2
-2
No files found.
packages/flutter/lib/src/material/debug.dart
View file @
97dc7eee
...
@@ -78,8 +78,8 @@ bool debugCheckHasMaterialLocalizations(BuildContext context) {
...
@@ -78,8 +78,8 @@ bool debugCheckHasMaterialLocalizations(BuildContext context) {
'to be provided by a Localizations widget ancestor.'
'to be provided by a Localizations widget ancestor.'
),
),
ErrorDescription
(
ErrorDescription
(
'
Localizations are used to generate many different messages, label
s, '
'
The material library uses Localizations to generate message
s, '
'
and abbreviations which are used by the material library
.'
'
labels, and abbreviations
.'
),
),
ErrorHint
(
ErrorHint
(
'To introduce a MaterialLocalizations, either use a '
'To introduce a MaterialLocalizations, either use a '
...
...
packages/flutter/lib/src/material/text_field.dart
View file @
97dc7eee
...
@@ -4,10 +4,6 @@
...
@@ -4,10 +4,6 @@
// @dart = 2.8
// @dart = 2.8
// TODO(Piinks): Remove ignoring deprecated member use analysis
// when TextField.canAssertMaterialLocalizations parameter is removed.
// ignore_for_file: deprecated_member_use_from_same_package
import
'dart:ui'
as
ui
show
BoxHeightStyle
,
BoxWidthStyle
;
import
'dart:ui'
as
ui
show
BoxHeightStyle
,
BoxWidthStyle
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
...
@@ -354,7 +350,6 @@ class TextField extends StatefulWidget {
...
@@ -354,7 +350,6 @@ class TextField extends StatefulWidget {
this
.
scrollController
,
this
.
scrollController
,
this
.
scrollPhysics
,
this
.
scrollPhysics
,
this
.
autofillHints
,
this
.
autofillHints
,
bool
canAssertMaterialLocalizations
,
})
:
assert
(
textAlign
!=
null
),
})
:
assert
(
textAlign
!=
null
),
assert
(
readOnly
!=
null
),
assert
(
readOnly
!=
null
),
assert
(
autofocus
!=
null
),
assert
(
autofocus
!=
null
),
...
@@ -400,7 +395,6 @@ class TextField extends StatefulWidget {
...
@@ -400,7 +395,6 @@ class TextField extends StatefulWidget {
selectAll:
true
,
selectAll:
true
,
paste:
true
,
paste:
true
,
)),
)),
canAssertMaterialLocalizations
=
canAssertMaterialLocalizations
??
true
,
super
(
key:
key
);
super
(
key:
key
);
/// Controls the text being edited.
/// Controls the text being edited.
...
@@ -733,16 +727,6 @@ class TextField extends StatefulWidget {
...
@@ -733,16 +727,6 @@ class TextField extends StatefulWidget {
/// {@macro flutter.services.autofill.autofillHints}
/// {@macro flutter.services.autofill.autofillHints}
final
Iterable
<
String
>
autofillHints
;
final
Iterable
<
String
>
autofillHints
;
/// Indicates whether [debugCheckHasMaterialLocalizations] can be called
/// during build.
@Deprecated
(
'Set canAssertMaterialLocalizations to `true`. This parameter will be '
'removed and was introduced to migrate TextField to assert '
'debugCheckHasMaterialLocalizations by default. '
'This feature was deprecated after v1.18.0.'
)
final
bool
canAssertMaterialLocalizations
;
@override
@override
_TextFieldState
createState
()
=>
_TextFieldState
();
_TextFieldState
createState
()
=>
_TextFieldState
();
...
@@ -1004,8 +988,7 @@ class _TextFieldState extends State<TextField> implements TextSelectionGestureDe
...
@@ -1004,8 +988,7 @@ class _TextFieldState extends State<TextField> implements TextSelectionGestureDe
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
assert
(
debugCheckHasMaterial
(
context
));
assert
(
debugCheckHasMaterial
(
context
));
if
(
widget
.
canAssertMaterialLocalizations
)
assert
(
debugCheckHasMaterialLocalizations
(
context
));
assert
(
debugCheckHasMaterialLocalizations
(
context
));
assert
(
debugCheckHasDirectionality
(
context
));
assert
(
debugCheckHasDirectionality
(
context
));
assert
(
assert
(
!(
widget
.
style
!=
null
&&
widget
.
style
.
inherit
==
false
&&
!(
widget
.
style
!=
null
&&
widget
.
style
.
inherit
==
false
&&
...
...
packages/flutter/test/material/debug_test.dart
View file @
97dc7eee
...
@@ -69,8 +69,8 @@ void main() {
...
@@ -69,8 +69,8 @@ void main() {
' No MaterialLocalizations found.
\n
'
' No MaterialLocalizations found.
\n
'
' BackButton widgets require MaterialLocalizations to be provided
\n
'
' BackButton widgets require MaterialLocalizations to be provided
\n
'
' by a Localizations widget ancestor.
\n
'
' by a Localizations widget ancestor.
\n
'
'
Localizations are used to generate many different
messages,
\n
'
'
The material library uses Localizations to generate
messages,
\n
'
' labels, and abbreviations
which are used by the material library
.
\n
'
' labels, and abbreviations.
\n
'
' To introduce a MaterialLocalizations, either use a MaterialApp at
\n
'
' To introduce a MaterialLocalizations, either use a MaterialApp at
\n
'
' the root of your application to include them automatically, or
\n
'
' the root of your application to include them automatically, or
\n
'
' add a Localization widget with a MaterialLocalizations delegate.
\n
'
' add a Localization widget with a MaterialLocalizations delegate.
\n
'
...
...
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