enableRecodeCategoric function

bool enableRecodeCategoric(
  1. String vname,
  2. WidgetRef ref
)

Determines if vname can be recoded as categorical based on its type.

Implementation

bool enableRecodeCategoric(String vname, WidgetRef ref) {
  Map meta = ref.watch(metaDataProvider);

  if (meta.containsKey(vname) &&
      meta[vname] is Map &&
      (meta[vname] as Map).containsKey('datatype') &&
      (meta[vname]['datatype'] is List) &&
      (meta[vname]['datatype'] as List).contains('character')) {
    return true;
  }

  return false;
}