Flexoelectric response of a liquid crystal layer with a temperature-induced orientational transition