Migrate flutter_localizations to null safety. (#68645)

Migrate flutter_localizations to null safety.
This commit is contained in:
Darren Austin
2020-11-12 15:13:51 -08:00
committed by GitHub
parent 2a5aa29442
commit 1c7e34bb20
25 changed files with 5532 additions and 5401 deletions

View File

@@ -382,15 +382,20 @@ $factoryDeclaration
///
/// Used by [generateGetter] below.
String generateType(Map<String, dynamic> attributes) {
bool optional = false;
String type = 'String';
if (attributes != null) {
optional = attributes.containsKey('optional');
switch (attributes['x-flutter-type'] as String) {
case 'icuShortTimePattern':
return 'TimeOfDayFormat';
type = 'TimeOfDayFormat';
break;
case 'scriptCategory':
return 'ScriptCategory';
type = 'ScriptCategory';
break;
}
}
return 'String';
return type + (optional ? '?' : '');
}
/// Returns the appropriate name for getters with the given attributes.