getWidgetList function

List<Widget> getWidgetList(
  1. Color color,
  2. MBTimeWindow timeWindow,
  3. MBTickerType tickerType,
  4. MBVariableForm variableForm,
  5. MBVariableType variableType,
  6. MBGraphSize graphSize,
  7. DateTime referenceTime, {
  8. double height = 100,
  9. dynamic variable,
})

Implementation

List<Widget> getWidgetList(
  Color color,
  MBTimeWindow timeWindow,
  MBTickerType tickerType,
  MBVariableForm variableForm,
  MBVariableType variableType,
  MBGraphSize graphSize,DateTime referenceTime, {
  double height = 100,
  dynamic variable,

}) {
  variable ??= mockVariable;

  return widgetRegistry.values
      .where((builder) {
        final GraphWidget graph = builder(variable, color, timeWindow, tickerType, graphSize, height, referenceTime);
        return graph.allowedSizes.contains(graphSize) && graph.allowedVariableForms.contains(variableForm) && graph.allowedVariableTypes.contains(variableType); // ✅ Filter by size first
      })
      .map((builder) => builder(variable, color, timeWindow, tickerType, graphSize, height, referenceTime))
      .toList();
}