takeFromMap method

  1. @override
void takeFromMap(
  1. Map<String, dynamic>? from, {
  2. bool copyEntries = true,
})
override

Used for meta-forms in setting deep properties

Implementation

@override
void takeFromMap(Map<String, dynamic>? from, {bool copyEntries = true}) {
  if (from == null) return;

  super.takeFromMap(from, copyEntries: copyEntries);
  for (final entry in from.entries) {
    final key = entry.key;
    final value = entry.value;
    if (value == null) continue;
    switch (key) {
      case "path":
        _path = JsonPath.fromJson(value);
        break;
      case "verb":
        _verb = value as String;
        break;
      case "label":
        _label = value as String;
        break;
      case "factRef":
        _factRef = MSchemaRef.fromJson(value);
        break;
      case "isFlexible":
        _isFlexible = value as bool;
        break;
      case "remindableInfo":
        _remindableInfo = IRemindableInfo.fromJson(value);
        break;
      case "agent":
        _agent = IFactAgent.fromJson(value);
        break;
      case "timeSensitivity":
        _timeSensitivity = ITimeSensitivity.fromJson(value);
        break;
      case "followUpLabel":
        _followUpLabel = value as String;
        break;
      case "priority":
        _priority = value as int;
        break;
      case "isHistorical":
        _isHistorical = value as bool;
        break;
      case "isFuture":
        _isFuture = value as bool;
        break;
      case "isStart":
        _isStart = value as bool;
        break;
      case "isEnd":
        _isEnd = value as bool;
        break;
      case "isExpiration":
        _isExpiration = value as bool;
        break;
      case "isTimestamp":
        _isTimestamp = value as bool;
        break;
      case "hasTime":
        _hasTime = value as bool;
        break;
      case "recurs":
        _recurs = IFactRecurrence.fromJson(value);
        break;
      case "dateTokens":
        _dateTokens = (value as List).cast<String>();
        break;
      default:
        break;
    }
  }
}