Fix dislocated doc and comment on ThemeData localize cache (#137315)

This comment on _localizedThemeDataCacheSize was a bit garbled from getting split up, and the doc on _localizedThemeDataCache was missing from having been moved elsewhere.

It looks like the dislocation happened in 8b86d238b (#116088), which was otherwise making unrelated changes, including a couple of lines near these.  Likely it was due to an error in resolving merge or rebase conflicts at some point while revising that PR.
This commit is contained in:
Greg Price 2023-10-26 13:57:52 -07:00 committed by GitHub
parent d737038f39
commit 5b3293c5ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1465,13 +1465,6 @@ class ThemeData with Diagnosticable {
Color get toggleableActiveColor => _toggleableActiveColor!;
final Color? _toggleableActiveColor;
// The number 5 was chosen without any real science or research behind it. It
// copies of ThemeData in memory comfortably) and not too small (most apps
// shouldn't have more than 5 theme/localization pairs).
static const int _localizedThemeDataCacheSize = 5;
/// Caches localized themes to speed up the [localize] method.
/// Creates a copy of this theme but with the given fields replaced with the new values.
///
/// The [brightness] value is applied to the [colorScheme].
@ -1708,7 +1701,14 @@ class ThemeData with Diagnosticable {
bottomAppBarColor: bottomAppBarColor ?? _bottomAppBarColor,
);
}
// The number 5 was chosen without any real science or research behind it. It
// just seemed like a number that's not too big (we should be able to fit 5
// copies of ThemeData in memory comfortably) and not too small (most apps
// shouldn't have more than 5 theme/localization pairs).
static const int _localizedThemeDataCacheSize = 5;
/// Caches localized themes to speed up the [localize] method.
static final _FifoCache<_IdentityThemeDataCacheKey, ThemeData> _localizedThemeDataCache =
_FifoCache<_IdentityThemeDataCacheKey, ThemeData>(_localizedThemeDataCacheSize);