mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
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.
This commit is contained in:
parent
34b42acf1b
commit
71228e02c6
@ -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`.
|
||||||
|
Loading…
Reference in New Issue
Block a user