Upgrade to Pro — share decks privately, control downloads, hide ads and more …

KonMari your Flutter code using DCM 🧹

KonMari your Flutter code using DCM 🧹

As Flutter projects scale, code clutter increases: unused files, oversized widgets, and spaghetti dependencies slow down development. What if we could organize our codebase like we tidy our homes?

Inspired by Marie Kondo’s KonMari Method, this talk explores organizing and maintaining Flutter codebases using DCM (Design Code Metrics).

We will recap the latest features that DCM provides to eliminate unnecessary code, optimize widgets, manage assets, and address code smells and violations.
By the end of this talk, developers will learn multiple approaches to reducing technical debt, improving code quality, and maintaining a codebase that truly “sparks joy”.

Key Takeaways:
- Showcase cleanup strategies to identify and remove unused code, assets, and inefficient widgets.
- Applying DCM for code health by using static analysis, widget insight to increase quality.
- Using metrics to reveal features that are challenging to scale and modify.

Target Audience:
Flutter developers of all levels who are interested in improving code quality, optimizing performance, and cleaning up their projects, especially those working on large codebases.

Link: https://dcm.dev/

Avatar for gerfalcon

gerfalcon

May 29, 2025
Tweet

More Decks by gerfalcon

Other Decks in Programming

Transcript

  1. KonMari your Flutter code using . Csongor Vogel Staff Software

    Engineer at talabat, Delivery Hero Co-organizer of Flutter Abu Dhabi & Dubai gerfalcon GerfalconVogel csongorvogel
  2. About me • Staff Software Engineer at talabat • Lecturer

    at Budapest University of Technology and Economics • Co-organizer of Flutter Abu Dhabi & Dubai
  3. Which outfit is actually clean? And ironed?! Where's that specific

    conference T-shirt I know I have somewhere? Do these socks even match? And where on earth is the other one?! My phone! Where did I leave my phone?! Is my phone even charged for the day? If not, which of these tangled chargers is the right one and where's a socket? Where's my event badge? My notebook? Honestly, where do I even start looking in all this? Am I going to miss the keynote because of this room?! What...?
  4. How do I set this up? Which dependencies are safe?

    What are the core libraries? Should I reuse this component or copy it? Will modifying this giant widget break everything? Where is the code for Feature X anyway? Is this function dead code, or critical? Why three state management patterns here?! If I change this, what breaks across 300 packages? Any trustworthy tests? CI's failing – my PR or master? How much time will this sinkhole cost me before I even code? What now...?
  5. As projects scale, code clutter increases • 🕸 Legacy code

    from the past • 🐘 Unused assets and dependencies bloat the project size • 🧩 Widgets become overly complex • 🚧 Lack of standards, inconsistent code makes navigation difficult • 🐌 Technical debt accumulates, slowing down the development of new features • 🗺 Onboarding new team members becomes a treasure hunt
  6. KonMari Method by Marie Kondo Rule 1: Commit Yourself to

    Tidying Up Rule 2: Imagine Your Ideal Lifestyle Rule 3: Finish Discarding First Rule 4: Tidy by Category, Not by Location Rule 5: Ask Does it spark joy?
  7. DCM • An advanced static analysis tool for Dart and

    Flutter • Improve your code quality by identifying: • Code smells and violations against best practices • Unused code, files, and assets • Dependency issues • Metrics (complexity, size, etc.)
  8. A codebase that Sparks Joy✨ • 🧹 Reduced technical debt

    and fewer hidden bugs • ⚡ Faster build times and improved app performance • 🤝 Consistent coding standards across the team • 💡 Clean, understandable, and easy to navigate • 🌱 Easier and quicker onboarding for new developers • 🛠 More time spent on building features, less on firefighting
  9. Timeline for adoption Preparation Execution & Automation Monitoring / Improvement

    • Align on the main categories • Define Rules, Severity Levels • Project Configuration • Conduct internal Trainings • Establish a Feedback Loop • Integrate with CI/CD - run on PRs • Introduce it gradually • Optional Check • Baseline • Different Severities • Start addressing violations • Track Dashboards • Measure Impact • Encourage additional Standards (by implementing Custom Rules) • Evaluating Presets, new rules • Planning additional categories using other features ⚙ ▶ 📊
  10. Resources and further materials • KonMari Method™ - Marie Kondo

    (konmari.com) • Dart Code Metrics (dcm.dev) • Effective Dart Style Guide (dart.dev/effective-dart) • Dart analyzer Package (pub.dev/analyzer) • Flutter Lints Package (pub.dev/flutter_lints v6.0.0) • Custom Lint Package - Invertase (pub.dev/custom_lint) • Danger (danger.systems) • Flutter Engineering - Majid Hajian (flutterengineering.io) • Building Mobile Apps at Scale: 39 Engineering Challenges - Gergely Orosz (mobileatscale.com)