toMap method

Map<String, dynamic>? toMap()
inherited

Implementation

Map<String, dynamic>? toMap() {
  final x = {
    "primary": _stringify(primary),
    "secondary": _stringify(secondary),
    "tertiary": _stringify(tertiary),
    "error": _stringify(error),
    "warning": _stringify(warning),
    "disable": _stringify(disable),
    "light": _stringify(light),
    "lightAsFixed": _stringify(lightAsFixed),
    "dark": _stringify(dark),
    "darkAsFixed": _stringify(darkAsFixed),
    "mid": _stringify(mid),
    "holo": _stringify(holo),
    "soft": _stringify(soft),
    "deep": _stringify(deep),
  };
  final y = x.entries.where((e) {
    if (e.value == null) return false;
    return true;
  });
  if (y.isEmpty) return null;
  return Map.fromEntries(y);
}