No dont take imodium stay hydrated as much as you can and get in touch with your doctor asap. I know you said you have stomach flu but if its anything pregnancy related imdodium will mask it and not treat it. Your baby wont be at any harm while your unwell so dont panic. I had similar problems when I couldn't keep food down and my doctor said best thing is to stay hydrated for both of you. He might prescribe you with something xx
I would call ur doctor and ask or call an after hour nurse and ask and in the meantime keep drinking water