TableController.fromJson constructor
TableController.fromJson(})
Create from JSON (convenience factory)
Implementation
factory TableController.fromJson(
Map<String, dynamic> json, {
void Function(double scrollTop, double scrollHeight, double clientHeight)? onScroll,
}) {
// Handle nested visualResponse structure
final configJson = json.containsKey('visualResponse')
? json['visualResponse'] as Map<String, dynamic>
: json;
// Create config from JSON
final baseConfig = TableConfig.fromJson(configJson);
final data = (json['tableValues'] as List?)
?.whereType<Map<String, dynamic>>()
.toList() ??
[];
return TableController(config: baseConfig, data: data)..onScroll = onScroll;
}