If your ears feel full and blocked or you keep getting the sensation that they aren't able to pop properly, then flying is probably going to make this worse. It is especially important for children to avoid flying with an ear infection as they are at higher risk due to having narrower Eustachian tubes.