from static method

TWidgetTheme from(
  1. bool isDarkMode,
  2. Color color,
  3. TVariant type
)

Implementation

static TWidgetTheme from(bool isDarkMode, Color color, TVariant type) {
  final key = _cacheKey(color, type, isDarkMode);

  return _baseThemeCache.putIfAbsent(key, () {
    return switch (type) {
      TVariant.solid => solidTheme(color, isDarkMode),
      TVariant.tonal => tonalTheme(color, isDarkMode),
      TVariant.outline => outlineTheme(color, isDarkMode),
      TVariant.softOutline => softOutlineTheme(color, isDarkMode),
      TVariant.filledOutline => filledOutlineTheme(color, isDarkMode),
      TVariant.text => textTheme(color, isDarkMode),
      TVariant.softText => softTextTheme(color, isDarkMode),
      TVariant.filledText => filledTextTheme(color, isDarkMode),
    };
  });
}