Flutter pubspec.yaml dependencies vs dev dependencies

🚀 Dependencies vs Dev Dependencies in Flutter (pubspec.yaml) While working on Flutter projects, understanding pubspec.yaml is very important, especially the difference between dependencies and dev_dependencies. 📦 dependencies These packages are required for the app to run in production. 👉 Used at runtime 👉 Included in the final build 👉 Example: HTTP requests (http) State management (provider, bloc) Local storage (shared_preferences) dependencies: flutter: sdk: flutter http: ^1.2.0 provider: ^6.0.0 🛠 dev_dependencies These packages are only needed during development phase. 👉 Not included in production build 👉 Used for testing, code generation, linting 👉 Example: flutter_test build_runner flutter_lints dev_dependencies: flutter_test: sdk: flutter build_runner: ^2.4.0 flutter_lints: ^3.0.0 ⚡ Quick Difference 📌 dependencies → App run karne ke liye 📌 dev_dependencies → App build aur test karne ke liye 💡 Simple rule: > If it affects users → dependencies If it helps developers → dev_dependencies #Flutter #Dart #MobileDevelopment #FlutterDev #Programming #SoftwareEngineering 🚀

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories