updateContext<T> method

void updateContext<T>(
  1. String key,
  2. T value
)

Update context with key and value

key the name for the context (attribut) value can be int, double, String or boolean otherwise the update context skip with warnning log

Implementation

void updateContext<T>(String key, T value) {
  switch (value.runtimeType) {
    case int:
    case double:
    case String:
    case bool:
      _context.addAll({key: value as Object});
      break;
    default:
      print(
          "Update context manage only int , String double and boolean value in this version ");
  }
}