updateFundamentalThemeData method

void updateFundamentalThemeData(
  1. ThemeData themeData
)

This is called internally by AFib and should not really exist.

It appears it is only possible to get a valid themeData using an actual BuildContext, which fills in certain typography information based on the locale. As a result, we need to update the state during the actual render, which shouldn't really be necessary.

I initially tried re-creating all the theming info during every render, which is the redux/immutable way to go about it, but it caused my test suite execution time to double. Manually updating the themeData works because the themeData is constant across all the renders, and we recreate the fundamental and conceptual themes any time the themeData would actually change.

Implementation

void updateFundamentalThemeData(ThemeData themeData) {
  final fundamentals = internalOnlyActiveStore.state.public.themes.fundamentals;
  fundamentals.updateThemeData(themeData);
}