diff --git a/packages/flutter/lib/src/material/debug.dart b/packages/flutter/lib/src/material/debug.dart index dfc7837365..e90ee46ebf 100644 --- a/packages/flutter/lib/src/material/debug.dart +++ b/packages/flutter/lib/src/material/debug.dart @@ -78,8 +78,8 @@ bool debugCheckHasMaterialLocalizations(BuildContext context) { 'to be provided by a Localizations widget ancestor.' ), ErrorDescription( - 'Localizations are used to generate many different messages, labels, ' - 'and abbreviations which are used by the material library.' + 'The material library uses Localizations to generate messages, ' + 'labels, and abbreviations.' ), ErrorHint( 'To introduce a MaterialLocalizations, either use a ' diff --git a/packages/flutter/lib/src/material/text_field.dart b/packages/flutter/lib/src/material/text_field.dart index 46a92df7f9..aea451a103 100644 --- a/packages/flutter/lib/src/material/text_field.dart +++ b/packages/flutter/lib/src/material/text_field.dart @@ -4,10 +4,6 @@ // @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 'package:flutter/cupertino.dart'; @@ -354,7 +350,6 @@ class TextField extends StatefulWidget { this.scrollController, this.scrollPhysics, this.autofillHints, - bool canAssertMaterialLocalizations, }) : assert(textAlign != null), assert(readOnly != null), assert(autofocus != null), @@ -400,7 +395,6 @@ class TextField extends StatefulWidget { selectAll: true, paste: true, )), - canAssertMaterialLocalizations = canAssertMaterialLocalizations ?? true, super(key: key); /// Controls the text being edited. @@ -733,16 +727,6 @@ class TextField extends StatefulWidget { /// {@macro flutter.services.autofill.autofillHints} final Iterable 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 _TextFieldState createState() => _TextFieldState(); @@ -1004,8 +988,7 @@ class _TextFieldState extends State implements TextSelectionGestureDe @override Widget build(BuildContext context) { assert(debugCheckHasMaterial(context)); - if (widget.canAssertMaterialLocalizations) - assert(debugCheckHasMaterialLocalizations(context)); + assert(debugCheckHasMaterialLocalizations(context)); assert(debugCheckHasDirectionality(context)); assert( !(widget.style != null && widget.style.inherit == false && diff --git a/packages/flutter/test/material/debug_test.dart b/packages/flutter/test/material/debug_test.dart index 2653605a9b..b2602ffdcc 100644 --- a/packages/flutter/test/material/debug_test.dart +++ b/packages/flutter/test/material/debug_test.dart @@ -69,8 +69,8 @@ void main() { ' No MaterialLocalizations found.\n' ' BackButton widgets require MaterialLocalizations to be provided\n' ' by a Localizations widget ancestor.\n' - ' Localizations are used to generate many different messages,\n' - ' labels, and abbreviations which are used by the material library.\n' + ' The material library uses Localizations to generate messages,\n' + ' labels, and abbreviations.\n' ' To introduce a MaterialLocalizations, either use a MaterialApp at\n' ' the root of your application to include them automatically, or\n' ' add a Localization widget with a MaterialLocalizations delegate.\n'