toJson method

  1. @override
Map<String, dynamic> toJson()

Convert this preset value to its encodable hashmap of String to it's encodable data. Override this method to declare how this field can be converted to it's encodable version.


Map<String, dynamic> toJson() {
  const t = TextThemeCodec();
  return {
    'background': t.encode(background),
    'foreground': t.encode(foreground),
    'primary': t.encode(primary),
    'secondary': t.encode(secondary),
    'ascent': t.encode(ascent),
    //...on surface
    'onPrimary': t.encode(onPrimary),
    'onSecondary': t.encode(onSecondary),
    'onAscent': t.encode(onAscent),
    'success': t.encode(success),
    'error': t.encode(error),
    'warning': t.encode(warning),