A Unified Model for Repeating and Non-repeating Fast Radio Bursts