is buddhism outside the idealism and materialism?
Buddhism points out that both are concepts, reality is free of concepts (unless we impose them).

In my experience concepts like idealism etc. are deeply ingrained, unlike "my nose is itchy", so it's useful to remember they're just in my head.