Refactor - 建立可重複使用的 widget
        
      
        Why don’t I see the full article?
      
        
            This article is part of a book for purchase. Purchase the book to access this article.
            
              
        
    WriterShelf™ is a unique multiple pen name blogging and forum platform. Protect relationships and your privacy. Take your writing in new directions. ** Join WriterShelf**
      
        WriterShelf™ is an open writing platform. The views, information and opinions in this article are those of the author.
      
  
          Article info
        
        
    This article is part of:
  
    
            
              Categories:
            
            
                    
⟩
⟩
                  
                  
                    
⟩
⟩
                  
                  
                    
⟩
⟩
                  
            
              Tags:
            
            
              Date:
            
            
              Published: 2021/09/25 - Updated: 2021/10/31
            
          
              Total: 3362 words
          
      
              Like
              
              or Dislike
              
            
          About the Author
          很久以前就是個「寫程式的」,其實,什麼程式都不熟⋯⋯
就,這會一點點,那會一點點⋯⋯
        More to explore
      
       
 
 
 
 
 
 
 

 

本篇詳細的介紹了怎麼在 Flutter 中分享一個功能,這也是 refactor 的一個很重要部分,我們把播音功能與介面獨立出來,現在可以很簡單的在不同的畫面分享共用。
Refactoring:在寫程式的世界裡,指的就是進化程式碼,讓它更 DRY(就是不要重複,這是大忌,還記得嗎?),更易讀,當然也要把壞的臭酸碼拿掉,現在我們就需要 refactoring 了,...