svg static method
- String code,
- BuildContext context
Interpolates all the theme colors into the given code
.
Implementation
static String svg(String code, BuildContext context) {
var encoded =
code.replaceAll(accentColor, _toHex(context.theme.colorScheme.primary));
encoded = encoded.replaceAll(
textColor, _toHex(context.theme.textTheme.bodyLarge!.color!));
encoded = encoded.replaceAll(
secondaryColor, _toHex(context.theme.colorScheme.background));
encoded = encoded.replaceAll(
primaryColor, _toHex(context.theme.colorScheme.surface));
encoded =
encoded.replaceAll(tertiaryColor, _toHex(context.theme.dividerColor));
return encoded;
}