getTheme method

Returns the SVG theme.

This method retrieves the theme, checking the provided theme first, and then falling back to the default theme if no theme is provided.

Implementation

@visibleForTesting
@protected
SvgTheme getTheme(BuildContext? context) {
  if (theme != null) {
    return theme!;
  }
  if (context != null) {
    final SvgTheme? defaultTheme = DefaultSvgTheme.of(context)?.theme;
    if (defaultTheme != null) {
      return defaultTheme;
    }
  }
  return const SvgTheme();
}