TableController.fromJson constructor

TableController.fromJson(
  1. Map<String, dynamic> json
)

Create from JSON (convenience factory)

Implementation

factory TableController.fromJson(Map<String, dynamic> json) {
  // Handle nested visualResponse structure
  final configJson = json.containsKey('visualResponse')
      ? json['visualResponse'] as Map<String, dynamic>
      : json;

  final config = TableConfig.fromJson(configJson);
  final data = (json['tableValues'] as List?)
          ?.whereType<Map<String, dynamic>>()
          .toList() ??
      [];

  return TableController(config: config, data: data);
}