Skip to content
Go back

Flutter in 2025: Forget MVVM, Embrace Fine-Grained Reactivity with Solid

Edit page

Hi there!

A while ago I read this article about SwiftUI, which is called SwiftUI in 2025: Forget MVVM and I asked myself, “Why can’t we do the same in Flutter?”.

Solid is a small framework built on top of Flutter that makes creating apps easier and more enjoyable.

Forget about manual state management, ChangeNotifiers, ValueNotifiers, StreamBuilder, FutureBuilder and all that boring stuff.

With Solid, you can create responsive components with a simple and intuitive syntax, similar to SwiftUI.

Here is a simple example of a counter app using Solid:

import 'package:flutter/material.dart';
import 'package:solid_annotations/solid_annotations.dart';

class Counter extends StatelessWidget {
  Counter({super.key});

  @SolidState()
  int counter = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Text('Date: ${DateTime.now()}'),
            Text('Counter is $counter'),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () => counter++,
        child: const Icon(Icons.add),
      ),
    );
  }
}

You get this result, with real fine-grained reactivity: Demo of Solid fine-grained reactivity

As you can see, the DateTime.now() text does not update when the counter changes, only the Counter is X text updates. This is because Solid tracks which parts of the UI depend on which state, and only updates those parts when the state changes, without any manual work from you.

Why I don’t need MVVM anymore

Your widgets are the most important part in Solid. They are the heart of your app, and they can hold state directly.

This means you don’t need to create separate ViewModel classes to manage state.

With Solid, you can keep your state and UI logic together in the same place, making your code easier to read and maintain.

In addition, with @SolidEnvironment you can easily share state between widgets without the need for complex dependency injection frameworks. For example you can have the following Counter class:

class Counter {
  @SolidState()
  int value = 0;
}

and, after providing it from a parent widget, you can access it in any child widget like this:

class MyWidget extends StatelessWidget {
  MyWidget({super.key});

  @SolidEnvironment()
  late Counter counter;

  @override
  Widget build(BuildContext context) {
    return Text('Counter is ${counter.value}');
  }
}

Think a bit about how much boilerplate code and complexity you can eliminate from your Flutter apps by using Solid.


If this sounds interesting, check out the Getting Started Guide to learn how to set up Solid in your Flutter project!


Edit page
Share this post on:

Next Post
Cleanup Mac for Devs and Dart/Flutter Projects