Unverified Commit 5b3293c5 authored by Greg Price's avatar Greg Price Committed by GitHub

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 8b86d238 (#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.
parent d737038f
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment