[flutter_tools] fix RangeError in gen-l10n by checking for empty string (#107604)

This commit is contained in:
Christopher Fujino
2022-07-15 11:56:09 -07:00
committed by GitHub
parent d72853940f
commit 94da724868
3 changed files with 39 additions and 3 deletions

View File

@@ -1050,6 +1050,9 @@ class LocalizationsGenerator {
}
static bool _isValidGetterAndMethodName(String name) {
if (name.isEmpty) {
return false;
}
// Public Dart method name must not start with an underscore
if (name[0] == '_') {
return false;

View File

@@ -124,6 +124,9 @@ class L10nException implements Exception {
L10nException(this.message);
final String message;
@override
String toString() => message;
}
// One optional named parameter to be used by a NumberFormat.