Could heart flutter be a side effect of pain medication such as morphine?

Unlikely. Pain itself can cause elevated heart rate and palpitations, but opiated don't typically cause fluttering or palpitations. I would check further with your doctor to ensure there's not some other issue here.
Heart flutter. Not usually - however opioids can cause heart rhythm issues in a very small number of patients. Your description of flutter should not be confused with the medical (a doctors) understanding which is life threatening. I think you mean palpitation.