0. support null-safety code gen 1. supports -legacy flag for legacy code gen 2. supports -hostname flag for server hostname 3. use dart official format 4. fix some some bugs Resolves: #1602
* optimize code * optimize code * optimize code * optimize code