Skip to main content

7 posts tagged with "blog"

View All Tags

Step by Step Guide to Integrate DCM Into A Flutter & Dart Open Source Package: dart_mappable

14 min read
Majid Hajian
Developer Advocate

Cover

I recently had the pleasure of collaborating with Kilian, the developer behind several Dart and Flutter open-source packages, including the popular "dart_mappable". "dart_mappable" is a package that simplifies JSON serialization, data classes, and supports powerful features like advanced inheritance and generics.

In this post, I'll walk you through how we integrated DCM into "dart_mappable" and show you how you can select rules, create baseline and start fixing issues quickly.

10 Flutter Widgets Probably Haven鈥檛 Heard Of (But Should Be Using!)

35 min read
Majid Hajian
Developer Advocate

Cover

It鈥檚 been over 6 years since I started developing with Flutter and Dart, and yet I still come across features or widgets that I didn鈥檛 know existed. It鈥檚 fascinating how a framework you work with daily can still surprise you with its depth and versatility.

In this article, I want to share some of those hidden gems I鈥檝e discovered lesser-known widgets and functionalities that can simplify your development process and add a unique touch to your apps. Moreover, we will go deeper into the implementation and explore how they are implemented to learn more about the patterns.

Let鈥檚 uncover some of these widgets together!

Demystifying Union Types in Dart, Tagged vs. Untagged, Once and For All

35 min read
Majid Hajian
Developer Advocate

Cover

Over the years and throughout my career, I have written a lot of code in various languages, such as PHP, Python, Javascript, Typescript, Dart, Java, Go, Clojure, and more. All these languages are equally good and have unique aspects that make you approach problem-solving in a certain way.

One concept seems to appear frequently, often in a rather basic manner but in fact quite complicated: Union Types. Some languages naturally support them; in others, it may seem like an impossible task.

In this article, we will be diving deep into Union Types (Untagged and Tagged Unions)鈥攚hat they are, why they鈥檙e helpful, where they fall short, and why, in strongly typed languages like Dart, you might want to reconsider their use. To convey my message better, I will write examples from different languages, including Typescript, F#, PHP, and more.

Without further ado, let鈥檚 get started.

Let鈥檚 Talk About Memory Leaks In Dart And Flutter

21 min read
Majid Hajian
Developer Advocate

Since 2006, when I started working in software development, I have faced the problem of memory leaks, particularly when using languages like Dart. The integration of Streams and asynchronous programming as a default feature in Dart introduces a level of difficulty in addressing this matter.

Memory leaks can be annoying as they are hard to spot and recreate compared to syntax errors or logic bugs that usually show up in the development phase. When it comes to memory leaks in Flutter applications, it's getting even more complex with the addition layers of widgets and controllers combined with listeners over time which may result performance issues or unexpected crashes for users after prolonged use.

Unfortunately, identifying all memory leaks isn't always straightforward when it comes to analysis since memory usage can vary based on runtime behavior patterns; nevertheless, tools like DCM and its Rules can sometimes help detect patterns that lead to memory leaks and prevent such issues.

In this article, we will explore Dart and Flutter memory leaks, how they occur, their significance in coding practices, solution to debug memory leaks and identify them such as DevTools and Leak Tracker and shifting left by relying on static analyzer tools such DCM and how they can prevent such leaks from sneaking into your code base.

Step-by-Step Guide to Integrate DCM with Open Source Dart & Flutter Packages: "Wolt Modal Sheet Use-case"

10 min read
Majid Hajian
Developer Advocate

Cover

At DCM, we understand the importance of maintaining a high-quality codebase, especially in a project as widely used as the Wolt Modal Sheet package. This package provides developers with a powerful tool for implementing responsive modals with multiple pages, smooth transitions, and scrollable content within Flutter applications. However, as projects grow and evolve, ensuring code consistency and catching potential bugs early becomes increasingly critical, particularly when maintaining an open-source project that receives multiple pull requests from different contributors.

Before we start, we'd like to mention that we offer a free OSS license for Dart and Flutter open-source packages. Check out our pricing and contact us by clicking the "Looking for OSS license?" button.

In this guide, we will walk you through the process of integrating DCM into the Wolt Modal Sheet package, covering everything from the initial setup to configuring CI pipelines and addressing code issues.

Improving Code Reviews - Tools and Practices for Dart and Flutter Projects

10 min read
Majid Hajian
Developer Advocate

Cover

Code reviews are integral to the software development lifecycle, crucial in maintaining code quality and promoting team collaboration. In this blog, I want to explore the importance of code reviews, tools, and practices to enhance the code review process and emphasize best practices specific to Dart and Flutter development. We will also discuss advanced concepts like "Shifting Left" to integrate reviews earlier in the development cycle, minimizing issues before they propagate.

Why more code is not always a bad thing

15 min read
Majid Hajian
Developer Advocate

There's a prevailing myth in software development that less code is always better. While concise code can benefit specific contexts, it doesn't necessarily equate to better code. Code quality, maintainability, and readability are often far more important than simply being less.

This article will explore why writing more code can often lead to better software, especially in Dart and Flutter applications. We'll focus on clarity, modularity, flexibility, robustness, and error handling. We'll also discuss the drawbacks of "magic" code and the importance of linting and rules in maintaining code quality.