Skip to content

Commit 71228e0

Browse files
authored
Prepare for making intl toBeginningOfSentenceCase non-nullable (#127488)
I intend to edit `toBeginningOfSentenceCase`'s return value to be non-nullable because it really is never null. That will mean that non-null asserts around it will become flagged as unnecessary, although right now they are necessary. So, apply a workaround - instead use a function that does a non-null assert without triggering any lints even after it becomes unnecessary.
1 parent 34b42ac commit 71228e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/flutter_tools/lib/src/base/utils.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ String sentenceCase(String str, [String? locale]) {
5959
if (str.isEmpty) {
6060
return str;
6161
}
62-
return toBeginningOfSentenceCase(str, locale)!;
62+
// TODO(christopherfujino): Remove this check after the next release of intl
63+
return ArgumentError.checkNotNull(toBeginningOfSentenceCase(str, locale));
6364
}
6465

6566
/// Converts `foo_bar` to `Foo Bar`.

0 commit comments

Comments
 (0)