Skip to content
CAI
Software that uses CAICheck a score

mkobuolys/flutter-design-patterns

52.9

Weak · 19 September 2026

6.7k

lines of production code

Dart

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a cross-platform Flutter application designed to demonstrate and visualize a comprehensive library of Object-Oriented Design Patterns. It provides interactive UI examples for creational, structural, and behavioral patterns, allowing users to manipulate parameters and observe real-time effects. The app serves as an educational tool by implementing these patterns in concrete scenarios, such as smart home control, shipping calculations, and data parsing, while maintaining a consistent, platform-aware interface across Android, iOS, and Web.

How it got here

2019 — Initial project scaffolding and design pattern implementations

47 changes.

The project was initialized with Flutter infrastructure and core state management, followed by the systematic implementation of various Object-Oriented design patterns. Each pattern, such as Singleton, Adapter, and Strategy, was developed with both backend logic and interactive UI demonstrations to serve as educational examples.

2020 — design pattern implementation examples

33 changes.

This period focused on expanding the design patterns library by adding comprehensive implementations and interactive UI demos for structural, creational, and behavioral patterns. Key additions included the Command, Memento, Prototype, Proxy, Decorator, Bridge, Builder, Flyweight, Chain of Responsibility, and Visitor patterns, each accompanied by concrete Dart code and Flutter widgets to demonstrate their functionality.

2021 — Design patterns library expansion and UI modernization

13 changes.

This period focused on expanding the Flutter design patterns library by adding interactive implementations and demos for the Mediator and Observer patterns. The application underwent significant UI and architectural improvements, including migrating to go\_router for navigation, centralizing constants, and introducing responsive layouts for the main menu and pattern details.

Features

Add Abstract Factory pattern demonstration with platform-specific widget selection

The Abstract Factory design pattern example now includes a new interactive UI that allows users to switch between Material and Cupertino widget factories. The implementation introduces a \FactorySelection\ widget for choosing the active factory and an \AbstractFactoryExample\ stateful widget that dynamically creates and renders platform-specific components (activity indicators, sliders, and switches) based on the user's selection, showcasing how the pattern abstracts UI creation across different design systems.

_lib/widgets/design\_patterns/abstract\factory · high confidence

Add Bridge design pattern demo with storage selection

The Bridge design pattern example now includes a user interface for selecting storage implementations. Users can choose between SQL and file-based storage for both customer and order data via radio buttons, and the application dynamically updates the repositories and data tables based on the selected storage backend.

_lib/widgets/design\patterns/bridge · high confidence

Add Bridge pattern entity models with faker-based data generation

The \lib/design\_patterns/bridge/entities\ directory now includes concrete entity classes (\Customer\, \Order\) and a base class (\EntityBase\) that implement the Bridge design pattern's data structures. These models support JSON serialization/deserialization and utilize the \faker\ package to generate realistic sample data (such as names, emails, and dish lists) for demonstration purposes.

_lib/design\patterns/bridge/entities · high confidence

Add Builder pattern demo for constructing burger configurations

Introduces a new interactive example in the design patterns section that demonstrates the Builder pattern through a burger ordering interface. Users can select from a menu of burger types (Hamburger, Cheeseburger, Big Mac, McChicken) via a dropdown, and the app dynamically constructs the selected burger and displays its formatted price, ingredients, and allergens. This adds a concrete, visual implementation of the Builder pattern to the library's widget examples.

_lib/widgets/design\patterns/builder · high confidence

Add Chain of Responsibility pattern demo with logging UI

The Chain of Responsibility design pattern example now includes a user interface that demonstrates the pattern in action. Users can trigger debug, info, and error log events via platform-specific buttons, and view the resulting formatted log messages in a scrollable column. The implementation uses a \LogBloc\ to manage the stream of log messages and a chain of loggers (\DebugLogger\, \InfoLogger\, \ErrorLogger\) to process them.

_lib/widgets/design\_patterns/chain\_of\responsibility · high confidence

Add Command design pattern example with undo functionality

The Command design pattern example now includes a user interface for executing and undoing shape modifications. Users can change the color, height, and width of a shape via dedicated buttons, with changes reflected in an animated container. An undo button allows reverting the last action, and a history column displays the sequence of executed commands.

_lib/widgets/design\patterns/command · high confidence

Add Customer and CustomerDetails models for Proxy pattern

Introduced the core data models for the Proxy design pattern demonstration: a Customer class that generates a unique ID and name using the faker library, and a CustomerDetails class holding specific attributes like email and hobby. These files establish the subject and proxy structure for this design pattern example.

_lib/design\patterns/proxy/customer · high confidence

Add Interpreter Design Pattern example with postfix expression solver

This location introduces the user-facing UI for the Interpreter design pattern. The \InterpreterExample\ widget displays a scrollable list of postfix expressions, and the \ExpressionSection\ widget allows users to solve each expression individually. Tapping the 'Solve' button triggers the interpreter logic to compute the result and displays the step-by-step solution via an animated cross-fade transition.

_lib/widgets/design\patterns/interpreter · high confidence

Add Iterator design pattern implementation for graph and tree structures

This change introduces the Iterator design pattern within the \lib/design\_patterns/iterator\ location. It adds a \Graph\ class to manage adjacency lists and exports a suite of tree collection and iterator implementations (breadth-first and depth-first) to facilitate traversal of tree structures.

_lib/design\patterns/iterator · high confidence

Add JSON and XML contact adapters

New adapter implementations have been added to parse contact data from JSON and XML sources. The JsonContactsAdapter converts JSON responses into Contact objects using dart:convert, while the XmlContactsAdapter parses XML documents using the xml package to extract contact details. Both adapters implement the IContactsAdapter interface, allowing the application to seamlessly integrate with different data formats.

_lib/design\patterns/adapter/adapters · high confidence

Add Mediator Design Pattern demo with interactive notification hub

This change introduces a new interactive demo for the Mediator design pattern in the Flutter widgets library. The example application features a \NotificationHub\ that manages communication between different team roles (Admin, Developer, Tester). Users can send messages to all members, specific groups (QA or Developers), or individual members, and can dynamically add new team members to the simulation. The UI includes a list displaying the last notification received by each member, allowing users to click on a member card to send a notification from their perspective, demonstrating the decoupled interaction facilitated by the mediator.

_lib/widgets/design\patterns/mediator · high confidence

Add Observer pattern demo with stock ticker UI

A new interactive example demonstrating the Observer design pattern has been added to the design patterns library. The feature introduces a stock ticker interface where users can select different subscriber types and toggle subscriptions for specific stock tickers (GameStop, Google, Tesla). The UI displays real-time stock updates with color-coded indicators for price changes, allowing users to observe how the pattern manages state changes and notifications between subjects and observers.

_lib/widgets/design\patterns/observer · high confidence

Add Observer pattern implementation for stock tickers

This change introduces the Observer design pattern within the \lib/design\_patterns/observer\ directory to manage stock price updates. It defines a \StockTicker\ base class that periodically generates random stock data for GameStop, Google, and Tesla, and notifies registered subscribers when prices change. Subscribers can filter these updates, with implementations provided for receiving all stock changes (\DefaultStockSubscriber\) or only growing stocks (\GrowingStockSubscriber\).

_lib/design\patterns/observer · high confidence

Add Proxy design pattern example with caching

Added a new Proxy design pattern example in the \lib/design\_patterns/proxy\ directory. This includes an interface for customer details, a service implementation that simulates a delayed fetch, and a proxy wrapper that caches results to avoid redundant calls.

_lib/design\patterns/proxy · high confidence

Add Singleton design pattern example

The Singleton design pattern example has been added to the widgets library, introducing a new interactive demo that illustrates singleton state management. The implementation includes a main example widget that displays multiple state cards and provides buttons to update or reset their text values, alongside a dedicated card widget for rendering the state information. This addition allows users to observe how singleton instances persist state across navigation within the application.

_lib/widgets/design\_patterns/flyweight, lib/widgets/design\patterns/singleton · high confidence

Add State design pattern example widget

A new example widget for the State design pattern has been added to the application. This widget demonstrates how to manage state transitions using a StateContext and renders different UI states via a StreamBuilder, providing a concrete implementation of the pattern for users to reference.

_lib/widgets/design\patterns/state · high confidence

Add Strategy Design Pattern demo for shipping options

A new interactive example demonstrates the Strategy design pattern by allowing users to select different shipping methods (In-Store Pickup, Parcel Terminal, Priority) and see the order summary update accordingly. The implementation includes a new ShippingOptions widget for selecting the strategy and a StrategyExample page that orchestrates the order items, selected strategy, and cost calculation.

_lib/widgets/design\patterns/strategy · high confidence

Add Template Method design pattern example for BMI calculation

This change introduces a new Flutter example demonstrating the Template Method design pattern. It adds three new widgets: \TemplateMethodExample\, which serves as the main entry point; \StudentsSection\, which manages the state for calculating BMI and displaying results; and \StudentsDataTable\, which renders the student data in a scrollable table. The example showcases how different data sources (XML, JSON, and filtered JSON) can share the same UI structure while varying the underlying calculation logic through the \StudentsBmiCalculator\ interface.

_lib/widgets/design\_patterns/template\method · high confidence

Add Visitor design pattern example with file export

The Visitor design pattern example now includes a user interface for selecting between different visitor implementations (HumanReadableVisitor and XmlVisitor) and exporting file information. Users can select a visitor type via radio buttons, view a hierarchical media directory structure, and click 'Export files' to see the formatted output in a dialog.

_lib/widgets/design\patterns/visitor · high confidence

Add adapter pattern demo for contacts

The adapter design pattern example now includes UI components to demonstrate fetching contacts from different data sources. A new ContactsSection widget accepts an IContactsAdapter, allowing users to toggle between JSON and XML contact sources via a PlatformButton, with each contact displayed in a ContactCard.

_lib/widgets/design\patterns/adapter · high confidence

Add composite design pattern example for hierarchical file structures

Introduces a new Flutter example demonstrating the composite design pattern, allowing users to visualize and interact with a hierarchical file system. The implementation includes a \Directory\ widget that recursively renders nested files and subdirectories using \ExpansionTile\, supporting various file types (audio, video, image, text) and calculating aggregate folder sizes.

_lib/widgets/design\patterns/composite · high confidence

Add concrete file type implementations for the Visitor pattern

This change introduces specific file type classes (AudioFile, ImageFile, TextFile, and VideoFile) within the visitor design pattern example. Each class extends the base File class, implements the accept method to support the visitor pattern, and includes specific properties relevant to its file type (such as albumTitle for audio or resolution for images). An index file is also added to export these new file types, making them available for use in the visitor pattern demonstration.

_lib/design\patterns/visitor/files · high confidence

Add customer details dialog UI components

The customer details dialog feature now includes the specific UI widgets required to display customer information. A new \CustomerDetailsDialog\ widget presents an \AlertDialog\ that shows a loading spinner while fetching data and displays the customer's name, email, position, and hobby once available. This is supported by \CustomerDetailsColumn\ to arrange the information vertically and \CustomerInfoGroup\ to render individual label-value pairs using the current theme's typography.

_lib/widgets/design\_patterns/proxy/customer\_details\dialog · high confidence

Add data models for design patterns and categories

New data models have been introduced to represent design patterns and their categories, enabling the app to parse and structure this content from JSON sources. The \DesignPattern\ model captures individual pattern details such as ID, title, description, and associated article URL, while the \DesignPatternCategory\ model groups these patterns under a specific category with a title and color, handling the nested deserialization of pattern lists.

lib/data/models · high confidence

Add image viewer, heartbeat animation, and logo button widgets

The \lib/widgets\ directory now includes three new UI components: \ImageView\, which provides a full-screen image viewer with pinch-to-zoom, double-tap to scale, and hero animation support; \HeartbeatAnimation\, a reusable widget that applies a pulsing scale animation to its child; and \LogoButton\, a simple icon button that displays the application logo asset.

lib/widgets · high confidence

Add main menu and design pattern details pages with responsive layouts

The application now includes dedicated navigation pages for the main menu and design pattern details. The main menu page displays a list of design pattern categories, adapting its layout to show cards in a row on desktop screens and a column on smaller devices. The design pattern details page presents information about a specific pattern, switching between a single-page layout and a tabbed layout based on screen width. Both pages utilize Riverpod for state management and handle loading and error states appropriately.

lib/navigation/pages · high confidence

Add order summary UI with strategy-based shipping calculation

A new OrderSummary widget has been added to display the order subtotal, shipping cost, and total. The shipping cost is calculated dynamically using the IShippingCostsStrategy interface, allowing the display to adapt to different shipping strategies. The summary is rendered as a card containing individual rows for each cost component.

_lib/widgets/design\_patterns/strategy/order/order\summary · high confidence

Add smart home mode selection UI with device status icons

The facade example now includes a user interface for selecting smart home modes (Home cinema, Gaming, Streaming) via toggle switches. Activating a mode triggers the corresponding facade methods to control underlying devices, and the UI displays real-time status icons (TV, Netflix, audio, console, camera, lights) using a new DeviceIcon widget that supports both FontAwesome and standard Material icons.

_lib/widgets/design\patterns/facade · high confidence

Add stock subscriber and ticker selection UI components

Introduced two new widgets in the observer design pattern demo: StockSubscriberSelection, which displays a list of subscribers as radio tiles for single-choice selection, and StockTickerSelection, which presents stock tickers as selectable cards that visually indicate subscription status. These components provide the user interface for selecting stock data sources within the application.

_lib/widgets/design\patterns/observer/selections · high confidence

Add web entry point and branding assets

The web location now includes the necessary files to serve the Flutter application, including an index.html with the title 'Flutter Design Patterns', a manifest.json for PWA support, and styles.css to display a welcome screen before the app loads. A CNAME file is also added to map the deployment to flutterdesignpatterns.com.

web · high confidence

Added Abstract Factory implementation for platform-specific widgets

The library now includes a concrete implementation of the Abstract Factory design pattern to generate platform-specific UI components. New files define factories for iOS (Cupertino) and Android (Material) styles, producing matching activity indicators, sliders, and switches. This allows the application to render consistent widget sets that match the user's operating system theme.

_lib/design\_patterns/abstract\factory/widgets · high confidence

Added Abstract Factory pattern implementation for platform-specific widgets

Introduced a new Abstract Factory design pattern implementation in the \lib/design\_patterns/abstract\_factory\ directory. This includes an \IWidgetsFactory\ interface defining the creation of platform-specific UI components (activity indicators, sliders, and switches) and a barrel export file (\abstract\_factory.dart\) that exposes the concrete factory implementations for Cupertino (iOS) and Material (Android) widgets along with their respective interfaces and concrete classes.

_lib/design\_patterns/abstract\factory · high confidence

Added Bridge design pattern example for decoupling abstractions from implementations

This location introduces a concrete implementation of the Bridge design pattern, demonstrating how to decouple an abstraction (repositories) from its implementation (storage backends). The code defines abstract interfaces for repositories (IRepository) and storage (IStorage), along with specific implementations for Customer and Order entities. It includes a JsonHelper utility that uses Dart's switch expressions to handle serialization and deserialization of entity types, and repository classes that delegate data operations to the injected storage implementation, allowing the abstraction and implementation to vary independently.

_lib/design\patterns/bridge · high confidence

Added Builder design pattern implementation for constructing burger products

The \lib/design\_patterns/builder\ directory now contains a complete implementation of the Builder design pattern, introducing a structured way to construct complex burger objects step-by-step. This includes a \Burger\ product class, a \BurgerBuilderBase\ abstract interface, and a \BurgerMaker\ director that orchestrates the construction process. Specific concrete builders are provided for Big Mac, Cheeseburger, Hamburger, and McChicken variants, each defining the unique sequence of ingredients (such as buns, patties, sauces, and vegetables) and associated allergen information. This change adds new library code for demonstrating this creational pattern within the application.

_lib/design\patterns/builder · high confidence

Added Circle and Rectangle shape implementations for the Prototype pattern

The shapes directory now includes concrete implementations for Circle and Rectangle classes that extend the Shape base class. These classes support the Prototype design pattern by providing clone constructors and methods, allowing users to create copies of shape instances. Each shape includes properties for color and dimensions (radius for Circle, height and width for Rectangle), a randomiseProperties method for generating random variations, and a render method that displays the shape as an animated container with a star icon.

_lib/design\patterns/prototype/shapes · high confidence

Added Composite pattern file interface

Introduced the \IFile\ abstract interface within the Composite design pattern library, defining the contract for file components with \getSize\ and \render\ methods.

_lib/design\patterns/composite · high confidence

Added Decorator design pattern example for pizza customization

The library now includes a new example demonstrating the Decorator design pattern using a pizza ordering scenario. This addition introduces core abstractions such as the \Pizza\ interface and \PizzaBase\ class, along with a \PizzaDecorator\ base class to allow toppings to be added dynamically. A \PizzaMenu\ class provides factory methods to construct specific pizza configurations (Margherita, Pepperoni, and Custom) by wrapping the base pizza with various topping decorators, illustrating how behavior can be extended at runtime without modifying the original component.

_lib/design\patterns/decorator · high confidence

Added Facade design pattern implementation for smart home subsystems

This change introduces the Facade design pattern within the \lib/design\_patterns/facade\ directory to simplify interactions with complex smart home subsystems. It adds specific API classes for audio, camera, Netflix, PlayStation, smart home controls, and TV devices, alongside a \SmartHomeState\ class to track device status. The implementation provides \SmartHomeFacade\ and \GamingFacade\ classes that orchestrate these subsystems, allowing users to execute high-level actions like 'startMovie', 'startGaming', and 'startStreaming' which automatically configure the appropriate combination of lights, TV, audio, and gaming equipment.

_lib/design\patterns/facade · high confidence

Added Factory Method design pattern example with dialog selection

This location introduces the user-facing example for the Factory Method design pattern, featuring a new UI that allows users to select between different platform-specific dialog implementations (Android and iOS) via a radio group and trigger the selected dialog with a button.

_lib/widgets/design\_patterns/factory\method · high confidence

Added Interpreter design pattern for postfix expression evaluation

The \lib/design\_patterns/interpreter\ library now provides a complete implementation of the Interpreter pattern, enabling users to parse and evaluate arithmetic expressions given in postfix notation. The package exports an \IExpression\ interface along with concrete terminal and non-terminal nodes for numbers, addition, subtraction, and multiplication. Users can utilize the \ExpressionHelpers.buildExpressionTree\ method to convert a postfix string into an expression tree, which can then be evaluated against an \ExpressionContext\ that tracks the step-by-step solution.

_lib/design\patterns/interpreter · high confidence

Added Iterator design pattern visualization example

A new interactive demo has been added to the design patterns section that visualizes tree traversal using the Iterator pattern. The example allows users to select between breadth-first and depth-first traversal strategies and watch the nodes of a sample graph being visited sequentially with a one-second delay between steps. The UI includes controls to start the traversal, reset the view, and switch between the two collection types, providing a concrete demonstration of how the iterator abstracts the traversal logic from the underlying data structure.

_lib/widgets/design\patterns/iterator · high confidence

Added JSON and XML contact API implementations

New API classes have been introduced to provide contact data in JSON and XML formats. The \JsonContactsApi\ class exposes a method to retrieve contact information as a JSON string, while the \XmlContactsApi\ class provides the same data in XML format. These additions support the adapter design pattern by offering distinct data serialization options for consumers.

_lib/design\patterns/adapter/apis · high confidence

Added Memento and Command pattern implementation files

This change introduces the foundational code for the Memento and Command design patterns within the \lib/design\_patterns/memento/command\_design\_pattern\ directory. It adds \icommand.dart\ defining the \ICommand\ interface with \execute\ and \undo\ methods, \command\_history.dart\ implementing a history stack to manage and undo commands, and \shape.dart\ providing a data class for shape properties (color, height, width) that can be memento'd. These files establish the core structure for tracking and reversing state changes in the application's design pattern examples.

_lib/design\_patterns/memento/command\_design\pattern · high confidence

Added Memento design pattern example with undo functionality

A new interactive example demonstrating the Memento design pattern has been added to the design patterns library. The feature includes a UI widget that displays a shape whose properties can be randomized, along with an 'Undo' button that reverts changes using a command history stack. The implementation consists of a main example stateful widget and a dedicated shape container widget that renders the animated shape.

_lib/widgets/design\patterns/memento · high confidence

Added Memento design pattern implementation

Introduced the Memento design pattern to the library, providing an Originator class that manages state via a Shape object and supports creating and restoring snapshots through IMemento and Memento classes. The module also exports related command design pattern components (commands, history, and interfaces) to facilitate state management workflows.

_lib/design\_patterns/memento, lib/design\patterns/memento/memento · high confidence

Added Prototype design pattern example with shape cloning

A new interactive example demonstrating the Prototype design pattern has been added, allowing users to clone Circle and Rectangle shapes. The UI presents two sections where users can randomize shape properties and create independent clones, visualized via the ShapeColumn component.

_lib/widgets/design\patterns/prototype · high confidence

Added Prototype design pattern implementation for shapes

Introduced a new Prototype design pattern implementation within the design patterns library, providing an abstract Shape base class that defines cloning, property randomization, and rendering capabilities, along with concrete Circle and Rectangle shape implementations.

_lib/design\patterns/prototype · high confidence

Added Proxy design pattern example

A new interactive example demonstrating the Proxy design pattern has been added to the library. The \ProxyExample\ widget displays a scrollable list of customer cards; tapping a card opens a dialog that utilizes a \CustomerDetailsServiceProxy\ to manage access to customer details, illustrating how the proxy controls access to the underlying service.

_lib/widgets/design\patterns/proxy · high confidence

Added RandomisePropertiesCommand for state randomization

A new command implementation, RandomisePropertiesCommand, has been added to the command design pattern. This command allows users to randomize the visual properties (color, height, and width) of an originator's state and supports undo functionality by restoring a previous memento backup.

_lib/design\_patterns/memento/command\_design\pattern/commands · high confidence

Added ShapeColumn widget for prototype pattern demonstration

A new ShapeColumn widget has been introduced to the application, providing a user interface for the prototype design pattern. This component displays both an original shape and its cloned counterpart side-by-side, allowing users to visualize the cloning process. It includes interactive controls labeled 'Randomise properties' and 'Clone', enabling users to modify the original shape's attributes or generate a copy, thereby demonstrating the core functionality of the prototype pattern within the design patterns showcase.

_lib/widgets/design\_patterns/prototype/shape\column · high confidence

Added Template Method pattern implementation for student BMI calculation

This change introduces a new implementation of the Template Method design pattern within the \lib/design\_patterns/template\_method\ directory. It defines an abstract \StudentsBmiCalculator\ base class that orchestrates the BMI calculation workflow (fetching data, filtering, and computing BMI) while allowing subclasses to customize specific steps. Concrete implementations are provided for JSON data sources, including a general calculator and one that filters for teenage students, along with corresponding API classes for JSON and XML data formats.

_lib/design\_patterns/template\method · high confidence

Added XML-based BMI calculator implementation

A new StudentsXmlBmiCalculator class has been introduced to parse student data from XML format. This component implements the template method pattern by extending the base StudentsBmiCalculator and overriding the getStudentsData method to fetch and parse student records (name, age, height, weight) from an XML source using the xml package.

_lib/design\_patterns/template\_method/bmi\calculators/xml · high confidence

Added command implementations for modifying shape properties

New command classes have been introduced to allow users to change the color, width, and height of shapes with undo support. The ChangeColorCommand, ChangeWidthCommand, and ChangeHeightCommand classes implement the Command interface, storing previous state values to enable undo operations and using the faker library to generate random values during execution.

_lib/design\patterns/command/commands · high confidence

Added customer and order data table widgets

Introduced two new Flutter widgets, CustomersDatatable and OrdersDatatable, within the Bridge design pattern example. These components render horizontal scrolling data tables displaying customer names and emails, as well as order dishes and totals, respectively, utilizing the shared bridge model classes.

_lib/widgets/design\_patterns/bridge/data\tables · high confidence

Added file and SQL storage implementations for the Bridge design pattern

Introduced two new storage implementations, FileStorage and SqlStorage, within the Bridge design pattern example. FileStorage manages data by serializing entities to strings and storing them in memory, while SqlStorage stores entity objects directly. Both classes implement the IStorage interface, providing distinct strategies for data persistence within the pattern's abstraction.

_lib/design\patterns/bridge/storages · high confidence

Added human-readable and XML export visitors

Two new visitor implementations have been added to the design pattern library: HumanReadableVisitor, which formats file metadata as indented text, and XmlVisitor, which generates structured XML output. These allow users to export file information in either plain text or XML formats by implementing the IVisitor interface.

_lib/design\patterns/visitor/visitors · high confidence

Added interactive pizza customization example using the Decorator pattern

This change introduces a new interactive demo within the Decorator design pattern section that allows users to select a pizza type (Margherita, Pepperoni, or Custom) and toggle toppings. The implementation includes a main stateful widget orchestrating the selection logic, a radio group for choosing the base pizza, conditional choice chips for adding toppings to custom pizzas, and a details view displaying the pizza description and calculated price, effectively demonstrating how decorators wrap objects to add responsibilities dynamically.

_lib/widgets/design\patterns/decorator · high confidence

Added order items table widget

A new OrderItemsTable widget has been introduced to display order details in a structured format. This component renders a data table showing the title, package size, and price for each item in an order, utilizing the existing OrderItem model and layout constants for consistent styling.

_lib/widgets/design\patterns/strategy/order · high confidence

Added pizza topping decorators to the decorator pattern example

The lib/design\_patterns/decorator/pizza\_toppings directory now includes concrete decorator classes for various pizza toppings (Basil, Mozzarella, Olive Oil, Oregano, Pecorino, Pepperoni, and Sauce). Each class extends the PizzaDecorator base class, overriding getDescription() to append the topping name and getPrice() to add a specific cost (ranging from 0.1 to 1.5) to the underlying pizza. A central pizza\_toppings.dart file exports all these topping modules, making them available for use in the decorator pattern demonstration.

_lib/design\_patterns/decorator/pizza\toppings · high confidence

Added platform-aware order action buttons

Introduced a new widget set for order management actions that adapts to the user's platform. The \OrderButton\ component renders a Material-style button on web and Android, while switching to a Cupertino-style button on iOS, ensuring a native look and feel. These buttons are grouped in \OrderButtons\, which provides 'Add random item' and 'Clear' actions for the order strategy demo.

_lib/widgets/design\_patterns/strategy/order/order\buttons · high confidence

Added platform-specific alert dialog implementations

New files have been added to implement the Factory Method pattern for alert dialogs, providing distinct behaviors for Android and iOS platforms. The Android implementation uses Material Design components, while the iOS implementation uses Cupertino components, allowing the application to present native-looking alert dialogs based on the operating system.

_lib/design\_patterns/factory\_method/alert\dialogs · high confidence

Added platform-specific back button and button widgets

New widgets have been introduced in the platform-specific library to handle UI differences across operating systems. The PlatformBackButton widget now provides a consistent back-navigation experience, using an Android-style arrow on Android and an iOS-style arrow on other platforms, while routing via go\_router. Additionally, the PlatformButton widget renders a Material-style button on Android and Web, and a Cupertino-style button on iOS, allowing the app to adhere to native design guidelines for user interactions.

_lib/widgets/platform\specific · high confidence

Added specific shipping cost calculation strategies

The application now includes concrete implementations for the shipping cost strategy pattern, allowing users to select from three distinct shipping methods: In-store pickup (free), Priority shipping (fixed fee of 9.99), and Parcel terminal shipping (variable fees based on package size: 1.99 for S, 2.49 for M, 2.99 for L, and 3.49 for XL).

_lib/design\patterns/strategy/strategies · high confidence

Added state-specific UI components for the State design pattern

New Flutter widgets have been introduced to represent distinct application states within the State design pattern implementation. The \ErrorState\ displays a red error message, \LoadedState\ renders a list of names in cards, \LoadingState\ shows a progress indicator and handles API transitions, and \NoResultsState\ displays a 'No Results' message. These components allow users to see specific visual feedback corresponding to the current state of the data loading process.

_lib/design\patterns/state/states · high confidence

Added tree collection iterator implementations

New files have been added to the \lib/design\_patterns/iterator/tree\_collections\ directory to support the Iterator design pattern for tree structures. This includes an \ITreeCollection\ interface and concrete implementations for breadth-first (\BreadthFirstTreeCollection\) and depth-first (\DepthFirstTreeCollection\) traversal, allowing users to obtain specific iterators for graph-based tree collections.

_lib/design\_patterns/iterator/tree\collections · high confidence

Added tree iterator implementations

This change introduces the Iterator design pattern for tree structures by adding a new \ITreeIterator\ interface and two concrete implementations: \BreadthFirstIterator\ and \DepthFirstIterator\. These classes allow users to traverse tree collections using breadth-first or depth-first strategies, providing methods to check for remaining nodes, retrieve the next node, and reset the iteration state.

_lib/design\_patterns/iterator/tree\iterators · high confidence

Centralized asset paths and layout spacing constants

The application now provides a unified location for design-time constants, introducing \AssetConstants\ to manage paths for design pattern data and markdown assets, alongside \LayoutConstants\ which defines standardized spacing, margin, and padding values (XS through XL) and responsive breakpoints for consistent UI layout across different screen sizes.

lib/constants · high confidence

Implement Chain of Responsibility logger hierarchy

The library now provides a concrete Chain of Responsibility implementation for logging, introducing three distinct logger handlers: DebugLogger, InfoLogger, and ErrorLogger. Each handler extends a common LoggerBase and is responsible for a specific log level, delegating to external services (such as MailService for errors or ExternalLoggingService for info) while maintaining the chain via a nextLogger property. This structure allows log messages to be processed by the appropriate handler based on severity.

_lib/design\_patterns/chain\_of\responsibility/loggers · high confidence

Initial Android application configuration for Flutter Design Patterns

The Android module for the \flutter\_design\_patterns\ app has been initialized with the standard Flutter V2 embedding structure. This includes the main \AndroidManifest.xml\ declaring the \MainActivity\ and launcher intent, Kotlin-based \MainActivity\ extending \FlutterActivity\, and resource files defining light and dark mode launch themes and splash screens. Debug and profile manifests are also added to grant internet access for development tools.

android/app · high confidence

Initial iOS project scaffolding for Flutter Runner

The iOS native project has been initialized with the standard Flutter Runner structure. This includes the Xcode project configuration, workspace settings, and build schemes required to build the app. The minimum deployment target is set to iOS 11.0, and the app bundle is configured to support iPhone and iPad orientations. The entry point uses a Swift AppDelegate that registers plugins, and the UI is driven by standard Flutter storyboards.

ios · high confidence

Initial release of Flutter Design Patterns application

This entry marks the initial commit of the Flutter Design Patterns project, introducing the core application structure and configuration. The release includes the main README with build instructions and deployment badges, a \.gitignore\ tailored for Flutter/Dart/Android/iOS development, and an \analysis\_options.yaml\ file that enforces code style using the \lint\ package. It also establishes the \.metadata\ file for Flutter tooling and migration tracking, setting the foundation for the open-source OOP design patterns implementation.

(repo-wide) · high confidence

Introduce Adapter design pattern for contacts

Added the core structure for the Adapter design pattern in the contacts domain, including a Contact model, an IContactsAdapter interface, and a barrel file exporting the adapter and API implementations (JSON and XML).

_lib/design\patterns/adapter · high confidence

Introduce Chain of Responsibility logging pattern with Riverpod-ready architecture

This change adds the Chain of Responsibility design pattern implementation for logging, providing a structured way to handle log messages across different levels (debug, info, error). The core logic is implemented in \LoggerBase\ and its subclasses, allowing log messages to be passed along a chain of handlers. A \LogBloc\ manages the state and stream of log messages, while \LogMessage\ and \LogLevel\ define the data structures. The implementation includes services like \ExternalLoggingService\ and \MailService\ to demonstrate how external logging and error reporting can be integrated into the chain. This structure is designed to be compatible with Riverpod for state management, as indicated by the \LogBloc\ and the commit message mentioning Riverpod.

_lib/design\_patterns/chain\_of\responsibility · high confidence

Introduce Command design pattern implementation for shape manipulation

This location adds the core infrastructure for the Command design pattern, allowing users to execute and undo shape modifications. It defines the \Command\ interface with \execute\, \getTitle\, and \undo\ methods, alongside a \CommandHistory\ class that manages a queue of commands to support undo operations. Specific implementations for changing shape color, height, and width are included, along with a \Shape\ model class to hold the mutable state (color, height, width) that these commands operate on.

_lib/design\patterns/command · high confidence

Introduce Flyweight design pattern for rendering shapes

Added a new implementation of the Flyweight design pattern within the design patterns library to efficiently manage and render geometric shapes. The change introduces a \ShapeFlyweightFactory\ that caches shared shape instances (currently supporting \Circle\ and \Square\ via \ShapeType\) to minimize memory usage, alongside concrete shape classes that implement an \IPositionedShape\ interface for rendering widgets at specific coordinates.

_lib/design\patterns/flyweight · high confidence

Introduce Mediator design pattern for team notifications

Added a new implementation of the Mediator design pattern in \lib/design\_patterns/mediator\ to manage team communications. This includes a \NotificationHub\ interface and \TeamNotificationHub\ implementation that centralizes message routing, allowing \TeamMember\ instances (such as \Admin\, \Developer\, and \Tester\) to send general or type-specific notifications without direct coupling.

_lib/design\patterns/mediator · high confidence

Introduce Order and OrderItem models for the Strategy pattern

Added the core data models for the strategy design pattern example: an Order class that manages a list of OrderItems and calculates the total price, and an OrderItem class that holds title, price, and package size details. The package size is defined by a new PackageSize enum (S, M, L, XL). OrderItem includes a factory constructor to generate random instances for demonstration purposes, relying on the faker package.

_lib/design\patterns/strategy/order · high confidence

Introduce Singleton design pattern examples in Dart

Added a new set of Dart files under \lib/design\_patterns/singleton\ that demonstrate the Singleton pattern. The implementation includes a base class (\ExampleStateBase\) defining shared state and behavior, alongside three concrete variations: a standard singleton using a private constructor and factory method (\ExampleState\), a singleton implemented via a static getter (\ExampleStateByDefinition\), and a non-singleton class (\ExampleStateWithoutSingleton\) for comparison. These files are exported via a central \singleton.dart\ library file.

_lib/design\patterns/singleton · high confidence

Introduce State design pattern implementation with reactive context

Added a new implementation of the State design pattern in the \lib/design\_patterns/state\ directory. This includes a \StateContext\ class that manages state transitions via a stream, an \IState\ interface defining state behavior, and specific state classes (\LoadingState\, \NoResultsState\, \ErrorState\, \LoadedState\) to represent different UI states. A \FakeApi\ class was also added to simulate asynchronous data fetching for demonstration purposes.

_lib/design\patterns/state · high confidence

Introduce Strategy design pattern for shipping cost calculation

Added a new Strategy design pattern implementation in the \lib/design\_patterns/strategy\ directory to handle shipping cost calculations. This includes an \IShippingCostsStrategy\ interface and concrete strategies for in-store pickup, parcel terminal shipping, and priority shipping, along with supporting order and package size models.

_lib/design\patterns/strategy · high confidence

Introduce Visitor design pattern for file system traversal

Added a new implementation of the Visitor design pattern within the \lib/design\_patterns/visitor\ directory. This change introduces a file system model (\IFile\, \Directory\, \File\) that supports traversal via visitors, enabling distinct operations such as generating human-readable text or XML representations without modifying the file classes themselves.

_lib/design\patterns/visitor · high confidence

Introduce typed file components for the Composite design pattern

The \lib/widgets/design\_patterns/composite/files\ directory now contains specific widget implementations for different file types. A new base \File\ widget renders file details (title, size, icon) as a ListTile, and four concrete subclasses—\AudioFile\, \ImageFile\, \TextFile\, and \VideoFile\—extend this base to provide type-specific icons. This change establishes the leaf nodes of the Composite pattern within this location.

_lib/widgets/design\patterns/composite/files · high confidence

Introduces Factory Method pattern implementation for platform-specific dialogs

This change adds the core structure for the Factory Method design pattern within the application. It introduces an abstract \CustomDialog\ class that defines the interface for creating dialog widgets and displaying them, alongside a main library file that exports the specific Android and iOS alert dialog implementations. This provides a standardized way to present platform-appropriate dialogs to the user.

_lib/design\_patterns/factory\method · high confidence

New centralized factory for design pattern examples

The design patterns library now includes a centralized factory (DesignPatternsFactory) that instantiates specific design pattern example widgets based on a string identifier. This allows consumers to dynamically load any of the 22 supported pattern examples (such as Abstract Factory, Observer, Strategy, etc.) by ID, with the factory throwing a specific exception if an unknown ID is provided.

_lib/widgets/design\patterns · high confidence

New design pattern detail view widgets

Added new widgets for the design pattern details screen: DetailsAppBar provides a platform-aware header with a 'Read blog post' action, ExampleView renders specific pattern examples via a factory, and MarkdownView displays pattern descriptions with rich formatting, syntax highlighting for code blocks, and interactive image previews.

_lib/modules/design\_pattern\details/widgets · high confidence

New helper utilities for syntax highlighting, file sizes, and URL launching

The app now includes a dedicated set of helper utilities in lib/helpers. A new DartSyntaxHighlighter provides custom syntax highlighting for Dart code blocks within Markdown content, using a specific color theme. A FileSizeConverter allows users to view file sizes in human-readable formats (B, KB, MB, etc.). Additionally, a UrlLauncher class centralizes URL launching logic, providing specific shortcuts for personal and blog pages while handling parsing errors via a custom UrlLauncherException. New list and string formatting extensions are also available for internal use.

lib/helpers · high confidence

Behavioural changes

Add single-page and tabbed layouts for design pattern details

The design pattern details view now supports two distinct layout modes: a single-page layout that displays the description and example side-by-side, and a tabbed layout that separates them into 'Description' and 'Example' tabs accessible via a bottom navigation bar. These new layout widgets replace previous implementations, allowing users to choose their preferred viewing style for design pattern information.

_lib/modules/design\_pattern\details/layouts · high confidence

App initialization and UI configuration updated

The application entry point now uses \usePathUrlStrategy()\ for URL handling and initializes the UI with \ProviderScope\ to support Riverpod state management. The app widget is configured to use a new \go\_router\ instance for navigation and applies a custom light theme defined in \themes.dart\, which specifies typography using the Roboto font family and Material 2021 standards.

lib · high confidence

Introduce Riverpod-based repositories for design patterns and markdown content

New repository implementations for design pattern categories and markdown content have been added to the data layer, utilizing Riverpod for state management and dependency injection. The \DesignPatternCategoriesRepository\ now loads category and pattern data from a JSON asset, exposing providers to fetch the full list or a specific pattern by ID. Similarly, the \MarkdownRepository\ provides a provider to load markdown content by ID from asset files. These changes replace previous data access patterns with a reactive, provider-driven approach, enabling components to subscribe to data changes and handle loading states more effectively.

lib/data/repositories · high confidence

Migrate navigation to go\_router with platform-specific transitions

The app's navigation system has been replaced with go\_router, introducing a declarative routing structure for the main menu and design pattern details pages. This change adds a fade transition effect for page changes on web platforms, while native platforms continue to use standard material transitions. The router configuration is now managed via Riverpod for dependency injection.

lib/navigation · high confidence

Redesigned main menu with responsive card and header widgets

The main menu interface has been updated to provide a distinct visual experience based on the device type. On desktop screens, categories are displayed in scrollable cards, while mobile screens use expandable tiles for the same content. The header now features a responsive layout that centers content on larger screens and aligns it to the start on smaller ones, including a dedicated logo button and an animated heart icon.

_lib/modules/main\menu · high confidence

Dependencies

Added Gradle wrapper configuration for version 6.7

The project now includes a Gradle wrapper properties file that configures the build system to use Gradle version 6.7. This ensures that all developers and CI environments use a consistent, reproducible version of the Gradle build tool, eliminating potential discrepancies caused by locally installed versions.

android/gradle · high confidence

Initial project setup with Flutter 3.41.5 and modern dependency stack

The project is initialized with a new configuration targeting Flutter SDK version 3.41.5 and Dart SDK 3.11.1. The dependency stack includes go\_router (v17.1.0) for navigation, flutter\_riverpod (v3.3.1) for state management, and flutter\_markdown\_plus (v1.0.7) for content rendering. Android build infrastructure is configured with Gradle 4.1.0 and Kotlin 1.6.10, while iOS is set to support iOS 11.0. The app also integrates font\_awesome\_flutter, url\_launcher, and xml parsing libraries, along with dev dependencies for code generation (riverpod\_generator, go\_router\_builder) and linting.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 53.

Lenses

  • Code Health 99
  • Architecture 98
  • Maturity 48
  • Readiness 39
  • Security 61
  • Domain Modelling 100

Changes since last survey

  • 284 commits — 275 feature/other, 9 fixes

By area

  • lib/design_patterns — 77 commits
  • (repo) — 40 commits
  • assets/markdown — 39 commits
  • lib/widgets — 36 commits
  • assets/images — 23 commits
  • (root) — 19 commits
  • assets/data — 8 commits
  • lib/modules — 7 commits
  • lib/pages — 7 commits
  • .github/workflows — 5 commits
  • android/app — 5 commits
  • lib/helpers — 4 commits
  • lib/data — 3 commits
  • lib/navigation — 2 commits
  • web/index.html — 2 commits
  • .github/dependabot.yml — 1 commit
  • android/build.gradle — 1 commit
  • android/gradle.properties — 1 commit
  • ios/Runner — 1 commit
  • ios/Runner.xcodeproj — 1 commit

Notable commits

  • fix: Added markdown, bug fix in DesignPatternDetails widget
  • fix: Enable web, fix Platform issues to run app in web
  • fix: Fix icon issue for platform back button
  • fix: Fix some examples
  • fix: Lint fixes, ios adjustments
  • fix: Recreate Android project, fix unnecessary repaint issue.
  • fix: Refactor code, fix some lint issues
  • fix: Revert "chore: create and update android project"
  • fix: bump auto_route, flutter_riverpod, auto_route_generator and fixed breaking changes
  • change: Add .fvm to .gitignore
  • change: Add Chain of Responsibility images to the assets config
  • change: Add Observer class diagrams
  • change: Add Observer info to the markdown file
  • change: Add URL to README
  • change: Add a skeleton readme file for the flyweight design pattern
  • change: Add auto_route, rework code
  • change: Add deployment status badge
  • change: Add design patterns link to README
  • change: Add flyweight assets to pubspec config
  • change: Add flyweight design pattern
  • …and 264 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

mkobuolys/flutter-design-patterns was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit a4e7f177110b65ec143be5792cfd94a08e46b7a0 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.