switch statement cleanup (#148382)
This PR is step 12 in the journey to solve issue #136139 and make the entire Flutter repo more readable. Most of it involves implementing switch expressions, and there's also a few other random things that I wanted to clean up a bit.
This commit is contained in:
@@ -226,12 +226,10 @@ abstract class GlobalMaterialLocalizations implements MaterialLocalizations {
|
||||
}
|
||||
|
||||
String? _formatDayPeriod(TimeOfDay timeOfDay) {
|
||||
switch (timeOfDay.period) {
|
||||
case DayPeriod.am:
|
||||
return anteMeridiemAbbreviation;
|
||||
case DayPeriod.pm:
|
||||
return postMeridiemAbbreviation;
|
||||
}
|
||||
return switch (timeOfDay.period) {
|
||||
DayPeriod.am => anteMeridiemAbbreviation,
|
||||
DayPeriod.pm => postMeridiemAbbreviation,
|
||||
};
|
||||
}
|
||||
|
||||
/// The raw version of [dateRangeStartDateSemanticLabel], with `$formattedDate` verbatim
|
||||
|
||||
Reference in New Issue
Block a user