getResolvedValueFromTheme function Null safety

Map<String, dynamic> getResolvedValueFromTheme(
  1. BuildContext context,
  2. dynamic k,
  3. Map<String, dynamic> v,
  4. dynamic val
)

Implementation

Map<String, dynamic> getResolvedValueFromTheme(
    BuildContext context, k, Map<String, dynamic> v, val) {
  dynamic theme =
      NativeBaseProvider.of(context).toJson()[propConfig[k]["scale"]];

  return {
    k: theme?.toJson()[val] ??
        (val != null ? convertToDouble(val.toString()) : val),
  };
}