Encapsulate widget with fragment gives an error

@Robbe_Keters, @mrkimedo, could you show more function code or explain where you are trying to return a Fragment?