Skip to content

Commit 5d5c385

Browse files
authored
[cupertino_ui] replace identical checks with equality when dealing with enums (flutter#12632)
previous PRs: - flutter#191537 - flutter#191788 - flutter/packages#12633 see - dart-lang/language#1811 - dart-lang/language#312 more info : - dart-lang/sdk#26980 - dart-lang/sdk#36511 - dart-lang/sdk#36564 - dart-lang/sdk#36528 ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent b929854 commit 5d5c385

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎packages/cupertino_ui/lib/src/text_field.dart‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,9 @@ class CupertinoTextField extends StatefulWidget {
340340
assert(maxLength == null || maxLength > 0),
341341
// Assert the following instead of setting it directly to avoid surprising the user by silently changing the value they set.
342342
assert(
343-
!identical(textInputAction, TextInputAction.newline) ||
343+
textInputAction != TextInputAction.newline ||
344344
maxLines == 1 ||
345-
!identical(keyboardType, TextInputType.text),
345+
keyboardType != TextInputType.text,
346346
'Use keyboardType TextInputType.multiline when using TextInputAction.newline on a multiline TextField.',
347347
),
348348
keyboardType =
@@ -480,9 +480,9 @@ class CupertinoTextField extends StatefulWidget {
480480
assert(maxLength == null || maxLength > 0),
481481
// Assert the following instead of setting it directly to avoid surprising the user by silently changing the value they set.
482482
assert(
483-
!identical(textInputAction, TextInputAction.newline) ||
483+
textInputAction != TextInputAction.newline ||
484484
maxLines == 1 ||
485-
!identical(keyboardType, TextInputType.text),
485+
keyboardType != TextInputType.text,
486486
'Use keyboardType TextInputType.multiline when using TextInputAction.newline on a multiline TextField.',
487487
),
488488
keyboardType =

0 commit comments

Comments
 (0)