Flexible optoelectronic devices