Pavement, Gravel, All Roads Point to The X
If you have never ridden a dropbar handlebar bike or never ridden one in dirt then a flatbar may be a good option for you. It's the handlebar position you have likely known how to ride with for as long as you have been riding.
Being in a familiar riding position gives you confidence in steering and balancing. The shifting is all done with your thumb so you can maintain two fingers on the brake levers for those sudden stops.
With the flatbar you are able to fit bags and racks onto the handlebars without worrying about interfering with the handlebars themselves. Or you can leave the bags at home and ride those trails like a rigid mountain bike.