Different Screen Sizes with same code base

What is the best technique to support deployment of code to multiple devices with different screen sizes while maintaining the core logic identically between them? Would it be to have multiple layouts with the same widget names and use #ifdef blocks to activate or inactivate them? Same with the device driver code functions?

the MUSIC demo is used responsive layout, might be able to give you some ideas

Thanks I’ll take a look. But I also mean devices with different chips and drivers. So one might use SPI and the other parallel, and different touch drivers. Can I detect the chipsets in setup and activate different functions, or do I have to have separate code bases. Every demo I see is customized for the particular board it’s being deployed onto.