Bits of Flutter

#Flutter

11 posts

Layered is not Clean, even with interfaces everywhere

Architecture

Many people think that creating an abstract class, an implementation and injecting the abstraction is already applying the Dependency Inversion Principle. It's not. This post walks through the questions I keep hearing about Clean, layered and DIP, and pins down the one detail that makes the difference.

Read More

BLoC Powered Components

Architecture

Don't make one single BLoC for the whole page. Follow the Single Responsibility Principle and split UI components into small features with their own BLoCs.

Read More

Global UI with Overlays

UI

Ever needed to display a widget above all other content? Flutter's Overlay widget is your secret weapon for custom notifications, persistent tooltips, and truly floating elements.

Read More

Clean UI with Widget Extensions

UI

Extension methods offer a powerful way to encapsulate common UI patterns, making your widget trees much cleaner and more readable. Instead of wrapping every widget, you can chain these extensions for a more fluent API.

Read More

Ghost State in BLoC

State Management

Sometimes your BLoC looks fine, but part of its logic lives outside the state hidden in private fields that never get emitted. That's ghost state. In this post, I show a real example of how it happens, and how to fix it so your state tells the whole story.

Read More

When BLoCs Start Talking Too Much

Architecture

(and how the Mediator Pattern can save you) Sometimes in a Flutter app, one BLoC starts depending on another. Maybe the profile screen needs the current user ID from the AuthBloc. So we inject one BLoC into the other. It works. Until it doesn't.

Read More