fixDir method
This will change the direction of the Flex according to the direction specified in the engine. Here we assume, whenever we are talking about Axis.horizontal, i.e Row, we meant the main axis and vice versa.
Implementation
Flex fixDir(BarChartEngine engine) {
return (direction == Axis.horizontal)
? applyAxisConfig(engine.flex.main)
: applyAxisConfig(engine.flex.cross);
}