[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Jun 12, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions packages/flutter/lib/src/material/text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// 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';
Expand Down Expand Up @@ -352,7 +348,6 @@ class TextField extends StatefulWidget {
this.scrollController,
this.scrollPhysics,
this.autofillHints,
bool canAssertMaterialLocalizations,
}) : assert(textAlign != null),
assert(readOnly != null),
assert(autofocus != null),
Expand Down Expand Up @@ -398,7 +393,6 @@ class TextField extends StatefulWidget {
selectAll: true,
paste: true,
)),
canAssertMaterialLocalizations = canAssertMaterialLocalizations ?? true,
super(key: key);

/// Controls the text being edited.
Expand Down Expand Up @@ -730,16 +724,6 @@ class TextField extends StatefulWidget {
/// {@macro flutter.widgets.editableText.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
_TextFieldState createState() => _TextFieldState();

Expand Down Expand Up @@ -1001,8 +985,7 @@ class _TextFieldState extends State<TextField> 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 &&
Expand Down