getWidgetList function
List<Widget>
getWidgetList(
- Color color,
- MBTimeWindow timeWindow,
- MBTickerType tickerType,
- MBVariableForm variableForm,
- MBVariableType variableType,
- MBGraphSize graphSize,
- DateTime referenceTime, {
- double height = 100,
- 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();
}