Unverified Commit 97dc7eee authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

Step 3 of 3: Remove opt-in for debugCheckHasMaterialLocalizations assertion on TextField (#58831)

parent ff7538f7
...@@ -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, labels, ' 'The material library uses Localizations to generate messages, '
'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 '
......
...@@ -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,7 +988,6 @@ class _TextFieldState extends State<TextField> implements TextSelectionGestureDe ...@@ -1004,7 +988,6 @@ 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(
......
...@@ -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'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment