Scaling theory of the metal-insulator transition in amorphous materials