ActiveTalker.fromJson constructor

ActiveTalker.fromJson(
  1. dynamic json
)

Implementation

ActiveTalker.fromJson(dynamic json) {
  try {
    if (json != null && json['activeList'] != null && json['activeList'] is List) {
      _activeList = [];
      (json['activeList'] as List).forEach((v) {
        try {
          if (v != null) {
            _activeList?.add(ActiveList.fromJson(v));
          }
        } catch (e) {
          print('Error parsing individual ActiveList item: $e');
          // Skip malformed items instead of failing completely
        }
      });
    } else {
      _activeList = [];
    }
  } catch (e) {
    print('Error parsing ActiveTalker JSON: $e');
    _activeList = [];
  }
}