Yes you can build the deck off the wall about a 1/2 inch or so.
The web site
www.decks.com has a good picture of what to make your flashing look like.
The only thing they leave ouy on these sites is that you need to use COPPER flashing now.If you are using pressure treated lumber you CAN NOT use ALUMINUMN or even coated /painted steel or aluminumn.
The new lumber reacts with these lighter gaged metals so to speak.(Don't want to get into electrolosis)
Copper or stainles steel(expensive and hard to do) are the only acceptable methods I know of.
Also keep the siding off the top deck boards so the siding can breath.You should be One inch off the top with a weep screed at the bottom of the stucco.
This is the same steel piece at the bottom of your siding at the ground.Your stucco should not go into the ground.
Hope this helps..
Seen way to many ledger failures.
InspectorD