Here are two ways to do it, one using a command (which turns on flat-view and sets the hide-filename-filter to *), another using a style (which does the same thing in a different way):
Edit 2019: If you want a button that toggles Flat View and the filter at once: