I never had a problem with carrots or potatoes and fruit flies, but then again I started my last colony this past fall and fruit flies were less of an issue in general. In my first colony I put all sorts of crazy things in there and had flies aplenty, but they didn't really create any issues for the mealworms as much as they were just a pest. I didn't have great success using sweet potato with this last colony, but I'm not sure why. They just didn't seem to like it as much.
They will eat whatever substrate you have in there, be it oats, wheat bran, etc, but I do recommend supplementing either way. My first colony used a substrate of rolled oats, mixed whole grains, alfalfa, and dog food all ground up together. I didn't like how the consistency of that tended to clump and compact, and their frass seemed to just stick to and mix around with everything. The finer particles would just settle in with the frass and I'm not even sure they were being consumed - or if they were, they were eating the frass with them. When I got my last colony I switched to wheat bran as a substrate, which in my limited experience was a much better consistency and a lot cleaner. I supplemented with mixes of any/all of the following, depending on what I had on hand or going stale in the pantry:
Whatever feed I had on hand - starter, grower, supplemental, mix, etc
Fish food, in my case pellets for pond fish but flakes would work
Soybean meal
Chia/flax/hemp seeds
Nonfat milk powder
Forage or alfalfa pellets (the forage I had was Haystack Naturals Special Blend)
High quality dog food
Corn meal
Various flours - wheat, coconut, almond, chickpea
I measured it all whole into a few Pyrex casserole dishes and baked on a low temp in the oven for about 20-30 mins to kill the grain mites. I HIGHLY recommend this step, not only for their substrate but any supplemental feed you put in there. After that I ground it into a fine powder in my coffee/spice grinder and sealed it in a large Ziploc bag.
To feed, I would place a piece of bread down in the bin and dump a pile of the feed on top of it. This prevents the feed from getting mixed into the substrate and lost on the bottom from all of the wriggling. Trust me - they will smell it and they will come to it. It was also an easier way for me to gauge their interest. I experimented with different mixes and would see which piles disappeared sooner, etc. As a bonus, they enjoy eating the bread too and that is another supplement form of moisture for a short time.
One other thing you could try is something like kale or cabbage leaves for moisture (or broccoli leaves for anyone who grows it). I'm not sure how well they'd work as a sole source, but I grew these in my garden and would place some spare leaves in from time to time. I used the leaves from the cabbage plants and not leaves from the heads, but I imagine those would work fine if not a potential source of some stank if you're not careful. Other greens would probably work too - dandelion greens, etc. Just be careful they're from somewhere that isn't treated.
Cabbage is known for having a healthy natural bloom on it (lots of natural Lactobacillus bacteria, which produce lactic acid as a byproduct and this is how and why we wind up with sauerkraut and kimchi.) I have a theory that the mealworms and beetles are naturally attracted to that bloom. Compost worms don't actually eat the raw material but rather the byproduct of bacterial decomposition. In nature, darkling beetles are often found living in decaying material, so I wondered if perhaps they also benefit from bacteria or their byproducts. When I placed one of my cabbage leaves with a clear bloom (looks like a powdery film, like you might note on plums or blueberries before they are washed) in my experimental bin alongside any number of other favourites, like banana peel (you want to talk fruit flies!), other greens, carrots, etc, they swarmed the bloomy cabbage leaves and had them chomped down to a dried little skeleton before they even seemed to notice the other materials.
I tossed a whole guard I grew in my last bin. They gnawed their way in through the tough skin and went to town hollowing it out. All they left were the dry remains of some seeds - picked clean. I think they were even starting to eat those.
Just some of my casual observations. I had a ton of mealworms in my last bin so they could often clean up scraps long before they stood a chance of rotting. As always, your mileage may vary. Experimenting is fun and I encourage it, but I also strongly recommend creating a separate smaller sacrificial experimental bin for such purposes.
@SolarDuck - you are in FL, right? Do you have easy access to a lot of yucca there? I get it for my dogs' homemade food (spoiled pups) and the thought recently crossed my mind that it could be great for mealworms potentially. If my broken thermostat hadn't committed mass mealworm murder I would have tried it in my last bin. The wax on the outside would prob be great at preventing wet substrate, and you could prob just cut out a little piece in the peel as an opening start for them.
Happy sciencing and insect husbandry!