Flutter Design Patterns: Introduction

Muhammad Omer Shafique
2 min readOct 31, 2022

--

Introduction to a series of articles about design patterns and their implementation in Dart and Flutter

A design pattern provides a general reusable solution for the common problems that occur in software design. The pattern typically shows relationships and interactions between classes or objects. The idea is to speed up the development process by providing well-tested, proven development/design paradigms. Design patterns are programming language-independent strategies for solving a common problem. That means a design pattern represents an idea, not a particular implementation. Using design patterns, you can make your code more flexible, reusable, and maintainable.

It’s not mandatory to consistently implement design patterns in your project. Design patterns are not meant for project development. Design patterns are meant for common problem-solving. Whenever there is a need, you have to implement a suitable pattern to avoid such problems in the future. To find out which pattern to use, you just have to try to understand the design patterns and their purposes. Only by doing that, you will be able to pick the right one.

Creational :

These design patterns are all about class instantiation or object creation. These patterns can be further categorized into Class-creational patterns and object-creational patterns. While class-creation patterns use inheritance effectively in the instantiation process, object-creation patterns use delegation effectively to get the job done. Creational design patterns are:

Singleton

Factory Method

Abstract Factory

Builder

Prototype

Structural :

These design patterns are about organizing different classes and objects to form larger structures and provide new functionality. Structural design patterns are:

Adapter

Bridge

Composite

Decorator

Facade

Flyweight

Proxy

Behavioral :

Behavioral patterns are about identifying common communication patterns between objects and realizing these patterns. Behavioral design patterns are:

Chain of responsibility

Command

Interpreter

Iterator

Mediator

Memento

Observer

State

Strategy

Template method

Visitor

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.

--

--