🚀 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 🚀
Flutter pubspec.yaml dependencies vs dev dependencies
More Relevant Posts
-
One thing I’ve been learning lately while working with Flutter: performance issues often come from small things we don’t notice at first. For example: – Unnecessary widget rebuilds – Poor state management – Too many API calls without optimization I had a case where an app felt laggy, especially when loading data. After digging deeper, the main issue wasn’t the API it was how the UI was rebuilding too often. After refactoring the state management and reducing rebuilds, the difference was actually quite significant. It reminded me that: Good performance is not always about big changes, sometimes it’s about fixing the small details. Still exploring and improving 🚀 #Flutter #MobileDeveloper #Programming #SoftwareEngineer #TechIndonesia
To view or add a comment, sign in
-
Flutter Devs — Quick Check: Are your packages in the right place? dependencies vs dev_dependencies seems simple… but it confuses many developers early on. 👉 One small mistake can even break your app in production. 📦 dependencies Does your app actually need this package to run on a user’s device? Examples: http, dio, provider, shared_preferences 🛠️ dev_dependencies Do you only need this package while writing, testing, or building the code? Examples: flutter_test, build_runner, lints ⚠️ Common mistake: Accidentally putting a runtime package inside dev_dependencies It works perfectly in debug mode… but fails in production because it’s not included in the final build Did you know this from day one, or learned it the hard way debugging a production issue? #Flutter #Dart #MobileDevelopment #AppDevelopment #FlutterDev #SoftwareEngineering #InterviewPrep
To view or add a comment, sign in
-
Flutter Journey — Day 36/100 Today I used a widget I didn’t pay much attention to earlier. 👉 ListTile I was building a list, and earlier I was manually designing each row. It worked… but it took more code and felt inconsistent. So I switched to ListTile. • Title, subtitle, leading, trailing — all structured • Clean layout by default • Less code, better UI And honestly, it saved a lot of time. Sometimes we try to build everything from scratch… while Flutter already gives simple solutions. One thing I realized: Good developers don’t just write code. They know what to reuse. Small widget… but very useful 👍 If you have any app idea, I can help turn your idea into a real application 🤝 Also, if you're building something, let’s connect. #Flutter #FlutterDev #BuildInPublic #100DaysOfCode #Developers #Programming #UI
To view or add a comment, sign in
-
Taking Flutter Code Quality to the Next Level with Custom analysis_options.yaml One thing I’ve learned after working on multiple production Flutter apps - code quality is not optional, it’s a system. Recently, I refined my analysis_options.yaml to enforce stricter standards across my projects 👇 🔍 What I focus on: ✅ Strong typing & error prevention Enforcing always_declare_return_types Catching unrelated_type_equality_checks Avoiding hidden runtime issues early ✅ Clean & readable code prefer_const_constructors prefer_final_fields require_trailing_commas ✅ Safer architecture decisions Avoiding positional booleans Preventing redundant arguments Enforcing proper parameter handling ✅ UI & Flutter-specific improvements sized_box_for_whitespace sort_child_properties_last Cleaner widget structure 💡 Why this matters: Instead of relying on code reviews to catch everything, I let the linter act like a senior developer in my project. This helps: Reduce bugs before runtime Keep code consistent across teams Speed up development (less back-and-forth) Maintain scalability in large apps ⚙️ In large projects (especially with Clean Architecture + BLoC/Cubit), having strict lint rules = predictable and maintainable codebase 🔥 Curious - what lint rules do you consider must-have in Flutter projects? #Flutter #Dart #MobileDevelopment #CleanCode #SoftwareEngineering #BLoC #FlutterDev #CodeQuality
To view or add a comment, sign in
-
-
🐛 A Bug That Taught Me a Lesson While working on a Flutter project, I faced a strange issue. 👉 Problem: Everything was working fine in development, but in production, the app behaved differently. It was hard to find the issue. After spending time debugging, I realized: 👉 I was not handling a null value properly in one scenario. This small mistake caused unexpected behavior in production. ✅ What I learned: * Always handle null and edge cases * Don’t assume data will always be correct * Test different scenarios before release 👉 Lesson: Small mistakes can create big issues. Debugging taught me to be more careful and think deeper 🚀 #Flutter #Debugging #Developers #Learning #MobileDevelopment
To view or add a comment, sign in
-
“3 Flutter concepts that broke my brain — until they finally clicked” When I started Flutter, I wasn’t struggling with code… I was Googling the same 3 things 10+ times 😅 1. BuildContext At first, it felt like some mysterious object. Now I think of it as: 👉 A GPS location in the widget tree It tells Flutter where your widget is so it can access things like themes, routes, and inherited data. 2. Stateless vs Stateful I used to overthink this a lot. Now I just ask one question: 👉 “Will this widget ever need to update itself?” No → Stateless Yes → Stateful Simple. 3. Hot Reload vs Hot Restart This confused me the most during practice. 👉 Hot Reload = like painting over a wall (structure stays) 👉 Hot Restart = demolish and rebuild everything One keeps your app state. The other resets it completely. That difference matters a lot in real projects. The real lesson? In interviews, nobody cares about textbook definitions. They care about whether you actually understand it. Still learning. Still simplifying. If you’re learning Flutter: 👉 What’s one concept that confused you a lot? Let’s help each other grow 👇 #Flutter #FlutterDev #MobileAppDevelopment #Dart #Programming #DeveloperJourney #LearningInPublic #CodingLife #BeginnerDeveloper #BuildInPublic
To view or add a comment, sign in
-
🚀 Write Cleaner Flutter Code with Extension Methods Ever felt your code getting messy with repeated utility functions? 🤯 Let’s fix that using Extension Methods in Dart 💡 📌 What are Extension Methods? Extension methods allow you to add new functionality to existing classes 👉 without modifying their source code 🧠 Why use Extension Methods? ✅ Cleaner & readable code ✅ Reusable logic ✅ No need for helper classes ✅ Improves maintainability ⚙️ Simple Example: extension StringExtension on String { String capitalize() { return this[0].toUpperCase() + substring(1); } } void main() { print("flutter".capitalize()); // Flutter } 🔥 Flutter Use Cases: 📱 UI Helpers extension PaddingExtension on Widget { Widget withPadding([double value = 8]) { return Padding( padding: EdgeInsets.all(value), child: this, ); } } 👉 Usage: Text("Hello").withPadding(16); 🎯 More Real Use Cases: String validation ✔️ Date formatting 📅 BuildContext shortcuts 🔥 Responsive UI helpers 📱 #Flutter #Dart #ExtensionMethods #FlutterDev #MobileDevelopment #CleanCode #CodeQuality #FlutterTips #AppDevelopment #Programming #SoftwareDevelopment #Developers #Tech #CodingLife #LearnFlutter #DevCommunity #CodeNewbie #FlutterCommunity
To view or add a comment, sign in
-
-
Flutter series: Part # 11 Understanding the lifecycle of a StatefulWidget is essential for writing clean, efficient, and production-ready Flutter applications. Every StatefulWidget in Flutter follows a specific execution flow that controls how the UI is created, updated, and destroyed. The core lifecycle methods are: createState() The first method executed when a StatefulWidget is created. It creates the State object that will manage the widget's mutable data. initState() Called once when the widget is inserted into the widget tree. This is where initialization happens (API calls, controllers, and listeners are usually set up here) build() The most important method responsible for rendering the UI. This method can run multiple times whenever the widget rebuilds. dispose() Called when the widget is permanently removed from the screen. Used to clean up resources like controllers, streams, timers, and animations to prevent memory leaks. Why understanding lifecycle matters: Helps build optimized Flutter applications Prevents memory leaks and performance issues Improves widget state management Essential knowledge for serious Flutter developers If you're learning Flutter, mastering the widget lifecycle will significantly improve the way you structure your apps. Save this post for your next Flutter project. #Flutter #FlutterDev #MobileDevelopment #AppDevelopment #Dart #Programming #SoftwareEngineering #FlutterCommunity #StatefulWidget #DeveloperLife
To view or add a comment, sign in
-
🎯📱 Flutter Tip: Keep Your Widgets Small & Reusable Big widgets = Big problems 😅 💡 Common Mistake: Writing one huge widget with 200+ lines of code ❌ → Hard to read → Hard to debug → Hard to reuse ⚡ Better Approach: 🧩 Break UI into Smaller Widgets Each widget = single responsibility 🔁 Reuse Components Buttons, cards, inputs → make them reusable 🧼 Keep Code Clean Smaller files = easier maintenance 🎯 Golden Rule: If your widget feels too big… it probably is. 🚀 Result: ✔️ Cleaner code ✔️ Faster development ✔️ Easier debugging 🔥 Great Flutter apps are built with small, reusable pieces. 💭 How big is your largest widget right now? 😄 #Flutter #MobileDevelopment #CleanCode #AppDevelopment #Developers #Programming #TechTips #ReusableCode
To view or add a comment, sign in
-
-
I used to think I was not good enough at Flutter, because every time I built something, it felt incomplete. Something was always “not right”: - UI didn’t feel perfect - Code wasn’t clean enough - Logic felt messy And honestly, it used to frustrate me. At one point, I started thinking maybe I’m just not good at this. But then I noticed something important 👇 Every developer I admire also started with messy code. They just didn’t stop because of it. So I changed my approach: 👉 I stopped trying to make things perfect while building 👉 I focused on finishing first, improving later And that small shift changed everything: ✔ I started completing more projects ✔ I understood my mistakes faster ✔ I improved without overthinking every line of code 💡 Biggest lesson: You don’t grow by building perfect projects… You grow by finishing imperfect ones. Still learning. Still building. 🚀 Have you ever abandoned a project because it wasn’t “perfect” yet? #Flutter #MobileDevelopment #Coding #BuildInPublic #DeveloperJourney
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
Helpfull for me