Unverified Commit 71228e02 authored by Oleh Prypin's avatar Oleh Prypin Committed by GitHub

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.
parent 34b42acf
...@@ -59,7 +59,8 @@ String sentenceCase(String str, [String? locale]) { ...@@ -59,7 +59,8 @@ String sentenceCase(String str, [String? locale]) {
if (str.isEmpty) { if (str.isEmpty) {
return str; return str;
} }
return toBeginningOfSentenceCase(str, locale)!; // TODO(christopherfujino): Remove this check after the next release of intl
return ArgumentError.checkNotNull(toBeginningOfSentenceCase(str, locale));
} }
/// Converts `foo_bar` to `Foo Bar`. /// Converts `foo_bar` to `Foo Bar`.
......
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