collectAllTabsData static method

Map<String, dynamic> collectAllTabsData(
  1. List<String> tabs,
  2. Map<String, dynamic> templateData
)

Static method to collect data from all controller instances

Implementation

static Map<String, dynamic> collectAllTabsData(List<String> tabs, Map<String, dynamic> templateData) {
  Map<String, dynamic> allTabsData = {};

  for (String tabName in tabs) {
    // Try to find the controller for this tab
    // Since controllers are created with unique tags, we need to find them differently
    // For now, we'll use the template data as base
    Map<String, dynamic> tabData =
    Map<String, dynamic>.from(templateData[tabName] ?? {});

    // Try to find the controller instance for this tab
    // This is a simplified approach - in a real implementation, you might want to store controller references
    allTabsData[tabName] = tabData;
  }

  return allTabsData;
}