getFlexDirection function