title: How to remove or identify unused packages from flutter to reduce size of the project?
body: <p>I used some packages that I no longer need in my flutter project, namely the <code>wilddog_auth</code> and <code>wilddog_sync</code>, I can remove the imports from <code>pubspec.yaml</code> file, and my dart files (aka removing <code>import 'package:wilddog_sync/wilddog_sync.dart'</code> etc.) and remove imports in MainActivity.java as well as in Xcode project but I can't purge the unused files installed by flutter, cocoapod and gradle. Now is there a unified command in flutter where I can remove all unused packages at once?</p>
  
  <p>I am pretty sure using <code>flutter clean</code> only removes build folder and using <code>flutter packages get</code> after removing packages from <code>pubspec.yaml</code> doesn't remove packages from <code>cocoapod</code> or <code>gradle</code> either.</p>
  
  <p>For example, after <code>flutter clean</code> and <code>flutter packages get</code> I rebuilt the project:</p>
  
  <pre><code>Launching lib/main.dart on Android SDK built for x86 64 in debug mode...
  Initializing gradle...
  Resolving dependencies...
  Running 'gradlew assembleDebug'...
  Built build/app/outputs/apk/debug/app-debug.apk.
  Installing build/app/outputs/apk/app.apk...
  I/FlutterActivityDelegate(11331): onResume setting current activity to this
  I/Choreographer(11331): Skipped 107 frames!  The application may be doing too much work on its main thread.
  D/EGL_emulation(11331): eglMakeCurrent: 0x79f21b4dbec0: ver 2 0 (tinfo 0x79f219b4f160)
  I/OpenGLRenderer(11331): Davey! duration=1903ms; Flags=1, IntendedVsync=7544454683637, Vsync=7546238016899, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=7546253803603, AnimationStart=7546253996603, PerformTraversalsStart=7546254171603, DrawStart=7546279222603, SyncQueued=7546288526603, SyncStart=7546295569603, IssueDrawCommandsStart=7546296644603, SwapBuffers=7546334455603, FrameCompleted=7546365204603, DequeueBufferDuration=2892000, QueueBufferDuration=199000, 
  Syncing files to device Android SDK built for x86 64...
  D/        (11331): HostConnection::get() New Host Connection established 0x79f219ab81e0, tid 11383
  D/EGL_emulation(11331): eglMakeCurrent: 0x79f21b5e26e0: ver 2 0 (tinfo 0x79f219aa66c0)
  W/IInputConnectionWrapper(11331): getCursorCapsMode on inactive InputConnection
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/WAFph.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/WAFph.jpg" alt="cocoapods"></a>
  <a href="https://i.stack.imgur.com/R6dSK.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/R6dSK.jpg" alt="gradle"></a></p>
  
  <p>Yet all the package files remained.</p>
  
  <p>Of course I could go into <code>./ios/</code> to run <code>pods install</code> to remove pods:</p>
  
  <pre><code>pod install
  Analyzing dependencies
  Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
  Removing Wilddog
  Removing WilddogCore
  Removing WilddogSync
  Downloading dependencies
  Using Flutter (1.0.0)
  Generating Pods project
  Integrating client project
  Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
  
  [!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
  </code></pre>